Browse Source

REPORT-59440 【主题切换】合并单元格以后,单元格样式都变成了自定义

【问题原因】
合并时新建单元格需要在设计器模块中处理,已获取当前正在编辑模版的主题数据来设置样式

【改动思路】
同标题
fix-lag
Starryi 3 years ago
parent
commit
a1a07dddbc
  1. 23
      designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

23
designer-realize/src/main/java/com/fr/grid/selection/CellSelection.java

@ -383,8 +383,27 @@ public class CellSelection extends Selection {
return false;
}
}
ec.merge(row, row + rowSpan - 1, column, column + columnSpan - 1);
int rowStartIndex = row;
int rowEndIndex = row + rowSpan - 1;
int columnStartIndex = column;
int columnEndIndex = column + columnSpan - 1;
// 合并已有单元格,还是新建单元格
boolean hasCellElement = false;
for (int ri = rowStartIndex; ri <= rowEndIndex; ri++) {
for (int ci = columnStartIndex; ci <= columnEndIndex; ci++) {
CellElement ce = ec.getCellElement(ci, ri);
if (ce != null) {
hasCellElement = true;
break;
}
}
}
if (hasCellElement) {
ec.merge(row, row + rowSpan - 1, column, column + columnSpan - 1);
} else {
ec.addCellElement(DefaultThemedTemplateCellElementCase.createInstance(column, row, columnSpan, rowSpan, null), true);
}
return true;
}

Loading…
Cancel
Save