diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-15 15:06:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-15 18:53:39 +0200 |
commit | 7d1692179e7cdca19ab34fdc9701512656f01861 (patch) | |
tree | 32fdc18742ceeb93090c5c13366705fe8908c1aa /sw | |
parent | a449b624b24515764a2a494e831583218ee54097 (diff) |
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@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/core/doc/doc.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/attr/swatrset.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentContentOperationsManager.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/doc/docfmt.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/edit/edlingu.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/txtnode/txtedt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unodraw.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unoobj.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unosect.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 6 | ||||
-rw-r--r-- | sw/source/core/unocore/unotbl.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/index/swuiidxmrk.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/langhelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/shells/tabsh.cxx | 2 |
16 files changed, 23 insertions, 22 deletions
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 ); } |