From ae778efe5e16d688d3fea5411bd896f167986161 Mon Sep 17 00:00:00 2001 From: wolfbeast Date: Wed, 29 May 2019 11:25:58 +0200 Subject: Make nsFind::Find actually use a string type as input. Futureproofing follow-up to b89570e31cfb84449241e363a595540b8810c217 --- embedding/components/find/nsFind.cpp | 6 +----- embedding/components/find/nsIFind.idl | 2 +- embedding/components/find/nsWebBrowserFind.cpp | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) (limited to 'embedding/components') diff --git a/embedding/components/find/nsFind.cpp b/embedding/components/find/nsFind.cpp index 6987c11d3..63304dafb 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 2c9b17703..ce02c9b7d 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 af44ce59b..aadc66f8e 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) { -- cgit v1.2.3