Commit 16adba39 authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

Поправила перемещение по стрелкам с зажатым shift : не возвращались обратно...

Поправила перемещение по стрелкам с зажатым shift : не возвращались обратно внутрь контента при перемещнии, если он не был первым (для стрелки вправо) или последним (для стрелки влево) в мат объекте

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56965 954022d7-b5bf-4e40-9824-e11837661b57
parent 27142cb7
"use strict"; "use strict";
var CENTER = -1;
function CMathBase() function CMathBase()
{ {
this.typeObj = MATH_COMP; this.typeObj = MATH_COMP;
...@@ -1514,14 +1513,17 @@ CMathBase.prototype = ...@@ -1514,14 +1513,17 @@ CMathBase.prototype =
CurPos_X = ContentPos.Get(Depth); CurPos_X = ContentPos.Get(Depth);
CurPos_Y = ContentPos.Get(Depth + 1); CurPos_Y = ContentPos.Get(Depth + 1);
} }
else if(SearchPos.ForSelection == true && this.SelectEnd.bOutside === true)
{
CurPos_X = this.SelectEnd.X;
CurPos_Y = this.SelectEnd.Y;
}
else else
{ {
CurPos_X = this.nRow - 1; CurPos_X = this.nRow - 1;
CurPos_Y = this.nCol - 1; CurPos_Y = this.nCol - 1;
} }
//var bUseContent = UseContentPos;
while(CurPos_X >= 0) while(CurPos_X >= 0)
{ {
while(CurPos_Y >= 0) while(CurPos_Y >= 0)
...@@ -1568,24 +1570,27 @@ CMathBase.prototype = ...@@ -1568,24 +1570,27 @@ CMathBase.prototype =
CurPos_X = ContentPos.Get(Depth); CurPos_X = ContentPos.Get(Depth);
CurPos_Y = ContentPos.Get(Depth + 1); CurPos_Y = ContentPos.Get(Depth + 1);
} }
else if(SearchPos.ForSelection == true && this.SelectEnd.bOutside === true)
{
CurPos_X = this.SelectEnd.X;
CurPos_Y = this.SelectEnd.Y;
}
else else
{ {
CurPos_X = 0; CurPos_X = 0;
CurPos_Y = 0; CurPos_Y = 0;
} }
var bUseContent = UseContentPos;
while(CurPos_X < this.nRow) while(CurPos_X < this.nRow)
{ {
while(CurPos_Y < this.nCol) while(CurPos_Y < this.nCol)
{ {
var bJDraw = this.elements[CurPos_X][CurPos_Y].IsJustDraw(), var bJDraw = this.elements[CurPos_X][CurPos_Y].IsJustDraw(),
usePlh = !bJDraw && bUseContent && this.elements[CurPos_X][CurPos_Y].IsPlaceholder(); usePlh = !bJDraw && UseContentPos && this.elements[CurPos_X][CurPos_Y].IsPlaceholder();
if(!bJDraw && !usePlh) if(!bJDraw && !usePlh)
{ {
this.elements[CurPos_X][CurPos_Y].Get_RightPos(SearchPos, ContentPos, Depth + 2, bUseContent, StepEnd, BegRun); this.elements[CurPos_X][CurPos_Y].Get_RightPos(SearchPos, ContentPos, Depth + 2, UseContentPos, StepEnd, BegRun);
SearchPos.Pos.Update(CurPos_X, Depth); SearchPos.Pos.Update(CurPos_X, Depth);
SearchPos.Pos.Update(CurPos_Y, Depth+1); SearchPos.Pos.Update(CurPos_Y, Depth+1);
} }
...@@ -1595,7 +1600,7 @@ CMathBase.prototype = ...@@ -1595,7 +1600,7 @@ CMathBase.prototype =
CurPos_Y++; CurPos_Y++;
bUseContent = false; UseContentPos = false;
BegRun = true; BegRun = true;
} }
...@@ -1609,8 +1614,10 @@ CMathBase.prototype = ...@@ -1609,8 +1614,10 @@ CMathBase.prototype =
result = SearchPos.Found; result = SearchPos.Found;
return result; var str = "Start: Outside " + this.SelectStart.bOutside + ", X " + this.SelectStart.X + ", Y " + this.SelectStart.Y + " ; " + "End: Outside " + this.SelectEnd.bOutside + ", X " + this.SelectEnd.X + ", Y " + this.SelectEnd.Y;
console.log(str);
return result;
}, },
old_Get_WordStartPos : function(SearchPos, ContentPos, Depth, UseContentPos) old_Get_WordStartPos : function(SearchPos, ContentPos, Depth, UseContentPos)
{ {
......
...@@ -6444,7 +6444,6 @@ CMathContent.prototype = ...@@ -6444,7 +6444,6 @@ CMathContent.prototype =
var result = false; var result = false;
var CurPos = UseContentPos ? ContentPos.Get(Depth) : 0; var CurPos = UseContentPos ? ContentPos.Get(Depth) : 0;
var bUseContent = UseContentPos;
while(CurPos < this.content.length && SearchPos.Found == false) while(CurPos < this.content.length && SearchPos.Found == false)
{ {
...@@ -6461,10 +6460,8 @@ CMathContent.prototype = ...@@ -6461,10 +6460,8 @@ CMathContent.prototype =
var bNotshift = SearchPos.ForSelection == false, var bNotshift = SearchPos.ForSelection == false,
bShiftCurrObj = SearchPos.ForSelection == true && this.SelectStartPos == CurPos; bShiftCurrObj = SearchPos.ForSelection == true && this.SelectStartPos == CurPos;
//console.log("Get_RightPos : CurPos " + CurPos + " SelectStartPos " + this.SelectStartPos);
if( bNotshift || bShiftCurrObj ) if( bNotshift || bShiftCurrObj )
this.content[CurPos].Get_RightPos(SearchPos, ContentPos, Depth + 1, bUseContent, StepEnd, BegRun); this.content[CurPos].Get_RightPos(SearchPos, ContentPos, Depth + 1, UseContentPos, StepEnd, BegRun);
} }
else if(BegRun) else if(BegRun)
{ {
...@@ -6473,7 +6470,7 @@ CMathContent.prototype = ...@@ -6473,7 +6470,7 @@ CMathContent.prototype =
} }
else else
{ {
this.content[CurPos].Get_RightPos(SearchPos, ContentPos, Depth + 1, bUseContent, StepEnd); this.content[CurPos].Get_RightPos(SearchPos, ContentPos, Depth + 1, UseContentPos, StepEnd);
} }
SearchPos.Pos.Update(CurPos, Depth); SearchPos.Pos.Update(CurPos, Depth);
...@@ -6485,7 +6482,7 @@ CMathContent.prototype = ...@@ -6485,7 +6482,7 @@ CMathContent.prototype =
BegRun = true; BegRun = true;
CurPos++; CurPos++;
bUseContent = false; UseContentPos = false;
} }
......
...@@ -25,7 +25,7 @@ function CMathMatrix(props) ...@@ -25,7 +25,7 @@ function CMathMatrix(props)
rSp: 0, rSp: 0,
rSpRule: 0, rSpRule: 0,
mcs: new Array(), mcs: new Array(),
baseJc: BASEJC_CENTER, baseJc: BASEJC_CENTER,
plcHide: false plcHide: false
}; };
...@@ -42,7 +42,6 @@ function CMathMatrix(props) ...@@ -42,7 +42,6 @@ function CMathMatrix(props)
if(props !== null && typeof(props) !== "undefined") if(props !== null && typeof(props) !== "undefined")
this.init(props); this.init(props);
//this.constructor.superclass.init.call(this, props);
g_oTableId.Add( this, this.Id ); g_oTableId.Add( this, this.Id );
} }
......
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