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

Tor Lillqvist tml at collabora.com
Fri Jun 30 18:29:35 UTC 2017


 sc/inc/filter.hxx                   |   39 +++++++++++++++++++-----------------
 sc/source/filter/dif/difexp.cxx     |    4 +--
 sc/source/filter/dif/difimp.cxx     |    2 -
 sc/source/filter/excel/excel.cxx    |    4 +--
 sc/source/filter/ftools/ftools.cxx  |    7 +-----
 sc/source/filter/html/htmlexp.cxx   |    2 -
 sc/source/filter/html/htmlimp.cxx   |    6 ++---
 sc/source/filter/inc/ftools.hxx     |   36 ---------------------------------
 sc/source/filter/lotus/lotus.cxx    |    2 -
 sc/source/filter/qpro/qpro.cxx      |    2 -
 sc/source/filter/rtf/rtfexp.cxx     |    2 -
 sc/source/filter/rtf/rtfimp.cxx     |    4 +--
 sc/source/filter/starcalc/scflt.cxx |    2 -
 13 files changed, 38 insertions(+), 74 deletions(-)

New commits:
commit cc0524a724d0a9b9516ce9eaf499d845165863f8
Author: Tor Lillqvist <tml at collabora.com>
Date:   Fri Jun 30 19:27:18 2017 +0300

    With ScFormatFilterMissing gone we don't need ScFormatFilterPluginImpl
    
    Change-Id: I01288c953dd02707d017bfba95459b83254ef963
    Reviewed-on: https://gerrit.libreoffice.org/39422
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/sc/inc/filter.hxx b/sc/inc/filter.hxx
index 04a0f4206985..efb83c2dcb7d 100644
--- a/sc/inc/filter.hxx
+++ b/sc/inc/filter.hxx
@@ -56,39 +56,42 @@ class ScEEAbsImport {
 };
 
 class SAL_DLLPUBLIC_RTTI ScFormatFilterPlugin {
+    // The member functions must be virtual for now even though this class has no derived classes,
+    // because of how this thing works.
   public:
+    ScFormatFilterPlugin() {};
+
     // various import filters
-    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;
+    virtual ErrCode ScImportLotus123( SfxMedium&, ScDocument*, rtl_TextEncoding eSrc );
+    virtual ErrCode ScImportQuattroPro(SvStream* pStream, ScDocument *pDoc);
+    virtual ErrCode ScImportExcel( SfxMedium&, ScDocument*, const EXCIMPFORMAT );
         // 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 ErrCode ScImportStarCalc10( SvStream&, ScDocument* ) = 0;
+    virtual ErrCode ScImportStarCalc10( SvStream&, ScDocument* );
     virtual ErrCode ScImportDif( SvStream&, ScDocument*, const ScAddress& rInsPos,
-                 const rtl_TextEncoding eSrc ) = 0;
-    virtual ErrCode ScImportRTF( SvStream&, const OUString& rBaseURL, ScDocument*, ScRange& rRange ) = 0;
+                                 const rtl_TextEncoding eSrc );
+    virtual ErrCode ScImportRTF( SvStream&, const OUString& rBaseURL, ScDocument*, ScRange& rRange );
     virtual ErrCode ScImportHTML( SvStream&, const OUString& rBaseURL, ScDocument*, ScRange& rRange, double nOutputFactor,
-                                   bool bCalcWidthHeight, SvNumberFormatter* pFormatter = nullptr, bool bConvertDate = true ) = 0;
+                                  bool bCalcWidthHeight, SvNumberFormatter* pFormatter = nullptr, bool bConvertDate = true );
 
     // various import helpers
-    virtual ScEEAbsImport *CreateRTFImport( ScDocument* pDoc, const ScRange& rRange ) = 0;
-    virtual ScEEAbsImport *CreateHTMLImport( ScDocument* pDocP, const OUString& rBaseURL, const ScRange& rRange ) = 0;
-    virtual OUString       GetHTMLRangeNameList( ScDocument* pDoc, const OUString& rOrigName ) = 0;
+    virtual ScEEAbsImport *CreateRTFImport( ScDocument* pDoc, const ScRange& rRange );
+    virtual ScEEAbsImport *CreateHTMLImport( ScDocument* pDocP, const OUString& rBaseURL, const ScRange& rRange );
+    virtual OUString       GetHTMLRangeNameList( ScDocument* pDoc, const OUString& rOrigName );
 
     // various export filters
-    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 ErrCode ScExportExcel5( SfxMedium&, ScDocument*, ExportFormatExcel eFormat, rtl_TextEncoding eDest );
+    virtual void ScExportDif( SvStream&, ScDocument*, const ScAddress& rOutPos, const rtl_TextEncoding eDest );
+    virtual void ScExportDif( SvStream&, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest );
     virtual void ScExportHTML( SvStream&, const OUString& rBaseURL, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest, bool bAll,
-                  const OUString& rStreamPath, OUString& rNonConvertibleChars, const OUString& rFilterOptions ) = 0;
-    virtual void ScExportRTF( SvStream&, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest ) = 0;
+                       const OUString& rStreamPath, OUString& rNonConvertibleChars, const OUString& rFilterOptions );
+    virtual void ScExportRTF( SvStream&, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest );
 
-    virtual ScOrcusFilters* GetOrcusFilters() = 0;
+    virtual ScOrcusFilters* GetOrcusFilters();
 
-protected:
-    ~ScFormatFilterPlugin() {}
+    virtual ~ScFormatFilterPlugin() {}
 };
 
 // scfilt plugin symbol
diff --git a/sc/source/filter/dif/difexp.cxx b/sc/source/filter/dif/difexp.cxx
index 4d0371285f0e..cb46e7342daa 100644
--- a/sc/source/filter/dif/difexp.cxx
+++ b/sc/source/filter/dif/difexp.cxx
@@ -33,7 +33,7 @@
 #include <osl/diagnose.h>
 #include <formula/errorcodes.hxx>
 
-void ScFormatFilterPluginImpl::ScExportDif( SvStream& rStream, ScDocument* pDoc,
+void ScFormatFilterPlugin::ScExportDif( SvStream& rStream, ScDocument* pDoc,
     const ScAddress& rOutPos, const rtl_TextEncoding eNach )
 {
     SCCOL       nEndCol;
@@ -47,7 +47,7 @@ void ScFormatFilterPluginImpl::ScExportDif( SvStream& rStream, ScDocument* pDoc,
     ScExportDif( rStream, pDoc, ScRange( aStart, aEnd ), eNach );
 }
 
-void ScFormatFilterPluginImpl::ScExportDif( SvStream& rOut, ScDocument* pDoc,
+void ScFormatFilterPlugin::ScExportDif( SvStream& rOut, ScDocument* pDoc,
     const ScRange&rRange, const rtl_TextEncoding eCharSet )
 {
     OSL_ENSURE( rRange.aStart <= rRange.aEnd, "*ScExportDif(): Range not sorted!" );
diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx
index 49bd02fb339c..777759148c3d 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 };
 
-ErrCode ScFormatFilterPluginImpl::ScImportDif(SvStream& rIn, ScDocument* pDoc, const ScAddress& rInsPos,
+ErrCode ScFormatFilterPlugin::ScImportDif(SvStream& rIn, ScDocument* pDoc, const ScAddress& rInsPos,
                         const rtl_TextEncoding eVon )
 {
     DifParser   aDifParser( rIn, *pDoc, eVon );
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx
index b6087bf30715..9451fd915fc0 100644
--- a/sc/source/filter/excel/excel.cxx
+++ b/sc/source/filter/excel/excel.cxx
@@ -45,7 +45,7 @@
 
 #include <memory>
 
-ErrCode ScFormatFilterPluginImpl::ScImportExcel( SfxMedium& rMedium, ScDocument* pDocument, const EXCIMPFORMAT eFormat )
+ErrCode ScFormatFilterPlugin::ScImportExcel( SfxMedium& rMedium, ScDocument* pDocument, const EXCIMPFORMAT eFormat )
 {
     // check the passed Calc document
     OSL_ENSURE( pDocument, "::ScImportExcel - no document" );
@@ -197,7 +197,7 @@ static ErrCode lcl_ExportExcelBiff( SfxMedium& rMedium, ScDocument *pDocument,
     return eRet;
 }
 
-ErrCode ScFormatFilterPluginImpl::ScExportExcel5( SfxMedium& rMedium, ScDocument *pDocument,
+ErrCode ScFormatFilterPlugin::ScExportExcel5( SfxMedium& rMedium, ScDocument *pDocument,
     ExportFormatExcel eFormat, rtl_TextEncoding eNach )
 {
     if( eFormat != ExpBiff5 && eFormat != ExpBiff8 )
diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx
index e3ebc5597730..691e0571d9cd 100644
--- a/sc/source/filter/ftools/ftools.cxx
+++ b/sc/source/filter/ftools/ftools.cxx
@@ -349,10 +349,7 @@ bool ScfTools::GetHTMLNameFromName( const OUString& rSource, OUString& rName )
     return !rName.isEmpty();
 }
 
-ScFormatFilterPluginImpl::ScFormatFilterPluginImpl() {}
-ScFormatFilterPluginImpl::~ScFormatFilterPluginImpl() {}
-
-ScOrcusFilters* ScFormatFilterPluginImpl::GetOrcusFilters()
+ScOrcusFilters* ScFormatFilterPlugin::GetOrcusFilters()
 {
     static ScOrcusFiltersImpl aImpl;
     return &aImpl;
@@ -360,7 +357,7 @@ ScOrcusFilters* ScFormatFilterPluginImpl::GetOrcusFilters()
 
 ScFormatFilterPlugin * SAL_CALL ScFilterCreate()
 {
-    return new ScFormatFilterPluginImpl();
+    return new ScFormatFilterPlugin();
 }
 
 // implementation class inside the filters
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index 5eef8b5a167f..727754e5b3c6 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -125,7 +125,7 @@ const sal_Char ScHTMLExport::sIndentSource[nIndentMax+1] =
 
 #define GLOBSTR(id) ScGlobal::GetRscString( id )
 
-void ScFormatFilterPluginImpl::ScExportHTML( SvStream& rStrm, const OUString& rBaseURL, ScDocument* pDoc,
+void ScFormatFilterPlugin::ScExportHTML( SvStream& rStrm, const OUString& rBaseURL, ScDocument* pDoc,
         const ScRange& rRange, const rtl_TextEncoding /*eNach*/, bool bAll,
         const OUString& rStreamPath, OUString& rNonConvertibleChars, const OUString& rFilterOptions )
 {
diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx
index 5dc06c5a8054..ff0b69c6f95c 100644
--- a/sc/source/filter/html/htmlimp.cxx
+++ b/sc/source/filter/html/htmlimp.cxx
@@ -42,7 +42,7 @@
 #include "ftools.hxx"
 #include "tokenarray.hxx"
 
-ErrCode ScFormatFilterPluginImpl::ScImportHTML( SvStream &rStream, const OUString& rBaseURL, ScDocument *pDoc,
+ErrCode ScFormatFilterPlugin::ScImportHTML( SvStream &rStream, const OUString& rBaseURL, ScDocument *pDoc,
         ScRange& rRange, double nOutputFactor, bool bCalcWidthHeight, SvNumberFormatter* pFormatter,
         bool bConvertDate )
 {
@@ -54,7 +54,7 @@ ErrCode ScFormatFilterPluginImpl::ScImportHTML( SvStream &rStream, const OUStrin
     return nErr;
 }
 
-ScEEAbsImport *ScFormatFilterPluginImpl::CreateHTMLImport( ScDocument* pDocP, const OUString& rBaseURL, const ScRange& rRange )
+ScEEAbsImport *ScFormatFilterPlugin::CreateHTMLImport( ScDocument* pDocP, const OUString& rBaseURL, const ScRange& rRange )
 {
     return new ScHTMLImport( pDocP, rBaseURL, rRange, true/*bCalcWidthHeight*/ );
 }
@@ -191,7 +191,7 @@ void ScHTMLImport::WriteToDocument(
     }
 }
 
-OUString ScFormatFilterPluginImpl::GetHTMLRangeNameList( ScDocument* pDoc, const OUString& rOrigName )
+OUString ScFormatFilterPlugin::GetHTMLRangeNameList( ScDocument* pDoc, const OUString& rOrigName )
 {
     return ScHTMLImport::GetHTMLRangeNameList( pDoc, rOrigName );
 }
diff --git a/sc/source/filter/inc/ftools.hxx b/sc/source/filter/inc/ftools.hxx
index faf22680d450..c8b88271fe12 100644
--- a/sc/source/filter/inc/ftools.hxx
+++ b/sc/source/filter/inc/ftools.hxx
@@ -257,42 +257,6 @@ typedef ::std::vector< sal_Int32 >                  ScfInt32Vec;
 typedef ::std::vector< sal_uInt32 >                 ScfUInt32Vec;
 typedef ::std::vector< OUString >            ScfStringVec;
 
-class ScFormatFilterPluginImpl : public ScFormatFilterPlugin
-{
-public:
-    ScFormatFilterPluginImpl();
-    virtual ~ScFormatFilterPluginImpl();
-    // various import filters
-    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 ErrCode ScImportStarCalc10( SvStream&, ScDocument* ) override;
-    virtual ErrCode ScImportDif( SvStream&, ScDocument*, const ScAddress& rInsPos,
-                 const rtl_TextEncoding eSrc ) override;
-    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;
-
-    virtual ScEEAbsImport *CreateRTFImport( ScDocument* pDoc, const ScRange& rRange ) override;
-    virtual ScEEAbsImport *CreateHTMLImport( ScDocument* pDocP, const OUString& rBaseURL, const ScRange& rRange ) override;
-    virtual OUString       GetHTMLRangeNameList( ScDocument* pDoc, const OUString& rOrigName ) override;
-
-    // various export filters
-    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,
-                  const OUString& rStreamPath, OUString& rNonConvertibleChars, const OUString& rFilterOptions ) override;
-    virtual void ScExportRTF( SvStream&, ScDocument*, const ScRange& rRange, const rtl_TextEncoding eDest ) override;
-
-    virtual ScOrcusFilters* GetOrcusFilters() override;
-};
-
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/filter/lotus/lotus.cxx b/sc/source/filter/lotus/lotus.cxx
index 8a7c8493225b..574eb9d8c86d 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"
 
-ErrCode ScFormatFilterPluginImpl::ScImportLotus123( SfxMedium& rMedium, ScDocument* pDocument, rtl_TextEncoding eSrc )
+ErrCode ScFormatFilterPlugin::ScImportLotus123( SfxMedium& rMedium, ScDocument* pDocument, rtl_TextEncoding eSrc )
 {
     ScFilterOptions aFilterOpt;
     bool bWithWK3 = aFilterOpt.GetWK3Flag();
diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx
index 80107e1f6f32..c2c119ce05f7 100644
--- a/sc/source/filter/qpro/qpro.cxx
+++ b/sc/source/filter/qpro/qpro.cxx
@@ -123,7 +123,7 @@ ErrCode ScQProReader::readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pSty
     return eRet;
 }
 
-ErrCode ScFormatFilterPluginImpl::ScImportQuattroPro(SvStream *pStream, ScDocument *pDoc)
+ErrCode ScFormatFilterPlugin::ScImportQuattroPro(SvStream *pStream, ScDocument *pDoc)
 {
     ScQProReader aReader(pStream);
     ErrCode eRet = aReader.import( pDoc );
diff --git a/sc/source/filter/rtf/rtfexp.cxx b/sc/source/filter/rtf/rtfexp.cxx
index 44e8629f9110..055e577f18e9 100644
--- a/sc/source/filter/rtf/rtfexp.cxx
+++ b/sc/source/filter/rtf/rtfexp.cxx
@@ -42,7 +42,7 @@
 #include "stlpool.hxx"
 #include "ftools.hxx"
 
-void ScFormatFilterPluginImpl::ScExportRTF( SvStream& rStrm, ScDocument* pDoc,
+void ScFormatFilterPlugin::ScExportRTF( SvStream& rStrm, ScDocument* pDoc,
         const ScRange& rRange, const rtl_TextEncoding /*eNach*/ )
 {
     ScRTFExport aEx( rStrm, pDoc, rRange );
diff --git a/sc/source/filter/rtf/rtfimp.cxx b/sc/source/filter/rtf/rtfimp.cxx
index ecd86a537846..ddadd1c12627 100644
--- a/sc/source/filter/rtf/rtfimp.cxx
+++ b/sc/source/filter/rtf/rtfimp.cxx
@@ -25,7 +25,7 @@
 #include "rtfparse.hxx"
 #include "ftools.hxx"
 
-ErrCode ScFormatFilterPluginImpl::ScImportRTF( SvStream &rStream, const OUString& rBaseURL, ScDocument *pDoc, ScRange& rRange )
+ErrCode ScFormatFilterPlugin::ScImportRTF( SvStream &rStream, const OUString& rBaseURL, ScDocument *pDoc, ScRange& rRange )
 {
     ScRTFImport aImp( pDoc, rRange );
     ErrCode nErr = aImp.Read( rStream, rBaseURL );
@@ -35,7 +35,7 @@ ErrCode ScFormatFilterPluginImpl::ScImportRTF( SvStream &rStream, const OUString
     return nErr;
 }
 
-ScEEAbsImport *ScFormatFilterPluginImpl::CreateRTFImport( ScDocument* pDoc, const ScRange& rRange )
+ScEEAbsImport *ScFormatFilterPlugin::CreateRTFImport( ScDocument* pDoc, const ScRange& rRange )
 {
     return new ScRTFImport( pDoc, rRange );
 }
diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx
index c6b9b199a645..06e572453e96 100644
--- a/sc/source/filter/starcalc/scflt.cxx
+++ b/sc/source/filter/starcalc/scflt.cxx
@@ -2400,7 +2400,7 @@ void Sc10Import::LoadObjects()
     }
 }
 
-ErrCode ScFormatFilterPluginImpl::ScImportStarCalc10( SvStream& rStream, ScDocument* pDocument )
+ErrCode ScFormatFilterPlugin::ScImportStarCalc10( SvStream& rStream, ScDocument* pDocument )
 {
     rStream.Seek( 0UL );
     Sc10Import  aImport( rStream, pDocument );


More information about the Libreoffice-commits mailing list