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 d3aca5e5b887631c1fc72905f130a693b4898377 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:15 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/+/184223 Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> Tested-by: allotropia jenkins <jenk...@allotropia.de> diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx index dc2a291234c3..6d12aa17679e 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport19.cxx @@ -1271,23 +1271,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 0c6e780c5a1e..899b0f60ac31 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -1338,6 +1338,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 b6717c92b549..5c16d48b2dff 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -9297,17 +9297,6 @@ void DocxAttributeOutput::FormatLRSpace( const SvxLRSpaceItem& rLRSpace ) m_pageMargins.nLeft += sal::static_int_cast<sal_uInt16>(rLRSpace.GetLeft()); m_pageMargins.nRight += sal::static_int_cast<sal_uInt16>(rLRSpace.GetRight()); - // 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,