summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 7b14439)
raw | patch | inline | side by side (parent: 7b14439)
author | jeff_schiller <jeff_schiller@users.sourceforge.net> | |
Sat, 23 Aug 2008 06:16:49 +0000 (06:16 +0000) | ||
committer | jeff_schiller <jeff_schiller@users.sourceforge.net> | |
Sat, 23 Aug 2008 06:16:49 +0000 (06:16 +0000) |
src/dialogs/rdf.cpp | patch | blob | history |
diff --git a/src/dialogs/rdf.cpp b/src/dialogs/rdf.cpp
index 320608e9ab055716083d9575d9b3add5200fd30e..70cac4e1fe8cdc69f092ade6c3cbaf6cc1b982ec 100644 (file)
--- a/src/dialogs/rdf.cpp
+++ b/src/dialogs/rdf.cpp
#include "xml/repr.h"
#include "rdf.h"
#include "sp-item-group.h"
+#include "inkscape.h"
/*
Inkscape::XML::Document * xmldoc = parent->document();
g_return_val_if_fail (xmldoc != NULL, FALSE);
+ // set document's title element to the RDF title
+ if (!strcmp(entity->name, "title")) {
+ SPDocument *doc = SP_ACTIVE_DOCUMENT;
+ if(doc && doc->root) doc->root->setTitle(text);
+ }
+
switch (entity->datatype) {
case RDF_CONTENT:
temp = sp_repr_children(parent);
g_return_val_if_fail (doc != NULL, NULL);
if ( entity == NULL ) return NULL;
//printf("want '%s'\n",entity->title);
+ bool bIsTitle = !strcmp(entity->name, "title");
Inkscape::XML::Node * item;
if ( entity->datatype == RDF_XML ) {
item = rdf_get_xml_repr ( doc, entity->tag, FALSE );
}
else {
- item = rdf_get_work_repr( doc, entity->tag, FALSE );
+ item = rdf_get_work_repr( doc, entity->tag, bIsTitle ); // build title if necessary
}
if ( item == NULL ) return NULL;
-
const gchar * result = rdf_get_repr_text ( item, entity );
+ if(!result && bIsTitle && doc->root) { // if RDF title not set
+ result = doc->root->title(); // get the document's <title>
+ rdf_set_work_entity(doc, entity, result); // and set the RDF
+ }
//printf("found '%s' == '%s'\n", entity->title, result );
return result;
}