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.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
fix: objectmatrix bug
jerry8c4486b4ec43
diff --git a/packages/base-sheets/src/Controller/ToolBarController.ts b/packages/base-sheets/src/Controller/ToolBarController.tsindex 523befe198..38b12a0bb2 100644--- a/packages/base-sheets/src/Controller/ToolBarController.ts+++ b/packages/base-sheets/src/Controller/ToolBarController.ts@@ -52,11 +52,11 @@ export class ToolBarController {const worksheet = workbook.getActiveSheet();if (worksheet) {const cellMatrix = worksheet.getCellMatrix();+ const strikeThrough = range.getStrikeThrough();const fontSize = range.getFontSize();+ const fontWeight = range.getFontWeight();const fontName = range.getFontFamily();const fontItalic = range.getFontStyle();- const fontWeight = range.getFontWeight();- const strikeThrough = range.getStrikeThrough();const underline = range.getUnderline();const horizontalAlign = range.getHorizontalAlignment();const verticalAlign = range.getVerticalAlignment();@@ -71,16 +71,19 @@ export class ToolBarController {console.log('fontWeight:', fontWeight);console.log('strikeThrough:', strikeThrough);- const fontNameItem = this._toolList.find((item) => item.name === 'font');+ const textRotateModeItem = this._toolList.find((item) => item.name === 'textRotateMode');const fontSizeItem = this._toolList.find((item) => item.name === 'fontSize');+ const fontNameItem = this._toolList.find((item) => item.name === 'font');const fontBoldItem = this._toolList.find((item) => item.name === 'bold');const fontItalicItem = this._toolList.find((item) => item.name === 'italic');const strikethroughItem = this._toolList.find((item) => item.name === 'strikethrough');const underlineItem = this._toolList.find((item) => item.name === 'underline');const horizontalAlignModeItem = this._toolList.find((item) => item.name === 'horizontalAlignMode');const verticalAlignModeItem = this._toolList.find((item) => item.name === 'verticalAlignMode');- const textRotateModeItem = this._toolList.find((item) => item.name === 'textRotateMode');+ if (strikethroughItem) {+ strikethroughItem.active = !!strikeThrough.s;+ }if (fontNameItem) {fontNameItem.children?.forEach((item) => {item.selected = fontName === item.value;@@ -97,9 +100,6 @@ export class ToolBarController {if (fontItalicItem) {fontItalicItem.active = !!fontItalic;}- if (strikethroughItem) {- strikethroughItem.active = !!strikeThrough.s;- }if (underlineItem) {underlineItem.active = !!underline.s;}@@ -108,16 +108,16 @@ export class ToolBarController {item.selected = horizontalAlign === item.value;});}- if (verticalAlignModeItem) {- verticalAlignModeItem.children?.forEach((item) => {- item.selected = verticalAlign === item.value;- });- }if (textRotateModeItem) {textRotateModeItem.children?.forEach((item) => {item.selected = rotation === item.value;});}+ if (verticalAlignModeItem) {+ verticalAlignModeItem.children?.forEach((item) => {+ item.selected = verticalAlign === item.value;+ });+ }this.resetToolBarList();}diff --git a/packages/sheets-plugin-numfmt/src/Model/Apply/SetNumfmtRangeData.ts b/packages/sheets-plugin-numfmt/src/Model/Apply/SetNumfmtRangeData.tsindex f504bba5a0..1181d2767a 100644--- a/packages/sheets-plugin-numfmt/src/Model/Apply/SetNumfmtRangeData.ts+++ b/packages/sheets-plugin-numfmt/src/Model/Apply/SetNumfmtRangeData.ts@@ -1,6 +1,6 @@import { ObjectMatrix, ObjectMatrixPrimitiveType, Workbook } from '@univer/core';-import { NUMFMT_PLUGIN_NAME } from '../../Basic/Const';import { NumfmtPlugin } from '../../NumfmtPlugin';+import { NUMFMT_PLUGIN_NAME } from '../../Basic/Const';export function SetNumfmtRangeData(workbook: Workbook, sheetId: string, numfmtPrimitiveMatrix: ObjectMatrixPrimitiveType<string>): ObjectMatrixPrimitiveType<string> {const context = workbook.getContext();