Commit 54bc7ba5 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Доработаны комбинации клавиш Shift + Ctrl + Home/End в новом параграфе.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53797 954022d7-b5bf-4e40-9824-e11837661b57
parent 2370bee1
......@@ -3287,8 +3287,13 @@ CDocument.prototype =
if ( type_Paragraph === ItemType )
{
Item.Selection.Set_EndPos(Item.Internal_GetStartPos(), -1);
Item.Selection.Set_StartPos(Item.Content.length - 1, -1);
if ( true !== Debug_ParaRunMode )
{
Item.Selection.Set_EndPos(Item.Internal_GetStartPos(), -1);
Item.Selection.Set_StartPos(Item.Content.length - 1, -1);
}
else
Item.Select_All( -1 );
}
else //if ( type_Table === ItemType )
{
......@@ -3368,8 +3373,15 @@ CDocument.prototype =
if ( type_Paragraph === ItemType )
{
Item.Selection.Set_StartPos(Item.Internal_GetStartPos(), -1);
Item.Selection.Set_EndPos(Item.Content.length - 1, -1);
if ( true !== Debug_ParaRunMode )
{
Item.Selection.Set_StartPos(Item.Internal_GetStartPos(), -1);
Item.Selection.Set_EndPos(Item.Content.length - 1, -1);
}
else
{
Item.Select_All( 1 );
}
}
else //if ( type_Table === ItemType )
{
......@@ -3384,7 +3396,7 @@ CDocument.prototype =
}
}
this.Content[StartPos].Cursor_MoveToEndPos(true);
this.Content[StartPos].Cursor_MoveToEndPos(true, false);
if ( this.Content[StartPos].GetType() === type_Paragraph )
this.Content[StartPos].Selection_Internal_Update();
......@@ -3469,7 +3481,7 @@ CDocument.prototype =
}
else
{
Item.Cursor_MoveToEndPos( true );
Item.Cursor_MoveToEndPos( false, true );
Item.Cursor_MoveLeft( 1, true, Word );
}
}
......@@ -3559,7 +3571,7 @@ CDocument.prototype =
}
else
{
Item.Cursor_MoveToEndPos( true );
Item.Cursor_MoveToEndPos( false, true );
Item.Cursor_MoveLeft( 1, true, Word );
}
}
......
......@@ -9139,6 +9139,13 @@ Paragraph.prototype =
var LinePos = this.Get_ParaPosByContentPos( TopPos );
var CurLine = LinePos.Line;
// Пересчитаем координату точки TopPos
this.Set_ParaContentPos( TopPos, CurLine, false );
this.Internal_Recalculate_CurPos(0, true, false, false );
this.CurPos.RealX = this.CurPos.X;
this.CurPos.RealY = this.CurPos.Y;
this.Selection_Remove();
if ( 0 == CurLine )
......@@ -9394,6 +9401,13 @@ Paragraph.prototype =
var LinePos = this.Get_ParaPosByContentPos( BottomPos );
var CurLine = LinePos.Line;
// Пересчитаем координату BottomPos
this.Set_ParaContentPos( BottomPos, CurLine, false );
this.Internal_Recalculate_CurPos(0, true, false, false );
this.CurPos.RealX = this.CurPos.X;
this.CurPos.RealY = this.CurPos.Y;
this.Selection_Remove();
if ( this.Lines.length - 1 == CurLine )
......@@ -9752,7 +9766,19 @@ Paragraph.prototype =
{
if ( true === AddToSelect )
{
var StartPos = null;
if ( true === this.Selection.Use )
StartPos = this.Get_ParaContentPos( true, true );
else
StartPos = this.Get_ParaContentPos( false, false );
var EndPos = this.Get_StartPos();
this.Selection.Use = true;
this.Selection.Start = false;
this.Set_SelectionContentPos( StartPos, EndPos );
}
else
{
......@@ -9766,7 +9792,7 @@ Paragraph.prototype =
}
},
Cursor_MoveToEndPos : function(AddToSelect)
Cursor_MoveToEndPos : function(AddToSelect, StartSelectFromEnd)
{
if ( true !== Debug_ParaRunMode )
{
......@@ -9815,24 +9841,43 @@ Paragraph.prototype =
{
if ( true === AddToSelect )
{
this.Selection.Use = true;
this.Selection.Start = false;
var StartPos = null;
if ( true === this.Selection.Use )
StartPos = this.Get_ParaContentPos( true, true );
else
StartPos = this.Get_ParaContentPos( false, false );
this.Selection.StartPos = this.Content.length - 1;
this.Selection.EndPos = this.Content.length - 1;
var EndPos = this.Get_EndPos(true);
this.CurPos.ContentPos = this.Content.length - 1;
this.Selection.Use = true;
this.Selection.Start = false;
this.Content[this.CurPos.ContentPos].Cursor_MoveToEndPos(true);
this.Set_SelectionContentPos( StartPos, EndPos );
}
else
{
this.Selection.Use = false;
this.Selection.Start = false;
if ( true === StartSelectFromEnd )
{
this.Selection.Use = true;
this.Selection.Start = false;
this.CurPos.ContentPos = this.Content.length - 1;
this.Content[this.CurPos.ContentPos].Cursor_MoveToEndPos();
this.Correct_ContentPos(false);
this.Selection.StartPos = this.Content.length - 1;
this.Selection.EndPos = this.Content.length - 1;
this.CurPos.ContentPos = this.Content.length - 1;
this.Content[this.CurPos.ContentPos].Cursor_MoveToEndPos(true);
}
else
{
this.Selection.Use = false;
this.Selection.Start = false;
this.CurPos.ContentPos = this.Content.length - 1;
this.Content[this.CurPos.ContentPos].Cursor_MoveToEndPos();
this.Correct_ContentPos(false);
}
}
}
},
......@@ -12236,7 +12281,7 @@ Paragraph.prototype =
}
},
Select_All : function()
Select_All : function(Direction)
{
if ( true !== Debug_ParaRunMode )
{
......@@ -12249,12 +12294,21 @@ Paragraph.prototype =
var Count = this.Content.length;
this.Selection.Use = true;
this.Selection.StartPos = 0;
this.Selection.EndPos = Count - 1;
if ( -1 === Direction )
{
this.Selection.StartPos = Count - 1;
this.Selection.EndPos = 0;
}
else
{
this.Selection.StartPos = 0;
this.Selection.EndPos = Count - 1;
}
for (var CurPos = 0; CurPos < Count; CurPos++)
{
this.Content[CurPos].Select_All();
this.Content[CurPos].Select_All(Direction);
}
}
},
......
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