summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-04-18 13:18:37 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2024-04-20 08:53:26 +0200
commit089398e51409458c5438c49fb347e4f09d9c09dc (patch)
treef9bd3b85a2f3153db57696a68a9a9e48efd8c139 /sd
parent7b1405689d4246e0e37e8759f03e1962af964cec (diff)
Return double from OutputDevice::GetTextArray
And introduce GetTextWidth / GetTextHeight variants returning double. It allows to avoid premature rounding. At least in one case - testTdf145111_anchor_in_Fontwork - it allowed to make the test DPI-independent (at least in my testing on Windows, using 125, 150, and 175% UI scaling). Change-Id: I973d2c729ec6bb7114b4f99b9027f1ead7c1d061 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166237 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/layout-tests.cxx10
-rw-r--r--sd/qa/unit/tiledrendering/LOKitSearchTest.cxx4
2 files changed, 7 insertions, 7 deletions
diff --git a/sd/qa/unit/layout-tests.cxx b/sd/qa/unit/layout-tests.cxx
index 6aaed8b55ab4..1735f6574be3 100644
--- a/sd/qa/unit/layout-tests.cxx
+++ b/sd/qa/unit/layout-tests.cxx
@@ -109,10 +109,10 @@ CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTdf128212)
xmlDocUniquePtr pXmlDoc = load("pptx/tdf128212.pptx");
// Without the fix in place, this test would have failed with
- // - Expected: 7793
+ // - Expected: 7795
// - Actual : 12068
- assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray"_ostr, "x"_ostr, "4521");
- assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray"_ostr, "y"_ostr, "7793");
+ assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray"_ostr, "x"_ostr, "4523");
+ assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray"_ostr, "y"_ostr, "7795");
}
CPPUNIT_TEST_FIXTURE(SdLayoutTest, testColumnsLayout)
@@ -316,10 +316,10 @@ CPPUNIT_TEST_FIXTURE(SdLayoutTest, testFitToFrameTextFitting)
assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray[1]"_ostr, "x"_ostr, "0");
assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray[1]"_ostr, "y"_ostr, "406");
assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray[1]/dxarray"_ostr, "first"_ostr,
- "110");
+ "114");
#ifndef _WIN32 // Windows seems to differ in text layouting, so ignore for now
assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray[1]/dxarray"_ostr, "last"_ostr,
- "6981");
+ "6984");
#endif
}
diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
index 35b32640b510..bd1fe98ce631 100644
--- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
+++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx
@@ -653,7 +653,7 @@ void LOKitSearchTest::testSearchIn2MixedObjects()
CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultSelection.size());
CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultPart.size());
- CPPUNIT_ASSERT_EQUAL("3546, 3174, 738, 402"_ostr,
+ CPPUNIT_ASSERT_EQUAL("3545, 3174, 740, 402"_ostr,
mpCallbackRecorder->m_aSearchResultSelection[0]);
// Search next
@@ -679,7 +679,7 @@ void LOKitSearchTest::testSearchIn2MixedObjects()
CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultSelection.size());
CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultPart.size());
- CPPUNIT_ASSERT_EQUAL("3546, 3174, 738, 402"_ostr,
+ CPPUNIT_ASSERT_EQUAL("3545, 3174, 740, 402"_ostr,
mpCallbackRecorder->m_aSearchResultSelection[0]);
}