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: revert set text style (#4544)

Ran Luo266dadcd4565
diff --git a/packages/docs-ui/src/basics/paragraph.ts b/packages/docs-ui/src/basics/paragraph.ts
index dac5783c0e..9ce46f599d 100644
--- a/packages/docs-ui/src/basics/paragraph.ts
+++ b/packages/docs-ui/src/basics/paragraph.ts
@@ -24,13 +24,12 @@ export function getTextRunAtPosition(
textRuns: ITextRun[],
position: number,
defaultStyle: ITextStyle,
- cacheStyle: Nullable<ITextStyle>,
- isCellEditor?: boolean
+ cacheStyle: Nullable<ITextStyle>
): ITextRun {
const retTextRun: ITextRun = {
st: 0,
ed: 0,
- ts: isCellEditor ? {} : defaultStyle,
+ ts: defaultStyle,
};
for (let i = textRuns.length - 1; i >= 0; i--) {
diff --git a/packages/docs-ui/src/controllers/render-controllers/doc-input.controller.ts b/packages/docs-ui/src/controllers/render-controllers/doc-input.controller.ts
index e818e0231d..fcd1c0ec65 100644
--- a/packages/docs-ui/src/controllers/render-controllers/doc-input.controller.ts
+++ b/packages/docs-ui/src/controllers/render-controllers/doc-input.controller.ts
@@ -77,7 +77,7 @@ export class DocInputController extends Disposable implements IRenderModule {
const defaultTextStyle = this._docMenuStyleService.getDefaultStyle();
const cacheStyle = this._docMenuStyleService.getStyleCache();
const curCustomRange = getCustomRangeAtPosition(originBody?.customRanges ?? [], activeRange.endOffset, SHEET_EDITOR_UNITS.includes(unitId));
- const curTextRun = getTextRunAtPosition(originBody?.textRuns ?? [], activeRange.endOffset, defaultTextStyle, cacheStyle, SHEET_EDITOR_UNITS.includes(unitId));
+ const curTextRun = getTextRunAtPosition(originBody?.textRuns ?? [], activeRange.endOffset, defaultTextStyle, cacheStyle);
const curCustomDecorations = getCustomDecorationAtPosition(originBody?.customDecorations ?? [], activeRange.endOffset);
await this._commandService.executeCommand(InsertCommand.id, {