From 58156c942843f9e5981d209ee6fc287eca231179 Mon Sep 17 00:00:00 2001 From: "ramiro%netscape.com" Date: Fri, 26 Mar 1999 11:34:21 +0000 Subject: [PATCH] Fix indiscriminate debug comment spewage. --- content/xul/document/src/nsXULDocument.cpp | 4 +-- rdf/content/src/nsXULDocument.cpp | 4 +-- xpfe/appshell/src/nsWebShellWindow.cpp | 39 ++++++++++++++++++---- 3 files changed, 37 insertions(+), 10 deletions(-) diff --git a/content/xul/document/src/nsXULDocument.cpp b/content/xul/document/src/nsXULDocument.cpp index 3f42996faa3..9e89eaacc8a 100644 --- a/content/xul/document/src/nsXULDocument.cpp +++ b/content/xul/document/src/nsXULDocument.cpp @@ -1946,7 +1946,7 @@ XULDocumentImpl::AddElementForResource(nsIRDFResource* aResource, nsIContent* aE if (! aElement) return NS_ERROR_NULL_POINTER; -#ifdef DEBUG +#ifdef DEBUG_waterson const char* uri; aResource->GetValue(&uri); printf("add [%p] <-- %s\n", aElement, uri); @@ -1968,7 +1968,7 @@ XULDocumentImpl::RemoveElementForResource(nsIRDFResource* aResource, nsIContent* if (! aElement) return NS_ERROR_NULL_POINTER; -#ifdef DEBUG +#ifdef DEBUG_waterson const char* uri; aResource->GetValue(&uri); printf("remove [%p] <-- %s\n", aElement, uri); diff --git a/rdf/content/src/nsXULDocument.cpp b/rdf/content/src/nsXULDocument.cpp index 3f42996faa3..9e89eaacc8a 100644 --- a/rdf/content/src/nsXULDocument.cpp +++ b/rdf/content/src/nsXULDocument.cpp @@ -1946,7 +1946,7 @@ XULDocumentImpl::AddElementForResource(nsIRDFResource* aResource, nsIContent* aE if (! aElement) return NS_ERROR_NULL_POINTER; -#ifdef DEBUG +#ifdef DEBUG_waterson const char* uri; aResource->GetValue(&uri); printf("add [%p] <-- %s\n", aElement, uri); @@ -1968,7 +1968,7 @@ XULDocumentImpl::RemoveElementForResource(nsIRDFResource* aResource, nsIContent* if (! aElement) return NS_ERROR_NULL_POINTER; -#ifdef DEBUG +#ifdef DEBUG_waterson const char* uri; aResource->GetValue(&uri); printf("remove [%p] <-- %s\n", aElement, uri); diff --git a/xpfe/appshell/src/nsWebShellWindow.cpp b/xpfe/appshell/src/nsWebShellWindow.cpp index 2dce7ce7c81..fbdc8a36e43 100644 --- a/xpfe/appshell/src/nsWebShellWindow.cpp +++ b/xpfe/appshell/src/nsWebShellWindow.cpp @@ -109,7 +109,9 @@ static NS_DEFINE_IID(kIXULCommandIID, NS_IXULCOMMAND_IID); static NS_DEFINE_IID(kIContentIID, NS_ICONTENT_IID); static NS_DEFINE_IID(kIEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID); +#ifdef DEBUG_rods #define DEBUG_MENUSDEL 1 +#endif #include "nsIWebShell.h" @@ -417,7 +419,11 @@ nsCOMPtr nsWebShellWindow::FindNamedParentFromDoc(nsIDOMDocument * a while (node) { nsString name; node->GetNodeName(name); + +#ifdef DEBUG_rods printf("Looking for [%s] [%s]\n", aName.ToNewCString(), name.ToNewCString()); // this leaks +#endif + if (name.Equals(aName)) return node; nsCOMPtr oldNode(node); @@ -523,12 +529,21 @@ NS_IMETHODIMP nsWebShellWindow::LoadMenuItem( if (NS_OK == menuDelegate->QueryInterface(kIXULCommandIID, (void**) &icmd)) { mMenuDelegates.AppendElement(icmd); nsCOMPtr listener(do_QueryInterface(menuDelegate)); - if (listener) { + + if (listener) + { pnsMenuItem->AddMenuListener(listener); - if (DEBUG_MENUSDEL) printf("Adding menu listener to [%s]\n", menuitemName.ToNewCString()); - } else { - if (DEBUG_MENUSDEL) printf("*** NOT Adding menu listener to [%s]\n", menuitemName.ToNewCString()); + +#ifdef DEBUG_MENUSDEL + printf("Adding menu listener to [%s]\n", menuitemName.ToNewCString()); +#endif + } +#ifdef DEBUG_MENUSDEL + else + { + printf("*** NOT Adding menu listener to [%s]\n", menuitemName.ToNewCString()); } +#endif } } return NS_OK; @@ -571,7 +586,11 @@ void nsWebShellWindow::LoadSubMenu( if (menuitemElement) { nsString menuitemNodeType; menuitemElement->GetNodeName(menuitemNodeType); + +#ifdef DEBUG_saari printf("Type [%s] %d\n", menuitemNodeType.ToNewCString(), menuitemNodeType.Equals("separator")); +#endif + if (menuitemNodeType.Equals("menuitem")) { // Load a menuitem LoadMenuItem(pnsMenu, menuitemElement, menuitemNode); @@ -624,7 +643,10 @@ void nsWebShellWindow::LoadMenus(nsIDOMDocument * aDOMDoc, nsIWidget * aParentWi menuElement->GetNodeName(menuNodeType); if (menuNodeType.Equals("menu")) { menuElement->GetAttribute(nsAutoString("name"), menuName); + +#ifdef DEBUG_rods printf("Creating Menu [%s] \n", menuName.ToNewCString()); // this leaks +#endif CreateMenu(pnsMenuBar, menuNode, menuName); } @@ -906,7 +928,9 @@ PRInt32 nsWebShellWindow::GetDocHeight(nsIDocument * aDoc) //---------------------------------------- NS_IMETHODIMP nsWebShellWindow::OnConnectionsComplete() { - if (DEBUG_MENUSDEL) printf("OnConnectionsComplete\n"); +#ifdef DEBUG_MENUSDEL + printf("OnConnectionsComplete\n"); +#endif // register as document listener // this is needed for menus @@ -1029,7 +1053,10 @@ void nsWebShellWindow::ExecuteJavaScriptString(nsString& aJavaScript) PRBool isUndefined = PR_FALSE; nsString rVal("xxx"); scriptContext->EvaluateString(aJavaScript, url, 0, rVal, &isUndefined); - if (DEBUG_MENUSDEL) printf("EvaluateString - %d [%s]\n", isUndefined, rVal.ToNewCString()); + +#ifdef DEBUG_MENUSDEL + printf("EvaluateString - %d [%s]\n", isUndefined, rVal.ToNewCString()); +#endif } }