From 99f68f7d87f36409eaaed9b8bd47832fb5f9a709 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Sun, 7 Jan 2007 16:49:07 +0000 Subject: [PATCH] Fixed crash when doing a boolean union when nothing is selected. --- src/splivarot.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 ) { -- 2.39.5