From 1c0e152adaba1b45d0e2cbe83d8f7834b1937eda Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 22 May 2013 11:17:52 -0400 Subject: Use the block position of the destination, not of the source. And a test to catch this. Change-Id: Ia73be239b4be96cbe029390efbbec5f49e429652 (cherry picked from commit 6958b6a3ce9f28bed2a529939e7740452929a5b3) --- sc/qa/unit/ucalc.cxx | 1 + sc/source/core/data/column.cxx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx index 36a59fac33b0..90da5f0d0b57 100644 --- a/sc/qa/unit/ucalc.cxx +++ b/sc/qa/unit/ucalc.cxx @@ -4494,6 +4494,7 @@ void Test::testPivotTableDocFunc() void Test::testSheetCopy() { m_pDoc->InsertTab(0, "TestTab"); + m_pDoc->SetString(ScAddress(0,0,0), "copy me"); CPPUNIT_ASSERT_MESSAGE("document should have one sheet to begin with.", m_pDoc->GetTableCount() == 1); SCROW nRow1, nRow2; bool bHidden = m_pDoc->RowHidden(0, 0, &nRow1, &nRow2); diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 10d36b6f142b..dfbc21d3115e 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1444,7 +1444,7 @@ void ScColumn::CopyToColumn( // Special case to allow removing of cell instances. A // string cell with empty content is used to indicate an // empty cell. - sc::ColumnBlockPosition* p = rCxt.getBlockPosition(nTab, nCol); + sc::ColumnBlockPosition* p = rCxt.getBlockPosition(rColumn.nTab, rColumn.nCol); if (pNew->GetCellType() == CELLTYPE_STRING) { OUString aStr = static_cast(pNew)->GetString(); -- cgit v1.2.3