Bug 58094 - cut/paste should point to the "old" cells
Summary: cut/paste should point to the "old" cells
Status: RESOLVED WORKSFORME
Alias: None
Product: calligrasheets
Classification: Applications
Component: general (show other bugs)
Version: 1.3post
Platform: unspecified Linux
: NOR grave
Target Milestone: ---
Assignee: Laurent Montel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-04 10:24 UTC by Ferdinand Gassauer
Modified: 2006-06-27 15:28 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
a patch fixing the bug (6.17 KB, patch)
2003-10-28 17:14 UTC, Stefan Hetzl
Details
a revised patch (9.67 KB, patch)
2003-11-02 20:03 UTC, Stefan Hetzl
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ferdinand Gassauer 2003-05-04 10:24:49 UTC
Version:           1.2.90 (using KDE 3.1.9)
Compiler:          gcc version 3.3 20030226 (prerelease) (SuSE Linux)
OS:          Linux (i686) release 2.4.20-4GB

Hi
cut / paste works like copy / paste.
but it should point to the previous referenced  cells, even if these are not marked as absolute

cu
ferdinand
Comment 1 Philipp Müller 2003-05-06 11:04:22 UTC
I checked this here with EXCEL and EXCEL does the adjustment of the references 
on cut - paste.

I also wouldn't like if cut - paste would behave differently to copy - paste as 
the adjustment happens logically on the the paste not on the cut or copy step.
As you pointed out, it works correctly if you defined the cell reference 
absolute (eg. $A$1), so this is the desired behaviour.

So I don't consider this a bug, it just behaves as it should.

Philipp
Comment 2 Ferdinand Gassauer 2003-05-06 11:37:34 UTC
Subject: Re:  cut/paste  should point to the "old" cells

On Tuesday 06 May 2003 11:04, 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=58094
>
>
>
>
> ------- Additional Comments From philipp.mueller@gmx.de  2003-05-06 11:04
> ------- I checked this here with EXCEL and EXCEL does the adjustment of the
> references on cut - paste.
>
> I also wouldn't like if cut - paste would behave differently to copy -
> paste as the adjustment happens logically on the the paste not on the cut
> or copy step. As you pointed out, it works correctly if you defined the
> cell reference absolute (eg. $A$1), so this is the desired behaviour.
>
> So I don't consider this a bug, it just behaves as it should.
>
> Philipp
Hmm!
what Excel do you use ?
example
A1=1
A2=2
A3=A1+A2
now cut / paste A3 to B3, 
B3=A1+A2 in Excel, gnumeric and openoffice and 
B3=B1+B2 in kspread.

IMHO this IS a big usability issue as it is not possible to "move" a cell to 
another position in the grid; may be I am missing some functionality.

Comment 3 Philipp Müller 2003-05-06 15:36:37 UTC
Ferdinand,

ah I see the difference.
I made the cut/paste including in this example the A1 and A2.
If I only cut and paste A3 then you are right, the formula is not changed.
If I cut/paste A2 and A3 but leave A1, then the new formula is B3=A1+B2.

Strange behaviour anyway.

Okay, as this is now a different behaviour in KSpread in comparision to the 
otherones I also consider it a bug. Additional the reason is to move a cell is 
the necessary issue.

Dunno how to implement this now, as doesn't distinguish according to including 
references or not.

Regards,

Philipp
Comment 4 Ferdinand Gassauer 2003-05-06 17:17:05 UTC
Subject: Re:  cut/paste  should point to the "old" cells

thanks
hope you can fix it until 1.3 or hopefully earier to allow extensive testing.

Comment 5 Ferdinand Gassauer 2003-07-08 04:58:12 UTC
IMHO  a show stopper 
Comment 6 Ferdinand Gassauer 2003-07-08 05:18:53 UTC
*** Bug 58652 has been marked as a duplicate of this bug. ***
Comment 7 Nicolas Goutte 2003-10-20 01:16:10 UTC
Back to more normal priority, as the bug cannot be fixed easily, and to major severity, as it is a big problem but it is not a security problem.

Have a nice day!
Comment 8 Ferdinand Gassauer 2003-10-20 09:33:47 UTC
Subject: Re:  cut/paste  should point to the "old" cells

it's not only a big problem it's a SHOW STOPPER!
I prefer a crash than quietly receiving wrong results.


Comment 9 Stefan Hetzl 2003-10-28 17:14:24 UTC
Created attachment 2912 [details]
a patch fixing the bug

This patch encodes relative references abosultely when copying cells to the
clipboard. For these types of references a new representation for a reference
in the XML-code for a cell is needed. A cell reference of %1%1 means a
reference to cell A1 regardless of where it is pasted.

Note: I sent this to koffice-devel a while ago but got no response. If it is ok
to commit, please let me know.
Comment 10 Ferdinand Gassauer 2003-10-28 17:29:35 UTC
Subject: Re:  cut/paste  should point to the "old" cells

On Tuesday 28 October 2003 17:14, 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=58094
>
>
>
>
> ------- Additional Comments From shetzl@chello.at  2003-10-28 17:14 -------
> Created an attachment (id=2912)
>  --> (http://bugs.kde.org/attachment.cgi?id=2912&action=view)
> a patch fixing the bug
>
> This patch encodes relative references abosultely when copying cells to the
> clipboard. For these types of references a new representation for a
> reference in the XML-code for a cell is needed. A cell reference of %1%1
> means a reference to cell A1 regardless of where it is pasted.
>
> Note: I sent this to koffice-devel a while ago but got no response. If it
> is ok to commit, please let me know.

Does it switch back to the relative reference when pasting ?

Comment 11 Stefan Hetzl 2003-10-28 17:36:24 UTC
> Does it switch back to the relative reference when pasting ?
Yes, it does.
Comment 12 Ferdinand Gassauer 2003-10-28 21:44:30 UTC
Unfortunately no the desired solution:
a) Now cut/paste of a cell works, but copy paste does the same which it shouldn't
example:
a1=2
a2=3
b2=a1+a2=5
copy b2 to b3 should give b3=a2+a3=3 (because a3 is empty)
cut/paste retains b3=a1+a2=5 correctly.

b) cut/paste of the source should also maintain the references of the result.
now cut/paste a1:a2 to a2:a3 
b2 should change to b2=a2+a3 , which it does not.
copy paste works correctly 

hope that helps
IMHO sombody menitioned, that the same internals are used for cut and copy - this seems the problem.

Comment 13 Stefan Hetzl 2003-11-02 20:03:33 UTC
Created attachment 2995 [details]
a revised patch

This is the revised patch which should fix a).

About b): This is something different and more difficult. To fix this we would
have to copy the DependingOnMe list to the clipboard for every cell. And when
pasting to a different sheet when those cells do not exist things become even
worse.
Comment 14 Ferdinand Gassauer 2003-11-03 07:56:03 UTC
Subject: Re:  cut/paste  should point to the "old" cells

On Sunday 02 November 2003 20:03, 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=58094
> shetzl@chello.at changed:
>
>            What    |Removed                     |Added
> ---------------------------------------------------------------------------
>- Attachment #2912 [details] is|0                           |1
>            obsolete|                            |
>
>
>
> ------- Additional Comments From shetzl@chello.at  2003-11-02 20:03 -------
> Created an attachment (id=2995)
>  --> (http://bugs.kde.org/attachment.cgi?id=2995&action=view)
> a revised patch
>
> This is the revised patch which should fix a).
>
> About b): This is something different and more difficult. To fix this we
> would have to copy the DependingOnMe list to the clipboard for every cell.
> And when pasting to a different sheet when those cells do not exist things
> become even worse.
I'll try to check this during the next days.
But as I said - IMHO it has to be solved or kspread shouldn't be released.
a not correctly (=conforming to other spread sheets) working cut/copy + paste 
it's a real showstopper. 
Comment 15 Stefan Hetzl 2003-11-03 17:31:07 UTC
I think this whole thing is a design issue rather than a bug. I agree that cut&paste of the source should be fixed, but I doubt it that this will be possible for 1.3:
The other spreadsheets have a "clipboard mode" that is activated when something is copied or cut to the clipboard. E.g. in gnumeric you have a floating boarder around the selection that is in the clipboard. Maybe it would make more sense to implement such a clipboard mode for kspread too (which would take too much time for 1.3).

The other spreadsheets have in common that they do not do the same thing on first paste and second paste after cutting but they do not behave the same. Try:
A1=1,A2=2,A3=A1+A2
now cut&paste A3 to B3 and then paste to C3
OpenOffice: B3=A1+A2, C3=C1+C2
Excel, gnumeric: B3=A1+A2, does not let you paste to C3

To get some behaviour that is different on first and second paste it would probably make
more sense to implement this in a clipboard mode like fashion. If not, it would be necessary
to write to the clipboard on the first paste after a cut.

Before fixing this we should first reach a consensus wether we want a clipboard mode for kspread and what the second paste after a cut should do.

Greetings,
Stefan
Comment 16 Ferdinand Gassauer 2003-11-03 19:13:02 UTC
Subject: Re:  cut/paste  should point to the "old" cells

On Monday 03 November 2003 17:31, 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=58094
>
>
>
>
> ------- Additional Comments From shetzl@chello.at  2003-11-03 17:31 -------
> I think this whole thing is a design issue rather than a bug. I agree that
> cut&paste of the source should be fixed, but I doubt it that this will be
> possible for 1.3: The other spreadsheets have a "clipboard mode" that is
> activated when something is copied or cut to the clipboard. E.g. in
> gnumeric you have a floating boarder around the selection that is in the
> clipboard. Maybe it would make more sense to implement such a clipboard
> mode for kspread too (which would take too much time for 1.3).
>
> The other spreadsheets have in common that they do not do the same thing on
> first paste and second paste after cutting but they do not behave the same.
> Try: A1=1,A2=2,A3=A1+A2
> now cut&paste A3 to B3 and then paste to C3
> OpenOffice: B3=A1+A2, C3=C1+C2
well I am sure that we will find some advocates for this one too ;-)

> Excel, gnumeric: B3=A1+A2, does not let you paste to C3
IMHO this one is "correct" - i.e everyone is used to this behaviour.

>
> To get some behaviour that is different on first and second paste it would
> probably make more sense to implement this in a clipboard mode like
> fashion. If not, it would be necessary to write to the clipboard on the
> first paste after a cut.
>
> Before fixing this we should first reach a consensus wether we want a
> clipboard mode for kspread and what the second paste after a cut should do.
May be KDE should contact the OO Developer to see if they consider this as a 
bug or feature and if so - why.

Well I do not understand the technology aspects. I just see the user side.

>
> Greetings,
> Stefan
I just have a bad feeling to see kspead be released with this - propably 
undocumented - behaviour.
IMHO cut/paste must absolutely retain cell references the same way as excel 
does. (except sum etc)
Hope that helps
Comment 17 Stefan Hetzl 2003-11-07 16:24:18 UTC
I have committed the patch (#13) to cvs as a temporary fix for 1.3. This should be solved more cleanly after the release of 1.3

Greetings,
Stefan
Comment 18 Ferdinand Gassauer 2003-11-07 18:34:43 UTC
Subject: Re:  automatic recalculation works only partly

Not sure
example

A1=1
A2=2
A3=3
A4=4
B4=A2+A3
now cut the range A3:b4 and past it into b3
C4=A2+A3 but should be A2+B3
may be this is bug 
http://bugs.kde.org/show_bug.cgi?id=58094
Comment 19 Stefan Hetzl 2003-11-08 11:30:57 UTC
Subject: Re:  cut/paste  should point to the "old" cells

On Friday 07 November 2003 18:34, you wrote:
> Not sure
> example
>
> A1=1
> A2=2
> A3=3
> A4=4
> B4=A2+A3
> now cut the range A3:b4 and past it into b3
> C4=A2+A3 but should be A2+B3
> may be this is bug
> http://bugs.kde.org/show_bug.cgi?id=58094
Thanks for pointing this out. Fixing this is not trivial unfortunatly. It 
would require the method that encodes the formula to know which rectangle is 
cutted to the clipboard. I would suggest to postpone this until after the 
release of 1.3 because this could be easily dealt with by a "clipboard mode" 
as mentioned in previous posts.

Greetings,
Stefan

Comment 20 Ferdinand Gassauer 2003-11-08 15:34:57 UTC
Subject: Re:  cut/paste  should point to the "old" cells

On Saturday 08 November 2003 11:30, 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=58094     
> 
> 
> 
> 
> ------- Additional Comments From shetzl@chello.at  2003-11-08 11:30
> -------
 Subject: Re:  cut/paste  should point to the "old" cells
> 
> On Friday 07 November 2003 18:34, you wrote:
>
> > Not sure
> > example
> >
> > A1=1
> > A2=2
> > A3=3
> > A4=4
> > B4=A2+A3
> > now cut the range A3:b4 and past it into b3
> > C4=A2+A3 but should be A2+B3
> > may be this is bug
> > http://bugs.kde.org/show_bug.cgi?id=58094
>
> Thanks for pointing this out. Fixing this is not trivial unfortunatly. It 
> would require the method that encodes the formula to know which rectangle
> is 
 cutted to the clipboard. I would suggest to postpone this until after
> the release of 1.3 because this could be easily dealt with by a "clipboard
> mode" as mentioned in previous posts.
> 
> Greetings,
> Stefan
> 
Do you think that this can go into a "patch" reasonable soon after the 
release. I still consider this as a show stopper. 
Comment 21 Stefan Hetzl 2003-11-09 17:37:16 UTC
Subject: Re:  cut/paste  should point to the "old" cells

On Saturday 08 November 2003 15:34, you wrote:
> Do you think that this can go into a "patch" reasonable soon after the
> release. I still consider this as a show stopper.
Yes, I will look into this after the release of 1.3.

Greetings,
Stefan

Comment 22 Ferdinand Gassauer 2004-03-21 21:28:48 UTC
It looks like it's working in CVS HEAD
Comment 23 Ferdinand Gassauer 2004-04-28 20:12:28 UTC
not all.
example 
a2=a1+b1
cut/paste b2 to b2, the formula should change to
a2=a1+b2
Comment 24 Ferdinand Gassauer 2004-04-28 20:14:18 UTC
correction
cut/paste b1 to b2, the formula should change to 
Comment 25 Ferdinand Gassauer 2004-07-21 21:21:35 UTC
still wrong in CVS of today
Comment 26 Ferdinand Gassauer 2004-07-21 21:23:53 UTC
I changed the severity to grave, because this beheaviour makes kspread unusable, as it destroys the context of the depending formula
Comment 27 Ferdinand Gassauer 2004-09-20 20:50:49 UTC
time is passing - cut/paste does not conform to the standard used by other spread sheets.
just want to know if this is going to change in the near future?

sorry to ask again
Comment 28 Stefan Hetzl 2004-09-21 10:10:25 UTC
Unfortunately I will not have the time to work on this. Sorry.

Greetings,
Stefan
Comment 29 Ferdinand Gassauer 2005-05-22 22:44:10 UTC
Hi all!
I was thinking about this behaviour again.
IMHO KDE still should implement cut/paste conforming to other spre4ad sheets.

BUT - IMHO it would be also nice to retain the current functionality but it should then be called "cut/paste values". same for "copy/paste values". In this case only the values of the cells are put in the buffer with out changing any underlying formula in the spread sheet.

cu
ferdinand
Comment 30 Ferdinand Gassauer 2005-06-28 08:50:36 UTC
Hi!

IMHO the documentation still reflects the problem

http://docs.kde.org/development/en/koffice/kspread/copypaste.html

If a cell contains a formula then the formula itself is copied rather than the displayed result, and if the formula contains a reference to another cell, then that reference is changed by the >>> Cut or Copy <<< and Paste operation to point to the cell that is in the same relative position as in the original cell. For example if cell A2 contains the formula  =B3 and is copied to C4, cell C4 will contain =D5 .

"cut and paste" shuld behave differently from "copy and paste" AND the documentation should also mention this.
Comment 31 Robert Knight 2005-09-06 11:29:03 UTC
Cut & Paste behaviour seems different from Copy & Paste behaviour in latest SVN version - ie. it seems to fulfil the reporters wishes.

Mark as RESOLVED?
Comment 32 Ferdinand Gassauer 2005-09-09 01:22:38 UTC
IMHO it works now as it should