Fixing bug 377449. Remove unnecessary arguments from LaunchTooltip(). r+sr=neil@parkwaycc.co.uk
authorjst@mozilla.org
Mon, 16 Apr 2007 16:22:34 -0700
changeset 570 bf4ee8616ab8620d17d90c87eadbab782fd445b3
parent 569 a1893600f2ff1a1a1bafe61c05890c0fee8ac87e
child 571 01b0198b645643c397d22b056590956c3e732b5a
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs377449
milestone1.9a4pre
Fixing bug 377449. Remove unnecessary arguments from LaunchTooltip(). r+sr=neil@parkwaycc.co.uk
layout/xul/base/src/nsXULTooltipListener.cpp
layout/xul/base/src/nsXULTooltipListener.h
--- a/layout/xul/base/src/nsXULTooltipListener.cpp
+++ b/layout/xul/base/src/nsXULTooltipListener.cpp
@@ -387,17 +387,17 @@ nsXULTooltipListener::ShowTooltip()
 #ifdef MOZ_XUL
       if (!mIsSourceTree) {
         mLastTreeRow = -1;
         mLastTreeCol = nsnull;
       }
 #endif
 
       xulDoc->SetTooltipNode(mTargetNode);
-      LaunchTooltip(mSourceNode, mMouseClientX, mMouseClientY);
+      LaunchTooltip();
       mTargetNode = nsnull;
 
       // at this point, |mCurrentTooltip| holds the content node of
       // the tooltip. If there is an attribute on the popup telling us
       // not to create the auto-hide timer, don't.
       nsCOMPtr<nsIDOMElement> tooltipEl(do_QueryInterface(mCurrentTooltip));
       if (!tooltipEl)
         return NS_ERROR_FAILURE;
@@ -462,57 +462,57 @@ SetTitletipLabel(nsITreeBoxObject* aTree
 
   nsAutoString label;
   view->GetCellText(aRow, aCol, label);
   
   aTooltip->SetAttr(nsnull, nsGkAtoms::label, label, PR_TRUE);
 }
 #endif
 
-nsresult
-nsXULTooltipListener::LaunchTooltip(nsIContent* aTarget, PRInt32 aX, PRInt32 aY)
+void
+nsXULTooltipListener::LaunchTooltip()
 {
   if (!mCurrentTooltip)
-    return NS_OK;
+    return;
 
   nsCOMPtr<nsIBoxObject> popupBox;
   nsCOMPtr<nsIDOMXULElement> xulTooltipEl(do_QueryInterface(mCurrentTooltip));
   if (!xulTooltipEl) {
     NS_ERROR("tooltip isn't a XUL element!");
-    return NS_ERROR_FAILURE;
+    return;
   }
 
   xulTooltipEl->GetBoxObject(getter_AddRefs(popupBox));
   nsCOMPtr<nsIPopupBoxObject> popupBoxObject(do_QueryInterface(popupBox));
   if (popupBoxObject) {
-    PRInt32 x = aX;
-    PRInt32 y = aY;
+    PRInt32 x = mMouseClientX;
+    PRInt32 y = mMouseClientY;
 #ifdef MOZ_XUL
     if (mIsSourceTree && mNeedTitletip) {
       nsCOMPtr<nsITreeBoxObject> obx;
       GetSourceTreeBoxObject(getter_AddRefs(obx));
 #ifdef DEBUG_crap
       GetTreeCellCoords(obx, mSourceNode,
                         mLastTreeRow, mLastTreeCol, &x, &y);
 #endif
 
       SetTitletipLabel(obx, mCurrentTooltip, mLastTreeRow, mLastTreeCol);
       mCurrentTooltip->SetAttr(nsnull, nsGkAtoms::titletip, NS_LITERAL_STRING("true"), PR_TRUE);
     } else
       mCurrentTooltip->UnsetAttr(nsnull, nsGkAtoms::titletip, PR_TRUE);
 #endif
 
-    nsCOMPtr<nsIDOMElement> targetEl(do_QueryInterface(aTarget));
+    nsCOMPtr<nsIDOMElement> targetEl(do_QueryInterface(mSourceNode));
     popupBoxObject->ShowPopup(targetEl, xulTooltipEl, x, y,
                               NS_LITERAL_STRING("tooltip").get(),
                               NS_LITERAL_STRING("none").get(),
                               NS_LITERAL_STRING("topleft").get());
   }
 
-  return NS_OK;
+  return;
 }
 
 nsresult
 nsXULTooltipListener::HideTooltip()
 {
   if (mCurrentTooltip) {
     // hide the popup through its box object
     nsCOMPtr<nsIDOMXULElement> tooltipEl(do_QueryInterface(mCurrentTooltip));
--- a/layout/xul/base/src/nsXULTooltipListener.h
+++ b/layout/xul/base/src/nsXULTooltipListener.h
@@ -116,17 +116,17 @@ protected:
   void CreateAutoHideTimer();
 
 #ifdef MOZ_XUL
   void CheckTreeBodyMove(nsIDOMMouseEvent* aMouseEvent);
   nsresult GetSourceTreeBoxObject(nsITreeBoxObject** aBoxObject);
 #endif
 
   nsresult ShowTooltip();
-  nsresult LaunchTooltip(nsIContent* aTarget, PRInt32 aX, PRInt32 aY);
+  void LaunchTooltip();
   nsresult HideTooltip();
   nsresult DestroyTooltip();
   // This method tries to find a tooltip for aTarget.
   nsresult FindTooltip(nsIContent* aTarget, nsIContent** aTooltip);
   // This method calls FindTooltip and checks that the tooltip
   // can be really used (i.e. tooltip is not a menu).
   nsresult GetTooltipFor(nsIContent* aTarget, nsIContent** aTooltip);