From kde-commits Tue Feb 07 17:28:57 2006 From: Robert Knight Date: Tue, 07 Feb 2006 17:28:57 +0000 To: kde-commits Subject: koffice/kspread Message-Id: <1139333337.106572.13830.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=113933343908445 SVN commit 506824 by knight: Fix bug where changing a cell containing a formula did not update that cell's dependancies if the result of evaluating that formula was equal to the result of evaluating the previously contained formula. This fixes the issue where entering formulae such as = did not update cell dependancies if was empty at the time the forumla was entered. M +7 -1 kspread_cell.cc --- trunk/koffice/kspread/kspread_cell.cc #506823:506824 @@ -484,7 +484,13 @@ if (v.type() != Value::Error) clearAllErrors(); - if ( d->value == v ) + //If the value has not changed then we don't need to do anything + //(ie. no need to relayout, update dependant cells etc.), + //unless this cell contains a formula, in which case its dependancies might have changed + //even though the value has not. For example, if this cell was previously empty (and its value is + //therefore empty) and a new dependency upon an empty cell has been added. The new value would still + //be empty, but the dependencies need to be updated (via the call to valueChanged() below). + if ( ( d->value == v ) && ( !isFormula() ) ) return; d->value = v;