diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-15 15:15:57 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-15 22:12:41 -0400 |
commit | a9ec5f51e13adef2cc2d03e8073e9b6013598309 (patch) | |
tree | 021441cda5ddde5ad0dd29feb3ad836bf00bf837 | |
parent | 6b51a4e7a3f511fc1dce0b21fe7926d303e9afbf (diff) |
Unit test to catch the out-of-sync text width bug I just fixed today.
Change-Id: I82d4199d7f8b7ba2dadb734a808dac53e845538f
-rw-r--r-- | sc/qa/unit/ucalc.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index f34dfb57710c..ec9465228ee5 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -6102,6 +6102,22 @@ void Test::testCellTextWidth() CPPUNIT_ASSERT_MESSAGE("Iterator should have ended.", !pIter->hasCell()); } + // Delete row 2 which shifts all cells below row 2 upward. After this, we + // should only have cells at rows 0 and 17. + m_pDoc->DeleteRow(0, 0, MAXCOL, MAXTAB, 2, 1); + { + // Full range again. + pIter.reset(new ScColumnTextWidthIterator(*m_pDoc, aTopCell, MAXROW)); + SCROW aRows[] = { 0, 17 }; + size_t n = SAL_N_ELEMENTS(aRows); + for (size_t i = 0; i < n; ++i, pIter->next()) + { + CPPUNIT_ASSERT_MESSAGE("Cell expected, but not there.", pIter->hasCell()); + CPPUNIT_ASSERT_EQUAL(aRows[i], pIter->getPos()); + } + CPPUNIT_ASSERT_MESSAGE("Iterator should have ended.", !pIter->hasCell()); + } + m_pDoc->DeleteTab(0); } |