Bug 125646 - calc undo doesn't separate auto-corrupt and user changes
Summary: calc undo doesn't separate auto-corrupt and user changes
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Undo-Redo
  Show dependency treegraph
 
Reported: 2019-06-02 20:07 UTC by Anthony Youngman
Modified: 2020-11-12 12:14 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Youngman 2019-06-02 20:07:09 UTC

    
Comment 1 Anthony Youngman 2019-06-02 20:13:51 UTC
Enter text that looks like an email address into a cell. Hit return.

calc converts it to an email address and jumps to the next cell.

Hit "undo" (or ctrl-z).

CALC DELETES THE USER'S TEXT!!!

"Undo" should not conflate auto-correct changes and user changes - it is a real pain in the neck (hence the papercut designation) when the program actively obstructs the user's attempts to enter the text they want. If auto-corrupt fucks up it should be *easy* for the user to fix, not almost impossible. Yes you can work around it, but you shouldn't have to!
Comment 2 Jacques Guilleron 2019-06-03 13:44:14 UTC
Hi Anthony,

Do you know after use of "undo", you can use "redo" or CTRL+Y?

Jacques
Comment 3 raal 2019-06-03 16:22:23 UTC
I can confirm with Version: 6.3.0.0.alpha1+
Build ID: 53325b40b557cc84d8d21c1baa0ef8d3bfc00ab8
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk3; 

Undo should be two steps, like in Writer (see bug 122052)

expected results:
Hit "undo" (or ctrl-z).
calc delete formatting
Hit "undo" (or ctrl-z).
Calc  deletes text
Comment 4 Anthony Youngman 2019-06-03 21:34:06 UTC
(In reply to Jacques Guilleron from comment #2)
> Hi Anthony,
> 
> Do you know after use of "undo", you can use "redo" or CTRL+Y?
> 
> Jacques

And what use is that? Sorry, but the problem is that user changes and autocorrupt changes are, from calc's pov, ONE change!

So redo will simply take me back to where I don't want to be, with my document auto-corrupted!

The problem is that there is *no way* I can stop auto-corrupt from buggering about with my text, because it thinks it's an email address. (My workaround is to enter extra text, which means that my document is "wrong", because there is no way to get it to consist of THE TEXT I ENTERED!)
Comment 5 Jacques Guilleron 2019-06-03 23:50:42 UTC
Hi Anthony,

You can edit the cell content and use CTRL+M, to delete the URL formatting and get a simple text or, if you don't want at all URL Recognition, type Tools > AutoCorrect Options...
select Options Tab and uncheck URL Recognition.

Cordially,

Jacques
Comment 6 Anthony Youngman 2019-06-04 00:37:39 UTC
(In reply to Jacques Guilleron from comment #5)
> Hi Anthony,
> 
> You can edit the cell content and use CTRL+M, to delete the URL formatting
> and get a simple text 

Just tried it - doesn't work!

> or, if you don't want at all URL Recognition, type
> Tools > AutoCorrect Options...
> select Options Tab and uncheck URL Recognition.
> 
And how many people are going to know - or find - that?

There's a reason I consider this a very nasty papercut bug - you should NOT leave your typical user cursing and swearing because they can't work out how to stop LO corrupting the text they typed in.

I appreciate actually fixing the bug might be a lot harder than it looks, but with things as they currently stand, fixing the user's document is a lot harder than it should be. Much as I hate praising MS Office, it gets it right. It *ALWAYS* marks the user's changes and auto-correct changes as *SEPARATE* edits so you can undo one and not the other.

LibreOffice, in *too* *many* places, conflates the changes so the user is stuffed with a choice of either the pre-edit state, or the post-corruption state, with no way to get to the desired state of "just give me what I typed, for fuck's sake!!!"

And no - expecting the user to know esoteric work-arounds like you suggested is not a good solution.
Comment 7 Xisco Faulí 2019-06-11 11:12:55 UTC
Also reproduced in

LibreOffice 3.3.0 
OOO330m19 (Build:6)
tag libreoffice-3.3.0.4

As mentioned by raal, calc and writer should have the same behaviour...
Comment 8 Heiko Tietze 2019-06-12 11:23:26 UTC
Another example: insert http://foo.bar in Writer and undo - it removes the autoformatting only. The same in Calc removes everything. Ctrl+M works as well as switching off the URL Recognition at Tools > Autocorrect Options: Options.

As a general rule we should undo all autoformatting separately.

I wonder if this could be an easyhack since Writer could serve as blue print.
Comment 9 Eike Rathke 2019-06-13 11:48:11 UTC
Calc uses the EditEngine for cell input, once Enter is hit or the input closed by other means there is one object with one change. Individual Undo of inline edits is only possible while still in the editing process, e.g. enter the email address or URL followed by a space (which triggers the field recognition) and hit Ctrl+Z.

This is by no means an EasyHack and Writer does not serve as blue print.

Besides, what is the actual problem if an email address or URL is recognized as such? Since 6.2 the cell display doesn't result anymore in the shaded field display, only the inline edit does.
Comment 10 Anthony Youngman 2019-06-14 12:44:32 UTC
(In reply to Eike Rathke from comment #9)
> Calc uses the EditEngine for cell input, once Enter is hit or the input
> closed by other means there is one object with one change. Individual Undo
> of inline edits is only possible while still in the editing process, e.g.
> enter the email address or URL followed by a space (which triggers the field
> recognition) and hit Ctrl+Z.

This is a work-around, it's not necessarily obvious to the user, and it also means that the text in the cell is not what the user wants.
> 
> This is by no means an EasyHack and Writer does not serve as blue print.
> 
> Besides, what is the actual problem if an email address or URL is recognized
> as such? Since 6.2 the cell display doesn't result anymore in the shaded
> field display, only the inline edit does.

You said that Calc uses the EditEngine, so I guess this applies to other edits as well as emails and urls? So what happens when auto-corrupt actually CHANGES
Comment 11 Anthony Youngman 2019-06-14 12:54:15 UTC
> 
> You said that Calc uses the EditEngine, so I guess this applies to other
> edits as well as emails and urls? So what happens when auto-corrupt actually
> CHANGES

Whoops ...

So what happens when auto-corrupt actually CHANGES what the user typed? I've hit this problem in several different places over the years, and the first time I hit it, it did EXACTLY THAT.

And when everyone told me where to go to turn auto-formatting off THEY GOT IT WRONG.

I know I can be a bit of "an angry old man" at times, but look at the frustration expressed in the penultimate paragraph of comment #5.

And ask yourself - "do any of these autoformat operations CHANGE THE USER TEXT". Well, of course they do, but in my experience it's not only *appearance* that changes, but also sometimes the *meaning* - it's too long ago to remember but that example I mentioned above did exactly that!

There's a reason I collectively call that stuff "auto-corrupt". You should NOT be changing the user's text, without giving them an easy way to change it back to what they actually typed! Can you really tell me that none of those auto- functions actually change the *text* and *meaning* of what the user typed? Because I know I've met at least one!

I know it's a paper-cut bug. But as papercuts go this is a chainsaw ... :-)
Comment 12 Anthony Youngman 2019-06-14 13:04:52 UTC
> 
> Besides, what is the actual problem if an email address or URL is recognized
> as such? Since 6.2 the cell display doesn't result anymore in the shaded
> field display, only the inline edit does.

If it doesn't change anything, why does it do it? And I don't know what you mean by "shaded display". ime it underlined my text, it changed the font colour, and it may have changed the font. NO THANKS PLEASE. *Don't* piss off the user ... :-)
Comment 13 Anthony Youngman 2019-06-14 22:53:34 UTC
> Besides, what is the actual problem if an email address or URL is recognized
> as such? Since 6.2 the cell display doesn't result anymore in the shaded
> field display, only the inline edit does.

Besides, what is the actual problem? I've just stumbled across an email to the list of mine, dated 8th Feb. It shows pretty graphically how, by not doing what the user expects, you can REALLY fuck things up. What's the saying? "To err is human, to really foul things up requires a computer".

Try the following sequence of events ...

1) Enter an url into a cell.
2) Tab to the next cell, causing calc to autoformat the url. (This next cell contains important information ... :-)
3) Spot a mistake in the url, so click on the cell intending to edit the url
4) Start editing the url, and realise that clicking on the url DID NOT select the cell, so you've just trashed your important information ...

OOPS !!!

UI papercuts are serious problems because they result in corrupted user documents. Just what *experienced* users in particular don't need. Ask any UI specialist what experienced users hate with a vengeance, and one of those things will be "inconsistent behaviour". Here we've just completely fucked about with what any normal user will expect.
Comment 14 Eike Rathke 2019-06-17 17:36:38 UTC
(In reply to Anthony Youngman from comment #12)
> > Besides, what is the actual problem if an email address or URL is recognized
> > as such? Since 6.2 the cell display doesn't result anymore in the shaded
> > field display, only the inline edit does.
> 
> If it doesn't change anything, why does it do it?

Turning an URI or email address into a field makes it (Ctrl+)Click'able, if it was just mere text that wouldn't be possible.


(In reply to Anthony Youngman from comment #13)
> 1) Enter an url into a cell.
> 2) Tab to the next cell, causing calc to autoformat the url. (This next cell
> contains important information ... :-)
> 3) Spot a mistake in the url, so click on the cell intending to edit the url
> 4) Start editing the url, and realise that clicking on the url DID NOT
> select the cell, so you've just trashed your important information ...
> 
> OOPS !!!

Which Escape escapes though, or Ctrl+Z undoes if cell input was already closed.

Btw, less fuck would be nice.