diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-03 16:42:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-03-06 06:00:38 +0000 |
commit | 7139563afe073b0e4e819fdaf7fe285e597f4c5f (patch) | |
tree | 927396085af6961ae7fbe7f3bb5f2821a5c35f0e /sw | |
parent | aadf790bbceb1cde94c2a6fe8edfb9951edca0a0 (diff) |
make use of the SfxItemSet::GetItem<T> method
Change-Id: I8201429993129b019a6dd51c203a9f8dcbb2253e
Reviewed-on: https://gerrit.libreoffice.org/34867
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/swunohelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par4.cxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewtab.cxx | 12 |
5 files changed, 11 insertions, 12 deletions
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index b44e7ebbf7ad..dbca147c552b 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -4864,7 +4864,7 @@ sal_uInt32 SwTextNode::GetRsid( sal_Int32 nStt, sal_Int32 nEnd ) const SfxItemSet aSet( (SfxItemPool&) (GetDoc()->GetAttrPool()), RES_CHRATR_RSID, RES_CHRATR_RSID ); if ( GetAttr(aSet, nStt, nEnd) ) { - const SvxRsidItem* pRsid = static_cast<const SvxRsidItem*>(aSet.GetItem(RES_CHRATR_RSID)); + const SvxRsidItem* pRsid = aSet.GetItem<SvxRsidItem>(RES_CHRATR_RSID); if( pRsid ) return pRsid->GetValue(); } diff --git a/sw/source/core/unocore/swunohelper.cxx b/sw/source/core/unocore/swunohelper.cxx index c6dd8fb5f20c..8044bfbc4691 100644 --- a/sw/source/core/unocore/swunohelper.cxx +++ b/sw/source/core/unocore/swunohelper.cxx @@ -263,7 +263,7 @@ bool UCB_GetFileListOfFolder( const OUString& rURL, bool needToMapFillItemsToSvxBrushItemTypes(const SfxItemSet& rSet, sal_uInt16 const nMID) { - const XFillStyleItem* pXFillStyleItem(static_cast< const XFillStyleItem* >(rSet.GetItem(XATTR_FILLSTYLE, false))); + const XFillStyleItem* pXFillStyleItem(rSet.GetItem<XFillStyleItem>(XATTR_FILLSTYLE, false)); if(!pXFillStyleItem) { diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 017df5b103c7..d0fad8f5eb5d 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -285,7 +285,7 @@ void MSWordExportBase::OutputItemSet( const SfxItemSet& rSet, bool bPapFormat, b } // Has to be called after RES_PARATR_GRABBAG is processed. - const XFillStyleItem* pXFillStyleItem(static_cast<const XFillStyleItem*>(rSet.GetItem(XATTR_FILLSTYLE))); + const XFillStyleItem* pXFillStyleItem(rSet.GetItem<XFillStyleItem>(XATTR_FILLSTYLE)); if (pXFillStyleItem && pXFillStyleItem->GetValue() == drawing::FillStyle_SOLID && !rSet.HasItem(RES_BACKGROUND)) { // Construct an SvxBrushItem, as expected by the exporters. @@ -803,7 +803,7 @@ void MSWordExportBase::OutputFormat( const SwFormat& rFormat, bool bPapFormat, b if (SfxItemState::SET != aSet.GetItemState(RES_SURROUND)) aSet.Put(SwFormatSurround(css::text::WrapTextMode_NONE)); - const XFillStyleItem* pXFillStyleItem(static_cast< const XFillStyleItem* >(rFrameFormat.GetAttrSet().GetItem(XATTR_FILLSTYLE))); + const XFillStyleItem* pXFillStyleItem(rFrameFormat.GetAttrSet().GetItem<XFillStyleItem>(XATTR_FILLSTYLE)); if (pXFillStyleItem) { switch (pXFillStyleItem->GetValue()) diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index b27d98362854..6f03cbb6a77b 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -380,8 +380,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph, if (pFlySet) { - if (const SwFormatFrameSize* pSize = - static_cast<const SwFormatFrameSize*>(pFlySet->GetItem(RES_FRM_SIZE, false))) + if (const SwFormatFrameSize* pSize = pFlySet->GetItem<SwFormatFrameSize>(RES_FRM_SIZE, false)) { aRect.SetSize(pSize->GetSize()); } diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index 9423c5990ae0..c656c404047b 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -2242,8 +2242,8 @@ void SwView::StateTabWin(SfxItemSet& rSet) rSet.Put( SfxBoolItem(SID_ATTR_PAGE_FOOTER, bFooterOn ) ); if(bFooterOn) { - const SvxLRSpaceItem* rLR = static_cast<const SvxLRSpaceItem*>(rFooter.GetFooterFormat()->GetAttrSet().GetItem(SID_ATTR_LRSPACE)); - const SvxULSpaceItem* rUL = static_cast<const SvxULSpaceItem*>(rFooter.GetFooterFormat()->GetAttrSet().GetItem(SID_ATTR_ULSPACE)); + const SvxLRSpaceItem* rLR = rFooter.GetFooterFormat()->GetAttrSet().GetItem<SvxLRSpaceItem>(SID_ATTR_LRSPACE); + const SvxULSpaceItem* rUL = rFooter.GetFooterFormat()->GetAttrSet().GetItem<SvxULSpaceItem>(SID_ATTR_ULSPACE); SvxLongLRSpaceItem aLR(rLR->GetLeft(), rLR->GetRight(), SID_ATTR_PAGE_FOOTER_LRMARGIN); rSet.Put(aLR); SvxLongULSpaceItem aUL( rUL->GetUpper(), rUL->GetLower(), SID_ATTR_PAGE_FOOTER_SPACING); @@ -2274,7 +2274,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) { case (drawing::FillStyle_SOLID): { - Color aColor = static_cast<const XFillColorItem*>( aSet.GetItem( XATTR_FILLCOLOR, false ) )->GetColorValue(); + Color aColor = aSet.GetItem<XFillColorItem>( XATTR_FILLCOLOR, false )->GetColorValue(); XFillColorItem aFillColorItem( OUString(), aColor ); aFillColorItem.SetWhich( SID_ATTR_PAGE_COLOR ); rSet.Put( aFillColorItem ); @@ -2283,7 +2283,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) case (drawing::FillStyle_GRADIENT): { - const XGradient& xGradient = static_cast<const XFillGradientItem*>( aSet.GetItem( XATTR_FILLGRADIENT ) )->GetGradientValue(); + const XGradient& xGradient = aSet.GetItem<XFillGradientItem>( XATTR_FILLGRADIENT )->GetGradientValue(); XFillGradientItem aFillGradientItem( OUString(), xGradient, SID_ATTR_PAGE_GRADIENT ); rSet.Put( aFillGradientItem ); } @@ -2291,7 +2291,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) case (drawing::FillStyle_HATCH): { - const XFillHatchItem *pFillHatchItem( static_cast<const XFillHatchItem*>( aSet.GetItem( XATTR_FILLHATCH ) ) ); + const XFillHatchItem *pFillHatchItem( aSet.GetItem<XFillHatchItem>( XATTR_FILLHATCH ) ); XFillHatchItem aFillHatchItem( pFillHatchItem->GetName(), pFillHatchItem->GetHatchValue()); aFillHatchItem.SetWhich( SID_ATTR_PAGE_HATCH ); rSet.Put( aFillHatchItem ); @@ -2300,7 +2300,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) case (drawing::FillStyle_BITMAP): { - const XFillBitmapItem *pFillBitmapItem = static_cast<const XFillBitmapItem*>( aSet.GetItem( XATTR_FILLBITMAP ) ); + const XFillBitmapItem *pFillBitmapItem = aSet.GetItem<XFillBitmapItem>( XATTR_FILLBITMAP ); XFillBitmapItem aFillBitmapItem( pFillBitmapItem->GetName(), pFillBitmapItem->GetGraphicObject() ); aFillBitmapItem.SetWhich( SID_ATTR_PAGE_BITMAP ); rSet.Put( aFillBitmapItem ); |