summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-05-06 18:29:17 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2021-05-06 20:59:10 +0200
commitef5b56123701b62b7fabeb1d1d9a7d1a4aa00d97 (patch)
treeb98fab7f30fe77d90a204e0ca7595b188e7ef3b4
parenta7ff945ca031324f060b0d989f7a89594fcfe9fe (diff)
Limit scopes of some variables
Change-Id: Ia8b2aae8953e2543b5c49a2cd7ddc4e84ba46f4c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115197 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--svx/source/svdraw/svdedxv.cxx15
1 files changed, 5 insertions, 10 deletions
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 26f27d294b29..95379012be54 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -1717,19 +1717,14 @@ bool SdrObjEditView::IsTextEditHit(const Point& rHit) const
if (mxTextEditObj.is())
{
tools::Rectangle aEditArea;
- OutlinerView* pOLV = pTextEditOutliner->GetView(0);
- if (pOLV != nullptr)
- {
+ if (OutlinerView* pOLV = pTextEditOutliner->GetView(0))
aEditArea.Union(pOLV->GetOutputArea());
- }
- bOk = aEditArea.IsInside(rHit);
- if (bOk)
+
+ if (aEditArea.IsInside(rHit))
{ // check if any characters were actually hit
- Point aPnt(rHit);
- aPnt -= aEditArea.TopLeft();
+ const Point aPnt(rHit - aEditArea.TopLeft());
tools::Long nHitTol = 2000;
- OutputDevice* pRef = pTextEditOutliner->GetRefDevice();
- if (pRef)
+ if (OutputDevice* pRef = pTextEditOutliner->GetRefDevice())
nHitTol = OutputDevice::LogicToLogic(nHitTol, MapUnit::Map100thMM,
pRef->GetMapMode().GetMapUnit());