summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-04-14 12:50:42 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2024-04-15 06:34:33 +0200
commit690526f95e3ee4fd25bb2c987e093543e4bc435b (patch)
tree06b6bb7b6c907fb1876eac1e60b7dac952b21f7b /sd
parent1dc92b9e9951ef118d2d823d54f9a022c2e41a27 (diff)
Generalize basegfx::fround for templated return type
And use it when assigning to tools::Long Change-Id: I0814d7bac9cdd48191ba69c64e3b12a4973b3417 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166071 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/layout-tests.cxx6
-rw-r--r--sd/source/core/sdpage.cxx16
2 files changed, 11 insertions, 11 deletions
diff --git a/sd/qa/unit/layout-tests.cxx b/sd/qa/unit/layout-tests.cxx
index a93584b62f67..6aaed8b55ab4 100644
--- a/sd/qa/unit/layout-tests.cxx
+++ b/sd/qa/unit/layout-tests.cxx
@@ -109,10 +109,10 @@ CPPUNIT_TEST_FIXTURE(SdLayoutTest, testTdf128212)
xmlDocUniquePtr pXmlDoc = load("pptx/tdf128212.pptx");
// Without the fix in place, this test would have failed with
- // - Expected: 7792
+ // - Expected: 7793
// - Actual : 12068
- assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray"_ostr, "x"_ostr, "4520");
- assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray"_ostr, "y"_ostr, "7792");
+ assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray"_ostr, "x"_ostr, "4521");
+ assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/textarray"_ostr, "y"_ostr, "7793");
}
CPPUNIT_TEST_FIXTURE(SdLayoutTest, testColumnsLayout)
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 020f1f6bbfd4..5c4eab5ee78c 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -1430,19 +1430,19 @@ static void CalcAutoLayoutRectangles( SdPage const & rPage,::tools::Rectangle* r
if(count == 0)
{
Size aSize ( aTitleRect.GetSize() );
- aSize.setHeight( basegfx::fround(aSize.Height() * propvalue[0]) );
- aSize.setWidth( basegfx::fround(aSize.Width() * propvalue[1]) );
- Point aPos( basegfx::fround(aTitlePos.X() +(aSize.Width() * propvalue[2])),
- basegfx::fround(aTitlePos.Y() + (aSize.Height() * propvalue[3])) );
+ aSize.setHeight( basegfx::fround<::tools::Long>(aSize.Height() * propvalue[0]) );
+ aSize.setWidth( basegfx::fround<::tools::Long>(aSize.Width() * propvalue[1]) );
+ Point aPos( basegfx::fround<::tools::Long>(aTitlePos.X() +(aSize.Width() * propvalue[2])),
+ basegfx::fround<::tools::Long>(aTitlePos.Y() + (aSize.Height() * propvalue[3])) );
rRectangle[count] = ::tools::Rectangle(aPos, aSize);
count = count+1;
}
else
{
- Size aSize( basegfx::fround(aLayoutSize.Width() * propvalue[1]),
- basegfx::fround(aLayoutSize.Height() * propvalue[0]) );
- Point aPos( basegfx::fround(aLayoutPos.X() +(aSize.Width() * propvalue[2])),
- basegfx::fround(aLayoutPos.Y() + (aSize.Height() * propvalue[3])) );
+ Size aSize( basegfx::fround<::tools::Long>(aLayoutSize.Width() * propvalue[1]),
+ basegfx::fround<::tools::Long>(aLayoutSize.Height() * propvalue[0]) );
+ Point aPos( basegfx::fround<::tools::Long>(aLayoutPos.X() +(aSize.Width() * propvalue[2])),
+ basegfx::fround<::tools::Long>(aLayoutPos.Y() + (aSize.Height() * propvalue[3])) );
rRectangle[count] = ::tools::Rectangle (aPos, aSize);
count = count+1;
}