diff options
author | Daniel Arato (NISZ) <arato.daniel@nisz.hu> | 2020-09-09 13:37:03 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-09-16 15:16:53 +0200 |
commit | 17984bf6a57b2c445c2fb9a748e90a74981fcdc8 (patch) | |
tree | 74dcd718ca05e385548a31c4c02bb56a0d14f34d /sw/source/filter/ww8/docxattributeoutput.cxx | |
parent | df2f2c8bf1004d00dd6cdff0e3edb9bf5777ffbd (diff) |
tdf#135663 DOCX export: fix OLE distance from text
Implements the export of the "mso-wrap-distance-*" properties of
VML icons of OLE objects to the "style" property of the "object" XML
tag. These properties are variously referred to as "wrap distance",
"margin" or "spacing" and they control the amount of blank space to
be left on each side of the object before text can appear.
Follow-up of commit 8ee88230c110ae90b439a52bc2906d6c5383967f
(tdf#135660 DOCX import: fix OLE icon wrap distance).
Change-Id: I576b876d2dca133b0ff593ff301519c17d2a348f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102323
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw/source/filter/ww8/docxattributeoutput.cxx')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 54cae24fe730..caaaf440ddc3 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -5825,6 +5825,17 @@ OString DocxAttributeOutput::GetOLEStyle(const SwFlyFrameFormat& rFormat, const "pt;height:" + OString::number( double( rSize.Height() ) / 20 ) + "pt"; //from VMLExport::AddRectangleDimensions(), it does: value/20 + const SvxLRSpaceItem& rLRSpace = rFormat.GetLRSpace(); + if (rLRSpace.IsExplicitZeroMarginValLeft() || rLRSpace.GetLeft()) + sShapeStyle += ";mso-wrap-distance-left:" + OString::number(double(rLRSpace.GetLeft()) / 20) + "pt"; + if (rLRSpace.IsExplicitZeroMarginValRight() || rLRSpace.GetRight()) + sShapeStyle += ";mso-wrap-distance-right:" + OString::number(double(rLRSpace.GetRight()) / 20) + "pt"; + const SvxULSpaceItem& rULSpace = rFormat.GetULSpace(); + if (rULSpace.GetUpper()) + sShapeStyle += ";mso-wrap-distance-top:" + OString::number(double(rULSpace.GetUpper()) / 20) + "pt"; + if (rULSpace.GetLower()) + sShapeStyle += ";mso-wrap-distance-bottom:" + OString::number(double(rULSpace.GetLower()) / 20) + "pt"; + //Export anchor setting, if it exists if (!aPos.isEmpty() && !aAnch.isEmpty()) sShapeStyle = aPos + sShapeStyle + aAnch; |