Commit 88177cb8 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

изменения во вставке картинок из word в excel

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@61580 954022d7-b5bf-4e40-9824-e11837661b57
parent 0c13a079
......@@ -3379,10 +3379,10 @@
},
_insertImagesFromBinaryWord: function(ws, data)
_insertImagesFromBinaryWord: function(ws, data, aImagesSync)
{
var activeRange = ws.activeRange;
var curCol, drawingObject, curRow, startCol = 0, startRow = 0, xfrm, drawingBase, graphicObject, aImagesSync = [], offX, offY, rot;
var curCol, drawingObject, curRow, startCol = 0, startRow = 0, xfrm, drawingBase, graphicObject, offX, offY, rot;
History.Create_NewPoint();
History.StartTransaction();
......@@ -3469,7 +3469,7 @@
startRow = drawingObject.from.row;
}
}
};
}
CheckSpPrXfrm(drawingObject.graphicObject);
xfrm = drawingObject.graphicObject.spPr.xfrm;
......@@ -3495,11 +3495,7 @@
}
drawingObject.graphicObject.recalculate();
drawingObject.graphicObject.select(ws.objectRender.controller, 0);
};
if(data._images)
aImagesSync = data._images;
}
window["Asc"]["editor"].ImageLoader.LoadDocumentImages(aImagesSync, null, ws.objectRender.asyncImagesDocumentEndLoaded);
ws.objectRender.showDrawingObjects(true);
......
......@@ -8266,8 +8266,10 @@
WorksheetView.prototype._pasteFromGlobalBuff = function (isLargeRange, isLocal, val, bIsUpdate, canChangeColWidth, onlyActive) {
var t = this;
//загрузка шрифтов, в случае удачи на callback вставляем текст
t._loadFonts(val.fontsNew, function () {
if(val.onlyImages !== true)
t._pasteFromLocalBuff(isLargeRange, isLocal, val, bIsUpdate, canChangeColWidth);
......@@ -8315,7 +8317,35 @@
}
else if(val.addImagesFromWord && val.addImagesFromWord.length != 0 && !(window["Asc"]["editor"] && window["Asc"]["editor"].isChartEditor))
{
window["Asc"]["editor"].wb.clipboard._insertImagesFromBinaryWord(t, val);
var api = window["Asc"]["editor"];
var rData = {"id": api.documentId, "c":"imgurls", "vkey": api.documentVKey, "data": JSON.stringify(val._images)};
api._asc_sendCommand(function(incomeObject){
if(incomeObject && "imgurls" == incomeObject.type)
{
var oFromTo = JSON.parse(incomeObject.data);
var nC, height, width;
var aImagesSync = [];
for(var i = 0, length = val._aPastedImages.length; i < length; ++i)
{
var sTo = oFromTo[val._aPastedImages[i].Url];
if(sTo)
{
var imageElem = val._aPastedImages[i];
if(null != imageElem)
{
var sNewSrc = oFromTo[imageElem.Url];
aImagesSync.push(sNewSrc);
if(null != sNewSrc)
imageElem.SetUrl(sNewSrc);
}
}
}
}
api.wb.clipboard._insertImagesFromBinaryWord(t, val, aImagesSync);
}, rData );
}
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