diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-28 16:10:06 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-28 15:05:32 +0100 |
commit | 3040d328c944d91b0cd612d86d358823b5c5b883 (patch) | |
tree | 689dd912ebff40137de98a7cf61b4042b9ec2cf2 /sfx2 | |
parent | d86778573a1ef207748cf8a6ca67eaef5cf04b02 (diff) |
tdf#120703 PVS: V547 Expression is always true/false
Change-Id: Iaa1a1811b638aadfe6b06b3465a182cb675031b5
Reviewed-on: https://gerrit.libreoffice.org/62476
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/control/shell.cxx | 12 | ||||
-rw-r--r-- | sfx2/source/view/sfxbasecontroller.cxx | 11 |
2 files changed, 8 insertions, 15 deletions
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx index a5f942cbb935..70df660c4d23 100644 --- a/sfx2/source/control/shell.cxx +++ b/sfx2/source/control/shell.cxx @@ -579,14 +579,10 @@ void SfxShell::SetVerbs(const css::uno::Sequence < css::embed::VerbDescriptor >& pImpl->aVerbList = aVerbs; - if (pViewSh) - { - // The status of SID_OBJECT is collected in the controller directly on - // the Shell, it is thus enough to encourage a new status update - SfxBindings *pBindings = pViewSh->GetViewFrame()->GetDispatcher()-> - GetBindings(); - pBindings->Invalidate( SID_OBJECT, true, true ); - } + // The status of SID_OBJECT is collected in the controller directly on + // the Shell, it is thus enough to encourage a new status update + SfxBindings* pBindings = pViewSh->GetViewFrame()->GetDispatcher()->GetBindings(); + pBindings->Invalidate(SID_OBJECT, true, true); } const css::uno::Sequence < css::embed::VerbDescriptor >& SfxShell::GetVerbs() const diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 3d06277c40e8..a15f07f3831c 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -1107,10 +1107,8 @@ uno::Sequence< sal_Int16 > SAL_CALL SfxBaseController::getSupportedCommandGroups SolarMutexGuard aGuard; std::vector< sal_Int16 > aGroupList; - SfxViewFrame* pViewFrame( m_pData->m_pViewShell->GetFrame() ); - SfxSlotPool* pPool = &SfxSlotPool::GetSlotPool( pViewFrame ); - - SfxSlotPool* pSlotPool = pPool ? pPool : &SFX_SLOTPOOL(); + SfxViewFrame* pViewFrame = m_pData->m_pViewShell ? m_pData->m_pViewShell->GetFrame() : nullptr; + SfxSlotPool* pSlotPool = pViewFrame ? &SfxSlotPool::GetSlotPool(pViewFrame) : &SFX_SLOTPOOL(); const SfxSlotMode nMode( SfxSlotMode::TOOLBOXCONFIG|SfxSlotMode::ACCELCONFIG|SfxSlotMode::MENUCONFIG ); // Select Group ( Group 0 is internal ) @@ -1143,9 +1141,8 @@ uno::Sequence< frame::DispatchInformation > SAL_CALL SfxBaseController::getConfi const SfxSlotMode nMode( SfxSlotMode::TOOLBOXCONFIG|SfxSlotMode::ACCELCONFIG|SfxSlotMode::MENUCONFIG ); SfxViewFrame* pViewFrame( m_pData->m_pViewShell->GetFrame() ); - SfxSlotPool* pPool( &SfxSlotPool::GetSlotPool( pViewFrame )); - - SfxSlotPool* pSlotPool = pPool ? pPool : &SFX_SLOTPOOL(); + SfxSlotPool* pSlotPool + = pViewFrame ? &SfxSlotPool::GetSlotPool(pViewFrame) : &SFX_SLOTPOOL(); for ( sal_uInt16 i=0; i<pSlotPool->GetGroupCount(); i++ ) { pSlotPool->SeekGroup( i ); |