summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/core/data/column.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 5fb98a2b2f1c..ac4850ecea09 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1258,8 +1258,11 @@ void ScColumn::CopyStaticToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDestCol
// Determine the range of cells in the original column that need to be copied.
it = std::find_if(maItems.begin(), maItems.end(), FindInRows(nRow1, nRow2));
- if (it != maItems.end())
- itEnd = std::find_if(it, maItems.end(), FindAboveRow(nRow2));
+ if (it == maItems.end())
+ // Nothing to copy.
+ return;
+
+ itEnd = std::find_if(it, maItems.end(), FindAboveRow(nRow2));
// Clone and staticize all cells that need to be copied.
std::vector<ColEntry> aCopied;