summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-05-22 11:17:52 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-05-22 12:21:45 -0400
commit1c0e152adaba1b45d0e2cbe83d8f7834b1937eda (patch)
tree8f375ef805b64cf0fba646e2f32eab1cd03c08b4
parent0ba159e33bb8f47250f57f377af40f7ca941c89c (diff)
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)
-rw-r--r--sc/qa/unit/ucalc.cxx1
-rw-r--r--sc/source/core/data/column.cxx2
2 files changed, 2 insertions, 1 deletions
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<ScStringCell*>(pNew)->GetString();