On 03-Jan-2002 Andre Poenitz wrote:
> On Thu, Dec 27, 2001 at 09:11:17AM +0100, Juergen Vigna wrote:
>> The only thing you have to do is implement the
>> virtual functions in formula.[Ch] (or anyway your outermost UpdatableInset!)
>>
>>   virtual bool searchForward(BufferView *, string const &, ...
>>   virtual bool searchBackward(BufferView *, string const &, ...
> 
> Okidoki... looks like you were right ;-)
> 
> And now the bonus question: How does replace work?

Hmm IMO that replace is not possible in mathed insets without greater
rewrite of lyxfind.C as it assumes that the selection is found inside
a LyXText structure, which it seems mathed insets do not have.

This is mainly what lyxfind.C does for a single replace if some text was
already found and is selected (but have a look at that file).

                bv->hideCursor();
                bv->update(bv->getLyXText(), BufferView::SELECT|BufferView::FITCUR);
                bv->toggleSelection(false);
                bv->getLyXText()->replaceSelectionWithString(bv, replacestr);
                bv->getLyXText()->setSelectionOverString(bv, replacestr);
                bv->update(bv->getLyXText(),
                           BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
                ++replace_count;

So you see that the substitution is actually done by the function
LyXText::replaceSelectionWithString(...)

       Jug

--
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._
Dr. Jürgen Vigna        E-Mail:  [EMAIL PROTECTED]
Italienallee 13/N       Tel/Fax: +39-0471-450260 / +39-0471-450253
I-39100 Bozen           Web:     http://www.sad.it/~jug
-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._-._

Reinhart was never his mother's favorite -- and he was an only child.
                -- Thomas Berger

Reply via email to