Bug 115833 - Specific autocorrection performed only if certain text exists in the document.
Summary: Specific autocorrection performed only if certain text exists in the document.
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
(earliest affected) release
Hardware: All All
: low trivial
Assignee: Not Assigned
Depends on:
Blocks: AutoCorrect-Complete
  Show dependency treegraph
Reported: 2018-02-18 22:08 UTC by saverio.pub2
Modified: 2021-03-08 09:52 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:

test case for replacement bug (8.62 KB, application/vnd.oasis.opendocument.text)
2018-02-18 22:08 UTC, saverio.pub2
Even more minimal test case (8.48 KB, application/vnd.oasis.opendocument.text)
2018-03-07 14:45 UTC, Buovjaga

Note You need to log in before you can comment on or make changes to this bug.
Description saverio.pub2 2018-02-18 22:08:50 UTC
Created attachment 139981 [details]
test case for replacement bug

I've removed the three dots replacement (`.*...` -> `…`) in the Write autocorrect replacement list.

This works as expected - if I open a new document and type three dots (and space), the three dots are not replaced.

However, there is a pecular exception; if I paste into the same document certain text, and type three dots (and space), the three dots are now replaced.

I've attached what I believe is the minimal test case for reproducing the problem.

In order to reproduce the error:

- remove the three dots replacement from Writer autocorrect options
- open the attached document
- type three dots (and space)

The three dots will be replaced.
Comment 1 saverio.pub2 2018-02-18 22:09:41 UTC
System information:

- XUbuntu x86-64 16.04

Libreoffice information:

Build ID: 1:6.0.1~rc1-0ubuntu0.16.04.1~lo1
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: gtk2; 
Locale: en-US (en_US.UTF-8); Calc: group
Comment 2 Buovjaga 2018-03-07 14:45:10 UTC
Created attachment 140435 [details]
Even more minimal test case

I reproduce.

I removed the table of contents by editing the content.xml and re-zipped and I can still reproduce the behaviour.

Here are the replacement rules for testers wanting to add them back after deleting from the rule list (they are near the end of the list after all the emojis):

Arch Linux 64-bit
Build ID: 856c57f20f9b07c686a854e0ccbb6ee3b0ee4791
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: kde4; 
Locale: fi-FI (fi_FI.UTF-8); Calc: group
Built on March 7th 2018
Comment 3 QA Administrators 2019-03-08 03:39:45 UTC Comment hidden (obsolete)
Comment 4 saverio.pub2 2019-03-08 22:15:44 UTC
Bug still present on v6.1.5.2.
Comment 5 QA Administrators 2021-03-08 04:01:59 UTC Comment hidden (obsolete)
Comment 6 saverio.pub2 2021-03-08 09:52:52 UTC
It turns out that this is not a bug. I've previously filed another bug for related reasons, and I got a clarifying answer.

The reason is that replacements are per-locale, and documents have an associated locale; therefore, the removal of the replacement must be performed on the document locale, not on the default one.

This is a bit confusing due to locale being multilayered; in the case of the minimal test case, it can be observer via `Tools` -> `Language` -> `For selection`, which will show `Italian (Italy)`. Removing the triple-dot from the replacement table for the `Italian (Italy)` language will yield the desired effect.