Version: 1.5rc1 (using KDE KDE 3.5.2) Installed from: Fedora RPMs Sometimes, when I enter a formula into a sheet shortly after changing sheets, the formula goes not into the currently selected cell (inside the sheet) but into the last selected cell in the previously selected sheet. I will attach a testcase shortly. Steps to reproduce: 1. Open testcase.ods (forthcoming). 2. Select Sheet1. 3. Select cell A1, type anything into it (e.g., "a"), then hit enter. 4. Select Sheet2. 5. Select cell A5. 6. Click the "Sum" button and select the range A1:A4. 7. Hit Enter. The sum will appear in cell Sheet1!A2, rather than Sheet2!A5, as it should.
Created an attachment (id=15704) [details] Test case for formula behavior
OK, I have investigated a little further, and it appears that this bug may kick in not only when invoking SUM, but whenever (1) you've been working with multiple sheets, (2) you start editing a formula, and (3) the new style of cell selector kicks in. I was editing a cell with a manually entered (F2 key + hand-typed) formula, something like =B17+E17+... and at some point the cell selector became active. Once this happened, it became impossible to enter any formula into the current sheet: no matter what I did, the formula would appear in the previous sheet rather than the current one. The only workaround was to close the document and re-open it. This bug makes multi-sheet documents almost unusable.
SVN commit 532606 by nikolaus: operation Selection Fix multi sheet selections for formulas (internal slang: choices) In a few cases the resulting formula was put in a wrong sheet. Note: The hiding of the editor for sheets other than the choice's starting sheet is intended (see: Canvas::updateEditor()). BUG: 125941 M +2 -14 branches/koffice/1.5/koffice/kspread/kspread_canvas.cc M +2 -14 trunk/koffice/kspread/kspread_canvas.cc --- branches/koffice/1.5/koffice/kspread/kspread_canvas.cc #532605:532606 @@ -3724,20 +3724,8 @@ { Sheet * sheet = activeSheet(); - //Ensure that the choice always has a sheet associated - //with it. - // - //FIXME: This really doesn't make sense. The concept of - //the 'choice selection' having only one sheet is wrong - because - //different parts of the choice selection may be on different - //sheets (at least, this doesn't work at the moment, but it should - //do). REVIEW after KSpread 1.5 has been released. - // - //This is a temporary workaround for now. It fixes the problem - //where the editor would be hidden because the choice's sheet - //was not the active sheet. - if (!choice()->sheet()) - choice()->setSheet( activeSheet() ); + // Set the starting sheet of the choice. + choice()->setSheet( activeSheet() ); if ( !d->cellEditor ) { --- trunk/koffice/kspread/kspread_canvas.cc #532605:532606 @@ -3666,20 +3666,8 @@ { Sheet * sheet = activeSheet(); - //Ensure that the choice always has a sheet associated - //with it. - // - //FIXME: This really doesn't make sense. The concept of - //the 'choice selection' having only one sheet is wrong - because - //different parts of the choice selection may be on different - //sheets (at least, this doesn't work at the moment, but it should - //do). REVIEW after KSpread 1.5 has been released. - // - //This is a temporary workaround for now. It fixes the problem - //where the editor would be hidden because the choice's sheet - //was not the active sheet. - if (!choice()->sheet()) - choice()->setSheet( activeSheet() ); + // Set the starting sheet of the choice. + choice()->setSheet( activeSheet() ); if ( !d->cellEditor ) {
You need to log in before you can comment on or make changes to this bug.