[scribus-dev] Tables GSoC - Weekly Report #6
Elvis Stansvik
elvstone at gmail.com
Mon Jul 11 12:16:37 UTC 2011
2011/7/11 Elvis Stansvik <elvstone at gmail.com>:
> 2011/7/11 Elvis Stansvik <elvstone at gmail.com>:
>> ...
>> ===Question 2===
>> I've now finally hit some problems relating to painting outside of the
>> table frame (before I didn't have any artifacts because of this, but
>> now they've started to appear sometimes when changing the border
>> through UI).
>
> I should note that this happens when the border reaches a certain
> width, probably when it goes outside the area around the frame that is
> actually repainted. So I really do think the table should never paint
> outside its frame. Is it OK if I try to implement the offset thing
> (and also at the same time finally get around to setting the cliprect
> properly, I think I did try early on with using the PoLine but it
> wasn't working, I'll try again).
>
> If it is OK, then my old question from the mid-week mini report is
> still valid; How can I be notified of style changes? Since the table
> needs to have this offset correctly set at all times, it needs to be
> notified of the following style changes, whether they came as a result
> of a change in a parent style or as a change in the locally stored
> style used for direct formatting:
>
> 1) Table top border changes.
> 2) Table left border changes.
> 3) Cell top border changes (on cells in row 0)
> 4) Cell left border changes (on cells in col 0)
After some more investigation I realize that it's not possible to
listen to individual style changes, but that it's possible to listen
to changes in the StyleContext. That means I should be able to listen
to the StyleContexts I have for table and cell styles in ScribusDoc
(docTableStyles and docCellStyles) to get notified of possible changes
in relevant parent styles. And for direct formatting I can just ensure
that the offset is also recalculated when setters are called on
PageItem_Table. Does that sound sane?
Listening to the style context like that will notify me of all style
changes, which is a bit liberal, but it's OK I think since it's not
time critical and besided the recalculation of the offsets should be
quite quick.
Elvis
More information about the scribus-dev
mailing list