Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

fix: only change the style when have ts (#4365)

ybzky57467da8774b
diff --git a/packages/sheets-ui/src/services/clipboard/html-to-usm/utils.ts b/packages/sheets-ui/src/services/clipboard/html-to-usm/utils.ts
index 3bb5ba9723..16d1a9957d 100644
--- a/packages/sheets-ui/src/services/clipboard/html-to-usm/utils.ts
+++ b/packages/sheets-ui/src/services/clipboard/html-to-usm/utils.ts
@@ -99,7 +99,7 @@ export function generateParagraphs(dataStream: string, prevParagraph?: IParagrap
export function convertToCellStyle(cell: ICellDataWithSpanInfo, dataStream: string, textRuns: ITextRun[] | undefined) {
const dataStreamLength = dataStream.length;
const textRunsLength = textRuns?.length ?? 0;
- const canConvertToCellStyle = !textRunsLength || (textRunsLength === 1 && textRuns![0].st === 0 && textRuns![0].ed === dataStreamLength);
+ const canConvertToCellStyle = textRunsLength === 1 && textRuns![0].st === 0 && textRuns![0].ed === dataStreamLength;
if (cell.p) {
if (canConvertToCellStyle && cell.p.body?.textRuns?.length) {