summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-10-06 16:17:38 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-10-10 11:33:38 +0200
commitdbd49cf90b175a3c3d7a4f25ad366f9bc4c716db (patch)
tree1c9ee40dc72d468f4b35dd83f62966844aabcf62 /sw/source/core
parentb972aa8727da6eb2d5d9740b18450d8706df0874 (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/core')
-rw-r--r--sw/source/core/access/accpara.cxx26
-rw-r--r--sw/source/core/attr/format.cxx2
-rw-r--r--sw/source/core/crsr/crstrvl.cxx9
-rw-r--r--sw/source/core/crsr/findattr.cxx3
-rw-r--r--sw/source/core/crsr/viscrs.cxx5
-rw-r--r--sw/source/core/doc/DocumentContentOperationsManager.cxx43
-rw-r--r--sw/source/core/doc/DocumentDeviceManager.cxx12
-rw-r--r--sw/source/core/doc/DocumentFieldsManager.cxx3
-rw-r--r--sw/source/core/doc/DocumentRedlineManager.cxx7
-rw-r--r--sw/source/core/doc/docfly.cxx4
-rw-r--r--sw/source/core/doc/docfmt.cxx19
-rw-r--r--sw/source/core/doc/docnew.cxx2
-rw-r--r--sw/source/core/doc/docsort.cxx7
-rw-r--r--sw/source/core/doc/tblcpy.cxx3
-rw-r--r--sw/source/core/doc/tblrwcl.cxx3
-rw-r--r--sw/source/core/docnode/ndtbl.cxx22
-rw-r--r--sw/source/core/docnode/node.cxx8
-rw-r--r--sw/source/core/draw/dcontact.cxx14
-rw-r--r--sw/source/core/draw/dflyobj.cxx2
-rw-r--r--sw/source/core/edit/acorrect.cxx4
-rw-r--r--sw/source/core/edit/autofmt.cxx11
-rw-r--r--sw/source/core/edit/edfmt.cxx3
-rw-r--r--sw/source/core/fields/cellfml.cxx3
-rw-r--r--sw/source/core/frmedt/fecopy.cxx5
-rw-r--r--sw/source/core/frmedt/fefly1.cxx4
-rw-r--r--sw/source/core/frmedt/feshview.cxx12
-rw-r--r--sw/source/core/layout/anchoreddrawobject.cxx2
-rw-r--r--sw/source/core/layout/fly.cxx3
-rw-r--r--sw/source/core/text/redlnitr.cxx2
-rw-r--r--sw/source/core/text/txtfld.cxx2
-rw-r--r--sw/source/core/text/txtfrm.cxx9
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx30
-rw-r--r--sw/source/core/txtnode/thints.cxx5
-rw-r--r--sw/source/core/undo/untbl.cxx37
-rw-r--r--sw/source/core/unocore/SwXTextDefaults.cxx2
-rw-r--r--sw/source/core/unocore/unodraw.cxx6
-rw-r--r--sw/source/core/unocore/unoframe.cxx32
-rw-r--r--sw/source/core/unocore/unoobj.cxx18
-rw-r--r--sw/source/core/unocore/unoport.cxx6
-rw-r--r--sw/source/core/unocore/unosect.cxx7
-rw-r--r--sw/source/core/unocore/unostyle.cxx11
-rw-r--r--sw/source/core/unocore/unotbl.cxx49
42 files changed, 198 insertions, 259 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));