From fb265f1a57223ce697991f095414e9466125e1b0 Mon Sep 17 00:00:00 2001 From: "ashuk%eng.sun.com" Date: Tue, 12 Sep 2000 16:33:45 +0000 Subject: [PATCH] author = ashuk r = a = edburns Bug = 48356, 51326 git-svn-id: svn://10.0.0.236/trunk@78880 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/java/webclient/src_moz/CurrentPageImpl.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mozilla/java/webclient/src_moz/CurrentPageImpl.cpp b/mozilla/java/webclient/src_moz/CurrentPageImpl.cpp index 7086ff08f46..4c239a00be7 100644 --- a/mozilla/java/webclient/src_moz/CurrentPageImpl.cpp +++ b/mozilla/java/webclient/src_moz/CurrentPageImpl.cpp @@ -106,6 +106,12 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_CurrentPageImp nsCOMPtr domWindow; if (initContext->docShell != nsnull) { nsCOMPtr interfaceRequestor(do_QueryInterface(initContext->docShell)); + nsCOMPtr url; + rv = initContext->docShell->GetCurrentURI(getter_AddRefs(url)); + if (NS_FAILED(rv) || nsnull == url) { + ::util_ThrowExceptionToJava(env, "Exception: NULL URL passed to Find call"); + return; + } if (interfaceRequestor != nsnull) { rv = interfaceRequestor->GetInterface(NS_GET_IID(nsIDOMWindow), getter_AddRefs(domWindow)); @@ -200,6 +206,9 @@ JNIEXPORT void JNICALL Java_org_mozilla_webclient_wrapper_1native_CurrentPageImp return; } + // Set the forward flag as per input parameter + searchContext->SetSearchBackwards(!forward); + // Pass searchContext to findComponent for the actual find call PRBool found = PR_TRUE; findComponent->FindNext(searchContext, &found);