Commit 4a15f236 authored by Ilya Kirillov's avatar Ilya Kirillov

Исправлен баг cо вставкой через билдер.

parent d471eccc
...@@ -1191,17 +1191,6 @@ ...@@ -1191,17 +1191,6 @@
*/ */
ApiDocument.prototype.InsertContent = function(arrContent) ApiDocument.prototype.InsertContent = function(arrContent)
{ {
var oParagraph = this.Document.Content[this.Document.CurPos.ContentPos];
if (!oParagraph || !(oParagraph instanceof Paragraph))
return false;
var oNearestPos = {
Paragraph : oParagraph,
ContentPos : oParagraph.Get_ParaContentPos(false, false)
};
oParagraph.Check_NearestPos(oNearestPos);
var oSelectedContent = new CSelectedContent(); var oSelectedContent = new CSelectedContent();
for (var nIndex = 0, nCount = arrContent.length; nIndex < nCount; ++nIndex) for (var nIndex = 0, nCount = arrContent.length; nIndex < nCount; ++nIndex)
{ {
...@@ -1212,9 +1201,6 @@ ...@@ -1212,9 +1201,6 @@
} }
} }
if (!this.Document.Can_InsertContent(oSelectedContent, oNearestPos))
return false;
if (this.Document.Is_SelectionUse()) if (this.Document.Is_SelectionUse())
{ {
this.Document.Start_SilentMode(); this.Document.Start_SilentMode();
...@@ -1223,6 +1209,20 @@ ...@@ -1223,6 +1209,20 @@
this.Document.Selection_Remove(true); this.Document.Selection_Remove(true);
} }
var oParagraph = this.Document.Content[this.Document.CurPos.ContentPos];
if (!oParagraph || !(oParagraph instanceof Paragraph))
return false;
var oNearestPos = {
Paragraph : oParagraph,
ContentPos : oParagraph.Get_ParaContentPos(false, false)
};
oParagraph.Check_NearestPos(oNearestPos);
if (!this.Document.Can_InsertContent(oSelectedContent, oNearestPos))
return false;
this.Document.Insert_Content(oSelectedContent, oNearestPos); this.Document.Insert_Content(oSelectedContent, oNearestPos);
this.Document.Selection_Remove(true); this.Document.Selection_Remove(true);
oParagraph.Clear_NearestPosArray(); oParagraph.Clear_NearestPosArray();
......
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