summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-12-17 15:14:08 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-12-18 10:13:31 -0500
commitd76bc6b5c719e525cd262ade54c3e99a7644acf2 (patch)
tree41b24008aa9f7f8c7d2b7b1bc6ce234a6a60a4ba
parent49c2c79286344cdbaf30999d2e6262b032db97df (diff)
Re-organize it a bit.
Change-Id: Idbd8c62a51e2de9df0396c2f18b8b25f0ad8ebf2
-rw-r--r--sc/source/ui/docshell/datastream.cxx16
1 files changed, 12 insertions, 4 deletions
diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx
index 42858ddaadc8..423ce0740ad8 100644
--- a/sc/source/ui/docshell/datastream.cxx
+++ b/sc/source/ui/docshell/datastream.cxx
@@ -352,14 +352,22 @@ void DataStream::MoveData()
meMove = MOVE_UP;
break;
case MOVE_UP:
- // Remove the top row and shift the remaining rows upward.
+ if (!mpEndRange)
+ break;
+
+ // Remove the top row and shift the remaining rows upward. Then
+ // insert a new row at the end row position.
mpDoc->DeleteRow(maStartRange);
mpDoc->InsertRow(*mpEndRange);
break;
case MOVE_DOWN:
- if (mpEndRange)
- mpDoc->DeleteRow(*mpEndRange);
- mpDoc->InsertRow(maRange);
+ if (!mpEndRange)
+ break;
+
+ // Remove the end row and shift the remaining rows downward by
+ // inserting a new row at the top row.
+ mpDoc->DeleteRow(*mpEndRange);
+ mpDoc->InsertRow(maStartRange);
break;
case NO_MOVE:
break;