diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-07 09:26:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-07 12:39:11 +0100 |
commit | 5404f75a2fa863b97bdf8432f647053f0bff726e (patch) | |
tree | 119d2cede534f5ce1173422df99a0e532d6a7a28 /svx | |
parent | 39efec060719bb2654ba20844ba02429371a4ffb (diff) |
loplugin:collapseif in sdext..svx
Change-Id: I188d9e9b53e00acfbae3c7acd54de28f084c4b3f
Reviewed-on: https://gerrit.libreoffice.org/62985
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/form/fmshimp.cxx | 7 | ||||
-rw-r--r-- | svx/source/sidebar/line/LinePropertyPanelBase.cxx | 22 | ||||
-rw-r--r-- | svx/source/svdraw/svddrgmt.cxx | 44 | ||||
-rw-r--r-- | svx/source/svdraw/svdmodel.cxx | 7 | ||||
-rw-r--r-- | svx/source/svdraw/svdpoev.cxx | 23 | ||||
-rw-r--r-- | svx/source/svdraw/svdviter.cxx | 7 | ||||
-rw-r--r-- | svx/source/svdraw/svdxcgv.cxx | 14 | ||||
-rw-r--r-- | svx/source/table/svdotable.cxx | 9 | ||||
-rw-r--r-- | svx/source/tbxctrls/extrusioncontrols.cxx | 15 |
9 files changed, 56 insertions, 92 deletions
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index edb44f22db40..b4fe6dc14805 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -2559,11 +2559,8 @@ void FmXFormShell::UpdateForms_Lock(bool _bInvalidate) Reference< XIndexAccess > xForms; FmFormPage* pPage = m_pShell->GetCurPage(); - if ( pPage ) - { - if ( m_pShell->m_bDesignMode ) - xForms.set(pPage->GetForms( false ), css::uno::UNO_QUERY); - } + if ( pPage && m_pShell->m_bDesignMode ) + xForms.set(pPage->GetForms( false ), css::uno::UNO_QUERY); if ( m_xForms != xForms ) { diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx index 9b1b8152321f..33c478fc457f 100644 --- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx +++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx @@ -385,14 +385,11 @@ void LinePropertyPanelBase::updateLineStart(bool bDisabled, bool bSetOrDefault, mpLBStart->Enable(); } - if(bSetOrDefault) + if(bSetOrDefault && pItem) { - if(pItem) - { - mpStartItem.reset(static_cast<XLineStartItem*>(pItem->Clone())); - SelectEndStyle(true); - return; - } + mpStartItem.reset(static_cast<XLineStartItem*>(pItem->Clone())); + SelectEndStyle(true); + return; } mpStartItem.reset(nullptr); @@ -412,14 +409,11 @@ void LinePropertyPanelBase::updateLineEnd(bool bDisabled, bool bSetOrDefault, mpLBEnd->Enable(); } - if(bSetOrDefault) + if(bSetOrDefault && pItem) { - if(pItem) - { - mpEndItem.reset(static_cast<XLineEndItem*>(pItem->Clone())); - SelectEndStyle(false); - return; - } + mpEndItem.reset(static_cast<XLineEndItem*>(pItem->Clone())); + SelectEndStyle(false); + return; } mpEndItem.reset(nullptr); diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index 6957043cf2f6..6d099d6efb77 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -1387,21 +1387,18 @@ bool SdrDragObjOwn::EndSdrDrag(bool /*bCopy*/) pObj->SendUserCall( SdrUserCallType::Resize, aBoundRect0 ); } - if(bRet) + if(bRet && bUndo ) { - if( bUndo ) - { - getSdrDragView().AddUndoActions( std::move(vConnectorUndoActions) ); + getSdrDragView().AddUndoActions( std::move(vConnectorUndoActions) ); - if ( pUndo ) - { - getSdrDragView().AddUndo(std::move(pUndo)); - } + if ( pUndo ) + { + getSdrDragView().AddUndo(std::move(pUndo)); + } - if ( pUndo2 ) - { - getSdrDragView().AddUndo(std::move(pUndo2)); - } + if ( pUndo2 ) + { + getSdrDragView().AddUndo(std::move(pUndo2)); } } @@ -3436,20 +3433,17 @@ void SdrDragDistort::MovAllPoints(basegfx::B2DPolyPolygon& rTarget) { SdrPageView* pPV = getSdrDragView().GetSdrPageView(); - if(pPV) + if(pPV && pPV->HasMarkedObjPageView()) { - if (pPV->HasMarkedObjPageView()) - { - basegfx::B2DPolyPolygon aDragPolygon(rTarget); - const basegfx::B2DRange aOriginalRange(aMarkRect.Left(), aMarkRect.Top(), aMarkRect.Right(), aMarkRect.Bottom()); - const basegfx::B2DPoint aTopLeft(aDistortedRect[0].X(), aDistortedRect[0].Y()); - const basegfx::B2DPoint aTopRight(aDistortedRect[1].X(), aDistortedRect[1].Y()); - const basegfx::B2DPoint aBottomLeft(aDistortedRect[3].X(), aDistortedRect[3].Y()); - const basegfx::B2DPoint aBottomRight(aDistortedRect[2].X(), aDistortedRect[2].Y()); - - aDragPolygon = basegfx::utils::distort(aDragPolygon, aOriginalRange, aTopLeft, aTopRight, aBottomLeft, aBottomRight); - rTarget = aDragPolygon; - } + basegfx::B2DPolyPolygon aDragPolygon(rTarget); + const basegfx::B2DRange aOriginalRange(aMarkRect.Left(), aMarkRect.Top(), aMarkRect.Right(), aMarkRect.Bottom()); + const basegfx::B2DPoint aTopLeft(aDistortedRect[0].X(), aDistortedRect[0].Y()); + const basegfx::B2DPoint aTopRight(aDistortedRect[1].X(), aDistortedRect[1].Y()); + const basegfx::B2DPoint aBottomLeft(aDistortedRect[3].X(), aDistortedRect[3].Y()); + const basegfx::B2DPoint aBottomRight(aDistortedRect[2].X(), aDistortedRect[2].Y()); + + aDragPolygon = basegfx::utils::distort(aDragPolygon, aOriginalRange, aTopLeft, aTopRight, aBottomLeft, aBottomRight); + rTarget = aDragPolygon; } } } diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 8f457727ad3e..22b28c956173 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -534,12 +534,9 @@ void SdrModel::SetUndoComment(const OUString& rComment) { OSL_FAIL("svx::SdrModel::SetUndoComment(), method not supported with application undo manager!" ); } - else if( IsUndoEnabled() ) + else if( IsUndoEnabled() && nUndoLevel==1) { - if(nUndoLevel==1) - { - pCurrentUndoGroup->SetComment(rComment); - } + pCurrentUndoGroup->SetComment(rComment); } } diff --git a/svx/source/svdraw/svdpoev.cxx b/svx/source/svdraw/svdpoev.cxx index ec4a09e88506..cc9b8005fe2c 100644 --- a/svx/source/svdraw/svdpoev.cxx +++ b/svx/source/svdraw/svdpoev.cxx @@ -126,21 +126,18 @@ void SdrPolyEditView::CheckPolyPossibilitiesHelper( SdrMark* pM, bool& b1stSmoot } } - if(!bSegmFuz) + if(!bSegmFuz && bCanSegment) { - if(bCanSegment) - { - bool bCrv(aLocalPolygon.isNextControlPointUsed(nPntNum)); + bool bCrv(aLocalPolygon.isNextControlPointUsed(nPntNum)); - if(b1stSegm) - { - b1stSegm = false; - bCurve = bCrv; - } - else - { - bSegmFuz = (bCrv != bCurve); - } + if(b1stSegm) + { + b1stSegm = false; + bCurve = bCrv; + } + else + { + bSegmFuz = (bCrv != bCurve); } } } diff --git a/svx/source/svdraw/svdviter.cxx b/svx/source/svdraw/svdviter.cxx index 1d4c9b035661..dfc7f7d41531 100644 --- a/svx/source/svdraw/svdviter.cxx +++ b/svx/source/svdraw/svdviter.cxx @@ -136,12 +136,9 @@ SdrView* SdrViewIter::ImpFindView() { SdrPageView* pPV = mpCurrentView->GetSdrPageView(); - if(pPV) + if(pPV && ImpCheckPageView(pPV)) { - if(ImpCheckPageView(pPV)) - { - return mpCurrentView; - } + return mpCurrentView; } } else diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index 3567d18856ae..0fb1e31b8d95 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -255,11 +255,8 @@ bool SdrExchangeView::Paste( SdrPageView* pMarkPV=nullptr; SdrPageView* pPV = GetSdrPageView(); - if(pPV) - { - if ( pPV->GetObjList() == pLst ) - pMarkPV=pPV; - } + if(pPV && pPV->GetObjList() == pLst ) + pMarkPV=pPV; ImpLimitToWorkArea( aPos ); if (pLst==nullptr) @@ -424,11 +421,8 @@ void SdrExchangeView::ImpPasteObject(SdrObject* pObj, SdrObjList& rLst, const Po SdrPageView* pMarkPV=nullptr; SdrPageView* pPV = GetSdrPageView(); - if(pPV) - { - if (pPV->GetObjList()==&rLst) - pMarkPV=pPV; - } + if(pPV && pPV->GetObjList()==&rLst) + pMarkPV=pPV; bool bMark = pMarkPV!=nullptr && !IsTextEdit() && (nOptions&SdrInsertFlags::DONTMARK)==SdrInsertFlags::NONE; if (bMark) diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 69cd8432c044..187f52af7a69 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -1062,13 +1062,10 @@ CellPos SdrTableObj::getPreviousRow( const CellPos& rPos, bool bEdgeTravel ) con if( mpImpl.is() ) { CellRef xCell( mpImpl->getCell( aPos ) ); - if( xCell.is() ) + if( xCell.is() && xCell->isMerged() ) { - if( xCell->isMerged() ) - { - sal_Int32 nTemp = 0; - findMergeOrigin( mpImpl->mxTable, aPos.mnCol, aPos.mnRow, nTemp, aPos.mnRow ); - } + sal_Int32 nTemp = 0; + findMergeOrigin( mpImpl->mxTable, aPos.mnCol, aPos.mnRow, nTemp, aPos.mnRow ); } if( aPos.mnRow > 0 ) diff --git a/svx/source/tbxctrls/extrusioncontrols.cxx b/svx/source/tbxctrls/extrusioncontrols.cxx index 438aa466b89c..70b170010478 100644 --- a/svx/source/tbxctrls/extrusioncontrols.cxx +++ b/svx/source/tbxctrls/extrusioncontrols.cxx @@ -746,18 +746,15 @@ void ExtrusionLightingWindow::SelectHdl(void const * pControl) if( pControl == this ) { int nLevel = getSelectedEntryId(); - if( nLevel >= 0 ) + if( nLevel >= 0 && nLevel != 3 ) { - if( nLevel != 3 ) - { - Sequence< PropertyValue > aArgs( 1 ); - aArgs[0].Name = OUString(g_sExtrusionLightingIntensity).copy(5); - aArgs[0].Value <<= static_cast<sal_Int32>(nLevel); + Sequence< PropertyValue > aArgs( 1 ); + aArgs[0].Name = OUString(g_sExtrusionLightingIntensity).copy(5); + aArgs[0].Value <<= static_cast<sal_Int32>(nLevel); - mrController.dispatchCommand( g_sExtrusionLightingIntensity, aArgs ); + mrController.dispatchCommand( g_sExtrusionLightingIntensity, aArgs ); - implSetIntensity( nLevel, true ); - } + implSetIntensity( nLevel, true ); } } else |