review-request: Fix objects are displayed if they should be hidden
Sebastian Sauer
mail at dipe.org
Tue Jun 7 20:19:21 BST 2011
This is related to bug https://bugs.kde.org/show_bug.cgi?id=274905 or to be
more exact to the objects displayed at the top of the first page which should
not be displayed.
The problem:
The anchored objects are anchored to a header/footer which is never created
and displayed cause no page with such a pageStyle exists in the document. So
we end with displayed shapes that are anchored to a textshape that isn't
visible.
A possible solution:
That's not so easy cause there are quit a lot different ways to address the
problem. Attached is the most simple solution I was able to come up with. I
like that solution cause a) it's at one place and not spread into different
files and b) it's short, easy to read+understand. But then I am not 100% sure
if there are cases where we actually end with an anchored shape that should be
displayed but is never proper resized. My tests didn't show any such cases.
Alternate solutions:
1) hide them in Words' rootAreaProvider::doPostLayout method. I don't like
that cause imho it's a generic problem we should imho better solve in the
textlayout-lib.
2) Check if the passes paragraphRect in
KoTextDocumentLayout::setAnchoringParagraphRect isEmpty and just always hide
shapes if that's the case. This would assume that the paragraphRect never can
be empty for valid areas. I don't know if that assumption is true.
3) ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: AnchoredShapesVisibility.patch
Type: text/x-patch
Size: 1023 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20110607/9149c1ac/attachment.bin>
More information about the calligra-devel
mailing list