Commit da2ae2bc authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug #32625 Исправлен баг при вставке.

parent 128181f5
......@@ -10369,6 +10369,7 @@ CDocument.prototype.Insert_Content = function(SelectedContent, NearPo
Para.Selection_Remove();
var bAddEmptyPara = false;
var bDoNotIncreaseDstIndex = false;
if (true === Para.Cursor_IsEnd())
{
......@@ -10378,8 +10379,12 @@ CDocument.prototype.Insert_Content = function(SelectedContent, NearPo
{
bConcatS = false;
// TODO: Возможно флаг bDoNotIncreaseDstIndex не нужен, и здесь не нужно увеличивать индекс DstIndex
if (type_Paragraph !== this.Content[DstIndex].Get_Type() || true !== this.Content[DstIndex].Is_Empty())
{
DstIndex++;
bDoNotIncreaseDstIndex = true;
}
}
else if (true === Elements[ElementsCount - 1].SelectedAll && true === bConcatS)
bAddEmptyPara = true;
......@@ -10428,7 +10433,7 @@ CDocument.prototype.Insert_Content = function(SelectedContent, NearPo
ParaS.Selection.StartPos = ParaS.Content.length - _ParaSContentLen;
ParaS.Selection.EndPos = ParaS.Content.length - 1;
}
else if (true !== Para.Cursor_IsStart())
else if (true !== Para.Cursor_IsStart() && true !== bDoNotIncreaseDstIndex)
{
DstIndex++;
}
......
......@@ -7679,6 +7679,7 @@ ParaSeparator.prototype.Copy = function()
/**
* Класс представляющий собой длинный разделитель (который в основном используется для сносок).
* @constructor
* @extends {CRunElementBase}
*/
function ParaContinuationSeparator()
{
......@@ -7686,12 +7687,12 @@ function ParaContinuationSeparator()
this.LineW = 0;
}
AscCommon.extendClass(ParaContinuationSeparator, CRunElementBase);
ParaContinuationSeparator.prototype.Type = para_ContinuationSeparator;
ParaContinuationSeparator.prototype.Get_Type = function()
ParaContinuationSeparator.prototype.Type = para_ContinuationSeparator;
ParaContinuationSeparator.prototype.Get_Type = function()
{
return para_ContinuationSeparator;
};
ParaContinuationSeparator.prototype.Draw = function(X, Y, Context, PDSE)
ParaContinuationSeparator.prototype.Draw = function(X, Y, Context, PDSE)
{
var l = X, t = PDSE.LineTop, r = X + this.Get_Width(), b = PDSE.BaseLine;
......@@ -7712,14 +7713,14 @@ ParaContinuationSeparator.prototype.Draw = function(X, Y, Context, PDSE)
Context.m_oContext.setLineDash([]);
}
};
ParaContinuationSeparator.prototype.Measure = function(Context, TextPr)
ParaContinuationSeparator.prototype.Measure = function(Context, TextPr)
{
this.Width = (50 * TEXTWIDTH_DIVIDER) | 0;
this.WidthVisible = (50 * TEXTWIDTH_DIVIDER) | 0;
this.LineW = (TextPr.FontSize / 18) * g_dKoef_pt_to_mm;
};
ParaContinuationSeparator.prototype.Copy = function()
ParaContinuationSeparator.prototype.Copy = function()
{
return new ParaContinuationSeparator();
};
......
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