Browse Source

Pull request #12255: REPORT-98450 批量修改单元格格式会影响单元格样式

Merge in DESIGN/design from ~LEO.QIN/design:release/11.0 to release/11.0

* commit '245d66c6cbad8e32bb9d908e7ce087f388ff9393':
  REPORT-98450 批量修改单元格格式会影响单元格样式 【问题原因】实际修改时,未考虑到style是包含字体、背景等其他样式,代码中将整个style样式替换为了左上角单元格的样式 【改动思路】批量操作时,仅修改格式样式
newui
Leo.Qin-覃宇攀 1 year ago
parent
commit
b3c5c30106
  1. 6
      designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java

6
designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java

@ -446,12 +446,14 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
Style oldStyle = cellElement == null ? Style.DEFAULT_STYLE : cellElement.getStyle(); Style oldStyle = cellElement == null ? Style.DEFAULT_STYLE : cellElement.getStyle();
Style style = formatPane.update(oldStyle); Style style = formatPane.update(oldStyle);
for (TemplateCellElement cellElement : allCellElements) { for (TemplateCellElement cellElement : allCellElements) {
Format elementFormat = cellElement.getStyle().getFormat(); Style cellElementStyle = cellElement.getStyle();
Format elementFormat = cellElementStyle.getFormat();
Format paneFormat = style.getFormat(); Format paneFormat = style.getFormat();
if (!Objects.equals(paneFormat, elementFormat)) { if (!Objects.equals(paneFormat, elementFormat)) {
// 点击单元格,但未设置格式时,不将单元格设置为编辑状态,防止将所选的每个单元格都设置为编辑状态 // 点击单元格,但未设置格式时,不将单元格设置为编辑状态,防止将所选的每个单元格都设置为编辑状态
editingElementCase.addCellElement(cellElement); editingElementCase.addCellElement(cellElement);
cellElement.setStyle(style); Style newStyle = cellElementStyle.deriveFormat(paneFormat);
cellElement.setStyle(newStyle);
updateStyle = true; updateStyle = true;
} }
} }

Loading…
Cancel
Save