diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-26 15:31:26 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-26 15:33:37 +0100 |
commit | 3b9e0676b0a193dbf802a6b703827c9cc0689900 (patch) | |
tree | f923afc6c47ceb5e3bb930025f27a8eaeb1758ff /svl/source/items | |
parent | 23ab1493b64dff46e5f66941240c9972e99d6f1f (diff) |
const_cast: convert some C-style casts and remove some redundant ones
Change-Id: Iefbf64608dba0c0ae01e79e5b679a9b42748b73a
Diffstat (limited to 'svl/source/items')
-rw-r--r-- | svl/source/items/itemset.cxx | 8 | ||||
-rw-r--r-- | svl/source/items/poolcach.cxx | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index c69cbb48baca..f0a42745a4bd 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -99,7 +99,7 @@ SfxItemSet::SfxItemSet (void) bTotalRanges; // avoid warnings #endif - _pWhichRanges = (sal_uInt16*) _pPool->GetFrozenIdRanges(); + _pWhichRanges = const_cast<sal_uInt16*>(_pPool->GetFrozenIdRanges()); assert( _pWhichRanges && "don't create ItemSets with full range before FreezeIdRanges()" ); if ( !_pWhichRanges ) _pPool->FillItemIdRanges_Impl( _pWhichRanges ); @@ -232,7 +232,7 @@ SfxItemSet::SfxItemSet( const SfxItemSet& rASet ): { // Just copy the pointer and increase RefCount *ppDst = *ppSrc; - ( (SfxPoolItem*) (*ppDst) )->AddRef(); + (*ppDst)->AddRef(); } else if ( !(*ppSrc)->Which() ) *ppDst = (*ppSrc)->Clone(); @@ -258,7 +258,7 @@ SfxItemSet::~SfxItemSet() if( *ppFnd && !IsInvalidItem(*ppFnd) ) { if( !(*ppFnd)->Which() ) - delete (SfxPoolItem*) *ppFnd; + delete *ppFnd; else { // Still multiple references present, so just alter the RefCount if ( 1 < (*ppFnd)->GetRefCount() && !IsDefaultItem(*ppFnd) ) @@ -770,7 +770,7 @@ void SfxItemSet::SetRanges( const sal_uInt16 *pNewRanges ) if( pNewRanges == GetPool()->GetFrozenIdRanges() ) { delete[] _pWhichRanges; - _pWhichRanges = ( sal_uInt16* ) pNewRanges; + _pWhichRanges = const_cast<sal_uInt16*>(pNewRanges); } else { diff --git a/svl/source/items/poolcach.cxx b/svl/source/items/poolcach.cxx index 09f2d531f632..eb1f955dbece 100644 --- a/svl/source/items/poolcach.cxx +++ b/svl/source/items/poolcach.cxx @@ -104,7 +104,7 @@ const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem &rOrigItem, bool b // Add the transformation to the cache SfxItemModifyImpl aModify; aModify.pOrigItem = &rOrigItem; - aModify.pPoolItem = (SfxSetItem*) pNewPoolItem; + aModify.pPoolItem = const_cast<SfxSetItem*>(pNewPoolItem); pCache->push_back( aModify ); DBG_ASSERT( !pItemToPut || |