summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-02-11 22:02:11 +0900
committerTomaž Vajngerl <quikee@gmail.com>2023-03-05 05:27:04 +0000
commitb33468fa2b5dadddd7ce27afd40979aafff61285 (patch)
treea4422e843e80320878961b7d69b63d1e8231f6d1 /include
parent62a0eb0a604a91b84d346fb50a12f868dbf7147f (diff)
make NbcRotate abstract as it's implementation is noop
During testing the NbcRotate function on SdrObject it turned out the the function is essentially a noop, because it uses normal equality to test the values of a double, which are a product of sin and cos functions (to determine the 90 degree angles). So because of this the input rectangle was never modified - noop. Because of this we can just remove the impl. of the function and declare it abstract, so that the actual implementations define a valid function to rotate. There were some subclasses that didn't override the NbcRotate so they used the one implementation in SdrObject. These subclasses now override the function and in the implementation we call assert(false), which is never called during a test run. It seems we never rotate those objects. Change-Id: I1b1a45a8e96ed2d061f9b9f80c5fdaa5a84d4c05 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148266 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/svx/svdobj.hxx2
-rw-r--r--include/svx/svdopage.hxx2
2 files changed, 3 insertions, 1 deletions
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 52923dc5b92e..ab5066d699a2 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -542,7 +542,7 @@ public:
virtual void NbcMove (const Size& rSiz);
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
virtual void NbcCrop (const basegfx::B2DPoint& rRef, double fxFact, double fyFact);
- virtual void NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs);
+ virtual void NbcRotate(const Point& rRef, Degree100 nAngle, double sn, double cs) = 0;
// Utility for call sites that don't have sin and cos handy
void NbcRotate(const Point& rRef, Degree100 nAngle);
virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
diff --git a/include/svx/svdopage.hxx b/include/svx/svdopage.hxx
index abb35d8239cd..279c75c758a6 100644
--- a/include/svx/svdopage.hxx
+++ b/include/svx/svdopage.hxx
@@ -64,6 +64,8 @@ public:
virtual OUString TakeObjNameSingul() const override;
virtual OUString TakeObjNamePlural() const override;
+
+ void NbcRotate(const Point& rRef, Degree100 nAngle, double sinAngle, double cosAngle) override;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */