[Libreoffice-commits] core.git: sc/qa

Markus Mohrhard markus.mohrhard at googlemail.com
Mon Apr 10 23:56:21 UTC 2017


 sc/qa/unit/ucalc.hxx         |    1 +
 sc/qa/unit/ucalc_formula.cxx |   26 ++++++++++++++++++++++++++
 2 files changed, 27 insertions(+)

New commits:
commit 98ebfb6a8638a76e96ffe7ada2485b3d13ed1fb9
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Mon Apr 10 23:32:29 2017 +0200

    add test for tdf#105245
    
    Change-Id: I4760ede6d14429be811fe96b28bf1c7663592678
    Reviewed-on: https://gerrit.libreoffice.org/36394
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

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: */


More information about the Libreoffice-commits mailing list