From ae6b93420739bdba2a96859795645b9cd84e421b Mon Sep 17 00:00:00 2001 From: Eivind Kvedalen Date: Thu, 3 Dec 2015 21:50:46 +0100 Subject: [PATCH] Spreadsheet: Fixed PropertySheet::Paste(); undo did not work correctly. --- src/Mod/Spreadsheet/App/PropertySheet.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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;