diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-10-06 16:17:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-10-10 11:33:38 +0200 |
commit | dbd49cf90b175a3c3d7a4f25ad366f9bc4c716db (patch) | |
tree | 1c9ee40dc72d468f4b35dd83f62966844aabcf62 /sw/source | |
parent | b972aa8727da6eb2d5d9740b18450d8706df0874 (diff) |
use SfxItemSetFixed in sw
Change-Id: I69e188d7599b7fc439f613cec0a0967ccb748b7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123313
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source')
131 files changed, 562 insertions, 742 deletions
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 6d75fe4abf86..e31c343d321d 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1465,9 +1465,9 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl( // get default paragraph attributes, if needed, and merge these into <pSet> if ( !bOnlyCharAttrs ) { - SfxItemSet aParaSet( const_cast<SwAttrPool&>(pTextNode->GetDoc().GetAttrPool()), - svl::Items<RES_PARATR_BEGIN, RES_PARATR_END - 1, - RES_FRMATR_BEGIN, RES_FRMATR_END - 1> ); + SfxItemSetFixed<RES_PARATR_BEGIN, RES_PARATR_END - 1, + RES_FRMATR_BEGIN, RES_FRMATR_END - 1> + aParaSet( const_cast<SwAttrPool&>(pTextNode->GetDoc().GetAttrPool()) ); pTextNode->SwContentNode::GetAttr( aParaSet ); pSet->Put( aParaSet ); } @@ -1476,8 +1476,8 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl( "<SwAccessibleParagraph::_getDefaultAttributesImpl(..)> - missing paragraph style. Serious defect!" ); if ( pTextNode->GetTextColl() ) { - SfxItemSet aCharSet( const_cast<SwAttrPool&>(pTextNode->GetDoc().GetAttrPool()), - svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1> ); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END - 1> + aCharSet( const_cast<SwAttrPool&>(pTextNode->GetDoc().GetAttrPool()) ); SetPutRecursive( aCharSet, pTextNode->GetTextColl()->GetAttrSet() ); pSet->Put( aCharSet ); } @@ -1644,8 +1644,7 @@ void SwAccessibleParagraph::_getRunAttributesImpl( } // retrieve character attributes for the created PaM <pPaM> - SfxItemSet aSet( pPaM->GetDoc().GetAttrPool(), - svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END -1> ); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END -1> aSet( pPaM->GetDoc().GetAttrPool() ); // #i82637# // From the perspective of the a11y API the character attributes, which // are set at the automatic paragraph style of the paragraph, are treated @@ -1655,16 +1654,14 @@ void SwAccessibleParagraph::_getRunAttributesImpl( { if ( pTextNode->HasSwAttrSet() ) { - SfxItemSet aAutomaticParaStyleCharAttrs( pPaM->GetDoc().GetAttrPool(), - svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END -1> ); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END -1> aAutomaticParaStyleCharAttrs( pPaM->GetDoc().GetAttrPool()); aAutomaticParaStyleCharAttrs.Put( *(pTextNode->GetpSwAttrSet()), false ); aSet.Put( aAutomaticParaStyleCharAttrs ); } } // get character attributes at <pPaM> and merge these into <aSet> { - SfxItemSet aCharAttrsAtPaM( pPaM->GetDoc().GetAttrPool(), - svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END -1> ); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END -1> aCharAttrsAtPaM( pPaM->GetDoc().GetAttrPool() ); SwUnoCursorHelper::GetCursorAttr(*pPaM, aCharAttrsAtPaM, true); aSet.Put( aCharAttrsAtPaM ); } @@ -1752,14 +1749,13 @@ void SwAccessibleParagraph::_getSupplementalAttributesImpl( { SwTextFrame const*const pFrame(static_cast<SwTextFrame const*>(GetFrame())); const SwTextNode *const pTextNode(pFrame->GetTextNodeForParaProps()); - SfxItemSet aSet( - const_cast<SwAttrPool&>(pTextNode->GetDoc().GetAttrPool()), - svl::Items< + SfxItemSetFixed< RES_PARATR_LINESPACING, RES_PARATR_ADJUST, RES_PARATR_TABSTOP, RES_PARATR_TABSTOP, RES_PARATR_NUMRULE, RES_PARATR_NUMRULE, RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1, - RES_LR_SPACE, RES_UL_SPACE>); + RES_LR_SPACE, RES_UL_SPACE> + aSet( const_cast<SwAttrPool&>(pTextNode->GetDoc().GetAttrPool()) ); if ( pTextNode->HasBullet() || pTextNode->HasNumber() ) { diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx index 6e5ba61cf13d..a878f3bf8f36 100644 --- a/sw/source/core/attr/format.cxx +++ b/sw/source/core/attr/format.cxx @@ -459,7 +459,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(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>); + SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> aTempSet(*m_aSet.GetPool()); const SvxBrushItem& rSource = rAttr.StaticWhichCast(RES_BACKGROUND); // fill a local ItemSet with the attributes corresponding as good as possible diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx index 03f94624aae2..d241ba739bf8 100644 --- a/sw/source/core/crsr/crstrvl.cxx +++ b/sw/source/core/crsr/crstrvl.cxx @@ -1788,8 +1788,7 @@ bool SwCursorShell::GetContentAtPos( const Point& rPt, if( !bRet && IsAttrAtPos::CurrAttrs & rContentAtPos.eContentAtPos ) { const sal_Int32 n = aPos.nContent.GetIndex(); - SfxItemSet aSet( GetDoc()->GetAttrPool(), svl::Items<POOLATTR_BEGIN, - POOLATTR_END - 1> ); + SfxItemSetFixed<POOLATTR_BEGIN, POOLATTR_END - 1> aSet( GetDoc()->GetAttrPool() ); if( pTextNd->GetpSwpHints() ) { for( size_t i = 0; i < pTextNd->GetSwpHints().Count(); ++i ) @@ -2147,11 +2146,9 @@ bool SwCursorShell::SetShadowCursorPos( const Point& rPt, SwFillMode eFillMode ) case SwFillMode::Indent: if( nullptr != (pCNd = aPos.nNode.GetNode().GetContentNode() )) { - SfxItemSet aSet( - GetDoc()->GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_PARATR_ADJUST, RES_PARATR_ADJUST, - RES_LR_SPACE, RES_LR_SPACE>); + RES_LR_SPACE, RES_LR_SPACE> aSet( GetDoc()->GetAttrPool() ); SvxLRSpaceItem aLR(pCNd->GetAttr(RES_LR_SPACE).StaticWhichCast(RES_LR_SPACE)); aLR.SetTextLeft( aFPos.nTabCnt ); aLR.SetTextFirstLineOffset( 0 ); diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index a9bb69fe17ed..ba5e6ac56d08 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -1054,8 +1054,7 @@ static bool FindAttrsImpl(SwPaM & rSearchPam, // check which text/char attributes are searched SwAttrCheckArr aCmpArr( rSet, bSrchForward, bNoColls ); - SfxItemSet aOtherSet( rSearchPam.GetDoc().GetAttrPool(), - svl::Items<RES_PARATR_BEGIN, RES_GRFATR_END-1> ); + SfxItemSetFixed<RES_PARATR_BEGIN, RES_GRFATR_END-1> aOtherSet( rSearchPam.GetDoc().GetAttrPool() ); aOtherSet.Put( rSet, false ); // got all invalid items FnSearchAttr fnSearch = bSrchForward diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index 5dd731471828..a1fe74191499 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -272,9 +272,8 @@ void SwVisibleCursor::SetPosAndShow(SfxViewShell const * pViewShell) if (pShell) { - SfxItemSet aSet(m_pCursorShell->GetSfxViewShell()->GetPool(), - svl::Items<RES_TXTATR_INETFMT, - RES_TXTATR_INETFMT>); + SfxItemSetFixed<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT> + aSet(m_pCursorShell->GetSfxViewShell()->GetPool()); pShell->GetCurAttr(aSet); if(SfxItemState::SET <= aSet.GetItemState( RES_TXTATR_INETFMT )) { diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index dd0541fae84c..36c7f33d1c17 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -1268,9 +1268,8 @@ namespace //local functions originally from docfmt.cxx if (!xExtra) { // Apply the first character's attributes to the ReplaceText - SfxItemSet aSet( rDoc.GetAttrPool(), - svl::Items<RES_CHRATR_BEGIN, RES_TXTATR_WITHEND_END - 1, - RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1> ); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_TXTATR_WITHEND_END - 1, + RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1> aSet( rDoc.GetAttrPool() ); SwTextNode * pNode = rRg.Start()->nNode.GetNode().GetTextNode(); pNode->GetParaAttr( aSet, rRg.Start()->nContent.GetIndex() + 1, rRg.End()->nContent.GetIndex() ); @@ -1423,21 +1422,17 @@ namespace //local functions originally from docfmt.cxx // - The attribute in rChgSet does not belong to one of the above categories if ( !bCharAttr && !bOtherAttr ) { - SfxItemSet* pTmpCharItemSet = new SfxItemSet( - rDoc.GetAttrPool(), - svl::Items< + SfxItemSet* pTmpCharItemSet = new SfxItemSetFixed< RES_CHRATR_BEGIN, RES_CHRATR_END - 1, RES_TXTATR_AUTOFMT, RES_TXTATR_CHARFMT, RES_TXTATR_UNKNOWN_CONTAINER, - RES_TXTATR_UNKNOWN_CONTAINER>); + RES_TXTATR_UNKNOWN_CONTAINER>( rDoc.GetAttrPool() ); - SfxItemSet* pTmpOtherItemSet = new SfxItemSet( - rDoc.GetAttrPool(), - svl::Items< + SfxItemSet* pTmpOtherItemSet = new SfxItemSetFixed< RES_PARATR_BEGIN, RES_GRFATR_END - 1, RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END - 1, // FillAttribute support: - XATTR_FILL_FIRST, XATTR_FILL_LAST>); + XATTR_FILL_FIRST, XATTR_FILL_LAST>( rDoc.GetAttrPool() ); pTmpCharItemSet->Put( rChgSet ); pTmpOtherItemSet->Put( rChgSet ); @@ -1526,8 +1521,8 @@ namespace //local functions originally from docfmt.cxx // Attributes without an end do not have a range if ( !bCharAttr && !bOtherAttr ) { - SfxItemSet aTextSet( rDoc.GetAttrPool(), - svl::Items<RES_TXTATR_NOEND_BEGIN, RES_TXTATR_NOEND_END-1> ); + SfxItemSetFixed<RES_TXTATR_NOEND_BEGIN, RES_TXTATR_NOEND_END-1> + aTextSet( rDoc.GetAttrPool() ); aTextSet.Put( rChgSet ); if( aTextSet.Count() ) { @@ -1557,12 +1552,11 @@ namespace //local functions originally from docfmt.cxx { // CharFormat and URL attributes are treated separately! // TEST_TEMP ToDo: AutoFormat! - SfxItemSet aTextSet( - rDoc.GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_TXTATR_REFMARK, RES_TXTATR_METAFIELD, RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY, - RES_TXTATR_INPUTFIELD, RES_TXTATR_INPUTFIELD>); + RES_TXTATR_INPUTFIELD, RES_TXTATR_INPUTFIELD> + aTextSet(rDoc.GetAttrPool()); aTextSet.Put( rChgSet ); if( aTextSet.Count() ) @@ -1695,16 +1689,15 @@ namespace //local functions originally from docfmt.cxx } } - SfxItemSet firstSet(rDoc.GetAttrPool(), - svl::Items<RES_PAGEDESC, RES_BREAK>); + SfxItemSetFixed<RES_PAGEDESC, RES_BREAK> firstSet(rDoc.GetAttrPool()); if (pOtherSet && pOtherSet->Count()) { // actually only RES_BREAK is possible here... firstSet.Put(*pOtherSet); } - SfxItemSet propsSet(rDoc.GetAttrPool(), - svl::Items<RES_PARATR_BEGIN, RES_PAGEDESC, + SfxItemSetFixed + <RES_PARATR_BEGIN, RES_PAGEDESC, RES_BREAK+1, RES_FRMATR_END, - XATTR_FILL_FIRST, XATTR_FILL_LAST+1>); + XATTR_FILL_FIRST, XATTR_FILL_LAST+1> propsSet(rDoc.GetAttrPool()); if (pOtherSet && pOtherSet->Count()) { propsSet.Put(*pOtherSet); @@ -4482,9 +4475,9 @@ bool DocumentContentOperationsManager::ReplaceRangeImpl( SwPaM& rPam, const OUSt if( !sRepl.isEmpty() ) { // Apply the first character's attributes to the ReplaceText - SfxItemSet aSet( m_rDoc.GetAttrPool(), - svl::Items<RES_CHRATR_BEGIN, RES_TXTATR_WITHEND_END - 1, - RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1> ); + SfxItemSetFixed + <RES_CHRATR_BEGIN, RES_TXTATR_WITHEND_END - 1, + RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1> aSet( m_rDoc.GetAttrPool() ); pTextNd->GetParaAttr( 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 5719a26e6076..a53a3ada86f2 100644 --- a/sw/source/core/doc/DocumentDeviceManager.cxx +++ b/sw/source/core/doc/DocumentDeviceManager.cxx @@ -205,13 +205,11 @@ void DocumentDeviceManager::setJobsetup(/*[in]*/ const JobSetup &rJobSetup ) if( !mpPrt ) { //The ItemSet is deleted by Sfx! - auto pSet = std::make_unique<SfxItemSet>( - m_rDoc.GetAttrPool(), - svl::Items< + auto pSet = std::make_unique<SfxItemSetFixed< SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, SID_HTML_MODE, SID_HTML_MODE, - FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER>); + FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER>>(m_rDoc.GetAttrPool()); VclPtr<SfxPrinter> p = VclPtr<SfxPrinter>::Create( std::move(pSet), rJobSetup ); if ( bCheckPageDescs ) setPrinter( p, true, true ); @@ -290,13 +288,11 @@ SfxPrinter& DocumentDeviceManager::CreatePrinter_() const // We create a default SfxPrinter. // The ItemSet is deleted by Sfx! - auto pSet = std::make_unique<SfxItemSet>( - m_rDoc.GetAttrPool(), - svl::Items< + auto pSet = std::make_unique<SfxItemSetFixed< SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, SID_HTML_MODE, SID_HTML_MODE, - FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER>); + FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER>>(m_rDoc.GetAttrPool()); VclPtr<SfxPrinter> pNewPrt = VclPtr<SfxPrinter>::Create( std::move(pSet) ); diff --git a/sw/source/core/doc/DocumentFieldsManager.cxx b/sw/source/core/doc/DocumentFieldsManager.cxx index 6a190e9fb21c..ff2f5168fa1e 100644 --- a/sw/source/core/doc/DocumentFieldsManager.cxx +++ b/sw/source/core/doc/DocumentFieldsManager.cxx @@ -854,8 +854,7 @@ void DocumentFieldsManager::UpdateTableFields( SfxPoolItem* pHt ) } SwFrameFormat* pFormat = pBox->ClaimFrameFormat(); - SfxItemSet aTmp( m_rDoc.GetAttrPool(), - svl::Items<RES_BOXATR_BEGIN,RES_BOXATR_END-1> ); + SfxItemSetFixed<RES_BOXATR_BEGIN,RES_BOXATR_END-1> aTmp( m_rDoc.GetAttrPool() ); if( pCalc->IsCalcError() ) nValue = DBL_MAX; diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 73e775f667e2..6dfac2b67012 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -403,12 +403,11 @@ namespace // using Undo, remove direct paragraph formatting of the "To" paragraph, // and apply here direct paragraph formatting of the "From" paragraph - SfxItemSet aTmp( - rDoc.GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_PARATR_BEGIN, RES_PARATR_END - 3, // skip RSID and GRABBAG RES_PARATR_LIST_BEGIN, RES_UL_SPACE, // skip PAGEDESC and BREAK - RES_CNTNT, RES_FRMATR_END - 1>); + RES_CNTNT, RES_FRMATR_END - 1> + aTmp(rDoc.GetAttrPool()); SfxItemSet aTmp2(aTmp); pToNode->GetParaAttr(aTmp, 0, 0); diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx index f8b0a15e942a..8293ef06bc31 100644 --- a/sw/source/core/doc/docfly.cxx +++ b/sw/source/core/doc/docfly.cxx @@ -1118,8 +1118,8 @@ SwChainRet SwDoc::Chain( SwFrameFormat &rSource, const SwFrameFormat &rDest ) aChain.SetPrev( &static_cast<SwFlyFrameFormat&>(rSource) ); SetAttr( aChain, rDestFormat ); - SfxItemSet aSet( GetAttrPool(), svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, - RES_CHAIN, RES_CHAIN> ); + SfxItemSetFixed<RES_FRM_SIZE, RES_FRM_SIZE, + RES_CHAIN, RES_CHAIN> aSet( GetAttrPool() ); // 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 4b5d592e87c9..194c863ee746 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -112,18 +112,16 @@ static bool lcl_RstAttr( SwNode* pNd, void* pArgs ) // remove unused attribute RES_LR_SPACE // add list attributes - SfxItemSet aSavedAttrsSet( - rDoc.GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_PARATR_NUMRULE, RES_PARATR_NUMRULE, RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1, - RES_PAGEDESC, RES_BREAK>); + RES_PAGEDESC, RES_BREAK> aSavedAttrsSet(rDoc.GetAttrPool()); const SfxItemSet* pAttrSetOfNode = pNode->GetpSwAttrSet(); std::vector<sal_uInt16> aClearWhichIds; // restoring all paragraph list attributes { - SfxItemSet aListAttrSet( rDoc.GetAttrPool(), svl::Items<RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1> ); + SfxItemSetFixed<RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1> aListAttrSet( rDoc.GetAttrPool() ); aListAttrSet.Set(*pAttrSetOfNode); if ( aListAttrSet.Count() ) { @@ -321,10 +319,11 @@ void SwDoc::ResetAttrs( const SwPaM &rRg, pStt, pEnd, pHst, nullptr, pLayout); // mst: not including META here; it seems attrs with CH_TXTATR are omitted - SfxItemSet aDelSet(GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1, - RES_TXTATR_INETFMT, RES_TXTATR_UNKNOWN_CONTAINER, - RES_PARATR_BEGIN, RES_FRMATR_END - 1, - RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END - 1>); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END - 1, + RES_TXTATR_INETFMT, RES_TXTATR_UNKNOWN_CONTAINER, + RES_PARATR_BEGIN, RES_FRMATR_END - 1, + RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END - 1> + aDelSet(GetAttrPool()); for( auto it = rAttrs.rbegin(); it != rAttrs.rend(); ++it ) { if( POOLATTR_END > *it ) @@ -416,7 +415,7 @@ void 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(), svl::Items<RES_CHRATR_RSID, RES_CHRATR_RSID>); + SfxItemSetFixed<RES_CHRATR_RSID, RES_CHRATR_RSID> aSet(GetAttrPool()); aSet.Put(aRsid); bool const bRet(pTextNode->SetAttr(aSet, nStart, rRg.GetPoint()->nContent.GetIndex())); diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx index d75392ba3205..1c2d6b3f3f96 100644 --- a/sw/source/core/doc/docnew.cxx +++ b/sw/source/core/doc/docnew.cxx @@ -351,7 +351,7 @@ SwDoc::SwDoc() // pass empty item set containing the paragraph's list attributes // as ignorable items to the stype manager. { - SfxItemSet aIgnorableParagraphItems( GetAttrPool(), svl::Items<RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1>); + SfxItemSetFixed<RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1> aIgnorableParagraphItems( GetAttrPool() ); mpStyleAccess = createStyleManager( &aIgnorableParagraphItems ); } diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index fbd7ff9e9bcb..38626edb3198 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -881,11 +881,10 @@ void FlatFndBox::FillFlat(const FndBox_& rBox, bool bLastBox) SfxItemState::SET == pFormat->GetItemState( RES_BOXATR_FORMULA ) || SfxItemState::SET == pFormat->GetItemState( RES_BOXATR_VALUE ) ) { - SfxItemSet aSet( - m_pDoc->GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_VERT_ORIENT, RES_VERT_ORIENT, - RES_BOXATR_FORMAT, RES_BOXATR_VALUE>); + RES_BOXATR_FORMAT, RES_BOXATR_VALUE> + aSet(m_pDoc->GetAttrPool()); aSet.Put( pFormat->GetAttrSet() ); if( m_vItemSets.empty() ) { diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx index e5b4c8f8095a..e0db7464470f 100644 --- a/sw/source/core/doc/tblcpy.cxx +++ b/sw/source/core/doc/tblcpy.cxx @@ -618,8 +618,7 @@ static void lcl_CpyBox( const SwTable& rCpyTable, const SwTableBox* pCpyBox, if( !pCpyBox ) return; - SfxItemSet aBoxAttrSet( pCpyDoc->GetAttrPool(), svl::Items<RES_BOXATR_FORMAT, - RES_BOXATR_VALUE> ); + SfxItemSetFixed<RES_BOXATR_FORMAT, RES_BOXATR_VALUE> aBoxAttrSet( pCpyDoc->GetAttrPool() ); aBoxAttrSet.Put( pCpyBox->GetFrameFormat()->GetAttrSet() ); if( !aBoxAttrSet.Count() ) return; diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx index 2273ec51c12f..d32e9f2af3e0 100644 --- a/sw/source/core/doc/tblrwcl.cxx +++ b/sw/source/core/doc/tblrwcl.cxx @@ -1904,8 +1904,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->rDoc.GetAttrPool(), - svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE> ); + SfxItemSetFixed<RES_BOXATR_FORMAT, RES_BOXATR_VALUE> aBoxAttrSet( pCpyPara->rDoc.GetAttrPool() ); 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 aeaa4042a6f2..87cbdfd5db70 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -484,7 +484,7 @@ const SwTable* SwDoc::InsertTable( const SwInsertTableOptions& rInsTableOpts, const sal_uInt16 nBoxArrLen = pTAFormat ? 16 : 4; aBoxFormatArr.resize( nBoxArrLen, nullptr ); } - SfxItemSet aCharSet( GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1> ); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1> aCharSet( GetAttrPool() ); SwNodeIndex aNdIdx( *pTableNd, 1 ); // Set to StartNode of first Box SwTableLines& rLines = rNdTable.GetTabLines(); @@ -770,7 +770,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTableOpts, aBoxFormatArr2 = std::vector<SwTableBoxFormat*>( nBoxArrLen, nullptr ); } - SfxItemSet aCharSet( GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1> ); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1> aCharSet( GetAttrPool() ); SwHistory* pHistory = pUndo ? &pUndo->GetHistory() : nullptr; @@ -3056,11 +3056,11 @@ void sw_BoxSetSplitBoxFormats( SwTableBox* pBox, SwCollectTableLineBoxes* pSplPa } else { - SfxItemSet aTmpSet( pFormat->GetDoc()->GetAttrPool(), - svl::Items<RES_LR_SPACE, RES_UL_SPACE, - RES_PROTECT, RES_PROTECT, - RES_VERT_ORIENT, RES_VERT_ORIENT, - RES_BACKGROUND, RES_SHADOW> ); + SfxItemSetFixed<RES_LR_SPACE, RES_UL_SPACE, + RES_PROTECT, RES_PROTECT, + RES_VERT_ORIENT, RES_VERT_ORIENT, + RES_BACKGROUND, RES_SHADOW> + aTmpSet( pFormat->GetDoc()->GetAttrPool() ); aTmpSet.Put( pFormat->GetAttrSet() ); if( aTmpSet.Count() ) pBox->ClaimFrameFormat()->SetFormatAttr( aTmpSet ); @@ -3676,7 +3676,7 @@ static bool lcl_SetAFormatBox(FndBox_ & rBox, SetAFormatTabPara *pSetPara, bool pSetBox->SetDirectFormatting(false); SwDoc* pDoc = pSetBox->GetFrameFormat()->GetDoc(); - SfxItemSet aCharSet(pDoc->GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1>); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1> aCharSet(pDoc->GetAttrPool()); SfxItemSet aBoxSet(pDoc->GetAttrPool(), aTableBoxSetRange); sal_uInt8 nPos = pSetPara->nAFormatLine * 4 + pSetPara->nAFormatBox; const bool bSingleRowTable = pSetPara->bSingleRowTable; @@ -4064,7 +4064,7 @@ void SwDoc::ChkBoxNumFormat( SwTableBox& rBox, bool bCallUpdate ) } SwTableBoxFormat* pBoxFormat = static_cast<SwTableBoxFormat*>(rBox.GetFrameFormat()); - SfxItemSet aBoxSet( GetAttrPool(), svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE> ); + SfxItemSetFixed<RES_BOXATR_FORMAT, RES_BOXATR_VALUE> aBoxSet( GetAttrPool() ); bool bLockModify = true; bool bSetNumberFormat = IsInsTableFormatNum(); @@ -4217,8 +4217,8 @@ void SwDoc::ClearLineNumAttrs( SwPosition const & rPos ) return; const SfxPoolItem* pFormatItem = nullptr; - SfxItemSet rSet( pTextNode->GetDoc().GetAttrPool(), - svl::Items<RES_PARATR_BEGIN, RES_PARATR_END - 1>); + SfxItemSetFixed<RES_PARATR_BEGIN, RES_PARATR_END - 1> + rSet( pTextNode->GetDoc().GetAttrPool() ); pTextNode->SwContentNode::GetAttr( rSet ); if ( SfxItemState::SET != rSet.GetItemState( RES_PARATR_NUMRULE , false , &pFormatItem ) ) return; diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx index 7d7ff10ed73d..7c0403239130 100644 --- a/sw/source/core/docnode/node.cxx +++ b/sw/source/core/docnode/node.cxx @@ -154,10 +154,10 @@ static bool Put( std::shared_ptr<const SfxItemSet>& rpAttrSet, const SwContentNo SwAttrSet aNewSet( static_cast<const SwAttrSet&>(*rpAttrSet) ); // #i76273# Robust - std::optional<SfxItemSet> pStyleNames; + std::optional<SfxItemSetFixed<RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME>> pStyleNames; if ( SfxItemState::SET == rSet.GetItemState( RES_FRMATR_STYLE_NAME, false ) ) { - pStyleNames.emplace( *aNewSet.GetPool(), svl::Items<RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME> ); + pStyleNames.emplace( *aNewSet.GetPool() ); pStyleNames->Put( aNewSet ); } @@ -201,10 +201,10 @@ static bool Put_BC( std::shared_ptr<const SfxItemSet>& rpAttrSet, SwAttrSet aNewSet( static_cast<const SwAttrSet&>(*rpAttrSet) ); // #i76273# Robust - std::optional<SfxItemSet> pStyleNames; + std::optional<SfxItemSetFixed<RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME>> pStyleNames; if ( SfxItemState::SET == rSet.GetItemState( RES_FRMATR_STYLE_NAME, false ) ) { - pStyleNames.emplace( *aNewSet.GetPool(), svl::Items<RES_FRMATR_STYLE_NAME, RES_FRMATR_CONDITIONAL_STYLE_NAME> ); + pStyleNames.emplace( *aNewSet.GetPool() ); pStyleNames->Put( aNewSet ); } diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 762b27251cbe..cb9618c44e8b 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -1088,7 +1088,7 @@ static 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(), svl::Items<RES_FRM_SIZE, RES_FRM_SIZE>); + SfxItemSetFixed<RES_FRM_SIZE, RES_FRM_SIZE> aResizeSet(pFormat->GetDoc()->GetAttrPool()); SwFormatFrameSize aSize; aResizeSet.Put(aSize); SwTextBoxHelper::syncFlyFrameAttr(*pFormat, aResizeSet, pFormat->FindRealSdrObject()); @@ -1283,8 +1283,7 @@ void SwDrawContact::Changed_( const SdrObject& rObj, assert(!"<SwDrawContact::Changed_(..)> - unsupported layout direction"); } } - SfxItemSet aSet( GetFormat()->GetDoc()->GetAttrPool(), - svl::Items<RES_VERT_ORIENT, RES_HORI_ORIENT> ); + SfxItemSetFixed<RES_VERT_ORIENT, RES_HORI_ORIENT> aSet( GetFormat()->GetDoc()->GetAttrPool() ); const SwFormatVertOrient& rVert = GetFormat()->GetVertOrient(); if ( nYPosDiff != 0 ) { @@ -1354,9 +1353,8 @@ void SwDrawContact::Changed_( const SdrObject& rObj, const bool bEnableSetModified = pDoc->getIDocumentState().IsEnableSetModified(); pDoc->getIDocumentState().SetEnableSetModified(false); - SfxItemSet aSyncSet( - pDoc->GetAttrPool(), - svl::Items<RES_VERT_ORIENT, RES_HORI_ORIENT, RES_ANCHOR, RES_ANCHOR>); + SfxItemSetFixed<RES_VERT_ORIENT, RES_HORI_ORIENT, RES_ANCHOR, RES_ANCHOR> + aSyncSet( pDoc->GetAttrPool() ); aSyncSet.Put(GetFormat()->GetHoriOrient()); bool bRelToTableCell(false); aSyncSet.Put(SwFormatVertOrient(pAnchoredDrawObj->GetRelPosToPageFrame(false, bRelToTableCell).getY(), @@ -1367,9 +1365,7 @@ void SwDrawContact::Changed_( const SdrObject& rObj, auto pSdrObj = const_cast<SdrObject*>(&rObj); if (pSdrObj != GetFormat()->FindRealSdrObject()) { - SfxItemSet aSet( - pDoc->GetAttrPool(), - svl::Items<RES_FRM_SIZE, RES_FRM_SIZE>); + SfxItemSetFixed<RES_FRM_SIZE, RES_FRM_SIZE> aSet( pDoc->GetAttrPool() ); aSet.Put(aSyncSet); aSet.Put(pSdrObj->GetMergedItem(RES_FRM_SIZE)); diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index 6d0a1ee0d917..d5497f9f2098 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -867,7 +867,7 @@ void SwVirtFlyDrawObj::NbcCrop(const basegfx::B2DPoint& rRef, double fxFact, dou Fraction(fyFact)); // Get old values for crop in 10th of mm - SfxItemSet aSet( pSh->GetAttrPool(), svl::Items<RES_GRFATR_CROPGRF, RES_GRFATR_CROPGRF> ); + SfxItemSetFixed<RES_GRFATR_CROPGRF, RES_GRFATR_CROPGRF> aSet( pSh->GetAttrPool() ); pSh->GetCurAttr( aSet ); SwCropGrf aCrop( aSet.Get(RES_GRFATR_CROPGRF) ); diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx index 5a2db8a5753d..5ee956672643 100644 --- a/sw/source/core/edit/acorrect.cxx +++ b/sw/source/core/edit/acorrect.cxx @@ -320,8 +320,8 @@ bool SwAutoCorrDoc::SetINetAttr( sal_Int32 nStt, sal_Int32 nEnd, const OUString& SwPaM aPam(pFrame->MapViewToModelPos(TextFrameIndex(nStt)), pFrame->MapViewToModelPos(TextFrameIndex(nEnd))); - SfxItemSet aSet( m_rEditSh.GetDoc()->GetAttrPool(), - svl::Items<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT> ); + SfxItemSetFixed<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT> + aSet( m_rEditSh.GetDoc()->GetAttrPool() ); aSet.Put( SwFormatINetFormat( rURL, OUString() )); m_rEditSh.GetDoc()->SetFormatItemByAutoFormat( aPam, aSet ); if( m_bUndoIdInitialized ) diff --git a/sw/source/core/edit/autofmt.cxx b/sw/source/core/edit/autofmt.cxx index a5d8d64c4a27..e4f226bfe535 100644 --- a/sw/source/core/edit/autofmt.cxx +++ b/sw/source/core/edit/autofmt.cxx @@ -588,9 +588,8 @@ bool SwAutoFormat::DoUnderline() aLine.SetWidth( DEF_LINE_WIDTH_2 ); break; } - SfxItemSet aSet(m_pDoc->GetAttrPool(), - svl::Items<RES_PARATR_CONNECT_BORDER, RES_PARATR_CONNECT_BORDER, - RES_BOX, RES_BOX>); + SfxItemSetFixed<RES_PARATR_CONNECT_BORDER, RES_PARATR_CONNECT_BORDER, + RES_BOX, RES_BOX> aSet(m_pDoc->GetAttrPool()); aSet.Put( SwParaConnectBorderItem( false ) ); SvxBoxItem aBox( RES_BOX ); aBox.SetLine( &aLine, SvxBoxItemLine::BOTTOM ); @@ -1003,13 +1002,11 @@ void SwAutoFormat::SetColl( sal_uInt16 nId, bool bHdLineOrText ) m_aDelPam.GetPoint()->nContent.Assign(m_aDelPam.GetPoint()->nNode.GetNode().GetContentNode(), 0); // keep hard tabs, alignment, language, hyphenation, DropCaps and nearly all frame attributes - SfxItemSet aSet( - m_pDoc->GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE, RES_PARATR_ADJUST, RES_PARATR_ADJUST, RES_PARATR_TABSTOP, RES_PARATR_DROP, - RES_BACKGROUND, RES_SHADOW>); + RES_BACKGROUND, RES_SHADOW> aSet(m_pDoc->GetAttrPool()); if (m_aDelPam.GetPoint()->nNode.GetNode().GetTextNode()->HasSwAttrSet()) { diff --git a/sw/source/core/edit/edfmt.cxx b/sw/source/core/edit/edfmt.cxx index f579862ae362..ea9bd667110f 100644 --- a/sw/source/core/edit/edfmt.cxx +++ b/sw/source/core/edit/edfmt.cxx @@ -40,8 +40,7 @@ SwCharFormat& SwEditShell::GetCharFormat(sal_uInt16 nFormat) const SwCharFormat* SwEditShell::GetCurCharFormat() const { SwCharFormat *pFormat = nullptr; - SfxItemSet aSet( GetDoc()->GetAttrPool(), svl::Items<RES_TXTATR_CHARFMT, - RES_TXTATR_CHARFMT> ); + SfxItemSetFixed<RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT> aSet( GetDoc()->GetAttrPool() ); const SfxPoolItem* pItem; if( GetCurAttr( aSet ) && SfxItemState::SET == aSet.GetItemState( RES_TXTATR_CHARFMT, false, &pItem ) ) diff --git a/sw/source/core/fields/cellfml.cxx b/sw/source/core/fields/cellfml.cxx index 9babd5487905..f74b80401596 100644 --- a/sw/source/core/fields/cellfml.cxx +++ b/sw/source/core/fields/cellfml.cxx @@ -124,8 +124,7 @@ double SwTableBox::GetValue( SwTableCalcPara& rCalcPara ) const if( !rCalcPara.IsStackOverflow() ) { SwFrameFormat* pFormat = pBox->ClaimFrameFormat(); - SfxItemSet aTmp( pDoc->GetAttrPool(), - svl::Items<RES_BOXATR_BEGIN,RES_BOXATR_END-1> ); + SfxItemSetFixed<RES_BOXATR_BEGIN,RES_BOXATR_END-1> aTmp( pDoc->GetAttrPool() ); 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 b5fcb696ec24..b77effcf9b49 100644 --- a/sw/source/core/frmedt/fecopy.cxx +++ b/sw/source/core/frmedt/fecopy.cxx @@ -1416,8 +1416,7 @@ void SwFEShell::Paste( SvStream& rStrm, SwPasteSdr nAction, const Point* pPt ) if( dynamic_cast<const SwVirtFlyDrawObj*>( pOldObj) != nullptr ) { // store attributes, then set SdrObject - SfxItemSet aFrameSet( mxDoc->GetAttrPool(), - svl::Items<RES_SURROUND, RES_ANCHOR> ); + SfxItemSetFixed<RES_SURROUND, RES_ANCHOR> aFrameSet( mxDoc->GetAttrPool() ); aFrameSet.Set( pFormat->GetAttrSet() ); Point aNullPt; @@ -1594,7 +1593,7 @@ bool SwFEShell::Paste(const Graphic &rGrf, const OUString& rURL) { pView->AddUndo(std::make_unique<SdrUndoAttrObj>(*pObj)); - SfxItemSet aSet(pView->GetModel()->GetItemPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLBITMAP>); + SfxItemSetFixed<XATTR_FILLSTYLE, XATTR_FILLBITMAP> aSet(pView->GetModel()->GetItemPool()); 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 280f901cc5d3..7043681704d9 100644 --- a/sw/source/core/frmedt/fefly1.cxx +++ b/sw/source/core/frmedt/fefly1.cxx @@ -1136,12 +1136,12 @@ bool SwFEShell::SetFlyFrameAttr( SfxItemSet& rSet ) return bRet; } -SfxItemSet SwFEShell::makeItemSetFromFormatAnchor(SfxItemPool& rPool, const SwFormatAnchor &rAnchor) +SfxItemSetFixed<RES_VERT_ORIENT, RES_ANCHOR> SwFEShell::makeItemSetFromFormatAnchor(SfxItemPool& rPool, const SwFormatAnchor &rAnchor) { // 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, svl::Items<RES_VERT_ORIENT, RES_ANCHOR>); + SfxItemSetFixed<RES_VERT_ORIENT, RES_ANCHOR> aSet(rPool); aSet.Put(rAnchor); return aSet; } diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index 81b8becdc24a..24a9655945f3 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -2023,8 +2023,8 @@ bool SwFEShell::ImpEndCreate() } } - SfxItemSet aSet( GetDoc()->GetAttrPool(), svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, - RES_SURROUND, RES_ANCHOR> ); + SfxItemSetFixed<RES_FRM_SIZE, RES_FRM_SIZE, + RES_SURROUND, RES_ANCHOR> aSet( GetDoc()->GetAttrPool() ); aSet.Put( aAnch ); // OD 2004-03-30 #i26791# - determine relative object position @@ -2098,7 +2098,7 @@ bool SwFEShell::ImpEndCreate() ::GetHtmlMode( GetDoc()->GetDocShell() ) && nullptr != ( pFlyFrame = GetSelectedFlyFrame() )) { - SfxItemSet aHtmlSet( GetDoc()->GetAttrPool(), svl::Items<RES_VERT_ORIENT, RES_HORI_ORIENT> ); + SfxItemSetFixed<RES_VERT_ORIENT, RES_HORI_ORIENT> aHtmlSet( GetDoc()->GetAttrPool() ); // horizontal orientation: const bool bLeftFrame = aFlyRect.Left() < pAnch->getFrameArea().Left() + pAnch->getFramePrintArea().Left(), @@ -2840,8 +2840,8 @@ void SwFEShell::CheckUnboundObjects() // First the action here, to assure GetCharRect delivers current values. StartAllAction(); - SfxItemSet aSet( GetAttrPool(), svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, - RES_SURROUND, RES_ANCHOR> ); + SfxItemSetFixed<RES_FRM_SIZE, RES_FRM_SIZE, + RES_SURROUND, RES_ANCHOR> aSet( GetAttrPool() ); aSet.Put( aAnch ); aSet.Put( SwFormatSurround( css::text::WrapTextMode_THROUGH ) ); SwFrameFormat* pFormat = getIDocumentLayoutAccess().MakeLayoutFormat( RndStdIds::DRAW_OBJECT, &aSet ); @@ -3202,7 +3202,7 @@ void SwFEShell::CreateDefaultShape( SdrObjKind eSdrObjectKind, const tools::Rect if(bMarquee) { - SfxItemSet aSet(pDrawModel->GetItemPool(), svl::Items<SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST>); + SfxItemSetFixed<SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST> aSet(pDrawModel->GetItemPool()); aSet.Put( makeSdrTextAutoGrowWidthItem( false ) ); aSet.Put( makeSdrTextAutoGrowHeightItem( false ) ); aSet.Put( SdrTextAniKindItem( SdrTextAniKind::Slide ) ); diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx index f0458f300bdc..3e37961dffd6 100644 --- a/sw/source/core/layout/anchoreddrawobject.cxx +++ b/sw/source/core/layout/anchoreddrawobject.cxx @@ -795,7 +795,7 @@ void SwAnchoredDrawObject::AdjustPositioningAttr( const SwFrame* _pNewAnchorFram SwFormatHoriOrient hori(nHoriRelPos, text::HoriOrientation::NONE, text::RelOrientation::FRAME); SwFormatVertOrient vert(nVertRelPos, text::VertOrientation::NONE, text::RelOrientation::FRAME); - SfxItemSet items(GetFrameFormat().GetDoc()->GetAttrPool(), svl::Items<RES_VERT_ORIENT, RES_HORI_ORIENT>); + SfxItemSetFixed<RES_VERT_ORIENT, RES_HORI_ORIENT> items(GetFrameFormat().GetDoc()->GetAttrPool()); items.Put(hori); items.Put(vert); GetFrameFormat().GetDoc()->SetAttr(items, GetFrameFormat()); diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index e5588ed10f7a..b4c6c58ee06d 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -1128,8 +1128,7 @@ void SwFlyFrame::ChgRelPos( const Point &rNewPos ) SwTwips nTmpY = nNewY == LONG_MAX ? 0 : nNewY; if( bVert ) nTmpY = -nTmpY; - SfxItemSet aSet( pFormat->GetDoc()->GetAttrPool(), - svl::Items<RES_VERT_ORIENT, RES_HORI_ORIENT>); + SfxItemSetFixed<RES_VERT_ORIENT, RES_HORI_ORIENT> aSet( pFormat->GetDoc()->GetAttrPool() ); 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 1440c08a7e89..258b31b6d058 100644 --- a/sw/source/core/text/redlnitr.cxx +++ b/sw/source/core/text/redlnitr.cxx @@ -721,7 +721,7 @@ short SwRedlineItr::Seek(SwFont& rFnt, { SwAttrPool& rPool = const_cast<SwDoc&>(m_rDoc).GetAttrPool(); - m_pSet = std::make_unique<SfxItemSet>(rPool, svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1>); + m_pSet = std::make_unique<SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END-1>>(rPool); } if( 1 < pRed->GetStackCount() ) diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx index bfcb5ef57c05..ee9cd7668d12 100644 --- a/sw/source/core/text/txtfld.cxx +++ b/sw/source/core/text/txtfld.cxx @@ -568,7 +568,7 @@ static void lcl_setRedlineAttr( SwTextFormatInfo &rInf, const SwTextNode& rTextN return; SwAttrPool& rPool = rInf.GetVsh()->GetDoc()->GetAttrPool(); - SfxItemSet aSet(rPool, svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1>); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END-1> aSet(rPool); std::size_t aAuthor = (1 < pRedlineNum->GetStackCount()) ? pRedlineNum->GetAuthor( 1 ) diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 326300f9a8ad..ebc777ee5219 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -383,8 +383,7 @@ namespace sw { rFormatSet.ClearItem(RES_BREAK); static_assert(RES_PAGEDESC + 1 == sal_uInt16(RES_BREAK), "first-node items must be adjacent"); - SfxItemSet firstSet(*rFormatSet.GetPool(), - svl::Items<RES_PAGEDESC, RES_BREAK>); + SfxItemSetFixed<RES_PAGEDESC, RES_BREAK> firstSet(*rFormatSet.GetPool()); pMerged->pFirstNode->SwContentNode::GetAttr(firstSet); rFormatSet.Put(firstSet); @@ -402,10 +401,10 @@ namespace sw { { rFormatSet.ClearItem(i); } - SfxItemSet propsSet(*rFormatSet.GetPool(), - svl::Items<RES_PARATR_BEGIN, RES_PAGEDESC, + SfxItemSetFixed<RES_PARATR_BEGIN, RES_PAGEDESC, RES_BREAK+1, RES_FRMATR_END, - XATTR_FILL_FIRST, XATTR_FILL_LAST+1>); + XATTR_FILL_FIRST, XATTR_FILL_LAST+1> + propsSet(*rFormatSet.GetPool()); pMerged->pParaPropsNode->SwContentNode::GetAttr(propsSet); rFormatSet.Put(propsSet); return *pMerged->pParaPropsNode; diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 8d5a58eccb25..6ca45bf97a7d 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -1994,12 +1994,11 @@ void SwTextNode::CopyText( SwTextNode *const pDest, pDest->HasSwAttrSet() || nLen != pDest->GetText().getLength())) { - SfxItemSet aCharSet( - pDest->GetDoc().GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_CHRATR_BEGIN, RES_CHRATR_END - 1, RES_TXTATR_INETFMT, RES_TXTATR_CHARFMT, - RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END - 1> ); + RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END - 1> + aCharSet( pDest->GetDoc().GetAttrPool() ); aCharSet.Put( *GetpSwAttrSet() ); if( aCharSet.Count() ) { @@ -2037,12 +2036,11 @@ void SwTextNode::CopyText( SwTextNode *const pDest, pDest->HasSwAttrSet() || nLen != pDest->GetText().getLength())) { - SfxItemSet aCharSet( - pDest->GetDoc().GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_CHRATR_BEGIN, RES_CHRATR_END - 1, RES_TXTATR_INETFMT, RES_TXTATR_CHARFMT, - RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END - 1>); + RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END - 1> + aCharSet( pDest->GetDoc().GetAttrPool() ); aCharSet.Put( *GetpSwAttrSet() ); if( aCharSet.Count() ) { @@ -2460,12 +2458,11 @@ void SwTextNode::CutImpl( SwTextNode * const pDest, const SwIndex & rDestStart, if( nInitSize || hasSwAttrSet || nLen != pDest->GetText().getLength()) { - SfxItemSet aCharSet( - pDest->GetDoc().GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_CHRATR_BEGIN, RES_CHRATR_END - 1, RES_TXTATR_INETFMT, RES_TXTATR_CHARFMT, - RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END - 1>); + RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END - 1> + aCharSet( pDest->GetDoc().GetAttrPool() ); aCharSet.Put( *GetpSwAttrSet() ); if( aCharSet.Count() ) pDest->SetAttr( aCharSet, nDestStart, nDestStart + nLen ); @@ -2474,10 +2471,9 @@ void SwTextNode::CutImpl( SwTextNode * const pDest, const SwIndex & rDestStart, { // Copy all attrs except RES_PARATR_LIST_LEVEL: it was initialized before // and current SwTextNode can contain not suitable for pDest value - SfxItemSet aCharSet( - pDest->GetDoc().GetAttrPool(), - svl::Items<RES_CHRATR_BEGIN, RES_PARATR_LIST_LEVEL - 1, - RES_PARATR_LIST_LEVEL + 1, HINT_END>); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_PARATR_LIST_LEVEL - 1, + RES_PARATR_LIST_LEVEL + 1, HINT_END> + aCharSet(pDest->GetDoc().GetAttrPool()); aCharSet.Put(*GetpSwAttrSet()); if (aCharSet.Count()) pDest->SetAttr(aCharSet, nDestStart, nDestStart + nLen); @@ -5159,7 +5155,7 @@ void SwTextNode::dumpAsXml(xmlTextWriterPtr pWriter) const sal_uInt32 SwTextNode::GetRsid( sal_Int32 nStt, sal_Int32 nEnd ) const { - SfxItemSet aSet( const_cast<SwAttrPool&>((GetDoc().GetAttrPool())), svl::Items<RES_CHRATR_RSID, RES_CHRATR_RSID> ); + SfxItemSetFixed<RES_CHRATR_RSID, RES_CHRATR_RSID> aSet( const_cast<SwAttrPool&>((GetDoc().GetAttrPool())) ); if (GetParaAttr(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 2464bc9d6860..f2e394b76e8b 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1026,8 +1026,7 @@ SwTextAttr* MakeTextAttr( // Somebody wants to build a SwTextAttr for a character attribute. // Sorry, this is not allowed any longer. // You'll get a brand new autostyle attribute: - SfxItemSet aItemSet( rDoc.GetAttrPool(), - svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END> ); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END> aItemSet( rDoc.GetAttrPool() ); aItemSet.Put( rAttr ); return MakeTextAttr( rDoc, aItemSet, nStt, nEnd ); } @@ -1835,7 +1834,7 @@ bool SwTextNode::SetAttr( // split sets (for selection in nodes) const SfxItemSet* pSet = &rSet; - SfxItemSet aTextSet( *rSet.GetPool(), svl::Items<RES_TXTATR_BEGIN, RES_TXTATR_END-1> ); + SfxItemSetFixed<RES_TXTATR_BEGIN, RES_TXTATR_END-1> aTextSet( *rSet.GetPool() ); // entire paragraph if ( !nStt && (nEnd == m_Text.getLength()) && diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 7d26e27ee56d..3e0ad953c45c 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -2217,8 +2217,7 @@ void SwUndoTableNumFormat::RedoImpl(::sw::UndoRedoContext & rContext) SwFrameFormat* pBoxFormat = pBox->ClaimFrameFormat(); if( m_bNewFormat || m_bNewFormula || m_bNewValue ) { - SfxItemSet aBoxSet( rDoc.GetAttrPool(), - svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE> ); + SfxItemSetFixed<RES_BOXATR_FORMAT, RES_BOXATR_VALUE> aBoxSet( rDoc.GetAttrPool() ); // Resetting attributes is not enough. In addition, take care that the // text will be also formatted correctly. @@ -2246,8 +2245,7 @@ void SwUndoTableNumFormat::RedoImpl(::sw::UndoRedoContext & rContext) } else if( getSwDefaultTextFormat() != m_nFormatIdx ) { - SfxItemSet aBoxSet( rDoc.GetAttrPool(), - svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE> ); + SfxItemSetFixed<RES_BOXATR_FORMAT, RES_BOXATR_VALUE> aBoxSet( rDoc.GetAttrPool() ); aBoxSet.Put( SwTableBoxNumFormat( m_nFormatIdx )); aBoxSet.Put( SwTableBoxValue( m_fNum )); @@ -2463,11 +2461,10 @@ void SwUndoTableCpyTable::UndoImpl(::sw::UndoRedoContext & rContext) aInsIdx = rBox.GetSttIdx() + 1; rDoc.GetNodes().Delete( aInsIdx ); - SfxItemSet aTmpSet( - rDoc.GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_VERT_ORIENT, RES_VERT_ORIENT, - RES_BOXATR_FORMAT, RES_BOXATR_VALUE>); + RES_BOXATR_FORMAT, RES_BOXATR_VALUE> + aTmpSet(rDoc.GetAttrPool()); aTmpSet.Put( rBox.GetFrameFormat()->GetAttrSet() ); if( aTmpSet.Count() ) { @@ -2484,11 +2481,9 @@ void SwUndoTableCpyTable::UndoImpl(::sw::UndoRedoContext & rContext) if( aTmpSet.Count() ) { - pEntry->pBoxNumAttr = std::make_unique<SfxItemSet>( - rDoc.GetAttrPool(), - svl::Items< + pEntry->pBoxNumAttr = std::make_unique<SfxItemSetFixed< RES_VERT_ORIENT, RES_VERT_ORIENT, - RES_BOXATR_FORMAT, RES_BOXATR_VALUE>); + RES_BOXATR_FORMAT, RES_BOXATR_VALUE>>(rDoc.GetAttrPool()); pEntry->pBoxNumAttr->Put( aTmpSet ); } @@ -2559,11 +2554,9 @@ void SwUndoTableCpyTable::RedoImpl(::sw::UndoRedoContext & rContext) aInsIdx = rBox.GetSttIdx() + 1; rDoc.GetNodes().Delete( aInsIdx ); - SfxItemSet aTmpSet( - rDoc.GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_VERT_ORIENT, RES_VERT_ORIENT, - RES_BOXATR_FORMAT, RES_BOXATR_VALUE>); + RES_BOXATR_FORMAT, RES_BOXATR_VALUE> aTmpSet(rDoc.GetAttrPool()); aTmpSet.Put( rBox.GetFrameFormat()->GetAttrSet() ); if( aTmpSet.Count() ) { @@ -2579,11 +2572,9 @@ void SwUndoTableCpyTable::RedoImpl(::sw::UndoRedoContext & rContext) if( aTmpSet.Count() ) { - pEntry->pBoxNumAttr = std::make_unique<SfxItemSet>( - rDoc.GetAttrPool(), - svl::Items< + pEntry->pBoxNumAttr = std::make_unique<SfxItemSetFixed< RES_VERT_ORIENT, RES_VERT_ORIENT, - RES_BOXATR_FORMAT, RES_BOXATR_VALUE>); + RES_BOXATR_FORMAT, RES_BOXATR_VALUE>>(rDoc.GetAttrPool()); pEntry->pBoxNumAttr->Put( aTmpSet ); } @@ -2612,11 +2603,9 @@ void SwUndoTableCpyTable::AddBoxBefore( const SwTableBox& rBox, bool bDelContent pEntry->pUndo = std::make_unique<SwUndoDelete>( aPam, true ); } - pEntry->pBoxNumAttr = std::make_unique<SfxItemSet>( - pDoc->GetAttrPool(), - svl::Items< + pEntry->pBoxNumAttr = std::make_unique<SfxItemSetFixed< RES_VERT_ORIENT, RES_VERT_ORIENT, - RES_BOXATR_FORMAT, RES_BOXATR_VALUE>); + RES_BOXATR_FORMAT, RES_BOXATR_VALUE>>(pDoc->GetAttrPool()); 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 603999eaee9b..cc6177bbb154 100644 --- a/sw/source/core/unocore/SwXTextDefaults.cxx +++ b/sw/source/core/unocore/SwXTextDefaults.cxx @@ -73,7 +73,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(), svl::Items<RES_PAGEDESC, RES_PAGEDESC> ); + SfxItemSetFixed<RES_PAGEDESC, RES_PAGEDESC> aSet( m_pDoc->GetAttrPool() ); 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 580553dbf8a2..56111d9817ef 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -584,8 +584,7 @@ void SwXDrawPage::add(const uno::Reference< drawing::XShape > & xShape) // now evaluate the properties of SwShapeDescriptor_Impl SwShapeDescriptor_Impl* pDesc = pShape->GetDescImpl(); - SfxItemSet aSet( m_pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, - RES_FRMATR_END-1> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1> aSet( m_pDoc->GetAttrPool() ); SwFormatAnchor aAnchor( RndStdIds::FLY_AS_CHAR ); bool bOpaque = false; if( pDesc ) @@ -1056,8 +1055,7 @@ void SwXShape::setPropertyValue(const OUString& rPropertyName, const uno::Any& a pFrame->GetFrameFormat()->GetDoc() == pDoc) { UnoActionContext aCtx(pDoc); - SfxItemSet aItemSet( pDoc->GetAttrPool(), - svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END - 1> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END - 1> aItemSet( pDoc->GetAttrPool() ); aItemSet.SetParent(&pFormat->GetAttrSet()); SwFormatAnchor aAnchor = static_cast<const SwFormatAnchor&>(aItemSet.Get(pEntry->nWID)); SwPosition aPos(*pFrame->GetFrameFormat()->GetContent().GetContentIdx()); diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 02886fbb7b76..85b38f9053e5 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -1732,8 +1732,7 @@ void SwXFrame::setPropertyValue(const OUString& rPropertyName, const ::uno::Any& SwXFrame* pFrame = comphelper::getFromUnoTunnel<SwXFrame>(xFrame); if(pFrame && this != pFrame && pFrame->GetFrameFormat() && pFrame->GetFrameFormat()->GetDoc() == pDoc) { - SfxItemSet aSet( pDoc->GetAttrPool(), - svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END - 1> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END - 1> aSet( pDoc->GetAttrPool() ); aSet.SetParent(&pFormat->GetAttrSet()); SwFormatAnchor aAnchor = static_cast<const SwFormatAnchor&>(aSet.Get(pEntry->nWID)); @@ -1752,12 +1751,13 @@ 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(), - svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END - 1, + SfxItemSetFixed + <RES_FRMATR_BEGIN, RES_FRMATR_END - 1, RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, // FillAttribute support - XATTR_FILL_FIRST, XATTR_FILL_LAST>); + XATTR_FILL_FIRST, XATTR_FILL_LAST> + aSet( pDoc->GetAttrPool()); bool bDone(false); aSet.SetParent(&pFormat->GetAttrSet()); @@ -2480,7 +2480,7 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName ) if(OWN_ATTR_FILLBMP_MODE == pEntry->nWID) { SwDoc* pDoc = pFormat->GetDoc(); - SfxItemSet aSet(pDoc->GetAttrPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>); + SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> aSet(pDoc->GetAttrPool()); aSet.SetParent(&pFormat->GetAttrSet()); aSet.ClearItem(XATTR_FILLBMP_STRETCH); @@ -2525,8 +2525,7 @@ void SwXFrame::setPropertyToDefault( const OUString& rPropertyName ) else { SwDoc* pDoc = pFormat->GetDoc(); - SfxItemSet aSet( pDoc->GetAttrPool(), - svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END - 1> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END - 1> aSet( pDoc->GetAttrPool() ); aSet.SetParent(&pFormat->GetAttrSet()); aSet.ClearItem(pEntry->nWID); if(rPropertyName != UNO_NAME_ANCHOR_TYPE) @@ -2702,19 +2701,18 @@ void SwXFrame::attachToRange(uno::Reference<text::XTextRange> const& xTextRange, SwNode& rNode = pDoc->GetNodes().GetEndOfContent(); SwPaM aPam(rNode); aPam.Move( fnMoveBackward, GoInDoc ); - static WhichRangesContainer const aFrameAttrRange(svl::Items< + + SfxItemSetFixed<RES_GRFATR_BEGIN, RES_GRFATR_END-1> aGrSet(pDoc->GetAttrPool()); + + SfxItemSetFixed< RES_FRMATR_BEGIN, RES_FRMATR_END-1, RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER, // FillAttribute support XATTR_FILL_FIRST, XATTR_FILL_LAST, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>); - static WhichRangesContainer const aGrAttrRange(svl::Items< - RES_GRFATR_BEGIN, RES_GRFATR_END-1>); - SfxItemSet aGrSet(pDoc->GetAttrPool(), aGrAttrRange ); - - SfxItemSet aFrameSet(pDoc->GetAttrPool(), aFrameAttrRange ); + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> + aFrameSet(pDoc->GetAttrPool() ); // set correct parent to get the XFILL_NONE FillStyle as needed aFrameSet.SetParent(&pDoc->GetDfltFrameFormat()->GetAttrSet()); @@ -2794,7 +2792,7 @@ void SwXFrame::attachToRange(uno::Reference<text::XTextRange> const& xTextRange, { pFormat->DelFrames(); pAnchorItem->SetAnchor( pCopySource->Start() ); - SfxItemSet aAnchorSet( pDoc->GetAttrPool(), svl::Items<RES_ANCHOR, RES_ANCHOR> ); + SfxItemSetFixed<RES_ANCHOR, RES_ANCHOR> aAnchorSet( pDoc->GetAttrPool() ); aAnchorSet.Put( *pAnchorItem ); pDoc->SetFlyFrameAttr( *pFormat, aAnchorSet ); } @@ -3108,7 +3106,7 @@ void SwXFrame::attach(const uno::Reference< text::XTextRange > & xTextRange) if (!::sw::XTextRangeToSwPaM(aIntPam, xTextRange)) throw lang::IllegalArgumentException(); - SfxItemSet aSet( pDoc->GetAttrPool(), svl::Items<RES_ANCHOR, RES_ANCHOR> ); + SfxItemSetFixed<RES_ANCHOR, RES_ANCHOR> aSet( pDoc->GetAttrPool() ); aSet.SetParent(&pFormat->GetAttrSet()); SwFormatAnchor aAnchor = aSet.Get(RES_ANCHOR); diff --git a/sw/source/core/unocore/unoobj.cxx b/sw/source/core/unocore/unoobj.cxx index b7c6cab3d7ed..c5e28f738dbb 100644 --- a/sw/source/core/unocore/unoobj.cxx +++ b/sw/source/core/unocore/unoobj.cxx @@ -349,8 +349,7 @@ lcl_setCharFormatSequence(SwPaM & rPam, uno::Any const& rValue) rPam.GetDoc().GetIDocumentUndoRedo().StartUndo(SwUndoId::START, nullptr); aStyle <<= aCharStyles.getConstArray()[nStyle]; // create a local set and apply each format directly - SfxItemSet aSet(rPam.GetDoc().GetAttrPool(), - svl::Items<RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT>); + SfxItemSetFixed<RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT> aSet(rPam.GetDoc().GetAttrPool()); lcl_setCharStyle(rPam.GetDoc(), aStyle, aSet); // the first style should replace the current attributes, // all other have to be added @@ -519,10 +518,11 @@ SwUnoCursorHelper::SetCursorPropertyValue( // TODO create own map for this, it contains UNO_NAME_DISPLAY_NAME? or make property readable so ODF export can map it to a automatic style? SfxItemPropertySet const& rPropSet(*aSwMapProvider.GetPropertySet(PROPERTY_MAP_CHAR_AUTO_STYLE)); SfxItemPropertyMap const& rMap(rPropSet.getPropertyMap()); - SfxItemSet items( rPam.GetDoc().GetAttrPool(), - svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1, + SfxItemSetFixed + <RES_CHRATR_BEGIN, RES_CHRATR_END-1, RES_TXTATR_CHARFMT, RES_TXTATR_CHARFMT, - RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1> ); + RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1> + items( rPam.GetDoc().GetAttrPool() ); for (beans::NamedValue const & prop : std::as_const(props)) { @@ -1716,11 +1716,11 @@ uno::Any SwUnoCursorHelper::GetPropertyValue( if (!bDone) { - SfxItemSet aSet( - rPaM.GetDoc().GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_CHRATR_BEGIN, RES_FRMATR_END - 1, - RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER>); + RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER> + aSet(rPaM.GetDoc().GetAttrPool()); + SwUnoCursorHelper::GetCursorAttr(rPaM, aSet); rPropSet.getPropertyValue(*pEntry, aSet, aAny); diff --git a/sw/source/core/unocore/unoport.cxx b/sw/source/core/unocore/unoport.cxx index 7431ffbc06a3..fea1e27749ef 100644 --- a/sw/source/core/unocore/unoport.cxx +++ b/sw/source/core/unocore/unoport.cxx @@ -356,12 +356,10 @@ void SwXTextPortion::GetPropertyValue( { if(!pSet) { - pSet = std::make_unique<SfxItemSet>( - pUnoCursor->GetDoc().GetAttrPool(), - svl::Items< + pSet = std::make_unique<SfxItemSetFixed< RES_CHRATR_BEGIN, RES_FRMATR_END - 1, RES_UNKNOWNATR_CONTAINER, - RES_UNKNOWNATR_CONTAINER>); + RES_UNKNOWNATR_CONTAINER>>(pUnoCursor->GetDoc().GetAttrPool()); 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 52853bf6448d..116524f89822 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -350,14 +350,13 @@ SwXTextSection::attach(const uno::Reference< text::XTextRange > & xTextRange) aSect.SetProtectFlag(m_pImpl->m_pProps->m_bProtect); aSect.SetEditInReadonlyFlag(m_pImpl->m_pProps->m_bEditInReadonly); - SfxItemSet aSet( - pDoc->GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_LR_SPACE, RES_LR_SPACE, RES_BACKGROUND, RES_BACKGROUND, RES_COL, RES_COL, RES_FTN_AT_TXTEND, RES_FRAMEDIR, - RES_UNKNOWNATR_CONTAINER,RES_UNKNOWNATR_CONTAINER>); + RES_UNKNOWNATR_CONTAINER,RES_UNKNOWNATR_CONTAINER> + aSet(pDoc->GetAttrPool()); if (m_pImpl->m_pProps->m_pBrushItem) { aSet.Put(*m_pImpl->m_pProps->m_pBrushItem); diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index a7ab270c6eb3..a0de46793064 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -2671,7 +2671,7 @@ void SAL_CALL SwXStyle::setPropertiesToDefault(const uno::Sequence<OUString>& aP { // SwDoc* pDoc = pTargetFormat->GetDoc(); - SfxItemSet aSet(pDoc->GetAttrPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>); + SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> aSet(pDoc->GetAttrPool()); aSet.SetParent(&pTargetFormat->GetAttrSet()); aSet.ClearItem(XATTR_FILLBMP_STRETCH); @@ -2933,8 +2933,8 @@ void SwXPageStyle::SetPropertyValues_Impl(const uno::Sequence<OUString>& rProper else if(pEntry->nWID == SID_ATTR_PAGE_ON && rValues[nProp].get<bool>()) { // Header/footer gets switched on, create defaults and the needed SfxSetItem - SfxItemSet aTempSet(*aBaseImpl.GetItemSet().GetPool(), - svl::Items<RES_FRMATR_BEGIN,RES_FRMATR_END - 1, // [82 + SfxItemSetFixed + <RES_FRMATR_BEGIN,RES_FRMATR_END - 1, // [82 // FillAttribute support XATTR_FILL_FIRST, XATTR_FILL_LAST, // [1014 @@ -2942,7 +2942,8 @@ 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>); + SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST> + aTempSet(*aBaseImpl.GetItemSet().GetPool()); // set correct parent to get the XFILL_NONE FillStyle as needed aTempSet.SetParent(&GetDoc()->GetDfltFrameFormat()->GetAttrSet()); @@ -3814,7 +3815,7 @@ SwAutoStylesEnumImpl::SwAutoStylesEnumImpl( SwDoc& rInitDoc, IStyleAccess::SwAut std::pair< sal_uInt16, text::RubyAdjust > aPair( pRubyItem->GetPosition(), pRubyItem->GetAdjustment() ); if ( aRubyMap.insert( aPair ).second ) { - auto pItemSet = std::make_shared<SfxItemSet>( rAttrPool, svl::Items<RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY> ); + auto pItemSet = std::make_shared<SfxItemSetFixed<RES_TXTATR_CJK_RUBY, RES_TXTATR_CJK_RUBY>>( rAttrPool ); pItemSet->Put( *pRubyItem ); mAutoStyles.push_back( pItemSet ); } diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index c0048eff38e1..5c8f9ae31ba8 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -704,7 +704,7 @@ void sw_setValue( SwXCell &rCell, double nVal ) SwDoc* pDoc = rCell.GetDoc(); UnoActionContext aAction(pDoc); SwFrameFormat* pBoxFormat = rCell.m_pBox->ClaimFrameFormat(); - SfxItemSet aSet(pDoc->GetAttrPool(), svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE>); + SfxItemSetFixed<RES_BOXATR_FORMAT, RES_BOXATR_VALUE> aSet(pDoc->GetAttrPool()); const SfxPoolItem* pItem; //!! do we need to set a new number format? Yes, if @@ -862,7 +862,7 @@ void SwXCell::setFormula(const OUString& rFormula) SwTableBoxFormula aFormula( sFormula ); SwDoc* pMyDoc = GetDoc(); UnoActionContext aAction(pMyDoc); - SfxItemSet aSet(pMyDoc->GetAttrPool(), svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_FORMULA>); + SfxItemSetFixed<RES_BOXATR_FORMAT, RES_BOXATR_FORMULA> aSet(pMyDoc->GetAttrPool()); const SfxPoolItem* pItem; SwFrameFormat* pBoxFormat = m_pBox->GetFrameFormat(); if(SfxItemState::SET != pBoxFormat->GetAttrSet().GetItemState(RES_BOXATR_FORMAT, true, &pItem) @@ -1719,9 +1719,10 @@ uno::Any SwXTextTableCursor::getPropertyValue(const OUString& rPropertyName) break; default: { - SfxItemSet aSet(rTableCursor.GetDoc().GetAttrPool(), - svl::Items<RES_CHRATR_BEGIN, RES_FRMATR_END-1, - RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER>); + SfxItemSetFixed + <RES_CHRATR_BEGIN, RES_FRMATR_END-1, + RES_UNKNOWNATR_CONTAINER, RES_UNKNOWNATR_CONTAINER> + aSet(rTableCursor.GetDoc().GetAttrPool()); SwUnoCursorHelper::GetCursorAttr(rTableCursor.GetSelRing(), aSet); m_pPropSet->getPropertyValue(*pEntry, aSet, aResult); } @@ -1803,15 +1804,14 @@ void SwTableProperties_Impl::AddItemToSet(SfxItemSet& rSet, } void SwTableProperties_Impl::ApplyTableAttr(const SwTable& rTable, SwDoc& rDoc) { - SfxItemSet aSet( - rDoc.GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_FRM_SIZE, RES_BREAK, RES_HORI_ORIENT, RES_HORI_ORIENT, RES_BACKGROUND, RES_BACKGROUND, RES_SHADOW, RES_SHADOW, RES_KEEP, RES_KEEP, - RES_LAYOUT_SPLIT, RES_LAYOUT_SPLIT>); + RES_LAYOUT_SPLIT, RES_LAYOUT_SPLIT> + aSet(rDoc.GetAttrPool()); const uno::Any* pRepHead; const SwFrameFormat &rFrameFormat = *rTable.GetFrameFormat(); if(GetProperty(FN_TABLE_HEADLINE_REPEAT, 0xff, pRepHead )) @@ -2593,9 +2593,9 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName, const uno::An UnoActionRemoveContext aRemoveContext(rCursor); rCursor.MakeBoxSels(); - SfxItemSet aSet(pDoc->GetAttrPool(), - svl::Items<RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>); + SfxItemSetFixed<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> + aSet(pDoc->GetAttrPool()); SvxBoxItem aBox( RES_BOX ); SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); @@ -2792,9 +2792,9 @@ uno::Any SwXTextTable::getPropertyValue(const OUString& rPropertyName) UnoActionRemoveContext aRemoveContext(rCursor); rCursor.MakeBoxSels(); - SfxItemSet aSet(pDoc->GetAttrPool(), - svl::Items<RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>); + SfxItemSetFixed<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> + aSet(pDoc->GetAttrPool()); aSet.Put(SvxBoxInfoItem( SID_ATTR_BORDER_INNER )); SwDoc::GetTabBorders(rCursor, aSet); const SvxBoxInfoItem& rBoxInfoItem = aSet.Get(SID_ATTR_BORDER_INNER); @@ -3373,9 +3373,9 @@ SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::Any& aV break; case RES_BOX : { - SfxItemSet aSet(rDoc.GetAttrPool(), - svl::Items<RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>); + SfxItemSetFixed<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> + aSet(rDoc.GetAttrPool()); SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::ALL, false); SvxBoxInfoItemValidFlags nValid = SvxBoxInfoItemValidFlags::NONE; @@ -3481,9 +3481,9 @@ uno::Any SAL_CALL SwXCellRange::getPropertyValue(const OUString& rPropertyName) case RES_BOX : { SwDoc& rDoc = m_pImpl->m_pTableCursor->GetDoc(); - SfxItemSet aSet(rDoc.GetAttrPool(), - svl::Items<RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>); + SfxItemSetFixed<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> + aSet(rDoc.GetAttrPool()); aSet.Put(SvxBoxInfoItem( SID_ATTR_BORDER_INNER )); SwDoc::GetTabBorders(*m_pImpl->m_pTableCursor, aSet); const SvxBoxItem& rBoxItem = aSet.Get(RES_BOX); @@ -3521,12 +3521,11 @@ uno::Any SAL_CALL SwXCellRange::getPropertyValue(const OUString& rPropertyName) break; default: { - SfxItemSet aSet( - m_pImpl->m_pTableCursor->GetDoc().GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_CHRATR_BEGIN, RES_FRMATR_END - 1, RES_UNKNOWNATR_CONTAINER, - RES_UNKNOWNATR_CONTAINER>); + RES_UNKNOWNATR_CONTAINER> + aSet(m_pImpl->m_pTableCursor->GetDoc().GetAttrPool()); // first look at the attributes of the cursor SwUnoTableCursor *const pCursor = dynamic_cast<SwUnoTableCursor*>(&(*m_pImpl->m_pTableCursor)); diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index 3d551ae475a1..c79946ea44db 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -660,7 +660,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( m_rDoc.GetAttrPool(), svl::Items<RES_PAGEDESC, RES_BREAK> ); + SfxItemSetFixed<RES_PAGEDESC, RES_BREAK> aBkSet( m_rDoc.GetAttrPool() ); SwContentNode* pNd = nullptr; if( !pTOXAttr->HadBreakItem() || !pTOXAttr->HadPageDescItem() ) { diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index ff3817eeeb00..6618a5479165 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -1203,15 +1203,14 @@ bool SwHTMLWriter::HasScriptDependentItems( const SfxItemSet& rItemSet, { //sequence of (start, end) property ranges we want to //query - SfxItemSet aTstItemSet( - *pDCCharFormat->GetAttrSet().GetPool(), - svl::Items< + SfxItemSetFixed< 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_CTL_FONT, - RES_CHRATR_CTL_POSTURE, RES_CHRATR_CTL_WEIGHT>); + RES_CHRATR_CTL_POSTURE, RES_CHRATR_CTL_WEIGHT> + aTstItemSet(*pDCCharFormat->GetAttrSet().GetPool()); aTstItemSet.Set( pDCCharFormat->GetAttrSet() ); return HasScriptDependentItems( aTstItemSet, false ); } @@ -1254,11 +1253,11 @@ static bool OutCSS1Rule( SwHTMLWriter& rHTMLWrt, const OUString& rSelector, //sequence of (start, end) property ranges we want to //query - SfxItemSet aScriptItemSet( *rItemSet.GetPool(), - svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONTSIZE, + SfxItemSetFixed<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> ); + RES_CHRATR_CJK_FONT, RES_CHRATR_CTL_WEIGHT> + aScriptItemSet( *rItemSet.GetPool() ); aScriptItemSet.Put( rItemSet ); OUString aNewSelector = aSelector + ".western" + aPseudo; @@ -1354,11 +1353,11 @@ static void OutCSS1DropCapRule( OutCSS1_SwFormatDropAttrs( rHTMLWrt, rDrop ); } - SfxItemSet aScriptItemSet( rHTMLWrt.m_pDoc->GetAttrPool(), - 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> ); + SfxItemSetFixed<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> + aScriptItemSet( rHTMLWrt.m_pDoc->GetAttrPool() ); if( pDCCharFormat ) aScriptItemSet.Set( pDCCharFormat->GetAttrSet() ); @@ -1667,8 +1666,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(), - svl::Items<RES_LR_SPACE, RES_UL_SPACE> ); + SfxItemSetFixed<RES_LR_SPACE, RES_UL_SPACE> aItemSet( *rMaster.GetAttrSet().GetPool() ); aItemSet.Set( rMaster.GetAttrSet() ); if( pRefPageDesc ) diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 938ea1656473..ae2e4bb69611 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -1847,8 +1847,7 @@ 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(), svl::Items<RES_CHRATR_BEGIN, - RES_CHRATR_END> ); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END> aItemSet( *rFormatItemSet.GetPool() ); SwHTMLWriter::GetEEAttrsFromDrwObj( aItemSet, pTextObj ); bool bOutStylesOld = m_bOutStyles; m_bOutStyles = false; diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx index 4d4f23ad3085..218cb300722a 100644 --- a/sw/source/filter/html/htmlctxt.cxx +++ b/sw/source/filter/html/htmlctxt.cxx @@ -476,8 +476,7 @@ bool SwHTMLParser::DoPositioning( SfxItemSet &rItemSet, // - there's a given width if( SwCSS1Parser::MayBePositioned( rPropInfo ) ) { - SfxItemSet aFrameItemSet( m_xDoc->GetAttrPool(), - svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1> aFrameItemSet( m_xDoc->GetAttrPool() ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs(aFrameItemSet ); @@ -767,8 +766,8 @@ void SwHTMLParser::SplitPREListingXMP( HTMLAttrContext *pCntxt ) SfxItemSet *HTMLAttrContext::GetFrameItemSet( SwDoc *pCreateDoc ) { if( !m_pFrameItemSet && pCreateDoc ) - m_pFrameItemSet = std::make_unique<SfxItemSet>( pCreateDoc->GetAttrPool(), - svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1> ); + m_pFrameItemSet = std::make_unique<SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1>> + ( pCreateDoc->GetAttrPool() ); return m_pFrameItemSet.get(); } diff --git a/sw/source/filter/html/htmldrawreader.cxx b/sw/source/filter/html/htmldrawreader.cxx index 23f422844168..2839a2febe4d 100644 --- a/sw/source/filter/html/htmldrawreader.cxx +++ b/sw/source/filter/html/htmldrawreader.cxx @@ -82,8 +82,7 @@ void SwHTMLParser::InsertDrawObject( SdrObject* pNewDrawObj, // to the visible layer. pNewDrawObj->SetLayer( m_xDoc->getIDocumentDrawModelAccess().GetInvisibleHeavenId() ); - SfxItemSet aFrameSet( m_xDoc->GetAttrPool(), - svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1> aFrameSet( m_xDoc->GetAttrPool() ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs( aFrameSet ); @@ -368,11 +367,11 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable ) eAniDir = SdrTextAniDirection::Right; // re set the attributes needed for scrolling - static WhichRangesContainer const aWhichMap(svl::Items< + SfxItemSetFixed< XATTR_FILL_FIRST, XATTR_FILL_LAST, SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, - EE_CHAR_START, EE_CHAR_END>); - SfxItemSet aItemSet( pModel->GetItemPool(), aWhichMap ); + EE_CHAR_START, EE_CHAR_END> + aItemSet( pModel->GetItemPool() ); aItemSet.Put( makeSdrTextAutoGrowWidthItem( false ) ); aItemSet.Put( makeSdrTextAutoGrowHeightItem( true ) ); aItemSet.Put( SdrTextAniKindItem( eAniKind ) ); diff --git a/sw/source/filter/html/htmlfldw.cxx b/sw/source/filter/html/htmlfldw.cxx index bc5073c11d38..dbe4fe8d9092 100644 --- a/sw/source/filter/html/htmlfldw.cxx +++ b/sw/source/filter/html/htmlfldw.cxx @@ -333,11 +333,11 @@ static Writer& OutHTML_SwField( Writer& rWrt, const SwField* pField, { //sequence of (start, end) property ranges we want to //query - SfxItemSet aScriptItemSet( rWrt.m_pDoc->GetAttrPool(), - 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> ); + SfxItemSetFixed<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> + aScriptItemSet( rWrt.m_pDoc->GetAttrPool() ); rTextNd.GetParaAttr(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 5cc282bf69b0..6c7d9003ceb3 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -2038,8 +2038,7 @@ 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(), svl::Items<RES_CHRATR_BEGIN, - RES_CHRATR_END> ); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END> aItemSet( *rFormatItemSet.GetPool() ); SwHTMLWriter::GetEEAttrsFromDrwObj( aItemSet, &rSdrObj ); 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 cd13fe78819f..3e30352f326b 100644 --- a/sw/source/filter/html/htmlforw.cxx +++ b/sw/source/filter/html/htmlforw.cxx @@ -1043,8 +1043,7 @@ Writer& OutHTML_DrawFrameFormatAsControl( Writer& rWrt, bool bEdit = TAG_TEXTAREA == eTag || TYPE_FILE == eType || TYPE_TEXT == eType; - SfxItemSet aItemSet( rHTMLWrt.m_pDoc->GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, - RES_CHRATR_END> ); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END> aItemSet( rHTMLWrt.m_pDoc->GetAttrPool() ); 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 be5677999462..592475dfa3cd 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -532,8 +532,7 @@ IMAGE_SETEVENT: if( HasStyleOptions( aStyle, aId, aClass ) ) ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo ); - SfxItemSet aFrameSet( m_xDoc->GetAttrPool(), - svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1> aFrameSet( m_xDoc->GetAttrPool() ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs( aFrameSet ); diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 3bdf379e06f0..cc10834228e9 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -622,8 +622,7 @@ bool SwHTMLParser::InsertEmbed() } } - SfxItemSet aFrameSet( m_xDoc->GetAttrPool(), - svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1> aFrameSet( m_xDoc->GetAttrPool() ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs( aFrameSet ); @@ -1132,8 +1131,7 @@ void SwHTMLParser::InsertFloatingFrame() ParseStyleOptions( aStyle, aId, aClass, aItemSet, aPropInfo ); // fetch the ItemSet - SfxItemSet aFrameSet( m_xDoc->GetAttrPool(), - svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1> aFrameSet( m_xDoc->GetAttrPool() ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs( aFrameSet ); diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index cafd7718cdb6..82f02d613587 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -324,8 +324,7 @@ void SwHTMLParser::NewDivision( HtmlTokenId nToken ) aSection.SetProtectFlag(true); } - SfxItemSet aFrameItemSet( m_xDoc->GetAttrPool(), - svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1> aFrameItemSet( m_xDoc->GetAttrPool() ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs(aFrameItemSet ); @@ -628,8 +627,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss ) bool bPositioned = false; if( bInCntnr || SwCSS1Parser::MayBePositioned( aPropInfo, true ) ) { - SfxItemSet aFrameItemSet( m_xDoc->GetAttrPool(), - svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1> aFrameItemSet( m_xDoc->GetAttrPool() ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs(aFrameItemSet ); @@ -700,8 +698,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss ) OUString aName( m_xDoc->GetUniqueSectionName( !aId.isEmpty() ? &aId : nullptr ) ); SwSectionData aSection( SectionType::Content, aName ); - SfxItemSet aFrameItemSet( m_xDoc->GetAttrPool(), - svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1> aFrameItemSet( m_xDoc->GetAttrPool() ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs(aFrameItemSet ); diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 5b81d63bf145..cbba52c6f119 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -1403,8 +1403,8 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox, { bool bLock = pFrameFormat->GetDoc()->GetNumberFormatter() ->IsTextFormat( nNumFormat ); - SfxItemSet aItemSet( *pFrameFormat->GetAttrSet().GetPool(), - svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_VALUE> ); + SfxItemSetFixed<RES_BOXATR_FORMAT, RES_BOXATR_VALUE> + aItemSet( *pFrameFormat->GetAttrSet().GetPool() ); SvxAdjust eAdjust = SvxAdjust::End; SwContentNode *pCNd = nullptr; if( !bLock ) @@ -2691,8 +2691,7 @@ SvxBrushItem* SwHTMLParser::CreateBrushItem( const Color *pColor, if( !rStyle.isEmpty() || !rId.isEmpty() || !rClass.isEmpty() ) { - SfxItemSet aItemSet( m_xDoc->GetAttrPool(), svl::Items<RES_BACKGROUND, - RES_BACKGROUND> ); + SfxItemSetFixed<RES_BACKGROUND, RES_BACKGROUND> aItemSet( m_xDoc->GetAttrPool() ); SvxCSS1PropertyInfo aPropInfo; if( !rClass.isEmpty() ) @@ -3212,7 +3211,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, // the table has no content yet, this means the actual table needs // to be created first - static const WhichRangesContainer aWhichIds(svl::Items< + SfxItemSetFixed< RES_PARATR_SPLIT, RES_PARATR_SPLIT, RES_PAGEDESC, RES_PAGEDESC, RES_BREAK, RES_BREAK, @@ -3220,9 +3219,7 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, RES_KEEP, RES_KEEP, RES_LAYOUT_SPLIT, RES_LAYOUT_SPLIT, RES_FRAMEDIR, RES_FRAMEDIR - >); - - SfxItemSet aItemSet( m_xDoc->GetAttrPool(), aWhichIds ); + > aItemSet( m_xDoc->GetAttrPool() ); SvxCSS1PropertyInfo aPropInfo; bool bStyleParsed = ParseStyleOptions( pCurTable->GetStyle(), @@ -3394,8 +3391,8 @@ void SwHTMLParser::BuildTableCell( HTMLTable *pCurTable, bool bReadOptions, { // the table should be put in a text frame - SfxItemSet aFrameSet( m_xDoc->GetAttrPool(), - svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1> + aFrameSet( m_xDoc->GetAttrPool() ); if( !pCurTable->IsNewDoc() ) Reader::ResetFrameFormatAttrs( aFrameSet ); diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index df8abc1e65d9..25627a3f2d82 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -2972,7 +2972,7 @@ void SwHTMLParser::SetAttr_( bool bChkEnd, bool bBeforeTable, case RES_BACKGROUND: { const SvxBrushItem& rBrush = static_cast< SvxBrushItem& >(*pAttr->m_pItem); - SfxItemSet aNewSet(m_xDoc->GetAttrPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>); + SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> aNewSet(m_xDoc->GetAttrPool()); setSvxBrushItemAsFillAttributesToTargetSet(rBrush, aNewSet); m_xDoc->getIDocumentContentOperations().InsertItemSet(aAttrPam, aNewSet, SetAttrMode::DONTREPLACE); @@ -4943,8 +4943,7 @@ void SwHTMLParser::InsertSpacer() // create an empty text frame // fetch the ItemSet - SfxItemSet aFrameSet( m_xDoc->GetAttrPool(), - svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1> aFrameSet( m_xDoc->GetAttrPool() ); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs( aFrameSet ); diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 68bd7654f5f9..43c3d9ba3c53 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -412,8 +412,7 @@ void SwWW8AttrIter::OutAttr(sal_Int32 nSwPos, bool bWriteCombChars, bool bPostpo const SvxFontItem *pFont = &rParentFont; const SfxPoolItem *pGrabBag = nullptr; - SfxItemSet aExportSet(*rNd.GetSwAttrSet().GetPool(), - svl::Items<RES_CHRATR_BEGIN, RES_TXTATR_END - 1>); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_TXTATR_END - 1> aExportSet(*rNd.GetSwAttrSet().GetPool()); //The hard formatting properties that affect the entire paragraph if (rNd.HasSwAttrSet()) @@ -2608,7 +2607,7 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) { // Allow MSO to emulate LO footnote text starting at left margin - only meaningful with hanging indent sal_Int32 nFirstLineIndent=0; - SfxItemSet aSet( m_rDoc.GetAttrPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE> ); + SfxItemSetFixed<RES_LR_SPACE, RES_LR_SPACE> aSet( m_rDoc.GetAttrPool() ); const SwTextNode* pTextNode( rNode.GetTextNode() ); if ( pTextNode && pTextNode->GetAttr(aSet) ) { @@ -3147,7 +3146,7 @@ void MSWordExportBase::OutputTextNode( 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_rDoc.GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, RES_TXTATR_END>); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_TXTATR_END> aParagraphMarkerProperties(m_rDoc.GetAttrPool()); bool bCharFormatOnly = true; SwFormatAutoFormat const& rListAutoFormat(static_cast<SwFormatAutoFormat const&>(rNode.GetAttr(RES_PARATR_LIST_AUTOFMT))); diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx index aac2b0595f63..ae67e973c98a 100644 --- a/sw/source/filter/ww8/wrtw8num.cxx +++ b/sw/source/filter/ww8/wrtw8num.cxx @@ -535,8 +535,7 @@ void MSWordExportBase::NumberingLevel( const SfxItemSet* pOutSet = nullptr; // cbGrpprlChpx - SfxItemSet aSet( m_rDoc.GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, - RES_CHRATR_END> ); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END> aSet( m_rDoc.GetAttrPool() ); if (rFormat.GetCharFormat() || bWriteBullet) { if (bWriteBullet) diff --git a/sw/source/filter/ww8/wrtw8sty.cxx b/sw/source/filter/ww8/wrtw8sty.cxx index f181e5b83571..3e8f9ec79a11 100644 --- a/sw/source/filter/ww8/wrtw8sty.cxx +++ b/sw/source/filter/ww8/wrtw8sty.cxx @@ -1088,7 +1088,7 @@ sal_uInt16 MSWordSections::NumberOfColumns( const SwDoc &rDoc, const WW8_SepInfo pPd = &rDoc.GetPageDesc( 0 ); const SfxItemSet &rSet = pPd->GetMaster().GetAttrSet(); - SfxItemSet aSet( *rSet.GetPool(), svl::Items<RES_COL, RES_COL> ); + SfxItemSetFixed<RES_COL, RES_COL> aSet( *rSet.GetPool() ); 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 7db1fb50386e..0ba034aa6564 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2074,7 +2074,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(), svl::Items<RES_CHRATR_ROTATE, RES_CHRATR_ROTATE>); + SfxItemSetFixed<RES_CHRATR_ROTATE, RES_CHRATR_ROTATE> aCoreSet(rDoc.GetAttrPool()); static_cast<const SwTextNode*>(pCNd)->GetParaAttr(aCoreSet, 0, static_cast<const SwTextNode*>(pCNd)->GetText().getLength()); const SfxPoolItem * pRotItem; diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index de8dbc3f0468..3f1d188fc09c 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -894,9 +894,8 @@ void MSWordExportBase::OutputFormat( const SwFormat& rFormat, bool bPapFormat, b { const SwFrameFormat &rFrameFormat = m_pParentFrame->GetFrameFormat(); - SfxItemSet aSet(m_rDoc.GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, - RES_FRMATR_END-1, - XATTR_FILL_FIRST, XATTR_FILL_LAST>); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1, + XATTR_FILL_FIRST, XATTR_FILL_LAST> aSet(m_rDoc.GetAttrPool()); aSet.Set(rFrameFormat.GetAttrSet()); // Fly as character becomes a paragraph bound @@ -3493,8 +3492,7 @@ void WW8Export::WriteFootnoteBegin( const SwFormatFootnote& rFootnote, ww::bytes { std::unique_ptr<ww::bytes> pOld = std::move(pO); pO = std::move(pOwnOutArr); - SfxItemSet aSet( m_rDoc.GetAttrPool(), svl::Items<RES_CHRATR_FONT, - RES_CHRATR_FONT> ); + SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONT> aSet( m_rDoc.GetAttrPool() ); pCFormat = pInfo->GetCharFormat( m_rDoc ); diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 83a5a772973a..6a1d32d4ee21 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -1168,8 +1168,8 @@ void SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj, { if( pFlyFormat && pRecord ) { - SfxItemSet aFlySet( m_rDoc.GetAttrPool(), - svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1, XATTR_START, XATTR_END> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1, XATTR_START, XATTR_END> + aFlySet( m_rDoc.GetAttrPool() ); tools::Rectangle aInnerDist( pRecord->nDxTextLeft, pRecord->nDyTextTop, @@ -2620,7 +2620,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( tools::Long nGrafAnchorCp ) // when in a header or footer word appears to treat all elements as wrap through // determine wrapping mode - SfxItemSet aFlySet(m_rDoc.GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1, XATTR_START, XATTR_END>); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1, XATTR_START, XATTR_END> aFlySet(m_rDoc.GetAttrPool()); Reader::ResetFrameFormatAttrs(aFlySet); // tdf#122425: Explicitly remove borders and spacing css::text::WrapTextMode eSurround = css::text::WrapTextMode_PARALLEL; bool bContour = false; @@ -2955,8 +2955,8 @@ SwFrameFormat* SwWW8ImplReader::MungeTextIntoDrawBox(SvxMSDffImportRec& rRecord, else { // use ww8-default border distance - SfxItemSet aItemSet(m_pDrawModel->GetItemPool(), - svl::Items<SDRATTR_TEXT_LEFTDIST, SDRATTR_TEXT_LOWERDIST>); + SfxItemSetFixed<SDRATTR_TEXT_LEFTDIST, SDRATTR_TEXT_LOWERDIST> + aItemSet(m_pDrawModel->GetItemPool()); aItemSet.Put(makeSdrTextLeftDistItem(rRecord.nDxTextLeft)); aItemSet.Put(makeSdrTextRightDistItem(rRecord.nDxTextRight)); aItemSet.Put(makeSdrTextUpperDistItem(rRecord.nDyTextTop)); @@ -3108,7 +3108,7 @@ SwFlyFrameFormat* SwWW8ImplReader::ImportReplaceableDrawables(SdrObject* &rpObje rFlySet.Put(SwFormatFrameSize(SwFrameSize::Fixed, nWidthTw, nHeightTw)); - SfxItemSet aGrSet(m_rDoc.GetAttrPool(), svl::Items<RES_GRFATR_BEGIN, RES_GRFATR_END-1>); + SfxItemSetFixed<RES_GRFATR_BEGIN, RES_GRFATR_END-1> aGrSet(m_rDoc.GetAttrPool()); // Note that the escher inner distance only seems to be honoured in // word for textboxes, not for graphics and ole objects. diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index 91b4d3e882c1..d60dec44f25b 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -555,8 +555,7 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj const * pTextObj, if (pObject) { // for the frame - SfxItemSet aAttrSet( m_rDoc.GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, - RES_FRMATR_END-1> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1> aAttrSet( m_rDoc.GetAttrPool() ); SvxMSDffImportRec const*const pRecord = (1 == aData.size()) ? aData.begin()->get() : nullptr; @@ -621,8 +620,7 @@ SwFrameFormat* SwWW8ImplReader::ImportGraf(SdrTextObj const * pTextObj, } // for the graphic - SfxItemSet aGrSet( m_rDoc.GetAttrPool(), svl::Items<RES_GRFATR_BEGIN, - RES_GRFATR_END-1> ); + SfxItemSetFixed<RES_GRFATR_BEGIN, RES_GRFATR_END-1> aGrSet( m_rDoc.GetAttrPool() ); 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 4045a3a5eda9..3f5384447958 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -2200,7 +2200,7 @@ void SwWW8ImplReader::Read_HdFtTextAsHackedFrame(WW8_CP nStart, WW8_CP nLen, m_pPaM->GetPoint()->nContent.Assign(m_pPaM->GetContentNode(), 0); // tdf#122425: Explicitly remove borders and spacing - SfxItemSet aFlySet(m_rDoc.GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END - 1>); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END - 1> aFlySet(m_rDoc.GetAttrPool()); Reader::ResetFrameFormatAttrs(aFlySet); SwFlyFrameFormat* pFrame @@ -4365,8 +4365,8 @@ void wwSectionManager::SetSegmentToPageDesc(const wwSection &rSection, // Only handle shape if it is a background shape if (aData.begin()->get()->nFlags & ShapeFlag::Background) { - SfxItemSet aSet(rFormat.GetDoc()->GetAttrPool(), - svl::Items<RES_BACKGROUND, RES_BACKGROUND,XATTR_START, XATTR_END>); + SfxItemSetFixed<RES_BACKGROUND, RES_BACKGROUND,XATTR_START, XATTR_END> + aSet(rFormat.GetDoc()->GetAttrPool()); mrReader.MatchSdrItemsIntoFlySet(pObject, aSet, mso_lineSimple, mso_lineSolid, mso_sptRectangle, aRect); if ( aSet.HasItem(RES_BACKGROUND) ) diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index c3a537192f8c..6f7198009f51 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -287,7 +287,7 @@ sal_uInt16 SwWW8ImplReader::End_Footnote() { // Allow MSO to emulate LO footnote text starting at left margin - only meaningful with hanging indent sal_Int32 nFirstLineIndent=0; - SfxItemSet aSet( m_rDoc.GetAttrPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE> ); + SfxItemSetFixed<RES_LR_SPACE, RES_LR_SPACE> aSet( m_rDoc.GetAttrPool() ); if ( pTNd->GetAttr(aSet) ) { const SvxLRSpaceItem* pLRSpace = aSet.GetItem<SvxLRSpaceItem>(RES_LR_SPACE); @@ -3479,8 +3479,7 @@ bool SwWW8ImplReader::StartTable(WW8_CP nStartCp) && !m_aTableStack.empty() && !InEqualApo(nNewInTable) ) { m_xTableDesc->m_pParentPos = new SwPosition(*m_pPaM->GetPoint()); - SfxItemSet aItemSet(m_rDoc.GetAttrPool(), - svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1>); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1> aItemSet(m_rDoc.GetAttrPool()); // #i33818# - anchor the Writer fly frame for the nested table at-character. // #i45301# SwFormatAnchor aAnchor( eAnchor ); diff --git a/sw/source/filter/ww8/ww8par2.hxx b/sw/source/filter/ww8/ww8par2.hxx index ac35b4813b8f..cb5029c63277 100644 --- a/sw/source/filter/ww8/ww8par2.hxx +++ b/sw/source/filter/ww8/ww8par2.hxx @@ -39,7 +39,7 @@ private: WW8DupProperties(const WW8DupProperties&) = delete; WW8DupProperties& operator=(const WW8DupProperties&) = delete; SwWW8FltControlStack* pCtrlStck; - SfxItemSet aChrSet,aParSet; + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END - 1> aChrSet,aParSet; }; struct WW8SwFlyPara @@ -132,7 +132,7 @@ public: SprmResult HasParaSprm(sal_uInt16 nId) const; }; -class WW8FlySet: public SfxItemSet +class WW8FlySet: public SfxItemSetFixed<RES_FRMATR_BEGIN,RES_FRMATR_END-1> { private: const WW8FlySet& operator=(const WW8FlySet&) = delete; diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index efea3b8f1fd7..52d25bdeae06 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -837,7 +837,7 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet } // create new Itemset for character attributes - rpItemSet.reset(new SfxItemSet( rDoc.GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1>)); + rpItemSet.reset(new SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END - 1>( rDoc.GetAttrPool() )); // Set Reader-ItemSet-Pointer to the newly created set rReader.SetCurrentItemSet(std::move(rpItemSet)); @@ -1865,8 +1865,7 @@ void SwWW8ImplReader::RegisterNumFormatOnTextNode(sal_uInt16 nCurrentLFO, if (!bApplyListLevelIndentDirectlyAtPara) return; - std::unique_ptr<SfxItemSet> xListIndent(new SfxItemSet(m_rDoc.GetAttrPool(), svl::Items<RES_LR_SPACE, - RES_LR_SPACE>)); + auto xListIndent = std::make_unique<SfxItemSet>(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/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 57758aa15f7f..acdcc6732b04 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -2458,8 +2458,7 @@ 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(), svl::Items<RES_FRMATR_BEGIN, - RES_FRMATR_END-1> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1> aFlySet( m_rDoc.GetAttrPool() ); aFlySet.Put( SwFormatAnchor( RndStdIds::FLY_AS_CHAR ) ); aFlySet.Put( SwFormatVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME )); m_pFlyFormatOfJustInsertedGraphic = @@ -3451,7 +3450,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(), svl::Items<RES_COL, RES_COL> ); + SfxItemSetFixed<RES_COL, RES_COL> aSet( m_rDoc.GetAttrPool() ); 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 5328487e1313..e6105c2ff5ad 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -2148,12 +2148,12 @@ void WW8SwFlyPara::BoxUpWidth( tools::Long nInWidth ) nNewNetWidth = nInWidth; }; -// The class WW8FlySet is derived from SfxItemSet and does not +// The class WW8FlySet is derived from SfxItemSetFixed and does not // provide more, but is easier to handle for me. // WW8FlySet-ctor for Apos and graphics Apos WW8FlySet::WW8FlySet(SwWW8ImplReader& rReader, const WW8FlyPara* pFW, const WW8SwFlyPara* pFS, bool bGraf) - : SfxItemSet(rReader.m_rDoc.GetAttrPool(),svl::Items<RES_FRMATR_BEGIN,RES_FRMATR_END-1>) + : SfxItemSetFixed(rReader.m_rDoc.GetAttrPool()) { Reader::ResetFrameFormatAttrs(*this); // remove distance/border // position @@ -2208,7 +2208,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, tools::Long nWidth, tools::Long nHeight ) - : SfxItemSet(rReader.m_rDoc.GetAttrPool(),svl::Items<RES_FRMATR_BEGIN,RES_FRMATR_END-1>) + : SfxItemSetFixed<RES_FRMATR_BEGIN,RES_FRMATR_END-1>(rReader.m_rDoc.GetAttrPool()) { Init(rReader, pPaM); @@ -2260,8 +2260,8 @@ void WW8FlySet::Init(const SwWW8ImplReader& rReader, const SwPaM* pPaM) WW8DupProperties::WW8DupProperties(SwDoc &rDoc, SwWW8FltControlStack *pStack) : pCtrlStck(pStack), - aChrSet(rDoc.GetAttrPool(), svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1> ), - aParSet(rDoc.GetAttrPool(), svl::Items<RES_PARATR_BEGIN, RES_PARATR_END - 1> ) + aChrSet(rDoc.GetAttrPool()), + aParSet(rDoc.GetAttrPool()) { //Close any open character properties and duplicate them inside the //first table cell diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index f73ef35be731..c4c28b37a40c 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -238,8 +238,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( SAL_WARN_IF(!pTextCursor, "sw.uno", "SwXTextCursor missing"); SwDoc *pDoc = SwImport::GetDocFromXMLImport( rImport ); - SfxItemSet aItemSet( pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, - RES_FRMATR_END> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END> aItemSet( pDoc->GetAttrPool() ); Size aTwipSize( 0, 0 ); tools::Rectangle aVisArea( 0, 0, nWidth, nHeight ); lcl_putHeightAndWidth( aItemSet, nHeight, nWidth, @@ -549,8 +548,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOOoLink( OSL_ENSURE( pTextCursor, "SwXTextCursor missing" ); SwDoc *pDoc = SwImport::GetDocFromXMLImport( rImport ); - SfxItemSet aItemSet( pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, - RES_FRMATR_END> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END> aItemSet( pDoc->GetAttrPool() ); Size aTwipSize( 0, 0 ); lcl_putHeightAndWidth( aItemSet, nHeight, nWidth, &aTwipSize ); @@ -640,8 +638,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertApplet( OSL_ENSURE( pTextCursor, "SwXTextCursor missing" ); SwDoc *pDoc = pTextCursor->GetDoc(); - SfxItemSet aItemSet( pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, - RES_FRMATR_END> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END> aItemSet( pDoc->GetAttrPool() ); lcl_putHeightAndWidth( aItemSet, nHeight, nWidth); SwApplet_Impl aAppletImpl ( aItemSet ); @@ -685,8 +682,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertPlugin( OSL_ENSURE( pTextCursor, "SwXTextCursor missing" ); SwDoc *pDoc = pTextCursor->GetDoc(); - SfxItemSet aItemSet( pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, - RES_FRMATR_END> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END> aItemSet( pDoc->GetAttrPool() ); lcl_putHeightAndWidth( aItemSet, nHeight, nWidth); // We'll need a (valid) URL, or we need a MIME type. If we don't have @@ -765,8 +761,7 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertFloatingFra OSL_ENSURE( pTextCursor, "SwXTextCursor missing" ); SwDoc *pDoc = pTextCursor->GetDoc(); - SfxItemSet aItemSet( pDoc->GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, - RES_FRMATR_END> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END> aItemSet( pDoc->GetAttrPool() ); lcl_putHeightAndWidth( aItemSet, nHeight, nWidth); ScrollingMode eScrollMode = ScrollingMode::Auto; diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx index 5e66599ddb38..232b9f8154df 100644 --- a/sw/source/ui/chrdlg/pardlg.cxx +++ b/sw/source/ui/chrdlg/pardlg.cxx @@ -227,9 +227,9 @@ void SwParaDlg::PageCreated(const OString& rId, SfxTabPage& rPage) // demand, but could also be directly added from the DrawModel. else if (rId == "area") { - SfxItemSet aNew(*aSet.GetPool(), - svl::Items<SID_COLOR_TABLE, SID_PATTERN_LIST, - SID_OFFER_IMPORT, SID_OFFER_IMPORT>); + SfxItemSetFixed + <SID_COLOR_TABLE, SID_PATTERN_LIST, + SID_OFFER_IMPORT, SID_OFFER_IMPORT> aNew(*aSet.GetPool()); aNew.Put(*GetInputSetImpl()); diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index eb5da1804e48..30a3c4cac6e4 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -754,9 +754,9 @@ void SwStdFontTabPage::Reset( const SfxItemSet* rSet) } else { - auto pPrinterSet = std::make_unique<SfxItemSet>( *rSet->GetPool(), - svl::Items<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, - SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC> ); + auto pPrinterSet = std::make_unique<SfxItemSetFixed + <SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, + SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC>>( *rSet->GetPool() ); m_pPrt = VclPtr<SfxPrinter>::Create(std::move(pPrinterSet)); m_bDisposePrinter = true; } diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 8a47a783dbb7..041412a32dba 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -997,8 +997,7 @@ void SwInsertDBColAutoPilot::DataToDoc( const Sequence<Any>& rSelection, if( pSelection && pTableSet ) SetTabSet(); - SfxItemSet aTableSet( rSh.GetAttrPool(), svl::Items<RES_BOXATR_FORMAT, - RES_BOXATR_VALUE> ); + SfxItemSetFixed<RES_BOXATR_FORMAT, RES_BOXATR_VALUE> aTableSet( rSh.GetAttrPool() ); bool bIsAutoUpdateCells = rSh.IsAutoUpdateCells(); rSh.SetAutoUpdateCells( false ); diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index 1933fe91f6e7..d6db97fa36f7 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -255,12 +255,10 @@ SwFrameFormat* SwMailMergeLayoutPage::InsertAddressFrame( bool bExample) { // insert the address block and the greeting line - SfxItemSet aSet( - rShell.GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_FRM_SIZE, RES_FRM_SIZE, RES_SURROUND, RES_ANCHOR, - RES_BOX, RES_BOX> ); + RES_BOX, RES_BOX> aSet( rShell.GetAttrPool() ); aSet.Put(SwFormatAnchor(RndStdIds::FLY_AT_PAGE, 1)); if(bAlignLeft) aSet.Put(SwFormatHoriOrient( 0, text::HoriOrientation::NONE, text::RelOrientation::PAGE_PRINT_AREA )); @@ -657,9 +655,8 @@ IMPL_LINK_NOARG(SwMailMergeLayoutPage, ChangeAddressHdl_Impl, weld::MetricSpinBu tools::Long nLeft = static_cast< tools::Long >(m_xLeftMF->denormalize(m_xLeftMF->get_value(FieldUnit::TWIP))); tools::Long nTop = static_cast< tools::Long >(m_xTopMF->denormalize(m_xTopMF->get_value(FieldUnit::TWIP))); - SfxItemSet aSet( - m_pExampleWrtShell->GetAttrPool(), - svl::Items<RES_VERT_ORIENT, RES_ANCHOR>); + SfxItemSetFixed<RES_VERT_ORIENT, RES_ANCHOR> aSet( + m_pExampleWrtShell->GetAttrPool()); if (m_xAlignToBodyCB->get_active()) 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 895c0398feb2..ee6733259408 100644 --- a/sw/source/ui/dialog/ascfldlg.cxx +++ b/sw/source/ui/dialog/ascfldlg.cxx @@ -195,9 +195,9 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( weld::Window* pParent, SwDocShell& rDocSh, VclPtr<SfxPrinter> pPrt = pDoc ? pDoc->getIDocumentDeviceAccess().getPrinter(false) : nullptr; if( !pPrt ) { - auto pSet = std::make_unique<SfxItemSet>( rDocSh.GetPool(), - svl::Items<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, - SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC> ); + auto pSet = std::make_unique<SfxItemSetFixed + <SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, + SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC>>( rDocSh.GetPool() ); 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 0b1f89a8320d..1b4de3da4acb 100644 --- a/sw/source/ui/dialog/macassgn.cxx +++ b/sw/source/ui/dialog/macassgn.cxx @@ -104,7 +104,7 @@ bool SwMacroAssignDlg::INetFormatDlg(weld::Window* pParent, SwWrtShell& rSh, std::unique_ptr<SvxMacroItem>& rpINetItem ) { bool bRet = false; - SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_FRMMACRO, RES_FRMMACRO, SID_EVENTCONFIG, SID_EVENTCONFIG> ); + SfxItemSetFixed<RES_FRMMACRO, RES_FRMMACRO, SID_EVENTCONFIG, SID_EVENTCONFIG> aSet( rSh.GetAttrPool() ); SvxMacroItem aItem( RES_FRMMACRO ); if( !rpINetItem ) rpINetItem.reset(new SvxMacroItem( RES_FRMMACRO )); diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index eecdaf01a648..9ff77c893263 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -991,16 +991,14 @@ IMPL_LINK_NOARG(SwEditRegionDlg, OptionsHdl, weld::Button&, void) if (!pSectRepr) return; - SfxItemSet aSet( - rSh.GetView().GetPool(), - svl::Items< + SfxItemSetFixed< RES_FRM_SIZE, RES_FRM_SIZE, RES_LR_SPACE, RES_LR_SPACE, RES_BACKGROUND, RES_BACKGROUND, RES_COL, RES_COL, RES_FTN_AT_TXTEND, RES_FRAMEDIR, XATTR_FILL_FIRST, XATTR_FILL_LAST, - SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE>); + SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE> aSet( rSh.GetView().GetPool() ); 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 7c3f976a6e1c..0466e6e5a957 100644 --- a/sw/source/ui/fldui/fldedt.cxx +++ b/sw/source/ui/fldui/fldedt.cxx @@ -189,7 +189,7 @@ SfxTabPage* SwFieldEditDlg::CreatePage(sal_uInt16 nGroup) case GRP_REG: { SfxObjectShell* pDocSh = SfxObjectShell::Current(); - SfxItemSet* pSet = new SfxItemSet( pDocSh->GetPool(), svl::Items<SID_DOCINFO, SID_DOCINFO> ); + auto pSet = new SfxItemSetFixed<SID_DOCINFO, SID_DOCINFO>( pDocSh->GetPool() ); using namespace ::com::sun::star; uno::Reference<document::XDocumentPropertiesSupplier> xDPS( pDocSh->GetModel(), uno::UNO_QUERY_THROW); @@ -298,8 +298,7 @@ IMPL_LINK_NOARG(SwFieldEditDlg, AddressHdl, weld::Button&, void) SwFieldMgr& rMgr = pTabPage->GetFieldMgr(); SwField *pCurField = rMgr.GetCurField(); - SfxItemSet aSet( pSh->GetAttrPool(), - svl::Items<SID_FIELD_GRABFOCUS, SID_FIELD_GRABFOCUS> ); + SfxItemSetFixed<SID_FIELD_GRABFOCUS, SID_FIELD_GRABFOCUS> aSet( pSh->GetAttrPool() ); EditPosition nEditPos = EditPosition::UNKNOWN; diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx index f9a0f2241448..79bf8037a0ee 100644 --- a/sw/source/ui/fldui/fldtdlg.cxx +++ b/sw/source/ui/fldui/fldtdlg.cxx @@ -134,7 +134,7 @@ SfxItemSet* SwFieldDlg::CreateInputItemSet(const OString& rID) SwDocShell *const pDocSh(static_cast<SwDocShell*>(SfxObjectShell::Current())); if (rID == "docinfo" && pDocSh) // might not have a shell if the dialog is restored on startup { - mxInputItemSet = std::make_unique<SfxItemSet>( pDocSh->GetPool(), svl::Items<SID_DOCINFO, SID_DOCINFO> ); + mxInputItemSet = std::make_unique<SfxItemSetFixed<SID_DOCINFO, SID_DOCINFO>>( pDocSh->GetPool() ); 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 467964929539..f12ae77f4180 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -134,12 +134,10 @@ SwColumnDlg::SwColumnDlg(weld::Window* pParent, SwWrtShell& rSh) const SwPageDesc* pPageDesc = m_rWrtShell.GetSelectedPageDescs(); if( pPageDesc ) { - m_pPageSet.reset( new SfxItemSet( - m_rWrtShell.GetAttrPool(), - svl::Items< + m_pPageSet = std::make_unique<SfxItemSetFixed< RES_FRM_SIZE, RES_FRM_SIZE, RES_LR_SPACE, RES_LR_SPACE, - RES_COL, RES_COL>) ); + RES_COL, RES_COL>>(m_rWrtShell.GetAttrPool()); const SwFrameFormat &rFormat = pPageDesc->GetMaster(); m_nPageWidth = rFormat.GetFrameSize().GetSize().Width(); @@ -295,7 +293,7 @@ IMPL_LINK_NOARG(SwColumnDlg, OkHdl, weld::Button&, void) } if(m_pFrameSet && SfxItemState::SET == m_pFrameSet->GetItemState(RES_COL) && m_bFrameChanged) { - SfxItemSet aTmp(*m_pFrameSet->GetPool(), svl::Items<RES_COL, RES_COL>); + SfxItemSetFixed<RES_COL, RES_COL> aTmp(*m_pFrameSet->GetPool()); aTmp.Put(*m_pFrameSet); m_rWrtShell.StartAction(); m_rWrtShell.Push(); diff --git a/sw/source/ui/frmdlg/frmdlg.cxx b/sw/source/ui/frmdlg/frmdlg.cxx index bb3f07287e6b..ffb5a8ed76c9 100644 --- a/sw/source/ui/frmdlg/frmdlg.cxx +++ b/sw/source/ui/frmdlg/frmdlg.cxx @@ -174,9 +174,9 @@ void SwFrameDlg::PageCreated(const OString& rId, SfxTabPage &rPage) // FN_DRAW_WRAP_DLG), but could also be directly added from the DrawModel. else if (rId == "area") { - SfxItemSet aNew(*GetInputSetImpl()->GetPool(), - svl::Items<SID_COLOR_TABLE, SID_PATTERN_LIST, - SID_OFFER_IMPORT, SID_OFFER_IMPORT>); + SfxItemSetFixed<SID_COLOR_TABLE, SID_PATTERN_LIST, + SID_OFFER_IMPORT, SID_OFFER_IMPORT> + aNew(*GetInputSetImpl()->GetPool()); aNew.Put(m_rSet); diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index 242539430c1b..e065a272eaa2 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -54,7 +54,7 @@ void SwFootNoteOptionDlg::PageCreated(const OString& /*rId*/, SfxTabPage &rPage) IMPL_LINK(SwFootNoteOptionDlg, OkHdl, weld::Button&, rBtn, void) { - SfxItemSet aDummySet(rSh.GetAttrPool(), svl::Items<1, 1> ); + SfxItemSetFixed<1, 1> aDummySet(rSh.GetAttrPool()); SfxTabPage *pPage = GetTabPage("footnotes"); if ( pPage ) pPage->FillItemSet( &aDummySet ); diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index e958762f975a..e9e76d0500fe 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -530,7 +530,7 @@ IMPL_LINK(SwGlossaryDlg, MenuHdl, const OString&, rItemIdent, void) } else if (rItemIdent == "macro") { - SfxItemSet aSet( m_pShell->GetAttrPool(), svl::Items<RES_FRMMACRO, RES_FRMMACRO, SID_EVENTCONFIG, SID_EVENTCONFIG> ); + SfxItemSetFixed<RES_FRMMACRO, RES_FRMMACRO, SID_EVENTCONFIG, SID_EVENTCONFIG> aSet( m_pShell->GetAttrPool() ); SvxMacro aStart(OUString(), OUString(), STARBASIC); SvxMacro aEnd(OUString(), OUString(), STARBASIC); diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index 4052882a65a1..5cdad12d3bf1 100644 --- a/sw/source/ui/misc/insfnote.cxx +++ b/sw/source/ui/misc/insfnote.cxx @@ -50,7 +50,7 @@ void SwInsFootNoteDlg::Apply() if (m_rSh.SetCurFootnote( aNote ) && m_bExtCharAvailable) { m_rSh.Right(CRSR_SKIP_CHARS, true, 1, false ); - SfxItemSet aSet(m_rSh.GetAttrPool(), svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONT>); + SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONT> aSet(m_rSh.GetAttrPool()); m_rSh.GetCurAttr(aSet); const SvxFontItem &rFont = aSet.Get( RES_CHRATR_FONT ); SvxFontItem aFont( rFont.GetFamily(), m_aFontName, @@ -92,7 +92,7 @@ IMPL_LINK_NOARG(SwInsFootNoteDlg, NumberExtCharHdl, weld::Button&, void) { m_xNumberCharBtn->set_active(true); - SfxItemSet aSet(m_rSh.GetAttrPool(), svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONT>); + SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONT> aSet(m_rSh.GetAttrPool()); m_rSh.GetCurAttr( aSet ); const SvxFontItem &rFont = aSet.Get( RES_CHRATR_FONT ); @@ -200,7 +200,7 @@ void SwInsFootNoteDlg::Init() sNumStr = aFootnoteNote.GetNumStr(); m_rSh.Right(CRSR_SKIP_CHARS, true, 1, false ); - SfxItemSet aSet(m_rSh.GetAttrPool(), svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONT>); + SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONT> aSet(m_rSh.GetAttrPool()); m_rSh.GetCurAttr(aSet); const SvxFontItem &rFont = aSet.Get( RES_CHRATR_FONT ); aFont = m_xNumberCharEdit->get_font(); diff --git a/sw/source/ui/misc/titlepage.cxx b/sw/source/ui/misc/titlepage.cxx index b5fce662d5cc..8925a60d0faf 100644 --- a/sw/source/ui/misc/titlepage.cxx +++ b/sw/source/ui/misc/titlepage.cxx @@ -22,7 +22,7 @@ namespace bool lcl_GetPageDesc(SwWrtShell& rSh, sal_uInt16 &rPageNo, std::unique_ptr<const SwFormatPageDesc>* ppPageFormatDesc) { bool bRet = false; - SfxItemSet aSet(rSh.GetAttrPool(), svl::Items<RES_PAGEDESC, RES_PAGEDESC>); + SfxItemSetFixed<RES_PAGEDESC, RES_PAGEDESC> aSet(rSh.GetAttrPool()); if (rSh.GetCurAttr(aSet)) { const SfxPoolItem* pItem(nullptr); diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx index dd2fbb02d5ea..710d209441b1 100644 --- a/sw/source/uibase/app/appenv.cxx +++ b/sw/source/uibase/app/appenv.cxx @@ -167,7 +167,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) // Check if there's already an envelope. bool bEnvChange = false; - SfxItemSet aSet(GetPool(), svl::Items<FN_ENVELOP, FN_ENVELOP>); + SfxItemSetFixed<FN_ENVELOP, FN_ENVELOP> aSet(GetPool()); aSet.Put(aEnvCfg.GetItem()); SfxPrinter* pTempPrinter = pSh->getIDocumentDeviceAccess().getPrinter( true ); @@ -282,7 +282,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) { pSh->SplitNode(); pSh->Right( CRSR_SKIP_CHARS, false, 1, false ); - SfxItemSet aBreakSet( pSh->GetAttrPool(), svl::Items<RES_PAGEDESC, RES_PAGEDESC> ); + SfxItemSetFixed<RES_PAGEDESC, RES_PAGEDESC> aBreakSet( pSh->GetAttrPool() ); aBreakSet.Put( SwFormatPageDesc( pFollow ) ); pSh->SetTableAttr( aBreakSet ); } diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx index 74b5d03acccb..c5fb25b624c2 100644 --- a/sw/source/uibase/app/applab.cxx +++ b/sw/source/uibase/app/applab.cxx @@ -69,8 +69,7 @@ static const SwFrameFormat *lcl_InsertBCText( SwWrtShell& rSh, const SwLabItem& SwFrameFormat &rFormat, sal_uInt16 nCol, sal_uInt16 nRow ) { - SfxItemSet aSet( - rSh.GetAttrPool(), svl::Items<RES_VERT_ORIENT, RES_ANCHOR>); + SfxItemSetFixed<RES_VERT_ORIENT, RES_ANCHOR> aSet( rSh.GetAttrPool() ); sal_uInt16 nPhyPageNum, nVirtPageNum; rSh.GetPageNum( nPhyPageNum, nVirtPageNum ); @@ -105,8 +104,7 @@ 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(), svl::Items<RES_VERT_ORIENT, RES_ANCHOR>); + SfxItemSetFixed<RES_VERT_ORIENT, RES_ANCHOR> aSet( rSh.GetAttrPool() ); sal_uInt16 nPhyPageNum, nVirtPageNum; rSh.GetPageNum( nPhyPageNum, nVirtPageNum ); @@ -149,7 +147,7 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel) SwLabCfgItem aLabCfg(bLabel); // Move up Dialog - SfxItemSet aSet( GetPool(), svl::Items<FN_LABEL, FN_LABEL> ); + SfxItemSetFixed<FN_LABEL, FN_LABEL> aSet( GetPool() ); 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 a738084516a6..c4fe62e2ffa9 100644 --- a/sw/source/uibase/app/appopt.cxx +++ b/sw/source/uibase/app/appopt.cxx @@ -85,9 +85,7 @@ std::optional<SfxItemSet> SwModule::CreateItemSet( sal_uInt16 nId ) } // Options/Edit - SfxItemSet aRet( - GetPool(), - svl::Items< + SfxItemSetFixed< RES_BACKGROUND, RES_BACKGROUND, XATTR_FILL_FIRST, XATTR_FILL_LAST, SID_PRINTPREVIEW, SID_PRINTPREVIEW, @@ -104,7 +102,8 @@ std::optional<SfxItemSet> SwModule::CreateItemSet( sal_uInt16 nId ) FN_PARAM_PRINTER, FN_PARAM_STDFONTS, FN_PARAM_WRTSHELL, FN_PARAM_WRTSHELL, FN_PARAM_SHADOWCURSOR, FN_PARAM_SHADOWCURSOR, - FN_PARAM_CRSR_IN_PROTECTED, FN_PARAM_CRSR_IN_PROTECTED>); + FN_PARAM_CRSR_IN_PROTECTED, FN_PARAM_CRSR_IN_PROTECTED> + aRet(GetPool()); aRet.Put( SwDocDisplayItem( aViewOpt ) ); aRet.Put( SwElemItem( aViewOpt ) ); diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 558e235bd318..e434bbf6c178 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -418,7 +418,7 @@ void SwDocShell::Execute(SfxRequest& rReq) pAFlags->pSmartTagMgr = &SwSmartTagMgr::Get(); - SfxItemSet aSet( pApp->GetPool(), svl::Items<SID_AUTO_CORRECT_DLG, SID_AUTO_CORRECT_DLG, SID_OPEN_SMARTTAGOPTIONS, SID_OPEN_SMARTTAGOPTIONS> ); + SfxItemSetFixed<SID_AUTO_CORRECT_DLG, SID_AUTO_CORRECT_DLG, SID_OPEN_SMARTTAGOPTIONS, SID_OPEN_SMARTTAGOPTIONS> aSet( pApp->GetPool() ); aSet.Put( aSwOptions ); const SfxPoolItem* pOpenSmartTagOptionsItem = nullptr; diff --git a/sw/source/uibase/dialog/regionsw.cxx b/sw/source/uibase/dialog/regionsw.cxx index 1fcc03bf6eb1..73c7bd725dc4 100644 --- a/sw/source/uibase/dialog/regionsw.cxx +++ b/sw/source/uibase/dialog/regionsw.cxx @@ -38,16 +38,15 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) SwWrtShell& rSh = GetShell(); const SfxItemSet *pSet = rReq.GetArgs(); - SfxItemSet aSet( - GetPool(), - svl::Items< + SfxItemSetFixed< RES_FRM_SIZE, RES_FRM_SIZE, RES_LR_SPACE, RES_LR_SPACE, RES_BACKGROUND, RES_BACKGROUND, RES_COL, RES_COL, RES_FTN_AT_TXTEND, RES_FRAMEDIR, XATTR_FILL_FIRST, XATTR_FILL_LAST, - SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE>); + SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE> + aSet( GetPool() ); if (!pSet || pSet->Count()==0) { @@ -154,14 +153,13 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) void SwWrtShell::StartInsertRegionDialog(const SwSectionData& rSectionData) { - SfxItemSet aSet( - GetView().GetPool(), - svl::Items< + SfxItemSetFixed< RES_FRM_SIZE, RES_FRM_SIZE, RES_BACKGROUND, RES_BACKGROUND, RES_COL, RES_COL, XATTR_FILL_FIRST, XATTR_FILL_LAST, - SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE>); + SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE> + aSet( GetView().GetPool() ); SwRect aRect; CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR); tools::Long nWidth = aRect.Width(); diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 8a3182e1e8c0..2a8cea3e83f6 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -547,7 +547,7 @@ bool SwTransferable::GetData( const DataFlavor& rFlavor, const OUString& rDestDo } if( m_pWrtShell->IsFrameSelected() ) { - SfxItemSet aSet( m_pWrtShell->GetAttrPool(), svl::Items<RES_URL, RES_URL> ); + SfxItemSetFixed<RES_URL, RES_URL> aSet( m_pWrtShell->GetAttrPool() ); m_pWrtShell->GetFlyFrameAttr( aSet ); const SwFormatURL& rURL = aSet.Get( RES_URL ); if( rURL.GetMap() ) @@ -1175,7 +1175,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut ) if( m_pWrtShell->IsFrameSelected() ) { - SfxItemSet aSet( m_pWrtShell->GetAttrPool(), svl::Items<RES_URL, RES_URL> ); + SfxItemSetFixed<RES_URL, RES_URL> aSet( m_pWrtShell->GetAttrPool() ); m_pWrtShell->GetFlyFrameAttr( aSet ); const SwFormatURL& rURL = aSet.Get( RES_URL ); if( rURL.GetMap() ) @@ -2507,7 +2507,7 @@ bool SwTransferable::PasteTargetURL( const TransferableDataHelper& rData, if( bRet ) { - SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL> ); + SfxItemSetFixed<RES_URL, RES_URL> aSet( rSh.GetAttrPool() ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL( aSet.Get( RES_URL ) ); @@ -2925,7 +2925,7 @@ bool SwTransferable::PasteGrf( const TransferableDataHelper& rData, SwWrtShell& { if( rSh.IsFrameSelected() ) { - SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL> ); + SfxItemSetFixed<RES_URL, RES_URL> aSet( rSh.GetAttrPool() ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL( aSet.Get( RES_URL ) ); aURL.SetURL( aBkmk.GetURL(), false ); @@ -2981,7 +2981,7 @@ bool SwTransferable::PasteGrf( const TransferableDataHelper& rData, SwWrtShell& aMap.Read( *pStream, IMapFormat::Detect ) == IMAP_ERR_OK && aMap.GetIMapObjectCount() ) { - SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL> ); + SfxItemSetFixed<RES_URL, RES_URL> aSet( rSh.GetAttrPool() ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL( aSet.Get( RES_URL ) ); aURL.SetMap( &aMap ); @@ -3000,7 +3000,7 @@ bool SwTransferable::PasteImageMap( const TransferableDataHelper& rData, bool bRet = false; if( rData.HasFormat( SotClipboardFormatId::SVIM )) { - SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL> ); + SfxItemSetFixed<RES_URL, RES_URL> aSet( rSh.GetAttrPool() ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL( aSet.Get( RES_URL ) ); const ImageMap* pOld = aURL.GetMap(); @@ -3041,7 +3041,7 @@ bool SwTransferable::PasteAsHyperlink( const TransferableDataHelper& rData, case OBJCNT_GRF: case OBJCNT_OLE: { - SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL> ); + SfxItemSetFixed<RES_URL, RES_URL> aSet( rSh.GetAttrPool() ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL2( aSet.Get( RES_URL ) ); aURL2.SetURL( sFile, false ); @@ -3139,7 +3139,7 @@ bool SwTransferable::PasteFileName( TransferableDataHelper& rData, case OBJCNT_GRF: case OBJCNT_OLE: { - SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL> ); + SfxItemSetFixed<RES_URL, RES_URL> aSet( rSh.GetAttrPool() ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL2( aSet.Get( RES_URL ) ); aURL2.SetURL( sFile, false ); @@ -3653,7 +3653,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos ) if( !m_pWrtShell->IsFrameSelected() ) return; - SfxItemSet aSet( m_pWrtShell->GetAttrPool(), svl::Items<RES_URL, RES_URL> ); + SfxItemSetFixed<RES_URL, RES_URL> aSet( m_pWrtShell->GetAttrPool() ); m_pWrtShell->GetFlyFrameAttr( aSet ); const SwFormatURL& rURL = aSet.Get( RES_URL ); if( rURL.GetMap() ) @@ -3873,7 +3873,7 @@ bool SwTransferable::PrivateDrop( SwWrtShell& rSh, const Point& rDragPt, // not yet consider Draw objects if( SelectionType::Graphic & nSelection ) { - SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL> ); + SfxItemSetFixed<RES_URL, RES_URL> aSet( rSh.GetAttrPool() ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL( aSet.Get( RES_URL ) ); aURL.SetURL( aTmp.GetURL(), false ); diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index 7a79acb26d76..3fcd9063efc1 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -319,9 +319,8 @@ void SwPageBreakWin::execute(std::string_view rIdent) rNd.GetDoc().GetIDocumentUndoRedo( ).StartUndo( SwUndoId::UI_DELETE_PAGE_BREAK, nullptr ); - SfxItemSet aSet( - GetEditWin()->GetView().GetWrtShell().GetAttrPool(), - svl::Items<RES_PAGEDESC, RES_BREAK>); + SfxItemSetFixed<RES_PAGEDESC, RES_BREAK> aSet( + GetEditWin()->GetView().GetWrtShell().GetAttrPool()); aSet.Put( SwFormatPageDesc( nullptr ) ); // This break could be from the current paragraph, if it has a PageBefore break. diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index d63a01644293..172f874e3b08 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -1669,7 +1669,7 @@ void SwPostItMgr::ExecuteFormatAllDialog(SwView& rView) OutlinerView* pOLV = pWin->GetOutlinerView(); SfxItemSet aEditAttr(pOLV->GetAttribs()); SfxItemPool* pPool(SwAnnotationShell::GetAnnotationPool(rView)); - SfxItemSet aDlgAttr(*pPool, svl::Items<XATTR_FILLSTYLE, XATTR_FILLCOLOR, EE_ITEMS_START, EE_ITEMS_END>); + SfxItemSetFixed<XATTR_FILLSTYLE, XATTR_FILLCOLOR, EE_ITEMS_START, EE_ITEMS_END> aDlgAttr(*pPool); aDlgAttr.Put(aEditAttr); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwCharDlg(rView.GetFrameWeld(), rView, aDlgAttr, SwCharDlgMode::Ann)); diff --git a/sw/source/uibase/docvw/UnfloatTableButton.cxx b/sw/source/uibase/docvw/UnfloatTableButton.cxx index 8abc5105f7d8..4b92b153a70e 100644 --- a/sw/source/uibase/docvw/UnfloatTableButton.cxx +++ b/sw/source/uibase/docvw/UnfloatTableButton.cxx @@ -156,8 +156,8 @@ void UnfloatTableButton::MouseButtonDown(const MouseEvent& /*rMEvt*/) if (pPageDesc) { // First set the existing page desc for the table node - SfxItemSet aSet(GetEditWin()->GetView().GetWrtShell().GetAttrPool(), - svl::Items<RES_PAGEDESC, RES_PAGEDESC>); + SfxItemSetFixed<RES_PAGEDESC, RES_PAGEDESC> aSet( + GetEditWin()->GetView().GetWrtShell().GetAttrPool()); aSet.Put(SwFormatPageDesc(pPageDesc)); SwPaM aPaMTable(*pTableNode); rDoc.getIDocumentContentOperations().InsertItemSet( diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 0ddc009a54c2..3ed905061c9e 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -1026,14 +1026,13 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, bool bWeb ) rSh.IsSelObjProtected( FlyProtectFlags::Pos ) != FlyProtectFlags::NONE ) return; - SfxItemSet aSet( - rSh.GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_FRM_SIZE, RES_FRM_SIZE, RES_PROTECT, RES_PROTECT, RES_VERT_ORIENT, RES_ANCHOR, RES_COL, RES_COL, - RES_FOLLOW_TEXT_FLOW, RES_FOLLOW_TEXT_FLOW>); + RES_FOLLOW_TEXT_FLOW, RES_FOLLOW_TEXT_FLOW> + aSet( rSh.GetAttrPool() ); rSh.GetFlyFrameAttr( aSet ); RndStdIds eAnchorId = aSet.Get(RES_ANCHOR).GetAnchorId(); Size aSnap; @@ -2235,7 +2234,7 @@ KEYINPUT_CHECKTABLE_INSDEL: eKeyState = SwKeyState::GoIntoFly; else { - SfxItemSet aSet(rSh.GetAttrPool(), svl::Items<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT>); + SfxItemSetFixed<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT> aSet(rSh.GetAttrPool()); 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 be64282036e6..9996117b9488 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -1414,8 +1414,7 @@ bool SwFieldMgr::InsertField( { &aFormat }); } - SfxItemSet aBoxSet( pCurShell->GetAttrPool(), - svl::Items<RES_BOXATR_FORMULA, RES_BOXATR_FORMULA> ); + SfxItemSetFixed<RES_BOXATR_FORMULA, RES_BOXATR_FORMULA> aBoxSet( pCurShell->GetAttrPool() ); 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 f6488420f42b..822434d96970 100644 --- a/sw/source/uibase/frmdlg/colex.cxx +++ b/sw/source/uibase/frmdlg/colex.cxx @@ -121,7 +121,7 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet ) { // create FillAttributes from SvxBrushItem //SetHdColor(rItem.GetColor()); const SvxBrushItem& rItem = rHeaderSet.Get(RES_BACKGROUND); - SfxItemSet aTempSet(*rHeaderSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>); + SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> aTempSet(*rHeaderSet.GetPool()); setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); setHeaderFillAttributes( @@ -159,7 +159,7 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet ) { // create FillAttributes from SvxBrushItem //SetFtColor(rItem.GetColor()); const SvxBrushItem& rItem = rFooterSet.Get(RES_BACKGROUND); - SfxItemSet aTempSet(*rFooterSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>); + SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> aTempSet(*rFooterSet.GetPool()); setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); setFooterFillAttributes( @@ -175,7 +175,7 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet ) { // create FillAttributes from SvxBrushItem const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(*pItem); - SfxItemSet aTempSet(*rSet.GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>); + SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> aTempSet(*rSet.GetPool()); setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); setPageFillAttributes( diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx b/sw/source/uibase/frmdlg/frmmgr.cxx index 3bddeb20fca8..69065a7fb457 100644 --- a/sw/source/uibase/frmdlg/frmmgr.cxx +++ b/sw/source/uibase/frmdlg/frmmgr.cxx @@ -169,7 +169,7 @@ void SwFlyFrameAttrMgr::UpdateFlyFrame() const SfxPoolItem *pGItem, *pItem; if( SfxItemState::SET == m_aSet.GetItemState( RES_ANCHOR, false, &pItem )) { - SfxItemSet aGetSet( *m_aSet.GetPool(), svl::Items<RES_ANCHOR, RES_ANCHOR> ); + SfxItemSetFixed<RES_ANCHOR, RES_ANCHOR> aGetSet( *m_aSet.GetPool() ); 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/hhcwrp.cxx b/sw/source/uibase/lingu/hhcwrp.cxx index fd0d7adee111..eff62f932e9c 100644 --- a/sw/source/uibase/lingu/hhcwrp.cxx +++ b/sw/source/uibase/lingu/hhcwrp.cxx @@ -314,10 +314,7 @@ void SwHHCWrapper::ChangeText_impl( const OUString &rNewText, bool bKeepAttribut if (bKeepAttributes) { // get item set with all relevant attributes - static const WhichRangesContainer aRanges(svl::Items< - RES_CHRATR_BEGIN, RES_FRMATR_END - >); - SfxItemSet aItemSet( m_rWrtShell.GetAttrPool(), aRanges ); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_FRMATR_END> aItemSet( m_rWrtShell.GetAttrPool() ); // get all attributes spanning the whole selection in order to // restore those for the new text m_rWrtShell.GetCurAttr( aItemSet ); @@ -466,9 +463,10 @@ void SwHHCWrapper::ReplaceUnit( OSL_ENSURE( GetTargetLanguage() == LANGUAGE_CHINESE_SIMPLIFIED || GetTargetLanguage() == LANGUAGE_CHINESE_TRADITIONAL, "SwHHCWrapper::ReplaceUnit : unexpected target language" ); - SfxItemSet aSet( m_rWrtShell.GetAttrPool(), svl::Items< + SfxItemSetFixed< RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT, - RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE> ); + RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE> + aSet( m_rWrtShell.GetAttrPool() ); if (pNewUnitLanguage) { aSet.Put( SvxLanguageItem( *pNewUnitLanguage, RES_CHRATR_CJK_LANGUAGE ) ); diff --git a/sw/source/uibase/lingu/olmenu.cxx b/sw/source/uibase/lingu/olmenu.cxx index 8d2c5f43afe3..4867c8e9e6fe 100644 --- a/sw/source/uibase/lingu/olmenu.cxx +++ b/sw/source/uibase/lingu/olmenu.cxx @@ -640,7 +640,7 @@ void SwSpellPopup::checkRedline() FN_REDLINE_PREV_CHANGE }; SwDoc *pDoc = m_pSh->GetDoc(); - SfxItemSet aSet(pDoc->GetAttrPool(), svl::Items<FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_PREV_CHANGE>); + SfxItemSetFixed<FN_REDLINE_ACCEPT_DIRECT, FN_REDLINE_PREV_CHANGE> aSet(pDoc->GetAttrPool()); for (sal_uInt16 nWhich : pRedlineIds) { aSet.Put(SfxVoidItem(nWhich)); diff --git a/sw/source/uibase/misc/glshell.cxx b/sw/source/uibase/misc/glshell.cxx index 634e396d44de..37d5e630769d 100644 --- a/sw/source/uibase/misc/glshell.cxx +++ b/sw/source/uibase/misc/glshell.cxx @@ -236,12 +236,11 @@ SwDocShellRef SwGlossaries::EditGroupDoc( const OUString& rGroup, const OUString { // we create a default SfxPrinter. // ItemSet is deleted by Sfx! - auto pSet = std::make_unique<SfxItemSet>( - xDocSh->GetDoc()->GetAttrPool(), - svl::Items< + auto pSet = std::make_unique<SfxItemSetFixed< SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, - FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER>); + FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER>> + ( xDocSh->GetDoc()->GetAttrPool() ); 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 c89e8e96eaf1..53df01560ab1 100644 --- a/sw/source/uibase/ribbar/concustomshape.cxx +++ b/sw/source/uibase/ribbar/concustomshape.cxx @@ -121,9 +121,7 @@ void ConstCustomShape::SetAttributes( SdrObject* pObj ) if( pSourceObj ) { const SfxItemSet& rSource = pSourceObj->GetMergedItemSet(); - SfxItemSet aDest( - pObj->getSdrModelFromSdrObject().GetItemPool(), - svl::Items< + SfxItemSetFixed< // Ranges from SdrAttrObj: SDRATTR_START, SDRATTR_SHADOW_LAST, SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, @@ -134,7 +132,8 @@ void ConstCustomShape::SetAttributes( SdrObject* pObj ) SDRATTR_GRAF_FIRST, SDRATTR_CUSTOMSHAPE_LAST, // Range from SdrTextObj: - EE_ITEMS_START, EE_ITEMS_END>); + EE_ITEMS_START, EE_ITEMS_END> + aDest( pObj->getSdrModelFromSdrObject().GetItemPool() ); aDest.Set( rSource ); pObj->SetMergedItemSet( aDest ); Degree100 nAngle = pSourceObj->GetRotateAngle(); diff --git a/sw/source/uibase/ribbar/conrect.cxx b/sw/source/uibase/ribbar/conrect.cxx index d520039b34d8..59630eef8389 100644 --- a/sw/source/uibase/ribbar/conrect.cxx +++ b/sw/source/uibase/ribbar/conrect.cxx @@ -93,8 +93,8 @@ bool ConstRectangle::MouseButtonUp(const MouseEvent& rMEvt) if( pObj ) { // Set the attributes needed for scrolling - SfxItemSet aItemSet( pSdrView->GetModel()->GetItemPool(), - svl::Items<SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST>); + SfxItemSetFixed<SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST> + aItemSet( pSdrView->GetModel()->GetItemPool() ); 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 a5607aba014e..2072ee25a12b 100644 --- a/sw/source/uibase/ribbar/drawbase.cxx +++ b/sw/source/uibase/ribbar/drawbase.cxx @@ -286,7 +286,7 @@ bool SwDrawBase::MouseButtonUp(const MouseEvent& rMEvt) bAutoCap = true; if(m_pWin->GetFrameColCount() > 1) { - SfxItemSet aSet(m_pView->GetPool(),svl::Items<RES_COL,RES_COL>); + SfxItemSetFixed<RES_COL,RES_COL> aSet(m_pView->GetPool()); SwFormatCol aCol(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 372290e75c19..37866ea29c66 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(), svl::Items<RES_BOXATR_FORMULA, RES_BOXATR_FORMULA> ); + SfxItemSetFixed<RES_BOXATR_FORMULA, RES_BOXATR_FORMULA> aSet( pWrtShell->GetAttrPool() ); if( pWrtShell->GetTableBoxFormulaAttrs( aSet )) sEdit += aSet.Get( RES_BOXATR_FORMULA ).GetFormula(); } diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index ad089f373e42..10e023a7992a 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -452,7 +452,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(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLCOLOR, EE_ITEMS_START, EE_ITEMS_END>); + SfxItemSetFixed<XATTR_FILLSTYLE, XATTR_FILLCOLOR, EE_ITEMS_START, EE_ITEMS_END> aDlgAttr(GetPool()); // util::Language does not exist in the EditEngine! Therefore not included in the set. @@ -494,11 +494,10 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( pView) != nullptr ); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, eMetric)); */ - SfxItemSet aDlgAttr( - GetPool(), - svl::Items< + SfxItemSetFixed< EE_ITEMS_START, EE_ITEMS_END, - SID_ATTR_PARA_HYPHENZONE, SID_ATTR_PARA_WIDOWS>); + SID_ATTR_PARA_HYPHENZONE, SID_ATTR_PARA_WIDOWS> + aDlgAttr( GetPool() ); aDlgAttr.Put(aEditAttr); @@ -540,11 +539,10 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) if( !static_cast<const SfxBoolItem*>(pPoolItem)->GetValue() ) bLeftToRight = !bLeftToRight; } - SfxItemSet aAttr( - *aNewAttr.GetPool(), - svl::Items< + SfxItemSetFixed< EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR, - EE_PARA_JUST, EE_PARA_JUST>); + EE_PARA_JUST, EE_PARA_JUST> + aAttr( *aNewAttr.GetPool() ); SvxAdjust nAdjust = SvxAdjust::Left; if( SfxItemState::SET == aEditAttr.GetItemState(EE_PARA_JUST, true, &pPoolItem ) ) @@ -1772,11 +1770,10 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) pOutliner->SetUpdateLayout(false); SfxItemSet aOldSet( pOLV->GetAttribs() ); - SfxItemSet aFontSet( - *aOldSet.GetPool(), - svl::Items< + SfxItemSetFixed< EE_CHAR_FONTINFO, EE_CHAR_FONTINFO, - EE_CHAR_FONTINFO_CJK, EE_CHAR_FONTINFO_CTL>); + EE_CHAR_FONTINFO_CJK, EE_CHAR_FONTINFO_CTL> + aFontSet( *aOldSet.GetPool() ); aFontSet.Set( aOldSet ); // Insert string diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 4242ee8a37e9..292b1f10c851 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -163,7 +163,7 @@ static void lcl_UpdateIMapDlg( SwWrtShell& rSh ) TargetList aList; SfxFrame::GetDefaultTargetList(aList); - SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL> ); + SfxItemSetFixed<RES_URL, RES_URL> aSet( rSh.GetAttrPool() ); rSh.GetFlyFrameAttr( aSet ); const SwFormatURL &rURL = aSet.Get( RES_URL ); SvxIMapDlgChildWindow::UpdateIMapDlg( @@ -1115,7 +1115,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) if ( rSh.IsFrameSelected() && pDlg->GetEditingObject() == rSh.GetIMapInventor() ) { - SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL> ); + SfxItemSetFixed<RES_URL, RES_URL> aSet( rSh.GetAttrPool() ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL( aSet.Get( RES_URL ) ); aURL.SetMap( &pDlg->GetImageMap() ); @@ -1168,7 +1168,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) if (pDlg && pDlg->GetEditingObject() == rSh.GetIMapInventor()) { rSh.StartAction(); - SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_SURROUND, RES_SURROUND>); + SfxItemSetFixed<RES_SURROUND, RES_SURROUND> aSet( rSh.GetAttrPool() ); rSh.GetFlyFrameAttr( aSet ); SwFormatSurround aSur( aSet.Get( RES_SURROUND ) ); if ( !aSur.IsContour() ) @@ -1230,7 +1230,7 @@ void SwBaseShell::Execute(SfxRequest &rReq) sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell()); if( nHtmlMode ) { - SfxItemSet aSet(GetPool(), svl::Items<RES_SURROUND, RES_HORI_ORIENT>); + SfxItemSetFixed<RES_SURROUND, RES_HORI_ORIENT> aSet(GetPool()); rSh.GetFlyFrameAttr(aSet); const SwFormatSurround& rSurround = aSet.Get(RES_SURROUND); @@ -1478,7 +1478,7 @@ IMPL_LINK_NOARG(SwBaseShell, GraphicArrivedHdl, SwCursorShell&, void) case FN_FRAME_WRAP_CONTOUR: if( !bProtect ) { - SfxItemSet aSet(GetPool(), svl::Items<RES_SURROUND, RES_SURROUND>); + SfxItemSetFixed<RES_SURROUND, RES_SURROUND> aSet(GetPool()); rSh.GetFlyFrameAttr(aSet); const SwFormatSurround& rWrap = aSet.Get(RES_SURROUND); bSetState = true; @@ -1585,8 +1585,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) break; case RES_SHADOW: { - SfxItemSet aSet( rSh.GetAttrPool(), - svl::Items<RES_SHADOW, RES_SHADOW> ); + SfxItemSetFixed<RES_SHADOW, RES_SHADOW> aSet( rSh.GetAttrPool()); // Table cell(s) selected? if ( rSh.IsTableMode() ) @@ -1768,7 +1767,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) if( !bParentCntProt && (bObj || rSh.IsFrameSelected())) { - SfxItemSet aSet(GetPool(), svl::Items<RES_ANCHOR, RES_ANCHOR>); + SfxItemSetFixed<RES_ANCHOR, RES_ANCHOR> aSet(GetPool()); if(bObj) rSh.GetObjAttr(aSet); else @@ -1819,7 +1818,7 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) if( !bParentCntProt && (bObj || rSh.IsFrameSelected())) { - SfxItemSet aSet(GetPool(), svl::Items<RES_OPAQUE, RES_ANCHOR>); + SfxItemSetFixed<RES_OPAQUE, RES_ANCHOR> aSet(GetPool()); RndStdIds nAnchorType; if(bObj) { @@ -1995,7 +1994,7 @@ void SwBaseShell::SetWrapMode( sal_uInt16 nSlot ) if( !bObj && !rSh.IsFrameSelected()) return; - SfxItemSet aSet(GetPool(), svl::Items<RES_OPAQUE, RES_SURROUND>); + SfxItemSetFixed<RES_OPAQUE, RES_SURROUND> aSet(GetPool()); if(bObj) rSh.GetObjAttr(aSet); else @@ -2153,9 +2152,10 @@ 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(), svl::Items<RES_CHRATR_FONTSIZE, RES_CHRATR_FONTSIZE, - RES_CHRATR_CJK_FONTSIZE, RES_CHRATR_CJK_FONTSIZE, - RES_CHRATR_CTL_FONTSIZE, RES_CHRATR_CTL_FONTSIZE>); + SfxItemSetFixed<RES_CHRATR_FONTSIZE, RES_CHRATR_FONTSIZE, + RES_CHRATR_CJK_FONTSIZE, RES_CHRATR_CJK_FONTSIZE, + RES_CHRATR_CTL_FONTSIZE, RES_CHRATR_CTL_FONTSIZE> + aHeightSet( GetPool() ); switch( nSlot ) { @@ -2197,9 +2197,10 @@ void SwBaseShell::ExecTextCtrl( SfxRequest& rReq ) sal_uInt32 nHeight = static_cast< const SvxFontHeightItem& >(pArgs->Get( nWhich )).GetHeight(); SwStdFontConfig* pStdFont = SW_MOD()->GetStdFontConfig(); - 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>); + SfxItemSetFixed<RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE, + RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, + RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE> + aLangSet( GetPool() ); rSh.GetCurAttr( aLangSet ); sal_Int32 nWesternSize = @@ -2367,7 +2368,7 @@ void SwBaseShell::GetBckColState(SfxItemSet &rSet) else { // Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set - SfxItemSet aCoreSet(GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>); + SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> aCoreSet(GetPool()); aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet()); @@ -2431,7 +2432,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq) else { // Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set - SfxItemSet aCoreSet(GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>); + SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> aCoreSet(GetPool()); aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet()); @@ -2519,7 +2520,7 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq) else { // Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set - SfxItemSet aCoreSet(GetPool(), svl::Items<XATTR_FILL_FIRST, XATTR_FILL_LAST>); + SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> aCoreSet(GetPool()); aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet()); setSvxBrushItemAsFillAttributesToTargetSet(*aBrushItem, aCoreSet); @@ -2564,9 +2565,8 @@ void SwBaseShell::GetBorderState(SfxItemSet &rSet) bool bTableMode = rSh.IsTableMode(); if ( bTableMode ) { - SfxItemSet aCoreSet( GetPool(), - svl::Items<RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> ); + SfxItemSetFixed<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> aCoreSet( GetPool() ); SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); aCoreSet.Put( aBoxInfo ); rSh.GetTabBorders( aCoreSet ); @@ -2648,9 +2648,8 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) break; case FN_FORMAT_BORDER_DLG: { - SfxItemSet aSet( rSh.GetAttrPool(), - svl::Items<RES_BOX , RES_SHADOW, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> ); + SfxItemSetFixed<RES_BOX , RES_SHADOW, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> aSet( rSh.GetAttrPool() ); ScopedVclPtr<SfxAbstractDialog> pDlg; // Table cell(s) selected? if ( rSh.IsTableMode() ) @@ -2704,9 +2703,8 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq) break; case FN_FORMAT_BACKGROUND_DLG: { - SfxItemSet aSet( rSh.GetAttrPool(), - svl::Items<RES_BACKGROUND, RES_BACKGROUND, - XATTR_FILL_FIRST, XATTR_FILL_LAST> ); + SfxItemSetFixed<RES_BACKGROUND, RES_BACKGROUND, + XATTR_FILL_FIRST, XATTR_FILL_LAST> aSet( rSh.GetAttrPool() ); ScopedVclPtr<SfxAbstractDialog> pDlg; SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); @@ -3076,7 +3074,7 @@ void SwBaseShell::ExecuteGallery(SfxRequest &rReq) rSh.SetBoxBackground( aBrush ); else if ( nPos == nFramePos || nPos == nGraphicPos || nPos == nOlePos ) { - SfxItemSet aCoreSet(GetPool(), svl::Items<RES_BACKGROUND, RES_BACKGROUND>); + SfxItemSetFixed<RES_BACKGROUND, RES_BACKGROUND> aCoreSet(GetPool()); aCoreSet.Put( aBrush ); rSh.SetFlyFrameAttr( aCoreSet ); } diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx index 52a3b0d02beb..9dc1ad6163c6 100644 --- a/sw/source/uibase/shells/drawsh.cxx +++ b/sw/source/uibase/shells/drawsh.cxx @@ -152,7 +152,7 @@ void SwDrawShell::InsertPictureFromFile(SdrObject& rObject) { pSdrView->AddUndo(std::make_unique<SdrUndoAttrObj>(rObject)); - SfxItemSet aSet(pSdrView->GetModel()->GetItemPool(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLBITMAP>); + SfxItemSetFixed<XATTR_FILLSTYLE, XATTR_FILLBITMAP> aSet(pSdrView->GetModel()->GetItemPool()); 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 3f440abc7b43..ff8579368812 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -124,15 +124,14 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq) const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); if( rMarkList.GetMark(0) != nullptr ) { - SfxItemSet aSet( - GetPool(), - svl::Items< + SfxItemSetFixed< RES_LR_SPACE, RES_UL_SPACE, RES_SURROUND, RES_SURROUND, RES_ANCHOR, RES_ANCHOR, RES_WRAP_INFLUENCE_ON_OBJPOS, RES_WRAP_INFLUENCE_ON_OBJPOS, SID_HTML_MODE, SID_HTML_MODE, - FN_DRAW_WRAP_DLG, FN_DRAW_WRAP_DLG>); + FN_DRAW_WRAP_DLG, FN_DRAW_WRAP_DLG> + aSet( GetPool() ); aSet.Put(SfxBoolItem(SID_HTML_MODE, 0 != ::GetHtmlMode(pSh->GetView().GetDocShell()))); @@ -268,7 +267,7 @@ void SwDrawBaseShell::Execute(SfxRequest const &rReq) SfxItemState::SET != pOutSet->GetItemState( SID_ATTR_TRANSFORM_POS_Y, false ); - SfxItemSet aFrameAttrSet(GetPool(), svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END - 1>); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END - 1> aFrameAttrSet(GetPool()); bool bSingleSelection = rMarkList.GetMarkCount() == 1; diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index cc21f3296927..ad2cc4c80c66 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -366,7 +366,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(), svl::Items<XATTR_FILLSTYLE, XATTR_FILLCOLOR, EE_ITEMS_START, EE_ITEMS_END>); + SfxItemSetFixed<XATTR_FILLSTYLE, XATTR_FILLCOLOR, EE_ITEMS_START, EE_ITEMS_END> aDlgAttr(GetPool()); // util::Language does not exists in the EditEngine! That is why not in set. @@ -431,11 +431,9 @@ 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(), - svl::Items< + SfxItemSetFixed< EE_ITEMS_START, EE_ITEMS_END, - SID_ATTR_PARA_HYPHENZONE, SID_ATTR_PARA_WIDOWS>); + SID_ATTR_PARA_HYPHENZONE, SID_ATTR_PARA_WIDOWS> aDlgAttr( GetPool() ); aDlgAttr.Put(aEditAttr); @@ -555,9 +553,8 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) pSdrView->SdrEndTextEdit(true); - SfxItemSet aAttr( *aNewAttr.GetPool(), - svl::Items<SDRATTR_TEXTDIRECTION, - SDRATTR_TEXTDIRECTION> ); + SfxItemSetFixed<SDRATTR_TEXTDIRECTION, + SDRATTR_TEXTDIRECTION> aAttr( *aNewAttr.GetPool() ); aAttr.Put( SvxWritingModeItem( nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ? @@ -586,11 +583,9 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) if( !static_cast<const SfxBoolItem*>(pPoolItem)->GetValue() ) bLeftToRight = !bLeftToRight; } - SfxItemSet aAttr( - *aNewAttr.GetPool(), - svl::Items< + SfxItemSetFixed< EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR, - EE_PARA_JUST, EE_PARA_JUST>); + EE_PARA_JUST, EE_PARA_JUST> aAttr( *aNewAttr.GetPool() ); 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 2cb86428b65b..7495cf5a7c37 100644 --- a/sw/source/uibase/shells/drwtxtsh.cxx +++ b/sw/source/uibase/shells/drwtxtsh.cxx @@ -735,11 +735,9 @@ void SwDrawTextShell::InsertSymbol(SfxRequest& rReq) pOutliner->SetUpdateLayout(false); SfxItemSet aOldSet( pOLV->GetAttribs() ); - SfxItemSet aFontSet( - *aOldSet.GetPool(), - svl::Items< + SfxItemSetFixed< EE_CHAR_FONTINFO, EE_CHAR_FONTINFO, - EE_CHAR_FONTINFO_CJK, EE_CHAR_FONTINFO_CTL>); + EE_CHAR_FONTINFO_CJK, EE_CHAR_FONTINFO_CTL> aFontSet( *aOldSet.GetPool() ); aFontSet.Set( aOldSet ); // Insert string diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index beafae953597..a4283b672008 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -180,7 +180,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(),svl::Items<RES_COL,RES_COL>); + SfxItemSetFixed<RES_COL,RES_COL> aSet(GetPool()); rSh.GetFlyFrameAttr( aSet ); SwFormatCol aCol(aSet.Get(RES_COL)); // GutterWidth will not always passed, hence get firstly @@ -215,7 +215,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) const OUString& rURL = rHLinkItem.GetURL(); const OUString& rTarget = rHLinkItem.GetTargetFrame(); - SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_URL, RES_URL> ); + SfxItemSetFixed<RES_URL, RES_URL> aSet( rSh.GetAttrPool() ); rSh.GetFlyFrameAttr( aSet ); SwFormatURL aURL( aSet.Get( RES_URL ) ); @@ -393,7 +393,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) if (pArgs && (pArgs->HasItem(SID_ATTR_TRANSFORM_ANGLE) || pArgs->HasItem(SID_ATTR_TRANSFORM_DELTA_ANGLE))) { - SfxItemSet aSet(rSh.GetAttrPool(), svl::Items<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION> ); + SfxItemSetFixed<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION> aSet(rSh.GetAttrPool() ); rSh.GetCurAttr(aSet); const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION); const Degree10 nOldRot(rRotation.GetValue()); @@ -444,9 +444,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) } else { - SfxItemSet aSet( - GetPool(), - svl::Items< + SfxItemSetFixed< RES_FRMATR_BEGIN, RES_FRMATR_END - 1, // FillAttribute support: XATTR_FILL_FIRST, XATTR_FILL_LAST, @@ -465,7 +463,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) FN_SET_FRM_ALT_NAME, FN_SET_FRM_ALT_NAME, FN_UNO_DESCRIPTION, FN_UNO_DESCRIPTION, FN_OLE_IS_MATH, FN_MATH_BASELINE_ALIGNMENT, - FN_PARAM_CHAIN_PREVIOUS, FN_PARAM_CHAIN_NEXT>); + FN_PARAM_CHAIN_PREVIOUS, FN_PARAM_CHAIN_NEXT> aSet( GetPool() ); // create needed items for XPropertyList entries from the DrawModel so that // the Area TabPage can access them @@ -562,11 +560,9 @@ 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(), - svl::Items< + SfxItemSetFixed< RES_FRM_SIZE, RES_FRM_SIZE, - RES_SURROUND, RES_ANCHOR>); + RES_SURROUND, RES_ANCHOR> aShellSet( GetPool() ); aShellSet.Put(*pOutSet); aMgr.SetAttrSet(aShellSet); if(SfxItemState::SET == pOutSet->GetItemState(FN_SET_FRM_NAME, false, &pItem)) @@ -658,7 +654,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) SwFormatHoriOrient aHori(aMgr.GetHoriOrient()); bool bMirror = !aHori.IsPosToggle(); aHori.SetPosToggle(bMirror); - SfxItemSet aSet(GetPool(), svl::Items<RES_HORI_ORIENT, RES_HORI_ORIENT>); + SfxItemSetFixed<RES_HORI_ORIENT, RES_HORI_ORIENT> aSet(GetPool()); aSet.Put(aHori); aMgr.SetAttrSet(aSet); bCopyToFormat = true; @@ -738,11 +734,9 @@ void SwFrameShell::GetState(SfxItemSet& rSet) if (!rSh.IsFrameSelected()) return; - SfxItemSet aSet( - rSh.GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_LR_SPACE, RES_UL_SPACE, - RES_PRINT, RES_HORI_ORIENT>); + RES_PRINT, RES_HORI_ORIENT> aSet(rSh.GetAttrPool() ); rSh.GetFlyFrameAttr( aSet ); bool bProtect = rSh.IsSelObjProtected(FlyProtectFlags::Pos) != FlyProtectFlags::NONE; @@ -920,7 +914,7 @@ void SwFrameShell::GetState(SfxItemSet& rSet) SvxHyperlinkItem aHLinkItem; const SfxPoolItem* pItem; - SfxItemSet aURLSet(GetPool(), svl::Items<RES_URL, RES_URL>); + SfxItemSetFixed<RES_URL, RES_URL> aURLSet(GetPool()); rSh.GetFlyFrameAttr( aURLSet ); if(SfxItemState::SET == aURLSet.GetItemState(RES_URL, true, &pItem)) @@ -1094,7 +1088,7 @@ void SwFrameShell::ExecFrameStyle(SfxRequest const & rReq) const SvxBoxItem* pPoolBoxItem = ::GetDfltAttr(RES_BOX); const SfxItemSet *pArgs = rReq.GetArgs(); - SfxItemSet aFrameSet(rSh.GetAttrPool(), svl::Items<RES_BOX, RES_BOX>); + SfxItemSetFixed<RES_BOX, RES_BOX> aFrameSet(rSh.GetAttrPool()); rSh.GetFlyFrameAttr( aFrameSet ); const SvxBoxItem& rBoxItem = aFrameSet.Get(RES_BOX); @@ -1289,7 +1283,7 @@ void SwFrameShell::GetLineStyleState(SfxItemSet &rSet) { if (rSh.IsFrameSelected()) { - SfxItemSet aFrameSet( rSh.GetAttrPool(), svl::Items<RES_BOX, RES_BOX> ); + SfxItemSetFixed<RES_BOX, RES_BOX> aFrameSet( rSh.GetAttrPool() ); rSh.GetFlyFrameAttr(aFrameSet); diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index a217b5d56ecb..1aa4b210a8a2 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -191,7 +191,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) convertTwipToMm100(rSh.GetAnyCurRect(CurRectType::FlyEmbedded).Width()), convertTwipToMm100(rSh.GetAnyCurRect(CurRectType::FlyEmbedded).Height())); - SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_GRFATR_MIRRORGRF, RES_GRFATR_CROPGRF> ); + SfxItemSetFixed<RES_GRFATR_MIRRORGRF, RES_GRFATR_CROPGRF> aSet( rSh.GetAttrPool() ); rSh.GetCurAttr( aSet ); SwMirrorGrf aMirror( aSet.Get(RES_GRFATR_MIRRORGRF) ); SwCropGrf aCrop( aSet.Get(RES_GRFATR_CROPGRF) ); @@ -258,9 +258,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) const SwViewOption* pVOpt = rSh.GetViewOptions(); SwViewOption aUsrPref( *pVOpt ); - SfxItemSet aSet( - GetPool(), - svl::Items< + SfxItemSetFixed< RES_FRMATR_BEGIN, RES_GRFATR_CROPGRF, // FillAttribute support: XATTR_FILL_FIRST, XATTR_FILL_LAST, @@ -283,7 +281,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) FN_PARAM_GRF_DIALOG, FN_PARAM_GRF_DIALOG, FN_SET_FRM_NAME, FN_KEEP_ASPECT_RATIO, FN_SET_FRM_ALT_NAME, FN_SET_FRM_ALT_NAME, - FN_UNO_DESCRIPTION, FN_UNO_DESCRIPTION>); + FN_UNO_DESCRIPTION, FN_UNO_DESCRIPTION> aSet( GetPool() ); // create needed items for XPropertyList entries from the DrawModel so that // the Area TabPage can access them @@ -366,8 +364,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) // get Mirror and Crop { - SfxItemSet aTmpSet( rSh.GetAttrPool(), - svl::Items<RES_GRFATR_MIRRORGRF, RES_GRFATR_CROPGRF> ); + SfxItemSetFixed<RES_GRFATR_MIRRORGRF, RES_GRFATR_CROPGRF> aTmpSet( rSh.GetAttrPool() ); rSh.GetCurAttr( aTmpSet ); aSet.Put( aTmpSet ); @@ -390,7 +387,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) { // RotGrfFlyFrame: Add current RotationAngle value, convert from // RES_GRFATR_ROTATION to SID_ATTR_TRANSFORM_ANGLE. Do not forget to // convert from 10th degrees to 100th degrees - SfxItemSet aTmpSet( rSh.GetAttrPool(), svl::Items<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION> ); + SfxItemSetFixed<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION> aTmpSet( rSh.GetAttrPool() ); rSh.GetCurAttr( aTmpSet ); const SwRotationGrf& rRotation = aTmpSet.Get(RES_GRFATR_ROTATION); nCurrentRotation = rRotation.GetValue(); @@ -437,11 +434,9 @@ void SwGrfShell::Execute(SfxRequest &rReq) if(pFormat && pFormat->IsAutoUpdateFormat()) { pFormat->SetFormatAttr(*pSet); - SfxItemSet aShellSet( - GetPool(), - svl::Items< + SfxItemSetFixed< RES_FRM_SIZE, RES_FRM_SIZE, - RES_SURROUND, RES_ANCHOR>); + RES_SURROUND, RES_ANCHOR> aShellSet( GetPool() ); aShellSet.Put(*pSet); aMgr.SetAttrSet(aShellSet); } @@ -518,8 +513,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) aMgr.SetRotation(nCurrentRotation, aNewRotation, aUnrotatedSize); } - SfxItemSet aGrfSet( rSh.GetAttrPool(), svl::Items<RES_GRFATR_BEGIN, - RES_GRFATR_END-1> ); + SfxItemSetFixed<RES_GRFATR_BEGIN, RES_GRFATR_END-1> aGrfSet( rSh.GetAttrPool() ); aGrfSet.Put( *pSet ); if( aGrfSet.Count() ) rSh.SetAttrSet( aGrfSet ); @@ -532,7 +526,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) case FN_GRAPHIC_MIRROR_ON_EVEN_PAGES: { - SfxItemSet aSet(rSh.GetAttrPool(), svl::Items<RES_GRFATR_MIRRORGRF, RES_GRFATR_MIRRORGRF>); + SfxItemSetFixed<RES_GRFATR_MIRRORGRF, RES_GRFATR_MIRRORGRF> aSet(rSh.GetAttrPool()); rSh.GetCurAttr( aSet ); SwMirrorGrf aGrf(aSet.Get(RES_GRFATR_MIRRORGRF)); aGrf.SetGrfToggle(!aGrf.IsGrfToggle()); @@ -563,8 +557,7 @@ void SwGrfShell::ExecAttr( SfxRequest const &rReq ) if (GraphicType::Bitmap == nGrfType || GraphicType::GdiMetafile == nGrfType) { - SfxItemSet aGrfSet( GetShell().GetAttrPool(), svl::Items<RES_GRFATR_BEGIN, - RES_GRFATR_END -1> ); + SfxItemSetFixed<RES_GRFATR_BEGIN, RES_GRFATR_END -1> aGrfSet( GetShell().GetAttrPool() ); const SfxItemSet *pArgs = rReq.GetArgs(); const SfxPoolItem* pItem; sal_uInt16 nSlot = rReq.GetSlot(); @@ -933,7 +926,7 @@ void SwGrfShell::ExecuteRotation(SfxRequest const &rReq) return; SwWrtShell& rShell = GetShell(); - SfxItemSet aSet( rShell.GetAttrPool(), svl::Items<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION> ); + SfxItemSetFixed<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION> aSet( rShell.GetAttrPool() ); rShell.GetCurAttr( aSet ); const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION); SwFlyFrameAttrMgr aMgr(false, &rShell, rShell.IsFrameSelected() ? Frmmgr_Type::NONE : Frmmgr_Type::GRF, nullptr); @@ -978,7 +971,7 @@ void SwGrfShell::GetAttrStateForRotation(SfxItemSet &rSet) case SID_ROTATE_GRAPHIC_RESET: { // RotGrfFlyFrame: disable when already no rotation - SfxItemSet aSet( rShell.GetAttrPool(), svl::Items<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION> ); + SfxItemSetFixed<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION> aSet( rShell.GetAttrPool() ); rShell.GetCurAttr( aSet ); const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION); bDisable = (0_deg10 == rRotation.GetValue()); @@ -988,7 +981,7 @@ void SwGrfShell::GetAttrStateForRotation(SfxItemSet &rSet) { // RotGrfFlyFrame: get rotation value from RES_GRFATR_ROTATION and copy to rSet as // SID_ATTR_TRANSFORM_ANGLE, convert from 10th degrees to 100th degrees - SfxItemSet aSet( rShell.GetAttrPool(), svl::Items<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION> ); + SfxItemSetFixed<RES_GRFATR_ROTATION, RES_GRFATR_ROTATION> aSet( rShell.GetAttrPool() ); rShell.GetCurAttr( aSet ); const SwRotationGrf& rRotation = aSet.Get(RES_GRFATR_ROTATION); rSet.Put(SdrAngleItem(SID_ATTR_TRANSFORM_ANGLE, toDegree100(rRotation.GetValue()))); diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index ec69568dad7b..96b5b52e7439 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -353,7 +353,7 @@ void ItemSetToTableParam( const SfxItemSet& rSet, bool bTabCols = false; SwTableRep* pRep = nullptr; SwFrameFormat *pFormat = rSh.GetTableFormat(); - SfxItemSet aSet( rSh.GetAttrPool(), svl::Items<RES_FRMATR_BEGIN, RES_FRMATR_END-1> ); + SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1> aSet( rSh.GetAttrPool() ); if(SfxItemState::SET == rSet.GetItemState( FN_TABLE_REP, false, &pItem )) { pRep = static_cast<SwTableRep*>(static_cast<const SwPtrItem*>(pItem)->GetValue()); @@ -465,9 +465,9 @@ void SwTableShell::Execute(SfxRequest &rReq) break; // Create items, because we have to rework anyway. std::shared_ptr<SvxBoxItem> aBox(std::make_shared<SvxBoxItem>(RES_BOX)); - SfxItemSet aCoreSet( GetPool(), - svl::Items<RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>); + SfxItemSetFixed<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> + aCoreSet( GetPool() ); SvxBoxInfoItem aCoreInfo( SID_ATTR_BORDER_INNER ); aCoreSet.Put(aCoreInfo); rSh.GetTabBorders( aCoreSet ); @@ -657,15 +657,12 @@ void SwTableShell::Execute(SfxRequest &rReq) FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( pView) != nullptr ); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); SvNumberFormatter* pFormatter = rSh.GetNumberFormatter(); - SfxItemSet aCoreSet( - GetPool(), - svl::Items< - SID_ATTR_NUMBERFORMAT_VALUE, - SID_ATTR_NUMBERFORMAT_INFO>); - - SfxItemSet aBoxSet( *aCoreSet.GetPool(), - svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_FORMAT, - RES_BOXATR_VALUE, RES_BOXATR_VALUE> ); + SfxItemSetFixed<SID_ATTR_NUMBERFORMAT_VALUE, SID_ATTR_NUMBERFORMAT_INFO> + aCoreSet( GetPool() ); + + SfxItemSetFixed<RES_BOXATR_FORMAT, RES_BOXATR_FORMAT, + RES_BOXATR_VALUE, RES_BOXATR_VALUE> + aBoxSet( *aCoreSet.GetPool() ); rSh.GetTableBoxFormulaAttrs( aBoxSet ); SfxItemState eState = aBoxSet.GetItemState(RES_BOXATR_FORMAT); @@ -703,8 +700,8 @@ void SwTableShell::Execute(SfxRequest &rReq) if( SfxItemState::SET == pDlg->GetOutputItemSet()->GetItemState( SID_ATTR_NUMBERFORMAT_VALUE, false, &pNumberFormatValueItem )) { - SfxItemSet aBoxFormatSet( *aCoreSet.GetPool(), - svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_FORMAT> ); + SfxItemSetFixed<RES_BOXATR_FORMAT, RES_BOXATR_FORMAT> + aBoxFormatSet( *aCoreSet.GetPool() ); aBoxFormatSet.Put( SwTableBoxNumFormat( static_cast<const SfxUInt32Item*>(pNumberFormatValueItem)->GetValue() )); rSh.SetTableBoxFormulaAttrs( aBoxFormatSet ); @@ -935,8 +932,7 @@ void SwTableShell::Execute(SfxRequest &rReq) if ( bSetInnerBorders ) { const SvxBoxInfoItem& aBoxInfo(aCoreSet.Get(SID_ATTR_BORDER_INNER)); - SfxItemSet aSet( GetPool(), svl::Items<SID_ATTR_BORDER_INNER, - SID_ATTR_BORDER_INNER>); + SfxItemSetFixed<SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> aSet( GetPool() ); aSet.Put( aBoxInfo ); ItemSetToTableParam( aSet, rSh ); rSh.EndUndo( nUndoId ); @@ -1183,8 +1179,8 @@ void SwTableShell::Execute(SfxRequest &rReq) case SID_ATTR_LRSPACE: if(pItem) { - SfxItemSet aSet( GetPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE, - RES_HORI_ORIENT, RES_HORI_ORIENT> ); + SfxItemSetFixed<RES_LR_SPACE, RES_LR_SPACE, + RES_HORI_ORIENT, RES_HORI_ORIENT> aSet( GetPool() ); SvxLRSpaceItem aLRSpace( *static_cast<const SvxLRSpaceItem*>(pItem) ); aLRSpace.SetWhich( RES_LR_SPACE ); aSet.Put( aLRSpace ); @@ -1215,7 +1211,7 @@ void SwTableShell::Execute(SfxRequest &rReq) if ( pItem ) { SwFormatLayoutSplit aSplit( static_cast<const SvxFormatSplitItem*>(pItem)->GetValue()); - SfxItemSet aSet(GetPool(), svl::Items<RES_LAYOUT_SPLIT, RES_LAYOUT_SPLIT> ); + SfxItemSetFixed<RES_LAYOUT_SPLIT, RES_LAYOUT_SPLIT> aSet(GetPool()); aSet.Put(aSplit); rSh.SetTableAttr(aSet); } @@ -1226,7 +1222,7 @@ void SwTableShell::Execute(SfxRequest &rReq) { SvxFormatKeepItem aKeep( *static_cast<const SvxFormatKeepItem*>(pItem) ); aKeep.SetWhich( RES_KEEP ); - SfxItemSet aSet(GetPool(), svl::Items<RES_KEEP, RES_KEEP> ); + SfxItemSetFixed<RES_KEEP, RES_KEEP> aSet(GetPool()); aSet.Put(aKeep); rSh.SetTableAttr(aSet); } @@ -1495,9 +1491,8 @@ SwTableShell::SwTableShell(SwView &_rView) : void SwTableShell::GetFrameBorderState(SfxItemSet &rSet) { - SfxItemSet aCoreSet( GetPool(), - svl::Items<RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> ); + SfxItemSetFixed<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> aCoreSet( GetPool() ); SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); aCoreSet.Put( aBoxInfo ); GetShell().GetTabBorders( aCoreSet ); @@ -1535,9 +1530,8 @@ void SwTableShell::ExecTableStyle(SfxRequest& rReq) void SwTableShell::GetLineStyleState(SfxItemSet &rSet) { - SfxItemSet aCoreSet( GetPool(), - svl::Items<RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>); + SfxItemSetFixed<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> aCoreSet( GetPool() ); SvxBoxInfoItem aCoreInfo( SID_ATTR_BORDER_INNER ); aCoreSet.Put(aCoreInfo); GetShell().GetTabBorders( aCoreSet ); @@ -1610,7 +1604,7 @@ void SwTableShell::ExecNumberFormat(SfxRequest const & rReq) if( NUMBERFORMAT_ENTRY_NOT_FOUND != nNumberFormat ) { - SfxItemSet aBoxSet( GetPool(), svl::Items<RES_BOXATR_FORMAT, RES_BOXATR_FORMAT> ); + SfxItemSetFixed<RES_BOXATR_FORMAT, RES_BOXATR_FORMAT> aBoxSet( GetPool() ); aBoxSet.Put( SwTableBoxNumFormat( nNumberFormat )); rSh.SetTableBoxFormulaAttrs( aBoxSet ); } diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index e107a86d34f0..ee20d9c74f65 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -986,7 +986,7 @@ void SwTextShell::InsertHyperlink(const SvxHyperlinkItem& rHlnkItem) return; rSh.StartAction(); - SfxItemSet aSet(GetPool(), svl::Items<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT>); + SfxItemSetFixed<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT> aSet(GetPool()); rSh.GetCurAttr( aSet ); const SfxPoolItem* pItem; diff --git a/sw/source/uibase/shells/textidx.cxx b/sw/source/uibase/shells/textidx.cxx index a9eb7921e66c..590b9fa82f0b 100644 --- a/sw/source/uibase/shells/textidx.cxx +++ b/sw/source/uibase/shells/textidx.cxx @@ -92,16 +92,14 @@ void SwTextShell::ExecIdx(SfxRequest const &rReq) } case FN_INSERT_MULTI_TOX: { - SfxItemSet aSet( - GetPool(), - svl::Items< + SfxItemSetFixed< RES_FRM_SIZE, RES_FRM_SIZE, RES_LR_SPACE, RES_LR_SPACE, RES_BACKGROUND, RES_BACKGROUND, RES_COL, RES_COL, XATTR_FILL_FIRST, XATTR_FILL_LAST, SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, - FN_PARAM_TOX_TYPE, FN_PARAM_TOX_TYPE>); + FN_PARAM_TOX_TYPE, FN_PARAM_TOX_TYPE> aSet( GetPool() ); 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 76be2461935a..eece3fcf4588 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -633,7 +633,7 @@ void SwTextShell::StateInsert( SfxItemSet &rSet ) case SID_HYPERLINK_GETLINK: { - SfxItemSet aSet(GetPool(), svl::Items<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT>); + SfxItemSetFixed<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT> aSet(GetPool()); rSh.GetCurAttr( aSet ); SvxHyperlinkItem aHLinkItem; @@ -892,9 +892,9 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) } SwWrtShell &rSh = GetShell(); - 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> ); + SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONT, + RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT, + RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONT> aSet( GetPool() ); rSh.GetCurAttr( aSet ); SvtScriptType nScript = rSh.GetScriptType(); @@ -984,9 +984,9 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) aNewFontItem->SetPitch( aNewFont.GetPitch()); aNewFontItem->SetCharSet( aNewFont.GetCharSet() ); - 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> ); + SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONT, + RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT, + RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONT> aRestoreSet( GetPool() ); 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 c60e3bd32adc..f59a4fe551e0 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -116,9 +116,7 @@ static void sw_CharDialog(SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot, { FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( &rWrtSh.GetView()) != nullptr ); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); - auto pCoreSet = std::make_shared<SfxItemSet>( - rWrtSh.GetView().GetPool(), - svl::Items< + auto pCoreSet = std::make_shared<SfxItemSetFixed< RES_CHRATR_BEGIN, RES_CHRATR_END - 1, RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, RES_BACKGROUND, RES_SHADOW, @@ -126,7 +124,7 @@ static void sw_CharDialog(SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot, SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, SID_HTML_MODE, SID_HTML_MODE, SID_ATTR_CHAR_WIDTH_FIT_TO_LINE, SID_ATTR_CHAR_WIDTH_FIT_TO_LINE, - FN_PARAM_SELECTION, FN_PARAM_SELECTION>); + FN_PARAM_SELECTION, FN_PARAM_SELECTION>> ( rWrtSh.GetView().GetPool() ); rWrtSh.GetCurAttr(*pCoreSet); bool bSel = rWrtSh.HasSelection(); @@ -469,10 +467,10 @@ void SwTextShell::Execute(SfxRequest &rReq) static const OUStringLiteral aParagraphLangPrefix(u"Paragraph_"); static const OUStringLiteral aDocumentLangPrefix(u"Default_"); - SfxItemSet aCoreSet( GetPool(), - svl::Items<RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE, + SfxItemSetFixed + <RES_CHRATR_LANGUAGE, RES_CHRATR_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE, - RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE> ); + RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE> aCoreSet( GetPool() ); sal_Int32 nPos = 0; bool bForSelection = true; @@ -574,7 +572,7 @@ void SwTextShell::Execute(SfxRequest &rReq) if ( bFont ) { rWrtSh.Left( CRSR_SKIP_CHARS, true, 1, false ); - SfxItemSet aSet( rWrtSh.GetAttrPool(), svl::Items<RES_CHRATR_FONT, RES_CHRATR_FONT> ); + SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONT> aSet( rWrtSh.GetAttrPool() ); rWrtSh.GetCurAttr( aSet ); rWrtSh.SetAttrSet( aSet, SetAttrMode::DONTEXPAND ); rWrtSh.ResetSelect(nullptr, false); @@ -878,7 +876,7 @@ void SwTextShell::Execute(SfxRequest &rReq) { if( rWrtSh.IsCursorInTable() ) { - SfxItemSet aSet( rWrtSh.GetAttrPool(), svl::Items<RES_BOXATR_FORMULA, RES_BOXATR_FORMULA> ); + SfxItemSetFixed<RES_BOXATR_FORMULA, RES_BOXATR_FORMULA> aSet( rWrtSh.GetAttrPool() ); aSet.Put( SwTableBoxFormula( sFormula )); rWrtSh.SetTableBoxFormulaAttrs( aSet ); rWrtSh.UpdateTable(); @@ -1000,9 +998,7 @@ void SwTextShell::Execute(SfxRequest &rReq) bool bApplyCharUnit = ::HasCharUnit( dynamic_cast<SwWebView*>( &GetView()) != nullptr ); SW_MOD()->PutItem(SfxBoolItem(SID_ATTR_APPLYCHARUNIT, bApplyCharUnit)); - SfxItemSet aCoreSet( - GetPool(), - svl::Items< + SfxItemSetFixed< RES_PARATR_BEGIN, RES_FRMATR_END - 1, // FillAttribute support: XATTR_FILL_FIRST, XATTR_FILL_LAST, @@ -1018,7 +1014,7 @@ void SwTextShell::Execute(SfxRequest &rReq) SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM, FN_PARAM_1, FN_PARAM_1, FN_NUMBER_NEWSTART, FN_NUMBER_NEWSTART_AT, - FN_DROP_TEXT, FN_DROP_CHAR_STYLE_NAME>); + FN_DROP_TEXT, FN_DROP_CHAR_STYLE_NAME> aCoreSet( GetPool() ); // get also the list level indent values merged as LR-SPACE item, if needed. rWrtSh.GetPaMAttr( pPaM, aCoreSet, true ); @@ -1135,7 +1131,7 @@ void SwTextShell::Execute(SfxRequest &rReq) if (pTempGradItem && pTempGradItem->GetName().isEmpty()) { // MigrateItemSet guarantees unique gradient names - SfxItemSet aMigrateSet(rWrtSh.GetView().GetPool(), svl::Items<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT>); + SfxItemSetFixed<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT> aMigrateSet(rWrtSh.GetView().GetPool()); aMigrateSet.Put(XFillGradientItem("gradient", pTempGradItem->GetGradientValue())); SdrModel::MigrateItemSet(&aMigrateSet, pSet, pDrawModel); } @@ -1143,7 +1139,7 @@ void SwTextShell::Execute(SfxRequest &rReq) const XFillHatchItem* pTempHatchItem = pSet->GetItem<XFillHatchItem>(XATTR_FILLHATCH); if (pTempHatchItem && pTempHatchItem->GetName().isEmpty()) { - SfxItemSet aMigrateSet(rWrtSh.GetView().GetPool(), svl::Items<XATTR_FILLHATCH, XATTR_FILLHATCH>); + SfxItemSetFixed<XATTR_FILLHATCH, XATTR_FILLHATCH> aMigrateSet(rWrtSh.GetView().GetPool()); aMigrateSet.Put(XFillHatchItem("hatch", pTempHatchItem->GetHatchValue())); SdrModel::MigrateItemSet(&aMigrateSet, pSet, pDrawModel); } @@ -1285,8 +1281,7 @@ void SwTextShell::Execute(SfxRequest &rReq) { if (nSlot != SID_ATTR_CHAR_COLOR_EXT) { - SfxItemSet aCoreSet( rWrtSh.GetView().GetPool(), svl::Items< - RES_CHRATR_BACKGROUND, RES_CHRATR_BACKGROUND> ); + SfxItemSetFixed<RES_CHRATR_BACKGROUND, RES_CHRATR_BACKGROUND> aCoreSet( rWrtSh.GetView().GetPool() ); rWrtSh.GetCurAttr( aCoreSet ); @@ -1379,9 +1374,7 @@ void SwTextShell::Execute(SfxRequest &rReq) case SID_OPEN_HYPERLINK: case SID_COPY_HYPERLINK_LOCATION: { - SfxItemSet aSet(GetPool(), - svl::Items<RES_TXTATR_INETFMT, - RES_TXTATR_INETFMT>); + SfxItemSetFixed<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT> aSet(GetPool()); rWrtSh.GetCurAttr(aSet); if(SfxItemState::SET <= aSet.GetItemState( RES_TXTATR_INETFMT )) { @@ -1995,9 +1988,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) case SID_EDIT_HYPERLINK: case SID_COPY_HYPERLINK_LOCATION: { - SfxItemSet aSet(GetPool(), - svl::Items<RES_TXTATR_INETFMT, - RES_TXTATR_INETFMT>); + SfxItemSetFixed<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT> aSet(GetPool()); rSh.GetCurAttr(aSet); if(SfxItemState::SET > aSet.GetItemState( RES_TXTATR_INETFMT ) || rSh.HasReadonlySel()) { @@ -2007,9 +1998,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) break; case SID_REMOVE_HYPERLINK: { - SfxItemSet aSet(GetPool(), - svl::Items<RES_TXTATR_INETFMT, - RES_TXTATR_INETFMT>); + SfxItemSetFixed<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT> aSet(GetPool()); rSh.GetCurAttr(aSet); // If a hyperlink is selected, either alone or along with other text... @@ -2049,9 +2038,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) break; case SID_OPEN_HYPERLINK: { - SfxItemSet aSet(GetPool(), - svl::Items<RES_TXTATR_INETFMT, - RES_TXTATR_INETFMT>); + SfxItemSetFixed<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT> aSet(GetPool()); rSh.GetCurAttr(aSet); bool bAuthorityFieldURL = false; @@ -2206,7 +2193,7 @@ void SwTextShell::GetState( SfxItemSet &rSet ) bool bDisable = false; // First get the state from the form shell - SfxItemSet aSet(GetShell().GetAttrPool(), svl::Items<SID_FM_CTL_PROPERTIES, SID_FM_CTL_PROPERTIES>); + SfxItemSetFixed<SID_FM_CTL_PROPERTIES, SID_FM_CTL_PROPERTIES> aSet(GetShell().GetAttrPool()); aSet.Put(SfxBoolItem( SID_FM_CTL_PROPERTIES, true )); GetShell().GetView().GetFormShell()->GetState( aSet ); diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx index a4f24c0708f7..f8c7b8d3e24f 100644 --- a/sw/source/uibase/shells/txtattr.cxx +++ b/sw/source/uibase/shells/txtattr.cxx @@ -72,7 +72,7 @@ void SwTextShell::ExecCharAttr(SfxRequest &rReq) Get( nWhich )).GetValue() ? STATE_ON : STATE_OFF; } - SfxItemSet aSet( GetPool(), svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1> ); + SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END-1> aSet( GetPool() ); if (STATE_TOGGLE == eState) rSh.GetCurAttr( aSet ); @@ -319,9 +319,9 @@ void SwTextShell::ExecParaAttr(SfxRequest &rReq) const SfxItemSet* pArgs = rReq.GetArgs(); // Get both attributes immediately isn't more expensive!! - SfxItemSet aSet( GetPool(), - svl::Items<RES_PARATR_LINESPACING, RES_PARATR_ADJUST, - RES_FRAMEDIR, RES_FRAMEDIR> ); + SfxItemSetFixed + <RES_PARATR_LINESPACING, RES_PARATR_ADJUST, + RES_FRAMEDIR, RES_FRAMEDIR> aSet( GetPool() ); sal_uInt16 nSlot = rReq.GetSlot(); switch (nSlot) @@ -381,8 +381,7 @@ SET_LINESPACE: case SID_ATTR_PARA_LEFT_TO_RIGHT : case SID_ATTR_PARA_RIGHT_TO_LEFT : { - SfxItemSet aAdjustSet( GetPool(), - svl::Items<RES_PARATR_ADJUST, RES_PARATR_ADJUST> ); + SfxItemSetFixed<RES_PARATR_ADJUST, RES_PARATR_ADJUST> aAdjustSet( GetPool() ); GetShell().GetCurAttr(aAdjustSet); bool bChgAdjust = false; SfxItemState eAdjustState = aAdjustSet.GetItemState(RES_PARATR_ADJUST, false); @@ -467,7 +466,7 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq) if( pItem ) { OUString sCharStyleName = static_cast<const SfxStringItem*>(pItem)->GetValue(); - SfxItemSet aSet(GetPool(), svl::Items<RES_PARATR_DROP, RES_PARATR_DROP>); + SfxItemSetFixed<RES_PARATR_DROP, RES_PARATR_DROP> aSet(GetPool()); rSh.GetCurAttr(aSet); SwFormatDrop aDropItem(aSet.Get(RES_PARATR_DROP)); SwCharFormat* pFormat = nullptr; @@ -487,8 +486,8 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq) } else { - SfxItemSet aSet(GetPool(), svl::Items<RES_PARATR_DROP, RES_PARATR_DROP, - HINT_END, HINT_END>); + SfxItemSetFixed<RES_PARATR_DROP, RES_PARATR_DROP, + HINT_END, HINT_END> aSet(GetPool()); rSh.GetCurAttr(aSet); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSwDropCapsDialog(GetView().GetFrameWeld(), aSet)); @@ -520,9 +519,8 @@ void SwTextShell::ExecParaAttrArgs(SfxRequest &rReq) { if(pItem) { - SfxItemSet aCoreSet( GetPool(), - svl::Items<RES_PAGEDESC, RES_PAGEDESC, - SID_ATTR_PARA_MODEL, SID_ATTR_PARA_MODEL>); + SfxItemSetFixed<RES_PAGEDESC, RES_PAGEDESC, + SID_ATTR_PARA_MODEL, SID_ATTR_PARA_MODEL> aCoreSet( GetPool() ); aCoreSet.Put(*pItem); SfxToSwPageDescAttr( rSh, aCoreSet); rSh.SetAttrSet(aCoreSet); @@ -806,9 +804,9 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) break; case SID_ATTR_PARA_MODEL: { - SfxItemSet aTemp(GetPool(), - svl::Items<RES_PAGEDESC,RES_PAGEDESC, - SID_ATTR_PARA_MODEL,SID_ATTR_PARA_MODEL>); + SfxItemSetFixed + <RES_PAGEDESC,RES_PAGEDESC, + SID_ATTR_PARA_MODEL,SID_ATTR_PARA_MODEL> aTemp(GetPool()); aTemp.Put(aCoreSet); ::SwToSfxPageDescAttr(aTemp); rSet.Put(aTemp.Get(SID_ATTR_PARA_MODEL)); @@ -817,7 +815,7 @@ void SwTextShell::GetAttrState(SfxItemSet &rSet) break; case RES_TXTATR_INETFMT: { - SfxItemSet aSet(GetPool(), svl::Items<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT>); + SfxItemSetFixed<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT> aSet(GetPool()); 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 8e1b1de09cc0..88daf7482267 100644 --- a/sw/source/uibase/shells/txtnum.cxx +++ b/sw/source/uibase/shells/txtnum.cxx @@ -120,9 +120,8 @@ void SwTextShell::ExecEnterNum(SfxRequest &rReq) case FN_NUMBER_BULLETS: case SID_OUTLINE_BULLET: { - SfxItemSet aSet( GetPool(), - svl::Items<SID_HTML_MODE, SID_HTML_MODE, - SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL> ); + SfxItemSetFixed<SID_HTML_MODE, SID_HTML_MODE, + SID_ATTR_NUMBERING_RULE, SID_PARAM_CUR_NUM_LEVEL> aSet( GetPool() ); 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 ad3066f63cf5..b71733a6e4ea 100644 --- a/sw/source/uibase/uiview/formatclipboard.cxx +++ b/sw/source/uibase/uiview/formatclipboard.cxx @@ -47,9 +47,7 @@ std::unique_ptr<SfxItemSet> lcl_CreateEmptyItemSet( SelectionType nSelectionType std::unique_ptr<SfxItemSet> pItemSet; if( nSelectionType & (SelectionType::Frame | SelectionType::Ole | SelectionType::Graphic) ) { - pItemSet = std::make_unique<SfxItemSet>( - rPool, - svl::Items< + pItemSet = std::make_unique<SfxItemSetFixed< RES_FRMATR_BEGIN, RES_FILL_ORDER, // no RES_FRM_SIZE RES_PAPER_BIN, RES_SURROUND, @@ -62,7 +60,7 @@ std::unique_ptr<SfxItemSet> lcl_CreateEmptyItemSet( SelectionType nSelectionType // 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>>(rPool); } else if( nSelectionType & SelectionType::DrawObject ) { @@ -71,12 +69,10 @@ std::unique_ptr<SfxItemSet> lcl_CreateEmptyItemSet( SelectionType nSelectionType else if( nSelectionType & SelectionType::Text ) { if( bNoParagraphFormats ) - pItemSet = std::make_unique<SfxItemSet>(rPool, - svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END - 1>); + pItemSet = std::make_unique<SfxItemSetFixed + <RES_CHRATR_BEGIN, RES_CHRATR_END - 1>>(rPool); else - pItemSet = std::make_unique<SfxItemSet>( - rPool, - svl::Items< + pItemSet = std::make_unique<SfxItemSetFixed< RES_CHRATR_BEGIN, RES_CHRATR_END - 1, RES_PARATR_BEGIN, RES_FILL_ORDER, // no RES_FRM_SIZE @@ -90,7 +86,7 @@ std::unique_ptr<SfxItemSet> lcl_CreateEmptyItemSet( SelectionType nSelectionType // 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>>(rPool); } return pItemSet; } @@ -377,9 +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 = std::make_unique<SfxItemSet>( - rPool, - svl::Items< + m_pTableItemSet = std::make_unique<SfxItemSetFixed< RES_PAGEDESC, RES_BREAK, RES_BACKGROUND, RES_SHADOW, // RES_BOX is inbetween RES_KEEP, RES_KEEP, @@ -391,7 +385,7 @@ void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bP SID_ATTR_BRUSH_ROW, SID_ATTR_BRUSH_TABLE, FN_TABLE_SET_VERT_ALIGN, FN_TABLE_SET_VERT_ALIGN, FN_TABLE_BOX_TEXTORIENTATION, FN_TABLE_BOX_TEXTORIENTATION, - FN_PARAM_TABLE_HEADLINE, FN_PARAM_TABLE_HEADLINE>); + FN_PARAM_TABLE_HEADLINE, FN_PARAM_TABLE_HEADLINE>>(rPool); lcl_getTableAttributes( *m_pTableItemSet, rWrtShell ); } diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 95845f888435..dd88a912b10e 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -725,7 +725,7 @@ void SwPagePreview::Execute( SfxRequest &rReq ) ScopedVclPtr<AbstractSvxZoomDialog> pDlg; if(!pArgs) { - SfxItemSet aCoreSet(GetPool(), svl::Items<SID_ATTR_ZOOM, SID_ATTR_ZOOM>); + SfxItemSetFixed<SID_ATTR_ZOOM, SID_ATTR_ZOOM> aCoreSet(GetPool()); const SwViewOption* pVOpt = GetViewShell()->GetViewOptions(); SvxZoomItem aZoom( pVOpt->GetZoomType(), pVOpt->GetZoom() ); aZoom.SetValueSet( @@ -1032,7 +1032,7 @@ void SwPagePreview::GetState( SfxItemSet& rSet ) // has the same status like the normal printing { const SfxPoolItem* pItem; - SfxItemSet aSet( *rSet.GetPool(), svl::Items<SID_PRINTDOC, SID_PRINTDOC> ); + SfxItemSetFixed<SID_PRINTDOC, SID_PRINTDOC> aSet( *rSet.GetPool() ); 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 2cced1e2e008..b9d04202d607 100644 --- a/sw/source/uibase/uiview/view0.cxx +++ b/sw/source/uibase/uiview/view0.cxx @@ -683,7 +683,7 @@ void SwView::ExecFormatFootnote() void SwView::ExecNumberingOutline(SfxItemPool & rPool) { - SfxItemSet aTmp(rPool, svl::Items<FN_PARAM_1, FN_PARAM_1>); + SfxItemSetFixed<FN_PARAM_1, FN_PARAM_1> aTmp(rPool); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateOutlineTabDialog(GetFrameWeld(), &aTmp, GetWrtShell())); pDlg->Execute(); diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index e867c27bd71f..61a292279b58 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -1731,8 +1731,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) { if(!pNumRule->IsAutoRule()) { - SfxItemSet aSet(GetPool(), - svl::Items<RES_PARATR_NUMRULE, RES_PARATR_NUMRULE>); + SfxItemSetFixed<RES_PARATR_NUMRULE, RES_PARATR_NUMRULE> aSet(GetPool()); rShell.GetCurAttr(aSet); if(SfxItemState::DEFAULT <= aSet.GetItemState(RES_PARATR_NUMRULE)) @@ -1867,7 +1866,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) else { const SwViewOption& rViewOptions = *rSh.GetViewOptions(); - SfxItemSet aCoreSet(m_pShell->GetPool(), svl::Items<SID_ATTR_ZOOM, SID_ATTR_ZOOM, SID_ATTR_VIEWLAYOUT, SID_ATTR_VIEWLAYOUT> ); + SfxItemSetFixed<SID_ATTR_ZOOM, SID_ATTR_ZOOM, SID_ATTR_VIEWLAYOUT, SID_ATTR_VIEWLAYOUT> aCoreSet(m_pShell->GetPool()); 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 e45bc9adbe35..5b5799123708 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -735,8 +735,7 @@ bool SwView::IsDrawTextHyphenate() SdrView *pSdrView = m_pWrtShell->GetDrawView(); bool bHyphenate = false; - SfxItemSet aNewAttr( pSdrView->GetModel()->GetItemPool(), - svl::Items<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE> ); + SfxItemSetFixed<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE> aNewAttr( pSdrView->GetModel()->GetItemPool() ); pSdrView->GetAttributes( aNewAttr ); if( aNewAttr.GetItemState( EE_PARA_HYPHENATE ) >= SfxItemState::DEFAULT ) bHyphenate = aNewAttr.Get( EE_PARA_HYPHENATE ).GetValue(); @@ -749,7 +748,7 @@ void SwView::HyphenateDrawText() SdrView *pSdrView = m_pWrtShell->GetDrawView(); bool bHyphenate = IsDrawTextHyphenate(); - SfxItemSet aSet( GetPool(), svl::Items<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE> ); + SfxItemSetFixed<EE_PARA_HYPHENATE, EE_PARA_HYPHENATE> aSet( GetPool() ); 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 1921c30d045a..038d9a722df3 100644 --- a/sw/source/uibase/uiview/viewprt.cxx +++ b/sw/source/uibase/uiview/viewprt.cxx @@ -324,13 +324,11 @@ void SetAppPrintOptions( SwViewShell* pSh, bool bWeb ) // Close application own printing options in SfxPrinter. SwAddPrinterItem aAddPrinterItem(aPrtData); - SfxItemSet aSet( - pSh->GetAttrPool(), - svl::Items< + SfxItemSetFixed< SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, SID_HTML_MODE, SID_HTML_MODE, - FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER>); + FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER> aSet( pSh->GetAttrPool() ); if(bWeb) aSet.Put(SfxUInt16Item(SID_HTML_MODE, diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index bce40514f752..d1f02ab5d196 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -282,9 +282,9 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) rRect.Right() - rPageRect.Right() + aLongLR.GetRight() : rPageRect.Left() + aLongLR.GetLeft() - rRect.Left(); - SfxItemSet aSet( GetPool(), svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, - RES_VERT_ORIENT, RES_HORI_ORIENT, - RES_COL, RES_COL> ); + SfxItemSetFixed<RES_FRM_SIZE, RES_FRM_SIZE, + RES_VERT_ORIENT, RES_HORI_ORIENT, + RES_COL, RES_COL> aSet( GetPool() ); if(bVerticalFrame) { @@ -375,7 +375,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) SvxLRSpaceItem aLRTmp = pSectFormat->GetLRSpace(); aLRTmp.SetLeft(aLRTmp.GetLeft() + nLeftDiff); aLRTmp.SetRight(aLRTmp.GetRight() + nRightDiff); - SfxItemSet aSet(rSh.GetAttrPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE, RES_COL, RES_COL>); + SfxItemSetFixed<RES_LR_SPACE, RES_LR_SPACE, RES_COL, RES_COL> aSet(rSh.GetAttrPool()); aSet.Put(aLRTmp); //change the first/last column if(bSect) @@ -431,8 +431,8 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) const tools::Long nDeltaY = rPageRect.Top() + aLongULSpace.GetUpper() - rRect.Top(); const tools::Long nHeight = nPageHeight - (aLongULSpace.GetUpper() + aLongULSpace.GetLower()); - SfxItemSet aSet( GetPool(), svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, - RES_VERT_ORIENT, RES_HORI_ORIENT> ); + SfxItemSetFixed<RES_FRM_SIZE, RES_FRM_SIZE, + RES_VERT_ORIENT, RES_HORI_ORIENT> aSet( GetPool() ); //which of the orientation attributes is to be put depends on the frame's environment bool bRTL; bool bVertL2R; @@ -488,7 +488,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) SvxLRSpaceItem aLR = pSectFormat->GetLRSpace(); aLR.SetLeft(aLR.GetLeft() + nLeftDiff); aLR.SetRight(aLR.GetRight() + nRightDiff); - SfxItemSet aSet(rSh.GetAttrPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE, RES_COL, RES_COL>); + SfxItemSetFixed<RES_LR_SPACE, RES_LR_SPACE, RES_COL, RES_COL> aSet(rSh.GetAttrPool()); aSet.Put(aLR); //change the first/last column if(bSect) @@ -628,7 +628,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) const SvxTabStopItem& rDefTabs = rSh.GetDefault(RES_PARATR_TABSTOP); // Default tab at pos 0 - SfxItemSet aSet( GetPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE> ); + SfxItemSetFixed<RES_LR_SPACE, RES_LR_SPACE> aSet( GetPool() ); rSh.GetCurAttr( aSet ); const SvxLRSpaceItem& rLR = aSet.Get(RES_LR_SPACE); @@ -644,7 +644,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) SwTextFormatColl* pColl = rSh.GetCurTextFormatColl(); if( pColl && pColl->IsAutoUpdateFormat() ) { - SfxItemSet aTmp(GetPool(), svl::Items<RES_PARATR_TABSTOP, RES_PARATR_TABSTOP>); + SfxItemSetFixed<RES_PARATR_TABSTOP, RES_PARATR_TABSTOP> aTmp(GetPool()); aTmp.Put(aTabStops); rSh.AutoUpdatePara( pColl, aTmp ); } @@ -664,7 +664,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) - SfxItemSet aItemSet(GetPool(), svl::Items<RES_PARATR_TABSTOP, RES_PARATR_TABSTOP>); + SfxItemSetFixed<RES_PARATR_TABSTOP, RES_PARATR_TABSTOP> aItemSet(GetPool()); rSh.GetCurAttr(aItemSet); SvxTabStopItem aTabStopItem(aItemSet.Get(RES_PARATR_TABSTOP)); lcl_EraseDefTabs(aTabStopItem); @@ -706,7 +706,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) const SfxPoolItem *fLineIndent, *pLeftIndent, *pRightIndent; if (pReqArgs) { - SfxItemSet aLRSpaceSet( GetPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE> ); + SfxItemSetFixed<RES_LR_SPACE, RES_LR_SPACE> aLRSpaceSet( GetPool() ); rSh.GetCurAttr( aLRSpaceSet ); SvxLRSpaceItem aParaMargin( aLRSpaceSet.Get( RES_LR_SPACE ) ); @@ -731,7 +731,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) } case SID_HANGING_INDENT: { - SfxItemSet aLRSpaceSet( GetPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE> ); + SfxItemSetFixed<RES_LR_SPACE, RES_LR_SPACE> aLRSpaceSet( GetPool() ); rSh.GetCurAttr( aLRSpaceSet ); SvxLRSpaceItem aParaMargin( aLRSpaceSet.Get( RES_LR_SPACE ) ); @@ -761,7 +761,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) { // --> #i42922# Mouse move of numbering label // has to consider the left indent of the paragraph - SfxItemSet aSet( GetPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE> ); + SfxItemSetFixed<RES_LR_SPACE, RES_LR_SPACE> aSet( GetPool() ); rSh.GetCurAttr( aSet ); const SvxLRSpaceItem& rLR = aSet.Get(RES_LR_SPACE); @@ -774,7 +774,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) } else if( pColl && pColl->IsAutoUpdateFormat() ) { - SfxItemSet aSet(GetPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE>); + SfxItemSetFixed<RES_LR_SPACE, RES_LR_SPACE> aSet(GetPool()); aSet.Put(aParaMargin); rSh.AutoUpdatePara( pColl, aSet); } @@ -783,7 +783,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) if ( aParaMargin.GetTextFirstLineOffset() < 0 ) { - SfxItemSet aSet( GetPool(), svl::Items<RES_PARATR_TABSTOP, RES_PARATR_TABSTOP> ); + SfxItemSetFixed<RES_PARATR_TABSTOP, RES_PARATR_TABSTOP> aSet( GetPool() ); rSh.GetCurAttr( aSet ); const SvxTabStopItem& rTabStops = aSet.Get(RES_PARATR_TABSTOP); @@ -810,7 +810,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) if( pColl && pColl->IsAutoUpdateFormat()) { - SfxItemSet aSetTmp(GetPool(), svl::Items<RES_PARATR_TABSTOP, RES_PARATR_TABSTOP>); + SfxItemSetFixed<RES_PARATR_TABSTOP, RES_PARATR_TABSTOP> aSetTmp(GetPool()); aSetTmp.Put(*aTabStops); rSh.AutoUpdatePara( pColl, aSetTmp ); } @@ -833,7 +833,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) SwTextFormatColl* pColl = rSh.GetCurTextFormatColl(); if( pColl && pColl->IsAutoUpdateFormat() ) { - SfxItemSet aSet(GetPool(), svl::Items<RES_UL_SPACE, RES_UL_SPACE>); + SfxItemSetFixed<RES_UL_SPACE, RES_UL_SPACE> aSet(GetPool()); aSet.Put(aParaMargin); rSh.AutoUpdatePara( pColl, aSet); } @@ -844,7 +844,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) case SID_PARASPACE_INCREASE: case SID_PARASPACE_DECREASE: { - SfxItemSet aULSpaceSet( GetPool(), svl::Items<RES_UL_SPACE, RES_UL_SPACE> ); + SfxItemSetFixed<RES_UL_SPACE, RES_UL_SPACE> aULSpaceSet( GetPool() ); rSh.GetCurAttr( aULSpaceSet ); SvxULSpaceItem aULSpace( aULSpaceSet.Get( RES_UL_SPACE ) ); sal_uInt16 nUpper = aULSpace.GetUpper(); @@ -966,7 +966,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) if ( bFrameSelection || nFrameType & FrameTypeFlags::FLY_ANY || bSect) { SwSectionFormat *pSectFormat = nullptr; - SfxItemSet aSet( GetPool(), svl::Items<RES_COL, RES_COL> ); + SfxItemSetFixed<RES_COL, RES_COL> aSet( GetPool() ); if(bSect) { SwSection *pSect = rSh.GetAnySection(); @@ -1392,8 +1392,8 @@ void SwView::StateTabWin(SfxItemSet& rSet) SvxLRSpaceItem aPageLRSpace( rDesc.GetMaster().GetLRSpace() ); SwapPageMargin( rDesc, aPageLRSpace ); - SfxItemSet aCoreSet( GetPool(), svl::Items<RES_PARATR_TABSTOP, RES_PARATR_TABSTOP, - RES_LR_SPACE, RES_UL_SPACE> ); + SfxItemSetFixed<RES_PARATR_TABSTOP, RES_PARATR_TABSTOP, + RES_LR_SPACE, RES_UL_SPACE> aCoreSet( GetPool() ); // get also the list level indent values merged as LR-SPACE item, if needed. rSh.GetCurAttr( aCoreSet, true ); const SelectionType nSelType = rSh.GetSelectionType(); @@ -1727,7 +1727,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) aDistLR.SetRight(rBox.GetDistance(SvxBoxItemLine::RIGHT)); //add the paragraph border distance - SfxItemSet aCoreSet1( GetPool(), svl::Items<RES_BOX, RES_BOX> ); + SfxItemSetFixed<RES_BOX, RES_BOX> aCoreSet1( GetPool() ); rSh.GetCurAttr( aCoreSet1 ); const SvxBoxItem& rParaBox = aCoreSet1.Get(RES_BOX); aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(SvxBoxItemLine::LEFT)); @@ -1741,9 +1741,8 @@ void SwView::StateTabWin(SfxItemSet& rSet) ( rSh.GetTableFormat() && !bFrameSelection && !(nFrameType & FrameTypeFlags::COLSECT ) ) ) { - SfxItemSet aCoreSet2( GetPool(), - svl::Items<RES_BOX, RES_BOX, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> ); + SfxItemSetFixed<RES_BOX, RES_BOX, + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> aCoreSet2( GetPool() ); SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER ); aBoxInfo.SetTable(false); aBoxInfo.SetDist(true); @@ -1754,7 +1753,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) aDistLR.SetRight(rBox.GetDistance(SvxBoxItemLine::RIGHT)); //add the border distance of the paragraph - SfxItemSet aCoreSet1( GetPool(), svl::Items<RES_BOX, RES_BOX> ); + SfxItemSetFixed<RES_BOX, RES_BOX> aCoreSet1( GetPool() ); rSh.GetCurAttr( aCoreSet1 ); const SvxBoxItem& rParaBox = aCoreSet1.Get(RES_BOX); aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(SvxBoxItemLine::LEFT)); @@ -1794,7 +1793,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) } //add the border distance of the paragraph - SfxItemSet aCoreSetTmp( GetPool(), svl::Items<RES_BOX, RES_BOX> ); + SfxItemSetFixed<RES_BOX, RES_BOX> aCoreSetTmp( GetPool() ); rSh.GetCurAttr( aCoreSetTmp ); const SvxBoxItem& rParaBox = aCoreSetTmp.Get(RES_BOX); aDistLR.SetLeft(aDistLR.GetLeft() + rParaBox.GetDistance(SvxBoxItemLine::LEFT)); diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx index db2019c99dba..8a8caaaa605c 100644 --- a/sw/source/uibase/uno/SwXDocumentSettings.cxx +++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx @@ -452,11 +452,11 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf SvMemoryStream aStream (aSequence.getArray(), nSize, StreamMode::READ ); aStream.Seek ( STREAM_SEEK_TO_BEGIN ); - auto pItemSet = std::make_unique<SfxItemSet>( mpDoc->GetAttrPool(), svl::Items< + auto pItemSet = std::make_unique<SfxItemSetFixed< SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, SID_HTML_MODE, SID_HTML_MODE, - FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER> ); + FN_PARAM_ADDPRINTER, FN_PARAM_ADDPRINTER>>( mpDoc->GetAttrPool() ); VclPtr<SfxPrinter> pPrinter = SfxPrinter::Create ( aStream, std::move(pItemSet) ); assert (! pPrinter->isDisposed() ); // set printer only once; in _postSetValues diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index b85b41ab2d20..39bea8b26d89 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -821,13 +821,12 @@ SwUnoCursor* SwXTextDocument::FindAny(const Reference< util::XSearchDescriptor > //try attribute search first if(pSearch->HasSearchAttributes()) { - SfxItemSet aSearch( - m_pDocShell->GetDoc()->GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_CHRATR_BEGIN, RES_CHRATR_END - 1, RES_TXTATR_INETFMT, RES_TXTATR_CHARFMT, RES_PARATR_BEGIN, RES_PARATR_END - 1, - RES_FRMATR_BEGIN, RES_FRMATR_END - 1>); + RES_FRMATR_BEGIN, RES_FRMATR_END - 1> + aSearch( m_pDocShell->GetDoc()->GetAttrPool() ); pSearch->FillSearchItemSet(aSearch); bool bCancel; nResult = static_cast<sal_Int32>(pUnoCursor->FindAttrs(aSearch, !pSearch->m_bStyles, diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 12eb53ed87fe..d658a6db7271 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -657,15 +657,14 @@ void SwGlobalTree::ExecuteContextMenuAction(std::string_view rSelectedPopupEntry { if(pContCopy) { - SfxItemSet aSet( - m_pActiveShell->GetView().GetPool(), - svl::Items< + SfxItemSetFixed< RES_FRM_SIZE, RES_FRM_SIZE, RES_LR_SPACE, RES_LR_SPACE, RES_BACKGROUND, RES_BACKGROUND, RES_COL, RES_COL, SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, - FN_PARAM_TOX_TYPE, FN_PARAM_TOX_TYPE>); + FN_PARAM_TOX_TYPE, FN_PARAM_TOX_TYPE> + aSet( m_pActiveShell->GetView().GetPool() ); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); ScopedVclPtr<AbstractMultiTOXTabDialog> pDlg(pFact->CreateMultiTOXTabDialog( diff --git a/sw/source/uibase/utlui/numfmtlb.cxx b/sw/source/uibase/utlui/numfmtlb.cxx index f24c5150cc2d..76f329aad80e 100644 --- a/sw/source/uibase/utlui/numfmtlb.cxx +++ b/sw/source/uibase/utlui/numfmtlb.cxx @@ -380,15 +380,13 @@ void SwNumFormatBase::CallSelectHdl() SwWrtShell &rSh = pView->GetWrtShell(); SvNumberFormatter* pFormatter = rSh.GetNumberFormatter(); - SfxItemSet aCoreSet( - rSh.GetAttrPool(), - svl::Items< + SfxItemSetFixed< SID_ATTR_NUMBERFORMAT_VALUE, 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>); + SID_ATTR_NUMBERFORMAT_ADD_AUTO> aCoreSet( rSh.GetAttrPool() ); double fValue = SwNumFormatBase::GetDefValue(nCurrFormatType); diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 3d9e09e5d065..c8a3cae408fe 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -1617,16 +1617,14 @@ void SwWrtShell::QuickUpdateStyle() void SwWrtShell::AutoUpdatePara(SwTextFormatColl* pColl, const SfxItemSet& rStyleSet, SwPaM* pPaM ) { SwPaM* pCursor = pPaM ? pPaM : GetCursor( ); - SfxItemSet aCoreSet( - GetAttrPool(), - svl::Items< + SfxItemSetFixed< RES_CHRATR_BEGIN, RES_CHRATR_END - 1, RES_PARATR_BEGIN, RES_PARATR_END - 1, RES_FRMATR_BEGIN, RES_FRMATR_END - 1, SID_ATTR_TABSTOP_DEFAULTS,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>); + SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM> aCoreSet( GetAttrPool() ); GetPaMAttr( pCursor, aCoreSet ); bool bReset = false; SfxItemIter aParaIter( aCoreSet ); |