summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2023-10-04 11:28:00 -0400
committerJustin Luth <jluth@mail.com>2023-10-04 20:43:35 +0200
commitb75d4156a3b2550db2cff1360a598e508ee51c8f (patch)
tree3cb412e07c99c317b28b49df59ba163b326b7352 /sw/source/filter
parent5760d7876dae55d351e80b990dc064440fa46a73 (diff)
related tdf#157572 docx export framePr: no w:x if zero or xAlign
xAlign has none of the complexities of yAlign. if xAlign is defined, it takes priority over w:x. So simply don't write out an unnecessary w:x if it is the default value (0) or if there is a xAlign. This change is just made to keep the code somewhat consistent between w:x and w:y. Change-Id: I5ef1da309e35e25660247675ba9ab6e336becd41 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157566 Tested-by: Jenkins Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 144469810097..4f0c67f3ce99 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1049,14 +1049,14 @@ void DocxAttributeOutput::PopulateFrameProperties(const SwFrameFormat* pFrameFor
attrList->add( FSNS( XML_w, XML_w), OString::number(nAdjustedWidth));
attrList->add( FSNS( XML_w, XML_h), OString::number(rSize.Height()));
- attrList->add( FSNS( XML_w, XML_x), OString::number(aPos.X));
-
const OString relativeFromH = convertToOOXMLHoriOrientRel(rHoriOrient.GetRelationOrient());
const 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);
+ else if (aPos.X)
+ attrList->add( FSNS( XML_w, XML_x), OString::number(aPos.X));
if (!aYAlign.isEmpty() && relativeFromV != "text")
attrList->add(FSNS(XML_w, XML_yAlign), aYAlign);
else if (aPos.Y)