summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-08-16 11:52:58 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-08-17 09:50:21 +0200
commitcdcebac3b5be695bcf390bda116f5a52209c0dd1 (patch)
tree0e79b9c6c4fa3ac4ffaf2c4ce714d45e5af5737a
parent2f3c3b8a205495df74e809f4167aa51400e5af89 (diff)
fetch GetMarkedSdrObj just once
Change-Id: I1af5326be2e71a5fe466b153177904907c12b7da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138387 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/frmedt/fefly1.cxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index 6ade7c6bb556..a63daab5e7ab 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -428,11 +428,14 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt )
return aRet;
const SdrMarkList &rMrkList = Imp()->GetDrawView()->GetMarkedObjectList();
- if ( rMrkList.GetMarkCount() != 1 ||
- !GetUserCall(rMrkList.GetMark( 0 )->GetMarkedSdrObj()) )
+ if (rMrkList.GetMarkCount() != 1)
+ return aRet;
+
+ SdrObject* pObj = rMrkList.GetMark(0)->GetMarkedSdrObj();
+
+ if (!GetUserCall(pObj))
return aRet;
- SdrObject* pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
// #i28701#
SwAnchoredObject* pAnchoredObj = ::GetUserCall( pObj )->GetAnchoredObj( pObj );
SwFrameFormat& rFormat = pAnchoredObj->GetFrameFormat();