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 /sd/source | |
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 'sd/source')
-rw-r--r-- | sd/source/core/stlsheet.cxx | 6 | ||||
-rw-r--r-- | sd/source/filter/html/htmlex.cxx | 6 | ||||
-rw-r--r-- | sd/source/filter/xml/sdtransform.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/dlg/dlgolbul.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/func/fuchar.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/func/fupage.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/func/futempl.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unopback.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/view/drviews2.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/drviewsj.cxx | 2 |
10 files changed, 22 insertions, 22 deletions
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)); } |