From eedaac6439c0c4edb489643335fcfc003607bf08 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Fri, 4 Oct 2013 22:24:32 +0200 Subject: LPE: add some const correctness, remove unused function, and fix potential crash bug (bzr r12656) --- src/live_effects/lpeobject.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/live_effects') diff --git a/src/live_effects/lpeobject.h b/src/live_effects/lpeobject.h index 534a12897..9700024fe 100644 --- a/src/live_effects/lpeobject.h +++ b/src/live_effects/lpeobject.h @@ -39,6 +39,7 @@ public: /* Note that the returned pointer can be NULL in a valid LivePathEffectObject contained in a valid list of lpeobjects in an lpeitem! * So one should always check whether the returned value is NULL or not */ Inkscape::LivePathEffect::Effect * get_lpe() { return lpe; }; + Inkscape::LivePathEffect::Effect const * get_lpe() const { return lpe; }; Inkscape::LivePathEffect::Effect *lpe; // this can be NULL in a valid LivePathEffectObject -- cgit v1.2.3 From c3f52c8e52a39fa94964ca9902b1884537d274bd Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Fri, 4 Oct 2013 22:26:40 +0200 Subject: fix hiding overloaded virtual (bzr r12657) --- src/live_effects/lpe-copy_rotate.cpp | 2 +- src/live_effects/lpe-copy_rotate.h | 2 +- src/live_effects/lpe-knot.cpp | 2 +- src/live_effects/lpe-knot.h | 2 +- src/live_effects/lpe-vonkoch.cpp | 2 +- src/live_effects/lpe-vonkoch.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/live_effects') diff --git a/src/live_effects/lpe-copy_rotate.cpp b/src/live_effects/lpe-copy_rotate.cpp index c1b72c3c7..65bbcdad1 100644 --- a/src/live_effects/lpe-copy_rotate.cpp +++ b/src/live_effects/lpe-copy_rotate.cpp @@ -115,7 +115,7 @@ LPECopyRotate::doEffect_pwd2 (Geom::Piecewise > const & p } void -LPECopyRotate::addCanvasIndicators(SPLPEItem */*lpeitem*/, std::vector &hp_vec) +LPECopyRotate::addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector &hp_vec) { using namespace Geom; diff --git a/src/live_effects/lpe-copy_rotate.h b/src/live_effects/lpe-copy_rotate.h index 1354b980a..ca7aa269c 100644 --- a/src/live_effects/lpe-copy_rotate.h +++ b/src/live_effects/lpe-copy_rotate.h @@ -41,7 +41,7 @@ public: void addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item); protected: - virtual void addCanvasIndicators(SPLPEItem *lpeitem, std::vector &hp_vec); + virtual void addCanvasIndicators(SPLPEItem const *lpeitem, std::vector &hp_vec); private: ScalarParam starting_angle; diff --git a/src/live_effects/lpe-knot.cpp b/src/live_effects/lpe-knot.cpp index 27652bf0c..8fec69958 100644 --- a/src/live_effects/lpe-knot.cpp +++ b/src/live_effects/lpe-knot.cpp @@ -588,7 +588,7 @@ LPEKnot::doBeforeEffect (SPLPEItem const* lpeitem) } void -LPEKnot::addCanvasIndicators(SPLPEItem */*lpeitem*/, std::vector &hp_vec) +LPEKnot::addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector &hp_vec) { using namespace Geom; double r = switcher_size*.1; diff --git a/src/live_effects/lpe-knot.h b/src/live_effects/lpe-knot.h index a25607981..b937f9021 100644 --- a/src/live_effects/lpe-knot.h +++ b/src/live_effects/lpe-knot.h @@ -64,7 +64,7 @@ public: void addKnotHolderEntities(KnotHolder *knotholder, SPDesktop *desktop, SPItem *item); protected: - virtual void addCanvasIndicators(SPLPEItem *lpeitem, std::vector &hp_vec); + virtual void addCanvasIndicators(SPLPEItem const *lpeitem, std::vector &hp_vec); private: void updateSwitcher(); diff --git a/src/live_effects/lpe-vonkoch.cpp b/src/live_effects/lpe-vonkoch.cpp index f7b2beeba..c0050fa60 100644 --- a/src/live_effects/lpe-vonkoch.cpp +++ b/src/live_effects/lpe-vonkoch.cpp @@ -176,7 +176,7 @@ LPEVonKoch::doEffect_path (std::vector const & path_in) //Usefull?? //void -//LPEVonKoch::addCanvasIndicators(SPLPEItem */*lpeitem*/, std::vector &hp_vec) +//LPEVonKoch::addCanvasIndicators(SPLPEItem const */*lpeitem*/, std::vector &hp_vec) /*{ using namespace Geom; if (draw_boxes.get_value()){ diff --git a/src/live_effects/lpe-vonkoch.h b/src/live_effects/lpe-vonkoch.h index 2ea7c8169..7dff2be52 100644 --- a/src/live_effects/lpe-vonkoch.h +++ b/src/live_effects/lpe-vonkoch.h @@ -57,7 +57,7 @@ public: //Usefull?? // protected: - //virtual void addCanvasIndicators(SPLPEItem *lpeitem, std::vector &hp_vec); + //virtual void addCanvasIndicators(SPLPEItem const *lpeitem, std::vector &hp_vec); private: ScalarParam nbgenerations; -- cgit v1.2.3 From 4f857ae84089672e9c7378d327e54889f64c62fb Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Fri, 4 Oct 2013 23:57:28 +0200 Subject: C++ (bzr r12660) --- src/live_effects/effect.cpp | 2 +- src/live_effects/effect.h | 2 +- src/live_effects/lpeobject.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/live_effects') diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index 105fdea32..623879ac5 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -270,7 +270,7 @@ void Effect::createAndApply(const char* name, SPDocument *doc, SPItem *item) Inkscape::GC::release(repr); gchar *href = g_strdup_printf("#%s", repr_id); - sp_lpe_item_add_path_effect(SP_LPE_ITEM(item), href, true); + SP_LPE_ITEM(item)->addPathEffect(href, true); g_free(href); } diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h index f7a7155b0..b9d86628f 100644 --- a/src/live_effects/effect.h +++ b/src/live_effects/effect.h @@ -66,7 +66,7 @@ public: /* * isReady() indicates whether all preparations which are necessary to apply the LPE are done, * e.g., waiting for a parameter path either before the effect is created or when it needs a - * path as argument. This is set in sp_lpe_item_add_path_effect(). + * path as argument. This is set in SPLPEItem::addPathEffect(). */ inline bool isReady() const { return is_ready; } inline void setReady(bool ready = true) { is_ready = ready; } diff --git a/src/live_effects/lpeobject.cpp b/src/live_effects/lpeobject.cpp index d61f2b2fa..d92c94d01 100644 --- a/src/live_effects/lpeobject.cpp +++ b/src/live_effects/lpeobject.cpp @@ -181,7 +181,7 @@ livepatheffect_on_repr_attr_changed ( Inkscape::XML::Node * /*repr*/, /** * If this has other users, create a new private duplicate and return it * returns 'this' when no forking was necessary (and therefore no duplicate was made) - * Check out sp_lpe_item_fork_path_effects_if_necessary ! + * Check out SPLPEItem::forkPathEffectsIfNecessary ! */ LivePathEffectObject *LivePathEffectObject::fork_private_if_necessary(unsigned int nr_of_allowed_users) { -- cgit v1.2.3