summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-09-26 14:42:04 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-09-27 18:07:33 +0200
commit0d45001d0112df2820c18fed648e648c94d2e5a3 (patch)
tree847997ea4737612408818eabc8f77b26cfb70fec /sd
parent7e76b983301b02dd7020636905b764b981b1fff0 (diff)
dynamic_cast followed by static_cast
Change-Id: I9c208cfedd87f04489c6bab4399c438e6aee1cbe Reviewed-on: https://gerrit.libreoffice.org/42862 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/func/fuolbull.cxx18
1 files changed, 6 insertions, 12 deletions
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;