From 13bb5a4b09f5b2ad19dad1b55f45d0fe2b2fb908 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 16 Jun 2017 09:58:13 +0200 Subject: Make SfxItemSet ranges correct by construction This is a follow-up to 45a7f5b62d0b1b21763c1c94255ef2309ea4280b "Keep WID ranges sorted, and join adjacent ones". While SfxItemSet::MergeRange relies on the m_pWhichRanges being sorted (and, under DBG_UTIL, asserts if they are not), the various SfxItemSet constructors curiously only check (via assert or DBG_ASSERT) that each individual range has an upper bound not smaller than its lower bound. Arguably, all SfxItemSet instances should fulfill the stronger guarantees required and checked by MergeRange. And in many cases the ranges are statically known, so that the checking can happen at compile time. Therefore, replace the two SfxItemSet ctors taking explicit ranges with two other ctors that actually do proper checking. The (templated) overload taking an svl::Items struct should be used in all cases where the range values are statically known at compile time, while the overload taking a std::initializer_list is for the remaining cases (that can only do runtime checking via assert). Most of those latter cases are simple cases with a single range covering a single item, but a few are more complex. (At least some of the uses of the existing SfxItemSet overload taking a const sal_uInt16* pWhichPairTable can probably also be strengthened, but that is left for another day.) This commit is the first in a series of two. Apart from the manual changes to compilerplugins/clang/store/sfxitemsetrewrite.cxx, include/svl/itemset.hxx, and svl/source/items/itemset.cxx, it only consists of automatic rewriting of the relevant SfxItemSet ctor calls (plus a few required manual fixes, see next). But it does not yet check that the individual ranges are properly sorted (see the TODO in svl::detail::validGap). That check will be enabled, and the ensuing manual fixes will be made in a follow-up commit, to reduce the likelyhood of accidents. There were three cases of necessary manual intervention: * sw/source/core/unocore/unostyle.cxx uses eAtr of enum type RES_FRMATR in braced-init-list syntax now, so needs explicit narrowing conversion to sal_uInt16. * In sw/source/uibase/uiview/formatclipboard.cxx, the trailiing comma in the definition of macro FORMAT_PAINTBRUSH_FRAME_IDS needed to be removed manually. * In svx/source/svdraw/svdoashp.cxx, svx/source/svdraw/svdotext.cxx, sw/source/uibase/app/docstyle.cxx, sw/source/uibase/shells/frmsh.cxx, sw/source/uibase/shells/grfsh.cxx, and sw/source/uibase/shells/textsh1.cxx, some comments had to be put back (see "TODO: the replaced range can contain relevant comments" in compilerplugins/clang/store/sfxitemsetrewrite.cxx). A few uses of the variadic form erroneously used nullptr instead of 0 for termination. But this should have been harmless even if promoted std::nullptr_t is larger than promoted sal_uInt16, assuming that the part of the nullptr value that was interpreted as sal_uInt16/promoted int was all-zero bits. Similarly, some uses made the harmless error of using 0L instead of 0. Change-Id: I2afea97282803cb311b9321a99bb627520ef5e35 Reviewed-on: https://gerrit.libreoffice.org/38861 Reviewed-by: Stephan Bergmann Tested-by: Stephan Bergmann --- sc/source/ui/app/scmod.cxx | 7 +++---- sc/source/ui/docshell/docsh3.cxx | 5 ++--- sc/source/ui/drawfunc/drawsh.cxx | 4 ++-- sc/source/ui/drawfunc/drawsh5.cxx | 2 +- sc/source/ui/drawfunc/drtxtob.cxx | 8 ++++---- sc/source/ui/drawfunc/drtxtob1.cxx | 5 ++--- sc/source/ui/drawfunc/drtxtob2.cxx | 9 ++++----- sc/source/ui/drawfunc/fuconcustomshape.cxx | 6 ++---- sc/source/ui/drawfunc/futext.cxx | 4 ++-- sc/source/ui/pagedlg/tphf.cxx | 4 ++-- sc/source/ui/unoobj/confuno.cxx | 5 ++--- sc/source/ui/view/cellsh1.cxx | 2 +- sc/source/ui/view/cellsh2.cxx | 2 +- sc/source/ui/view/cellsh3.cxx | 8 ++++---- sc/source/ui/view/drawview.cxx | 2 +- sc/source/ui/view/formatsh.cxx | 12 ++++++------ sc/source/ui/view/gridwin2.cxx | 2 +- sc/source/ui/view/gridwin3.cxx | 2 +- sc/source/ui/view/pivotsh.cxx | 2 +- sc/source/ui/view/prevwsh.cxx | 2 +- sc/source/ui/view/tabvwsh3.cxx | 2 +- sc/source/ui/view/tabvwshc.cxx | 12 ++++++------ sc/source/ui/view/viewfun2.cxx | 8 ++++---- sc/source/ui/view/viewfunc.cxx | 2 +- 24 files changed, 55 insertions(+), 62 deletions(-) (limited to 'sc/source/ui') diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index 8ca88ba3b886..db4637665612 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -405,7 +405,7 @@ void ScModule::Execute( SfxRequest& rReq ) bSet = !GetDocOptions().IsAutoSpell(); } - SfxItemSet aSet( GetPool(), SID_AUTOSPELL_CHECK, SID_AUTOSPELL_CHECK ); + SfxItemSet aSet( GetPool(), svl::Items{} ); aSet.Put( SfxBoolItem( SID_AUTOSPELL_CHECK, bSet ) ); ModifyOptions( aSet ); rReq.Done(); @@ -1932,7 +1932,7 @@ std::unique_ptr ScModule::CreateItemSet( sal_uInt16 nId ) { pRet = o3tl::make_unique( GetPool(), // TP_CALC: - SID_SCDOCOPTIONS, SID_SCDOCOPTIONS, + svl::Items ScModule::CreateItemSet( sal_uInt16 nId ) // TP_DEFAULTS SID_SCDEFAULTSOPTIONS, SID_SCDEFAULTSOPTIONS, // TP_FORMULA - SID_SCFORMULAOPTIONS, SID_SCFORMULAOPTIONS, - 0 ); + SID_SCFORMULAOPTIONS, SID_SCFORMULAOPTIONS>{} ); const ScAppOptions& rAppOpt = GetAppOptions(); diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index 2a6e39bad2f9..25d137b30f53 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -645,10 +645,9 @@ void ScDocShell::ExecuteChangeCommentDialog( ScChangeAction* pAction, vcl::Windo aDate += ScGlobal::pLocaleData->getTime( aDT, false ); SfxItemSet aSet( GetPool(), - SID_ATTR_POSTIT_AUTHOR, SID_ATTR_POSTIT_AUTHOR, + svl::Items{} ); aSet.Put( SvxPostItTextItem ( aComment, SID_ATTR_POSTIT_TEXT ) ); aSet.Put( SvxPostItAuthorItem( aAuthor, SID_ATTR_POSTIT_AUTHOR ) ); diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index 7d28bfe733f4..670d713774b7 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -122,7 +122,7 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) case SID_TEXT_STANDARD: // delete hard text attributes { - SfxItemSet aEmptyAttr(GetPool(), EE_ITEMS_START, EE_ITEMS_END); + SfxItemSet aEmptyAttr(GetPool(), svl::Items{}); pView->SetAttributes(aEmptyAttr, true); } break; @@ -334,7 +334,7 @@ void ScDrawShell::ExecuteMacroAssign( SdrObject* pObj, vcl::Window* pWin ) } // create empty itemset for macro-dlg - std::unique_ptr pItemSet(new SfxItemSet(SfxGetpApp()->GetPool(), SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG, 0 )); + std::unique_ptr pItemSet(new SfxItemSet(SfxGetpApp()->GetPool(), svl::Items{} )); pItemSet->Put ( aItem ); SfxEventNamesItem aNamesItem(SID_EVENTCONFIG); diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx index 1b7cb1f9107c..2bd0815df733 100644 --- a/sc/source/ui/drawfunc/drawsh5.cxx +++ b/sc/source/ui/drawfunc/drawsh5.cxx @@ -451,7 +451,7 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) const SfxBoolItem* pItem = rReq.GetArg(SID_ENABLE_HYPHENATION); if( pItem ) { - SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE ); + SfxItemSet aSet( GetPool(), svl::Items{} ); bool bValue = pItem->GetValue(); aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) ); pView->SetAttributes( aSet ); diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index a4b096213b49..92b092f758b0 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -801,7 +801,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) if ( pOutView ) pOutView->Paint( tools::Rectangle() ); - SfxItemSet aEmptyAttr( *aEditAttr.GetPool(), EE_ITEMS_START, EE_ITEMS_END ); + SfxItemSet aEmptyAttr( *aEditAttr.GetPool(), svl::Items{} ); pView->SetAttributes( aEmptyAttr, true ); if ( pOutView ) @@ -924,7 +924,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) sal_uInt16 nId = SID_ATTR_PARA_LRSPACE; const SvxLRSpaceItem& rItem = static_cast( pArgs->Get( nId )); - SfxItemSet aAttr( GetPool(), EE_PARA_LRSPACE, EE_PARA_LRSPACE ); + SfxItemSet aAttr( GetPool(), svl::Items{} ); nId = EE_PARA_LRSPACE; SvxLRSpaceItem aLRSpaceItem( rItem.GetLeft(), rItem.GetRight(), rItem.GetTextLeft(), @@ -936,7 +936,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) { SvxLineSpacingItem aLineSpaceItem = static_cast(pArgs->Get( GetPool().GetWhich(nSlot))); - SfxItemSet aAttr( GetPool(), EE_PARA_SBL, EE_PARA_SBL ); + SfxItemSet aAttr( GetPool(), svl::Items{} ); aAttr.Put( aLineSpaceItem ); pView->SetAttributes( aAttr ); } @@ -944,7 +944,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) { SvxULSpaceItem aULSpaceItem = static_cast(pArgs->Get( GetPool().GetWhich(nSlot))); - SfxItemSet aAttr( GetPool(), EE_PARA_ULSPACE, EE_PARA_ULSPACE ); + SfxItemSet aAttr( GetPool(), svl::Items{} ); aULSpaceItem.SetWhich(EE_PARA_ULSPACE); aAttr.Put( aULSpaceItem ); pView->SetAttributes( aAttr ); diff --git a/sc/source/ui/drawfunc/drtxtob1.cxx b/sc/source/ui/drawfunc/drtxtob1.cxx index c655351c888b..f6c1e339eb6b 100644 --- a/sc/source/ui/drawfunc/drtxtob1.cxx +++ b/sc/source/ui/drawfunc/drtxtob1.cxx @@ -72,13 +72,12 @@ bool ScDrawTextObjectBar::ExecuteParaDlg( const SfxItemSet& rArgs, { SfxItemPool* pArgPool = rArgs.GetPool(); SfxItemSet aNewAttr( *pArgPool, - EE_ITEMS_START, EE_ITEMS_END, + svl::Items{} ); aNewAttr.Put( rArgs ); // Values have been taken over once to show the dialog. diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx index 8b0fddfbfed6..8783ef9c27ba 100644 --- a/sc/source/ui/drawfunc/drtxtob2.cxx +++ b/sc/source/ui/drawfunc/drtxtob2.cxx @@ -91,7 +91,7 @@ void ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq ) case SID_TEXTDIRECTION_LEFT_TO_RIGHT: case SID_TEXTDIRECTION_TOP_TO_BOTTOM: { - SfxItemSet aAttr( pView->GetModel()->GetItemPool(), SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION, 0 ); + SfxItemSet aAttr( pView->GetModel()->GetItemPool(), svl::Items{} ); aAttr.Put( SvxWritingModeItem( nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ? css::text::WritingMode_LR_TB : css::text::WritingMode_TB_RL, @@ -107,7 +107,7 @@ void ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq ) const SfxBoolItem* pItem = rReq.GetArg(SID_ENABLE_HYPHENATION); if( pItem ) { - SfxItemSet aSet( GetPool(), EE_PARA_HYPHENATE, EE_PARA_HYPHENATE ); + SfxItemSet aSet( GetPool(), svl::Items{} ); bool bValue = pItem->GetValue(); aSet.Put( SfxBoolItem( EE_PARA_HYPHENATE, bValue ) ); pView->SetAttributes( aSet ); @@ -163,9 +163,8 @@ void ScDrawTextObjectBar::ExecuteExtra( SfxRequest &rReq ) case SID_ATTR_PARA_RIGHT_TO_LEFT: { SfxItemSet aAttr( pView->GetModel()->GetItemPool(), - EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR, - EE_PARA_JUST, EE_PARA_JUST, - 0 ); + svl::Items{} ); bool bLeft = ( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT ); aAttr.Put( SvxFrameDirectionItem( bLeft ? SvxFrameDirection::Horizontal_LR_TB : SvxFrameDirection::Horizontal_RL_TB, diff --git a/sc/source/ui/drawfunc/fuconcustomshape.cxx b/sc/source/ui/drawfunc/fuconcustomshape.cxx index 54d8470229f6..9cc4cd982c8f 100644 --- a/sc/source/ui/drawfunc/fuconcustomshape.cxx +++ b/sc/source/ui/drawfunc/fuconcustomshape.cxx @@ -168,7 +168,7 @@ void FuConstCustomShape::SetAttributes( SdrObject* pObj ) { const SfxItemSet& rSource = pSourceObj->GetMergedItemSet(); SfxItemSet aDest( pObj->GetModel()->GetItemPool(), // ranges from SdrAttrObj - SDRATTR_START, SDRATTR_SHADOW_LAST, + svl::Items{}); aDest.Set( rSource ); pObj->SetMergedItemSet( aDest ); sal_Int32 nAngle = pSourceObj->GetRotateAngle(); diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx index c7d735a32ae0..3062294a8292 100644 --- a/sc/source/ui/drawfunc/futext.cxx +++ b/sc/source/ui/drawfunc/futext.cxx @@ -413,7 +413,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) // set needed attributes for scrolling SfxItemSet aItemSet( pDrDoc->GetItemPool(), - SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST); + svl::Items{}); aItemSet.Put( makeSdrTextAutoGrowWidthItem( false ) ); aItemSet.Put( makeSdrTextAutoGrowHeightItem( false ) ); @@ -684,7 +684,7 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const tools::Rectan if(bMarquee) { - SfxItemSet aSet(pDrDoc->GetItemPool(), SDRATTR_MISC_FIRST, SDRATTR_MISC_LAST); + SfxItemSet aSet(pDrDoc->GetItemPool(), svl::Items{}); aSet.Put( makeSdrTextAutoGrowWidthItem( false ) ); aSet.Put( makeSdrTextAutoGrowHeightItem( false ) ); diff --git a/sc/source/ui/pagedlg/tphf.cxx b/sc/source/ui/pagedlg/tphf.cxx index 2a4e385c851c..0c6c0b04a157 100644 --- a/sc/source/ui/pagedlg/tphf.cxx +++ b/sc/source/ui/pagedlg/tphf.cxx @@ -44,8 +44,8 @@ ScHFPage::ScHFPage( vcl::Window* pParent, const SfxItemSet& rSet, sal_uInt16 nSe : SvxHFPage ( pParent, rSet, nSetId ), aDataSet ( *rSet.GetPool(), - ATTR_PAGE_HEADERLEFT, ATTR_PAGE_FOOTERRIGHT, - ATTR_PAGE, ATTR_PAGE, 0 ), + svl::Items{} ), nPageUsage ( SvxPageUsage::All ), pStyleDlg ( nullptr ) { diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx index 1cbab301bb6d..857b9d1bac4d 100644 --- a/sc/source/ui/unoobj/confuno.cxx +++ b/sc/source/ui/unoobj/confuno.cxx @@ -238,11 +238,10 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( SvMemoryStream aStream (aSequence.getArray(), nSize, StreamMode::READ ); aStream.Seek ( STREAM_SEEK_TO_BEGIN ); auto pSet = o3tl::make_unique( *rDoc.GetPool(), - SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN, + svl::Items{} ); pDocShell->SetPrinter( SfxPrinter::Create( aStream, std::move(pSet) ) ); } } diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 90700aa3ee5f..ff173fda39fe 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -3036,7 +3036,7 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq) ScopedVclPtr pDlg; ScSubTotalParam aSubTotalParam; - SfxItemSet aArgSet( GetPool(), SCITEM_SUBTDATA, SCITEM_SUBTDATA ); + SfxItemSet aArgSet( GetPool(), svl::Items{} ); // Only get existing named database range. ScDBData* pDBData = pTabViewShell->GetDBData(true, SC_DB_OLD); diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 3c6eec7a0b20..feeba69dc20a 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -478,7 +478,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) if( lcl_GetSortParam( pData, aSortParam ) ) { ScDocument* pDoc = GetViewData()->GetDocument(); - SfxItemSet aArgSet( GetPool(), SCITEM_SORTDATA, SCITEM_SORTDATA ); + SfxItemSet aArgSet( GetPool(), svl::Items{} ); pDBData->GetSortParam( aSortParam ); bool bHasHeader = pDoc->HasColHeader( aSortParam.nCol1, aSortParam.nRow1, aSortParam.nCol2, aSortParam.nRow2, pData->GetTabNo() ); diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index 1b3105b87aab..b2be50b1ba05 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -331,13 +331,13 @@ void ScCellShell::Execute( SfxRequest& rReq ) std::unique_ptr pEmptySet( new SfxItemSet( *pReqArgs->GetPool(), - ATTR_PATTERN_START, - ATTR_PATTERN_END )); + svl::Items{} )); std::unique_ptr pNewSet( new SfxItemSet( *pReqArgs->GetPool(), - ATTR_PATTERN_START, - ATTR_PATTERN_END )); + svl::Items{} )); const SfxPoolItem* pAttr = nullptr; sal_uInt16 nWhich = 0; diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index e8b2e064bd85..23cbe4ddf408 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -997,7 +997,7 @@ SdrObject* ScDrawView::ApplyGraphicToObject( { AddUndo(new SdrUndoAttrObj(rHitObject)); - SfxItemSet aSet(GetModel()->GetItemPool(), XATTR_FILLSTYLE, XATTR_FILLBITMAP); + SfxItemSet aSet(GetModel()->GetItemPool(), svl::Items{}); aSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP)); aSet.Put(XFillBitmapItem(OUString(), rGraphic)); diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 7dd4bfb5dd54..6895e17c064b 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -1033,7 +1033,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq ) } short nType = GetCurrentNumberFormatType(); - SfxItemSet aSet( GetPool(), nSlot, nSlot ); + SfxItemSet aSet( GetPool(), {{nSlot, nSlot}} ); switch ( nSlot ) { case SID_NUMBER_TWODEC: @@ -1239,7 +1239,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq ) const SfxItemSet& rOldSet = pTabViewShell->GetSelectionPattern()->GetItemSet(); SfxItemPool* pDocPool = GetViewData()->GetDocument()->GetPool(); - SfxItemSet aNewSet( *pDocPool, ATTR_PATTERN_START, ATTR_PATTERN_END ); + SfxItemSet aNewSet( *pDocPool, svl::Items{} ); aNewSet.Put( *pItem ); pTabViewShell->ApplyAttributes( &aNewSet, &rOldSet ); } @@ -1873,13 +1873,13 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq ) std::unique_ptr pOldSet( new SfxItemSet( *(pDoc->GetPool()), - ATTR_PATTERN_START, - ATTR_PATTERN_END )); + svl::Items{} )); std::unique_ptr pNewSet( new SfxItemSet( *(pDoc->GetPool()), - ATTR_PATTERN_START, - ATTR_PATTERN_END )); + svl::Items{} )); const SfxPoolItem& rBorderAttr = pOldAttrs->GetItemSet(). Get( ATTR_BORDER ); diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx index 46f6ed82e251..7688dd25b9a2 100644 --- a/sc/source/ui/view/gridwin2.cxx +++ b/sc/source/ui/view/gridwin2.cxx @@ -199,7 +199,7 @@ void ScGridWindow::DoPushPivotButton( SCCOL nCol, SCROW nRow, const MouseEvent& } SfxItemSet aArgSet( pViewData->GetViewShell()->GetPool(), - SCITEM_QUERYDATA, SCITEM_QUERYDATA ); + svl::Items{} ); aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA, pViewData, &aQueryParam ) ); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx index 3383f18d0720..fb6aba1ee455 100644 --- a/sc/source/ui/view/gridwin3.cxx +++ b/sc/source/ui/view/gridwin3.cxx @@ -332,7 +332,7 @@ void ScGridWindow::UpdateStatusPosSize() if (!pPV) return; // shouldn't be called in that case either - SfxItemSet aSet(pViewData->GetViewShell()->GetPool(), SID_ATTR_POSITION, SID_ATTR_SIZE); + SfxItemSet aSet(pViewData->GetViewShell()->GetPool(), svl::Items{}); // Fill items for position and size: // show action rectangle during action, diff --git a/sc/source/ui/view/pivotsh.cxx b/sc/source/ui/view/pivotsh.cxx index 2c96d3e62a5a..185000c9c866 100644 --- a/sc/source/ui/view/pivotsh.cxx +++ b/sc/source/ui/view/pivotsh.cxx @@ -100,7 +100,7 @@ void ScPivotShell::Execute( SfxRequest& rReq ) ScViewData& rViewData = pViewShell->GetViewData(); SfxItemSet aArgSet( pViewShell->GetPool(), - SCITEM_QUERYDATA, SCITEM_QUERYDATA ); + svl::Items{} ); aArgSet.Put( ScQueryItem( SCITEM_QUERYDATA, &rViewData, &aQueryParam ) ); ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index 3bd8aed1684f..6d86d188e7fb 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -627,7 +627,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq ) } else { - SfxItemSet aSet ( GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM ); + SfxItemSet aSet ( GetPool(), svl::Items{} ); SvxZoomItem aZoomItem( SvxZoomType::PERCENT, pPreview->GetZoom(), SID_ATTR_ZOOM ); aSet.Put( aZoomItem ); diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index d6d11f18c79e..559aa45506bc 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -706,7 +706,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) } else { - SfxItemSet aSet ( GetPool(), SID_ATTR_ZOOM, SID_ATTR_ZOOM ); + SfxItemSet aSet ( GetPool(), svl::Items{} ); SvxZoomItem aZoomItem( eOldZoomType, nOldZoom, SID_ATTR_ZOOM ); ScopedVclPtr pDlg; ScMarkData& rMark = GetViewData().GetMarkData(); diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 7cbcaed65b9b..53ad7ede5038 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -203,8 +203,8 @@ VclPtr ScTabViewShell::CreateRefDialog( case SID_OPENDLG_CONSOLIDATE: { SfxItemSet aArgSet( GetPool(), - SCITEM_CONSOLIDATEDATA, - SCITEM_CONSOLIDATEDATA ); + svl::Items{} ); const ScConsolidateParam* pDlgData = pDoc->GetConsolidateDlgData(); @@ -254,8 +254,8 @@ VclPtr ScTabViewShell::CreateRefDialog( { ScQueryParam aQueryParam; SfxItemSet aArgSet( GetPool(), - SCITEM_QUERYDATA, - SCITEM_QUERYDATA ); + svl::Items{} ); ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, ScGetDBSelection::RowDown); pDBData->ExtendDataArea(pDoc); @@ -284,8 +284,8 @@ VclPtr ScTabViewShell::CreateRefDialog( ScQueryParam aQueryParam; SfxItemSet aArgSet( GetPool(), - SCITEM_QUERYDATA, - SCITEM_QUERYDATA ); + svl::Items{} ); ScDBData* pDBData = GetDBData(false, SC_DB_MAKE, ScGetDBSelection::RowDown); pDBData->ExtendDataArea(pDoc); diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx index dec005d3561a..36e22d64ab24 100644 --- a/sc/source/ui/view/viewfun2.cxx +++ b/sc/source/ui/view/viewfun2.cxx @@ -3126,12 +3126,12 @@ void ScViewFunc::SetSelectionFrameLines( const SvxBorderLine* pLine, { std::unique_ptr pOldSet(new SfxItemSet( *(pDoc->GetPool()), - ATTR_PATTERN_START, - ATTR_PATTERN_END )); + svl::Items{} )); std::unique_ptr pNewSet(new SfxItemSet( *(pDoc->GetPool()), - ATTR_PATTERN_START, - ATTR_PATTERN_END )); + svl::Items{} )); SvxBorderLine aLine; diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index db6edf9d6112..6e09d4b6291b 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -981,7 +981,7 @@ void ScViewFunc::ApplyAttr( const SfxPoolItem& rAttrItem ) } ScPatternAttr aNewAttrs( o3tl::make_unique( *GetViewData().GetDocument()->GetPool(), - ATTR_PATTERN_START, ATTR_PATTERN_END ) ); + svl::Items{} ) ); aNewAttrs.GetItemSet().Put( rAttrItem ); // if justify is set (with Buttons), always indentation 0 -- cgit v1.2.3