diff --git a/src/Mod/Spreadsheet/App/PropertySheet.cpp b/src/Mod/Spreadsheet/App/PropertySheet.cpp index eeeb7b387..d851ff14f 100644 --- a/src/Mod/Spreadsheet/App/PropertySheet.cpp +++ b/src/Mod/Spreadsheet/App/PropertySheet.cpp @@ -260,9 +260,15 @@ void PropertySheet::Paste(const Property &from) while (icurr != data.end()) { Cell * cell = icurr->second; - if (cell->isMarked()) - clear(ifrom->first); - ++icurr; + if (cell->isMarked()) { + std::map::iterator next = icurr; + + ++next; + clear(icurr->first); + icurr = next; + } + else + ++icurr; } mergedCells = froms->mergedCells;