48 if( m_state == sendToBack )
50 VObjectListIterator itr(
document()->selection()->objects() );
51 for ( itr.toLast() ; itr.current() ; --itr )
55 VLayerListIterator litr(
document()->layers() );
57 for ( ; litr.current(); ++litr )
59 objects = litr.current()->objects();
60 VObjectListIterator itr2( objects );
61 for ( ; itr2.current(); ++itr2 )
62 if( itr2.current() == itr.current() )
64 litr.current()->sendToBack( *itr2.current() );
70 else if( m_state == bringToFront )
72 VObjectListIterator itr(
document()->selection()->objects() );
73 for ( ; itr.current() ; ++itr )
77 VLayerListIterator litr(
document()->layers() );
79 for ( ; litr.current(); ++litr )
81 objects = litr.current()->objects();
82 VObjectListIterator itr2( objects );
83 for ( ; itr2.current(); ++itr2 )
84 if( itr2.current() == itr.current() )
86 litr.current()->bringToFront( *itr2.current() );
92 else if( m_state == up || m_state == down )
96 VLayerListIterator litr(
document()->layers() );
97 while( !selection.
objects().isEmpty() && litr.current() )
99 for ( ; litr.current(); ++litr )
103 VObjectList objects = litr.current()->objects();
105 VObjectListIterator objectItr( objects );
107 for ( ; objectItr.current(); ++objectItr )
109 VObjectListIterator selectionItr( selection.
objects() );
110 for ( ; selectionItr.current() ; ++selectionItr )
112 if( objectItr.current() == selectionItr.current() )
115 todo.prepend( objectItr.current() );
117 todo.append( objectItr.current() );
122 kdDebug(38000) <<
"todo.count() : " << todo.count() << endl;
125 VObjectListIterator todoItr( todo );
126 for ( ; todoItr.current(); ++todoItr )
129 litr.current()->upwards( *todoItr.current() );
131 litr.current()->downwards( *todoItr.current() );
133 selection.
take( *todoItr.current() );