Commit 22c44851 authored by Anna.Pavlova's avatar Anna.Pavlova

1. Поправлен баг на открытие (setArgSize для CMathContent)

2. Поправлен баг на запись : отдавались некорректно свойства CDelimiters
3. Переделаны свойства CEqqArray (без повторной записи в историю Id)
4. У CBox добавлено поле со свойствами класса

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56879 954022d7-b5bf-4e40-9824-e11837661b57
parent c50806b1
......@@ -568,11 +568,20 @@ function CBox(props)
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_BOX;
this.aln = false;
this.Pr =
{
aln: false,
opEmu: false,
diff: false,
noBreak: false,
brk: false
};
/*this.aln = false;
this.opEmu = false;
this.diff = false;
this.noBreak = false;
this.brk = false;
this.brk = false;*/
CMathBase.call(this);
......@@ -592,25 +601,25 @@ CBox.prototype.fillContent = function()
this.setDimension(1, 1);
this.setContent();
if(this.opEmu)
if(this.Pr.opEmu)
this.elements[0][0].decreaseArgSize();
}
CBox.prototype.setProperties = function(props)
{
if(props.opEmu === true || props.opEmu === 1)
this.opEmu = true;
if(props.opEmu === true || props.opEmu === false)
this.Pr.opEmu = props.opEmu;
if(props.diff === true || props.diff === 1)
this.diff = true;
if(props.diff === true || props.diff === false)
this.Pr.diff = props.diff;
if(props.noBreak === true || props.noBreak === 1)
this.noBreak = true;
if(props.noBreak === true || props.noBreak === false)
this.Pr.noBreak = props.noBreak;
if(props.brk === true || props.brk === 1)
this.brk = true;
if(props.brk === true || props.brk === false)
this.Pr.brk = props.brk;
if(props.aln === true || props.aln === 1)
this.aln = true;
if(props.aln === true || props.aln === false)
this.Pr.aln = props.aln;
this.setCtrPrp(props.ctrPrp);
......@@ -630,16 +639,7 @@ CBox.prototype.getBase = function()
}
CBox.prototype.getPropsForWrite = function()
{
var props =
{
aln: this.aln,
opEmu: this.opEmu,
diff: this.diff,
noBreak: this.noBreak,
brk: this.brk
};
return props;
return this.Pr;
}
CBox.prototype.Save_Changes = function(Data, Writer)
{
......@@ -857,7 +857,6 @@ CBar.prototype.Get_Id = function()
function CPhantom(props)
{
this.Id = g_oIdCounter.Get_NewId();
this.props = null;
CMathBase.call(this);
this.Pr =
......@@ -921,7 +920,7 @@ CPhantom.prototype.fillMathComposition = function(props, contents /*array*/)
}
CPhantom.prototype.getPropsForWrite = function()
{
return this.props;
return this.Pr;
}
CPhantom.prototype.Save_Changes = function(Data, Writer)
{
......
......@@ -450,10 +450,10 @@ CDegree.prototype.IsPlhIterator = function()
}
CDegree.prototype.setProperties = function(props)
{
if(props.type === DEGREE_SUPERSCRIPT)
if(props.type === DEGREE_SUPERSCRIPT || props.type === DEGREE_SUBSCRIPT)
this.Pr.type = DEGREE_SUPERSCRIPT;
else
this.Pr.type = DEGREE_SUPERSCRIPT;
else if(props.type === DEGREE_SUBSCRIPT)
this.Pr.type = DEGREE_SUBSCRIPT;
this.setCtrPrp(props.ctrPrp);
......
......@@ -198,8 +198,7 @@ CMathFunc.prototype.fillMathComposition = function(props, contents /*array*/)
}
CMathFunc.prototype.getPropsForWrite = function()
{
var props = {};
return props;
return this.Pr;
}
CMathFunc.prototype.Save_Changes = function(Data, Writer)
{
......
......@@ -888,8 +888,8 @@ CMathContent.prototype =
for(var i = 0; i < this.content.length; i++)
{
if(this.content[i].value.typeObj == MATH_COMP)
this.content[i].value.setArgSize(argSize);
if(this.content[i].typeObj == MATH_COMP)
this.content[i].setArgSize(argSize);
}
}
},
......@@ -5053,7 +5053,6 @@ CMathContent.prototype =
this.Parent = Parent;
}
if (!this.bRoot && this.content.length == 0)
if (!this.degHide)
this.fillPlaceholders();
var lng = this.content.length;
......
......@@ -8,8 +8,6 @@ function CMathMatrix(props)
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_MATRIX;
this.gaps = null;
this.Pr =
{
cGp: 0,
......@@ -24,26 +22,11 @@ function CMathMatrix(props)
plcHide: false
};
this.spaceRow =
{
rule: 0,
gap: 0,
minGap: 13/12 // em
// 780 /20 (pt) for font 36 pt
// minGap: 0
};
this.spaceColumn =
{
rule: 0,
gap: 0,
minGap: 0 // minGap / 20 pt
};
this.spaceRow = null;
this.spaceColumn = null;
this.gaps = null;
this.gaps =
{
row: [],
column: []
};
this.setDefaultSpace();
//// special for "read" ////
this.row = 0;
......@@ -64,6 +47,29 @@ CMathMatrix.prototype.init = function(props)
this.setProperties(props);
this.fillContent();
}
CMathMatrix.prototype.setDefaultSpace = function()
{
this.spaceRow =
{
rule: 0,
gap: 0,
minGap: 13/12 // em
// 780 /20 (pt) for font 36 pt
// minGap: 0
};
this.spaceColumn =
{
rule: 0,
gap: 0,
minGap: 0 // minGap / 20 pt
};
this.gaps =
{
row: [],
column: []
};
}
CMathMatrix.prototype.setRuleGap = function(oSpace, rule, gap, minGap)
{
var bInt = rule == rule - 0 && rule == rule^ 0,
......@@ -591,49 +597,71 @@ function CEqArray(props)
this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_EQ_ARRAY;
this.maxDist = 0;
this.objDist = 0;
this.init_2(props);
g_oTableId.Add( this, this.Id );
}
extend(CEqArray, CMathMatrix);
CEqArray.prototype.init_2 = function(props)
{
var Pr =
this.Pr =
{
column: 1,
row: props.row,
baseJc: BASEJC_CENTER,
rSpRule: 0,
rSp: 0,
/* only for CEqArray*/
maxDist: 0,
objDist: 0,
ctrPrp: new CTextPr()
/**/
cGp: 0,
cGpRule: 0,
cSp: 0,
rSp: 0,
rSpRule: 0,
}; // default
mcJc: new Array(),
baseJc: BASEJC_CENTER,
plcHide: false
};
this.spaceRow = null;
this.spaceColumn = null;
this.gaps = null;
if(props.rSpRule !== "undefined" && props.rSpRule !== null)
Pr.rSpRule = props.rSpRule;
this.setDefaultSpace();
if(props.rSp !== "undefined" && props.rSp !== null)
Pr.rSp = props.rSp;
//// special for "read" ////
this.column = 0;
////
if(props.baseJc !== "undefined" && props.baseJc !== null)
Pr.baseJc = props.baseJc;
//CMathMatrix.call(this);
// Делаем так, чтобы лишный Id в историю не записался
CMathMatrix.superclass.constructor.call(this);
if(props !== null && typeof(props) !== "undefined")
this.init(props);
g_oTableId.Add( this, this.Id );
}
extend(CEqArray, CMathMatrix);
CEqArray.prototype.init = function(props)
{
this.setProperties(props);
this.fillContent();
}
CEqArray.prototype.setProperties = function(props)
{
if(props.maxDist !== "undefined" && props.maxDist !== null)
this.maxDist = props.maxDist;
this.Pr.maxDist = props.maxDist;
if(props.objDist !== "undefined" && props.objDist !== null)
this.objDist = props.objDist;
this.Pr.objDist = props.objDist;
var Pr =
{
column: 1,
row: props.row,
baseJc: props.baseJc,
if(props.ctrPrp !== "undefined" && props.ctrPrp !== null)
Pr.ctrPrp = props.ctrPrp;
rSpRule: props.rSpRule,
rSp: props.rSp,
ctrPrp: props.ctrPrp
};
CEqArray.superclass.constructor.call(this, Pr);
CEqArray.superclass.setProperties.call(this, Pr);
}
CEqArray.prototype.getElement = function(num)
{
......@@ -649,17 +677,7 @@ CEqArray.prototype.fillMathComposition = function(props, contents /*array*/)
}
CEqArray.prototype.getPropsForWrite = function()
{
var props = {};
props.row = this.nRow;
props.baseJc = this.baseJc;
props.rSpRule = this.spaceRow.rule;
props.rSp = this.spaceRow.gap;
props.maxDist = this.maxDist;
props.objDist = this.objDist;
return props;
return this.Pr;
}
CEqArray.prototype.Save_Changes = function(Data, Writer)
{
......
......@@ -2955,7 +2955,7 @@ COperator.prototype.getProps = function(props, defaultProps)
this.defaultType = defaultProps.type;
var bDelimiter = this.type == OPER_DELIMITER || this.type == OPER_SEPARATOR,
bNotType = typeof(props.type)=="undefined" || props.type == null,
bNotType = typeof(props.type) == "undefined" || props.type == null,
bStr = typeof(chr) === "string",
bEmptyStr = bStr && chr.length == 0,
bCode = typeof(chr) === "string" && chr.length > 0;
......@@ -3905,16 +3905,15 @@ CDelimiter.prototype.getBase = function(numb)
}
CDelimiter.prototype.getPropsForWrite = function()
{
var props = {};
props.grow = this.grow == true ? 1 : 0;
props.column = this.nCol;
props.shp = this.shape;
props.begChr = this.begOper.getChr(); // default: PARENTHESIS_LEFT
props.endChr = this.endOper.getChr(); // default: PARENTHESIS_RIGHT
props.sepChr = this.sepOper.getChr(); // default: DELIMITER_LINE
var props =
{
grow: this.Pr.grow,
column: this.nCol,
shp: this.Pr.shp,
begChr: this.begOper.getChr(), // default: PARENTHESIS_LEFT
endChr: this.endOper.getChr(), // default: PARENTHESIS_RIGHT
sepChr: this.sepOper.getChr() // default: DELIMITER_LINE
};
return props;
}
......
......@@ -1355,12 +1355,7 @@ CRadical.prototype.getDegree = function()
}
CRadical.prototype.getPropsForWrite = function()
{
var props =
{
degHide: this.Pr.degHide
};
return props;
return this.Pr;
}
CRadical.prototype.Save_Changes = function(Data, Writer)
{
......
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