summaryrefslogtreecommitdiff
path: root/sc/qa/unit
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/unit')
-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: */