diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-05-16 12:26:55 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-05-16 12:26:55 +0100 |
commit | 689e53de62e83c17df592b3d020599acd2b41a4e (patch) | |
tree | ff2201db8994ec715dd8bd0c62263183fcf29fcc /sd | |
parent | 2f5bba2511ef5ef3ad92f8f9547e25128570c324 (diff) |
no need to double dynamic_cast
Change-Id: I183d03c4c28f87790665ac971abc9544e86797f1
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 3393c5a8f182..73cd3a84feb0 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -720,15 +720,12 @@ void SlideSorterViewShell::GetStateMovePageFirst (SfxItemSet& rSet) if ( ! IsMainViewShell()) { std::shared_ptr<ViewShell> pMainViewShell = GetViewShellBase().GetMainViewShell(); - if (pMainViewShell.get() != nullptr && nullptr != dynamic_cast< const DrawViewShell *>( pMainViewShell.get() )) + DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>(pMainViewShell.get()); + if (pDrawViewShell != nullptr && pDrawViewShell->GetPageKind() == PK_HANDOUT) { - DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>(pMainViewShell.get()); - if (pDrawViewShell != nullptr && pDrawViewShell->GetPageKind() == PK_HANDOUT) - { - rSet.DisableItem( SID_MOVE_PAGE_FIRST ); - rSet.DisableItem( SID_MOVE_PAGE_UP ); - return; - } + rSet.DisableItem( SID_MOVE_PAGE_FIRST ); + rSet.DisableItem( SID_MOVE_PAGE_UP ); + return; } } @@ -837,15 +834,12 @@ void SlideSorterViewShell::ExecMovePageLast (SfxRequest& /*rReq*/) void SlideSorterViewShell::GetStateMovePageLast (SfxItemSet& rSet) { std::shared_ptr<ViewShell> pMainViewShell = GetViewShellBase().GetMainViewShell(); - if (pMainViewShell.get() != nullptr && nullptr != dynamic_cast< const DrawViewShell *>( pMainViewShell.get() )) + DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>(pMainViewShell.get()); + if (pDrawViewShell != nullptr && pDrawViewShell->GetPageKind() == PK_HANDOUT) { - DrawViewShell* pDrawViewShell = dynamic_cast<DrawViewShell*>(pMainViewShell.get()); - if (pDrawViewShell != nullptr && pDrawViewShell->GetPageKind() == PK_HANDOUT) - { - rSet.DisableItem( SID_MOVE_PAGE_LAST ); - rSet.DisableItem( SID_MOVE_PAGE_DOWN ); - return; - } + rSet.DisableItem( SID_MOVE_PAGE_LAST ); + rSet.DisableItem( SID_MOVE_PAGE_DOWN ); + return; } sal_uInt16 lastSelectedPageNo = 0; |