diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-02-05 10:23:27 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-02-06 10:26:56 +0100 |
commit | 2113de51158a6e6c14931109bb9a4e27303c0eab (patch) | |
tree | cd0b43b4901bb2d957003a32f76fe857c7ffa46e /vcl/qa/cppunit/pdfexport | |
parent | 4a95c38e1c2c3582b9a53d39e192c5496b12abe0 (diff) |
tdf#96892 higher precision pdf fixed ints
reverts
commit 5f6065f980756fdb81c7018bedbb7f54e2b8214a
Date: Thu Mar 3 20:44:47 2016 +0000
coverity#1355126 Logically dead code
maybe we should be using more precision, but we haven't
been in the past
and...
commit cd5cc12d4330d68d0a233a82eda30e983ce202a4
Date: Thu Mar 3 20:42:52 2016 +0000
nLog10Divisor is 1
and then fix the original appendFixedInt bug wrt higher precision settings
and then bump those settings from 1 decimal place to 3 and adjust our
pdf export test for the new precision
Change-Id: Ib1b4c41ce2e651d5343919b253ffd46895c764ac
Reviewed-on: https://gerrit.libreoffice.org/49227
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/qa/cppunit/pdfexport')
-rw-r--r-- | vcl/qa/cppunit/pdfexport/pdfexport.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index a904a5dc638d..cb03680a4703 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -724,36 +724,36 @@ void PdfExportTest::testTdf108963() float fX = 0; float fY = 0; FPDFPathSegment_GetPoint(pSegment, &fX, &fY); - CPPUNIT_ASSERT_EQUAL(static_cast<float>(245.4), fX); - CPPUNIT_ASSERT_EQUAL(static_cast<float>(244.2), fY); + CPPUNIT_ASSERT_EQUAL(245395, static_cast<int>(round(fX * 1000))); + CPPUNIT_ASSERT_EQUAL(244233, static_cast<int>(round(fY * 1000))); CPPUNIT_ASSERT(!FPDFPathSegment_GetClose(pSegment)); pSegment = FPDFPath_GetPathSegment(pPdfPageObject, 1); CPPUNIT_ASSERT_EQUAL(FPDF_SEGMENT_LINETO, FPDFPathSegment_GetType(pSegment)); FPDFPathSegment_GetPoint(pSegment, &fX, &fY); - CPPUNIT_ASSERT_EQUAL(static_cast<float>(275.1), fX); - CPPUNIT_ASSERT_EQUAL(static_cast<float>(267.6), fY); + CPPUNIT_ASSERT_EQUAL(275102, static_cast<int>(round(fX * 1000))); + CPPUNIT_ASSERT_EQUAL(267590, static_cast<int>(round(fY * 1000))); CPPUNIT_ASSERT(!FPDFPathSegment_GetClose(pSegment)); pSegment = FPDFPath_GetPathSegment(pPdfPageObject, 2); CPPUNIT_ASSERT_EQUAL(FPDF_SEGMENT_LINETO, FPDFPathSegment_GetType(pSegment)); FPDFPathSegment_GetPoint(pSegment, &fX, &fY); - CPPUNIT_ASSERT_EQUAL(static_cast<float>(287.5), fX); - CPPUNIT_ASSERT_EQUAL(static_cast<float>(251.8), fY); + CPPUNIT_ASSERT_EQUAL(287518, static_cast<int>(round(fX * 1000))); + CPPUNIT_ASSERT_EQUAL(251801, static_cast<int>(round(fY * 1000))); CPPUNIT_ASSERT(!FPDFPathSegment_GetClose(pSegment)); pSegment = FPDFPath_GetPathSegment(pPdfPageObject, 3); CPPUNIT_ASSERT_EQUAL(FPDF_SEGMENT_LINETO, FPDFPathSegment_GetType(pSegment)); FPDFPathSegment_GetPoint(pSegment, &fX, &fY); - CPPUNIT_ASSERT_EQUAL(static_cast<float>(257.8), fX); - CPPUNIT_ASSERT_EQUAL(static_cast<float>(228.4), fY); + CPPUNIT_ASSERT_EQUAL(257839, static_cast<int>(round(fX * 1000))); + CPPUNIT_ASSERT_EQUAL(228444, static_cast<int>(round(fY * 1000))); CPPUNIT_ASSERT(!FPDFPathSegment_GetClose(pSegment)); pSegment = FPDFPath_GetPathSegment(pPdfPageObject, 4); CPPUNIT_ASSERT_EQUAL(FPDF_SEGMENT_LINETO, FPDFPathSegment_GetType(pSegment)); FPDFPathSegment_GetPoint(pSegment, &fX, &fY); - CPPUNIT_ASSERT_EQUAL(static_cast<float>(245.4), fX); - CPPUNIT_ASSERT_EQUAL(static_cast<float>(244.2), fY); + CPPUNIT_ASSERT_EQUAL(245395, static_cast<int>(round(fX * 1000))); + CPPUNIT_ASSERT_EQUAL(244233, static_cast<int>(round(fY * 1000))); CPPUNIT_ASSERT(FPDFPathSegment_GetClose(pSegment)); } } |