Commit 3b95cead authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

(2.0.0.139): AVSOfficeDocxFile2

(1.0.0.70): XlsxSerializerCom
Изменена запись chartTitle в бинарник

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49350 954022d7-b5bf-4e40-9824-e11837661b57
parent 504bfbbe
...@@ -760,9 +760,14 @@ var c_oSer_ChartType = ...@@ -760,9 +760,14 @@ var c_oSer_ChartType =
PlotArea: 2, PlotArea: 2,
Style: 3, Style: 3,
TitlePptx: 4, TitlePptx: 4,
TitleTxPrPptx: 5, ShowBorder: 5,
ShowBorder: 6, SpPr: 6
SpPr: 7 };
/** @enum */
var c_oSer_ChartTitlePptxType =
{
TxPptx: 0,
TxPrPptx: 1
}; };
/** @enum */ /** @enum */
var c_oSer_ChartLegendType = var c_oSer_ChartLegendType =
...@@ -810,7 +815,6 @@ var c_oSer_ChartCatAxType = ...@@ -810,7 +815,6 @@ var c_oSer_ChartCatAxType =
Delete: 2, Delete: 2,
AxPos: 3, AxPos: 3,
TitlePptx: 4, TitlePptx: 4,
TitleTxPrPptx: 5,
TxPrPptx: 6 TxPrPptx: 6
}; };
/** @enum */ /** @enum */
...@@ -1351,8 +1355,9 @@ function Binary_ChartReader(stream, chart, chartAsGroup) ...@@ -1351,8 +1355,9 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
} }
else if ( c_oSer_ChartType.Title === type ) else if ( c_oSer_ChartType.Title === type )
{ {
this.chart.header.title = this.stream.GetString2LE(length); //todo
if("" == this.chart.header.title) var sTitle = this.stream.GetString2LE(length);
if("" == sTitle)
this.chart.header.bDefaultTitle = true; this.chart.header.bDefaultTitle = true;
} }
else if ( c_oSer_ChartType.PlotArea === type ) else if ( c_oSer_ChartType.PlotArea === type )
...@@ -1426,17 +1431,15 @@ function Binary_ChartReader(stream, chart, chartAsGroup) ...@@ -1426,17 +1431,15 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
{ {
this.chart.styleId = this.stream.GetULongLE(); this.chart.styleId = this.stream.GetULongLE();
} }
else if ( c_oSer_ChartType.TitlePptx === type || c_oSer_ChartType.TitleTxPrPptx === type) else if ( c_oSer_ChartType.TitlePptx === type)
{ {
if(!isRealObject(this.chartAsGroup.chartTitle)) if(!isRealObject(this.chartAsGroup.chartTitle))
this.chartAsGroup.chartTitle = new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE); this.chartAsGroup.chartTitle = new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE);
this.chart.header.bDefaultTitle = true;
var oPresentationSimpleSerializer = new CPPTXContentLoader(); res = this.bcr.Read1(length, function(t,l){
var textBody = oPresentationSimpleSerializer.ReadTextBody(null, this.stream, this.chartAsGroup.chartTitle); return oThis.ReadChartTitle(t,l, oThis.chartAsGroup.chartTitle, oThis.chart.header);
if(c_oSer_ChartType.TitlePptx === type) });
this.chartAsGroup.chartTitle.txBody = textBody;
else
this.chartAsGroup.chartTitle.txPr = textBody;
} }
else if ( c_oSer_ChartType.SpPr === type ) else if ( c_oSer_ChartType.SpPr === type )
{ {
...@@ -1451,6 +1454,25 @@ function Binary_ChartReader(stream, chart, chartAsGroup) ...@@ -1451,6 +1454,25 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
}; };
this.ReadChartTitle = function(type, length, chartTitlePptx, chartTitleHeader)
{
var res = c_oSerConstants.ReadOk;
if ( c_oSer_ChartTitlePptxType.TxPptx === type || c_oSer_ChartTitlePptxType.TxPrPptx === type)
{
var oPresentationSimpleSerializer = new CPPTXContentLoader();
var textBody = oPresentationSimpleSerializer.ReadTextBody(null, this.stream, chartTitlePptx);
if(c_oSer_ChartTitlePptxType.TxPptx === type)
{
chartTitlePptx.txBody = textBody;
chartTitleHeader.bDefaultTitle = false;
}
else
chartTitlePptx.txPr = textBody;
}
else
res = c_oSerConstants.ReadUnknown;
return res;
}
this.ReadLegend = function(type, length, oLegendEntries) this.ReadLegend = function(type, length, oLegendEntries)
{ {
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
...@@ -1585,8 +1607,9 @@ function Binary_ChartReader(stream, chart, chartAsGroup) ...@@ -1585,8 +1607,9 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
var oThis = this; var oThis = this;
if ( c_oSer_ChartCatAxType.Title === type ) if ( c_oSer_ChartCatAxType.Title === type )
{ {
oAx.title = this.stream.GetString2LE(length); //todo
if("" == oAx.title) var sTitle = this.stream.GetString2LE(length);
if("" == sTitle)
oAx.bDefaultTitle = true; oAx.bDefaultTitle = true;
} }
else if ( c_oSer_ChartCatAxType.MajorGridlines === type ) else if ( c_oSer_ChartCatAxType.MajorGridlines === type )
...@@ -1595,23 +1618,15 @@ function Binary_ChartReader(stream, chart, chartAsGroup) ...@@ -1595,23 +1618,15 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
oAx.bShow = !this.stream.GetBool(); oAx.bShow = !this.stream.GetBool();
else if ( c_oSer_ChartCatAxType.AxPos === type ) else if ( c_oSer_ChartCatAxType.AxPos === type )
oAx.axPos = this.stream.GetUChar(); oAx.axPos = this.stream.GetUChar();
else if ( c_oSer_ChartCatAxType.TitlePptx === type || c_oSer_ChartCatAxType.TitleTxPrPptx === type) else if ( c_oSer_ChartCatAxType.TitlePptx === type )
{ {
if(!isRealObject(oAx.chartTitle)) if(!isRealObject(oAx.chartTitle))
oAx.chartTitle = new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE); oAx.chartTitle = new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE);
var oPresentationSimpleSerializer = new CPPTXContentLoader();
var textBody = oPresentationSimpleSerializer.ReadTextBody(null, this.stream, oAx.chartTitle);
if(c_oSer_ChartCatAxType.TitlePptx === type)
oAx.chartTitle.txBody = textBody;
else
oAx.chartTitle.txPr = textBody;
/*var params = this.ParsePptxParagraph(textBody);
if(c_oSer_ChartCatAxType.TitlePptx === type)
oAx.title = params.text;
else
oAx.bDefaultTitle = true; oAx.bDefaultTitle = true;
if(null != params.font)
oAx.titlefont = params.font; */ res = this.bcr.Read1(length, function(t,l){
return oThis.ReadChartTitle(t,l, oAx.chartTitle, oAx);
});
} }
else if ( c_oSer_ChartCatAxType.TxPrPptx === type ) else if ( c_oSer_ChartCatAxType.TxPrPptx === type )
{ {
......
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