Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
84e33633
Commit
84e33633
authored
Sep 20, 2016
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Worked out the situation when document ends on a long footnote.
parent
91aac575
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
161 additions
and
126 deletions
+161
-126
word/Editor/Document.js
word/Editor/Document.js
+151
-126
word/Editor/Footnotes.js
word/Editor/Footnotes.js
+10
-0
No files found.
word/Editor/Document.js
View file @
84e33633
...
...
@@ -2022,10 +2022,19 @@ CDocument.prototype.Recalculate = function(bOneParagraph, bRecalcContentLast, _R
this
.
DrawingDocument
.
FirePaint
();
return
;
}
else
if
(
ChangeIndex
>=
this
.
Content
.
length
)
// Найдем начальную страницу, с которой мы начнем пересчет
var
StartPage
=
0
;
var
StartIndex
=
0
;
if
(
ChangeIndex
>=
this
.
Content
.
length
)
{
ChangeIndex
=
this
.
Content
.
length
-
1
;
// Сюда мы попадаем при рассчете сносок, которые выходят за пределы самого документа
StartIndex
=
this
.
Content
.
length
;
StartPage
=
RecalcData
.
Inline
.
PageNum
;
}
else
{
// Здсь мы должны проверить предыдущие элементы на наличие параматра KeepNext
while
(
ChangeIndex
>
0
)
...
...
@@ -2042,10 +2051,6 @@ CDocument.prototype.Recalculate = function(bOneParagraph, bRecalcContentLast, _R
}
}
// Найдем начальную страницу, с которой мы начнем пересчет
var
StartPage
=
0
;
var
StartIndex
=
0
;
var
ChangedElement
=
this
.
Content
[
ChangeIndex
];
if
(
ChangedElement
.
Pages
.
length
>
0
&&
-
1
!==
ChangedElement
.
Index
&&
ChangedElement
.
Get_StartPage_Absolute
()
<
RecalcData
.
Inline
.
PageNum
-
1
)
{
...
...
@@ -2094,6 +2099,7 @@ CDocument.prototype.Recalculate = function(bOneParagraph, bRecalcContentLast, _R
this
.
HdrFtrRecalc
.
Id
=
null
;
this
.
DrawingDocument
.
OnEndRecalculate
(
false
);
}
}
this
.
HdrFtrRecalc
.
PageCount
=
-
1
;
...
...
@@ -2757,6 +2763,24 @@ CDocument.prototype.Recalculate_PageColumn = function()
}
if
(
Index
>=
Count
)
{
// Пересчет основной части документа законечен. Возможна ситуация, при которой последние сноски с данной
// страницы переносятся на следующую (т.е. остались непересчитанные сноски). Эти сноски нужно пересчитать
if
(
this
.
Footnotes
.
HaveContinuesFootnotes
(
PageIndex
,
ColumnIndex
))
{
bContinue
=
true
;
_PageIndex
=
PageIndex
;
_ColumnIndex
=
ColumnIndex
+
1
;
if
(
_ColumnIndex
>=
ColumnsCount
)
{
_ColumnIndex
=
0
;
_PageIndex
=
PageIndex
+
1
;
}
_bStart
=
true
;
_StartIndex
=
Count
;
}
else
{
this
.
Internal_CheckCurPage
();
this
.
DrawingDocument
.
OnEndRecalculate
(
true
);
...
...
@@ -2789,6 +2813,7 @@ CDocument.prototype.Recalculate_PageColumn = function()
}
}
}
}
if
(
true
===
bContinue
)
{
...
...
word/Editor/Footnotes.js
View file @
84e33633
...
...
@@ -488,6 +488,16 @@ CFootnotesController.prototype.LoadRecalculateObject = function(nPageAbs, nColum
oColumn
.
LoadRecalculateObject
(
oRObject
);
};
CFootnotesController
.
prototype
.
HaveContinuesFootnotes
=
function
(
nPageAbs
,
nColumnAbs
)
{
var
oColumn
=
this
.
private_GetPageColumn
(
nPageAbs
,
nColumnAbs
);
if
(
!
oColumn
)
return
false
;
var
arrContinues
=
oColumn
.
GetContinuesElements
();
return
(
arrContinues
.
length
>
0
?
true
:
false
);
};
/**
* Проверяем, используется заданная сноска в документе.
* @param {string} sFootnoteId
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment