Commit 8ecf6d52 authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

- Рефакторинг

- Исправлен баг с миганием шейпа с текстом при Undo


git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50256 954022d7-b5bf-4e40-9824-e11837661b57
parent bdb5eec8
This diff is collapsed.
......@@ -362,6 +362,7 @@ CHistory.prototype =
this.workbook.bUndoChanges = true;
var isReInit = false;
var isRedrawAll = true;
var oCurWorksheet = this.workbook.getWorksheet(this.workbook.getActive());
if(null != Point.nLastSheetId && Point.nLastSheetId != oCurWorksheet.getId())
this.workbook.handlers.trigger("showWorksheet", Point.nLastSheetId);
......@@ -372,6 +373,8 @@ CHistory.prototype =
Item.Class.Undo( Item.Type, Item.Data, Item.SheetId );
if (g_oUndoRedoWorksheet === Item.Class && historyitem_Worksheet_SetViewSettings === Item.Type)
isReInit = true;
if (g_oUndoRedoGraphicObjects === Item.Class)
isRedrawAll = false;
}
var oSelectRange = null;
if(null != Point.SelectRange)
......@@ -394,7 +397,10 @@ CHistory.prototype =
this.workbook.bUndoChanges = false;
if (isReInit)
this.workbook.handlers.trigger("reInit");
this.workbook.handlers.trigger("drawWS");
if (isRedrawAll)
this.workbook.handlers.trigger("drawWS");
else
this.workbook.handlers.trigger("showDrawingObjects", true);
/* возвращаем отрисовку. и перерисовываем ячейки с предварительным пересчетом */
buildRecalc(this.workbook);
......
......@@ -2603,9 +2603,9 @@
var positionY = null;
if(ws.cols && firstRange && firstRange.c1 != undefined && ws.cols[firstRange.c1].left != undefined)
positionX = ws.cols[firstRange.c1].left;
positionX = ws.cols[firstRange.c1].left - ws.getCellLeft(0, 1);
if(ws.rows && firstRange && firstRange.r1 != undefined && ws.rows[firstRange.r1].top != undefined)
positionY = ws.rows[firstRange.r1].top
positionY = ws.rows[firstRange.r1].top - ws.getCellTop(0, 1);
var Drawing;
switch(first_string)
......
......@@ -1241,6 +1241,7 @@
// Shapes
var coord = this._getCoordinates(event);
this.handlers.trigger("graphicObjectMouseUpEx", event, coord.x, coord.y);
if ( this.isGraphicObjectMode ) {
this.handlers.trigger("graphicObjectMouseUp", event, coord.x, coord.y);
this._changeSelectionDone(event);
......
......@@ -212,10 +212,11 @@
"isGlobalLockEditCell": function () {return self.collaborativeEditing.getGlobalLockEditCell();},
"updateSelectionName": function () {self._onUpdateSelectionName.apply(self, arguments);},
// Shapes
// Shapes
"graphicObjectMouseDown": function () {self._onGraphicObjectMouseDown.apply(self, arguments);},
"graphicObjectMouseMove": function () {self._onGraphicObjectMouseMove.apply(self, arguments);},
"graphicObjectMouseUp": function () {self._onGraphicObjectMouseUp.apply(self, arguments);},
"graphicObjectMouseUpEx": function () {self._onGraphicObjectMouseUpEx.apply(self, arguments);},
"graphicObjectWindowKeyDown": function () {return self._onGraphicObjectWindowKeyDown.apply(self, arguments);},
"graphicObjectWindowKeyPress": function () {return self._onGraphicObjectWindowKeyPress.apply(self, arguments);},
"getGraphicsInfo": function () {return self._onGetGraphicsInfo.apply(self, arguments);},
......@@ -259,6 +260,9 @@
this.model.handlers.add("drawWS", function () {
self.drawWS.apply(self, arguments);
});
this.model.handlers.add("showDrawingObjects", function () {
self.onShowDrawingObjects.apply(self, arguments);
});
this.model.handlers.add("lockDraw", function () {
self.lockDraw.apply(self, arguments);
});
......@@ -711,6 +715,11 @@
ws.objectRender.graphicObjectMouseUp(e, x, y);
},
_onGraphicObjectMouseUpEx: function (e, x, y) {
//var ws = this.getWorksheet();
//ws.objectRender.coordsManager.calculateCell(x, y);
},
_onGraphicObjectWindowKeyDown: function (e) {
var ws = this.getWorksheet();
return ws.objectRender.graphicObjectKeyDown(e);
......@@ -1495,6 +1504,10 @@
this._lockDraw = false;
this.getWorksheet().draw(this._lockDraw);
},
onShowDrawingObjects: function (clearCanvas) {
var ws = this.getWorksheet();
ws.objectRender.showDrawingObjects(clearCanvas);
},
lockDraw: function(){
this._lockDraw = true;
......
......@@ -7117,9 +7117,9 @@
var positionY = null;
if (t.cols && val.addImages[im].curCell && val.addImages[im].curCell.col != undefined && t.cols[val.addImages[im].curCell.col].left != undefined)
positionX = t.cols[val.addImages[im].curCell.col].left;
positionX = t.cols[val.addImages[im].curCell.col].left - ws.getCellLeft(0, 1);
if (t.rows && val.addImages[im].curCell && val.addImages[im].curCell.row != undefined && t.rows[val.addImages[im].curCell.row].top != undefined)
positionY = t.rows[val.addImages[im].curCell.row].top
positionY = t.rows[val.addImages[im].curCell.row].top - ws.getCellTop(0, 1);
var Drawing;
switch(first_string) {
......
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