- // Cut the last segment
- if (doc->GetDoodleSegments().GetCount() > 0)
- {
- wxList::compatibility_iterator node = doc->GetDoodleSegments().GetLast();
- DoodleSegment *seg = (DoodleSegment *)node->GetData();
- delete seg;
- doc->GetDoodleSegments().Erase(node);
-
- doc->Modify(true);
- doc->UpdateAllViews();
- }
+ case DOODLE_CUT:
+ {
+ // Paste the segment
+ if (m_segment)
+ {
+ m_doc->GetDoodleSegments().Append(m_segment);
+ m_doc->Modify(true);
+ m_doc->UpdateAllViews();
+ m_segment = NULL;
+ }
+ m_doc->Modify(true);
+ m_doc->UpdateAllViews();
+ break;
+ }
+ case DOODLE_ADD:
+ {
+ // Cut the last segment
+ if (m_doc->GetDoodleSegments().GetCount() > 0)
+ {
+ wxList::compatibility_iterator node = m_doc->GetDoodleSegments().GetLast();
+ DoodleSegment* seg = (DoodleSegment*)node->GetData();
+ delete seg;
+ m_doc->GetDoodleSegments().Erase(node);
+
+ m_doc->Modify(true);
+ m_doc->UpdateAllViews();
+ }
+ }