orcus is mandatory now

We use it as a json parser, for calc cell styles and tests. Making it
optional is just making the code more complex and introduces more
sources for errors.

Change-Id: I8769628a4ab9519cafc3d43db7c0007e0aa265dc
Reviewed-on: https://gerrit.libreoffice.org/31307
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
This commit is contained in:
Markus Mohrhard 2016-11-28 01:51:45 +01:00
parent 764358a43b
commit 039261b3f6
16 changed files with 28 additions and 158 deletions

View File

@ -3128,8 +3128,6 @@ endef
endif # SYSTEM_PYTHON
# ORCUS
ifeq ($(ENABLE_ORCUS),TRUE)
ifneq ($(SYSTEM_LIBORCUS),)
define gb_LinkTarget__use_orcus
@ -3220,13 +3218,6 @@ endif # MSC
endif # SYSTEM_LIBORCUS
else # ENABLE_ORCUS != TRUE
gb_LinkTarget__use_orcus :=
gb_LinkTarget__use_orcus-parser :=
endif
ifeq ($(ENABLE_EOT),TRUE)
ifneq ($(SYSTEM_LIBEOT),)

View File

@ -132,7 +132,6 @@ export ENABLE_EVOAB2=@ENABLE_EVOAB2@
export ENABLE_FIREBIRD_SDBC=@ENABLE_FIREBIRD_SDBC@
export ENABLE_FORMULA_LOGGER=@ENABLE_FORMULA_LOGGER@
export ENABLE_GIO=@ENABLE_GIO@
export ENABLE_ORCUS=@ENABLE_ORCUS@
export ENABLE_GLTF=@ENABLE_GLTF@
export SYSTEM_LIBGLTF=@SYSTEM_LIBGLTF@
export LIBGLTF_CFLAGS=@LIBGLTF_CFLAGS@

View File

@ -1,6 +0,0 @@
#ifndef CONFIG_ORCUS_H
#define CONFIG_ORCUS_H
#define ENABLE_ORCUS 0
#endif

View File

@ -1044,11 +1044,6 @@ AC_ARG_ENABLE(breakpad,
[Enables breakpad for crash reporting.])
)
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.])
@ -9206,13 +9201,6 @@ AC_SUBST(ENABLE_BREAKPAD)
dnl ===================================================================
dnl Orcus
dnl ===================================================================
AC_MSG_CHECKING([whether to enable orcus])
if test -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.12 >= 0.12.0])
if test "$with_system_orcus" != "yes"; then
if test "$SYSTEM_BOOST" = "TRUE"; then
@ -9244,11 +9232,6 @@ if test -z "$enable_orcus" -o "$enable_orcus" != no; then
AC_SUBST([BOOST_SYSTEM_LIB])
AC_SUBST(SYSTEM_LIBORCUS)
else
AC_MSG_RESULT([no])
fi
AC_SUBST(ENABLE_ORCUS)
dnl ===================================================================
dnl HarfBuzz
dnl ===================================================================
@ -12862,7 +12845,6 @@ AC_CONFIG_HEADERS([config_host/config_lgpl.h])
AC_CONFIG_HEADERS([config_host/config_liblangtag.h])
AC_CONFIG_HEADERS([config_host/config_locales.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_oox.h])
AC_CONFIG_HEADERS([config_host/config_opengl.h])

View File

@ -84,8 +84,6 @@
#include <vcl/svapp.hxx>
#include <cppuhelper/implbase.hxx>
#include <config_orcus.h>
const char PROP_TYPES[] = "Types";
const char PROP_NAME[] = "Name";
@ -653,8 +651,6 @@ LoadEnv::EContentType LoadEnv::classifyContent(const OUString&
namespace {
#if ENABLE_ORCUS
bool queryOrcusTypeAndFilter(const uno::Sequence<beans::PropertyValue>& rDescriptor, OUString& rType, OUString& rFilter)
{
OUString aURL;
@ -712,15 +708,6 @@ 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()

View File

@ -119,7 +119,6 @@ $(eval $(call gb_CppunitTest_use_components,sc_subsequent_filters_test,\
))
endif
ifeq ($(ENABLE_ORCUS),TRUE)
$(eval $(call gb_CppunitTest_use_externals,sc_subsequent_filters_test,\
orcus \
orcus-parser \
@ -129,8 +128,6 @@ $(eval $(call gb_CppunitTest_use_externals,sc_subsequent_filters_test,\
zlib \
))
endif
$(eval $(call gb_CppunitTest_use_configuration,sc_subsequent_filters_test))
# vim: set noet sw=4 ts=4:

View File

@ -221,7 +221,6 @@ $(eval $(call gb_Library_add_exception_objects,scfilt,\
sc/source/filter/oox/worksheetsettings \
))
ifeq ($(ENABLE_ORCUS),TRUE)
$(eval $(call gb_Library_use_externals,scfilt,\
orcus \
orcus-parser \
@ -238,6 +237,4 @@ $(eval $(call gb_Library_add_exception_objects,scfilt,\
sc/source/filter/orcus/filterdetect \
))
endif
# vim: set noet sw=4 ts=4:

View File

@ -22,14 +22,10 @@
#include <cppunit/Asserter.h>
#include <cppunit/AdditionalMessage.h>
#include <config_orcus.h>
#if ENABLE_ORCUS
#if defined(_WIN32)
#define __ORCUS_STATIC_LIB
#endif
#include <orcus/csv_parser.hpp>
#endif
#include <fstream>
@ -120,8 +116,6 @@ void loadFile(const OUString& aFileName, std::string& aContent)
aContent = aOStream.str();
}
#if ENABLE_ORCUS
void testFile(OUString& aFileName, ScDocument& rDoc, SCTAB nTab, StringType aStringFormat)
{
csv_handler aHandler(&rDoc, nTab, aStringFormat);
@ -170,13 +164,6 @@ void testCondFile(OUString& aFileName, ScDocument* pDoc, SCTAB nTab)
}
}
#else
void testFile(OUString&, ScDocument&, SCTAB, StringType) {}
void testCondFile(OUString&, ScDocument*, SCTAB) {}
#endif
void testFormats(ScBootstrapFixture* pTest, ScDocument* pDoc, sal_Int32 nFormat)
{
//test Sheet1 with csv file

View File

@ -65,16 +65,12 @@
#include <formula/errorcodes.hxx>
#include "externalrefmgr.hxx"
#include <stlpool.hxx>
#include <config_orcus.h>
#include <attrib.hxx>
#if ENABLE_ORCUS
#include <orcusfiltersimpl.hxx>
#include "orcusfilters.hxx"
#include "filter.hxx"
#include "orcusinterface.hxx"
#endif
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
@ -163,9 +159,7 @@ public:
void testCondFormatParentXLSX();
void testColorScaleNumWithRefXLSX();
#if ENABLE_ORCUS
void testOrcusODSStyleInterface();
#endif
void testLiteralInFormulaXLS();
@ -295,9 +289,7 @@ public:
CPPUNIT_TEST(testCondFormatParentXLSX);
CPPUNIT_TEST(testColorScaleNumWithRefXLSX);
#if ENABLE_ORCUS
CPPUNIT_TEST(testOrcusODSStyleInterface);
#endif
CPPUNIT_TEST(testLiteralInFormulaXLS);
@ -2854,7 +2846,6 @@ void ScFiltersTest::testColorScaleNumWithRefXLSX()
xDocSh->DoClose();
}
#if ENABLE_ORCUS
void ScFiltersTest::testOrcusODSStyleInterface()
{
ScDocument aDoc;
@ -3069,7 +3060,6 @@ void ScFiltersTest::testOrcusODSStyleInterface()
CPPUNIT_ASSERT_EQUAL_MESSAGE("Style Name10 :Error with ver justify", static_cast<sal_uInt16>(SVX_VER_JUSTIFY_CENTER), pVerJustify->GetValue());
}
#endif
void ScFiltersTest::testLiteralInFormulaXLS()
{

View File

@ -35,11 +35,7 @@
#include "stlsheet.hxx"
#include "compiler.hxx"
#include <config_orcus.h>
#if ENABLE_ORCUS
#include "orcusfiltersimpl.hxx"
#endif
// ScFilterTools::ReadLongDouble()
@ -357,12 +353,8 @@ ScFormatFilterPluginImpl::~ScFormatFilterPluginImpl() {}
ScOrcusFilters* ScFormatFilterPluginImpl::GetOrcusFilters()
{
#if ENABLE_ORCUS
static ScOrcusFiltersImpl aImpl;
return &aImpl;
#else
return NULL;
#endif
}
ScFormatFilterPlugin * SAL_CALL ScFilterCreate()

View File

@ -56,11 +56,8 @@
#include "document.hxx"
#include "rangelst.hxx"
#include <config_orcus.h>
#include <o3tl/make_unique.hxx>
#if ENABLE_ORCUS
#include <orcus/css_parser.hpp>
#endif
#include <com/sun/star/document/XDocumentProperties.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
@ -3079,8 +3076,6 @@ void ScHTMLQueryParser::CloseTable( const ImportInfo& rInfo )
mpCurrTable = mpCurrTable->CloseTable( rInfo );
}
#if ENABLE_ORCUS
namespace {
/**
@ -3204,12 +3199,6 @@ void ScHTMLQueryParser::ParseStyle(const OUString& rStrm)
}
}
#else
void ScHTMLQueryParser::ParseStyle(const OUString&) {}
#endif
IMPL_LINK( ScHTMLQueryParser, HTMLImportHdl, ImportInfo&, rInfo, void )
{
switch( rInfo.eState )

View File

@ -26,16 +26,13 @@
#include <stringutil.hxx>
#include <documentlinkmgr.hxx>
#include <config_orcus.h>
#include "officecfg/Office/Calc.hxx"
#if ENABLE_ORCUS
#if defined(_WIN32)
#define __ORCUS_STATIC_LIB
#endif
#include <orcus/csv_parser.hpp>
#endif
#include <queue>
@ -66,8 +63,6 @@ inline double getNow()
return static_cast<double>(now.Seconds) + static_cast<double>(now.Nanosec) / 1000000000.0;
}
#if ENABLE_ORCUS
class CSVHandler
{
DataStream::Line& mrLine;
@ -106,8 +101,6 @@ public:
}
};
#endif
}
namespace datastreams {
@ -135,9 +128,7 @@ class ReaderThread : public salhelper::Thread
osl::Condition maCondReadStream;
osl::Condition maCondConsume;
#if ENABLE_ORCUS
orcus::csv::parser_config maConfig;
#endif
public:
@ -147,10 +138,8 @@ public:
mnColCount(nColCount),
mbTerminate(false)
{
#if ENABLE_ORCUS
maConfig.delimiters.push_back(',');
maConfig.text_qualifier = '"';
#endif
}
virtual ~ReaderThread() override
@ -238,11 +227,9 @@ private:
{
rLine.maCells.clear();
mpStream->ReadLine(rLine.maLine);
#if ENABLE_ORCUS
CSVHandler aHdl(rLine, mnColCount);
orcus::csv_parser<CSVHandler> parser(rLine.maLine.getStr(), rLine.maLine.getLength(), aHdl, maConfig);
parser.parse();
#endif
}
aGuard.reset(); // lock
@ -510,8 +497,6 @@ void DataStream::MoveData()
}
}
#if ENABLE_ORCUS
void DataStream::Text2Doc()
{
Line aLine = ConsumeLine();
@ -566,12 +551,6 @@ void DataStream::Text2Doc()
++mnLinesSinceRefresh;
}
#else
void DataStream::Text2Doc() {}
#endif
bool DataStream::ImportData()
{
if (!mbValuesInLine)

View File

@ -116,7 +116,6 @@
#include "refreshtimerprotector.hxx"
#include <orcus/orcus_import_ods.hpp>
#include <orcusfiltersimpl.hxx>
#include <config_orcus.h>
#include <officecfg/Office/Calc.hxx>
#include <comphelper/processfactory.hxx>
@ -594,7 +593,6 @@ bool ScDocShell::Load( SfxMedium& rMedium )
aDocument.GetStyleSheetPool()->CreateStandardStyles();
aDocument.UpdStlShtPtrsFrmNms();
#if ENABLE_ORCUS
if (!mbUcalcTest)
{
/* Create styles that are imported through Orcus */
@ -610,7 +608,6 @@ bool ScDocShell::Load( SfxMedium& rMedium )
if (pOrcus)
pOrcus->importODS_Styles(aDocument, aPath);
}
#endif
bRet = LoadXML( &rMedium, nullptr );
}

View File

@ -26,7 +26,6 @@
#include <editeng/unolingu.hxx>
#include <orcus/orcus_import_ods.hpp>
#include <orcusfiltersimpl.hxx>
#include <config_orcus.h>
#include <config_folders.h>
#include "drwlayer.hxx"
@ -60,7 +59,6 @@ bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
aDocument.GetStyleSheetPool()->CreateStandardStyles();
aDocument.UpdStlShtPtrsFrmNms();
#if ENABLE_ORCUS
if (!mbUcalcTest)
{
/* Create styles that are imported through Orcus */
@ -75,7 +73,6 @@ bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
if (pOrcus)
pOrcus->importODS_Styles(aDocument, aPath);
}
#endif
// SetDocumentModified is not allowed anymore in Load/InitNew!
InitItems();

View File

@ -66,8 +66,6 @@
#include "markdata.hxx"
#include <documentlinkmgr.hxx>
#include <config_orcus.h>
#include <memory>
using namespace com::sun::star;
@ -1208,11 +1206,9 @@ void ScCellShell::GetDBState( SfxItemSet& rSet )
}
}
break;
#if !ENABLE_ORCUS
case SID_MANAGE_XML_SOURCE:
rSet.DisableItem(nWhich);
break;
#endif
}
nWhich = aIter.NextWhich();
}

View File

@ -77,8 +77,6 @@
#include "PivotLayoutDialog.hxx"
#include <config_orcus.h>
void ScTabViewShell::SetCurRefDlgId( sal_uInt16 nNew )
{
// CurRefDlgId is stored in ScModule to find if a ref dialog is open,
@ -444,9 +442,7 @@ VclPtr<SfxModelessDialog> ScTabViewShell::CreateRefDialog(
case SID_MANAGE_XML_SOURCE:
{
#if ENABLE_ORCUS
pResult = VclPtr<ScXMLSourceDlg>::Create(pB, pCW, pParent, pDoc);
#endif
}
break;