diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-09-11 17:08:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-12 06:48:17 +0200 |
commit | 7e2a6709d9511f983f9981258c38ccc125bcd3fe (patch) | |
tree | 6a7b444d3e8b65c5d22e9bcf26ee4ae04d04b03c | |
parent | 75ca51725274b95417aa2c7f169145e3cd3b3b4f (diff) |
cppcheck: identicalConditionAfterEarlyExit
Change-Id: I59d91390ee303eadc10315405cce44cfd7c37d56
Reviewed-on: https://gerrit.libreoffice.org/42179
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 5 | ||||
-rw-r--r-- | svtools/source/contnr/treelist.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par5.cxx | 5 | ||||
-rw-r--r-- | vcl/source/gdi/print3.cxx | 7 |
4 files changed, 6 insertions, 13 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 75d833880caa..a8e83f9c95be 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -794,8 +794,7 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet ) { const SfxViewShell *pVSh; const SfxShell *pFSh; - if ( !pSh || - !pSh->HasName() || + if ( !pSh->HasName() || !( pSh->Get_Impl()->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT ) || ( pSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED && ( !(pVSh = pSh->GetViewShell()) || @@ -815,7 +814,7 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet ) case SID_RELOAD: { - if ( !pSh || !pSh->CanReload_Impl() || pSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) + if ( !pSh->CanReload_Impl() || pSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) rSet.DisableItem(nWhich); else { diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx index ce0a07cef863..8d6c72b570c4 100644 --- a/svtools/source/contnr/treelist.cxx +++ b/svtools/source/contnr/treelist.cxx @@ -433,7 +433,7 @@ sal_uLong SvTreeList::GetChildCount( const SvTreeListEntry* pParent ) const if ( !pParent ) return GetEntryCount(); - if (!pParent || pParent->m_Children.empty()) + if (pParent->m_Children.empty()) return 0; sal_uLong nCount = 0; diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index e306bbef3290..36d700d715c1 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -922,7 +922,7 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes) } // no routine available - if (bNested || !bHasHandler || bCodeNest) + if (!bHasHandler || bCodeNest) { if( m_nFieldTagBad[nI] & nMask ) // Flag: Tag it when bad return Read_F_Tag( &aF ); // Result not as text @@ -2723,12 +2723,11 @@ void SwWW8ImplReader::Read_SubF_Ruby( WW8ReadFieldParams& rReadParam) //Create a new char style if necessary if (!pCharFormat) { - SwCharFormat *pFormat=nullptr; OUString aNm; //Take this as the base name SwStyleNameMapper::FillUIName(RES_POOLCHR_RUBYTEXT,aNm); aNm+=OUString::number(m_aRubyCharFormats.size()+1); - pFormat = m_rDoc.MakeCharFormat(aNm, m_rDoc.GetDfltCharFormat()); + SwCharFormat *pFormat = m_rDoc.MakeCharFormat(aNm, m_rDoc.GetDfltCharFormat()); SvxFontHeightItem aHeightItem(nFontSize*10, 100, RES_CHRATR_FONTSIZE); SvxFontItem aFontItem(FAMILY_DONTKNOW,sFontName, OUString(), PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, RES_CHRATR_FONT); diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index e70c4d02dd82..a825d0b23438 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -1266,16 +1266,11 @@ DrawModeFlags PrinterController::removeTransparencies( GDIMetaFile const & i_rIn void PrinterController::printFilteredPage( int i_nPage ) { if( mpImplData->meJobState != css::view::PrintableState_JOB_STARTED ) - return; + return; // rhbz#657394: check that we are still printing... GDIMetaFile aPageFile; PrinterController::PageSize aPageSize = getFilteredPageFile( i_nPage, aPageFile ); - if (mpImplData->meJobState != css::view::PrintableState_JOB_STARTED) - { // rhbz#657394: check that we are still printing... - return; - } - if( mpImplData->mpProgress ) { // do nothing if printing is canceled |