Kaydet (Commit) 8da96df8 authored tarafından Markus Mohrhard's avatar Markus Mohrhard Kaydeden (comit) Andras Timar

add test for cond format copy&paste whole sheet

Conflicts:
	sc/qa/unit/ucalc.cxx
	sc/qa/unit/ucalc.hxx

Change-Id: I6e15bec2e1a2593b965df4c105758dc4bf22061f
üst 824ee35a
......@@ -4968,6 +4968,39 @@ void Test::testCondCopyPasteSheetBetweenDoc()
m_pDoc->DeleteTab(0);
}
void Test::testCondCopyPasteSheet()
{
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);
m_pDoc->CopyTab(0, SC_TAB_APPEND);
ScConditionalFormatList* pList = m_pDoc->GetCondFormList(1);
CPPUNIT_ASSERT_EQUAL(size_t(1), pList->size());
ScConditionalFormat& rFormat = *pList->begin();
const ScRangeList& rRange = rFormat.GetRange();
CPPUNIT_ASSERT_EQUAL(ScRangeList(ScRange(0,0,1,3,3,1)), rRange);
sal_uInt32 nKey = rFormat.GetKey();
const SfxPoolItem* pItem = m_pDoc->GetAttr( 2, 2, 1, ATTR_CONDITIONAL );
const ScCondFormatItem* pCondFormatItem = static_cast<const ScCondFormatItem*>(pItem);
CPPUNIT_ASSERT(pCondFormatItem);
CPPUNIT_ASSERT_EQUAL(size_t(1), pCondFormatItem->GetCondFormatData().size());
CPPUNIT_ASSERT( nKey == pCondFormatItem->GetCondFormatData().at(0) );
m_pDoc->DeleteTab(1);
m_pDoc->DeleteTab(0);
}
void Test::testMixData()
{
m_pDoc->InsertTab(0, "Test");
......
......@@ -302,6 +302,7 @@ public:
void testCondFormatInsertRow();
void testCondFormatInsertCol();
void testCondCopyPasteSheetBetweenDoc();
void testCondCopyPasteSheet();
CPPUNIT_TEST_SUITE(Test);
#if CALC_TEST_PERF
......@@ -414,6 +415,7 @@ public:
CPPUNIT_TEST(testEditTextIterator);
CPPUNIT_TEST(testCondFormatINSDEL);
CPPUNIT_TEST(testCondCopyPasteSheetBetweenDoc);
CPPUNIT_TEST(testCondCopyPasteSheet);
CPPUNIT_TEST_SUITE_END();
private:
......
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