const_cast: convert some C-style casts and remove some redundant ones
Change-Id: Ib6842b6215ff70a31299d1410ed66c3ea34e7c78
This commit is contained in:
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user