Examples of UnicodeString


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

    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

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

      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

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

              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

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

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

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

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

Examples of org.apache.poi.hssf.record.common.UnicodeString

                    lrec.setRow(row);
                    lrec.setXFIndex(styleIndex);
                }
                if (setValue) {
                    String str = convertCellValueToString();
                    int sstIndex = _book.getWorkbook().addSSTString(new UnicodeString(str));
                    lrec.setSSTIndex(sstIndex);
                    UnicodeString us = _book.getWorkbook().getSSTString(sstIndex);
                    _stringValue = new HSSFRichTextString();
                    _stringValue.setUnicodeString(us);
                }
                _record = lrec;
                break;
View Full Code Here

Examples of org.apache.poi.hssf.record.common.UnicodeString

        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

Examples of org.apache.poi.hssf.record.common.UnicodeString

    public void test47847() throws Exception {
       HSSFWorkbook wb = openSample("47847.xls");
       assertEquals(3, wb.getNumberOfSheets());
      
       // Find the SST record
       UnicodeString withExt = wb.getWorkbook().getSSTString(0);
       UnicodeString withoutExt = wb.getWorkbook().getSSTString(31);
      
       assertEquals("O:Alloc:Qty", withExt.getString());
       assertTrue((withExt.getOptionFlags() & 0x0004) == 0x0004);
      
       assertEquals("RT", withoutExt.getString());
       assertTrue((withoutExt.getOptionFlags() & 0x0004) == 0x0000);
      
       // Something about continues...

      
       // Write out and re-read
       wb = writeOutAndReadBack(wb);
       assertEquals(3, wb.getNumberOfSheets());
      
       // Check it's the same now
       withExt = wb.getWorkbook().getSSTString(0);
       withoutExt = wb.getWorkbook().getSSTString(31);
      
       assertEquals("O:Alloc:Qty", withExt.getString());
       assertTrue((withExt.getOptionFlags() & 0x0004) == 0x0004);
      
       assertEquals("RT", withoutExt.getString());
       assertTrue((withoutExt.getOptionFlags() & 0x0004) == 0x0000);
    }
View Full Code Here

Examples of org.apache.poi.hssf.record.common.UnicodeString

                    lrec.setRow(row);
                    lrec.setXFIndex(styleIndex);
                }
                if (setValue) {
                    String str = convertCellValueToString();
                    int sstIndex = _book.getWorkbook().addSSTString(new UnicodeString(str));
                    lrec.setSSTIndex(sstIndex);
                    UnicodeString us = _book.getWorkbook().getSSTString(sstIndex);
                    _stringValue = new HSSFRichTextString();
                    _stringValue.setUnicodeString(us);
                }
                _record = lrec;
                break;
View Full Code Here

Examples of org.apache.poi.hssf.record.common.UnicodeString

        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
TOP
Copyright © 2018 www.massapi.com. 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.