1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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/.
10 #ifndef INCLUDED_SC_INC_CALCCONFIG_HXX
11 #define INCLUDED_SC_INC_CALCCONFIG_HXX
19 #include <formula/grammar.hxx>
20 #include <formula/opcode.hxx>
21 #include <rtl/ustring.hxx>
23 #include <comphelper/configurationlistener.hxx>
25 // have to match the registry values
34 * Configuration options for formula interpreter.
36 struct SC_DLLPUBLIC ScCalcConfig
38 // from most stringent to most relaxed
39 enum class StringConversion
41 ILLEGAL
, ///< =1+"1" or =1+"x" give #VALUE!
42 ZERO
, ///< =1+"1" or =1+"x" give 1
43 UNAMBIGUOUS
, ///< =1+"1" gives 2, but =1+"1.000" or =1+"x" give #VALUE!
44 LOCALE
///< =1+"1.000" may be 2 or 1001 ... =1+"x" gives #VALUE!
46 formula::FormulaGrammar::AddressConvention meStringRefAddressSyntax
;
47 StringConversion meStringConversion
;
48 bool mbEmptyStringAsZero
:1;
49 bool mbHasStringRefSyntax
:1;
51 static bool isOpenCLEnabled();
52 static bool isSwInterpreterEnabled();
54 bool mbOpenCLSubsetOnly
:1;
55 bool mbOpenCLAutoSelect
:1;
56 OUString maOpenCLDevice
;
57 sal_Int32 mnOpenCLMinimumFormulaGroupSize
;
59 typedef std::shared_ptr
<std::set
<OpCode
>> OpCodeSet
;
61 OpCodeSet mpOpenCLSubsetOpCodes
;
62 OpCodeSet mpSwInterpreterSubsetOpCodes
;
66 void setOpenCLConfigToDefault();
69 void MergeDocumentSpecific( const ScCalcConfig
& r
);
70 void SetStringRefSyntax( formula::FormulaGrammar::AddressConvention eConv
);
72 bool operator== (const ScCalcConfig
& r
) const;
73 bool operator!= (const ScCalcConfig
& r
) const;
76 SC_DLLPUBLIC OUString
ScOpCodeSetToSymbolicString(const ScCalcConfig::OpCodeSet
& rOpCodes
);
77 SC_DLLPUBLIC
ScCalcConfig::OpCodeSet
ScStringToOpCodeSet(const OUString
& rOpCodes
);
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */