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/KoBgSpellCheck.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/KoBgSpellCheck.cpp')
-rw-r--r-- | lib/kotext/KoBgSpellCheck.cpp | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/lib/kotext/KoBgSpellCheck.cpp b/lib/kotext/KoBgSpellCheck.cpp index 9dd0b9b9..d20dd80d 100644 --- a/lib/kotext/KoBgSpellCheck.cpp +++ b/lib/kotext/KoBgSpellCheck.cpp @@ -41,8 +41,8 @@ using namespace KSpell2; #include <klocale.h> #include <kdebug.h> #include <kdeversion.h> -#include <qtimer.h> -#include <qptrdict.h> +#include <tqtimer.h> +#include <tqptrdict.h> // #define DEBUG_BGSPELLCHECKING @@ -51,7 +51,7 @@ class KoBgSpellCheck::Private public: int marked; KoSpell *backSpeller; - QPtrDict<KoTextParag> paragCache; + TQPtrDict<KoTextParag> paragCache; bool startupChecking; KoTextParag* intraWordParag; int intraWordPosition; @@ -59,9 +59,9 @@ public: static const int delayAfterMarked = 10; -KoBgSpellCheck::KoBgSpellCheck( const Broker::Ptr& broker, QObject *parent, +KoBgSpellCheck::KoBgSpellCheck( const Broker::Ptr& broker, TQObject *tqparent, const char *name ) - : QObject( parent, name ) + : TQObject( tqparent, name ) { #ifdef DEBUG_BGSPELLCHECKING kdDebug(32500) << "KoBgSpellCheck::KoBgSpellCheck " << this << endl; @@ -73,12 +73,12 @@ KoBgSpellCheck::KoBgSpellCheck( const Broker::Ptr& broker, QObject *parent, d->intraWordPosition = 0; d->backSpeller = new KoSpell( broker, this, "KoSpell" ); - connect( d->backSpeller, SIGNAL(misspelling(const QString&, int)), - SLOT(spellCheckerMisspelling(const QString &, int )) ); - connect( d->backSpeller, SIGNAL(done()), - SLOT(spellCheckerDone()) ); - connect( d->backSpeller, SIGNAL(aboutToFeedText()), - SLOT(slotClearPara()) ); + connect( d->backSpeller, TQT_SIGNAL(misspelling(const TQString&, int)), + TQT_SLOT(spellCheckerMisspelling(const TQString &, int )) ); + connect( d->backSpeller, TQT_SIGNAL(done()), + TQT_SLOT(spellCheckerDone()) ); + connect( d->backSpeller, TQT_SIGNAL(aboutToFeedText()), + TQT_SLOT(slotClearPara()) ); } KoBgSpellCheck::~KoBgSpellCheck() @@ -90,12 +90,12 @@ void KoBgSpellCheck::registerNewTextObject( KoTextObject *obj ) { Q_ASSERT( obj ); - connect( obj, SIGNAL(paragraphCreated(KoTextParag*)), - SLOT(slotParagraphCreated(KoTextParag*)) ); - connect( obj, SIGNAL(paragraphModified(KoTextParag*, int, int, int)), - SLOT(slotParagraphModified(KoTextParag*, int, int, int)) ); - connect( obj, SIGNAL(paragraphDeleted(KoTextParag*)), - SLOT(slotParagraphDeleted(KoTextParag*)) ); + connect( obj, TQT_SIGNAL(paragraphCreated(KoTextParag*)), + TQT_SLOT(slotParagraphCreated(KoTextParag*)) ); + connect( obj, TQT_SIGNAL(paragraphModified(KoTextParag*, int, int, int)), + TQT_SLOT(slotParagraphModified(KoTextParag*, int, int, int)) ); + connect( obj, TQT_SIGNAL(paragraphDeleted(KoTextParag*)), + TQT_SLOT(slotParagraphDeleted(KoTextParag*)) ); } void KoBgSpellCheck::setEnabled( bool b ) @@ -124,7 +124,7 @@ void KoBgSpellCheck::start() d->backSpeller->start(); } -void KoBgSpellCheck::spellCheckerMisspelling( const QString &old, int pos ) +void KoBgSpellCheck::spellCheckerMisspelling( const TQString &old, int pos ) { KoTextParag* parag = d->backSpeller->currentParag(); #ifdef DEBUG_BGSPELLCHECKING @@ -135,12 +135,12 @@ void KoBgSpellCheck::spellCheckerMisspelling( const QString &old, int pos ) #endif markWord( parag, pos, old.length(), true ); // Repaint immediately, since the checking is timer-based (slow), it looks - // slow (chunky) if we only repaint once a paragraph is completely done. + // slow (chunky) if we only tqrepaint once a paragraph is completely done. parag->document()->emitRepaintChanged(); if ( d->startupChecking && d->marked > delayAfterMarked ) { d->marked = 0; - QTimer::singleShot( 1000, this, SLOT(checkerContinue()) ); + TQTimer::singleShot( 1000, this, TQT_SLOT(checkerContinue()) ); } else { if ( d->startupChecking ) ++d->marked; @@ -171,7 +171,7 @@ void KoBgSpellCheck::markWord( KoTextParag* parag, int pos, int length, bool mis #endif parag->setFormat( pos, length, &format, true, KoTextFormat::Misspelled ); parag->setChanged( true ); - // don't repaint here, in the slotParagraphModified case we want to repaint only once at the end + // don't tqrepaint here, in the slotParagraphModified case we want to tqrepaint only once at the end } void KoBgSpellCheck::checkerContinue() @@ -187,7 +187,7 @@ void KoBgSpellCheck::spellCheckerDone() if ( d->paragCache.isEmpty() ) return; - QPtrDictIterator<KoTextParag> itr( d->paragCache ); + TQPtrDictIterator<KoTextParag> itr( d->paragCache ); KoTextParag *parag = d->paragCache.take( itr.currentKey() ); #ifdef DEBUG_BGSPELLCHECKING kdDebug(32500) << "spellCheckerDone : " << parag << ", cache = "<< d->paragCache.count() <<endl; @@ -230,19 +230,19 @@ void KoBgSpellCheck::slotParagraphModified( KoTextParag* parag, int /*ParagModif #if KDE_VERSION > KDE_MAKE_VERSION(3,3,0) if ( length < 10 ) { - QString str = parag->string()->stringToSpellCheck(); + TQString str = parag->string()->stringToSpellCheck(); /// ##### do we really need to create a Filter every time? Filter filter; filter.setBuffer( str ); // pos - 1 wasn't enough for the case a splitting a word into two misspelled halves - filter.setCurrentPosition( QMAX( 0, pos - 2 ) ); + filter.setCurrentPosition( TQMAX( 0, pos - 2 ) ); int curPos = filter.currentPosition(); // Filter adjusted it by going back to the last word - //kdDebug() << "str='" << str << "' set position " << QMAX(0, pos-2) << " got back curPos=" << curPos << endl; + //kdDebug() << "str='" << str << "' set position " << TQMAX(0, pos-2) << " got back curPos=" << curPos << endl; filter.setSettings( d->backSpeller->settings() ); // Tricky: KSpell2::Filter::nextWord's behavior makes the for() loop skip ignored words, // so it doesn't mark them as OK... So we need to clear the marks everywhere first. - // To avoid flickering the repainting is only done once, after checking the parag. + // To avoid flickering the tqrepainting is only done once, after checking the parag. markWord( parag, curPos, parag->length() - curPos, false ); for ( Word w = filter.nextWord(); !w.end; w = filter.nextWord() ) { @@ -254,7 +254,7 @@ void KoBgSpellCheck::slotParagraphModified( KoTextParag* parag, int /*ParagModif parag->document()->emitRepaintChanged(); #else if ( length < 3 ) { - QString word; + TQString word; int start; bool misspelled = !d->backSpeller->checkWordInParagraph( parag, pos, word, start ); @@ -287,7 +287,7 @@ void KoBgSpellCheck::slotClearPara() // (e.g. due to adding a word to the ignore list, not due to editing) // // TODO: do this all only if there was a format with 'misspelled' in the paragraph, - // to minimize repaints + // to minimize tqrepaints KoTextStringChar *ch = parag->at( 0 ); KoTextFormat format( *ch->format() ); format.setMisspelled( false ); |