Commit d81516b2 authored by Ilya.Kirillov's avatar Ilya.Kirillov

Исправлены баги 27031, 27032.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58947 954022d7-b5bf-4e40-9824-e11837661b57
parent 4ee6740e
...@@ -1493,7 +1493,7 @@ ParaRun.prototype.Recalculate_Range = function(PRS, ParaPr, Depth) ...@@ -1493,7 +1493,7 @@ ParaRun.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
}*/ }*/
this.RecalcInfo.TextPr = true; this.RecalcInfo.TextPr = true;
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All ); this.private_UpdateSpellChecking();
} }
// Сначала измеряем элементы (можно вызывать каждый раз, внутри разруливается, чтобы измерялось 1 раз) // Сначала измеряем элементы (можно вызывать каждый раз, внутри разруливается, чтобы измерялось 1 раз)
...@@ -4716,9 +4716,7 @@ ParaRun.prototype.Set_Pr = function(TextPr) ...@@ -4716,9 +4716,7 @@ ParaRun.prototype.Set_Pr = function(TextPr)
History.Add( this, { Type : historyitem_ParaRun_TextPr, New : TextPr, Old : OldValue } ); History.Add( this, { Type : historyitem_ParaRun_TextPr, New : TextPr, Old : OldValue } );
this.Recalc_CompiledPr(true); this.Recalc_CompiledPr(true);
// TODO: Орфография: пока сделаем так, в будущем надо будет переделать this.private_UpdateSpellChecking();
if(undefined !== this.Paragraph && this.Paragraph !== null)
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All );
}; };
ParaRun.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll) ParaRun.prototype.Apply_TextPr = function(TextPr, IncFontSize, ApplyToAll)
...@@ -5499,8 +5497,7 @@ ParaRun.prototype.Set_Lang2 = function(Lang) ...@@ -5499,8 +5497,7 @@ ParaRun.prototype.Set_Lang2 = function(Lang)
if ( undefined != Lang.Val ) if ( undefined != Lang.Val )
this.Set_Lang_Val( Lang.Val ); this.Set_Lang_Val( Lang.Val );
// TODO: Орфография: пока сделаем так, в будущем надо будет переделать this.private_UpdateSpellChecking();
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All );
} }
}; };
...@@ -5573,10 +5570,8 @@ ParaRun.prototype.Undo = function(Data) ...@@ -5573,10 +5570,8 @@ ParaRun.prototype.Undo = function(Data)
this.Content.splice( Data.Pos, Data.EndPos - Data.Pos + 1 ); this.Content.splice( Data.Pos, Data.EndPos - Data.Pos + 1 );
this.RecalcInfo.Measure = true; this.RecalcInfo.Measure = true;
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All ); this.private_UpdateSpellChecking();
this.private_UpdateMathResize();
if (para_Math_Run === this.Type && undefined !== this.Parent && null !== this.Parent && null !== this.Parent.ParaMath)
this.Parent.ParaMath.SetNeedResize();
break; break;
} }
...@@ -5591,10 +5586,8 @@ ParaRun.prototype.Undo = function(Data) ...@@ -5591,10 +5586,8 @@ ParaRun.prototype.Undo = function(Data)
this.Content = Array_start.concat( Data.Items, Array_end ); this.Content = Array_start.concat( Data.Items, Array_end );
this.RecalcInfo.Measure = true; this.RecalcInfo.Measure = true;
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All ); this.private_UpdateSpellChecking();
this.private_UpdateMathResize();
if (para_Math_Run === this.Type && undefined !== this.Parent && null !== this.Parent && null !== this.Parent.ParaMath)
this.Parent.ParaMath.SetNeedResize();
break; break;
} }
...@@ -5866,7 +5859,7 @@ ParaRun.prototype.Undo = function(Data) ...@@ -5866,7 +5859,7 @@ ParaRun.prototype.Undo = function(Data)
this.Pr.Lang = new CLang(); this.Pr.Lang = new CLang();
this.Recalc_CompiledPr(false); this.Recalc_CompiledPr(false);
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All ); this.private_UpdateSpellChecking();
break; break;
} }
...@@ -5879,7 +5872,7 @@ ParaRun.prototype.Undo = function(Data) ...@@ -5879,7 +5872,7 @@ ParaRun.prototype.Undo = function(Data)
this.Pr.Lang.Bidi = undefined; this.Pr.Lang.Bidi = undefined;
this.Recalc_CompiledPr(false); this.Recalc_CompiledPr(false);
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All ); this.private_UpdateSpellChecking();
break; break;
} }
...@@ -5892,7 +5885,7 @@ ParaRun.prototype.Undo = function(Data) ...@@ -5892,7 +5885,7 @@ ParaRun.prototype.Undo = function(Data)
this.Pr.Lang.EastAsia = undefined; this.Pr.Lang.EastAsia = undefined;
this.Recalc_CompiledPr(false); this.Recalc_CompiledPr(false);
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All ); this.private_UpdateSpellChecking();
break; break;
} }
...@@ -5905,7 +5898,7 @@ ParaRun.prototype.Undo = function(Data) ...@@ -5905,7 +5898,7 @@ ParaRun.prototype.Undo = function(Data)
this.Pr.Lang.Val = undefined; this.Pr.Lang.Val = undefined;
this.Recalc_CompiledPr(false); this.Recalc_CompiledPr(false);
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All ); this.private_UpdateSpellChecking();
break; break;
} }
...@@ -5952,10 +5945,8 @@ ParaRun.prototype.Redo = function(Data) ...@@ -5952,10 +5945,8 @@ ParaRun.prototype.Redo = function(Data)
this.Content = Array_start.concat( Data.Items, Array_end ); this.Content = Array_start.concat( Data.Items, Array_end );
this.RecalcInfo.Measure = true; this.RecalcInfo.Measure = true;
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All ); this.private_UpdateSpellChecking();
this.private_UpdateMathResize();
if (para_Math_Run === this.Type && undefined !== this.Parent && null !== this.Parent && null !== this.Parent.ParaMath)
this.Parent.ParaMath.SetNeedResize();
break; break;
...@@ -5966,10 +5957,8 @@ ParaRun.prototype.Redo = function(Data) ...@@ -5966,10 +5957,8 @@ ParaRun.prototype.Redo = function(Data)
this.Content.splice( Data.Pos, Data.EndPos - Data.Pos + 1 ); this.Content.splice( Data.Pos, Data.EndPos - Data.Pos + 1 );
this.RecalcInfo.Measure = true; this.RecalcInfo.Measure = true;
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All ); this.private_UpdateSpellChecking();
this.private_UpdateMathResize();
if (para_Math_Run === this.Type && undefined !== this.Parent && null !== this.Parent && null !== this.Parent.ParaMath)
this.Parent.ParaMath.SetNeedResize();
break; break;
} }
...@@ -6241,7 +6230,7 @@ ParaRun.prototype.Redo = function(Data) ...@@ -6241,7 +6230,7 @@ ParaRun.prototype.Redo = function(Data)
this.Pr.Lang = new CLang(); this.Pr.Lang = new CLang();
this.Recalc_CompiledPr(false); this.Recalc_CompiledPr(false);
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All ); this.private_UpdateSpellChecking();
break; break;
} }
...@@ -6254,7 +6243,7 @@ ParaRun.prototype.Redo = function(Data) ...@@ -6254,7 +6243,7 @@ ParaRun.prototype.Redo = function(Data)
this.Pr.Lang.Bidi = undefined; this.Pr.Lang.Bidi = undefined;
this.Recalc_CompiledPr(false); this.Recalc_CompiledPr(false);
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All ); this.private_UpdateSpellChecking();
break; break;
} }
...@@ -6267,7 +6256,7 @@ ParaRun.prototype.Redo = function(Data) ...@@ -6267,7 +6256,7 @@ ParaRun.prototype.Redo = function(Data)
this.Pr.Lang.EastAsia = undefined; this.Pr.Lang.EastAsia = undefined;
this.Recalc_CompiledPr(false); this.Recalc_CompiledPr(false);
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All ); this.private_UpdateSpellChecking();
break; break;
} }
...@@ -6280,7 +6269,7 @@ ParaRun.prototype.Redo = function(Data) ...@@ -6280,7 +6269,7 @@ ParaRun.prototype.Redo = function(Data)
this.Pr.Lang.Val = undefined; this.Pr.Lang.Val = undefined;
this.Recalc_CompiledPr(false); this.Recalc_CompiledPr(false);
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All ); this.private_UpdateSpellChecking();
break; break;
} }
...@@ -6770,12 +6759,8 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color) ...@@ -6770,12 +6759,8 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color)
} }
this.RecalcInfo.Measure = true; this.RecalcInfo.Measure = true;
this.private_UpdateSpellChecking();
if ( undefined !== this.Paragraph && null !== this.Paragraph ) this.private_UpdateMathResize();
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All );
if (para_Math_Run === this.Type && undefined !== this.Parent && null !== this.Parent && null !== this.Parent.ParaMath)
this.Parent.ParaMath.SetNeedResize();
break; break;
} }
...@@ -6800,12 +6785,8 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color) ...@@ -6800,12 +6785,8 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color)
} }
this.RecalcInfo.Measure = true; this.RecalcInfo.Measure = true;
this.private_UpdateSpellChecking();
if (undefined !== this.Paragraph && null !== this.Paragraph) this.private_UpdateMathResize();
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All );
if (para_Math_Run === this.Type && undefined !== this.Parent && null !== this.Parent && null !== this.Parent.ParaMath)
this.Parent.ParaMath.SetNeedResize();
break; break;
} }
...@@ -7191,9 +7172,7 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color) ...@@ -7191,9 +7172,7 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color)
this.Pr.Lang = new CLang(); this.Pr.Lang = new CLang();
this.Recalc_CompiledPr(true); this.Recalc_CompiledPr(true);
this.private_UpdateSpellChecking();
if ( undefined !== this.Paragraph && null !== this.Paragraph )
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All );
break; break;
} }
...@@ -7209,9 +7188,7 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color) ...@@ -7209,9 +7188,7 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color)
this.Pr.Lang.Bidi = undefined; this.Pr.Lang.Bidi = undefined;
this.Recalc_CompiledPr(true); this.Recalc_CompiledPr(true);
this.private_UpdateSpellChecking();
if ( undefined !== this.Paragraph && null !== this.Paragraph )
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All );
break; break;
} }
...@@ -7227,9 +7204,7 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color) ...@@ -7227,9 +7204,7 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color)
this.Pr.Lang.EastAsia = undefined; this.Pr.Lang.EastAsia = undefined;
this.Recalc_CompiledPr(true); this.Recalc_CompiledPr(true);
this.private_UpdateSpellChecking();
if ( undefined !== this.Paragraph && null !== this.Paragraph )
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All );
break; break;
} }
...@@ -7245,9 +7220,7 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color) ...@@ -7245,9 +7220,7 @@ ParaRun.prototype.Load_Changes = function(Reader, Reader2, Color)
this.Pr.Lang.Val = undefined; this.Pr.Lang.Val = undefined;
this.Recalc_CompiledPr(true); this.Recalc_CompiledPr(true);
this.private_UpdateSpellChecking();
if ( undefined !== this.Paragraph && null !== this.Paragraph )
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All );
break; break;
} }
...@@ -7381,6 +7354,16 @@ ParaRun.prototype.Clear_CollaborativeMarks = function() ...@@ -7381,6 +7354,16 @@ ParaRun.prototype.Clear_CollaborativeMarks = function()
{ {
this.CollaborativeMarks.Clear(); this.CollaborativeMarks.Clear();
}; };
ParaRun.prototype.private_UpdateSpellChecking = function()
{
if(undefined !== this.Paragraph && null !== this.Paragraph)
this.Paragraph.RecalcInfo.Set_Type_0_Spell(pararecalc_0_Spell_All);
};
ParaRun.prototype.private_UpdateMathResize = function()
{
if (para_Math_Run === this.Type && undefined !== this.Parent && null !== this.Parent && null !== this.Parent.ParaMath)
this.Parent.ParaMath.SetNeedResize();
};
function CParaRunSelection() function CParaRunSelection()
{ {
......
...@@ -1617,7 +1617,21 @@ CMathContent.prototype = ...@@ -1617,7 +1617,21 @@ CMathContent.prototype =
private_CorrectCurPos : function() private_CorrectCurPos : function()
{ {
this.CurPos = Math.max(0, Math.min(this.content.length - 1, this.CurPos)); if (this.CurPos > this.content.length - 1)
{
this.CurPos = this.content.length - 1;
if (para_Math_Run === this.content[this.CurPos].Type)
this.content[this.CurPos].Cursor_MoveToEndPos(false);
}
if (this.CurPos < 0)
{
this.CurPos = this.content.length - 1;
if (para_Math_Run === this.content[this.CurPos].Type)
this.content[this.CurPos].Cursor_MoveToStartPos();
}
}, },
Add_ToContent : function(Pos, Item) Add_ToContent : function(Pos, Item)
...@@ -4268,6 +4282,9 @@ CMathContent.prototype.Selection_Remove = function() ...@@ -4268,6 +4282,9 @@ CMathContent.prototype.Selection_Remove = function()
EndPos = this.Selection.Start; EndPos = this.Selection.Start;
} }
StartPos = Math.max(0, StartPos);
EndPos = Math.min(this.content.length - 1, EndPos);
for (var nPos = StartPos; nPos <= EndPos; nPos++) for (var nPos = StartPos; nPos <= EndPos; nPos++)
{ {
this.content[nPos].Selection_Remove(); this.content[nPos].Selection_Remove();
......
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