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 = ...@@ -5782,7 +5782,8 @@ DrawingObjectsController.prototype =
if(content) if(content)
{ {
this.drawingObjects.getDrawingDocument().UpdateTargetTransform(this.getTargetTransform()); 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() ...@@ -561,59 +561,60 @@ CTable.prototype.Get_TableOffsetCorrection = function()
return 0; 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; return;
var CurPage = Page_abs - this.Get_StartPage_Absolute(); if (CurPage < 0 || CurPage >= this.Pages.length)
if ( CurPage < 0 || CurPage >= this.Pages.length )
return; return;
switch( this.Selection.Type ) var Page = this.Pages[CurPage];
var PageAbs = this.private_GetAbsolutePageIndex(CurPage);
switch (this.Selection.Type)
{ {
case table_Selection_Cell: 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 Pos = this.Selection.Data[Index];
var Row = this.Content[Pos.Row]; var Row = this.Content[Pos.Row];
var Cell = Row.Get_Cell( Pos.Cell ); var Cell = Row.Get_Cell(Pos.Cell);
var CellInfo = Row.Get_CellInfo( Pos.Cell ); var CellInfo = Row.Get_CellInfo(Pos.Cell);
var CellMar = Cell.Get_Margins(); 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_start = (0 === Pos.Cell ? Page.X + CellInfo.X_content_start : Page.X + CellInfo.X_cell_start);
var X_end = CellInfo.X_cell_end; var X_end = Page.X + CellInfo.X_cell_end;
var Cell_Pages = Cell.Content_Get_PagesCount(); var Cell_Pages = Cell.Content_Get_PagesCount();
var Cell_PageRel = Page_abs - Cell.Content.Get_StartPage_Absolute(); var Cell_PageRel = CurPage - Cell.Content.Get_StartPage_Relative();
if ( Cell_PageRel < 0 || Cell_PageRel >= Cell_Pages ) if (Cell_PageRel < 0 || Cell_PageRel >= Cell_Pages)
continue; 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; 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 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; break;
} }
case table_Selection_Text: case table_Selection_Text:
{ {
var Cell = this.Content[this.Selection.StartPos.Pos.Row].Get_Cell( this.Selection.StartPos.Pos.Cell ); 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_PageRel = CurPage - Cell.Content.Get_StartPage_Relative();
Cell.Content.Selection_Draw_Page(Cell_PageRel);
break; break;
} }
} }
......
...@@ -675,7 +675,7 @@ CGraphicFrame.prototype = ...@@ -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(); this.graphicObject.RecalculateCurPos();
return; return;
} }
...@@ -715,7 +715,7 @@ CGraphicFrame.prototype = ...@@ -715,7 +715,7 @@ CGraphicFrame.prototype =
drawingDocument.TargetEnd(); drawingDocument.TargetEnd();
drawingDocument.SelectEnabled(true); drawingDocument.SelectEnabled(true);
drawingDocument.SelectClear(); drawingDocument.SelectClear();
Doc.Selection_Draw_Page(this.parent.num); Doc.Selection_Draw_Page(0);
drawingDocument.SelectShow(); drawingDocument.SelectShow();
} }
else else
...@@ -736,6 +736,17 @@ CGraphicFrame.prototype = ...@@ -736,6 +736,17 @@ CGraphicFrame.prototype =
} }
}, },
Get_AbsolutePage : function(CurPage)
{
return this.Get_StartPage_Absolute();
},
Get_AbsoluteColumn : function(CurPage)
{
return 0;
},
Is_TopDocument: function() Is_TopDocument: function()
{ {
return false; return false;
...@@ -1029,16 +1040,6 @@ CGraphicFrame.prototype = ...@@ -1029,16 +1040,6 @@ CGraphicFrame.prototype =
}, },
Get_AbsolutePage : function(CurPage)
{
return this.parent.num;
},
Get_AbsoluteColumn : function(CurPage)
{
return 0;//TODO;
},
hitToHandles: function() hitToHandles: function()
{ {
return -1; 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