diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-12-02 00:59:58 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-12-02 05:31:10 +0100 |
commit | 1f2d3b3f09d16033dae1f99f7739564a5f4c5482 (patch) | |
tree | 292145abe33a2bac69d67fdd67cfc7a8527f6024 /sd | |
parent | a9b13f2b7f0d2ab8bcf25a3110a06ababb4573f6 (diff) |
tdf#120703 PVS: V560 A part of conditional expression is always true/false
Change-Id: Ia9c496ec93bedb13764969bf21c3f21d84caacef
Reviewed-on: https://gerrit.libreoffice.org/64413
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/core/sdpage.cxx | 3 | ||||
-rw-r--r-- | sd/source/core/sdpage2.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/app/sdmod2.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/app/sdxfer.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/sdview.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/sdview2.cxx | 11 |
6 files changed, 14 insertions, 14 deletions
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 6475a933cfb0..5fdbd63e8007 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -2902,8 +2902,7 @@ bool SdPage::RestoreDefaultText( SdrObject* pObj ) // OutlinerParaObjects needs to be changed. The // AutoGrowWidth/Height items still exist in the // not changed object. - if(pTextObj - && pTextObj->GetOutlinerParaObject() + if(pTextObj->GetOutlinerParaObject() && pTextObj->GetOutlinerParaObject()->IsVertical() != bVertical) { ::tools::Rectangle aObjectRect = pTextObj->GetSnapRect(); diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx index 93d56c50b36c..0744eca27585 100644 --- a/sd/source/core/sdpage2.cxx +++ b/sd/source/core/sdpage2.cxx @@ -480,15 +480,13 @@ void SdPage::RemoveEmptyPresentationObjects() { SdrObjListIter aShapeIter( this, SdrIterMode::DeepWithGroups ); - SdrObject* pShape; - for( pShape = aShapeIter.Next(); pShape; pShape = aShapeIter.Next() ) + for (SdrObject* pShape = aShapeIter.Next(); pShape; pShape = aShapeIter.Next()) { - if( pShape && pShape->IsEmptyPresObj() ) + if (pShape->IsEmptyPresObj()) { RemoveObject( pShape->GetOrdNum() ); SdrObject::Free( pShape ); } - } } diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index 979b46c1c3da..04aa3657adf7 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -135,7 +135,7 @@ static SdPage* GetCurrentPage( sd::ViewShell const * pViewSh, EditFieldInfo cons if(pPage) { - bMasterView = pPage && pPage->IsMasterPage(); + bMasterView = pPage->IsMasterPage(); } } diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index 14543f4f1a76..2c873604aa30 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -177,7 +177,7 @@ void SdTransferable::CreateObjectReplacement( SdrObject* pObj ) { SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >( pObj ); - if (pUnoCtrl && SdrInventor::FmForm == pUnoCtrl->GetObjInventor()) + if (SdrInventor::FmForm == pUnoCtrl->GetObjInventor()) { const Reference< css::awt::XControlModel >& xControlModel( pUnoCtrl->GetUnoControlModel() ); diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index caee8aba20c0..5938c80428d8 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -1254,7 +1254,7 @@ bool View::ShouldToggleOn( continue; pOutliner->SetText(*(pText->GetOutlinerParaObject())); sal_Int16 nStatus = pOutliner->GetBulletsNumberingStatus(); - bToggleOn = (bNormalBullet && nStatus != 0) || (!bNormalBullet && nStatus != 1) || bToggleOn; + bToggleOn = (bNormalBullet && nStatus != 0) || (!bNormalBullet && nStatus != 1); pOutliner->Clear(); } } @@ -1266,7 +1266,7 @@ bool View::ShouldToggleOn( continue; pOutliner->SetText(*pParaObj); sal_Int16 nStatus = pOutliner->GetBulletsNumberingStatus(); - bToggleOn = (bNormalBullet && nStatus != 0) || (!bNormalBullet && nStatus != 1) || bToggleOn; + bToggleOn = (bNormalBullet && nStatus != 0) || (!bNormalBullet && nStatus != 1); pOutliner->Clear(); } } diff --git a/sd/source/ui/view/sdview2.cxx b/sd/source/ui/view/sdview2.cxx index 13526f297954..cf5fc2cc27a4 100644 --- a/sd/source/ui/view/sdview2.cxx +++ b/sd/source/ui/view/sdview2.cxx @@ -282,7 +282,7 @@ void View::DoPaste (::sd::Window* pWindow) if( pObj && pPage && pPage->GetPresObjKind(pObj) == PRESOBJ_TITLE ) { // remove all hard linebreaks from the title - if( pOutliner && pOutliner->GetParagraphCount() > 1 ) + if (pOutliner->GetParagraphCount() > 1) { bool bOldUpdateMode = pOutliner->GetUpdateMode(); @@ -305,7 +305,7 @@ void View::DoPaste (::sd::Window* pWindow) if( !mrDoc.IsChanged() ) { - if( pOutliner && pOutliner->IsModified() ) + if (pOutliner->IsModified()) mrDoc.SetChanged(); } } @@ -502,7 +502,8 @@ sal_Int8 View::AcceptDrop( const AcceptDropEvent& rEvt, DropTargetHelper& rTarge bool bXFillExchange = rTargetHelper.IsDropFormatSupported( SotClipboardFormatId::XFA ); // check handle insert - if( !nRet && ( (bXFillExchange && ( SdrDragMode::Gradient == GetDragMode() )) || ( SdrDragMode::Transparence == GetDragMode() ) ) ) + if ((bXFillExchange && (SdrDragMode::Gradient == GetDragMode())) + || (SdrDragMode::Transparence == GetDragMode())) { const SdrHdlList& rHdlList = GetHdlList(); @@ -654,7 +655,9 @@ sal_Int8 View::ExecuteDrop( const ExecuteDropEvent& rEvt, aPos = pTargetWindow->PixelToLogic( rEvt.maPosPixel ); // handle insert? - if( (!nRet && ( SdrDragMode::Gradient == GetDragMode() )) || (( SdrDragMode::Transparence == GetDragMode() ) && aDataHelper.HasFormat( SotClipboardFormatId::XFA )) ) + if ((SdrDragMode::Gradient == GetDragMode()) + || ((SdrDragMode::Transparence == GetDragMode()) + && aDataHelper.HasFormat(SotClipboardFormatId::XFA))) { const SdrHdlList& rHdlList = GetHdlList(); |