Kaydet (Commit) 0c9ad1c7 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

add test for formula listener during delete sheet

Change-Id: I49c53048db575e60f5110b2161658c190ba2e7f8
Reviewed-on: https://gerrit.libreoffice.org/39318Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 4a3cb4a7
...@@ -493,6 +493,7 @@ public: ...@@ -493,6 +493,7 @@ public:
void testFormulaListenerSingleCellToMultipleCells(); void testFormulaListenerSingleCellToMultipleCells();
void testFormulaListenerMultipleCellsToMultipleCells(); void testFormulaListenerMultipleCellsToMultipleCells();
void testFormulaListenerUpdateInsertTab(); void testFormulaListenerUpdateInsertTab();
void testFormulaListenerUpdateDeleteTab();
// Check that the Listeners are correctly updated when we // Check that the Listeners are correctly updated when we
// call a operation // call a operation
...@@ -789,6 +790,7 @@ public: ...@@ -789,6 +790,7 @@ public:
CPPUNIT_TEST(testFormulaListenerMultipleCellsToSingleCell); CPPUNIT_TEST(testFormulaListenerMultipleCellsToSingleCell);
CPPUNIT_TEST(testFormulaListenerMultipleCellsToMultipleCells); CPPUNIT_TEST(testFormulaListenerMultipleCellsToMultipleCells);
CPPUNIT_TEST(testFormulaListenerUpdateInsertTab); CPPUNIT_TEST(testFormulaListenerUpdateInsertTab);
CPPUNIT_TEST(testFormulaListenerUpdateDeleteTab);
CPPUNIT_TEST(testImportStream); CPPUNIT_TEST(testImportStream);
CPPUNIT_TEST(testDeleteContents); CPPUNIT_TEST(testDeleteContents);
CPPUNIT_TEST(testTransliterateText); CPPUNIT_TEST(testTransliterateText);
......
...@@ -830,6 +830,27 @@ void Test::testFormulaListenerUpdateInsertTab() ...@@ -830,6 +830,27 @@ void Test::testFormulaListenerUpdateInsertTab()
m_pDoc->DeleteTab(0); m_pDoc->DeleteTab(0);
} }
void Test::testFormulaListenerUpdateDeleteTab()
{
m_pDoc->InsertTab(0, "test");
m_pDoc->InsertTab(0, "to_delete");
ScCompiler aCompiler(m_pDoc, ScAddress(10, 10, 1), formula::FormulaGrammar::GRAM_ENGLISH);
std::unique_ptr<ScTokenArray> pTokenArray(aCompiler.CompileString("A1"));
ScFormulaListener aListener(m_pDoc);
aListener.addTokenArray(pTokenArray.get(), ScAddress(10, 10, 1));
CPPUNIT_ASSERT(!aListener.NeedsRepaint());
m_pDoc->DeleteTab(0);
// check that the listener has moved
m_pDoc->SetValue(ScAddress(0, 0, 0), 1.0);
CPPUNIT_ASSERT(aListener.NeedsRepaint());
m_pDoc->DeleteTab(0);
}
void Test::testCondFormatUpdateMoveTab() void Test::testCondFormatUpdateMoveTab()
{ {
m_pDoc->InsertTab(0, "test"); m_pDoc->InsertTab(0, "test");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment