mirror of
https://github.com/ONLYOFFICE/sdkjs.git
synced 2026-04-07 14:09:12 +08:00
[se] Fix tests
This commit is contained in:
@ -410,10 +410,10 @@
|
||||
//в данном случае не вырезаем, а записываем
|
||||
if (!ws.isNeedSelectionCut() && false === ws.isMultiSelect()) {
|
||||
ws.workbook.cutIdSheet = ws.model.Id;
|
||||
ws.copyCutRange = [ws.model.selectionRange.getLast()];
|
||||
ws.setCutRange([ws.model.selectionRange.getLast()]);
|
||||
}
|
||||
} else if (!ws.objectRender.selectedGraphicObjectsExists()) {
|
||||
ws.copyCutRange = ws.model.selectionRange.ranges;
|
||||
ws.setCutRange(ws.model.selectionRange.ranges);
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -1968,7 +1968,7 @@
|
||||
var pasteInOriginalDoc = this._checkPastedInOriginalDoc(pastedWb);
|
||||
if (pasteInOriginalDoc && null !== window["Asc"]["editor"].wb.cutIdSheet) {
|
||||
var wsFrom = window["Asc"]["editor"].wb.getWorksheetById(window["Asc"]["editor"].wb.cutIdSheet);
|
||||
var fromRange = wsFrom ? wsFrom.copyCutRange : null;
|
||||
var fromRange = wsFrom ? wsFrom.getCutRange() : null;
|
||||
if (fromRange) {
|
||||
fromRange = fromRange[0];
|
||||
var aRange = ws.model.selectionRange.getLast();
|
||||
|
||||
@ -4829,7 +4829,7 @@
|
||||
}
|
||||
|
||||
if(ws) {
|
||||
ws.copyCutRange = null;
|
||||
ws.setCutRange(null);
|
||||
}
|
||||
this.cutIdSheet = null;
|
||||
|
||||
@ -4849,16 +4849,16 @@
|
||||
if(this.cutIdSheet == null) {
|
||||
var activeWs = this.wsViews[this.wsActive];
|
||||
|
||||
var needUpdateSelection = bDrawSelection && activeWs && activeWs.copyCutRange;
|
||||
var needUpdateSelection = bDrawSelection && activeWs && activeWs.getCutRange();
|
||||
if(needUpdateSelection) {
|
||||
activeWs.cleanSelection();
|
||||
}
|
||||
|
||||
var isCopyHighlighted = false;
|
||||
for(var i in this.wsViews) {
|
||||
if (this.wsViews[i].copyCutRange != null) {
|
||||
if (this.wsViews[i].getCutRange() != null) {
|
||||
isCopyHighlighted = true;
|
||||
this.wsViews[i].copyCutRange = null;
|
||||
this.wsViews[i].setCutRange(null);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -6729,13 +6729,22 @@
|
||||
};
|
||||
|
||||
WorksheetView.prototype._drawCutRange = function () {
|
||||
if(this.copyCutRange) {
|
||||
for (var i in this.copyCutRange) {
|
||||
this._drawElements(this._drawSelectionElement, this.copyCutRange[i], AscCommonExcel.selectionLineType.DashThick, this.settings.activeCellBorderColor);
|
||||
let cutRange = this.getCutRange();
|
||||
if(cutRange) {
|
||||
for (var i in cutRange) {
|
||||
this._drawElements(this._drawSelectionElement, cutRange[i], AscCommonExcel.selectionLineType.DashThick, this.settings.activeCellBorderColor);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
WorksheetView.prototype.setCutRange = function (val) {
|
||||
this.copyCutRange = val;
|
||||
};
|
||||
|
||||
WorksheetView.prototype.getCutRange = function () {
|
||||
return this.copyCutRange;
|
||||
};
|
||||
|
||||
WorksheetView.prototype.drawTraceDependents = function () {
|
||||
let traceManager = this.traceDependentsManager;
|
||||
if(traceManager && (traceManager.isHaveDependents() || traceManager.isHavePrecedents() || traceManager.isHaveExternalPrecedents())) {
|
||||
@ -8830,7 +8839,7 @@
|
||||
//print lines view
|
||||
let isTraceDependents = this.traceDependentsManager.isHaveData();
|
||||
let searchSpecificRange = this.handlers.trigger('selectSearchingResults') && this.workbook.SearchEngine && this.workbook.SearchEngine.isSpecificRange();
|
||||
if(this.viewPrintLines || this.copyCutRange || (this.isPageBreakPreview(true) && this.pagesModeData) || searchSpecificRange || isTraceDependents) {
|
||||
if(this.viewPrintLines || this.getCutRange() || (this.isPageBreakPreview(true) && this.pagesModeData) || searchSpecificRange || isTraceDependents) {
|
||||
this.overlayCtx.clear();
|
||||
if (isTraceDependents) {
|
||||
this.traceDependentsManager.clearCoordsData();
|
||||
|
||||
@ -1017,6 +1017,8 @@
|
||||
|
||||
try
|
||||
{
|
||||
this.bCut = isCut;
|
||||
|
||||
this.Api.asc_CheckCopy(copy_data, c_oAscClipboardDataFormat.Text | c_oAscClipboardDataFormat.Html | c_oAscClipboardDataFormat.Internal | c_oAscClipboardDataFormat.Image);
|
||||
|
||||
let clipboardData = {};
|
||||
@ -1039,6 +1041,8 @@
|
||||
if (isCut === true)
|
||||
this.Api.asc_SelectionCut();
|
||||
|
||||
this.bCut = false;
|
||||
|
||||
this.SendCopyEvent();
|
||||
|
||||
return true;
|
||||
@ -1284,17 +1288,22 @@
|
||||
|
||||
ClearBuffer : function()
|
||||
{
|
||||
if (-1 != this.clearBufferTimerId)
|
||||
{
|
||||
// clear old timer (restart interval)
|
||||
clearTimeout(this.clearBufferTimerId);
|
||||
}
|
||||
this.clearBufferTimerId = setTimeout(function(){
|
||||
if (AscCommon.g_clipboardBase)
|
||||
AscCommon.g_clipboardBase.clearBufferTimerId = -1;
|
||||
}, 500);
|
||||
|
||||
this.Button_Copy();
|
||||
if (this.isUseNewCopy()) {
|
||||
navigator.clipboard.writeText('');
|
||||
} else {
|
||||
if (-1 != this.clearBufferTimerId)
|
||||
{
|
||||
// clear old timer (restart interval)
|
||||
clearTimeout(this.clearBufferTimerId);
|
||||
}
|
||||
this.clearBufferTimerId = setTimeout(function(){
|
||||
if (AscCommon.g_clipboardBase)
|
||||
AscCommon.g_clipboardBase.clearBufferTimerId = -1;
|
||||
}, 500);
|
||||
|
||||
this.Button_Copy();
|
||||
}
|
||||
},
|
||||
|
||||
isCopyOutEnabled : function()
|
||||
|
||||
@ -1523,12 +1523,12 @@ QUnit.config.autostart = false;
|
||||
Select(0, 0, 0, 0, 0, 0);
|
||||
editor.asc_SelectionCut();
|
||||
ExecuteTableHotkey(tableHotkeyTypes.reset);
|
||||
assert.strictEqual(wsView.copyCutRange, null, 'Check resetting cut range');
|
||||
assert.strictEqual(wsView.getCutRange(), null, 'Check resetting cut range');
|
||||
|
||||
Select(0, 0, 0, 0, 0, 0);
|
||||
editor.asc_Copy();
|
||||
ExecuteTableHotkey(tableHotkeyTypes.reset);
|
||||
assert.strictEqual(wsView.copyCutRange, null, 'Check resetting copy range');
|
||||
assert.strictEqual(wsView.getCutRange(), null, 'Check resetting copy range');
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user