diff --git a/cui/source/dialogs/srchxtra.cxx b/cui/source/dialogs/srchxtra.cxx index 7081f2eab84f..684e5d91eff1 100644 --- a/cui/source/dialogs/srchxtra.cxx +++ b/cui/source/dialogs/srchxtra.cxx @@ -73,8 +73,7 @@ void SvxSearchFormatDialog::PageCreated(const OUString& rId, SfxTabPage& rPage) const FontList* pApm_pFontList = nullptr; if (SfxObjectShell* pSh = SfxObjectShell::Current()) { - const SvxFontListItem* pFLItem = static_cast( - pSh->GetItem( SID_ATTR_CHAR_FONTLIST )); + const SvxFontListItem* pFLItem = pSh->GetItem( SID_ATTR_CHAR_FONTLIST ); if ( pFLItem ) pApm_pFontList = pFLItem->GetFontList(); } diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index a9725e22388b..da9e62a6913a 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -349,12 +349,11 @@ const FontList* SvxCharNamePage::GetFontList() const /* #110771# SvxFontListItem::GetFontList can return NULL */ if (SfxObjectShell* pDocSh = SfxObjectShell::Current()) { - const SfxPoolItem* pItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST ); + const SvxFontListItem* pItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST ); if ( pItem != nullptr ) { - DBG_ASSERT(nullptr != static_cast(pItem)->GetFontList(), - "Where is the font list?"); - m_pImpl->m_pFontList = static_cast(pItem )->GetFontList()->Clone(); + DBG_ASSERT(nullptr != pItem->GetFontList(), "Where is the font list?"); + m_pImpl->m_pFontList = pItem->GetFontList()->Clone(); } } if(!m_pImpl->m_pFontList) diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index 3d3e5083294f..aa2618c51f06 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -764,8 +764,7 @@ IMPL_LINK_NOARG(SvxNumPickTabPage, NumSelectHdl_Impl, ValueSet*, void) if (SfxObjectShell* pCurDocShell = SfxObjectShell::Current()) { const SvxFontListItem* pFontListItem = - static_cast( pCurDocShell - ->GetItem( SID_ATTR_CHAR_FONTLIST )); + pCurDocShell->GetItem( SID_ATTR_CHAR_FONTLIST ); pList = pFontListItem ? pFontListItem->GetFontList() : nullptr; } } diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 5a7c94afe24c..1e6f3cfb1ad5 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -1392,8 +1392,7 @@ const vcl::Font* FindFont(std::u16string_view rFontName) SfxObjectShell* pDocSh = SfxObjectShell::Current(); if (!pDocSh) return nullptr; - const SvxFontListItem* pFonts - = static_cast(pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST)); + const SvxFontListItem* pFonts = pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST); const FontList* pList = pFonts ? pFonts->GetFontList() : nullptr; if (pList && !rFontName.empty()) if (sal_Handle hMetric = pList->GetFirstFontMetric(rFontName)) @@ -6457,8 +6456,7 @@ static char* getFonts (const char* pCommand, const bool bBloatWithRepeatedSizes) SfxObjectShell* pDocSh = SfxObjectShell::Current(); if (!pDocSh) return nullptr; - const SvxFontListItem* pFonts = static_cast( - pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST)); + const SvxFontListItem* pFonts = pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST); const FontList* pList = pFonts ? pFonts->GetFontList() : nullptr; if (!bBloatWithRepeatedSizes) diff --git a/include/editeng/editids.hrc b/include/editeng/editids.hrc index 2b29c3e34fde..c431aeb6760f 100644 --- a/include/editeng/editids.hrc +++ b/include/editeng/editids.hrc @@ -67,6 +67,7 @@ class SvxWeightItem; class SvxWidowsItem; class SvxWordLineModeItem; class SvxScriptHintItem; +class SvxFontListItem; /* These SID_SVX_START entries came from include/svx/svxids.hrc, avoid @@ -95,7 +96,7 @@ class SvxScriptHintItem; #define SID_ATTR_CHAR_CASEMAP TypedWhichId( SID_SVX_START + 19 ) #define SID_ATTR_CHAR_LANGUAGE TypedWhichId( SID_SVX_START + 20 ) #define SID_ATTR_CHAR_ESCAPEMENT TypedWhichId( SID_SVX_START + 21 ) -#define SID_ATTR_CHAR_FONTLIST ( SID_SVX_START + 22 ) +#define SID_ATTR_CHAR_FONTLIST TypedWhichId( SID_SVX_START + 22 ) #define SID_ATTR_BORDER_OUTER TypedWhichId( SID_SVX_START + 24 ) #define SID_ATTR_BORDER_SHADOW TypedWhichId( SID_SVX_START + 25 ) #define SID_ATTR_PARA_ADJUST TypedWhichId( SID_SVX_START + 27 ) diff --git a/sc/source/filter/excel/xehelper.cxx b/sc/source/filter/excel/xehelper.cxx index 7ba3fb58c02d..27bcee2fbb67 100644 --- a/sc/source/filter/excel/xehelper.cxx +++ b/sc/source/filter/excel/xehelper.cxx @@ -718,8 +718,7 @@ void XclExpHFConverter::AppendPortion( const EditTextObject* pTextObj, sal_Unico const FontList* pFontList = nullptr; if( SfxObjectShell* pDocShell = GetDocShell() ) { - if( const SvxFontListItem* pInfoItem = static_cast< const SvxFontListItem* >( - pDocShell->GetItem( SID_ATTR_CHAR_FONTLIST ) ) ) + if( const SvxFontListItem* pInfoItem = pDocShell->GetItem( SID_ATTR_CHAR_FONTLIST ) ) pFontList = pInfoItem->GetFontList(); } diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx index 8a60750716c8..2e16bcfd7d1e 100644 --- a/sc/source/filter/excel/xistyle.cxx +++ b/sc/source/filter/excel/xistyle.cxx @@ -220,8 +220,7 @@ void XclImpFont::SetFontData( const XclFontData& rFontData, bool bHasCharSet ) { if( ScDocShell* pDocShell = GetDocShell() ) { - if( const SvxFontListItem* pInfoItem = static_cast< const SvxFontListItem* >( - pDocShell->GetItem( SID_ATTR_CHAR_FONTLIST ) ) ) + if( const SvxFontListItem* pInfoItem = pDocShell->GetItem( SID_ATTR_CHAR_FONTLIST ) ) { if( const FontList* pFontList = pInfoItem->GetFontList() ) { diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx index 75e751ad31f5..bbf716a1602c 100644 --- a/sc/source/ui/attrdlg/attrdlg.cxx +++ b/sc/source/ui/attrdlg/attrdlg.cxx @@ -87,11 +87,11 @@ void ScAttrDlg::PageCreated(const OUString& rPageId, SfxTabPage& rTabPage) } else if (rPageId == "font" && pDocSh) { - const SfxPoolItem* pInfoItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST ); + const SvxFontListItem* pInfoItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST ); SAL_WARN_IF(!pInfoItem, "sc.ui", "we should have a FontListItem normally here"); if (pInfoItem) { - aSet.Put (SvxFontListItem(static_cast(pInfoItem)->GetFontList(), SID_ATTR_CHAR_FONTLIST )); + aSet.Put (SvxFontListItem(pInfoItem->GetFontList(), SID_ATTR_CHAR_FONTLIST )); rTabPage.PageCreated(aSet); } } diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index 1dd8e2fbde04..558e1a3f462f 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -855,8 +855,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq ) { if (SfxObjectShell* pObjSh = SfxObjectShell::Current()) { - const SvxFontListItem* pFontListItem = static_cast< const SvxFontListItem* > - ( pObjSh->GetItem( SID_ATTR_CHAR_FONTLIST ) ); + const SvxFontListItem* pFontListItem = pObjSh->GetItem( SID_ATTR_CHAR_FONTLIST ); const FontList* pFontList = pFontListItem ? pFontListItem->GetFontList() : nullptr; pOutView->GetEditView().ChangeFontSize( nSlot == SID_GROW_FONT_SIZE, pFontList ); mrViewData.GetBindings().Invalidate( SID_ATTR_CHAR_FONTHEIGHT ); diff --git a/sc/source/ui/miscdlgs/textdlgs.cxx b/sc/source/ui/miscdlgs/textdlgs.cxx index 1e9219234641..d0cf689abb8a 100644 --- a/sc/source/ui/miscdlgs/textdlgs.cxx +++ b/sc/source/ui/miscdlgs/textdlgs.cxx @@ -54,8 +54,7 @@ void ScCharDlg::PageCreated(const OUString& rId, SfxTabPage &rPage) SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); if (rId == "font") { - SvxFontListItem aItem(*static_cast( - ( m_rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) ); + SvxFontListItem aItem(* m_rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ); aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); rPage.PageCreated(aSet); diff --git a/sc/source/ui/styleui/styledlg.cxx b/sc/source/ui/styleui/styledlg.cxx index 5253a040edd8..b0b5631192ad 100644 --- a/sc/source/ui/styleui/styledlg.cxx +++ b/sc/source/ui/styleui/styledlg.cxx @@ -131,12 +131,11 @@ void ScStyleDlg::PageCreated(const OUString& rPageId, SfxTabPage& rTabPage) } else if (rPageId == "font") { - const SfxPoolItem* pInfoItem - = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST ); + const SvxFontListItem* pInfoItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST ); OSL_ENSURE( pInfoItem, "FontListItem not found!" ); - aSet.Put (SvxFontListItem(static_cast(*pInfoItem).GetFontList(), SID_ATTR_CHAR_FONTLIST)); + aSet.Put (SvxFontListItem(pInfoItem->GetFontList(), SID_ATTR_CHAR_FONTLIST)); rTabPage.PageCreated(aSet); } else if (rPageId == "background") @@ -230,8 +229,7 @@ void ScDrawStyleDlg::PageCreated(const OUString& rPageId, SfxTabPage& rTabPage) { if (SfxObjectShell* pDocSh = SfxObjectShell::Current()) { - SvxFontListItem aItem(*static_cast( - pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST))); + SvxFontListItem aItem(*pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST)); aSet.Put(SvxFontListItem(aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); } diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 9d5de6cdcab5..ba13c281b10d 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -1248,8 +1248,7 @@ void ScEditShell::ExecuteAttr(SfxRequest& rReq) case SID_SHRINK_FONT_SIZE: { SfxObjectShell* pObjSh = SfxObjectShell::Current(); - const SvxFontListItem* pFontListItem = static_cast - (pObjSh ? pObjSh->GetItem(SID_ATTR_CHAR_FONTLIST) : nullptr); + const SvxFontListItem* pFontListItem = (pObjSh ? pObjSh->GetItem(SID_ATTR_CHAR_FONTLIST) : nullptr); const FontList* pFontList = pFontListItem ? pFontListItem->GetFontList() : nullptr; pEditView->ChangeFontSize( nSlot == SID_GROW_FONT_SIZE, pFontList ); rBindings.Invalidate( SID_ATTR_CHAR_FONTHEIGHT ); diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index 4467b33d68b6..b6654d6213b9 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -271,9 +271,9 @@ SdFontPropertyBox::SdFontPropertyBox(weld::Label* pLabel, weld::Container* pPare if (SfxObjectShell* pDocSh = SfxObjectShell::Current()) { - auto pItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST ); + const SvxFontListItem* pItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST ); if (pItem) - pFontList = static_cast(pItem)->GetFontList(); + pFontList = pItem->GetFontList(); } if (!pFontList) diff --git a/sd/source/ui/dlg/dlgchar.cxx b/sd/source/ui/dlg/dlgchar.cxx index fce5baf16daa..28d1a638bd9b 100644 --- a/sd/source/ui/dlg/dlgchar.cxx +++ b/sd/source/ui/dlg/dlgchar.cxx @@ -58,7 +58,7 @@ void SdCharDlg::PageCreated(const OUString& rId, SfxTabPage &rPage) SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); if (rId == "font") { - SvxFontListItem aItem(* static_cast( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ); + SvxFontListItem aItem(* rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ); aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); rPage.PageCreated(aSet); diff --git a/sd/source/ui/dlg/prltempl.cxx b/sd/source/ui/dlg/prltempl.cxx index b996052a8d61..9b918d2d5baa 100644 --- a/sd/source/ui/dlg/prltempl.cxx +++ b/sd/source/ui/dlg/prltempl.cxx @@ -262,7 +262,7 @@ void SdPresLayoutTemplateDlg::PageCreated(const OUString& rId, SfxTabPage &rPage } else if (rId == "font") { - SvxFontListItem aItem(*static_cast(mpDocShell->GetItem( SID_ATTR_CHAR_FONTLIST) ) ); + SvxFontListItem aItem(*mpDocShell->GetItem( SID_ATTR_CHAR_FONTLIST) ); aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); rPage.PageCreated(aSet); } diff --git a/sd/source/ui/dlg/tabtempl.cxx b/sd/source/ui/dlg/tabtempl.cxx index 7699c36a67aa..863588b048bd 100644 --- a/sd/source/ui/dlg/tabtempl.cxx +++ b/sd/source/ui/dlg/tabtempl.cxx @@ -128,8 +128,7 @@ void SdTabTemplateDlg::PageCreated(const OUString& rId, SfxTabPage &rPage) } else if (rId == "font") { - SvxFontListItem aItem(*static_cast( - rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ); + SvxFontListItem aItem(*rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST)); aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); rPage.PageCreated(aSet); diff --git a/sd/source/ui/view/drtxtob1.cxx b/sd/source/ui/view/drtxtob1.cxx index 85abbc5c54e8..dcee114cdbed 100644 --- a/sd/source/ui/view/drtxtob1.cxx +++ b/sd/source/ui/view/drtxtob1.cxx @@ -471,7 +471,7 @@ void TextObjectBar::Execute(SfxRequest& rReq) case SID_GROW_FONT_SIZE: case SID_SHRINK_FONT_SIZE: { - const SvxFontListItem* pFonts = static_cast(mrViewShell.GetDocSh()->GetItem( SID_ATTR_CHAR_FONTLIST )); + const SvxFontListItem* pFonts = mrViewShell.GetDocSh()->GetItem( SID_ATTR_CHAR_FONTLIST ); const FontList* pFontList = pFonts ? pFonts->GetFontList(): nullptr; if( pFontList ) { diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index d825f69b95b1..c10804ca3e62 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -4534,7 +4534,7 @@ void DrawViewShell::ExecChar( SfxRequest &rReq ) case SID_SHRINK_FONT_SIZE: case SID_GROW_FONT_SIZE: { - const SvxFontListItem* pFonts = dynamic_cast(GetDocSh()->GetItem( SID_ATTR_CHAR_FONTLIST ) ); + const SvxFontListItem* pFonts = GetDocSh()->GetItem( SID_ATTR_CHAR_FONTLIST ); const FontList* pFontList = pFonts ? pFonts->GetFontList() : nullptr; if( pFontList ) { diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx index 7877e460ad2c..72aa41f996e7 100644 --- a/svx/source/form/fmtextcontrolshell.cxx +++ b/svx/source/form/fmtextcontrolshell.cxx @@ -613,7 +613,7 @@ namespace svx void FmTextControlShell::executeAttributeDialog( AttributeSet _eSet, SfxRequest& rReq ) { - const SvxFontListItem* pFontList = dynamic_cast( m_pViewFrame->GetObjectShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ); + const SvxFontListItem* pFontList = m_pViewFrame->GetObjectShell()->GetItem( SID_ATTR_CHAR_FONTLIST ); DBG_ASSERT( pFontList, "FmTextControlShell::executeAttributeDialog: no font list item!" ); if ( !pFontList ) return; diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index ca64c8f1ad68..0c9d9c26b015 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -815,7 +815,7 @@ void OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt1 { if (SfxObjectShell* pCurDocShell = SfxObjectShell::Current()) { - const SvxFontListItem* pFontListItem = static_cast(pCurDocShell->GetItem(SID_ATTR_CHAR_FONTLIST)); + const SvxFontListItem* pFontListItem = pCurDocShell->GetItem(SID_ATTR_CHAR_FONTLIST); pList = pFontListItem ? pFontListItem->GetFontList() : nullptr; } } diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 180062bfc2c3..1cd57098bab2 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -1659,8 +1659,7 @@ static bool lcl_GetDocFontList(const FontList** ppFontList, SvxFontNameBox_Base& const SvxFontListItem* pFontListItem = nullptr; if ( pDocSh ) - pFontListItem = - static_cast(pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST )); + pFontListItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST ); else { ::std::unique_ptr aFontList(new FontList(Application::GetDefaultDevice())); diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx index 6d5aee41481e..1850d9bca749 100644 --- a/sw/source/core/unocore/unocrsrhelper.cxx +++ b/sw/source/core/unocore/unocrsrhelper.cxx @@ -891,9 +891,7 @@ void setNumberingProperty(const Any& rValue, SwPaM& rPam) { if (SwDocShell* pShell = rDoc.GetDocShell()) { - const SvxFontListItem* pFontListItem = - static_cast( - pShell->GetItem( SID_ATTR_CHAR_FONTLIST )); + const SvxFontListItem* pFontListItem = pShell->GetItem( SID_ATTR_CHAR_FONTLIST ); const FontList* pList = pFontListItem->GetFontList(); vcl::Font aFont(pList->Get( diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index e6296e5dc54f..7e24c5739a78 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -2000,8 +2000,7 @@ void SwXNumberingRules::SetPropertiesToNumFormat( if (!sBulletFontName.isEmpty() && pLclDocShell) { const SvxFontListItem* pFontListItem = - static_cast(pLclDocShell - ->GetItem( SID_ATTR_CHAR_FONTLIST )); + pLclDocShell->GetItem( SID_ATTR_CHAR_FONTLIST ); const FontList* pList = pFontListItem->GetFontList(); vcl::Font aFont(pList->Get(sBulletFontName, WEIGHT_NORMAL, ITALIC_NONE)); aFormat.SetBulletFont(&aFont); diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 41aaddc3d1ea..8ddf16e7a0c0 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1758,7 +1758,7 @@ void SwXStyle::SetPropertyValue(const SfxItemPropertyMapEntry& { if (SwDocShell* pShell = m_pDoc->GetDocShell()) { - const auto pFontListItem(static_cast(pShell->GetItem(SID_ATTR_CHAR_FONTLIST))); + const SvxFontListItem* pFontListItem(pShell->GetItem(SID_ATTR_CHAR_FONTLIST)); const auto pList(pFontListItem->GetFontList()); vcl::Font aFont(pList->Get(rBulletName.toString(), WEIGHT_NORMAL, ITALIC_NONE)); aFormat.SetBulletFont(&aFont); diff --git a/sw/source/filter/html/htmlcss1.cxx b/sw/source/filter/html/htmlcss1.cxx index 3d0793f4ae13..4d98765d65b9 100644 --- a/sw/source/filter/html/htmlcss1.cxx +++ b/sw/source/filter/html/htmlcss1.cxx @@ -1106,8 +1106,7 @@ const FontList *SwCSS1Parser::GetFontList() const SwDocShell *pDocSh = m_pDoc->GetDocShell(); if( pDocSh ) { - const SvxFontListItem *pFListItem = - static_cast(pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST)); + const SvxFontListItem *pFListItem = pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST); if( pFListItem ) pFList = pFListItem->GetFontList(); } diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index b885d4a21685..ac1e566e3669 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -3856,8 +3856,7 @@ void SwHTMLParser::NewFontAttr( HtmlTokenId nToken ) SwDocShell *pDocSh = m_xDoc->GetDocShell(); if( pDocSh ) { - const SvxFontListItem *pFListItem = - static_cast(pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST)); + const SvxFontListItem *pFListItem = pDocSh->GetItem(SID_ATTR_CHAR_FONTLIST); if( pFListItem ) pFList = pFListItem->GetFontList(); } diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx index d23784fae59d..8c1995c9a4d0 100644 --- a/sw/source/ui/chrdlg/chardlg.cxx +++ b/sw/source/ui/chrdlg/chardlg.cxx @@ -88,8 +88,7 @@ void SwCharDlg::PageCreated(const OUString& rId, SfxTabPage &rPage) SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); if (rId == "font") { - SvxFontListItem aFontListItem( *static_cast( - ( m_rView.GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ) ) ); + SvxFontListItem aFontListItem( *m_rView.GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ); aSet.Put (SvxFontListItem( aFontListItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); if(m_nDialogMode != SwCharDlgMode::Draw && m_nDialogMode != SwCharDlgMode::Ann) aSet.Put (SfxUInt32Item(SID_FLAG_TYPE,SVX_PREVIEW_CHARACTER)); diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx index 1e0bbff36d15..a8ae6fc61803 100644 --- a/sw/source/ui/fmtui/tmpdlg.cxx +++ b/sw/source/ui/fmtui/tmpdlg.cxx @@ -311,8 +311,7 @@ void SwTemplateDlgController::PageCreated(const OUString& rId, SfxTabPage &rPage { if (SwView* pView = GetActiveView()) { - SvxFontListItem aFontListItem( *static_cast(pView-> - GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ) ); + SvxFontListItem aFontListItem( *(pView->GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST )) ); aSet.Put (SvxFontListItem( aFontListItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); sal_uInt32 nFlags = 0; diff --git a/sw/source/uibase/dialog/watermarkdialog.cxx b/sw/source/uibase/dialog/watermarkdialog.cxx index a4fc7959ea38..b91326ae09e9 100644 --- a/sw/source/uibase/dialog/watermarkdialog.cxx +++ b/sw/source/uibase/dialog/watermarkdialog.cxx @@ -60,12 +60,12 @@ void SwWatermarkDialog::InitFields() { // Update font list SfxObjectShell* pDocSh = SfxObjectShell::Current(); - const SfxPoolItem* pFontItem; + const SvxFontListItem* pFontItem; const FontList* pFontList = nullptr; std::unique_ptr xFontList; if ( pDocSh && ( ( pFontItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST ) ) != nullptr ) ) - pFontList = static_cast( pFontItem )->GetFontList(); + pFontList = pFontItem->GetFontList(); if (!pFontList) { diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx index 8f6224682a61..9df4e07f47ea 100644 --- a/sw/source/uibase/docvw/srcedtw.cxx +++ b/sw/source/uibase/docvw/srcedtw.cxx @@ -952,7 +952,7 @@ void SwSrcEditWindow::SetFont() sFontName = aFont.GetFamilyName(); } const SvxFontListItem* pFontListItem = - static_cast(m_pSrcView->GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST )); + m_pSrcView->GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ); const FontList* pList = pFontListItem->GetFontList(); vcl::Font aFont(pList->Get(sFontName, WEIGHT_NORMAL, ITALIC_NONE)); diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index b71aecd2f9e7..e946d15c4306 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -229,8 +229,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq ) case FN_SHRINK_FONT_SIZE: { const SfxObjectShell* pObjSh = SfxObjectShell::Current(); - const SvxFontListItem* pFontListItem = static_cast - (pObjSh ? pObjSh->GetItem(SID_ATTR_CHAR_FONTLIST) : nullptr); + const SvxFontListItem* pFontListItem = (pObjSh ? pObjSh->GetItem(SID_ATTR_CHAR_FONTLIST) : nullptr); const FontList* pFontList = pFontListItem ? pFontListItem->GetFontList() : nullptr; pOLV->GetEditView().ChangeFontSize( nSlot == FN_GROW_FONT_SIZE, pFontList ); } diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx index a209877f1286..1924f8da68bc 100644 --- a/sw/source/uibase/shells/drwtxtex.cxx +++ b/sw/source/uibase/shells/drwtxtex.cxx @@ -649,8 +649,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq ) case FN_SHRINK_FONT_SIZE: { const SfxObjectShell* pObjSh = SfxObjectShell::Current(); - const SvxFontListItem* pFontListItem = static_cast< const SvxFontListItem* > - (pObjSh ? pObjSh->GetItem(SID_ATTR_CHAR_FONTLIST) : nullptr); + const SvxFontListItem* pFontListItem = (pObjSh ? pObjSh->GetItem(SID_ATTR_CHAR_FONTLIST) : nullptr); const FontList* pFontList = pFontListItem ? pFontListItem->GetFontList() : nullptr; pOLV->GetEditView().ChangeFontSize( nSlot == FN_GROW_FONT_SIZE, pFontList ); }