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

git-svn-id:...

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51080 954022d7-b5bf-4e40-9824-e11837661b57
parent 1f2d3062
......@@ -1786,6 +1786,67 @@ CChartAsGroup.prototype =
this.addToDrawingObjects();
},
normalize: function()
{
var new_off_x, new_off_y, new_ext_x, new_ext_y;
var xfrm = this.spPr.xfrm;
if(!isRealObject(this.group))
{
new_off_x = xfrm.offX;
new_off_y = xfrm.offY;
new_ext_x = xfrm.extX;
new_ext_y = xfrm.extY;
}
else
{
var scale_scale_coefficients = this.group.getResultScaleCoefficients();
new_off_x = scale_scale_coefficients.cx*(xfrm.offX - this.group.spPr.xfrm.chOffX);
new_off_y = scale_scale_coefficients.cy*(xfrm.offY - this.group.spPr.xfrm.chOffY);
new_ext_x = scale_scale_coefficients.cx*xfrm.extX;
new_ext_y = scale_scale_coefficients.cy*xfrm.extY;
}
this.setPosition(new_off_x, new_off_y);
this.setExtents(new_ext_x, new_ext_y);
},
getFullFlipH: function()
{
return false;
},
getFullFlipV: function()
{
return false;
},
getFullRotate: function()
{
return !isRealObject(this.group) ? 0 : this.group.getFullRotate();
},
setFlips: function()
{},
setRotate: function()
{},
copy: function(x, y)
{
var w = new CMemory();
var bin = this.writeToBinaryForCopyPaste(w);
bin = bin.substring("TeamLabChartSheets".length, bin.length - "TeamLabGroupSheets".length);
var r = CreateBinaryReader(bin, 0, bin.length);
var copy = new CChartAsGroup(null,this.drawingObjects);
r.GetLong();
copy.readFromBinaryForCopyPaste(r, null, this.drawingObjects, x, y);
return copy;
},
writeToBinaryForCopyPaste: function(w)
{
w.WriteLong(CLASS_TYPE_CHART_AS_GROUP);
......
......@@ -1114,12 +1114,17 @@ CGroupShape.prototype =
break;
}
}
this.resetSelection(drawingObjectsController);
},
resetSelection: function(drawingObjectsController)
{
while(this.selectedObjects.length > 0)
var count = this.selectedObjects.length;
while(count > 0)
{
this.selectedObjects[0].deselect(drawingObjectsController);
--count;
}
},
createRotateTrack: function()
......@@ -1691,11 +1696,22 @@ CGroupShape.prototype =
this.spPr = pr;
},
readFromBinaryForCopyPaste: function(r, group, drawingObjects, x, y)
copy: function(x, y)
{
var w = new CMemory();
var bin = this.writeToBinaryForCopyPaste(w);
bin = bin.substring("TeamLabGroupSheets".length, bin.length - "TeamLabGroupSheets".length);
var r = CreateBinaryReader(bin, 0, bin.length);
var copy = new CGroupShape(null,this.drawingObjects);
r.GetLong();
copy.readFromBinaryForCopyPaste(r, null, this.drawingObjects, x, y);
return copy;
},
this.group = group;
this.drawingObjects = drawingObjects;
readFromBinaryForCopyPaste: function(r, group, drawingObjects, x, y)
{
this.setGroup(group);
this.setDrawingObjects(drawingObjects);
this.spPr.Read_FromBinary2(r);
var dx = 0, dy = 0;
if(r.GetBool())
......
......@@ -1255,6 +1255,18 @@ CImageShape.prototype =
},
copy: function(x, y)
{
var w = new CMemory();
var bin = this.writeToBinaryForCopyPaste(w);
bin = bin.substring("TeamLabImageSheets".length, bin.length - "TeamLabImageSheets".length);
var r = CreateBinaryReader(bin, 0, bin.length);
var copy = new CImageShape(null,this.drawingObjects);
r.GetLong();
copy.readFromBinaryForCopyPaste(r, null, this.drawingObjects, x, y);
return copy;
},
readFromBinaryForCopyPaste: function(r, group, drawingObjects, x, y)
{
this.group = group;
......
......@@ -3020,9 +3020,21 @@ CShape.prototype =
return "TeamLabShapeSheets" + w.pos + ";" + w.GetBase64Memory();
},
copy: function(x, y)
{
var w = new CMemory();
var bin = this.writeToBinaryForCopyPaste(w);
bin = bin.substring("TeamLabShapeSheets".length, bin.length - "TeamLabShapeSheets".length);
var r = CreateBinaryReader(bin, 0, bin.length);
var copy = new CShape(null,this.drawingObjects, null);
r.GetLong();
copy.readFromBinaryForCopyPaste(r, null, this.drawingObjects, x, y);
return copy;
},
readFromBinaryForCopyPaste: function(r, group, drawingObjects, x, y)
{
this.group = group;
this.setGroup(group);
this.setDrawingObjects(drawingObjects);
var dx = 0, dy = 0;
......@@ -3146,7 +3158,7 @@ CShape.prototype =
readFromBinaryForCopyPaste2: function(r, group, drawingObjects, x, y)
{
this.group = group;
this.setGroup(group);
this.setDrawingObjects(drawingObjects);
var dx = 0, dy = 0;
......
......@@ -2612,34 +2612,47 @@ function MoveState(drawingObjectsController, drawingObjects, startX, startY, rec
{
var isViewMode = this.drawingObjectsController.drawingObjects.isViewerMode();
var worksheet = this.drawingObjects.getWorksheet();
this.drawingObjects.objectLocker.reset();
var track_objects = this.drawingObjectsController.arrTrackObjects;
var ctrlKey = e.ctrlKey;
var track_objects2 = [];
for(i = 0; i < track_objects.length; ++i)
{
track_objects2.push(track_objects[i]);
}
if(!isViewMode)
{
for(var i =0; i < track_objects.length; ++i)
if(!ctrlKey)
{
this.drawingObjects.objectLocker.addObjectId(track_objects[i].originalObject.Get_Id());
}
var track_objects2 = [];
for(i = 0; i < track_objects.length; ++i)
{
track_objects2.push(track_objects[i]);
}
this.drawingObjects.objectLocker.reset();
for(var i =0; i < track_objects.length; ++i)
{
this.drawingObjects.objectLocker.addObjectId(track_objects[i].originalObject.Get_Id());
}
var drawingObjects = this.drawingObjects;
var callback = function(bLock)
{
if(bLock)
{
History.Create_NewPoint();
for(var i = 0; i < track_objects2.length; ++i)
track_objects2[i].trackEnd();
drawingObjects.showDrawingObjects(true);
var drawingObjects = this.drawingObjects;
var callback = function(bLock)
}
};
this.drawingObjects.objectLocker.checkObjects(callback);
}
else
{
if(bLock)
this.drawingObjectsController.resetSelection();
History.Create_NewPoint();
for(var i = 0; i < track_objects2.length; ++i)
{
History.Create_NewPoint();
for(var i = 0; i < track_objects2.length; ++i)
track_objects2[i].trackEnd();
drawingObjects.showDrawingObjects(true);
var copy = track_objects2[i].originalObject.copy(track_objects2[i].x, track_objects2[i].y);
copy.select(this.drawingObjects.controller);
copy.addToDrawingObjects();
}
};
this.drawingObjects.objectLocker.checkObjects(callback);
}
}
//History.Create_NewPoint();
//this.drawingObjectsController.trackEnd();
......
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