summaryrefslogtreecommitdiffstats
path: root/kdeui/kspell.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-07 03:45:53 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-07 03:45:53 +0000
commit10308be19ef7fa44699562cc75946e7ea1fdf6b9 (patch)
tree4bc444c00a79e88105f2cfce5b6209994c413ca0 /kdeui/kspell.cpp
parent307136d8eef0ba133b78ceee8e901138d4c996a1 (diff)
downloadtdelibs-10308be19ef7fa44699562cc75946e7ea1fdf6b9.tar.gz
tdelibs-10308be19ef7fa44699562cc75946e7ea1fdf6b9.zip
Revert automated changes
Sorry guys, they are just not ready for prime time Work will continue as always git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1212479 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdeui/kspell.cpp')
-rw-r--r--kdeui/kspell.cpp96
1 files changed, 48 insertions, 48 deletions
diff --git a/kdeui/kspell.cpp b/kdeui/kspell.cpp
index 20b89f41f..c4ea85ec6 100644
--- a/kdeui/kspell.cpp
+++ b/kdeui/kspell.cpp
@@ -393,7 +393,7 @@ bool KSpell::addPersonal( const TQString & word )
TQString qs = word.simplifyWhiteSpace();
//we'll let ispell do the work here b/c we can
- if ( qs.tqfind(' ') != -1 || qs.isEmpty() ) // make sure it's a _word_
+ if ( qs.find(' ') != -1 || qs.isEmpty() ) // make sure it's a _word_
return false;
qs.prepend( "*" );
@@ -412,7 +412,7 @@ bool KSpell::ignore( const TQString & word )
TQString qs = word.simplifyWhiteSpace();
//we'll let ispell do the work here b/c we can
- if ( qs.tqfind (' ') != -1 || qs.isEmpty() ) // make sure it's a _word_
+ if ( qs.find (' ') != -1 || qs.isEmpty() ) // make sure it's a _word_
return false;
qs.prepend( "@" );
@@ -483,7 +483,7 @@ bool KSpell::checkWord( const TQString & buffer, bool _usedialog )
d->checking = true;
TQString qs = buffer.simplifyWhiteSpace();
- if ( qs.tqfind (' ') != -1 || qs.isEmpty() ) { // make sure it's a _word_
+ if ( qs.find (' ') != -1 || qs.isEmpty() ) { // make sure it's a _word_
d->checkNextTimer->start( 0, true );
return false;
}
@@ -525,7 +525,7 @@ bool KSpell::checkWord( const TQString & buffer, bool _usedialog, bool suggest )
d->checking = true;
TQString qs = buffer.simplifyWhiteSpace();
- if ( qs.tqfind (' ') != -1 || qs.isEmpty() ) { // make sure it's a _word_
+ if ( qs.find (' ') != -1 || qs.isEmpty() ) { // make sure it's a _word_
d->checkNextTimer->start( 0, true );
return false;
}
@@ -635,7 +635,7 @@ void KSpell::checkWord3()
{
disconnect( this, TQT_SIGNAL(dialog3()), this, TQT_SLOT(checkWord3()) );
- emit corrected( cwword, tqreplacement(), 0L );
+ emit corrected( cwword, replacement(), 0L );
}
TQString KSpell::funnyWord( const TQString & word )
@@ -660,7 +660,7 @@ TQString KSpell::funnyWord( const TQString & word )
i = j-1;
- if ( !( k = qs.tqfindRev(shorty) ) || k != -1 )
+ if ( !( k = qs.findRev(shorty) ) || k != -1 )
qs.remove( k, shorty.length() );
else
{
@@ -681,7 +681,7 @@ int KSpell::parseOneResponse( const TQString &buffer, TQString &word, TQStringLi
// returns
// GOOD if word is fine
// IGNORE if word is in ignorelist
- // REPLACE if word is in tqreplacelist
+ // REPLACE if word is in replacelist
// MISTAKE if word is misspelled
{
word = "";
@@ -699,7 +699,7 @@ int KSpell::parseOneResponse( const TQString &buffer, TQString &word, TQStringLi
int i,j;
- word = buffer.mid( 2, buffer.tqfind( ' ', 3 ) -2 );
+ word = buffer.mid( 2, buffer.find( ' ', 3 ) -2 );
//check() needs this
orig=word;
@@ -717,22 +717,22 @@ int KSpell::parseOneResponse( const TQString &buffer, TQString &word, TQStringLi
//We don't take advantage of ispell's ignore function because
//we can't interrupt ispell's output (when checking a large
//buffer) to add a word to _it's_ ignore-list.
- if ( ignorelist.tqfindIndex( word.lower() ) != -1 )
+ if ( ignorelist.findIndex( word.lower() ) != -1 )
return IGNORE;
//// Position in line ///
TQString qs2;
- if ( buffer.tqfind( ':' ) != -1 )
- qs2 = buffer.left( buffer.tqfind(':') );
+ if ( buffer.find( ':' ) != -1 )
+ qs2 = buffer.left( buffer.find(':') );
else
qs2 = buffer;
- posinline = qs2.right( qs2.length()-qs2.tqfindRev(' ') ).toInt()-1;
+ posinline = qs2.right( qs2.length()-qs2.findRev(' ') ).toInt()-1;
///// Replace-list stuff ////
- TQStringList::Iterator it = tqreplacelist.begin();
- for( ;it != tqreplacelist.end(); ++it, ++it ) // Skip two entries at a time.
+ TQStringList::Iterator it = replacelist.begin();
+ for( ;it != replacelist.end(); ++it, ++it ) // Skip two entries at a time.
{
if ( word == *it ) // Word matches
{
@@ -745,14 +745,14 @@ int KSpell::parseOneResponse( const TQString &buffer, TQString &word, TQStringLi
/////// Suggestions //////
if ( buffer[0] != '#' )
{
- TQString qs = buffer.mid( buffer.tqfind(':')+2, buffer.length() );
+ TQString qs = buffer.mid( buffer.find(':')+2, buffer.length() );
qs += ',';
sugg.clear();
i = j = 0;
while( (unsigned int)i < qs.length() )
{
- TQString temp = qs.mid( i, (j=qs.tqfind (',',i)) - i );
+ TQString temp = qs.mid( i, (j=qs.find (',',i)) - i );
sugg.append( funnyWord(temp) );
i=j+2;
@@ -873,7 +873,7 @@ void KSpell::checkList3a (KProcIO *)
if ( e == REPLACE )
{
TQString old = *(--wlIt); ++wlIt;
- dlgtqreplacement = word;
+ dlgreplacement = word;
checkListReplaceCurrent();
// inform application
emit corrected( old, *(--wlIt), lastpos ); ++wlIt;
@@ -916,8 +916,8 @@ void KSpell::checkListReplaceCurrent()
wlIt--;
TQString s = *wlIt;
- s.tqreplace(posinline+offset,orig.length(),tqreplacement());
- offset += tqreplacement().length()-orig.length();
+ s.replace(posinline+offset,orig.length(),replacement());
+ offset += replacement().length()-orig.length();
wordlist->insert (wlIt, s);
wlIt = wordlist->remove (wlIt);
// wlIt now points to the word after the repalced one
@@ -940,7 +940,7 @@ void KSpell::checkList4 ()
kdDebug(750) << "KS: cklist4: lastpos: " << lastpos << endl;
old = *(--wlIt);
++wlIt;
- // tqreplace word
+ // replace word
checkListReplaceCurrent();
emit corrected( old, *(--wlIt), lastpos );
++wlIt;
@@ -1016,7 +1016,7 @@ bool KSpell::check( const TQString &_buffer, bool _usedialog )
emitProgress();
// send first buffer line
- int i = origbuffer.tqfind( '\n', 0 ) + 1;
+ int i = origbuffer.find( '\n', 0 ) + 1;
qs = origbuffer.mid( 0, i );
cleanFputs( qs, false );
@@ -1079,10 +1079,10 @@ void KSpell::check2( KProcIO * )
if (e==REPLACE)
{
- dlgtqreplacement=word;
- emit corrected( orig, tqreplacement(), lastpos );
- offset += tqreplacement().length()-orig.length();
- newbuffer.tqreplace( lastpos, orig.length(), word );
+ dlgreplacement=word;
+ emit corrected( orig, replacement(), lastpos );
+ offset += replacement().length()-orig.length();
+ newbuffer.replace( lastpos, orig.length(), word );
}
else //MISTAKE
{
@@ -1130,7 +1130,7 @@ void KSpell::check2( KProcIO * )
//kdDebug(750) << "[EOL](" << tempe << ")[" << temp << "]" << endl;
lastpos = (lastlastline=lastline) + offset; //do we really want this?
- i = origbuffer.tqfind('\n', lastline) + 1;
+ i = origbuffer.find('\n', lastline) + 1;
qs = origbuffer.mid( lastline, i-lastline );
cleanFputs( qs, false );
lastline = i;
@@ -1153,17 +1153,17 @@ void KSpell::check3 ()
// evaluates the return value of the dialog
{
disconnect (this, TQT_SIGNAL (dialog3()), this, TQT_SLOT (check3()));
- kdDebug(750) << "check3 [" << cwword << "] [" << tqreplacement() << "] " << dlgresult << endl;
+ kdDebug(750) << "check3 [" << cwword << "] [" << replacement() << "] " << dlgresult << endl;
//others should have been processed by dialog() already
switch (dlgresult)
{
case KS_REPLACE:
case KS_REPLACEALL:
- offset+=tqreplacement().length()-cwword.length();
- newbuffer.tqreplace (lastpos, cwword.length(),
- tqreplacement());
- emit corrected (dlgorigword, tqreplacement(), lastpos);
+ offset+=replacement().length()-cwword.length();
+ newbuffer.replace (lastpos, cwword.length(),
+ replacement());
+ emit corrected (dlgorigword, replacement(), lastpos);
break;
case KS_CANCEL:
// kdDebug(750) << "canceled\n" << endl;
@@ -1215,15 +1215,15 @@ void KSpell::dialog( const TQString & word, TQStringList & sugg, const char *_sl
TQString tmpBuf = newbuffer;
kdDebug(750)<<" position = "<<lastpos<<endl;
- // extract a context string, tqreplace all characters which might confuse
+ // extract a context string, replace all characters which might confuse
// the RichText display and highlight the possibly wrong word
TQString marker( "_MARKER_" );
- tmpBuf.tqreplace( lastpos, word.length(), marker );
+ tmpBuf.replace( lastpos, word.length(), marker );
TQString context = tmpBuf.mid(QMAX(lastpos-18,0), 2*18+marker.length());
- context.tqreplace( '\n',TQString::tqfromLatin1(" "));
- context.tqreplace( '<', TQString::tqfromLatin1("&lt;") );
- context.tqreplace( '>', TQString::tqfromLatin1("&gt;") );
- context.tqreplace( marker, TQString::tqfromLatin1("<b>%1</b>").arg( word ) );
+ context.replace( '\n',TQString::fromLatin1(" "));
+ context.replace( '<', TQString::fromLatin1("&lt;") );
+ context.replace( '>', TQString::fromLatin1("&gt;") );
+ context.replace( marker, TQString::fromLatin1("<b>%1</b>").arg( word ) );
context = "<qt>" + context + "</qt>";
ksdlg->init( word, &sugg, context );
@@ -1243,7 +1243,7 @@ void KSpell::dialog2( int result )
dlgresult = result;
ksdlg->standby();
- dlgtqreplacement = ksdlg->tqreplacement();
+ dlgreplacement = ksdlg->replacement();
//process result here
switch ( dlgresult )
@@ -1265,14 +1265,14 @@ void KSpell::dialog2( int result )
break;
case KS_REPLACEALL:
{
- tqreplacelist.append( dlgorigword );
- TQString _tqreplacement = tqreplacement();
- tqreplacelist.append( _tqreplacement );
- emit tqreplaceall( dlgorigword , _tqreplacement );
+ replacelist.append( dlgorigword );
+ TQString _replacement = replacement();
+ replacelist.append( _replacement );
+ emit replaceall( dlgorigword , _replacement );
}
break;
case KS_SUGGEST:
- checkWord( ksdlg->tqreplacement(), false, true );
+ checkWord( ksdlg->replacement(), false, true );
return;
break;
}
@@ -1295,7 +1295,7 @@ KSpell::~KSpell()
KSpellConfig KSpell::ksConfig() const
{
ksconfig->setIgnoreList(ignorelist);
- ksconfig->setReplaceAllList(tqreplacelist);
+ ksconfig->setReplaceAllList(replacelist);
return *ksconfig;
}
@@ -1413,13 +1413,13 @@ KSpell::modalCheck( TQString& text, KSpellConfig* _kcs )
void KSpell::slotSpellCheckerCorrected( const TQString & oldText, const TQString & newText, unsigned int pos )
{
- modaltext=modaltext.tqreplace(pos,oldText.length(),newText);
+ modaltext=modaltext.replace(pos,oldText.length(),newText);
}
void KSpell::slotModalReady()
{
- //kdDebug() << tqApp->loopLevel() << endl;
+ //kdDebug() << qApp->loopLevel() << endl;
//kdDebug(750) << "MODAL READY------------------" << endl;
Q_ASSERT( m_status == Running );
@@ -1439,7 +1439,7 @@ void KSpell::slotModalDone( const TQString &/*_buffer*/ )
cleanUp();
//kdDebug() << "ABOUT TO EXIT LOOP" << endl;
- //tqApp->exit_loop();
+ //qApp->exit_loop();
//modalWidgetHack->close(true);
slotModalSpellCheckerFinished();
@@ -1537,7 +1537,7 @@ void KSpell::initialize( TQWidget *_parent, const TQString &_caption,
// copy ignore list from ksconfig
ignorelist += ksconfig->ignoreList();
- tqreplacelist += ksconfig->tqreplaceAllList();
+ replacelist += ksconfig->replaceAllList();
texmode=dlgon=false;
m_status = Starting;
dialogsetup = false;