diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-11 14:31:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-11 16:11:47 +0200 |
commit | 126510981b3a71bf0e73551938c483f14281d3c4 (patch) | |
tree | cbbe84726bd3e9b25f164af56cb00d9738f99863 /sd | |
parent | f477b54e01766fabc0179beec9aa3dc31b5824e2 (diff) |
loplugin:moveparam in sd
Change-Id: Ia29e29d9af21dbd9bfb846db03f0100832835352
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123390
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/inc/AnnotationEnumeration.hxx | 2 | ||||
-rw-r--r-- | sd/inc/CustomAnimationPreset.hxx | 4 | ||||
-rw-r--r-- | sd/source/core/CustomAnimationPreset.cxx | 2 | ||||
-rw-r--r-- | sd/source/core/annotations/AnnotationEnumeration.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/app/sdxfer.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/framework/configuration/ResourceId.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/inc/framework/ResourceId.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/inc/sdxfer.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsClipboard.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsSlotManager.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/controller/SlsTransferableData.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/inc/controller/SlsTransferableData.hxx | 4 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopage.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/view/DocumentRenderer.cxx | 12 |
14 files changed, 35 insertions, 35 deletions
diff --git a/sd/inc/AnnotationEnumeration.hxx b/sd/inc/AnnotationEnumeration.hxx index 6dbc7250e92f..ed35b46b4068 100644 --- a/sd/inc/AnnotationEnumeration.hxx +++ b/sd/inc/AnnotationEnumeration.hxx @@ -31,7 +31,7 @@ class XAnnotationEnumeration; namespace sd { css::uno::Reference<css::office::XAnnotationEnumeration> -createAnnotationEnumeration(const AnnotationVector&); +createAnnotationEnumeration(AnnotationVector&&); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/inc/CustomAnimationPreset.hxx b/sd/inc/CustomAnimationPreset.hxx index 6894a7c7af77..b746b20b7f83 100644 --- a/sd/inc/CustomAnimationPreset.hxx +++ b/sd/inc/CustomAnimationPreset.hxx @@ -75,8 +75,8 @@ struct PresetCategory OUString maLabel; EffectDescriptorList maEffects; - PresetCategory( const OUString& rLabel, const EffectDescriptorList& rEffects ) - : maLabel( rLabel ), maEffects( rEffects ) {} + PresetCategory( const OUString& rLabel, EffectDescriptorList&& rEffects ) + : maLabel( rLabel ), maEffects( std::move(rEffects) ) {} }; typedef std::shared_ptr< PresetCategory > PresetCategoryPtr; typedef std::vector< PresetCategoryPtr > PresetCategoryList; diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx index 1afc9f360e51..5147cb3cf0e0 100644 --- a/sd/source/core/CustomAnimationPreset.cxx +++ b/sd/source/core/CustomAnimationPreset.cxx @@ -381,7 +381,7 @@ void CustomAnimationPresets::importPresets( const Reference< XMultiServiceFactor } #endif } - rPresetMap.push_back( std::make_shared<PresetCategory>( aLabel, aEffectsList ) ); + rPresetMap.push_back( std::make_shared<PresetCategory>( aLabel, std::move(aEffectsList) ) ); } } } diff --git a/sd/source/core/annotations/AnnotationEnumeration.cxx b/sd/source/core/annotations/AnnotationEnumeration.cxx index 018de9b379b2..5fae2422b8f4 100644 --- a/sd/source/core/annotations/AnnotationEnumeration.cxx +++ b/sd/source/core/annotations/AnnotationEnumeration.cxx @@ -38,7 +38,7 @@ namespace { class AnnotationEnumeration: public ::cppu::WeakImplHelper< css::office::XAnnotationEnumeration > { public: - explicit AnnotationEnumeration( const AnnotationVector& rAnnotations ); + explicit AnnotationEnumeration( AnnotationVector&& rAnnotations ); AnnotationEnumeration(const AnnotationEnumeration&) = delete; AnnotationEnumeration& operator=(const AnnotationEnumeration&) = delete; @@ -55,13 +55,13 @@ private: } -Reference< XAnnotationEnumeration > createAnnotationEnumeration( const sd::AnnotationVector& rAnnotations ) +Reference< XAnnotationEnumeration > createAnnotationEnumeration( sd::AnnotationVector&& rAnnotations ) { - return new AnnotationEnumeration( rAnnotations ); + return new AnnotationEnumeration( std::move(rAnnotations) ); } -AnnotationEnumeration::AnnotationEnumeration( const AnnotationVector& rAnnotations ) -: maAnnotations(rAnnotations) +AnnotationEnumeration::AnnotationEnumeration( AnnotationVector&& rAnnotations ) +: maAnnotations(std::move(rAnnotations)) { maIter = maAnnotations.begin(); } diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx index dcd3e6d2517d..e813c687f5c7 100644 --- a/sd/source/ui/app/sdxfer.cxx +++ b/sd/source/ui/app/sdxfer.cxx @@ -666,7 +666,7 @@ void SdTransferable::SetObjectDescriptor( std::unique_ptr<TransferableObjectDesc PrepareOLE( *mpObjDesc ); } -void SdTransferable::SetPageBookmarks( const std::vector<OUString> &rPageBookmarks, bool bPersistent ) +void SdTransferable::SetPageBookmarks( std::vector<OUString> && rPageBookmarks, bool bPersistent ) { if( !mpSourceDoc ) return; @@ -689,7 +689,7 @@ void SdTransferable::SetPageBookmarks( const std::vector<OUString> &rPageBookmar else { mpPageDocShell = mpSourceDoc->GetDocSh(); - maPageBookmarks = rPageBookmarks; + maPageBookmarks = std::move(rPageBookmarks); } if( mpSdViewIntern ) diff --git a/sd/source/ui/framework/configuration/ResourceId.cxx b/sd/source/ui/framework/configuration/ResourceId.cxx index d8dd98d9f06c..48a6d360f5f2 100644 --- a/sd/source/ui/framework/configuration/ResourceId.cxx +++ b/sd/source/ui/framework/configuration/ResourceId.cxx @@ -52,8 +52,8 @@ ResourceId::ResourceId() } ResourceId::ResourceId ( - const std::vector<OUString>& rResourceURLs) - : maResourceURLs(rResourceURLs) + std::vector<OUString>&& rResourceURLs) + : maResourceURLs(std::move(rResourceURLs)) { ParseResourceURL(); } @@ -342,7 +342,7 @@ sal_Bool SAL_CALL Reference<XResourceId> SAL_CALL ResourceId::clone() { - return new ResourceId(maResourceURLs); + return new ResourceId(std::vector(maResourceURLs)); } //----- XInitialization ------------------------------------------------------- diff --git a/sd/source/ui/inc/framework/ResourceId.hxx b/sd/source/ui/inc/framework/ResourceId.hxx index 26870273561f..98b456c76037 100644 --- a/sd/source/ui/inc/framework/ResourceId.hxx +++ b/sd/source/ui/inc/framework/ResourceId.hxx @@ -60,7 +60,7 @@ public: The set of URLs may be empty. The result is then the same as returned by ResourceId() default constructor. */ - ResourceId (const ::std::vector<OUString>& rsResourceURLs); + ResourceId (std::vector<OUString>&& rsResourceURLs); /** Create a new resource id that has an empty anchor. @param rsResourceURL diff --git a/sd/source/ui/inc/sdxfer.hxx b/sd/source/ui/inc/sdxfer.hxx index 65b67839958e..5e25ba682711 100644 --- a/sd/source/ui/inc/sdxfer.hxx +++ b/sd/source/ui/inc/sdxfer.hxx @@ -62,7 +62,7 @@ public: bool HasSourceDoc( const SdDrawDocument* pDoc ) const { return( mpSourceDoc == pDoc ); } - void SetPageBookmarks( const std::vector<OUString>& rPageBookmarks, bool bPersistent ); + void SetPageBookmarks( std::vector<OUString>&& rPageBookmarks, bool bPersistent ); bool IsPageTransferable() const { return mbPageTransferable; } bool HasPageBookmarks() const { return( mpPageDocShell && ( !maPageBookmarks.empty() ) ); } const std::vector<OUString>& GetPageBookmarks() const { return maPageBookmarks; } diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index 6e1da49fcedd..a902383c42e2 100644 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -429,7 +429,7 @@ void Clipboard::CreateSlideTransferable ( rtl::Reference<SdTransferable> pTransferable = TransferableData::CreateTransferable ( pDocument, dynamic_cast<SlideSorterViewShell*>(mrSlideSorter.GetViewShell()), - aRepresentatives); + std::move(aRepresentatives)); if (bDrag) SD_MOD()->pTransferDrag = pTransferable.get(); @@ -461,7 +461,7 @@ void Clipboard::CreateSlideTransferable ( { TemporarySlideTrackingDeactivator aDeactivator (mrController); - pTransferable->SetPageBookmarks (aBookmarkList, !bDrag); + pTransferable->SetPageBookmarks (std::move(aBookmarkList), !bDrag); } if (bDrag) @@ -540,14 +540,14 @@ std::shared_ptr<SdTransferable::UserData> Clipboard::CreateTransferableUserData std::shared_ptr<SdTransferable::UserData> pNewTransferable = std::make_shared<TransferableData>( pSlideSorterViewShell, - aRepresentatives); + std::move(aRepresentatives)); pTransferable->SetWorkDocument(pTreeListBoxTransferable->GetSourceDoc()->AllocSdDrawDocument()); // pTransferable->SetView(&mrSlideSorter.GetView()); // Set page bookmark list. std::vector<OUString> aPageBookmarks; aPageBookmarks.push_back(sBookmark); - pTransferable->SetPageBookmarks(aPageBookmarks, false); + pTransferable->SetPageBookmarks(std::move(aPageBookmarks), false); // Replace the view referenced by the transferable with the // corresponding slide sorter view. diff --git a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx index 215d5ae1682a..89d10e310725 100644 --- a/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSlotManager.cxx @@ -99,11 +99,11 @@ SlideExclusionState GetSlideExclusionState (model::PageEnumeration& rPageSet); namespace { -void collectUIInformation(const std::map<OUString, OUString>& aParameters, const OUString& rAction) +void collectUIInformation(std::map<OUString, OUString>&& aParameters, const OUString& rAction) { EventDescription aDescription; aDescription.aID = "impress_win_or_draw_win"; - aDescription.aParameters = aParameters; + aDescription.aParameters = std::move(aParameters); aDescription.aAction = rAction; aDescription.aKeyWord = "ImpressWindowUIObject"; aDescription.aParent = "MainWindow"; diff --git a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx index 2aac76fe0600..f4b89a5aba9c 100644 --- a/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx +++ b/sd/source/ui/slidesorter/controller/SlsTransferableData.cxx @@ -26,10 +26,10 @@ namespace sd::slidesorter::controller { rtl::Reference<SdTransferable> TransferableData::CreateTransferable ( SdDrawDocument* pSrcDoc, SlideSorterViewShell* pViewShell, - const ::std::vector<Representative>& rRepresentatives) + ::std::vector<Representative>&& rRepresentatives) { rtl::Reference<SdTransferable> pTransferable = new SdTransferable (pSrcDoc, nullptr, false/*bInitOnGetData*/); - auto pData = std::make_shared<TransferableData>(pViewShell, rRepresentatives); + auto pData = std::make_shared<TransferableData>(pViewShell, std::move(rRepresentatives)); pTransferable->AddUserData(pData); return pTransferable; } @@ -51,9 +51,9 @@ std::shared_ptr<TransferableData> TransferableData::GetFromTransferable (const S TransferableData::TransferableData ( SlideSorterViewShell* pViewShell, - const ::std::vector<Representative>& rRepresentatives) + ::std::vector<Representative>&& rRepresentatives) : mpViewShell(pViewShell), - maRepresentatives(rRepresentatives) + maRepresentatives(std::move(rRepresentatives)) { if (mpViewShell != nullptr) StartListening(*mpViewShell); diff --git a/sd/source/ui/slidesorter/inc/controller/SlsTransferableData.hxx b/sd/source/ui/slidesorter/inc/controller/SlsTransferableData.hxx index 5830588cb83a..863c2fe73fa0 100644 --- a/sd/source/ui/slidesorter/inc/controller/SlsTransferableData.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlsTransferableData.hxx @@ -51,13 +51,13 @@ public: static rtl::Reference<SdTransferable> CreateTransferable ( SdDrawDocument* pSrcDoc, SlideSorterViewShell* pViewShell, - const ::std::vector<TransferableData::Representative>& rRepresentatives); + ::std::vector<TransferableData::Representative>&& rRepresentatives); static std::shared_ptr<TransferableData> GetFromTransferable (const SdTransferable* pTransferable); TransferableData ( SlideSorterViewShell* pViewShell, - const ::std::vector<TransferableData::Representative>& rRepresentatives); + ::std::vector<TransferableData::Representative>&& rRepresentatives); virtual ~TransferableData() override; const ::std::vector<Representative>& GetRepresentatives() const { return maRepresentatives;} diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 51a7671578c3..d1284cf46789 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -2488,7 +2488,7 @@ void SAL_CALL SdGenericDrawPage::removeAnnotation(const Reference< XAnnotation > Reference< XAnnotationEnumeration > SAL_CALL SdGenericDrawPage::createAnnotationEnumeration() { - return ::sd::createAnnotationEnumeration( GetPage()->getAnnotations() ); + return ::sd::createAnnotationEnumeration( std::vector(GetPage()->getAnnotations()) ); } void SdDrawPage::getBackground(Any& rValue) diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index 34c6c9c9336b..3af73d2c22cb 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -80,9 +80,9 @@ namespace { public: PrintOptions ( const vcl::PrinterOptionsHelper& rHelper, - const std::vector<sal_Int32>& rSlidesPerPage) + std::vector<sal_Int32>&& rSlidesPerPage) : mrProperties(rHelper), - maSlidesPerPage(rSlidesPerPage) + maSlidesPerPage(std::move(rSlidesPerPage)) { } @@ -951,7 +951,7 @@ namespace { public: HandoutPrinterPage ( const sal_uInt16 nHandoutPageIndex, - const std::vector<sal_uInt16>& rPageIndices, + std::vector<sal_uInt16>&& rPageIndices, const MapMode& rMapMode, const OUString& rsPageString, const Point& rPageStringOffset, @@ -961,7 +961,7 @@ namespace { : PrinterPage(PageKind::Handout, rMapMode, false, rsPageString, rPageStringOffset, nDrawMode, eOrientation, nPaperTray), mnHandoutPageIndex(nHandoutPageIndex), - maPageIndices(rPageIndices) + maPageIndices(std::move(rPageIndices)) { } @@ -1218,7 +1218,7 @@ public: } if (bIsValueChanged && ! mpOptions ) - mpOptions.reset(new PrintOptions(*this, maSlidesPerPage)); + mpOptions.reset(new PrintOptions(*this, std::vector(maSlidesPerPage))); if( bIsValueChanged || bIsPaperChanged ) PreparePages(); } @@ -1858,7 +1858,7 @@ private: maPrinterPages.push_back( std::make_shared<HandoutPrinterPage>( nPrinterPageIndex++, - aPageIndices, + std::move(aPageIndices), aMap, rInfo.msTimeDate, aPageOfs, |