summaryrefslogtreecommitdiffstats
path: root/lib/kotext/KoSearchDia.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kotext/KoSearchDia.cpp')
-rw-r--r--lib/kotext/KoSearchDia.cpp90
1 files changed, 45 insertions, 45 deletions
diff --git a/lib/kotext/KoSearchDia.cpp b/lib/kotext/KoSearchDia.cpp
index 915ef4f7..0acd88cc 100644
--- a/lib/kotext/KoSearchDia.cpp
+++ b/lib/kotext/KoSearchDia.cpp
@@ -100,11 +100,11 @@ void KoSearchContextUI::setCtxHistory( const TQStringList & history )
m_ctx->m_strings = history;
}
-KoSearchDia::KoSearchDia( TQWidget * tqparent,const char *name, KoSearchContext *tqfind, bool hasSelection, bool hasCursor )
- : KFindDialog( tqparent, name, tqfind->m_options, tqfind->m_strings )
+KoSearchDia::KoSearchDia( TQWidget * tqparent,const char *name, KoSearchContext *find, bool hasSelection, bool hasCursor )
+ : KFindDialog( tqparent, name, find->m_options, find->m_strings )
{
// The dialog extension.
- m_findUI = new KoSearchContextUI( tqfind, findExtension() );
+ m_findUI = new KoSearchContextUI( find, findExtension() );
setHasSelection(hasSelection);
setHasCursor(hasCursor);
}
@@ -119,12 +119,12 @@ void KoSearchDia::slotOk()
m_findUI->setCtxHistory( findHistory() );
}
-KoReplaceDia::KoReplaceDia( TQWidget *tqparent, const char *name, KoSearchContext *tqfind, KoSearchContext *tqreplace, bool hasSelection, bool hasCursor )
- : KReplaceDialog( tqparent, name, tqfind->m_options, tqfind->m_strings, tqreplace->m_strings )
+KoReplaceDia::KoReplaceDia( TQWidget *tqparent, const char *name, KoSearchContext *find, KoSearchContext *replace, bool hasSelection, bool hasCursor )
+ : KReplaceDialog( tqparent, name, find->m_options, find->m_strings, replace->m_strings )
{
// The dialog extension.
- m_findUI = new KoSearchContextUI( tqfind, findExtension() );
- m_replaceUI = new KoSearchContextUI( tqreplace, replaceExtension() );
+ m_findUI = new KoSearchContextUI( find, findExtension() );
+ m_replaceUI = new KoSearchContextUI( replace, replaceExtension() );
// Look whether we have a selection, and/or a cursor
setHasSelection(hasSelection);
setHasCursor(hasCursor);
@@ -147,8 +147,8 @@ void KoReplaceDia::slotOk()
KoFindReplace::KoFindReplace( TQWidget * tqparent, KoSearchDia * dialog, const TQValueList<KoTextObject *> & lstObject, KoTextView* textView )
- : m_tqfind( new KoTextFind( dialog->pattern(), dialog->options(), this, tqparent ) ),
- m_tqreplace( 0L ),
+ : m_find( new KoTextFind( dialog->pattern(), dialog->options(), this, tqparent ) ),
+ m_replace( 0L ),
m_searchContext( *dialog->searchContext() ),
m_replaceContext(),
m_searchContextEnabled( dialog->optionSelected() ),
@@ -158,12 +158,12 @@ KoFindReplace::KoFindReplace( TQWidget * tqparent, KoSearchDia * dialog, const T
m_textIterator( lstObject, textView, dialog->options() ),
m_lastTextObjectHighlighted( 0 )
{
- connectFind( m_tqfind );
+ connectFind( m_find );
}
KoFindReplace::KoFindReplace( TQWidget * tqparent, KoReplaceDia * dialog, const TQValueList<KoTextObject *> & lstObject, KoTextView* textView )
- : m_tqfind( 0L ),
- m_tqreplace( new KoTextReplace( dialog->pattern(), dialog->replacement(), dialog->options(), this, tqparent ) ),
+ : m_find( 0L ),
+ m_replace( new KoTextReplace( dialog->pattern(), dialog->replacement(), dialog->options(), this, tqparent ) ),
m_searchContext( *dialog->searchContext() ),
m_replaceContext( *dialog->replaceContext() ),
m_searchContextEnabled( dialog->optionFindSelected() ),
@@ -173,23 +173,23 @@ KoFindReplace::KoFindReplace( TQWidget * tqparent, KoReplaceDia * dialog, const
m_textIterator( lstObject, textView, dialog->options() ),
m_lastTextObjectHighlighted( 0 )
{
- connectFind( m_tqreplace );
- connect( m_tqreplace, TQT_SIGNAL( tqreplace( const TQString &, int , int, int ) ),
- this, TQT_SLOT( tqreplace( const TQString &, int , int,int ) ) );
+ connectFind( m_replace );
+ connect( m_replace, TQT_SIGNAL( replace( const TQString &, int , int, int ) ),
+ this, TQT_SLOT( replace( const TQString &, int , int,int ) ) );
}
-void KoFindReplace::connectFind( KFind* tqfind )
+void KoFindReplace::connectFind( KFind* find )
{
- connect( tqfind, TQT_SIGNAL( optionsChanged() ),
+ connect( find, TQT_SIGNAL( optionsChanged() ),
this, TQT_SLOT( optionsChanged() ) );
- connect( tqfind, TQT_SIGNAL( dialogClosed() ),
+ connect( find, TQT_SIGNAL( dialogClosed() ),
this, TQT_SLOT( dialogClosed() ) );
// Connect highlight signal to code which handles highlighting
// of found text.
- connect( tqfind, TQT_SIGNAL( highlight( const TQString &, int, int ) ),
+ connect( find, TQT_SIGNAL( highlight( const TQString &, int, int ) ),
this, TQT_SLOT( highlight( const TQString &, int, int ) ) );
// Connect findNext signal - called when pressing the button in the dialog
- connect( tqfind, TQT_SIGNAL( findNext() ),
+ connect( find, TQT_SIGNAL( findNext() ),
this, TQT_SLOT( slotFindNext() ) );
m_bInit = true;
m_currentParagraphModified = false;
@@ -204,8 +204,8 @@ KoFindReplace::~KoFindReplace()
{
removeHighlight();
//kdDebug(32500) << "KoFindReplace::~KoFindReplace" << endl;
- delete m_tqfind;
- delete m_tqreplace;
+ delete m_find;
+ delete m_replace;
}
void KoFindReplace::optionsChanged()
@@ -270,11 +270,11 @@ bool KoFindReplace::findNext()
m_currentParagraphModified = false;
}
- if ( m_tqfind )
+ if ( m_find )
// Let KFind inspect the text fragment, and display a dialog if a match is found
- res = m_tqfind->find();
+ res = m_find->find();
else
- res = m_tqreplace->replace();
+ res = m_replace->replace();
}
//kdDebug(32500) << k_funcinfo << "we're done. res=" << res << endl;
@@ -286,17 +286,17 @@ bool KoFindReplace::findNext()
m_textIterator.setOptions( m_textIterator.options() & ~KFindDialog::FromCursor );
m_textIterator.restart();
m_bInit = true;
- if ( m_tqfind )
- m_tqfind->resetCounts();
+ if ( m_find )
+ m_find->resetCounts();
else
- m_tqreplace->resetCounts();
+ m_replace->resetCounts();
return findNext();
}
else { // done, close the 'find next' dialog
- if ( m_tqfind )
- m_tqfind->closeFindNextDialog();
+ if ( m_find )
+ m_find->closeFindNextDialog();
else
- m_tqreplace->closeReplaceNextDialog();
+ m_replace->closeReplaceNextDialog();
}
return false;
}
@@ -327,15 +327,15 @@ bool KoFindReplace::findPrevious()
long KoFindReplace::options() const
{
- return m_tqfind ? m_tqfind->options() : m_tqreplace->options();
+ return m_find ? m_find->options() : m_replace->options();
}
void KoFindReplace::setOptions(long opt)
{
- if ( m_tqfind )
- m_tqfind->setOptions(opt);
+ if ( m_find )
+ m_find->setOptions(opt);
else
- m_tqreplace->setOptions(opt);
+ m_replace->setOptions(opt);
m_textIterator.setOptions( opt );
}
@@ -354,19 +354,19 @@ void KoFindReplace::highlight( const TQString &, int matchingIndex, int matching
m_lastTextObjectHighlighted->removeHighlight(true);
m_lastTextObjectHighlighted = m_textIterator.currentTextObject();
//kdDebug(32500) << "KoFindReplace::highlight " << matchingIndex << "," << matchingLength << endl;
- KDialogBase* dialog = m_tqfind ? m_tqfind->findNextDialog() : m_tqreplace->replaceNextDialog();
+ KDialogBase* dialog = m_find ? m_find->findNextDialog() : m_replace->replaceNextDialog();
highlightPortion(m_textIterator.currentParag(), m_offset + matchingIndex, matchingLength, m_lastTextObjectHighlighted->textDocument(), dialog );
}
-// slot connected to the 'tqreplace' signal
-void KoFindReplace::tqreplace( const TQString &text, int matchingIndex,
+// slot connected to the 'replace' signal
+void KoFindReplace::replace( const TQString &text, int matchingIndex,
int replacementLength, int matchedLength )
{
//kdDebug(32500) << "KoFindReplace::replace m_offset=" << m_offset << " matchingIndex=" << matchingIndex << " matchedLength=" << matchedLength << " options=" << options() << endl;
m_matchingIndex = matchingIndex;
int index = m_offset + matchingIndex;
- // highlight might not have happened (if 'prompt on tqreplace' is off)
+ // highlight might not have happened (if 'prompt on replace' is off)
if ( (options() & KReplaceDialog::PromptOnReplace) == 0 )
highlight( text, matchingIndex, matchedLength );
@@ -493,19 +493,19 @@ KMacroCommand* KoFindReplace::macroCommand()
void KoFindReplace::setActiveWindow()
{
- KDialogBase* dialog = m_tqfind ? m_tqfind->findNextDialog() : m_tqreplace->replaceNextDialog();
+ KDialogBase* dialog = m_find ? m_find->findNextDialog() : m_replace->replaceNextDialog();
if ( dialog )
dialog->setActiveWindow();
}
/*int KoFindReplace::numMatches() const
{
- return m_tqfind->numMatches();
+ return m_find->numMatches();
}
int KoFindReplace::numReplacements() const
{
- return m_tqreplace->numReplacements();
+ return m_replace->numReplacements();
}*/
////
@@ -921,10 +921,10 @@ bool KoFindReplace::validateMatch( const TQString & /*text*/, int index, int mat
bool KoFindReplace::shouldRestart()
{
- if ( m_tqfind )
- return m_tqfind->shouldRestart( true /*since text is editable*/, m_doCounting );
+ if ( m_find )
+ return m_find->shouldRestart( true /*since text is editable*/, m_doCounting );
else
- return m_tqreplace->shouldRestart( true /*since text is editable*/, m_doCounting );
+ return m_replace->shouldRestart( true /*since text is editable*/, m_doCounting );
}
#include "KoSearchDia.moc"