diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/qa/unit/uicalc/data/tdf159373.ods | bin | 0 -> 32546 bytes | |||
-rw-r--r-- | sc/qa/unit/uicalc/uicalc.cxx | 20 |
2 files changed, 20 insertions, 0 deletions
diff --git a/sc/qa/unit/uicalc/data/tdf159373.ods b/sc/qa/unit/uicalc/data/tdf159373.ods Binary files differnew file mode 100644 index 000000000000..6dc7a110e3fa --- /dev/null +++ b/sc/qa/unit/uicalc/data/tdf159373.ods diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx index 1bf9dfc12883..f792cc0dcd1f 100644 --- a/sc/qa/unit/uicalc/uicalc.cxx +++ b/sc/qa/unit/uicalc/uicalc.cxx @@ -1684,6 +1684,26 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf117706) CPPUNIT_ASSERT_EQUAL(OUString(""), pDoc->GetString(ScAddress(0, 2, 0))); } +CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf159373) +{ + createScDoc("tdf159373.ods"); + ScDocument* pDoc = getScDoc(); + + CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(2), pDoc->GetTableCount()); + + uno::Sequence<beans::PropertyValue> aArgs( + comphelper::InitPropertySequence({ { "Index", uno::Any(sal_uInt16(0)) } })); + + // Without the fix in place, this test would have crashed here + dispatchCommand(mxComponent, ".uno:Remove", aArgs); + + CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(1), pDoc->GetTableCount()); + + dispatchCommand(mxComponent, ".uno:Undo", aArgs); + + CPPUNIT_ASSERT_EQUAL(static_cast<SCTAB>(2), pDoc->GetTableCount()); +} + CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf86166) { createScDoc("tdf86166.ods"); |