Commit e8f81b28 authored by Ilya Kirillov's avatar Ilya Kirillov

Fix bug #33185 Has been processed a special case when a document ends on a...

Fix bug #33185 Has been processed a special case when a document ends on a long footnote. Previous processing didn't work because of bug 33185.
parent ee153a24
......@@ -2255,6 +2255,7 @@
window['AscDFH'].historyitem_recalctype_Flow = 1; // Изменения произошли в "плавающем" объекте
window['AscDFH'].historyitem_recalctype_HdrFtr = 2; // Изменения произошли в колонтитуле
window['AscDFH'].historyitem_recalctype_Drawing = 3; // Изменения произошли в drawing'е
window['AscDFH'].historyitem_recalctype_NotesEnd = 4; // Изменение произошли в сносках, которые идут в конце документа
// Типы классов, в которых происходили изменения (типы нужны для совместного редактирования)
window['AscDFH'].historyitem_type_Unknown = 0;
......
......@@ -2014,25 +2014,29 @@ CDocument.prototype.Recalculate = function(bOneParagraph, bRecalcContentLast, _R
}
}
if (ChangeIndex < 0)
{
this.DrawingDocument.ClearCachePages();
this.DrawingDocument.FirePaint();
return;
}
// Найдем начальную страницу, с которой мы начнем пересчет
var StartPage = 0;
var StartIndex = 0;
if (ChangeIndex >= this.Content.length)
if (ChangeIndex < 0 && true === RecalcData.NotesEnd)
{
// Сюда мы попадаем при рассчете сносок, которые выходят за пределы самого документа
StartIndex = this.Content.length;
StartPage = RecalcData.Inline.PageNum;
StartPage = RecalcData.NotesEndPage;
MainChange = true;
}
else
{
if (ChangeIndex < 0)
{
this.DrawingDocument.ClearCachePages();
this.DrawingDocument.FirePaint();
return;
}
else if (ChangeIndex >= this.Content.length)
{
ChangeIndex = this.Content.length - 1;
}
// Здсь мы должны проверить предыдущие элементы на наличие параматра KeepNext
while (ChangeIndex > 0)
......@@ -2041,7 +2045,11 @@ CDocument.prototype.Recalculate = function(bOneParagraph, bRecalcContentLast, _R
if (type_Paragraph === PrevElement.Get_Type() && true === PrevElement.Get_CompiledPr2(false).ParaPr.KeepNext)
{
ChangeIndex--;
RecalcData.Inline.PageNum = PrevElement.Get_StartPage_Absolute() + (PrevElement.Pages.length - 1); // считаем, что изменилась последняя страница
RecalcData.Inline.PageNum = PrevElement.Get_StartPage_Absolute() + (PrevElement.Pages.length - 1); // считаем,
// что
// изменилась
// последняя
// страница
}
else
{
......@@ -6786,11 +6794,6 @@ CDocument.prototype.OnKeyDown = function(e)
bUpdateSelection = false;
bRetValue = keydownresult_PreventAll;
}
// else if (e.KeyCode === 113)
// {
// this.AddFootnote();
// bRetValue = keydownresult_PreventAll;
// }
else if (e.KeyCode == 121 && true === e.ShiftKey) // Shift + F10 - контекстное меню
{
var X_abs, Y_abs, oPosition, ConvertedPos;
......
......@@ -785,8 +785,19 @@ CFootnotesController.prototype.Refresh_RecalcData2 = function(nRelPageIndex)
if (this.LogicDocument.Pages[nAbsPageIndex])
{
var nIndex = this.LogicDocument.Pages[nAbsPageIndex].Pos;
if (nIndex >= this.LogicDocument.Content.length)
{
History.RecalcData_Add({
Type : AscDFH.historyitem_recalctype_NotesEnd,
PageNum : nAbsPageIndex
});
}
else
{
this.LogicDocument.Refresh_RecalcData2(nIndex, nAbsPageIndex);
}
}
};
CFootnotesController.prototype.Get_PageContentStartPos = function(nPageAbs, nColumnAbs)
{
......
......@@ -48,7 +48,10 @@ function CHistory(Document)
this.RecalculateData =
{
Inline : {Pos : -1, PageNum : 0},
Inline : {
Pos : -1,
PageNum : 0
},
Flow : [],
HdrFtr : [],
Drawings : {
......@@ -56,10 +59,10 @@ function CHistory(Document)
Map : {},
ThemeInfo : null
},
Tables : [],
NumPr : [],
NotesEnd : false,
NotesEndPage : 0,
Update : true
};
......@@ -481,7 +484,10 @@ CHistory.prototype =
var NumPr = this.RecalculateData.NumPr;
this.RecalculateData =
{
Inline : {Pos : -1, PageNum : 0},
Inline : {
Pos : -1,
PageNum : 0
},
Flow : [],
HdrFtr : [],
Drawings : {
......@@ -492,7 +498,8 @@ CHistory.prototype =
Tables : [],
NumPr : NumPr,
NotesEnd : false,
NotesEndPage : 0,
Update : true
};
},
......@@ -590,6 +597,13 @@ CHistory.prototype =
}
break;
}
case AscDFH.historyitem_recalctype_NotesEnd:
{
this.RecalculateData.NotesEnd = true;
this.RecalculateData.NotesEndPage = Data.PageNum;
break;
}
}
},
......
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