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

1. Не учитывался argSize после переноса в ParaMath

2. Поля со свойствами у Accent строго по документации

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56266 954022d7-b5bf-4e40-9824-e11837661b57
parent 3fe786cf
...@@ -855,7 +855,7 @@ ParaMath.prototype = ...@@ -855,7 +855,7 @@ ParaMath.prototype =
// Функция для работы с формулой // Функция для работы с формулой
// в тч с дефолтными текстовыми настройками и argSize // в тч с дефолтными текстовыми настройками и argSize
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
ApplyArgSize : function(oWPrp) ApplyArgSize : function(oWPrp, argSize)
{ {
var tPrp = new CTextPr(); var tPrp = new CTextPr();
var defaultWPrp = var defaultWPrp =
...@@ -873,22 +873,16 @@ ParaMath.prototype = ...@@ -873,22 +873,16 @@ ParaMath.prototype =
var FSize = tPrp.FontSize; var FSize = tPrp.FontSize;
if(this.argSize == -1) if(argSize == -1)
{ {
//aa: 0.0013 bb: 0.66 cc: 0.5
//aa: 0.0009 bb: 0.68 cc: 0.26
FSize = 0.0009*FSize*FSize + 0.68*FSize + 0.26; FSize = 0.0009*FSize*FSize + 0.68*FSize + 0.26;
//FSize = 0.001*FSize*FSize + 0.723*FSize - 1.318; //FSize = 0.65*FSize;
//FSize = 0.0006*FSize*FSize + 0.743*FSize - 1.53;
} }
else if(this.argSize == -2) else if(argSize == -2)
{ {
// aa: -0.0004 bb: 0.66 cc: 0.87
// aa: -0.0014 bb: 0.71 cc: 0.39
// aa: 0 bb: 0.63 cc: 1.11
//FSize = 0.63*FSize + 1.11;
FSize = -0.0004*FSize*FSize + 0.66*FSize + 0.87; FSize = -0.0004*FSize*FSize + 0.66*FSize + 0.87;
//tPrp.FontSize *= 0.473; //FSize = 0.65*FSize*FSize;
} }
tPrp.FontSize = FSize; tPrp.FontSize = FSize;
......
...@@ -44,7 +44,6 @@ function ParaRun(Paragraph, bMathRun) ...@@ -44,7 +44,6 @@ function ParaRun(Paragraph, bMathRun)
this.SearchMarks = new Array(); this.SearchMarks = new Array();
this.SpellingMarks = new Array(); this.SpellingMarks = new Array();
if(bMathRun) if(bMathRun)
{ {
this.typeObj = MATH_PARA_RUN; this.typeObj = MATH_PARA_RUN;
...@@ -4293,7 +4292,7 @@ ParaRun.prototype = ...@@ -4293,7 +4292,7 @@ ParaRun.prototype =
TextPr.Merge(MPrp); // bold, italic TextPr.Merge(MPrp); // bold, italic
} }
this.Parent.ParaMath.ApplyArgSize(TextPr); this.Parent.ParaMath.ApplyArgSize(TextPr, this.Parent.argSize);
} }
else else
TextPr.Merge( this.Pr ); // Мержим прямые настройки данного рана TextPr.Merge( this.Pr ); // Мержим прямые настройки данного рана
......
...@@ -1006,42 +1006,50 @@ function CAccent(props) ...@@ -1006,42 +1006,50 @@ function CAccent(props)
this.Id = g_oIdCounter.Get_NewId(); this.Id = g_oIdCounter.Get_NewId();
this.kind = MATH_ACCENT; this.kind = MATH_ACCENT;
this.chr = null;
this.chrType = null;
this.loc = LOCATION_TOP;
this.operator = new COperator(OPER_ACCENT); this.operator = new COperator(OPER_ACCENT);
//this.code = null; // храним код буквы и тип здесь //this.code = null; // храним код буквы и тип здесь
//this.typeOper = null; // т.к в класах, которые вызываем, не учитываем случаи, когда элементы (стрелки/скобки) переворачиваются //this.typeOper = null; // т.к в класах, которые вызываем, не учитываем случаи, когда элементы (стрелки/скобки) переворачиваются
this.loc = LOCATION_TOP;
CMathBase.call(this); CMathBase.call(this);
this.init(props); this.init(props);
this.setCtrPrp(props.ctrPrp);
if(props.ctrPrp !== null && typeof(props.ctrPrp) !== "undefined")
this.setCtrPrp(props.ctrPrp);
g_oTableId.Add( this, this.Id ); g_oTableId.Add( this, this.Id );
} }
extend(CAccent, CMathBase); extend(CAccent, CMathBase);
CAccent.prototype.init = function(props) CAccent.prototype.init = function(props)
{ {
var prp = this.chr = props.chr;
{ this.chrType = props.chrType;
type: props.chrType,
chr: props.chr,
loc: LOCATION_TOP
};
var defaultPrp = //this.operator.init(prp, defaultPrp);
{ //this.operator.relate(this);
type: ACCENT_CIRCUMFLEX
};
this.operator.init(prp, defaultPrp);
this.operator.relate(this);
this.setDimension(1, 1); this.setDimension(1, 1);
this.setContent(); this.setContent();
this.elements[0][0].SetDot(true); this.elements[0][0].SetDot(true);
}
/// вызов этой функции обязательно в конце CAccent.prototype.setChr = function(chr)
//this.WriteContentsToHistory(); {
this.chr = chr;
this.chrType = null;
this.RecalcInfo.bProps = true;
}
CAccent.prototype.setChrType = function(chrType)
{
this.chr = null;
this.chrType = chrType;
this.RecalcInfo.bProps = true;
} }
CAccent.prototype.old_init = function(properties) CAccent.prototype.old_init = function(properties)
{ {
...@@ -1615,6 +1623,27 @@ CAccent.prototype.Resize = function(Parent, ParaMath, oMeasure) ...@@ -1615,6 +1623,27 @@ CAccent.prototype.Resize = function(Parent, ParaMath, oMeasure)
this.RecalcInfo.bCtrPrp = false; this.RecalcInfo.bCtrPrp = false;
} }
if(this.RecalcInfo.bProps == true)
{
var prp =
{
type: this.chrType,
chr: this.chr,
loc: LOCATION_TOP
};
var defaultPrp =
{
type: ACCENT_CIRCUMFLEX
};
this.operator.init(prp, defaultPrp);
this.operator.relate(this);
this.chr = String.fromCharCode(this.operator.code);
this.chrType = this.operator.typeOper;
}
var base = this.elements[0][0]; var base = this.elements[0][0];
base.Resize(this, ParaMath, oMeasure); base.Resize(this, ParaMath, oMeasure);
...@@ -1741,9 +1770,4 @@ CAccent.prototype.Read_FromBinary2 = function( Reader ) ...@@ -1741,9 +1770,4 @@ CAccent.prototype.Read_FromBinary2 = function( Reader )
var Flags = Reader.GetLong(); var Flags = Reader.GetLong();
if ( Flags & 1 ) if ( Flags & 1 )
this.chr = Reader.GetLong(); this.chr = Reader.GetLong();
} }
CAccent.prototype.Get_Id = function() \ No newline at end of file
{
return this.Id;
}
...@@ -118,7 +118,7 @@ CMathBase.prototype = ...@@ -118,7 +118,7 @@ CMathBase.prototype =
Get_CompiledCtrPrp: function() Get_CompiledCtrPrp: function()
{ {
var CompiledCtrPrp = this.CompiledCtrPrp.Copy(); var CompiledCtrPrp = this.CompiledCtrPrp.Copy();
this.ParaMath.ApplyArgSize(CompiledCtrPrp); this.ParaMath.ApplyArgSize(CompiledCtrPrp, this.argSize);
return CompiledCtrPrp; return CompiledCtrPrp;
}, },
......
...@@ -5232,7 +5232,7 @@ CMathContent.prototype = ...@@ -5232,7 +5232,7 @@ CMathContent.prototype =
oWPrp.Merge(mgWPrp); oWPrp.Merge(mgWPrp);
//this.applyArgSize(oWPrp); //this.applyArgSize(oWPrp);
this.ParaMath.ApplyArgSize(oWPrp); this.ParaMath.ApplyArgSize(oWPrp, this.argSize);
pGraphics.SetFont(oWPrp); pGraphics.SetFont(oWPrp);
} }
......
...@@ -2264,13 +2264,10 @@ function COperator(type) ...@@ -2264,13 +2264,10 @@ function COperator(type)
this.shiftAccent = 0; this.shiftAccent = 0;
} }
COperator.prototype.init = function(properties, defaultProps) // props (chr, type, location), defaultProps (chr, location) COperator.prototype.init = function(properties, defaultProps) // props (chr, type, location), defaultProps (chr, location)
{
var prp = this.getProps(properties, defaultProps);
this.init_2(prp);
}
COperator.prototype.init_2 = function(props)
{ {
var props = this.getProps(properties, defaultProps);
var operator = null, var operator = null,
typeOper = null, typeOper = null,
codeChr = null; codeChr = null;
...@@ -4083,13 +4080,16 @@ function CGroupCharacter(props) ...@@ -4083,13 +4080,16 @@ function CGroupCharacter(props)
CCharacter.call(this); CCharacter.call(this);
this.init(props);
}
extend(CGroupCharacter, CCharacter);
CGroupCharacter.prototype.init = function(props)
{
if(props.vertJc === VJUST_TOP || props.vertJc === VJUST_BOT) if(props.vertJc === VJUST_TOP || props.vertJc === VJUST_BOT)
this.vertJust = props.vertJc; this.vertJust = props.vertJc;
if(props.pos === LOCATION_TOP || props.location === LOCATION_TOP) if(props.pos === LOCATION_TOP || props.pos === LOCATION_BOT)
this.loc = LOCATION_TOP; this.loc = LOCATION_TOP;
else if(props.pos === LOCATION_BOT || props.location === LOCATION_BOT)
this.loc = LOCATION_BOT;
var operDefaultPrp = var operDefaultPrp =
{ {
...@@ -4106,13 +4106,12 @@ function CGroupCharacter(props) ...@@ -4106,13 +4106,12 @@ function CGroupCharacter(props)
this.setCharacter(operProps, operDefaultPrp); this.setCharacter(operProps, operDefaultPrp);
this.setCtrPrp(props.ctrPrp); if(props.ctrPrp !== null && typeof(props.ctrPrp)!== "undefined")
this.setCtrPrp(props.ctrPrp);
/// вызов этой функции обязательно в конце /// вызов этой функции обязательно в конце
//this.WriteContentsToHistory(); g_oTableId.Add( this, this.Id );
g_oTableId.Add( this, this.Id );
} }
extend(CGroupCharacter, CCharacter);
CGroupCharacter.prototype.getAscent = function(oMeasure) CGroupCharacter.prototype.getAscent = function(oMeasure)
{ {
var ascent; var ascent;
...@@ -4292,6 +4291,10 @@ CGroupCharacter.prototype.old_getGlyph = function(code, type) ...@@ -4292,6 +4291,10 @@ CGroupCharacter.prototype.old_getGlyph = function(code, type)
} }
return operator; return operator;
}
CGroupCharacter.prototype.setPos = function() // change location
{
} }
CGroupCharacter.prototype.getPropsForWrite = function() CGroupCharacter.prototype.getPropsForWrite = function()
{ {
......
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