Commit de2558be authored by Alexander.Trofimov's avatar Alexander.Trofimov

update setSelectionInfo

parent 94ee68f7
......@@ -8476,7 +8476,7 @@
}
};
WorksheetView.prototype.setSelectionInfo = function (prop, val, onlyActive, fromBinary, sortColor) {
WorksheetView.prototype.setSelectionInfo = function (prop, val, onlyActive, fromBinary) {
// Проверка глобального лока
if (this.collaborativeEditing.getGlobalLock()) {
return;
......@@ -8486,13 +8486,6 @@
var checkRange = [];
var activeCell = this.model.selectionRange.activeCell.clone();
var arn = this.model.selectionRange.getLast().clone(true);
if (onlyActive) {
checkRange.push(new asc_Range(activeCell.col, activeCell.row, activeCell.col, activeCell.row));
} else {
this.model.selectionRange.ranges.forEach(function (item) {
checkRange.push(item.getAllRange());
});
}
var onSelectionCallback = function (isSuccess) {
if (false === isSuccess) {
......@@ -8640,7 +8633,7 @@
callTrigger = true;
t.handlers.trigger("slowOperation", true);
}
t.cellCommentator.sortComments(range.sort(val, activeCell.col, sortColor, true));
t.cellCommentator.sortComments(range.sort(val.type, activeCell.col, val.color, true));
break;
case "empty":
......@@ -8780,7 +8773,11 @@
}
};
//получаем диапазон вставки
if ("paste" === prop && val.onlyImages === true) {
onSelectionCallback();
return;
}
if ("paste" === prop && val.onlyImages !== true) {
var newRange;
if (fromBinary) {
......@@ -8790,33 +8787,32 @@
}
var g_clipboardBase = window['AscCommon'].g_clipboardBase;
if(!AscCommonExcel.g_clipboardExcel.specialPasteStart)
{
var sBinary = AscCommonExcel.g_clipboardExcel.copyProcessor.getBinaryForCopy(this, newRange);
g_clipboardBase.specialPasteUndoData.data = sBinary;
if (!AscCommonExcel.g_clipboardExcel.specialPasteStart) {
g_clipboardBase.specialPasteUndoData.data =
AscCommonExcel.g_clipboardExcel.copyProcessor.getBinaryForCopy(this, newRange);
var specialPasteSelectionRange = new AscCommonExcel.SelectionRange();
specialPasteSelectionRange.ranges[0] = newRange.clone();
g_clipboardBase.specialPasteData.activeRange = specialPasteSelectionRange;
window['AscCommon'].g_clipboardBase.specialPasteUndoData.transpose = null;
}
else if(g_clipboardBase.specialPasteProps && g_clipboardBase.specialPasteProps.transpose)
{
} else if (g_clipboardBase.specialPasteProps && g_clipboardBase.specialPasteProps.transpose) {
window['AscCommon'].g_clipboardBase.specialPasteUndoData.transpose = true;
}
checkRange = [newRange];
}
if ("paste" === prop && val.onlyImages === true) {
onSelectionCallback();
} else if (onlyActive) {
checkRange.push(new asc_Range(activeCell.col, activeCell.row, activeCell.col, activeCell.row));
} else {
this._isLockedCells(checkRange, /*subType*/null, onSelectionCallback);
this.model.selectionRange.ranges.forEach(function (item) {
checkRange.push(item.getAllRange());
});
}
this._isLockedCells(checkRange, /*subType*/null, onSelectionCallback);
};
WorksheetView.prototype.specialPaste = function (props) {
var api = window["Asc"]["editor"];
var t = this;
var clipboard_base = window['AscCommon'].g_clipboardBase;
......@@ -12432,7 +12428,7 @@
}
//sort
t.setSelectionInfo("sort", type, null, null, rgbColor);
t.setSelectionInfo("sort", {type: type, color: rgbColor});
//TODO возможно стоит возвратить selection обратно
} else if (false !== sortProps) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment