Kaydet (Commit) e5802954 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

fdo#75642: Add test case for this.

Change-Id: I220cc3aeac79325e7664461d3bd5219e9e1f04f7
üst 72922d8f
......@@ -5575,6 +5575,12 @@ void Test::clearRange(ScDocument* pDoc, const ScRange& rRange)
rRange.aEnd.Col(), rRange.aEnd.Row(), aMarkData, IDF_CONTENTS);
}
void Test::clearSheet(ScDocument* pDoc, SCTAB nTab)
{
ScRange aRange(0,0,nTab,MAXCOL,MAXROW,nTab);
clearRange(pDoc, aRange);
}
void Test::copyToClip(ScDocument* pSrcDoc, const ScRange& rRange, ScDocument* pClipDoc)
{
ScClipParam aClipParam(rRange, false);
......
......@@ -42,6 +42,7 @@ public:
static bool insertRangeNames(ScDocument* pDoc, const RangeNameDef* p, const RangeNameDef* pEnd);
static void printRange(ScDocument* pDoc, const ScRange& rRange, const char* pCaption);
static void clearRange(ScDocument* pDoc, const ScRange& rRange);
static void clearSheet(ScDocument* pDoc, SCTAB nTab);
static void copyToClip(ScDocument* pSrcDoc, const ScRange& rRange, ScDocument* pClipDoc);
static void pasteFromClip(ScDocument* pDestDoc, const ScRange& rDestRange, ScDocument* pClipDoc);
static ScUndoPaste* createUndoPaste(ScDocShell& rDocSh, const ScRange& rRange, ScDocument* pUndoDoc);
......
......@@ -2458,7 +2458,7 @@ void Test::testFuncVLOOKUP()
}
// Clear the sheet and start over.
clearRange(m_pDoc, ScRange(0,0,0,MAXCOL,MAXROW,0));
clearSheet(m_pDoc, 0);
// Lookup on sorted data intersparsed with empty cells.
......@@ -2492,6 +2492,22 @@ void Test::testFuncVLOOKUP()
CPPUNIT_ASSERT_EQUAL(OUString("Four"), m_pDoc->GetString(ScAddress(4,3,0)));
CPPUNIT_ASSERT_EQUAL(OUString("Four"), m_pDoc->GetString(ScAddress(4,4,0)));
// Start over again.
clearSheet(m_pDoc, 0);
// Set A,B,....,G to A1:A7.
m_pDoc->SetString(ScAddress(0,0,0), "A");
m_pDoc->SetString(ScAddress(0,1,0), "B");
m_pDoc->SetString(ScAddress(0,2,0), "C");
m_pDoc->SetString(ScAddress(0,3,0), "D");
m_pDoc->SetString(ScAddress(0,4,0), "E");
m_pDoc->SetString(ScAddress(0,5,0), "F");
m_pDoc->SetString(ScAddress(0,6,0), "G");
// Set the formula in C1.
m_pDoc->SetString(ScAddress(2,0,0), "=VLOOKUP(\"C\";A1:A16;1)");
CPPUNIT_ASSERT_EQUAL(OUString("C"), m_pDoc->GetString(ScAddress(2,0,0)));
m_pDoc->DeleteTab(0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment