From afaa10da25729f2aa5ca7df86d6bbea83d45cccf Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 18 Jan 2017 16:04:17 +0200 Subject: [PATCH] make SfxItemSet with SAL_WARN_UNUSED Change-Id: Ia74ca329d8438f614169031acfbe0406faf7c281 Reviewed-on: https://gerrit.libreoffice.org/33268 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- chart2/source/controller/main/ShapeController.cxx | 2 -- filter/source/msfilter/svdfppt.cxx | 2 -- include/svl/itemset.hxx | 2 +- sd/source/core/drawdoc.cxx | 1 - sd/source/ui/func/futempl.cxx | 1 - svl/source/items/itemprop.cxx | 5 ----- sw/source/uibase/shells/annotsh.cxx | 4 ---- 7 files changed, 1 insertion(+), 16 deletions(-) diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx index 8c68892a498e..58b70e6bfecc 100644 --- a/chart2/source/controller/main/ShapeController.cxx +++ b/chart2/source/controller/main/ShapeController.cxx @@ -303,8 +303,6 @@ void ShapeController::executeDispatch_FormatArea() pFact->CreateSvxAreaTabDialog( pParent, &aAttr, &pDrawModelWrapper->getSdrModel(), true ) ); if ( pDlg.get() ) { - SfxItemPool& rItemPool = pDrawViewWrapper->GetModel()->GetItemPool(); - SfxItemSet aSet( rItemPool, rItemPool.GetFirstWhich(), rItemPool.GetLastWhich() ); if ( pDlg->Execute() == RET_OK ) { const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet(); diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index aa5f8d44dca9..af09b9d0221c 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -7423,7 +7423,6 @@ void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell >& xCell ) {//vertical writing xPropSet->setPropertyValue( "TextWritingMode" , Any( css::text::WritingMode_TB_RL ) ); } - SfxItemSet aSet( pObj->GetMergedItemSet() ); drawing::FillStyle eFillStyle(static_cast(pObj->GetMergedItem( XATTR_FILLSTYLE )).GetValue()); css::drawing::FillStyle eFS( css::drawing::FillStyle_NONE ); switch( eFillStyle ) @@ -7503,7 +7502,6 @@ void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >& xTabl { try { - SfxItemSet aSet( pLine->GetMergedItemSet() ); drawing::LineStyle eLineStyle(static_cast(pLine->GetMergedItem( XATTR_LINESTYLE )).GetValue()); css::table::BorderLine2 aBorderLine; switch( eLineStyle ) diff --git a/include/svl/itemset.hxx b/include/svl/itemset.hxx index 502c0ebc2c99..8c1ebd5b8109 100644 --- a/include/svl/itemset.hxx +++ b/include/svl/itemset.hxx @@ -31,7 +31,7 @@ class SvStream; typedef std::map SfxItemMap; -class SVL_DLLPUBLIC SfxItemSet +class SAL_WARN_UNUSED SVL_DLLPUBLIC SfxItemSet { friend class SfxItemIter; diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index df8afd126746..3868bd8c2857 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -301,7 +301,6 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh) // Set the StyleSheetPool for HitTestOutliner. // The link to the StyleRequest handler of the document is set later, in // NewOrLoadCompleted, because only then do all the templates exist. - SfxItemSet aSet2( pHitTestOutliner->GetEmptyItemSet() ); pHitTestOutliner->SetStyleSheetPool( static_cast(GetStyleSheetPool()) ); SetCalcFieldValueHdl( pHitTestOutliner ); diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx index 33d8a0e654a2..bd978008831b 100644 --- a/sd/source/ui/func/futempl.cxx +++ b/sd/source/ui/func/futempl.cxx @@ -299,7 +299,6 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) ScopedVclPtr pPresDlg; SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create(); bool bOldDocInOtherLanguage = false; - SfxItemSet aOriSet( pStyleSheet->GetItemSet() ); SfxStyleFamily eFamily = pStyleSheet->GetFamily(); diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx index e6ac2eddcc49..70669963d8b7 100644 --- a/svl/source/items/itemprop.cxx +++ b/svl/source/items/itemprop.cxx @@ -234,11 +234,6 @@ void SfxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry& rEn SfxItemState eState = rSet.GetItemState( rEntry.nWID, true, &pItem ); if (SfxItemState::SET != eState && SfxItemPool::IsWhich(rEntry.nWID)) pItem = &rSet.GetPool()->GetDefaultItem(rEntry.nWID); - //maybe there's another way to find an Item - if(eState < SfxItemState::DEFAULT) - { - SfxItemSet aSet(*rSet.GetPool(), rEntry.nWID, rEntry.nWID); - } if(!pNewItem && pItem) { pNewItem.reset(pItem->Clone()); diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index 92f465580767..70f399c4876e 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -893,8 +893,6 @@ void SwAnnotationShell::ExecClpbrd(SfxRequest &rReq) return; OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView(); - SfxItemSet aEditAttr(pOLV->GetAttribs()); - SfxItemSet aNewAttr(*aEditAttr.GetPool(), aEditAttr.GetRanges()); long aOldHeight = pPostItMgr->GetActiveSidebarWin()->GetPostItTextHeight(); sal_uInt16 nSlot = rReq.GetSlot(); @@ -1229,7 +1227,6 @@ void SwAnnotationShell::ExecLingu(SfxRequest &rReq) return; OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView(); - SfxItemSet aEditAttr(pOLV->GetAttribs()); sal_uInt16 nSlot = rReq.GetSlot(); SwWrtShell &rSh = rView.GetWrtShell(); bool bRestoreSelection = false; @@ -1353,7 +1350,6 @@ void SwAnnotationShell::GetLinguState(SfxItemSet &rSet) return; OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView(); - SfxItemSet aEditAttr(pOLV->GetAttribs()); SfxWhichIter aIter(rSet); sal_uInt16 nWhich = aIter.FirstWhich();