summaryrefslogtreecommitdiff
path: root/sc/inc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-04-30 11:16:21 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-04-30 13:10:45 -0400
commitc9aa06260000a3640a5557c2d34be7e2a82d8f91 (patch)
treebbc8f9668d5adf923c5231ef7026c3457be49f3e /sc/inc
parent29bf5fa50d7471d4ea6d5d59c2e2b091000fd306 (diff)
Move the group calculation code into its own class.
To isolate the code that will be re-written for true vectorized calculation... Change-Id: I3ccd15841ed6fcdc6a22a590ba82d46d0b4863c5
Diffstat (limited to 'sc/inc')
-rw-r--r--sc/inc/column.hxx2
-rw-r--r--sc/inc/formulacell.hxx4
-rw-r--r--sc/inc/formulagroup.hxx22
-rw-r--r--sc/inc/types.hxx3
4 files changed, 27 insertions, 4 deletions
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index e70f108e70f2..e0773aab3e1b 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -82,8 +82,6 @@ struct ScFormulaCellGroup;
struct ScRefCellValue;
class ScDocumentImport;
-typedef ::boost::intrusive_ptr<ScFormulaCellGroup> ScFormulaCellGroupRef;
-
struct ScNeededSizeOptions
{
const ScPatternAttr* pPattern;
diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index e4f1cfa5fd0e..2a8546f28a2f 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -51,8 +51,6 @@ inline void intrusive_ptr_release(ScFormulaCellGroup *p)
delete p;
}
-typedef ::boost::intrusive_ptr<ScFormulaCellGroup> ScFormulaCellGroupRef;
-
enum ScMatrixMode {
MM_NONE = 0, // No matrix formula
MM_FORMULA = 1, // Upper left matrix formula cell
@@ -282,6 +280,8 @@ public:
*/
void SetResultDouble( double n ) { aResult.SetDouble( n); }
+ void SetResultToken( const formula::FormulaToken* pToken );
+
double GetResultDouble() const { return aResult.GetDouble(); }
void SetErrCode( sal_uInt16 n );
diff --git a/sc/inc/formulagroup.hxx b/sc/inc/formulagroup.hxx
index 0a8e3f7aa7c1..55f6e0997ff8 100644
--- a/sc/inc/formulagroup.hxx
+++ b/sc/inc/formulagroup.hxx
@@ -10,9 +10,15 @@
#ifndef SC_FORMULAGROUP_HXX
#define SC_FORMULAGROUP_HXX
+#include "address.hxx"
+#include "types.hxx"
+
#include <boost/noncopyable.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
+class ScDocument;
+class ScTokenArray;
+
namespace sc {
struct FormulaGroupContext : boost::noncopyable
@@ -23,6 +29,22 @@ struct FormulaGroupContext : boost::noncopyable
ArrayStoreType maArrays;
};
+/**
+ * All the vectorized formula calculation code should be collectd here.
+ */
+class FormulaGroupInterpreter
+{
+ ScDocument& mrDoc;
+ ScAddress maTopPos;
+ ScFormulaCellGroupRef mxGroup;
+ ScTokenArray& mrCode;
+public:
+ FormulaGroupInterpreter(
+ ScDocument& rDoc, const ScAddress& rTopPos, const ScFormulaCellGroupRef& xGroup, ScTokenArray& rCode);
+
+ bool interpret();
+};
+
}
#endif
diff --git a/sc/inc/types.hxx b/sc/inc/types.hxx
index 1af6e2d73b62..9654271c4887 100644
--- a/sc/inc/types.hxx
+++ b/sc/inc/types.hxx
@@ -20,6 +20,9 @@ typedef ::boost::intrusive_ptr<const ScMatrix> ScConstMatrixRef;
class ScToken;
typedef ::boost::intrusive_ptr<ScToken> ScTokenRef;
+struct ScFormulaCellGroup;
+typedef ::boost::intrusive_ptr<ScFormulaCellGroup> ScFormulaCellGroupRef;
+
/**
* When vectorization is enabled, we could potentially mass-calculate a
* series of formula token arrays in adjacent formula cells in one step,