>>>>> "Juergen" == Juergen Spitzmueller <[EMAIL PROTECTED]> writes:

Juergen> Jean-Marc Lasgouttes wrote:
>> Concerning this
>> 
>> +           // there's obviously no better way to omit indendation
>> in tabular cells :-( +           && (par.ownerCode() !=
>> InsetBase::TEXT_CODE || isMainText())
>> 
>> Do you mean "there is no obvious better way"?

Juergen> Read: *I* did not find any other way.

Your comment implies that there is no better way :)

>> What is the value of par.ownerCode() here?

Juergen> par.ownerCode() returns TEXT_CODE for tabular cells (not, as
Juergen> I had expected, TABULAR_CODE). The problem is that there
Juergen> seems to be no way (except the above, which strikes me rather
Juergen> vague) to tell leftMargin that a paragraph is part of a
Juergen> tabular cell.

So the test only works by chance, because a tabular cell is the only
insettext that is not subclassed, right? The right solution, then,
could be to create an InsetCell, which is a child of insettext and
returns CELL_CODE. But this is not something we want to do now.

We could move the test lyxCode == TEXT_CODE inside
InsetText::neverIndent, but this does not handle the isMainText()
case.

What about

bool InsetText::neverIndent{} const 
{
        // only a tabular cell does that.
        return lyxCode() == TEXT_CODE;
}

and then in the patch, test for 

+           // in some insets, paragraphs are never indented
+           && (isMainText() || !par.inInset()->neverIndent())

[inInset is always tru AFAICS]

Would that work?

JMarc

Reply via email to