@Override protected RichTextString createRichTextString(String value) { return new XSSFRichTextString(value); }
@Override protected RichTextString createRichTextString(String str) { return new XSSFRichTextString(str); }
/** * Return a string item by index * * @param idx index of item to return. * @return the item at the specified position in this Shared String table. */ @Override public RichTextString getItemAt(int idx) { return new XSSFRichTextString(strings.get(idx)); }
/** * Provide access to the strings in the SharedStringsTable * * @return list of shared string instances */ public List<RichTextString> getSharedStringItems() { ArrayList<RichTextString> items = new ArrayList<>(); for (CTRst rst : strings) { items.add(new XSSFRichTextString(rst)); } return Collections.unmodifiableList(items); }
@Override public XSSFRichTextString createRichTextString(String text) { logger.log(POILogger.INFO, "SXSSF doesn't support Rich Text Strings, any formatting information will be lost"); return new XSSFRichTextString(text); }
/** * Set a string value for the cell. * * @param str value to set the cell to. For formulas we'll set the formula * cached string result, for String cells we'll set its value. For other types we will * change the cell to a string cell and set its value. * If value is null then we will change the cell to a Blank cell. */ @Override public void setCellValue(String str) { setCellValue(str == null ? null : new XSSFRichTextString(str)); }
@Override public RichTextString getItemAt(int idx) { return new XSSFRichTextString(getEntryAt(idx)); }
@Override public RichTextString getItemAt(int idx) { return new XSSFRichTextString(getEntryAt(idx)); }
public void setString(String string) { setString(new XSSFRichTextString(string)); }
private void endCellValue(String name) throws SAXException { // ensure size if (curCol >= curRowContent.length) { curRowContent = Arrays.copyOf(curRowContent, (int)(curCol * 1.5)); } if (CELL_VALUE_TAG.equals(name)) { switch (currentCellType) { case STRING: int idx = Integer.parseInt(currentCellValue); currentCellValue = new XSSFRichTextString(sst.getEntryAt(idx)).toString(); currentCellType = FieldType.EMPTY; break; } curRowContent[curCol] = currentCellValue; } else if (CELL_VALUE_TAG_1.equals(name)) { curRowContent[curCol] = currentCellValue; } }
/** * Creates a new XSSFRichTextString for you. */ @Override public XSSFRichTextString createRichTextString(String text) { XSSFRichTextString rt = new XSSFRichTextString(text); rt.setStylesTableReference(workbook.getStylesSource()); return rt; }
/** * @return the rich text string of the comment */ @Override public XSSFRichTextString getString() { if(_str == null) { CTRst rst = _comment.getText(); if(rst != null) _str = new XSSFRichTextString(_comment.getText()); } return _str; }
if ( event == XMLStreamConstants.START_ELEMENT && sheetReader.getLocalName().equals( "v" ) ) { int idx = Integer.parseInt( sheetReader.getElementText() ); String content = new XSSFRichTextString( sst.getEntryAt( idx ) ).toString(); headerRow.add( content ); break; event = sheetReader.next(); if ( event == XMLStreamConstants.CHARACTERS ) { String content = new XSSFRichTextString( sheetReader.getText() ).toString(); headerRow.add( content ); break;
/** * Returns the title static text, or null if none is set. Note that a title * formula may be set instead. Empty text result is for backward * compatibility, and could mean the title text is empty or there is a * formula instead. Check for a formula first, falling back on text for * cleaner logic. * * @return static title text if set, null if there is no title, empty string * if the title text is empty or the title uses a formula instead */ public XSSFRichTextString getTitleText() { if (!chart.isSetTitle()) { return null; } // TODO Do properly CTTitle title = chart.getTitle(); StringBuilder text = new StringBuilder(64); XmlObject[] t = title.selectPath("declare namespace a='" + XSSFDrawing.NAMESPACE_A + "' .//a:t"); for (XmlObject element : t) { NodeList kids = element.getDomNode().getChildNodes(); final int count = kids.getLength(); for (int n = 0; n < count; n++) { Node kid = kids.item(n); if (kid instanceof Text) { text.append(kid.getNodeValue()); } } } return new XSSFRichTextString(text.toString()); }
content = new XSSFRichTextString( sst.getEntryAt( idx ) ).toString(); } else { content = sheetReader.getElementText(); event = sheetReader.next(); if ( event == XMLStreamConstants.CHARACTERS ) { content = new XSSFRichTextString( sheetReader.getText() ).toString(); break;
break; case INLINESTR: result = new XSSFRichTextString(value.toString()).toString(); break; case SSTINDEX: try { final int index = Integer.parseInt(value); result = new XSSFRichTextString(sharedStringsTable.getEntryAt(index)).getString(); } catch (NumberFormatException e) { result = value;
break; case INLINESTR: result = new XSSFRichTextString(value.toString()).toString(); break; case SSTINDEX: try { final int index = Integer.parseInt(value); result = new XSSFRichTextString(sharedStringsTable.getEntryAt(index)).getString(); } catch (NumberFormatException e) { result = value;
switch (cellType) { case BLANK: rt = new XSSFRichTextString(""); break; case STRING: if(_cell.isSetIs()) { rt = new XSSFRichTextString(_cell.getIs()); } else if (_cell.isSetV()) { rt = new XSSFRichTextString(_cell.getV()); } else { rt = new XSSFRichTextString(""); rt = new XSSFRichTextString(_cell.isSetV() ? _cell.getV() : ""); } else { if (_cell.isSetV()) { int idx = Integer.parseInt(_cell.getV()); rt = new XSSFRichTextString(_sharedStringSource.getEntryAt(idx)); rt = new XSSFRichTextString(""); case FORMULA: checkFormulaCachedValueType(CellType.STRING, getBaseCellType(false)); rt = new XSSFRichTextString(_cell.isSetV() ? _cell.getV() : ""); break; default:
case STRING: int sstIndex = Integer.parseInt(_cell.getV()); XSSFRichTextString rt = new XSSFRichTextString(_sharedStringSource.getEntryAt(sstIndex)); String text = rt.getString(); return Boolean.parseBoolean(text);
case STRING: int sstIndex = Integer.parseInt(_cell.getV()); XSSFRichTextString rt = new XSSFRichTextString(_sharedStringSource.getEntryAt(sstIndex)); return rt.getString(); case NUMERIC: