summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-08-07 15:26:48 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2020-08-10 13:27:35 +0200
commit2eb4fe77fa7d8e7e2154f9807e1eed0076e1d7e2 (patch)
tree0fb47d91f2f0baede677b1e61f750eb4a51a5d5a /filter
parent09be57965fbdc291a25c4f48550f467b43a7177c (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> (cherry picked from commit 2cb90a5c87fe46737c8d840967d8836284f92ffd) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100353 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/escherex.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 443d533ecadb..8bf8c779af64 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>
@@ -692,6 +693,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 ) )
@@ -830,6 +835,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 );