Code

Merge and cleanup of GSoC C++-ification project.
[inkscape.git] / src / extension / effect.cpp
index afc0668a9eb967eff6dbe7429b2281903a4198b6..51aa42da67fe8699770247393ed1931f235e7572 100644 (file)
@@ -1,6 +1,7 @@
 /*
  * Authors:
  *   Ted Gould <ted@gould.cx>
+ *   Abhishek Sharma
  *
  * Copyright (C) 2002-2007 Authors
  *
@@ -258,7 +259,7 @@ Effect::prefs (Inkscape::UI::View::View * doc)
     This function first insures that the extension is loaded, and if not,
     loads it.  It then calls the implemention to do the actual work.  It
     also resets the last effect pointer to be this effect.  Finally, it
-    executes a \c sp_document_done to commit the changes to the undo
+    executes a \c SPDocumentUndo::done to commit the changes to the undo
     stack.
 */
 void
@@ -295,6 +296,19 @@ 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 == NULL) {
         Inkscape::Verb::get(SP_VERB_EFFECT_LAST)->sensitive(NULL, false);
         Inkscape::Verb::get(SP_VERB_EFFECT_LAST_PREF)->sensitive(NULL, false);