Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export class HeaderSizeUIPlugin extends CoreViewPlugin<HeaderSizeState> implemen
}
break;
case "SET_FORMATTING":
if (cmd.style && ("fontSize" in cmd.style || "wrapping" in cmd.style)) {
if ("style" in cmd && (!cmd.style || "fontSize" in cmd.style || "wrapping" in cmd.style)) {
for (const zone of cmd.target) {
// TODO FLDA use rangeSet
this.updateRowSizeForZoneChange(cmd.sheetId, zone);
Expand Down
5 changes: 1 addition & 4 deletions src/clipboard_handlers/cell_clipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ export class CellClipboardHandler extends AbstractCellClipboardHandler<
tokens: cell?.isFormula
? cell.compiledFormula.tokens.map(({ value, type }) => ({ value, type }))
: [],
border: this.getters.getCellBorder(position) || undefined,
evaluatedCell,
position,
});
Expand Down Expand Up @@ -249,7 +248,6 @@ export class CellClipboardHandler extends AbstractCellClipboardHandler<
if (clipboardOption?.pasteOption === "onlyFormat") {
this.dispatch("UPDATE_CELL", {
...target,
style: origin?.style ?? null,
format: originFormat ?? targetCell.format,
});
return;
Expand All @@ -270,11 +268,10 @@ export class CellClipboardHandler extends AbstractCellClipboardHandler<
origin.tokens
);
}
if (content !== "" || origin?.format || origin?.style) {
if (content !== "" || origin?.format) {
this.dispatch("UPDATE_CELL", {
...target,
content,
style: origin?.style || null,
format: origin?.format,
});
} else if (targetCell) {
Expand Down
4 changes: 2 additions & 2 deletions src/clipboard_handlers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ clipboardHandlersRegistries.cellHandlers
.add("cell", CellClipboardHandler)
.add("sheet", SheetClipboardHandler)
.add("merge", MergeClipboardHandler)
.add("style", StyleClipboardHandler)
.add("table", TableClipboardHandler)
.add("conditionalFormat", ConditionalFormatClipboardHandler)
.add("references", ReferenceClipboardHandler)
.add("border", BorderClipboardHandler)
.add("style", StyleClipboardHandler);
.add("border", BorderClipboardHandler);
2 changes: 2 additions & 0 deletions src/clipboard_handlers/style_clipboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ export class StyleClipboardHandler extends AbstractCellClipboardHandler<
}
const zones = target.zones;
if (!options.isCutOperation) {
this.dispatch("SET_FORMATTING", { sheetId, target: zones, style: undefined });
for (const zone of zones) {
for (const pasteZone of splitZoneForPaste(zone, content.width, content.height)) {
this.pasteStyleZone(sheetId, pasteZone.left, pasteZone.top, content.styles);
}
}
} else {
const { left, top } = zones[0];
this.dispatch("SET_FORMATTING", { sheetId, target: [zones[0]], style: undefined });
this.pasteStyleZone(sheetId, left, top, content.styles);
}
}
Expand Down