Kaydet (Commit) 664e64a1 authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Markus Mohrhard

add test for fdo#85304

Change-Id: I35692a4a4ccfd1aa5938078bdf32a3eaff082453
üst 1de372de
...@@ -149,6 +149,7 @@ public: ...@@ -149,6 +149,7 @@ public:
void testFormulaRefUpdateNameExpandRef(); void testFormulaRefUpdateNameExpandRef();
void testFormulaRefUpdateNameDeleteRow(); void testFormulaRefUpdateNameDeleteRow();
void testFormulaRefUpdateNameCopySheet(); void testFormulaRefUpdateNameCopySheet();
void testFormulaRefUpdateNameDelete();
void testFormulaRefUpdateValidity(); void testFormulaRefUpdateValidity();
void testMultipleOperations(); void testMultipleOperations();
void testFuncCOLUMN(); void testFuncCOLUMN();
...@@ -454,6 +455,7 @@ public: ...@@ -454,6 +455,7 @@ public:
CPPUNIT_TEST(testFormulaRefUpdateNameExpandRef); CPPUNIT_TEST(testFormulaRefUpdateNameExpandRef);
CPPUNIT_TEST(testFormulaRefUpdateNameDeleteRow); CPPUNIT_TEST(testFormulaRefUpdateNameDeleteRow);
CPPUNIT_TEST(testFormulaRefUpdateNameCopySheet); CPPUNIT_TEST(testFormulaRefUpdateNameCopySheet);
CPPUNIT_TEST(testFormulaRefUpdateNameDelete);
CPPUNIT_TEST(testFormulaRefUpdateValidity); CPPUNIT_TEST(testFormulaRefUpdateValidity);
CPPUNIT_TEST(testMultipleOperations); CPPUNIT_TEST(testMultipleOperations);
CPPUNIT_TEST(testFuncCOLUMN); CPPUNIT_TEST(testFuncCOLUMN);
......
...@@ -2636,6 +2636,26 @@ void Test::testFormulaRefUpdateNameCopySheet() ...@@ -2636,6 +2636,26 @@ void Test::testFormulaRefUpdateNameCopySheet()
m_pDoc->DeleteTab(0); m_pDoc->DeleteTab(0);
} }
void Test::testFormulaRefUpdateNameDelete()
{
m_pDoc->InsertTab(0, "Test");
// Insert a new name 'MyRange' to reference B1
bool bInserted = m_pDoc->InsertNewRangeName("MyRange", ScAddress(0,0,0), "$Test.$B$1");
CPPUNIT_ASSERT(bInserted);
const ScRangeData* pName = m_pDoc->GetRangeName()->findByUpperName("MYRANGE");
CPPUNIT_ASSERT(pName);
m_pDoc->DeleteCol(1, 0, 3, 0, 0, 1);
const ScTokenArray* pCode = pName->GetCode();
sc::TokenStringContext aCxt(m_pDoc, formula::FormulaGrammar::GRAM_ENGLISH);
OUString aExpr = pCode->CreateString(aCxt, ScAddress(0,0,0));
CPPUNIT_ASSERT_EQUAL(OUString("$Test.$B$1"), aExpr);
m_pDoc->DeleteTab(0);
}
void Test::testFormulaRefUpdateValidity() void Test::testFormulaRefUpdateValidity()
{ {
struct { struct {
......
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