summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 35a9b9d)
raw | patch | inline | side by side (parent: 35a9b9d)
author | ishmal <ishmal@users.sourceforge.net> | |
Mon, 26 Jun 2006 03:44:10 +0000 (03:44 +0000) | ||
committer | ishmal <ishmal@users.sourceforge.net> | |
Mon, 26 Jun 2006 03:44:10 +0000 (03:44 +0000) |
src/extension/internal/odf.cpp | patch | blob | history |
index fcb9c23d2389dd7fea5b9643d4ee32b013ab291b..9a8d9ecfae9f45d28d8677e61e0a6895bb86afdd 100644 (file)
}
-/**
- * Encode a string, checking for XML entities, to
- * make an XML string safe for output
- */
-static Glib::ustring toXml(const Glib::ustring &str)
-{
- Glib::ustring outbuf;
- for (unsigned int i=0 ; i<str.size() ; i++)
- {
- XMLCh ch = (XMLCh) str[i];
- if (ch == '&')
- outbuf.append("&r;");
- else if (ch == '<')
- outbuf.append("<");
- else if (ch == '>')
- outbuf.append(">");
- else if (ch == '"')
- outbuf.append(""");
- else if (ch == '\'')
- outbuf.append("'");
- else
- outbuf.push_back(ch);
- }
- return outbuf;
-}
-
-
outs.printf("office:version=\"1.0\">\n");
outs.printf("<office:meta>\n");
outs.printf(" <meta:generator>Inkscape.org - 0.45</meta:generator>\n");
- outs.printf(" <meta:initial-creator>%s</meta:initial-creator>\n",
- toXml(creator).c_str());
- outs.printf(" <meta:creation-date>%s</meta:creation-date>\n", date.c_str());
+ outs.printf(" <meta:initial-creator>%#s</meta:initial-creator>\n",
+ creator.c_str());
+ outs.printf(" <meta:creation-date>%#s</meta:creation-date>\n", date.c_str());
for (iter = metadata.begin() ; iter != metadata.end() ; iter++)
{
Glib::ustring name = iter->first;
Glib::ustring value = iter->second;
if (name.size() > 0 && value.size()>0)
{
- outs.printf(" <%s>%s</%s>\n",
- toXml(name).c_str(), toXml(value).c_str(), toXml(name).c_str());
+ outs.printf(" <%#s>%#s</%#s>\n",
+ name.c_str(), value.c_str(), name.c_str());
}
}
outs.printf(" <meta:editing-cycles>2</meta:editing-cycles>\n");