summaryrefslogtreecommitdiffstats
path: root/src/nodepath.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2009-03-19 23:26:11 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2009-03-19 23:26:11 +0000
commit814e487998159f3b7125935fde6b078de2280dc4 (patch)
treeca878a51a44fa25806b840ab4122d13032daee3b /src/nodepath.cpp
parentfix crash when undoing LPE path param edit just after the edit. (diff)
downloadinkscape-814e487998159f3b7125935fde6b078de2280dc4.tar.gz
inkscape-814e487998159f3b7125935fde6b078de2280dc4.zip
tidy up SPObjects that must always be LivePathEffectObjects
(bzr r7526)
Diffstat (limited to 'src/nodepath.cpp')
-rw-r--r--src/nodepath.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nodepath.cpp b/src/nodepath.cpp
index 1899f7978..b59a2d865 100644
--- a/src/nodepath.cpp
+++ b/src/nodepath.cpp
@@ -248,10 +248,16 @@ sp_nodepath_destroy_helperpaths(Inkscape::NodePath::Path *np) {
/**
* \brief Creates new nodepath from item
*
+ * If repr_key_in is not NULL, object *has* to be a LivePathEffectObject !
+ *
* \todo create proper constructor for nodepath::path, this method returns null a constructor cannot so this cannot be simply converted to constructor.
*/
Inkscape::NodePath::Path *sp_nodepath_new(SPDesktop *desktop, SPObject *object, bool show_handles, const char * repr_key_in, SPItem *item)
{
+ if (repr_key_in) {
+ g_assert(IS_LIVEPATHEFFECT(object));
+ }
+
Inkscape::XML::Node *repr = object->repr;
/** \todo
@@ -328,7 +334,7 @@ Inkscape::NodePath::Path *sp_nodepath_new(SPDesktop *desktop, SPObject *object,
np->d2i = np->i2d.inverse();
np->repr = repr;
- if (repr_key_in) { // apparently the object is an LPEObject (this is a dirty check, hopefully nobody tries feeding non-lpeobjects into this method with non-null repr_key_in)
+ if (repr_key_in) { // apparently the object is an LPEObject
np->repr_key = g_strdup(repr_key_in);
np->repr_nodetypes_key = g_strconcat(np->repr_key, "-nodetypes", NULL);
Inkscape::LivePathEffect::Effect * lpe = LIVEPATHEFFECT(object)->get_lpe();