summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-11-01 20:16:15 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-11-01 20:16:54 -0400
commit157b804ba1dad4b857bd723c454ab907b623a980 (patch)
tree03100def210da04f3105880a79f9fd7135b12a4c /sc/source
parentf978013f9b8d5256aa029a3572d905bebb55c5f4 (diff)
Add comments to make it easier to follow this non-obvious code.
Change-Id: Ib3d3e5b57799c22916845899839ddcc9a81e9b98
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/core/data/column.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 1321cd23c323..5debdd10ff4a 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1484,6 +1484,7 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol)
SCSIZE i;
Search( nStartRow, i); // i points to start row or position thereafter
SCSIZE nStartPos = i;
+ // First, copy the cell instances to the new column.
for ( ; i < maItems.size() && maItems[i].nRow <= nEndRow; ++i)
{
SCROW nRow = maItems[i].nRow;
@@ -1531,15 +1532,16 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol)
nStartPos = (*it).first;
nStopPos = (*it).second;
for (i=nStartPos; i<nStopPos; ++i)
- maItems[i].pCell = pNoteCell;
+ maItems[i].pCell = pNoteCell; // Assign the dumpy cell instance to all slots.
for (i=nStartPos; i<nStopPos; ++i)
{
rAddress.SetRow( maItems[i].nRow );
pDocument->AreaBroadcast( aHint );
}
+ // Erase the slots containing pointers to the dummy cell instance.
maItems.erase(maItems.begin() + nStartPos, maItems.begin() + nStopPos);
}
- pNoteCell->Delete();
+ pNoteCell->Delete(); // Delete the dummy cell instance.
}
}