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 | |
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>
30 files changed, 67 insertions, 69 deletions
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index 3c283573a607..5a3e94cf758f 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -1619,7 +1619,7 @@ void SvxExtParagraphTabPage::Reset( const SfxItemSet* rSet ) { m_pPageNumBox->EnableTriState(false); m_pPageNumBox->SetState(TRISTATE_TRUE); - SfxUInt16Item const*const pItem(static_cast<const SfxUInt16Item*>(rSet->GetItem(_nWhich))); + SfxUInt16Item const*const pItem(rSet->GetItem<SfxUInt16Item>(_nWhich)); const sal_uInt16 nPageNum(pItem->GetValue()); m_pPagenumEdit->SetValue( nPageNum ); break; diff --git a/editeng/source/uno/unotext.cxx b/editeng/source/uno/unotext.cxx index 70df9b115bf1..99f8884d951c 100644 --- a/editeng/source/uno/unotext.cxx +++ b/editeng/source/uno/unotext.cxx @@ -634,7 +634,7 @@ void SvxUnoTextRangeBase::getPropertyValue( const SfxItemPropertySimpleEntry* pM case EE_FEATURE_FIELD: if ( rSet.GetItemState( EE_FEATURE_FIELD, false ) == SfxItemState::SET ) { - const SvxFieldItem* pItem = static_cast<const SvxFieldItem*>(rSet.GetItem( EE_FEATURE_FIELD )); + const SvxFieldItem* pItem = rSet.GetItem<SvxFieldItem>( EE_FEATURE_FIELD ); const SvxFieldData* pData = pItem->GetField(); uno::Reference< text::XTextRange > xAnchor( this ); @@ -690,7 +690,7 @@ bool SvxUnoTextRangeBase::GetPropertyValueHelper( SfxItemSet& rSet, const SfxIt if( eState != SfxItemState::SET && eState != SfxItemState::DEFAULT) throw uno::RuntimeException(); - const SvxNumBulletItem* pBulletItem = static_cast<const SvxNumBulletItem*>(rSet.GetItem( EE_PARA_NUMBULLET )); + const SvxNumBulletItem* pBulletItem = rSet.GetItem<SvxNumBulletItem>( EE_PARA_NUMBULLET ); if( pBulletItem == nullptr ) throw uno::RuntimeException(); @@ -731,7 +731,7 @@ bool SvxUnoTextRangeBase::GetPropertyValueHelper( SfxItemSet& rSet, const SfxIt SfxItemState eState = rSet.GetItemState( EE_PARA_BULLETSTATE ); if( eState == SfxItemState::SET || eState == SfxItemState::DEFAULT ) { - const SfxBoolItem* pItem = static_cast<const SfxBoolItem*>(rSet.GetItem( EE_PARA_BULLETSTATE )); + const SfxBoolItem* pItem = rSet.GetItem<SfxBoolItem>( EE_PARA_BULLETSTATE ); bState = pItem->GetValue(); } diff --git a/sc/source/filter/excel/xlchart.cxx b/sc/source/filter/excel/xlchart.cxx index d4ad17ed2d1e..c78811f10987 100644 --- a/sc/source/filter/excel/xlchart.cxx +++ b/sc/source/filter/excel/xlchart.cxx @@ -1015,17 +1015,17 @@ void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet, { if( rEscherFmt.mxItemSet ) { - if( const XFillStyleItem* pStyleItem = static_cast< const XFillStyleItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLSTYLE, false ) ) ) + if( const XFillStyleItem* pStyleItem = rEscherFmt.mxItemSet->GetItem<XFillStyleItem>( XATTR_FILLSTYLE, false ) ) { switch( pStyleItem->GetValue() ) { case drawing::FillStyle_SOLID: // #i84812# Excel 2007 writes Escher properties for solid fill - if( const XFillColorItem* pColorItem = static_cast< const XFillColorItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLCOLOR, false ) ) ) + if( const XFillColorItem* pColorItem = rEscherFmt.mxItemSet->GetItem<XFillColorItem>( XATTR_FILLCOLOR, false ) ) { namespace cssd = ::com::sun::star::drawing; // get solid transparence too - const XFillTransparenceItem* pTranspItem = static_cast< const XFillTransparenceItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLTRANSPARENCE, false ) ); + const XFillTransparenceItem* pTranspItem = rEscherFmt.mxItemSet->GetItem<XFillTransparenceItem>( XATTR_FILLTRANSPARENCE, false ); sal_uInt16 nTransp = pTranspItem ? pTranspItem->GetValue() : 0; ScfPropSetHelper& rAreaHlp = GetAreaHelper( ePropMode ); rAreaHlp.InitializeWrite(); @@ -1034,7 +1034,7 @@ void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet, } break; case drawing::FillStyle_GRADIENT: - if( const XFillGradientItem* pGradItem = static_cast< const XFillGradientItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLGRADIENT, false ) ) ) + if( const XFillGradientItem* pGradItem = rEscherFmt.mxItemSet->GetItem<XFillGradientItem>( XATTR_FILLGRADIENT, false ) ) { Any aGradientAny; if( pGradItem->QueryValue( aGradientAny, MID_FILLGRADIENT ) ) @@ -1052,7 +1052,7 @@ void XclChPropSetHelper::WriteEscherProperties( ScfPropertySet& rPropSet, } break; case drawing::FillStyle_BITMAP: - if( const XFillBitmapItem* pBmpItem = static_cast< const XFillBitmapItem* >( rEscherFmt.mxItemSet->GetItem( XATTR_FILLBITMAP, false ) ) ) + if( const XFillBitmapItem* pBmpItem = rEscherFmt.mxItemSet->GetItem<XFillBitmapItem>( XATTR_FILLBITMAP, false ) ) { Any aBitmapAny; if( pBmpItem->QueryValue( aBitmapAny, MID_GRAFURL ) ) diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index 58f37e30bb71..4754fa6f82a9 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -125,7 +125,7 @@ XclRootData::XclRootData( XclBiff eBiff, SfxMedium& rMedium, // document URL and path if( const SfxItemSet* pItemSet = mrMedium.GetItemSet() ) - if( const SfxStringItem* pItem = static_cast< const SfxStringItem* >( pItemSet->GetItem( SID_FILE_NAME ) ) ) + if( const SfxStringItem* pItem = pItemSet->GetItem<SfxStringItem>( SID_FILE_NAME ) ) maDocUrl = pItem->GetValue(); maBasePath = maDocUrl.copy( 0, maDocUrl.lastIndexOf( '/' ) + 1 ); diff --git a/sc/source/filter/orcus/orcusfiltersimpl.cxx b/sc/source/filter/orcus/orcusfiltersimpl.cxx index a27f2707e154..6bac0e9d3576 100644 --- a/sc/source/filter/orcus/orcusfiltersimpl.cxx +++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx @@ -48,7 +48,7 @@ uno::Reference<task::XStatusIndicator> getStatusIndicator(SfxMedium& rMedium) SfxItemSet* pSet = rMedium.GetItemSet(); if (pSet) { - const SfxUnoAnyItem* pItem = static_cast<const SfxUsrAnyItem*>(pSet->GetItem(SID_PROGRESS_STATUSBAR_CONTROL)); + const SfxUnoAnyItem* pItem = pSet->GetItem<SfxUsrAnyItem>(SID_PROGRESS_STATUSBAR_CONTROL); if (pItem) xStatusIndicator.set(pItem->GetValue(), uno::UNO_QUERY); } diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index 579c7f0abce9..668531eccb51 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -87,7 +87,7 @@ uno::Reference <task::XStatusIndicator> ScXMLImportWrapper::GetStatusIndicator() SfxItemSet* pSet = pMedium->GetItemSet(); if (pSet) { - const SfxUnoAnyItem* pItem = static_cast<const SfxUnoAnyItem*>(pSet->GetItem(SID_PROGRESS_STATUSBAR_CONTROL)); + const SfxUnoAnyItem* pItem = pSet->GetItem<SfxUnoAnyItem>(SID_PROGRESS_STATUSBAR_CONTROL); if (pItem) xStatusIndicator.set(pItem->GetValue(), uno::UNO_QUERY); } diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 377fe43cad7c..f8baa2e50126 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -2380,8 +2380,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed ) bRet = true; if ( bHasMemo ) { - const SfxStringItem* pNameItem = - static_cast<const SfxStringItem*>( rMed.GetItemSet()->GetItem( SID_FILE_NAME ) ); + const SfxStringItem* pNameItem = rMed.GetItemSet()->GetItem<SfxStringItem>( SID_FILE_NAME ); INetURLObject aDbtFile( pNameItem->GetValue(), INetProtocol::File ); aDbtFile.setExtension("dbt"); if ( IsDocument( aDbtFile ) && !KillFile( aDbtFile ) ) diff --git a/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index a7dd13cc925d..3b9c34040801 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -1099,8 +1099,8 @@ Any SAL_CALL SdStyleSheet::getPropertyValue( const OUString& PropertyName ) { SfxItemSet &rStyleSet = GetItemSet(); - const XFillBmpStretchItem* pStretchItem = static_cast<const XFillBmpStretchItem*>(rStyleSet.GetItem(XATTR_FILLBMP_STRETCH)); - const XFillBmpTileItem* pTileItem = static_cast<const XFillBmpTileItem*>(rStyleSet.GetItem(XATTR_FILLBMP_TILE)); + const XFillBmpStretchItem* pStretchItem = rStyleSet.GetItem<XFillBmpStretchItem>(XATTR_FILLBMP_STRETCH); + const XFillBmpTileItem* pTileItem = rStyleSet.GetItem<XFillBmpTileItem>(XATTR_FILLBMP_TILE); if( pStretchItem && pTileItem ) { @@ -1228,7 +1228,7 @@ PropertyState SAL_CALL SdStyleSheet::getPropertyState( const OUString& PropertyN case XATTR_LINESTART: case XATTR_LINEDASH: { - const NameOrIndex* pItem = static_cast<const NameOrIndex*>(rStyleSet.GetItem((sal_uInt16)pEntry->nWID)); + const NameOrIndex* pItem = rStyleSet.GetItem<NameOrIndex>((sal_uInt16)pEntry->nWID); if( ( pItem == nullptr ) || pItem->GetName().isEmpty() ) eState = PropertyState_DEFAULT_VALUE; } diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 9c62a04d7a5c..323a3c3e1f35 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -316,7 +316,7 @@ OUString getParagraphStyle( SdrOutliner* pOutliner, sal_Int32 nPara ) OUString sStyle; - if( static_cast<const SvxFrameDirectionItem*>(aParaSet.GetItem( EE_PARA_WRITINGDIR ))->GetValue() == FRMDIR_HORI_RIGHT_TOP ) + if( aParaSet.GetItem<SvxFrameDirectionItem>( EE_PARA_WRITINGDIR )->GetValue() == FRMDIR_HORI_RIGHT_TOP ) { sStyle = "direction: rtl;"; @@ -830,7 +830,7 @@ void HtmlExport::SetDocColors( SdPage* pPage ) { SfxItemSet& rSet = pSheet->GetItemSet(); if(rSet.GetItemState(EE_CHAR_COLOR) == SfxItemState::SET) - maTextColor = static_cast<const SvxColorItem*>(rSet.GetItem(EE_CHAR_COLOR))->GetValue(); + maTextColor = rSet.GetItem<SvxColorItem>(EE_CHAR_COLOR)->GetValue(); } // default background from the background of the master page of the first page @@ -1460,7 +1460,7 @@ OUString HtmlExport::TextAttribToHTMLString( SfxItemSet* pSet, HtmlState* pState OUString aLink, aTarget; if ( pSet->GetItemState( EE_FEATURE_FIELD ) == SfxItemState::SET ) { - const SvxFieldItem* pItem = static_cast<const SvxFieldItem*>(pSet->GetItem( EE_FEATURE_FIELD )); + const SvxFieldItem* pItem = pSet->GetItem<SvxFieldItem>( EE_FEATURE_FIELD ); if(pItem) { const SvxURLField* pURL = dynamic_cast<const SvxURLField*>( pItem->GetField() ); diff --git a/sd/source/filter/xml/sdtransform.cxx b/sd/source/filter/xml/sdtransform.cxx index 726fa02425ef..e8b52ee2d2f1 100644 --- a/sd/source/filter/xml/sdtransform.cxx +++ b/sd/source/filter/xml/sdtransform.cxx @@ -276,7 +276,7 @@ bool SdTransformOOo2xDocument::getBulletState( const SfxItemSet& rSet, sal_uInt1 { if( (rSet.GetItemState( nWhich ) == SfxItemState::SET) ) { - const SvXMLAttrContainerItem& rAttr = *static_cast< const SvXMLAttrContainerItem* >( rSet.GetItem( nWhich ) ); + const SvXMLAttrContainerItem& rAttr = *rSet.GetItem<SvXMLAttrContainerItem>( nWhich ); const sal_uInt16 nCount = rAttr.GetAttrCount(); for( sal_uInt16 nItem = 0; nItem < nCount; nItem++ ) @@ -298,7 +298,7 @@ bool SdTransformOOo2xDocument::transformItemSet( SfxItemSet& rSet, bool bNumberi bool bRet = false; if( bNumbering ) { - SvxLRSpaceItem aItem( *static_cast<const SvxLRSpaceItem*>(rSet.GetItem( EE_PARA_LRSPACE )) ); + SvxLRSpaceItem aItem( *rSet.GetItem<SvxLRSpaceItem>( EE_PARA_LRSPACE ) ); if( (aItem.GetLeft() != 0) || (aItem.GetTextFirstLineOfst() != 0) ) { aItem.SetLeftValue( 0 ); @@ -322,7 +322,7 @@ bool SdTransformOOo2xDocument::removeAlienAttributes( SfxItemSet& rSet, sal_uInt { if( (rSet.GetItemState( nWhich ) == SfxItemState::SET) ) { - const SvXMLAttrContainerItem& rAttr = *static_cast< const SvXMLAttrContainerItem* >( rSet.GetItem( nWhich ) ); + const SvXMLAttrContainerItem& rAttr = *rSet.GetItem<SvXMLAttrContainerItem>( nWhich ); const sal_uInt16 nCount = rAttr.GetAttrCount(); for( sal_uInt16 nItem = 0; nItem < nCount; nItem++ ) diff --git a/sd/source/ui/dlg/dlgolbul.cxx b/sd/source/ui/dlg/dlgolbul.cxx index ae69b2aa22da..66222547025e 100644 --- a/sd/source/ui/dlg/dlgolbul.cxx +++ b/sd/source/ui/dlg/dlgolbul.cxx @@ -112,7 +112,7 @@ OutlineBulletDlg::OutlineBulletDlg( if(bTitle && aInputSet.GetItemState(EE_PARA_NUMBULLET) == SfxItemState::SET ) { - const SvxNumBulletItem* pItem = static_cast<const SvxNumBulletItem*>( aInputSet.GetItem(EE_PARA_NUMBULLET) ); + const SvxNumBulletItem* pItem = aInputSet.GetItem<SvxNumBulletItem>(EE_PARA_NUMBULLET); SvxNumRule* pRule = pItem->GetNumRule(); if(pRule) { @@ -187,7 +187,7 @@ const SfxItemSet* OutlineBulletDlg::GetOutputItemSet() const if(bTitle && pOutputSet->GetItemState(EE_PARA_NUMBULLET) == SfxItemState::SET ) { - const SvxNumBulletItem* pBulletItem = static_cast<const SvxNumBulletItem*>(pOutputSet->GetItem(EE_PARA_NUMBULLET)); + const SvxNumBulletItem* pBulletItem = pOutputSet->GetItem<SvxNumBulletItem>(EE_PARA_NUMBULLET); SvxNumRule* pRule = pBulletItem->GetNumRule(); if(pRule) pRule->SetFeatureFlag( SvxNumRuleFlags::NO_NUMBERS, false ); diff --git a/sd/source/ui/func/fuchar.cxx b/sd/source/ui/func/fuchar.cxx index 91dce945ed7d..4a8aedd64ece 100644 --- a/sd/source/ui/func/fuchar.cxx +++ b/sd/source/ui/func/fuchar.cxx @@ -113,7 +113,7 @@ void FuChar::DoExecute( SfxRequest& rReq ) SfxItemSet aOtherSet( *pOutputSet ); // and now the reverse process - const SvxBrushItem* pBrushItem= static_cast<const SvxBrushItem*>(aOtherSet.GetItem( SID_ATTR_BRUSH_CHAR )); + const SvxBrushItem* pBrushItem = aOtherSet.GetItem<SvxBrushItem>( SID_ATTR_BRUSH_CHAR ); if ( pBrushItem ) { diff --git a/sd/source/ui/func/fupage.cxx b/sd/source/ui/func/fupage.cxx index 15682c460eb1..cd9c99b36eb8 100644 --- a/sd/source/ui/func/fupage.cxx +++ b/sd/source/ui/func/fupage.cxx @@ -362,9 +362,9 @@ const SfxItemSet* FuPage::ExecuteDialog( vcl::Window* pParent ) } // if the background for this page was set to invisible, the background-object has to be deleted, too. - if( ( static_cast<const XFillStyleItem*>( pTempSet->GetItem( XATTR_FILLSTYLE ) )->GetValue() == drawing::FillStyle_NONE ) || + if( ( pTempSet->GetItem<XFillStyleItem>( XATTR_FILLSTYLE )->GetValue() == drawing::FillStyle_NONE ) || ( ( pTempSet->GetItemState( XATTR_FILLSTYLE ) == SfxItemState::DEFAULT ) && - ( static_cast<const XFillStyleItem*>( aMergedAttr.GetItem( XATTR_FILLSTYLE ) )->GetValue() == drawing::FillStyle_NONE ) ) ) + ( aMergedAttr.GetItem<XFillStyleItem>( XATTR_FILLSTYLE )->GetValue() == drawing::FillStyle_NONE ) ) ) mbPageBckgrdDeleted = true; bool bSetToAllPages = false; diff --git a/sd/source/ui/func/futempl.cxx b/sd/source/ui/func/futempl.cxx index 30893d8c4308..77a53c1d7d23 100644 --- a/sd/source/ui/func/futempl.cxx +++ b/sd/source/ui/func/futempl.cxx @@ -414,7 +414,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) SfxItemSet aTempSet(*pOutSet); static_cast<SdStyleSheet*>(pStyleSheet)->AdjustToFontHeight(aTempSet); - const SvxBrushItem* pBrushItem = static_cast<const SvxBrushItem*>(aTempSet.GetItem(XATTR_FILLBACKGROUND)); + const SvxBrushItem* pBrushItem = aTempSet.GetItem<SvxBrushItem>(XATTR_FILLBACKGROUND); if( pBrushItem ) { SvxBackgroundColorItem aBackColorItem( pBrushItem->GetColor(), EE_CHAR_BKGCOLOR); @@ -432,7 +432,7 @@ void FuTemplate::DoExecute( SfxRequest& rReq ) { if (aTempSet.GetItemState(EE_PARA_NUMBULLET) == SfxItemState::SET) { - SvxNumRule aRule(*static_cast<const SvxNumBulletItem*>(aTempSet.GetItem(EE_PARA_NUMBULLET))->GetNumRule()); + SvxNumRule aRule(*aTempSet.GetItem<SvxNumBulletItem>(EE_PARA_NUMBULLET)->GetNumRule()); OUString sStyleName(SD_RESSTR(STR_PSEUDOSHEET_OUTLINE) + " 1"); SfxStyleSheetBase* pFirstStyleSheet = pSSPool->Find( sStyleName, SD_STYLE_FAMILY_PSEUDO); diff --git a/sd/source/ui/unoidl/unopback.cxx b/sd/source/ui/unoidl/unopback.cxx index 17043a99e4c6..e65af781d435 100644 --- a/sd/source/ui/unoidl/unopback.cxx +++ b/sd/source/ui/unoidl/unopback.cxx @@ -277,8 +277,8 @@ uno::Any SAL_CALL SdUnoPageBackground::getPropertyValue( const OUString& Propert { if( pEntry->nWID == OWN_ATTR_FILLBMP_MODE ) { - const XFillBmpStretchItem* pStretchItem = static_cast<const XFillBmpStretchItem*>(mpSet->GetItem(XATTR_FILLBMP_STRETCH)); - const XFillBmpTileItem* pTileItem = static_cast<const XFillBmpTileItem*>(mpSet->GetItem(XATTR_FILLBMP_TILE)); + const XFillBmpStretchItem* pStretchItem = mpSet->GetItem<XFillBmpStretchItem>(XATTR_FILLBMP_STRETCH); + const XFillBmpTileItem* pTileItem = mpSet->GetItem<XFillBmpTileItem>(XATTR_FILLBMP_TILE); if( pStretchItem && pTileItem ) { diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 93e228981a44..ea41c4d0aacf 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -215,16 +215,16 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) mpDrawView->BegUndo(); SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - bool bSet = static_cast<const SdrTextFitToSizeTypeItem*>(pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_FITTOSIZE))->GetValue() != SdrFitToSizeType::NONE; + bool bSet = pObj->GetMergedItemSet().GetItem<SdrTextFitToSizeTypeItem>(SDRATTR_TEXT_FITTOSIZE)->GetValue() != SdrFitToSizeType::NONE; mpDrawView->AddUndo(GetDoc()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj)); if (!bSet) { //If we are turning on AutoFit we have to turn these off if already on - if (static_cast<const SdrOnOffItem*>(pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_AUTOGROWHEIGHT))->GetValue()) + if (pObj->GetMergedItemSet().GetItem<SdrOnOffItem>(SDRATTR_TEXT_AUTOGROWHEIGHT)->GetValue()) pObj->SetMergedItem(makeSdrTextAutoGrowHeightItem(false)); - if (static_cast<const SdrOnOffItem*>(pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_AUTOGROWWIDTH))->GetValue()) + if (pObj->GetMergedItemSet().GetItem<SdrOnOffItem>(SDRATTR_TEXT_AUTOGROWWIDTH)->GetValue()) pObj->SetMergedItem(makeSdrTextAutoGrowWidthItem(false)); } diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx index 6043ba6b1f2a..cc52eb9e5ab9 100644 --- a/sd/source/ui/view/drviewsj.cxx +++ b/sd/source/ui/view/drviewsj.cxx @@ -262,7 +262,7 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) if( SfxItemState::DEFAULT == rSet.GetItemState( SID_OUTLINE_TEXT_AUTOFIT ) ) { const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj(); - const bool bSet = static_cast<const SdrTextFitToSizeTypeItem*>(pObj->GetMergedItemSet().GetItem(SDRATTR_TEXT_FITTOSIZE))->GetValue() != SdrFitToSizeType::NONE; + const bool bSet = pObj->GetMergedItemSet().GetItem<SdrTextFitToSizeTypeItem>(SDRATTR_TEXT_FITTOSIZE)->GetValue() != SdrFitToSizeType::NONE; rSet.Put(SfxBoolItem(SID_OUTLINE_TEXT_AUTOFIT, bSet)); } diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 8b90a7a6595d..303704dec17a 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -461,7 +461,7 @@ Reference < XContent > SfxMedium::GetContent() const OUString SfxMedium::GetBaseURL( bool bForSaving ) { OUString aBaseURL; - const SfxStringItem* pBaseURLItem = static_cast<const SfxStringItem*>( GetItemSet()->GetItem(SID_DOC_BASEURL) ); + const SfxStringItem* pBaseURLItem = GetItemSet()->GetItem<SfxStringItem>(SID_DOC_BASEURL); if ( pBaseURLItem ) aBaseURL = pBaseURLItem->GetValue(); else if (!utl::ConfigManager::IsAvoidConfig() && GetContent().is()) @@ -492,7 +492,7 @@ OUString SfxMedium::GetBaseURL( bool bForSaving ) bool SfxMedium::IsSkipImages() { - const SfxStringItem* pSkipImagesItem = static_cast<const SfxStringItem*>( GetItemSet()->GetItem(SID_FILE_FILTEROPTIONS) ); + const SfxStringItem* pSkipImagesItem = GetItemSet()->GetItem<SfxStringItem>(SID_FILE_FILTEROPTIONS); return pSkipImagesItem && pSkipImagesItem->GetValue() == "SkipImages"; } 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; } 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 ); |