diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-03-16 22:00:15 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-03-17 02:32:10 +0000 |
commit | 1bffa5e110772a7d6183ac64e56c23f2c3019f93 (patch) | |
tree | 91318f5b9dc10e90a70379d4cd5911c54e4a3583 /sc/qa | |
parent | 36d7e21c00d59eead018ad8ef339847a782b9734 (diff) |
add more conditional format one cell to range tests, related tdf#106242
Change-Id: I6daa394618f7d2b06251091497128fa96391d386
Reviewed-on: https://gerrit.libreoffice.org/35296
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc/qa')
-rw-r--r-- | sc/qa/unit/ucalc.hxx | 2 | ||||
-rw-r--r-- | sc/qa/unit/ucalc_condformat.cxx | 32 |
2 files changed, 34 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx index fb2390c1f5da..b172776c0ac5 100644 --- a/sc/qa/unit/ucalc.hxx +++ b/sc/qa/unit/ucalc.hxx @@ -469,6 +469,7 @@ public: void testCondCopyPasteSingleCell(); //e.g. fdo#82503 void testCondCopyPasteSingleCellToRange(); //e.g. fdo#82503 void testCondCopyPasteSingleRowToRange(); //e.g. tdf#106242 + void testCondCopyPasteSingleRowToRange2(); void testCondCopyPasteSheetBetweenDoc(); void testCondCopyPasteSheet(); void testIconSet(); @@ -747,6 +748,7 @@ public: CPPUNIT_TEST(testCondCopyPasteSingleCell); CPPUNIT_TEST(testCondCopyPasteSingleCellToRange); CPPUNIT_TEST(testCondCopyPasteSingleRowToRange); + CPPUNIT_TEST(testCondCopyPasteSingleRowToRange2); CPPUNIT_TEST(testCondCopyPasteSheetBetweenDoc); CPPUNIT_TEST(testCondCopyPasteSheet); CPPUNIT_TEST(testCondFormatEndsWithStr); diff --git a/sc/qa/unit/ucalc_condformat.cxx b/sc/qa/unit/ucalc_condformat.cxx index 0b0a8a2af97b..391766f9f146 100644 --- a/sc/qa/unit/ucalc_condformat.cxx +++ b/sc/qa/unit/ucalc_condformat.cxx @@ -411,6 +411,38 @@ void Test::testCondCopyPasteSingleRowToRange() m_pDoc->DeleteTab(0); } +void Test::testCondCopyPasteSingleRowToRange2() +{ + m_pDoc->InsertTab(0, "Test"); + + ScConditionalFormat* pFormat = new ScConditionalFormat(1, m_pDoc); + ScRange aCondFormatRange(0,0,0,0,0,0); + ScRangeList aRangeList(aCondFormatRange); + pFormat->SetRange(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 aClipDoc(SCDOCMODE_CLIP); + copyToClip(m_pDoc, ScRange(0,0,0,3,0,0), &aClipDoc); + ScRange aTargetRange(0,4,0,MAXCOL,4,0); + pasteOneCellFromClip(m_pDoc, aTargetRange, &aClipDoc); + + std::set<sal_uLong> aCondFormatIndices; + + for (SCCOL nCol = 0; nCol <= MAXCOL; ++nCol) + { + ScConditionalFormat* pNewFormat = m_pDoc->GetCondFormat(nCol, 4, 0); + if (nCol % 4 == 0) + CPPUNIT_ASSERT(pNewFormat); + else + CPPUNIT_ASSERT(!pNewFormat); + } + + m_pDoc->DeleteTab(0); +} + void Test::testCondCopyPasteSheetBetweenDoc() { m_pDoc->InsertTab(0, "Test"); |