summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c2d3794)
raw | patch | inline | side by side (parent: c2d3794)
author | mental <mental@users.sourceforge.net> | |
Thu, 8 May 2008 13:05:51 +0000 (13:05 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Thu, 8 May 2008 13:05:51 +0000 (13:05 +0000) |
diff --git a/inkscape.desktop.in b/inkscape.desktop.in
index 648989800c9040aea0f4f30ac86bfd4f1b4eb7c2..22851c1f60891528f41a6fb00164ae83c1a1861a 100644 (file)
--- a/inkscape.desktop.in
+++ b/inkscape.desktop.in
[Desktop Entry]
+Version=1.0
+Encoding=UTF-8
+Name=No name
_Name=Inkscape Vector Graphics Editor
_Comment=Create and edit Scalable Vector Graphics images
-
-Version=1.0
-
Type=Application
Categories=Graphics;VectorGraphics;GTK;
-
MimeType=image/svg+xml;image/svg+xml-compressed;
-
-FilePattern=inkscape
+FilePattern=inkscape;
Exec=inkscape %F
TryExec=inkscape
Terminal=false
StartupNotify=true
-
Icon=inkscape
index 92da747a42db484478a219860461ef3ba18bf4ff..4424aaa1bf7b10a8cfe68997dcfb295ceece838e 100644 (file)
text = NULL;
if (spaw->hasobj && spaw->src.object) {
-
- if (!sp_repr_set_attr ( SP_OBJECT_REPR (spaw->src.object),
- spaw->attribute, text) )
- {
- /* Cannot set attribute */
- text = SP_OBJECT_REPR (spaw->src.object)->attribute(spaw->attribute);
- gtk_entry_set_text (GTK_ENTRY (spaw), text ? text : "");
- }
+
+ SP_OBJECT_REPR (spaw->src.object)->setAttribute(spaw->attribute, text, false);
sp_document_done (SP_OBJECT_DOCUMENT (spaw->src.object), SP_VERB_NONE,
_("Set attribute"));
} else if (spaw->src.repr) {
- if (!sp_repr_set_attr (spaw->src.repr, spaw->attribute, text))
- {
- /* Cannot set attribute */
- text = spaw->src.repr->attribute(spaw->attribute);
- gtk_entry_set_text (GTK_ENTRY (spaw), text ? text : "");
- }
+ spaw->src.repr->setAttribute(spaw->attribute, text, false);
/* TODO: Warning! Undo will not be flushed in given case */
}
spaw->blocked = FALSE;
text = NULL;
if (spat->hasobj && spat->src.object) {
- if (!sp_repr_set_attr ( SP_OBJECT_REPR (spat->src.object),
- spat->attributes[i], text))
- {
- /* Cannot set attribute */
- text = SP_OBJECT_REPR (spat->src.object)->attribute(spat->attributes[i]);
- gtk_entry_set_text ( GTK_ENTRY (spat->entries[i]),
- text ? text : (const gchar *) "");
- }
+ SP_OBJECT_REPR (spat->src.object)->setAttribute(spat->attributes[i], text, false);
sp_document_done (SP_OBJECT_DOCUMENT (spat->src.object), SP_VERB_NONE,
_("Set attribute"));
} else if (spat->src.repr) {
- if (!sp_repr_set_attr (spat->src.repr,
- spat->attributes[i], text))
- {
- /* Cannot set attribute */
- text = spat->src.repr->attribute(spat->attributes[i]);
- gtk_entry_set_text ( GTK_ENTRY (spat->entries[i]),
- text ? text : (const gchar *) "" );
- }
+ spat->src.repr->setAttribute(spat->attributes[i], text, false);
/* TODO: Warning! Undo will not be flushed in given case */
}
spat->blocked = FALSE;
index 1bc28b3281930f93a1dbf8f983acd335fe0bdf67..2d1b4c4b17e983baf1f8aea978e38af5dbc8e09e 100644 (file)
--- a/src/dialogs/xml-tree.cpp
+++ b/src/dialogs/xml-tree.cpp
gchar *value = gtk_text_buffer_get_text( gtk_text_view_get_buffer(attr_value),
&start, &end, TRUE );
- if (!sp_repr_set_attr(selected_repr, name, value)) {
- gchar *message = g_strdup_printf(_("Cannot set <b>%s</b>: Another element with value <b>%s</b> already exists!"), name, value);
- _message_stack->flash(Inkscape::WARNING_MESSAGE, message);
- g_free(message);
- }
+ selected_repr->setAttribute(name, value, false);
g_free(name);
g_free(value);
diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp
index b6567a012dc4847f48bcd4f0f037911aeef033b9..d43d950fb999e3a593b37ac2c539fdf72ae8ad8e 100644 (file)
--- a/src/path-chemistry.cpp
+++ b/src/path-chemistry.cpp
repr->setAttribute("clip-path", clip_path_str);
/* Rotation center */
- sp_repr_set_attr(repr, "inkscape:transform-center-x", SP_OBJECT_REPR(item)->attribute("inkscape:transform-center-x"));
- sp_repr_set_attr(repr, "inkscape:transform-center-y", SP_OBJECT_REPR(item)->attribute("inkscape:transform-center-y"));
+ repr->setAttribute("inkscape:transform-center-x", SP_OBJECT_REPR(item)->attribute("inkscape:transform-center-x"), false);
+ repr->setAttribute("inkscape:transform-center-y", SP_OBJECT_REPR(item)->attribute("inkscape:transform-center-y"), false);
/* Definition */
gchar *def_str = sp_svg_write_path(SP_CURVE_BPATH(curve));
diff --git a/src/prefs-utils.cpp b/src/prefs-utils.cpp
index b2b3efeb7080c8c5a5d95cf215befd873f8178bc..a8f358fafec42904b28303b02fec191bffd10bff 100644 (file)
--- a/src/prefs-utils.cpp
+++ b/src/prefs-utils.cpp
Inkscape::XML::Node *father = inkscape_get_repr(INKSCAPE, father_path);
if (! father ) return NULL;
Inkscape::XML::Node *repr = father->document()->createElement("group");
- sp_repr_set_attr(repr, "id", child);
+ repr->setAttribute("id", child, false);
father->appendChild(repr);
return g_strdup_printf("%s.%s", father_path,child);
}
index 09c086f468a405136c93aa8fdb5842cd6888b22f..0f89464411e395c9a6235bdd24fd5d1b80b54418 100644 (file)
GSList const *l = (GSList *) selection->reprList();
while (l != NULL) {
- sp_repr_set_attr((Inkscape::XML::Node*)l->data, "transform", NULL);
+ ((Inkscape::XML::Node*)l->data)->setAttribute("transform", NULL, false);
l = l->next;
}
Inkscape::XML::Node *parent = sp_repr_parent(sel_repr);
Inkscape::XML::Node *clone = xml_doc->createElement("svg:use");
- sp_repr_set_attr(clone, "x", "0");
- sp_repr_set_attr(clone, "y", "0");
- sp_repr_set_attr(clone, "xlink:href", g_strdup_printf("#%s", sel_repr->attribute("id")));
-
- sp_repr_set_attr(clone, "inkscape:transform-center-x", sel_repr->attribute("inkscape:transform-center-x"));
- sp_repr_set_attr(clone, "inkscape:transform-center-y", sel_repr->attribute("inkscape:transform-center-y"));
+ clone->setAttribute("x", "0", false);
+ clone->setAttribute("y", "0", false);
+ clone->setAttribute("xlink:href", g_strdup_printf("#%s", sel_repr->attribute("id")), false);
+
+ clone->setAttribute("inkscape:transform-center-x", sel_repr->attribute("inkscape:transform-center-x"), false);
+ clone->setAttribute("inkscape:transform-center-y", sel_repr->attribute("inkscape:transform-center-y"), false);
// add the new clone to the top of the original's parent
parent->appendChild(clone);
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index 99d73970061b9389ebdca9848c2bb8b5814991ac..f6ddf27dfa0aae1414a756e7ddf5c2c0ac260e63 100644 (file)
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
@@ -1423,9 +1423,7 @@ sp_object_setAttribute(SPObject *object, gchar const *key, gchar const *value, S
g_return_if_fail(SP_EXCEPTION_IS_OK(ex));
/// \todo fixme: Exception if object is NULL? */
- if (!sp_repr_set_attr(object->repr, key, value)) {
- ex->code = SP_NO_MODIFICATION_ALLOWED_ERR;
- }
+ object->repr->setAttribute(key, value, false);
}
void
@@ -1435,9 +1433,7 @@ sp_object_removeAttribute(SPObject *object, gchar const *key, SPException *ex)
g_return_if_fail(SP_EXCEPTION_IS_OK(ex));
/// \todo fixme: Exception if object is NULL? */
- if (!sp_repr_set_attr(object->repr, key, NULL)) {
- ex->code = SP_NO_MODIFICATION_ALLOWED_ERR;
- }
+ object->repr->setAttribute(key, NULL, false);
}
/* Helper */
diff --git a/src/xml/repr-css.cpp b/src/xml/repr-css.cpp
index afa0ca2ef36a8b439443cc36a8f58886eca162f0..888250c4024597cde3330800dcc9351bbb72de2c 100644 (file)
--- a/src/xml/repr-css.cpp
+++ b/src/xml/repr-css.cpp
g_assert(css != NULL);
g_assert(name != NULL);
- sp_repr_set_attr((Node *) css, name, value);
+ ((Node *) css)->setAttribute(name, value, false);
}
void
g_assert(css != NULL);
g_assert(name != NULL);
- sp_repr_set_attr((Node *) css, name, "inkscape:unset");
+ ((Node *) css)->setAttribute(name, "inkscape:unset", false);
}
double
guchar *const str_value_unsigned = cr_term_to_string(decl->value);
gchar *const str_value = reinterpret_cast<gchar *>(str_value_unsigned);
gchar *value_unquoted = attribute_unquote (str_value); // libcroco returns strings quoted in ""
- sp_repr_set_attr((Node *) css, decl->property->stryng->str, value_unquoted);
+ ((Node *) css)->setAttribute(decl->property->stryng->str, value_unquoted, false);
g_free(value_unquoted);
g_free(str_value);
}
diff --git a/src/xml/repr.h b/src/xml/repr.h
index 67616df294308cdd9f09af27708d76878dd4d5d4..162451a0fb304f61c22238a7b7a4c1f831e846be 100644 (file)
--- a/src/xml/repr.h
+++ b/src/xml/repr.h
Inkscape::XML::Document *sp_repr_document_new(gchar const *rootname);
-/* Contents */
-/// Sets the node's \a key attribute to \a value.
-inline unsigned sp_repr_set_attr(Inkscape::XML::Node *repr, gchar const *key, gchar const *value,
- bool is_interactive = false) {
- repr->setAttribute(key, value, is_interactive);
- return true;
-}
-
/* Tree */
/// Returns the node's parent.
inline Inkscape::XML::Node *sp_repr_parent(Inkscape::XML::Node const *repr) {