From 08cdf1661159623414ae99a791295a0995a677e7 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 10 Nov 2014 10:39:17 +0200 Subject: loplugin: cstylecast Change-Id: I639ac26f4d84ff0a2d573d2e58bc5bd41052a925 --- sw/source/core/inc/cntfrm.hxx | 12 ++++++------ sw/source/core/inc/frmtool.hxx | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'sw') diff --git a/sw/source/core/inc/cntfrm.hxx b/sw/source/core/inc/cntfrm.hxx index 579b8fe63cf5..74b9f4d7fcb1 100644 --- a/sw/source/core/inc/cntfrm.hxx +++ b/sw/source/core/inc/cntfrm.hxx @@ -110,7 +110,7 @@ public: inline SwCntntFrm* SwCntntFrm::GetNextCntntFrm() const { if ( GetNext() && GetNext()->IsCntntFrm() ) - return (SwCntntFrm*)GetNext(); + return const_cast(static_cast(GetNext())); else return (SwCntntFrm*)ImplGetNextCntntFrm( true ); } @@ -118,7 +118,7 @@ inline SwCntntFrm* SwCntntFrm::GetNextCntntFrm() const inline SwCntntFrm* SwCntntFrm::GetPrevCntntFrm() const { if ( GetPrev() && GetPrev()->IsCntntFrm() ) - return (SwCntntFrm*)GetPrev(); + return const_cast(static_cast(GetPrev())); else return (SwCntntFrm*)ImplGetNextCntntFrm( false ); } @@ -134,20 +134,20 @@ inline const SwCntntNode *SwCntntFrm::GetNode() const inline const SwCntntFrm *SwCntntFrm::GetFollow() const { - return (const SwCntntFrm*)SwFlowFrm::GetFollow(); + return static_cast(SwFlowFrm::GetFollow()); } inline SwCntntFrm *SwCntntFrm::GetFollow() { - return (SwCntntFrm*)SwFlowFrm::GetFollow(); + return static_cast(SwFlowFrm::GetFollow()); } inline const SwCntntFrm *SwCntntFrm::GetPrecede() const { - return (const SwCntntFrm*)SwFlowFrm::GetPrecede(); + return static_cast(SwFlowFrm::GetPrecede()); } inline SwCntntFrm *SwCntntFrm::GetPrecede() { - return (SwCntntFrm*)SwFlowFrm::GetPrecede(); + return static_cast(SwFlowFrm::GetPrecede()); } #endif diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx index 8003042244f5..04b70539b57d 100644 --- a/sw/source/core/inc/frmtool.hxx +++ b/sw/source/core/inc/frmtool.hxx @@ -26,6 +26,7 @@ #include "swcache.hxx" #include #include +#include class SwPageFrm; class SwFlyFrm; @@ -200,7 +201,7 @@ class SwLayNotify : public SwFrmNotify { bool bLowersComplete; - SwLayoutFrm *GetLay() { return (SwLayoutFrm*)pFrm; } + SwLayoutFrm *GetLay() { return static_cast(pFrm); } public: SwLayNotify( SwLayoutFrm *pLayFrm ); @@ -214,7 +215,7 @@ class SwFlyNotify : public SwLayNotify { SwPageFrm *pOldPage; const SwRect aFrmAndSpace; - SwFlyFrm *GetFly() { return (SwFlyFrm*)pFrm; } + SwFlyFrm *GetFly() { return static_cast(pFrm); } public: SwFlyNotify( SwFlyFrm *pFlyFrm ); -- cgit