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