LOK: tilebench improvements
[LibreOffice.git] / sc / inc / interpretercontext.hxx
blobd2b6814fad6e10cf526287f0d10fd01ff545e9dd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #ifndef INCLUDED_SC_INC_INTERPRETERCONTEXT_HXX
11 #define INCLUDED_SC_INC_INTERPRETERCONTEXT_HXX
13 #include <vector>
14 #include <formula/token.hxx>
16 #define TOKEN_CACHE_SIZE 8
18 class ScDocument;
19 class SvNumberFormatter;
21 struct ScInterpreterContext
23 const ScDocument& mrDoc;
24 SvNumberFormatter* mpFormatter;
25 size_t mnTokenCachePos;
26 std::vector<formula::FormulaToken*> maTokens;
28 ScInterpreterContext(const ScDocument& rDoc, SvNumberFormatter* pFormatter)
29 : mrDoc(rDoc)
30 , mpFormatter(pFormatter)
31 , mnTokenCachePos(0)
32 , maTokens(TOKEN_CACHE_SIZE, nullptr)
36 ~ScInterpreterContext()
38 for (auto p : maTokens)
39 if (p)
40 p->DecRef();
43 SvNumberFormatter* GetFormatTable() const { return mpFormatter; }
46 #endif // INCLUDED_SC_INC_INTERPRETERCONTEXT_HXX
48 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */