diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-09-18 11:47:56 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-09-21 11:02:20 +0200 |
commit | fdc8590032b292dcb8152b328401e591fea642a4 (patch) | |
tree | c3951fc48c92f69c4c38e3dc2291904d9d4ff94d /oox | |
parent | 54bd2266d6e0c8926ecaf0fbb2dbb5ee9d1a802d (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>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/vmlexport.cxx | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index dea03c552cee..b5cc2152acda 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; @@ -1484,17 +1488,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; @@ -1507,6 +1520,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; |