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 /kword/KWTableStyle.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 'kword/KWTableStyle.cpp')
-rw-r--r-- | kword/KWTableStyle.cpp | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/kword/KWTableStyle.cpp b/kword/KWTableStyle.cpp index d8bb83a8..dd446669 100644 --- a/kword/KWTableStyle.cpp +++ b/kword/KWTableStyle.cpp @@ -28,17 +28,17 @@ #include <kdebug.h> #include <klocale.h> -#include <qdom.h> +#include <tqdom.h> KWTableStyleCollection::KWTableStyleCollection() - : KoUserStyleCollection( QString::fromLatin1( "table" ) ) + : KoUserStyleCollection( TQString::tqfromLatin1( "table" ) ) { } void KWTableStyleCollection::saveOasis( KoGenStyles& mainStyles, KoSavingContext& savingContext ) const { if ( !isDefault() ) { - 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 ) { KWTableStyle* style = static_cast<KWTableStyle *>( *styleIt ); style->saveOasis( mainStyles, savingContext ); @@ -48,14 +48,14 @@ void KWTableStyleCollection::saveOasis( KoGenStyles& mainStyles, KoSavingContext int KWTableStyleCollection::loadOasisStyles( KoOasisContext& context, const KoStyleCollection& paragraphStyles, const KWFrameStyleCollection& frameStyles ) { - QValueVector<QDomElement> userStyles = context.oasisStyles().userStyles(); + TQValueVector<TQDomElement> userStyles = context.oasisStyles().userStyles(); bool defaultStyleDeleted = false; int stylesLoaded = 0; for (unsigned int item = 0; item < userStyles.count(); item++) { - QDomElement styleElem = userStyles[item]; + TQDomElement styleElem = userStyles[item]; Q_ASSERT( !styleElem.isNull() ); - if ( styleElem.attributeNS( KoXmlNS::style, "family", QString::null ) != "table-cell" ) + if ( styleElem.attributeNS( KoXmlNS::style, "family", TQString() ) != "table-cell" ) continue; if ( !defaultStyleDeleted ) { @@ -66,7 +66,7 @@ int KWTableStyleCollection::loadOasisStyles( KoOasisContext& context, const KoSt defaultStyleDeleted = true; } - KWTableStyle *sty = new KWTableStyle( QString::null, 0, 0 ); + KWTableStyle *sty = new KWTableStyle( TQString(), 0, 0 ); // Load the style sty->loadOasis( styleElem, context, paragraphStyles, frameStyles ); // Style created, now let's try to add it @@ -82,24 +82,24 @@ int KWTableStyleCollection::loadOasisStyles( KoOasisContext& context, const KoSt /* Class: KWTableStyle */ /******************************************************************/ -KWTableStyle::KWTableStyle( const QString & name, KoParagStyle * _paragStyle, KWFrameStyle * _frameStyle ) +KWTableStyle::KWTableStyle( const TQString & name, KoParagStyle * _paragStyle, KWFrameStyle * _frameStyle ) : KoUserStyle( name ) { m_paragStyle = _paragStyle; m_frameStyle = _frameStyle; } -KWTableStyle::KWTableStyle( QDomElement & parentElem, KWDocument *_doc, int /*docVersion*/ ) - : KoUserStyle( QString::null ) +KWTableStyle::KWTableStyle( TQDomElement & tqparentElem, KWDocument *_doc, int /*docVersion*/ ) + : KoUserStyle( TQString() ) { - QDomElement element = parentElem.namedItem( "NAME" ).toElement(); + TQDomElement element = tqparentElem.namedItem( "NAME" ).toElement(); if ( ( !element.isNull() ) && ( element.hasAttribute("value") ) ) { m_name = element.attribute( "value" ); m_displayName = i18n( "Style name", m_name.utf8() ); } else kdWarning() << "No NAME tag in table style!" << endl; - element = parentElem.namedItem( "PFRAMESTYLE" ).toElement(); + element = tqparentElem.namedItem( "PFRAMESTYLE" ).toElement(); m_frameStyle = 0; if ( ( !element.isNull() ) && ( element.hasAttribute("name") ) ) m_frameStyle = _doc->frameStyleCollection()->findStyleByDisplayName( element.attribute( "name" ) ); @@ -109,17 +109,17 @@ KWTableStyle::KWTableStyle( QDomElement & parentElem, KWDocument *_doc, int /*do m_frameStyle = _doc->frameStyleCollection()->frameStyleAt( 0 ); else { // Isn't possible ( I hope ) KWFrameStyle * standardFrameStyle = new KWFrameStyle( "Plain" ); - standardFrameStyle->setBackgroundColor(QColor("white")); - standardFrameStyle->setTopBorder(KoBorder(QColor("black"),KoBorder::SOLID,0)); - standardFrameStyle->setRightBorder(KoBorder(QColor("black"),KoBorder::SOLID,0)); - standardFrameStyle->setLeftBorder(KoBorder(QColor("black"),KoBorder::SOLID,0)); - standardFrameStyle->setBottomBorder(KoBorder(QColor("black"),KoBorder::SOLID,0)); + standardFrameStyle->setBackgroundColor(TQColor("white")); + standardFrameStyle->setTopBorder(KoBorder(TQColor("black"),KoBorder::SOLID,0)); + standardFrameStyle->setRightBorder(KoBorder(TQColor("black"),KoBorder::SOLID,0)); + standardFrameStyle->setLeftBorder(KoBorder(TQColor("black"),KoBorder::SOLID,0)); + standardFrameStyle->setBottomBorder(KoBorder(TQColor("black"),KoBorder::SOLID,0)); _doc->frameStyleCollection()->addStyle( standardFrameStyle ); m_frameStyle = _doc->frameStyleCollection()->frameStyleAt( 0 ); } } - element = parentElem.namedItem( "PSTYLE" ).toElement(); + element = tqparentElem.namedItem( "PSTYLE" ).toElement(); m_paragStyle = 0; if ( ( !element.isNull() ) && ( element.hasAttribute("name") ) ) m_paragStyle = _doc->styleCollection()->findStyleByDisplayName( element.attribute( "name" ) ); @@ -143,31 +143,31 @@ void KWTableStyle::operator=( const KWTableStyle &rhs ) m_frameStyle = rhs.frameStyle(); } -void KWTableStyle::saveTableStyle( QDomElement & parentElem ) +void KWTableStyle::saveTableStyle( TQDomElement & tqparentElem ) { - QDomDocument doc = parentElem.ownerDocument(); - QDomElement element = doc.createElement( "NAME" ); - parentElem.appendChild( element ); + TQDomDocument doc = tqparentElem.ownerDocument(); + TQDomElement element = doc.createElement( "NAME" ); + tqparentElem.appendChild( element ); element.setAttribute( "value", displayName() ); if (m_frameStyle) { element = doc.createElement( "PFRAMESTYLE" ); - parentElem.appendChild( element ); + tqparentElem.appendChild( element ); element.setAttribute( "name", m_frameStyle->displayName() ); } if (m_paragStyle) { element = doc.createElement( "PSTYLE" ); - parentElem.appendChild( element ); + tqparentElem.appendChild( element ); element.setAttribute( "name", m_paragStyle->displayName() ); } } -KWTableStyle *KWTableStyle::loadStyle( QDomElement & parentElem, KWDocument *_doc, int docVersion ) +KWTableStyle *KWTableStyle::loadStyle( TQDomElement & tqparentElem, KWDocument *_doc, int docVersion ) { - return new KWTableStyle( parentElem, _doc, docVersion ); + return new KWTableStyle( tqparentElem, _doc, docVersion ); } void KWTableStyle::saveOasis( KoGenStyles& mainStyles, KoSavingContext& /*savingContext*/ ) const @@ -181,8 +181,8 @@ void KWTableStyle::saveOasis( KoGenStyles& mainStyles, KoSavingContext& /*saving // try to preserve existing internal name, if it looks adequate (no spaces) // ## TODO: check XML-Schemacs NCName conformity - const bool nameIsConform = !m_name.isEmpty() && m_name.find( ' ' ) == -1; - QString newName; + const bool nameIsConform = !m_name.isEmpty() && m_name.tqfind( ' ' ) == -1; + TQString newName; if ( nameIsConform ) newName = mainStyles.lookup( tableCellStyle, m_name, KoGenStyles::DontForceNumbering ); else @@ -190,11 +190,11 @@ void KWTableStyle::saveOasis( KoGenStyles& mainStyles, KoSavingContext& /*saving const_cast<KWTableStyle*>( this )->m_name = newName; } -void KWTableStyle::loadOasis( QDomElement & styleElem, KoOasisContext& context, const KoStyleCollection& paragraphStyles, const KWFrameStyleCollection& frameStyles ) +void KWTableStyle::loadOasis( TQDomElement & styleElem, KoOasisContext& context, const KoStyleCollection& paragraphStyles, const KWFrameStyleCollection& frameStyles ) { // Load name - m_name = styleElem.attributeNS( KoXmlNS::style, "name", QString::null ); - m_displayName = styleElem.attributeNS( KoXmlNS::style, "display-name", QString::null ); + m_name = styleElem.attributeNS( KoXmlNS::style, "name", TQString() ); + m_displayName = styleElem.attributeNS( KoXmlNS::style, "display-name", TQString() ); if ( m_displayName.isEmpty() ) m_displayName = m_name; kdDebug() << k_funcinfo << m_name << " " << m_displayName << endl; @@ -203,14 +203,14 @@ void KWTableStyle::loadOasis( QDomElement & styleElem, KoOasisContext& context, styleStack.setTypeProperties( "table-cell" ); styleStack.save(); - context.addStyles( &styleElem, "table-cell" ); // Load all parents - only because we don't support inheritance. + context.addStyles( &styleElem, "table-cell" ); // Load all tqparents - only because we don't support inheritance. - const QString frameStyleName = styleStack.attributeNS( KoXmlNS::koffice, "frame-style-name" ); + const TQString frameStyleName = styleStack.attributeNS( KoXmlNS::koffice, "frame-style-name" ); m_frameStyle = frameStyles.findStyle( frameStyleName ); if ( !m_frameStyle ) kdWarning(32001) << "Frame style " << frameStyleName << " not found!" << endl; - const QString paragraphStyleName = styleStack.attributeNS( KoXmlNS::koffice, "paragraph-style-name" ); + const TQString paragraphStyleName = styleStack.attributeNS( KoXmlNS::koffice, "paragraph-style-name" ); m_paragStyle = paragraphStyles.findStyle( paragraphStyleName ); if ( !m_paragStyle ) kdWarning(32001) << "Paragraph style " << paragraphStyleName << " not found!" << endl; |