[Libreoffice-commits] core.git: Branch 'feature/configure-disable-orcus' - framework/source sc/Library_scfilt.mk sc/qa sc/source

Kohei Yoshida kohei.yoshida at collabora.com
Wed Sep 18 18:34:17 PDT 2013


 framework/source/loadenv/loadenv.cxx |   13 +++++++++++++
 sc/Library_scfilt.mk                 |   24 +++++++++++++++---------
 sc/qa/unit/helper/qahelper.cxx       |   13 +++++++++++++
 sc/source/filter/ftools/ftools.cxx   |    9 +++++++++
 sc/source/filter/html/htmlpars.cxx   |   10 ++++++++++
 sc/source/ui/view/cellsh2.cxx        |    7 +++++++
 sc/source/ui/view/tabvwshc.cxx       |    4 ++++
 7 files changed, 71 insertions(+), 9 deletions(-)

New commits:
commit fe823992e4fa388435189de41749d2b8bded59f7
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Sep 18 21:35:50 2013 -0400

    Disable all features that rely on orcus.
    
    Change-Id: I6dcf91491497cd9d3662adaeceb73b4b544a56c9

diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index effa1d3..1767133 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -86,6 +86,8 @@
 #include "rtl/bootstrap.hxx"
 #include <vcl/svapp.hxx>
 
+#include <config_orcus.h>
+
 const char PROP_TYPES[] = "Types";
 const char PROP_NAME[] = "Name";
 
@@ -711,6 +713,8 @@ LoadEnv::EContentType LoadEnv::classifyContent(const OUString&
 
 namespace {
 
+#if ENABLE_ORCUS
+
 bool queryOrcusTypeAndFilter(const uno::Sequence<beans::PropertyValue>& rDescriptor, OUString& rType, OUString& rFilter)
 {
     // depending on the experimental mode
@@ -775,6 +779,15 @@ bool queryOrcusTypeAndFilter(const uno::Sequence<beans::PropertyValue>& rDescrip
     return false;
 }
 
+#else
+
+bool queryOrcusTypeAndFilter(const uno::Sequence<beans::PropertyValue>&, OUString&, OUString&)
+{
+    return false;
+}
+
+#endif
+
 }
 
 void LoadEnv::impl_detectTypeAndFilter()
diff --git a/sc/Library_scfilt.mk b/sc/Library_scfilt.mk
index 75ee0fe..ddd52a3 100644
--- a/sc/Library_scfilt.mk
+++ b/sc/Library_scfilt.mk
@@ -63,12 +63,6 @@ $(eval $(call gb_Library_use_libraries,scfilt,\
 	$(gb_UWINAPI) \
 ))
 
-$(eval $(call gb_Library_use_externals,scfilt,\
-	orcus \
-	orcus-parser \
-	zlib \
-))
-
 $(eval $(call gb_Library_add_exception_objects,scfilt,\
 	sc/source/filter/dif/difexp \
 	sc/source/filter/dif/difimp \
@@ -221,16 +215,28 @@ $(eval $(call gb_Library_add_exception_objects,scfilt,\
 	sc/source/filter/oox/worksheetfragment \
 	sc/source/filter/oox/worksheethelper \
 	sc/source/filter/oox/worksheetsettings \
-	sc/source/filter/orcus/interface \
-	sc/source/filter/orcus/orcusfiltersimpl \
-	sc/source/filter/orcus/xmlcontext \
 	sc/source/filter/services \
 ))
 
+ifeq ($(ENABLE_ORCUS),TRUE)
+$(eval $(call gb_Library_use_externals,scfilt,\
+	orcus \
+	orcus-parser \
+	zlib \
+))
+
 ifeq ($(SYSTEM_ZLIB),YES)
 $(eval $(call gb_Library_add_defs,scfilt,\
 	-DSYSTEM_ZLIB \
 ))
 endif
 
+$(eval $(call gb_Library_add_exception_objects,scfilt,\
+	sc/source/filter/orcus/interface \
+	sc/source/filter/orcus/orcusfiltersimpl \
+	sc/source/filter/orcus/xmlcontext \
+))
+
+endif
+
 # vim: set noet sw=4 ts=4:
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 33c8f04..8139363 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -15,10 +15,14 @@
 #include "svx/svdpage.hxx"
 #include "svx/svdoole2.hxx"
 
+#include <config_orcus.h>
+
+#if ENABLE_ORCUS
 #if defined WNT
 #define __ORCUS_STATIC_LIB
 #endif
 #include <orcus/csv_parser.hpp>
+#endif
 
 #include <fstream>
 
@@ -93,6 +97,8 @@ void loadFile(const OUString& aFileName, std::string& aContent)
     aContent = aOStream.str();
 }
 
+#if ENABLE_ORCUS
+
 void testFile(OUString& aFileName, ScDocument* pDoc, SCTAB nTab, StringType aStringFormat)
 {
     csv_handler aHandler(pDoc, nTab, aStringFormat);
@@ -142,6 +148,13 @@ void testCondFile(OUString& aFileName, ScDocument* pDoc, SCTAB nTab)
     }
 }
 
+#else
+
+void testFile(OUString&, ScDocument*, SCTAB, StringType) {}
+void testCondFile(OUString&, ScDocument*, SCTAB) {}
+
+#endif
+
 const SdrOle2Obj* getSingleChartObject(ScDocument& rDoc, sal_uInt16 nPage)
 {
     // Retrieve the chart object instance from the 2nd page (for the 2nd sheet).
diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx
index aab9afd..3623a7d 100644
--- a/sc/source/filter/ftools/ftools.cxx
+++ b/sc/source/filter/ftools/ftools.cxx
@@ -32,7 +32,12 @@
 #include "stlpool.hxx"
 #include "stlsheet.hxx"
 #include "compiler.hxx"
+
+#include <config_orcus.h>
+
+#if ENABLE_ORCUS
 #include "orcusfiltersimpl.hxx"
+#endif
 
 #include <stdio.h>
 
@@ -348,8 +353,12 @@ ScFormatFilterPluginImpl::~ScFormatFilterPluginImpl() {}
 
 ScOrcusFilters* ScFormatFilterPluginImpl::GetOrcusFilters()
 {
+#if ENABLE_ORCUS
     static ScOrcusFiltersImpl aImpl;
     return &aImpl;
+#else
+    return NULL;
+#endif
 }
 
 SAL_DLLPUBLIC_EXPORT ScFormatFilterPlugin * SAL_CALL ScFilterCreate(void)
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index fa89af0..9beb5c9 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -56,7 +56,9 @@
 #include "document.hxx"
 #include "rangelst.hxx"
 
+#if ENABLE_ORCUS
 #include <orcus/css_parser.hpp>
+#endif
 
 #include <com/sun/star/document/XDocumentProperties.hpp>
 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
@@ -3164,6 +3166,8 @@ void ScHTMLQueryParser::CloseTable( const ImportInfo& rInfo )
     mpCurrTable = mpCurrTable->CloseTable( rInfo );
 }
 
+#if ENABLE_ORCUS
+
 namespace {
 
 /**
@@ -3267,6 +3271,12 @@ void ScHTMLQueryParser::ParseStyle(const OUString& rStrm)
     }
 }
 
+#else
+
+void ScHTMLQueryParser::ParseStyle(const OUString&) {}
+
+#endif
+
 // ----------------------------------------------------------------------------
 
 IMPL_LINK( ScHTMLQueryParser, HTMLImportHdl, const ImportInfo*, pInfo )
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index a140318..9da5ace 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -59,6 +59,8 @@
 #include "queryentry.hxx"
 #include "markdata.hxx"
 
+#include <config_orcus.h>
+
 using namespace com::sun::star;
 
 static bool lcl_GetTextToColumnsRange( const ScViewData* pData, ScRange& rRange )
@@ -1142,6 +1144,11 @@ void ScCellShell::GetDBState( SfxItemSet& rSet )
                     }
                 }
                 break;
+#if !ENABLE_ORCUS
+            case SID_MANAGE_XML_SOURCE:
+                rSet.DisableItem(nWhich);
+            break;
+#endif
         }
         nWhich = aIter.NextWhich();
     }
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 309a3e0..1bc5dc4 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -68,6 +68,8 @@
 #include "CorrelationDialog.hxx"
 #include "CovarianceDialog.hxx"
 
+#include <config_orcus.h>
+
 //------------------------------------------------------------------
 
 void ScTabViewShell::SetCurRefDlgId( sal_uInt16 nNew )
@@ -397,7 +399,9 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
 
         case SID_MANAGE_XML_SOURCE:
         {
+#if ENABLE_ORCUS
             pResult = new ScXMLSourceDlg(pB, pCW, pParent, pDoc);
+#endif
         }
         break;
 


More information about the Libreoffice-commits mailing list