Browse Source

fix deserialisation of consecutive integer ranges

pull/182/merge
Siegfried Pammer 14 years ago
parent
commit
0bfb193e47
  1. 17
      ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs

17
ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlReader.cs

@ -776,34 +776,23 @@ namespace Ricciolo.StylesExplorer.MarkupReflection
throw new ArgumentException(); throw new ArgumentException();
Int32Collection ints = new Int32Collection(capacity); Int32Collection ints = new Int32Collection(capacity);
switch (type) switch (type) {
{
case IntegerCollectionType.Byte: case IntegerCollectionType.Byte:
for (int i = 0; i < capacity; i++) for (int i = 0; i < capacity; i++)
{
ints.Add(reader.ReadByte()); ints.Add(reader.ReadByte());
}
return ints; return ints;
case IntegerCollectionType.UShort: case IntegerCollectionType.UShort:
for (int j = 0; j < capacity; j++) for (int j = 0; j < capacity; j++)
{
ints.Add(reader.ReadUInt16()); ints.Add(reader.ReadUInt16());
}
return ints; return ints;
case IntegerCollectionType.Integer: case IntegerCollectionType.Integer:
for (int k = 0; k < capacity; k++) for (int k = 0; k < capacity; k++)
{
ints.Add(reader.ReadInt32()); ints.Add(reader.ReadInt32());
}
return ints; return ints;
case IntegerCollectionType.Consecutive: case IntegerCollectionType.Consecutive:
for (int m = reader.ReadInt32(); m < capacity; m++) int start = reader.ReadInt32();
{ for (int m = start; m < capacity + start; m++)
ints.Add(m); ints.Add(m);
}
return ints; return ints;
} }
throw new ArgumentException(); throw new ArgumentException();

Loading…
Cancel
Save