summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/livepatheffect-editor.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-11-15 17:29:41 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-11-15 17:29:41 +0000
commita5333b6abc807176319c96d66cb7111e70f4896f (patch)
tree5d835204a110f9fa328e96919078edf83af69784 /src/ui/dialog/livepatheffect-editor.cpp
parentSix a bug on subpaths pointed by suv (diff)
downloadinkscape-a5333b6abc807176319c96d66cb7111e70f4896f.tar.gz
inkscape-a5333b6abc807176319c96d66cb7111e70f4896f.zip
ignore this commit
(bzr r13682.1.9)
Diffstat (limited to 'src/ui/dialog/livepatheffect-editor.cpp')
-rw-r--r--src/ui/dialog/livepatheffect-editor.cpp35
1 files changed, 25 insertions, 10 deletions
diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp
index eb3857ee7..e9c012ff5 100644
--- a/src/ui/dialog/livepatheffect-editor.cpp
+++ b/src/ui/dialog/livepatheffect-editor.cpp
@@ -292,8 +292,11 @@ LivePathEffectEditor::onSelectionChanged(Inkscape::Selection *sel)
effectlist_store->clear();
current_lpeitem = NULL;
- if ( sel && !sel->isEmpty() ) {
- SPItem *item = sel->singleItem();
+ if ( sel && (sel->isEmpty() || sel->singleItem())) {
+ SPItem * item= SP_ITEM(current_desktop->currentRoot());
+ if(!sel->isEmpty()){
+ item = sel->singleItem();
+ }
if ( item ) {
SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(item);
if ( lpeitem ) {
@@ -422,8 +425,11 @@ void
LivePathEffectEditor::onAdd()
{
Inkscape::Selection *sel = _getSelection();
- if ( sel && !sel->isEmpty() ) {
- SPItem *item = sel->singleItem();
+ if ( sel && (sel->isEmpty() || sel->singleItem())) {
+ SPItem * item= SP_ITEM(current_desktop->currentRoot());
+ if(!sel->isEmpty()){
+ item = sel->singleItem();
+ }
if (item) {
if ( dynamic_cast<SPLPEItem *>(item) ) {
// show effectlist dialog
@@ -500,8 +506,11 @@ void
LivePathEffectEditor::onRemove()
{
Inkscape::Selection *sel = _getSelection();
- if ( sel && !sel->isEmpty() ) {
- SPItem *item = sel->singleItem();
+ if ( sel && (sel->isEmpty() || sel->singleItem())) {
+ SPItem * item= SP_ITEM(current_desktop->currentRoot());
+ if(!sel->isEmpty()){
+ item = sel->singleItem();
+ }
SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(item);
if ( lpeitem ) {
lpeitem->removeCurrentPathEffect(false);
@@ -518,8 +527,11 @@ LivePathEffectEditor::onRemove()
void LivePathEffectEditor::onUp()
{
Inkscape::Selection *sel = _getSelection();
- if ( sel && !sel->isEmpty() ) {
- SPItem *item = sel->singleItem();
+ if ( sel && (sel->isEmpty() || sel->singleItem())) {
+ SPItem * item= SP_ITEM(current_desktop->currentRoot());
+ if(!sel->isEmpty()){
+ item = sel->singleItem();
+ }
SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(item);
if ( lpeitem ) {
lpeitem->upCurrentPathEffect();
@@ -535,8 +547,11 @@ void LivePathEffectEditor::onUp()
void LivePathEffectEditor::onDown()
{
Inkscape::Selection *sel = _getSelection();
- if ( sel && !sel->isEmpty() ) {
- SPItem *item = sel->singleItem();
+ if ( sel && (sel->isEmpty() || sel->singleItem())) {
+ SPItem * item= SP_ITEM(current_desktop->currentRoot());
+ if(!sel->isEmpty()){
+ item = sel->singleItem();
+ }
SPLPEItem *lpeitem = dynamic_cast<SPLPEItem *>(item);
if ( lpeitem ) {
lpeitem->downCurrentPathEffect();