[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: TextTool commands
From:       Thomas Zander <zander () kde ! org>
Date:       2007-03-22 22:11:58
Message-ID: 200703222311.58376.zander () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Thursday 22 March 2007 21:32, Pierre Stirnweiss wrote:
> I am looking into the TextTool because I would like to work on a track
> changes functionnality for KWord, which could then lead to collaboration
> functionnality.
[]
> I have done a quick trial for the bold operation. It work as follow:
> - the TextTool has got a slot for the bold action
> - the slot creates a new TextBoldCommand and adds it directly to the canvas
> - the constructor of the command stores the text formatting about to be
> changed with a TextFragmentBackup object
> - this info is used for the undo.
> This bypasses the QDocument undo/redo but allows more flexibility.

Not using the QTextDocument undo/redo is not possible; as that would require 
us to emulate all the features of components like the QTextCursor etc.
For example; pressing enter inserts a '\n' but that also inherits the 
properties from the previous paragraph.
I really don't want to see code appearing in koffice to do that.

Did you look into the kotext/KoTextEditingPlugin.h ?
Its rather new, and does not have much API docs, but the idea is that you get 
a call every time a word is changed via the tool.

Additionally you may be interrested in the QTextDocument::contentsChange 
signal.

Hope that helps.
-- 
Thomas Zander

[Attachment #5 (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