diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-09-21 10:21:31 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-09-25 23:27:09 +0000 |
commit | cb64e937139dad31279078ca464157190cb54350 (patch) | |
tree | 2923c1cf47ad617dcd51117a5ddae318ef65038b /sc/qa | |
parent | c6ed68c6324f909f3338cde0983aaaff17a801ab (diff) |
add test for tdf#100393
Change-Id: Iee500b1721dc8cc8e76f86bd152353a4b0c67556
Reviewed-on: https://gerrit.libreoffice.org/29257
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_condformat.cxx | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/sc/qa/unit/ucalc_condformat.cxx b/sc/qa/unit/ucalc_condformat.cxx index 8ddbd6464fcb..93ce111cefd6 100644 --- a/sc/qa/unit/ucalc_condformat.cxx +++ b/sc/qa/unit/ucalc_condformat.cxx @@ -350,27 +350,30 @@ void Test::testCondCopyPasteSingleCellToRange() ScDocument aClipDoc(SCDOCMODE_CLIP); copyToClip(m_pDoc, ScRange(0,0,0,0,0,0), &aClipDoc); - ScRange aTargetRange(4,4,0,4,8,0); + ScRange aTargetRange(4,4,0,5,8,0); pasteFromClip(m_pDoc, aTargetRange, &aClipDoc); std::set<sal_uLong> aCondFormatIndices; for(SCROW nRow = 4; nRow <= 8; ++nRow) { - ScConditionalFormat* pPastedFormat = m_pDoc->GetCondFormat(4, nRow, 0); - CPPUNIT_ASSERT(pPastedFormat); - - CPPUNIT_ASSERT_EQUAL(ScRangeList(ScRange(4, nRow, 0)), pPastedFormat->GetRange()); - sal_uLong nPastedKey = pPastedFormat->GetKey(); - CPPUNIT_ASSERT( nIndex != nPastedKey); - const SfxPoolItem* pItem = m_pDoc->GetAttr( 4, nRow, 0, ATTR_CONDITIONAL ); - const ScCondFormatItem* pCondFormatItem = static_cast<const ScCondFormatItem*>(pItem); - - CPPUNIT_ASSERT(pCondFormatItem); - CPPUNIT_ASSERT_EQUAL(size_t(1), pCondFormatItem->GetCondFormatData().size()); - CPPUNIT_ASSERT( nIndex != pCondFormatItem->GetCondFormatData().at(0) ); - auto itr = aCondFormatIndices.find(nPastedKey); - CPPUNIT_ASSERT(itr == aCondFormatIndices.end()); - aCondFormatIndices.insert(nPastedKey); + for (SCCOL nCol = 4; nCol <= 5; ++nCol) + { + ScConditionalFormat* pPastedFormat = m_pDoc->GetCondFormat(nCol, nRow, 0); + CPPUNIT_ASSERT(pPastedFormat); + + CPPUNIT_ASSERT_EQUAL(ScRangeList(ScRange(nCol, nRow, 0)), pPastedFormat->GetRange()); + sal_uLong nPastedKey = pPastedFormat->GetKey(); + CPPUNIT_ASSERT( nIndex != nPastedKey); + const SfxPoolItem* pItem = m_pDoc->GetAttr( nCol, nRow, 0, ATTR_CONDITIONAL ); + const ScCondFormatItem* pCondFormatItem = static_cast<const ScCondFormatItem*>(pItem); + + CPPUNIT_ASSERT(pCondFormatItem); + CPPUNIT_ASSERT_EQUAL(size_t(1), pCondFormatItem->GetCondFormatData().size()); + CPPUNIT_ASSERT( nIndex != pCondFormatItem->GetCondFormatData().at(0) ); + auto itr = aCondFormatIndices.find(nPastedKey); + CPPUNIT_ASSERT(itr == aCondFormatIndices.end()); + aCondFormatIndices.insert(nPastedKey); + } } m_pDoc->DeleteTab(0); |