]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror changes from trunk.
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 14 Aug 2013 20:33:55 +0000 (20:33 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 14 Aug 2013 20:33:55 +0000 (20:33 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.7@11240 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES-1.6.txt
cups/libcups2.def
cups/pwg-media.c
cups/pwg-private.h
cups/testpwg.c

index 0f00d314b052ba7990e25b7c7a575d2c7ee2078d..23e14229731c4e0e571cc140a864217cd9bb9739 100644 (file)
@@ -3,6 +3,8 @@ CHANGES-1.6.txt
 
 CHANGES IN CUPS V1.6.4
 
+       - Removed some duplicate size definitions for some ISO sizes that were
+         causing problems (<rdar://problem/14722721>)
        - The IPP backend did not add the "last-document" attribute
          (<rdar://problem/114660379>)
        - Added a SyncOnClose directive to cups-files.conf to force cupsd to
index 8745d9e142b17e6d2a991c13149a7f50f95c57ed..ea525c1509271d796695b5ec799e667cacaef734 100644 (file)
@@ -61,6 +61,7 @@ _ppdNormalizeMakeAndModel
 _ppdOpen\r
 _ppdOpenFile\r
 _ppdParseOptions\r
+_pwgMediaTable\r
 cupsAddDest\r
 cupsAddOption\r
 cupsAdminCreateWindowsPPD\r
index 264ca7135bdff9790f342c6968fb578884560a7f..87ed7b724f52c932febc6caabb4d2ccaf9c8ca6d 100644 (file)
@@ -24,6 +24,7 @@
  *                             name.
  *   pwgMediaForSize()       - Get the PWG media size for the given
  *                             dimensions.
+ *   _pwgMediaTable()         - Return the internal media size table.
  *   pwg_compare_legacy()     - Compare two sizes using the legacy names.
  *   pwg_compare_ppd()       - Compare two sizes using the PPD names.
  *   pwg_compare_pwg()       - Compare two sizes using the PWG names.
@@ -233,13 +234,11 @@ static pwg_media_t const cups_pwg_media[] =
   _PWG_MEDIA_MM("prc_4_110x208mm", NULL, "EnvPRC4", 110, 208),
   _PWG_MEDIA_MM("prc_8_120x309mm", NULL, "EnvPRC8", 120, 309),
   _PWG_MEDIA_MM("prc_6_120x320mm", NULL, NULL, 120, 320),
-  _PWG_MEDIA_MM("prc_3_125x176mm", NULL, "EnvPRC3", 125, 176),
   _PWG_MEDIA_MM("prc_16k_146x215mm", NULL, "PRC16K", 146, 215),
   _PWG_MEDIA_MM("prc_7_160x230mm", NULL, "EnvPRC7", 160, 230),
   _PWG_MEDIA_MM("om_juuro-ku-kai_198x275mm", NULL, NULL, 198, 275),
   _PWG_MEDIA_MM("om_pa-kai_267x389mm", NULL, NULL, 267, 389),
   _PWG_MEDIA_MM("om_dai-pa-kai_275x395mm", NULL, NULL, 275, 395),
-  _PWG_MEDIA_MM("prc_10_324x458mm", NULL, "EnvPRC10", 324, 458),
 
   /* Chinese Standard Sheet Media Inch Sizes */
   _PWG_MEDIA_IN("roc_16k_7.75x10.75in", NULL, "roc16k", 7.75, 10.75),
@@ -251,7 +250,6 @@ static pwg_media_t const cups_pwg_media[] =
   /* Other Metric Standard Sheet Media Sizes */
   _PWG_MEDIA_MM("om_small-photo_100x150mm", NULL, "om_small-photo", 100, 150),
   _PWG_MEDIA_MM("om_italian_110x230mm", NULL, "EnvItalian", 110, 230),
-  _PWG_MEDIA_MM("om_postfix_114x229mm", NULL, NULL, 114, 229),
   _PWG_MEDIA_MM("om_large-photo_200x300", NULL, "om_large-photo", 200, 300),
   _PWG_MEDIA_MM("om_folio_210x330mm", "folio", "Folio", 210, 330),
   _PWG_MEDIA_MM("om_folio-sp_215x315mm", NULL, "FolioSP", 215, 315),
@@ -1003,6 +1001,19 @@ pwg_media_t *_pwgMediaForSize(int width, int length)
 { return (pwgMediaForSize(width, length)); }
 
 
+/*
+ * '_pwgMediaTable()' - Return the internal media size table.
+ */
+
+const pwg_media_t *                    /* O - Pointer to first entry */
+_pwgMediaTable(size_t *num_media)      /* O - Number of entries */
+{
+  *num_media = sizeof(cups_pwg_media) / sizeof(cups_pwg_media[0]);
+
+  return (cups_pwg_media);
+}
+
+
 /*
  * 'pwg_compare_legacy()' - Compare two sizes using the legacy names.
  */
index ad097bf531b96387cdf4b279c480bdf43575f6e1..d012e308f98efdf1a3db1d85beef6351426c4cb2 100644 (file)
@@ -65,6 +65,7 @@ extern pwg_media_t    *_pwgMediaForPWG(const char *pwg)
                            _CUPS_INTERNAL_MSG("Use pwgMediaForPWG instead.");
 extern pwg_media_t     *_pwgMediaForSize(int width, int length)
                            _CUPS_INTERNAL_MSG("Use pwgMediaForSize instead.");
+extern const pwg_media_t *_pwgMediaTable(size_t *num_media);
 
 #  ifdef __cplusplus
 }
index 58f6f73e4a3358fab61a9f27f2e7d52d206488cd..dfa9f402acd677e6298d599ed79d073d9a6a35c0 100644 (file)
@@ -45,11 +45,15 @@ int                                 /* O - Exit status */
 main(int  argc,                                /* I - Number of command-line args */
      char *argv[])                     /* I - Command-line arguments */
 {
-  int          status;                 /* Status of tests (0 = success, 1 = fail) */
-  const char   *ppdfile;               /* PPD filename */
-  ppd_file_t   *ppd;                   /* PPD file */
-  _ppd_cache_t *pc;                    /* PPD cache and PWG mapping data */
-  pwg_media_t  *pwgmedia;              /* PWG media size */
+  int                  status;         /* Status of tests (0 = success, 1 = fail) */
+  const char           *ppdfile;       /* PPD filename */
+  ppd_file_t           *ppd;           /* PPD file */
+  _ppd_cache_t         *pc;            /* PPD cache and PWG mapping data */
+  const pwg_media_t    *pwgmedia;      /* PWG media size */
+  size_t               i,              /* Looping var */
+                       num_media;      /* Number of media sizes */
+  const pwg_media_t    *mediatable;    /* Media size table */
+  int                  dupmedia = 0;   /* Duplicate media sizes? */
 
 
   status = 0;
@@ -302,6 +306,33 @@ main(int  argc,                            /* I - Number of command-line args */
   else
     printf("PASS (%s)\n", pwgmedia->pwg);
 
+  fputs("Duplicate size test: ", stdout);
+  for (mediatable = _pwgMediaTable(&num_media);
+       num_media > 1;
+       num_media --, mediatable ++)
+  {
+    for (i = num_media - 1, pwgmedia = mediatable + 1; i > 0; i --, pwgmedia ++)
+    {
+      if (pwgmedia->width == mediatable->width &&
+          pwgmedia->length == mediatable->length)
+      {
+        if (!dupmedia)
+        {
+          dupmedia = 1;
+          status ++;
+          puts("FAIL");
+        }
+
+        printf("    %s and %s have the same dimensions (%dx%d)\n",
+               pwgmedia->pwg, mediatable->pwg, pwgmedia->width,
+               pwgmedia->length);
+      }
+    }
+  }
+  if (!dupmedia)
+    puts("PASS");
+
+
   return (status);
 }