public Vector hasMordMerge(HSSFSheet sheet,
CellRangeAddress cellRangeAddress) {
int mergedNum = sheet.getNumMergedRegions();
CellRangeAddress range = null;
Vector vector = new Vector();
//第几列
int level = cellRangeAddress.getFirstColumn();
// 查找是否还有合并
for (int inner = 0; inner < mergedNum; inner++) {
range = sheet.getMergedRegion(inner);
if (range.getFirstRow() >= cellRangeAddress.getFirstRow()
&& range.getLastRow() <= cellRangeAddress.getLastRow()
&& range.getFirstColumn() == level + 1
&& range.getLastColumn() == level + 1) {// 下一层级存在该level的合并区
vector.add(range);
}
}
return vector;
}
Nothon
最新推荐文章于 2024-08-23 19:32:58 发布