Kaydet (Commit) a6aa57ff authored tarafından Noel Grandin's avatar Noel Grandin

use ERRCODE_NONE instead of 0

peeling off a small chunk of my ErrCode strong_int conversion

Change-Id: Idc89e8496083beed7608cba705cd981139eb7111
Reviewed-on: https://gerrit.libreoffice.org/38777Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 546c3551
......@@ -1542,7 +1542,7 @@ bool BasicManager::HasMacro( OUString const& i_fullyQualifiedName ) const
ErrCode BasicManager::ExecuteMacro( OUString const& i_fullyQualifiedName, SbxArray* i_arguments, SbxValue* i_retValue )
{
SbMethod* pMethod = lcl_queryMacro( this, i_fullyQualifiedName );
ErrCode nError = 0;
ErrCode nError = ERRCODE_NONE;
if ( pMethod )
{
if ( i_arguments )
......
......@@ -46,7 +46,7 @@ SbiGlobals::SbiGlobals()
pMod = nullptr;
pCompMod = nullptr; // JSM
nInst = 0;
nCode = 0;
nCode = ERRCODE_NONE;
nLine = 0;
nCol1 = nCol2 = 0;
bCompilerError = false;
......
......@@ -1064,7 +1064,7 @@ void SbModule::Run( SbMethod* pMeth )
// Launcher problem
// i80726 The Find below will generate an error in Testtool so we reset it unless there was one before already
bool bWasError = SbxBase::GetError() != 0;
bool bWasError = SbxBase::GetError() != ERRCODE_NONE;
SbxVariable* pMSOMacroRuntimeLibVar = Find( "Launcher", SbxClassType::Object );
if ( !bWasError && (SbxBase::GetError() == ERRCODE_SBX_PROC_UNDEFINED) )
SbxBase::ResetError();
......
......@@ -376,7 +376,7 @@ bool SbiScanner::NextSym()
aSym = p; bNumber = true;
// For bad characters, scan and parse errors generate only one error.
SbError nError = 0;
ErrCode nError = ERRCODE_NONE;
if (bScanError)
{
--pLine;
......
......@@ -115,7 +115,7 @@ SbError SbiDdeControl::Initiate( const OUString& rService, const OUString& rTopi
aConvList[nChannel-1] = pConv;
rnHandle = nChannel;
}
return 0;
return ERRCODE_NONE;
}
SbError SbiDdeControl::Terminate( size_t nChannel )
......@@ -133,7 +133,7 @@ SbError SbiDdeControl::Terminate( size_t nChannel )
delete pConv;
aConvList[nChannel-1] = DDE_FREECHANNEL;
return 0;
return ERRCODE_NONE;
}
SbError SbiDdeControl::TerminateAll()
......@@ -148,7 +148,7 @@ SbError SbiDdeControl::TerminateAll()
aConvList.clear();
return 0;
return ERRCODE_NONE;
}
SbError SbiDdeControl::Request( size_t nChannel, const OUString& rItem, OUString& rResult )
......
......@@ -206,7 +206,7 @@ RTLFUNC(Error)
else
{
OUString aErrorMsg;
SbError nErr = 0;
SbError nErr = ERRCODE_NONE;
sal_Int32 nCode = 0;
if( rPar.Count() == 1 )
{
......
......@@ -1080,7 +1080,7 @@ static bool lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm,
{
pStrm->Seek( nFPos + nBlockLen );
}
return pStrm->GetErrorCode() == 0;
return pStrm->GetErrorCode() == ERRCODE_NONE;
}
static bool lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm,
......@@ -1191,7 +1191,7 @@ static bool lcl_ReadSbxVariable( SbxVariable& rVar, SvStream* pStrm,
{
pStrm->Seek( nFPos + nBlockLen );
}
return pStrm->GetErrorCode() == 0;
return pStrm->GetErrorCode() == ERRCODE_NONE;
}
......@@ -2283,7 +2283,7 @@ RTLFUNC(DateDiff)
double implGetDateOfFirstDayInFirstWeek
( sal_Int16 nYear, sal_Int16& nFirstDay, sal_Int16& nFirstWeek, bool* pbError = nullptr )
{
SbError nError = 0;
SbError nError = ERRCODE_NONE;
if( nFirstDay < 0 || nFirstDay > 7 )
nError = ERRCODE_BASIC_BAD_ARGUMENT;
......@@ -2298,7 +2298,7 @@ double implGetDateOfFirstDayInFirstWeek
nError = ERRCODE_BASIC_BAD_ARGUMENT;
}
if( nError != 0 )
if( nError != ERRCODE_NONE )
{
StarBASIC::Error( nError );
if( pbError )
......
......@@ -585,7 +585,7 @@ SbiRuntime::SbiRuntime( SbModule* pm, SbMethod* pe, sal_uInt32 nStart )
nCol2 = 0;
nExprLvl = 0;
nArgc = 0;
nError = 0;
nError = ERRCODE_NONE;
nForLvl = 0;
nOps = 0;
refExprStk = new SbxArray;
......@@ -792,7 +792,7 @@ bool SbiRuntime::Step()
{
SbError err = nError;
ClearExprStack();
nError = 0;
nError = ERRCODE_NONE;
pInst->nErr = err;
pInst->nErl = nLine;
pErrCode = pCode;
......@@ -2408,7 +2408,7 @@ void SbiRuntime::StepINPUT()
char ch = 0;
SbError err;
// Skip whitespace
while( ( err = pIosys->GetError() ) == 0 )
while( ( err = pIosys->GetError() ) == ERRCODE_NONE )
{
ch = pIosys->Read();
if( ch != ' ' && ch != '\t' && ch != '\n' )
......@@ -2424,7 +2424,7 @@ void SbiRuntime::StepINPUT()
{
ch = pIosys->Read();
}
while( ( err = pIosys->GetError() ) == 0 )
while( ( err = pIosys->GetError() ) == ERRCODE_NONE )
{
if( ch == sep )
{
......@@ -2444,7 +2444,7 @@ void SbiRuntime::StepINPUT()
// skip whitespace
if( ch == ' ' || ch == '\t' )
{
while( ( err = pIosys->GetError() ) == 0 )
while( ( err = pIosys->GetError() ) == ERRCODE_NONE )
{
if( ch != ' ' && ch != '\t' && ch != '\n' )
{
......@@ -2588,18 +2588,18 @@ void SbiRuntime::StepSTDERROR()
{
pError = nullptr; bError = true;
pInst->aErrorMsg.clear();
pInst->nErr = 0;
pInst->nErr = ERRCODE_NONE;
pInst->nErl = 0;
nError = 0;
nError = ERRCODE_NONE;
SbxErrObject::getUnoErrObject()->Clear();
}
void SbiRuntime::StepNOERROR()
{
pInst->aErrorMsg.clear();
pInst->nErr = 0;
pInst->nErr = ERRCODE_NONE;
pInst->nErl = 0;
nError = 0;
nError = ERRCODE_NONE;
SbxErrObject::getUnoErrObject()->Clear();
bError = false;
}
......@@ -3081,9 +3081,9 @@ void SbiRuntime::StepERRHDL( sal_uInt32 nOp1 )
pError = pCode;
pCode = p;
pInst->aErrorMsg.clear();
pInst->nErr = 0;
pInst->nErr = ERRCODE_NONE;
pInst->nErl = 0;
nError = 0;
nError = ERRCODE_NONE;
SbxErrObject::getUnoErrObject()->Clear();
}
......@@ -3111,9 +3111,9 @@ void SbiRuntime::StepRESUME( sal_uInt32 nOp1 )
if( nOp1 > 1 )
StepJUMP( nOp1 );
pInst->aErrorMsg.clear();
pInst->nErr = 0;
pInst->nErr = ERRCODE_NONE;
pInst->nErl = 0;
nError = 0;
nError = ERRCODE_NONE;
bInError = false;
}
......
......@@ -317,7 +317,7 @@ void SvxHyperlinkNewDocTp::DoApply ()
{
SvStream* pIStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::READ );
bool bOk = pIStm && ( pIStm->GetError() == 0);
bool bOk = pIStm && ( pIStm->GetError() == ERRCODE_NONE);
delete pIStm;
......
......@@ -178,7 +178,7 @@ namespace svx
aFileDlg.SetDisplayDirectory( aTransformer.get( OFileNotation::N_URL ) );
}
if (0 != aFileDlg.Execute())
if (ERRCODE_NONE != aFileDlg.Execute())
return;
if (m_pName->GetText().isEmpty())
......
......@@ -796,7 +796,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ClickImportHdl, Button*, void)
bDifferent = false;
if( bDifferent ) {
nError = 0;
nError = ERRCODE_NONE;
break;
}
......
......@@ -133,7 +133,7 @@ sal_Int32 ReadThroughComponent(
}
// success!
return 0;
return ERRCODE_NONE;
}
......@@ -165,12 +165,12 @@ sal_Int32 ReadThroughComponent(
// do we even have an alternative name?
if ( nullptr == pCompatibilityStreamName )
return 0;
return ERRCODE_NONE;
// if so, does the stream exist?
sStreamName = OUString::createFromAscii(pCompatibilityStreamName);
if ( !xStorage->hasByName( sStreamName ) || !xStorage->isStreamElement( sStreamName ) )
return 0;
return ERRCODE_NONE;
}
// get input stream
......@@ -340,7 +340,7 @@ bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor )
,this
);
if ( nRet == 0 )
if ( nRet == ERRCODE_NONE )
nRet = ReadThroughComponent( xStorage
,xModel
,"content.xml"
......@@ -349,7 +349,7 @@ bool ODBFilter::implImport( const Sequence< PropertyValue >& rDescriptor )
,this
);
bRet = nRet == 0;
bRet = nRet == ERRCODE_NONE;
if ( bRet )
{
......
......@@ -706,7 +706,7 @@ namespace dbaui
_aFileOpen.SetDisplayDirectory(sOldPath);
else
_aFileOpen.SetDisplayDirectory( SvtPathOptions().GetWorkPath() );
if (0 == _aFileOpen.Execute())
if (ERRCODE_NONE == _aFileOpen.Execute())
{
setURLNoPrefix(_aFileOpen.GetPath());
SetRoadmapStateValue(checkTestConnection());
......
......@@ -119,7 +119,7 @@ SvxBulletItem::SvxBulletItem( SvStream& rStrm, sal_uInt16 _nWhich )
sal_uInt64 const nOldPos = rStrm.Tell();
// Ignore Errorcode when reading Bitmap,
// see comment in SvxBulletItem::Store()
bool bOldError = rStrm.GetError() != 0;
bool bOldError = rStrm.GetError() != ERRCODE_NONE;
ReadDIB(aBmp, rStrm, true);
if ( !bOldError && rStrm.GetError() )
......
......@@ -215,7 +215,7 @@ namespace dbp
aFileDlg.AddFilter(pFilter->GetUIName(),pFilter->GetDefaultExtension());
}
if (0 == aFileDlg.Execute())
if (ERRCODE_NONE == aFileDlg.Execute())
{
OUString sDataSourceName = aFileDlg.GetPath();
::svt::OFileNotation aFileNotation(sDataSourceName);
......
......@@ -2772,7 +2772,7 @@ namespace pcr
}
_rClearBeforeDialog.clear();
bool bSuccess = ( 0 == aFileDlg.Execute() );
bool bSuccess = ( ERRCODE_NONE == aFileDlg.Execute() );
if ( bSuccess )
{
if ( bHandleNonLink && xController.is() )
......@@ -2812,7 +2812,7 @@ namespace pcr
aFileDlg.SetDisplayDirectory( sURL );
_rClearBeforeDialog.clear();
bool bSuccess = ( 0 == aFileDlg.Execute() );
bool bSuccess = ( ERRCODE_NONE == aFileDlg.Execute() );
if ( bSuccess )
_out_rNewValue <<= aFileDlg.GetPath();
return bSuccess;
......@@ -2875,7 +2875,7 @@ namespace pcr
}
_rClearBeforeDialog.clear();
bool bSuccess = ( 0 == aFileDlg.Execute() );
bool bSuccess = ( ERRCODE_NONE == aFileDlg.Execute() );
if ( bSuccess )
_out_rNewValue <<= aFileDlg.GetPath();
return bSuccess;
......
......@@ -2343,7 +2343,7 @@ void OS2METReader::ReadFont(sal_uInt16 nFieldSize)
nPos=pOS2MET->Tell();
nMaxPos=nPos+(sal_uLong)nFieldSize;
pOS2MET->SeekRel(2); nPos+=2;
while (nPos<nMaxPos && pOS2MET->GetError()==0) {
while (nPos<nMaxPos && pOS2MET->GetError()==ERRCODE_NONE) {
pOS2MET->ReadUChar( nByte );
sal_uInt16 nLen = ((sal_uInt16)nByte) & 0x00ff;
if (nLen == 0)
......@@ -2431,7 +2431,7 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize)
nPos=pOS2MET->Tell();
nMaxPos=nPos+(sal_uLong)nFieldSize;
pOS2MET->SeekRel(3); nPos+=3;
while (nPos<nMaxPos && pOS2MET->GetError()==0) {
while (nPos<nMaxPos && pOS2MET->GetError()==ERRCODE_NONE) {
pOS2MET->ReadUChar( nbyte ); nElemLen=((sal_uInt16)nbyte) & 0x00ff;
if (nElemLen>11) {
pOS2MET->SeekRel(4);
......@@ -2486,7 +2486,7 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize)
case EndImgObjMagic: {
// read temporary Windows BMP file:
if (pBitmapList==nullptr || pBitmapList->pBMP==nullptr ||
pBitmapList->pBMP->GetError()!=0) {
pBitmapList->pBMP->GetError()!=ERRCODE_NONE) {
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
ErrorCode=5;
return;
......@@ -2495,7 +2495,7 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize)
ReadDIB(pBitmapList->aBitmap, *(pBitmapList->pBMP), false);
if (pBitmapList->pBMP->GetError()!=0) {
if (pBitmapList->pBMP->GetError()!=ERRCODE_NONE) {
pOS2MET->SetError(SVSTREAM_FILEFORMAT_ERROR);
ErrorCode=6;
}
......@@ -2518,7 +2518,7 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize)
nPos=pOS2MET->Tell();
nMaxPos=nPos+(sal_uLong)nFieldSize;
while (nPos<nMaxPos && pOS2MET->GetError()==0) {
while (nPos<nMaxPos && pOS2MET->GetError()==ERRCODE_NONE) {
pOS2MET->ReadUChar( nbyte ); nDataID=((sal_uInt16)nbyte)&0x00ff;
if (nDataID==0x00fe) {
pOS2MET->ReadUChar( nbyte );
......@@ -2570,7 +2570,7 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize)
else pOS2MET->SeekRel(-1); // no header, go back one byte
// loop through Order:
while (pOS2MET->Tell()<nMaxPos && pOS2MET->GetError()==0) {
while (pOS2MET->Tell()<nMaxPos && pOS2MET->GetError()==ERRCODE_NONE) {
pOS2MET->ReadUChar( nbyte ); nOrderID=((sal_uInt16)nbyte) & 0x00ff;
if (nOrderID==0x00fe) {
pOS2MET->ReadUChar( nbyte );
......@@ -2614,7 +2614,7 @@ void OS2METReader::ReadField(sal_uInt16 nFieldType, sal_uInt16 nFieldSize)
sal_uInt8 nbyte;
nMaxPos=pOS2MET->Tell()+(sal_uLong)nFieldSize;
while (pOS2MET->Tell()<nMaxPos && pOS2MET->GetError()==0) {
while (pOS2MET->Tell()<nMaxPos && pOS2MET->GetError()==ERRCODE_NONE) {
pOS2MET->ReadUChar( nbyte ); nDscID =((sal_uInt16)nbyte) & 0x00ff;
pOS2MET->ReadUChar( nbyte ); nDscLen=((sal_uInt16)nbyte) & 0x00ff;
nPos=pOS2MET->Tell();
......
......@@ -3809,7 +3809,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
if (nSkip <= aHd.nRecLen)
{
rSt.SeekRel(nSkip);
if (0 == rSt.GetError())
if (ERRCODE_NONE == rSt.GetError())
bGrfRead = GetBLIPDirect( rSt, aGraf, &aVisArea );
}
}
......@@ -4849,7 +4849,7 @@ tools::Rectangle SvxMSDffManager::GetGlobalChildAnchor( const DffRecordHeader& r
return aChildAnchor;
bool bIsClientRectRead = false;
while ( ( rSt.GetError() == 0 ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
while ( ( rSt.GetError() == ERRCODE_NONE ) && ( rSt.Tell() < rHd.GetRecEndFilePos() ) )
{
DffRecordHeader aShapeHd;
if (!ReadDffRecordHeader(rSt, aShapeHd))
......@@ -5851,7 +5851,7 @@ void SvxMSDffManager::GetCtrlData(sal_uInt32 nOffsDggL)
nPos += DFF_COMMON_RECORD_HEADER_SIZE + nLength;
++nDrawingContainerId;
}
while( ( rStCtrl.GetError() == 0 ) && ( nPos < nMaxStrPos ) && bOk );
while( ( rStCtrl.GetError() == ERRCODE_NONE ) && ( nPos < nMaxStrPos ) && bOk );
}
}
......@@ -5908,7 +5908,7 @@ void SvxMSDffManager::GetDrawingGroupContainerData( SvStream& rSt, sal_uLong nLe
rSt.ReadUInt32( nBLIPLen );
rSt.SeekRel( nSkipBLIPPos );
rSt.ReadUInt32( nBLIPPos );
bOk = rSt.GetError() == 0;
bOk = rSt.GetError() == ERRCODE_NONE;
nLength -= nSkipBLIPLen+ 4 + nSkipBLIPPos + 4;
}
......
......@@ -679,7 +679,7 @@ namespace frm
m_bDownloading = false;
return;
}
if (m_pMedium->GetErrorCode()==0)
if (m_pMedium->GetErrorCode()==ERRCODE_NONE)
{
SvStream* pStream = m_pMedium->GetInStream();
......
......@@ -244,7 +244,7 @@ namespace frm
OUString::createFromAscii( aExportFormat.pExtension ) );
}
ErrCode nResult = aFP.Execute();
if ( nResult == 0 )
if ( nResult == ERRCODE_NONE )
{
OUString sFileName = aFP.GetPath();
SvStream* pStream = ::utl::UcbStreamHelper::CreateStream(
......
......@@ -1273,7 +1273,7 @@ Image AddonsOptions_Impl::ReadImageFromURL(const OUString& aImageURL)
Image aImage;
SvStream* pStream = UcbStreamHelper::CreateStream( aImageURL, StreamMode::STD_READ );
if ( pStream && ( pStream->GetErrorCode() == 0 ))
if ( pStream && ( pStream->GetErrorCode() == ERRCODE_NONE ))
{
// Use graphic class to also support more graphic formats (bmp,png,...)
Graphic aGraphic;
......
......@@ -123,7 +123,7 @@ void ImageButtonToolbarController::executeControlCommand( const css::frame::Cont
bool ImageButtonToolbarController::ReadImageFromURL( bool bBigImage, const OUString& aImageURL, Image& aImage )
{
std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream( aImageURL, StreamMode::STD_READ ));
if ( pStream && ( pStream->GetErrorCode() == 0 ))
if ( pStream && ( pStream->GetErrorCode() == ERRCODE_NONE ))
{
// Use graphic class to also support more graphic formats (bmp,png,...)
Graphic aGraphic;
......
......@@ -397,7 +397,7 @@ public:
bool eof() const { return m_isEof; }
/// stream is broken
bool bad() const { return GetError() != 0; }
bool bad() const { return GetError() != ERRCODE_NONE; }
/** Get state
......
......@@ -324,7 +324,7 @@ sal_uInt32 ConvDicXMLExport::exportDoc( enum ::xmloff::token::XMLTokenEnum /*eCl
GetDocHandler()->endDocument();
bSuccess = true;
return 0;
return ERRCODE_NONE;
}
......
......@@ -374,7 +374,7 @@ bool ScAutoFormatDataField::Load( SvStream& rStream, const ScAfVersions& rVersio
aStacked.SetValue( aOrientation.IsStacked() );
aRotateAngle.SetValue( aOrientation.GetRotation( aRotateAngle.GetValue() ) );
return (rStream.GetError() == 0);
return (rStream.GetError() == ERRCODE_NONE);
}
bool ScAutoFormatDataField::Save( SvStream& rStream, sal_uInt16 fileVersion )
......@@ -426,7 +426,7 @@ bool ScAutoFormatDataField::Save( SvStream& rStream, sal_uInt16 fileVersion )
// --- from 680/dr25 on: store strings as UTF-8
aNumFormat.Save( rStream, RTL_TEXTENCODING_UTF8 );
return (rStream.GetError() == 0);
return (rStream.GetError() == ERRCODE_NONE);
}
ScAutoFormatData::ScAutoFormatData()
......@@ -753,7 +753,7 @@ bool ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersions )
{
sal_uInt16 nVer = 0;
rStream.ReadUInt16( nVer );
bool bRet = 0 == rStream.GetError();
bool bRet = ERRCODE_NONE == rStream.GetError();
if( bRet && (nVer == AUTOFORMAT_DATA_ID_X ||
(AUTOFORMAT_DATA_ID_504 <= nVer && nVer <= AUTOFORMAT_DATA_ID)) )
{
......@@ -790,7 +790,7 @@ bool ScAutoFormatData::Load( SvStream& rStream, const ScAfVersions& rVersions )
if (nVer >= AUTOFORMAT_DATA_ID_31005)
rStream >> m_swFields;
bRet = 0 == rStream.GetError();
bRet = ERRCODE_NONE == rStream.GetError();
for( sal_uInt16 i = 0; bRet && i < 16; ++i )
bRet = GetField( i ).Load( rStream, rVersions, nVer );
}
......@@ -817,7 +817,7 @@ bool ScAutoFormatData::Save(SvStream& rStream, sal_uInt16 fileVersion)
if (fileVersion >= SOFFICE_FILEFORMAT_50)
WriteAutoFormatSwBlob( rStream, m_swFields );
bool bRet = 0 == rStream.GetError();
bool bRet = ERRCODE_NONE == rStream.GetError();
for (sal_uInt16 i = 0; bRet && (i < 16); i++)
bRet = GetField( i ).Save( rStream, fileVersion );
......@@ -1007,14 +1007,14 @@ void ScAutoFormat::Load()
SfxMedium aMedium( aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), StreamMode::READ );
SvStream* pStream = aMedium.GetInStream();
bool bRet = (pStream && pStream->GetError() == 0);
bool bRet = (pStream && pStream->GetError() == ERRCODE_NONE);
if (bRet)
{
SvStream& rStream = *pStream;
// Attention: A common header has to be read
sal_uInt16 nVal = 0;
rStream.ReadUInt16( nVal );
bRet = 0 == rStream.GetError();
bRet = ERRCODE_NONE == rStream.GetError();
if (bRet)
{
......@@ -1042,7 +1042,7 @@ void ScAutoFormat::Load()
ScAutoFormatData* pData;
sal_uInt16 nAnz = 0;
rStream.ReadUInt16( nAnz );
bRet = (rStream.GetError() == 0);
bRet = (rStream.GetError() == ERRCODE_NONE);
for (sal_uInt16 i=0; bRet && (i < nAnz); i++)
{
pData = new ScAutoFormatData();
......@@ -1065,7 +1065,7 @@ bool ScAutoFormat::Save()
SfxMedium aMedium( aURL.GetMainURL(INetURLObject::DecodeMechanism::NONE), StreamMode::WRITE );
SvStream* pStream = aMedium.GetOutStream();
bool bRet = (pStream && pStream->GetError() == 0);
bool bRet = (pStream && pStream->GetError() == ERRCODE_NONE);
if (bRet)
{
const sal_uInt16 fileVersion = SOFFICE_FILEFORMAT_50;
......@@ -1080,10 +1080,10 @@ bool ScAutoFormat::Save()
osl_getThreadTextEncoding() ) );
m_aVersions.Write(rStream, fileVersion);
bRet &= (rStream.GetError() == 0);
bRet &= (rStream.GetError() == ERRCODE_NONE);
rStream.WriteUInt16( m_Data.size() - 1 );
bRet &= (rStream.GetError() == 0);
bRet &= (rStream.GetError() == ERRCODE_NONE);
MapType::iterator it = m_Data.begin(), itEnd = m_Data.end();
if (it != itEnd)
{
......
......@@ -1305,7 +1305,7 @@ void ScHTMLExport::CopyLocalFileToINet( OUString& rFileNm,
aMedium.Close();
aMedium.Commit();
bRet = 0 == aMedium.GetError();
bRet = ERRCODE_NONE == aMedium.GetError();
if( bRet )
{
......
......@@ -411,7 +411,7 @@ Sc10FontCollection::Sc10FontCollection(SvStream& rStream)
{
sal_uInt16 nAnz(0);
rStream.ReadUInt16( nAnz );
for (sal_uInt16 i=0; (i < nAnz) && (nError == 0); i++)
for (sal_uInt16 i=0; (i < nAnz) && (nError == ERRCODE_NONE); i++)
{
nError = insert_new<Sc10FontData>( this, rStream);
}
......@@ -452,7 +452,7 @@ Sc10NameCollection::Sc10NameCollection(SvStream& rStream) :
{
sal_uInt16 nAnz;
rStream.ReadUInt16( nAnz );
for (sal_uInt16 i=0; (i < nAnz) && (nError == 0); i++)
for (sal_uInt16 i=0; (i < nAnz) && (nError == ERRCODE_NONE); i++)
{
nError = insert_new<Sc10NameData>( this, rStream);
}
......@@ -502,7 +502,7 @@ Sc10PatternCollection::Sc10PatternCollection(SvStream& rStream)
{
sal_uInt16 nAnz;
rStream.ReadUInt16( nAnz );
for (sal_uInt16 i=0; (i < nAnz) && (nError == 0); i++)
for (sal_uInt16 i=0; (i < nAnz) && (nError == ERRCODE_NONE); i++)
{
nError = insert_new<Sc10PatternData>( this, rStream);
}
......@@ -562,7 +562,7 @@ Sc10DataBaseCollection::Sc10DataBaseCollection(SvStream& rStream)
lcl_ReadFixedString( rStream, ActName, sizeof(ActName));
sal_uInt16 nAnz;
rStream.ReadUInt16( nAnz );
for (sal_uInt16 i=0; (i < nAnz) && (nError == 0); i++)
for (sal_uInt16 i=0; (i < nAnz) && (nError == ERRCODE_NONE); i++)
{
nError = insert_new<Sc10DataBaseData>( this, rStream);
}
......@@ -992,7 +992,7 @@ void Sc10Import::LoadFileHeader()
lcl_ReadFileHeader(rStream, FileHeader);
nError = rStream.GetError();
if ( nError == 0 )
if ( nError == ERRCODE_NONE )
{
sal_Char Sc10CopyRight[32];
strcpy(Sc10CopyRight, "Blaise-Tabelle");
......@@ -1385,7 +1385,7 @@ void Sc10Import::LoadTables()
sal_Int16 nTabCount;
rStream.ReadInt16( nTabCount );
for (sal_Int16 Tab = 0; (Tab < nTabCount) && (nError == 0); Tab++)
for (sal_Int16 Tab = 0; (Tab < nTabCount) && (nError == ERRCODE_NONE); Tab++)
{
Sc10PageFormat PageFormat;
sal_Int16 DataBaseIndex;
......@@ -1460,7 +1460,7 @@ void Sc10Import::LoadTables()
rStream.ReadUChar( Visible );
nError = rStream.GetError();
if (nError != 0) return;
if (nError != ERRCODE_NONE) return;
if (TabNo == 0)
pDoc->RenameTab(static_cast<SCTAB> (TabNo), SC10TOSTRING( TabName ));
......@@ -1582,14 +1582,14 @@ void Sc10Import::LoadTables()
nError = errUnknownID;
return;
}
for (SCCOL Col = 0; (Col <= SC10MAXCOL) && (nError == 0); Col++)
for (SCCOL Col = 0; (Col <= SC10MAXCOL) && (nError == ERRCODE_NONE); Col++)
{
rStream.ReadUInt16( Count );
nError = rStream.GetError();
if ((Count != 0) && (nError == 0))
if ((Count != 0) && (nError == ERRCODE_NONE))
LoadCol(Col, static_cast<SCTAB> (TabNo));
}
OSL_ENSURE( nError == 0, "Stream" );
OSL_ENSURE( nError == ERRCODE_NONE, "Stream" );
}
pPrgrsBar->Progress();
......@@ -1606,12 +1606,12 @@ void Sc10Import::LoadCol(SCCOL Col, SCTAB Tab)
rStream.ReadUInt16( CellCount );
SCROW nScCount = static_cast< SCROW >( CellCount );
if (nScCount > MAXROW) nError = errUnknownFormat;
for (sal_uInt16 i = 0; (i < CellCount) && (nError == 0); i++)
for (sal_uInt16 i = 0; (i < CellCount) && (nError == ERRCODE_NONE); i++)
{
rStream.ReadUChar( CellType );
rStream.ReadUInt16( Row );
nError = rStream.GetError();
if (nError == 0)
if (nError == ERRCODE_NONE)