From 60688fe72a9a75ac54d895a7aa61d3a0518ca8ab Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Fri, 7 Oct 2016 20:48:31 +0200 Subject: Fix bug:1630796 on flatten button Fixed bugs: - https://launchpad.net/bugs/1630796 (bzr r15150) --- src/widgets/pencil-toolbar.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index 582fb66ba..b177c42b4 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -50,6 +50,7 @@ #include "live_effects/lpe-powerstroke.h" #include "live_effects/lpeobject.h" #include "live_effects/lpeobject-reference.h" +#include "ui/dialog/livepatheffect-editor.h" using Inkscape::UI::UXManager; using Inkscape::UI::ToolboxFactory; @@ -242,7 +243,7 @@ static void sp_simplify_flatten(GtkWidget * /*widget*/, GObject *obj) SPLPEItem* lpeitem = dynamic_cast(*it); if (lpeitem && lpeitem->hasPathEffect()){ PathEffectList lpelist = lpeitem->getEffectList(); - std::list::iterator i; + PathEffectList::iterator i; for (i = lpelist.begin(); i != lpelist.end(); ++i) { LivePathEffectObject *lpeobj = (*i)->lpeobject; if (lpeobj) { @@ -260,7 +261,10 @@ static void sp_simplify_flatten(GtkWidget * /*widget*/, GObject *obj) lpeitem->removeCurrentPathEffect(false); shape->setCurve(c,0); } + Inkscape::UI::Dialog::LivePathEffectEditor *lpeeditor = new Inkscape::UI::Dialog::LivePathEffectEditor(); + lpeeditor->effect_list_reload(lpeitem); break; + } } } -- cgit v1.2.3 From 3fb11a7eb8d066e2b16bddb98de9b4c03e28ba56 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 8 Oct 2016 01:46:38 +0200 Subject: Fix bug:1630796 on flatten button. Attemp 2 Fixed bugs: - https://launchpad.net/bugs/1630796 (bzr r15152) --- src/widgets/pencil-toolbar.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/widgets') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index b177c42b4..c3a2ab946 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -239,8 +239,9 @@ static void sp_simplify_flatten(GtkWidget * /*widget*/, GObject *obj) { SPDesktop *desktop = static_cast(g_object_get_data(obj, "desktop")); auto selected = desktop->getSelection()->items(); + SPLPEItem* lpeitem = NULL; for (auto it(selected.begin()); it != selected.end(); ++it){ - SPLPEItem* lpeitem = dynamic_cast(*it); + lpeitem = dynamic_cast(*it); if (lpeitem && lpeitem->hasPathEffect()){ PathEffectList lpelist = lpeitem->getEffectList(); PathEffectList::iterator i; @@ -261,16 +262,17 @@ static void sp_simplify_flatten(GtkWidget * /*widget*/, GObject *obj) lpeitem->removeCurrentPathEffect(false); shape->setCurve(c,0); } - Inkscape::UI::Dialog::LivePathEffectEditor *lpeeditor = new Inkscape::UI::Dialog::LivePathEffectEditor(); - lpeeditor->effect_list_reload(lpeitem); break; - } } } } } } + if (lpeitem) { + desktop->getSelection()->remove(lpeitem->getRepr()); + desktop->getSelection()->add(lpeitem->getRepr()); + } } static void sp_pencil_tb_tolerance_value_changed(GtkAdjustment *adj, GObject *tbl) -- cgit v1.2.3 From be44e8e6202cd88cfb5b8d7e8938ae9734d27f1c Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 8 Oct 2016 01:49:29 +0200 Subject: Remove unnecesary header from last push (bzr r15153) --- src/widgets/pencil-toolbar.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp index c3a2ab946..96733cb22 100644 --- a/src/widgets/pencil-toolbar.cpp +++ b/src/widgets/pencil-toolbar.cpp @@ -50,7 +50,6 @@ #include "live_effects/lpe-powerstroke.h" #include "live_effects/lpeobject.h" #include "live_effects/lpeobject-reference.h" -#include "ui/dialog/livepatheffect-editor.h" using Inkscape::UI::UXManager; using Inkscape::UI::ToolboxFactory; -- cgit v1.2.3