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
63788267
Commit
63788267
authored
Mar 24, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug #34380
parent
2226d75a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
52 deletions
+93
-52
word/Editor/DocumentContent.js
word/Editor/DocumentContent.js
+54
-50
word/Editor/Footnotes.js
word/Editor/Footnotes.js
+39
-2
No files found.
word/Editor/DocumentContent.js
View file @
63788267
...
...
@@ -1370,65 +1370,69 @@ 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
(
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
;
// В колонтитуле не учитывается.
if
(
true
!=
this
.
Is_HdrFtr
(
false
)
||
true
===
bForceCheckDrawings
)
{
// Учитываем все Drawing-объекты с обтеканием. Объекты без обтекания (над и под текстом) учитываем только в
// случае, когда начальная точка (левый верхний угол) попадает в this.Y + Height
var
Bounds
=
this
.
Pages
[
CurPage
].
Bounds
;
var
PageAbs
=
this
.
Get_AbsolutePage
(
CurPage
);
var
AllDrawingObjects
=
this
.
Get_AllDrawingObjects
();
var
Count
=
AllDrawingObjects
.
length
;
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
{
var
Obj
=
AllDrawingObjects
[
Index
];
if
(
PageNumAbs
===
Obj
.
Get_PageNum
())
{
var
ObjBounds
=
Obj
.
Get_Bounds
();
if
(
true
===
Obj
.
Use_TextWrap
())
{
if
(
ObjBounds
.
Bottom
>
Bounds
.
Bottom
)
Bounds
.
Bottom
=
ObjBounds
.
Bottom
;
}
else
if
(
undefined
!==
Height
&&
ObjBounds
.
Top
<
this
.
Y
+
Height
)
{
if
(
ObjBounds
.
Bottom
>=
this
.
Y
+
Height
)
Bounds
.
Bottom
=
this
.
Y
+
Height
;
else
if
(
ObjBounds
.
Bottom
>
Bounds
.
Bottom
)
Bounds
.
Bottom
=
ObjBounds
.
Bottom
;
}
}
}
// В колонтитуле не учитывается.
if
(
true
!=
this
.
Is_HdrFtr
(
false
)
||
true
===
bForceCheckDrawings
)
{
// Учитываем все Drawing-объекты с обтеканием. Объекты без обтекания (над и под текстом) учитываем только в
// случае, когда начальная точка (левый верхний угол) попадает в this.Y + Height
// Кроме этого пробежимся по всем Flow-таблицам и учтем их границы
var
Count
=
this
.
Content
.
length
;
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
TableBounds
=
Element
.
Get_PageBounds
(
PageNum
-
Element
.
PageNum
);
if
(
TableBounds
.
Bottom
>
Bounds
.
Bottom
)
Bounds
.
Bottom
=
TableBounds
.
Bottom
;
}
}
}
var
AllDrawingObjects
=
this
.
Get_AllDrawingObjects
();
var
Count
=
AllDrawingObjects
.
length
;
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
{
var
Obj
=
AllDrawingObjects
[
Index
];
if
(
PageAbs
===
Obj
.
Get_PageNum
())
{
var
ObjBounds
=
Obj
.
Get_Bounds
();
if
(
true
===
Obj
.
Use_TextWrap
())
{
if
(
ObjBounds
.
Bottom
>
Bounds
.
Bottom
)
Bounds
.
Bottom
=
ObjBounds
.
Bottom
;
}
else
if
(
undefined
!==
Height
&&
ObjBounds
.
Top
<
this
.
Y
+
Height
)
{
if
(
ObjBounds
.
Bottom
>=
this
.
Y
+
Height
)
Bounds
.
Bottom
=
this
.
Y
+
Height
;
else
if
(
ObjBounds
.
Bottom
>
Bounds
.
Bottom
)
Bounds
.
Bottom
=
ObjBounds
.
Bottom
;
}
}
}
// Кроме этого пробежимся по всем Flow-таблицам и учтем их границы
var
Count
=
this
.
Content
.
length
;
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
{
var
Element
=
this
.
Content
[
Index
];
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
(
ElementPageIndex
);
if
(
TableBounds
.
Bottom
>
Bounds
.
Bottom
)
Bounds
.
Bottom
=
TableBounds
.
Bottom
;
}
}
}
return
Bounds
;
return
Bounds
;
};
CDocumentContent
.
prototype
.
Get_PagesCount
=
function
()
CDocumentContent
.
prototype
.
Get_PagesCount
=
function
()
{
return
this
.
Pages
.
length
;
return
this
.
Pages
.
length
;
};
CDocumentContent
.
prototype
.
Get_SummaryHeight
=
function
()
{
...
...
word/Editor/Footnotes.js
View file @
63788267
...
...
@@ -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
;
...
...
@@ -1112,7 +1149,7 @@ CFootnotesController.prototype.private_GetFootnoteOnPageByXY = function(X, Y, nP
var
oFootnote
=
oColumn
.
Elements
[
nIndex
];
var
nElementPageIndex
=
oFootnote
.
GetElementPageIndex
(
nPageAbs
,
nColumnIndex
);
var
oBounds
=
oFootnote
.
Get_PageBounds
(
nElementPageIndex
);
var
oBounds
=
oFootnote
.
Get_PageBounds
(
nElementPageIndex
);
if
(
oBounds
.
Top
<=
Y
||
0
===
nIndex
)
return
{
...
...
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