Kaydet (Commit) 470a91cb authored tarafından Eike Rathke's avatar Eike Rathke

Resolves: tdf#80583 create range list string with proper delimiter

... which is the to be used function parameter separator here. The
current document's grammar (from which the separator is obtained
in ScRangeList::Format() if not specified) may differ from the
forced English grammar later when compiling the formula, and all
formula expressions to be inserted use the language independent
';' semicolon function parameter separator.

Change-Id: I7a3deb6d50fc57ed434ede1f00bbe8c5c1361e0f
Reviewed-on: https://gerrit.libreoffice.org/64819Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: Jenkins
üst 8e1f198a
......@@ -334,7 +334,7 @@ void ScAnalysisOfVarianceDialog::AnovaSingleFactor(AddressWalkerWriter& output,
// Sum of Squares
aTemplate.setTemplate("=DEVSQ(%RANGE_LIST%)");
aTemplate.applyRangeList("%RANGE_LIST%", aRangeList);
aTemplate.applyRangeList("%RANGE_LIST%", aRangeList, ';');
output.writeFormula(aTemplate.getTemplate());
output.nextColumn();
......
......@@ -69,10 +69,10 @@ void FormulaTemplate::applyRange(const OUString& aVariable, const ScRange& aRang
mTemplate = mTemplate.replaceAll(aVariable, aString);
}
void FormulaTemplate::applyRangeList(const OUString& aVariable, const ScRangeList& aRangeList)
void FormulaTemplate::applyRangeList(const OUString& aVariable, const ScRangeList& aRangeList, sal_Unicode cDelimiter)
{
OUString aString;
aRangeList.Format(aString, ScRefFlags::RANGE_ABS_3D, mpDoc, mpDoc->GetAddressConvention());
aRangeList.Format(aString, ScRefFlags::RANGE_ABS_3D, mpDoc, mpDoc->GetAddressConvention(), cDelimiter);
mTemplate = mTemplate.replaceAll(aVariable, aString);
}
......
......@@ -41,7 +41,7 @@ public:
void autoReplaceUses3D(bool bUse3D) { mbUse3D = bUse3D; }
void applyRange(const OUString& aVariable, const ScRange& aRange, bool b3D = true);
void applyRangeList(const OUString& aVariable, const ScRangeList& aRangeList);
void applyRangeList(const OUString& aVariable, const ScRangeList& aRangeList, sal_Unicode cDelimiter );
void applyAddress(const OUString& aVariable, const ScAddress& aAddress, bool b3D = true);
void applyString(const OUString& aVariable, const OUString& aValue);
void applyNumber(const OUString& aVariable, sal_Int32 aValue);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment