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

Добавлен набросок класса ParaMath для работы с формулами.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@52239 954022d7-b5bf-4e40-9824-e11837661b57
parent 3df50592
...@@ -8790,7 +8790,7 @@ CDocument.prototype = ...@@ -8790,7 +8790,7 @@ CDocument.prototype =
var Table = this.Is_TableBorder( X, Y, PageIndex ); var Table = this.Is_TableBorder( X, Y, PageIndex );
if ( null != Table ) if ( null != Table )
{ {
if ( true === this.Document_Is_SelectionLocked(changestype_None, { Type : changestype_2_Element_and_Type, Element : Table, CheckType : changestype_Table_Properties } ) ) if ( true === editor.isViewMode || true === this.Document_Is_SelectionLocked(changestype_None, { Type : changestype_2_Element_and_Type, Element : Table, CheckType : changestype_Table_Properties } ) )
return; return;
this.Create_NewHistoryPoint(); this.Create_NewHistoryPoint();
......
...@@ -889,6 +889,7 @@ Paragraph.prototype = ...@@ -889,6 +889,7 @@ Paragraph.prototype =
switch( Item.Type ) switch( Item.Type )
{ {
case para_Math:
case para_Text: case para_Text:
case para_Space: case para_Space:
case para_PageNum: case para_PageNum:
...@@ -1340,6 +1341,7 @@ Paragraph.prototype = ...@@ -1340,6 +1341,7 @@ Paragraph.prototype =
switch( Item.Type ) switch( Item.Type )
{ {
case para_Math:
case para_Text: case para_Text:
{ {
bStartWord = true; bStartWord = true;
...@@ -3168,6 +3170,7 @@ Paragraph.prototype = ...@@ -3168,6 +3170,7 @@ Paragraph.prototype =
switch( Item.Type ) switch( Item.Type )
{ {
case para_Math:
case para_Text: case para_Text:
{ {
bFirstLineItem = false; bFirstLineItem = false;
...@@ -3463,6 +3466,7 @@ Paragraph.prototype = ...@@ -3463,6 +3466,7 @@ Paragraph.prototype =
case para_TextPr: case para_TextPr:
case para_End: case para_End:
case para_NewLine: case para_NewLine:
case para_Math:
{ {
X += Item.WidthVisible; X += Item.WidthVisible;
break; break;
...@@ -4288,6 +4292,7 @@ Paragraph.prototype = ...@@ -4288,6 +4292,7 @@ Paragraph.prototype =
case para_Drawing: case para_Drawing:
case para_Tab: case para_Tab:
case para_Text: case para_Text:
case para_Math:
{ {
if ( para_Drawing === Item.Type && drawing_Anchor === Item.DrawingType ) if ( para_Drawing === Item.Type && drawing_Anchor === Item.DrawingType )
break; break;
...@@ -4794,6 +4799,7 @@ Paragraph.prototype = ...@@ -4794,6 +4799,7 @@ Paragraph.prototype =
case para_Drawing: case para_Drawing:
case para_Tab: case para_Tab:
case para_Text: case para_Text:
case para_Math:
{ {
if ( para_Drawing != Item.Type || drawing_Anchor != Item.DrawingType ) if ( para_Drawing != Item.Type || drawing_Anchor != Item.DrawingType )
{ {
...@@ -4990,6 +4996,7 @@ Paragraph.prototype = ...@@ -4990,6 +4996,7 @@ Paragraph.prototype =
case para_Drawing: case para_Drawing:
case para_Tab: case para_Tab:
case para_Text: case para_Text:
case para_Math:
{ {
if ( para_Drawing != Item.Type || drawing_Anchor != Item.DrawingType ) if ( para_Drawing != Item.Type || drawing_Anchor != Item.DrawingType )
{ {
...@@ -7749,6 +7756,7 @@ Paragraph.prototype = ...@@ -7749,6 +7756,7 @@ Paragraph.prototype =
} }
case para_PageNum: case para_PageNum:
case para_Text: case para_Text:
case para_Math:
TempDx = Item.WidthVisible; TempDx = Item.WidthVisible;
bCheck = true; bCheck = true;
......
...@@ -39,6 +39,7 @@ var para_CollaborativeChangesEnd = 0x0022; // Конец изменений д ...@@ -39,6 +39,7 @@ var para_CollaborativeChangesEnd = 0x0022; // Конец изменений д
var para_CommentStart = 0x0023; // Начало комментария 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 break_Line = 0x01; var break_Line = 0x01;
var break_Page = 0x02; var break_Page = 0x02;
...@@ -7483,6 +7484,106 @@ ParaPresentationNumbering.prototype = ...@@ -7483,6 +7484,106 @@ ParaPresentationNumbering.prototype =
} }
}; };
// Класс ParaMath
function ParaMath(value)
{
this.Id = g_oIdCounter.Get_NewId();
this.Type = para_Math;
this.Math = new CMathComposition();
this.Width = 0;
this.Height = 0;
this.WidthVisible = 0;
this.TextAscent = 0;
this.TextDescent = 0;
this.TextHeight = 0;
this.TextAscent2 = 0;
this.YOffset = 0;
this.CurPage = 0;
this.CurLines = 0;
this.CurRange = 0;
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
g_oTableId.Add( this, this.Id );
}
ParaMath.prototype =
{
Get_Id : function()
{
return this.Id;
},
Set_Id : function(newId)
{
g_oTableId.Reset_Id( this, newId, this.Id );
this.Id = newId;
},
Draw : function( X, Y, Context )
{
this.Math.Draw_2( X, Y, Context )
},
Measure : function( Context )
{
this.Math.RecalculateComposition_2();
var Size = this.Math.getSize();
this.Width = Size.width;
this.Height = Size.height;
this.WidthVisible = Size.width;
},
Is_RealContent : function( )
{
return true;
},
Can_AddNumbering : function()
{
return true;
},
Copy : function()
{
var Math = new ParaMath();
return Math;
},
Write_ToBinary : function(Writer)
{
// Long : Type
// String : Id
Writer.WriteLong( this.Type );
Writer.WriteString2( this.Id );
},
Write_ToBinary2 : function(Writer)
{
},
Read_FromBinary2 : function(Reader)
{
},
Save_Changes : function(Data, Writer)
{
},
Load_Changes : function(Reader)
{
}
};
function ParagraphContent_Read_FromBinary(Reader) function ParagraphContent_Read_FromBinary(Reader)
{ {
var ElementType = Reader.GetLong(); var ElementType = Reader.GetLong();
...@@ -7493,6 +7594,7 @@ function ParagraphContent_Read_FromBinary(Reader) ...@@ -7493,6 +7594,7 @@ function ParagraphContent_Read_FromBinary(Reader)
case para_TextPr : case para_TextPr :
case para_Drawing : case para_Drawing :
case para_HyperlinkStart : case para_HyperlinkStart :
case para_Math :
{ {
var ElementId = Reader.GetString2(); var ElementId = Reader.GetString2();
Element = g_oTableId.Get_ById( ElementId ); Element = g_oTableId.Get_ById( ElementId );
......
...@@ -162,7 +162,27 @@ ...@@ -162,7 +162,27 @@
<!--for charts--> <!--for charts-->
<script type="text/javascript" src="../Excel/graphics/DrawingContextWord.js"></script> <script type="text/javascript" src="../Excel/graphics/DrawingContextWord.js"></script>
<script type="text/javascript" src="Math/mathTypes.js"></script>
<script type="text/javascript" src="Math/print.js"></script>
<script type="text/javascript" src="Math/mathText.js"></script>
<script type="text/javascript" src="Math/mathContent.js"></script>
<script type="text/javascript" src="Math/actions.js"></script>
<script type="text/javascript" src="Math/base.js"></script>
<script type="text/javascript" src="Math/subBase.js"></script>
<script type="text/javascript" src="Math/fraction.js"></script>
<script type="text/javascript" src="Math/degree.js"></script>
<script type="text/javascript" src="Math/matrix.js"></script>
<script type="text/javascript" src="Math/limit.js"></script>
<script type="text/javascript" src="Math/nary.js"></script>
<script type="text/javascript" src="Math/radical.js"></script>
<script type="text/javascript" src="Math/operators.js"></script>
<script type="text/javascript" src="Math/accent.js"></script>
<script type="text/javascript" src="Math/drawingUnion.js"></script>
<script type="text/javascript" src="Math/borderBox.js"></script>
<script type="text/javascript" src="Math/test_for_read.js"></script>
<script type="text/javascript" src="Math/test_composition.js"></script>
</head> </head>
<body id="id_body" class="block_elem" style="-moz-user-select:none;-khtml-user-select:none;user-select:none;width:100%;height:100%;background-color:#B0B0B0;overflow:hidden;position:fixed;" UNSELECTABLE="on"> <body id="id_body" class="block_elem" style="-moz-user-select:none;-khtml-user-select:none;user-select:none;width:100%;height:100%;background-color:#B0B0B0;overflow:hidden;position:fixed;" UNSELECTABLE="on">
<div id="id_menu" class="block_elem" style="width:100%;height:21mm;background-color:#F4F5F6;"> <div id="id_menu" class="block_elem" style="width:100%;height:21mm;background-color:#F4F5F6;">
......
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