10 #include <com/sun/star/uno/Sequence.hxx>
11 #include <com/sun/star/lang/Locale.hpp>
12 #include <osl/diagnose.h>
22 namespace lang = ::com::sun::star::lang;
32 bUseEnglishFuncName =
false;
34 mbWriteCalcConfig =
true;
41 ResetFormulaSeparators();
46 GetDefaultFormulaSeparators(aFormulaSepArg, aFormulaSepArrayCol, aFormulaSepArrayRow);
50 OUString& rSepArg, OUString& rSepArrayCol, OUString& rSepArrayRow)
58 const OUString& rLang = rLocale.Language;
66 const OUString& rListSep = rLocaleData.
getListSep();
68 if (rDecSep.isEmpty() || rListSep.isEmpty())
83 if (cDecSep ==
'.' || (cDecSepAlt ==
'.' && cDecSep !=
','))
85 else if (cDecSep ==
',' && cDecSepAlt ==
'.')
89 if (rLocale.Language ==
"de" && rLocale.Country ==
"CH")
94 rSepArg = OUString(cListSep);
96 if (cDecSep == cListSep && cDecSep !=
';')
138 assert(SfxPoolItem::operator==(rItem));
149 #define CFGPATH_FORMULA "Office.Calc/Formula"
151 #define SCFORMULAOPT_GRAMMAR 0
152 #define SCFORMULAOPT_ENGLISH_FUNCNAME 1
153 #define SCFORMULAOPT_SEP_ARG 2
154 #define SCFORMULAOPT_SEP_ARRAY_ROW 3
155 #define SCFORMULAOPT_SEP_ARRAY_COL 4
156 #define SCFORMULAOPT_STRING_REF_SYNTAX 5
157 #define SCFORMULAOPT_STRING_CONVERSION 6
158 #define SCFORMULAOPT_EMPTY_OUSTRING_AS_ZERO 7
159 #define SCFORMULAOPT_OOXML_RECALC 8
160 #define SCFORMULAOPT_ODF_RECALC 9
161 #define SCFORMULAOPT_OPENCL_AUTOSELECT 10
162 #define SCFORMULAOPT_OPENCL_DEVICE 11
163 #define SCFORMULAOPT_OPENCL_SUBSET_ONLY 12
164 #define SCFORMULAOPT_OPENCL_MIN_SIZE 13
165 #define SCFORMULAOPT_OPENCL_SUBSET_OPS 14
169 return {
"Syntax/Grammar",
170 "Syntax/EnglishFunctionName",
171 "Syntax/SeparatorArg",
172 "Syntax/SeparatorArrayRow",
173 "Syntax/SeparatorArrayCol",
174 "Syntax/StringRefAddressSyntax",
175 "Syntax/StringConversion",
176 "Syntax/EmptyStringAsZero",
177 "Load/OOXMLRecalcMode",
178 "Load/ODFRecalcMode",
179 "Calculation/OpenCLAutoSelect",
180 "Calculation/OpenCLDevice",
181 "Calculation/OpenCLSubsetOnly",
182 "Calculation/OpenCLMinimumDataSize",
183 "Calculation/OpenCLSubsetOpCodes"};
189 static sal_uInt16 aVals[] = {
206 OSL_ENSURE(
SAL_N_ELEMENTS(aVals) == aPropNames.getLength(),
"Properties and ids are out of Sync");
208 for ( sal_Int32
i=0;
i<aPropNames.getLength(); ++
i )
209 aPropIdMap[aPropNames[
i]] = aVals[
i ];
225 OSL_ENSURE(aValues.getLength() == aNames.getLength(),
"GetProperties failed");
227 if(aValues.getLength() != aNames.getLength())
230 sal_Int32 nIntVal = 0;
231 for(
int nProp = 0; nProp < aNames.getLength(); nProp++)
233 PropsToIds::iterator it_end = aPropMap.end();
234 PropsToIds::iterator it = aPropMap.find( aNames[nProp] );
235 if(pValues[nProp].hasValue() && it != it_end )
246 if (!(pValues[nProp] >>= nIntVal))
271 bool bEnglish =
false;
272 if (pValues[nProp] >>= bEnglish)
279 if ((pValues[nProp] >>= aSep) && !aSep.isEmpty())
286 if ((pValues[nProp] >>= aSep) && !aSep.isEmpty())
293 if ((pValues[nProp] >>= aSep) && !aSep.isEmpty())
304 if (!(pValues[nProp] >>= nIntVal))
340 if (!(pValues[nProp] >>= nIntVal))
359 SAL_WARN(
"sc",
"unknown string conversion option!");
369 pValues[nProp] >>= bVal;
376 if (pValues[nProp] >>= nIntVal)
390 SAL_WARN(
"sc",
"unknown ooxml recalc option!");
400 if (pValues[nProp] >>= nIntVal)
414 SAL_WARN(
"sc",
"unknown odf recalc option!");
424 pValues[nProp] >>= bVal;
431 pValues[nProp] >>= aOpenCLDevice;
438 pValues[nProp] >>= bVal;
445 pValues[nProp] >>= nVal;
452 pValues[nProp] >>= sVal;
468 Any* pOldValues = aOldValues.getArray();
470 bool bSetOpenCL =
false;
472 for (
int nProp = 0; nProp < aNames.getLength(); ++nProp)
481 case ::formula::FormulaGrammar::GRAM_NATIVE_XL_A1: nVal = 1;
break;
482 case ::formula::FormulaGrammar::GRAM_NATIVE_XL_R1C1: nVal = 2;
break;
485 pValues[nProp] <<= nVal;
491 pValues[nProp] <<= b;
511 case ::formula::FormulaGrammar::CONV_OOO: nVal = 0;
break;
512 case ::formula::FormulaGrammar::CONV_XL_A1: nVal = 1;
break;
513 case ::formula::FormulaGrammar::CONV_XL_R1C1: nVal = 2;
break;
514 case ::formula::FormulaGrammar::CONV_A1_XL_A1: nVal = 3;
break;
517 pValues[nProp] <<= nVal;
521 pValues[nProp] = pOldValues[nProp];
538 pValues[nProp] <<= nVal;
542 pValues[nProp] = pOldValues[nProp];
551 pValues[nProp] <<= bVal;
555 pValues[nProp] = pOldValues[nProp];
575 pValues[nProp] <<= nVal;
594 pValues[nProp] <<= nVal;
600 pValues[nProp] <<= bVal;
607 pValues[nProp] <<= aOpenCLDevice;
614 pValues[nProp] <<= bVal;
620 pValues[nProp] <<= nVal;
626 pValues[nProp] <<= sVal;
631 #if !HAVE_FEATURE_OPENCL
635 sc::FormulaGroupInterpreter::switchOpenCLDevice(
=1+"1" gives 2, but =1+"1.000" or =1+"x" give VALUE!
const OUString & getListSep() const
OUString ScOpCodeSetToSymbolicString(const ScCalcConfig::OpCodeSet &rOpCodes)
static css::lang::Locale * GetLocale()
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
bool EnableNotification(const css::uno::Sequence< OUString > &rNames, bool bEnableInternalNotification=false)
StringConversion meStringConversion
#define SAL_N_ELEMENTS(arr)
ScCalcConfig::OpCodeSet ScStringToOpCodeSet(std::u16string_view rOpCodes)
const OUString & getNumDecimalSep() const
bool PutProperties(const css::uno::Sequence< OUString > &rNames, const css::uno::Sequence< css::uno::Any > &rValues)
OpCodeSet mpOpenCLSubsetOpCodes
=1+"1.000" may be 2 or 1001 ... =1+"x" gives VALUE!
css::uno::Sequence< css::uno::Any > GetProperties(const css::uno::Sequence< OUString > &rNames)
const PropertyStruct aPropNames[]
formula::FormulaGrammar::AddressConvention meStringRefAddressSyntax
const OUString & getNumDecimalSepAlt() const
static SC_DLLPUBLIC const LocaleDataWrapper * getLocaleDataPtr()
sal_Int32 mnOpenCLMinimumFormulaGroupSize
const PropertyValue * pValues
=1+"1" or =1+"x" give VALUE!
#define SAL_WARN(area, stream)
bool operator==(const SharedUNOComponent< INTERFACE, COMPONENT > &_rLHS, const css::uno::Reference< INTERFACE > &_rRHS)