diff options
| author | Gail Carmichael <gail.banaszkiewicz@gmail.com> | 2007-07-17 17:39:06 +0000 |
|---|---|---|
| committer | gbanaszk <gbanaszk@users.sourceforge.net> | 2007-07-17 17:39:06 +0000 |
| commit | 65013deec0bd76a9d120769e045848b547d52a78 (patch) | |
| tree | 7e622cd36a16704dc250a494e4b0e3009dae6eea /src/selection-chemistry.cpp | |
| parent | Unfuzzied (diff) | |
| download | inkscape-65013deec0bd76a9d120769e045848b547d52a78.tar.gz inkscape-65013deec0bd76a9d120769e045848b547d52a78.zip | |
A few additions to ensure that editing trefs is not allowed (and doesn't cause a crash). Also allows all trefs within a selection to be 'unlinked'.
(bzr r3261)
Diffstat (limited to 'src/selection-chemistry.cpp')
| -rw-r--r-- | src/selection-chemistry.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index dd6ab6eb8..188ace06b 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -2122,6 +2122,18 @@ sp_selection_unlink() { SPItem *item = (SPItem *) items->data; + if (SP_IS_TEXT(item)) { + SPObject *tspan = sp_tref_convert_to_tspan(SP_OBJECT(item)); + + if (tspan) { + SP_OBJECT(item)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); + } + + // Set unlink to true, and fall into the next if which + // will include this text item in the new selection + unlinked = true; + } + if (!(SP_IS_USE(item) || SP_IS_TREF(item))) { // keep the non-use item in the new selection new_select = g_slist_prepend(new_select, item); @@ -2132,7 +2144,7 @@ sp_selection_unlink() if (SP_IS_USE(item)) { unlink = sp_use_unlink(SP_USE(item)); } else /*if (SP_IS_TREF(use))*/ { - unlink = SP_ITEM(sp_tref_convert_to_tspan(SP_TREF(item))); + unlink = SP_ITEM(sp_tref_convert_to_tspan(SP_OBJECT(item))); } unlinked = true; |
