diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2004-01-10 19:19:52 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2004-01-10 19:19:52 +0800 |
commit | 137a5961bbd03f74a90927ae1a03ed5e19e5d666 (patch) | |
tree | 710be6153d725c44fa97993e3dee32aaf74ef9d6 /embed/mozilla/MozillaPrivate.cpp | |
parent | 264834c946c5555c48b1fda985c6513c23773228 (diff) | |
download | gsoc2013-epiphany-137a5961bbd03f74a90927ae1a03ed5e19e5d666.tar gsoc2013-epiphany-137a5961bbd03f74a90927ae1a03ed5e19e5d666.tar.gz gsoc2013-epiphany-137a5961bbd03f74a90927ae1a03ed5e19e5d666.tar.bz2 gsoc2013-epiphany-137a5961bbd03f74a90927ae1a03ed5e19e5d666.tar.lz gsoc2013-epiphany-137a5961bbd03f74a90927ae1a03ed5e19e5d666.tar.xz gsoc2013-epiphany-137a5961bbd03f74a90927ae1a03ed5e19e5d666.tar.zst gsoc2013-epiphany-137a5961bbd03f74a90927ae1a03ed5e19e5d666.zip |
Use NS_ENSURE_SUCCESS/NS_ENSURE_TRUE at appropriate places.
2004-01-10 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/FilePicker.cpp:
* embed/mozilla/MozDownload.cpp:
* embed/mozilla/MozRegisterComponents.cpp:
* embed/mozilla/MozillaPrivate.cpp:
Use NS_ENSURE_SUCCESS/NS_ENSURE_TRUE at appropriate places.
Diffstat (limited to 'embed/mozilla/MozillaPrivate.cpp')
-rw-r--r-- | embed/mozilla/MozillaPrivate.cpp | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/embed/mozilla/MozillaPrivate.cpp b/embed/mozilla/MozillaPrivate.cpp index 17925955f..d83509119 100644 --- a/embed/mozilla/MozillaPrivate.cpp +++ b/embed/mozilla/MozillaPrivate.cpp @@ -1,3 +1,27 @@ +/* + * Copyright (C) 2003 Marco Pesenti Gritti + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * $Id$ + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "MozillaPrivate.h" #include <nsIServiceManagerUtils.h> @@ -11,8 +35,6 @@ GtkWidget *MozillaFindEmbed (nsIDOMWindow *aDOMWindow) { - nsresult result; - nsCOMPtr<nsIWindowWatcher> wwatch (do_GetService("@mozilla.org/embedcomp/window-watcher;1")); NS_ENSURE_TRUE (wwatch, nsnull); @@ -33,14 +55,13 @@ GtkWidget *MozillaFindEmbed (nsIDOMWindow *aDOMWindow) NS_ENSURE_TRUE (domWindow, nsnull); nsCOMPtr<nsIWebBrowserChrome> windowChrome; - result = wwatch->GetChromeForWindow (domWindow, - getter_AddRefs(windowChrome)); + wwatch->GetChromeForWindow (domWindow, getter_AddRefs(windowChrome)); NS_ENSURE_TRUE (windowChrome, nsnull); - nsCOMPtr<nsIEmbeddingSiteWindow> window - (do_QueryInterface(windowChrome, &result)); + nsCOMPtr<nsIEmbeddingSiteWindow> window (do_QueryInterface(windowChrome)); NS_ENSURE_TRUE (window, nsnull); + nsresult result; GtkWidget *mozembed; result = window->GetSiteWindow ((void **)&mozembed); NS_ENSURE_SUCCESS (result, nsnull); @@ -51,7 +72,7 @@ GtkWidget *MozillaFindEmbed (nsIDOMWindow *aDOMWindow) GtkWidget *MozillaFindGtkParent (nsIDOMWindow *aDOMWindow) { GtkWidget *embed = MozillaFindEmbed (aDOMWindow); - if (!embed) return nsnull; + NS_ENSURE_TRUE (embed, nsnull); return gtk_widget_get_toplevel (GTK_WIDGET (embed)); } @@ -59,7 +80,7 @@ GtkWidget *MozillaFindGtkParent (nsIDOMWindow *aDOMWindow) #define MM_TO_INCH(x) (((double) x) / 25.4) NS_METHOD MozillaCollatePrintSettings (const EmbedPrintInfo *info, - nsIPrintSettings *options) + nsIPrintSettings *options) { const static int frame_types[] = { nsIPrintSettings::kFramesAsIs, |