Abdelrazak Younes wrote:

> Jürgen Spitzmüller wrote:
>> Abdelrazak Younes wrote:
>>> I understand but I still don't like the scanning... :-)
>> 
>> I don't like it either. But I don't see an alternative yet.
> 
> We could just provide the feature if the label is not deeper than
> one-level. If the user wants to deeply bury the label inside nested
> insets, then he will miss the feature.

Not good. There is no logical reason why it should not work with a deeply
nested caption. Even if you can't imagine reasons to nest captions, there
might be some cases where this is useful.

> In other word:
> 
> if (parent().lyxCode() == InsetBase::CAPTION_CODE)
>    name = from_ascii(static_cast<InsetCaption const &>(parent()).type());
> 
> if (parent().lyxCode() == InsetBase::OPTARG_CODE
>      && parent().parent().lyxCode() == InsetBase::CAPTION_CODE)
>    name = from_ascii(
>       static_cast<InsetCaption const &>(parent().parent()).type());
> 
> The tree-like approach brings very clean and understandable code IMO.

Except for copy/paste and undo/redo. This becomes ugly.

> Abdel.
> 
> PS: I have a patch mostly ready for that.

Why? I fully agree with Andre that the tree<->object decision should be
thoroughly thought out, because it has a lot of implications. This needs to
be done before any coding, and we should not introduce a mixture of both
approaches.

And if anybody forgot: Now is not the time to make such decisions or even to
discuss them. There are plenty of open bugs and regressions with 1.5.0
target in bugzilla.


Georg

Reply via email to