blob: eaaeb3f0f4d1dbe03e1078dc6de543e38ed81aa1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
/* -*- 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_CALCCONFIG_HXX
#define INCLUDED_SC_INC_CALCCONFIG_HXX
#include "scdllapi.h"
#include <ostream>
#include <set>
#include <formula/grammar.hxx>
#include <formula/opcode.hxx>
#include <rtl/ustring.hxx>
// have to match the registry values
enum ScRecalcOptions
{
RECALC_ALWAYS = 0,
RECALC_NEVER,
RECALC_ASK,
};
/**
* Configuration options for formula interpreter.
*/
struct SC_DLLPUBLIC ScCalcConfig
{
// from most stringent to most relaxed
enum StringConversion
{
STRING_CONVERSION_AS_ERROR = 0, ///< =1+"1" or =1+"x" give #VALUE!
STRING_CONVERSION_AS_ZERO, ///< =1+"1" or =1+"x" give 1
STRING_CONVERSION_UNAMBIGUOUS, ///< =1+"1" gives 2, but =1+"1.000" or =1+"x" give #VALUE!
STRING_CONVERSION_LOCALE_DEPENDENT ///< =1+"1.000" may be 2 or 1001 ... =1+"x" gives #VALUE!
};
formula::FormulaGrammar::AddressConvention meStringRefAddressSyntax;
StringConversion meStringConversion;
bool mbEmptyStringAsZero:1;
bool mbOpenCLEnabled:1;
bool mbOpenCLSubsetOnly:1;
bool mbOpenCLAutoSelect:1;
OUString maOpenCLDevice;
sal_Int32 mnOpenCLMinimumFormulaGroupSize;
std::set<OpCodeEnum> maOpenCLSubsetOpCodes;
std::set<OUString> maOpenCLWhiteList;
std::set<OUString> maOpenCLBlackList;
ScCalcConfig();
void setOpenCLConfigToDefault();
void reset();
void MergeDocumentSpecific( const ScCalcConfig& r );
bool operator== (const ScCalcConfig& r) const;
bool operator!= (const ScCalcConfig& r) const;
};
SC_DLLPUBLIC std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig& rConfig);
SC_DLLPUBLIC OUString ScOpCodeSetToNumberString(const std::set<OpCodeEnum>& rOpCodes);
SC_DLLPUBLIC OUString ScOpCodeSetToSymbolicString(const std::set<OpCodeEnum>& rOpCodes);
SC_DLLPUBLIC std::set<OpCodeEnum> ScStringToOpCodeSet(const OUString& rOpCodes);
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|