Bug 140211 - Date suffix superscript formatting persisting
Summary: Date suffix superscript formatting persisting
Status: RESOLVED WONTFIX
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-06 09:06 UTC by whosyvox
Modified: 2023-04-21 14:57 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 whosyvox 2021-02-06 09:06:45 UTC
Description:
This bug occurs while editing a spreadsheet cell in LO Calc.

The suffix superscript formatting for ordinal/date numbers (e.g. ^th, ^st) will persist should the user backspace after having placed said suffix. (Though this seems to be inconsistent and may need to be done twice for the bug to show up.)

This issue is compounded by the fact that the default toolbars enabled for LO Calc does not include 'text formatting' - and thus no option to toggle superscript, meaning the only simple way to prevent this from occurring from a normal user's perspective is to start over.


--
I've encountered this bug a good dozen of times having used LO throughout January, so I'm sure I'm not alone in the frustration.

Steps to Reproduce:
1. Enter the text "22nd"
2. Press space
3. Press backspace
4. Repeat 2 and 3
5. Enter any other text, e.g. "of march"

Actual Results:
22^nd ^of ^march

Expected Results:
22^nd of march


Reproducible: Always


User Profile Reset: Yes



Additional Info:

It may be worth detecting that on entering a space character that:
1) superscript is currently active
2) that we're at a word boundary
3) the last word is an ordinal number with suffix

And automatically disabling superscript to improve the user experience.
Comment 1 Jean-Baptiste Faure 2021-08-15 17:14:56 UTC
Are you sure for your steps to reproduce? For me that should produce
22ndof march
first backspace remove autocorrection
second backspace remove de second space.

So I do not understand what you want to do

Status set to NEEDINFO, please set it back to UNCONFIRMED once requested
information is provided.

Best regards. JBF
Comment 2 whosyvox 2021-12-09 06:18:11 UTC
(In reply to Jean-Baptiste Faure from comment #1)
> Are you sure for your steps to reproduce? For me that should produce
> 22ndof march
> first backspace remove autocorrection
> second backspace remove de second space.
> 
> So I do not understand what you want to do
> 
> Status set to NEEDINFO, please set it back to UNCONFIRMED once requested
> information is provided.
> 
> Best regards. JBF

The steps to reproduce may indeed be faulty. My apologies. Here are steps that should reproduce:

1. Enter a cell with a number and ordinal suffix, e.g. '22nd'
2. Leave the cell (e.g. press enter or tab)
3. Re-enter the cell and attempt to append any further text to the cell, e.g. 'of March'

The result will be that the newly appended text will gain the superscript:
22^nd ^of ^March

This does not occur if you skip 2. and append the text directly after adding the suffix. e.g. entering '22nd of march' in a single operation yields:
22^nd of March
Comment 3 QA Administrators 2021-12-10 04:24:18 UTC Comment hidden (obsolete)
Comment 4 Jean-Baptiste Faure 2021-12-10 22:18:58 UTC
(In reply to whosyvox from comment #2)
> [...]
> The steps to reproduce may indeed be faulty. My apologies. Here are steps
> that should reproduce:
> 
> 1. Enter a cell with a number and ordinal suffix, e.g. '22nd'
> 2. Leave the cell (e.g. press enter or tab)
> 3. Re-enter the cell and attempt to append any further text to the cell,
> e.g. 'of March'
> 
> The result will be that the newly appended text will gain the superscript:
> 22^nd ^of ^March
> 
> This does not occur if you skip 2. and append the text directly after adding
> the suffix. e.g. entering '22nd of march' in a single operation yields:
> 22^nd of March

There is no bug there. Because nd has gained the superscript, each character that follows has the same format. It is the same thing in Writer. You just forgot to type a space after nd before leaving the cell.

This behavior is not linked to the date format. You can try with the words "The 1st player". If you type (without the quotes) :
1/ 'The 1st'
2/ ' player'
you will get: 'The 1^st^ player'

If you type:
1/ 'The 1st '
2/ 'player'
you will get: 'The 1^st player' as expected.

Best regards. JBF
Comment 5 whosyvox 2022-02-12 18:12:25 UTC
(In reply to Jean-Baptiste Faure from comment #4)
> (In reply to whosyvox from comment #2)
> > [...]
> > The steps to reproduce may indeed be faulty. My apologies. Here are steps
> > that should reproduce:
> > 
> > 1. Enter a cell with a number and ordinal suffix, e.g. '22nd'
> > 2. Leave the cell (e.g. press enter or tab)
> > 3. Re-enter the cell and attempt to append any further text to the cell,
> > e.g. 'of March'
> > 
> > The result will be that the newly appended text will gain the superscript:
> > 22^nd ^of ^March
> > 
> > This does not occur if you skip 2. and append the text directly after adding
> > the suffix. e.g. entering '22nd of march' in a single operation yields:
> > 22^nd of March
> 
> There is no bug there. Because nd has gained the superscript, each character
> that follows has the same format. It is the same thing in Writer. You just
> forgot to type a space after nd before leaving the cell.
> 
> This behavior is not linked to the date format. You can try with the words
> "The 1st player". If you type (without the quotes) :
> 1/ 'The 1st'
> 2/ ' player'
> you will get: 'The 1^st^ player'
> 
> If you type:
> 1/ 'The 1st '
> 2/ 'player'
> you will get: 'The 1^st player' as expected.
> 
> Best regards. JBF


The issue is that if you leave a cell with the superscript applied on the last character then, on returning, /even/ if you then start with a space, all subsequent characters will be superscripted.

e.g. The cell said '14th', you leave and rejoin, adding ' of july' results in the ' of july' also being subscripted.
If you were to type '14th of july' without leaving/re-entering the cell, it will correctly remove the superscript from 'of july'.

My point was that there's clearly some logic applied after typing a suffix to remove the superscripting, but this is not being applied if re-entering a cell.

https://www.youtube.com/watch?v=K4B_QfHKTw0
Comment 6 Stéphane Guillou (stragu) 2023-04-21 14:57:26 UTC
I see the behaviour is comment 2 in:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5cd9de202765e243e41416802f3e4486b8a96f16
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Behaviour was the same in OOo 3.3, so marking as inherited.

I guess the difference is in what triggers the autocorrect:
- Without leaving the cell, the autocorrect action is applied when the space is inserted. The autocorrect rule is to only superscript "nd", the space is left as is.
- With leaving the cell, it's the action of leaving the cell that applies the autocorrect. Therefore, the last character in the string is superscript, and anything added behind it will also be superscript.

So I agree with Jean-Baptiste: it might be surprising, but the behaviour is logical:
- Adding to a string needs to continue with the same formatting, as a default
- Alternative would be to also add a space behind "nd" when leaving the cell: this would create frustration (silently adding characters is guaranteed to raise hairs)

Hopefully that makes sense?

I am closing as "won't fix", given that it was opened as an enhancement.
But if I am missing something, like a different autocorrect action that doesn't follow the same behaviour, please let us know.