Commit 63b375b5 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

проверки на наличие graphicPage

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@63722 954022d7-b5bf-4e40-9824-e11837661b57
parent f829ab77
......@@ -278,39 +278,9 @@ NullState.prototype =
{
drawing_page = this.drawingObjects.getHdrFtrObjectsByPageIndex(pageIndex);
}
ret = handleFloatObjects(this.drawingObjects, drawing_page.beforeTextObjects, e, x, y, null, pageIndex, true);
if(ret)
if(drawing_page)
{
end_target_doc_content = checkEmptyPlaceholderContent(this.drawingObjects.getTargetDocContent());
if ((start_target_doc_content || end_target_doc_content) && (start_target_doc_content !== end_target_doc_content))
{
this.drawingObjects.drawingDocument.OnRecalculatePage(pageIndex, this.drawingObjects.document.Pages[pageIndex]);
this.drawingObjects.drawingDocument.OnEndRecalculate(false, true);
}
return ret;
}
var no_shape_child_array = [];
for(var i = 0; i < drawing_page.inlineObjects.length; ++i)
{
if(!drawing_page.inlineObjects[i].parent.isShapeChild())
no_shape_child_array.push(drawing_page.inlineObjects[i]);
}
ret = handleInlineObjects(this.drawingObjects, no_shape_child_array, e, x, y, pageIndex, true);
if(ret)
{
end_target_doc_content = checkEmptyPlaceholderContent(this.drawingObjects.getTargetDocContent());
if ((start_target_doc_content || end_target_doc_content) && (start_target_doc_content !== end_target_doc_content))
{
this.drawingObjects.drawingDocument.OnRecalculatePage(pageIndex, this.drawingObjects.document.Pages[pageIndex]);
this.drawingObjects.drawingDocument.OnEndRecalculate(false, true);
}
return ret;
}
if(!bTextFlag)
{
ret = handleFloatObjects(this.drawingObjects, drawing_page.wrappingObjects, e, x, y, null, pageIndex, true);
ret = handleFloatObjects(this.drawingObjects, drawing_page.beforeTextObjects, e, x, y, null, pageIndex, true);
if(ret)
{
end_target_doc_content = checkEmptyPlaceholderContent(this.drawingObjects.getTargetDocContent());
......@@ -322,7 +292,13 @@ NullState.prototype =
return ret;
}
ret = handleFloatObjects(this.drawingObjects, drawing_page.behindDocObjects, e, x, y, null, pageIndex, true);
var no_shape_child_array = [];
for(var i = 0; i < drawing_page.inlineObjects.length; ++i)
{
if(!drawing_page.inlineObjects[i].parent.isShapeChild())
no_shape_child_array.push(drawing_page.inlineObjects[i]);
}
ret = handleInlineObjects(this.drawingObjects, no_shape_child_array, e, x, y, pageIndex, true);
if(ret)
{
end_target_doc_content = checkEmptyPlaceholderContent(this.drawingObjects.getTargetDocContent());
......@@ -333,8 +309,34 @@ NullState.prototype =
}
return ret;
}
}
if(!bTextFlag)
{
ret = handleFloatObjects(this.drawingObjects, drawing_page.wrappingObjects, e, x, y, null, pageIndex, true);
if(ret)
{
end_target_doc_content = checkEmptyPlaceholderContent(this.drawingObjects.getTargetDocContent());
if ((start_target_doc_content || end_target_doc_content) && (start_target_doc_content !== end_target_doc_content))
{
this.drawingObjects.drawingDocument.OnRecalculatePage(pageIndex, this.drawingObjects.document.Pages[pageIndex]);
this.drawingObjects.drawingDocument.OnEndRecalculate(false, true);
}
return ret;
}
ret = handleFloatObjects(this.drawingObjects, drawing_page.behindDocObjects, e, x, y, null, pageIndex, true);
if(ret)
{
end_target_doc_content = checkEmptyPlaceholderContent(this.drawingObjects.getTargetDocContent());
if ((start_target_doc_content || end_target_doc_content) && (start_target_doc_content !== end_target_doc_content))
{
this.drawingObjects.drawingDocument.OnRecalculatePage(pageIndex, this.drawingObjects.document.Pages[pageIndex]);
this.drawingObjects.drawingDocument.OnEndRecalculate(false, true);
}
return ret;
}
}
}
if(start_target_doc_content)
{
this.drawingObjects.drawingDocument.OnRecalculatePage(pageIndex, this.drawingObjects.document.Pages[pageIndex]);
......
......@@ -899,7 +899,7 @@ CGraphicObjects.prototype =
draw: function(pageIndex, graphics)
{
this.graphicPages[pageIndex].draw(graphics);
this.graphicPages[pageIndex] && this.graphicPages[pageIndex].draw(graphics);
},
selectionDraw: function()
......@@ -1260,7 +1260,10 @@ CGraphicObjects.prototype =
documentStatistics: function( CurPage, Statistics )
{
this.graphicPages[CurPage].documentStatistics(Statistics);
if(this.graphicPages[CurPage])
{
this.graphicPages[CurPage].documentStatistics(Statistics);
}
},
setSelectionState: DrawingObjectsController.prototype.setSelectionState,
......@@ -1481,8 +1484,11 @@ CGraphicObjects.prototype =
documentSearch: function( CurPage, String, search_Common )
{
this.graphicPages[CurPage].documentSearch(String, search_Common);
CGraphicPage.prototype.documentSearch.call(this.getHdrFtrObjectsByPageIndex(CurPage), String, search_Common);
if(this.graphicPages[CurPage])
{
this.graphicPages[CurPage].documentSearch(String, search_Common);
CGraphicPage.prototype.documentSearch.call(this.getHdrFtrObjectsByPageIndex(CurPage), String, search_Common);
}
},
getSelectedElementsInfo: function( Info )
......@@ -1515,7 +1521,7 @@ CGraphicObjects.prototype =
{
graphic_page = this.graphicPages[pageIndex];
}
return graphic_page.behindDocObjects.concat(graphic_page.wrappingObjects.concat(graphic_page.inlineObjects.concat(graphic_page.beforeTextObjects)));
return graphic_page? graphic_page.behindDocObjects.concat(graphic_page.wrappingObjects.concat(graphic_page.inlineObjects.concat(graphic_page.beforeTextObjects))) : [];
},
selectNextObject: DrawingObjectsController.prototype.selectNextObject,
......@@ -1758,16 +1764,22 @@ CGraphicObjects.prototype =
drawBehindDoc: function(pageIndex, graphics)
{
graphics.shapePageIndex = pageIndex;
this.graphicPages[pageIndex].drawBehindDoc(graphics);
graphics.shapePageIndex = null;
if(this.graphicPages[pageIndex])
{
graphics.shapePageIndex = pageIndex;
this.graphicPages[pageIndex].drawBehindDoc(graphics);
graphics.shapePageIndex = null;
}
},
drawWrappingObjects: function(pageIndex, graphics)
{
graphics.shapePageIndex = pageIndex;
this.graphicPages[pageIndex].drawWrappingObjects(graphics);
graphics.shapePageIndex = null;
if(this.graphicPages[pageIndex])
{
graphics.shapePageIndex = pageIndex;
this.graphicPages[pageIndex].drawWrappingObjects(graphics);
graphics.shapePageIndex = null;
}
},
drawWrappingObjectsInContent: function(pageIndex, graphics, content)
......@@ -1792,9 +1804,12 @@ CGraphicObjects.prototype =
drawBeforeObjects: function(pageIndex, graphics)
{
graphics.shapePageIndex = pageIndex;
this.graphicPages[pageIndex].drawBeforeObjects(graphics);
graphics.shapePageIndex = null;
if(this.graphicPages[pageIndex])
{
graphics.shapePageIndex = pageIndex;
this.graphicPages[pageIndex].drawBeforeObjects(graphics);
graphics.shapePageIndex = null;
}
},
drawBehindDocHdrFtr: function(pageIndex, graphics)
......@@ -2591,15 +2606,18 @@ CGraphicObjects.prototype =
getAllRasterImagesOnPage: function(pageIndex)
{
var ret = [];
var graphic_page = this.graphicPages[pageIndex];
var hdr_ftr_page = this.getHdrFtrObjectsByPageIndex(pageIndex);
var graphic_array = graphic_page.beforeTextObjects.concat(graphic_page.wrappingObjects).concat(graphic_page.inlineObjects).concat(graphic_page.behindDocObjects);
graphic_array = graphic_array.concat(hdr_ftr_page.beforeTextObjects).concat(hdr_ftr_page.wrappingObjects).concat(hdr_ftr_page.inlineObjects).concat(hdr_ftr_page.behindDocObjects);
for(var i = 0; i < graphic_array.length; ++i)
if(this.graphicPages[pageIndex])
{
if(graphic_array[i].getAllRasterImages)
graphic_array[i].getAllRasterImages(ret);
var graphic_page = this.graphicPages[pageIndex];
var hdr_ftr_page = this.getHdrFtrObjectsByPageIndex(pageIndex);
var graphic_array = graphic_page.beforeTextObjects.concat(graphic_page.wrappingObjects).concat(graphic_page.inlineObjects).concat(graphic_page.behindDocObjects);
graphic_array = graphic_array.concat(hdr_ftr_page.beforeTextObjects).concat(hdr_ftr_page.wrappingObjects).concat(hdr_ftr_page.inlineObjects).concat(hdr_ftr_page.behindDocObjects);
for(var i = 0; i < graphic_array.length; ++i)
{
if(graphic_array[i].getAllRasterImages)
graphic_array[i].getAllRasterImages(ret);
}
}
return ret;
},
......
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