sw/source/filter/ww8/docxattributeoutput.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit b75d4156a3b2550db2cff1360a598e508ee51c8f
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Wed Oct 4 11:28:00 2023 -0400
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Wed Oct 4 20:43:35 2023 +0200

    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 <jl...@mail.com>

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)

Reply via email to