Commit 63788267 authored by Ilya Kirillov's avatar Ilya Kirillov

Fixed bug #34380

parent 2226d75a
......@@ -1370,16 +1370,19 @@ CDocumentContent.prototype.RecalculateCurPos = function()
return null;
};
CDocumentContent.prototype.Get_PageBounds = function(PageNum, Height, bForceCheckDrawings)
CDocumentContent.prototype.Get_PageBounds = function(CurPage, Height, bForceCheckDrawings)
{
if (this.Pages.length <= 0)
return {Top : 0, Left : 0, Right : 0, Bottom : 0};
if (PageNum < 0 || PageNum > this.Pages.length)
return this.Pages[0].Bounds;
if (CurPage < 0)
CurPage = 0;
var Bounds = this.Pages[PageNum].Bounds;
var PageNumAbs = PageNum + this.Get_StartPage_Absolute();
if (CurPage >= this.Pages.length)
CurPage = this.Pages.length - 1;
var Bounds = this.Pages[CurPage].Bounds;
var PageAbs = this.Get_AbsolutePage(CurPage);
// В колонтитуле не учитывается.
if (true != this.Is_HdrFtr(false) || true === bForceCheckDrawings)
......@@ -1392,7 +1395,7 @@ CDocumentContent.prototype.Get_PageBounds = function(PageNum, He
for (var Index = 0; Index < Count; Index++)
{
var Obj = AllDrawingObjects[Index];
if (PageNumAbs === Obj.Get_PageNum())
if (PageAbs === Obj.Get_PageNum())
{
var ObjBounds = Obj.Get_Bounds();
if (true === Obj.Use_TextWrap())
......@@ -1415,9 +1418,10 @@ CDocumentContent.prototype.Get_PageBounds = function(PageNum, He
for (var Index = 0; Index < Count; Index++)
{
var Element = this.Content[Index];
if (type_Table === Element.GetType() && true != Element.Is_Inline() && Element.Pages.length > PageNum - Element.PageNum && PageNum - Element.PageNum >= 0)
var ElementPageIndex = this.private_GetElementPageIndex(Index, CurPage, 0, 1);
if (type_Table === Element.GetType() && true != Element.Is_Inline() && 0 <= ElementPageIndex && ElementPageIndex < Element.Get_PagesCount())
{
var TableBounds = Element.Get_PageBounds(PageNum - Element.PageNum);
var TableBounds = Element.Get_PageBounds(ElementPageIndex);
if (TableBounds.Bottom > Bounds.Bottom)
Bounds.Bottom = TableBounds.Bottom;
}
......
......@@ -931,7 +931,11 @@ CFootnotesController.prototype.EndSelection = function(X, Y, PageAbs, MouseEvent
// Новый селект
if (this.Selection.Start.Footnote !== this.Selection.End.Footnote)
{
if (this.Selection.Start.Page > this.Selection.End.Page || this.Selection.Start.Index > this.Selection.End.Index)
if (this.Selection.Start.Page > this.Selection.End.Page
|| (this.Selection.Start.Page === this.Selection.End.Page
&& (this.Selection.Start.Column > this.Selection.End.Column
|| (this.Selection.Start.Column === this.Selection.End.Column
&& this.Selection.Start.Index > this.Selection.End.Index))))
{
this.Selection.Start.Footnote.Selection_SetEnd(-MEASUREMENT_MAX_MM_VALUE, -MEASUREMENT_MAX_MM_VALUE, 0, MouseEvent);
this.Selection.End.Footnote.Selection_SetStart(MEASUREMENT_MAX_MM_VALUE, MEASUREMENT_MAX_MM_VALUE, this.Selection.End.Footnote.Pages.length - 1, MouseEvent);
......@@ -1104,6 +1108,39 @@ CFootnotesController.prototype.private_GetFootnoteOnPageByXY = function(X, Y, nP
}
}
if (!oColumn)
return null;
if (oColumn.Elements.length <= 0)
{
var nCurColumnIndex = nColumnIndex - 1;
while (nCurColumnIndex >= 0)
{
if (oPage.Columns[nCurColumnIndex].Elements.length > 0)
{
oColumn = oPage.Columns[nCurColumnIndex];
nColumnIndex = nCurColumnIndex;
break;
}
nCurColumnIndex--;
}
if (nCurColumnIndex < 0)
{
nCurColumnIndex = nColumnIndex + 1;
while (nCurColumnIndex <= oPage.Columns.length - 1)
{
if (oPage.Columns[nCurColumnIndex].Elements.length > 0)
{
oColumn = oPage.Columns[nCurColumnIndex];
nColumnIndex = nCurColumnIndex;
break;
}
nCurColumnIndex++;
}
}
}
if (!oColumn)
return null;
......
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