https://bugs.freedesktop.org/show_bug.cgi?id=83037

          Priority: medium
            Bug ID: 83037
          Assignee: libreoffice-bugs@lists.freedesktop.org
           Summary: → and ← and autocorrect collisions
          Severity: normal
    Classification: Unclassified
                OS: Windows (All)
          Reporter: ba...@quipo.it
          Hardware: Other
            Status: UNCONFIRMED
           Version: 4.4.0.0.alpha0+ Master
         Component: Linguistic
           Product: LibreOffice

tested under Win7x64 using LibO 4.2.6.2, 4.3.0.4 and 4.4.x master

STEPS TO REPRODUCE

1- open a new document 
2- select language English (USA)
3- be sure autocorrect replacement is active (“Tools/AutoCorrect
Options/Options” flag both M and T in “use replacement table”
4- be sure an English (USA) autocorrect list is activated in the user profile
(“Tools/AutoCorrect Options/Replace” scroll the language list to English (USA)
and add a new custom autocorrect entry
5- type: -> , -- > , <- , <-- 

with 4.2.x and 4.3.x you will see: → , → , ← , ←- 

with 4.4.x you'll see: → , -→ , ← , ←- 

this is caused by a collision of the following autocorrect replacements in
4.4.x :

.*->.*     to    →     (unicode U+2192)
.*-->.*    to    → 
.*<-.*     to    ←     (unicode U+2190)
.*<--.*    to    ←


are present in LibO 4.4.x master in the default autocorrect list for the these
languages:

Catalan, Czech, Danish, Dutch (NL), Dutch (BE), English (AU), English (US),
English (UK), Finnish, French, German, Lithuanian, Luxembourgish, Polish,
Portuguese (PT), Portuguese (BR), Russian, Spanish, Swedish, Vietnamese

whilst .*->.* and .*<-.* are correctly replaced respectively as → and ←
.*-->.* and .*<--.* get erroneously replaced as -→ and  ←-

this is due to collision between the .*->.* and .*-->.* replacement since the
-> pattern is already contained in the --> pattern

the middle autocorrect wildcard pattern is actually only present in 4.4.x
master and not in 4.2.x and 4.3.x

that wildcard it was added to special characters by Lazlo Nemeth to fix Bug
81571 - AutoCorrect incorrectly requires and keeps spaces around special
characters

see his committ:
http://cgit.freedesktop.org/libreoffice/core/commit/?id=b3b6361c555e54ce852d62c80c0bb3d19c1ec78f


while that fix is ok for other replacements such as .*(r).* to ® in order to
allow thinkgs like Sony(R) to be replaced as Sony®, it causes collisions
between -> and --> 

So I suggest the to remove the wildcards from those entries since in 4.2.x and
4.3.x the old “ -> to → ” and “ --> to → ” replacements with no wildcard have
no collision between them.

To avoid the autocorrect collision of *.<-.* and *.<--.* removing the wildcards
is not enough since the bug is also present with simple <- and <-- and in 4.2.x
and 4.3.x 

another part of the bug is indeed that the - is a trailing character (like “.”
or “space”) and triggers autocorrect replacement before you complete the typing
sequence.

So you have to remove the wildcard from *.<-.* and entirely replace them with
.*←-.* to ← 

In summary we should change this current 4.4.x replacements:
.*->.*     to    →     (unicode U+2192)
.*-->.*    to    → 
.*<-.*     to    ←     (unicode U+2190)
.*<--.*    to    ←

with:
->      to    →     (unicode U+2192)
-->     to    → 
<-      to    ←     (unicode U+2190)
.*←-.*  to    ←

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to