Commit 073adb85 authored by Sergey Luzyanin's avatar Sergey Luzyanin

fix Bug 33924

parent 81a3ba9f
...@@ -550,6 +550,10 @@ ...@@ -550,6 +550,10 @@
CGraphicObjectBase.prototype.getAllRasterImages = function(mapUrl){ CGraphicObjectBase.prototype.getAllRasterImages = function(mapUrl){
}; };
CGraphicObjectBase.prototype.checkCorrect = function(){
return true;
};
CGraphicObjectBase.prototype.setDrawingBaseType = function(nType){ CGraphicObjectBase.prototype.setDrawingBaseType = function(nType){
if(this.drawingBase){ if(this.drawingBase){
History.Add(new AscDFH.CChangesDrawingsLong(this, AscDFH.historyitem_AutoShapes_SetDrawingBaseType, this.drawingBase.Type, nType)); History.Add(new AscDFH.CChangesDrawingsLong(this, AscDFH.historyitem_AutoShapes_SetDrawingBaseType, this.drawingBase.Type, nType));
......
...@@ -51,7 +51,7 @@ AscDFH.drawingsConstructorsMap[AscDFH.historyitem_Comment_Position] = AscFormat. ...@@ -51,7 +51,7 @@ AscDFH.drawingsConstructorsMap[AscDFH.historyitem_Comment_Position] = AscFormat.
AscDFH.drawingsConstructorsMap[AscDFH.historyitem_Comment_Change] = CCommentData; AscDFH.drawingsConstructorsMap[AscDFH.historyitem_Comment_Change] = CCommentData;
AscDFH.drawingsChangesMap[AscDFH.historyitem_Comment_Position] = function(oClass, value){oClass.x = value.a, oClass.y = value.b;}; AscDFH.drawingsChangesMap[AscDFH.historyitem_Comment_Position] = function(oClass, value){oClass.x = value.a; oClass.y = value.b;};
AscDFH.drawingsChangesMap[AscDFH.historyitem_Comment_Change] = function(oClass, value){oClass.Data = value;}; AscDFH.drawingsChangesMap[AscDFH.historyitem_Comment_Change] = function(oClass, value){oClass.Data = value;};
AscDFH.drawingsChangesMap[AscDFH.historyitem_Comment_TypeInfo] = function(oClass, value){oClass.m_oTypeInfo = value;}; AscDFH.drawingsChangesMap[AscDFH.historyitem_Comment_TypeInfo] = function(oClass, value){oClass.m_oTypeInfo = value;};
......
...@@ -393,6 +393,7 @@ AscDFH.drawingContentChanges[AscDFH.historyitem_Presentation_RemoveSlide] = func ...@@ -393,6 +393,7 @@ AscDFH.drawingContentChanges[AscDFH.historyitem_Presentation_RemoveSlide] = func
AscDFH.drawingContentChanges[AscDFH.historyitem_Presentation_AddSlideMaster] = function(oClass){return oClass.slideMasters;}; AscDFH.drawingContentChanges[AscDFH.historyitem_Presentation_AddSlideMaster] = function(oClass){return oClass.slideMasters;};
AscDFH.drawingsConstructorsMap[AscDFH.historyitem_Presentation_SetShowPr] = CShowPr; AscDFH.drawingsConstructorsMap[AscDFH.historyitem_Presentation_SetShowPr] = CShowPr;
AscDFH.drawingsConstructorsMap[AscDFH.historyitem_Presentation_SlideSize] = AscFormat.CDrawingBaseCoordsWritable
function CPresentation(DrawingDocument) function CPresentation(DrawingDocument)
{ {
......
...@@ -92,10 +92,6 @@ AscDFH.drawingContentChanges[AscDFH.historyitem_SlideRemoveFromSpTree ] = fu ...@@ -92,10 +92,6 @@ AscDFH.drawingContentChanges[AscDFH.historyitem_SlideRemoveFromSpTree ] = fu
AscDFH.drawingContentChanges[AscDFH.historyitem_SlideCommentsAddComment ] = AscDFH.drawingContentChanges[AscDFH.historyitem_SlideCommentsAddComment ] =
AscDFH.drawingContentChanges[AscDFH.historyitem_SlideCommentsRemoveComment] = function(oClass){return oClass.comments;}; AscDFH.drawingContentChanges[AscDFH.historyitem_SlideCommentsRemoveComment] = function(oClass){return oClass.comments;};
AscDFH.changesFactory[AscDFH.historyitem_SlideSetTiming ] = AscDFH.CChangesDrawingsObjectNoId;
AscDFH.changesFactory[AscDFH.historyitem_SlideSetSize ] = AscDFH.CChangesDrawingsObjectNoId;
AscDFH.changesFactory[AscDFH.historyitem_SlideSetBg ] = AscDFH.CChangesDrawingsObjectNoId;
AscDFH.drawingsConstructorsMap[AscDFH.historyitem_SlideSetSize ] = AscFormat.CDrawingBaseCoordsWritable; AscDFH.drawingsConstructorsMap[AscDFH.historyitem_SlideSetSize ] = AscFormat.CDrawingBaseCoordsWritable;
AscDFH.drawingsConstructorsMap[AscDFH.historyitem_SlideSetBg ] = AscFormat.CBg; AscDFH.drawingsConstructorsMap[AscDFH.historyitem_SlideSetBg ] = AscFormat.CBg;
......
...@@ -740,6 +740,7 @@ CWordCollaborativeEditing.prototype.Undo = function() ...@@ -740,6 +740,7 @@ CWordCollaborativeEditing.prototype.Undo = function()
var mapDocumentContents = {}; var mapDocumentContents = {};
var mapParagraphs = {}; var mapParagraphs = {};
var mapDrawings = {};
for (var nIndex = 0, nCount = arrReverseChanges.length; nIndex < nCount; ++nIndex) for (var nIndex = 0, nCount = arrReverseChanges.length; nIndex < nCount; ++nIndex)
{ {
var oChange = arrReverseChanges[nIndex]; var oChange = arrReverseChanges[nIndex];
...@@ -750,12 +751,29 @@ CWordCollaborativeEditing.prototype.Undo = function() ...@@ -750,12 +751,29 @@ CWordCollaborativeEditing.prototype.Undo = function()
mapParagraphs[oClass.Get_Id()] = oClass; mapParagraphs[oClass.Get_Id()] = oClass;
else if (oClass.IsParagraphContentElement && true === oClass.IsParagraphContentElement() && true === oChange.IsContentChange() && oClass.Get_Paragraph()) else if (oClass.IsParagraphContentElement && true === oClass.IsParagraphContentElement() && true === oChange.IsContentChange() && oClass.Get_Paragraph())
mapParagraphs[oClass.Get_Paragraph().Get_Id()] = oClass.Get_Paragraph(); mapParagraphs[oClass.Get_Paragraph().Get_Id()] = oClass.Get_Paragraph();
else if(oClass instanceof AscCommonWord.ParaDrawing){
mapDrawings[oClass.Get_Id()] = oClass;
}
} }
// Создаем точку в истории. Делаем действия через обычные функции (с отключенным пересчетом), которые пишут в // Создаем точку в истории. Делаем действия через обычные функции (с отключенным пересчетом), которые пишут в
// историю. Сохраняем список изменений в новой точке, удаляем данную точку. // историю. Сохраняем список изменений в новой точке, удаляем данную точку.
var oHistory = AscCommon.History; var oHistory = AscCommon.History;
oHistory.CreateNewPointForCollectChanges(); oHistory.CreateNewPointForCollectChanges();
var oDrawing;
for(var sId in mapDrawings){
if(mapDrawings.hasOwnProperty(sId)){
oDrawing = mapDrawings[sId];
if(!oDrawing.CheckCorrect()){
var oParentParagraph = oDrawing.Get_ParentParagraph();
oDrawing.Remove_FromDocument(false);
if(oParentParagraph){
mapParagraphs[oParentParagraph.Get_Id()] = oParentParagraph;
}
}
}
}
for (var sId in mapDocumentContents) for (var sId in mapDocumentContents)
{ {
var oDocumentContent = mapDocumentContents[sId]; var oDocumentContent = mapDocumentContents[sId];
...@@ -766,6 +784,7 @@ CWordCollaborativeEditing.prototype.Undo = function() ...@@ -766,6 +784,7 @@ CWordCollaborativeEditing.prototype.Undo = function()
oDocumentContent.Add_ToContent(nContentLen, oNewParagraph); oDocumentContent.Add_ToContent(nContentLen, oNewParagraph);
} }
} }
for (var sId in mapParagraphs) for (var sId in mapParagraphs)
{ {
var oParagraph = mapParagraphs[sId]; var oParagraph = mapParagraphs[sId];
......
...@@ -215,6 +215,17 @@ ParaDrawing.prototype.Search_GetId = function(bNext, bCurrent) ...@@ -215,6 +215,17 @@ ParaDrawing.prototype.Search_GetId = function(bNext, bCurrent)
return this.GraphicObj.Search_GetId(bNext, bCurrent); return this.GraphicObj.Search_GetId(bNext, bCurrent);
return null; return null;
}; };
ParaDrawing.prototype.CheckCorrect = function(){
if(!this.GraphicObj){
return false;
}
if(this.GraphicObj && this.GraphicObj.checkCorrect){
return this.GraphicObj.checkCorrect();
}
return true;
};
ParaDrawing.prototype.Get_AllDrawingObjects = function(DrawingObjects) ParaDrawing.prototype.Get_AllDrawingObjects = function(DrawingObjects)
{ {
if (null == DrawingObjects) if (null == DrawingObjects)
......
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