Commit e1a8355f authored by Sergey.Tsarkov's avatar Sergey.Tsarkov Committed by Alexander.Trofimov

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

2. добавлена вставка формул при совместном редактировании

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53364 954022d7-b5bf-4e40-9824-e11837661b57
parent 3ecc40b7
...@@ -155,6 +155,7 @@ function CTableId() ...@@ -155,6 +155,7 @@ function CTableId()
case historyitem_type_Style : Element = new CStyle(); break; case historyitem_type_Style : Element = new CStyle(); break;
case historyitem_type_TextBody : Element = new CTextBody(); break; case historyitem_type_TextBody : Element = new CTextBody(); break;
case historyitem_type_ChartTitle : Element = new CChartTitle(); break; case historyitem_type_ChartTitle : Element = new CChartTitle(); break;
case historyitem_type_Math : Element = new ParaMath(); break;
} }
Element.Read_FromBinary2(Reader); Element.Read_FromBinary2(Reader);
......
...@@ -379,6 +379,7 @@ var historyitem_type_Style = 29; ...@@ -379,6 +379,7 @@ var historyitem_type_Style = 29;
var historyitem_type_Styles = 30; var historyitem_type_Styles = 30;
var historyitem_type_TextBody = 31; var historyitem_type_TextBody = 31;
var historyitem_type_ChartTitle = 32; var historyitem_type_ChartTitle = 32;
var historyitem_type_Math = 33;
//Типы изменений в классе CChartAsGroup //Типы изменений в классе CChartAsGroup
......
...@@ -7666,7 +7666,7 @@ ParaPresentationNumbering.prototype = ...@@ -7666,7 +7666,7 @@ ParaPresentationNumbering.prototype =
}; };
// Класс ParaMath // Класс ParaMath
function ParaMath() function ParaMath(bAddMenu)
{ {
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
...@@ -7695,6 +7695,7 @@ function ParaMath() ...@@ -7695,6 +7695,7 @@ function ParaMath()
this.CurRange = 0; this.CurRange = 0;
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора) // Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
if (!bAddMenu)
g_oTableId.Add( this, this.Id ); g_oTableId.Add( this, this.Id );
// TODO: // TODO:
...@@ -7975,11 +7976,29 @@ ParaMath.prototype = ...@@ -7975,11 +7976,29 @@ ParaMath.prototype =
Write_ToBinary2 : function(Writer) Write_ToBinary2 : function(Writer)
{ {
Writer.WriteLong( historyitem_type_Math );
var oThis = this;
this.bs = new BinaryCommonWriter(Writer);
this.boMaths = new Binary_oMathWriter(Writer);
//this.bs.WriteItem(c_oSerParType.OMathPara, function(){oThis.boMaths.WriteOMathPara(oThis.Math);});
this.bs.WriteItemWithLength ( function(){oThis.boMaths.WriteOMathPara(oThis.Math);});
}, },
Read_FromBinary2 : function(Reader) Read_FromBinary2 : function(Reader)
{ {
var oThis = this;
this.boMathr = new Binary_oMathReader(Reader);
this.bcr = new Binary_CommonReader(Reader);
var length = Reader.GetUChar();
var res = false;
Reader.cur += 3;
res = this.bcr.Read1(length, function(t, l){
return oThis.boMathr.ReadMathOMathPara(t,l,oThis.Math);
});
}, },
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -7343,9 +7343,8 @@ asc_docs_api.prototype.asc_AddMath = function(Type) ...@@ -7343,9 +7343,8 @@ asc_docs_api.prototype.asc_AddMath = function(Type)
{ {
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint(); this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
var MathElement = new ParaMath(); var bAddMenu = true;
// TODO: в зависимости от типа Type сделать заполнение MathElement var MathElement = new ParaMath(bAddMenu);
var props = new Object(); var props = new Object();
switch (Type) switch (Type)
...@@ -9417,7 +9416,7 @@ asc_docs_api.prototype.asc_AddMath = function(Type) ...@@ -9417,7 +9416,7 @@ asc_docs_api.prototype.asc_AddMath = function(Type)
oElem.fillPlaceholders(); oElem.fillPlaceholders();
break; break;
} }
g_oTableId.Add( MathElement, MathElement.Id );
this.WordControl.m_oLogicDocument.Paragraph_Add( MathElement ); this.WordControl.m_oLogicDocument.Paragraph_Add( MathElement );
} }
} }
......
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