summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-09-30 09:39:36 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-09-30 11:48:48 +0200
commit7ced53424a21ab264374d97aacdfb4ec166c8171 (patch)
treea119f33d08617939ed0a8c8dc4870c7832443506 /svx/source/svdraw
parent6b709ad5d46dc33f29ec28183cea40cf9e77e2af (diff)
loplugin:reducevarscope in svx
Change-Id: I88fdaa74c4944f9ffc81db6df08a29283362375a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103647 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/svdhdl.cxx8
-rw-r--r--svx/source/svdraw/svdmodel.cxx2
-rw-r--r--svx/source/svdraw/svdoashp.cxx4
-rw-r--r--svx/source/svdraw/svdview.cxx3
4 files changed, 6 insertions, 11 deletions
diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx
index 9a3380e8b2b9..001fe3580b86 100644
--- a/svx/source/svdraw/svdhdl.cxx
+++ b/svx/source/svdraw/svdhdl.cxx
@@ -745,11 +745,10 @@ BitmapEx ImpGetBitmapEx(BitmapMarkerKind eKindOfMarker, BitmapColorIndex eIndex)
// use this code path only when we use HiDPI (for now)
if (Application::GetDefaultDevice()->GetDPIScalePercentage() > 100)
{
- OUString sMarkerPrefix("svx/res/marker-");
-
OUString sMarkerName = appendMarkerName(eKindOfMarker);
if (!sMarkerName.isEmpty())
{
+ OUString sMarkerPrefix("svx/res/marker-");
BitmapEx aBitmapEx;
if (eKindOfMarker == BitmapMarkerKind::Crosshair
@@ -1373,8 +1372,6 @@ void SdrHdlGradient::FromIAOToItem(SdrObject* _pObj, bool bSetItemOnObject, bool
GradTransGradient aGradTransGradient;
GradTransVector aGradTransVector;
- OUString aString;
-
aGradTransVector.maPositionA = basegfx::B2DPoint(GetPos().X(), GetPos().Y());
aGradTransVector.maPositionB = basegfx::B2DPoint(Get2ndPos().X(), Get2ndPos().Y());
if(pColHdl1)
@@ -1394,16 +1391,15 @@ void SdrHdlGradient::FromIAOToItem(SdrObject* _pObj, bool bSetItemOnObject, bool
{
SdrModel& rModel(_pObj->getSdrModelFromSdrObject());
SfxItemSet aNewSet(rModel.GetItemPool());
+ const OUString aString;
if(IsGradient())
{
- aString.clear();
XFillGradientItem aNewGradItem(aString, aGradTransGradient.aGradient);
aNewSet.Put(aNewGradItem);
}
else
{
- aString.clear();
XFillFloatTransparenceItem aNewTransItem(aString, aGradTransGradient.aGradient);
aNewSet.Put(aNewTransItem);
}
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index c3afe2ccb352..81b5dbaad0c4 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1867,9 +1867,9 @@ SvxNumType SdrModel::GetPageNumType() const
void SdrModel::ReadUserDataSequenceValue(const css::beans::PropertyValue* pValue)
{
- bool bBool = false;
if (pValue->Name == "AnchoredTextOverflowLegacy")
{
+ bool bBool = false;
if (pValue->Value >>= bBool)
{
mpImpl->mbAnchoredTextOverflowLegacy = bBool;
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 3e7391d8123c..fd708af04550 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -2083,8 +2083,8 @@ void SdrObjCustomShape::DragCreateObject( SdrDragStat& rStat )
std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() );
- sal_uInt32 const nDefaultObjectSizeWidth = 3000; // default width from SDOptions ?
- sal_uInt32 const nDefaultObjectSizeHeight= 3000;
+ constexpr sal_uInt32 nDefaultObjectSizeWidth = 3000; // default width from SDOptions ?
+ constexpr sal_uInt32 nDefaultObjectSizeHeight= 3000;
if ( ImpVerticalSwitch( *this ) )
{
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index d74e5e8bf800..2cf43d6669e8 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -1086,9 +1086,8 @@ PointerStyle SdrView::GetPreferredPointer(const Point& rMousePos, const OutputDe
SdrHdl* pH2=maHdlList.GetHdl(SdrHdlKind::Ref2);
bool b90=false;
bool b45=false;
- Point aDif;
if (pH1!=nullptr && pH2!=nullptr) {
- aDif=pH2->GetPos()-pH1->GetPos();
+ Point aDif = pH2->GetPos()-pH1->GetPos();
b90=(aDif.X()==0) || aDif.Y()==0;
b45=b90 || (std::abs(aDif.X())==std::abs(aDif.Y()));
}