From 1c75594f5c37e86dec195ec1975254315ef180e9 Mon Sep 17 00:00:00 2001 From: Eric Greveson Date: Wed, 3 Jul 2013 23:00:06 +0100 Subject: Changed dbus interface to treat 'division' like other boolops, with a new return type for selection_combine to support this (array of string). This also fixes a bug with not setting the error flag when returning NULL from this method. Refactored some more selection verbs to allow use in no-GUI mode. (bzr r12387.1.5) --- src/extension/dbus/document-interface.cpp | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'src/extension/dbus/document-interface.cpp') diff --git a/src/extension/dbus/document-interface.cpp b/src/extension/dbus/document-interface.cpp index f0cc71de1..87b769e26 100644 --- a/src/extension/dbus/document-interface.cpp +++ b/src/extension/dbus/document-interface.cpp @@ -1222,13 +1222,11 @@ document_interface_selection_invert (DocumentInterface *object, GError **error) gboolean document_interface_selection_group (DocumentInterface *object, GError **error) { - //sp_selection_group (object->desk); return dbus_call_verb (object, SP_VERB_SELECTION_GROUP, error); } gboolean document_interface_selection_ungroup (DocumentInterface *object, GError **error) { - //sp_selection_ungroup (object->desk); return dbus_call_verb (object, SP_VERB_SELECTION_UNGROUP, error); } @@ -1362,8 +1360,8 @@ document_interface_selection_to_path (DocumentInterface *object, GError **error) } -gchar * -document_interface_selection_combine (DocumentInterface *object, gchar *cmd, +gboolean +document_interface_selection_combine (DocumentInterface *object, gchar *cmd, char ***newpaths, GError **error) { if (strcmp(cmd, "union") == 0) @@ -1374,20 +1372,14 @@ document_interface_selection_combine (DocumentInterface *object, gchar *cmd, dbus_call_verb (object, SP_VERB_SELECTION_DIFF, error); else if (strcmp(cmd, "exclusion") == 0) dbus_call_verb (object, SP_VERB_SELECTION_SYMDIFF, error); - else - return NULL; - - if (object->context.getSelection()->singleRepr() != NULL) - return g_strdup(object->context.getSelection()->singleRepr()->attribute("id")); - return NULL; -} - -gboolean -document_interface_selection_divide (DocumentInterface *object, char ***out, GError **error) -{ - dbus_call_verb (object, SP_VERB_SELECTION_CUT, error); + else if (strcmp(cmd, "division") == 0) + dbus_call_verb (object, SP_VERB_SELECTION_CUT, error); + else { + g_set_error(error, INKSCAPE_ERROR, INKSCAPE_ERROR_OTHER, "Operation command not recognised"); + return FALSE; + } - return document_interface_selection_get (object, out, error); + return document_interface_selection_get (object, newpaths, error); } gboolean -- cgit v1.2.3