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