Add additional debugging code for bug 563980.
authorL. David Baron <dbaron@dbaron.org>
Wed, 05 May 2010 15:02:31 -0700
changeset 41942 4498b6800a4950e1c96ff7060c8ee8f0c79c19b9
parent 41941 a84e93e5fada5bcdab4b085a1fd08ddb294601c3
child 41943 cb85b40582bceed47385bab3a4906a850be27395
push idunknown
push userunknown
push dateunknown
bugs563980
milestone1.9.3a5pre
Add additional debugging code for bug 563980.
editor/libeditor/html/nsHTMLAbsPosition.cpp
editor/libeditor/html/nsHTMLInlineTableEditor.cpp
editor/libeditor/html/nsHTMLObjectResizer.cpp
--- a/editor/libeditor/html/nsHTMLAbsPosition.cpp
+++ b/editor/libeditor/html/nsHTMLAbsPosition.cpp
@@ -308,24 +308,30 @@ nsHTMLEditor::HideGrabber()
     mAbsolutelyPositionedObject->RemoveAttribute(NS_LITERAL_STRING("_moz_abspos"));
   if (NS_FAILED(res)) return res;
 
   mAbsolutelyPositionedObject = nsnull;
   NS_ENSURE_TRUE(mGrabber, NS_ERROR_NULL_POINTER);
 
   // get the presshell's document observer interface.
   nsCOMPtr<nsIPresShell> ps = do_QueryReferent(mPresShellWeak);
-  if (!ps) return NS_ERROR_NOT_INITIALIZED;
+  if (!ps) {
+    NS_WARNING("no pres shell; can't remove grabber");
+    return NS_ERROR_NOT_INITIALIZED;
+  }
 
   nsCOMPtr<nsIDOMNode> parentNode;
   res = mGrabber->GetParentNode(getter_AddRefs(parentNode));
   NS_ENSURE_SUCCESS(res, res);
 
   nsCOMPtr<nsIContent> parentContent = do_QueryInterface(parentNode);
-  if (!parentContent) return NS_ERROR_NULL_POINTER;
+  if (!parentContent) {
+    NS_WARNING("no parent content; can't remove grabber");
+    return NS_ERROR_NULL_POINTER;
+  }
 
   DeleteRefToAnonymousNode(mGrabber, parentContent, ps);
   mGrabber = nsnull;
   DeleteRefToAnonymousNode(mPositioningShadow, parentContent, ps);
   mPositioningShadow = nsnull;
 
   return NS_OK;
 }
--- a/editor/libeditor/html/nsHTMLInlineTableEditor.cpp
+++ b/editor/libeditor/html/nsHTMLInlineTableEditor.cpp
@@ -120,24 +120,30 @@ nsHTMLEditor::HideInlineTableEditingUI()
   RemoveMouseClickListener(mRemoveColumnButton);
   RemoveMouseClickListener(mAddColumnAfterButton);
   RemoveMouseClickListener(mAddRowBeforeButton);
   RemoveMouseClickListener(mRemoveRowButton);
   RemoveMouseClickListener(mAddRowAfterButton);
 
   // get the presshell's document observer interface.
   nsCOMPtr<nsIPresShell> ps = do_QueryReferent(mPresShellWeak);
-  if (!ps) return NS_ERROR_NOT_INITIALIZED;
+  if (!ps) {
+    NS_WARNING("no pres shell; can't remove inline table editing");
+    return NS_ERROR_NOT_INITIALIZED;
+  }
 
   // get the root content node.
 
   nsIDOMElement *bodyElement = GetRoot();
 
   nsCOMPtr<nsIContent> bodyContent( do_QueryInterface(bodyElement) );
-  if (!bodyContent) return NS_ERROR_FAILURE;
+  if (!bodyContent) {
+    NS_WARNING("no body; can't remove inline table editing");
+    return NS_ERROR_FAILURE;
+  }
 
   DeleteRefToAnonymousNode(mAddColumnBeforeButton, bodyContent, ps);
   mAddColumnBeforeButton = nsnull;
   DeleteRefToAnonymousNode(mRemoveColumnButton, bodyContent, ps);
   mRemoveColumnButton = nsnull;
   DeleteRefToAnonymousNode(mAddColumnAfterButton, bodyContent, ps);
   mAddColumnAfterButton = nsnull;
   DeleteRefToAnonymousNode(mAddRowBeforeButton, bodyContent, ps);
--- a/editor/libeditor/html/nsHTMLObjectResizer.cpp
+++ b/editor/libeditor/html/nsHTMLObjectResizer.cpp
@@ -434,17 +434,20 @@ nsHTMLEditor::ShowResizersInner(nsIDOMEl
 NS_IMETHODIMP 
 nsHTMLEditor::HideResizers(void)
 {
   if (!mResizedObject)
     return NS_OK;
 
   // get the presshell's document observer interface.
   nsCOMPtr<nsIPresShell> ps = do_QueryReferent(mPresShellWeak);
-  if (!ps) return NS_ERROR_NOT_INITIALIZED;
+  if (!ps) {
+    NS_WARNING("no pres shell; can't remove resizers");
+    return NS_ERROR_NOT_INITIALIZED;
+  }
 
   nsresult res;
   nsCOMPtr<nsIDOMNode> parentNode;
   nsCOMPtr<nsIContent> parentContent;
 
   if (mTopLeftHandle) {
     res = mTopLeftHandle->GetParentNode(getter_AddRefs(parentNode));
     NS_ENSURE_SUCCESS(res, res);