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>
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index de92fe9..8a05d96 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 0c55249..5336107 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: */