Commit a138244a authored by Sergey Luzyanin's avatar Sergey Luzyanin

fix Bug 34251

parent 44de7cd2
...@@ -6573,7 +6573,7 @@ DrawingObjectsController.prototype = ...@@ -6573,7 +6573,7 @@ DrawingObjectsController.prototype =
this.clearTrackObjects(); this.clearTrackObjects();
this.resetSelection(); this.resetSelection();
this.changeCurrentState(new AscFormat.NullState(this)); this.changeCurrentState(new AscFormat.NullState(this));
if(selection_state.textObject) if(selection_state.textObject && !selection_state.textObject.bDeleted)
{ {
this.selectObject(selection_state.textObject, selection_state.selectStartPage); this.selectObject(selection_state.textObject, selection_state.selectStartPage);
this.selection.textSelection = selection_state.textObject; this.selection.textSelection = selection_state.textObject;
...@@ -6586,19 +6586,19 @@ DrawingObjectsController.prototype = ...@@ -6586,19 +6586,19 @@ DrawingObjectsController.prototype =
selection_state.textObject.getDocContent().Set_SelectionState(selection_state.textSelection, selection_state.textSelection.length-1); selection_state.textObject.getDocContent().Set_SelectionState(selection_state.textSelection, selection_state.textSelection.length-1);
} }
} }
else if(selection_state.groupObject) else if(selection_state.groupObject && !selection_state.groupObject.bDeleted)
{ {
this.selectObject(selection_state.groupObject, selection_state.selectStartPage); this.selectObject(selection_state.groupObject, selection_state.selectStartPage);
this.selection.groupSelection = selection_state.groupObject; this.selection.groupSelection = selection_state.groupObject;
selection_state.groupObject.setSelectionState(selection_state.groupSelection); selection_state.groupObject.setSelectionState(selection_state.groupSelection);
} }
else if(selection_state.chartObject) else if(selection_state.chartObject && !selection_state.chartObject.bDeleted)
{ {
this.selectObject(selection_state.chartObject, selection_state.selectStartPage); this.selectObject(selection_state.chartObject, selection_state.selectStartPage);
this.selection.chartSelection = selection_state.chartObject; this.selection.chartSelection = selection_state.chartObject;
selection_state.chartObject.setSelectionState(selection_state.chartSelection); selection_state.chartObject.setSelectionState(selection_state.chartSelection);
} }
else if(selection_state.wrapObject) else if(selection_state.wrapObject && !selection_state.wrapObject.bDeleted)
{ {
this.selectObject(selection_state.wrapObject, selection_state.selectStartPage); this.selectObject(selection_state.wrapObject, selection_state.selectStartPage);
this.selection.wrapPolygonSelection = selection_state.wrapObject; this.selection.wrapPolygonSelection = selection_state.wrapObject;
...@@ -6607,7 +6607,10 @@ DrawingObjectsController.prototype = ...@@ -6607,7 +6607,10 @@ DrawingObjectsController.prototype =
{ {
for(var i = 0; i < selection_state.selection.length; ++i) for(var i = 0; i < selection_state.selection.length; ++i)
{ {
this.selectObject(selection_state.selection[i].object, selection_state.selection[i].pageIndex); if(!selection_state.selection[i].object.bDeleted)
{
this.selectObject(selection_state.selection[i].object, selection_state.selection[i].pageIndex);
}
} }
} }
}, },
......
...@@ -3926,7 +3926,7 @@ CPresentation.prototype = ...@@ -3926,7 +3926,7 @@ CPresentation.prototype =
oDocState.Pos = []; oDocState.Pos = [];
oDocState.StartPos = []; oDocState.StartPos = [];
oDocState.EndPos = []; oDocState.EndPos = [];
oDocState.CurPage = this.CurPage;
if(this.Slides[this.CurPage]){ if(this.Slides[this.CurPage]){
oDocState.Slide = this.Slides[this.CurPage]; oDocState.Slide = this.Slides[this.CurPage];
this.Slides[this.CurPage].graphicObjects.Save_DocumentStateBeforeLoadChanges(oDocState); this.Slides[this.CurPage].graphicObjects.Save_DocumentStateBeforeLoadChanges(oDocState);
...@@ -3946,11 +3946,25 @@ CPresentation.prototype = ...@@ -3946,11 +3946,25 @@ CPresentation.prototype =
this.CurPage = i; this.CurPage = i;
this.bGoToPage = true; this.bGoToPage = true;
bFind = true; bFind = true;
if(this.Slides[this.CurPage]){
var oDrawingObjects = this.Slides[this.CurPage].graphicObjects;
oDrawingObjects.clearPreTrackObjects();
oDrawingObjects.clearTrackObjects();
oDrawingObjects.resetSelection();
oDrawingObjects.changeCurrentState(new AscFormat.NullState(oDrawingObjects));
}
} }
} }
if(!bFind){ if(!bFind){
this.CurPage = this.Slides.length - 1; this.CurPage = this.Slides.length - 1;
this.bGoToPage = true; this.bGoToPage = true;
if(this.Slides[this.CurPage]){
var oDrawingObjects = this.Slides[this.CurPage].graphicObjects;
oDrawingObjects.clearPreTrackObjects();
oDrawingObjects.clearTrackObjects();
oDrawingObjects.resetSelection();
oDrawingObjects.changeCurrentState(new AscFormat.NullState(oDrawingObjects));
}
return; return;
} }
} }
...@@ -3961,6 +3975,21 @@ CPresentation.prototype = ...@@ -3961,6 +3975,21 @@ CPresentation.prototype =
oDrawingObjects.changeCurrentState(new AscFormat.NullState(oDrawingObjects)); oDrawingObjects.changeCurrentState(new AscFormat.NullState(oDrawingObjects));
oDrawingObjects.loadDocumentStateAfterLoadChanges(oState); oDrawingObjects.loadDocumentStateAfterLoadChanges(oState);
} }
else{
if(oState.CurPage === -1){
if(this.Slides.length > 0){
this.CurPage = 0;
this.bGoToPage = true;
}
}
if(this.Slides[this.CurPage]){
var oDrawingObjects = this.Slides[this.CurPage].graphicObjects;
oDrawingObjects.clearPreTrackObjects();
oDrawingObjects.clearTrackObjects();
oDrawingObjects.resetSelection();
oDrawingObjects.changeCurrentState(new AscFormat.NullState(oDrawingObjects));
}
}
}, },
Get_SelectedContent : function() Get_SelectedContent : function()
......
...@@ -662,6 +662,14 @@ Slide.prototype = ...@@ -662,6 +662,14 @@ Slide.prototype =
} }
}, },
correctContent: function(){
for(var i = this.cSld.spTree.length - 1; i > -1 ; --i){
if(this.cSld.spTree[i].bDeleted){
this.removeFromSpTreeById(this.cSld.spTree[i].Get_Id());
}
}
},
removeFromSpTreeById: function(id) removeFromSpTreeById: function(id)
{ {
var sp_tree = this.cSld.spTree; var sp_tree = this.cSld.spTree;
......
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