author | kergoth <kergoth> | 2003-08-09 16:24:58 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-08-09 16:24:58 (UTC) |
commit | e16d333ec2e8509fc665921ca106c25325bae9e0 (patch) (side-by-side diff) | |
tree | 9e9068190a15bc9b2a52ab33b40881128f732c0e /noncore/apps/tableviewer/db/xmlsource.cpp | |
parent | 1c58d1407f9584fedcdae390a04e2b37e5853361 (diff) | |
download | opie-e16d333ec2e8509fc665921ca106c25325bae9e0.zip opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.gz opie-e16d333ec2e8509fc665921ca106c25325bae9e0.tar.bz2 |
Merge from BRANCH_1_0
Diffstat (limited to 'noncore/apps/tableviewer/db/xmlsource.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/tableviewer/db/xmlsource.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/noncore/apps/tableviewer/db/xmlsource.cpp b/noncore/apps/tableviewer/db/xmlsource.cpp index 7418a85..94fec36 100644 --- a/noncore/apps/tableviewer/db/xmlsource.cpp +++ b/noncore/apps/tableviewer/db/xmlsource.cpp @@ -12,24 +12,26 @@ ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "xmlsource.h" #include <qdict.h> #include <stdlib.h> #include <qtextstream.h> +#include "../xmlencodeattr.h" + DBXml::DBXml(DBStore *d) { dstore = d; } QString DBXml::type() { return "xml"; } @@ -59,25 +61,25 @@ bool DBXml::saveSource(QIODevice *outDev) outstream << "<database name=\"" << dstore->getName() << "\">" << endl; outstream << "<header>" << endl; k = dstore->getKeys(); KeyListIterator it(*k); while(it.current()) { if (!it.current()->delFlag()) { outstream << "<key name=\"KEYID" << it.currentKey() << "\" "; outstream << "type=\"" << TVVariant::typeToName(it.current()->type()) << "\">"; - outstream << it.current()->name() << "</key>" << endl; + outstream << encodeAttr(it.current()->name()) << "</key>" << endl; } ++it; } outstream << "</header>" << endl; dstore->first(); do { elem = dstore->getCurrentData(); if (!elem) break; @@ -85,25 +87,25 @@ bool DBXml::saveSource(QIODevice *outDev) it.toFirst(); while (it.current()) { i = it.currentKey(); if (elem->hasValidValue(i)) { outstream << "<KEYID" << i << ">"; if (dstore->getKeyType(i) == TVVariant::Date) { // dates in files are different from displayed dates QDate date = elem->getField(i).toDate(); outstream << date.day() << "/" << date.month() << "/" << date.year(); } else { - outstream << elem->toQString(i); + outstream << encodeAttr(elem->toQString(i)); } outstream << "</KEYID" << i << ">" << endl; } ++it; } outstream << "</record>" << endl; } while(dstore->next()); outstream << "</database>" << endl; return TRUE; } |