Commit d9cac898 authored by Alexander.Trofimov's avatar Alexander.Trofimov

Binary_ChartWriter перевел на prototype


git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53671 954022d7-b5bf-4e40-9824-e11837661b57
parent 6c48e9d6
......@@ -958,13 +958,14 @@ function BinaryChartWriter(memory)
{
this.memory = memory;
this.bs = new BinaryCommonWriter(this.memory);
this.Write = function(chartAsGroup)
{
}
BinaryChartWriter.prototype.Write = function(chartAsGroup)
{
var oThis = this;
this.bs.WriteItem(c_oSer_DrawingType.Chart, function(){oThis.WriteChartContent(chartAsGroup);});
};
this.WriteChartContent = function(chartAsGroup)
{
};
BinaryChartWriter.prototype.WriteChartContent = function(chartAsGroup)
{
var oThis = this;
var chart = chartAsGroup.chart;
if(null != chart.legend && true == chart.legend.bShow)
......@@ -984,9 +985,9 @@ function BinaryChartWriter(memory)
oTempSpPr.ln = oLn;
this.bs.WriteItem(c_oSer_ChartType.SpPr, function(){window.global_pptx_content_writer.WriteSpPr(oThis.memory, oTempSpPr);});
}
};
this.WriteLegend = function(legend)
{
};
BinaryChartWriter.prototype.WriteLegend = function(legend)
{
var oThis = this;
if(null != legend.position)
{
......@@ -1003,9 +1004,9 @@ function BinaryChartWriter(memory)
}
if(null != legend.bOverlay)
this.bs.WriteItem(c_oSer_ChartLegendType.Overlay, function(){oThis.memory.WriteBool(legend.bOverlay);});
};
this.WritePlotArea = function(chartAsGroup)
{
};
BinaryChartWriter.prototype.WritePlotArea = function(chartAsGroup)
{
var oThis = this;
var chart = chartAsGroup.chart;
var xAxisTitle = chartAsGroup.hAxisTitle;
......@@ -1031,9 +1032,9 @@ function BinaryChartWriter(memory)
}
this.bs.WriteItem(c_oSer_ChartPlotAreaType.BasicChart, function(){oThis.WriteBasicChart(chart);});
};
this.WriteCatAx = function(oAxisTitle, axis, axis2, bBottom)
{
};
BinaryChartWriter.prototype.WriteCatAx = function(oAxisTitle, axis, axis2, bBottom)
{
var oThis = this;
if(null != oAxisTitle && null != oAxisTitle.txBody)
this.bs.WriteItem(c_oSer_ChartCatAxType.TitlePptx, function(){oThis.WriteTitlePptx(oAxisTitle.txBody, axis.bDefaultTitle);});
......@@ -1045,9 +1046,9 @@ function BinaryChartWriter(memory)
this.bs.WriteItem(c_oSer_ChartCatAxType.AxPos, function(){oThis.memory.WriteByte(EChartAxPos.chartaxposBottom);});
else
this.bs.WriteItem(c_oSer_ChartCatAxType.AxPos, function(){oThis.memory.WriteByte(EChartAxPos.chartaxposLeft);});
};
this.WriteBasicChart = function(chart)
{
};
BinaryChartWriter.prototype.WriteBasicChart = function(chart)
{
var oThis = this;
var byteType = null;
if(null != chart.type)
......@@ -1122,9 +1123,9 @@ function BinaryChartWriter(memory)
this.memory.WriteByte(c_oSerPropLenType.Variable);
this.bs.WriteItemWithLength(function(){oThis.WriteDataLabels(chart);});
}
};
this.WriteSeries = function(chart)
{
};
BinaryChartWriter.prototype.WriteSeries = function(chart)
{
var oThis = this;
for(var i = 0, length = chart.series.length; i < length; ++i)
{
......@@ -1132,9 +1133,9 @@ function BinaryChartWriter(memory)
if(null != seria)
this.bs.WriteItem(c_oSer_BasicChartType.Seria, function(){oThis.WriteSeria(chart, seria, i);});
}
};
this.WriteSeria = function(chart, seria, nIndex)
{
};
BinaryChartWriter.prototype.WriteSeria = function(chart, seria, nIndex)
{
var oThis = this;
if(c_oAscChartType.scatter == chart.type && null != seria.xVal)
this.bs.WriteItem(c_oSer_ChartSeriesType.xVal, function(){oThis.WriteSeriesNumCache(seria.xVal);});
......@@ -1172,9 +1173,9 @@ function BinaryChartWriter(memory)
}
if(c_oAscChartType.scatter != chart.type && null != seria.Cat && (null != seria.Cat.Formula || seria.Cat.NumCache.length > 0))
this.bs.WriteItem(c_oSer_ChartSeriesType.Cat, function(){oThis.WriteSeriesNumCache(seria.Cat);});
};
this.WriteSeriesNumCache = function(oCache)
{
};
BinaryChartWriter.prototype.WriteSeriesNumCache = function(oCache)
{
var oThis = this;
if(null != oCache.Formula)
{
......@@ -1183,9 +1184,9 @@ function BinaryChartWriter(memory)
}
if(null != oCache.NumCache)
this.bs.WriteItem(c_oSer_ChartSeriesNumCacheType.NumCache2, function(){oThis.WriteSeriesNumCacheValues(oCache.NumCache);});
};
this.WriteSeriesNumCacheValues = function(NumCache)
{
};
BinaryChartWriter.prototype.WriteSeriesNumCacheValues = function(NumCache)
{
var oThis = this;
for(var i in NumCache)
{
......@@ -1194,18 +1195,18 @@ function BinaryChartWriter(memory)
if(null != elem)
this.bs.WriteItem(c_oSer_ChartSeriesNumCacheType.NumCacheItem, function(){oThis.WriteSeriesNumCacheValue(elem.val, nIndex);});
}
}
this.WriteSeriesNumCacheValue = function(val, index)
{
};
BinaryChartWriter.prototype.WriteSeriesNumCacheValue = function(val, index)
{
var oThis = this;
//val
this.memory.WriteByte(c_oSer_ChartSeriesNumCacheType.NumCacheVal);
this.memory.WriteString2(val.toString());
//index
this.bs.WriteItem(c_oSer_ChartSeriesNumCacheType.NumCacheIndex, function(){oThis.memory.WriteLong(index);});
}
this.WriteSeriesMarkers = function(marker)
{
};
BinaryChartWriter.prototype.WriteSeriesMarkers = function(marker)
{
var oThis = this;
if(null != marker.Size)
{
......@@ -1219,9 +1220,9 @@ function BinaryChartWriter(memory)
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteByte(marker.Symbol);
}
};
this.WriteDataLabels = function(chart)
{
};
BinaryChartWriter.prototype.WriteDataLabels = function(chart)
{
var oThis = this;
if(null != chart.bShowValue)
{
......@@ -1235,16 +1236,15 @@ function BinaryChartWriter(memory)
this.memory.WriteByte(c_oSerPropLenType.Byte);
this.memory.WriteBool(chart.bShowCatName);
}
};
this.WriteTitlePptx = function(txBody, bDefault)
{
};
BinaryChartWriter.prototype.WriteTitlePptx = function(txBody, bDefault)
{
var oThis = this;
if(true != bDefault)
this.bs.WriteItem(c_oSer_ChartTitlePptxType.TxPptx, function(){window.global_pptx_content_writer.WriteTextBody(oThis.memory, txBody);});
else
this.bs.WriteItem(c_oSer_ChartTitlePptxType.TxPrPptx, function(){window.global_pptx_content_writer.WriteTextBody(oThis.memory, txBody);});
}
}
};
/** @constructor */
function Binary_ChartReader(stream, chart, chartAsGroup)
{
......
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