pjfanning commented on code in PR #682: URL: https://github.com/apache/poi/pull/682#discussion_r1733276730
########## poi/src/main/java/org/apache/poi/ss/util/CellUtil.java: ########## @@ -381,31 +498,64 @@ public static void setFont(Cell cell, Font font) { * </p> * * @param cell The cell to change the style of - * @param properties The properties to be added to a cell style, as {propertyName: propertyValue}. + * @param properties The properties to be added to a cell style, as {property: propertyValue}. * @since POI 3.14 beta 2 + * @deprecated See {@link #setCellStylePropertiesEnum(Cell, Map)} */ + @Deprecated public static void setCellStyleProperties(Cell cell, Map<String, Object> properties) { + Map<CellPropertyType, Object> strPropMap = new HashMap<>(properties.size()); + properties.forEach((k, v) -> strPropMap.put(namePropertyMap.get(k), v)); + setCellStyleProperties(cell, strPropMap, false); + } + + /** + * <p>This method attempts to find an existing CellStyle that matches the {@code cell}'s + * current style plus styles properties in {@code properties}. A new style is created if the + * workbook does not contain a matching style.</p> + * + * <p>Modifies the cell style of {@code cell} without affecting other cells that use the + * same style.</p> + * + * <p>This is necessary because Excel has an upper limit on the number of styles that it supports.</p> + * + * <p>This function is more efficient than multiple calls to + * {@link #setCellStyleProperty(Cell, CellPropertyType, Object)} + * if adding multiple cell styles.</p> + * + * <p>For performance reasons, if this is the only cell in a workbook that uses a cell style, + * this method does NOT remove the old style from the workbook. + * <!-- NOT IMPLEMENTED: Unused styles should be + * pruned from the workbook with [@link #removeUnusedCellStyles(Workbook)] or + * [@link #removeStyleFromWorkbookIfUnused(CellStyle, Workbook)]. --> + * </p> + * + * @param cell The cell to change the style of + * @param properties The properties to be added to a cell style, as {property: propertyValue}. + * @since POI 3.14 beta 2 Review Comment: should be since POI 5.3.1 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org For additional commands, e-mail: dev-h...@poi.apache.org