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

Исправлены баги в совместном редактировании и Undo/Redo после добавления новой...

Исправлены баги в совместном редактировании и Undo/Redo после добавления новой формулы. Исправлены баги в копировании и совместном редкатировании с placeholder.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58770 954022d7-b5bf-4e40-9824-e11837661b57
parent fd285713
......@@ -6830,9 +6830,10 @@ function ParagraphContent_Read_FromBinary(Reader)
case para_Numbering : Element = new ParaNumbering(); break;
case para_Tab : Element = new ParaTab(); break;
case para_PageNum : Element = new ParaPageNum(); break;
case para_PresentationNumbering : Element = new ParaPresentationNumbering(); break;
case para_Math_Text : Element = new CMathText(false); break;
case para_Math_Placeholder : Element = new CMathText(); break;
case para_Math_Text : Element = new CMathText(); break;
case para_Math_Ampersand : Element = new CMathAmp(); break;
case para_PresentationNumbering : Element = new ParaPresentationNumbering(); break;
}
if ( null != Element )
......
......@@ -2,7 +2,7 @@
function CMathBorderBoxPr()
{
strikeVthis.hideBot = false;
this.hideBot = false;
this.hideLeft = false;
this.hideRight = false;
this.hideTop = false;
......@@ -417,29 +417,29 @@ function CMathBoxPr()
CMathBoxPr.prototype.Set_FromObject = function(Obj)
{
if(true === Obj.aln || 1 === Obj.aln)
this.Pr.aln = true;
this.aln = true;
else
this.Pr.aln = false;
this.aln = false;
if(true === Obj.brk || 1 === Obj.brk)
this.Pr.brk = true;
this.brk = true;
else
this.Pr.brk = false;
this.brk = false;
if(true === Obj.diff || 1 === Obj.diff)
this.Pr.diff = true;
this.diff = true;
else
this.Pr.diff = false;
this.diff = false;
if(true === Obj.noBreak || 1 === Obj.noBreak)
this.Pr.noBreak = true;
this.noBreak = true;
else
this.Pr.noBreak = false;
this.noBreak = false;
if(true === Obj.opEmu || 1 === Obj.opEmu)
this.Pr.opEmu = true;
this.opEmu = true;
else
this.Pr.opEmu = false;
this.opEmu = false;
};
CMathBoxPr.prototype.Copy = function()
......@@ -514,7 +514,7 @@ CBox.prototype.fillContent = function()
}
CBox.prototype.setProperties = function(props)
{
this.Pr.Set_FromObject(Obj);
this.Pr.Set_FromObject(props);
this.setCtrPrp(props.ctrPrp);
this.RecalcInfo.bProps = true;
......
......@@ -2807,22 +2807,6 @@ CMathContent.prototype =
{
if(this.ParaMath !== null)
this.ParaMath.Refresh_RecalcData(); // Refresh_RecalcData сообщает родительскому классу, что у него произошли изменения, нужно пересчитать
},
_Check_HistoryUninon: function(Data1, Data2)
{
var Type1 = Data1.Type;
var Type2 = Data2.Type;
if ( historyitem_Paragraph_AddItem === Type1 && historyitem_Paragraph_AddItem === Type2 )
{
if ( 1 === Data1.Items.length && 1 === Data2.Items.length && Data1.Pos === Data2.Pos - 1 && !this.content[Data1.Pos].typeObj === MATH_COMP && !this.content[Data2.Pos].typeObj === MATH_COMP )
return true;
}
return false
},
Check_HistoryUninon: function(Data1, Data2)
{
return false;
},
Load_FromMenu: function(Type, Paragraph)
{
......@@ -4547,80 +4531,38 @@ CMathContent.prototype =
break;
}
},
Add: function (oElem, Pos)
{
oElem.Parent = this;
if(oElem.Type === para_Math_Composition)
{
//oElem.setArgSize(this.argSize);
this.content.splice(Pos,0,oElem);
}
else
{
this.content.splice(Pos,0,oElem);
}
if (this.content.length != 1)
this.CurPos++;
},
AddText : function(oElem, sText)
{
if(sText)
{
var MathRun = new ParaRun(this.Paragraph, true);
var Pos = oElem.CurPos + 1,
PosEnd = Pos + 1;
var items = [];
for (var i=0; i < sText.length; i++)
for (var nCharPos = 0, nTextLen = sText.length; nCharPos < nTextLen; nCharPos++)
{
var oText = null;
if ( 0x0026 == sText[i].charCodeAt(0))
if ( 0x0026 == sText.charCodeAt(nCharPos))
oText = new CMathAmp();
else
{
oText = new CMathText(false);
oText.addTxt(sText[i]);
oText.addTxt(sText[nCharPos]);
}
MathRun.Add(oText, true);
}
oElem.DeleteEmptyRuns();
oElem.Add(MathRun,Pos);
items.push(MathRun);
History.Add(oElem, {Type: historyitem_Math_AddItem, Items: items, Pos: Pos, PosEnd: PosEnd});
oElem.SetRunEmptyToContent(true);
oElem.Internal_Content_Add(oElem.CurPos + 1, MathRun, true);
}
},
DeleteEmptyRuns : function ()
{
var nLen = this.content.length;
while(nLen >= 0 )
{
var oElem = this.content[nLen];
if (oElem && oElem.typeObj == MATH_PARA_RUN && oElem.Content.length == 0)
this.content.splice(nLen, 1);
nLen--;
}
},
CreateElem : function (oElem, oParent)
{
oElem.Parent = oParent;
var Pos = oParent.CurPos + 1,
PosEnd = Pos + 1;
var items = [];
if (oParent)
{
oParent.DeleteEmptyRuns();
oParent.Add(oElem,Pos);
items.push(oElem);
History.Add(oParent, {Type: historyitem_Math_AddItem, Items: items, Pos: Pos, PosEnd: PosEnd});
oParent.SetRunEmptyToContent(true);
}
var Pos = oParent.CurPos + 1;
oParent.Internal_Content_Add(Pos, oElem, true);
},
CreateFraction : function (oFraction,oParentElem,sNumText,sDenText)
{
this.CreateElem(oFraction, oParentElem);
......
......@@ -41,7 +41,7 @@ function CMathText(bJDraw)
// для Para_Run
this.Type = para_Math_Text;
this.bJDraw = bJDraw;
this.bJDraw = (undefined === bJDraw ? false : bJDraw);
this.value = null;
......@@ -785,21 +785,25 @@ CMathText.prototype =
Copy: function()
{
var NewLetter = new CMathText(this.bJDraw);
NewLetter.add(this.value);
NewLetter.Type = this.Type;
NewLetter.value = this.value;
return NewLetter;
},
Write_ToBinary : function(Writer)
{
// Пишем тип дла раза, 1 раз для общей функции чтения, второй раз
// для разделения обычного MathText от PlaceHolder
Writer.WriteLong(this.Type);
// Long : Type
// Long : value
Writer.WriteLong( this.Type );
Writer.WriteLong( this.value );
Writer.WriteLong(this.Type);
Writer.WriteLong(this.value) ;
},
Read_FromBinary : function(Reader)
{
this.Type = Reader.GetLong();
this.value = Reader.GetLong();
}
......
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