Commit 0a604120 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Переделана функция очистки текстовых настроек. Исправлен баг с падением при...

Переделана функция очистки текстовых настроек. Исправлен баг с падением при добавлении таблицы с нулевым значением колонок или строк.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55926 954022d7-b5bf-4e40-9824-e11837661b57
parent c82a4c49
......@@ -987,6 +987,20 @@ ParaComment.prototype =
{
return "";
},
Clear_TextFormatting : function( DefHyper )
{
var Count = this.Content.length;
for ( var Pos = 0; Pos < Count; Pos++ )
{
var Item = this.Content[Pos];
Item.Clear_TextFormatting( DefHyper );
if ( para_Run === Item.Type )
Item.Set_RStyle( DefHyper );
}
},
//-----------------------------------------------------------------------------------
// Функции пересчета
//-----------------------------------------------------------------------------------
......
......@@ -2375,6 +2375,9 @@ CDocument.prototype =
Add_InlineTable : function(Cols, Rows)
{
if ( Cols <= 0 || Rows <= 0 )
return;
// Добавляем таблицу в колонтитул
if ( docpostype_HdrFtr === this.CurPos.Type )
{
......
......@@ -729,6 +729,20 @@ ParaHyperlink.prototype =
for (var Index = 0; Index < Count; Index++)
this.Content[Index].Get_AllFontNames( AllFonts );
},
Clear_TextFormatting : function( DefHyper )
{
var Count = this.Content.length;
for ( var Pos = 0; Pos < Count; Pos++ )
{
var Item = this.Content[Pos];
Item.Clear_TextFormatting( DefHyper );
if ( para_Run === Item.Type )
Item.Set_RStyle( DefHyper );
}
},
//-----------------------------------------------------------------------------------
// Функции пересчета
//-----------------------------------------------------------------------------------
......
......@@ -352,6 +352,10 @@ ParaMath.prototype =
return "";
},
Clear_TextFormatting : function( DefHyper )
{
},
//-----------------------------------------------------------------------------------
// Функции пересчета
//-----------------------------------------------------------------------------------
......
......@@ -15390,35 +15390,14 @@ Paragraph.prototype =
Clear_TextFormatting : function()
{
var Styles = this.Parent.Get_Styles();
var DefHyper = Styles.Get_Default_Hyperlink();
var DefHyper = Styles.Get_Default_Hyperlink();
// TODO: Сделать, чтобы данная функция работала по выделению
for ( var Index = 0; Index < this.Content.length; Index++ )
{
var Item = this.Content[Index];
if ( para_TextPr === Item.Type )
{
Item.Set_Bold( undefined );
Item.Set_Italic( undefined );
Item.Set_Strikeout( undefined );
Item.Set_Underline( undefined );
Item.Set_FontFamily( undefined );
Item.Set_FontSize( undefined );
Item.Set_Color( undefined );
Item.Set_VertAlign( undefined );
Item.Set_HighLight( undefined );
Item.Set_Spacing( undefined );
Item.Set_DStrikeout( undefined );
Item.Set_Caps( undefined );
Item.Set_SmallCaps( undefined );
Item.Set_Position( undefined );
Item.Set_RFonts2( undefined );
Item.Set_Lang( undefined );
if ( undefined === Item.Value.RStyle || Item.Value.RStyle != DefHyper )
{
Item.Set_RStyle( undefined );
}
}
Item.Clear_TextFormatting( DefHyper );
}
},
......
......@@ -4056,6 +4056,28 @@ ParaRun.prototype =
//-----------------------------------------------------------------------------------
// Функции для работы с настройками текста свойств
//-----------------------------------------------------------------------------------
Clear_TextFormatting : function( DefHyper )
{
// Highlight и Lang не сбрасываются при очистке текстовых настроек
this.Set_Bold( undefined );
this.Set_Italic( undefined );
this.Set_Strikeout( undefined );
this.Set_Underline( undefined );
this.Set_FontSize( undefined );
this.Set_Color( undefined );
this.Set_Unifill( undefined );
this.Set_VertAlign( undefined );
this.Set_Spacing( undefined );
this.Set_DStrikeout( undefined );
this.Set_Caps( undefined );
this.Set_SmallCaps( undefined );
this.Set_Position( undefined );
this.Set_RFonts2( undefined );
this.Set_RStyle( undefined );
this.Set_Shd( undefined );
},
Get_TextPr : function()
{
return this.Pr.Copy();
......
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