Commit 9f36eb70 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

правка бага с ошибками при передаче скопированной диаграммы в редакторе документов

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51333 954022d7-b5bf-4e40-9824-e11837661b57
parent 5fd3be9e
......@@ -1443,7 +1443,12 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
else
{
if(!isRealObject(this.chartAsGroup.chartTitle))
this.chartAsGroup.chartTitle = new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE);
{
if(this.chartAsGroup.addTitle)
this.chartAsGroup.addTitle(new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE));
else
this.chartAsGroup.chartTitle = new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE);
}
this.InitOldChartTitle(this.chartAsGroup.chartTitle, sTitle);
}
}
......@@ -1510,9 +1515,19 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
this.chart.yAxis = oTemp;
}
if ( xAxis )
this.chartAsGroup.hAxisTitle = xAxis.chartTitle;
{
if(this.chartAsGroup.addXAxis)
this.chartAsGroup.addXAxis(xAxis.chartTitle);
else
this.chartAsGroup.hAxisTitle = xAxis.chartTitle;
}
if ( yAxis )
this.chartAsGroup.vAxisTitle = yAxis.chartTitle;
{
if(this.chartAsGroup.addYAxis)
this.chartAsGroup.addYAxis(yAxis.chartTitle);
else
this.chartAsGroup.vAxisTitle = yAxis.chartTitle;
}
}
else if ( c_oSer_ChartType.Style === type )
{
......@@ -1521,7 +1536,12 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
else if ( c_oSer_ChartType.TitlePptx === type)
{
if(!isRealObject(this.chartAsGroup.chartTitle))
this.chartAsGroup.chartTitle = new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE);
{
if(this.chartAsGroup.addTitle)
this.chartAsGroup.addTitle(new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE));
else
this.chartAsGroup.chartTitle = new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE);
}
this.chart.header.bDefaultTitle = true;
res = this.bcr.Read1(length, function(t,l){
......@@ -1703,7 +1723,12 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
else
{
if(!isRealObject(oAx.chartTitle))
oAx.chartTitle = new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE);
{
if(oAx.addTitle)
oAx.addTitle(new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE));
else
oAx.chartTitle = new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE);
}
this.InitOldChartTitle(oAx.chartTitle, sTitle);
if(bValAx && null != oAx.chartTitle && null != oAx.chartTitle.txBody && null != oAx.chartTitle.txBody.bodyPr)
{
......@@ -1722,7 +1747,12 @@ function Binary_ChartReader(stream, chart, chartAsGroup)
else if ( c_oSer_ChartCatAxType.TitlePptx === type )
{
if(!isRealObject(oAx.chartTitle))
oAx.chartTitle = new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE);
{
if(oAx.addTitle)
oAx.addTitle(new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE));
else
oAx.chartTitle = new CChartTitle(this.chartAsGroup, CHART_TITLE_TYPE_TITLE);
}
oAx.bDefaultTitle = true;
res = this.bcr.Read1(length, function(t,l){
......
......@@ -83,10 +83,14 @@ CGraphicObjects.prototype =
}
if(bAddHistory)
{
if(obj instanceof WordShape || obj instanceof WordImage)
if(obj instanceof WordShape || obj instanceof WordImage )
{
History.Add(obj, {Type: historyitem_CalculateAfterCopyInGroup});
}
if(obj instanceof CChartAsGroup)
{
History.Add(obj, {Type: historyitem_AutoShapes_RecalculateAfterResize});
}
}
}
}
......@@ -365,7 +369,9 @@ CGraphicObjects.prototype =
if(!isRealObject(chart_props))
{
chart_props = {fromGroup: true};
g_oTableId.m_bTurnOff = true;
chart_props.ChartProperties = new asc_CChart(c_obj.chart);
g_oTableId.m_bTurnOff = false;
}
else
{
......@@ -473,7 +479,9 @@ CGraphicObjects.prototype =
{
chart_props = {};
chart_props = s_arr[i].Get_Props(null);
g_oTableId.m_bTurnOff = true;
chart_props.ChartProperties = new asc_CChart(c_obj.chart);
g_oTableId.m_bTurnOff = false;
}
else
{
......
......@@ -2280,6 +2280,10 @@ CChartAsGroup.prototype =
var type = reader.GetLong();
switch(type)
{
case historyitem_CalculateAfterCopyInGroup:
{
this.recalculate();
}
case historyitem_SetXfrmShape:
{
var xfrm = this.spPr.xfrm;
......@@ -2429,7 +2433,9 @@ CChartAsGroup.prototype =
{
if(r.GetBool())
{
g_oTableId.m_bTurnOff = true;
this.chart = new asc_CChart();
g_oTableId.m_bTurnOff = false;
//r.GetLong();
this.chart.Read_FromBinary2(r);
}
......
......@@ -39,6 +39,7 @@ function CChartTitle(chartGroup, type)
recalculateBrush: true,
recalculatePen: true
};
this.recalcInfo = {};
this.selected = false;
this.Id = g_oIdCounter.Get_NewId();
......
......@@ -7982,12 +7982,16 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, bAllow
else if( c_oSerImageType2.Chart === type )
{
var oNewGraphicObj = new CChartAsGroup();
if(g_oTableId)
g_oTableId.m_bTurnOff = true;
var chart = new asc_CChart();
if(g_oTableId)
g_oTableId.m_bTurnOff = false;
var oBinary_ChartReader = new Binary_ChartReader(this.stream, chart, oNewGraphicObj);
oBinary_ChartReader.ReadExternal(length);
if(null != chart.range.interval && chart.range.interval.length > 0)
{
oNewGraphicObj.chart = chart;
oNewGraphicObj.setAscChart(chart);
//oNewGraphicObj.setChart(chart, true);
oParaDrawing.Set_GraphicObject(oNewGraphicObj);
}
......
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