25#include "vselection.h"
30 :
VCommand( doc, i18n(
"Group Objects" ),
"14_group" )
32 m_selection = document()->selection()->clone();
37VGroupCmd::~VGroupCmd()
39 delete( m_selection );
45 m_group =
new VGroup( document()->activeLayer() );
47 VObjectListIterator itr( m_selection->objects() );
48 for ( ; itr.current() ; ++itr )
51 VGroup *parent =
dynamic_cast<VGroup*
>( itr.current()->parent() );
53 parent->
take( *itr.current() );
55 m_group->append( itr.current() );
58 document()->append( m_group );
59 document()->selection()->clear();
60 document()->selection()->append( m_group );
71 document()->selection()->clear();
73 VObjectListIterator itr( m_group->objects() );
74 for ( ; itr.current() ; ++itr )
77 document()->selection()->append( itr.current() );
81 if( ( parent =
dynamic_cast<VGroup*
>( m_group->parent() ) ) )
84 parent->
take( *m_group );
87 VObjectListIterator itr = m_selection->objects();
89 for ( ; itr.current() ; ++itr )
91 parent->
append( itr.current() );
The base class for all karbon commands.
All non-visual, static doc info is in here.
Base class for all sort of VObject conglomerats.
void take(const VObject &object)
Removes the reference to child object, not the object itself.
void append(VObject *object)
Appends a new child object.
@ deleted
deleted, nearly dead