+ if (currentSegment->lines.Number() == 0)
+ {
+ delete currentSegment;
+ currentSegment = (DoodleSegment *) NULL;
+ }
+ else
+ {
+ // We've got a valid segment on mouse left up, so store it.
+ DrawingDocument *doc = (DrawingDocument *)view->GetDocument();
+
+ doc->GetCommandProcessor()->Submit(new DrawingCommand("Add Segment", DOODLE_ADD, doc, currentSegment));
+
+ view->GetDocument()->Modify(TRUE);
+ currentSegment = (DoodleSegment *) NULL;
+ }