WorkBook 在创建 Sheet 时,会使用如下代码判断 该 name 是否已存在.
public boolean doesContainsSheetName(String name, int excludeSheetIdx) {
String aName = name;
if(name.length() > 31) {
aName = name.substring(0, 31);
}
for(int i = 0; i < this.boundsheets.size(); ++i) {
BoundSheetRecord boundSheetRecord = this.getBoundSheetRec(i);
if(excludeSheetIdx != i) {
String bName = boundSheetRecord.getSheetname();
if(bName.length() > 31) {
bName = bName.substring(0, 31);
}
if(aName.equalsIgnoreCase(bName)) {
return true;
}
}
}
return false;
}