summaryrefslogtreecommitdiffstats
path: root/src/selection-chemistry.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2013-09-25 21:51:52 +0000
committerJohan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>2013-09-25 21:51:52 +0000
commit96190a607cf8edbcb8d4d2f88f0e451cf6abfa83 (patch)
tree23926255835e7dba58563cfa2ef818abd528d43e /src/selection-chemistry.cpp
parentpatch by Tomasz Boczkowski for missing Windows icon (Bug 1228591) (diff)
downloadinkscape-96190a607cf8edbcb8d4d2f88f0e451cf6abfa83.tar.gz
inkscape-96190a607cf8edbcb8d4d2f88f0e451cf6abfa83.zip
C++ify calling a few SPLPEItem functions, much more work than expected... slowly slowly...
(bzr r12593)
Diffstat (limited to 'src/selection-chemistry.cpp')
-rw-r--r--src/selection-chemistry.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index 64ecd6e04..8a414eb4b 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -1182,9 +1182,10 @@ void sp_selection_paste_livepatheffect(SPDesktop *desktop)
static void sp_selection_remove_livepatheffect_impl(SPItem *item)
{
- if ( item && SP_IS_LPE_ITEM(item) &&
- sp_lpe_item_has_path_effect(SP_LPE_ITEM(item))) {
- sp_lpe_item_remove_all_path_effects(SP_LPE_ITEM(item), false);
+ if ( SPLPEItem *lpeitem = dynamic_cast<SPLPEItem*>(item) ) {
+ if ( lpeitem->hasPathEffect() ) {
+ sp_lpe_item_remove_all_path_effects(SP_LPE_ITEM(item), false);
+ }
}
}
@@ -2318,9 +2319,9 @@ void sp_selection_next_patheffect_param(SPDesktop * dt)
Inkscape::Selection *selection = sp_desktop_selection(dt);
if ( selection && !selection->isEmpty() ) {
SPItem *item = selection->singleItem();
- if ( item && SP_IS_SHAPE(item)) {
- if (sp_lpe_item_has_path_effect(SP_LPE_ITEM(item))) {
- sp_lpe_item_edit_next_param_oncanvas(SP_LPE_ITEM(item), dt);
+ if ( SPLPEItem *lpeitem = dynamic_cast<SPLPEItem*>(item) ) {
+ if (lpeitem->hasPathEffect()) {
+ sp_lpe_item_edit_next_param_oncanvas(lpeitem, dt);
} else {
dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("The selection has no applied path effect."));
}
@@ -2679,7 +2680,7 @@ sp_select_clone_original(SPDesktop *desktop)
original = SP_FLOWTEXT(item)->get_frame(NULL); // first frame only
} else if (SP_IS_LPE_ITEM(item)) {
// check if the applied LPE is Clone original, if so, go to the refered path
- Inkscape::LivePathEffect::Effect* lpe = sp_lpe_item_has_path_effect_of_type(SP_LPE_ITEM(item), Inkscape::LivePathEffect::CLONE_ORIGINAL);
+ Inkscape::LivePathEffect::Effect* lpe = SP_LPE_ITEM(item)->getPathEffectOfType(Inkscape::LivePathEffect::CLONE_ORIGINAL);
if (lpe) {
Inkscape::LivePathEffect::Parameter *lpeparam = lpe->getParameter("linkedpath");
if (Inkscape::LivePathEffect::OriginalPathParam *pathparam = dynamic_cast<Inkscape::LivePathEffect::OriginalPathParam *>(lpeparam)) {