summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-10-07 17:28:09 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-10-07 17:51:37 +0200
commit3f6e074d8e77c0cd82f9715b48024e81470180d3 (patch)
tree0dff21199d125d96f7a37cf8f1eade6e43326bd9 /svx
parent6483e1c0cd61c36bd326621ba653413ae25503b3 (diff)
Avoid clang-analyzer-deadcode.DeadStores
...in case future modifications to SdrCropViewHdl::CreateB2dIAObject /will/ make use of fRotate. Change-Id: I059d61879fceca88893625b099d4e2c0bda65067
Diffstat (limited to 'svx')
-rw-r--r--svx/source/svdraw/svdedxv.cxx2
-rw-r--r--svx/source/svdraw/svdhdl.cxx33
2 files changed, 22 insertions, 13 deletions
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index f30421efc397..92ed90c9217a 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1683,7 +1683,6 @@ bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
mxTextEditObj->SetMergedItemSetAndBroadcast(*pSet, bReplaceAll);
FlushComeBackTimer(); // to set ModeHasChanged immediately
- bRet=true;
}
}
else if (!bOnlyEEItems)
@@ -1728,7 +1727,6 @@ bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll)
}
}
FlushComeBackTimer();
- bRet=true;
}
if(!bNoEEItems)
{
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 256e00352a42..84a53dce82f0 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -19,6 +19,7 @@
#include <algorithm>
+#include <cassert>
#include <svx/svdhdl.hxx>
#include <svx/svdpagv.hxx>
@@ -2396,6 +2397,26 @@ SdrCropViewHdl::SdrCropViewHdl(
{
}
+namespace {
+
+void translateRotationToMirroring(basegfx::B2DVector & scale, double * rotate) {
+ assert(rotate != nullptr);
+
+ // detect 180 degree rotation, this is the same as mirrored in X and Y,
+ // thus change to mirroring. Prefer mirroring here. Use the equal call
+ // with getSmallValue here, the original which uses rtl::math::approxEqual
+ // is too correct here. Maybe this changes with enhanced precision in aw080
+ // to the better so that this can be reduced to the more precise call again
+ if(basegfx::fTools::equal(fabs(*rotate), F_PI, 0.000000001))
+ {
+ scale.setX(scale.getX() * -1.0);
+ scale.setY(scale.getY() * -1.0);
+ *rotate = 0.0;
+ }
+}
+
+}
+
void SdrCropViewHdl::CreateB2dIAObject()
{
GetRidOfIAObject();
@@ -2418,17 +2439,7 @@ void SdrCropViewHdl::CreateB2dIAObject()
return;
}
- // detect 180 degree rotation, this is the same as mirrored in X and Y,
- // thus change to mirroring. Prefer mirroring here. Use the equal call
- // with getSmallValue here, the original which uses rtl::math::approxEqual
- // is too correct here. Maybe this changes with enhanced precision in aw080
- // to the better so that this can be reduced to the more precise call again
- if(basegfx::fTools::equal(fabs(fRotate), F_PI, 0.000000001))
- {
- aScale.setX(aScale.getX() * -1.0);
- aScale.setY(aScale.getY() * -1.0);
- fRotate = 0.0;
- }
+ translateRotationToMirroring(aScale, &fRotate);
// remember mirroring, reset at Scale and adapt crop values for usage;
// mirroring can stay in the object transformation, so do not have to