svx/source/tbxctrls/PaletteManager.cxx | 4 ++-- sw/source/filter/html/htmlctxt.cxx | 6 +++--- sw/source/filter/ww8/wrtw8esh.cxx | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-)
New commits: commit 7d1d111c36c9e81d41442f3eb29f7fc52b598c90 Author: Manish Bera <mbera.de...@gmail.com> AuthorDate: Tue Dec 31 12:26:38 2024 +0530 Commit: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> CommitDate: Wed Jan 1 10:30:00 2025 +0100 tdf#140226: use StaticWhichCast Change-Id: I461471e5b2e9cd3d94896d9ba6ac315f7237bec6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/179510 Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> Tested-by: Jenkins diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx index 426da02c94d8..b01b3eb3514b 100644 --- a/svx/source/tbxctrls/PaletteManager.cxx +++ b/svx/source/tbxctrls/PaletteManager.cxx @@ -63,7 +63,7 @@ PaletteManager::PaletteManager() : { const SfxPoolItem* pItem = nullptr; if( nullptr != ( pItem = pDocSh->GetItem(SID_COLOR_TABLE) ) ) - pColorList = static_cast<const SvxColorListItem*>(pItem)->GetColorList(); + pColorList = pItem->StaticWhichCast(SID_COLOR_TABLE).GetColorList(); } if(!pColorList.is()) pColorList = XColorList::CreateStdColorList(); @@ -344,7 +344,7 @@ OUString PaletteManager::GetPaletteName() { const SfxPoolItem* pItem = nullptr; if( nullptr != ( pItem = pDocSh->GetItem(SID_COLOR_TABLE) ) ) - pColorList = static_cast<const SvxColorListItem*>(pItem)->GetColorList(); + pColorList = pItem->StaticWhichCast(SID_COLOR_TABLE).GetColorList(); } } return aNames[mnCurrentPalette]; diff --git a/sw/source/filter/html/htmlctxt.cxx b/sw/source/filter/html/htmlctxt.cxx index 6e3d0f639ef3..71ac0b067c53 100644 --- a/sw/source/filter/html/htmlctxt.cxx +++ b/sw/source/filter/html/htmlctxt.cxx @@ -692,17 +692,17 @@ void SwHTMLParser::InsertAttrs( SfxItemSet &rItemSet, break; case RES_CHRATR_FONTSIZE: // don't set attributes with a % property - if( static_cast<const SvxFontHeightItem *>(pItem)->GetProp() == 100 ) + if( pItem->StaticWhichCast(RES_CHRATR_FONTSIZE).GetProp() == 100 ) ppAttr = &m_xAttrTab->pFontHeight; break; case RES_CHRATR_CJK_FONTSIZE: // don't set attributes with a % property - if( static_cast<const SvxFontHeightItem *>(pItem)->GetProp() == 100 ) + if( pItem->StaticWhichCast(RES_CHRATR_CJK_FONTSIZE).GetProp() == 100 ) ppAttr = &m_xAttrTab->pFontHeightCJK; break; case RES_CHRATR_CTL_FONTSIZE: // don't set attributes with a % property - if( static_cast<const SvxFontHeightItem *>(pItem)->GetProp() == 100 ) + if( pItem->StaticWhichCast(RES_CHRATR_CTL_FONTSIZE).GetProp() == 100 ) ppAttr = &m_xAttrTab->pFontHeightCTL; break; diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index c9a457b2961e..f3fc3ea2353e 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -1076,7 +1076,7 @@ void MSWord_SdrAttrIter::SetCharSet(const EECharAttrib& rAttr, bool bStart) if( bStart ) { - rtl_TextEncoding eChrSet = static_cast<const SvxFontItem&>(rItem).GetCharSet(); + rtl_TextEncoding eChrSet = rItem.StaticWhichCast(EE_CHAR_FONTINFO).GetCharSet(); m_aChrSetArr.push_back( eChrSet ); m_aChrTextAtrArr.push_back( &rAttr ); }