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

update setSelectionInfo

parent 94ee68f7
...@@ -8476,7 +8476,7 @@ ...@@ -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()) { if (this.collaborativeEditing.getGlobalLock()) {
return; return;
...@@ -8486,13 +8486,6 @@ ...@@ -8486,13 +8486,6 @@
var checkRange = []; var checkRange = [];
var activeCell = this.model.selectionRange.activeCell.clone(); var activeCell = this.model.selectionRange.activeCell.clone();
var arn = this.model.selectionRange.getLast().clone(true); 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) { var onSelectionCallback = function (isSuccess) {
if (false === isSuccess) { if (false === isSuccess) {
...@@ -8640,7 +8633,7 @@ ...@@ -8640,7 +8633,7 @@
callTrigger = true; callTrigger = true;
t.handlers.trigger("slowOperation", 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; break;
case "empty": case "empty":
...@@ -8779,44 +8772,47 @@ ...@@ -8779,44 +8772,47 @@
AscCommonExcel.g_clipboardExcel.end_paste(); AscCommonExcel.g_clipboardExcel.end_paste();
} }
}; };
//получаем диапазон вставки if ("paste" === prop && val.onlyImages === true) {
if ("paste" === prop && val.onlyImages !== true) { onSelectionCallback();
var newRange; return;
if (fromBinary) { }
newRange = this._pasteFromBinary(val, true);
} else { if ("paste" === prop && val.onlyImages !== true) {
newRange = this._pasteFromHTML(val, true); var newRange;
} if (fromBinary) {
newRange = this._pasteFromBinary(val, true);
} else {
newRange = this._pasteFromHTML(val, true);
}
var g_clipboardBase = window['AscCommon'].g_clipboardBase; var g_clipboardBase = window['AscCommon'].g_clipboardBase;
if(!AscCommonExcel.g_clipboardExcel.specialPasteStart) if (!AscCommonExcel.g_clipboardExcel.specialPasteStart) {
{ g_clipboardBase.specialPasteUndoData.data =
var sBinary = AscCommonExcel.g_clipboardExcel.copyProcessor.getBinaryForCopy(this, newRange); AscCommonExcel.g_clipboardExcel.copyProcessor.getBinaryForCopy(this, newRange);
g_clipboardBase.specialPasteUndoData.data = sBinary;
var specialPasteSelectionRange = new AscCommonExcel.SelectionRange(); var specialPasteSelectionRange = new AscCommonExcel.SelectionRange();
specialPasteSelectionRange.ranges[0] = newRange.clone(); specialPasteSelectionRange.ranges[0] = newRange.clone();
g_clipboardBase.specialPasteData.activeRange = specialPasteSelectionRange; g_clipboardBase.specialPasteData.activeRange = specialPasteSelectionRange;
window['AscCommon'].g_clipboardBase.specialPasteUndoData.transpose = null; 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; window['AscCommon'].g_clipboardBase.specialPasteUndoData.transpose = true;
} }
checkRange = [newRange]; checkRange = [newRange];
} } else if (onlyActive) {
if ("paste" === prop && val.onlyImages === true) { checkRange.push(new asc_Range(activeCell.col, activeCell.row, activeCell.col, activeCell.row));
onSelectionCallback(); } else {
} else { this.model.selectionRange.ranges.forEach(function (item) {
this._isLockedCells(checkRange, /*subType*/null, onSelectionCallback); checkRange.push(item.getAllRange());
} });
}
this._isLockedCells(checkRange, /*subType*/null, onSelectionCallback);
}; };
WorksheetView.prototype.specialPaste = function (props) { WorksheetView.prototype.specialPaste = function (props) {
var api = window["Asc"]["editor"];
var t = this; var t = this;
var clipboard_base = window['AscCommon'].g_clipboardBase; var clipboard_base = window['AscCommon'].g_clipboardBase;
...@@ -12432,7 +12428,7 @@ ...@@ -12432,7 +12428,7 @@
} }
//sort //sort
t.setSelectionInfo("sort", type, null, null, rgbColor); t.setSelectionInfo("sort", {type: type, color: rgbColor});
//TODO возможно стоит возвратить selection обратно //TODO возможно стоит возвратить selection обратно
} else if (false !== sortProps) { } 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