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

Сохранение изменений в историю при перемещении, вращении, изменении размеров,...

Сохранение изменений в историю при перемещении, вращении, изменении размеров, изменении аджастментов. Поправлено падение при перемещении объектов

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47790 954022d7-b5bf-4e40-9824-e11837661b57
parent 05427571
......@@ -82,37 +82,38 @@ CGroupShape.prototype =
setPosition: function(x, y)
{
this.spPr.xfrm.offX = x;
this.spPr.xfrm.offY = y;
var model_id = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setPosition(x, y, model_id);
},
setExtents: function(extX, extY)
{
this.spPr.xfrm.extX = extX;
this.spPr.xfrm.extY = extY;
var model_id = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setExtents(extX, extY, model_id);
},
setFlips: function(flipH, flipV)
{
this.spPr.xfrm.flipH = flipH;
this.spPr.xfrm.flipV = flipV;
var model_id = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setFlips(flipH, flipV, model_id);
},
setRotate: function(rot)
{
this.spPr.xfrm.rot = rot;
var model_id = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setRotate(rot, model_id);
},
setChildExtents: function(chExtX, chExtY)
{
this.spPr.xfrm.chExtX = chExtX;
this.spPr.xfrm.chExtY = chExtY;
var model_id = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setChildExtents(chExtX, chExtY, model_id);
},
setChildOffsets: function(chOffX, chOffY)
{
this.spPr.xfrm.chOffX = chOffX;
this.spPr.xfrm.chOffY = chOffY;
var model_id = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setChildOffsets(chOffX, chOffY, model_id);
},
updateDrawingBaseCoordinates: function()
......
......@@ -121,25 +121,27 @@ CImage.prototype =
setPosition: function(x, y)
{
this.spPr.xfrm.offX = x;
this.spPr.xfrm.offY = y;
var model_id = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setPosition(x, y, model_id);
},
setExtents: function(extX, extY)
{
this.spPr.xfrm.extX = extX;
this.spPr.xfrm.extY = extY;
var model_id = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setExtents(extX, extY, model_id);
},
setFlips: function(flipH, flipV)
{
this.spPr.xfrm.flipH = flipH;
this.spPr.xfrm.flipV = flipV;
var model_id = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setFlips(flipH, flipV, model_id);
},
setRotate: function(rot)
{
this.spPr.xfrm.rot = rot;
var model_id = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setRotate(rot, model_id);
},
setRecalculateAll: function()
......@@ -151,6 +153,7 @@ CImage.prototype =
recalculateBrush: true
};
},
updateDrawingBaseCoordinates: function()
{
if(isRealObject(this.drawingBase))
......@@ -444,9 +447,9 @@ CImage.prototype =
{
checker._s();
checker._m(0, 0);
checker._l(this.absExtX, 0);
checker._l(this.absExtX, this.absExtY);
checker._l(0, this.absExtY);
checker._l(this.extX, 0);
checker._l(this.extX, this.extY);
checker._l(0, this.extY);
checker._z();
checker._e();
}
......
......@@ -106,8 +106,8 @@ CShape.prototype =
setPosition: function(x, y)
{
this.spPr.xfrm.offX = x;
this.spPr.xfrm.offY = y;
var model_id = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setPosition(x, y, model_id);
},
updateDrawingBaseCoordinates: function()
......@@ -118,19 +118,20 @@ CShape.prototype =
setExtents: function(extX, extY)
{
this.spPr.xfrm.extX = extX;
this.spPr.xfrm.extY = extY;
var model_id = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setExtents(extX, extY, model_id);
},
setFlips: function(flipH, flipV)
{
this.spPr.xfrm.flipH = flipH;
this.spPr.xfrm.flipV = flipV;
var model_id = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setFlips(flipH, flipV, model_id);
},
setRotate: function(rot)
{
this.spPr.xfrm.rot = rot;
var model_id = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setRotate(rot, model_id);
},
setPresetGeometry: function(presetGeom)
......@@ -166,32 +167,13 @@ CShape.prototype =
setAdjustmentValue: function(ref1, value1, ref2, value2)
{
if(this.spPr.geometry)
{
/*var data = {};
data.Type = historyitem_SetAdjValue;
data.ref1 = ref1;
data.newValue1 = value1;
data.ref2 = ref2;
data.newValue2 = value2;
data.oldValue1 = this.spPr.geometry.gdLst[ref1];
data.oldValue2 = this.spPr.geometry.gdLst[ref2];
History.Add(this, data);*/
var geometry = this.spPr.geometry;
if(typeof geometry.gdLst[ref1] === "number")
{
geometry.gdLst[ref1] = value1;
}
if(typeof geometry.gdLst[ref2] === "number")
{
geometry.gdLst[ref2] = value2;
}
var model_id = this.drawingObjects.getWorksheet().model.getId();
geometry.setGuideValue(ref1, value1, model_id);
geometry.setGuideValue(ref2, value2, model_id);
geometry.Recalculate(this.extX, this.extY);
/*this.calculateContent();
this.calculateTransformTextMatrix(); */
}
},
......@@ -230,7 +212,6 @@ CShape.prototype =
}
},
recalculateTransform: function()
{
var xfrm = this.spPr.xfrm;
......@@ -390,9 +371,9 @@ CShape.prototype =
{
checker._s();
checker._m(0, 0);
checker._l(this.absExtX, 0);
checker._l(this.absExtX, this.absExtY);
checker._l(0, this.absExtY);
checker._l(this.extX, 0);
checker._l(this.extX, this.extY);
checker._l(0, this.extY);
checker._z();
checker._e();
}
......@@ -828,6 +809,17 @@ CShape.prototype =
createMoveInGroupTrack: function()
{
return new MoveShapeImageTrackInGroup(this);
},
copyFromOther: function(sp)
{
this.spPr.copyFromOther(sp.spPr);
if(isRealObject(sp.style))
{
if(!isRealObject(this.style))
this.setSyle(new CShapeStyle());
this.style.copyFromOther(sp.style);
}
}
};
\ No newline at end of file
......@@ -695,6 +695,7 @@ function PreMoveState(drawingObjectsController, drawingObjects, startX, startY,
min_y = cur_rect_bounds.minY;
}
this.drawingObjectsController.changeCurrentState(new MoveState(this.drawingObjectsController, this.drawingObjects, this.startX, this.startY, min_x, min_y, max_x - min_x, max_y - min_y, this.majorObject));
this.drawingObjectsController.onMouseMove(e, x, y);
};
this.onMouseUp = function(e, x, y)
......
......@@ -76,6 +76,14 @@ var historyitem_DrawingObject_Remove = 2;
var historyitem_DrawingObject_Edit = 3;
var historyitem_DrawingLayer = 4;
var historyitem_AutoShapes_Offset = 1;
var historyitem_AutoShapes_Extents = 2;
var historyitem_AutoShapes_Child_Offset = 3;
var historyitem_AutoShapes_Child_Extents = 4;
var historyitem_AutoShapes_Rotate = 5;
var historyitem_AutoShapes_Flips = 6;
var historyitem_AutoShapes_SetGuideValue = 7;
var historyitem_Comment_Add = 1;
var historyitem_Comment_Remove = 2;
var historyitem_Comment_Change = 3;
......
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