Added FileVersion attribute to XML format to distinguish legacy float binary files from new double binary files

This commit is contained in:
jrheinlaender
2013-03-27 11:47:18 +04:30
parent 4dcc5eb6cb
commit fdc3e50811
39 changed files with 119 additions and 78 deletions

View File

@@ -1127,14 +1127,20 @@ void PropertyFloatList::SaveDocFile (Base::Writer &writer) const
}
}
void PropertyFloatList::RestoreDocFile(Base::Reader &reader)
void PropertyFloatList::RestoreDocFile(Base::Reader &reader, const int FileVersion)
{
Base::InputStream str(reader);
uint32_t uCt=0;
str >> uCt;
std::vector<double> values(uCt);
for (std::vector<double>::iterator it = values.begin(); it != values.end(); ++it) {
str >> *it;
if (FileVersion > 0) {
str >> *it;
} else {
float val;
str >> val;
(*it) = val;
}
}
setValues(values);
}
@@ -2084,7 +2090,7 @@ void PropertyColorList::SaveDocFile (Base::Writer &writer) const
}
}
void PropertyColorList::RestoreDocFile(Base::Reader &reader)
void PropertyColorList::RestoreDocFile(Base::Reader &reader, const int FileVersion)
{
Base::InputStream str(reader);
uint32_t uCt=0;