diff options
Diffstat (limited to 'lib/kofficecore/tests/kogenstylestest.cpp')
-rw-r--r-- | lib/kofficecore/tests/kogenstylestest.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
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; |