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: inline format error in cell (#1843)

Ran Luo2002fdfb1a52
diff --git a/packages/engine-render/src/components/sheets/sheet-skeleton.ts b/packages/engine-render/src/components/sheets/sheet-skeleton.ts
index 7a04e88149..86a2ccb702 100644
--- a/packages/engine-render/src/components/sheets/sheet-skeleton.ts
+++ b/packages/engine-render/src/components/sheets/sheet-skeleton.ts
@@ -1759,6 +1759,13 @@ export class SpreadsheetSkeleton extends Skeleton {
if (!documentData.documentStyle) {
documentData.documentStyle = {};
}
+
+ // Fix https://github.com/dream-num/univer/issues/1586
+ documentData.documentStyle.pageSize = {
+ width: Number.POSITIVE_INFINITY,
+ height: Number.POSITIVE_INFINITY,
+ };
+
documentData.documentStyle.renderConfig = renderConfig;
const paragraphs = documentData.body.paragraphs || [];
diff --git a/packages/sheets/src/commands/mutations/set-range-values.mutation.ts b/packages/sheets/src/commands/mutations/set-range-values.mutation.ts
index 87ea0437ff..45572d1a4d 100644
--- a/packages/sheets/src/commands/mutations/set-range-values.mutation.ts
+++ b/packages/sheets/src/commands/mutations/set-range-values.mutation.ts
@@ -31,7 +31,7 @@ import type {
ITextStyle,
Nullable,
} from '@univerjs/core';
-import { CellValueType, CommandType, IUniverInstanceService, ObjectMatrix, Tools } from '@univerjs/core';
+import { CellValueType, CommandType, IUniverInstanceService, normalizeTextRuns, ObjectMatrix, Tools } from '@univerjs/core';
import type { IAccessor } from '@wendellhu/redi';
/** Params of `SetRangeValuesMutation` */
@@ -148,7 +148,9 @@ function setNull(value: Nullable<ICellData>) {
*/
export const SetRangeValuesMutation: IMutation<ISetRangeValuesMutationParams, boolean> = {
id: 'sheet.mutation.set-range-values',
+
type: CommandType.MUTATION,
+
handler: (accessor, params) => {
const { cellValue, subUnitId, unitId } = params;
const univerInstanceService = accessor.get(IUniverInstanceService);
@@ -523,7 +525,7 @@ export function mergeRichTextStyle(p: IDocumentData, newStyle: Nullable<IStyleDa
newTextRuns.push(tr);
}
- p.body.textRuns = newTextRuns;
+ p.body.textRuns = normalizeTextRuns(newTextRuns);
}
function isNumeric(str: string) {