some changes from a nother patch was accidently checked in
git-svn-id: svn://10.0.0.236/trunk@131424 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
f94983c561
commit
fd580a6eb2
@ -414,14 +414,6 @@ NS_IMETHODIMP nsDocShell::GetInterface(const nsIID & aIID, void **aSink)
|
||||
NS_ADDREF((nsISupports*)*aSink);
|
||||
return NS_OK;
|
||||
}
|
||||
else if (aIID.Equals(NS_GET_IID(nsIWebBrowserSpellCheck))) {
|
||||
nsresult rv = EnsureSpellCheck();
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
*aSink = mSpellCheck;
|
||||
NS_ADDREF((nsISupports*)*aSink);
|
||||
return NS_OK;
|
||||
}
|
||||
else if (aIID.Equals(NS_GET_IID(nsIEditingSession)) && NS_SUCCEEDED(EnsureEditorData())) {
|
||||
nsCOMPtr<nsIEditingSession> editingSession;
|
||||
mEditorData->GetEditingSession(getter_AddRefs(editingSession));
|
||||
@ -6614,50 +6606,6 @@ NS_IMETHODIMP nsDocShell::EnsureFind()
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsDocShell::EnsureSpellCheck()
|
||||
{
|
||||
nsresult rv;
|
||||
if (!mSpellCheck)
|
||||
{
|
||||
mSpellCheck = do_CreateInstance("@mozilla.org/embedcomp/spellcheck;1", &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
}
|
||||
|
||||
// we promise that the nsIWebBrowserFind that we return has been set
|
||||
// up to point to the focussed, or content window, so we have to
|
||||
// set that up each time.
|
||||
nsCOMPtr<nsIScriptGlobalObject> scriptGO;
|
||||
rv = GetScriptGlobalObject(getter_AddRefs(scriptGO));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
// default to our window
|
||||
nsCOMPtr<nsIDOMWindow> rootWindow = do_QueryInterface(scriptGO);
|
||||
nsCOMPtr<nsIDOMWindow> windowToSearch = rootWindow;
|
||||
|
||||
// if we can, search the focussed window
|
||||
nsCOMPtr<nsPIDOMWindow> ourWindow = do_QueryInterface(scriptGO);
|
||||
nsCOMPtr<nsIFocusController> focusController;
|
||||
if (ourWindow)
|
||||
ourWindow->GetRootFocusController(getter_AddRefs(focusController));
|
||||
if (focusController)
|
||||
{
|
||||
nsCOMPtr<nsIDOMWindowInternal> focussedWindow;
|
||||
focusController->GetFocusedWindow(getter_AddRefs(focussedWindow));
|
||||
if (focussedWindow)
|
||||
windowToSearch = focussedWindow;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIWebBrowserSpellCheckInFrames> spellCheckInFrames = do_QueryInterface(mSpellCheck);
|
||||
if (!spellCheckInFrames) return NS_ERROR_NO_INTERFACE;
|
||||
|
||||
rv = spellCheckInFrames->SetRootSearchFrame(rootWindow);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = spellCheckInFrames->SetCurrentSearchFrame(windowToSearch);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsDocShell::IsFrame()
|
||||
{
|
||||
|
||||
@ -78,7 +78,6 @@
|
||||
#include "nsIDocShellHistory.h"
|
||||
#include "nsIURIFixup.h"
|
||||
#include "nsIWebBrowserFind.h"
|
||||
#include "nsIWebBrowserSpellCheck.h"
|
||||
#include "nsIHttpChannel.h"
|
||||
|
||||
|
||||
@ -248,7 +247,6 @@ protected:
|
||||
NS_IMETHOD EnsureScriptEnvironment();
|
||||
NS_IMETHOD EnsureEditorData();
|
||||
NS_IMETHOD EnsureFind();
|
||||
NS_IMETHOD EnsureSpellCheck();
|
||||
NS_IMETHOD RefreshURIFromQueue();
|
||||
NS_IMETHOD DisplayLoadError(nsresult aError, nsIURI *aURI, const PRUnichar *aURL);
|
||||
NS_IMETHOD LoadErrorPage(nsIURI *aURI, const PRUnichar *aURL, const PRUnichar *aPage, const PRUnichar *aDescription);
|
||||
@ -304,7 +302,6 @@ protected:
|
||||
nsCOMPtr<nsISupports> mLoadCookie; // the load cookie associated with the window context.
|
||||
nsCOMPtr<nsIURIFixup> mURIFixup;
|
||||
nsCOMPtr<nsIWebBrowserFind> mFind;
|
||||
nsCOMPtr<nsIWebBrowserSpellCheck> mSpellCheck;
|
||||
PRInt32 mMarginWidth;
|
||||
PRInt32 mMarginHeight;
|
||||
PRInt32 mItemType;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user