summaryrefslogtreecommitdiff
path: root/sc/inc/tokenstringcontext.hxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-11-14 21:20:12 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-11-14 23:53:52 -0500
commit07f8216e5722d2288143367a07f4d567ab060431 (patch)
tree2b94cc96ff5322c912b697dff3dea04720eebc87 /sc/inc/tokenstringcontext.hxx
parent8819e6909568ec8e3feebb4226ef4f381af209a9 (diff)
Create string from token array directly from ScTokenArray. Still WIP.
And make it re-entrant for thread safety. This method should not modify the internal state of the token array object. The one with ScCompiler is not re-entrant. Still some way to go. Change-Id: I06de3637341727aef0963dddfb98527f415bf7fa
Diffstat (limited to 'sc/inc/tokenstringcontext.hxx')
-rw-r--r--sc/inc/tokenstringcontext.hxx39
1 files changed, 39 insertions, 0 deletions
diff --git a/sc/inc/tokenstringcontext.hxx b/sc/inc/tokenstringcontext.hxx
new file mode 100644
index 000000000000..e5bb01c3ccc9
--- /dev/null
+++ b/sc/inc/tokenstringcontext.hxx
@@ -0,0 +1,39 @@
+/* -*- 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_TOKENSTRINGCONTEXT_HXX
+#define SC_TOKENSTRINGCONTEXT_HXX
+
+#include "compiler.hxx"
+
+namespace sc {
+
+/**
+ * Context for creating string from an array of formula tokens, used in
+ * ScTokenArray::CreateString(). You can re-use the same string context
+ * between multiple CreateString() calls as long as the document content is
+ * unmodified.
+ */
+struct TokenStringContext
+{
+ formula::FormulaGrammar::Grammar meGram;
+ formula::FormulaCompiler::OpCodeMapPtr mxOpCodeMap;
+ const ScCompiler::Convention* mpRefConv;
+ OUString maErrRef;
+
+ std::vector<OUString> maTabNames;
+
+ TokenStringContext( formula::FormulaGrammar::Grammar eGram );
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */