Kaydet (Commit) e8b661dd authored tarafından Miklos Vajna's avatar Miklos Vajna

n#793262 fix DOCX import of last empty header/footer para char props

At the end of the header/footer import, the last empty paragraph was
removed. In case the last but one paragraph was empty, but had character
properties (e.g. a custom font size), the removal changed these, and
used the character properties of the last paragraph instead.

Simply dispose the last paragraph, this way character properties are
always kept.
üst 2f3749ef
......@@ -278,9 +278,22 @@ void DomainMapper_Impl::RemoveLastParagraph( )
}
else
xCursor.set(m_aTextAppendStack.top().xCursor, uno::UNO_QUERY);
uno::Reference<container::XEnumerationAccess> xEnumerationAccess(xCursor, uno::UNO_QUERY);
// Keep the character properties of the last but one paragraph, even if
// it's empty. This works for headers/footers, and maybe in other cases
// as well, but surely not in textboxes.
if (m_bInHeaderFooterImport && xEnumerationAccess.is())
{
uno::Reference<container::XEnumeration> xEnumeration = xEnumerationAccess->createEnumeration();
uno::Reference<lang::XComponent> xParagraph(xEnumeration->nextElement(), uno::UNO_QUERY);
xParagraph->dispose();
}
else
{
xCursor->goLeft( 1, true );
xCursor->setString(OUString());
}
}
catch( const uno::Exception& )
{
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment