Issue 126447

Summary: When using LanguageTools, toggling the checkbox "check grammar" in the spell checker removes content
Product: Writer Reporter: Stefan Heinemann <stefan.heinemann>
Component: codeAssignee: AOO issues mailing list <issues>
Status: CLOSED FIXED QA Contact:
Severity: Major    
Priority: P2 CC: kschenk, oooforum, pescetti
Version: 4.1.1Keywords: data_loss
Target Milestone: 4.1.2Flags: pescetti: 4.1.2_release_blocker+
Hardware: All   
OS: All   
Issue Type: PATCH Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Fix for the bug that removes the content when "check grammar" is toggled
none
Patch by Stefan Heinemann, modified version none

Description Stefan Heinemann 2015-08-06 09:20:30 UTC
Created attachment 84859 [details]
Fix for the bug that removes the content when "check grammar" is toggled

This was reported before, in https://bugs.documentfoundation.org/show_bug.cgi?id=39348

Steps to reproduce: 

1. install LanguageTool (http://extensions.openoffice.org/de/project/languagetool)
2. write some faulty text
3. open the spell checker
4. toggle the "check grammar" checkbox
-> content in the text gets removed

Check out this video: https://videobin.org/+9it/cp6.ogg

I attached a patch that fixed said bug.
Comment 1 Marcus 2015-08-06 11:20:09 UTC
@Stefan: Thanks for the patch. Seems to be an easy fix.

@All: I suggest to accept this issue and fix for the 4.1.2 release.

Reasons:
- Preventing data loss
- Easy fix
- Low risk
- Support the work from AOO contributors
Comment 2 oooforum (fr) 2015-08-08 12:33:04 UTC
Status and issue type changed
Comment 3 Stefan Heinemann 2015-08-10 12:15:02 UTC
It's lower case "true" of course.
Comment 4 Kay 2015-08-14 16:07:03 UTC
I took a quick look at the fix for apparently the same issue referenced in 

https://bugs.documentfoundation.org/show_bug.cgi?id=39348

Oddly, it seems the fix applied to deal with this same problem by LO

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

is basically what we have now I think. That is, it is the reverse of the patch submitted here. 

Could this behavior be caused by changes in the LanguageTools extension?
Comment 5 Andrea Pescetti 2015-08-26 07:09:12 UTC
We can surely include this in 4.1.2, but I'd appreciate to see an answer by Stefan to the previous question by Kay, to make sure that we not make code changes that are specific to LanguageTool or even to a certain version of it.
Comment 6 Andrea Pescetti 2015-08-30 15:30:15 UTC
Analysis:
- I confirm the issue with OpenOffice 4.1.1
- Stefan's patch itself does not apply.
- "before" and "after" in the patch are reversed, and this may address the perplexity by Kay too.
- I attach a version of Stefan's patch that does apply (in short: I swapped the "before" and "after" lines and I changed "True" into "true").

I built trunk (not AOO410, i.e., OpenOffice 4.1.2) with this new version of the patch, and this fixes the bug.

So the approach I will follow is:
- Patch is committed to trunk now
- Buildbots will produce a new build from trunk
- We give people the opportunity to double-check this issue before merging to AOO410 for OpenOffice 4.1.2.
Comment 7 Andrea Pescetti 2015-08-30 15:33:22 UTC
Created attachment 84897 [details]
Patch by Stefan Heinemann, modified version
Comment 8 SVN Robot 2015-08-30 15:36:28 UTC
"pescetti" committed SVN revision 1700126 into trunk:
#i126447# Fix text deletion when toggling "Check grammar" in spell checker.
Comment 9 Andrea Pescetti 2015-10-07 21:52:48 UTC
Now merged to AOO410 for OpenOffice 4.1.2.
Comment 10 Andrea Pescetti 2015-10-17 21:59:23 UTC
To verify: Repeat the "Steps to reproduce" described in the first post of this issue and check if the bug still appears.
Comment 11 Andrea Pescetti 2015-10-19 07:38:42 UTC
Verified fixed in OpenOffice 4.1.2-RC2 with latest LanguageTool (3.1) and instructions from the original post.