diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-05-29 14:03:00 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-05-30 08:44:27 +0200 |
commit | 2d362fab91fb70fbe7026c1e96452fe06fa5736e (patch) | |
tree | dfe0bff75d8f9f59d6a2f8f35b9d6414c69f113b /svx | |
parent | b1da1ef5766d1910b29d98b62a842ccfd7bacf08 (diff) |
GetMarkedObjectByIndex -> GetMarkedObjectList().GetMark()->GetMarkedSdrObj()
In order to reduce number of calls to GetMarkedObjectList() later on
Change-Id: I57ab7d2d8edd98da5175bd1066dfab0fa2cc888e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168220
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/engine3d/view3d.cxx | 28 | ||||
-rw-r--r-- | svx/source/engine3d/view3d1.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svddrgv.cxx | 16 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv1.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdedtv2.cxx | 20 | ||||
-rw-r--r-- | svx/source/svdraw/svdedxv.cxx | 8 | ||||
-rw-r--r-- | svx/source/svdraw/svdmrkv.cxx | 14 | ||||
-rw-r--r-- | svx/source/svdraw/svdview.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdxcgv.cxx | 8 |
10 files changed, 59 insertions, 57 deletions
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx index 12e12d653491..55787cc4a2df 100644 --- a/svx/source/engine3d/view3d.cxx +++ b/svx/source/engine3d/view3d.cxx @@ -102,7 +102,7 @@ Impl3DMirrorConstructOverlay::Impl3DMirrorConstructOverlay(const E3dView& rView) { for(size_t a = 0; a < mnCount; ++a) { - SdrObject* pObject = mrView.GetMarkedObjectByIndex(a); + SdrObject* pObject = mrView.GetMarkedObjectList().GetMark(a)->GetMarkedSdrObj(); if(pObject) { @@ -119,7 +119,7 @@ Impl3DMirrorConstructOverlay::Impl3DMirrorConstructOverlay(const E3dView& rView) for(size_t a = 0; a < mnCount; ++a) { - SdrObject* pObject = mrView.GetMarkedObjectByIndex(a); + SdrObject* pObject = mrView.GetMarkedObjectList().GetMark(a)->GetMarkedSdrObj(); mpPolygons[mnCount - (a + 1)] = pObject->TakeXorPoly(); } } @@ -220,7 +220,7 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const const size_t nCnt = GetMarkedObjectList().GetMarkCount(); for(size_t nObjs = 0; nObjs < nCnt; ++nObjs) { - SdrObject *pObj = GetMarkedObjectByIndex(nObjs); + SdrObject *pObj = GetMarkedObjectList().GetMark(nObjs)->GetMarkedSdrObj(); if(auto pCompoundObject = dynamic_cast<E3dCompoundObject*>(pObj)) { // related scene @@ -249,7 +249,7 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const // objects for(size_t nObjs = 0; nObjs < nCnt; ++nObjs) { - SdrObject *pObj = GetMarkedObjectByIndex(nObjs); + SdrObject *pObj = GetMarkedObjectList().GetMark(nObjs)->GetMarkedSdrObj(); if(auto pCompoundObject = dynamic_cast<E3dCompoundObject*>(pObj)) { // related scene @@ -264,7 +264,7 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const for(size_t nObjs = 0; nObjs < nCnt; ++nObjs) { - SdrObject *pObj = GetMarkedObjectByIndex(nObjs); + SdrObject *pObj = GetMarkedObjectList().GetMark(nObjs)->GetMarkedSdrObj(); if(auto p3DObj = DynCastE3dObject(pObj)) { // Select object @@ -286,7 +286,7 @@ void E3dView::DrawMarkedObj(OutputDevice& rOut) const // Reset selection flag for(size_t nObjs = 0; nObjs < nCnt; ++nObjs) { - SdrObject *pObj = GetMarkedObjectByIndex(nObjs); + SdrObject *pObj = GetMarkedObjectList().GetMark(nObjs)->GetMarkedSdrObj(); if(auto pCompoundObject = dynamic_cast<E3dCompoundObject*>(pObj)) { // related scene @@ -318,7 +318,7 @@ std::unique_ptr<SdrModel> E3dView::CreateMarkedObjModel() const for(size_t nObjs = 0; nObjs < nCount; ++nObjs) { - const SdrObject* pObj = GetMarkedObjectByIndex(nObjs); + const SdrObject* pObj = GetMarkedObjectList().GetMark(nObjs)->GetMarkedSdrObj(); if(!bSpecialHandling) if(auto pCompoundObj = dynamic_cast< const E3dCompoundObject*>(pObj)) @@ -358,7 +358,7 @@ std::unique_ptr<SdrModel> E3dView::CreateMarkedObjModel() const // and collect SnapRect of selected objects for(size_t nObjs = 0; nObjs < nCount; ++nObjs) { - SdrObject *pObj = GetMarkedObjectByIndex(nObjs); + SdrObject *pObj = GetMarkedObjectList().GetMark(nObjs)->GetMarkedSdrObj(); if(auto p3DObj = dynamic_cast<E3dCompoundObject*>(pObj)) { @@ -587,7 +587,7 @@ bool E3dView::IsConvertTo3DObjPossible() const for(size_t a=0; !bAny3D && a<GetMarkedObjectList().GetMarkCount(); ++a) { - SdrObject *pObj = GetMarkedObjectByIndex(a); + SdrObject *pObj = GetMarkedObjectList().GetMark(a)->GetMarkedSdrObj(); if(pObj) { ImpIsConvertTo3DPossible(pObj, bAny3D, bGroupSelected); @@ -1168,7 +1168,7 @@ bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut, const size_t nCnt = GetMarkedObjectList().GetMarkCount(); for(size_t nObjs = 0; nObjs < nCnt; ++nObjs) { - SdrObject *pObj = GetMarkedObjectByIndex(nObjs); + SdrObject *pObj = GetMarkedObjectList().GetMark(nObjs)->GetMarkedSdrObj(); if(pObj) { if( const E3dScene* pScene = DynCastE3dScene(pObj) ) @@ -1330,7 +1330,7 @@ void E3dView::Start3DCreation() basegfx::B2DRange aR; for(size_t nMark = 0; nMark < GetMarkedObjectList().GetMarkCount(); ++nMark) { - SdrObject* pMark = GetMarkedObjectByIndex(nMark); + SdrObject* pMark = GetMarkedObjectList().GetMark(nMark)->GetMarkedSdrObj(); basegfx::B2DPolyPolygon aXPP(pMark->TakeXorPoly()); aR.expand(basegfx::utils::getRange(aXPP)); } @@ -1478,7 +1478,7 @@ bool E3dView::IsBreak3DObjPossible() const { for (size_t i = 0; i < nCount; ++i) { - SdrObject* pObj = GetMarkedObjectByIndex(i); + SdrObject* pObj = GetMarkedObjectList().GetMark(i)->GetMarkedSdrObj(); if (auto p3dObject = DynCastE3dObject(pObj)) { @@ -1510,7 +1510,7 @@ void E3dView::Break3DObj() BegUndo(SvxResId(RID_SVX_3D_UNDO_BREAK_LATHE)); for(size_t a=0; a<nCount; ++a) { - E3dObject* pObj = static_cast<E3dObject*>(GetMarkedObjectByIndex(a)); + E3dObject* pObj = static_cast<E3dObject*>(GetMarkedObjectList().GetMark(a)->GetMarkedSdrObj()); BreakSingle3DObj(pObj); } DeleteMarked(); @@ -1558,7 +1558,7 @@ void E3dView::CheckPossibilities() bool b3DObject = false; for(size_t nObjs = 0; (nObjs < nMarkCnt) && !bCompound; ++nObjs) { - SdrObject *pObj = GetMarkedObjectByIndex(nObjs); + SdrObject *pObj = GetMarkedObjectList().GetMark(nObjs)->GetMarkedSdrObj(); if(dynamic_cast< const E3dCompoundObject* >(pObj)) bCompound = true; if(DynCastE3dObject(pObj)) diff --git a/svx/source/engine3d/view3d1.cxx b/svx/source/engine3d/view3d1.cxx index 3b80a00c3337..db5466dd287b 100644 --- a/svx/source/engine3d/view3d1.cxx +++ b/svx/source/engine3d/view3d1.cxx @@ -38,7 +38,7 @@ void E3dView::ConvertMarkedToPolyObj() if (GetMarkedObjectList().GetMarkCount() == 1) { - SdrObject* pObj = GetMarkedObjectByIndex(0); + SdrObject* pObj = GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); if (pObj) { @@ -107,7 +107,7 @@ SfxItemSet E3dView::Get3DAttributes() const for(size_t a = 0; a < nMarkCnt; ++a) { - SdrObject* pObj = GetMarkedObjectByIndex(a); + SdrObject* pObj = GetMarkedObjectList().GetMark(a)->GetMarkedSdrObj(); Imp_E3dView_InorderRun3DObjects(*pObj, nSelectedItems); } @@ -150,7 +150,7 @@ void E3dView::Set3DAttributes( const SfxItemSet& rAttr) for(size_t a = 0; a < nMarkCnt; ++a) { - SdrObject* pObj = GetMarkedObjectByIndex(a); + SdrObject* pObj = GetMarkedObjectList().GetMark(a)->GetMarkedSdrObj(); Imp_E3dView_InorderRun3DObjects(*pObj, nSelectedItems); } diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx index 0fb64eee11eb..0f41314f8c57 100644 --- a/svx/source/svdraw/svddrgv.cxx +++ b/svx/source/svdraw/svddrgv.cxx @@ -148,7 +148,7 @@ bool SdrDragView::TakeDragObjAnchorPos(Point& rPos, bool bTR ) const !IsDraggingPoints() && !IsDraggingGluePoints() && // not when moving points dynamic_cast<const SdrDragMovHdl*>( mpCurrentSdrDragMethod.get() ) == nullptr) // not when moving handles { - SdrObject* pObj=GetMarkedObjectByIndex(0); + SdrObject* pObj=GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); if (auto pCaptionObj = dynamic_cast<SdrCaptionObj*>(pObj)) { Point aPt(pCaptionObj->GetTailPos()); @@ -210,7 +210,7 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl // Coordinate maybe affected by GridOffset, so we may need to // adapt to Model-coordinates here if((comphelper::LibreOfficeKit::isActive() && mpMarkedObj - && getPossibleGridOffsetForSdrObject(aGridOffset, GetMarkedObjectByIndex(0), GetSdrPageView())) + && getPossibleGridOffsetForSdrObject(aGridOffset, GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(), GetSdrPageView())) || (getPossibleGridOffsetForPosition( aGridOffset, basegfx::B2DPoint(aPnt.X(), aPnt.Y()), @@ -269,7 +269,7 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl bool b3DObjSelected = false; for(size_t a=0; !b3DObjSelected && a<GetMarkedObjectList().GetMarkCount(); ++a) { - SdrObject* pObj = GetMarkedObjectByIndex(a); + SdrObject* pObj = GetMarkedObjectList().GetMark(a)->GetMarkedSdrObj(); if(DynCastE3dObject(pObj)) b3DObjSelected = true; } @@ -417,7 +417,7 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl bool bSingleTextObjMark = false; // SJ: #i100490# if ( GetMarkedObjectList().GetMarkCount() == 1 ) { - mpMarkedObj=GetMarkedObjectByIndex(0); + mpMarkedObj=GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); if ( mpMarkedObj && DynCastSdrTextObj( mpMarkedObj) != nullptr && static_cast<SdrTextObj*>(mpMarkedObj)->IsTextFrame() ) @@ -433,7 +433,7 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl { if(SdrHdlKind::Move == meDragHdl) { - const bool bCustomShapeSelected(1 == GetMarkedObjectList().GetMarkCount() && dynamic_cast<const SdrObjCustomShape*>(GetMarkedObjectByIndex(0)) != nullptr); + const bool bCustomShapeSelected(1 == GetMarkedObjectList().GetMarkCount() && dynamic_cast<const SdrObjCustomShape*>(GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj()) != nullptr); if(bCustomShapeSelected) { @@ -442,7 +442,7 @@ bool SdrDragView::BegDragObj(const Point& rPnt, OutputDevice* pOut, SdrHdl* pHdl } else if(SdrHdlKind::Poly == meDragHdl) { - const bool bConnectorSelected(1 == GetMarkedObjectList().GetMarkCount() && dynamic_cast<const SdrEdgeObj*>(GetMarkedObjectByIndex(0)) != nullptr); + const bool bConnectorSelected(1 == GetMarkedObjectList().GetMarkCount() && dynamic_cast<const SdrEdgeObj*>(GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj()) != nullptr); if(bConnectorSelected) { @@ -514,7 +514,7 @@ void SdrDragView::MovDragObj(const Point& rPnt) // Coordinate maybe affected by GridOffset, so we may need to // adapt to Model-coordinates here if((comphelper::LibreOfficeKit::isActive() && mpMarkedObj - && getPossibleGridOffsetForSdrObject(aGridOffset, GetMarkedObjectByIndex(0), GetSdrPageView())) + && getPossibleGridOffsetForSdrObject(aGridOffset, GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(), GetSdrPageView())) || (getPossibleGridOffsetForPosition( aGridOffset, basegfx::B2DPoint(aPnt.X(), aPnt.Y()), @@ -716,7 +716,7 @@ bool SdrDragView::IsInsGluePointPossible() const if (GetMarkedObjectList().GetMarkCount()==1) { // return sal_False, if only 1 object which is a connector. - const SdrObject* pObj=GetMarkedObjectByIndex(0); + const SdrObject* pObj=GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); if (dynamic_cast<const SdrEdgeObj *>(pObj) == nullptr) { bRet=true; diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index c6d058b4a644..f982a037b0f4 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -504,7 +504,7 @@ void SdrEditView::CheckPossibilities() { // check bCombinePossible more thoroughly // still missing ... - const SdrObject* pObj=GetMarkedObjectByIndex(0); + const SdrObject* pObj=GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); //const SdrPathObj* pPath=dynamic_cast<SdrPathObj*>( pObj ); bool bGroup=pObj->GetSubList()!=nullptr; bool bHasText=pObj->GetOutlinerParaObject()!=nullptr; @@ -663,7 +663,7 @@ void SdrEditView::CheckPossibilities() // Don't allow moving glued connectors. // Currently only implemented for single selection. if (nMarkCount==1) { - SdrObject* pObj=GetMarkedObjectByIndex(0); + SdrObject* pObj=GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); SdrEdgeObj* pEdge=dynamic_cast<SdrEdgeObj*>( pObj ); if (pEdge!=nullptr) { SdrObject* pNode1=pEdge->GetConnectedNode(true); @@ -675,7 +675,7 @@ void SdrEditView::CheckPossibilities() // Don't allow enter Diagrams if (1 == nMarkCount && m_bGrpEnterPossible) { - SdrObject* pCandidate(GetMarkedObjectByIndex(0)); + SdrObject* pCandidate(GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj()); if(nullptr != pCandidate && pCandidate->isDiagram()) m_bGrpEnterPossible = false; diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index ccdbfb03b58d..50f17849f164 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -910,7 +910,7 @@ void SdrEditView::MergeAttrFromMarked(SfxItemSet& rAttr, bool bOnlyHardAttr) con for(size_t a = 0; a < nMarkCount; ++a) { // #80277# merging was done wrong in the prev version - SdrObject *pObj = GetMarkedObjectByIndex(a); + SdrObject *pObj = GetMarkedObjectList().GetMark(a)->GetMarkedSdrObj(); if (!pObj) { continue; @@ -1941,7 +1941,7 @@ void SdrEditView::AlignMarkedObjects(SdrHorAlign eHor, SdrVertAlign eVert) { if (nMarkCount==1) { // align single object to page - const SdrObject* pObj=GetMarkedObjectByIndex(0); + const SdrObject* pObj=GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); const SdrPage* pPage=pObj->getSdrPageFromSdrObject(); const SdrPageGridFrameList* pGFL=pPage->GetGridFrameList(GetMarkedObjectList().GetMark(0)->GetPageView(),&(pObj->GetSnapRect())); const SdrPageGridFrame* pFrame=nullptr; diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index f3fedc30f7ad..a5976f135478 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -83,7 +83,7 @@ void SdrEditView::MovMarkedToTop() GetMarkedObjectList().ForceSort(); for (size_t nm=0; nm<nCount; ++nm) { // All Ordnums have to be correct! - GetMarkedObjectByIndex(nm)->GetOrdNum(); + GetMarkedObjectList().GetMark(nm)->GetMarkedSdrObj()->GetOrdNum(); } bool bChg=false; SdrObjList* pOL0=nullptr; @@ -171,7 +171,7 @@ void SdrEditView::MovMarkedToBtm() GetMarkedObjectList().ForceSort(); for (size_t nm=0; nm<nCount; ++nm) { // All Ordnums have to be correct! - GetMarkedObjectByIndex(nm)->GetOrdNum(); + GetMarkedObjectList().GetMark(nm)->GetMarkedSdrObj()->GetOrdNum(); } bool bChg=false; @@ -285,7 +285,7 @@ void SdrEditView::PutMarkedInFrontOfObj(const SdrObject* pRefObj) } for (size_t nm=0; nm<nCount; ++nm) { // All Ordnums have to be correct! - GetMarkedObjectByIndex(nm)->GetOrdNum(); + GetMarkedObjectList().GetMark(nm)->GetMarkedSdrObj()->GetOrdNum(); } bool bChg=false; SdrObjList* pOL0=nullptr; @@ -385,7 +385,7 @@ void SdrEditView::PutMarkedBehindObj(const SdrObject* pRefObj) } } for (size_t nm=0; nm<nCount; ++nm) { // All Ordnums have to be correct! - GetMarkedObjectByIndex(nm)->GetOrdNum(); + GetMarkedObjectList().GetMark(nm)->GetMarkedSdrObj()->GetOrdNum(); } bool bChg=false; SdrObjList* pOL0=nullptr; @@ -456,11 +456,11 @@ void SdrEditView::ReverseOrderOfMarked() SdrObjList* pOL=GetMarkedObjectList().GetMark(a)->GetPageView()->GetObjList(); size_t c=b; if (a<c) { // make sure OrdNums aren't dirty - GetMarkedObjectByIndex(a)->GetOrdNum(); + GetMarkedObjectList().GetMark(a)->GetMarkedSdrObj()->GetOrdNum(); } while (a<c) { - SdrObject* pObj1=GetMarkedObjectByIndex(a); - SdrObject* pObj2=GetMarkedObjectByIndex(c); + SdrObject* pObj1=GetMarkedObjectList().GetMark(a)->GetMarkedSdrObj(); + SdrObject* pObj2=GetMarkedObjectList().GetMark(c)->GetMarkedSdrObj(); const size_t nOrd1=pObj1->GetOrdNumDirect(); const size_t nOrd2=pObj2->GetOrdNumDirect(); if( bUndo ) @@ -493,7 +493,7 @@ void SdrEditView::ImpCheckToTopBtmPossible() return; if (nCount==1) { // special-casing for single selection - SdrObject* pObj=GetMarkedObjectByIndex(0); + SdrObject* pObj=GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); SdrObjList* pOL=pObj->getParentSdrObjListFromSdrObject(); SAL_WARN_IF(!pOL, "svx", "Object somehow has no ObjList"); size_t nMax = pOL ? pOL->GetObjCount() : 0; @@ -515,7 +515,7 @@ void SdrEditView::ImpCheckToTopBtmPossible() SdrObjList* pOL0=nullptr; size_t nPos0 = 0; for (size_t nm = 0; !m_bToBtmPossible && nm<nCount; ++nm) { // check 'send to background' - SdrObject* pObj=GetMarkedObjectByIndex(nm); + SdrObject* pObj=GetMarkedObjectList().GetMark(nm)->GetMarkedSdrObj(); SdrObjList* pOL=pObj->getParentSdrObjListFromSdrObject(); if (pOL!=pOL0) { nPos0 = 0; @@ -530,7 +530,7 @@ void SdrEditView::ImpCheckToTopBtmPossible() nPos0 = SAL_MAX_SIZE; for (size_t nm=nCount; !m_bToTopPossible && nm>0; ) { // check 'bring to front' --nm; - SdrObject* pObj=GetMarkedObjectByIndex(nm); + SdrObject* pObj=GetMarkedObjectList().GetMark(nm)->GetMarkedSdrObj(); SdrObjList* pOL=pObj->getParentSdrObjListFromSdrObject(); if (pOL!=pOL0) { nPos0=pOL->GetObjCount(); diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 6422656791bd..a7d61b0c97f6 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -2324,7 +2324,8 @@ SvtScriptType SdrObjEditView::GetScriptType() const for (size_t i = 0; i < nMarkCount; ++i) { - OutlinerParaObject* pParaObj = GetMarkedObjectByIndex(i)->GetOutlinerParaObject(); + OutlinerParaObject* pParaObj + = GetMarkedObjectList().GetMark(i)->GetMarkedSdrObj()->GetOutlinerParaObject(); if (pParaObj) { @@ -2366,7 +2367,8 @@ void SdrObjEditView::GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr) c rTargetSet.Put(mpTextEditOutlinerView->GetAttribs(), false); } - if (GetMarkedObjectList().GetMarkCount() == 1 && GetMarkedObjectByIndex(0) == pText.get()) + if (GetMarkedObjectList().GetMarkCount() == 1 + && GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj() == pText.get()) { MergeNotPersistAttrFromMarked(rTargetSet); } @@ -2496,7 +2498,7 @@ bool SdrObjEditView::SetAttributes(const SfxItemSet& rSet, bool bReplaceAll) pTextEditObj->SetMergedItemSetAndBroadcast(aSet, bReplaceAll); if (GetMarkedObjectList().GetMarkCount() == 1 - && GetMarkedObjectByIndex(0) == pTextEditObj.get()) + && GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj() == pTextEditObj.get()) { SetNotPersistAttrToMarked(aSet); } diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 06c95d060fd1..d077171b53ab 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -606,7 +606,7 @@ bool SdrMarkView::ImpIsFrameHandles() const bool bStdDrag=meDragMode==SdrDragMode::Move; if (nMarkCount==1 && bStdDrag && bFrmHdl) { - const SdrObject* pObj=GetMarkedObjectByIndex(0); + const SdrObject* pObj=GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); if (pObj && pObj->GetObjInventor()==SdrInventor::Default) { SdrObjKind nIdent=pObj->GetObjIdentifier(); @@ -716,7 +716,7 @@ bool SdrMarkView::dumpGluePointsToJSON(boost::property_tree::ptree& rTree) { if (!pObj) continue; - if (pObj == GetMarkedObjectByIndex(0)) + if (pObj == GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj()) continue; const SdrGluePointList* pGPL = pObj->GetGluePointList(); bool VertexObject = !(pGPL && pGPL->GetCount()); @@ -934,7 +934,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S // whether the shape is rotated or not, we will always have the correct gridOffset // Note that the gridOffset is calculated from the first selected obj basegfx::B2DVector aGridOffset(0.0, 0.0); - if(getPossibleGridOffsetForSdrObject(aGridOffset, GetMarkedObjectByIndex(0), pPageView)) + if(getPossibleGridOffsetForSdrObject(aGridOffset, GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(), pPageView)) { Point p(aGridOffset.getX(), aGridOffset.getY()); if (convertMapMode) @@ -1278,7 +1278,7 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell) if (nMarkCount==1) { - mpMarkedObj=GetMarkedObjectByIndex(0); + mpMarkedObj=GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); if(nullptr != mpMarkedObj) { @@ -1622,7 +1622,7 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode) const size_t nMarkCount = GetMarkedObjectList().GetMarkCount(); if(nMarkCount == 1) { - SdrObject* pObj = GetMarkedObjectByIndex(0); + SdrObject* pObj = GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); SdrModel& rModel = GetModel(); const SfxItemSet& rSet = pObj->GetMergedItemSet(); @@ -1684,7 +1684,7 @@ void SdrMarkView::AddDragModeHdl(SdrDragMode eMode) const size_t nMarkCount = GetMarkedObjectList().GetMarkCount(); if(nMarkCount == 1) { - SdrObject* pObj = GetMarkedObjectByIndex(0); + SdrObject* pObj = GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); const SfxItemSet& rSet = pObj->GetMergedItemSet(); drawing::FillStyle eFillStyle = rSet.Get(XATTR_FILLSTYLE).GetValue(); @@ -2779,7 +2779,7 @@ void SdrMarkView::MarkListHasChanged() mbMarkedPointsRectsDirty=true; bool bOneEdgeMarked=false; if (GetMarkedObjectList().GetMarkCount()==1) { - const SdrObject* pObj=GetMarkedObjectByIndex(0); + const SdrObject* pObj=GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); if (pObj->GetObjInventor()==SdrInventor::Default) { bOneEdgeMarked = pObj->GetObjIdentifier() == SdrObjKind::Edge; } diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index f20e6006845c..ece2f48db3fd 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -1078,7 +1078,7 @@ PointerStyle SdrView::GetPreferredPointer(const Point& rMousePos, const OutputDe // are 3D objects selected? bool b3DObjSelected = false; for (size_t a=0; !b3DObjSelected && a<GetMarkedObjectList().GetMarkCount(); ++a) { - SdrObject* pObj = GetMarkedObjectByIndex(a); + SdrObject* pObj = GetMarkedObjectList().GetMark(a)->GetMarkedSdrObj(); if(DynCastE3dObject(pObj)) b3DObjSelected = true; } @@ -1313,7 +1313,7 @@ SdrViewContext SdrView::GetContext() const { bool bPath=true; for( size_t nMarkNum = 0; nMarkNum < nMarkCount && bPath; ++nMarkNum ) - if (dynamic_cast<const SdrPathObj*>(GetMarkedObjectByIndex(nMarkNum)) == nullptr) + if (dynamic_cast<const SdrPathObj*>(GetMarkedObjectList().GetMark(nMarkNum)->GetMarkedSdrObj()) == nullptr) bPath=false; if( bPath ) @@ -1326,7 +1326,7 @@ SdrViewContext SdrView::GetContext() const for( size_t nMarkNum = 0; nMarkNum < nMarkCount && ( bGraf || bMedia ); ++nMarkNum ) { - const SdrObject* pMarkObj = GetMarkedObjectByIndex( nMarkNum ); + const SdrObject* pMarkObj = GetMarkedObjectList().GetMark(nMarkNum)->GetMarkedSdrObj(); DBG_ASSERT( pMarkObj, "SdrView::GetContext(), null pointer in mark list!" ); if( !pMarkObj ) diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx index 7039978f67b9..b8079ae9e5dd 100644 --- a/svx/source/svdraw/svdxcgv.cxx +++ b/svx/source/svdraw/svdxcgv.cxx @@ -436,7 +436,7 @@ BitmapEx SdrExchangeView::GetMarkedObjBitmapEx(bool bNoVDevIfOneBmpMarked, const { if(bNoVDevIfOneBmpMarked) { - SdrObject* pGrafObjTmp = GetMarkedObjectByIndex( 0 ); + SdrObject* pGrafObjTmp = GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); SdrGrafObj* pGrafObj = dynamic_cast<SdrGrafObj*>( pGrafObjTmp ); if( pGrafObj && ( pGrafObj->GetGraphicType() == GraphicType::Bitmap ) ) @@ -446,7 +446,7 @@ BitmapEx SdrExchangeView::GetMarkedObjBitmapEx(bool bNoVDevIfOneBmpMarked, const } else { - const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(GetMarkedObjectByIndex(0)); + const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj()); if(pSdrGrafObj && pSdrGrafObj->isEmbeddedVectorGraphicData()) { @@ -529,7 +529,7 @@ GDIMetaFile SdrExchangeView::GetMarkedObjMetaFile(bool bNoVDevIfOneMtfMarked) co if( bNoVDevIfOneMtfMarked ) { - SdrObject* pGrafObjTmp = GetMarkedObjectByIndex( 0 ); + SdrObject* pGrafObjTmp = GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); SdrGrafObj* pGrafObj = ( GetMarkedObjectList().GetMarkCount() ==1 ) ? dynamic_cast<SdrGrafObj*>( pGrafObjTmp ) : nullptr; if( pGrafObj ) @@ -585,7 +585,7 @@ Graphic SdrExchangeView::GetAllMarkedGraphic() const if( AreObjectsMarked() ) { if( ( 1 == GetMarkedObjectList().GetMarkCount() ) && GetMarkedObjectList().GetMark( 0 ) ) - aRet = SdrExchangeView::GetObjGraphic(*GetMarkedObjectByIndex(0)); + aRet = SdrExchangeView::GetObjGraphic(*GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj()); else aRet = GetMarkedObjMetaFile(); } |