summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-04-22 14:10:38 +0100
committerAndras Timar <andras.timar@collabora.com>2015-06-03 15:13:03 +0200
commit9149e38a06df18a7a894a8180862415797bbe263 (patch)
tree59010a8a37d6bdf974403f6db349d084a1b99df0 /xmloff
parent2590070e370aef29aa8ec517fd3d23b48808361c (diff)
fix assert on export of ooo63141-1.doc to odt
if bAutoStyles is true then the mbDoSomething of the SvXMLElementExport is false, and the ctor/dtor doesn't do anything so any attributes added to the exporter are not cleared by the SvXMLElementExport dtor so only add the attribute if bAutoStyles if false and might as well extend the block to cover the use of SvXMLElementExport and use the other ctor which defaults mbDoSomething on Change-Id: If35cd35e902372562fd7e78b3f970d91fcec3c16 (cherry picked from commit bd75327c8bc1157036ca11db8c808dc7ceb2109e) Reviewed-on: https://gerrit.libreoffice.org/16053 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/text/txtparae.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index cdc468cdc57e..5da84e001c49 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -2208,13 +2208,16 @@ void XMLTextParagraphExport::exportTextRangeEnumeration(
}
else if ( sType.equals( sAnnotationEnd ) )
{
- Reference<XNamed> xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
- const OUString& rName = xBookmark->getName();
- if ( rName.getLength() > 0 )
+ if (!bAutoStyles)
{
- GetExport().AddAttribute(XML_NAMESPACE_OFFICE, XML_NAME, rName);
+ Reference<XNamed> xBookmark(xPropSet->getPropertyValue(sBookmark), UNO_QUERY);
+ const OUString& rName = xBookmark->getName();
+ if (!rName.isEmpty())
+ {
+ GetExport().AddAttribute(XML_NAMESPACE_OFFICE, XML_NAME, rName);
+ }
+ SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_OFFICE, XML_ANNOTATION_END, false, false );
}
- SvXMLElementExport aElem( GetExport(), !bAutoStyles, XML_NAMESPACE_OFFICE, XML_ANNOTATION_END, false, false );
}
else if( sType.equals( sFrame ) )
{