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/KWImportStyleDia.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/KWImportStyleDia.cpp')
-rw-r--r-- | kword/KWImportStyleDia.cpp | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/kword/KWImportStyleDia.cpp b/kword/KWImportStyleDia.cpp index b49a8bb4..b8341d20 100644 --- a/kword/KWImportStyleDia.cpp +++ b/kword/KWImportStyleDia.cpp @@ -20,24 +20,24 @@ #include <klocale.h> #include "KWDocument.h" -#include <qvbox.h> -#include <qlayout.h> -#include <qlineedit.h> -#include <qpushbutton.h> -#include <qlistbox.h> +#include <tqvbox.h> +#include <tqlayout.h> +#include <tqlineedit.h> +#include <tqpushbutton.h> +#include <tqlistbox.h> #include <kmessagebox.h> #include "KWImportStyleDia.h" #include <KoStore.h> -#include <qfile.h> +#include <tqfile.h> #include <kfiledialog.h> #include <kdebug.h> -#include <qlabel.h> +#include <tqlabel.h> #include "KWTextParag.h" -KWImportStyleDia::KWImportStyleDia( KWDocument *_doc, KoStyleCollection* currentCollection, QWidget *parent, const char *name ) - :KoImportStyleDia( currentCollection, parent, name ), +KWImportStyleDia::KWImportStyleDia( KWDocument *_doc, KoStyleCollection* currentCollection, TQWidget *tqparent, const char *name ) + :KoImportStyleDia( currentCollection, tqparent, name ), m_doc(_doc) { @@ -50,15 +50,15 @@ KWImportStyleDia::~KWImportStyleDia() void KWImportStyleDia::loadFile() { - KFileDialog fd( QString::null, QString::null, 0, 0, TRUE ); - QStringList lst = "application/x-kword"; + KFileDialog fd( TQString(), TQString(), 0, 0, TRUE ); + TQStringList lst = "application/x-kword"; #if 0 lst << "application/vnd.oasis.opendocument.text"; #endif fd.setMimeFilter( lst ); fd.setCaption(i18n("Import Style")); KURL url; - if ( fd.exec() != QDialog::Accepted ) + if ( fd.exec() != TQDialog::Accepted ) return; url = fd.selectedURL(); if( url.isEmpty() ) @@ -68,7 +68,7 @@ void KWImportStyleDia::loadFile() i18n("Import Style")); return; } - QMap<QString, QString>insertStyle; + TQMap<TQString, TQString>insertStyle; KoStore* store=KoStore::createStore( this, url, KoStore::Read ); if (store ) @@ -78,10 +78,10 @@ void KWImportStyleDia::loadFile() clear(); m_listStyleName->clear(); - QDomDocument doc; + TQDomDocument doc; doc.setContent( store->device() ); - QDomElement word = doc.documentElement(); - QDomElement stylesElem = word.namedItem( "STYLES" ).toElement(); + TQDomElement word = doc.documentElement(); + TQDomElement stylesElem = word.namedItem( "STYLES" ).toElement(); if ( !stylesElem.isNull() ) { //todo @@ -92,17 +92,17 @@ void KWImportStyleDia::loadFile() // I guess we'll have to keep this old loading code forever though, // so we can't really get rid of the subclasses. - QValueList<QString> followingStyles; - QDomNodeList listStyles = stylesElem.elementsByTagName( "STYLE" ); + TQValueList<TQString> followingStyles; + TQDomNodeList listStyles = stylesElem.elementsByTagName( "STYLE" ); for (unsigned int item = 0; item < listStyles.count(); item++) { - QDomElement styleElem = listStyles.item( item ).toElement(); + TQDomElement styleElem = listStyles.item( item ).toElement(); - KoParagStyle *sty = new KoParagStyle( QString::null ); - // Load the paraglayout from the <STYLE> element + KoParagStyle *sty = new KoParagStyle( TQString() ); + // Load the paragtqlayout from the <STYLE> element sty->loadStyle( styleElem, m_doc->syntaxVersion() ); //#### wrong syntaxVersion! - QString name = sty->displayName(); + TQString name = sty->displayName(); if ( currentCollection()->findStyle( name ) ) sty->setName(generateStyleName(sty->name() + "-%1")); // ### TODO: we should offer the option of updating the @@ -111,7 +111,7 @@ void KWImportStyleDia::loadFile() sty->setDisplayName(generateStyleDisplayName(sty->displayName() + "-%1")); insertStyle.insert( name, sty->name() ); // old name -> new name - QDomElement formatElem = styleElem.namedItem( "FORMAT" ).toElement(); + TQDomElement formatElem = styleElem.namedItem( "FORMAT" ).toElement(); if ( !formatElem.isNull() ) sty->format() = KWTextParag::loadFormat( formatElem, 0L, m_doc->defaultFont(), m_doc->globalLanguage(), m_doc->globalHyphenation() ); else @@ -122,7 +122,7 @@ void KWImportStyleDia::loadFile() if( m_styleList.count() >= 0 && uint( m_styleList.count() ) > followingStyles.count() ) { - QString following = styleElem.namedItem("FOLLOWING").toElement().attribute("name"); + TQString following = styleElem.namedItem("FOLLOWING").toElement().attribute("name"); followingStyles.append( following ); } else @@ -132,9 +132,9 @@ void KWImportStyleDia::loadFile() Q_ASSERT( m_styleList.count() >= 0 && followingStyles.count() == uint( m_styleList.count() ) ); unsigned int i=0; - for( QValueList<QString>::Iterator it = followingStyles.begin(); it != followingStyles.end(); ++it ) { - QString newName =*it; - if ( insertStyle.contains( *it ) ) + for( TQValueList<TQString>::Iterator it = followingStyles.begin(); it != followingStyles.end(); ++it ) { + TQString newName =*it; + if ( insertStyle.tqcontains( *it ) ) newName = (insertStyle)[ *it ]; KoParagStyle * style = m_styleList.findStyle(newName); @@ -166,17 +166,17 @@ void KWImportStyleDia::loadFile() delete store; } -KWImportFrameTableStyleDia::KWImportFrameTableStyleDia( KWDocument *_doc, const QStringList &_list, StyleType _type, QWidget *parent, const char *name ) - : KDialogBase( parent, name , true, "", Ok|Cancel, Ok, true ) +KWImportFrameTableStyleDia::KWImportFrameTableStyleDia( KWDocument *_doc, const TQStringList &_list, StyleType _type, TQWidget *tqparent, const char *name ) + : KDialogBase( tqparent, name , true, "", Ok|Cancel, Ok, true ) { setCaption( i18n("Import Style") ); m_doc=_doc; m_typeStyle = _type; m_list =_list; - QVBox *page = makeVBoxMainWidget(); - new QLabel(i18n("Select style to import:"), page); - m_listStyleName = new QListBox( page ); - m_listStyleName->setSelectionMode( QListBox::Multi ); + TQVBox *page = makeVBoxMainWidget(); + new TQLabel(i18n("Select style to import:"), page); + m_listStyleName = new TQListBox( page ); + m_listStyleName->setSelectionMode( TQListBox::Multi ); loadFile(); resize (300, 400); setFocus(); @@ -190,14 +190,14 @@ KWImportFrameTableStyleDia::~KWImportFrameTableStyleDia() m_tableStyleList.clear(); } -QString KWImportFrameTableStyleDia::generateStyleName( const QString & templateName ) +TQString KWImportFrameTableStyleDia::generateStyleName( const TQString & templateName ) { - QString name; + TQString name; int num = 1; bool exists; do { - name = templateName.arg( num ); - exists = (m_list.findIndex( name )!=-1); + name = templateName.tqarg( num ); + exists = (m_list.tqfindIndex( name )!=-1); ++num; } while ( exists ); return name; @@ -206,15 +206,15 @@ QString KWImportFrameTableStyleDia::generateStyleName( const QString & templateN void KWImportFrameTableStyleDia::loadFile() { - KFileDialog fd( QString::null, QString::null, 0, 0, TRUE ); - QStringList lst = "application/x-kword"; + KFileDialog fd( TQString(), TQString(), 0, 0, TRUE ); + TQStringList lst = "application/x-kword"; #if 0 lst << "application/vnd.oasis.opendocument.text"; #endif fd.setMimeFilter( lst ); fd.setCaption(i18n("Import Style")); KURL url; - if ( fd.exec() != QDialog::Accepted ) + if ( fd.exec() != TQDialog::Accepted ) return; url = fd.selectedURL(); if( url.isEmpty() ) @@ -229,31 +229,31 @@ void KWImportFrameTableStyleDia::loadFile() { if (store->open("maindoc.xml") ) { - QDomDocument doc; + TQDomDocument doc; doc.setContent( store->device() ); - QDomElement word = doc.documentElement(); + TQDomElement word = doc.documentElement(); if ( m_typeStyle ==frameStyle ) { - QDomNodeList listStyles = word.elementsByTagName( "FRAMESTYLE" ); + TQDomNodeList listStyles = word.elementsByTagName( "FRAMESTYLE" ); for (unsigned int item = 0; item < listStyles.count(); item++) { - QDomElement styleElem = listStyles.item( item ).toElement(); + TQDomElement styleElem = listStyles.item( item ).toElement(); KWFrameStyle *sty = new KWFrameStyle( styleElem ); - QString name =sty->name(); - if ( m_list.findIndex( name )!=-1 ) - sty->setDisplayName(generateStyleName( sty->displayName() + QString( "-%1"))); + TQString name =sty->name(); + if ( m_list.tqfindIndex( name )!=-1 ) + sty->setDisplayName(generateStyleName( sty->displayName() + TQString( "-%1"))); m_frameStyleList.append( sty); } } else { - QDomNodeList listStyles = word.elementsByTagName( "TABLESTYLE" ); + TQDomNodeList listStyles = word.elementsByTagName( "TABLESTYLE" ); for (unsigned int item = 0; item < listStyles.count(); item++) { - QDomElement styleElem = listStyles.item( item ).toElement(); + TQDomElement styleElem = listStyles.item( item ).toElement(); KWTableStyle *sty = new KWTableStyle( styleElem,m_doc,2 ); - QString name =sty->name(); - if ( m_list.findIndex( name )!=-1 ) - sty->setName(generateStyleName( sty->displayName() + QString( "-%1"))); + TQString name =sty->name(); + if ( m_list.tqfindIndex( name )!=-1 ) + sty->setName(generateStyleName( sty->displayName() + TQString( "-%1"))); m_tableStyleList.append( sty); } } @@ -284,7 +284,7 @@ void KWImportFrameTableStyleDia::loadFile() void KWImportFrameTableStyleDia::initList() { - QStringList lst; + TQStringList lst; if ( m_typeStyle ==frameStyle ) { for ( KWFrameStyle * p = m_frameStyleList.first(); p != 0L; p = m_frameStyleList.next() ) @@ -309,11 +309,11 @@ void KWImportFrameTableStyleDia::slotOk() { if ( !m_listStyleName->isSelected( i )) { - QString name = m_listStyleName->text(i ); + TQString name = m_listStyleName->text(i ); if ( m_typeStyle ==frameStyle ) // frame styles { //remove this style from list - QPtrListIterator<KWFrameStyle> styleIt( m_frameStyleList ); + TQPtrListIterator<KWFrameStyle> styleIt( m_frameStyleList ); for ( ; styleIt.current(); ++styleIt ) { if ( styleIt.current()->displayName() == name ) @@ -326,7 +326,7 @@ void KWImportFrameTableStyleDia::slotOk() else // then it will have to be table styles { //remove this style from list - QPtrListIterator<KWTableStyle> styleIt( m_tableStyleList ); + TQPtrListIterator<KWTableStyle> styleIt( m_tableStyleList ); for ( ; styleIt.current(); ++styleIt ) { if ( styleIt.current()->displayName() == name ) |