- stream << lines.Number() << '\n';
- wxNode *node = lines.First();
- while (node)
- {
- DoodleLine *line = (DoodleLine *)node->Data();
- stream << line->x1 << " " << line->y1 << " " << line->x2 << " " << line->y2 << "\n";
- node = node->Next();
- }
- return stream;
+ wxInt32 n = m_lines.GetCount();
+ stream << n << '\n';
+
+ wxList::compatibility_iterator node = m_lines.GetFirst();
+ while (node)
+ {
+ DoodleLine *line = (DoodleLine *)node->GetData();
+ stream << line->x1 << " " <<
+ line->y1 << " " <<
+ line->x2 << " " <<
+ line->y2 << "\n";
+ node = node->GetNext();
+ }
+
+ return stream;
+}
+#else
+wxOutputStream &DoodleSegment::SaveObject(wxOutputStream& stream)
+{
+ wxTextOutputStream text_stream( stream );
+
+ wxInt32 n = m_lines.GetCount();
+ text_stream << n << wxT("\n");
+
+ wxList::compatibility_iterator node = m_lines.GetFirst();
+ while (node)
+ {
+ DoodleLine* line = (DoodleLine*)node->GetData();
+ text_stream << line->x1 << wxT(" ") <<
+ line->y1 << wxT(" ") <<
+ line->x2 << wxT(" ") <<
+ line->y2 << wxT("\n");
+ node = node->GetNext();
+ }
+
+ return stream;