summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2008-03-28 19:48:22 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2008-03-28 19:48:22 +0000
commit3e43c57c9571cfd07cfc582f4129fbec99e15c12 (patch)
treecb93ad69e04880f04e42ece73e2690f5aff2b361 /src
parentand two more files that were missed in lpe-group commit (diff)
downloadinkscape-3e43c57c9571cfd07cfc582f4129fbec99e15c12.tar.gz
inkscape-3e43c57c9571cfd07cfc582f4129fbec99e15c12.zip
fix lpe-PathPAram when deleting the path that it links to
fix ClipboardManager to construct the svgd from pathvector instead of obtaining the string from PathParam which can be a href instead of svgd (bzr r5222)
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/parameter/path.cpp18
-rw-r--r--src/live_effects/parameter/path.h1
-rw-r--r--src/ui/clipboard.cpp3
3 files changed, 19 insertions, 3 deletions
diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp
index be26006c7..d7237e54b 100644
--- a/src/live_effects/parameter/path.cpp
+++ b/src/live_effects/parameter/path.cpp
@@ -205,6 +205,7 @@ PathParam::param_editOncanvas(SPItem * item, SPDesktop * dt)
shape_editor->set_item_lpe_path_parameter(item, SP_OBJECT(param_effect->getLPEObj()), param_key.c_str());
} else {
// set referred item for editing
+ shape_editor->set_item(ref.getObject());
}
}
@@ -242,6 +243,18 @@ PathParam::param_set_and_write_new_value (Geom::Piecewise<Geom::D2<Geom::SBasis>
}
void
+PathParam::param_set_and_write_new_value (std::vector<Geom::Path> const & newpath)
+{
+ remove_link();
+ _pathvector = newpath;
+ must_recalculate_pwd2 = true;
+
+ gchar * svgd = SVGD_from_2GeomPath( _pathvector );
+ param_write_to_repr(svgd);
+ g_free(svgd);
+}
+
+void
PathParam::ensure_pwd2()
{
if (must_recalculate_pwd2) {
@@ -294,8 +307,9 @@ PathParam::remove_link()
void
PathParam::linked_delete(SPObject */*deleted*/)
{
-// don't know what to do yet. not acting probably crashes inkscape.
- g_message("PathParam::linked_delete");
+ quit_listening();
+ remove_link();
+ param_set_and_write_new_value (_pathvector);
}
void
diff --git a/src/live_effects/parameter/path.h b/src/live_effects/parameter/path.h
index 1f2be32c8..d72b4b7fe 100644
--- a/src/live_effects/parameter/path.h
+++ b/src/live_effects/parameter/path.h
@@ -43,6 +43,7 @@ public:
void param_set_default();
void param_set_and_write_default();
void param_set_and_write_new_value (Geom::Piecewise<Geom::D2<Geom::SBasis> > const & newpath);
+ void param_set_and_write_new_value (std::vector<Geom::Path> const & newpath);
virtual void param_editOncanvas(SPItem * item, SPDesktop * dt);
virtual void param_setup_nodepath(Inkscape::NodePath::Path *np);
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index 842f10d52..4ee838708 100644
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
@@ -73,6 +73,7 @@
#include "text-context.h"
#include "text-editing.h"
#include "tools-switch.h"
+#include "live_effects/n-art-bpath-2geom.h"
/// @brief Made up mimetype to represent Gdk::Pixbuf clipboard contents
#define CLIPBOARD_GDK_PIXBUF_TARGET "image/x-gdk-pixbuf"
@@ -223,7 +224,7 @@ void ClipboardManagerImpl::copy()
void ClipboardManagerImpl::copyPathParameter(Inkscape::LivePathEffect::PathParam *pp)
{
if ( pp == NULL ) return;
- gchar *svgd = pp->param_writeSVGValue();
+ gchar *svgd = SVGD_from_2GeomPath( pp->get_pathvector() );
if ( svgd == NULL || *svgd == '\0' ) return;
_discardInternalClipboard();