Commit fa18501b authored by Dmitry.Vikulov's avatar Dmitry.Vikulov

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

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


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