Bug 126308 - Escape character "'" (single quote) shows in final cell output
Summary: Escape character "'" (single quote) shows in final cell output
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.4.7.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Calc-Cells
  Show dependency treegraph
 
Reported: 2019-07-09 12:12 UTC by david.cortes.rivera
Modified: 2023-05-12 22:41 UTC (History)
3 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 david.cortes.rivera 2019-07-09 12:12:18 UTC
Steps to reproduce:
* Open LO Calc.
* Write something that would evaluate to a date, format, or formula, prefixing it with escape character "'" (single quote) at the beginning so that it would interpret it as raw text. E.g. "'2019-01-33", or "'*not_bold*".
* Press enter

Expected behavior: should show the text after the "'" as simple text, without trying to evaluate it to date/format/etc.

Actual behavior: depending on whether it's written from scratch or not, it might respect the "'" escape character, but will end up showing it in the cell (i.e. while MS Excel will show "2019-01-33", Calc will show "'2019-01-33"), or in some cases when there was something there from before, will ignore the "'" and evaluate anyway.
Comment 1 david.cortes.rivera 2019-07-09 12:27:34 UTC
Cannot edit the comment now, but I think this only happens when the input is invalid after being evaluated. E.g.
MS Excel: "'2019-01-01" -> "2019-01-01" (text)
MS Excel: "'2019-13-33" -> "2019-13-33" (text)
LO Calc: "'2019-01-01" -> "2019-01-01" (text)
LO Calc: "'2019-13-33" -> "'2019-13-33" (text, but includes extra character).
Comment 2 Oliver Brinzing 2019-07-09 16:49:38 UTC
(In reply to david.cortes.rivera from comment #1)
> LO Calc: "'2019-01-01" -> "2019-01-01" (text)
> LO Calc: "'2019-13-33" -> "'2019-13-33" (text, but includes extra character).

confirming, even with text, e.g.:

"'Hello" -> "'Hello"

this behaviour is different from AOO 4.1.5, but i don't know if the change was intended.
Comment 3 m_a_riosv 2019-07-11 00:29:19 UTC
I don't think it is a bug.
Character escape only works with valid non text values, otherwise there is nothing to escape. And a way to know if the escaped value it's valid or not.
Comment 4 david.cortes.rivera 2019-07-11 05:46:16 UTC
(In reply to m.a.riosv from comment #3)
> I don't think it is a bug.
> Character escape only works with valid non text values, otherwise there is
> nothing to escape. And a way to know if the escaped value it's valid or not.

But in MS Excel it doesn't show in the output when it's applied to regular text. Also being an escape character IMO it'd make sense to not show it regardless.

Finally, it has the problem that if I apply a function that adds it to a whole column, it will show it in some entries and not in others.
Comment 5 QA Administrators 2021-07-11 03:39:53 UTC Comment hidden (obsolete)
Comment 6 david.cortes.rivera 2021-07-11 03:47:28 UTC
Still reproducible:

Version: 7.0.4.2
Build ID: 00(Build:2)
CPU threads: 16; OS: Linux 5.10; UI render: default; VCL: kf5
Locale: en-US (en_US.UTF-8); UI: en-US
Debian package version: 1:7.0.4-4
Calc: threaded
Comment 7 ady 2023-05-12 22:41:15 UTC
This is solved with the resolution in bug 149665 for LO 7.5. I'm not sure I would call it a duplicate, but the behavior presented here in bug 126308 is no longer present.

If you want the apostrophe to be really part of the cell, then format the cell as text before introducing the content with its initial "'" (see Release Notes for LO 7.5).

Setting as WFM.