]> git.sur5r.net Git - glabels/commitdiff
2008-01-25 Jim Evins <evins@snaught.com>
authorJim Evins <evins@snaught.com>
Sat, 26 Jan 2008 01:54:42 +0000 (01:54 +0000)
committerJim Evins <evins@snaught.com>
Sat, 26 Jan 2008 01:54:42 +0000 (01:54 +0000)
* src/bc.c:
Fixed Code128C backend parameters.
* src/label-barcode.c: (get_size):
Bug #1766425.  If barcode is not renderable with either
input data or default data, use a default size.  Also
fixed small leak.

git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/branches/glabels-2_2@732 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/ChangeLog
glabels2/src/bc.c
glabels2/src/label-barcode.c

index 74862a9e3171c23b886b3f125d601f4d890f3d4e..3405a27b192f99a00bbae42500b2f6ac77d2d6c0 100644 (file)
@@ -1,3 +1,12 @@
+2008-01-25  Jim Evins  <evins@snaught.com>
+
+       * src/bc.c:
+               Fixed Code128C backend parameters.
+       * src/label-barcode.c: (get_size):
+               Bug #1766425.  If barcode is not renderable with either
+               input data or default data, use a default size.  Also
+               fixed small leak.
+
 2008-01-22  Jim Evins  <evins@snaught.com>
 
        * NEWS:
index 89de2fbbcb060f16807718284121ec145e7207bf..bcb427f5b59018dc70f444e85f40dd215d76c8d8 100644 (file)
@@ -134,7 +134,7 @@ static const Backend backends[] = {
          TRUE, TRUE, TRUE, TRUE, "0000000000", TRUE, 10},
 
        { "Code128C", N_("Code 128C"), gl_barcode_gnubarcode_new,
-         TRUE, TRUE, TRUE, TRUE, "0000000000", TRUE, 10},
+         TRUE, TRUE, TRUE, FALSE, "0000000000", TRUE, 10},
 
        { "Code128B", N_("Code 128B"), gl_barcode_gnubarcode_new,
          TRUE, TRUE, TRUE, TRUE, "0000000000", TRUE, 10},
index 9cb08043e8cb2ad679cc5ef9435f56df9cc28bbd..1901cfb1aadd5e1cee373a3e00d9d982fd14019e 100644 (file)
@@ -290,6 +290,7 @@ get_size (glLabelObject *object,
                              w_parent,
                              h_parent,
                              data);
+       g_free (data);
 
        if ( gbc == NULL ) {
                /* Try again with default digits. */
@@ -301,13 +302,22 @@ get_size (glLabelObject *object,
                                      w_parent,
                                      h_parent,
                                      data);
+                g_free (data);
        }
 
-       *w = gbc->width;
-       *h = gbc->height;
+        if ( gbc != NULL )
+        {
+                *w = gbc->width;
+                *h = gbc->height;
+        }
+        else
+        {
+                /* If we still can't render, just set a default size. */
+                *w = 144;
+                *h = 72;
+        }
 
        gl_barcode_free (&gbc);
-       g_free (data);
 
        gl_debug (DEBUG_LABEL, "END");
 }