diff options
author | Tor Lillqvist <tml@collabora.com> | 2017-10-04 00:12:31 +0300 |
---|---|---|
committer | Dennis Francis <dennis.francis@collabora.co.uk> | 2017-11-21 16:09:42 +0530 |
commit | 257cc7a0027ce4338210fddd50a3d3e5badb0c0b (patch) | |
tree | 792dc764466fdf4a73ca2cc06c4f491651e09749 /sc/inc/interpretercontext.hxx | |
parent | 995a25b3c28107558f82e26aa081589ccd393c12 (diff) |
Introduce ScInterpreterContext
Possibly later things that need to be thread-local can be handled through
the ScInterpreterContext.
Why handle some thread-local things through the
ScDocument::maNonThreaded and ScDocument::maThreadSpecific mechanism,
and others through this ScInterpreterContext? Good question.
Share SvNumberFormatter across worker threads
and use mutex to protect SvNumberFormatter::IsNumberFormat()
Change-Id: I372e5fbd9a19785f55f0faf4a4bedc5fc1ef3e03
Diffstat (limited to 'sc/inc/interpretercontext.hxx')
-rw-r--r-- | sc/inc/interpretercontext.hxx | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/sc/inc/interpretercontext.hxx b/sc/inc/interpretercontext.hxx new file mode 100644 index 000000000000..cbf05349ca5f --- /dev/null +++ b/sc/inc/interpretercontext.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 INCLUDED_SC_INC_INTERPRETERCONTEXT_HXX +#define INCLUDED_SC_INC_INTERPRETERCONTEXT_HXX + +class ScDocument; +class SvNumberFormatter; + +struct ScInterpreterContext +{ + const ScDocument& mrDoc; + SvNumberFormatter* mpFormatter; + + ScInterpreterContext(const ScDocument& rDoc, SvNumberFormatter* pFormatter) : + mrDoc(rDoc), + mpFormatter(pFormatter) + { + } + + ~ScInterpreterContext() + { + } + + SvNumberFormatter* GetFormatTable() const + { + return mpFormatter; + } +}; + +#endif // INCLUDED_SC_INC_INTERPRETERCONTEXT_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ |