Commit 86a675f3 authored by Ilya.Kirillov's avatar Ilya.Kirillov

Исправлен баг с сохранением настроек текста, при удалении выделенного текста....

Исправлен баг с сохранением настроек текста, при удалении выделенного текста. Исправлен баг с запросом орфографии у текста с настройкой "Все прописные".

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47863 954022d7-b5bf-4e40-9824-e11837661b57
parent 2ff82347
......@@ -355,7 +355,7 @@ Paragraph.prototype =
}
// Передвинем все метки слов для проверки орфографии
this.SpellChecker.Update_OnAdd( this, Pos, Item.Type );
this.SpellChecker.Update_OnAdd( this, Pos, Item );
},
// Добавляем несколько элементов в конец параграфа.
......@@ -4882,6 +4882,9 @@ Paragraph.prototype =
var Hyper_start = this.Check_Hyperlink2( StartPos );
var Hyper_end = this.Check_Hyperlink2( EndPos );
// Если встречалось какое-либо изменение настроек, сохраним его последние изменение
var LastTextPr = null;
for ( var Index = StartPos; Index < EndPos; Index++ )
{
var Item = this.Content[Index];
......@@ -4890,11 +4893,10 @@ Paragraph.prototype =
var ObjId = Item.Get_Id();
this.Parent.DrawingObjects.Remove_ById( ObjId );
}
else if ( para_TextPr === Item.Type )
LastTextPr = Item;
}
// Рассчитаем стиль на конце селекта
var TextPr = this.Internal_CalculateTextPr( EndPos + 1 );
this.Internal_Content_Remove2( StartPos, EndPos - StartPos );
// После удаления позиции могли измениться
......@@ -4908,7 +4910,8 @@ Paragraph.prototype =
StartPos = Temp;
}
this.Internal_Content_Add( StartPos, new ParaTextPr( TextPr ) );
if ( null != LastTextPr )
this.Internal_Content_Add( StartPos, new ParaTextPr( LastTextPr.Value ) );
this.CurPos.ContentPos = StartPos;
this.CurPos.Line = -1;
......
......@@ -281,8 +281,9 @@ CParaSpellChecker.prototype =
this.Internal_UpdateParagraphState();
},
Update_OnAdd : function(Paragraph, Pos, ItemType)
Update_OnAdd : function(Paragraph, Pos, Item)
{
var ItemType = Item.Type;
var Left = null;
var Right = null;
......@@ -308,13 +309,17 @@ CParaSpellChecker.prototype =
var RecalcInfo = Paragraph.RecalcInfo;
RecalcInfo.Update_Spell_OnChange( Pos, 1, true );
if ( para_TextPr != ItemType && para_Numbering != ItemType )
if ( para_TextPr != ItemType )
{
var StartPos = ( null === Left ? 0 : Left.StartPos );
var EndPos = ( null === Right ? Paragraph.Content.length - 1 : Right.EndPos );
RecalcInfo.Set_Type_0_Spell(pararecalc_0_Spell_Pos, StartPos, EndPos);
}
else if ( undefined != Item.Value.Caps )
{
RecalcInfo.Set_Type_0_Spell(pararecalc_0_Spell_All);
}
else if ( para_TextPr === ItemType )
{
RecalcInfo.Set_Type_0_Spell(pararecalc_0_Spell_Lang);
......@@ -657,13 +662,21 @@ Paragraph.prototype.Continue_CheckSpelling = function()
if ( false === bWord )
{
bWord = true;
sWord = Item.Value;
nWordStart = Pos;
nWordEnd = Pos;
if ( true != CurTextPr.Caps )
sWord = Item.Value;
else
sWord = Item.Value.toUpperCase();
}
else
{
sWord += Item.Value;
if ( true != CurTextPr.Caps )
sWord += Item.Value;
else
sWord += Item.Value.toUpperCase();
nWordEnd = Pos;
}
}
......@@ -724,13 +737,21 @@ Paragraph.prototype.Continue_CheckSpelling = function()
if ( false === bWord )
{
bWord = true;
sWord = Item.Value;
nWordStart = Pos;
nWordEnd = Pos;
if ( true != CurTextPr.Caps )
sWord = Item.Value;
else
sWord = Item.Value.toUpperCase();
}
else
{
sWord += Item.Value;
if ( true != CurTextPr.Caps )
sWord += Item.Value;
else
sWord += Item.Value.toUpperCase();
nWordEnd = Pos;
}
}
......
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