diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-10 14:13:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-10 19:45:34 +0200 |
commit | fa311ad62f935d6469b77936d477125d98dbee60 (patch) | |
tree | d712ee8e0e16065923fefba70f433e760a6627b6 | |
parent | 6af0da482d8d387f181cb9c2cf9301859c9683cb (diff) |
loplugin:moveparam in svx
Change-Id: I2e422235129f810feea5c17afa1332d8b7ac14ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123332
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
24 files changed, 36 insertions, 38 deletions
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx index 21f60f29e598..3eab0a4e6219 100644 --- a/cui/source/tabpages/numfmt.cxx +++ b/cui/source/tabpages/numfmt.cxx @@ -713,7 +713,7 @@ bool SvxNumberFormatTabPage::FillItemSet( SfxItemSet* rCoreAttrs ) if ( !aDelFormats.empty() ) { - pNumItem->SetDelFormats( aDelFormats ); + pNumItem->SetDelFormats( std::vector(aDelFormats) ); if(bNumItemFlag) { diff --git a/include/svx/ClassificationDialog.hxx b/include/svx/ClassificationDialog.hxx index b83068ba1c1e..d018662b5366 100644 --- a/include/svx/ClassificationDialog.hxx +++ b/include/svx/ClassificationDialog.hxx @@ -87,7 +87,7 @@ public: ~ClassificationDialog() override; std::vector<ClassificationResult> getResult(); - void setupValues(std::vector<ClassificationResult> const& rInput); + void setupValues(std::vector<ClassificationResult>&& rInput); }; } // end svx namespace diff --git a/include/svx/numinf.hxx b/include/svx/numinf.hxx index 2002638d794d..ef1219988e04 100644 --- a/include/svx/numinf.hxx +++ b/include/svx/numinf.hxx @@ -56,7 +56,7 @@ public: double GetValueDouble() const { return nDoubleVal; } const std::vector<sal_uInt32> & GetDelFormats() const { return mvDelFormats; } - void SetDelFormats( std::vector<sal_uInt32> const & ); + void SetDelFormats( std::vector<sal_uInt32> && ); SvxNumberValueType GetValueType() const { return eValueType; } diff --git a/include/svx/sdr/overlay/overlayselection.hxx b/include/svx/sdr/overlay/overlayselection.hxx index f2402500b8d5..d456ac6bf11b 100644 --- a/include/svx/sdr/overlay/overlayselection.hxx +++ b/include/svx/sdr/overlay/overlayselection.hxx @@ -67,7 +67,7 @@ namespace sdr::overlay virtual drawinglayer::primitive2d::Primitive2DContainer getOverlayObjectPrimitive2DSequence() const override; // data write access - void setRanges(const std::vector< basegfx::B2DRange >& rNew); + void setRanges(std::vector< basegfx::B2DRange >&& rNew); }; } // end of namespace sdr::overlay diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx index 9b33b07c3a22..d4ece164bece 100644 --- a/include/svx/svdmrkv.hxx +++ b/include/svx/svdmrkv.hxx @@ -310,7 +310,7 @@ public: // Just objects are marked which are inclosed completely void MarkObj(const tools::Rectangle& rRect, bool bUnmark); void MarkObj(SdrObject* pObj, SdrPageView* pPV, bool bUnmark = false, bool bDoNoSetMarkHdl = false, - std::vector<basegfx::B2DRectangle> const & rSubSelections = std::vector<basegfx::B2DRectangle>()); + std::vector<basegfx::B2DRectangle> && rSubSelections = std::vector<basegfx::B2DRectangle>()); void MarkAllObj(SdrPageView* pPV=nullptr); // pPage=NULL => all displayed pages void UnmarkAllObj(SdrPageView const * pPV=nullptr); // pPage=NULL => all displayed pages diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 0ebe41c8e630..0f77f2070219 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -854,7 +854,7 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector<sd::SearchSelection>* pSelecti basegfx::B2DRectangle aSubSelection = getPDFSelection(rVectorGraphicSearchContext.mpVectorGraphicSearch, mpObj); if (!aSubSelection.isEmpty()) aSubSelections.push_back(aSubSelection); - mpView->MarkObj(mpObj, pPageView, false, false, aSubSelections); + mpView->MarkObj(mpObj, pPageView, false, false, std::move(aSubSelections)); } else { @@ -1276,7 +1276,7 @@ void SdOutliner::ProvideNextTextObject() if (!aSubSelection.isEmpty()) aSubSelections.push_back(aSubSelection); - mpView->MarkObj(mpObj, pPageView, false, false, aSubSelections); + mpView->MarkObj(mpObj, pPageView, false, false, std::move(aSubSelections)); mpDrawDocument->GetDocSh()->SetWaitCursor( false ); } diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index d73f2aa6ae2c..b951231f2c5b 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -1652,7 +1652,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) ClassificationCollector aCollector(*this); aCollector.collect(); - xDialog->setupValues(aCollector.getResults()); + xDialog->setupValues(std::vector(aCollector.getResults())); if (RET_OK == xDialog->run()) { diff --git a/svx/source/dialog/ClassificationDialog.cxx b/svx/source/dialog/ClassificationDialog.cxx index 501e891d8d83..af72a7edf2a2 100644 --- a/svx/source/dialog/ClassificationDialog.cxx +++ b/svx/source/dialog/ClassificationDialog.cxx @@ -291,9 +291,9 @@ void ClassificationDialog::insertField(ClassificationType eType, OUString const m_xEditWindow->InsertField(SvxFieldItem(aField, EE_FEATURE_FIELD)); } -void ClassificationDialog::setupValues(std::vector<ClassificationResult> const & rInput) +void ClassificationDialog::setupValues(std::vector<ClassificationResult> && rInput) { - m_aInitialValues = rInput; + m_aInitialValues = std::move(rInput); readIn(m_aInitialValues); } diff --git a/svx/source/dialog/imapdlg.cxx b/svx/source/dialog/imapdlg.cxx index 22f9173dee1e..fb8252d76eba 100644 --- a/svx/source/dialog/imapdlg.cxx +++ b/svx/source/dialog/imapdlg.cxx @@ -231,13 +231,11 @@ const ImageMap& SvxIMapDlg::GetImageMap() const void SvxIMapDlg::SetTargetList( const TargetList& rTargetList ) { - TargetList aNewList( rTargetList ); - - m_xIMapWnd->SetTargetList( aNewList ); + m_xIMapWnd->SetTargetList( rTargetList ); m_xCbbTarget->clear(); - for (const OUString & s : aNewList) + for (const OUString & s : rTargetList) m_xCbbTarget->append_text(s); } diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index bd987d99b735..a4ed0e6090a9 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -161,7 +161,7 @@ const ImageMap& IMapWindow::GetImageMap() return aIMap; } -void IMapWindow::SetTargetList( TargetList& rTargetList ) +void IMapWindow::SetTargetList( const TargetList& rTargetList ) { // Delete old List aTargetList.clear(); diff --git a/svx/source/dialog/imapwnd.hxx b/svx/source/dialog/imapwnd.hxx index e7e3a1263da3..4ef2c9277a86 100644 --- a/svx/source/dialog/imapwnd.hxx +++ b/svx/source/dialog/imapwnd.hxx @@ -130,7 +130,7 @@ public: void SetInfoLink( const Link<IMapWindow&,void>& rLink ) { aInfoLink = rLink; } - void SetTargetList( TargetList& rTargetList ); + void SetTargetList( const TargetList& rTargetList ); const NotifyInfo& GetInfo() const { return aInfo; } }; diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index a4d7283ab23c..22426ad7dbeb 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1430,7 +1430,7 @@ IMPL_LINK(FmFilterNavigator, DragBeginHdl, bool&, rUnsetDragIcon, bool) ::std::vector<FmFilterItem*> aItemList; if (FmFormItem* pFirstItem = getSelectedFilterItems(aItemList)) { - m_aControlExchange->setDraggedEntries(aItemList); + m_aControlExchange->setDraggedEntries(std::move(aItemList)); m_aControlExchange->setFormItem(pFirstItem); OFilterItemExchange& rExchange = *m_aControlExchange; diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx index 6ef4d39549df..280912284c86 100644 --- a/svx/source/form/fmshell.cxx +++ b/svx/source/form/fmshell.cxx @@ -575,7 +575,7 @@ void FmFormShell::Execute(SfxRequest &rReq) InterfaceBag aOnlyTheForm; aOnlyTheForm.insert(Reference<XInterface>(GetImpl()->getCurrentForm_Lock(), UNO_QUERY)); - GetImpl()->setCurrentSelection_Lock(aOnlyTheForm); + GetImpl()->setCurrentSelection_Lock(std::move(aOnlyTheForm)); GetImpl()->ShowSelectionProperties_Lock(bShow); diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx index 248a2651e23a..ff42f94a770d 100644 --- a/svx/source/form/fmshimp.cxx +++ b/svx/source/form/fmshimp.cxx @@ -1908,17 +1908,17 @@ bool FmXFormShell::setCurrentSelectionFromMark_Lock(const SdrMarkList& _rMarkLis if ( ( _rMarkList.GetMarkCount() > 0 ) && isControlList( _rMarkList ) ) collectInterfacesFromMarkList( _rMarkList, m_aLastKnownMarkedControls ); - return setCurrentSelection_Lock(m_aLastKnownMarkedControls); + return setCurrentSelection_Lock(o3tl::sorted_vector(m_aLastKnownMarkedControls)); } bool FmXFormShell::selectLastMarkedControls_Lock() { - return setCurrentSelection_Lock(m_aLastKnownMarkedControls); + return setCurrentSelection_Lock(o3tl::sorted_vector(m_aLastKnownMarkedControls)); } -bool FmXFormShell::setCurrentSelection_Lock( const InterfaceBag& _rSelection ) +bool FmXFormShell::setCurrentSelection_Lock( InterfaceBag&& _rSelection ) { if (impl_checkDisposed_Lock()) return false; @@ -2627,7 +2627,7 @@ void SAL_CALL FmXFormShell::selectionChanged(const lang::EventObject& rEvent) InterfaceBag aNewSelection; aNewSelection.insert( Reference<XInterface>( xSelObj, UNO_QUERY ) ); - if (setCurrentSelection_Lock(aNewSelection) && IsPropBrwOpen_Lock()) + if (setCurrentSelection_Lock(std::move(aNewSelection)) && IsPropBrwOpen_Lock()) ShowSelectionProperties_Lock(true); EnableTrackProperties_Lock(true); diff --git a/svx/source/form/navigatortree.cxx b/svx/source/form/navigatortree.cxx index 436b1d604355..84a3839af30f 100644 --- a/svx/source/form/navigatortree.cxx +++ b/svx/source/form/navigatortree.cxx @@ -1312,7 +1312,7 @@ namespace svxform { InterfaceBag aSelection; aSelection.insert( Reference<XInterface>( xNewForm, UNO_QUERY ) ); - pFormShell->GetImpl()->setCurrentSelection_Lock(aSelection); + pFormShell->GetImpl()->setCurrentSelection_Lock(std::move(aSelection)); pFormShell->GetViewShell()->GetViewFrame()->GetBindings().Invalidate(SID_FM_PROPERTIES, true, true); } @@ -1540,7 +1540,7 @@ namespace svxform if ( bSetSelectionAsMarkList ) pFormShell->GetImpl()->setCurrentSelectionFromMark_Lock(pFormShell->GetFormView()->GetMarkedObjectList()); else - pFormShell->GetImpl()->setCurrentSelection_Lock(aSelection); + pFormShell->GetImpl()->setCurrentSelection_Lock(std::move(aSelection)); if (pFormShell->GetImpl()->IsPropBrwOpen_Lock() || bForce) { @@ -1898,7 +1898,7 @@ namespace svxform { InterfaceBag aSelection; aSelection.insert( Reference< XInterface >( pSingleSelectionData->GetFormIface(), UNO_QUERY ) ); - pFormShell->GetImpl()->setCurrentSelection_Lock(aSelection); + pFormShell->GetImpl()->setCurrentSelection_Lock(std::move(aSelection)); } } diff --git a/svx/source/inc/filtnav.hxx b/svx/source/inc/filtnav.hxx index 59af45acbd86..34343d9c0af4 100644 --- a/svx/source/inc/filtnav.hxx +++ b/svx/source/inc/filtnav.hxx @@ -186,7 +186,7 @@ public: inline static bool hasFormat( const DataFlavorExVector& _rFormats ); const ::std::vector<FmFilterItem*>& getDraggedEntries() const { return m_aDraggedEntries; } - void setDraggedEntries(const ::std::vector<FmFilterItem*>& _rList) { m_aDraggedEntries = _rList; } + void setDraggedEntries(::std::vector<FmFilterItem*>&& _rList) { m_aDraggedEntries = std::move(_rList); } FmFormItem* getFormItem() const { return m_pFormItem; } void setFormItem( FmFormItem* _pItem ) { m_pFormItem = _pItem; } diff --git a/svx/source/inc/fmshimp.hxx b/svx/source/inc/fmshimp.hxx index a60e03d2e4ed..4d3c55bc8aa1 100644 --- a/svx/source/inc/fmshimp.hxx +++ b/svx/source/inc/fmshimp.hxx @@ -356,7 +356,7 @@ public: @return <TRUE/> if and only if the to-bet-set selection was different from the previous selection */ - SAL_DLLPRIVATE bool setCurrentSelection_Lock(const InterfaceBag& rSelection); + SAL_DLLPRIVATE bool setCurrentSelection_Lock(InterfaceBag&& rSelection); /** sets the new selection to the last known marked controls */ diff --git a/svx/source/items/numinf.cxx b/svx/source/items/numinf.cxx index 1bb149e868c5..5df9470ce4b1 100644 --- a/svx/source/items/numinf.cxx +++ b/svx/source/items/numinf.cxx @@ -122,9 +122,9 @@ SvxNumberInfoItem* SvxNumberInfoItem::Clone( SfxItemPool * ) const return new SvxNumberInfoItem( *this ); } -void SvxNumberInfoItem::SetDelFormats( std::vector<sal_uInt32> const & aData ) +void SvxNumberInfoItem::SetDelFormats( std::vector<sal_uInt32> && aData ) { - mvDelFormats = aData; + mvDelFormats = std::move(aData); } diff --git a/svx/source/sdr/overlay/overlayselection.cxx b/svx/source/sdr/overlay/overlayselection.cxx index f0c40344edaa..0463567c593c 100644 --- a/svx/source/sdr/overlay/overlayselection.cxx +++ b/svx/source/sdr/overlay/overlayselection.cxx @@ -205,11 +205,11 @@ namespace sdr::overlay return OverlayObject::getOverlayObjectPrimitive2DSequence(); } - void OverlaySelection::setRanges(const std::vector< basegfx::B2DRange >& rNew) + void OverlaySelection::setRanges(std::vector< basegfx::B2DRange >&& rNew) { if(rNew != maRanges) { - maRanges = rNew; + maRanges = std::move(rNew); objectChange(); } } diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx index 6e2247153b53..db0ccf6ea486 100644 --- a/svx/source/svdraw/svdedxv.cxx +++ b/svx/source/svdraw/svdedxv.cxx @@ -607,7 +607,7 @@ void TextEditOverlayObject::checkSelectionChange() aRect.Right() + aLogicPixel.Width(), aRect.Bottom() + aLogicPixel.Height()); } - mxOverlaySelection->setRanges(aLogicRanges); + mxOverlaySelection->setRanges(std::move(aLogicRanges)); } } // end of anonymous namespace diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index a8fa52eb7d05..ff76ce6bf485 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -2124,7 +2124,7 @@ void collectUIInformation(const SdrObject* pObj) } void SdrMarkView::MarkObj(SdrObject* pObj, SdrPageView* pPV, bool bUnmark, bool bDoNoSetMarkHdl, - std::vector<basegfx::B2DRectangle> const & rSubSelections) + std::vector<basegfx::B2DRectangle> && rSubSelections) { if (!(pObj!=nullptr && pPV!=nullptr && IsObjMarkable(pObj, pPV))) return; @@ -2144,7 +2144,7 @@ void collectUIInformation(const SdrObject* pObj) } } - maSubSelectionList = rSubSelections; + maSubSelectionList = std::move(rSubSelections); if (!bDoNoSetMarkHdl) { MarkListHasChanged(); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 2ec5ba2d2a95..1191a8784e08 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -2408,7 +2408,7 @@ SdrObject* SdrObject::ImpConvertToContourObj(bool bForceLineDash) if (!aExtractedLineFills.empty() && !utl::ConfigManager::IsFuzzing()) { // merge to a single tools::PolyPolygon (OR) - aMergedLineFillPolyPolygon = basegfx::utils::mergeToSinglePolyPolygon(aExtractedLineFills); + aMergedLineFillPolyPolygon = basegfx::utils::mergeToSinglePolyPolygon(std::move(aExtractedLineFills)); } } diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index a1fe74191499..5d076c8264d4 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -412,7 +412,7 @@ void SwSelPaintRects::Show(std::vector<OString>* pSelectionRectangles) { if(!aNewRanges.empty()) { - static_cast<sdr::overlay::OverlaySelection*>(m_pCursorOverlay.get())->setRanges(aNewRanges); + static_cast<sdr::overlay::OverlaySelection*>(m_pCursorOverlay.get())->setRanges(std::move(aNewRanges)); } else { diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index e434bbf6c178..c783cfacb59c 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -1215,7 +1215,7 @@ void SwDocShell::Execute(SfxRequest& rReq) SwWrtShell* pShell = GetWrtShell(); std::vector<svx::ClassificationResult> aInput = pShell->CollectAdvancedClassification(); - xDialog->setupValues(aInput); + xDialog->setupValues(std::move(aInput)); weld::DialogController::runAsync(xDialog, [xDialog, pShell](sal_Int32 nResult){ if (RET_OK == nResult) @@ -1232,7 +1232,7 @@ void SwDocShell::Execute(SfxRequest& rReq) }); std::vector<svx::ClassificationResult> aInput = pShell->CollectParagraphClassification(); - xDialog->setupValues(aInput); + xDialog->setupValues(std::move(aInput)); weld::DialogController::runAsync(xDialog, [xDialog, pShell](sal_Int32 nResult){ if (RET_OK == nResult) |