[Libreoffice-commits] core.git: sc/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Thu Oct 7 14:44:29 UTC 2021


 sc/source/core/data/docpool.cxx            |    4 ++--
 sc/source/core/data/documen8.cxx           |    6 +++---
 sc/source/core/data/patattr.cxx            |    2 +-
 sc/source/core/data/stlsheet.cxx           |    8 +++-----
 sc/source/core/data/table2.cxx             |    2 +-
 sc/source/filter/excel/xehelper.cxx        |    4 ++--
 sc/source/filter/excel/xlroot.cxx          |    2 +-
 sc/source/ui/app/scmod.cxx                 |    2 +-
 sc/source/ui/docshell/docsh3.cxx           |    3 +--
 sc/source/ui/drawfunc/drawsh.cxx           |    4 ++--
 sc/source/ui/drawfunc/drawsh5.cxx          |    2 +-
 sc/source/ui/drawfunc/drtxtob.cxx          |    8 ++++----
 sc/source/ui/drawfunc/drtxtob1.cxx         |    6 ++----
 sc/source/ui/drawfunc/drtxtob2.cxx         |    9 ++++-----
 sc/source/ui/drawfunc/fuconcustomshape.cxx |    7 +++----
 sc/source/ui/drawfunc/futext.cxx           |    5 ++---
 sc/source/ui/unoobj/confuno.cxx            |    6 +++---
 sc/source/ui/view/cellsh1.cxx              |    2 +-
 sc/source/ui/view/cellsh2.cxx              |    2 +-
 sc/source/ui/view/cellsh3.cxx              |    8 ++------
 sc/source/ui/view/drawview.cxx             |    2 +-
 sc/source/ui/view/formatsh.cxx             |   10 +++-------
 sc/source/ui/view/gridwin2.cxx             |    3 +--
 sc/source/ui/view/gridwin3.cxx             |    2 +-
 sc/source/ui/view/pivotsh.cxx              |    3 +--
 sc/source/ui/view/prevwsh.cxx              |    2 +-
 sc/source/ui/view/tabvwsh3.cxx             |    2 +-
 sc/source/ui/view/tabvwshc.cxx             |   14 +++++---------
 sc/source/ui/view/viewfun2.cxx             |    8 ++------
 sc/source/ui/view/viewfunc.cxx             |    4 ++--
 30 files changed, 58 insertions(+), 84 deletions(-)

New commits:
commit 1d4827a26a749ca704430d6aae972ee39e35ba10
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Wed Oct 6 19:39:14 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Oct 7 16:43:52 2021 +0200

    use SfxItemSetFixed in sc
    
    Change-Id: I5b1d66adb1b9e5dd0e470403ba7095183334cc66
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123182
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index ee4f81c337e4..38dfcb1187df 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -282,11 +282,11 @@ ScDocumentPool::ScDocumentPool()
     if ( ScGlobal::GetEmptyBrushItem() )
 
         mvPoolDefaults[ ATTR_PATTERN     - ATTR_STARTINDEX ] =
-            new ScPatternAttr( SfxItemSet( *this, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END> ),
+            new ScPatternAttr( SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END>( *this ),
                                ScResId(STR_STYLENAME_STANDARD) );
     else
         mvPoolDefaults[ ATTR_PATTERN     - ATTR_STARTINDEX ] =
-            new ScPatternAttr( SfxItemSet( *this, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END> ),
+            new ScPatternAttr( SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END>( *this ),
                                STRING_STANDARD ); // FIXME: without name?
 
     mvPoolDefaults[ ATTR_LRSPACE         - ATTR_STARTINDEX ] = new SvxLRSpaceItem( ATTR_LRSPACE );
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 1553c26c0f3e..3354ead298f0 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -117,11 +117,11 @@ SfxPrinter* ScDocument::GetPrinter(bool bCreateIfNotExist)
     if ( !mpPrinter && bCreateIfNotExist )
     {
         auto pSet =
-            std::make_unique<SfxItemSet>( *mxPoolHelper->GetDocPool(),
-                            svl::Items<SID_PRINTER_NOTFOUND_WARN,  SID_PRINTER_NOTFOUND_WARN,
+            std::make_unique<SfxItemSetFixed
+                            <SID_PRINTER_NOTFOUND_WARN,  SID_PRINTER_NOTFOUND_WARN,
                             SID_PRINTER_CHANGESTODOC,   SID_PRINTER_CHANGESTODOC,
                             SID_PRINT_SELECTEDSHEET,    SID_PRINT_SELECTEDSHEET,
-                            SID_SCPRINTOPTIONS,         SID_SCPRINTOPTIONS> );
+                            SID_SCPRINTOPTIONS,         SID_SCPRINTOPTIONS>>(*mxPoolHelper->GetDocPool());
 
         SfxPrinterChangeFlags nFlags = SfxPrinterChangeFlags::NONE;
         if (officecfg::Office::Common::Print::Warning::PaperOrientation::get())
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index b9b2859104b2..f474cb052232 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -83,7 +83,7 @@ ScPatternAttr::ScPatternAttr( SfxItemSet&& pItemSet )
 }
 
 ScPatternAttr::ScPatternAttr( SfxItemPool* pItemPool )
-    :   SfxSetItem  ( ATTR_PATTERN, SfxItemSet( *pItemPool, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END> ) ),
+    :   SfxSetItem  ( ATTR_PATTERN, SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END>( *pItemPool ) ),
         pStyle      ( nullptr ),
         mnKey(0)
 {
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index 2880cd5be67f..5712bf883c78 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -138,14 +138,12 @@ SfxItemSet& ScStyleSheet::GetItemSet()
                     // (== Standard page template)
 
                     SfxItemPool& rItemPool = GetPool()->GetPool();
-                    pSet = new SfxItemSet(
-                        rItemPool,
-                        svl::Items<
+                    pSet = new SfxItemSetFixed<
                             ATTR_USERDEF, ATTR_USERDEF,
                             ATTR_WRITINGDIR, ATTR_WRITINGDIR,
                             ATTR_BACKGROUND, ATTR_BACKGROUND,
                             ATTR_BORDER, ATTR_SHADOW,
-                            ATTR_LRSPACE, ATTR_PAGE_SCALETO> );
+                            ATTR_LRSPACE, ATTR_PAGE_SCALETO>(rItemPool);
 
                     //  If being loaded also the set is then filled in from the file,
                     //  so the defaults do not need to be set.
@@ -222,7 +220,7 @@ SfxItemSet& ScStyleSheet::GetItemSet()
 
             case SfxStyleFamily::Para:
             default:
-                pSet = new SfxItemSet( GetPool()->GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END> );
+                pSet = new SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END>( GetPool()->GetPool() );
                 break;
         }
         bMySet = true;
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 04d7a8092e4e..be9f92a3239d 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -467,7 +467,7 @@ void ScTable::DeleteSelection( InsertDeleteFlags nDelFlag, const ScMarkData& rMa
     if ( IsProtected() && (nDelFlag & InsertDeleteFlags::ATTRIB) )
     {
         ScDocumentPool* pPool = rDocument.GetPool();
-        SfxItemSet aSet( *pPool, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END> );
+        SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END> aSet( *pPool );
         aSet.Put( ScProtectionAttr( false ) );
         SfxItemPoolCache aCache( pPool, &aSet );
         ApplySelectionCache( &aCache, rMark );
diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx
index 6292a86e007a..658d8ea837ca 100644
--- a/sc/source/filter/excel/xehelper.cxx
+++ b/sc/source/filter/excel/xehelper.cxx
@@ -428,7 +428,7 @@ XclExpStringRef lclCreateFormattedString(
 
     // font buffer and helper item set for edit engine -> Calc item conversion
     XclExpFontBuffer& rFontBuffer = rRoot.GetFontBuffer();
-    SfxItemSet aItemSet( *rRoot.GetDoc().GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END> );
+    SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END> aItemSet( *rRoot.GetDoc().GetPool() );
 
     // script type handling
     Reference< XBreakIterator > xBreakIt = rRoot.GetDoc().GetBreakIterator();
@@ -679,7 +679,7 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico
 
     OUString aText;
     sal_Int32 nHeight = 0;
-    SfxItemSet aItemSet( *GetDoc().GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END> );
+    SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END> aItemSet( *GetDoc().GetPool() );
 
     // edit engine
     bool bOldUpdateMode = mrEE.SetUpdateLayout( true );
diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx
index 8c0097b720b9..d0a808c3a225 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -382,7 +382,7 @@ ScHeaderEditEngine& XclRoot::GetHFEditEngine() const
 
         // set Calc header/footer defaults
         auto pEditSet = std::make_unique<SfxItemSet>( rEE.GetEmptyItemSet() );
-        SfxItemSet aItemSet( *GetDoc().GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END> );
+        SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END> aItemSet( *GetDoc().GetPool() );
         ScPatternAttr::FillToEditItemSet( *pEditSet, aItemSet );
         // FillToEditItemSet() adjusts font height to 1/100th mm, we need twips
         pEditSet->Put( aItemSet.Get( ATTR_FONT_HEIGHT ).CloneSetWhich(EE_CHAR_FONTHEIGHT) );
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index b6917c58e9a9..3c47445cf566 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -349,7 +349,7 @@ void ScModule::Execute( SfxRequest& rReq )
                         bSet = !GetDocOptions().IsAutoSpell();
                 }
 
-                SfxItemSet aSet( GetPool(), svl::Items<SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK> );
+                SfxItemSetFixed<SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK> aSet( GetPool() );
                 aSet.Put( SfxBoolItem( SID_AUTOSPELL_CHECK, bSet ) );
                 ModifyOptions( aSet );
                 rReq.Done();
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 103b910803c9..cc8f3b912de2 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -646,8 +646,7 @@ void ScDocShell::ExecuteChangeCommentDialog( ScChangeAction* pAction, weld::Wind
     OUString aDate = ScGlobal::getLocaleData().getDate( aDT ) + " " +
         ScGlobal::getLocaleData().getTime( aDT, false );
 
-    SfxItemSet aSet(
-        GetPool(), svl::Items<SID_ATTR_POSTIT_AUTHOR, SID_ATTR_POSTIT_TEXT>);
+    SfxItemSetFixed<SID_ATTR_POSTIT_AUTHOR, SID_ATTR_POSTIT_TEXT> aSet( GetPool() );
 
     aSet.Put( SvxPostItTextItem  ( aComment, SID_ATTR_POSTIT_TEXT ) );
     aSet.Put( SvxPostItAuthorItem( aAuthor,  SID_ATTR_POSTIT_AUTHOR ) );
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 3de430eecb7e..08be0531f2a5 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -202,7 +202,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
 
         case SID_TEXT_STANDARD: // delete hard text attributes
             {
-                SfxItemSet aEmptyAttr(GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>);
+                SfxItemSetFixed<EE_ITEMS_START, EE_ITEMS_END> aEmptyAttr(GetPool());
                 pView->SetAttributes(aEmptyAttr, true);
             }
             break;
@@ -460,7 +460,7 @@ void ScDrawShell::ExecuteMacroAssign(SdrObject* pObj, weld::Window* pWin)
     }
 
     // create empty itemset for macro-dlg
-    SfxItemSet aItemSet(SfxGetpApp()->GetPool(), svl::Items<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG> );
+    SfxItemSetFixed<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG> aItemSet(SfxGetpApp()->GetPool() );
     aItemSet.Put ( aItem );
 
     SfxEventNamesItem aNamesItem(SID_EVENTCONFIG);
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index 7b3d47a83ced..70dff477d54e 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -455,7 +455,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
                 const SfxBoolItem* pItem = rReq.GetArg<SfxBoolItem>(SID_ENABLE_HYPHENATION);
                 if( pItem )
                 {
-                    SfxItemSet aSet( GetPool(), svl::Items<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE> );
+                    SfxItemSetFixed<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE> aSet( GetPool() );
                     bool bValue = pItem->GetValue();
                     aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
                     pView->SetAttributes( aSet );
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 8dcdfe12a2e8..9303380ca494 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -800,7 +800,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
                 if ( pOutView )
                     pOutView->Paint( tools::Rectangle() );
 
-                SfxItemSet aEmptyAttr( *aEditAttr.GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END> );
+                SfxItemSetFixed<EE_ITEMS_START, EE_ITEMS_END> aEmptyAttr( *aEditAttr.GetPool() );
                 pView->SetAttributes( aEmptyAttr, true );
 
                 if ( pOutView )
@@ -924,7 +924,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
         sal_uInt16 nId = SID_ATTR_PARA_LRSPACE;
         const SvxLRSpaceItem& rItem = static_cast<const SvxLRSpaceItem&>(
             pArgs->Get( nId ));
-        SfxItemSet aAttr( GetPool(), svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE> );
+        SfxItemSetFixed<EE_PARA_LRSPACE, EE_PARA_LRSPACE> aAttr( GetPool() );
         nId = EE_PARA_LRSPACE;
         SvxLRSpaceItem aLRSpaceItem( rItem.GetLeft(),
             rItem.GetRight(), rItem.GetTextLeft(),
@@ -936,7 +936,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
     {
         SvxLineSpacingItem aLineSpaceItem = static_cast<const SvxLineSpacingItem&>(pArgs->Get(
                                                             GetPool().GetWhich(nSlot)));
-        SfxItemSet aAttr( GetPool(), svl::Items<EE_PARA_SBL, EE_PARA_SBL> );
+        SfxItemSetFixed<EE_PARA_SBL, EE_PARA_SBL> aAttr( GetPool() );
         aAttr.Put( aLineSpaceItem );
         pView->SetAttributes( aAttr );
     }
@@ -944,7 +944,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
     {
         SvxULSpaceItem aULSpaceItem = static_cast<const SvxULSpaceItem&>(pArgs->Get(
                                                             GetPool().GetWhich(nSlot)));
-        SfxItemSet aAttr( GetPool(), svl::Items<EE_PARA_ULSPACE, EE_PARA_ULSPACE> );
+        SfxItemSetFixed<EE_PARA_ULSPACE, EE_PARA_ULSPACE> aAttr( GetPool() );
         aULSpaceItem.SetWhich(EE_PARA_ULSPACE);
         aAttr.Put( aULSpaceItem );
         pView->SetAttributes( aAttr );
diff --git a/sc/source/ui/drawfunc/drtxtob1.cxx b/sc/source/ui/drawfunc/drtxtob1.cxx
index 077c5209ae28..4bef23933ed7 100644
--- a/sc/source/ui/drawfunc/drtxtob1.cxx
+++ b/sc/source/ui/drawfunc/drtxtob1.cxx
@@ -64,11 +64,9 @@ bool ScDrawTextObjectBar::ExecuteParaDlg( const SfxItemSet& rArgs,
                                                 SfxItemSet& rOutSet )
 {
     SfxItemPool* pArgPool = rArgs.GetPool();
-    SfxItemSet aNewAttr(
-        *pArgPool,
-        svl::Items<
+    SfxItemSetFixed<
             EE_ITEMS_START, EE_ITEMS_END,
-            SID_ATTR_PARA_PAGEBREAK, SID_ATTR_PARA_WIDOWS>);
+            SID_ATTR_PARA_PAGEBREAK, SID_ATTR_PARA_WIDOWS>  aNewAttr(*pArgPool);
     aNewAttr.Put( rArgs );
 
     // Values have been taken over once to show the dialog.
diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx
index a09f59718de8..a5b4a7394cdd 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -82,7 +82,7 @@ void ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
         case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
         case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
             {
-                SfxItemSet aAttr( pView->GetModel()->GetItemPool(), svl::Items<SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION> );
+                SfxItemSetFixed<SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION> aAttr( pView->GetModel()->GetItemPool() );
                 aAttr.Put( SvxWritingModeItem(
                     nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ?
                         css::text::WritingMode_LR_TB : css::text::WritingMode_TB_RL,
@@ -98,7 +98,7 @@ void ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
                 const SfxBoolItem* pItem = rReq.GetArg<SfxBoolItem>(SID_ENABLE_HYPHENATION);
                 if( pItem )
                 {
-                    SfxItemSet aSet( GetPool(), svl::Items<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE> );
+                    SfxItemSetFixed<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE> aSet( GetPool() );
                     bool bValue = pItem->GetValue();
                     aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
                     pView->SetAttributes( aSet );
@@ -153,9 +153,8 @@ void ScDrawTextObjectBar::ExecuteExtra( SfxRequest &rReq )
         case SID_ATTR_PARA_LEFT_TO_RIGHT:
         case SID_ATTR_PARA_RIGHT_TO_LEFT:
             {
-                SfxItemSet aAttr( pView->GetModel()->GetItemPool(),
-                                    svl::Items<EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR,
-                                    EE_PARA_JUST, EE_PARA_JUST> );
+                SfxItemSetFixed<EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR,
+                                    EE_PARA_JUST, EE_PARA_JUST>  aAttr( pView->GetModel()->GetItemPool() );
                 bool bLeft = ( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT );
                 aAttr.Put( SvxFrameDirectionItem(
                                 bLeft ? SvxFrameDirection::Horizontal_LR_TB : SvxFrameDirection::Horizontal_RL_TB,
diff --git a/sc/source/ui/drawfunc/fuconcustomshape.cxx b/sc/source/ui/drawfunc/fuconcustomshape.cxx
index b9cea7984a97..2e7a506f77f1 100644
--- a/sc/source/ui/drawfunc/fuconcustomshape.cxx
+++ b/sc/source/ui/drawfunc/fuconcustomshape.cxx
@@ -156,9 +156,7 @@ void FuConstCustomShape::SetAttributes( SdrObject* pObj )
                         if( pSourceObj )
                         {
                             const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
-                            SfxItemSet aDest(
-                                pObj->getSdrModelFromSdrObject().GetItemPool(),
-                                svl::Items<
+                            SfxItemSetFixed<
                                     // Ranges from SdrAttrObj:
                                     SDRATTR_START, SDRATTR_SHADOW_LAST,
                                     SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
@@ -169,7 +167,8 @@ void FuConstCustomShape::SetAttributes( SdrObject* pObj )
                                     SDRATTR_GRAF_FIRST,
                                         SDRATTR_CUSTOMSHAPE_LAST,
                                     // Range from SdrTextObj:
-                                    EE_ITEMS_START, EE_ITEMS_END>);
+                                    EE_ITEMS_START, EE_ITEMS_END>  aDest(
+                                pObj->getSdrModelFromSdrObject().GetItemPool());
                             aDest.Set( rSource );
                             pObj->SetMergedItemSet( aDest );
                             Degree100 nAngle = pSourceObj->GetRotateAngle();
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index dc2f1d8ec8fb..ef853ef52078 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -394,8 +394,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
                     SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
 
                     // set needed attributes for scrolling
-                    SfxItemSet aItemSet( pDrDoc->GetItemPool(),
-                                            svl::Items<SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST>);
+                    SfxItemSetFixed<SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST> aItemSet( pDrDoc->GetItemPool());
 
                     aItemSet.Put( makeSdrTextAutoGrowWidthItem( false ) );
                     aItemSet.Put( makeSdrTextAutoGrowHeightItem( false ) );
@@ -662,7 +661,7 @@ SdrObjectUniquePtr FuText::CreateDefaultObject(const sal_uInt16 nID, const tools
 
             if(bMarquee)
             {
-                SfxItemSet aSet(pDrDoc->GetItemPool(), svl::Items<SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST>);
+                SfxItemSetFixed<SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST> aSet(pDrDoc->GetItemPool());
 
                 aSet.Put( makeSdrTextAutoGrowWidthItem( false ) );
                 aSet.Put( makeSdrTextAutoGrowHeightItem( false ) );
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index f148b9abed8f..ba081d5e2433 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -239,11 +239,11 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
             {
                 SvMemoryStream aStream (aSequence.getArray(), nSize, StreamMode::READ );
                 aStream.Seek ( STREAM_SEEK_TO_BEGIN );
-                auto pSet = std::make_unique<SfxItemSet>( *rDoc.GetPool(),
-                        svl::Items<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
+                auto pSet = std::make_unique<SfxItemSetFixed
+                        <SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
                         SID_PRINTER_CHANGESTODOC,  SID_PRINTER_CHANGESTODOC,
                         SID_PRINT_SELECTEDSHEET,   SID_PRINT_SELECTEDSHEET,
-                        SID_SCPRINTOPTIONS,        SID_SCPRINTOPTIONS> );
+                        SID_SCPRINTOPTIONS,        SID_SCPRINTOPTIONS>>( *rDoc.GetPool());
 
                 SfxPrinter* pPrinter = pDocShell->GetPrinter();
                 bool bPreferPrinterPapersize = false;
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 0a0ecd874c88..94d2816604c4 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -3273,7 +3273,7 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq)
 
     ScopedVclPtr<SfxAbstractTabDialog> pDlg;
     ScSubTotalParam aSubTotalParam;
-    SfxItemSet aArgSet( GetPool(), svl::Items<SCITEM_SUBTDATA, SCITEM_SUBTDATA> );
+    SfxItemSetFixed<SCITEM_SUBTDATA, SCITEM_SUBTDATA> aArgSet( GetPool() );
 
     bool bAnonymous;
 
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 08526a2fa34f..0bed3b16141f 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -501,7 +501,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
                     if( lcl_GetSortParam( rData, aSortParam ) )
                     {
                         ScDocument& rDoc = GetViewData().GetDocument();
-                        SfxItemSet  aArgSet( GetPool(), svl::Items<SCITEM_SORTDATA, SCITEM_SORTDATA> );
+                        SfxItemSetFixed<SCITEM_SORTDATA, SCITEM_SORTDATA>  aArgSet( GetPool() );
 
                         pDBData->GetSortParam( aSortParam );
                         bool bHasHeader = rDoc.HasColHeader( aSortParam.nCol1, aSortParam.nRow1, aSortParam.nCol2, aSortParam.nRow2, rData.GetTabNo() );
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 960f8aa03381..43abca74e734 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -454,13 +454,9 @@ void ScCellShell::Execute( SfxRequest& rReq )
 
                     // set cell attribute without dialog:
 
-                    SfxItemSet aEmptySet( *pReqArgs->GetPool(),
-                                          svl::Items<ATTR_PATTERN_START,
-                                          ATTR_PATTERN_END> );
+                    SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END>  aEmptySet( *pReqArgs->GetPool() );
 
-                    SfxItemSet aNewSet( *pReqArgs->GetPool(),
-                                        svl::Items<ATTR_PATTERN_START,
-                                        ATTR_PATTERN_END> );
+                    SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END>  aNewSet( *pReqArgs->GetPool() );
 
                     const SfxPoolItem*  pAttr = nullptr;
                     sal_uInt16              nWhich = 0;
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index 0fffffa0661b..ed0cf254ba10 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -1138,7 +1138,7 @@ SdrObject* ScDrawView::ApplyGraphicToObject(
     {
         AddUndo(std::make_unique<SdrUndoAttrObj>(rHitObject));
 
-        SfxItemSet aSet(GetModel()->GetItemPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLBITMAP>);
+        SfxItemSetFixed<XATTR_FILLSTYLE, XATTR_FILLBITMAP> aSet(GetModel()->GetItemPool());
 
         aSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
         aSet.Put(XFillBitmapItem(OUString(), rGraphic));
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index fd0007c4e3ff..afba26065fa3 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1236,7 +1236,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
                     const SfxItemSet& rOldSet =
                         pTabViewShell->GetSelectionPattern()->GetItemSet();
                     SfxItemPool* pDocPool = GetViewData().GetDocument().GetPool();
-                    SfxItemSet aNewSet( *pDocPool, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END> );
+                    SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END> aNewSet( *pDocPool );
                     aNewSet.Put( *pItem );
                     pTabViewShell->ApplyAttributes( &aNewSet, &rOldSet );
                 }
@@ -1900,12 +1900,8 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
                 {
                     ::editeng::SvxBorderLine*          pDefLine = pTabViewShell->GetDefaultFrameLine();
                     const ScPatternAttr*    pOldAttrs = pTabViewShell->GetSelectionPattern();
-                    SfxItemSet aOldSet( *rDoc.GetPool(),
-                                        svl::Items<ATTR_PATTERN_START,
-                                                    ATTR_PATTERN_END> );
-                    SfxItemSet aNewSet( *rDoc.GetPool(),
-                                        svl::Items<ATTR_PATTERN_START,
-                                                    ATTR_PATTERN_END> );
+                    SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END> aOldSet( *rDoc.GetPool() );
+                    SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END> aNewSet( *rDoc.GetPool() );
                     const SfxPoolItem&      rBorderAttr =
                                                 pOldAttrs->GetItemSet().
                                                     Get( ATTR_BORDER );
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index cfcd088bba34..0baef4a4aa96 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -195,8 +195,7 @@ void ScGridWindow::DoPushPivotButton( SCCOL nCol, SCROW nRow, const MouseEvent&
                 nSrcTab = pDesc->GetSourceRange().aStart.Tab();
             }
 
-            SfxItemSet aArgSet( mrViewData.GetViewShell()->GetPool(),
-                                        svl::Items<SCITEM_QUERYDATA, SCITEM_QUERYDATA> );
+            SfxItemSetFixed<SCITEM_QUERYDATA, SCITEM_QUERYDATA>  aArgSet( mrViewData.GetViewShell()->GetPool() );
             aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA, &mrViewData, &aQueryParam ) );
 
             ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx
index 25d8eb0729c6..e550447da8b5 100644
--- a/sc/source/ui/view/gridwin3.cxx
+++ b/sc/source/ui/view/gridwin3.cxx
@@ -340,7 +340,7 @@ void ScGridWindow::UpdateStatusPosSize()
     if (!pPV)
         return; // shouldn't be called in that case either
 
-    SfxItemSet aSet(mrViewData.GetViewShell()->GetPool(), svl::Items<SID_ATTR_POSITION, SID_ATTR_SIZE>);
+    SfxItemSetFixed<SID_ATTR_POSITION, SID_ATTR_SIZE> aSet(mrViewData.GetViewShell()->GetPool());
 
     //  Fill items for position and size:
     //  show action rectangle during action,
diff --git a/sc/source/ui/view/pivotsh.cxx b/sc/source/ui/view/pivotsh.cxx
index eb21ece4e33c..b4ef807ffa46 100644
--- a/sc/source/ui/view/pivotsh.cxx
+++ b/sc/source/ui/view/pivotsh.cxx
@@ -94,8 +94,7 @@ void ScPivotShell::Execute( const SfxRequest& rReq )
                 }
 
                 ScViewData& rViewData = pViewShell->GetViewData();
-                SfxItemSet aArgSet( pViewShell->GetPool(),
-                    svl::Items<SCITEM_QUERYDATA, SCITEM_QUERYDATA> );
+                SfxItemSetFixed<SCITEM_QUERYDATA, SCITEM_QUERYDATA> aArgSet( pViewShell->GetPool() );
                 aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA, &rViewData, &aQueryParam ) );
 
                 ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 56f0277e03ff..58026e22926e 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -635,7 +635,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
                 }
                 else
                 {
-                    SfxItemSet      aSet     ( GetPool(), svl::Items<SID_ATTR_ZOOM, SID_ATTR_ZOOM> );
+                    SfxItemSetFixed<SID_ATTR_ZOOM, SID_ATTR_ZOOM>  aSet( GetPool() );
                     SvxZoomItem     aZoomItem( SvxZoomType::PERCENT, pPreview->GetZoom(), SID_ATTR_ZOOM );
 
                     aSet.Put( aZoomItem );
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index ec1cee97633b..4ad0eb9de120 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -758,7 +758,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
                 }
                 else
                 {
-                    SfxItemSet      aSet     ( GetPool(), svl::Items<SID_ATTR_ZOOM, SID_ATTR_ZOOM> );
+                    SfxItemSetFixed<SID_ATTR_ZOOM, SID_ATTR_ZOOM> aSet( GetPool() );
                     SvxZoomItem     aZoomItem( eOldZoomType, nOldZoom, SID_ATTR_ZOOM );
                     ScopedVclPtr<AbstractSvxZoomDialog> pDlg;
                     ScMarkData&     rMark = GetViewData().GetMarkData();
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 43313394b2b5..4dc3cf3bdb46 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -274,9 +274,8 @@ std::shared_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont
         }
         case SID_OPENDLG_CONSOLIDATE:
         {
-            SfxItemSet aArgSet( GetPool(),
-                                svl::Items<SCITEM_CONSOLIDATEDATA,
-                                SCITEM_CONSOLIDATEDATA> );
+            SfxItemSetFixed<SCITEM_CONSOLIDATEDATA,
+                                SCITEM_CONSOLIDATEDATA>  aArgSet( GetPool() );
 
             const ScConsolidateParam* pDlgData =
                             rDoc.GetConsolidateDlgData();
@@ -313,9 +312,7 @@ std::shared_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont
         {
 
             ScQueryParam    aQueryParam;
-            SfxItemSet      aArgSet( GetPool(),
-                                     svl::Items<SCITEM_QUERYDATA,
-                                     SCITEM_QUERYDATA> );
+            SfxItemSetFixed<SCITEM_QUERYDATA, SCITEM_QUERYDATA> aArgSet( GetPool() );
 
             ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, ScGetDBSelection::RowDown);
             pDBData->ExtendDataArea(rDoc);
@@ -338,9 +335,8 @@ std::shared_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont
         case SID_SPECIAL_FILTER:
         {
             ScQueryParam    aQueryParam;
-            SfxItemSet      aArgSet( GetPool(),
-                                     svl::Items<SCITEM_QUERYDATA,
-                                     SCITEM_QUERYDATA> );
+            SfxItemSetFixed<SCITEM_QUERYDATA,
+                                     SCITEM_QUERYDATA> aArgSet( GetPool() );
 
             ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, ScGetDBSelection::RowDown);
             pDBData->ExtendDataArea(rDoc);
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index cc0362c058e8..964a9ef2e100 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -3342,12 +3342,8 @@ void ScViewFunc::SetSelectionFrameLines( const SvxBorderLine* pLine,
     // none of the lines don't care?
     if( (eItemState != SfxItemState::DONTCARE) && (eTLBRState != SfxItemState::DONTCARE) && (eBLTRState != SfxItemState::DONTCARE) )
     {
-        SfxItemSet aOldSet( *rDoc.GetPool(),
-                            svl::Items<ATTR_PATTERN_START,
-                                        ATTR_PATTERN_END> );
-        SfxItemSet aNewSet(*rDoc.GetPool(),
-                            svl::Items<ATTR_PATTERN_START,
-                                        ATTR_PATTERN_END> );
+        SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END> aOldSet( *rDoc.GetPool() );
+        SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END> aNewSet( *rDoc.GetPool() );
 
         SvxBorderLine           aLine;
 
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 17b28bbf9248..e3c725dcb4f0 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -1006,8 +1006,8 @@ void ScViewFunc::ApplyAttr( const SfxPoolItem& rAttrItem, bool bAdjustBlockHeigh
         return;
     }
 
-    ScPatternAttr aNewAttrs( SfxItemSet( *GetViewData().GetDocument().GetPool(),
-                                            svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END> ) );
+    ScPatternAttr aNewAttrs(
+        SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END>( *GetViewData().GetDocument().GetPool() ) );
 
     aNewAttrs.GetItemSet().Put( rAttrItem );
     //  if justify is set (with Buttons), always indentation 0


More information about the Libreoffice-commits mailing list