yuhuihu / excellibrary

Automatically exported from code.google.com/p/excellibrary
0 stars 0 forks source link

Bug with one file in QiHe.Office.Excel.MsofbtDgg #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Cannot open one xls file in OfficeDoc. Exception in this source code of
class QiHe.Office.Excel.MsofbtDgg:

namespace QiHe.Office.Excel
{
    public partial class MsofbtDgg : EscherRecord
    {
// This collection never used
        Dictionary<int, int> GroupIdClusters = new Dictionary<int, int>();
        public override void Decode()
        {
            MemoryStream stream = new MemoryStream(Data);
            BinaryReader reader = new BinaryReader(stream);
            MaxShapeID = reader.ReadInt32();
            NumIDClusters = reader.ReadInt32();
            NumSavedShapes = reader.ReadInt32();
            NumSavedDrawings = reader.ReadInt32();
            IDClusters = new List<long>();
            while (stream.Position < stream.Length)
            {
                //IDClusters.Add(reader.ReadInt64());
                int drawingGroupId = reader.ReadInt32();
                int numShapeIdsUsed = reader.ReadInt32();
// In this line i has a Exception (Double keys)
                GroupIdClusters.Add(drawingGroupId, numShapeIdsUsed);
            }
        }

    }
}

I remove line GroupIdClusters.Add(drawingGroupId, numShapeIdsUsed); and all
be fine. 

Original issue reported on code.google.com by outcold...@gmail.com on 26 Mar 2009 at 7:48

GoogleCodeExporter commented 9 years ago
fixed by r42.

Original comment by China.LiuJunFeng on 26 Mar 2009 at 10:46