summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-08-19 15:58:16 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-08-20 15:21:21 +0200
commit01408f9da879f69adbfee515efb4d8a57af2460e (patch)
treebcfeef176fce26acd162846da1585eb1002f18e3 /svx/source
parented3aa0575d73f34d5fa666d147c569ce3d55048d (diff)
Revert "ofz#37370 Null-dereference"
This reverts the code of commit 9343551f5588ffa4916e2c5d33cbd6fcf56ca99d but keeps the test-case No reason to have this after: 0bb3ccf9148106ce3e5d9e03c23ab5a9602e843c 'Revert "Simplify Rect2Poly"' Change-Id: I37f363e51dc5daed3faf85f27203b2cfe09b82c1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120746 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/svdraw/svdotxtr.cxx27
1 files changed, 13 insertions, 14 deletions
diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx
index 0b667f18ce0c..e499a332400c 100644
--- a/svx/source/svdraw/svdotxtr.cxx
+++ b/svx/source/svdraw/svdotxtr.cxx
@@ -239,21 +239,20 @@ void SdrTextObj::NbcMirror(const Point& rRef1, const Point& rRef2)
std::abs(rRef1.X()-rRef2.X())==std::abs(rRef1.Y()-rRef2.Y()))) {
bRotate90=maGeo.nRotationAngle.get() % 9000 ==0;
}
- if (!maRect.IsEmpty()) { // ofz#37370 an 'empty' rect creates a polygon with 0 points
- tools::Polygon aPol(Rect2Poly(maRect,maGeo));
- sal_uInt16 nPointCount = aPol.GetSize();
- for (sal_uInt16 i = 0; i < nPointCount; ++i) {
- MirrorPoint(aPol[i],rRef1,rRef2);
- }
- // turn polygon and move it a little
- tools::Polygon aPol0(aPol);
- aPol[0]=aPol0[1];
- aPol[1]=aPol0[0];
- aPol[2]=aPol0[3];
- aPol[3]=aPol0[2];
- aPol[4]=aPol0[1];
- Poly2Rect(aPol,maRect,maGeo);
+ tools::Polygon aPol(Rect2Poly(maRect,maGeo));
+ sal_uInt16 i;
+ sal_uInt16 nPointCount=aPol.GetSize();
+ for (i=0; i<nPointCount; i++) {
+ MirrorPoint(aPol[i],rRef1,rRef2);
}
+ // turn polygon and move it a little
+ tools::Polygon aPol0(aPol);
+ aPol[0]=aPol0[1];
+ aPol[1]=aPol0[0];
+ aPol[2]=aPol0[3];
+ aPol[3]=aPol0[2];
+ aPol[4]=aPol0[1];
+ Poly2Rect(aPol,maRect,maGeo);
if (bRotate90) {
bool bRota90=maGeo.nRotationAngle.get() % 9000 ==0;