Bug 55660 - warning if referenced cells are removed (delete row/column)
Summary: warning if referenced cells are removed (delete row/column)
Status: RESOLVED FIXED
Alias: None
Product: calligrasheets
Classification: Applications
Component: general (show other bugs)
Version: 1.2post
Platform: unspecified Linux
: HI grave
Target Milestone: ---
Assignee: Laurent Montel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-03-07 21:26 UTC by Ferdinand Gassauer
Modified: 2005-05-10 22:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ferdinand Gassauer 2003-03-07 21:26:05 UTC
Version:           1.2post (using KDE 3.1.9)
Compiler:          gcc version 3.2 (SuSE Linux)
OS:          Linux (i686) release 2.4.19-4GB

Hi!
Deleting Rows and Columns should at least issue a warning if a referenced cell gets deleted as it braeks the formula in another cell.

BTW
A1=1
A2=2
A3=3
A4=4
B3=A2+A3=5

then delete row 2

A1=1
A2=3
A3=4
B2=A2+A3=7

this is strange, at  least unexpected and IMHO wrong

excel something like  B2=#reference+A2=#error

as the referenced cell migth also be on another sheet, this error will usualy be dedected much later - and mostly to late to UNDO.

cu
ferdinand
Comment 1 Ferdinand Gassauer 2003-03-09 18:21:57 UTC
Hi! 
This behaviour is definitely wrong, because kspread forgets to point to the correct 
cells after removing a line 
Comment 2 Ferdinand Gassauer 2003-03-19 21:14:26 UTC
Insert/delete of rows/columns does not retain cell reference making kspread almost 
unusable for the moment. 
IMHO should be fixed if possible for the upcoming beta as it is a basic functionality of 
a spread sheet. 
 
Comment 3 Philipp Müller 2003-05-12 21:57:33 UTC
Subject: Re: warnig if referenced cells are removed (delete row/column)

Ferdinand,

I think I have fixed most of this bug, but as it is critical can you test it 
first.

Then we can close the bug.

Philipp

Comment 4 Ferdinand Gassauer 2003-05-12 22:45:36 UTC
after recompiling kspread with current cvs I can not confirm that the problems are solved. 
Do I have to make a distclean and/or recompile other parts of koffice ? 
cu 
ferdinand 
Comment 5 Ferdinand Gassauer 2003-05-13 06:30:21 UTC
Subject: Re:  warnig if referenced cells are removed (delete row/column)

On Monday 12 May 2003 21:57, you wrote:
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
> http://bugs.kde.org/show_bug.cgi?id=55660
>
>
>
>
> ------- Additional Comments From philipp.mueller@gmx.de  2003-05-12 21:57
> ------- Subject: Re: warnig if referenced cells are removed (delete
> row/column)
>
> Ferdinand,
>
> I think I have fixed most of this bug, but as it is critical can you test
> it first.
>
> Then we can close the bug.
>
> Philipp
Do you think that  a popup window can issue a warning.
"Attention! deleting this row/column/cell will break the formula in cell xy"

if the cell with the "parse error" is out of the visible area or on another 
sheet, it migth be too late for redo actions.

cu
ferdinand
http://www.goesing.at

Comment 6 Philipp Müller 2003-05-13 10:16:45 UTC
Ferdinand,

as I understand with your second comment, the "parse" error is now displayed 
correctly (distclean or similar things are not necessary). I still need to 
check how I can change the errormessage "parse" to "dependancy", which is a bit 
more tricky.

The warning dialog is not hard to implement, but would make things much slower.

Without such a warning I only need to parse every formula only once and during 
the parse in case of such error I only change the formula with this "#Depend!" 
content. If I would give a warning before, I would need to parse it 2 times, 
one time just to check if we get a warning and then a second time to then 
adjust the formulas. As such an error is rather seldom, this extraround is for 
me waste of time for the regular case.
But you are right, I can display an error message _after_ the parsing in case 
of an error with the hint to undo.

If you like to test more: The parsing of the formulas itself shouldn't make any 
problems as it's straight foreward, more tricky is the undo. Can you stress the 
undo a bit?

We have breakages of the formula in following cases for rows and columns:
- Inserting row/column (in case the reference is near 32767)
  As well with "insert with shift" - eg. in EXCEL "Kopierte Zellen einf
Comment 7 Ferdinand Gassauer 2003-05-13 11:03:16 UTC
Subject: Re:  warnig if referenced cells are removed (delete row/column)

On Tuesday 13 May 2003 10:16, you wrote:
> But you are right, I can display an error message _after_ the parsing in
> case of an error with the hint to undo.
Yes this would be a big step forward.
the hint should somehow point (GoTo <cell>) to the broken cell, which as I 
said, could be on another sheet.

I'll try to do some more testing during the next days.
> Thanks for you help,
>
> Philipp

Comment 8 Philipp Müller 2003-05-14 07:58:30 UTC
Subject: Re:  warnig if referenced cells are removed (delete row/column)

On Tuesday 13 May 2003 11:03, you wrote:
> > But you are right, I can display an error message _after_ the parsing in
> > case of an error with the hint to undo.
>
> Yes this would be a big step forward.
> the hint should somehow point (GoTo <cell>) to the broken cell, which as I
> said, could be on another sheet.

I tested it and we have this already. You just need to enable error messages, 
then the error message is displayed with the reference to every broken cell.
Which can be quite hard, eg. you have a list of 1000 products with the 
respective netto price and now want to calculate the price including the VAT 
(MwSt) for every product. The VAT is stored in one cell and when you then 
delete the VAT cell, then you will get 1000 error messages ...
Undo gives here some strange error message dialogs, but it works fine for me.

Philipp

Comment 9 Markus Kohls 2004-05-19 15:36:42 UTC
Question: Shouldn't correcting the Formulas be the "right" behaviour instead of showing an Error Message? At Least in cases, where the affected cells are only moved, and not deleted?
Comment 10 Inge Wallin 2005-05-10 21:43:08 UTC
This actually works now (1.4beta).  The result after removing row 2 is
=#Dependency!+A3
which is what the reporter wanted.
Comment 11 Ferdinand Gassauer 2005-05-10 22:46:02 UTC
Hi!
thank you for working on this one.
IMHO so something more "visual" should happen if a row or column of a referenced cell or the cell itself is deleted is deleted.
IMHO a modal window should pop up asking if one really wants to proceed.

if yes there should be an easy way to find all cells which lost their referenced cells i.e containing "#Dependency"
Comment 12 Ferdinand Gassauer 2005-05-10 22:48:57 UTC
may be it could be helpful to allow the user to decide if the result should be 
"#Dependency" or to remove the reference.
the options are 
- revert
- create formulas with "#Dependency"
- remove dependency from formulas, bearing the risk, that the formula gets invalid by itself. (syntax error)