[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: Re: Some input on tables
From: Thomas Zander <zander () kde ! org>
Date: 2009-06-14 21:18:51
Message-ID: 200906142318.52090.zander () kde ! org
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
On Friday 12. June 2009 14.14.15 Elvis Stansvik wrote:
> Thomas, all,
[]
Looks great all ;)
> - A couple of technical questions -
>
> o I understand the x(), y() and width() control the positioning and
> confinement of the layout engine, but can I expect any surprises here?
> Is it law, or are there any places where the layout engine will not
> obey these?
From the top of my head the only place / reason this is ignored is in kword
that does text-runaround.
So there might be an object in the way that makes the text move. I'd be
interested in finding out what other office suites do if you put a circle over
a table...
Still, if kword decides to move a paragraph based on a shape getting in the
way the Layout object still has all the power to correct it afterwards when
kword calls addLine() on it.
So I think you can safely ignore this issue for now.
> o Given a QTextCursor, I can use QTextCursor::currentTable() to
> determine if I'm inside a table, but I guess I shouldn't use this
> method too liberally, as it does a parent frame traversal and
> qobject_cast<QTextTable *>, and instead have state flag(s) within the
> layout engine that I set/unset to track whether I'm inside or outside
> table cells?
Sounds good; if you combine this with the current text pos
(QTextBlock::position()) and the QTextTable::firstPosition() / lastPosition()
I think you should be safe, speed wise.
Additionally you can just use QTextDocument::rootFrame() and the
QTextFrame::childFrames() to quickly figure out when the first table starts to
avoid calls to currentTable() for plain text blocks.
> All feedback/corrections/suggestions are very much welcome. In the
> meantime I'll keep working on a first basic layout test.
Coolness :)
--
Thomas Zander
["signature.asc" (application/pgp-signature)]
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic