diff options
author | Michael Meeks <michael.meeks@suse.com> | 2013-06-27 16:49:41 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-06-27 19:34:39 +0100 |
commit | 66e72c38f77bedc28b990b2a724829b50c70bf8d (patch) | |
tree | d04bcc7fa3062071f1fdcc5454ad574a025aab28 /sc/inc | |
parent | d7f2e338cf00052f7edbecf664b3d0088198a374 (diff) |
abstract out the FormulaGroupInterpreter more cleanly.
Diffstat (limited to 'sc/inc')
-rw-r--r-- | sc/inc/document.hxx | 1 | ||||
-rw-r--r-- | sc/inc/formulagroup.hxx | 30 |
2 files changed, 22 insertions, 9 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index ff0b869cc532..377c80eacba4 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -415,6 +415,7 @@ private: ::std::set<ScFormulaCell*> maSubTotalCells; bool mbUseEmbedFonts; + public: bool IsUsingEmbededFonts() { return mbUseEmbedFonts; } void SetIsUsingEmbededFonts( bool bUse ) { mbUseEmbedFonts = bUse; } diff --git a/sc/inc/formulagroup.hxx b/sc/inc/formulagroup.hxx index 55f6e0997ff8..e5839e4c7116 100644 --- a/sc/inc/formulagroup.hxx +++ b/sc/inc/formulagroup.hxx @@ -30,19 +30,31 @@ struct FormulaGroupContext : boost::noncopyable }; /** - * All the vectorized formula calculation code should be collectd here. + * All the vectorized formula calculation code should be collected here. + * + * Abstract base class for formula group interpreters, and a factory. */ -class FormulaGroupInterpreter +class SC_DLLPUBLIC FormulaGroupInterpreter +{ + static FormulaGroupInterpreter *msInstance; + protected: + FormulaGroupInterpreter() {} + virtual ~FormulaGroupInterpreter() {} + public: + static FormulaGroupInterpreter *getStatic(); + + virtual bool interpret(ScDocument& rDoc, const ScAddress& rTopPos, const ScFormulaCellGroupRef& xGroup, ScTokenArray& rCode) = 0; +}; + +/// Inherit from this for alternate formula group calculation approaches. +class SC_DLLPUBLIC FormulaGroupInterpreterSoftware : public FormulaGroupInterpreter { - ScDocument& mrDoc; - ScAddress maTopPos; - ScFormulaCellGroupRef mxGroup; - ScTokenArray& mrCode; public: - FormulaGroupInterpreter( - ScDocument& rDoc, const ScAddress& rTopPos, const ScFormulaCellGroupRef& xGroup, ScTokenArray& rCode); + FormulaGroupInterpreterSoftware() : + FormulaGroupInterpreter() {} + virtual ~FormulaGroupInterpreterSoftware() {} - bool interpret(); + virtual bool interpret(ScDocument& rDoc, const ScAddress& rTopPos, const ScFormulaCellGroupRef& xGroup, ScTokenArray& rCode); }; } |