diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2019-06-24 15:23:44 +0200 |
---|---|---|
committer | Regina Henschel <rb.henschel@t-online.de> | 2019-06-26 18:37:07 +0200 |
commit | e7c0bc4811029abca878343dcce8057f9d3b7053 (patch) | |
tree | 751a5fc63d2e792f56143b64d8310c09c25d6b3c /oox/source/export | |
parent | 43e917a3912121f046495f9df3b2ca2b21a624db (diff) |
tdf#125573 Scale text to path for TextWarp, use fromWordArt
LO uses not exactly the algorithm from DrawingML for Warp, but using
'ScaleX=false' gives similar results. MS Office uses scaling to path
too for legacy shapes from category 'Follow Path', which were
imported from binary ppt. It sets attribute 'fromWordArt' in that
cases. This attribute is now interpreted on import and generated on
export. Only in case of new 'Follow Path' shapes, the text is not
scaled. 'ScaleX=true' is used in that case.
Change-Id: I6fbc02eda436ef3bbc44783a16d79ce4bcd66f29
Reviewed-on: https://gerrit.libreoffice.org/74644
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'oox/source/export')
-rw-r--r-- | oox/source/export/drawingml.cxx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index e81c9026df9b..11d900e28794 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -2584,7 +2584,9 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin } } - Sequence<drawing::EnhancedCustomShapeAdjustmentValue>aAdjustmentSeq; + Sequence<drawing::EnhancedCustomShapeAdjustmentValue> aAdjustmentSeq; + uno::Sequence<beans::PropertyValue> aTextPathSeq; + bool bScaleX(false); if (GetProperty(rXPropSet, "CustomShapeGeometry")) { @@ -2610,10 +2612,23 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin } else if (aProps[i].Name == "AdjustmentValues") aProps[i].Value >>= aAdjustmentSeq; + else if (aProps[i].Name == "TextPath") + { + aProps[i].Value >>= aTextPathSeq; + for (int k = 0; k < aTextPathSeq.getLength(); k++) + { + if (aTextPathSeq[k].Name == "ScaleX") + aTextPathSeq[k].Value >>= bScaleX; + } + } } } } + bool bFromWordArt = !bScaleX + && ( presetWarp == "textArchDown" || presetWarp == "textArchUp" + || presetWarp == "textButton" || presetWarp == "textCircle"); + TextHorizontalAdjust eHorizontalAlignment( TextHorizontalAdjust_CENTER ); bool bHorizontalCenter = false; if (GetProperty(rXPropSet, "TextHorizontalAdjust")) @@ -2646,6 +2661,7 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin } mpFS->startElementNS( (nXmlNamespace ? nXmlNamespace : XML_a), XML_bodyPr, XML_wrap, pWrap, + XML_fromWordArt, bFromWordArt ? "1" : nullptr, XML_lIns, (nLeft != DEFLRINS) ? OString::number(oox::drawingml::convertHmmToEmu(nLeft)).getStr() : nullptr, XML_rIns, (nRight != DEFLRINS) ? OString::number(oox::drawingml::convertHmmToEmu(nRight)).getStr() : nullptr, XML_tIns, (nTop != DEFTBINS) ? OString::number(oox::drawingml::convertHmmToEmu(nTop)).getStr() : nullptr, |