From 40a428fde0a33e7127dfa30845d65c698e408053 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 22 Sep 2022 16:05:44 +0100 Subject: [PATCH] Related: tdf#151107 make "sloppy" paper fit up to 1.25pt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 0b6d45056ab6e1c47b4ed62eedaad02249439444. Change-Id: Ifbc0e286be4ab3dffd0d66228fd1abe2dfc0fde0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140445 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- i18nutil/source/utility/paper.cxx | 6 +++++- sw/qa/extras/ooxmlexport/ooxmlexport15.cxx | 4 ++-- sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/i18nutil/source/utility/paper.cxx b/i18nutil/source/utility/paper.cxx index 1976880a060d..f6871e655f58 100644 --- a/i18nutil/source/utility/paper.cxx +++ b/i18nutil/source/utility/paper.cxx @@ -165,7 +165,11 @@ const PageDesc aDinTab[] = const size_t nTabSize = SAL_N_ELEMENTS(aDinTab); -#define MAXSLOPPY 21 +// tdf#151107 make this not just large enough for rounding errors on our side +// but also large enough to match where the ppd side rounded up to the next +// point. Seen with C5/C6/C65 envelopes which can be found over 1 point away +// from the values in aDinTab +#define MAXSLOPPY PT2MM100(1.25) void PaperInfo::doSloppyFit(bool bAlsoTryRotated) { diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx index 0878ce515e2e..d7c0c5404677 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport15.cxx @@ -676,9 +676,9 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf132149_pgBreak) assertXPath(pDump, "//page[2]/infos/prtBounds", "left", "2268"); //Left page style assertXPath(pDump, "//page[1]/infos/bounds", "width", "8391"); //landscape - assertXPath(pDump, "//page[2]/infos/bounds", "width", "5953"); //portrait + assertXPath(pDump, "//page[2]/infos/bounds", "width", "5940"); //portrait // This two-line 3rd page ought not to exist. DID YOU FIX ME? The real page 3 should be "8391" landscape. - assertXPath(pDump, "//page[3]/infos/bounds", "width", "5953"); + assertXPath(pDump, "//page[3]/infos/bounds", "width", "5940"); // This really ought to be on odd page 3, but now it is on odd page 5. assertXPath(pDump, "//page[5]/infos/bounds", "width", "8391"); assertXPath(pDump, "//page[5]/infos/prtBounds", "right", "6122"); //Left page style diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index b6d4af1fe739..f15b2c1f3ca9 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -322,7 +322,7 @@ DECLARE_OOXMLEXPORT_TEST(testCalendar3, "calendar3.docx") // Both Word and LO display it as landscape, so ensure that it round-trips with landscape dimensions. uno::Reference xPageStyle(getStyles("PageStyles")->getByName("Standard"), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL_MESSAGE("Page Width (mm) ", sal_Int32(148), getProperty(xPageStyle, "Width") / 100); - CPPUNIT_ASSERT_EQUAL_MESSAGE("Page Height (mm)", sal_Int32(105), getProperty(xPageStyle, "Height") / 100); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Page Height (mm)", sal_Int32(104), getProperty(xPageStyle, "Height") / 100); } DECLARE_OOXMLEXPORT_TEST(testCalendar4, "calendar4.docx")