From 71b468b05580953e70aabce5b68586ed8967c71c Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Wed, 7 Dec 2005 18:15:33 +0000 Subject: Minor code cleanup. 2005-12-07 Christian Persch * embed/mozilla/EphyFind.cpp: Minor code cleanup. * src/ephy-find-toolbar.c: (entry_key_press_event_cb), (ephy_find_toolbar_close): Also check for GDK_ISO_Enter. * src/ephy-window.c: (sync_tab_address): Close the find toolbar when loading a new page. --- embed/mozilla/EphyFind.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'embed') diff --git a/embed/mozilla/EphyFind.cpp b/embed/mozilla/EphyFind.cpp index 1eab78c34..c1625cc8c 100644 --- a/embed/mozilla/EphyFind.cpp +++ b/embed/mozilla/EphyFind.cpp @@ -160,7 +160,7 @@ void EphyFind::SetSelectionAttention (PRBool aAttention) { #ifdef HAVE_TYPEAHEADFIND - if (aAttention && mAttention) return; + if (aAttention == mAttention) return; mAttention = aAttention; @@ -187,12 +187,10 @@ EphyFind::SetSelectionAttention (PRBool aAttention) PRBool hasMore = PR_FALSE; while (NS_SUCCEEDED (enumerator->HasMoreElements (&hasMore)) && hasMore) { nsCOMPtr element; - nsCOMPtr sd; - enumerator->GetNext (getter_AddRefs (element)); if (!element) continue; - sd = do_GetInterface (element); + nsCOMPtr sd (do_GetInterface (element)); if (!sd) continue; nsCOMPtr controller (do_QueryInterface (sd)); @@ -270,7 +268,7 @@ EphyFind::ActivateLink (GdkModifierType aMask) nsCOMPtr link; #if defined(HAVE_TYPEAHEADFIND) && defined(HAVE_GECKO_1_8) rv = mFinder->GetFoundLink (getter_AddRefs (link)); - NS_ENSURE_TRUE (NS_SUCCEEDED (rv) && link, FALSE); + if (NS_FAILED (rv) || !link) return FALSE; #else nsCOMPtr focus (do_QueryInterface (mWebBrowser)); NS_ENSURE_TRUE (focus, FALSE); @@ -279,6 +277,7 @@ EphyFind::ActivateLink (GdkModifierType aMask) NS_ENSURE_TRUE (NS_SUCCEEDED (rv) && link, FALSE); /* ensure this is really a link so we don't accidentally submit if we're on a button or so! */ + /* FIXME: does that work with xlink links? */ nsCOMPtr anchor (do_QueryInterface (link)); if (!anchor) return FALSE; #endif /* HAVE_TYPEAHEADFIND && HAVE_GECKO_1_8 */ @@ -311,6 +310,7 @@ EphyFind::ActivateLink (GdkModifierType aMask) (aMask & GDK_CONTROL_MASK) != 0, (aMask & GDK_MOD1_MASK) != 0 /* Alt */, (aMask & GDK_SHIFT_MASK) != 0, + /* FIXME when we upgrade to gtk 2.10 */ PR_FALSE /* Meta */, nsIDOMKeyEvent::DOM_VK_RETURN, 0); -- cgit v1.2.3