Skip to content

Commit 9d672a3

Browse files
os-cibtimar
authored andcommitted
tdf#165083 Remove of wrong page margin export code
With 8ef9573 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 <[email protected]> Tested-by: Jenkins Tested-by: Gabor Kelemen <[email protected]> (cherry picked from commit 1a87821e7947da8aaa9e67eddcd8602c4f9ae637) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184481
1 parent 59ea743 commit 9d672a3

File tree

4 files changed

+20
-28
lines changed

4 files changed

+20
-28
lines changed

sw/qa/extras/ooxmlexport/ooxmlexport19.cxx

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,23 +1280,6 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf148952_2010)
12801280
CPPUNIT_ASSERT_EQUAL(u"Black"_ustr, title);
12811281
}
12821282

1283-
DECLARE_OOXMLEXPORT_TEST(testTdf153196, "A019_min.docx")
1284-
{
1285-
uno::Reference<beans::XPropertySet> xPageStyle;
1286-
getStyles("PageStyles")->getByName("Converted1") >>= xPageStyle;
1287-
sal_Int32 nLeftMargin{};
1288-
xPageStyle->getPropertyValue("LeftMargin") >>= nLeftMargin;
1289-
// Without the accompanying fix in place, this test would have failed with:
1290-
// - Expected: 4265
1291-
// - Actual : 0
1292-
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4265), nLeftMargin);
1293-
sal_Int32 nRightMargin{};
1294-
xPageStyle->getPropertyValue("RightMargin") >>= nRightMargin;
1295-
// - Expected: 0
1296-
// - Actual : 4265
1297-
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), nRightMargin);
1298-
}
1299-
13001283
CPPUNIT_PLUGIN_IMPLEMENT();
13011284

13021285
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

sw/qa/extras/ooxmlimport/ooxmlimport2.cxx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,26 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf154370)
13331333
CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState);
13341334
}
13351335
}
1336+
1337+
CPPUNIT_TEST_FIXTURE(Test, testTdf153196)
1338+
{
1339+
createSwDoc("A019_min.docx");
1340+
1341+
uno::Reference<beans::XPropertySet> xPageStyle;
1342+
getStyles("PageStyles")->getByName("Converted1") >>= xPageStyle;
1343+
sal_Int32 nLeftMargin{};
1344+
xPageStyle->getPropertyValue("LeftMargin") >>= nLeftMargin;
1345+
// Without the accompanying fix in place, this test would have failed with:
1346+
// - Expected: 4265
1347+
// - Actual : 0
1348+
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(4265), nLeftMargin);
1349+
sal_Int32 nRightMargin{};
1350+
xPageStyle->getPropertyValue("RightMargin") >>= nRightMargin;
1351+
// - Expected: 0
1352+
// - Actual : 4265
1353+
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), nRightMargin);
1354+
}
1355+
13361356
// tests should only be added to ooxmlIMPORT *if* they fail round-tripping in ooxmlEXPORT
13371357

13381358
} // end of anonymous namespace

sw/source/filter/ww8/docxattributeoutput.cxx

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9468,17 +9468,6 @@ void DocxAttributeOutput::FormatLRSpace( const SvxLRSpaceItem& rLRSpace )
94689468

94699469
m_pageMargins.nLeft += sal::static_int_cast<sal_uInt16>(rLRSpace.ResolveLeft({}));
94709470
m_pageMargins.nRight += sal::static_int_cast<sal_uInt16>(rLRSpace.ResolveRight({}));
9471-
// if page layout is 'left' then left/right margin need to be exchanged
9472-
// as it is exported as mirrored layout starting with even page
9473-
const WW8_SepInfo *pSectionInfo = m_rExport.Sections().CurrentSectionInfo();
9474-
if (pSectionInfo->pPageDesc &&
9475-
m_rExport.isMirroredMargin() &&
9476-
((pSectionInfo->pPageDesc->ReadUseOn() & UseOnPage::All) == UseOnPage::Left))
9477-
{
9478-
sal_uInt16 nLeft = m_pageMargins.nLeft;
9479-
m_pageMargins.nLeft = m_pageMargins.nRight;
9480-
m_pageMargins.nRight = nLeft;
9481-
}
94829471
sal_uInt16 nGutter = rLRSpace.GetGutterMargin();
94839472

94849473
AddToAttrList( m_pSectionSpacingAttrList,

0 commit comments

Comments
 (0)