- wxDocument::SaveObject(stream);
-
- wxTextOutputStream text_stream( stream );
-
- wxInt32 n = doodleSegments.Number();
- text_stream << n << '\n';
-
- wxNode *node = doodleSegments.First();
- while (node)
- {
- DoodleSegment *segment = (DoodleSegment *)node->Data();
- segment->SaveObject(stream);
- text_stream << '\n';
-
- node = node->Next();
- }
-
- return stream;
+ wxDocument::SaveObject(stream);
+
+ wxTextOutputStream text_stream( stream );
+
+ wxInt32 n = doodleSegments.GetCount();
+ text_stream << n << '\n';
+
+ wxList::compatibility_iterator node = doodleSegments.GetFirst();
+ while (node)
+ {
+ DoodleSegment *segment = (DoodleSegment *)node->GetData();
+ segment->SaveObject(stream);
+ text_stream << '\n';
+
+ node = node->GetNext();
+ }
+
+ return stream;