[Libreoffice-commits] core.git: basctl/source chart2/source compilerplugins/clang cui/source desktop/source editeng/source extensions/source include/svl reportdesign/source sc/qa sc/source sd/qa sd/source sfx2/source starmath/qa starmath/source svl/source svx/source sw/qa sw/source

Stephan Bergmann sbergman at redhat.com
Fri Jun 16 15:29:12 UTC 2017


 basctl/source/basicide/basdoc.cxx                         |    2 
 chart2/source/controller/drawinglayer/DrawViewWrapper.cxx |    5 
 chart2/source/controller/main/DrawCommandDispatch.cxx     |    6 
 chart2/source/controller/main/ShapeController.cxx         |    5 
 compilerplugins/clang/store/sfxitemsetrewrite.cxx         |  262 ++++++++++++++
 cui/source/dialogs/cuihyperdlg.cxx                        |    8 
 cui/source/dialogs/hltpbase.cxx                           |    4 
 cui/source/factory/dlgfact.cxx                            |    2 
 cui/source/options/treeopt.cxx                            |   29 -
 cui/source/tabpages/bbdlg.cxx                             |    5 
 cui/source/tabpages/page.cxx                              |   10 
 desktop/source/app/app.cxx                                |    2 
 editeng/source/editeng/editdoc.cxx                        |    4 
 editeng/source/editeng/editobj.cxx                        |    4 
 editeng/source/editeng/impedit2.cxx                       |    2 
 editeng/source/editeng/impedit4.cxx                       |    6 
 editeng/source/items/textitem.cxx                         |    2 
 editeng/source/uno/unofdesc.cxx                           |    4 
 editeng/source/uno/unoipset.cxx                           |    2 
 editeng/source/uno/unotext.cxx                            |    2 
 extensions/source/propctrlr/formcomponenthandler.cxx      |    5 
 include/svl/itemset.hxx                                   |   67 +++
 reportdesign/source/ui/misc/UITools.cxx                   |    2 
 reportdesign/source/ui/report/ReportSection.cxx           |    6 
 sc/qa/unit/ucalc_formula.cxx                              |    2 
 sc/source/core/data/docpool.cxx                           |    7 
 sc/source/core/data/documen8.cxx                          |    5 
 sc/source/core/data/patattr.cxx                           |    4 
 sc/source/core/data/stlsheet.cxx                          |    7 
 sc/source/core/data/table2.cxx                            |    2 
 sc/source/core/tool/detfunc.cxx                           |   12 
 sc/source/filter/excel/xehelper.cxx                       |    4 
 sc/source/filter/excel/xlroot.cxx                         |    2 
 sc/source/filter/starcalc/scflt.cxx                       |    5 
 sc/source/ui/app/scmod.cxx                                |    7 
 sc/source/ui/docshell/docsh3.cxx                          |    5 
 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                        |    5 
 sc/source/ui/drawfunc/drtxtob2.cxx                        |    9 
 sc/source/ui/drawfunc/fuconcustomshape.cxx                |    6 
 sc/source/ui/drawfunc/futext.cxx                          |    4 
 sc/source/ui/pagedlg/tphf.cxx                             |    4 
 sc/source/ui/unoobj/confuno.cxx                           |    5 
 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                            |   12 
 sc/source/ui/view/gridwin2.cxx                            |    2 
 sc/source/ui/view/gridwin3.cxx                            |    2 
 sc/source/ui/view/pivotsh.cxx                             |    2 
 sc/source/ui/view/prevwsh.cxx                             |    2 
 sc/source/ui/view/tabvwsh3.cxx                            |    2 
 sc/source/ui/view/tabvwshc.cxx                            |   12 
 sc/source/ui/view/viewfun2.cxx                            |    8 
 sc/source/ui/view/viewfunc.cxx                            |    2 
 sd/qa/unit/dialogs-test.cxx                               |   10 
 sd/source/core/sdpage.cxx                                 |    4 
 sd/source/core/sdpage2.cxx                                |    2 
 sd/source/core/stlsheet.cxx                               |    6 
 sd/source/ui/app/sdmod2.cxx                               |   10 
 sd/source/ui/dlg/dlgfield.cxx                             |    2 
 sd/source/ui/dlg/prltempl.cxx                             |    2 
 sd/source/ui/docshell/docshel4.cxx                        |    5 
 sd/source/ui/func/fubullet.cxx                            |    2 
 sd/source/ui/func/fuconcs.cxx                             |    6 
 sd/source/ui/func/fucopy.cxx                              |    6 
 sd/source/ui/func/fuexpand.cxx                            |    2 
 sd/source/ui/func/fumorph.cxx                             |    2 
 sd/source/ui/func/fuoaprms.cxx                            |    2 
 sd/source/ui/func/fuolbull.cxx                            |    6 
 sd/source/ui/func/fupage.cxx                              |   23 -
 sd/source/ui/func/fuparagr.cxx                            |    5 
 sd/source/ui/func/fuprlout.cxx                            |    2 
 sd/source/ui/func/fuprobjs.cxx                            |    2 
 sd/source/ui/func/fuscale.cxx                             |    2 
 sd/source/ui/func/fusldlg.cxx                             |    2 
 sd/source/ui/func/fusnapln.cxx                            |    2 
 sd/source/ui/func/fusumry.cxx                             |    2 
 sd/source/ui/func/futext.cxx                              |    4 
 sd/source/ui/unoidl/UnoDocumentSettings.cxx               |    5 
 sd/source/ui/unoidl/unopage.cxx                           |    4 
 sd/source/ui/unoidl/unopback.cxx                          |   10 
 sd/source/ui/view/drtxtob.cxx                             |    2 
 sd/source/ui/view/drtxtob1.cxx                            |    6 
 sd/source/ui/view/drviews2.cxx                            |   14 
 sd/source/ui/view/drviews3.cxx                            |   18 
 sd/source/ui/view/drviews4.cxx                            |    5 
 sd/source/ui/view/drviews7.cxx                            |    4 
 sd/source/ui/view/drviewsf.cxx                            |    2 
 sd/source/ui/view/drviewsi.cxx                            |    5 
 sd/source/ui/view/outlnvsh.cxx                            |    4 
 sd/source/ui/view/sdview.cxx                              |    4 
 sd/source/ui/view/sdview3.cxx                             |    4 
 sd/source/ui/view/sdview4.cxx                             |    2 
 sfx2/source/appl/appserv.cxx                              |    4 
 sfx2/source/control/bindings.cxx                          |    2 
 sfx2/source/control/shell.cxx                             |    4 
 sfx2/source/doc/objserv.cxx                               |    5 
 starmath/qa/cppunit/test_starmath.cxx                     |    8 
 starmath/source/document.cxx                              |    5 
 starmath/source/smmod.cxx                                 |    5 
 starmath/source/view.cxx                                  |    2 
 svl/source/items/itemset.cxx                              |  140 ++-----
 svx/source/dialog/databaseregistrationui.cxx              |    2 
 svx/source/dialog/dlgctl3d.cxx                            |    7 
 svx/source/dialog/hdft.cxx                                |   28 -
 svx/source/dialog/imapwnd.cxx                             |    2 
 svx/source/engine3d/float3d.cxx                           |    7 
 svx/source/engine3d/view3d1.cxx                           |    9 
 svx/source/sdr/properties/attributeproperties.cxx         |    7 
 svx/source/sdr/properties/captionproperties.cxx           |    7 
 svx/source/sdr/properties/circleproperties.cxx            |    7 
 svx/source/sdr/properties/connectorproperties.cxx         |    7 
 svx/source/sdr/properties/customshapeproperties.cxx       |    7 
 svx/source/sdr/properties/defaultproperties.cxx           |    6 
 svx/source/sdr/properties/e3dcompoundproperties.cxx       |    4 
 svx/source/sdr/properties/e3dproperties.cxx               |    7 
 svx/source/sdr/properties/e3dsceneproperties.cxx          |    2 
 svx/source/sdr/properties/graphicproperties.cxx           |    7 
 svx/source/sdr/properties/measureproperties.cxx           |    7 
 svx/source/sdr/properties/textproperties.cxx              |    9 
 svx/source/svdraw/svddrgmt.cxx                            |    2 
 svx/source/svdraw/svdedtv1.cxx                            |    5 
 svx/source/svdraw/svdedtv2.cxx                            |    5 
 svx/source/svdraw/svdfmtf.cxx                             |   10 
 svx/source/svdraw/svdibrow.cxx                            |    2 
 svx/source/svdraw/svdoashp.cxx                            |   10 
 svx/source/svdraw/svdotext.cxx                            |   10 
 svx/source/svdraw/svdotxed.cxx                            |    2 
 svx/source/svdraw/svdpage.cxx                             |    2 
 svx/source/table/cell.cxx                                 |   16 
 svx/source/table/svdotable.cxx                            |    7 
 svx/source/tbxctrls/grafctrl.cxx                          |    8 
 svx/source/unodraw/UnoNameItemTable.cxx                   |    2 
 svx/source/unodraw/unomtabl.cxx                           |    2 
 svx/source/unodraw/unoshape.cxx                           |   10 
 svx/source/xoutdev/xattr.cxx                              |    8 
 svx/source/xoutdev/xexch.cxx                              |    2 
 svx/source/xoutdev/xpool.cxx                              |    4 
 sw/qa/core/uwriter.cxx                                    |    2 
 sw/qa/extras/tiledrendering/tiledrendering.cxx            |   14 
 sw/qa/extras/uiwriter/uiwriter.cxx                        |   16 
 sw/qa/extras/ww8export/ww8export.cxx                      |    2 
 sw/source/core/access/accpara.cxx                         |   30 -
 sw/source/core/attr/format.cxx                            |    2 
 sw/source/core/attr/swatrset.cxx                          |    2 
 sw/source/core/crsr/crstrvl.cxx                           |    9 
 sw/source/core/crsr/findattr.cxx                          |    4 
 sw/source/core/doc/DocumentContentOperationsManager.cxx   |   25 -
 sw/source/core/doc/DocumentDeviceManager.cxx              |   10 
 sw/source/core/doc/DocumentFieldsManager.cxx              |    2 
 sw/source/core/doc/docfly.cxx                             |    4 
 sw/source/core/doc/docfmt.cxx                             |   12 
 sw/source/core/doc/docnew.cxx                             |    2 
 sw/source/core/doc/docsort.cxx                            |    4 
 sw/source/core/doc/tblcpy.cxx                             |    4 
 sw/source/core/doc/tblrwcl.cxx                            |    2 
 sw/source/core/docnode/ndtbl.cxx                          |   11 
 sw/source/core/docnode/node.cxx                           |    4 
 sw/source/core/draw/dcontact.cxx                          |    4 
 sw/source/core/draw/dflyobj.cxx                           |    2 
 sw/source/core/edit/acorrect.cxx                          |    2 
 sw/source/core/edit/autofmt.cxx                           |   10 
 sw/source/core/edit/edfmt.cxx                             |    4 
 sw/source/core/edit/edlingu.cxx                           |    4 
 sw/source/core/fields/cellfml.cxx                         |    2 
 sw/source/core/frmedt/fecopy.cxx                          |    4 
 sw/source/core/frmedt/fefly1.cxx                          |    2 
 sw/source/core/frmedt/feshview.cxx                        |   12 
 sw/source/core/frmedt/fews.cxx                            |    2 
 sw/source/core/layout/fly.cxx                             |    2 
 sw/source/core/text/redlnitr.cxx                          |    2 
 sw/source/core/txtnode/ndtxt.cxx                          |   17 
 sw/source/core/txtnode/thints.cxx                         |    4 
 sw/source/core/undo/unattr.cxx                            |    2 
 sw/source/core/undo/untbl.cxx                             |   24 -
 sw/source/core/unocore/SwXTextDefaults.cxx                |    2 
 sw/source/core/unocore/unodraw.cxx                        |    8 
 sw/source/core/unocore/unoframe.cxx                       |   16 
 sw/source/core/unocore/unoobj.cxx                         |   16 
 sw/source/core/unocore/unoport.cxx                        |    5 
 sw/source/core/unocore/unosect.cxx                        |    9 
 sw/source/core/unocore/unostyle.cxx                       |   15 
 sw/source/core/unocore/unotbl.cxx                         |   43 --
 sw/source/filter/ascii/parasc.cxx                         |    5 
 sw/source/filter/basflt/fltshell.cxx                      |    2 
 sw/source/filter/html/SwAppletImpl.cxx                    |    2 
 sw/source/filter/html/css1atr.cxx                         |   17 
 sw/source/filter/html/htmlatr.cxx                         |    6 
 sw/source/filter/html/htmlctxt.cxx                        |    4 
 sw/source/filter/html/htmldrawreader.cxx                  |    2 
 sw/source/filter/html/htmlfldw.cxx                        |    5 
 sw/source/filter/html/htmlflywriter.cxx                   |    4 
 sw/source/filter/html/htmlforw.cxx                        |    4 
 sw/source/filter/html/htmlgrin.cxx                        |    2 
 sw/source/filter/html/htmlplug.cxx                        |    4 
 sw/source/filter/html/htmlsect.cxx                        |    6 
 sw/source/filter/html/htmltab.cxx                         |    8 
 sw/source/filter/html/swhtml.cxx                          |    4 
 sw/source/filter/ww8/wrtw8nds.cxx                         |    4 
 sw/source/filter/ww8/wrtw8num.cxx                         |    4 
 sw/source/filter/ww8/wrtw8sty.cxx                         |    2 
 sw/source/filter/ww8/wrtww8.cxx                           |    2 
 sw/source/filter/ww8/ww8atr.cxx                           |    9 
 sw/source/filter/ww8/ww8graf.cxx                          |    8 
 sw/source/filter/ww8/ww8graf2.cxx                         |    8 
 sw/source/filter/ww8/ww8par.cxx                           |    2 
 sw/source/filter/ww8/ww8par2.cxx                          |    4 
 sw/source/filter/ww8/ww8par3.cxx                          |    6 
 sw/source/filter/ww8/ww8par4.cxx                          |    4 
 sw/source/filter/ww8/ww8par5.cxx                          |    8 
 sw/source/filter/ww8/ww8par6.cxx                          |   10 
 sw/source/filter/xml/xmlfmt.cxx                           |    2 
 sw/source/filter/xml/xmltexti.cxx                         |   20 -
 sw/source/ui/chrdlg/drpcps.cxx                            |    2 
 sw/source/ui/chrdlg/pardlg.cxx                            |    4 
 sw/source/ui/config/optpage.cxx                           |    5 
 sw/source/ui/dbui/dbinsdlg.cxx                            |    4 
 sw/source/ui/dbui/mmlayoutpage.cxx                        |   10 
 sw/source/ui/dialog/ascfldlg.cxx                          |    5 
 sw/source/ui/dialog/macassgn.cxx                          |    2 
 sw/source/ui/dialog/uiregionsw.cxx                        |    5 
 sw/source/ui/fldui/fldedt.cxx                             |    5 
 sw/source/ui/fldui/fldtdlg.cxx                            |    2 
 sw/source/ui/frmdlg/column.cxx                            |    7 
 sw/source/ui/frmdlg/frmdlg.cxx                            |    4 
 sw/source/ui/index/swuiidxmrk.cxx                         |    2 
 sw/source/ui/misc/docfnote.cxx                            |    2 
 sw/source/ui/misc/glossary.cxx                            |    2 
 sw/source/ui/misc/insfnote.cxx                            |    6 
 sw/source/ui/misc/titlepage.cxx                           |    2 
 sw/source/uibase/app/appenv.cxx                           |    4 
 sw/source/uibase/app/applab.cxx                           |   10 
 sw/source/uibase/app/appopt.cxx                           |    8 
 sw/source/uibase/app/docsh2.cxx                           |    2 
 sw/source/uibase/app/docstyle.cxx                         |    5 
 sw/source/uibase/dialog/regionsw.cxx                      |   10 
 sw/source/uibase/dochdl/swdtflvr.cxx                      |   20 -
 sw/source/uibase/docvw/HeaderFooterWin.cxx                |    4 
 sw/source/uibase/docvw/PageBreakWin.cxx                   |    5 
 sw/source/uibase/docvw/PostItMgr.cxx                      |    2 
 sw/source/uibase/docvw/edtwin.cxx                         |    8 
 sw/source/uibase/fldui/fldmgr.cxx                         |    2 
 sw/source/uibase/frmdlg/colex.cxx                         |    6 
 sw/source/uibase/frmdlg/frmmgr.cxx                        |    2 
 sw/source/uibase/lingu/olmenu.cxx                         |    7 
 sw/source/uibase/misc/glshell.cxx                         |    5 
 sw/source/uibase/ribbar/concustomshape.cxx                |    6 
 sw/source/uibase/ribbar/conrect.cxx                       |    2 
 sw/source/uibase/ribbar/drawbase.cxx                      |    2 
 sw/source/uibase/ribbar/inputwin.cxx                      |    2 
 sw/source/uibase/shells/annotsh.cxx                       |   17 
 sw/source/uibase/shells/basesh.cxx                        |   49 +-
 sw/source/uibase/shells/drawsh.cxx                        |    2 
 sw/source/uibase/shells/drwbassh.cxx                      |    7 
 sw/source/uibase/shells/drwtxtex.cxx                      |   16 
 sw/source/uibase/shells/drwtxtsh.cxx                      |    5 
 sw/source/uibase/shells/frmsh.cxx                         |   27 -
 sw/source/uibase/shells/grfsh.cxx                         |   26 -
 sw/source/uibase/shells/langhelper.cxx                    |    2 
 sw/source/uibase/shells/tabsh.cxx                         |   43 +-
 sw/source/uibase/shells/textfld.cxx                       |    2 
 sw/source/uibase/shells/textidx.cxx                       |    5 
 sw/source/uibase/shells/textsh.cxx                        |   11 
 sw/source/uibase/shells/textsh1.cxx                       |   37 -
 sw/source/uibase/shells/txtattr.cxx                       |   26 -
 sw/source/uibase/shells/txtnum.cxx                        |    5 
 sw/source/uibase/uiview/formatclipboard.cxx               |   18 
 sw/source/uibase/uiview/pview.cxx                         |    4 
 sw/source/uibase/uiview/view0.cxx                         |    2 
 sw/source/uibase/uiview/view2.cxx                         |    4 
 sw/source/uibase/uiview/viewdraw.cxx                      |    4 
 sw/source/uibase/uiview/viewprt.cxx                       |    5 
 sw/source/uibase/uiview/viewtab.cxx                       |   46 +-
 sw/source/uibase/uno/unotxdoc.cxx                         |   15 
 sw/source/uibase/utlui/glbltree.cxx                       |    5 
 sw/source/uibase/utlui/numfmtlb.cxx                       |    5 
 sw/source/uibase/utlui/uitool.cxx                         |   12 
 sw/source/uibase/wrtsh/delete.cxx                         |    2 
 sw/source/uibase/wrtsh/wrtsh1.cxx                         |    5 
 283 files changed, 1225 insertions(+), 1132 deletions(-)

New commits:
commit 13bb5a4b09f5b2ad19dad1b55f45d0fe2b2fb908
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jun 16 09:58:13 2017 +0200

    Make SfxItemSet ranges correct by construction
    
    This is a follow-up to 45a7f5b62d0b1b21763c1c94255ef2309ea4280b "Keep WID ranges
    sorted, and join adjacent ones".  While SfxItemSet::MergeRange relies on the
    m_pWhichRanges being sorted (and, under DBG_UTIL, asserts if they are not), the
    various SfxItemSet constructors curiously only check (via assert or DBG_ASSERT)
    that each individual range has an upper bound not smaller than its lower bound.
    Arguably, all SfxItemSet instances should fulfill the stronger guarantees
    required and checked by MergeRange.
    
    And in many cases the ranges are statically known, so that the checking can
    happen at compile time.  Therefore, replace the two SfxItemSet ctors taking
    explicit ranges with two other ctors that actually do proper checking.  The
    (templated) overload taking an svl::Items struct should be used in all cases
    where the range values are statically known at compile time, while the overload
    taking a std::initializer_list<Pair> is for the remaining cases (that can only
    do runtime checking via assert).  Most of those latter cases are simple cases
    with a single range covering a single item, but a few are more complex.
    
    (At least some of the uses of the existing SfxItemSet overload taking a
    
      const sal_uInt16* pWhichPairTable
    
    can probably also be strengthened, but that is left for another day.)
    
    This commit is the first in a series of two.  Apart from the manual changes to
    compilerplugins/clang/store/sfxitemsetrewrite.cxx, include/svl/itemset.hxx, and
    svl/source/items/itemset.cxx, it only consists of automatic rewriting of the
    relevant SfxItemSet ctor calls (plus a few required manual fixes, see next).
    But it does not yet check that the individual ranges are properly sorted (see
    the TODO in svl::detail::validGap).  That check will be enabled, and the ensuing
    manual fixes will be made in a follow-up commit, to reduce the likelyhood of
    accidents.
    
    There were three cases of necessary manual intervention:
    
    * sw/source/core/unocore/unostyle.cxx uses eAtr of enum type RES_FRMATR in
    braced-init-list syntax now, so needs explicit narrowing conversion to
    sal_uInt16.
    
    * In sw/source/uibase/uiview/formatclipboard.cxx, the trailiing comma in the
    definition of macro FORMAT_PAINTBRUSH_FRAME_IDS needed to be removed manually.
    
    * In svx/source/svdraw/svdoashp.cxx, svx/source/svdraw/svdotext.cxx,
    sw/source/uibase/app/docstyle.cxx, sw/source/uibase/shells/frmsh.cxx,
    sw/source/uibase/shells/grfsh.cxx, and sw/source/uibase/shells/textsh1.cxx,
    some comments had to be put back (see "TODO: the replaced range can contain
    relevant comments" in compilerplugins/clang/store/sfxitemsetrewrite.cxx).
    
    A few uses of the variadic form erroneously used nullptr instead of 0 for
    termination.  But this should have been harmless even if promoted std::nullptr_t
    is larger than promoted sal_uInt16, assuming that the part of the nullptr value
    that was interpreted as sal_uInt16/promoted int was all-zero bits.  Similarly,
    some uses made the harmless error of using 0L instead of 0.
    
    Change-Id: I2afea97282803cb311b9321a99bb627520ef5e35
    Reviewed-on: https://gerrit.libreoffice.org/38861
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Tested-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/basctl/source/basicide/basdoc.cxx b/basctl/source/basicide/basdoc.cxx
index 5bfb75ab67a0..8006a0550604 100644
--- a/basctl/source/basicide/basdoc.cxx
+++ b/basctl/source/basicide/basdoc.cxx
@@ -63,7 +63,7 @@ SfxPrinter* DocShell::GetPrinter( bool bCreate )
 {
     if ( !pPrinter && bCreate )
         pPrinter.disposeAndReset(VclPtr<SfxPrinter>::Create(o3tl::make_unique<SfxItemSet>(
-            GetPool(), SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN
+            GetPool(), svl::Items<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN>{}
         )));
 
     return pPrinter.get();
diff --git a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
index c1005f5e0ef3..59cff5f86c18 100644
--- a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
+++ b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
@@ -284,11 +284,10 @@ SdrOutliner* DrawViewWrapper::getOutliner() const
 SfxItemSet DrawViewWrapper::getPositionAndSizeItemSetFromMarkedObject() const
 {
     SfxItemSet aFullSet( GetModel()->GetItemPool(),
-                    SID_ATTR_TRANSFORM_POS_X, SID_ATTR_TRANSFORM_ANGLE,
+                    svl::Items<SID_ATTR_TRANSFORM_POS_X, SID_ATTR_TRANSFORM_ANGLE,
                     SID_ATTR_TRANSFORM_PROTECT_POS, SID_ATTR_TRANSFORM_AUTOHEIGHT,
                     SDRATTR_ECKENRADIUS, SDRATTR_ECKENRADIUS,
-                    SID_ATTR_METRIC, SID_ATTR_METRIC,
-                    0);
+                    SID_ATTR_METRIC, SID_ATTR_METRIC>{});
     SfxItemSet aGeoSet( E3dView::GetGeoAttrFromMarked() );
     aFullSet.Put( aGeoSet );
     aFullSet.Put( SfxUInt16Item(SID_ATTR_METRIC,static_cast< sal_uInt16 >( ConfigurationAccess::getFieldUnit())));
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx
index 4b06f17c9d26..d9f8cc0b1229 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -137,7 +137,7 @@ void DrawCommandDispatch::setAttributes( SdrObject* pObj )
                                 {
                                     const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
                                     SfxItemSet aDest( pObj->GetModel()->GetItemPool(),          // ranges from SdrAttrObj
-                                        SDRATTR_START, SDRATTR_SHADOW_LAST,
+                                        svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST,
                                         SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
                                         SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
                                         // Graphic Attributes
@@ -147,9 +147,7 @@ void DrawCommandDispatch::setAttributes( SdrObject* pObj )
                                         // CustomShape properties
                                         SDRATTR_CUSTOMSHAPE_FIRST, SDRATTR_CUSTOMSHAPE_LAST,
                                         // range from SdrTextObj
-                                        EE_ITEMS_START, EE_ITEMS_END,
-                                        // end
-                                        0, 0);
+                                        EE_ITEMS_START, EE_ITEMS_END>{});
                                     aDest.Set( rSource );
                                     pObj->SetMergedItemSet( aDest );
                                     sal_Int32 nAngle = pSourceObj->GetRotateAngle();
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index 1895f2db54d2..c9a34316a727 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -564,13 +564,12 @@ void ShapeController::executeDispatch_ParagraphDialog()
             pDrawViewWrapper->GetAttributes( aAttr );
 
             SfxItemSet aNewAttr( rPool,
-                                    EE_ITEMS_START, EE_ITEMS_END,
+                                    svl::Items<EE_ITEMS_START, EE_ITEMS_END,
                                     SID_ATTR_PARA_HYPHENZONE, SID_ATTR_PARA_HYPHENZONE,
                                     SID_ATTR_PARA_PAGEBREAK, SID_ATTR_PARA_PAGEBREAK,
                                     SID_ATTR_PARA_SPLIT, SID_ATTR_PARA_SPLIT,
                                     SID_ATTR_PARA_WIDOWS, SID_ATTR_PARA_WIDOWS,
-                                    SID_ATTR_PARA_ORPHANS, SID_ATTR_PARA_ORPHANS,
-                                    0 );
+                                    SID_ATTR_PARA_ORPHANS, SID_ATTR_PARA_ORPHANS>{} );
             aNewAttr.Put( aAttr );
             aNewAttr.Put( SvxHyphenZoneItem( false, SID_ATTR_PARA_HYPHENZONE ) );
             aNewAttr.Put( SvxFormatBreakItem( SvxBreak::NONE, SID_ATTR_PARA_PAGEBREAK ) );
diff --git a/compilerplugins/clang/store/sfxitemsetrewrite.cxx b/compilerplugins/clang/store/sfxitemsetrewrite.cxx
new file mode 100644
index 000000000000..db316f861af2
--- /dev/null
+++ b/compilerplugins/clang/store/sfxitemsetrewrite.cxx
@@ -0,0 +1,262 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "check.hxx"
+#include "plugin.hxx"
+
+namespace {
+
+class Visitor final:
+    public RecursiveASTVisitor<Visitor>, public loplugin::RewritePlugin
+{
+public:
+    explicit Visitor(InstantiationData const & data): RewritePlugin(data) {}
+
+    bool VisitCXXConstructExpr(CXXConstructExpr const * expr) {
+        if (ignoreLocation(expr)) {
+            return true;
+        }
+        auto const ctor = expr->getConstructor();
+        if (!loplugin::DeclCheck(ctor->getParent()).Class("SfxItemSet")
+            .GlobalNamespace())
+        {
+            return true;
+        }
+        auto const numParams = ctor->getNumParams();
+        auto const variadic = ctor->isVariadic();
+        if (!(((numParams == 3 && !variadic) || (numParams == 4 && variadic))
+              && (loplugin::TypeCheck(ctor->getParamDecl(0)->getType())
+                  .LvalueReference().Class("SfxItemPool").GlobalNamespace())))
+        {
+            return true;
+        }
+        auto const numArgs = expr->getNumArgs();
+        if (numArgs < 3) {
+            report(
+                DiagnosticsEngine::Warning,
+                ("unexpected SfxItemPool constructor call with less than three"
+                 " arguments"),
+                expr->getExprLoc())
+                << expr->getSourceRange();
+            return true;
+        }
+        rewrite(expr, variadic, false, numArgs, expr->getArgs());
+        return true;
+    }
+
+    bool VisitCallExpr(CallExpr const * expr) {
+        if (ignoreLocation(expr)) {
+            return true;
+        }
+        auto const dre = dyn_cast<DeclRefExpr>(
+            expr->getCallee()->IgnoreParenImpCasts());
+        if (dre == nullptr
+            || !(loplugin::DeclCheck(dre->getDecl()).Function("make_unique")
+                 .Namespace("o3tl").GlobalNamespace()))
+        {
+            return true;
+        }
+        auto const numTArgs = dre->getNumTemplateArgs();
+        if (numTArgs == 0) {
+            report(
+                DiagnosticsEngine::Warning,
+                "unexpected o3tl::make_unique call without template arguments",
+                expr->getExprLoc())
+                << expr->getSourceRange();
+            return true;
+        }
+        auto const tArg0 = dre->getTemplateArgs()[0].getArgument();
+        if (tArg0.getKind() != TemplateArgument::Type) {
+            report(
+                DiagnosticsEngine::Warning,
+                ("unexpected o3tl::make_unique call with non-type first"
+                 " template argument"),
+                expr->getExprLoc())
+                << expr->getSourceRange();
+            return true;
+        }
+        if (!loplugin::TypeCheck(tArg0.getAsType()).Class("SfxItemSet")
+            .GlobalNamespace())
+        {
+            return true;
+        }
+        auto const numArgs = expr->getNumArgs();
+        if (numArgs < 3) {
+            return true;
+        }
+        rewrite(expr, numArgs > 3, true, numArgs, expr->getArgs());
+        return true;
+    }
+
+private:
+    void run() override {
+        if (compiler.getLangOpts().CPlusPlus) {
+            TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
+        }
+    }
+
+    SourceLocation nextToken(SourceLocation loc) {
+        return loc.getLocWithOffset(
+            Lexer::MeasureTokenLength(
+                loc, compiler.getSourceManager(), compiler.getLangOpts()));
+    }
+
+    SourceLocation atMacroExpansionStart(SourceLocation loc) {
+        while (loc.isMacroID()
+               && (compiler.getSourceManager()
+                   .isAtStartOfImmediateMacroExpansion(loc, &loc)))
+        {}
+        return loc;
+    }
+
+    SourceLocation atMacroExpansionEnd(SourceLocation loc) {
+        while (compiler.getSourceManager().isMacroBodyExpansion(loc)) {
+            loc = compiler.getSourceManager().getImmediateExpansionRange(loc)
+                .second;
+        }
+        return loc;
+    }
+
+    void rewrite(
+        Expr const * expr, bool variadic, bool forward, unsigned numArgs,
+        Expr const * const * args)
+    {
+        bool constant = true;
+        unsigned firstZero = 0;
+        for (unsigned i = 1; i != numArgs; ++i) {
+            auto const arg = args[i];
+            constant = constant
+                && arg->isCXX11ConstantExpr(compiler.getASTContext());
+            APSInt v;
+            auto const zero
+                = ((arg->EvaluateAsInt(v, compiler.getASTContext())
+                    && v == 0)
+                   || (variadic && i > 4
+                       && arg->isNullPointerConstant(
+                           compiler.getASTContext(),
+                           Expr::NPC_ValueDependentIsNotNull)));
+            if (variadic) {
+                if (zero) {
+                    if (firstZero == 0) {
+                        if (i == 1) {
+                            report(
+                                DiagnosticsEngine::Warning,
+                                ("unexpected missing non-zero arguments before"
+                                 " first zero argument in SfxItemPool"
+                                 " constructor call"),
+                                arg->getExprLoc())
+                                << expr->getSourceRange();
+                            return;
+                        }
+                        if (i % 2 == 0) {
+                            report(
+                                DiagnosticsEngine::Warning,
+                                ("unexpected odd number of potentially non-zero"
+                                 " arguments before first definitely zero"
+                                 " argument in SfxItemPool constructor call"),
+                                arg->getExprLoc())
+                                << expr->getSourceRange();
+                            return;
+                        }
+                        firstZero = i;
+                    }
+                } else if (firstZero != 0) {
+                    report(
+                        DiagnosticsEngine::Warning,
+                        ("unexpected potentially non-zero argument in"
+                         " SfxItemPool constructor call, following zero"
+                         " argument"),
+                        arg->getExprLoc())
+                        << expr->getSourceRange();
+                    return;
+                }
+            } else if (zero) {
+                report(
+                    DiagnosticsEngine::Warning,
+                    "unexpected zero argument in SfxItemPool constructor call",
+                    arg->getExprLoc())
+                    << expr->getSourceRange();
+                return;
+            }
+        }
+        if (variadic && firstZero == 0) {
+            report(
+                DiagnosticsEngine::Warning,
+                ("unexpected SfxItemPool constructor call with no detectable"
+                 " zero arguments"),
+                expr->getExprLoc())
+                << expr->getSourceRange();
+            return;
+        }
+        if (rewriter != nullptr) {
+            if (!insertTextBefore(
+                    atMacroExpansionStart(args[1]->getLocStart()),
+                    (constant
+                     ? StringRef("svl::Items<")
+                     : (forward
+                        ? StringRef("std::initializer_list<SfxItemSet::Pair>{{")
+                        : StringRef("{{")))))
+            {
+                goto failed;
+            }
+            auto const postLoc = atMacroExpansionEnd(
+                args[numArgs - 1]->getLocEnd());
+            auto const postStr = constant ? StringRef(">{}") : StringRef("}}");
+            if (variadic) {
+                //TODO: the replaced range can contain relevant comments:
+                if (!replaceText(
+                        SourceRange(
+                            nextToken(
+                                atMacroExpansionEnd(
+                                    args[firstZero - 1]->getLocEnd())),
+                            postLoc),
+                        postStr))
+                {
+                    goto failed;
+                }
+            } else {
+                if (!insertTextAfterToken(postLoc, postStr)) {
+                    goto failed;
+                }
+            }
+            if (!constant && variadic) {
+                for (unsigned i = 2; i != firstZero - 1; ++i) {
+                    auto const arg = args[i];
+                    if (!(i % 2 == 0
+                          ? insertTextAfterToken(
+                              atMacroExpansionEnd(arg->getLocEnd()), "}")
+                          : insertTextBefore(
+                              atMacroExpansionStart(arg->getLocStart()), "{")))
+                    {
+                        goto failed;
+                    }
+                }
+            }
+            return;
+        }
+    failed: //TODO: undo partial changes
+        report(
+            DiagnosticsEngine::Warning,
+            ("rewrite SfxItemPool constructor call with"
+             " %select{%select{|std::initializer_list<SfxItemSet::Pair>}1"
+             "%{%{..., ...%}, ..., %{..., ...%}%}|svl::Items<...>%{%}}0 around"
+             " the %select{|leading }2%3 WID arguments%select{| and remove the"
+             " remaining %4 zero %plural{1:argument|:arguments}4}2"),
+            expr->getExprLoc())
+            << constant << forward << variadic
+            << (variadic ? firstZero - 1 : numArgs - 1) << (numArgs - firstZero)
+            << expr->getSourceRange();
+    }
+};
+
+static loplugin::Plugin::Registration<Visitor> reg("sfxitemsetrewrite",true);
+
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/cui/source/dialogs/cuihyperdlg.cxx b/cui/source/dialogs/cuihyperdlg.cxx
index eb8e9515b759..c5bd7a669c99 100644
--- a/cui/source/dialogs/cuihyperdlg.cxx
+++ b/cui/source/dialogs/cuihyperdlg.cxx
@@ -118,8 +118,8 @@ SvxHpLinkDlg::SvxHpLinkDlg (vcl::Window* pParent, SfxBindings* pBindings)
     GetCancelButton().SetText ( CuiResId(RID_SVXSTR_HYPDLG_CLOSEBUT) );
 
     // create itemset for tabpages
-    mpItemSet = o3tl::make_unique<SfxItemSet>( SfxGetpApp()->GetPool(), SID_HYPERLINK_GETLINK,
-                               SID_HYPERLINK_SETLINK );
+    mpItemSet = o3tl::make_unique<SfxItemSet>( SfxGetpApp()->GetPool(), svl::Items<SID_HYPERLINK_GETLINK,
+                               SID_HYPERLINK_SETLINK>{} );
 
     SvxHyperlinkItem aItem(SID_HYPERLINK_GETLINK);
     mpItemSet->Put(aItem);
@@ -191,8 +191,8 @@ bool SvxHpLinkDlg::Close()
 
 void SvxHpLinkDlg::Apply()
 {
-    SfxItemSet aItemSet( SfxGetpApp()->GetPool(), SID_HYPERLINK_GETLINK,
-                         SID_HYPERLINK_SETLINK );
+    SfxItemSet aItemSet( SfxGetpApp()->GetPool(), svl::Items<SID_HYPERLINK_GETLINK,
+                         SID_HYPERLINK_SETLINK>{} );
 
     SvxHyperlinkTabPageBase* pCurrentPage = static_cast<SvxHyperlinkTabPageBase*>(
                                                 GetTabPage( GetCurPageId() ) );
diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx
index 9c6d5c10f073..2a8fcbbf763b 100644
--- a/cui/source/dialogs/hltpbase.cxx
+++ b/cui/source/dialogs/hltpbase.cxx
@@ -323,8 +323,8 @@ IMPL_LINK_NOARG(SvxHyperlinkTabPageBase, ClickScriptHdl_Impl, Button*, void)
 
         // create empty itemset for macro-dlg
         std::unique_ptr<SfxItemSet> pItemSet( new SfxItemSet(SfxGetpApp()->GetPool(),
-                                              SID_ATTR_MACROITEM,
-                                              SID_ATTR_MACROITEM ) );
+                                              svl::Items<SID_ATTR_MACROITEM,
+                                              SID_ATTR_MACROITEM>{} ) );
         pItemSet->Put ( aItem );
 
         /*  disable HyperLinkDlg for input while the MacroAssignDlg is working
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index a6e5d5f68004..4d07d9f9e5f8 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1285,7 +1285,7 @@ class SvxMacroAssignDialog : public VclAbstractDialog
 public:
     SvxMacroAssignDialog( vcl::Window* _pParent, const Reference< XFrame >& _rxDocumentFrame, const bool _bUnoDialogMode,
             const Reference< XNameReplace >& _rxEvents, const sal_uInt16 _nInitiallySelectedEvent )
-        :m_aItems( SfxGetpApp()->GetPool(), SID_ATTR_MACROITEM, SID_ATTR_MACROITEM )
+        :m_aItems( SfxGetpApp()->GetPool(), svl::Items<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM>{} )
     {
         m_aItems.Put( SfxBoolItem( SID_ATTR_MACROITEM, _bUnoDialogMode ) );
         m_pDialog.reset( VclPtr<SvxMacroAssignDlg>::Create( _pParent, _rxDocumentFrame, m_aItems, _rxEvents, _nInitiallySelectedEvent ) );
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 72721304337b..b82a2a948442 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1124,14 +1124,13 @@ std::unique_ptr<SfxItemSet> OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId
         {
             pRet = o3tl::make_unique<SfxItemSet>(
                 SfxGetpApp()->GetPool(),
-                SID_ATTR_METRIC, SID_ATTR_SPELL,
+                svl::Items<SID_ATTR_METRIC, SID_ATTR_SPELL,
                 SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK,
                 SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER,
                 SID_ATTR_YEAR2000, SID_ATTR_YEAR2000,
-                SID_HTML_MODE, SID_HTML_MODE,
-                0 );
+                SID_HTML_MODE, SID_HTML_MODE>{} );
 
-            SfxItemSet aOptSet( SfxGetpApp()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER );
+            SfxItemSet aOptSet( SfxGetpApp()->GetPool(), svl::Items<SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER>{} );
             SfxGetpApp()->GetOptions(aOptSet);
             pRet->Put(aOptSet);
 
@@ -1164,11 +1163,10 @@ std::unique_ptr<SfxItemSet> OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId
         case SID_LANGUAGE_OPTIONS :
         {
             pRet = o3tl::make_unique<SfxItemSet>(SfxGetpApp()->GetPool(),
-                    SID_ATTR_LANGUAGE, SID_AUTOSPELL_CHECK,
+                    svl::Items<SID_ATTR_LANGUAGE, SID_AUTOSPELL_CHECK,
                     SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE,
                     SID_OPT_LOCALE_CHANGED, SID_OPT_LOCALE_CHANGED,
-                    SID_SET_DOCUMENT_LANGUAGE, SID_SET_DOCUMENT_LANGUAGE,
-                    0 );
+                    SID_SET_DOCUMENT_LANGUAGE, SID_SET_DOCUMENT_LANGUAGE>{} );
 
             // for linguistic
 
@@ -1233,28 +1231,25 @@ std::unique_ptr<SfxItemSet> OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId
         break;
         case SID_INET_DLG :
                 pRet = o3tl::make_unique<SfxItemSet>( SfxGetpApp()->GetPool(),
-                                SID_BASIC_ENABLED, SID_BASIC_ENABLED,
+                                svl::Items<SID_BASIC_ENABLED, SID_BASIC_ENABLED,
                 //SID_OPTIONS_START - ..END
                                 SID_SAVEREL_INET, SID_SAVEREL_FSYS,
                                 SID_INET_NOPROXY, SID_INET_FTP_PROXY_PORT,
-                                SID_SECURE_URL, SID_SECURE_URL,
-                                0L );
+                                SID_SECURE_URL, SID_SECURE_URL>{} );
                 SfxGetpApp()->GetOptions(*pRet);
         break;
         case SID_FILTER_DLG:
             pRet = o3tl::make_unique<SfxItemSet>( SfxGetpApp()->GetPool(),
-            SID_ATTR_DOCINFO, SID_ATTR_AUTOSAVEMINUTE,
+            svl::Items<SID_ATTR_DOCINFO, SID_ATTR_AUTOSAVEMINUTE,
             SID_SAVEREL_INET, SID_SAVEREL_FSYS,
             SID_ATTR_PRETTYPRINTING, SID_ATTR_PRETTYPRINTING,
-            SID_ATTR_WARNALIENFORMAT, SID_ATTR_WARNALIENFORMAT,
-            0 );
+            SID_ATTR_WARNALIENFORMAT, SID_ATTR_WARNALIENFORMAT>{} );
             SfxGetpApp()->GetOptions(*pRet);
             break;
 
         case SID_SB_STARBASEOPTIONS:
             pRet = o3tl::make_unique<SfxItemSet>( SfxGetpApp()->GetPool(),
-            SID_SB_POOLING_ENABLED, SID_SB_DB_REGISTER,
-            0 );
+            svl::Items<SID_SB_POOLING_ENABLED, SID_SB_DB_REGISTER>{} );
             ::offapp::ConnectionPoolConfig::GetOptions(*pRet);
             svx::DbRegisteredNamesConfig::GetOptions(*pRet);
             break;
@@ -1262,7 +1257,7 @@ std::unique_ptr<SfxItemSet> OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId
         case SID_SCH_EDITOPTIONS:
         {
             SvxChartOptions aChartOpt;
-            pRet = o3tl::make_unique<SfxItemSet>( SfxGetpApp()->GetPool(), SID_SCH_EDITOPTIONS, SID_SCH_EDITOPTIONS );
+            pRet = o3tl::make_unique<SfxItemSet>( SfxGetpApp()->GetPool(), svl::Items<SID_SCH_EDITOPTIONS, SID_SCH_EDITOPTIONS>{} );
             pRet->Put( SvxChartColorTableItem( SID_SCH_EDITOPTIONS, aChartOpt.GetDefaultColors() ) );
             break;
         }
@@ -1278,7 +1273,7 @@ void OfaTreeOptionsDialog::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet
         {
             utl::MiscCfg    aMisc;
             const SfxPoolItem* pItem = nullptr;
-            SfxItemSet aOptSet(SfxGetpApp()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER );
+            SfxItemSet aOptSet(SfxGetpApp()->GetPool(), svl::Items<SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER>{} );
             aOptSet.Put(rSet);
             if(aOptSet.Count())
                 SfxGetpApp()->SetOptions( aOptSet );
diff --git a/cui/source/tabpages/bbdlg.cxx b/cui/source/tabpages/bbdlg.cxx
index 0cef97d9ce1b..114f7dd28269 100644
--- a/cui/source/tabpages/bbdlg.cxx
+++ b/cui/source/tabpages/bbdlg.cxx
@@ -74,9 +74,8 @@ void SvxBorderBackgroundDlg::PageCreated( sal_uInt16 nPageId, SfxTabPage& rTabPa
     {
         SfxItemSet aNew(
             *GetInputSetImpl()->GetPool(),
-            SID_COLOR_TABLE, SID_BITMAP_LIST,
-            SID_OFFER_IMPORT, SID_OFFER_IMPORT,
-            0, 0);
+            svl::Items<SID_COLOR_TABLE, SID_BITMAP_LIST,
+            SID_OFFER_IMPORT, SID_OFFER_IMPORT>{});
 
         aNew.Put(*GetInputSetImpl());
 
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index 16100cc46413..437cdb41a0e5 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -1155,7 +1155,7 @@ void SvxPageDescPage::ResetBackground_Impl(const SfxItemSet& rSet)
                 {
                     // create FillAttributes from SvxBrushItem
                     const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich));
-                    SfxItemSet aTempSet(*rTmpSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
+                    SfxItemSet aTempSet(*rTmpSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
 
                     setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
                     aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
@@ -1199,7 +1199,7 @@ void SvxPageDescPage::ResetBackground_Impl(const SfxItemSet& rSet)
                 {
                     // create FillAttributes from SvxBrushItem
                     const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich));
-                    SfxItemSet aTempSet(*rTmpSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
+                    SfxItemSet aTempSet(*rTmpSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
 
                     setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
                     aFooterFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
@@ -1233,7 +1233,7 @@ void SvxPageDescPage::ResetBackground_Impl(const SfxItemSet& rSet)
         {
             // create FillAttributes from SvxBrushItem
             const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(*pItem);
-            SfxItemSet aTempSet(*rSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
+            SfxItemSet aTempSet(*rSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
 
             setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
             aPageFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
@@ -1303,7 +1303,7 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet )
             {
                 // aBspWin.SetHdColor(rItem.GetColor());
                 const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rHeaderSet.Get(nWhich));
-                SfxItemSet aTempSet(*rHeaderSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
+                SfxItemSet aTempSet(*rHeaderSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
 
                 setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
                 aHeaderFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
@@ -1365,7 +1365,7 @@ void SvxPageDescPage::InitHeadFoot_Impl( const SfxItemSet& rSet )
             {
                 // aBspWin.SetFtColor(rItem.GetColor());
                 const SvxBrushItem& rItem = static_cast<const SvxBrushItem&>(rFooterSet.Get(nWhich));
-                SfxItemSet aTempSet(*rFooterSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST);
+                SfxItemSet aTempSet(*rFooterSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
 
                 setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet);
                 aFooterFillAttributes.reset(new drawinglayer::attribute::SdrAllFillAttributesHelper(aTempSet));
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index 640c2ec550cc..993f6933d84b 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -289,7 +289,7 @@ bool shouldLaunchQuickstart()
     if (!bQuickstart)
     {
         const SfxPoolItem* pItem=nullptr;
-        SfxItemSet aQLSet(SfxGetpApp()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER);
+        SfxItemSet aQLSet(SfxGetpApp()->GetPool(), svl::Items<SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER>{});
         SfxGetpApp()->GetOptions(aQLSet);
         SfxItemState eState = aQLSet.GetItemState(SID_ATTR_QUICKLAUNCHER, false, &pItem);
         if (SfxItemState::SET == eState)
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 67ab2af678b9..28c2641d43c4 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -1860,7 +1860,7 @@ void ContentNode::dumpAsXml(struct _xmlTextWriter* pWriter) const
 
 ContentAttribs::ContentAttribs( SfxItemPool& rPool )
 : pStyle(nullptr)
-, aAttribSet( rPool, EE_PARA_START, EE_CHAR_END )
+, aAttribSet( rPool, svl::Items<EE_PARA_START, EE_CHAR_END>{} )
 {
 }
 
@@ -2105,7 +2105,7 @@ void CreateFont( SvxFont& rFont, const SfxItemSet& rSet, bool bSearchInParent, S
 
 void EditDoc::CreateDefFont( bool bUseStyles )
 {
-    SfxItemSet aTmpSet( GetItemPool(), EE_PARA_START, EE_CHAR_END );
+    SfxItemSet aTmpSet( GetItemPool(), svl::Items<EE_PARA_START, EE_CHAR_END>{} );
     CreateFont( aDefFont, aTmpSet );
     aDefFont.SetVertical( IsVertical() );
     aDefFont.SetOrientation( IsVertical() ? (IsTopToBottom() ? 2700 : 900) : 0 );
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index ed1fdb06136e..8eee9ea854ef 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -115,7 +115,7 @@ const XParaPortion& XParaPortionList::operator [](size_t i) const
 
 ContentInfo::ContentInfo( SfxItemPool& rPool ) :
     eFamily(SfxStyleFamily::Para),
-    aParaAttribs(rPool, EE_PARA_START, EE_CHAR_END)
+    aParaAttribs(rPool, svl::Items<EE_PARA_START, EE_CHAR_END>{})
 {
 }
 
@@ -124,7 +124,7 @@ ContentInfo::ContentInfo( const ContentInfo& rCopyFrom, SfxItemPool& rPoolToUse
     maText(rCopyFrom.maText),
     aStyle(rCopyFrom.aStyle),
     eFamily(rCopyFrom.eFamily),
-    aParaAttribs(rPoolToUse, EE_PARA_START, EE_CHAR_END)
+    aParaAttribs(rPoolToUse, svl::Items<EE_PARA_START, EE_CHAR_END>{})
 {
     // this should ensure that the Items end up in the correct Pool!
     aParaAttribs.Set( rCopyFrom.GetParaAttribs() );
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 048f330e18c8..bd56b86f1ae5 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -699,7 +699,7 @@ const SfxItemSet& ImpEditEngine::GetEmptyItemSet()
 {
     if ( !pEmptyItemSet )
     {
-        pEmptyItemSet = o3tl::make_unique<SfxItemSet>( aEditDoc.GetItemPool(), EE_ITEMS_START, EE_ITEMS_END );
+        pEmptyItemSet = o3tl::make_unique<SfxItemSet>( aEditDoc.GetItemPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
         for ( sal_uInt16 nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++)
         {
             pEmptyItemSet->ClearItem( nWhich );
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 2e2232c08870..b7c33d0e7588 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -2154,7 +2154,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView,
                 if(aCurrentNewPortion->sText != aCurrentOldPortion->sText)
                 {
                     //change text and apply language
-                    SfxItemSet aSet( aEditDoc.GetItemPool(), nLangWhichId, nLangWhichId);
+                    SfxItemSet aSet( aEditDoc.GetItemPool(), {{nLangWhichId, nLangWhichId}});
                     aSet.Put(SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId));
                     SetAttribs( *aCurrentOldPosition, aSet );
                     ImpInsertText( *aCurrentOldPosition, aCurrentNewPortion->sText );
@@ -2162,7 +2162,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView,
                 else if(aCurrentNewPortion->eLanguage != aCurrentOldPortion->eLanguage)
                 {
                     //apply language
-                    SfxItemSet aSet( aEditDoc.GetItemPool(), nLangWhichId, nLangWhichId);
+                    SfxItemSet aSet( aEditDoc.GetItemPool(), {{nLangWhichId, nLangWhichId}});
                     aSet.Put(SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId));
                     SetAttribs( *aCurrentOldPosition, aSet );
                 }
@@ -2199,7 +2199,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView& rEditView,
                         case SvtScriptType::COMPLEX : nLangWhichId = EE_CHAR_LANGUAGE_CTL; break;
                         default: break;
                     }
-                    SfxItemSet aSet( aEditDoc.GetItemPool(), nLangWhichId, nLangWhichId);
+                    SfxItemSet aSet( aEditDoc.GetItemPool(), {{nLangWhichId, nLangWhichId}});
                     aSet.Put(SvxLanguageItem(aCurrentNewPortion->eLanguage, nLangWhichId));
                     SetAttribs( aCurrentPaM, aSet );
                 }
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index c6882ca85ca2..e40a630698d2 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -3260,7 +3260,7 @@ SfxPoolItem* SvxScriptTypeItem::Clone( SfxItemPool * ) const
 
 SvxScriptSetItem::SvxScriptSetItem( sal_uInt16 nSlotId, SfxItemPool& rPool )
     : SfxSetItem( nSlotId, o3tl::make_unique<SfxItemSet>( rPool,
-                        SID_ATTR_CHAR_FONT, SID_ATTR_CHAR_FONT ))
+                        svl::Items<SID_ATTR_CHAR_FONT, SID_ATTR_CHAR_FONT>{} ))
 {
     sal_uInt16 nLatin, nAsian, nComplex;
     GetWhichIds( nLatin, nAsian, nComplex );
diff --git a/editeng/source/uno/unofdesc.cxx b/editeng/source/uno/unofdesc.cxx
index 3d0b90ed3d02..7e136e4ae8c4 100644
--- a/editeng/source/uno/unofdesc.cxx
+++ b/editeng/source/uno/unofdesc.cxx
@@ -190,13 +190,13 @@ void SvxUnoFontDescriptor::setPropertyToDefault( SfxItemSet& rSet )
 
 uno::Any SvxUnoFontDescriptor::getPropertyDefault( SfxItemPool* pPool )
 {
-    SfxItemSet aSet( *pPool, EE_CHAR_FONTINFO, EE_CHAR_FONTINFO,
+    SfxItemSet aSet( *pPool, svl::Items<EE_CHAR_FONTINFO, EE_CHAR_FONTINFO,
                              EE_CHAR_FONTHEIGHT, EE_CHAR_FONTHEIGHT,
                              EE_CHAR_ITALIC, EE_CHAR_ITALIC,
                              EE_CHAR_UNDERLINE, EE_CHAR_UNDERLINE,
                              EE_CHAR_WEIGHT, EE_CHAR_WEIGHT,
                              EE_CHAR_STRIKEOUT, EE_CHAR_STRIKEOUT,
-                             EE_CHAR_WLM, EE_CHAR_WLM, 0 );
+                             EE_CHAR_WLM, EE_CHAR_WLM>{} );
 
     uno::Any aAny;
 
diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx
index 0eebf97ee0c9..cc2a5c6c1861 100644
--- a/editeng/source/uno/unoipset.cxx
+++ b/editeng/source/uno/unoipset.cxx
@@ -203,7 +203,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertySimpleEntry*
     if( eMapUnit == MapUnit::Map100thMM )
         nMemberId &= (~CONVERT_TWIPS);
     uno::Any aVal;
-    SfxItemSet aSet( mrItemPool, pMap->nWID, pMap->nWID);
+    SfxItemSet aSet( mrItemPool, {{pMap->nWID, pMap->nWID}});
 
     if( (pMap->nWID < OWN_ATTR_VALUE_START) || (pMap->nWID > OWN_ATTR_VALUE_END ) )
     {
diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx
index 155d93412bac..d3b27a366914 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1273,7 +1273,7 @@ uno::Any SAL_CALL SvxUnoTextRangeBase::getPropertyDefault( const OUString& aProp
                     // Get Default from ItemPool
                     if(SfxItemPool::IsWhich(pMap->nWID))
                     {
-                        SfxItemSet aSet( *pPool,    pMap->nWID, pMap->nWID);
+                        SfxItemSet aSet( *pPool,    {{pMap->nWID, pMap->nWID}});
                         aSet.Put(pPool->GetDefaultItem(pMap->nWID));
                         return SvxItemPropertySet::getPropertyValue(pMap, aSet, true, false );
                     }
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx
index 4537548b8a36..ab4dbe5d3368 100644
--- a/extensions/source/propctrlr/formcomponenthandler.cxx
+++ b/extensions/source/propctrlr/formcomponenthandler.cxx
@@ -2660,9 +2660,8 @@ namespace pcr
         {
             // create the itemset for the dialog
             SfxItemSet aCoreSet(SfxGetpApp()->GetPool(),
-                SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_VALUE,
-                SID_ATTR_NUMBERFORMAT_INFO, SID_ATTR_NUMBERFORMAT_INFO,
-                0);     // ripped this somewhere ... don't understand it :(
+                svl::Items<SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_VALUE,
+                SID_ATTR_NUMBERFORMAT_INFO, SID_ATTR_NUMBERFORMAT_INFO>{});     // ripped this somewhere ... don't understand it :(
 
             // get the number formats supplier
             Reference< XNumberFormatsSupplier >  xSupplier;
diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx
index ee3ac3d06366..a1715cc896f5 100644
--- a/include/svl/itemset.hxx
+++ b/include/svl/itemset.hxx
@@ -19,9 +19,14 @@
 #ifndef INCLUDED_SVL_ITEMSET_HXX
 #define INCLUDED_SVL_ITEMSET_HXX
 
-#include <svl/svldllapi.h>
+#include <sal/config.h>
+
+#include <cassert>
+#include <cstddef>
+#include <initializer_list>
+#include <type_traits>
 
-#include <cstdarg>
+#include <svl/svldllapi.h>
 #include <svl/poolitem.hxx>
 
 class SfxItemPool;
@@ -30,6 +35,48 @@ class SvStream;
 
 typedef SfxPoolItem const** SfxItemArray;
 
+namespace svl {
+
+namespace detail {
+
+constexpr bool validRange(sal_uInt16 wid1, sal_uInt16 wid2)
+{ return wid1 != 0 && wid1 <= wid2; }
+
+constexpr bool validGap(sal_uInt16, sal_uInt16)
+{ return true; } //TODO: wid2 > wid1 && wid2 - wid1 > 1
+
+template<sal_uInt16 WID1, sal_uInt16 WID2> constexpr bool validRanges()
+{ return validRange(WID1, WID2); }
+
+template<sal_uInt16 WID1, sal_uInt16 WID2, sal_uInt16 WID3, sal_uInt16... WIDs>
+constexpr bool validRanges() {
+    return validRange(WID1, WID2) && validGap(WID2, WID3)
+        && validRanges<WID3, WIDs...>();
+}
+
+// The calculations in rangeSize and rangesSize cannot overflow, assuming
+// std::size_t is no smaller than sal_uInt16:
+
+constexpr std::size_t rangeSize(sal_uInt16 wid1, sal_uInt16 wid2) {
+#if HAVE_CXX14_CONSTEXPR
+    assert(validRange(wid1, wid2));
+#endif
+    return wid2 - wid1 + 1;
+}
+
+template<sal_uInt16 WID1, sal_uInt16 WID2> constexpr std::size_t rangesSize()
+{ return rangeSize(WID1, WID2); }
+
+template<sal_uInt16 WID1, sal_uInt16 WID2, sal_uInt16 WID3, sal_uInt16... WIDs>
+constexpr std::size_t rangesSize()
+{ return rangeSize(WID1, WID2) + rangesSize<WID3, WIDs...>(); }
+
+}
+
+template<sal_uInt16... WIDs> struct Items {};
+
+}
+
 class SAL_WARN_UNUSED SVL_DLLPUBLIC SfxItemSet
 {
     friend class SfxItemIter;
@@ -45,8 +92,10 @@ friend class SfxAllItemSet;
 
 private:
     SVL_DLLPRIVATE void                     InitRanges_Impl(const sal_uInt16 *nWhichPairTable);
-    SVL_DLLPRIVATE void                     InitRanges_Impl(va_list pWhich, sal_uInt16 n1, sal_uInt16 n2, sal_uInt16 n3);
-    SVL_DLLPRIVATE void                     InitRanges_Impl(sal_uInt16 nWh1, sal_uInt16 nWh2);
+
+    SfxItemSet(
+        SfxItemPool & pool, std::initializer_list<sal_uInt16> wids,
+        std::size_t items);
 
 public:
     SfxItemArray                GetItems_Impl() const { return m_pItems; }
@@ -61,11 +110,17 @@ protected:
     void                        PutDirect(const SfxPoolItem &rItem);
 
 public:
+    struct Pair { sal_uInt16 wid1, wid2; };
+
                                 SfxItemSet( const SfxItemSet& );
 
                                 SfxItemSet( SfxItemPool&);
-                                SfxItemSet( SfxItemPool&, sal_uInt16 nWhich1, sal_uInt16 nWhich2 );
-                                SfxItemSet( SfxItemPool&, int nWh1, int nWh2, int nNull, ... );
+    template<sal_uInt16... WIDs> SfxItemSet(
+        typename std::enable_if<
+            svl::detail::validRanges<WIDs...>(), SfxItemPool &>::type pool,
+        svl::Items<WIDs...>):
+        SfxItemSet(pool, {WIDs...}, svl::detail::rangesSize<WIDs...>()) {}
+                                SfxItemSet( SfxItemPool&, std::initializer_list<Pair> wids );
                                 SfxItemSet( SfxItemPool&, const sal_uInt16* nWhichPairTable );
     virtual                     ~SfxItemSet();
 
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 7e535aabd2f0..443e23ca2c1f 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -751,7 +751,7 @@ bool openAreaDialog( const uno::Reference<report::XShape >& _xShape,const uno::R
     try
     {
         SfxItemPool& rItemPool = pModel->GetItemPool();
-        ::std::unique_ptr<SfxItemSet> pDescriptor( new SfxItemSet( rItemPool, rItemPool.GetFirstWhich(),rItemPool.GetLastWhich() ) );
+        ::std::unique_ptr<SfxItemSet> pDescriptor( new SfxItemSet( rItemPool, {{rItemPool.GetFirstWhich(),rItemPool.GetLastWhich()}} ) );
         lcl_fillShapeToItems(_xShape,*pDescriptor);
 
         {   // want the dialog to be destroyed before our set
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index 88171c364b60..b84b81973ca7 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -609,7 +609,7 @@ void OReportSection::createDefault(const OUString& _sType,SdrObject* _pObj)
                         {
                             const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
                             SfxItemSet aDest( _pObj->GetModel()->GetItemPool(),                 // ranges from SdrAttrObj
-                            SDRATTR_START, SDRATTR_SHADOW_LAST,
+                            svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST,
                             SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
                             SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
                             // Graphic Attributes
@@ -619,9 +619,7 @@ void OReportSection::createDefault(const OUString& _sType,SdrObject* _pObj)
                             // CustomShape properties
                             SDRATTR_CUSTOMSHAPE_FIRST, SDRATTR_CUSTOMSHAPE_LAST,
                             // range from SdrTextObj
-                            EE_ITEMS_START, EE_ITEMS_END,
-                            // end
-                            0, 0);
+                            EE_ITEMS_START, EE_ITEMS_END>{});
                             aDest.Set( rSource );
                             _pObj->SetMergedItemSet( aDest );
                             sal_Int32 nAngle = pSourceObj->GetRotateAngle();
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index a438eaeb77e8..6154ed4d9915 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -3425,7 +3425,7 @@ void Test::testFormulaRefUpdateValidity()
     SfxUInt32Item aItem(ATTR_VALIDDATA, nIndex);
 
     ScPatternAttr aNewAttrs(
-        o3tl::make_unique<SfxItemSet>(*m_pDoc->GetPool(), ATTR_PATTERN_START, ATTR_PATTERN_END));
+        o3tl::make_unique<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/docpool.cxx b/sc/source/core/data/docpool.cxx
index 1e5511642fff..f0845342489a 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -209,14 +209,13 @@ ScDocumentPool::ScDocumentPool()
     GetDefaultFonts( aDummy, *pCjkFont, *pCtlFont );
 
     SvxBoxInfoItem* pGlobalBorderInnerAttr = new SvxBoxInfoItem( ATTR_BORDER_INNER );
-    auto pSet = o3tl::make_unique<SfxItemSet>( *this, ATTR_PATTERN_START, ATTR_PATTERN_END );
+    auto pSet = o3tl::make_unique<SfxItemSet>( *this, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
     SfxItemSet      aSetItemItemSet( *this,
-                                     ATTR_BACKGROUND, ATTR_BACKGROUND,
+                                     svl::Items<ATTR_BACKGROUND, ATTR_BACKGROUND,
                                      ATTR_BORDER,     ATTR_SHADOW,
                                      ATTR_LRSPACE,    ATTR_ULSPACE,
                                      ATTR_PAGE_SIZE,  ATTR_PAGE_SIZE,
-                                     ATTR_PAGE_ON,    ATTR_PAGE_SHARED,
-                                     0 );
+                                     ATTR_PAGE_ON,    ATTR_PAGE_SHARED>{} );
 
     pGlobalBorderInnerAttr->SetLine(nullptr, SvxBoxInfoItemLine::HORI);
     pGlobalBorderInnerAttr->SetLine(nullptr, SvxBoxInfoItemLine::VERT);
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index d01155961a13..1dec3d68cd75 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -120,11 +120,10 @@ SfxPrinter* ScDocument::GetPrinter(bool bCreateIfNotExist)
     {
         auto pSet =
             o3tl::make_unique<SfxItemSet>( *xPoolHelper->GetDocPool(),
-                            SID_PRINTER_NOTFOUND_WARN,  SID_PRINTER_NOTFOUND_WARN,
+                            svl::Items<SID_PRINTER_NOTFOUND_WARN,  SID_PRINTER_NOTFOUND_WARN,
                             SID_PRINTER_CHANGESTODOC,   SID_PRINTER_CHANGESTODOC,
                             SID_PRINT_SELECTEDSHEET,    SID_PRINT_SELECTEDSHEET,
-                            SID_SCPRINTOPTIONS,         SID_SCPRINTOPTIONS,
-                            nullptr );
+                            SID_SCPRINTOPTIONS,         SID_SCPRINTOPTIONS>{} );
 
         ::utl::MiscCfg aMisc;
         SfxPrinterChangeFlags nFlags = SfxPrinterChangeFlags::NONE;
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 0ab7a9c60c0c..cddd652158b3 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -85,7 +85,7 @@ ScPatternAttr::ScPatternAttr( std::unique_ptr<SfxItemSet>&& pItemSet )
 }
 
 ScPatternAttr::ScPatternAttr( SfxItemPool* pItemPool )
-    :   SfxSetItem  ( ATTR_PATTERN, o3tl::make_unique<SfxItemSet>( *pItemPool, ATTR_PATTERN_START, ATTR_PATTERN_END ) ),
+    :   SfxSetItem  ( ATTR_PATTERN, o3tl::make_unique<SfxItemSet>( *pItemPool, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} ) ),
         pName       ( nullptr ),
         pStyle      ( nullptr ),
         mnKey(0)
@@ -161,7 +161,7 @@ SfxPoolItem* ScPatternAttr::Create( SvStream& rStream, sal_uInt16 /* nVersion */
         pStr = new OUString( ScGlobal::GetRscString(STR_STYLENAME_STANDARD) );
 
     auto pNewSet = o3tl::make_unique<SfxItemSet>( *GetItemSet().GetPool(),
-                                       ATTR_PATTERN_START, ATTR_PATTERN_END );
+                                       svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
     pNewSet->Load( rStream );
 
     ScPatternAttr* pPattern = new ScPatternAttr( std::move(pNewSet) );
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index ae7aed25f171..a04cc9f00309 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -139,12 +139,11 @@ SfxItemSet& ScStyleSheet::GetItemSet()
 
                     SfxItemPool& rItemPool = GetPool().GetPool();
                     pSet = new SfxItemSet( rItemPool,
-                                           ATTR_BACKGROUND, ATTR_BACKGROUND,
+                                           svl::Items<ATTR_BACKGROUND, ATTR_BACKGROUND,
                                            ATTR_BORDER, ATTR_SHADOW,
                                            ATTR_LRSPACE, ATTR_PAGE_SCALETO,
                                            ATTR_WRITINGDIR, ATTR_WRITINGDIR,
-                                           ATTR_USERDEF, ATTR_USERDEF,
-                                           0 );
+                                           ATTR_USERDEF, ATTR_USERDEF>{} );
 
                     //  If being loaded also the set is then filled in from the file,
                     //  so the defaults do not need to be set.
@@ -222,7 +221,7 @@ SfxItemSet& ScStyleSheet::GetItemSet()
 
             case SfxStyleFamily::Para:
             default:
-                pSet = new SfxItemSet( GetPool().GetPool(), ATTR_PATTERN_START, ATTR_PATTERN_END );
+                pSet = new SfxItemSet( GetPool().GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
                 break;
         }
         bMySet = true;
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 4d8ce194b3c9..e63c23c3e2c2 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -479,7 +479,7 @@ void ScTable::DeleteSelection( InsertDeleteFlags nDelFlag, const ScMarkData& rMa
     if ( IsProtected() && (nDelFlag & InsertDeleteFlags::ATTRIB) )
     {
         ScDocumentPool* pPool = pDocument->GetPool();
-        SfxItemSet aSet( *pPool, ATTR_PATTERN_START, ATTR_PATTERN_END );
+        SfxItemSet aSet( *pPool, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
         aSet.Put( ScProtectionAttr( false ) );
         SfxItemPoolCache aCache( pPool, &aSet );
         ApplySelectionCache( &aCache, rMark );
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index 9544fb20453c..56c3578088aa 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -134,11 +134,11 @@ static bool lcl_HasThickLine( SdrObject& rObj )
 }
 
 ScDetectiveData::ScDetectiveData( SdrModel* pModel ) :
-    aBoxSet( pModel->GetItemPool(), SDRATTR_START, SDRATTR_END ),
-    aArrowSet( pModel->GetItemPool(), SDRATTR_START, SDRATTR_END ),
-    aToTabSet( pModel->GetItemPool(), SDRATTR_START, SDRATTR_END ),
-    aFromTabSet( pModel->GetItemPool(), SDRATTR_START, SDRATTR_END ),
-    aCircleSet( pModel->GetItemPool(), SDRATTR_START, SDRATTR_END )
+    aBoxSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END>{} ),
+    aArrowSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END>{} ),
+    aToTabSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END>{} ),
+    aFromTabSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END>{} ),
+    aCircleSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END>{} )
 {
     nMaxLevel = 0;
 
@@ -194,7 +194,7 @@ ScDetectiveData::ScDetectiveData( SdrModel* pModel ) :
 }
 
 ScCommentData::ScCommentData( ScDocument& rDoc, SdrModel* pModel ) :
-    aCaptionSet( pModel->GetItemPool(), SDRATTR_START, SDRATTR_END, EE_ITEMS_START, EE_ITEMS_END, 0, 0 )
+    aCaptionSet( pModel->GetItemPool(), svl::Items<SDRATTR_START, SDRATTR_END, EE_ITEMS_START, EE_ITEMS_END>{} )
 {
     basegfx::B2DPolygon aTriangle;
     aTriangle.append(basegfx::B2DPoint(10.0, 0.0));
diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx
index fe01b5c27477..37244ae8ae80 100644
--- a/sc/source/filter/excel/xehelper.cxx
+++ b/sc/source/filter/excel/xehelper.cxx
@@ -424,7 +424,7 @@ XclExpStringRef lclCreateFormattedString(
 
     // font buffer and helper item set for edit engine -> Calc item conversion
     XclExpFontBuffer& rFontBuffer = rRoot.GetFontBuffer();
-    SfxItemSet aItemSet( *rRoot.GetDoc().GetPool(), ATTR_PATTERN_START, ATTR_PATTERN_END );
+    SfxItemSet aItemSet( *rRoot.GetDoc().GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
 
     // script type handling
     Reference< XBreakIterator > xBreakIt = rRoot.GetDoc().GetBreakIterator();
@@ -678,7 +678,7 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico
 
     OUString aText;
     sal_Int32 nHeight = 0;
-    SfxItemSet aItemSet( *GetDoc().GetPool(), ATTR_PATTERN_START, ATTR_PATTERN_END );
+    SfxItemSet aItemSet( *GetDoc().GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
 
     // edit engine
     bool bOldUpdateMode = mrEE.GetUpdateMode();
diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx
index f2dccf1b4aa7..cd8ea057cab5 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -371,7 +371,7 @@ ScHeaderEditEngine& XclRoot::GetHFEditEngine() const
 
         // set Calc header/footer defaults
         SfxItemSet* pEditSet = new SfxItemSet( rEE.GetEmptyItemSet() );
-        SfxItemSet aItemSet( *GetDoc().GetPool(), ATTR_PATTERN_START, ATTR_PATTERN_END );
+        SfxItemSet aItemSet( *GetDoc().GetPool(), svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
         ScPatternAttr::FillToEditItemSet( *pEditSet, aItemSet );
         // FillToEditItemSet() adjusts font height to 1/100th mm, we need twips
         std::unique_ptr<SfxPoolItem> pNewItem( aItemSet.Get( ATTR_FONT_HEIGHT ).CloneSetWhich(EE_CHAR_FONTHEIGHT));
diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx
index e2ba310fc3e1..f07075e483a8 100644
--- a/sc/source/filter/starcalc/scflt.cxx
+++ b/sc/source/filter/starcalc/scflt.cxx
@@ -760,12 +760,11 @@ void Sc10PageCollection::PutToDoc( ScDocument* pDoc )
             pSet->Put( aHeaderItem );
 
             SfxItemSet aSetItemItemSet( *pDoc->GetPool(),
-                                  ATTR_BACKGROUND, ATTR_BACKGROUND,
+                                  svl::Items<ATTR_BACKGROUND, ATTR_BACKGROUND,
                                   ATTR_BORDER, ATTR_SHADOW,
                                   ATTR_PAGE_SIZE, ATTR_PAGE_SIZE,
                                   ATTR_LRSPACE, ATTR_ULSPACE,
-                                  ATTR_PAGE_ON, ATTR_PAGE_SHARED,
-                                  0 );
+                                  ATTR_PAGE_ON, ATTR_PAGE_SHARED>{} );
             nColor = pHeadFootLine->BackColor;
             Color aBColor( nColor.Red, nColor.Green, nColor.Blue );
             nColor = pHeadFootLine->RasterColor;
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 8ca88ba3b886..db4637665612 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -405,7 +405,7 @@ void ScModule::Execute( SfxRequest& rReq )
                         bSet = !GetDocOptions().IsAutoSpell();
                 }
 
-                SfxItemSet aSet( GetPool(), SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK );
+                SfxItemSet aSet( GetPool(), svl::Items<SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK>{} );
                 aSet.Put( SfxBoolItem( SID_AUTOSPELL_CHECK, bSet ) );
                 ModifyOptions( aSet );
                 rReq.Done();
@@ -1932,7 +1932,7 @@ std::unique_ptr<SfxItemSet> ScModule::CreateItemSet( sal_uInt16 nId )
     {
         pRet = o3tl::make_unique<SfxItemSet>( GetPool(),
                             // TP_CALC:
-                            SID_SCDOCOPTIONS,       SID_SCDOCOPTIONS,
+                            svl::Items<SID_SCDOCOPTIONS,       SID_SCDOCOPTIONS,
                             // TP_VIEW:
                             SID_SCVIEWOPTIONS,      SID_SCVIEWOPTIONS,
                             SID_SC_OPT_SYNCZOOM,    SID_SC_OPT_SYNCZOOM,
@@ -1955,8 +1955,7 @@ std::unique_ptr<SfxItemSet> ScModule::CreateItemSet( sal_uInt16 nId )
                             // TP_DEFAULTS
                             SID_SCDEFAULTSOPTIONS, SID_SCDEFAULTSOPTIONS,
                             // TP_FORMULA
-                            SID_SCFORMULAOPTIONS, SID_SCFORMULAOPTIONS,
-                            0 );
+                            SID_SCFORMULAOPTIONS, SID_SCFORMULAOPTIONS>{} );
 
         const ScAppOptions& rAppOpt = GetAppOptions();
 
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 2a6e39bad2f9..25d137b30f53 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -645,10 +645,9 @@ void ScDocShell::ExecuteChangeCommentDialog( ScChangeAction* pAction, vcl::Windo
     aDate += ScGlobal::pLocaleData->getTime( aDT, false );
 
     SfxItemSet aSet( GetPool(),
-                      SID_ATTR_POSTIT_AUTHOR, SID_ATTR_POSTIT_AUTHOR,
+                      svl::Items<SID_ATTR_POSTIT_AUTHOR, SID_ATTR_POSTIT_AUTHOR,
                       SID_ATTR_POSTIT_DATE,   SID_ATTR_POSTIT_DATE,
-                      SID_ATTR_POSTIT_TEXT,   SID_ATTR_POSTIT_TEXT,
-                      0 );
+                      SID_ATTR_POSTIT_TEXT,   SID_ATTR_POSTIT_TEXT>{} );
 
     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 7d28bfe733f4..670d713774b7 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -122,7 +122,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
 
         case SID_TEXT_STANDARD: // delete hard text attributes
             {
-                SfxItemSet aEmptyAttr(GetPool(), EE_ITEMS_START, EE_ITEMS_END);
+                SfxItemSet aEmptyAttr(GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{});
                 pView->SetAttributes(aEmptyAttr, true);
             }
             break;
@@ -334,7 +334,7 @@ void ScDrawShell::ExecuteMacroAssign( SdrObject* pObj, vcl::Window* pWin )
     }
 
     // create empty itemset for macro-dlg
-    std::unique_ptr<SfxItemSet> pItemSet(new SfxItemSet(SfxGetpApp()->GetPool(), SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG, 0 ));
+    std::unique_ptr<SfxItemSet> pItemSet(new SfxItemSet(SfxGetpApp()->GetPool(), svl::Items<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG>{} ));
     pItemSet->Put ( aItem );
 
     SfxEventNamesItem aNamesItem(SID_EVENTCONFIG);
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index 1b7cb1f9107c..2bd0815df733 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -451,7 +451,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq )
                 const SfxBoolItem* pItem = rReq.GetArg<SfxBoolItem>(SID_ENABLE_HYPHENATION);
                 if( pItem )
                 {
-                    SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
+                    SfxItemSet aSet( GetPool(), svl::Items<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE>{} );
                     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 a4b096213b49..92b092f758b0 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -801,7 +801,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
                 if ( pOutView )
                     pOutView->Paint( tools::Rectangle() );
 
-                SfxItemSet aEmptyAttr( *aEditAttr.GetPool(), EE_ITEMS_START, EE_ITEMS_END );
+                SfxItemSet aEmptyAttr( *aEditAttr.GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
                 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(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
+            SfxItemSet aAttr( GetPool(), svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} );
             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(), EE_PARA_SBL, EE_PARA_SBL );
+            SfxItemSet aAttr( GetPool(), svl::Items<EE_PARA_SBL, EE_PARA_SBL>{} );
             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(), EE_PARA_ULSPACE, EE_PARA_ULSPACE );
+            SfxItemSet aAttr( GetPool(), svl::Items<EE_PARA_ULSPACE, EE_PARA_ULSPACE>{} );
             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 c655351c888b..f6c1e339eb6b 100644
--- a/sc/source/ui/drawfunc/drtxtob1.cxx
+++ b/sc/source/ui/drawfunc/drtxtob1.cxx
@@ -72,13 +72,12 @@ bool ScDrawTextObjectBar::ExecuteParaDlg( const SfxItemSet& rArgs,
 {
     SfxItemPool* pArgPool = rArgs.GetPool();
     SfxItemSet aNewAttr( *pArgPool,
-                            EE_ITEMS_START, EE_ITEMS_END,
+                            svl::Items<EE_ITEMS_START, EE_ITEMS_END,
                             SID_ATTR_PARA_HYPHENZONE, SID_ATTR_PARA_HYPHENZONE,
                             SID_ATTR_PARA_PAGEBREAK, SID_ATTR_PARA_PAGEBREAK,
                             SID_ATTR_PARA_SPLIT, SID_ATTR_PARA_SPLIT,
                             SID_ATTR_PARA_WIDOWS, SID_ATTR_PARA_WIDOWS,
-                            SID_ATTR_PARA_ORPHANS, SID_ATTR_PARA_ORPHANS,
-                            0 );
+                            SID_ATTR_PARA_ORPHANS, SID_ATTR_PARA_ORPHANS>{} );
     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 8b0fddfbfed6..8783ef9c27ba 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -91,7 +91,7 @@ void ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
         case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
         case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
             {
-                SfxItemSet aAttr( pView->GetModel()->GetItemPool(), SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, 0 );
+                SfxItemSet aAttr( pView->GetModel()->GetItemPool(), svl::Items<SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION>{} );
                 aAttr.Put( SvxWritingModeItem(
                     nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ?
                         css::text::WritingMode_LR_TB : css::text::WritingMode_TB_RL,
@@ -107,7 +107,7 @@ void ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
                 const SfxBoolItem* pItem = rReq.GetArg<SfxBoolItem>(SID_ENABLE_HYPHENATION);
                 if( pItem )
                 {
-                    SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
+                    SfxItemSet aSet( GetPool(), svl::Items<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE>{} );
                     bool bValue = pItem->GetValue();
                     aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
                     pView->SetAttributes( aSet );
@@ -163,9 +163,8 @@ void ScDrawTextObjectBar::ExecuteExtra( SfxRequest &rReq )
         case SID_ATTR_PARA_RIGHT_TO_LEFT:
             {
                 SfxItemSet aAttr( pView->GetModel()->GetItemPool(),
-                                    EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR,
-                                    EE_PARA_JUST, EE_PARA_JUST,
-                                    0 );
+                                    svl::Items<EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR,
+                                    EE_PARA_JUST, EE_PARA_JUST>{} );
                 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 54d8470229f6..9cc4cd982c8f 100644
--- a/sc/source/ui/drawfunc/fuconcustomshape.cxx
+++ b/sc/source/ui/drawfunc/fuconcustomshape.cxx
@@ -168,7 +168,7 @@ void FuConstCustomShape::SetAttributes( SdrObject* pObj )
                         {
                             const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
                             SfxItemSet aDest( pObj->GetModel()->GetItemPool(),              // ranges from SdrAttrObj
-                            SDRATTR_START, SDRATTR_SHADOW_LAST,
+                            svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST,
                             SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
                             SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
                             // Graphic Attributes
@@ -178,9 +178,7 @@ void FuConstCustomShape::SetAttributes( SdrObject* pObj )
                             // CustomShape properties
                             SDRATTR_CUSTOMSHAPE_FIRST, SDRATTR_CUSTOMSHAPE_LAST,
                             // range from SdrTextObj
-                            EE_ITEMS_START, EE_ITEMS_END,
-                            // end
-                            0, 0);
+                            EE_ITEMS_START, EE_ITEMS_END>{});
                             aDest.Set( rSource );
                             pObj->SetMergedItemSet( aDest );
                             sal_Int32 nAngle = pSourceObj->GetRotateAngle();
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index c7d735a32ae0..3062294a8292 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -413,7 +413,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
 
                     // set needed attributes for scrolling
                     SfxItemSet aItemSet( pDrDoc->GetItemPool(),
-                                            SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST);
+                                            svl::Items<SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST>{});
 
                     aItemSet.Put( makeSdrTextAutoGrowWidthItem( false ) );
                     aItemSet.Put( makeSdrTextAutoGrowHeightItem( false ) );
@@ -684,7 +684,7 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const tools::Rectan
 
             if(bMarquee)
             {
-                SfxItemSet aSet(pDrDoc->GetItemPool(), SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST);
+                SfxItemSet aSet(pDrDoc->GetItemPool(), svl::Items<SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST>{});
 
                 aSet.Put( makeSdrTextAutoGrowWidthItem( false ) );
                 aSet.Put( makeSdrTextAutoGrowHeightItem( false ) );
diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx
index 2a4e385c851c..0c6c0b04a157 100644
--- a/sc/source/ui/pagedlg/tphf.cxx
+++ b/sc/source/ui/pagedlg/tphf.cxx
@@ -44,8 +44,8 @@ ScHFPage::ScHFPage( vcl::Window* pParent, const SfxItemSet& rSet, sal_uInt16 nSe
 
     :   SvxHFPage   ( pParent, rSet, nSetId ),
         aDataSet    ( *rSet.GetPool(),
-                       ATTR_PAGE_HEADERLEFT, ATTR_PAGE_FOOTERRIGHT,
-                       ATTR_PAGE, ATTR_PAGE, 0 ),
+                       svl::Items<ATTR_PAGE_HEADERLEFT, ATTR_PAGE_FOOTERRIGHT,
+                       ATTR_PAGE, ATTR_PAGE>{} ),
         nPageUsage  ( SvxPageUsage::All ),
         pStyleDlg   ( nullptr )
 {
diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx
index 1cbab301bb6d..857b9d1bac4d 100644
--- a/sc/source/ui/unoobj/confuno.cxx
+++ b/sc/source/ui/unoobj/confuno.cxx
@@ -238,11 +238,10 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue(
                     SvMemoryStream aStream (aSequence.getArray(), nSize, StreamMode::READ );
                     aStream.Seek ( STREAM_SEEK_TO_BEGIN );
                     auto pSet = o3tl::make_unique<SfxItemSet>( *rDoc.GetPool(),
-                            SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
+                            svl::Items<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
                             SID_PRINTER_CHANGESTODOC,  SID_PRINTER_CHANGESTODOC,
                             SID_PRINT_SELECTEDSHEET,   SID_PRINT_SELECTEDSHEET,
-                            SID_SCPRINTOPTIONS,        SID_SCPRINTOPTIONS,
-                            nullptr );
+                            SID_SCPRINTOPTIONS,        SID_SCPRINTOPTIONS>{} );
                     pDocShell->SetPrinter( SfxPrinter::Create( aStream, std::move(pSet) ) );
                 }
             }
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 90700aa3ee5f..ff173fda39fe 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -3036,7 +3036,7 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq)
 
     ScopedVclPtr<SfxAbstractTabDialog> pDlg;
     ScSubTotalParam aSubTotalParam;
-    SfxItemSet aArgSet( GetPool(), SCITEM_SUBTDATA, SCITEM_SUBTDATA );
+    SfxItemSet aArgSet( GetPool(), svl::Items<SCITEM_SUBTDATA, SCITEM_SUBTDATA>{} );
 
     // Only get existing named database range.
     ScDBData* pDBData = pTabViewShell->GetDBData(true, SC_DB_OLD);
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index 3c6eec7a0b20..feeba69dc20a 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -478,7 +478,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
                     if( lcl_GetSortParam( pData, aSortParam ) )
                     {
                         ScDocument* pDoc = GetViewData()->GetDocument();
-                        SfxItemSet  aArgSet( GetPool(), SCITEM_SORTDATA, SCITEM_SORTDATA );
+                        SfxItemSet  aArgSet( GetPool(), svl::Items<SCITEM_SORTDATA, SCITEM_SORTDATA>{} );
 
                         pDBData->GetSortParam( aSortParam );
                         bool bHasHeader = pDoc->HasColHeader( aSortParam.nCol1, aSortParam.nRow1, aSortParam.nCol2, aSortParam.nRow2, pData->GetTabNo() );
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 1b3105b87aab..b2be50b1ba05 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -331,13 +331,13 @@ void ScCellShell::Execute( SfxRequest& rReq )
 
                     std::unique_ptr<SfxItemSet> pEmptySet(
                                         new SfxItemSet( *pReqArgs->GetPool(),
-                                                        ATTR_PATTERN_START,
-                                                        ATTR_PATTERN_END ));
+                                                        svl::Items<ATTR_PATTERN_START,
+                                                        ATTR_PATTERN_END>{} ));
 
                     std::unique_ptr<SfxItemSet> pNewSet(
                                         new SfxItemSet( *pReqArgs->GetPool(),
-                                                        ATTR_PATTERN_START,
-                                                        ATTR_PATTERN_END ));
+                                                        svl::Items<ATTR_PATTERN_START,
+                                                        ATTR_PATTERN_END>{} ));
 
                     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 e8b2e064bd85..23cbe4ddf408 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -997,7 +997,7 @@ SdrObject* ScDrawView::ApplyGraphicToObject(
     {
         AddUndo(new SdrUndoAttrObj(rHitObject));
 
-        SfxItemSet aSet(GetModel()->GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLBITMAP);
+        SfxItemSet aSet(GetModel()->GetItemPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLBITMAP>{});
 
         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 7dd4bfb5dd54..6895e17c064b 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1033,7 +1033,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
     }
 
     short nType = GetCurrentNumberFormatType();
-    SfxItemSet aSet( GetPool(), nSlot, nSlot );
+    SfxItemSet aSet( GetPool(), {{nSlot, nSlot}} );
     switch ( nSlot )
     {
         case SID_NUMBER_TWODEC:
@@ -1239,7 +1239,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
                     const SfxItemSet& rOldSet =
                         pTabViewShell->GetSelectionPattern()->GetItemSet();
                     SfxItemPool* pDocPool = GetViewData()->GetDocument()->GetPool();
-                    SfxItemSet aNewSet( *pDocPool, ATTR_PATTERN_START, ATTR_PATTERN_END );
+                    SfxItemSet aNewSet( *pDocPool, svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} );
                     aNewSet.Put( *pItem );
                     pTabViewShell->ApplyAttributes( &aNewSet, &rOldSet );
                 }
@@ -1873,13 +1873,13 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq )
                     std::unique_ptr<SfxItemSet> pOldSet(
                                                 new SfxItemSet(
                                                         *(pDoc->GetPool()),
-                                                        ATTR_PATTERN_START,
-                                                        ATTR_PATTERN_END ));
+                                                        svl::Items<ATTR_PATTERN_START,
+                                                        ATTR_PATTERN_END>{} ));
                     std::unique_ptr<SfxItemSet> pNewSet(
                                                 new SfxItemSet(
                                                         *(pDoc->GetPool()),
-                                                        ATTR_PATTERN_START,
-                                                        ATTR_PATTERN_END ));
+                                                        svl::Items<ATTR_PATTERN_START,
+                                                        ATTR_PATTERN_END>{} ));
                     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 46f6ed82e251..7688dd25b9a2 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -199,7 +199,7 @@ void ScGridWindow::DoPushPivotButton( SCCOL nCol, SCROW nRow, const MouseEvent&
             }
 
             SfxItemSet aArgSet( pViewData->GetViewShell()->GetPool(),
-                                        SCITEM_QUERYDATA, SCITEM_QUERYDATA );
+                                        svl::Items<SCITEM_QUERYDATA, SCITEM_QUERYDATA>{} );
             aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA, pViewData, &aQueryParam ) );
 
             ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx
index 3383f18d0720..fb6aba1ee455 100644
--- a/sc/source/ui/view/gridwin3.cxx
+++ b/sc/source/ui/view/gridwin3.cxx
@@ -332,7 +332,7 @@ void ScGridWindow::UpdateStatusPosSize()
     if (!pPV)
         return; // shouldn't be called in that case either
 
-    SfxItemSet aSet(pViewData->GetViewShell()->GetPool(), SID_ATTR_POSITION, SID_ATTR_SIZE);
+    SfxItemSet aSet(pViewData->GetViewShell()->GetPool(), svl::Items<SID_ATTR_POSITION, SID_ATTR_SIZE>{});
 
     //  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 2c96d3e62a5a..185000c9c866 100644
--- a/sc/source/ui/view/pivotsh.cxx
+++ b/sc/source/ui/view/pivotsh.cxx
@@ -100,7 +100,7 @@ void ScPivotShell::Execute( SfxRequest& rReq )
 
                 ScViewData& rViewData = pViewShell->GetViewData();
                 SfxItemSet aArgSet( pViewShell->GetPool(),
-                    SCITEM_QUERYDATA, SCITEM_QUERYDATA );
+                    svl::Items<SCITEM_QUERYDATA, SCITEM_QUERYDATA>{} );
                 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 3bd8aed1684f..6d86d188e7fb 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -627,7 +627,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq )
                 }
                 else
                 {
-                    SfxItemSet      aSet     ( GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM );
+                    SfxItemSet      aSet     ( GetPool(), svl::Items<SID_ATTR_ZOOM, SID_ATTR_ZOOM>{} );
                     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 d6d11f18c79e..559aa45506bc 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -706,7 +706,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
                 }
                 else
                 {
-                    SfxItemSet      aSet     ( GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM );
+                    SfxItemSet      aSet     ( GetPool(), svl::Items<SID_ATTR_ZOOM, SID_ATTR_ZOOM>{} );
                     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 7cbcaed65b9b..53ad7ede5038 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -203,8 +203,8 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
         case SID_OPENDLG_CONSOLIDATE:
         {
             SfxItemSet aArgSet( GetPool(),
-                                SCITEM_CONSOLIDATEDATA,
-                                SCITEM_CONSOLIDATEDATA );
+                                svl::Items<SCITEM_CONSOLIDATEDATA,
+                                SCITEM_CONSOLIDATEDATA>{} );
 
             const ScConsolidateParam* pDlgData =
                             pDoc->GetConsolidateDlgData();
@@ -254,8 +254,8 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
         {
             ScQueryParam    aQueryParam;
             SfxItemSet      aArgSet( GetPool(),
-                                     SCITEM_QUERYDATA,
-                                     SCITEM_QUERYDATA );
+                                     svl::Items<SCITEM_QUERYDATA,
+                                     SCITEM_QUERYDATA>{} );
 
             ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, ScGetDBSelection::RowDown);
             pDBData->ExtendDataArea(pDoc);
@@ -284,8 +284,8 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
 
             ScQueryParam    aQueryParam;
             SfxItemSet      aArgSet( GetPool(),
-                                     SCITEM_QUERYDATA,
-                                     SCITEM_QUERYDATA );
+                                     svl::Items<SCITEM_QUERYDATA,
+                                     SCITEM_QUERYDATA>{} );
 
             ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, ScGetDBSelection::RowDown);
             pDBData->ExtendDataArea(pDoc);
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index dec005d3561a..36e22d64ab24 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -3126,12 +3126,12 @@ void ScViewFunc::SetSelectionFrameLines( const SvxBorderLine* pLine,
         {
             std::unique_ptr<SfxItemSet> pOldSet(new SfxItemSet(
                                             *(pDoc->GetPool()),
-                                            ATTR_PATTERN_START,
-                                            ATTR_PATTERN_END ));
+                                            svl::Items<ATTR_PATTERN_START,
+                                            ATTR_PATTERN_END>{} ));
             std::unique_ptr<SfxItemSet> pNewSet(new SfxItemSet(
                                             *(pDoc->GetPool()),
-                                            ATTR_PATTERN_START,
-                                            ATTR_PATTERN_END ));
+                                            svl::Items<ATTR_PATTERN_START,
+                                            ATTR_PATTERN_END>{} ));
 
             SvxBorderLine           aLine;
 
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index db6edf9d6112..6e09d4b6291b 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -981,7 +981,7 @@ void ScViewFunc::ApplyAttr( const SfxPoolItem& rAttrItem )
     }
 
     ScPatternAttr aNewAttrs( o3tl::make_unique<SfxItemSet>( *GetViewData().GetDocument()->GetPool(),
-                                            ATTR_PATTERN_START, ATTR_PATTERN_END ) );
+                                            svl::Items<ATTR_PATTERN_START, ATTR_PATTERN_END>{} ) );
 
     aNewAttrs.GetItemSet().Put( rAttrItem );
     //  if justify is set (with Buttons), always indentation 0
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx
index 2a7642b2a813..3901d7e2ce86 100644
--- a/sd/qa/unit/dialogs-test.cxx
+++ b/sd/qa/unit/dialogs-test.cxx
@@ -222,7 +222,7 @@ const SfxItemSet& SdDialogsTest::getEmptyFillStyleSfxItemSet()
     {
         SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
         CPPUNIT_ASSERT(pDrawDoc);
-        mpEmptyFillStyleSfxItemSet.reset( new SfxItemSet(pDrawDoc->GetItemPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST) );
+        mpEmptyFillStyleSfxItemSet.reset( new SfxItemSet(pDrawDoc->GetItemPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}) );
         CPPUNIT_ASSERT(mpEmptyFillStyleSfxItemSet);
         mpEmptyFillStyleSfxItemSet->Put(XFillStyleItem(drawing::FillStyle_NONE));
     }
@@ -350,7 +350,7 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
             // CreateSdSnapLineDlg(const SfxItemSet& rInAttrs, ::sd::View* pView) override;
             SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
             CPPUNIT_ASSERT(pDrawDoc);
-            SfxItemSet aNewAttr(pDrawDoc->GetItemPool(), ATTR_SNAPLINE_START, ATTR_SNAPLINE_END);
+            SfxItemSet aNewAttr(pDrawDoc->GetItemPool(), svl::Items<ATTR_SNAPLINE_START, ATTR_SNAPLINE_END>{});
             aNewAttr.Put(SfxInt32Item(ATTR_SNAPLINE_X, 0));
             aNewAttr.Put(SfxInt32Item(ATTR_SNAPLINE_Y, 0));
             pRetval = getSdAbstractDialogFactory()->CreateSdSnapLineDlg(
@@ -364,7 +364,7 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
             // CreateSdInsertLayerDlg(const SfxItemSet& rInAttrs, bool bDeletable, const OUString& aStr) override;
             SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
             CPPUNIT_ASSERT(pDrawDoc);
-            SfxItemSet aNewAttr(pDrawDoc->GetItemPool(), ATTR_LAYER_START, ATTR_LAYER_END);
+            SfxItemSet aNewAttr(pDrawDoc->GetItemPool(), svl::Items<ATTR_LAYER_START, ATTR_LAYER_END>{});
             const OUString aLayerName = SdResId(STR_LAYER); // + OUString::number(2);
             aNewAttr.Put(makeSdAttrLayerName(aLayerName));
             aNewAttr.Put(makeSdAttrLayerTitle());
@@ -432,7 +432,7 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
             const std::vector<OUString> aPageNames;
             SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
             CPPUNIT_ASSERT(pDrawDoc);
-            SfxItemSet aDlgSet(pDrawDoc->GetItemPool(), ATTR_PRESENT_START, ATTR_PRESENT_END);
+            SfxItemSet aDlgSet(pDrawDoc->GetItemPool(), svl::Items<ATTR_PRESENT_START, ATTR_PRESENT_END>{});
             ::sd::PresentationSettings& rPresentationSettings = pDrawDoc->getPresentationSettings();
             aDlgSet.Put(SfxBoolItem(ATTR_PRESENT_ALL, rPresentationSettings.mbAll));
             aDlgSet.Put(SfxBoolItem(ATTR_PRESENT_CUSTOMSHOW, rPresentationSettings.mbCustomShow));
@@ -513,7 +513,7 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID)
             // CreatSdActionDialog(const SfxItemSet* pAttr, ::sd::View* pView) override;
             SdDrawDocument* pDrawDoc = getSdXImpressDocument()->GetDoc();
             CPPUNIT_ASSERT(pDrawDoc);
-            SfxItemSet aSet(pDrawDoc->GetItemPool(), ATTR_ANIMATION_START, ATTR_ACTION_END);
+            SfxItemSet aSet(pDrawDoc->GetItemPool(), svl::Items<ATTR_ANIMATION_START, ATTR_ACTION_END>{});
             aSet.Put(SfxBoolItem(ATTR_ANIMATION_ACTIVE, false));
             aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_EFFECT, sal_uInt16(presentation::AnimationEffect_NONE)));
             aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_TEXTEFFECT, sal_uInt16(presentation::AnimationEffect_NONE)));
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index dd4f403344a2..2594a895bedd 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -2156,7 +2156,7 @@ SdrObject* convertPresentationObjectImpl(SdPage& rPage, SdrObject* pSourceObj, P
             }
 
             // Remove LRSpace item
-            SfxItemSet aSet(pModel->GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
+            SfxItemSet aSet(pModel->GetPool(), svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} );
 
             aSet.Put(pNewObj->GetMergedItemSet());
 
@@ -2194,7 +2194,7 @@ SdrObject* convertPresentationObjectImpl(SdPage& rPage, SdrObject* pSourceObj, P
             pNewObj->SetEmptyPresObj(false);
 
             // reset left indent
-            SfxItemSet aSet(pModel->GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
+            SfxItemSet aSet(pModel->GetPool(), svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} );
 
             aSet.Put(pNewObj->GetMergedItemSet());
 
diff --git a/sd/source/core/sdpage2.cxx b/sd/source/core/sdpage2.cxx
index c8c5b946776c..bf66a0b57338 100644
--- a/sd/source/core/sdpage2.cxx
+++ b/sd/source/core/sdpage2.cxx
@@ -479,7 +479,7 @@ SfxStyleSheet* SdPage::GetTextStyleSheetForObject( SdrObject* pObj ) const
 SfxItemSet* SdPage::getOrCreateItems()
 {
     if( mpItems == nullptr )
-        mpItems = o3tl::make_unique<SfxItemSet>( pModel->GetItemPool(), SDRATTR_XMLATTRIBUTES, SDRATTR_XMLATTRIBUTES );
+        mpItems = o3tl::make_unique<SfxItemSet>( pModel->GetItemPool(), svl::Items<SDRATTR_XMLATTRIBUTES, SDRATTR_XMLATTRIBUTES>{} );
 
     return mpItems.get();
 }
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index 74fe9937bde8..5fabb740dbd2 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -1006,7 +1006,7 @@ void SAL_CALL SdStyleSheet::setPropertyValue( const OUString& aPropertyName, con
             throw IllegalArgumentException();
         }
 
-        SfxItemSet aSet( GetPool().GetPool(),   pEntry->nWID, pEntry->nWID);
+        SfxItemSet aSet( GetPool().GetPool(),   {{pEntry->nWID, pEntry->nWID}});
         aSet.Put( rStyleSet );
 
         if( !aSet.Count() )
@@ -1113,7 +1113,7 @@ Any SAL_CALL SdStyleSheet::getPropertyValue( const OUString& PropertyName )
         }
         else
         {
-            SfxItemSet aSet( GetPool().GetPool(),   pEntry->nWID, pEntry->nWID);
+            SfxItemSet aSet( GetPool().GetPool(),   {{pEntry->nWID, pEntry->nWID}});
 
             const SfxPoolItem* pItem;
             SfxItemSet& rStyleSet = GetItemSet();
@@ -1301,7 +1301,7 @@ Any SAL_CALL SdStyleSheet::getPropertyDefault( const OUString& aPropertyName )
     else
     {
         SfxItemPool& rMyPool = GetPool().GetPool();
-        SfxItemSet aSet( rMyPool,   pEntry->nWID, pEntry->nWID);
+        SfxItemSet aSet( rMyPool,   {{pEntry->nWID, pEntry->nWID}});
         aSet.Put( rMyPool.GetDefaultItem( pEntry->nWID ) );
         aRet = SvxItemPropertySet_getPropertyValue( pEntry, aSet );
     }
diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx
index 2ddb26a7ee84..2bcf6455ea31 100644
--- a/sd/source/ui/app/sdmod2.cxx
+++ b/sd/source/ui/app/sdmod2.cxx
@@ -442,7 +442,7 @@ std::unique_ptr<SfxItemSet> SdModule::CreateItemSet( sal_uInt16 nSlot )
     rPool.SetDefaultMetric( MapUnit::Map100thMM );
 
     auto pRet = o3tl::make_unique<SfxItemSet>( rPool,
-                        SID_ATTR_METRIC, SID_ATTR_METRIC,
+                        svl::Items<SID_ATTR_METRIC, SID_ATTR_METRIC,
                         SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP,
 
                         ATTR_OPTIONS_LAYOUT, ATTR_OPTIONS_LAYOUT,
@@ -455,8 +455,7 @@ std::unique_ptr<SfxItemSet> SdModule::CreateItemSet( sal_uInt16 nSlot )
 
                         ATTR_OPTIONS_PRINT, ATTR_OPTIONS_PRINT,
 
-                        SID_ATTR_GRID_OPTIONS, SID_ATTR_GRID_OPTIONS,
-                        0 );
+                        SID_ATTR_GRID_OPTIONS, SID_ATTR_GRID_OPTIONS>{} );
 
     // TP_OPTIONS_LAYOUT:
     pRet->Put( SdOptionsLayoutItem( pOptions, pFrameView ) );
@@ -628,10 +627,9 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
     }
 
     SfxItemSet aPrintSet( GetPool(),
-                    SID_PRINTER_NOTFOUND_WARN,  SID_PRINTER_NOTFOUND_WARN,
+                    svl::Items<SID_PRINTER_NOTFOUND_WARN,  SID_PRINTER_NOTFOUND_WARN,
                     SID_PRINTER_CHANGESTODOC,   SID_PRINTER_CHANGESTODOC,
-                    ATTR_OPTIONS_PRINT,         ATTR_OPTIONS_PRINT,
-                    0 );
+                    ATTR_OPTIONS_PRINT,         ATTR_OPTIONS_PRINT>{} );
 
     // Print
     const SdOptionsPrintItem* pPrintItem = nullptr;
diff --git a/sd/source/ui/dlg/dlgfield.cxx b/sd/source/ui/dlg/dlgfield.cxx
index 6270815d8ff0..047d2fab0b4a 100644
--- a/sd/source/ui/dlg/dlgfield.cxx
+++ b/sd/source/ui/dlg/dlgfield.cxx
@@ -319,7 +319,7 @@ IMPL_LINK_NOARG(SdModifyFieldDlg, LanguageChangeHdl, ListBox&, void)
 
 SfxItemSet SdModifyFieldDlg::GetItemSet()
 {
-    SfxItemSet aOutput( *maInputSet.GetPool(), EE_CHAR_LANGUAGE, EE_CHAR_LANGUAGE_CTL );
+    SfxItemSet aOutput( *maInputSet.GetPool(), svl::Items<EE_CHAR_LANGUAGE, EE_CHAR_LANGUAGE_CTL>{} );
 
     if( m_pLbLanguage->IsValueChangedFromSaved() )
     {
diff --git a/sd/source/ui/dlg/prltempl.cxx b/sd/source/ui/dlg/prltempl.cxx
index 0f5e3db0c55b..dbd14ef2161d 100644
--- a/sd/source/ui/dlg/prltempl.cxx
+++ b/sd/source/ui/dlg/prltempl.cxx
@@ -60,7 +60,7 @@ SdPresLayoutTemplateDlg::SdPresLayoutTemplateDlg( SfxObjectShell* pDocSh,
                             , "modules/sdraw/ui/drawprtldialog.ui"),
         mpDocShell          ( pDocSh ),
         ePO                 ( _ePO ),
-        aInputSet           ( *rStyleBase.GetItemSet().GetPool(), SID_PARAM_NUM_PRESET, SID_PARAM_CUR_NUM_LEVEL ),
+        aInputSet           ( *rStyleBase.GetItemSet().GetPool(), svl::Items<SID_PARAM_NUM_PRESET, SID_PARAM_CUR_NUM_LEVEL>{} ),
         pOutSet             ( nullptr ),
         pOrgSet             ( &rStyleBase.GetItemSet() )
 {
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 3f680f6871f2..cb562673ef43 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -100,10 +100,9 @@ SfxPrinter* DrawDocShell::GetPrinter(bool bCreate)
     {
         // create ItemSet with special pool area
         auto pSet = o3tl::make_unique<SfxItemSet>( GetPool(),
-                            SID_PRINTER_NOTFOUND_WARN,  SID_PRINTER_NOTFOUND_WARN,
+                            svl::Items<SID_PRINTER_NOTFOUND_WARN,  SID_PRINTER_NOTFOUND_WARN,
                             SID_PRINTER_CHANGESTODOC,   SID_PRINTER_CHANGESTODOC,
-                            ATTR_OPTIONS_PRINT,         ATTR_OPTIONS_PRINT,
-                            0 );
+                            ATTR_OPTIONS_PRINT,         ATTR_OPTIONS_PRINT>{} );
         // set PrintOptionsSet
         SdOptionsPrintItem aPrintItem( SD_MOD()->GetSdOptions(mpDoc->GetDocumentType()) );
         SfxFlagItem aFlagItem( SID_PRINTER_CHANGESTODOC );
diff --git a/sd/source/ui/func/fubullet.cxx b/sd/source/ui/func/fubullet.cxx
index 82f43477691c..1ef5ac6276ad 100644
--- a/sd/source/ui/func/fubullet.cxx
+++ b/sd/source/ui/func/fubullet.cxx
@@ -252,7 +252,7 @@ void FuBullet::InsertSpecialCharacter( SfxRequest& rReq )
                empty string). */
             pOV->InsertText( "" );
 
-            SfxItemSet aOldSet( mpDoc->GetPool(), EE_CHAR_FONTINFO, EE_CHAR_FONTINFO, 0 );
+            SfxItemSet aOldSet( mpDoc->GetPool(), svl::Items<EE_CHAR_FONTINFO, EE_CHAR_FONTINFO>{} );
             aOldSet.Put( pOV->GetAttribs() );
 
             ::svl::IUndoManager& rUndoMgr =  pOL->GetUndoManager();
diff --git a/sd/source/ui/func/fuconcs.cxx b/sd/source/ui/func/fuconcs.cxx
index ef7a9e9402b9..9536a691d1de 100644
--- a/sd/source/ui/func/fuconcs.cxx
+++ b/sd/source/ui/func/fuconcs.cxx
@@ -191,7 +191,7 @@ void FuConstructCustomShape::SetAttributes( SdrObject* pObj )
                             {
                                 const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
                                 SfxItemSet aDest( pObj->GetModel()->GetItemPool(),              // ranges from SdrAttrObj
-                                SDRATTR_START, SDRATTR_SHADOW_LAST,
+                                svl::Items<SDRATTR_START, SDRATTR_SHADOW_LAST,
                                 SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST,
                                 SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION,
                                 // Graphic Attributes
@@ -201,9 +201,7 @@ void FuConstructCustomShape::SetAttributes( SdrObject* pObj )
                                 // CustomShape properties
                                 SDRATTR_CUSTOMSHAPE_FIRST, SDRATTR_CUSTOMSHAPE_LAST,
                                 // range from SdrTextObj
-                                EE_ITEMS_START, EE_ITEMS_END,
-                                // end
-                                0, 0);
+                                EE_ITEMS_START, EE_ITEMS_END>{});
                                 aDest.Set( rSource );
                                 pObj->SetMergedItemSet( aDest );
                                 sal_Int32 nAngle = pSourceObj->GetRotateAngle();
diff --git a/sd/source/ui/func/fucopy.cxx b/sd/source/ui/func/fucopy.cxx
index 41ce0571c81a..505521b48ccb 100644
--- a/sd/source/ui/func/fucopy.cxx
+++ b/sd/source/ui/func/fucopy.cxx
@@ -77,7 +77,7 @@ void FuCopy::DoExecute( SfxRequest& rReq )
         if( !pArgs )
         {
             SfxItemSet aSet( mpViewShell->GetPool(),
-                                ATTR_COPY_START, ATTR_COPY_END, 0 );
+                                svl::Items<ATTR_COPY_START, ATTR_COPY_END>{} );
 
             // indicate color attribute
             SfxItemSet aAttr( mpDoc->GetPool() );
@@ -210,7 +210,7 @@ void FuCopy::DoExecute( SfxRequest& rReq )
 
             if( ( 1 == i ) && bColor )
             {
-                SfxItemSet aNewSet( mpViewShell->GetPool(), XATTR_FILLSTYLE, XATTR_FILLCOLOR, 0L );
+                SfxItemSet aNewSet( mpViewShell->GetPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLCOLOR>{} );
                 aNewSet.Put( XFillStyleItem( drawing::FillStyle_SOLID ) );
                 aNewSet.Put( XFillColorItem( OUString(), aStartColor ) );
                 mpView->SetAttributes( aNewSet );
@@ -272,7 +272,7 @@ void FuCopy::DoExecute( SfxRequest& rReq )
                 sal_uInt8 nGreen = aStartColor.GetGreen() + (sal_uInt8) ( ( (long) aEndColor.GetGreen() - (long) aStartColor.GetGreen() ) *  (long) i / (long) nNumber );
                 sal_uInt8 nBlue = aStartColor.GetBlue() + (sal_uInt8) ( ( (long) aEndColor.GetBlue() - (long) aStartColor.GetBlue() ) * (long) i / (long) nNumber );
                 Color aNewColor( nRed, nGreen, nBlue );
-                SfxItemSet aNewSet( mpViewShell->GetPool(), XATTR_FILLSTYLE, XATTR_FILLCOLOR, 0L );

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list