24#include "vungroupcmd.h"
25#include "vselection.h"
30 :
VCommand( doc, i18n(
"Ungroup Objects" ),
"14_ungroup" )
32 m_group =
dynamic_cast<VGroup *
>( document()->selection()->objects().getFirst() );
37VUnGroupCmd::~VUnGroupCmd()
47 document()->selection()->clear();
49 VObjectListIterator itr( m_group->objects() );
50 for ( ; itr.current() ; ++itr )
53 document()->selection()->append( itr.current() );
57 if( ( parent =
dynamic_cast<VGroup*
>( m_group->parent() ) ) )
60 parent->
take( *m_group );
63 VObjectListIterator itr = m_group->objects();
65 for ( ; itr.current() ; ++itr )
67 itr.current()->invalidateBoundingBox();
68 parent->
append( itr.current() );
79VUnGroupCmd::unexecute()
84 VObjectListIterator itr( m_objects );
85 for ( ; itr.current() ; ++itr )
88 document()->activeLayer()->take( *itr.current() );
89 m_group->append( itr.current() );
93 document()->append( m_group );
94 document()->selection()->clear();
95 document()->selection()->append( m_group );
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.
const VObjectList & objects() const
Read only access to the grouped objects.
@ deleted
deleted, nearly dead
@ normal
visible, not active