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.

Merge remote-tracking branch 'origin/dev' into dev

jerrybedbb702403f
diff --cc packages/base-sheets/src/Controller/ToolBarController.ts
index 212f1d3aff,219d9a846f..dff4bde162
--- a/packages/base-sheets/src/Controller/ToolBarController.ts
+++ b/packages/base-sheets/src/Controller/ToolBarController.ts
@@@ -492,41 -444,40 +492,41 @@@ export class ToolBarController
// Monitor selection changes, update toolbar button status and values TODO: 根据不同的焦点对象,接受
this._plugin.getObserver('onChangeSelectionObserver')?.add((selectionControl: SelectionControl) => {
- const currentCell = selectionControl.model.currentCell;
-
- if (currentCell) {
- let currentRangeData;
-
- if (currentCell.isMerged) {
- const mergeInfo = currentCell.mergeInfo;
-
- currentRangeData = {
- startRow: mergeInfo.startRow,
- endRow: mergeInfo.endRow,
- startColumn: mergeInfo.startColumn,
- endColumn: mergeInfo.endColumn,
- };
- } else {
- const { row, column } = currentCell;
- currentRangeData = {
- startRow: row,
- endRow: row,
- startColumn: column,
- endColumn: column,
- };
- }
-
- const cellData = this._plugin.getWorkbook().getActiveSheet().getRange(currentRangeData).getObjectValue({ isIncludeStyle: true });
+ // const currentCell = selectionControl.model.currentCell;
+ //
+ // if (currentCell) {
+ // let currentRangeData;
+ //
+ // if (currentCell.isMerged) {
+ // const mergeInfo = currentCell.mergeInfo;
+ //
+ // currentRangeData = {
+ // startRow: mergeInfo.startRow,
+ // endRow: mergeInfo.endRow,
+ // startColumn: mergeInfo.startColumn,
+ // endColumn: mergeInfo.endColumn,
+ // };
+ // } else {
+ // const { row, column } = currentCell;
+ // currentRangeData = {
+ // startRow: row,
+ // endRow: row,
+ // startColumn: column,
+ // endColumn: column,
+ // };
+ // }
+ //
+ // const cellData = this._plugin.getWorkbook().getActiveSheet().getRange(currentRangeData).getObjectValue({ isIncludeStyle: true });
+ // }
+ const manager = this._plugin.getSelectionManager();
+ const range = manager?.getCurrentCell();
+ if (range) {
+ this._changeToolBarState(range);
}
});
-
- this._plugin.context.getContextObserver('onSheetRenderDidMountObservable').add(() => {
- this._initSelectedObserver();
- });
}
- initRegisterComponent() {
+ private _initRegisterComponent() {
const pluginName = this._plugin.getPluginName();
// 注册自定义组件