diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-05-29 13:49:41 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-05-30 08:44:37 +0200 |
commit | 322a6ca8f912513f69747a68fe5497ee6b643293 (patch) | |
tree | 21c616c42d9596e535ae8ed3e757b6ccfb38f42c /svx | |
parent | 2d362fab91fb70fbe7026c1e96452fe06fa5736e (diff) |
AreObjectsMarked -> GetMarkedObjectList().GetMarkCount() != 0
In order to reduce number of calls to GetMarkedObjectList() later on
Change-Id: Ib2eb7c88338e64744f886a338acca65f782f8170
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168218
Tested-by: Jenkins
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/graphctl.cxx | 4 | ||||
-rw-r--r-- | svx/source/engine3d/view3d.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svddrgv.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv1.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv2.cxx | 9 | ||||
-rw-r--r-- | svx/source/svdraw/svdmrkv.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdundo.cxx | 10 | ||||
-rw-r--r-- | svx/source/svdraw/svdview.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdxcgv.cxx | 6 |
9 files changed, 25 insertions, 24 deletions
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx index 34e411923464..31892b253b97 100644 --- a/svx/source/dialog/graphctl.cxx +++ b/svx/source/dialog/graphctl.cxx @@ -310,7 +310,7 @@ bool GraphCtrl::KeyInput( const KeyEvent& rKEvt ) pView->BrkAction(); bProc = true; } - else if ( pView->AreObjectsMarked() ) + else if ( pView->GetMarkedObjectList().GetMarkCount() != 0 ) { pView->UnmarkAllObj(); bProc = true; @@ -410,7 +410,7 @@ bool GraphCtrl::KeyInput( const KeyEvent& rKEvt ) nY = 0; } - if (pView->AreObjectsMarked() && !aCode.IsMod1() ) + if (pView->GetMarkedObjectList().GetMarkCount() != 0 && !aCode.IsMod1() ) { if(aCode.IsMod2()) { diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index 55787cc4a2df..3507bc1972bd 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -812,7 +812,7 @@ void E3dView::ImpCreate3DObject(E3dScene* pScene, SdrObject* pObj, bool bExtrude void E3dView::ConvertMarkedObjTo3D(bool bExtrude, const basegfx::B2DPoint& rPnt1, const basegfx::B2DPoint& rPnt2) { - if(!AreObjectsMarked()) + if(GetMarkedObjectList().GetMarkCount() == 0) return; // Create undo @@ -1368,7 +1368,7 @@ void E3dView::Start3DCreation() SetMarkHandles(nullptr); //HMHif (bVis) ShowMarkHdl(); - if (AreObjectsMarked()) MarkListHasChanged(); + if (GetMarkedObjectList().GetMarkCount() != 0) MarkListHasChanged(); // Show mirror polygon IMMEDIATELY const SdrHdlList &aHdlList = GetHdlList(); @@ -1424,7 +1424,7 @@ void E3dView::End3DCreation(bool bUseDefaultValuesForMirrorAxes) { ResetCreationActive(); - if(!AreObjectsMarked()) + if(GetMarkedObjectList().GetMarkCount() == 0) return; if(bUseDefaultValuesForMirrorAxes) diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx index 0f41314f8c57..b7ae687d9d0c 100644 --- a/svx/source/svdraw/svddrgv.cxx +++ b/svx/source/svdraw/svddrgv.cxx @@ -711,7 +711,7 @@ bool SdrDragView::EndInsObjPoint(SdrCreateCmd eCmd) bool SdrDragView::IsInsGluePointPossible() const { bool bRet=false; - if (IsInsGluePointMode() && AreObjectsMarked()) + if (IsInsGluePointMode() && GetMarkedObjectList().GetMarkCount() != 0) { if (GetMarkedObjectList().GetMarkCount()==1) { diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index 50f17849f164..0f9e703517fe 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -1061,7 +1061,7 @@ std::vector<sal_uInt16> GetAllCharPropIds(std::span< const SfxPoolItem* const > void SdrEditView::SetAttrToMarked(const SfxItemSet& rAttr, bool bReplaceAll) { - if (!AreObjectsMarked()) + if (GetMarkedObjectList().GetMarkCount() == 0) return; #ifdef DBG_UTIL @@ -1293,7 +1293,7 @@ SfxStyleSheet* SdrEditView::GetStyleSheetFromMarked() const void SdrEditView::SetStyleSheetToMarked(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr) { - if (!AreObjectsMarked()) + if (GetMarkedObjectList().GetMarkCount() == 0) return; const bool bUndo = IsUndoEnabled(); @@ -1375,7 +1375,7 @@ SfxItemSet SdrEditView::GetGeoAttrFromMarked() const SID_ATTR_TRANSFORM_POS_X, SID_ATTR_TRANSFORM_ANGLE, SID_ATTR_TRANSFORM_PROTECT_POS, SID_ATTR_TRANSFORM_AUTOHEIGHT>); - if (AreObjectsMarked()) + if (GetMarkedObjectList().GetMarkCount() != 0) { SfxItemSet aMarkAttr(GetAttrFromMarked(false)); // because of AutoGrowHeight and corner radius tools::Rectangle aRect(GetMarkedObjRect()); diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index a5976f135478..72e7c4737860 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -993,7 +993,7 @@ void SdrEditView::DistributeMarkedObjects(sal_uInt16 SlotID) void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode) { // #i73441# check content - if(!AreObjectsMarked()) + if(GetMarkedObjectList().GetMarkCount() == 0) return; SdrMarkList aRemove; @@ -1019,7 +1019,7 @@ void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode) // mechanisms. In a next step the polygon clipper will even be able to clip curves... // ConvertMarkedToPolyObj(true); ConvertMarkedToPathObj(true); - OSL_ENSURE(AreObjectsMarked(), "no more objects selected after preparations (!)"); + OSL_ENSURE(GetMarkedObjectList().GetMarkCount() != 0, "no more objects selected after preparations (!)"); for(size_t a=0; a<GetMarkedObjectList().GetMarkCount(); ++a) { @@ -1781,7 +1781,7 @@ void SdrEditView::DismantleMarkedObjects(bool bMakeLines) void SdrEditView::GroupMarked() { - if (!AreObjectsMarked()) + if (GetMarkedObjectList().GetMarkCount() == 0) return; GetMarkedObjectList().ForceSort(); @@ -2031,7 +2031,8 @@ rtl::Reference<SdrObject> SdrEditView::ImpConvertOneObj(SdrObject* pObj, bool bP void SdrEditView::ImpConvertTo(bool bPath, bool bLineToArea) { - if (!AreObjectsMarked()) return; + if (GetMarkedObjectList().GetMarkCount() == 0) + return; bool bMrkChg = false; const size_t nMarkCount=GetMarkedObjectList().GetMarkCount(); diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index d077171b53ab..256345560b30 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -1584,7 +1584,7 @@ void SdrMarkView::SetDragMode(SdrDragMode eMode) ForceRefToMarked(); SetMarkHandles(nullptr); { - if (AreObjectsMarked()) MarkListHasChanged(); + if (GetMarkedObjectList().GetMarkCount() != 0) MarkListHasChanged(); } } } diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index bec090c6339c..af55855405d1 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -144,7 +144,7 @@ bool SdrUndoGroup::CanSdrRepeat(SdrView& rView) const switch (eFunction) { case SdrRepeatFunc::NONE : return false; - case SdrRepeatFunc::Delete : return rView.AreObjectsMarked(); + case SdrRepeatFunc::Delete : return rView.GetMarkedObjectList().GetMarkCount() != 0; case SdrRepeatFunc::CombinePolyPoly: return rView.IsCombinePossible(); case SdrRepeatFunc::CombineOnePoly : return rView.IsCombinePossible(true); case SdrRepeatFunc::DismantlePolys : return rView.IsDismantlePossible(); @@ -544,7 +544,7 @@ void SdrUndoMoveObj::SdrRepeat(SdrView& rView) bool SdrUndoMoveObj::CanSdrRepeat(SdrView& rView) const { - return rView.AreObjectsMarked(); + return rView.GetMarkedObjectList().GetMarkCount() != 0; } OUString SdrUndoMoveObj::GetSdrRepeatComment() const @@ -806,7 +806,7 @@ void SdrUndoDelObj::SdrRepeat(SdrView& rView) bool SdrUndoDelObj::CanSdrRepeat(SdrView& rView) const { - return rView.AreObjectsMarked(); + return rView.GetMarkedObjectList().GetMarkCount() != 0; } OUString SdrUndoDelObj::GetSdrRepeatComment() const @@ -1105,7 +1105,7 @@ OUString SdrUndoObjSetText::GetSdrRepeatComment() const void SdrUndoObjSetText::SdrRepeat(SdrView& rView) { - if (!(bNewTextAvailable && rView.AreObjectsMarked())) + if (!(bNewTextAvailable && rView.GetMarkedObjectList().GetMarkCount() != 0)) return; const SdrMarkList& rML=rView.GetMarkedObjectList(); @@ -1138,7 +1138,7 @@ void SdrUndoObjSetText::SdrRepeat(SdrView& rView) bool SdrUndoObjSetText::CanSdrRepeat(SdrView& rView) const { bool bOk = false; - if (bNewTextAvailable && rView.AreObjectsMarked()) { + if (bNewTextAvailable && rView.GetMarkedObjectList().GetMarkCount() != 0) { bOk=true; } return bOk; diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index ece2f48db3fd..a23dcc0c65ea 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -1201,7 +1201,7 @@ OUString SdrView::GetStatusText() } else if(IsMarkObj()) { - if(AreObjectsMarked()) + if(GetMarkedObjectList().GetMarkCount() != 0) { aStr = SvxResId(STR_ViewMarkMoreObjs); } @@ -1274,7 +1274,7 @@ OUString SdrView::GetStatusText() if(aStr == STR_NOTHING) { - if (AreObjectsMarked()) { + if (GetMarkedObjectList().GetMarkCount() != 0) { aStr = ImpGetDescriptionString(STR_ViewMarked); if (IsGluePointEditMode()) { if (HasMarkedGluePoints()) { diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index b8079ae9e5dd..696414b2108c 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -430,7 +430,7 @@ BitmapEx SdrExchangeView::GetMarkedObjBitmapEx(bool bNoVDevIfOneBmpMarked, const { BitmapEx aBmp; - if( AreObjectsMarked() ) + if( GetMarkedObjectList().GetMarkCount() != 0 ) { if(1 == GetMarkedObjectList().GetMarkCount()) { @@ -521,7 +521,7 @@ GDIMetaFile SdrExchangeView::GetMarkedObjMetaFile(bool bNoVDevIfOneMtfMarked) co { GDIMetaFile aMtf; - if( AreObjectsMarked() ) + if( GetMarkedObjectList().GetMarkCount() != 0 ) { tools::Rectangle aBound( GetMarkedObjBoundRect() ); Size aBoundSize( aBound.GetWidth(), aBound.GetHeight() ); @@ -582,7 +582,7 @@ Graphic SdrExchangeView::GetAllMarkedGraphic() const { Graphic aRet; - if( AreObjectsMarked() ) + if( GetMarkedObjectList().GetMarkCount() != 0 ) { if( ( 1 == GetMarkedObjectList().GetMarkCount() ) && GetMarkedObjectList().GetMark( 0 ) ) aRet = SdrExchangeView::GetObjGraphic(*GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj()); |