Jean-Marc Lasgouttes wrote:
> But isn't ``*this'' a good enough LyXText when inside
> LyXText::dispatch? 

Obviously not (or I am doing something wrong):

text3.C: In member function `dispatch_result LyXText::dispatch(const
   FuncRequest&)':
text3.C:1044: error: cannot convert `LyXText' to `LyXText*' for argument `1' 
to
   `void <unnamed>::overwriteSelection(LyXText*)'
make[3]: *** [text3.o] Fehler 1

If I change the function to void overwriteSelection(LyXText lt), I get

text3.C: In function `void <unnamed>::overwriteSelection(LyXText)':
text3.C:143: error: base operand of `->' has non-pointer type `LyXText'
text3.C:144: error: base operand of `->' has non-pointer type `LyXText'
text3.C:145: error: base operand of `->' has non-pointer type `LyXText'
text3.C:146: error: base operand of `->' has non-pointer type `LyXText'
text3.C: In function `void <unnamed>::specialChar(LyXText*, BufferView*,
   InsetSpecialChar::Kind)':
text3.C:378: error: conversion from `LyXText*' to non-scalar type `LyXText'
   requested

text3.C:378 is
void specialChar(LyXText * lt, BufferView * bv, InsetSpecialChar::Kind kind)
{
        lt->update();
        InsetSpecialChar * new_inset = new InsetSpecialChar(kind);
        overwriteSelection(lt);// line 378
        if (!bv->insertInset(new_inset))
                delete new_inset;
        else
                bv->updateInset(new_inset);
}


> I have to admit that I do not understand this code very well, and I
> feel nervous at the idea of adding it to 1.3.x without knowing exactly
> why and how it works.

Fair enough. Though it seems pretty clear to me: just a CUT of the selection 
before actually inserting.

Juergen.

Reply via email to