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);