summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-09-05 13:24:40 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-09-05 14:36:58 +0200
commitfd2f96c2ff83bee968fec8aa7c402ae02e78e2e4 (patch)
treed9ad1d437e308454f57aa892b683659a41f25470 /sc
parent6cc31515db179c61ec2269fa9fe939ad6ae7a9bc (diff)
add test case for fdo#67783
Change-Id: I3a8f99e00e12a6120a284afabbf51e6fbb36195b
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/ucalc.cxx44
-rw-r--r--sc/qa/unit/ucalc.hxx2
2 files changed, 46 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index ab227ea92c00..ad98b7df62cd 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -4138,6 +4138,50 @@ void Test::testCondFormatINSDEL()
m_pDoc->DeleteTab(0);
}
+void Test::testCondFormatInsertCol()
+{
+ m_pDoc->InsertTab(0, "Test");
+ ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0);
+
+ ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc);
+ ScRangeList aRangeList(ScRange(0,0,0,3,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,4,2);
+ const ScRangeList& rRange = pFormat->GetRange();
+ CPPUNIT_ASSERT_EQUAL(ScRangeList(ScRange(0,0,0,5,3,0)), rRange);
+
+ m_pDoc->DeleteTab(0);
+}
+
+void Test::testCondFormatInsertRow()
+{
+ m_pDoc->InsertTab(0, "Test");
+ ScConditionalFormatList* pList = m_pDoc->GetCondFormList(0);
+
+ ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc);
+ ScRangeList aRangeList(ScRange(0,0,0,3,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->InsertRow(0,0,MAXCOL,0,4,2);
+ const ScRangeList& rRange = pFormat->GetRange();
+ CPPUNIT_ASSERT_EQUAL(ScRangeList(ScRange(0,0,0,5,5,0)), rRange);
+
+ m_pDoc->DeleteTab(0);
+}
+
void Test::printRange(ScDocument* pDoc, const ScRange& rRange, const char* pCaption)
{
SCROW nRow1 = rRange.aStart.Row(), nRow2 = rRange.aEnd.Row();
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index fba750f8c488..9ad69b663701 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -271,6 +271,8 @@ public:
void testEditTextIterator();
void testCondFormatINSDEL();
+ void testCondFormatInsertRow();
+ void testCondFormatInsertCol();
CPPUNIT_TEST_SUITE(Test);
#if CALC_TEST_PERF