Commit e7924d10 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@51080 954022d7-b5bf-4e40-9824-e11837661b57
parent 1f2d3062
...@@ -1786,6 +1786,67 @@ CChartAsGroup.prototype = ...@@ -1786,6 +1786,67 @@ CChartAsGroup.prototype =
this.addToDrawingObjects(); 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) writeToBinaryForCopyPaste: function(w)
{ {
w.WriteLong(CLASS_TYPE_CHART_AS_GROUP); w.WriteLong(CLASS_TYPE_CHART_AS_GROUP);
......
...@@ -1114,12 +1114,17 @@ CGroupShape.prototype = ...@@ -1114,12 +1114,17 @@ CGroupShape.prototype =
break; break;
} }
} }
this.resetSelection(drawingObjectsController);
}, },
resetSelection: function(drawingObjectsController) resetSelection: function(drawingObjectsController)
{ {
while(this.selectedObjects.length > 0) var count = this.selectedObjects.length;
while(count > 0)
{
this.selectedObjects[0].deselect(drawingObjectsController); this.selectedObjects[0].deselect(drawingObjectsController);
--count;
}
}, },
createRotateTrack: function() createRotateTrack: function()
...@@ -1691,11 +1696,22 @@ CGroupShape.prototype = ...@@ -1691,11 +1696,22 @@ CGroupShape.prototype =
this.spPr = pr; 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; readFromBinaryForCopyPaste: function(r, group, drawingObjects, x, y)
this.drawingObjects = drawingObjects; {
this.setGroup(group);
this.setDrawingObjects(drawingObjects);
this.spPr.Read_FromBinary2(r); this.spPr.Read_FromBinary2(r);
var dx = 0, dy = 0; var dx = 0, dy = 0;
if(r.GetBool()) if(r.GetBool())
......
...@@ -1255,6 +1255,18 @@ CImageShape.prototype = ...@@ -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) readFromBinaryForCopyPaste: function(r, group, drawingObjects, x, y)
{ {
this.group = group; this.group = group;
......
...@@ -3020,9 +3020,21 @@ CShape.prototype = ...@@ -3020,9 +3020,21 @@ CShape.prototype =
return "TeamLabShapeSheets" + w.pos + ";" + w.GetBase64Memory(); 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) readFromBinaryForCopyPaste: function(r, group, drawingObjects, x, y)
{ {
this.group = group; this.setGroup(group);
this.setDrawingObjects(drawingObjects); this.setDrawingObjects(drawingObjects);
var dx = 0, dy = 0; var dx = 0, dy = 0;
...@@ -3146,7 +3158,7 @@ CShape.prototype = ...@@ -3146,7 +3158,7 @@ CShape.prototype =
readFromBinaryForCopyPaste2: function(r, group, drawingObjects, x, y) readFromBinaryForCopyPaste2: function(r, group, drawingObjects, x, y)
{ {
this.group = group; this.setGroup(group);
this.setDrawingObjects(drawingObjects); this.setDrawingObjects(drawingObjects);
var dx = 0, dy = 0; var dx = 0, dy = 0;
......
...@@ -2612,34 +2612,47 @@ function MoveState(drawingObjectsController, drawingObjects, startX, startY, rec ...@@ -2612,34 +2612,47 @@ function MoveState(drawingObjectsController, drawingObjects, startX, startY, rec
{ {
var isViewMode = this.drawingObjectsController.drawingObjects.isViewerMode(); var isViewMode = this.drawingObjectsController.drawingObjects.isViewerMode();
var worksheet = this.drawingObjects.getWorksheet(); var worksheet = this.drawingObjects.getWorksheet();
this.drawingObjects.objectLocker.reset();
var track_objects = this.drawingObjectsController.arrTrackObjects; 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) if(!isViewMode)
{ {
for(var i =0; i < track_objects.length; ++i) if(!ctrlKey)
{ {
this.drawingObjects.objectLocker.addObjectId(track_objects[i].originalObject.Get_Id()); this.drawingObjects.objectLocker.reset();
} for(var i =0; i < track_objects.length; ++i)
var track_objects2 = []; {
for(i = 0; i < track_objects.length; ++i) this.drawingObjects.objectLocker.addObjectId(track_objects[i].originalObject.Get_Id());
{ }
track_objects2.push(track_objects[i]); 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(); var copy = track_objects2[i].originalObject.copy(track_objects2[i].x, track_objects2[i].y);
for(var i = 0; i < track_objects2.length; ++i) copy.select(this.drawingObjects.controller);
track_objects2[i].trackEnd(); copy.addToDrawingObjects();
drawingObjects.showDrawingObjects(true);
} }
}; }
this.drawingObjects.objectLocker.checkObjects(callback);
} }
//History.Create_NewPoint(); //History.Create_NewPoint();
//this.drawingObjectsController.trackEnd(); //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