diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2021-08-10 08:10:19 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-08-11 06:41:17 +0200 |
commit | fa339b3adb53300ae68913bed87e18caf9f2e262 (patch) | |
tree | e3aed1bb38664cfe343a6d7f0803d2312c86c76a /sd/qa/unit | |
parent | e89404f00b25cfddd4098b4b2cf900d190617221 (diff) |
convert some LogicToLogic calls to use o3tl::convert instead
If a LogicToLogic uses fixed units, we can use o3tl::convert
instead. We can also do the same for all other cases where
LogicToLogic is used, but that needs additional investigation to
determine if it is safe to do so.
Note:
MapUnit::Pixel is converted to o3tl::Length::pt because it assumed
72 PPI for a logical pixel, which corresponds with the conversion
rate of a point (72 PPI).
Today, 96 PPI is standard, which is also used for o3tl::Length:px.
Change-Id: I29126df38bfcfda74b5d83d4cb880a378aecd18b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120230
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd/qa/unit')
-rw-r--r-- | sd/qa/unit/tiledrendering/LOKitSearchTest.cxx | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx index 762faaac1b56..dd661553b425 100644 --- a/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx +++ b/sd/qa/unit/tiledrendering/LOKitSearchTest.cxx @@ -347,9 +347,9 @@ void LOKitSearchTest::testSearchInPDF() CPPUNIT_ASSERT_EQUAL(1, mpCallbackRecorder->m_nSearchResultCount); CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultSelection.size()); - CPPUNIT_ASSERT_EQUAL(OString("3763, 1331, 1432, 483"), + CPPUNIT_ASSERT_EQUAL(OString("3763, 1331, 1432, 482"), mpCallbackRecorder->m_aSearchResultSelection[0]); - CPPUNIT_ASSERT_EQUAL(tools::Rectangle(Point(3763, 1331), Size(1433, 484)), + CPPUNIT_ASSERT_EQUAL(tools::Rectangle(Point(3763, 1331), Size(1433, 483)), mpCallbackRecorder->m_aSelection[0]); // Search again - same result @@ -359,9 +359,9 @@ void LOKitSearchTest::testSearchInPDF() CPPUNIT_ASSERT_EQUAL(2, mpCallbackRecorder->m_nSearchResultCount); CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultSelection.size()); - CPPUNIT_ASSERT_EQUAL(OString("3763, 1331, 1432, 483"), + CPPUNIT_ASSERT_EQUAL(OString("3763, 1331, 1432, 482"), mpCallbackRecorder->m_aSearchResultSelection[0]); - CPPUNIT_ASSERT_EQUAL(tools::Rectangle(Point(3763, 1331), Size(1433, 484)), + CPPUNIT_ASSERT_EQUAL(tools::Rectangle(Point(3763, 1331), Size(1433, 483)), mpCallbackRecorder->m_aSelection[0]); } @@ -444,7 +444,7 @@ void LOKitSearchTest::testSearchInPDFInMultiplePages() CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultPart.size()); CPPUNIT_ASSERT_EQUAL(0, mpCallbackRecorder->m_aSearchResultPart[0]); - CPPUNIT_ASSERT_EQUAL(OString("9463, 3382, 1099, 499"), + CPPUNIT_ASSERT_EQUAL(OString("9463, 3382, 1099, 498"), mpCallbackRecorder->m_aSearchResultSelection[0]); // Search for "him" @@ -457,7 +457,7 @@ void LOKitSearchTest::testSearchInPDFInMultiplePages() CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultPart.size()); CPPUNIT_ASSERT_EQUAL(0, mpCallbackRecorder->m_aSearchResultPart[0]); - CPPUNIT_ASSERT_EQUAL(OString("5592, 5038, 1100, 499"), + CPPUNIT_ASSERT_EQUAL(OString("5592, 5038, 1099, 498"), mpCallbackRecorder->m_aSearchResultSelection[0]); // Search for "him" @@ -470,7 +470,7 @@ void LOKitSearchTest::testSearchInPDFInMultiplePages() CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultPart.size()); CPPUNIT_ASSERT_EQUAL(1, mpCallbackRecorder->m_aSearchResultPart[0]); - CPPUNIT_ASSERT_EQUAL(OString("9463, 1308, 1099, 499"), + CPPUNIT_ASSERT_EQUAL(OString("9463, 1308, 1099, 498"), mpCallbackRecorder->m_aSearchResultSelection[0]); // Search for "him" @@ -483,7 +483,7 @@ void LOKitSearchTest::testSearchInPDFInMultiplePages() CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultPart.size()); CPPUNIT_ASSERT_EQUAL(1, mpCallbackRecorder->m_aSearchResultPart[0]); - CPPUNIT_ASSERT_EQUAL(OString("5592, 2964, 1100, 499"), + CPPUNIT_ASSERT_EQUAL(OString("5592, 2964, 1099, 498"), mpCallbackRecorder->m_aSearchResultSelection[0]); // Search for "him" - back to start @@ -496,7 +496,7 @@ void LOKitSearchTest::testSearchInPDFInMultiplePages() CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultPart.size()); CPPUNIT_ASSERT_EQUAL(0, mpCallbackRecorder->m_aSearchResultPart[0]); - CPPUNIT_ASSERT_EQUAL(OString("9463, 3382, 1099, 499"), + CPPUNIT_ASSERT_EQUAL(OString("9463, 3382, 1099, 498"), mpCallbackRecorder->m_aSearchResultSelection[0]); } @@ -547,7 +547,7 @@ void LOKitSearchTest::testSearchInPDFInMultiplePagesBackwards() CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultPart.size()); CPPUNIT_ASSERT_EQUAL(0, mpCallbackRecorder->m_aSearchResultPart[0]); - CPPUNIT_ASSERT_EQUAL(OString("5592, 5038, 1100, 499"), + CPPUNIT_ASSERT_EQUAL(OString("5592, 5038, 1099, 498"), mpCallbackRecorder->m_aSearchResultSelection[0]); // Search for "him" @@ -560,7 +560,7 @@ void LOKitSearchTest::testSearchInPDFInMultiplePagesBackwards() CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultPart.size()); CPPUNIT_ASSERT_EQUAL(0, mpCallbackRecorder->m_aSearchResultPart[0]); - CPPUNIT_ASSERT_EQUAL(OString("9463, 3382, 1099, 499"), + CPPUNIT_ASSERT_EQUAL(OString("9463, 3382, 1099, 498"), mpCallbackRecorder->m_aSearchResultSelection[0]); // Search for "him" @@ -573,7 +573,7 @@ void LOKitSearchTest::testSearchInPDFInMultiplePagesBackwards() CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultPart.size()); CPPUNIT_ASSERT_EQUAL(1, mpCallbackRecorder->m_aSearchResultPart[0]); - CPPUNIT_ASSERT_EQUAL(OString("5592, 2964, 1100, 499"), + CPPUNIT_ASSERT_EQUAL(OString("5592, 2964, 1099, 498"), mpCallbackRecorder->m_aSearchResultSelection[0]); // Search for "him" @@ -586,7 +586,7 @@ void LOKitSearchTest::testSearchInPDFInMultiplePagesBackwards() CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultPart.size()); CPPUNIT_ASSERT_EQUAL(1, mpCallbackRecorder->m_aSearchResultPart[0]); - CPPUNIT_ASSERT_EQUAL(OString("9463, 1308, 1099, 499"), + CPPUNIT_ASSERT_EQUAL(OString("9463, 1308, 1099, 498"), mpCallbackRecorder->m_aSearchResultSelection[0]); // Search for "him" - back to start @@ -599,7 +599,7 @@ void LOKitSearchTest::testSearchInPDFInMultiplePagesBackwards() CPPUNIT_ASSERT_EQUAL(size_t(1), mpCallbackRecorder->m_aSearchResultPart.size()); CPPUNIT_ASSERT_EQUAL(0, mpCallbackRecorder->m_aSearchResultPart[0]); - CPPUNIT_ASSERT_EQUAL(OString("5592, 5038, 1100, 499"), + CPPUNIT_ASSERT_EQUAL(OString("5592, 5038, 1099, 498"), mpCallbackRecorder->m_aSearchResultSelection[0]); } |