[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: Re: patch: (preliminary) fix for #31732
From: David Faure <david () mandrakesoft ! com>
Date: 2002-01-15 22:24:51
[Download RAW message or body]
On Tuesday 15 January 2002 22:43, Emmanuel Touzery wrote:
> Hello!
>
> >Thanks for the patch... but allow me to comment on it :
>
> no problem, I actually asked for comments :O)
>
> > I totally hate code
> >duplication. It makes maintainance and debugging very difficult.
> >
> >Please use an approach similar to KPresenter's use of
KoTextFormatInterface.
>
> Yes, I understand, only it makes grouping the KCommand for the undo harder
> (kpresenter does not group them). actually with the new patch the undo
> actions are not grouped anymore (that is, if you select several cells in a
> table, do an action, and undo it, you'll have to click undo the number of
> selected cells, not just once).
>
> the reason is that setBold() and such doesn't return a KCommand, so i would
> need new methods like KoTextFormatInterface::startGrouping() and
> endGrouping(), but that is not very adapted for the API i guess (and would
> break a lot of code) so i don't know exactly how to solve that "nicely".
> maybe you have a better idea?
Indeed - and kpresenter has the same problem, didn't think about undo/redo
when writing KoTextInterface.
OK, so what about making those method return a KCommand ?
Wouldn't be hard for KoTextObject, setFormat() already calls
setFormatCommand(), to get a KCommand out of it. It requires moving a bit of
code around though, we still need kotextobject to emit the command when not
called through kotextformatinterface.
Once each call returns a KCommand, the caller can simply bundle them into a
macro command.
What do you think ?
--
David FAURE, david@mandrakesoft.com, faure@kde.org
http://people.mandrakesoft.com/~david, http://www.konqueror.org
KDE 3.0: Konquering the Desktops
_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://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