summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-04-28 00:28:41 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2019-04-28 08:34:46 +0200
commit38e7f933c86b66010f65d821155eccd9e8a4135e (patch)
tree9b71f3b1927f66394af0ce1560388a6cb2daf96a /sd
parent3159ba99d16bf875c28b77c1219a794d9e9a6186 (diff)
tdf#120703 PVS: V581 ifs with identical conditions
V581 The conditional expressions of the 'if' statements situated alongside each other are identical. Change-Id: I11fa13677c7980e6ac17fc4358406472ee784e41 Reviewed-on: https://gerrit.libreoffice.org/71446 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/slideshow/slideshow.cxx12
-rw-r--r--sd/source/ui/slidesorter/controller/SlsSlotManager.cxx7
2 files changed, 7 insertions, 12 deletions
diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx
index a358bbfee73f..5fec836f5090 100644
--- a/sd/source/ui/slideshow/slideshow.cxx
+++ b/sd/source/ui/slideshow/slideshow.cxx
@@ -727,8 +727,7 @@ void SAL_CALL SlideShow::end()
if( mpCurrentViewShellBase )
{
- ViewShell* pViewShell = mpCurrentViewShellBase->GetMainViewShell().get();
- if( pViewShell )
+ if (ViewShell* const pViewShell = mpCurrentViewShellBase->GetMainViewShell().get())
{
// invalidate the view shell so the presentation slot will be re-enabled
// and the rehearsing will be updated
@@ -773,11 +772,12 @@ void SAL_CALL SlideShow::end()
}
}
}
- }
- //Fire the acc focus event when focus is switched back. The above method mpCurrentViewShellBase->GetWindow()->GrabFocus() will
- //set focus to WorkWindow instead of the sd::window, so here call Shell's method to fire the focus event
- if (pViewShell)
+
+ // Fire the acc focus event when focus is switched back. The above method
+ // mpCurrentViewShellBase->GetWindow()->GrabFocus() will set focus to WorkWindow
+ // instead of the sd::window, so here call Shell's method to fire the focus event
pViewShell->SwitchActiveViewFireFocus();
+ }
}
mpCurrentViewShellBase = nullptr;
}
diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
index 420c99f86e80..55b58e197f1c 100644
--- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
+++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx
@@ -665,15 +665,10 @@ void SlotManager::GetMenuState (SfxItemSet& rSet)
if (eEditMode == EditMode::MasterPage)
{
+ // Disable some slots when in master page mode.
rSet.DisableItem(SID_ASSIGN_LAYOUT);
rSet.DisableItem(SID_INSERTPAGE);
- }
- // Disable some slots when in master page mode.
- if (eEditMode == EditMode::MasterPage)
- {
- if (rSet.GetItemState(SID_INSERTPAGE) == SfxItemState::DEFAULT)
- rSet.DisableItem(SID_INSERTPAGE);
if (rSet.GetItemState(SID_DUPLICATE_PAGE) == SfxItemState::DEFAULT)
rSet.DisableItem(SID_DUPLICATE_PAGE);
}