Commit 77241ba3 authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Исправлен баг с выставлением заливки параграфа (баг 20531).

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50424 954022d7-b5bf-4e40-9824-e11837661b57
parent a5c8c67a
......@@ -49,6 +49,7 @@ var historyitem_Paragraph_Pr = 31; // Изменяем с
var historyitem_Paragraph_PresentationPr_Bullet = 32; // Изменяем свойства нумерации у параграфа в презентации
var historyitem_Paragraph_PresentationPr_Level = 33; // Изменяем уровень параграфа в презентациях
var historyitem_Paragraph_FramePr = 34; // Изменяем настройки рамки
var historyitem_Paragraph_Shd = 35; // Изменяем настройки заливки целиком
// Типы изменений в классе ParaTextPr
var historyitem_TextPr_Change = 1; // Изменяем настройку
......
......@@ -9346,7 +9346,7 @@ Paragraph.prototype =
this.Set_KeepNext( undefined );
this.Set_PageBreakBefore( undefined );
this.Set_Spacing( new CParaSpacing(), true );
this.Set_Shd( new CDocumentShd(), true );
this.Set_Shd( undefined, true );
this.Set_WidowControl( undefined );
this.Set_Tabs( new CParaTabs() );
this.Set_Border( undefined, historyitem_Paragraph_Borders_Between );
......@@ -9561,22 +9561,33 @@ Paragraph.prototype =
Set_Shd : function(_Shd, bDeleteUndefined)
{
var Shd = new CDocumentShd();
Shd.Set_FromObject( _Shd );
if ( undefined === this.Pr.Shd )
this.Pr.Shd = new CDocumentShd();
if ( ( undefined != Shd.Value || true === bDeleteUndefined ) && this.Pr.Shd.Value !== Shd.Value )
if ( undefined === _Shd )
{
History.Add( this, { Type : historyitem_Paragraph_Shd_Value, New : Shd.Value, Old : ( undefined != this.Pr.Shd.Value ? this.Pr.Shd.Value : undefined ) } );
this.Pr.Shd.Value = Shd.Value;
if ( undefined != this.Pr.Shd )
{
History.Add( this, { Type : historyitem_Paragraph_Shd, New : undefined, Old : this.Pr.Shd } );
this.Pr.Shd = undefined;
}
}
if ( undefined != Shd.Color || true === bDeleteUndefined )
else
{
History.Add( this, { Type : historyitem_Paragraph_Shd_Color, New : Shd.Color, Old : ( undefined != this.Pr.Shd.Color ? this.Pr.Shd.Color : undefined ) } );
this.Pr.Shd.Color = Shd.Color;
var Shd = new CDocumentShd();
Shd.Set_FromObject( _Shd );
if ( undefined === this.Pr.Shd )
this.Pr.Shd = new CDocumentShd();
if ( ( undefined != Shd.Value || true === bDeleteUndefined ) && this.Pr.Shd.Value !== Shd.Value )
{
History.Add( this, { Type : historyitem_Paragraph_Shd_Value, New : Shd.Value, Old : ( undefined != this.Pr.Shd.Value ? this.Pr.Shd.Value : undefined ) } );
this.Pr.Shd.Value = Shd.Value;
}
if ( undefined != Shd.Color || true === bDeleteUndefined )
{
History.Add( this, { Type : historyitem_Paragraph_Shd_Color, New : Shd.Color, Old : ( undefined != this.Pr.Shd.Color ? this.Pr.Shd.Color : undefined ) } );
this.Pr.Shd.Color = Shd.Color;
}
}
// Надо пересчитать конечный стиль
......@@ -11627,6 +11638,15 @@ Paragraph.prototype =
break;
}
case historyitem_Paragraph_Shd:
{
this.Pr.Shd = Data.Old;
this.CompiledPr.NeedRecalc = true;
break;
}
case historyitem_Paragraph_WidowControl:
{
this.Pr.WidowControl = Data.Old;
......@@ -11979,6 +11999,16 @@ Paragraph.prototype =
break;
}
case historyitem_Paragraph_Shd:
{
this.Pr.Shd = Data.New;
this.CompiledPr.NeedRecalc = true;
break;
}
case historyitem_Paragraph_WidowControl:
{
this.Pr.WidowControl = Data.New;
......@@ -12239,6 +12269,7 @@ Paragraph.prototype =
}
case historyitem_Paragraph_Shd_Value:
case historyitem_Paragraph_Shd_Color:
case historyitem_Paragraph_Shd:
case historyitem_Paragraph_DocNext:
case historyitem_Paragraph_DocPrev:
{
......@@ -12583,6 +12614,26 @@ Paragraph.prototype =
break;
}
case historyitem_Paragraph_Shd:
{
// Bool : IsUndefined
// Если false
// Variable : Shd (CDocumentShd)
var New = Data.New;
if ( undefined != New )
{
Writer.WriteBool( false );
Data.New.Write_ToBinary(Writer);
}
else
Writer.WriteBool( true );
break;
}
case historyitem_Paragraph_Tabs:
{
// Bool : IsUndefined
......@@ -13113,6 +13164,25 @@ Paragraph.prototype =
break;
}
case historyitem_Paragraph_Shd:
{
// Bool : IsUndefined
// Если false
// Byte : Value
if ( false === Reader.GetBool() )
{
this.Pr.Shd = new CDocumentShd();
this.Pr.Shd.Read_FromBinary( Reader );
}
else
this.Pr.Shd = undefined;
this.CompiledPr.NeedRecalc = true;
break;
}
case historyitem_Paragraph_WidowControl:
{
// Bool : IsUndefined
......
......@@ -4539,8 +4539,10 @@ CDocumentShd.prototype =
Set_FromObject : function(Shd)
{
this.Value = Shd.Value;
if ( shd_Nil != Shd.Value )
if ( shd_Nil != Shd.Value && undefined != Shd.Color )
this.Color.Set( Shd.Color.r, Shd.Color.g, Shd.Color.b );
else if ( undefined === Shd.Color )
this.Color = undefined;
},
Write_ToBinary : function(Writer)
......
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