From 17d5196ffdf89fccff89ae5d35b1bef1cb8d81ec Mon Sep 17 00:00:00 2001 From: James Teh Date: Fri, 10 Jun 2016 11:59:52 +1000 Subject: [PATCH] Remove reporting of grammar errors, as this causes crashes in Microsoft Word. This reverts most of commit 05c1eb7b11ac17ea2f3346ee7a25c9e0bdc36fca. Fixes #5954. Re #5877. --- nvdaHelper/remote/winword.cpp | 19 +++++-------------- source/config/__init__.py | 1 - source/globalCommands.py | 16 +--------------- source/gui/settingsDialogs.py | 6 ------ source/speech.py | 14 -------------- user_docs/en/changes.t2t | 1 + user_docs/en/userGuide.t2t | 1 - 7 files changed, 7 insertions(+), 51 deletions(-) diff --git a/nvdaHelper/remote/winword.cpp b/nvdaHelper/remote/winword.cpp index 3c42e87a4a6..8e231c4e3b3 100644 --- a/nvdaHelper/remote/winword.cpp +++ b/nvdaHelper/remote/winword.cpp @@ -73,7 +73,6 @@ using namespace std; #define wdDISPID_CONTENTCONTROL_TITLE 12 #define wdDISPID_STYLE_NAMELOCAL 0 #define wdDISPID_STYLE_PARENT 1002 -#define wdDISPID_RANGE_GRAMMATICALERRORS 315 #define wdDISPID_RANGE_SPELLINGERRORS 316 #define wdDISPID_SPELLINGERRORS_ITEM 0 #define wdDISPID_SPELLINGERRORS_COUNT 1 @@ -328,7 +327,7 @@ BOOL generateFormFieldXML(IDispatch* pDispatchRange, wostringstream& XMLStream, return foundFormField; } -bool collectSpellingGrammarErrorOffsets(int spellingGrammarErrorsDispId, IDispatchPtr pDispatchRange, vector>& errorVector) { +bool collectSpellingErrorOffsets(IDispatchPtr pDispatchRange, vector>& errorVector) { IDispatchPtr pDispatchApplication=NULL; if(_com_dispatch_raw_propget(pDispatchRange,wdDISPID_RANGE_APPLICATION ,VT_DISPATCH,&pDispatchApplication)!=S_OK||!pDispatchApplication) { return false; @@ -340,7 +339,7 @@ bool collectSpellingGrammarErrorOffsets(int spellingGrammarErrorsDispId, IDispat return false; } IDispatchPtr pDispatchSpellingErrors=NULL; - if(_com_dispatch_raw_propget(pDispatchRange,spellingGrammarErrorsDispId,VT_DISPATCH,&pDispatchSpellingErrors)!=S_OK||!pDispatchSpellingErrors) { + if(_com_dispatch_raw_propget(pDispatchRange,wdDISPID_RANGE_SPELLINGERRORS,VT_DISPATCH,&pDispatchSpellingErrors)!=S_OK||!pDispatchSpellingErrors) { return false; } long iVal=0; @@ -848,11 +847,9 @@ void winword_getTextInRange_helper(HWND hwnd, winword_getTextInRange_args* args) } //Check for any inline shapes in the entire range to work out whether its worth checking for them by word bool hasInlineShapes=(getInlineShapesCount(pDispatchRange)>0); - vector > spellingErrorVector; - vector > grammarErrorVector; + vector > errorVector; if(formatConfig&formatConfig_reportSpellingErrors) { - collectSpellingGrammarErrorOffsets(wdDISPID_RANGE_SPELLINGERRORS,pDispatchRange,spellingErrorVector); - collectSpellingGrammarErrorOffsets(wdDISPID_RANGE_GRAMMATICALERRORS,pDispatchRange,grammarErrorVector); + collectSpellingErrorOffsets(pDispatchRange,errorVector); } _com_dispatch_raw_method(pDispatchRange,wdDISPID_RANGE_COLLAPSE,DISPATCH_METHOD,VT_EMPTY,NULL,L"\x0003",wdCollapseStart); int chunkStartOffset=args->startOffset; @@ -951,18 +948,12 @@ void winword_getTextInRange_helper(HWND hwnd, winword_getTextInRange_args* args) XMLStream<>::iterator i=errorVector.begin();i!=errorVector.end();++i) { if(chunkStartOffset>=i->first&&chunkStartOffsetsecond) { XMLStream<=i->first&&chunkStartOffsetsecond) { - XMLStream<>::iterator i=commentVector.begin();i!=commentVector.end();++i) { if(!(chunkStartOffset>=i->second||chunkEndOffset<=i->first)) { XMLStream<second)<