[scribus-dev] Tables GSoC - Weekly Report #4

Elvis Stansvik elvstone at gmail.com
Mon Jun 27 01:04:29 UTC 2011

Hi again,

I know it's technically Monday, so I'm late :) Below is my fourth
weekly report. [1]

A simple screencast showing the state of border painting is at



[1] http://wiki.scribus.net/canvas/GSoC_2011_Tables_Weekly_Reports

= Tables GSoC - Weekly Report #4 =

== Work Report ==
* Some small cleanups to insertRows()/-Columns() and removeRows()/-Columns().
* Added a new empty page "Table" to the PP.
* Added properties for table border model and border drawing options
to the table style / table.
* Drafted a design of how borders could be collected by "border
collectors" inheriting from a common base class and started working on
* Added a drawLine(...) taking QPointF to ScPainter.
* Realized my initial design mentioned above was probably
unnecessarily complex / over-designed and abandoned it.
* Added a PageItem_Table::collapseBorders(...) which does primitive
collapsing of two borders.
* Added four functions to PageItem_Table for getting the correctly
collapsed borders of a cell.
* Added PageItem_Table::drawBorders(...) for painting a list of borders.
* Added PageItem_Table::drawTableCollapsed which paints the entire
table with collapsed borders. It works by making one iteration across
the cells of the table, painting cell backgrounds and collecting
borders as it goes. It then paints the collected horizontal and
vertical borders in the correct order in a second pass.
* Switched to using QRectF / QPointF instead of FRect / FPoint.
* Added PageItem_Table::adjustBorderJoins(...) which adjusts the
endpoints of the four borders surrounding a cell according to the
border drawing order (horizontal first or vertical first).
* Added setTableBorderDrawingOptions(...) to scripter API.

== Project Status ==
On the schedule for this past week was

* Cell formatting properties such as border and padding.
* Cell content layout; use Scribus' text frames to populate cells.

And quite frankly (and unfortunately) I haven't managed to do half of
the things I wanted to. The reasons for this are several and mostly
has to do with bad planning on my part, so I take full responsibility
for all of them.

Firstly, we had visitors from Singapore coming in on Tue-Wed, and the
plan was that Hanna would take care of showing them around town et.c.,
as she was supposed to have those days off. But they called her in for
work in the last minute, leaving me to take care of the guests.
Secondly, for Midsummer celebrations we were as usual going up to some
friend's summer house up in the northwest. Before I left I made sure
that tethering using my Android phone would work in Linux, and looked
up the 3G coverage up there, as it's quite a remote location. My hope
was to get some hacking done while up there. Tethering worked out of
the box and the coverage map I looked said it would be OK.
Unfortunately it was only good for certain providers, and coverage was
horrible (even regular calls were a bit shaky for me). Finally, as the
tickets for the train we were going to take up there on Friday rapidly
grew outrageously expensive, we had to book tickets for early Thursday
instead. This all meant that when I got home late Saturday night, I
hadn't gotten much work done at all. Hence the meagre list in the Work
Report this time around. It's a combination of unrealistic planning on
my part and some bad circumstances.

But enough about that. The project status right now is that basic
painting of solid collapsed borders is pretty much done. The approach
I finally settled on seems to work out OK, though some things could of
course be improved.

== Problems / Questions ==
Nothing at the moment. One thing that gave me a little surprise was
that I realized e.g. FRect::right() will not return left() + width()
but left() + width() - 1 (just like that infamous "bug" QRect has for
historical reasons). I've since switched to QRectF.

== Next Week ==
In the timeline for next week is

* More integration of text frames. Fixing of issues/road bumps.
* UI: Row/column selection/insertion/removal/resizing.

How appropriate that I managed to get the words "road bumps" in there
for this week :)

On a more serious note, what I'll be working hard on during next week
is of course getting back on schedule. First I'll fix any remaining
issues with the basic border drawing I have now. This means

* Add a vertical and horizontal offset to the table layout. The basic
table grid should actually be offset by (max(left borders of first
column)/2, max(top borders of first row)/2)
* Add cell padding (this is easy, it's just a few more properties on the cells).

After that I should have content bounding rectangles for the cells,
and can finally turn my head to integrating Scribus' text frames. As
the schedule also mentions UI for next week, I'll try to at least
start looking at canvas modes and cell selections.

More information about the scribus-dev mailing list