]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix localization of media sizes.
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Fri, 23 May 2014 03:18:00 +0000 (03:18 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Fri, 23 May 2014 03:18:00 +0000 (03:18 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11894 a1ca3aef-8c08-0410-bb20-df032aa958be

cups/dest-localization.c

index cdec441b5f66ed1a1d9806b42949fcac7c5edd55..4ed2675b41b47c9a35122c7d5b36b55e0e33c58c 100644 (file)
@@ -130,12 +130,21 @@ cupsLocalizeDestMedia(
       break;
     else if (mdb->size_name && !strcmp(mdb->size_name, size->media))
       break;
-    else if (mdb->width == size->width && mdb->length == size->length && mdb->bottom == size->bottom && mdb->left == size->left && mdb->right == size->right && mdb->top == size->top)
-      break;
+  }
+
+  if (!mdb)
+  {
+    for (mdb = (_cups_media_db_t *)cupsArrayFirst(db); mdb; mdb = (_cups_media_db_t *)cupsArrayNext(db))
+    {
+      if (mdb->width == size->width && mdb->length == size->length && mdb->bottom == size->bottom && mdb->left == size->left && mdb->right == size->right && mdb->top == size->top)
+       break;
+    }
   }
 
   if (mdb)
   {
+    DEBUG_printf(("1cupsLocalizeDestMedia: MATCH mdb%p [key=\"%s\" size_name=\"%s\" source=\"%s\" type=\"%s\" width=%d length=%d B%d L%d R%d T%d]", mdb, mdb->key, mdb->size_name, mdb->source, mdb->type, mdb->width, mdb->length, mdb->bottom, mdb->left, mdb->right, mdb->top));
+
     lsource = cupsLocalizeDestValue(http, dest, dinfo, "media-source", mdb->source);
     ltype   = cupsLocalizeDestValue(http, dest, dinfo, "media-type", mdb->type);
   }