[gimp] pdb: add missing breaks in switch() so we don't always pattern-fill



commit 439c5a7814561fb5fbaaef372acc732829450ceb
Author: Michael Natterer <mitch gimp org>
Date:   Thu May 17 21:56:05 2012 +0200

    pdb: add missing breaks in switch() so we don't always pattern-fill

 app/pdb/edit-cmds.c       |   16 ++++++++++++----
 tools/pdbgen/pdb/edit.pdb |   16 ++++++++++++----
 2 files changed, 24 insertions(+), 8 deletions(-)
---
diff --git a/app/pdb/edit-cmds.c b/app/pdb/edit-cmds.c
index 5f785c2..8077253 100644
--- a/app/pdb/edit-cmds.c
+++ b/app/pdb/edit-cmds.c
@@ -593,13 +593,21 @@ edit_bucket_fill_invoker (GimpProcedure      *procedure,
 
           if (! gimp_channel_is_empty (gimp_image_get_mask (image)))
             {
-              GimpFillType fill_type;
+              GimpFillType fill_type = GIMP_FG_BUCKET_FILL;
 
               switch (fill_mode)
                 {
-                case GIMP_FG_BUCKET_FILL:      fill_type = GIMP_FOREGROUND_FILL;
-                case GIMP_BG_BUCKET_FILL:      fill_type = GIMP_BACKGROUND_FILL;
-                case GIMP_PATTERN_BUCKET_FILL: fill_type = GIMP_PATTERN_FILL;
+                case GIMP_FG_BUCKET_FILL:
+                  fill_type = GIMP_FOREGROUND_FILL;
+                  break;
+
+                case GIMP_BG_BUCKET_FILL:
+                  fill_type = GIMP_BACKGROUND_FILL;
+                  break;
+
+                case GIMP_PATTERN_BUCKET_FILL:
+                  fill_type = GIMP_PATTERN_FILL;
+                  break;
                 }
 
               success = gimp_edit_fill (image, drawable, context, fill_type,
diff --git a/tools/pdbgen/pdb/edit.pdb b/tools/pdbgen/pdb/edit.pdb
index d39d8c0..6155ca6 100644
--- a/tools/pdbgen/pdb/edit.pdb
+++ b/tools/pdbgen/pdb/edit.pdb
@@ -633,13 +633,21 @@ HELP
 
       if (! gimp_channel_is_empty (gimp_image_get_mask (image)))
         {
-          GimpFillType fill_type;
+          GimpFillType fill_type = GIMP_FG_BUCKET_FILL;
 
           switch (fill_mode)
             {
-            case GIMP_FG_BUCKET_FILL:      fill_type = GIMP_FOREGROUND_FILL;
-            case GIMP_BG_BUCKET_FILL:      fill_type = GIMP_BACKGROUND_FILL;
-            case GIMP_PATTERN_BUCKET_FILL: fill_type = GIMP_PATTERN_FILL;
+            case GIMP_FG_BUCKET_FILL:
+              fill_type = GIMP_FOREGROUND_FILL;
+              break;
+
+            case GIMP_BG_BUCKET_FILL:
+              fill_type = GIMP_BACKGROUND_FILL;
+              break;
+
+            case GIMP_PATTERN_BUCKET_FILL:
+              fill_type = GIMP_PATTERN_FILL;
+              break;
             }
 
           success = gimp_edit_fill (image, drawable, context, fill_type,



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