summaryrefslogtreecommitdiffstats
path: root/lib/kotext/KoStyleCollection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kotext/KoStyleCollection.cpp')
-rw-r--r--lib/kotext/KoStyleCollection.cpp56
1 files changed, 28 insertions, 28 deletions
diff --git a/lib/kotext/KoStyleCollection.cpp b/lib/kotext/KoStyleCollection.cpp
index 39ce4b99..7313e7be 100644
--- a/lib/kotext/KoStyleCollection.cpp
+++ b/lib/kotext/KoStyleCollection.cpp
@@ -29,7 +29,7 @@
#include <kdebug.h>
#include <klocale.h>
-#include <qdom.h>
+#include <tqdom.h>
KoStyleCollection::KoStyleCollection()
: KoUserStyleCollection( "paragsty" )
@@ -42,16 +42,16 @@ KoStyleCollection::~KoStyleCollection()
int KoStyleCollection::loadOasisStyles( KoOasisContext& context )
{
- QStringList followingStyles;
- QValueVector<QDomElement> userStyles = context.oasisStyles().userStyles();
+ TQStringList followingStyles;
+ TQValueVector<TQDomElement> userStyles = context.oasisStyles().userStyles();
bool defaultStyleDeleted = false;
int stylesLoaded = 0;
const unsigned int nStyles = userStyles.count();
for (unsigned int item = 0; item < nStyles; item++) {
- QDomElement styleElem = userStyles[item];
+ TQDomElement styleElem = userStyles[item];
Q_ASSERT( !styleElem.isNull() );
- if ( styleElem.attributeNS( KoXmlNS::style, "family", QString::null ) != "paragraph" )
+ if ( styleElem.attributeNS( KoXmlNS::style, "family", TQString() ) != "paragraph" )
continue;
if( !defaultStyleDeleted ) { // we are going to import at least one style.
@@ -62,7 +62,7 @@ int KoStyleCollection::loadOasisStyles( KoOasisContext& context )
defaultStyleDeleted = true;
}
- KoParagStyle *sty = new KoParagStyle( QString::null );
+ KoParagStyle *sty = new KoParagStyle( TQString() );
// Load the style
sty->loadStyle( styleElem, context );
// Style created, now let's try to add it
@@ -75,7 +75,7 @@ int KoStyleCollection::loadOasisStyles( KoOasisContext& context )
if ( count() > oldStyleCount )
{
- const QString following = styleElem.attributeNS( KoXmlNS::style, "next-style-name", QString::null );
+ const TQString following = styleElem.attributeNS( KoXmlNS::style, "next-style-name", TQString() );
followingStyles.append( following );
++stylesLoaded;
}
@@ -89,8 +89,8 @@ int KoStyleCollection::loadOasisStyles( KoOasisContext& context )
}
unsigned int i=0;
- for( QValueList<QString>::ConstIterator it = followingStyles.begin(); it != followingStyles.end(); ++it, ++i ) {
- const QString followingStyleName = *it;
+ for( TQValueList<TQString>::ConstIterator it = followingStyles.begin(); it != followingStyles.end(); ++it, ++i ) {
+ const TQString followingStyleName = *it;
if ( !followingStyleName.isEmpty() ) {
KoParagStyle * style = findStyle( followingStyleName );
if ( style )
@@ -98,7 +98,7 @@ int KoStyleCollection::loadOasisStyles( KoOasisContext& context )
}
}
- // TODO the same thing for style inheritance (style:parent-style-name) and setParentStyle()
+ // TODO the same thing for style inheritance (style:tqparent-style-name) and setParentStyle()
Q_ASSERT( defaultStyle() );
return stylesLoaded;
@@ -107,12 +107,12 @@ int KoStyleCollection::loadOasisStyles( KoOasisContext& context )
void KoStyleCollection::saveOasis( KoGenStyles& styles, int styleType, KoSavingContext& context ) const
{
// In order to reduce the bloat, we define that the first style (usually Standard)
- // is the "parent" (reference) for the others.
+ // is the "tqparent" (reference) for the others.
// ## This is mostly a hack due to lack of proper style inheritance.
// Once that's implemented, default to 'styles derive from Standard', but save normally.
- QString refStyleName;
+ TQString refStyleName;
- for ( QValueList<KoUserStyle *>::const_iterator styleIt = m_styleList.begin(), styleEnd = m_styleList.end() ; styleIt != styleEnd ; ++styleIt ) {
+ for ( TQValueList<KoUserStyle *>::const_iterator styleIt = m_styleList.begin(), styleEnd = m_styleList.end() ; styleIt != styleEnd ; ++styleIt ) {
KoParagStyle* style = static_cast<KoParagStyle *>( *styleIt );
style->saveStyle( styles, styleType, refStyleName, context );
kdDebug() << k_funcinfo << "Saved style " << style->displayName() << " to OASIS format as " << style->name() << endl;
@@ -123,10 +123,10 @@ void KoStyleCollection::saveOasis( KoGenStyles& styles, int styleType, KoSavingC
// because the style's m_name is already unique so there's no risk of
// "two styles being only different due to their following-style"; the
// display-name will also be different, and will ensure they get two kogenstyles.
- for ( QValueList<KoUserStyle *>::const_iterator styleIt = m_styleList.begin(), styleEnd = m_styleList.end() ; styleIt != styleEnd ; ++styleIt ) {
+ for ( TQValueList<KoUserStyle *>::const_iterator styleIt = m_styleList.begin(), styleEnd = m_styleList.end() ; styleIt != styleEnd ; ++styleIt ) {
KoParagStyle* style = static_cast<KoParagStyle *>( *styleIt );
if ( style->followingStyle() && style->followingStyle() != style ) {
- const QString fsname = style->followingStyle()->name();
+ const TQString fsname = style->followingStyle()->name();
KoGenStyle* gs = styles.styleForModification( style->name() );
Q_ASSERT( gs );
if ( gs )
@@ -137,9 +137,9 @@ void KoStyleCollection::saveOasis( KoGenStyles& styles, int styleType, KoSavingC
void KoStyleCollection::importStyles( const KoStyleCollection& styleCollection )
{
- const QValueList<KoUserStyle *> styles = styleCollection.styleList();
- QMap<QString, QString> followStyle;
- for ( QValueList<KoUserStyle *>::const_iterator styleIt = styles.begin(), styleEnd = styles.end() ; styleIt != styleEnd ; ++styleIt ) {
+ const TQValueList<KoUserStyle *> styles = styleCollection.styleList();
+ TQMap<TQString, TQString> followStyle;
+ for ( TQValueList<KoUserStyle *>::const_iterator styleIt = styles.begin(), styleEnd = styles.end() ; styleIt != styleEnd ; ++styleIt ) {
KoParagStyle* p = static_cast<KoParagStyle *>( *styleIt );
KoParagStyle* style = new KoParagStyle( *p );
if ( style->followingStyle() ) {
@@ -148,11 +148,11 @@ void KoStyleCollection::importStyles( const KoStyleCollection& styleCollection )
style = addStyle( style );
}
- QMapIterator<QString, QString> itFollow = followStyle.begin();
+ TQMapIterator<TQString, TQString> itFollow = followStyle.begin();
for ( ; itFollow != followStyle.end(); ++itFollow )
{
KoParagStyle * style = findStyle(itFollow.key());
- const QString followingStyleName = followStyle[ itFollow.key() ];
+ const TQString followingStyleName = followStyle[ itFollow.key() ];
KoParagStyle * styleFollow = findStyle(followingStyleName);
//kdDebug() << " " << style << " " << itFollow.key() << ": followed by " << styleFollow << " (" << followingStyleName << ")" << endl;
Q_ASSERT(styleFollow);
@@ -166,7 +166,7 @@ void KoStyleCollection::importStyles( const KoStyleCollection& styleCollection )
void KoStyleCollection::saveOasisOutlineStyles( KoXmlWriter& writer ) const
{
bool first = true;
- QValueVector<KoParagStyle *> styles = outlineStyles();
+ TQValueVector<KoParagStyle *> styles = outlineStyles();
for ( int i = 0 ; i < 10 ; ++i ) {
if ( styles[i] ) {
if ( first ) {
@@ -182,9 +182,9 @@ void KoStyleCollection::saveOasisOutlineStyles( KoXmlWriter& writer ) const
writer.endElement(); // text:outline-style
}
-QValueVector<KoParagStyle *> KoStyleCollection::outlineStyles() const
+TQValueVector<KoParagStyle *> KoStyleCollection::outlineStyles() const
{
- QValueVector<KoParagStyle *> lst( 10, 0 );
+ TQValueVector<KoParagStyle *> lst( 10, 0 );
for ( int i = 0 ; i < 10 ; ++i ) {
KoParagStyle* style = outlineStyleForLevel( i );
if ( style )
@@ -196,7 +196,7 @@ QValueVector<KoParagStyle *> KoStyleCollection::outlineStyles() const
KoParagStyle* KoStyleCollection::outlineStyleForLevel( int level ) const
{
- for ( QValueList<KoUserStyle *>::const_iterator styleIt = m_styleList.begin(), styleEnd = m_styleList.end() ; styleIt != styleEnd ; ++styleIt ) {
+ for ( TQValueList<KoUserStyle *>::const_iterator styleIt = m_styleList.begin(), styleEnd = m_styleList.end() ; styleIt != styleEnd ; ++styleIt ) {
KoParagStyle* style = static_cast<KoParagStyle *>( *styleIt );
if ( style->isOutline() && style->paragLayout().counter )
{
@@ -210,7 +210,7 @@ KoParagStyle* KoStyleCollection::outlineStyleForLevel( int level ) const
KoParagStyle* KoStyleCollection::numberedStyleForLevel( int level ) const
{
- for ( QValueList<KoUserStyle *>::const_iterator styleIt = m_styleList.begin(), styleEnd = m_styleList.end() ; styleIt != styleEnd ; ++styleIt ) {
+ for ( TQValueList<KoUserStyle *>::const_iterator styleIt = m_styleList.begin(), styleEnd = m_styleList.end() ; styleIt != styleEnd ; ++styleIt ) {
KoParagStyle* style = static_cast<KoParagStyle *>( *styleIt );
KoParagCounter* counter = style->paragLayout().counter;
if ( !style->isOutline() && counter
@@ -233,7 +233,7 @@ KoParagStyle* KoStyleCollection::defaultStyle() const
#ifndef NDEBUG
void KoStyleCollection::printDebug() const
{
- for ( QValueList<KoUserStyle *>::const_iterator styleIt = m_styleList.begin(), styleEnd = m_styleList.end() ; styleIt != styleEnd ; ++styleIt ) {
+ for ( TQValueList<KoUserStyle *>::const_iterator styleIt = m_styleList.begin(), styleEnd = m_styleList.end() ; styleIt != styleEnd ; ++styleIt ) {
KoParagStyle* style = static_cast<KoParagStyle *>( *styleIt );
// short version:
@@ -242,12 +242,12 @@ void KoStyleCollection::printDebug() const
kdDebug() << "Style " << style << " " << style->name() << " isOutline=" << style->isOutline() << endl;
kdDebug() << " format: " << style->format().key() <<endl;
static const char * const s_align[] = { "Auto", "Left", "Right", "ERROR", "HCenter", "ERR", "ERR", "ERR", "Justify", };
- kdDebug() << " align: " << s_align[(Qt::AlignmentFlags)style->paragLayout().alignment] << endl;
+ kdDebug() << " align: " << s_align[(TQt::AlignmentFlags)style->paragLayout().tqalignment] << endl;
if ( style->paragLayout().counter )
kdDebug() << " counter level=" << style->paragLayout().counter->depth() << endl;
kdDebug() << " following style: " << style->followingStyle() << " "
- << ( style->followingStyle() ? style->followingStyle()->name() : QString::null ) << endl;
+ << ( style->followingStyle() ? style->followingStyle()->name() : TQString() ) << endl;
}
}