Commit b89a6180 authored by Sergey.Luzyanin's avatar Sergey.Luzyanin

Не рисовался селект в таблицах

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@67916 954022d7-b5bf-4e40-9824-e11837661b57
parent eae0addb
......@@ -5782,7 +5782,8 @@ DrawingObjectsController.prototype =
if(content)
{
this.drawingObjects.getDrawingDocument().UpdateTargetTransform(this.getTargetTransform());
content.Selection_Draw_Page(isRealNumber(num) ? num : 0);
content.Selection_Draw_Page(0);
}
},
......
......@@ -561,59 +561,60 @@ CTable.prototype.Get_TableOffsetCorrection = function()
return 0;
};
CTable.prototype.Selection_Draw_Page = function(Page_abs)
CTable.prototype.Selection_Draw_Page = function(CurPage)
{
if ( false === this.Selection.Use )
if (false === this.Selection.Use)
return;
var CurPage = Page_abs - this.Get_StartPage_Absolute();
if ( CurPage < 0 || CurPage >= this.Pages.length )
if (CurPage < 0 || CurPage >= this.Pages.length)
return;
switch( this.Selection.Type )
var Page = this.Pages[CurPage];
var PageAbs = this.private_GetAbsolutePageIndex(CurPage);
switch (this.Selection.Type)
{
case table_Selection_Cell:
{
var Row_prev_index = -1;
for ( var Index = 0; Index < this.Selection.Data.length; Index++ )
for (var Index = 0; Index < this.Selection.Data.length; ++Index)
{
var Pos = this.Selection.Data[Index];
var Row = this.Content[Pos.Row];
var Cell = Row.Get_Cell( Pos.Cell );
var CellInfo = Row.Get_CellInfo( Pos.Cell );
var Cell = Row.Get_Cell(Pos.Cell);
var CellInfo = Row.Get_CellInfo(Pos.Cell);
var CellMar = Cell.Get_Margins();
if ( -1 === Row_prev_index || Row_prev_index != Pos.Row )
Row_prev_index = Pos.Row;
var X_start = CellInfo.X_cell_start;
var X_end = CellInfo.X_cell_end;
var X_start = (0 === Pos.Cell ? Page.X + CellInfo.X_content_start : Page.X + CellInfo.X_cell_start);
var X_end = Page.X + CellInfo.X_cell_end;
var Cell_Pages = Cell.Content_Get_PagesCount();
var Cell_PageRel = Page_abs - Cell.Content.Get_StartPage_Absolute();
if ( Cell_PageRel < 0 || Cell_PageRel >= Cell_Pages )
var Cell_PageRel = CurPage - Cell.Content.Get_StartPage_Relative();
if (Cell_PageRel < 0 || Cell_PageRel >= Cell_Pages)
continue;
var Bounds = Cell.Content_Get_PageBounds( Cell_PageRel );
var Bounds = Cell.Content_Get_PageBounds(Cell_PageRel);
var Y_offset = Cell.Temp.Y_VAlign_offset[Cell_PageRel];
if ( 0 != Cell_PageRel )
if (0 != Cell_PageRel)
{
// мы должны определить ряд, на котором случился перенос на новую страницу
var TempRowIndex = this.Pages[CurPage].FirstRow;
this.DrawingDocument.AddPageSelection( Page_abs, X_start, this.RowsInfo[TempRowIndex].Y[CurPage] + this.RowsInfo[TempRowIndex].TopDy[CurPage], X_end - X_start, this.RowsInfo[TempRowIndex].H[CurPage] );
this.DrawingDocument.AddPageSelection(PageAbs, X_start, this.RowsInfo[TempRowIndex].Y[CurPage] + this.RowsInfo[TempRowIndex].TopDy[CurPage], X_end - X_start, this.RowsInfo[TempRowIndex].H[CurPage]);
}
else
{
this.DrawingDocument.AddPageSelection( Page_abs, X_start, this.RowsInfo[Pos.Row].Y[CurPage] + this.RowsInfo[Pos.Row].TopDy[CurPage], X_end - X_start, this.RowsInfo[Pos.Row].H[CurPage] );
this.DrawingDocument.AddPageSelection(PageAbs, X_start, this.RowsInfo[Pos.Row].Y[CurPage] + this.RowsInfo[Pos.Row].TopDy[CurPage], X_end - X_start, this.RowsInfo[Pos.Row].H[CurPage] );
}
}
break;
}
case table_Selection_Text:
{
var Cell = this.Content[this.Selection.StartPos.Pos.Row].Get_Cell( this.Selection.StartPos.Pos.Cell );
Cell.Content.Selection_Draw_Page(Page_abs);
var Cell = this.Content[this.Selection.StartPos.Pos.Row].Get_Cell(this.Selection.StartPos.Pos.Cell);
var Cell_PageRel = CurPage - Cell.Content.Get_StartPage_Relative();
Cell.Content.Selection_Draw_Page(Cell_PageRel);
break;
}
}
......
......@@ -675,7 +675,7 @@ CGraphicFrame.prototype =
}
}
}
this.graphicObject.Selection_SetStart(tx, ty, 0, e);
this.graphicObject.Selection_SetStart(tx, ty, this.parent.num, e);
this.graphicObject.RecalculateCurPos();
return;
}
......@@ -715,7 +715,7 @@ CGraphicFrame.prototype =
drawingDocument.TargetEnd();
drawingDocument.SelectEnabled(true);
drawingDocument.SelectClear();
Doc.Selection_Draw_Page(this.parent.num);
Doc.Selection_Draw_Page(0);
drawingDocument.SelectShow();
}
else
......@@ -736,6 +736,17 @@ CGraphicFrame.prototype =
}
},
Get_AbsolutePage : function(CurPage)
{
return this.Get_StartPage_Absolute();
},
Get_AbsoluteColumn : function(CurPage)
{
return 0;
},
Is_TopDocument: function()
{
return false;
......@@ -1029,16 +1040,6 @@ CGraphicFrame.prototype =
},
Get_AbsolutePage : function(CurPage)
{
return this.parent.num;
},
Get_AbsoluteColumn : function(CurPage)
{
return 0;//TODO;
},
hitToHandles: function()
{
return -1;
......
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