Date: Thu, 28 Aug 2008 15:35:44 +0200 (CEST) From: Henrik Friedrichsen <hrkfrd@googlemail.com> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/126917: epdfview crashes when opening the print dialog Message-ID: <200808281335.m7SDZiWs041581@megawr.ath.cx> Resent-Message-ID: <200808281340.m7SDe5gU093514@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 126917 >Category: ports >Synopsis: epdfview crashes when opening the print dialog >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Aug 28 13:40:05 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Henrik Friedrichsen >Release: FreeBSD 7.0-STABLE i386 >Organization: >Environment: System: FreeBSD dsp.megawr.ath.cx 7.0-STABLE FreeBSD 7.0-STABLE #0: Sun Aug 24 21:14:38 CEST 2008 root@dsp.megawr.ath.cx:/usr/src/sys/i386/compile/KRAFTWERK i386 >Description: epdfview has a known affecting the current version in the ports tree that makes it segfault when opening the print dialog. This problem has been fixed in svn. The patch attached includes that fix in the current port build. More information: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=477200 >How-To-Repeat: Open a PDF file with epdfview and try to print. >Fix: Apply the patch attached on the port. --- epdfview.patch begins here --- diff -Naur ./files/patch-PrintPtr.cxx ../epdfview/files/patch-PrintPtr.cxx --- ./files/patch-PrintPtr.cxx 1970-01-01 01:00:00.000000000 +0100 +++ ../epdfview/files/patch-PrintPtr.cxx 2008-08-28 15:28:32.000000000 +0200 @@ -0,0 +1,103 @@ +diff -Naur ./src/PrintPter.cxx ../epdfview-0.1.6/src/PrintPter.cxx +--- ./src/PrintPter.cxx 2008-08-28 15:27:16.000000000 +0200 ++++ ../epdfview-0.1.6/src/PrintPter.cxx 2008-08-28 15:27:32.000000000 +0200 +@@ -230,20 +230,27 @@ + ppdFindOption (printerPPD, "PageSize"); + view.clearPageSizeList (); + int pageSizeToSelect = 0; +- ppd_choice_t *pageSizeChoice = pageSizeOption->choices; +- for ( int currentSize = 0 ; +- currentSize < pageSizeOption->num_choices ; +- ++currentSize, ++pageSizeChoice ) ++ if ( 0 != pageSizeOption ) + { +- const gchar *sizeName = pageSizeChoice->text; +- const gchar *sizeValue = pageSizeChoice->choice; +- +- view.addPageSize (_(sizeName), sizeValue); +- if ( pageSizeChoice->marked ) ++ ppd_choice_t *pageSizeChoice = pageSizeOption->choices; ++ for ( int currentSize = 0 ; ++ currentSize < pageSizeOption->num_choices ; ++ ++currentSize, ++pageSizeChoice ) + { +- pageSizeToSelect = currentSize; ++ const gchar *sizeName = pageSizeChoice->text; ++ const gchar *sizeValue = pageSizeChoice->choice; ++ ++ view.addPageSize (_(sizeName), sizeValue); ++ if ( pageSizeChoice->marked ) ++ { ++ pageSizeToSelect = currentSize; ++ } + } + } ++ else ++ { ++ view.addPageSize (_("A4"), "A4"); ++ } + view.selectPageSize (pageSizeToSelect); + + // Get the resolutions. +@@ -251,29 +258,36 @@ + ppdFindOption (printerPPD, "Resolution"); + view.clearResolutionList (); + int resolutionToSelect = 0; +- ppd_choice_t *resolutionChoice = resolutionOption->choices; +- for ( int currentRes = 0 ; +- currentRes < resolutionOption->num_choices ; +- ++currentRes, ++resolutionChoice ) ++ if ( 0 != resolutionOption ) + { +- const gchar *resName = resolutionChoice->text; +- const gchar *resValue = resolutionChoice->choice; +- +- view.addResolution (_(resName), resValue); +- if ( resolutionChoice->marked ) ++ ppd_choice_t *resolutionChoice = resolutionOption->choices; ++ for ( int currentRes = 0 ; ++ currentRes < resolutionOption->num_choices ; ++ ++currentRes, ++resolutionChoice ) + { +- resolutionToSelect = currentRes; ++ const gchar *resName = resolutionChoice->text; ++ const gchar *resValue = resolutionChoice->choice; ++ ++ view.addResolution (_(resName), resValue); ++ if ( resolutionChoice->marked ) ++ { ++ resolutionToSelect = currentRes; ++ } + } + } ++ else ++ { ++ view.addResolution (_("300 DPI"), "300x300dpi"); ++ } + view.selectResolution (resolutionToSelect); + + // Get the color models. + ppd_option_t *colorModelOption = + ppdFindOption (printerPPD, "ColorModel"); + view.clearColorModelList (); ++ int colorModelToSelect = 0; + if ( NULL != colorModelOption ) + { +- int colorModelToSelect = 0; + ppd_choice_t *colorModelChoice = colorModelOption->choices; + for ( int currentColor = 0 ; + currentColor < colorModelOption->num_choices ; +@@ -288,12 +302,12 @@ + colorModelToSelect = currentColor; + } + } +- view.selectColorModel (colorModelToSelect); + } + else + { + view.addColorModel (_("Grayscale"), "Gray"); + } ++ view.selectColorModel (colorModelToSelect); + ppdClose (printerPPD); + } + } --- epdfview.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808281335.m7SDZiWs041581>