Commit 21e7102e authored by Ilya.Kirillov's avatar Ilya.Kirillov Committed by Alexander.Trofimov

Сделана отрисовка заливки текста (поле Shd). Сделано, чтобы в CTextPr поле Shd...

Сделана отрисовка заливки текста (поле Shd). Сделано, чтобы в CTextPr поле Shd могло быть неопределено.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55922 954022d7-b5bf-4e40-9824-e11837661b57
parent e0284441
...@@ -6689,6 +6689,19 @@ Paragraph.prototype = ...@@ -6689,6 +6689,19 @@ Paragraph.prototype =
pGraphics.df(); pGraphics.df();
} }
//----------------------------------------------------------------------------------------------------------
// Рисуем заливку текста
//----------------------------------------------------------------------------------------------------------
var aShd = PDSH.Shd;
var Element = aShd.Get_Next();
while ( null != Element )
{
pGraphics.b_color1( Element.r, Element.g, Element.b, 255 );
pGraphics.rect( Element.x0, Element.y0, Element.x1 - Element.x0, Element.y1 - Element.y0 );
pGraphics.df();
Element = aShd.Get_Next();
}
//---------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------
// Рисуем выделение текста // Рисуем выделение текста
//---------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------
...@@ -22293,6 +22306,7 @@ function CParagraphDrawStateHightlights() ...@@ -22293,6 +22306,7 @@ function CParagraphDrawStateHightlights()
this.Coll = new CParaDrawingRangeLines(); this.Coll = new CParaDrawingRangeLines();
this.Find = new CParaDrawingRangeLines(); this.Find = new CParaDrawingRangeLines();
this.Comm = new CParaDrawingRangeLines(); this.Comm = new CParaDrawingRangeLines();
this.Shd = new CParaDrawingRangeLines();
this.Comments = new Array(); this.Comments = new Array();
this.CommentsFlag = comments_NoComment; this.CommentsFlag = comments_NoComment;
......
...@@ -2789,6 +2789,7 @@ ParaRun.prototype = ...@@ -2789,6 +2789,7 @@ ParaRun.prototype =
var aColl = PDSH.Coll; var aColl = PDSH.Coll;
var aFind = PDSH.Find; var aFind = PDSH.Find;
var aComm = PDSH.Comm; var aComm = PDSH.Comm;
var aShd = PDSH.Shd;
var Range = this.Lines[CurLine].Ranges[CurRange]; var Range = this.Lines[CurLine].Ranges[CurRange];
var StartPos = Range.StartPos; var StartPos = Range.StartPos;
...@@ -2799,7 +2800,11 @@ ParaRun.prototype = ...@@ -2799,7 +2800,11 @@ ParaRun.prototype =
var bDrawFind = PDSH.DrawFind; var bDrawFind = PDSH.DrawFind;
var bDrawColl = PDSH.DrawColl; var bDrawColl = PDSH.DrawColl;
var oShd = this.Get_CompiledPr(false).Shd;
var bDrawShd = ( oShd === undefined || shd_Nil === oShd.Value ? false : true );
var ShdColor = ( true === bDrawShd ? oShd.Get_Color( PDSH.Paragraph ) : null );
var X = PDSH.X; var X = PDSH.X;
var Y0 = PDSH.Y0; var Y0 = PDSH.Y0;
var Y1 = PDSH.Y1; var Y1 = PDSH.Y1;
...@@ -2832,6 +2837,9 @@ ParaRun.prototype = ...@@ -2832,6 +2837,9 @@ ParaRun.prototype =
var DrawColl = this.CollaborativeMarks.Check( Pos ); var DrawColl = this.CollaborativeMarks.Check( Pos );
if ( true === bDrawShd )
aShd.Add( Y0, Y1, X, X + Item.WidthVisible, 0, ShdColor.r, ShdColor.g, ShdColor.b );
switch( Item.Type ) switch( Item.Type )
{ {
case para_PageNum: case para_PageNum:
...@@ -4421,6 +4429,9 @@ ParaRun.prototype = ...@@ -4421,6 +4429,9 @@ ParaRun.prototype =
if ( undefined != TextPr.Lang ) if ( undefined != TextPr.Lang )
this.Set_Lang2( TextPr.Lang ); this.Set_Lang2( TextPr.Lang );
if ( undefined !== TextPr.Shd )
this.Set_Shd( TextPr.Shd );
}, },
Set_Bold : function(Value) Set_Bold : function(Value)
...@@ -4843,6 +4854,25 @@ ParaRun.prototype = ...@@ -4843,6 +4854,25 @@ ParaRun.prototype =
this.Recalc_CompiledPr(false); this.Recalc_CompiledPr(false);
} }
}, },
Set_Shd : function(Shd)
{
if ( (undefined === this.Pr.Shd && undefined === Shd) || (undefined !== this.Pr.Shd && undefined !== Shd && true === this.Pr.Shd.Compare( Shd ) ) )
return;
var OldShd = this.Pr.Shd;
if ( undefined !== Shd )
{
this.Pr.Shd = new CDocumentShd();
this.Pr.Shd.Set_FromObject( Shd );
}
else
this.Pr.Shd = undefined;
History.Add( this, { Type : historyitem_ParaRun_Shd, New : this.Pr.Shd, Old : OldShd } );
this.Recalc_CompiledPr(false);
},
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// Undo/Redo функции // Undo/Redo функции
...@@ -5188,6 +5218,14 @@ ParaRun.prototype = ...@@ -5188,6 +5218,14 @@ ParaRun.prototype =
break; break;
} }
case historyitem_ParaRun_Shd:
{
this.Pr.Shd = Data.Old;
this.Recalc_CompiledPr(false);
break;
}
} }
}, },
...@@ -5533,6 +5571,14 @@ ParaRun.prototype = ...@@ -5533,6 +5571,14 @@ ParaRun.prototype =
break; break;
} }
case historyitem_ParaRun_Shd:
{
this.Pr.Shd = Data.New;
this.Recalc_CompiledPr(false);
break;
}
} }
}, },
...@@ -5862,6 +5908,24 @@ ParaRun.prototype = ...@@ -5862,6 +5908,24 @@ ParaRun.prototype =
break; break;
} }
case historyitem_ParaRun_Shd:
{
// Bool : undefined
// false - >
// Variable : CDocumentShd
if ( undefined !== Data.New )
{
Writer.WriteBool(false);
Data.New.Write_ToBinary(Writer);
}
else
Writer.WriteBool(true);
break;
}
} }
return Writer; return Writer;
...@@ -6373,6 +6437,27 @@ ParaRun.prototype = ...@@ -6373,6 +6437,27 @@ ParaRun.prototype =
break; break;
} }
case historyitem_ParaRun_Shd:
{
// Bool : undefined
// false - >
// Variable : CDocumentShd
if ( false === Reader.GetBool() )
{
this.Pr.Shd = new CDocumentShd();
this.Pr.Shd.Read_FromBinary( Reader );
}
else
this.Pr.Shd = undefined;
this.Recalc_CompiledPr(false);
break;
}
} }
}, },
......
...@@ -6372,7 +6372,7 @@ function CTextPr() ...@@ -6372,7 +6372,7 @@ function CTextPr()
this.RTL = undefined; this.RTL = undefined;
this.Lang = new CLang(); this.Lang = new CLang();
this.Unifill = undefined; this.Unifill = undefined;
this.Shd = new CDocumentShd(); this.Shd = undefined;
} }
CTextPr.prototype = CTextPr.prototype =
...@@ -6403,7 +6403,7 @@ CTextPr.prototype = ...@@ -6403,7 +6403,7 @@ CTextPr.prototype =
this.RTL = undefined; this.RTL = undefined;
this.Lang = new CLang(); this.Lang = new CLang();
this.Unifill = undefined; this.Unifill = undefined;
this.Shd = new CDocumentShd(); this.Shd = undefined;
}, },
Copy : function() Copy : function()
...@@ -6451,7 +6451,8 @@ CTextPr.prototype = ...@@ -6451,7 +6451,8 @@ CTextPr.prototype =
if(undefined != this.Unifill) if(undefined != this.Unifill)
TextPr.Unifill = this.Unifill.createDuplicate(); TextPr.Unifill = this.Unifill.createDuplicate();
TextPr.Shd = this.Shd.Copy(); if (undefined !== this.Shd )
TextPr.Shd = this.Shd.Copy();
return TextPr; return TextPr;
}, },
...@@ -6533,7 +6534,8 @@ CTextPr.prototype = ...@@ -6533,7 +6534,8 @@ CTextPr.prototype =
if(undefined != TextPr.Unifill) if(undefined != TextPr.Unifill)
this.Unifill = TextPr.Unifill.createDuplicate(); this.Unifill = TextPr.Unifill.createDuplicate();
this.Shd = TextPr.Shd.Copy(); if ( undefined !== TextPr.Shd )
this.Shd = TextPr.Shd.Copy();
}, },
Init_Default : function() Init_Default : function()
...@@ -6565,7 +6567,7 @@ CTextPr.prototype = ...@@ -6565,7 +6567,7 @@ CTextPr.prototype =
this.RTL = false; this.RTL = false;
this.Lang.Init_Default(); this.Lang.Init_Default();
this.Unifill = undefined; this.Unifill = undefined;
this.Shd.Init_Default(); this.Shd = undefined;
}, },
Set_FromObject : function(TextPr) Set_FromObject : function(TextPr)
...@@ -6625,7 +6627,12 @@ CTextPr.prototype = ...@@ -6625,7 +6627,12 @@ CTextPr.prototype =
this.Unifill = TextPr.Unifill ; this.Unifill = TextPr.Unifill ;
if ( undefined !== TextPr.Shd ) if ( undefined !== TextPr.Shd )
{
this.Shd = new CDocumentShd();
this.Shd.Set_FromObject( TextPr.Shd ); this.Shd.Set_FromObject( TextPr.Shd );
}
else
this.Shd = undefined;
}, },
Compare : function(TextPr) Compare : function(TextPr)
...@@ -6715,11 +6722,7 @@ CTextPr.prototype = ...@@ -6715,11 +6722,7 @@ CTextPr.prototype =
// Lang // Lang
this.Lang.Compare( TextPr.Lang ); this.Lang.Compare( TextPr.Lang );
//Result_TextPr.Unifill = CompareUniFill(this.Unifill, TextPr.Unifill); //Result_TextPr.Unifill = CompareUniFill(this.Unifill, TextPr.Unifill);
// Shd
if ( this.Shd.Value !== TextPr.Shd.Value )
this.Shd.Value = shd_Nil;
return this; return this;
}, },
...@@ -7003,6 +7006,7 @@ CTextPr.prototype = ...@@ -7003,6 +7006,7 @@ CTextPr.prototype =
// Shd // Shd
if ( Flags & 8388608 ) if ( Flags & 8388608 )
{ {
this.Shd = new CDocumentShd();
this.Shd.Read_FromBinary( Reader ); this.Shd.Read_FromBinary( Reader );
} }
}, },
......
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