summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9fb5202)
raw | patch | inline | side by side (parent: 9fb5202)
author | mental <mental@users.sourceforge.net> | |
Tue, 27 Feb 2007 15:20:01 +0000 (15:20 +0000) | ||
committer | mental <mental@users.sourceforge.net> | |
Tue, 27 Feb 2007 15:20:01 +0000 (15:20 +0000) |
diff --git a/src/document.cpp b/src/document.cpp
index 9fc6dc4dae13491a348cbecf999dbe60164a39e8..3579c4c91ffc1906ae25060816f0c804093c0d90 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
Inkscape::XML::Node *rroot;
Inkscape::Version sodipodi_version;
- rroot = sp_repr_document_root(rdoc);
+ rroot = rdoc->root();
document = new SPDocument();
rdoc = sp_repr_read_file(uri, SP_SVG_NS_URI);
/* If file cannot be loaded, return NULL without warning */
if (rdoc == NULL) return NULL;
- rroot = sp_repr_document_root(rdoc);
+ rroot = rdoc->root();
/* If xml file is not svg, return NULL without warning */
/* fixme: destroy document */
if (strcmp(rroot->name(), "svg:svg") != 0) return NULL;
@@ -390,7 +390,7 @@ sp_document_new_from_mem(gchar const *buffer, gint length, unsigned int keepaliv
/* If it cannot be loaded, return NULL without warning */
if (rdoc == NULL) return NULL;
- rroot = sp_repr_document_root(rdoc);
+ rroot = rdoc->root();
/* If xml file is not svg, return NULL without warning */
/* fixme: destroy document */
if (strcmp(rroot->name(), "svg:svg") != 0) return NULL;
index 5539e03582f2e3a772c0c86833cc15b7bd29dab1..9a097bd6e6cf37c2b0dba185e9ec5c83f371b8f3 100644 (file)
repr = sp_document_repr_root (doc);
} else {
rdoc = sp_repr_document_new ("svg:svg");
- repr = sp_repr_document_root (rdoc);
+ repr = rdoc->root();
repr = sp_document_root (doc)->updateRepr(repr, SP_OBJECT_WRITE_BUILD);
}
index 3eb9cf809d5a699a434b2806e7b21d2bb6dd6f52..0372e4aa051f242a61f7e24bcf9667fe0de82ab4 100644 (file)
--- a/src/extension/system.cpp
+++ b/src/extension/system.cpp
g_return_val_if_fail(doc != NULL, NULL);
- Inkscape::XML::Node *repr = sp_repr_document_root(doc);
+ Inkscape::XML::Node *repr = doc->root();
/* sp_repr_print(repr); */
diff --git a/src/inkscape.cpp b/src/inkscape.cpp
index 0163842747a78e1006ab92a9acc3edf023545ead..be3ff1e7d0681de8322e13501c1762cc2bd8c46f 100644 (file)
--- a/src/inkscape.cpp
+++ b/src/inkscape.cpp
@@ -658,7 +658,7 @@ inkscape_load_config (const gchar *filename, Inkscape::XML::Document *config, co
return false;
}
- Inkscape::XML::Node *root = sp_repr_document_root (doc);
+ Inkscape::XML::Node *root = doc->root();
if (strcmp (root->name(), "inkscape")) {
gchar *safeFn = Inkscape::IO::sanitizeString(fn);
GtkWidget *w = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, e_notsp, safeFn, warn);
return NULL;
}
- Inkscape::XML::Node *repr = sp_repr_document_root (Inkscape::Preferences::get());
+ Inkscape::XML::Node *repr = Inkscape::Preferences::get()->root();
if (!repr) return NULL;
g_assert (!(strcmp (repr->name(), "inkscape")));
Inkscape::XML::Node *
inkscape_get_menus (Inkscape::Application * inkscape)
{
- Inkscape::XML::Node *repr = sp_repr_document_root (inkscape->menus);
+ Inkscape::XML::Node *repr = inkscape->menus->root();
g_assert (!(strcmp (repr->name(), "inkscape")));
return repr->firstChild();
}
diff --git a/src/interface.cpp b/src/interface.cpp
index bf9b481ee2174d94987f826d7b828f7b7e557821..83f4ac3c8ffdc6708a4deb26e44a06be23fcebd0 100644 (file)
--- a/src/interface.cpp
+++ b/src/interface.cpp
return;
}
- Inkscape::XML::Node *repr = sp_repr_document_root(rnewdoc);
+ Inkscape::XML::Node *repr = rnewdoc->root();
gchar const *style = repr->attribute("style");
Inkscape::XML::Node *newgroup = rnewdoc->createElement("svg:g");
diff --git a/src/sp-image.cpp b/src/sp-image.cpp
index 0e92a1bcc6b5caca9d7db559d659ac8252d3c064..c5ed9117b162e4c684290780d3a9e99299578f3e 100644 (file)
--- a/src/sp-image.cpp
+++ b/src/sp-image.cpp
if (pixbuf != NULL) return pixbuf;
} else if (!g_path_is_absolute (filename)) {
/* try to load from relative pos */
- docbase = sp_repr_document_root (repr->document())->attribute("sodipodi:docbase");
+ docbase = repr->document()->root()->attribute("sodipodi:docbase");
if (!docbase) docbase = ".";
fullname = g_build_filename(docbase, filename, NULL);
pixbuf = Inkscape::IO::pixbuf_new_from_file( fullname, NULL );
index 7ab857f4600de5e258da690fe93f43bff8cbe4a0..0e3d8d4a433d365db37fdf4ae7874ed7dc4e64b6 100644 (file)
Inkscape::GC::init();
document = sp_repr_document_new("test");
- root = sp_repr_document_root(document);
+ root = document->root();
utest_start("XML Transactions");
diff --git a/src/xml/repr.h b/src/xml/repr.h
index 1f7f68bf1e00619a7701389d8a0e34e0266651c2..89221656a1bd14377a13ffe57ce8598a3e0905f7 100644 (file)
--- a/src/xml/repr.h
+++ b/src/xml/repr.h
char const *sp_xml_ns_uri_prefix(gchar const *uri, gchar const *suggested);
char const *sp_xml_ns_prefix_uri(gchar const *prefix);
-
-/*inline Inkscape::XML::Node *sp_repr_duplicate(Inkscape::XML::Node const *repr) {
- return repr->duplicate();
-}*/
-
Inkscape::XML::Document *sp_repr_document_new(gchar const *rootname);
-/// Returns root node of document.
-inline Inkscape::XML::Node *sp_repr_document_root(Inkscape::XML::Document const *doc) {
- if (!doc) return NULL;
- return const_cast<Inkscape::XML::Node *>(doc->root());
-}
-
/* 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,