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 /sw | |
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 'sw')
-rw-r--r-- | sw/source/core/frmedt/fefly1.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/frmedt/feshview.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/frmedt/fews.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 12 | ||||
-rw-r--r-- | sw/source/uibase/shells/drawdlg.cxx | 12 | ||||
-rw-r--r-- | sw/source/uibase/shells/drwbassh.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/shells/drwtxtsh.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uiview/formatclipboard.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 2 |
10 files changed, 24 insertions, 24 deletions
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index 2b25d21424e3..80c6fafcc3ff 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -261,7 +261,7 @@ void SwFEShell::SelectFlyFrame( SwFlyFrame& rFrame ) if( rFrame.IsFlyInContentFrame() && rFrame.GetAnchorFrame() ) rFrame.GetAnchorFrame()->SetCompletePaint(); - if( pImpl->GetDrawView()->AreObjectsMarked() ) + if( pImpl->GetDrawView()->GetMarkedObjectList().GetMarkCount() != 0 ) pImpl->GetDrawView()->UnmarkAll(); pImpl->GetDrawView()->MarkObj( rFrame.GetVirtDrawObj(), diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index f15fb3e2f3e6..5644769b1aaf 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -733,7 +733,7 @@ void SwFEShell::StartCropImage() void SwFEShell::BeginDrag( const Point* pPt, bool bIsShift) { SdrView *pView = Imp()->GetDrawView(); - if ( pView && pView->AreObjectsMarked() ) + if ( pView && pView->GetMarkedObjectList().GetMarkCount() != 0 ) { m_pChainFrom.reset(); m_pChainTo.reset(); diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index b748ecbe1122..f9f41eb0e76e 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -316,7 +316,7 @@ void SwFEShell::ShellGetFocus() { if (!comphelper::LibreOfficeKit::isActive()) Imp()->GetDrawView()->showMarkHandles(); - if ( Imp()->GetDrawView()->AreObjectsMarked() ) + if ( Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() != 0 ) FrameNotify( this, FLY_DRAG_START ); } } @@ -325,7 +325,7 @@ void SwFEShell::ShellLoseFocus() { SwCursorShell::ShellLoseFocus(); - if ( HasDrawView() && Imp()->GetDrawView()->AreObjectsMarked() ) + if ( HasDrawView() && Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() != 0 ) { if (!comphelper::LibreOfficeKit::isActive()) Imp()->GetDrawView()->hideMarkHandles(); @@ -1336,7 +1336,7 @@ void SwFEShell::MoveObjectIfActive( svt::EmbeddedObjectRef&, const Point& ) void SwFEShell::ToggleHeaderFooterEdit() { // Clear objects selection - if ( Imp()->GetDrawView()->AreObjectsMarked() ) + if ( Imp()->GetDrawView()->GetMarkedObjectList().GetMarkCount() != 0 ) { Imp()->GetDrawView()->UnmarkAll(); ClearMark(); diff --git a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx index 5cf2fb6edf04..6a865078af74 100644 --- a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx +++ b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx @@ -683,7 +683,7 @@ void SwSpellDialogChildWindow::MakeTextSelection_Impl(SwWrtShell& rShell, ShellM else if ( rShell.HasSelection() || rView.IsDrawMode() ) { SdrView *pSdrView = rShell.GetDrawView(); - if(pSdrView && pSdrView->AreObjectsMarked() && + if(pSdrView && pSdrView->GetMarkedObjectList().GetMarkCount() != 0 && pSdrView->GetHdlList().GetFocusHdl()) { const_cast<SdrHdlList&>(pSdrView->GetHdlList()).ResetFocusHdl(); diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index cf8031a527ae..b0d7adcf36c3 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -1843,7 +1843,7 @@ KEYINPUT_CHECKTABLE: { if(!pFlyFormat && SwKeyState::KeyToView != eFlyState && (rSh.GetSelectionType() & (SelectionType::DrawObject|SelectionType::DbForm)) && - rSh.GetDrawView()->AreObjectsMarked()) + rSh.GetDrawView()->GetMarkedObjectList().GetMarkCount() != 0) eKeyState = SwKeyState::Draw_Change; if( pFlyFormat ) @@ -1863,7 +1863,7 @@ KEYINPUT_CHECKTABLE: if ( ( pFlyFormat && ( nSelectionType & (SelectionType::Frame|SelectionType::Ole|SelectionType::Graphic) ) ) || ( ( nSelectionType & (SelectionType::DrawObject|SelectionType::DbForm) ) - && rSh.GetDrawView()->AreObjectsMarked() ) ) + && rSh.GetDrawView()->GetMarkedObjectList().GetMarkCount() != 0 ) ) { eKeyState = pFlyFormat ? SwKeyState::Fly_Change : SwKeyState::Draw_Change; if (nSelectionType & SelectionType::DrawObject) @@ -1936,7 +1936,7 @@ KEYINPUT_CHECKTABLE_INSDEL: if(SwKeyState::KeyToView != eFlyState) { if((nSelectionType & (SelectionType::DrawObject|SelectionType::DbForm)) && - rSh.GetDrawView()->AreObjectsMarked()) + rSh.GetDrawView()->GetMarkedObjectList().GetMarkCount() != 0) eKeyState = SwKeyState::Draw_Change; else if(nSelectionType & (SelectionType::Frame|SelectionType::Ole|SelectionType::Graphic)) eKeyState = SwKeyState::Fly_Change; @@ -2267,7 +2267,7 @@ KEYINPUT_CHECKTABLE_INSDEL: else if((rSh.GetSelectionType() & (SelectionType::DrawObject|SelectionType::DbForm| SelectionType::Frame|SelectionType::Ole|SelectionType::Graphic)) && - rSh.GetDrawView()->AreObjectsMarked()) + rSh.GetDrawView()->GetMarkedObjectList().GetMarkCount() != 0) eKeyState = SwKeyState::EnterDrawHandleMode; else { @@ -2290,7 +2290,7 @@ KEYINPUT_CHECKTABLE_INSDEL: } else if((rSh.GetSelectionType() & (SelectionType::DrawObject|SelectionType::DbForm| SelectionType::Frame|SelectionType::Ole|SelectionType::Graphic)) && - rSh.GetDrawView()->AreObjectsMarked()) + rSh.GetDrawView()->GetMarkedObjectList().GetMarkCount() != 0) { eKeyState = SwKeyState::EnterDrawHandleMode; } @@ -4391,7 +4391,7 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) if ( m_bIsInMove || IsMinMove( m_aStartPos, aPixPt ) ) { // event processing for resizing - if (pSdrView && pSdrView->AreObjectsMarked()) + if (pSdrView && pSdrView->GetMarkedObjectList().GetMarkCount() != 0) { const Point aSttPt( PixelToLogic( m_aStartPos ) ); diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx index b778ea9b806e..028b77c7830a 100644 --- a/sw/source/uibase/shells/drawdlg.cxx +++ b/sw/source/uibase/shells/drawdlg.cxx @@ -67,7 +67,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) { if (nResult == RET_OK) { - if (pView->AreObjectsMarked()) + if (pView->GetMarkedObjectList().GetMarkCount() != 0) { pSh->StartAction(); pView->SetAttributes(*pDlg->GetOutputItemSet()); @@ -90,7 +90,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) case SID_MEASURE_DLG: { - bool bHasMarked = pView->AreObjectsMarked(); + bool bHasMarked = pView->GetMarkedObjectList().GetMarkCount() != 0; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog(rReq.GetFrameWeld(), @@ -109,7 +109,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) case SID_ATTRIBUTES_AREA: { - bool bHasMarked = pView->AreObjectsMarked(); + bool bHasMarked = pView->GetMarkedObjectList().GetMarkCount() != 0; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); VclPtr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog(rReq.GetFrameWeld(), @@ -159,7 +159,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq) case SID_ATTRIBUTES_LINE: { - bool bHasMarked = pView->AreObjectsMarked(); + bool bHasMarked = pView->GetMarkedObjectList().GetMarkCount() != 0; const SdrObject* pObj = nullptr; const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); @@ -258,7 +258,7 @@ void SwDrawShell::ExecDrawAttrArgs(SfxRequest const & rReq) if (pArgs) { - if(pView->AreObjectsMarked()) + if(pView->GetMarkedObjectList().GetMarkCount() != 0) { std::unique_ptr<SfxItemSet> pNewArgs = pArgs->Clone(); lcl_convertStringArguments(pNewArgs); @@ -337,7 +337,7 @@ void SwDrawShell::GetDrawAttrState(SfxItemSet& rSet) { SdrView* pSdrView = GetShell().GetDrawView(); - if (pSdrView->AreObjectsMarked()) + if (pSdrView->GetMarkedObjectList().GetMarkCount() != 0) { bool bDisable = Disable( rSet ); diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index 3ddd29689adf..0e5409700ceb 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -118,7 +118,7 @@ void SwDrawBaseShell::Execute(SfxRequest& rReq) { case FN_DRAW_WRAP_DLG: { - if(pSdrView->AreObjectsMarked()) + if(pSdrView->GetMarkedObjectList().GetMarkCount() != 0) { if(!pArgs) { @@ -174,7 +174,7 @@ void SwDrawBaseShell::Execute(SfxRequest& rReq) case SID_ATTR_TRANSFORM: { - if(pSdrView->AreObjectsMarked()) + if(pSdrView->GetMarkedObjectList().GetMarkCount() != 0) { if(!pArgs) { diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index eccfa7936f2c..784ff5b82804 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -449,7 +449,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq) { if (nResult == RET_OK) { - if (m_pSdrView->AreObjectsMarked()) + if (m_pSdrView->GetMarkedObjectList().GetMarkCount() != 0) { m_pSdrView->SetAttributes(*pDlg->GetOutputItemSet()); xRequest->Done(*(pDlg->GetOutputItemSet())); @@ -465,7 +465,7 @@ void SwDrawTextShell::ExecDraw(SfxRequest &rReq) case SID_TABLE_VERT_BOTTOM: { sal_uInt16 nSId = rReq.GetSlot(); - if (m_pSdrView->AreObjectsMarked()) + if (m_pSdrView->GetMarkedObjectList().GetMarkCount() != 0) { SdrTextVertAdjust eTVA = SDRTEXTVERTADJUST_TOP; if (nSId == SID_TABLE_VERT_CENTER) diff --git a/sw/source/uibase/uiview/formatclipboard.cxx b/sw/source/uibase/uiview/formatclipboard.cxx index 4c300797d41e..1878b3efc209 100644 --- a/sw/source/uibase/uiview/formatclipboard.cxx +++ b/sw/source/uibase/uiview/formatclipboard.cxx @@ -353,7 +353,7 @@ void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bP SdrView* pDrawView = rWrtShell.GetDrawView(); if(pDrawView) { - if( pDrawView->AreObjectsMarked() ) + if( pDrawView->GetMarkedObjectList().GetMarkCount() != 0 ) { pItemSet_TextAttr = std::make_unique<SfxItemSet>( pDrawView->GetAttrFromMarked(true/*bOnlyHardAttr*/) ); //remove attributes defining the type/data of custom shapes diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 0ac3f7b1ba3e..db00d02b1933 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -1218,7 +1218,7 @@ void SwView::Execute(SfxRequest &rReq) else if ( m_pWrtShell->HasSelection() || IsDrawMode() ) { SdrView *pSdrView = m_pWrtShell->HasDrawView() ? m_pWrtShell->GetDrawView() : nullptr; - if(pSdrView && pSdrView->AreObjectsMarked() && + if(pSdrView && pSdrView->GetMarkedObjectList().GetMarkCount() != 0 && pSdrView->GetHdlList().GetFocusHdl()) { const_cast<SdrHdlList&>(pSdrView->GetHdlList()).ResetFocusHdl(); |