~ubuntu-branches/ubuntu/oneiric/cups/oneiric

« back to all changes in this revision

Viewing changes to cups/page.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2010-04-09 16:19:16 UTC
  • mto: (25.1.2 lucid) (55.1.1 sid)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20100409161916-k0e6prz52ubf4vlg
Tags: upstream-1.4.3
ImportĀ upstreamĀ versionĀ 1.4.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * "$Id: page.c 8664 2009-05-20 21:21:50Z mike $"
 
2
 * "$Id: page.c 8959 2010-01-18 22:10:29Z mike $"
3
3
 *
4
4
 *   Page size functions for the Common UNIX Printing System (CUPS).
5
5
 *
6
 
 *   Copyright 2007-2009 by Apple Inc.
 
6
 *   Copyright 2007-2010 by Apple Inc.
7
7
 *   Copyright 1997-2007 by Easy Software Products, all rights reserved.
8
8
 *
9
9
 *   These coded instructions, statements, and computer programs are the
250
250
  * Figure out the current minimum width and length...
251
251
  */
252
252
 
 
253
  width  = ppd->custom_min[0];
 
254
  length = ppd->custom_min[1];
 
255
 
253
256
  if (qualifier2)
254
257
  {
255
258
   /*
277
280
      attr = ppdFindAttr(ppd, "cupsMinSize", spec);
278
281
    }
279
282
 
280
 
    if (!attr ||
281
 
        (attr->value && sscanf(attr->value, "%f%f", &width, &length) != 2))
 
283
    if ((attr && attr->value &&
 
284
         sscanf(attr->value, "%f%f", &width, &length) != 2) || !attr)
282
285
    {
283
286
      width  = ppd->custom_min[0];
284
287
      length = ppd->custom_min[1];
285
288
    }
286
289
  }
287
 
  else
288
 
  {
289
 
    width  = ppd->custom_min[0];
290
 
    length = ppd->custom_min[1];
291
 
  }
292
290
 
293
291
  minimum->width  = width;
294
292
  minimum->length = length;
301
299
  * Figure out the current maximum width and length...
302
300
  */
303
301
 
 
302
  width  = ppd->custom_max[0];
 
303
  length = ppd->custom_max[1];
 
304
 
304
305
  if (qualifier2)
305
306
  {
306
307
   /*
335
336
      length = ppd->custom_max[1];
336
337
    }
337
338
  }
338
 
  else
339
 
  {
340
 
    width  = ppd->custom_max[0];
341
 
    length = ppd->custom_max[1];
342
 
  }
343
339
 
344
340
  maximum->width  = width;
345
341
  maximum->length = length;
395
391
 
396
392
 
397
393
/*
398
 
 * End of "$Id: page.c 8664 2009-05-20 21:21:50Z mike $".
 
394
 * End of "$Id: page.c 8959 2010-01-18 22:10:29Z mike $".
399
395
 */