diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-03 15:43:04 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-11-03 20:47:58 +0100 |
commit | 49747ff2337fd1f4a3ee8e16d6328b8dacad99ec (patch) | |
tree | 110901102d4ae356b161434a4e4064a28a0a738a /sd | |
parent | 0981f1d8c8a8918b5f28bf5605023b07e73b0d44 (diff) |
tdf#120703 PVS: V547 Expression is always true/false
Change-Id: I75082c85862b83ed2503900186ce9c70783e54db
Reviewed-on: https://gerrit.libreoffice.org/62817
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/docshell/docshel4.cxx | 12 | ||||
-rw-r--r-- | sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx | 5 | ||||
-rw-r--r-- | sd/source/ui/view/DocumentRenderer.cxx | 15 |
3 files changed, 11 insertions, 21 deletions
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index fca227e683c7..672181e24fbb 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -568,17 +568,11 @@ bool DrawDocShell::Save() bool DrawDocShell::SaveAs( SfxMedium& rMedium ) { mpDoc->setDocAccTitle(OUString()); - SfxViewFrame* pFrame1 = SfxViewFrame::GetFirst( this ); - if (pFrame1) + if (SfxViewFrame* pFrame1 = SfxViewFrame::GetFirst(this)) { - vcl::Window* pWindow = &pFrame1->GetWindow(); - if ( pWindow ) + if (vcl::Window* pSysWin = pFrame1->GetWindow().GetSystemWindow()) { - vcl::Window* pSysWin = pWindow->GetSystemWindow(); - if ( pSysWin ) - { - pSysWin->SetAccessibleName(OUString()); - } + pSysWin->SetAccessibleName(OUString()); } } mpDoc->StopWorkStartupDelay(); diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx index 6ff1bc115ac4..c9e4b8057cd8 100644 --- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx @@ -182,9 +182,8 @@ void CurrentMasterPagesSelector::UpdateSelection() else { SdrPage& rMasterPage (pPage->TRG_GetMasterPage()); - SdPage* pMasterPage = static_cast<SdPage*>(&rMasterPage); - if (pMasterPage != nullptr) - aNames.insert (pMasterPage->GetName()); + assert(dynamic_cast<SdPage*>(&rMasterPage)); + aNames.insert(static_cast<SdPage&>(rMasterPage).GetName()); } } } diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index ae5cd6fdae37..80d25dc1f3de 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -1280,15 +1280,12 @@ public: { mbHasOrientationWarningBeenShown = true; // Show warning that the orientation could not be set. - if (pViewShell) - { - std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog(pViewShell->GetFrameWeld(), - VclMessageType::Warning, VclButtonsType::OkCancel, - SdResId(STR_WARN_PRINTFORMAT_FAILURE))); - xWarn->set_default_response(RET_CANCEL); - if (xWarn->run() != RET_OK) - return; - } + std::unique_ptr<weld::MessageDialog> xWarn(Application::CreateMessageDialog( + pViewShell->GetFrameWeld(), VclMessageType::Warning, VclButtonsType::OkCancel, + SdResId(STR_WARN_PRINTFORMAT_FAILURE))); + xWarn->set_default_response(RET_CANCEL); + if (xWarn->run() != RET_OK) + return; } } |