- wxDocument::SaveObject(stream);
-
- stream << doodleSegments.Number() << '\n';
- wxNode *node = doodleSegments.First();
- while (node)
- {
- DoodleSegment *segment = (DoodleSegment *)node->Data();
- segment->SaveObject(stream);
- stream << '\n';
+ wxDocument::SaveObject(stream);
+
+ wxInt32 n = doodleSegments.Number();
+ stream << n << '\n';
+
+ wxNode *node = doodleSegments.First();
+ while (node)
+ {
+ DoodleSegment *segment = (DoodleSegment *)node->Data();
+ segment->SaveObject(stream);
+ stream << '\n';
+
+ node = node->Next();
+ }
+
+ return stream;
+}
+#else
+wxOutputStream& DrawingDocument::SaveObject(wxOutputStream& stream)
+{
+ 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();
+ }