summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-14 13:34:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-14 15:42:31 +0200
commita6aa57ff591fdf3d834a7e0b1e9e2ebad1d87c5c (patch)
tree3de1d4767963fd78bcf6f8a90a4e2467e3a2acc5 /sc
parent546c35519125a769755330c961c7b8fc61e24d89 (diff)
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/38777 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/autoform.cxx22
-rw-r--r--sc/source/filter/html/htmlexp.cxx2
-rw-r--r--sc/source/filter/starcalc/scflt.cxx48
-rw-r--r--sc/source/ui/docshell/tablink.cxx2
4 files changed, 37 insertions, 37 deletions
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index 3940631fd176..889af745e706 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -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)
{
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 4f1b1038acfe..ed957bbf2db0 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -1305,7 +1305,7 @@ void ScHTMLExport::CopyLocalFileToINet( OUString& rFileNm,
aMedium.Close();
aMedium.Commit();
- bRet = 0 == aMedium.GetError();
+ bRet = ERRCODE_NONE == aMedium.GetError();
if( bRet )
{
diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx
index 7993aa325e77..e2ba310fc3e1 100644
--- a/sc/source/filter/starcalc/scflt.cxx
+++ b/sc/source/filter/starcalc/scflt.cxx
@@ -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)
{
switch (CellType)
{
@@ -1696,16 +1696,16 @@ void Sc10Import::LoadColAttr(SCCOL Col, SCTAB Tab)
Sc10ColAttr aFlag;
Sc10ColAttr aPattern;
- if (nError == 0) LoadAttr(aFont);
- if (nError == 0) LoadAttr(aAttr);
- if (nError == 0) LoadAttr(aJustify);
- if (nError == 0) LoadAttr(aFrame);
- if (nError == 0) LoadAttr(aRaster);
- if (nError == 0) LoadAttr(aValue);
- if (nError == 0) LoadAttr(aColor);
- if (nError == 0) LoadAttr(aFrameColor);
- if (nError == 0) LoadAttr(aFlag);
- if (nError == 0) LoadAttr(aPattern);
+ if (nError == ERRCODE_NONE) LoadAttr(aFont);
+ if (nError == ERRCODE_NONE) LoadAttr(aAttr);
+ if (nError == ERRCODE_NONE) LoadAttr(aJustify);
+ if (nError == ERRCODE_NONE) LoadAttr(aFrame);
+ if (nError == ERRCODE_NONE) LoadAttr(aRaster);
+ if (nError == ERRCODE_NONE) LoadAttr(aValue);
+ if (nError == ERRCODE_NONE) LoadAttr(aColor);
+ if (nError == ERRCODE_NONE) LoadAttr(aFrameColor);
+ if (nError == ERRCODE_NONE) LoadAttr(aFlag);
+ if (nError == ERRCODE_NONE) LoadAttr(aPattern);
if (nError)
return;
@@ -2309,12 +2309,12 @@ void Sc10Import::LoadObjects()
sal_Char Reserved[32];
rStream.ReadBytes(Reserved, sizeof(Reserved));
nError = rStream.GetError();
- if ((nAnz > 0) && (nError == 0))
+ if ((nAnz > 0) && (nError == ERRCODE_NONE))
{
sal_uInt8 ObjectType;
Sc10GraphHeader GraphHeader;
bool IsOleObject = false; // TODO: this is only a band-aid
- for (sal_uInt16 i = 0; (i < nAnz) && (nError == 0) && !rStream.IsEof() && !IsOleObject; i++)
+ for (sal_uInt16 i = 0; (i < nAnz) && (nError == ERRCODE_NONE) && !rStream.IsEof() && !IsOleObject; i++)
{
rStream.ReadUChar( ObjectType );
lcl_ReadGraphHeader(rStream, GraphHeader);
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx
index b3b00683960e..d6f850b12541 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -266,7 +266,7 @@ bool ScTableLink::Refresh(const OUString& rNewFile, const OUString& rNewFilter,
/* #i71497# check if external document is loaded successfully,
otherwise we may find the empty default sheet "Sheet1" in
rSrcDoc, even if the document does not exist. */
- if( pMed->GetError() == 0 )
+ if( pMed->GetError() == ERRCODE_NONE )
{
// no sheet name -> use first sheet
if ( !aTabName.isEmpty() && !bAutoTab )