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
f403e1dd
Commit
f403e1dd
authored
Sep 12, 2016
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed several bugs with calculating a footnotes.
parent
1b89a438
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
72 deletions
+42
-72
word/Editor/ParagraphContent.js
word/Editor/ParagraphContent.js
+6
-2
word/Editor/Paragraph_Recalculate.js
word/Editor/Paragraph_Recalculate.js
+34
-68
word/Editor/Run.js
word/Editor/Run.js
+2
-2
No files found.
word/Editor/ParagraphContent.js
View file @
f403e1dd
...
...
@@ -7641,10 +7641,14 @@ ParaFootnoteReference.prototype.Get_Footnote = function()
{
return
this
.
Footnote
;
};
ParaFootnoteReference
.
prototype
.
UpdateNumber
=
function
(
nPageAbs
,
nColumnAbs
,
nAdditional
)
ParaFootnoteReference
.
prototype
.
UpdateNumber
=
function
(
PRS
)
{
if
(
this
.
Footnote
)
if
(
this
.
Footnote
&&
true
!==
PRS
.
IsFastRecalculate
()
)
{
var
nPageAbs
=
PRS
.
GetPageAbs
();
var
nColumnAbs
=
PRS
.
GetColumnAbs
();
var
nAdditional
=
PRS
.
GetFootnoteReferencesCount
()
var
oLogicDocument
=
this
.
Footnote
.
Get_LogicDocument
();
var
oFootnotesController
=
oLogicDocument
.
GetFootnotesController
();
this
.
Number
=
oFootnotesController
.
GetFootnoteNumberOnPage
(
nPageAbs
,
nColumnAbs
)
+
nAdditional
;
...
...
word/Editor/Paragraph_Recalculate.js
View file @
f403e1dd
...
...
@@ -1875,56 +1875,6 @@ Paragraph.prototype.private_RecalculateLineCheckFootnotes = function(CurLine, Cu
return
true
;
var
oTopDocument
=
PRS
.
TopDocument
;
// for (var nIndex = 0, nCount = PRS.Footnotes.length; nIndex < nCount; ++nIndex)
// {
// var oFootnote = PRS.Footnotes[nIndex].FootnoteReference.Get_Footnote();
// var oPos = PRS.Footnotes[nIndex].Pos;
//
// // Проверим позицию
// if (true === this.MoveToLBP && PRS.LineBreakPos.Compare(oPos) >= 0)
// return true;
//
// // TODO: Здесь надо разобраться с параграфами внутри таблицы.
// if (oTopDocument instanceof CDocument)
// {
// var RecalcInfo = oTopDocument.RecalcInfo;
// var nPageAbs = PRS.PageAbs;
// var nColumnAbs = PRS.ColumnAbs;
// if (true === RecalcInfo.Can_RecalcObject())
// {
// RecalcInfo.Set_FootnoteReference(oFootnote, nPageAbs, nColumnAbs);
// oTopDocument.Footnotes.AddFootnoteToPage(nPageAbs, nColumnAbs, oFootnote, this.Pages[CurPage].Y + this.Lines[CurLine].Bottom);
// PRS.RecalcResult = recalcresult_CurPage | recalcresultflags_Column | recalcresultflags_Footnotes;
// return false;
// }
// else if (true === RecalcInfo.Check_FootnoteReference(oFootnote))
// {
// if (true === RecalcInfo.Is_PageBreakBefore())
// {
// //PRS.RecalcResult
// }
//
// if (nPageAbs === RecalcInfo.FootnotePage && nColumnAbs === RecalcInfo.FootnoteColumn)
// {
// // Все нормально пересчиталось
// RecalcInfo.Reset_FootnoteReference();
// }
// else
// {
// // TODO: Реализовать
// RecalcInfo.Set_PageBreakBefore(true);
// oTopDocument.Footnotes.RemoveFootnoteFromPage(nPageAbs, nColumnAbs, oFootnote);
// PRS.RecalcResult = recalcresult_CurPage | recalcresultflags_Column | recalcresultflags_Footnotes;
// return false;
// }
// }
// else
// {
// // Ничего не делаем, просто пропускаем ссылку на данную сноску
// }
// }
// }
var
arrFootnotes
=
[];
for
(
var
nIndex
=
0
,
nCount
=
PRS
.
Footnotes
.
length
;
nIndex
<
nCount
;
++
nIndex
)
{
...
...
@@ -1932,8 +1882,8 @@ Paragraph.prototype.private_RecalculateLineCheckFootnotes = function(CurLine, Cu
var
oPos
=
PRS
.
Footnotes
[
nIndex
].
Pos
;
// Проверим позицию
if
(
true
===
this
.
MoveToLBP
&&
PRS
.
LineBreakPos
.
Compare
(
oPos
)
>
=
0
)
return
tr
ue
;
if
(
true
===
PRS
.
MoveToLBP
&&
PRS
.
LineBreakPos
.
Compare
(
oPos
)
<
=
0
)
contin
ue
;
arrFootnotes
.
push
(
oFootnote
);
}
...
...
@@ -3007,22 +2957,38 @@ CParagraphRecalculateStateWrap.prototype =
NumberingItem
.
LineAscent
=
LineAscent
;
return
X
;
},
Add_FootnoteReference
:
function
(
FootnoteReference
,
Pos
)
{
this
.
Footnotes
.
push
({
FootnoteReference
:
FootnoteReference
,
Pos
:
Pos
});
},
GetFootnoteReferencesCount
:
function
()
{
return
this
.
Footnotes
.
length
;
},
SetFast
:
function
(
bValue
)
{
this
.
Fast
=
bValue
;
}
}
};
CParagraphRecalculateStateWrap
.
prototype
.
AddFootnoteReference
=
function
(
FootnoteReference
,
Pos
)
{
this
.
Footnotes
.
push
({
FootnoteReference
:
FootnoteReference
,
Pos
:
Pos
});
};
CParagraphRecalculateStateWrap
.
prototype
.
GetFootnoteReferencesCount
=
function
()
{
return
this
.
Footnotes
.
length
;
};
CParagraphRecalculateStateWrap
.
prototype
.
SetFast
=
function
(
bValue
)
{
this
.
Fast
=
bValue
;
};
CParagraphRecalculateStateWrap
.
prototype
.
IsFastRecalculate
=
function
()
{
return
this
.
Fast
;
};
CParagraphRecalculateStateWrap
.
prototype
.
GetPageAbs
=
function
()
{
return
this
.
PageAbs
;
};
CParagraphRecalculateStateWrap
.
prototype
.
GetColumnAbs
=
function
()
{
return
this
.
ColumnAbs
;
};
CParagraphRecalculateStateWrap
.
prototype
.
GetCurrentContentPos
=
function
(
nPos
)
{
var
oContentPos
=
this
.
CurPos
.
Copy
();
oContentPos
.
Set
(
this
.
CurPos
);
oContentPos
.
Add
(
nPos
);
return
oContentPos
;
};
function
CParagraphRecalculateStateCounter
()
...
...
word/Editor/Run.js
View file @
f403e1dd
...
...
@@ -2343,8 +2343,8 @@ ParaRun.prototype.Recalculate_Range = function(PRS, ParaPr, Depth)
if
(
para_FootnoteReference
===
ItemType
)
{
Item
.
UpdateNumber
(
PRS
.
PageAbs
,
PRS
.
ColumnAbs
,
PRS
.
GetFootnoteReferencesCount
()
);
PRS
.
Add
_FootnoteReference
(
Item
,
Pos
);
Item
.
UpdateNumber
(
PRS
);
PRS
.
Add
FootnoteReference
(
Item
,
PRS
.
GetCurrentContentPos
(
Pos
)
);
}
else
if
(
para_FootnoteRef
===
ItemType
)
{
...
...
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