Bug 96369

Summary: ordinal numbers suffixes autocorrect replacements triggered in between words
Product: LibreOffice Reporter: tommy27 <barta>
Component: LinguisticAssignee: Caolán McNamara <caolan.mcnamara>
Status: RESOLVED FIXED    
Severity: normal CC: barta, cloph, nemeth, timar74, valtermura
Priority: medium Keywords: regression
Version: 3.4.3 release   
Hardware: All   
OS: All   
Whiteboard: target:5.3.0 target:5.2.2
Crash report or crash signature: Regression By:
Attachments: bug summary in PDF

Description tommy27 2015-12-09 20:24:34 UTC
tested under Win8.1 64bit but reproducible under WinXP 32bit and Win7 64bit

issue can be reproduced from at least LibO 3.4.3 till current 5.2.0.0 alpha release

bug is not reproducible with LibO 3.3.4 and is not present in AOO 4.4.0
so it's a LibO 3.4.x regression

STEPS TO REPRODICE
1- Tools/AutoCorrect Options/Localized Options
put the tick on “Format ordinal numbers suffixes (1st -> 1^st)

2- change document language language to Italian

3- simply type 5a or 5o; the autocorrect engine will correctly replace them as 5a and 5o 

4- imagine the user wants to type the italian word “testa” (head) but does a typing error and digits tes5a (a common typing error because of the proximity of the “5” and “t” keys); the autocorrect engine kicks in and replace it as  tes5a

if you untick the option, no replacement happens 

EXPECTED BEHAVIOUR
ordinal numbers suffixes autocorrect replacement should kick in only after “discrete numbers” (i.e.  5a → 5a ; 25a → 25a etc. etc) but not in mixed letters and numbers sequences like tes5a.

I'd expect that when I type tes5a no replacement should happen, the word should then be recognized as an error and tagged with a red squiggly underline 

then the user can set an automatic autocorrect replacement using the right click autocorrect suggestions menu (

interestingly I see this bug with Italian only 

in English if I type 3rd it's correctly replaced as 3rd 
but if I type n3rd, unlike Italian, it's not corrected as n3rd

maybe the difference bis that in Italian you need a single letter to trigger the ordinal suffixes thing ( 5a →  5a) while in English it's a two digits trigger (3rd → 3rd )
Comment 1 tommy27 2015-12-09 20:29:19 UTC
Created attachment 121179 [details]
bug summary in PDF

for some reasons the text is not correctly rendered in the bugzilla post

please download and read this PDF
Comment 2 tommy27 2015-12-15 09:50:55 UTC
CC'ing Valter Mura from the IT localization team
Comment 3 Valter Mura 2015-12-20 11:36:37 UTC
I confirm the behaviour, tested in 5.0.2.2 (Linux).

This issue should be checked and solved by developers. Adding Andras and Christian.
Comment 4 Caolán McNamara 2016-08-30 11:16:25 UTC
This does affect English as well. The mixed text+number is considered 0, so in English the trigger is <number>th, e.g. a5th
Comment 5 Commit Notification 2016-08-30 11:48:41 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=776e2e2635487523cd1757f382f54487b36b5ad3

Resolves: tdf#96369 don't superscript ordinals for mixed text and numbers

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 tommy27 2016-08-31 07:46:32 UTC
thanks!!! a 5.2.x backport would be appreciated.
Comment 7 Commit Notification 2016-09-02 16:29:40 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4edd7ed8bc2c75a23babe9893fdbe58dd7bcf562&h=libreoffice-5-2

Resolves: tdf#96369 don't superscript ordinals for mixed text and numbers

It will be available in 5.2.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 tommy27 2016-09-02 16:33:18 UTC
:-)