Bug 87169 - Autocorrect doesn't work on some imported .docx documents
Summary: Autocorrect doesn't work on some imported .docx documents
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3.3.2 release
Hardware: Other Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-09 20:33 UTC by Matt Price
Modified: 2015-04-28 10:47 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Minimal fle that fails to autocorrect properly. (9.89 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2014-12-10 00:29 UTC, Matt Price
Details
en-CA autocorrect file (1.28 KB, application/octet-stream)
2014-12-10 01:25 UTC, Matt Price
Details
en-US autocorrect file (8.13 KB, application/x-ns-proxy-autoconfig)
2014-12-10 01:26 UTC, Matt Price
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Price 2014-12-09 20:33:07 UTC
autocorrect, and abbreviations added manually to the autocorrect table, occasionally do not function in documents that I receive form students.  I have tried turning Format --> Autocorrect --> While typing off and hten on again, but that seems to have no effect.  On one document which I am using right now, all but one entry in the Autocorrect --> submenu are greyed out, so it is not possible to turn the "while typing" feature on.  

I can't attach these files because they don't belong to me.  I can try to produce a stripped down version of one and see if that helps.  

This is a frustrating bug for me as I use the autocorrect table to insert unicode characters such as checkmarks and copyediting symbols.  I'd welcome a workaround or fix, and am happy to run tests to help.
Comment 1 tommy27 2014-12-09 21:38:15 UTC
(In reply to Matt Price from comment #0)
> .... 
> 
> I can't attach these files because they don't belong to me.  I can try to
> produce a stripped down version of one and see if that helps.  
> 
> ...

test file needed to try debugging
Comment 2 Robinson Tryon (qubit) 2014-12-09 23:46:29 UTC
(In reply to tommy27 from comment #1)
> (In reply to Matt Price from comment #0)
> > .... 
> > 
> > I can't attach these files because they don't belong to me.  I can try to
> > produce a stripped down version of one and see if that helps.  
> > 
> > ...
> 
> test file needed to try debugging

Status -> NEEDINFO

(Matt: Please change the status back to UNCONFIRMED after you've provided a test file)
Comment 3 Matt Price 2014-12-10 00:29:44 UTC
Created attachment 110657 [details]
Minimal fle that fails to autocorrect properly.

I learned a little bit more making this file (started with student document and erased all the content).  Some corrections seem to work, e.g. “hting” is replaced by thing.  But “htings”, which is in the Replacement Table, is not replaced.  Nor is /cm, which I have mapped to ✓.  Are there multiple autocorrect mechanisms, and perhaps some of them get turned off somehow in the file itself?
Comment 4 Robinson Tryon (qubit) 2014-12-10 00:49:33 UTC
(In reply to Matt Price from comment #3)
> Created attachment 110657 [details]
> Minimal fle that fails to autocorrect properly.
> 
> I learned a little bit more making this file (started with student document
> and erased all the content).  Some corrections seem to work, e.g. “hting” is
> replaced by thing.  But “htings”, which is in the Replacement Table, is not
> replaced.  Nor is /cm, which I have mapped to ✓.  Are there multiple
> autocorrect mechanisms, and perhaps some of them get turned off somehow in
> the file itself?

There is AutoText, that's kind of like a shortcut system for adding big chunks of text/graphics/whatever:
https://help.libreoffice.org/Writer/AutoText

Perhaps there's something squirrelly with your saved entries. Please attach your autocorrect dat file to the bug. Mine's located here:
  /home/qubit/.config/libreoffice/4/user/autocorr/acor_en-US.dat

Or in a parallel (test) install, somewhere like this:
  <user dir>/autocorr/acor_en-US.dat

If you're using a different locale, please adjust the name of the file accordingly :-)
Comment 5 Matt Price 2014-12-10 01:25:52 UTC
Created attachment 110659 [details]
en-CA autocorrect file
Comment 6 Matt Price 2014-12-10 01:26:34 UTC
Created attachment 110660 [details]
en-US autocorrect file
Comment 7 Matt Price 2014-12-10 01:50:13 UTC
Looks like it has to do with locale (thanks for the tip!).  I have two autocorrect files in user/autocorr/ -- acor_en-CA.dat and  acor_en-US.dat .  en-CA is kind of a stub locale, I think, but it appears that my checkmark and other shortcuts are stored there, in DocumentList.xml.  The en_US.dat is much larger, and the DocumentList.xml is about 10 times as large. 

Setting the language for the current document to English (Canada) via Tools --> Settings --> Languages (and ticking "for this document only") activates the Autocorrect Replacement Table to which I have access via Format --> AutoCorrect --> AutoCorrect Options.  

That's a somewhat labourious process.  I recorded a macro that does it for me and bound to Alt-1 in Customize --> Keyboard, so now that works for me!  

I wonder if it's worth keeping the bug open under a different name, though, like: 

 Autocorrect doesn't identify locale of Replacement Table, 

or 

Autocorrect only makes replacement table of default locale available

If autocorrect had told me I was editing the wrong table, I probably wouldn't have had to bother you...  

I will leave title for now as you will know better than I if that's a good idea.
Comment 8 tommy27 2014-12-10 04:30:30 UTC
the en-CA autocorrect list will apply changes only to documents that are written in english (canada) while en-US autocorrect will apply to english (United States) documents.

so, probably some students are sending you document in english (canada) and english (united states) and that's why some autocorrect work in one document and not in another.

regarding the autocorrect table addition of new entries, the language and it's variant is listed in the upper right corner of the table, so you probably did not notice you entered some entries in en-CA and other in en-US

I don't see a buggy behaviour in this but just an user error.
however correct me if I'm wrong and I misunderstood the situation.

let's get back to NEEDINFO
Comment 9 tommy27 2014-12-10 04:35:52 UTC
your minimal test case is english (USA) so if I enter two autocorrect entries for hting -> thing  and   htings -> things in the acor_en-US replacement table, both will work.

if the  htings -> things  is instead in the acor_en-CA  it won't apply to that document because of it's different language variant

so I still think this is NOTABUG

feel free to revert status if you have valid arguments against this decision
Comment 10 Matt Price 2014-12-10 15:01:47 UTC
Definitely user error, thank you Tommy!  NOTABUG seems right.