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

Добавлен первый вариант класса CRun для нового параграфа.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53020 954022d7-b5bf-4e40-9824-e11837661b57
parent be382ff1
...@@ -62,6 +62,8 @@ var recalcresult2_NextPage = 0x01; // Рассчет нужно продолжи ...@@ -62,6 +62,8 @@ var recalcresult2_NextPage = 0x01; // Рассчет нужно продолжи
var StartTime; var StartTime;
var g_TestColumns = false;
function CSelectedElement(Element, SelectedAll) function CSelectedElement(Element, SelectedAll)
{ {
this.Element = Element; this.Element = Element;
...@@ -661,17 +663,51 @@ CDocument.prototype = ...@@ -661,17 +663,51 @@ CDocument.prototype =
Get_PageContentStartPos : function (PageIndex) Get_PageContentStartPos : function (PageIndex)
{ {
var Y = Y_Top_Field; if ( true !== g_TestColumns )
var YHeader = this.HdrFtr.Get_HeaderBottomPos( PageIndex ); {
if ( YHeader >= 0 && YHeader > Y ) var Y = Y_Top_Field;
Y = YHeader; var YHeader = this.HdrFtr.Get_HeaderBottomPos( PageIndex );
if ( YHeader >= 0 && YHeader > Y )
Y = YHeader;
var YLimit = Y_Bottom_Field;
var YFooter = this.HdrFtr.Get_FooterTopPos( PageIndex );
if ( YFooter >= 0 && YFooter < YLimit )
YLimit = YFooter;
return { X : X_Left_Field, Y : Y, XLimit : X_Right_Field, YLimit : YLimit };
}
else
{
if ( 0 === PageIndex % 2 )
{
var Y = Y_Top_Field;
var YHeader = this.HdrFtr.Get_HeaderBottomPos( PageIndex );
if ( YHeader >= 0 && YHeader > Y )
Y = YHeader;
var YLimit = Y_Bottom_Field; var YLimit = Y_Bottom_Field;
var YFooter = this.HdrFtr.Get_FooterTopPos( PageIndex ); var YFooter = this.HdrFtr.Get_FooterTopPos( PageIndex );
if ( YFooter >= 0 && YFooter < YLimit ) if ( YFooter >= 0 && YFooter < YLimit )
YLimit = YFooter; YLimit = YFooter;
return { X : X_Left_Field, Y : Y, XLimit : X_Right_Field, YLimit : YLimit }; return { X : X_Left_Field, Y : Y, XLimit : (X_Left_Field + X_Right_Field) / 2 - 10, YLimit : YLimit };
}
else
{
var Y = Y_Top_Field;
var YHeader = this.HdrFtr.Get_HeaderBottomPos( PageIndex );
if ( YHeader >= 0 && YHeader > Y )
Y = YHeader;
var YLimit = Y_Bottom_Field;
var YFooter = this.HdrFtr.Get_FooterTopPos( PageIndex );
if ( YFooter >= 0 && YFooter < YLimit )
YLimit = YFooter;
return { X : (X_Left_Field + X_Right_Field) / 2 + 10, Y : Y, XLimit : X_Right_Field, YLimit : YLimit };
}
}
}, },
Get_PageLimits : function(PageIndex) Get_PageLimits : function(PageIndex)
...@@ -1273,14 +1309,35 @@ CDocument.prototype = ...@@ -1273,14 +1309,35 @@ CDocument.prototype =
if ( true === bReDraw ) if ( true === bReDraw )
{ {
this.DrawingDocument.OnRecalculatePage( PageIndex, this.Pages[PageIndex] ); if ( true !== g_TestColumns )
this.DrawingDocument.OnRecalculatePage( PageIndex, this.Pages[PageIndex] );
else
{
if ( 1 === PageIndex % 2 || Index >= Count )
{
var __PageIndex = 0;
if ( 1 === PageIndex % 2 )
__PageIndex = (PageIndex - 1) / 2;
else
__PageIndex = PageIndex / 2;
this.DrawingDocument.OnRecalculatePage( __PageIndex, this.Pages[PageIndex] );
}
}
} }
if ( Index >= Count ) if ( Index >= Count )
{ {
this.Internal_CheckCurPage(); this.Internal_CheckCurPage();
this.DrawingDocument.OnEndRecalculate( true ); this.DrawingDocument.OnEndRecalculate( true );
this.DrawingObjects.onEndRecalculateDocument( this.Pages.length );
if ( true !== g_TestColumns )
this.DrawingObjects.onEndRecalculateDocument( this.Pages.length );
else
{
var _Len = ( 0 === this.Pages.length % 2 ? this.Pages.length / 2 : (this.Pages.length + 1) / 2 );
this.DrawingObjects.onEndRecalculateDocument( _Len );
}
if ( true === this.Selection.UpdateOnRecalc ) if ( true === this.Selection.UpdateOnRecalc )
{ {
...@@ -1520,11 +1577,35 @@ CDocument.prototype = ...@@ -1520,11 +1577,35 @@ CDocument.prototype =
this.DrawingObjects.drawBehindDoc( nPageIndex, pGraphics ); this.DrawingObjects.drawBehindDoc( nPageIndex, pGraphics );
this.DrawingObjects.drawWrappingObjects( nPageIndex, pGraphics ); this.DrawingObjects.drawWrappingObjects( nPageIndex, pGraphics );
var Page_StartPos = this.Pages[nPageIndex].Pos; if ( true !== g_TestColumns )
var Page_EndPos = this.Pages[nPageIndex].EndPos;
for ( var Index = Page_StartPos; Index <= Page_EndPos; Index++ )
{ {
this.Content[Index].Draw(nPageIndex, pGraphics); var Page_StartPos = this.Pages[nPageIndex].Pos;
var Page_EndPos = this.Pages[nPageIndex].EndPos;
for ( var Index = Page_StartPos; Index <= Page_EndPos; Index++ )
{
this.Content[Index].Draw(nPageIndex, pGraphics);
}
}
else
{
var __PageIndex = nPageIndex * 2;
var Page_StartPos = this.Pages[__PageIndex].Pos;
var Page_EndPos = this.Pages[__PageIndex].EndPos;
for ( var Index = Page_StartPos; Index <= Page_EndPos; Index++ )
{
this.Content[Index].Draw(__PageIndex, pGraphics);
}
__PageIndex = nPageIndex * 2 + 1;
if ( undefined != this.Pages[__PageIndex] )
{
Page_StartPos = this.Pages[__PageIndex].Pos;
Page_EndPos = this.Pages[__PageIndex].EndPos;
for ( var Index = Page_StartPos; Index <= Page_EndPos; Index++ )
{
this.Content[Index].Draw(__PageIndex, pGraphics);
}
}
} }
this.DrawingObjects.drawBeforeObjects( nPageIndex, pGraphics ); this.DrawingObjects.drawBeforeObjects( nPageIndex, pGraphics );
...@@ -9123,7 +9204,7 @@ CDocument.prototype = ...@@ -9123,7 +9204,7 @@ CDocument.prototype =
if ( PageIndex < 0 ) if ( PageIndex < 0 )
return; return;
this.Update_CursorType( X, Y, PageIndex, e ); //this.Update_CursorType( X, Y, PageIndex, e );
if ( true === this.Selection.Use && true === this.Selection.Start ) if ( true === this.Selection.Use && true === this.Selection.Start )
{ {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -40,6 +40,8 @@ var para_CommentStart = 0x0023; // Начало комментар ...@@ -40,6 +40,8 @@ var para_CommentStart = 0x0023; // Начало комментар
var para_CommentEnd = 0x0024; // Начало комментария var para_CommentEnd = 0x0024; // Начало комментария
var para_PresentationNumbering = 0x0025; // Элемент, обозначающий нумерацию для списков в презентациях var para_PresentationNumbering = 0x0025; // Элемент, обозначающий нумерацию для списков в презентациях
var para_Math = 0x0026; // Формула var para_Math = 0x0026; // Формула
var para_Run = 0x0027; // Текстовый элемент
var para_Sym = 0x0028; // Символ
var break_Line = 0x01; var break_Line = 0x01;
var break_Page = 0x02; var break_Page = 0x02;
...@@ -326,6 +328,113 @@ ParaSpace.prototype = ...@@ -326,6 +328,113 @@ ParaSpace.prototype =
} }
}; };
function ParaSym(Char, FontFamily)
{
this.Type = para_Sym;
this.FontFamily = FontFamily;
this.Char = Char;
this.FontSlot = fontslot_ASCII;
this.FontKoef = 1;
this.Width = 0;
this.Height = 0;
this.WidthVisible = 0;
}
ParaSym.prototype =
{
Draw : function(X,Y,Context, TextPr)
{
var CurTextPr = TextPr.Copy();
switch ( this.FontSlot )
{
case fontslot_ASCII: CurTextPr.RFonts.Ascii = { Name : this.FontFamily, Index : -1 }; break;
case fontslot_CS: CurTextPr.RFonts.CS = { Name : this.FontFamily, Index : -1 }; break;
case fontslot_EastAsia: CurTextPr.RFonts.EastAsia = { Name : this.FontFamily, Index : -1 }; break;
case fontslot_HAnsi: CurTextPr.RFonts.HAnsi = { Name : this.FontFamily, Index : -1 }; break;
}
Context.SetTextPr( CurTextPr );
Context.SetFontSlot( this.FontSlot, this.FontKoef );
Context.FillText( X, Y, String.fromCharCode( this.Char ) );
Context.SetTextPr( TextPr );
},
Measure : function(Context, TextPr)
{
this.FontKoef = TextPr.Get_FontKoef();
var Hint = TextPr.RFonts.Hint;
var bCS = TextPr.CS;
var bRTL = TextPr.RTL;
var lcid = TextPr.Lang.EastAsia;
this.FontSlot = g_font_detector.Get_FontClass( this.CalcValue.charCodeAt(0), Hint, lcid, bCS, bRTL );
var CurTextPr = TextPr.Copy();
switch ( this.FontSlot )
{
case fontslot_ASCII: CurTextPr.RFonts.Ascii = { Name : this.FontFamily, Index : -1 }; break;
case fontslot_CS: CurTextPr.RFonts.CS = { Name : this.FontFamily, Index : -1 }; break;
case fontslot_EastAsia: CurTextPr.RFonts.EastAsia = { Name : this.FontFamily, Index : -1 }; break;
case fontslot_HAnsi: CurTextPr.RFonts.HAnsi = { Name : this.FontFamily, Index : -1 }; break;
}
Context.SetTextPr( CurTextPr );
Context.SetFontSlot( this.FontSlot, this.FontKoef );
var Temp = Context.Measure( this.CalcValue );
Context.SetTextPr( TextPr );
Temp.Width = Math.max( Temp.Width + TextPr.Spacing, 0 );
this.Width = Temp.Width;
this.Height = Temp.Height;
this.WidthVisible = Temp.Width;
},
Is_RealContent : function()
{
return true;
},
Can_AddNumbering : function()
{
return true;
},
Copy : function()
{
return new ParaSym( this.Char, this.FontFamily );
},
Write_ToBinary : function(Writer)
{
// Long : Type
// String : FontFamily
// Long : Char
Writer.WriteLong( this.Type );
Writer.WriteString2( this.FontFamily );
Writer.WriteLong( this.Char );
},
Read_FromBinary : function(Reader)
{
// String : FontFamily
// Long : Char
this.FontFamily = Reader.GetString2();
this.Char = Reader.GetLong();
}
};
// Класс ParaTextPr // Класс ParaTextPr
function ParaTextPr(Props) function ParaTextPr(Props)
{ {
...@@ -2491,6 +2600,7 @@ function ParaNumbering() ...@@ -2491,6 +2600,7 @@ function ParaNumbering()
{ {
this.Type = para_Numbering; this.Type = para_Numbering;
this.Pos = -1; this.Pos = -1;
this.Item = undefined;
this.Internal = this.Internal =
{ {
......
This diff is collapsed.
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
var Default_Tab_Stop = 12.5; var Default_Tab_Stop = 12.5;
var Default_Heading_Font = "Arial"; var Default_Heading_Font = "Arial";
var Default_Font = "Arial";
var align_Right = 0; var align_Right = 0;
var align_Left = 1; var align_Left = 1;
......
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