Ejemplo n.º 1
0
        public LexPage(SpreadSheet xls, int no) : this(xls.GetSheet().name, no)
        {
            char endCol = (char)('A' + xls.GetRow(0).GetLastCellNum());

            for (char c = 'B'; c <= endCol; ++c)
            {
                columnTitles[xls.GetString1(1, c)] = c - 'B';
            }
            List <string> list = new List <string> ();

            for (int r = 1; r <= xls.GetSheet().GetLastRowNum(); ++r)
            {
                list.Clear();
                string key = xls.GetString1(r + 1, 'A').Trim();
                if (!key.IsEmpty())
                {
                    for (char c = 'B'; c <= endCol; ++c)
                    {
                        list.Add(xls.GetString1(r + 1, c));
                        // TODOM use filter instead of Replace
//						list.Add (xls.GetString(r+1, c).Replace("\\n", "\n"));
                    }
                    if (list.Count > 0)
                    {
                        string[] arr = list.ToArray();
                        if (sheet.ContainsKey(key))
                        {
                            log.Error("Duplicate key: {0}.{1}", name, key);
                        }
                        sheet[key] = arr;
                    }
                }
            }
        }