]> git.tokkee.org Git - inkscape.git/commitdiff

Code

Fixed crash when doing a boolean union when nothing is selected.
authorjohanengelen <johanengelen@users.sourceforge.net>
Sun, 7 Jan 2007 16:49:07 +0000 (16:49 +0000)
committerjohanengelen <johanengelen@users.sourceforge.net>
Sun, 7 Jan 2007 16:49:07 +0000 (16:49 +0000)
src/splivarot.cpp

index 1d0e4e7dfc446b3ba41b5fb41e4a92deb1fd8504..f4f43fd490067fd071a32f5cf5f269804431d768 100644 (file)
@@ -103,13 +103,18 @@ sp_selected_path_boolop(bool_op bop, const unsigned int verb, const Glib::ustrin
     SPDesktop *desktop = SP_ACTIVE_DESKTOP;
 
     Inkscape::Selection *selection = sp_desktop_selection(desktop);
-
+    
     GSList *il = (GSList *) selection->itemList();
-
-    if (g_slist_length(il) < 2 && bop != bool_op_union) {
+    
+    // allow union on a single object for the purpose of removing self overlapse (svn log, revision 13334)
+    if ( (g_slist_length(il) < 2) && (bop != bool_op_union)) {
         desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Select <b>at least 2 paths</b> to perform a boolean operation."));
         return;
     }
+    else if ( g_slist_length(il) < 1 ) {
+        desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Select <b>at least 1 path</b> to perform a boolean union."));
+        return;
+    }
 
     if (g_slist_length(il) > 2) {
         if (bop == bool_op_diff || bop == bool_op_symdiff || bop == bool_op_cut || bop == bool_op_slice ) {