# Bazaar merge directive format 2 (Bazaar 0.90)
# revision_id: manish10@gmail.com-20130411050113-vtt72oe5mcx1td0c
# target_branch: http://bzr.nvaccess.org/nvda/main/
# testament_sha1: ee52e997a7d302bb810bd4f7362ee953571a1333
# timestamp: 2013-04-11 10:34:36 +0530
# base_revision_id: mhameed@src.gnome.org-20130407140912-\
#   nxcewil6sl1abcuh
# 
# Begin patch
=== modified file 'nvdaHelper/remote/winword.cpp'
--- nvdaHelper/remote/winword.cpp	2013-03-13 03:11:22 +0000
+++ nvdaHelper/remote/winword.cpp	2013-04-11 05:01:13 +0000
@@ -50,6 +50,9 @@
 #define wdDISPID_STYLE_NAMELOCAL 0
 #define wdDISPID_RANGE_SPELLINGERRORS 316
 #define wdDISPID_SPELLINGERRORS_COUNT 1
+#define wdDISPID_RANGE_APPLICATION 1000
+#define wdDISPID_APPLICATION_ISSANDBOX 492
+
 #define wdDISPID_RANGE_FONT 5
 #define wdDISPID_FONT_COLOR 159
 #define wdDISPID_FONT_BOLD 130
@@ -398,11 +401,20 @@
 		}
 	} 
 	if(formatConfig&formatConfig_reportSpellingErrors) {
-		IDispatchPtr pDispatchSpellingErrors=NULL;
-		if(_com_dispatch_raw_propget(pDispatchRange,wdDISPID_RANGE_SPELLINGERRORS,VT_DISPATCH,&pDispatchSpellingErrors)==S_OK&&pDispatchSpellingErrors) {
-			_com_dispatch_raw_propget(pDispatchSpellingErrors,wdDISPID_SPELLINGERRORS_COUNT,VT_I4,&iVal);
-			if(iVal>0) {
-				formatAttribsStream<<L"invalid-spelling=\""<<iVal<<L"\" ";
+		IDispatchPtr pDispatchApplication=NULL;
+		if(_com_dispatch_raw_propget(pDispatchRange,wdDISPID_RANGE_APPLICATION ,VT_DISPATCH,&pDispatchApplication)==S_OK && pDispatchApplication) {
+			bool isSandbox = true;
+			// We need to ironically enter the if block if the call to get IsSandbox property fails
+			// for backward compatibility because IsSandbox was introduced with word 2010 and earlier versions will return a failure for this property access.
+			// This however, means that if this property access fails for some reason in word 2010, then we will incorrectly enter this section.
+			if(_com_dispatch_raw_propget(pDispatchApplication,wdDISPID_APPLICATION_ISSANDBOX ,VT_BOOL,&isSandbox)!=S_OK || !isSandbox ) {
+				IDispatchPtr pDispatchSpellingErrors=NULL;
+				if(_com_dispatch_raw_propget(pDispatchRange,wdDISPID_RANGE_SPELLINGERRORS,VT_DISPATCH,&pDispatchSpellingErrors)==S_OK&&pDispatchSpellingErrors) {
+					_com_dispatch_raw_propget(pDispatchSpellingErrors,wdDISPID_SPELLINGERRORS_COUNT,VT_I4,&iVal);
+					if(iVal>0) {
+						formatAttribsStream<<L"invalid-spelling=\""<<iVal<<L"\" ";
+					}
+				}
 			}
 		}
 	}

# Begin bundle
IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWe/nsBQAAg3fgHAyeWf//37t
38S//9/+UAW+7UtzXTa40js0dFTbhlAk9JmptSn6Zok9BPQ1Rp6TTyjQ0GCaabU09T1NNBkhMmJp
poUxT2kT1D01DQDI0aMEyAAMEoJMKYKbSTxRp6NNQ9QaHqHogAGjQ0DT1DgGEYTTEMAgGQAwjTJk
wjAQ0EkSZDRBoaJmUyaaap5IzRNAPUepiBoD0jSAJUAmTMMyUQV7aeA5+sPAwwibomN87UGOL1NS
UI9WnczC6G6Xd4Rpp3cGyzq9m2rNNUVenoP3CkoM+TnOJlTESpD73hNL36xN/hHwTuiehAUbPBe/
NIxzN7dTFrmke+WU28nBi2YI8i6kZ1FUWGwcozFVnM+KhiWkbYaw4l8f3pzcEY7VseL2JnatCCNQ
hE6BUiAC6wPWmiaeFaV1szP7BGO/8x5BfwCxXEFbzwB1TiNjdjDdq0LBc3EqklhyljzLrTantfLG
2Up5Ftkidw5VZ2vMN9Q5BIMIMW44ohIxpSvKHIL8IuKqgRk7itDDVll3wJ1ektr8bjKycdwIvQ8G
iDSLtRPpiC8OQGpsjX8arRSrO0F7QQ6VGCajialnXKWV3HYNuExY8rpuoHeEGGpiZQOmgQA1L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