summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-09-07 10:16:23 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-09-07 17:29:34 +0200
commitb42516b433c1d71487db061a058887f6dd76dd74 (patch)
treec1b9a7d5f032742d30c77b3c0717e87569ab7ac3 /sd
parent500f85145181ff219d801cb26b0cfd44a219598a (diff)
dynamic_cast followed by static_cast
Change-Id: If917550a1425d3ec82fcf7ad06dd9f9438fb2e30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121750 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/sdview2.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx
index 950a2422c599..6ac19f72e1e7 100644
--- a/sd/source/ui/view/sdview2.cxx
+++ b/sd/source/ui/view/sdview2.cxx
@@ -349,14 +349,11 @@ void View::StartDrag( const Point& rStartPos, vcl::Window* pWindow )
if( IsTextEdit() )
SdrEndTextEdit();
- DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >( mpDocSh ? mpDocSh->GetViewShell() : nullptr );
-
- if( pDrawViewShell )
+ if (DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>(mpDocSh ? mpDocSh->GetViewShell() : nullptr))
{
- const rtl::Reference<FuPoor>& xFunction( pDrawViewShell->GetCurrentFunction() );
-
- if( xFunction.is() && nullptr != dynamic_cast< const FuDraw *>( xFunction.get() ) )
- static_cast<FuDraw*>(xFunction.get())->ForcePointer();
+ const rtl::Reference<FuPoor>& xFunction(pDrawViewShell->GetCurrentFunction());
+ if (FuDraw* pFunction = dynamic_cast<FuDraw*>(xFunction.get()))
+ pFunction->ForcePointer();
}
mpDragSrcMarkList.reset( new SdrMarkList(GetMarkedObjectList()) );