summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-09-07 13:19:14 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-09-07 19:36:07 +0200
commitf0b0c7a23f2d36437d845b7f53defe25dfe8cef0 (patch)
treec7d88f1f1934e774c752ba2d4c763a9a745097c2 /sc
parentb2111e6b15b7a2ee3849d48605f3d6507463028b (diff)
add test for duplicated conditional formats
Change-Id: If6d24cba87eebf6ddbb0d5392d653890ff99ef04
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/ucalc.cxx22
-rw-r--r--sc/qa/unit/ucalc.hxx2
2 files changed, 24 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index f90c544f20ec..3f88cf5cf81d 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -7096,6 +7096,28 @@ void Test::testCondCopyPasteSingleCell()
m_pDoc->DeleteTab(0);
}
+void Test::testCopySheetCondFormat()
+{
+ m_pDoc->InsertTab(0, "Test");
+
+ ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc);
+ ScRange aCondFormatRange(0,0,0,3,3,0);
+ ScRangeList aRangeList(aCondFormatRange);
+ 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->AddCondFormat(pFormat, 0);
+
+ ScDocument aDoc;
+ aDoc.TransferTab(m_pDoc, 0, 0, true);
+
+ ScConditionalFormatList* pList = aDoc.GetCondFormList(0);
+ CPPUNIT_ASSERT_EQUAL(size_t(1), pList->size());
+
+ m_pDoc->DeleteTab(0);
+}
+
void Test::testIconSet()
{
m_pDoc->InsertTab(0, "Test");
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index ec9542c4bc66..2bb3afbb0cfe 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -377,6 +377,7 @@ public:
void testCondFormatInsertDeleteSheets();
void testCondCopyPaste();
void testCondCopyPasteSingleCell(); //e.g. fdo#82503
+ void testCopySheetCondFormat();
void testIconSet();
void testImportStream();
@@ -558,6 +559,7 @@ public:
CPPUNIT_TEST(testCondFormatInsertDeleteSheets);
CPPUNIT_TEST(testCondCopyPaste);
CPPUNIT_TEST(testCondCopyPasteSingleCell);
+ CPPUNIT_TEST(testCopySheetCondFormat);
CPPUNIT_TEST(testIconSet);
CPPUNIT_TEST(testImportStream);
CPPUNIT_TEST(testDeleteContents);