summaryrefslogtreecommitdiffstats
path: root/lib/kofficecore/tests
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
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')
-rw-r--r--lib/kofficecore/tests/filter_graph.cpp44
-rw-r--r--lib/kofficecore/tests/filterchain_test.cpp8
-rw-r--r--lib/kofficecore/tests/kodomtest.cpp46
-rw-r--r--lib/kofficecore/tests/kogenstylestest.cpp58
-rw-r--r--lib/kofficecore/tests/kooasissettingstest.cpp6
-rw-r--r--lib/kofficecore/tests/kooasisstoretest.cpp10
-rw-r--r--lib/kofficecore/tests/kopointtest.cpp10
-rw-r--r--lib/kofficecore/tests/korecttest.cpp8
-rw-r--r--lib/kofficecore/tests/koxmlreadertest.cpp820
-rw-r--r--lib/kofficecore/tests/priorityqueue_test.cpp8
10 files changed, 509 insertions, 509 deletions
diff --git a/lib/kofficecore/tests/filter_graph.cpp b/lib/kofficecore/tests/filter_graph.cpp
index 22323355..ac25c8d7 100644
--- a/lib/kofficecore/tests/filter_graph.cpp
+++ b/lib/kofficecore/tests/filter_graph.cpp
@@ -17,7 +17,7 @@
* Boston, MA 02110-1301, USA.
*/
-#include <qfile.h>
+#include <tqfile.h>
#include <KoQueryTrader.h>
#include <KoFilterManager.h>
#include <kinstance.h>
@@ -27,51 +27,51 @@ int main( int /*argc*/, char ** /*argv*/ )
{
KInstance instance( "filter_graph" ); // we need an instance when using the trader
- QCString output = "digraph filters {\n";
+ TQCString output = "digraph filters {\n";
// The following code is shamelessly copied over from KOffice::Graph::buildGraph
// It wasn't feasible to do some serious changes in the lib for that tiny bit
// of duplicated code in a test file.
- QValueList<QString> vertices; // to keep track of already inserted values, not performance critical
+ TQValueList<TQString> vertices; // to keep track of already inserted values, not performance critical
// Make sure that all available parts are added to the graph
- QValueList<KoDocumentEntry> parts( KoDocumentEntry::query() );
- QValueList<KoDocumentEntry>::ConstIterator partIt( parts.begin() );
- QValueList<KoDocumentEntry>::ConstIterator partEnd( parts.end() );
+ TQValueList<KoDocumentEntry> parts( KoDocumentEntry::query() );
+ TQValueList<KoDocumentEntry>::ConstIterator partIt( parts.begin() );
+ TQValueList<KoDocumentEntry>::ConstIterator partEnd( parts.end() );
while ( partIt != partEnd ) {
//kdDebug() << ( *partIt ).service()->desktopEntryName() << endl;
- QStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList();
+ TQStringList nativeMimeTypes = ( *partIt ).service()->property( "X-KDE-ExtraNativeMimeTypes" ).toStringList();
nativeMimeTypes += ( *partIt ).service()->property( "X-KDE-NativeMimeType" ).toString();
- QStringList::ConstIterator it = nativeMimeTypes.begin();
- QStringList::ConstIterator end = nativeMimeTypes.end();
+ TQStringList::ConstIterator it = nativeMimeTypes.begin();
+ TQStringList::ConstIterator end = nativeMimeTypes.end();
for ( ; it != end; ++it ) {
- QString key = *it;
+ TQString key = *it;
//kdDebug() << " " << key << endl;
if ( !key.isEmpty() ) {
output += " \"";
output += key.latin1();
- output += "\" [shape=box, style=filled, fillcolor=lightblue];\n";
- if ( vertices.find( key ) == vertices.end() )
+ output += "\" [tqshape=box, style=filled, fillcolor=lightblue];\n";
+ if ( vertices.tqfind( key ) == vertices.end() )
vertices.append( key );
}
}
++partIt;
}
- QValueList<KoFilterEntry::Ptr> filters( KoFilterEntry::query() ); // no constraint here - we want *all* :)
- QValueList<KoFilterEntry::Ptr>::ConstIterator it = filters.begin();
- QValueList<KoFilterEntry::Ptr>::ConstIterator end = filters.end();
+ TQValueList<KoFilterEntry::Ptr> filters( KoFilterEntry::query() ); // no constraint here - we want *all* :)
+ TQValueList<KoFilterEntry::Ptr>::ConstIterator it = filters.begin();
+ TQValueList<KoFilterEntry::Ptr>::ConstIterator end = filters.end();
for ( ; it != end; ++it ) {
kdDebug() << "import " << ( *it )->import << " export " << ( *it )->export_ << endl;
// First add the "starting points"
- QStringList::ConstIterator importIt = ( *it )->import.begin();
- QStringList::ConstIterator importEnd = ( *it )->import.end();
+ TQStringList::ConstIterator importIt = ( *it )->import.begin();
+ TQStringList::ConstIterator importEnd = ( *it )->import.end();
for ( ; importIt != importEnd; ++importIt ) {
// already there?
- if ( vertices.find( *importIt ) == vertices.end() ) {
+ if ( vertices.tqfind( *importIt ) == vertices.end() ) {
vertices.append( *importIt );
output += " \"";
output += ( *importIt ).latin1();
@@ -79,12 +79,12 @@ int main( int /*argc*/, char ** /*argv*/ )
}
}
- QStringList::ConstIterator exportIt = ( *it )->export_.begin();
- QStringList::ConstIterator exportEnd = ( *it )->export_.end();
+ TQStringList::ConstIterator exportIt = ( *it )->export_.begin();
+ TQStringList::ConstIterator exportEnd = ( *it )->export_.end();
for ( ; exportIt != exportEnd; ++exportIt ) {
// First make sure the export vertex is in place
- if ( vertices.find( *exportIt ) == vertices.end() ) {
+ if ( vertices.tqfind( *exportIt ) == vertices.end() ) {
output += " \"";
output += ( *exportIt ).latin1();
output += "\";\n";
@@ -107,7 +107,7 @@ int main( int /*argc*/, char ** /*argv*/ )
output += "}\n";
- QFile f( "graph.dot" );
+ TQFile f( "graph.dot" );
if ( f.open( IO_WriteOnly ) )
f.writeBlock( output.data(), output.size() - 1 );
f.close();
diff --git a/lib/kofficecore/tests/filterchain_test.cpp b/lib/kofficecore/tests/filterchain_test.cpp
index 23f620a1..773bd02f 100644
--- a/lib/kofficecore/tests/filterchain_test.cpp
+++ b/lib/kofficecore/tests/filterchain_test.cpp
@@ -32,7 +32,7 @@ int main( int /*argc*/, char ** /*argv*/ )
KoFilterManager *manager = new KoFilterManager( 0 );
kdDebug() << "Trying to build some filter chains..." << endl;
- QCString mimeType( "foo/bar" );
+ TQCString mimeType( "foo/bar" );
KoFilterChain::Ptr chain = g.chain( manager, mimeType );
if ( !chain )
kdDebug() << "Chain for 'foo/bar' is not available, OK" << endl;
@@ -79,9 +79,9 @@ int main( int /*argc*/, char ** /*argv*/ )
}
kdDebug() << "Checking mimeFilter() for Import:" << endl;
- QStringList list = KoFilterManager::mimeFilter( "application/x-kword", KoFilterManager::Import );
- QStringList::ConstIterator it = list.begin();
- QStringList::ConstIterator end = list.end();
+ TQStringList list = KoFilterManager::mimeFilter( "application/x-kword", KoFilterManager::Import );
+ TQStringList::ConstIterator it = list.begin();
+ TQStringList::ConstIterator end = list.end();
for ( ; it != end; ++it )
kdDebug() << " " << *it << endl;
kdDebug() << " " << list.count() << " entries." << endl;
diff --git a/lib/kofficecore/tests/kodomtest.cpp b/lib/kofficecore/tests/kodomtest.cpp
index c8e3c539..14cae56e 100644
--- a/lib/kofficecore/tests/kodomtest.cpp
+++ b/lib/kofficecore/tests/kodomtest.cpp
@@ -20,17 +20,17 @@
#include "KoDom.h"
#include "KoXmlNS.h"
-#include <qapplication.h>
+#include <tqapplication.h>
#include <assert.h>
-//static void debugElemNS( const QDomElement& elem )
+//static void debugElemNS( const TQDomElement& elem )
//{
// qDebug( "nodeName=%s tagName=%s localName=%s prefix=%s namespaceURI=%s", elem.nodeName().latin1(), elem.tagName().latin1(), elem.localName().latin1(), elem.prefix().latin1(), elem.namespaceURI().latin1() );
//}
-void testQDom( const QDomDocument& doc )
+void testTQDom( const TQDomDocument& doc )
{
- QDomElement docElem = doc.documentElement();
+ TQDomElement docElem = doc.documentElement();
//debugElemNS( docElem );
assert( docElem.nodeName() == "o:document-content" );
assert( docElem.tagName() == "document-content" );
@@ -39,21 +39,21 @@ void testQDom( const QDomDocument& doc )
assert( docElem.namespaceURI() == KoXmlNS::office );
// WARNING, elementsByTagNameNS is recursive!!!
- QDomNodeList docElemChildren = docElem.elementsByTagNameNS( KoXmlNS::office, "body" );
+ TQDomNodeList docElemChildren = docElem.elementsByTagNameNS( KoXmlNS::office, "body" );
assert( docElemChildren.length() == 1 );
- QDomElement elem = docElemChildren.item( 0 ).toElement();
+ TQDomElement elem = docElemChildren.item( 0 ).toElement();
//debugElemNS( elem );
assert( elem.tagName() == "body" );
assert( elem.localName() == "body" );
assert( elem.prefix() == "o" );
assert( elem.namespaceURI() == KoXmlNS::office );
- QDomNode n = elem.firstChild();
+ TQDomNode n = elem.firstChild();
for ( ; !n.isNull() ; n = n.nextSibling() ) {
if ( !n.isElement() )
continue;
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
//debugElemNS( e );
assert( e.tagName() == "p" );
assert( e.localName() == "p" );
@@ -61,35 +61,35 @@ void testQDom( const QDomDocument& doc )
assert( e.namespaceURI() == KoXmlNS::text );
}
- qDebug("testQDom... ok");
+ qDebug("testTQDom... ok");
}
-void testKoDom( const QDomDocument& doc )
+void testKoDom( const TQDomDocument& doc )
{
- QDomElement docElem = KoDom::namedItemNS( doc, KoXmlNS::office, "document-content" );
+ TQDomElement docElem = KoDom::namedItemNS( doc, KoXmlNS::office, "document-content" );
assert( !docElem.isNull() );
assert( docElem.localName() == "document-content" );
assert( docElem.namespaceURI() == KoXmlNS::office );
- QDomElement body = KoDom::namedItemNS( docElem, KoXmlNS::office, "body" );
+ TQDomElement body = KoDom::namedItemNS( docElem, KoXmlNS::office, "body" );
assert( !body.isNull() );
assert( body.localName() == "body" );
assert( body.namespaceURI() == KoXmlNS::office );
- QDomElement p = KoDom::namedItemNS( body, KoXmlNS::text, "p" );
+ TQDomElement p = KoDom::namedItemNS( body, KoXmlNS::text, "p" );
assert( !p.isNull() );
assert( p.localName() == "p" );
assert( p.namespaceURI() == KoXmlNS::text );
- const QDomElement officeStyle = KoDom::namedItemNS( docElem, KoXmlNS::office, "styles" );
+ const TQDomElement officeStyle = KoDom::namedItemNS( docElem, KoXmlNS::office, "styles" );
assert( !officeStyle.isNull() );
// Look for a non-existing element
- QDomElement notexist = KoDom::namedItemNS( body, KoXmlNS::text, "notexist" );
+ TQDomElement notexist = KoDom::namedItemNS( body, KoXmlNS::text, "notexist" );
assert( notexist.isNull() );
int count = 0;
- QDomElement elem;
+ TQDomElement elem;
forEachElement( elem, body ) {
assert( elem.localName() == "p" );
assert( elem.namespaceURI() == KoXmlNS::text );
@@ -98,8 +98,8 @@ void testKoDom( const QDomDocument& doc )
assert( count == 2 );
// Attributes
- // ### Qt bug: it doesn't work if using style-name instead of text:style-name in the XML
- const QString styleName = p.attributeNS( KoXmlNS::text, "style-name", QString::null );
+ // ### TQt bug: it doesn't work if using style-name instead of text:style-name in the XML
+ const TQString styleName = p.attributeNS( KoXmlNS::text, "style-name", TQString() );
qDebug( "%s", styleName.latin1() );
assert( styleName == "L1" );
@@ -107,9 +107,9 @@ void testKoDom( const QDomDocument& doc )
}
int main( int argc, char** argv ) {
- QApplication app( argc, argv, QApplication::Tty );
+ TQApplication app( argc, argv, TQApplication::Tty );
- const QCString xml = QCString( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
+ const TQCString xml = TQCString( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
"<o:document-content xmlns:o=\"" )
+ KoXmlNS::office
+ "\" xmlns=\"" + KoXmlNS::text
@@ -117,13 +117,13 @@ int main( int argc, char** argv ) {
+ "\">\n"
"<o:body><p text:style-name=\"L1\">foobar</p><p>2nd</p></o:body><o:styles></o:styles>\n"
"</o:document-content>\n";
- QDomDocument doc;
- //QXmlSimpleReader reader;
+ TQDomDocument doc;
+ //TQXmlSimpleReader reader;
//reader.setFeature( "http://xml.org/sax/features/namespaces", TRUE );
//reader.setFeature( "http://xml.org/sax/features/namespace-prefixes", FALSE );
bool ok = doc.setContent( xml, true /* namespace processing */ );
assert( ok );
- testQDom(doc);
+ testTQDom(doc);
testKoDom(doc);
}
diff --git a/lib/kofficecore/tests/kogenstylestest.cpp b/lib/kofficecore/tests/kogenstylestest.cpp
index ddfac1f6..1068cdc4 100644
--- a/lib/kofficecore/tests/kogenstylestest.cpp
+++ b/lib/kofficecore/tests/kogenstylestest.cpp
@@ -27,9 +27,9 @@ int testLookup()
kdDebug() << k_funcinfo << endl;
KoGenStyles coll;
- QMap<QString, QString> map1;
+ TQMap<TQString, TQString> map1;
map1.insert( "map1key", "map1value" );
- QMap<QString, QString> map2;
+ TQMap<TQString, TQString> map2;
map2.insert( "map2key1", "map2value1" );
map2.insert( "map2key2", "map2value2" );
@@ -40,7 +40,7 @@ int testLookup()
first.addStyleMap( map1 );
first.addStyleMap( map2 );
- QString firstName = coll.lookup( first );
+ TQString firstName = coll.lookup( first );
kdDebug() << "The first style got assigned the name " << firstName << endl;
assert( firstName == "A1" ); // it's fine if it's something else, but the koxmlwriter tests require a known name
assert( first.type() == KoGenStyle::STYLE_AUTO );
@@ -52,7 +52,7 @@ int testLookup()
second.addStyleMap( map1 );
second.addStyleMap( map2 );
- QString secondName = coll.lookup( second );
+ TQString secondName = coll.lookup( second );
kdDebug() << "The second style got assigned the name " << secondName << endl;
assert( firstName == secondName ); // check that sharing works
@@ -66,18 +66,18 @@ int testLookup()
KoGenStyle third( KoGenStyle::STYLE_AUTO, "paragraph", secondName ); // inherited style
third.addProperty( "style:margin-left", "1.249cm" );
- third.addProperty( "style:page-number", "0" ); // same as parent
- third.addProperty( "style:foobar", "3", KoGenStyle::TextType ); // different from parent
- assert( third.parentName() == secondName );
+ third.addProperty( "style:page-number", "0" ); // same as tqparent
+ third.addProperty( "style:foobar", "3", KoGenStyle::TextType ); // different from tqparent
+ assert( third.tqparentName() == secondName );
- QString thirdName = coll.lookup( third, "P" );
+ TQString thirdName = coll.lookup( third, "P" );
kdDebug() << "The third style got assigned the name " << thirdName << endl;
assert( thirdName == "P1" );
KoGenStyle user( KoGenStyle::STYLE_USER, "paragraph" ); // differs from third since it doesn't inherit second, and has a different type
user.addProperty( "style:margin-left", "1.249cm" );
- QString userStyleName = coll.lookup( user, "User", KoGenStyles::DontForceNumbering );
+ TQString userStyleName = coll.lookup( user, "User", KoGenStyles::DontForceNumbering );
kdDebug() << "The user style got assigned the name " << userStyleName << endl;
assert( userStyleName == "User" );
@@ -87,8 +87,8 @@ int testLookup()
sameAsParent.addProperty( "style:foobar", "2", KoGenStyle::TextType );
sameAsParent.addStyleMap( map1 );
sameAsParent.addStyleMap( map2 );
- QString sapName = coll.lookup( sameAsParent, "foobar" );
- kdDebug() << "The 'same as parent' style got assigned the name " << sapName << endl;
+ TQString sapName = coll.lookup( sameAsParent, "foobar" );
+ kdDebug() << "The 'same as tqparent' style got assigned the name " << sapName << endl;
assert( sapName == secondName );
assert( coll.styles().count() == 3 );
@@ -102,13 +102,13 @@ int testLookup()
headerStyle.addStyleMap( map1 );
headerStyle.addStyleMap( map2 );
headerStyle.setAutoStyleInStylesDotXml( true );
- QString headerStyleName = coll.lookup( headerStyle, "foobar" );
+ TQString headerStyleName = coll.lookup( headerStyle, "foobar" );
assert( coll.styles().count() == 4 );
assert( coll.styles( KoGenStyle::STYLE_AUTO ).count() == 2 );
assert( coll.styles( KoGenStyle::STYLE_USER ).count() == 1 );
- QValueList<KoGenStyles::NamedStyle> stylesXmlStyles = coll.styles( KoGenStyle::STYLE_AUTO, true );
+ TQValueList<KoGenStyles::NamedStyle> stylesXmlStyles = coll.styles( KoGenStyle::STYLE_AUTO, true );
assert( stylesXmlStyles.count() == 1 );
KoGenStyles::NamedStyle firstStyle = stylesXmlStyles.first();
assert( firstStyle.name == headerStyleName );
@@ -119,13 +119,13 @@ int testLookup()
TEST_BEGIN( 0, 0 );
third.writeStyle( &writer, coll, "style:style", thirdName, "style:paragraph-properties" );
- TEST_END( "XML for third style", "<r>\n <style:style style:name=\"P1\" style:parent-style-name=\"A1\" style:family=\"paragraph\">\n <style:paragraph-properties style:margin-left=\"1.249cm\"/>\n <style:text-properties style:foobar=\"3\"/>\n </style:style>\n</r>\n" );
+ TEST_END( "XML for third style", "<r>\n <style:style style:name=\"P1\" style:tqparent-style-name=\"A1\" style:family=\"paragraph\">\n <style:paragraph-properties style:margin-left=\"1.249cm\"/>\n <style:text-properties style:foobar=\"3\"/>\n </style:style>\n</r>\n" );
coll.markStyleForStylesXml( firstName );
{
- QValueList<KoGenStyles::NamedStyle> stylesXmlStyles = coll.styles( KoGenStyle::STYLE_AUTO, true );
+ TQValueList<KoGenStyles::NamedStyle> stylesXmlStyles = coll.styles( KoGenStyle::STYLE_AUTO, true );
assert( stylesXmlStyles.count() == 2 );
- QValueList<KoGenStyles::NamedStyle> contentXmlStyles = coll.styles( KoGenStyle::STYLE_AUTO, false );
+ TQValueList<KoGenStyles::NamedStyle> contentXmlStyles = coll.styles( KoGenStyle::STYLE_AUTO, false );
assert( contentXmlStyles.count() == 1 );
}
@@ -147,7 +147,7 @@ int testDefaultStyle()
defaultStyle.addAttribute( "style:master-page-name", "Standard" );
defaultStyle.addProperty( "myfont", "isBold" );
defaultStyle.setDefaultStyle( true );
- QString defaultStyleName = coll.lookup( defaultStyle );
+ TQString defaultStyleName = coll.lookup( defaultStyle );
assert( !defaultStyleName.isEmpty() ); // whatever, but not empty
assert( defaultStyle.type() == KoGenStyle::STYLE_AUTO );
assert( defaultStyle.isDefaultStyle() );
@@ -155,7 +155,7 @@ int testDefaultStyle()
KoGenStyle anotherStyle( KoGenStyle::STYLE_AUTO, "paragraph" );
anotherStyle.addAttribute( "style:master-page-name", "Standard" );
anotherStyle.addProperty( "myfont", "isBold" );
- QString anotherStyleName = coll.lookup( anotherStyle );
+ TQString anotherStyleName = coll.lookup( anotherStyle );
assert( anotherStyleName == defaultStyleName );
assert( coll.styles().count() == 1 );
@@ -166,11 +166,11 @@ int testDefaultStyle()
// The kspread case: not writing out all properties, only if they differ
// from the default style.
- // KoGenStyles doesn't fetch info from the parent style when testing
- // for equality, so KSpread uses isEmpty() to check for equality-to-parent.
+ // KoGenStyles doesn't fetch info from the tqparent style when testing
+ // for equality, so KSpread uses isEmpty() to check for equality-to-tqparent.
KoGenStyle dataStyle( KoGenStyle::STYLE_AUTO, "paragraph", defaultStyleName );
assert( dataStyle.isEmpty() );
- // and then it doesn't look up the auto style, but rather uses the parent style directly.
+ // and then it doesn't look up the auto style, but rather uses the tqparent style directly.
return 0;
}
@@ -187,7 +187,7 @@ int testUserStyles()
user1.addAttribute( "style:display-name", "User 1" );
user1.addProperty( "myfont", "isBold" );
- QString user1StyleName = coll.lookup( user1, "User1", KoGenStyles::DontForceNumbering );
+ TQString user1StyleName = coll.lookup( user1, "User1", KoGenStyles::DontForceNumbering );
kdDebug() << "The user style got assigned the name " << user1StyleName << endl;
assert( user1StyleName == "User1" );
@@ -195,25 +195,25 @@ int testUserStyles()
user2.addAttribute( "style:display-name", "User 2" );
user2.addProperty( "myfont", "isBold" );
- QString user2StyleName = coll.lookup( user2, "User2", KoGenStyles::DontForceNumbering );
+ TQString user2StyleName = coll.lookup( user2, "User2", KoGenStyles::DontForceNumbering );
kdDebug() << "The user style got assigned the name " << user2StyleName << endl;
assert( user2StyleName == "User2" );
// And now, what if the data uses that style?
// This is like sameAsParent in the other test, but this time the
- // parent is a STYLE_USER...
+ // tqparent is a STYLE_USER...
KoGenStyle dataStyle( KoGenStyle::STYLE_AUTO, "paragraph", user2StyleName );
dataStyle.addProperty( "myfont", "isBold" );
- QString dataStyleName = coll.lookup( dataStyle, "DataStyle" );
+ TQString dataStyleName = coll.lookup( dataStyle, "DataStyle" );
kdDebug() << "The auto style got assigned the name " << dataStyleName << endl;
- assert( dataStyleName == "User2" ); // it found the parent as equal
+ assert( dataStyleName == "User2" ); // it found the tqparent as equal
// Let's do the opposite test, just to make sure
KoGenStyle dataStyle2( KoGenStyle::STYLE_AUTO, "paragraph", user2StyleName );
dataStyle2.addProperty( "myfont", "isNotBold" );
- QString dataStyle2Name = coll.lookup( dataStyle2, "DataStyle" );
+ TQString dataStyle2Name = coll.lookup( dataStyle2, "DataStyle" );
kdDebug() << "The different auto style got assigned the name " << dataStyle2Name << endl;
assert( dataStyle2Name == "DataStyle1" );
@@ -241,14 +241,14 @@ int testStylesDotXml()
headerStyle.addAttribute( "style:master-page-name", "Standard" );
headerStyle.addProperty( "style:page-number", "0" );
headerStyle.setAutoStyleInStylesDotXml( true );
- QString headerStyleName = coll.lookup( headerStyle, "P" );
+ TQString headerStyleName = coll.lookup( headerStyle, "P" );
assert( headerStyleName == "P1" );
//coll.dump();
KoGenStyle first( KoGenStyle::STYLE_AUTO, "paragraph" );
first.addAttribute( "style:master-page-name", "Standard" );
- QString firstName = coll.lookup( first, "P" );
+ TQString firstName = coll.lookup( first, "P" );
kdDebug() << "The auto style got assigned the name " << firstName << endl;
assert( firstName == "P2" ); // anything but not P1.
return 0;
diff --git a/lib/kofficecore/tests/kooasissettingstest.cpp b/lib/kofficecore/tests/kooasissettingstest.cpp
index ef29536d..a60fbd86 100644
--- a/lib/kofficecore/tests/kooasissettingstest.cpp
+++ b/lib/kofficecore/tests/kooasissettingstest.cpp
@@ -33,7 +33,7 @@ void testSelectItemSet( KoOasisSettings& settings )
void testParseConfigItemString( KoOasisSettings& settings )
{
KoOasisSettings::Items viewSettings = settings.itemSet( "view-settings" );
- const QString unit = viewSettings.parseConfigItemString( "unit" );
+ const TQString unit = viewSettings.parseConfigItemString( "unit" );
qDebug( "%s", unit.latin1() );
assert( unit == "mm" );
kdDebug() << "testParseConfigItemString OK" << endl;
@@ -71,7 +71,7 @@ void testNamedMap( KoOasisSettings& settings )
int main( int, char** ) {
- const QCString xml = "\
+ const TQCString xml = "\
<?xml version=\"1.0\" encoding=\"UTF-8\"?> \
<office:document-settings xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:office:1.0\" xmlns:config=\"urn:oasis:names:tc:opendocument:xmlns:config:1.0\"> \
<office:settings> \
@@ -92,7 +92,7 @@ int main( int, char** ) {
</office:document-settings> \
";
- QDomDocument doc;
+ TQDomDocument doc;
bool ok = doc.setContent( xml, true /* namespace processing */ );
assert( ok );
diff --git a/lib/kofficecore/tests/kooasisstoretest.cpp b/lib/kofficecore/tests/kooasisstoretest.cpp
index 6750904b..be791644 100644
--- a/lib/kofficecore/tests/kooasisstoretest.cpp
+++ b/lib/kofficecore/tests/kooasisstoretest.cpp
@@ -21,9 +21,9 @@
#include <kdebug.h>
#include <assert.h>
-void testMimeForPath( QDomDocument& doc )
+void testMimeForPath( TQDomDocument& doc )
{
- QString mime = KoOasisStore::mimeForPath( doc, "Object 1" );
+ TQString mime = KoOasisStore::mimeForPath( doc, "Object 1" );
kdDebug() << k_funcinfo << mime << endl;
assert( !mime.isNull() );
assert( !mime.isEmpty() );
@@ -33,7 +33,7 @@ void testMimeForPath( QDomDocument& doc )
int main( int, char** ) {
- const QCString xml = "\
+ const TQCString xml = "\
<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\
<manifest:manifest xmlns:manifest=\"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0\">\n\
<manifest:file-entry manifest:media-type=\"application/vnd.oasis.opendocument.text\" manifest:full-path=\"/\"/>\n\
@@ -42,8 +42,8 @@ int main( int, char** ) {
</manifest:manifest> \
";
- QDomDocument doc;
- QString errorMsg;
+ TQDomDocument doc;
+ TQString errorMsg;
int errorLine, errorColumn;
bool ok = doc.setContent( xml, true /* namespace processing */, &errorMsg, &errorLine, &errorColumn );
if ( !ok ) {
diff --git a/lib/kofficecore/tests/kopointtest.cpp b/lib/kofficecore/tests/kopointtest.cpp
index 25286a5d..bf2ff843 100644
--- a/lib/kofficecore/tests/kopointtest.cpp
+++ b/lib/kofficecore/tests/kopointtest.cpp
@@ -4,7 +4,7 @@
#include <stdlib.h>
#include <math.h>
-bool check( QString txt, bool res, bool expected )
+bool check( TQString txt, bool res, bool expected )
{
if ( res == expected ) {
kdDebug() << txt << " : checking '" << res << "' against expected value '" << expected << "'... " << "ok" << endl;
@@ -15,7 +15,7 @@ bool check( QString txt, bool res, bool expected )
return true;
}
-bool check( QString txt, double res, double expected )
+bool check( TQString txt, double res, double expected )
{
if ( kAbs(res - expected) < 0.000001 ) {
kdDebug() << txt << " : checking '" << res << "' against expected value '" << expected << "'... " << "ok" << endl;
@@ -39,9 +39,9 @@ int main()
check( "KoPoint::setX()", p1.x(), 2.1 );
check( "KoPoint::setY()", p1.y(), 3.2 );
- KoPoint p2( QPoint( -30, -40 ) );
- check( "KoPoint(const QPoint&)", p2.x(), -30.0 );
- check( "KoPoint(const QPoint&)", p2.y(), -40.0 );
+ KoPoint p2( TQPoint( -30, -40 ) );
+ check( "KoPoint(const TQPoint&)", p2.x(), -30.0 );
+ check( "KoPoint(const TQPoint&)", p2.y(), -40.0 );
p2.rx() = 1.5;
p2.ry() = 2.5;
check( "KoPoint::rx()", p2.x(), 1.5 );
diff --git a/lib/kofficecore/tests/korecttest.cpp b/lib/kofficecore/tests/korecttest.cpp
index 9c2cb8b0..f1a1fd89 100644
--- a/lib/kofficecore/tests/korecttest.cpp
+++ b/lib/kofficecore/tests/korecttest.cpp
@@ -5,7 +5,7 @@
#include <kdebug.h>
#include <kglobal.h>
-bool check(QString txt, bool res, bool expected)
+bool check(TQString txt, bool res, bool expected)
{
if (res == expected) {
kdDebug() << txt << " : checking '" << res << "' against expected value '" << expected << "'... " << "ok" << endl;
@@ -17,12 +17,12 @@ bool check(QString txt, bool res, bool expected)
return true;
}
-bool check(QString txt, QString a, QString b)
+bool check(TQString txt, TQString a, TQString b)
{
if (a.isEmpty())
- a = QString::null;
+ a = TQString();
if (b.isEmpty())
- b = QString::null;
+ b = TQString();
if (a == b) {
kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "ok" << endl;
}
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
diff --git a/lib/kofficecore/tests/priorityqueue_test.cpp b/lib/kofficecore/tests/priorityqueue_test.cpp
index d2c7eafd..4f49e752 100644
--- a/lib/kofficecore/tests/priorityqueue_test.cpp
+++ b/lib/kofficecore/tests/priorityqueue_test.cpp
@@ -19,8 +19,8 @@
#include <priorityqueue.h>
#include <kdebug.h>
-#include <qptrlist.h>
-#include <qasciidict.h>
+#include <tqptrlist.h>
+#include <tqasciidict.h>
#include <stdlib.h>
#include <time.h>
@@ -43,9 +43,9 @@ static const char* const keys[] = { "one", "two", "three", "four", "five",
int main( int /*argc*/, char **/*argv*/ )
{
- QPtrList<Node> list;
+ TQPtrList<Node> list;
list.setAutoDelete( true );
- QAsciiDict<Node> dict;
+ TQAsciiDict<Node> dict;
KOffice::PriorityQueue<Node> queue;