summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-04-10 23:32:29 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-04-11 01:55:59 +0200
commit98ebfb6a8638a76e96ffe7ada2485b3d13ed1fb9 (patch)
treefc9e9388ce3c64da906921447692218a3883135a
parentcb57a432ba98ffe197c8fd2528e4b363c3285cc4 (diff)
add test for tdf#105245
Change-Id: I4760ede6d14429be811fe96b28bf1c7663592678 Reviewed-on: https://gerrit.libreoffice.org/36394 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--sc/qa/unit/ucalc.hxx1
-rw-r--r--sc/qa/unit/ucalc_formula.cxx26
2 files changed, 27 insertions, 0 deletions
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index de92fe9245ce..8a05d9653508 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -166,6 +166,7 @@ public:
void testFormulaRefUpdateNameDelete();
void testFormulaRefUpdateValidity();
void testTokenArrayRefUpdateMove();
+ void testSingleCellCopyColumnLabel();
void testMultipleOperations();
void testFuncCOLUMN();
void testFuncCOUNT();
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 0c552491fcdc..5336107f0bb2 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -30,6 +30,7 @@
#include <scitems.hxx>
#include <patattr.hxx>
#include <docpool.hxx>
+#include "docoptio.hxx"
#include <formula/vectortoken.hxx>
#include <officecfg/Office/Common.hxx>
@@ -7711,4 +7712,29 @@ void Test::testRefR1C1WholeRow()
m_pDoc->DeleteTab(0);
}
+void Test::testSingleCellCopyColumnLabel()
+{
+ ScDocOptions aOptions = m_pDoc->GetDocOptions();
+ aOptions.SetLookUpColRowNames(true);
+ m_pDoc->SetDocOptions(aOptions);
+ m_pDoc->InsertTab(0, "Test");
+
+ m_pDoc->SetString(0, 0, 0, "a");
+ m_pDoc->SetValue(0, 1, 0, 1.0);
+ m_pDoc->SetValue(0, 2, 0, 2.0);
+ m_pDoc->SetValue(0, 3, 0, 3.0);
+ m_pDoc->SetString(1, 1, 0, "='a'");
+
+ double nVal = m_pDoc->GetValue(1, 1, 0);
+ ASSERT_DOUBLES_EQUAL(1.0, nVal);
+
+ ScDocument aClipDoc(SCDOCMODE_CLIP);
+ copyToClip(m_pDoc, ScRange(1, 1, 0), &aClipDoc);
+ pasteOneCellFromClip(m_pDoc, ScRange(1, 2, 0), &aClipDoc);
+ nVal = m_pDoc->GetValue(1, 2, 0);
+ ASSERT_DOUBLES_EQUAL(2.0, nVal);
+
+ m_pDoc->DeleteTab(0);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */