diff --git a/src/Mod/Spreadsheet/App/Cell.cpp b/src/Mod/Spreadsheet/App/Cell.cpp index c929d10c56..0c7063780a 100644 --- a/src/Mod/Spreadsheet/App/Cell.cpp +++ b/src/Mod/Spreadsheet/App/Cell.cpp @@ -585,9 +585,9 @@ bool Cell::getSpans(int &rows, int &columns) const return isUsed(SPANS_SET); } -void Cell::setException(const std::string &e) +void Cell::setException(const std::string &e, bool silent) { - if(e.size() && owner && owner->sheet()) { + if(!silent && e.size() && owner && owner->sheet()) { FC_ERR(owner->sheet()->getFullName() << '.' << address.toString() << ": " << e); } diff --git a/src/Mod/Spreadsheet/App/Cell.h b/src/Mod/Spreadsheet/App/Cell.h index e8bdb1e669..3268a25277 100644 --- a/src/Mod/Spreadsheet/App/Cell.h +++ b/src/Mod/Spreadsheet/App/Cell.h @@ -85,7 +85,7 @@ public: void setSpans(int rows, int columns); bool getSpans(int & rows, int & columns) const; - void setException(const std::string & e); + void setException(const std::string & e, bool silent=false); void clearException(); diff --git a/src/Mod/Spreadsheet/App/Sheet.cpp b/src/Mod/Spreadsheet/App/Sheet.cpp index 7efe50be57..85c8e93a05 100644 --- a/src/Mod/Spreadsheet/App/Sheet.cpp +++ b/src/Mod/Spreadsheet/App/Sheet.cpp @@ -858,15 +858,15 @@ DocumentObjectExecReturn *Sheet::execute(void) FC_LOG(addr.toString()); recomputeCell(addr); } - } catch (std::exception&) { + } catch (std::exception &) { for(auto &v : VertexList) { Cell * cell = cells.getValue(v.first); // Mark as erroneous - cellErrors.insert(v.first); - if (cell) - cell->setException("Pending computation due to cyclic dependency"); - updateProperty(v.first); - updateAlias(v.first); + if(cell) { + cellErrors.insert(v.first); + cell->setException("Pending computation due to cyclic dependency",true); + cellUpdated(v.first); + } } // Try to be more user friendly by finding individual loops @@ -912,10 +912,10 @@ DocumentObjectExecReturn *Sheet::execute(void) } catch (std::exception&) { // Cycle detected; flag all with errors std::ostringstream ss; - ss << "Cyclic dependency" << std::endl; + ss << "Cyclic dependency"; int count = 0; for(auto &v : VertexList) { - if(count==20) + if(count++%20 == 0) ss << std::endl; else ss << ", "; @@ -924,8 +924,10 @@ DocumentObjectExecReturn *Sheet::execute(void) std::string msg = ss.str(); for(auto &v : VertexList) { Cell * cell = cells.getValue(v.first); - if (cell) - cell->setException(msg.c_str()); + if (cell) { + cell->setException(msg.c_str(),true); + cellUpdated(v.first); + } } } }