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

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55954 954022d7-b5bf-4e40-9824-e11837661b57
parent 8b7039e8
......@@ -183,6 +183,108 @@ CCircumflex.prototype.relate = function(parent)
this.Parent = parent;
}
function CAccentCircumflex()
{
CGlyphOperator.call(this);
}
extend(CAccentCircumflex, CGlyphOperator);
CAccentCircumflex.prototype.calcSize = function(stretch)
{
var alpha = this.getCtrPrp().FontSize/36;
var width = 3.88*alpha;
var height = 3.175*alpha;
var augm = 0.9*stretch/width;
if(augm < 1)
augm = 1;
else if (augm > 5)
augm = 5;
width *= augm;
return {width: width, height: height};
}
CAccentCircumflex.prototype.calcCoord = function(stretch)
{
var fontSize = this.getCtrPrp().FontSize;
//var penW = fontSize*g_dKoef_pt_to_mm*this.PEN_W;
//penW *= 96/25.4;
// g_dKoef_px_to_mm = 25.4/96
var textScale = fontSize/1000, // 1000 pt
alpha = textScale*25.4/96 /64;
var X = new Array(),
Y = new Array();
X[0] = 0; Y[0] = 2373;
X[1] = 9331; Y[1] = 15494;
X[2] = 14913; Y[2] = 15494;
X[3] = 23869; Y[3] = 2373;
X[4] = 20953; Y[4] = 0;
X[5] = 12122; Y[5] = 10118;
X[6] = 11664; Y[6] = 10118;
X[7] = 2833; Y[7] = 0;
X[8] = 0; Y[8] = 2373;
var XX = new Array(),
YY = new Array();
var W = stretch/alpha;
var a1 = X[3] - X[0], b1 = W, c1 = X[2] - X[1],
a2 = X[4] - X[7], b2 = W - 2*X[7], c2 = X[5] - X[6] ; //X[8] = 0
var RX = new Array();
for(var i = 0; i < X.length; i++)
RX[i] = 1;
RX[0] = RX[2] = (b1 - c1)/(a1-c1);
RX[4] = RX[6] = (b2 - c2)/(a2-c2);
XX[0] = XX[8] = X[0];
YY[0] = YY[8] = Y[0];
for(var i = 0; i< 4; i++)
{
XX[1 + i] = XX[i] + RX[i]*(X[1+i] - X[i]);
XX[7-i] = XX[8 - i] + RX[7-i]*(X[7-i] - X[8-i]);
YY[1+i] = Y[1+i];
YY[7-i] = Y[7-i];
}
for(var i = 0; i < XX.length; i++)
{
XX[i] = XX[i]*alpha ;
YY[i] = YY[i]*alpha;
}
var H = YY[1];
W = XX[3];
return {XX: XX, YY: YY, W: W, H: H};
}
CAccentCircumflex.prototype.drawPath = function(pGraphics, XX, YY)
{
pGraphics._m(XX[0], YY[0]);
pGraphics._l(XX[1], YY[1]);
pGraphics._l(XX[2], YY[2]);
pGraphics._l(XX[3], YY[3]);
pGraphics._l(XX[4], YY[4]);
pGraphics._l(XX[5], YY[5]);
pGraphics._l(XX[6], YY[6]);
pGraphics._l(XX[7], YY[7]);
pGraphics._l(XX[8], YY[8]);
pGraphics._l(XX[9], YY[9]);
pGraphics._l(XX[10], YY[10]);
pGraphics._l(XX[11], YY[11]);
}
function CLine()
{
......@@ -239,6 +341,49 @@ CLine.prototype.relate = function(parent)
this.Parent = parent;
}
function CAccentLine()
{
CGlyphOperator.call(this);
}
extend(CAccentLine, CGlyphOperator);
CAccentLine.prototype.calcSize = function(stretch)
{
var alpha = this.Parent.getCtrPrp().FontSize/36;
var height = 1.68*alpha;
var width = 4.938*alpha;
width = stretch > width ? stretch : width;
return {width: width, height: height};
}
CAccentLine.prototype.calcCoord = function(stretch)
{
var fontSize = this.getCtrPrp().FontSize;
var X = new Array(),
Y = new Array();
X[0] = 0; Y[0] = 0;
X[1] = stretch; Y[1] = 0;
X[2] = stretch; Y[2] = 0.011*fontSize;
X[3] = 0; Y[3] = Y[2];
X[4] = 0; Y[4] = 0;
var W = X[2],
H = Y[2];
return {XX: X, YY: Y, W: W, H: H};
}
CAccentLine.prototype.drawPath = function(pGraphics, XX, YY)
{
pGraphics._m(XX[0], YY[0]);
pGraphics._l(XX[1], YY[1]);
pGraphics._l(XX[2], YY[2]);
pGraphics._l(XX[3], YY[3]);
pGraphics._l(XX[4], YY[4]);
}
function CDoubleLine()
{
this.PEN_W = 0.04;
......@@ -296,6 +441,64 @@ CDoubleLine.prototype.relate = function(parent)
this.Parent = parent;
}
function CAccentDoubleLine()
{
CGlyphOperator.call(this);
}
extend(CAccentDoubleLine, CGlyphOperator);
CAccentDoubleLine.prototype.calcSize = function(stretch)
{
var alpha = this.getCtrPrp().FontSize/36;
var height = 2.843*alpha;
var width = 4.938*alpha;
width = stretch > width ? stretch : width;
return {width: width, height: height};
}
CAccentDoubleLine.prototype.calcCoord = function(stretch)
{
var fontSize = this.getCtrPrp().FontSize;
var X = new Array(),
Y = new Array();
X[0] = 0; Y[0] = 0;
X[1] = stretch; Y[1] = 0;
X[2] = stretch; Y[2] = 0.011*fontSize;
X[3] = 0; Y[3] = Y[2];
X[4] = 0; Y[4] = 0;
X[5] = 0; Y[5] = 0.039486*fontSize;
X[6] = stretch; Y[6] = Y[5];
X[7] = stretch; Y[7] = 0.0503*fontSize;
X[8] = 0; Y[8] = Y[7];
X[9] = 0; Y[9] = Y[5];
var W = X[7],
H = Y[7];
return {XX: X, YY: Y, W: W, H: H};
}
CAccentDoubleLine.prototype.drawPath = function(pGraphics, XX, YY)
{
pGraphics._m(XX[0], YY[0]);
pGraphics._l(XX[1], YY[1]);
pGraphics._l(XX[2], YY[2]);
pGraphics._l(XX[3], YY[3]);
pGraphics._l(XX[4], YY[4]);
pGraphics.df();
pGraphics._s();
pGraphics._m(XX[5], YY[5]);
pGraphics._l(XX[6], YY[6]);
pGraphics._l(XX[7], YY[7]);
pGraphics._l(XX[8], YY[8]);
pGraphics._l(XX[9], YY[9]);
}
function CTilde()
{
}
......@@ -404,6 +607,92 @@ CTilde.prototype.relate = function(parent)
this.Parent = parent;
}
function CAccentTilde()
{
CGlyphOperator.call(this);
}
extend(CAccentTilde, CGlyphOperator);
CAccentTilde.prototype.calcSize = function(stretch)
{
var betta = this.getCtrPrp().FontSize/36;
var width = 9.047509765625*betta; // реальная на отрисовке width 7.495282031249999
var height = 2.469444444444444*betta;
return {width: width, height: height};
}
CAccentTilde.prototype.calcCoord = function(stretch)
{
var X = new Array(),
Y = new Array();
X[0] = 0; Y[0] = 3066;
X[1] = 2125; Y[1] = 7984;
X[2] = 5624; Y[2] = 11256;
X[3] = 9123; Y[3] = 14528;
X[4] = 13913; Y[4] = 14528;
X[5] = 18912; Y[5] = 14528;
X[6] = 25827; Y[6] = 10144;
X[7] = 32742; Y[7] = 5760;
X[8] = 36324; Y[8] = 5760;
X[9] = 39865; Y[9] = 5760;
X[10] = 42239; Y[10] = 7641;
X[11] = 44614; Y[11] = 9522;
X[12] = 47030; Y[12] = 13492;
X[13] = 50362; Y[13] = 11254;
X[14] = 48571; Y[14] = 7544;
X[15] = 44697; Y[15] = 3772;
X[16] = 40823; Y[16] = 0;
X[17] = 35283; Y[17] = 0;
X[18] = 29951; Y[18] = 0;
X[19] = 23098; Y[19] = 4384;
X[20] = 16246; Y[20] = 8768;
X[21] = 12622; Y[21] = 8768;
X[22] = 9581; Y[22] = 8768;
X[23] = 7290; Y[23] = 6845;
X[24] = 4999; Y[24] = 4922;
X[25] = 3249; Y[25] = 1243;
X[26] = 0; Y[26] = 3066;
var XX = new Array(),
YY = new Array();
var fontSize = this.Parent.getCtrPrp().FontSize;
var textScale = fontSize/1000, // 1000 pt
alpha = textScale*25.4/96 /64 ; // g_dKoef_px_to_mm = 25.4/96
for(var i = 0; i < X.length; i++)
{
XX[i] = X[i]*alpha;
YY[i] = (Y[5] - Y[i])*alpha*0.65; // сжали !
}
var W = X[13],
H = Y[5];
return {XX: X, YY: Y, W: W, H: H};
}
CAccentTilde.prototype.drawPath = function(pGraphics, XX, YY)
{
pGraphics._m(XX[0], YY[0]);
pGraphics._c(XX[0], YY[0], XX[1], YY[1], XX[2], YY[2] );
pGraphics._c(XX[2], YY[2], XX[3], YY[3], XX[4], YY[4] );
pGraphics._c(XX[4], YY[4], XX[5], YY[5], XX[6], YY[6] );
pGraphics._c(XX[6], YY[6], XX[7], YY[7], XX[8], YY[8] );
pGraphics._c(XX[8], YY[8], XX[9], YY[9], XX[10], YY[10] );
pGraphics._c(XX[10], YY[10], XX[11], YY[11], XX[12], YY[12] );
pGraphics._l(XX[13], YY[13]);
pGraphics._c(XX[13], YY[13], XX[14], YY[14], XX[15], YY[15] );
pGraphics._c(XX[15], YY[15], XX[16], YY[16], XX[17], YY[17] );
pGraphics._c(XX[17], YY[17], XX[18], YY[18], XX[19], YY[19] );
pGraphics._c(XX[19], YY[19], XX[20], YY[20], XX[21], YY[21] );
pGraphics._c(XX[21], YY[21], XX[22], YY[22], XX[23], YY[23] );
pGraphics._c(XX[23], YY[23], XX[24], YY[24], XX[25], YY[25] );
pGraphics._l(XX[26], YY[26]);
}
function CBreve()
{
this.turn = TURN_MIRROR_0;
......@@ -520,6 +809,85 @@ CBreve.prototype.relate = function(parent)
this.Parent = parent;
}
function CAccentBreve()
{
CGlyphOperator.call(this);
}
extend(CAccentBreve, CGlyphOperator);
CAccentBreve.prototype.calcSize = function(stretch)
{
var betta = this.getCtrPrp().FontSize/36;
var width = 4.2333333333333325*betta;
var height = 2.469444444444445*betta;
return {width: width, height: height};
}
CAccentBreve.prototype.calcCoord = function(stretch)
{
var X = new Array(),
Y = new Array();
X[0] = 25161; Y[0] = 11372;
X[1] = 24077; Y[1] = 5749;
X[2] = 20932; Y[2] = 2875;
X[3] = 17787; Y[3] = 0;
X[4] = 12247; Y[4] = 0;
X[5] = 7082; Y[5] = 0;
X[6] = 4083; Y[6] = 2854;
X[7] = 1083; Y[7] = 5707;
X[8] = 0; Y[8] = 11372;
X[9] = 3208; Y[9] = 12371;
X[10] = 4249; Y[10] = 9623;
X[11] = 5561; Y[11] = 8083;
X[12] = 6873; Y[12] = 6542;
X[13] = 8456; Y[13] = 5959;
X[14] = 10039; Y[14] = 5376;
X[15] = 12414; Y[15] = 5376;
X[16] = 14746; Y[16] = 5376;
X[17] = 16454; Y[17] = 5980;
X[18] = 18162; Y[18] = 6583;
X[19] = 19558; Y[19] = 8124;
X[20] = 20953; Y[20] = 9665;
X[21] = 21953; Y[21] = 12371;
X[22] = 25161; Y[22] = 11372;
var XX = new Array(),
YY = new Array();
var fontSize = this.getCtrPrp().FontSize;
var textScale = fontSize/1000, // 1000 pt
alpha = textScale*25.4/96 /64 ; // g_dKoef_px_to_mm = 25.4/96
for(var i = 0; i < X.length; i++)
{
XX[i] = X[i]*alpha ;
YY[i] = Y[i]*alpha ;
}
var H = YY[9],
W = XX[0];
return {XX: XX, YY: YY, W: W, H: H};
}
CAccentBreve.prototype.drawPath = function(pGraphics, XX, YY)
{
pGraphics._m(XX[0], YY[0]);
pGraphics._c(XX[0], YY[0], XX[1], YY[1], XX[2], YY[2] );
pGraphics._c(XX[2], YY[2], XX[3], YY[3], XX[4], YY[4] );
pGraphics._c(XX[4], YY[4], XX[5], YY[5], XX[6], YY[6] );
pGraphics._c(XX[6], YY[6], XX[7], YY[7], XX[8], YY[8] );
pGraphics._l(XX[9], YY[9]);
pGraphics._c(XX[9], YY[9], XX[10], YY[10], XX[11], YY[11] );
pGraphics._c(XX[11], YY[11], XX[12], YY[12], XX[13], YY[13] );
pGraphics._c(XX[13], YY[13], XX[14], YY[14], XX[15], YY[15] );
pGraphics._c(XX[15], YY[15], XX[16], YY[16], XX[17], YY[17] );
pGraphics._c(XX[17], YY[17], XX[18], YY[18], XX[19], YY[19] );
pGraphics._c(XX[19], YY[19], XX[20], YY[20], XX[21], YY[21] );
pGraphics._l(XX[22], YY[22]);
}
function CSign()
{
this.sign = new CMathText(true);
......@@ -606,12 +974,13 @@ CSign.prototype.fixSize = function(oMeasure, stretch, bIncline)
this.sign.Resize(oMeasure);
if(this.typeOper == ACCENT_THREE_DOTS)
/*if(this.typeOper == ACCENT_THREE_DOTS)
this.dH = 1.2*ctrPrp.FontSize/36;
else
this.dH = 1.2*ctrPrp.FontSize/36;
this.dH = 1.2*ctrPrp.FontSize/36;*/
var height = this.sign.size.height + this.dH,
//var height = this.sign.size.height + this.dH,
var height = this.sign.size.height,
width = this.sign.size.widthG;
if(bIncline)
......@@ -637,20 +1006,38 @@ function CAccent()
this.kind = MATH_ACCENT;
this.operator = new COperator(OPER_ACCENT);
this.Pr =
{
code: null,
typeOper: null
};
this.code = null; // храним код буквы и тип здесь
this.typeOper = null; // т.к в класах, которые вызываем, не учитываем случаи, когда элементы (стрелки/скобки) переворачиваются
this.loc = LOCATION_TOP;
CCharacter.call(this);
}
extend(CAccent, CCharacter);
CAccent.prototype.init = function(properties)
CAccent.prototype.init = function(props)
{
var prp =
{
type: props.chrType,
chr: props.chr,
loc: LOCATION_TOP
};
var defaultPrp =
{
type: ACCENT_CIRCUMFLEX
};
this.operator.init(prp, defaultPrp);
this.operator.relate(this);
this.setDimension(1, 1);
this.setContent();
this.elements[0][0].SetDot(true);
/// вызов этой функции обязательно в конце
this.WriteContentsToHistory();
}
CAccent.prototype.old_init = function(properties)
{
var type = properties.chrType,
code;
......@@ -1156,9 +1543,6 @@ CAccent.prototype.init = function(properties)
////
this.Pr.typeOper = typeOper;
this.Pr.code = codeChr;
this.setDimension(1, 1);
this.setContent();
......@@ -1182,7 +1566,7 @@ CAccent.prototype.setPosition = function(pos)
// выставить правильно смещение для остальных значков
// для обычных текстовых значков (ACCENT_SIGN) выставлено
if(this.Pr.typeOper == ACCENT_SIGN)
if(this.typeOper == ACCENT_SIGN)
y1 = this.pos.y - this.shiftOperator + this.size.ascent; //shiftOperator to "CCharacter"
else
y1 = this.pos.y;
......
......@@ -5050,7 +5050,7 @@ CMathContent.prototype =
var runPrp = this.content[pos].getRunPrp();
var currRPrp = runPrp.getMergedWPrp();
//this.applyArgSize(currRPrp);
this.Composition.Parent.ApplyArgSize(currRPrp); // в ParaMath
this.Composition.ApplyArgSize(currRPrp); // в ParaMath
RecalcInfo.currRunPrp = currRPrp;
......@@ -5065,7 +5065,7 @@ CMathContent.prototype =
var oWPrp = this.Parent.getCtrPrp();
//this.applyArgSize(oWPrp);
this.Composition.Parent.ApplyArgSize(oWPrp);
this.Composition.ApplyArgSize(oWPrp);
oWPrp.Italic = false;
oMeasure.SetFont(oWPrp);
......@@ -5075,7 +5075,7 @@ CMathContent.prototype =
}
else
{
this.content[pos].Set_Paragraph(this.Composition.Parent.Paragraph);
this.content[pos].Set_Paragraph(this.Composition.Paragraph);
this.content[pos].Math_Recalculate(RecalcInfo);
}
}
......@@ -5188,7 +5188,7 @@ CMathContent.prototype =
oWPrp.Merge(mgWPrp);
//this.applyArgSize(oWPrp);
this.Composition.Parent.ApplyArgSize(oWPrp);
this.Composition.ApplyArgSize(oWPrp);
pGraphics.SetFont(oWPrp);
}
......@@ -5199,7 +5199,7 @@ CMathContent.prototype =
var oWPrp = this.Parent.getCtrPrp();
//this.applyArgSize(oWPrp);
this.Composition.Parent.ApplyArgSize(oWPrp);
this.Composition.ApplyArgSize(oWPrp);
oWPrp.Italic = false;
pGraphics.SetFont(oWPrp);
......@@ -5837,16 +5837,16 @@ CMathContent.prototype =
_X = this.pos.x + this.Composition.X + this.size.width;
var ctrPrp = this.Parent.getCtrPrp();
this.Composition.Parent.ApplyArgSize(ctrPrp);
this.Composition.ApplyArgSize(ctrPrp);
//this.applyArgSize(ctrPrp);
var sizeCursor = ctrPrp.FontSize*g_dKoef_pt_to_mm;
Y -= sizeCursor*0.8;
this.Composition.Parent.Paragraph.DrawingDocument.SetTargetSize(sizeCursor);
this.Composition.Paragraph.DrawingDocument.SetTargetSize(sizeCursor);
//Para.DrawingDocument.UpdateTargetFromPaint = true;
this.Composition.Parent.Paragraph.DrawingDocument.UpdateTarget( _X, Y, this.Composition.Parent.Paragraph.Get_StartPage_Absolute() + _CurPage );
this.Composition.Paragraph.DrawingDocument.UpdateTarget( _X, Y, this.Composition.Paragraph.Get_StartPage_Absolute() + _CurPage );
result = {X: _X, Y: Y};
......@@ -6056,7 +6056,7 @@ CMathContent.prototype =
if(bCurrComp && !bLeftRun) // добавление пустого Run перед мат объектом
{
var emptyRun = new ParaRun(this.Composition.Parent.Paragraph, true);
var emptyRun = new ParaRun(this.Composition.Paragraph, true);
var txtPrp = current.Get_TxtPrp();
emptyRun.Set_Pr(txtPrp);
......@@ -6079,7 +6079,7 @@ CMathContent.prototype =
if(len > 0 && this.content[len - 1].typeObj == MATH_COMP)
{
var emptyRun = new ParaRun(this.Composition.Parent.Paragraph, true);
var emptyRun = new ParaRun(this.Composition.Paragraph, true);
var txtPrp = current.Get_TxtPrp();
emptyRun.Set_Pr(txtPrp);
......@@ -6223,7 +6223,7 @@ CMathContent.prototype =
},
Get_Default_TPrp: function()
{
return this.Composition.Parent.Get_Default_TPrp();
return this.Composition.Get_Default_TPrp();
},
// перемещение по стрелкам
Get_LeftPos: function(SearchPos, ContentPos, Depth, UseContentPos, EndRun)
......@@ -6677,7 +6677,7 @@ CMathContent.prototype =
}
function CMathComposition()
/*function CMathComposition()
{
this.Parent = undefined;
......@@ -6728,7 +6728,7 @@ CMathComposition.prototype =
},
SetProperties: function(props)
{
//****** FOR FORMULA ******//
/*//****** FOR FORMULA ******//*/
// В документации везде, где нет примера использования свояства, означает, что Word не поддерживает это свойство !
......@@ -6753,7 +6753,7 @@ CMathComposition.prototype =
if(props.wrapIndent + 0 == props.wrapIndent && isNaN(props.wrapIndent)) // проверка на число
this.props.wrapIndent = props.wrapIndent/1440;
//********* check for element 0x1FFD - 0xA721 ********//
/*//********* check for element 0x1FFD - 0xA721 ********//*/
// This element specifies the right justification of the wrapped line of an instance of mathematical text
// Instance : Arrows 0x2190-0x21B3, 0x21B6, 0x21B7, 0x21BA-0x21E9, 0x21F4-0x21FF,
// 0x3D, 0x2234 - 0x2237, 0x2239, 0x223B - 0x228B, 0x228F - 0x2292, 0x22A2 - 0x22B9,
......@@ -6765,7 +6765,7 @@ CMathComposition.prototype =
this.props.wrapRight = props.wrapRight;
//****** FOR DOCUMENT ******//
/*//****** FOR DOCUMENT ******//*/
// defaultJc
// выравнивание формулы в документе
......@@ -6784,7 +6784,7 @@ CMathComposition.prototype =
this.props.lMargin = props.lMargin;
this.props.rMargin = props.rMargin;
//****** НЕПОДДЕРЖИВАЕМЫЕ Вордом свойства ******//
/*//****** НЕПОДДЕРЖИВАЕМЫЕ Вордом свойства ******//*/
// mathFont: в качестве font поддерживается только Cambria Math
// остальные шрифты возможно будут поддержаны MS в будущем
......@@ -6798,7 +6798,7 @@ CMathComposition.prototype =
// http://blogs.msdn.com/b/murrays/archive/2008/10/27/default-document-math-properties.aspx
//****** FOR FORMULA ******//
/*//****** FOR FORMULA ******//*/
// http://msdn.microsoft.com/en-us/library/ff529906(v=office.12).aspx
// Word ignores the interSp attribute and fails to write it back out.
......@@ -6808,7 +6808,7 @@ CMathComposition.prototype =
// Word does not implement this feature and does not write the intraSp element.
this.props.intraSp = intraSp;
//****** FOR DOCUMENT ******//
/*//****** FOR DOCUMENT ******//*/
// http://msdn.microsoft.com/en-us/library/ff533406(v=office.12).aspx
// Word ignores and discards postSp
......@@ -6826,13 +6826,13 @@ CMathComposition.prototype =
return 0.6*metrics.Height;
},
/*GetGapSign: function(oMeasure, font)
*//*GetGapSign: function(oMeasure, font)
{
oMeasure.SetFont(font);
var metrics = oMeasure.Measure2Code(0x2217); // "+"
return metrics.Height;
},*/
},*//*
CheckTarget: function()
{
var bSelect = this.SelectContent.selectUse(),
......@@ -6981,7 +6981,7 @@ CMathComposition.prototype =
var code = e.CharCode;
//
/*if(code == 42)
*//*if(code == 42)
code = 8727;
else if(code == 45)
code = 8722;
......@@ -6993,11 +6993,11 @@ CMathComposition.prototype =
code = 0x2211;
if(code == 0x0068)
code = 0x210E;*/
/*else if(code > 0x0040 && code < 0x005B)
code = 0x210E;*//*
*//*else if(code > 0x0040 && code < 0x005B)
code = code + 0x1D3F3;
else if(code > 0x0060 && code < 0x007b)
code = code + 0x1D3ED;*/
code = code + 0x1D3ED;*//*
if(code>=0x0020 )
{
......@@ -7076,8 +7076,8 @@ CMathComposition.prototype =
m++;
/*if(k%10 == 0 && m%10 == 0)
console.log("k: " + k, "m: " + m);*/
*//*if(k%10 == 0 && m%10 == 0)
console.log("k: " + k, "m: " + m);*//*
// x = 53.10799999999981
// y = 18.008999999999965
......@@ -7091,8 +7091,8 @@ CMathComposition.prototype =
if(TEST)
{
History.Create_NewPoint();
/*var start = this.SelectContent.selection.startPos,
end = this.SelectContent.selection.endPos;*/
*//*var start = this.SelectContent.selection.startPos,
end = this.SelectContent.selection.endPos;*//*
var start = this.SelectContent.RealSelect.startPos,
end = this.SelectContent.RealSelect.endPos;
var Pos;
......@@ -7150,8 +7150,8 @@ CMathComposition.prototype =
this.SelectContent.removeAreaSelect();
/*if(this.Root.IsEmpty())
this.Root.addRunPrp(this.DefaultTxtPrp);*/
*//*if(this.Root.IsEmpty())
this.Root.addRunPrp(this.DefaultTxtPrp);*//*
var items = this.SelectContent.addLetter(code);
......@@ -7285,11 +7285,11 @@ CMathComposition.prototype =
{
simulatorMComposition(this, MATH_EDIT);
},
/*RecalculateReverse: function(oMeasure) // for edit
*//*RecalculateReverse: function(oMeasure) // for edit
{
this.SelectContent.RecalculateReverse(oMeasure);
},*/
//////////////* end of test functions *//////////////////
},*//*
/////////////*//* end of test functions *//*/////////////////
Init: function()
{
this.Root = new CMathContent();
......@@ -7317,13 +7317,13 @@ CMathComposition.prototype =
// Math Run Properties default прокинуты
},
/*SetTestRunPrp: function()
*//*SetTestRunPrp: function()
{
var runPrp = new CTextPr();
runPrp.Merge(this.DefaultTxtPrp);
this.Root.addRunPrp(runPrp);
},*/
},*//*
GetDefaultRunPrp: function()
{
var rPrp = new CMathRunPrp();
......@@ -7427,7 +7427,7 @@ CMathComposition.prototype =
},
old_getSize: function()
{
/*return this.Root.size;*/
*//*return this.Root.size;*//*
//
//var sh = 0.2487852283770651*g_oTextMeasurer.GetHeight();
......@@ -7609,7 +7609,7 @@ CMathComposition.prototype =
{
return this.CurrentContent.getRunPrp(this.CurrentContent.CurPos);
}
}
}*/
function CEmpty()
......
......@@ -14,6 +14,7 @@ function CGlyphOperator()
this.size = null;
this.stretch = 0;
this.bStretch = true;
this.penW = 1; // px
}
......@@ -35,6 +36,7 @@ CGlyphOperator.prototype.init = function(props)
this.loc = props.location;
this.turn = props.turn;
this.bStretch = (props.bStretch == true || props.bStretch == false) ? props.bStretch : true;
}
CGlyphOperator.prototype.fixSize = function(stretch)
{
......@@ -50,7 +52,12 @@ CGlyphOperator.prototype.fixSize = function(stretch)
height = sizeGlyph.height;
ascent = height/2;
//
if(this.bStretch)
this.stretch = stretch > width ? stretch : width;
else
this.stretch = width;
}
else
{
......@@ -230,6 +237,7 @@ CGlyphOperator.prototype.getCoordinateGlyph = function()
bArrow = this.Parent.typeOper == ARROW_LEFT || this.Parent.typeOper == ARROW_RIGHT || this.Parent.typeOper == ARROW_LR,
bDoubleArrow = this.Parent.typeOper == DOUBLE_LEFT_ARROW || this.Parent.typeOper == DOUBLE_RIGHT_ARROW || this.Parent.typeOper == DOUBLE_ARROW_LR;
var a1, a2, b1, b2, c1, c2;
if(bLine)
{
......@@ -2260,21 +2268,25 @@ function COperator(type)
this.pos = null;
this.coordGlyph = null;
this.size = {width: 0, height: 0};
this.shiftAccent = 0;
}
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 operator = null,
typeOper = null,
codeChr = null;
var prp = this.getProps(properties, defaultProps);
//var code = typeof(prp.chr) === "string" && prp.chr.length > 0 ? prp.chr.charCodeAt(0) : null;
var type = prp.type,
location = prp.loc,
code = prp.code;
var type = props.type,
location = props.loc,
code = props.code;
var prp = {};
////////// delimiters //////////
......@@ -2284,12 +2296,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
typeOper = PARENTHESIS_LEFT;
operator = new COperatorParenthesis();
var props =
prp =
{
location: location,
turn: TURN_0
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x29 || type === PARENTHESIS_RIGHT)
{
......@@ -2297,12 +2309,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
typeOper = PARENTHESIS_RIGHT;
operator = new COperatorParenthesis();
var props =
prp =
{
location: location,
turn: TURN_180
};
operator.init(props);
operator.init(prp);
}
else if(code == 0x7B || type === BRACKET_CURLY_LEFT)
{
......@@ -2310,12 +2322,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
typeOper = BRACKET_CURLY_LEFT;
operator = new COperatorBracket();
var props =
prp =
{
location: location,
turn: TURN_0
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x7D || type === BRACKET_CURLY_RIGHT)
{
......@@ -2323,12 +2335,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
typeOper = BRACKET_CURLY_RIGHT;
operator = new COperatorBracket();
var props =
prp =
{
location: location,
turn: TURN_180
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x5B || type === BRACKET_SQUARE_LEFT)
{
......@@ -2336,12 +2348,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
typeOper = BRACKET_SQUARE_LEFT;
operator = new CSquareBracket();
var props =
prp =
{
location: location,
turn: TURN_0
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x5D || type === BRACKET_SQUARE_RIGHT)
{
......@@ -2349,12 +2361,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
typeOper = BRACKET_SQUARE_RIGHT;
operator = new CSquareBracket();
var props =
prp =
{
location: location,
turn: TURN_180
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x27E8 || type === BRACKET_ANGLE_LEFT) // 0x3C => 0x27E8
{
......@@ -2362,12 +2374,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
typeOper = BRACKET_ANGLE_LEFT;
operator = new COperatorAngleBracket();
var props =
prp =
{
location: location,
turn: TURN_0
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x27E9 || type === BRACKET_ANGLE_RIGHT) // 0x3E => 0x27E9
{
......@@ -2375,12 +2387,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
typeOper = BRACKET_ANGLE_RIGHT;
operator = new COperatorAngleBracket();
var props =
prp =
{
location: location,
turn: TURN_180
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x7C || type === DELIMITER_LINE)
{
......@@ -2388,13 +2400,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
typeOper = DELIMITER_LINE;
operator = new COperatorLine();
var props =
prp =
{
location: location,
//location: DELIMITER_LOCATION_LEFT,
turn: TURN_0
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x230A || type === HALF_SQUARE_LEFT)
{
......@@ -2402,13 +2413,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
typeOper = HALF_SQUARE_LEFT;
operator = new CHalfSquareBracket();
var props =
prp =
{
//location: DELIMITER_LOCATION_LEFT,
location: location,
turn: TURN_0
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x230B || type == HALF_SQUARE_RIGHT)
{
......@@ -2416,13 +2426,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
typeOper = HALF_SQUARE_RIGHT;
operator = new CHalfSquareBracket();
var props =
prp =
{
//location: DELIMITER_LOCATION_LEFT,
location: location,
turn: TURN_180
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x2308 || type == HALF_SQUARE_LEFT_UPPER)
{
......@@ -2430,13 +2439,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
typeOper = HALF_SQUARE_LEFT_UPPER;
operator = new CHalfSquareBracket();
var props =
prp =
{
//location: DELIMITER_LOCATION_LEFT,
location: location,
turn: TURN_MIRROR_0
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x2309 || type == HALF_SQUARE_RIGHT_UPPER)
{
......@@ -2444,13 +2452,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
typeOper = HALF_SQUARE_RIGHT_UPPER;
operator = new CHalfSquareBracket();
var props =
prp =
{
//location: DELIMITER_LOCATION_LEFT,
location: location,
turn: TURN_MIRROR_180
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x2016 || type == DELIMITER_DOUBLE_LINE)
{
......@@ -2458,13 +2465,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
typeOper = DELIMITER_DOUBLE_LINE;
operator = new COperatorDoubleLine();
var props =
prp =
{
location: location,
//location: DELIMITER_LOCATION_LEFT,
turn: TURN_0
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x27E6 || type == WHITE_SQUARE_LEFT)
{
......@@ -2472,13 +2478,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
typeOper = WHITE_SQUARE_LEFT;
operator = new CWhiteSquareBracket();
var props =
prp =
{
//location: DELIMITER_LOCATION_LEFT,
location: location,
turn: TURN_0
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x27E7 || type == WHITE_SQUARE_RIGHT)
{
......@@ -2486,13 +2491,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
typeOper = WHITE_SQUARE_RIGHT;
operator = new CWhiteSquareBracket();
var props =
prp =
{
//location: DELIMITER_LOCATION_LEFT,
location: location,
turn: TURN_180
};
operator.init(props);
operator.init(prp);
}
else if(type === OPERATOR_EMPTY)
{
......@@ -2512,12 +2516,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
typeOper = ACCENT_ARROW_LEFT;
operator = new CCombiningArrow();
var props =
prp =
{
location: LOCATION_TOP,
turn: TURN_0
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x20D7 || type === ACCENT_ARROW_RIGHT)
{
......@@ -2525,12 +2529,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
codeChr = 0x20D7;
operator = new CCombiningArrow();
var props =
prp =
{
location: LOCATION_TOP,
turn: TURN_180
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x20E1 || type === ACCENT_ARROW_LR)
{
......@@ -2538,13 +2542,13 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
codeChr = 0x20E1;
operator = new CCombining_LR_Arrow();
var props =
prp =
{
location: LOCATION_TOP,
turn: TURN_0
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x20D0 || type === ACCENT_HALF_ARROW_LEFT)
{
......@@ -2552,12 +2556,12 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
codeChr = 0x20D0;
operator = new CCombiningHalfArrow();
var props =
prp =
{
location: LOCATION_TOP,
turn: TURN_0
};
operator.init(props);
operator.init(prp);
}
else if(code === 0x20D1 || type === ACCENT_HALF_ARROW_RIGHT)
{
......@@ -2565,15 +2569,123 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
codeChr = 0x20D1;
operator = new CCombiningHalfArrow();
var props =
prp =
{
location: LOCATION_TOP,
turn: TURN_180
};
operator.init(props);
operator.init(prp);
}
///////////////////////////////
else if(code === 0x302 || type === ACCENT_CIRCUMFLEX)
{
typeOper = ACCENT_CIRCUMFLEX;
codeChr = 0x302;
//operator = new CCircumflex();
operator = new CAccentCircumflex();
prp =
{
location: LOCATION_TOP,
turn: TURN_MIRROR_0,
bStretch: false
};
operator.init(prp);
}
else if(code === 0x30C || type === ACCENT_COMB_CARON)
{
typeOper = ACCENT_COMB_CARON;
codeChr = 0x30C;
operator = new CAccentCircumflex();
prp =
{
location: LOCATION_TOP,
turn: TURN_0,
bStretch: false
};
operator.init(prp);
}
else if(code === 0x305 || type === ACCENT_LINE)
{
typeOper = ACCENT_LINE;
//codeChr = 0x332;
codeChr = 0x305;
operator = new CAccentLine();
prp =
{
location: LOCATION_TOP,
turn: TURN_0
};
operator.init(prp);
}
else if(code === 0x33F || type === ACCENT_DOUBLE_LINE)
{
typeOper = ACCENT_DOUBLE_LINE;
//codeChr = 0x333;
codeChr = 0x33F;
operator = new CAccentDoubleLine();
prp =
{
location: LOCATION_TOP,
turn: TURN_0
};
operator.init(prp);
}
else if(code === 0x303 || type === ACCENT_TILDE)
{
typeOper = ACCENT_TILDE;
codeChr = 0x303;
operator = new CAccentTilde();
prp =
{
location: LOCATION_TOP,
turn: TURN_0,
bStretch: false
};
operator.init(prp);
}
else if(code === 0x306 || type === ACCENT_BREVE)
{
typeOper = ACCENT_BREVE;
codeChr = 0x306;
operator = new CAccentBreve();
prp =
{
location: LOCATION_TOP,
turn: TURN_MIRROR_0,
bStretch: false
};
operator.init(prp);
}
else if(code == 0x311 || type == ACCENT_INVERT_BREVE)
{
typeOper = ACCENT_INVERT_BREVE;
codeChr = 0x311;
operator = new CAccentBreve();
prp =
{
location: LOCATION_TOP,
turn: TURN_0,
bStretch: false
};
operator.init(prp);
}
/////////////////////////
//////////////////////////////////////////////////////
/*else if(code === 0x302 || type === ACCENT_CIRCUMFLEX)
{
......@@ -2821,7 +2933,7 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
operator.init(props);
}
//////////////////////////////////////////
//////////////////////////////////////////////////////
else if(code !== null)
{
......@@ -2838,7 +2950,6 @@ COperator.prototype.init = function(properties, defaultProps) // props (c
this.operator = operator;
this.code = codeChr;
this.typeOper = typeOper;
}
COperator.prototype.getProps = function(props, defaultProps)
{
......@@ -2902,12 +3013,14 @@ COperator.prototype.draw = function(x, y, pGraphics)
else
{
if(this.type === OPER_SEPARATOR)
this.drawSeparator(x, y,pGraphics);
this.drawSeparator(x, y, pGraphics);
else if(this.type == OPER_ACCENT)
this.drawAccent(x, y, pGraphics);
else
this.drawOperator(x, y, pGraphics);
}
}
COperator.prototype.drawOperator = function( absX, absY, pGraphics)
COperator.prototype.drawOperator = function(absX, absY, pGraphics)
{
if(this.operator !== -1)
{
......@@ -3035,6 +3148,11 @@ COperator.prototype.fixSize = function(oMeasure, stretch)
width = this.operator.size.width;
height = this.operator.size.height;
}
var letterX = new CMathText(true);
letterX.add(0x78);
letterX.Resize(oMeasure);
this.shiftAccent = letterX.size.ascent;
}
else
{
......@@ -3084,6 +3202,12 @@ COperator.prototype.setPosition = function(pos)
y = pos.y + ascent - k*this.operator.size.height;
this.operator.setPosition({x: x, y: y});*/
if(this.type == OPER_ACCENT)
{
this.operator.setPosition({x: pos.x, y: pos.y + this.shiftAccent});
}
else
this.operator.setPosition(pos);
}
......@@ -3171,6 +3295,7 @@ function CDelimiter()
this.shape = DELIMITER_SHAPE_CENTERED;
this.grow = true;
this.code = null;
this.typeOper = null;
......@@ -3845,7 +3970,7 @@ CDelimiter.prototype.getPropsForWrite = function()
function CCharacter()
{
this.operator = new COperator(OPER_GROUP_CHAR);
this.shiftOperator = 0;
this.shiftX = 0;
CMathBase.call(this);
}
......@@ -3865,19 +3990,18 @@ CCharacter.prototype.Resize = function(oMeasure)
this.operator.fixSize(oMeasure, base.size.width);
var letterX = new CMathText(true);
letterX.add(0x78);
letterX.Resize(oMeasure);
this.shiftX = base.size.ascent - letterX.size.ascent;
var width = base.size.width > this.operator.size.width ? base.size.width : this.operator.size.width,
height = base.size.height + this.operator.size.height,
height = base.size.height + this.operator.size.height + this.shiftX,
ascent = this.getAscent(oMeasure);
var ctrPrp = this.mergeCtrTPrp();
oMeasure.SetFont(ctrPrp);
var letterX = new CMathText(true);
letterX.add(0x78);
letterX.Resize(oMeasure);
this.shiftOperator = base.size.ascent - letterX.size.ascent;
this.size = {height: height, width: width, ascent: ascent};
}
CCharacter.prototype.setPosition = function(pos)
......@@ -3895,7 +4019,7 @@ CCharacter.prototype.setPosition = function(pos)
this.operator.setPosition({x: x1, y: y1});
var x2 = this.pos.x + this.GapLeft + alignCnt,
y2 = this.pos.y + this.operator.size.height;
y2 = this.pos.y + this.operator.size.height + this.shiftX;
this.elements[0][0].setPosition({x: x2, y: y2});
}
......
......@@ -192,10 +192,8 @@
<script type="text/javascript" src="../Excel/graphics/DrawingContextWord.js"></script>
<script type="text/javascript" src="Math/mathTypes.js"></script>
<!--<script type="text/javascript" src="Math/print.js"></script>-->
<script type="text/javascript" src="Math/mathText.js"></script>
<script type="text/javascript" src="Math/mathContent.js"></script>
<!--<script type="text/javascript" src="Math/actions.js"></script>-->
<script type="text/javascript" src="Math/base.js"></script>
<!--<script type="text/javascript" src="Math/subBase.js"></script>-->
<script type="text/javascript" src="Math/fraction.js"></script>
......
......@@ -195,7 +195,32 @@ CPosition.prototype.put_X = function(v) { this.X = v; }
CPosition.prototype.get_Y = function() { return this.Y; }
CPosition.prototype.put_Y = function(v) { this.Y = v; }
function CPaddings( obj )
{
if ( obj )
{
this.Left = (undefined == obj.Left) ? null : obj.Left;
this.Top = (undefined == obj.Top) ? null : obj.Top;
this.Bottom = (undefined == obj.Bottom) ? null : obj.Bottom;
this.Right = (undefined == obj.Right) ? null : obj.Right;
}
else
{
this.Left = null;
this.Top = null;
this.Bottom = null;
this.Right = null;
}
}
CPaddings.prototype.get_Left = function() { return this.Left; }
CPaddings.prototype.put_Left = function(v) { this.Left = v; }
CPaddings.prototype.get_Top = function() { return this.Top; }
CPaddings.prototype.put_Top = function(v) { this.Top = v; }
CPaddings.prototype.get_Bottom = function() { return this.Bottom; }
CPaddings.prototype.put_Bottom = function(v) { this.Bottom = v; }
CPaddings.prototype.get_Right = function() { return this.Right; }
CPaddings.prototype.put_Right = function(v) { this.Right = v; }
function CImageSize( width, height, isCorrect )
{
......@@ -719,11 +744,6 @@ asc_docs_api.prototype.SetLanguage = function(langId)
this.CurrentTranslate = translations_map[langId];
}
asc_docs_api.prototype.asc_GetFontThumbnailsPath = function()
{
return "../Common/Images/";
}
asc_docs_api.prototype.TranslateStyleName = function(style_name)
{
var ret = this.CurrentTranslate.DefaultStyles[style_name];
......@@ -1026,7 +1046,7 @@ asc_docs_api.prototype.LoadDocument = function(c_DocInfo)
this.DocInfo.put_OfflineApp(true);
// For test create unique id
documentId = "test_document_id";
documentId = "test_document_id_27jaies45983th";
this.OfflineAppDocumentStartLoad();
this.sync_zoomChangeCallback(this.WordControl.m_nZoomValue, 0);
}
......@@ -1084,7 +1104,7 @@ asc_docs_api.prototype.CreateCSS = function()
var style1 = document.createElement('style');
style1.type = 'text/css';
style1.innerHTML = ".buttonTabs {\
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAA5CAMAAADjueCuAAAABGdBTUEAALGPC/xhBQAAAEhQTFRFAAAAWFhYZWVlSEhIY2NjV1dXQ0NDYWFhYmJiTk5OVlZWYGBgVFRUS0tLbGxsRERETExMZmZmVVVVXl5eR0dHa2trPj4+u77CpAZQrwAAAAF0Uk5TAEDm2GYAAABwSURBVDjL1dHHDoAgEEVR7NLr4P//qQm6EMaFxtje8oTF5ELIpU35Fstf3GegsPEBG+uwSYpNB1qNKreoDeNw/r6dLr/tnFpbbNZj8wKbk8W/1d6ZPjfrhdHx9c4fbA9wzMYWm3OFhbQmbC2ue6z9DCH/Exf/mU3YAAAAAElFTkSuQmCC);\
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAA5CAYAAADUZxCcAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAABM0lEQVRYR+2Wu4qAMBBF/TIbBQXFylclPtBGf2KrLfdX/DFb21musOLikJ0MwW0sDoab5EgmOOit6+oMNtTChlrOwcfnF2lhZdu2eba8Mn6DCbFsnmdalsX4ErGsbVvqus6NrCxLqqrKjSxJEsqyzI0sDEOKougQ1nVNfd/faiiW+b5PEKZpSjgyaohLua4RyyQ8I9Nyk7mADbWwoZZzwNVCCivjbusvXhm/wYRaho98mqZf69QyiJqmcSODKM9zN7KiKAjd95qJZajROI7H0SBCkwyCQCf7qRGOBhG6LrrvdY1YJuEZmZabzAVsqIUNtbChlnPAFVYKK9v33bPllfEbTFjL0IoAN/e/Mvx+DsPgRoYuC7g5kQw/xhxxHB9PKxnaswkrmZRnZFpuMhewoY7V+wa2hli8QmxDtwAAAABJRU5ErkJggg==);\
background-position: 0px 0px;\
background-repeat: no-repeat;\
}";
......@@ -1102,7 +1122,7 @@ background-repeat: no-repeat;\
var style3 = document.createElement('style');
style3.type = 'text/css';
style3.innerHTML = ".buttonPrevPage {\
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAABgBAMAAADm/++TAAAABGdBTUEAALGPC/xhBQAAABJQTFRFAAAA////UVNVu77Cenp62Nrc3x8hMQAAAAF0Uk5TAEDm2GYAAABySURBVCjPY2AgETDBGEoKUAElJcJSxANjKGAwDQWDYAKMIBhDSRXCCFJSIixF0GS4M+AMExcwcCbAcIQxBEUgDEdBQcJSBE2GO4PU6IJHASxS4NGER4p28YWIAlikwKMJjxTt4gsRBbBIgUcTHini4wsAwMmIvYZODL0AAAAASUVORK5CYII=);\
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAABgCAYAAAAU0fKgAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwwAADsMBx2+oZAAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAABU0lEQVRYR+XWQW6DQBBEUV8xinwxzsWOc3AGoorUUgv9qZ4Gr/DiZVFQxSwg8mvbtlsw7MCwA8MODDswDD+/74PyDENROdD1gGEuVyMYBlcMGMrM0wXDXK5GMOzAsAPDDgw7MOx4Lcty3PE/sO/7Jd8woFeY8mAH8ndA12U4kMtuxJ5ARsVgB6qny3Agl92IPcGMJw3c8ZmBdV0v+YYBvcKUBzuQvwO6LsOBXHYj9gQyKgY7UD1dhgO57EbsCWY8aeAO/NHQgWEHhh0YdmDYgSG9ynSfYCgzZcEwVGXBMD890H2CocyUBcNQlQXDDgw7MOzAsAPDjvv/UPSHfr7MePJA/g7C+R6xJ6jKYgfElWU4kJ8ezveIPUFVFjsgrizlQOVJA3d8ZoB+vsx48kD+DsL5HrEnqMpiB8SVZTiQnx7O94g9QVUWOyCuLOVA5UkD1y3HHxBw7VBakRjXAAAAAElFTkSuQmCC);\
background-position: 0px 0px;\
background-repeat: no-repeat;\
}";
......@@ -1111,7 +1131,7 @@ background-repeat: no-repeat;\
var style4 = document.createElement('style');
style4.type = 'text/css';
style4.innerHTML = ".buttonNextPage {\
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAABgBAMAAADm/++TAAAABGdBTUEAALGPC/xhBQAAABJQTFRFAAAA////UVNVu77Cenp62Nrc3x8hMQAAAAF0Uk5TAEDm2GYAAABySURBVCjPY2AgETDBGEoKUAElJcJSxANjKGAwDQWDYAKMIBhDSRXCCFJSIixF0GS4M+AMExcwcCbAcIQxBEUgDEdBQcJSBE2GO4PU6IJHASxS4NGER4p28YWIAlikwKMJjxTt4gsRBbBIgUcTHini4wsAwMmIvYZODL0AAAAASUVORK5CYII=);\
background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAABgCAYAAAAU0fKgAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwwAADsMBx2+oZAAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAABU0lEQVRYR+XWQW6DQBBEUV8xinwxzsWOc3AGoorUUgv9qZ4Gr/DiZVFQxSwg8mvbtlsw7MCwA8MODDswDD+/74PyDENROdD1gGEuVyMYBlcMGMrM0wXDXK5GMOzAsAPDDgw7MOx4Lcty3PE/sO/7Jd8woFeY8mAH8ndA12U4kMtuxJ5ARsVgB6qny3Agl92IPcGMJw3c8ZmBdV0v+YYBvcKUBzuQvwO6LsOBXHYj9gQyKgY7UD1dhgO57EbsCWY8aeAO/NHQgWEHhh0YdmDYgSG9ynSfYCgzZcEwVGXBMD890H2CocyUBcNQlQXDDgw7MOzAsAPDjvv/UPSHfr7MePJA/g7C+R6xJ6jKYgfElWU4kJ8ezveIPUFVFjsgrizlQOVJA3d8ZoB+vsx48kD+DsL5HrEnqMpiB8SVZTiQnx7O94g9QVUWOyCuLOVA5UkD1y3HHxBw7VBakRjXAAAAAElFTkSuQmCC);\
background-position: 0px -48px;\
background-repeat: no-repeat;\
}";
......@@ -3526,34 +3546,7 @@ asc_docs_api.prototype.paraApply = function(Props)
this.WordControl.m_oLogicDocument.Set_ParagraphShd( Props.Shd );
if ( "undefined" != typeof(Props.Brd) && null != Props.Brd )
{
if(Props.Brd.Left && Props.Brd.Left.Color)
{
Props.Brd.Left.Unifill = CreateUnifillFromAscColor(Props.Brd.Left.Color);
}
if(Props.Brd.Top && Props.Brd.Top.Color)
{
Props.Brd.Top.Unifill = CreateUnifillFromAscColor(Props.Brd.Top.Color);
}
if(Props.Brd.Right && Props.Brd.Right.Color)
{
Props.Brd.Right.Unifill = CreateUnifillFromAscColor(Props.Brd.Right.Color);
}
if(Props.Brd.Bottom && Props.Brd.Bottom.Color)
{
Props.Brd.Bottom.Unifill = CreateUnifillFromAscColor(Props.Brd.Bottom.Color);
}
if(Props.Brd.InsideH && Props.Brd.InsideH.Color)
{
Props.Brd.InsideH.Unifill = CreateUnifillFromAscColor(Props.Brd.InsideH.Color);
}
if(Props.Brd.InsideV && Props.Brd.InsideV.Color)
{
Props.Brd.InsideV.Unifill = CreateUnifillFromAscColor(Props.Brd.InsideV.Color);
}
this.WordControl.m_oLogicDocument.Set_ParagraphBorders( Props.Brd );
}
if ( undefined != Props.Tabs )
{
......@@ -3841,10 +3834,7 @@ asc_docs_api.prototype.put_TextColor = function(color)
if ( false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Paragraph_Content) )
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
var Unifill = new CUniFill();
Unifill.fill = new CSolidFill();
Unifill.fill.color = CorrectUniColor(color, Unifill.fill.color);
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { Unifill : Unifill} ) );
this.WordControl.m_oLogicDocument.Paragraph_Add( new ParaTextPr( { Color : { r : color.get_r(), g : color.get_g(), b : color.get_b(), Auto : color.get_auto() } } ) );
if ( true === this.isMarkerFormat )
this.sync_MarkerFormatCallback( false );
......@@ -3859,10 +3849,7 @@ asc_docs_api.prototype.put_ParagraphShade = function(is_flag, color)
this.WordControl.m_oLogicDocument.Set_ParagraphShd( { Value : shd_Nil } );
else
{
var Unifill = new CUniFill();
Unifill.fill = new CSolidFill();
Unifill.fill.color = CorrectUniColor(color, Unifill.fill.color);
this.WordControl.m_oLogicDocument.Set_ParagraphShd( { Value : shd_Clear, Color : { r : color.get_r(), g : color.get_g(), b : color.get_b() }, Unifill: Unifill } );
this.WordControl.m_oLogicDocument.Set_ParagraphShd( { Value : shd_Clear, Color : { r : color.get_r(), g : color.get_g(), b : color.get_b() } } );
}
}
}
......@@ -4899,38 +4886,6 @@ asc_docs_api.prototype.tblApply = function(obj)
{
if ( false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Table_Properties) )
{
if(obj.CellBorders)
{
if(obj.CellBorders.Left && obj.CellBorders.Left.Color)
{
obj.CellBorders.Left.Unifill = CreateUnifillFromAscColor(obj.CellBorders.Left.Color);
}
if(obj.CellBorders.Top && obj.CellBorders.Top.Color)
{
obj.CellBorders.Top.Unifill = CreateUnifillFromAscColor(obj.CellBorders.Top.Color);
}
if(obj.CellBorders.Right && obj.CellBorders.Right.Color)
{
obj.CellBorders.Right.Unifill = CreateUnifillFromAscColor(obj.CellBorders.Right.Color);
}
if(obj.CellBorders.Bottom && obj.CellBorders.Bottom.Color)
{
obj.CellBorders.Bottom.Unifill = CreateUnifillFromAscColor(obj.CellBorders.Bottom.Color);
}
if(obj.CellBorders.InsideH && obj.CellBorders.InsideH.Color)
{
obj.CellBorders.InsideH.Unifill = CreateUnifillFromAscColor(obj.CellBorders.InsideH.Color);
}
if(obj.CellBorders.InsideV && obj.CellBorders.InsideV.Color)
{
obj.CellBorders.InsideV.Unifill = CreateUnifillFromAscColor(obj.CellBorders.InsideV.Color);
}
}
if(obj.CellsBackground && obj.CellsBackground.Color)
{
obj.CellsBackground.Unifill = CreateUnifillFromAscColor(obj.CellsBackground.Color);
}
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
this.WordControl.m_oLogicDocument.Set_TableProps(obj);
}
......@@ -6191,14 +6146,14 @@ asc_docs_api.prototype.ChangeColorScheme = function(index_scheme)
{
History.TurnOff();
}
//this.chartStyleManager.init();
//this.chartPreviewManager.init();
this.chartStyleManager.init();
this.chartPreviewManager.init();
if(is_on)
{
History.TurnOn();
}
this.asc_fireCallback("asc_onUpdateChartStyles");
this.WordControl.m_oLogicDocument.Recalculate();
_changer.calculateAfterChangeTheme();
// TODO:
this.WordControl.m_oDrawingDocument.ClearCachePages();
......@@ -6325,6 +6280,54 @@ asc_docs_api.prototype.OpenDocumentEndCallback = function()
//Recalculate для Document
Document.CurPos.ContentPos = 0;
// TODO: Переделать
// var hdr = Document.HdrFtr.Content[0].Header;
// var ftr = Document.HdrFtr.Content[0].Footer;
// var drawing_objects = Document.DrawingObjects;
// if(hdr.First != null || ftr.First != null)
// {
// drawing_objects.firstPage = new HeaderFooterGraphicObjects();
// }
// if(hdr.Even != null || ftr.Even != null)
// {
// if((hdr.Even != null && hdr.Even == hdr.First) || (ftr.Even != null && ftr.Even == ftr.First))
// drawing_objects.evenPage = drawing_objects.firstPage;
// else
// drawing_objects.evenPage = new HeaderFooterGraphicObjects();
// }
// if(hdr.Odd != null || ftr.Odd != null)
// {
// if((hdr.Odd != null && hdr.Odd == hdr.First) || (ftr.Odd != null && ftr.Odd == ftr.First))
// drawing_objects.oddPage = drawing_objects.firstPage;
// else if((hdr.Odd != null && hdr.Odd == hdr.Even)|| (ftr.Odd != null && ftr.Odd == ftr.Even))
// drawing_objects.oddPage = drawing_objects.evenPage;
// else
// drawing_objects.oddPage = new HeaderFooterGraphicObjects();
// }
/* if(hdr.Odd != null)
{
if((hdr.Odd != null && hdr.Odd == hdr.First) )
drawing_objects.headerFooter.header.odd = drawing_objects.headerFooter.header.first;
else if((hdr.Odd != null && hdr.Odd == hdr.Even))
drawing_objects.headerFooter.header.odd = drawing_objects.headerFooter.header.even;
else
drawing_objects.headerFooter.header.odd = new HeaderFooterGraphicObjects();
}
if(ftr.Odd != null)
{
if((ftr.Odd != null && ftr.Odd == ftr.First) )
drawing_objects.headerFooter.footer.odd = drawing_objects.headerFooter.footer.first;
else if((ftr.Odd != null && ftr.Odd == ftr.Even))
drawing_objects.headerFooter.footer.odd = drawing_objects.headerFooter.footer.even;
else
drawing_objects.headerFooter.footer.odd = new HeaderFooterGraphicObjects();
} */
History.RecalcData_Add({Type: historyrecalctype_Drawing, All: true});
Document.DrawingObjects.addToZIndexManagerAfterOpen();
if (!this.isOnlyReaderMode)
......@@ -6587,39 +6590,6 @@ asc_docs_api.prototype.asc_setAutoSaveGap = function (autoSaveGap) {
}
};
asc_docs_api.prototype.asc_SetDocumentPlaceChangedEnabled = function(bEnabled)
{
if (this.WordControl)
this.WordControl.m_bDocumentPlaceChangedEnabled = bEnabled;
}
asc_docs_api.prototype.asc_SetViewRulers = function(bRulers)
{
//if (false === this.bInit_word_control || true === this.isViewMode)
// return;
if (this.WordControl.m_bIsRuler != bRulers)
{
this.WordControl.m_bIsRuler = bRulers;
this.WordControl.checkNeedRules();
this.WordControl.OnResize(true);
}
}
asc_docs_api.prototype.asc_SetViewRulersChange = function()
{
//if (false === this.bInit_word_control || true === this.isViewMode)
// return;
this.WordControl.m_bIsRuler = !this.WordControl.m_bIsRuler;
this.WordControl.checkNeedRules();
this.WordControl.OnResize(true);
return this.WordControl.m_bIsRuler;
}
asc_docs_api.prototype.asc_GetViewRulers = function()
{
return this.WordControl.m_bIsRuler;
}
asc_docs_api.prototype.SetMobileVersion = function(val)
{
this.isMobileVersion = val;
......@@ -7381,12 +7351,21 @@ CErrorData.prototype.get_Value = function() { return this.Value; };
//test
// Вставка диаграмм
asc_docs_api.prototype.asc_getChartObject = function(type, subtype)
asc_docs_api.prototype.asc_getChartObject = function()
{
this.isChartEditor = true; // Для совместного редактирования
return this.WordControl.m_oLogicDocument.Get_ChartObject(type, subtype);
var oColor, oNewColor;
var graphicObject = this.WordControl.m_oLogicDocument.Get_ChartObject();
for (var i = 0; i < this.WordControl.m_oDrawingDocument.GuiControlColorsMap.length; i++) {
oColor = this.WordControl.m_oDrawingDocument.GuiControlColorsMap[i];
oNewColor = new CRGBColor();
oNewColor.RGBA.R = oColor.r;
oNewColor.RGBA.G = oColor.g;
oNewColor.RGBA.B = oColor.b;
graphicObject.chart.themeColors.push(oNewColor);
}
return graphicObject;
}
asc_docs_api.prototype.asc_addChartDrawingObject = function(options)
......@@ -9617,6 +9596,36 @@ window["asc_docs_api"].prototype["asc_nativeCalculateFile"] = function()
//Recalculate для Document
Document.CurPos.ContentPos = 0;
// TODO: Переделать
// var hdr = Document.HdrFtr.Content[0].Header;
// var ftr = Document.HdrFtr.Content[0].Footer;
// var drawing_objects = Document.DrawingObjects;
// if(hdr.First != null || ftr.First != null)
// {
// drawing_objects.firstPage = new HeaderFooterGraphicObjects();
// }
// if(hdr.Even != null || ftr.Even != null)
// {
// if((hdr.Even != null && hdr.Even == hdr.First) || (ftr.Even != null && ftr.Even == ftr.First))
// drawing_objects.evenPage = drawing_objects.firstPage;
// else
// drawing_objects.evenPage = new HeaderFooterGraphicObjects();
// }
// if(hdr.Odd != null || ftr.Odd != null)
// {
// if((hdr.Odd != null && hdr.Odd == hdr.First) || (ftr.Odd != null && ftr.Odd == ftr.First))
// drawing_objects.oddPage = drawing_objects.firstPage;
// else if((hdr.Odd != null && hdr.Odd == hdr.Even)|| (ftr.Odd != null && ftr.Odd == ftr.Even))
// drawing_objects.oddPage = drawing_objects.evenPage;
// else
// drawing_objects.oddPage = new HeaderFooterGraphicObjects();
// }
//Document.DrawingObjects.calculateAfterOpen();
//Document.DrawingObjects.calculateAfterChangeTheme();
History.RecalcData_Add({Type: historyrecalctype_Drawing, All: true});
Document.DrawingObjects.addToZIndexManagerAfterOpen();
......
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