Commit 29358743 authored by Alexey Golubev's avatar Alexey Golubev

Merge branch 'hotfix/v4.2.4'

parents 514a3a75 8b187082
...@@ -845,65 +845,61 @@ ...@@ -845,65 +845,61 @@
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2] ? arg[2] : new cNumber(1); var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2] ? arg[2] : new cNumber(1);
function findMatch(a0, a1, a2) { function findMatch(a0, a1, a2) {
var a1RowCount = a1.length, a1ColumnCount = a1[0].length, a0Value = a0.getValue(), a2Value = a2.getValue(), arr = [], res = new cError(cErrorType.not_available), index = -1; var i, item, a1RowCount = a1.length, a1ColumnCount = a1[0].length, a2Value = a2.getValue(), arr, index = -1;
var a0Type = a0.type;
var a0Value = a0.getValue();
if(!(cElementType.number === a0Type || cElementType.string === a0Type || cElementType.bool === a0Type || cElementType.error === a0Type || cElementType.empty === a0Type)) {
a0Type = a0Value.type;
a0Value = a0Value.getValue();
}
if (a1RowCount > 1 && a1ColumnCount > 1) { if (a1RowCount > 1 && a1ColumnCount > 1) {
return new cError(cErrorType.not_available); return new cError(cErrorType.not_available);
} else if (a1RowCount == 1 && a1ColumnCount > 1) { } else if (a1RowCount === 1 && a1ColumnCount >= 1) {
for (var i = 0; i < a1ColumnCount; i++) { arr = a1[0];
arr[i] = a1[0][i].getValue();
}
} else if (a1RowCount > 1 && a1ColumnCount == 1) {
for (var i = 0; i < a1RowCount; i++) {
arr[i] = a1[i][0].getValue();
}
} else { } else {
arr[0] = a1[0][0]; arr = [];
for (i = 0; i < a1RowCount; i++) {
arr[i] = a1[i][0];
}
} }
if (!(a2Value == 1 || a2Value == 0 || a2Value == -1)) { if (!(-1 === a2Value || 0 === a2Value || 1 === a2Value)) {
return new cError(cErrorType.not_numeric); return new cError(cErrorType.not_numeric);
} }
if (a2Value == -1) { for (i = 0; i < arr.length; ++i) {
for (var i = 0; i < arr.length; i++) { item = arr[i];
if (arr[i] >= a0Value) { if (arr[i].type === a0Type) {
if (0 === a2Value) {
if (cElementType.string === a0Type) {
if (AscCommonExcel.searchRegExp2(item.toString(), a0Value)) {
index = i; index = i;
} else {
break; break;
} }
} } else {
} else if (a2Value == 0) { if (item == a0Value) {
if (cElementType.string === a0.type) {
for (var i = 0; i < arr.length; i++) {
if (AscCommonExcel.searchRegExp2(arr[i].toString(), a0Value)) {
index = i; index = i;
break; break;
} }
} }
} else { } else if (1 === a2Value) {
for (var i = 0; i < arr.length; i++) { if (item <= a0Value) {
if (arr[i] == a0Value) {
index = i; index = i;
} else {
break; break;
} }
} } else if (-1 === a2Value) {
} if (item >= a0Value) {
} else if (a2Value == 1) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] <= a0Value) {
index = i; index = i;
} else { } else {
break; break;
} }
} }
} }
if (index > -1) {
res = new cNumber(index + 1);
} }
return res; return (-1 < index) ? new cNumber(index + 1) : new cError(cErrorType.not_available);
} }
...@@ -918,6 +914,8 @@ ...@@ -918,6 +914,8 @@
arg1 = arg1.getMatrix(); arg1 = arg1.getMatrix();
} else if (cElementType.cellsRange3D === arg1.type && arg1.wsFrom == arg1.wsTo) { } else if (cElementType.cellsRange3D === arg1.type && arg1.wsFrom == arg1.wsTo) {
arg1 = arg1.getMatrix()[0]; arg1 = arg1.getMatrix()[0];
} else if (cElementType.cell === arg1.type || cElementType.cell3D === arg1.type) {
arg1 = arg1.getMatrix();
} else { } else {
return this.value = new cError(cErrorType.not_available); return this.value = new cError(cErrorType.not_available);
} }
......
...@@ -1320,7 +1320,7 @@ ...@@ -1320,7 +1320,7 @@
this.canvasOuterStyle.top = top + 'px'; this.canvasOuterStyle.top = top + 'px';
this.canvasOuterStyle.width = widthStyle + 'px'; this.canvasOuterStyle.width = widthStyle + 'px';
this.canvasOuterStyle.height = heightStyle + 'px'; this.canvasOuterStyle.height = heightStyle + 'px';
this.canvasOuterStyle.zIndex = this.top <= 0 ? -1 : z; this.canvasOuterStyle.zIndex = this.top < 0 ? -1 : z;
this.canvas.width = this.canvasOverlay.width = width; this.canvas.width = this.canvasOverlay.width = width;
this.canvas.height = this.canvasOverlay.height = height; this.canvas.height = this.canvasOverlay.height = height;
......
...@@ -233,17 +233,6 @@ window["asc_initAdvancedOptions"] = function(_code) ...@@ -233,17 +233,6 @@ window["asc_initAdvancedOptions"] = function(_code)
_editor._onNeedParams(undefined, (_code == 90 || _code == 91) ? true : undefined); _editor._onNeedParams(undefined, (_code == 90 || _code == 91) ? true : undefined);
}; };
// copy/paste focus error!!!
window["asc_desktop_copypaste"] = function(_api, _method)
{
var bIsFocus = _api.asc_IsFocus();
if (!bIsFocus)
_api.asc_enableKeyEvents(true);
window["AscDesktopEditor"][_method]();
if (!bIsFocus)
_api.asc_enableKeyEvents(false);
}
// меняем среду // меняем среду
//AscBrowser.isSafari = false; //AscBrowser.isSafari = false;
//AscBrowser.isSafariMacOs = false; //AscBrowser.isSafariMacOs = false;
......
...@@ -928,3 +928,14 @@ ...@@ -928,3 +928,14 @@
window['AscCommon'] = window['AscCommon'] || {}; window['AscCommon'] = window['AscCommon'] || {};
window['AscCommon'].g_clipboardBase = g_clipboardBase; window['AscCommon'].g_clipboardBase = g_clipboardBase;
})(window); })(window);
// copy/paste focus error!!!
window["asc_desktop_copypaste"] = function(_api, _method)
{
var bIsFocus = _api.asc_IsFocus();
if (!bIsFocus)
_api.asc_enableKeyEvents(true);
window["AscDesktopEditor"][_method]();
if (!bIsFocus)
_api.asc_enableKeyEvents(false);
};
\ No newline at end of file
...@@ -1028,7 +1028,7 @@ ...@@ -1028,7 +1028,7 @@
} }
}; };
DocsCoApi.prototype._onSaveLock = function(data) { DocsCoApi.prototype._onSaveLock = function (data) {
if (null != data["saveLock"]) { if (null != data["saveLock"]) {
var indexCallback = this._saveCallback.length - 1; var indexCallback = this._saveCallback.length - 1;
var oTmpCallback = this._saveCallback[indexCallback]; var oTmpCallback = this._saveCallback[indexCallback];
...@@ -1041,13 +1041,13 @@ ...@@ -1041,13 +1041,13 @@
this._saveCallback[indexCallback] = null; this._saveCallback[indexCallback] = null;
oTmpCallback(data); oTmpCallback(data);
if (data['error']) { }
}
if (null == data["saveLock"] || data['error'] || data["saveLock"]) {
this._state = ConnectionState.Authorized; this._state = ConnectionState.Authorized;
// Делаем отложенные lock-и // Делаем отложенные lock-и
this._sendBufferedLocks(); this._sendBufferedLocks();
} }
}
}
}; };
DocsCoApi.prototype._onUnSaveLock = function(data) { DocsCoApi.prototype._onUnSaveLock = function(data) {
......
...@@ -5831,6 +5831,7 @@ CDocument.prototype.Insert_Content = function(SelectedContent, NearPos) ...@@ -5831,6 +5831,7 @@ CDocument.prototype.Insert_Content = function(SelectedContent, NearPos)
this.Selection.Use = true; this.Selection.Use = true;
this.Selection.StartPos = DstIndex; this.Selection.StartPos = DstIndex;
this.Selection.EndPos = DstIndex + ElementsCount - 1; this.Selection.EndPos = DstIndex + ElementsCount - 1;
this.CurPos.ContentPos = DstIndex + ElementsCount - 1;
} }
if (docpostype_DrawingObjects !== this.CurPos.Type) if (docpostype_DrawingObjects !== this.CurPos.Type)
......
...@@ -4471,6 +4471,7 @@ CDocumentContent.prototype.Insert_Content = function(Selecte ...@@ -4471,6 +4471,7 @@ CDocumentContent.prototype.Insert_Content = function(Selecte
this.Selection.Use = true; this.Selection.Use = true;
this.Selection.StartPos = DstIndex; this.Selection.StartPos = DstIndex;
this.Selection.EndPos = DstIndex + ElementsCount - 1; this.Selection.EndPos = DstIndex + ElementsCount - 1;
this.CurPos.ContentPos = DstIndex + ElementsCount - 1;
} }
if (true === bNeedSelect) if (true === bNeedSelect)
......
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