summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-03-25 14:51:27 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-03-26 09:47:30 +0100
commit80996c374b4ff2514b2e952cfd572ae499b481a1 (patch)
tree5a4a6b2c50e2a7c6f60ab7a83969346cd91cdcb6
parentb23214f768e94f3fbdb0317b5fd458c55a9118db (diff)
add inital test case for fdo#62206
Change-Id: I0a88f4cbd70f5acf84b9c1c6704ac0be92b79c5b
-rw-r--r--sc/qa/unit/ucalc.cxx29
1 files changed, 29 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index f72bdd0c60b2..ec0769588db1 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -68,6 +68,8 @@
#include "interpre.hxx"
#include "columniterator.hxx"
#include "types.hxx"
+#include "conditio.hxx"
+#include "globstr.hrc"
#include "formula/IFunctionDescription.hxx"
@@ -272,6 +274,7 @@ public:
* Test formula & formula grouping
*/
void testFormulaGrouping();
+ void testCondFormatINSDEL();
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(testCollator);
@@ -336,6 +339,7 @@ public:
CPPUNIT_TEST(testAnchoredRotatedShape);
CPPUNIT_TEST(testCellTextWidth);
CPPUNIT_TEST(testFormulaGrouping);
+ CPPUNIT_TEST(testCondFormatINSDEL);
CPPUNIT_TEST_SUITE_END();
private:
@@ -6274,6 +6278,31 @@ void Test::testFormulaGrouping()
}
}
+void Test::testCondFormatINSDEL()
+{
+ // fdo#62206
+ m_pDoc->InsertTab(0, "Test");
+ ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0);
+
+ ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc);
+ ScRangeList aRangeList(ScRange(0,0,0,0,3,0));
+ pFormat->AddRange(aRangeList);
+ ScCondFormatEntry* pEntry = new ScCondFormatEntry(SC_COND_DIRECT,"=B2","",m_pDoc,ScAddress(0,0,0),ScGlobal::GetRscString(STR_STYLENAME_RESULT));
+ pFormat->AddEntry(pEntry);
+
+ m_pDoc->AddCondFormatData(pFormat->GetRange(), 0, 1);
+ pList->InsertNew(pFormat);
+
+ m_pDoc->InsertCol(0,0,MAXROW,0,0,2);
+ const ScRangeList& rRange = pFormat->GetRange();
+ CPPUNIT_ASSERT(rRange == ScRange(2,0,0,2,3,0));
+
+ OUString aExpr = pEntry->GetExpression(ScAddress(2,0,0), 0);
+ CPPUNIT_ASSERT_EQUAL(aExpr, OUString("D2"));
+
+ m_pDoc->DeleteTab(0);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
}