Bug 94862 - Autocorrect -> to arrow adds additional text
Summary: Autocorrect -> to arrow adds additional text
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Linguistic (show other bugs)
Version:
(earliest affected)
4.4.5.1 rc
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-07 15:14 UTC by Leon Stringer
Modified: 2016-10-11 14:36 UTC (History)
2 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 Leon Stringer 2015-10-07 15:14:32 UTC
1. Start LibreOffice Writer.
2. Paste the text "one -> two -> three" (i.e. hyphen, greater than).
3. Move the caret to after the first "->" (i.e. "one ->| two...").
4. Press space expecting the first "→" to become a right arrow. You actually end up with "One →  two →  two -> three".

LibreOffice 5.0.2.2 on Windows 7 Professional, language English (UK).
Comment 1 tommy27 2015-10-07 18:04:14 UTC
I was able to reproduce it few minutes ago using LibO 4.4.5.1 under Win8.1 x64

then I closed LibO and relaunched it and the bug is not reproducible anymore...
kinda weird isn't it?

maybe there's some other action that trigger this strange autocorrect replacement.

let's investigate further...
Comment 2 Leon Stringer 2015-10-08 11:50:33 UTC
It's consistent for me.

On the Replace tab (Tools -> AutoCorrect Options...) AutoCorrect lists "-->" as the character for an arrow. If I try the test with "one --> two --> three" the problem doesn't occur. The sequence "->" isn't listed so I'm not sure where it's reading this from at all.
Comment 3 tommy27 2015-10-08 12:01:48 UTC
not reproducibile for me right now on anotehr Win7 x64 machine

however try "one -> two -> three -> four -> five"

is the bug just triggered after "two ->" or does it happens in the other positions as well ?
Comment 4 tommy27 2015-10-08 12:10:56 UTC
tell me also what happens if you just type " -- " do you have some kind of autocorrect replacement just for the double hyphen?

I suspect an autocorrect collision between a " -- " entry and a " --> " entry could be bug trigger
Comment 5 Leon Stringer 2015-10-08 13:02:55 UTC
"one -> two -> three -> four -> five" with the caret after the second "->" (i.e. "one -> two ->| three -> four -> five" becomes: "one -> two →  three → four →  three -> four -> five".

I've found the entry in the AutoCorrect list: it's matching a regex: ".*->.*". Presumably what's happening is that the pattern match for the range is greedy so it's matching from the caret to the end of the string and inserting the substitute string at that point. So should all AutoCorrect matches that use a regex be non-greedy? And will this require a change to the pattern in the list or a code?
Comment 6 tommy27 2015-10-08 19:20:10 UTC
I add Lazlo Nemeth to CC list.

he's the one who implemented wildcard autocorrection patterns (those with the .* regex)

maybe he can come up with an idea about this weird autocorrect bug
Comment 7 tommy27 2016-10-07 21:39:01 UTC
I don't reproduce it under 5.1.5.2

@Leon
are you still experiencing this one?
Comment 8 Leon Stringer 2016-10-11 14:14:43 UTC
Re-tested with LO 5.2.2.2 on Microsoft Windows 10.

I no longer see this issue.
Comment 9 tommy27 2016-10-11 14:36:12 UTC
hence, RESOLVED WORKSFORME