From dcf765f3dcbff2e65428e0f002bb5ea3648940f0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 25 Jun 2011 15:35:01 +0000 Subject: warning cleanup (no functional changes) - enclose && / || with brackets to avoid ambiguity. - don't cast from booleans to pointers. (bzr r10359) --- src/extension/effect.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/extension/effect.cpp') diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index 51aa42da6..e01eb760a 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -324,7 +324,7 @@ Effect::set_last_effect (Effect * in_effect) Inkscape::XML::Node * Effect::find_menu (Inkscape::XML::Node * menustruct, const gchar *name) { - if (menustruct == NULL) return false; + if (menustruct == NULL) return NULL; for (Inkscape::XML::Node * child = menustruct; child != NULL; child = child->next()) { -- cgit v1.2.3 From be7df18d6aef42dd657426b6a9d30834e5f54ca6 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 28 Aug 2011 21:18:21 +0200 Subject: Remove nr-object.h and nr-macros.h (bzr r10582.1.10) --- src/extension/effect.cpp | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'src/extension/effect.cpp') diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index e01eb760a..b42caca06 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -355,21 +355,15 @@ Effect::set_pref_dialog (PrefDialog * prefdialog) return; } -/** \brief Create an action for a \c EffectVerb - \param view Which view the action should be created for - \return The built action. - - Calls \c make_action_helper with the \c vector. -*/ SPAction * Effect::EffectVerb::make_action (Inkscape::UI::View::View * view) { - return make_action_helper(view, &vector, static_cast(this)); + return make_action_helper(view, &perform, static_cast(this)); } /** \brief Decode the verb code and take appropriate action */ void -Effect::EffectVerb::perform( SPAction *action, void * data, void */*pdata*/ ) +Effect::EffectVerb::perform( SPAction *action, void * data ) { Inkscape::UI::View::View * current_view = sp_action_get_view(action); // SPDocument * current_document = current_view->doc; @@ -388,14 +382,6 @@ Effect::EffectVerb::perform( SPAction *action, void * data, void */*pdata*/ ) return; } -/** - * Action vector to define functions called if a staticly defined file verb - * is called. - */ -SPActionEventVector Effect::EffectVerb::vector = - {{NULL}, Effect::EffectVerb::perform, NULL, NULL, NULL, NULL}; - - } } /* namespace Inkscape, Extension */ /* -- cgit v1.2.3 From 1937d8b83734173f61d1a620c7431f7e692ae88f Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Fri, 28 Oct 2011 22:04:48 +0200 Subject: fix potential null pointer deref (bzr r10702) --- src/extension/effect.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'src/extension/effect.cpp') diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index b42caca06..4f87e98cd 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -296,18 +296,20 @@ Effect::effect (Inkscape::UI::View::View * doc) void Effect::set_last_effect (Effect * in_effect) { - gchar const * verb_id = in_effect->get_verb()->get_id(); - gchar const * help_id_prefix = "org.inkscape.help."; - - // We don't want these "effects" to register as the last effect, - // this wouldn't be helpful to the user who selects a real effect, - // then goes to the help file (implemented as an effect), then goes - // back to the effect, only to see it written over by the help file - // selection. - - // This snippet should fix this bug: - // https://bugs.launchpad.net/inkscape/+bug/600671 - if (strncmp(verb_id, help_id_prefix, strlen(help_id_prefix)) == 0) return; + if (in_effect) { + gchar const * verb_id = in_effect->get_verb()->get_id(); + gchar const * help_id_prefix = "org.inkscape.help."; + + // We don't want these "effects" to register as the last effect, + // this wouldn't be helpful to the user who selects a real effect, + // then goes to the help file (implemented as an effect), then goes + // back to the effect, only to see it written over by the help file + // selection. + + // This snippet should fix this bug: + // https://bugs.launchpad.net/inkscape/+bug/600671 + if (strncmp(verb_id, help_id_prefix, strlen(help_id_prefix)) == 0) return; + } if (in_effect == NULL) { Inkscape::Verb::get(SP_VERB_EFFECT_LAST)->sensitive(NULL, false); -- cgit v1.2.3