mirror of
https://github.com/apache/poi.git
synced 2026-02-27 20:40:08 +08:00
refactor getTableStyle due to perf issues (#896)
This commit is contained in:
parent
28cd548f6b
commit
2b7f7074a0
@ -841,14 +841,15 @@ public class StylesTable extends POIXMLDocumentPart implements Styles {
|
|||||||
* @return defined style, either explicit or built-in, or null if not found
|
* @return defined style, either explicit or built-in, or null if not found
|
||||||
*
|
*
|
||||||
* @since 3.17 beta 1
|
* @since 3.17 beta 1
|
||||||
|
* @throws IllegalArgumentException if there is no explicit table style but the name is an
|
||||||
|
* unknown built-in style
|
||||||
*/
|
*/
|
||||||
public TableStyle getTableStyle(String name) {
|
public TableStyle getTableStyle(String name) {
|
||||||
if (name == null) return null;
|
if (name == null) return null;
|
||||||
try {
|
TableStyle tableStyle = getExplicitTableStyle(name);
|
||||||
return XSSFBuiltinTableStyle.valueOf(name).getStyle();
|
if (tableStyle == null)
|
||||||
} catch (IllegalArgumentException e) {
|
tableStyle = XSSFBuiltinTableStyle.valueOf(name).getStyle();
|
||||||
return getExplicitTableStyle(name);
|
return tableStyle;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user