diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-12-04 07:50:20 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-12-04 08:24:18 +0100 |
commit | 9c2dfa9b41f82cfa763c500d34fe2a32a075f566 (patch) | |
tree | 08e5e74ce3fef619e9b16f396d1d17d3088b1f6a /sc/source/filter/orcus | |
parent | cb9cc446b39cafea018d2492fb4842a94aed7b77 (diff) |
activate basic gnumeric support in experimental mode
Please note that this is nothing mroe than a technical demo showing the
great opportunities provided by orcus.
It only imports some basic objects for now but provides the basis for
the future calc filter framework.
Change-Id: I6c6fb8d07e33482b2efdcbbe9a0f43224c5aa5a1
Diffstat (limited to 'sc/source/filter/orcus')
-rw-r--r-- | sc/source/filter/orcus/orcusfiltersimpl.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sc/source/filter/orcus/orcusfiltersimpl.cxx b/sc/source/filter/orcus/orcusfiltersimpl.cxx index 4e6c98b65060..ed33cc185971 100644 --- a/sc/source/filter/orcus/orcusfiltersimpl.cxx +++ b/sc/source/filter/orcus/orcusfiltersimpl.cxx @@ -16,6 +16,7 @@ #include <orcus/spreadsheet/import_interface.hpp> #include <orcus/orcus_csv.hpp> +#include <orcus/orcus_gnumeric.hpp> #include <orcus/global.hpp> #ifdef WNT @@ -50,6 +51,26 @@ bool ScOrcusFiltersImpl::importCSV(ScDocument& rDoc, const OUString& rPath) cons return true; } +bool ScOrcusFiltersImpl::importGnumeric(ScDocument& rDoc, const OUString& rPath) const +{ + ScOrcusFactory aFactory(rDoc); + OString aSysPath = toSystemPath(rPath); + const char* path = aSysPath.getStr(); + + try + { + orcus::orcus_gnumeric filter(&aFactory); + filter.read_file(path); + } + catch (const std::exception& e) + { + SAL_WARN("sc", "Unable to load gnumeric file! " << e.what()); + return false; + } + + return true; +} + ScOrcusXMLContext* ScOrcusFiltersImpl::createXMLContext(ScDocument& rDoc, const rtl::OUString& rPath) const { return new ScOrcusXMLContextImpl(rDoc, rPath); |