summaryrefslogtreecommitdiff
path: root/sw/source/core/draw
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 /sw/source/core/draw
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 'sw/source/core/draw')
-rw-r--r--sw/source/core/draw/dcontact.cxx8
-rw-r--r--sw/source/core/draw/dflyobj.cxx16
2 files changed, 12 insertions, 12 deletions
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 3ae40ccde5a2..3d7fdc18120d 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -2393,7 +2393,7 @@ void SwDrawVirtObj::NbcResize(const Point& rRef, const Fraction& xFact, const Fr
SetRectsDirty();
}
-void SwDrawVirtObj::NbcRotate(const Point& rRef, tools::Long nAngle, double sn, double cs)
+void SwDrawVirtObj::NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs)
{
rRefObj.NbcRotate(rRef - GetOffset(), nAngle, sn, cs);
SetRectsDirty();
@@ -2405,7 +2405,7 @@ void SwDrawVirtObj::NbcMirror(const Point& rRef1, const Point& rRef2)
SetRectsDirty();
}
-void SwDrawVirtObj::NbcShear(const Point& rRef, tools::Long nAngle, double tn, bool bVShear)
+void SwDrawVirtObj::NbcShear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear)
{
rRefObj.NbcShear(rRef - GetOffset(), nAngle, tn, bVShear);
SetRectsDirty();
@@ -2427,7 +2427,7 @@ void SwDrawVirtObj::Resize(const Point& rRef, const Fraction& xFact, const Fract
}
}
-void SwDrawVirtObj::Rotate(const Point& rRef, tools::Long nAngle, double sn, double cs)
+void SwDrawVirtObj::Rotate(const Point& rRef, Degree100 nAngle, double sn, double cs)
{
if(nAngle)
{
@@ -2446,7 +2446,7 @@ void SwDrawVirtObj::Mirror(const Point& rRef1, const Point& rRef2)
SendUserCall(SdrUserCallType::Resize, aBoundRect0);
}
-void SwDrawVirtObj::Shear(const Point& rRef, tools::Long nAngle, double tn, bool bVShear)
+void SwDrawVirtObj::Shear(const Point& rRef, Degree100 nAngle, double tn, bool bVShear)
{
if(nAngle)
{
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 31ddcf4dd727..a06f0e8415c3 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -378,20 +378,20 @@ bool SwVirtFlyDrawObj::HasLimitedRotation() const
return ContainsSwGrfNode();
}
-void SwVirtFlyDrawObj::Rotate(const Point& rRef, tools::Long nAngle, double sn, double cs)
+void SwVirtFlyDrawObj::Rotate(const Point& rRef, Degree100 nAngle100, double sn, double cs)
{
if(ContainsSwGrfNode())
{
// RotGrfFlyFrame: Here is where the positively completed rotate interaction is executed.
// Rotation is in 1/100th degree and may be signed (!)
- nAngle /= 10;
+ Degree10 nAngle10 = toDegree10(nAngle100);
- while(nAngle < 0)
+ while(nAngle10 < 0_deg10)
{
- nAngle += 3600;
+ nAngle10 += 3600_deg10;
}
- SwWrtShell *pShForAngle = nAngle ? dynamic_cast<SwWrtShell*>(GetFlyFrame()->getRootFrame()->GetCurrShell()) : nullptr;
+ SwWrtShell *pShForAngle = nAngle10 ? dynamic_cast<SwWrtShell*>(GetFlyFrame()->getRootFrame()->GetCurrShell()) : nullptr;
if (pShForAngle)
{
// RotGrfFlyFrame: Add transformation to placeholder object
@@ -399,13 +399,13 @@ void SwVirtFlyDrawObj::Rotate(const Point& rRef, tools::Long nAngle, double sn,
const Degree10 nOldRot(SwVirtFlyDrawObj::getPossibleRotationFromFraphicFrame(aSize));
SwFlyFrameAttrMgr aMgr(false, pShForAngle, Frmmgr_Type::NONE, nullptr);
- aMgr.SetRotation(nOldRot, (nOldRot + Degree10(nAngle)) % 3600_deg10, aSize);
+ aMgr.SetRotation(nOldRot, (nOldRot + nAngle10) % 3600_deg10, aSize);
}
}
else
{
// call parent
- SdrVirtObj::Rotate(rRef, nAngle, sn, cs);
+ SdrVirtObj::Rotate(rRef, nAngle100, sn, cs);
}
}
@@ -1167,7 +1167,7 @@ Degree10 SwVirtFlyDrawObj::getPossibleRotationFromFraphicFrame(Size& rSize) cons
return nRetval;
}
-tools::Long SwVirtFlyDrawObj::GetRotateAngle() const
+Degree100 SwVirtFlyDrawObj::GetRotateAngle() const
{
if(ContainsSwGrfNode())
{