summaryrefslogtreecommitdiff
path: root/embedding
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-05-29 11:25:58 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-05-29 11:25:58 +0200
commitd873bd96953a6c8de8a9355e330400e0799db661 (patch)
treea90c8c90e9e6a495038fa1c4242b9855f7843ef8 /embedding
parent50062bdfc004c8e24e3344ffe6991894ee0e6d09 (diff)
downloaduxp-d873bd96953a6c8de8a9355e330400e0799db661.tar.gz
Make nsFind::Find actually use a string type as input.
Futureproofing follow-up to b89570e31cfb84449241e363a595540b8810c217
Diffstat (limited to 'embedding')
-rw-r--r--embedding/components/find/nsFind.cpp6
-rw-r--r--embedding/components/find/nsIFind.idl2
-rw-r--r--embedding/components/find/nsWebBrowserFind.cpp2
-rw-r--r--embedding/test/test_nsFind.html14
4 files changed, 3 insertions, 21 deletions
diff --git a/embedding/components/find/nsFind.cpp b/embedding/components/find/nsFind.cpp
index 6987c11d31..63304dafb9 100644
--- a/embedding/components/find/nsFind.cpp
+++ b/embedding/components/find/nsFind.cpp
@@ -932,7 +932,7 @@ nsFind::ResetAll()
// Take nodes out of the tree with NextNode, until null (NextNode will return 0
// at the end of our range).
NS_IMETHODIMP
-nsFind::Find(const char16_t* aPatText, nsIDOMRange* aSearchRange,
+nsFind::Find(const nsAString& aPatText, nsIDOMRange* aSearchRange,
nsIDOMRange* aStartPoint, nsIDOMRange* aEndPoint,
nsIDOMRange** aRangeRet)
{
@@ -949,10 +949,6 @@ nsFind::Find(const char16_t* aPatText, nsIDOMRange* aSearchRange,
NS_ENSURE_ARG_POINTER(aRangeRet);
*aRangeRet = 0;
- if (!aPatText) {
- return NS_ERROR_NULL_POINTER;
- }
-
ResetAll();
nsAutoString patAutoStr(aPatText);
diff --git a/embedding/components/find/nsIFind.idl b/embedding/components/find/nsIFind.idl
index 2c9b177035..ce02c9b7de 100644
--- a/embedding/components/find/nsIFind.idl
+++ b/embedding/components/find/nsIFind.idl
@@ -29,6 +29,6 @@ interface nsIFind : nsISupports
* end (forward) or start (backward).
* @retval A range spanning the match that was found (or null).
*/
- nsIDOMRange Find(in wstring aPatText, in nsIDOMRange aSearchRange,
+ nsIDOMRange Find(in AString aPatText, in nsIDOMRange aSearchRange,
in nsIDOMRange aStartPoint, in nsIDOMRange aEndPoint);
};
diff --git a/embedding/components/find/nsWebBrowserFind.cpp b/embedding/components/find/nsWebBrowserFind.cpp
index af44ce59bc..aadc66f8eb 100644
--- a/embedding/components/find/nsWebBrowserFind.cpp
+++ b/embedding/components/find/nsWebBrowserFind.cpp
@@ -751,7 +751,7 @@ nsWebBrowserFind::SearchInFrame(nsPIDOMWindowOuter* aWindow, bool aWrapping,
NS_ENSURE_SUCCESS(rv, rv);
- rv = find->Find(mSearchString.get(), searchRange, startPt, endPt,
+ rv = find->Find(mSearchString, searchRange, startPt, endPt,
getter_AddRefs(foundRange));
if (NS_SUCCEEDED(rv) && foundRange) {
diff --git a/embedding/test/test_nsFind.html b/embedding/test/test_nsFind.html
index 5f5a4687ac..f180cda20f 100644
--- a/embedding/test/test_nsFind.html
+++ b/embedding/test/test_nsFind.html
@@ -33,20 +33,6 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=450048
var startPt = searchRange;
var endPt = searchRange;
- // Check |null| detection on |aPatText| parameter.
- try {
- rf.Find(null, searchRange, startPt, endPt);
-
- ok(false, "Missing NS_ERROR_NULL_POINTER exception");
- } catch (e) {
- e = SpecialPowers.wrap(e);
- if (e.result == SpecialPowers.Cr.NS_ERROR_NULL_POINTER) {
- ok(true, null);
- } else {
- throw e;
- }
- }
-
// Check |null| detection on |aSearchRange| parameter.
try {
rf.Find("", null, startPt, endPt);