From 1f1c7a4b0d582dffa920c7a51a55ea32c4d203fe Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 24 Nov 2014 10:39:58 +0200 Subject: loplugin: cstylecast Change-Id: I74d655f24396c35305e90e26c91e45c6fc44df75 --- sw/source/ui/misc/docfnote.cxx | 4 ++-- sw/source/ui/misc/glossary.cxx | 2 +- sw/source/ui/misc/linenum.cxx | 2 +- sw/source/ui/misc/outline.cxx | 12 ++++++------ sw/source/ui/misc/pgfnote.cxx | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'sw/source/ui/misc') diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index 74188d14fa7f..b938a07761fe 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -53,7 +53,7 @@ SwFootNoteOptionDlg::SwFootNoteOptionDlg(vcl::Window *pParent, SwWrtShell &rS) void SwFootNoteOptionDlg::PageCreated( sal_uInt16 /*nId*/, SfxTabPage &rPage ) { - ((SwEndNoteOptionPage&)rPage).SetShell( rSh ); + static_cast(rPage).SetShell( rSh ); } IMPL_LINK( SwFootNoteOptionDlg, OkHdl, Button *, pBtn ) @@ -339,7 +339,7 @@ static SwCharFmt* lcl_GetCharFormat( SwWrtShell* pSh, const OUString& rCharFmtNa pBase = pPool->Find(rCharFmtName, SFX_STYLE_FAMILY_CHAR); if(!pBase) pBase = &pPool->Make(rCharFmtName, SFX_STYLE_FAMILY_CHAR); - pFmt = ((SwDocStyleSheet*)pBase)->GetCharFmt(); + pFmt = static_cast(pBase)->GetCharFmt(); } return pFmt; } diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 179c64a5693f..f5f1d18cb707 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -530,7 +530,7 @@ IMPL_LINK( SwGlossaryDlg, MenuHdl, Menu *, pMn ) if ( pMacroDlg && pMacroDlg->Execute() == RET_OK && SfxItemState::SET == pMacroDlg->GetOutputItemSet()->GetItemState( RES_FRMMACRO, false, &pItem ) ) { - const SvxMacroTableDtor& rTbl = ((SvxMacroItem*)pItem)->GetMacroTable(); + const SvxMacroTableDtor& rTbl = static_cast(pItem)->GetMacroTable(); pGlossaryHdl->SetMacros( m_pShortNameEdit->GetText(), rTbl.Get( SW_EVENT_START_INS_GLOSSARY ), rTbl.Get( SW_EVENT_END_INS_GLOSSARY ) ); diff --git a/sw/source/ui/misc/linenum.cxx b/sw/source/ui/misc/linenum.cxx index b28b2a754bfb..e4f86d4dc293 100644 --- a/sw/source/ui/misc/linenum.cxx +++ b/sw/source/ui/misc/linenum.cxx @@ -185,7 +185,7 @@ IMPL_LINK_NOARG(SwLineNumberingDlg, OKHdl) pBase = pPool->Find(sCharFmtName, SFX_STYLE_FAMILY_CHAR); if(!pBase) pBase = &pPool->Make(sCharFmtName, SFX_STYLE_FAMILY_CHAR); - pCharFmt = ((SwDocStyleSheet*)pBase)->GetCharFmt(); + pCharFmt = static_cast(pBase)->GetCharFmt(); } if (pCharFmt) diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index 5b52fc15227d..930c73726911 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -200,12 +200,12 @@ void SwOutlineTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage) { if (nPageId == m_nNumPosId) { - ((SwNumPositionTabPage&)rPage).SetWrtShell(&rWrtSh); - ((SwNumPositionTabPage&)rPage).SetOutlineTabDialog(this); + static_cast(rPage).SetWrtShell(&rWrtSh); + static_cast(rPage).SetOutlineTabDialog(this); } else if (nPageId == m_nOutlineId) { - ((SwOutlineSettingsTabPage&)rPage).SetWrtShell(&rWrtSh); + static_cast(rPage).SetWrtShell(&rWrtSh); } } @@ -717,7 +717,7 @@ IMPL_LINK_NOARG(SwOutlineSettingsTabPage, CharFmtHdl) pBase = pPool->Find(sEntry, SFX_STYLE_FAMILY_CHAR); if(!pBase) pBase = &pPool->Make(sEntry, SFX_STYLE_FAMILY_PAGE); - pFmt = ((SwDocStyleSheet*)pBase)->GetCharFmt(); + pFmt = static_cast(pBase)->GetCharFmt(); } } @@ -746,8 +746,8 @@ void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell) { pSh = pShell; // query this document's NumRules - pNumRule = ((SwOutlineTabDialog*)GetTabDialog())->GetNumRule(); - pCollNames = ((SwOutlineTabDialog*)GetTabDialog())->GetCollNames(); + pNumRule = static_cast(GetTabDialog())->GetNumRule(); + pCollNames = static_cast(GetTabDialog())->GetCollNames(); m_pPreviewWIN->SetNumRule(pNumRule); m_pPreviewWIN->SetOutlineNames(pCollNames); diff --git a/sw/source/ui/misc/pgfnote.cxx b/sw/source/ui/misc/pgfnote.cxx index e81e2c34d6f4..bf3632ed2dbb 100644 --- a/sw/source/ui/misc/pgfnote.cxx +++ b/sw/source/ui/misc/pgfnote.cxx @@ -310,7 +310,7 @@ void SwFootNotePage::ActivatePage(const SfxItemSet& rSet) const SfxPoolItem* pItem; if( SfxItemState::SET == rSet.GetItemState( rSet.GetPool()->GetWhich( SID_ATTR_PAGE_HEADERSET), false, &pItem ) ) { - const SfxItemSet& rHeaderSet = ((SvxSetItem*)pItem)->GetItemSet(); + const SfxItemSet& rHeaderSet = static_cast(pItem)->GetItemSet(); const SfxBoolItem& rHeaderOn = (const SfxBoolItem&)rHeaderSet.Get( rSet.GetPool()->GetWhich( SID_ATTR_PAGE_ON ) ); @@ -325,7 +325,7 @@ void SwFootNotePage::ActivatePage(const SfxItemSet& rSet) if( SfxItemState::SET == rSet.GetItemState( rSet.GetPool()->GetWhich( SID_ATTR_PAGE_FOOTERSET), false, &pItem ) ) { - const SfxItemSet& rFooterSet = ((SvxSetItem*)pItem)->GetItemSet(); + const SfxItemSet& rFooterSet = static_cast(pItem)->GetItemSet(); const SfxBoolItem& rFooterOn = (const SfxBoolItem&)rFooterSet.Get( SID_ATTR_PAGE_ON ); -- cgit