Commit a138244a authored by Sergey Luzyanin's avatar Sergey Luzyanin

fix Bug 34251

parent 44de7cd2
......@@ -6573,7 +6573,7 @@ DrawingObjectsController.prototype =
this.clearTrackObjects();
this.resetSelection();
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.selection.textSelection = selection_state.textObject;
......@@ -6586,19 +6586,19 @@ DrawingObjectsController.prototype =
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.selection.groupSelection = selection_state.groupObject;
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.selection.chartSelection = selection_state.chartObject;
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.selection.wrapPolygonSelection = selection_state.wrapObject;
......@@ -6606,10 +6606,13 @@ DrawingObjectsController.prototype =
else
{
for(var i = 0; i < selection_state.selection.length; ++i)
{
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 =
oDocState.Pos = [];
oDocState.StartPos = [];
oDocState.EndPos = [];
oDocState.CurPage = this.CurPage;
if(this.Slides[this.CurPage]){
oDocState.Slide = this.Slides[this.CurPage];
this.Slides[this.CurPage].graphicObjects.Save_DocumentStateBeforeLoadChanges(oDocState);
......@@ -3946,11 +3946,25 @@ CPresentation.prototype =
this.CurPage = i;
this.bGoToPage = 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){
this.CurPage = this.Slides.length - 1;
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;
}
}
......@@ -3961,6 +3975,21 @@ CPresentation.prototype =
oDrawingObjects.changeCurrentState(new AscFormat.NullState(oDrawingObjects));
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()
......
......@@ -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)
{
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