mirror of
https://github.com/roytam1/mozilla45esr.git
synced 2026-05-26 06:25:03 +00:00
reverted nsFind changes as it caused crash.
This commit is contained in:
@@ -853,7 +853,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 nsAString& aPatText, nsIDOMRange* aSearchRange,
|
||||
nsFind::Find(const char16_t* aPatText, nsIDOMRange* aSearchRange,
|
||||
nsIDOMRange* aStartPoint, nsIDOMRange* aEndPoint,
|
||||
nsIDOMRange** aRangeRet)
|
||||
{
|
||||
@@ -870,6 +870,10 @@ nsFind::Find(const nsAString& aPatText, nsIDOMRange* aSearchRange,
|
||||
NS_ENSURE_ARG_POINTER(aRangeRet);
|
||||
*aRangeRet = 0;
|
||||
|
||||
if (!aPatText) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
ResetAll();
|
||||
|
||||
nsAutoString patAutoStr(aPatText);
|
||||
|
||||
@@ -34,6 +34,6 @@ interface nsIFind : nsISupports
|
||||
* end (forward) or start (backward).
|
||||
* @retval A range spanning the match that was found (or null).
|
||||
*/
|
||||
nsIDOMRange Find(in AString aPatText, in nsIDOMRange aSearchRange,
|
||||
nsIDOMRange Find(in wstring aPatText, in nsIDOMRange aSearchRange,
|
||||
in nsIDOMRange aStartPoint, in nsIDOMRange aEndPoint);
|
||||
};
|
||||
|
||||
@@ -756,7 +756,7 @@ nsWebBrowserFind::SearchInFrame(nsIDOMWindow* aWindow, bool aWrapping,
|
||||
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = find->Find(mSearchString, searchRange, startPt, endPt,
|
||||
rv = find->Find(mSearchString.get(), searchRange, startPt, endPt,
|
||||
getter_AddRefs(foundRange));
|
||||
|
||||
if (NS_SUCCEEDED(rv) && foundRange) {
|
||||
|
||||
@@ -396,7 +396,7 @@ nsTypeAheadFind::FindItNow(nsIPresShell *aPresShell, bool aIsLinksOnly,
|
||||
|
||||
while (true) { // ----- Outer while loop: go through all docs -----
|
||||
while (true) { // === Inner while loop: go through a single doc ===
|
||||
mFind->Find(mTypeAheadBuffer, mSearchRange, mStartPointRange,
|
||||
mFind->Find(mTypeAheadBuffer.get(), mSearchRange, mStartPointRange,
|
||||
mEndPointRange, getter_AddRefs(returnRange));
|
||||
|
||||
if (!returnRange)
|
||||
|
||||
Reference in New Issue
Block a user