Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(sheet): empty formular bar when in array range #1532

Merged
merged 2 commits into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -519,7 +519,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 @@ -559,11 +559,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