summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-09-20 17:45:14 +0200
committerAndras Timar <andras.timar@collabora.com>2017-09-26 10:36:36 +0200
commit2c0b882fdb640cf96f56eaced234792916a52c90 (patch)
tree2eea05bd6d85cfb4636a4e43f27461a59a2e29ba /xmloff
parentc87e63fdb084dfff44c765993680fe343050ee88 (diff)
tdf#112005 xmloff: ODF export: export embedded object text *first*
... before adding any attributes, so that the attributes don't erroneously get added to the paragraph element. Also fix the problem that if you set "ODF format version" to 1.1 or 1.2, export asserts in SvXMLNamespaceMap::GetQNameByKey() because the "loext" namespace isn't registered, and creates an invalid <p> element. Change-Id: I637f9d3ff746d877ced480e35ef53f4545a06a4b (cherry picked from commit 86f256596c8566e80993e1cf6035bc3534b6f816) Reviewed-on: https://gerrit.libreoffice.org/42569 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 65c99825ceb08743a70b6e598f65491a67d9a884)
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/shapeexport.cxx22
1 files changed, 15 insertions, 7 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 6d8f0185c249..e4ec98689841 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -1514,6 +1514,13 @@ bool XMLShapeExport::ImpExportPresentationAttributes( const uno::Reference< bean
void XMLShapeExport::ImpExportText( const uno::Reference< drawing::XShape >& xShape, TextPNS eExtensionNS )
{
+ if (eExtensionNS == TextPNS::EXTENSION)
+ {
+ if (mrExport.getDefaultVersion() <= SvtSaveOptions::ODFVER_012)
+ {
+ return; // do not export to ODF 1.1/1.2
+ }
+ }
uno::Reference< text::XText > xText( xShape, uno::UNO_QUERY );
if( xText.is() )
{
@@ -2780,6 +2787,14 @@ void XMLShapeExport::ImpExportOLE2Shape(
if( !bIsEmptyPresObj || bSaveBackwardsCompatible )
{
+ // tdf#112005 export text *before* adding any attributes
+ if (!bIsEmptyPresObj && supportsText(eShapeType))
+ {
+ // #i118485# Add text export, the draw OLE shape allows text now
+ // fdo#58571 chart objects don't allow text:p
+ ImpExportText( xShape, TextPNS::EXTENSION );
+ }
+
if (pAttrList)
{
mrExport.AddAttributeList(pAttrList);
@@ -2815,13 +2830,6 @@ void XMLShapeExport::ImpExportOLE2Shape(
if( !sClassId.isEmpty() )
mrExport.AddAttribute(XML_NAMESPACE_DRAW, XML_CLASS_ID, sClassId );
- if(supportsText(eShapeType))
- {
- // #i118485# Add text export, the draw OLE shape allows text now
- // fdo#58571 chart objects don't allow text:p
- ImpExportText( xShape, TextPNS::EXTENSION );
- }
-
if(!bExportEmbedded)
{
// xlink:href