RepositoryExternal.mk | 8 +++ config_host.mk.in | 1 config_host/config_orcus.h.in | 6 ++ configure.ac | 89 +++++++++++++++++++++-------------- framework/source/loadenv/loadenv.cxx | 13 +++++ liborcus/Module_liborcus.mk | 2 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 + 12 files changed, 142 insertions(+), 44 deletions(-)
New commits: commit 293413d13b620052bc795eef9387f0bd9a1846d7 Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Wed Sep 18 21:39:38 2013 -0400 Diable orcus on cygwin, OS X, iOS and Android by default. Change-Id: Ife2b2d00ba1439a10a61dca72a95e8cbcbd798eb diff --git a/configure.ac b/configure.ac index 141d0e1..93880f8 100644 --- a/configure.ac +++ b/configure.ac @@ -443,6 +443,7 @@ cygwin*|interix*|mingw32*) test_xrender=no test_freetype=no test_fontconfig=no + enable_orcus=no _os=WINNT DLLPOST=".dll" @@ -482,6 +483,7 @@ darwin*) # Mac OS X or iOS _os=Darwin fi enable_systray=no + enable_orcus=no # See comment above the case "$host_os" LINKFLAGSSHL="-dynamiclib -single_module" @@ -574,6 +576,7 @@ linux-android*) enable_opengl=no enable_lpsolve=no enable_report_builder=no + enable_orcus=no with_theme="tango" test_cups=no test_dbus=no commit 05dd2fb998de7e66345d39b0d34e03c84fe22470 Author: Kohei Yoshida <kohei.yosh...@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; commit 02346aa4663055e1adf7c52ede89871a493f4513 Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Wed Sep 18 19:06:20 2013 -0400 Add the configure bits to support --disable-orcus. Change-Id: Ieeb1581187248875ca2e37278c62a382f6caa8e0 diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 8a8d06c..a0315f5 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -2475,6 +2475,8 @@ $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO,\ endif # SYSTEM_PYTHON # ORCUS +ifeq ($(ENABLE_ORCUS),TRUE) + ifeq ($(SYSTEM_LIBORCUS),YES) define gb_LinkTarget__use_orcus @@ -2515,6 +2517,12 @@ endef endif # SYSTEM_LIBORCUS +else # ENABLE_ORCUS != TRUE + +gb_LinkTarget__use_orcus := +gb_LinkTarget__use_orcus-parser := + +endif ### X11 stuff ### diff --git a/config_host.mk.in b/config_host.mk.in index 6b9768f..9699d58 100644 --- a/config_host.mk.in +++ b/config_host.mk.in @@ -120,6 +120,7 @@ export ENABLE_GCONF=@ENABLE_GCONF@ export ENABLE_GIO=@ENABLE_GIO@ export ENABLE_GNOMEVFS=@ENABLE_GNOMEVFS@ export ENABLE_GRAPHITE=@ENABLE_GRAPHITE@ +export ENABLE_ORCUS=@ENABLE_ORCUS@ export ENABLE_HARFBUZZ=@ENABLE_HARFBUZZ@ export ENABLE_GSTREAMER=@ENABLE_GSTREAMER@ export ENABLE_GSTREAMER_0_10=@ENABLE_GSTREAMER_0_10@ diff --git a/config_host/config_orcus.h.in b/config_host/config_orcus.h.in new file mode 100644 index 0000000..68e3757 --- /dev/null +++ b/config_host/config_orcus.h.in @@ -0,0 +1,6 @@ +#ifndef CONFIG_ORCUS_H +#define CONFIG_ORCUS_H + +#define ENABLE_ORCUS 0 + +#endif diff --git a/configure.ac b/configure.ac index fda58df..141d0e1 100644 --- a/configure.ac +++ b/configure.ac @@ -729,6 +729,11 @@ AC_ARG_ENABLE(graphite, [Enables the compilation of Graphite smart font rendering.]) ) +AC_ARG_ENABLE(orcus, + AS_HELP_STRING([--enable-orcus], + [Enables orcus for extra file import filters for Calc.]) +) + AC_ARG_ENABLE(fetch-external, AS_HELP_STRING([--disable-fetch-external], [Disables fetching external tarballs from web sources.]) @@ -8941,6 +8946,52 @@ fi AC_SUBST(ENABLE_GRAPHITE) dnl =================================================================== +dnl Orcus +dnl =================================================================== + +AC_MSG_CHECKING([whether to enable orcus]) +if test $_os != Darwin -a $_os != Android -a $_os != iOS -a \( -z "$enable_orcus" -o "$enable_orcus" != no \); then + AC_MSG_RESULT([yes]) + ENABLE_ORCUS="TRUE" + AC_DEFINE(ENABLE_ORCUS) + + libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.6 >= 0.5.0]) + if test "$with_system_orcus" != "yes"; then + if test "$SYSTEM_BOOST" = "YES"; then + # =========================================================== + # Determine if we are going to need to link with Boost.System + # =========================================================== + dnl This seems to be necessary since boost 1.50 (1.48 does not need it, + dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned + dnl in documentation has no effect. + AC_MSG_CHECKING([if we need to link with Boost.System]) + AC_LANG_PUSH([C++]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + @%:@include <boost/version.hpp> + ]],[[ + #if BOOST_VERSION >= 105000 + # error yes, we need to link with Boost.System + #endif + ]])],[ + AC_MSG_RESULT([no]) + ],[ + AC_MSG_RESULT([yes]) + AX_BOOST_SYSTEM + ]) + AC_LANG_POP([C++]) + fi + fi + dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world + SYSTEM_LIBORCUS=$SYSTEM_ORCUS + AC_SUBST([BOOST_SYSTEM_LIB]) + AC_SUBST(SYSTEM_LIBORCUS) + +else + AC_MSG_RESULT([no]) +fi +AC_SUBST(ENABLE_ORCUS) + +dnl =================================================================== dnl HarfBuzz dnl =================================================================== AC_MSG_CHECKING([whether to enable HarfBuzz support]) @@ -9210,40 +9261,6 @@ AC_SUBST(RASQAL_MAJOR) AC_SUBST(REDLAND_MAJOR) dnl =================================================================== -dnl Check for system orcus -dnl =================================================================== -libo_CHECK_SYSTEM_MODULE([orcus],[ORCUS],[liborcus-0.6 >= 0.5.0]) -if test "$with_system_orcus" != "yes"; then - if test "$SYSTEM_BOOST" = "YES"; then - # =========================================================== - # Determine if we are going to need to link with Boost.System - # =========================================================== - dnl This seems to be necessary since boost 1.50 (1.48 does not need it, - dnl 1.49 is untested). The macro BOOST_THREAD_DONT_USE_SYSTEM mentioned - dnl in documentation has no effect. - AC_MSG_CHECKING([if we need to link with Boost.System]) - AC_LANG_PUSH([C++]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - @%:@include <boost/version.hpp> - ]],[[ - #if BOOST_VERSION >= 105000 - # error yes, we need to link with Boost.System - #endif - ]])],[ - AC_MSG_RESULT([no]) - ],[ - AC_MSG_RESULT([yes]) - AX_BOOST_SYSTEM - ]) - AC_LANG_POP([C++]) - fi -fi -dnl FIXME by renaming SYSTEM_LIBORCUS to SYSTEM_ORCUS in the build system world -SYSTEM_LIBORCUS=$SYSTEM_ORCUS -AC_SUBST([BOOST_SYSTEM_LIB]) -AC_SUBST(SYSTEM_LIBORCUS) - -dnl =================================================================== dnl Check for system hunspell dnl =================================================================== AC_MSG_CHECKING([which libhunspell to use]) @@ -12571,6 +12588,7 @@ AC_CONFIG_HEADERS([config_host/config_global.h]) AC_CONFIG_HEADERS([config_host/config_graphite.h]) AC_CONFIG_HEADERS([config_host/config_lgpl.h]) AC_CONFIG_HEADERS([config_host/config_mpl.h]) +AC_CONFIG_HEADERS([config_host/config_orcus.h]) AC_CONFIG_HEADERS([config_host/config_kde4.h]) AC_CONFIG_HEADERS([config_host/config_mingw.h]) AC_CONFIG_HEADERS([config_host/config_oox.h]) diff --git a/liborcus/Module_liborcus.mk b/liborcus/Module_liborcus.mk index 78e90d9..d290e86 100644 --- a/liborcus/Module_liborcus.mk +++ b/liborcus/Module_liborcus.mk @@ -9,7 +9,7 @@ $(eval $(call gb_Module_Module,liborcus)) -ifeq ($(SYSTEM_LIBORCUS),NO) +ifeq ($(ENABLE_ORCUS)-$(SYSTEM_LIBORCUS),TRUE-NO) $(eval $(call gb_Module_add_targets,liborcus,\ ExternalProject_liborcus \ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits