OSDN Git Service

adobeAcrobat vbuf backend: Some nodes seem to report FontInfo_MixedInfo for IPDDomNod...
authorJames Teh <jamie@jantrid.net>
Fri, 5 Nov 2010 11:45:18 +0000 (21:45 +1000)
committerJames Teh <jamie@jantrid.net>
Fri, 5 Nov 2010 11:45:18 +0000 (21:45 +1000)
source/NVDAHelper/vbufBackends/adobeAcrobat/adobeAcrobat.cpp
user_docs/en/changes.t2t

index ccfc213..cff14ef 100644 (file)
@@ -116,19 +116,25 @@ VBufStorage_fieldNode_t* renderText(VBufStorage_buffer_t* buffer,
                fontStatus = FontInfo_NoInfo;\r
        }\r
 \r
+       long childCount;\r
        if (fontStatus == FontInfo_MixedInfo) {\r
                // This node contains text in more than one font.\r
                // We need to descend further to get font information.\r
                DEBUG_MSG(L"Mixed font info, descending");\r
-               long childCount;\r
                if ((res = domNode->GetChildCount(&childCount)) != S_OK) {\r
                        DEBUG_MSG(L"IPDDomNode::GetChildCount returned " << res);\r
                        childCount = 0;\r
                }\r
                if (childCount == 0) {\r
-                       DEBUG_MSG(L"Child count is 0");\r
+                       // HACK: Child count really shouldn't be 0 if fontStatus is FontInfo_MixedInfo, but it sometimes is.\r
+                       // Therefore, ignore FontInfo_MixedInfo in this case.\r
+                       // Otherwise, the node will be rendered as empty.\r
+                       DEBUG_MSG(L"Child count is 0, ignoring mixed font info");\r
+                       fontStatus = FontInfo_NoInfo;\r
                }\r
+       }\r
 \r
+       if (fontStatus == FontInfo_MixedInfo) {\r
                // Iterate through the children.\r
                for (long childIndex = 0; childIndex < childCount; ++childIndex) {\r
                        IPDDomNode* domChild;\r
index 4d1a02c..fac8dd4 100644 (file)
@@ -28,6 +28,7 @@
 - If an NVDA modifier key is pressed twice quickly but there is an intervening key press, the NVDA modifier key is no longer passed through on the second press.\r
 - Punctuation keys are now spoken in input help even when speaking of punctuation is disabled. (#977)\r
 - In the Keyboard Settings dialog, the keyboard layout names are now presented in the configured NVDA language instead of always in English. (#558)\r
+- Fixed an issue where some items were rendered as empty in Adobe Reader documents; e.g. the links in the table of contents of the Apple iPhone IOS 4.1 User Guide.\r
 \r
 \r
 = 2010.2 =\r