diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-14 13:34:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-14 15:42:31 +0200 |
commit | a6aa57ff591fdf3d834a7e0b1e9e2ebad1d87c5c (patch) | |
tree | 3de1d4767963fd78bcf6f8a90a4e2467e3a2acc5 /sw | |
parent | 546c35519125a769755330c961c7b8fc61e24d89 (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 'sw')
-rw-r--r-- | sw/source/core/doc/docbasic.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/doc/tblafmt.cxx | 24 | ||||
-rw-r--r-- | sw/source/core/swg/SwXMLBlockExport.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ascii/parasc.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ascii/wrtasc.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/writer/writer.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8graf2.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par3.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 10 | ||||
-rw-r--r-- | sw/source/uibase/config/uinums.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/dbui/dbmgr.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uiview/srcview.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uno/unoatxt.cxx | 2 |
14 files changed, 35 insertions, 35 deletions
diff --git a/sw/source/core/doc/docbasic.cxx b/sw/source/core/doc/docbasic.cxx index 8b4ee3a007fd..8b197546f10d 100644 --- a/sw/source/core/doc/docbasic.cxx +++ b/sw/source/core/doc/docbasic.cxx @@ -74,7 +74,7 @@ static Sequence<Any> *lcl_docbasic_convertArgs( SbxArray& rArgs ) bool SwDoc::ExecMacro( const SvxMacro& rMacro, OUString* pRet, SbxArray* pArgs ) { - ErrCode eErr = 0; + ErrCode eErr = ERRCODE_NONE; switch( rMacro.GetScriptType() ) { case STARBASIC: @@ -126,7 +126,7 @@ bool SwDoc::ExecMacro( const SvxMacro& rMacro, OUString* pRet, SbxArray* pArgs ) } } - return 0 == eErr; + return ERRCODE_NONE == eErr; } sal_uInt16 SwDoc::CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEvent, @@ -210,7 +210,7 @@ sal_uInt16 SwDoc::CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEve const SvxMacro& rMacro = *pTable->Get( nEvent ); if( STARBASIC == rMacro.GetScriptType() ) { - nRet += 0 == mpDocShell->CallBasic( rMacro.GetMacName(), + nRet += ERRCODE_NONE == mpDocShell->CallBasic( rMacro.GetMacName(), rMacro.GetLibName(), nullptr ) ? 1 : 0; } else if( EXTENDED_STYPE == rMacro.GetScriptType() ) @@ -223,7 +223,7 @@ sal_uInt16 SwDoc::CallEvent( sal_uInt16 nEvent, const SwCallMouseEvent& rCallEve SAL_INFO("sw", "SwDoc::CallEvent URL is " << rMacro.GetMacName() ); - nRet += 0 == mpDocShell->CallXScript( + nRet += ERRCODE_NONE == mpDocShell->CallXScript( rMacro.GetMacName(), *pUnoArgs,aRet, aOutArgsIndex, aOutArgs) ? 1 : 0; } // JavaScript calls are ignored diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx index 3787418e9e78..215b29c730e9 100644 --- a/sw/source/core/doc/tblafmt.cxx +++ b/sw/source/core/doc/tblafmt.cxx @@ -496,7 +496,7 @@ bool SwBoxAutoFormat::Load( SvStream& rStream, const SwAfVersions& rVersions, sa m_aStacked.SetValue( aOrientation.IsStacked() ); m_aRotateAngle.SetValue( aOrientation.GetRotation( m_aRotateAngle.GetValue() ) ); - return 0 == rStream.GetError(); + return ERRCODE_NONE == rStream.GetError(); } bool SwBoxAutoFormat::Save( SvStream& rStream, sal_uInt16 fileVersion ) const @@ -549,7 +549,7 @@ bool SwBoxAutoFormat::Save( SvStream& rStream, sal_uInt16 fileVersion ) const RTL_TEXTENCODING_UTF8); rStream.WriteUInt16( (sal_uInt16)m_eSysLanguage ).WriteUInt16( (sal_uInt16)m_eNumFormatLanguage ); - return 0 == rStream.GetError(); + return ERRCODE_NONE == rStream.GetError(); } bool SwBoxAutoFormat::SaveVersionNo( SvStream& rStream, sal_uInt16 fileVersion ) const @@ -588,7 +588,7 @@ bool SwBoxAutoFormat::SaveVersionNo( SvStream& rStream, sal_uInt16 fileVersion ) rStream.WriteUInt16( 0 ); // NumberFormat - return 0 == rStream.GetError(); + return ERRCODE_NONE == rStream.GetError(); } SwTableAutoFormat::SwTableAutoFormat( const OUString& rName ) @@ -966,7 +966,7 @@ bool SwTableAutoFormat::Load( SvStream& rStream, const SwAfVersions& rVersions ) { sal_uInt16 nVal = 0; rStream.ReadUInt16( nVal ); - bool bRet = 0 == rStream.GetError(); + bool bRet = ERRCODE_NONE == rStream.GetError(); if( bRet && (nVal == AUTOFORMAT_DATA_ID_X || (AUTOFORMAT_DATA_ID_504 <= nVal && nVal <= AUTOFORMAT_DATA_ID)) ) @@ -1008,7 +1008,7 @@ bool SwTableAutoFormat::Load( SvStream& rStream, const SwAfVersions& rVersions ) READ(m_aShadow, SvxShadowItem, AUTOFORMAT_FILE_VERSION); } - bRet = 0 == rStream.GetError(); + bRet = ERRCODE_NONE== rStream.GetError(); for( sal_uInt8 i = 0; bRet && i < 16; ++i ) { @@ -1052,7 +1052,7 @@ bool SwTableAutoFormat::Save( SvStream& rStream, sal_uInt16 fileVersion ) const m_aShadow.Store(rStream, m_aShadow.GetVersion(fileVersion)); } - bool bRet = 0 == rStream.GetError(); + bool bRet = ERRCODE_NONE == rStream.GetError(); for( int i = 0; bRet && i < 16; ++i ) { @@ -1314,13 +1314,13 @@ bool SwTableAutoFormatTable::Save() const bool SwTableAutoFormatTable::Load( SvStream& rStream ) { - bool bRet = 0 == rStream.GetError(); + bool bRet = ERRCODE_NONE == rStream.GetError(); if (bRet) { // Attention: We need to read a general Header here sal_uInt16 nVal = 0; rStream.ReadUInt16( nVal ); - bRet = 0 == rStream.GetError(); + bRet = ERRCODE_NONE == rStream.GetError(); if( bRet ) { @@ -1354,7 +1354,7 @@ bool SwTableAutoFormatTable::Load( SvStream& rStream ) sal_uInt16 nCount = 0; rStream.ReadUInt16( nCount ); - bRet = 0 == rStream.GetError(); + bRet = ERRCODE_NONE== rStream.GetError(); if (bRet) { const size_t nMinRecordSize = sizeof(sal_uInt16); @@ -1392,7 +1392,7 @@ bool SwTableAutoFormatTable::Load( SvStream& rStream ) bool SwTableAutoFormatTable::Save( SvStream& rStream ) const { - bool bRet = 0 == rStream.GetError(); + bool bRet = ERRCODE_NONE == rStream.GetError(); if (bRet) { rStream.SetVersion(AUTOFORMAT_FILE_VERSION); @@ -1403,7 +1403,7 @@ bool SwTableAutoFormatTable::Save( SvStream& rStream ) const .WriteUChar( 2 ) // Character count of the Header including this value .WriteUChar( GetStoreCharSet( ::osl_getThreadTextEncoding() ) ); - bRet = 0 == rStream.GetError(); + bRet = ERRCODE_NONE == rStream.GetError(); if (!bRet) return false; @@ -1412,7 +1412,7 @@ bool SwTableAutoFormatTable::Save( SvStream& rStream ) const rStream, AUTOFORMAT_FILE_VERSION); rStream.WriteUInt16( m_pImpl->m_AutoFormats.size() - 1 ); - bRet = 0 == rStream.GetError(); + bRet = ERRCODE_NONE == rStream.GetError(); for (auto const & rFormat: m_pImpl->m_AutoFormats) { diff --git a/sw/source/core/swg/SwXMLBlockExport.cxx b/sw/source/core/swg/SwXMLBlockExport.cxx index 1cb361d2ed6d..6e62df74ff55 100644 --- a/sw/source/core/swg/SwXMLBlockExport.cxx +++ b/sw/source/core/swg/SwXMLBlockExport.cxx @@ -73,7 +73,7 @@ sal_uInt32 SwXMLBlockListExport::exportDoc(enum XMLTokenEnum ) } } GetDocHandler()->endDocument(); - return 0; + return ERRCODE_NONE; } SwXMLTextBlockExport::SwXMLTextBlockExport( diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx index a82ca4344848..0fbf8800c1b7 100644 --- a/sw/source/filter/ascii/parasc.cxx +++ b/sw/source/filter/ascii/parasc.cxx @@ -491,7 +491,7 @@ sal_uLong SwASCIIParser::ReadChars() rtl_destroyTextToUnicodeContext( hConverter, hContext ); rtl_destroyTextToUnicodeConverter( hConverter ); } - return 0; + return ERRCODE_NONE; } void SwASCIIParser::InsertText( const OUString& rStr ) diff --git a/sw/source/filter/ascii/wrtasc.cxx b/sw/source/filter/ascii/wrtasc.cxx index 3399572a9184..00ed3e928fbd 100644 --- a/sw/source/filter/ascii/wrtasc.cxx +++ b/sw/source/filter/ascii/wrtasc.cxx @@ -189,7 +189,7 @@ sal_uLong SwASCWriter::WriteStream() if( bShowProgress ) ::EndProgress( pDoc->GetDocShell() ); - return 0; + return ERRCODE_NONE; } void GetASCWriter( const OUString& rFltNm, const OUString& /*rBaseURL*/, WriterRef& xRet ) diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 040fdd5b86e4..4ba96bb823dd 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -321,7 +321,7 @@ sal_uLong SwHTMLWriter::WriteStream() m_nFootNote = m_nEndNote = 0; - m_nWarn = 0; + m_nWarn = ERRCODE_NONE; GetNumInfo().Clear(); m_pNextNumRuleInfo = nullptr; diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index ea80865358bd..c46132263491 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -340,7 +340,7 @@ bool Writer::CopyLocalFileToINet( OUString& rFileNm ) aSrcFile.Close(); aDstFile.Commit(); - bRet = 0 == aDstFile.GetError(); + bRet = ERRCODE_NONE == aDstFile.GetError(); if( bRet ) { diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index 4b42da49d882..5aa5d6fe0085 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -241,7 +241,7 @@ extern void WW8PicShadowToReal( WW8_PIC_SHADOW* pPicS, WW8_PIC* pPic ); bool SwWW8ImplReader::GetPictGrafFromStream(Graphic& rGraphic, SvStream& rSrc) { - return 0 == GraphicFilter::GetGraphicFilter().ImportGraphic(rGraphic, OUString(), rSrc); + return ERRCODE_NONE == GraphicFilter::GetGraphicFilter().ImportGraphic(rGraphic, OUString(), rSrc); } bool SwWW8ImplReader::ReadGrafFile(OUString& rFileName, Graphic*& rpGraphic, diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index c94db550f043..48809b436ced 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -523,7 +523,7 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet rSt.ReadInt32( aLVL.nStartAt ); rSt.ReadUChar( aLVL.nNFC ); rSt.ReadUChar( aBits1 ); - if( 0 != rSt.GetError() ) return false; + if( ERRCODE_NONE != rSt.GetError() ) return false; aLVL.nAlign = (aBits1 & 0x03); if( aBits1 & 0x10 ) aLVL.bV6Prev = sal_uInt8(true); if( aBits1 & 0x20 ) aLVL.bV6PrSp = sal_uInt8(true); @@ -532,7 +532,7 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet for(sal_uInt8 nLevelB = 0; nLevelB < nMaxLevel; ++nLevelB) { rSt.ReadUChar( aLVL.aOfsNumsXCH[ nLevelB ] ); - if( 0 != rSt.GetError() ) + if( ERRCODE_NONE != rSt.GetError() ) { bLVLOkB = false; break; @@ -549,7 +549,7 @@ bool WW8ListManager::ReadLVL(SwNumFormat& rNumFormat, std::unique_ptr<SfxItemSet rSt.ReadUChar( aLVL.nLenGrpprlChpx ); rSt.ReadUChar( aLVL.nLenGrpprlPapx ); rSt.SeekRel( 2 ); - if( 0 != rSt.GetError()) return false; + if( ERRCODE_NONE != rSt.GetError()) return false; // 2. read PAPx if needed and search for indent values diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index c3154ffb064e..64f7aceb3e5a 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -5485,7 +5485,7 @@ WW8Fib::WW8Fib(SvStream& rSt, sal_uInt8 nWantedVersion, sal_uInt32 nOffset) rSt.ReadUInt16( m_wIdent ); rSt.ReadUInt16( m_nFib ); rSt.ReadUInt16( m_nProduct ); - if( 0 != rSt.GetError() ) + if( ERRCODE_NONE != rSt.GetError() ) { sal_Int16 nFibMin; sal_Int16 nFibMax; @@ -5782,7 +5782,7 @@ WW8Fib::WW8Fib(SvStream& rSt, sal_uInt8 nWantedVersion, sal_uInt32 nOffset) rSt.ReadUInt32( m_lcbSttbttmbd ); } - if( 0 == rSt.GetError() ) + if( ERRCODE_NONE == rSt.GetError() ) { // set bit flag m_fDot = aBits1 & 0x01 ; @@ -5837,7 +5837,7 @@ WW8Fib::WW8Fib(SvStream& rSt, sal_uInt8 nWantedVersion, sal_uInt32 nOffset) rSt.ReadInt32( m_lcbPlcftxbxBkd ); rSt.ReadInt32( m_fcPlcfHdrtxbxBkd ); rSt.ReadInt32( m_lcbPlcfHdrtxbxBkd ); - if( 0 != rSt.GetError() ) + if( ERRCODE_NONE != rSt.GetError() ) { m_nFibError = ERR_SWG_READ_ERROR; } @@ -5876,7 +5876,7 @@ WW8Fib::WW8Fib(SvStream& rSt, sal_uInt8 nWantedVersion, sal_uInt32 nOffset) rSt.ReadUInt32(m_lcbFactoidData); } - if( 0 != rSt.GetError() ) + if( ERRCODE_NONE != rSt.GetError() ) m_nFibError = ERR_SWG_READ_ERROR; rSt.Seek( 0x5bc ); // Actual nFib introduced in Word 2003 @@ -6628,7 +6628,7 @@ WW8_STD* WW8Style::Read1STDFixed(sal_uInt16& rSkip) while( false ); // trick: the block above will passed through exactly one time // and can be left early with a "break" - if( (0 != rSt.GetError()) || !nRead ) + if( (ERRCODE_NONE != rSt.GetError()) || !nRead ) DELETEZ( pStd ); // report error with NULL rSkip = cbStd - cbSTDBaseInFile; diff --git a/sw/source/uibase/config/uinums.cxx b/sw/source/uibase/config/uinums.cxx index 5b126a19e692..3b78f4d064ae 100644 --- a/sw/source/uibase/config/uinums.cxx +++ b/sw/source/uibase/config/uinums.cxx @@ -61,7 +61,7 @@ void SwChapterNumRules::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) { sw::ExportStoredChapterNumberingRules(*this, *pStream,CHAPTER_FILENAME); diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index cc45bd357a20..393a1df9bdc5 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -875,7 +875,7 @@ static void lcl_SaveDebugDoc( SfxObjectShell *xTargetDocShell, StreamMode::STD_READWRITE ); bool bAnyError = !xTargetDocShell->DoSaveAs( *pDstMed ); // xObjectShell->DoSaveCompleted crashes the mail merge unit tests, so skip it - bAnyError |= (0 != xTargetDocShell->GetError()); + bAnyError |= (ERRCODE_NONE != xTargetDocShell->GetError()); if( bAnyError ) SAL_WARN( "sw.mailmerge", "Error saving: " << aTempFile.GetURL() ); else @@ -918,7 +918,7 @@ static bool lcl_SaveDoc( // Actually this should be a bool... so in case of email and individual // files, where this is set, we skip the recently used handling bAnyError |= !xObjectShell->DoSaveCompleted( pDstMed, !decodedURL ); - bAnyError |= (0 != xObjectShell->GetError()); + bAnyError |= (ERRCODE_NONE != xObjectShell->GetError()); if( bAnyError ) { // error message ?? diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index a6223728856b..afbf0cf24e29 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/uibase/uiview/srcview.cxx @@ -780,7 +780,7 @@ void SwSrcView::Load(SwDocShell* pDocShell) if(bHtml && !bDocModified && pDocShell->HasName()) { SvStream* pStream = pMedium->GetInStream(); - if(pStream && 0 == pStream->GetError() ) + if(pStream && ERRCODE_NONE == pStream->GetError() ) { rtl_TextEncoding eHeaderEnc = SfxHTMLParser::GetEncodingByHttpHeader( diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx index 1bdd9098431e..ae63084d28ff 100644 --- a/sw/source/uibase/uno/unoatxt.cxx +++ b/sw/source/uibase/uno/unoatxt.cxx @@ -286,7 +286,7 @@ void SwXAutoTextGroup::renameByName(const OUString& aElementName, (nOldIdx == USHRT_MAX || nOldIdx == nIdx )) { pGlosGroup->Rename( nIdx, &aNewShort, &aNewName ); - if(pGlosGroup->GetError() != 0) + if(pGlosGroup->GetError() != ERRCODE_NONE) throw io::IOException(); } } |