Commit 72c2bef0 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Исправлен баг с выставлением текущей позиции и селекта в функции Concat_Paragraphs.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@66324 954022d7-b5bf-4e40-9824-e11837661b57
parent 62eb9d61
...@@ -14652,24 +14652,19 @@ CDocument.prototype.Concat_Paragraphs = function(Pos) ...@@ -14652,24 +14652,19 @@ CDocument.prototype.Concat_Paragraphs = function(Pos)
var OldSelectionStartPos = this.Selection.StartPos; var OldSelectionStartPos = this.Selection.StartPos;
var OldSelectionEndPos = this.Selection.EndPos; var OldSelectionEndPos = this.Selection.EndPos;
var OldCurPos = this.CurPos.ContentPos;
Para1.Concat(Para2); Para1.Concat(Para2);
this.Remove_FromContent(Pos + 1, 1); this.Remove_FromContent(Pos + 1, 1);
if (OldSelectionStartPos === Pos + 1 && OldSelectionEndPos === Pos + 1) if (OldCurPos > Pos)
{ this.CurPos.ContentPos = OldCurPos - 1;
this.Selection_Remove();
this.CurPos.ContentPos = Pos; if (OldSelectionStartPos > Pos)
Para1.Cursor_MoveToStartPos(false); this.Selection.StartPos = OldSelectionStartPos - 1;
}
else if (OldSelectionStartPos <= Pos + 1 && Pos + 1 <= OldSelectionEndPos) if (OldSelectionEndPos > Pos)
{ this.Selection.EndPos = OldSelectionEndPos - 1;
this.Selection.EndPos--;
}
else if (OldSelectionEndPos <= Pos + 1 && Pos + 1 <= OldSelectionStartPos)
{
this.Selection.StartPos--;
}
} }
}; };
CDocument.prototype.Get_ElementsCount = function() CDocument.prototype.Get_ElementsCount = function()
......
...@@ -1656,10 +1656,10 @@ CDocumentContent.prototype = ...@@ -1656,10 +1656,10 @@ CDocumentContent.prototype =
{ {
var Pos = ( true === this.Selection.Use && selectionflag_Numbering !== this.Selection.Flag ? this.Selection.EndPos : this.CurPos.ContentPos ); var Pos = ( true === this.Selection.Use && selectionflag_Numbering !== this.Selection.Flag ? this.Selection.EndPos : this.CurPos.ContentPos );
if (Pos >= 0 && Pos < this.Content.length) if (Pos >= 0 && Pos < this.Content.length)
{
return this.Content[Pos].Get_CurrentPage_Absolute(); return this.Content[Pos].Get_CurrentPage_Absolute();
}
} }
return 0;
}, },
DocumentStatistics : function(Stats) DocumentStatistics : function(Stats)
...@@ -9512,24 +9512,19 @@ CDocumentContent.prototype.Concat_Paragraphs = function(Pos) ...@@ -9512,24 +9512,19 @@ CDocumentContent.prototype.Concat_Paragraphs = function(Pos)
var OldSelectionStartPos = this.Selection.StartPos; var OldSelectionStartPos = this.Selection.StartPos;
var OldSelectionEndPos = this.Selection.EndPos; var OldSelectionEndPos = this.Selection.EndPos;
var OldCurPos = this.CurPos.ContentPos;
Para1.Concat(Para2); Para1.Concat(Para2);
this.Remove_FromContent(Pos + 1, 1); this.Remove_FromContent(Pos + 1, 1);
if (OldSelectionStartPos === Pos + 1 && OldSelectionEndPos === Pos + 1) if (OldCurPos > Pos)
{ this.CurPos.ContentPos = OldCurPos - 1;
this.Selection_Remove();
this.CurPos.ContentPos = Pos; if (OldSelectionStartPos > Pos)
Para1.Cursor_MoveToStartPos(false); this.Selection.StartPos = OldSelectionStartPos - 1;
}
else if (OldSelectionStartPos <= Pos + 1 && Pos + 1 <= OldSelectionEndPos) if (OldSelectionEndPos > Pos)
{ this.Selection.EndPos = OldSelectionEndPos - 1;
this.Selection.EndPos--;
}
else if (OldSelectionEndPos <= Pos + 1 && Pos + 1 <= OldSelectionStartPos)
{
this.Selection.StartPos--;
}
} }
}; };
CDocumentContent.prototype.Get_ElementsCount = function() CDocumentContent.prototype.Get_ElementsCount = function()
......
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