summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-12-04 07:50:20 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2012-12-04 08:24:18 +0100
commit9c2dfa9b41f82cfa763c500d34fe2a32a075f566 (patch)
tree08e5e74ce3fef619e9b16f396d1d17d3088b1f6a /framework
parentcb9cc446b39cafea018d2492fb4842a94aed7b77 (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 'framework')
-rw-r--r--framework/source/loadenv/loadenv.cxx24
1 files changed, 21 insertions, 3 deletions
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index c676fe49ac03..78bc67c8c42f 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -32,6 +32,9 @@
#include <services.h>
#include <comphelper/interaction.hxx>
#include <framework/interaction.hxx>
+#include <comphelper/processfactory.hxx>
+#include <comphelper/configuration.hxx>
+#include "officecfg/Office/Common.hxx"
#include <com/sun/star/task/ErrorCodeRequest.hpp>
#include <com/sun/star/uno/RuntimeException.hpp>
@@ -703,15 +706,22 @@ LoadEnv::EContentType LoadEnv::classifyContent(const ::rtl::OUString&
namespace {
-#if 1
+#if 0
+// TODO: We will reinstate this function later, so don't remove this!
bool queryOrcusTypeAndFilter(const uno::Sequence<beans::PropertyValue>&, OUString&, OUString&)
{
return false;
}
#else
-// TODO: We will reinstate this function later, so don't remove this!
bool queryOrcusTypeAndFilter(const uno::Sequence<beans::PropertyValue>& rDescriptor, OUString& rType, OUString& rFilter)
{
+ // depending on the experimental mode
+ uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
+ if (!xContext.is() || !officecfg::Office::Common::Misc::ExperimentalMode::get(xContext))
+ {
+ return false;
+ }
+
OUString aURL;
sal_Int32 nSize = rDescriptor.getLength();
for (sal_Int32 i = 0; i < nSize; ++i)
@@ -727,13 +737,21 @@ bool queryOrcusTypeAndFilter(const uno::Sequence<beans::PropertyValue>& rDescrip
if (aURL.isEmpty() || aURL.copy(0,8).equalsIgnoreAsciiCase("private:"))
return false;
- if (aURL.endsWith(".csv"))
+ if(aURL.endsWith(".gnumeric"))
+ {
+ rType = "generic_Text";
+ rFilter = "orcus-gnumeric";
+ return true;
+ }
+#if 0
+ else if (aURL.endsWith(".csv"))
{
// Use .csv as the first test file type.
rType = "generic_Text";
rFilter = "orcus-test-filter";
return true;
}
+#endif
return false;
}