[Libreoffice-commits] core.git: 2 commits - sc/qa sc/source
Kohei Yoshida
kohei.yoshida at collabora.com
Tue Apr 29 08:43:00 PDT 2014
sc/qa/unit/ucalc_formula.cxx | 22 ++++++++++++++++++++++
sc/source/core/data/document10.cxx | 4 ++++
2 files changed, 26 insertions(+)
New commits:
commit ea0ac020160207a08de3168142abc2a74f17afd6
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Tue Apr 29 11:40:06 2014 -0400
fdo#74322: Let's not handle cut mode here.
Things are a bit more complex in cut mode than what this method can handle.
Change-Id: Idadee23beff08c2df89d47bb237e8a2d2fd69dab
diff --git a/sc/source/core/data/document10.cxx b/sc/source/core/data/document10.cxx
index 2046b31..4112bb9 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -57,6 +57,10 @@ bool ScDocument::CopyOneCellFromClip(
sc::CopyFromClipContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 )
{
ScDocument* pClipDoc = rCxt.getClipDoc();
+ if (pClipDoc->GetClipParam().mbCutMode)
+ // We don't handle cut and paste or moving of cells here.
+ return false;
+
ScRange aClipRange = pClipDoc->GetClipParam().getWholeRange();
if (aClipRange.aStart != aClipRange.aEnd)
// The source is not really a single cell. Bail out.
commit fd65b90934d0c521de1f3b04214e364fd540f080
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Tue Apr 29 11:20:55 2014 -0400
fdo#74322: Additional test for the followup issue.
Change-Id: I971e7ea2535138eb4ac901c227c72a50578746a8
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index 937c96e..ae65185 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -1932,6 +1932,28 @@ void Test::testFormulaRefUpdateNamedExpressionMove()
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(0,9,0)));
CPPUNIT_ASSERT_EQUAL(6.0, m_pDoc->GetValue(ScAddress(0,10,0)));
+ // Clear and start over.
+ clearSheet(m_pDoc, 0);
+ m_pDoc->GetRangeName()->clear();
+
+ // Set value to B2.
+ m_pDoc->SetValue(ScAddress(1,1,0), 2.0);
+
+ // Define B2 as 'MyCell'.
+ bInserted = m_pDoc->InsertNewRangeName("MyCell", ScAddress(0,0,0), "$Test.$B$2");
+ CPPUNIT_ASSERT(bInserted);
+
+ // Set formula to B3 that references B2 via MyCell.
+ m_pDoc->SetString(ScAddress(1,2,0), "=MyCell*2");
+ CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(ScAddress(1,2,0)));
+
+ // Move B2 to D2.
+ bMoved = rFunc.MoveBlock(ScRange(1,1,0,1,1,0), ScAddress(3,1,0), true, true, false, true);
+ CPPUNIT_ASSERT(bMoved);
+
+ // Value in B3 should remain unchanged.
+ CPPUNIT_ASSERT_EQUAL(4.0, m_pDoc->GetValue(ScAddress(1,2,0)));
+
m_pDoc->DeleteTab(0);
}
More information about the Libreoffice-commits
mailing list