summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2017-06-16 09:58:13 +0200
committerStephan Bergmann <sbergman@redhat.com>2017-06-16 17:28:41 +0200
commit13bb5a4b09f5b2ad19dad1b55f45d0fe2b2fb908 (patch)
treed38ad18688a292ff6ccdfaa7c51080197ec95934 /sd
parentf83d8ae84584c0967e2346566d21d65d6d7a432f (diff)
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@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/dialogs-test.cxx10
-rw-r--r--sd/source/core/sdpage.cxx4
-rw-r--r--sd/source/core/sdpage2.cxx2
-rw-r--r--sd/source/core/stlsheet.cxx6
-rw-r--r--sd/source/ui/app/sdmod2.cxx10
-rw-r--r--sd/source/ui/dlg/dlgfield.cxx2
-rw-r--r--sd/source/ui/dlg/prltempl.cxx2
-rw-r--r--sd/source/ui/docshell/docshel4.cxx5
-rw-r--r--sd/source/ui/func/fubullet.cxx2
-rw-r--r--sd/source/ui/func/fuconcs.cxx6
-rw-r--r--sd/source/ui/func/fucopy.cxx6
-rw-r--r--sd/source/ui/func/fuexpand.cxx2
-rw-r--r--sd/source/ui/func/fumorph.cxx2
-rw-r--r--sd/source/ui/func/fuoaprms.cxx2
-rw-r--r--sd/source/ui/func/fuolbull.cxx6
-rw-r--r--sd/source/ui/func/fupage.cxx23
-rw-r--r--sd/source/ui/func/fuparagr.cxx5
-rw-r--r--sd/source/ui/func/fuprlout.cxx2
-rw-r--r--sd/source/ui/func/fuprobjs.cxx2
-rw-r--r--sd/source/ui/func/fuscale.cxx2
-rw-r--r--sd/source/ui/func/fusldlg.cxx2
-rw-r--r--sd/source/ui/func/fusnapln.cxx2
-rw-r--r--sd/source/ui/func/fusumry.cxx2
-rw-r--r--sd/source/ui/func/futext.cxx4
-rw-r--r--sd/source/ui/unoidl/UnoDocumentSettings.cxx5
-rw-r--r--sd/source/ui/unoidl/unopage.cxx4
-rw-r--r--sd/source/ui/unoidl/unopback.cxx10
-rw-r--r--sd/source/ui/view/drtxtob.cxx2
-rw-r--r--sd/source/ui/view/drtxtob1.cxx6
-rw-r--r--sd/source/ui/view/drviews2.cxx14
-rw-r--r--sd/source/ui/view/drviews3.cxx18
-rw-r--r--sd/source/ui/view/drviews4.cxx5
-rw-r--r--sd/source/ui/view/drviews7.cxx4
-rw-r--r--sd/source/ui/view/drviewsf.cxx2
-rw-r--r--sd/source/ui/view/drviewsi.cxx5
-rw-r--r--sd/source/ui/view/outlnvsh.cxx4
-rw-r--r--sd/source/ui/view/sdview.cxx4
-rw-r--r--sd/source/ui/view/sdview3.cxx4
-rw-r--r--sd/source/ui/view/sdview4.cxx2
39 files changed, 95 insertions, 105 deletions
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 );
+ SfxItemSet aNewSet( mpViewShell->GetPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLCOLOR>{} );
aNewSet.Put( XFillStyleItem( drawing::FillStyle_SOLID ) );
aNewSet.Put( XFillColorItem( OUString(), aNewColor ) );
mpView->SetAttributes( aNewSet );
diff --git a/sd/source/ui/func/fuexpand.cxx b/sd/source/ui/func/fuexpand.cxx
index a7b3dbcbb419..a6f73a44bb66 100644
--- a/sd/source/ui/func/fuexpand.cxx
+++ b/sd/source/ui/func/fuexpand.cxx
@@ -116,7 +116,7 @@ void FuExpandPage::DoExecute( SfxRequest& )
pOutl->SetText(*pParaObj);
// remove hard paragraph- and character attributes
- SfxItemSet aEmptyEEAttr(mpDoc->GetPool(), EE_ITEMS_START, EE_ITEMS_END);
+ SfxItemSet aEmptyEEAttr(mpDoc->GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{});
sal_Int32 nParaCount1 = pOutl->GetParagraphCount();
for (sal_Int32 nPara = 0; nPara < nParaCount1; nPara++)
diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx
index 84484652aab6..39a11f7da83c 100644
--- a/sd/source/ui/func/fumorph.cxx
+++ b/sd/source/ui/func/fumorph.cxx
@@ -343,7 +343,7 @@ void FuMorph::ImpInsertPolygons(
long nEndLineWidth = 0;
SdrPageView* pPageView = mpView->GetSdrPageView();
SfxItemPool & rPool = pObj1->GetObjectItemPool();
- SfxItemSet aSet1( rPool,SDRATTR_START,SDRATTR_NOTPERSIST_FIRST-1,EE_ITEMS_START,EE_ITEMS_END,0 );
+ SfxItemSet aSet1( rPool,svl::Items<SDRATTR_START,SDRATTR_NOTPERSIST_FIRST-1,EE_ITEMS_START,EE_ITEMS_END>{} );
SfxItemSet aSet2( aSet1 );
bool bLineColor = false;
bool bFillColor = false;
diff --git a/sd/source/ui/func/fuoaprms.cxx b/sd/source/ui/func/fuoaprms.cxx
index a58efa46b682..7ad003aa4b68 100644
--- a/sd/source/ui/func/fuoaprms.cxx
+++ b/sd/source/ui/func/fuoaprms.cxx
@@ -339,7 +339,7 @@ void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
if(!pArgs)
{
// fill ItemSet for dialog
- SfxItemSet aSet(mpDoc->GetPool(), ATTR_ANIMATION_START, ATTR_ACTION_END);
+ SfxItemSet aSet(mpDoc->GetPool(), svl::Items<ATTR_ANIMATION_START, ATTR_ACTION_END>{});
// fill the set
if (nAnimationSet == ATTR_SET)
diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index c15d2948573b..a9b36dcd63c3 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -77,7 +77,7 @@ void FuOutlineBullet::DoExecute( SfxRequest& rReq )
mpView->GetAttributes( aEditAttr );
SfxItemSet aNewAttr( mpViewShell->GetPool(),
- EE_ITEMS_START, EE_ITEMS_END );
+ svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
aNewAttr.Put( aEditAttr, false );
// create and execute dialog
@@ -150,7 +150,7 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq)
return;
}
- SfxItemSet aNewAttr( mpViewShell->GetPool(), EE_ITEMS_START, EE_ITEMS_END );
+ SfxItemSet aNewAttr( mpViewShell->GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
{
SfxItemSet aEditAttr( mpDoc->GetPool() );
mpView->GetAttributes( aEditAttr );
@@ -270,7 +270,7 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq)
if (bInMasterView && pNumRule)
{
- SfxItemSet aSetAttr( mpViewShell->GetPool(), EE_ITEMS_START, EE_ITEMS_END );
+ SfxItemSet aSetAttr( mpViewShell->GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
aSetAttr.Put(SvxNumBulletItem( *pNumRule, nNumItemId ));
mpView->SetAttributes(aSetAttr);
}
diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index 77ad9e4a990c..024afcc41ac4 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -212,15 +212,14 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent )
PageKind ePageKind = mpDrawViewShell->GetPageKind();
SfxItemSet aNewAttr(mpDoc->GetPool(),
- mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE),
- mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE),
- SID_ATTR_PAGE, SID_ATTR_PAGE_SHARED,
- SID_ATTR_BORDER_OUTER, SID_ATTR_BORDER_OUTER,
- SID_ATTR_BORDER_SHADOW, SID_ATTR_BORDER_SHADOW,
- XATTR_FILL_FIRST, XATTR_FILL_LAST,
- SID_ATTR_PAGE_COLOR,SID_ATTR_PAGE_FILLSTYLE,
- EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR,
- 0);
+ {{mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE),
+ mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE)},
+ {SID_ATTR_PAGE, SID_ATTR_PAGE_SHARED},
+ {SID_ATTR_BORDER_OUTER, SID_ATTR_BORDER_OUTER},
+ {SID_ATTR_BORDER_SHADOW, SID_ATTR_BORDER_SHADOW},
+ {XATTR_FILL_FIRST, XATTR_FILL_LAST},
+ {SID_ATTR_PAGE_COLOR,SID_ATTR_PAGE_FILLSTYLE},
+ {EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR}});
// Retrieve additional data for dialog
@@ -279,7 +278,7 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent )
p2 = pPtr[3];
pPtr += 2;
}
- SfxItemSet aMergedAttr( *aNewAttr.GetPool(), p1, p2 );
+ SfxItemSet aMergedAttr( *aNewAttr.GetPool(), {{p1, p2}} );
mergeItemSetsImpl( aMergedAttr, aNewAttr );
@@ -316,12 +315,12 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent )
int nError = aDlg.GetGraphic(aGraphic);
if( nError == ERRCODE_NONE )
{
- pTempSet.reset( new SfxItemSet( mpDoc->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, 0) );
+ pTempSet.reset( new SfxItemSet( mpDoc->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}) );
pTempSet->Put( XFillStyleItem( drawing::FillStyle_BITMAP ) );
// MigrateItemSet makes sure the XFillBitmapItem will have a unique name
- SfxItemSet aMigrateSet( mpDoc->GetPool(), XATTR_FILLBITMAP, XATTR_FILLBITMAP );
+ SfxItemSet aMigrateSet( mpDoc->GetPool(), svl::Items<XATTR_FILLBITMAP, XATTR_FILLBITMAP>{} );
aMigrateSet.Put(XFillBitmapItem(OUString("background"), aGraphic));
SdrModel::MigrateItemSet( &aMigrateSet, pTempSet.get(), mpDoc );
diff --git a/sd/source/ui/func/fuparagr.cxx b/sd/source/ui/func/fuparagr.cxx
index 9d0f39d8fff8..eb5158088d50 100644
--- a/sd/source/ui/func/fuparagr.cxx
+++ b/sd/source/ui/func/fuparagr.cxx
@@ -70,10 +70,9 @@ void FuParagraph::DoExecute( SfxRequest& rReq )
mpView->GetAttributes( aEditAttr );
SfxItemPool *pPool = aEditAttr.GetPool();
SfxItemSet aNewAttr( *pPool,
- EE_ITEMS_START, EE_ITEMS_END,
+ svl::Items<EE_ITEMS_START, EE_ITEMS_END,
SID_ATTR_TABSTOP_OFFSET, SID_ATTR_TABSTOP_OFFSET,
- ATTR_PARANUMBERING_START, ATTR_PARANUMBERING_END,
- 0 );
+ ATTR_PARANUMBERING_START, ATTR_PARANUMBERING_END>{} );
aNewAttr.Put( aEditAttr );
diff --git a/sd/source/ui/func/fuprlout.cxx b/sd/source/ui/func/fuprlout.cxx
index e615de959c54..b2b09be755e5 100644
--- a/sd/source/ui/func/fuprlout.cxx
+++ b/sd/source/ui/func/fuprlout.cxx
@@ -143,7 +143,7 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
bool bLoad = false; // appear the new master pages?
OUString aFile;
- SfxItemSet aSet(mpDoc->GetPool(), ATTR_PRESLAYOUT_START, ATTR_PRESLAYOUT_END);
+ SfxItemSet aSet(mpDoc->GetPool(), svl::Items<ATTR_PRESLAYOUT_START, ATTR_PRESLAYOUT_END>{});
aSet.Put( SfxBoolItem( ATTR_PRESLAYOUT_LOAD, bLoad));
aSet.Put( SfxBoolItem( ATTR_PRESLAYOUT_MASTER_PAGE, bMasterPage ) );
diff --git a/sd/source/ui/func/fuprobjs.cxx b/sd/source/ui/func/fuprobjs.cxx
index 7f8fed69b2a9..ba72af5aab2c 100644
--- a/sd/source/ui/func/fuprobjs.cxx
+++ b/sd/source/ui/func/fuprobjs.cxx
@@ -71,7 +71,7 @@ void FuPresentationObjects::DoExecute( SfxRequest& )
/* does the selections end in a unique presentation layout?
if not, it is not allowed to edit the templates */
- SfxItemSet aSet(mpDoc->GetItemPool(), SID_STATUS_LAYOUT, SID_STATUS_LAYOUT);
+ SfxItemSet aSet(mpDoc->GetItemPool(), svl::Items<SID_STATUS_LAYOUT, SID_STATUS_LAYOUT>{});
pOutlineViewShell->GetStatusBarState( aSet );
OUString aLayoutName = static_cast<const SfxStringItem&>(aSet.Get(SID_STATUS_LAYOUT)).GetValue();
DBG_ASSERT(!aLayoutName.isEmpty(), "Layout not defined");
diff --git a/sd/source/ui/func/fuscale.cxx b/sd/source/ui/func/fuscale.cxx
index e71d93a17378..7235a5c37ce7 100644
--- a/sd/source/ui/func/fuscale.cxx
+++ b/sd/source/ui/func/fuscale.cxx
@@ -69,7 +69,7 @@ void FuScale::DoExecute( SfxRequest& rReq )
if( !pArgs )
{
- SfxItemSet aNewAttr( mpDoc->GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM );
+ SfxItemSet aNewAttr( mpDoc->GetPool(), svl::Items<SID_ATTR_ZOOM, SID_ATTR_ZOOM>{} );
std::unique_ptr<SvxZoomItem> pZoomItem;
SvxZoomEnableFlags nZoomValues = SvxZoomEnableFlags::ALL;
diff --git a/sd/source/ui/func/fusldlg.cxx b/sd/source/ui/func/fusldlg.cxx
index 2ef0a548a184..c0ab1580bf6c 100644
--- a/sd/source/ui/func/fusldlg.cxx
+++ b/sd/source/ui/func/fusldlg.cxx
@@ -60,7 +60,7 @@ void FuSlideShowDlg::DoExecute( SfxRequest& )
{
PresentationSettings& rPresentationSettings = mpDoc->getPresentationSettings();
- SfxItemSet aDlgSet( mpDoc->GetPool(), ATTR_PRESENT_START, ATTR_PRESENT_END );
+ SfxItemSet aDlgSet( mpDoc->GetPool(), svl::Items<ATTR_PRESENT_START, ATTR_PRESENT_END>{} );
std::vector<OUString> aPageNameList(mpDoc->GetSdPageCount( PageKind::Standard ));
const OUString& rPresPage = rPresentationSettings.maPresPage;
OUString aFirstPage;
diff --git a/sd/source/ui/func/fusnapln.cxx b/sd/source/ui/func/fusnapln.cxx
index 25fe9b64a559..c06452231199 100644
--- a/sd/source/ui/func/fusnapln.cxx
+++ b/sd/source/ui/func/fusnapln.cxx
@@ -72,7 +72,7 @@ void FuSnapLine::DoExecute( SfxRequest& rReq )
if (!pArgs)
{
- SfxItemSet aNewAttr(mpViewShell->GetPool(), ATTR_SNAPLINE_START, ATTR_SNAPLINE_END);
+ SfxItemSet aNewAttr(mpViewShell->GetPool(), svl::Items<ATTR_SNAPLINE_START, ATTR_SNAPLINE_END>{});
bool bLineExist (false);
Point aLinePos;
diff --git a/sd/source/ui/func/fusumry.cxx b/sd/source/ui/func/fusumry.cxx
index 661e5ae13359..bb199e0b5438 100644
--- a/sd/source/ui/func/fusumry.cxx
+++ b/sd/source/ui/func/fusumry.cxx
@@ -194,7 +194,7 @@ void FuSummaryPage::DoExecute( SfxRequest& )
return;
// remove hard break- and character attributes
- SfxItemSet aEmptyEEAttr(mpDoc->GetPool(), EE_ITEMS_START, EE_ITEMS_END);
+ SfxItemSet aEmptyEEAttr(mpDoc->GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{});
sal_Int32 nParaCount = pOutl->GetParagraphCount();
for (sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index 647a67db86aa..488032f4bf54 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -532,7 +532,7 @@ void FuText::ImpSetAttributesForNewTextObject(SdrTextObj* pTxtObj)
void FuText::ImpSetAttributesFitToSize(SdrTextObj* pTxtObj)
{
// FitToSize (fit to frame)
- SfxItemSet aSet(mpViewShell->GetPool(), SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH);
+ SfxItemSet aSet(mpViewShell->GetPool(), svl::Items<SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH>{});
SdrFitToSizeType eFTS = SdrFitToSizeType::Proportional;
aSet.Put(SdrTextFitToSizeTypeItem(eFTS));
aSet.Put(makeSdrTextAutoGrowHeightItem(false));
@@ -544,7 +544,7 @@ void FuText::ImpSetAttributesFitToSize(SdrTextObj* pTxtObj)
void FuText::ImpSetAttributesFitToSizeVertical(SdrTextObj* pTxtObj)
{
SfxItemSet aSet(mpViewShell->GetPool(),
- SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH);
+ svl::Items<SDRATTR_TEXT_AUTOGROWHEIGHT, SDRATTR_TEXT_AUTOGROWWIDTH>{});
SdrFitToSizeType eFTS = SdrFitToSizeType::Proportional;
aSet.Put(SdrTextFitToSizeTypeItem(eFTS));
aSet.Put(makeSdrTextAutoGrowHeightItem(false));
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index 3958c469867a..3e0fcb8a7141 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -754,10 +754,9 @@ DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries,
else
{
pItemSet = o3tl::make_unique<SfxItemSet>(pDoc->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>{} );
}
pPrinter = SfxPrinter::Create ( aStream, std::move(pItemSet) );
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 081b25604a84..490b061ca422 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -2481,7 +2481,7 @@ void SdDrawPage::setBackground( const Any& rValue )
// is it our own implementation?
SdUnoPageBackground* pBack = SdUnoPageBackground::getImplementation( xSet );
- SfxItemSet aSet( GetModel()->GetDoc()->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST );
+ SfxItemSet aSet( GetModel()->GetDoc()->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{} );
if( pBack )
{
@@ -2867,7 +2867,7 @@ void SdMasterPage::setBackground( const Any& rValue )
// is it our own implementation?
SdUnoPageBackground* pBack = SdUnoPageBackground::getImplementation( xInputSet );
- SfxItemSet aSet( GetModel()->GetDoc()->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST );
+ SfxItemSet aSet( GetModel()->GetDoc()->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{} );
if( pBack )
{
diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx
index e588d0b1bc63..c31bd58cd661 100644
--- a/sd/source/ui/unoidl/unopback.cxx
+++ b/sd/source/ui/unoidl/unopback.cxx
@@ -60,7 +60,7 @@ SdUnoPageBackground::SdUnoPageBackground(
if( pDoc )
{
StartListening( *pDoc );
- mpSet = o3tl::make_unique<SfxItemSet>( pDoc->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST );
+ mpSet = o3tl::make_unique<SfxItemSet>( pDoc->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{} );
if( pSet )
mpSet->Put(*pSet);
@@ -101,7 +101,7 @@ void SdUnoPageBackground::fillItemSet( SdDrawDocument* pDoc, SfxItemSet& rSet )
StartListening( *pDoc );
mpDoc = pDoc;
- mpSet = o3tl::make_unique<SfxItemSet>( *rSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST );
+ mpSet = o3tl::make_unique<SfxItemSet>( *rSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{} );
if( mpPropSet->AreThereOwnUsrAnys() )
{
@@ -228,7 +228,7 @@ void SAL_CALL SdUnoPageBackground::setPropertyValue( const OUString& aPropertyNa
}
SfxItemPool& rPool = *mpSet->GetPool();
- SfxItemSet aSet( rPool, pEntry->nWID, pEntry->nWID);
+ SfxItemSet aSet( rPool, {{pEntry->nWID, pEntry->nWID}});
aSet.Put( *mpSet );
if( !aSet.Count() )
@@ -290,7 +290,7 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyValue( const OUString& Propert
else
{
SfxItemPool& rPool = *mpSet->GetPool();
- SfxItemSet aSet( rPool, pEntry->nWID, pEntry->nWID);
+ SfxItemSet aSet( rPool, {{pEntry->nWID, pEntry->nWID}});
aSet.Put( *mpSet );
if( !aSet.Count() )
@@ -418,7 +418,7 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyDefault( const OUString& aProp
else
{
SfxItemPool& rPool = *mpSet->GetPool();
- SfxItemSet aSet( rPool, pEntry->nWID, pEntry->nWID);
+ SfxItemSet aSet( rPool, {{pEntry->nWID, pEntry->nWID}});
aSet.Put( rPool.GetDefaultItem( pEntry->nWID ) );
aAny = SvxItemPropertySet_getPropertyValue( pEntry, aSet );
diff --git a/sd/source/ui/view/drtxtob.cxx b/sd/source/ui/view/drtxtob.cxx
index 33e8977c6292..de7c1e9db631 100644
--- a/sd/source/ui/view/drtxtob.cxx
+++ b/sd/source/ui/view/drtxtob.cxx
@@ -129,7 +129,7 @@ void TextObjectBar::GetCharState( SfxItemSet& rSet )
SfxItemSet aCharAttrSet( mpView->GetDoc().GetPool() );
mpView->GetAttributes( aCharAttrSet );
- SfxItemSet aNewAttr( mpViewShell->GetPool(),EE_ITEMS_START,EE_ITEMS_END);
+ SfxItemSet aNewAttr( mpViewShell->GetPool(),svl::Items<EE_ITEMS_START,EE_ITEMS_END>{});
aNewAttr.Put(aCharAttrSet, false);
rSet.Put(aNewAttr, false);
diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx
index 351b5a960b31..bcb39952be3e 100644
--- a/sd/source/ui/view/drtxtob1.cxx
+++ b/sd/source/ui/view/drtxtob1.cxx
@@ -267,7 +267,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
SvxLRSpaceItem aLRSpace = static_cast<const SvxLRSpaceItem&>(pArgs->Get(
GetPool().GetWhich(nSpaceSlot)));
- SfxItemSet aEditAttr( GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
+ SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} );
aLRSpace.SetWhich( EE_PARA_LRSPACE );
aEditAttr.Put( aLRSpace );
@@ -279,7 +279,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
case SID_HANGING_INDENT:
{
- SfxItemSet aLRSpaceSet( GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
+ SfxItemSet aLRSpaceSet( GetPool(), svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} );
mpView->GetAttributes( aLRSpaceSet );
SvxLRSpaceItem aParaMargin( static_cast<const SvxLRSpaceItem&>( aLRSpaceSet.Get( EE_PARA_LRSPACE ) ) );
@@ -324,7 +324,7 @@ void TextObjectBar::Execute( SfxRequest &rReq )
case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
{
mpView->SdrEndTextEdit();
- SfxItemSet aAttr( mpView->GetDoc().GetPool(), SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, 0 );
+ SfxItemSet aAttr( mpView->GetDoc().GetPool(), 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,
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index a674d8836db5..fb5f5b31eb33 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -313,7 +313,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
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 ) );
mpDrawView->SetAttributes( aSet );
@@ -321,7 +321,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
else // only for testing purpose
{
OSL_FAIL(" no value for hyphenation!");
- SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE );
+ SfxItemSet aSet( GetPool(), svl::Items<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE>{} );
bool bValue = true;
aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) );
mpDrawView->SetAttributes( aSet );
@@ -785,7 +785,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
pOutl->RemoveFields(checkSvxFieldData<SvxURLField>);
}
- pSet.reset(new SfxItemSet( GetPool(), EE_ITEMS_START, EE_ITEMS_END ));
+ pSet.reset(new SfxItemSet( GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} ));
mpDrawView->SetAttributes( *pSet, true );
}
else
@@ -806,7 +806,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if( pPresPage->IsPresObj( pObj ) )
{
- auto pNewSet = o3tl::make_unique<SfxItemSet>( GetDoc()->GetPool(), SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT, 0 );
+ auto pNewSet = o3tl::make_unique<SfxItemSet>( GetDoc()->GetPool(), svl::Items<SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_AUTOGROWHEIGHT>{} );
pNewSet->Put(pObj->GetMergedItemSet());
aAttrList.push_back(std::make_pair(std::move(pNewSet), pObj->GetUserCall()));
}
@@ -1283,7 +1283,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
case SID_CONNECTION_NEW_ROUTING:
{
- SfxItemSet aDefAttr( GetPool(), SDRATTR_EDGELINE1DELTA, SDRATTR_EDGELINE3DELTA );
+ SfxItemSet aDefAttr( GetPool(), svl::Items<SDRATTR_EDGELINE1DELTA, SDRATTR_EDGELINE3DELTA>{} );
GetView()->SetAttributes( aDefAttr, true ); // (ReplaceAll)
Cancel();
@@ -1387,7 +1387,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if (! pArgs)
{
- SfxItemSet aNewAttr( GetDoc()->GetPool(), ATTR_LAYER_START, ATTR_LAYER_END );
+ SfxItemSet aNewAttr( GetDoc()->GetPool(), svl::Items<ATTR_LAYER_START, ATTR_LAYER_END>{} );
aNewAttr.Put( makeSdAttrLayerName( aLayerName ) );
aNewAttr.Put( makeSdAttrLayerTitle() );
@@ -1555,7 +1555,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
if (! pArgs)
{
- SfxItemSet aNewAttr( GetDoc()->GetPool(), ATTR_LAYER_START, ATTR_LAYER_END );
+ SfxItemSet aNewAttr( GetDoc()->GetPool(), svl::Items<ATTR_LAYER_START, ATTR_LAYER_END>{} );
aNewAttr.Put( makeSdAttrLayerName( aLayerName ) );
aNewAttr.Put( makeSdAttrLayerTitle( aLayerTitle ) );
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx
index ab4aaf5f6936..8fd9640f62fe 100644
--- a/sd/source/ui/view/drviews3.cxx
+++ b/sd/source/ui/view/drviews3.cxx
@@ -657,7 +657,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
const SvxTabStopItem& rItem = static_cast<const SvxTabStopItem&>(
pArgs->Get( EE_PARA_TABS ));
- SfxItemSet aEditAttr( GetPool(), EE_PARA_TABS, EE_PARA_TABS );
+ SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_TABS, EE_PARA_TABS>{} );
aEditAttr.Put( rItem );
mpDrawView->SetAttributes( aEditAttr );
@@ -672,7 +672,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
SvxLineSpacingItem aParaLineSP = static_cast<const SvxLineSpacingItem&>(pArgs->Get(
GetPool().GetWhich(nSlot)));
- SfxItemSet aEditAttr( GetPool(), EE_PARA_SBL, EE_PARA_SBL );
+ SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_SBL, EE_PARA_SBL>{} );
aParaLineSP.SetWhich( EE_PARA_SBL );
aEditAttr.Put( aParaLineSP );
@@ -684,7 +684,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
case SID_ATTR_PARA_ADJUST_LEFT:
{
SvxAdjustItem aItem( SvxAdjust::Left, EE_PARA_JUST );
- SfxItemSet aEditAttr( GetPool(), EE_PARA_JUST, EE_PARA_JUST );
+ SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_JUST, EE_PARA_JUST>{} );
aEditAttr.Put( aItem );
mpDrawView->SetAttributes( aEditAttr );
@@ -695,7 +695,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
case SID_ATTR_PARA_ADJUST_CENTER:
{
SvxAdjustItem aItem( SvxAdjust::Center, EE_PARA_JUST );
- SfxItemSet aEditAttr( GetPool(), EE_PARA_JUST, EE_PARA_JUST );
+ SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_JUST, EE_PARA_JUST>{} );
aEditAttr.Put( aItem );
mpDrawView->SetAttributes( aEditAttr );
@@ -706,7 +706,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
case SID_ATTR_PARA_ADJUST_RIGHT:
{
SvxAdjustItem aItem( SvxAdjust::Right, EE_PARA_JUST );
- SfxItemSet aEditAttr( GetPool(), EE_PARA_JUST, EE_PARA_JUST );
+ SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_JUST, EE_PARA_JUST>{} );
aEditAttr.Put( aItem );
mpDrawView->SetAttributes( aEditAttr );
@@ -717,7 +717,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
case SID_ATTR_PARA_ADJUST_BLOCK:
{
SvxAdjustItem aItem( SvxAdjust::Block, EE_PARA_JUST );
- SfxItemSet aEditAttr( GetPool(), EE_PARA_JUST, EE_PARA_JUST );
+ SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_JUST, EE_PARA_JUST>{} );
aEditAttr.Put( aItem );
mpDrawView->SetAttributes( aEditAttr );
@@ -731,7 +731,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
sal_uInt16 nSlot = SID_ATTR_PARA_ULSPACE;
SvxULSpaceItem aULSP = static_cast<const SvxULSpaceItem&>(pArgs->Get(
GetPool().GetWhich(nSlot)));
- SfxItemSet aEditAttr( GetPool(), EE_PARA_ULSPACE, EE_PARA_ULSPACE );
+ SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_ULSPACE, EE_PARA_ULSPACE>{} );
aULSP.SetWhich( EE_PARA_ULSPACE );
aEditAttr.Put( aULSP );
@@ -747,7 +747,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
SvxLRSpaceItem aLRSpace = static_cast<const SvxLRSpaceItem&>(pArgs->Get(
GetPool().GetWhich(nSlot)));
- SfxItemSet aEditAttr( GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE );
+ SfxItemSet aEditAttr( GetPool(), svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} );
aLRSpace.SetWhich( EE_PARA_LRSPACE );
aEditAttr.Put( aLRSpace );
@@ -837,7 +837,7 @@ void DrawViewShell::ExecRuler(SfxRequest& rReq)
// only put lrSpace item
SfxItemSet aEditAttrReduced( GetDoc()->GetPool(),
- EE_PARA_LRSPACE, EE_PARA_LRSPACE );
+ svl::Items<EE_PARA_LRSPACE, EE_PARA_LRSPACE>{} );
aEditAttrReduced.Put( aLRSpaceItem );
mpDrawView->SetAttributes( aEditAttrReduced );
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index a89af7f4e69b..1dcd2aa8f3c5 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -835,10 +835,9 @@ void DrawViewShell::ShowMousePosInfo(const ::tools::Rectangle& rRect,
OSL_ASSERT (GetViewShell()!=nullptr);
if ( !GetViewShell()->GetUIActiveClient() )
{
- SfxItemSet aSet(GetPool(), SID_CONTEXT, SID_CONTEXT,
+ SfxItemSet aSet(GetPool(), svl::Items<SID_CONTEXT, SID_CONTEXT,
SID_ATTR_POSITION, SID_ATTR_POSITION,
- SID_ATTR_SIZE, SID_ATTR_SIZE,
- 0);
+ SID_ATTR_SIZE, SID_ATTR_SIZE>{});
GetStatusBarState(aSet);
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 976449563727..6e9d40f365e7 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -1546,7 +1546,7 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet )
SdPage* pPage = GetActualPage();
if (pPage != nullptr && GetDoc() != nullptr)
{
- SfxItemSet aMergedAttr(GetDoc()->GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, 0);
+ SfxItemSet aMergedAttr(GetDoc()->GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{});
SdStyleSheet* pStyleSheet = pPage->getPresentationStyle(HID_PSEUDOSHEET_BACKGROUND);
MergePageBackgroundFilling(pPage, pStyleSheet, meEditMode == EditMode::MasterPage, aMergedAttr);
if (drawing::FillStyle_BITMAP == static_cast<const XFillStyleItem&>(aMergedAttr.Get(XATTR_FILLSTYLE)).GetValue())
@@ -1751,7 +1751,7 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
XFillGradientItem aGradientItem( static_cast<const XFillGradientItem&>(pArgs->Get( XATTR_FILLGRADIENT )) );
// MigrateItemSet guarantees unique gradient names
- SfxItemSet aMigrateSet( mpDrawView->GetModel()->GetItemPool(), XATTR_FILLGRADIENT, XATTR_FILLGRADIENT );
+ SfxItemSet aMigrateSet( mpDrawView->GetModel()->GetItemPool(), svl::Items<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT>{} );
aMigrateSet.Put( aGradientItem );
SdrModel::MigrateItemSet( &aMigrateSet, pTempSet, mpDrawView->GetModel() );
diff --git a/sd/source/ui/view/drviewsf.cxx b/sd/source/ui/view/drviewsf.cxx
index e07c835f5ec1..dd57a075214c 100644
--- a/sd/source/ui/view/drviewsf.cxx
+++ b/sd/source/ui/view/drviewsf.cxx
@@ -571,7 +571,7 @@ void DrawViewShell::GetAttrState( SfxItemSet& rSet )
SfxItemSet aEditAttr( GetDoc()->GetPool() );
mpDrawView->GetAttributes( aEditAttr );
- SfxItemSet aNewAttr( GetPool(), EE_ITEMS_START, EE_ITEMS_END );
+ SfxItemSet aNewAttr( GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
aNewAttr.Put( aEditAttr, false );
std::unique_ptr<SvxNumRule> pNumRule;
diff --git a/sd/source/ui/view/drviewsi.cxx b/sd/source/ui/view/drviewsi.cxx
index fe10d917541c..48e403f7ceb6 100644
--- a/sd/source/ui/view/drviewsi.cxx
+++ b/sd/source/ui/view/drviewsi.cxx
@@ -121,8 +121,7 @@ void DrawViewShell::AssignFrom3DWindow()
if(!GetView()->IsPresObjSelected())
{
SfxItemSet aSet( GetDoc()->GetPool(),
- SDRATTR_START, SDRATTR_END,
- 0, 0);
+ svl::Items<SDRATTR_START, SDRATTR_END>{});
p3DWin->GetAttr( aSet );
// own UNDO-compounding also around transformation in 3D
@@ -132,7 +131,7 @@ void DrawViewShell::AssignFrom3DWindow()
{
// assign only text-attribute
SfxItemSet aTextSet( GetDoc()->GetPool(),
- EE_ITEMS_START, EE_ITEMS_END, 0 );
+ svl::Items<EE_ITEMS_START, EE_ITEMS_END>{} );
aTextSet.Put( aSet, false );
GetView()->SetAttributes( aTextSet );
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx
index 0ce3e37e7631..328c2b101857 100644
--- a/sd/source/ui/view/outlnvsh.cxx
+++ b/sd/source/ui/view/outlnvsh.cxx
@@ -832,7 +832,7 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet )
// does the selection provide a unique presentation layout?
// if not, the templates must not be edited
- SfxItemSet aSet(*rSet.GetPool(), SID_STATUS_LAYOUT, SID_STATUS_LAYOUT);
+ SfxItemSet aSet(*rSet.GetPool(), svl::Items<SID_STATUS_LAYOUT, SID_STATUS_LAYOUT>{});
GetStatusBarState(aSet);
OUString aTest = static_cast<const SfxStringItem&>(aSet.Get(SID_STATUS_LAYOUT)).GetValue();
if (aTest.isEmpty())
@@ -1477,7 +1477,7 @@ void OutlineViewShell::GetAttrState( SfxItemSet& rSet )
SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get());
if (pFamilyItem && static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO)
{
- SfxItemSet aSet(*rSet.GetPool(), SID_STATUS_LAYOUT, SID_STATUS_LAYOUT);
+ SfxItemSet aSet(*rSet.GetPool(), svl::Items<SID_STATUS_LAYOUT, SID_STATUS_LAYOUT>{});
GetStatusBarState(aSet);
OUString aRealStyle = static_cast<const SfxStringItem&>(aSet.Get(SID_STATUS_LAYOUT)).GetValue();
if (aRealStyle.isEmpty())
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index 8d6543a45744..bc7467e4045e 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -991,8 +991,8 @@ bool View::IsMorphingAllowed() const
( nKind1 != OBJ_CAPTION && nKind2 != OBJ_CAPTION ) &&
dynamic_cast< const E3dObject *>( pObj1 ) == nullptr && dynamic_cast< const E3dObject *>( pObj2 ) == nullptr )
{
- SfxItemSet aSet1( mrDoc.GetPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE );
- SfxItemSet aSet2( mrDoc.GetPool(), XATTR_FILLSTYLE, XATTR_FILLSTYLE );
+ SfxItemSet aSet1( mrDoc.GetPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLSTYLE>{} );
+ SfxItemSet aSet2( mrDoc.GetPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLSTYLE>{} );
aSet1.Put(pObj1->GetMergedItemSet());
aSet2.Put(pObj2->GetMergedItemSet());
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index 34a6cc857c01..cff977eb1461 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -790,8 +790,8 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
if( dynamic_cast< E3dObject *>( pPickObj ) != nullptr && dynamic_cast< E3dObject *>( pObj ) != nullptr )
{
// handle 3D attribute in addition
- SfxItemSet aNewSet( mrDoc.GetPool(), SID_ATTR_3D_START, SID_ATTR_3D_END, 0 );
- SfxItemSet aOldSet( mrDoc.GetPool(), SID_ATTR_3D_START, SID_ATTR_3D_END, 0 );
+ SfxItemSet aNewSet( mrDoc.GetPool(), svl::Items<SID_ATTR_3D_START, SID_ATTR_3D_END>{} );
+ SfxItemSet aOldSet( mrDoc.GetPool(), svl::Items<SID_ATTR_3D_START, SID_ATTR_3D_END>{} );
aOldSet.Put(pPickObj->GetMergedItemSet());
aNewSet.Put( pObj->GetMergedItemSet() );
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index 051a3cc0e5e3..3d98ee66ea4f 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -161,7 +161,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
EndUndo();
}
- SfxItemSet aSet(mpDocSh->GetPool(), XATTR_FILLSTYLE, XATTR_FILLBITMAP);
+ SfxItemSet aSet(mpDocSh->GetPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLBITMAP>{});
aSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
aSet.Put(XFillBitmapItem(rGraphic));