emfio/qa/cppunit/emf/EmfImportTest.cxx | 34 ++++++++++++++++----------------- include/tools/XmlWriter.hxx | 13 +++++++++++- svgio/qa/cppunit/SvgImportTest.cxx | 28 +++++++++++++-------------- svx/qa/unit/sdr.cxx | 22 ++++++++++----------- svx/qa/unit/svdraw.cxx | 4 +-- tools/source/xml/XmlWriter.cxx | 2 - 6 files changed, 57 insertions(+), 46 deletions(-)
New commits: commit 1f1f4232001fa23ec1a1bf67d605fda9df542eec Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Sun Apr 14 11:25:21 2024 +0100 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Sun Apr 14 15:13:10 2024 +0200 Round in XmlWriter::attribute when passing a double Before, it truncated. Rounding provides a closer value. Change-Id: I213e6ae34ada2f5081cb2c8b2ef431448c712b37 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165947 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/emfio/qa/cppunit/emf/EmfImportTest.cxx b/emfio/qa/cppunit/emf/EmfImportTest.cxx index da1ead889431..a00351178065 100644 --- a/emfio/qa/cppunit/emf/EmfImportTest.cxx +++ b/emfio/qa/cppunit/emf/EmfImportTest.cxx @@ -126,12 +126,12 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawImagePointsTypeBitmap) CPPUNIT_ASSERT(pDocument); assertXPath(pDocument, aXPathPrefix + "polypolygoncolor", "color"_ostr, "#0080ff"); - assertXPath(pDocument, aXPathPrefix + "bitmap", "xy11"_ostr, "5346"); + assertXPath(pDocument, aXPathPrefix + "bitmap", "xy11"_ostr, "5347"); assertXPath(pDocument, aXPathPrefix + "bitmap", "xy12"_ostr, "0"); assertXPath(pDocument, aXPathPrefix + "bitmap", "xy13"_ostr, "5558"); assertXPath(pDocument, aXPathPrefix + "bitmap", "xy21"_ostr, "0"); - assertXPath(pDocument, aXPathPrefix + "bitmap", "xy22"_ostr, "4716"); - assertXPath(pDocument, aXPathPrefix + "bitmap", "xy23"_ostr, "5564"); + assertXPath(pDocument, aXPathPrefix + "bitmap", "xy22"_ostr, "4717"); + assertXPath(pDocument, aXPathPrefix + "bitmap", "xy23"_ostr, "5565"); assertXPath( pDocument, aXPathPrefix + "bitmap/data[2]", "row"_ostr, "020202,ffffff,ffffff,ffffff,fefefe,ffffff,ffffff,fefefe,ffffff,ffffff,f8f8f8,ffffff," @@ -159,7 +159,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawString) // check correct import of the DrawString: height, position, text, color and font assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "height"_ostr, "120"); assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "x"_ostr, "817"); - assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "y"_ostr, "1137"); + assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "y"_ostr, "1138"); assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "text"_ostr, "TEST"); assertXPath(pDocument, aXPathPrefix + "transform/textsimpleportion", "fontcolor"_ostr, "#000000"); @@ -197,7 +197,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawStringAlign) "12"); assertXPath(pDocument, aXPathPrefix + "mask/transform[2]/textsimpleportion", "height"_ostr, "12"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[2]/textsimpleportion", "x"_ostr, "143"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[2]/textsimpleportion", "x"_ostr, "144"); assertXPath(pDocument, aXPathPrefix + "mask/transform[2]/textsimpleportion", "y"_ostr, "22"); assertXPath(pDocument, aXPathPrefix + "mask/transform[2]/textsimpleportion", "text"_ostr, "HCVT"); @@ -218,7 +218,7 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawStringAlign) assertXPath(pDocument, aXPathPrefix + "mask/transform[4]/textsimpleportion", "text"_ostr, "HLVC"); - assertXPath(pDocument, aXPathPrefix + "mask/transform[5]/textsimpleportion", "x"_ostr, "142"); + assertXPath(pDocument, aXPathPrefix + "mask/transform[5]/textsimpleportion", "x"_ostr, "143"); assertXPath(pDocument, aXPathPrefix + "mask/transform[5]/textsimpleportion", "y"_ostr, "66"); assertXPath(pDocument, aXPathPrefix + "mask/transform[5]/textsimpleportion", "text"_ostr, "HCVC"); @@ -330,7 +330,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusDrawBeziers) assertXPath(pDocument, aXPathPrefix + "transform[1]", "xy13"_ostr, "800"); assertXPath(pDocument, aXPathPrefix + "transform[1]", "xy21"_ostr, "-4"); assertXPath(pDocument, aXPathPrefix + "transform[1]", "xy22"_ostr, "0"); - assertXPath(pDocument, aXPathPrefix + "transform[1]", "xy23"_ostr, "3195"); + assertXPath(pDocument, aXPathPrefix + "transform[1]", "xy23"_ostr, "3196"); } CPPUNIT_TEST_FIXTURE(Test, testDrawLine) @@ -368,13 +368,13 @@ CPPUNIT_TEST_FIXTURE(Test, testDrawLineWithCaps) CPPUNIT_ASSERT(pDocument); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow", 3); - assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[1]/line", "width"_ostr, "211"); + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[1]/line", "width"_ostr, "212"); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[1]/stroke", 0); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[1]/linestartattribute/polypolygon", "path"_ostr, "m0-1 1 2h-2z"); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[1]/lineendattribute", 0); - assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[2]/line", "width"_ostr, "211"); + assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[2]/line", "width"_ostr, "212"); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[2]/stroke", 0); assertXPath(pDocument, aXPathPrefix + "polygonstrokearrow[2]/linestartattribute/polypolygon", "path"_ostr, "m0-1 1 2h-2z"); @@ -502,7 +502,7 @@ CPPUNIT_TEST_FIXTURE(Test, testLinearGradient) "repeat"); assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "startx"_ostr, "-1"); assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "starty"_ostr, "-1"); - assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "endx"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "endx"_ostr, "-1"); assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "endy"_ostr, "-1"); assertXPath(pDocument, aXPathPrefix + "mask/svglineargradient[2]", "opacity"_ostr, "1"); assertXPath( @@ -958,8 +958,8 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusBrushPathGradientWithBlendColors) assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "radius"_ostr, "0.7"); assertXPath(pDocument, aXPathPrefix + "svgradialgradient/focalx", 0); assertXPath(pDocument, aXPathPrefix + "svgradialgradient/focaly", 0); - assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "startx"_ostr, "0"); - assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "starty"_ostr, "0"); + assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "startx"_ostr, "1"); + assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "starty"_ostr, "1"); assertXPath(pDocument, aXPathPrefix + "svgradialgradient", "spreadmethod"_ostr, "pad"); } @@ -1169,7 +1169,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusDrawPathWithMiterLimit) assertXPath(pDocument, aXPathPrefix + "polypolygonstroke", 3); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "color"_ostr, "#c800c8"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "width"_ostr, "1057"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "width"_ostr, "1058"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "linejoin"_ostr, "Miter"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "miterangle"_ostr, "5"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/stroke", 0); @@ -1179,7 +1179,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusDrawPathWithMiterLimit) assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[1]/polypolygonstroke/line", "color"_ostr, "#6400c8"); assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[1]/polypolygonstroke/line", - "width"_ostr, "1057"); + "width"_ostr, "1058"); assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[1]/polypolygonstroke/line", "linejoin"_ostr, "Miter"); assertXPath(pDocument, aXPathPrefix + "unifiedtransparence[1]/polypolygonstroke/line", @@ -1192,13 +1192,13 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusDrawPathWithMiterLimit) "miterangle"_ostr, "19"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "color"_ostr, "#0000ff"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "width"_ostr, "1057"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "width"_ostr, "1058"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "linejoin"_ostr, "Miter"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "miterangle"_ostr, "60"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/stroke", 0); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[3]/line", "color"_ostr, "#0000ff"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[3]/line", "width"_ostr, "1057"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[3]/line", "width"_ostr, "1058"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[3]/line", "linejoin"_ostr, "Miter"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[3]/line", "miterangle"_ostr, "60"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[3]/stroke", 0); @@ -1266,7 +1266,7 @@ CPPUNIT_TEST_FIXTURE(Test, testEmfPlusFillClosedCurve) assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "color"_ostr, "#00ff00"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "width"_ostr, "4"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "linejoin"_ostr, "Miter"); - assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "miterangle"_ostr, "3"); + assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "miterangle"_ostr, "4"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[1]/line", "linecap"_ostr, "BUTT"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "color"_ostr, "#aaaa00"); assertXPath(pDocument, aXPathPrefix + "polypolygonstroke[2]/line", "width"_ostr, "4"); diff --git a/include/tools/XmlWriter.hxx b/include/tools/XmlWriter.hxx index 400748611bd5..03cc151b2624 100644 --- a/include/tools/XmlWriter.hxx +++ b/include/tools/XmlWriter.hxx @@ -10,6 +10,9 @@ #ifndef INCLUDED_TOOLS_XMLWRITER_HXX #define INCLUDED_TOOLS_XMLWRITER_HXX +#include <sal/config.h> + +#include <basegfx/numeric/ftools.hxx> #include <tools/toolsdllapi.h> #include <rtl/string.hxx> #include <memory> @@ -52,7 +55,15 @@ public: void attribute(const char* sTagName, const OString& aValue); void attribute(const OString& sTagName, const OString& aValue); void attribute(const char* sTagName, std::u16string_view aValue); - void attribute(const char* sTagName, sal_Int32 aNumber); + void attribute(const char* sTagName, sal_Int64 aNumber); + template <typename T> + requires std::is_arithmetic_v<T> void attribute(const char* sTagName, T aNumber) + { + if constexpr (std::is_floating_point_v<T>) + return attribute(sTagName, basegfx::fround64(aNumber)); + else + return attribute(sTagName, static_cast<sal_Int64>(aNumber)); + } void attributeDouble(const char* sTagName, double aNumber); void attributeBase64(const char* sTagName, std::vector<sal_uInt8> const& rValueInBytes); void attributeBase64(const char* sTagName, std::vector<char> const& rValueInBytes); diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index 3bfe3022df39..c9aacd000d35 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -375,7 +375,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFontsizeKeywords) assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[7]"_ostr, "fontcolor"_ostr, "#008000"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[7]"_ostr, "text"_ostr, "Sample"); - assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[7]"_ostr, "height"_ostr, "27"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[7]"_ostr, "height"_ostr, "28"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[7]"_ostr, "familyname"_ostr, "Times New Roman"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[8]"_ostr, "fontcolor"_ostr, "#ff7f50"); @@ -601,20 +601,20 @@ CPPUNIT_TEST_FIXTURE(Test, testMarkerOrient) xmlDocUniquePtr pDocument = dumpAndParseSvg(u"/svgio/qa/cppunit/data/MarkerOrient.svg"); assertXPath(pDocument, "/primitive2D/transform/transform[1]"_ostr, "xy11"_ostr, "0"); - assertXPath(pDocument, "/primitive2D/transform/transform[1]"_ostr, "xy12"_ostr, "0"); + assertXPath(pDocument, "/primitive2D/transform/transform[1]"_ostr, "xy12"_ostr, "1"); assertXPath(pDocument, "/primitive2D/transform/transform[1]"_ostr, "xy13"_ostr, "7"); - assertXPath(pDocument, "/primitive2D/transform/transform[1]"_ostr, "xy21"_ostr, "0"); + assertXPath(pDocument, "/primitive2D/transform/transform[1]"_ostr, "xy21"_ostr, "-1"); assertXPath(pDocument, "/primitive2D/transform/transform[1]"_ostr, "xy22"_ostr, "0"); assertXPath(pDocument, "/primitive2D/transform/transform[1]"_ostr, "xy23"_ostr, "13"); assertXPath(pDocument, "/primitive2D/transform/transform[1]"_ostr, "xy31"_ostr, "0"); assertXPath(pDocument, "/primitive2D/transform/transform[1]"_ostr, "xy32"_ostr, "0"); assertXPath(pDocument, "/primitive2D/transform/transform[1]"_ostr, "xy33"_ostr, "1"); - assertXPath(pDocument, "/primitive2D/transform/transform[2]"_ostr, "xy11"_ostr, "0"); + assertXPath(pDocument, "/primitive2D/transform/transform[2]"_ostr, "xy11"_ostr, "1"); assertXPath(pDocument, "/primitive2D/transform/transform[2]"_ostr, "xy12"_ostr, "0"); assertXPath(pDocument, "/primitive2D/transform/transform[2]"_ostr, "xy13"_ostr, "87"); assertXPath(pDocument, "/primitive2D/transform/transform[2]"_ostr, "xy21"_ostr, "0"); - assertXPath(pDocument, "/primitive2D/transform/transform[2]"_ostr, "xy22"_ostr, "0"); + assertXPath(pDocument, "/primitive2D/transform/transform[2]"_ostr, "xy22"_ostr, "1"); assertXPath(pDocument, "/primitive2D/transform/transform[2]"_ostr, "xy23"_ostr, "87"); assertXPath(pDocument, "/primitive2D/transform/transform[2]"_ostr, "xy31"_ostr, "0"); assertXPath(pDocument, "/primitive2D/transform/transform[2]"_ostr, "xy32"_ostr, "0"); @@ -647,7 +647,7 @@ CPPUNIT_TEST_FIXTURE(Test, testMarkerInCssStyle) assertXPath(pDocument, "/primitive2D/transform/transform[1]/polypolygonstroke/line"_ostr, "color"_ostr, "#008000"); assertXPath(pDocument, "/primitive2D/transform/transform[1]/polypolygonstroke/line"_ostr, "width"_ostr, "1"); assertXPath(pDocument, "/primitive2D/transform/transform[1]/polypolygonstroke/line"_ostr, "linejoin"_ostr, "Miter"); - assertXPath(pDocument, "/primitive2D/transform/transform[1]/polypolygonstroke/line"_ostr, "miterangle"_ostr, "28"); + assertXPath(pDocument, "/primitive2D/transform/transform[1]/polypolygonstroke/line"_ostr, "miterangle"_ostr, "29"); assertXPath(pDocument, "/primitive2D/transform/transform[1]/polypolygonstroke/line"_ostr, "linecap"_ostr, "BUTT"); } @@ -706,7 +706,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156777) // - Expected: #008000 // - Actual : #000000 assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]"_ostr, "fontcolor"_ostr, "#008000"); - assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]"_ostr, "x"_ostr, "84"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]"_ostr, "x"_ostr, "85"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]"_ostr, "y"_ostr, "23"); } @@ -721,7 +721,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156834) assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]"_ostr, "text"_ostr, "Middle"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]"_ostr, "x"_ostr, "30"); - assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]"_ostr, "y"_ostr, "56"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]"_ostr, "y"_ostr, "57"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]"_ostr, "text"_ostr, "Hanging"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]"_ostr, "x"_ostr, "30"); @@ -729,7 +729,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156834) assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[4]"_ostr, "text"_ostr, "Central"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[4]"_ostr, "x"_ostr, "30"); - assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[4]"_ostr, "y"_ostr, "116"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[4]"_ostr, "y"_ostr, "117"); } CPPUNIT_TEST_FIXTURE(Test, testTdf104339) @@ -811,10 +811,10 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156616) assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]"_ostr, "x"_ostr, "114"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]"_ostr, "y"_ostr, "122"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[4]"_ostr, "text"_ostr, "First"); - assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[4]"_ostr, "x"_ostr, "86"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[4]"_ostr, "x"_ostr, "87"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[4]"_ostr, "y"_ostr, "153"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[5]"_ostr, "text"_ostr, " line"); - assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[5]"_ostr, "x"_ostr, "114"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[5]"_ostr, "x"_ostr, "115"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[5]"_ostr, "y"_ostr, "153"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[6]"_ostr, "text"_ostr, "Second line"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[6]"_ostr, "x"_ostr, "77"); @@ -1220,7 +1220,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf94765) assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[1]"_ostr, "endy"_ostr, "1"); assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[2]"_ostr, "startx"_ostr, "0"); assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[2]"_ostr, "starty"_ostr, "0"); - assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[2]"_ostr, "endx"_ostr, "0"); + assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[2]"_ostr, "endx"_ostr, "1"); assertXPath(pDocument, "/primitive2D/transform/transform/svglineargradient[2]"_ostr, "endy"_ostr, "0"); } @@ -1333,7 +1333,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf97663) // tdf#97663: Without the fix in place, this test would have failed with // - Expected: 236 // - Actual : 204 - assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]"_ostr, "y"_ostr, "236"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]"_ostr, "y"_ostr, "237"); } CPPUNIT_TEST_FIXTURE(Test, testTdf156269) @@ -1551,7 +1551,7 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf156837) // Without the fix in place, this test would have failed with // - Expected: 94 // - Actual : 103 - assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]"_ostr, "y"_ostr, "94"); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]"_ostr, "y"_ostr, "95"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]"_ostr, "height"_ostr, "10"); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]"_ostr, "text"_ostr, " 3"); } diff --git a/svx/qa/unit/sdr.cxx b/svx/qa/unit/sdr.cxx index a58209941b5c..681e3100aca1 100644 --- a/svx/qa/unit/sdr.cxx +++ b/svx/qa/unit/sdr.cxx @@ -77,7 +77,7 @@ CPPUNIT_TEST_FIXTURE(SdrTest, testShadowScaleOrigin) // i.e. the shadow origin was not the top right corner for scaling (larger x position, so it was // visible on the right of the shape as well). CPPUNIT_ASSERT_EQUAL(sal_Int32(-705), fShadowX); - CPPUNIT_ASSERT_EQUAL(sal_Int32(-684), fShadowY); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-685), fShadowY); } CPPUNIT_TEST_FIXTURE(SdrTest, testShadowAlignment) @@ -97,35 +97,35 @@ CPPUNIT_TEST_FIXTURE(SdrTest, testShadowAlignment) xmlDocUniquePtr pDocument = aDumper.dumpAndParse(xPrimitiveSequence); // Without the accompanying fix in place, this test would have failed with: - // - Expected: -567 + // - Expected: -568 // - Actual : 162 // - In <>, attribute 'xy13' of '(//shadow/transform)[1]' incorrect value. // i.e. shadow alignment was ignored while scaling the shadow. - assertXPath(pDocument, "(//shadow/transform)[1]"_ostr, "xy13"_ostr, "-567"); + assertXPath(pDocument, "(//shadow/transform)[1]"_ostr, "xy13"_ostr, "-568"); assertXPath(pDocument, "(//shadow/transform)[1]"_ostr, "xy23"_ostr, "162"); - assertXPath(pDocument, "(//shadow/transform)[2]"_ostr, "xy13"_ostr, "-1794"); + assertXPath(pDocument, "(//shadow/transform)[2]"_ostr, "xy13"_ostr, "-1795"); assertXPath(pDocument, "(//shadow/transform)[2]"_ostr, "xy23"_ostr, "162"); assertXPath(pDocument, "(//shadow/transform)[3]"_ostr, "xy13"_ostr, "-3021"); assertXPath(pDocument, "(//shadow/transform)[3]"_ostr, "xy23"_ostr, "161"); - assertXPath(pDocument, "(//shadow/transform)[4]"_ostr, "xy13"_ostr, "-567"); + assertXPath(pDocument, "(//shadow/transform)[4]"_ostr, "xy13"_ostr, "-568"); assertXPath(pDocument, "(//shadow/transform)[4]"_ostr, "xy23"_ostr, "-749"); assertXPath(pDocument, "(//shadow/transform)[5]"_ostr, "xy13"_ostr, "-3021"); assertXPath(pDocument, "(//shadow/transform)[5]"_ostr, "xy23"_ostr, "-750"); - assertXPath(pDocument, "(//shadow/transform)[6]"_ostr, "xy13"_ostr, "-566"); - assertXPath(pDocument, "(//shadow/transform)[6]"_ostr, "xy23"_ostr, "-1691"); + assertXPath(pDocument, "(//shadow/transform)[6]"_ostr, "xy13"_ostr, "-567"); + assertXPath(pDocument, "(//shadow/transform)[6]"_ostr, "xy23"_ostr, "-1692"); - assertXPath(pDocument, "(//shadow/transform)[7]"_ostr, "xy13"_ostr, "-1794"); + assertXPath(pDocument, "(//shadow/transform)[7]"_ostr, "xy13"_ostr, "-1795"); assertXPath(pDocument, "(//shadow/transform)[7]"_ostr, "xy23"_ostr, "-1693"); - assertXPath(pDocument, "(//shadow/transform)[8]"_ostr, "xy13"_ostr, "-3022"); - assertXPath(pDocument, "(//shadow/transform)[8]"_ostr, "xy23"_ostr, "-1691"); + assertXPath(pDocument, "(//shadow/transform)[8]"_ostr, "xy13"_ostr, "-3023"); + assertXPath(pDocument, "(//shadow/transform)[8]"_ostr, "xy23"_ostr, "-1692"); - assertXPath(pDocument, "(//shadow/transform)[9]"_ostr, "xy13"_ostr, "-1794"); + assertXPath(pDocument, "(//shadow/transform)[9]"_ostr, "xy13"_ostr, "-1795"); assertXPath(pDocument, "(//shadow/transform)[9]"_ostr, "xy23"_ostr, "-750"); } { diff --git a/svx/qa/unit/svdraw.cxx b/svx/qa/unit/svdraw.cxx index 969f1256704f..3254e64161fb 100644 --- a/svx/qa/unit/svdraw.cxx +++ b/svx/qa/unit/svdraw.cxx @@ -734,8 +734,8 @@ CPPUNIT_TEST_FIXTURE(SvdrawTest, testClipVerticalTextOverflow) // make sure the text that isn't overflowing is still aligned properly assertXPathContent(pDocument, "count((//sdrblocktext)[5]//textsimpleportion)"_ostr, "3"); - assertXPath(pDocument, "((//sdrblocktext)[5]//textsimpleportion)[1]"_ostr, "y"_ostr, "5073"); - assertXPath(pDocument, "((//sdrblocktext)[5]//textsimpleportion)[3]"_ostr, "y"_ostr, "6597"); + assertXPath(pDocument, "((//sdrblocktext)[5]//textsimpleportion)[1]"_ostr, "y"_ostr, "5074"); + assertXPath(pDocument, "((//sdrblocktext)[5]//textsimpleportion)[3]"_ostr, "y"_ostr, "6598"); // Test vertically overflowing text, with vertical text direction assertXPathContent(pDocument, "count((//sdrblocktext)[6]//textsimpleportion)"_ostr, "12"); diff --git a/tools/source/xml/XmlWriter.cxx b/tools/source/xml/XmlWriter.cxx index 424b13c67b01..f49c312bd133 100644 --- a/tools/source/xml/XmlWriter.cxx +++ b/tools/source/xml/XmlWriter.cxx @@ -140,7 +140,7 @@ void XmlWriter::attribute(const char* name, std::u16string_view value) attribute(name, OUStringToOString(value, RTL_TEXTENCODING_UTF8)); } -void XmlWriter::attribute(const char* name, const sal_Int32 aNumber) +void XmlWriter::attribute(const char* name, const sal_Int64 aNumber) { attribute(name, OString::number(aNumber)); }