summaryrefslogtreecommitdiff
path: root/sw/qa
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2024-10-30 09:51:26 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-10-31 12:10:52 +0100
commit11b15571475414ef853e21a6c96afa2ac81f848f (patch)
treee32da625489c121001e8436fb693b2a25a1e1b6e /sw/qa
parentef085d09e0c019f78a3d35f759c8fe567856b615 (diff)
convert KernArray from sal_Int32 to double
which allows us to eliminate a bunch of rounding at various layers, and consequently maintain a lot more precision Change-Id: I911dedd7c041c1d67396c082e5695346ea689acb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175814 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/qa')
-rw-r--r--sw/qa/core/text/text.cxx4
-rw-r--r--sw/qa/core/txtnode/justify.cxx4
-rw-r--r--sw/qa/extras/layout/layout3.cxx6
-rw-r--r--sw/qa/extras/tiledrendering/tiledrendering.cxx2
4 files changed, 8 insertions, 8 deletions
diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index 40bdcca07b5f..6dc3e933a2dc 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -1623,9 +1623,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf129810)
CPPUNIT_ASSERT_EQUAL(size_t(14), pDXArray.size());
// Assert we are using the expected width for uncompressed chars
- CPPUNIT_ASSERT_EQUAL(sal_Int32(720), pDXArray[0]);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(720), sal_Int32(pDXArray[0]));
// Assert we are using the expected width for compressed chars
- CPPUNIT_ASSERT_EQUAL(sal_Int32(500), pDXArray[6] - pDXArray[5]);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(500), sal_Int32(pDXArray[6] - pDXArray[5]));
break;
}
}
diff --git a/sw/qa/core/txtnode/justify.cxx b/sw/qa/core/txtnode/justify.cxx
index 98b81babd8ff..495c3037a062 100644
--- a/sw/qa/core/txtnode/justify.cxx
+++ b/sw/qa/core/txtnode/justify.cxx
@@ -56,13 +56,13 @@ std::ostream& operator<<(std::ostream& rStrm, const CharWidthArray& rCharWidthAr
void CharWidthArray::ConvertToKernArray()
{
for (std::size_t i = 1; i < maArray.size(); ++i)
- maArray.adjust(i, maArray[i - 1]);
+ maArray[i] += maArray[i - 1];
}
void CharWidthArray::ConvertToCharWidths()
{
for (sal_Int32 i = maArray.size() - 1; i > 0; --i)
- maArray.adjust(i, -maArray[i - 1]);
+ maArray[i] -= maArray[i - 1];
}
/// Convert maArray to kern array values, then invoke the function, and convert it back.
diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx
index 7fd080b043e2..ebec9da48e4f 100644
--- a/sw/qa/extras/layout/layout3.cxx
+++ b/sw/qa/extras/layout/layout3.cxx
@@ -446,7 +446,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf161810)
// Assert we are using the expected position for the last char
// This was 9369, now 9165, according to the fixed space shrinking
- CPPUNIT_ASSERT_LESS(sal_Int32(9300), pDXArray[72]);
+ CPPUNIT_ASSERT_LESS(sal_Int32(9300), sal_Int32(pDXArray[72]));
break;
}
}
@@ -491,7 +491,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf163149)
// Assert we are using the expected position for the last char
// This was 4673, now 4163, according to the fixed space shrinking
- CPPUNIT_ASSERT_LESS(sal_Int32(4200), pDXArray[45]);
+ CPPUNIT_ASSERT_LESS(sal_Int32(4200), sal_Int32(pDXArray[45]));
break;
}
}
@@ -920,7 +920,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, testTdf122607)
assertXPath(pXmlDoc,
"/root/page[1]/anchored/fly/txt[1]/anchored/fly/tab/row[2]/cell/txt[7]/anchored/"
"fly/txt/SwParaPortion/SwLineLayout/child::*[1]",
- "width", u"428");
+ "width", u"427");
assertXPath(pXmlDoc,
"/root/page[1]/anchored/fly/txt[1]/anchored/fly/tab/row[2]/cell/txt[7]/anchored/"
"fly/txt/SwParaPortion/SwLineLayout/child::*[1]",
diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx
index eb7502025b15..fec4a17c269e 100644
--- a/sw/qa/extras/tiledrendering/tiledrendering.cxx
+++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx
@@ -3389,7 +3389,7 @@ CPPUNIT_TEST_FIXTURE(SwTiledRenderingTest, testDropDownFormFieldButton)
CPPUNIT_ASSERT_EQUAL("drop-down"_ostr, sType);
OString sTextArea( aTree.get_child("textArea").get_value<std::string>() );
- CPPUNIT_ASSERT_EQUAL("1538, 1418, 1026, 275"_ostr, sTextArea);
+ CPPUNIT_ASSERT_EQUAL("1538, 1418, 1025, 275"_ostr, sTextArea);
boost::property_tree::ptree aItems = aTree.get_child("params").get_child("items");
CPPUNIT_ASSERT_EQUAL(size_t(6), aItems.size());