diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kotext/KoStyleCollection.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-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/kotext/KoStyleCollection.cpp')
-rw-r--r-- | lib/kotext/KoStyleCollection.cpp | 56 |
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; } } |