OSDN Git Service

adobeAcrobat vbuf backend: Don't descend beneath word nodes for FontInfo_NoInfo,...
authorJames Teh <jamie@jantrid.net>
Tue, 30 Oct 2012 08:32:08 +0000 (18:32 +1000)
committerJames Teh <jamie@jantrid.net>
Tue, 30 Oct 2012 08:32:08 +0000 (18:32 +1000)
It looks like the word segments don't have valid font info where this occurs anyway, so descending doesn't help.

nvdaHelper/vbufBackends/adobeAcrobat/adobeAcrobat.cpp

index eda3fbc..8b9a697 100644 (file)
@@ -134,7 +134,12 @@ VBufStorage_fieldNode_t* renderText(VBufStorage_buffer_t* buffer,
        if (!text)\r
                domNode->GetChildCount(&childCount);\r
 \r
-       if (fontStatus == FontInfo_NoInfo && childCount > 0) {\r
+       long nodeType = 0;\r
+       if (fontStatus == FontInfo_NoInfo && childCount > 0\r
+               // We never want to descend beneath word nodes,\r
+               // as word segments sometimes seem to double characters.\r
+               && domNode->GetType(&nodeType) == S_OK && nodeType != CPDDomNode_Word\r
+       ) {\r
                // HACK: #2175: Reader 10.1 and later report FontInfo_NoInfo even when there is mixed font info.\r
                // Therefore, we must assume FontInfo_MixedInfo.\r
                fontStatus = FontInfo_MixedInfo;\r