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

List:       kde-commits
Subject:    koffice/karbon
From:       Rob Buis <rwlbuis () xs4all ! nl>
Date:       2003-06-01 18:32:16
[Download RAW message or body]

CVS commit by buis: 

Seperating VClipartCmd...


  A            commands/vclipartcmd.cc   1.1
  A            commands/vclipartcmd.h   1.1
  M +2 -0      commands/Makefile.am   1.26
  M +1 -37     tools/vcliparttool.cc   1.28
  M +0 -21     tools/vcliparttool.h   1.14


--- koffice/karbon/tools/vcliparttool.h  #1.13:1.14
@@ -29,5 +29,4 @@
 #include <kdialogbase.h>
 
-#include "vcommand.h"
 #include "vtool.h"
 
@@ -92,24 +91,4 @@ protected:
 
 private:
-
-        class VClipartCmd : public VCommand
-        {
-        public:
-                VClipartCmd( VDocument* doc, const QString& name, VObject* clipart );
-                virtual ~VClipartCmd()
-                {}
-
-                virtual void execute();
-                virtual void unexecute();
-                virtual bool isExecuted()
-                {
-                        return m_executed;
-                }
-
-        private:
-                VObject* m_clipart;
-                bool m_executed;
-        };
-
         VObject* m_clipart;
         KoPoint m_topleft;

--- koffice/karbon/tools/vcliparttool.cc  #1.27:1.28
@@ -34,4 +34,5 @@
 #include <karbon_view.h>
 #include "vcliparttool.h"
+#include <commands/vclipartcmd.h>
 #include <core/vdocument.h>
 #include <core/vgroup.h>
@@ -381,41 +382,4 @@ VClipartTool::cancel()
 
         delete m_clipart;
-}
-
-VClipartTool::VClipartCmd::VClipartCmd( VDocument* doc, const QString& name, VObject* clipart )
-                : VCommand( doc, name ), m_clipart( clipart->clone() ), m_executed( false )
-{
-}
-
-void
-VClipartTool::VClipartCmd::execute()
-{
-        if( !m_clipart )
-                return;
-
-        if( m_clipart->state() == VObject::deleted )
-                m_clipart->setState( VObject::normal );
-        else
-        {
-                m_clipart->setState( VObject::normal );
-                document()->append( m_clipart );
-                document()->selection()->clear();
-                document()->selection()->append( m_clipart );
-        }
-
-        m_executed = true;
-}
-
-void
-VClipartTool::VClipartCmd::unexecute()
-{
-        if( !m_clipart )
-                return;
-
-        document()->selection()->take( *m_clipart );
-
-        m_clipart->setState( VObject::deleted );
-
-        m_executed = false;
 }
 

--- koffice/karbon/commands/Makefile.am  #1.25:1.26
@@ -11,4 +11,5 @@
         vbooleancmd.h \
         vcleanupcmd.h \
+        vclipartcmd.h \
         vcommand.h \
         vdeletecmd.h \
@@ -29,4 +30,5 @@
         vbooleancmd.cc \
         vcleanupcmd.cc \
+        vclipartcmd.cc \
         vcommand.cc \
         vdeletecmd.cc \


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

Configure | About | News | Add a list | Sponsored by KoreLogic