Commit e7c3ac28 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

рефакторинг

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53483 954022d7-b5bf-4e40-9824-e11837661b57
parent a1664989
...@@ -617,7 +617,7 @@ function calcAllMargin(isFormatCell,isformatCellScOy,minX,maxX,minY,maxY, chart) ...@@ -617,7 +617,7 @@ function calcAllMargin(isFormatCell,isformatCellScOy,minX,maxX,minY,maxY, chart)
{ {
if(bar.type == 'hbar' && bar._otherProps._autoGrouping == 'stackedPer') if(bar.type == 'hbar' && bar._otherProps._autoGrouping == 'stackedPer')
{ {
for (i=0; i<bar.data.length; ++i) { for (var i = 0; i < bar.data.length; ++i) {
if (typeof(bar.data[i]) == 'object') { if (typeof(bar.data[i]) == 'object') {
var value = Number(OfficeExcel.array_max(bar.data[i], true)); var value = Number(OfficeExcel.array_max(bar.data[i], true));
} else { } else {
...@@ -981,7 +981,7 @@ function insertChart(chart, options) { ...@@ -981,7 +981,7 @@ function insertChart(chart, options) {
isNumberVal = false; isNumberVal = false;
} }
} }
for(l = 0; l < series.length; ++l) for(var l = 0; l < series.length; ++l)
{ {
var firstCol = 0; var firstCol = 0;
var firstRow = 0; var firstRow = 0;
...@@ -1015,7 +1015,7 @@ function insertChart(chart, options) { ...@@ -1015,7 +1015,7 @@ function insertChart(chart, options) {
var row = firstRow; var row = firstRow;
var n = 0; var n = 0;
for(col = firstCol; col < lastCol; ++col) for(var col = firstCol; col < lastCol; ++col)
{ {
if(!curSeria[col]) if(!curSeria[col])
{ {
...@@ -1130,10 +1130,10 @@ function insertChart(chart, options) { ...@@ -1130,10 +1130,10 @@ function insertChart(chart, options) {
formatCellScOy = formatCell; formatCellScOy = formatCell;
formatCell = 'General'; formatCell = 'General';
for (i = 0; i < scatterArr.length; ++i) { for (var i = 0; i < scatterArr.length; ++i) {
newArr[i] = []; newArr[i] = [];
newAdobeLabels[i] = []; newAdobeLabels[i] = [];
for (j = 0; j < scatterArr[i].length; ++j) { for (var j = 0; j < scatterArr[i].length; ++j) {
newArr[i][j] = []; newArr[i][j] = [];
newAdobeLabels[i][j] = []; newAdobeLabels[i][j] = [];
newArr[i][j][0] = j+1; newArr[i][j][0] = j+1;
...@@ -1162,7 +1162,7 @@ function insertChart(chart, options) { ...@@ -1162,7 +1162,7 @@ function insertChart(chart, options) {
{ {
newArr[0]=[]; newArr[0]=[];
newAdobeLabels[0] = []; newAdobeLabels[0] = [];
for (j = 0; j < scatterArr[0].length; ++j) { for (var j = 0; j < scatterArr[0].length; ++j) {
newArr[0][j] = []; newArr[0][j] = [];
newAdobeLabels[0][j] = []; newAdobeLabels[0][j] = [];
newArr[0][j][0] = j+1; newArr[0][j][0] = j+1;
...@@ -1193,10 +1193,10 @@ function insertChart(chart, options) { ...@@ -1193,10 +1193,10 @@ function insertChart(chart, options) {
else else
{ {
//принимаем первую срочку за X, остальные за y //принимаем первую срочку за X, остальные за y
for (i = 1; i < scatterArr.length; ++i) { for (var i = 1; i < scatterArr.length; ++i) {
newArr[i-1] = []; newArr[i-1] = [];
newAdobeLabels[i-1] = []; newAdobeLabels[i-1] = [];
for (j = 0; j < scatterArr[i].length; ++j) { for (var j = 0; j < scatterArr[i].length; ++j) {
newArr[i-1][j] = []; newArr[i-1][j] = [];
newAdobeLabels[i-1][j] = []; newAdobeLabels[i-1][j] = [];
newArr[i-1][j][0] = scatterArr[0][j]; newArr[i-1][j][0] = scatterArr[0][j];
...@@ -1322,9 +1322,9 @@ function arrReverse(arr) { ...@@ -1322,9 +1322,9 @@ function arrReverse(arr) {
if(!arr || !arr.length) if(!arr || !arr.length)
return; return;
var newarr = []; var newarr = [];
for (i = 0; i < arr[0].length; ++i) { for (var i = 0; i < arr[0].length; ++i) {
newarr[i] = []; newarr[i] = [];
for (j = 0; j < arr.length; ++j) { for (var j = 0; j < arr.length; ++j) {
newarr[i][j] = arr[j][i]; newarr[i][j] = arr[j][i];
} }
} }
......
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
var yTickGap = (OfficeExcel.GetHeight(this) - this._chartGutter._top - this._chartGutter._bottom) / numYTicks; var yTickGap = (OfficeExcel.GetHeight(this) - this._chartGutter._top - this._chartGutter._bottom) / numYTicks;
var xpos = yaxispos == 'left' ? this._chartGutter._left : OfficeExcel.GetWidth(this) - this._chartGutter._right; var xpos = yaxispos == 'left' ? this._chartGutter._left : OfficeExcel.GetWidth(this) - this._chartGutter._right;
for (y=this._chartGutter._top,isCount = 0; for (var y=this._chartGutter._top,isCount = 0;
xaxispos == 'center' ? y <= (OfficeExcel.GetHeight(this) - this._chartGutter._bottom) + 2 : y <= (OfficeExcel.GetHeight(this) - this._chartGutter._bottom + (xaxispos == 'top' ? 1 : 0)) + 2; xaxispos == 'center' ? y <= (OfficeExcel.GetHeight(this) - this._chartGutter._bottom) + 2 : y <= (OfficeExcel.GetHeight(this) - this._chartGutter._bottom + (xaxispos == 'top' ? 1 : 0)) + 2;
y += yTickGap,++isCount) { y += yTickGap,++isCount) {
...@@ -304,7 +304,7 @@ ...@@ -304,7 +304,7 @@
underline: this._otherProps._labels_above_underline underline: this._otherProps._labels_above_underline
}; };
for (i=0; i<this.data.length; ++i) { for (var i=0; i<this.data.length; ++i) {
// Work out the height // Work out the height
//The width is up outside the loop //The width is up outside the loop
...@@ -496,7 +496,7 @@ ...@@ -496,7 +496,7 @@
} else if (typeof(this.data[i]) == 'object') { } else if (typeof(this.data[i]) == 'object') {
this.context.lineWidth = this._otherProps._linewidth; this.context.lineWidth = this._otherProps._linewidth;
for (j=0; j<this.data[i].length; ++j) { for (var j=0; j<this.data[i].length; ++j) {
// Set the fill and stroke colors // Set the fill and stroke colors
this.context.strokeStyle = strokeStyle; this.context.strokeStyle = strokeStyle;
...@@ -541,7 +541,7 @@ ...@@ -541,7 +541,7 @@
} }
else else
{*/ {*/
for (n=0; n<j; ++n) for (var n = 0; n < j; ++n)
{ {
if(this.min < 0 && this.max > 0) if(this.min < 0 && this.max > 0)
{ {
...@@ -647,7 +647,7 @@ ...@@ -647,7 +647,7 @@
} }
var diffWidth; var diffWidth;
var diffHeight; var diffHeight;
for (x=this._chartGutter._left + (xTickGap / 2); x<=OfficeExcel.GetWidth(this) - this._chartGutter._right; x+=xTickGap) { for (var x=this._chartGutter._left + (xTickGap / 2); x<=OfficeExcel.GetWidth(this) - this._chartGutter._right; x+=xTickGap) {
if('auto' == this._otherProps._ylabels_count) if('auto' == this._otherProps._ylabels_count)
{ {
diffWidth = axisOxAngleOptions ? (axisOxAngleOptions[countLabels]*Math.sin(angle*Math.PI/180))/(4) : 0; diffWidth = axisOxAngleOptions ? (axisOxAngleOptions[countLabels]*Math.sin(angle*Math.PI/180))/(4) : 0;
......
...@@ -1276,7 +1276,7 @@ ...@@ -1276,7 +1276,7 @@
var i, sum; var i, sum;
var len = arr.length; var len = arr.length;
for(i=0,sum=0;i<len;sum+=arr[i++]); for(var i=0,sum=0;i<len;sum+=arr[i++]);
return sum; return sum;
} }
...@@ -1512,7 +1512,7 @@ ...@@ -1512,7 +1512,7 @@
// Draw the horizontal lines // Draw the horizontal lines
if (obj._otherProps._background_grid_hlines) { if (obj._otherProps._background_grid_hlines) {
height = (OfficeExcel.GetHeight(obj) - gutterBottom - gutterTop); height = (OfficeExcel.GetHeight(obj) - gutterBottom - gutterTop);
for (y = gutterTop; y <= height + gutterTop + 1; y+=obj._otherProps._background_grid_hsize) { for (var y = gutterTop; y <= height + gutterTop + 1; y+=obj._otherProps._background_grid_hsize) {
if((y + obj._otherProps._background_grid_hsize) > (height + gutterTop + 1)) if((y + obj._otherProps._background_grid_hsize) > (height + gutterTop + 1))
{ {
y = height + gutterTop; y = height + gutterTop;
...@@ -1533,7 +1533,7 @@ ...@@ -1533,7 +1533,7 @@
if (obj._otherProps._background_grid_vlines) { if (obj._otherProps._background_grid_vlines) {
// Draw the vertical lines // Draw the vertical lines
var width = (obj.canvas.width - gutterRight - gutterLeft) var width = (obj.canvas.width - gutterRight - gutterLeft)
for (x=gutterLeft; x<=width + gutterLeft + 1; x+=obj._otherProps._background_grid_vsize) { for (var x=gutterLeft; x<=width + gutterLeft + 1; x+=obj._otherProps._background_grid_vsize) {
if((x + obj._otherProps._background_grid_vsize) > width + gutterLeft + 1) if((x + obj._otherProps._background_grid_vsize) > width + gutterLeft + 1)
{ {
x = width + gutterLeft; x = width + gutterLeft;
...@@ -1635,7 +1635,7 @@ ...@@ -1635,7 +1635,7 @@
* Work backwards adding the thousand seperators * Work backwards adding the thousand seperators
*/ */
var foundPoint; var foundPoint;
for (i=(num.length - 1),j=0; i>=0; j++,i--) { for (var i=(num.length - 1),j=0; i>=0; j++,i--) {
var character = num.charAt(i); var character = num.charAt(i);
if ( j % 3 == 0 && j != 0) { if ( j % 3 == 0 && j != 0) {
...@@ -1653,7 +1653,7 @@ ...@@ -1653,7 +1653,7 @@
*/ */
var rev = output; var rev = output;
output = ''; output = '';
for (i=(rev.length - 1); i>=0; i--) { for (var i=(rev.length - 1); i>=0; i--) {
output += rev.charAt(i); output += rev.charAt(i);
} }
...@@ -1692,7 +1692,7 @@ ...@@ -1692,7 +1692,7 @@
*/ */
obj.context.beginPath(); obj.context.beginPath();
for (i=0; i<hbars.length; ++i) { for (var i=0; i<hbars.length; ++i) {
// If null is specified as the "height", set it to the upper max value // If null is specified as the "height", set it to the upper max value
if (hbars[i][1] == null) { if (hbars[i][1] == null) {
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
context.font = text_size + 'pt ' + obj._otherProps._text_font; context.font = text_size + 'pt ' + obj._otherProps._text_font;
// Work out the longest bit of text // Work out the longest bit of text
for (i=0; i<key.length; ++i) { for (var i=0; i<key.length; ++i) {
width = Math.max(width, context.measureText(key[i]).width); width = Math.max(width, context.measureText(key[i]).width);
} }
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
this.max = 0; this.max = 0;
var value = 0; var value = 0;
for (i=0; i<this.data.length; ++i) { for (var i=0; i<this.data.length; ++i) {
if (typeof(this.data[i]) == 'object') { if (typeof(this.data[i]) == 'object') {
value = Number(OfficeExcel.array_max(this.data[i], true)); value = Number(OfficeExcel.array_max(this.data[i], true));
} else { } else {
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
{ {
var yTickGap = (this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) / this.data.length; var yTickGap = (this.canvas.height - this._chartGutter._top - this._chartGutter._bottom) / this.data.length;
for (y=this._chartGutter._top; y<=(this.canvas.height - this._chartGutter._bottom) + 1; y+=yTickGap) { for (var y=this._chartGutter._top; y<=(this.canvas.height - this._chartGutter._bottom) + 1; y+=yTickGap) {
if('auto' == this._otherProps._ylabels_count) if('auto' == this._otherProps._ylabels_count)
{ {
if( (y + yTickGap) > (this.canvas.height - this._chartGutter._bottom)) if( (y + yTickGap) > (this.canvas.height - this._chartGutter._bottom))
...@@ -185,7 +185,7 @@ ...@@ -185,7 +185,7 @@
yStart = this.canvas.height - this._chartGutter._bottom; yStart = this.canvas.height - this._chartGutter._bottom;
yEnd = (this.canvas.height - this._chartGutter._bottom) + 5; yEnd = (this.canvas.height - this._chartGutter._bottom) + 5;
for (x=(this.canvas.width - this._chartGutter._right), i=0; this._otherProps._yaxispos == 'center' ? x>=this._chartGutter._left : x>=this._chartGutter._left; x-=xTickGap) { for (var x=(this.canvas.width - this._chartGutter._right), i=0; this._otherProps._yaxispos == 'center' ? x>=this._chartGutter._left : x>=this._chartGutter._left; x-=xTickGap) {
if (this._otherProps._yaxispos != 'center' || i != 5) { if (this._otherProps._yaxispos != 'center' || i != 5) {
this.context.moveTo(AA(this, x), yStart); this.context.moveTo(AA(this, x), yStart);
...@@ -322,7 +322,7 @@ ...@@ -322,7 +322,7 @@
var i=0; var i=0;
if('auto' == this._otherProps._ylabels_count) if('auto' == this._otherProps._ylabels_count)
{ {
for (y=this._chartGutter._top + (yTickGap / 2); y<=OfficeExcel.GetHeight(this) - this._chartGutter._bottom; y+=yTickGap) { for (var y=this._chartGutter._top + (yTickGap / 2); y<=OfficeExcel.GetHeight(this) - this._chartGutter._bottom; y+=yTickGap) {
OfficeExcel.Text(this.context, font,text_size, this.nullPositionOX - xOffset,y,String(this._otherProps._labels[i++]),'center','right', false, null, null, bold, null,textOptions); OfficeExcel.Text(this.context, font,text_size, this.nullPositionOX - xOffset,y,String(this._otherProps._labels[i++]),'center','right', false, null, null, bold, null,textOptions);
} }
} }
...@@ -378,7 +378,7 @@ ...@@ -378,7 +378,7 @@
var graphwidth = (this.canvas.width - this._chartGutter._left - this._chartGutter._right); var graphwidth = (this.canvas.width - this._chartGutter._left - this._chartGutter._right);
var halfwidth = graphwidth / 2; var halfwidth = graphwidth / 2;
for (i=0; i<this.data.length; ++i) { for (var i=0; i<this.data.length; ++i) {
...@@ -474,7 +474,7 @@ ...@@ -474,7 +474,7 @@
*/ */
} else if (typeof(this.data[i]) == 'object') { } else if (typeof(this.data[i]) == 'object') {
for (j=0; j<this.data[i].length; ++j) { for (var j=0; j<this.data[i].length; ++j) {
// Set the fill/stroke colors // Set the fill/stroke colors
this.context.strokeStyle = this._otherProps._strokecolor; this.context.strokeStyle = this._otherProps._strokecolor;
if(this._otherProps._colors[j]) if(this._otherProps._colors[j])
......
...@@ -321,7 +321,7 @@ ...@@ -321,7 +321,7 @@
var lineto = (this._otherProps._yaxispos == 'left' ? this._chartGutter._left : this.canvas.width - this._chartGutter._right + this._otherProps._smallyticks); var lineto = (this._otherProps._yaxispos == 'left' ? this._chartGutter._left : this.canvas.width - this._chartGutter._right + this._otherProps._smallyticks);
// Draw the upper halves Y tick marks // Draw the upper halves Y tick marks
for (y=this._chartGutter._top; y < (this.grapharea / 2) + this._chartGutter._top; y+=interval) { for (var y=this._chartGutter._top; y < (this.grapharea / 2) + this._chartGutter._top; y+=interval) {
this.context.moveTo((this._otherProps._yaxispos == 'left' ? this._chartGutter._left - this._otherProps._smallyticks : this.canvas.width - this._chartGutter._right), AA(this, y)); this.context.moveTo((this._otherProps._yaxispos == 'left' ? this._chartGutter._left - this._otherProps._smallyticks : this.canvas.width - this._chartGutter._right), AA(this, y));
this.context.lineTo(lineto, AA(this, y)); this.context.lineTo(lineto, AA(this, y));
} }
...@@ -509,7 +509,7 @@ ...@@ -509,7 +509,7 @@
} }
var diffWidth; var diffWidth;
var diffHeight; var diffHeight;
for (i=0; i<numLabels; ++i) { for (var i=0; i<numLabels; ++i) {
// Changed 8th Nov 2010 to be not reliant on the coords // Changed 8th Nov 2010 to be not reliant on the coords
//if (this._otherProps._labels[i] && this.coords && this.coords[i] && this.coords[i][0]) { //if (this._otherProps._labels[i] && this.coords && this.coords[i] && this.coords[i][0]) {
...@@ -583,7 +583,7 @@ ...@@ -583,7 +583,7 @@
// Loop thru each value given, plotting the line // Loop thru each value given, plotting the line
// (FORMERLY FIRST) // (FORMERLY FIRST)
for (i=0; i<lineData.length; i++) { for (var i=0; i<lineData.length; i++) {
var data_point = lineData[i]; var data_point = lineData[i];
......
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
var text_size = this._otherProps._text_size; var text_size = this._otherProps._text_size;
for (lNum=0; lNum<labels.length; ++lNum) { for (var lNum=0; lNum<labels.length; ++lNum) {
isFormatCellTrue = isFormatCell; isFormatCellTrue = isFormatCell;
if(this.arrFormatAdobeLabels && this.arrFormatAdobeLabels[lNum]) if(this.arrFormatAdobeLabels && this.arrFormatAdobeLabels[lNum])
isFormatCellTrue = this.arrFormatAdobeLabels[0][lNum]; isFormatCellTrue = this.arrFormatAdobeLabels[0][lNum];
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
this.max = this._otherProps._ymax; this.max = this._otherProps._ymax;
else else
{ {
for (i=0; i<this.data.length; ++i) { for (var i=0; i<this.data.length; ++i) {
for (j=0; j<this.data[i].length; ++j) { for (j=0; j<this.data[i].length; ++j) {
this.max = Math.max(this.max, typeof(this.data[i][j][1]) == 'object' ? OfficeExcel.array_max(this.data[i][j][1]) : Math.abs(this.data[i][j][1])); this.max = Math.max(this.max, typeof(this.data[i][j][1]) == 'object' ? OfficeExcel.array_max(this.data[i][j][1]) : Math.abs(this.data[i][j][1]));
} }
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
this.DrawLabels(xScale,isFormatCell,isformatCellScOy); this.DrawLabels(xScale,isFormatCell,isformatCellScOy);
i = 0; i = 0;
for(i=0; i<this.data.length; ++i) { for(var i=0; i<this.data.length; ++i) {
this.DrawMarks(i); this.DrawMarks(i);
if(this._otherProps._type != 'burse2') if(this._otherProps._type != 'burse2')
...@@ -286,7 +286,7 @@ ...@@ -286,7 +286,7 @@
{ {
var numyticks = this._otherProps._numyticks; var numyticks = this._otherProps._numyticks;
for (y=this._chartGutter._top,countTick = 0; y <= this.canvas.height - this._chartGutter._bottom + 1 + (this._otherProps._xaxispos == 'center' ? 1 : 0) ; y+=(graphHeight / numyticks),countTick++) { for (var y=this._chartGutter._top,countTick = 0; y <= this.canvas.height - this._chartGutter._bottom + 1 + (this._otherProps._xaxispos == 'center' ? 1 : 0) ; y+=(graphHeight / numyticks),countTick++) {
if(countTick == numyticks) if(countTick == numyticks)
y = this.canvas.height - this._chartGutter._bottom; y = this.canvas.height - this._chartGutter._bottom;
...@@ -564,7 +564,7 @@ ...@@ -564,7 +564,7 @@
var valign = null; var valign = null;
var halign = 'center'; var halign = 'center';
for (i=0; i<labels.length; ++i) { for (var i=0; i<labels.length; ++i) {
if (typeof(labels[i]) == 'object') { if (typeof(labels[i]) == 'object') {
......
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