summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2023-04-14 12:26:40 -0400
committerJustin Luth <jluth@mail.com>2023-04-15 02:42:17 +0200
commite07d5c089ab2e8fe8a5cfa2a11cef3f1cf3afab3 (patch)
treeab63fb656972d4c6e9dc2cb62827f01b9bd0607c /sw/source
parent4829a85d0753c93419bd46b1d50bcfa6f0f3f1da (diff)
tdf#154703 docx export framePr: export xAlign/yAlign
This fixes a regression in LO 4.4 from commit 1c876f5616522ab695de8c0316cdb0c601081815. The relative positions (left,right, center, inside, outside) (top, bottom...) were simply ignored on export. Change-Id: Ie12eb75483fbc3f05c77e45d40e4a18a7ead5b1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150430 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 0f34bc7b645b..d83cc1cdcc63 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -904,7 +904,9 @@ void DocxAttributeOutput::PopulateFrameProperties(const SwFrameFormat* pFrameFor
{
rtl::Reference<sax_fastparser::FastAttributeList> attrList = FastSerializerHelper::createAttrList();
- awt::Point aPos(pFrameFormat->GetHoriOrient().GetPos(), pFrameFormat->GetVertOrient().GetPos());
+ const SwFormatHoriOrient& rHoriOrient = pFrameFormat->GetHoriOrient();
+ const SwFormatVertOrient& rVertOrient = pFrameFormat->GetVertOrient();
+ awt::Point aPos(rHoriOrient.GetPos(), rVertOrient.GetPos());
attrList->add( FSNS( XML_w, XML_w), OString::number(rSize.Width()));
attrList->add( FSNS( XML_w, XML_h), OString::number(rSize.Height()));
@@ -920,8 +922,15 @@ void DocxAttributeOutput::PopulateFrameProperties(const SwFrameFormat* pFrameFor
attrList->add(FSNS(XML_w, XML_hSpace), OString::number((nLeft + nRight) / 2));
attrList->add(FSNS(XML_w, XML_vSpace), OString::number((nUpper + nLower) / 2));
- OString relativeFromH = convertToOOXMLHoriOrientRel( pFrameFormat->GetHoriOrient().GetRelationOrient() );
- OString relativeFromV = convertToOOXMLVertOrientRel( pFrameFormat->GetVertOrient().GetRelationOrient() );
+ OString relativeFromH = convertToOOXMLHoriOrientRel(rHoriOrient.GetRelationOrient());
+ OString relativeFromV = convertToOOXMLVertOrientRel(rVertOrient.GetRelationOrient());
+
+ OString aXAlign = convertToOOXMLHoriOrient(rHoriOrient.GetHoriOrient(), /*bIsPosToggle=*/false);
+ OString aYAlign = convertToOOXMLVertOrient(rVertOrient.GetVertOrient());
+ if (!aXAlign.isEmpty())
+ attrList->add(FSNS(XML_w, XML_xAlign), aXAlign);
+ if (!aYAlign.isEmpty())
+ attrList->add(FSNS(XML_w, XML_yAlign), aYAlign);
switch (pFrameFormat->GetSurround().GetValue())
{