Index: Source/WebCore/inspector/ContentSearchUtils.cpp |
=================================================================== |
--- Source/WebCore/inspector/ContentSearchUtils.cpp (revision 98111) |
+++ Source/WebCore/inspector/ContentSearchUtils.cpp (working copy) |
@@ -97,9 +97,9 @@ |
return result; |
} |
-RegularExpression createSearchRegex(const String& text, bool caseSensitive, bool isRegex) |
+RegularExpression createSearchRegex(const String& query, bool caseSensitive, bool isRegex) |
{ |
- String regexSource = isRegex ? text : createSearchRegexSource(text); |
+ String regexSource = isRegex ? query : createSearchRegexSource(query); |
return RegularExpression(regexSource, caseSensitive ? TextCaseSensitive : TextCaseInsensitive); |
} |
@@ -119,11 +119,11 @@ |
return result; |
} |
-PassRefPtr<InspectorArray> searchInTextByLines(const String& query, const String& text) |
+PassRefPtr<InspectorArray> searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex) |
{ |
RefPtr<InspectorArray> result = InspectorArray::create(); |
- RegularExpression regex = ContentSearchUtils::createSearchRegex(query, false, false); |
+ RegularExpression regex = ContentSearchUtils::createSearchRegex(query, caseSensitive, isRegex); |
Vector<pair<int, String> > matches = getRegularExpressionMatchesByLines(regex, text); |
for (Vector<pair<int, String> >::const_iterator it = matches.begin(); it != matches.end(); ++it) |