OSDN Git Service

winword_getTextInRange: no longer move through the text by Winword's characterFormatt...
authorMichael Curran <mick@kulgan.net>
Tue, 6 Dec 2011 02:08:06 +0000 (12:08 +1000)
committerMichael Curran <mick@kulgan.net>
Tue, 6 Dec 2011 02:08:06 +0000 (12:08 +1000)
nvdaHelper/remote/winword.cpp

index 870f5e4..a4d5caa 100644 (file)
@@ -480,12 +480,8 @@ void winword_getTextInRange_helper(HWND hwnd, winword_getTextInRange_args* args)
        //And grab any text and formatting and generate appropriate xml\r
        bool firstLoop=true;\r
        do {\r
-               //Try moving\r
-               //But if characterFormatting doesn't work, and word doesn't work, or no units were moved then break out of the loop\r
-               if((\r
-                       ((formatConfig&formatConfig_reportSpellingErrors)||(_com_dispatch_raw_method(pDispatchRange,wdDISPID_RANGE_MOVEEND,DISPATCH_METHOD,VT_I4,&unitsMoved,L"\x0003\x0003",wdCharacterFormatting,1)!=S_OK))&&\r
-                       _com_dispatch_raw_method(pDispatchRange,wdDISPID_RANGE_MOVEEND,DISPATCH_METHOD,VT_I4,&unitsMoved,L"\x0003\x0003",wdWord,1)!=S_OK\r
-               )||unitsMoved<=0) {\r
+               //Move the end by word\r
+               if(_com_dispatch_raw_method(pDispatchRange,wdDISPID_RANGE_MOVEEND,DISPATCH_METHOD,VT_I4,&unitsMoved,L"\x0003\x0003",wdWord,1)!=S_OK||unitsMoved<=0) {\r
                        break;\r
                }\r
                _com_dispatch_raw_propget(pDispatchRange,wdDISPID_RANGE_END,VT_I4,&chunkEndOffset);\r