summaryrefslogtreecommitdiff
path: root/emfio
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 /emfio
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 'emfio')
-rw-r--r--emfio/qa/cppunit/emf/EmfImportTest.cxx2
-rw-r--r--emfio/source/reader/emfreader.cxx4
-rw-r--r--emfio/source/reader/mtftools.cxx2
-rw-r--r--emfio/source/reader/wmfreader.cxx4
4 files changed, 6 insertions, 6 deletions
diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx
index 30955bdb8973..1c4378c7bc42 100644
--- a/emfio/qa/cppunit/emf/EmfImportTest.cxx
+++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx
@@ -1399,7 +1399,7 @@ CPPUNIT_TEST_FIXTURE(Test, testExtTextOutOpaqueAndClipWMF)
assertXPath(pDocument, aPrefix + "group[3]/mask/group/polypolygoncolor", "color", u"#ff8000");
assertXPath(pDocument, aPrefix + "group[3]/mask/group/polypolygoncolor/polypolygon", "path",
- u"m1067 1067h1317v473h-1317z");
+ u"m1067 1067h1317.12890625v473h-1317.12890625z");
assertXPath(pDocument, aPrefix + "group[3]/mask/group/textsimpleportion", "text", u"OOOO");
assertXPath(pDocument, aPrefix + "group[3]/mask/group/textsimpleportion", "fontcolor",
u"#000000");
diff --git a/emfio/source/reader/emfreader.cxx b/emfio/source/reader/emfreader.cxx
index ff179d7ed2a0..9cdbeedda898 100644
--- a/emfio/source/reader/emfreader.cxx
+++ b/emfio/source/reader/emfreader.cxx
@@ -1962,7 +1962,7 @@ namespace emfio
}
}
- aDXAry.set(i, 0);
+ aDXAry[i] = 0;
if (nOptions & ETO_PDY)
{
pDYAry[i] = 0;
@@ -1972,7 +1972,7 @@ namespace emfio
{
sal_Int32 nDxTmp = 0;
mpInputStream->ReadInt32(nDxTmp);
- aDXAry.set(i, o3tl::saturating_add(aDXAry[i], nDxTmp));
+ aDXAry[i] += nDxTmp;
if (nOptions & ETO_PDY)
{
sal_Int32 nDyTmp = 0;
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index f12e6e92b17d..7ce4cd0fd559 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -1681,7 +1681,7 @@ namespace emfio
// #i121382# Map DXArray using WorldTransform
const Size aSizeX(ImplMap(Size(nSumX, 0)));
const basegfx::B2DVector aVectorX(aSizeX.Width(), aSizeX.Height());
- pDXArry->set(i, basegfx::fround(aVectorX.getLength()) * (nSumX >= 0 ? 1 : -1));
+ (*pDXArry)[i] = aVectorX.getLength() * (nSumX >= 0 ? 1 : -1);
if (pDYArry)
{
diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx
index 414218c717bb..5c16df6e42b2 100644
--- a/emfio/source/reader/wmfreader.cxx
+++ b/emfio/source/reader/wmfreader.cxx
@@ -805,7 +805,7 @@ namespace emfio
}
}
- aDXAry.set(i, nDx);
+ aDXAry[i] = nDx;
if ( nOptions & ETO_PDY )
{
pDYAry[i] = nDy;
@@ -1303,7 +1303,7 @@ namespace emfio
{
sal_Int32 val;
aMemoryStream.ReadInt32(val);
- aDXAry.set(i, val);
+ aDXAry[i] = val;
}
aMemoryStream.ReadUInt32(mnSkipActions);
DrawText(aPt, aString,