On Sun, Feb 10, 2008 at 06:52:34PM -0000, [EMAIL PROTECTED] wrote:
> Author: younes
> Date: Sun Feb 10 19:52:32 2008
> New Revision: 22925
> 
> URL: http://www.lyx.org/trac/changeset/22925
> Log:
> Fix LFUN_WORD_FIND
> 
> Modified:
>     lyx-devel/trunk/src/BufferView.cpp
>     lyx-devel/trunk/src/lyxfind.cpp
>     lyx-devel/trunk/src/lyxfind.h
> 
> Modified: lyx-devel/trunk/src/BufferView.cpp
> URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/BufferView.cpp?rev=22925
> ==============================================================================
> --- lyx-devel/trunk/src/BufferView.cpp (original)
> +++ lyx-devel/trunk/src/BufferView.cpp Sun Feb 10 19:52:32 2008
> @@ -1108,7 +1108,10 @@
>               break;
>  
>       case LFUN_WORD_FIND:
> -             find(this, cmd);
> +             if (find(this, cmd))
> +                     showCursor();
> +             else
> +                     message(_("String not found!"));
>               break;
>  
>       case LFUN_WORD_REPLACE: {
> 
> Modified: lyx-devel/trunk/src/lyxfind.cpp
> URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/lyxfind.cpp?rev=22925
> ==============================================================================
> --- lyx-devel/trunk/src/lyxfind.cpp (original)
> +++ lyx-devel/trunk/src/lyxfind.cpp Sun Feb 10 19:52:32 2008
> @@ -244,10 +244,10 @@
>  }
>  
>  
> -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 @@
>       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);
>  }
>  
>  
> 
> Modified: lyx-devel/trunk/src/lyxfind.h
> URL: http://www.lyx.org/trac/file/lyx-devel/trunk/src/lyxfind.h?rev=22925
> ==============================================================================
> --- lyx-devel/trunk/src/lyxfind.h (original)
> +++ lyx-devel/trunk/src/lyxfind.h Sun Feb 10 19:52:32 2008
> @@ -45,8 +45,9 @@
>  /** 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.

Good!

Andre'

Reply via email to