From c6745d1b5b0af8284f8dd485046ec570c4ca68e0 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 13 Oct 2018 14:02:03 +0200 Subject: [PATCH] fixes 0003610: App::PropertyFloatList not updating in Spreadsheet --- src/Mod/Spreadsheet/App/PropertySheet.cpp | 37 ++++++++++++++++++----- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/src/Mod/Spreadsheet/App/PropertySheet.cpp b/src/Mod/Spreadsheet/App/PropertySheet.cpp index b8a05892d1..1006f80e89 100644 --- a/src/Mod/Spreadsheet/App/PropertySheet.cpp +++ b/src/Mod/Spreadsheet/App/PropertySheet.cpp @@ -1079,15 +1079,38 @@ void PropertySheet::recomputeDependants(const Property *prop) std::string fullName = std::string(docName) + "#" + std::string(nameInDoc) + "." + std::string(name); std::map >::const_iterator i = propertyNameToCellMap.find(fullName); - if (i == propertyNameToCellMap.end()) - return; + if (i != propertyNameToCellMap.end()) { + std::set::const_iterator j = i->second.begin(); + std::set::const_iterator end = i->second.end(); - std::set::const_iterator j = i->second.begin(); - std::set::const_iterator end = i->second.end(); + while (j != end) { + setDirty(*j); + ++j; + } + } + else if (prop->isDerivedFrom(App::PropertyLists::getClassTypeId())) { + // #0003610: + // Inside propertyNameToCellMap we keep a string including the + // index operator of the property. From the given property we + // can't build 'fullName' to include this index, so we must go + // through all elements and check for a string of the form: + // 'fullName[index]' and set dirty the appropriate cells. + std::string fullNameIndex = "^"; + fullNameIndex += fullName; + fullNameIndex += "\\[[0-9]+\\]$"; + boost::regex rx(fullNameIndex); + boost::cmatch what; + for (auto i : propertyNameToCellMap) { + if (boost::regex_match(i.first.c_str(), what, rx)) { + std::set::const_iterator j = i.second.begin(); + std::set::const_iterator end = i.second.end(); - while (j != end) { - setDirty(*j); - ++j; + while (j != end) { + setDirty(*j); + ++j; + } + } + } } } }