From 631b310516dc651c441bd6c03439479cd91a6a9a Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 7 Jan 2007 16:49:07 +0000 Subject: Fixed crash when doing a boolean union when nothing is selected. (bzr r2145) --- src/splivarot.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/splivarot.cpp b/src/splivarot.cpp index 1d0e4e7df..f4f43fd49 100644 --- a/src/splivarot.cpp +++ b/src/splivarot.cpp @@ -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 at least 2 paths to perform a boolean operation.")); return; } + else if ( g_slist_length(il) < 1 ) { + desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Select at least 1 path 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 ) { -- cgit v1.2.3