Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 238976 | Differences between
and this patch

Collapse All | Expand All

(-)cups-1.3.8/filter/texttops.c (+15 lines)
Lines 173-178 WriteProlog(const char *title, /* I - T Link Here
173
  SizeColumns = (PageRight - PageLeft) / 72.0 * CharsPerInch;
173
  SizeColumns = (PageRight - PageLeft) / 72.0 * CharsPerInch;
174
  SizeLines   = (PageTop - PageBottom) / 72.0 * LinesPerInch;
174
  SizeLines   = (PageTop - PageBottom) / 72.0 * LinesPerInch;
175
175
176
  if (SizeColumns <= 0 || SizeColumns > 32767 ||
177
      SizeLines <= 0 || SizeLines > 32767)
178
  {
179
    _cupsLangPrintf(stderr, _("ERROR: Unable to print %dx%d text page!\n"),
180
                    SizeColumns, SizeLines);
181
    exit(1);
182
  }
183
176
  Page    = calloc(sizeof(lchar_t *), SizeLines);
184
  Page    = calloc(sizeof(lchar_t *), SizeLines);
177
  Page[0] = calloc(sizeof(lchar_t), SizeColumns * SizeLines);
185
  Page[0] = calloc(sizeof(lchar_t), SizeColumns * SizeLines);
178
  for (i = 1; i < SizeLines; i ++)
186
  for (i = 1; i < SizeLines; i ++)
Lines 187-192 WriteProlog(const char *title, /* I - T Link Here
187
  else
195
  else
188
    ColumnWidth = SizeColumns;
196
    ColumnWidth = SizeColumns;
189
197
198
  if (ColumnWidth <= 0)
199
  {
200
    _cupsLangPrintf(stderr, _("ERROR: Unable to print %d text columns!\n"),
201
                    PageColumns);
202
    exit(1);
203
  }
204
190
 /*
205
 /*
191
  * Output the DSC header...
206
  * Output the DSC header...
192
  */
207
  */
(-)cups-1.3.8/filter/textcommon.c (-1 / +25 lines)
Lines 3-9 Link Here
3
 *
3
 *
4
 *   Common text filter routines for the Common UNIX Printing System (CUPS).
4
 *   Common text filter routines for the Common UNIX Printing System (CUPS).
5
 *
5
 *
6
 *   Copyright 2007 by Apple Inc.
6
 *   Copyright 2007-2008 by Apple Inc.
7
 *   Copyright 1997-2007 by Easy Software Products.
7
 *   Copyright 1997-2007 by Easy Software Products.
8
 *
8
 *
9
 *   These coded instructions, statements, and computer programs are the
9
 *   These coded instructions, statements, and computer programs are the
Lines 605-618 TextMain(const char *name, /* I - Name o Link Here
605
                !strcasecmp(val, "yes");
605
                !strcasecmp(val, "yes");
606
606
607
  if ((val = cupsGetOption("columns", num_options, options)) != NULL)
607
  if ((val = cupsGetOption("columns", num_options, options)) != NULL)
608
  {
608
    PageColumns = atoi(val);
609
    PageColumns = atoi(val);
609
610
611
    if (PageColumns < 1)
612
    {
613
      _cupsLangPrintf(stderr, _("ERROR: Bad columns value %d!\n"), PageColumns);
614
      return (1);
615
    }
616
  }
617
610
  if ((val = cupsGetOption("cpi", num_options, options)) != NULL)
618
  if ((val = cupsGetOption("cpi", num_options, options)) != NULL)
619
  {
611
    CharsPerInch = atof(val);
620
    CharsPerInch = atof(val);
612
621
622
    if (CharsPerInch <= 0.0)
623
    {
624
      _cupsLangPrintf(stderr, _("ERROR: Bad cpi value %f!\n"), CharsPerInch);
625
      return (1);
626
    }
627
  }
628
613
  if ((val = cupsGetOption("lpi", num_options, options)) != NULL)
629
  if ((val = cupsGetOption("lpi", num_options, options)) != NULL)
630
  {
614
    LinesPerInch = atof(val);
631
    LinesPerInch = atof(val);
615
632
633
    if (LinesPerInch <= 0.0)
634
    {
635
      _cupsLangPrintf(stderr, _("ERROR: Bad lpi value %f!\n"), LinesPerInch);
636
      return (1);
637
    }
638
  }
639
616
  if (PrettyPrint)
640
  if (PrettyPrint)
617
    PageTop -= 216.0f / LinesPerInch;
641
    PageTop -= 216.0f / LinesPerInch;
618
642

Return to bug 238976