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