Kaydet (Commit) 3f6e074d authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Avoid clang-analyzer-deadcode.DeadStores

...in case future modifications to SdrCropViewHdl::CreateB2dIAObject /will/ make
use of fRotate.

Change-Id: I059d61879fceca88893625b099d4e2c0bda65067
üst 6483e1c0
......@@ -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)
{
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment