sc/qa/unit/data/ods/tdf167636.ods |binary sc/qa/unit/parallelism.cxx | 40 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+)
New commits: commit 16ae64568a8714067a99c4c0a54f5f080b5b9fff Author: Caolán McNamara <[email protected]> AuthorDate: Fri Feb 20 10:51:11 2026 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Fri Feb 20 22:32:40 2026 +0100 Related: tdf#167636 add a test for this problem Change-Id: Iddfdfe766d0ed1a37b45b42f27dae2d5804acbb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199830 Tested-by: Jenkins Tested-by: Caolán McNamara <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sc/qa/unit/data/ods/tdf167636.ods b/sc/qa/unit/data/ods/tdf167636.ods new file mode 100644 index 000000000000..34621ba05ab9 Binary files /dev/null and b/sc/qa/unit/data/ods/tdf167636.ods differ diff --git a/sc/qa/unit/parallelism.cxx b/sc/qa/unit/parallelism.cxx index 903c97be4fd2..071739ad32e5 100644 --- a/sc/qa/unit/parallelism.cxx +++ b/sc/qa/unit/parallelism.cxx @@ -16,6 +16,7 @@ #include <formulagroup.hxx> #include <officecfg/Office/Calc.hxx> +#include <unotools/syslocaleoptions.hxx> using namespace sc; @@ -86,6 +87,45 @@ CPPUNIT_TEST_FIXTURE(ScParallelismTest, testTdf160368) pDocSh->DoHardRecalc(); } +// VLOOKUP with CONCATENATE involving decimal numbers returns #N/A +// under threaded calculation when locale uses comma as decimal separator +CPPUNIT_TEST_FIXTURE(ScParallelismTest, testTdf167636) +{ + // Set locale to French (comma decimal separator) for the duration of the test + SvtSysLocaleOptions aOptions; + OUString sLocaleConfigString = aOptions.GetLanguageTag().getBcp47(); + aOptions.SetLocaleConfigString(u"fr-FR"_ustr); + aOptions.Commit(); + comphelper::ScopeGuard g([&aOptions, &sLocaleConfigString] { + aOptions.SetLocaleConfigString(sLocaleConfigString); + aOptions.Commit(); + }); + + createScDoc("ods/tdf167636.ods"); + + ScDocument* pDoc = getScDoc(); + + // Recalculate via CalcFormulaTree which uses threaded group calculation. + pDoc->CalcFormulaTree(false, false, true); + + // After threaded recalc with French locale, VLOOKUP formulas + // involving CONCATENATE with decimal numbers should return correct + // results, not #N/A. + + // D2 = 14 * 10 = 140 + CPPUNIT_ASSERT_DOUBLES_EQUAL(140.0, pDoc->GetValue(3, 1, 0), 1e-10); + // D3 = 16 * 20 = 320 + CPPUNIT_ASSERT_DOUBLES_EQUAL(320.0, pDoc->GetValue(3, 2, 0), 1e-10); + // D4 = 12 * 30 = 360 + CPPUNIT_ASSERT_DOUBLES_EQUAL(360.0, pDoc->GetValue(3, 3, 0), 1e-10); + // D5 = 6 * 40 = 240 + CPPUNIT_ASSERT_DOUBLES_EQUAL(240.0, pDoc->GetValue(3, 4, 0), 1e-10); + // D6 = 13 * 50 = 650 + CPPUNIT_ASSERT_DOUBLES_EQUAL(650.0, pDoc->GetValue(3, 5, 0), 1e-10); + // D7 = 7 * 60 = 420 + CPPUNIT_ASSERT_DOUBLES_EQUAL(420.0, pDoc->GetValue(3, 6, 0), 1e-10); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
