sc/qa/unit/data/xlsx/tdf100154.xlsx    |binary
 sc/qa/unit/subsequent_filters_test.cxx |   13 +++++++++++++
 sc/source/core/tool/address.cxx        |    1 +
 3 files changed, 14 insertions(+)

New commits:
commit 48b934e5c2cac3da0313d8e77ef8dfed59729006
Author:     Vladislav Tarakanov <[email protected]>
AuthorDate: Sun Feb 8 11:04:09 2026 +0400
Commit:     Xisco Fauli <[email protected]>
CommitDate: Mon Feb 9 10:29:58 2026 +0100

    tdf#100154 Treat non-ASCII characters as non-digits
    
    In the original implementation, when importing,
    sheet names consisting only of non-ASCII characters
    separated by '.' are treated as strings, not
    references. However, MS Office handles such names
    and saves them in .xlsx files, causing formulas with
    references to such sheets imported into LO to
    produce incorrect values ​​after recalculation.
    
    This fix consists of treating non-ASCII characters as
    non-digits.
    
    Change-Id: I4427692c7293e1f41ed48a70b3b53fd180173299
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198775
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <[email protected]>
    (cherry picked from commit 20d62f4a29798fe35d8a89902d8662b9a3f444bf)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198949
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sc/qa/unit/data/xlsx/tdf100154.xlsx 
b/sc/qa/unit/data/xlsx/tdf100154.xlsx
new file mode 100644
index 000000000000..8b6c8dd536d8
Binary files /dev/null and b/sc/qa/unit/data/xlsx/tdf100154.xlsx differ
diff --git a/sc/qa/unit/subsequent_filters_test.cxx 
b/sc/qa/unit/subsequent_filters_test.cxx
index 51cb491b77cd..458a673edeae 100644
--- a/sc/qa/unit/subsequent_filters_test.cxx
+++ b/sc/qa/unit/subsequent_filters_test.cxx
@@ -1587,6 +1587,19 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest, 
testRowIndex1BasedXLSX)
     CPPUNIT_ASSERT_EQUAL(u"Third line."_ustr, aStr);
 }
 
+CPPUNIT_TEST_FIXTURE(ScFiltersTest, testNonAsciiWithDotXLSX)
+{
+    createScDoc("xlsx/tdf100154.xlsx");
+    ScDocument* pDoc = getScDoc();
+
+    OUString aStr = pDoc->GetFormula(0, 0, 0);
+    CPPUNIT_ASSERT_EQUAL(u"=$'Новый.лист'.A1"_ustr, aStr);
+
+    pDoc->CalcAll();
+    double aValue = pDoc->GetValue(ScAddress(0, 0, 0));
+    CPPUNIT_ASSERT_EQUAL(5.0, aValue);
+}
+
 ScFiltersTest::ScFiltersTest()
     : ScModelTestBase(u"sc/qa/unit/data"_ustr)
 {
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx
index 4c6453cf53e4..5714cc91b3e1 100644
--- a/sc/source/core/tool/address.cxx
+++ b/sc/source/core/tool/address.cxx
@@ -400,6 +400,7 @@ static const sal_Unicode * lcl_XL_ParseSheetRef( const 
sal_Unicode* start,
             {
                 // non ASCII character is allowed.
                 ++p;
+                only_digits = false;
             }
             else
                 break;

Reply via email to