Commit aef2240a 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@55976 954022d7-b5bf-4e40-9824-e11837661b57
parent bf5ca144
...@@ -2541,7 +2541,9 @@ ...@@ -2541,7 +2541,9 @@
else if(cloneImg.graphicObject && (cloneImg.graphicObject.isShape() || cloneImg.graphicObject.isImage() || cloneImg.graphicObject.isGroup() || cloneImg.graphicObject.isChart())) else if(cloneImg.graphicObject && (cloneImg.graphicObject.isShape() || cloneImg.graphicObject.isImage() || cloneImg.graphicObject.isGroup() || cloneImg.graphicObject.isChart()))
{ {
var cMemory = new CMemory(); var cMemory = new CMemory();
var altAttr = cloneImg.graphicObject.writeToBinaryForCopyPaste(cMemory);
var altAttr = null;
//altAttr = cloneImg.graphicObject.writeToBinaryForCopyPaste(cMemory);
var isImage = cloneImg.graphicObject.isImage(); var isImage = cloneImg.graphicObject.isImage();
var imageUrl; var imageUrl;
if(isImage) if(isImage)
...@@ -2549,7 +2551,7 @@ ...@@ -2549,7 +2551,7 @@
if(isImage && imageUrl) if(isImage && imageUrl)
url = getFullImageSrc(imageUrl); url = getFullImageSrc(imageUrl);
else else
url = cloneImg.graphicObject.getBase64Image(); url = cloneImg.graphicObject.getBase64Img();
curImage.alt = altAttr; curImage.alt = altAttr;
} }
else else
...@@ -3024,13 +3026,11 @@ ...@@ -3024,13 +3026,11 @@
_insertImagesFromBinary: function(ws, data) _insertImagesFromBinary: function(ws, data)
{ {
var activeRange = ws.activeRange; var activeRange = ws.activeRange;
var curCol; var curCol, drawingObject, curRow, startCol, startRow, xfrm;
var curRow;
var startCol;
var startRow;
var xfrm;
History.Create_NewPoint(); History.Create_NewPoint();
History.StartTransaction(); History.StartTransaction();
//определяем стартовую позицию, если изображений несколько вставляется //определяем стартовую позицию, если изображений несколько вставляется
for(var i = 0; i < data.Drawings.length; i++) for(var i = 0; i < data.Drawings.length; i++)
{ {
...@@ -3074,58 +3074,36 @@ ...@@ -3074,58 +3074,36 @@
} }
} }
} }
} };
for(var i = 0; i < data.Drawings.length; i++) for(var i = 0; i < data.Drawings.length; i++)
{ {
if(i == 0) if(i == 0)
window["Asc"]["editor"].isStartAddShape = true; window["Asc"]["editor"].isStartAddShape = true;
drawingObject = data.Drawings[i]; drawingObject = data.Drawings[i];
// Object types
if (typeof CChartAsGroup != "undefined" && drawingObject.graphicObject instanceof CChartAsGroup) { CheckSpPrXfrm(drawingObject.graphicObject);
xfrm = drawingObject.graphicObject.spPr.xfrm;
ws.objectRender.calcChartInterval(drawingObject.graphicObject.chart);
//drawingObject.graphicObject.setPosition(10,10); curCol = xfrm.offX - startCol + ws.objectRender.convertMetric(ws.cols[activeRange.c1].left - ws.getCellLeft(0, 1), 1, 3);
drawingObject.graphicObject.drawingBase = drawingObject; curRow = xfrm.offY - startRow + ws.objectRender.convertMetric(ws.rows[activeRange.r1].top - ws.getCellTop(0, 1), 1, 3);
drawingObject.graphicObject.setDrawingObjects(ws.objectRender);
if (drawingObject.graphicObject.chartTitle)
drawingObject.graphicObject.chartTitle.drawingObjects = ws.objectRender;
drawingObject.graphicObject.chart.worksheet = ws.model;
//drawingObject.graphicObject.chart.rebuildSeries();
//drawingObject.graphicObject.recalculate();
drawingObject.graphicObject.init();
drawingObject.graphicObject.addToDrawingObjects();
//aObjects.push( drawingObject );
//var boundsChecker = _this.getBoundsChecker(drawingObject);
//aBoundsCheckers.push(boundsChecker);
}
else if (drawingObject.graphicObject instanceof CShape || drawingObject.graphicObject instanceof CImageShape || drawingObject.graphicObject instanceof CGroupShape) {
xfrm = drawingObject.graphicObject.spPr.xfrm;
if(xfrm)
{
curCol = xfrm.offX - startCol + ws.objectRender.convertMetric(ws.cols[activeRange.c1].left - ws.getCellLeft(0, 1), 1, 3);
curRow = xfrm.offY - startRow + ws.objectRender.convertMetric(ws.rows[activeRange.r1].top - ws.getCellTop(0, 1), 1, 3);
drawingObject.graphicObject.setPosition(curCol, curRow);
}
else
{
curCol = drawingObject.from.col - startCol + activeRange.c1;
curRow = drawingObject.from.row - startRow + activeRange.r1;
drawingObject.graphicObject.setPosition(ws.objectRender.convertMetric(ws.cols[curCol].left, 1, 3), ws.objectRender.convertMetric(ws.rows[curRow].top, 1, 3));
}
drawingObject.graphicObject.setDrawingObjects(ws.objectRender); xfrm.setOffX(curCol);
drawingObject.graphicObject.setDrawingDocument(ws.objectRender.drawingDocument); xfrm.setOffY(curRow);
drawingObject.graphicObject.recalculate();
drawingObject = ws.objectRender.cloneDrawingObject(drawingObject);
drawingObject.graphicObject.addToDrawingObjects(); drawingObject.graphicObject.setDrawingBase(drawingObject);
drawingObject.graphicObject.select(ws.objectRender.controller);
} drawingObject.graphicObject.setDrawingObjects(ws.objectRender);
} drawingObject.graphicObject.setWorksheet(ws.model);
//drawingObject.graphicObject.setDrawingDocument(ws.objectRender.drawingDocument);
drawingObject.graphicObject.recalculate();
drawingObject.graphicObject.addToDrawingObjects();
drawingObject.graphicObject.select(ws.objectRender.controller, 0);
};
History.EndTransaction(); History.EndTransaction();
}, },
......
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