26 std::map<OUString, ScRangeName*> rRangeMap;
47 switch (sObjType.toInt32())
137 sal_Int32 nObjType = sValue.toInt32();
166 if (sValue ==
"0" || sValue ==
"1")
172 if (sValue ==
"1" || sValue ==
"2")
187 if (sValue ==
"1" || sValue ==
"2" || sValue ==
"3")
248 if (sValue.isEmpty())
363 if (sValue.isEmpty())
376 sal_Int32 nOptionsSize = aOptions.getLength();
377 auto pParamValues = aOptions.getArray();
379 for (
auto i = 0;
i < nOptionsSize;
i++)
381 css::beans::PropertyValue aProp = aOptions[
i];
382 OUString sLOParamName = aProp.Name;
389 OUString sParamType = std::get<OUString>(aParamInfo[2]);
391 if (sParamType ==
"int")
393 css::uno::Any
nValue(sParamValue.toInt32());
394 pParamValues[
i] = css::beans::PropertyValue(sLOParamName, -1,
nValue,
395 css::beans::PropertyState_DIRECT_VALUE);
397 if (sParamType ==
"bool")
402 if (sLOParamName ==
"NonNegative")
403 bTmpValue = sParamValue ==
"1" ? true :
false;
405 bTmpValue = sParamValue.toBoolean();
407 css::uno::Any bValue(bTmpValue);
408 pParamValues[
i] = css::beans::PropertyValue(sLOParamName, -1, bValue,
409 css::beans::PropertyState_DIRECT_VALUE);
418 sal_Int32 nOptionsSize = aOptions.getLength();
420 for (
auto i = 0;
i < nOptionsSize;
i++)
422 css::beans::PropertyValue aProp = aOptions[
i];
423 OUString sLOParamName = aProp.Name;
430 OUString sParamType = std::get<OUString>(aParamInfo[2]);
431 if (sParamType ==
"int")
437 if (sParamType ==
"bool")
440 aProp.Value >>= bValue;
441 if (sLOParamName ==
"NonNegative")
452 SetParameter(eParamId, OUString::number(sal_Int32(bValue)));
462 std::vector<ScRangeData*> aItemsToErase;
468 if (
pData &&
pData->GetName().startsWith(
"solver_"))
469 aItemsToErase.push_back(
pData);
472 for (
auto pItem : aItemsToErase)
489 css::uno::Sequence<OUString> aEngineNames;
490 css::uno::Sequence<OUString> aDescriptions;
void SetDocumentModified()
SC_DLLPUBLIC void GetRangeNameMap(std::map< OUString, ScRangeName * > &rRangeName)
static SC_DLLPUBLIC void EraseQuotes(OUString &rString, sal_Unicode cQuote, bool bUnescapeEmbedded=true)
Erases the character cQuote from rString, if it exists at beginning AND end.
static SC_DLLPUBLIC void AddQuotes(OUString &rString, sal_Unicode cQuote, bool bEscapeEmbedded=true)
Inserts the character cQuote at beginning and end of rString.
static SC_DLLPUBLIC const CharClass & getCharClass()
SC_DLLPUBLIC OUString GetSymbol(const formula::FormulaGrammar::Grammar eGrammar=formula::FormulaGrammar::GRAM_DEFAULT) const
SC_DLLPUBLIC ScRangeData * findByIndex(sal_uInt16 i) const
SC_DLLPUBLIC size_t size() const
SC_DLLPUBLIC ScRangeData * findByUpperName(const OUString &rName)
void erase(const ScRangeData &r)
SC_DLLPUBLIC bool insert(ScRangeData *p, bool bReuseFreeIndex=true)
Insert object into set.
static void GetImplementations(css::uno::Sequence< OUString > &rImplNames, css::uno::Sequence< OUString > &rDescriptions)
static css::uno::Sequence< css::beans::PropertyValue > GetDefaults(std::u16string_view rImplName)
const OUString & GetName() const
SC_DLLPUBLIC void GetEngineOptions(css::uno::Sequence< css::beans::PropertyValue > &aOptions)
bool ReadConstraintPart(ConstraintPart ePart, tools::Long nIndex, OUString &rValue)
std::map< OUString, TParamInfo > SolverParamNames
std::vector< OUString > m_aConstraintParts
ScRangeName * m_pRangeName
void DeleteAllNamedRanges()
SolverSettings(ScTable &pTable)
css::uno::Sequence< css::beans::PropertyValue > m_aEngineOptions
std::map< OUString, OUString > SolverNamesToExcelEngines
SC_DLLPUBLIC OUString GetParameter(SolverParameter eParam)
SC_DLLPUBLIC void ResetToDefaults()
std::map< SolverParameter, OUString > m_mNamedRanges
SC_DLLPUBLIC void SetObjectiveType(ObjectiveType eType)
SC_DLLPUBLIC void SetConstraints(std::vector< ModelConstraint > aConstraints)
OUString m_sVariableCells
void WriteConstraintPart(ConstraintPart ePart, tools::Long nIndex, OUString sValue)
bool ReadParamValue(SolverParameter eParam, OUString &rValue, bool bRemoveQuotes=false)
SC_DLLPUBLIC void SetEngineOptions(css::uno::Sequence< css::beans::PropertyValue > &aOptions)
std::vector< std::variant< OUString, SolverParameter > > TParamInfo
SC_DLLPUBLIC void SetParameter(SolverParameter eParam, OUString sValue)
SC_DLLPUBLIC void SaveSolverSettings()
void WriteParamValue(SolverParameter eParam, OUString sValue, bool bQuoted=false)
std::vector< ModelConstraint > m_aConstraints
std::unique_ptr< sal_Int32[]> pData
CAUTION! The following defines must be in the same namespace as the respective type.
ConstraintOperator nOperator