summaryrefslogtreecommitdiffstats
path: root/sc/inc/simpleformulacalc.hxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-05-07 00:59:48 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-06-02 03:24:56 +0200
commit1a663077de77bdbb7edfe2283d9e9bc93e90594f (patch)
treebb7ecb4df6e776f0a38ec3e5749a4fe3bdb5ec24 /sc/inc/simpleformulacalc.hxx
parentwe don't need this include in the header file (diff)
downloadcore-1a663077de77bdbb7edfe2283d9e9bc93e90594f.tar.gz
core-1a663077de77bdbb7edfe2283d9e9bc93e90594f.zip
initial work on removing some ScFormulaCell instances
These cells where using a ScFormulaCell to calculate the result of a formula and get the number format. Use the new ScSimpleFormulaCalculator which is a simplified version that has only a few limitations. Change-Id: I71f01b8fa10506234627a6512cb434800dceca6a
Diffstat (limited to 'sc/inc/simpleformulacalc.hxx')
-rw-r--r--sc/inc/simpleformulacalc.hxx54
1 files changed, 54 insertions, 0 deletions
diff --git a/sc/inc/simpleformulacalc.hxx b/sc/inc/simpleformulacalc.hxx
new file mode 100644
index 000000000000..43ff6eac4acf
--- /dev/null
+++ b/sc/inc/simpleformulacalc.hxx
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef SC_SIMPLE_FORMULA_CALC_HXX
+#define SC_SIMPLE_FORMULA_CALC_HXX
+
+#include <boost/scoped_ptr.hpp>
+#include <formula/grammar.hxx>
+
+#include "address.hxx"
+#include "formularesult.hxx"
+
+class ScDocument;
+class ScTokenArray;
+
+class ScSimpleFormulaCalculator
+{
+private:
+ short mnFormatType;
+ sal_uLong mnFormatIndex;
+
+ bool mbCalculated;
+ boost::scoped_ptr<ScTokenArray> mpCode;
+ ScAddress maAddr;
+ ScDocument* mpDoc;
+ ScFormulaResult maResult;
+
+public:
+ ScSimpleFormulaCalculator(ScDocument* pDoc, const ScAddress& rAddr,
+ const OUString& rFormula, formula::FormulaGrammar::Grammar eGram = formula::FormulaGrammar::GRAM_DEFAULT);
+ ~ScSimpleFormulaCalculator();
+
+ void Calculate();
+ bool IsValue();
+ sal_uInt16 GetErrCode();
+ double GetValue();
+ OUString GetString();
+ short GetFormatType() const { return mnFormatType; }
+ sal_uLong GetFormatIndex() const { return mnFormatIndex; }
+
+ bool HasColRowName();
+
+ ScTokenArray* GetCode();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */