Martin Vermeer wrote:
On Wed, 24 Oct 2007 10:05:22 +0200
Abdelrazak Younes <[EMAIL PROTECTED]> wrote:

...

I _hope_ the encoding problem was the only one remaining... can you say
'spaghetti'?
It wasn't so bad in the end, was it? ;)
I circumvented the spaghetti rather than addressing it ;-/ "Not good"
again. This is often what happens: a new layer of code is piled on top,
and the "wart" gets encapsulated.
Yep, a lot of LyX source code is like this. People adding code to methods instead of encapsulating new code in new smaller methods...

We should put a hard rule that anyone adding more than 10 lines of code to a method should do so in a new method. Or is it in the coding rules already?


bool Paragraph::isFreeSpacing() const
{
        if (layout()->free_spacing)
                return true;

        // for now we just need this, later should we need this in some
        // other way we can always add a function to Inset too.
        return ownerCode() == ERT_CODE || ownerCode() == LISTINGS_CODE;
}

Grrr!, Grrrr!! and again Grrrrr!!!

What shall we do with this?

I am afraid this is needed in a number of place. This ownerCode() concept is flawed I think. I suspect it won't be needed the moment you proceed to this change:

I am thinking of just implementing isFreeSpacing() for Inset, and then
inheriting and modifying it in Collapsable using layout.verbatim. Are
there any problems with that?

Looks like a sane thinks to do.

Abdel.

Reply via email to