summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-05 15:02:51 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-06 08:15:57 +0200
commitde8caac6bee3237ba634e7dce2e4635dc8bba57b (patch)
tree9260fb99b4f6de1619df46a11aa388ad8d42db63 /sot
parent690f2f5c4633780734a63305fd16733fb1344c74 (diff)
replace SVSTREAM_OK with ERRCODE_NONE
since the first is #define'd to the second, and offers no extra value Change-Id: I2c67e09ea3aa5361b8e7dfe7a20858c6ae054450 Reviewed-on: https://gerrit.libreoffice.org/38406 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sot')
-rw-r--r--sot/source/sdstor/stg.cxx10
-rw-r--r--sot/source/sdstor/stgcache.cxx6
-rw-r--r--sot/source/sdstor/stgcache.hxx2
-rw-r--r--sot/source/sdstor/stgdir.cxx6
-rw-r--r--sot/source/sdstor/stgio.cxx4
-rw-r--r--sot/source/sdstor/stgole.cxx12
-rw-r--r--sot/source/sdstor/stgstrms.cxx8
-rw-r--r--sot/source/sdstor/storage.cxx14
8 files changed, 31 insertions, 31 deletions
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx
index 04e1ea3f18ca..e744a357d351 100644
--- a/sot/source/sdstor/stg.cxx
+++ b/sot/source/sdstor/stg.cxx
@@ -51,7 +51,7 @@ StorageBase::StorageBase()
: m_bAutoCommit( false )
{
m_nMode = StreamMode::READ;
- m_nError = SVSTREAM_OK;
+ m_nError = ERRCODE_NONE;
}
StorageBase::~StorageBase()
@@ -64,7 +64,7 @@ StorageBase::~StorageBase()
ErrCode StorageBase::GetError() const
{
const ErrCode n = m_nError;
- m_nError = SVSTREAM_OK;
+ m_nError = ERRCODE_NONE;
return n;
}
@@ -76,7 +76,7 @@ void StorageBase::SetError( ErrCode n ) const
void StorageBase::ResetError() const
{
- m_nError = SVSTREAM_OK;
+ m_nError = ERRCODE_NONE;
}
OLEStorageBase::OLEStorageBase( StgIo* p, StgDirEntry* pe, StreamMode& nMode )
@@ -371,7 +371,7 @@ Storage::Storage( SvStream& r, bool bDirect )
m_nMode = StreamMode::READ;
if( r.IsWritable() )
m_nMode = StreamMode::READ | StreamMode::WRITE;
- if( r.GetError() == SVSTREAM_OK )
+ if( r.GetError() == ERRCODE_NONE )
{
pIo->SetStrm( &r, false );
sal_uLong nSize = r.Seek( STREAM_SEEK_TO_END );
@@ -398,7 +398,7 @@ Storage::Storage( UCBStorageStream& rStrm, bool bDirect )
{
m_nMode = StreamMode::READ;
- if ( rStrm.GetError() != SVSTREAM_OK )
+ if ( rStrm.GetError() != ERRCODE_NONE )
{
SetError( rStrm.GetError() );
pEntry = nullptr;
diff --git a/sot/source/sdstor/stgcache.cxx b/sot/source/sdstor/stgcache.cxx
index 57632bcc128c..bb4277556f9f 100644
--- a/sot/source/sdstor/stgcache.cxx
+++ b/sot/source/sdstor/stgcache.cxx
@@ -86,7 +86,7 @@ static sal_Int32 lcl_GetPageCount( sal_uLong nFileSize, short nPageSize )
}
StgCache::StgCache()
- : m_nError( SVSTREAM_OK )
+ : m_nError( ERRCODE_NONE )
, m_nPages( 0 )
, m_nRef( 0 )
, m_nReplaceIdx( 0 )
@@ -401,13 +401,13 @@ void StgCache::SetError( ErrCode n )
void StgCache::ResetError()
{
- m_nError = SVSTREAM_OK;
+ m_nError = ERRCODE_NONE;
m_pStrm->ResetError();
}
void StgCache::MoveError( StorageBase& r )
{
- if( m_nError != SVSTREAM_OK )
+ if( m_nError != ERRCODE_NONE )
{
r.SetError( m_nError );
ResetError();
diff --git a/sot/source/sdstor/stgcache.hxx b/sot/source/sdstor/stgcache.hxx
index 1a61c89f7d3a..cf3b971580e8 100644
--- a/sot/source/sdstor/stgcache.hxx
+++ b/sot/source/sdstor/stgcache.hxx
@@ -72,7 +72,7 @@ public:
SvStream* GetStrm() { return m_pStrm; }
void SetStrm( SvStream*, bool );
void SetStrm( UCBStorageStream* );
- bool Good() const { return m_nError == SVSTREAM_OK; }
+ bool Good() const { return m_nError == ERRCODE_NONE; }
ErrCode GetError() { return m_nError; }
void MoveError( StorageBase& );
void SetError( ErrCode );
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index 7d496223e29e..bc0d042065ef 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -322,7 +322,7 @@ bool StgDirEntry::SetSize( sal_Int32 nNewSize )
{
m_pTmpStrm->SetSize( nNewSize );
m_pStgStrm->GetIo().SetError( m_pTmpStrm->GetError() );
- return m_pTmpStrm->GetError() == SVSTREAM_OK;
+ return m_pTmpStrm->GetError() == ERRCODE_NONE;
}
else
{
@@ -561,7 +561,7 @@ bool StgDirEntry::Strm2Tmp()
{
// It was already committed once
m_pTmpStrm = new StgTmpStrm;
- if( m_pTmpStrm->GetError() == SVSTREAM_OK && m_pTmpStrm->Copy( *m_pCurStrm ) )
+ if( m_pTmpStrm->GetError() == ERRCODE_NONE && m_pTmpStrm->Copy( *m_pCurStrm ) )
return true;
n = 1; // indicates error
}
@@ -569,7 +569,7 @@ bool StgDirEntry::Strm2Tmp()
{
n = m_aEntry.GetSize();
m_pTmpStrm = new StgTmpStrm( n );
- if( m_pTmpStrm->GetError() == SVSTREAM_OK )
+ if( m_pTmpStrm->GetError() == ERRCODE_NONE )
{
if( n )
{
diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx
index fcb622b9aa44..b6a704340c28 100644
--- a/sot/source/sdstor/stgio.cxx
+++ b/sot/source/sdstor/stgio.cxx
@@ -132,9 +132,9 @@ bool StgIo::CommitAll()
const ErrCode n = m_pStrm->GetError();
SetError( n );
#ifdef DBG_UTIL
- if( n==SVSTREAM_OK ) ValidateFATs();
+ if( n==ERRCODE_NONE ) ValidateFATs();
#endif
- return n == SVSTREAM_OK;
+ return n == ERRCODE_NONE;
}
}
}
diff --git a/sot/source/sdstor/stgole.cxx b/sot/source/sdstor/stgole.cxx
index 15907d4d8502..a00e706e38de 100644
--- a/sot/source/sdstor/stgole.cxx
+++ b/sot/source/sdstor/stgole.cxx
@@ -105,7 +105,7 @@ bool StgCompObjStream::Load()
memset( &m_aClsId, 0, sizeof( ClsId ) );
m_nCbFormat = SotClipboardFormatId::NONE;
m_aUserName.clear();
- if( GetError() != SVSTREAM_OK )
+ if( GetError() != ERRCODE_NONE )
return false;
Seek( 8L ); // skip the first part
sal_Int32 nMarker = 0;
@@ -137,12 +137,12 @@ bool StgCompObjStream::Load()
SetError( SVSTREAM_GENERALERROR );
}
}
- return GetError() == SVSTREAM_OK;
+ return GetError() == ERRCODE_NONE;
}
bool StgCompObjStream::Store()
{
- if( GetError() != SVSTREAM_OK )
+ if( GetError() != ERRCODE_NONE )
return false;
Seek( 0L );
OString aAsciiUserName(OUStringToOString(m_aUserName, RTL_TEXTENCODING_MS_1252));
@@ -157,7 +157,7 @@ bool StgCompObjStream::Store()
WriteClipboardFormat( *this, m_nCbFormat );
WriteInt32( 0 ); // terminator
Commit();
- return GetError() == SVSTREAM_OK;
+ return GetError() == ERRCODE_NONE;
}
/////////////////////////// class StgOleStream
@@ -169,7 +169,7 @@ StgOleStream::StgOleStream( BaseStorage& rStg )
bool StgOleStream::Store()
{
- if( GetError() != SVSTREAM_OK )
+ if( GetError() != ERRCODE_NONE )
return false;
Seek( 0L );
@@ -179,7 +179,7 @@ bool StgOleStream::Store()
WriteInt32( 0 ); // reserved
WriteInt32( 0 ); // Moniker 1
Commit();
- return GetError() == SVSTREAM_OK;
+ return GetError() == ERRCODE_NONE;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index 8f6f584d4605..38d4972ec416 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -1142,7 +1142,7 @@ bool StgTmpStrm::Copy( StgTmpStrm& rSrc )
sal_uInt64 n = rSrc.GetSize();
const sal_uInt64 nCur = rSrc.Tell();
SetSize( n );
- if( GetError() == SVSTREAM_OK )
+ if( GetError() == ERRCODE_NONE )
{
std::unique_ptr<sal_uInt8[]> p(new sal_uInt8[ 4096 ]);
rSrc.Seek( 0L );
@@ -1232,7 +1232,7 @@ void StgTmpStrm::SetSize(sal_uInt64 n)
break; // error
}
s->Flush();
- if( s->GetError() != SVSTREAM_OK )
+ if( s->GetError() != ERRCODE_NONE )
i = 1;
}
Seek( nCur );
@@ -1278,7 +1278,7 @@ std::size_t StgTmpStrm::PutData( const void* pData, std::size_t n )
if( nNew > THRESHOLD && !m_pStrm )
{
SetSize( nNew );
- if( GetError() != SVSTREAM_OK )
+ if( GetError() != ERRCODE_NONE )
return 0;
}
if( m_pStrm )
@@ -1300,7 +1300,7 @@ sal_uInt64 StgTmpStrm::SeekPos(sal_uInt64 n)
if( n && n > THRESHOLD && !m_pStrm )
{
SetSize( n );
- if( GetError() != SVSTREAM_OK )
+ if( GetError() != ERRCODE_NONE )
return Tell();
else
return n;
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index ea5d4007b45f..ee8f72949834 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -229,11 +229,11 @@ bool SotStorageStream::Commit()
if( pOwnStm )
{
pOwnStm->Flush();
- if( pOwnStm->GetError() == SVSTREAM_OK )
+ if( pOwnStm->GetError() == ERRCODE_NONE )
pOwnStm->Commit();
SetError( pOwnStm->GetError() );
}
- return GetError() == SVSTREAM_OK;
+ return GetError() == ERRCODE_NONE;
}
bool SotStorageStream::SetProperty( const OUString& rName, const css::uno::Any& rValue )
@@ -274,7 +274,7 @@ bool SotStorageStream::SetProperty( const OUString& rName, const css::uno::Any&
#define INIT_SotStorage() \
: m_pOwnStg( nullptr ) \
, m_pStorStm( nullptr ) \
- , m_nError( SVSTREAM_OK ) \
+ , m_nError( ERRCODE_NONE ) \
, m_bIsRoot( false ) \
, m_bDelStm( false ) \
, m_nVersion( SOFFICE_FILEFORMAT_CURRENT )
@@ -580,7 +580,7 @@ bool SotStorage::CopyTo( SotStorage * pDestStg )
else
SetError( SVSTREAM_GENERALERROR );
- return SVSTREAM_OK == GetError();
+ return ERRCODE_NONE == GetError();
}
bool SotStorage::Commit()
@@ -593,7 +593,7 @@ bool SotStorage::Commit()
else
SetError( SVSTREAM_GENERALERROR );
- return SVSTREAM_OK == GetError();
+ return ERRCODE_NONE == GetError();
}
SotStorageStream * SotStorage::OpenSotStream( const OUString & rEleName,
@@ -681,7 +681,7 @@ bool SotStorage::Remove( const OUString & rEleName )
else
SetError( SVSTREAM_GENERALERROR );
- return SVSTREAM_OK == GetError();
+ return ERRCODE_NONE == GetError();
}
bool SotStorage::CopyTo( const OUString & rEleName,
@@ -696,7 +696,7 @@ bool SotStorage::CopyTo( const OUString & rEleName,
else
SetError( SVSTREAM_GENERALERROR );
- return SVSTREAM_OK == GetError();
+ return ERRCODE_NONE == GetError();
}
bool SotStorage::Validate()