Commit 0fa7cfaa authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

scripts new version

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@58412 954022d7-b5bf-4e40-9824-e11837661b57
parent 2959ab8b
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -75566,6 +75566,10 @@ function DrawingObjects() {
return val * ascCvtRatio(from, to);
};
_this.convertPixToMM = function(pix)
{
return this.convertMetric(pix, 0, 3);
};
_this.getSelectedGraphicObjects = function() {
return _this.controller.selectedObjects;
};
......@@ -96312,6 +96316,7 @@ CImageShape.prototype =
{
this.setWorksheet(worksheet);
this.setParent(null);
this.setBDeleted(false);
return this;
},
......@@ -97045,6 +97050,24 @@ CGroupShape.prototype =
this.bDeleted = pr;
},
setBDeleted2: function(pr)
{
this.bDeleted = pr;
for(var i = 0; i < this.spTree.length; ++i)
{
if(this.spTree[i].setBDeleted2)
{
this.spTree[i].setBDeleted2(pr);
}
else
{
this.spTree[i].bDeleted = pr;
}
}
},
documentUpdateSelectionState: function()
{
if(this.selection.textSelection)
......@@ -97271,6 +97294,7 @@ CGroupShape.prototype =
var sp_tree_copy = [].concat(this.spTree), i;
this.setWorksheet(worksheet);
this.setParent(null);
this.setBDeleted(false);
for(i = this.spTree.length-1; i > -1; --i)
{
this.removeFromSpTreeByPos(i);
......@@ -97278,6 +97302,7 @@ CGroupShape.prototype =
for(i = 0; i < sp_tree_copy.length; ++i)
{
this.addToSpTree(this.spTree.length, sp_tree_copy[i].convertToPPTX(drawingDocument, worksheet));
this.spTree[this.spTree.length - 1].setGroup(this);
}
return this;
},
......@@ -100026,6 +100051,7 @@ CChartSpace.prototype =
convertToPPTX: function(drawingDocument, worksheet)
{
this.setBDeleted(false);
this.setWorksheet(worksheet);
this.setParent(null);
return this;
......@@ -106570,9 +106596,9 @@ CChartSpace.prototype =
for(i = 0; i < series.length; ++i)
{
ser = series[i];
arr_str_labels.push(ser.getSeriesName());
if(ser.isHidden)
continue;
arr_str_labels.push(ser.getSeriesName());
calc_entry = new CalcLegendEntry(legend, this);
calc_entry.txBody = CreateTextBodyFromString(arr_str_labels[i], this.getDrawingDocument(), calc_entry);
entry = legend.findLegendEntryByIndex(i);
......@@ -109622,6 +109648,20 @@ CPivotSource.prototype =
}
},
createDuplicate: function()
{
var copy = new CPivotSource();
if(isRealNumber(this.fmtId))
{
copy.setFmtId(this.fmtId);
}
if(typeof this.name === "string")
{
copy.setName(this.name);
}
return copy;
},
Save_Changes: function(data, w)
{
w.WriteLong(data.Type);
......@@ -109724,6 +109764,17 @@ CProtection.prototype =
this.userInterface = pr;
},
createDuplicate: function()
{
var c = new CProtection();
c.setChartObject (this.chartObject );
c.setData (this.data);
c.setFormatting (this.formatting);
c.setSelection (this.selection);
c.setUserInterface(this.userInterface);
return c;
},
Undo: function(data)
{
......@@ -181524,12 +181575,12 @@ ParaRun.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
{
this.Paragraph = PRS.Paragraph;
if(this.Type == para_Math_Run)
/*if(this.Type == para_Math_Run)
{
this.ArgSize = PRS.ArgSize.value;
this.bEqqArray = PRS.bEqqArray;
this.Parent = PRS.Parent;
}
}*/
this.RecalcInfo.TextPr = true;
this.Paragraph.RecalcInfo.Set_Type_0_Spell( pararecalc_0_Spell_All );
......@@ -188018,6 +188069,13 @@ function MathMenu (type)
this.Type = para_Math;
this.Menu = type;
}
MathMenu.prototype =
{
Get_Type : function()
{
return this.Type;
}
}
function ParaMath()
{
this.Id = g_oIdCounter.Get_NewId();
......@@ -188171,7 +188229,7 @@ ParaMath.prototype =
if ( para_Text === Type)
{
var oText = new CMathText(false);
oText.addTxt(Item.Value);
oText.add(Item.Value);
oStartContent.Add(oText, true);
}
else if ( para_Space === Type )
......@@ -188562,7 +188620,6 @@ ParaMath.prototype =
if(PRS.NewRange == false)
this.Root.Recalculate_Reset(PRS.Range, PRS.Line);
this.Root.Resize(g_oTextMeasurer, null, this, RPI/*recalculate properties info*/, ArgSize, TextPr);
//this.Root.Resize(null, this, g_oTextMeasurer, RPI/*recalculate properties info*/, TextPr);
......@@ -295148,6 +295205,9 @@ var ACCENT_ARROW_RIGHT = 27;
var ACCENT_ARROW_LR = 28;
var ACCENT_HALF_ARROW_LEFT = 29;
var ACCENT_HALF_ARROW_RIGHT = 30;
var PARENTHESIS_TOP = 31;
var PARENTHESIS_BOTTOM = 32;
var BRACKET_SQUARE_TOP = 33;
var ACCENT_ONE_DOT = 31;
var ACCENT_TWO_DOTS = 32;
......@@ -296926,8 +296986,10 @@ CMPrp.prototype =
this.sty = STY_ITALIC;
else if(Bold == true)
this.sty = STY_BOLD;
else
else if(Bold == false && Italic == false)
this.sty = STY_PLAIN;
else
this.sty = undefined;
}
}
......@@ -300870,6 +300932,7 @@ CMathContent.prototype =
ctrPrp = current.Get_CtrPrp();
mathPrp = new CMPrp();
mathPrp.SetStyle(ctrPrp.Bold, ctrPrp.Italic);
emptyRun.Set_MathPr(mathPrp);
......@@ -305510,12 +305573,6 @@ CMathBase.prototype =
}
}
/*if(this.constructor.name == "CDegreeSubSup")
{
console.log("startX " + startX + " startY " + startY + "; " + "endX " + endX + " endY " + endY);
}*/
this.bSelectionUse = true;
},
......@@ -308814,7 +308871,6 @@ CLimit.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
this.Parent = Parent;
this.ParaMath = ParaMath;
//this.Set_CompiledCtrPrp(ParaMath);
if(this.RecalcInfo.bProps == true || RPI.bChangeInline == true)
{
......@@ -308866,7 +308922,6 @@ CLimit.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
}
if(RPI.bInline == true && RPI.bMathFunc == true)
{
this.elements[0][0].Resize(oMeasure, this, ParaMath, RPI, ArgSize);
......@@ -308880,8 +308935,6 @@ CLimit.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
}
else
{
//this.setDistance();
this.FName.Resize(oMeasure, this, ParaMath, RPI, ArgSize);
var ArgSzIter = ArgSize.Copy();
......@@ -308905,28 +308958,6 @@ CLimit.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
width += this.GapLeft + this.GapRight;
/*var width = 0;
var height = 0;
var maxWH = this.getWidthsHeights();
this.setDistance();
var Widths = maxWH.widths;
var Heights = maxWH.heights;
for( var j = 0 ; j < this.nRow; j++ )
height += Heights[j];
height += this.dH*(this.nRow - 1);
for(var i=0; i < this.nCol ; i++)
width += Widths[i];
width += this.dW*(this.nCol - 1) + this.GapLeft + this.GapRight;
var ascent = this.getAscent(oMeasure);*/
this.size = {width: width, height: height, ascent: ascent};
}
......@@ -312985,7 +313016,6 @@ CGlyphOperator.prototype.getCoordinateGlyph = function()
}*/
/*var shW = 0,
shH = 0;
......@@ -313053,10 +313083,6 @@ CGlyphOperator.prototype.relate = function(parent)
{
this.Parent = parent;
}
CGlyphOperator.prototype.IsArrow = function()
{
return false;
}
function COperatorBracket()
......@@ -313068,26 +313094,37 @@ COperatorBracket.prototype.calcSize = function( stretch )
{
var betta = this.getCtrPrp().FontSize/36;
// перевернутая скобка
var minBoxH = 4.917529296874999 *betta, //width of 0x28
var heightBr, widthBr;
var minBoxH = 4.917529296874999 *betta; //width of 0x28
if(this.Parent.type == OPER_GROUP_CHAR)
{
// перевернутая скобка
widthBr = 7.347222222222221*betta;
heightBr = minBoxH;
}
else
{
// перевернутая скобка
widthBr = 12.347222222222221*betta;
var maxBoxH;
var maxBoxH;
var rx = stretch / widthBr;
if(rx < 1)
rx = 1;
var rx = stretch / widthBr;
if(rx < 1)
rx = 1;
if(rx < 2.1)
maxBoxH = minBoxH * 1.37;
else if(rx < 3.22)
maxBoxH = minBoxH * 1.06;
else
maxBoxH = 8.74 *betta;
if(rx < 2.1)
maxBoxH = minBoxH * 1.37;
else if(rx < 3.22)
maxBoxH = minBoxH * 1.06;
else
maxBoxH = 8.74 *betta;
var delta = maxBoxH - minBoxH;
var delta = maxBoxH - minBoxH;
var heightBr = delta/4.3 * (rx - 1) + minBoxH;
heightBr = heightBr > maxBoxH ? maxBoxH : heightBr;
heightBr = delta/4.3 * (rx - 1) + minBoxH;
heightBr = heightBr > maxBoxH ? maxBoxH : heightBr;
}
return {width: widthBr, height: heightBr};
}
......@@ -313495,13 +313532,19 @@ COperatorBracket.prototype.calcCoord = function(stretch)
}
var H = Y[53]*RX[53];
for(var i = 0; i < 54; i++)
{
YY[i] = (H - Y[i]*RX[i])*alpha;
//YY[i] = (H - Y[i]*RX[i])*alpha;
if(this.Parent.type == OPER_GROUP_CHAR)
YY[i] = (Y[53] - Y[i])*alpha;
else
YY[i] = (Y[53]*RX[53] - Y[i]*RX[i])*alpha;
XX[i] = XX[i]*alpha;
}
for(var i = 0; i < 50; i++)
YY[54 + i] = YY[51 - i];
......@@ -313575,7 +313618,6 @@ COperatorBracket.prototype.drawPath = function(pGraphics, XX, YY)
pGraphics._c(XX[102], YY[102], XX[103], YY[103], XX[0], YY[0]);
}
// TODO: сделать так, чтобы размер скобки совпадал в начальном случае (плейсхолдер), сейчас по размеру аргумента
function COperatorParenthesis()
{
......@@ -313586,15 +313628,29 @@ COperatorParenthesis.prototype.calcSize = function(stretch)
{
var betta = this.getCtrPrp().FontSize/36;
var maxBoxH = 9.63041992187 *betta, //9.63 width of 0x239D
minBoxH = 5.27099609375 *betta, //width of 0x28
var heightBr, widthBr;
var minBoxH = 5.27099609375 *betta; //width of 0x28
if(this.Parent.type == OPER_GROUP_CHAR)
{
// перевернутая скобка
widthBr = 6.99444444444*betta;
heightBr = minBoxH;
}
else
{
var maxBoxH = 9.63041992187 *betta; //9.63 width of 0x239D
widthBr = 11.99444444444 *betta;
var ry = stretch / widthBr,
delta = maxBoxH - minBoxH;
var heightBr = delta/4.3 * (ry - 1) + minBoxH;
heightBr = heightBr > maxBoxH ? maxBoxH : heightBr;
var ry = stretch / widthBr,
delta = maxBoxH - minBoxH;
heightBr = delta/4.3 * (ry - 1) + minBoxH;
heightBr = heightBr > maxBoxH ? maxBoxH : heightBr;
}
return {height: heightBr, width : widthBr};
}
......@@ -313622,15 +313678,17 @@ COperatorParenthesis.prototype.calcCoord = function(stretch)
var aug = stretch/(X[9]*alpha)/2; //Y[9]*alpha - высота скобки
var RX, RY;
var MIN_AUG = this.Parent.type == OPER_GROUP_CHAR ? 0.5 : 1;
if(aug > 6.53)
{
RX = 6.53;
RY = 2.05;
}
else if(aug < 1)
else if(aug < MIN_AUG)
{
RX = 1;
RY = 1;
RX = MIN_AUG;
RY = MIN_AUG;
}
else
{
......@@ -313638,14 +313696,17 @@ COperatorParenthesis.prototype.calcCoord = function(stretch)
RY = 1 + (aug - 1)*0.19;
}
var DistH = [];
for(var i= 0; i< 5; i++)
DistH[i] = Y[9-i] - Y[i];
for(var i = 5; i < 10; i++)
if(this.Parent.type !== OPER_GROUP_CHAR)
{
Y[i] = Y[i]*RY; //точки правой дуги
Y[9-i] = Y[i] - DistH[9-i]; //точки левой дуги
var DistH = [];
for(var i= 0; i< 5; i++)
DistH[i] = Y[9-i] - Y[i];
for(var i = 5; i < 10; i++)
{
Y[i] = Y[i]*RY; //точки правой дуги
Y[9-i] = Y[i] - DistH[9-i]; //точки левой дуги
}
}
// X
......@@ -313674,8 +313735,10 @@ COperatorParenthesis.prototype.calcCoord = function(stretch)
for(var i = 0; i < 10; i++)
{
YY[19 - i] = shiftY - Y[i]*alpha;
YY[i] = shiftY - Y[i]*alpha;
XX[19 - i] = X[i]*alpha;
XX[i] = stretch - X[i]*alpha;
}
......@@ -314273,10 +314336,6 @@ CSingleArrow.prototype.drawPath = function(pGraphics, XX, YY)
pGraphics._l(XX[9], YY[9]);
pGraphics._l(XX[10], YY[10]);
}
CSingleArrow.prototype.IsArrow = function()
{
return true;
}
function CLeftRightArrow()
{
......@@ -314362,10 +314421,6 @@ CLeftRightArrow.prototype.drawPath = function(pGraphics, XX, YY)
pGraphics._l(XX[16], YY[16]);
}
CLeftRightArrow.prototype.IsArrow = function()
{
return true;
}
function CDoubleArrow()
{
......@@ -314461,10 +314516,7 @@ CDoubleArrow.prototype.drawPath = function(pGraphics, XX, YY)
pGraphics._m(XX[16], YY[16]);
pGraphics._l(XX[17], YY[17]);
}
CDoubleArrow.prototype.IsArrow = function()
{
return true;
}
function CLR_DoubleArrow()
{
......@@ -314570,11 +314622,6 @@ CLR_DoubleArrow.prototype.drawPath = function(pGraphics, XX, YY)
pGraphics._l(XX[22], YY[22]);
pGraphics._l(XX[23], YY[23]);
}
CLR_DoubleArrow.prototype.IsArrow = function()
{
return true;
}
function CCombiningArrow()
......@@ -315396,6 +315443,45 @@ COperator.prototype.mergeProperties = function(properties, defaultProps) // pr
};
operator.init(prp);
}
else if(code === 0x23DC || type === PARENTHESIS_TOP)
{
codeChr = 0x23DC;
typeOper = PARENTHESIS_TOP;
operator = new COperatorParenthesis();
prp =
{
location: location,
turn: TURN_0
};
operator.init(prp);
}
else if(code === 0x23DD || type === PARENTHESIS_BOTTOM)
{
codeChr = 0x23DD;
typeOper = PARENTHESIS_BOTTOM;
operator = new COperatorParenthesis();
prp =
{
location: location,
turn: TURN_MIRROR_0
};
operator.init(prp);
}
else if(code === 0x23E0 || type === BRACKET_SQUARE_TOP)
{
codeChr = 0x23E0;
typeOper = BRACKET_SQUARE_TOP;
operator = new CSquareBracket();
prp =
{
location: location,
turn: TURN_0
};
operator.init(prp);
}
else if(code === 0x2190 || type === ARROW_LEFT)
{
codeChr = 0x2190;
......@@ -315882,7 +315968,13 @@ COperator.prototype.getChr = function()
}
COperator.prototype.IsArrow = function()
{
return this.operator.IsArrow();
//return this.operator.IsArrow();
var bArrow = this.typeOper == ARROW_LEFT || this.typeOper == ARROW_RIGHT || this.typeOper == ARROW_LR,
bDoubleArrow = this.typeOper == DOUBLE_LEFT_ARROW || this.typeOper == DOUBLE_RIGHT_ARROW || this.typeOper == DOUBLE_ARROW_LR,
bAccentArrow = his.typeOper == ACCENT_ARROW_LEFT || this.typeOper == ACCENT_ARROW_RIGHT || this.typeOper == ACCENT_ARROW_LR || this.typeOper == ACCENT_HALF_ARROW_LEFT || this.typeOper == ACCENT_HALF_ARROW_RIGHT;
return bArrow || bDoubleArrow;
}
function CDelimiter(props)
......@@ -316588,6 +316680,7 @@ CCharacter.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
height = base.size.height + this.operator.size.height,
ascent = this.getAscent(oMeasure);
width += this.GapLeft + this.GapRight;
this.size = {height: height, width: width, ascent: ascent};
}
......@@ -316631,7 +316724,7 @@ CCharacter.prototype.setPosition = function(pos, PosInfo)
}
CCharacter.prototype.Get_ParaContentPosByXY = function(SearchPos, Depth, _CurLine, _CurRange, StepEnd)
{
var align = (this.size.width - this.elements[0][0].size.width)/2;
var align = (this.size.width - this.elements[0][0].size.width - this.GapLeft - this.GapRight)/2;
SearchPos.CurX += this.GapLeft + align;
......@@ -317467,28 +317560,6 @@ CSign.prototype.setPosition = function(pos)
{
this.sign.setPosition(pos);
}
/*CSign.prototype.setPosition = function(pos)
{
var shX = 0;
if(this.typeOper == ACCENT_GRAVE)
shX = 1.1*this.sign.size.widthG;
else if(this.typeOper == ACCENT_ACUTE)
shX = 1.25*this.sign.size.widthG;
else if(this.typeOper == ACCENT_ONE_DOT)
shX = 1.53*this.sign.size.widthG;
else if(this.typeOper == ACCENT_TWO_DOTS)
shX = 0.95*this.sign.size.widthG;
else if(this.typeOper == ACCENT_THREE_DOTS)
shX = 0.015*this.sign.size.widthG;
var position =
{
x: pos.x + shX,
y: pos.y + this.sign.size.ascent
};
this.sign.setPosition(position);
}*/
CSign.prototype.fixSize = function(oMeasure, stretch, bIncline)
{
var ctrPrp = this.Parent.Get_CompiledCtrPrp();
......@@ -317585,519 +317656,6 @@ CAccent.prototype.IsAccent = function()
{
return true;
}
CAccent.prototype.old_init = function(properties)
{
var type = properties.chrType,
code;
var typeOper, codeChr;
var operator;
//// ВРЕМЕННО !!!!
var bCode = false,
bType = typeof(type) !== "undefined" && type !== null;
if(typeof(properties.chr) === "string")
{
bCode = true;
code = properties.chr.charCodeAt(0);
}
/*var bDot = code === 0x307 || props.chr.type === ACCENT_ONE_DOT,
b2Dots = code === 0x308 || props.chr.type === ACCENT_TWO_DOTS,
b3Dots = code === 0x20DB || props.chr.type === ACCENT_THREE_DOTS,
bAccGrave = code === 0x300 || props.chr.type === ACCENT_GRAVE,
bAccAcute = code === 0x301 || props.chr.type === ACCENT_ACUTE;
if(bDot || b2Dots || b3Dots || bAccGrave || bAccAcute)
{
this.accent = new CMathText();
this.accent.add(code);
typeOper = props.chr.type;
}*/
if(code === 0x302 || type === ACCENT_CIRCUMFLEX)
{
typeOper = ACCENT_CIRCUMFLEX;
codeChr = 0x302;
operator = new CCircumflex();
var props =
{
turn: TURN_MIRROR_0
};
operator.init(props);
}
else if(code === 0x30C || type === ACCENT_COMB_CARON)
{
typeOper = ACCENT_COMB_CARON;
codeChr = 0x30C;
operator = new CCircumflex();
var props =
{
turn: TURN_0
};
operator.init(props);
}
else if(code === 0x305 || type === ACCENT_LINE)
{
typeOper = ACCENT_LINE;
//codeChr = 0x332;
codeChr = 0x305;
operator = new CLine();
}
else if(code === 0x33F || type === ACCENT_DOUBLE_LINE)
{
typeOper = ACCENT_DOUBLE_LINE;
//codeChr = 0x333;
codeChr = 0x33F;
operator = new CDoubleLine();
}
else if(code === 0x303 || type === ACCENT_TILDE)
{
typeOper = ACCENT_TILDE;
codeChr = 0x303;
operator = new CTilde();
}
else if(code === 0x306 || type === ACCENT_BREVE)
{
typeOper = ACCENT_BREVE;
codeChr = 0x306;
operator = new CBreve();
var props =
{
turn: TURN_MIRROR_0
};
operator.init(props);
}
else if(code == 0x311 || type == ACCENT_INVERT_BREVE)
{
typeOper = ACCENT_INVERT_BREVE;
codeChr = 0x311;
operator = new CBreve();
var props =
{
turn: TURN_0
};
operator.init(props);
}
else if(code === 0x20D6 || type === ACCENT_ARROW_LEFT)
{
typeOper = ACCENT_ARROW_LEFT;
codeChr = 0x20D6;
/*var glyph = new CCombiningArrow();
var props =
{
location: LOCATION_TOP,
turn: TURN_0
};
glyph.init(props);*/
operator = new COperator(OPER_ACCENT);
var props =
{
type: properties.chrType,
chr: properties.chr
};
var defaultProps =
{
loc: LOCATION_TOP
};
operator.init(props, defaultProps);
}
else if(code === 0x20D7 || type === ACCENT_ARROW_RIGHT)
{
typeOper = ACCENT_ARROW_RIGHT;
codeChr = 0x20D7;
/*var glyph = new CCombiningArrow();
var props =
{
location: LOCATION_TOP,
turn: TURN_180
};
glyph.init(props);
operator = new COperator(glyph);*/
operator = new COperator(OPER_ACCENT);
var props =
{
type: properties.chrType,
chr: properties.chr
};
var defaultProps =
{
loc: LOCATION_TOP
};
operator.init(props, defaultProps);
}
else if(code === 0x20E1 || type === ACCENT_ARROW_LR)
{
typeOper = ACCENT_ARROW_LR;
codeChr = 0x20E1;
/*var glyph = new CCombining_LR_Arrow();
var props =
{
location: LOCATION_TOP,
turn: TURN_0
};
glyph.init(props);
operator = new COperator(glyph);*/
operator = new COperator(OPER_ACCENT);
var props =
{
type: properties.chrType,
chr: properties.chr
};
var defaultProps =
{
loc: LOCATION_TOP
};
operator.init(props, defaultProps);
}
else if(code === 0x20D0 || type === ACCENT_HALF_ARROW_LEFT)
{
typeOper = ACCENT_HALF_ARROW_LEFT;
codeChr = 0x20D0;
/*var glyph = new CCombiningHalfArrow();
var props =
{
location: LOCATION_TOP,
turn: TURN_0
};
glyph.init(props);
operator = new COperator(glyph);*/
operator = new COperator(OPER_ACCENT);
var props =
{
type: properties.chrType,
chr: properties.chr
};
var defaultProps =
{
loc: LOCATION_TOP
};
operator.init(props, defaultProps);
}
else if(code === 0x20D1 || type === ACCENT_HALF_ARROW_RIGHT)
{
typeOper = ACCENT_HALF_ARROW_RIGHT;
codeChr = 0x20D1;
/*var glyph = new CCombiningHalfArrow();
var props =
{
location: LOCATION_TOP,
turn: TURN_180
};
glyph.init(props);
operator = new COperator(glyph);*/
operator = new COperator(OPER_ACCENT);
var props =
{
type: properties.chrType,
chr: properties.chr
};
var defaultProps =
{
loc: LOCATION_TOP
};
operator.init(props, defaultProps);
}
/*if(code === 0x302 || type === ACCENT_CIRCUMFLEX)
{
typeOper = ACCENT_CIRCUMFLEX;
this.code = 0x302;
accent = new CCircumflex();
accent.setTurn(TURN_0);
}
else if(code === 0x30C || type === ACCENT_COMB_CARON)
{
typeOper = ACCENT_COMB_CARON;
this.code = 0x30C;
accent = new CCircumflex();
accent.setTurn(TURN_MIRROR_0);
}
else if(code === 0x332 || type === ACCENT_LINE)
{
typeOper = ACCENT_LINE;
this.code = 0x332;
accent = new CLine();
}
else if(code === 0x333 || type === ACCENT_DOUBLE_LINE)
{
typeOper = ACCENT_DOUBLE_LINE;
this.code = 0x333;
accent = new CDoubleLine();
}
else if(code === 0x303 || type === ACCENT_TILDE)
{
typeOper = ACCENT_TILDE;
this.code = 0x303;
accent = new CTilde();
}
else if(code === 0x306 || type === ACCENT_BREVE)
{
typeOper = ACCENT_BREVE;
this.code = 0x306;
accent = new CBreve();
accent.setTurn(TURN_MIRROR_0);
}
else if(code == 0x311 || type == ACCENT_INVERT_BREVE)
{
typeOper = ACCENT_INVERT_BREVE;
this.code = 0x311;
accent = new CBreve();
accent.setTurn(TURN_0);
}
else if(code === 0x20D6 || type === ACCENT_ARROW_LEFT)
{
typeOper = ACCENT_ARROW_LEFT;
this.code = 0x20D6;
glyph = new CCombiningArrow();
var prp =
{
location: LOCATION_TOP,
turn: TURN_0
};
glyph.init(prp);
accent = new COperator(glyph);
}
else if(code === 0x20D7 || type === ACCENT_ARROW_RIGHT)
{
typeOper = ACCENT_ARROW_RIGHT;
this.code = 0x20D7;
glyph = new CCombiningArrow();
var prp =
{
location: LOCATION_TOP,
turn: TURN_180
};
glyph.init(prp);
accent = new COperator(glyph);
}
else if(code === 0x20E1 || type === ACCENT_ARROW_LR)
{
typeOper = ACCENT_ARROW_LR;
this.code = 0x20E1;
glyph = new CCombining_LR_Arrow();
var prp =
{
location: LOCATION_TOP,
turn: TURN_0
};
glyph.init(prp);
accent = new COperator(glyph);
}
else if(code === 0x20D0 || type === ACCENT_HALF_ARROW_LEFT)
{
typeOper = ACCENT_HALF_ARROW_LEFT;
this.code = 0x20D0;
glyph = new CCombiningHalfArrow();
var prp =
{
location: LOCATION_TOP,
turn: TURN_0
};
glyph.init(prp);
accent = new COperator(glyph);
}
else if(code === 0x20D1 || type === ACCENT_HALF_ARROW_RIGHT)
{
typeOper = ACCENT_HALF_ARROW_RIGHT;
this.code = 0x20D1;
glyph = new CCombiningHalfArrow();
var prp =
{
location: LOCATION_TOP,
turn: TURN_180
};
glyph.init(prp);
accent = new COperator(glyph);
}*/
///// group characters /////
/*else if(code === 0x2190 || type === ARROW_LEFT)
{
typeOper = ARROW_LEFT;
codeChr = 0x2190;
operator = new CSingleArrow();
var props =
{
location: this.loc,
turn: TURN_0
};
operator.init(props);
}
else if(code === 0x2192 || type === ARROW_RIGHT)
{
typeOper = ARROW_RIGHT;
codeChr = 0x2192;
glyph = new CSingleArrow();
var prp =
{
location: this.loc,
turn: TURN_180
};
glyph.init(prp);
}
else if(code === 0x2194 || type === ARROW_LR)
{
typeOper = ARROW_LR;
codeChr = 0x2194;
glyph = new CLeftRightArrow();
var prp =
{
location: this.loc,
turn: TURN_0
};
glyph.init(prp);
}
else if(code === 0x21D0 || type === DOUBLE_LEFT_ARROW)
{
typeOper = DOUBLE_LEFT_ARROW;
codeChr = 0x21D0;
glyph = new CDoubleArrow();
var prp =
{
location: this.loc,
turn: TURN_0
};
glyph.init(prp);
}
else if(code === 0x21D2 || type === DOUBLE_RIGHT_ARROW)
{
typeOper = DOUBLE_RIGHT_ARROW;
codeChr = 0x21D2;
glyph = new CDoubleArrow();
var prp =
{
location: this.loc,
turn: TURN_180
};
glyph.init(prp);
}
else if(code === 0x21D4 || type === DOUBLE_ARROW_LR)
{
typeOper = DOUBLE_ARROW_LR;
codeChr = 0x21D4;
glyph = new CLR_DoubleArrow();
var prp =
{
location: this.loc,
turn: TURN_0
};
glyph.init(prp);
}*/
/////
else if(bCode || bType)
{
typeOper = ACCENT_SIGN;
operator = new CSign();
var props =
{
type: type,
code: code
};
operator.init(props);
codeChr = operator.getCodeCharacter();
}
else
{
/*typeOper = ACCENT_COMB_CARON;
codeChr = 0x30C;
operator = new CCircumflex();
var props =
{
turn: TURN_MIRROR_0
};
operator.init(props);*/
typeOper = ACCENT_CIRCUMFLEX;
codeChr = 0x302;
operator = new CCircumflex();
var props =
{
turn: TURN_MIRROR_0
};
operator.init(props);
}
this.operator = operator;
this.operator.relate(this);
////
// TO DO
// убрать
//
this.typeOper = typeOper;
this.code = codeChr;
////
this.setDimension(1, 1);
this.setContent();
//this.setOperator(accent);
this.elements[0][0].SetDot(true);
}
CAccent.prototype.setPosition = function(pos, PosInfo)
{
this.pos.x = pos.x;
......@@ -318165,7 +317723,6 @@ CAccent.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
this.operator.fixSize(ParaMath, oMeasure, base.size.width);
if(this.operator.typeOper == OPERATOR_TEXT)
{
var letterX = new CMathText(true);
......@@ -318182,6 +317739,7 @@ CAccent.prototype.Resize = function(oMeasure, Parent, ParaMath, RPI, ArgSize)
height = base.size.height + this.operator.size.height + this.gap,
ascent = this.operator.size.height + this.gap + this.elements[0][0].size.ascent;
width += this.GapLeft + this.GapRight;
this.size = {height: height, width: width, ascent: ascent};
}
......@@ -340403,8 +339961,6 @@ Range.prototype.getValueWithFormat=function(){
};
Range.prototype.getValue2=function(dDigitsCount, fIsFitMeasurer){
//[{"text":"qwe","format":{"b":true, "i":false, "u":Asc.EUnderline.underlineNone, "s":false, "fn":"Arial", "fs": 12, "c": 0xff00ff, "va": "subscript" }},{}...]
var nRow0 = this.bbox.r1;
var nCol0 = this.bbox.c1;
var cell = this.worksheet._getCellNoEmpty(this.bbox.r1, this.bbox.c1);
if(null != cell)
return cell.getValue2(dDigitsCount, fIsFitMeasurer);
......@@ -340475,6 +340031,19 @@ Range.prototype.getNumFormatStr=function(){
Range.prototype.getNumFormatType=function(){
return this.getNumFormat().getType();
};
// Узнаем отличается ли шрифт (размер и гарнитура) в ячейке от шрифта в строке
Range.prototype.isNotDefaultFont = function () {
// Получаем фонт ячейки
var cellFont = this.getFont();
var rowFont = g_oDefaultFont;
var row = this.worksheet._getRowNoEmpty(this.bbox.r1);
if (null != row && null != row.xfs && null != row.xfs.font)
rowFont = row.xfs.font;
else if (null != this.oAllCol)
rowFont = this.oAllCol;
return (cellFont.fn !== rowFont.fn || cellFont.fs !== rowFont.fs);
};
Range.prototype.getFont = function(){
var nRow = this.bbox.r1;
var nCol = this.bbox.c1;
......@@ -340498,180 +340067,28 @@ Range.prototype.getFont = function(){
return g_oDefaultFont;
};
Range.prototype.getFontname=function(){
var nRow = this.bbox.r1;
var nCol = this.bbox.c1;
var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell)
{
var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.font)
return xfs.font.fn;
}
else
{
//стили столбов и колонок
var row = this.worksheet._getRowNoEmpty(nRow);
if(null != row && null != row.xfs && null != row.xfs.font)
return row.xfs.font.fn;
var col = this.worksheet._getColNoEmptyWithAll(nCol);
if(null != col && null != col.xfs && null != col.xfs.font)
return col.xfs.font.fn;
}
return g_oDefaultFont.fn;
return this.getFont().fn;
};
Range.prototype.getFontsize=function(){
var nRow = this.bbox.r1;
var nCol = this.bbox.c1;
var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell)
{
var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.font)
return xfs.font.fs;
}
else
{
//стили столбов и колонок
var row = this.worksheet._getRowNoEmpty(nRow);
if(null != row && null != row.xfs && null != row.xfs.font)
return row.xfs.font.fs;
var col = this.worksheet._getColNoEmptyWithAll(nCol);
if(null != col && null != col.xfs && null != col.xfs.font)
return col.xfs.font.fs;
}
return g_oDefaultFont.fs;
return this.getFont().fs;
};
Range.prototype.getFontcolor=function(){
var nRow = this.bbox.r1;
var nCol = this.bbox.c1;
var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell)
{
var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.font)
return xfs.font.c;
}
else
{
//стили столбов и колонок
var row = this.worksheet._getRowNoEmpty(nRow);
if(null != row && null != row.xfs && null != row.xfs.font)
return row.xfs.font.c;
var col = this.worksheet._getColNoEmptyWithAll(nCol);
if(null != col && null != col.xfs && null != col.xfs.font)
return col.xfs.font.c;
}
return g_oDefaultFont.c;
return this.getFont().c;
};
Range.prototype.getBold=function(){
var nRow = this.bbox.r1;
var nCol = this.bbox.c1;
var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell)
{
var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.font)
return xfs.font.b;
}
else
{
//стили столбов и колонок
var row = this.worksheet._getRowNoEmpty(nRow);
if(null != row && null != row.xfs && null != row.xfs.font)
return row.xfs.font.b;
var col = this.worksheet._getColNoEmptyWithAll(nCol);
if(null != col && null != col.xfs && null != col.xfs.font)
return col.xfs.font.b;
}
return g_oDefaultFont.b;
return this.getFont().b;
};
Range.prototype.getItalic=function(){
var nRow = this.bbox.r1;
var nCol = this.bbox.c1;
var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell)
{
var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.font)
return xfs.font.i;
}
else
{
//стили столбов и колонок
var row = this.worksheet._getRowNoEmpty(nRow);
if(null != row && null != row.xfs && null != row.xfs.font)
return row.xfs.font.i;
var col = this.worksheet._getColNoEmptyWithAll(nCol);
if(null != col && null != col.xfs && null != col.xfs.font)
return col.xfs.font.i;
}
return g_oDefaultFont.i;
return this.getFont().i;
};
Range.prototype.getUnderline=function(){
var nRow = this.bbox.r1;
var nCol = this.bbox.c1;
var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell)
{
var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.font)
return xfs.font.u;
}
else
{
//стили столбов и колонок
var row = this.worksheet._getRowNoEmpty(nRow);
if(null != row && null != row.xfs && null != row.xfs.font)
return row.xfs.font.u;
var col = this.worksheet._getColNoEmptyWithAll(nCol);
if(null != col && null != col.xfs && null != col.xfs.font)
return col.xfs.font.u;
}
return g_oDefaultFont.u;
return this.getFont().u;
};
Range.prototype.getStrikeout=function(){
var nRow = this.bbox.r1;
var nCol = this.bbox.c1;
var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell)
{
var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.font)
return xfs.font.s;
}
else
{
//стили столбов и колонок
var row = this.worksheet._getRowNoEmpty(nRow);
if(null != row && null != row.xfs && null != row.xfs.font)
return row.xfs.font.s;
var col = this.worksheet._getColNoEmptyWithAll(nCol);
if(null != col && null != col.xfs && null != col.xfs.font)
return col.xfs.font.s;
}
return g_oDefaultFont.s;
return this.getFont().s;
};
Range.prototype.getFontAlign=function(){
var nRow = this.bbox.r1;
var nCol = this.bbox.c1;
var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell)
{
var xfs = cell.getCompiledStyle();
if(null != xfs && null != xfs.font)
return xfs.font.va;
}
else
{
//стили столбов и колонок
var row = this.worksheet._getRowNoEmpty(nRow);
if(null != row && null != row.xfs && null != row.xfs.font)
return row.xfs.font.va;
var col = this.worksheet._getColNoEmptyWithAll(nCol);
if(null != col && null != col.xfs && null != col.xfs.font)
return col.xfs.font.va;
}
return g_oDefaultFont.va;
return this.getFont().va;
};
Range.prototype.getQuotePrefix=function(){
var nRow = this.bbox.r1;
......@@ -353004,6 +352421,9 @@ window["asc_docs_api"].prototype["asc_nativeOpenFile"] = function(base64File)
if (this.GenerateNativeStyles !== undefined)
{
this.GenerateNativeStyles();
if (this.WordControl.m_oDrawingDocument.CheckTableStylesOne !== undefined)
this.WordControl.m_oDrawingDocument.CheckTableStylesOne();
}
};
......@@ -353637,6 +353057,8 @@ function CTableOutlineDr()
this.TableStylesSheckLook = null;
this.TableStylesSheckLookFlag = false;
this.TableStylesSendOne = false;
this.Native = window["native"];
this.checkMouseDown = function(pos, drDoc)
......@@ -354082,6 +353504,8 @@ function CDrawingDocument()
this.TableOutlineDr = new CTableOutlineDr();
}
var _table_styles = null;
CDrawingDocument.prototype =
{
AfterLoad : function()
......@@ -355004,8 +354428,24 @@ CDrawingDocument.prototype =
}
},
CheckTableStylesOne : function()
{
var _tableLook = new CTablePropLook(undefined);
_tableLook.FirstRow = true;
_tableLook.BandHor = true;
_tableLook.FirstCol = true;
this.CheckTableStyles(_tableLook);
this.TableStylesSendOne = true;
},
CheckTableStyles : function(tableLook)
{
if (true === this.TableStylesSendOne)
return;
if (this.TableStylesSheckLookFlag)
{
this.TableStylesSheckLook = tableLook;
......@@ -359430,6 +358870,7 @@ asc_docs_api.prototype.Internal_Update_Ind_Right = function(Right)
asc_docs_api.prototype["NativeAfterLoad"] = function()
{
this.WordControl.m_oDrawingDocument.AfterLoad();
this.WordControl.m_oLogicDocument.Set_UseTextShd(false);
};
asc_docs_api.prototype["GetNativePageMeta"] = function(pageIndex)
{
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