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

undo/redo

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47959 954022d7-b5bf-4e40-9824-e11837661b57
parent be6dbe63
...@@ -17,7 +17,7 @@ if ( !window["Asc"] ) { // Для вставки диаграмм в Word ...@@ -17,7 +17,7 @@ if ( !window["Asc"] ) { // Для вставки диаграмм в Word
} }
function isObject(what) { function isObject(what) {
return ( what && (typeof(what) == "object") ); return ( (what != null) && (typeof(what) == "object") );
} }
function convertFormula(formula, ws) { function convertFormula(formula, ws) {
...@@ -2722,7 +2722,8 @@ function DrawingObjects() { ...@@ -2722,7 +2722,8 @@ function DrawingObjects() {
MoveX: 19, MoveX: 19,
MoveY: 20, MoveY: 20,
SizeCoeff: 21, SizeCoeff: 21,
ChartData: 22 ChartData: 22,
GraphicObject: 23
}; };
_t.id = g_oIdCounter ? g_oIdCounter.Get_NewId() : null; _t.id = g_oIdCounter ? g_oIdCounter.Get_NewId() : null;
...@@ -3018,7 +3019,7 @@ function DrawingObjects() { ...@@ -3018,7 +3019,7 @@ function DrawingObjects() {
} }
if ( g_oTableId ) if ( g_oTableId )
g_oTableId.Add( _t, _t.Id ); g_oTableId.Add( _t, _t.id );
} }
DrawingBase.prototype = { DrawingBase.prototype = {
...@@ -3066,6 +3067,7 @@ function DrawingObjects() { ...@@ -3066,6 +3067,7 @@ function DrawingObjects() {
case this.Properties.SizeCoeff: return this.size.coeff; break; case this.Properties.SizeCoeff: return this.size.coeff; break;
case this.Properties.ChartData: return this.chart; break; case this.Properties.ChartData: return this.chart; break;
case this.Properties.GraphicObject: return this.graphicObject; break;
} }
}, },
...@@ -3100,6 +3102,7 @@ function DrawingObjects() { ...@@ -3100,6 +3102,7 @@ function DrawingObjects() {
case this.Properties.SizeCoeff: this.size.coeff = value; break; case this.Properties.SizeCoeff: this.size.coeff = value; break;
case this.Properties.ChartData: this.chart = value; break; case this.Properties.ChartData: this.chart = value; break;
case this.Properties.GraphicObject: this.graphicObject = value; break;
} }
} }
} }
...@@ -3221,6 +3224,7 @@ function DrawingObjects() { ...@@ -3221,6 +3224,7 @@ function DrawingObjects() {
copyObject.size.coeff = obj.size.coeff; copyObject.size.coeff = obj.size.coeff;
copyObject.chart = new asc_CChart(obj.chart); copyObject.chart = new asc_CChart(obj.chart);
copyObject.graphicObject = obj.graphicObject;
copyObject.chart.worksheet = obj.chart.worksheet; copyObject.chart.worksheet = obj.chart.worksheet;
return copyObject; return copyObject;
...@@ -4043,8 +4047,8 @@ function DrawingObjects() { ...@@ -4043,8 +4047,8 @@ function DrawingObjects() {
obj.graphicObject = graphic; obj.graphicObject = graphic;
graphic.setDrawingBase(obj); graphic.setDrawingBase(obj);
//History.Create_NewPoint(); History.Create_NewPoint();
//History.Add(g_oUndoRedoDrawingObject, historyitem_DrawingObject_Add, worksheet.model.getId(), null, obj); History.Add(g_oUndoRedoDrawingObject, historyitem_DrawingObject_Add, worksheet.model.getId(), null, obj);
obj.graphicObject.select(_this.controller); obj.graphicObject.select(_this.controller);
aObjects.push(obj); aObjects.push(obj);
......
...@@ -614,12 +614,6 @@ ...@@ -614,12 +614,6 @@
if (event.which === 18) { if (event.which === 18) {
t.lastKeyCode = event.which; t.lastKeyCode = event.which;
} }
var graphicObjects = t.handlers.trigger("getSelectedGraphicObjects");
if ( graphicObjects.length ) {
t.handlers.trigger("graphicObjectWindowKeyDown", event);
return true;
}
// Двигаемся ли мы в выделенной области // Двигаемся ли мы в выделенной области
var selectionActivePointChanged = false; var selectionActivePointChanged = false;
...@@ -867,6 +861,12 @@ ...@@ -867,6 +861,12 @@
if ((dc !== 0 || dr !== 0) && false === t.handlers.trigger("isGlobalLockEditCell")) { if ((dc !== 0 || dr !== 0) && false === t.handlers.trigger("isGlobalLockEditCell")) {
var graphicObjects = t.handlers.trigger("getSelectedGraphicObjects");
if ( graphicObjects.length ) {
t.handlers.trigger("graphicObjectWindowKeyDown", event);
return true;
}
// Проверка на движение в выделенной области // Проверка на движение в выделенной области
if (selectionActivePointChanged) { if (selectionActivePointChanged) {
t.handlers.trigger("selectionActivePointChanged", dc, dr, t.handlers.trigger("selectionActivePointChanged", dc, dr,
......
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