summaryrefslogtreecommitdiff
path: root/sc/qa/unit/ucalc.hxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-07-11 12:27:38 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-07-11 12:30:16 -0400
commit96086484d3429ff849b468ef5d1ff8ac8e7874a9 (patch)
tree0cd38cc3bb590055367e607b6a5c6c196b7f668a /sc/qa/unit/ucalc.hxx
parent67ffff37ed16dff6529daf36835554f54a28fe5e (diff)
Move pivot table tests into a separate source file.
Change-Id: Ie32999007bbeaff4076195c68f2537ba0da6148b
Diffstat (limited to 'sc/qa/unit/ucalc.hxx')
-rw-r--r--sc/qa/unit/ucalc.hxx28
1 files changed, 28 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index 04896833a0cc..55e3f7ce678d 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -11,6 +11,7 @@
#define SC_UCALC_HXX
#include "helper/qahelper.hxx"
+#include "document.hxx"
struct TestImpl;
class ScUndoPaste;
@@ -31,11 +32,38 @@ class Test : public test::BootstrapFixture
{
public:
+ static void printRange(ScDocument* pDoc, const ScRange& rRange, const char* pCaption);
static void clearRange(ScDocument* pDoc, const ScRange& rRange);
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);
+ template<size_t _Size>
+ static ScRange insertRangeData(ScDocument* pDoc, const ScAddress& rPos, const char* aData[][_Size], size_t nRowCount)
+ {
+ ScRange aRange(rPos);
+ aRange.aEnd.SetCol(rPos.Col()+_Size-1);
+ aRange.aEnd.SetRow(rPos.Row()+nRowCount-1);
+
+ clearRange(pDoc, aRange);
+
+ for (size_t i = 0; i < _Size; ++i)
+ {
+ for (size_t j = 0; j < nRowCount; ++j)
+ {
+ if (!aData[j][i])
+ continue;
+
+ SCCOL nCol = i + rPos.Col();
+ SCROW nRow = j + rPos.Row();
+ pDoc->SetString(nCol, nRow, rPos.Tab(), OUString(aData[j][i], strlen(aData[j][i]), RTL_TEXTENCODING_UTF8));
+ }
+ }
+
+ printRange(pDoc, aRange, "Range data content");
+ return aRange;
+ }
+
Test();
~Test();