Exemplo n.º 1
0
        /// <summary>
        /// Creates the low-level records for a comment.
        /// </summary>
        /// <param name="hssfShape">The highlevel shape.</param>
        /// <param name="shapeId">The shape id to use for this shape.</param>
        public CommentShape(HSSFComment hssfShape, int shapeId)
            : base(hssfShape, shapeId)
        {


            note = CreateNoteRecord(hssfShape, shapeId);

            ObjRecord obj = ObjRecord;
            List<SubRecord> records = obj.SubRecords;
            int cmoIdx = 0;
            for (int i = 0; i < records.Count; i++)
            {
                Object r = records[i];

                if (r is CommonObjectDataSubRecord)
                {
                    //modify autoFill attribute inherited from <c>TextObjectRecord</c>
                    CommonObjectDataSubRecord cmo = (CommonObjectDataSubRecord)r;
                    cmo.IsAutoFill=(false);
                    cmoIdx = i;
                }
            }
            //Add NoteStructure sub record
            //we don't know it's format, for now the record data Is empty
            NoteStructureSubRecord u = new NoteStructureSubRecord();
            obj.AddSubRecord(cmoIdx + 1, u);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Creates the low level NoteRecord
 /// which holds the comment attributes.
 /// </summary>
 /// <param name="shape">The shape.</param>
 /// <param name="shapeId">The shape id.</param>
 /// <returns></returns>
 private NoteRecord CreateNoteRecord(HSSFComment shape, int shapeId)
 {
     NoteRecord note = new NoteRecord();
     note.Column = shape.Column;
     note.Row = shape.Row;
     note.Flags = (shape.Visible ? NoteRecord.NOTE_VISIBLE : NoteRecord.NOTE_HIDDEN);
     note.ShapeId = shapeId;
     note.Author = (shape.Author == null ? "" : shape.Author);
     return note;
 }
Exemplo n.º 3
0
 /**
  * Constructs a cell comment.
  *
  * @param anchor    the client anchor describes how this comment is attached
  *                  to the sheet.
  * @return      the newly created comment.
  */
 public HSSFComment CreateComment(HSSFAnchor anchor)
 {
     HSSFComment shape = new HSSFComment(null, anchor);
     shape.Anchor = anchor;
     AddShape(shape);
     return shape;
 }