Commit ca552426 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Не сохраняем пустые пересчетные индексы (для Excel) и не отправляем пустые изменения.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56670 954022d7-b5bf-4e40-9824-e11837661b57
parent 5b322988
......@@ -1599,15 +1599,12 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
oRecalcIndexRows = t.collaborativeEditing.addRecalcIndex(oElement["type"], oElement["index"]);
}
}
}
// Теперь нужно пересчитать индексы для lock-элементов
if (null !== oRecalcIndexColumns && null !== oRecalcIndexRows) {
t.collaborativeEditing._recalcLockArray(c_oAscLockTypes.kLockTypeMine, oRecalcIndexColumns, oRecalcIndexRows);
t.collaborativeEditing._recalcLockArray(c_oAscLockTypes.kLockTypeOther, oRecalcIndexColumns, oRecalcIndexRows);
oRecalcIndexColumns = null;
oRecalcIndexRows = null;
}
// Теперь нужно пересчитать индексы для lock-элементов
if (null !== oRecalcIndexColumns || null !== oRecalcIndexRows) {
t.collaborativeEditing._recalcLockArray(c_oAscLockTypes.kLockTypeMine, oRecalcIndexColumns, oRecalcIndexRows);
t.collaborativeEditing._recalcLockArray(c_oAscLockTypes.kLockTypeOther, oRecalcIndexColumns, oRecalcIndexRows);
}
// т.е. если bSendEvent не задан, то посылаем сообщение + если мы уже открыли документ
......@@ -1676,10 +1673,15 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
var arrChanges = this.wbModel.SerializeHistory();
if (this.collaborativeEditing.getCollaborativeEditing()) {
// Пересчетные индексы добавляем только если мы не одни
arrChanges.push({"index" : recalcIndexColumns, "type" : "0"});
arrChanges.push({"index" : recalcIndexRows, "type" : "1"});
if (recalcIndexColumns)
arrChanges.push({"index" : recalcIndexColumns, "type" : "0"});
if (recalcIndexRows)
arrChanges.push({"index" : recalcIndexRows, "type" : "1"});
}
this.CoAuthoringApi.saveChanges(arrChanges);
if (0 < arrChanges.length)
this.CoAuthoringApi.saveChanges(arrChanges);
else
this.CoAuthoringApi.unLockDocument();
}
},
......
......@@ -275,6 +275,7 @@
};
CCollaborativeEditing.prototype.getRecalcIndexSave = function (oRecalcIndex) {
var bHasIndex = false;
var result = {};
var element = null;
for (var sheetId in oRecalcIndex) {
......@@ -282,6 +283,7 @@
continue;
result[sheetId] = {"_arrElements": []};
for (var i = 0, length = oRecalcIndex[sheetId]._arrElements.length; i < length; ++i) {
bHasIndex = true;
element = oRecalcIndex[sheetId]._arrElements[i];
result[sheetId]["_arrElements"].push({"_recalcType" : element._recalcType,
"_position" : element._position, "_count" : element._count,
......@@ -289,7 +291,7 @@
}
}
return result;
return bHasIndex ? result : null;
};
CCollaborativeEditing.prototype.S4 = function () {
......@@ -489,12 +491,12 @@
oRangeOrObjectId = element["rangeOrObjectId"];
if (oRecalcIndexColumns.hasOwnProperty(sheetId)) {
if (oRecalcIndexColumns && oRecalcIndexColumns.hasOwnProperty(sheetId)) {
// Пересчет колонок
oRangeOrObjectId["c1"] = oRecalcIndexColumns[sheetId].getLockMe(oRangeOrObjectId["c1"]);
oRangeOrObjectId["c2"] = oRecalcIndexColumns[sheetId].getLockMe(oRangeOrObjectId["c2"]);
}
if (oRecalcIndexRows.hasOwnProperty(sheetId)) {
if (oRecalcIndexRows && oRecalcIndexRows.hasOwnProperty(sheetId)) {
// Пересчет строк
oRangeOrObjectId["r1"] = oRecalcIndexRows[sheetId].getLockMe(oRangeOrObjectId["r1"]);
oRangeOrObjectId["r2"] = oRecalcIndexRows[sheetId].getLockMe(oRangeOrObjectId["r2"]);
......
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