editeng/source/editeng/impedit2.cxx | 3 - reportdesign/source/ui/report/ReportSection.cxx | 23 ++++------- sc/source/core/data/stlsheet.cxx | 32 +++++++-------- sc/source/ui/drawfunc/drawsh.cxx | 9 ++-- sd/source/core/stlsheet.cxx | 49 +++++++++++------------- sd/source/ui/app/sdmod2.cxx | 17 ++++---- sd/source/ui/func/fuconcs.cxx | 20 +++------ sd/source/ui/func/fupage.cxx | 19 +++------ sd/source/ui/func/fuparagr.cxx | 7 +-- sd/source/ui/unoidl/unopage.cxx | 4 - sd/source/ui/view/drtxtob1.cxx | 6 +- sd/source/ui/view/outlnvsh.cxx | 4 - svx/source/svdraw/svdotxed.cxx | 2 sw/source/core/doc/DocumentDeviceManager.cxx | 21 ++++------ sw/source/core/doc/DocumentRedlineManager.cxx | 9 +--- sw/source/core/doc/docsort.cxx | 7 +-- sw/source/core/docnode/ndtbl.cxx | 20 ++++----- sw/source/filter/html/htmlctxt.cxx | 6 +- sw/source/ui/misc/insfnote.cxx | 6 +- sw/source/uibase/fldui/fldmgr.cxx | 2 sw/source/uibase/frmdlg/frmmgr.cxx | 2 sw/source/uibase/lingu/hhcwrp.cxx | 9 +--- sw/source/uibase/shells/annotsh.cxx | 23 ++++------- sw/source/uibase/shells/textsh.cxx | 16 ++++--- sw/source/uibase/uiview/view0.cxx | 2 25 files changed, 153 insertions(+), 165 deletions(-)
New commits: commit 7afd95daf2224e80fe57c62f819dfb9ec4c630c9 Author: rafaelhlima <rafael.palma.l...@gmail.com> AuthorDate: Tue Jan 14 16:50:19 2025 -0300 Commit: Rafael Lima <rafael.palma.l...@gmail.com> CommitDate: Mon Jan 20 12:38:28 2025 +0100 tdf#164685 Cleanup SfxItemSetFixed Cleanup of class SfxItemSetFixed as described in the bug ticket. Change-Id: I0704ab45624217a8d00a942e0e8d6d6276934306 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180255 Reviewed-by: Armin Le Grand <armin.le.gr...@me.com> Tested-by: Jenkins diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 2cd3d66de41b..fee808e6bc39 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -755,7 +755,8 @@ const SfxItemSet& ImpEditEngine::GetEmptyItemSet() const { if ( !pEmptyItemSet ) { - pEmptyItemSet = std::make_unique<SfxItemSetFixed<EE_ITEMS_START, EE_ITEMS_END>>(const_cast<SfxItemPool&>(maEditDoc.GetItemPool())); + pEmptyItemSet = std::make_unique<SfxItemSet>(SfxItemSet::makeFixedSfxItemSet< + EE_ITEMS_START, EE_ITEMS_END>(const_cast<SfxItemPool&>(maEditDoc.GetItemPool()))); for ( sal_uInt16 nWhich = EE_ITEMS_START; nWhich <= EE_CHAR_END; nWhich++) { pEmptyItemSet->ClearItem( nWhich ); diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 77ad558e0396..de7f0ef69be4 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -598,19 +598,16 @@ void OReportSection::createDefault(const OUString& _sType,SdrObject* _pObj) if( pSourceObj ) { const SfxItemSet& rSource = pSourceObj->GetMergedItemSet(); - SfxItemSetFixed< - // Ranges from SdrAttrObj: - SDRATTR_START, SDRATTR_SHADOW_LAST, - SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, - SDRATTR_TEXTDIRECTION, - SDRATTR_TEXTDIRECTION, - // Graphic attributes, 3D properties, - // CustomShape properties: - SDRATTR_GRAF_FIRST, - SDRATTR_CUSTOMSHAPE_LAST, - // Range from SdrTextObj: - EE_ITEMS_START, EE_ITEMS_END> - aDest( _pObj->getSdrModelFromSdrObject().GetItemPool() ); + SfxItemSet aDest(SfxItemSet::makeFixedSfxItemSet< + // Ranges from SdrAttrObj: + SDRATTR_START, SDRATTR_SHADOW_LAST, + SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, + SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, + // Graphic attributes, 3D properties, + // CustomShape properties: + SDRATTR_GRAF_FIRST, SDRATTR_CUSTOMSHAPE_LAST, + // Range from SdrTextObj: + EE_ITEMS_START, EE_ITEMS_END>(_pObj->getSdrModelFromSdrObject().GetItemPool())); aDest.Set( rSource ); _pObj->SetMergedItemSet( aDest ); Degree100 nAngle = pSourceObj->GetRotateAngle(); diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx index 47b861756337..b56a6ef0c6a2 100644 --- a/sc/source/core/data/stlsheet.cxx +++ b/sc/source/core/data/stlsheet.cxx @@ -144,13 +144,12 @@ SfxItemSet& ScStyleSheet::GetItemSet() // (== Standard page template) SfxItemPool& rItemPool = GetPool()->GetPool(); - pSet = new SfxItemSetFixed< - ATTR_USERDEF, ATTR_USERDEF, - ATTR_WRITINGDIR, ATTR_WRITINGDIR, - ATTR_BACKGROUND, ATTR_BACKGROUND, - ATTR_BORDER, ATTR_SHADOW, - ATTR_LRSPACE, ATTR_PAGE_SCALETO>(rItemPool); - + pSet = new SfxItemSet(rItemPool, WhichRangesContainer(svl::Items< + ATTR_USERDEF, ATTR_USERDEF, + ATTR_WRITINGDIR, ATTR_WRITINGDIR, + ATTR_BACKGROUND, ATTR_BACKGROUND, + ATTR_BORDER, ATTR_SHADOW, + ATTR_LRSPACE, ATTR_PAGE_SCALETO>)); // If being loaded also the set is then filled in from the file, // so the defaults do not need to be set. // GetPrinter would then also create a new printer, @@ -233,20 +232,21 @@ SfxItemSet& ScStyleSheet::GetItemSet() pItemPool = pItemPool->GetSecondaryPool(); assert(pItemPool); - pSet = new SfxItemSetFixed< - XATTR_LINE_FIRST, XATTR_LINE_LAST, - XATTR_FILL_FIRST, XATTR_FILL_LAST, - SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, - SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_WORDWRAP, - SDRATTR_EDGE_FIRST, SDRATTR_MEASURE_LAST, - SDRATTR_3D_FIRST, SDRATTR_3D_LAST, - EE_PARA_START, EE_CHAR_END>(*pItemPool); + pSet = new SfxItemSet(*pItemPool, WhichRangesContainer(svl::Items< + XATTR_LINE_FIRST, XATTR_LINE_LAST, + XATTR_FILL_FIRST, XATTR_FILL_LAST, + SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, + SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_WORDWRAP, + SDRATTR_EDGE_FIRST, SDRATTR_MEASURE_LAST, + SDRATTR_3D_FIRST, SDRATTR_3D_LAST, + EE_PARA_START, EE_CHAR_END>)); } break; case SfxStyleFamily::Para: default: - pSet = new SfxItemSetFixed<ATTR_PATTERN_START, ATTR_PATTERN_END>( GetPool()->GetPool() ); + pSet = new SfxItemSet(GetPool()->GetPool(), WhichRangesContainer(svl::Items< + ATTR_PATTERN_START, ATTR_PATTERN_END>)); break; } bMySet = true; diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index 01c65a4ed446..f679b031f3a5 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -161,8 +161,9 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) case SID_CELL_FORMAT_RESET: case SID_TEXT_STANDARD: { - SfxItemSetFixed<SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_MINFRAMEHEIGHT, - SDRATTR_TEXT_MAXFRAMEHEIGHT, SDRATTR_TEXT_MAXFRAMEWIDTH> aEmptyAttr(GetPool()); + SfxItemSet aEmptyAttr(SfxItemSet::makeFixedSfxItemSet< + SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_MINFRAMEHEIGHT, + SDRATTR_TEXT_MAXFRAMEHEIGHT, SDRATTR_TEXT_MAXFRAMEWIDTH>(GetPool())); if (ScDrawLayer::IsNoteCaption(pSingleSelectedObj)) aEmptyAttr.Put(pView->GetAttrFromMarked(true)); @@ -429,7 +430,9 @@ void ScDrawShell::ExecuteMacroAssign(SdrObject* pObj, weld::Window* pWin) } // create empty itemset for macro-dlg - auto xItemSet = std::make_unique<SfxItemSetFixed<SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG>>( SfxGetpApp()->GetPool() ); + auto xItemSet = std::make_unique<SfxItemSet>(SfxItemSet::makeFixedSfxItemSet< + SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, + SID_EVENTCONFIG, SID_EVENTCONFIG>(SfxGetpApp()->GetPool())); xItemSet->Put ( aItem ); SfxEventNamesItem aNamesItem(SID_EVENTCONFIG); diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index 8fcc2cbd1440..c4b5dfe92046 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -218,14 +218,14 @@ SfxItemSet& SdStyleSheet::GetItemSet() // we create the ItemSet 'on demand' if necessary if (!pSet) { - pSet = new SfxItemSetFixed< - XATTR_LINE_FIRST, XATTR_LINE_LAST, - XATTR_FILL_FIRST, XATTR_FILL_LAST, - SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, - SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_WORDWRAP, - SDRATTR_EDGE_FIRST, SDRATTR_MEASURE_LAST, - SDRATTR_3D_FIRST, SDRATTR_3D_LAST, - EE_PARA_START, EE_CHAR_END>(GetPool()->GetPool()); + pSet = new SfxItemSet(GetPool()->GetPool(), WhichRangesContainer(svl::Items< + XATTR_LINE_FIRST, XATTR_LINE_LAST, + XATTR_FILL_FIRST, XATTR_FILL_LAST, + SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, + SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_WORDWRAP, + SDRATTR_EDGE_FIRST, SDRATTR_MEASURE_LAST, + SDRATTR_3D_FIRST, SDRATTR_3D_LAST, + EE_PARA_START, EE_CHAR_END>)); bMySet = true; } @@ -236,15 +236,14 @@ SfxItemSet& SdStyleSheet::GetItemSet() { if (!pSet) { - pSet = new SfxItemSetFixed< - XATTR_LINE_FIRST, XATTR_LINE_LAST, - XATTR_FILL_FIRST, XATTR_FILL_LAST, - SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, - SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_XMLATTRIBUTES, - SDRATTR_TEXT_WORDWRAP, SDRATTR_TEXT_WORDWRAP, - SDRATTR_TABLE_FIRST, SDRATTR_TABLE_LAST, - EE_PARA_START, EE_CHAR_END>(GetPool()->GetPool()); - + pSet = new SfxItemSet(GetPool()->GetPool(), WhichRangesContainer(svl::Items< + XATTR_LINE_FIRST, XATTR_LINE_LAST, + XATTR_FILL_FIRST, XATTR_FILL_LAST, + SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, + SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_XMLATTRIBUTES, + SDRATTR_TEXT_WORDWRAP, SDRATTR_TEXT_WORDWRAP, + SDRATTR_TABLE_FIRST, SDRATTR_TABLE_LAST, + EE_PARA_START, EE_CHAR_END>)); bMySet = true; } @@ -266,14 +265,14 @@ SfxItemSet& SdStyleSheet::GetItemSet() { if (!pSet) { - pSet = new SfxItemSetFixed< - XATTR_LINE_FIRST, XATTR_LINE_LAST, - XATTR_FILL_FIRST, XATTR_FILL_LAST, - SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, - SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_WORDWRAP, - SDRATTR_EDGE_FIRST, SDRATTR_MEASURE_LAST, - SDRATTR_3D_FIRST, SDRATTR_3D_LAST, - EE_PARA_START, EE_CHAR_END>(GetPool()->GetPool()); + pSet = new SfxItemSet(GetPool()->GetPool(), WhichRangesContainer(svl::Items< + XATTR_LINE_FIRST, XATTR_LINE_LAST, + XATTR_FILL_FIRST, XATTR_FILL_LAST, + SDRATTR_SHADOW_FIRST, SDRATTR_SHADOW_LAST, + SDRATTR_TEXT_MINFRAMEHEIGHT, SDRATTR_TEXT_WORDWRAP, + SDRATTR_EDGE_FIRST, SDRATTR_MEASURE_LAST, + SDRATTR_3D_FIRST, SDRATTR_3D_LAST, + EE_PARA_START, EE_CHAR_END>)); bMySet = true; } diff --git a/sd/source/ui/app/sdmod2.cxx b/sd/source/ui/app/sdmod2.cxx index 52b3f7780844..338b134f2277 100644 --- a/sd/source/ui/app/sdmod2.cxx +++ b/sd/source/ui/app/sdmod2.cxx @@ -456,11 +456,11 @@ std::optional<SfxItemSet> SdModule::CreateItemSet( sal_uInt16 nSlot ) SfxItemPool& rPool = GetPool(); rPool.SetDefaultMetric( MapUnit::Map100thMM ); - SfxItemSetFixed< - SID_ATTR_GRID_OPTIONS, SID_ATTR_GRID_OPTIONS, - SID_ATTR_METRIC, SID_ATTR_METRIC, - SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP, - ATTR_OPTIONS_LAYOUT, ATTR_OPTIONS_SCALE_END> aRet(rPool); + SfxItemSet aRet(SfxItemSet::makeFixedSfxItemSet< + SID_ATTR_GRID_OPTIONS, SID_ATTR_GRID_OPTIONS, + SID_ATTR_METRIC, SID_ATTR_METRIC, + SID_ATTR_DEFTABSTOP, SID_ATTR_DEFTABSTOP, + ATTR_OPTIONS_LAYOUT, ATTR_OPTIONS_SCALE_END>(rPool)); sal_uInt16 nDefTab = 0; SvtSysLocale aSysLocale; @@ -674,9 +674,10 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet ) bMiscOptions = true; } - SfxItemSetFixed<SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, - SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, - ATTR_OPTIONS_PRINT, ATTR_OPTIONS_PRINT> aPrintSet( GetPool() ); + SfxItemSet aPrintSet(SfxItemSet::makeFixedSfxItemSet< + SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, + SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC, + ATTR_OPTIONS_PRINT, ATTR_OPTIONS_PRINT>(GetPool())); // Print const SdOptionsPrintItem* pPrintItem = rSet.GetItemIfSet( ATTR_OPTIONS_PRINT, false); diff --git a/sd/source/ui/func/fuconcs.cxx b/sd/source/ui/func/fuconcs.cxx index 4ec87e53cf86..3c8b2344148e 100644 --- a/sd/source/ui/func/fuconcs.cxx +++ b/sd/source/ui/func/fuconcs.cxx @@ -187,18 +187,14 @@ void FuConstructCustomShape::SetAttributes( SdrObject* pObj ) if( pSourceObj ) { const SfxItemSet& rSource = pSourceObj->GetMergedItemSet(); - SfxItemSetFixed< - // Ranges from SdrAttrObj: - SDRATTR_START, SDRATTR_SHADOW_LAST, - SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, - SDRATTR_TEXTDIRECTION, - SDRATTR_TEXTDIRECTION, - // Graphic attributes, 3D properties, - // CustomShape properties: - SDRATTR_GRAF_FIRST, - SDRATTR_CUSTOMSHAPE_LAST, - // Range from SdrTextObj: - EE_ITEMS_START, EE_ITEMS_END> aDest(pObj->getSdrModelFromSdrObject().GetItemPool()); + SfxItemSet aDest(SfxItemSet::makeFixedSfxItemSet< + // Ranges from SdrAttrObj: + SDRATTR_START, SDRATTR_SHADOW_LAST, SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST, SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, + // Graphic attributes, 3D properties, + // CustomShape properties: + SDRATTR_GRAF_FIRST, SDRATTR_CUSTOMSHAPE_LAST, + // Range from SdrTextObj: + EE_ITEMS_START, EE_ITEMS_END>(pObj->getSdrModelFromSdrObject().GetItemPool())); aDest.Set( rSource ); pObj->SetMergedItemSet( aDest ); // Enables Word-wrap by default (tdf#134369) diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index dc3d4ea66faa..bfffe9f0be36 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -199,14 +199,11 @@ void FuPage::ExecuteAsyncDialog(weld::Window* pParent, const SfxRequest& rReq) return; } - std::shared_ptr<SfxItemSet> aNewAttr = std::make_shared< - SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST, - EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR, - SID_ATTR_BORDER_OUTER, SID_ATTR_BORDER_OUTER, - SID_ATTR_BORDER_SHADOW, SID_ATTR_BORDER_SHADOW, - SID_ATTR_PAGE, SID_ATTR_PAGE_SHARED, - SID_ATTR_CHAR_GRABBAG, SID_ATTR_CHAR_GRABBAG, - SID_ATTR_PAGE_COLOR, SID_ATTR_PAGE_FILLSTYLE>>(mpDoc->GetPool()); + std::shared_ptr<SfxItemSet> aNewAttr = std::make_shared<SfxItemSet>(SfxItemSet::makeFixedSfxItemSet< + XATTR_FILL_FIRST, XATTR_FILL_LAST, EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR, + SID_ATTR_BORDER_OUTER, SID_ATTR_BORDER_OUTER, SID_ATTR_BORDER_SHADOW, + SID_ATTR_BORDER_SHADOW, SID_ATTR_PAGE, SID_ATTR_PAGE_SHARED, SID_ATTR_CHAR_GRABBAG, + SID_ATTR_CHAR_GRABBAG, SID_ATTR_PAGE_COLOR, SID_ATTR_PAGE_FILLSTYLE>(mpDoc->GetPool())); // Keep it sorted aNewAttr->MergeRange(mpDoc->GetPool().GetWhichIDFromSlotID(SID_ATTR_LRSPACE), mpDoc->GetPool().GetWhichIDFromSlotID(SID_ATTR_ULSPACE)); @@ -335,7 +332,7 @@ void FuPage::ExecuteAsyncDialog(weld::Window* pParent, const SfxRequest& rReq) tempSet.Put( XFillStyleItem( drawing::FillStyle_BITMAP ) ); // MigrateItemSet makes sure the XFillBitmapItem will have a unique name - SfxItemSetFixed<XATTR_FILLBITMAP, XATTR_FILLBITMAP> aMigrateSet( mpDoc->GetPool() ); + SfxItemSet aMigrateSet(SfxItemSet::makeFixedSfxItemSet<XATTR_FILLBITMAP, XATTR_FILLBITMAP>(mpDoc->GetPool())); aMigrateSet.Put(XFillBitmapItem(u"background"_ustr, std::move(aGraphic))); SdrModel::MigrateItemSet( &aMigrateSet, &tempSet, *mpDoc ); @@ -408,7 +405,7 @@ void FuPage::ApplyItemSet(SdStyleSheet& styleSheet, const std::shared_ptr<SfxIte if (pTempGradItem && pTempGradItem->GetName().isEmpty()) { // MigrateItemSet guarantees unique gradient names - SfxItemSetFixed<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT> aMigrateSet( mpDoc->GetPool() ); + SfxItemSet aMigrateSet(SfxItemSet::makeFixedSfxItemSet<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT>(mpDoc->GetPool())); aMigrateSet.Put( XFillGradientItem(u"gradient"_ustr, pTempGradItem->GetGradientValue()) ); SdrModel::MigrateItemSet( &aMigrateSet, &tempSet, *mpDoc); } @@ -417,7 +414,7 @@ void FuPage::ApplyItemSet(SdStyleSheet& styleSheet, const std::shared_ptr<SfxIte if (pTempHatchItem && pTempHatchItem->GetName().isEmpty()) { // MigrateItemSet guarantees unique hatch names - SfxItemSetFixed<XATTR_FILLHATCH, XATTR_FILLHATCH> aMigrateSet( mpDoc->GetPool() ); + SfxItemSet aMigrateSet(SfxItemSet::makeFixedSfxItemSet<XATTR_FILLHATCH, XATTR_FILLHATCH>(mpDoc->GetPool())); aMigrateSet.Put( XFillHatchItem(u"hatch"_ustr, pTempHatchItem->GetHatchValue()) ); SdrModel::MigrateItemSet( &aMigrateSet, &tempSet, *mpDoc); } diff --git a/sd/source/ui/func/fuparagr.cxx b/sd/source/ui/func/fuparagr.cxx index ee50cc05d304..b13d9fbffe58 100644 --- a/sd/source/ui/func/fuparagr.cxx +++ b/sd/source/ui/func/fuparagr.cxx @@ -67,9 +67,10 @@ void FuParagraph::DoExecute( SfxRequest& rReq ) SfxItemSet aEditAttr( mpDoc->GetPool() ); mpView->GetAttributes( aEditAttr ); SfxItemPool *pPool = aEditAttr.GetPool(); - SfxItemSetFixed<EE_ITEMS_START, EE_ITEMS_END, - SID_ATTR_TABSTOP_OFFSET, SID_ATTR_TABSTOP_OFFSET, - ATTR_PARANUMBERING_START, ATTR_PARANUMBERING_END> aNewAttr( *pPool ); + SfxItemSet aNewAttr(SfxItemSet::makeFixedSfxItemSet< + EE_ITEMS_START, EE_ITEMS_END, + SID_ATTR_TABSTOP_OFFSET, SID_ATTR_TABSTOP_OFFSET, + ATTR_PARANUMBERING_START, ATTR_PARANUMBERING_END>(*pPool)); aNewAttr.Put( aEditAttr ); diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index a5899460e754..64ae86dbe4ae 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -2481,7 +2481,7 @@ void SdDrawPage::setBackground( const Any& rValue ) // is it our own implementation? SdUnoPageBackground* pBack = dynamic_cast<SdUnoPageBackground*>( xSet.get() ); - SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> aSet( GetModel()->GetDoc()->GetPool() ); + SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<XATTR_FILL_FIRST, XATTR_FILL_LAST>(GetModel()->GetDoc()->GetPool())); if( pBack ) { @@ -2850,7 +2850,7 @@ void SdMasterPage::setBackground( const Any& rValue ) // is it our own implementation? SdUnoPageBackground* pBack = dynamic_cast<SdUnoPageBackground*>( xInputSet.get() ); - SfxItemSetFixed<XATTR_FILL_FIRST, XATTR_FILL_LAST> aSet( GetModel()->GetDoc()->GetPool() ); + SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<XATTR_FILL_FIRST, XATTR_FILL_LAST>(GetModel()->GetDoc()->GetPool())); if( pBack ) { diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 9058f7ad30a0..ad497a5db1ec 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -328,7 +328,7 @@ void TextObjectBar::ExecuteImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxR SvxLRSpaceItem aLRSpace = static_cast<const SvxLRSpaceItem&>(pArgs->Get( SID_ATTR_PARA_LRSPACE)); - SfxItemSetFixed<EE_PARA_LRSPACE, EE_PARA_LRSPACE> aEditAttr(mpView->GetDoc().GetPool()); + SfxItemSet aEditAttr(SfxItemSet::makeFixedSfxItemSet<EE_PARA_LRSPACE, EE_PARA_LRSPACE>(mpView->GetDoc().GetPool())); aLRSpace.SetWhich( EE_PARA_LRSPACE ); aEditAttr.Put( aLRSpace ); @@ -341,7 +341,7 @@ void TextObjectBar::ExecuteImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxR case SID_HANGING_INDENT: { - SfxItemSetFixed<EE_PARA_LRSPACE, EE_PARA_LRSPACE> aLRSpaceSet(mpView->GetDoc().GetPool()); + SfxItemSet aLRSpaceSet(SfxItemSet::makeFixedSfxItemSet<EE_PARA_LRSPACE, EE_PARA_LRSPACE>(mpView->GetDoc().GetPool())); mpView->GetAttributes( aLRSpaceSet ); SvxLRSpaceItem aParaMargin( aLRSpaceSet.Get( EE_PARA_LRSPACE ) ); @@ -398,7 +398,7 @@ void TextObjectBar::ExecuteImpl(ViewShell* mpViewShell, ::sd::View* mpView, SfxR // tdf#131571: SdrEndTextEdit invalidates pTextEditOutlinerView, the pointer retrieved for pOLV // so reinitialize pOLV pOLV=mpView->GetTextEditOutlinerView(); - SfxItemSetFixed<SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION> aAttr( mpView->GetDoc().GetPool() ); + SfxItemSet aAttr(SfxItemSet::makeFixedSfxItemSet<SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION>(mpView->GetDoc().GetPool())); aAttr.Put( SvxWritingModeItem( nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ? css::text::WritingMode_LR_TB : css::text::WritingMode_TB_RL, diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index f55ad226fa4e..d2ee997ad100 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -818,7 +818,7 @@ void OutlineViewShell::GetMenuState( SfxItemSet &rSet ) // does the selection provide a unique presentation layout? // if not, the templates must not be edited - SfxItemSetFixed<SID_STATUS_LAYOUT, SID_STATUS_LAYOUT> aSet(*rSet.GetPool()); + SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<SID_STATUS_LAYOUT, SID_STATUS_LAYOUT>(*rSet.GetPool())); GetStatusBarState(aSet); OUString aTest = aSet.Get(SID_STATUS_LAYOUT).GetValue(); if (aTest.isEmpty()) @@ -1466,7 +1466,7 @@ void OutlineViewShell::GetAttrState( SfxItemSet& rSet ) GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pFamilyItem); if (pFamilyItem && static_cast<SfxStyleFamily>(pFamilyItem->GetValue()) == SfxStyleFamily::Pseudo) { - SfxItemSetFixed<SID_STATUS_LAYOUT, SID_STATUS_LAYOUT> aSet(*rSet.GetPool()); + SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<SID_STATUS_LAYOUT, SID_STATUS_LAYOUT>(*rSet.GetPool())); GetStatusBarState(aSet); OUString aRealStyle = aSet.Get(SID_STATUS_LAYOUT).GetValue(); if (aRealStyle.isEmpty()) diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index adcdb6a578a1..32fb9111a47e 100644 --- a/svx/source/svdraw/svdotxed.cxx +++ b/svx/source/svdraw/svdotxed.cxx @@ -95,7 +95,7 @@ bool SdrTextObj::BegTextEdit(SdrOutliner& rOutl) // at SetParaAttribs(), all attributes contained in the parent become // attributed hard to the paragraph. const SfxItemSet& rSet = GetObjectItemSet(); - SfxItemSetFixed<EE_ITEMS_START, EE_ITEMS_END> aFilteredSet(*rSet.GetPool()); + SfxItemSet aFilteredSet(SfxItemSet::makeFixedSfxItemSet<EE_ITEMS_START, EE_ITEMS_END>(*rSet.GetPool())); aFilteredSet.Put(rSet); rOutl.SetParaAttribs(0, aFilteredSet); } diff --git a/sw/source/core/doc/DocumentDeviceManager.cxx b/sw/source/core/doc/DocumentDeviceManager.cxx index 690a183e1fdc..1d49f23e7182 100644 --- a/sw/source/core/doc/DocumentDeviceManager.cxx +++ b/sw/source/core/doc/DocumentDeviceManager.cxx @@ -205,11 +205,11 @@ void DocumentDeviceManager::setJobsetup(/*[in]*/ const JobSetup &rJobSetup ) if( !mpPrt ) { //The ItemSet is deleted by Sfx! - 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>>(m_rDoc.GetAttrPool()); + auto pSet = std::make_unique<SfxItemSet>(SfxItemSet::makeFixedSfxItemSet< + 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>(m_rDoc.GetAttrPool())); VclPtr<SfxPrinter> p = VclPtr<SfxPrinter>::Create( std::move(pSet), rJobSetup ); if ( bCheckPageDescs ) setPrinter( p, true, true ); @@ -284,12 +284,11 @@ SfxPrinter& DocumentDeviceManager::CreatePrinter_() const // We create a default SfxPrinter. // The ItemSet is deleted by Sfx! - 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>>(m_rDoc.GetAttrPool()); - + auto pSet = std::make_unique<SfxItemSet>(SfxItemSet::makeFixedSfxItemSet< + 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>(m_rDoc.GetAttrPool())); VclPtr<SfxPrinter> pNewPrt = VclPtr<SfxPrinter>::Create( std::move(pSet) ); // assign PrintData to newly created printer diff --git a/sw/source/core/doc/DocumentRedlineManager.cxx b/sw/source/core/doc/DocumentRedlineManager.cxx index 90c11ed7f9a9..653ff6175bf6 100644 --- a/sw/source/core/doc/DocumentRedlineManager.cxx +++ b/sw/source/core/doc/DocumentRedlineManager.cxx @@ -429,11 +429,10 @@ namespace // using Undo, remove direct paragraph formatting of the "To" paragraph, // and apply here direct paragraph formatting of the "From" paragraph - 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> - aTmp(rDoc.GetAttrPool()); + SfxItemSet aTmp(SfxItemSet::makeFixedSfxItemSet< + 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>(rDoc.GetAttrPool())); SfxItemSet aTmp2(aTmp); pToNode->GetParaAttr(aTmp, 0, 0); diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index 8f5e70d5110d..083df79ae5fc 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -872,10 +872,9 @@ void FlatFndBox::FillFlat(const FndBox_& rBox, bool bLastBox) SfxItemState::SET == pFormat->GetItemState( RES_BOXATR_FORMULA ) || SfxItemState::SET == pFormat->GetItemState( RES_BOXATR_VALUE ) ) { - SfxItemSetFixed< - RES_VERT_ORIENT, RES_VERT_ORIENT, - RES_BOXATR_FORMAT, RES_BOXATR_VALUE> - aSet(m_pDoc->GetAttrPool()); + SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet< + RES_VERT_ORIENT, RES_VERT_ORIENT, + RES_BOXATR_FORMAT, RES_BOXATR_VALUE>(m_pDoc->GetAttrPool())); aSet.Put( pFormat->GetAttrSet() ); if( m_vItemSets.empty() ) { diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index feb300507db2..f26438d4ebd8 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 ); } - SfxItemSetFixed<RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1> aCharSet( GetAttrPool() ); + SfxItemSet aCharSet(SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1>(GetAttrPool())); SwNodeIndex aNdIdx( *pTableNd, 1 ); // Set to StartNode of first Box SwTableLines& rLines = rNdTable.GetTabLines(); @@ -772,7 +772,7 @@ const SwTable* SwDoc::TextToTable( const SwInsertTableOptions& rInsTableOpts, aBoxFormatArr2 = std::vector<SwTableBoxFormat*>( nBoxArrLen, nullptr ); } - SfxItemSetFixed<RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1> aCharSet( GetAttrPool() ); + SfxItemSet aCharSet(SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1>(GetAttrPool())); SwHistory* pHistory = pUndo ? &pUndo->GetHistory() : nullptr; @@ -3131,11 +3131,10 @@ void sw_BoxSetSplitBoxFormats( SwTableBox* pBox, SwCollectTableLineBoxes* pSplPa } else { - 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() ); + SfxItemSet aTmpSet(SfxItemSet::makeFixedSfxItemSet< + RES_LR_SPACE, RES_UL_SPACE, RES_PROTECT, RES_PROTECT, + RES_VERT_ORIENT, RES_VERT_ORIENT, RES_BACKGROUND, + RES_SHADOW>(pFormat->GetDoc()->GetAttrPool())); aTmpSet.Put( pFormat->GetAttrSet() ); if( aTmpSet.Count() ) pBox->ClaimFrameFormat()->SetFormatAttr( aTmpSet ); @@ -3738,7 +3737,7 @@ static bool lcl_SetAFormatBox(FndBox_ & rBox, SetAFormatTabPara *pSetPara, bool pSetBox->SetDirectFormatting(false); SwDoc* pDoc = pSetBox->GetFrameFormat()->GetDoc(); - SfxItemSetFixed<RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1> aCharSet(pDoc->GetAttrPool()); + SfxItemSet aCharSet(SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_BEGIN, RES_PARATR_LIST_END-1>(pDoc->GetAttrPool())); SfxItemSet aBoxSet(pDoc->GetAttrPool(), aTableBoxSetRange); sal_uInt8 nPos = pSetPara->nAFormatLine * 4 + pSetPara->nAFormatBox; const bool bSingleRowTable = pSetPara->bSingleRowTable; @@ -4117,7 +4116,7 @@ void SwDoc::ChkBoxNumFormat( SwTableBox& rBox, bool bCallUpdate ) } SwTableBoxFormat* pBoxFormat = rBox.GetFrameFormat(); - SfxItemSetFixed<RES_BOXATR_FORMAT, RES_BOXATR_VALUE> aBoxSet( GetAttrPool() ); + SfxItemSet aBoxSet(SfxItemSet::makeFixedSfxItemSet<RES_BOXATR_FORMAT, RES_BOXATR_VALUE>(GetAttrPool())); bool bLockModify = true; bool bSetNumberFormat = IsInsTableFormatNum(); @@ -4265,8 +4264,7 @@ void SwDoc::ClearLineNumAttrs( SwPosition const & rPos ) && pTextNode->GetText().isEmpty())) return; - SfxItemSetFixed<RES_PARATR_BEGIN, RES_PARATR_END - 1> - rSet( pTextNode->GetDoc().GetAttrPool() ); + SfxItemSet rSet(SfxItemSet::makeFixedSfxItemSet<RES_PARATR_BEGIN, RES_PARATR_END - 1>(pTextNode->GetDoc().GetAttrPool())); pTextNode->SwContentNode::GetAttr( rSet ); const SfxStringItem* pFormatItem = rSet.GetItemIfSet( RES_PARATR_NUMRULE, false ); if ( !pFormatItem ) diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx index 71ac0b067c53..e8ffc2c98848 100644 --- a/sw/source/filter/html/htmlctxt.cxx +++ b/sw/source/filter/html/htmlctxt.cxx @@ -478,7 +478,7 @@ bool SwHTMLParser::DoPositioning( SfxItemSet &rItemSet, // - there's a given width if( SwCSS1Parser::MayBePositioned( rPropInfo ) ) { - SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1> aFrameItemSet( m_xDoc->GetAttrPool() ); + SfxItemSet aFrameItemSet(SfxItemSet::makeFixedSfxItemSet<RES_FRMATR_BEGIN, RES_FRMATR_END-1>(m_xDoc->GetAttrPool())); if( !IsNewDoc() ) Reader::ResetFrameFormatAttrs(aFrameItemSet ); @@ -801,8 +801,8 @@ void SwHTMLParser::SplitPREListingXMP( HTMLAttrContext *pCntxt ) SfxItemSet *HTMLAttrContext::GetFrameItemSet( SwDoc *pCreateDoc ) { if( !m_pFrameItemSet && pCreateDoc ) - m_pFrameItemSet = std::make_unique<SfxItemSetFixed<RES_FRMATR_BEGIN, RES_FRMATR_END-1>> - ( pCreateDoc->GetAttrPool() ); + m_pFrameItemSet = std::make_unique<SfxItemSet>(SfxItemSet::makeFixedSfxItemSet< + RES_FRMATR_BEGIN, RES_FRMATR_END-1>(pCreateDoc->GetAttrPool())); return m_pFrameItemSet.get(); } diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index 8e51c4c232b3..dacf8308fe72 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(SwCursorSkipMode::Chars, true, 1, false ); - SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONT> aSet(m_rSh.GetAttrPool()); + SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_FONT, RES_CHRATR_FONT>(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); - SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONT> aSet(m_rSh.GetAttrPool()); + SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_FONT, RES_CHRATR_FONT>(m_rSh.GetAttrPool())); m_rSh.GetCurAttr( aSet ); const SvxFontItem &rFont = aSet.Get( RES_CHRATR_FONT ); @@ -212,7 +212,7 @@ void SwInsFootNoteDlg::Init() sNumStr = aFootnoteNote.GetNumStr(); m_rSh.Right(SwCursorSkipMode::Chars, true, 1, false ); - SfxItemSetFixed<RES_CHRATR_FONT, RES_CHRATR_FONT> aSet(m_rSh.GetAttrPool()); + SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_FONT, RES_CHRATR_FONT>(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/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx index 74ac10c03e78..7d4d4e251b67 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -1444,7 +1444,7 @@ bool SwFieldMgr::InsertField( { &aFormat }); } - SfxItemSetFixed<RES_BOXATR_FORMULA, RES_BOXATR_FORMULA> aBoxSet( pCurShell->GetAttrPool() ); + SfxItemSet aBoxSet(SfxItemSet::makeFixedSfxItemSet<RES_BOXATR_FORMULA, RES_BOXATR_FORMULA>(pCurShell->GetAttrPool())); OUString sFormula(comphelper::string::stripStart(rData.m_sPar2, ' ')); if ( sFormula.startsWith("=") ) diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx b/sw/source/uibase/frmdlg/frmmgr.cxx index 275bd4a8cb66..d9213858eed3 100644 --- a/sw/source/uibase/frmdlg/frmmgr.cxx +++ b/sw/source/uibase/frmdlg/frmmgr.cxx @@ -171,7 +171,7 @@ void SwFlyFrameAttrMgr::UpdateFlyFrame() const SwFormatAnchor *pGItem, *pItem; if( (pItem = m_aSet.GetItemIfSet( RES_ANCHOR, false )) ) { - SfxItemSetFixed<RES_ANCHOR, RES_ANCHOR> aGetSet( *m_aSet.GetPool() ); + SfxItemSet aGetSet(SfxItemSet::makeFixedSfxItemSet<RES_ANCHOR, RES_ANCHOR>(*m_aSet.GetPool())); if( m_pOwnSh->GetFlyFrameAttr( aGetSet ) && 1 == aGetSet.Count() && (pGItem = aGetSet.GetItemIfSet( RES_ANCHOR, false )) && pGItem->GetAnchorId() == pItem->GetAnchorId() ) diff --git a/sw/source/uibase/lingu/hhcwrp.cxx b/sw/source/uibase/lingu/hhcwrp.cxx index 47bf47d0f537..9cfb85ba725b 100644 --- a/sw/source/uibase/lingu/hhcwrp.cxx +++ b/sw/source/uibase/lingu/hhcwrp.cxx @@ -312,7 +312,7 @@ void SwHHCWrapper::ChangeText_impl( const OUString &rNewText, bool bKeepAttribut if (bKeepAttributes) { // get item set with all relevant attributes - SfxItemSetFixed<RES_CHRATR_BEGIN, RES_FRMATR_END> aItemSet( m_rWrtShell.GetAttrPool() ); + SfxItemSet aItemSet(SfxItemSet::makeFixedSfxItemSet<RES_CHRATR_BEGIN, RES_FRMATR_END>(m_rWrtShell.GetAttrPool())); // get all attributes spanning the whole selection in order to // restore those for the new text m_rWrtShell.GetCurAttr( aItemSet ); @@ -461,10 +461,9 @@ void SwHHCWrapper::ReplaceUnit( OSL_ENSURE( GetTargetLanguage() == LANGUAGE_CHINESE_SIMPLIFIED || GetTargetLanguage() == LANGUAGE_CHINESE_TRADITIONAL, "SwHHCWrapper::ReplaceUnit : unexpected target language" ); - SfxItemSetFixed< - RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT, - RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE> - aSet( m_rWrtShell.GetAttrPool() ); + SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet< + RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT, + RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_LANGUAGE>(m_rWrtShell.GetAttrPool())); if (pNewUnitLanguage) { aSet.Put( SvxLanguageItem( *pNewUnitLanguage, RES_CHRATR_CJK_LANGUAGE ) ); diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index 0231546f1504..7e8430897fb6 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -499,7 +499,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( pView) != nullptr ); SwModule::get()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, eMetric)); */ - SfxItemSetFixed<XATTR_FILLSTYLE, XATTR_FILLCOLOR, EE_ITEMS_START, EE_ITEMS_END> aDlgAttr(GetPool()); + SfxItemSet aDlgAttr(SfxItemSet::makeFixedSfxItemSet<XATTR_FILLSTYLE, XATTR_FILLCOLOR, EE_ITEMS_START, EE_ITEMS_END>(GetPool())); // util::Language does not exist in the EditEngine! Therefore not included in the set. @@ -552,10 +552,9 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( pView) != nullptr ); SwModule::get()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, eMetric)); */ - SfxItemSetFixed< - EE_ITEMS_START, EE_ITEMS_END, - SID_ATTR_PARA_HYPHENZONE, SID_ATTR_PARA_WIDOWS> - aDlgAttr( GetPool() ); + SfxItemSet aDlgAttr(SfxItemSet::makeFixedSfxItemSet< + EE_ITEMS_START, EE_ITEMS_END, + SID_ATTR_PARA_HYPHENZONE, SID_ATTR_PARA_WIDOWS>(GetPool())); aDlgAttr.Put(aEditAttr); @@ -597,10 +596,9 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) if( !static_cast<const SfxBoolItem*>(pPoolItem)->GetValue() ) bLeftToRight = !bLeftToRight; } - SfxItemSetFixed< - EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR, - EE_PARA_JUST, EE_PARA_JUST> - aAttr( *aNewAttr.GetPool() ); + SfxItemSet aAttr(SfxItemSet::makeFixedSfxItemSet< + EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR, + EE_PARA_JUST, EE_PARA_JUST>(*aNewAttr.GetPool())); SvxAdjust nAdjust = SvxAdjust::Left; if( const SvxAdjustItem* pAdjustItem = aEditAttr.GetItemIfSet(EE_PARA_JUST ) ) @@ -1867,10 +1865,9 @@ void SwAnnotationShell::InsertSymbol(SfxRequest& rReq) pOutliner->SetUpdateLayout(false); SfxItemSet aOldSet( pOLV->GetAttribs() ); - SfxItemSetFixed< - EE_CHAR_FONTINFO, EE_CHAR_FONTINFO, - EE_CHAR_FONTINFO_CJK, EE_CHAR_FONTINFO_CTL> - aFontSet( *aOldSet.GetPool() ); + SfxItemSet aFontSet(SfxItemSet::makeFixedSfxItemSet< + EE_CHAR_FONTINFO, EE_CHAR_FONTINFO, EE_CHAR_FONTINFO_CJK, + EE_CHAR_FONTINFO_CTL>(*aOldSet.GetPool())); aFontSet.Set( aOldSet ); // Insert string diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index 27806d9d688a..bc6e8b74254d 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -692,7 +692,7 @@ void SwTextShell::StateInsert( SfxItemSet &rSet ) case SID_HYPERLINK_GETLINK: { - SfxItemSetFixed<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT> aSet(GetPool()); + SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet<RES_TXTATR_INETFMT, RES_TXTATR_INETFMT>(GetPool())); rSh.GetCurAttr( aSet ); SvxHyperlinkItem aHLinkItem; @@ -981,9 +981,10 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) } SwWrtShell &rSh = GetShell(); - 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() ); + SfxItemSet aSet(SfxItemSet::makeFixedSfxItemSet< + RES_CHRATR_FONT, RES_CHRATR_FONT, + RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT, + RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONT>(GetPool())); rSh.GetCurAttr( aSet ); SvtScriptType nScript = rSh.GetScriptType(); @@ -1080,9 +1081,10 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq ) aNewFontItem->SetPitch( aNewFont.GetPitch()); aNewFontItem->SetCharSet( aNewFont.GetCharSet() ); - 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() ); + SfxItemSet aRestoreSet(SfxItemSet::makeFixedSfxItemSet< + RES_CHRATR_FONT, RES_CHRATR_FONT, + RES_CHRATR_CJK_FONT, RES_CHRATR_CJK_FONT, + RES_CHRATR_CTL_FONT, RES_CHRATR_CTL_FONT>(GetPool())); nScript = g_pBreakIt->GetAllScriptsOfText( aChars ); if( SvtScriptType::LATIN & nScript ) diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx index e4e89e76c1eb..95dfe297fdce 100644 --- a/sw/source/uibase/uiview/view0.cxx +++ b/sw/source/uibase/uiview/view0.cxx @@ -787,7 +787,7 @@ void SwView::ExecFormatFootnote() void SwView::ExecNumberingOutline(SfxItemPool & rPool) { - SfxItemSetFixed<FN_PARAM_1, FN_PARAM_1> aTmp(rPool); + SfxItemSet aTmp(SfxItemSet::makeFixedSfxItemSet<FN_PARAM_1, FN_PARAM_1>(rPool)); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateOutlineTabDialog(GetFrameWeld(), &aTmp, GetWrtShell())); pDlg->StartExecuteAsync(