Commit 56d5bbc6 authored by Sergey Luzyanin's avatar Sergey Luzyanin

fix Bug 34250

parent 85c01f94
......@@ -990,6 +990,8 @@ CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGrou
{
var oUnifill = CreateUniFillFromExcelColor(oSparklineGroup.colorSeries);
var oSerie = chart_space.chart.plotArea.charts[0].series[0];
oSerie.setSpPr(new AscFormat.CSpPr());
if(nSparklineType === Asc.c_oAscSparklineType.Line)
{
var oLn = oSerie.spPr.ln;
......
......@@ -949,6 +949,8 @@ CCollaborativeEditingBase.prototype.private_RestoreDocumentState = function(DocS
var mapTables = {};
var mapGrObjects = {};
var mapSlides = {};
var mapLayouts = {};
var bChangedLayout = false;
for (var nIndex = 0, nCount = arrReverseChanges.length; nIndex < nCount; ++nIndex)
{
var oChange = arrReverseChanges[nIndex];
......@@ -971,8 +973,14 @@ CCollaborativeEditingBase.prototype.private_RestoreDocumentState = function(DocS
mapTables[oClass.Get_Id()] = oClass;
else if(oClass instanceof AscFormat.CShape || oClass instanceof AscFormat.CImageShape || oClass instanceof AscFormat.CChartSpace || oClass instanceof AscFormat.CGroupShape || oClass instanceof AscFormat.CGraphicFrame)
mapGrObjects[oClass.Get_Id()] = oClass;
else if(typeof AscCommonSlide !== "undefined" && AscCommonSlide.Slide && oClass instanceof AscCommonSlide.Slide){
mapSlides[oClass.Get_Id()] = oClass;
else if(typeof AscCommonSlide !== "undefined") {
if (AscCommonSlide.Slide && oClass instanceof AscCommonSlide.Slide) {
mapSlides[oClass.Get_Id()] = oClass;
}
else if(AscCommonSlide.SlideLayout && oClass instanceof AscCommonSlide.SlideLayout){
mapLayouts[oClass.Get_Id()] = oClass;
bChangedLayout = true;
}
}
}
......@@ -985,6 +993,18 @@ CCollaborativeEditingBase.prototype.private_RestoreDocumentState = function(DocS
mapSlides[sId].correctContent();
}
}
if(bChangedLayout){
for(var i = oLogicDocument.Slides.length - 1; i > -1 ; --i){
var Layout = oLogicDocument.Slides[i].Layout;
if(!Layout || mapLayouts[Layout.Get_Id()]){
if(!oLogicDocument.Slides[i].CheckLayout()){
oLogicDocument.removeSlide(i);
}
}
}
}
for(var sId in mapGrObjects){
var oShape = mapGrObjects[sId];
if(!oShape.checkCorrect()){
......
......@@ -943,6 +943,32 @@ CPresentation.prototype =
if(_RecalcData.Drawings.ThemeInfo)
{
this.clearThemeTimeouts();
if(_RecalcData.Drawings && _RecalcData.Drawings.Map)
{
for(key in _RecalcData.Drawings.Map)
{
if(_RecalcData.Drawings.Map.hasOwnProperty(key))
{
var oSlide = _RecalcData.Drawings.Map[key];
if(oSlide instanceof AscCommonSlide.Slide && AscFormat.isRealNumber(oSlide.num))
{
var ArrInd = _RecalcData.Drawings.ThemeInfo.ArrInd;
for(i = 0; i < ArrInd.length; ++i)
{
if(oSlide.num === ArrInd[i])
{
break;
}
}
if(i === ArrInd.length)
{
_RecalcData.Drawings.ThemeInfo.ArrInd.push(oSlide.num);
}
}
}
}
}
var startRecalcIndex = _RecalcData.Drawings.ThemeInfo.ArrInd.indexOf(this.CurPage);
if(startRecalcIndex === -1)
{
......
......@@ -195,6 +195,11 @@ function Slide(presentation, slideLayout, slideNum)
this.Id = AscCommon.g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id);
this.lastLayoutType = null;
this.lastLayoutMatchingName = null;
this.lastLayoutName = null;
if(presentation)
{
this.Width = presentation.Width;
......@@ -513,6 +518,11 @@ Slide.prototype =
case AscDFH.historyitem_SlideSetLayout:
{
this.checkSlideTheme();
if(this.Layout){
this.lastLayoutType = this.Layout.type;
this.lastLayoutMatchingName = this.Layout.matchingName;
this.lastLayoutName = this.Layout.cSld.name;
}
break;
}
}
......@@ -560,6 +570,11 @@ Slide.prototype =
{
History.Add(new AscDFH.CChangesDrawingsObject(this, AscDFH.historyitem_SlideSetLayout, this.Layout, layout));
this.Layout = layout;
if(layout){
this.lastLayoutType = layout.type;
this.lastLayoutMatchingName = layout.matchingName;
this.lastLayoutName = layout.cSld.name;
}
},
setSlideNum: function(num)
......@@ -662,6 +677,27 @@ Slide.prototype =
}
},
CheckLayout: function(){
var bRet = true;
if(!this.Layout || !this.Layout.CheckCorrect()){
var oMaster = this.presentation.slideMasters[0];
if(!oMaster){
bRet = false;
}
else{
var oLayout = oMaster.getMatchingLayout(this.lastLayoutType, this.lastLayoutMatchingName, this.lastLayoutName, undefined);
if(oLayout){
this.setLayout(oLayout);
}
else{
bRet = false;
}
}
}
return bRet;
},
correctContent: function(){
for(var i = this.cSld.spTree.length - 1; i > -1 ; --i){
if(this.cSld.spTree[i].bDeleted){
......@@ -677,7 +713,7 @@ Slide.prototype =
{
if(sp_tree[i].Get_Id() === id)
{
History.Add(new AscDFH.CChangesDrawingsContentPresentation(this, AscDFH.historyitem_SlideRemoveFromSpTree, i, [sp_tree[i]], false));
History.Add(new AscDFH.CChangesDrawingsContentPresentation(this, AscDFH.historyitem_SlideRemoveFromSpTree, i, [sp_tree[i]], false));
sp_tree.splice(i, 1);
return i;
}
......
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