Commit 2de7d7e3 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Bug 27996 - [AutoSave] "Красный крест" или потеря изображения при переоткрытии...

Bug 27996 - [AutoSave] "Красный крест" или потеря изображения при переоткрытии после копировании изображения из CDE в CPE

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@60254 954022d7-b5bf-4e40-9824-e11837661b57
parent c72808dd
...@@ -2398,6 +2398,14 @@ CBarChart.prototype = ...@@ -2398,6 +2398,14 @@ CBarChart.prototype =
}, },
checkSpPrRasterImages: function(images)
{
this.dLbls && this.dLbls.checkSpPrRasterImages(images);
for(var i = 0; i < this.series.length; ++i)
this.series[i].checkSpPrRasterImages(images);
},
getObjectType: function() getObjectType: function()
{ {
return historyitem_type_BarChart; return historyitem_type_BarChart;
...@@ -2890,6 +2898,7 @@ CAreaChart.prototype = ...@@ -2890,6 +2898,7 @@ CAreaChart.prototype =
}, },
getAllRasterImages: CBarChart.prototype.getAllRasterImages, getAllRasterImages: CBarChart.prototype.getAllRasterImages,
checkSpPrRasterImages: CBarChart.prototype.checkSpPrRasterImages,
removeDataLabels: CBarChart.prototype.removeDataLabels, removeDataLabels: CBarChart.prototype.removeDataLabels,
getAxisByTypes: CPlotArea.prototype.getAxisByTypes, getAxisByTypes: CPlotArea.prototype.getAxisByTypes,
...@@ -3344,6 +3353,17 @@ CAreaSeries.prototype = ...@@ -3344,6 +3353,17 @@ CAreaSeries.prototype =
} }
}, },
checkSpPrRasterImages: function(images)
{
checkSpPrRasterImages(this.spPr);
checkSpPrRasterImages(this.dLbls);
for(var i = 0; i < this.dPt.length; ++i)
{
checkSpPrRasterImages(this.dPt[i].spPr);
this.dPt[i].marker && checkSpPrRasterImages(this.dPt[i].marker.spPr);
}
},
setFromOtherSeries: function(o) setFromOtherSeries: function(o)
{ {
if(o.cat) if(o.cat)
...@@ -8928,6 +8948,7 @@ CBarSeries.prototype = ...@@ -8928,6 +8948,7 @@ CBarSeries.prototype =
}, },
getAllRasterImages: CAreaSeries.prototype.getAllRasterImages, getAllRasterImages: CAreaSeries.prototype.getAllRasterImages,
checkSpPrRasterImages: CAreaSeries.prototype.checkSpPrRasterImages,
setFromOtherSeries: function(o) setFromOtherSeries: function(o)
{ {
...@@ -9419,6 +9440,7 @@ CBubbleChart.prototype = ...@@ -9419,6 +9440,7 @@ CBubbleChart.prototype =
documentCreateFontMap: CBarChart.prototype.documentCreateFontMap, documentCreateFontMap: CBarChart.prototype.documentCreateFontMap,
getAllRasterImages: CBarChart.prototype.getAllRasterImages, getAllRasterImages: CBarChart.prototype.getAllRasterImages,
checkSpPrRasterImages: CBarChart.prototype.checkSpPrRasterImages,
getAxisByTypes: CPlotArea.prototype.getAxisByTypes, getAxisByTypes: CPlotArea.prototype.getAxisByTypes,
...@@ -9846,6 +9868,7 @@ CBubbleSeries.prototype = ...@@ -9846,6 +9868,7 @@ CBubbleSeries.prototype =
documentCreateFontMap: CAreaSeries.prototype.documentCreateFontMap, documentCreateFontMap: CAreaSeries.prototype.documentCreateFontMap,
getAllRasterImages: CAreaSeries.prototype.getAllRasterImages, getAllRasterImages: CAreaSeries.prototype.getAllRasterImages,
checkSpPrRasterImages: CAreaSeries.prototype.checkSpPrRasterImages,
getSeriesName: CAreaSeries.prototype.getSeriesName, getSeriesName: CAreaSeries.prototype.getSeriesName,
getCatName: CAreaSeries.prototype.getCatName, getCatName: CAreaSeries.prototype.getCatName,
...@@ -10825,6 +10848,15 @@ CDLbls.prototype = ...@@ -10825,6 +10848,15 @@ CDLbls.prototype =
} }
}, },
checkSpPrRasterImages: function()
{
checkSpPrRasterImages(this.spPr);
for(var i = 0; i < this.dLbl.length; ++i)
{
this.dLbl[i] && checkSpPrRasterImages(this.dLbl[i].spPr);
}
},
Write_ToBinary2: function(w) Write_ToBinary2: function(w)
{ {
w.WriteLong(this.getObjectType()); w.WriteLong(this.getObjectType());
...@@ -12258,6 +12290,7 @@ CDoughnutChart.prototype = ...@@ -12258,6 +12290,7 @@ CDoughnutChart.prototype =
documentCreateFontMap: CBarChart.prototype.documentCreateFontMap, documentCreateFontMap: CBarChart.prototype.documentCreateFontMap,
getAllRasterImages: CBarChart.prototype.getAllRasterImages, getAllRasterImages: CBarChart.prototype.getAllRasterImages,
checkSpPrRasterImages: CBarChart.prototype.checkSpPrRasterImages,
removeDataLabels: CBarChart.prototype.removeDataLabels, removeDataLabels: CBarChart.prototype.removeDataLabels,
...@@ -14178,6 +14211,16 @@ CLineChart.prototype = ...@@ -14178,6 +14211,16 @@ CLineChart.prototype =
} }
}, },
checkSpPrRasterImages: function(images)
{
CBarChart.prototype.checkSpPrRasterImages.call(this, images);
if(this.upDownBars)
{
checkSpPrRasterImages(this.upDownBars.upBars);
checkSpPrRasterImages(this.upDownBars.downBars);
}
},
removeDataLabels: CBarChart.prototype.removeDataLabels, removeDataLabels: CBarChart.prototype.removeDataLabels,
getAxisByTypes: CPlotArea.prototype.getAxisByTypes, getAxisByTypes: CPlotArea.prototype.getAxisByTypes,
...@@ -14749,6 +14792,7 @@ CLineSeries.prototype = ...@@ -14749,6 +14792,7 @@ CLineSeries.prototype =
documentCreateFontMap: CAreaSeries.prototype.documentCreateFontMap, documentCreateFontMap: CAreaSeries.prototype.documentCreateFontMap,
getAllRasterImages: CAreaSeries.prototype.getAllRasterImages, getAllRasterImages: CAreaSeries.prototype.getAllRasterImages,
checkSpPrRasterImages: CAreaSeries.prototype.checkSpPrRasterImages,
getSeriesName: CAreaSeries.prototype.getSeriesName, getSeriesName: CAreaSeries.prototype.getSeriesName,
getCatName: CAreaSeries.prototype.getCatName, getCatName: CAreaSeries.prototype.getCatName,
...@@ -16658,6 +16702,15 @@ COfPieChart.prototype = ...@@ -16658,6 +16702,15 @@ COfPieChart.prototype =
} }
}, },
checkSpPrRasterImages: function(images)
{
CBarChart.prototype.checkSpPrRasterImages.call(this, images);
if(this.serLines && this.serLines.spPr)
{
checkSpPrRasterImages(this.serLines.spPr);
}
},
removeDataLabels: CBarChart.prototype.removeDataLabels, removeDataLabels: CBarChart.prototype.removeDataLabels,
...@@ -17394,6 +17447,7 @@ CPieChart.prototype = ...@@ -17394,6 +17447,7 @@ CPieChart.prototype =
}, },
getAllRasterImages: CBarChart.prototype.getAllRasterImages, getAllRasterImages: CBarChart.prototype.getAllRasterImages,
checkSpPrRasterImages: CBarChart.prototype.checkSpPrRasterImages,
removeDataLabels: CBarChart.prototype.removeDataLabels, removeDataLabels: CBarChart.prototype.removeDataLabels,
...@@ -17771,6 +17825,7 @@ CPieSeries.prototype = ...@@ -17771,6 +17825,7 @@ CPieSeries.prototype =
documentCreateFontMap: CAreaSeries.prototype.documentCreateFontMap, documentCreateFontMap: CAreaSeries.prototype.documentCreateFontMap,
getAllRasterImages: CAreaSeries.prototype.getAllRasterImages, getAllRasterImages: CAreaSeries.prototype.getAllRasterImages,
checkSpPrRasterImages: CAreaSeries.prototype.checkSpPrRasterImages,
setFromOtherSeries: function(o) setFromOtherSeries: function(o)
{ {
...@@ -18417,6 +18472,7 @@ CRadarChart.prototype = ...@@ -18417,6 +18472,7 @@ CRadarChart.prototype =
removeDataLabels: CBarChart.prototype.removeDataLabels, removeDataLabels: CBarChart.prototype.removeDataLabels,
getAllRasterImages: CBarChart.prototype.getAllRasterImages, getAllRasterImages: CBarChart.prototype.getAllRasterImages,
checkSpPrRasterImages: CBarChart.prototype.checkSpPrRasterImages,
getAxisByTypes: CPlotArea.prototype.getAxisByTypes, getAxisByTypes: CPlotArea.prototype.getAxisByTypes,
...@@ -18817,6 +18873,7 @@ CRadarSeries.prototype = ...@@ -18817,6 +18873,7 @@ CRadarSeries.prototype =
getAllRasterImages: CAreaSeries.prototype.getAllRasterImages, getAllRasterImages: CAreaSeries.prototype.getAllRasterImages,
checkSpPrRasterImages: CAreaSeries.prototype.checkSpPrRasterImages,
Write_ToBinary2: function(w) Write_ToBinary2: function(w)
{ {
...@@ -19501,6 +19558,7 @@ CScatterChart.prototype = ...@@ -19501,6 +19558,7 @@ CScatterChart.prototype =
documentCreateFontMap: CBarChart.prototype.documentCreateFontMap, documentCreateFontMap: CBarChart.prototype.documentCreateFontMap,
getAllRasterImages: CBarChart.prototype.getAllRasterImages, getAllRasterImages: CBarChart.prototype.getAllRasterImages,
checkSpPrRasterImages: CBarChart.prototype.checkSpPrRasterImages,
removeDataLabels: CBarChart.prototype.removeDataLabels, removeDataLabels: CBarChart.prototype.removeDataLabels,
...@@ -19933,6 +19991,7 @@ CScatterSeries.prototype = ...@@ -19933,6 +19991,7 @@ CScatterSeries.prototype =
}, },
getAllRasterImages: CAreaSeries.prototype.getAllRasterImages, getAllRasterImages: CAreaSeries.prototype.getAllRasterImages,
checkSpPrRasterImages: CAreaSeries.prototype.checkSpPrRasterImages,
setFromOtherSeries: function(o) setFromOtherSeries: function(o)
{ {
...@@ -20667,6 +20726,7 @@ CStockChart.prototype = ...@@ -20667,6 +20726,7 @@ CStockChart.prototype =
documentCreateFontMap: CBarChart.prototype.documentCreateFontMap, documentCreateFontMap: CBarChart.prototype.documentCreateFontMap,
getAllRasterImages: CBarChart.prototype.getAllRasterImages, getAllRasterImages: CBarChart.prototype.getAllRasterImages,
checkSpPrRasterImages: CBarChart.prototype.checkSpPrRasterImages,
removeDataLabels: CBarChart.prototype.removeDataLabels, removeDataLabels: CBarChart.prototype.removeDataLabels,
...@@ -21584,6 +21644,15 @@ CSurfaceChart.prototype = ...@@ -21584,6 +21644,15 @@ CSurfaceChart.prototype =
} }
}, },
checkSpPrRasterImages: function(images)
{
CBarChart.prototype.checkSpPrRasterImages.call(this, images);
for(var i = 0; i < this.bandFmts.length; ++i)
{
this.bandFmts[i] && checkSpPrRasterImages(this.bandFmts[i].spPr);
}
},
Write_ToBinary2: function(w) Write_ToBinary2: function(w)
{ {
w.WriteLong(this.getObjectType()); w.WriteLong(this.getObjectType());
...@@ -21922,6 +21991,7 @@ CSurfaceSeries.prototype = ...@@ -21922,6 +21991,7 @@ CSurfaceSeries.prototype =
getAllRasterImages: CAreaSeries.prototype.getAllRasterImages, getAllRasterImages: CAreaSeries.prototype.getAllRasterImages,
checkSpPrRasterImages: CAreaSeries.prototype.checkSpPrRasterImages,
setFromOtherSeries: function(o) setFromOtherSeries: function(o)
......
...@@ -237,7 +237,7 @@ function checkFiniteNumber(num) ...@@ -237,7 +237,7 @@ function checkFiniteNumber(num)
var G_O_VISITED_HLINK_COLOR = CreateUniFillSolidFillWidthTintOrShade(CreateUnifillSolidFillSchemeColorByIndex(10), 0); var G_O_VISITED_HLINK_COLOR = CreateUniFillSolidFillWidthTintOrShade(CreateUnifillSolidFillSchemeColorByIndex(10), 0);
function addPointToMap(map, worksheet, row, col, pt) /*function addPointToMap(map, worksheet, row, col, pt)
{ {
if(!Array.isArray(map[worksheet.getId()+""])) if(!Array.isArray(map[worksheet.getId()+""]))
{ {
...@@ -271,7 +271,7 @@ function checkPointInMap(map, worksheet, row, col) ...@@ -271,7 +271,7 @@ function checkPointInMap(map, worksheet, row, col)
{ {
return false; return false;
} }
} }*/
function CChartSpace() function CChartSpace()
...@@ -317,7 +317,7 @@ function CChartSpace() ...@@ -317,7 +317,7 @@ function CChartSpace()
this.bounds = {l: 0, t: 0, r: 0, b:0, w: 0, h:0, x: 0, y: 0}; this.bounds = {l: 0, t: 0, r: 0, b:0, w: 0, h:0, x: 0, y: 0};
this.parsedFromulas = []; this.parsedFromulas = [];
this.pointsMap = {}; //this.pointsMap = {};
this.setRecalculateInfo(); this.setRecalculateInfo();
...@@ -2214,7 +2214,7 @@ CChartSpace.prototype = ...@@ -2214,7 +2214,7 @@ CChartSpace.prototype =
recalculateReferences: function() recalculateReferences: function()
{ {
var worksheet = this.worksheet; var worksheet = this.worksheet;
this.pointsMap = {}; //this.pointsMap = {};
if(!worksheet) if(!worksheet)
return; return;
...@@ -2283,7 +2283,7 @@ CChartSpace.prototype = ...@@ -2283,7 +2283,7 @@ CChartSpace.prototype =
pt.setFormatCode(cell.getNumFormatStr()) pt.setFormatCode(cell.getNumFormatStr())
} }
num_cache.addPt(pt); num_cache.addPt(pt);
addPointToMap(oThis.pointsMap, source_worksheet, range.r1, j, pt); //addPointToMap(oThis.pointsMap, source_worksheet, range.r1, j, pt);
} }
} }
pt_index++; pt_index++;
...@@ -2308,7 +2308,7 @@ CChartSpace.prototype = ...@@ -2308,7 +2308,7 @@ CChartSpace.prototype =
pt.setFormatCode(cell.getNumFormatStr()) pt.setFormatCode(cell.getNumFormatStr())
} }
num_cache.addPt(pt); num_cache.addPt(pt);
addPointToMap(oThis.pointsMap, source_worksheet, j, range.c1, pt); //addPointToMap(oThis.pointsMap, source_worksheet, j, range.c1, pt);
} }
} }
pt_index++; pt_index++;
...@@ -2378,7 +2378,7 @@ CChartSpace.prototype = ...@@ -2378,7 +2378,7 @@ CChartSpace.prototype =
pt.setVal(value_width_format); pt.setVal(value_width_format);
str_cache.addPt(pt); str_cache.addPt(pt);
addPointToMap(oThis.pointsMap, source_worksheet, range.r1, j, pt); //addPointToMap(oThis.pointsMap, source_worksheet, range.r1, j, pt);
} }
} }
pt_index++; pt_index++;
...@@ -2399,7 +2399,7 @@ CChartSpace.prototype = ...@@ -2399,7 +2399,7 @@ CChartSpace.prototype =
pt.setIdx(pt_index); pt.setIdx(pt_index);
pt.setVal(cell.getValueWithFormat()); pt.setVal(cell.getValueWithFormat());
str_cache.addPt(pt); str_cache.addPt(pt);
addPointToMap(oThis.pointsMap, source_worksheet, j, range.c1, pt); //addPointToMap(oThis.pointsMap, source_worksheet, j, range.c1, pt);
} }
} }
pt_index++; pt_index++;
...@@ -11357,3 +11357,75 @@ function getChartSeries (worksheet, options, catHeadersBBox, serHeadersBBox) { ...@@ -11357,3 +11357,75 @@ function getChartSeries (worksheet, options, catHeadersBBox, serHeadersBBox) {
return {series: series, parsedHeaders: parsedHeaders}; return {series: series, parsedHeaders: parsedHeaders};
} }
function checkSpPrRasterImages(spPr)
{
if(spPr && spPr.Fill && spPr.Fill && spPr.Fill.fill && spPr.Fill.fill.type === FILL_TYPE_BLIP)
{
var copyBlipFill = spPr.Fill.createDuplicate();
copyBlipFill.fill.setRasterImageId(spPr.Fill.fill.RasterImageId);
spPr.setFill(copyBlipFill);
}
}
function checkBlipFillRasterImages(sp)
{
switch (sp.getObjectType())
{
case historyitem_type_Shape:
{
checkSpPrRasterImages(sp.spPr);
break;
}
case historyitem_type_ImageShape:
{
if(sp.blipFill)
{
var newBlipFill = sp.blipFill.createDuplicate();
newBlipFill.setRasterImageId(sp.blipFill.RasterImageId);
sp.setBlipFill(newBlipFill);
}
break;
}
case historyitem_type_ChartSpace:
{
checkSpPrRasterImages(sp.spPr);
var chart = sp.chart;
if(chart)
{
chart.backWall && checkSpPrRasterImages(chart.backWall.spPr);
chart.floor && checkSpPrRasterImages(chart.floor.spPr);
chart.legend && checkSpPrRasterImages(chart.legend.spPr);
chart.sideWall && checkSpPrRasterImages(chart.sideWall.spPr);
chart.title && checkSpPrRasterImages(chart.title.spPr);
//plotArea
var plot_area = sp.chart.plotArea;
if(plot_area)
{
checkSpPrRasterImages(plot_area.spPr);
for(var j = 0; j < plot_area.axId.length; ++j)
{
var axis = plot_area.axId[j];
if(axis)
{
checkSpPrRasterImages(axis.spPr);
axis.title && axis.title && checkSpPrRasterImages(axis.title.spPr);
}
}
for(j = 0; j < plot_area.charts.length; ++j)
{
plot_area.charts[j].checkSpPrRasterImages();
}
}
}
break;
}
case historyitem_type_GroupShape:
{
checkBlipFillRasterImages(sp.spTree);
break;
}
case historyitem_type_GraphicFrame:
{
break;
}
}
}
\ No newline at end of file
...@@ -4052,7 +4052,10 @@ PasteProcessor.prototype = ...@@ -4052,7 +4052,10 @@ PasteProcessor.prototype =
for(var i = 0; i < presentationSelectedContent.Drawings.length; i++) for(var i = 0; i < presentationSelectedContent.Drawings.length; i++)
{ {
if(!(presentationSelectedContent.Drawings[i].Drawing instanceof CGraphicFrame)) if(!(presentationSelectedContent.Drawings[i].Drawing instanceof CGraphicFrame))
presentationSelectedContent.Drawings[i].Drawing = presentationSelectedContent.Drawings[i].Drawing.convertToPPTX(oThis.oDocument.DrawingDocument); {
presentationSelectedContent.Drawings[i].Drawing = presentationSelectedContent.Drawings[i].Drawing.convertToPPTX(oThis.oDocument.DrawingDocument);
checkBlipFillRasterImages(presentationSelectedContent.Drawings[i].Drawing);
}
} }
oThis.api.pre_Paste(fonts, image_map, paste_callback); oThis.api.pre_Paste(fonts, image_map, paste_callback);
...@@ -4064,7 +4067,10 @@ PasteProcessor.prototype = ...@@ -4064,7 +4067,10 @@ PasteProcessor.prototype =
for(var i = 0; i < presentationSelectedContent.Drawings.length; i++) for(var i = 0; i < presentationSelectedContent.Drawings.length; i++)
{ {
if(!(presentationSelectedContent.Drawings[i].Drawing instanceof CGraphicFrame)) if(!(presentationSelectedContent.Drawings[i].Drawing instanceof CGraphicFrame))
presentationSelectedContent.Drawings[i].Drawing = presentationSelectedContent.Drawings[i].Drawing.convertToPPTX(oThis.oDocument.DrawingDocument); {
presentationSelectedContent.Drawings[i].Drawing = presentationSelectedContent.Drawings[i].Drawing.convertToPPTX(oThis.oDocument.DrawingDocument);
checkBlipFillRasterImages(presentationSelectedContent.Drawings[i].Drawing);
}
} }
oThis.api.pre_Paste(aContent.fonts, aContent.images, paste_callback); oThis.api.pre_Paste(aContent.fonts, aContent.images, paste_callback);
......
...@@ -512,7 +512,6 @@ CTable.prototype.Selection_Draw_Page = function(Page_abs) ...@@ -512,7 +512,6 @@ CTable.prototype.Selection_Draw_Page = function(Page_abs)
} }
} }
}; };
CStyle.prototype.Create_NormalTable = function() CStyle.prototype.Create_NormalTable = function()
{ {
var TablePr = var TablePr =
......
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