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(base-sheets): copy/paste

tonytonychopper1239e2acfc2ab22
diff --git a/packages/base-sheets/src/Controller/Selection/DragLineController.ts b/packages/base-sheets/src/Controller/Selection/DragLineController.ts
index f003e2d623..8a3436c038 100644
--- a/packages/base-sheets/src/Controller/Selection/DragLineController.ts
+++ b/packages/base-sheets/src/Controller/Selection/DragLineController.ts
@@ -10,7 +10,7 @@ enum DRAG_LINE_KEY {
const DEFAULT_DRAG_LINE_CONFIG = {
strokeColor: 'rgb(1,136,251)',
- strokeWidth: 2,
+ strokeWidth: 1,
fillStrokeWidth: 5,
};
@@ -79,8 +79,8 @@ export class DragLineController {
this._dragLineControlContent = new Rect(DRAG_LINE_KEY.lineContent, {
width: contentWidth,
- height: 2,
- top: this._end - 2,
+ height: 1,
+ top: this._end - 1,
left: width,
fill: DEFAULT_DRAG_LINE_CONFIG.strokeColor,
});
@@ -98,7 +98,7 @@ export class DragLineController {
width: DEFAULT_DRAG_LINE_CONFIG.strokeWidth,
height: contentHeight,
top: height,
- left: this._end - 2,
+ left: this._end - 1,
fill: DEFAULT_DRAG_LINE_CONFIG.strokeColor,
});
}
diff --git a/packages/base-sheets/src/Controller/ToolBarController.ts b/packages/base-sheets/src/Controller/ToolBarController.ts
index 78929e7cb5..4006765089 100644
--- a/packages/base-sheets/src/Controller/ToolBarController.ts
+++ b/packages/base-sheets/src/Controller/ToolBarController.ts
@@ -82,7 +82,7 @@ export class ToolBarController {
const verticalAlignModeItem = this._toolList.find((item) => item.name === 'verticalAlignMode');
if (strikethroughItem) {
- strikethroughItem.active = !!strikeThrough.s;
+ // strikethroughItem.active = !!strikeThrough.s;
}
if (fontNameItem) {
fontNameItem.children?.forEach((item) => {
@@ -101,7 +101,7 @@ export class ToolBarController {
fontItalicItem.active = !!fontItalic;
}
if (underlineItem) {
- underlineItem.active = !!underline.s;
+ // underlineItem.active = !!underline.s;
}
if (horizontalAlignModeItem) {
horizontalAlignModeItem.children?.forEach((item) => {
diff --git a/packages/sheets-plugin-clipboard/src/Domain/Copy.ts b/packages/sheets-plugin-clipboard/src/Domain/Copy.ts
index bc6b3f24e6..7dabbecada 100644
--- a/packages/sheets-plugin-clipboard/src/Domain/Copy.ts
+++ b/packages/sheets-plugin-clipboard/src/Domain/Copy.ts
@@ -42,7 +42,7 @@ export class UniverCopy extends Copy {
const copyList = [
{
locale: ['rightClick.copy'],
- onClick: (...arg: any) => this.copyTo(...arg),
+ onClick: () => this.copyTo(),
},
{
customLabel: {
@@ -54,19 +54,19 @@ export class UniverCopy extends Copy {
children: [
{
locale: ['Json', 'rightClick.firstLineTitle'],
- onClick: (...arg: any) => this.copyJsonHead(...arg),
+ onClick: () => this.copyJsonHead(),
},
{
locale: ['Json', 'rightClick.untitled'],
- onClick: (...arg: any) => this.copyJsonNoHead(...arg),
+ onClick: () => this.copyJsonNoHead(),
},
{
locale: ['rightClick.array1'],
- onClick: (...arg: any) => this.copyArray1(...arg),
+ onClick: () => this.copyArray1(),
},
{
locale: ['rightClick.array2'],
- onClick: (...arg: any) => this.copyArray2(...arg),
+ onClick: () => this.copyArray2(),
},
{
customLabel: {
@@ -298,8 +298,6 @@ export class UniverCopy extends Copy {
}
async copyTo(...arg: any) {
- arg[1].ref.hideSelect();
-
const table = this._getCopyContent();
if (table) {
const isWrite = await Clipboard.write({
@@ -310,9 +308,6 @@ export class UniverCopy extends Copy {
//复制为json格式字符串,首行为标题
async copyJsonHead(...arg: any) {
- arg[1].ref.hideSelect();
- arg[1].ref.getParent().hideSelect();
-
const Range = this._getRangeInfo();
if (!Range) return;
const { range, rangeData } = Range;
@@ -350,9 +345,6 @@ export class UniverCopy extends Copy {
//复制为json格式字符串,无标题,采用ABCD作为标题
async copyJsonNoHead(...arg: any) {
- arg[1].ref.hideSelect();
- arg[1].ref.getParent().hideSelect();
-
const Range = this._getRangeInfo();
if (!Range) return;
const { range, rangeData } = Range;
@@ -372,9 +364,6 @@ export class UniverCopy extends Copy {
//复制为一维数组
async copyArray1(...arg: any) {
- arg[1].ref.hideSelect();
- arg[1].ref.getParent().hideSelect();
-
const Range = this._getRangeInfo();
if (!Range) return;
const { range, rangeData } = Range;
@@ -392,9 +381,6 @@ export class UniverCopy extends Copy {
//复制为二维数组
async copyArray2(...arg: any) {
- arg[1].ref.hideSelect();
- arg[1].ref.getParent().hideSelect();
-
const Range = this._getRangeInfo();
if (!Range) return;
const { range, rangeData } = Range;
diff --git a/packages/sheets-plugin-clipboard/src/Domain/Paste.ts b/packages/sheets-plugin-clipboard/src/Domain/Paste.ts
index ca48c45be7..3794cd0c55 100644
--- a/packages/sheets-plugin-clipboard/src/Domain/Paste.ts
+++ b/packages/sheets-plugin-clipboard/src/Domain/Paste.ts
@@ -38,8 +38,7 @@ export class UniverPaste extends Paste {
const pasteList = [
{
locale: ['rightClick.paste'],
- onClick: (...arg: any) => {
- arg[1].ref.hideSelect();
+ onClick: () => {
this.pasteTo();
},
},