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
4a836625
Commit
4a836625
authored
Sep 02, 2016
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed several bugs working with footnotes which has been divided to columns.
parent
7ada3f36
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
15 deletions
+24
-15
word/Editor/Footnotes.js
word/Editor/Footnotes.js
+24
-15
No files found.
word/Editor/Footnotes.js
View file @
4a836625
...
@@ -428,12 +428,17 @@ CFootnotesController.prototype.GetFootnoteNumberOnPage = function(nPageAbs, nCol
...
@@ -428,12 +428,17 @@ CFootnotesController.prototype.GetFootnoteNumberOnPage = function(nPageAbs, nCol
for
(
var
nIndex
=
0
,
nCount
=
oColumn
.
Elements
.
length
;
nIndex
<
nCount
;
++
nIndex
)
for
(
var
nIndex
=
0
,
nCount
=
oColumn
.
Elements
.
length
;
nIndex
<
nCount
;
++
nIndex
)
{
{
if
(
oFootnote
&&
oFootnote
===
oColumn
.
Elements
[
nIndex
])
var
oCurFootnote
=
oColumn
.
Elements
[
nIndex
];
// Сноски начинающиеся не на данной колонке мы не учитываем
if
(
0
===
oCurFootnote
.
GetElementPageIndex
(
nPageAbs
,
nColumnIndex
))
{
if
(
oFootnote
&&
oFootnote
===
oCurFootnote
)
return
nFootnoteIndex
;
return
nFootnoteIndex
;
nFootnoteIndex
++
;
nFootnoteIndex
++
;
}
}
}
}
}
return
nFootnoteIndex
;
return
nFootnoteIndex
;
};
};
...
@@ -589,29 +594,33 @@ CFootnotesController.prototype.CheckHitInFootnote = function(X, Y, nPageAbs)
...
@@ -589,29 +594,33 @@ CFootnotesController.prototype.CheckHitInFootnote = function(X, Y, nPageAbs)
var
oPage
=
this
.
Pages
[
nPageAbs
];
var
oPage
=
this
.
Pages
[
nPageAbs
];
var
oColumn
=
null
;
var
oColumn
=
null
;
for
(
var
nColumnIndex
=
0
,
nColumnsCount
=
oPage
.
Columns
.
length
;
nColumnIndex
<
nColumnsCount
;
++
nColumnIndex
)
var
nFindedColumnIndex
=
0
,
nColumnsCount
=
oPage
.
Columns
.
length
;
for
(
var
nColumnIndex
=
0
;
nColumnIndex
<
nColumnsCount
;
++
nColumnIndex
)
{
{
if
(
nColumnIndex
<
nColumnsCount
-
1
)
if
(
nColumnIndex
<
nColumnsCount
-
1
)
{
{
if
(
X
<
(
oPage
.
Columns
[
nColumnIndex
].
XLimit
+
oPage
.
Columns
[
nColumnIndex
+
1
].
X
)
/
2
)
if
(
X
<
(
oPage
.
Columns
[
nColumnIndex
].
XLimit
+
oPage
.
Columns
[
nColumnIndex
+
1
].
X
)
/
2
)
{
{
oColumn
=
oPage
.
Columns
[
nColumnIndex
];
oColumn
=
oPage
.
Columns
[
nColumnIndex
];
nFindedColumnIndex
=
nColumnIndex
;
break
;
break
;
}
}
}
}
else
else
{
{
oColumn
=
oPage
.
Columns
[
nColumnIndex
];
oColumn
=
oPage
.
Columns
[
nColumnIndex
];
nFindedColumnIndex
=
nColumnIndex
;
}
}
}
}
if
(
!
oColumn
)
if
(
!
oColumn
||
nFindedColumnIndex
>=
nColumnsCount
)
return
false
;
return
false
;
for
(
var
nIndex
=
0
,
nCount
=
oColumn
.
Elements
.
length
;
nIndex
<
nCount
;
++
nIndex
)
for
(
var
nIndex
=
0
,
nCount
=
oColumn
.
Elements
.
length
;
nIndex
<
nCount
;
++
nIndex
)
{
{
var
oFootnote
=
oColumn
.
Elements
[
nIndex
];
var
oFootnote
=
oColumn
.
Elements
[
nIndex
];
var
oBounds
=
oFootnote
.
Get_PageBounds
(
0
);
var
nFootnotePageIndex
=
oFootnote
.
GetElementPageIndex
(
nPageAbs
,
nFindedColumnIndex
);
var
oBounds
=
oFootnote
.
Get_PageBounds
(
nFootnotePageIndex
);
if
(
oBounds
.
Top
<=
Y
)
if
(
oBounds
.
Top
<=
Y
)
return
true
;
return
true
;
...
@@ -644,7 +653,7 @@ CFootnotesController.prototype.StartSelection = function(X, Y, PageAbs, MouseEve
...
@@ -644,7 +653,7 @@ CFootnotesController.prototype.StartSelection = function(X, Y, PageAbs, MouseEve
this
.
Selection
.
Start
=
oResult
;
this
.
Selection
.
Start
=
oResult
;
this
.
Selection
.
End
=
oResult
;
this
.
Selection
.
End
=
oResult
;
this
.
Selection
.
Start
.
Footnote
.
Selection_SetStart
(
X
,
Y
,
0
,
MouseEvent
);
this
.
Selection
.
Start
.
Footnote
.
Selection_SetStart
(
X
,
Y
,
this
.
Selection
.
Start
.
FootnotePageIndex
,
MouseEvent
);
this
.
CurFootnote
=
this
.
Selection
.
Start
.
Footnote
;
this
.
CurFootnote
=
this
.
Selection
.
Start
.
Footnote
;
...
@@ -687,16 +696,16 @@ CFootnotesController.prototype.EndSelection = function(X, Y, PageAbs, MouseEvent
...
@@ -687,16 +696,16 @@ CFootnotesController.prototype.EndSelection = function(X, Y, PageAbs, MouseEvent
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
.
Index
>
this
.
Selection
.
End
.
Index
)
{
{
this
.
Selection
.
Start
.
Footnote
.
Selection_SetEnd
(
-
MEASUREMENT_MAX_MM_VALUE
,
-
MEASUREMENT_MAX_MM_VALUE
,
0
,
MouseEvent
);
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
,
0
,
MouseEvent
);
this
.
Selection
.
End
.
Footnote
.
Selection_SetStart
(
MEASUREMENT_MAX_MM_VALUE
,
MEASUREMENT_MAX_MM_VALUE
,
this
.
Selection
.
End
.
Footnote
.
Pages
.
length
-
1
,
MouseEvent
);
this
.
Selection
.
Direction
=
-
1
;
this
.
Selection
.
Direction
=
-
1
;
}
}
else
else
{
{
this
.
Selection
.
Start
.
Footnote
.
Selection_SetEnd
(
MEASUREMENT_MAX_MM_VALUE
,
MEASUREMENT_MAX_MM_VALUE
,
0
,
MouseEvent
);
this
.
Selection
.
Start
.
Footnote
.
Selection_SetEnd
(
MEASUREMENT_MAX_MM_VALUE
,
MEASUREMENT_MAX_MM_VALUE
,
this
.
Selection
.
Start
.
Footnote
.
Pages
.
length
-
1
,
MouseEvent
);
this
.
Selection
.
End
.
Footnote
.
Selection_SetStart
(
-
MEASUREMENT_MAX_MM_VALUE
,
-
MEASUREMENT_MAX_MM_VALUE
,
0
,
MouseEvent
);
this
.
Selection
.
End
.
Footnote
.
Selection_SetStart
(
-
MEASUREMENT_MAX_MM_VALUE
,
-
MEASUREMENT_MAX_MM_VALUE
,
0
,
MouseEvent
);
this
.
Selection
.
Direction
=
1
;
this
.
Selection
.
Direction
=
1
;
}
}
this
.
Selection
.
End
.
Footnote
.
Selection_SetEnd
(
X
,
Y
,
0
,
MouseEvent
);
this
.
Selection
.
End
.
Footnote
.
Selection_SetEnd
(
X
,
Y
,
this
.
Selection
.
End
.
FootnotePageIndex
,
MouseEvent
);
var
oRange
=
this
.
private_GetFootnotesRange
(
this
.
Selection
.
Start
,
this
.
Selection
.
End
);
var
oRange
=
this
.
private_GetFootnotesRange
(
this
.
Selection
.
Start
,
this
.
Selection
.
End
);
for
(
var
sFootnoteId
in
oRange
)
for
(
var
sFootnoteId
in
oRange
)
...
@@ -711,7 +720,7 @@ CFootnotesController.prototype.EndSelection = function(X, Y, PageAbs, MouseEvent
...
@@ -711,7 +720,7 @@ CFootnotesController.prototype.EndSelection = function(X, Y, PageAbs, MouseEvent
}
}
else
else
{
{
this
.
Selection
.
End
.
Footnote
.
Selection_SetEnd
(
X
,
Y
,
0
,
MouseEvent
);
this
.
Selection
.
End
.
Footnote
.
Selection_SetEnd
(
X
,
Y
,
this
.
Selection
.
End
.
FootnotePageIndex
,
MouseEvent
);
this
.
Selection
.
Footnotes
=
{};
this
.
Selection
.
Footnotes
=
{};
this
.
Selection
.
Footnotes
[
this
.
Selection
.
Start
.
Footnote
.
Get_Id
()]
=
this
.
Selection
.
Start
.
Footnote
;
this
.
Selection
.
Footnotes
[
this
.
Selection
.
Start
.
Footnote
.
Get_Id
()]
=
this
.
Selection
.
Start
.
Footnote
;
this
.
Selection
.
Direction
=
0
;
this
.
Selection
.
Direction
=
0
;
...
...
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