[scribus-dev] tables gsoc: primitive code review

Elvis Stansvik elvstone at gmail.com
Fri Jul 15 16:25:47 UTC 2011


2011/7/15 Nick Shaforostoff <shafff at ukr.net>:
> ok, in pageitem_table.h i suggest changing these kind of lines:
>        /// Vertical positions of rows.
>        QList<qreal> m_rowPositions;
>        /// Height of rows.
>        QList<qreal> m_rowHeights;
>
> into
> struct RowPosHeight
> {
>    qreal position, height
> };
> QList<RowPosHeight> m_rowPosHeights;
>
>
> this would reduce memory overhead and also will make code a bit faster, as those two vars are often accessed/modified together.

Makes sense. Although I'm not too concerned about performance at the
moment, I'll try to fix this ASAP.

In _theory_ the need for storing the widths/heights could be done away
with all together and they could instead be deduced from the positions
alone, provided that you store rows() + 1 and columns() + 1 positions,
but I don't think the kludge would be worth it. You'd also need two
list lookups to get the width then, unless you use a linked list.

Anyway, thanks for taking the time!

Elvis



More information about the scribus-dev mailing list