Jean-Marc Lasgouttes wrote:
"Jürgen" == Jürgen Spitzmüller <[EMAIL PROTECTED]> writes:

Jürgen> The attached patch seems the most easiest way to implement
Jürgen> this. Comments?

I'd rather do:

-       if (layout->labeltype == LABEL_SENSITIVE) {
+       if (cur.innerInsetOfType(InsetBase::CAPTION_CODE) || layout->labeltype 
== LABEL_SENSITIVE) {

Yes. That's what I meant in my previous comment (obviously InsetCaption derives from InsetText, not LyXText).

But instead of using 'cur' I'd rather have a new method in LyXText:

InsetText * parent();
InsetText const * parent() const;

Then the above code will be
+ if (parent()->lyxCode() == InsetBase::CAPTION_CODE) || layout->labeltype == LABEL_SENSITIVE) {

That would of course mean that we pass the Parent at LyXText construction. I think that having access to the parent InsetText will remove may hacks in the code.

Abdel.

Reply via email to