[Libreoffice-commits] core.git: editeng/source include/svl reportdesign/source sd/source sfx2/source svl/source svx/source sw/qa sw/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jul 15 16:54:16 UTC 2021
editeng/source/editeng/impedit4.cxx | 6 ++--
editeng/source/uno/unoipset.cxx | 2 -
editeng/source/uno/unotext.cxx | 2 -
include/svl/itemset.hxx | 2 -
reportdesign/source/ui/misc/UITools.cxx | 2 -
sd/source/core/stlsheet.cxx | 6 ++--
sd/source/ui/func/fupage.cxx | 18 +++++++-------
sd/source/ui/unoidl/unopback.cxx | 6 ++--
sfx2/source/control/bindings.cxx | 2 -
sfx2/source/control/shell.cxx | 4 +--
svl/source/items/itemset.cxx | 20 ----------------
svx/source/sdr/properties/defaultproperties.cxx | 4 +--
svx/source/table/cell.cxx | 6 ++--
svx/source/unodraw/UnoNameItemTable.cxx | 2 -
svx/source/unodraw/unoshape.cxx | 6 ++--
sw/qa/core/doc/doc.cxx | 3 +-
sw/source/core/attr/swatrset.cxx | 2 -
sw/source/core/doc/DocumentContentOperationsManager.cxx | 2 -
sw/source/core/doc/docfmt.cxx | 4 +--
sw/source/core/edit/edlingu.cxx | 4 +--
sw/source/core/txtnode/txtedt.cxx | 2 -
sw/source/core/unocore/unodraw.cxx | 2 -
sw/source/core/unocore/unoobj.cxx | 2 -
sw/source/core/unocore/unosect.cxx | 4 +--
sw/source/core/unocore/unostyle.cxx | 6 ++--
sw/source/core/unocore/unotbl.cxx | 4 +--
sw/source/filter/ww8/ww8par.cxx | 2 -
sw/source/ui/index/swuiidxmrk.cxx | 2 -
sw/source/uibase/docvw/edtwin.cxx | 2 -
sw/source/uibase/shells/langhelper.cxx | 2 -
sw/source/uibase/shells/tabsh.cxx | 2 -
31 files changed, 56 insertions(+), 77 deletions(-)
New commits:
commit 7d1692179e7cdca19ab34fdc9701512656f01861
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Jul 15 15:06:11 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Jul 15 18:53:39 2021 +0200
drop the Pair constructor from SfxItemSet
just so we have one fewer odd constructors here
Change-Id: I81278e9436747a4eb46a33da9bfec7a8b30079b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118982
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 8a6e0a68baca..cc44ac847163 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -2108,7 +2108,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView const & 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 );
@@ -2116,7 +2116,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView const & 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 );
}
@@ -2150,7 +2150,7 @@ void ImpEditEngine::ApplyChangedSentence(EditView const & 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(rCurrentNewPortion.eLanguage, nLangWhichId));
SetAttribs( aCurrentPaM, aSet );
}
diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx
index cdc1bac825df..3f524805f4ed 100644
--- a/editeng/source/uno/unoipset.cxx
+++ b/editeng/source/uno/unoipset.cxx
@@ -197,7 +197,7 @@ uno::Any SvxItemPropertySet::getPropertyValue( const SfxItemPropertyMapEntry* pM
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 cf9ea10a601e..0a3d7f215058 100644
--- a/editeng/source/uno/unotext.cxx
+++ b/editeng/source/uno/unotext.cxx
@@ -1255,7 +1255,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/include/svl/itemset.hxx b/include/svl/itemset.hxx
index efae21b3be61..6c1116fb009c 100644
--- a/include/svl/itemset.hxx
+++ b/include/svl/itemset.hxx
@@ -134,7 +134,6 @@ protected:
SfxItemSet( SfxItemPool&, SfxAllItemSetFlag );
public:
- struct Pair { sal_uInt16 wid1, wid2; };
SfxItemSet( const SfxItemSet& );
SfxItemSet( SfxItemSet&& ) noexcept;
SfxItemSet( SfxItemPool& );
@@ -151,7 +150,6 @@ public:
svl::Items<WIDs...>)
: SfxItemSet(pool, WhichRangesContainer(svl::Items<WIDs...>::value), 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 6be0594813f6..a9fc081556fb 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -776,7 +776,7 @@ bool openAreaDialog( const uno::Reference<report::XShape >& _xShape,const uno::R
try
{
SfxItemPool& rItemPool = pModel->GetItemPool();
- SfxItemSet aDescriptor( rItemPool, {{rItemPool.GetFirstWhich(),rItemPool.GetLastWhich()}} );
+ SfxItemSet aDescriptor( rItemPool, rItemPool.GetFirstWhich(), rItemPool.GetLastWhich() );
lcl_fillShapeToItems(_xShape, aDescriptor);
{ // want the dialog to be destroyed before our set
diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx
index eb578bdc3d31..9bd424e12a1f 100644
--- a/sd/source/core/stlsheet.cxx
+++ b/sd/source/core/stlsheet.cxx
@@ -1024,7 +1024,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() )
@@ -1130,7 +1130,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();
@@ -1328,7 +1328,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/func/fupage.cxx b/sd/source/ui/func/fupage.cxx
index 982fab729734..b37ee29fb5ff 100644
--- a/sd/source/ui/func/fupage.cxx
+++ b/sd/source/ui/func/fupage.cxx
@@ -200,15 +200,15 @@ const SfxItemSet* FuPage::ExecuteDialog(weld::Window* pParent, const SfxRequest&
if (!mpDrawViewShell)
return nullptr;
- SfxItemSet aNewAttr(mpDoc->GetPool(), {
- { XATTR_FILL_FIRST, XATTR_FILL_LAST },
- { EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR },
- { SID_ATTR_BORDER_OUTER, SID_ATTR_BORDER_OUTER },
- { SID_ATTR_BORDER_SHADOW, SID_ATTR_BORDER_SHADOW },
- { SID_ATTR_PAGE, SID_ATTR_PAGE_SHARED },
- { SID_ATTR_CHAR_GRABBAG, SID_ATTR_CHAR_GRABBAG },
- { SID_ATTR_PAGE_COLOR, SID_ATTR_PAGE_FILLSTYLE },
- });
+ SfxItemSet aNewAttr(mpDoc->GetPool(), svl::Items<
+ XATTR_FILL_FIRST, XATTR_FILL_LAST,
+ EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR,
+ SID_ATTR_BORDER_OUTER, SID_ATTR_BORDER_OUTER,
+ SID_ATTR_BORDER_SHADOW, SID_ATTR_BORDER_SHADOW,
+ SID_ATTR_PAGE, SID_ATTR_PAGE_SHARED,
+ SID_ATTR_CHAR_GRABBAG, SID_ATTR_CHAR_GRABBAG,
+ SID_ATTR_PAGE_COLOR, SID_ATTR_PAGE_FILLSTYLE
+ >{});
// Keep it sorted
aNewAttr.MergeRange(mpDoc->GetPool().GetWhich(SID_ATTR_LRSPACE),
mpDoc->GetPool().GetWhich(SID_ATTR_ULSPACE));
diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx
index 573e22411066..99d4042ad4a8 100644
--- a/sd/source/ui/unoidl/unopback.cxx
+++ b/sd/source/ui/unoidl/unopback.cxx
@@ -211,7 +211,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() )
@@ -271,7 +271,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() )
@@ -393,7 +393,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/sfx2/source/control/bindings.cxx b/sfx2/source/control/bindings.cxx
index 042684647114..b217534376d2 100644
--- a/sfx2/source/control/bindings.cxx
+++ b/sfx2/source/control/bindings.cxx
@@ -987,7 +987,7 @@ void SfxBindings::Execute_Impl( SfxRequest& aReq, const SfxSlot* pSlot, SfxShell
{
// The value is attached to a toggleable attribute (Bools)
sal_uInt16 nWhich = pSlot->GetWhich(rPool);
- SfxItemSet aSet(rPool, {{nWhich, nWhich}});
+ SfxItemSet aSet(rPool, nWhich, nWhich);
SfxStateFunc pFunc = pSlot->GetStateFnc();
(*pFunc)(pShell, aSet);
const SfxPoolItem *pOldItem;
diff --git a/sfx2/source/control/shell.cxx b/sfx2/source/control/shell.cxx
index 118e205cd3ff..a3bcc266f5e4 100644
--- a/sfx2/source/control/shell.cxx
+++ b/sfx2/source/control/shell.cxx
@@ -396,7 +396,7 @@ bool SfxShell::CanExecuteSlot_Impl( const SfxSlot &rSlot )
// Get Slot status
SfxItemPool &rPool = GetPool();
const sal_uInt16 nId = rSlot.GetWhich( rPool );
- SfxItemSet aSet(rPool, {{nId, nId}});
+ SfxItemSet aSet(rPool, nId, nId);
SfxStateFunc pFunc = rSlot.GetStateFnc();
(*pFunc)( this, aSet );
return aSet.GetItemState(nId) != SfxItemState::DISABLED;
@@ -484,7 +484,7 @@ const SfxPoolItem* SfxShell::GetSlotState
// Get Item and Item status
const SfxPoolItem *pItem = nullptr;
- SfxItemSet aSet( rPool, {{nSlotId, nSlotId}} ); // else pItem dies too soon
+ SfxItemSet aSet( rPool, nSlotId, nSlotId ); // else pItem dies too soon
if ( nullptr != pSlot )
{
// Call Status method
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx
index 66673ad69968..b2fb14f5c73f 100644
--- a/svl/source/items/itemset.cxx
+++ b/svl/source/items/itemset.cxx
@@ -145,26 +145,6 @@ SfxItemSet::SfxItemSet(
m_pItems.reset( new SfxPoolItem const *[size]{} );
}
-SfxItemSet::SfxItemSet(
- SfxItemPool & pool, std::initializer_list<Pair> wids):
- m_pPool(&pool), m_pParent(nullptr),
- m_nCount(0)
-{
- assert(wids.size() != 0);
- std::unique_ptr<WhichPair[]> xPairs = std::make_unique<WhichPair[]>(wids.size());
- std::size_t i = 0;
- std::size_t size = 0;
- for (auto const & p: wids) {
- xPairs[i++] = { p.wid1, p.wid2 };
- size += svl::detail::rangeSize(p.wid1, p.wid2);
- // cannot overflow, assuming std::size_t is no smaller than
- // sal_uInt16
- }
- m_pWhichRanges = WhichRangesContainer(std::move(xPairs), wids.size());
- assert(svl::detail::validRanges2(m_pWhichRanges));
- m_pItems.reset( new SfxPoolItem const *[size]{} );
-}
-
SfxItemSet::SfxItemSet( SfxItemPool& rPool, const sal_uInt16* pWhichPairTable )
: m_pPool(&rPool)
, m_pParent(nullptr)
diff --git a/svx/source/sdr/properties/defaultproperties.cxx b/svx/source/sdr/properties/defaultproperties.cxx
index b12e7bd5b82d..d20d75f4f8cf 100644
--- a/svx/source/sdr/properties/defaultproperties.cxx
+++ b/svx/source/sdr/properties/defaultproperties.cxx
@@ -115,7 +115,7 @@ namespace sdr::properties
ItemChange(nWhichID, &rItem);
PostItemChange(nWhichID);
- SfxItemSet aSet(GetSdrObject().GetObjectItemPool(), {{nWhichID, nWhichID}});
+ SfxItemSet aSet(GetSdrObject().GetObjectItemPool(), nWhichID, nWhichID);
aSet.Put(rItem);
ItemSetChanged(aSet);
}
@@ -140,7 +140,7 @@ namespace sdr::properties
if(nWhich)
{
- SfxItemSet aSet(GetSdrObject().GetObjectItemPool(), {{nWhich, nWhich}});
+ SfxItemSet aSet(GetSdrObject().GetObjectItemPool(), nWhich, nWhich);
ItemSetChanged(aSet);
}
}
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 9b025032525d..87bf71c431cd 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -1117,7 +1117,7 @@ void SAL_CALL Cell::setPropertyValue( const OUString& rPropertyName, const Any&
}
default:
{
- SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), {{pMap->nWID, pMap->nWID}});
+ SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID);
aSet.Put(mpProperties->GetItem(pMap->nWID));
bool bSpecial = false;
@@ -1237,7 +1237,7 @@ Any SAL_CALL Cell::getPropertyValue( const OUString& PropertyName )
}
default:
{
- SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), {{pMap->nWID, pMap->nWID}});
+ SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID);
aSet.Put(mpProperties->GetItem(pMap->nWID));
Any aAny;
@@ -1565,7 +1565,7 @@ Any SAL_CALL Cell::getPropertyDefault( const OUString& aPropertyName )
{
if( SfxItemPool::IsWhich(pMap->nWID) )
{
- SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), {{pMap->nWID, pMap->nWID}});
+ SfxItemSet aSet(GetObject().getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID);
aSet.Put(GetObject().getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID));
return GetAnyForItem( aSet, pMap );
}
diff --git a/svx/source/unodraw/UnoNameItemTable.cxx b/svx/source/unodraw/UnoNameItemTable.cxx
index ac13c30ea88b..dfa75c460f66 100644
--- a/svx/source/unodraw/UnoNameItemTable.cxx
+++ b/svx/source/unodraw/UnoNameItemTable.cxx
@@ -99,7 +99,7 @@ sal_Bool SAL_CALL SvxUnoNameItemTable::supportsService( const OUString& Service
void SvxUnoNameItemTable::ImplInsertByName( const OUString& aName, const uno::Any& aElement )
{
- maItemSetVector.push_back( std::make_unique< SfxItemSet >( *mpModelPool, std::initializer_list<SfxItemSet::Pair>{{mnWhich, mnWhich}} ) );
+ maItemSetVector.push_back( std::make_unique< SfxItemSet >( *mpModelPool, mnWhich, mnWhich ) );
std::unique_ptr<NameOrIndex> xNewItem(createItem());
xNewItem->SetName(aName);
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 32e3a5c6768a..6974ce0f11fd 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -1387,7 +1387,7 @@ bool SvxShape::SetFillAttribute( sal_uInt16 nWID, const OUString& rName )
{
if(HasSdrObject())
{
- SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), {{nWID, nWID}} );
+ SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), nWID, nWID );
if( SetFillAttribute( nWID, rName, aSet, &GetSdrObject()->getSdrModelFromSdrObject() ) )
{
@@ -1730,7 +1730,7 @@ uno::Any SvxShape::_getPropertyValue( const OUString& PropertyName )
DBG_ASSERT( pMap->nWID == SDRATTR_TEXTDIRECTION || (pMap->nWID < SDRATTR_NOTPERSIST_FIRST || pMap->nWID > SDRATTR_NOTPERSIST_LAST), "Not persist item not handled!" );
DBG_ASSERT( pMap->nWID < OWN_ATTR_VALUE_START || pMap->nWID > OWN_ATTR_VALUE_END, "Not item property not handled!" );
- SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), {{pMap->nWID, pMap->nWID}});
+ SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID );
aSet.Put(GetSdrObject()->GetMergedItem(pMap->nWID));
if(SvxUnoTextRangeBase::GetPropertyValueHelper( aSet, pMap, aAny ))
@@ -3067,7 +3067,7 @@ uno::Any SvxShape::_getPropertyDefault( const OUString& aPropertyName )
if(!SfxItemPool::IsWhich(pMap->nWID))
throw beans::UnknownPropertyException( "No WhichID " + OUString::number(pMap->nWID) + " for " + aPropertyName, static_cast<cppu::OWeakObject*>(this));
- SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), {{pMap->nWID, pMap->nWID}});
+ SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID );
aSet.Put(GetSdrObject()->getSdrModelFromSdrObject().GetItemPool().GetDefaultItem(pMap->nWID));
return GetAnyForItem( aSet, pMap );
diff --git a/sw/qa/core/doc/doc.cxx b/sw/qa/core/doc/doc.cxx
index 00b8df8a3c41..faf6b822e7c1 100644
--- a/sw/qa/core/doc/doc.cxx
+++ b/sw/qa/core/doc/doc.cxx
@@ -103,7 +103,8 @@ CPPUNIT_TEST_FIXTURE(SwCoreDocTest, testLocaleIndependentTemplate)
SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "locale-independent-template.odt");
SwDocShell* pDocShell = pDoc->GetDocShell();
SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
- SfxItemSet aSet(pWrtShell->GetAttrPool(), { { RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE } });
+ SfxItemSet aSet(pWrtShell->GetAttrPool(),
+ svl::Items<RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE>{});
pWrtShell->GetCurAttr(aSet);
const SvxLanguageItem* pItem = aSet.GetItem(RES_CHRATR_LANGUAGE);
CPPUNIT_ASSERT(pItem);
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index b49043c029ce..f09d9111e8eb 100644
--- a/sw/source/core/attr/swatrset.cxx
+++ b/sw/source/core/attr/swatrset.cxx
@@ -93,7 +93,7 @@ SwAttrPool::~SwAttrPool()
}
SwAttrSet::SwAttrSet( SwAttrPool& rPool, sal_uInt16 nWh1, sal_uInt16 nWh2 )
- : SfxItemSet( rPool, {{nWh1, nWh2}} ), m_pOldSet( nullptr ), m_pNewSet( nullptr )
+ : SfxItemSet( rPool, nWh1, nWh2 ), m_pOldSet( nullptr ), m_pNewSet( nullptr )
{
}
diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx
index 02a336e8a0e6..ef0c4c1f3648 100644
--- a/sw/source/core/doc/DocumentContentOperationsManager.cxx
+++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx
@@ -3346,7 +3346,7 @@ bool DocumentContentOperationsManager::InsertPoolItem(
pUndoAttr.reset(new SwUndoAttr( rRg, rHt, nFlags ));
}
- SfxItemSet aSet( m_rDoc.GetAttrPool(), {{rHt.Which(), rHt.Which()}} );
+ SfxItemSet aSet( m_rDoc.GetAttrPool(), rHt.Which(), rHt.Which() );
aSet.Put( rHt );
const bool bRet = lcl_InsAttr(m_rDoc, rRg, aSet, nFlags, pUndoAttr.get(), pLayout, ppNewTextAttr);
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index f643d9750b90..fd6346b33ffc 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -450,7 +450,7 @@ bool SwDoc::UpdateParRsid( SwTextNode *pTextNode, sal_uInt32 nVal )
/// If Undo is enabled, the old values is added to the Undo history.
void SwDoc::SetAttr( const SfxPoolItem& rAttr, SwFormat& rFormat )
{
- SfxItemSet aSet( GetAttrPool(), {{rAttr.Which(), rAttr.Which()}} );
+ SfxItemSet aSet( GetAttrPool(), rAttr.Which(), rAttr.Which() );
aSet.Put( rAttr );
SetAttr( aSet, rFormat );
}
@@ -526,7 +526,7 @@ static bool lcl_SetNewDefTabStops( SwTwips nOldWidth, SwTwips nNewWidth,
/// If Undo is enabled, the old value is added to the Undo history.
void SwDoc::SetDefault( const SfxPoolItem& rAttr )
{
- SfxItemSet aSet( GetAttrPool(), {{rAttr.Which(), rAttr.Which()}} );
+ SfxItemSet aSet( GetAttrPool(), rAttr.Which(), rAttr.Which() );
aSet.Put( rAttr );
SetDefault( aSet );
}
diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx
index 51e63d16c6f3..71a5ae401010 100644
--- a/sw/source/core/edit/edlingu.cxx
+++ b/sw/source/core/edit/edlingu.cxx
@@ -1196,7 +1196,7 @@ void SwEditShell::ApplyChangedSentence(const svx::SpellPortions& rNewPortions, b
case SvtScriptType::COMPLEX : nLangWhichId = RES_CHRATR_CTL_LANGUAGE; break;
default: break;
}
- SfxItemSet aSet(GetAttrPool(), {{nLangWhichId, nLangWhichId}});
+ SfxItemSet aSet(GetAttrPool(), nLangWhichId, nLangWhichId);
GetCurAttr( aSet );
const SvxLanguageItem& rLang = static_cast<const SvxLanguageItem& >(aSet.Get(nLangWhichId));
if(rLang.GetLanguage() != rCurrentNewPortion.eLanguage)
@@ -1516,7 +1516,7 @@ static LanguageType lcl_GetLanguage(SwEditShell& rSh)
case SvtScriptType::COMPLEX : nLangWhichId = RES_CHRATR_CTL_LANGUAGE; break;
default: break;
}
- SfxItemSet aSet(rSh.GetAttrPool(), {{nLangWhichId, nLangWhichId}});
+ SfxItemSet aSet(rSh.GetAttrPool(), nLangWhichId, nLangWhichId);
rSh.GetCurAttr( aSet );
const SvxLanguageItem& rLang = static_cast<const SvxLanguageItem& >(aSet.Get(nLangWhichId));
return rLang.GetLanguage();
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index c98946a40113..52f1e213d221 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1069,7 +1069,7 @@ void SwTextNode::SetLanguageAndFont( const SwPaM &rPaM,
const vcl::Font *pFont, sal_uInt16 nFontWhichId )
{
SwEditShell *pEditShell = GetDoc().GetEditShell();
- SfxItemSet aSet(pEditShell->GetAttrPool(), { { nLangWhichId, nLangWhichId } });
+ SfxItemSet aSet(pEditShell->GetAttrPool(), nLangWhichId, nLangWhichId );
if (pFont)
aSet.MergeRange(nFontWhichId, nFontWhichId); // Keep it sorted
aSet.Put( SvxLanguageItem( nLang, nLangWhichId ) );
diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx
index 6faa27465851..8a961b11affa 100644
--- a/sw/source/core/unocore/unodraw.cxx
+++ b/sw/source/core/unocore/unodraw.cxx
@@ -1885,7 +1885,7 @@ void SwXShape::setPropertyToDefault( const OUString& rPropertyName )
if(pFormat)
{
const SfxItemSet& rSet = pFormat->GetAttrSet();
- SfxItemSet aSet(pFormat->GetDoc()->GetAttrPool(), {{pEntry->nWID, pEntry->nWID}});
+ SfxItemSet aSet(pFormat->GetDoc()->GetAttrPool(), pEntry->nWID, pEntry->nWID);
aSet.SetParent(&rSet);
aSet.ClearItem(pEntry->nWID);
pFormat->GetDoc()->SetAttr(aSet, *pFormat);
diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx
index 695095295c19..38bfe951f343 100644
--- a/sw/source/core/unocore/unoobj.cxx
+++ b/sw/source/core/unocore/unoobj.cxx
@@ -1910,7 +1910,7 @@ SwUnoCursorHelper::GetPropertyStates(
case SW_PROPERTY_STATE_CALLER_SINGLE_VALUE_ONLY:
pSet.reset(
new SfxItemSet( rPaM.GetDoc().GetAttrPool(),
- {{pEntry->nWID, pEntry->nWID}} ));
+ pEntry->nWID, pEntry->nWID ));
break;
default:
pSet.reset( new SfxItemSet(
diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx
index 1cd3f8d50a20..0fa7e6fb7966 100644
--- a/sw/source/core/unocore/unosect.cxx
+++ b/sw/source/core/unocore/unosect.cxx
@@ -836,7 +836,7 @@ void SwXTextSection::Impl::SetPropertyValues_Impl(
if (pFormat)
{
const SfxItemSet& rOldAttrSet = pFormat->GetAttrSet();
- pItemSet.reset( new SfxItemSet(*rOldAttrSet.GetPool(), {{pEntry->nWID, pEntry->nWID}}));
+ pItemSet.reset( new SfxItemSet(*rOldAttrSet.GetPool(), pEntry->nWID, pEntry->nWID));
pItemSet->Put(rOldAttrSet);
m_rPropSet.setPropertyValue(*pEntry,
pValues[nProperty], *pItemSet);
@@ -1568,7 +1568,7 @@ SwXTextSection::setPropertyToDefault(const OUString& rPropertyName)
if (pFormat)
{
const SfxItemSet& rOldAttrSet = pFormat->GetAttrSet();
- pNewAttrSet.reset( new SfxItemSet(*rOldAttrSet.GetPool(), {{pEntry->nWID, pEntry->nWID}}));
+ pNewAttrSet.reset( new SfxItemSet(*rOldAttrSet.GetPool(), pEntry->nWID, pEntry->nWID));
pNewAttrSet->ClearItem(pEntry->nWID);
}
else
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 86d9381b8573..724bd28831f4 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1612,7 +1612,7 @@ void SwXStyle::SetPropertyValue<HINT_BEGIN>(const SfxItemPropertyMapEntry& rEntr
{
// default ItemSet handling
SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet();
- SfxItemSet aSet(*rStyleSet.GetPool(), {{rEntry.nWID, rEntry.nWID}});
+ SfxItemSet aSet(*rStyleSet.GetPool(), rEntry.nWID, rEntry.nWID);
aSet.SetParent(&rStyleSet);
rPropSet.setPropertyValue(rEntry, rValue, aSet);
rStyleSet.Put(aSet);
@@ -1721,7 +1721,7 @@ void SwXStyle::SetPropertyValue<sal_uInt16(RES_PAPER_BIN)>(const SfxItemProperty
if(nBin == std::numeric_limits<printeridx_t>::max())
throw lang::IllegalArgumentException();
SfxItemSet& rStyleSet = o_rStyleBase.GetItemSet();
- SfxItemSet aSet(*rStyleSet.GetPool(), {{rEntry.nWID, rEntry.nWID}});
+ SfxItemSet aSet(*rStyleSet.GetPool(), rEntry.nWID, rEntry.nWID);
aSet.SetParent(&rStyleSet);
rPropSet.setPropertyValue(rEntry, uno::makeAny(static_cast<sal_Int8>(nBin == std::numeric_limits<printeridx_t>::max()-1 ? -1 : nBin)), aSet);
rStyleSet.Put(aSet);
@@ -3346,7 +3346,7 @@ void SwXFrameStyle::SetItem(sal_uInt16 eAtr, const SfxPoolItem& rItem)
return;
rtl::Reference<SwDocStyleSheet> xStyle(new SwDocStyleSheet(*static_cast<SwDocStyleSheet*>(pBase)));
SfxItemSet& rStyleSet = xStyle->GetItemSet();
- SfxItemSet aSet(*rStyleSet.GetPool(), {{sal_uInt16(eAtr), sal_uInt16(eAtr)}});
+ SfxItemSet aSet(*rStyleSet.GetPool(), sal_uInt16(eAtr), sal_uInt16(eAtr));
aSet.Put(rItem);
xStyle->SetItemSet(aSet);
}
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 611000eb9a03..2b9ae958bee4 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -1671,7 +1671,7 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, const u
break;
default:
{
- SfxItemSet aItemSet(rDoc.GetAttrPool(), {{pEntry->nWID, pEntry->nWID}});
+ SfxItemSet aItemSet(rDoc.GetAttrPool(), pEntry->nWID, pEntry->nWID);
SwUnoCursorHelper::GetCursorAttr(rTableCursor.GetSelRing(),
aItemSet);
@@ -3460,7 +3460,7 @@ SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV
break;
default:
{
- SfxItemSet aItemSet( rDoc.GetAttrPool(), {{pEntry->nWID, pEntry->nWID}} );
+ SfxItemSet aItemSet( rDoc.GetAttrPool(), pEntry->nWID, pEntry->nWID );
SwUnoCursorHelper::GetCursorAttr(rCursor.GetSelRing(),
aItemSet);
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 04b65f3e6eac..6b8024892753 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1483,7 +1483,7 @@ const SfxPoolItem* SwWW8FltControlStack::GetFormatAttr(const SwPosition& rPos,
if (pNd->IsTextNode())
{
const sal_Int32 nPos = rPos.nContent.GetIndex();
- m_xScratchSet.reset(new SfxItemSet(m_rDoc.GetAttrPool(), {{nWhich, nWhich}}));
+ m_xScratchSet.reset(new SfxItemSet(m_rDoc.GetAttrPool(), nWhich, nWhich));
if (pNd->GetTextNode()->GetParaAttr(*m_xScratchSet, nPos, nPos))
pItem = m_xScratchSet->GetItem(nWhich);
}
diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx
index 8b4548647af5..b985af79141a 100644
--- a/sw/source/ui/index/swuiidxmrk.cxx
+++ b/sw/source/ui/index/swuiidxmrk.cxx
@@ -401,7 +401,7 @@ void SwIndexMarkPane::UpdateLanguageDependenciesForPhoneticReading()
case SvtScriptType::COMPLEX:nWhich = RES_CHRATR_CTL_LANGUAGE; break;
default:nWhich = RES_CHRATR_LANGUAGE; break;
}
- SfxItemSet aLangSet(m_pSh->GetAttrPool(), {{nWhich, nWhich}});
+ SfxItemSet aLangSet(m_pSh->GetAttrPool(), nWhich, nWhich);
m_pSh->GetCurAttr(aLangSet);
m_nLangForPhoneticReading = static_cast<const SvxLanguageItem&>(aLangSet.Get(nWhich)).GetLanguage();
}
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index 22c1c3f55e1d..1d918dc69422 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -803,7 +803,7 @@ static sal_uInt16 lcl_isNonDefaultLanguage(LanguageType eBufferLanguage, SwView
}
if(bLang)
{
- SfxItemSet aLangSet(rView.GetPool(), {{nWhich, nWhich}});
+ SfxItemSet aLangSet(rView.GetPool(), nWhich, nWhich);
SwWrtShell& rSh = rView.GetWrtShell();
rSh.GetCurAttr(aLangSet);
if(SfxItemState::DEFAULT <= aLangSet.GetItemState(nWhich))
diff --git a/sw/source/uibase/shells/langhelper.cxx b/sw/source/uibase/shells/langhelper.cxx
index a9ebd1d9c759..305c8cd25d11 100644
--- a/sw/source/uibase/shells/langhelper.cxx
+++ b/sw/source/uibase/shells/langhelper.cxx
@@ -381,7 +381,7 @@ namespace SwLangHelper
/// RES_CHRATR_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CTL_LANGUAGE,
LanguageType GetLanguage( SwWrtShell &rSh, sal_uInt16 nLangWhichId )
{
- SfxItemSet aSet( rSh.GetAttrPool(), {{nLangWhichId, nLangWhichId}} );
+ SfxItemSet aSet( rSh.GetAttrPool(), nLangWhichId, nLangWhichId );
rSh.GetCurAttr( aSet );
return GetLanguage(aSet,nLangWhichId);
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index cd231be93192..78df3fd11f3e 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -129,7 +129,7 @@ const sal_uInt16* SwuiGetUITableAttrRange()
static void lcl_SetAttr( SwWrtShell &rSh, const SfxPoolItem &rItem )
{
- SfxItemSet aSet( rSh.GetView().GetPool(), {{rItem.Which(), rItem.Which()}});
+ SfxItemSet aSet( rSh.GetView().GetPool(), rItem.Which(), rItem.Which());
aSet.Put( rItem );
rSh.SetTableAttr( aSet );
}
More information about the Libreoffice-commits
mailing list