summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/docxattributeoutput.cxx
diff options
context:
space:
mode:
authorAttila Bakos <bakos.attilakaroly@nisz.hu>2020-05-14 15:48:21 +0200
committerLászló Németh <nemeth@numbertext.org>2020-06-10 11:12:16 +0200
commit4bdff3c731a9f8ef11ffdae804a99a47f119ee50 (patch)
tree18a31830751129f5b7fd1b40bf966056b358703b /sw/source/filter/ww8/docxattributeoutput.cxx
parenta977df3015f84506a3636d278b981cb2bd12083b (diff)
tdf#133065 tdf#133602 DOCX export: fix OLE wrap regression
caused by commit 2150fdc7d0f63288ac56c33cb898589512057642 (tdf#131539 DOCX export: fix position of OLE objects). The wrap setting of the anchored OLE object were not preserved. Note: It needs also z-order export for background mode. Co-authored-by: Tibor Nagy Change-Id: I7f8c48019157dda00bcc97a490c5f582eccf1b22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94220 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.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 937906cad902..d8479c410a37 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -5607,6 +5607,31 @@ void DocxAttributeOutput::WriteOLE( SwOLENode& rNode, const Size& rSize, const S
FSNS( XML_r, XML_id ), sImageId.toUtf8(),
FSNS( XML_o, XML_title ), "" );
+ //export wrap settings
+ if(rFlyFrameFormat && rFlyFrameFormat->GetAnchor().GetAnchorId() != RndStdIds::FLY_AS_CHAR)
+ {
+ const SwFormatSurround aWrap = rFlyFrameFormat->GetSurround();
+ bool bIsCountur = aWrap.IsContour();
+
+ if (aWrap.GetSurround() == text::WrapTextMode::WrapTextMode_NONE)
+ m_pSerializer->singleElementNS(XML_w10, XML_wrap, XML_type, "topAndBottom");
+ if (aWrap.GetSurround() == text::WrapTextMode::WrapTextMode_PARALLEL && !bIsCountur)
+ m_pSerializer->singleElementNS(XML_w10, XML_wrap, XML_type, "square");
+ if (aWrap.GetSurround() == text::WrapTextMode::WrapTextMode_PARALLEL && bIsCountur)
+ m_pSerializer->singleElementNS(XML_w10, XML_wrap, XML_type, "tight");
+ if (aWrap.GetSurround() == text::WrapTextMode::WrapTextMode_DYNAMIC && !bIsCountur)
+ m_pSerializer->singleElementNS(XML_w10, XML_wrap, XML_type, "square", XML_side, "largest");
+ if (aWrap.GetSurround() == text::WrapTextMode::WrapTextMode_LEFT && !bIsCountur)
+ m_pSerializer->singleElementNS(XML_w10, XML_wrap, XML_type, "square", XML_side, "left");
+ if (aWrap.GetSurround() == text::WrapTextMode::WrapTextMode_RIGHT && !bIsCountur)
+ m_pSerializer->singleElementNS(XML_w10, XML_wrap, XML_type, "square", XML_side, "right");
+ if (aWrap.GetSurround() == text::WrapTextMode::WrapTextMode_DYNAMIC && bIsCountur)
+ m_pSerializer->singleElementNS(XML_w10, XML_wrap, XML_type, "tight", XML_side, "largest");
+ if (aWrap.GetSurround() == text::WrapTextMode::WrapTextMode_LEFT && bIsCountur)
+ m_pSerializer->singleElementNS(XML_w10, XML_wrap, XML_type, "tight", XML_side, "left");
+ if (aWrap.GetSurround() == text::WrapTextMode::WrapTextMode_RIGHT && bIsCountur)
+ m_pSerializer->singleElementNS(XML_w10, XML_wrap, XML_type, "tight", XML_side, "right");
+ }
m_pSerializer->endElementNS( XML_v, XML_shape );
// OLE object definition