From 35975f9ea30e9ec8ac9276f90874ffe272001038 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 1 Nov 2023 10:39:45 +0200 Subject: pass SfxItemSet by const & to CreateNoteFromObjectData Because in an upcoming patch the CloneAsValue() call in XclImpNoteObj::DoPreProcessSdrObj will stop working, because the underlying SfxItemSet will no longer be an SfxAllItemSet Change-Id: I8361a1b1c1c64cff49c736812fbfb2597ab41140 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158750 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/inc/postit.hxx | 2 +- sc/source/core/data/postit.cxx | 4 ++-- sc/source/filter/excel/xiescher.cxx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx index df114eaf64a5..5e7f6f81d16f 100644 --- a/sc/inc/postit.hxx +++ b/sc/inc/postit.hxx @@ -246,7 +246,7 @@ public: */ static ScPostIt* CreateNoteFromObjectData( ScDocument& rDoc, const ScAddress& rPos, - SfxItemSet&& oItemSet, const OUString& rStyleName, + const SfxItemSet& rItemSet, const OUString& rStyleName, const OutlinerParaObject& rOutlinerObj, const tools::Rectangle& rCaptionRect, bool bShown ); diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index e46836f12e53..fa84f0212b81 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -957,14 +957,14 @@ ScNoteData ScNoteUtil::CreateNoteData(ScDocument& rDoc, const ScAddress& rPos, } ScPostIt* ScNoteUtil::CreateNoteFromObjectData( - ScDocument& rDoc, const ScAddress& rPos, SfxItemSet&& rItemSet, const OUString& rStyleName, + ScDocument& rDoc, const ScAddress& rPos, const SfxItemSet& rItemSet, const OUString& rStyleName, const OutlinerParaObject& rOutlinerObj, const tools::Rectangle& rCaptionRect, bool bShown ) { ScNoteData aNoteData(CreateNoteData(rDoc, rPos, rCaptionRect, bShown)); ScCaptionInitData& rInitData = *aNoteData.mxInitData; rInitData.mxOutlinerObj = rOutlinerObj; - rInitData.moItemSet.emplace(std::move(rItemSet)); + rInitData.moItemSet.emplace(rItemSet); rInitData.maStyleName = ScStyleNameConversion::ProgrammaticToDisplayName(rStyleName, SfxStyleFamily::Frame); return InsertNote(rDoc, rPos, std::move(aNoteData), /*bAlwaysCreateCaption*/false, 0/*nPostItId*/); diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 3f5969cead78..62e35213a045 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -1876,7 +1876,7 @@ void XclImpNoteObj::DoPreProcessSdrObj( XclImpDffConverter& rDffConv, SdrObject& // create cell note with all data from drawing object ScNoteUtil::CreateNoteFromObjectData( GetDoc(), maScPos, - rSdrObj.GetMergedItemSet().CloneAsValue(), // new object on heap expected + rSdrObj.GetMergedItemSet(), OUString(), *pOutlinerObj, rSdrObj.GetLogicRect(), ::get_flag( mnNoteFlags, EXC_NOTE_VISIBLE ) ); -- cgit