Version: 1.5.1 (using KDE KDE 3.5.2) Installed from: Ubuntu Packages OS: Linux It happened that when I clicked undo, a formula like =(Tablas!B7/30*14)-F8 undoing to =Tablas!B7-F8 conserves current value. Even clicking on tools->recalculate sheet doesn't work.
This bug is already fixed in the SVN version.
Reopen the report since the problem is reproducable for me with KSpread from 1.6-branch compiled 5 minutes ago. Also I changed the severity to grave since wrong formula-results are one of the worst cases. Reproduce; 1. Fill cells A1="1", A2="10", A3="100", A4="=A1+A2" 2. Change A4 to "=A2+A3" 3. Undo 4. A4 has the old calc-result and even F9 does not update the wrong value. Only way to get the correct values is to close the document and reopen it. Proposed fix; Index: manipulator_data.cc =================================================================== --- manipulator_data.cc (Revision 574496) +++ manipulator_data.cc (Arbeitskopie) @@ -71,6 +71,13 @@ { Cell *cell = m_sheet->nonDefaultCell (col, row); cell->setCellValue (val, fmtType, text); + if (cell->isFormula()) { + cell->setCalcDirtyFlag(); + //cell->calc(); + //m_sheet->valueChanged(cell); + //m_sheet->recalc(true); + //m_sheet->updateCell(cell,col,row); + } } } } The problem with the fix is, that even if the cell's dirty-flag is set and even if calc() got called, the formula does not got updated whyever :-(
Added Tomas to the cc-list since that way it's easier for him to know, that I reopened the bug + confirmed the bug (maybe a regression?)
This with 1.5.x or trunk (Qt4) ?
SVN commit 598528 by nikolaus: Fix "undo/redo apparently is not recalculating formulas" BUG: 128383 M +4 -0 branches/koffice/1.6/koffice/kspread/kspread_cell.cc M +4 -0 trunk/koffice/kspread/Cell.cpp --- branches/koffice/1.6/koffice/kspread/kspread_cell.cc #598527:598528 @@ -516,7 +516,11 @@ void Cell::setCellValue (const Value &v, FormatType fmtType, const QString &txt) { if ( !txt.isNull() ) + { d->strText = txt; + if ( isFormula() ) + makeFormula(); + } else if ( !isFormula() ) d->strText = sheet()->doc()->converter()->asString (v).asString(); if (fmtType != No_format) --- trunk/koffice/kspread/Cell.cpp #598527:598528 @@ -329,7 +329,11 @@ void Cell::setCellValue (const Value &value, FormatType fmtType, const QString &txt) { if ( !txt.isNull() ) + { d->strText = txt; + if ( isFormula() ) + makeFormula(); + } else if ( !isFormula() ) d->strText = sheet()->doc()->converter()->asString( value ).asString(); if ( fmtType != No_format )
You need to log in before you can comment on or make changes to this bug.