diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-08-08 19:54:11 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-08-08 19:54:11 +0800 |
commit | d0bf32aad9e7f27f50ffc45abe0e1e0cb0a433ad (patch) | |
tree | 7ad675294866c78ab859941928b876c421c185d3 /embed/mozilla | |
parent | 1bb4b10ce6a3e857b14e0637e17203960dcc9543 (diff) | |
download | gsoc2013-epiphany-d0bf32aad9e7f27f50ffc45abe0e1e0cb0a433ad.tar gsoc2013-epiphany-d0bf32aad9e7f27f50ffc45abe0e1e0cb0a433ad.tar.gz gsoc2013-epiphany-d0bf32aad9e7f27f50ffc45abe0e1e0cb0a433ad.tar.bz2 gsoc2013-epiphany-d0bf32aad9e7f27f50ffc45abe0e1e0cb0a433ad.tar.lz gsoc2013-epiphany-d0bf32aad9e7f27f50ffc45abe0e1e0cb0a433ad.tar.xz gsoc2013-epiphany-d0bf32aad9e7f27f50ffc45abe0e1e0cb0a433ad.tar.zst gsoc2013-epiphany-d0bf32aad9e7f27f50ffc45abe0e1e0cb0a433ad.zip |
Consistent naming for nsresult vars. Since 'rv' had the majority, 'rv' it
2004-08-08 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/EphyBrowser.cpp:
* embed/mozilla/EphySingle.cpp:
* embed/mozilla/EventContext.cpp:
* embed/mozilla/MozillaPrivate.cpp:
* embed/mozilla/mozilla-embed-single.cpp:
* embed/mozilla/mozilla-embed.cpp:
Consistent naming for nsresult vars. Since 'rv' had the majority,
'rv' it is.
Diffstat (limited to 'embed/mozilla')
-rw-r--r-- | embed/mozilla/EphyBrowser.cpp | 57 | ||||
-rw-r--r-- | embed/mozilla/EphySingle.cpp | 6 | ||||
-rw-r--r-- | embed/mozilla/EventContext.cpp | 31 | ||||
-rw-r--r-- | embed/mozilla/MozillaPrivate.cpp | 6 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed-single.cpp | 30 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed.cpp | 96 |
6 files changed, 111 insertions, 115 deletions
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp index 4ee1028e6..62cf139ed 100644 --- a/embed/mozilla/EphyBrowser.cpp +++ b/embed/mozilla/EphyBrowser.cpp @@ -107,16 +107,15 @@ EphyEventListener::Init(EphyEmbed *aOwner) nsresult EphyFaviconEventListener::HandleFaviconLink (nsIDOMNode *node) { - nsresult result; - nsCOMPtr<nsIDOMElement> linkElement; linkElement = do_QueryInterface (node); if (!linkElement) return NS_ERROR_FAILURE; PRUnichar relAttr[] = { 'r', 'e', 'l', '\0' }; + nsresult rv; nsEmbedString value; - result = linkElement->GetAttribute (nsEmbedString(relAttr), value); - if (NS_FAILED (result)) return NS_ERROR_FAILURE; + rv = linkElement->GetAttribute (nsEmbedString(relAttr), value); + if (NS_FAILED (rv)) return NS_ERROR_FAILURE; nsEmbedCString rel; NS_UTF16ToCString (value, NS_CSTRING_ENCODING_UTF8, rel); @@ -126,8 +125,8 @@ EphyFaviconEventListener::HandleFaviconLink (nsIDOMNode *node) { PRUnichar hrefAttr[] = { 'h', 'r', 'e', 'f', '\0' }; nsEmbedString value; - result = linkElement->GetAttribute (nsEmbedString (hrefAttr), value); - if (NS_FAILED (result) || !value.Length()) return NS_ERROR_FAILURE; + rv = linkElement->GetAttribute (nsEmbedString (hrefAttr), value); + if (NS_FAILED (rv) || !value.Length()) return NS_ERROR_FAILURE; nsEmbedCString link; NS_UTF16ToCString (value, NS_CSTRING_ENCODING_UTF8, link); @@ -140,16 +139,16 @@ EphyFaviconEventListener::HandleFaviconLink (nsIDOMNode *node) NS_ENSURE_TRUE (doc, NS_ERROR_FAILURE); nsEmbedString spec; - result = doc->GetDocumentURI (spec); - NS_ENSURE_SUCCESS (result, result); + rv = doc->GetDocumentURI (spec); + NS_ENSURE_SUCCESS (rv, rv); nsCOMPtr<nsIURI> uri; - result = EphyUtils::NewURI (getter_AddRefs(uri), spec); - NS_ENSURE_SUCCESS (result, result); + rv = EphyUtils::NewURI (getter_AddRefs(uri), spec); + NS_ENSURE_SUCCESS (rv, rv); nsEmbedCString favicon_url; - result = uri->Resolve (link, favicon_url); - if (NS_FAILED (result)) return NS_ERROR_FAILURE; + rv = uri->Resolve (link, favicon_url); + if (NS_FAILED (rv)) return NS_ERROR_FAILURE; char *url = g_strdup (favicon_url.get()); g_signal_emit_by_name (mOwner, "ge_favicon", url); @@ -374,15 +373,13 @@ nsresult EphyBrowser::PrintPreviewNavigate(PRInt16 navType, PRInt32 pageNum) nsresult EphyBrowser::GetSHistory (nsISHistory **aSHistory) { - nsresult result; - NS_ENSURE_TRUE (mWebBrowser, NS_ERROR_FAILURE); nsCOMPtr<nsIWebNavigation> ContentNav = do_QueryInterface (mWebBrowser); NS_ENSURE_TRUE (ContentNav, NS_ERROR_FAILURE); nsCOMPtr<nsISHistory> SessionHistory; - result = ContentNav->GetSessionHistory (getter_AddRefs (SessionHistory)); + ContentNav->GetSessionHistory (getter_AddRefs (SessionHistory)); NS_ENSURE_TRUE (SessionHistory, NS_ERROR_FAILURE); *aSHistory = SessionHistory.get(); @@ -499,8 +496,6 @@ nsresult EphyBrowser::GetDocument (nsIDOMDocument **aDOMDocument) nsresult EphyBrowser::GetTargetDocument (nsIDOMDocument **aDOMDocument) { - nsresult result; - NS_ENSURE_TRUE (mWebBrowser, NS_ERROR_FAILURE); /* Use the current target document */ @@ -518,9 +513,10 @@ nsresult EphyBrowser::GetTargetDocument (nsIDOMDocument **aDOMDocument) webBrowserFocus = do_QueryInterface (mWebBrowser); NS_ENSURE_TRUE (webBrowserFocus, NS_ERROR_FAILURE); + nsresult rv; nsCOMPtr<nsIDOMWindow> DOMWindow; - result = webBrowserFocus->GetFocusedWindow (getter_AddRefs(DOMWindow)); - if (NS_SUCCEEDED(result) && DOMWindow) + rv = webBrowserFocus->GetFocusedWindow (getter_AddRefs(DOMWindow)); + if (NS_SUCCEEDED (rv) && DOMWindow) { return DOMWindow->GetDocument (aDOMDocument); } @@ -556,9 +552,9 @@ nsresult EphyBrowser::GetSHTitleAtIndex (PRInt32 index, PRUnichar **title) getter_AddRefs (he)); NS_ENSURE_TRUE (he, NS_ERROR_FAILURE); - nsresult result; - result = he->GetTitle (title); - NS_ENSURE_TRUE (NS_SUCCEEDED (result) && title, NS_ERROR_FAILURE); + nsresult rv; + rv = he->GetTitle (title); + NS_ENSURE_TRUE (NS_SUCCEEDED (rv) && title, NS_ERROR_FAILURE); return NS_OK; } @@ -580,9 +576,9 @@ nsresult EphyBrowser::GetSHUrlAtIndex (PRInt32 index, nsACString &url) he->GetURI (getter_AddRefs(uri)); NS_ENSURE_TRUE (uri, NS_ERROR_FAILURE); - nsresult result; - result = uri->GetSpec(url); - NS_ENSURE_TRUE (NS_SUCCEEDED (result) && url.Length(), NS_ERROR_FAILURE); + nsresult rv; + rv = uri->GetSpec(url); + NS_ENSURE_TRUE (NS_SUCCEEDED (rv) && url.Length(), NS_ERROR_FAILURE); return NS_OK; } @@ -724,8 +720,9 @@ nsresult EphyBrowser::GetForcedEncoding (nsACString &encoding) nsCOMPtr<nsIMarkupDocumentViewer> mdv = do_QueryInterface(contentViewer); NS_ENSURE_TRUE (mdv, NS_ERROR_FAILURE); - nsresult result = mdv->GetForceCharacterSet (encoding); - NS_ENSURE_SUCCESS (result, NS_ERROR_FAILURE); + nsresult rv; + rv = mdv->GetForceCharacterSet (encoding); + NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE); return NS_OK; } @@ -919,9 +916,9 @@ nsresult EphyBrowser::GetHasModifiedForms (PRBool *modified) nsCOMPtr<nsIDOMDocument> domDoc; contentViewer->GetDOMDocument (getter_AddRefs (domDoc)); - nsresult result; - result = GetDocumentHasModifiedForms (domDoc, &numTextFields, &hasTextArea); - if (NS_SUCCEEDED (result) && + nsresult rv; + rv = GetDocumentHasModifiedForms (domDoc, &numTextFields, &hasTextArea); + if (NS_SUCCEEDED (rv) && (numTextFields >= NUM_MODIFIED_TEXTFIELDS_REQUIRED || hasTextArea)) { *modified = PR_TRUE; diff --git a/embed/mozilla/EphySingle.cpp b/embed/mozilla/EphySingle.cpp index 7dc59b811..e8f2d4ee4 100644 --- a/embed/mozilla/EphySingle.cpp +++ b/embed/mozilla/EphySingle.cpp @@ -298,10 +298,10 @@ mozilla_cookie_to_ephy_cookie (nsICookie *cookie) EphyPermissionInfo * mozilla_permission_to_ephy_permission (nsIPermission *perm) { - nsresult result; + nsresult rv; nsEmbedCString type; - result = perm->GetType(type); - NS_ENSURE_SUCCESS (result, NULL); + rv = perm->GetType(type); + NS_ENSURE_SUCCESS (rv, NULL); PRUint32 cap; perm->GetCapability(&cap); diff --git a/embed/mozilla/EventContext.cpp b/embed/mozilla/EventContext.cpp index 82407e1b0..5f5f7e99d 100644 --- a/embed/mozilla/EventContext.cpp +++ b/embed/mozilla/EventContext.cpp @@ -578,9 +578,7 @@ nsresult EventContext::GetCSSBackground (nsIDOMNode *node, nsAString& url) nsresult EventContext::GetMouseEventInfo (nsIDOMMouseEvent *aMouseEvent, MozillaEmbedEvent *info) { - nsresult result; - - /* casting 32-bit guint* to PRUint16* below will break on big-endian */ + /* FIXME: casting 32-bit guint* to PRUint16* below will break on big-endian */ PRUint16 btn; aMouseEvent->GetButton (&btn); @@ -613,12 +611,13 @@ nsresult EventContext::GetMouseEventInfo (nsIDOMMouseEvent *aMouseEvent, Mozilla /* be sure we are not clicking on the scroolbars */ - nsCOMPtr<nsIDOMNSEvent> nsEvent = do_QueryInterface(aMouseEvent, &result); - if (NS_FAILED(result) || !nsEvent) return NS_ERROR_FAILURE; + nsCOMPtr<nsIDOMNSEvent> nsEvent = do_QueryInterface(aMouseEvent); + if (!nsEvent) return NS_ERROR_FAILURE; + nsresult rv; nsCOMPtr<nsIDOMEventTarget> OriginalTarget; - result = nsEvent->GetOriginalTarget(getter_AddRefs(OriginalTarget)); - if (NS_FAILED(result) || !OriginalTarget) return NS_ERROR_FAILURE; + rv = nsEvent->GetOriginalTarget(getter_AddRefs(OriginalTarget)); + if (NS_FAILED (rv) || !OriginalTarget) return NS_ERROR_FAILURE; nsCOMPtr<nsIDOMNode> OriginalNode = do_QueryInterface(OriginalTarget); if (!OriginalNode) return NS_ERROR_FAILURE; @@ -636,11 +635,11 @@ nsresult EventContext::GetMouseEventInfo (nsIDOMMouseEvent *aMouseEvent, Mozilla return NS_ERROR_FAILURE; nsCOMPtr<nsIDOMEventTarget> EventTarget; - result = aMouseEvent->GetTarget(getter_AddRefs(EventTarget)); - if (NS_FAILED(result) || !EventTarget) return NS_ERROR_FAILURE; + rv = aMouseEvent->GetTarget(getter_AddRefs(EventTarget)); + if (NS_FAILED (rv) || !EventTarget) return NS_ERROR_FAILURE; - result = GetEventContext (EventTarget, info); - if (NS_FAILED(result)) return result; + rv = GetEventContext (EventTarget, info); + if (NS_FAILED (rv)) return rv; /* Get the modifier */ @@ -725,15 +724,15 @@ nsresult EventContext::GetKeyEventInfo (nsIDOMKeyEvent *aKeyEvent, MozillaEmbedE nsresult EventContext::IsPageFramed (nsIDOMNode *node, PRBool *Framed) { - nsresult result; + nsresult rv; nsCOMPtr<nsIDOMDocument> mainDocument; - result = mBrowser->GetDocument (getter_AddRefs(mainDocument)); - if (NS_FAILED(result) || !mainDocument) return NS_ERROR_FAILURE; + rv = mBrowser->GetDocument (getter_AddRefs(mainDocument)); + if (NS_FAILED (rv) || !mainDocument) return NS_ERROR_FAILURE; nsCOMPtr<nsIDOMDocument> nodeDocument; - result = node->GetOwnerDocument (getter_AddRefs(nodeDocument)); - if (NS_FAILED(result) || !nodeDocument) return NS_ERROR_FAILURE; + rv = node->GetOwnerDocument (getter_AddRefs(nodeDocument)); + if (NS_FAILED (rv) || !nodeDocument) return NS_ERROR_FAILURE; *Framed = (mainDocument != nodeDocument); diff --git a/embed/mozilla/MozillaPrivate.cpp b/embed/mozilla/MozillaPrivate.cpp index e3f3324f9..fdece6738 100644 --- a/embed/mozilla/MozillaPrivate.cpp +++ b/embed/mozilla/MozillaPrivate.cpp @@ -58,10 +58,10 @@ GtkWidget *MozillaFindEmbed (nsIDOMWindow *aDOMWindow) nsCOMPtr<nsIEmbeddingSiteWindow> window (do_QueryInterface(windowChrome)); NS_ENSURE_TRUE (window, nsnull); - nsresult result; + nsresult rv; GtkWidget *mozembed; - result = window->GetSiteWindow ((void **)&mozembed); - NS_ENSURE_SUCCESS (result, nsnull); + rv = window->GetSiteWindow ((void **)&mozembed); + NS_ENSURE_SUCCESS (rv, nsnull); return mozembed; } diff --git a/embed/mozilla/mozilla-embed-single.cpp b/embed/mozilla/mozilla-embed-single.cpp index ba379377e..b0ffffeb3 100644 --- a/embed/mozilla/mozilla-embed-single.cpp +++ b/embed/mozilla/mozilla-embed-single.cpp @@ -381,18 +381,18 @@ have_gnome_url_handler (const gchar *protocol) static nsresult getUILang (nsAString& aUILang) { - nsresult result; + nsresult rv; - nsCOMPtr<nsILocaleService> localeService = do_GetService (NS_LOCALESERVICE_CONTRACTID, &result); - if (NS_FAILED (result) || !localeService) + nsCOMPtr<nsILocaleService> localeService = do_GetService (NS_LOCALESERVICE_CONTRACTID); + if (!localeService) { g_warning ("Could not get locale service!\n"); return NS_ERROR_FAILURE; } - result = localeService->GetLocaleComponentForUserAgent (aUILang); + rv = localeService->GetLocaleComponentForUserAgent (aUILang); - if (NS_FAILED (result)) + if (NS_FAILED (rv)) { g_warning ("Could not determine locale!\n"); return NS_ERROR_FAILURE; @@ -404,22 +404,22 @@ getUILang (nsAString& aUILang) static nsresult mozilla_init_chrome (void) { - nsresult result; + nsresult rv; nsEmbedString uiLang; nsCOMPtr<nsIXULChromeRegistry> chromeRegistry = do_GetService (NS_CHROMEREGISTRY_CONTRACTID); NS_ENSURE_TRUE (chromeRegistry, NS_ERROR_FAILURE); // Set skin to 'classic' so we get native scrollbars. - result = chromeRegistry->SelectSkin (nsEmbedCString("classic/1.0"), PR_FALSE); - NS_ENSURE_SUCCESS (result, NS_ERROR_FAILURE); + rv = chromeRegistry->SelectSkin (nsEmbedCString("classic/1.0"), PR_FALSE); + NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE); // set locale - result = chromeRegistry->SetRuntimeProvider(PR_TRUE); - NS_ENSURE_SUCCESS (result, NS_ERROR_FAILURE); + rv = chromeRegistry->SetRuntimeProvider(PR_TRUE); + NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE); - result = getUILang(uiLang); - NS_ENSURE_SUCCESS (result, NS_ERROR_FAILURE); + rv = getUILang(uiLang); + NS_ENSURE_SUCCESS (rv, NS_ERROR_FAILURE); nsEmbedCString cUILang; NS_UTF16ToCString (uiLang, NS_CSTRING_ENCODING_UTF8, cUILang); @@ -628,7 +628,7 @@ impl_get_font_list (EphyEmbedSingle *shell, static GList * impl_list_cookies (EphyCookieManager *manager) { - nsresult result; + nsresult rv; GList *cookies = NULL; nsCOMPtr<nsICookieManager> cookieManager = @@ -645,8 +645,8 @@ impl_list_cookies (EphyCookieManager *manager) cookieEnumerator->HasMoreElements(&enumResult)) { nsCOMPtr<nsICookie> keks; - result = cookieEnumerator->GetNext (getter_AddRefs(keks)); - if (NS_FAILED (result) || !keks) continue; + rv = cookieEnumerator->GetNext (getter_AddRefs(keks)); + if (NS_FAILED (rv) || !keks) continue; EphyCookie *cookie = mozilla_cookie_to_ephy_cookie (keks); if (!cookie) continue; diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp index 4a9c0b0f0..a07f54831 100644 --- a/embed/mozilla/mozilla-embed.cpp +++ b/embed/mozilla/mozilla-embed.cpp @@ -110,12 +110,12 @@ impl_manager_can_do_command (EphyCommandManager *manager, const char *command) { MozillaEmbedPrivate *mpriv = MOZILLA_EMBED(manager)->priv; - nsresult result; + nsresult rv; PRBool enabled; - result = mpriv->browser->GetCommandState (command, &enabled); + rv = mpriv->browser->GetCommandState (command, &enabled); - return NS_SUCCEEDED (result) ? enabled : FALSE; + return NS_SUCCEEDED (rv) ? enabled : FALSE; } static void @@ -179,12 +179,12 @@ impl_find_next (EphyEmbed *embed, gboolean backwards) { MozillaEmbedPrivate *mpriv = MOZILLA_EMBED(embed)->priv; - nsresult result; + nsresult rv; PRBool didFind; - result = mpriv->browser->Find (backwards, &didFind); + rv = mpriv->browser->Find (backwards, &didFind); - return NS_SUCCEEDED (result) ? didFind : FALSE; + return NS_SUCCEEDED (rv) ? didFind : FALSE; } static void @@ -216,10 +216,10 @@ mozilla_embed_realize (GtkWidget *widget) (* GTK_WIDGET_CLASS(parent_class)->realize) (widget); - nsresult result; - result = mpriv->browser->Init (GTK_MOZ_EMBED (widget)); + nsresult rv; + rv = mpriv->browser->Init (GTK_MOZ_EMBED (widget)); - if (NS_FAILED(result)) + if (NS_FAILED (rv)) { g_warning ("EphyBrowser initialization failed for %p\n", widget); } @@ -529,16 +529,16 @@ impl_set_zoom (EphyEmbed *embed, float zoom) { EphyBrowser *browser; - nsresult result; + nsresult rv; g_return_if_fail (zoom > 0.0); browser = MOZILLA_EMBED(embed)->priv->browser; g_return_if_fail (browser != NULL); - result = browser->SetZoom (zoom); + rv = browser->SetZoom (zoom); - if (NS_SUCCEEDED (result)) + if (NS_SUCCEEDED (rv)) { g_signal_emit_by_name (embed, "ge_zoom_change", zoom); } @@ -549,10 +549,11 @@ impl_get_zoom (EphyEmbed *embed) { MozillaEmbedPrivate *mpriv = MOZILLA_EMBED(embed)->priv; float f; + + nsresult rv; + rv = mpriv->browser->GetZoom (&f); - nsresult result = mpriv->browser->GetZoom (&f); - - if (NS_SUCCEEDED (result)) + if (NS_SUCCEEDED (rv)) { return f; } @@ -671,12 +672,12 @@ static int impl_print_preview_n_pages (EphyEmbed *embed) { MozillaEmbedPrivate *mpriv = MOZILLA_EMBED(embed)->priv; - nsresult result; + nsresult rv; int num; - result = mpriv->browser->PrintPreviewNumPages(&num); + rv = mpriv->browser->PrintPreviewNumPages(&num); - return NS_SUCCEEDED(result) ? num : 0; + return NS_SUCCEEDED (rv) ? num : 0; } static void @@ -685,9 +686,8 @@ impl_print_preview_navigate (EphyEmbed *embed, int page) { MozillaEmbedPrivate *mpriv = MOZILLA_EMBED(embed)->priv; - nsresult result; - result = mpriv->browser->PrintPreviewNavigate(type, page); + mpriv->browser->PrintPreviewNavigate(type, page); } static void @@ -695,19 +695,19 @@ impl_set_encoding (EphyEmbed *embed, const char *encoding) { MozillaEmbedPrivate *mpriv = MOZILLA_EMBED(embed)->priv; - nsresult result; + nsresult rv; nsEmbedCString currEnc; g_return_if_fail (encoding != NULL); - result = mpriv->browser->GetEncoding (currEnc); - if (NS_FAILED (result)) return; + rv = mpriv->browser->GetEncoding (currEnc); + if (NS_FAILED (rv)) return; if (strcmp (currEnc.get(), encoding) != 0 || encoding[0] == '\0' && !ephy_embed_has_automatic_encoding (embed)) { - result = mpriv->browser->ForceEncoding (encoding); - if (NS_FAILED (result)) return; + rv = mpriv->browser->ForceEncoding (encoding); + if (NS_FAILED (rv)) return; } #if (MOZILLA_IS_BRANCH (1,7) && MOZILLA_CHECK_VERSION3 (1, 7, 3)) || MOZILLA_CHECK_VERSION4 (1, 8, MOZILLA_ALPHA, 3) @@ -727,12 +727,12 @@ static char * impl_get_encoding (EphyEmbed *embed) { MozillaEmbedPrivate *mpriv = MOZILLA_EMBED(embed)->priv; - nsresult result; + nsresult rv; nsEmbedCString encoding; - result = mpriv->browser->GetEncoding (encoding); + rv = mpriv->browser->GetEncoding (encoding); - if (NS_FAILED (result) || !encoding.Length()) + if (NS_FAILED (rv) || !encoding.Length()) { return NULL; } @@ -744,12 +744,12 @@ static gboolean impl_has_automatic_encoding (EphyEmbed *embed) { MozillaEmbedPrivate *mpriv = MOZILLA_EMBED(embed)->priv; - nsresult result; + nsresult rv; nsEmbedCString encoding; - result = mpriv->browser->GetForcedEncoding (encoding); + rv = mpriv->browser->GetForcedEncoding (encoding); - if (NS_FAILED (result) || !encoding.Length()) + if (NS_FAILED (rv) || !encoding.Length()) { return TRUE; } @@ -761,12 +761,12 @@ static gboolean impl_has_modified_forms (EphyEmbed *embed) { MozillaEmbedPrivate *mpriv = MOZILLA_EMBED(embed)->priv; - nsresult result; + nsresult rv; PRBool modified; - result = mpriv->browser->GetHasModifiedForms (&modified); + rv = mpriv->browser->GetHasModifiedForms (&modified); - return modified == PR_TRUE ? TRUE : FALSE; + return NS_SUCCEEDED (rv) ? modified : FALSE; } static void @@ -931,7 +931,7 @@ mozilla_embed_dom_mouse_click_cb (GtkMozEmbed *embed, gpointer dom_event, MozillaEmbedEvent *info; EventContext event_context; gint return_value = FALSE; - nsresult result; + nsresult rv; MozillaEmbedPrivate *mpriv = MOZILLA_EMBED(embed)->priv; if (dom_event == NULL) @@ -948,16 +948,16 @@ mozilla_embed_dom_mouse_click_cb (GtkMozEmbed *embed, gpointer dom_event, info = mozilla_embed_event_new (NS_STATIC_CAST (gpointer, dev)); event_context.Init (mpriv->browser); - result = event_context.GetMouseEventInfo (ev, MOZILLA_EMBED_EVENT (info)); + rv = event_context.GetMouseEventInfo (ev, MOZILLA_EMBED_EVENT (info)); - if (NS_SUCCEEDED(result)) + if (NS_SUCCEEDED (rv)) { nsCOMPtr<nsIDOMDocument> domDoc; - result = event_context.GetTargetDocument (getter_AddRefs(domDoc)); - if (NS_SUCCEEDED(result)) + rv = event_context.GetTargetDocument (getter_AddRefs(domDoc)); + if (NS_SUCCEEDED (rv)) { - result = mpriv->browser->PushTargetDocument (domDoc); - if (NS_SUCCEEDED(result)) + rv = mpriv->browser->PushTargetDocument (domDoc); + if (NS_SUCCEEDED (rv)) { g_signal_emit_by_name (membed, "ge_dom_mouse_click", info, &return_value); @@ -979,7 +979,7 @@ mozilla_embed_dom_mouse_down_cb (GtkMozEmbed *embed, gpointer dom_event, MozillaEmbedEvent *info; EventContext event_context; gint return_value = FALSE; - nsresult result; + nsresult rv; EphyEmbedEventType type; MozillaEmbedPrivate *mpriv = MOZILLA_EMBED(embed)->priv; @@ -997,18 +997,18 @@ mozilla_embed_dom_mouse_down_cb (GtkMozEmbed *embed, gpointer dom_event, info = mozilla_embed_event_new (NS_STATIC_CAST (gpointer, dev)); event_context.Init (mpriv->browser); - result = event_context.GetMouseEventInfo (ev, MOZILLA_EMBED_EVENT (info)); - if (NS_FAILED (result)) return FALSE; + rv = event_context.GetMouseEventInfo (ev, MOZILLA_EMBED_EVENT (info)); + if (NS_FAILED (rv)) return FALSE; type = ephy_embed_event_get_event_type ((EphyEmbedEvent *) info); nsCOMPtr<nsIDOMDocument> domDoc; - result = event_context.GetTargetDocument (getter_AddRefs(domDoc)); - if (NS_SUCCEEDED(result)) + rv = event_context.GetTargetDocument (getter_AddRefs(domDoc)); + if (NS_SUCCEEDED (rv)) { - result = mpriv->browser->PushTargetDocument (domDoc); + rv = mpriv->browser->PushTargetDocument (domDoc); - if (NS_SUCCEEDED(result)) + if (NS_SUCCEEDED (rv)) { g_signal_emit_by_name (membed, "ge_dom_mouse_down", info, &return_value); |