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 /sc | |
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 'sc')
-rw-r--r-- | sc/qa/unit/anchor.cxx | 2 | ||||
-rw-r--r-- | sc/qa/unit/scshapetest.cxx | 2 | ||||
-rw-r--r-- | sc/qa/unit/tiledrendering/tiledrendering.cxx | 2 | ||||
-rw-r--r-- | sc/qa/unit/uicalc/uicalc2.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/drawsh.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/drawsh2.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/drawsh5.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/fuconstr.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/fudraw.cxx | 20 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/fupoor.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/fusel.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/futext.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/view/drawvie3.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/drawvie4.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/drawview.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin3.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh2.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsh4.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshb.cxx | 2 |
20 files changed, 52 insertions, 51 deletions
diff --git a/sc/qa/unit/anchor.cxx b/sc/qa/unit/anchor.cxx index 0dfffdd8ba4b..d5f5975f5e45 100644 --- a/sc/qa/unit/anchor.cxx +++ b/sc/qa/unit/anchor.cxx @@ -100,7 +100,7 @@ void ScAnchorTest::testUndoAnchor() // Select graphic object pDrawView->MarkNextObj(); - CPPUNIT_ASSERT(pDrawView->AreObjectsMarked()); + CPPUNIT_ASSERT(pDrawView->GetMarkedObjectList().GetMarkCount() != 0); // Set Cell Anchor ScDrawLayer::SetCellAnchoredFromPosition(*pObject, rDoc, 0, false); diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx index 294c5590843f..d6d018f4ab60 100644 --- a/sc/qa/unit/scshapetest.cxx +++ b/sc/qa/unit/scshapetest.cxx @@ -932,7 +932,7 @@ CPPUNIT_TEST_FIXTURE(ScShapeTest, testFitToCellSize) // Select the shape pDrawView->MarkNextObj(); - CPPUNIT_ASSERT(pDrawView->AreObjectsMarked()); + CPPUNIT_ASSERT(pDrawView->GetMarkedObjectList().GetMarkCount() != 0); // Fit selected shape into cell pViewShell->GetViewData().GetDispatcher().Execute(SID_FITCELLSIZE); diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index f184251132e3..02b6783bfe44 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -3870,7 +3870,7 @@ CPPUNIT_TEST_FIXTURE(ScTiledRenderingTest, testEditShapeText) const bool bShapeSelected = pView->SelectObject(u"Shape 1"); CPPUNIT_ASSERT(bShapeSelected); - CPPUNIT_ASSERT(ScDocShell::GetViewData()->GetScDrawView()->AreObjectsMarked()); + CPPUNIT_ASSERT(ScDocShell::GetViewData()->GetScDrawView()->GetMarkedObjectList().GetMarkCount() != 0); Scheduler::ProcessEventsToIdle(); diff --git a/sc/qa/unit/uicalc/uicalc2.cxx b/sc/qa/unit/uicalc/uicalc2.cxx index 346255a42303..b1ee2a0c9856 100644 --- a/sc/qa/unit/uicalc/uicalc2.cxx +++ b/sc/qa/unit/uicalc/uicalc2.cxx @@ -69,7 +69,8 @@ static void lcl_SelectObjectByName(ScTabViewShell& rViewShell, std::u16string_vi OString(OUStringToOString(rObjName, RTL_TEXTENCODING_UTF8) + " not found.").getStr(), bFound); - CPPUNIT_ASSERT(rViewShell.GetViewData().GetScDrawView()->AreObjectsMarked()); + CPPUNIT_ASSERT(rViewShell.GetViewData().GetScDrawView()->GetMarkedObjectList().GetMarkCount() + != 0); } CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testTdf150499) diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index ee276c782ca4..68f277a1756c 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -255,7 +255,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) } - if( pView->AreObjectsMarked() ) + if( pView->GetMarkedObjectList().GetMarkCount() != 0 ) { std::unique_ptr<SfxItemSet> pNewArgs = rReq.GetArgs()->Clone(); lcl_convertStringArguments(*pNewArgs); @@ -327,7 +327,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) case SID_ATTR_TRANSFORM: { - if ( pView->AreObjectsMarked() ) + if ( pView->GetMarkedObjectList().GetMarkCount() != 0 ) { const SfxItemSet* pArgs = rReq.GetArgs(); @@ -476,7 +476,7 @@ void ScDrawShell::ExecuteMacroAssign(SdrObject* pObj, weld::Window* pWin) void ScDrawShell::ExecuteLineDlg( const SfxRequest& rReq ) { ScDrawView* pView = rViewData.GetScDrawView(); - bool bHasMarked = pView->AreObjectsMarked(); + bool bHasMarked = pView->GetMarkedObjectList().GetMarkCount() != 0; const SdrObject* pObj = nullptr; const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); @@ -514,7 +514,7 @@ void ScDrawShell::ExecuteLineDlg( const SfxRequest& rReq ) void ScDrawShell::ExecuteAreaDlg( const SfxRequest& rReq ) { ScDrawView* pView = rViewData.GetScDrawView(); - bool bHasMarked = pView->AreObjectsMarked(); + bool bHasMarked = pView->GetMarkedObjectList().GetMarkCount() != 0; std::shared_ptr<SfxRequest> xRequest = std::make_shared<SfxRequest>(rReq); @@ -546,7 +546,7 @@ void ScDrawShell::ExecuteAreaDlg( const SfxRequest& rReq ) void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq ) { ScDrawView* pView = rViewData.GetScDrawView(); - bool bHasMarked = pView->AreObjectsMarked(); + bool bHasMarked = pView->GetMarkedObjectList().GetMarkCount() != 0; SfxItemSet aNewAttr ( pView->GetDefaultAttr() ); if( bHasMarked ) @@ -573,7 +573,7 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq ) void ScDrawShell::ExecuteMeasureDlg( SfxRequest& rReq ) { ScDrawView* pView = rViewData.GetScDrawView(); - bool bHasMarked = pView->AreObjectsMarked(); + bool bHasMarked = pView->GetMarkedObjectList().GetMarkCount() != 0; SfxItemSet aNewAttr ( pView->GetDefaultAttr() ); if( bHasMarked ) diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx index 0e7cc33f121d..e8d7b233d743 100644 --- a/sc/source/ui/drawfunc/drawsh2.cxx +++ b/sc/source/ui/drawfunc/drawsh2.cxx @@ -392,7 +392,7 @@ void ScDrawShell::GetDrawAttrState( SfxItemSet& rSet ) vcl::Window* pWindow = rViewData.GetActiveWin(); ScDrawView* pDrView = rViewData.GetScDrawView(); Point aPos = pWindow->PixelToLogic(aMousePos); - bool bHasMarked = pDrView->AreObjectsMarked(); + bool bHasMarked = pDrView->GetMarkedObjectList().GetMarkCount() != 0; if( bHasMarked ) { @@ -448,7 +448,7 @@ void ScDrawShell::GetDrawAttrState( SfxItemSet& rSet ) if ( bActionItem ) return; - if ( pDrView->AreObjectsMarked() ) // selected objects + if ( pDrView->GetMarkedObjectList().GetMarkCount() != 0 ) // selected objects { tools::Rectangle aRect = pDrView->GetAllMarkedRect(); pPV->LogicToPagePos(aRect); diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx index c82b01bcc23e..acf843dc3692 100644 --- a/sc/source/ui/drawfunc/drawsh5.cxx +++ b/sc/source/ui/drawfunc/drawsh5.cxx @@ -709,7 +709,7 @@ void ScDrawShell::ExecFormatPaintbrush( const SfxRequest& rReq ) bLock = pArgs->Get(SID_FORMATPAINTBRUSH).GetValue(); ScDrawView* pDrawView = rViewData.GetScDrawView(); - if ( pDrawView && pDrawView->AreObjectsMarked() ) + if ( pDrawView && pDrawView->GetMarkedObjectList().GetMarkCount() != 0 ) { std::unique_ptr<SfxItemSet> pItemSet(new SfxItemSet( pDrawView->GetAttrFromMarked(true/*bOnlyHardAttr*/) )); pView->SetDrawBrushSet( std::move(pItemSet), bLock ); @@ -720,7 +720,7 @@ void ScDrawShell::ExecFormatPaintbrush( const SfxRequest& rReq ) void ScDrawShell::StateFormatPaintbrush( SfxItemSet& rSet ) { ScDrawView* pDrawView = rViewData.GetScDrawView(); - bool bSelection = pDrawView && pDrawView->AreObjectsMarked(); + bool bSelection = pDrawView && pDrawView->GetMarkedObjectList().GetMarkCount() != 0; bool bHasPaintBrush = rViewData.GetView()->HasPaintBrush(); if ( !bHasPaintBrush && !bSelection ) diff --git a/sc/source/ui/drawfunc/fuconstr.cxx b/sc/source/ui/drawfunc/fuconstr.cxx index 689f33d8fed8..2f3122dfba5c 100644 --- a/sc/source/ui/drawfunc/fuconstr.cxx +++ b/sc/source/ui/drawfunc/fuconstr.cxx @@ -71,7 +71,7 @@ bool FuConstruct::MouseButtonDown(const MouseEvent& rMEvt) pView->BegDragObj(aMDPos, nullptr, pHdl, 1); bReturn = true; } - else if ( pView->AreObjectsMarked() ) + else if ( pView->GetMarkedObjectList().GetMarkCount() != 0 ) { pView->UnmarkAll(); bReturn = true; @@ -136,7 +136,7 @@ bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt) sal_uInt16 nClicks = rMEvt.GetClicks(); if ( nClicks == 2 && rMEvt.IsLeft() ) { - if ( pView->AreObjectsMarked() ) + if ( pView->GetMarkedObjectList().GetMarkCount() != 0 ) { const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); if (rMarkList.GetMarkCount() == 1) @@ -199,12 +199,12 @@ bool FuConstruct::SimpleMouseButtonUp(const MouseEvent& rMEvt) { pWindow->ReleaseMouse(); - if ( !pView->AreObjectsMarked() && rMEvt.GetClicks() < 2 ) + if ( pView->GetMarkedObjectList().GetMarkCount() == 0 && rMEvt.GetClicks() < 2 ) { pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1()); SfxDispatcher& rDisp = rViewShell.GetViewData().GetDispatcher(); - if ( pView->AreObjectsMarked() ) + if ( pView->GetMarkedObjectList().GetMarkCount() != 0 ) rDisp.Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD); else rDisp.Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD); diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx index 1d5be0692b4a..4e79d513b9f8 100644 --- a/sc/source/ui/drawfunc/fudraw.cxx +++ b/sc/source/ui/drawfunc/fudraw.cxx @@ -209,7 +209,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) rViewData.GetDispatcher().Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD); bReturn = true; } - else if ( pView->AreObjectsMarked() ) + else if ( pView->GetMarkedObjectList().GetMarkCount() != 0 ) { // III SdrHdlList& rHdlList = const_cast< SdrHdlList& >( pView->GetHdlList() ); @@ -219,7 +219,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) pView->UnmarkAll(); // while bezier editing, object is selected - if (!pView->AreObjectsMarked()) + if (pView->GetMarkedObjectList().GetMarkCount() == 0) rViewShell.SetDrawShell( false ); bReturn = true; @@ -287,7 +287,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) { // in calc do NOT start draw object selection using TAB/SHIFT-TAB when // there is not yet an object selected - if(pView->AreObjectsMarked()) + if(pView->GetMarkedObjectList().GetMarkCount() != 0) { vcl::KeyCode aCode = rKEvt.GetKeyCode(); @@ -307,7 +307,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) } // II - if(pView->AreObjectsMarked()) + if(pView->GetMarkedObjectList().GetMarkCount() != 0) pView->MakeVisible(pView->GetAllMarkedRect(), *pWindow); bReturn = true; @@ -343,7 +343,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) { // in calc do NOT select the last draw object when // there is not yet an object selected - if(pView->AreObjectsMarked()) + if(pView->GetMarkedObjectList().GetMarkCount() != 0) { vcl::KeyCode aCode = rKEvt.GetKeyCode(); @@ -354,7 +354,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) pView->MarkNextObj(); // II - if(pView->AreObjectsMarked()) + if(pView->GetMarkedObjectList().GetMarkCount() != 0) pView->MakeVisible(pView->GetAllMarkedRect(), *pWindow); bReturn = true; @@ -367,7 +367,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) { // in calc do NOT select the first draw object when // there is not yet an object selected - if(pView->AreObjectsMarked()) + if(pView->GetMarkedObjectList().GetMarkCount() != 0) { vcl::KeyCode aCode = rKEvt.GetKeyCode(); @@ -378,7 +378,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) pView->MarkNextObj(true); // II - if(pView->AreObjectsMarked()) + if(pView->GetMarkedObjectList().GetMarkCount() != 0) pView->MakeVisible(pView->GetAllMarkedRect(), *pWindow); bReturn = true; @@ -394,7 +394,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) { // in calc do cursor travelling of draw objects only when // there is an object selected yet - if(pView->AreObjectsMarked()) + if(pView->GetMarkedObjectList().GetMarkCount() != 0) { const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); @@ -562,7 +562,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) case KEY_SPACE: { // in calc do only something when draw objects are selected - if(pView->AreObjectsMarked()) + if(pView->GetMarkedObjectList().GetMarkCount() != 0) { const SdrHdlList& rHdlList = pView->GetHdlList(); SdrHdl* pHdl = rHdlList.GetFocusHdl(); diff --git a/sc/source/ui/drawfunc/fupoor.cxx b/sc/source/ui/drawfunc/fupoor.cxx index 4299e02512d8..2f20077809b9 100644 --- a/sc/source/ui/drawfunc/fupoor.cxx +++ b/sc/source/ui/drawfunc/fupoor.cxx @@ -251,7 +251,7 @@ bool FuPoor::doConstructOrthogonal() const } // Detect image/media and resize proportionally, but don't constrain movement by default - if (pView->AreObjectsMarked()) + if (pView->GetMarkedObjectList().GetMarkCount() != 0) { const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); if (rMarkList.GetMarkCount() == 1) diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx index 1fcc7a448750..a98ad29abe47 100644 --- a/sc/source/ui/drawfunc/fusel.cxx +++ b/sc/source/ui/drawfunc/fusel.cxx @@ -416,7 +416,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) // unlock internal layer to include note captions pView->UnlockInternalLayer(); pView->EndAction(); - if ( pView->AreObjectsMarked() ) + if ( pView->GetMarkedObjectList().GetMarkCount() != 0 ) { bReturn = true; @@ -464,7 +464,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) sal_uInt16 nClicks = rMEvt.GetClicks(); if (pView && nClicks == 2 && rMEvt.IsLeft()) { - if ( pView->AreObjectsMarked() ) + if ( pView->GetMarkedObjectList().GetMarkCount() != 0 ) { const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); if (rMarkList.GetMarkCount() == 1) diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx index 8db495b0f467..9256c0a5dc49 100644 --- a/sc/source/ui/drawfunc/futext.cxx +++ b/sc/source/ui/drawfunc/futext.cxx @@ -437,12 +437,12 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) SetInEditMode(); // leave mode when sole click (-> fuconstr) - if ( !pView->AreObjectsMarked() ) + if ( pView->GetMarkedObjectList().GetMarkCount() == 0 ) { pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1()); SfxDispatcher& rDisp = rViewShell.GetViewData().GetDispatcher(); - if ( pView->AreObjectsMarked() ) + if ( pView->GetMarkedObjectList().GetMarkCount() != 0 ) rDisp.Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD); else rDisp.Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD); @@ -457,12 +457,12 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) { pWindow->ReleaseMouse(); - if ( !pView->AreObjectsMarked() && rMEvt.GetClicks() < 2 ) + if ( pView->GetMarkedObjectList().GetMarkCount() == 0 && rMEvt.GetClicks() < 2 ) { pView->MarkObj(aPnt, -2, false, rMEvt.IsMod1()); SfxDispatcher& rDisp = rViewShell.GetViewData().GetDispatcher(); - if ( pView->AreObjectsMarked() ) + if ( pView->GetMarkedObjectList().GetMarkCount() != 0 ) rDisp.Execute(SID_OBJECT_SELECT, SfxCallMode::SLOT | SfxCallMode::RECORD); else rDisp.Execute(aSfxRequest.GetSlot(), SfxCallMode::SLOT | SfxCallMode::RECORD); @@ -541,7 +541,7 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* pMousePixel, if ( pObj && (pObj->GetLayer() == SC_LAYER_INTERN) ) pView->UnlockInternalLayer(); - if ( !pObj && pView->AreObjectsMarked() ) + if ( !pObj && pView->GetMarkedObjectList().GetMarkCount() != 0 ) { const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); if (rMarkList.GetMarkCount() == 1) diff --git a/sc/source/ui/view/drawvie3.cxx b/sc/source/ui/view/drawvie3.cxx index 5ff00f515f7b..bb90c2a1c819 100644 --- a/sc/source/ui/view/drawvie3.cxx +++ b/sc/source/ui/view/drawvie3.cxx @@ -64,7 +64,7 @@ ScDrawView::ScDrawView( void ScDrawView::SetPageAnchored() { - if( !AreObjectsMarked() ) + if( GetMarkedObjectList().GetMarkCount() == 0 ) return; const SdrMarkList* pMark = &GetMarkedObjectList(); @@ -89,7 +89,7 @@ void ScDrawView::SetPageAnchored() void ScDrawView::SetCellAnchored(bool bResizeWithCell) { - if( !AreObjectsMarked() ) + if( GetMarkedObjectList().GetMarkCount() == 0 ) return; const SdrMarkList* pMark = &GetMarkedObjectList(); @@ -118,7 +118,7 @@ ScAnchorType ScDrawView::GetAnchorType() const bool bPage = false; bool bCell = false; bool bCellResize = false; - if( AreObjectsMarked() ) + if( GetMarkedObjectList().GetMarkCount() != 0 ) { const SdrMarkList* pMark = &GetMarkedObjectList(); const size_t nCount = pMark->GetMarkCount(); diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index 59291977cddd..8e2b55b9ca7d 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -57,7 +57,7 @@ Point aDragStartDiff; void ScDrawView::BeginDrag( vcl::Window* pWindow, const Point& rStartPos ) { - if ( !AreObjectsMarked() ) + if ( GetMarkedObjectList().GetMarkCount() == 0 ) return; BrkAction(); diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index e06d794888c0..26949721cd34 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -211,7 +211,7 @@ void ScDrawView::InvalidateDrawTextAttrs() void ScDrawView::SetMarkedToLayer( SdrLayerID nLayerNo ) { - if (!AreObjectsMarked()) + if (GetMarkedObjectList().GetMarkCount() == 0) return; // #i11702# use SdrUndoObjectLayerChange for undo diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 3b453fbb32cc..b948bf837f41 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -3461,7 +3461,7 @@ void ScGridWindow::Command( const CommandEvent& rCEvt ) // Is a draw object selected? SdrView* pDrawView = pViewSh->GetScDrawView(); - if (pDrawView && pDrawView->AreObjectsMarked()) + if (pDrawView && pDrawView->GetMarkedObjectList().GetMarkCount() != 0) { // #100442#; the context menu should open in the middle of the selected objects tools::Rectangle aSelectRect(LogicToPixel(pDrawView->GetAllMarkedBoundRect())); @@ -3609,7 +3609,7 @@ void ScGridWindow::SelectForContextMenu( const Point& rPosPixel, SCCOL nCellX, S if ( bHitSelected ) return; - bool bWasDraw = ( pDrawView && pDrawView->AreObjectsMarked() ); + bool bWasDraw = ( pDrawView && pDrawView->GetMarkedObjectList().GetMarkCount() != 0 ); bool bHitDraw = false; if ( pDrawView ) { diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx index e550447da8b5..b0a8c0e3628b 100644 --- a/sc/source/ui/view/gridwin3.cxx +++ b/sc/source/ui/view/gridwin3.cxx @@ -180,12 +180,12 @@ bool ScGridWindow::DrawKeyInput(const KeyEvent& rKEvt, vcl::Window* pWin) if (pDrView && pDraw && !mrViewData.IsRefMode()) { pDraw->SetWindow( this ); - bool bOldMarked = pDrView->AreObjectsMarked(); + bool bOldMarked = pDrView->GetMarkedObjectList().GetMarkCount() != 0; if (pDraw->KeyInput( rKEvt )) { bool bLeaveDraw = false; bool bUsed = true; - bool bNewMarked = pDrView->AreObjectsMarked(); + bool bNewMarked = pDrView->GetMarkedObjectList().GetMarkCount() != 0; if ( !mrViewData.GetView()->IsDrawSelMode() ) if ( !bNewMarked ) { @@ -363,7 +363,7 @@ void ScGridWindow::UpdateStatusPosSize() } if ( !bActionItem ) { - if ( pDrView->AreObjectsMarked() ) // selected objects + if ( pDrView->GetMarkedObjectList().GetMarkCount() != 0 ) // selected objects { tools::Rectangle aRect = pDrView->GetAllMarkedRect(); pPV->LogicToPagePos(aRect); @@ -386,7 +386,7 @@ void ScGridWindow::UpdateStatusPosSize() bool ScGridWindow::DrawHasMarkedObj() { ScDrawView* p = mrViewData.GetScDrawView(); - return p && p->AreObjectsMarked(); + return p && p->GetMarkedObjectList().GetMarkCount() != 0; } void ScGridWindow::DrawMarkDropObj( SdrObject* pObj ) diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx index b2fef44d9656..593507098f07 100644 --- a/sc/source/ui/view/tabvwsh2.cxx +++ b/sc/source/ui/view/tabvwsh2.cxx @@ -166,14 +166,14 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) if ( bSelectFirst ) { // select first draw object if none is selected yet - if(!pView->AreObjectsMarked()) + if(pView->GetMarkedObjectList().GetMarkCount() == 0) { // select first object pView->UnmarkAllObj(); pView->MarkNextObj(true); // ...and make it visible - if(pView->AreObjectsMarked()) + if(pView->GetMarkedObjectList().GetMarkCount() != 0) pView->MakeVisible(pView->GetAllMarkedRect(), *pWin); } } diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 5c62962e2c06..5be05d61ce4f 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -577,7 +577,7 @@ void ScTabViewShell::UpdateDrawShell() // Remove DrawShell if nothing is selected. SdrView* pDrView = GetScDrawView(); - if ( pDrView && !pDrView->AreObjectsMarked() && !IsDrawSelMode() ) + if ( pDrView && pDrView->GetMarkedObjectList().GetMarkCount() == 0 && !IsDrawSelMode() ) SetDrawShell( false ); } diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index bbf98297f9c8..08400cdce9eb 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -497,7 +497,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) const SfxRectangleItem& rRect = rReq.GetArgs()->Get(SID_OBJECTRESIZE); tools::Rectangle aRect( pWin->PixelToLogic( rRect.GetValue() ) ); - if ( pView->AreObjectsMarked() ) + if ( pView->GetMarkedObjectList().GetMarkCount() != 0 ) { const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); |