Package org.apache.poi.hssf.record

Examples of org.apache.poi.hssf.record.UnicodeString$FormatRun


        if (_cellType != CELL_TYPE_STRING) {
            setCellType(CELL_TYPE_STRING, false, row, col, styleIndex);
        }
        int index = 0;

        UnicodeString str = hvalue.getUnicodeString();
        index = _book.getWorkbook().addSSTString(str);
        (( LabelSSTRecord ) _record).setSSTIndex(index);
        _stringValue = hvalue;
        _stringValue.setWorkbookReferences(_book.getWorkbook(), (( LabelSSTRecord ) _record));
        _stringValue.setUnicodeString(_book.getWorkbook().getSSTString(index));
View Full Code Here


    public HSSFRichTextString( String string )
    {
        if (string == null)
          string = "";
        this.string = new UnicodeString(string);
    }
View Full Code Here

     *  be affected by changes that we make to this string.
     */
    private UnicodeString cloneStringIfRequired() {
      if (book == null)
        return string;
      UnicodeString s = (UnicodeString)string.clone();
      return s;
    }
View Full Code Here

                 LabelRecord oldrec = ( LabelRecord ) rec;

                 records.remove(k);
                 LabelSSTRecord newrec   = new LabelSSTRecord();
                 int            stringid =
                     workbook.addSSTString(new UnicodeString(oldrec.getValue()));

                 newrec.setRow(oldrec.getRow());
                 newrec.setColumn(oldrec.getColumn());
                 newrec.setXFIndex(oldrec.getXFIndex());
                 newrec.setSSTIndex(stringid);
View Full Code Here

    /** @deprecated Do not call this method from your applications. Use the methods
     *  available in the HSSFRow to add string HSSFCells
     */
    public int addSSTString(String string)
    {
        return workbook.addSSTString(new UnicodeString(string));
    }
View Full Code Here

                addTextCell(record, label.getValue());
                break;

            case LabelSSTRecord.sid: // Ref. a string in the shared string table
                LabelSSTRecord sst = (LabelSSTRecord) record;
                UnicodeString unicode = sstRecord.getString(sst.getSSTIndex());
                addTextCell(record, unicode.getString());
                break;

            case NumberRecord.sid: // Contains a numeric cell value
                NumberRecord number = (NumberRecord) record;
                addCell(record, new NumberCell(number.getValue(), format));
View Full Code Here

    Class cls = object.getClass();
   
    if(cls == Boolean.class || cls == Double.class || cls == ErrorConstant.class) {
      return 8;
    }
    UnicodeString strVal = (UnicodeString)object;
    UnicodeRecordStats urs = new UnicodeRecordStats();
    strVal.getRecordSize(urs);
    return urs.recordSize;
  }
View Full Code Here

      LittleEndian.putByte(data, offset, TYPE_NUMBER);
      LittleEndian.putDouble(data, offset+1, dVal.doubleValue());
      return 9;
    }
    if (value instanceof UnicodeString) {
      UnicodeString usVal = (UnicodeString) value;
      LittleEndian.putByte(data, offset, TYPE_STRING);
      UnicodeRecordStats urs = new UnicodeRecordStats();
      usVal.serialize(urs, offset +1, data);
      return 1 + urs.recordSize;
    }
    if (value instanceof ErrorConstant) {
      ErrorConstant ecVal = (ErrorConstant) value;
      LittleEndian.putByte(data, offset, TYPE_ERROR_CODE);
View Full Code Here

              LittleEndian.putDouble(array, pos+offset, ((Double)o).doubleValue());
              pos+=8;
            } else if (o instanceof UnicodeString) {
              array[pos+offset] = 0x02;
              pos++;             
              UnicodeString s = (UnicodeString)o;
              //JMH TBD Handle string continuation. Id do it now but its 4am.
                  UnicodeString.UnicodeRecordStats stats = new UnicodeString.UnicodeRecordStats();
                  s.serialize(stats, pos + offset, array);
                  pos += stats.recordSize;
            } else throw new RuntimeException("Coding error");
          }
        }
        return pos;
View Full Code Here

    public HSSFRichTextString( String string )
    {
        if (string == null)
          string = "";
        this.string = new UnicodeString(string);
    }
View Full Code Here

TOP

Related Classes of org.apache.poi.hssf.record.UnicodeString$FormatRun

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.