- for (int i = 0; i < n; i++)
- {
- DoodleLine *line = new DoodleLine;
- stream >> line->x1 >> line->y1 >> line->x2 >> line->y2;
- lines.Append(line);
- }
- return stream;
+#if wxUSE_STD_IOSTREAM
+wxSTD istream& DoodleSegment::LoadObject(wxSTD istream& stream)
+{
+ wxInt32 n = 0;
+ stream >> n;
+
+ for (int i = 0; i < n; i++)
+ {
+ DoodleLine *line = new DoodleLine;
+ stream >> line->x1 >>
+ line->y1 >>
+ line->x2 >>
+ line->y2;
+ lines.Append(line);
+ }
+
+ return stream;
+}
+#else
+wxInputStream &DoodleSegment::LoadObject(wxInputStream& stream)
+{
+ wxTextInputStream text_stream( stream );
+
+ wxInt32 n = 0;
+ text_stream >> n;
+
+ for (int i = 0; i < n; i++)
+ {
+ DoodleLine *line = new DoodleLine;
+ text_stream >> line->x1 >>
+ line->y1 >>
+ line->x2 >>
+ line->y2;
+ lines.Append(line);
+ }
+
+ return stream;