aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@.gnome.org>2003-08-15 00:44:35 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-08-15 00:44:35 +0800
commitcef2c42a07d633d2431872c9a8929f28a052c6f3 (patch)
tree5165fff1882ef7d43178e7328d2cf51d01e143ca
parent83d079f0b909106f3c3da16fd62a7cdfdf6b07e2 (diff)
downloadgsoc2013-epiphany-cef2c42a07d633d2431872c9a8929f28a052c6f3.tar
gsoc2013-epiphany-cef2c42a07d633d2431872c9a8929f28a052c6f3.tar.gz
gsoc2013-epiphany-cef2c42a07d633d2431872c9a8929f28a052c6f3.tar.bz2
gsoc2013-epiphany-cef2c42a07d633d2431872c9a8929f28a052c6f3.tar.lz
gsoc2013-epiphany-cef2c42a07d633d2431872c9a8929f28a052c6f3.tar.xz
gsoc2013-epiphany-cef2c42a07d633d2431872c9a8929f28a052c6f3.tar.zst
gsoc2013-epiphany-cef2c42a07d633d2431872c9a8929f28a052c6f3.zip
Make print preview exit code safer.
2003-08-14 Marco Pesenti Gritti <marco@.gnome.org> * embed/mozilla/EphyWrapper.cpp: * src/ppview-toolbar.c: (toolbar_cmd_ppv_close): Make print preview exit code safer.
-rw-r--r--ChangeLog7
-rw-r--r--embed/mozilla/EphyWrapper.cpp2
-rwxr-xr-xsrc/ppview-toolbar.c13
3 files changed, 18 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index dac0cab68..71fc0cf26 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2003-08-14 Marco Pesenti Gritti <marco@.gnome.org>
+
+ * embed/mozilla/EphyWrapper.cpp:
+ * src/ppview-toolbar.c: (toolbar_cmd_ppv_close):
+
+ Make print preview exit code safer.
+
2003-08-14 Christian Persch <chpe@cvs.gnome.org>
* lib/egg/egg-toolbars-model.c: (impl_add_item):
diff --git a/embed/mozilla/EphyWrapper.cpp b/embed/mozilla/EphyWrapper.cpp
index 3b9856716..d9de1d54d 100644
--- a/embed/mozilla/EphyWrapper.cpp
+++ b/embed/mozilla/EphyWrapper.cpp
@@ -211,7 +211,7 @@ nsresult EphyWrapper::PrintPreviewClose (void)
if (NS_FAILED(rv) || !print) return NS_ERROR_FAILURE;
rv = print->GetDoingPrintPreview(&isPreview);
- if (isPreview == PR_TRUE)
+ if (NS_SUCCEEDED (rv) && isPreview == PR_TRUE)
{
rv = print->ExitPrintPreview();
}
diff --git a/src/ppview-toolbar.c b/src/ppview-toolbar.c
index d08dbdece..26b52926e 100755
--- a/src/ppview-toolbar.c
+++ b/src/ppview-toolbar.c
@@ -394,16 +394,23 @@ static void
toolbar_cmd_ppv_close (EggMenuMerge *merge,
PPViewToolbar *t)
{
- EphyWindow *window = t->priv->window;
+ EphyWindow *window;
EphyEmbed *embed;
GtkWidget *notebook;
+ g_return_if_fail (IS_PPVIEW_TOOLBAR (t));
+
+ window = t->priv->window;
+ g_return_if_fail (IS_EPHY_WINDOW (window));
+
embed = ephy_window_get_active_embed (window);
- g_return_if_fail (embed != NULL);
+ g_return_if_fail (IS_EPHY_EMBED (embed));
- ephy_window_set_chrome (t->priv->window, t->priv->original_mask);
+ ephy_window_set_chrome (window, t->priv->original_mask);
notebook = ephy_window_get_notebook (window);
+ g_return_if_fail (IS_EPHY_NOTEBOOK (notebook));
+
ephy_notebook_set_show_tabs (EPHY_NOTEBOOK (notebook), TRUE);
ephy_embed_print_preview_close (embed);