From 0d05f417c3a7dcde89f5e15b29f39ce2db65b543 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 26 Mar 2015 15:31:36 +0100 Subject: const_cast: convert some C-style casts and remove some redundant ones Change-Id: Iabe2ecce65a91b003fe042a22630131449968fd8 --- include/svtools/fmtfield.hxx | 2 +- include/svtools/treelist.hxx | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'include/svtools') diff --git a/include/svtools/fmtfield.hxx b/include/svtools/fmtfield.hxx index efce83a940c0..bda86e2f4447 100644 --- a/include/svtools/fmtfield.hxx +++ b/include/svtools/fmtfield.hxx @@ -244,7 +244,7 @@ protected: // SetFormatKey without FormatChanged notification SvNumberFormatter* CreateFormatter() { SetFormatter(StandardFormatter()); return m_pFormatter; } - SvNumberFormatter* ImplGetFormatter() const { return m_pFormatter ? m_pFormatter : ((FormattedField*)this)->CreateFormatter(); } + SvNumberFormatter* ImplGetFormatter() const { return m_pFormatter ? m_pFormatter : const_cast(this)->CreateFormatter(); } bool PreNotify(NotifyEvent& rNEvt) SAL_OVERRIDE; diff --git a/include/svtools/treelist.hxx b/include/svtools/treelist.hxx index cad50fc71040..79b6ff640c19 100644 --- a/include/svtools/treelist.hxx +++ b/include/svtools/treelist.hxx @@ -286,7 +286,7 @@ public: ); sal_uLong GetVisibleCount() const - { return pModel->GetVisibleCount( (SvListView*)this ); } + { return pModel->GetVisibleCount( const_cast(this) ); } SvTreeListEntry* FirstVisible() const { return pModel->FirstVisible(); } @@ -324,26 +324,26 @@ public: { return pModel->GetEntryAtAbsPos(nAbsPos); } SvTreeListEntry* GetEntryAtVisPos( sal_uLong nVisPos ) const - { return pModel->GetEntryAtVisPos((SvListView*)this,nVisPos); } + { return pModel->GetEntryAtVisPos(this,nVisPos); } sal_uLong GetAbsPos( SvTreeListEntry* pEntry ) const { return pModel->GetAbsPos(pEntry); } sal_uLong GetVisiblePos( SvTreeListEntry* pEntry ) const - { return pModel->GetVisiblePos((SvListView*)this,pEntry); } + { return pModel->GetVisiblePos(this,pEntry); } sal_uLong GetVisibleChildCount(SvTreeListEntry* pParent ) const - { return pModel->GetVisibleChildCount((SvListView*)this,pParent); } + { return pModel->GetVisibleChildCount(this,pParent); } sal_uLong GetChildSelectionCount( SvTreeListEntry* pParent ) const - { return pModel->GetChildSelectionCount((SvListView*)this,pParent); } + { return pModel->GetChildSelectionCount(this,pParent); } // Does not call the Select Handler virtual void SelectAll( bool bSelect, bool ) { pModel->SelectAll((SvListView*)this, bSelect); } bool IsEntryVisible( SvTreeListEntry* pEntry ) const - { return pModel->IsEntryVisible((SvListView*)this,pEntry); } + { return pModel->IsEntryVisible(this,pEntry); } bool IsExpanded( SvTreeListEntry* pEntry ) const; bool IsSelected( SvTreeListEntry* pEntry ) const; -- cgit