Commit b89d02d8 authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug #34540

parent fac01b2d
...@@ -11914,26 +11914,43 @@ CDocument.prototype.controller_AddToParagraph = function(ParaItem, bRecalculate) ...@@ -11914,26 +11914,43 @@ CDocument.prototype.controller_AddToParagraph = function(ParaItem, bRecalculate)
var Item = this.Content[this.CurPos.ContentPos]; var Item = this.Content[this.CurPos.ContentPos];
var ItemType = Item.GetType(); var ItemType = Item.GetType();
if (para_NewLine === ParaItem.Type && true === ParaItem.Is_PageOrColumnBreak()) if (para_NewLine === ParaItem.Type && true === ParaItem.IsPageOrColumnBreak())
{ {
if (type_Paragraph === ItemType) if (type_Paragraph === ItemType)
{ {
if (true === Item.Cursor_IsStart()) if (true === Item.Cursor_IsStart())
{ {
this.Add_NewParagraph(undefined, true); if (ParaItem.IsColumnBreak())
var CurPos = this.CurPos.ContentPos - 1; {
this.Content[CurPos].Cursor_MoveToStartPos(); this.Content[this.CurPos.ContentPos].Add(ParaItem);
this.Content[CurPos].Add(ParaItem); }
this.Content[CurPos].Clear_Formatting(); else
{
this.Add_NewParagraph(undefined, true);
var CurPos = this.CurPos.ContentPos - 1;
this.Content[CurPos].Cursor_MoveToStartPos();
this.Content[CurPos].Add(ParaItem);
this.Content[CurPos].Clear_Formatting();
}
} }
else else
{ {
this.Add_NewParagraph(undefined, true); if (ParaItem.IsColumnBreak())
this.Add_NewParagraph(undefined, true); {
var CurPos = this.CurPos.ContentPos - 1; this.Add_NewParagraph(undefined, true);
this.Content[CurPos].Cursor_MoveToStartPos(); var CurPos = this.CurPos.ContentPos;
this.Content[CurPos].Add(ParaItem); this.Content[CurPos].Cursor_MoveToStartPos();
this.Content[CurPos].Clear_Formatting(); this.Content[CurPos].Add(ParaItem);
}
else
{
this.Add_NewParagraph(undefined, true);
this.Add_NewParagraph(undefined, true);
var CurPos = this.CurPos.ContentPos - 1;
this.Content[CurPos].Cursor_MoveToStartPos();
this.Content[CurPos].Add(ParaItem);
this.Content[CurPos].Clear_Formatting();
}
} }
if (false != bRecalculate) if (false != bRecalculate)
......
...@@ -1109,6 +1109,19 @@ ParaNewLine.prototype = ...@@ -1109,6 +1109,19 @@ ParaNewLine.prototype =
return false; return false;
} }
}; };
ParaNewLine.prototype.IsPageOrColumnBreak = function()
{
return (break_Page === this.BreakType || break_Column === this.BreakType);
};
ParaNewLine.prototype.IsPageBreak = function()
{
return (break_Page === this.BreakType);
};
ParaNewLine.prototype.IsColumnBreak = function()
{
return (break_Column === this.BreakType);
};
// Класс ParaNumbering // Класс ParaNumbering
function ParaNumbering() function ParaNumbering()
......
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