diff options
Diffstat (limited to 'sw')
141 files changed, 515 insertions, 615 deletions
diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx index e0ccaaeb778b..e816a91f0b30 100644 --- a/sw/qa/core/uwriter.cxx +++ b/sw/qa/core/uwriter.cxx @@ -970,7 +970,7 @@ void SwDocTest::testGraphicAnchorDeletion() aPaM.GetPoint()->nContent.Assign(aPaM.GetContentNode(), RTL_CONSTASCII_LENGTH("graphic anchor>>")); //Insert a graphic at X of >>X<< in paragraph 2 - SfxItemSet aFlySet(m_pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1); + SfxItemSet aFlySet(m_pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{}); SwFormatAnchor aAnchor(RndStdIds::FLY_AS_CHAR); aAnchor.SetAnchor(aPaM.GetPoint()); aFlySet.Put(aAnchor); diff --git a/sw/qa/extras/tiledrendering/tiledrendering.cxx b/sw/qa/extras/tiledrendering/tiledrendering.cxx index ecd84826233f..e719a368558e 100644 --- a/sw/qa/extras/tiledrendering/tiledrendering.cxx +++ b/sw/qa/extras/tiledrendering/tiledrendering.cxx @@ -1383,7 +1383,7 @@ void SwTiledRenderingTest::testTrackChangesCallback() CPPUNIT_ASSERT_EQUAL(-1, m_nTrackedChangeIndex); pWrtShell->Left(CRSR_SKIP_CHARS, /*bSelect=*/false, 1, /*bBasicCall=*/false); - SfxItemSet aSet(pWrtShell->GetDoc()->GetAttrPool(), FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_ACCEPT_DIRECT); + SfxItemSet aSet(pWrtShell->GetDoc()->GetAttrPool(), svl::Items<FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_ACCEPT_DIRECT>{}); SfxVoidItem aItem(FN_REDLINE_ACCEPT_DIRECT); aSet.Put(aItem); pWrtShell->GetView().GetState(aSet); @@ -1730,8 +1730,8 @@ namespace { void checkUndoRepairStates(SwXTextDocument* pXTextDocument, SwView* pView1, SwView* pView2) { - SfxItemSet aItemSet1(pXTextDocument->GetDocShell()->GetDoc()->GetAttrPool(), SID_UNDO, SID_UNDO); - SfxItemSet aItemSet2(pXTextDocument->GetDocShell()->GetDoc()->GetAttrPool(), SID_UNDO, SID_UNDO); + SfxItemSet aItemSet1(pXTextDocument->GetDocShell()->GetDoc()->GetAttrPool(), svl::Items<SID_UNDO, SID_UNDO>{}); + SfxItemSet aItemSet2(pXTextDocument->GetDocShell()->GetDoc()->GetAttrPool(), svl::Items<SID_UNDO, SID_UNDO>{}); // first view, undo enabled pView1->GetState(aItemSet1); CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, aItemSet1.GetItemState(SID_UNDO)); @@ -1764,8 +1764,8 @@ void SwTiledRenderingTest::testDisableUndoRepair() int nView2 = SfxLokHelper::getView(); { - SfxItemSet aItemSet1(pXTextDocument->GetDocShell()->GetDoc()->GetAttrPool(), SID_UNDO, SID_UNDO); - SfxItemSet aItemSet2(pXTextDocument->GetDocShell()->GetDoc()->GetAttrPool(), SID_UNDO, SID_UNDO); + SfxItemSet aItemSet1(pXTextDocument->GetDocShell()->GetDoc()->GetAttrPool(), svl::Items<SID_UNDO, SID_UNDO>{}); + SfxItemSet aItemSet2(pXTextDocument->GetDocShell()->GetDoc()->GetAttrPool(), svl::Items<SID_UNDO, SID_UNDO>{}); pView1->GetState(aItemSet1); CPPUNIT_ASSERT_EQUAL(SfxItemState::DISABLED, aItemSet1.GetItemState(SID_UNDO)); pView2->GetState(aItemSet2); @@ -1785,8 +1785,8 @@ void SwTiledRenderingTest::testDisableUndoRepair() pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 'u', 0); Scheduler::ProcessEventsToIdle(); { - SfxItemSet aItemSet1(pXTextDocument->GetDocShell()->GetDoc()->GetAttrPool(), SID_UNDO, SID_UNDO); - SfxItemSet aItemSet2(pXTextDocument->GetDocShell()->GetDoc()->GetAttrPool(), SID_UNDO, SID_UNDO); + SfxItemSet aItemSet1(pXTextDocument->GetDocShell()->GetDoc()->GetAttrPool(), svl::Items<SID_UNDO, SID_UNDO>{}); + SfxItemSet aItemSet2(pXTextDocument->GetDocShell()->GetDoc()->GetAttrPool(), svl::Items<SID_UNDO, SID_UNDO>{}); // second view, undo enabled pView2->GetState(aItemSet2); CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, aItemSet2.GetItemState(SID_UNDO)); diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 7ef2dabaf0d4..e1d73952b9e5 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -1004,7 +1004,7 @@ void SwUiWriterTest::testCp1000071() // Change the document layout to be 2 columns, and then undo. pWrtShell->SelAll(); SwSectionData section(CONTENT_SECTION, pWrtShell->GetUniqueSectionName()); - SfxItemSet set( pDoc->GetDocShell()->GetPool(), RES_COL, RES_COL, 0 ); + SfxItemSet set( pDoc->GetDocShell()->GetPool(), svl::Items<RES_COL, RES_COL>{} ); SwFormatCol col; col.Init( 2, 0, 10000 ); set.Put( col ); @@ -2078,7 +2078,7 @@ void SwUiWriterTest::testTdf72788() //Apply a *Bold* attribute to selection SvxWeightItem aWeightItem(WEIGHT_BOLD, RES_CHRATR_WEIGHT); rIDCO.InsertPoolItem(*pCursor, aWeightItem); - SfxItemSet aSet( pDoc->GetAttrPool(), RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT); + SfxItemSet aSet( pDoc->GetAttrPool(), svl::Items<RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT>{}); //Add selected text's attributes to aSet pCursor->GetNode().GetTextNode()->GetAttr(aSet, 5, 12); SfxPoolItem const * pPoolItem = aSet.GetItem(RES_CHRATR_WEIGHT); @@ -3225,8 +3225,8 @@ void SwUiWriterTest::testUndoDelAsCharTdf107512() sw::UndoManager & rUndoManager(pDoc->GetUndoManager()); IDocumentContentOperations & rIDCO(pDoc->getIDocumentContentOperations()); SwCursorShell * pShell(pDoc->GetEditShell()); - SfxItemSet frameSet(pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1); - SfxItemSet grfSet(pDoc->GetAttrPool(), RES_GRFATR_BEGIN, RES_GRFATR_END-1); + SfxItemSet frameSet(pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{}); + SfxItemSet grfSet(pDoc->GetAttrPool(), svl::Items<RES_GRFATR_BEGIN, RES_GRFATR_END-1>{}); rIDCO.InsertString(*pShell->GetCursor(), "foo"); pShell->ClearMark(); SwFormatAnchor anchor(RndStdIds::FLY_AS_CHAR); @@ -3245,7 +3245,7 @@ void SwUiWriterTest::testUndoDelAsCharTdf107512() CPPUNIT_ASSERT(pShell->GetCursor()->GetNode().GetTextNode()->GetTextAttrForCharAt(4, RES_TXTATR_FLYCNT)); CPPUNIT_ASSERT_EQUAL(OUString(OUStringLiteral1(CH_TXTATR_BREAKWORD) + u"foo" + OUStringLiteral1(CH_TXTATR_BREAKWORD)), pShell->GetCursor()->GetNode().GetTextNode()->GetText()); SfxPoolItem const* pItem; - SfxItemSet query(pDoc->GetAttrPool(), RES_CHRATR_HIDDEN, RES_CHRATR_HIDDEN); + SfxItemSet query(pDoc->GetAttrPool(), svl::Items<RES_CHRATR_HIDDEN, RES_CHRATR_HIDDEN>{}); pShell->GetCursor()->GetNode().GetTextNode()->GetAttr(query, 1, 4); CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, query.GetItemState(RES_CHRATR_HIDDEN, false, &pItem)); CPPUNIT_ASSERT(static_cast<SvxCharHiddenItem const*>(pItem)->GetValue()); @@ -3358,7 +3358,7 @@ void SwUiWriterTest::testUndoCharAttribute() // Apply a "Bold" attribute to selection SvxWeightItem aWeightItem(WEIGHT_BOLD, RES_CHRATR_WEIGHT); rIDCO.InsertPoolItem(*pCursor, aWeightItem); - SfxItemSet aSet( pDoc->GetAttrPool(), RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT); + SfxItemSet aSet( pDoc->GetAttrPool(), svl::Items<RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT>{}); // Adds selected text's attributes to aSet pCursor->GetNode().GetTextNode()->GetAttr(aSet, 10, 19); SfxPoolItem const * pPoolItem = aSet.GetItem(RES_CHRATR_WEIGHT); @@ -3379,8 +3379,8 @@ void SwUiWriterTest::testUndoDelAsChar() sw::UndoManager & rUndoManager(pDoc->GetUndoManager()); IDocumentContentOperations & rIDCO(pDoc->getIDocumentContentOperations()); SwCursorShell * pShell(pDoc->GetEditShell()); - SfxItemSet frameSet(pDoc->GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1); - SfxItemSet grfSet(pDoc->GetAttrPool(), RES_GRFATR_BEGIN, RES_GRFATR_END-1); + SfxItemSet frameSet(pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{}); + SfxItemSet grfSet(pDoc->GetAttrPool(), svl::Items<RES_GRFATR_BEGIN, RES_GRFATR_END-1>{}); SwFormatAnchor anchor(RndStdIds::FLY_AS_CHAR); frameSet.Put(anchor); GraphicObject grf; diff --git a/sw/qa/extras/ww8export/ww8export.cxx b/sw/qa/extras/ww8export/ww8export.cxx index 2af0b8fde045..003c12a6e0d8 100644 --- a/sw/qa/extras/ww8export/ww8export.cxx +++ b/sw/qa/extras/ww8export/ww8export.cxx @@ -129,7 +129,7 @@ protected: // emulate the behavior from tdf#94386 - insert an envelope to the // document - SfxItemSet aSet(pWrtShell->GetView().GetCurShell()->GetPool(), FN_ENVELOP, FN_ENVELOP); + SfxItemSet aSet(pWrtShell->GetView().GetCurShell()->GetPool(), svl::Items<FN_ENVELOP, FN_ENVELOP>{}); aSet.Put(SwEnvItem()); SfxRequest aRequest(FN_ENVELOP, SfxCallMode::SYNCHRON, aSet); SW_MOD()->ExecOther(aRequest); diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 5ef35031a60f..0decdcd1a448 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1681,16 +1681,14 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl( if ( !bOnlyCharAttrs ) { pSet.reset( new SfxItemSet( const_cast<SwAttrPool&>(pTextNode->GetDoc()->GetAttrPool()), - RES_CHRATR_BEGIN, RES_CHRATR_END - 1, + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1, RES_PARATR_BEGIN, RES_PARATR_END - 1, - RES_FRMATR_BEGIN, RES_FRMATR_END - 1, - 0 ) ); + RES_FRMATR_BEGIN, RES_FRMATR_END - 1>{} ) ); } else { pSet.reset( new SfxItemSet( const_cast<SwAttrPool&>(pTextNode->GetDoc()->GetAttrPool()), - RES_CHRATR_BEGIN, RES_CHRATR_END - 1, - 0 ) ); + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1>{} ) ); } // #i82637# - From the perspective of the a11y API the default character // attributes are the character attributes, which are set at the paragraph style @@ -1701,9 +1699,8 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl( if ( !bOnlyCharAttrs ) { SfxItemSet aParaSet( const_cast<SwAttrPool&>(pTextNode->GetDoc()->GetAttrPool()), - RES_PARATR_BEGIN, RES_PARATR_END - 1, - RES_FRMATR_BEGIN, RES_FRMATR_END - 1, - 0 ); + svl::Items<RES_PARATR_BEGIN, RES_PARATR_END - 1, + RES_FRMATR_BEGIN, RES_FRMATR_END - 1>{} ); pTextNode->SwContentNode::GetAttr( aParaSet ); pSet->Put( aParaSet ); } @@ -1713,8 +1710,7 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl( if ( pTextNode->GetTextColl() ) { SfxItemSet aCharSet( const_cast<SwAttrPool&>(pTextNode->GetDoc()->GetAttrPool()), - RES_CHRATR_BEGIN, RES_CHRATR_END - 1, - 0 ); + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1>{} ); SetPutRecursive( aCharSet, pTextNode->GetTextColl()->GetAttrSet() ); pSet->Put( aCharSet ); } @@ -1904,8 +1900,7 @@ void SwAccessibleParagraph::_getRunAttributesImpl( // retrieve character attributes for the created PaM <pPaM> SfxItemSet aSet( pPaM->GetDoc()->GetAttrPool(), - RES_CHRATR_BEGIN, RES_CHRATR_END -1, - 0 ); + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END -1>{} ); // #i82637# // From the perspective of the a11y API the character attributes, which // are set at the automatic paragraph style of the paragraph, are treated @@ -1917,8 +1912,7 @@ void SwAccessibleParagraph::_getRunAttributesImpl( if ( pTextNode->HasSwAttrSet() ) { SfxItemSet aAutomaticParaStyleCharAttrs( pPaM->GetDoc()->GetAttrPool(), - RES_CHRATR_BEGIN, RES_CHRATR_END -1, - 0 ); + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END -1>{} ); aAutomaticParaStyleCharAttrs.Put( *(pTextNode->GetpSwAttrSet()), false ); aSet.Put( aAutomaticParaStyleCharAttrs ); } @@ -1926,8 +1920,7 @@ void SwAccessibleParagraph::_getRunAttributesImpl( // get character attributes at <pPaM> and merge these into <aSet> { SfxItemSet aCharAttrsAtPaM( pPaM->GetDoc()->GetAttrPool(), - RES_CHRATR_BEGIN, RES_CHRATR_END -1, - 0 ); + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END -1>{} ); SwUnoCursorHelper::GetCursorAttr(*pPaM, aCharAttrsAtPaM, true); aSet.Put( aCharAttrsAtPaM ); } @@ -2024,14 +2017,13 @@ void SwAccessibleParagraph::_getSupplementalAttributesImpl( const SwTextNode* pTextNode( GetTextNode() ); std::unique_ptr<SfxItemSet> pSet; pSet.reset( new SfxItemSet( const_cast<SwAttrPool&>(pTextNode->GetDoc()->GetAttrPool()), - RES_PARATR_ADJUST, RES_PARATR_ADJUST, + svl::Items<RES_PARATR_ADJUST, RES_PARATR_ADJUST, RES_PARATR_TABSTOP, RES_PARATR_TABSTOP, RES_PARATR_LINESPACING, RES_PARATR_LINESPACING, RES_UL_SPACE, RES_UL_SPACE, RES_LR_SPACE, RES_LR_SPACE, RES_PARATR_NUMRULE, RES_PARATR_NUMRULE, - RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1, - 0 ) ); + RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1>{} ) ); if ( pTextNode->HasBullet() || pTextNode->HasNumber() ) { diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx index ca951a3e159a..12f0de192efd 100644 --- a/sw/source/core/attr/format.cxx +++ b/sw/source/core/attr/format.cxx @@ -482,7 +482,7 @@ bool SwFormat::SetFormatAttr( const SfxPoolItem& rAttr ) { // FALLBACKBREAKHERE should not be used; instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST] SAL_INFO("sw.core", "Do no longer use SvxBrushItem, instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes (simple fallback is in place and used)"); - SfxItemSet aTempSet(*m_aSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST, 0, 0); + SfxItemSet aTempSet(*m_aSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}); const SvxBrushItem& rSource = static_cast< const SvxBrushItem& >(rAttr); // fill a local ItemSet with the attributes corresponding as good as possible diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx index 29a6cb291d22..bc55739cecba 100644 --- a/sw/source/core/attr/swatrset.cxx +++ b/sw/source/core/attr/swatrset.cxx @@ -143,7 +143,7 @@ void SwAttrPool::removeAndDeleteSecondaryPools() } 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/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index ccd662d67f13..4adb93eb0337 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -1570,8 +1570,8 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, if( !bRet && IsAttrAtPos::CurrAttrs & rContentAtPos.eContentAtPos ) { const sal_Int32 n = aPos.nContent.GetIndex(); - SfxItemSet aSet( GetDoc()->GetAttrPool(), POOLATTR_BEGIN, - POOLATTR_END - 1 ); + SfxItemSet aSet( GetDoc()->GetAttrPool(), svl::Items<POOLATTR_BEGIN, + POOLATTR_END - 1>{} ); if( pTextNd->GetpSwpHints() ) { for( size_t i = 0; i < pTextNd->GetSwpHints().Count(); ++i ) @@ -1928,9 +1928,8 @@ bool SwCursorShell::SetShadowCursorPos( const Point& rPt, SwFillMode eFillMode ) if( nullptr != (pCNd = aPos.nNode.GetNode().GetContentNode() )) { SfxItemSet aSet( GetDoc()->GetAttrPool(), - RES_LR_SPACE, RES_LR_SPACE, - RES_PARATR_ADJUST, RES_PARATR_ADJUST, - 0 ); + svl::Items<RES_LR_SPACE, RES_LR_SPACE, + RES_PARATR_ADJUST, RES_PARATR_ADJUST>{} ); SvxLRSpaceItem aLR( static_cast<const SvxLRSpaceItem&>( pCNd->GetAttr( RES_LR_SPACE ) ) ); aLR.SetTextLeft( aFPos.nTabCnt ); diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index bf0ec9142114..0d14fbf72a94 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -227,7 +227,7 @@ SwAttrCheckArr::SwAttrCheckArr( const SfxItemSet& rSet, bool bFwd, , nNdEnd(0) , nFound(0) , nStackCnt(0) - , aCmpSet( *rSet.GetPool(), RES_CHRATR_BEGIN, RES_TXTATR_END-1 ) + , aCmpSet( *rSet.GetPool(), svl::Items<RES_CHRATR_BEGIN, RES_TXTATR_END-1>{} ) , bNoColls(bNoCollections) , bForward(bFwd) { @@ -977,7 +977,7 @@ bool SwPaM::Find( const SfxItemSet& rSet, bool bNoColls, SwMoveFnCollection cons // check which text/char attributes are searched SwAttrCheckArr aCmpArr( rSet, bSrchForward, bNoColls ); SfxItemSet aOtherSet( GetDoc()->GetAttrPool(), - RES_PARATR_BEGIN, RES_GRFATR_END-1 ); + svl::Items<RES_PARATR_BEGIN, RES_GRFATR_END-1>{} ); aOtherSet.Put( rSet, false ); // got all invalid items FnSearchAttr fnSearch = bSrchForward diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 49d8b4fedfab..df72344446a9 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -1072,24 +1072,21 @@ namespace //local functions originally from docfmt.cxx if ( !bCharAttr && !bOtherAttr ) { SfxItemSet* pTmpCharItemSet = new SfxItemSet( pDoc->GetAttrPool(), - RES_CHRATR_BEGIN, RES_CHRATR_END-1, + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_TXTATR_AUTOFMT, RES_TXTATR_AUTOFMT, RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, - RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, - 0 ); + RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER>{} ); SfxItemSet* pTmpOtherItemSet = new SfxItemSet( pDoc->GetAttrPool(), - RES_PARATR_BEGIN, RES_PARATR_END-1, + svl::Items<RES_PARATR_BEGIN, RES_PARATR_END-1, RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1, RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_GRFATR_BEGIN, RES_GRFATR_END-1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, // FillAttribute support - XATTR_FILL_FIRST, XATTR_FILL_LAST, - - 0 ); + XATTR_FILL_FIRST, XATTR_FILL_LAST>{} ); pTmpCharItemSet->Put( rChgSet ); pTmpOtherItemSet->Put( rChgSet ); @@ -1151,7 +1148,7 @@ namespace //local functions originally from docfmt.cxx if ( !bCharAttr && !bOtherAttr ) { SfxItemSet aTextSet( pDoc->GetAttrPool(), - RES_TXTATR_NOEND_BEGIN, RES_TXTATR_NOEND_END-1 ); + svl::Items<RES_TXTATR_NOEND_BEGIN, RES_TXTATR_NOEND_END-1>{} ); aTextSet.Put( rChgSet ); if( aTextSet.Count() ) { @@ -1182,11 +1179,10 @@ namespace //local functions originally from docfmt.cxx // CharFormat and URL attributes are treated separately! // TEST_TEMP ToDo: AutoFormat! SfxItemSet aTextSet( pDoc->GetAttrPool(), - RES_TXTATR_REFMARK, RES_TXTATR_TOXMARK, + svl::Items<RES_TXTATR_REFMARK, RES_TXTATR_TOXMARK, RES_TXTATR_META, RES_TXTATR_METAFIELD, RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY, - RES_TXTATR_INPUTFIELD, RES_TXTATR_INPUTFIELD, - 0 ); + RES_TXTATR_INPUTFIELD, RES_TXTATR_INPUTFIELD>{} ); aTextSet.Put( rChgSet ); if( aTextSet.Count() ) @@ -3092,7 +3088,7 @@ bool DocumentContentOperationsManager::InsertPoolItem( pUndoAttr = 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, bExpandCharToPara ); @@ -3882,9 +3878,8 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt { // Apply the first character's attributes to the ReplaceText SfxItemSet aSet( m_rDoc.GetAttrPool(), - RES_CHRATR_BEGIN, RES_TXTATR_WITHEND_END - 1, - RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, - 0 ); + svl::Items<RES_CHRATR_BEGIN, RES_TXTATR_WITHEND_END - 1, + RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1>{} ); pTextNd->GetAttr( aSet, nStt+1, nStt+1 ); aSet.ClearItem( RES_TXTATR_REFMARK ); diff --git a/sw/source/core/doc/DocumentDeviceManager.cxx b/sw/source/core/doc/DocumentDeviceManager.cxx index b5ccaa5aead6..f88fceee1680 100644 --- a/sw/source/core/doc/DocumentDeviceManager.cxx +++ b/sw/source/core/doc/DocumentDeviceManager.cxx @@ -207,11 +207,10 @@ void DocumentDeviceManager::setJobsetup(/*[in]*/ const JobSetup &rJobSetup ) { //The ItemSet is deleted by Sfx! auto pSet = o3tl::make_unique<SfxItemSet>( m_rDoc.GetAttrPool(), - FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER, + svl::Items<FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER, SID_HTML_MODE, SID_HTML_MODE, SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, - SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, - 0 ); + SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC>{} ); VclPtr<SfxPrinter> p = VclPtr<SfxPrinter>::Create( std::move(pSet), rJobSetup ); if ( bCheckPageDescs ) setPrinter( p, true, true ); @@ -291,11 +290,10 @@ SfxPrinter& DocumentDeviceManager::CreatePrinter_() const // We create a default SfxPrinter. // The ItemSet is deleted by Sfx! auto pSet = o3tl::make_unique<SfxItemSet>( m_rDoc.GetAttrPool(), - FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER, + svl::Items<FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER, SID_HTML_MODE, SID_HTML_MODE, SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, - SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, - 0 ); + SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC>{} ); VclPtr<SfxPrinter> pNewPrt = VclPtr<SfxPrinter>::Create( std::move(pSet) ); const_cast<DocumentDeviceManager*>(this)->setPrinter( pNewPrt, true, true ); diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx index 65238ea36193..e68c4eb00cd5 100644 --- a/sw/source/core/doc/DocumentFieldsManager.cxx +++ b/sw/source/core/doc/DocumentFieldsManager.cxx @@ -811,7 +811,7 @@ void DocumentFieldsManager::UpdateTableFields( SfxPoolItem* pHt ) SwFrameFormat* pFormat = pBox->ClaimFrameFormat(); SfxItemSet aTmp( m_rDoc.GetAttrPool(), - RES_BOXATR_BEGIN,RES_BOXATR_END-1 ); + svl::Items<RES_BOXATR_BEGIN,RES_BOXATR_END-1>{} ); if( pCalc->IsCalcError() ) nValue = DBL_MAX; diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index cfe3ca7ba717..49d1dc7c16e9 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -1078,8 +1078,8 @@ SwChainRet SwDoc::Chain( SwFrameFormat &rSource, const SwFrameFormat &rDest ) aChain.SetPrev( &static_cast<SwFlyFrameFormat&>(rSource) ); SetAttr( aChain, rDestFormat ); - SfxItemSet aSet( GetAttrPool(), RES_FRM_SIZE, RES_FRM_SIZE, - RES_CHAIN, RES_CHAIN, 0 ); + SfxItemSet aSet( GetAttrPool(), svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, + RES_CHAIN, RES_CHAIN>{} ); // Attach Follow to the Master. aChain.SetPrev( &static_cast<SwFlyFrameFormat&>(rSource) ); diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index ef366c600c1d..4e66dccc6c2a 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -110,16 +110,16 @@ static bool lcl_RstAttr( const SwNodePtr& rpNd, void* pArgs ) // remove unused attribute RES_LR_SPACE // add list attributes - SfxItemSet aSavedAttrsSet(pDoc->GetAttrPool(), RES_PAGEDESC, RES_BREAK, + SfxItemSet aSavedAttrsSet(pDoc->GetAttrPool(), svl::Items<RES_PAGEDESC, RES_BREAK, RES_PARATR_NUMRULE, RES_PARATR_NUMRULE, RES_PARATR_LIST_BEGIN, - RES_PARATR_LIST_END - 1, 0); + RES_PARATR_LIST_END - 1>{}); const SfxItemSet* pAttrSetOfNode = pNode->GetpSwAttrSet(); std::vector<sal_uInt16> aClearWhichIds; // restoring all paragraph list attributes { - SfxItemSet aListAttrSet( pDoc->GetAttrPool(), RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1 ); + SfxItemSet aListAttrSet( pDoc->GetAttrPool(), svl::Items<RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1>{} ); aListAttrSet.Set(*pAttrSetOfNode); if ( aListAttrSet.Count() ) { @@ -425,7 +425,7 @@ bool SwDoc::UpdateRsid( const SwPaM &rRg, const sal_Int32 nLen ) const sal_Int32 nStart(rRg.GetPoint()->nContent.GetIndex() - nLen); SvxRsidItem aRsid( mnRsid, RES_CHRATR_RSID ); - SfxItemSet aSet(GetAttrPool(), RES_CHRATR_RSID, RES_CHRATR_RSID); + SfxItemSet aSet(GetAttrPool(), svl::Items<RES_CHRATR_RSID, RES_CHRATR_RSID>{}); aSet.Put(aRsid); bool const bRet(pTextNode->SetAttr(aSet, nStart, rRg.GetPoint()->nContent.GetIndex())); @@ -462,7 +462,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 ); } @@ -540,7 +540,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/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index f4a6095dfe62..ecb98a2c5284 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -341,7 +341,7 @@ SwDoc::SwDoc() // pass empty item set containing the paragraph's list attributes // as ignorable items to the stype manager. { - SfxItemSet aIgnorableParagraphItems( GetAttrPool(), RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1); + SfxItemSet aIgnorableParagraphItems( GetAttrPool(), svl::Items<RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1>{}); mpStyleAccess = createStyleManager( &aIgnorableParagraphItems ); } diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index 69e301ed17b4..c59b2fa7184d 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -895,8 +895,8 @@ void FlatFndBox::FillFlat(const FndBox_& rBox, bool bLastBox) SfxItemState::SET == pFormat->GetItemState( RES_BOXATR_VALUE ) ) { auto pSet = o3tl::make_unique<SfxItemSet>( pDoc->GetAttrPool(), - RES_BOXATR_FORMAT, RES_BOXATR_VALUE, - RES_VERT_ORIENT, RES_VERT_ORIENT, 0 ); + svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE, + RES_VERT_ORIENT, RES_VERT_ORIENT>{} ); pSet->Put( pFormat->GetAttrSet() ); if( ppItemSets.empty() ) { diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx index fb1eb20955f8..1527689908df 100644 --- a/sw/source/core/doc/tblcpy.cxx +++ b/sw/source/core/doc/tblcpy.cxx @@ -632,8 +632,8 @@ static void lcl_CpyBox( const SwTable& rCpyTable, const SwTableBox* pCpyBox, // Copy the TableBoxAttributes - Formula/Format/Value if( pCpyBox ) { - SfxItemSet aBoxAttrSet( pCpyDoc->GetAttrPool(), RES_BOXATR_FORMAT, - RES_BOXATR_VALUE ); + SfxItemSet aBoxAttrSet( pCpyDoc->GetAttrPool(), svl::Items<RES_BOXATR_FORMAT, + RES_BOXATR_VALUE>{} ); aBoxAttrSet.Put( pCpyBox->GetFrameFormat()->GetAttrSet() ); if( aBoxAttrSet.Count() ) { diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index 625d668f216c..bba0d703f00d 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -1895,7 +1895,7 @@ static void lcl_CopyBoxToDoc(FndBox_ const& rFndBox, CpyPara *const pCpyPara) // We can also copy formulas and values, if we copy the content { SfxItemSet aBoxAttrSet( pCpyPara->pDoc->GetAttrPool(), - RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); + svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE>{} ); aBoxAttrSet.Put(rFndBox.GetBox()->GetFrameFormat()->GetAttrSet()); if( aBoxAttrSet.Count() ) { diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index d5c9d5357a06..d6ceddd2a889 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -477,7 +477,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTableOpts, const sal_uInt16 nBoxArrLen = pTAFormat ? 16 : 4; aBoxFormatArr.resize( nBoxArrLen, nullptr ); } - SfxItemSet aCharSet( GetAttrPool(), RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1 ); + SfxItemSet aCharSet( GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1>{} ); SwNodeIndex aNdIdx( *pTableNd, 1 ); // Set to StartNode of first Box SwTableLines& rLines = rNdTable.GetTabLines(); @@ -766,7 +766,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTableOpts, aBoxFormatArr2.reset(new std::vector<SwTableBoxFormat*>( nBoxArrLen, nullptr )); } - SfxItemSet aCharSet( GetAttrPool(), RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1 ); + SfxItemSet aCharSet( GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1>{} ); SwHistory* pHistory = pUndo ? &pUndo->GetHistory() : nullptr; @@ -3701,7 +3701,7 @@ static bool lcl_SetAFormatBox(FndBox_ & rBox, SetAFormatTabPara *pSetPara, bool pSetBox->SetDirectFormatting(false); SwDoc* pDoc = pSetBox->GetFrameFormat()->GetDoc(); - SfxItemSet aCharSet(pDoc->GetAttrPool(), RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1); + SfxItemSet aCharSet(pDoc->GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1>{}); SfxItemSet aBoxSet(pDoc->GetAttrPool(), aTableBoxSetRange); sal_uInt8 nPos = pSetPara->nAFormatLine * 4 + pSetPara->nAFormatBox; pSetPara->rTableFormat.UpdateToSet(nPos, aCharSet, SwTableAutoFormat::UPDATE_CHAR, nullptr); @@ -4078,7 +4078,7 @@ void SwDoc::ChkBoxNumFormat( SwTableBox& rBox, bool bCallUpdate ) } SwTableBoxFormat* pBoxFormat = static_cast<SwTableBoxFormat*>(rBox.GetFrameFormat()); - SfxItemSet aBoxSet( GetAttrPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); + SfxItemSet aBoxSet( GetAttrPool(), svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE>{} ); bool bLockModify = true; bool bSetNumberFormat = IsInsTableFormatNum(); @@ -4230,8 +4230,7 @@ void SwDoc::ClearLineNumAttrs( SwPosition & rPos ) { const SfxPoolItem* pFormatItem = nullptr; SfxItemSet rSet( pTextNode->GetDoc()->GetAttrPool(), - RES_PARATR_BEGIN, RES_PARATR_END - 1, - 0); + svl::Items<RES_PARATR_BEGIN, RES_PARATR_END - 1>{}); pTextNode->SwContentNode::GetAttr( rSet ); if ( SfxItemState::SET == rSet.GetItemState( RES_PARATR_NUMRULE , false , &pFormatItem ) ) { diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 578e1a98e2ff..b23fac6f9d00 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -153,7 +153,7 @@ bool Put( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwContentNode& rNo std::unique_ptr<SfxItemSet> pStyleNames; if ( SfxItemState::SET == rSet.GetItemState( RES_FRMATR_STYLE_NAME, false ) ) { - pStyleNames.reset(new SfxItemSet( *aNewSet.GetPool(), RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME )); + pStyleNames.reset(new SfxItemSet( *aNewSet.GetPool(), svl::Items<RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME>{} )); pStyleNames->Put( aNewSet ); } @@ -200,7 +200,7 @@ bool Put_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, std::unique_ptr<SfxItemSet> pStyleNames; if ( SfxItemState::SET == rSet.GetItemState( RES_FRMATR_STYLE_NAME, false ) ) { - pStyleNames.reset(new SfxItemSet( *aNewSet.GetPool(), RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME )); + pStyleNames.reset(new SfxItemSet( *aNewSet.GetPool(), svl::Items<RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME>{} )); pStyleNames->Put( aNewSet ); } diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 5c620cafc4d3..23fe86495c98 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -1062,7 +1062,7 @@ void lcl_textBoxSizeNotify(SwFrameFormat* pFormat) if (SwTextBoxHelper::isTextBox(pFormat, RES_DRAWFRMFMT)) { // Just notify the textbox that the size has changed, the actual object size is not interesting. - SfxItemSet aResizeSet(pFormat->GetDoc()->GetAttrPool(), RES_FRM_SIZE, RES_FRM_SIZE, 0); + SfxItemSet aResizeSet(pFormat->GetDoc()->GetAttrPool(), svl::Items<RES_FRM_SIZE, RES_FRM_SIZE>{}); SwFormatFrameSize aSize; aResizeSet.Put(aSize); SwTextBoxHelper::syncFlyFrameAttr(*pFormat, aResizeSet); @@ -1252,7 +1252,7 @@ void SwDrawContact::Changed_( const SdrObject& rObj, } } SfxItemSet aSet( GetFormat()->GetDoc()->GetAttrPool(), - RES_VERT_ORIENT, RES_HORI_ORIENT, 0 ); + svl::Items<RES_VERT_ORIENT, RES_HORI_ORIENT>{} ); const SwFormatVertOrient& rVert = GetFormat()->GetVertOrient(); if ( nYPosDiff != 0 ) { diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 28ac7d83874a..f89cdeea30c9 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -747,7 +747,7 @@ void SwVirtFlyDrawObj::NbcCrop(const Point& rRef, const Fraction& xFact, const F return ; // Get old values for crop in 10th of mm - SfxItemSet aSet( pSh->GetAttrPool(), RES_GRFATR_CROPGRF, RES_GRFATR_CROPGRF ); + SfxItemSet aSet( pSh->GetAttrPool(), svl::Items<RES_GRFATR_CROPGRF, RES_GRFATR_CROPGRF>{} ); pSh->GetCurAttr( aSet ); SwCropGrf aCrop( static_cast<const SwCropGrf&>(aSet.Get(RES_GRFATR_CROPGRF)) ); diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx index ed42d4ff1d4d..b2a15b34c601 100644 --- a/sw/source/core/edit/acorrect.cxx +++ b/sw/source/core/edit/acorrect.cxx @@ -257,7 +257,7 @@ bool SwAutoCorrDoc::SetINetAttr( sal_Int32 nStt, sal_Int32 nEnd, const OUString& SwPaM aPam( rNd, nStt, rNd, nEnd ); SfxItemSet aSet( rEditSh.GetDoc()->GetAttrPool(), - RES_TXTATR_INETFMT, RES_TXTATR_INETFMT ); + svl::Items<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT>{} ); aSet.Put( SwFormatINetFormat( rURL, OUString() )); rEditSh.GetDoc()->SetFormatItemByAutoFormat( aPam, aSet ); if( bUndoIdInitialized ) diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index f9a992833f10..f9e37f7ab433 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -578,9 +578,8 @@ bool SwAutoFormat::DoUnderline() break; } SfxItemSet aSet(m_pDoc->GetAttrPool(), - RES_PARATR_CONNECT_BORDER, RES_PARATR_CONNECT_BORDER, - RES_BOX, RES_BOX, - 0); + svl::Items<RES_PARATR_CONNECT_BORDER, RES_PARATR_CONNECT_BORDER, + RES_BOX, RES_BOX>{}); aSet.Put( SwParaConnectBorderItem( false ) ); SvxBoxItem aBox( RES_BOX ); aBox.SetLine( &aLine, SvxBoxItemLine::BOTTOM ); @@ -988,11 +987,10 @@ void SwAutoFormat::SetColl( sal_uInt16 nId, bool bHdLineOrText ) // keep hard tabs, alignment, language, hyphenation, DropCaps and nearly all frame attributes SfxItemSet aSet( m_pDoc->GetAttrPool(), - RES_PARATR_ADJUST, RES_PARATR_ADJUST, + svl::Items<RES_PARATR_ADJUST, RES_PARATR_ADJUST, RES_PARATR_TABSTOP, RES_PARATR_DROP, RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE, - RES_BACKGROUND, RES_SHADOW, - 0 ); + RES_BACKGROUND, RES_SHADOW>{} ); if( m_pCurTextNd->HasSwAttrSet() ) { diff --git a/sw/source/core/edit/edfmt.cxx b/sw/source/core/edit/edfmt.cxx index 40d716e6cc17..c162358a1913 100644 --- a/sw/source/core/edit/edfmt.cxx +++ b/sw/source/core/edit/edfmt.cxx @@ -42,8 +42,8 @@ SwCharFormat& SwEditShell::GetCharFormat(sal_uInt16 nFormat) const SwCharFormat* SwEditShell::GetCurCharFormat() const { SwCharFormat *pFormat = nullptr; - SfxItemSet aSet( GetDoc()->GetAttrPool(), RES_TXTATR_CHARFMT, - RES_TXTATR_CHARFMT ); + SfxItemSet aSet( GetDoc()->GetAttrPool(), svl::Items<RES_TXTATR_CHARFMT, + RES_TXTATR_CHARFMT>{} ); const SfxPoolItem* pItem; if( GetCurAttr( aSet ) && SfxItemState::SET == aSet.GetItemState( RES_TXTATR_CHARFMT, false, &pItem ) ) diff --git a/sw/source/core/edit/edlingu.cxx b/sw/source/core/edit/edlingu.cxx index 2c01c9e5cff0..e75ee2dee152 100644 --- a/sw/source/core/edit/edlingu.cxx +++ b/sw/source/core/edit/edlingu.cxx @@ -1230,7 +1230,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, 0); + SfxItemSet aSet(GetAttrPool(), {{nLangWhichId, nLangWhichId}}); GetCurAttr( aSet ); const SvxLanguageItem& rLang = static_cast<const SvxLanguageItem& >(aSet.Get(nLangWhichId)); if(rLang.GetLanguage() != aCurrentNewPortion->eLanguage) @@ -1558,7 +1558,7 @@ static LanguageType lcl_GetLanguage(SwEditShell& rSh) case SvtScriptType::COMPLEX : nLangWhichId = RES_CHRATR_CTL_LANGUAGE; break; default: break; } - SfxItemSet aSet(rSh.GetAttrPool(), nLangWhichId, nLangWhichId, 0); + 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/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index 1be01755be5a..90bdef938d0e 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -118,7 +118,7 @@ double SwTableBox::GetValue( SwTableCalcPara& rCalcPara ) const { SwFrameFormat* pFormat = pBox->ClaimFrameFormat(); SfxItemSet aTmp( pDoc->GetAttrPool(), - RES_BOXATR_BEGIN,RES_BOXATR_END-1 ); + svl::Items<RES_BOXATR_BEGIN,RES_BOXATR_END-1>{} ); aTmp.Put( SwTableBoxValue( nRet ) ); if( SfxItemState::SET != pFormat->GetItemState( RES_BOXATR_FORMAT )) aTmp.Put( SwTableBoxNumFormat( 0 )); diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx index 42c09bd5555a..11513cf65eff 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -1392,7 +1392,7 @@ void SwFEShell::Paste( SvStream& rStrm, SwPasteSdr nAction, const Point* pPt ) { // store attributes, then set SdrObject SfxItemSet aFrameSet( mpDoc->GetAttrPool(), - RES_SURROUND, RES_ANCHOR ); + svl::Items<RES_SURROUND, RES_ANCHOR>{} ); aFrameSet.Set( pFormat->GetAttrSet() ); Point aNullPt; @@ -1572,7 +1572,7 @@ bool SwFEShell::Paste(const Graphic &rGrf, const OUString& rURL) { pView->AddUndo(new SdrUndoAttrObj(*pObj)); - SfxItemSet aSet(pView->GetModel()->GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLBITMAP); + SfxItemSet aSet(pView->GetModel()->GetItemPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLBITMAP>{}); aSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP)); aSet.Put(XFillBitmapItem(OUString(), rGrf)); diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx index b0d3a3a8e0f3..575a16bbf96c 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -1063,7 +1063,7 @@ SfxItemSet SwFEShell::makeItemSetFromFormatAnchor(SfxItemPool& rPool, const SwFo // The set also includes VERT/HORI_ORIENT, because the align // shall be changed in FEShell::SetFlyFrameAttr/SetFlyFrameAnchor, // possibly as a result of the anchor change. - SfxItemSet aSet(rPool, RES_VERT_ORIENT, RES_ANCHOR); + SfxItemSet aSet(rPool, svl::Items<RES_VERT_ORIENT, RES_ANCHOR>{}); aSet.Put(rAnchor); return aSet; } diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 813dcc658a8d..f7165eb5678e 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -1884,8 +1884,8 @@ bool SwFEShell::ImpEndCreate() } } - SfxItemSet aSet( GetDoc()->GetAttrPool(), RES_FRM_SIZE, RES_FRM_SIZE, - RES_SURROUND, RES_ANCHOR, 0 ); + SfxItemSet aSet( GetDoc()->GetAttrPool(), svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, + RES_SURROUND, RES_ANCHOR>{} ); aSet.Put( aAnch ); // OD 2004-03-30 #i26791# - determine relative object position @@ -1953,7 +1953,7 @@ bool SwFEShell::ImpEndCreate() ::GetHtmlMode( GetDoc()->GetDocShell() ) && nullptr != ( pFlyFrame = GetSelectedFlyFrame() )) { - SfxItemSet aHtmlSet( GetDoc()->GetAttrPool(), RES_VERT_ORIENT, RES_HORI_ORIENT ); + SfxItemSet aHtmlSet( GetDoc()->GetAttrPool(), svl::Items<RES_VERT_ORIENT, RES_HORI_ORIENT>{} ); // horizontal orientation: const bool bLeftFrame = aFlyRect.Left() < pAnch->Frame().Left() + pAnch->Prt().Left(), @@ -2704,8 +2704,8 @@ void SwFEShell::CheckUnboundObjects() // First the action here, to assure GetCharRect delivers current values. StartAllAction(); - SfxItemSet aSet( GetAttrPool(), RES_FRM_SIZE, RES_FRM_SIZE, - RES_SURROUND, RES_ANCHOR, 0 ); + SfxItemSet aSet( GetAttrPool(), svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, + RES_SURROUND, RES_ANCHOR>{} ); aSet.Put( aAnch ); Point aRelNullPt; @@ -3069,7 +3069,7 @@ long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const if(bMarquee) { - SfxItemSet aSet(pDrawModel->GetItemPool(), SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST); + SfxItemSet aSet(pDrawModel->GetItemPool(), svl::Items<SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST>{}); aSet.Put( makeSdrTextAutoGrowWidthItem( false ) ); aSet.Put( makeSdrTextAutoGrowHeightItem( false ) ); aSet.Put( SdrTextAniKindItem( SdrTextAniKind::Slide ) ); diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 1208a71aa8cf..3233ea34800f 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -518,7 +518,7 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const OUString &rText, con //the next line, pushing the caption text out of //the frame making the caption apparently disappear SvxCharHiddenItem aHidden(true, RES_CHRATR_HIDDEN); - SfxItemSet aSet(GetDoc()->GetAttrPool(), aHidden.Which(), aHidden.Which()); + SfxItemSet aSet(GetDoc()->GetAttrPool(), {{aHidden.Which(), aHidden.Which()}}); aSet.Put(aHidden); pTextNode->SetAttr(aSet, nIndex, nIndex + 1); } diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 8ad675b77590..7a45f973ecef 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -1035,7 +1035,7 @@ void SwFlyFrame::ChgRelPos( const Point &rNewPos ) if( bVert ) nTmpY = -nTmpY; SfxItemSet aSet( pFormat->GetDoc()->GetAttrPool(), - RES_VERT_ORIENT, RES_HORI_ORIENT); + svl::Items<RES_VERT_ORIENT, RES_HORI_ORIENT>{}); SwFormatVertOrient aVert( pFormat->GetVertOrient() ); const SwTextFrame *pAutoFrame = nullptr; diff --git a/sw/source/core/text/redlnitr.cxx b/sw/source/core/text/redlnitr.cxx index b0aaeb31bf8d..3a68743aaff5 100644 --- a/sw/source/core/text/redlnitr.cxx +++ b/sw/source/core/text/redlnitr.cxx @@ -236,7 +236,7 @@ short SwRedlineItr::Seek_(SwFont& rFnt, sal_Int32 nNew, sal_Int32 nOld) { SwAttrPool& rPool = const_cast<SwDoc&>(rDoc).GetAttrPool(); - pSet = o3tl::make_unique<SfxItemSet>(rPool, RES_CHRATR_BEGIN, RES_CHRATR_END-1); + pSet = o3tl::make_unique<SfxItemSet>(rPool, svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1>{}); } if( 1 < pRed->GetStackCount() ) diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index c687809cbb92..3c5f2553a795 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -1706,11 +1706,10 @@ void SwTextNode::CopyText( SwTextNode *const pDest, nLen != pDest->GetText().getLength())) { SfxItemSet aCharSet( pDest->GetDoc()->GetAttrPool(), - RES_CHRATR_BEGIN, RES_CHRATR_END-1, + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, - RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, - 0 ); + RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1>{} ); aCharSet.Put( *GetpSwAttrSet() ); if( aCharSet.Count() ) { @@ -1749,11 +1748,10 @@ void SwTextNode::CopyText( SwTextNode *const pDest, nLen != pDest->GetText().getLength())) { SfxItemSet aCharSet( pDest->GetDoc()->GetAttrPool(), - RES_CHRATR_BEGIN, RES_CHRATR_END-1, + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, - RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, - 0 ); + RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1>{} ); aCharSet.Put( *GetpSwAttrSet() ); if( aCharSet.Count() ) { @@ -2108,11 +2106,10 @@ void SwTextNode::CutImpl( SwTextNode * const pDest, const SwIndex & rDestStart, nLen != pDest->GetText().getLength()) { SfxItemSet aCharSet( pDest->GetDoc()->GetAttrPool(), - RES_CHRATR_BEGIN, RES_CHRATR_END-1, + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, - RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1, - 0 ); + RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1>{} ); aCharSet.Put( *GetpSwAttrSet() ); if( aCharSet.Count() ) pDest->SetAttr( aCharSet, nDestStart, nDestStart + nLen ); @@ -4880,7 +4877,7 @@ void SwTextNode::dumpAsXml(xmlTextWriterPtr pWriter) const sal_uInt32 SwTextNode::GetRsid( sal_Int32 nStt, sal_Int32 nEnd ) const { - SfxItemSet aSet( const_cast<SfxItemPool&>(static_cast<SfxItemPool const &>(GetDoc()->GetAttrPool())), RES_CHRATR_RSID, RES_CHRATR_RSID ); + SfxItemSet aSet( const_cast<SfxItemPool&>(static_cast<SfxItemPool const &>(GetDoc()->GetAttrPool())), svl::Items<RES_CHRATR_RSID, RES_CHRATR_RSID>{} ); if ( GetAttr(aSet, nStt, nEnd) ) { const SvxRsidItem* pRsid = aSet.GetItem<SvxRsidItem>(RES_CHRATR_RSID); diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index c590a6e5cab7..e0095e77acf0 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -993,7 +993,7 @@ SwTextAttr* MakeTextAttr( // Sorry, this is not allowed any longer. // You'll get a brand new autostyle attribute: SfxItemSet aItemSet( rDoc.GetAttrPool(), - RES_CHRATR_BEGIN, RES_CHRATR_END ); + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END>{} ); aItemSet.Put( rAttr ); return MakeTextAttr( rDoc, aItemSet, nStt, nEnd ); } @@ -1834,7 +1834,7 @@ bool SwTextNode::SetAttr( // split sets (for selection in nodes) const SfxItemSet* pSet = &rSet; - SfxItemSet aTextSet( *rSet.GetPool(), RES_TXTATR_BEGIN, RES_TXTATR_END-1 ); + SfxItemSet aTextSet( *rSet.GetPool(), svl::Items<RES_TXTATR_BEGIN, RES_TXTATR_END-1>{} ); // entire paragraph if ( !nStt && (nEnd == m_Text.getLength()) && diff --git a/sw/source/core/undo/unattr.cxx b/sw/source/core/undo/unattr.cxx index deaf037a82fd..4be99c3222b6 100644 --- a/sw/source/core/undo/unattr.cxx +++ b/sw/source/core/undo/unattr.cxx @@ -665,7 +665,7 @@ void SwUndoResetAttr::SetAttrs( const std::set<sal_uInt16> &rAttrs ) SwUndoAttr::SwUndoAttr( const SwPaM& rRange, const SfxPoolItem& rAttr, const SetAttrMode nFlags ) : SwUndo( SwUndoId::INSATTR, rRange.GetDoc() ), SwUndRng( rRange ) - , m_AttrSet( rRange.GetDoc()->GetAttrPool(), rAttr.Which(), rAttr.Which() ) + , m_AttrSet( rRange.GetDoc()->GetAttrPool(), {{rAttr.Which(), rAttr.Which()}} ) , m_pHistory( new SwHistory ) , m_nNodeIndex( ULONG_MAX ) , m_nInsertFlags( nFlags ) diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index c1d0dc50afaa..0d65e3caa7d0 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -2326,7 +2326,7 @@ void SwUndoTableNumFormat::RedoImpl(::sw::UndoRedoContext & rContext) if( bNewFormat || bNewFormula || bNewValue ) { SfxItemSet aBoxSet( rDoc.GetAttrPool(), - RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); + svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE>{} ); // Resetting attributes is not enough. In addition, take care that the // text will be also formatted correctly. @@ -2355,7 +2355,7 @@ void SwUndoTableNumFormat::RedoImpl(::sw::UndoRedoContext & rContext) else if( css::util::NumberFormat::TEXT != static_cast<sal_Int16>(nFormatIdx) ) { SfxItemSet aBoxSet( rDoc.GetAttrPool(), - RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); + svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE>{} ); aBoxSet.Put( SwTableBoxNumFormat( nFormatIdx )); aBoxSet.Put( SwTableBoxValue( fNum )); @@ -2529,8 +2529,8 @@ void SwUndoTableCpyTable::UndoImpl(::sw::UndoRedoContext & rContext) aInsIdx = rBox.GetSttIdx() + 1; rDoc.GetNodes().Delete( aInsIdx ); - SfxItemSet aTmpSet( rDoc.GetAttrPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE, - RES_VERT_ORIENT, RES_VERT_ORIENT, 0 ); + SfxItemSet aTmpSet( rDoc.GetAttrPool(), svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE, + RES_VERT_ORIENT, RES_VERT_ORIENT>{} ); aTmpSet.Put( rBox.GetFrameFormat()->GetAttrSet() ); if( aTmpSet.Count() ) { @@ -2548,8 +2548,8 @@ void SwUndoTableCpyTable::UndoImpl(::sw::UndoRedoContext & rContext) if( aTmpSet.Count() ) { pEntry->pBoxNumAttr = o3tl::make_unique<SfxItemSet>( rDoc.GetAttrPool(), - RES_BOXATR_FORMAT, RES_BOXATR_VALUE, - RES_VERT_ORIENT, RES_VERT_ORIENT, 0 ); + svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE, + RES_VERT_ORIENT, RES_VERT_ORIENT>{} ); pEntry->pBoxNumAttr->Put( aTmpSet ); } @@ -2620,8 +2620,8 @@ void SwUndoTableCpyTable::RedoImpl(::sw::UndoRedoContext & rContext) aInsIdx = rBox.GetSttIdx() + 1; rDoc.GetNodes().Delete( aInsIdx ); - SfxItemSet aTmpSet( rDoc.GetAttrPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE, - RES_VERT_ORIENT, RES_VERT_ORIENT, 0 ); + SfxItemSet aTmpSet( rDoc.GetAttrPool(), svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE, + RES_VERT_ORIENT, RES_VERT_ORIENT>{} ); aTmpSet.Put( rBox.GetFrameFormat()->GetAttrSet() ); if( aTmpSet.Count() ) { @@ -2638,8 +2638,8 @@ void SwUndoTableCpyTable::RedoImpl(::sw::UndoRedoContext & rContext) if( aTmpSet.Count() ) { pEntry->pBoxNumAttr = o3tl::make_unique<SfxItemSet>( rDoc.GetAttrPool(), - RES_BOXATR_FORMAT, RES_BOXATR_VALUE, - RES_VERT_ORIENT, RES_VERT_ORIENT, 0 ); + svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE, + RES_VERT_ORIENT, RES_VERT_ORIENT>{} ); pEntry->pBoxNumAttr->Put( aTmpSet ); } @@ -2669,8 +2669,8 @@ void SwUndoTableCpyTable::AddBoxBefore( const SwTableBox& rBox, bool bDelContent } pEntry->pBoxNumAttr = o3tl::make_unique<SfxItemSet>( pDoc->GetAttrPool(), - RES_BOXATR_FORMAT, RES_BOXATR_VALUE, - RES_VERT_ORIENT, RES_VERT_ORIENT, 0 ); + svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE, + RES_VERT_ORIENT, RES_VERT_ORIENT>{} ); pEntry->pBoxNumAttr->Put( rBox.GetFrameFormat()->GetAttrSet() ); if( !pEntry->pBoxNumAttr->Count() ) { diff --git a/sw/source/core/unocore/SwXTextDefaults.cxx b/sw/source/core/unocore/SwXTextDefaults.cxx index 17b62c0afd98..e709ffdf8356 100644 --- a/sw/source/core/unocore/SwXTextDefaults.cxx +++ b/sw/source/core/unocore/SwXTextDefaults.cxx @@ -72,7 +72,7 @@ void SAL_CALL SwXTextDefaults::setPropertyValue( const OUString& rPropertyName, const SfxPoolItem& rItem = m_pDoc->GetDefault(pMap->nWID); if (RES_PAGEDESC == pMap->nWID && MID_PAGEDESC_PAGEDESCNAME == pMap->nMemberId) { - SfxItemSet aSet( m_pDoc->GetAttrPool(), RES_PAGEDESC, RES_PAGEDESC ); + SfxItemSet aSet( m_pDoc->GetAttrPool(), svl::Items<RES_PAGEDESC, RES_PAGEDESC>{} ); aSet.Put(rItem); SwUnoCursorHelper::SetPageDesc( aValue, *m_pDoc, aSet ); m_pDoc->SetDefault(aSet.Get(RES_PAGEDESC)); diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 70cec6decfbd..7b26b283fcb7 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -596,8 +596,8 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) // now evaluate the properties of SwShapeDescriptor_Impl SwShapeDescriptor_Impl* pDesc = pShape->GetDescImpl(); - SfxItemSet aSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, - RES_FRMATR_END-1 ); + SfxItemSet aSet( pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, + RES_FRMATR_END-1>{} ); SwFormatAnchor aAnchor( RndStdIds::FLY_AS_CHAR ); bool bOpaque = false; if( pDesc ) @@ -1075,7 +1075,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a { UnoActionContext aCtx(pDoc); SfxItemSet aItemSet( pDoc->GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END - 1 ); + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END - 1>{} ); aItemSet.SetParent(&pFormat->GetAttrSet()); SwFormatAnchor aAnchor = static_cast<const SwFormatAnchor&>(aItemSet.Get(pEntry->nWID)); SwPosition aPos(*pFrame->GetFrameFormat()->GetContent().GetContentIdx()); @@ -1883,7 +1883,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/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index a005091d1bbb..3e902cd9611f 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1766,7 +1766,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& if(pFrame && this != pFrame && pFrame->GetFrameFormat() && pFrame->GetFrameFormat()->GetDoc() == pDoc) { SfxItemSet aSet( pDoc->GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END - 1 ); + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END - 1>{} ); aSet.SetParent(&pFormat->GetAttrSet()); SwFormatAnchor aAnchor = static_cast<const SwFormatAnchor&>(aSet.Get(pEntry->nWID)); @@ -1786,13 +1786,11 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& // standard UNO API write attributes // adapt former attr from SvxBrushItem::PutValue to new items XATTR_FILL_FIRST, XATTR_FILL_LAST SfxItemSet aSet( pDoc->GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END - 1, + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END - 1, RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, // FillAttribute support - XATTR_FILL_FIRST, XATTR_FILL_LAST, - - 0L); + XATTR_FILL_FIRST, XATTR_FILL_LAST>{}); bool bDone(false); aSet.SetParent(&pFormat->GetAttrSet()); @@ -2477,7 +2475,7 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName ) if(OWN_ATTR_FILLBMP_MODE == pEntry->nWID) { SwDoc* pDoc = pFormat->GetDoc(); - SfxItemSet aSet(pDoc->GetAttrPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + SfxItemSet aSet(pDoc->GetAttrPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}); aSet.SetParent(&pFormat->GetAttrSet()); aSet.ClearItem(XATTR_FILLBMP_STRETCH); @@ -2523,7 +2521,7 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName ) { SwDoc* pDoc = pFormat->GetDoc(); SfxItemSet aSet( pDoc->GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END - 1 ); + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END - 1>{} ); aSet.SetParent(&pFormat->GetAttrSet()); aSet.ClearItem(pEntry->nWID); if(rPropertyName != UNO_NAME_ANCHOR_TYPE) @@ -2783,7 +2781,7 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan { pFormat->DelFrames(); pAnchorItem->SetAnchor( m_pCopySource->Start() ); - SfxItemSet aAnchorSet( pDoc->GetAttrPool(), RES_ANCHOR, RES_ANCHOR ); + SfxItemSet aAnchorSet( pDoc->GetAttrPool(), svl::Items<RES_ANCHOR, RES_ANCHOR>{} ); aAnchorSet.Put( *pAnchorItem ); pDoc->SetFlyFrameAttr( *pFormat, aAnchorSet ); delete pAnchorItem; @@ -3052,7 +3050,7 @@ void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange) SwUnoInternalPaM aIntPam(*pDoc); if (::sw::XTextRangeToSwPaM(aIntPam, xTextRange)) { - SfxItemSet aSet( pDoc->GetAttrPool(), RES_ANCHOR, RES_ANCHOR ); + SfxItemSet aSet( pDoc->GetAttrPool(), svl::Items<RES_ANCHOR, RES_ANCHOR>{} ); aSet.SetParent(&pFormat->GetAttrSet()); SwFormatAnchor aAnchor = static_cast<const SwFormatAnchor&>(aSet.Get(RES_ANCHOR)); aAnchor.SetAnchor( aIntPam.Start() ); diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index d2723423f23d..0fd4dca72244 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -386,7 +386,7 @@ lcl_setCharFormatSequence(SwPaM & rPam, uno::Any const& rValue) aStyle <<= aCharStyles.getConstArray()[nStyle]; // create a local set and apply each format directly SfxItemSet aSet(rPam.GetDoc()->GetAttrPool(), - RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT); + svl::Items<RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT>{}); lcl_setCharStyle(rPam.GetDoc(), aStyle, aSet); // the first style should replace the current attributes, // all other have to be added @@ -1739,10 +1739,9 @@ uno::Any SwUnoCursorHelper::GetPropertyValue( if (!bDone) { SfxItemSet aSet(rPaM.GetDoc()->GetAttrPool(), - RES_CHRATR_BEGIN, RES_FRMATR_END - 1, + svl::Items<RES_CHRATR_BEGIN, RES_FRMATR_END - 1, RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, - RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, - 0L); + RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER>{}); SwUnoCursorHelper::GetCursorAttr(rPaM, aSet); rPropSet.getPropertyValue(*pEntry, aSet, aAny); @@ -1917,20 +1916,19 @@ SwUnoCursorHelper::GetPropertyStates( case SW_PROPERTY_STATE_CALLER_SWX_TEXT_PORTION: pSet.reset( new SfxItemSet( rPaM.GetDoc()->GetAttrPool(), - RES_CHRATR_BEGIN, RES_TXTATR_END )); + svl::Items<RES_CHRATR_BEGIN, RES_TXTATR_END>{} )); break; 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( rPaM.GetDoc()->GetAttrPool(), - RES_CHRATR_BEGIN, RES_FRMATR_END - 1, + svl::Items<RES_CHRATR_BEGIN, RES_FRMATR_END - 1, RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, - RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, - 0L )); + RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER>{} )); } // #i63870# SwUnoCursorHelper::GetCursorAttr( rPaM, *pSet ); diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index b9769d58f91b..be26a3b937c5 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -362,10 +362,9 @@ void SwXTextPortion::GetPropertyValue( if(!pSet) { pSet = o3tl::make_unique<SfxItemSet>(pUnoCursor->GetDoc()->GetAttrPool(), - RES_CHRATR_BEGIN, RES_FRMATR_END - 1, + svl::Items<RES_CHRATR_BEGIN, RES_FRMATR_END - 1, RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, - RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, - 0L); + RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER>{}); SwUnoCursorHelper::GetCursorAttr(*pUnoCursor, *pSet); } m_pPropSet->getPropertyValue(rEntry, *pSet, rVal); diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index da5af6a13e38..a9cf24f28943 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -352,12 +352,11 @@ SwXTextSection::attach(const uno::Reference< text::XTextRange > & xTextRange) aSect.SetEditInReadonlyFlag(m_pImpl->m_pProps->m_bEditInReadonly); SfxItemSet aSet(pDoc->GetAttrPool(), - RES_COL, RES_COL, + svl::Items<RES_COL, RES_COL, RES_BACKGROUND, RES_BACKGROUND, RES_FTN_AT_TXTEND, RES_FRAMEDIR, RES_LR_SPACE, RES_LR_SPACE, - RES_UNKNOWNATR_CONTAINER,RES_UNKNOWNATR_CONTAINER, - 0); + RES_UNKNOWNATR_CONTAINER,RES_UNKNOWNATR_CONTAINER>{}); if (m_pImpl->m_pProps->m_pBrushItem.get()) { aSet.Put(*m_pImpl->m_pProps->m_pBrushItem); @@ -811,7 +810,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); @@ -1541,7 +1540,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 2cce53ca24b6..165466e80fce 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1565,7 +1565,7 @@ void SwXStyle::SetPropertyValue<HINT_BEGIN>(const SfxItemPropertySimpleEntry& rE { // 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); @@ -1675,7 +1675,7 @@ void SwXStyle::SetPropertyValue<RES_PAPER_BIN>(const SfxItemPropertySimpleEntry& 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); @@ -2602,7 +2602,7 @@ void SAL_CALL SwXStyle::setPropertiesToDefault(const uno::Sequence<OUString>& aP { // SwDoc* pDoc = pTargetFormat->GetDoc(); - SfxItemSet aSet(pDoc->GetAttrPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + SfxItemSet aSet(pDoc->GetAttrPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}); aSet.SetParent(&pTargetFormat->GetAttrSet()); aSet.ClearItem(XATTR_FILLBMP_STRETCH); @@ -2873,7 +2873,7 @@ void SwXPageStyle::SetPropertyValues_Impl(const uno::Sequence<OUString>& rProper { // Header/footer gets switched on, create defaults and the needed SfxSetItem SfxItemSet aTempSet(*aBaseImpl.GetItemSet().GetPool(), - RES_FRMATR_BEGIN,RES_FRMATR_END - 1, // [82 + svl::Items<RES_FRMATR_BEGIN,RES_FRMATR_END - 1, // [82 // FillAttribute support XATTR_FILL_FIRST, XATTR_FILL_LAST, // [1014 @@ -2881,8 +2881,7 @@ void SwXPageStyle::SetPropertyValues_Impl(const uno::Sequence<OUString>& rProper SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER, // [10023 SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE, // [10051 SID_ATTR_PAGE_ON,SID_ATTR_PAGE_SHARED, // [10060 - SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST, - 0); + SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST>{}); // set correct parent to get the XFILL_NONE FillStyle as needed aTempSet.SetParent(&GetDoc()->GetDfltFrameFormat()->GetAttrSet()); @@ -3275,7 +3274,7 @@ void SwXFrameStyle::SetItem(enum RES_FRMATR eAtr, const SfxPoolItem& rItem) return; rtl::Reference<SwDocStyleSheet> xStyle(new SwDocStyleSheet(*static_cast<SwDocStyleSheet*>(pBase))); SfxItemSet& rStyleSet = xStyle->GetItemSet(); - SfxItemSet aSet(*rStyleSet.GetPool(), eAtr, eAtr); + SfxItemSet aSet(*rStyleSet.GetPool(), {{sal_uInt16(eAtr), sal_uInt16(eAtr)}}); aSet.Put(rItem); xStyle->SetItemSet(aSet); } @@ -3719,7 +3718,7 @@ SwAutoStylesEnumImpl::SwAutoStylesEnumImpl( SwDoc* pInitDoc, IStyleAccess::SwAut if ( aRubyMap.find( aPair ) == aRubyMap.end() ) { aRubyMap.insert( aPair ); - std::shared_ptr<SfxItemSet> pItemSet( new SfxItemSet( rAttrPool, RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY ) ); + std::shared_ptr<SfxItemSet> pItemSet( new SfxItemSet( rAttrPool, svl::Items<RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY>{} ) ); pItemSet->Put( *pItem ); mAutoStyles.push_back( pItemSet ); } diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index e35c6185c2db..2d1c91e219fe 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -733,7 +733,7 @@ void sw_setValue( SwXCell &rCell, double nVal ) SwDoc* pDoc = rCell.GetDoc(); UnoActionContext aAction(pDoc); SwFrameFormat* pBoxFormat = rCell.pBox->ClaimFrameFormat(); - SfxItemSet aSet(pDoc->GetAttrPool(), RES_BOXATR_FORMAT, RES_BOXATR_VALUE); + SfxItemSet aSet(pDoc->GetAttrPool(), svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE>{}); const SfxPoolItem* pItem; //!! do we need to set a new number format? Yes, if @@ -909,7 +909,7 @@ void SwXCell::setFormula(const OUString& rFormula) SwTableBoxFormula aFormula( sFormula ); SwDoc* pMyDoc = GetDoc(); UnoActionContext aAction(pMyDoc); - SfxItemSet aSet(pMyDoc->GetAttrPool(), RES_BOXATR_FORMAT, RES_BOXATR_FORMULA); + SfxItemSet aSet(pMyDoc->GetAttrPool(), svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_FORMULA>{}); const SfxPoolItem* pItem; SwFrameFormat* pBoxFormat = pBox->GetFrameFormat(); if(SfxItemState::SET != pBoxFormat->GetAttrSet().GetItemState(RES_BOXATR_FORMAT, true, &pItem) @@ -1701,7 +1701,7 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, const u break; default: { - SfxItemSet aItemSet(pDoc->GetAttrPool(), pEntry->nWID, pEntry->nWID); + SfxItemSet aItemSet(pDoc->GetAttrPool(), {{pEntry->nWID, pEntry->nWID}}); SwUnoCursorHelper::GetCursorAttr(rTableCursor.GetSelRing(), aItemSet); @@ -1754,9 +1754,8 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName) default: { SfxItemSet aSet(rTableCursor.GetDoc()->GetAttrPool(), - RES_CHRATR_BEGIN, RES_FRMATR_END-1, - RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, - 0L); + svl::Items<RES_CHRATR_BEGIN, RES_FRMATR_END-1, + RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER>{}); SwUnoCursorHelper::GetCursorAttr(rTableCursor.GetSelRing(), aSet); m_pPropSet->getPropertyValue(*pEntry, aSet, aResult); } @@ -1827,15 +1826,14 @@ void SwTableProperties_Impl::AddItemToSet(SfxItemSet& rSet, std::function<Tpooli void SwTableProperties_Impl::ApplyTableAttr(const SwTable& rTable, SwDoc& rDoc) { SfxItemSet aSet(rDoc.GetAttrPool(), - RES_LAYOUT_SPLIT, RES_LAYOUT_SPLIT, + svl::Items<RES_LAYOUT_SPLIT, RES_LAYOUT_SPLIT, RES_BACKGROUND, RES_BACKGROUND, RES_FRM_SIZE, RES_UL_SPACE, RES_HORI_ORIENT, RES_HORI_ORIENT, RES_BREAK, RES_BREAK, RES_KEEP, RES_KEEP, RES_SHADOW, RES_SHADOW, - RES_PAGEDESC, RES_PAGEDESC, - 0 + RES_PAGEDESC, RES_PAGEDESC>{} ); const uno::Any* pRepHead; const SwFrameFormat &rFrameFormat = *rTable.GetFrameFormat(); @@ -2629,9 +2627,8 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, const uno::An rCursor.MakeBoxSels(); SfxItemSet aSet(pDoc->GetAttrPool(), - RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, - 0); + svl::Items<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{}); SvxBoxItem aBox( RES_BOX ); SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); @@ -2828,9 +2825,8 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) rCursor.MakeBoxSels(); SfxItemSet aSet(pDoc->GetAttrPool(), - RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, - 0); + svl::Items<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{}); aSet.Put(SvxBoxInfoItem( SID_ATTR_BORDER_INNER )); SwDoc::GetTabBorders(rCursor, aSet); const SvxBoxInfoItem& rBoxInfoItem = @@ -3419,9 +3415,8 @@ SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV case RES_BOX : { SfxItemSet aSet(pDoc->GetAttrPool(), - RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, - 0); + svl::Items<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{}); SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::ALL, false); SvxBoxInfoItemValidFlags nValid = SvxBoxInfoItemValidFlags::NONE; @@ -3487,7 +3482,7 @@ SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV break; default: { - SfxItemSet aItemSet( pDoc->GetAttrPool(), pEntry->nWID, pEntry->nWID ); + SfxItemSet aItemSet( pDoc->GetAttrPool(), {{pEntry->nWID, pEntry->nWID}} ); SwUnoCursorHelper::GetCursorAttr(rCursor.GetSelRing(), aItemSet); @@ -3531,9 +3526,8 @@ uno::Any SAL_CALL SwXCellRange::getPropertyValue(const OUString& rPropertyName) { SwDoc *const pDoc = m_pImpl->m_pTableCursor->GetDoc(); SfxItemSet aSet(pDoc->GetAttrPool(), - RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, - 0); + svl::Items<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{}); aSet.Put(SvxBoxInfoItem( SID_ATTR_BORDER_INNER )); SwDoc::GetTabBorders(*m_pImpl->m_pTableCursor, aSet); const SvxBoxItem& rBoxItem = static_cast<const SvxBoxItem&>(aSet.Get(RES_BOX)); @@ -3571,10 +3565,9 @@ uno::Any SAL_CALL SwXCellRange::getPropertyValue(const OUString& rPropertyName) default: { SfxItemSet aSet(m_pImpl->m_pTableCursor->GetDoc()->GetAttrPool(), - RES_CHRATR_BEGIN, RES_FRMATR_END -1, + svl::Items<RES_CHRATR_BEGIN, RES_FRMATR_END -1, RES_TXTATR_UNKNOWN_CONTAINER, RES_TXTATR_UNKNOWN_CONTAINER, - RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, - 0L); + RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER>{}); // first look at the attributes of the cursor SwUnoTableCursor *const pCursor = dynamic_cast<SwUnoTableCursor*>(&(*m_pImpl->m_pTableCursor)); diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx index 0479c74e9769..e03ae3921ae0 100644 --- a/sw/source/filter/ascii/parasc.cxx +++ b/sw/source/filter/ascii/parasc.cxx @@ -102,10 +102,9 @@ SwASCIIParser::SwASCIIParser(SwDoc* pD, const SwPaM& rCursor, SvStream& rIn, pArr = new sal_Char [ ASC_BUFFLEN + 2 ]; pItemSet = o3tl::make_unique<SfxItemSet>( pDoc->GetAttrPool(), - RES_CHRATR_FONT, RES_CHRATR_LANGUAGE, + svl::Items<RES_CHRATR_FONT, RES_CHRATR_LANGUAGE, RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_LANGUAGE, - RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_LANGUAGE, - 0 ); + RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_LANGUAGE>{} ); // set defaults from the options if( rOpt.GetLanguage() ) diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index 039a1c39a0ea..cb0991bf426c 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -671,7 +671,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos, // test if on this node there had been a pagebreak BEFORE the // tox attribute was put on the stack - SfxItemSet aBkSet( pDoc->GetAttrPool(), RES_PAGEDESC, RES_BREAK ); + SfxItemSet aBkSet( pDoc->GetAttrPool(), svl::Items<RES_PAGEDESC, RES_BREAK>{} ); SwContentNode* pNd = nullptr; if( !pTOXAttr->HadBreakItem() || !pTOXAttr->HadPageDescItem() ) { diff --git a/sw/source/filter/html/SwAppletImpl.cxx b/sw/source/filter/html/SwAppletImpl.cxx index 11fba7e16641..8d3a8858c9da 100644 --- a/sw/source/filter/html/SwAppletImpl.cxx +++ b/sw/source/filter/html/SwAppletImpl.cxx @@ -106,7 +106,7 @@ SwHtmlOptType SwApplet_Impl::GetOptionType( const OUString& rName, bool bApplet return nType; } SwApplet_Impl::SwApplet_Impl( SfxItemPool& rPool ) : - aItemSet( rPool, RES_FRMATR_BEGIN, RES_FRMATR_END-1 ) + aItemSet( rPool, svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{} ) { } diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index bb80e234df7d..8505dc0a4bf6 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -1224,14 +1224,13 @@ bool SwHTMLWriter::HasScriptDependentItems( const SfxItemSet& rItemSet, //sequence of (start, end) property ranges we want to //query SfxItemSet aTstItemSet( *pDCCharFormat->GetAttrSet().GetPool(), - RES_CHRATR_FONT, RES_CHRATR_FONT, + svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONT, RES_CHRATR_POSTURE, RES_CHRATR_POSTURE, RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT, RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_POSTURE, RES_CHRATR_CJK_WEIGHT, RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONT, - RES_CHRATR_CTL_POSTURE, RES_CHRATR_CTL_WEIGHT, - 0 ); + RES_CHRATR_CTL_POSTURE, RES_CHRATR_CTL_WEIGHT>{} ); aTstItemSet.Set( pDCCharFormat->GetAttrSet() ); return HasScriptDependentItems( aTstItemSet, false ); } @@ -1275,11 +1274,10 @@ static bool OutCSS1Rule( SwHTMLWriter& rHTMLWrt, const OUString& rSelector, //sequence of (start, end) property ranges we want to //query SfxItemSet aScriptItemSet( *rItemSet.GetPool(), - RES_CHRATR_FONT, RES_CHRATR_FONTSIZE, + svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONTSIZE, RES_CHRATR_LANGUAGE, RES_CHRATR_POSTURE, RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT, - RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_WEIGHT, - 0 ); + RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_WEIGHT>{} ); aScriptItemSet.Put( rItemSet ); OUString aNewSelector( aSelector ); @@ -1378,11 +1376,10 @@ static void OutCSS1DropCapRule( } SfxItemSet aScriptItemSet( rHTMLWrt.pDoc->GetAttrPool(), - RES_CHRATR_FONT, RES_CHRATR_FONTSIZE, + svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONTSIZE, RES_CHRATR_LANGUAGE, RES_CHRATR_POSTURE, RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT, - RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_WEIGHT, - 0 ); + RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_WEIGHT>{} ); if( pDCCharFormat ) aScriptItemSet.Set( pDCCharFormat->GetAttrSet() ); @@ -1697,7 +1694,7 @@ static Writer& OutCSS1_SwPageDesc( Writer& rWrt, const SwPageDesc& rPageDesc, // Export the distance-Attributes as normally const SwFrameFormat &rMaster = rPageDesc.GetMaster(); SfxItemSet aItemSet( *rMaster.GetAttrSet().GetPool(), - RES_LR_SPACE, RES_UL_SPACE ); + svl::Items<RES_LR_SPACE, RES_UL_SPACE>{} ); aItemSet.Set( rMaster.GetAttrSet() ); if( pRefPageDesc ) diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 1eef03d8a148..0a61af5dbc77 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -590,7 +590,7 @@ void OutHTML_SwFormat( Writer& rWrt, const SwFormat& rFormat, if (!rInfo.pItemSet.get()) { - rInfo.pItemSet.reset(new SfxItemSet(*rFormat.GetAttrSet().GetPool(), RES_UL_SPACE, RES_UL_SPACE)); + rInfo.pItemSet.reset(new SfxItemSet(*rFormat.GetAttrSet().GetPool(), svl::Items<RES_UL_SPACE, RES_UL_SPACE>{})); } rInfo.pItemSet->Put( aULSpaceItem ); } @@ -1835,8 +1835,8 @@ void HTMLEndPosLst::Insert( const SwDrawFrameFormat& rFormat, sal_Int32 nPos, // insert them as hints. Because of the amount of Hints the styles // are not considered! const SfxItemSet& rFormatItemSet = rFormat.GetAttrSet(); - SfxItemSet aItemSet( *rFormatItemSet.GetPool(), RES_CHRATR_BEGIN, - RES_CHRATR_END ); + SfxItemSet aItemSet( *rFormatItemSet.GetPool(), svl::Items<RES_CHRATR_BEGIN, + RES_CHRATR_END>{} ); SwHTMLWriter::GetEEAttrsFromDrwObj( aItemSet, pTextObj, true ); bool bOutStylesOld = bOutStyles; bOutStyles = false; diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx index c575f209e6bb..0646803f9c92 100644 --- a/sw/source/filter/html/htmlctxt.cxx +++ b/sw/source/filter/html/htmlctxt.cxx @@ -409,7 +409,7 @@ bool SwHTMLParser::DoPositioning( SfxItemSet &rItemSet, if( SwCSS1Parser::MayBePositioned( rPropInfo ) ) { SfxItemSet aFrameItemSet( m_xDoc->GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{} ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs(aFrameItemSet ); @@ -704,7 +704,7 @@ SfxItemSet *HTMLAttrContext::GetFrameItemSet( SwDoc *pCreateDoc ) { if( !pFrameItemSet && pCreateDoc ) pFrameItemSet = o3tl::make_unique<SfxItemSet>( pCreateDoc->GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{} ); return pFrameItemSet.get(); } diff --git a/sw/source/filter/html/htmldrawreader.cxx b/sw/source/filter/html/htmldrawreader.cxx index f2800093088c..7654a703bdf5 100644 --- a/sw/source/filter/html/htmldrawreader.cxx +++ b/sw/source/filter/html/htmldrawreader.cxx @@ -83,7 +83,7 @@ void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj, pNewDrawObj->SetLayer( m_xDoc->getIDocumentDrawModelAccess().GetInvisibleHeavenId() ); SfxItemSet aFrameSet( m_xDoc->GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{} ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs( aFrameSet ); diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx index 2f1f82609c8c..601d1113fcb1 100644 --- a/sw/source/filter/html/htmlfldw.cxx +++ b/sw/source/filter/html/htmlfldw.cxx @@ -327,11 +327,10 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pField, //sequence of (start, end) property ranges we want to //query SfxItemSet aScriptItemSet( rWrt.pDoc->GetAttrPool(), - RES_CHRATR_FONT, RES_CHRATR_FONTSIZE, + svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONTSIZE, RES_CHRATR_POSTURE, RES_CHRATR_POSTURE, RES_CHRATR_WEIGHT, RES_CHRATR_WEIGHT, - RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_WEIGHT, - 0 ); + RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_WEIGHT>{} ); rTextNd.GetAttr( aScriptItemSet, nFieldPos, nFieldPos+1 ); sal_uInt16 aWesternWhichIds[4] = diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 69320ce63047..9a736f05822a 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -1829,8 +1829,8 @@ static Writer& OutHTML_FrameFormatAsMarquee( Writer& rWrt, const SwFrameFormat& // get the edit engine attributes of the object as SW attributes and // sort them as Hints const SfxItemSet& rFormatItemSet = rFrameFormat.GetAttrSet(); - SfxItemSet aItemSet( *rFormatItemSet.GetPool(), RES_CHRATR_BEGIN, - RES_CHRATR_END ); + SfxItemSet aItemSet( *rFormatItemSet.GetPool(), svl::Items<RES_CHRATR_BEGIN, + RES_CHRATR_END>{} ); SwHTMLWriter::GetEEAttrsFromDrwObj( aItemSet, &rSdrObj, true ); bool bCfgOutStylesOld = rHTMLWrt.m_bCfgOutStyles; rHTMLWrt.m_bCfgOutStyles = false; diff --git a/sw/source/filter/html/htmlforw.cxx b/sw/source/filter/html/htmlforw.cxx index 6ec96beded12..a963de30fb44 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -1041,8 +1041,8 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, bool bEdit = TAG_TEXTAREA == eTag || TYPE_FILE == eType || TYPE_TEXT == eType; - SfxItemSet aItemSet( rHTMLWrt.pDoc->GetAttrPool(), RES_CHRATR_BEGIN, - RES_CHRATR_END ); + SfxItemSet aItemSet( rHTMLWrt.pDoc->GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, + RES_CHRATR_END>{} ); if( xPropSetInfo->hasPropertyByName( "BackgroundColor" ) ) { aTmp = xPropSet->getPropertyValue( "BackgroundColor" ); diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 12f035d83b76..b9a0cf6e26b5 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -487,7 +487,7 @@ IMAGE_SETEVENT: ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo ); SfxItemSet aFrameSet( m_xDoc->GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{} ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs( aFrameSet ); diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 136a8550fd56..98f48eccc608 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -430,7 +430,7 @@ void SwHTMLParser::InsertEmbed() } SfxItemSet aFrameSet( m_xDoc->GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{} ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs( aFrameSet ); @@ -922,7 +922,7 @@ void SwHTMLParser::InsertFloatingFrame() // den Itemset holen SfxItemSet aFrameSet( m_xDoc->GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{} ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs( aFrameSet ); diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index b1151ca37313..38333bbf487c 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -309,7 +309,7 @@ void SwHTMLParser::NewDivision( HtmlTokenId nToken ) } SfxItemSet aFrameItemSet( m_xDoc->GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{} ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs(aFrameItemSet ); @@ -613,7 +613,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss ) if( bInCntnr || SwCSS1Parser::MayBePositioned( aPropInfo, true ) ) { SfxItemSet aFrameItemSet( m_xDoc->GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{} ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs(aFrameItemSet ); @@ -685,7 +685,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss ) SwSectionData aSection( CONTENT_SECTION, aName ); SfxItemSet aFrameItemSet( m_xDoc->GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{} ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs(aFrameItemSet ); diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 2f1daece276a..a8550415f72f 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -1426,7 +1426,7 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox, bool bLock = pFrameFormat->GetDoc()->GetNumberFormatter() ->IsTextFormat( nNumFormat ); SfxItemSet aItemSet( *pFrameFormat->GetAttrSet().GetPool(), - RES_BOXATR_FORMAT, RES_BOXATR_VALUE ); + svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE>{} ); SvxAdjust eAdjust = SvxAdjust::End; SwContentNode *pCNd = nullptr; if( !bLock ) @@ -2819,8 +2819,8 @@ SvxBrushItem* SwHTMLParser::CreateBrushItem( const Color *pColor, if( !rStyle.isEmpty() || !rId.isEmpty() || !rClass.isEmpty() ) { - SfxItemSet aItemSet( m_xDoc->GetAttrPool(), RES_BACKGROUND, - RES_BACKGROUND ); + SfxItemSet aItemSet( m_xDoc->GetAttrPool(), svl::Items<RES_BACKGROUND, + RES_BACKGROUND>{} ); SvxCSS1PropertyInfo aPropInfo; if( !rClass.isEmpty() ) @@ -3524,7 +3524,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, // the table should be put in a text frame SfxItemSet aFrameSet( m_xDoc->GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{} ); if( !pCurTable->IsNewDoc() ) Reader::ResetFrameFormatAttrs( aFrameSet ); diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 199e80dd6c09..3b4e77d6b937 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -2853,7 +2853,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable, case RES_BACKGROUND: { const SvxBrushItem& rBrush = static_cast< SvxBrushItem& >(*pAttr->pItem); - SfxItemSet aNewSet(m_xDoc->GetAttrPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + SfxItemSet aNewSet(m_xDoc->GetAttrPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}); setSvxBrushItemAsFillAttributesToTargetSet(rBrush, aNewSet); m_xDoc->getIDocumentContentOperations().InsertItemSet(*pAttrPam, aNewSet, SetAttrMode::DONTREPLACE); @@ -4835,7 +4835,7 @@ void SwHTMLParser::InsertSpacer() // den Itemset holen SfxItemSet aFrameSet( m_xDoc->GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{} ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs( aFrameSet ); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index ddf3a0c098be..37e38d5c52b4 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -398,7 +398,7 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bRuby ) const SfxPoolItem *pGrabBag = nullptr; SfxItemSet aExportSet(*rNd.GetSwAttrSet().GetPool(), - RES_CHRATR_BEGIN, RES_TXTATR_END - 1); + svl::Items<RES_CHRATR_BEGIN, RES_TXTATR_END - 1>{}); //The hard formatting properties that affect the entire paragraph if (rNd.HasSwAttrSet()) @@ -2784,7 +2784,7 @@ void MSWordExportBase::OutputTextNode( const SwTextNode& rNode ) // Exception: if there is a character style hint at the end of the // paragraph only, then still go with 2), as RES_TXTATR_CHARFMT is always // set as a hint. - SfxItemSet aParagraphMarkerProperties(m_pDoc->GetAttrPool(), RES_CHRATR_BEGIN, RES_TXTATR_END); + SfxItemSet aParagraphMarkerProperties(m_pDoc->GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, RES_TXTATR_END>{}); bool bCharFormatOnly = true; if(const SwpHints* pTextAttrs = rNode.GetpSwpHints()) { diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index ca2e6fcf6da7..ecb31796f019 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -484,8 +484,8 @@ void MSWordExportBase::AbstractNumberingDefinitions() const SfxItemSet* pOutSet = nullptr; // cbGrpprlChpx - SfxItemSet aSet( m_pDoc->GetAttrPool(), RES_CHRATR_BEGIN, - RES_CHRATR_END ); + SfxItemSet aSet( m_pDoc->GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, + RES_CHRATR_END>{} ); if ( rFormat.GetCharFormat() || bWriteBullet ) { if ( bWriteBullet ) diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index 7fd7459d5ec4..03cca10e99ae 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1062,7 +1062,7 @@ sal_uInt16 MSWordSections::NumberOfColumns( const SwDoc &rDoc, const WW8_SepInfo } const SfxItemSet &rSet = pPd->GetMaster().GetAttrSet(); - SfxItemSet aSet( *rSet.GetPool(), RES_COL, RES_COL ); + SfxItemSet aSet( *rSet.GetPool(), svl::Items<RES_COL, RES_COL>{} ); aSet.SetParent( &rSet ); //0xffffffff, what the hell is going on with that!, fixme most terribly diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 0927c58eb81e..2048387249e8 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2087,7 +2087,7 @@ static sal_uInt16 lcl_TCFlags(SwDoc &rDoc, const SwTableBox * pBox, sal_Int32 nR const SwContentNode * pCNd = pSttNd->GetNodes().GoNext( &aIdx ); if( pCNd && pCNd->IsTextNode()) { - SfxItemSet aCoreSet(rDoc.GetAttrPool(), RES_CHRATR_ROTATE, RES_CHRATR_ROTATE); + SfxItemSet aCoreSet(rDoc.GetAttrPool(), svl::Items<RES_CHRATR_ROTATE, RES_CHRATR_ROTATE>{}); static_cast<const SwTextNode*>(pCNd)->GetAttr( aCoreSet, 0, static_cast<const SwTextNode*>(pCNd)->GetText().getLength()); const SfxPoolItem * pRotItem; if ( SfxItemState::SET == aCoreSet.GetItemState(RES_CHRATR_ROTATE, true, &pRotItem)) diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 0caf73a064a1..da52344e2545 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -782,10 +782,9 @@ void MSWordExportBase::OutputFormat( const SwFormat& rFormat, bool bPapFormat, b { const SwFrameFormat &rFrameFormat = m_pParentFrame->GetFrameFormat(); - SfxItemSet aSet(m_pDoc->GetAttrPool(), RES_FRMATR_BEGIN, + SfxItemSet aSet(m_pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1, - XATTR_FILL_FIRST, XATTR_FILL_LAST, - 0); + XATTR_FILL_FIRST, XATTR_FILL_LAST>{}); aSet.Set(rFrameFormat.GetAttrSet()); // Fly as character becomes a paragraph bound @@ -3064,8 +3063,8 @@ void WW8Export::WriteFootnoteBegin( const SwFormatFootnote& rFootnote, ww::bytes { ww::bytes* pOld = pO; pO = &aOutArr; - SfxItemSet aSet( m_pDoc->GetAttrPool(), RES_CHRATR_FONT, - RES_CHRATR_FONT ); + SfxItemSet aSet( m_pDoc->GetAttrPool(), svl::Items<RES_CHRATR_FONT, + RES_CHRATR_FONT>{} ); pCFormat = pInfo->GetCharFormat( *m_pDoc ); aSet.Set( pCFormat->GetAttrSet() ); diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 7479e709577d..74c6a920b2c9 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -1124,7 +1124,7 @@ void SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj, if( pRecord ) { SfxItemSet aFlySet( m_rDoc.GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{} ); tools::Rectangle aInnerDist( pRecord->nDxTextLeft, pRecord->nDyTextTop, @@ -2533,7 +2533,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) // when in a header or footer word appears to treat all elements as wrap through // Umfluss-Modus ermitteln - SfxItemSet aFlySet(m_rDoc.GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1); + SfxItemSet aFlySet(m_rDoc.GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{}); css::text::WrapTextMode eSurround = css::text::WrapTextMode_PARALLEL; bool bContour = false; switch (pF->nwr) @@ -2849,7 +2849,7 @@ SwFrameFormat* SwWW8ImplReader::MungeTextIntoDrawBox(SdrObject* pTrueObject, { // use ww8-default border distance SfxItemSet aItemSet(m_pDrawModel->GetItemPool(), - SDRATTR_TEXT_LEFTDIST, SDRATTR_TEXT_LOWERDIST); + svl::Items<SDRATTR_TEXT_LEFTDIST, SDRATTR_TEXT_LOWERDIST>{}); aItemSet.Put( makeSdrTextLeftDistItem( pRecord->nDxTextLeft ) ); aItemSet.Put( makeSdrTextRightDistItem( pRecord->nDxTextRight ) ); aItemSet.Put( makeSdrTextUpperDistItem( pRecord->nDyTextTop ) ); @@ -2998,7 +2998,7 @@ SwFlyFrameFormat* SwWW8ImplReader::ImportReplaceableDrawables( SdrObject* &rpObj rFlySet.Put(SwFormatFrameSize(ATT_FIX_SIZE, nWidthTw, nHeightTw)); - SfxItemSet aGrSet(m_rDoc.GetAttrPool(), RES_GRFATR_BEGIN, RES_GRFATR_END-1); + SfxItemSet aGrSet(m_rDoc.GetAttrPool(), svl::Items<RES_GRFATR_BEGIN, RES_GRFATR_END-1>{}); if (pRecord) { diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index 5aa5d6fe0085..d34c32ca003e 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -558,8 +558,8 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj, if (pObject) { // for the frame - SfxItemSet aAttrSet( m_rDoc.GetAttrPool(), RES_FRMATR_BEGIN, - RES_FRMATR_END-1 ); + SfxItemSet aAttrSet( m_rDoc.GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, + RES_FRMATR_END-1>{} ); SvxMSDffImportRec const*const pRecord = (1 == aData.size()) ? aData.begin()->get() : nullptr; @@ -623,8 +623,8 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj* pTextObj, } // for the graphic - SfxItemSet aGrSet( m_rDoc.GetAttrPool(), RES_GRFATR_BEGIN, - RES_GRFATR_END-1 ); + SfxItemSet aGrSet( m_rDoc.GetAttrPool(), svl::Items<RES_GRFATR_BEGIN, + RES_GRFATR_END-1>{} ); if( aPD.nCL || aPD.nCR || aPD.nCT || aPD.nCB ) { diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index f80ce894dad6..22ca6889474d 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -1485,7 +1485,7 @@ const SfxPoolItem* SwWW8FltControlStack::GetFormatAttr(const SwPosition& rPos, if (pNd->IsTextNode()) { const sal_Int32 nPos = rPos.nContent.GetIndex(); - SfxItemSet aSet(pDoc->GetAttrPool(), nWhich, nWhich); + SfxItemSet aSet(pDoc->GetAttrPool(), {{nWhich, nWhich}}); if (pNd->GetTextNode()->GetAttr(aSet, nPos, nPos)) pItem = aSet.GetItem(nWhich); } diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 99feec026987..bd32af41ddae 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -1860,7 +1860,7 @@ WW8TabDesc::WW8TabDesc(SwWW8ImplReader* pIoClass, WW8_CP nStartCp) : m_pTable(nullptr), m_pParentPos(nullptr), m_pFlyFormat(nullptr), - m_aItemSet(m_pIo->m_rDoc.GetAttrPool(),RES_FRMATR_BEGIN,RES_FRMATR_END-1) + m_aItemSet(m_pIo->m_rDoc.GetAttrPool(),svl::Items<RES_FRMATR_BEGIN,RES_FRMATR_END-1>{}) { m_pIo->m_bAktAND_fNumberAcross = false; @@ -3537,7 +3537,7 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp) { m_pTableDesc->m_pParentPos = new SwPosition(*m_pPaM->GetPoint()); SfxItemSet aItemSet(m_rDoc.GetAttrPool(), - RES_FRMATR_BEGIN, RES_FRMATR_END-1); + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{}); // #i33818# - anchor the Writer fly frame for the nested table at-character. // #i45301# SwFormatAnchor aAnchor( eAnchor ); diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 48809b436ced..811923bbd77f 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -678,7 +678,7 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet } // create new Itemset for character attributes - rpItemSet.reset(new SfxItemSet( rDoc.GetAttrPool(), RES_CHRATR_BEGIN, RES_CHRATR_END - 1)); + rpItemSet.reset(new SfxItemSet( rDoc.GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1>{})); // Set Reader-ItemSet-Pointer to the newly created set rReader.SetAktItemSet(rpItemSet.get()); @@ -1852,8 +1852,8 @@ void SwWW8ImplReader::RegisterNumFormatOnTextNode(sal_uInt16 nActLFO, if (bApplyListLevelIndentDirectlyAtPara) { - SfxItemSet aListIndent(m_rDoc.GetAttrPool(), RES_LR_SPACE, - RES_LR_SPACE); + SfxItemSet aListIndent(m_rDoc.GetAttrPool(), svl::Items<RES_LR_SPACE, + RES_LR_SPACE>{}); const SvxLRSpaceItem *pItem = static_cast<const SvxLRSpaceItem*>( GetFormatAttr(RES_LR_SPACE)); OSL_ENSURE(pItem, "impossible"); diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index ac6d9d4c4525..4a859a7a09fb 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -257,8 +257,8 @@ SwFrameFormat* SwWW8ImplReader::ImportOle(const Graphic* pGrf, SfxItemSet* pTempSet = nullptr; if( !pFlySet ) { - pTempSet = new SfxItemSet( m_rDoc.GetAttrPool(), RES_FRMATR_BEGIN, - RES_FRMATR_END-1); + pTempSet = new SfxItemSet( m_rDoc.GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, + RES_FRMATR_END-1>{}); pFlySet = pTempSet; diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 67e7eb60a501..32acea9229c2 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2307,7 +2307,7 @@ WW8PostProcessAttrsInfo::WW8PostProcessAttrsInfo(WW8_CP nCpStart, WW8_CP nCpEnd, , mnCpStart(nCpStart) , mnCpEnd(nCpEnd) , mPaM(*rPaM.GetMark(), *rPaM.GetPoint()) - , mItemSet(rPaM.GetDoc()->GetAttrPool(), RES_CHRATR_BEGIN, RES_PARATR_END - 1) + , mItemSet(rPaM.GetDoc()->GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, RES_PARATR_END - 1>{}) { } @@ -2396,8 +2396,8 @@ eF_ResT SwWW8ImplReader::Read_F_IncludePicture( WW8FieldDesc*, OUString& rStr ) that we have inserted a graphic link and the suiting SwAttrSet will be inserted into the frame format. */ - SfxItemSet aFlySet( m_rDoc.GetAttrPool(), RES_FRMATR_BEGIN, - RES_FRMATR_END-1 ); + SfxItemSet aFlySet( m_rDoc.GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, + RES_FRMATR_END-1>{} ); aFlySet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ) ); aFlySet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME )); m_pFlyFormatOfJustInsertedGraphic = @@ -3400,7 +3400,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr ) if ( nIndexCols > 1 ) { // Set the column number for index - SfxItemSet aSet( m_rDoc.GetAttrPool(), RES_COL, RES_COL ); + SfxItemSet aSet( m_rDoc.GetAttrPool(), svl::Items<RES_COL, RES_COL>{} ); SwFormatCol aCol; aCol.Init( nIndexCols, 708, USHRT_MAX ); aSet.Put( aCol ); diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index e80a66cf1617..f5752a43481c 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -2045,7 +2045,7 @@ void WW8SwFlyPara::BoxUpWidth( long nInWidth ) // WW8FlySet-ctor for Apos and graphics Apos WW8FlySet::WW8FlySet(SwWW8ImplReader& rReader, const WW8FlyPara* pFW, const WW8SwFlyPara* pFS, bool bGraf) - : SfxItemSet(rReader.m_rDoc.GetAttrPool(),RES_FRMATR_BEGIN,RES_FRMATR_END-1) + : SfxItemSet(rReader.m_rDoc.GetAttrPool(),svl::Items<RES_FRMATR_BEGIN,RES_FRMATR_END-1>{}) { if (!rReader.m_bNewDoc) Reader::ResetFrameFormatAttrs(*this); // remove distance/border @@ -2101,7 +2101,7 @@ WW8FlySet::WW8FlySet(SwWW8ImplReader& rReader, const WW8FlyPara* pFW, // WW8FlySet-ctor for character bound graphics WW8FlySet::WW8FlySet( SwWW8ImplReader& rReader, const SwPaM* pPaM, const WW8_PIC& rPic, long nWidth, long nHeight ) - : SfxItemSet(rReader.m_rDoc.GetAttrPool(),RES_FRMATR_BEGIN,RES_FRMATR_END-1) + : SfxItemSet(rReader.m_rDoc.GetAttrPool(),svl::Items<RES_FRMATR_BEGIN,RES_FRMATR_END-1>{}) { Init(rReader, pPaM); @@ -2154,8 +2154,8 @@ void WW8FlySet::Init(const SwWW8ImplReader& rReader, const SwPaM* pPaM) WW8DupProperties::WW8DupProperties(SwDoc &rDoc, SwWW8FltControlStack *pStack) : pCtrlStck(pStack), - aChrSet(rDoc.GetAttrPool(), RES_CHRATR_BEGIN, RES_CHRATR_END - 1 ), - aParSet(rDoc.GetAttrPool(), RES_PARATR_BEGIN, RES_PARATR_END - 1 ) + aChrSet(rDoc.GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1>{} ), + aParSet(rDoc.GetAttrPool(), svl::Items<RES_PARATR_BEGIN, RES_PARATR_END - 1>{} ) { //Close any open character properties and duplicate them inside the //first table cell @@ -2357,7 +2357,7 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, const WW8_TablePos *p if (IsDropCap()) { m_bDropCap = true; - m_pAktItemSet = new SfxItemSet( m_rDoc.GetAttrPool(), RES_CHRATR_BEGIN, RES_PARATR_END - 1 ); + m_pAktItemSet = new SfxItemSet( m_rDoc.GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, RES_PARATR_END - 1>{} ); return false; } diff --git a/sw/source/filter/xml/xmlfmt.cxx b/sw/source/filter/xml/xmlfmt.cxx index ec0ac4cb77d0..8f60091126c1 100644 --- a/sw/source/filter/xml/xmlfmt.cxx +++ b/sw/source/filter/xml/xmlfmt.cxx @@ -486,7 +486,7 @@ SvXMLImportContext *SwXMLItemSetStyleContext_Impl::CreateItemSetContext( pItemSet.reset( new SfxItemSet( rItemPool, aTableSetRange ) ); break; case XML_STYLE_FAMILY_TABLE_COLUMN: - pItemSet.reset( new SfxItemSet( rItemPool, RES_FRM_SIZE, RES_FRM_SIZE, 0 ) ); + pItemSet.reset( new SfxItemSet( rItemPool, svl::Items<RES_FRM_SIZE, RES_FRM_SIZE>{} ) ); break; case XML_STYLE_FAMILY_TABLE_ROW: pItemSet.reset( new SfxItemSet( rItemPool, aTableLineSetRange ) ); diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 410122a478c4..27ac77c0143b 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -233,8 +233,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( SAL_WARN_IF(!pTextCursor, "sw.uno", "SwXTextCursor missing"); SwDoc *pDoc = SwImport::GetDocFromXMLImport( rImport ); - SfxItemSet aItemSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, - RES_FRMATR_END ); + SfxItemSet aItemSet( pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, + RES_FRMATR_END>{} ); Size aTwipSize( 0, 0 ); tools::Rectangle aVisArea( 0, 0, nWidth, nHeight ); lcl_putHeightAndWidth( aItemSet, nHeight, nWidth, @@ -548,8 +548,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink( OSL_ENSURE( pTextCursor, "SwXTextCursor missing" ); SwDoc *pDoc = SwImport::GetDocFromXMLImport( rImport ); - SfxItemSet aItemSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, - RES_FRMATR_END ); + SfxItemSet aItemSet( pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, + RES_FRMATR_END>{} ); Size aTwipSize( 0, 0 ); lcl_putHeightAndWidth( aItemSet, nHeight, nWidth, &aTwipSize.Height(), &aTwipSize.Width() ); @@ -636,8 +636,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertApplet( OSL_ENSURE( pTextCursor, "SwXTextCursor missing" ); SwDoc *pDoc = pTextCursor->GetDoc(); - SfxItemSet aItemSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, - RES_FRMATR_END ); + SfxItemSet aItemSet( pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, + RES_FRMATR_END>{} ); lcl_putHeightAndWidth( aItemSet, nHeight, nWidth); SwApplet_Impl aAppletImpl ( aItemSet ); @@ -682,8 +682,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin( OSL_ENSURE( pTextCursor, "SwXTextCursor missing" ); SwDoc *pDoc = pTextCursor->GetDoc(); - SfxItemSet aItemSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, - RES_FRMATR_END ); + SfxItemSet aItemSet( pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, + RES_FRMATR_END>{} ); lcl_putHeightAndWidth( aItemSet, nHeight, nWidth); // We'll need a (valid) URL, or we need a MIME type. If we don't have @@ -765,8 +765,8 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra OSL_ENSURE( pTextCursor, "SwXTextCursor missing" ); SwDoc *pDoc = pTextCursor->GetDoc(); - SfxItemSet aItemSet( pDoc->GetAttrPool(), RES_FRMATR_BEGIN, - RES_FRMATR_END ); + SfxItemSet aItemSet( pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, + RES_FRMATR_END>{} ); lcl_putHeightAndWidth( aItemSet, nHeight, nWidth); ScrollingMode eScrollMode = ScrollingMode::Auto; diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index c2112d8fd994..e7a92eb8d293 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -252,7 +252,7 @@ bool SwDropCapsPict::GetNextScriptSegment(size_t &nIdx, sal_Int32 &start, sal_In void SwDropCapsPict::GetFontSettings( const SwDropCapsPage& _rPage, vcl::Font& _rFont, sal_uInt16 _nWhich ) { - SfxItemSet aSet( _rPage.rSh.GetAttrPool(), _nWhich, _nWhich); + SfxItemSet aSet( _rPage.rSh.GetAttrPool(), {{_nWhich, _nWhich}}); _rPage.rSh.GetCurAttr(aSet); SvxFontItem aFormatFont(static_cast<const SvxFontItem &>( aSet.Get(_nWhich))); diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx index 96616838f5bd..bd57bdd2d30c 100644 --- a/sw/source/ui/chrdlg/pardlg.cxx +++ b/sw/source/ui/chrdlg/pardlg.cxx @@ -266,8 +266,8 @@ void SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) else if (m_nAreaId == nId) { SfxItemSet aNew(*aSet.GetPool(), - SID_COLOR_TABLE, SID_PATTERN_LIST, - SID_OFFER_IMPORT, SID_OFFER_IMPORT, 0, 0); + svl::Items<SID_COLOR_TABLE, SID_PATTERN_LIST, + SID_OFFER_IMPORT, SID_OFFER_IMPORT>{}); aNew.Put(*GetInputSetImpl()); diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 83e249172f0e..4718cb12736f 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -812,9 +812,8 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet) else { auto pPrinterSet = o3tl::make_unique<SfxItemSet>( *rSet->GetPool(), - SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, - SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, - 0 ); + svl::Items<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, + SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC>{} ); m_pPrt = VclPtr<SfxPrinter>::Create(std::move(pPrinterSet)); } delete m_pFontList; diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index f76d612e3453..f1bb51abe791 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -1052,8 +1052,8 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, if( pSelection && pTableSet ) SetTabSet(); - SfxItemSet aTableSet( rSh.GetAttrPool(), RES_BOXATR_FORMAT, - RES_BOXATR_VALUE ); + SfxItemSet aTableSet( rSh.GetAttrPool(), svl::Items<RES_BOXATR_FORMAT, + RES_BOXATR_VALUE>{} ); bool bIsAutoUpdateCells = rSh.IsAutoUpdateCells(); rSh.SetAutoUpdateCells( false ); diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index 6392e8418a72..0cd4bcaf7c02 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -283,13 +283,12 @@ SwFrameFormat* SwMailMergeLayoutPage::InsertAddressFrame( bool bExample) { // insert the address block and the greeting line - SfxItemSet aSet(rShell.GetAttrPool(), RES_ANCHOR, RES_ANCHOR, + SfxItemSet aSet(rShell.GetAttrPool(), svl::Items<RES_ANCHOR, RES_ANCHOR, RES_VERT_ORIENT, RES_VERT_ORIENT, RES_HORI_ORIENT, RES_HORI_ORIENT, RES_BOX, RES_BOX, RES_FRM_SIZE, RES_FRM_SIZE, - RES_SURROUND, RES_SURROUND, - 0 ); + RES_SURROUND, RES_SURROUND>{} ); aSet.Put(SwFormatAnchor(RndStdIds::FLY_AT_PAGE, 1)); if(bAlignLeft) aSet.Put(SwFormatHoriOrient( 0, text::HoriOrientation::NONE, text::RelOrientation::PAGE_PRINT_AREA )); @@ -693,10 +692,9 @@ IMPL_LINK_NOARG(SwMailMergeLayoutPage, ChangeAddressHdl_Impl, SpinField&, void) long nLeft = static_cast< long >(m_pLeftMF->Denormalize(m_pLeftMF->GetValue(FUNIT_TWIP))); long nTop = static_cast< long >(m_pTopMF->Denormalize(m_pTopMF->GetValue(FUNIT_TWIP))); - SfxItemSet aSet(m_pExampleWrtShell->GetAttrPool(), RES_ANCHOR, RES_ANCHOR, + SfxItemSet aSet(m_pExampleWrtShell->GetAttrPool(), svl::Items<RES_ANCHOR, RES_ANCHOR, RES_VERT_ORIENT, RES_VERT_ORIENT, - RES_HORI_ORIENT, RES_HORI_ORIENT, - 0 ); + RES_HORI_ORIENT, RES_HORI_ORIENT>{} ); if(m_pAlignToBodyCB->IsChecked()) aSet.Put(SwFormatHoriOrient( 0, text::HoriOrientation::NONE, text::RelOrientation::PAGE_PRINT_AREA )); else diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx index 665bd8d7a331..5eb68e8da9f3 100644 --- a/sw/source/ui/dialog/ascfldlg.cxx +++ b/sw/source/ui/dialog/ascfldlg.cxx @@ -183,9 +183,8 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( vcl::Window* pParent, SwDocShell& rDocSh, if( !pPrt ) { auto pSet = o3tl::make_unique<SfxItemSet>( rDocSh.GetPool(), - SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, - SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, - 0 ); + svl::Items<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, + SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC>{} ); pPrt = VclPtr<SfxPrinter>::Create( std::move(pSet) ); bDelPrinter = true; } diff --git a/sw/source/ui/dialog/macassgn.cxx b/sw/source/ui/dialog/macassgn.cxx index e3474777369a..0a38fa43b0b9 100644 --- a/sw/source/ui/dialog/macassgn.cxx +++ b/sw/source/ui/dialog/macassgn.cxx @@ -108,7 +108,7 @@ bool SwMacroAssignDlg::INetFormatDlg( vcl::Window* pParent, SwWrtShell& rSh, SvxMacroItem*& rpINetItem ) { bool bRet = false; - SfxItemSet aSet( rSh.GetAttrPool(), RES_FRMMACRO, RES_FRMMACRO, SID_EVENTCONFIG, SID_EVENTCONFIG, 0 ); + SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_FRMMACRO, RES_FRMMACRO, SID_EVENTCONFIG, SID_EVENTCONFIG>{} ); SvxMacroItem aItem( RES_FRMMACRO ); if( !rpINetItem ) rpINetItem = new SvxMacroItem( RES_FRMMACRO ); diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index ec7da6517db6..bd659c941a1b 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -1049,14 +1049,13 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OptionsHdl, Button*, void) { SectRepr* pSectRepr = static_cast<SectRepr*>(pEntry->GetUserData()); SfxItemSet aSet(rSh.GetView().GetPool(), - RES_COL, RES_COL, + svl::Items<RES_COL, RES_COL, RES_COLUMNBALANCE, RES_FRAMEDIR, RES_BACKGROUND, RES_BACKGROUND, RES_FRM_SIZE, RES_FRM_SIZE, SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, RES_LR_SPACE, RES_LR_SPACE, - RES_FTN_AT_TXTEND, RES_END_AT_TXTEND, - 0); + RES_FTN_AT_TXTEND, RES_END_AT_TXTEND>{}); aSet.Put( pSectRepr->GetCol() ); aSet.Put( pSectRepr->GetBackground() ); diff --git a/sw/source/ui/fldui/fldedt.cxx b/sw/source/ui/fldui/fldedt.cxx index c310348ccfdf..a08c6f7369e6 100644 --- a/sw/source/ui/fldui/fldedt.cxx +++ b/sw/source/ui/fldui/fldedt.cxx @@ -178,7 +178,7 @@ VclPtr<SfxTabPage> SwFieldEditDlg::CreatePage(sal_uInt16 nGroup) case GRP_REG: { SfxObjectShell* pDocSh = SfxObjectShell::Current(); - SfxItemSet* pSet = new SfxItemSet( pDocSh->GetPool(), SID_DOCINFO, SID_DOCINFO ); + SfxItemSet* pSet = new SfxItemSet( pDocSh->GetPool(), svl::Items<SID_DOCINFO, SID_DOCINFO>{} ); using namespace ::com::sun::star; uno::Reference<document::XDocumentPropertiesSupplier> xDPS( pDocSh->GetModel(), uno::UNO_QUERY_THROW); @@ -299,8 +299,7 @@ IMPL_LINK_NOARG(SwFieldEditDlg, AddressHdl, Button*, void) SwField *pCurField = rMgr.GetCurField(); SfxItemSet aSet( pSh->GetAttrPool(), - SID_FIELD_GRABFOCUS, SID_FIELD_GRABFOCUS, - 0L ); + svl::Items<SID_FIELD_GRABFOCUS, SID_FIELD_GRABFOCUS>{} ); EditPosition nEditPos = EditPosition::UNKNOWN; diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx index 12a6cb4dbc92..f0cf404b3bf1 100644 --- a/sw/source/ui/fldui/fldtdlg.cxx +++ b/sw/source/ui/fldui/fldtdlg.cxx @@ -162,7 +162,7 @@ SfxItemSet* SwFieldDlg::CreateInputItemSet( sal_uInt16 nID ) SwDocShell *const pDocSh(static_cast<SwDocShell*>(SfxObjectShell::Current())); if (nID == m_nDokInf && pDocSh) // might not have a shell if the dialog is restored on startup { - SfxItemSet* pISet = new SfxItemSet( pDocSh->GetPool(), SID_DOCINFO, SID_DOCINFO ); + SfxItemSet* pISet = new SfxItemSet( pDocSh->GetPool(), svl::Items<SID_DOCINFO, SID_DOCINFO>{} ); using namespace ::com::sun::star; uno::Reference<document::XDocumentPropertiesSupplier> xDPS( pDocSh->GetModel(), uno::UNO_QUERY_THROW); diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 1c6e913cca02..7a72564183be 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -145,10 +145,9 @@ SwColumnDlg::SwColumnDlg(vcl::Window* pParent, SwWrtShell& rSh) if( pPageDesc ) { pPageSet = new SfxItemSet( rWrtShell.GetAttrPool(), - RES_COL, RES_COL, + svl::Items<RES_COL, RES_COL, RES_FRM_SIZE, RES_FRM_SIZE, - RES_LR_SPACE, RES_LR_SPACE, - 0 ); + RES_LR_SPACE, RES_LR_SPACE>{} ); const SwFrameFormat &rFormat = pPageDesc->GetMaster(); nPageWidth = rFormat.GetFrameSize().GetSize().Width(); @@ -318,7 +317,7 @@ IMPL_LINK_NOARG(SwColumnDlg, OkHdl, Button*, void) } if(pFrameSet && SfxItemState::SET == pFrameSet->GetItemState(RES_COL) && bFrameChanged) { - SfxItemSet aTmp(*pFrameSet->GetPool(), RES_COL, RES_COL); + SfxItemSet aTmp(*pFrameSet->GetPool(), svl::Items<RES_COL, RES_COL>{}); aTmp.Put(*pFrameSet); rWrtShell.StartAction(); rWrtShell.Push(); diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx index 96282d5fc67b..5294a92f3e5a 100644 --- a/sw/source/ui/frmdlg/frmdlg.cxx +++ b/sw/source/ui/frmdlg/frmdlg.cxx @@ -194,8 +194,8 @@ void SwFrameDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) else if (nId == m_nAreaId) { SfxItemSet aNew(*GetInputSetImpl()->GetPool(), - SID_COLOR_TABLE, SID_PATTERN_LIST, - SID_OFFER_IMPORT, SID_OFFER_IMPORT, 0, 0); + svl::Items<SID_COLOR_TABLE, SID_PATTERN_LIST, + SID_OFFER_IMPORT, SID_OFFER_IMPORT>{}); aNew.Put(m_rSet); diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index 1d07e066f894..a04f5c8fdc8c 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -345,7 +345,7 @@ void SwIndexMarkPane::UpdateLanguageDependenciesForPhoneticReading() case SvtScriptType::COMPLEX:nWhich = RES_CHRATR_CTL_LANGUAGE; break; default:nWhich = RES_CHRATR_LANGUAGE; break; } - SfxItemSet aLangSet(pSh->GetAttrPool(), nWhich, nWhich); + SfxItemSet aLangSet(pSh->GetAttrPool(), {{nWhich, nWhich}}); pSh->GetCurAttr(aLangSet); nLangForPhoneticReading = static_cast<const SvxLanguageItem&>(aLangSet.Get(nWhich)).GetLanguage(); } diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index 755aeb4759f2..27fb6a2d1287 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -58,7 +58,7 @@ void SwFootNoteOptionDlg::PageCreated( sal_uInt16 /*nId*/, SfxTabPage &rPage ) IMPL_LINK( SwFootNoteOptionDlg, OkHdl, Button *, pBtn, void ) { - SfxItemSet aDummySet(rSh.GetAttrPool(), 1, 1 ); + SfxItemSet aDummySet(rSh.GetAttrPool(), svl::Items<1, 1>{} ); SfxTabPage *pPage = GetTabPage( m_nFootNoteId ); if ( pPage ) pPage->FillItemSet( &aDummySet ); diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 7b5b3e80efcc..f1379fe97251 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -525,7 +525,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn, bool ) } else if (sItemIdent == "macro") { - SfxItemSet aSet( pSh->GetAttrPool(), RES_FRMMACRO, RES_FRMMACRO, SID_EVENTCONFIG, SID_EVENTCONFIG, 0 ); + SfxItemSet aSet( pSh->GetAttrPool(), svl::Items<RES_FRMMACRO, RES_FRMMACRO, SID_EVENTCONFIG, SID_EVENTCONFIG>{} ); SvxMacro aStart(aEmptyOUStr, aEmptyOUStr, STARBASIC); SvxMacro aEnd(aEmptyOUStr, aEmptyOUStr, STARBASIC); diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index 13eef0bcc73e..e6c785e5051d 100644 --- a/sw/source/ui/misc/insfnote.cxx +++ b/sw/source/ui/misc/insfnote.cxx @@ -59,7 +59,7 @@ void SwInsFootNoteDlg::Apply() if( rSh.SetCurFootnote( aNote ) && bExtCharAvailable ) { rSh.Right(CRSR_SKIP_CHARS, true, 1, false ); - SfxItemSet aSet( rSh.GetAttrPool(), RES_CHRATR_FONT, RES_CHRATR_FONT ); + SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONT>{} ); rSh.GetCurAttr( aSet ); const SvxFontItem &rFont = static_cast<const SvxFontItem &>( aSet.Get( RES_CHRATR_FONT )); SvxFontItem aFont( rFont.GetFamily(), m_aFontName, @@ -102,7 +102,7 @@ IMPL_LINK_NOARG(SwInsFootNoteDlg, NumberExtCharHdl, Button*, void) { m_pNumberCharBtn->Check(); - SfxItemSet aSet( rSh.GetAttrPool(), RES_CHRATR_FONT, RES_CHRATR_FONT ); + SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONT>{} ); rSh.GetCurAttr( aSet ); const SvxFontItem &rFont = static_cast<const SvxFontItem &>( aSet.Get( RES_CHRATR_FONT ) ); @@ -231,7 +231,7 @@ void SwInsFootNoteDlg::Init() sNumStr = aFootnoteNote.GetNumStr(); rSh.Right(CRSR_SKIP_CHARS, true, 1, false ); - SfxItemSet aSet( rSh.GetAttrPool(), RES_CHRATR_FONT, RES_CHRATR_FONT ); + SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONT>{} ); rSh.GetCurAttr( aSet ); const SvxFontItem &rFont = static_cast<const SvxFontItem &>( aSet.Get( RES_CHRATR_FONT ) ); diff --git a/sw/source/ui/misc/titlepage.cxx b/sw/source/ui/misc/titlepage.cxx index 14751a4ecafa..5fcefe0451c6 100644 --- a/sw/source/ui/misc/titlepage.cxx +++ b/sw/source/ui/misc/titlepage.cxx @@ -32,7 +32,7 @@ namespace bool lcl_GetPageDesc(SwWrtShell *pSh, sal_uInt16 &rPageNo, const SwFormatPageDesc **ppPageFormatDesc) { bool bRet = false; - SfxItemSet aSet( pSh->GetAttrPool(), RES_PAGEDESC, RES_PAGEDESC ); + SfxItemSet aSet( pSh->GetAttrPool(), svl::Items<RES_PAGEDESC, RES_PAGEDESC>{} ); if (pSh->GetCurAttr( aSet )) { const SfxPoolItem* pItem(nullptr); diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx index 9d24de198036..de15a21570a6 100644 --- a/sw/source/uibase/app/appenv.cxx +++ b/sw/source/uibase/app/appenv.cxx @@ -183,7 +183,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) // Check if there's already an envelope. bool bEnvChange = false; - SfxItemSet aSet(GetPool(), FN_ENVELOP, FN_ENVELOP, 0); + SfxItemSet aSet(GetPool(), svl::Items<FN_ENVELOP, FN_ENVELOP>{}); aSet.Put(aEnvCfg.GetItem()); SfxPrinter* pTempPrinter = pSh->getIDocumentDeviceAccess().getPrinter( true ); @@ -302,7 +302,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) { pSh->SplitNode(); pSh->Right( CRSR_SKIP_CHARS, false, 1, false ); - SfxItemSet aBreakSet( pSh->GetAttrPool(), RES_PAGEDESC, RES_PAGEDESC, 0 ); + SfxItemSet aBreakSet( pSh->GetAttrPool(), svl::Items<RES_PAGEDESC, RES_PAGEDESC>{} ); aBreakSet.Put( SwFormatPageDesc( pFollow ) ); pSh->SetTableAttr( aBreakSet ); } diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx index a55e3962592d..56c5cf609e4a 100644 --- a/sw/source/uibase/app/applab.cxx +++ b/sw/source/uibase/app/applab.cxx @@ -84,8 +84,8 @@ static const SwFrameFormat *lcl_InsertBCText( SwWrtShell& rSh, const SwLabItem& SwFrameFormat &rFormat, sal_uInt16 nCol, sal_uInt16 nRow ) { - SfxItemSet aSet(rSh.GetAttrPool(), RES_ANCHOR, RES_ANCHOR, - RES_VERT_ORIENT, RES_VERT_ORIENT, RES_HORI_ORIENT, RES_HORI_ORIENT, 0 ); + SfxItemSet aSet(rSh.GetAttrPool(), svl::Items<RES_ANCHOR, RES_ANCHOR, + RES_VERT_ORIENT, RES_VERT_ORIENT, RES_HORI_ORIENT, RES_HORI_ORIENT>{} ); sal_uInt16 nPhyPageNum, nVirtPageNum; rSh.GetPageNum( nPhyPageNum, nVirtPageNum ); @@ -121,8 +121,8 @@ static const SwFrameFormat *lcl_InsertLabText( SwWrtShell& rSh, const SwLabItem& SwFrameFormat &rFormat, SwFieldMgr& rFieldMgr, sal_uInt16 nCol, sal_uInt16 nRow, bool bLast ) { - SfxItemSet aSet(rSh.GetAttrPool(), RES_ANCHOR, RES_ANCHOR, - RES_VERT_ORIENT, RES_VERT_ORIENT, RES_HORI_ORIENT, RES_HORI_ORIENT, 0 ); + SfxItemSet aSet(rSh.GetAttrPool(), svl::Items<RES_ANCHOR, RES_ANCHOR, + RES_VERT_ORIENT, RES_VERT_ORIENT, RES_HORI_ORIENT, RES_HORI_ORIENT>{} ); sal_uInt16 nPhyPageNum, nVirtPageNum; rSh.GetPageNum( nPhyPageNum, nVirtPageNum ); @@ -165,7 +165,7 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel) SwLabCfgItem aLabCfg(bLabel); // Move up Dialog - SfxItemSet aSet( GetPool(), FN_LABEL, FN_LABEL, 0 ); + SfxItemSet aSet( GetPool(), svl::Items<FN_LABEL, FN_LABEL>{} ); aSet.Put( aLabCfg.GetItem() ); SwAbstractDialogFactory* pDialogFactory = SwAbstractDialogFactory::Create(); diff --git a/sw/source/uibase/app/appopt.cxx b/sw/source/uibase/app/appopt.cxx index 9db1a4b61002..3db438e1e7c2 100644 --- a/sw/source/uibase/app/appopt.cxx +++ b/sw/source/uibase/app/appopt.cxx @@ -97,7 +97,7 @@ std::unique_ptr<SfxItemSet> SwModule::CreateItemSet( sal_uInt16 nId ) } // Options/Edit - auto pRet = o3tl::make_unique<SfxItemSet>(GetPool(), FN_PARAM_DOCDISP, FN_PARAM_ELEM, + auto pRet = o3tl::make_unique<SfxItemSet>(GetPool(), svl::Items<FN_PARAM_DOCDISP, FN_PARAM_ELEM, SID_PRINTPREVIEW, SID_PRINTPREVIEW, SID_ATTR_GRID_OPTIONS, SID_ATTR_GRID_OPTIONS, FN_PARAM_PRINTER, FN_PARAM_STDFONTS, @@ -113,11 +113,7 @@ std::unique_ptr<SfxItemSet> SwModule::CreateItemSet( sal_uInt16 nId ) FN_HSCROLL_METRIC, FN_VSCROLL_METRIC, SID_ATTR_LANGUAGE, SID_ATTR_LANGUAGE, SID_ATTR_CHAR_CJK_LANGUAGE, SID_ATTR_CHAR_CJK_LANGUAGE, - SID_ATTR_CHAR_CTL_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE, -#if OSL_DEBUG_LEVEL > 1 - FN_PARAM_SWTEST, FN_PARAM_SWTEST, -#endif - 0); + SID_ATTR_CHAR_CTL_LANGUAGE, SID_ATTR_CHAR_CTL_LANGUAGE>{}); pRet->Put( SwDocDisplayItem( aViewOpt ) ); pRet->Put( SwElemItem( aViewOpt ) ); diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index f5c6316ddbac..ad675dfd9b0c 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -363,7 +363,7 @@ void SwDocShell::Execute(SfxRequest& rReq) pAFlags->pSmartTagMgr = &SwSmartTagMgr::Get(); - SfxItemSet aSet( pApp->GetPool(), SID_AUTO_CORRECT_DLG, SID_AUTO_CORRECT_DLG, SID_OPEN_SMARTTAGOPTIONS, SID_OPEN_SMARTTAGOPTIONS, 0 ); + SfxItemSet aSet( pApp->GetPool(), svl::Items<SID_AUTO_CORRECT_DLG, SID_AUTO_CORRECT_DLG, SID_OPEN_SMARTTAGOPTIONS, SID_OPEN_SMARTTAGOPTIONS>{} ); aSet.Put( aSwOptions ); const SfxPoolItem* pOpenSmartTagOptionsItem = nullptr; diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx index 55dab8a712ad..30b7a1da172e 100644 --- a/sw/source/uibase/app/docstyle.cxx +++ b/sw/source/uibase/app/docstyle.cxx @@ -462,7 +462,7 @@ SwDocStyleSheet::SwDocStyleSheet( SwDoc& rDocument, pBoxFormat(nullptr), rDoc(rDocument), aCoreSet(GetPool().GetPool(), // sorted by indices, one double removed - RES_CHRATR_BEGIN, RES_CHRATR_END - 1, // [1 + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1, // [1 RES_PARATR_BEGIN, RES_PARATR_END - 1, // [60 RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1, // [77 RES_FRMATR_BEGIN, RES_FRMATR_END - 1, // [82 @@ -488,8 +488,7 @@ SwDocStyleSheet::SwDocStyleSheet( SwDoc& rDocument, SID_ATTR_NUMBERING_RULE, SID_ATTR_NUMBERING_RULE, // [10855 SID_ATTR_AUTO_STYLE_UPDATE, SID_ATTR_AUTO_STYLE_UPDATE, // [12065 FN_PARAM_FTN_INFO, FN_PARAM_FTN_INFO, // [21123 - FN_COND_COLL, FN_COND_COLL, // [22401 - 0), + FN_COND_COLL, FN_COND_COLL>{}), // [22401 bPhysical(false) { nHelpId = UCHAR_MAX; diff --git a/sw/source/uibase/dialog/regionsw.cxx b/sw/source/uibase/dialog/regionsw.cxx index ef18d8c2a52f..2402b661675d 100644 --- a/sw/source/uibase/dialog/regionsw.cxx +++ b/sw/source/uibase/dialog/regionsw.cxx @@ -62,14 +62,13 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) const SfxItemSet *pSet = rReq.GetArgs(); SfxItemSet aSet(GetPool(), - RES_COL, RES_COL, + svl::Items<RES_COL, RES_COL, RES_LR_SPACE, RES_LR_SPACE, RES_COLUMNBALANCE, RES_FRAMEDIR, RES_BACKGROUND, RES_BACKGROUND, RES_FRM_SIZE, RES_FRM_SIZE, RES_FTN_AT_TXTEND, RES_END_AT_TXTEND, - SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, - 0); + SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE>{}); if (!pSet || pSet->Count()==0) { @@ -181,11 +180,10 @@ IMPL_LINK( SwWrtShell, InsertRegionDialog, void*, p, void ) if (xSectionData.get()) { SfxItemSet aSet(GetView().GetPool(), - RES_COL, RES_COL, + svl::Items<RES_COL, RES_COL, RES_BACKGROUND, RES_BACKGROUND, RES_FRM_SIZE, RES_FRM_SIZE, - SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, - 0); + SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE>{}); SwRect aRect; CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR); long nWidth = aRect.Width(); diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 0dd00ae68382..501d6fcd456d 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -470,7 +470,7 @@ bool SwTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo } if( m_pWrtShell->IsFrameSelected() ) { - SfxItemSet aSet( m_pWrtShell->GetAttrPool(), RES_URL, RES_URL ); + SfxItemSet aSet( m_pWrtShell->GetAttrPool(), svl::Items<RES_URL, RES_URL>{} ); m_pWrtShell->GetFlyFrameAttr( aSet ); const SwFormatURL& rURL = static_cast<const SwFormatURL&>(aSet.Get( RES_URL )); if( rURL.GetMap() ) @@ -991,7 +991,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut ) if( m_pWrtShell->IsFrameSelected() ) { - SfxItemSet aSet( m_pWrtShell->GetAttrPool(), RES_URL, RES_URL ); + SfxItemSet aSet( m_pWrtShell->GetAttrPool(), svl::Items<RES_URL, RES_URL>{} ); m_pWrtShell->GetFlyFrameAttr( aSet ); const SwFormatURL& rURL = static_cast<const SwFormatURL&>(aSet.Get( RES_URL )); if( rURL.GetMap() ) @@ -1997,7 +1997,7 @@ bool SwTransferable::PasteTargetURL( TransferableDataHelper& rData, if( bRet ) { - SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); + SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) ); @@ -2387,7 +2387,7 @@ bool SwTransferable::PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, { if( rSh.IsFrameSelected() ) { - SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); + SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) ); aURL.SetURL( aBkmk.GetURL(), false ); @@ -2443,7 +2443,7 @@ bool SwTransferable::PasteGrf( TransferableDataHelper& rData, SwWrtShell& rSh, aMap.Read( *pStream, IMAP_FORMAT_DETECT ) == IMAP_ERR_OK && aMap.GetIMapObjectCount() ) { - SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); + SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) ); aURL.SetMap( &aMap ); @@ -2462,7 +2462,7 @@ bool SwTransferable::PasteImageMap( TransferableDataHelper& rData, bool bRet = false; if( rData.HasFormat( SotClipboardFormatId::SVIM )) { - SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); + SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) ); const ImageMap* pOld = aURL.GetMap(); @@ -2503,7 +2503,7 @@ bool SwTransferable::PasteAsHyperlink( TransferableDataHelper& rData, case OBJCNT_GRF: case OBJCNT_OLE: { - SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); + SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL2( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) ); aURL2.SetURL( sFile, false ); @@ -2597,7 +2597,7 @@ bool SwTransferable::PasteFileName( TransferableDataHelper& rData, case OBJCNT_GRF: case OBJCNT_OLE: { - SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); + SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL2( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) ); aURL2.SetURL( sFile, false ); @@ -3128,7 +3128,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos ) if( m_pWrtShell->IsFrameSelected() ) { - SfxItemSet aSet( m_pWrtShell->GetAttrPool(), RES_URL, RES_URL ); + SfxItemSet aSet( m_pWrtShell->GetAttrPool(), svl::Items<RES_URL, RES_URL>{} ); m_pWrtShell->GetFlyFrameAttr( aSet ); const SwFormatURL& rURL = static_cast<const SwFormatURL&>(aSet.Get( RES_URL )); if( rURL.GetMap() ) @@ -3338,7 +3338,7 @@ bool SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, // not yet consider Draw objects if( SelectionType::Graphic & nSelection ) { - SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); + SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) ); aURL.SetURL( aTmp.GetURL(), false ); diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx index f0097c6f2931..0feb53f1e972 100644 --- a/sw/source/uibase/docvw/HeaderFooterWin.cxx +++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx @@ -419,10 +419,10 @@ void SwHeaderFooterWin::ExecuteCommand(const OString& rIdent) SfxItemPool* pPool = pHFFormat->GetAttrSet().GetPool(); SfxItemSet aSet( *pPool, - RES_BACKGROUND, RES_BACKGROUND, + svl::Items<RES_BACKGROUND, RES_BACKGROUND, RES_BOX, RES_BOX, SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, - RES_SHADOW, RES_SHADOW, 0 ); + RES_SHADOW, RES_SHADOW>{} ); aSet.Put( pHFFormat->GetAttrSet() ); diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index 6611f113f169..0aabe5fe728f 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -283,9 +283,8 @@ void SwPageBreakWin::Select() pNd->GetDoc()->GetIDocumentUndoRedo( ).StartUndo( SwUndoId::UI_DELETE_PAGE_BREAK, nullptr ); SfxItemSet aSet( GetEditWin()->GetView().GetWrtShell().GetAttrPool(), - RES_PAGEDESC, RES_PAGEDESC, - RES_BREAK, RES_BREAK, - nullptr ); + svl::Items<RES_PAGEDESC, RES_PAGEDESC, + RES_BREAK, RES_BREAK>{} ); aSet.Put( SvxFormatBreakItem( SvxBreak::NONE, RES_BREAK ) ); aSet.Put( SwFormatPageDesc( nullptr ) ); diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 55b4ea914d4a..7b6cbccfa5f9 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -1580,7 +1580,7 @@ void SwPostItMgr::ExecuteFormatAllDialog(SwView& rView) OutlinerView* pOLV = pWin->GetOutlinerView(); SfxItemSet aEditAttr(pOLV->GetAttribs()); SfxItemPool* pPool(SwAnnotationShell::GetAnnotationPool(rView)); - SfxItemSet aDlgAttr(*pPool, EE_ITEMS_START, EE_ITEMS_END); + SfxItemSet aDlgAttr(*pPool, svl::Items<EE_ITEMS_START, EE_ITEMS_END>{}); aDlgAttr.Put(aEditAttr); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg(rView.GetWindow(), rView, aDlgAttr, SwCharDlgMode::Ann)); diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index d1779e0b11b0..84daa3597987 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -787,7 +787,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)) @@ -1010,11 +1010,11 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, bool bWeb ) rSh.IsSelObjProtected( FlyProtectFlags::Pos ) == FlyProtectFlags::NONE ) { SfxItemSet aSet(rSh.GetAttrPool(), - RES_FRM_SIZE, RES_FRM_SIZE, + svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, RES_VERT_ORIENT, RES_ANCHOR, RES_COL, RES_COL, RES_PROTECT, RES_PROTECT, - RES_FOLLOW_TEXT_FLOW, RES_FOLLOW_TEXT_FLOW, 0); + RES_FOLLOW_TEXT_FLOW, RES_FOLLOW_TEXT_FLOW>{}); rSh.GetFlyFrameAttr( aSet ); RndStdIds eAnchorId = static_cast<const SwFormatAnchor&>(aSet.Get(RES_ANCHOR)).GetAnchorId(); Size aSnap; @@ -2242,7 +2242,7 @@ KEYINPUT_CHECKTABLE_INSDEL: eKeyState = SwKeyState::GoIntoFly; else { - SfxItemSet aSet(rSh.GetAttrPool(), RES_TXTATR_INETFMT, RES_TXTATR_INETFMT); + SfxItemSet aSet(rSh.GetAttrPool(), svl::Items<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT>{}); rSh.GetCurAttr(aSet); if(SfxItemState::SET == aSet.GetItemState(RES_TXTATR_INETFMT, false)) { diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx index 2d275b3e5f29..f540d076c1a1 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -1259,7 +1259,7 @@ bool SwFieldMgr::InsertField( } SfxItemSet aBoxSet( pCurShell->GetAttrPool(), - RES_BOXATR_FORMULA, RES_BOXATR_FORMULA ); + svl::Items<RES_BOXATR_FORMULA, RES_BOXATR_FORMULA>{} ); OUString sFormula(comphelper::string::stripStart(rData.m_sPar2, ' ')); if ( sFormula.startsWith("=") ) diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx index 96a76fe4437e..3b9c1212159e 100644 --- a/sw/source/uibase/frmdlg/colex.cxx +++ b/sw/source/uibase/frmdlg/colex.cxx @@ -129,7 +129,7 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet ) { // create FillAttributes from SvxBrushItem //SetHdColor(rItem.GetColor()); const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rHeaderSet.Get(RES_BACKGROUND)); - 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); setHeaderFillAttributes( @@ -175,7 +175,7 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet ) { // create FillAttributes from SvxBrushItem //SetFtColor(rItem.GetColor()); const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rFooterSet.Get(RES_BACKGROUND)); - 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); setFooterFillAttributes( @@ -198,7 +198,7 @@ void SwPageExample::UpdateExample( 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); setPageFillAttributes( diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx b/sw/source/uibase/frmdlg/frmmgr.cxx index a710350cae40..61835e66bbc9 100644 --- a/sw/source/uibase/frmdlg/frmmgr.cxx +++ b/sw/source/uibase/frmdlg/frmmgr.cxx @@ -139,7 +139,7 @@ void SwFlyFrameAttrMgr::UpdateFlyFrame() const SfxPoolItem *pGItem, *pItem; if( SfxItemState::SET == m_aSet.GetItemState( RES_ANCHOR, false, &pItem )) { - SfxItemSet aGetSet( *m_aSet.GetPool(), RES_ANCHOR, RES_ANCHOR ); + SfxItemSet aGetSet( *m_aSet.GetPool(), svl::Items<RES_ANCHOR, RES_ANCHOR>{} ); if( m_pOwnSh->GetFlyFrameAttr( aGetSet ) && 1 == aGetSet.Count() && SfxItemState::SET == aGetSet.GetItemState( RES_ANCHOR, false, &pGItem ) && static_cast<const SwFormatAnchor*>(pGItem)->GetAnchorId() == diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx index dc336015eb51..140ab07814d8 100644 --- a/sw/source/uibase/lingu/olmenu.cxx +++ b/sw/source/uibase/lingu/olmenu.cxx @@ -597,7 +597,7 @@ void SwSpellPopup::checkRedline() FN_REDLINE_PREV_CHANGE }; SwDoc *pDoc = m_pSh->GetDoc(); - SfxItemSet aSet(pDoc->GetAttrPool(), FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_PREV_CHANGE); + SfxItemSet aSet(pDoc->GetAttrPool(), svl::Items<FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_PREV_CHANGE>{}); for (sal_uInt16 nWhich : pRedlineIds) { aSet.Put(SfxVoidItem(nWhich)); @@ -822,10 +822,9 @@ void SwSpellPopup::Execute( sal_uInt16 nId ) // Set language for selection or for paragraph... SfxItemSet aCoreSet( m_pSh->GetView().GetPool(), - RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE, + svl::Items<RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, - RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE, - 0 ); + RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE>{} ); OUString aNewLangText; if (MN_SET_LANGUAGE_SELECTION_START <= nId && nId <= MN_SET_LANGUAGE_SELECTION_END) diff --git a/sw/source/uibase/misc/glshell.cxx b/sw/source/uibase/misc/glshell.cxx index f9be5953fe7c..66125ad7189e 100644 --- a/sw/source/uibase/misc/glshell.cxx +++ b/sw/source/uibase/misc/glshell.cxx @@ -241,10 +241,9 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const OUString& rGroup, const OUString // we create a default SfxPrinter. // ItemSet is deleted by Sfx! auto pSet = o3tl::make_unique<SfxItemSet>( xDocSh->GetDoc()->GetAttrPool(), - FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER, + svl::Items<FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER, SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, - SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, - 0 ); + SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC>{} ); VclPtr<SfxPrinter> pPrinter = VclPtr<SfxPrinter>::Create( std::move(pSet) ); // and append it to the document. diff --git a/sw/source/uibase/ribbar/concustomshape.cxx b/sw/source/uibase/ribbar/concustomshape.cxx index 755eb8074da3..31baef25178e 100644 --- a/sw/source/uibase/ribbar/concustomshape.cxx +++ b/sw/source/uibase/ribbar/concustomshape.cxx @@ -128,7 +128,7 @@ void ConstCustomShape::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 @@ -138,9 +138,7 @@ void ConstCustomShape::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/sw/source/uibase/ribbar/conrect.cxx b/sw/source/uibase/ribbar/conrect.cxx index 5a8823501cf9..a07a14ced753 100644 --- a/sw/source/uibase/ribbar/conrect.cxx +++ b/sw/source/uibase/ribbar/conrect.cxx @@ -95,7 +95,7 @@ bool ConstRectangle::MouseButtonUp(const MouseEvent& rMEvt) { // Set the attributes needed for scrolling SfxItemSet aItemSet( pSdrView->GetModel()->GetItemPool(), - SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST); + svl::Items<SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST>{}); aItemSet.Put( makeSdrTextAutoGrowWidthItem( false ) ); aItemSet.Put( makeSdrTextAutoGrowHeightItem( false ) ); diff --git a/sw/source/uibase/ribbar/drawbase.cxx b/sw/source/uibase/ribbar/drawbase.cxx index 5c02f9b3c32f..f4a1078a6b99 100644 --- a/sw/source/uibase/ribbar/drawbase.cxx +++ b/sw/source/uibase/ribbar/drawbase.cxx @@ -285,7 +285,7 @@ bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt) bAutoCap = true; if(m_pWin->GetFrameColCount() > 1) { - SfxItemSet aSet(m_pView->GetPool(),RES_COL,RES_COL); + SfxItemSet aSet(m_pView->GetPool(),svl::Items<RES_COL,RES_COL>{}); SwFormatCol aCol(static_cast<const SwFormatCol&>(aSet.Get(RES_COL))); aCol.Init(m_pWin->GetFrameColCount(), aCol.GetGutterWidth(), aCol.GetWishWidth()); aSet.Put(aCol); diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx index 488cd6ac3b1f..6bf68a3b9605 100644 --- a/sw/source/uibase/ribbar/inputwin.cxx +++ b/sw/source/uibase/ribbar/inputwin.cxx @@ -255,7 +255,7 @@ void SwInputWindow::ShowWin() } pWrtShell->DoUndo(false); - SfxItemSet aSet( pWrtShell->GetAttrPool(), RES_BOXATR_FORMULA, RES_BOXATR_FORMULA ); + SfxItemSet aSet( pWrtShell->GetAttrPool(), svl::Items<RES_BOXATR_FORMULA, RES_BOXATR_FORMULA>{} ); if( pWrtShell->GetTableBoxFormulaAttrs( aSet )) sEdit += static_cast<const SwTableBoxFormula&>(aSet.Get( RES_BOXATR_FORMULA )).GetFormula(); } diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index 69fc95b59cae..1428a8c772dc 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -479,7 +479,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( pView) != nullptr ); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, eMetric)); */ - SfxItemSet aDlgAttr(GetPool(), EE_ITEMS_START, EE_ITEMS_END); + SfxItemSet aDlgAttr(GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{}); // util::Language does not exist in the EditEngine! Therefore not included in the set. @@ -525,12 +525,11 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, eMetric)); */ SfxItemSet aDlgAttr(GetPool(), - 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_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>{}); aDlgAttr.Put(aEditAttr); @@ -576,9 +575,8 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) bLeftToRight = !bLeftToRight; } SfxItemSet aAttr( *aNewAttr.GetPool(), - EE_PARA_JUST, EE_PARA_JUST, - EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR, - 0 ); + svl::Items<EE_PARA_JUST, EE_PARA_JUST, + EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR>{} ); SvxAdjust nAdjust = SvxAdjust::Left; if( SfxItemState::SET == aEditAttr.GetItemState(EE_PARA_JUST, true, &pPoolItem ) ) @@ -1793,10 +1791,9 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) SfxItemSet aOldSet( pOLV->GetAttribs() ); SfxItemSet aFontSet( *aOldSet.GetPool(), - EE_CHAR_FONTINFO, EE_CHAR_FONTINFO, + svl::Items<EE_CHAR_FONTINFO, EE_CHAR_FONTINFO, EE_CHAR_FONTINFO_CJK, EE_CHAR_FONTINFO_CJK, - EE_CHAR_FONTINFO_CTL, EE_CHAR_FONTINFO_CTL, - 0 ); + EE_CHAR_FONTINFO_CTL, EE_CHAR_FONTINFO_CTL>{} ); aFontSet.Set( aOldSet ); // Insert string diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 465048dc32c9..9c43baea5d24 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -172,7 +172,7 @@ static void lcl_UpdateIMapDlg( SwWrtShell& rSh ) std::unique_ptr<TargetList> pList(new TargetList); rSh.GetView().GetViewFrame()->GetFrame().GetTargetList(*pList); - SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); + SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} ); rSh.GetFlyFrameAttr( aSet ); const SwFormatURL &rURL = static_cast<const SwFormatURL&>(aSet.Get( RES_URL )); SvxIMapDlgChildWindow::UpdateIMapDlg( @@ -985,7 +985,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) if ( rSh.IsFrameSelected() && pDlg->GetEditingObject() == rSh.GetIMapInventor() ) { - SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); + SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) ); aURL.SetMap( &pDlg->GetImageMap() ); @@ -1020,7 +1020,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) if (pDlg && pDlg->GetEditingObject() == rSh.GetIMapInventor()) { rSh.StartAction(); - SfxItemSet aSet( rSh.GetAttrPool(), RES_SURROUND, RES_SURROUND); + SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_SURROUND, RES_SURROUND>{}); rSh.GetFlyFrameAttr( aSet ); SwFormatSurround aSur( static_cast<const SwFormatSurround&>(aSet.Get( RES_SURROUND )) ); if ( !aSur.IsContour() ) @@ -1082,7 +1082,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell()); if( nHtmlMode ) { - SfxItemSet aSet(GetPool(), RES_SURROUND, RES_HORI_ORIENT); + SfxItemSet aSet(GetPool(), svl::Items<RES_SURROUND, RES_HORI_ORIENT>{}); rSh.GetFlyFrameAttr(aSet); const SwFormatSurround& rSurround = static_cast<const SwFormatSurround&>(aSet.Get(RES_SURROUND)); @@ -1328,7 +1328,7 @@ IMPL_LINK_NOARG(SwBaseShell, GraphicArrivedHdl, SwCursorShell&, void) case FN_FRAME_WRAP_CONTOUR: if( !bProtect ) { - SfxItemSet aSet(GetPool(), RES_SURROUND, RES_SURROUND); + SfxItemSet aSet(GetPool(), svl::Items<RES_SURROUND, RES_SURROUND>{}); rSh.GetFlyFrameAttr(aSet); const SwFormatSurround& rWrap = static_cast<const SwFormatSurround&>(aSet.Get(RES_SURROUND)); bSetState = true; @@ -1432,7 +1432,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) case RES_SHADOW: { SfxItemSet aSet( rSh.GetAttrPool(), - RES_SHADOW, RES_SHADOW ); + svl::Items<RES_SHADOW, RES_SHADOW>{} ); // Table cell(s) selected? if ( rSh.IsTableMode() ) @@ -1614,7 +1614,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) if( !bParentCntProt && (bObj || rSh.IsFrameSelected())) { - SfxItemSet aSet(GetPool(), RES_ANCHOR, RES_ANCHOR); + SfxItemSet aSet(GetPool(), svl::Items<RES_ANCHOR, RES_ANCHOR>{}); if(bObj) rSh.GetObjAttr(aSet); else @@ -1656,7 +1656,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) if( !bParentCntProt && (bObj || rSh.IsFrameSelected())) { - SfxItemSet aSet(GetPool(), RES_OPAQUE, RES_ANCHOR); + SfxItemSet aSet(GetPool(), svl::Items<RES_OPAQUE, RES_ANCHOR>{}); RndStdIds nAnchorType; if(bObj) { @@ -1830,7 +1830,7 @@ void SwBaseShell::SetWrapMode( sal_uInt16 nSlot ) bool bObj = 0 != rSh.IsObjSelected(); if( bObj || rSh.IsFrameSelected()) { - SfxItemSet aSet(GetPool(), RES_OPAQUE, RES_SURROUND); + SfxItemSet aSet(GetPool(), svl::Items<RES_OPAQUE, RES_SURROUND>{}); if(bObj) rSh.GetObjAttr(aSet); else @@ -1967,10 +1967,9 @@ void SwBaseShell::ExecTextCtrl( SfxRequest& rReq ) SfxItemPool& rPool = rSh.GetAttrPool(); sal_uInt16 nWhich = rPool.GetWhich( nSlot ); SvtScriptType nScripts = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX; - SfxItemSet aHeightSet( GetPool(), RES_CHRATR_FONTSIZE, RES_CHRATR_FONTSIZE, + SfxItemSet aHeightSet( GetPool(), svl::Items<RES_CHRATR_FONTSIZE, RES_CHRATR_FONTSIZE, RES_CHRATR_CJK_FONTSIZE, RES_CHRATR_CJK_FONTSIZE, - RES_CHRATR_CTL_FONTSIZE, RES_CHRATR_CTL_FONTSIZE, - 0L); + RES_CHRATR_CTL_FONTSIZE, RES_CHRATR_CTL_FONTSIZE>{}); switch( nSlot ) { @@ -2012,10 +2011,9 @@ void SwBaseShell::ExecTextCtrl( SfxRequest& rReq ) sal_uInt32 nHeight = static_cast< const SvxFontHeightItem& >(pArgs->Get( nWhich )).GetHeight(); SwStdFontConfig* pStdFont = SW_MOD()->GetStdFontConfig(); - SfxItemSet aLangSet( GetPool(), RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE, + SfxItemSet aLangSet( GetPool(), svl::Items<RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, - RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE, - 0L); + RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE>{}); rSh.GetCurAttr( aLangSet ); sal_Int32 nWesternSize = @@ -2107,7 +2105,7 @@ void SwBaseShell::GetTextFontCtrlState( SfxItemSet& rSet ) if( !pFntCoreSet ) { pFntCoreSet.reset(new SfxItemSet( *rSet.GetPool(), - RES_CHRATR_BEGIN, RES_CHRATR_END-1 )); + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1>{} )); rSh.GetCurAttr( *pFntCoreSet ); nScriptType = rSh.GetScriptType(); // #i42732# input language should be preferred over @@ -2184,7 +2182,7 @@ void SwBaseShell::GetBckColState(SfxItemSet &rSet) else { // Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set - SfxItemSet aCoreSet(GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + SfxItemSet aCoreSet(GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}); aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet()); @@ -2244,7 +2242,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq) else { // Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set - SfxItemSet aCoreSet(GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + SfxItemSet aCoreSet(GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}); aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet()); @@ -2303,7 +2301,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq) else { // Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set - SfxItemSet aCoreSet(GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + SfxItemSet aCoreSet(GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>{}); aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet()); setSvxBrushItemAsFillAttributesToTargetSet(aBrushItem, aCoreSet); @@ -2349,8 +2347,8 @@ void SwBaseShell::GetBorderState(SfxItemSet &rSet) if ( bTableMode ) { SfxItemSet aCoreSet( GetPool(), - RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, 0 ); + svl::Items<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{} ); SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); aCoreSet.Put( aBoxInfo ); rSh.GetTabBorders( aCoreSet ); @@ -2427,9 +2425,8 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) case FN_FORMAT_BORDER_DLG: { SfxItemSet aSet( rSh.GetAttrPool(), - RES_BOX , RES_SHADOW, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, - 0 ); + svl::Items<RES_BOX , RES_SHADOW, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{} ); ScopedVclPtr<SfxAbstractDialog> pDlg; // Table cell(s) selected? if ( rSh.IsTableMode() ) @@ -2493,7 +2490,7 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) case FN_FORMAT_BACKGROUND_DLG: { SfxItemSet aSet( rSh.GetAttrPool(), - RES_BACKGROUND, RES_BACKGROUND ); + svl::Items<RES_BACKGROUND, RES_BACKGROUND>{} ); ScopedVclPtr<SfxAbstractDialog> pDlg; SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); @@ -2824,7 +2821,7 @@ void SwBaseShell::ExecuteGallery(SfxRequest &rReq) rSh.SetBoxBackground( aBrush ); else if ( nPos == nFramePos || nPos == nGraphicPos || nPos == nOlePos ) { - SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND); + SfxItemSet aCoreSet(GetPool(), svl::Items<RES_BACKGROUND, RES_BACKGROUND>{}); aCoreSet.Put( aBrush ); rSh.SetFlyFrameAttr( aCoreSet ); } diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx index b1b97df5368c..350181edf917 100644 --- a/sw/source/uibase/shells/drawsh.cxx +++ b/sw/source/uibase/shells/drawsh.cxx @@ -167,7 +167,7 @@ void SwDrawShell::InsertPictureFromFile(SdrObject& rObject) { pSdrView->AddUndo(new SdrUndoAttrObj(rObject)); - SfxItemSet aSet(pSdrView->GetModel()->GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLBITMAP); + SfxItemSet aSet(pSdrView->GetModel()->GetItemPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLBITMAP>{}); aSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP)); aSet.Put(XFillBitmapItem(OUString(), aGraphic)); diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index ec081a2919d1..e13780543c0a 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -124,12 +124,11 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); if( rMarkList.GetMark(0) != nullptr ) { - SfxItemSet aSet(GetPool(), RES_SURROUND, RES_SURROUND, + SfxItemSet aSet(GetPool(), svl::Items<RES_SURROUND, RES_SURROUND, RES_ANCHOR, RES_ANCHOR, RES_LR_SPACE, RES_UL_SPACE, SID_HTML_MODE, SID_HTML_MODE, - FN_DRAW_WRAP_DLG, FN_DRAW_WRAP_DLG, - 0); + FN_DRAW_WRAP_DLG, FN_DRAW_WRAP_DLG>{}); aSet.Put(SfxBoolItem(SID_HTML_MODE, 0 != ::GetHtmlMode(pSh->GetView().GetDocShell()))); @@ -260,7 +259,7 @@ void SwDrawBaseShell::Execute(SfxRequest &rReq) SfxItemState::SET != pOutSet->GetItemState( SID_ATTR_TRANSFORM_POS_Y, false ); - SfxItemSet aFrameAttrSet(GetPool(), RES_FRMATR_BEGIN, RES_FRMATR_END - 1); + SfxItemSet aFrameAttrSet(GetPool(), svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END - 1>{}); bool bSingleSelection = rMarkList.GetMarkCount() == 1; diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index b875b49d721f..01ca59adb602 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -350,7 +350,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) SwView* pView = &GetView(); FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( pView) != nullptr ); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) ); - SfxItemSet aDlgAttr(GetPool(), EE_ITEMS_START, EE_ITEMS_END); + SfxItemSet aDlgAttr(GetPool(), svl::Items<EE_ITEMS_START, EE_ITEMS_END>{}); // util::Language does not exists in the EditEngine! That is why not in set. @@ -419,12 +419,11 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( pView) != nullptr ); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) ); SfxItemSet aDlgAttr(GetPool(), - 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_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>{}); aDlgAttr.Put(aEditAttr); @@ -507,8 +506,8 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) pSdrView->SdrEndTextEdit(true); SfxItemSet aAttr( *aNewAttr.GetPool(), - SDRATTR_TEXTDIRECTION, - SDRATTR_TEXTDIRECTION ); + svl::Items<SDRATTR_TEXTDIRECTION, + SDRATTR_TEXTDIRECTION>{} ); aAttr.Put( SvxWritingModeItem( nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ? @@ -538,9 +537,8 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) bLeftToRight = !bLeftToRight; } SfxItemSet aAttr( *aNewAttr.GetPool(), - EE_PARA_JUST, EE_PARA_JUST, - EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR, - 0 ); + svl::Items<EE_PARA_JUST, EE_PARA_JUST, + EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR>{} ); SvxAdjust nAdjust = SvxAdjust::Left; if( SfxItemState::SET == aEditAttr.GetItemState(EE_PARA_JUST, true, &pPoolItem ) ) diff --git a/sw/source/uibase/shells/drwtxtsh.cxx b/sw/source/uibase/shells/drwtxtsh.cxx index f920fa1a21ad..e3777c565222 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -766,10 +766,9 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) SfxItemSet aOldSet( pOLV->GetAttribs() ); SfxItemSet aFontSet( *aOldSet.GetPool(), - EE_CHAR_FONTINFO, EE_CHAR_FONTINFO, + svl::Items<EE_CHAR_FONTINFO, EE_CHAR_FONTINFO, EE_CHAR_FONTINFO_CJK, EE_CHAR_FONTINFO_CJK, - EE_CHAR_FONTINFO_CTL, EE_CHAR_FONTINFO_CTL, - 0 ); + EE_CHAR_FONTINFO_CTL, EE_CHAR_FONTINFO_CTL>{} ); aFontSet.Set( aOldSet ); // Insert string diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index 9a75265c5065..9ebe7f9810c5 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -166,7 +166,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) if(pArgs->GetItemState(SID_ATTR_COLUMNS, false, &pItem) == SfxItemState::SET) nCols = static_cast<const SfxUInt16Item *>(pItem)->GetValue(); - SfxItemSet aSet(GetPool(),RES_COL,RES_COL); + SfxItemSet aSet(GetPool(),svl::Items<RES_COL,RES_COL>{}); rSh.GetFlyFrameAttr( aSet ); SwFormatCol aCol(static_cast<const SwFormatCol&>(aSet.Get(RES_COL))); // GutterWidth will not always passed, hence get firstly @@ -201,7 +201,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) const OUString& rURL = rHLinkItem.GetURL(); const OUString& rTarget = rHLinkItem.GetTargetFrame(); - SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); + SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL>{} ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL( static_cast<const SwFormatURL&>(aSet.Get( RES_URL )) ); @@ -388,7 +388,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) else { SfxItemSet aSet(GetPool(), // sorted by indices - RES_FRMATR_BEGIN, RES_FRMATR_END-1, // [82 + svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1, // [82 // FillAttribute support XATTR_FILL_FIRST, XATTR_FILL_LAST, // [1014 @@ -412,8 +412,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) FN_SET_FRM_ALT_NAME, FN_SET_FRM_ALT_NAME, // [21318 FN_UNO_DESCRIPTION, FN_UNO_DESCRIPTION, // [21320 FN_OLE_IS_MATH, FN_MATH_BASELINE_ALIGNMENT, // [22314 - FN_PARAM_CHAIN_PREVIOUS, FN_PARAM_CHAIN_NEXT, // [22420 - 0); + FN_PARAM_CHAIN_PREVIOUS, FN_PARAM_CHAIN_NEXT>{}); // [22420 // create needed items for XPropertyList entries from the DrawModel so that // the Area TabPage can access them @@ -512,11 +511,10 @@ void SwFrameShell::Execute(SfxRequest &rReq) // Anything which is not supported by the format must be set hard. if(SfxItemState::SET == pOutSet->GetItemState(FN_SET_FRM_NAME, false, &pItem)) rSh.SetFlyName(static_cast<const SfxStringItem*>(pItem)->GetValue()); - SfxItemSet aShellSet(GetPool(), RES_FRM_SIZE, RES_FRM_SIZE, + SfxItemSet aShellSet(GetPool(), svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, RES_SURROUND, RES_SURROUND, RES_ANCHOR, RES_ANCHOR, - RES_VERT_ORIENT,RES_HORI_ORIENT, - 0); + RES_VERT_ORIENT,RES_HORI_ORIENT>{}); aShellSet.Put(*pOutSet); aMgr.SetAttrSet(aShellSet); if(SfxItemState::SET == pOutSet->GetItemState(FN_SET_FRM_NAME, false, &pItem)) @@ -608,7 +606,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) SwFormatHoriOrient aHori(aMgr.GetHoriOrient()); bool bMirror = !aHori.IsPosToggle(); aHori.SetPosToggle(bMirror); - SfxItemSet aSet(GetPool(), RES_HORI_ORIENT, RES_HORI_ORIENT); + SfxItemSet aSet(GetPool(), svl::Items<RES_HORI_ORIENT, RES_HORI_ORIENT>{}); aSet.Put(aHori); aMgr.SetAttrSet(aSet); bCopyToFormat = true; @@ -693,11 +691,10 @@ void SwFrameShell::GetState(SfxItemSet& rSet) if (rSh.IsFrameSelected()) { SfxItemSet aSet( rSh.GetAttrPool(), - RES_LR_SPACE, RES_UL_SPACE, + svl::Items<RES_LR_SPACE, RES_UL_SPACE, RES_PROTECT, RES_HORI_ORIENT, RES_OPAQUE, RES_OPAQUE, - RES_PRINT, RES_OPAQUE, - 0 ); + RES_PRINT, RES_OPAQUE>{} ); rSh.GetFlyFrameAttr( aSet ); bool bProtect = rSh.IsSelObjProtected(FlyProtectFlags::Pos) != FlyProtectFlags::NONE; @@ -837,7 +834,7 @@ void SwFrameShell::GetState(SfxItemSet& rSet) SvxHyperlinkItem aHLinkItem; const SfxPoolItem* pItem; - SfxItemSet aURLSet(GetPool(), RES_URL, RES_URL); + SfxItemSet aURLSet(GetPool(), svl::Items<RES_URL, RES_URL>{}); rSh.GetFlyFrameAttr( aURLSet ); if(SfxItemState::SET == aURLSet.GetItemState(RES_URL, true, &pItem)) @@ -992,7 +989,7 @@ void SwFrameShell::ExecFrameStyle(SfxRequest& rReq) const SvxBoxItem* pPoolBoxItem = static_cast<const SvxBoxItem*>(::GetDfltAttr(RES_BOX)); const SfxItemSet *pArgs = rReq.GetArgs(); - SfxItemSet aFrameSet(rSh.GetAttrPool(), RES_BOX, RES_BOX); + SfxItemSet aFrameSet(rSh.GetAttrPool(), svl::Items<RES_BOX, RES_BOX>{}); rSh.GetFlyFrameAttr( aFrameSet ); const SvxBoxItem& rBoxItem = static_cast<const SvxBoxItem&>(aFrameSet.Get(RES_BOX)); @@ -1184,7 +1181,7 @@ void SwFrameShell::GetLineStyleState(SfxItemSet &rSet) { if (rSh.IsFrameSelected()) { - SfxItemSet aFrameSet( rSh.GetAttrPool(), RES_BOX, RES_BOX ); + SfxItemSet aFrameSet( rSh.GetAttrPool(), svl::Items<RES_BOX, RES_BOX>{} ); rSh.GetFlyFrameAttr(aFrameSet); diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index 2c8d69346959..8d228f5d17bc 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -151,7 +151,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) convertTwipToMm100(rSh.GetAnyCurRect(CurRectType::FlyEmbedded).Width()), convertTwipToMm100(rSh.GetAnyCurRect(CurRectType::FlyEmbedded).Height())); - SfxItemSet aSet( rSh.GetAttrPool(), RES_GRFATR_MIRRORGRF, RES_GRFATR_CROPGRF ); + SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_GRFATR_MIRRORGRF, RES_GRFATR_CROPGRF>{} ); rSh.GetCurAttr( aSet ); SwMirrorGrf aMirror( static_cast<const SwMirrorGrf&>( aSet.Get(RES_GRFATR_MIRRORGRF)) ); SwCropGrf aCrop( static_cast<const SwCropGrf&>( aSet.Get(RES_GRFATR_CROPGRF)) ); @@ -220,7 +220,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) SfxItemSet aSet(GetPool(), // sorted by indices - RES_FRMATR_BEGIN,RES_FRMATR_END - 1, // [ 82 + svl::Items<RES_FRMATR_BEGIN,RES_FRMATR_END - 1, // [ 82 RES_GRFATR_MIRRORGRF,RES_GRFATR_CROPGRF, // [ 123 // FillAttribute support @@ -244,8 +244,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) FN_SET_FRM_NAME,FN_KEEP_ASPECT_RATIO, // [21306 FN_SET_FRM_ALT_NAME,FN_SET_FRM_ALT_NAME, // [21318 SID_REFERER, SID_REFERER, - FN_UNO_DESCRIPTION, FN_UNO_DESCRIPTION, // [21320 - 0); + FN_UNO_DESCRIPTION, FN_UNO_DESCRIPTION>{}); // [21320 // create needed items for XPropertyList entries from the DrawModel so that // the Area TabPage can access them @@ -329,7 +328,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) // get Mirror and Crop { SfxItemSet aTmpSet( rSh.GetAttrPool(), - RES_GRFATR_MIRRORGRF, RES_GRFATR_CROPGRF ); + svl::Items<RES_GRFATR_MIRRORGRF, RES_GRFATR_CROPGRF>{} ); rSh.GetCurAttr( aTmpSet ); aSet.Put( aTmpSet ); @@ -389,11 +388,10 @@ void SwGrfShell::Execute(SfxRequest &rReq) if(pFormat && pFormat->IsAutoUpdateFormat()) { pFormat->SetFormatAttr(*pSet); - SfxItemSet aShellSet(GetPool(), RES_FRM_SIZE, RES_FRM_SIZE, + SfxItemSet aShellSet(GetPool(), svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, RES_SURROUND, RES_SURROUND, RES_ANCHOR, RES_ANCHOR, - RES_VERT_ORIENT,RES_HORI_ORIENT, - 0); + RES_VERT_ORIENT,RES_HORI_ORIENT>{}); aShellSet.Put(*pSet); aMgr.SetAttrSet(aShellSet); } @@ -461,8 +459,8 @@ void SwGrfShell::Execute(SfxRequest &rReq) FN_UNO_DESCRIPTION, true, &pItem )) rSh.SetObjDescription( static_cast<const SfxStringItem*>(pItem)->GetValue() ); - SfxItemSet aGrfSet( rSh.GetAttrPool(), RES_GRFATR_BEGIN, - RES_GRFATR_END-1 ); + SfxItemSet aGrfSet( rSh.GetAttrPool(), svl::Items<RES_GRFATR_BEGIN, + RES_GRFATR_END-1>{} ); aGrfSet.Put( *pSet ); if( aGrfSet.Count() ) rSh.SetAttrSet( aGrfSet ); @@ -475,7 +473,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) case FN_GRAPHIC_MIRROR_ON_EVEN_PAGES: { - SfxItemSet aSet(rSh.GetAttrPool(), RES_GRFATR_MIRRORGRF, RES_GRFATR_MIRRORGRF); + SfxItemSet aSet(rSh.GetAttrPool(), svl::Items<RES_GRFATR_MIRRORGRF, RES_GRFATR_MIRRORGRF>{}); rSh.GetCurAttr( aSet ); SwMirrorGrf aGrf(static_cast<const SwMirrorGrf &>(aSet.Get(RES_GRFATR_MIRRORGRF))); aGrf.SetGrfToggle(!aGrf.IsGrfToggle()); @@ -506,8 +504,8 @@ void SwGrfShell::ExecAttr( SfxRequest &rReq ) if (GraphicType::Bitmap == nGrfType || GraphicType::GdiMetafile == nGrfType) { - SfxItemSet aGrfSet( GetShell().GetAttrPool(), RES_GRFATR_BEGIN, - RES_GRFATR_END -1 ); + SfxItemSet aGrfSet( GetShell().GetAttrPool(), svl::Items<RES_GRFATR_BEGIN, + RES_GRFATR_END -1>{} ); const SfxItemSet *pArgs = rReq.GetArgs(); const SfxPoolItem* pItem; sal_uInt16 nSlot = rReq.GetSlot(); @@ -878,7 +876,7 @@ void SwGrfShell::ExecuteRotation(SfxRequest &rReq) Size aSize(nRotatedWidth, nRotatedHeight); aManager.SetSize(aSize); aManager.UpdateFlyFrame(); - SfxItemSet aSet( rShell.GetAttrPool(), RES_GRFATR_CROPGRF, RES_GRFATR_CROPGRF ); + SfxItemSet aSet( rShell.GetAttrPool(), svl::Items<RES_GRFATR_CROPGRF, RES_GRFATR_CROPGRF>{} ); rShell.GetCurAttr( aSet ); SwCropGrf aCrop( static_cast<const SwCropGrf&>( aSet.Get(RES_GRFATR_CROPGRF) ) ); tools::Rectangle aCropRectangle(aCrop.GetLeft(), aCrop.GetTop(), aCrop.GetRight(), aCrop.GetBottom()); diff --git a/sw/source/uibase/shells/langhelper.cxx b/sw/source/uibase/shells/langhelper.cxx index 398105f7df71..547c6c389ea5 100644 --- a/sw/source/uibase/shells/langhelper.cxx +++ b/sw/source/uibase/shells/langhelper.cxx @@ -405,7 +405,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 f049202a95d2..83fe0b2a458d 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -134,7 +134,7 @@ const sal_uInt16* SwuiGetUITableAttrRange() static void lcl_SetAttr( SwWrtShell &rSh, const SfxPoolItem &rItem ) { - SfxItemSet aSet( rSh.GetView().GetPool(), rItem.Which(), rItem.Which(), 0); + SfxItemSet aSet( rSh.GetView().GetPool(), {{rItem.Which(), rItem.Which()}}); aSet.Put( rItem ); rSh.SetTableAttr( aSet ); } @@ -361,7 +361,7 @@ void ItemSetToTableParam( const SfxItemSet& rSet, bool bTabCols = false; SwTableRep* pRep = nullptr; SwFrameFormat *pFormat = rSh.GetTableFormat(); - SfxItemSet aSet( rSh.GetAttrPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1 ); + SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>{} ); if(SfxItemState::SET == rSet.GetItemState( FN_TABLE_REP, false, &pItem )) { pRep = static_cast<SwTableRep*>(static_cast<const SwPtrItem*>(pItem)->GetValue()); @@ -474,9 +474,8 @@ void SwTableShell::Execute(SfxRequest &rReq) // Create items, because we have to rework anyway. SvxBoxItem aBox( RES_BOX ); SfxItemSet aCoreSet( GetPool(), - RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, - 0); + svl::Items<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{}); SvxBoxInfoItem aCoreInfo( SID_ATTR_BORDER_INNER ); aCoreSet.Put(aCoreInfo); rSh.GetTabBorders( aCoreSet ); @@ -641,14 +640,12 @@ void SwTableShell::Execute(SfxRequest &rReq) SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); SvNumberFormatter* pFormatter = rSh.GetNumberFormatter(); SfxItemSet aCoreSet( GetPool(), - SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_VALUE, - SID_ATTR_NUMBERFORMAT_INFO, SID_ATTR_NUMBERFORMAT_INFO, - 0 ); + svl::Items<SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_VALUE, + SID_ATTR_NUMBERFORMAT_INFO, SID_ATTR_NUMBERFORMAT_INFO>{} ); SfxItemSet aBoxSet( *aCoreSet.GetPool(), - RES_BOXATR_FORMAT, RES_BOXATR_FORMAT, - RES_BOXATR_VALUE, RES_BOXATR_VALUE, - 0 ); + svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_FORMAT, + RES_BOXATR_VALUE, RES_BOXATR_VALUE>{} ); rSh.GetTableBoxFormulaAttrs( aBoxSet ); SfxItemState eState = aBoxSet.GetItemState(RES_BOXATR_FORMAT); @@ -695,7 +692,7 @@ void SwTableShell::Execute(SfxRequest &rReq) SID_ATTR_NUMBERFORMAT_VALUE, false, &pNumberFormatItem )) { SfxItemSet aBoxFormatSet( *aCoreSet.GetPool(), - RES_BOXATR_FORMAT, RES_BOXATR_FORMAT ); + svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_FORMAT>{} ); aBoxFormatSet.Put( SwTableBoxNumFormat( static_cast<const SfxUInt32Item*>(pNumberFormatItem)->GetValue() )); rSh.SetTableBoxFormulaAttrs( aBoxFormatSet ); @@ -923,8 +920,8 @@ void SwTableShell::Execute(SfxRequest &rReq) { const SvxBoxInfoItem aBoxInfo(static_cast<const SvxBoxInfoItem&>( aCoreSet.Get(SID_ATTR_BORDER_INNER))); - SfxItemSet aSet( GetPool(), SID_ATTR_BORDER_INNER, - SID_ATTR_BORDER_INNER, 0); + SfxItemSet aSet( GetPool(), svl::Items<SID_ATTR_BORDER_INNER, + SID_ATTR_BORDER_INNER>{}); aSet.Put( aBoxInfo ); ItemSetToTableParam( aSet, rSh ); rSh.EndUndo( nUndoId ); @@ -1139,8 +1136,8 @@ void SwTableShell::Execute(SfxRequest &rReq) case SID_ATTR_LRSPACE: if(pItem) { - SfxItemSet aSet( GetPool(), RES_LR_SPACE, RES_LR_SPACE, - RES_HORI_ORIENT, RES_HORI_ORIENT, 0 ); + SfxItemSet aSet( GetPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE, + RES_HORI_ORIENT, RES_HORI_ORIENT>{} ); SvxLRSpaceItem aLRSpace( *static_cast<const SvxLRSpaceItem*>(pItem) ); aLRSpace.SetWhich( RES_LR_SPACE ); aSet.Put( aLRSpace ); @@ -1174,7 +1171,7 @@ void SwTableShell::Execute(SfxRequest &rReq) if ( pItem ) { SwFormatLayoutSplit aSplit( static_cast<const SvxFormatSplitItem*>(pItem)->GetValue()); - SfxItemSet aSet(GetPool(), RES_LAYOUT_SPLIT, RES_LAYOUT_SPLIT, 0 ); + SfxItemSet aSet(GetPool(), svl::Items<RES_LAYOUT_SPLIT, RES_LAYOUT_SPLIT>{} ); aSet.Put(aSplit); rSh.SetTableAttr(aSet); } @@ -1185,7 +1182,7 @@ void SwTableShell::Execute(SfxRequest &rReq) { SvxFormatKeepItem aKeep( *static_cast<const SvxFormatKeepItem*>(pItem) ); aKeep.SetWhich( RES_KEEP ); - SfxItemSet aSet(GetPool(), RES_KEEP, RES_KEEP, 0 ); + SfxItemSet aSet(GetPool(), svl::Items<RES_KEEP, RES_KEEP>{} ); aSet.Put(aKeep); rSh.SetTableAttr(aSet); } @@ -1409,8 +1406,8 @@ SwTableShell::SwTableShell(SwView &_rView) : void SwTableShell::GetFrameBorderState(SfxItemSet &rSet) { SfxItemSet aCoreSet( GetPool(), - RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, 0 ); + svl::Items<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{} ); SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); aCoreSet.Put( aBoxInfo ); GetShell().GetTabBorders( aCoreSet ); @@ -1449,8 +1446,8 @@ void SwTableShell::ExecTableStyle(SfxRequest& rReq) void SwTableShell::GetLineStyleState(SfxItemSet &rSet) { SfxItemSet aCoreSet( GetPool(), - RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, 0); + svl::Items<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{}); SvxBoxInfoItem aCoreInfo( SID_ATTR_BORDER_INNER ); aCoreSet.Put(aCoreInfo); GetShell().GetTabBorders( aCoreSet ); @@ -1522,7 +1519,7 @@ void SwTableShell::ExecNumberFormat(SfxRequest& rReq) if( NUMBERFORMAT_ENTRY_NOT_FOUND != nNumberFormat ) { - SfxItemSet aBoxSet( GetPool(), RES_BOXATR_FORMAT, RES_BOXATR_FORMAT ); + SfxItemSet aBoxSet( GetPool(), svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_FORMAT>{} ); aBoxSet.Put( SwTableBoxNumFormat( nNumberFormat )); rSh.SetTableBoxFormulaAttrs( aBoxSet ); } diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index 1fe73b0478ff..c8a963a0e7a9 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -903,7 +903,7 @@ void SwTextShell::InsertHyperlink(const SvxHyperlinkItem& rHlnkItem) if( rSh.GetSelectionType() & SelectionType::Text ) { rSh.StartAction(); - SfxItemSet aSet(GetPool(), RES_TXTATR_INETFMT, RES_TXTATR_INETFMT); + SfxItemSet aSet(GetPool(), svl::Items<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT>{}); rSh.GetCurAttr( aSet ); const SfxPoolItem* pItem; diff --git a/sw/source/uibase/shells/textidx.cxx b/sw/source/uibase/shells/textidx.cxx index 259b381e7e14..3166b4a83b4a 100644 --- a/sw/source/uibase/shells/textidx.cxx +++ b/sw/source/uibase/shells/textidx.cxx @@ -106,13 +106,12 @@ void SwTextShell::ExecIdx(SfxRequest &rReq) case FN_INSERT_MULTI_TOX: { SfxItemSet aSet(GetPool(), - RES_COL, RES_COL, + svl::Items<RES_COL, RES_COL, RES_BACKGROUND, RES_BACKGROUND, RES_FRM_SIZE, RES_FRM_SIZE, SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, RES_LR_SPACE, RES_LR_SPACE, - FN_PARAM_TOX_TYPE, FN_PARAM_TOX_TYPE, - 0 ); + FN_PARAM_TOX_TYPE, FN_PARAM_TOX_TYPE>{} ); SwWrtShell& rSh = GetShell(); SwRect aRect; rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR); diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index da3af66a4209..87bfca3b4d05 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -636,7 +636,7 @@ void SwTextShell::StateInsert( SfxItemSet &rSet ) case SID_HYPERLINK_GETLINK: { - SfxItemSet aSet(GetPool(), RES_TXTATR_INETFMT, RES_TXTATR_INETFMT); + SfxItemSet aSet(GetPool(), svl::Items<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT>{}); rSh.GetCurAttr( aSet ); SvxHyperlinkItem aHLinkItem; @@ -899,10 +899,9 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) } SwWrtShell &rSh = GetShell(); - SfxItemSet aSet( GetPool(), RES_CHRATR_FONT, RES_CHRATR_FONT, + SfxItemSet aSet( GetPool(), svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONT, RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT, - RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONT, - 0 ); + RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONT>{} ); rSh.GetCurAttr( aSet ); SvtScriptType nScript = rSh.GetScriptType(); @@ -999,9 +998,9 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) aNewFontItem.SetPitch( aNewFont.GetPitch()); aNewFontItem.SetCharSet( aNewFont.GetCharSet() ); - SfxItemSet aRestoreSet( GetPool(), RES_CHRATR_FONT, RES_CHRATR_FONT, + SfxItemSet aRestoreSet( GetPool(), svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONT, RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT, - RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONT, 0 ); + RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONT>{} ); nScript = g_pBreakIt->GetAllScriptsOfText( aChars ); if( SvtScriptType::LATIN & nScript ) diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index c5f284426d15..0d2cc4239296 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -126,7 +126,7 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( &rWrtSh.GetView()) != nullptr ); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); SfxItemSet aCoreSet( rWrtSh.GetView().GetPool(), - RES_CHRATR_BEGIN, RES_CHRATR_END-1, + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, RES_BACKGROUND, RES_BACKGROUND, RES_BOX, RES_BOX, @@ -134,8 +134,7 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, FN_PARAM_SELECTION, FN_PARAM_SELECTION, SID_HTML_MODE, SID_HTML_MODE, - SID_ATTR_CHAR_WIDTH_FIT_TO_LINE, SID_ATTR_CHAR_WIDTH_FIT_TO_LINE, - 0 ); + SID_ATTR_CHAR_WIDTH_FIT_TO_LINE, SID_ATTR_CHAR_WIDTH_FIT_TO_LINE>{} ); rWrtSh.GetCurAttr( aCoreSet ); bool bSel = rWrtSh.HasSelection(); bool bSelectionPut = false; @@ -359,10 +358,9 @@ void SwTextShell::Execute(SfxRequest &rReq) const OUString aStrResetLangs("RESET_LANGUAGES"); SfxItemSet aCoreSet( GetPool(), - RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE, + svl::Items<RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, - RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE, - 0 ); + RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE>{} ); sal_Int32 nPos = 0; bool bForSelection = true; @@ -464,7 +462,7 @@ void SwTextShell::Execute(SfxRequest &rReq) if ( bFont ) { rWrtSh.Left( CRSR_SKIP_CHARS, true, 1, false ); - SfxItemSet aSet( rWrtSh.GetAttrPool(), RES_CHRATR_FONT, RES_CHRATR_FONT ); + SfxItemSet aSet( rWrtSh.GetAttrPool(), svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONT>{} ); rWrtSh.GetCurAttr( aSet ); rWrtSh.SetAttrSet( aSet, SetAttrMode::DONTEXPAND ); rWrtSh.ResetSelect(nullptr, false); @@ -782,7 +780,7 @@ void SwTextShell::Execute(SfxRequest &rReq) { if( rWrtSh.IsCursorInTable() ) { - SfxItemSet aSet( rWrtSh.GetAttrPool(), RES_BOXATR_FORMULA, RES_BOXATR_FORMULA ); + SfxItemSet aSet( rWrtSh.GetAttrPool(), svl::Items<RES_BOXATR_FORMULA, RES_BOXATR_FORMULA>{} ); aSet.Put( SwTableBoxFormula( sFormula )); rWrtSh.SetTableBoxFormulaAttrs( aSet ); rWrtSh.UpdateTable(); @@ -907,7 +905,7 @@ void SwTextShell::Execute(SfxRequest &rReq) SW_MOD()->PutItem(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, bApplyCharUnit)); SfxItemSet aCoreSet( GetPool(), // sorted by indices, one group of three concatenated - RES_PARATR_BEGIN, RES_PARATR_END - 1, // [60 + svl::Items<RES_PARATR_BEGIN, RES_PARATR_END - 1, // [60 RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1, // [77 RES_FRMATR_BEGIN, RES_FRMATR_END - 1, // [82 @@ -929,8 +927,7 @@ void SwTextShell::Execute(SfxRequest &rReq) SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM, // [10457 FN_PARAM_1, FN_PARAM_1, // [21160 FN_NUMBER_NEWSTART, FN_NUMBER_NEWSTART_AT, // [21738 - FN_DROP_TEXT, FN_DROP_CHAR_STYLE_NAME, // [22418 - 0); + FN_DROP_TEXT, FN_DROP_CHAR_STYLE_NAME>{});// [22418 // get also the list level indent values merged as LR-SPACE item, if needed. rWrtSh.GetPaMAttr( pPaM, aCoreSet, true ); @@ -1211,7 +1208,7 @@ void SwTextShell::Execute(SfxRequest &rReq) rWrtSh.SetAttrItem( SvxBrushItem(RES_CHRATR_HIGHLIGHT) ); // Remove shading marker - SfxItemSet aCoreSet( rWrtSh.GetView().GetPool(), RES_CHRATR_GRABBAG, RES_CHRATR_GRABBAG ); + SfxItemSet aCoreSet( rWrtSh.GetView().GetPool(), svl::Items<RES_CHRATR_GRABBAG, RES_CHRATR_GRABBAG>{} ); rWrtSh.GetCurAttr( aCoreSet ); const SfxPoolItem *pTmpItem; @@ -1311,8 +1308,8 @@ void SwTextShell::Execute(SfxRequest &rReq) case FN_COPY_HYPERLINK_LOCATION: { SfxItemSet aSet(GetPool(), - RES_TXTATR_INETFMT, - RES_TXTATR_INETFMT); + svl::Items<RES_TXTATR_INETFMT, + RES_TXTATR_INETFMT>{}); rWrtSh.GetCurAttr(aSet); if(SfxItemState::SET <= aSet.GetItemState( RES_TXTATR_INETFMT )) { @@ -1666,8 +1663,8 @@ void SwTextShell::GetState( SfxItemSet &rSet ) case FN_COPY_HYPERLINK_LOCATION: { SfxItemSet aSet(GetPool(), - RES_TXTATR_INETFMT, - RES_TXTATR_INETFMT); + svl::Items<RES_TXTATR_INETFMT, + RES_TXTATR_INETFMT>{}); rSh.GetCurAttr(aSet); if(SfxItemState::SET > aSet.GetItemState( RES_TXTATR_INETFMT ) || rSh.HasReadonlySel()) { @@ -1678,8 +1675,8 @@ void SwTextShell::GetState( SfxItemSet &rSet ) case FN_REMOVE_HYPERLINK: { SfxItemSet aSet(GetPool(), - RES_TXTATR_INETFMT, - RES_TXTATR_INETFMT); + svl::Items<RES_TXTATR_INETFMT, + RES_TXTATR_INETFMT>{}); rSh.GetCurAttr(aSet); // If a hyperlink is selected, either alone or along with other text... @@ -1721,8 +1718,8 @@ void SwTextShell::GetState( SfxItemSet &rSet ) case SID_OPEN_HYPERLINK: { SfxItemSet aSet(GetPool(), - RES_TXTATR_INETFMT, - RES_TXTATR_INETFMT); + svl::Items<RES_TXTATR_INETFMT, + RES_TXTATR_INETFMT>{}); rSh.GetCurAttr(aSet); if(SfxItemState::SET > aSet.GetItemState( RES_TXTATR_INETFMT, false )) rSet.DisableItem(nWhich); diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index a2313ff8bca3..647a733d93cd 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -78,7 +78,7 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq) Get( nWhich )).GetValue() ? STATE_ON : STATE_OFF; } - SfxItemSet aSet( GetPool(), RES_CHRATR_BEGIN, RES_CHRATR_END-1 ); + SfxItemSet aSet( GetPool(), svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1>{} ); if (STATE_TOGGLE == eState) rSh.GetCurAttr( aSet ); @@ -312,9 +312,8 @@ void SwTextShell::ExecParaAttr(SfxRequest &rReq) // Get both attributes immediately isn't more expensive!! SfxItemSet aSet( GetPool(), - RES_PARATR_LINESPACING, RES_PARATR_ADJUST, - RES_FRAMEDIR, RES_FRAMEDIR, - 0 ); + svl::Items<RES_PARATR_LINESPACING, RES_PARATR_ADJUST, + RES_FRAMEDIR, RES_FRAMEDIR>{} ); sal_uInt16 nSlot = rReq.GetSlot(); switch (nSlot) @@ -375,7 +374,7 @@ SET_LINESPACE: case SID_ATTR_PARA_RIGHT_TO_LEFT : { SfxItemSet aAdjustSet( GetPool(), - RES_PARATR_ADJUST, RES_PARATR_ADJUST ); + svl::Items<RES_PARATR_ADJUST, RES_PARATR_ADJUST>{} ); GetShell().GetCurAttr(aAdjustSet); bool bChgAdjust = false; SfxItemState eAdjustState = aAdjustSet.GetItemState(RES_PARATR_ADJUST, false); @@ -460,7 +459,7 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq) if( pItem ) { OUString sCharStyleName = static_cast<const SfxStringItem*>(pItem)->GetValue(); - SfxItemSet aSet(GetPool(), RES_PARATR_DROP, RES_PARATR_DROP, 0L); + SfxItemSet aSet(GetPool(), svl::Items<RES_PARATR_DROP, RES_PARATR_DROP>{}); rSh.GetCurAttr(aSet); SwFormatDrop aDropItem(static_cast<const SwFormatDrop&>(aSet.Get(RES_PARATR_DROP))); SwCharFormat* pFormat = nullptr; @@ -480,8 +479,8 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq) } else { - SfxItemSet aSet(GetPool(), RES_PARATR_DROP, RES_PARATR_DROP, - HINT_END, HINT_END, 0); + SfxItemSet aSet(GetPool(), svl::Items<RES_PARATR_DROP, RES_PARATR_DROP, + HINT_END, HINT_END>{}); rSh.GetCurAttr(aSet); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); @@ -518,8 +517,8 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq) if(pItem) { SfxItemSet aCoreSet( GetPool(), - RES_PAGEDESC, RES_PAGEDESC, - SID_ATTR_PARA_MODEL, SID_ATTR_PARA_MODEL, 0); + svl::Items<RES_PAGEDESC, RES_PAGEDESC, + SID_ATTR_PARA_MODEL, SID_ATTR_PARA_MODEL>{}); aCoreSet.Put(*pItem); SfxToSwPageDescAttr( rSh, aCoreSet); rSh.SetAttrSet(aCoreSet); @@ -787,9 +786,8 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) case SID_ATTR_PARA_MODEL: { SfxItemSet aTemp(GetPool(), - RES_PAGEDESC,RES_PAGEDESC, - SID_ATTR_PARA_MODEL,SID_ATTR_PARA_MODEL, - 0L); + svl::Items<RES_PAGEDESC,RES_PAGEDESC, + SID_ATTR_PARA_MODEL,SID_ATTR_PARA_MODEL>{}); aTemp.Put(aCoreSet); ::SwToSfxPageDescAttr(aTemp); rSet.Put(aTemp.Get(SID_ATTR_PARA_MODEL)); @@ -798,7 +796,7 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) break; case RES_TXTATR_INETFMT: { - SfxItemSet aSet(GetPool(), RES_TXTATR_INETFMT, RES_TXTATR_INETFMT); + SfxItemSet aSet(GetPool(), svl::Items<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT>{}); rSh.GetCurAttr(aSet); const SfxPoolItem& rItem = aSet.Get(RES_TXTATR_INETFMT); rSet.Put(rItem); diff --git a/sw/source/uibase/shells/txtnum.cxx b/sw/source/uibase/shells/txtnum.cxx index 2e19f7816ac7..a435c410e7a4 100644 --- a/sw/source/uibase/shells/txtnum.cxx +++ b/sw/source/uibase/shells/txtnum.cxx @@ -112,9 +112,8 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) case SID_OUTLINE_BULLET: { SfxItemSet aSet( GetPool(), - SID_HTML_MODE, SID_HTML_MODE, - SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL, - 0 ); + svl::Items<SID_HTML_MODE, SID_HTML_MODE, + SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL>{} ); SwDocShell* pDocSh = GetView().GetDocShell(); const bool bHtml = dynamic_cast<SwWebDocShell*>( pDocSh ) != nullptr; const SwNumRule* pNumRuleAtCurrentSelection = GetShell().GetNumRuleAtCurrentSelection(); diff --git a/sw/source/uibase/uiview/formatclipboard.cxx b/sw/source/uibase/uiview/formatclipboard.cxx index 6fe524d0fdb8..728d4f28df59 100644 --- a/sw/source/uibase/uiview/formatclipboard.cxx +++ b/sw/source/uibase/uiview/formatclipboard.cxx @@ -55,7 +55,7 @@ RES_COL, RES_KEEP, \ /* no RES_URL */ \ RES_EDIT_IN_READONLY, RES_LAYOUT_SPLIT, \ /* no RES_CHAIN */ \ -RES_TEXTGRID, RES_FRMATR_END-1, +RES_TEXTGRID, RES_FRMATR_END-1 #define FORMAT_PAINTBRUSH_PARAGRAPH_IDS \ RES_PARATR_BEGIN, RES_PARATR_END -1, \ @@ -68,8 +68,7 @@ std::unique_ptr<SfxItemSet> lcl_CreateEmptyItemSet( SelectionType nSelectionType if( nSelectionType & (SelectionType::Frame | SelectionType::Ole | SelectionType::Graphic) ) { pItemSet = o3tl::make_unique<SfxItemSet>(rPool, - FORMAT_PAINTBRUSH_FRAME_IDS - 0); + svl::Items<FORMAT_PAINTBRUSH_FRAME_IDS>{}); } else if( nSelectionType & SelectionType::DrawObject ) { @@ -79,13 +78,11 @@ std::unique_ptr<SfxItemSet> lcl_CreateEmptyItemSet( SelectionType nSelectionType { if( bNoParagraphFormats ) pItemSet = o3tl::make_unique<SfxItemSet>(rPool, - RES_CHRATR_BEGIN, RES_CHRATR_END - 1, - 0); + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1>{}); else pItemSet = o3tl::make_unique<SfxItemSet>(rPool, - RES_CHRATR_BEGIN, RES_CHRATR_END - 1, - FORMAT_PAINTBRUSH_PARAGRAPH_IDS - 0); + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1, + FORMAT_PAINTBRUSH_PARAGRAPH_IDS>{}); } return pItemSet; } @@ -376,7 +373,7 @@ void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bP if( nSelectionType & SelectionType::TableCell )//only copy table attributes if really cells are selected (not only text in tables) { m_pTableItemSet = o3tl::make_unique<SfxItemSet>(rPool, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_SHADOW, //SID_ATTR_BORDER_OUTER is inbetween + svl::Items<SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_SHADOW, //SID_ATTR_BORDER_OUTER is inbetween RES_BACKGROUND, RES_SHADOW, //RES_BOX is inbetween SID_ATTR_BRUSH_ROW, SID_ATTR_BRUSH_TABLE, RES_BREAK, RES_BREAK, @@ -387,8 +384,7 @@ void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bP RES_FRAMEDIR, RES_FRAMEDIR, FN_PARAM_TABLE_HEADLINE, FN_PARAM_TABLE_HEADLINE, FN_TABLE_BOX_TEXTORIENTATION, FN_TABLE_BOX_TEXTORIENTATION, - FN_TABLE_SET_VERT_ALIGN, FN_TABLE_SET_VERT_ALIGN, - 0); + FN_TABLE_SET_VERT_ALIGN, FN_TABLE_SET_VERT_ALIGN>{}); lcl_getTableAttributes( *m_pTableItemSet, rWrtShell ); } diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 7d1ed4da0564..2455df3c9c0e 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -761,7 +761,7 @@ void SwPagePreview::Execute( SfxRequest &rReq ) ScopedVclPtr<AbstractSvxZoomDialog> pDlg; if(!pArgs) { - SfxItemSet aCoreSet(GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM); + SfxItemSet aCoreSet(GetPool(), svl::Items<SID_ATTR_ZOOM, SID_ATTR_ZOOM>{}); const SwViewOption* pVOpt = GetViewShell()->GetViewOptions(); SvxZoomItem aZoom( pVOpt->GetZoomType(), pVOpt->GetZoom() ); aZoom.SetValueSet( @@ -1077,7 +1077,7 @@ void SwPagePreview::GetState( SfxItemSet& rSet ) // has the same status like the normal printing { const SfxPoolItem* pItem; - SfxItemSet aSet( *rSet.GetPool(), SID_PRINTDOC, SID_PRINTDOC ); + SfxItemSet aSet( *rSet.GetPool(), svl::Items<SID_PRINTDOC, SID_PRINTDOC>{} ); GetSlotState( SID_PRINTDOC, SfxViewShell::GetInterface(), &aSet ); if( SfxItemState::DISABLED == aSet.GetItemState( SID_PRINTDOC, false, &pItem )) diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx index 5a6f8ef17681..f6d6bdee9494 100644 --- a/sw/source/uibase/uiview/view0.cxx +++ b/sw/source/uibase/uiview/view0.cxx @@ -603,7 +603,7 @@ void SwView::ExecFormatFootnote() void SwView::ExecNumberingOutline(SfxItemPool & rPool) { - SfxItemSet aTmp(rPool, FN_PARAM_1, FN_PARAM_1); + SfxItemSet aTmp(rPool, svl::Items<FN_PARAM_1, FN_PARAM_1>{}); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "Dialog creation failed!"); ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTabDialog( DLG_TAB_OUTLINE, diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 117dd7fbd969..1fc001e2830d 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -1524,7 +1524,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) if(!pNumRule->IsAutoRule()) { SfxItemSet aSet(GetPool(), - RES_PARATR_NUMRULE, RES_PARATR_NUMRULE); + svl::Items<RES_PARATR_NUMRULE, RES_PARATR_NUMRULE>{}); rShell.GetCurAttr(aSet); if(SfxItemState::DEFAULT <= aSet.GetItemState(RES_PARATR_NUMRULE)) @@ -1662,7 +1662,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) else { const SwViewOption& rViewOptions = *rSh.GetViewOptions(); - SfxItemSet aCoreSet(m_pShell->GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM, SID_ATTR_VIEWLAYOUT, SID_ATTR_VIEWLAYOUT, 0 ); + SfxItemSet aCoreSet(m_pShell->GetPool(), svl::Items<SID_ATTR_ZOOM, SID_ATTR_ZOOM, SID_ATTR_VIEWLAYOUT, SID_ATTR_VIEWLAYOUT>{} ); SvxZoomItem aZoom( rViewOptions.GetZoomType(), rViewOptions.GetZoom() ); const bool bBrowseMode = rSh.GetViewOptions()->getBrowseMode(); diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index 67a827b1f231..d639a566bd54 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -752,7 +752,7 @@ bool SwView::IsDrawTextHyphenate() bool bHyphenate = false; SfxItemSet aNewAttr( pSdrView->GetModel()->GetItemPool(), - EE_PARA_HYPHENATE, EE_PARA_HYPHENATE ); + svl::Items<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE>{} ); if( pSdrView->GetAttributes( aNewAttr ) && aNewAttr.GetItemState( EE_PARA_HYPHENATE ) >= SfxItemState::DEFAULT ) bHyphenate = static_cast<const SfxBoolItem&>(aNewAttr.Get( EE_PARA_HYPHENATE )). @@ -766,7 +766,7 @@ void SwView::HyphenateDrawText() SdrView *pSdrView = m_pWrtShell->GetDrawView(); bool bHyphenate = IsDrawTextHyphenate(); - SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE ); + SfxItemSet aSet( GetPool(), svl::Items<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE>{} ); aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, !bHyphenate ) ); pSdrView->SetAttributes( aSet ); GetViewFrame()->GetBindings().Invalidate(FN_HYPHENATE_OPT_DLG); diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx index 448f192377bd..6a6f005bb413 100644 --- a/sw/source/uibase/uiview/viewprt.cxx +++ b/sw/source/uibase/uiview/viewprt.cxx @@ -314,11 +314,10 @@ void SetAppPrintOptions( SwViewShell* pSh, bool bWeb ) // Close application own printing options in SfxPrinter. SwAddPrinterItem aAddPrinterItem(aPrtData); SfxItemSet aSet( pSh->GetAttrPool(), - FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER, + svl::Items<FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER, SID_HTML_MODE, SID_HTML_MODE, SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, - SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, - 0 ); + SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC>{} ); utl::MiscCfg aMisc; diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index 60903b74a50c..cd38970c6bd9 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -279,9 +279,9 @@ void SwView::ExecTabWin( SfxRequest& rReq ) rRect.Right() - rPageRect.Right() + aLongLR.GetRight() : rPageRect.Left() + aLongLR.GetLeft() - rRect.Left(); - SfxItemSet aSet( GetPool(), RES_FRM_SIZE, RES_FRM_SIZE, + SfxItemSet aSet( GetPool(), svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, RES_VERT_ORIENT, RES_HORI_ORIENT, - RES_COL, RES_COL, 0 ); + RES_COL, RES_COL>{} ); if(bVerticalFrame) { @@ -372,7 +372,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) SvxLRSpaceItem aLRTmp = pSectFormat->GetLRSpace(); aLRTmp.SetLeft(aLRTmp.GetLeft() + nLeftDiff); aLRTmp.SetRight(aLRTmp.GetRight() + nRightDiff); - SfxItemSet aSet(rSh.GetAttrPool(), RES_LR_SPACE, RES_LR_SPACE, RES_COL, RES_COL, 0L); + SfxItemSet aSet(rSh.GetAttrPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE, RES_COL, RES_COL>{}); aSet.Put(aLRTmp); //change the first/last column if(bSect) @@ -428,8 +428,8 @@ void SwView::ExecTabWin( SfxRequest& rReq ) const long nDeltaY = rPageRect.Top() + aLongULSpace.GetUpper() - rRect.Top(); const long nHeight = nPageHeight - (aLongULSpace.GetUpper() + aLongULSpace.GetLower()); - SfxItemSet aSet( GetPool(), RES_FRM_SIZE, RES_FRM_SIZE, - RES_VERT_ORIENT, RES_HORI_ORIENT, 0 ); + SfxItemSet aSet( GetPool(), svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, + RES_VERT_ORIENT, RES_HORI_ORIENT>{} ); //which of the orientation attributes is to be put depends on the frame's environment bool bRTL; bool bVertL2R; @@ -485,7 +485,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) SvxLRSpaceItem aLR = pSectFormat->GetLRSpace(); aLR.SetLeft(aLR.GetLeft() + nLeftDiff); aLR.SetRight(aLR.GetRight() + nRightDiff); - SfxItemSet aSet(rSh.GetAttrPool(), RES_LR_SPACE, RES_LR_SPACE, RES_COL, RES_COL, 0L); + SfxItemSet aSet(rSh.GetAttrPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE, RES_COL, RES_COL>{}); aSet.Put(aLR); //change the first/last column if(bSect) @@ -627,7 +627,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) static_cast<const SvxTabStopItem&>(rSh.GetDefault(RES_PARATR_TABSTOP)); // Default tab at pos 0 - SfxItemSet aSet( GetPool(), RES_LR_SPACE, RES_LR_SPACE ); + SfxItemSet aSet( GetPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE>{} ); rSh.GetCurAttr( aSet ); const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(aSet.Get(RES_LR_SPACE)); @@ -643,7 +643,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) SwTextFormatColl* pColl = rSh.GetCurTextFormatColl(); if( pColl && pColl->IsAutoUpdateFormat() ) { - SfxItemSet aTmp(GetPool(), RES_PARATR_TABSTOP, RES_PARATR_TABSTOP); + SfxItemSet aTmp(GetPool(), svl::Items<RES_PARATR_TABSTOP, RES_PARATR_TABSTOP>{}); aTmp.Put(aTabStops); rSh.AutoUpdatePara( pColl, aTmp ); } @@ -654,7 +654,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) case SID_HANGING_INDENT: { - SfxItemSet aLRSpaceSet( GetPool(), RES_LR_SPACE, RES_LR_SPACE ); + SfxItemSet aLRSpaceSet( GetPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE>{} ); rSh.GetCurAttr( aLRSpaceSet ); SvxLRSpaceItem aParaMargin( static_cast<const SvxLRSpaceItem&>( aLRSpaceSet.Get( RES_LR_SPACE ) ) ); @@ -684,7 +684,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) { // --> #i42922# Mouse move of numbering label // has to consider the left indent of the paragraph - SfxItemSet aSet( GetPool(), RES_LR_SPACE, RES_LR_SPACE ); + SfxItemSet aSet( GetPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE>{} ); rSh.GetCurAttr( aSet ); const SvxLRSpaceItem& rLR = static_cast<const SvxLRSpaceItem&>(aSet.Get(RES_LR_SPACE)); @@ -698,7 +698,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) } else if( pColl && pColl->IsAutoUpdateFormat() ) { - SfxItemSet aSet(GetPool(), RES_LR_SPACE, RES_LR_SPACE); + SfxItemSet aSet(GetPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE>{}); aSet.Put(aParaMargin); rSh.AutoUpdatePara( pColl, aSet); } @@ -707,7 +707,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) if ( aParaMargin.GetTextFirstLineOfst() < 0 ) { - SfxItemSet aSet( GetPool(), RES_PARATR_TABSTOP, RES_PARATR_TABSTOP ); + SfxItemSet aSet( GetPool(), svl::Items<RES_PARATR_TABSTOP, RES_PARATR_TABSTOP>{} ); rSh.GetCurAttr( aSet ); const SvxTabStopItem& rTabStops = static_cast<const SvxTabStopItem&>(aSet.Get(RES_PARATR_TABSTOP)); @@ -736,7 +736,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) if( pColl && pColl->IsAutoUpdateFormat()) { - SfxItemSet aSetTmp(GetPool(), RES_PARATR_TABSTOP, RES_PARATR_TABSTOP); + SfxItemSet aSetTmp(GetPool(), svl::Items<RES_PARATR_TABSTOP, RES_PARATR_TABSTOP>{}); aSetTmp.Put(aTabStops); rSh.AutoUpdatePara( pColl, aSetTmp ); } @@ -761,7 +761,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) SwTextFormatColl* pColl = rSh.GetCurTextFormatColl(); if( pColl && pColl->IsAutoUpdateFormat() ) { - SfxItemSet aSet(GetPool(), RES_UL_SPACE, RES_UL_SPACE); + SfxItemSet aSet(GetPool(), svl::Items<RES_UL_SPACE, RES_UL_SPACE>{}); aSet.Put(aParaMargin); rSh.AutoUpdatePara( pColl, aSet); } @@ -772,7 +772,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) case SID_PARASPACE_INCREASE: case SID_PARASPACE_DECREASE: { - SfxItemSet aULSpaceSet( GetPool(), RES_UL_SPACE, RES_UL_SPACE ); + SfxItemSet aULSpaceSet( GetPool(), svl::Items<RES_UL_SPACE, RES_UL_SPACE>{} ); rSh.GetCurAttr( aULSpaceSet ); SvxULSpaceItem aULSpace( static_cast< const SvxULSpaceItem& >( aULSpaceSet.Get( RES_UL_SPACE ) ) ); @@ -877,7 +877,7 @@ void SwView::ExecTabWin( SfxRequest& rReq ) if ( bFrameSelection || nFrameType & FrameTypeFlags::FLY_ANY || bSect) { SwSectionFormat *pSectFormat = nullptr; - SfxItemSet aSet( GetPool(), RES_COL, RES_COL ); + SfxItemSet aSet( GetPool(), svl::Items<RES_COL, RES_COL>{} ); if(bSect) { SwSection *pSect = rSh.GetAnySection(); @@ -1216,8 +1216,8 @@ void SwView::StateTabWin(SfxItemSet& rSet) SvxLRSpaceItem aPageLRSpace( rDesc.GetMaster().GetLRSpace() ); SwapPageMargin( rDesc, aPageLRSpace ); - SfxItemSet aCoreSet( GetPool(), RES_PARATR_TABSTOP, RES_PARATR_TABSTOP, - RES_LR_SPACE, RES_UL_SPACE, 0 ); + SfxItemSet aCoreSet( GetPool(), svl::Items<RES_PARATR_TABSTOP, RES_PARATR_TABSTOP, + RES_LR_SPACE, RES_UL_SPACE>{} ); // get also the list level indent values merged as LR-SPACE item, if needed. rSh.GetCurAttr( aCoreSet, true ); const SelectionType nSelType = rSh.GetSelectionType(); @@ -1548,7 +1548,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) aDistLR.SetRight(rBox.GetDistance(SvxBoxItemLine::RIGHT)); //add the paragraph border distance - SfxItemSet aCoreSet1( GetPool(), RES_BOX, RES_BOX ); + SfxItemSet aCoreSet1( GetPool(), svl::Items<RES_BOX, RES_BOX>{} ); rSh.GetCurAttr( aCoreSet1 ); const SvxBoxItem& rParaBox = static_cast<const SvxBoxItem&>(aCoreSet1.Get(RES_BOX)); aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(SvxBoxItemLine::LEFT)); @@ -1563,8 +1563,8 @@ void SwView::StateTabWin(SfxItemSet& rSet) !(nFrameType & FrameTypeFlags::COLSECT ) ) ) { SfxItemSet aCoreSet2( GetPool(), - RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, 0 ); + svl::Items<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{} ); SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); aBoxInfo.SetTable(false); aBoxInfo.SetDist(true); @@ -1575,7 +1575,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) aDistLR.SetRight(rBox.GetDistance(SvxBoxItemLine::RIGHT)); //add the border distance of the paragraph - SfxItemSet aCoreSet1( GetPool(), RES_BOX, RES_BOX ); + SfxItemSet aCoreSet1( GetPool(), svl::Items<RES_BOX, RES_BOX>{} ); rSh.GetCurAttr( aCoreSet1 ); const SvxBoxItem& rParaBox = static_cast<const SvxBoxItem&>(aCoreSet1.Get(RES_BOX)); aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(SvxBoxItemLine::LEFT)); @@ -1615,7 +1615,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) } //add the border distance of the paragraph - SfxItemSet aCoreSetTmp( GetPool(), RES_BOX, RES_BOX ); + SfxItemSet aCoreSetTmp( GetPool(), svl::Items<RES_BOX, RES_BOX>{} ); rSh.GetCurAttr( aCoreSetTmp ); const SvxBoxItem& rParaBox = static_cast<const SvxBoxItem&>(aCoreSetTmp.Get(RES_BOX)); aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(SvxBoxItemLine::LEFT)); diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 755d2497cf1d..73d89980092d 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -764,15 +764,13 @@ sal_Int32 SwXTextDocument::replaceAll(const Reference< util::XSearchDescriptor > if(pSearch->HasSearchAttributes()||pSearch->HasReplaceAttributes()) { SfxItemSet aSearch(pDocShell->GetDoc()->GetAttrPool(), - RES_CHRATR_BEGIN, RES_CHRATR_END-1, + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_PARATR_BEGIN, RES_PARATR_END-1, - RES_FRMATR_BEGIN, RES_FRMATR_END-1, - 0); + RES_FRMATR_BEGIN, RES_FRMATR_END-1>{}); SfxItemSet aReplace(pDocShell->GetDoc()->GetAttrPool(), - RES_CHRATR_BEGIN, RES_CHRATR_END-1, + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_PARATR_BEGIN, RES_PARATR_END-1, - RES_FRMATR_BEGIN, RES_FRMATR_END-1, - 0); + RES_FRMATR_BEGIN, RES_FRMATR_END-1>{}); pSearch->FillSearchItemSet(aSearch); pSearch->FillReplaceItemSet(aReplace); bool bCancel; @@ -898,11 +896,10 @@ SwUnoCursor* SwXTextDocument::FindAny(const Reference< util::XSearchDescriptor > if(pSearch->HasSearchAttributes()) { SfxItemSet aSearch(pDocShell->GetDoc()->GetAttrPool(), - RES_CHRATR_BEGIN, RES_CHRATR_END-1, + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_PARATR_BEGIN, RES_PARATR_END-1, RES_FRMATR_BEGIN, RES_FRMATR_END-1, - RES_TXTATR_INETFMT, RES_TXTATR_CHARFMT, - 0); + RES_TXTATR_INETFMT, RES_TXTATR_CHARFMT>{}); pSearch->FillSearchItemSet(aSearch); bool bCancel; nResult = (sal_Int32)pUnoCursor->Find( aSearch, !pSearch->m_bStyles, diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index a3095d534d74..9def934ce64f 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -866,13 +866,12 @@ void SwGlobalTree::ExecuteContextMenuAction( sal_uInt16 nSelectedPopupEntry ) if(pContCopy) { SfxItemSet aSet(m_pActiveShell->GetView().GetPool(), - RES_COL, RES_COL, + svl::Items<RES_COL, RES_COL, RES_BACKGROUND, RES_BACKGROUND, RES_FRM_SIZE, RES_FRM_SIZE, SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, RES_LR_SPACE, RES_LR_SPACE, - FN_PARAM_TOX_TYPE, FN_PARAM_TOX_TYPE, - 0); + FN_PARAM_TOX_TYPE, FN_PARAM_TOX_TYPE>{}); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); assert(pFact && "Dialog creation failed!"); diff --git a/sw/source/uibase/utlui/numfmtlb.cxx b/sw/source/uibase/utlui/numfmtlb.cxx index 3ce361976004..a8d1348f5af0 100644 --- a/sw/source/uibase/utlui/numfmtlb.cxx +++ b/sw/source/uibase/utlui/numfmtlb.cxx @@ -370,12 +370,11 @@ IMPL_LINK( NumFormatListBox, SelectHdl, ListBox&, rBox, void ) SvNumberFormatter* pFormatter = rSh.GetNumberFormatter(); SfxItemSet aCoreSet( rSh.GetAttrPool(), - SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_VALUE, + svl::Items<SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_INFO, SID_ATTR_NUMBERFORMAT_INFO, SID_ATTR_NUMBERFORMAT_ONE_AREA, SID_ATTR_NUMBERFORMAT_ONE_AREA, SID_ATTR_NUMBERFORMAT_NOLANGUAGE, SID_ATTR_NUMBERFORMAT_NOLANGUAGE, - SID_ATTR_NUMBERFORMAT_ADD_AUTO, SID_ATTR_NUMBERFORMAT_ADD_AUTO, - 0 ); + SID_ATTR_NUMBERFORMAT_ADD_AUTO, SID_ATTR_NUMBERFORMAT_ADD_AUTO>{} ); double fValue = GetDefValue( nCurrFormatType); diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx index 45afe60c1520..6cafada3d10d 100644 --- a/sw/source/uibase/utlui/uitool.cxx +++ b/sw/source/uibase/utlui/uitool.cxx @@ -465,7 +465,7 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet) // HeaderInfo, margins, background, border SfxItemSet aHeaderSet(*rSet.GetPool(), - RES_FRMATR_BEGIN,RES_FRMATR_END - 1, // [82 + svl::Items<RES_FRMATR_BEGIN,RES_FRMATR_END - 1, // [82 // FillAttribute support XATTR_FILL_FIRST, XATTR_FILL_LAST, // [1014 @@ -473,8 +473,7 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet) SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER, // [10023 SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE, // [10051 SID_ATTR_PAGE_ON,SID_ATTR_PAGE_SHARED, // [10060 - SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST, - 0, 0); + SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST>{}); // set correct parent to get the XFILL_NONE FillStyle as needed aHeaderSet.SetParent(&rMaster.GetDoc()->GetDfltFrameFormat()->GetAttrSet()); @@ -516,7 +515,7 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet) // FooterInfo, margins, background, border SfxItemSet aFooterSet(*rSet.GetPool(), - RES_FRMATR_BEGIN,RES_FRMATR_END - 1, // [82 + svl::Items<RES_FRMATR_BEGIN,RES_FRMATR_END - 1, // [82 // FillAttribute support XATTR_FILL_FIRST, XATTR_FILL_LAST, // [1014 @@ -524,8 +523,7 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet) SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER, // [10023 SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE, // [10051 SID_ATTR_PAGE_ON,SID_ATTR_PAGE_SHARED, // [10060 - SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST, - 0, 0); + SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST>{}); // set correct parent to get the XFILL_NONE FillStyle as needed aFooterSet.SetParent(&rMaster.GetDoc()->GetDfltFrameFormat()->GetAttrSet()); @@ -637,7 +635,7 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet ) } else { - SfxItemSet aCoreSet(rShell.GetView().GetPool(), RES_PAGEDESC, RES_PAGEDESC ); + SfxItemSet aCoreSet(rShell.GetView().GetPool(), svl::Items<RES_PAGEDESC, RES_PAGEDESC>{} ); rShell.GetCurAttr( aCoreSet ); if(SfxItemState::SET == aCoreSet.GetItemState( RES_PAGEDESC, true, &pItem ) ) { diff --git a/sw/source/uibase/wrtsh/delete.cxx b/sw/source/uibase/wrtsh/delete.cxx index 02540d95b22d..2f5969599c7c 100644 --- a/sw/source/uibase/wrtsh/delete.cxx +++ b/sw/source/uibase/wrtsh/delete.cxx @@ -47,7 +47,7 @@ bool SwWrtShell::TryRemoveIndent() { bool bResult = false; - SfxItemSet aAttrSet(GetAttrPool(), RES_LR_SPACE, RES_LR_SPACE); + SfxItemSet aAttrSet(GetAttrPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE>{}); GetCurAttr(aAttrSet); SvxLRSpaceItem aItem = static_cast<const SvxLRSpaceItem &>(aAttrSet.Get(RES_LR_SPACE)); diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 9145fb223c37..08527aa134de 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -1535,7 +1535,7 @@ void SwWrtShell::AutoUpdatePara(SwTextFormatColl* pColl, const SfxItemSet& rStyl { SwPaM* pCursor = pPaM ? pPaM : GetCursor( ); SfxItemSet aCoreSet( GetAttrPool(), - RES_CHRATR_BEGIN, RES_CHRATR_END - 1, + svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1, RES_PARATR_BEGIN, RES_PARATR_END - 1, RES_FRMATR_BEGIN, RES_FRMATR_END - 1, SID_ATTR_TABSTOP_POS, SID_ATTR_TABSTOP_POS, @@ -1543,8 +1543,7 @@ void SwWrtShell::AutoUpdatePara(SwTextFormatColl* pColl, const SfxItemSet& rStyl SID_ATTR_TABSTOP_OFFSET, SID_ATTR_TABSTOP_OFFSET, SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, SID_ATTR_PARA_MODEL, SID_ATTR_PARA_KEEP, - SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM, - 0 ); + SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM>{} ); GetPaMAttr( pCursor, aCoreSet ); bool bReset = false; SfxItemIter aParaIter( aCoreSet ); |