summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-10-28 23:34:39 +0100
committerEike Rathke <erack@redhat.com>2015-10-28 23:37:17 +0100
commit9d28748d4b6d97bf0d18956e9e0336d71d9fc718 (patch)
treed08c75d3fe5e477b47b3e1ff7628fd946bdc0b8e /sc
parentb5cd11b4b02a85a83db77ba9d8d1763f0cd88cb1 (diff)
unit test for tdf#95395
Change-Id: I8bbd70f6740019bebc23d20259f923b8f87d4329
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/ucalc_formula.cxx23
1 files changed, 23 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index c9815a77bacc..6972517a7d00 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -4188,6 +4188,29 @@ void Test::testFuncVLOOKUP()
m_pDoc->SetString(ScAddress(2,0,0), "=VLOOKUP(\"C\";A1:A16;1)");
CPPUNIT_ASSERT_EQUAL(OUString("C"), m_pDoc->GetString(ScAddress(2,0,0)));
+
+ // A21:E24, test position dependent implicit intersection as argument to a
+ // scalar value parameter in a function that has a ReferenceOrForceArray
+ // type parameter somewhere else and formula is not in array mode,
+ // VLOOKUP(Value;ReferenceOrForceArray;...)
+ const char* aData2[][5] = {
+ { "1", "one", "3", "=VLOOKUP(C21:C24;A21:B24;2;0)", "three" },
+ { "2", "two", "1", "=VLOOKUP(C21:C24;A21:B24;2;0)", "one" },
+ { "3", "three", "4", "=VLOOKUP(C21:C24;A21:B24;2;0)", "four" },
+ { "4", "four", "2", "=VLOOKUP(C21:C24;A21:B24;2;0)", "two" }
+ };
+
+ ScAddress aPos2(0,20,0);
+ ScRange aRange2 = insertRangeData(m_pDoc, aPos2, aData2, SAL_N_ELEMENTS(aData2));
+ CPPUNIT_ASSERT(aRange2.aStart == aPos2);
+
+ aPos2.SetCol(3); // column D formula results
+ for (size_t i=0; i < SAL_N_ELEMENTS(aData2); ++i)
+ {
+ CPPUNIT_ASSERT_EQUAL( OUString::createFromAscii( aData2[i][4]), m_pDoc->GetString(aPos2));
+ aPos2.IncRow();
+ }
+
m_pDoc->DeleteTab(0);
}