Commit 1a310020 authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed problem with adding empty paragraphs on adding an block-level content control.

parent b601fb62
......@@ -756,22 +756,22 @@ CDocumentContentBase.prototype.private_AddContentControl = function(nContentCont
{
var oSdt = new CBlockLevelSdt(editor.WordControl.m_oLogicDocument, this);
if (oElement.IsCursorAtEnd())
if (oElement.IsCursorAtBegin())
{
this.Internal_Content_Add(this.CurPos.ContentPos + 1, oSdt);
this.CurPos.ContentPos = this.CurPos.ContentPos + 1;
this.Internal_Content_Add(this.CurPos.ContentPos, oSdt);
}
else if (oElement.IsCursorAtBegin())
else if (oElement.IsCursorAtEnd())
{
this.Internal_Content_Add(this.CurPos.ContentPos, oSdt);
this.Internal_Content_Add(this.CurPos.ContentPos + 1, oSdt);
this.CurPos.ContentPos = this.CurPos.ContentPos + 1;
}
else
{
var oNewParagraph = new Paragraph(this.DrawingDocument, this);
oElement.Split(oNewParagraph);
this.Internal_Content_Add(this.CurPos.ContentPos + 1, oNewParagraph);
this.Internal_Content_Add(this.CurPos.ContentPos + 1, oSdt);
this.Internal_Content_Add(this.CurPos.ContentPos + 2, oNewParagraph);
this.CurPos.ContentPos = this.CurPos.ContentPos + 1;
}
......
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