summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-05-16 23:06:33 -0400
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-05-17 03:24:08 +0000
commit8549d1dbe648ce01e4a351eb301dcf146c62676d (patch)
tree098a400cf212bcf9cc6756570f78b39cab68a385
parent68ee7e9c423ba8ca01862435753105c7c28aa62e (diff)
fdo#77735: Don't proceed when all cells in the range are empty.
That means there is nothing to delete, and proceeding would cause Calc to freeze. Change-Id: I2a8fb5736870ba459082873c8f864283d8b9c664 (cherry picked from commit bc7e0967be52f5eb7948fbb1c30edc7dd5acc18d) Reviewed-on: https://gerrit.libreoffice.org/9388 Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r--sc/source/core/data/column4.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index 7996cd82441e..9a3ef12e6db3 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -53,6 +53,10 @@ void ScColumn::DeleteBeforeCopyFromClip( sc::CopyFromClipContext& rCxt, const Sc
sc::SingleColumnSpanSet::SpansType aSpans;
aSpanSet.getSpans(aSpans);
+ if (aSpans.empty())
+ // All cells in the range in the clip are empty. Nothing to delete.
+ return;
+
// Translate the clip column spans into the destination column, and repeat as needed.
std::vector<sc::RowSpan> aDestSpans;
SCROW nDestOffset = aRange.mnRow1 - nClipRow1;