[gimp/metadata-browser] file-ps: Change list of ifs to switch



commit dcb9ee830af5d893fcba3ec403de7152826a4c59
Author: Mukund Sivaraman <muks banu com>
Date:   Mon Oct 10 09:56:32 2011 +0530

    file-ps: Change list of ifs to switch

 plug-ins/common/file-ps.c |   21 +++++++++++++++------
 1 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/plug-ins/common/file-ps.c b/plug-ins/common/file-ps.c
index 0aa75f7..f985b7f 100644
--- a/plug-ins/common/file-ps.c
+++ b/plug-ins/common/file-ps.c
@@ -1221,12 +1221,21 @@ save_image (const gchar  *filename,
 
   save_ps_header (ofp, filename);
 
-  if (drawable_type == GIMP_GRAY_IMAGE)
-    retval = save_gray (ofp, image_ID, drawable_ID);
-  else if (drawable_type == GIMP_INDEXED_IMAGE)
-    retval = save_index (ofp, image_ID, drawable_ID);
-  else if (drawable_type == GIMP_RGB_IMAGE)
-    retval = save_rgb (ofp, image_ID, drawable_ID);
+  switch (drawable_type)
+    {
+    case GIMP_INDEXED_IMAGE:
+      retval = save_index (ofp, image_ID, drawable_ID);
+      break;
+    case GIMP_GRAY_IMAGE:
+      retval = save_gray (ofp, image_ID, drawable_ID);
+      break;
+    case GIMP_RGB_IMAGE:
+      retval = save_rgb (ofp, image_ID, drawable_ID);
+      break;
+    default:
+      g_message (_("Cannot operate on unknown image types."));
+      retval = FALSE;
+    }
 
   save_ps_trailer (ofp);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]