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

List:       koffice-devel
Subject:    Karbon visitor and command, difficulties understanding parts of it.
From:       Tim Beaulen <tbscope () gmail ! com>
Date:       2005-07-24 15:55:27
Message-ID: dd1e9b170507240855167d49e () mail ! gmail ! com
[Download RAW message or body]

Hello,

I'm trying to fix a undo/redo bug in Karbon.
The specific bug report can be found here:
http://bugs.kde.org/show_bug.cgi?id=60438

Part of the bug can be solved be removing two lines in the unexecute
function of the vtransformcmd.cc code, like this:

Index: vtransformcmd.cc
===================================================================
--- vtransformcmd.cc    (revision 437690)
+++ vtransformcmd.cc    (working copy)
@@ -138,8 +138,6 @@
        }
        // reset
        m_mat = m_mat.invert();
-       delete( m_selection );
-       m_selection = 0L;
        setSuccess( false );
 }


This at least solves the problem that the selection that this command
worked on is not deleted after an undo, so that you can redo the
command again on the selection it applied to.


The biggest problem is the VTransformCmd::visitVSubpath function.
It operates on whatever is currently selected on the screen, and not
on the stored selection. At least, it looks that way. Therefore, if
you move a complete ellipse and then select a node on the ellipse and
try to undo the move, the undo takes only place on the selected point,
and not the complete ellipse.

This function takes a VSubpath path. This is obviously not the correct
path it gets.

I tried several things but always end up in trouble and not getting
the desired effect.

One thing that you can't do is just select each and every point of the
objects again as that is not always true. You can move a single point
too for example.

But what I also don't get is this: in the unexecute function you see
these lines:

// move objects back to original position
visit( *m_selection );

Then why does the visitVSubpath work on a different selection?
m_selection is the selection stored while creating the command. It can
not change as far as I know.


I guess I don't fully understand the concept of visitors yet.
Maybe someone else can check this out and give me some pointers?

Thanks.
_______________________________________________
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