Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 #include "PluginStdAfx.h" | 1 #include "PluginStdAfx.h" |
2 | 2 |
3 #include "PluginFilter.h" | 3 #include "PluginFilter.h" |
4 | 4 |
5 #if (defined PRODUCT_ADBLOCKPLUS) | 5 #if (defined PRODUCT_ADBLOCKPLUS) |
6 #include "PluginSettings.h" | 6 #include "PluginSettings.h" |
7 #include "PluginClient.h" | 7 #include "PluginClient.h" |
8 #include "PluginClientFactory.h" | 8 #include "PluginClientFactory.h" |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
381 CComPtr<IHTMLElement> pDomPredecessor; | 381 CComPtr<IHTMLElement> pDomPredecessor; |
382 HRESULT hr = S_FALSE; | 382 HRESULT hr = S_FALSE; |
383 switch (m_predecessor->m_type) | 383 switch (m_predecessor->m_type) |
384 { | 384 { |
385 case ETraverserComplexType::TRAVERSER_TYPE_PARENT: | 385 case ETraverserComplexType::TRAVERSER_TYPE_PARENT: |
386 hr = pEl->get_parentElement(&pDomPredecessor); | 386 hr = pEl->get_parentElement(&pDomPredecessor); |
387 break; | 387 break; |
388 case ETraverserComplexType::TRAVERSER_TYPE_IMMEDIATE: | 388 case ETraverserComplexType::TRAVERSER_TYPE_IMMEDIATE: |
389 hr = S_FALSE; | 389 hr = S_FALSE; |
390 CComQIPtr<IHTMLDOMNode> pPrevSiblingNode = pEl; | 390 CComQIPtr<IHTMLDOMNode> pPrevSiblingNode = pEl; |
391 long type = 0; | |
392 while (pPrevSiblingNode && type != 1) | |
393 { | |
394 IHTMLDOMNode* tmpNode; | |
395 pPrevSiblingNode->get_previousSibling(&tmpNode); | |
396 pPrevSiblingNode.Attach(tmpNode); | |
397 if (pPrevSiblingNode) | |
398 { | |
399 hr = pPrevSiblingNode->get_nodeType(&type); | |
400 if (hr != S_OK) | |
401 pPrevSiblingNode.Release(); | |
402 } | |
403 } | |
404 | |
391 if (pPrevSiblingNode) | 405 if (pPrevSiblingNode) |
392 { | 406 hr = pPrevSiblingNode.QueryInterface(&pDomPredecessor); |
393 long type; | 407 else |
394 do | 408 return false; |
395 { | |
396 IHTMLDOMNode* tmpNode; | |
397 pPrevSiblingNode->get_previousSibling(&tmpNode); | |
398 pPrevSiblingNode.Attach(tmpNode); | |
Wladimir Palant
2013/10/08 10:30:38
For reference: this is the only place that needed
| |
399 if (pPrevSiblingNode) | |
400 { | |
401 hr = pPrevSiblingNode->get_nodeType(&type); | |
402 if (hr != S_OK) | |
403 pPrevSiblingNode.Release(); | |
404 } | |
405 } while (pPrevSiblingNode && type != 1); | |
406 | |
407 if (pPrevSiblingNode) | |
408 hr = pPrevSiblingNode.QueryInterface(&pDomPredecessor); | |
409 else | |
410 return false; | |
411 } | |
Wladimir Palant
2013/10/08 10:30:38
I think that the logic here is still unnecessarily
Felix Dahlke
2013/10/10 08:52:45
Yes, that'd be better.
| |
412 break; | 409 break; |
413 } | 410 } |
414 if (hr != S_OK) | 411 if (hr != S_OK) |
415 return false; | 412 return false; |
416 return m_predecessor->IsMatchFilterElementHide(pDomPredecessor); | 413 return m_predecessor->IsMatchFilterElementHide(pDomPredecessor); |
417 } | 414 } |
418 | 415 |
419 return true; | 416 return true; |
420 } | 417 } |
421 | 418 |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
867 if (pos > 0 && domain.GetLength() + pos == subdomain.GetLength()) | 864 if (pos > 0 && domain.GetLength() + pos == subdomain.GetLength()) |
868 { | 865 { |
869 if (subdomain.GetAt(pos - 1) == '.') | 866 if (subdomain.GetAt(pos - 1) == '.') |
870 { | 867 { |
871 return true; | 868 return true; |
872 } | 869 } |
873 } | 870 } |
874 | 871 |
875 return false; | 872 return false; |
876 } | 873 } |
LEFT | RIGHT |