diff --git a/mozilla/editor/composer/src/nsEditorShell.cpp b/mozilla/editor/composer/src/nsEditorShell.cpp index a23ffd50196..ceb8d4d7c28 100644 --- a/mozilla/editor/composer/src/nsEditorShell.cpp +++ b/mozilla/editor/composer/src/nsEditorShell.cpp @@ -1603,73 +1603,6 @@ nsEditorShell::TransferDocumentStateListeners() return NS_OK; } -// this method should move into JS -NS_IMETHODIMP -nsEditorShell::CheckOpenWindowForURLMatch(const PRUnichar* inFileURL, nsIDOMWindowInternal* inCheckWindow, PRBool *aDidFind) -{ - NS_ENSURE_ARG_POINTER((inCheckWindow && aDidFind)); - - *aDidFind = PR_FALSE; - - nsresult rv; - nsAutoString fileurlstring(inFileURL); - nsCOMPtr newFileLocation; - rv = NS_NewURI(getter_AddRefs(newFileLocation), fileurlstring); - if (NS_FAILED(rv)) return rv; - - nsCOMPtr contentWindow; - inCheckWindow->GetContent(getter_AddRefs(contentWindow)); - if (!contentWindow) return NS_ERROR_NULL_POINTER; - - // get the content doc - nsCOMPtr contentDoc; - contentWindow->GetDocument(getter_AddRefs(contentDoc)); - - // use the contentDoc to get the document's URI - nsCOMPtr docURI; - rv = GetDocumentURI(contentDoc, getter_AddRefs(docURI)); - if (rv == NS_ERROR_NOT_INITIALIZED) return NS_OK; // editing about:blank so no uri yet - if (NS_FAILED(rv) || !docURI) return NS_ERROR_NULL_POINTER; - - // this does a simple string compare but isn't really checking for aliases - // or ".." in path which might actually cause this method to fail to match - // even though the same file is being edited - PRBool isSameFile; - if (NS_SUCCEEDED(docURI->Equals(newFileLocation, &isSameFile)) && isSameFile) - { - *aDidFind = PR_TRUE; - } - else - { - // do the schemes match? if not, these are not matches - // check file: protocol first - PRBool doContinueChecking = PR_TRUE; - nsCOMPtr currentProtocolFile(do_QueryInterface(docURI)); - if (currentProtocolFile) - { - nsCOMPtr newProtocolFile(do_QueryInterface(newFileLocation)); - if (!newProtocolFile) - { - *aDidFind = PR_FALSE; - doContinueChecking = PR_FALSE; - } - else if (NS_SUCCEEDED(currentProtocolFile->Equals(newProtocolFile, &isSameFile)) && isSameFile) - { - *aDidFind = PR_TRUE; - doContinueChecking = PR_FALSE; - } - } - - // check http urls... then ftp, then maybe even https... any others? - if (doContinueChecking) - { - // this is covered by bug #104908 - } - } - - return NS_OK; -} - nsresult nsEditorShell::GetDocumentURI(nsIDOMDocument *aDoc, nsIURI **aDocumentURI) { diff --git a/mozilla/editor/idl/nsIEditorShell.idl b/mozilla/editor/idl/nsIEditorShell.idl index 9d94fef1ea8..37d3cd209aa 100644 --- a/mozilla/editor/idl/nsIEditorShell.idl +++ b/mozilla/editor/idl/nsIEditorShell.idl @@ -133,9 +133,6 @@ interface nsIEditorShell : nsISupports */ void Shutdown(); - /* check a particular window's URL to see if it matches the given URL */ - boolean checkOpenWindowForURLMatch( in wstring inFileURL, in nsIDOMWindowInternal inCheckWindow); - /* Commands */ void Print();