Commit f060b3ba authored by Alexander Trofimov's avatar Alexander Trofimov Committed by GitHub

Merge pull request #95 from ONLYOFFICE/hotfix/v4.2.4

Hotfix/v4.2.4
parents 61f696a8 8b187082
......@@ -802,65 +802,61 @@
var arg0 = arg[0], arg1 = arg[1], arg2 = arg[2] ? arg[2] : new cNumber(1);
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) {
return new cError(cErrorType.not_available);
} else if (a1RowCount == 1 && a1ColumnCount > 1) {
for (var i = 0; i < a1ColumnCount; i++) {
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 if (a1RowCount === 1 && a1ColumnCount >= 1) {
arr = a1[0];
} 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);
}
if (a2Value == -1) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] >= a0Value) {
index = i;
} else {
break;
}
}
} else if (a2Value == 0) {
if (cElementType.string === a0.type) {
for (var i = 0; i < arr.length; i++) {
if (AscCommonExcel.searchRegExp2(arr[i].toString(), a0Value)) {
for (i = 0; i < arr.length; ++i) {
item = arr[i];
if (arr[i].type === a0Type) {
if (0 === a2Value) {
if (cElementType.string === a0Type) {
if (AscCommonExcel.searchRegExp2(item.toString(), a0Value)) {
index = i;
break;
}
} else {
if (item == a0Value) {
index = i;
break;
}
}
} else if (1 === a2Value) {
if (item <= a0Value) {
index = i;
} else {
break;
}
}
} else {
for (var i = 0; i < arr.length; i++) {
if (arr[i] == a0Value) {
} else if (-1 === a2Value) {
if (item >= a0Value) {
index = i;
} else {
break;
}
}
}
} else if (a2Value == 1) {
for (var i = 0; i < arr.length; i++) {
if (arr[i] <= a0Value) {
index = i;
} else {
break;
}
}
}
if (index > -1) {
res = new cNumber(index + 1);
}
return res;
return (-1 < index) ? new cNumber(index + 1) : new cError(cErrorType.not_available);
}
......@@ -875,6 +871,8 @@
arg1 = arg1.getMatrix();
} else if (cElementType.cellsRange3D === arg1.type && arg1.wsFrom == arg1.wsTo) {
arg1 = arg1.getMatrix()[0];
} else if (cElementType.cell === arg1.type || cElementType.cell3D === arg1.type) {
arg1 = arg1.getMatrix();
} else {
return this.value = new cError(cErrorType.not_available);
}
......
......@@ -1314,7 +1314,7 @@
this.canvasOuterStyle.top = top + 'px';
this.canvasOuterStyle.width = widthStyle + '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.height = this.canvasOverlay.height = height;
......
......@@ -233,17 +233,6 @@ window["asc_initAdvancedOptions"] = function(_code)
_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.isSafariMacOs = false;
......
......@@ -927,4 +927,15 @@
var g_clipboardBase = new CClipboardBase();
window['AscCommon'] = window['AscCommon'] || {};
window['AscCommon'].g_clipboardBase = g_clipboardBase;
})(window);
\ No newline at end of file
})(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
......@@ -1048,27 +1048,27 @@
}
};
DocsCoApi.prototype._onSaveLock = function(data) {
if (null != data["saveLock"]) {
var indexCallback = this._saveCallback.length - 1;
var oTmpCallback = this._saveCallback[indexCallback];
if (oTmpCallback) {
// Очищаем предыдущий таймер
if (null !== this.saveLockCallbackErrorTimeOutId) {
clearTimeout(this.saveLockCallbackErrorTimeOutId);
this.saveLockCallbackErrorTimeOutId = null;
}
this._saveCallback[indexCallback] = null;
oTmpCallback(data);
if (data['error']) {
this._state = ConnectionState.Authorized;
DocsCoApi.prototype._onSaveLock = function (data) {
if (null != data["saveLock"]) {
var indexCallback = this._saveCallback.length - 1;
var oTmpCallback = this._saveCallback[indexCallback];
if (oTmpCallback) {
// Очищаем предыдущий таймер
if (null !== this.saveLockCallbackErrorTimeOutId) {
clearTimeout(this.saveLockCallbackErrorTimeOutId);
this.saveLockCallbackErrorTimeOutId = null;
}
this._saveCallback[indexCallback] = null;
oTmpCallback(data);
}
}
if (null == data["saveLock"] || data['error'] || data["saveLock"]) {
this._state = ConnectionState.Authorized;
// Делаем отложенные lock-и
this._sendBufferedLocks();
}
}
}
};
}
};
DocsCoApi.prototype._onUnSaveLock = function(data) {
// Очищаем предыдущий таймер сохранения
......
......@@ -5827,6 +5827,7 @@ CDocument.prototype.Insert_Content = function(SelectedContent, NearPos)
this.Selection.Use = true;
this.Selection.StartPos = DstIndex;
this.Selection.EndPos = DstIndex + ElementsCount - 1;
this.CurPos.ContentPos = DstIndex + ElementsCount - 1;
}
if (docpostype_DrawingObjects !== this.CurPos.Type)
......
......@@ -4473,6 +4473,7 @@ CDocumentContent.prototype.Insert_Content = function(Selecte
this.Selection.Use = true;
this.Selection.StartPos = DstIndex;
this.Selection.EndPos = DstIndex + ElementsCount - 1;
this.CurPos.ContentPos = DstIndex + ElementsCount - 1;
}
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