Another segfault fix.

-- 
Rogério Brito : rbr...@{ime.usp.br,gmail.com} : GPG key 1024D/7C2CAEB8
http://rb.doesntexist.org : Packages for LaTeX : algorithms.berlios.de
DebianQA: http://qa.debian.org/developer.php?login=rbrito%40ime.usp.br
#! /bin/sh /usr/share/dpatch/dpatch-run
## fix-437725.dpatch from Arno Renevier <arenev...@fdn.fr>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix segmentation fault when pressing Ctrl-W in full screen mode

@DPATCH@
--- a/xpdf/XPDFViewer.cc
+++ b/xpdf/XPDFViewer.cc
@@ -402,18 +402,21 @@
   title = app->getTitle() ? app->getTitle()->getCString()
                           : (char *)xpdfAppName;
   XtVaSetValues(win, XmNtitle, title, XmNiconName, title, NULL);
-  s = XmStringCreateLocalized("");
-  XtVaSetValues(pageNumText, XmNlabelString, s, NULL);
-  XmStringFree(s);
-  s = XmStringCreateLocalized(" of 0");
-  XtVaSetValues(pageCountLabel, XmNlabelString, s, NULL);
-  XmStringFree(s);
 
-  // disable buttons
-  XtVaSetValues(prevTenPageBtn, XmNsensitive, False, NULL);
-  XtVaSetValues(prevPageBtn, XmNsensitive, False, NULL);
-  XtVaSetValues(nextTenPageBtn, XmNsensitive, False, NULL);
-  XtVaSetValues(nextPageBtn, XmNsensitive, False, NULL);
+  if (toolBar != None) {
+      s = XmStringCreateLocalized("");
+      XtVaSetValues(pageNumText, XmNlabelString, s, NULL);
+      XmStringFree(s);
+      s = XmStringCreateLocalized(" of 0");
+      XtVaSetValues(pageCountLabel, XmNlabelString, s, NULL);
+      XmStringFree(s);
+
+      // disable buttons
+      XtVaSetValues(prevTenPageBtn, XmNsensitive, False, NULL);
+      XtVaSetValues(prevPageBtn, XmNsensitive, False, NULL);
+      XtVaSetValues(nextTenPageBtn, XmNsensitive, False, NULL);
+      XtVaSetValues(nextPageBtn, XmNsensitive, False, NULL);
+  }
 
   // remove the old outline
 #ifndef DISABLE_OUTLINE

Reply via email to