From 03998c25358f88a9fd6ac306ad1aba81fceca0fe Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 24 Sep 2021 14:20:49 +0200 Subject: use SfxItemSetFixed in svx Change-Id: I8123b34c73a16579b59989ae31329dec378d8b98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122584 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svx/source/dialog/databaseregistrationui.cxx | 2 +- svx/source/dialog/dlgctl3d.cxx | 7 +++---- svx/source/dialog/hdft.cxx | 11 +++++------ svx/source/dialog/imapwnd.cxx | 3 ++- svx/source/engine3d/float3d.cxx | 2 +- svx/source/engine3d/view3d1.cxx | 4 ++-- svx/source/sdr/properties/e3dcompoundproperties.cxx | 4 ++-- svx/source/sdr/properties/e3dsceneproperties.cxx | 2 +- svx/source/sdr/properties/textproperties.cxx | 2 +- svx/source/svdraw/svddrgmt.cxx | 2 +- svx/source/svdraw/svdedtv2.cxx | 5 ++--- svx/source/svdraw/svdfmtf.cxx | 4 ++-- svx/source/svdraw/svdoashp.cxx | 5 ++--- svx/source/svdraw/svdotext.cxx | 5 ++--- svx/source/svdraw/svdotxed.cxx | 2 +- svx/source/svdraw/svdpdf.cxx | 2 +- svx/source/table/cell.cxx | 3 +-- svx/source/table/tablecontroller.cxx | 2 +- svx/source/tbxctrls/grafctrl.cxx | 4 ++-- svx/source/unodraw/unoshape.cxx | 2 +- 20 files changed, 34 insertions(+), 39 deletions(-) (limited to 'svx') diff --git a/svx/source/dialog/databaseregistrationui.cxx b/svx/source/dialog/databaseregistrationui.cxx index 1bc9ef29b985..aa62b5b38877 100644 --- a/svx/source/dialog/databaseregistrationui.cxx +++ b/svx/source/dialog/databaseregistrationui.cxx @@ -31,7 +31,7 @@ namespace svx { sal_uInt16 nResult = RET_CANCEL; - SfxItemSet aRegistrationItems( SfxGetpApp()->GetPool(), svl::Items ); + SfxItemSetFixed aRegistrationItems( SfxGetpApp()->GetPool() ); SvxAbstractDialogFactory* pDialogFactory = SvxAbstractDialogFactory::Create(); ScopedVclPtr pDialog(pDialogFactory->CreateSfxDialog(parentWindow, aRegistrationItems, nullptr, RID_SFXPAGE_DBREGISTER)); diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index 46c2b3f31fc4..ecefacf7b2a4 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -122,9 +122,8 @@ void Svx3DPreviewControl::Construct() // invalidate SnapRects of objects mpScene->SetBoundAndSnapRectsDirty(); - SfxItemSet aSet( mpModel->GetItemPool(), - svl::Items ); + SfxItemSetFixed aSet( mpModel->GetItemPool() ); aSet.Put( XLineStyleItem( drawing::LineStyle_NONE ) ); aSet.Put( XFillStyleItem( drawing::FillStyle_SOLID ) ); aSet.Put( XFillColorItem( "", COL_WHITE ) ); @@ -180,7 +179,7 @@ void Svx3DPreviewControl::SetObjectType(SvxPreviewObjectType nType) if(mnObjectType == nType && mp3DObj) return; - SfxItemSet aSet(mpModel->GetItemPool(), svl::Items); + SfxItemSetFixed aSet(mpModel->GetItemPool()); mnObjectType = nType; if( mp3DObj ) diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx index 6bf8f0668b95..d687d0ba6fa0 100644 --- a/svx/source/dialog/hdft.cxx +++ b/svx/source/dialog/hdft.cxx @@ -207,7 +207,7 @@ bool SvxHFPage::FillItemSet( SfxItemSet* rSet ) DBG_ASSERT(pPool,"no pool :-("); MapUnit eUnit = pPool->GetMetric(nWSize); // take over DrawingLayer FillStyles - SfxItemSet aSet(*pPool, svl::Items); + SfxItemSetFixed aSet(*pPool); // Keep it valid aSet.MergeRange(nWSize, nWSize); aSet.MergeRange(nWLRSpace, nWLRSpace); @@ -642,8 +642,7 @@ IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, weld::Button&, void) // create FillAttributes from SvxBrushItem const SvxBrushItem& rItem = static_cast(pBBSet->Get(nWhich)); - SfxItemSet aTempSet(*pBBSet->GetPool(), - svl::Items); + SfxItemSetFixed aTempSet(*pBBSet->GetPool()); setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); aFillAttributes = @@ -717,7 +716,7 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet ) { // create FillAttributes from SvxBrushItem const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich)); - SfxItemSet aTempSet(*rTmpSet.GetPool(), svl::Items); + SfxItemSetFixed aTempSet(*rTmpSet.GetPool()); setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); aHeaderFillAttributes = std::make_shared(aTempSet); @@ -753,7 +752,7 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet ) { // create FillAttributes from SvxBrushItem const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rTmpSet.Get(nWhich)); - SfxItemSet aTempSet(*rTmpSet.GetPool(), svl::Items); + SfxItemSetFixed aTempSet(*rTmpSet.GetPool()); setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); aFooterFillAttributes = std::make_shared(aTempSet); @@ -779,7 +778,7 @@ void SvxHFPage::ResetBackground_Impl( const SfxItemSet& rSet ) { // create FillAttributes from SvxBrushItem const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rSet.Get(nWhich)); - SfxItemSet aTempSet(*rSet.GetPool(), svl::Items); + SfxItemSetFixed aTempSet(*rSet.GetPool()); setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); aPageFillAttributes = std::make_shared(aTempSet); diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 0d90d3dcef4e..bd987d99b735 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -659,7 +659,8 @@ void IMapWindow::DoMacroAssign() if ( !pSdrObj ) return; - SfxItemSet aSet(*pIMapPool, svl::Items); + SfxItemSetFixed + aSet(*pIMapPool); SfxEventNamesItem aNamesItem(SID_EVENTCONFIG); aNamesItem.AddEvent( "MouseOver", "", SvMacroItemId::OnMouseOver ); diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index 790f5e740b16..0ad3c1cd74af 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -2746,7 +2746,7 @@ void Svx3DWin::UpdatePreview() } // Get Itemset - SfxItemSet aSet( pModel->GetItemPool(), svl::Items); + SfxItemSetFixed aSet( pModel->GetItemPool() ); // Get Attributes and set the preview GetAttr( aSet ); diff --git a/svx/source/engine3d/view3d1.cxx b/svx/source/engine3d/view3d1.cxx index 617eaebe9706..22ec229bfd09 100644 --- a/svx/source/engine3d/view3d1.cxx +++ b/svx/source/engine3d/view3d1.cxx @@ -118,7 +118,7 @@ SfxItemSet E3dView::Get3DAttributes() const if(!nSelectedItems) { // Get defaults and apply - SfxItemSet aDefaultSet(mpModel->GetItemPool(), svl::Items); + SfxItemSetFixed aDefaultSet(mpModel->GetItemPool()); GetAttributes(aDefaultSet); aSet.Put(aDefaultSet); @@ -158,7 +158,7 @@ void E3dView::Set3DAttributes( const SfxItemSet& rAttr) if(!nSelectedItems) { // Set defaults - SfxItemSet aDefaultSet(mpModel->GetItemPool(), svl::Items); + SfxItemSetFixed aDefaultSet(mpModel->GetItemPool()); aDefaultSet.Put(rAttr); SetAttributes(aDefaultSet); } diff --git a/svx/source/sdr/properties/e3dcompoundproperties.cxx b/svx/source/sdr/properties/e3dcompoundproperties.cxx index e3fe78e47679..c31d85fdc9de 100644 --- a/svx/source/sdr/properties/e3dcompoundproperties.cxx +++ b/svx/source/sdr/properties/e3dcompoundproperties.cxx @@ -56,7 +56,7 @@ namespace sdr::properties GetObjectItemSet(); // add filtered scene properties (SDRATTR_3DSCENE_) to local itemset - SfxItemSet aSet(*mxItemSet->GetPool(), svl::Items); + SfxItemSetFixed aSet(*mxItemSet->GetPool() ); aSet.Put(pScene->GetProperties().GetObjectItemSet()); mxItemSet->Put(aSet); } @@ -77,7 +77,7 @@ namespace sdr::properties GetObjectItemSet(); // Generate filtered scene properties (SDRATTR_3DSCENE_) itemset - SfxItemSet aSet(*mxItemSet->GetPool(), svl::Items); + SfxItemSetFixed aSet(*mxItemSet->GetPool()); aSet.Put(rSet); if(bClearAllItems) diff --git a/svx/source/sdr/properties/e3dsceneproperties.cxx b/svx/source/sdr/properties/e3dsceneproperties.cxx index f04bc4b88236..b4700a89a8d1 100644 --- a/svx/source/sdr/properties/e3dsceneproperties.cxx +++ b/svx/source/sdr/properties/e3dsceneproperties.cxx @@ -53,7 +53,7 @@ namespace sdr::properties if(mxItemSet) { // filter for SDRATTR_3DSCENE_ items, only keep those items - SfxItemSet aNew(*mxItemSet->GetPool(), svl::Items); + SfxItemSetFixed aNew(*mxItemSet->GetPool()); aNew.Put(*mxItemSet); mxItemSet->ClearItem(); mxItemSet->Put(aNew); diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx index 77ed512a57bf..75bbb9a89e37 100644 --- a/svx/source/sdr/properties/textproperties.cxx +++ b/svx/source/sdr/properties/textproperties.cxx @@ -478,7 +478,7 @@ namespace sdr::properties if(bHasURL) { - SfxItemSet aColorSet(*aSet.GetPool(), svl::Items ); + SfxItemSetFixed aColorSet(*aSet.GetPool()); aColorSet.Put(aSet, false); ESelection aSel(nPara, 0); diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index ef744f881906..525cbb3360a2 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -3834,7 +3834,7 @@ bool SdrDragCrop::EndSdrDrag(bool /*bCopy*/) sal_Int32 nBottomCrop = static_cast( rOldCrop.GetBottom() - nDiffBottom * fScaleY ); SfxItemPool& rPool = getSdrDragView().GetModel()->GetItemPool(); - SfxItemSet aSet( rPool, svl::Items ); + SfxItemSetFixed aSet( rPool ); aSet.Put( SdrGrafCropItem( nLeftCrop, nTopCrop, nRightCrop, nBottomCrop ) ); getSdrDragView().SetAttributes( aSet, false ); } diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index 4e5a5e3c4f43..1d04e2eb381a 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -558,10 +558,9 @@ void SdrEditView::ImpCopyAttributes(const SdrObject* pSource, SdrObject* pDest) if(!(pSource && pDest)) return; - SfxItemSet aSet(mpModel->GetItemPool(), - svl::Items); + EE_ITEMS_START, EE_ITEMS_END> aSet(mpModel->GetItemPool()); aSet.Put(pSource->GetMergedItemSet()); diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index be753c35eaa1..e62186225370 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -720,7 +720,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaRoundRectAction const & rAct) SetAttributes(pRect); tools::Long nRad=(rAct.GetHorzRound()+rAct.GetVertRound())/2; if (nRad!=0) { - SfxItemSet aSet(*mpLineAttr->GetPool(), svl::Items); + SfxItemSetFixed aSet(*mpLineAttr->GetPool()); aSet.Put(SdrMetricItem(SDRATTR_CORNER_RADIUS, nRad)); pRect->SetMergedItemSet(aSet); } @@ -1046,7 +1046,7 @@ void ImpSdrGDIMetaFileImport::ImportText( const Point& rPos, const OUString& rSt if (!aFnt.IsTransparent()) { - SfxItemSet aAttr(*mpFillAttr->GetPool(), svl::Items); + SfxItemSetFixed aAttr(*mpFillAttr->GetPool()); aAttr.Put(XFillStyleItem(drawing::FillStyle_SOLID)); aAttr.Put(XFillColorItem(OUString(), aFnt.GetFillColor())); pText->SetMergedItemSet(aAttr); diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 5cdd00a77e39..20a072b912ab 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -2215,11 +2215,10 @@ void SdrObjCustomShape::SetVerticalWriting( bool bVertical ) tools::Rectangle aObjectRect = GetLogicRect(); // prepare ItemSet to set exchanged width and height items - SfxItemSet aNewSet(*rSet.GetPool(), - svl::Items); + SDRATTR_TEXT_AUTOGROWWIDTH, SDRATTR_TEXT_HORZADJUST> aNewSet(*rSet.GetPool()); aNewSet.Put(rSet); diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 3ad373cad189..c21a19db27b5 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -1503,11 +1503,10 @@ void SdrTextObj::SetVerticalWriting(bool bVertical) tools::Rectangle aObjectRect = GetSnapRect(); // prepare ItemSet to set exchanged width and height items - SfxItemSet aNewSet(*rSet.GetPool(), - svl::Items); + SDRATTR_TEXT_AUTOGROWWIDTH, SDRATTR_TEXT_HORZADJUST> aNewSet(*rSet.GetPool()); aNewSet.Put(rSet); aNewSet.Put(makeSdrTextAutoGrowWidthItem(bAutoGrowHeight)); diff --git a/svx/source/svdraw/svdotxed.cxx b/svx/source/svdraw/svdotxed.cxx index bbcdc2a7add9..96523d679471 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(); - SfxItemSet aFilteredSet(*rSet.GetPool(), svl::Items); + SfxItemSetFixed aFilteredSet(*rSet.GetPool()); aFilteredSet.Put(rSet); rOutl.SetParaAttribs(0, aFilteredSet); } diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx index 3e253ede4fde..ee6a59102c5d 100644 --- a/svx/source/svdraw/svdpdf.cxx +++ b/svx/source/svdraw/svdpdf.cxx @@ -828,7 +828,7 @@ void ImpSdrPdfImport::InsertTextObject(const Point& rPos, const Size& rSize, con if (!aFont.IsTransparent()) { - SfxItemSet aAttr(*mpFillAttr->GetPool(), svl::Items); + SfxItemSetFixed aAttr(*mpFillAttr->GetPool()); aAttr.Put(XFillStyleItem(drawing::FillStyle_SOLID)); aAttr.Put(XFillColorItem(OUString(), aFont.GetFillColor())); pText->SetMergedItemSet(aAttr); diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 427977d591e6..3abce7c4d820 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -346,8 +346,7 @@ namespace sdr::properties bool bAutoGrowHeight = rSet.Get(SDRATTR_TEXT_AUTOGROWHEIGHT).GetValue(); // prepare ItemSet to set exchanged width and height items - SfxItemSet aNewSet(*rSet.GetPool(), - svl::Items); + SfxItemSetFixed aNewSet(*rSet.GetPool()); aNewSet.Put(rSet); aNewSet.Put(makeSdrTextAutoGrowWidthItem(bAutoGrowHeight)); diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index a0f1d36fd92a..ba3079e292a3 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -2749,7 +2749,7 @@ void SvxTableController::SetAttrToSelectedShape(const SfxItemSet& rAttr) return; // Filter out non-shadow items from rAttr. - SfxItemSet aSet(*rAttr.GetPool(), svl::Items); + SfxItemSetFixed aSet(*rAttr.GetPool()); aSet.Put(rAttr); // Set shadow items on the marked shape. diff --git a/svx/source/tbxctrls/grafctrl.cxx b/svx/source/tbxctrls/grafctrl.cxx index 1751c7ea2844..4baee3c82a83 100644 --- a/svx/source/tbxctrls/grafctrl.cxx +++ b/svx/source/tbxctrls/grafctrl.cxx @@ -501,7 +501,7 @@ VclPtr SvxGrafModeToolBoxControl::CreateItemWindow( vcl::Wind void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView ) { SfxItemPool& rPool = rView.GetModel()->GetItemPool(); - SfxItemSet aSet( rPool, svl::Items ); + SfxItemSetFixed aSet( rPool ); OUString aUndoStr; const bool bUndo = rView.IsUndoEnabled(); @@ -618,7 +618,7 @@ void SvxGrafAttrHelper::ExecuteGrafAttr( SfxRequest& rReq, SdrView& rView ) if( ( pObj->GetGraphicType() != GraphicType::NONE ) && ( pObj->GetGraphicType() != GraphicType::Default ) ) { - SfxItemSet aGrfAttr( rPool, svl::Items ); + SfxItemSetFixed aGrfAttr( rPool ); const MapUnit eOldMetric = rPool.GetMetric( 0 ); aGrfAttr.Put(pObj->GetMergedItemSet()); diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index b900d7a35eed..47676618c106 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -624,7 +624,7 @@ void SvxShape::ObtainSettingsFromPropertySet(const SvxItemPropertySet& rPropSet) DBG_TESTSOLARMUTEX(); if(HasSdrObject() && maUrsAnys.AreThereOwnUsrAnys()) { - SfxItemSet aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), svl::Items); + SfxItemSetFixed aSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool() ); Reference< beans::XPropertySet > xShape(this); SvxItemPropertySet_ObtainSettingsFromPropertySet(rPropSet, maUrsAnys, aSet, xShape, &mpPropSet->getPropertyMap() ); -- cgit