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 /svx | |
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 'svx')
-rw-r--r-- | svx/source/table/cell.cxx | 4 | ||||
-rw-r--r-- | svx/source/table/tablelayouter.cxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 4 | ||||
-rw-r--r-- | svx/source/toolbars/extrusionbar.cxx | 16 | ||||
-rw-r--r-- | svx/source/toolbars/fontworkbar.cxx | 6 | ||||
-rw-r--r-- | svx/source/unodraw/unobrushitemhelper.cxx | 2 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 4 |
7 files changed, 19 insertions, 19 deletions
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 0d3b4d444e35..a5637875a821 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -1376,7 +1376,7 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName ) case XATTR_FILLHATCH: case XATTR_LINEDASH: { - const NameOrIndex* pItem = static_cast<const NameOrIndex*>(rSet.GetItem((sal_uInt16)pMap->nWID)); + const NameOrIndex* pItem = rSet.GetItem<NameOrIndex>((sal_uInt16)pMap->nWID); if( ( pItem == nullptr ) || pItem->GetName().isEmpty() ) eState = PropertyState_DEFAULT_VALUE; } @@ -1391,7 +1391,7 @@ PropertyState SAL_CALL Cell::getPropertyState( const OUString& PropertyName ) case XATTR_LINESTART: case XATTR_FILLFLOATTRANSPARENCE: { - const NameOrIndex* pItem = static_cast<const NameOrIndex*>(rSet.GetItem((sal_uInt16)pMap->nWID)); + const NameOrIndex* pItem = rSet.GetItem<NameOrIndex>((sal_uInt16)pMap->nWID); if( pItem == nullptr ) eState = PropertyState_DEFAULT_VALUE; } diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx index e90c19999fcf..efba5de5ef01 100644 --- a/svx/source/table/tablelayouter.cxx +++ b/svx/source/table/tablelayouter.cxx @@ -1009,7 +1009,7 @@ void TableLayouter::UpdateBorderLayout() if( !xCell.is() ) continue; - const SvxBoxItem* pThisAttr = static_cast<const SvxBoxItem*>(xCell->GetItemSet().GetItem( SDRATTR_TABLE_BORDER )); + const SvxBoxItem* pThisAttr = xCell->GetItemSet().GetItem<SvxBoxItem>( SDRATTR_TABLE_BORDER ); OSL_ENSURE(pThisAttr,"sdr::table::TableLayouter::UpdateBorderLayout(), no border attribute?"); if( !pThisAttr ) diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 99f93e194dec..a0f5c5eece48 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -678,9 +678,9 @@ void SvxStyleBox_Impl::SetupEntry(vcl::RenderContext& rRenderContext, vcl::Windo if (!pItemSet) return; const SvxFontItem * const pFontItem = - static_cast<const SvxFontItem*>(pItemSet->GetItem(SID_ATTR_CHAR_FONT)); + pItemSet->GetItem<SvxFontItem>(SID_ATTR_CHAR_FONT); const SvxFontHeightItem * const pFontHeightItem = - static_cast<const SvxFontHeightItem*>(pItemSet->GetItem(SID_ATTR_CHAR_FONTHEIGHT)); + pItemSet->GetItem<SvxFontHeightItem>(SID_ATTR_CHAR_FONTHEIGHT); if ( pFontItem && pFontHeightItem ) { diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx index 9a60fa42e44a..481388ad269f 100644 --- a/svx/source/toolbars/extrusionbar.cxx +++ b/svx/source/toolbars/extrusionbar.cxx @@ -177,7 +177,7 @@ static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem { if( rReq.GetArgs() && rReq.GetArgs()->GetItemState( SID_EXTRUSION_DIRECTION ) == SfxItemState::SET ) { - sal_Int32 nSkew = static_cast<const SfxInt32Item*>(rReq.GetArgs()->GetItem(SID_EXTRUSION_DIRECTION))->GetValue(); + sal_Int32 nSkew = rReq.GetArgs()->GetItem<SfxInt32Item>(SID_EXTRUSION_DIRECTION)->GetValue(); Position3D aViewPoint( 3472, -3472, 25000 ); double fOriginX = 0.50; @@ -261,7 +261,7 @@ static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem { if( rReq.GetArgs() && rReq.GetArgs()->GetItemState( SID_EXTRUSION_PROJECTION ) == SfxItemState::SET ) { - sal_Int32 nProjection = static_cast<const SfxInt32Item*>(rReq.GetArgs()->GetItem(SID_EXTRUSION_PROJECTION))->GetValue(); + sal_Int32 nProjection = rReq.GetArgs()->GetItem<SfxInt32Item>(SID_EXTRUSION_PROJECTION)->GetValue(); ProjectionMode eProjectionMode = nProjection == 1 ? ProjectionMode_PARALLEL : ProjectionMode_PERSPECTIVE; css::beans::PropertyValue aPropValue; aPropValue.Name = "ProjectionMode"; @@ -274,7 +274,7 @@ static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem { if( rReq.GetArgs() && rReq.GetArgs()->GetItemState( SID_EXTRUSION_DEPTH ) == SfxItemState::SET) { - double fDepth = static_cast<const SvxDoubleItem*>(rReq.GetArgs()->GetItem(SID_EXTRUSION_DEPTH))->GetValue(); + double fDepth = rReq.GetArgs()->GetItem<SvxDoubleItem>(SID_EXTRUSION_DEPTH)->GetValue(); double fFraction = 0.0; EnhancedCustomShapeParameterPair aDepthPropPair; aDepthPropPair.First.Value <<= fDepth; @@ -318,7 +318,7 @@ static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem { if( rReq.GetArgs() && rReq.GetArgs()->GetItemState( SID_EXTRUSION_SURFACE ) == SfxItemState::SET) { - sal_Int32 nSurface = static_cast<const SfxInt32Item*>(rReq.GetArgs()->GetItem(SID_EXTRUSION_SURFACE))->GetValue(); + sal_Int32 nSurface = rReq.GetArgs()->GetItem<SfxInt32Item>(SID_EXTRUSION_SURFACE)->GetValue(); ShadeMode eShadeMode( ShadeMode_FLAT ); bool bMetal = false; @@ -365,7 +365,7 @@ static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem { if( rReq.GetArgs() && rReq.GetArgs()->GetItemState( SID_EXTRUSION_LIGHTING_INTENSITY ) == SfxItemState::SET) { - sal_Int32 nLevel = static_cast<const SfxInt32Item*>(rReq.GetArgs()->GetItem(SID_EXTRUSION_LIGHTING_INTENSITY))->GetValue(); + sal_Int32 nLevel = rReq.GetArgs()->GetItem<SfxInt32Item>(SID_EXTRUSION_LIGHTING_INTENSITY)->GetValue(); double fBrightness; bool bHarsh2 = false; @@ -425,7 +425,7 @@ static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem { if( rReq.GetArgs() && rReq.GetArgs()->GetItemState( SID_EXTRUSION_LIGHTING_DIRECTION ) == SfxItemState::SET) { - sal_Int32 nDirection = static_cast<const SfxInt32Item*>(rReq.GetArgs()->GetItem(SID_EXTRUSION_LIGHTING_DIRECTION))->GetValue(); + sal_Int32 nDirection = rReq.GetArgs()->GetItem<SfxInt32Item>(SID_EXTRUSION_LIGHTING_DIRECTION)->GetValue(); if((nDirection >= 0) && (nDirection < 9)) { @@ -568,8 +568,8 @@ void ExtrusionBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rB (rReq.GetArgs()->GetItemState( SID_EXTRUSION_DEPTH ) == SfxItemState::SET) && (rReq.GetArgs()->GetItemState( SID_ATTR_METRIC ) == SfxItemState::SET)) { - double fDepth = static_cast<const SvxDoubleItem*>(rReq.GetArgs()->GetItem(SID_EXTRUSION_DEPTH))->GetValue(); - FieldUnit eUnit = (FieldUnit)static_cast<const SfxUInt16Item*>(rReq.GetArgs()->GetItem(SID_ATTR_METRIC))->GetValue(); + double fDepth = rReq.GetArgs()->GetItem<SvxDoubleItem>(SID_EXTRUSION_DEPTH)->GetValue(); + FieldUnit eUnit = (FieldUnit)rReq.GetArgs()->GetItem<SfxUInt16Item>(SID_ATTR_METRIC)->GetValue(); ScopedVclPtrInstance< ExtrusionDepthDialog > aDlg(nullptr, fDepth, eUnit); sal_uInt16 nRet = aDlg->Execute(); diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx index f8632057d4a5..493571b51614 100644 --- a/svx/source/toolbars/fontworkbar.cxx +++ b/svx/source/toolbars/fontworkbar.cxx @@ -269,7 +269,7 @@ static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem { if( rReq.GetArgs() && rReq.GetArgs()->GetItemState( SID_FONTWORK_ALIGNMENT ) == SfxItemState::SET ) { - sal_Int32 nValue = static_cast<const SfxInt32Item*>(rReq.GetArgs()->GetItem(SID_FONTWORK_ALIGNMENT))->GetValue(); + sal_Int32 nValue = rReq.GetArgs()->GetItem<SfxInt32Item>(SID_FONTWORK_ALIGNMENT)->GetValue(); if ( ( nValue >= 0 ) && ( nValue < 5 ) ) { SdrFitToSizeType eFTS = SdrFitToSizeType::NONE; @@ -294,7 +294,7 @@ static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem { if( rReq.GetArgs() && ( rReq.GetArgs()->GetItemState( SID_FONTWORK_CHARACTER_SPACING ) == SfxItemState::SET ) ) { - sal_Int32 nCharSpacing = static_cast<const SfxInt32Item*>(rReq.GetArgs()->GetItem(SID_FONTWORK_CHARACTER_SPACING))->GetValue(); + sal_Int32 nCharSpacing = rReq.GetArgs()->GetItem<SfxInt32Item>(SID_FONTWORK_CHARACTER_SPACING)->GetValue(); pObj->SetMergedItem( SvxCharScaleWidthItem( (sal_uInt16)nCharSpacing, EE_CHAR_FONTWIDTH ) ); pObj->BroadcastObjectChange(); } @@ -484,7 +484,7 @@ void FontworkBar::execute( SdrView* pSdrView, SfxRequest& rReq, SfxBindings& rBi { if( rReq.GetArgs() && ( rReq.GetArgs()->GetItemState( SID_FONTWORK_CHARACTER_SPACING ) == SfxItemState::SET ) ) { - sal_Int32 nCharSpacing = static_cast<const SfxInt32Item*>(rReq.GetArgs()->GetItem(SID_FONTWORK_CHARACTER_SPACING))->GetValue(); + sal_Int32 nCharSpacing = rReq.GetArgs()->GetItem<SfxInt32Item>(SID_FONTWORK_CHARACTER_SPACING)->GetValue(); ScopedVclPtrInstance< FontworkCharacterSpacingDialog > aDlg( nullptr, nCharSpacing ); sal_uInt16 nRet = aDlg->Execute(); if( nRet != 0 ) diff --git a/svx/source/unodraw/unobrushitemhelper.cxx b/svx/source/unodraw/unobrushitemhelper.cxx index c3d547d973d7..5f610e1dacb3 100644 --- a/svx/source/unodraw/unobrushitemhelper.cxx +++ b/svx/source/unodraw/unobrushitemhelper.cxx @@ -194,7 +194,7 @@ SvxBrushItem getSvxBrushItemForSolid(const SfxItemSet& rSourceSet, bool bSearchI //UUUU SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents, bool bXMLImportHack) { - const XFillStyleItem* pXFillStyleItem(static_cast< const XFillStyleItem* >(rSourceSet.GetItem(XATTR_FILLSTYLE, bSearchInParents))); + const XFillStyleItem* pXFillStyleItem(rSourceSet.GetItem<XFillStyleItem>(XATTR_FILLSTYLE, bSearchInParents)); if(!pXFillStyleItem || drawing::FillStyle_NONE == pXFillStyleItem->GetValue()) { diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 1f2688921915..46a69cd8d2b2 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -2030,7 +2030,7 @@ beans::PropertyState SAL_CALL SvxShape::_getPropertyState( const OUString& Prope case XATTR_FILLHATCH: case XATTR_LINEDASH: { - const NameOrIndex* pItem = static_cast<const NameOrIndex*>(rSet.GetItem((sal_uInt16)pMap->nWID)); + const NameOrIndex* pItem = rSet.GetItem<NameOrIndex>((sal_uInt16)pMap->nWID); if( ( pItem == nullptr ) || pItem->GetName().isEmpty() ) eState = beans::PropertyState_DEFAULT_VALUE; } @@ -2045,7 +2045,7 @@ beans::PropertyState SAL_CALL SvxShape::_getPropertyState( const OUString& Prope case XATTR_LINESTART: case XATTR_FILLFLOATTRANSPARENCE: { - const NameOrIndex* pItem = static_cast<const NameOrIndex*>(rSet.GetItem((sal_uInt16)pMap->nWID)); + const NameOrIndex* pItem = rSet.GetItem<NameOrIndex>((sal_uInt16)pMap->nWID); if ( pItem == nullptr ) eState = beans::PropertyState_DEFAULT_VALUE; } |