[Libreoffice-commits] core.git: sc/qa
Markus Mohrhard
markus.mohrhard at googlemail.com
Sun Sep 25 23:29:17 UTC 2016
sc/qa/unit/ucalc_condformat.cxx | 35 +++++++++++++++++++----------------
1 file changed, 19 insertions(+), 16 deletions(-)
New commits:
commit cb64e937139dad31279078ca464157190cb54350
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Wed Sep 21 10:21:31 2016 +0200
add test for tdf#100393
Change-Id: Iee500b1721dc8cc8e76f86bd152353a4b0c67556
Reviewed-on: https://gerrit.libreoffice.org/29257
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/sc/qa/unit/ucalc_condformat.cxx b/sc/qa/unit/ucalc_condformat.cxx
index 8ddbd64..93ce111 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);
More information about the Libreoffice-commits
mailing list