summaryrefslogtreecommitdiffstats
path: root/lib/kofficecore/tests/koxmlreadertest.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kofficecore/tests/koxmlreadertest.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kofficecore/tests/koxmlreadertest.cpp')
-rw-r--r--lib/kofficecore/tests/koxmlreadertest.cpp820
1 files changed, 410 insertions, 410 deletions
diff --git a/lib/kofficecore/tests/koxmlreadertest.cpp b/lib/kofficecore/tests/koxmlreadertest.cpp
index 213fe0db..f8e6ed89 100644
--- a/lib/kofficecore/tests/koxmlreadertest.cpp
+++ b/lib/kofficecore/tests/koxmlreadertest.cpp
@@ -19,15 +19,15 @@
// xmlreadertest.cpp - test KoXml classes
// Ariya Hidayat, November 2005
-#include <qstring.h>
-#include <qcstring.h>
-#include <qbuffer.h>
-#include <qtextstream.h>
-#include <qdatetime.h>
-#include <qfile.h>
+#include <tqstring.h>
+#include <tqcstring.h>
+#include <tqbuffer.h>
+#include <tqtextstream.h>
+#include <tqdatetime.h>
+#include <tqfile.h>
#include "KoXmlReader.h"
-#include <qxml.h>
+#include <tqxml.h>
#define CHECK(x,y) check(__FILE__,__LINE__,#x,x,y)
@@ -42,8 +42,8 @@ const T& result, const T& expected )
if( result != expected )
{
testFailed++;
- QString message;
- QTextStream ts( &message, IO_WriteOnly );
+ TQString message;
+ TQTextStream ts( &message, IO_WriteOnly );
ts << msg;
ts << " Result:";
ts << result;
@@ -61,8 +61,8 @@ bool expected )
if( result != expected )
{
testFailed++;
- QString message;
- QTextStream ts( &message, IO_WriteOnly );
+ TQString message;
+ TQTextStream ts( &message, IO_WriteOnly );
ts << msg;
ts << " Result: ";
if( result ) ts << "True"; else ts << "False";
@@ -75,13 +75,13 @@ bool expected )
void testNode()
{
- QString errorMsg;
+ TQString errorMsg;
int errorLine = 0;
int errorColumn = 0;
- QByteArray xmlbuf;
- QBuffer xmldevice( xmlbuf );
- QTextStream xmlstream( xmlbuf, IO_WriteOnly );
+ TQByteArray xmlbuf;
+ TQBuffer xmldevice( xmlbuf );
+ TQTextStream xmlstream( xmlbuf, IO_WriteOnly );
xmlstream << "<earth>";
xmlstream << "<continents>";
xmlstream << "<asia/>";
@@ -105,13 +105,13 @@ void testNode()
// null node
KoXmlNode node1;
- CHECK( node1.nodeName(), QString::null );
+ CHECK( node1.nodeName(), TQString() );
CHECK( node1.isNull(), true );
CHECK( node1.isElement(), false );
CHECK( node1.isElement(), false );
CHECK( node1.isDocument(), false );
CHECK( node1.ownerDocument().isNull(), false );
- CHECK( node1.parentNode().isNull(), true );
+ CHECK( node1.tqparentNode().isNull(), true );
CHECK( node1.hasChildNodes(), false );
CHECK( node1.firstChild().isNull(), true );
CHECK( node1.lastChild().isNull(), true );
@@ -126,7 +126,7 @@ void testNode()
// a node which is a document
KoXmlNode node3 = doc;
- CHECK( node3.nodeName(), QString("#document") );
+ CHECK( node3.nodeName(), TQString("#document") );
CHECK( node3.isNull(), false );
CHECK( node3.isElement(), false );
CHECK( node3.isText(), false );
@@ -137,14 +137,14 @@ void testNode()
// convert to document and the compare
KoXmlDocument doc2 = node3.toDocument();
- CHECK( doc2.nodeName(), QString("#document") );
+ CHECK( doc2.nodeName(), TQString("#document") );
CHECK( doc2.isNull(), false );
CHECK( doc2.isDocument(), true );
CHECK( node3==doc2, true );
// a document is of course can't be converted to element
KoXmlElement invalidElement = node3.toElement();
- CHECK( invalidElement.nodeName(), QString::null );
+ CHECK( invalidElement.nodeName(), TQString() );
CHECK( invalidElement.isNull(), true );
CHECK( invalidElement.isElement(), true );
CHECK( invalidElement.isText(), false );
@@ -153,7 +153,7 @@ void testNode()
// clear() makes it a null node again
node3.clear();
CHECK( node3.isNull(), true );
- CHECK( node3.nodeName(), QString::null );
+ CHECK( node3.nodeName(), TQString() );
CHECK( node3.isElement(), false );
CHECK( node3.isText(), false );
CHECK( node3.isDocument(), false );
@@ -182,7 +182,7 @@ void testNode()
// a node which is an element for <continents>
KoXmlNode node5 = doc.firstChild().firstChild();
- CHECK( node5.nodeName(), QString("continents") );
+ CHECK( node5.nodeName(), TQString("continents") );
CHECK( node5.isNull(), false );
CHECK( node5.isElement(), true );
CHECK( node5.isText(), false );
@@ -208,8 +208,8 @@ void testNode()
CHECK( invalidDoc.isDocument(), true );
// node for <europe> using namedItem() function
- KoXmlNode europeNode = continentsElement.namedItem( QString("europe") );
- CHECK( europeNode.nodeName(), QString("europe") );
+ KoXmlNode europeNode = continentsElement.namedItem( TQString("europe") );
+ CHECK( europeNode.nodeName(), TQString("europe") );
CHECK( europeNode.isNull(), false );
CHECK( europeNode.isElement(), true );
CHECK( europeNode.isText(), false );
@@ -217,7 +217,7 @@ void testNode()
CHECK( europeNode.ownerDocument()==doc, true );
// search non-existing node
- KoXmlNode fooNode = continentsElement.namedItem( QString("foobar") );
+ KoXmlNode fooNode = continentsElement.namedItem( TQString("foobar") );
CHECK( fooNode.isNull(), true );
CHECK( fooNode.isElement(), false );
CHECK( fooNode.isText(), false );
@@ -226,14 +226,14 @@ void testNode()
void testElement()
{
- QString errorMsg;
+ TQString errorMsg;
int errorLine = 0;
int errorColumn = 0;
- QByteArray xmlbuf;
- QBuffer xmldevice( xmlbuf );
+ TQByteArray xmlbuf;
+ TQBuffer xmldevice( xmlbuf );
- QTextStream xmlstream( xmlbuf, IO_WriteOnly );
+ TQTextStream xmlstream( xmlbuf, IO_WriteOnly );
xmlstream << "<html>";
xmlstream << "<body bgcolor=\"#000\">";
xmlstream << "<p>";
@@ -251,39 +251,39 @@ void testElement()
// element for <html>
KoXmlElement rootElement;
rootElement = doc.documentElement();
- CHECK( rootElement.nodeName(), QString("html") );
+ CHECK( rootElement.nodeName(), TQString("html") );
CHECK( rootElement.isNull(), false );
CHECK( rootElement.isElement(), true );
CHECK( rootElement.isDocument(), false );
CHECK( rootElement.ownerDocument().isNull(), false );
CHECK( rootElement.ownerDocument()==doc, true );
- CHECK( rootElement.parentNode().isNull(), false );
- CHECK( rootElement.parentNode().toDocument()==doc, true );
+ CHECK( rootElement.tqparentNode().isNull(), false );
+ CHECK( rootElement.tqparentNode().toDocument()==doc, true );
CHECK( rootElement.hasChildNodes(), true );
- CHECK( rootElement.tagName(), QString("html") );
+ CHECK( rootElement.tagName(), TQString("html") );
CHECK( rootElement.prefix().isNull(), true );
// element for <body>
KoXmlElement bodyElement;
bodyElement = rootElement.firstChild().toElement();
- CHECK( bodyElement.nodeName(), QString("body") );
+ CHECK( bodyElement.nodeName(), TQString("body") );
CHECK( bodyElement.isNull(), false );
CHECK( bodyElement.isElement(), true );
CHECK( bodyElement.isDocument(), false );
CHECK( bodyElement.ownerDocument().isNull(), false );
CHECK( bodyElement.ownerDocument()==doc, true );
- CHECK( bodyElement.parentNode().isNull(), false );
- CHECK( bodyElement.parentNode()==rootElement, true );
+ CHECK( bodyElement.tqparentNode().isNull(), false );
+ CHECK( bodyElement.tqparentNode()==rootElement, true );
CHECK( bodyElement.hasChildNodes(), true );
- CHECK( bodyElement.tagName(), QString("body") );
+ CHECK( bodyElement.tagName(), TQString("body") );
CHECK( bodyElement.prefix().isNull(), true );
CHECK( bodyElement.hasAttribute("bgcolor"), true );
- CHECK( bodyElement.attribute("bgcolor"), QString("#000") );
+ CHECK( bodyElement.attribute("bgcolor"), TQString("#000") );
// a shared copy of <body>, will still have access to attribute bgcolor
KoXmlElement body2Element;
body2Element = bodyElement;
- CHECK( body2Element.nodeName(), QString("body") );
+ CHECK( body2Element.nodeName(), TQString("body") );
CHECK( body2Element.isNull(), false );
CHECK( body2Element.isElement(), true );
CHECK( body2Element.isDocument(), false );
@@ -292,14 +292,14 @@ void testElement()
CHECK( body2Element==bodyElement, true );
CHECK( body2Element!=bodyElement, false );
CHECK( body2Element.hasChildNodes(), true );
- CHECK( body2Element.tagName(), QString("body") );
+ CHECK( body2Element.tagName(), TQString("body") );
CHECK( body2Element.prefix().isNull(), true );
CHECK( body2Element.hasAttribute("bgcolor"), true );
- CHECK( body2Element.attribute("bgcolor"), QString("#000") );
+ CHECK( body2Element.attribute("bgcolor"), TQString("#000") );
// empty element, by default constructor
KoXmlElement testElement;
- CHECK( testElement.nodeName(), QString::null );
+ CHECK( testElement.nodeName(), TQString() );
CHECK( testElement.isNull(), true );
CHECK( testElement.isElement(), true );
CHECK( testElement.isDocument(), false );
@@ -307,20 +307,20 @@ void testElement()
CHECK( testElement.ownerDocument()!=doc, true );
CHECK( testElement==rootElement, false );
CHECK( testElement!=rootElement, true );
- CHECK( testElement.parentNode().isNull(), true );
+ CHECK( testElement.tqparentNode().isNull(), true );
CHECK( testElement.hasChildNodes(), false );
// check assignment operator
testElement = rootElement;
- CHECK( testElement.nodeName(), QString("html") );
+ CHECK( testElement.nodeName(), TQString("html") );
CHECK( testElement.isNull(), false );
CHECK( testElement.isElement(), true );
CHECK( testElement.isDocument(), false );
CHECK( testElement==rootElement, true );
CHECK( testElement!=rootElement, false );
- CHECK( testElement.parentNode().isNull(), false );
- CHECK( testElement.parentNode().toDocument()==doc, true );
- CHECK( testElement.tagName(), QString("html") );
+ CHECK( testElement.tqparentNode().isNull(), false );
+ CHECK( testElement.tqparentNode().toDocument()==doc, true );
+ CHECK( testElement.tagName(), TQString("html") );
CHECK( testElement.prefix().isNull(), true );
// assigned from another empty element
@@ -336,8 +336,8 @@ void testElement()
CHECK( testElement.ownerDocument().isNull(), false );
CHECK( testElement.ownerDocument()==doc, true );
CHECK( testElement==bodyElement, true );
- CHECK( testElement.parentNode().isNull(), false );
- CHECK( testElement.tagName(), QString("body") );
+ CHECK( testElement.tqparentNode().isNull(), false );
+ CHECK( testElement.tagName(), TQString("body") );
CHECK( testElement.prefix().isNull(), true );
CHECK( testElement.hasChildNodes(), true );
@@ -349,9 +349,9 @@ void testElement()
CHECK( dummyElement.ownerDocument().isNull(), false );
CHECK( dummyElement.ownerDocument()==doc, true );
CHECK( dummyElement==rootElement, true );
- CHECK( dummyElement.parentNode().isNull(), false );
+ CHECK( dummyElement.tqparentNode().isNull(), false );
CHECK( dummyElement.hasChildNodes(), true );
- CHECK( dummyElement.tagName(), QString("html") );
+ CHECK( dummyElement.tagName(), TQString("html") );
CHECK( dummyElement.prefix().isNull(), true );
// clear() turns element to null node
@@ -378,14 +378,14 @@ void testElement()
void testAttributes()
{
- QString errorMsg;
+ TQString errorMsg;
int errorLine = 0;
int errorColumn = 0;
- QByteArray xmlbuf;
- QBuffer xmldevice( xmlbuf );
+ TQByteArray xmlbuf;
+ TQBuffer xmldevice( xmlbuf );
- QTextStream xmlstream( xmlbuf, IO_WriteOnly );
+ TQTextStream xmlstream( xmlbuf, IO_WriteOnly );
xmlstream << "<p>";
xmlstream << "<img src=\"foo.png\" width=\"300\" height=\"150\"/>";
xmlstream << "</p>";
@@ -400,26 +400,26 @@ void testAttributes()
rootElement = doc.documentElement();
CHECK( rootElement.isNull(), false );
CHECK( rootElement.isElement(), true );
- CHECK( rootElement.parentNode().isNull(), false );
- CHECK( rootElement.parentNode().toDocument()==doc, true );
- CHECK( rootElement.tagName(), QString("p") );
+ CHECK( rootElement.tqparentNode().isNull(), false );
+ CHECK( rootElement.tqparentNode().toDocument()==doc, true );
+ CHECK( rootElement.tagName(), TQString("p") );
CHECK( rootElement.prefix().isNull(), true );
KoXmlElement imgElement;
imgElement = rootElement.firstChild().toElement();
CHECK( imgElement.isNull(), false );
CHECK( imgElement.isElement(), true );
- CHECK( imgElement.tagName(), QString("img") );
+ CHECK( imgElement.tagName(), TQString("img") );
CHECK( imgElement.prefix().isNull(), true );
CHECK( imgElement.hasAttribute("src"), true );
CHECK( imgElement.hasAttribute("width"), true );
CHECK( imgElement.hasAttribute("height"), true );
CHECK( imgElement.hasAttribute("non-exist"), false );
CHECK( imgElement.hasAttribute("SRC"), false );
- CHECK( imgElement.attribute("src"), QString("foo.png") );
- CHECK( imgElement.attribute("width"), QString("300") );
+ CHECK( imgElement.attribute("src"), TQString("foo.png") );
+ CHECK( imgElement.attribute("width"), TQString("300") );
CHECK( imgElement.attribute("width").toInt(), 300 );
- CHECK( imgElement.attribute("height"), QString("150") );
+ CHECK( imgElement.attribute("height"), TQString("150") );
CHECK( imgElement.attribute("height").toInt(), 150 );
CHECK( imgElement.attribute("border").isEmpty(), true );
CHECK( imgElement.attribute("border","0").toInt(), 0 );
@@ -428,14 +428,14 @@ void testAttributes()
void testText()
{
- QString errorMsg;
+ TQString errorMsg;
int errorLine = 0;
int errorColumn = 0;
- QByteArray xmlbuf;
- QBuffer xmldevice( xmlbuf );
+ TQByteArray xmlbuf;
+ TQBuffer xmldevice( xmlbuf );
- QTextStream xmlstream( xmlbuf, IO_WriteOnly );
+ TQTextStream xmlstream( xmlbuf, IO_WriteOnly );
xmlstream << "<p>";
xmlstream << "Hello ";
xmlstream << "<b>world</b>";
@@ -456,17 +456,17 @@ void testText()
CHECK( parElement.isDocument(), false );
CHECK( parElement.ownerDocument().isNull(), false );
CHECK( parElement.ownerDocument()==doc, true );
- CHECK( parElement.parentNode().isNull(), false );
- CHECK( parElement.parentNode().toDocument()==doc, true );
+ CHECK( parElement.tqparentNode().isNull(), false );
+ CHECK( parElement.tqparentNode().toDocument()==doc, true );
CHECK( parElement.hasChildNodes(), true );
- CHECK( parElement.tagName(), QString("p") );
+ CHECK( parElement.tagName(), TQString("p") );
CHECK( parElement.prefix().isNull(), true );
- CHECK( parElement.text(), QString("Hello world") );
+ CHECK( parElement.text(), TQString("Hello world") );
// node for "Hello"
KoXmlNode helloNode;
helloNode = parElement.firstChild();
- CHECK( helloNode.nodeName(), QString("#text") );
+ CHECK( helloNode.nodeName(), TQString("#text") );
CHECK( helloNode.isNull(), false );
CHECK( helloNode.isElement(), false );
CHECK( helloNode.isText(), true );
@@ -475,12 +475,12 @@ void testText()
// "Hello" text
KoXmlText helloText;
helloText = helloNode.toText();
- CHECK( helloText.nodeName(), QString("#text") );
+ CHECK( helloText.nodeName(), TQString("#text") );
CHECK( helloText.isNull(), false );
CHECK( helloText.isElement(), false );
CHECK( helloText.isText(), true );
CHECK( helloText.isDocument(), false );
- CHECK( helloText.data(), QString("Hello ") );
+ CHECK( helloText.data(), TQString("Hello ") );
// shared copy of the text
KoXmlText hello2Text;
@@ -489,7 +489,7 @@ void testText()
CHECK( hello2Text.isElement(), false );
CHECK( hello2Text.isText(), true );
CHECK( hello2Text.isDocument(), false );
- CHECK( hello2Text.data(), QString("Hello ") );
+ CHECK( hello2Text.data(), TQString("Hello ") );
// element for <b>
KoXmlElement boldElement;
@@ -500,9 +500,9 @@ void testText()
CHECK( boldElement.isDocument(), false );
CHECK( boldElement.ownerDocument().isNull(), false );
CHECK( boldElement.ownerDocument()==doc, true );
- CHECK( boldElement.parentNode().isNull(), false );
+ CHECK( boldElement.tqparentNode().isNull(), false );
CHECK( boldElement.hasChildNodes(), true );
- CHECK( boldElement.tagName(), QString("b") );
+ CHECK( boldElement.tagName(), TQString("b") );
CHECK( boldElement.prefix().isNull(), true );
// "world" text
@@ -512,19 +512,19 @@ void testText()
CHECK( worldText.isElement(), false );
CHECK( worldText.isText(), true );
CHECK( worldText.isDocument(), false );
- CHECK( worldText.data(), QString("world") );
+ CHECK( worldText.data(), TQString("world") );
}
void testCDATA()
{
- QString errorMsg;
+ TQString errorMsg;
int errorLine = 0;
int errorColumn = 0;
- QByteArray xmlbuf;
- QBuffer xmldevice( xmlbuf );
+ TQByteArray xmlbuf;
+ TQBuffer xmldevice( xmlbuf );
- QTextStream xmlstream( xmlbuf, IO_WriteOnly );
+ TQTextStream xmlstream( xmlbuf, IO_WriteOnly );
xmlstream << "<p>";
xmlstream << "Hello ";
xmlstream << "<![CDATA[world]]>";
@@ -545,12 +545,12 @@ void testCDATA()
CHECK( parElement.isDocument(), false );
CHECK( parElement.ownerDocument().isNull(), false );
CHECK( parElement.ownerDocument()==doc, true );
- CHECK( parElement.parentNode().isNull(), false );
- CHECK( parElement.parentNode().toDocument()==doc, true );
+ CHECK( parElement.tqparentNode().isNull(), false );
+ CHECK( parElement.tqparentNode().toDocument()==doc, true );
CHECK( parElement.hasChildNodes(), true );
- CHECK( parElement.tagName(), QString("p") );
+ CHECK( parElement.tagName(), TQString("p") );
CHECK( parElement.prefix().isNull(), true );
- CHECK( parElement.text(), QString("Hello world") );
+ CHECK( parElement.text(), TQString("Hello world") );
// node for "Hello"
KoXmlNode helloNode;
@@ -567,13 +567,13 @@ void testCDATA()
CHECK( helloText.isElement(), false );
CHECK( helloText.isText(), true );
CHECK( helloText.isDocument(), false );
- CHECK( helloText.data(), QString("Hello ") );
+ CHECK( helloText.data(), TQString("Hello ") );
// node for CDATA "world!"
// Note: isText() is also true for CDATA
KoXmlNode worldNode;
worldNode = helloNode.nextSibling();
- CHECK( worldNode.nodeName(), QString("#cdata-section") );
+ CHECK( worldNode.nodeName(), TQString("#cdata-section") );
CHECK( worldNode.isNull(), false );
CHECK( worldNode.isElement(), false );
CHECK( worldNode.isText(), true );
@@ -584,25 +584,25 @@ void testCDATA()
// Note: isText() is also true for CDATA
KoXmlCDATASection worldCDATA;
worldCDATA = worldNode.toCDATASection();
- CHECK( worldCDATA.nodeName(), QString("#cdata-section") );
+ CHECK( worldCDATA.nodeName(), TQString("#cdata-section") );
CHECK( worldCDATA.isNull(), false );
CHECK( worldCDATA.isElement(), false );
CHECK( worldCDATA.isText(), true );
CHECK( worldCDATA.isCDATASection(), true );
CHECK( worldCDATA.isDocument(), false );
- CHECK( worldCDATA.data(), QString("world") );
+ CHECK( worldCDATA.data(), TQString("world") );
}
void testDocument()
{
- QString errorMsg;
+ TQString errorMsg;
int errorLine = 0;
int errorColumn = 0;
- QByteArray xmlbuf;
- QBuffer xmldevice( xmlbuf );
+ TQByteArray xmlbuf;
+ TQBuffer xmldevice( xmlbuf );
- QTextStream xmlstream( xmlbuf, IO_WriteOnly );
+ TQTextStream xmlstream( xmlbuf, IO_WriteOnly );
xmlstream << "<koffice>";
xmlstream << " <kword/>\n";
xmlstream << " <kpresenter/>\n";
@@ -612,11 +612,11 @@ void testDocument()
KoXmlDocument doc;
// empty document
- CHECK( doc.nodeName(), QString("#document") );
+ CHECK( doc.nodeName(), TQString("#document") );
CHECK( doc.isNull(), false );
CHECK( doc.isElement(), false );
CHECK( doc.isDocument(), true );
- CHECK( doc.parentNode().isNull(), true );
+ CHECK( doc.tqparentNode().isNull(), true );
CHECK( doc.firstChild().isNull(), true );
CHECK( doc.lastChild().isNull(), true );
CHECK( doc.previousSibling().isNull(), true );
@@ -629,38 +629,38 @@ void testDocument()
CHECK( errorColumn, 0 );
// this document has something already
- CHECK( doc.nodeName(), QString("#document") );
+ CHECK( doc.nodeName(), TQString("#document") );
CHECK( doc.isNull(), false );
CHECK( doc.isElement(), false );
CHECK( doc.isDocument(), true );
- CHECK( doc.parentNode().isNull(), true );
+ CHECK( doc.tqparentNode().isNull(), true );
CHECK( doc.firstChild().isNull(), false );
CHECK( doc.lastChild().isNull(), false );
CHECK( doc.previousSibling().isNull(), true );
CHECK( doc.nextSibling().isNull(), true );
- // make sure its children are fine
+ // make sure its tqchildren are fine
KoXmlElement rootElement;
rootElement = doc.firstChild().toElement();
CHECK( rootElement.isNull(), false );
CHECK( rootElement.isElement(), true );
CHECK( rootElement.isDocument(), false );
- CHECK( rootElement.parentNode().isNull(), false );
- CHECK( rootElement.parentNode().toDocument()==doc, true );
+ CHECK( rootElement.tqparentNode().isNull(), false );
+ CHECK( rootElement.tqparentNode().toDocument()==doc, true );
rootElement = doc.lastChild().toElement();
CHECK( rootElement.isNull(), false );
CHECK( rootElement.isElement(), true );
CHECK( rootElement.isDocument(), false );
- CHECK( rootElement.parentNode().isNull(), false );
- CHECK( rootElement.parentNode().toDocument()==doc, true );
+ CHECK( rootElement.tqparentNode().isNull(), false );
+ CHECK( rootElement.tqparentNode().toDocument()==doc, true );
// clear() converts it into null node
doc.clear();
- CHECK( doc.nodeName(), QString::null );
+ CHECK( doc.nodeName(), TQString() );
CHECK( doc.isNull(), true );
CHECK( doc.isElement(), false );
CHECK( doc.isDocument(), true );
- CHECK( doc.parentNode().isNull(), true );
+ CHECK( doc.tqparentNode().isNull(), true );
CHECK( doc.firstChild().isNull(), true );
CHECK( doc.lastChild().isNull(), true );
CHECK( doc.previousSibling().isNull(), true );
@@ -668,24 +668,24 @@ void testDocument()
// assigned from another empty document
doc = KoXmlDocument();
- CHECK( doc.nodeName(), QString("#document") );
+ CHECK( doc.nodeName(), TQString("#document") );
CHECK( doc.isNull(), false );
CHECK( doc.isElement(), false );
CHECK( doc.isDocument(), true );
- CHECK( doc.parentNode().isNull(), true );
+ CHECK( doc.tqparentNode().isNull(), true );
}
void testNamespace()
{
- QString errorMsg;
+ TQString errorMsg;
int errorLine = 0;
int errorColumn = 0;
- QByteArray xmlbuf;
- QBuffer xmldevice( xmlbuf );
- QTextStream xmlstream( xmlbuf, IO_WriteOnly );
+ TQByteArray xmlbuf;
+ TQBuffer xmldevice( xmlbuf );
+ TQTextStream xmlstream( xmlbuf, IO_WriteOnly );
- // taken from example in Qt documentation (xml.html)
+ // taken from example in TQt documentation (xml.html)
xmlstream << "<document xmlns:book = \"http://trolltech.com/fnord/book/\"";
xmlstream << " xmlns = \"http://trolltech.com/fnord/\" >";
xmlstream << "<book>";
@@ -715,31 +715,31 @@ void testNamespace()
rootElement = doc.documentElement();
CHECK( rootElement.isNull(), false );
CHECK( rootElement.isElement(), true );
- CHECK( rootElement.tagName(), QString("document") );
+ CHECK( rootElement.tagName(), TQString("document") );
CHECK( rootElement.prefix().isNull(), true );
bookElement = rootElement.firstChild().toElement();
CHECK( bookElement.isNull(), false );
CHECK( bookElement.isElement(), true );
- CHECK( bookElement.tagName(), QString("book") );
+ CHECK( bookElement.tagName(), TQString("book") );
CHECK( bookElement.prefix().isNull(), true );
- CHECK( bookElement.localName(), QString::null );
+ CHECK( bookElement.localName(), TQString() );
bookTitleElement = bookElement.firstChild().toElement();
CHECK( bookTitleElement.isNull(), false );
CHECK( bookTitleElement.isElement(), true );
- CHECK( bookTitleElement.tagName(), QString("book:title") );
+ CHECK( bookTitleElement.tagName(), TQString("book:title") );
CHECK( bookTitleElement.prefix().isNull(), true );
- CHECK( bookTitleElement.localName(), QString::null );
+ CHECK( bookTitleElement.localName(), TQString() );
bookAuthorElement = bookTitleElement.nextSibling().toElement();
CHECK( bookAuthorElement.isNull(), false );
CHECK( bookAuthorElement.isElement(), true );
- CHECK( bookAuthorElement.tagName(), QString("book:author") );
+ CHECK( bookAuthorElement.tagName(), TQString("book:author") );
CHECK( bookAuthorElement.prefix().isNull(), true );
- CHECK( bookAuthorElement.attribute("title"), QString("Ms") );
- CHECK( bookAuthorElement.attribute("fnord:title"), QString("Goddess") );
- CHECK( bookAuthorElement.attribute("name"), QString("Eris Kallisti") );
+ CHECK( bookAuthorElement.attribute("title"), TQString("Ms") );
+ CHECK( bookAuthorElement.attribute("fnord:title"), TQString("Goddess") );
+ CHECK( bookAuthorElement.attribute("name"), TQString("Eris Kallisti") );
// ------------- now with namespace processing -----------
xmldevice.at(0); // just to rewind
@@ -757,28 +757,28 @@ void testNamespace()
rootElement = doc.documentElement();
CHECK( rootElement.isNull(), false );
CHECK( rootElement.isElement(), true );
- CHECK( rootElement.tagName(), QString("document") );
+ CHECK( rootElement.tagName(), TQString("document") );
CHECK( rootElement.prefix().isEmpty(), true );
- CHECK( rootElement.namespaceURI(), QString( defaultNS ) );
- CHECK( rootElement.localName(), QString("document") );
+ CHECK( rootElement.namespaceURI(), TQString( defaultNS ) );
+ CHECK( rootElement.localName(), TQString("document") );
// <book>
bookElement = rootElement.firstChild().toElement();
CHECK( bookElement.isNull(), false );
CHECK( bookElement.isElement(), true );
- CHECK( bookElement.tagName(), QString("book") );
+ CHECK( bookElement.tagName(), TQString("book") );
CHECK( bookElement.prefix().isEmpty(), true );
- CHECK( bookElement.namespaceURI(), QString( defaultNS ) );
- CHECK( bookElement.localName(), QString("book") );
+ CHECK( bookElement.namespaceURI(), TQString( defaultNS ) );
+ CHECK( bookElement.localName(), TQString("book") );
// <book:title>
bookTitleElement = bookElement.firstChild().toElement();
CHECK( bookTitleElement.isNull(), false );
CHECK( bookTitleElement.isElement(), true );
- CHECK( bookTitleElement.tagName(), QString("title") );
- CHECK( bookTitleElement.prefix(), QString("book") );
- CHECK( bookTitleElement.namespaceURI(), QString(bookNS) );
- CHECK( bookTitleElement.localName(), QString("title") );
+ CHECK( bookTitleElement.tagName(), TQString("title") );
+ CHECK( bookTitleElement.prefix(), TQString("book") );
+ CHECK( bookTitleElement.namespaceURI(), TQString(bookNS) );
+ CHECK( bookTitleElement.localName(), TQString("title") );
// another way, find it using namedItemNS()
KoXmlElement book2TitleElement;
@@ -787,16 +787,16 @@ void testNamespace()
CHECK( book2TitleElement==bookTitleElement, true );
CHECK( book2TitleElement.isNull(), false );
CHECK( book2TitleElement.isElement(), true );
- CHECK( book2TitleElement.tagName(), QString("title") );
+ CHECK( book2TitleElement.tagName(), TQString("title") );
// <book:author>
bookAuthorElement = bookTitleElement.nextSibling().toElement();
CHECK( bookAuthorElement.isNull(), false );
CHECK( bookAuthorElement.isElement(), true );
- CHECK( bookAuthorElement.tagName(), QString("author") );
- CHECK( bookAuthorElement.prefix(), QString("book") );
- CHECK( bookAuthorElement.namespaceURI(), QString(bookNS) );
- CHECK( bookAuthorElement.localName(), QString("author") );
+ CHECK( bookAuthorElement.tagName(), TQString("author") );
+ CHECK( bookAuthorElement.prefix(), TQString("book") );
+ CHECK( bookAuthorElement.namespaceURI(), TQString(bookNS) );
+ CHECK( bookAuthorElement.localName(), TQString("author") );
// another way, find it using namedItemNS()
KoXmlElement book2AuthorElement;
@@ -805,7 +805,7 @@ void testNamespace()
CHECK( book2AuthorElement==bookAuthorElement, true );
CHECK( book2AuthorElement.isNull(), false );
CHECK( book2AuthorElement.isElement(), true );
- CHECK( book2AuthorElement.tagName(), QString("author") );
+ CHECK( book2AuthorElement.tagName(), TQString("author") );
// attributes in <book:author>
// Note: with namespace processing, attribute's prefix is taken out and
@@ -814,9 +814,9 @@ void testNamespace()
CHECK( bookAuthorElement.hasAttribute("title"), true );
CHECK( bookAuthorElement.hasAttribute("fnord:title"), false );
CHECK( bookAuthorElement.hasAttribute("name"), true );
- CHECK( bookAuthorElement.attribute("title"), QString("Goddess") );
+ CHECK( bookAuthorElement.attribute("title"), TQString("Goddess") );
CHECK( bookAuthorElement.attribute("fnord:title").isEmpty(), true );
- CHECK( bookAuthorElement.attribute("name"), QString("Eris Kallisti") );
+ CHECK( bookAuthorElement.attribute("name"), TQString("Eris Kallisti") );
// attributes in <book:author>, with NS family of functions
// those without prefix are not accessible at all, because they do not belong
@@ -826,9 +826,9 @@ void testNamespace()
CHECK( bookAuthorElement.hasAttributeNS(bookNS,"title"), false );
CHECK( bookAuthorElement.hasAttributeNS(fnordNS,"title"), true );
- CHECK( bookAuthorElement.attributeNS(defaultNS,"title",""), QString("Goddess") );
- CHECK( bookAuthorElement.attributeNS(bookNS,"title",""), QString("") );
- CHECK( bookAuthorElement.attributeNS(fnordNS,"title",""), QString("Goddess") );
+ CHECK( bookAuthorElement.attributeNS(defaultNS,"title",""), TQString("Goddess") );
+ CHECK( bookAuthorElement.attributeNS(bookNS,"title",""), TQString("") );
+ CHECK( bookAuthorElement.attributeNS(fnordNS,"title",""), TQString("Goddess") );
CHECK( bookAuthorElement.hasAttributeNS(defaultNS,"fnord:title"), false );
CHECK( bookAuthorElement.hasAttributeNS(bookNS,"fnord:title"), false );
@@ -838,20 +838,20 @@ void testNamespace()
CHECK( bookAuthorElement.hasAttributeNS(bookNS,"name"), false );
CHECK( bookAuthorElement.hasAttributeNS(fnordNS,"name"), false );
- CHECK( bookAuthorElement.attributeNS(defaultNS,"name",QString::null).isEmpty(), true );
- CHECK( bookAuthorElement.attributeNS(bookNS,"name",QString::null).isEmpty(), true );
- CHECK( bookAuthorElement.attributeNS(fnordNS,"name",QString::null).isEmpty(), true );
+ CHECK( bookAuthorElement.attributeNS(defaultNS,"name",TQString()).isEmpty(), true );
+ CHECK( bookAuthorElement.attributeNS(bookNS,"name",TQString()).isEmpty(), true );
+ CHECK( bookAuthorElement.attributeNS(fnordNS,"name",TQString()).isEmpty(), true );
}
void testUnload()
{
- QString errorMsg;
+ TQString errorMsg;
int errorLine = 0;
int errorColumn = 0;
- QByteArray xmlbuf;
- QBuffer xmldevice( xmlbuf );
- QTextStream xmlstream( xmlbuf, IO_WriteOnly );
+ TQByteArray xmlbuf;
+ TQBuffer xmldevice( xmlbuf );
+ TQTextStream xmlstream( xmlbuf, IO_WriteOnly );
xmlstream << "<earth>";
xmlstream << "<continents>";
xmlstream << "<asia/>";
@@ -877,9 +877,9 @@ void testUnload()
earthElement = doc.documentElement().toElement();
CHECK( earthElement.isNull(), false );
CHECK( earthElement.isElement(), true );
- CHECK( earthElement.parentNode().isNull(), false );
+ CHECK( earthElement.tqparentNode().isNull(), false );
CHECK( earthElement.hasChildNodes(), true );
- CHECK( earthElement.tagName(), QString("earth") );
+ CHECK( earthElement.tagName(), TQString("earth") );
CHECK( earthElement.prefix().isNull(), true );
// this ensures that all child nodes of <earth> are loaded
@@ -890,7 +890,7 @@ void testUnload()
// we should get the correct first child
KoXmlElement continentsElement = earthElement.firstChild().toElement();
- CHECK( continentsElement.nodeName(), QString("continents") );
+ CHECK( continentsElement.nodeName(), TQString("continents") );
CHECK( continentsElement.isNull(), false );
CHECK( continentsElement.isElement(), true );
CHECK( continentsElement.isText(), false );
@@ -902,7 +902,7 @@ void testUnload()
// we should get the correct last child
KoXmlElement oceansElement = earthElement.lastChild().toElement();
- CHECK( oceansElement.nodeName(), QString("oceans") );
+ CHECK( oceansElement.nodeName(), TQString("oceans") );
CHECK( oceansElement.isNull(), false );
CHECK( oceansElement.isElement(), true );
CHECK( oceansElement.isText(), false );
@@ -912,14 +912,14 @@ void testUnload()
void testSimpleXML()
{
- QString errorMsg;
+ TQString errorMsg;
int errorLine = 0;
int errorColumn = 0;
- QByteArray xmlbuf;
- QBuffer xmldevice( xmlbuf );
+ TQByteArray xmlbuf;
+ TQBuffer xmldevice( xmlbuf );
- QTextStream xmlstream( xmlbuf, IO_WriteOnly );
+ TQTextStream xmlstream( xmlbuf, IO_WriteOnly );
xmlstream << "<solarsystem>";
xmlstream << " <mercurius/>\n";
xmlstream << " <venus/>\n";
@@ -941,9 +941,9 @@ void testSimpleXML()
rootElement = doc.documentElement();
CHECK( rootElement.isNull(), false );
CHECK( rootElement.isElement(), true );
- CHECK( rootElement.parentNode().isNull(), false );
+ CHECK( rootElement.tqparentNode().isNull(), false );
CHECK( rootElement.hasChildNodes(), true );
- CHECK( rootElement.tagName(), QString("solarsystem") );
+ CHECK( rootElement.tagName(), TQString("solarsystem") );
CHECK( rootElement.prefix().isNull(), true );
// node <mercurius>
@@ -953,9 +953,9 @@ void testSimpleXML()
CHECK( firstPlanetNode.isElement(), true );
CHECK( firstPlanetNode.nextSibling().isNull(), false );
CHECK( firstPlanetNode.previousSibling().isNull(), true );
- CHECK( firstPlanetNode.parentNode().isNull(), false );
- CHECK( firstPlanetNode.parentNode()==rootElement, true );
- CHECK( firstPlanetNode.parentNode()!=rootElement, false );
+ CHECK( firstPlanetNode.tqparentNode().isNull(), false );
+ CHECK( firstPlanetNode.tqparentNode()==rootElement, true );
+ CHECK( firstPlanetNode.tqparentNode()!=rootElement, false );
CHECK( firstPlanetNode.hasChildNodes(), false );
CHECK( firstPlanetNode.firstChild().isNull(), true );
CHECK( firstPlanetNode.lastChild().isNull(), true );
@@ -965,12 +965,12 @@ void testSimpleXML()
firstPlanetElement = firstPlanetNode.toElement();
CHECK( firstPlanetElement.isNull(), false );
CHECK( firstPlanetElement.isElement(), true );
- CHECK( firstPlanetElement.parentNode().isNull(), false );
- CHECK( firstPlanetElement.parentNode()==rootElement, true );
+ CHECK( firstPlanetElement.tqparentNode().isNull(), false );
+ CHECK( firstPlanetElement.tqparentNode()==rootElement, true );
CHECK( firstPlanetElement.hasChildNodes(), false );
CHECK( firstPlanetElement.firstChild().isNull(), true );
CHECK( firstPlanetElement.lastChild().isNull(), true );
- CHECK( firstPlanetElement.tagName(), QString("mercurius") );
+ CHECK( firstPlanetElement.tagName(), TQString("mercurius") );
CHECK( firstPlanetElement.prefix().isNull(), true );
// node <venus>
@@ -982,9 +982,9 @@ void testSimpleXML()
CHECK( secondPlanetNode.previousSibling().isNull(), false );
CHECK( secondPlanetNode.previousSibling()==firstPlanetNode, true );
CHECK( secondPlanetNode.previousSibling()==firstPlanetElement, true );
- CHECK( secondPlanetNode.parentNode().isNull(), false );
- CHECK( secondPlanetNode.parentNode()==rootElement, true );
- CHECK( secondPlanetNode.parentNode()!=rootElement, false );
+ CHECK( secondPlanetNode.tqparentNode().isNull(), false );
+ CHECK( secondPlanetNode.tqparentNode()==rootElement, true );
+ CHECK( secondPlanetNode.tqparentNode()!=rootElement, false );
CHECK( secondPlanetNode.hasChildNodes(), false );
CHECK( secondPlanetNode.firstChild().isNull(), true );
CHECK( secondPlanetNode.lastChild().isNull(), true );
@@ -998,64 +998,64 @@ void testSimpleXML()
CHECK( secondPlanetElement.previousSibling().isNull(), false );
CHECK( secondPlanetElement.previousSibling()==firstPlanetNode, true );
CHECK( secondPlanetElement.previousSibling()==firstPlanetElement, true );
- CHECK( secondPlanetElement.parentNode().isNull(), false );
- CHECK( secondPlanetElement.parentNode()==rootElement, true );
- CHECK( secondPlanetElement.parentNode()!=rootElement, false );
+ CHECK( secondPlanetElement.tqparentNode().isNull(), false );
+ CHECK( secondPlanetElement.tqparentNode()==rootElement, true );
+ CHECK( secondPlanetElement.tqparentNode()!=rootElement, false );
CHECK( secondPlanetElement.hasChildNodes(), false );
CHECK( secondPlanetElement.firstChild().isNull(), true );
CHECK( secondPlanetElement.lastChild().isNull(), true );
- CHECK( secondPlanetElement.tagName(), QString("venus") );
+ CHECK( secondPlanetElement.tagName(), TQString("venus") );
CHECK( secondPlanetElement.prefix().isNull(), true );
}
void testRootError()
{
- QString errorMsg;
+ TQString errorMsg;
int errorLine = 0;
int errorColumn = 0;
// multiple root nodes are not valid !
- QByteArray xmlbuf;
- QBuffer xmldevice( xmlbuf );
- QTextStream xmlstream( xmlbuf, IO_WriteOnly );
+ TQByteArray xmlbuf;
+ TQBuffer xmldevice( xmlbuf );
+ TQTextStream xmlstream( xmlbuf, IO_WriteOnly );
xmlstream << "<earth></earth><moon></moon>";
KoXmlDocument doc;
CHECK( doc.setContent( &xmldevice, &errorMsg, &errorLine, &errorColumn ), false );
CHECK( errorMsg.isEmpty(), false );
- CHECK( errorMsg, QString("unexpected character") );
+ CHECK( errorMsg, TQString("unexpected character") );
CHECK( errorLine, 1 );
CHECK( errorColumn, 17 );
}
void testMismatchedTag()
{
- QString errorMsg;
+ TQString errorMsg;
int errorLine = 0;
int errorColumn = 0;
- QByteArray xmlbuf;
- QBuffer xmldevice( xmlbuf );
- QTextStream xmlstream( xmlbuf, IO_WriteOnly );
+ TQByteArray xmlbuf;
+ TQBuffer xmldevice( xmlbuf );
+ TQTextStream xmlstream( xmlbuf, IO_WriteOnly );
xmlstream << "<earth></e>";
KoXmlDocument doc;
CHECK( doc.setContent( &xmldevice, &errorMsg, &errorLine, &errorColumn ), false );
CHECK( errorMsg.isEmpty(), false );
- CHECK( errorMsg, QString("tag mismatch") );
+ CHECK( errorMsg, TQString("tag mismatch") );
CHECK( errorLine, 1 );
CHECK( errorColumn, 11 );
}
void testSimpleOpenDocumentText()
{
- QString errorMsg;
+ TQString errorMsg;
int errorLine = 0;
int errorColumn = 0;
- QByteArray xmlbuf;
- QBuffer xmldevice( xmlbuf );
- QTextStream xmlstream( xmlbuf, IO_WriteOnly );
+ TQByteArray xmlbuf;
+ TQBuffer xmldevice( xmlbuf );
+ TQTextStream xmlstream( xmlbuf, IO_WriteOnly );
// content.xml from a simple OpenDocument text
// it has only paragraph "Hello, world!"
@@ -1088,119 +1088,119 @@ void testSimpleOpenDocumentText()
contentElement = doc.documentElement();
CHECK( contentElement.isNull(), false );
CHECK( contentElement.isElement(), true );
- CHECK( contentElement.parentNode().isNull(), false );
- CHECK( contentElement.parentNode().toDocument()==doc, true );
+ CHECK( contentElement.tqparentNode().isNull(), false );
+ CHECK( contentElement.tqparentNode().toDocument()==doc, true );
CHECK( contentElement.firstChild().isNull(), false );
CHECK( contentElement.lastChild().isNull(), false );
CHECK( contentElement.previousSibling().isNull(), false );
CHECK( contentElement.nextSibling().isNull(), true );
- CHECK( contentElement.localName(), QString("document-content") );
+ CHECK( contentElement.localName(), TQString("document-content") );
CHECK( contentElement.hasAttributeNS(officeNS,"version"), true );
- CHECK( contentElement.attributeNS(officeNS,"version",""), QString("1.0") );
+ CHECK( contentElement.attributeNS(officeNS,"version",""), TQString("1.0") );
// <office:automatic-styles>
KoXmlElement stylesElement;
stylesElement = KoXml::namedItemNS( contentElement, officeNS, "automatic-styles" );
CHECK( stylesElement.isNull(), false );
CHECK( stylesElement.isElement(), true );
- CHECK( stylesElement.parentNode().isNull(), false );
- CHECK( stylesElement.parentNode()==contentElement, true );
+ CHECK( stylesElement.tqparentNode().isNull(), false );
+ CHECK( stylesElement.tqparentNode()==contentElement, true );
CHECK( stylesElement.firstChild().isNull(), true );
CHECK( stylesElement.lastChild().isNull(), true );
CHECK( stylesElement.previousSibling().isNull(), true );
CHECK( stylesElement.nextSibling().isNull(), false );
- CHECK( stylesElement.localName(), QString("automatic-styles") );
+ CHECK( stylesElement.localName(), TQString("automatic-styles") );
// also same <office:automatic-styles>, but without namedItemNS
KoXmlNode styles2Element;
styles2Element = contentElement.firstChild().toElement();
CHECK( styles2Element.isNull(), false );
CHECK( styles2Element.isElement(), true );
- CHECK( styles2Element.parentNode().isNull(), false );
- CHECK( styles2Element.parentNode()==contentElement, true );
+ CHECK( styles2Element.tqparentNode().isNull(), false );
+ CHECK( styles2Element.tqparentNode()==contentElement, true );
CHECK( styles2Element.firstChild().isNull(), true );
CHECK( styles2Element.lastChild().isNull(), true );
CHECK( styles2Element.previousSibling().isNull(), true );
CHECK( styles2Element.nextSibling().isNull(), false );
- CHECK( styles2Element.localName(), QString("automatic-styles") );
+ CHECK( styles2Element.localName(), TQString("automatic-styles") );
// <office:body>
KoXmlElement bodyElement;
bodyElement = KoXml::namedItemNS( contentElement, officeNS, "body" );
CHECK( bodyElement.isNull(), false );
CHECK( bodyElement.isElement(), true );
- CHECK( bodyElement.parentNode().isNull(), false );
- CHECK( bodyElement.parentNode()==contentElement, true );
+ CHECK( bodyElement.tqparentNode().isNull(), false );
+ CHECK( bodyElement.tqparentNode()==contentElement, true );
CHECK( bodyElement.firstChild().isNull(), false );
CHECK( bodyElement.lastChild().isNull(), false );
CHECK( bodyElement.previousSibling().isNull(), false );
CHECK( bodyElement.nextSibling().isNull(), true );
- CHECK( bodyElement.localName(), QString("body") );
+ CHECK( bodyElement.localName(), TQString("body") );
// also same <office:body>, but without namedItemNS
KoXmlElement body2Element;
body2Element = stylesElement.nextSibling().toElement();
CHECK( body2Element.isNull(), false );
CHECK( body2Element.isElement(), true );
- CHECK( body2Element.parentNode().isNull(), false );
- CHECK( body2Element.parentNode()==contentElement, true );
+ CHECK( body2Element.tqparentNode().isNull(), false );
+ CHECK( body2Element.tqparentNode()==contentElement, true );
CHECK( body2Element.firstChild().isNull(), false );
CHECK( body2Element.lastChild().isNull(), false );
CHECK( body2Element.previousSibling().isNull(), false );
CHECK( body2Element.nextSibling().isNull(), true );
- CHECK( body2Element.localName(), QString("body") );
+ CHECK( body2Element.localName(), TQString("body") );
// <office:text>
KoXmlElement textElement;
textElement = KoXml::namedItemNS( bodyElement, officeNS, "text" );
CHECK( textElement.isNull(), false );
CHECK( textElement.isElement(), true );
- CHECK( textElement.parentNode().isNull(), false );
- CHECK( textElement.parentNode()==bodyElement, true );
+ CHECK( textElement.tqparentNode().isNull(), false );
+ CHECK( textElement.tqparentNode()==bodyElement, true );
CHECK( textElement.firstChild().isNull(), false );
CHECK( textElement.lastChild().isNull(), false );
CHECK( textElement.previousSibling().isNull(), true );
CHECK( textElement.nextSibling().isNull(), true );
- CHECK( textElement.localName(), QString("text") );
+ CHECK( textElement.localName(), TQString("text") );
// the same <office:text>, but without namedItemNS
KoXmlElement text2Element;
text2Element = bodyElement.firstChild().toElement();
CHECK( text2Element.isNull(), false );
CHECK( text2Element.isElement(), true );
- CHECK( text2Element.parentNode().isNull(), false );
- CHECK( text2Element.parentNode()==bodyElement, true );
+ CHECK( text2Element.tqparentNode().isNull(), false );
+ CHECK( text2Element.tqparentNode()==bodyElement, true );
CHECK( text2Element.firstChild().isNull(), false );
CHECK( text2Element.lastChild().isNull(), false );
CHECK( text2Element.previousSibling().isNull(), true );
CHECK( text2Element.nextSibling().isNull(), true );
- CHECK( text2Element.localName(), QString("text") );
+ CHECK( text2Element.localName(), TQString("text") );
// <text:p>
KoXmlElement parElement;
parElement = textElement.firstChild().toElement();
CHECK( parElement.isNull(), false );
CHECK( parElement.isElement(), true );
- CHECK( parElement.parentNode().isNull(), false );
- CHECK( parElement.parentNode()==textElement, true );
+ CHECK( parElement.tqparentNode().isNull(), false );
+ CHECK( parElement.tqparentNode()==textElement, true );
CHECK( parElement.firstChild().isNull(), false );
CHECK( parElement.lastChild().isNull(), false );
CHECK( parElement.previousSibling().isNull(), true );
CHECK( parElement.nextSibling().isNull(), true );
- CHECK( parElement.tagName(), QString("p") );
- CHECK( parElement.text(), QString("Hello, world!") );
- CHECK( parElement.attributeNS( QString(textNS),"style-name",""), QString("Standard") );
+ CHECK( parElement.tagName(), TQString("p") );
+ CHECK( parElement.text(), TQString("Hello, world!") );
+ CHECK( parElement.attributeNS( TQString(textNS),"style-name",""), TQString("Standard") );
}
void testSimpleOpenDocumentSpreadsheet()
{
- QString errorMsg;
+ TQString errorMsg;
int errorLine = 0;
int errorColumn = 0;
- QByteArray xmlbuf;
- QBuffer xmldevice( xmlbuf );
- QTextStream xmlstream( xmlbuf, IO_WriteOnly );
+ TQByteArray xmlbuf;
+ TQBuffer xmldevice( xmlbuf );
+ TQTextStream xmlstream( xmlbuf, IO_WriteOnly );
// content.xml from a simple OpenDocument spreadsheet
// the document has three worksheets, the last two are empty.
@@ -1244,65 +1244,65 @@ void testSimpleOpenDocumentSpreadsheet()
CHECK( errorLine, 0 );
CHECK( errorColumn, 0 );
- QString officeNS = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
- QString tableNS = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
- QString textNS = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
+ TQString officeNS = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
+ TQString tableNS = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
+ TQString textNS = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
// <office:document-content>
KoXmlElement contentElement;
contentElement = doc.documentElement();
CHECK( contentElement.isNull(), false );
CHECK( contentElement.isElement(), true );
- CHECK( contentElement.parentNode().isNull(), false );
- CHECK( contentElement.parentNode().toDocument()==doc, true );
+ CHECK( contentElement.tqparentNode().isNull(), false );
+ CHECK( contentElement.tqparentNode().toDocument()==doc, true );
CHECK( contentElement.firstChild().isNull(), false );
CHECK( contentElement.lastChild().isNull(), false );
CHECK( contentElement.previousSibling().isNull(), false );
CHECK( contentElement.nextSibling().isNull(), true );
- CHECK( contentElement.localName(), QString("document-content") );
+ CHECK( contentElement.localName(), TQString("document-content") );
// <office:body>
KoXmlElement bodyElement;
bodyElement = contentElement.firstChild().toElement();
CHECK( bodyElement.isNull(), false );
CHECK( bodyElement.isElement(), true );
- CHECK( bodyElement.parentNode().isNull(), false );
- CHECK( bodyElement.parentNode()==contentElement, true );
+ CHECK( bodyElement.tqparentNode().isNull(), false );
+ CHECK( bodyElement.tqparentNode()==contentElement, true );
CHECK( bodyElement.firstChild().isNull(), false );
CHECK( bodyElement.lastChild().isNull(), false );
CHECK( bodyElement.previousSibling().isNull(), true );
CHECK( bodyElement.nextSibling().isNull(), true );
- CHECK( bodyElement.localName(), QString("body") );
+ CHECK( bodyElement.localName(), TQString("body") );
// <office:spreadsheet>
KoXmlElement spreadsheetElement;
spreadsheetElement = bodyElement.firstChild().toElement();
CHECK( spreadsheetElement.isNull(), false );
CHECK( spreadsheetElement.isElement(), true );
- CHECK( spreadsheetElement.parentNode().isNull(), false );
- CHECK( spreadsheetElement.parentNode()==bodyElement, true );
+ CHECK( spreadsheetElement.tqparentNode().isNull(), false );
+ CHECK( spreadsheetElement.tqparentNode()==bodyElement, true );
CHECK( spreadsheetElement.firstChild().isNull(), false );
CHECK( spreadsheetElement.lastChild().isNull(), false );
CHECK( spreadsheetElement.previousSibling().isNull(), true );
CHECK( spreadsheetElement.nextSibling().isNull(), true );
- CHECK( spreadsheetElement.localName(), QString("spreadsheet") );
+ CHECK( spreadsheetElement.localName(), TQString("spreadsheet") );
// <table:table> for Sheet1
KoXmlElement sheet1Element;
sheet1Element = spreadsheetElement.firstChild().toElement();
CHECK( sheet1Element.isNull(), false );
CHECK( sheet1Element.isElement(), true );
- CHECK( sheet1Element.parentNode().isNull(), false );
- CHECK( sheet1Element.parentNode()==spreadsheetElement, true );
+ CHECK( sheet1Element.tqparentNode().isNull(), false );
+ CHECK( sheet1Element.tqparentNode()==spreadsheetElement, true );
CHECK( sheet1Element.firstChild().isNull(), false );
CHECK( sheet1Element.lastChild().isNull(), false );
CHECK( sheet1Element.previousSibling().isNull(), true );
CHECK( sheet1Element.nextSibling().isNull(), false );
- CHECK( sheet1Element.tagName(), QString("table") );
+ CHECK( sheet1Element.tagName(), TQString("table") );
CHECK( sheet1Element.hasAttributeNS(tableNS,"name"), true );
- CHECK( sheet1Element.attributeNS(tableNS,"name",""), QString("Sheet1") );
- CHECK( sheet1Element.attributeNS(tableNS,"style-name",""), QString("ta1") );
- CHECK( sheet1Element.attributeNS(tableNS,"print",""), QString("false") );
+ CHECK( sheet1Element.attributeNS(tableNS,"name",""), TQString("Sheet1") );
+ CHECK( sheet1Element.attributeNS(tableNS,"style-name",""), TQString("ta1") );
+ CHECK( sheet1Element.attributeNS(tableNS,"print",""), TQString("false") );
KoXml::load( sheet1Element, 100 );
@@ -1311,94 +1311,94 @@ void testSimpleOpenDocumentSpreadsheet()
columnElement = sheet1Element.firstChild().toElement();
CHECK( columnElement.isNull(), false );
CHECK( columnElement.isElement(), true );
- CHECK( columnElement.parentNode().isNull(), false );
- CHECK( columnElement.parentNode()==sheet1Element, true );
+ CHECK( columnElement.tqparentNode().isNull(), false );
+ CHECK( columnElement.tqparentNode()==sheet1Element, true );
CHECK( columnElement.firstChild().isNull(), true );
CHECK( columnElement.lastChild().isNull(), true );
CHECK( columnElement.previousSibling().isNull(), true );
CHECK( columnElement.nextSibling().isNull(), false );
- CHECK( columnElement.tagName(), QString("table-column") );
- CHECK( columnElement.attributeNS(tableNS,"style-name",""), QString("co1") );
- CHECK( columnElement.attributeNS(tableNS,"default-cell-style-name",""), QString("Default") );
+ CHECK( columnElement.tagName(), TQString("table-column") );
+ CHECK( columnElement.attributeNS(tableNS,"style-name",""), TQString("co1") );
+ CHECK( columnElement.attributeNS(tableNS,"default-cell-style-name",""), TQString("Default") );
// <table:table-row>
KoXmlElement rowElement;
rowElement = columnElement.nextSibling().toElement();
CHECK( rowElement.isNull(), false );
CHECK( rowElement.isElement(), true );
- CHECK( rowElement.parentNode().isNull(), false );
- CHECK( rowElement.parentNode()==sheet1Element, true );
+ CHECK( rowElement.tqparentNode().isNull(), false );
+ CHECK( rowElement.tqparentNode()==sheet1Element, true );
CHECK( rowElement.firstChild().isNull(), false );
CHECK( rowElement.lastChild().isNull(), false );
CHECK( rowElement.previousSibling().isNull(), false );
CHECK( rowElement.nextSibling().isNull(), true );
- CHECK( rowElement.tagName(), QString("table-row") );
- CHECK( rowElement.attributeNS(tableNS,"style-name",""), QString("ro1") );
+ CHECK( rowElement.tagName(), TQString("table-row") );
+ CHECK( rowElement.attributeNS(tableNS,"style-name",""), TQString("ro1") );
// <table:table-cell>
KoXmlElement cellElement;
cellElement = rowElement.firstChild().toElement();
CHECK( cellElement.isNull(), false );
CHECK( cellElement.isElement(), true );
- CHECK( cellElement.parentNode().isNull(), false );
- CHECK( cellElement.parentNode()==rowElement, true );
+ CHECK( cellElement.tqparentNode().isNull(), false );
+ CHECK( cellElement.tqparentNode()==rowElement, true );
CHECK( cellElement.firstChild().isNull(), false );
CHECK( cellElement.lastChild().isNull(), false );
CHECK( cellElement.previousSibling().isNull(), true );
CHECK( cellElement.nextSibling().isNull(), true );
- CHECK( cellElement.tagName(), QString("table-cell") );
- CHECK( cellElement.attributeNS(officeNS,"value-type",""), QString("string") );
+ CHECK( cellElement.tagName(), TQString("table-cell") );
+ CHECK( cellElement.attributeNS(officeNS,"value-type",""), TQString("string") );
// <text:p>
KoXmlElement parElement;
parElement = cellElement.firstChild().toElement();
CHECK( parElement.isNull(), false );
CHECK( parElement.isElement(), true );
- CHECK( parElement.parentNode().isNull(), false );
- CHECK( parElement.parentNode()==cellElement, true );
+ CHECK( parElement.tqparentNode().isNull(), false );
+ CHECK( parElement.tqparentNode()==cellElement, true );
CHECK( parElement.firstChild().isNull(), false );
CHECK( parElement.lastChild().isNull(), false );
CHECK( parElement.previousSibling().isNull(), true );
CHECK( parElement.nextSibling().isNull(), true );
- CHECK( parElement.tagName(), QString("p") );
- CHECK( parElement.text(), QString("Hello, world") );
+ CHECK( parElement.tagName(), TQString("p") );
+ CHECK( parElement.text(), TQString("Hello, world") );
// <table:table> for Sheet2
KoXmlElement sheet2Element;
sheet2Element = sheet1Element.nextSibling().toElement();
CHECK( sheet2Element.isNull(), false );
CHECK( sheet2Element.isElement(), true );
- CHECK( sheet2Element.parentNode().isNull(), false );
- CHECK( sheet2Element.parentNode()==spreadsheetElement, true );
+ CHECK( sheet2Element.tqparentNode().isNull(), false );
+ CHECK( sheet2Element.tqparentNode()==spreadsheetElement, true );
CHECK( sheet2Element.firstChild().isNull(), false );
CHECK( sheet2Element.lastChild().isNull(), false );
CHECK( sheet2Element.previousSibling().isNull(), false );
CHECK( sheet2Element.nextSibling().isNull(), false );
- CHECK( sheet2Element.tagName(), QString("table") );
+ CHECK( sheet2Element.tagName(), TQString("table") );
// </table:table> for Sheet3
KoXmlElement sheet3Element;
sheet3Element = sheet2Element.nextSibling().toElement();
CHECK( sheet3Element.isNull(), false );
CHECK( sheet3Element.isElement(), true );
- CHECK( sheet3Element.parentNode().isNull(), false );
- CHECK( sheet3Element.parentNode()==spreadsheetElement, true );
+ CHECK( sheet3Element.tqparentNode().isNull(), false );
+ CHECK( sheet3Element.tqparentNode()==spreadsheetElement, true );
CHECK( sheet3Element.firstChild().isNull(), false );
CHECK( sheet3Element.lastChild().isNull(), false );
CHECK( sheet3Element.previousSibling().isNull(), false );
CHECK( sheet3Element.nextSibling().isNull(), true );
- CHECK( sheet3Element.tagName(), QString("table") );
+ CHECK( sheet3Element.tagName(), TQString("table") );
}
void testSimpleOpenDocumentPresentation()
{
- QString errorMsg;
+ TQString errorMsg;
int errorLine = 0;
int errorColumn = 0;
- QByteArray xmlbuf;
- QBuffer xmldevice( xmlbuf );
- QTextStream xmlstream( xmlbuf, IO_WriteOnly );
+ TQByteArray xmlbuf;
+ TQBuffer xmldevice( xmlbuf );
+ TQTextStream xmlstream( xmlbuf, IO_WriteOnly );
// content.xml from a simple OpenDocument presentation
// styles, declarations and unnecessary namespaces are omitted
@@ -1419,9 +1419,9 @@ void testSimpleOpenDocumentPresentation()
xmlstream << " <office:presentation>";
xmlstream << " <draw:page draw:name=\"Title\" draw:style-name=\"dp1\" ";
xmlstream << " draw:master-page-name=\"lyt-cool\" ";
- xmlstream << " presentation:presentation-page-layout-name=\"AL1T0\">";
+ xmlstream << " presentation:presentation-page-tqlayout-name=\"AL1T0\">";
xmlstream << " <draw:frame presentation:style-name=\"pr1\" ";
- xmlstream << " draw:text-style-name=\"P2\" draw:layer=\"layout\" ";
+ xmlstream << " draw:text-style-name=\"P2\" draw:layer=\"tqlayout\" ";
xmlstream << " svg:width=\"23.912cm\" svg:height=\"3.508cm\" ";
xmlstream << " svg:x=\"2.058cm\" svg:y=\"1.543cm\" ";
xmlstream << " presentation:class=\"title\" ";
@@ -1431,7 +1431,7 @@ void testSimpleOpenDocumentPresentation()
xmlstream << " </draw:text-box>";
xmlstream << " </draw:frame>";
xmlstream << " <draw:frame presentation:style-name=\"pr2\" ";
- xmlstream << " draw:text-style-name=\"P3\" draw:layer=\"layout\"";
+ xmlstream << " draw:text-style-name=\"P3\" draw:layer=\"tqlayout\"";
xmlstream << " svg:width=\"23.912cm\" svg:height=\"13.231cm\"";
xmlstream << " svg:x=\"2.058cm\" svg:y=\"5.838cm\" ";
xmlstream << " presentation:class=\"subtitle\">";
@@ -1440,8 +1440,8 @@ void testSimpleOpenDocumentPresentation()
xmlstream << " </draw:text-box>";
xmlstream << " </draw:frame>";
xmlstream << " <presentation:notes draw:style-name=\"dp2\">";
- xmlstream << " <draw:page-thumbnail draw:style-name=\"gr1\" draw:layer=\"layout\" svg:width=\"13.706cm\" svg:height=\"10.28cm\" svg:x=\"3.647cm\" svg:y=\"2.853cm\" draw:page-number=\"1\" presentation:class=\"page\"/>";
- xmlstream << " <draw:frame presentation:style-name=\"pr3\" draw:text-style-name=\"P1\" draw:layer=\"layout\" svg:width=\"14.518cm\" svg:height=\"11.411cm\" svg:x=\"3.249cm\" svg:y=\"14.13cm\" presentation:class=\"notes\" presentation:placeholder=\"true\">";
+ xmlstream << " <draw:page-thumbnail draw:style-name=\"gr1\" draw:layer=\"tqlayout\" svg:width=\"13.706cm\" svg:height=\"10.28cm\" svg:x=\"3.647cm\" svg:y=\"2.853cm\" draw:page-number=\"1\" presentation:class=\"page\"/>";
+ xmlstream << " <draw:frame presentation:style-name=\"pr3\" draw:text-style-name=\"P1\" draw:layer=\"tqlayout\" svg:width=\"14.518cm\" svg:height=\"11.411cm\" svg:x=\"3.249cm\" svg:y=\"14.13cm\" presentation:class=\"notes\" presentation:placeholder=\"true\">";
xmlstream << " <draw:text-box/>";
xmlstream << " </draw:frame>";
xmlstream << " </presentation:notes>";
@@ -1469,236 +1469,236 @@ void testSimpleOpenDocumentPresentation()
CHECK( contentElement.isNull(), false );
CHECK( contentElement.isElement(), true );
- CHECK( contentElement.parentNode().isNull(), false );
- CHECK( contentElement.parentNode().toDocument()==doc, true );
+ CHECK( contentElement.tqparentNode().isNull(), false );
+ CHECK( contentElement.tqparentNode().toDocument()==doc, true );
CHECK( contentElement.firstChild().isNull(), false );
CHECK( contentElement.lastChild().isNull(), false );
CHECK( contentElement.previousSibling().isNull(), false );
CHECK( contentElement.nextSibling().isNull(), true );
- CHECK( contentElement.localName(), QString("document-content") );
+ CHECK( contentElement.localName(), TQString("document-content") );
CHECK( contentElement.hasAttributeNS(officeNS,"version"), true );
- CHECK( contentElement.attributeNS(officeNS,"version",""), QString("1.0") );
+ CHECK( contentElement.attributeNS(officeNS,"version",""), TQString("1.0") );
// <office:scripts>
KoXmlElement scriptsElement;
scriptsElement = KoXml::namedItemNS( contentElement, officeNS, "scripts" );
CHECK( scriptsElement.isNull(), false );
CHECK( scriptsElement.isElement(), true );
- CHECK( scriptsElement.parentNode().isNull(), false );
- CHECK( scriptsElement.parentNode()==contentElement, true );
+ CHECK( scriptsElement.tqparentNode().isNull(), false );
+ CHECK( scriptsElement.tqparentNode()==contentElement, true );
CHECK( scriptsElement.firstChild().isNull(), true );
CHECK( scriptsElement.lastChild().isNull(), true );
CHECK( scriptsElement.previousSibling().isNull(), true );
CHECK( scriptsElement.nextSibling().isNull(), false );
- CHECK( scriptsElement.localName(), QString("scripts") );
+ CHECK( scriptsElement.localName(), TQString("scripts") );
// <office:automatic-styles>
KoXmlElement stylesElement;
stylesElement = KoXml::namedItemNS( contentElement, officeNS, "automatic-styles" );
CHECK( stylesElement.isNull(), false );
CHECK( stylesElement.isElement(), true );
- CHECK( stylesElement.parentNode().isNull(), false );
- CHECK( stylesElement.parentNode()==contentElement, true );
+ CHECK( stylesElement.tqparentNode().isNull(), false );
+ CHECK( stylesElement.tqparentNode()==contentElement, true );
CHECK( stylesElement.firstChild().isNull(), true );
CHECK( stylesElement.lastChild().isNull(), true );
CHECK( stylesElement.previousSibling().isNull(), false );
CHECK( stylesElement.nextSibling().isNull(), false );
- CHECK( stylesElement.localName(), QString("automatic-styles") );
+ CHECK( stylesElement.localName(), TQString("automatic-styles") );
// also same <office:automatic-styles>, but without namedItemNS
KoXmlNode styles2Element;
styles2Element = scriptsElement.nextSibling().toElement();
CHECK( styles2Element.isNull(), false );
CHECK( styles2Element.isElement(), true );
- CHECK( styles2Element.parentNode().isNull(), false );
- CHECK( styles2Element.parentNode()==contentElement, true );
+ CHECK( styles2Element.tqparentNode().isNull(), false );
+ CHECK( styles2Element.tqparentNode()==contentElement, true );
CHECK( styles2Element.firstChild().isNull(), true );
CHECK( styles2Element.lastChild().isNull(), true );
CHECK( styles2Element.previousSibling().isNull(), false );
CHECK( styles2Element.nextSibling().isNull(), false );
- CHECK( styles2Element.localName(), QString("automatic-styles") );
+ CHECK( styles2Element.localName(), TQString("automatic-styles") );
// <office:body>
KoXmlElement bodyElement;
bodyElement = KoXml::namedItemNS( contentElement, officeNS, "body" );
CHECK( bodyElement.isNull(), false );
CHECK( bodyElement.isElement(), true );
- CHECK( bodyElement.parentNode().isNull(), false );
- CHECK( bodyElement.parentNode()==contentElement, true );
+ CHECK( bodyElement.tqparentNode().isNull(), false );
+ CHECK( bodyElement.tqparentNode()==contentElement, true );
CHECK( bodyElement.firstChild().isNull(), false );
CHECK( bodyElement.lastChild().isNull(), false );
CHECK( bodyElement.previousSibling().isNull(), false );
CHECK( bodyElement.nextSibling().isNull(), true );
- CHECK( bodyElement.localName(), QString("body") );
+ CHECK( bodyElement.localName(), TQString("body") );
// also same <office:body>, but without namedItemNS
KoXmlElement body2Element;
body2Element = stylesElement.nextSibling().toElement();
CHECK( body2Element.isNull(), false );
CHECK( body2Element.isElement(), true );
- CHECK( body2Element.parentNode().isNull(), false );
- CHECK( body2Element.parentNode()==contentElement, true );
+ CHECK( body2Element.tqparentNode().isNull(), false );
+ CHECK( body2Element.tqparentNode()==contentElement, true );
CHECK( body2Element.firstChild().isNull(), false );
CHECK( body2Element.lastChild().isNull(), false );
CHECK( body2Element.previousSibling().isNull(), false );
CHECK( body2Element.nextSibling().isNull(), true );
- CHECK( body2Element.localName(), QString("body") );
+ CHECK( body2Element.localName(), TQString("body") );
// <office:presentation>
KoXmlElement presentationElement;
presentationElement = KoXml::namedItemNS( bodyElement, officeNS, "presentation" );
CHECK( presentationElement.isNull(), false );
CHECK( presentationElement.isElement(), true );
- CHECK( presentationElement.parentNode().isNull(), false );
- CHECK( presentationElement.parentNode()==bodyElement, true );
+ CHECK( presentationElement.tqparentNode().isNull(), false );
+ CHECK( presentationElement.tqparentNode()==bodyElement, true );
CHECK( presentationElement.firstChild().isNull(), false );
CHECK( presentationElement.lastChild().isNull(), false );
CHECK( presentationElement.previousSibling().isNull(), true );
CHECK( presentationElement.nextSibling().isNull(), true );
- CHECK( presentationElement.localName(), QString("presentation") );
+ CHECK( presentationElement.localName(), TQString("presentation") );
// the same <office:presentation>, but without namedItemNS
KoXmlElement presentation2Element;
presentation2Element = bodyElement.firstChild().toElement();
CHECK( presentation2Element.isNull(), false );
CHECK( presentation2Element.isElement(), true );
- CHECK( presentation2Element.parentNode().isNull(), false );
- CHECK( presentation2Element.parentNode()==bodyElement, true );
+ CHECK( presentation2Element.tqparentNode().isNull(), false );
+ CHECK( presentation2Element.tqparentNode()==bodyElement, true );
CHECK( presentation2Element.firstChild().isNull(), false );
CHECK( presentation2Element.lastChild().isNull(), false );
CHECK( presentation2Element.previousSibling().isNull(), true );
CHECK( presentation2Element.nextSibling().isNull(), true );
- CHECK( presentation2Element.localName(), QString("presentation") );
+ CHECK( presentation2Element.localName(), TQString("presentation") );
// <draw:page> for "Title"
KoXmlElement titlePageElement;
titlePageElement = presentationElement.firstChild().toElement();
CHECK( titlePageElement.isNull(), false );
CHECK( titlePageElement.isElement(), true );
- CHECK( titlePageElement.parentNode().isNull(), false );
- CHECK( titlePageElement.parentNode()==presentationElement, true );
+ CHECK( titlePageElement.tqparentNode().isNull(), false );
+ CHECK( titlePageElement.tqparentNode()==presentationElement, true );
CHECK( titlePageElement.firstChild().isNull(), false );
CHECK( titlePageElement.lastChild().isNull(), false );
CHECK( titlePageElement.previousSibling().isNull(), true );
CHECK( titlePageElement.nextSibling().isNull(), false );
- CHECK( titlePageElement.localName(), QString("page") );
- CHECK( titlePageElement.attributeNS(drawNS,"name",""), QString("Title") );
- CHECK( titlePageElement.attributeNS(drawNS,"style-name",""), QString("dp1") );
- CHECK( titlePageElement.attributeNS(drawNS,"master-page-name",""), QString("lyt-cool") );
+ CHECK( titlePageElement.localName(), TQString("page") );
+ CHECK( titlePageElement.attributeNS(drawNS,"name",""), TQString("Title") );
+ CHECK( titlePageElement.attributeNS(drawNS,"style-name",""), TQString("dp1") );
+ CHECK( titlePageElement.attributeNS(drawNS,"master-page-name",""), TQString("lyt-cool") );
CHECK( titlePageElement.attributeNS(presentationNS,
- "presentation-page-layout-name",""), QString("AL1T0") );
+ "presentation-page-tqlayout-name",""), TQString("AL1T0") );
// <draw:frame> for the title frame
KoXmlElement titleFrameElement;
titleFrameElement = titlePageElement.firstChild().toElement();
CHECK( titleFrameElement.isNull(), false );
CHECK( titleFrameElement.isElement(), true );
- CHECK( titleFrameElement.parentNode().isNull(), false );
- CHECK( titleFrameElement.parentNode()==titlePageElement, true );
+ CHECK( titleFrameElement.tqparentNode().isNull(), false );
+ CHECK( titleFrameElement.tqparentNode()==titlePageElement, true );
CHECK( titleFrameElement.firstChild().isNull(), false );
CHECK( titleFrameElement.lastChild().isNull(), false );
CHECK( titleFrameElement.previousSibling().isNull(), true );
CHECK( titleFrameElement.nextSibling().isNull(), false );
- CHECK( titleFrameElement.localName(), QString("frame") );
- CHECK( titleFrameElement.attributeNS(presentationNS,"style-name",""), QString("pr1") );
- CHECK( titleFrameElement.attributeNS(presentationNS,"class",""), QString("title") );
- CHECK( titleFrameElement.attributeNS(presentationNS,"user-transformed",""), QString("true") );
- CHECK( titleFrameElement.attributeNS(drawNS,"text-style-name",""), QString("P2") );
- CHECK( titleFrameElement.attributeNS(drawNS,"layer",""), QString("layout") );
- CHECK( titleFrameElement.attributeNS(svgNS,"width",""), QString("23.912cm") );
- CHECK( titleFrameElement.attributeNS(svgNS,"height",""), QString("3.508cm") );
- CHECK( titleFrameElement.attributeNS(svgNS,"x",""), QString("2.058cm") );
- CHECK( titleFrameElement.attributeNS(svgNS,"y",""), QString("1.543cm") );
+ CHECK( titleFrameElement.localName(), TQString("frame") );
+ CHECK( titleFrameElement.attributeNS(presentationNS,"style-name",""), TQString("pr1") );
+ CHECK( titleFrameElement.attributeNS(presentationNS,"class",""), TQString("title") );
+ CHECK( titleFrameElement.attributeNS(presentationNS,"user-transformed",""), TQString("true") );
+ CHECK( titleFrameElement.attributeNS(drawNS,"text-style-name",""), TQString("P2") );
+ CHECK( titleFrameElement.attributeNS(drawNS,"layer",""), TQString("tqlayout") );
+ CHECK( titleFrameElement.attributeNS(svgNS,"width",""), TQString("23.912cm") );
+ CHECK( titleFrameElement.attributeNS(svgNS,"height",""), TQString("3.508cm") );
+ CHECK( titleFrameElement.attributeNS(svgNS,"x",""), TQString("2.058cm") );
+ CHECK( titleFrameElement.attributeNS(svgNS,"y",""), TQString("1.543cm") );
// <draw:text-box> of the title frame
KoXmlElement titleBoxElement;
titleBoxElement = titleFrameElement.firstChild().toElement();
CHECK( titleBoxElement.isNull(), false );
CHECK( titleBoxElement.isElement(), true );
- CHECK( titleBoxElement.parentNode().isNull(), false );
- CHECK( titleBoxElement.parentNode()==titleFrameElement, true );
+ CHECK( titleBoxElement.tqparentNode().isNull(), false );
+ CHECK( titleBoxElement.tqparentNode()==titleFrameElement, true );
CHECK( titleBoxElement.firstChild().isNull(), false );
CHECK( titleBoxElement.lastChild().isNull(), false );
CHECK( titleBoxElement.previousSibling().isNull(), true );
CHECK( titleBoxElement.nextSibling().isNull(), true );
- CHECK( titleBoxElement.localName(), QString("text-box") );
+ CHECK( titleBoxElement.localName(), TQString("text-box") );
// <text:p> for the title text-box
KoXmlElement titleParElement;
titleParElement = titleBoxElement.firstChild().toElement();
CHECK( titleParElement.isNull(), false );
CHECK( titleParElement.isElement(), true );
- CHECK( titleParElement.parentNode().isNull(), false );
- CHECK( titleParElement.parentNode()==titleBoxElement, true );
+ CHECK( titleParElement.tqparentNode().isNull(), false );
+ CHECK( titleParElement.tqparentNode()==titleBoxElement, true );
CHECK( titleParElement.firstChild().isNull(), false );
CHECK( titleParElement.lastChild().isNull(), false );
CHECK( titleParElement.previousSibling().isNull(), true );
CHECK( titleParElement.nextSibling().isNull(), true );
- CHECK( titleParElement.localName(), QString("p") );
- CHECK( titleParElement.attributeNS(textNS,"style-name",""), QString("P1") );
- CHECK( titleParElement.text(), QString("Foobar") );
+ CHECK( titleParElement.localName(), TQString("p") );
+ CHECK( titleParElement.attributeNS(textNS,"style-name",""), TQString("P1") );
+ CHECK( titleParElement.text(), TQString("Foobar") );
// <draw:frame> for the subtitle frame
KoXmlElement subtitleFrameElement;
subtitleFrameElement = titleFrameElement.nextSibling().toElement();
CHECK( subtitleFrameElement.isNull(), false );
CHECK( subtitleFrameElement.isElement(), true );
- CHECK( subtitleFrameElement.parentNode().isNull(), false );
- CHECK( subtitleFrameElement.parentNode()==titlePageElement, true );
+ CHECK( subtitleFrameElement.tqparentNode().isNull(), false );
+ CHECK( subtitleFrameElement.tqparentNode()==titlePageElement, true );
CHECK( subtitleFrameElement.firstChild().isNull(), false );
CHECK( subtitleFrameElement.lastChild().isNull(), false );
CHECK( subtitleFrameElement.previousSibling().isNull(), false );
CHECK( subtitleFrameElement.nextSibling().isNull(), false );
- CHECK( subtitleFrameElement.localName(), QString("frame") );
- CHECK( subtitleFrameElement.attributeNS(presentationNS,"style-name",""), QString("pr2") );
- CHECK( subtitleFrameElement.attributeNS(presentationNS,"class",""), QString("subtitle") );
+ CHECK( subtitleFrameElement.localName(), TQString("frame") );
+ CHECK( subtitleFrameElement.attributeNS(presentationNS,"style-name",""), TQString("pr2") );
+ CHECK( subtitleFrameElement.attributeNS(presentationNS,"class",""), TQString("subtitle") );
CHECK( subtitleFrameElement.hasAttributeNS(presentationNS,"user-transformed"), false );
- CHECK( subtitleFrameElement.attributeNS(drawNS,"text-style-name",""), QString("P3") );
- CHECK( subtitleFrameElement.attributeNS(drawNS,"layer",""), QString("layout") );
- CHECK( subtitleFrameElement.attributeNS(svgNS,"width",""), QString("23.912cm") );
- CHECK( subtitleFrameElement.attributeNS(svgNS,"height",""), QString("13.231cm") );
- CHECK( subtitleFrameElement.attributeNS(svgNS,"x",""), QString("2.058cm") );
- CHECK( subtitleFrameElement.attributeNS(svgNS,"y",""), QString("5.838cm") );
+ CHECK( subtitleFrameElement.attributeNS(drawNS,"text-style-name",""), TQString("P3") );
+ CHECK( subtitleFrameElement.attributeNS(drawNS,"layer",""), TQString("tqlayout") );
+ CHECK( subtitleFrameElement.attributeNS(svgNS,"width",""), TQString("23.912cm") );
+ CHECK( subtitleFrameElement.attributeNS(svgNS,"height",""), TQString("13.231cm") );
+ CHECK( subtitleFrameElement.attributeNS(svgNS,"x",""), TQString("2.058cm") );
+ CHECK( subtitleFrameElement.attributeNS(svgNS,"y",""), TQString("5.838cm") );
// <draw:text-box> of the subtitle frame
KoXmlElement subtitleBoxElement;
subtitleBoxElement = subtitleFrameElement.firstChild().toElement();
CHECK( subtitleBoxElement.isNull(), false );
CHECK( subtitleBoxElement.isElement(), true );
- CHECK( subtitleBoxElement.parentNode().isNull(), false );
- CHECK( subtitleBoxElement.parentNode()==subtitleFrameElement, true );
+ CHECK( subtitleBoxElement.tqparentNode().isNull(), false );
+ CHECK( subtitleBoxElement.tqparentNode()==subtitleFrameElement, true );
CHECK( subtitleBoxElement.firstChild().isNull(), false );
CHECK( subtitleBoxElement.lastChild().isNull(), false );
CHECK( subtitleBoxElement.previousSibling().isNull(), true );
CHECK( subtitleBoxElement.nextSibling().isNull(), true );
- CHECK( subtitleBoxElement.localName(), QString("text-box") );
+ CHECK( subtitleBoxElement.localName(), TQString("text-box") );
// <text:p> for the subtitle text-box
KoXmlElement subtitleParElement;
subtitleParElement = subtitleBoxElement.firstChild().toElement();
CHECK( subtitleParElement.isNull(), false );
CHECK( subtitleParElement.isElement(), true );
- CHECK( subtitleParElement.parentNode().isNull(), false );
- CHECK( subtitleParElement.parentNode()==subtitleBoxElement, true );
+ CHECK( subtitleParElement.tqparentNode().isNull(), false );
+ CHECK( subtitleParElement.tqparentNode()==subtitleBoxElement, true );
CHECK( subtitleParElement.firstChild().isNull(), false );
CHECK( subtitleParElement.lastChild().isNull(), false );
CHECK( subtitleParElement.previousSibling().isNull(), true );
CHECK( subtitleParElement.nextSibling().isNull(), true );
- CHECK( subtitleParElement.localName(), QString("p") );
- CHECK( subtitleParElement.attributeNS(textNS,"style-name",""), QString("P3") );
- CHECK( subtitleParElement.text(), QString("Foo") );
+ CHECK( subtitleParElement.localName(), TQString("p") );
+ CHECK( subtitleParElement.attributeNS(textNS,"style-name",""), TQString("P3") );
+ CHECK( subtitleParElement.text(), TQString("Foo") );
}
void testSimpleOpenDocumentFormula()
{
- QString errorMsg;
+ TQString errorMsg;
int errorLine = 0;
int errorColumn = 0;
- QByteArray xmlbuf;
- QBuffer xmldevice( xmlbuf );
- QTextStream xmlstream( xmlbuf, IO_WriteOnly );
+ TQByteArray xmlbuf;
+ TQBuffer xmldevice( xmlbuf );
+ TQTextStream xmlstream( xmlbuf, IO_WriteOnly );
// content.xml from a simple OpenDocument formula
// this is essentially MathML
@@ -1731,141 +1731,141 @@ void testSimpleOpenDocumentFormula()
mathElement = doc.documentElement();
CHECK( mathElement.isNull(), false );
CHECK( mathElement.isElement(), true );
- CHECK( mathElement.parentNode().isNull(), false );
- CHECK( mathElement.parentNode().toDocument()==doc, true );
+ CHECK( mathElement.tqparentNode().isNull(), false );
+ CHECK( mathElement.tqparentNode().toDocument()==doc, true );
CHECK( mathElement.firstChild().isNull(), false );
CHECK( mathElement.lastChild().isNull(), false );
CHECK( mathElement.previousSibling().isNull(), false );
CHECK( mathElement.nextSibling().isNull(), true );
- CHECK( mathElement.localName(), QString("math") );
+ CHECK( mathElement.localName(), TQString("math") );
// <math:semantics>
KoXmlElement semanticsElement;
semanticsElement = KoXml::namedItemNS( mathElement, mathNS, "semantics" );
CHECK( semanticsElement.isNull(), false );
CHECK( semanticsElement.isElement(), true );
- CHECK( semanticsElement.parentNode().isNull(), false );
- CHECK( semanticsElement.parentNode().toElement()==mathElement, true );
+ CHECK( semanticsElement.tqparentNode().isNull(), false );
+ CHECK( semanticsElement.tqparentNode().toElement()==mathElement, true );
CHECK( semanticsElement.firstChild().isNull(), false );
CHECK( semanticsElement.lastChild().isNull(), false );
CHECK( semanticsElement.previousSibling().isNull(), true );
CHECK( semanticsElement.nextSibling().isNull(), true );
- CHECK( semanticsElement.localName(), QString("semantics") );
+ CHECK( semanticsElement.localName(), TQString("semantics") );
// the same <math:semantics> but without namedItemNS
KoXmlElement semantics2Element;
semantics2Element = mathElement.firstChild().toElement();
CHECK( semantics2Element.isNull(), false );
CHECK( semantics2Element.isElement(), true );
- CHECK( semantics2Element.parentNode().isNull(), false );
- CHECK( semantics2Element.parentNode().toElement()==mathElement, true );
+ CHECK( semantics2Element.tqparentNode().isNull(), false );
+ CHECK( semantics2Element.tqparentNode().toElement()==mathElement, true );
CHECK( semantics2Element.firstChild().isNull(), false );
CHECK( semantics2Element.lastChild().isNull(), false );
CHECK( semantics2Element.previousSibling().isNull(), true );
CHECK( semantics2Element.nextSibling().isNull(), true );
- CHECK( semantics2Element.localName(), QString("semantics") );
+ CHECK( semantics2Element.localName(), TQString("semantics") );
// <math:mrow>
KoXmlElement mrowElement;
mrowElement = semanticsElement.firstChild().toElement();
CHECK( mrowElement.isNull(), false );
CHECK( mrowElement.isElement(), true );
- CHECK( mrowElement.parentNode().isNull(), false );
- CHECK( mrowElement.parentNode().toElement()==semanticsElement, true );
+ CHECK( mrowElement.tqparentNode().isNull(), false );
+ CHECK( mrowElement.tqparentNode().toElement()==semanticsElement, true );
CHECK( mrowElement.firstChild().isNull(), false );
CHECK( mrowElement.lastChild().isNull(), false );
CHECK( mrowElement.previousSibling().isNull(), true );
CHECK( mrowElement.nextSibling().isNull(), false );
- CHECK( mrowElement.localName(), QString("mrow") );
+ CHECK( mrowElement.localName(), TQString("mrow") );
// <math:mi> for "E"
KoXmlElement miElement;
miElement = mrowElement.firstChild().toElement();
CHECK( miElement.isNull(), false );
CHECK( miElement.isElement(), true );
- CHECK( miElement.parentNode().isNull(), false );
- CHECK( miElement.parentNode().toElement()==mrowElement, true );
+ CHECK( miElement.tqparentNode().isNull(), false );
+ CHECK( miElement.tqparentNode().toElement()==mrowElement, true );
CHECK( miElement.firstChild().isNull(), false );
CHECK( miElement.lastChild().isNull(), false );
CHECK( miElement.previousSibling().isNull(), true );
CHECK( miElement.nextSibling().isNull(), false );
- CHECK( miElement.localName(), QString("mi") );
+ CHECK( miElement.localName(), TQString("mi") );
// <math:mo> for "="
KoXmlElement moElement;
moElement = miElement.nextSibling().toElement();
CHECK( moElement.isNull(), false );
CHECK( moElement.isElement(), true );
- CHECK( moElement.parentNode().isNull(), false );
- CHECK( moElement.parentNode().toElement()==mrowElement, true );
+ CHECK( moElement.tqparentNode().isNull(), false );
+ CHECK( moElement.tqparentNode().toElement()==mrowElement, true );
CHECK( moElement.firstChild().isNull(), false );
CHECK( moElement.lastChild().isNull(), false );
CHECK( moElement.previousSibling().isNull(), false );
CHECK( moElement.nextSibling().isNull(), false );
- CHECK( moElement.localName(), QString("mo") );
- CHECK( moElement.attributeNS(mathNS,"stretchy",""), QString("false") );
+ CHECK( moElement.localName(), TQString("mo") );
+ CHECK( moElement.attributeNS(mathNS,"stretchy",""), TQString("false") );
// <math:msup> for "mc" and superscripted "2"
KoXmlElement msupElement;
msupElement = moElement.nextSibling().toElement();
CHECK( msupElement.isNull(), false );
CHECK( msupElement.isElement(), true );
- CHECK( msupElement.parentNode().isNull(), false );
- CHECK( msupElement.parentNode().toElement()==mrowElement, true );
+ CHECK( msupElement.tqparentNode().isNull(), false );
+ CHECK( msupElement.tqparentNode().toElement()==mrowElement, true );
CHECK( msupElement.firstChild().isNull(), false );
CHECK( msupElement.lastChild().isNull(), false );
CHECK( msupElement.previousSibling().isNull(), false );
CHECK( msupElement.nextSibling().isNull(), true );
- CHECK( msupElement.localName(), QString("msup") );
+ CHECK( msupElement.localName(), TQString("msup") );
// <math:mi> inside the <math:msup> for "mc"
KoXmlElement mcElement;
mcElement = msupElement.firstChild().toElement();
CHECK( mcElement.isNull(), false );
CHECK( mcElement.isElement(), true );
- CHECK( mcElement.parentNode().isNull(), false );
- CHECK( mcElement.parentNode().toElement()==msupElement, true );
+ CHECK( mcElement.tqparentNode().isNull(), false );
+ CHECK( mcElement.tqparentNode().toElement()==msupElement, true );
CHECK( mcElement.firstChild().isNull(), false );
CHECK( mcElement.lastChild().isNull(), false );
CHECK( mcElement.previousSibling().isNull(), true );
CHECK( mcElement.nextSibling().isNull(), false );
- CHECK( mcElement.localName(), QString("mi") );
- CHECK( mcElement.text(), QString("mc") );
- CHECK( mcElement.attributeNS(mathNS,"fontstyle",""), QString("italic") );
+ CHECK( mcElement.localName(), TQString("mi") );
+ CHECK( mcElement.text(), TQString("mc") );
+ CHECK( mcElement.attributeNS(mathNS,"fontstyle",""), TQString("italic") );
// <math:mn> inside the <math:msup> for "2" (superscript)
KoXmlElement mnElement;
mnElement = mcElement.nextSibling().toElement();
CHECK( mnElement.isNull(), false );
CHECK( mnElement.isElement(), true );
- CHECK( mnElement.parentNode().isNull(), false );
- CHECK( mnElement.parentNode().toElement()==msupElement, true );
+ CHECK( mnElement.tqparentNode().isNull(), false );
+ CHECK( mnElement.tqparentNode().toElement()==msupElement, true );
CHECK( mnElement.firstChild().isNull(), false );
CHECK( mnElement.lastChild().isNull(), false );
CHECK( mnElement.previousSibling().isNull(), false );
CHECK( mnElement.nextSibling().isNull(), true );
- CHECK( mnElement.localName(), QString("mn") );
- CHECK( mnElement.text(), QString("2") );
+ CHECK( mnElement.localName(), TQString("mn") );
+ CHECK( mnElement.text(), TQString("2") );
// <math:annotation>
KoXmlElement annotationElement;
annotationElement = semanticsElement.lastChild().toElement();
CHECK( annotationElement.isNull(), false );
CHECK( annotationElement.isElement(), true );
- CHECK( annotationElement.parentNode().isNull(), false );
- CHECK( annotationElement.parentNode().toElement()==semanticsElement, true );
+ CHECK( annotationElement.tqparentNode().isNull(), false );
+ CHECK( annotationElement.tqparentNode().toElement()==semanticsElement, true );
CHECK( annotationElement.firstChild().isNull(), false );
CHECK( annotationElement.lastChild().isNull(), false );
CHECK( annotationElement.previousSibling().isNull(), false );
CHECK( annotationElement.nextSibling().isNull(), true );
- CHECK( annotationElement.localName(), QString("annotation") );
- CHECK( annotationElement.text(), QString("E = mc^2 ") );
- CHECK( annotationElement.attributeNS(mathNS,"encoding",""), QString("StarMath 5.0") );
+ CHECK( annotationElement.localName(), TQString("annotation") );
+ CHECK( annotationElement.text(), TQString("E = mc^2 ") );
+ CHECK( annotationElement.attributeNS(mathNS,"encoding",""), TQString("StarMath 5.0") );
}
void testLargeOpenDocumentSpreadsheet()
{
- QString errorMsg;
+ TQString errorMsg;
int errorLine = 0;
int errorColumn = 0;
@@ -1873,9 +1873,9 @@ void testLargeOpenDocumentSpreadsheet()
int rowCount = 200;
int colCount = 200*2;
- QByteArray xmlbuf;
- QBuffer xmldevice( xmlbuf );
- QTextStream xmlstream( xmlbuf, IO_WriteOnly );
+ TQByteArray xmlbuf;
+ TQBuffer xmldevice( xmlbuf );
+ TQTextStream xmlstream( xmlbuf, IO_WriteOnly );
// content.xml
xmlstream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
@@ -1887,7 +1887,7 @@ void testLargeOpenDocumentSpreadsheet()
xmlstream << "<office:spreadsheet>";
for( int i = 0; i < sheetCount; i++ )
{
- QString sheetName = QString("Sheet%1").arg(i+1);
+ TQString sheetName = TQString("Sheet%1").tqarg(i+1);
xmlstream << "<table:table table:name=\"" << sheetName;
xmlstream << "\" table:print=\"false\">";
for( int j = 0; j < rowCount; j++ )
@@ -1909,24 +1909,24 @@ void testLargeOpenDocumentSpreadsheet()
printf("Raw XML size: %d KB\n", xmlbuf.size()/1024 );
- QTime timer;
+ TQTime timer;
timer.start();
#if 1
// just to test parsing speed with plain dumb handler
- QXmlSimpleReader* reader = new QXmlSimpleReader;
+ TQXmlSimpleReader* reader = new TQXmlSimpleReader;
reader->setFeature( "http://xml.org/sax/features/namespaces", true );
- QXmlDefaultHandler handler;
+ TQXmlDefaultHandler handler;
reader->setContentHandler( &handler );
reader->setErrorHandler( &handler );
reader->setLexicalHandler( &handler );
reader->setDeclHandler( &handler );
reader->setDTDHandler( &handler );
- QXmlInputSource xmlSource;
- xmlSource.setData( QString::fromUtf8( xmlbuf.data(), xmlbuf.size() ) );
+ TQXmlInputSource xmlSource;
+ xmlSource.setData( TQString::fromUtf8( xmlbuf.data(), xmlbuf.size() ) );
timer.start();
reader->parse( &xmlSource );
- printf("Large spreadsheet: QXmlDefaultHandler parsing time is %d ms\n", timer.elapsed() );
+ printf("Large spreadsheet: TQXmlDefaultHandler parsing time is %d ms\n", timer.elapsed() );
delete reader;
#endif
@@ -1935,7 +1935,7 @@ void testLargeOpenDocumentSpreadsheet()
// uncomment to see the performance if on-demand/lazy loading is not used
// will definitely eat more memory
-#ifndef KOXML_USE_QDOM
+#ifndef KOXML_USE_TQDOM
doc.setFastLoading( true );
#endif
@@ -1950,30 +1950,30 @@ void testLargeOpenDocumentSpreadsheet()
xmlbuf.resize( 0 );
// namespaces that will be used
- QString officeNS = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
- QString tableNS = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
- QString textNS = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
+ TQString officeNS = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
+ TQString tableNS = "urn:oasis:names:tc:opendocument:xmlns:table:1.0";
+ TQString textNS = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
// <office:document-content>
KoXmlElement contentElement;
contentElement = doc.documentElement();
CHECK( contentElement.isNull(), false );
CHECK( contentElement.isElement(), true );
- CHECK( contentElement.localName(), QString("document-content") );
+ CHECK( contentElement.localName(), TQString("document-content") );
// <office:body>
KoXmlElement bodyElement;
bodyElement = contentElement.firstChild().toElement();
CHECK( bodyElement.isNull(), false );
CHECK( bodyElement.isElement(), true );
- CHECK( bodyElement.localName(), QString("body") );
+ CHECK( bodyElement.localName(), TQString("body") );
// <office:spreadsheet>
KoXmlElement spreadsheetElement;
spreadsheetElement = bodyElement.firstChild().toElement();
CHECK( spreadsheetElement.isNull(), false );
CHECK( spreadsheetElement.isElement(), true );
- CHECK( spreadsheetElement.localName(), QString("spreadsheet") );
+ CHECK( spreadsheetElement.localName(), TQString("spreadsheet") );
// now we visit every sheet, every row, every cell
timer.start();
@@ -1981,19 +1981,19 @@ void testLargeOpenDocumentSpreadsheet()
tableElement = spreadsheetElement.firstChild().toElement();
for( int table=0; table < sheetCount; table++ )
{
- QString tableName = QString("Sheet%1").arg(table+1);
+ TQString tableName = TQString("Sheet%1").tqarg(table+1);
CHECK( tableElement.isNull(), false );
CHECK( tableElement.isElement(), true );
- CHECK( tableElement.localName(), QString("table") );
+ CHECK( tableElement.localName(), TQString("table") );
CHECK( tableElement.hasAttributeNS(tableNS,"name"), true );
CHECK( tableElement.attributeNS(tableNS,"name",""), tableName );
- CHECK( tableElement.attributeNS(tableNS,"print",""), QString("false") );
+ CHECK( tableElement.attributeNS(tableNS,"print",""), TQString("false") );
// load everything for this table
KoXml::load( tableElement, 99 );
- CHECK( tableElement.parentNode().isNull(), false );
- CHECK( tableElement.parentNode()==spreadsheetElement, true );
+ CHECK( tableElement.tqparentNode().isNull(), false );
+ CHECK( tableElement.tqparentNode()==spreadsheetElement, true );
CHECK( tableElement.firstChild().isNull(), false );
CHECK( tableElement.lastChild().isNull(), false );
@@ -2003,9 +2003,9 @@ void testLargeOpenDocumentSpreadsheet()
{
CHECK( rowElement.isNull(), false );
CHECK( rowElement.isElement(), true );
- CHECK( rowElement.localName(), QString("table-row") );
- CHECK( rowElement.parentNode().isNull(), false );
- CHECK( rowElement.parentNode()==tableElement, true );
+ CHECK( rowElement.localName(), TQString("table-row") );
+ CHECK( rowElement.tqparentNode().isNull(), false );
+ CHECK( rowElement.tqparentNode()==tableElement, true );
CHECK( rowElement.firstChild().isNull(), false );
CHECK( rowElement.lastChild().isNull(), false );
@@ -2015,12 +2015,12 @@ void testLargeOpenDocumentSpreadsheet()
{
CHECK( cellElement.isNull(), false );
CHECK( cellElement.isElement(), true );
- CHECK( cellElement.localName(), QString("table-cell") );
- CHECK( cellElement.text(), QString("Hello, world") );
+ CHECK( cellElement.localName(), TQString("table-cell") );
+ CHECK( cellElement.text(), TQString("Hello, world") );
CHECK( cellElement.hasAttributeNS(officeNS,"value-type"), true );
- CHECK( cellElement.attributeNS(officeNS,"value-type",""), QString("string" ) );
- CHECK( cellElement.parentNode().isNull(), false );
- CHECK( cellElement.parentNode()==rowElement, true );
+ CHECK( cellElement.attributeNS(officeNS,"value-type",""), TQString("string" ) );
+ CHECK( cellElement.tqparentNode().isNull(), false );
+ CHECK( cellElement.tqparentNode()==rowElement, true );
CHECK( cellElement.firstChild().isNull(), false );
CHECK( cellElement.lastChild().isNull(), false );
cellElement = cellElement.nextSibling().toElement();
@@ -2063,8 +2063,8 @@ int main( int argc, char** argv )
// testLargeOpenDocumentSpreadsheet();
-#ifdef KOXML_USE_QDOM
- printf("Using QDom: ");
+#ifdef KOXML_USE_TQDOM
+ printf("Using TQDom: ");
#else
printf("Using KoXml: ");
#endif