summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-09-18 11:47:56 +0200
committerCaolán McNamara <caolanm@redhat.com>2020-09-21 13:15:04 +0200
commitc54d697e2ac379d4b1a3ff5acb6f06bff30cadd6 (patch)
tree82fb44ee738e85d75f62372fdcbc0cb095069151 /oox
parent88084ceca708a343fc79249f91eb9de34d26b3e9 (diff)
tdf#136620 tdf#136708 filter,oox,sw: fix export of 2 different wraps
This reverts commit 2cb90a5c87fe46737c8d840967d8836284f92ffd. Revert the change to EscherPropertyContainer, which was completely bogus, based on pre-existing bogus code in VMLExport::Commit(). The problem is that ESCHER_Wrap values are for wrapping text *inside* a text box, which is "mso-wrap-style" in VML, whereas VML's w10:wrap element defines how text wraps *around* a shape, doesn't exist as an ESCHER property and is specific to Word formats. Instead, export the w10:wrap element in VMLExport::EndShape(). This has 2 callers, WriteActiveXControl() and writeVMLDrawing(). Furthermore the value "none" wasn't written for WrapTextMode_THROUGH, which caused the wrap element to be omitted in that case. Change-Id: Id4a01fcb2ea73fa9bef4ee8769b5e0680e059f15 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103009 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit fdc8590032b292dcb8152b328401e591fea642a4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103090 Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/export/vmlexport.cxx22
1 files changed, 18 insertions, 4 deletions
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index 79733db5ced0..54eba8b7ee1e 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -421,11 +421,15 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
case ESCHER_WrapSquare:
case ESCHER_WrapByPoints: pWrapType = "square"; break; // these two are equivalent according to the docu
case ESCHER_WrapNone: pWrapType = "none"; break;
- case ESCHER_WrapTopBottom: pWrapType = "topAndBottom"; break;
- case ESCHER_WrapThrough: pWrapType = "through"; break;
+ case ESCHER_WrapTopBottom:
+ case ESCHER_WrapThrough:
+ break; // last two are *undefined* in MS-ODRAW, don't exist in VML
}
if ( pWrapType )
- m_pSerializer->singleElementNS(XML_w10, XML_wrap, XML_type, pWrapType);
+ {
+ m_ShapeStyle.append(";mso-wrap-style:");
+ m_ShapeStyle.append(pWrapType);
+ }
}
bAlreadyWritten[ ESCHER_Prop_WrapText ] = true;
break;
@@ -1478,17 +1482,26 @@ void VMLExport::EndShape( sal_Int32 nShapeElement )
m_pSerializer->endElementNS(XML_v, XML_textbox);
}
+ if (m_pWrapAttrList)
+ {
+ sax_fastparser::XFastAttributeListRef const pWrapAttrList(m_pWrapAttrList.release());
+ m_pSerializer->singleElementNS(XML_w10, XML_wrap, pWrapAttrList);
+ }
+
// end of the shape
m_pSerializer->endElementNS( XML_v, nShapeElement );
}
-OString const & VMLExport::AddSdrObject( const SdrObject& rObj, sal_Int16 eHOri, sal_Int16 eVOri, sal_Int16 eHRel, sal_Int16 eVRel, const bool bOOxmlExport )
+OString const & VMLExport::AddSdrObject( const SdrObject& rObj, sal_Int16 eHOri, sal_Int16 eVOri, sal_Int16 eHRel, sal_Int16 eVRel,
+ std::unique_ptr<FastAttributeList> pWrapAttrList,
+ const bool bOOxmlExport )
{
m_pSdrObject = &rObj;
m_eHOri = eHOri;
m_eVOri = eVOri;
m_eHRel = eHRel;
m_eVRel = eVRel;
+ m_pWrapAttrList = std::move(pWrapAttrList);
m_bInline = false;
EscherEx::AddSdrObject(rObj, bOOxmlExport);
return m_sShapeId;
@@ -1501,6 +1514,7 @@ OString const & VMLExport::AddInlineSdrObject( const SdrObject& rObj, const bool
m_eVOri = -1;
m_eHRel = -1;
m_eVRel = -1;
+ m_pWrapAttrList.reset();
m_bInline = true;
EscherEx::AddSdrObject(rObj, bOOxmlExport);
return m_sShapeId;