Commit e3867e0b 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@49700 954022d7-b5bf-4e40-9824-e11837661b57
parent 2b48e422
......@@ -2843,11 +2843,38 @@ function DrawingObjects() {
window.attachEvent("onmessage", this._uploadMessage);
}
}
_this.shiftMap = {};
}
_this.preCopy = function()
{
_this.shiftMap = {};
var selected_objects = _this.controller.selectedObjects;
if(selected_objects.length > 0)
{
var min_x, min_y;
min_x = selected_objects[0].x;
min_y = selected_objects[0].y;
for(var i = 1; i < selected_objects.length; ++i)
{
if(selected_objects[i].x < min_x)
min_x = selected_objects[i].x;
if(selected_objects[i].y < min_y)
min_y = selected_objects[i].y;
}
for(var i = 0; i < selected_objects.length; ++i)
{
_this.shiftMap[selected_objects[i].Get_Id()] = {x: selected_objects[i].x - min_x, y: selected_objects[i].y - min_y};
}
}
};
_this.getAllFonts = function(AllFonts) {
},
};
_this.getChartRender = function() {
return chartRender;
......
......@@ -1644,6 +1644,7 @@ CChartAsGroup.prototype =
this.recalculate();
},
getBase64Image: function()
{
return this.brush.fill.canvas.toDataURL();
......
......@@ -1640,6 +1640,12 @@ CGroupShape.prototype =
{
w.WriteLong(CLASS_TYPE_GROUP);
this.spPr.Write_ToBinary2(w);
w.WriteBool(isRealObject(this.drawingObjects.shiftMap[this.Id]));
if(isRealObject(this.drawingObjects.shiftMap[this.Id]))
{
w.WriteDouble(this.drawingObjects.shiftMap[this.Id].x);
w.WriteDouble(this.drawingObjects.shiftMap[this.Id].y);
}
w.WriteLong(this.spTree.length);
for(var i = 0; i < this.spTree.length; ++i)
{
......@@ -1660,9 +1666,15 @@ CGroupShape.prototype =
this.group = group;
this.drawingObjects = drawingObjects;
this.spPr.Read_FromBinary2(r);
var dx = 0, dy = 0;
if(r.GetBool())
{
dx = r.GetDouble();
dy = r.GetDouble();
}
if(isRealNumber(x) && isRealNumber(y))
{
this.setPosition(x, y);
this.setPosition(x + dx, y + dy);
}
var l = r.GetLong();
for(var i = 0; i < l;++i)
......
......@@ -1084,6 +1084,12 @@ CImageShape.prototype =
{
w.WriteLong(CLASS_TYPE_IMAGE);
this.blipFill.Write_ToBinary2(w);
w.WriteBool(isRealObject(this.drawingObjects.shiftMap[this.Id]));
if(isRealObject(this.drawingObjects.shiftMap[this.Id]))
{
w.WriteDouble(this.drawingObjects.shiftMap[this.Id].x);
w.WriteDouble(this.drawingObjects.shiftMap[this.Id].y);
}
this.spPr.Write_ToBinary2(w);
return "TeamLabImage" + w.pos + ";" + w.GetBase64Memory();
......@@ -1094,10 +1100,16 @@ CImageShape.prototype =
this.group = group;
this.drawingObjects = drawingObjects;
this.blipFill.Read_FromBinary2(r);
var dx = 0, dy = 0;
if(r.GetBool())
{
dx = r.GetDouble();
dy = r.GetDouble();
}
this.spPr.Read_FromBinary2(r);
if(isRealNumber(x) && isRealNumber(y))
{
this.setPosition(x, y);
this.setPosition(x + dx, y + dy);
}
if(!isRealObject(group))
......
......@@ -2876,6 +2876,12 @@ CShape.prototype =
writeToBinaryForCopyPaste: function(w)
{
w.WriteLong(CLASS_TYPE_SHAPE);
w.WriteBool(isRealObject(this.drawingObjects.shiftMap[this.Id]));
if(isRealObject(this.drawingObjects.shiftMap[this.Id]))
{
w.WriteDouble(this.drawingObjects.shiftMap[this.Id].x);
w.WriteDouble(this.drawingObjects.shiftMap[this.Id].y);
}
this.spPr.Write_ToBinary2(w);
w.WriteBool(isRealObject(this.style));
if(isRealObject(this.style))
......@@ -2895,6 +2901,12 @@ CShape.prototype =
this.group = group;
this.setDrawingObjects(drawingObjects);
var dx = 0, dy = 0;
if(r.GetBool())
{
dx = r.GetDouble();
dy = r.GetDouble();
}
this.spPr.bwMode = r.GetBool();
r.GetBool();
this.setXfrmObject(new CXfrm());
......@@ -2983,7 +2995,7 @@ CShape.prototype =
if(isRealNumber(x) && isRealNumber(y))
{
this.setPosition(x, y);
this.setPosition(x + dx, y + dy);
}
if(r.GetBool())
{
......
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