Commit 78272213 authored by Anna.Pavlova's avatar Anna.Pavlova Committed by Alexander.Trofimov

Поправила баг на открытие N-арных операторов

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55498 954022d7-b5bf-4e40-9824-e11837661b57
parent 5f16c404
...@@ -774,14 +774,14 @@ ParaMath.prototype = ...@@ -774,14 +774,14 @@ ParaMath.prototype =
{ {
// TODO: ParaMath.Cursor_MoveToStartPos // TODO: ParaMath.Cursor_MoveToStartPos
this.Math.Cursor_MoveToStartPos(); this.Root.Cursor_MoveToStartPos();
}, },
Cursor_MoveToEndPos : function(SelectFromEnd) Cursor_MoveToEndPos : function(SelectFromEnd)
{ {
// TODO: ParaMath.Cursor_MoveToEndPos // TODO: ParaMath.Cursor_MoveToEndPos
this.Math.Cursor_MoveToEndPos(); this.Root.Cursor_MoveToEndPos();
}, },
Get_ParaContentPosByXY : function(SearchPos, Depth, _CurLine, _CurRange, StepEnd, Flag) // получить логическую позицию по XY Get_ParaContentPosByXY : function(SearchPos, Depth, _CurLine, _CurRange, StepEnd, Flag) // получить логическую позицию по XY
...@@ -866,7 +866,6 @@ ParaMath.prototype = ...@@ -866,7 +866,6 @@ ParaMath.prototype =
// TODO: ParaMath.Get_PosByElement // TODO: ParaMath.Get_PosByElement
}, },
Get_RunElementByPos : function(ContentPos, Depth) Get_RunElementByPos : function(ContentPos, Depth)
{ {
return null; return null;
...@@ -875,12 +874,14 @@ ParaMath.prototype = ...@@ -875,12 +874,14 @@ ParaMath.prototype =
Get_LeftPos : function(SearchPos, ContentPos, Depth, UseContentPos) Get_LeftPos : function(SearchPos, ContentPos, Depth, UseContentPos)
{ {
// TODO: ParaMath.Get_LeftPos // TODO: ParaMath.Get_LeftPos
this.Root.Get_LeftPos(SearchPos, ContentPos, Depth, UseContentPos);
return false; return false;
}, },
Get_RightPos : function(SearchPos, ContentPos, Depth, UseContentPos, StepEnd) Get_RightPos : function(SearchPos, ContentPos, Depth, UseContentPos, StepEnd)
{ {
// TODO: ParaMath.Get_RightPos // TODO: ParaMath.Get_RightPos
this.Root.Get_RightPos(SearchPos, ContentPos, Depth, UseContentPos, StepEnd);
return false; return false;
}, },
...@@ -912,11 +913,13 @@ ParaMath.prototype = ...@@ -912,11 +913,13 @@ ParaMath.prototype =
Get_StartPos : function(ContentPos, Depth) Get_StartPos : function(ContentPos, Depth)
{ {
// TODO: ParaMath.Get_StartPos // TODO: ParaMath.Get_StartPos
this.Root.Get_StartPos(ContentPos, Depth);
}, },
Get_EndPos : function(BehindEnd, ContentPos, Depth) Get_EndPos : function(BehindEnd, ContentPos, Depth)
{ {
// TODO: ParaMath.Get_EndPos // TODO: ParaMath.Get_EndPos
this.Root.Get_EndPos(BehindEnd, ContentPos, Depth);
}, },
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// Функции для работы с селектом // Функции для работы с селектом
...@@ -925,25 +928,6 @@ ParaMath.prototype = ...@@ -925,25 +928,6 @@ ParaMath.prototype =
{ {
// TODO: ParaMath.Set_SelectionContentPos // TODO: ParaMath.Set_SelectionContentPos
if(StartFlag == 0)
{
var str = "";
for(var i = 0; i < StartContentPos.Data.length; i++)
str += StartContentPos.Data[i] + " ";
//console.log("StartContentPos " + str);
}
if(EndFlag == 0)
{
var str = "";
for(var i = 0; i < EndContentPos.Data.length; i++)
str += EndContentPos.Data [i]+ " ";
//console.log("EndContentPos " + str);
}
this.Root.Set_SelectionContentPos(StartContentPos, EndContentPos, Depth, StartFlag, EndFlag); this.Root.Set_SelectionContentPos(StartContentPos, EndContentPos, Depth, StartFlag, EndFlag);
this.bSelectionUse = true; this.bSelectionUse = true;
...@@ -1042,8 +1026,7 @@ ParaMath.prototype = ...@@ -1042,8 +1026,7 @@ ParaMath.prototype =
if(start == end) if(start == end)
{ {
if(SelectContent.content[start].typeObj == MATH_PLACEHOLDER) bPlaceholder = SelectContent.IsPlaceholder();
bPlaceholder = true;
} }
return bPlaceholder; return bPlaceholder;
......
...@@ -736,10 +736,10 @@ function BinaryFileWriter(doc) ...@@ -736,10 +736,10 @@ function BinaryFileWriter(doc)
this.WriteTable(c_oSerTableTypes.Numbering, new BinaryNumberingTableWriter(this.memory, this.Document, oNumIdMap)); this.WriteTable(c_oSerTableTypes.Numbering, new BinaryNumberingTableWriter(this.memory, this.Document, oNumIdMap));
//Write StyleTable //Write StyleTable
this.WriteTable(c_oSerTableTypes.Style, new BinaryStyleTableWriter(this.memory, this.Document, oNumIdMap)); this.WriteTable(c_oSerTableTypes.Style, new BinaryStyleTableWriter(this.memory, this.Document, oNumIdMap));
//Write DocumentTable //Write DocumentTable
var oBinaryHeaderFooterTableWriter = new BinaryHeaderFooterTableWriter(this.memory, this.Document, oNumIdMap); var oBinaryHeaderFooterTableWriter = new BinaryHeaderFooterTableWriter(this.memory, this.Document, oNumIdMap);
this.WriteTable(c_oSerTableTypes.Document, new BinaryDocumentTableWriter(this.memory, this.Document, oMapCommentId, oNumIdMap, null, oBinaryHeaderFooterTableWriter)); this.WriteTable(c_oSerTableTypes.Document, new BinaryDocumentTableWriter(this.memory, this.Document, oMapCommentId, oNumIdMap, null, oBinaryHeaderFooterTableWriter));
//Write HeaderFooter //Write HeaderFooter
this.WriteTable(c_oSerTableTypes.HdrFtr, oBinaryHeaderFooterTableWriter); this.WriteTable(c_oSerTableTypes.HdrFtr, oBinaryHeaderFooterTableWriter);
//Write OtherTable //Write OtherTable
var oBinaryOtherTableWriter = new BinaryOtherTableWriter(this.memory, this.Document) var oBinaryOtherTableWriter = new BinaryOtherTableWriter(this.memory, this.Document)
...@@ -1024,7 +1024,7 @@ function BinaryStyleTableWriter(memory, doc, oNumIdMap, oUsedStyleMap) ...@@ -1024,7 +1024,7 @@ function BinaryStyleTableWriter(memory, doc, oNumIdMap, oUsedStyleMap)
function Binary_pPrWriter(memory, oNumIdMap, oBinaryHeaderFooterTableWriter) function Binary_pPrWriter(memory, oNumIdMap, oBinaryHeaderFooterTableWriter)
{ {
this.memory = memory; this.memory = memory;
this.oNumIdMap = oNumIdMap; this.oNumIdMap = oNumIdMap;
this.oBinaryHeaderFooterTableWriter = oBinaryHeaderFooterTableWriter; this.oBinaryHeaderFooterTableWriter = oBinaryHeaderFooterTableWriter;
this.bs = new BinaryCommonWriter(this.memory); this.bs = new BinaryCommonWriter(this.memory);
this.brPrs = new Binary_rPrWriter(this.memory); this.brPrs = new Binary_rPrWriter(this.memory);
...@@ -1431,9 +1431,9 @@ function Binary_pPrWriter(memory, oNumIdMap, oBinaryHeaderFooterTableWriter) ...@@ -1431,9 +1431,9 @@ function Binary_pPrWriter(memory, oNumIdMap, oBinaryHeaderFooterTableWriter)
else if(null != sectPr.FooterFirst) else if(null != sectPr.FooterFirst)
item = sectPr.FooterFirst; item = sectPr.FooterFirst;
if(null != item) if(null != item)
{ {
var nH = sectPr.Get_PageHeight(); var nH = sectPr.Get_PageHeight();
if(null == nH) if(null == nH)
nH = Page_Height; nH = Page_Height;
this.memory.WriteByte(c_oSer_pgMarType.Footer); this.memory.WriteByte(c_oSer_pgMarType.Footer);
this.memory.WriteByte(c_oSerPropLenType.Double); this.memory.WriteByte(c_oSerPropLenType.Double);
...@@ -1460,47 +1460,47 @@ function Binary_pPrWriter(memory, oNumIdMap, oBinaryHeaderFooterTableWriter) ...@@ -1460,47 +1460,47 @@ function Binary_pPrWriter(memory, oNumIdMap, oBinaryHeaderFooterTableWriter)
}; };
this.WriteHdr = function(sectPr) this.WriteHdr = function(sectPr)
{ {
var oThis = this; var oThis = this;
var nIndex; var nIndex;
if(null != this.oBinaryHeaderFooterTableWriter){ if(null != this.oBinaryHeaderFooterTableWriter){
if(null != sectPr.HeaderDefault){ if(null != sectPr.HeaderDefault){
nIndex = this.oBinaryHeaderFooterTableWriter.aHeaders.length;
this.bs.WriteItem(c_oSerProp_secPrType.hdrftrelem, function(){oThis.memory.WriteLong(nIndex);});
this.oBinaryHeaderFooterTableWriter.aHeaders.push({type: c_oSerHdrFtrTypes.HdrFtr_Odd, elem: sectPr.HeaderDefault});
}
if(null != sectPr.HeaderEven){
nIndex = this.oBinaryHeaderFooterTableWriter.aHeaders.length; nIndex = this.oBinaryHeaderFooterTableWriter.aHeaders.length;
this.bs.WriteItem(c_oSerProp_secPrType.hdrftrelem, function(){oThis.memory.WriteLong(nIndex);}); this.bs.WriteItem(c_oSerProp_secPrType.hdrftrelem, function(){oThis.memory.WriteLong(nIndex);});
this.oBinaryHeaderFooterTableWriter.aHeaders.push({type: c_oSerHdrFtrTypes.HdrFtr_Odd, elem: sectPr.HeaderDefault}); this.oBinaryHeaderFooterTableWriter.aHeaders.push({type: c_oSerHdrFtrTypes.HdrFtr_Even, elem: sectPr.HeaderEven});
} }
if(null != sectPr.HeaderEven){ if(null != sectPr.HeaderFirst){
nIndex = this.oBinaryHeaderFooterTableWriter.aHeaders.length; nIndex = this.oBinaryHeaderFooterTableWriter.aHeaders.length;
this.bs.WriteItem(c_oSerProp_secPrType.hdrftrelem, function(){oThis.memory.WriteLong(nIndex);}); this.bs.WriteItem(c_oSerProp_secPrType.hdrftrelem, function(){oThis.memory.WriteLong(nIndex);});
this.oBinaryHeaderFooterTableWriter.aHeaders.push({type: c_oSerHdrFtrTypes.HdrFtr_Even, elem: sectPr.HeaderEven}); this.oBinaryHeaderFooterTableWriter.aHeaders.push({type: c_oSerHdrFtrTypes.HdrFtr_First, elem: sectPr.HeaderFirst});
} }
if(null != sectPr.HeaderFirst){ }
nIndex = this.oBinaryHeaderFooterTableWriter.aHeaders.length; }
this.bs.WriteItem(c_oSerProp_secPrType.hdrftrelem, function(){oThis.memory.WriteLong(nIndex);}); this.WriteFtr = function(sectPr)
this.oBinaryHeaderFooterTableWriter.aHeaders.push({type: c_oSerHdrFtrTypes.HdrFtr_First, elem: sectPr.HeaderFirst}); {
} var oThis = this;
} var nIndex;
} if(null != this.oBinaryHeaderFooterTableWriter){
this.WriteFtr = function(sectPr) if(null != sectPr.FooterDefault){
{ nIndex = this.oBinaryHeaderFooterTableWriter.aFooters.length;
var oThis = this; this.bs.WriteItem(c_oSerProp_secPrType.hdrftrelem, function(){oThis.memory.WriteLong(nIndex);});
var nIndex; this.oBinaryHeaderFooterTableWriter.aFooters.push({type: c_oSerHdrFtrTypes.HdrFtr_Odd, elem: sectPr.FooterDefault});
if(null != this.oBinaryHeaderFooterTableWriter){ }
if(null != sectPr.FooterDefault){ if(null != sectPr.FooterEven){
nIndex = this.oBinaryHeaderFooterTableWriter.aFooters.length; nIndex = this.oBinaryHeaderFooterTableWriter.aFooters.length;
this.bs.WriteItem(c_oSerProp_secPrType.hdrftrelem, function(){oThis.memory.WriteLong(nIndex);}); this.bs.WriteItem(c_oSerProp_secPrType.hdrftrelem, function(){oThis.memory.WriteLong(nIndex);});
this.oBinaryHeaderFooterTableWriter.aFooters.push({type: c_oSerHdrFtrTypes.HdrFtr_Odd, elem: sectPr.FooterDefault}); this.oBinaryHeaderFooterTableWriter.aFooters.push({type: c_oSerHdrFtrTypes.HdrFtr_Even, elem: sectPr.FooterEven});
} }
if(null != sectPr.FooterEven){ if(null != sectPr.FooterFirst){
nIndex = this.oBinaryHeaderFooterTableWriter.aFooters.length; nIndex = this.oBinaryHeaderFooterTableWriter.aFooters.length;
this.bs.WriteItem(c_oSerProp_secPrType.hdrftrelem, function(){oThis.memory.WriteLong(nIndex);}); this.bs.WriteItem(c_oSerProp_secPrType.hdrftrelem, function(){oThis.memory.WriteLong(nIndex);});
this.oBinaryHeaderFooterTableWriter.aFooters.push({type: c_oSerHdrFtrTypes.HdrFtr_Even, elem: sectPr.FooterEven}); this.oBinaryHeaderFooterTableWriter.aFooters.push({type: c_oSerHdrFtrTypes.HdrFtr_First, elem: sectPr.FooterFirst});
} }
if(null != sectPr.FooterFirst){ }
nIndex = this.oBinaryHeaderFooterTableWriter.aFooters.length;
this.bs.WriteItem(c_oSerProp_secPrType.hdrftrelem, function(){oThis.memory.WriteLong(nIndex);});
this.oBinaryHeaderFooterTableWriter.aFooters.push({type: c_oSerHdrFtrTypes.HdrFtr_First, elem: sectPr.FooterFirst});
}
}
} }
}; };
function Binary_rPrWriter(memory) function Binary_rPrWriter(memory)
...@@ -3372,8 +3372,8 @@ function BinaryHeaderFooterTableWriter(memory, doc, oNumIdMap) ...@@ -3372,8 +3372,8 @@ function BinaryHeaderFooterTableWriter(memory, doc, oNumIdMap)
{ {
this.memory = memory; this.memory = memory;
this.Document = doc; this.Document = doc;
this.oNumIdMap = oNumIdMap; this.oNumIdMap = oNumIdMap;
this.aHeaders = []; this.aHeaders = [];
this.aFooters = []; this.aFooters = [];
this.bs = new BinaryCommonWriter(this.memory); this.bs = new BinaryCommonWriter(this.memory);
this.Write = function() this.Write = function()
...@@ -3393,11 +3393,11 @@ function BinaryHeaderFooterTableWriter(memory, doc, oNumIdMap) ...@@ -3393,11 +3393,11 @@ function BinaryHeaderFooterTableWriter(memory, doc, oNumIdMap)
}; };
this.WriteHdrFtrContent = function(aHdrFtr) this.WriteHdrFtrContent = function(aHdrFtr)
{ {
var oThis = this; var oThis = this;
for(var i = 0, length = aHdrFtr.length; i < length; ++i) for(var i = 0, length = aHdrFtr.length; i < length; ++i)
{ {
var item = aHdrFtr[i]; var item = aHdrFtr[i];
this.bs.WriteItem(item.type, function(){oThis.WriteHdrFtrItem(item.elem);}); this.bs.WriteItem(item.type, function(){oThis.WriteHdrFtrItem(item.elem);});
} }
}; };
this.WriteHdrFtrItem = function(item) this.WriteHdrFtrItem = function(item)
...@@ -5650,17 +5650,17 @@ function Binary_pPrReader(doc, oReadResult, stream) ...@@ -5650,17 +5650,17 @@ function Binary_pPrReader(doc, oReadResult, stream)
if(null != oNewSectionPr.HeaderDefault) if(null != oNewSectionPr.HeaderDefault)
oNewSectionPr.HeaderDefault.Set_BoundY2(oAdditional.HeaderMargin, false); oNewSectionPr.HeaderDefault.Set_BoundY2(oAdditional.HeaderMargin, false);
} }
if(null != oAdditional.FooterMargin){ if(null != oAdditional.FooterMargin){
var nH = oNewSectionPr.Get_PageHeight(); var nH = oNewSectionPr.Get_PageHeight();
if(null == nH) if(null == nH)
nH = Page_Height; nH = Page_Height;
var nMargin = nH - oAdditional.FooterMargin; var nMargin = nH - oAdditional.FooterMargin;
if(null != oNewSectionPr.FooterFirst) if(null != oNewSectionPr.FooterFirst)
oNewSectionPr.FooterFirst.Set_BoundY2(nMargin, false); oNewSectionPr.FooterFirst.Set_BoundY2(nMargin, false);
if(null != oNewSectionPr.FooterEven) if(null != oNewSectionPr.FooterEven)
oNewSectionPr.FooterEven.Set_BoundY2(nMargin, false); oNewSectionPr.FooterEven.Set_BoundY2(nMargin, false);
if(null != oNewSectionPr.FooterDefault) if(null != oNewSectionPr.FooterDefault)
oNewSectionPr.FooterDefault.Set_BoundY2(nMargin, false); oNewSectionPr.FooterDefault.Set_BoundY2(nMargin, false);
} }
this.paragraph.Set_SectionPr(oNewSectionPr); this.paragraph.Set_SectionPr(oNewSectionPr);
} }
...@@ -7112,7 +7112,7 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow ...@@ -7112,7 +7112,7 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
if(null != oAdditional.FooterMargin){ if(null != oAdditional.FooterMargin){
var nH = oSectPr.Get_PageHeight(); var nH = oSectPr.Get_PageHeight();
if(null == nH) if(null == nH)
nH = Page_Height; nH = Page_Height;
var nMargin = nH - oAdditional.FooterMargin; var nMargin = nH - oAdditional.FooterMargin;
if(null != oSectPr.FooterFirst) if(null != oSectPr.FooterFirst)
oSectPr.FooterFirst.Set_BoundY2(nMargin, false); oSectPr.FooterFirst.Set_BoundY2(nMargin, false);
...@@ -10278,6 +10278,7 @@ function Binary_oMathReader(stream) ...@@ -10278,6 +10278,7 @@ function Binary_oMathReader(stream)
{ {
if (!props.init) if (!props.init)
{ {
oNary.relate(oParent);
oNary.init(props); oNary.init(props);
oParent.addElementToContent(oNary); oParent.addElementToContent(oNary);
props.init = true; props.init = true;
......
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