sc/source/core/data/simpleformulacalc.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
New commits: commit 198ceb02bcd091f69b10e7ee5ca0d8e54119e9ff Author: Eike Rathke <er...@redhat.com> AuthorDate: Fri Jun 3 21:18:04 2022 +0200 Commit: Eike Rathke <er...@redhat.com> CommitDate: Sat Jun 4 00:21:26 2022 +0200 Function Wizard: use actual array separators to truncate result ... instead of hard coded ',' and ';'. And truncate / append "..." after separator, not at. Change-Id: I62f8c00f108165102d3b6a8b73b82774b8973a67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135370 Reviewed-by: Eike Rathke <er...@redhat.com> Tested-by: Jenkins diff --git a/sc/source/core/data/simpleformulacalc.cxx b/sc/source/core/data/simpleformulacalc.cxx index 5959d08318d2..4b999f2ac09a 100644 --- a/sc/source/core/data/simpleformulacalc.cxx +++ b/sc/source/core/data/simpleformulacalc.cxx @@ -64,12 +64,15 @@ void ScSimpleFormulaCalculator::Calculate() if (mbLimitString) { - size_t n = aStr.getLength(); - for (size_t i = DISPLAY_LEN; i < n; ++i) + const sal_Unicode cCol = ScCompiler::GetNativeSymbol(ocArrayColSep)[0]; + const sal_Unicode cRow = ScCompiler::GetNativeSymbol(ocArrayRowSep)[0]; + const sal_Int32 n = aStr.getLength(); + for (sal_Int32 i = DISPLAY_LEN; i < n; ++i) { - if (aStr[i] == ',' || aStr[i] == ';') + const sal_Unicode c = aStr[i]; + if (c == cCol || c == cRow) { - aStr.truncate(i); + aStr.truncate(i+1); aStr.append("..."); break; }