Commit d9d7d1c3 authored by Sergey Konovalov's avatar Sergey Konovalov

pluginMethod_InsertDocuments to sdt

parent 5432b28b
......@@ -2021,8 +2021,8 @@ PasteProcessor.prototype =
{
if(!PasteElementsId.g_bIsDocumentCopyPaste)
return;
var paragraph = oDoc.Content[oDoc.CurPos.ContentPos];
if (null != paragraph && type_Paragraph == paragraph.GetType()) {
var paragraph = oDoc.GetCurrentParagraph();
if (null != paragraph) {
var NearPos = { Paragraph: paragraph, ContentPos: paragraph.Get_ParaContentPos(false, false) };
paragraph.Check_NearestPos(NearPos);
//делаем небольшой сдвиг по y, потому что сама точка TargetPos для двухстрочного параграфа определяется как верхняя
......@@ -2051,7 +2051,7 @@ PasteProcessor.prototype =
return;
}
oDoc.Insert_Content(oSelectedContent, NearPos);
paragraph.Parent.Insert_Content(oSelectedContent, NearPos);
if(this.oLogicDocument && this.oLogicDocument.DrawingObjects)
{
var oTargetTextObject = AscFormat.getTargetTextObject(this.oLogicDocument.DrawingObjects);
......
......@@ -2134,7 +2134,7 @@ background-repeat: no-repeat;\
t.sendEvent("asc_onError", c_oAscError.ID.MailMergeLoadFile, c_oAscError.Level.NoCritical);
return;
}
//t.WordControl.m_oLogicDocument.AddNewParagraph();
t.insertDocumentUrlsData.oSdt = t.WordControl.m_oLogicDocument.AddContentControl();
t.asc_PasteData(AscCommon.c_oAscClipboardDataFormat.Internal, 'docData;' + result, undefined, undefined, true);
});
}
......@@ -2145,6 +2145,12 @@ background-repeat: no-repeat;\
};
asc_docs_api.prototype.continueInsertDocumentUrls = function()
{
var oSdt = this.insertDocumentUrlsData.oSdt;
if(oSdt && oSdt.Content.Get_ElementsCount() > 1){
oSdt.Content.Remove_FromContent(oSdt.Content.Get_ElementsCount() - 1 , 1);
oSdt.MoveCursorToEndPos(false, false);
}
this.WordControl.m_oLogicDocument.MoveCursorRight(false, false, true);
if (this.insertDocumentUrlsData && this.insertDocumentUrlsData.documents.length > 0) {
this.asc_DownloadAs(Asc.c_oAscFileType.CANVAS_WORD);
} else {
......@@ -7510,7 +7516,7 @@ background-repeat: no-repeat;\
window.g_asc_plugins.setPluginMethodReturnAsync();
LogicDocument.Create_NewHistoryPoint(AscDFH.historydescription_Document_InsertDocumentsByUrls);
this.insertDocumentUrlsData = {imageMap: null, documents: arrDocuments, endCallback : function(_api) {
this.insertDocumentUrlsData = {imageMap: null, documents: arrDocuments, oSdt: null, endCallback : function(_api) {
if (window.g_asc_plugins)
window.g_asc_plugins.onPluginMethodReturn();
}};
......
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