summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/document-properties.cpp
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2014-04-09 10:45:20 +0000
committerJabiertxof <jtx@jtx.marker.es>2014-04-09 10:45:20 +0000
commitf0c6ea33bcb5a03352f6276bac82d56c39c3f5fe (patch)
tree28159b96674a5c003fb36948ff04f3eaae3ec864 /src/ui/dialog/document-properties.cpp
parentRefactor of end anchors. (diff)
parentMake extension tests compatible with VPATH builds. (diff)
downloadinkscape-f0c6ea33bcb5a03352f6276bac82d56c39c3f5fe.tar.gz
inkscape-f0c6ea33bcb5a03352f6276bac82d56c39c3f5fe.zip
update to trunk
(bzr r11950.1.326)
Diffstat (limited to 'src/ui/dialog/document-properties.cpp')
-rw-r--r--src/ui/dialog/document-properties.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index 67e788e21..2674efc1e 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -1236,23 +1236,16 @@ void DocumentProperties::removeEmbeddedScript(){
}
}
- const GSList *current = SP_ACTIVE_DOCUMENT->getResourceList( "script" );
- while ( current ) {
- if (current->data && SP_IS_OBJECT(current->data)) {
- SPObject* obj = SP_OBJECT(current->data);
- if (id == obj->getId()){
-
- //XML Tree being used directly here while it shouldn't be.
- Inkscape::XML::Node *repr = obj->getRepr();
- if (repr){
- sp_repr_unparent(repr);
-
- // inform the document, so we can undo
- DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_EMBEDDED_SCRIPT, _("Remove embedded script"));
- }
- }
+ SPObject* obj = SP_ACTIVE_DOCUMENT->getObjectById(id);
+ if (obj) {
+ //XML Tree being used directly here while it shouldn't be.
+ Inkscape::XML::Node *repr = obj->getRepr();
+ if (repr){
+ sp_repr_unparent(repr);
+
+ // inform the document, so we can undo
+ DocumentUndo::done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_EMBEDDED_SCRIPT, _("Remove embedded script"));
}
- current = g_slist_next(current);
}
populate_script_lists();