[Libreoffice-commits] core.git: compilerplugins/clang editeng/source include/svl include/svx sc/inc sc/qa sc/source svl/source svx/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Mon Jul 5 17:01:18 UTC 2021


 compilerplugins/clang/redundantfcast.cxx |    3 +++
 editeng/source/items/textitem.cxx        |    2 +-
 include/svl/setitem.hxx                  |   11 ++++++-----
 include/svx/pageitem.hxx                 |    2 +-
 include/svx/xflasit.hxx                  |    2 +-
 include/svx/xlnasit.hxx                  |    2 +-
 sc/inc/attarray.hxx                      |    3 ++-
 sc/inc/patattr.hxx                       |    4 ++--
 sc/qa/unit/ucalc_formula.cxx             |    2 +-
 sc/source/core/data/attarray.cxx         |    2 +-
 sc/source/core/data/docpool.cxx          |   10 +++++++---
 sc/source/core/data/document.cxx         |    2 +-
 sc/source/core/data/patattr.cxx          |    8 ++++----
 sc/source/ui/docshell/docsh6.cxx         |   12 ++++++------
 sc/source/ui/view/viewfunc.cxx           |    6 +++---
 svl/source/items/itempool.cxx            |    1 +
 svl/source/items/itemset.cxx             |    1 +
 svl/source/items/sitem.cxx               |   14 ++++++++------
 svx/source/items/pageitem.cxx            |    2 +-
 svx/source/xoutdev/xattr.cxx             |    8 ++++----
 svx/source/xoutdev/xpool.cxx             |    4 ++--
 21 files changed, 57 insertions(+), 44 deletions(-)

New commits:
commit 6cb400f41df0dd108cdb4b4d3ec6656844814147
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Jul 3 20:26:18 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Jul 5 19:00:45 2021 +0200

    store the SfxItemSet inside SfxSetItem by value
    
    rather than on the heap, avoiding an allocation
    
    Change-Id: I3f1504f9a2d4178a9ba59e98de182a0ab98cdce0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118356
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/redundantfcast.cxx b/compilerplugins/clang/redundantfcast.cxx
index d600aa5b79df..dc41ea63ded1 100644
--- a/compilerplugins/clang/redundantfcast.cxx
+++ b/compilerplugins/clang/redundantfcast.cxx
@@ -313,6 +313,9 @@ public:
         // compile-time check of constant
         if (fn == SRCDIR "/bridges/source/jni_uno/jni_bridge.cxx")
             return false;
+        // TODO constructing a temporary to pass to a && param
+        if (fn == SRCDIR "/sc/source/ui/view/viewfunc.cxx")
+            return false;
         return true;
     }
 
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 53f5328890b2..6bfb782e3e19 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -2405,7 +2405,7 @@ bool SvxCharReliefItem::QueryValue( css::uno::Any& rVal,
 *************************************************************************/
 
 SvxScriptSetItem::SvxScriptSetItem( sal_uInt16 nSlotId, SfxItemPool& rPool )
-    : SfxSetItem( nSlotId, std::make_unique<SfxItemSet>( rPool,
+    : SfxSetItem( nSlotId, SfxItemSet( rPool,
                         svl::Items<SID_ATTR_CHAR_FONT, SID_ATTR_CHAR_FONT>{} ))
 {
     sal_uInt16 nLatin, nAsian, nComplex;
diff --git a/include/svl/setitem.hxx b/include/svl/setitem.hxx
index 81f832b756ae..11154d4dfa3d 100644
--- a/include/svl/setitem.hxx
+++ b/include/svl/setitem.hxx
@@ -21,17 +21,18 @@
 
 #include <sal/config.h>
 
+#include <optional>
 #include <svl/poolitem.hxx>
-#include <memory>
+#include <svl/itemset.hxx>
 
 class SVL_DLLPUBLIC SfxSetItem : public SfxPoolItem
 {
-    std::unique_ptr<SfxItemSet> pSet;
+    SfxItemSet maSet;
 
     SfxSetItem& operator=(const SfxSetItem&) = delete;
 
 public:
-    SfxSetItem(sal_uInt16 nWhich, std::unique_ptr<SfxItemSet>&& pSet);
+    SfxSetItem(sal_uInt16 nWhich, SfxItemSet&& pSet);
     SfxSetItem(sal_uInt16 nWhich, const SfxItemSet& rSet);
     SfxSetItem(const SfxSetItem&, SfxItemPool* pPool = nullptr);
     virtual ~SfxSetItem() override;
@@ -45,8 +46,8 @@ public:
     // create a copy of itself
     virtual SfxSetItem* Clone(SfxItemPool* pPool = nullptr) const override = 0;
 
-    const SfxItemSet& GetItemSet() const { return *pSet; }
-    SfxItemSet& GetItemSet() { return *pSet; }
+    const SfxItemSet& GetItemSet() const { return maSet; }
+    SfxItemSet& GetItemSet() { return maSet; }
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/svx/pageitem.hxx b/include/svx/pageitem.hxx
index f35bfea46ee3..bd47facb530a 100644
--- a/include/svx/pageitem.hxx
+++ b/include/svx/pageitem.hxx
@@ -101,7 +101,7 @@ class SVX_DLLPUBLIC SvxSetItem final : public SfxSetItem
 public:
     SvxSetItem( const sal_uInt16 nId, const SfxItemSet& rSet );
     SvxSetItem( const SvxSetItem& rItem );
-    SvxSetItem( const sal_uInt16 nId, std::unique_ptr<SfxItemSet>&& pSet );
+    SvxSetItem( const sal_uInt16 nId, SfxItemSet&& pSet );
 
     virtual SvxSetItem* Clone( SfxItemPool *pPool = nullptr ) const override;
 
diff --git a/include/svx/xflasit.hxx b/include/svx/xflasit.hxx
index d20cf280bdc3..e263f09dc0c1 100644
--- a/include/svx/xflasit.hxx
+++ b/include/svx/xflasit.hxx
@@ -31,7 +31,7 @@
 class SVXCORE_DLLPUBLIC XFillAttrSetItem final : public SfxSetItem
 {
 public:
-                            XFillAttrSetItem(std::unique_ptr<SfxItemSet>&& pItemSet );
+                            XFillAttrSetItem(SfxItemSet&& pItemSet );
                             XFillAttrSetItem(SfxItemPool* pItemPool);
                             XFillAttrSetItem(const XFillAttrSetItem& rAttr);
                             XFillAttrSetItem(const XFillAttrSetItem& rAttr,
diff --git a/include/svx/xlnasit.hxx b/include/svx/xlnasit.hxx
index abc095cd8864..09dc3d36af24 100644
--- a/include/svx/xlnasit.hxx
+++ b/include/svx/xlnasit.hxx
@@ -31,7 +31,7 @@
 class SVXCORE_DLLPUBLIC XLineAttrSetItem final : public SfxSetItem
 {
 public:
-                            XLineAttrSetItem(std::unique_ptr<SfxItemSet>&& pItemSet );
+                            XLineAttrSetItem(SfxItemSet&& pItemSet );
                             XLineAttrSetItem(SfxItemPool* pItemPool);
                             XLineAttrSetItem(const XLineAttrSetItem& rAttr);
                             XLineAttrSetItem(const XLineAttrSetItem& rAttr,
diff --git a/sc/inc/attarray.hxx b/sc/inc/attarray.hxx
index c0d65c7fcbea..52c2793c3f3c 100644
--- a/sc/inc/attarray.hxx
+++ b/sc/inc/attarray.hxx
@@ -25,6 +25,7 @@
 
 #include <algorithm>
 #include <memory>
+#include <optional>
 
 #include <svl/itemset.hxx>
 
@@ -64,7 +65,7 @@ struct ScLineFlags
 
 struct ScMergePatternState
 {
-    std::unique_ptr<SfxItemSet> pItemSet;
+    std::optional<SfxItemSet> pItemSet;
     const ScPatternAttr* pOld1;     ///< existing objects, temporary
     const ScPatternAttr* pOld2;
 
diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx
index 99d0f64b28ad..e6ac9603dd17 100644
--- a/sc/inc/patattr.hxx
+++ b/sc/inc/patattr.hxx
@@ -56,8 +56,8 @@ class SC_DLLPUBLIC ScPatternAttr final : public SfxSetItem
     ScStyleSheet*              pStyle;
     sal_uInt64                 mnKey;
 public:
-                            ScPatternAttr(std::unique_ptr<SfxItemSet>&& pItemSet, const OUString& rStyleName);
-                            ScPatternAttr(std::unique_ptr<SfxItemSet>&& pItemSet);
+                            ScPatternAttr(SfxItemSet&& pItemSet, const OUString& rStyleName);
+                            ScPatternAttr(SfxItemSet&& pItemSet);
                             ScPatternAttr(SfxItemPool* pItemPool);
                             ScPatternAttr(const ScPatternAttr& rPatternAttr);
 
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 41e769b59877..c13aadc566e8 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -4589,7 +4589,7 @@ void TestFormula::testFormulaRefUpdateValidity()
     SfxUInt32Item aItem(ATTR_VALIDDATA, nIndex);
 
     ScPatternAttr aNewAttrs(
-        std::make_unique<SfxItemSet>(*m_pDoc->GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{}));
+        SfxItemSet(*m_pDoc->GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{}));
     aNewAttrs.GetItemSet().Put(aItem);
 
     m_pDoc->ApplyPattern(0, 1, 0, aNewAttrs);
diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index 41fb51471c43..9fac3fd247ae 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -1004,7 +1004,7 @@ void ScAttrArray::MergePatternArea( SCROW nStartRow, SCROW nEndRow,
             else
             {
                 // first pattern - copied from parent
-                rState.pItemSet = std::make_unique<SfxItemSet>( *rThisSet.GetPool(), rThisSet.GetRanges() );
+                rState.pItemSet.emplace( *rThisSet.GetPool(), rThisSet.GetRanges() );
                 rState.pItemSet->Set( rThisSet, bDeep );
                 rState.mnPatternId = pPattern->GetKey();
             }
diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index 66d3275cc4ab..6ad0c97574e1 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -203,7 +203,6 @@ ScDocumentPool::ScDocumentPool()
     SvxFontItem* pCtlFont = getDefaultFontItem(nCtlLang, DefaultFontType::CTL_SPREADSHEET, ATTR_CTL_FONT);
 
     SvxBoxInfoItem* pGlobalBorderInnerAttr = new SvxBoxInfoItem( ATTR_BORDER_INNER );
-    auto pSet = std::make_unique<SfxItemSet>( *this, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
     SfxItemSet      aSetItemItemSet( *this,
                                      svl::Items<ATTR_BACKGROUND, ATTR_BACKGROUND,
                                      ATTR_BORDER,     ATTR_SHADOW,
@@ -281,9 +280,14 @@ ScDocumentPool::ScDocumentPool()
     // TODO: Write additional method ScGlobal::IsInit() or somesuch
     //       or detect whether this is the Secondary Pool for a MessagePool
     if ( ScGlobal::GetEmptyBrushItem() )
-        mvPoolDefaults[ ATTR_PATTERN     - ATTR_STARTINDEX ] = new ScPatternAttr( std::move(pSet), ScResId(STR_STYLENAME_STANDARD) );
+
+        mvPoolDefaults[ ATTR_PATTERN     - ATTR_STARTINDEX ] =
+            new ScPatternAttr( SfxItemSet( *this, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} ),
+                               ScResId(STR_STYLENAME_STANDARD) );
     else
-        mvPoolDefaults[ ATTR_PATTERN     - ATTR_STARTINDEX ] = new ScPatternAttr( std::move(pSet), STRING_STANDARD ); // FIXME: without name?
+        mvPoolDefaults[ ATTR_PATTERN     - ATTR_STARTINDEX ] =
+            new ScPatternAttr( SfxItemSet( *this, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} ),
+                               STRING_STANDARD ); // FIXME: without name?
 
     mvPoolDefaults[ ATTR_LRSPACE         - ATTR_STARTINDEX ] = new SvxLRSpaceItem( ATTR_LRSPACE );
     mvPoolDefaults[ ATTR_ULSPACE         - ATTR_STARTINDEX ] = new SvxULSpaceItem( ATTR_ULSPACE );
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index c9a30aedc012..8d446382eaac 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -5113,7 +5113,7 @@ std::unique_ptr<ScPatternAttr> ScDocument::CreateSelectionPattern( const ScMarkD
     OSL_ENSURE( aState.pItemSet, "SelectionPattern Null" );
     if (aState.pItemSet)
     {
-        std::unique_ptr<ScPatternAttr> pPattern(new ScPatternAttr( std::move(aState.pItemSet) ));
+        std::unique_ptr<ScPatternAttr> pPattern(new ScPatternAttr( std::move(*aState.pItemSet) ));
         if (aState.mbValidPatternId)
             pPattern->SetKey(aState.mnPatternId);
 
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index d5f137f09117..a73758288ce1 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -66,7 +66,7 @@
 #include <fillinfo.hxx>
 #include <boost/functional/hash.hpp>
 
-ScPatternAttr::ScPatternAttr( std::unique_ptr<SfxItemSet>&& pItemSet, const OUString& rStyleName )
+ScPatternAttr::ScPatternAttr( SfxItemSet&& pItemSet, const OUString& rStyleName )
     :   SfxSetItem  ( ATTR_PATTERN, std::move(pItemSet) ),
         pName       ( rStyleName ),
         pStyle      ( nullptr ),
@@ -74,7 +74,7 @@ ScPatternAttr::ScPatternAttr( std::unique_ptr<SfxItemSet>&& pItemSet, const OUSt
 {
 }
 
-ScPatternAttr::ScPatternAttr( std::unique_ptr<SfxItemSet>&& pItemSet )
+ScPatternAttr::ScPatternAttr( SfxItemSet&& pItemSet )
     :   SfxSetItem  ( ATTR_PATTERN, std::move(pItemSet) ),
         pStyle      ( nullptr ),
         mnKey(0)
@@ -82,7 +82,7 @@ ScPatternAttr::ScPatternAttr( std::unique_ptr<SfxItemSet>&& pItemSet )
 }
 
 ScPatternAttr::ScPatternAttr( SfxItemPool* pItemPool )
-    :   SfxSetItem  ( ATTR_PATTERN, std::make_unique<SfxItemSet>( *pItemPool, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} ) ),
+    :   SfxSetItem  ( ATTR_PATTERN, SfxItemSet( *pItemPool, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} ) ),
         pStyle      ( nullptr ),
         mnKey(0)
 {
@@ -102,7 +102,7 @@ ScPatternAttr::~ScPatternAttr()
 
 ScPatternAttr* ScPatternAttr::Clone( SfxItemPool *pPool ) const
 {
-    ScPatternAttr* pPattern = new ScPatternAttr( GetItemSet().Clone(true, pPool) );
+    ScPatternAttr* pPattern = new ScPatternAttr( GetItemSet().CloneAsValue(true, pPool) );
 
     pPattern->pStyle = pStyle;
     pPattern->pName = pName;
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index fa12ebd6ac4c..eb86c98e9a00 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -211,16 +211,16 @@ static void lcl_AdjustPool( SfxStyleSheetBasePool* pStylePool )
         if (rStyleSet.GetItemState(ATTR_PAGE_HEADERSET,false,&pItem) == SfxItemState::SET)
         {
             const SfxItemSet& rSrcSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
-            auto pDestSet = std::make_unique<SfxItemSet>(*rStyleSet.GetPool(),rSrcSet.GetRanges());
-            pDestSet->Put(rSrcSet);
-            rStyleSet.Put(SvxSetItem(ATTR_PAGE_HEADERSET,std::move(pDestSet)));
+            SfxItemSet aDestSet(*rStyleSet.GetPool(),rSrcSet.GetRanges());
+            aDestSet.Put(rSrcSet);
+            rStyleSet.Put(SvxSetItem(ATTR_PAGE_HEADERSET, std::move(aDestSet)));
         }
         if (rStyleSet.GetItemState(ATTR_PAGE_FOOTERSET,false,&pItem) == SfxItemState::SET)
         {
             const SfxItemSet& rSrcSet = static_cast<const SvxSetItem*>(pItem)->GetItemSet();
-            auto pDestSet = std::make_unique<SfxItemSet>(*rStyleSet.GetPool(),rSrcSet.GetRanges());
-            pDestSet->Put(rSrcSet);
-            rStyleSet.Put(SvxSetItem(ATTR_PAGE_FOOTERSET,std::move(pDestSet)));
+            SfxItemSet aDestSet(*rStyleSet.GetPool(),rSrcSet.GetRanges());
+            aDestSet.Put(rSrcSet);
+            rStyleSet.Put(SvxSetItem(ATTR_PAGE_FOOTERSET, std::move(aDestSet)));
         }
 
         pStyle = pStylePool->Next();
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 718d8cd0e8c7..acea298aab32 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -895,8 +895,8 @@ void ScViewFunc::ApplyAttributes( const SfxItemSet* pDialogSet,
         return;
     }
 
-    ScPatternAttr aOldAttrs( std::make_unique<SfxItemSet>(*pOldSet) );
-    ScPatternAttr aNewAttrs( std::make_unique<SfxItemSet>(*pDialogSet) );
+    ScPatternAttr aOldAttrs(( SfxItemSet(*pOldSet) ));
+    ScPatternAttr aNewAttrs(( SfxItemSet(*pDialogSet) ));
     aNewAttrs.DeleteUnchanged( &aOldAttrs );
 
     if ( pDialogSet->GetItemState( ATTR_VALUE_FORMAT ) == SfxItemState::SET )
@@ -1005,7 +1005,7 @@ void ScViewFunc::ApplyAttr( const SfxPoolItem& rAttrItem, bool bAdjustBlockHeigh
         return;
     }
 
-    ScPatternAttr aNewAttrs( std::make_unique<SfxItemSet>( *GetViewData().GetDocument().GetPool(),
+    ScPatternAttr aNewAttrs( SfxItemSet( *GetViewData().GetDocument().GetPool(),
                                             svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} ) );
 
     aNewAttrs.GetItemSet().Put( rAttrItem );
diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx
index 6d090d8556bd..b23ef665c899 100644
--- a/svl/source/items/itempool.cxx
+++ b/svl/source/items/itempool.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <svl/itempool.hxx>
+#include <svl/setitem.hxx>
 
 #include <string.h>
 #include <libxml/xmlwriter.h>
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 5b986167686f..7fb88175590d 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -28,6 +28,7 @@
 
 #include <sal/log.hxx>
 #include <svl/itemset.hxx>
+#include <svl/itemset.hxx>
 #include <svl/itempool.hxx>
 #include <svl/itemiter.hxx>
 #include <svl/setitem.hxx>
diff --git a/svl/source/items/sitem.cxx b/svl/source/items/sitem.cxx
index 57eb5436ea56..c4734d35c2f2 100644
--- a/svl/source/items/sitem.cxx
+++ b/svl/source/items/sitem.cxx
@@ -29,23 +29,25 @@
 
 SfxSetItem::SfxSetItem( sal_uInt16 which, const SfxItemSet &rSet) :
     SfxPoolItem(which),
-    pSet(rSet.Clone())
+    maSet(rSet)
 {
+    assert(!dynamic_cast<const SfxAllItemSet*>(&rSet) && "cannot handle SfxAllItemSet here");
 }
 
 
-SfxSetItem::SfxSetItem( sal_uInt16 which, std::unique_ptr<SfxItemSet> &&pS) :
+SfxSetItem::SfxSetItem( sal_uInt16 which, SfxItemSet &&pS) :
     SfxPoolItem(which),
-    pSet(std::move(pS))
+    maSet(pS)
 {
-    DBG_ASSERT(pSet, "SfxSetItem without set constructed" );
+    assert(!dynamic_cast<SfxAllItemSet*>(&pS) && "cannot handle SfxAllItemSet here");
 }
 
 
 SfxSetItem::SfxSetItem( const SfxSetItem& rCopy, SfxItemPool *pPool ) :
     SfxPoolItem(rCopy),
-    pSet(rCopy.pSet->Clone(true, pPool))
+    maSet(rCopy.maSet.CloneAsValue(true, pPool))
 {
+    assert(!dynamic_cast<const SfxAllItemSet*>(&rCopy) && "cannot handle SfxAllItemSet here");
 }
 
 
@@ -57,7 +59,7 @@ SfxSetItem::~SfxSetItem()
 bool SfxSetItem::operator==( const SfxPoolItem& rCmp) const
 {
     assert(SfxPoolItem::operator==(rCmp));
-    return *pSet == *static_cast<const SfxSetItem &>(rCmp).pSet;
+    return maSet == static_cast<const SfxSetItem &>(rCmp).maSet;
 }
 
 
diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx
index a715543e8dae..db45b3e9fe62 100644
--- a/svx/source/items/pageitem.cxx
+++ b/svx/source/items/pageitem.cxx
@@ -262,7 +262,7 @@ SvxSetItem::SvxSetItem( const SvxSetItem& rItem ) :
 {
 }
 
-SvxSetItem::SvxSetItem( const sal_uInt16 nId, std::unique_ptr<SfxItemSet>&& _pSet ) :
+SvxSetItem::SvxSetItem( const sal_uInt16 nId, SfxItemSet&& _pSet ) :
 
     SfxSetItem( nId, std::move(_pSet) )
 {
diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx
index 421094428fb3..ea32ddea2cb4 100644
--- a/svx/source/xoutdev/xattr.cxx
+++ b/svx/source/xoutdev/xattr.cxx
@@ -2998,14 +2998,14 @@ XFormTextHideFormItem* XFormTextHideFormItem::Clone(SfxItemPool* /*pPool*/) cons
 
 
 /// a line attribute set item
-XLineAttrSetItem::XLineAttrSetItem( std::unique_ptr<SfxItemSet>&& pItemSet ) :
+XLineAttrSetItem::XLineAttrSetItem( SfxItemSet&& pItemSet ) :
     SfxSetItem( XATTRSET_LINE, std::move(pItemSet))
 {
 }
 
 XLineAttrSetItem::XLineAttrSetItem( SfxItemPool* pItemPool ) :
     SfxSetItem( XATTRSET_LINE,
-        std::make_unique<SfxItemSet>( *pItemPool, svl::Items<XATTR_LINE_FIRST, XATTR_LINE_LAST>{}))
+        SfxItemSet( *pItemPool, svl::Items<XATTR_LINE_FIRST, XATTR_LINE_LAST>{}))
 {
 }
 
@@ -3026,14 +3026,14 @@ XLineAttrSetItem* XLineAttrSetItem::Clone( SfxItemPool* pPool ) const
 }
 
 /// fill attribute set item
-XFillAttrSetItem::XFillAttrSetItem( std::unique_ptr<SfxItemSet>&& pItemSet ) :
+XFillAttrSetItem::XFillAttrSetItem( SfxItemSet&& pItemSet ) :
     SfxSetItem( XATTRSET_FILL, std::move(pItemSet))
 {
 }
 
 XFillAttrSetItem::XFillAttrSetItem( SfxItemPool* pItemPool ) :
     SfxSetItem( XATTRSET_FILL,
-        std::make_unique<SfxItemSet>( *pItemPool, svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}))
+        SfxItemSet( *pItemPool, svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}))
 {
 }
 
diff --git a/svx/source/xoutdev/xpool.cxx b/svx/source/xoutdev/xpool.cxx
index bff5490aa565..928098ceca68 100644
--- a/svx/source/xoutdev/xpool.cxx
+++ b/svx/source/xoutdev/xpool.cxx
@@ -141,10 +141,10 @@ XOutdevItemPool::XOutdevItemPool(SfxItemPool* _pMaster)
 
     // create SetItems
     rPoolDefaults[XATTRSET_LINE - XATTR_START] = new XLineAttrSetItem(
-        std::make_unique<SfxItemSet>(
+        SfxItemSet(
             *_pMaster, svl::Items<XATTR_LINE_FIRST, XATTR_LINE_LAST>{}));
     rPoolDefaults[XATTRSET_FILL - XATTR_START] = new XFillAttrSetItem(
-        std::make_unique<SfxItemSet>(
+        SfxItemSet(
             *_pMaster, svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}));
 
     // create ItemInfos


More information about the Libreoffice-commits mailing list