summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--offapi/com/sun/star/sheet/opencl/XOpenCLSelection.idl25
-rw-r--r--sc/inc/docuno.hxx14
-rw-r--r--sc/source/ui/unoobj/docuno.cxx45
3 files changed, 84 insertions, 0 deletions
diff --git a/offapi/com/sun/star/sheet/opencl/XOpenCLSelection.idl b/offapi/com/sun/star/sheet/opencl/XOpenCLSelection.idl
index cbf1af065435..b7f47b8565ee 100644
--- a/offapi/com/sun/star/sheet/opencl/XOpenCLSelection.idl
+++ b/offapi/com/sun/star/sheet/opencl/XOpenCLSelection.idl
@@ -74,6 +74,31 @@ interface XOpenCLSelection : com::sun::star::uno::XInterface
*/
sequence< OpenCLPlatform > getOpenCLPlatforms();
+ /*
+ * Sets OpenCL to be considered only for formulas that use only a specific subset of opcodes.
+ */
+ void enableOpcodeSubsetTest();
+
+ /*
+ * Sets OpenCL to be considered for formulas regardless of what opcodes they contain.
+ */
+ void disableOpcodeSubsetTest();
+
+ /*
+ * Returns whether OpenCL is considered or not depending on the opcodes a formula uses.
+ */
+ boolean isOpcodeSubsetTested();
+
+ /*
+ * Sets the lower limit on the number of cells involved in a formula for OpenCL to be considered.
+ */
+ void setFormulaCellNumberLimit( [in] long number );
+
+ /*
+ * Returns the lower limit on the number of cells involved in a formula for OpenCL to be considered.
+ */
+ long getFormulaCellNumberLimit();
+
};
}; }; }; }; };
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index da0ea2537f1d..9f7ed0afccb5 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -353,6 +353,20 @@ public:
SAL_CALL getOpenCLPlatforms()
throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+ virtual void SAL_CALL enableOpcodeSubsetTest()
+ throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual void SAL_CALL disableOpcodeSubsetTest()
+ throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual sal_Bool SAL_CALL isOpcodeSubsetTested()
+ throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual void SAL_CALL setFormulaCellNumberLimit( sal_Int32 number )
+ throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
+
+ virtual sal_Int32 SAL_CALL getFormulaCellNumberLimit()
+ throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
// ITiledRenderable
virtual void paintTile( VirtualDevice& rDevice,
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 6993c0473639..10f50aa3e7db 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -28,6 +28,7 @@
#include <svx/unoshape.hxx>
#include <officecfg/Office/Common.hxx>
+#include <officecfg/Office/Calc.hxx>
#include <svl/numuno.hxx>
#include <svl/smplhint.hxx>
#include <unotools/moduleoptions.hxx>
@@ -2448,6 +2449,50 @@ uno::Sequence< sheet::opencl::OpenCLPlatform > ScModelObj::getOpenCLPlatforms()
#endif
}
+namespace {
+
+void setOpcodeSubsetTest(bool bFlag)
+ throw (uno::RuntimeException, std::exception)
+{
+ boost::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
+ officecfg::Office::Calc::Formula::Calculation::OpenCLSubsetOnly::set(bFlag, batch);
+ batch->commit();
+}
+
+}
+
+void ScModelObj::enableOpcodeSubsetTest()
+ throw (uno::RuntimeException, std::exception)
+{
+ setOpcodeSubsetTest(true);
+}
+
+void ScModelObj::disableOpcodeSubsetTest()
+ throw (uno::RuntimeException, std::exception)
+{
+ setOpcodeSubsetTest(false);
+}
+
+sal_Bool ScModelObj::isOpcodeSubsetTested()
+ throw (uno::RuntimeException, std::exception)
+{
+ return officecfg::Office::Calc::Formula::Calculation::OpenCLSubsetOnly::get();
+}
+
+void ScModelObj::setFormulaCellNumberLimit( sal_Int32 number )
+ throw (uno::RuntimeException, std::exception)
+{
+ boost::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create());
+ officecfg::Office::Calc::Formula::Calculation::OpenCLMinimumDataSize::set(number, batch);
+ batch->commit();
+}
+
+sal_Int32 ScModelObj::getFormulaCellNumberLimit()
+ throw (uno::RuntimeException, std::exception)
+{
+ return officecfg::Office::Calc::Formula::Calculation::OpenCLMinimumDataSize::get().get();
+}
+
ScDrawPagesObj::ScDrawPagesObj(ScDocShell* pDocSh) :
pDocShell( pDocSh )
{