sd/source/ui/view/sdview2.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
New commits: commit b42516b433c1d71487db061a058887f6dd76dd74 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Sep 7 10:16:23 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Sep 7 17:29:34 2021 +0200 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 <caol...@redhat.com> 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()) );