Skip to content

Commit

Permalink
feat(sheet): empty formular bar when in array range (#1532)
Browse files Browse the repository at this point in the history
* feat: empty formular bar when in array range

* refactor: remove unused codes
  • Loading branch information
Jocs authored Mar 9, 2024
1 parent 0da7b64 commit eea95ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ export class FormulaEditorController extends RxDisposable {
@IUniverInstanceService private readonly _univerInstanceService: IUniverInstanceService,
@IRenderManagerService private readonly _renderManagerService: IRenderManagerService,
@IEditorBridgeService private readonly _editorBridgeService: IEditorBridgeService,
@Inject(DocSkeletonManagerService) private readonly _docSkeletonManagerService: DocSkeletonManagerService,
@Inject(DocViewModelManagerService) private readonly _docViewModelManagerService: DocViewModelManagerService,
@ICommandService private readonly _commandService: ICommandService,
@IContextService private readonly _contextService: IContextService,
@IFormulaEditorManagerService private readonly _formulaEditorManagerService: IFormulaEditorManagerService,
@IUndoRedoService private readonly _undoRedoService: IUndoRedoService,
@Inject(DocSkeletonManagerService) private readonly _docSkeletonManagerService: DocSkeletonManagerService,
@Inject(DocViewModelManagerService) private readonly _docViewModelManagerService: DocViewModelManagerService,
@Inject(TextSelectionManagerService) private readonly _textSelectionManagerService: TextSelectionManagerService
) {
super();
Expand Down Expand Up @@ -207,7 +207,7 @@ export class FormulaEditorController extends RxDisposable {
if (visibleState.visible === false) {
this._editorBridgeService.changeVisible({
visible: true,
eventType: DeviceInputEventType.PointerDown,
eventType: DeviceInputEventType.Dblclick,
});
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ export class StartEditController extends Disposable {
return;
}

this._resetBodyStyle(snapshot.body!);
this._resetBodyStyle(snapshot.body!, !!isInArrayFormulaRange);

documentDataModel.reset(snapshot);
documentViewModel.reset(documentDataModel);
Expand Down Expand Up @@ -563,11 +563,11 @@ export class StartEditController extends Disposable {
);
}

private _resetBodyStyle(body: IDocumentBody) {
private _resetBodyStyle(body: IDocumentBody, removeStyle = false) {
body.dataStream = DEFAULT_EMPTY_DOCUMENT_VALUE;

if (body.textRuns != null) {
if (body.textRuns.length === 1) {
if (body.textRuns.length === 1 && !removeStyle) {
body.textRuns[0].st = 0;
body.textRuns[0].ed = 1;
} else {
Expand Down

0 comments on commit eea95ac

Please sign in to comment.