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

картинки в колонтитулах

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55831 954022d7-b5bf-4e40-9824-e11837661b57
parent c28f1fd8
......@@ -1877,10 +1877,7 @@ CDocument.prototype =
if ( section_borders_ZOrderBack === SectPr.Get_Borders_ZOrder() )
this.Draw_Borders(pGraphics, SectPr);
this.DrawingObjects.drawBehindDocHdrFtr( nPageIndex, pGraphics );
this.DrawingObjects.drawWrappingObjectsHdrFtr( nPageIndex, pGraphics );
this.HdrFtr.Draw( nPageIndex, pGraphics );
this.DrawingObjects.drawBeforeObjectsHdrFtr( nPageIndex, pGraphics );
// Рисуем содержимое документа на данной странице
if ( docpostype_HdrFtr === this.CurPos.Type )
......
......@@ -561,18 +561,19 @@ CGraphicObjects.prototype =
addFloatTable: function(table)
{
var hdr_ftr = table.Table.Parent.Is_HdrFtr(true);
if(!hdr_ftr)
{
if(!this.graphicPages[table.PageNum + table.PageController])
{
this.graphicPages[table.PageNum + table.PageController] = new CGraphicPage(table.PageNum + table.PageController, this);
}
if(!table.Table.Parent.Is_HdrFtr())
{
this.graphicPages[table.PageNum + table.PageController].addFloatTable(table);
this.graphicPages[table.PageNum + table.PageController].hdrFtrPage.addFloatTable(table);
}
else
{
this.graphicPages[table.PageNum + table.PageController].hdrFtrPage.addFloatTable(table);
hdr_ftr.DrawingPage.addFloatTable(table);
}
},
......@@ -583,11 +584,17 @@ CGraphicObjects.prototype =
this.graphicPages[pageIndex] = new CGraphicPage(pageIndex, this);
}
var table = g_oTableId.Get_ById(id);
if(!table.Parent.Is_HdrFtr())
if(table)
{
var hdr_ftr = table.Parent.Is_HdrFtr(true);
if(!hdr_ftr)
{
this.graphicPages[pageIndex].removeFloatTableById(id);
}
else
{
this.graphicPages[pageIndex].hdrFtrPage.removeFloatTableById(id);
hdr_ftr.DrawingPage.removeFloatTableById(id);
}
}
},
......@@ -873,17 +880,31 @@ CGraphicObjects.prototype =
},
resetDrawingArrays : function(pageIndex, docContent)
{
var hdr_ftr = docContent.Is_HdrFtr(true);
if(!hdr_ftr)
{
if(isRealObject(this.graphicPages[pageIndex]))
{
if(!docContent || !docContent.Is_HdrFtr())
this.graphicPages[pageIndex].resetDrawingArrays(docContent);
}
}
else
this.graphicPages[pageIndex].hdrFtrPage.resetDrawingArrays(docContent);
{
hdr_ftr.DrawingPage.resetDrawingArrays(docContent);
}
},
mergeHdrFtrPages: function(page1, page2, pageIndex)
{
if(!isRealObject(this.graphicPages[pageIndex]))
this.graphicPages[pageIndex] = new CGraphicPage(pageIndex, this);
this.graphicPages[pageIndex].hdrFtrPage.clear();
this.graphicPages[pageIndex].hdrFtrPage.mergePages(page1, page2);
},
onEndRecalculateDocument: function(pagesCount)
{
for(var i = 0; i < pagesCount; ++i)
......@@ -1766,6 +1787,9 @@ CGraphicObjects.prototype =
getGroup: DrawingObjectsController.prototype.getGroup,
addObjectOnPage: function(pageIndex, object)
{
var hdr_ftr = object.parent.DocumentContent.Is_HdrFtr(true);
if(!hdr_ftr)
{
if(!this.graphicPages[pageIndex])
{
......@@ -1776,37 +1800,11 @@ CGraphicObjects.prototype =
this.graphicPages[z] = new CGraphicPage(z, this);
}
}
var page;
if(!object.parent.DocumentContent.Is_HdrFtr())
page = this.graphicPages[pageIndex];
else
page = this.graphicPages[pageIndex].hdrFtrPage;
var array_type = object.parent.getDrawingArrayType();
switch(array_type)
{
case DRAWING_ARRAY_TYPE_INLINE:
{
page.inlineObjects.push(object);
break;
this.graphicPages[pageIndex].addObject(object);
}
case DRAWING_ARRAY_TYPE_BEHIND:
{
page.behindDocObjects.push(object);
page.behindDocObjects.sort(ComparisonByZIndexSimpleParent);
break;
}
case DRAWING_ARRAY_TYPE_BEFORE:
else
{
page.beforeTextObjects.push(object);
page.beforeTextObjects.sort(ComparisonByZIndexSimpleParent);
break;
}
case DRAWING_ARRAY_TYPE_WRAPPING:
{
page.wrappingObjects.push(object);
page.wrappingObjects.sort(ComparisonByZIndexSimpleParent);
break;
}
hdr_ftr.DrawingPage.addObject(object);
}
},
......@@ -2529,16 +2527,13 @@ CGraphicObjects.prototype =
if(isRealObject(object))
{
var hdr_ftr = object.DocumentContent.Is_HdrFtr(true);
//for(var i = 0; i < this.graphicPages.length; ++i)
{
var page = !hdr_ftr ? this.graphicPages[pageIndex] : this.graphicPages[pageIndex] && this.graphicPages[pageIndex].hdrFtrPage;
var page = !hdr_ftr ? this.graphicPages[pageIndex] : hdr_ftr.DrawingPage;
if(isRealObject(page))
{
var array_type = object.getDrawingArrayType();
page.delObjectById(id, array_type);
}
}
}
},
Remove_ById: function(id)
......
......@@ -46,6 +46,88 @@ CGraphicPage.prototype =
}
this.flowTables.push(table);
},
addObject: function(object)
{
var array_type = object.parent.getDrawingArrayType();
var drawing_array, need_sort = true;
switch(array_type)
{
case DRAWING_ARRAY_TYPE_INLINE:
{
drawing_array = this.inlineObjects;
need_sort = false;
break;
}
case DRAWING_ARRAY_TYPE_BEHIND:
{
drawing_array = this.behindDocObjects;
break;
}
case DRAWING_ARRAY_TYPE_BEFORE:
{
drawing_array = this.beforeTextObjects;
break;
}
case DRAWING_ARRAY_TYPE_WRAPPING:
{
drawing_array = this.wrappingObjects;
break;
}
}
if(Array.isArray(drawing_array))
{
for(var i = 0; i < drawing_array.length; ++i)
{
if(drawing_array[i] === object)
{
break;
}
}
if(i === drawing_array.length)
{
drawing_array.push(object);
if(need_sort)
{
drawing_array.sort(ComparisonByZIndexSimpleParent);
}
}
}
},
concatPage: function(page)
{
this.inlineObjects = this.inlineObjects.concat(page.inlineObjects);
this.behindDocObjects = this.behindDocObjects.concat(page.behindDocObjects);
this.wrappingObjects = this.wrappingObjects.concat(page.wrappingObjects);
this.beforeTextObjects = this.beforeTextObjects.concat(page.beforeTextObjects);
this.flowTables = this.flowTables.concat(page.flowTables);
},
mergePages: function(page1, page2)
{
if(page1)
{
this.concatPage(page1);
}
if(page2)
{
this.concatPage(page2);
}
this.behindDocObjects.sort(ComparisonByZIndexSimpleParent);
this.wrappingObjects.sort(ComparisonByZIndexSimpleParent);
this.beforeTextObjects.sort(ComparisonByZIndexSimpleParent);
},
clear: function()
{
this.inlineObjects = [];
this.behindDocObjects = [];
this.wrappingObjects = [];
this.beforeTextObjects = [];
this.flowTables = [];
},
CheckRange: function(X0, Y0, X1, Y1, Y0sp, Y1Ssp, LeftField, RightField, HdrFtrRanges, docContent)
{
return this.wrapManager.checkRanges(X0, Y0, X1, Y1, Y0sp, Y1Ssp, LeftField, RightField, HdrFtrRanges, docContent);
......@@ -249,14 +331,6 @@ CGraphicPage.prototype =
findInArrayAndRemove(drawingPage.beforeTextObjects, docContent, document);
findTableInArrayAndRemove(drawingPage.flowTables, docContent, document);
}
else if(Array.isArray(drawingPage.inlineArray))
{
findInArrayAndRemove(drawingPage.inlineArray, docContent, document);
findInArrayAndRemove(drawingPage.behindDocArray, docContent, document);
findInArrayAndRemove(drawingPage.wrappingArray, docContent, document);
findInArrayAndRemove(drawingPage.beforeTextArray, docContent, document);
findTableInArrayAndRemove(drawingPage.floatTables, docContent, document);
}
}
if(!isRealObject(docContent))
......@@ -265,6 +339,7 @@ CGraphicPage.prototype =
findInArrayAndRemoveFromDrawingPage(this, docContent, editor.WordControl.m_oLogicDocument);
},
draw: function(graphics)
{
for(var _object_index = 0; _object_index < this.inlineObjects.length; ++_object_index)
......
......@@ -47,6 +47,7 @@ function CHeaderFooter(Parent, LogicDocument, DrawingDocument, Type)
NeedRecalc : {}, // Объект с ключом - номером страницы, нужно ли пересчитывать данную страницу
SectPr : {} // Объект с ключом - номером страницы и полем - ссылкой на секцию
};
this.DrawingPage = new CGraphicPage(0, null);
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
g_oTableId.Add( this, this.Id );
......@@ -1234,6 +1235,8 @@ CHeaderFooterController.prototype =
return this.CurHdrFtr.RecalculateCurPos();
},
Recalculate : function(PageIndex)
{
// Определим четность страницы и является ли она первой в данной секции. Заметим, что четность страницы
......@@ -1253,10 +1256,6 @@ CHeaderFooterController.prototype =
this.Pages[PageIndex] = new CHdrFtrPage();
this.Pages[PageIndex].Header = Header;
this.Pages[PageIndex].Footer = Footer;
if(this.LogicDocument.DrawingObjects.graphicPages[PageIndex])
{
this.LogicDocument.DrawingObjects.graphicPages[PageIndex].hdrFtrPage.resetDrawingArrays(this.LogicDocument);
}
var X, XLimit;
var Orient = SectPr.Get_Orientation();
......@@ -1332,11 +1331,18 @@ CHeaderFooterController.prototype =
var Header = this.Pages[nPageIndex].Header;
var Footer = this.Pages[nPageIndex].Footer;
this.LogicDocument.DrawingObjects.mergeHdrFtrPages(Header && Header.DrawingPage, Footer && Footer.DrawingPage, nPageIndex);
this.LogicDocument.DrawingObjects.drawBehindDocHdrFtr( nPageIndex, pGraphics );
this.LogicDocument.DrawingObjects.drawWrappingObjectsHdrFtr( nPageIndex, pGraphics );
if ( null !== Header )
Header.Draw( nPageIndex, pGraphics );
if ( null !== Footer )
Footer.Draw( nPageIndex, pGraphics );
this.LogicDocument.DrawingObjects.drawBeforeObjectsHdrFtr( nPageIndex, pGraphics );
},
CheckRange : function(X0, Y0, X1, Y1, _Y0, _Y1, X_lf, X_rf, PageIndex)
......
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