From 39d10139e08e19acc0284ef12d0fcb1ff69dd91e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Mon, 6 Jul 2026 22:04:36 +0000 Subject: [PATCH] sc: add an ODS round-trip test for the # spilled-range operator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The # operator uses the native # symbol in ODFF, so it needs no special handling to survive an ODS save and reload. Cover it the same way as the XLSX round-trip: load the fixture, check the formulas, save and reload as ODS, and check again. Change-Id: I900c418fb57b79a8e0434bdc2b4b8b9e88f5b05d Signed-off-by: Tomaž Vajngerl Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/6265 Tested-by: Jenkins CPCI Reviewed-by: Mike Kaganski (cherry picked from commit 5a5d2aa0cd4ca72be0288855889ae75562d6e34a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207909 Reviewed-by: Xisco Fauli Tested-by: Jenkins --- sc/qa/unit/subsequent_filters_test5.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sc/qa/unit/subsequent_filters_test5.cxx b/sc/qa/unit/subsequent_filters_test5.cxx index 7e6abbfa6f84..9d00442d5267 100644 --- a/sc/qa/unit/subsequent_filters_test5.cxx +++ b/sc/qa/unit/subsequent_filters_test5.cxx @@ -227,6 +227,24 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest5, testSpillOperatorXlsxRoundTrip) checkSpillFormulas(); } +CPPUNIT_TEST_FIXTURE(ScFiltersTest5, testSpillOperatorOdsRoundTrip) +{ + // The # spilled-range operator survives an ODS round-trip too, on + // its own and inside other functions. + createScDoc("xlsx/SimpleSpillOperatorFixture.xlsx"); + + auto checkSpillFormulas = [this]() { + ScDocument* pDocument = getScDoc(); + CPPUNIT_ASSERT_EQUAL(u"=B2#"_ustr, pDocument->GetFormula(2, 1, 0)); + CPPUNIT_ASSERT_EQUAL(u"=UNIQUE(B2#)"_ustr, pDocument->GetFormula(3, 1, 0)); + CPPUNIT_ASSERT_EQUAL(u"=SUM(B2#)"_ustr, pDocument->GetFormula(4, 1, 0)); + }; + + checkSpillFormulas(); + saveAndReload(TestFilter::ODS); + checkSpillFormulas(); +} + CPPUNIT_TEST_FIXTURE(ScFiltersTest5, testDynamicSpillStateExportFODS) { // A dynamic-array master in spill state collapses to 1x1. FODS