sw/qa/extras/ooxmlexport/ooxmlexport19.cxx   |   17 -----------------
 sw/qa/extras/ooxmlimport/ooxmlimport2.cxx    |   20 ++++++++++++++++++++
 sw/source/filter/ww8/docxattributeoutput.cxx |   11 -----------
 3 files changed, 20 insertions(+), 28 deletions(-)

New commits:
commit bac7665f78b734a9ba79a4511484c579047ea0df
Author:     Oliver Specht <oliver.spe...@cib.de>
AuthorDate: Thu Mar 20 08:35:01 2025 +0100
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Wed Apr 23 09:57:04 2025 +0200

    tdf#165083 Remove of wrong page margin export code
    
    With 8ef9573f087b86f93860c8d07d04b60a40512836 import and export
    of page margins has been changed. The export part was wrong so
    it is removed here.
    
    Change-Id: I00ab7854cb7ee0baa81bfffcd7f07dea3b84f2f8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183146
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>
    Tested-by: Jenkins
    Tested-by: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>

diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
index 1e5552b7a4b5..ef8da13a9f15 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx
@@ -1280,23 +1280,6 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148952_2010)
     CPPUNIT_ASSERT_EQUAL(u"Black"_ustr, title);
 }
 
-DECLARE_OOXMLEXPORT_TEST(testTdf153196, "A019_min.docx")
-{
-    uno::Reference<beans::XPropertySet> xPageStyle;
-    getStyles("PageStyles")->getByName("Converted1") >>= xPageStyle;
-    sal_Int32 nLeftMargin{};
-    xPageStyle->getPropertyValue("LeftMargin") >>= nLeftMargin;
-    // Without the accompanying fix in place, this test would have failed with:
-    // - Expected: 4265
-    // - Actual  : 0
-    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4265), nLeftMargin);
-    sal_Int32 nRightMargin{};
-    xPageStyle->getPropertyValue("RightMargin") >>= nRightMargin;
-    // - Expected: 0
-    // - Actual  : 4265
-    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), nRightMargin);
-}
-
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/qa/extras/ooxmlexport/data/A019_min.docx 
b/sw/qa/extras/ooxmlimport/data/A019_min.docx
similarity index 100%
rename from sw/qa/extras/ooxmlexport/data/A019_min.docx
rename to sw/qa/extras/ooxmlimport/data/A019_min.docx
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
index 9e5daa6dab96..38ac0159960c 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx
@@ -1333,6 +1333,26 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf154370)
         CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, 
ePropertyState);
     }
 }
+
+CPPUNIT_TEST_FIXTURE(Test, testTdf153196)
+{
+    createSwDoc("A019_min.docx");
+
+    uno::Reference<beans::XPropertySet> xPageStyle;
+    getStyles("PageStyles")->getByName("Converted1") >>= xPageStyle;
+    sal_Int32 nLeftMargin{};
+    xPageStyle->getPropertyValue("LeftMargin") >>= nLeftMargin;
+    // Without the accompanying fix in place, this test would have failed with:
+    // - Expected: 4265
+    // - Actual  : 0
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4265), nLeftMargin);
+    sal_Int32 nRightMargin{};
+    xPageStyle->getPropertyValue("RightMargin") >>= nRightMargin;
+    // - Expected: 0
+    // - Actual  : 4265
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), nRightMargin);
+}
+
 // tests should only be added to ooxmlIMPORT *if* they fail round-tripping in 
ooxmlEXPORT
 
 } // end of anonymous namespace
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx 
b/sw/source/filter/ww8/docxattributeoutput.cxx
index f0442d082b27..6c820e7af2cd 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -9483,17 +9483,6 @@ void DocxAttributeOutput::FormatLRSpace( const 
SvxLRSpaceItem& rLRSpace )
 
         m_pageMargins.nLeft += 
sal::static_int_cast<sal_uInt16>(rLRSpace.ResolveLeft({}));
         m_pageMargins.nRight += 
sal::static_int_cast<sal_uInt16>(rLRSpace.ResolveRight({}));
-        // if page layout is 'left' then left/right margin need to be exchanged
-        // as it is exported as mirrored layout starting with even page
-        const WW8_SepInfo *pSectionInfo = 
m_rExport.Sections().CurrentSectionInfo();
-        if (pSectionInfo->pPageDesc &&
-            m_rExport.isMirroredMargin() &&
-            ((pSectionInfo->pPageDesc->ReadUseOn() & UseOnPage::All) == 
UseOnPage::Left))
-        {
-            sal_uInt16 nLeft = m_pageMargins.nLeft;
-            m_pageMargins.nLeft = m_pageMargins.nRight;
-            m_pageMargins.nRight = nLeft;
-        }
         sal_uInt16 nGutter = rLRSpace.GetGutterMargin();
 
         AddToAttrList( m_pSectionSpacingAttrList,

Reply via email to