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

Unified Diff: src/plugin/PluginFilter.cpp

Issue 4912420225024000: Issue #1234 - Convert strings associated with URL's (Closed)
Patch Set: Created Jan. 5, 2015, 4:15 p.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
Index: src/plugin/PluginFilter.cpp
===================================================================
--- a/src/plugin/PluginFilter.cpp
+++ b/src/plugin/PluginFilter.cpp
@@ -565,7 +565,7 @@
{
#ifdef ENABLE_DEBUG_RESULT
DEBUG_HIDE_EL(indent + "HideEl::Found (tag/id) filter:" + idIt->second.m_filterText)
- CPluginDebug::DebugResultHiding(tagCString, "id:" + id, idIt->second.m_filterText);
+ CPluginDebug::DebugResultHiding(tagCString, L"id:" + id, idIt->second.m_filterText);
#endif
return true;
}
@@ -579,7 +579,7 @@
{
#ifdef ENABLE_DEBUG_RESULT
DEBUG_HIDE_EL(indent + "HideEl::Found (?/id) filter:" + idIt->second.m_filterText)
- CPluginDebug::DebugResultHiding(tagCString, "id:" + id, idIt->second.m_filterText);
+ CPluginDebug::DebugResultHiding(tagCString, L"id:" + id, idIt->second.m_filterText);
#endif
return true;
}
@@ -602,7 +602,7 @@
{
#ifdef ENABLE_DEBUG_RESULT
DEBUG_HIDE_EL(indent + "HideEl::Found (tag/class) filter:" + classIt->second.m_filterText)
- CPluginDebug::DebugResultHiding(tagCString, "class:" + className, classIt->second.m_filterText);
+ CPluginDebug::DebugResultHiding(tagCString, L"class:" + className, classIt->second.m_filterText);
#endif
return true;
}
@@ -705,15 +705,14 @@
bool CPluginFilter::ShouldBlock(const std::wstring& src, int contentType, const std::wstring& domain, bool addDebug) const
{
- CString srcCString = to_CString(src);
+ std::wstring srcTrimmed = TrimString(src);
// We should not block the empty string, so all filtering does not make sense
// Therefore we just return
- if (srcCString.Trim().IsEmpty())
+ if (srcTrimmed.empty())
{
return false;
}
-
CPluginSettings* settings = CPluginSettings::GetInstance();
CString type;
@@ -729,20 +728,20 @@
}
CPluginClient* client = CPluginClient::GetInstance();
- if (client->Matches(to_wstring(srcCString), to_wstring(type), domain))
+ if (client->Matches(srcTrimmed, to_wstring(type), domain))
{
if (addDebug)
{
DEBUG_FILTER("Filter::ShouldBlock " + type + " YES")
#ifdef ENABLE_DEBUG_RESULT
- CPluginDebug::DebugResultBlocking(type, srcCString, domain);
+ CPluginDebug::DebugResultBlocking(type, srcTrimmed, domain);
#endif
}
return true;
}
#ifdef ENABLE_DEBUG_RESULT
- CPluginDebug::DebugResultIgnoring(type, srcCString, domain);
+ CPluginDebug::DebugResultIgnoring(type, srcTrimmed, domain);
#endif
return false;
}

Powered by Google App Engine
This is Rietveld