summaryrefslogtreecommitdiff
path: root/sd/source/ui/slidesorter/shell
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-05-16 12:26:55 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-05-16 12:26:55 +0100
commit689e53de62e83c17df592b3d020599acd2b41a4e (patch)
treeff2201db8994ec715dd8bd0c62263183fcf29fcc /sd/source/ui/slidesorter/shell
parent2f5bba2511ef5ef3ad92f8f9547e25128570c324 (diff)
no need to double dynamic_cast
Change-Id: I183d03c4c28f87790665ac971abc9544e86797f1
Diffstat (limited to 'sd/source/ui/slidesorter/shell')
-rw-r--r--sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx26
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;