summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-11-26 20:34:45 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-11-26 20:35:56 -0500
commitaa2cc9505b476d2170913e1d4dc41313449fe996 (patch)
treeaa6c72c09b67c73b9be2f6db964ca6a1221e8da3 /sc/qa/unit
parent513eadd422ff6a41cfe9a16f82cf32872d729652 (diff)
Fix additional bugs in the vector array fetching code.
And a test case to catch it. Change-Id: I233269822b383afa9783bdc7318eddee31d1eaa3
Diffstat (limited to 'sc/qa/unit')
-rw-r--r--sc/qa/unit/ucalc_formula.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index ff89dbe74642..a51308c22f37 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -451,6 +451,25 @@ void Test::testFetchVectorRefArray()
CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 2, "baz"));
CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 3, "quack"));
+ // Column H starts with formula cells.
+ for (SCROW i = 0; i < 10; ++i)
+ m_pDoc->SetString(ScAddress(7,i,0), "=ROW()");
+
+ m_pDoc->CalcAll();
+ aArray = m_pDoc->FetchVectorRefArray(ScAddress(7,3,0), 3); // H4:H6
+ CPPUNIT_ASSERT_MESSAGE("Failed to fetch vector ref array.", aArray.isValid());
+ CPPUNIT_ASSERT_MESSAGE("Array should have a numeric array.", aArray.mpNumericArray);
+ CPPUNIT_ASSERT_MESSAGE("Array should NOT have a string array.", !aArray.mpStringArray);
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 0, 4.0));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 1, 5.0));
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 2, 6.0));
+
+ aArray = m_pDoc->FetchVectorRefArray(ScAddress(7,4,0), 10); // H5:H15
+ CPPUNIT_ASSERT_MESSAGE("Failed to fetch vector ref array.", aArray.isValid());
+ CPPUNIT_ASSERT_MESSAGE("Array should have a numeric array.", aArray.mpNumericArray);
+ CPPUNIT_ASSERT_MESSAGE("Array should NOT have a string array.", !aArray.mpStringArray);
+ CPPUNIT_ASSERT_MESSAGE("Unexpected string cell.", equals(aArray, 0, 5.0));
+
m_pDoc->DeleteTab(0);
}