diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-26 15:31:07 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-26 15:33:36 +0100 |
commit | af3cb5e85a54c5b9653f4757863b8ed15df8477b (patch) | |
tree | 9066dfbaf47f73853ca2611a0babd2391d74e699 /sot | |
parent | b54922052210f92ede0483a6311b97a75cf1cdcc (diff) |
const_cast: convert some C-style casts and remove some redundant ones
Change-Id: Ib6842b6215ff70a31299d1410ed66c3ea34e7c78
Diffstat (limited to 'sot')
-rw-r--r-- | sot/source/sdstor/stg.cxx | 10 | ||||
-rw-r--r-- | sot/source/sdstor/storage.cxx | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index eb708bc82136..1304d5c54e40 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -65,19 +65,19 @@ StorageBase::~StorageBase() sal_uLong StorageBase::GetError() const { sal_uLong n = m_nError; - ((StorageBase*) this)->m_nError = SVSTREAM_OK; + const_cast<StorageBase*>(this)->m_nError = SVSTREAM_OK; return n; } void StorageBase::SetError( sal_uLong n ) const { if( !m_nError ) - ((StorageBase*) this)->m_nError = n; + const_cast<StorageBase*>(this)->m_nError = n; } void StorageBase::ResetError() const { - ((StorageBase*) this)->m_nError = SVSTREAM_OK; + const_cast<StorageBase*>(this)->m_nError = SVSTREAM_OK; } // Retrieve the underlying SvStream for info purposes @@ -542,7 +542,7 @@ Storage::~Storage() const OUString& Storage::GetName() const { if( !bIsRoot && Validate() ) - pEntry->aEntry.GetName( ((Storage*) this)->aName ); + pEntry->aEntry.GetName( const_cast<Storage*>(this)->aName ); return aName; } @@ -794,7 +794,7 @@ bool Storage::CopyTo( BaseStorage* pDest ) const SetError( SVSTREAM_ACCESS_DENIED ); return false; } - Storage* pThis = (Storage*) this; + Storage* pThis = const_cast<Storage*>(this); pDest->SetClassId( GetClassId() ); pDest->SetDirty(); SvStorageInfoList aList; diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index d6e9bc1085f7..c91138326204 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -207,9 +207,9 @@ void SotStorageStream::SetSize(sal_uInt64 const nNewSize) sal_uInt32 SotStorageStream::GetSize() const { sal_uLong nPos = Tell(); - ((SotStorageStream *)this)->Seek( STREAM_SEEK_TO_END ); + const_cast<SotStorageStream *>(this)->Seek( STREAM_SEEK_TO_END ); sal_uLong nSize = Tell(); - ((SotStorageStream *)this)->Seek( nPos ); + const_cast<SotStorageStream *>(this)->Seek( nPos ); return nSize; } @@ -600,7 +600,7 @@ const OUString & SotStorage::GetName() const { DBG_ASSERT( Owner(), "must be owner" ); if( m_pOwnStg ) - ((SotStorage *)this)->m_aName = m_pOwnStg->GetName(); + const_cast<SotStorage *>(this)->m_aName = m_pOwnStg->GetName(); } return m_aName; } |