Commit 2e544cf0 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

copy/paste диаграмм

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49554 954022d7-b5bf-4e40-9824-e11837661b57
parent e467763a
...@@ -2086,23 +2086,12 @@ ...@@ -2086,23 +2086,12 @@
table.appendChild(curImage); table.appendChild(curImage);
//add image or chart in local buffer //add image or chart in local buffer
if(image.graphicObject.isChart())
{
isChart = {};
isChart.chart = cloneImg.chart;
isChart.src = cloneImg.src;
isChart.height = curImage.height;
isChart.width = curImage.width;
}
else
{
t.lStorage[nLoc] = {}; t.lStorage[nLoc] = {};
t.lStorage[nLoc].image = curImage; t.lStorage[nLoc].image = curImage;
t.lStorage[nLoc].fromCol = cloneImg.from.col; t.lStorage[nLoc].fromCol = cloneImg.from.col;
t.lStorage[nLoc].fromRow = cloneImg.from.row; t.lStorage[nLoc].fromRow = cloneImg.from.row;
nLoc++; nLoc++;
isImage = true; isImage = true;
}
t._addLocalStorage(isImage,isChart,range.worksheet.getCell( new CellAddress(row, col, 0) ),bbox.r1,bbox.c1, image.from.row, image.from.col); t._addLocalStorage(isImage,isChart,range.worksheet.getCell( new CellAddress(row, col, 0) ),bbox.r1,bbox.c1, image.from.row, image.from.col);
} }
...@@ -2530,76 +2519,64 @@ ...@@ -2530,76 +2519,64 @@
var firstRange = ws.activeRange.clone(true); var firstRange = ws.activeRange.clone(true);
for(i=0;i < array.length;i++) for(i=0;i < array.length;i++)
{ {
if(typeof array[i].isChart == 'object') var binary_shape = array[i].image.getAttribute("alt");
var sub;
if(typeof binary_shape === "string")
sub = binary_shape.substr(0, 12);
if(typeof binary_shape === "string" &&( sub === "TeamLabShape" || sub === "TeamLabImage" || sub === "TeamLabChart" || sub === "TeamLabGroup"))
{ {
var activeRange = ws.activeRange; var reader = CreateBinaryReader(binary_shape, 12, binary_shape.length);
var left = ws.cols[activeRange.c1].left; reader.GetLong();
var top = ws.rows[activeRange.r1].top; if(isRealObject(reader))
var options = reader.oImages = this.oImages;
var first_string = null;
if(reader !== null && typeof reader === "object")
{ {
height: array[i].isChart.height, first_string = sub;
width: array[i].isChart.width,
left: left,
top: top
} }
ws.objectRender.addChartDrawingObject(array[i].isChart.chart,null,options); var positionX = null
} var positionY = null;
else
{ if(ws.cols && firstRange && firstRange.c1 != undefined && ws.cols[firstRange.c1].left != undefined)
var binary_shape = array[i].image.getAttribute("alt"); positionX = ws.cols[firstRange.c1].left;
var sub; if(ws.rows && firstRange && firstRange.r1 != undefined && ws.rows[firstRange.r1].top != undefined)
if(typeof binary_shape === "string") positionY = ws.rows[firstRange.r1].top
sub = binary_shape.substr(0, 12);
if(typeof binary_shape === "string" &&( sub === "TeamLabShape" || sub === "TeamLabImage" /*|| sub === "TeamLabChart" */|| sub === "TeamLabGroup")) var Drawing;
switch(first_string)
{ {
var reader = CreateBinaryReader(binary_shape, 12, binary_shape.length); case "TeamLabImage":
reader.GetLong();
if(isRealObject(reader))
reader.oImages = this.oImages;
var first_string = null;
if(reader !== null && typeof reader === "object")
{ {
first_string = sub; Drawing = new CImageShape();
break;
} }
var positionX = null case "TeamLabShape":
var positionY = null;
if(ws.cols && firstRange && firstRange.c1 != undefined && ws.cols[firstRange.c1].left != undefined)
positionX = ws.cols[firstRange.c1].left;
if(ws.rows && firstRange && firstRange.r1 != undefined && ws.rows[firstRange.r1].top != undefined)
positionY = ws.rows[firstRange.r1].top
var Drawing;
switch(first_string)
{ {
case "TeamLabImage": Drawing = new CShape();
{ break;
Drawing = new CImageShape(); }
break; case "TeamLabGroup":
} {
case "TeamLabShape": Drawing = new CGroupShape();
{ break;
Drawing = new CShape(); }
break; case "TeamLabChart":
} {
case "TeamLabGroup": Drawing = new CChartAsGroup();
{ break;
Drawing = new CGroupShape(); }
break; default :
} {
default : Drawing = CreateImageFromBinary(src);
{ break;
Drawing = CreateImageFromBinary(src);
break;
}
} }
if(positionX && positionY && ws.objectRender)
Drawing.readFromBinaryForCopyPaste(reader,null, ws.objectRender,ws.objectRender.convertMetric(positionX,1,3),ws.objectRender.convertMetric(positionY,1,3));
else
Drawing.readFromBinaryForCopyPaste(reader,null, ws.objectRender);
Drawing.drawingObjects = ws.objectRender;
Drawing.addToDrawingObjects();
} }
if(positionX && positionY && ws.objectRender)
Drawing.readFromBinaryForCopyPaste(reader,null, ws.objectRender,ws.objectRender.convertMetric(positionX,1,3),ws.objectRender.convertMetric(positionY,1,3));
else
Drawing.readFromBinaryForCopyPaste(reader,null, ws.objectRender);
Drawing.drawingObjects = ws.objectRender;
Drawing.addToDrawingObjects();
} }
} }
return true; return true;
......
...@@ -7171,7 +7171,7 @@ ...@@ -7171,7 +7171,7 @@
var sub; var sub;
if(typeof binary_shape === "string") if(typeof binary_shape === "string")
sub = binary_shape.substr(0, 12); sub = binary_shape.substr(0, 12);
if(typeof binary_shape === "string" &&( sub === "TeamLabShape" || sub === "TeamLabImage" /*|| sub === "TeamLabChart" */|| sub === "TeamLabGroup")) if(typeof binary_shape === "string" &&( sub === "TeamLabShape" || sub === "TeamLabImage" || sub === "TeamLabChart" || sub === "TeamLabGroup"))
{ {
var reader = CreateBinaryReader(binary_shape, 12, binary_shape.length); var reader = CreateBinaryReader(binary_shape, 12, binary_shape.length);
reader.GetLong(); reader.GetLong();
...@@ -7208,6 +7208,11 @@ ...@@ -7208,6 +7208,11 @@
Drawing = new CGroupShape(); Drawing = new CGroupShape();
break; break;
} }
case "TeamLabChart":
{
Drawing = new CChartAsGroup();
break;
}
default : default :
{ {
Drawing = CreateImageFromBinary(src); Drawing = CreateImageFromBinary(src);
......
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