diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-09 08:52:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-21 08:42:30 +0200 |
commit | 528632660b72b105345945c13c5b68060d94a91b (patch) | |
tree | 860508d482959abeb9175f0ce6b9e65954269f95 /sw/source/filter | |
parent | aee66aa85e75f67135e5c6079a281e18402d261a (diff) |
convert ErrCode to strong typedef
would have preferred to re-use o3tl::strong_int, of which this
is a modified copy, but there are lots of convenience accessors
which are nice to define on the class.
Change-Id: I301b807aaf02fbced3bf75de1e1692cde6c0340a
Reviewed-on: https://gerrit.libreoffice.org/38497
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/filter')
29 files changed, 123 insertions, 123 deletions
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx index e03ae3921ae0..ab5512b7976d 100644 --- a/sw/source/filter/ascii/parasc.cxx +++ b/sw/source/filter/ascii/parasc.cxx @@ -60,7 +60,7 @@ class SwASCIIParser SvtScriptType nScript; bool bNewDoc; - sal_uLong ReadChars(); + ErrCode ReadChars(); void InsertText( const OUString& rStr ); SwASCIIParser(const SwASCIIParser&) = delete; @@ -71,11 +71,11 @@ public: bool bReadNewDoc, const SwAsciiOptions& rOpts ); ~SwASCIIParser(); - sal_uLong CallParser(); + ErrCode CallParser(); }; // Call for the general reader interface -sal_uLong AsciiReader::Read( SwDoc &rDoc, const OUString&, SwPaM &rPam, const OUString & ) +ErrCode AsciiReader::Read( SwDoc &rDoc, const OUString&, SwPaM &rPam, const OUString & ) { if( !pStrm ) { @@ -85,7 +85,7 @@ sal_uLong AsciiReader::Read( SwDoc &rDoc, const OUString&, SwPaM &rPam, const OU SwASCIIParser* pParser = new SwASCIIParser( &rDoc, rPam, *pStrm, !bInsertMode, aOpt.GetASCIIOpts() ); - sal_uLong nRet = pParser->CallParser(); + ErrCode nRet = pParser->CallParser(); delete pParser; // after Read reset the options @@ -138,7 +138,7 @@ SwASCIIParser::~SwASCIIParser() } // Calling the parser -sal_uLong SwASCIIParser::CallParser() +ErrCode SwASCIIParser::CallParser() { rInput.Seek(STREAM_SEEK_TO_END); rInput.ResetError(); @@ -169,7 +169,7 @@ sal_uLong SwASCIIParser::CallParser() pDoc->SetTextFormatColl(*pPam, pColl); } - sal_uLong nError = ReadChars(); + ErrCode nError = ReadChars(); if( pItemSet ) { @@ -249,7 +249,7 @@ sal_uLong SwASCIIParser::CallParser() return nError; } -sal_uLong SwASCIIParser::ReadChars() +ErrCode SwASCIIParser::ReadChars() { sal_Unicode *pStt = nullptr, *pEnd = nullptr, *pLastStt = nullptr; long nReadCnt = 0, nLineLen = 0; @@ -291,7 +291,7 @@ sal_uLong SwASCIIParser::ReadChars() hConverter = rtl_createTextToUnicodeConverter( currentCharSet ); OSL_ENSURE( hConverter, "no string convert available" ); if (!hConverter) - return ERROR_SW_READ_BASE; + return ErrCode(ERROR_SW_READ_BASE); bSwapUnicode = false; hContext = rtl_createTextToUnicodeContext( hConverter ); } diff --git a/sw/source/filter/ascii/wrtasc.cxx b/sw/source/filter/ascii/wrtasc.cxx index 00ed3e928fbd..7a23d1970fba 100644 --- a/sw/source/filter/ascii/wrtasc.cxx +++ b/sw/source/filter/ascii/wrtasc.cxx @@ -83,7 +83,7 @@ SwASCWriter::SwASCWriter( const OUString& rFltNm ) SwASCWriter::~SwASCWriter() {} -sal_uLong SwASCWriter::WriteStream() +ErrCode SwASCWriter::WriteStream() { if( bASCII_ParaAsCR ) // If predefined m_sLineEnd = "\015"; diff --git a/sw/source/filter/ascii/wrtasc.hxx b/sw/source/filter/ascii/wrtasc.hxx index 82d2b108f498..cb0fdc191bb2 100644 --- a/sw/source/filter/ascii/wrtasc.hxx +++ b/sw/source/filter/ascii/wrtasc.hxx @@ -30,7 +30,7 @@ class SwASCWriter : public Writer { OUString m_sLineEnd; - virtual sal_uLong WriteStream() override; + virtual ErrCode WriteStream() override; public: SwASCWriter( const OUString& rFilterName ); diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx index a1459c780fa3..f112ee9a77cb 100644 --- a/sw/source/filter/basflt/fltini.cxx +++ b/sw/source/filter/basflt/fltini.cxx @@ -647,8 +647,8 @@ extern "C" { Reader *ImportDOC(); void ExportDOC( const OUString&, const OUString& rBaseURL, WriterRef& ); Reader *ImportDOCX(); - sal_uLong SaveOrDelMSVBAStorage_ww8( SfxObjectShell&, SotStorage&, sal_Bool, const OUString& ); - sal_uLong GetSaveWarningOfMSVBAStorage_ww8( SfxObjectShell& ); + sal_uInt32 SaveOrDelMSVBAStorage_ww8( SfxObjectShell&, SotStorage&, sal_Bool, const OUString& ); + sal_uInt32 GetSaveWarningOfMSVBAStorage_ww8( SfxObjectShell& ); } #endif @@ -725,27 +725,27 @@ Reader* GetDOCXReader() #endif } -typedef sal_uLong ( SAL_CALL *SaveOrDel )( SfxObjectShell&, SotStorage&, sal_Bool, const OUString& ); -typedef sal_uLong ( SAL_CALL *GetSaveWarning )( SfxObjectShell& ); +typedef sal_uInt32 ( SAL_CALL *SaveOrDel )( SfxObjectShell&, SotStorage&, sal_Bool, const OUString& ); +typedef sal_uInt32 ( SAL_CALL *GetSaveWarning )( SfxObjectShell& ); -sal_uLong SaveOrDelMSVBAStorage( SfxObjectShell& rDoc, SotStorage& rStor, bool bSaveInto, const OUString& rStorageName ) +ErrCode SaveOrDelMSVBAStorage( SfxObjectShell& rDoc, SotStorage& rStor, bool bSaveInto, const OUString& rStorageName ) { #ifndef DISABLE_DYNLOADING SaveOrDel pFunction = reinterpret_cast<SaveOrDel>( SwGlobals::getFilters().GetMswordLibSymbol( "SaveOrDelMSVBAStorage_ww8" ) ); if( pFunction ) - return pFunction( rDoc, rStor, bSaveInto, rStorageName ); + return ErrCode(pFunction( rDoc, rStor, bSaveInto, rStorageName )); return ERRCODE_NONE; #else return SaveOrDelMSVBAStorage_ww8( rDoc, rStor, bSaveInto, rStorageName ); #endif } -sal_uLong GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocS ) +ErrCode GetSaveWarningOfMSVBAStorage( SfxObjectShell &rDocS ) { #ifndef DISABLE_DYNLOADING GetSaveWarning pFunction = reinterpret_cast<GetSaveWarning>( SwGlobals::getFilters().GetMswordLibSymbol( "GetSaveWarningOfMSVBAStorage_ww8" ) ); if( pFunction ) - return pFunction( rDocS ); + return ErrCode(pFunction( rDocS )); return ERRCODE_NONE; #else return GetSaveWarningOfMSVBAStorage_ww8( rDocS ); diff --git a/sw/source/filter/basflt/shellio.cxx b/sw/source/filter/basflt/shellio.cxx index 615c0d938780..3e2a3ec4393c 100644 --- a/sw/source/filter/basflt/shellio.cxx +++ b/sw/source/filter/basflt/shellio.cxx @@ -62,7 +62,7 @@ using namespace ::com::sun::star; -sal_uLong SwReader::Read( const Reader& rOptions ) +ErrCode SwReader::Read( const Reader& rOptions ) { // copy variables Reader* po = const_cast<Reader*>(&rOptions); @@ -83,7 +83,7 @@ sal_uLong SwReader::Read( const Reader& rOptions ) return ERR_SWG_FILE_FORMAT_ERROR; } - sal_uLong nError = 0L; + ErrCode nError = ERRCODE_NONE; GetDoc(); @@ -181,7 +181,7 @@ sal_uLong SwReader::Read( const Reader& rOptions ) mxDoc->getIDocumentRedlineAccess().SetRedlineFlags_intern( RedlineFlags::Ignore ); - if( !IsError( nError )) // set the End position already + if( ! nError.IsError() ) // set the End position already { --aEndPos; pCNd = aEndPos.GetNode().GetContentNode(); @@ -727,7 +727,7 @@ SwWriter::SwWriter(SfxMedium& rMedium, SwDoc &rDocument) { } -sal_uLong SwWriter::Write( WriterRef& rxWriter, const OUString* pRealFileName ) +ErrCode SwWriter::Write( WriterRef& rxWriter, const OUString* pRealFileName ) { // #i73788# SwPauseThreadStarting aPauseThreadStarting; @@ -851,7 +851,7 @@ sal_uLong SwWriter::Write( WriterRef& rxWriter, const OUString* pRealFileName ) const bool bOrigPurgeOle = pOutDoc->getIDocumentSettingAccess().get(DocumentSettingId::PURGE_OLE); pOutDoc->getIDocumentSettingAccess().set(DocumentSettingId::PURGE_OLE, false); - sal_uLong nError = 0; + ErrCode nError = ERRCODE_NONE; if( pMedium ) nError = rxWriter->Write( *pPam, *pMedium, pRealFileName ); else if( pStg.is() ) @@ -884,7 +884,7 @@ sal_uLong SwWriter::Write( WriterRef& rxWriter, const OUString* pRealFileName ) { delete pPam; // delete the created Pam // Everything was written successfully? Tell the document! - if ( !IsError( nError ) && !xDoc.is() ) + if ( !nError.IsError() && !xDoc.is() ) { rDoc.getIDocumentState().ResetModified(); // #i38810# - reset also flag, that indicates updated links diff --git a/sw/source/filter/docx/swdocxreader.cxx b/sw/source/filter/docx/swdocxreader.cxx index 3f2bb22b4d26..25ee0567a95e 100644 --- a/sw/source/filter/docx/swdocxreader.cxx +++ b/sw/source/filter/docx/swdocxreader.cxx @@ -48,7 +48,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT Reader* SAL_CALL ImportDOCX() return new SwDOCXReader; } -sal_uLong SwDOCXReader::Read( SwDoc& /* rDoc */, const OUString& /* rBaseURL */, SwPaM& /* rPaM */, const OUString& /* FileName */ ) +ErrCode SwDOCXReader::Read( SwDoc& /* rDoc */, const OUString& /* rBaseURL */, SwPaM& /* rPaM */, const OUString& /* FileName */ ) { return ERR_SWG_READ_ERROR; } diff --git a/sw/source/filter/docx/swdocxreader.hxx b/sw/source/filter/docx/swdocxreader.hxx index 6c6dab0b2d1b..6418194bbdd0 100644 --- a/sw/source/filter/docx/swdocxreader.hxx +++ b/sw/source/filter/docx/swdocxreader.hxx @@ -35,7 +35,7 @@ public: virtual bool ReadGlossaries( SwTextBlocks& rBlocks, bool bSaveRelFiles ) const override; private: - virtual sal_uLong Read( SwDoc&, const OUString&, SwPaM&, const OUString& ) override; + virtual ErrCode Read( SwDoc&, const OUString&, SwPaM&, const OUString& ) override; static bool MakeEntries( SwDoc *pD, SwTextBlocks &rBlocks ); }; diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 1987153b18aa..1c020e270922 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -3161,7 +3161,7 @@ static Writer& OutCSS1_SvxBrush( Writer& rWrt, const SfxPoolItem& rHt, { if( !XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64) ) { - rHTMLWrt.m_nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE; + rHTMLWrt.m_nWarn = ErrCode(WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE); } } aLink.clear(); diff --git a/sw/source/filter/html/htmlflywriter.cxx b/sw/source/filter/html/htmlflywriter.cxx index 9a736f05822a..5c4746f18b8c 100644 --- a/sw/source/filter/html/htmlflywriter.cxx +++ b/sw/source/filter/html/htmlflywriter.cxx @@ -1360,7 +1360,7 @@ Writer& OutHTML_Image( Writer& rWrt, const SwFrameFormat &rFrameFormat, OUString aGraphicInBase64; if ( !XOutBitmap::GraphicToBase64(rGraphic, aGraphicInBase64) ) { - rHTMLWrt.m_nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE; + rHTMLWrt.m_nWarn = ErrCode(WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE); } OStringBuffer sBuffer; @@ -1438,7 +1438,7 @@ Writer& OutHTML_BulletImage( Writer& rWrt, { if( !XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64) ) { - rHTMLWrt.m_nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE; + rHTMLWrt.m_nWarn = ErrCode(WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE); } } } @@ -1728,10 +1728,10 @@ static Writer & OutHTML_FrameFormatAsImage( Writer& rWrt, const SwFrameFormat& r XOutBitmap::WriteGraphic( aGraphic, GraphicURL, "JPG", (XOutFlags::UseGifIfPossible| - XOutFlags::UseNativeIfPossible) ) != 0 ) + XOutFlags::UseNativeIfPossible) ) != ERRCODE_NONE ) { // empty or incorrect, because there is nothing to output - rHTMLWrt.m_nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE; + rHTMLWrt.m_nWarn = ErrCode(WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE); return rWrt; } @@ -1796,11 +1796,11 @@ static Writer& OutHTML_FrameFormatGrfNode( Writer& rWrt, const SwFrameFormat& rF aMM100Size = OutputDevice::LogicToLogic( rSize.GetSize(), MapMode( MapUnit::MapTwip ), MapMode( MapUnit::Map100thMM )); - sal_uInt16 nErr = XOutBitmap::WriteGraphic( pGrfNd->GetGrf(), aGraphicURL, + ErrCode nErr = XOutBitmap::WriteGraphic( pGrfNd->GetGrf(), aGraphicURL, "JPG", nFlags, &aMM100Size ); if( nErr ) { - rHTMLWrt.m_nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE; + rHTMLWrt.m_nWarn = ErrCode(WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE); return rWrt; } aGraphicURL = URIHelper::SmartRel2Abs( diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 48ae575cf327..981a479b9490 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -1313,13 +1313,13 @@ Writer& OutHTML_FrameFormatOLENodeGrf( Writer& rWrt, const SwFrameFormat& rFrame if(pTempFileName) aGraphicURL = *pTempFileName; - sal_uInt16 nErr = XOutBitmap::WriteGraphic( aGraphic, aGraphicURL, + ErrCode nErr = XOutBitmap::WriteGraphic( aGraphic, aGraphicURL, "JPG", (XOutFlags::UseGifIfPossible | XOutFlags::UseNativeIfPossible) ); if( nErr ) // error, don't write anything { - rHTMLWrt.m_nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE; + rHTMLWrt.m_nWarn = ErrCode(WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE); return rWrt; } aGraphicURL = URIHelper::SmartRel2Abs( diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index 7b1e42963dad..a431b466f9b3 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -189,7 +189,7 @@ bool HTMLReader::SetStrmStgPtr() } // Aufruf fuer die allg. Reader-Schnittstelle -sal_uLong HTMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPam, const OUString & rName ) +ErrCode HTMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPam, const OUString & rName ) { if( !pStrm ) { @@ -212,7 +212,7 @@ sal_uLong HTMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPam, // so nobody steals the document! rDoc.acquire(); - sal_uLong nRet = 0; + ErrCode nRet = ERRCODE_NONE; tools::SvRef<SwHTMLParser> xParser = new SwHTMLParser( &rDoc, rPam, *pStrm, rName, rBaseURL, !bInsertMode, pMedium, IsReadUTF8(), diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 4ba96bb823dd..adf1d388912d 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -185,7 +185,7 @@ void SwHTMLWriter::SetupFilterOptions(SfxMedium& rMedium) } } -sal_uLong SwHTMLWriter::WriteStream() +ErrCode SwHTMLWriter::WriteStream() { SvxHtmlOptions& rHtmlOptions = SvxHtmlOptions::Get(); @@ -1226,7 +1226,7 @@ void SwHTMLWriter::OutBackground( const SvxBrushItem *pBrushItem, bool bGraphic { if( !XOutBitmap::GraphicToBase64(*pGrf, aGraphicInBase64) ) { - m_nWarn = WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE; + m_nWarn = ErrCode(WARN_SWG_POOR_LOAD | WARN_SW_WRITE_BASE); } Strm().WriteCharPtr( " " OOO_STRING_SVTOOLS_HTML_O_background "=\"" ); Strm().WriteCharPtr( OOO_STRING_SVTOOLS_HTML_O_data ":" ); diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx index 6061bd4c2eec..45edb4e7e71a 100644 --- a/sw/source/filter/html/wrthtml.hxx +++ b/sw/source/filter/html/wrthtml.hxx @@ -271,7 +271,7 @@ class SwHTMLWriter : public Writer void CollectLinkTargets(); protected: - sal_uLong WriteStream() override; + ErrCode WriteStream() override; void SetupFilterOptions(SfxMedium& rMedium) override; public: @@ -302,7 +302,7 @@ public: sal_uInt32 m_aFontHeights[7]; // font heights 1-7 - sal_uInt32 m_nWarn; // warning code + ErrCode m_nWarn; // warning code sal_uInt32 m_nLastLFPos; // last position of LF HtmlTokenId m_nLastParaToken; // to hold paragraphs together diff --git a/sw/source/filter/inc/fltini.hxx b/sw/source/filter/inc/fltini.hxx index 7b5fa11001e4..a5b7f1569a4d 100644 --- a/sw/source/filter/inc/fltini.hxx +++ b/sw/source/filter/inc/fltini.hxx @@ -33,7 +33,7 @@ class HTMLReader: public Reader { // we don't want to have the streams/storages open virtual bool SetStrmStgPtr() override; - virtual sal_uLong Read(SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &) override; + virtual ErrCode Read(SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &) override; virtual OUString GetTemplateName() const override; public: HTMLReader(); @@ -41,7 +41,7 @@ public: class XMLReader : public Reader { - virtual sal_uLong Read(SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &) override; + virtual ErrCode Read(SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &) override; public: virtual int GetReaderType() override; diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index d0567a4f7ba1..cb578d4ebc53 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -40,10 +40,10 @@ using namespace ::com::sun::star; /// Glue class to call RtfImport as an internal filter, needed by copy&paste support. class SwRTFReader : public Reader { - sal_uLong Read(SwDoc&, const OUString& rBaseURL, SwPaM&, const OUString&) override; + ErrCode Read(SwDoc&, const OUString& rBaseURL, SwPaM&, const OUString&) override; }; -sal_uLong SwRTFReader::Read(SwDoc& rDoc, const OUString& /*rBaseURL*/, SwPaM& rPam, const OUString&) +ErrCode SwRTFReader::Read(SwDoc& rDoc, const OUString& /*rBaseURL*/, SwPaM& rPam, const OUString&) { if (!pStrm) return ERR_SWG_READ_ERROR; @@ -86,7 +86,7 @@ sal_uLong SwRTFReader::Read(SwDoc& rDoc, const OUString& /*rBaseURL*/, SwPaM& rP { "InsertMode", uno::Any(true) }, { "TextInsertModeRange", uno::Any(xInsertTextRange) } })); - sal_uLong ret(0); + ErrCode ret = ERRCODE_NONE; try { xFilter->filter(aDescriptor); diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index c46132263491..dab18534b15b 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -240,11 +240,11 @@ SvStream& Writer::OutULong( SvStream& rStrm, sal_uLong nVal ) return lcl_OutLongExt(rStrm, nVal, false); } -sal_uLong Writer::Write( SwPaM& rPaM, SvStream& rStrm, const OUString* pFName ) +ErrCode Writer::Write( SwPaM& rPaM, SvStream& rStrm, const OUString* pFName ) { if ( IsStgWriter() ) { - sal_uLong nResult = ERRCODE_ABORT; + ErrCode nResult = ERRCODE_ABORT; try { tools::SvRef<SotStorage> aRef = new SotStorage( rStrm ); @@ -268,7 +268,7 @@ sal_uLong Writer::Write( SwPaM& rPaM, SvStream& rStrm, const OUString* pFName ) // for comparison secure to the current Pam pOrigPam = &rPaM; - sal_uLong nRet = WriteStream(); + ErrCode nRet = WriteStream(); ResetWriter(); @@ -278,7 +278,7 @@ sal_uLong Writer::Write( SwPaM& rPaM, SvStream& rStrm, const OUString* pFName ) void Writer::SetupFilterOptions(SfxMedium& /*rMedium*/) {} -sal_uLong Writer::Write( SwPaM& rPam, SfxMedium& rMedium, const OUString* pFileName ) +ErrCode Writer::Write( SwPaM& rPam, SfxMedium& rMedium, const OUString* pFileName ) { SetupFilterOptions(rMedium); // This method must be overridden in SwXMLWriter a storage from medium will be used there. @@ -286,13 +286,13 @@ sal_uLong Writer::Write( SwPaM& rPam, SfxMedium& rMedium, const OUString* pFileN return Write( rPam, *rMedium.GetOutStream(), pFileName ); } -sal_uLong Writer::Write( SwPaM& /*rPam*/, SotStorage&, const OUString* ) +ErrCode Writer::Write( SwPaM& /*rPam*/, SotStorage&, const OUString* ) { OSL_ENSURE( false, "Write in Storages on a stream?" ); return ERR_SWG_WRITE_ERROR; } -sal_uLong Writer::Write( SwPaM&, const uno::Reference < embed::XStorage >&, const OUString*, SfxMedium* ) +ErrCode Writer::Write( SwPaM&, const uno::Reference < embed::XStorage >&, const OUString*, SfxMedium* ) { OSL_ENSURE( false, "Write in Storages on a stream?" ); return ERR_SWG_WRITE_ERROR; @@ -487,13 +487,13 @@ bool Writer::GetBookmarks(const SwContentNode& rNd, sal_Int32 nStt, } // Storage-specific -sal_uLong StgWriter::WriteStream() +ErrCode StgWriter::WriteStream() { OSL_ENSURE( false, "Write in Storages on a stream?" ); return ERR_SWG_WRITE_ERROR; } -sal_uLong StgWriter::Write( SwPaM& rPaM, SotStorage& rStg, const OUString* pFName ) +ErrCode StgWriter::Write( SwPaM& rPaM, SotStorage& rStg, const OUString* pFName ) { SetStream(nullptr); pStg = &rStg; @@ -505,7 +505,7 @@ sal_uLong StgWriter::Write( SwPaM& rPaM, SotStorage& rStg, const OUString* pFNam // for comparison secure to the current Pam pOrigPam = &rPaM; - sal_uLong nRet = WriteStorage(); + ErrCode nRet = WriteStorage(); pStg = nullptr; ResetWriter(); @@ -513,7 +513,7 @@ sal_uLong StgWriter::Write( SwPaM& rPaM, SotStorage& rStg, const OUString* pFNam return nRet; } -sal_uLong StgWriter::Write( SwPaM& rPaM, const uno::Reference < embed::XStorage >& rStg, const OUString* pFName, SfxMedium* pMedium ) +ErrCode StgWriter::Write( SwPaM& rPaM, const uno::Reference < embed::XStorage >& rStg, const OUString* pFName, SfxMedium* pMedium ) { SetStream(nullptr); pStg = nullptr; @@ -526,7 +526,7 @@ sal_uLong StgWriter::Write( SwPaM& rPaM, const uno::Reference < embed::XStorage // for comparison secure to the current Pam pOrigPam = &rPaM; - sal_uLong nRet = pMedium ? WriteMedium( *pMedium ) : WriteStorage(); + ErrCode nRet = pMedium ? WriteMedium( *pMedium ) : WriteStorage(); pStg = nullptr; ResetWriter(); diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 8b2de89d8bc7..e83f11e584c4 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -1369,7 +1369,7 @@ private: public: SwRTFWriter(const OUString& rFilterName, const OUString& rBaseURL); - sal_uLong WriteStream() override; + ErrCode WriteStream() override; }; SwRTFWriter::SwRTFWriter(const OUString& rFltName, const OUString& rBaseURL) @@ -1379,12 +1379,12 @@ SwRTFWriter::SwRTFWriter(const OUString& rFltName, const OUString& rBaseURL) m_bOutOutlineOnly = rFltName.startsWith("O"); } -sal_uLong SwRTFWriter::WriteStream() +ErrCode SwRTFWriter::WriteStream() { SwPaM aPam(*pCurPam->End(), *pCurPam->Start()); RtfExport aExport(nullptr, pDoc, &aPam, pCurPam, this, m_bOutOutlineOnly); aExport.ExportDocument(true); - return 0; + return ERRCODE_NONE; } extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL ExportRTF(const OUString& rFltName, const OUString& rBaseURL, WriterRef& xRet) diff --git a/sw/source/filter/ww8/rtfexportfilter.hxx b/sw/source/filter/ww8/rtfexportfilter.hxx index c58bf2b89554..5b626344e900 100644 --- a/sw/source/filter/ww8/rtfexportfilter.hxx +++ b/sw/source/filter/ww8/rtfexportfilter.hxx @@ -30,9 +30,9 @@ class RtfWriter : public Writer { protected: - sal_uLong WriteStream() override + ErrCode WriteStream() override { - return 0; + return ERRCODE_NONE; } }; diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 2048387249e8..7b1a06f741aa 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3445,7 +3445,7 @@ void WW8Export::PrepareStorage() } } -sal_uLong SwWW8Writer::WriteStorage() +ErrCode SwWW8Writer::WriteStorage() { // #i34818# - update layout (if present), for SwWriteTable SwViewShell* pViewShell = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell(); @@ -3473,19 +3473,19 @@ sal_uLong SwWW8Writer::WriteStorage() } ::EndProgress( pDoc->GetDocShell() ); - return 0; + return ERRCODE_NONE; } -sal_uLong SwWW8Writer::WriteMedium( SfxMedium& ) +ErrCode SwWW8Writer::WriteMedium( SfxMedium& ) { return WriteStorage(); } -sal_uLong SwWW8Writer::Write( SwPaM& rPaM, SfxMedium& rMed, +ErrCode SwWW8Writer::Write( SwPaM& rPaM, SfxMedium& rMed, const OUString* pFileName ) { mpMedium = &rMed; - sal_uLong nRet = StgWriter::Write( rPaM, rMed, pFileName ); + ErrCode nRet = StgWriter::Write( rPaM, rMed, pFileName ); mpMedium = nullptr; return nRet; } @@ -3625,10 +3625,10 @@ SwWW8Writer::~SwWW8Writer() { } -extern "C" SAL_DLLPUBLIC_EXPORT sal_uLong SAL_CALL SaveOrDelMSVBAStorage_ww8( SfxObjectShell& rDoc, SotStorage& rStor, sal_Bool bSaveInto, const OUString& rStorageName ) +extern "C" SAL_DLLPUBLIC_EXPORT sal_uInt32 SAL_CALL SaveOrDelMSVBAStorage_ww8( SfxObjectShell& rDoc, SotStorage& rStor, sal_Bool bSaveInto, const OUString& rStorageName ) { SvxImportMSVBasic aTmp( rDoc, rStor ); - return aTmp.SaveOrDelMSVBAStorage( bSaveInto, rStorageName ); + return sal_uInt32(aTmp.SaveOrDelMSVBAStorage( bSaveInto, rStorageName )); } extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL ExportDOC( const OUString& rFltName, const OUString& rBaseURL, WriterRef& xRet ) @@ -3636,9 +3636,9 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL ExportDOC( const OUString& rFltNam xRet = new SwWW8Writer( rFltName, rBaseURL ); } -extern "C" SAL_DLLPUBLIC_EXPORT sal_uLong SAL_CALL GetSaveWarningOfMSVBAStorage_ww8( SfxObjectShell &rDocS ) +extern "C" SAL_DLLPUBLIC_EXPORT sal_uInt32 SAL_CALL GetSaveWarningOfMSVBAStorage_ww8( SfxObjectShell &rDocS ) { - return SvxImportMSVBasic::GetSaveWarningOfMSVBAStorage( rDocS ); + return sal_uInt32(SvxImportMSVBasic::GetSaveWarningOfMSVBAStorage( rDocS )); } bool WW8_WrPlcFootnoteEdn::WriteText( WW8Export& rWrt ) diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 0957e33220fd..bb371dcdc5b7 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -899,8 +899,8 @@ public: SwWW8Writer(const OUString& rFltName, const OUString& rBaseURL); virtual ~SwWW8Writer() override; - virtual sal_uLong WriteStorage() override; - virtual sal_uLong WriteMedium( SfxMedium& ) override; + virtual ErrCode WriteStorage() override; + virtual ErrCode WriteMedium( SfxMedium& ) override; // TODO most probably we want to be able to get these in // MSExportFilterBase @@ -932,7 +932,7 @@ public: bool InitStd97CodecUpdateMedium( ::msfilter::MSCodec_Std97& rCodec ); using StgWriter::Write; - virtual sal_uLong Write( SwPaM&, SfxMedium&, const OUString* ) override; + virtual ErrCode Write( SwPaM&, SfxMedium&, const OUString* ) override; //Seems not an expected to provide method to access the private member SfxMedium* GetMedia() { return mpMedium; } diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 30cf48d92935..a12f89e25dd9 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -4870,9 +4870,9 @@ void SwWW8ImplReader::ReadGlobalTemplateSettings( const OUString& sCreatedFrom, } } -sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss) +ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss) { - sal_uLong nErrRet = 0; + ErrCode nErrRet = ERRCODE_NONE; m_rDoc.SetDocumentType( SwDoc::DOCTYPE_MSWORD ); if (m_bNewDoc && m_pStg && !pGloss) @@ -5382,10 +5382,10 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss) return nErrRet; } -sal_uLong SwWW8ImplReader::SetSubStreams(tools::SvRef<SotStorageStream> &rTableStream, +ErrCode SwWW8ImplReader::SetSubStreams(tools::SvRef<SotStorageStream> &rTableStream, tools::SvRef<SotStorageStream> &rDataStream) { - sal_uLong nErrRet = 0; + ErrCode nErrRet = ERRCODE_NONE; // 6 stands for "6 OR 7", 7 stands for "ONLY 7" switch (m_pWwFib->m_nVersion) { @@ -5657,9 +5657,9 @@ static bool lclReadCryptoAPIHeader(msfilter::RC4EncryptionInfo &info, SvStream & return true; } -sal_uLong SwWW8ImplReader::LoadThroughDecryption(WW8Glossary *pGloss) +ErrCode SwWW8ImplReader::LoadThroughDecryption(WW8Glossary *pGloss) { - sal_uLong nErrRet = 0; + ErrCode nErrRet = ERRCODE_NONE; if (pGloss) m_pWwFib = pGloss->GetFib(); else @@ -5727,7 +5727,7 @@ sal_uLong SwWW8ImplReader::LoadThroughDecryption(WW8Glossary *pGloss) // if initialization has failed the EncryptionData should be empty if ( aEncryptionData.getLength() && aCtx.VerifyKey( m_pWwFib->m_nKey, m_pWwFib->m_nHash ) ) { - nErrRet = 0; + nErrRet = ERRCODE_NONE; pTempMain = MakeTemp(aDecryptMain); m_pStrm->Seek(0); @@ -5794,7 +5794,7 @@ sal_uLong SwWW8ImplReader::LoadThroughDecryption(WW8Glossary *pGloss) if (aEncryptionData.getLength() && xCtx->VerifyKey(info.verifier.encryptedVerifier, info.verifier.encryptedVerifierHash)) { - nErrRet = 0; + nErrRet = ERRCODE_NONE; pTempMain = MakeTemp(aDecryptMain); @@ -5830,7 +5830,7 @@ sal_uLong SwWW8ImplReader::LoadThroughDecryption(WW8Glossary *pGloss) } } - if (nErrRet == 0) + if (nErrRet == ERRCODE_NONE) { m_pStrm = &aDecryptMain; @@ -6083,9 +6083,9 @@ void SwWW8ImplReader::GetSmartTagInfo(SwFltRDFMark& rMark) rMark.SetAttributes(aAttributes); } -sal_uLong SwWW8ImplReader::LoadDoc(WW8Glossary *pGloss) +ErrCode SwWW8ImplReader::LoadDoc(WW8Glossary *pGloss) { - sal_uLong nErrRet = 0; + ErrCode nErrRet = ERRCODE_NONE; { static const sal_Char* aNames[ 13 ] = { @@ -6217,7 +6217,7 @@ bool SAL_CALL TestImportDOC(SvStream &rStream, const OUString &rFltName) SwPaM aPaM( aIdx ); aPaM.GetPoint()->nContent.Assign(aIdx.GetNode().GetContentNode(), 0); pD->SetInReading(true); - bool bRet = xReader->Read(*pD, OUString(), aPaM, OUString()) == 0; + bool bRet = xReader->Read(*pD, OUString(), aPaM, OUString()) == ERRCODE_NONE; pD->SetInReading(false); return bRet; @@ -6238,9 +6238,9 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportWW2(SvStream &rStream) return TestImportDOC(rStream, "WW6"); } -sal_uLong WW8Reader::OpenMainStream( tools::SvRef<SotStorageStream>& rRef, sal_uInt16& rBuffSize ) +ErrCode WW8Reader::OpenMainStream( tools::SvRef<SotStorageStream>& rRef, sal_uInt16& rBuffSize ) { - sal_uLong nRet = ERR_SWG_READ_ERROR; + ErrCode nRet = ERR_SWG_READ_ERROR; OSL_ENSURE( pStg.get(), "Where is my Storage?" ); rRef = pStg->OpenSotStream( "WordDocument", StreamMode::READ | StreamMode::SHARE_DENYALL); @@ -6251,7 +6251,7 @@ sal_uLong WW8Reader::OpenMainStream( tools::SvRef<SotStorageStream>& rRef, sal_u sal_uInt16 nOld = rRef->GetBufferSize(); rRef->SetBufferSize( rBuffSize ); rBuffSize = nOld; - nRet = 0; + nRet = ERRCODE_NONE; } else nRet = rRef->GetError(); @@ -6259,7 +6259,7 @@ sal_uLong WW8Reader::OpenMainStream( tools::SvRef<SotStorageStream>& rRef, sal_u return nRet; } -sal_uLong WW8Reader::Read(SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, const OUString & /* FileName */) +ErrCode WW8Reader::Read(SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, const OUString & /* FileName */) { sal_uInt16 nOldBuffSize = 32768; bool bNew = !bInsertMode; // New Doc (no inserting) @@ -6267,7 +6267,7 @@ sal_uLong WW8Reader::Read(SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, co tools::SvRef<SotStorageStream> refStrm; // So that no one else can steal the Stream SvStream* pIn = pStrm; - sal_uLong nRet = 0; + ErrCode nRet = ERRCODE_NONE; sal_uInt8 nVersion = 8; const OUString sFltName = GetFltName(); diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index b859a030ef5b..f64509bf1421 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -130,8 +130,8 @@ struct WW8LFOInfo; class WW8Reader : public StgReader { - virtual sal_uLong Read(SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &) override; - sal_uLong OpenMainStream( tools::SvRef<SotStorageStream>& rRef, sal_uInt16& rBuffSize ); + virtual ErrCode Read(SwDoc &, const OUString& rBaseURL, SwPaM &, const OUString &) override; + ErrCode OpenMainStream( tools::SvRef<SotStorageStream>& rRef, sal_uInt16& rBuffSize ); public: virtual int GetReaderType() override; @@ -1513,9 +1513,9 @@ private: //This converts MS Asian Typography information into OOo's void ImportDopTypography(const WW8DopTypography &rTypo); - sal_uLong LoadThroughDecryption(WW8Glossary *pGloss); - sal_uLong SetSubStreams(tools::SvRef<SotStorageStream> &rTableStream, tools::SvRef<SotStorageStream> &rDataStream); - sal_uLong CoreLoad(WW8Glossary *pGloss); + ErrCode LoadThroughDecryption(WW8Glossary *pGloss); + ErrCode SetSubStreams(tools::SvRef<SotStorageStream> &rTableStream, tools::SvRef<SotStorageStream> &rDataStream); + ErrCode CoreLoad(WW8Glossary *pGloss); void ReadDocVars(); @@ -1871,7 +1871,7 @@ public: // really private, but can only be done public const OUString& GetBaseURL() const { return m_sBaseURL; } // load a complete doc file - sal_uLong LoadDoc(WW8Glossary *pGloss=nullptr); + ErrCode LoadDoc(WW8Glossary *pGloss=nullptr); rtl_TextEncoding GetCurrentCharSet(); rtl_TextEncoding GetCurrentCJKCharSet(); rtl_TextEncoding GetCharSetFromLanguage(); diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 64f7aceb3e5a..68b3870d83fc 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -2165,7 +2165,7 @@ void WW8PLCF::GeneratePLCF(SvStream& rSt, sal_Int32 nPN, sal_Int32 ncpN) rSt.ReadInt32( nFc ); pPLCF_PosArray[i] = nFc; - failure = rSt.GetError(); + failure = bool(rSt.GetError()); } } @@ -2191,7 +2191,7 @@ void WW8PLCF::GeneratePLCF(SvStream& rSt, sal_Int32 nPN, sal_Int32 ncpN) rSt.ReadInt32( nFc ); pPLCF_PosArray[nIMax] = nFc; // end of the last Fkp - failure = rSt.GetError(); + failure = bool(rSt.GetError()); } while(false); } diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index 9a1b277c8480..22ae96e0d85a 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -1113,7 +1113,7 @@ public: /* error status */ - sal_uLong m_nFibError; + ErrCode m_nFibError; /* data read from FIB by Ctor (corresponds only approximately to the real structure @@ -1599,7 +1599,7 @@ struct WW8Dop { public: /* Error Status */ - sal_uLong nDopError; + ErrCode nDopError; /* Corresponds only roughly to the actual structure of the Winword DOP, the winword FIB version matters to what exists. diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx index a288f7949f4b..8282b081c2e8 100644 --- a/sw/source/filter/xml/swxml.cxx +++ b/sw/source/filter/xml/swxml.cxx @@ -126,7 +126,7 @@ namespace { /// read a component (file + filter version) -sal_Int32 ReadThroughComponent( +ErrCode ReadThroughComponent( uno::Reference<io::XInputStream> const & xInputStream, uno::Reference<XComponent> const & xModelComponent, const OUString& rStreamName, @@ -273,11 +273,11 @@ sal_Int32 ReadThroughComponent( } // success! - return 0; + return ERRCODE_NONE; } // read a component (storage version) -sal_Int32 ReadThroughComponent( +ErrCode ReadThroughComponent( uno::Reference<embed::XStorage> const & xStorage, uno::Reference<XComponent> const & xModelComponent, const sal_Char* pStreamName, @@ -309,7 +309,7 @@ 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); @@ -322,7 +322,7 @@ sal_Int32 ReadThroughComponent( } if (! bContainsStream ) - return 0; + return ERRCODE_NONE; } // set Base URL @@ -490,7 +490,7 @@ static void lcl_ConvertSdrOle2ObjsToSdrGrafObjs(SwDoc& _rDoc) } } -sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, const OUString & rName ) +ErrCode XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, const OUString & rName ) { // needed for relative URLs, but in clipboard copy/paste there may be none // and also there is the SwXMLTextBlocks special case @@ -768,7 +768,7 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c } (void)rDoc.acquire(); // prevent deletion - sal_uInt32 nRet = 0; + ErrCode nRet = ERRCODE_NONE; // save redline mode into import info property set const OUString sShowChanges("ShowChanges"); @@ -799,7 +799,7 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c makeAny( bTextDocInOOoFileFormat ) ); } - sal_uInt32 nWarnRDF = 0; + ErrCode nWarnRDF = ERRCODE_NONE; if ( !(IsOrganizerMode() || IsBlockMode() || aOpt.IsFormatsOnly() || bInsertMode) ) { @@ -837,13 +837,13 @@ sal_uLong XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, c // read storage streams // #i103539#: always read meta.xml for generator - sal_uInt32 const nWarn = ReadThroughComponent( + ErrCode const nWarn = ReadThroughComponent( xStorage, xModelComp, "meta.xml", "Meta.xml", xContext, (bOASIS ? "com.sun.star.comp.Writer.XMLOasisMetaImporter" : "com.sun.star.comp.Writer.XMLMetaImporter"), aEmptyArgs, rName, false ); - sal_uInt32 nWarn2 = 0; + ErrCode nWarn2 = ERRCODE_NONE; if( !(IsOrganizerMode() || IsBlockMode() || aOpt.IsFormatsOnly() || bInsertMode) ) { diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx index f49af4ffeae3..d7690b57cae9 100644 --- a/sw/source/filter/xml/wrtxml.cxx +++ b/sw/source/filter/xml/wrtxml.cxx @@ -69,7 +69,7 @@ SwXMLWriter::~SwXMLWriter() { } -sal_uInt32 SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xStatusIndicator, +ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xStatusIndicator, const OUString& aDocHierarchicalName ) { // Get service factory @@ -425,15 +425,15 @@ sal_uInt32 SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& return WARN_SWG_FEATURES_LOST; } - return 0; + return ERRCODE_NONE; } -sal_uLong SwXMLWriter::WriteStorage() +ErrCode SwXMLWriter::WriteStorage() { return Write_( uno::Reference < task::XStatusIndicator >(), OUString() ); } -sal_uLong SwXMLWriter::WriteMedium( SfxMedium& aTargetMedium ) +ErrCode SwXMLWriter::WriteMedium( SfxMedium& aTargetMedium ) { uno::Reference < task::XStatusIndicator > xStatusIndicator; OUString aName; @@ -449,7 +449,7 @@ sal_uLong SwXMLWriter::WriteMedium( SfxMedium& aTargetMedium ) return Write_( xStatusIndicator, aName ); } -sal_uLong SwXMLWriter::Write( SwPaM& rPaM, SfxMedium& rMed, +ErrCode SwXMLWriter::Write( SwPaM& rPaM, SfxMedium& rMed, const OUString* pFileName ) { return IsStgWriter() diff --git a/sw/source/filter/xml/wrtxml.hxx b/sw/source/filter/xml/wrtxml.hxx index 558b21fd4521..1dbd9f63dfa0 100644 --- a/sw/source/filter/xml/wrtxml.hxx +++ b/sw/source/filter/xml/wrtxml.hxx @@ -39,20 +39,20 @@ namespace com { namespace sun { namespace star { class SwXMLWriter : public StgWriter { - sal_uInt32 Write_( const css::uno::Reference < css::task::XStatusIndicator>&, const OUString& ); + ErrCode Write_( const css::uno::Reference < css::task::XStatusIndicator>&, const OUString& ); using StgWriter::Write; protected: - virtual sal_uLong WriteStorage() override; - virtual sal_uLong WriteMedium( SfxMedium& aTargetMedium ) override; + virtual ErrCode WriteStorage() override; + virtual ErrCode WriteMedium( SfxMedium& aTargetMedium ) override; public: SwXMLWriter( const OUString& rBaseURL ); virtual ~SwXMLWriter() override; - virtual sal_uLong Write( SwPaM&, SfxMedium&, const OUString* ) override; + virtual ErrCode Write( SwPaM&, SfxMedium&, const OUString* ) override; private: diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx index fa7abe2d94e0..6d41045d0b8c 100644 --- a/sw/source/filter/xml/xmlexp.cxx +++ b/sw/source/filter/xml/xmlexp.cxx @@ -96,7 +96,7 @@ SwXMLExport::SwXMLExport( InitItemExport(); } -sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) +ErrCode SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) { if( !GetModel().is() ) return ERR_SWG_WRITE_ERROR; @@ -286,7 +286,7 @@ sal_uInt32 SwXMLExport::exportDoc( enum XMLTokenEnum eClass ) ( nRedlineFlags & RedlineFlags::ShowMask ) | RedlineFlags::ShowInsert ); } - sal_uInt32 nRet = SvXMLExport::exportDoc( eClass ); + ErrCode nRet = SvXMLExport::exportDoc( eClass ); // now we can restore the redline mode (if we changed it previously) if( bSaveRedline ) diff --git a/sw/source/filter/xml/xmlexp.hxx b/sw/source/filter/xml/xmlexp.hxx index c08b0e2b33b0..778cf20931c4 100644 --- a/sw/source/filter/xml/xmlexp.hxx +++ b/sw/source/filter/xml/xmlexp.hxx @@ -114,7 +114,7 @@ public: virtual ~SwXMLExport() override; - virtual sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_TOKEN_INVALID ) override; + virtual ErrCode exportDoc( enum ::xmloff::token::XMLTokenEnum eClass = ::xmloff::token::XML_TOKEN_INVALID ) override; inline const SvXMLUnitConverter& GetTwipUnitConverter() const; |