Esempio n. 1
0
 /// <summary>
 /// Creates new HSSFName   - called by HSSFWorkbook to Create a sheet from
 /// scratch.
 /// </summary>
 /// <param name="book">lowlevel Workbook object associated with the sheet.</param>
 /// <param name="name">the Name Record</param>
 /// <param name="comment"></param>
 internal HSSFName(HSSFWorkbook book, NameRecord name, NameCommentRecord comment)
 {
     this.book = book;
     this._definedNameRec = name;
     _commentRec = comment;
 }
Esempio n. 2
0
 private bool IsRowColHeaderRecord(NameRecord r)
 {
     return r.OptionFlag == 0x20 && ("" + ((char)7)).Equals(r.NameText);
 }
Esempio n. 3
0
 /* package */
 internal HSSFName(HSSFWorkbook book, NameRecord name):this(book, name, null)
 {
     
 }
Esempio n. 4
0
        public void AddName(NameRecord name)
        {
            _definedNames.Add(name);

            // TODO - this Is messy
            // Not the most efficient way but the other way was causing too many bugs
            int idx = FindFirstRecordLocBySid(ExternSheetRecord.sid);
            if (idx == -1) idx = FindFirstRecordLocBySid(SupBookRecord.sid);
            if (idx == -1) idx = FindFirstRecordLocBySid(CountryRecord.sid);
            int countNames = _definedNames.Count;
            _workbookRecordList.Add(idx + countNames, name);

        }
 public Name(NameRecord nameRecord, int index)
 {
     _nameRecord = nameRecord;
     _index = index;
 }
 /** gets the name comment record
  * @param nameRecord name record who's comment is required.
  * @return name comment record or <code>null</code> if there isn't one for the given name.
  */
     public NameCommentRecord GetNameCommentRecord(NameRecord nameRecord)
     {
         if (commentRecords.ContainsKey(nameRecord.NameText))
             return commentRecords[nameRecord.NameText];
         else
             return null;
     }
        /**Generates a NameRecord to represent a built-in region
         * @return a new NameRecord Unless the index is invalid
         */
        public NameRecord CreateBuiltInName(byte builtInName, int index)
        {
            if (index == -1 || index + 1 > short.MaxValue)
                throw new ArgumentException("Index is not valid [" + index + "]");

            NameRecord name = new NameRecord(builtInName, (short)(index));

            AddName(name);

            return name;
        }
        /** Creates new name
         * @return new name record
         */
        public NameRecord AddName(NameRecord name)
        {

            OrCreateLinkTable.AddName(name);

            return name;
        }