//width, height id
if (updateSize) {
if (cell != null) {
//process overflow when cell type is string, halign is left, no wrap, no merge
CellStyle cellStyle = cell.getCellStyle();
if (cell.getCellType() == Cell.CELL_TYPE_STRING &&
mergeIndex == null && !cellStyle.getWrapText() &&
BookHelper.getRealAlignment(cell) == CellStyle.ALIGN_LEFT) {
attrs.put("ovf", 1); //1 stand for true
int c = getMaxOverflowableCellIndex(cell, sheet.getRow(row));
if (c != col) {
attrs.put("moc", c);
}
}
}
}
//style attr
if (updateStyle) {
CellFormatHelper cfh = new CellFormatHelper(sheet, row, col, getMergeMatrixHelper(sheet));
String style = cfh.getHtmlStyle();
if (!Strings.isEmpty(style)) {
int idx = styleAggregation.add(style);
attrs.put("s", idx);
}
String innerStyle = cfh.getInnerHtmlStyle();
if (!Strings.isEmpty(innerStyle)) {
int idx = styleAggregation.add(innerStyle);
attrs.put("is", idx);
}
if (cfh.hasRightBorder()) {
attrs.put("rb", 1);
}
}
if (cell != null) {
int cellType = cell.getCellType();
if (cellType != Cell.CELL_TYPE_BLANK)
attrs.put("ct", cellType);
if (updateText) {
if (cellType != Cell.CELL_TYPE_BLANK) {
final String cellText = getCelltext(sheet, row, col);
final String editText = getEdittext(sheet, row, col);
final String formatText = getCellFormatText(sheet, row, col);
if (Objects.equals(cellText, editText) && Objects.equals(editText, formatText)) {
attrs.put("meft", textAggregation.add(cellText));
} else {
attrs.put("t", textAggregation.add(cellText));
attrs.put("et", textAggregation.add(editText));
attrs.put("ft", textAggregation.add(formatText));
}
}
}
if (updateStyle) {
CellStyle cellStyle = cell.getCellStyle();
boolean locked = cellStyle.getLocked();
if (!locked)
attrs.put("l", "f"); //f stand for "false"
boolean wrap = cellStyle.getWrapText();
if (wrap)
attrs.put("wp", 1);
int horizontalAlignment = BookHelper.getRealAlignment(cell);
switch(horizontalAlignment) {
case CellStyle.ALIGN_CENTER:
case CellStyle.ALIGN_CENTER_SELECTION:
attrs.put("ha", "c");
break;
case CellStyle.ALIGN_RIGHT:
attrs.put("ha", "r");
break;
}
int verticalAlignment = cellStyle.getVerticalAlignment();
switch(verticalAlignment) {
case CellStyle.VERTICAL_TOP:
attrs.put("va", "t");
break;
case CellStyle.VERTICAL_CENTER:
attrs.put("va", "c");
break;
//case CellStyle.VERTICAL_BOTTOM: //default
// break;
}
Font font = _book.getFontAt(cellStyle.getFontIndex());
short fontHeight = font.getFontHeightInPoints();
if (fontHeight != XSSFFont.DEFAULT_FONT_SIZE) {
attrs.put("fs", fontHeight);
}
}