[Libreoffice-commits] core.git: sc/inc sc/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Jun 6 07:48:27 UTC 2017


 sc/inc/filter.hxx                   |   36 ++++++----------------
 sc/inc/scerrors.hxx                 |    9 +++++
 sc/source/filter/dif/difimp.cxx     |   10 +++---
 sc/source/filter/excel/excel.cxx    |   36 +++++++++++-----------
 sc/source/filter/excel/expop2.cxx   |    4 +-
 sc/source/filter/excel/impop.cxx    |    4 +-
 sc/source/filter/excel/read.cxx     |   12 +++----
 sc/source/filter/html/htmlimp.cxx   |    4 +-
 sc/source/filter/inc/excimp8.hxx    |    2 -
 sc/source/filter/inc/exp_op.hxx     |    4 +-
 sc/source/filter/inc/ftools.hxx     |   16 ++++-----
 sc/source/filter/inc/imp_op.hxx     |    4 +-
 sc/source/filter/inc/lotimpop.hxx   |    4 +-
 sc/source/filter/inc/qpro.hxx       |    4 +-
 sc/source/filter/lotus/filter.cxx   |   16 ++++-----
 sc/source/filter/lotus/lotread.cxx  |   14 ++++----
 sc/source/filter/lotus/lotus.cxx    |   10 +++---
 sc/source/filter/qpro/qpro.cxx      |   24 +++++++-------
 sc/source/filter/rtf/rtfimp.cxx     |    4 +-
 sc/source/filter/starcalc/scflt.cxx |    4 +-
 sc/source/ui/docshell/docsh.cxx     |   58 ++++++++++++++++++------------------
 sc/source/ui/docshell/docsh8.cxx    |   12 +++----
 sc/source/ui/docshell/impex.cxx     |   18 +++++------
 sc/source/ui/view/viewfun5.cxx      |    4 +-
 24 files changed, 153 insertions(+), 160 deletions(-)

New commits:
commit 13f91bdc0c8cdb5c6107f2c5ebebe4611be8fe81
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Jun 5 16:45:02 2017 +0200

    expand out FltError and eERR constants
    
    they're just aliases for ErrCode and ERRCODE constants.
    It's not like I can even convert them to an enum since the relevant
    functions do not return only these constants, but also a variety of
    other error constants.
    
    This a cleanup commit prior to converting the ErrCode stuff to an
    o3tl::strong_int
    
    Change-Id: Ia9f506a24f6bd382d86b68e46bec36e4da7a4310
    Reviewed-on: https://gerrit.libreoffice.org/38412
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sc/inc/filter.hxx b/sc/inc/filter.hxx
index ce4fac78d442..750af6986d8f 100644
--- a/sc/inc/filter.hxx
+++ b/sc/inc/filter.hxx
@@ -23,6 +23,7 @@
 #include <rtl/textenc.h>
 #include <rtl/ustring.hxx>
 #include <tools/solar.h>
+#include <vcl/errcode.hxx>
 
 #include "scdllapi.h"
 
@@ -35,23 +36,6 @@ class ScRange;
 class SvNumberFormatter;
 class ScOrcusFilters;
 
-// return values im-/export filter  (sal_uLong)
-
-typedef sal_uLong FltError;
-
-#define eERR_OK         ERRCODE_NONE                // no error
-#define eERR_OPEN       SCERR_IMPORT_OPEN
-#define eERR_NOMEM      SCERR_IMPORT_OUTOFMEM       // out of memory
-#define eERR_UNKN_WK    SCERR_IMPORT_UNKNOWN_WK     // unknown WK? format (Lotus 1-2-3)
-#define eERR_FORMAT     SCERR_IMPORT_FORMAT         // format error during reading (no formula error!)
-#define eERR_NI         SCERR_IMPORT_NI             // filter not implemented
-#define eERR_UNKN_BIFF  SCERR_IMPORT_UNKNOWN_BIFF   // unknown BIFF format (Excel)
-#define eERR_FILEPASSWD SCERR_IMPORT_FILEPASSWD     // file password protected
-#define eERR_INTERN     SCERR_IMPORT_INTERNAL       // internal error
-#define eERR_RNGOVRFLW  SCWARN_IMPORT_RANGE_OVERFLOW// overflow of cell coordinates
-                                                    // table restricted to valid area (?)
-// more error codes: s. scerrors.hxx
-
 // for import
 enum EXCIMPFORMAT { EIF_AUTO, EIF_BIFF5, EIF_BIFF8, EIF_BIFF_LE4 };
 
@@ -74,18 +58,18 @@ class ScEEAbsImport {
 class SAL_DLLPUBLIC_RTTI ScFormatFilterPlugin {
   public:
     // various import filters
-    virtual FltError ScImportLotus123( SfxMedium&, ScDocument*, rtl_TextEncoding eSrc ) = 0;
-    virtual FltError ScImportQuattroPro(SvStream* pStream, ScDocument *pDoc) = 0;
-    virtual FltError ScImportExcel( SfxMedium&, ScDocument*, const EXCIMPFORMAT ) = 0;
+    virtual ErrCode ScImportLotus123( SfxMedium&, ScDocument*, rtl_TextEncoding eSrc ) = 0;
+    virtual ErrCode ScImportQuattroPro(SvStream* pStream, ScDocument *pDoc) = 0;
+    virtual ErrCode ScImportExcel( SfxMedium&, ScDocument*, const EXCIMPFORMAT ) = 0;
         // eFormat == EIF_AUTO  -> matching filter is used automatically
         // eFormat == EIF_BIFF5 -> only Biff5 stream is read successfully (in an Excel97 doc, too)
         // eFormat == EIF_BIFF8 -> only Biff8 stream is read successfully (only in Excel97 docs)
         // eFormat == EIF_BIFF_LE4 -> only non storage files _might_ be read successfully
-    virtual FltError ScImportStarCalc10( SvStream&, ScDocument* ) = 0;
-    virtual FltError ScImportDif( SvStream&, ScDocument*, const ScAddress& rInsPos,
+    virtual ErrCode ScImportStarCalc10( SvStream&, ScDocument* ) = 0;
+    virtual ErrCode ScImportDif( SvStream&, ScDocument*, const ScAddress& rInsPos,
                  const rtl_TextEncoding eSrc ) = 0;
-    virtual FltError ScImportRTF( SvStream&, const OUString& rBaseURL, ScDocument*, ScRange& rRange ) = 0;
-    virtual FltError ScImportHTML( SvStream&, const OUString& rBaseURL, ScDocument*, ScRange& rRange, double nOutputFactor,
+    virtual ErrCode ScImportRTF( SvStream&, const OUString& rBaseURL, ScDocument*, ScRange& rRange ) = 0;
+    virtual ErrCode ScImportHTML( SvStream&, const OUString& rBaseURL, ScDocument*, ScRange& rRange, double nOutputFactor,
                                    bool bCalcWidthHeight, SvNumberFormatter* pFormatter = nullptr, bool bConvertDate = true ) = 0;
 
     // various import helpers
@@ -94,7 +78,7 @@ class SAL_DLLPUBLIC_RTTI ScFormatFilterPlugin {
     virtual OUString       GetHTMLRangeNameList( ScDocument* pDoc, const OUString& rOrigName ) = 0;
 
     // various export filters
-    virtual FltError ScExportExcel5( SfxMedium&, ScDocument*, ExportFormatExcel eFormat, rtl_TextEncoding eDest ) = 0;
+    virtual ErrCode ScExportExcel5( SfxMedium&, ScDocument*, ExportFormatExcel eFormat, rtl_TextEncoding eDest ) = 0;
     virtual void ScExportDif( SvStream&, ScDocument*, const ScAddress& rOutPos, const rtl_TextEncoding eDest ) = 0;
     virtual void ScExportDif( SvStream&, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest ) = 0;
     virtual void ScExportHTML( SvStream&, const OUString& rBaseURL, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest, bool bAll,
@@ -119,7 +103,7 @@ class ScFormatFilter {
 
 struct LotusContext;
 
-FltError ScImportLotus123old(LotusContext& rContext, SvStream&, ScDocument*, rtl_TextEncoding eSrc);
+ErrCode ScImportLotus123old(LotusContext& rContext, SvStream&, ScDocument*, rtl_TextEncoding eSrc);
 
 #endif
 
diff --git a/sc/inc/scerrors.hxx b/sc/inc/scerrors.hxx
index 3555a9f8a171..0c16534f0b1e 100644
--- a/sc/inc/scerrors.hxx
+++ b/sc/inc/scerrors.hxx
@@ -26,13 +26,20 @@
 #define SCERR_IMPORT_CONNECT        (   1 | ERRCODE_CLASS_READ | ERRCODE_AREA_SC )
 #define SCERR_IMPORT_OPEN           (   2 | ERRCODE_CLASS_READ | ERRCODE_AREA_SC )
 #define SCERR_IMPORT_UNKNOWN        (   3 | ERRCODE_CLASS_READ | ERRCODE_AREA_SC )
+  // out of memory
 #define SCERR_IMPORT_OUTOFMEM       (   4 | ERRCODE_CLASS_READ | ERRCODE_AREA_SC )
+  // unknown WK? format (Lotus 1-2-3)
 #define SCERR_IMPORT_UNKNOWN_WK     (   5 | ERRCODE_CLASS_READ | ERRCODE_AREA_SC )
+  // format error during reading (no formula error!)
 #define SCERR_IMPORT_FORMAT         (   6 | ERRCODE_CLASS_READ | ERRCODE_AREA_SC )
+  // filter not implemented
 #define SCERR_IMPORT_NI             (   7 | ERRCODE_CLASS_READ | ERRCODE_AREA_SC )
+  // unknown BIFF format (Excel)
 #define SCERR_IMPORT_UNKNOWN_BIFF   (   8 | ERRCODE_CLASS_READ | ERRCODE_AREA_SC )
 #define SCERR_IMPORT_NI_BIFF        (   9 | ERRCODE_CLASS_READ | ERRCODE_AREA_SC )
+  // file password protected
 #define SCERR_IMPORT_FILEPASSWD     (  10 | ERRCODE_CLASS_READ | ERRCODE_AREA_SC )
+  // internal error
 #define SCERR_IMPORT_INTERNAL       (  11 | ERRCODE_CLASS_READ | ERRCODE_AREA_SC )
 #define SCERR_IMPORT_8K_LIMIT       (  12 | ERRCODE_CLASS_READ | ERRCODE_AREA_SC )
 #define SCWARN_IMPORT_OPEN_FM3      (  13 | ERRCODE_CLASS_READ | ERRCODE_WARNING_MASK | ERRCODE_AREA_SC )
@@ -50,6 +57,8 @@
 #define SCERR_EXPORT_SQLEXCEPTION   (   5 | ERRCODE_CLASS_WRITE | ERRCODE_AREA_SC )
 
 // ERRCODE_CLASS_IMPORT - does not display "Read-Error" in MsgBox
+    // overflow of cell coordinates
+    // table restricted to valid area (?)
 #define SCWARN_IMPORT_RANGE_OVERFLOW (  1 | ERRCODE_CLASS_IMPORT | ERRCODE_WARNING_MASK | ERRCODE_AREA_SC )
 #define SCWARN_IMPORT_ROW_OVERFLOW  (   2 | ERRCODE_CLASS_IMPORT | ERRCODE_WARNING_MASK | ERRCODE_AREA_SC )
 #define SCWARN_IMPORT_COLUMN_OVERFLOW ( 3 | ERRCODE_CLASS_IMPORT | ERRCODE_WARNING_MASK | ERRCODE_AREA_SC )
diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx
index c133ecb4c544..49bd02fb339c 100644
--- a/sc/source/filter/dif/difimp.cxx
+++ b/sc/source/filter/dif/difimp.cxx
@@ -47,7 +47,7 @@ const sal_Unicode pKeyNA[]      = { 'N', 'A', 0 };
 const sal_Unicode pKeyV[]       = { 'V', 0 };
 const sal_Unicode pKey1_0[]     = { '1', ',', '0', 0 };
 
-FltError ScFormatFilterPluginImpl::ScImportDif(SvStream& rIn, ScDocument* pDoc, const ScAddress& rInsPos,
+ErrCode ScFormatFilterPluginImpl::ScImportDif(SvStream& rIn, ScDocument* pDoc, const ScAddress& rInsPos,
                         const rtl_TextEncoding eVon )
 {
     DifParser   aDifParser( rIn, *pDoc, eVon );
@@ -211,17 +211,17 @@ FltError ScFormatFilterPluginImpl::ScImportDif(SvStream& rIn, ScDocument* pDoc,
         aAttrCache.Apply( *pDoc, nBaseTab );
     }
     else
-        return eERR_FORMAT;
+        return SCERR_IMPORT_FORMAT;
 
     if( bSyntErrWarn )
 
         // FIXME: Add proper Warnung!
-        return eERR_RNGOVRFLW;
+        return SCWARN_IMPORT_RANGE_OVERFLOW;
 
     else if( bOverflowWarn )
-        return eERR_RNGOVRFLW;
+        return SCWARN_IMPORT_RANGE_OVERFLOW;
     else
-        return eERR_OK;
+        return ERRCODE_NONE;
 }
 
 DifParser::DifParser( SvStream& rNewIn, ScDocument& rDoc, rtl_TextEncoding e )
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx
index 8988935f80f0..b6087bf30715 100644
--- a/sc/source/filter/excel/excel.cxx
+++ b/sc/source/filter/excel/excel.cxx
@@ -45,24 +45,24 @@
 
 #include <memory>
 
-FltError ScFormatFilterPluginImpl::ScImportExcel( SfxMedium& rMedium, ScDocument* pDocument, const EXCIMPFORMAT eFormat )
+ErrCode ScFormatFilterPluginImpl::ScImportExcel( SfxMedium& rMedium, ScDocument* pDocument, const EXCIMPFORMAT eFormat )
 {
     // check the passed Calc document
     OSL_ENSURE( pDocument, "::ScImportExcel - no document" );
-    if( !pDocument ) return eERR_INTERN;        // should not happen
+    if( !pDocument ) return SCERR_IMPORT_INTERNAL;        // should not happen
 
     /*  Import all BIFF versions regardless on eFormat, needed for import of
         external cells (file type detection returns Excel4.0). */
     if( (eFormat != EIF_AUTO) && (eFormat != EIF_BIFF_LE4) && (eFormat != EIF_BIFF5) && (eFormat != EIF_BIFF8) )
     {
         OSL_FAIL( "::ScImportExcel - wrong file format specification" );
-        return eERR_FORMAT;
+        return SCERR_IMPORT_FORMAT;
     }
 
     // check the input stream from medium
     SvStream* pMedStrm = rMedium.GetInStream();
     OSL_ENSURE( pMedStrm, "::ScImportExcel - medium without input stream" );
-    if( !pMedStrm ) return eERR_OPEN;           // should not happen
+    if( !pMedStrm ) return SCERR_IMPORT_OPEN;           // should not happen
 
     SvStream* pBookStrm = nullptr;            // The "Book"/"Workbook" stream containing main data.
     XclBiff eBiff = EXC_BIFF_UNKNOWN;   // The BIFF version of the main stream.
@@ -116,7 +116,7 @@ FltError ScFormatFilterPluginImpl::ScImportExcel( SfxMedium& rMedium, ScDocument
     }
 
     // try to import the file
-    FltError eRet = eERR_UNKN_BIFF;
+    ErrCode eRet = SCERR_IMPORT_UNKNOWN_BIFF;
     if( pBookStrm )
     {
         pBookStrm->SetBufferSize( 0x8000 );     // still needed?
@@ -137,18 +137,18 @@ FltError ScFormatFilterPluginImpl::ScImportExcel( SfxMedium& rMedium, ScDocument
             default:    DBG_ERROR_BIFF();
         }
 
-        eRet = xFilter.get() ? xFilter->Read() : eERR_INTERN;
+        eRet = xFilter.get() ? xFilter->Read() : SCERR_IMPORT_INTERNAL;
     }
 
     return eRet;
 }
 
-static FltError lcl_ExportExcelBiff( SfxMedium& rMedium, ScDocument *pDocument,
+static ErrCode lcl_ExportExcelBiff( SfxMedium& rMedium, ScDocument *pDocument,
         SvStream* pMedStrm, bool bBiff8, rtl_TextEncoding eNach )
 {
     // try to open an OLE storage
     tools::SvRef<SotStorage> xRootStrg = new SotStorage( pMedStrm, false );
-    if( xRootStrg->GetError() ) return eERR_OPEN;
+    if( xRootStrg->GetError() ) return SCERR_IMPORT_OPEN;
 
     // create BIFF dependent strings
     OUString aStrmName, aClipName, aClassName;
@@ -167,11 +167,11 @@ static FltError lcl_ExportExcelBiff( SfxMedium& rMedium, ScDocument *pDocument,
 
     // open the "Book"/"Workbook" stream
     tools::SvRef<SotStorageStream> xStrgStrm = ScfTools::OpenStorageStreamWrite( xRootStrg, aStrmName );
-    if( !xStrgStrm.is() || xStrgStrm->GetError() ) return eERR_OPEN;
+    if( !xStrgStrm.is() || xStrgStrm->GetError() ) return SCERR_IMPORT_OPEN;
 
     xStrgStrm->SetBufferSize( 0x8000 );     // still needed?
 
-    FltError eRet = eERR_UNKN_BIFF;
+    ErrCode eRet = SCERR_IMPORT_UNKNOWN_BIFF;
     XclExpRootData aExpData( bBiff8 ? EXC_BIFF8 : EXC_BIFF5, rMedium, xRootStrg, *pDocument, eNach );
     if ( bBiff8 )
     {
@@ -184,7 +184,7 @@ static FltError lcl_ExportExcelBiff( SfxMedium& rMedium, ScDocument *pDocument,
         eRet = aFilter.Write();
     }
 
-    if( eRet == eERR_RNGOVRFLW )
+    if( eRet == SCWARN_IMPORT_RANGE_OVERFLOW )
         eRet = SCWARN_EXPORT_MAXROW;
 
     SvGlobalName aGlobName(MSO_EXCEL5_CLASSID);
@@ -197,22 +197,22 @@ static FltError lcl_ExportExcelBiff( SfxMedium& rMedium, ScDocument *pDocument,
     return eRet;
 }
 
-FltError ScFormatFilterPluginImpl::ScExportExcel5( SfxMedium& rMedium, ScDocument *pDocument,
+ErrCode ScFormatFilterPluginImpl::ScExportExcel5( SfxMedium& rMedium, ScDocument *pDocument,
     ExportFormatExcel eFormat, rtl_TextEncoding eNach )
 {
     if( eFormat != ExpBiff5 && eFormat != ExpBiff8 )
-        return eERR_NI;
+        return SCERR_IMPORT_NI;
 
     // check the passed Calc document
     OSL_ENSURE( pDocument, "::ScExportExcel5 - no document" );
-    if( !pDocument ) return eERR_INTERN;        // should not happen
+    if( !pDocument ) return SCERR_IMPORT_INTERNAL;        // should not happen
 
     // check the output stream from medium
     SvStream* pMedStrm = rMedium.GetOutStream();
     OSL_ENSURE( pMedStrm, "::ScExportExcel5 - medium without output stream" );
-    if( !pMedStrm ) return eERR_OPEN;           // should not happen
+    if( !pMedStrm ) return SCERR_IMPORT_OPEN;           // should not happen
 
-    FltError eRet = eERR_UNKN_BIFF;
+    ErrCode eRet = SCERR_IMPORT_UNKNOWN_BIFF;
     if( eFormat == ExpBiff5 || eFormat == ExpBiff8 )
         eRet = lcl_ExportExcelBiff( rMedium, pDocument, pMedStrm, eFormat == ExpBiff8, eNach );
 
@@ -224,7 +224,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportQPW(SvStream &rStream)
     ScDLL::Init();
     ScDocument aDocument;
     aDocument.MakeTable(0);
-    return ScFormatFilter::Get().ScImportQuattroPro(&rStream, &aDocument) == eERR_OK;
+    return ScFormatFilter::Get().ScImportQuattroPro(&rStream, &aDocument) == ERRCODE_NONE;
 }
 
 extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportXLS(const OUString &rURL)
@@ -233,7 +233,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportXLS(const OUString &rURL
     SfxMedium aMedium(rURL, StreamMode::READ);
     ScDocument aDocument;
     aDocument.MakeTable(0);
-    return ScFormatFilter::Get().ScImportExcel(aMedium, &aDocument, EIF_AUTO) == eERR_OK;
+    return ScFormatFilter::Get().ScImportExcel(aMedium, &aDocument, EIF_AUTO) == ERRCODE_NONE;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/excel/expop2.cxx b/sc/source/filter/excel/expop2.cxx
index e2fdfecf1a0a..ed636897f326 100644
--- a/sc/source/filter/excel/expop2.cxx
+++ b/sc/source/filter/excel/expop2.cxx
@@ -71,7 +71,7 @@ ExportBiff5::~ExportBiff5()
 {
 }
 
-FltError ExportBiff5::Write()
+ErrCode ExportBiff5::Write()
 {
     SfxObjectShell* pDocShell = GetDocShell();
     OSL_ENSURE( pDocShell, "ExportBiff5::Write - no document shell" );
@@ -139,7 +139,7 @@ FltError ExportBiff5::Write()
     if( rAddrConv.IsTabTruncated() )
         return SCWARN_EXPORT_MAXTAB;
 
-    return eERR_OK;
+    return ERRCODE_NONE;
 }
 
 ExportBiff8::ExportBiff8( XclExpRootData& rExpData, SvStream& rStrm ) :
diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx
index 51a401db0a26..154efd5e1102 100644
--- a/sc/source/filter/excel/impop.cxx
+++ b/sc/source/filter/excel/impop.cxx
@@ -99,9 +99,9 @@ ImportTyp::~ImportTyp()
 {
 }
 
-FltError ImportTyp::Read()
+ErrCode ImportTyp::Read()
 {
-    return eERR_INTERN;
+    return SCERR_IMPORT_INTERNAL;
 }
 
 ImportExcel::ImportExcel( XclImpRootData& rImpData, SvStream& rStrm ):
diff --git a/sc/source/filter/excel/read.cxx b/sc/source/filter/excel/read.cxx
index f25eb3fcf3e9..794bad50e2f0 100644
--- a/sc/source/filter/excel/read.cxx
+++ b/sc/source/filter/excel/read.cxx
@@ -63,7 +63,7 @@ namespace
     }
 }
 
-FltError ImportExcel::Read()
+ErrCode ImportExcel::Read()
 {
     XclImpPageSettings&     rPageSett       = GetPageSettings();
     XclImpTabViewSettings&  rTabViewSett    = GetTabViewSettings();
@@ -97,7 +97,7 @@ FltError ImportExcel::Read()
 
     Zustand             eAkt = Z_BiffNull, ePrev = Z_BiffNull;
 
-    FltError        eLastErr = eERR_OK;
+    ErrCode         eLastErr = ERRCODE_NONE;
     sal_uInt16      nOpcode;
     sal_uInt16      nBofLevel = 0;
 
@@ -768,7 +768,7 @@ FltError ImportExcel::Read()
         }
     }
 
-    if( eLastErr == eERR_OK )
+    if( eLastErr == ERRCODE_NONE )
     {
         pProgress.reset();
 
@@ -790,7 +790,7 @@ FltError ImportExcel::Read()
     return eLastErr;
 }
 
-FltError ImportExcel8::Read()
+ErrCode ImportExcel8::Read()
 {
 #ifdef EXC_INCL_DUMPER
     {
@@ -834,7 +834,7 @@ FltError ImportExcel8::Read()
 
     XclImpReadState eAkt = EXC_STATE_BEFORE_GLOBALS;
 
-    FltError eLastErr = eERR_OK;
+    ErrCode eLastErr = ERRCODE_NONE;
 
     std::unique_ptr< ScfSimpleProgressBar > pProgress( new ScfSimpleProgressBar(
         aIn.GetSvStreamSize(), GetDocShell(), STR_LOAD_DOC ) );
@@ -1245,7 +1245,7 @@ FltError ImportExcel8::Read()
         }
     }
 
-    if( eLastErr == eERR_OK )
+    if( eLastErr == ERRCODE_NONE )
     {
         // In some strange circumstances a the codename might be missing
         // # Create any missing Sheet CodeNames
diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx
index 1bef8dbbad78..41c9d6cd0a5c 100644
--- a/sc/source/filter/html/htmlimp.cxx
+++ b/sc/source/filter/html/htmlimp.cxx
@@ -42,12 +42,12 @@
 #include "ftools.hxx"
 #include "tokenarray.hxx"
 
-FltError ScFormatFilterPluginImpl::ScImportHTML( SvStream &rStream, const OUString& rBaseURL, ScDocument *pDoc,
+ErrCode ScFormatFilterPluginImpl::ScImportHTML( SvStream &rStream, const OUString& rBaseURL, ScDocument *pDoc,
         ScRange& rRange, double nOutputFactor, bool bCalcWidthHeight, SvNumberFormatter* pFormatter,
         bool bConvertDate )
 {
     ScHTMLImport aImp( pDoc, rBaseURL, rRange, bCalcWidthHeight );
-    FltError nErr = (FltError) aImp.Read( rStream, rBaseURL );
+    ErrCode nErr = (ErrCode) aImp.Read( rStream, rBaseURL );
     ScRange aR = aImp.GetRange();
     rRange.aEnd = aR.aEnd;
     aImp.WriteToDocument( true, nOutputFactor, pFormatter, bConvertDate );
diff --git a/sc/source/filter/inc/excimp8.hxx b/sc/source/filter/inc/excimp8.hxx
index 1c8cef4db240..720dcee70cc9 100644
--- a/sc/source/filter/inc/excimp8.hxx
+++ b/sc/source/filter/inc/excimp8.hxx
@@ -38,7 +38,7 @@ public:
                             ImportExcel8( XclImpRootData& rImpData, SvStream& rStrm );
     virtual                 ~ImportExcel8() override;
 
-    virtual FltError        Read() override;
+    virtual ErrCode         Read() override;
 
     void                    Calccount();              // 0x0C
     void                    Precision();              // 0x0E
diff --git a/sc/source/filter/inc/exp_op.hxx b/sc/source/filter/inc/exp_op.hxx
index 42ee70d2ed74..f02431819ab6 100644
--- a/sc/source/filter/inc/exp_op.hxx
+++ b/sc/source/filter/inc/exp_op.hxx
@@ -46,7 +46,7 @@ public:
                             pD = pDoc;
                         }
 
-    virtual FltError    Write() = 0;
+    virtual ErrCode     Write() = 0;
 };
 
 class ExportBiff5 : public ExportTyp, protected XclExpRoot
@@ -61,7 +61,7 @@ protected:
 public:
                         ExportBiff5( XclExpRootData& rExpData, SvStream& rStrm );
     virtual             ~ExportBiff5() override;
-    FltError            Write() override;
+    ErrCode             Write() override;
 };
 
 class ExportBiff8 : public ExportBiff5
diff --git a/sc/source/filter/inc/ftools.hxx b/sc/source/filter/inc/ftools.hxx
index c1403dea28f1..faf22680d450 100644
--- a/sc/source/filter/inc/ftools.hxx
+++ b/sc/source/filter/inc/ftools.hxx
@@ -263,18 +263,18 @@ public:
     ScFormatFilterPluginImpl();
     virtual ~ScFormatFilterPluginImpl();
     // various import filters
-    virtual FltError ScImportLotus123( SfxMedium&, ScDocument*, rtl_TextEncoding eSrc ) override;
-    virtual FltError ScImportQuattroPro(SvStream* pStream, ScDocument *pDoc) override;
-    virtual FltError ScImportExcel( SfxMedium&, ScDocument*, const EXCIMPFORMAT ) override;
+    virtual ErrCode ScImportLotus123( SfxMedium&, ScDocument*, rtl_TextEncoding eSrc ) override;
+    virtual ErrCode ScImportQuattroPro(SvStream* pStream, ScDocument *pDoc) override;
+    virtual ErrCode ScImportExcel( SfxMedium&, ScDocument*, const EXCIMPFORMAT ) override;
         // eFormat == EIF_AUTO  -> matching filter is used automatically
         // eFormat == EIF_BIFF5 -> only Biff5 stream leads to success (even in an Excel97 doc)
         // eFormat == EIF_BIFF8 -> only Biff8 stream leads to success (only in Excel97 docs)
         // eFormat == EIF_BIFF_LE4 -> only non-storage files _could_ lead to success
-    virtual FltError ScImportStarCalc10( SvStream&, ScDocument* ) override;
-    virtual FltError ScImportDif( SvStream&, ScDocument*, const ScAddress& rInsPos,
+    virtual ErrCode ScImportStarCalc10( SvStream&, ScDocument* ) override;
+    virtual ErrCode ScImportDif( SvStream&, ScDocument*, const ScAddress& rInsPos,
                  const rtl_TextEncoding eSrc ) override;
-    virtual FltError ScImportRTF( SvStream&, const OUString& rBaseURL, ScDocument*, ScRange& rRange ) override;
-    virtual FltError ScImportHTML( SvStream&, const OUString& rBaseURL, ScDocument*, ScRange& rRange,
+    virtual ErrCode ScImportRTF( SvStream&, const OUString& rBaseURL, ScDocument*, ScRange& rRange ) override;
+    virtual ErrCode ScImportHTML( SvStream&, const OUString& rBaseURL, ScDocument*, ScRange& rRange,
                                    double nOutputFactor, bool bCalcWidthHeight,
                                    SvNumberFormatter* pFormatter = nullptr, bool bConvertDate = true ) override;
 
@@ -283,7 +283,7 @@ public:
     virtual OUString       GetHTMLRangeNameList( ScDocument* pDoc, const OUString& rOrigName ) override;
 
     // various export filters
-    virtual FltError ScExportExcel5( SfxMedium&, ScDocument*, ExportFormatExcel eFormat, rtl_TextEncoding eDest ) override;
+    virtual ErrCode ScExportExcel5( SfxMedium&, ScDocument*, ExportFormatExcel eFormat, rtl_TextEncoding eDest ) override;
     virtual void ScExportDif( SvStream&, ScDocument*, const ScAddress& rOutPos, const rtl_TextEncoding eDest ) override;
     virtual void ScExportDif( SvStream&, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest ) override;
     virtual void ScExportHTML( SvStream&, const OUString& rBaseURL, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest, bool bAll,
diff --git a/sc/source/filter/inc/imp_op.hxx b/sc/source/filter/inc/imp_op.hxx
index 4a2dfafd51a0..a386ecc67389 100644
--- a/sc/source/filter/inc/imp_op.hxx
+++ b/sc/source/filter/inc/imp_op.hxx
@@ -52,7 +52,7 @@ public:
                         ImportTyp( ScDocument*, rtl_TextEncoding eSrc );
     virtual             ~ImportTyp();
 
-    virtual FltError    Read();
+    virtual ErrCode     Read();
 };
 
 class XclImpOutlineDataBuffer : protected XclImpRoot
@@ -201,7 +201,7 @@ public:
 
     virtual                 ~ImportExcel() override;
 
-    virtual FltError        Read() override;
+    virtual ErrCode         Read() override;
 };
 
 #endif
diff --git a/sc/source/filter/inc/lotimpop.hxx b/sc/source/filter/inc/lotimpop.hxx
index 54f45a1c5282..192871d35002 100644
--- a/sc/source/filter/inc/lotimpop.hxx
+++ b/sc/source/filter/inc/lotimpop.hxx
@@ -79,8 +79,8 @@ public:
 
     virtual             ~ImportLotus() override;
 
-    FltError            Read() override;
-    FltError            Read( SvStream& );                  // special for *.fm3-Dateien
+    ErrCode             Read() override;
+    ErrCode             Read( SvStream& );                  // special for *.fm3-Dateien
 };
 
 inline void ImportLotus::Read( ScAddress& rAddr )
diff --git a/sc/source/filter/inc/qpro.hxx b/sc/source/filter/inc/qpro.hxx
index 55e5e7ccd1bb..f3ad43299fc4 100644
--- a/sc/source/filter/inc/qpro.hxx
+++ b/sc/source/filter/inc/qpro.hxx
@@ -50,8 +50,8 @@ public:
     sal_uInt16 getLength() { return mnLength; }
     void readString( OUString &rString, sal_uInt16 nLength );
 
-    FltError import( ScDocument *pDoc );
-    FltError readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pStyle );
+    ErrCode import( ScDocument *pDoc );
+    ErrCode readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pStyle );
 };
 #endif
 
diff --git a/sc/source/filter/lotus/filter.cxx b/sc/source/filter/lotus/filter.cxx
index a66206082d0a..a6a843deec5c 100644
--- a/sc/source/filter/lotus/filter.cxx
+++ b/sc/source/filter/lotus/filter.cxx
@@ -36,7 +36,7 @@
 #include "fprogressbar.hxx"
 #include "lotfilter.hxx"
 
-static FltError
+static ErrCode
 generate_Opcodes(LotusContext &rContext, SvStream& aStream,
                   ScfStreamProgressBar& aPrgrsBar)
 {
@@ -54,9 +54,9 @@ generate_Opcodes(LotusContext &rContext, SvStream& aStream,
             pOps = LotusContext::pOpFkt123;
             nOps = FKT_LIMIT123;
         break;
-        case eWK3:      return eERR_NI;
-        case eWK_Error: return eERR_FORMAT;
-        default:        return eERR_UNKN_WK;
+        case eWK3:      return SCERR_IMPORT_NI;
+        case eWK_Error: return SCERR_IMPORT_FORMAT;
+        default:        return SCERR_IMPORT_UNKNOWN_WK;
      }
 
     // #i76299# seems that SvStream::IsEof() does not work correctly
@@ -72,7 +72,7 @@ generate_Opcodes(LotusContext &rContext, SvStream& aStream,
         if( nOpcode == LOTUS_EOF )
             rContext.bEOF = true;
         else if( nOpcode == LOTUS_FILEPASSWD )
-            return eERR_FILEPASSWD;
+            return SCERR_IMPORT_FILEPASSWD;
         else if( nOpcode < nOps )
             pOps[ nOpcode ] (rContext, aStream, nLength);
         else if (rContext.eTyp == eWK123 && nOpcode == LOTUS_PATTERN)
@@ -103,7 +103,7 @@ generate_Opcodes(LotusContext &rContext, SvStream& aStream,
 
     rContext.pDoc->CalcAfterLoad();
 
-    return eERR_OK;
+    return ERRCODE_NONE;
 }
 
 WKTYP ScanVersion(SvStream& aStream)
@@ -161,7 +161,7 @@ WKTYP ScanVersion(SvStream& aStream)
     return eWK_UNKNOWN;
 }
 
-FltError ScImportLotus123old(LotusContext& rContext, SvStream& aStream, ScDocument* pDocument, rtl_TextEncoding eSrc )
+ErrCode ScImportLotus123old(LotusContext& rContext, SvStream& aStream, ScDocument* pDocument, rtl_TextEncoding eSrc )
 {
     aStream.Seek( 0UL );
 
@@ -172,7 +172,7 @@ FltError ScImportLotus123old(LotusContext& rContext, SvStream& aStream, ScDocume
 
     // allocate memory
     if( !MemNew(rContext) )
-        return eERR_NOMEM;
+        return SCERR_IMPORT_OUTOFMEM;
 
     // initialize page format (only Tab 0!)
     // initialize page format; meaning: get defaults from SC TODO:
diff --git a/sc/source/filter/lotus/lotread.cxx b/sc/source/filter/lotus/lotread.cxx
index d23955b544ef..003b82d7c424 100644
--- a/sc/source/filter/lotus/lotread.cxx
+++ b/sc/source/filter/lotus/lotread.cxx
@@ -28,7 +28,7 @@
 
 class ScFormulaCell;
 
-FltError ImportLotus::Read()
+ErrCode ImportLotus::Read()
 {
     enum STATE
     {
@@ -44,7 +44,7 @@ FltError ImportLotus::Read()
     sal_uInt16          nSubType;
     sal_uInt16          nRecLen;
     sal_uInt32          nNextRec = 0UL;
-    FltError        eRet = eERR_OK;
+    ErrCode        eRet = ERRCODE_NONE;
 //  ScFormulaCell   *pLastFormCell;
 
     STATE           eAkt = S_START;
@@ -110,7 +110,7 @@ FltError ImportLotus::Read()
                 break;
 
                 case 0x0002:                            // PASSWORD
-                eRet = eERR_FILEPASSWD;
+                eRet = SCERR_IMPORT_FILEPASSWD;
                 eAkt = S_END;
                 break;
 
@@ -171,7 +171,7 @@ FltError ImportLotus::Read()
                 }
                 else
                 {
-                    eRet = eERR_FORMAT;
+                    eRet = SCERR_IMPORT_FORMAT;
                     eAkt = S_END;
                 }
             }
@@ -224,7 +224,7 @@ FltError ImportLotus::Read()
     return eRet;
 }
 
-FltError ImportLotus::Read(SvStream& rIn)
+ErrCode ImportLotus::Read(SvStream& rIn)
 {
     pIn = &rIn;
 
@@ -232,7 +232,7 @@ FltError ImportLotus::Read(SvStream& rIn)
     sal_uInt16          nOp;
     sal_uInt16          nRecLen;
     sal_uInt32          nNextRec = 0UL;
-    FltError        eRet = eERR_OK;
+    ErrCode             eRet = ERRCODE_NONE;
 
     nTab = 0;
     nExtTab = -1;
@@ -258,7 +258,7 @@ FltError ImportLotus::Read(SvStream& rIn)
                 if( nRecLen != 26 || !BofFm3() )
                 {
                     bRead = false;
-                    eRet = eERR_FORMAT;
+                    eRet = SCERR_IMPORT_FORMAT;
                 }
                 break;
 
diff --git a/sc/source/filter/lotus/lotus.cxx b/sc/source/filter/lotus/lotus.cxx
index 6afba99bdd4b..f9d6c8128765 100644
--- a/sc/source/filter/lotus/lotus.cxx
+++ b/sc/source/filter/lotus/lotus.cxx
@@ -28,7 +28,7 @@
 #include "filtopt.hxx"
 #include "ftools.hxx"
 
-FltError ScFormatFilterPluginImpl::ScImportLotus123( SfxMedium& rMedium, ScDocument* pDocument, rtl_TextEncoding eSrc )
+ErrCode ScFormatFilterPluginImpl::ScImportLotus123( SfxMedium& rMedium, ScDocument* pDocument, rtl_TextEncoding eSrc )
 {
     ScFilterOptions aFilterOpt;
     bool bWithWK3 = aFilterOpt.GetWK3Flag();
@@ -36,9 +36,9 @@ FltError ScFormatFilterPluginImpl::ScImportLotus123( SfxMedium& rMedium, ScDocum
     SvStream*           pStream = rMedium.GetInStream();
 
     if( !pStream )
-        return eERR_OPEN;
+        return SCERR_IMPORT_OPEN;
 
-    FltError            eRet;
+    ErrCode            eRet;
 
     pStream->Seek( 0UL );
 
@@ -67,7 +67,7 @@ FltError ScFormatFilterPluginImpl::ScImportLotus123( SfxMedium& rMedium, ScDocum
         return eRet;
     }
 
-    if( eRet != eERR_OK )
+    if( eRet != ERRCODE_NONE )
         return eRet;
 
     if (aContext.pLotusRoot->eFirstType == Lotus123Typ::WK3)
@@ -79,7 +79,7 @@ FltError ScFormatFilterPluginImpl::ScImportLotus123( SfxMedium& rMedium, ScDocum
         pStream = aMedium.GetInStream();
         if ( pStream )
         {
-            if( aLotusImport.Read( *pStream ) != eERR_OK )
+            if( aLotusImport.Read( *pStream ) != ERRCODE_NONE )
                 eRet = SCWARN_IMPORT_WRONG_FM3;
         }
         else
diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx
index 5b35e3b155c8..80107e1f6f32 100644
--- a/sc/source/filter/qpro/qpro.cxx
+++ b/sc/source/filter/qpro/qpro.cxx
@@ -34,9 +34,9 @@
 #include <tools/stream.hxx>
 #include <memory>
 
-FltError ScQProReader::readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pStyle )
+ErrCode ScQProReader::readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pStyle )
 {
-    FltError eRet = eERR_OK;
+    ErrCode eRet = ERRCODE_NONE;
     sal_uInt8  nCol, nDummy;
     sal_uInt16 nRow;
     sal_uInt16 nStyle;
@@ -44,7 +44,7 @@ FltError ScQProReader::readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pSt
 
     SAL_INFO("sc", "Read sheet " << nTab);
 
-    while( eERR_OK == eRet && !bEndOfSheet && nextRecord() )
+    while( ERRCODE_NONE == eRet && !bEndOfSheet && nextRecord() )
     {
         switch( getId() )
         {
@@ -61,7 +61,7 @@ FltError ScQProReader::readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pSt
                     pDoc->SetTextCell(ScAddress(nCol,nRow,nTab), aLabel);
                 }
                 else
-                    eRet = eERR_FORMAT;
+                    eRet = SCERR_IMPORT_FORMAT;
                 }
                 break;
 
@@ -106,7 +106,7 @@ FltError ScQProReader::readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pSt
 
                 QProToSc aConv(*mpStream, pDoc->GetSharedStringPool(), aAddr);
                 if (ConvErr::OK != aConv.Convert( pArray ))
-                    eRet = eERR_FORMAT;
+                    eRet = SCERR_IMPORT_FORMAT;
                 else
                 {
                     ScFormulaCell* pFormula = new ScFormulaCell(pDoc, aAddr, *pArray);
@@ -123,10 +123,10 @@ FltError ScQProReader::readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pSt
     return eRet;
 }
 
-FltError ScFormatFilterPluginImpl::ScImportQuattroPro(SvStream *pStream, ScDocument *pDoc)
+ErrCode ScFormatFilterPluginImpl::ScImportQuattroPro(SvStream *pStream, ScDocument *pDoc)
 {
     ScQProReader aReader(pStream);
-    FltError eRet = aReader.import( pDoc );
+    ErrCode eRet = aReader.import( pDoc );
     return eRet;
 }
 
@@ -151,20 +151,20 @@ ScQProReader::~ScQProReader()
 }
 
 
-FltError ScQProReader::import( ScDocument *pDoc )
+ErrCode ScQProReader::import( ScDocument *pDoc )
 {
-    FltError eRet = eERR_OK;
+    ErrCode eRet = ERRCODE_NONE;
     sal_uInt16 nVersion;
     sal_uInt16 i = 1, j = 1;
     SCTAB nTab = 0;
     SetEof( false );
 
     if( !recordsLeft() )
-        return eERR_OPEN;
+        return SCERR_IMPORT_OPEN;
 
     std::unique_ptr<ScQProStyle> pStyleElement( new ScQProStyle );
 
-    while( nextRecord() && eRet == eERR_OK)
+    while( nextRecord() && eRet == ERRCODE_NONE)
     {
         switch( getId() )
         {
@@ -212,7 +212,7 @@ FltError ScQProReader::import( ScDocument *pDoc )
                 if (nLen >= 4)
                     readString( aLabel, nLen - 4 );
                 else
-                    eRet = eERR_FORMAT;
+                    eRet = SCERR_IMPORT_FORMAT;
                 pStyleElement->setFontType( j, aLabel );
                 j++;
                 }
diff --git a/sc/source/filter/rtf/rtfimp.cxx b/sc/source/filter/rtf/rtfimp.cxx
index 000e3ab4d23e..bb269686b693 100644
--- a/sc/source/filter/rtf/rtfimp.cxx
+++ b/sc/source/filter/rtf/rtfimp.cxx
@@ -25,10 +25,10 @@
 #include "rtfparse.hxx"
 #include "ftools.hxx"
 
-FltError ScFormatFilterPluginImpl::ScImportRTF( SvStream &rStream, const OUString& rBaseURL, ScDocument *pDoc, ScRange& rRange )
+ErrCode ScFormatFilterPluginImpl::ScImportRTF( SvStream &rStream, const OUString& rBaseURL, ScDocument *pDoc, ScRange& rRange )
 {
     ScRTFImport aImp( pDoc, rRange );
-    FltError nErr = (FltError) aImp.Read( rStream, rBaseURL );
+    ErrCode nErr = (ErrCode) aImp.Read( rStream, rBaseURL );
     ScRange aR = aImp.GetRange();
     rRange.aEnd = aR.aEnd;
     aImp.WriteToDocument();
diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx
index 25f05968c553..7993aa325e77 100644
--- a/sc/source/filter/starcalc/scflt.cxx
+++ b/sc/source/filter/starcalc/scflt.cxx
@@ -2399,11 +2399,11 @@ void Sc10Import::LoadObjects()
     }
 }
 
-FltError ScFormatFilterPluginImpl::ScImportStarCalc10( SvStream& rStream, ScDocument* pDocument )
+ErrCode ScFormatFilterPluginImpl::ScImportStarCalc10( SvStream& rStream, ScDocument* pDocument )
 {
     rStream.Seek( 0UL );
     Sc10Import  aImport( rStream, pDocument );
-    return ( FltError ) aImport.Import();
+    return ( ErrCode ) aImport.Import();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index a1011779ea2f..0ece2cf55594 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1093,8 +1093,8 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
             SvStream* pStream = rMedium.GetInStream();
             if (pStream)
             {
-                FltError eError = ScFormatFilter::Get().ScImportStarCalc10( *pStream, &aDocument );
-                if (eError != eERR_OK)
+                ErrCode eError = ScFormatFilter::Get().ScImportStarCalc10( *pStream, &aDocument );
+                if (eError != ERRCODE_NONE)
                 {
                     if (!GetError())
                         SetError(eError);
@@ -1121,9 +1121,9 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                 sItStr = ScGlobal::GetCharsetString( RTL_TEXTENCODING_IBM_437 );
             }
 
-            FltError eError = ScFormatFilter::Get().ScImportLotus123( rMedium, &aDocument,
+            ErrCode eError = ScFormatFilter::Get().ScImportLotus123( rMedium, &aDocument,
                                                 ScGlobal::GetCharsetValue(sItStr));
-            if (eError != eERR_OK)
+            if (eError != ERRCODE_NONE)
             {
                 if (!GetError())
                     SetError(eError);
@@ -1152,7 +1152,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
 
             MakeDrawLayer(); //! In the filter
             CalcOutputFactor(); // prepare update of row height
-            FltError eError = ScFormatFilter::Get().ScImportExcel( rMedium, &aDocument, eFormat );
+            ErrCode eError = ScFormatFilter::Get().ScImportExcel( rMedium, &aDocument, eFormat );
             aDocument.UpdateFontCharSet();
             if ( aDocument.IsChartListenerCollectionNeedsUpdate() )
                 aDocument.UpdateChartListenerCollection(); //! For all imports?
@@ -1166,7 +1166,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                     SetError(eError);
                 bRet = true;
             }
-            else if (eError != eERR_OK)
+            else if (eError != ERRCODE_NONE)
             {
                 if (!GetError())
                     SetError(eError);
@@ -1206,7 +1206,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                 aOptions.SetTextSep( '"' );
             }
 
-            FltError eError = eERR_OK;
+            ErrCode eError = ERRCODE_NONE;
             bool bOverflowRow, bOverflowCol, bOverflowCell;
             bOverflowRow = bOverflowCol = bOverflowCell = false;
 
@@ -1221,7 +1221,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                     pInStream->SetStreamCharSet( aOptions.GetCharSet() );
                     pInStream->Seek( 0 );
                     bRet = aImpEx.ImportStream( *pInStream, rMedium.GetBaseURL(), SotClipboardFormatId::STRING );
-                    eError = bRet ? eERR_OK : SCERR_IMPORT_CONNECT;
+                    eError = bRet ? ERRCODE_NONE : SCERR_IMPORT_CONNECT;
                     aDocument.StartAllListeners();
                     sc::SetFormulaDirtyContext aCxt;
                     aDocument.SetAllFormulasDirty(aCxt);
@@ -1248,7 +1248,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                 }
             }
 
-            if (eError != eERR_OK)
+            if (eError != ERRCODE_NONE)
             {
                 if (!GetError())
                     SetError(eError);
@@ -1256,7 +1256,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
             else if (!GetError() && (bOverflowRow || bOverflowCol || bOverflowCell))
             {
                 // precedence: row, column, cell
-                FltError nWarn = (bOverflowRow ? SCWARN_IMPORT_ROW_OVERFLOW :
+                ErrCode nWarn = (bOverflowRow ? SCWARN_IMPORT_ROW_OVERFLOW :
                         (bOverflowCol ? SCWARN_IMPORT_COLUMN_OVERFLOW :
                          SCWARN_IMPORT_CELL_OVERFLOW));
                 SetError(nWarn);
@@ -1288,7 +1288,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                     ScGlobal::GetCharsetValue(sItStr), aColWidthParam, *aRecalcRanges.mpRanges );
             aRecalcRowRangesArray.push_back(aRecalcRanges);
 
-            if (eError != eERR_OK)
+            if (eError != ERRCODE_NONE)
             {
                 if (!GetError())
                     SetError(eError);
@@ -1306,7 +1306,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
             SvStream* pStream = rMedium.GetInStream();
             if (pStream)
             {
-                FltError eError;
+                ErrCode eError;
                 OUString sItStr;
                 SfxItemSet*  pSet = rMedium.GetItemSet();
                 const SfxPoolItem* pItem;
@@ -1326,7 +1326,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
 
                 eError = ScFormatFilter::Get().ScImportDif( *pStream, &aDocument, ScAddress(0,0,0),
                                     ScGlobal::GetCharsetValue(sItStr));
-                if (eError != eERR_OK)
+                if (eError != ERRCODE_NONE)
                 {
                     if (!GetError())
                         SetError(eError);
@@ -1343,7 +1343,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
         }
         else if (aFltName == pFilterSylk)
         {
-            FltError eError = SCERR_IMPORT_UNKNOWN;
+            ErrCode eError = SCERR_IMPORT_UNKNOWN;
             if( !rMedium.IsStorage() )
             {
                 ScImportExport aImpEx( &aDocument );
@@ -1353,7 +1353,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                 {
                     pInStream->Seek( 0 );
                     bRet = aImpEx.ImportStream( *pInStream, rMedium.GetBaseURL(), SotClipboardFormatId::SYLK );
-                    eError = bRet ? eERR_OK : SCERR_IMPORT_UNKNOWN;
+                    eError = bRet ? ERRCODE_NONE : SCERR_IMPORT_UNKNOWN;
                     aDocument.StartAllListeners();
                     sc::SetFormulaDirtyContext aCxt;
                     aDocument.SetAllFormulasDirty(aCxt);
@@ -1364,7 +1364,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                 }
             }
 
-            if ( eError != eERR_OK && !GetError() )
+            if ( eError != ERRCODE_NONE && !GetError() )
                 SetError(eError);
             bSetColWidths = true;
             bSetSimpleTextColWidths = true;
@@ -1372,8 +1372,8 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
         }
         else if (aFltName == pFilterQPro6)
         {
-            FltError eError = ScFormatFilter::Get().ScImportQuattroPro(rMedium.GetInStream(), &aDocument);
-            if (eError != eERR_OK)
+            ErrCode eError = ScFormatFilter::Get().ScImportQuattroPro(rMedium.GetInStream(), &aDocument);
+            if (eError != ERRCODE_NONE)
             {
                 if (!GetError())
                     SetError(eError);
@@ -1390,7 +1390,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
         }
         else if (aFltName == pFilterRtf)
         {
-            FltError eError = SCERR_IMPORT_UNKNOWN;
+            ErrCode eError = SCERR_IMPORT_UNKNOWN;
             if( !rMedium.IsStorage() )
             {
                 SvStream* pInStream = rMedium.GetInStream();
@@ -1399,7 +1399,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                     pInStream->Seek( 0 );
                     ScRange aRange;
                     eError = ScFormatFilter::Get().ScImportRTF( *pInStream, rMedium.GetBaseURL(), &aDocument, aRange );
-                    if (eError != eERR_OK)
+                    if (eError != ERRCODE_NONE)
                     {
                         if (!GetError())
                             SetError(eError);
@@ -1421,12 +1421,12 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                 }
             }
 
-            if ( eError != eERR_OK && !GetError() )
+            if ( eError != ERRCODE_NONE && !GetError() )
                 SetError(eError);
         }
         else if (aFltName == pFilterHtml || aFltName == pFilterHtmlWebQ)
         {
-            FltError eError = SCERR_IMPORT_UNKNOWN;
+            ErrCode eError = SCERR_IMPORT_UNKNOWN;
             bool bWebQuery = aFltName == pFilterHtmlWebQ;
             if( !rMedium.IsStorage() )
             {
@@ -1451,7 +1451,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                     SvNumberFormatter aNumFormatter( comphelper::getProcessComponentContext(), eLang);
                     eError = ScFormatFilter::Get().ScImportHTML( *pInStream, rMedium.GetBaseURL(), &aDocument, aRange,
                                             GetOutputFactor(), !bWebQuery, &aNumFormatter, bDateConvert );
-                    if (eError != eERR_OK)
+                    if (eError != ERRCODE_NONE)
                     {
                         if (!GetError())
                             SetError(eError);
@@ -1472,7 +1472,7 @@ bool ScDocShell::ConvertFrom( SfxMedium& rMedium )
                 }
             }
 
-            if ( eError != eERR_OK && !GetError() )
+            if ( eError != ERRCODE_NONE && !GetError() )
                 SetError(eError);
         }
         else
@@ -2282,13 +2282,13 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
             ExportFormatExcel eFormat = ExpBiff5;
             if( aFltName == pFilterExcel97 || aFltName == pFilterEx97Temp )
                 eFormat = ExpBiff8;
-            FltError eError = ScFormatFilter::Get().ScExportExcel5( rMed, &aDocument, eFormat, RTL_TEXTENCODING_MS_1252 );
+            ErrCode eError = ScFormatFilter::Get().ScExportExcel5( rMed, &aDocument, eFormat, RTL_TEXTENCODING_MS_1252 );
 
             if( eError && !GetError() )
                 SetError(eError);
 
             // don't return false for warnings
-            bRet = ((eError & ERRCODE_WARNING_MASK) == ERRCODE_WARNING_MASK) || (eError == eERR_OK);
+            bRet = ((eError & ERRCODE_WARNING_MASK) == ERRCODE_WARNING_MASK) || (eError == ERRCODE_NONE);
         }
         else
         {
@@ -2356,15 +2356,15 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
         sal_uLong eError = DBaseExport(
             rMed.GetPhysicalName(), ScGlobal::GetCharsetValue(sCharSet), bHasMemo);
 
-        if ( eError != eERR_OK && (eError & ERRCODE_WARNING_MASK) )
+        if ( eError != ERRCODE_NONE && (eError & ERRCODE_WARNING_MASK) )
         {
-            eError = eERR_OK;
+            eError = ERRCODE_NONE;
         }
 
         INetURLObject aTmpFile( rMed.GetPhysicalName(), INetProtocol::File );
         if ( bHasMemo )
             aTmpFile.setExtension("dbt");
-        if ( eError != eERR_OK )
+        if ( eError != ERRCODE_NONE )
         {
             if (!GetError())
                 SetError(eError);
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 5ee969c56bc7..fe715fa66cf6 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -299,7 +299,7 @@ sal_uLong ScDocShell::DBaseImport( const OUString& rFullFileName, rtl_TextEncodi
     return ERRCODE_IO_GENERAL;
 #else
 
-    sal_uLong nErr = eERR_OK;
+    sal_uLong nErr = ERRCODE_NONE;
 
     // Try to get the Text Encoding from the driver
     if( eCharSet == RTL_TEXTENCODING_IBM_850 )
@@ -768,7 +768,7 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncodi
     INetURLObject aDeleteObj( rFullFileName, INetProtocol::File );
     KillFile( aDeleteObj );
 
-    sal_uLong nErr = eERR_OK;
+    sal_uLong nErr = ERRCODE_NONE;
 
     SCCOL nFirstCol, nLastCol;
     SCROW  nFirstRow, nLastRow;
@@ -952,7 +952,7 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncodi
                     case sdbc::DataType::VARCHAR:
                         aString = aDocument.GetString(nDocCol, nDocRow, nTab);
                         xRowUpdate->updateString( nCol+1, aString );
-                        if ( nErr == eERR_OK && pColLengths[nCol] < aString.getLength() )
+                        if ( nErr == ERRCODE_NONE && pColLengths[nCol] < aString.getLength() )
                             nErr = SCWARN_EXPORT_DATALOST;
                         break;
 
@@ -966,7 +966,7 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncodi
                             if ( bIsNull )
                             {
                                 xRowUpdate->updateNull( nCol+1 );
-                                if ( nErr == eERR_OK &&
+                                if ( nErr == ERRCODE_NONE &&
                                         aDocument.HasStringData( nDocCol, nDocRow, nTab ) )
                                     nErr = SCWARN_EXPORT_DATALOST;
                             }
@@ -982,7 +982,7 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncodi
                     case sdbc::DataType::DECIMAL:
                     case sdbc::DataType::BIT:
                         aDocument.GetValue( nDocCol, nDocRow, nTab, fVal );
-                        if ( fVal == 0.0 && nErr == eERR_OK &&
+                        if ( fVal == 0.0 && nErr == ERRCODE_NONE &&
                                             aDocument.HasStringData( nDocCol, nDocRow, nTab ) )
                             nErr = SCWARN_EXPORT_DATALOST;
                         if ( pColTypes[nCol] == sdbc::DataType::BIT )
@@ -993,7 +993,7 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncodi
 
                     default:
                         OSL_FAIL( "ScDocShell::DBaseExport: unknown FieldType" );
-                        if ( nErr == eERR_OK )
+                        if ( nErr == ERRCODE_NONE )
                             nErr = SCWARN_EXPORT_DATALOST;
                         aDocument.GetValue( nDocCol, nDocRow, nTab, fVal );
                         xRowUpdate->updateDouble( nCol+1, fVal );
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 8541cc06e988..936fdcf0e9b3 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -2216,20 +2216,20 @@ class ScFormatFilterMissing : public ScFormatFilterPlugin {
       OSL_FAIL("Missing file filters");
     }
     virtual ~ScFormatFilterMissing() {}
-    virtual FltError ScImportLotus123( SfxMedium&, ScDocument*, rtl_TextEncoding ) override { return eERR_INTERN; }
-    virtual FltError ScImportQuattroPro(SvStream*, ScDocument *) override { return eERR_INTERN; }
-    virtual FltError ScImportExcel( SfxMedium&, ScDocument*, const EXCIMPFORMAT ) override { return eERR_INTERN; }
-    virtual FltError ScImportStarCalc10( SvStream&, ScDocument* ) override { return eERR_INTERN; }
-    virtual FltError ScImportDif( SvStream&, ScDocument*, const ScAddress&,
-                 const rtl_TextEncoding ) override { return eERR_INTERN; }
-    virtual FltError ScImportRTF( SvStream&, const OUString&, ScDocument*, ScRange& ) override { return eERR_INTERN; }
-    virtual FltError ScImportHTML( SvStream&, const OUString&, ScDocument*, ScRange&, double, bool, SvNumberFormatter*, bool ) override { return eERR_INTERN; }
+    virtual ErrCode ScImportLotus123( SfxMedium&, ScDocument*, rtl_TextEncoding ) override { return SCERR_IMPORT_INTERNAL; }
+    virtual ErrCode ScImportQuattroPro( SvStream*, ScDocument* ) override { return SCERR_IMPORT_INTERNAL; }
+    virtual ErrCode ScImportExcel( SfxMedium&, ScDocument*, const EXCIMPFORMAT ) override { return SCERR_IMPORT_INTERNAL; }
+    virtual ErrCode ScImportStarCalc10( SvStream&, ScDocument* ) override { return SCERR_IMPORT_INTERNAL; }
+    virtual ErrCode ScImportDif( SvStream&, ScDocument*, const ScAddress&,
+                 const rtl_TextEncoding ) override { return SCERR_IMPORT_INTERNAL; }
+    virtual ErrCode ScImportRTF( SvStream&, const OUString&, ScDocument*, ScRange& ) override { return SCERR_IMPORT_INTERNAL; }
+    virtual ErrCode ScImportHTML( SvStream&, const OUString&, ScDocument*, ScRange&, double, bool, SvNumberFormatter*, bool ) override { return SCERR_IMPORT_INTERNAL; }
 
     virtual ScEEAbsImport *CreateRTFImport( ScDocument*, const ScRange& ) override { return nullptr; }
     virtual ScEEAbsImport *CreateHTMLImport( ScDocument*, const OUString&, const ScRange& ) override { return nullptr; }
     virtual OUString       GetHTMLRangeNameList( ScDocument*, const OUString& ) override { return OUString(); }
 
-    virtual FltError ScExportExcel5( SfxMedium&, ScDocument*, ExportFormatExcel, rtl_TextEncoding ) override { return eERR_INTERN; }
+    virtual ErrCode ScExportExcel5( SfxMedium&, ScDocument*, ExportFormatExcel, rtl_TextEncoding ) override { return SCERR_IMPORT_INTERNAL; }
     virtual void ScExportDif( SvStream&, ScDocument*, const ScAddress&, const rtl_TextEncoding ) override {}
     virtual void ScExportDif( SvStream&, ScDocument*, const ScRange&, const rtl_TextEncoding ) override {}
     virtual void ScExportHTML( SvStream&, const OUString&, ScDocument*, const ScRange&, const rtl_TextEncoding, bool,
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index bc22f1f9caf5..a4c955d16478 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -538,8 +538,8 @@ bool ScViewFunc::PasteDataFormat( SotClipboardFormatId nFormatId,
 
             SfxMedium aMed;
             aMed.GetItemSet()->Put( SfxUsrAnyItem( SID_INPUTSTREAM, uno::makeAny( xStm ) ) );
-            FltError eErr = ScFormatFilter::Get().ScImportExcel( aMed, pInsDoc, EIF_AUTO );
-            if ( eErr == eERR_OK )
+            ErrCode eErr = ScFormatFilter::Get().ScImportExcel( aMed, pInsDoc, EIF_AUTO );
+            if ( eErr == ERRCODE_NONE )
             {
                 ScRange aSource;
                 const ScExtDocOptions* pExtOpt = pInsDoc->GetExtDocOptions();


More information about the Libreoffice-commits mailing list