Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/PluginFilter.cpp

Issue 12325013: Fix ATL assertion error in traverser (Closed)
Patch Set: Simplified the logic Created Oct. 16, 2013, 9:26 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginFilter.cpp
===================================================================
--- a/src/plugin/PluginFilter.cpp
+++ b/src/plugin/PluginFilter.cpp
@@ -388,27 +388,24 @@
case ETraverserComplexType::TRAVERSER_TYPE_IMMEDIATE:
hr = S_FALSE;
CComQIPtr<IHTMLDOMNode> pPrevSiblingNode = pEl;
+ long type = 0;
+ while (pPrevSiblingNode && type != 1)
+ {
+ IHTMLDOMNode* tmpNode;
+ pPrevSiblingNode->get_previousSibling(&tmpNode);
+ pPrevSiblingNode.Attach(tmpNode);
+ if (pPrevSiblingNode)
+ {
+ hr = pPrevSiblingNode->get_nodeType(&type);
+ if (hr != S_OK)
+ pPrevSiblingNode.Release();
+ }
+ }
+
if (pPrevSiblingNode)
- {
- long type;
- do
- {
- IHTMLDOMNode* tmpNode;
- pPrevSiblingNode->get_previousSibling(&tmpNode);
- pPrevSiblingNode.Attach(tmpNode);
- if (pPrevSiblingNode)
- {
- hr = pPrevSiblingNode->get_nodeType(&type);
- if (hr != S_OK)
- pPrevSiblingNode.Release();
- }
- } while (pPrevSiblingNode && type != 1);
-
- if (pPrevSiblingNode)
- hr = pPrevSiblingNode.QueryInterface(&pDomPredecessor);
- else
- return false;
- }
+ hr = pPrevSiblingNode.QueryInterface(&pDomPredecessor);
+ else
+ return false;
break;
}
if (hr != S_OK)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld