Fix LFUN_WORD_FIND

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22925 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-02-10 18:52:32 +00:00
parent d9669be4ec
commit 02e8322c79
3 changed files with 9 additions and 10 deletions

View File

@ -1108,7 +1108,10 @@ bool BufferView::dispatch(FuncRequest const & cmd)
break;
case LFUN_WORD_FIND:
find(this, cmd);
if (find(this, cmd))
showCursor();
else
message(_("String not found!"));
break;
case LFUN_WORD_REPLACE: {

View File

@ -244,10 +244,10 @@ docstring const replace2string(docstring const & search, docstring const & repla
}
void find(BufferView * bv, FuncRequest const & ev)
bool find(BufferView * bv, FuncRequest const & ev)
{
if (!bv || ev.action != LFUN_WORD_FIND)
return;
return false;
//lyxerr << "find called, cmd: " << ev << endl;
@ -261,12 +261,7 @@ void find(BufferView * bv, FuncRequest const & ev)
bool matchword = parse_bool(howto);
bool forward = parse_bool(howto);
bool const found = find(bv, search,
casesensitive, matchword, forward);
if (!found)
// emit message signal.
bv->message(_("String not found!"));
return find(bv, search, casesensitive, matchword, forward);
}

View File

@ -45,8 +45,9 @@ docstring const replace2string(docstring const & search,
/** Parse the string encoding of the find request that is found in
* \c ev.argument and act on it.
* The string is encoded by \c find2string.
* \return true if the string was found.
*/
void find(BufferView * bv, FuncRequest const & ev);
bool find(BufferView * bv, FuncRequest const & ev);
/** Parse the string encoding of the replace request that is found in
* \c ev.argument and act on it.