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
fe07d8b5
Commit
fe07d8b5
authored
May 23, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed problem with bounding rectangle around a block level content control.
parent
09f46ed7
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
82 additions
and
1 deletion
+82
-1
word/Editor/DocumentContent.js
word/Editor/DocumentContent.js
+32
-0
word/Editor/DocumentContentElementBase.js
word/Editor/DocumentContentElementBase.js
+4
-0
word/Editor/Paragraph.js
word/Editor/Paragraph.js
+37
-0
word/Editor/StructuredDocumentTags/BlockLevel.js
word/Editor/StructuredDocumentTags/BlockLevel.js
+5
-1
word/Editor/Table.js
word/Editor/Table.js
+4
-0
No files found.
word/Editor/DocumentContent.js
View file @
fe07d8b5
...
...
@@ -1395,6 +1395,38 @@ CDocumentContent.prototype.Get_PageBounds = function(CurPage, Height, bForceChec
return
Bounds
;
};
CDocumentContent
.
prototype
.
GetContentBounds
=
function
(
CurPage
)
{
var
oBounds
=
this
.
Get_PageBounds
(
CurPage
);
var
oPage
=
this
.
Pages
[
CurPage
];
if
(
!
oPage
)
return
oBounds
;
this
.
Pos
=
0
;
this
.
EndPos
=
-
1
;
for
(
var
nIndex
=
oPage
.
Pos
;
nIndex
<=
oPage
.
EndPos
;
++
nIndex
)
{
var
oElement
=
this
.
Content
[
nIndex
];
var
nElementPageIndex
=
this
.
private_GetElementPageIndex
(
nIndex
,
CurPage
,
0
,
1
);
var
oElementBounds
=
oElement
.
GetContentBounds
(
nElementPageIndex
);
if
(
oElementBounds
.
Bottom
>
oBounds
.
Bottom
)
oBounds
.
Bottom
=
oElementBounds
.
Bottom
;
if
(
oElementBounds
.
Top
<
oBounds
.
Top
)
oBounds
.
Top
=
oElementBounds
.
Top
;
if
(
oElementBounds
.
Right
>
oBounds
.
Right
)
oBounds
.
Right
=
oElementBounds
.
Right
;
if
(
oElementBounds
.
Left
<
oBounds
.
Left
)
oBounds
.
Left
=
oElementBounds
.
Left
;
}
return
oBounds
;
};
CDocumentContent
.
prototype
.
Get_PagesCount
=
function
()
{
return
this
.
Pages
.
length
;
...
...
word/Editor/DocumentContentElementBase.js
View file @
fe07d8b5
...
...
@@ -128,6 +128,10 @@ CDocumentContentElementBase.prototype.Get_PageBounds = function(CurPage)
{
return
new
CDocumentBounds
(
this
.
X
,
this
.
Y
,
this
.
XLimit
,
this
.
YLimit
);
};
CDocumentContentElementBase
.
prototype
.
GetContentBounds
=
function
(
CurPage
)
{
return
new
CDocumentBounds
(
this
.
X
,
this
.
Y
,
this
.
XLimit
,
this
.
YLimit
);
};
CDocumentContentElementBase
.
prototype
.
Is_EmptyPage
=
function
(
CurPage
)
{
return
false
;
...
...
word/Editor/Paragraph.js
View file @
fe07d8b5
...
...
@@ -414,6 +414,39 @@ Paragraph.prototype.Get_PageBounds = function(CurPage)
{
return
this
.
Pages
[
CurPage
].
Bounds
;
};
Paragraph
.
prototype
.
GetContentBounds
=
function
(
CurPage
)
{
var
oBounds
=
this
.
Get_PageBounds
(
CurPage
).
Copy
();
var
oPage
=
this
.
Pages
[
CurPage
];
if
(
!
oPage
)
return
oBounds
;
for
(
var
CurLine
=
oPage
.
StartLine
;
CurLine
<=
oPage
.
EndLine
;
++
CurLine
)
{
var
oLine
=
this
.
Lines
[
CurLine
];
var
Top
=
oLine
.
Top
+
oPage
.
Y
;
if
(
oBounds
.
Top
>
Top
)
oBounds
.
Top
=
Top
;
var
Bottom
=
oLine
.
Bottom
+
oPage
.
Y
;
if
(
oBounds
.
Bottom
<
Bottom
)
oBounds
.
Bottom
=
Bottom
;
for
(
var
CurRange
=
0
,
RangesCount
=
oLine
.
Ranges
.
length
;
CurRange
<
RangesCount
;
++
CurRange
)
{
var
oRange
=
oLine
.
Ranges
[
CurRange
];
if
(
oBounds
.
Left
>
oRange
.
X
)
oBounds
.
Left
=
oRange
.
X
;
if
(
oBounds
.
Right
<
oRange
.
XEnd
)
oBounds
.
Right
=
oRange
.
XEnd
;
}
}
return
oBounds
;
};
Paragraph
.
prototype
.
Get_EmptyHeight
=
function
()
{
var
Pr
=
this
.
Get_CompiledPr
();
...
...
@@ -12137,6 +12170,10 @@ CDocumentBounds.prototype.Reset = function()
this
.
Right
=
0
;
this
.
Top
=
0
;
};
CDocumentBounds
.
prototype
.
Copy
=
function
()
{
return
new
CDocumentBounds
(
this
.
Left
,
this
.
Top
,
this
.
Right
,
this
.
Bottom
);
};
function
CParagraphPageEndInfo
()
{
...
...
word/Editor/StructuredDocumentTags/BlockLevel.js
View file @
fe07d8b5
...
...
@@ -105,6 +105,10 @@ CBlockLevelSdt.prototype.Get_PageBounds = function(CurPage)
{
return
this
.
Content
.
Get_PageBounds
(
CurPage
);
};
CBlockLevelSdt
.
prototype
.
GetContentBounds
=
function
(
CurPage
)
{
return
this
.
Content
.
GetContentBounds
(
CurPage
);
};
CBlockLevelSdt
.
prototype
.
Is_EmptyPage
=
function
(
CurPage
)
{
// TODO: Реализовать
...
...
@@ -596,7 +600,7 @@ CBlockLevelSdt.prototype.DrawContentControlsTrack = function(isHover)
for
(
var
nCurPage
=
0
,
nPagesCount
=
this
.
GetPagesCount
();
nCurPage
<
nPagesCount
;
++
nCurPage
)
{
var
nPageAbs
=
this
.
Get_AbsolutePage
(
nCurPage
);
var
oBounds
=
this
.
GetPage
Bounds
(
nCurPage
);
var
oBounds
=
this
.
Content
.
GetContent
Bounds
(
nCurPage
);
arrRects
.
push
({
X
:
oBounds
.
Left
,
Y
:
oBounds
.
Top
,
R
:
oBounds
.
Right
,
B
:
oBounds
.
Bottom
,
Page
:
nPageAbs
});
}
...
...
word/Editor/Table.js
View file @
fe07d8b5
...
...
@@ -2061,6 +2061,10 @@ CTable.prototype.Get_PageBounds = function(CurPage)
{
return
this
.
Pages
[
CurPage
].
Bounds
;
};
CTable
.
prototype
.
GetContentBounds
=
function
(
CurPage
)
{
return
this
.
Get_PageBounds
(
CurPage
);
};
CTable
.
prototype
.
Get_PagesCount
=
function
()
{
return
this
.
Pages
.
length
;
...
...
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