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 = ...@@ -278,39 +278,9 @@ NullState.prototype =
{ {
drawing_page = this.drawingObjects.getHdrFtrObjectsByPageIndex(pageIndex); drawing_page = this.drawingObjects.getHdrFtrObjectsByPageIndex(pageIndex);
} }
ret = handleFloatObjects(this.drawingObjects, drawing_page.beforeTextObjects, e, x, y, null, pageIndex, true); if(drawing_page)
if(ret)
{ {
end_target_doc_content = checkEmptyPlaceholderContent(this.drawingObjects.getTargetDocContent()); ret = handleFloatObjects(this.drawingObjects, drawing_page.beforeTextObjects, e, x, y, null, pageIndex, true);
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);
if(ret) if(ret)
{ {
end_target_doc_content = checkEmptyPlaceholderContent(this.drawingObjects.getTargetDocContent()); end_target_doc_content = checkEmptyPlaceholderContent(this.drawingObjects.getTargetDocContent());
...@@ -322,7 +292,13 @@ NullState.prototype = ...@@ -322,7 +292,13 @@ NullState.prototype =
return ret; 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) if(ret)
{ {
end_target_doc_content = checkEmptyPlaceholderContent(this.drawingObjects.getTargetDocContent()); end_target_doc_content = checkEmptyPlaceholderContent(this.drawingObjects.getTargetDocContent());
...@@ -333,8 +309,34 @@ NullState.prototype = ...@@ -333,8 +309,34 @@ NullState.prototype =
} }
return ret; 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) if(start_target_doc_content)
{ {
this.drawingObjects.drawingDocument.OnRecalculatePage(pageIndex, this.drawingObjects.document.Pages[pageIndex]); this.drawingObjects.drawingDocument.OnRecalculatePage(pageIndex, this.drawingObjects.document.Pages[pageIndex]);
......
...@@ -899,7 +899,7 @@ CGraphicObjects.prototype = ...@@ -899,7 +899,7 @@ CGraphicObjects.prototype =
draw: function(pageIndex, graphics) draw: function(pageIndex, graphics)
{ {
this.graphicPages[pageIndex].draw(graphics); this.graphicPages[pageIndex] && this.graphicPages[pageIndex].draw(graphics);
}, },
selectionDraw: function() selectionDraw: function()
...@@ -1260,7 +1260,10 @@ CGraphicObjects.prototype = ...@@ -1260,7 +1260,10 @@ CGraphicObjects.prototype =
documentStatistics: function( CurPage, Statistics ) documentStatistics: function( CurPage, Statistics )
{ {
this.graphicPages[CurPage].documentStatistics(Statistics); if(this.graphicPages[CurPage])
{
this.graphicPages[CurPage].documentStatistics(Statistics);
}
}, },
setSelectionState: DrawingObjectsController.prototype.setSelectionState, setSelectionState: DrawingObjectsController.prototype.setSelectionState,
...@@ -1481,8 +1484,11 @@ CGraphicObjects.prototype = ...@@ -1481,8 +1484,11 @@ CGraphicObjects.prototype =
documentSearch: function( CurPage, String, search_Common ) documentSearch: function( CurPage, String, search_Common )
{ {
this.graphicPages[CurPage].documentSearch(String, search_Common); if(this.graphicPages[CurPage])
CGraphicPage.prototype.documentSearch.call(this.getHdrFtrObjectsByPageIndex(CurPage), String, search_Common); {
this.graphicPages[CurPage].documentSearch(String, search_Common);
CGraphicPage.prototype.documentSearch.call(this.getHdrFtrObjectsByPageIndex(CurPage), String, search_Common);
}
}, },
getSelectedElementsInfo: function( Info ) getSelectedElementsInfo: function( Info )
...@@ -1515,7 +1521,7 @@ CGraphicObjects.prototype = ...@@ -1515,7 +1521,7 @@ CGraphicObjects.prototype =
{ {
graphic_page = this.graphicPages[pageIndex]; 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, selectNextObject: DrawingObjectsController.prototype.selectNextObject,
...@@ -1758,16 +1764,22 @@ CGraphicObjects.prototype = ...@@ -1758,16 +1764,22 @@ CGraphicObjects.prototype =
drawBehindDoc: function(pageIndex, graphics) drawBehindDoc: function(pageIndex, graphics)
{ {
graphics.shapePageIndex = pageIndex; if(this.graphicPages[pageIndex])
this.graphicPages[pageIndex].drawBehindDoc(graphics); {
graphics.shapePageIndex = null; graphics.shapePageIndex = pageIndex;
this.graphicPages[pageIndex].drawBehindDoc(graphics);
graphics.shapePageIndex = null;
}
}, },
drawWrappingObjects: function(pageIndex, graphics) drawWrappingObjects: function(pageIndex, graphics)
{ {
graphics.shapePageIndex = pageIndex; if(this.graphicPages[pageIndex])
this.graphicPages[pageIndex].drawWrappingObjects(graphics); {
graphics.shapePageIndex = null; graphics.shapePageIndex = pageIndex;
this.graphicPages[pageIndex].drawWrappingObjects(graphics);
graphics.shapePageIndex = null;
}
}, },
drawWrappingObjectsInContent: function(pageIndex, graphics, content) drawWrappingObjectsInContent: function(pageIndex, graphics, content)
...@@ -1792,9 +1804,12 @@ CGraphicObjects.prototype = ...@@ -1792,9 +1804,12 @@ CGraphicObjects.prototype =
drawBeforeObjects: function(pageIndex, graphics) drawBeforeObjects: function(pageIndex, graphics)
{ {
graphics.shapePageIndex = pageIndex; if(this.graphicPages[pageIndex])
this.graphicPages[pageIndex].drawBeforeObjects(graphics); {
graphics.shapePageIndex = null; graphics.shapePageIndex = pageIndex;
this.graphicPages[pageIndex].drawBeforeObjects(graphics);
graphics.shapePageIndex = null;
}
}, },
drawBehindDocHdrFtr: function(pageIndex, graphics) drawBehindDocHdrFtr: function(pageIndex, graphics)
...@@ -2591,15 +2606,18 @@ CGraphicObjects.prototype = ...@@ -2591,15 +2606,18 @@ CGraphicObjects.prototype =
getAllRasterImagesOnPage: function(pageIndex) getAllRasterImagesOnPage: function(pageIndex)
{ {
var ret = []; var ret = [];
var graphic_page = this.graphicPages[pageIndex]; if(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) var graphic_page = this.graphicPages[pageIndex];
graphic_array[i].getAllRasterImages(ret); 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; 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