summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-08-07 15:26:48 +0200
committerMichael Stahl <michael.stahl@cib.de>2020-08-07 18:25:31 +0200
commit2cb90a5c87fe46737c8d840967d8836284f92ffd (patch)
treeeda6fd4cc5635791fdd0a278d77a1ab2e108fa31
parent1a13804092f93dd77b081ea063856d9896838a51 (diff)
filter: MSO export: convert TextWrap property to Escher_Wrap*
There's a paucity of working wrapping modes in Escher unfortunately. Change-Id: Ibaf99c3249a6492dc129f9c9b5707778038f9a4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100331 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de>
-rw-r--r--filter/source/msfilter/escherex.cxx20
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport15.cxx2
2 files changed, 22 insertions, 0 deletions
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index d851e9f6723d..2dabfa2014d5 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -61,6 +61,7 @@
#include <com/sun/star/drawing/FlagSequence.hpp>
#include <com/sun/star/drawing/PolygonFlags.hpp>
#include <com/sun/star/text/WritingMode.hpp>
+#include <com/sun/star/text/WrapTextMode.hpp>
#include <com/sun/star/drawing/TextVerticalAdjust.hpp>
#include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
@@ -691,6 +692,10 @@ void EscherPropertyContainer::CreateTextProperties(
bool bWordWrap ( false );
bool bAutoGrowSize ( false );
+ uno::Any aTextWrap;
+
+ EscherPropertyValueHelper::GetPropertyValue(aTextWrap, rXPropSet, "TextWrap", true);
+
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "TextWritingMode", true ) )
aAny >>= eWM;
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, rXPropSet, "TextVerticalAdjust", true ) )
@@ -829,6 +834,21 @@ void EscherPropertyContainer::CreateTextProperties(
nTextAttr |= 0x20002;
}
}
+
+ if (aTextWrap.hasValue())
+ { // explicit text wrap overrides whatever was inferred previously
+ switch (aTextWrap.get<text::WrapTextMode>())
+ {
+ case text::WrapTextMode_THROUGH:
+ eWrapMode = ESCHER_WrapNone;
+ break;
+ // in theory there are 3 more Escher_Wrap, but [MS-ODRAW] says they are useless
+ default:
+ eWrapMode = ESCHER_WrapSquare;
+ break;
+ }
+ }
+
AddOpt( ESCHER_Prop_dxTextLeft, nLeft * 360 );
AddOpt( ESCHER_Prop_dxTextRight, nRight * 360 );
AddOpt( ESCHER_Prop_dyTextTop, nTop * 360 );
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
index 4e0bcad21fc7..9643439d1f69 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
@@ -279,6 +279,8 @@ DECLARE_OOXMLEXPORT_TEST(testAtPageShapeRelOrientation, "rotated_shape.fodt")
// now test text rotation -> VML writing direction
assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape/v:textbox", "style", "mso-layout-flow-alt:bottom-to-top");
+ // text wrap -> VML
+ assertXPath(pXmlDocument, "/w:document/w:body/w:p/w:r/mc:AlternateContent[1]/mc:Fallback/w:pict/v:shape/w10:wrap", "type", "none");
}