Commit 168ee73d 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@56259 954022d7-b5bf-4e40-9824-e11837661b57
parent e1fdad9a
...@@ -289,7 +289,19 @@ ...@@ -289,7 +289,19 @@
this.lStorage.htmlInShape = text; this.lStorage.htmlInShape = text;
else else
{ {
var oBinaryFileWriter = new Asc.BinaryFileWriter(worksheet.model.workbook, worksheet.activeRange); var api = window["Asc"]["editor"];
var sProtocol = window.location.protocol;
var documentOrigin;
var sHost = window.location.host;
documentOrigin = "";
if(sProtocol && "" != sProtocol)
documentOrigin = sProtocol + "//" + sHost;
else
documentOrigin = sHost;
window.global_pptx_content_writer.Start_UseFullUrl(documentOrigin + g_sResourceServiceLocalUrl + api.documentId + "/");
var oBinaryFileWriter = new Asc.BinaryFileWriter(worksheet.model.workbook, worksheet.activeRange);
var sBase64 = oBinaryFileWriter.Write(); var sBase64 = oBinaryFileWriter.Write();
if(this.element.children && this.element.children.length == 1 /*&& window.USER_AGENT_SAFARI_MACOS*/) if(this.element.children && this.element.children.length == 1 /*&& window.USER_AGENT_SAFARI_MACOS*/)
{ {
...@@ -300,7 +312,9 @@ ...@@ -300,7 +312,9 @@
$(this.element.children[0]).addClass("xslData;" + sBase64); $(this.element.children[0]).addClass("xslData;" + sBase64);
//for buttons copy/paste //for buttons copy/paste
this.lStorage = sBase64; this.lStorage = sBase64;
window.global_pptx_content_writer.End_UseFullUrl()
} }
} }
...@@ -2087,12 +2101,19 @@ ...@@ -2087,12 +2101,19 @@
oOldEditor = editor; oOldEditor = editor;
//создается глобальная переменная //создается глобальная переменная
editor = { isDocumentEditor: true, WordControl: { m_oLogicDocument: newCDocument } }; editor = { isDocumentEditor: true, WordControl: { m_oLogicDocument: newCDocument } };
window.global_pptx_content_loader.Clear();
window.global_pptx_content_loader.Start_UseFullUrl();
var openParams = { checkFileSize: false, charCount: 0, parCount: 0 }; var openParams = { checkFileSize: false, charCount: 0, parCount: 0 };
History.TurnOff(); History.TurnOff();
var oBinaryFileReader = new BinaryFileReader(newCDocument, openParams); var oBinaryFileReader = new BinaryFileReader(newCDocument, openParams);
var oRes = oBinaryFileReader.ReadFromString(sBase64); var oRes = oBinaryFileReader.ReadFromString(sBase64);
History.TurnOn(); History.TurnOn();
editor = oOldEditor; editor = oOldEditor;
window.global_pptx_content_loader.End_UseFullUrl();
return oBinaryFileReader.oReadResult; return oBinaryFileReader.oReadResult;
//TODO ПРОСМОТРЕТЬ ВСЕ ЗАКОММЕНТИРОВАННЫЕ ОБЛАСТИ!!!! //TODO ПРОСМОТРЕТЬ ВСЕ ЗАКОММЕНТИРОВАННЫЕ ОБЛАСТИ!!!!
...@@ -3057,7 +3078,7 @@ ...@@ -3057,7 +3078,7 @@
_insertImagesFromBinary: function(ws, data) _insertImagesFromBinary: function(ws, data)
{ {
var activeRange = ws.activeRange; var activeRange = ws.activeRange;
var curCol, drawingObject, curRow, startCol, startRow, xfrm; var curCol, drawingObject, curRow, startCol, startRow, xfrm, aImagesSync = [];
History.Create_NewPoint(); History.Create_NewPoint();
History.StartTransaction(); History.StartTransaction();
...@@ -3133,8 +3154,13 @@ ...@@ -3133,8 +3154,13 @@
drawingObject.graphicObject.addToDrawingObjects(); drawingObject.graphicObject.addToDrawingObjects();
drawingObject.graphicObject.select(ws.objectRender.controller, 0); drawingObject.graphicObject.select(ws.objectRender.controller, 0);
if(drawingObject.graphicObject.isImage())
aImagesSync.push(drawingObject.graphicObject.getImageUrl());
}; };
window["Asc"]["editor"].ImageLoader.LoadDocumentImages(aImagesSync, null, ws.objectRender.asyncImagesDocumentEndLoaded);
ws.objectRender.showDrawingObjects(true); ws.objectRender.showDrawingObjects(true);
ws.setSelectionShape(true); ws.setSelectionShape(true);
History.EndTransaction(); History.EndTransaction();
...@@ -3143,7 +3169,7 @@ ...@@ -3143,7 +3169,7 @@
_insertImagesFromBinaryWord: function(ws, data) _insertImagesFromBinaryWord: function(ws, data)
{ {
var activeRange = ws.activeRange; var activeRange = ws.activeRange;
var curCol, drawingObject, curRow, startCol, startRow, xfrm, drawingBase, graphicObject; var curCol, drawingObject, curRow, startCol, startRow, xfrm, drawingBase, graphicObject, aImagesSync = [];
History.Create_NewPoint(); History.Create_NewPoint();
History.StartTransaction(); History.StartTransaction();
...@@ -3225,8 +3251,11 @@ ...@@ -3225,8 +3251,11 @@
drawingObject.graphicObject.addToDrawingObjects(); drawingObject.graphicObject.addToDrawingObjects();
drawingObject.graphicObject.select(ws.objectRender.controller, 0); drawingObject.graphicObject.select(ws.objectRender.controller, 0);
aImagesSync.push(drawingObject.graphicObject.getImageUrl());
}; };
window["Asc"]["editor"].ImageLoader.LoadDocumentImages(aImagesSync, null, ws.objectRender.asyncImagesDocumentEndLoaded);
ws.objectRender.showDrawingObjects(true);
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