Revision 854691(Back to digest)
Other in Office
Say hello to KoTextDocument.
Currently, we have no place to store meta data of the text shape's QTextDocument.
We have the style manager residing in the layout which is not an ideal place.
A place to store automatic list styles is also needed.
My initial thoughts were to have a KoTextDocument that subclasses QTextDocument that stores all this information.
Thomas pointed out that it would be nice to stick in all information in a QTextDocument somehow.
So, the approach chosen, is to store all the meta data as resources using QTextDocument::addResource().
To have a nice mechanism to access them, KoTextDocument is just a wrapper on top of QTextDocument.
Currently, the patch only stores the style manager but more will follow.
An important thing to know is that we should now use QTextDocument::clear() with care since it will clear away the resources too.
If you want to only clear the contents, one must use a QTextCursorto select all + clear selection.