Commit 0a8032e7 authored by Sergey Luzyanin's avatar Sergey Luzyanin

fix Bug 34159

parent 4f1eb1b5
......@@ -458,6 +458,14 @@ function asc_CChartBinary(chart) {
this["colorMapBinary"] = pptx_writer.pos + ";" + pptx_writer.GetBase64Memory();
}
this["urls"] = JSON.stringify(AscCommon.g_oDocumentUrls.getUrls());
if(chart.parent && chart.parent.docPr){
this["cTitle"] = chart.parent.docPr.title;
this["cDescription"] = chart.parent.docPr.descr;
}
else{
this["cTitle"] = chart.getTitle();
this["cDescription"] = chart.getDescription();
}
}
}
......@@ -507,7 +515,6 @@ asc_CChartBinary.prototype = {
{
var stream = AscFormat.CreateBinaryReader(binary, 0, binary.length);
var oBinaryReader = new AscCommon.BinaryPPTYLoader();
oBinaryReader.stream = new AscCommon.FileStream();
oBinaryReader.stream.obj = stream.obj;
oBinaryReader.stream.data = stream.data;
......@@ -2688,6 +2695,15 @@ function DrawingObjects() {
{
worksheet.model.workbook.theme = theme;
}
if(chart["cTitle"] || chart["cDescription"]){
if(!oNewChartSpace.nvGraphicFramePr){
var nv_sp_pr = new AscFormat.UniNvPr();
nv_sp_pr.cNvPr.setId(1024);
oNewChartSpace.setNvSpPr(nv_sp_pr);
}
oNewChartSpace.setTitle(chart["cTitle"]);
oNewChartSpace.setDescription(chart["cDescription"]);
}
var colorMapOverride = asc_chart_binary.getColorMap();
if(colorMapOverride)
{
......
......@@ -239,8 +239,7 @@ DrawingObjectsController.prototype.getColorMapOverride = function()
};
DrawingObjectsController.prototype.editChart = function(binary)
{
var bin_object = {"binary":binary};
var chart_space = this.getChartSpace2(bin_object, null);
var chart_space = this.getChartSpace2(binary, null);
chart_space.setParent(this.drawingObjects);
var by_types, i;
by_types = AscFormat.getObjectsByTypesFromArr(this.selectedObjects, true);
......@@ -286,6 +285,8 @@ DrawingObjectsController.prototype.editChart = function(binary)
chart_space.spPr.xfrm.setOffY(aSelectedCharts[0].y);
var pos = aSelectedCharts[0].deleteDrawingBase();
chart_space.addToDrawingObjects(pos);
chart_space.setTitle(binary["cTitle"]);
chart_space.setDescription(binary["cDescription"]);
this.resetSelection();
this.selectObject(chart_space, this.drawingObjects.num);
this.startRecalculate();
......
......@@ -5883,7 +5883,7 @@ background-repeat: no-repeat;\
// Находим выделенную диаграмму и накатываем бинарник
if (AscCommon.isRealObject(chartBinary))
{
this.WordControl.m_oLogicDocument.Edit_Chart(chartBinary["binary"]);
this.WordControl.m_oLogicDocument.Edit_Chart(chartBinary);
}
};
......
......@@ -906,8 +906,7 @@ CGraphicObjects.prototype =
editChart: function(chart)
{
var bin_object = {"binary":chart};
var chart_space = this.getChartSpace2(bin_object, null), select_start_page, parent_paragraph, nearest_pos;
var chart_space = this.getChartSpace2(chart, null), select_start_page, parent_paragraph, nearest_pos;
var by_types;
......@@ -958,6 +957,8 @@ CGraphicObjects.prototype =
select_start_page = aSelectedCharts[0].selectStartPage;
chart_space.setParent(aSelectedCharts[0].parent);
aSelectedCharts[0].parent.Set_GraphicObject(chart_space);
aSelectedCharts[0].parent.docPr.setTitle(chart["cTitle"]);
aSelectedCharts[0].parent.docPr.setDescr(chart["cDescription"]);
this.resetSelection();
this.selectObject(chart_space, select_start_page);
aSelectedCharts[0].parent.CheckWH();
......
......@@ -6645,11 +6645,10 @@ background-repeat: no-repeat;\
// Находим выделенную диаграмму и накатываем бинарник
if (AscFormat.isObject(chartBinary))
{
var binary = chartBinary["binary"];
if (false === this.WordControl.m_oLogicDocument.Document_Is_SelectionLocked(changestype_Paragraph_Content))
{
History.Create_NewPoint(AscDFH.historydescription_Document_EditChart);
this.WordControl.m_oLogicDocument.Edit_Chart(binary);
this.WordControl.m_oLogicDocument.Edit_Chart(chartBinary);
}
}
};
......
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