15#include <rtl/ustring.hxx>
39 const char*
env = getenv(
"SC_FORCE_CALCULATION" );
42 if( strcmp(
env,
"opencl" ) == 0 )
44 SAL_INFO(
"sc.core.formulagroup",
"Forcing calculations to use OpenCL");
47 if( strcmp(
env,
"threads" ) == 0 )
49 SAL_INFO(
"sc.core.formulagroup",
"Forcing calculations to use threads");
52 if( strcmp(
env,
"core" ) == 0 )
54 SAL_INFO(
"sc.core.formulagroup",
"Forcing calculations to use core");
57 SAL_WARN(
"sc.core.formulagroup",
"Unrecognized value of SC_FORCE_CALCULATION");
77 return gOpenCLEnabled.
get();
88 return gThreadingEnabled.
get();
92 meStringRefAddressSyntax(
formula::FormulaGrammar::CONV_UNSPECIFIED),
94 mbEmptyStringAsZero(false),
95 mbHasStringRefSyntax(false)
189 OUStringBuffer
result(256);
193 for (
auto i = rOpCodes->begin();
i != rOpCodes->end(); ++
i)
195 if (
i != rOpCodes->begin())
197 result.append(pOpCodeMap->getSymbol(*
i));
200 return result.makeStringAndClear();
211 sal_Int32 fromIndex(0);
213 OUString s(OUString::Concat(rOpCodes) +
";");
215 while ((semicolon = s.indexOf(
';', fromIndex)) >= 0)
217 if (semicolon > fromIndex)
219 OUString element(s.copy(fromIndex, semicolon - fromIndex));
220 sal_Int32
n = element.toInt32();
221 if (
n > 0 || (
n == 0 && element ==
"0"))
225 auto opcode(rHashMap.find(element));
226 if (opcode != rHashMap.end())
227 result->insert(opcode->second);
229 SAL_WARN(
"sc.opencl",
"Unrecognized OpCode " << element <<
" in OpCode set string");
232 fromIndex = semicolon+1;
static rtl::Reference< ConfigurationListener > const & getMiscListener()
static ForceCalculationType forceCalculationTypeInit()
OUString ScOpCodeSetToSymbolicString(const ScCalcConfig::OpCodeSet &rOpCodes)
static rtl::Reference< ConfigurationListener > const & getFormulaCalculationListener()
ScCalcConfig::OpCodeSet ScStringToOpCodeSet(std::u16string_view rOpCodes)
@ ForceCalculationThreads
#define SAL_WARN(area, stream)
#define SAL_INFO(area, stream)
const css::uno::Reference< css::xml::crypto::XSecurityEnvironment > & env
Configuration options for formula interpreter.
sal_Int32 mnOpenCLMinimumFormulaGroupSize
static bool isOpenCLEnabled()
void setOpenCLConfigToDefault()
StringConversion meStringConversion
static ForceCalculationType getForceCalculationType()
OpCodeSet mpOpenCLSubsetOpCodes
static bool isThreadingEnabled()
void MergeDocumentSpecific(const ScCalcConfig &r)
std::shared_ptr< o3tl::sorted_vector< OpCode > > OpCodeSet
bool operator!=(const ScCalcConfig &r) const
bool operator==(const ScCalcConfig &r) const
void SetStringRefSyntax(formula::FormulaGrammar::AddressConvention eConv)
formula::FormulaGrammar::AddressConvention meStringRefAddressSyntax
bool mbHasStringRefSyntax