index 079a09b5a23d120c32721e9c967682be7dab9e88..6b37b65d4bb68cfab8e7913a6967ad1089297848 100644 (file)
--- a/src/dialogs/xml-tree.cpp
+++ b/src/dialogs/xml-tree.cpp
w = prefs_get_int_attribute(prefs_path, "w", 0);
h = prefs_get_int_attribute(prefs_path, "h", 0);
}
+
+ if (x<0) x=0;
+ if (y<0) y=0;
+
if (x != 0 || y != 0) {
gtk_window_move((GtkWindow *) dlg, x, y);
} else {
NULL,
_("New element node"),
NULL,
- sp_icon_new( GTK_ICON_SIZE_LARGE_TOOLBAR,
+ sp_icon_new( Inkscape::ICON_SIZE_LARGE_TOOLBAR,
INKSCAPE_STOCK_ADD_XML_ELEMENT_NODE ),
G_CALLBACK(cmd_new_element_node),
NULL);
button = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
NULL, _("New text node"), NULL,
- sp_icon_new( GTK_ICON_SIZE_LARGE_TOOLBAR,
+ sp_icon_new( Inkscape::ICON_SIZE_LARGE_TOOLBAR,
INKSCAPE_STOCK_ADD_XML_TEXT_NODE ),
G_CALLBACK(cmd_new_text_node),
NULL);
button = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
NULL, _("Duplicate node"), NULL,
- sp_icon_new( GTK_ICON_SIZE_LARGE_TOOLBAR,
+ sp_icon_new( Inkscape::ICON_SIZE_LARGE_TOOLBAR,
INKSCAPE_STOCK_DUPLICATE_XML_NODE ),
G_CALLBACK(cmd_duplicate_node),
NULL);
button = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
NULL, _("Delete node"), NULL,
- sp_icon_new( GTK_ICON_SIZE_LARGE_TOOLBAR,
+ sp_icon_new( Inkscape::ICON_SIZE_LARGE_TOOLBAR,
INKSCAPE_STOCK_DELETE_XML_NODE ),
G_CALLBACK(cmd_delete_node), NULL );
button = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar),
NULL, _("Delete attribute"), NULL,
- sp_icon_new( GTK_ICON_SIZE_LARGE_TOOLBAR,
+ sp_icon_new( Inkscape::ICON_SIZE_LARGE_TOOLBAR,
INKSCAPE_STOCK_DELETE_XML_ATTRIBUTE ),
(GCallback) cmd_delete_attr, NULL);
}
current_desktop = desktop;
if (desktop) {
- sel_changed_connection = SP_DT_SELECTION(desktop)->connectChanged(&on_desktop_selection_changed);
+ sel_changed_connection = sp_desktop_selection(desktop)->connectChanged(&on_desktop_selection_changed);
document_replaced_connection = desktop->connectDocumentReplaced(&on_document_replaced);
- set_tree_document(SP_DT_DOCUMENT(desktop));
+ set_tree_document(sp_desktop_document(desktop));
} else {
set_tree_document(NULL);
}
return NULL;
}
- return SP_DT_SELECTION(current_desktop)->singleRepr();
+ return sp_desktop_selection(current_desktop)->singleRepr();
}
return;
}
- Inkscape::Selection *selection = SP_DT_SELECTION(current_desktop);
+ Inkscape::Selection *selection = sp_desktop_selection(current_desktop);
SPObject *object;
if (repr) {
repr = sp_repr_parent(repr);
} // end of while loop
- object = SP_DT_DOCUMENT(current_desktop)->getObjectByRepr(repr);
+ object = sp_desktop_document(current_desktop)->getObjectByRepr(repr);
} else {
object = NULL;
}
blocked++;
if ( object && in_dt_coordsys(*object)
- && !( SP_IS_TSPAN(object) ||
- SP_IS_STRING(object) ||
- SP_IS_ROOT(object) ) )
+ && !(SP_IS_STRING(object) ||
+ SP_IS_ROOT(object) ) )
{
- /* We cannot set selection to tspan, string, or root; failures and
- * crashes will occur. */
- /* TODO: when a tspan is highlighted, set selection to its parent
- * text
- */
+ /* We cannot set selection to root or string - they are not items and selection is not
+ * equipped to deal with them */
selection->set(SP_ITEM(object));
}
blocked--;
gtk_window_get_position((GtkWindow *) dlg, &x, &y);
gtk_window_get_size((GtkWindow *) dlg, &w, &h);
+ if (x<0) x=0;
+ if (y<0) y=0;
+
prefs_set_int_attribute(prefs_path, "x", x);
prefs_set_int_attribute(prefs_path, "y", y);
prefs_set_int_attribute(prefs_path, "w", w);
if (current_desktop)
sel_changed_connection.disconnect();
- sel_changed_connection = SP_DT_SELECTION(dt)->connectChanged(&on_desktop_selection_changed);
+ sel_changed_connection = sp_desktop_selection(dt)->connectChanged(&on_desktop_selection_changed);
set_tree_document(doc);
}