Commit c0e02fe8 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@50317 954022d7-b5bf-4e40-9824-e11837661b57
parent 9e2587b7
......@@ -1660,6 +1660,32 @@ CChartAsGroup.prototype =
this.recalculate();
},
readFromBinaryForCopyPaste2: function(r, group, drawingObjects, x, y)
{
this.group = group;
this.drawingObjects = drawingObjects;
if(r.GetBool())
{
this.chartTitle = new CChartTitle(this, CHART_TITLE_TYPE_TITLE);
this.chartTitle.readFromBinary(r);
}
if(r.GetBool())
{
this.vAxisTitle = new CChartTitle(this, CHART_TITLE_TYPE_V_AXIS);
this.vAxisTitle.readFromBinary(r);
}
if(r.GetBool())
{
this.hAxisTitle = new CChartTitle(this, CHART_TITLE_TYPE_H_AXIS);
this.hAxisTitle.readFromBinary(r);
}
this.chart.Read_FromBinary2(r, false);
this.spPr.Read_FromBinary2(r);
if(isRealNumber(x) && isRealNumber(y))
this.spPr.xfrm.setPosition(x, y);
},
getBase64Image: function()
{
......
......@@ -183,37 +183,37 @@ CGroupShape.prototype =
setPosition: function(x, y)
{
var model_id = this.drawingObjects.getWorksheet().model.getId();
var model_id;// = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setPosition(x, y, model_id);
},
setExtents: function(extX, extY)
{
var model_id = this.drawingObjects.getWorksheet().model.getId();
var model_id;// = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setExtents(extX, extY, model_id);
},
setFlips: function(flipH, flipV)
{
var model_id = this.drawingObjects.getWorksheet().model.getId();
var model_id;// = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setFlips(flipH, flipV, model_id);
},
setRotate: function(rot)
{
var model_id = this.drawingObjects.getWorksheet().model.getId();
var model_id;// = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setRotate(rot, model_id);
},
setChildExtents: function(chExtX, chExtY)
{
var model_id = this.drawingObjects.getWorksheet().model.getId();
var model_id;// = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setChildExtents(chExtX, chExtY, model_id);
},
setChildOffsets: function(chOffX, chOffY)
{
var model_id = this.drawingObjects.getWorksheet().model.getId();
var model_id;// = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setChildOffsets(chOffX, chOffY, model_id);
},
......@@ -1738,6 +1738,55 @@ CGroupShape.prototype =
{
this.recalculate();
}
},
readFromBinaryForCopyPaste2: function(r, group, drawingObjects, x, y)
{
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 + dx, y + dy);
}
var l = r.GetLong();
for(var i = 0; i < l;++i)
{
switch (r.GetLong())
{
case CLASS_TYPE_SHAPE:
{
this.spTree[i] = new CShape(null, drawingObjects);
this.spTree[i].readFromBinaryForCopyPaste(r, this, drawingObjects);
break;
}
case CLASS_TYPE_IMAGE:
{
this.spTree[i] = new CImageShape(null, drawingObjects);
this.spTree[i].readFromBinaryForCopyPaste(r, this, drawingObjects);
break;
}
case CLASS_TYPE_GROUP:
{
this.spTree[i] = new CGroupShape(null, drawingObjects);
this.spTree[i].readFromBinaryForCopyPaste(r, this, drawingObjects);
break;
}
}
}
if(!isRealObject(group))
{
}
}
};
......
......@@ -194,26 +194,26 @@ CImageShape.prototype =
setPosition: function(x, y)
{
var model_id = this.drawingObjects.getWorksheet().model.getId();
var model_id;// = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setPosition(x, y, model_id);
},
setExtents: function(extX, extY)
{
var model_id = this.drawingObjects.getWorksheet().model.getId();
var model_id;//this.drawingObjects.getWorksheet().model = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setExtents(extX, extY, model_id);
},
setFlips: function(flipH, flipV)
{
var model_id = this.drawingObjects.getWorksheet().model.getId();
var model_id;// = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setFlips(flipH, flipV, model_id);
},
setRotate: function(rot)
{
var model_id = this.drawingObjects.getWorksheet().model.getId();
var model_id;// = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setRotate(rot, model_id);
},
......@@ -1267,5 +1267,27 @@ CImageShape.prototype =
this.calculateContent();
this.calculateTransformTextMatrix();
}
},
readFromBinaryForCopyPaste2: function(r, group, drawingObjects, x, y)
{
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 + dx, y + dy);
}
if(!isRealObject(group))
{
}
}
};
\ No newline at end of file
......@@ -1009,7 +1009,7 @@ CShape.prototype =
setPosition: function(x, y)
{
var model_id = this.drawingObjects.getWorksheet().model.getId();
var model_id;// = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setPosition(x, y, model_id);
},
......@@ -1034,19 +1034,19 @@ CShape.prototype =
setExtents: function(extX, extY)
{
var model_id = this.drawingObjects.getWorksheet().model.getId();
var model_id;// = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setExtents(extX, extY, model_id);
},
setFlips: function(flipH, flipV)
{
var model_id = this.drawingObjects.getWorksheet().model.getId();
var model_id;// = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setFlips(flipH, flipV, model_id);
},
setRotate: function(rot)
{
var model_id = this.drawingObjects.getWorksheet().model.getId();
var model_id;// = this.drawingObjects.getWorksheet().model.getId();
this.spPr.xfrm.setRotate(rot, model_id);
},
......@@ -1091,7 +1091,7 @@ CShape.prototype =
if(this.spPr.geometry)
{
var geometry = this.spPr.geometry;
var model_id = this.drawingObjects.getWorksheet().model.getId();
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);
......@@ -3058,6 +3058,121 @@ CShape.prototype =
}
},
readFromBinaryForCopyPaste2: function(r, group, drawingObjects, x, y)
{
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());
var Reader = r;
var offX, offY, extX, extY, flipH, flipV, rot;
var flag = Reader.GetBool();
if(flag)
offX = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
offY = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
extX = Reader.GetDouble();
flag = Reader.GetBool();
if(flag)
extY = Reader.GetDouble();
flag = Reader.GetBool();
flag = Reader.GetBool();
flag = Reader.GetBool();
flag = Reader.GetBool();
flag = Reader.GetBool();
if(flag)
flipH = Reader.GetBool();
flag = Reader.GetBool();
if(flag)
flipV = Reader.GetBool();
flag = Reader.GetBool();
if(flag)
rot = Reader.GetDouble();
if(isRealNumber(offX) && isRealNumber(offY))
this.setPosition(offX, offY);
if(isRealNumber(extX) && isRealNumber(extY))
this.setExtents(extX, extY);
this.setFlips(flipH, flipV);
if(isRealNumber(rot))
this.setRotate(rot);
var flag = Reader.GetBool();
if(flag)
{
var geometry = new CGeometry();
geometry.Read_FromBinary2(Reader);
this.setPresetGeometry(geometry.preset);
}
flag = Reader.GetBool();
if(flag)
{
var Fill = new CUniFill();
Fill.Read_FromBinary2(Reader);
this.setUniFill(Fill);
}
flag = Reader.GetBool();
if(flag)
{
var ln = new CLn();
ln.Read_FromBinary2(Reader);
this.setUniLine(ln);
}
if(isRealNumber(x) && isRealNumber(y))
{
this.setPosition(x + dx, y + dy);
}
if(r.GetBool())
{
var style = new CShapeStyle();
style.Read_FromBinary2(r);
this.setStyleBinary(style);
}
if(r.GetBool())
{
this.txBody = new CTextBody(this);
this.txBody.readFromBinaryForCopyPaste(r, drawingObjects.drawingDocument);
}
},
setStyleBinary: function(style)
{
......
......@@ -2288,7 +2288,53 @@ Woorksheet.prototype.clone=function(sNewId){
for(var i in this.aGCells)
oNewWs.aGCells[i] = this.aGCells[i].clone();
if(null != this.Drawings)
oNewWs.Drawings = this.Drawings.concat();
{
oNewWs.Drawings = [];
var w = new CMemory();
for(var i = 0; i < this.Drawings.length; ++i)
{
this.Drawings[i].graphicObject.writeToBinaryForCopyPaste(w);
}
var binary = w.pos + ";" + w.GetBase64Memory();
var stream = CreateBinaryReader(binary, 0, binary.length);
var drawingObjects = new DrawingObjects();
for(var i = 0; i < this.Drawings.length; ++i)
{
var obj = null;
switch(stream.GetLong())
{
case CLASS_TYPE_SHAPE:
{
obj = new CShape(null, null, null);
break;
}
case CLASS_TYPE_IMAGE:
{
obj = new CImageShape(null, null);
break;
}
case CLASS_TYPE_GROUP:
{
obj = new CGroupShape(null, null);
break;
}
case CLASS_TYPE_CHART:
{
obj = new CChartAsGroup(null, null);
break;
}
}
if(isRealObject(obj))
{
var drawingObject = drawingObjects.createDrawingObject();
obj.readFromBinaryForCopyPaste2(stream, null, null, null, null);
drawingObject.graphicObject = obj;
oNewWs.Drawings.push(drawingObject);
}
}
//oNewWs.Drawings = this.Drawings.concat();
}
if(null != this.aComments) {
for (var i = 0; i < this.aComments.length; i++) {
var comment = new asc_CCommentData(this.aComments[i]);
......
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