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

add tests for tdf#104026

Change-Id: I928828f5f3ee22429e174e6e761d6683a36fdb24
Reviewed-on: https://gerrit.libreoffice.org/35290Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 3f0f35c8
......@@ -485,6 +485,8 @@ public:
void testCondFormatUpdateDeleteTab();
void testCondFormatUpdateInsertTab();
void testCondFormatUpdateReference();
void testCondFormatUpdateReferenceDelRow();
void testCondFormatUpdateReferenceInsRow();
void testCondFormatEndsWithStr();
void testCondFormatEndsWithVal();
......@@ -745,6 +747,8 @@ public:
CPPUNIT_TEST(testCondCopyPasteSheet);
CPPUNIT_TEST(testCondFormatEndsWithStr);
CPPUNIT_TEST(testCondFormatEndsWithVal);
CPPUNIT_TEST(testCondFormatUpdateReferenceDelRow);
CPPUNIT_TEST(testCondFormatUpdateReferenceInsRow);
CPPUNIT_TEST(testIconSet);
CPPUNIT_TEST(testDataBarLengthAutomaticAxis);
CPPUNIT_TEST(testDataBarLengthMiddleAxis);
......
......@@ -875,4 +875,44 @@ void Test::testCondFormatUpdateReference()
m_pDoc->DeleteTab(0);
}
void Test::testCondFormatUpdateReferenceDelRow()
{
m_pDoc->InsertTab(0, "test");
ScConditionEntry* pEntry = new ScConditionEntry(SC_COND_EQUAL, "B6", "", m_pDoc, ScAddress(0, 5, 0), "", "", formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
ScConditionalFormat* pFormat = new ScConditionalFormat(0, m_pDoc);
pFormat->SetRange(ScRange(0, 5, 0, 0, 5, 0));
m_pDoc->AddCondFormat(pFormat, 0);
pFormat->AddEntry(pEntry);
m_pDoc->DeleteRow(0, 0, MAXCOL, 0, 4, 1);
OUString aStr = pEntry->GetExpression(ScAddress(0, 4, 0), 0);
CPPUNIT_ASSERT_EQUAL(OUString("B5"), aStr);
m_pDoc->DeleteTab(0);
}
void Test::testCondFormatUpdateReferenceInsRow()
{
m_pDoc->InsertTab(0, "test");
ScConditionEntry* pEntry = new ScConditionEntry(SC_COND_EQUAL, "B6", "", m_pDoc, ScAddress(0, 5, 0), "", "", formula::FormulaGrammar::GRAM_DEFAULT, formula::FormulaGrammar::GRAM_DEFAULT);
ScConditionalFormat* pFormat = new ScConditionalFormat(0, m_pDoc);
pFormat->SetRange(ScRange(0, 5, 0, 0, 5, 0));
m_pDoc->AddCondFormat(pFormat, 0);
pFormat->AddEntry(pEntry);
m_pDoc->InsertRow(0, 0, MAXCOL, 0, 4, 1);
OUString aStr = pEntry->GetExpression(ScAddress(0, 6, 0), 0);
CPPUNIT_ASSERT_EQUAL(OUString("B7"), aStr);
m_pDoc->DeleteTab(0);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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