Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37845432
en ru br
ALT Linux repos
S:0.1.8-alt7
4.1: 0.1.6-alt0.1.1

Group :: Office
RPM: epdfview

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: mdk-epdfview-0.1.6-fix-printing.patch
Download


diff -Naur epdfview-0.1.6/src/PrintPter.cxx epdfview-0.1.6.tpg/src/PrintPter.cxx
--- epdfview-0.1.6/src/PrintPter.cxx	2007-02-23 07:37:59.000000000 +0000
+++ epdfview-0.1.6.tpg/src/PrintPter.cxx	2008-03-28 00:11:36.000000000 +0000
@@ -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);
             }
         }
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin