Bug 142050 - Calc: Display mismatch - initial quote displayed if followed by letters but not if followed by digits
Summary: Calc: Display mismatch - initial quote displayed if followed by letters but n...
Status: RESOLVED DUPLICATE of bug 149665
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: x86-64 (AMD64) Windows (All)
: medium trivial
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-03 08:15 UTC by Hajo
Modified: 2023-03-06 09:14 UTC (History)
1 user (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 Hajo 2021-05-03 08:15:16 UTC
Description:
An initial quote should not be displayed in a cell.

Steps to Reproduce:
1. Start Calc
2. Enter "'09:20" or any other digits following a quote. Expected behavior: quote not displayed in cell = OK
3. Enter "'abc" or any other letters following a quote. Expected behavior: quote not displayed in cell => ERROR in this case the quote is displayed

Actual Results:
Initial quote displayed if cell contains letters

Expected Results:
Initial quote not displayed in any case


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.1.2.2 (x64) / LibreOffice Community
Build ID: 8a45595d069ef5570103caea1b71cc9d82b2aae4
CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Vulkan; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: threaded
Comment 1 Mike Kaganski 2021-05-03 08:54:30 UTC
(In reply to Hajo from comment #0)
> initial quote displayed if followed by letters but not if followed by digits
> An initial quote should not be displayed in a cell.

This is a misconception.
Initial single quote is *only* treated specially on input when the rest of the string *may* be treated as number, in a cell that otherwise tries to interpret the input (has number format other than "Text"). It is used to indicate that this following "number" should be treated as literal text. The single quote is not a part of the data in cell, would not be written into the file, would not be found when searching, and would only be shown in formula bar to help you see this "number being a string".

When the data may *not* be converted to number, the leading single quote is not treated specially. This works as intended.

Case when single quote before *alphabetical* characters is treated specially: in en-US locale, enter

'Oct 10

Case when single quote before *numeric* characters is not treated specially:

'123+123

In first case, the interpreter *could* convert "Oct 10" to a date, and thus the quote is treated as a hint to not do that. In the second case, the "123+123" cannot be converted to a number, and thus the whole string (including the leading apostrophe) is considered verbatim.
Comment 2 Mike Kaganski 2023-03-06 09:14:41 UTC

*** This bug has been marked as a duplicate of bug 149665 ***