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

сброс селекта при удалении буквы

добавлена обработка амперсанда
настройки peraPun для совместного редактирования
обработка переноса формулы
поправлены баги в меню

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58116 954022d7-b5bf-4e40-9824-e11837661b57
parent 651366ec
......@@ -201,6 +201,7 @@ ParaMath.prototype =
oMRun.Add(oItem, true);
oStartContent.Remove_FromContent(i, 1, false);
}
oStartContent.Selection_Remove();
}
oContent.Content.Load_FromMenu(Item.Menu, this.Paragraph);
......
......@@ -7743,7 +7743,8 @@ function ParagraphContent_Read_FromBinary(Reader)
case para_CommentStart : Element = new ParaCommentStart(); break;
case para_CommentEnd : Element = new ParaCommentEnd(); break;
case para_PresentationNumbering : Element = new ParaPresentationNumbering(); break;
case para_Math_Text : Element = new CMathText(false); break;
case para_Math_Text : Element = new CMathText(false); break;
case para_Math_Ampersand : Element = new CMathAmp(); break;
}
if ( null != Element )
......
......@@ -7225,6 +7225,7 @@ ParaRun.prototype =
// Long : Количество элементов
// Array of variable : массив с элементами
Writer.WriteLong( this.Type );
var ParagraphToWrite, PrToWrite, ContentToWrite;
if(this.StartState)
{
......@@ -7242,7 +7243,7 @@ ParaRun.prototype =
Writer.WriteString2( this.Id );
Writer.WriteString2( null !== ParagraphToWrite && undefined !== ParagraphToWrite ? ParagraphToWrite.Get_Id() : "" );
PrToWrite.Write_ToBinary( Writer );
var Count = ContentToWrite.length;
Writer.WriteLong( Count );
for ( var Index = 0; Index < Count; Index++ )
......@@ -7260,10 +7261,13 @@ ParaRun.prototype =
// Long : Количество элементов
// Array of variable : массив с элементами
this.Type = Reader.GetLong();
this.Id = Reader.GetString2();
this.Paragraph = g_oTableId.Get_ById( Reader.GetString2() );
this.Pr = new CTextPr();
this.Pr.Read_FromBinary( Reader );
if ( this.Type == para_Math_Run)
this.MathPrp = new CMPrp();
if(undefined !== editor && true === editor.isDocumentEditor)
{
......
......@@ -596,7 +596,9 @@ var c_oSer_OMathContentType = {
Sup: 56,
MText: 57,
CtrlPr: 58,
Id: 59
Id: 59,
pagebreak: 60,
linebreak: 61
};
var c_oSer_HyperlinkType = {
Content: 0,
......@@ -1914,10 +1916,11 @@ function Binary_oMathWriter(memory, oMathPara)
{
var Item = oMRun.Content[CurPos];
switch ( Item.Type )
{
case para_Math_Text : oText += String.fromCharCode(Item.value); break;
{
case para_Math_Ampersand : oText += "&"; break;
case para_Math_Text : oText += String.fromCharCode(Item.value); break;
case para_Space:
case para_Tab : oText += " "; break;
case para_Tab : oText += " "; break;
}
}
......@@ -9678,6 +9681,7 @@ function Binary_oMathReader(stream)
{
var res = c_oSerConstants.ReadOk;
var oThis = this;
var oNewElem = null;
if (c_oSer_OMathContentType.MText === type)
{
......@@ -9686,17 +9690,20 @@ function Binary_oMathReader(stream)
text = this.stream.GetString2();
for (var i = 0; i < text.length; ++i)
{
//управляющие символы
if (0x001F < text[i].charCodeAt(0))
var oText = null;
if ( 0x0026 == text[i].charCodeAt(0))
oText = new CMathAmp();
else if (0x001F < text[i].charCodeAt(0)) //управляющие символы
{
var oText = new CMathText(false);
oText.addTxt(text[i]);
oMRun.Content.splice( i, 0, oText );
oText = new CMathText(false);
oText.addTxt(text[i]);
}
/*в будущем переделка под para_space
else if (text[i] == ' ')
oMRun.Content.splice(oMRun.Content.length, 0, new ParaSpace(1));
oText = new ParaSpace(1)
*/
if (oText)
oMRun.Content.splice( i, 0, oText );
}
if (oParent)
......@@ -9718,8 +9725,23 @@ function Binary_oMathReader(stream)
res = this.brPrr.Read(length, rPr);
oMRun.Set_Pr(rPr);
}
else if (c_oSer_OMathContentType.pagenum === type)
{
oNewElem = new ParaPageNum();
}
else if (c_oSer_OMathContentType.pagebreak === type)
{
oNewElem = new ParaNewLine( break_Page );
}
else
res = c_oSerConstants.ReadUnknown;
if (null != oNewElem)
{
//TODO обработка переноса
//oMRun.Add_ToContent(0, oNewElem, false);
}
return res;
};
this.ReadMathMRPr = function(type, length, props)
......
......@@ -6624,9 +6624,9 @@ CMathContent.prototype =
this.CreateElem(oEqArr, del2Elem);
var eqArrElem0 = oEqArr.getElement(0);
this.AddText(eqArrElem0, "-x,&x<0");
this.AddText(eqArrElem0, "-x, &x<0");
var eqArrElem0 = oEqArr.getElement(1);
var sTxt = "x,&x" + String.fromCharCode(8805) + "0";
var sTxt = "x, &x" + String.fromCharCode(8805) + "0";
this.AddText(eqArrElem0,sTxt);
break;
case 124: props = {ctrPrp: new CTextPr(), column:1};
......@@ -7589,8 +7589,14 @@ CMathContent.prototype =
var items = [];
for (var i=0; i < sText.length; i++)
{
var oText = new CMathText(false);
oText.addTxt(sText[i]);
var oText = null;
if ( 0x0026 == sText[i].charCodeAt(0))
oText = new CMathAmp();
else
{
oText = new CMathText(false);
oText.addTxt(sText[i]);
}
MathRun.Add(oText, true);
}
oElem.DeleteEmptyRuns();
......
......@@ -794,6 +794,15 @@ CMathAmp.prototype =
IsAlignPoint: function()
{
return this.Type == para_Math_Ampersand;
},
Write_ToBinary : function(Writer)
{
// Long : Type
Writer.WriteLong( this.Type );
},
Read_FromBinary : function(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