Bug 48892 - EDITING: AutoCorrect does not invert closing quote(s) after en dash / em dash
Summary: EDITING: AutoCorrect does not invert closing quote(s) after en dash / em dash
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Linguistic (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: lowest minor
Assignee: László Németh
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: AutoCorrect-Complete
  Show dependency treegraph
 
Reported: 2012-04-18 12:29 UTC by Patrick Gillespie
Modified: 2023-11-24 18:11 UTC (History)
4 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 Patrick Gillespie 2012-04-18 12:29:13 UTC
If one writes a sentence as follows:

"Test" :Smart Quotes Work

But one can usually reproduce the bug with the following:

"Test-- "  :Smart Quote will reverse the closing quotes.
"Test -- " :Smart Quote will reverse the closing quotes.
"Test --"  :Smart Quote will reverse the closing quotes *if* one has already tried to correct the second example by backspacing.

If one tries to correct the mistake by backspacing over the incorrect quote *and* deleting the space, Writer will still reverse the close quotes. This strange little bug seems most easily reproduced when using an em-dash with a space before and after.

Why, you might ask, would a writer insert a space before or after an em-dash? Well, I'm glad you asked. This brings me to the next bug. If one sets auto-correct to correct two dashes (--) with an em-dash, auto-correct only works if the double-dash is discreet (separated from the word it follows).

Test-- :Won't be auto-corrected.

Test -- :*Will* be auto-corrected - but then one runs into the smart quotes bug.

Look forward to a fix for this.
Comment 1 bfoman (inactive) 2012-04-27 03:26:32 UTC
Confirmed with:
LOdev 3.5.3rc1+ 
Build ID: 51648779-22e3d74-d554af7
Windows 7 Professional SP1 64 bit

Results:
„Test”
„Test-- „
„Test – „
„Test --”
Comment 2 Joel Madero 2012-09-11 21:02:01 UTC
Confirmed with 3.6.1.2. Marking as NEW and prioritizing. Please open the other issue up as a new bug as it is different and we try not to lump bugs together.

Minor - Harder to make professional quality work only under incredibly specific situation, even in that situation a simple space corrects problem

Lowest - Very unlikely many users are affected by this.

Hopefully we can get someone to take a look at this one. 

@Patrick: I agree with the second bug as well (confirmed) but it needs to be a separate bug, thanks
Comment 3 vermontpoet 2012-09-24 21:22:28 UTC
//@Patrick: I agree with the second bug as well (confirmed) but it needs to be a separate bug, thanks...//

Reported as Bug 55293
Comment 4 Owen Genat (retired) 2013-06-07 10:53:56 UTC
Changed "auto-correct" to "AutoCorrect" in title as that is the actual name of the facility in question and this bug was not showing up in typical searches. I have also made a basic clean-up of the title to more clearly indicate the highly specific nature of this issue. 

It essentially deals with the treatment of correcting a closing quotation mark when in proximity to either an en dash or em dash. The hyphen-minus (U+002D) does not display the indicated behaviour under Linux TDF/LO v4.0.3.3. As per the description given "Test – " (U+2013) or "Test — " (U+2014) if the backspace key is pressed twice to remove the erroneous closing quotation mark and prior space, entering a new closing quotation mark adjacent to the dash again results in an erroneous closing quotation mark.
Comment 5 tommy27 2014-08-02 02:43:26 UTC
(In reply to comment #0)
> .....
> 
> Why, you might ask, would a writer insert a space before or after an
> em-dash? Well, I'm glad you asked. This brings me to the next bug. If one
> sets auto-correct to correct two dashes (--) with an em-dash, auto-correct
> only works if the double-dash is discreet (separated from the word it
> follows).
> 
> Test-- :Won't be auto-corrected.
> 
> Test -- :*Will* be auto-corrected - but then one runs into the smart quotes
> bug.

take a look at Bug 55292 - autocorrect does not correct two dashes to em-dash *when dashes are not discreet*

now thanks to wilcard autocorrection this part of the issue is fixed so I wonder if after setting a proper wildcard autocorrect pattern you can get rid of the closing quote issue as well.

you need a 4.4.x master build with Lazlo's fix to test (probably a daily build will be available tomorrow)
Comment 6 Patrick Gillespie 2014-08-02 12:32:23 UTC
Okay, if anyone can provide a link to the master build. Is it here?

http://cgit.freedesktop.org/libreoffice/core/commit/?id=a07425892205ff8951027ea20459b97370d01de6

If so, I've never installed from the mater build. I'm using Debian. I usually wait for an uptodate deb and manually install, but I'm open to instruction.
Comment 7 tommy27 2014-08-02 12:42:47 UTC
daily build page is here: http://dev-builds.libreoffice.org/daily/master/

current master should integrate that fix.
Comment 8 Patrick Gillespie 2014-08-02 17:33:32 UTC
Thanks. I've installed it. It starts despite the warnings below. A quick search via Google doesn't find a Debian repository with these dependencies. Since in starts, I'll go ahead and test unless anyone says otherwise, or can recommend a source for the same. 

dpkg: dependency problems prevent configuration of lodevbasis4.4-extension-beanshell-script-provider:
 lodevbasis4.4-extension-beanshell-script-provider depends on lodevbasis4.4-core05 (>= 4.4.0.0.alpha0); however:
  Package lodevbasis4.4-core05 is not installed.
 lodevbasis4.4-extension-beanshell-script-provider depends on lodevbasis4.4-core05 (<= 4.4.0.0.alpha0-1); however:
  Package lodevbasis4.4-core05 is not installed.


dpkg: error processing package lodevbasis4.4-extension-beanshell-script-provider (--install):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of lodevbasis4.4-extension-javascript-script-provider:
 lodevbasis4.4-extension-javascript-script-provider depends on lodevbasis4.4-core05 (>= 4.4.0.0.alpha0); however:
  Package lodevbasis4.4-core05 is not installed.
 lodevbasis4.4-extension-javascript-script-provider depends on lodevbasis4.4-core05 (<= 4.4.0.0.alpha0-1); however:
  Package lodevbasis4.4-core05 is not installed.

dpkg: error processing package lodevbasis4.4-extension-javascript-script-provider (--install):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of lodevbasis4.4-extension-mediawiki-publisher:
 lodevbasis4.4-extension-mediawiki-publisher depends on lodevbasis4.4-core05 (>= 4.4.0.0.alpha0); however:
  Package lodevbasis4.4-core05 is not installed.
 lodevbasis4.4-extension-mediawiki-publisher depends on lodevbasis4.4-core05 (<= 4.4.0.0.alpha0-1); however:
  Package lodevbasis4.4-core05 is not installed.

dpkg: error processing package lodevbasis4.4-extension-mediawiki-publisher (--install):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of lodevbasis4.4-extension-nlpsolver:
 lodevbasis4.4-extension-nlpsolver depends on lodevbasis4.4-core05 (>= 4.4.0.0.alpha0); however:
  Package lodevbasis4.4-core05 is not installed.
 lodevbasis4.4-extension-nlpsolver depends on lodevbasis4.4-core05 (<= 4.4.0.0.alpha0-1); however:
  Package lodevbasis4.4-core05 is not installed.

dpkg: error processing package lodevbasis4.4-extension-nlpsolver (--install):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of lodevbasis4.4-extension-pdf-import:
 lodevbasis4.4-extension-pdf-import depends on lodevbasis4.4-core05 (>= 4.4.0.0.alpha0); however:
  Package lodevbasis4.4-core05 is not installed.
 lodevbasis4.4-extension-pdf-import depends on lodevbasis4.4-core05 (<= 4.4.0.0.alpha0-1); however:
  Package lodevbasis4.4-core05 is not installed.

dpkg: error processing package lodevbasis4.4-extension-pdf-import (--install):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of lodevbasis4.4-extension-report-builder:
 lodevbasis4.4-extension-report-builder depends on lodevbasis4.4-core05 (>= 4.4.0.0.alpha0); however:
  Package lodevbasis4.4-core05 is not installed.
 lodevbasis4.4-extension-report-builder depends on lodevbasis4.4-core05 (<= 4.4.0.0.alpha0-1); however:
  Package lodevbasis4.4-core05 is not installed.

dpkg: error processing package lodevbasis4.4-extension-report-builder (--install):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of lodevbasis4.4-filter-data:
 lodevbasis4.4-filter-data depends on lodevbasis4.4-core05 (>= 4.4.0.0.alpha0); however:
  Package lodevbasis4.4-core05 is not installed.
 lodevbasis4.4-filter-data depends on lodevbasis4.4-core05 (<= 4.4.0.0.alpha0-1); however:
  Package lodevbasis4.4-core05 is not installed.

dpkg: error processing package lodevbasis4.4-filter-data (--install):
 dependency problems - leaving unconfigured
Setting up lodevbasis4.4-gnome-integration (4.4.0.0.alpha0-1) ...
Setting up lodevbasis4.4-graphicfilter (4.4.0.0.alpha0-1) ...
Setting up lodevbasis4.4-images (4.4.0.0.alpha0-1) ...
Setting up lodevbasis4.4-impress (4.4.0.0.alpha0-1) ...
Setting up lodevbasis4.4-kde-integration (4.4.0.0.alpha0-1) ...
Setting up lodevbasis4.4-math (4.4.0.0.alpha0-1) ...
Setting up lodevbasis4.4-ogltrans (4.4.0.0.alpha0-1) ...
Setting up lodevbasis4.4-onlineupdate (4.4.0.0.alpha0-1) ...
Setting up lodevbasis4.4-ooofonts (4.4.0.0.alpha0-1) ...
Setting up lodevbasis4.4-ooolinguistic (4.4.0.0.alpha0-1) ...
dpkg: dependency problems prevent configuration of lodevbasis4.4-python-script-provider:
 lodevbasis4.4-python-script-provider depends on lodevbasis4.4-core05 (>= 4.4.0.0.alpha0); however:
  Package lodevbasis4.4-core05 is not installed.
 lodevbasis4.4-python-script-provider depends on lodevbasis4.4-core05 (<= 4.4.0.0.alpha0-1); however:
  Package lodevbasis4.4-core05 is not installed.
Comment 9 tommy27 2014-08-03 15:46:23 UTC
(In reply to comment #5)
> (In reply to comment #0)
> ...
> take a look at Bug 55292 - autocorrect does not correct two dashes to
> em-dash *when dashes are not discreet*
> 
> now thanks to wilcard autocorrection this part of the issue is fixed so I
> wonder if after setting a proper wildcard autocorrect pattern you can get
> rid of the closing quote issue as well.
> 
> you need a 4.4.x master build with Lazlo's fix to test (probably a daily
> build will be available tomorrow)


I've just tested a new 4.4.x daily but that wildcard fix has no effect on the "closing quotes" issue when dealing with these examples.

> "Test-- "  :Smart Quote will reverse the closing quotes.
> "Test -- " :Smart Quote will reverse the closing quotes.

this 3rd case instead will work either with en-dash or em-dash

> "Test --"  :Smart Quote will reverse the closing quotes *if* one has already
> tried to correct the second example by backspacing.

I see correct closing of quotes without hitting backspace.


please retest yourself and give feedback.
info about new wildard autocorrect patterns for en- and em-dash described in detail here: https://bugs.freedesktop.org/show_bug.cgi?id=55292#c19
Comment 10 Owen Genat (retired) 2014-08-10 02:55:06 UTC
(In reply to comment #9)
> I've just tested a new 4.4.x daily ...
> 
> please retest yourself and give feedback.
> info about new wildard autocorrect patterns for en- and em-dash described in 
> detail here: https://bugs.freedesktop.org/show_bug.cgi?id=55292#c19

Using attachment 104345 [details] (as per bug 55292) for AutoCorrect, I placed it in my user profile and renamed it to acor_en-AU.dat (my locale) so I can see exactly which entries are being used and confirm that ONLY these entries are being used. Tested under v4.4.0.0.alpha0+ Build ID: 4d635dcae4d7275d04a17a0efc11b0531d5d0a82
TinderBox: Linux-rpm_deb-x86_64@46-TDF, Branch:master, Time: 2014-08-08_23:24:32

Results (trailing character after second quote mark is a SPACE):

“a-- “     to n-dash OK and wrong closing quote NOT OK
“a--- “    to m-dash OK and wrong closing quote NOT OK
“a -- “    to n-dash OK and wrong closing quote NOT OK
“a --- “   to m-dash OK and wrong closing quote NOT OK
“a --”     to n-dash OK and correct closing quote OK
“a ---”    to n-dash+hyphen NOT OK and correct closing quote OK
Comment 11 tommy27 2014-08-18 13:44:24 UTC
I see the same closing quotes issues near to en-dash in OOo 3.3 and AOO 4.1 as well, hence the bug is inherited from OOo era.
Comment 12 tommy27 2015-07-28 05:47:06 UTC
(In reply to Patrick Gillespie from comment #0)
> If one writes a sentence as follows:
> 
> "Test" :Smart Quotes Work
> 
> But one can usually reproduce the bug with the following:
> 
> "Test-- "  :Smart Quote will reverse the closing quotes.
> "Test -- " :Smart Quote will reverse the closing quotes.
> "Test --"  :Smart Quote will reverse the closing quotes *if* one has already
> tried to correct the second example by backspacing.
> ....

still present in LibO 5.1.0.0.alpha1+
Build ID: 8cfdd81b70ef37927b40497ffd10034f28335034
TinderBox: Win-x86@39, Branch:master, Time: 2015-07-24_02:47:18
Locale: en-US (it_IT)
Comment 13 QA Administrators 2016-09-20 10:18:39 UTC Comment hidden (obsolete)
Comment 14 tommy27 2016-09-24 08:15:38 UTC
retested under Win8.1 x64 using 
LibO 5.3.0.0.alpha0+
Build ID: 4c70a1a6666a079872b8f1966bd398e924dc1d1a
CPU Threads: 4; OS Version: Windows 6.29; UI Render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2016-09-22_06:54:24
Locale: it-IT (it_IT); Calc: group

Replace single and double quotes option ON.
P.S. -- is "en-dash" and --- is "em-dash"

“a--”    -> correct
“a –-”   -> correct
“a–- “   -> reverse
“a –- “  -> reverse

“a---”    -> correct
“a –--”   -> correct
“a–-- “   -> reverse
“a –-- “  -> reverse

“a-”    -> correct
“a -”   -> correct
“a- “   -> reverse
“a - “  -> reverse

“a!”    -> correct
“a !”   -> correct
“a! “   -> reverse
“a ! “  -> reverse

“ab”    -> correct
“a b”   -> correct
“ab “   -> reverse
“a b “  -> reverse

according to my tests it's not a matter of proximity to an "en-dash" or to an "em-dash" and it's not even an autocorrect issue.

I see the reverse of closing quotes even using a single hyphen, another punctation mark (i.e. !) or another letter.

which really causes the reverting of closing quotes is the presence of a blank space (" ") before the second quote you digit.

to be more precise I would say that if there's no space before second quote, that one is correcly reverted, while if there's a space before second quote it is not reverted and remains straight like the first one.

correct me if I misunderstood the bug scenario.
maybe something changed from the initial description since a patch about en-dash and em-dash autocorrections and use of hyphen as an autocorrect trigger changed after the fix for Bug 83037
Comment 15 QA Administrators 2018-06-18 02:42:30 UTC Comment hidden (obsolete)
Comment 16 QA Administrators 2020-06-18 03:52:36 UTC Comment hidden (obsolete)
Comment 17 QA Administrators 2022-06-19 03:29:19 UTC Comment hidden (obsolete)
Comment 18 Stéphane Guillou (stragu) 2023-06-26 18:20:12 UTC
Testing again with a recent master build, I can confirm the issue:

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

The issue is not related to the autocorrect of two hyphens to one em-dash.

To test, only make sure the option "Replace" is on in: Tools > AutoCorrect > AutoCorrect Options > Localized options > Double Quotes.
One can test that autocorrect of closing double quotes work properly directly after (these can be copy-pasted if needed):

- a hyphen: “Test-”
- an underscore: “Test_”
- a minus sign: “Test−”
- a tilde: “Test~”
- a full stop: “Test.”
- etc.

But not after:

- an en-dash: “Test–“
- an em-dash: “Test—“

Same with single quotes.