[Libreoffice-commits] core.git: sd/source

Caolán McNamara caolanm at redhat.com
Wed Sep 27 16:07:55 UTC 2017


 sd/source/ui/func/fuolbull.cxx |   18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

New commits:
commit 0d45001d0112df2820c18fed648e648c94d2e5a3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Sep 26 14:42:04 2017 +0100

    dynamic_cast followed by static_cast
    
    Change-Id: I9c208cfedd87f04489c6bab4399c438e6aee1cbe
    Reviewed-on: https://gerrit.libreoffice.org/42862
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index 24803eb84020..03deeed1b511 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -99,12 +99,10 @@ void FuOutlineBullet::DoExecute( SfxRequest& rReq )
 
                     std::unique_ptr< OutlineViewModelChangeGuard > aGuard;
 
-                    if( dynamic_cast< const OutlineView *>( mpView ) !=  nullptr)
+                    if (OutlineView* pView = dynamic_cast<OutlineView*>(mpView))
                     {
-                        pOLV = static_cast<OutlineView*>(mpView)
-                            ->GetViewByWindow(mpViewShell->GetActiveWindow());
-
-                        aGuard.reset( new OutlineViewModelChangeGuard( static_cast<OutlineView&>(*mpView) ) );
+                        pOLV = pView->GetViewByWindow(mpViewShell->GetActiveWindow());
+                        aGuard.reset(new OutlineViewModelChangeGuard(*pView));
                     }
 
                     if( pOLV )
@@ -235,14 +233,10 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq)
 
     OutlinerView* pOLV = mpView->GetTextEditOutlinerView();
     std::unique_ptr< OutlineViewModelChangeGuard > aGuard;
+    if (OutlineView* pView = dynamic_cast<OutlineView*>(mpView))
     {
-        if( dynamic_cast< const OutlineView *>( mpView ) !=  nullptr)
-        {
-            pOLV = static_cast<OutlineView*>(mpView)
-                ->GetViewByWindow(mpViewShell->GetActiveWindow());
-
-            aGuard.reset( new OutlineViewModelChangeGuard( static_cast<OutlineView&>(*mpView) ) );
-        }
+        pOLV = pView->GetViewByWindow(mpViewShell->GetActiveWindow());
+        aGuard.reset(new OutlineViewModelChangeGuard(*pView));
     }
 
     SdrOutliner* pOwner = bInMasterView ? mpView->GetTextEditOutliner() : nullptr;


More information about the Libreoffice-commits mailing list