Commit c2ec1add authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Bug 25882 - [CoEdit] Не рисуются локи вокруг автофигур пока не будут введены данные в ячейки

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57707 954022d7-b5bf-4e40-9824-e11837661b57
parent 819b83d3
...@@ -776,7 +776,6 @@ function DrawingArea(ws) { ...@@ -776,7 +776,6 @@ function DrawingArea(ws) {
if ( !_this.worksheet.objectRender.controller.selectedObjects.length && !api.isStartAddShape ) if ( !_this.worksheet.objectRender.controller.selectedObjects.length && !api.isStartAddShape )
_this.worksheet._drawSelection(); _this.worksheet._drawSelection();
var chart; var chart;
var controller = _this.worksheet.objectRender.controller; var controller = _this.worksheet.objectRender.controller;
var selected_objects = controller.selection.groupSelection ? controller.selection.groupSelection.selectedObjects : controller.selectedObjects; var selected_objects = controller.selection.groupSelection ? controller.selection.groupSelection.selectedObjects : controller.selectedObjects;
......
...@@ -3456,15 +3456,15 @@ function DrawingObjects() { ...@@ -3456,15 +3456,15 @@ function DrawingObjects() {
return response; return response;
}; };
_this.setGraphicObjectLockState = function(id, state) { // _this.setGraphicObjectLockState = function(id, state) {
//
for (var i = 0; i < aObjects.length; i++) { // for (var i = 0; i < aObjects.length; i++) {
if ( id == aObjects[i].graphicObject.Id ) { // if ( id == aObjects[i].graphicObject.Id ) {
aObjects[i].graphicObject.lockType = state; // aObjects[i].graphicObject.lockType = state;
break; // break;
} // }
} // }
}; // };
_this.resetLockedGraphicObjects = function() { _this.resetLockedGraphicObjects = function() {
......
...@@ -4977,8 +4977,6 @@ DrawingObjectsController.prototype = ...@@ -4977,8 +4977,6 @@ DrawingObjectsController.prototype =
} }
}, },
checkSelectedObjectsAndCallback: function(callback, args) checkSelectedObjectsAndCallback: function(callback, args)
{ {
var selection_state = this.getSelectionState(); var selection_state = this.getSelectionState();
...@@ -4996,31 +4994,13 @@ DrawingObjectsController.prototype = ...@@ -4996,31 +4994,13 @@ DrawingObjectsController.prototype =
if(bSync !== true) if(bSync !== true)
{ {
_this.setSelectionState(selection_state); _this.setSelectionState(selection_state);
} for(var i = 0; i < _this.selectedObjects.length; ++i)
callback.apply(_this, args);
_this.startRecalculate();
// _this.recalculateCurPos();
_this.drawingObjects.sendGraphicObjectProps();
}
};
this.drawingObjects.objectLocker.checkObjects(callback2);
},
checkObjectsAndCallback: function(callback, args)
{
this.drawingObjects.objectLocker.reset();
var objects = this.getDrawingObjects();
for(var i = 0; i < objects.length; ++i)
{ {
this.drawingObjects.objectLocker.addObjectId(objects[i].Get_Id()); _this.selectedObjects[i].lockType = c_oAscLockTypes.kLockTypeMine;
}
} }
var _this = this;
var callback2 = function(bLock)
{
if(bLock)
{
callback.apply(_this, args); callback.apply(_this, args);
_this.startRecalculate(); _this.startRecalculate();
_this.recalculateCurPos();
_this.drawingObjects.sendGraphicObjectProps(); _this.drawingObjects.sendGraphicObjectProps();
} }
}; };
......
...@@ -1509,6 +1509,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1509,6 +1509,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
t.collaborativeEditing.addUnlock (lockElem); t.collaborativeEditing.addUnlock (lockElem);
} }
var drawing;
if (null != lockElem) { if (null != lockElem) {
var oldType = lockElem.getType(); var oldType = lockElem.getType();
if (c_oAscLockTypes.kLockTypeOther2 === oldType || c_oAscLockTypes.kLockTypeOther3 === oldType) if (c_oAscLockTypes.kLockTypeOther2 === oldType || c_oAscLockTypes.kLockTypeOther3 === oldType)
...@@ -1518,7 +1519,17 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1518,7 +1519,17 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
// Выставляем ID пользователя, залочившего данный элемент // Выставляем ID пользователя, залочившего данный элемент
lockElem.setUserId (e["user"]); lockElem.setUserId (e["user"]);
if(lockElem && lockElem.Element)
{
drawing = g_oTableId.Get_ById(lockElem.Element["rangeOrObjectId"]);
if(drawing)
{
drawing.lockType = lockElem.Type;
} }
}
}
if (t.wb) { if (t.wb) {
// Шлем update для toolbar-а, т.к. когда select в lock ячейке нужно заблокировать toolbar // Шлем update для toolbar-а, т.к. когда select в lock ячейке нужно заблокировать toolbar
...@@ -1534,6 +1545,10 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1534,6 +1545,10 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
ws.draw(); ws.draw();
else else
ws.updateSelection(); ws.updateSelection();
if(drawing && ws.model === drawing.worksheet)
{
ws.objectRender.showDrawingObjects(true);
}
} }
} }
}; };
...@@ -1560,16 +1575,18 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -1560,16 +1575,18 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
t.wb.getWorksheet().cleanSelection(); t.wb.getWorksheet().cleanSelection();
} }
var drawing;
if (c_oAscLockTypes.kLockTypeNone !== newType) if (c_oAscLockTypes.kLockTypeNone !== newType)
lockElem.setType (newType, true); lockElem.setType (newType, true);
else { else {
// Удаляем из lock-ов, тот, кто правил ушел и не сохранил // Удаляем из lock-ов, тот, кто правил ушел и не сохранил
t.collaborativeEditing.removeUnlock (lockElem); t.collaborativeEditing.removeUnlock (lockElem);
drawing = g_oTableId.Get_ById(lockElem.Element["rangeOrObjectId"]);
if ( lockElem.Element["type"] == c_oAscLockTypeElem.Object ) if(drawing && drawing.lockType !== c_oAscLockTypes.kLockTypeNone)
t._onTryResetLockedGraphicObject(lockElem.Element["rangeOrObjectId"]); {
drawing.lockType = c_oAscLockTypes.kLockTypeNone;
}
} }
if (t.wb) { if (t.wb) {
// Шлем update для листов // Шлем update для листов
t._onUpdateSheetsLock(lockElem); t._onUpdateSheetsLock(lockElem);
......
...@@ -223,8 +223,10 @@ ...@@ -223,8 +223,10 @@
while (bIsCollaborative && 0 < this.m_arrNeedUnlock2.length) { while (bIsCollaborative && 0 < this.m_arrNeedUnlock2.length) {
oLock = this.m_arrNeedUnlock2.shift(); oLock = this.m_arrNeedUnlock2.shift();
oLock.setType(c_oAscLockTypes.kLockTypeNone, false); oLock.setType(c_oAscLockTypes.kLockTypeNone, false);
if (oLock.Element["type"] == c_oAscLockTypeElem.Object) {
if (this.handlers.trigger("tryResetLockedGraphicObject", oLock.Element["rangeOrObjectId"])) var drawing = g_oTableId.Get_ById(oLock.Element["rangeOrObjectId"]);
if(drawing && drawing.lockType !== c_oAscLockTypes.kLockTypeNone) {
drawing.lockType = c_oAscLockTypes.kLockTypeNone;
bRedrawGraphicObjects = true; bRedrawGraphicObjects = true;
} }
this.handlers.trigger("releaseLocks", oLock.Element["guid"]); this.handlers.trigger("releaseLocks", oLock.Element["guid"]);
...@@ -235,8 +237,9 @@ ...@@ -235,8 +237,9 @@
for (;bIsCollaborative && nIndex < nCount; ++nIndex) { for (;bIsCollaborative && nIndex < nCount; ++nIndex) {
oLock = this.m_arrNeedUnlock[nIndex]; oLock = this.m_arrNeedUnlock[nIndex];
if (c_oAscLockTypes.kLockTypeOther2 === oLock.getType()) { if (c_oAscLockTypes.kLockTypeOther2 === oLock.getType()) {
if (oLock.Element["type"] == c_oAscLockTypeElem.Object) { drawing = g_oTableId.Get_ById(oLock.Element["rangeOrObjectId"]);
if (this.handlers.trigger("tryResetLockedGraphicObject", oLock.Element["rangeOrObjectId"])) if(drawing && drawing.lockType !== c_oAscLockTypes.kLockTypeNone) {
drawing.lockType = c_oAscLockTypes.kLockTypeNone;
bRedrawGraphicObjects = true; bRedrawGraphicObjects = true;
} }
this.m_arrNeedUnlock.splice(nIndex, 1); this.m_arrNeedUnlock.splice(nIndex, 1);
......
...@@ -3772,14 +3772,14 @@ ...@@ -3772,14 +3772,14 @@
arrayCells = this.collaborativeEditing.getLockCellsOther(currentSheetId); arrayCells = this.collaborativeEditing.getLockCellsOther(currentSheetId);
} }
if (bIsDrawObjects) { ///if (bIsDrawObjects) {
var arrayObjects = (c_oAscLockTypes.kLockTypeMine === type) ? /// var arrayObjects = (c_oAscLockTypes.kLockTypeMine === type) ?
this.collaborativeEditing.getLockObjectsMe(currentSheetId) : this.collaborativeEditing.getLockObjectsOther(currentSheetId); /// this.collaborativeEditing.getLockObjectsMe(currentSheetId) : this.collaborativeEditing.getLockObjectsOther(currentSheetId);
///
for (i = 0; i < arrayObjects.length; ++i) { /// for (i = 0; i < arrayObjects.length; ++i) {
this.objectRender.setGraphicObjectLockState(arrayObjects[i], type); /// this.objectRender.setGraphicObjectLockState(arrayObjects[i], type);
} /// }
} ///}
for (i = 0; i < arrayCells.length; ++i) { for (i = 0; i < arrayCells.length; ++i) {
oCellTmp = new asc_Range(arrayCells[i].c1, arrayCells[i].r1, arrayCells[i].c2, arrayCells[i].r2); oCellTmp = new asc_Range(arrayCells[i].c1, arrayCells[i].r1, arrayCells[i].c2, arrayCells[i].r2);
...@@ -9379,6 +9379,7 @@ ...@@ -9379,6 +9379,7 @@
t._cleanCellsTextMetricsCache(); t._cleanCellsTextMetricsCache();
t._prepareCellTextMetricsCache(); t._prepareCellTextMetricsCache();
t.objectRender.setScrollOffset(); t.objectRender.setScrollOffset();
t.objectRender.rebuildChartGraphicObjects(oChangeData);
t.draw(); t.draw();
t.handlers.trigger("reinitializeScroll"); t.handlers.trigger("reinitializeScroll");
...@@ -9386,8 +9387,6 @@ ...@@ -9386,8 +9387,6 @@
if (isUpdateCols) { t._updateVisibleColsCount(); } if (isUpdateCols) { t._updateVisibleColsCount(); }
if (isUpdateRows) { t._updateVisibleRowsCount(); } if (isUpdateRows) { t._updateVisibleRowsCount(); }
t.objectRender.rebuildChartGraphicObjects(oChangeData);
t.objectRender.showDrawingObjects(true);
}; };
switch (prop) { switch (prop) {
...@@ -9781,9 +9780,6 @@ ...@@ -9781,9 +9780,6 @@
if (isUpdateCols) { t._updateVisibleColsCount(); } if (isUpdateCols) { t._updateVisibleColsCount(); }
if (isUpdateRows) { t._updateVisibleRowsCount(); } if (isUpdateRows) { t._updateVisibleRowsCount(); }
if (false === lockDraw)
t.objectRender.showDrawingObjects(true);
}; };
WorksheetView.prototype.expandColsOnScroll = function (isNotActive, updateColsCount, newColsCount) { WorksheetView.prototype.expandColsOnScroll = function (isNotActive, updateColsCount, newColsCount) {
......
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