diff options
author | Baran Aytas <barannaytas@gmail.com> | 2021-09-11 19:28:47 +0300 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-09-17 10:52:41 +0200 |
commit | 6184eefa835f0495ed8136471d61837f5662b6d6 (patch) | |
tree | 09f2e7717c8232c174da1d03f30bf2e4d06ea1d6 /sc | |
parent | dac29c278531d5474289eb54aa03987c4958ac83 (diff) |
tdf#140226: Make use of SfxPoolItems more typesafe by using StaticWhichCast
Change-Id: Ideaf9ec500af7c3aecbb7086a123a3764cac54d1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121956
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/patattr.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 795f8671522f..b9b2859104b2 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -581,19 +581,19 @@ void ScPatternAttr::FillToEditItemSet( SfxItemSet& rEditSet, const SfxItemSet& r if ( pCondSet->GetItemState( ATTR_FONT_COLOR, true, &pItem ) != SfxItemState::SET ) pItem = &rSrcSet.Get( ATTR_FONT_COLOR ); - aColorItem.reset(static_cast<SvxColorItem*>(pItem->Clone())); + aColorItem.reset(&pItem->Clone()->StaticWhichCast(ATTR_FONT_COLOR)); if ( pCondSet->GetItemState( ATTR_FONT, true, &pItem ) != SfxItemState::SET ) pItem = &rSrcSet.Get( ATTR_FONT ); - aFontItem.reset(static_cast<SvxFontItem*>(pItem->Clone())); + aFontItem.reset(&pItem->Clone()->StaticWhichCast(ATTR_FONT)); if ( pCondSet->GetItemState( ATTR_CJK_FONT, true, &pItem ) != SfxItemState::SET ) pItem = &rSrcSet.Get( ATTR_CJK_FONT ); - aCjkFontItem.reset(static_cast<SvxFontItem*>(pItem->Clone())); + aCjkFontItem.reset(&pItem->Clone()->StaticWhichCast(ATTR_CJK_FONT)); if ( pCondSet->GetItemState( ATTR_CTL_FONT, true, &pItem ) != SfxItemState::SET ) pItem = &rSrcSet.Get( ATTR_CTL_FONT ); - aCtlFontItem.reset(static_cast<SvxFontItem*>(pItem->Clone())); + aCtlFontItem.reset(&pItem->Clone()->StaticWhichCast(ATTR_CTL_FONT)); if ( pCondSet->GetItemState( ATTR_FONT_HEIGHT, true, &pItem ) != SfxItemState::SET ) pItem = &rSrcSet.Get( ATTR_FONT_HEIGHT ); @@ -627,11 +627,11 @@ void ScPatternAttr::FillToEditItemSet( SfxItemSet& rEditSet, const SfxItemSet& r if ( pCondSet->GetItemState( ATTR_FONT_UNDERLINE, true, &pItem ) != SfxItemState::SET ) pItem = &rSrcSet.Get( ATTR_FONT_UNDERLINE ); - aUnderlineItem.reset(static_cast<SvxUnderlineItem*>(pItem->Clone())); + aUnderlineItem.reset(&pItem->Clone()->StaticWhichCast(ATTR_FONT_UNDERLINE)); if ( pCondSet->GetItemState( ATTR_FONT_OVERLINE, true, &pItem ) != SfxItemState::SET ) pItem = &rSrcSet.Get( ATTR_FONT_OVERLINE ); - aOverlineItem.reset(static_cast<SvxOverlineItem*>(pItem->Clone())); + aOverlineItem.reset(&pItem->Clone()->StaticWhichCast(ATTR_FONT_OVERLINE)); if ( pCondSet->GetItemState( ATTR_FONT_WORDLINE, true, &pItem ) != SfxItemState::SET ) pItem = &rSrcSet.Get( ATTR_FONT_WORDLINE ); |