fdo#60740: Handle empty paragraphs correctly.

Change-Id: I47d4f60daec82d2b6a4b5e8f20b8cb6484c55057
This commit is contained in:
Kohei Yoshida
2013-08-25 00:07:45 -04:00
parent 882bee5ede
commit d81b56c7f6
2 changed files with 7 additions and 3 deletions

View File

@@ -902,6 +902,13 @@ void EditTextObjectImpl::GetAllSectionAttributes( std::vector<editeng::SectionAt
{
size_t nPara = distance(aParaBorders.begin(), it);
const SectionBordersType& rBorders = *it;
if (rBorders.size() == 1 && rBorders[0] == 0)
{
// Empty paragraph. Push an empty section.
aAttrs.push_back(editeng::SectionAttribute(nPara, 0, 0));
continue;
}
SectionBordersType::const_iterator itBorder = rBorders.begin(), itBorderEnd = rBorders.end();
size_t nPrev = *itBorder;
size_t nCur;

View File

@@ -3067,9 +3067,6 @@ void flushParagraph(
const ScXMLEditAttributeMap& rAttrMap,
std::vector<editeng::SectionAttribute>::const_iterator it, std::vector<editeng::SectionAttribute>::const_iterator itEnd )
{
if (it == itEnd)
return;
OUString aElemName = rExport.GetNamespaceMap().GetQNameByKey(
XML_NAMESPACE_TEXT, GetXMLToken(XML_P));
SvXMLElementExport aElemP(rExport, aElemName, false, false);