summaryrefslogtreecommitdiff
path: root/sc/qa
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2020-12-22 15:42:08 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-01-02 15:26:38 +0100
commit11e52fe2979b0947814a49b9c17ec373795cbf8e (patch)
tree48268579f052b7fdfcc2c334fffe8c91d29cb234 /sc/qa
parent610ceb05025c9c7a9a34dddcb0dac506b8eab441 (diff)
introduce Degree100 strong_int type
Change-Id: I78f837a1340be0ca5c49097f543a481b7b43a632 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108367 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/qa')
-rw-r--r--sc/qa/unit/scshapetest.cxx19
-rw-r--r--sc/qa/unit/ucalc.cxx6
2 files changed, 14 insertions, 11 deletions
diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx
index 14dc129e6951..344a26e28901 100644
--- a/sc/qa/unit/scshapetest.cxx
+++ b/sc/qa/unit/scshapetest.cxx
@@ -234,16 +234,17 @@ void ScShapeTest::testTdf137033_RotShear_ResizeHide()
// Verify hiding has changed shape geometry as expected
tools::Rectangle aSnapRect(pObj->GetSnapRect());
- tools::Long aRotateAngle(pObj->GetRotateAngle());
- tools::Long aShearAngle(pObj->GetShearAngle());
+ Degree100 aRotateAngle(pObj->GetRotateAngle());
+ Degree100 aShearAngle(pObj->GetShearAngle());
// mathematical exact would be Point(3868, 4795), Size(9763, 1909)
// current values as of LO 7.2
const tools::Rectangle aExpectRect(Point(3871, 4796), Size(9764, 1910));
- const tools::Long aExpectRotateAngle(20923);
- const tools::Long aExpectShearAngle(-6572);
- CPPUNIT_ASSERT_MESSAGE("Hide rows, shear angle: ", abs(aShearAngle - aExpectShearAngle) <= 1);
+ const Degree100 aExpectRotateAngle(20923_deg100);
+ const Degree100 aExpectShearAngle(-6572_deg100);
+ CPPUNIT_ASSERT_MESSAGE("Hide rows, shear angle: ",
+ abs(aShearAngle - aExpectShearAngle) <= 1_deg100);
CPPUNIT_ASSERT_MESSAGE("Hide rows, rotate angle: ",
- abs(aRotateAngle - aExpectRotateAngle) <= 1);
+ abs(aRotateAngle - aExpectRotateAngle) <= 1_deg100);
lcl_AssertRectEqualWithTolerance("Reload: wrong pos or size", aExpectRect, aSnapRect, 1);
// Save and reload.
@@ -269,8 +270,10 @@ void ScShapeTest::testTdf137033_RotShear_ResizeHide()
aSnapRect = pObj->GetSnapRect();
aRotateAngle = pObj->GetRotateAngle();
aShearAngle = pObj->GetShearAngle();
- CPPUNIT_ASSERT_MESSAGE("Reload, shear angle: ", abs(aShearAngle - aExpectShearAngle) <= 3);
- CPPUNIT_ASSERT_MESSAGE("Reload, rotate angle: ", abs(aRotateAngle - aExpectRotateAngle) <= 3);
+ CPPUNIT_ASSERT_MESSAGE("Reload, shear angle: ",
+ abs(aShearAngle - aExpectShearAngle) <= 3_deg100);
+ CPPUNIT_ASSERT_MESSAGE("Reload, rotate angle: ",
+ abs(aRotateAngle - aExpectRotateAngle) <= 3_deg100);
lcl_AssertRectEqualWithTolerance("Reload: wrong pos or size", aExpectRect, aSnapRect, 4);
pDocSh->DoClose();
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 774f3eb7069a..cbf2267ce07e 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -5715,9 +5715,9 @@ void Test::testAnchoredRotatedShape()
SdrRectObj *pObj = new SdrRectObj(*pDrawLayer, aRect);
pPage->InsertObject(pObj);
Point aRef1(pObj->GetSnapRect().Center());
- int nAngle = 9000; //90 deg.
- double nSin = sin(nAngle * F_PI18000);
- double nCos = cos(nAngle * F_PI18000);
+ Degree100 nAngle = 9000_deg100; //90 deg.
+ double nSin = sin(nAngle.get() * F_PI18000);
+ double nCos = cos(nAngle.get() * F_PI18000);
pObj->Rotate(aRef1,nAngle,nSin,nCos);
ScDrawLayer::SetCellAnchoredFromPosition(*pObj, *m_pDoc, 0, true);