Code

Fix for bug LP #383244 (patch by Hannes Hochreiner)
authorJazzyNico <JazzyNico@users.sourceforge.net>
Wed, 29 Jul 2009 19:46:17 +0000 (19:46 +0000)
committerJazzyNico <JazzyNico@users.sourceforge.net>
Wed, 29 Jul 2009 19:46:17 +0000 (19:46 +0000)
src/ui/dialog/document-properties.cpp

index bb9ab4d02676343fb26ced97b0d0841e4530a19f..423778276e8fd32752bbe40a0909b0e6225882a3 100644 (file)
@@ -653,7 +653,7 @@ void DocumentProperties::removeExternalScript(){
     while ( current ) {
         SPObject* obj = SP_OBJECT(current->data);
         SPScript* script = (SPScript*) obj;
-        if (!name.compare(script->xlinkhref)){
+        if (name == script->xlinkhref){
             sp_repr_unparent(obj->repr);
             sp_document_done(SP_ACTIVE_DOCUMENT, SP_VERB_EDIT_REMOVE_EXTERNAL_SCRIPT, _("Remove external script"));
         }
@@ -671,8 +671,12 @@ void DocumentProperties::populate_external_scripts_box(){
     while ( current ) {
         SPObject* obj = SP_OBJECT(current->data);
         SPScript* script = (SPScript*) obj;
-        Gtk::TreeModel::Row row = *(_ExternalScriptsListStore->append());
-        row[_ExternalScriptsListColumns.filenameColumn] = script->xlinkhref;
+        if (script->xlinkhref)
+        {
+            Gtk::TreeModel::Row row = *(_ExternalScriptsListStore->append());
+            row[_ExternalScriptsListColumns.filenameColumn] = script->xlinkhref;
+        }
+
         current = g_slist_next(current);
     }
 }