修訂 | 0ab42d2d63a5e339450d13caac93a92e561dabcb (tree) |
---|---|
時間 | 2012-03-10 20:41:51 |
作者 | Michael Curran <mick@kulg...> |
Commiter | Michael Curran |
nvdaHelperRemote winword support: fix a freeze seen when using IME in XP with MS Word, introduced with the new inprocess winword support. specifically: When the IME composition window is active, MS Word's range.moveEnd successfully moves by 1 unit at the end of the line/document, yet range.end does not actually change (in our code this means that range.end is equivilent to range.start). This was causing an infinite loop. Now the loop is broken straight away if after moveEnd the end is <= to start.
@@ -478,6 +478,11 @@ void winword_getTextInRange_helper(HWND hwnd, winword_getTextInRange_args* args) | ||
478 | 478 | _com_dispatch_raw_propput(pDispatchRange,wdDISPID_RANGE_END,VT_I4,args->endOffset); |
479 | 479 | chunkEndOffset=args->endOffset; |
480 | 480 | } |
481 | + //When using IME, the last moveEnd succeeds but the end does not really move | |
482 | + if(chunkEndOffset<=chunkStartOffset) { | |
483 | + LOG_DEBUGWARNING(L"moveEnd successfull but range did not expand! chunkStartOffset "<<chunkStartOffset<<L", chunkEndOffset "<<chunkEndOffset); | |
484 | + break; | |
485 | + } | |
481 | 486 | _com_dispatch_raw_propget(pDispatchRange,wdDISPID_RANGE_TEXT,VT_BSTR,&text); |
482 | 487 | if(text) { |
483 | 488 | //Force a new chunk before and after control+b (note characters) |