diff --git a/mozilla/editor/base/nsEditorShell.cpp b/mozilla/editor/base/nsEditorShell.cpp index 8a1b72e9e5a..af351b80819 100644 --- a/mozilla/editor/base/nsEditorShell.cpp +++ b/mozilla/editor/base/nsEditorShell.cpp @@ -35,7 +35,6 @@ #include "nsIScriptGlobalObjectOwner.h" #include "nsIDOMDocument.h" #include "nsIMarkupDocumentViewer.h" -#include "nsIDOMXULDocument.h" #include "nsIDOMHTMLDocument.h" #include "nsIDiskDocument.h" #include "nsIDocument.h" @@ -185,18 +184,16 @@ GetChromeElement(nsIDocShell *aShell, const char *aID, nsIDOMElement **aElement) nsresult rv = GetDocument( aShell, getter_AddRefs(doc) ); if(NS_SUCCEEDED(rv) && doc) { - // Up-cast. - nsCOMPtr xulDoc( do_QueryInterface(doc) ); - if ( xulDoc ) + nsCOMPtr dDoc( do_QueryInterface(doc) ); + if ( dDoc ) { - // Find specified element. - nsCOMPtr elem; - rv = xulDoc->GetElementById( NS_ConvertASCIItoUCS2(aID), getter_AddRefs(elem) ); - if (elem) - { - *aElement = elem.get(); - NS_ADDREF(*aElement); - } + nsCOMPtr elem; + rv = dDoc->GetElementById( NS_ConvertASCIItoUCS2(aID), getter_AddRefs(elem) ); + if (elem) + { + *aElement = elem.get(); + NS_ADDREF(*aElement); + } } } return rv; @@ -476,7 +473,7 @@ nsEditorShell::PrepareDocumentForEditing(nsIDocumentLoader* aLoader, nsIURI *aUr if (!mStateMaintainer) return NS_ERROR_OUT_OF_MEMORY; mStateMaintainer->AddRef(); // the owning reference - // get the XULDoc from the webshell + // get the Doc from the webshell nsCOMPtr cv; rv = mDocShell->GetContentViewer(getter_AddRefs(cv)); if (NS_FAILED(rv)) return rv; @@ -488,11 +485,12 @@ nsEditorShell::PrepareDocumentForEditing(nsIDocumentLoader* aLoader, nsIURI *aUr rv = docViewer->GetDocument(*getter_AddRefs(chromeDoc)); if (NS_FAILED(rv)) return rv; - nsCOMPtr xulDoc = do_QueryInterface(chromeDoc, &rv); + nsCOMPtr dDoc = do_QueryInterface(chromeDoc, &rv); if (NS_FAILED(rv)) return rv; + // now init the state maintainer - rv = mStateMaintainer->Init(mEditor, xulDoc); + rv = mStateMaintainer->Init(mEditor, dDoc); if (NS_FAILED(rv)) return rv; // set it up as a selection listener @@ -608,7 +606,7 @@ nsEditorShell::PrepareDocumentForEditing(nsIDocumentLoader* aLoader, nsIURI *aUr // Activate the debug menu only in debug builds // by removing the "hidden" attribute set "true" in XUL nsCOMPtr elem; - rv = xulDoc->GetElementById(NS_ConvertASCIItoUCS2("debugMenu"), getter_AddRefs(elem)); + rv = dDoc->GetElementById(NS_ConvertASCIItoUCS2("debugMenu"), getter_AddRefs(elem)); if (elem) elem->RemoveAttribute(NS_ConvertASCIItoUCS2("hidden")); #endif @@ -1486,6 +1484,7 @@ nsEditorShell::UnregisterDocumentStateListener(nsIDocumentStateListener *docList return editor->RemoveDocumentStateListener(docListener); } + return NS_OK; } diff --git a/mozilla/editor/base/nsInterfaceState.cpp b/mozilla/editor/base/nsInterfaceState.cpp index e62e0e88d75..d8e836618ae 100644 --- a/mozilla/editor/base/nsInterfaceState.cpp +++ b/mozilla/editor/base/nsInterfaceState.cpp @@ -30,7 +30,6 @@ #include "nsIDocumentViewer.h" #include "nsIDocument.h" #include "nsIDOMDocument.h" -#include "nsIDOMXULDocument.h" #include "nsIDiskDocument.h" #include "nsIDOMElement.h" #include "nsIDOMSelection.h" @@ -101,7 +100,7 @@ NS_IMPL_RELEASE(nsInterfaceState); NS_IMPL_QUERY_INTERFACE4(nsInterfaceState, nsIDOMSelectionListener, nsIDocumentStateListener, nsITransactionListener, nsITimerCallback); NS_IMETHODIMP -nsInterfaceState::Init(nsIHTMLEditor* aEditor, nsIDOMXULDocument *aChromeDoc) +nsInterfaceState::Init(nsIHTMLEditor* aEditor, nsIDOMDocument *aChromeDoc) { if (!aEditor) return NS_ERROR_INVALID_ARG; @@ -665,7 +664,7 @@ nsInterfaceState::Notify(nsITimer *timer) #endif -nsresult NS_NewInterfaceState(nsIHTMLEditor* aEditor, nsIDOMXULDocument* aChromeDoc, nsIDOMSelectionListener** aInstancePtrResult) +nsresult NS_NewInterfaceState(nsIHTMLEditor* aEditor, nsIDOMDocument* aChromeDoc, nsIDOMSelectionListener** aInstancePtrResult) { nsInterfaceState* newThang = new nsInterfaceState; if (!newThang) diff --git a/mozilla/editor/base/nsInterfaceState.h b/mozilla/editor/base/nsInterfaceState.h index efc42688c3d..ef0ec703c49 100644 --- a/mozilla/editor/base/nsInterfaceState.h +++ b/mozilla/editor/base/nsInterfaceState.h @@ -33,7 +33,7 @@ #include "nsITimerCallback.h" class nsIHTMLEditor; -class nsIDOMXULDocument; +class nsIDOMDocument; // class responsible for communicating changes in local state back to the UI. // This is currently somewhat tied to a given XUL UI implementation @@ -50,7 +50,7 @@ public: NS_DECL_ISUPPORTS - NS_IMETHOD Init(nsIHTMLEditor* aEditor, nsIDOMXULDocument *aChromeDoc); + NS_IMETHOD Init(nsIHTMLEditor* aEditor, nsIDOMDocument *aChromeDoc); // force an update of the UI. At some point, we could pass flags // here to target certain things for updating. @@ -113,7 +113,7 @@ protected: // so would result in cirular reference chains. nsIHTMLEditor* mEditor; // the HTML editor - nsIDOMXULDocument* mChromeDoc; // XUL document for the chrome area + nsIDOMDocument* mChromeDoc; // XUL document for the chrome area nsIDOMWindow* mDOMWindow; // nsIDOMWindow used for calling UpdateCommands @@ -145,6 +145,6 @@ protected: }; -extern "C" nsresult NS_NewInterfaceState(nsIHTMLEditor* aEditor, nsIDOMXULDocument* aChromeDoc, nsIDOMSelectionListener** aInstancePtrResult); +extern "C" nsresult NS_NewInterfaceState(nsIHTMLEditor* aEditor, nsIDOMDocument* aChromeDoc, nsIDOMSelectionListener** aInstancePtrResult); #endif // nsInterfaceState_h__ diff --git a/mozilla/editor/composer/src/nsEditorShell.cpp b/mozilla/editor/composer/src/nsEditorShell.cpp index 8a1b72e9e5a..af351b80819 100644 --- a/mozilla/editor/composer/src/nsEditorShell.cpp +++ b/mozilla/editor/composer/src/nsEditorShell.cpp @@ -35,7 +35,6 @@ #include "nsIScriptGlobalObjectOwner.h" #include "nsIDOMDocument.h" #include "nsIMarkupDocumentViewer.h" -#include "nsIDOMXULDocument.h" #include "nsIDOMHTMLDocument.h" #include "nsIDiskDocument.h" #include "nsIDocument.h" @@ -185,18 +184,16 @@ GetChromeElement(nsIDocShell *aShell, const char *aID, nsIDOMElement **aElement) nsresult rv = GetDocument( aShell, getter_AddRefs(doc) ); if(NS_SUCCEEDED(rv) && doc) { - // Up-cast. - nsCOMPtr xulDoc( do_QueryInterface(doc) ); - if ( xulDoc ) + nsCOMPtr dDoc( do_QueryInterface(doc) ); + if ( dDoc ) { - // Find specified element. - nsCOMPtr elem; - rv = xulDoc->GetElementById( NS_ConvertASCIItoUCS2(aID), getter_AddRefs(elem) ); - if (elem) - { - *aElement = elem.get(); - NS_ADDREF(*aElement); - } + nsCOMPtr elem; + rv = dDoc->GetElementById( NS_ConvertASCIItoUCS2(aID), getter_AddRefs(elem) ); + if (elem) + { + *aElement = elem.get(); + NS_ADDREF(*aElement); + } } } return rv; @@ -476,7 +473,7 @@ nsEditorShell::PrepareDocumentForEditing(nsIDocumentLoader* aLoader, nsIURI *aUr if (!mStateMaintainer) return NS_ERROR_OUT_OF_MEMORY; mStateMaintainer->AddRef(); // the owning reference - // get the XULDoc from the webshell + // get the Doc from the webshell nsCOMPtr cv; rv = mDocShell->GetContentViewer(getter_AddRefs(cv)); if (NS_FAILED(rv)) return rv; @@ -488,11 +485,12 @@ nsEditorShell::PrepareDocumentForEditing(nsIDocumentLoader* aLoader, nsIURI *aUr rv = docViewer->GetDocument(*getter_AddRefs(chromeDoc)); if (NS_FAILED(rv)) return rv; - nsCOMPtr xulDoc = do_QueryInterface(chromeDoc, &rv); + nsCOMPtr dDoc = do_QueryInterface(chromeDoc, &rv); if (NS_FAILED(rv)) return rv; + // now init the state maintainer - rv = mStateMaintainer->Init(mEditor, xulDoc); + rv = mStateMaintainer->Init(mEditor, dDoc); if (NS_FAILED(rv)) return rv; // set it up as a selection listener @@ -608,7 +606,7 @@ nsEditorShell::PrepareDocumentForEditing(nsIDocumentLoader* aLoader, nsIURI *aUr // Activate the debug menu only in debug builds // by removing the "hidden" attribute set "true" in XUL nsCOMPtr elem; - rv = xulDoc->GetElementById(NS_ConvertASCIItoUCS2("debugMenu"), getter_AddRefs(elem)); + rv = dDoc->GetElementById(NS_ConvertASCIItoUCS2("debugMenu"), getter_AddRefs(elem)); if (elem) elem->RemoveAttribute(NS_ConvertASCIItoUCS2("hidden")); #endif @@ -1486,6 +1484,7 @@ nsEditorShell::UnregisterDocumentStateListener(nsIDocumentStateListener *docList return editor->RemoveDocumentStateListener(docListener); } + return NS_OK; } diff --git a/mozilla/editor/composer/src/nsInterfaceState.cpp b/mozilla/editor/composer/src/nsInterfaceState.cpp index e62e0e88d75..d8e836618ae 100644 --- a/mozilla/editor/composer/src/nsInterfaceState.cpp +++ b/mozilla/editor/composer/src/nsInterfaceState.cpp @@ -30,7 +30,6 @@ #include "nsIDocumentViewer.h" #include "nsIDocument.h" #include "nsIDOMDocument.h" -#include "nsIDOMXULDocument.h" #include "nsIDiskDocument.h" #include "nsIDOMElement.h" #include "nsIDOMSelection.h" @@ -101,7 +100,7 @@ NS_IMPL_RELEASE(nsInterfaceState); NS_IMPL_QUERY_INTERFACE4(nsInterfaceState, nsIDOMSelectionListener, nsIDocumentStateListener, nsITransactionListener, nsITimerCallback); NS_IMETHODIMP -nsInterfaceState::Init(nsIHTMLEditor* aEditor, nsIDOMXULDocument *aChromeDoc) +nsInterfaceState::Init(nsIHTMLEditor* aEditor, nsIDOMDocument *aChromeDoc) { if (!aEditor) return NS_ERROR_INVALID_ARG; @@ -665,7 +664,7 @@ nsInterfaceState::Notify(nsITimer *timer) #endif -nsresult NS_NewInterfaceState(nsIHTMLEditor* aEditor, nsIDOMXULDocument* aChromeDoc, nsIDOMSelectionListener** aInstancePtrResult) +nsresult NS_NewInterfaceState(nsIHTMLEditor* aEditor, nsIDOMDocument* aChromeDoc, nsIDOMSelectionListener** aInstancePtrResult) { nsInterfaceState* newThang = new nsInterfaceState; if (!newThang) diff --git a/mozilla/editor/composer/src/nsInterfaceState.h b/mozilla/editor/composer/src/nsInterfaceState.h index efc42688c3d..ef0ec703c49 100644 --- a/mozilla/editor/composer/src/nsInterfaceState.h +++ b/mozilla/editor/composer/src/nsInterfaceState.h @@ -33,7 +33,7 @@ #include "nsITimerCallback.h" class nsIHTMLEditor; -class nsIDOMXULDocument; +class nsIDOMDocument; // class responsible for communicating changes in local state back to the UI. // This is currently somewhat tied to a given XUL UI implementation @@ -50,7 +50,7 @@ public: NS_DECL_ISUPPORTS - NS_IMETHOD Init(nsIHTMLEditor* aEditor, nsIDOMXULDocument *aChromeDoc); + NS_IMETHOD Init(nsIHTMLEditor* aEditor, nsIDOMDocument *aChromeDoc); // force an update of the UI. At some point, we could pass flags // here to target certain things for updating. @@ -113,7 +113,7 @@ protected: // so would result in cirular reference chains. nsIHTMLEditor* mEditor; // the HTML editor - nsIDOMXULDocument* mChromeDoc; // XUL document for the chrome area + nsIDOMDocument* mChromeDoc; // XUL document for the chrome area nsIDOMWindow* mDOMWindow; // nsIDOMWindow used for calling UpdateCommands @@ -145,6 +145,6 @@ protected: }; -extern "C" nsresult NS_NewInterfaceState(nsIHTMLEditor* aEditor, nsIDOMXULDocument* aChromeDoc, nsIDOMSelectionListener** aInstancePtrResult); +extern "C" nsresult NS_NewInterfaceState(nsIHTMLEditor* aEditor, nsIDOMDocument* aChromeDoc, nsIDOMSelectionListener** aInstancePtrResult); #endif // nsInterfaceState_h__