summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-09-26 16:52:30 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-26 20:22:22 +0200
commitadfdffa5001dd17da9ea3670a5dc23af559c17ba (patch)
treed2c1ae8b7a6f22ec6d94b9479887f0a9cd7942d6 /sw
parent501929557800e400c9ee07d25687ee60354d74c2 (diff)
use SfxItemSetFixed in sw
Change-Id: I1b7bfe92dc4ef61b26940ed02ccd8f359e8149e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122652 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx10
-rw-r--r--sw/source/uibase/utlui/uitool.cxx15
-rw-r--r--sw/source/uibase/wrtsh/delete.cxx4
3 files changed, 12 insertions, 17 deletions
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 23c337284c01..b85b41ab2d20 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -704,14 +704,12 @@ sal_Int32 SwXTextDocument::replaceAll(const Reference< util::XSearchDescriptor >
//try attribute search first
if(pSearch->HasSearchAttributes()||pSearch->HasReplaceAttributes())
{
- SfxItemSet aSearch(m_pDocShell->GetDoc()->GetAttrPool(),
- svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1,
+ SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
- RES_FRMATR_BEGIN, RES_FRMATR_END-1>);
- SfxItemSet aReplace(m_pDocShell->GetDoc()->GetAttrPool(),
- svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1,
+ RES_FRMATR_BEGIN, RES_FRMATR_END-1> aSearch(m_pDocShell->GetDoc()->GetAttrPool());
+ SfxItemSetFixed<RES_CHRATR_BEGIN, RES_CHRATR_END-1,
RES_PARATR_BEGIN, RES_PARATR_END-1,
- RES_FRMATR_BEGIN, RES_FRMATR_END-1>);
+ RES_FRMATR_BEGIN, RES_FRMATR_END-1> aReplace(m_pDocShell->GetDoc()->GetAttrPool());
pSearch->FillSearchItemSet(aSearch);
pSearch->FillReplaceItemSet(aReplace);
bool bCancel;
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx
index 6447862a44f0..5c34b89ca0a7 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -200,8 +200,7 @@ void ApplyCharBackground(const Color& rBackgroundColor, SwWrtShell& rShell)
{
rShell.StartUndo(SwUndoId::INSATTR);
- SfxItemSet aCoreSet(rShell.GetView().GetPool(), svl::Items<
- RES_CHRATR_GRABBAG, RES_CHRATR_GRABBAG>);
+ SfxItemSetFixed<RES_CHRATR_GRABBAG, RES_CHRATR_GRABBAG> aCoreSet(rShell.GetView().GetPool());
rShell.GetCurAttr(aCoreSet);
@@ -515,8 +514,7 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet)
OSL_ENSURE(pHeaderFormat != nullptr, "no header format");
// HeaderInfo, margins, background, border
- SfxItemSet aHeaderSet(*rSet.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
@@ -524,7 +522,7 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet)
SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER, // [10023
SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE, // [10051
SID_ATTR_PAGE_ON,SID_ATTR_PAGE_SHARED, // [10060
- SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST>);
+ SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST> aHeaderSet(*rSet.GetPool());
// set correct parent to get the XFILL_NONE FillStyle as needed
aHeaderSet.SetParent(&rMaster.GetDoc()->GetDfltFrameFormat()->GetAttrSet());
@@ -565,8 +563,7 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet)
OSL_ENSURE(pFooterFormat != nullptr, "no footer format");
// FooterInfo, margins, background, border
- SfxItemSet aFooterSet(*rSet.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
@@ -574,7 +571,7 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet)
SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER, // [10023
SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE, // [10051
SID_ATTR_PAGE_ON,SID_ATTR_PAGE_SHARED, // [10060
- SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST>);
+ SID_ATTR_PAGE_SHARED_FIRST,SID_ATTR_PAGE_SHARED_FIRST> aFooterSet(*rSet.GetPool());
// set correct parent to get the XFILL_NONE FillStyle as needed
aFooterSet.SetParent(&rMaster.GetDoc()->GetDfltFrameFormat()->GetAttrSet());
@@ -706,7 +703,7 @@ void SfxToSwPageDescAttr( const SwWrtShell& rShell, SfxItemSet& rSet )
}
else
{
- SfxItemSet aCoreSet(rShell.GetView().GetPool(), svl::Items<RES_PAGEDESC, RES_PAGEDESC> );
+ SfxItemSetFixed<RES_PAGEDESC, RES_PAGEDESC> aCoreSet(rShell.GetView().GetPool());
rShell.GetCurAttr( aCoreSet );
if(SfxItemState::SET == aCoreSet.GetItemState( RES_PAGEDESC, true, &pItem ) )
{
diff --git a/sw/source/uibase/wrtsh/delete.cxx b/sw/source/uibase/wrtsh/delete.cxx
index 0c1cd4f23d6f..c33f014f8f31 100644
--- a/sw/source/uibase/wrtsh/delete.cxx
+++ b/sw/source/uibase/wrtsh/delete.cxx
@@ -64,7 +64,7 @@ bool SwWrtShell::TryRemoveIndent()
{
bool bResult = false;
- SfxItemSet aAttrSet(GetAttrPool(), svl::Items<RES_LR_SPACE, RES_LR_SPACE>);
+ SfxItemSetFixed<RES_LR_SPACE, RES_LR_SPACE> aAttrSet(GetAttrPool());
GetCurAttr(aAttrSet);
SvxLRSpaceItem aItem = aAttrSet.Get(RES_LR_SPACE);
@@ -441,7 +441,7 @@ bool SwWrtShell::DelRight()
if ( IsRedlineOn() && (eAnchorId != RndStdIds::FLY_AS_CHAR &&
eAnchorId != RndStdIds::FLY_AT_CHAR) )
{
- SfxItemSet aSet(GetAttrPool(), svl::Items<RES_ANCHOR, RES_ANCHOR>);
+ SfxItemSetFixed<RES_ANCHOR, RES_ANCHOR> aSet(GetAttrPool());
GetFlyFrameAttr(aSet);
SwFormatAnchor aAnch(RndStdIds::FLY_AT_CHAR);
aSet.Put(aAnch);