Commit 3f9f4dc2 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin

Падения при вставке в презентациях.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@59763 954022d7-b5bf-4e40-9824-e11837661b57
parent 1b3f3bbc
...@@ -223,7 +223,7 @@ CChartSpace.prototype.recalculateBounds = function() ...@@ -223,7 +223,7 @@ CChartSpace.prototype.recalculateBounds = function()
CChartSpace.prototype.recalculate = function() CChartSpace.prototype.recalculate = function()
{ {
if(this.bDeleted) if(this.bDeleted || !this.parent)
return; return;
ExecuteNoHistory(function() ExecuteNoHistory(function()
{ {
......
...@@ -313,7 +313,7 @@ CGraphicFrame.prototype = ...@@ -313,7 +313,7 @@ CGraphicFrame.prototype =
getHierarchy: CShape.prototype.getHierarchy, getHierarchy: CShape.prototype.getHierarchy,
recalculate: function() recalculate: function()
{ {
if(this.bDeleted) if(this.bDeleted || !this.parent)
return; return;
ExecuteNoHistory(function(){ ExecuteNoHistory(function(){
if(this.recalcInfo.recalculateTable) if(this.recalcInfo.recalculateTable)
......
...@@ -180,7 +180,7 @@ CGroupShape.prototype.updatePosition = CShape.prototype.updatePosition; ...@@ -180,7 +180,7 @@ CGroupShape.prototype.updatePosition = CShape.prototype.updatePosition;
CGroupShape.prototype.setParent2 = CShape.prototype.setParent2; CGroupShape.prototype.setParent2 = CShape.prototype.setParent2;
CGroupShape.prototype.recalculate = function() CGroupShape.prototype.recalculate = function()
{ {
if(this.bDeleted) if(this.bDeleted || !this.parent)
return; return;
ExecuteNoHistory(function() ExecuteNoHistory(function()
{ {
......
...@@ -126,6 +126,8 @@ CImageShape.prototype.getHierarchy = CShape.prototype.getHierarchy; ...@@ -126,6 +126,8 @@ CImageShape.prototype.getHierarchy = CShape.prototype.getHierarchy;
CImageShape.prototype.getParentObjects = CShape.prototype.getParentObjects; CImageShape.prototype.getParentObjects = CShape.prototype.getParentObjects;
CImageShape.prototype.recalculate = function () CImageShape.prototype.recalculate = function ()
{ {
if(this.bDeleted || !this.parent)
return;
ExecuteNoHistory(function(){ ExecuteNoHistory(function(){
if (this.recalcInfo.recalculateBrush) { if (this.recalcInfo.recalculateBrush) {
this.recalculateBrush(); this.recalculateBrush();
......
...@@ -2842,78 +2842,81 @@ CPresentation.prototype = ...@@ -2842,78 +2842,81 @@ CPresentation.prototype =
Get_SelectedContent : function() Get_SelectedContent : function()
{ {
var ret = new PresentationSelectedContent(), i; return ExecuteNoHistory(function()
if(this.Slides.length > 0)
{ {
switch(editor.WordControl.Thumbnails.FocusObjType) var ret = new PresentationSelectedContent(), i;
if(this.Slides.length > 0)
{ {
case FOCUS_OBJECT_MAIN: switch(editor.WordControl.Thumbnails.FocusObjType)
{ {
var target_text_object = getTargetTextObject(this.Slides[this.CurPage].graphicObjects); case FOCUS_OBJECT_MAIN:
if(target_text_object)
{ {
var doc_content = this.Slides[this.CurPage].graphicObjects.getTargetDocContent(); var target_text_object = getTargetTextObject(this.Slides[this.CurPage].graphicObjects);
if(target_text_object.getObjectType() === historyitem_type_GraphicFrame && !doc_content) if(target_text_object)
{ {
if(target_text_object.graphicObject) var doc_content = this.Slides[this.CurPage].graphicObjects.getTargetDocContent();
if(target_text_object.getObjectType() === historyitem_type_GraphicFrame && !doc_content)
{ {
var GraphicFrame = target_text_object.copy(); if(target_text_object.graphicObject)
var SelectedContent = new CSelectedContent(); {
target_text_object.graphicObject.Get_SelectedContent(SelectedContent); var GraphicFrame = target_text_object.copy();
var Table = SelectedContent.Elements[0].Element; var SelectedContent = new CSelectedContent();
GraphicFrame.setGraphicObject(Table); target_text_object.graphicObject.Get_SelectedContent(SelectedContent);
Table.Set_Parent(GraphicFrame); var Table = SelectedContent.Elements[0].Element;
ret.Drawings.push(new DrawingCopyObject(GraphicFrame, target_text_object.x, target_text_object.y, target_text_object.extX, target_text_object.extY, target_text_object.getBase64Img()) ); GraphicFrame.setGraphicObject(Table);
Table.Set_Parent(GraphicFrame);
ret.Drawings.push(new DrawingCopyObject(GraphicFrame, target_text_object.x, target_text_object.y, target_text_object.extX, target_text_object.extY, target_text_object.getBase64Img()) );
}
} }
} else
else
{
if(doc_content)
{ {
var SelectedContent = new CSelectedContent(); if(doc_content)
doc_content.Get_SelectedContent(SelectedContent); {
ret.DocContent = SelectedContent; var SelectedContent = new CSelectedContent();
doc_content.Get_SelectedContent(SelectedContent);
ret.DocContent = SelectedContent;
}
} }
} }
} else
else
{
var selector = this.Slides[this.CurPage].graphicObjects.groupSelection ? this.Slides[this.CurPage].graphicObjects.groupSelection : this.Slides[this.CurPage].graphicObjects;
if(selector.selection.chartSelection && selector.selection.chartSelection.selection.title)
{ {
var doc_content = selector.selection.chartSelection.selection.title.getDocContent(); var selector = this.Slides[this.CurPage].graphicObjects.groupSelection ? this.Slides[this.CurPage].graphicObjects.groupSelection : this.Slides[this.CurPage].graphicObjects;
if(doc_content) if(selector.selection.chartSelection && selector.selection.chartSelection.selection.title)
{ {
var doc_content = selector.selection.chartSelection.selection.title.getDocContent();
if(doc_content)
{
var SelectedContent = new CSelectedContent(); var SelectedContent = new CSelectedContent();
doc_content.Set_ApplyToAll(true); doc_content.Set_ApplyToAll(true);
doc_content.Get_SelectedContent(SelectedContent); doc_content.Get_SelectedContent(SelectedContent);
doc_content.Set_ApplyToAll(false); doc_content.Set_ApplyToAll(false);
ret.DocContent = SelectedContent; ret.DocContent = SelectedContent;
}
} }
} else
else
{
for(i = 0; i < selector.selectedObjects.length; ++i)
{ {
var Drawing = selector.selectedObjects[i]; for(i = 0; i < selector.selectedObjects.length; ++i)
ret.Drawings.push(new DrawingCopyObject(Drawing.copy(), Drawing.x, Drawing.y, Drawing.extX, Drawing.extY, Drawing.getBase64Img())); {
var Drawing = selector.selectedObjects[i];
ret.Drawings.push(new DrawingCopyObject(Drawing.copy(), Drawing.x, Drawing.y, Drawing.extX, Drawing.extY, Drawing.getBase64Img()));
}
} }
} }
break;
} }
break; case FOCUS_OBJECT_THUMBNAILS :
}
case FOCUS_OBJECT_THUMBNAILS :
{
var selected_slides = editor.WordControl.Thumbnails.GetSelectedArray();
for(i = 0; i < selected_slides.length; ++i)
{ {
ret.SlideObjects.push(new SlideCopyObject(this.Slides[selected_slides[i]].createDuplicate(), this.Slides[selected_slides[i]].getBase64Img())); var selected_slides = editor.WordControl.Thumbnails.GetSelectedArray();
for(i = 0; i < selected_slides.length; ++i)
{
ret.SlideObjects.push(new SlideCopyObject(this.Slides[selected_slides[i]].createDuplicate(), this.Slides[selected_slides[i]].getBase64Img()));
}
} }
} }
} }
} return ret;
return ret; }, this, []);
}, },
Insert_Content : function(Content) Insert_Content : function(Content)
......
...@@ -406,7 +406,7 @@ CShape.prototype.recalcText = function() ...@@ -406,7 +406,7 @@ CShape.prototype.recalcText = function()
CShape.prototype.recalculate = function () CShape.prototype.recalculate = function ()
{ {
if(this.bDeleted) if(this.bDeleted || !this.parent)
return; return;
var check_slide_placeholder = !this.isPlaceholder() || (this.parent && this.parent.getObjectType() === historyitem_type_Slide); var check_slide_placeholder = !this.isPlaceholder() || (this.parent && this.parent.getObjectType() === historyitem_type_Slide);
ExecuteNoHistory(function(){ ExecuteNoHistory(function(){
......
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