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>
This commit is contained in:
@@ -79,7 +79,7 @@ void SbiImage::Clear()
|
||||
|
||||
bool SbiGood( SvStream& r )
|
||||
{
|
||||
return !r.IsEof() && r.GetError() == SVSTREAM_OK;
|
||||
return !r.IsEof() && r.GetError() == ERRCODE_NONE;
|
||||
}
|
||||
|
||||
// Open Record
|
||||
@@ -142,7 +142,7 @@ bool SbiImage::Load( SvStream& r, sal_uInt32& nVersion )
|
||||
|
||||
r.ReadUInt16( nSign ).ReadUInt32( nLen ).ReadUInt16( nCount );
|
||||
nNext += nLen + 8;
|
||||
if( r.GetError() == SVSTREAM_OK )
|
||||
if( r.GetError() == ERRCODE_NONE )
|
||||
{
|
||||
switch( static_cast<FileOffset>( nSign ) )
|
||||
{
|
||||
|
||||
@@ -144,7 +144,7 @@ void SbiStream::MapError()
|
||||
{
|
||||
switch( pStrm->GetError() )
|
||||
{
|
||||
case SVSTREAM_OK:
|
||||
case ERRCODE_NONE:
|
||||
nError = 0;
|
||||
break;
|
||||
case SVSTREAM_FILE_NOT_FOUND:
|
||||
|
||||
@@ -4760,7 +4760,7 @@ RTLFUNC(DumpAllObjects)
|
||||
StreamMode::WRITE | StreamMode::TRUNC );
|
||||
p->Dump( aStrm, rPar.Get( 2 )->GetBool() );
|
||||
aStrm.Close();
|
||||
if( aStrm.GetError() != SVSTREAM_OK )
|
||||
if( aStrm.GetError() != ERRCODE_NONE )
|
||||
{
|
||||
StarBASIC::Error( ERRCODE_BASIC_IO_ERROR );
|
||||
}
|
||||
|
||||
@@ -727,7 +727,7 @@ bool SbxDimArray::LoadData( SvStream& rStrm, sal_uInt16 nVer )
|
||||
{
|
||||
short nDimension;
|
||||
rStrm.ReadInt16( nDimension );
|
||||
for( short i = 0; i < nDimension && rStrm.GetError() == SVSTREAM_OK; i++ )
|
||||
for( short i = 0; i < nDimension && rStrm.GetError() == ERRCODE_NONE; i++ )
|
||||
{
|
||||
sal_Int16 lb(0), ub(0);
|
||||
rStrm.ReadInt16( lb ).ReadInt16( ub );
|
||||
|
||||
@@ -247,7 +247,7 @@ bool SbxBase::Store( SvStream& rStrm )
|
||||
rStrm.Seek( nOldPos );
|
||||
rStrm.WriteUInt32( nNewPos - nOldPos );
|
||||
rStrm.Seek( nNewPos );
|
||||
if( rStrm.GetError() != SVSTREAM_OK )
|
||||
if( rStrm.GetError() != ERRCODE_NONE )
|
||||
bRes = false;
|
||||
if( bRes )
|
||||
bRes = true;
|
||||
|
||||
@@ -509,7 +509,7 @@ bool ORTFImportExport::Write()
|
||||
|
||||
m_pStream->WriteChar( '}' ).WriteCharPtr( SAL_NEWLINE_STRING );
|
||||
m_pStream->WriteUChar( 0 );
|
||||
return ((*m_pStream).GetError() == SVSTREAM_OK);
|
||||
return ((*m_pStream).GetError() == ERRCODE_NONE);
|
||||
}
|
||||
|
||||
void ORTFImportExport::appendRow(OString* pHorzChar,sal_Int32 _nColumnCount,sal_Int32& k,sal_Int32& kk)
|
||||
@@ -640,7 +640,7 @@ bool OHTMLImportExport::Write()
|
||||
OUT_LF();
|
||||
TAG_OFF_LF( OOO_STRING_SVTOOLS_HTML_html );
|
||||
|
||||
return ((*m_pStream).GetError() == SVSTREAM_OK);
|
||||
return ((*m_pStream).GetError() == ERRCODE_NONE);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1989,7 +1989,7 @@ void SvxAutoCorrectLanguageLists::LoadXMLExceptList_Imp(
|
||||
{
|
||||
tools::SvRef<SotStorageStream> xStrm = rStg->OpenSotStream( sStrmName,
|
||||
( StreamMode::READ | StreamMode::SHARE_DENYWRITE | StreamMode::NOCREATE ) );
|
||||
if( SVSTREAM_OK != xStrm->GetError())
|
||||
if( ERRCODE_NONE != xStrm->GetError())
|
||||
{
|
||||
xStrm.clear();
|
||||
rStg.clear();
|
||||
@@ -2084,13 +2084,13 @@ void SvxAutoCorrectLanguageLists::SaveExceptList_Imp(
|
||||
xExp->exportDoc( XML_BLOCK_LIST );
|
||||
|
||||
xStrm->Commit();
|
||||
if( xStrm->GetError() == SVSTREAM_OK )
|
||||
if( xStrm->GetError() == ERRCODE_NONE )
|
||||
{
|
||||
xStrm.clear();
|
||||
if (!bConvert)
|
||||
{
|
||||
rStg->Commit();
|
||||
if( SVSTREAM_OK != rStg->GetError() )
|
||||
if( ERRCODE_NONE != rStg->GetError() )
|
||||
{
|
||||
rStg->Remove( sStrmName );
|
||||
rStg->Commit();
|
||||
@@ -2312,7 +2312,7 @@ void SvxAutoCorrectLanguageLists::RemoveStream_Imp( const OUString& rName )
|
||||
if( sShareAutoCorrFile != sUserAutoCorrFile )
|
||||
{
|
||||
tools::SvRef<SotStorage> xStg = new SotStorage( sUserAutoCorrFile, StreamMode::READWRITE );
|
||||
if( xStg.is() && SVSTREAM_OK == xStg->GetError() &&
|
||||
if( xStg.is() && ERRCODE_NONE == xStg->GetError() &&
|
||||
xStg->IsStream( rName ) )
|
||||
{
|
||||
xStg->Remove( rName );
|
||||
@@ -2449,12 +2449,12 @@ bool SvxAutoCorrectLanguageLists::MakeBlocklist_Imp( SotStorage& rStg )
|
||||
xExp->exportDoc( XML_BLOCK_LIST );
|
||||
|
||||
refList->Commit();
|
||||
bRet = SVSTREAM_OK == refList->GetError();
|
||||
bRet = ERRCODE_NONE == refList->GetError();
|
||||
if( bRet )
|
||||
{
|
||||
refList.clear();
|
||||
rStg.Commit();
|
||||
if( SVSTREAM_OK != rStg.GetError() )
|
||||
if( ERRCODE_NONE != rStg.GetError() )
|
||||
{
|
||||
bRemove = true;
|
||||
bRet = false;
|
||||
@@ -2482,7 +2482,7 @@ bool SvxAutoCorrectLanguageLists::MakeCombinedChanges( std::vector<SvxAutocorrWo
|
||||
MakeUserStorage_Impl();
|
||||
tools::SvRef<SotStorage> xStorage = new SotStorage( sUserAutoCorrFile, StreamMode::READWRITE );
|
||||
|
||||
bool bRet = xStorage.is() && SVSTREAM_OK == xStorage->GetError();
|
||||
bool bRet = xStorage.is() && ERRCODE_NONE == xStorage->GetError();
|
||||
|
||||
if( bRet )
|
||||
{
|
||||
@@ -2554,7 +2554,7 @@ bool SvxAutoCorrectLanguageLists::PutText( const OUString& rShort, const OUStrin
|
||||
MakeUserStorage_Impl();
|
||||
tools::SvRef<SotStorage> xStg = new SotStorage( sUserAutoCorrFile, StreamMode::READWRITE );
|
||||
|
||||
bool bRet = xStg.is() && SVSTREAM_OK == xStg->GetError();
|
||||
bool bRet = xStg.is() && ERRCODE_NONE == xStg->GetError();
|
||||
|
||||
// Update the word list
|
||||
if( bRet )
|
||||
|
||||
@@ -6593,7 +6593,7 @@ bool SvxMSDffManager::MakeContentStream( SotStorage * pStor, const GDIMetaFile &
|
||||
aEle.Write( *xStm );
|
||||
|
||||
xStm->SetBufferSize( 0 );
|
||||
return xStm->GetError() == SVSTREAM_OK;
|
||||
return xStm->GetError() == ERRCODE_NONE;
|
||||
}
|
||||
|
||||
struct ClsIDs {
|
||||
@@ -7165,7 +7165,7 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
|
||||
{
|
||||
sal_uInt32 nLen(0), nDummy(0);
|
||||
pDataStrm->ReadUInt32( nLen ).ReadUInt32( nDummy );
|
||||
if( SVSTREAM_OK != pDataStrm->GetError() ||
|
||||
if( ERRCODE_NONE != pDataStrm->GetError() ||
|
||||
// Id in BugDoc - exist there other Ids?
|
||||
// The ConvertToOle2 - does not check for consistent
|
||||
0x30008 != nDummy )
|
||||
|
||||
@@ -1299,7 +1299,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
|
||||
|
||||
SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const OUString& rBaseURL ) :
|
||||
SdrEscherImport ( rParam, rBaseURL ),
|
||||
bOk ( rStCtrl.GetErrorCode() == SVSTREAM_OK ),
|
||||
bOk ( rStCtrl.GetErrorCode() == ERRCODE_NONE ),
|
||||
pPersistPtr ( nullptr ),
|
||||
nPersistPtrAnz ( 0 ),
|
||||
pDefaultSheet ( nullptr ),
|
||||
@@ -2024,7 +2024,7 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt
|
||||
// is this a visual basic storage ?
|
||||
tools::SvRef<SotStorage> xSubStorage = xSource->OpenSotStorage( "VBA",
|
||||
StreamMode::READWRITE | StreamMode::NOCREATE | StreamMode::SHARE_DENYALL );
|
||||
if( xSubStorage.is() && ( SVSTREAM_OK == xSubStorage->GetError() ) )
|
||||
if( xSubStorage.is() && ( ERRCODE_NONE == xSubStorage->GetError() ) )
|
||||
{
|
||||
tools::SvRef<SotStorage> xMacros = xDest->OpenSotStorage( "MACROS" );
|
||||
if ( xMacros.is() )
|
||||
@@ -2046,13 +2046,13 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt
|
||||
if ( xDoc.is() )
|
||||
{
|
||||
tools::SvRef<SotStorage> xVBA = SotStorage::OpenOLEStorage( xDoc, SvxImportMSVBasic::GetMSBasicStorageName() );
|
||||
if ( xVBA.is() && ( xVBA->GetError() == SVSTREAM_OK ) )
|
||||
if ( xVBA.is() && ( xVBA->GetError() == ERRCODE_NONE ) )
|
||||
{
|
||||
tools::SvRef<SotStorage> xSubVBA = xVBA->OpenSotStorage( "_MS_VBA_Overhead" );
|
||||
if ( xSubVBA.is() && ( xSubVBA->GetError() == SVSTREAM_OK ) )
|
||||
if ( xSubVBA.is() && ( xSubVBA->GetError() == ERRCODE_NONE ) )
|
||||
{
|
||||
tools::SvRef<SotStorageStream> xOriginal = xSubVBA->OpenSotStream( "_MS_VBA_Overhead2" );
|
||||
if ( xOriginal.is() && ( xOriginal->GetError() == SVSTREAM_OK ) )
|
||||
if ( xOriginal.is() && ( xOriginal->GetError() == ERRCODE_NONE ) )
|
||||
{
|
||||
if ( nPersistPtr && ( nPersistPtr < nPersistPtrAnz ) )
|
||||
{
|
||||
|
||||
@@ -202,7 +202,7 @@ bool SvTokenStream::MakeToken( SvToken & rToken )
|
||||
nColumn += c == '\t' ? nTabSize : 1;
|
||||
}
|
||||
}
|
||||
while( 0 == c && !IsEof() && ( SVSTREAM_OK == pInStream->GetError() ) );
|
||||
while( 0 == c && !IsEof() && ( ERRCODE_NONE == pInStream->GetError() ) );
|
||||
|
||||
sal_uLong nLastLine = nLine;
|
||||
sal_uLong nLastColumn = nColumn;
|
||||
@@ -239,8 +239,8 @@ bool SvTokenStream::MakeToken( SvToken & rToken )
|
||||
}
|
||||
c = GetFastNextChar();
|
||||
}
|
||||
while( '/' != c && !IsEof() && ( SVSTREAM_OK == pInStream->GetError() ) );
|
||||
if( IsEof() || ( SVSTREAM_OK != pInStream->GetError() ) )
|
||||
while( '/' != c && !IsEof() && ( ERRCODE_NONE == pInStream->GetError() ) );
|
||||
if( IsEof() || ( ERRCODE_NONE != pInStream->GetError() ) )
|
||||
return false;
|
||||
c = GetNextChar();
|
||||
rToken.nType = SVTOKENTYPE::Comment;
|
||||
@@ -275,7 +275,7 @@ bool SvTokenStream::MakeToken( SvToken & rToken )
|
||||
else
|
||||
aStr.append(c);
|
||||
}
|
||||
if( IsEof() || ( SVSTREAM_OK != pInStream->GetError() ) )
|
||||
if( IsEof() || ( ERRCODE_NONE != pInStream->GetError() ) )
|
||||
return false;
|
||||
rToken.nType = SVTOKENTYPE::String;
|
||||
rToken.aString = aStr.makeStringAndClear();
|
||||
@@ -330,7 +330,7 @@ bool SvTokenStream::MakeToken( SvToken & rToken )
|
||||
}
|
||||
rToken.SetLine( nLastLine );
|
||||
rToken.SetColumn( nLastColumn );
|
||||
return pInStream->GetError() == SVSTREAM_OK;
|
||||
return pInStream->GetError() == ERRCODE_NONE;
|
||||
}
|
||||
|
||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||
|
||||
@@ -141,7 +141,7 @@ static bool ResponseFile( StringList * pList, int argc, char ** argv )
|
||||
if( '@' == **(argv +i) )
|
||||
{ // when @, then response file
|
||||
SvFileStream aStm( OUString::createFromAscii((*(argv +i)) +1), StreamMode::STD_READ );
|
||||
if( aStm.GetError() != SVSTREAM_OK )
|
||||
if( aStm.GetError() != ERRCODE_NONE )
|
||||
return false;
|
||||
|
||||
OString aStr;
|
||||
|
||||
@@ -146,7 +146,7 @@ bool SvIdlDataBase::ReadIdFile( const OString& rOFileName )
|
||||
aIdFileList.push_back( rFileName );
|
||||
this->AddDepFile( aFullName );
|
||||
SvTokenStream aTokStm( aFullName );
|
||||
if( aTokStm.GetStream().GetError() == SVSTREAM_OK )
|
||||
if( aTokStm.GetStream().GetError() == ERRCODE_NONE )
|
||||
{
|
||||
SvToken& rTok = aTokStm.GetToken_Next();
|
||||
|
||||
@@ -447,7 +447,7 @@ SvIdlWorkingBase::SvIdlWorkingBase(const SvCommand& rCmd) : SvIdlDataBase(rCmd)
|
||||
|
||||
bool SvIdlWorkingBase::WriteSfx( SvStream & rOutStm )
|
||||
{
|
||||
if( rOutStm.GetError() != SVSTREAM_OK )
|
||||
if( rOutStm.GetError() != ERRCODE_NONE )
|
||||
return false;
|
||||
|
||||
// reset all tmp variables for writing
|
||||
|
||||
@@ -141,7 +141,7 @@ void SvIdlParser::ReadInclude( SvMetaModule& rModule )
|
||||
osl::FileBase::getSystemPathFromFileURL( aFullName, aFullName );
|
||||
rBase.AddDepFile( aFullName );
|
||||
SvTokenStream aTokStm( aFullName );
|
||||
if( SVSTREAM_OK != aTokStm.GetStream().GetError() )
|
||||
if( ERRCODE_NONE != aTokStm.GetStream().GetError() )
|
||||
{
|
||||
OStringBuffer aStr("cannot open file: ");
|
||||
aStr.append(OUStringToOString(aFullName, RTL_TEXTENCODING_UTF8));
|
||||
|
||||
@@ -37,7 +37,7 @@ bool FileMove_Impl( const OUString & rFile1, const OUString & rFile2, bool bImme
|
||||
{
|
||||
SvFileStream aOutStm1( rFile1, StreamMode::STD_READ );
|
||||
SvFileStream aOutStm2( rFile2, StreamMode::STD_READ );
|
||||
if( aOutStm1.GetError() == SVSTREAM_OK )
|
||||
if( aOutStm1.GetError() == ERRCODE_NONE )
|
||||
{
|
||||
std::unique_ptr<sal_uInt8[]> pBuf1(new sal_uInt8[ BR ]);
|
||||
std::unique_ptr<sal_uInt8[]> pBuf2(new sal_uInt8[ BR ]);
|
||||
@@ -144,7 +144,7 @@ int main ( int argc, char ** argv)
|
||||
aTmpDepFile = tempFileHelper(aCommand.m_DepFile);
|
||||
SvFileStream aOutStm( aTmpDepFile, StreamMode::READWRITE | StreamMode::TRUNC );
|
||||
pDataBase->WriteDepFile(aOutStm, aCommand.aTargetFile);
|
||||
if( aOutStm.GetError() != SVSTREAM_OK )
|
||||
if( aOutStm.GetError() != ERRCODE_NONE )
|
||||
{
|
||||
nExit = -1;
|
||||
fprintf( stderr, "cannot write dependency file: %s\n",
|
||||
|
||||
@@ -55,7 +55,7 @@ enum class EEAnchorMode {
|
||||
EDITENG_DLLPUBLIC extern const size_t EE_APPEND;
|
||||
|
||||
// Error messages for Read / Write Method
|
||||
#define EE_READWRITE_OK (SVSTREAM_OK)
|
||||
#define EE_READWRITE_OK (ERRCODE_NONE)
|
||||
#define EE_READWRITE_WRONGFORMAT (SVSTREAM_ERRBASE_USER+1)
|
||||
#define EE_READWRITE_GENERALERROR (SVSTREAM_ERRBASE_USER+2)
|
||||
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ public:
|
||||
void ResetError() const;
|
||||
void SetError( ErrCode ) const;
|
||||
ErrCode GetError() const;
|
||||
bool Good() const { return m_nError == SVSTREAM_OK; }
|
||||
bool Good() const { return m_nError == ERRCODE_NONE; }
|
||||
StreamMode GetMode() const { return m_nMode; }
|
||||
void SetAutoCommit( bool bSet )
|
||||
{ m_bAutoCommit = bSet; }
|
||||
|
||||
@@ -108,7 +108,7 @@ public:
|
||||
ErrCode GetError() const { return ERRCODE_TOERROR(m_nError); }
|
||||
void SetError( ErrCode nErrorCode )
|
||||
{
|
||||
if( m_nError == SVSTREAM_OK )
|
||||
if( m_nError == ERRCODE_NONE )
|
||||
m_nError = nErrorCode;
|
||||
}
|
||||
|
||||
|
||||
@@ -222,10 +222,7 @@ inline sal_uInt32 ERRCODE_TOERROR( ErrCode x )
|
||||
#define ERRCODE_IO_NOTSTORABLEINBINARYFORMAT CAST_TO_UINT32(39UL |ERRCODE_CLASS_FORMAT|\
|
||||
ERRCODE_AREA_IO)
|
||||
|
||||
// FsysErrorCodes
|
||||
|
||||
// StreamErrorCodes
|
||||
#define SVSTREAM_OK ERRCODE_NONE
|
||||
|
||||
#define SVSTREAM_GENERALERROR ERRCODE_IO_GENERAL
|
||||
#define SVSTREAM_FILE_NOT_FOUND ERRCODE_IO_NOTEXISTS
|
||||
|
||||
@@ -62,7 +62,7 @@ bool SAL_CALL LotusWordProImportFilter::importImpl( const Sequence< css::beans::
|
||||
}
|
||||
|
||||
SvFileStream inputStream( sURL, StreamMode::READ );
|
||||
if ( inputStream.IsEof() || ( inputStream.GetError() != SVSTREAM_OK ) )
|
||||
if ( inputStream.IsEof() || ( inputStream.GetError() != ERRCODE_NONE ) )
|
||||
return false;
|
||||
|
||||
// An XML import service: what we push sax messages to..
|
||||
|
||||
@@ -37,7 +37,7 @@ ScMultipleReadHeader::ScMultipleReadHeader(SvStream& rNewStream) :
|
||||
if (nID != SCID_SIZES)
|
||||
{
|
||||
OSL_FAIL("SCID_SIZES not found");
|
||||
if ( rStream.GetError() == SVSTREAM_OK )
|
||||
if ( rStream.GetError() == ERRCODE_NONE )
|
||||
rStream.SetError( SVSTREAM_FILEFORMAT_ERROR );
|
||||
|
||||
// everything to 0, so BytesLeft() aborts at least
|
||||
@@ -62,7 +62,7 @@ ScMultipleReadHeader::~ScMultipleReadHeader()
|
||||
if ( pMemStream && pMemStream->Tell() != pMemStream->GetEndOfData() )
|
||||
{
|
||||
OSL_FAIL( "Sizes not fully read" );
|
||||
if ( rStream.GetError() == SVSTREAM_OK )
|
||||
if ( rStream.GetError() == ERRCODE_NONE )
|
||||
rStream.SetError( SCWARN_IMPORT_INFOLOST );
|
||||
}
|
||||
delete pMemStream;
|
||||
@@ -77,7 +77,7 @@ void ScMultipleReadHeader::EndEntry()
|
||||
OSL_ENSURE( nPos <= nEntryEnd, "read too much" );
|
||||
if ( nPos != nEntryEnd )
|
||||
{
|
||||
if ( rStream.GetError() == SVSTREAM_OK )
|
||||
if ( rStream.GetError() == ERRCODE_NONE )
|
||||
rStream.SetError( SCWARN_IMPORT_INFOLOST );
|
||||
rStream.Seek( nEntryEnd ); // ignore the rest
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ void ImportExcel8::ReadBasic()
|
||||
{
|
||||
// see if we have the XCB stream
|
||||
tools::SvRef<SotStorageStream> xXCB = xRootStrg->OpenSotStream( "XCB", StreamMode::STD_READ );
|
||||
if ( xXCB.is()|| SVSTREAM_OK == xXCB->GetError() )
|
||||
if ( xXCB.is()|| ERRCODE_NONE == xXCB->GetError() )
|
||||
{
|
||||
ScCTBWrapper wrapper;
|
||||
if ( wrapper.Read( *xXCB ) )
|
||||
|
||||
@@ -458,7 +458,7 @@ bool ScImportExport::ExportStream( SvStream& rStrm, const OUString& rBaseURL, So
|
||||
rStrm.WriteUInt16( 0 );
|
||||
else
|
||||
rStrm.WriteChar( 0 );
|
||||
return rStrm.GetError() == SVSTREAM_OK;
|
||||
return rStrm.GetError() == ERRCODE_NONE;
|
||||
}
|
||||
}
|
||||
if( nFmt == SotClipboardFormatId::HTML )
|
||||
@@ -1691,14 +1691,14 @@ bool ScImportExport::Doc2Text( SvStream& rStrm )
|
||||
lcl_WriteSimpleString( rStrm, OUString(cSep) );
|
||||
}
|
||||
WriteUnicodeOrByteEndl( rStrm );
|
||||
if( rStrm.GetError() != SVSTREAM_OK )
|
||||
if( rStrm.GetError() != ERRCODE_NONE )
|
||||
break;
|
||||
if( nSizeLimit && rStrm.Tell() > nSizeLimit )
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return rStrm.GetError() == SVSTREAM_OK;
|
||||
return rStrm.GetError() == ERRCODE_NONE;
|
||||
}
|
||||
|
||||
bool ScImportExport::Sylk2Doc( SvStream& rStrm )
|
||||
@@ -2094,7 +2094,7 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm )
|
||||
}
|
||||
lcl_WriteSimpleString( rStrm, OUString( 'E' ) );
|
||||
WriteUnicodeOrByteEndl( rStrm );
|
||||
return rStrm.GetError() == SVSTREAM_OK;
|
||||
return rStrm.GetError() == ERRCODE_NONE;
|
||||
}
|
||||
|
||||
bool ScImportExport::Doc2HTML( SvStream& rStrm, const OUString& rBaseURL )
|
||||
@@ -2102,14 +2102,14 @@ bool ScImportExport::Doc2HTML( SvStream& rStrm, const OUString& rBaseURL )
|
||||
// rtl_TextEncoding is ignored in ScExportHTML, read from Load/Save HTML options
|
||||
ScFormatFilter::Get().ScExportHTML( rStrm, rBaseURL, pDoc, aRange, RTL_TEXTENCODING_DONTKNOW, bAll,
|
||||
aStreamPath, aNonConvertibleChars, maFilterOptions );
|
||||
return rStrm.GetError() == SVSTREAM_OK;
|
||||
return rStrm.GetError() == ERRCODE_NONE;
|
||||
}
|
||||
|
||||
bool ScImportExport::Doc2RTF( SvStream& rStrm )
|
||||
{
|
||||
// rtl_TextEncoding is ignored in ScExportRTF
|
||||
ScFormatFilter::Get().ScExportRTF( rStrm, pDoc, aRange, RTL_TEXTENCODING_DONTKNOW );
|
||||
return rStrm.GetError() == SVSTREAM_OK;
|
||||
return rStrm.GetError() == ERRCODE_NONE;
|
||||
}
|
||||
|
||||
bool ScImportExport::Doc2Dif( SvStream& rStrm )
|
||||
|
||||
@@ -1451,13 +1451,13 @@ extern "C" SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL SaveVBA( SfxObjectShell& rDocS
|
||||
aMSVBas.SaveOrDelMSVBAStorage( true, "_MS_VBA_Overhead" );
|
||||
|
||||
tools::SvRef<SotStorage> xOverhead = xDest->OpenSotStorage( "_MS_VBA_Overhead" );
|
||||
if ( xOverhead.is() && ( xOverhead->GetError() == SVSTREAM_OK ) )
|
||||
if ( xOverhead.is() && ( xOverhead->GetError() == ERRCODE_NONE ) )
|
||||
{
|
||||
tools::SvRef<SotStorage> xOverhead2 = xOverhead->OpenSotStorage( "_MS_VBA_Overhead" );
|
||||
if ( xOverhead2.is() && ( xOverhead2->GetError() == SVSTREAM_OK ) )
|
||||
if ( xOverhead2.is() && ( xOverhead2->GetError() == ERRCODE_NONE ) )
|
||||
{
|
||||
tools::SvRef<SotStorageStream> xTemp = xOverhead2->OpenSotStream( "_MS_VBA_Overhead2" );
|
||||
if ( xTemp.is() && ( xTemp->GetError() == SVSTREAM_OK ) )
|
||||
if ( xTemp.is() && ( xTemp->GetError() == ERRCODE_NONE ) )
|
||||
{
|
||||
sal_uInt32 nLen = xTemp->GetSize();
|
||||
if ( nLen )
|
||||
|
||||
@@ -1543,7 +1543,7 @@ void SdPublishingDlg::Load()
|
||||
pStream->ReadUInt16( nDesigns );
|
||||
|
||||
for( sal_uInt16 nIndex = 0;
|
||||
pStream->GetError() == SVSTREAM_OK && nIndex < nDesigns;
|
||||
pStream->GetError() == ERRCODE_NONE && nIndex < nDesigns;
|
||||
nIndex++ )
|
||||
{
|
||||
SdPublishingDesign aDesign;
|
||||
@@ -1576,7 +1576,7 @@ bool SdPublishingDlg::Save()
|
||||
pStream->WriteUInt16( nDesigns );
|
||||
|
||||
for( sal_uInt16 nIndex = 0;
|
||||
pStream->GetError() == SVSTREAM_OK && nIndex < nDesigns;
|
||||
pStream->GetError() == ERRCODE_NONE && nIndex < nDesigns;
|
||||
nIndex++ )
|
||||
WriteSdPublishingDesign( *pStream, m_aDesignList[nIndex] );
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ public:
|
||||
|
||||
SfxMedium_Impl::SfxMedium_Impl() :
|
||||
m_nStorOpenMode(SFX_STREAM_READWRITE),
|
||||
m_eError(SVSTREAM_OK),
|
||||
m_eError(ERRCODE_NONE),
|
||||
bUpdatePickList(true),
|
||||
bIsTemp( false ),
|
||||
bDownloadDone( true ),
|
||||
@@ -291,7 +291,7 @@ SfxMedium_Impl::~SfxMedium_Impl()
|
||||
|
||||
void SfxMedium::ResetError()
|
||||
{
|
||||
pImpl->m_eError = SVSTREAM_OK;
|
||||
pImpl->m_eError = ERRCODE_NONE;
|
||||
if( pImpl->m_pInStream )
|
||||
pImpl->m_pInStream->ResetError();
|
||||
if( pImpl->m_pOutStream )
|
||||
@@ -649,13 +649,13 @@ bool SfxMedium::Commit()
|
||||
else if( pImpl->m_pInStream )
|
||||
pImpl->m_pInStream->Flush();
|
||||
|
||||
if ( GetError() == SVSTREAM_OK )
|
||||
if ( GetError() == ERRCODE_NONE )
|
||||
{
|
||||
// does something only in case there is a temporary file ( means aName points to different location than aLogicName )
|
||||
Transfer_Impl();
|
||||
}
|
||||
|
||||
bool bResult = ( GetError() == SVSTREAM_OK );
|
||||
bool bResult = ( GetError() == ERRCODE_NONE );
|
||||
|
||||
if ( bResult && DocNeedsFileDateCheck() )
|
||||
GetInitFileDate( true );
|
||||
@@ -1353,7 +1353,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( bool bCreateTempIfNo )
|
||||
// impossibility to create the storage is no error
|
||||
}
|
||||
|
||||
if( ( pImpl->nLastStorageError = GetError() ) != SVSTREAM_OK )
|
||||
if( ( pImpl->nLastStorageError = GetError() ) != ERRCODE_NONE )
|
||||
{
|
||||
pImpl->xStorage = nullptr;
|
||||
if ( pImpl->m_pInStream )
|
||||
@@ -1399,7 +1399,7 @@ uno::Reference < embed::XStorage > SfxMedium::GetStorage( bool bCreateTempIfNo )
|
||||
// There the version is stored as packed Stream
|
||||
uno::Reference < io::XStream > xStr = xSub->openStreamElement( rTag.Identifier, embed::ElementModes::READ );
|
||||
SvStream* pStream = utl::UcbStreamHelper::CreateStream( xStr );
|
||||
if ( pStream && pStream->GetError() == SVSTREAM_OK )
|
||||
if ( pStream && pStream->GetError() == ERRCODE_NONE )
|
||||
{
|
||||
// Unpack Stream in TempDir
|
||||
::utl::TempFile aTempFile;
|
||||
|
||||
@@ -2105,7 +2105,7 @@ bool SfxObjectShell::ConvertFrom
|
||||
*xStream >> ...;
|
||||
|
||||
// Do not call 'rMedium.CloseInStream()'! Keep File locked!
|
||||
return SVSTREAM_OK == rMedium.GetError();
|
||||
return ERRCODE_NONE == rMedium.GetError();
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -2430,7 +2430,7 @@ bool SfxObjectShell::ConvertTo
|
||||
*xStream << ...;
|
||||
|
||||
rMedium.CloseOutStream(); // opens the InStream automatically
|
||||
return SVSTREAM_OK == rMedium.GetError();
|
||||
return ERRCODE_NONE == rMedium.GetError();
|
||||
}
|
||||
return false ;
|
||||
}
|
||||
|
||||
@@ -688,7 +688,7 @@ void SfxOleDictionaryProperty::ImplLoad( SvStream& rStrm )
|
||||
sal_Int32 nNameCount = GetPropType();
|
||||
// read property ID/name pairs
|
||||
maPropNameMap.clear();
|
||||
for( sal_Int32 nIdx = 0; (nIdx < nNameCount) && (rStrm.GetErrorCode() == SVSTREAM_OK) && !rStrm.IsEof(); ++nIdx )
|
||||
for( sal_Int32 nIdx = 0; (nIdx < nNameCount) && (rStrm.GetErrorCode() == ERRCODE_NONE) && !rStrm.IsEof(); ++nIdx )
|
||||
{
|
||||
sal_Int32 nPropId(0);
|
||||
rStrm.ReadInt32( nPropId );
|
||||
@@ -953,7 +953,7 @@ void SfxOleSection::ImplLoad( SvStream& rStrm )
|
||||
// read property ID/position pairs
|
||||
typedef ::std::map< sal_Int32, sal_uInt32 > SfxOlePropPosMap;
|
||||
SfxOlePropPosMap aPropPosMap;
|
||||
for( sal_Int32 nPropIdx = 0; (nPropIdx < nPropCount) && (rStrm.GetErrorCode() == SVSTREAM_OK) && !rStrm.IsEof(); ++nPropIdx )
|
||||
for( sal_Int32 nPropIdx = 0; (nPropIdx < nPropCount) && (rStrm.GetErrorCode() == ERRCODE_NONE) && !rStrm.IsEof(); ++nPropIdx )
|
||||
{
|
||||
sal_Int32 nPropId(0);
|
||||
sal_uInt32 nPropPos(0);
|
||||
@@ -1034,7 +1034,7 @@ void SfxOleSection::ImplSave( SvStream& rStrm )
|
||||
bool SfxOleSection::SeekToPropertyPos( SvStream& rStrm, sal_uInt32 nPropPos ) const
|
||||
{
|
||||
rStrm.Seek( static_cast< std::size_t >( mnStartPos + nPropPos ) );
|
||||
return rStrm.GetErrorCode() == SVSTREAM_OK;
|
||||
return rStrm.GetErrorCode() == ERRCODE_NONE;
|
||||
}
|
||||
|
||||
void SfxOleSection::LoadProperty( SvStream& rStrm, sal_Int32 nPropId )
|
||||
@@ -1099,7 +1099,7 @@ ErrCode SfxOlePropertySet::LoadPropertySet( SotStorage* pStrg, const OUString& r
|
||||
if( pStrg )
|
||||
{
|
||||
tools::SvRef<SotStorageStream> xStrm = pStrg->OpenSotStream( rStrmName, StreamMode::STD_READ );
|
||||
if( xStrm.is() && (xStrm->GetError() == SVSTREAM_OK) )
|
||||
if( xStrm.is() && (xStrm->GetError() == ERRCODE_NONE) )
|
||||
{
|
||||
xStrm->SetBufferSize( STREAM_BUFFER_SIZE );
|
||||
Load( *xStrm );
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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 );
|
||||
|
||||
@@ -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 )
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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: */
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -32,7 +32,7 @@ bool GetMathTypeVersion( SotStorage* pStor, sal_uInt8 &nVersion )
|
||||
tools::SvRef<SotStorageStream> xSrc = pStor->OpenSotStream(
|
||||
"Equation Native",
|
||||
StreamMode::STD_READ);
|
||||
if ( (!xSrc.is()) || (SVSTREAM_OK != xSrc->GetError()))
|
||||
if ( (!xSrc.is()) || (ERRCODE_NONE != xSrc->GetError()))
|
||||
return bSuccess;
|
||||
SotStorageStream *pS = xSrc.get();
|
||||
pS->SetEndian( SvStreamEndian::LITTLE );
|
||||
|
||||
@@ -558,7 +558,7 @@ bool MathType::Parse(SotStorage *pStor)
|
||||
tools::SvRef<SotStorageStream> xSrc = pStor->OpenSotStream(
|
||||
"Equation Native",
|
||||
StreamMode::STD_READ);
|
||||
if ( (!xSrc.is()) || (SVSTREAM_OK != xSrc->GetError()))
|
||||
if ( (!xSrc.is()) || (ERRCODE_NONE != xSrc->GetError()))
|
||||
return false;
|
||||
pS = xSrc.get();
|
||||
pS->SetEndian( SvStreamEndian::LITTLE );
|
||||
@@ -1922,7 +1922,7 @@ bool MathType::ConvertFromStarMath( SfxMedium& rMedium )
|
||||
xStor2.clear();
|
||||
|
||||
tools::SvRef<SotStorageStream> xSrc = pStor->OpenSotStream("Equation Native");
|
||||
if ( (!xSrc.is()) || (SVSTREAM_OK != xSrc->GetError()))
|
||||
if ( (!xSrc.is()) || (ERRCODE_NONE != xSrc->GetError()))
|
||||
return false;
|
||||
|
||||
pS = xSrc.get();
|
||||
|
||||
@@ -148,7 +148,7 @@ SvStream& SvxMacroTableDtor::Write( SvStream& rStream ) const
|
||||
rStream.WriteUInt16( aSvxMacroTable.size() );
|
||||
|
||||
SvxMacroTable::const_iterator it = aSvxMacroTable.begin();
|
||||
while( it != aSvxMacroTable.end() && rStream.GetError() == SVSTREAM_OK )
|
||||
while( it != aSvxMacroTable.end() && rStream.GetError() == ERRCODE_NONE )
|
||||
{
|
||||
const SvxMacro& rMac = it->second;
|
||||
rStream.WriteUInt16( it->first );
|
||||
|
||||
@@ -1054,7 +1054,7 @@ bool SwLayCacheIoImpl::OpenRec( sal_uInt8 cType )
|
||||
pStream->ReadUInt32( nVal );
|
||||
sal_uInt8 cRecTyp = (sal_uInt8)nVal;
|
||||
if( !nVal || cRecTyp != cType ||
|
||||
pStream->GetErrorCode() != SVSTREAM_OK || pStream->IsEof() )
|
||||
pStream->GetErrorCode() != ERRCODE_NONE || pStream->IsEof() )
|
||||
{
|
||||
OSL_ENSURE( nVal, "OpenRec: Record-Header is 0" );
|
||||
OSL_ENSURE( cRecTyp == cType, "OpenRec: Wrong Record Type" );
|
||||
@@ -1087,7 +1087,7 @@ bool SwLayCacheIoImpl::CloseRec()
|
||||
sal_uInt32 nVal = ( nSize << 8 ) | aRecords.back().type;
|
||||
pStream->WriteUInt32( nVal );
|
||||
pStream->Seek( nPos );
|
||||
if( pStream->GetError() != SVSTREAM_OK )
|
||||
if( pStream->GetError() != ERRCODE_NONE )
|
||||
bRes = false;
|
||||
}
|
||||
else
|
||||
@@ -1100,7 +1100,7 @@ bool SwLayCacheIoImpl::CloseRec()
|
||||
if( n < nPos )
|
||||
bRes = false;
|
||||
}
|
||||
if( pStream->GetErrorCode() != SVSTREAM_OK )
|
||||
if( pStream->GetErrorCode() != ERRCODE_NONE )
|
||||
bRes = false;
|
||||
}
|
||||
aRecords.pop_back();
|
||||
@@ -1133,7 +1133,7 @@ sal_uInt8 SwLayCacheIoImpl::Peek()
|
||||
sal_uInt32 nPos = pStream->Tell();
|
||||
pStream->ReadUChar( c );
|
||||
pStream->Seek( nPos );
|
||||
if( pStream->GetErrorCode() != SVSTREAM_OK )
|
||||
if( pStream->GetErrorCode() != ERRCODE_NONE )
|
||||
{
|
||||
c = 0;
|
||||
bError = true;
|
||||
|
||||
@@ -392,7 +392,7 @@ sal_uLong SwXMLTextBlocks::PutBlockText( const OUString& rShort,
|
||||
sal_uLong nRes = 0;
|
||||
if( nErr == SVSTREAM_DISK_FULL )
|
||||
nRes = ERR_W4W_WRITE_FULL;
|
||||
else if( nErr != SVSTREAM_OK )
|
||||
else if( nErr != ERRCODE_NONE )
|
||||
nRes = ERR_SWG_WRITE_ERROR;
|
||||
*/
|
||||
if( !nRes ) // So that we can access the Doc via GetText & nCur
|
||||
|
||||
@@ -313,7 +313,7 @@ sal_uLong SwASCIIParser::ReadChars()
|
||||
|
||||
// Read a new block
|
||||
sal_uLong lGCount;
|
||||
if( SVSTREAM_OK != rInput.GetError() || 0 == (lGCount =
|
||||
if( ERRCODE_NONE != rInput.GetError() || 0 == (lGCount =
|
||||
rInput.ReadBytes( pArr + nArrOffset,
|
||||
ASC_BUFFLEN - nArrOffset )))
|
||||
break; // break from the while loop
|
||||
|
||||
@@ -112,7 +112,7 @@ bool SwIoSystem::IsValidStgFilter(SotStorage& rStg, const SfxFilter& rFilter)
|
||||
if (rFilter.GetUserData() == FILTER_WW8 || rFilter.GetUserData() == sWW6)
|
||||
nStgFormatId = SotClipboardFormatId::NONE;
|
||||
|
||||
bool bRet = SVSTREAM_OK == rStg.GetError() &&
|
||||
bool bRet = ERRCODE_NONE == rStg.GetError() &&
|
||||
( nStgFormatId == SotClipboardFormatId::NONE || rFilter.GetFormat() == nStgFormatId ) &&
|
||||
( rStg.IsContained( SwIoSystem::GetSubStorageName( rFilter )) );
|
||||
if( bRet )
|
||||
@@ -203,7 +203,7 @@ std::shared_ptr<const SfxFilter> SwIoSystem::GetFileFilter(const OUString& rFile
|
||||
{
|
||||
}
|
||||
|
||||
if( xStg.is() && ( xStg->GetError() == SVSTREAM_OK ) )
|
||||
if( xStg.is() && ( xStg->GetError() == ERRCODE_NONE ) )
|
||||
{
|
||||
while ( pFilter )
|
||||
{
|
||||
|
||||
@@ -3719,7 +3719,7 @@ void WW8Export::RestoreMacroCmds()
|
||||
xSrcRoot->openStreamElement( SL::aMSMacroCmds, embed::ElementModes::READ );
|
||||
SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( xSrcStream );
|
||||
|
||||
if ( pStream && SVSTREAM_OK == pStream->GetError())
|
||||
if ( pStream && ERRCODE_NONE == pStream->GetError())
|
||||
{
|
||||
pStream->Seek(STREAM_SEEK_TO_END);
|
||||
pFib->m_lcbCmds = pStream->Tell();
|
||||
|
||||
@@ -47,7 +47,7 @@ WW8Glossary::WW8Glossary(tools::SvRef<SotStorageStream> &refStrm, sal_uInt8 nVer
|
||||
xTableStream = pStg->OpenSotStream(
|
||||
aWwFib.m_fWhichTableStm ? SL::a1Table : SL::a0Table, StreamMode::STD_READ);
|
||||
|
||||
if (xTableStream.is() && SVSTREAM_OK == xTableStream->GetError())
|
||||
if (xTableStream.is() && ERRCODE_NONE == xTableStream->GetError())
|
||||
{
|
||||
xTableStream->SetEndian(SvStreamEndian::LITTLE);
|
||||
pGlossary.reset( new WW8GlossaryFib(*refStrm, nVersion, aWwFib) );
|
||||
|
||||
@@ -4871,7 +4871,7 @@ void SwWW8ImplReader::ReadGlobalTemplateSettings( const OUString& sCreatedFrom,
|
||||
tools::SvRef<SotStorageStream> xTableStream =
|
||||
rRoot->OpenSotStream(aWwFib.m_fWhichTableStm ? SL::a1Table : SL::a0Table, StreamMode::STD_READ);
|
||||
|
||||
if (xTableStream.is() && SVSTREAM_OK == xTableStream->GetError())
|
||||
if (xTableStream.is() && ERRCODE_NONE == xTableStream->GetError())
|
||||
{
|
||||
xTableStream->SetEndian(SvStreamEndian::LITTLE);
|
||||
WW8Customizations aGblCustomisations( xTableStream.get(), aWwFib );
|
||||
@@ -5421,7 +5421,7 @@ sal_uLong SwWW8ImplReader::SetSubStreams(tools::SvRef<SotStorageStream> &rTableS
|
||||
|
||||
rDataStream = m_pStg->OpenSotStream(SL::aData, StreamMode::STD_READ);
|
||||
|
||||
if (rDataStream.is() && SVSTREAM_OK == rDataStream->GetError())
|
||||
if (rDataStream.is() && ERRCODE_NONE == rDataStream->GetError())
|
||||
{
|
||||
m_pDataStream = rDataStream.get();
|
||||
m_pDataStream->SetEndian(SvStreamEndian::LITTLE);
|
||||
@@ -6240,7 +6240,7 @@ sal_uLong WW8Reader::OpenMainStream( tools::SvRef<SotStorageStream>& rRef, sal_u
|
||||
|
||||
if( rRef.is() )
|
||||
{
|
||||
if( SVSTREAM_OK == rRef->GetError() )
|
||||
if( ERRCODE_NONE == rRef->GetError() )
|
||||
{
|
||||
sal_uInt16 nOld = rRef->GetBufferSize();
|
||||
rRef->SetBufferSize( rBuffSize );
|
||||
|
||||
@@ -441,7 +441,7 @@ void SvPersistStream::ReadObj
|
||||
OSL_FAIL( "false version" );
|
||||
}
|
||||
|
||||
if( !(nHdr & P_ID_0) && GetError() == SVSTREAM_OK )
|
||||
if( !(nHdr & P_ID_0) && GetError() == ERRCODE_NONE )
|
||||
{
|
||||
if( P_OBJ & nHdr )
|
||||
{ // read object, nId only set for P_DBGUTIL
|
||||
|
||||
@@ -370,12 +370,12 @@ SvStream::~SvStream()
|
||||
void SvStream::ClearError()
|
||||
{
|
||||
m_isEof = false;
|
||||
m_nError = SVSTREAM_OK;
|
||||
m_nError = ERRCODE_NONE;
|
||||
}
|
||||
|
||||
void SvStream::SetError( sal_uInt32 nErrorCode )
|
||||
{
|
||||
if (m_nError == SVSTREAM_OK)
|
||||
if (m_nError == ERRCODE_NONE)
|
||||
m_nError = nErrorCode;
|
||||
}
|
||||
|
||||
@@ -691,13 +691,13 @@ bool SvStream::WriteUnicodeOrByteText( const OUString& rStr, rtl_TextEncoding eD
|
||||
if ( eDestCharSet == RTL_TEXTENCODING_UNICODE )
|
||||
{
|
||||
write_uInt16s_FromOUString(*this, rStr, rStr.getLength());
|
||||
return m_nError == SVSTREAM_OK;
|
||||
return m_nError == ERRCODE_NONE;
|
||||
}
|
||||
else
|
||||
{
|
||||
OString aStr(OUStringToOString(rStr, eDestCharSet));
|
||||
write_uInt8s_FromOString(*this, aStr, aStr.getLength());
|
||||
return m_nError == SVSTREAM_OK;
|
||||
return m_nError == ERRCODE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -710,7 +710,7 @@ bool SvStream::WriteLine(const OString& rStr)
|
||||
{
|
||||
WriteBytes(rStr.getStr(), rStr.getLength());
|
||||
endl(*this);
|
||||
return m_nError == SVSTREAM_OK;
|
||||
return m_nError == ERRCODE_NONE;
|
||||
}
|
||||
|
||||
bool SvStream::WriteUniOrByteChar( sal_Unicode ch, rtl_TextEncoding eDestCharSet )
|
||||
@@ -722,7 +722,7 @@ bool SvStream::WriteUniOrByteChar( sal_Unicode ch, rtl_TextEncoding eDestCharSet
|
||||
OString aStr(&ch, 1, eDestCharSet);
|
||||
WriteBytes(aStr.getStr(), aStr.getLength());
|
||||
}
|
||||
return m_nError == SVSTREAM_OK;
|
||||
return m_nError == ERRCODE_NONE;
|
||||
}
|
||||
|
||||
void SvStream::StartWritingUnicodeText()
|
||||
|
||||
@@ -181,7 +181,7 @@ static sal_uInt32 GetSvError( int nErrno )
|
||||
{
|
||||
static struct { int nErr; sal_uInt32 sv; } errArr[] =
|
||||
{
|
||||
{ 0, SVSTREAM_OK },
|
||||
{ 0, ERRCODE_NONE },
|
||||
{ EACCES, SVSTREAM_ACCESS_DENIED },
|
||||
{ EBADF, SVSTREAM_INVALID_HANDLE },
|
||||
#if defined(NETBSD) || \
|
||||
@@ -233,7 +233,7 @@ static sal_uInt32 GetSvError( oslFileError nErrno )
|
||||
{
|
||||
static struct { oslFileError nErr; sal_uInt32 sv; } errArr[] =
|
||||
{
|
||||
{ osl_File_E_None, SVSTREAM_OK },
|
||||
{ osl_File_E_None, ERRCODE_NONE },
|
||||
{ osl_File_E_ACCES, SVSTREAM_ACCESS_DENIED },
|
||||
{ osl_File_E_BADF, SVSTREAM_INVALID_HANDLE },
|
||||
{ osl_File_E_DEADLK, SVSTREAM_LOCKING_VIOLATION },
|
||||
|
||||
@@ -48,7 +48,7 @@ static std::size_t GetSvError( DWORD nWntError )
|
||||
{
|
||||
static struct { DWORD wnt; std::size_t sv; } errArr[] =
|
||||
{
|
||||
{ ERROR_SUCCESS, SVSTREAM_OK },
|
||||
{ ERROR_SUCCESS, ERRCODE_NONE },
|
||||
{ ERROR_ACCESS_DENIED, SVSTREAM_ACCESS_DENIED },
|
||||
{ ERROR_ACCOUNT_DISABLED, SVSTREAM_ACCESS_DENIED },
|
||||
{ ERROR_ACCOUNT_EXPIRED, SVSTREAM_ACCESS_DENIED },
|
||||
|
||||
Reference in New Issue
Block a user