diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2018-08-09 16:30:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-10 08:19:55 +0200 |
commit | b268ef57e97e692644335afeae834205ecb73557 (patch) | |
tree | 872299ece84d84bb335ede04c6687b287a751208 /sw/source/uibase/dialog | |
parent | d063bea95848fd3b899b9809cb8e69eb61ded2fc (diff) |
unnecessary null check before dynamic_cast, in sw
Change-Id: I4f3f3f8b8b7fdf57fe76ff9a24cd8c58e386392d
Reviewed-on: https://gerrit.libreoffice.org/58770
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/dialog')
-rw-r--r-- | sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/dialog/regionsw.cxx | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx index b9a5ea30a518..98c5fbf74835 100644 --- a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx +++ b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx @@ -732,8 +732,8 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh) if ( rMarkList.GetMarkCount() == 1 ) { SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - if( pObj && dynamic_cast< const SdrTextObj *>( pObj ) != nullptr ) - pCurrentTextObj = static_cast<SdrTextObj*>(pObj); + if( auto pSdrTextObj = dynamic_cast<SdrTextObj *>( pObj ) ) + pCurrentTextObj = pSdrTextObj; } // at first fill the list of drawing objects if(!m_pSpellState->m_bTextObjectsCollected ) diff --git a/sw/source/uibase/dialog/regionsw.cxx b/sw/source/uibase/dialog/regionsw.cxx index 95617aac1b0a..e0f25330ddd4 100644 --- a/sw/source/uibase/dialog/regionsw.cxx +++ b/sw/source/uibase/dialog/regionsw.cxx @@ -216,9 +216,9 @@ void SwBaseShell::EditRegionDialog(SfxRequest const & rReq) { SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); ScopedVclPtr<AbstractEditRegionDlg> pEditRegionDlg(pFact->CreateEditRegionDlg(pParentWin, rWrtShell)); - if(pItem && dynamic_cast< const SfxStringItem *>( pItem ) != nullptr) + if(auto pStringItem = dynamic_cast< const SfxStringItem *>( pItem )) { - pEditRegionDlg->SelectSection(static_cast<const SfxStringItem*>(pItem)->GetValue()); + pEditRegionDlg->SelectSection(pStringItem->GetValue()); } pEditRegionDlg->Execute(); } |