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(-)

New commits:
commit 35975f9ea30e9ec8ac9276f90874ffe272001038
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Nov 1 10:39:45 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Nov 1 13:09:25 2023 +0100

    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 <noel.gran...@collabora.co.uk>

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 ) );

Reply via email to