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
f0a6e378
Commit
f0a6e378
authored
May 17, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented bounding path around the CInlineLevelSdt.
parent
7f04d9bc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
27 deletions
+37
-27
common/HistoryCommon.js
common/HistoryCommon.js
+1
-0
common/TableId.js
common/TableId.js
+1
-0
word/Editor/Document.js
word/Editor/Document.js
+6
-2
word/Editor/StructuredDocumentTags/InlineLevel.js
word/Editor/StructuredDocumentTags/InlineLevel.js
+29
-25
No files found.
common/HistoryCommon.js
View file @
f0a6e378
...
...
@@ -1104,6 +1104,7 @@
window
[
'
AscDFH
'
].
historyitem_type_Presentation
=
58
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_BlockLevelSdt
=
59
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_SdtPr
=
60
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_InlineLevelSdt
=
61
<<
16
;
window
[
'
AscDFH
'
].
historyitem_type_CommonShape
=
1000
<<
16
;
// Этот класс добавлен для элементов, у которых нет конкретного класса
...
...
common/TableId.js
View file @
f0a6e378
...
...
@@ -262,6 +262,7 @@
this
.
m_oFactoryClass
[
AscDFH
.
historyitem_type_deg_subsup
]
=
AscCommonWord
.
CDegreeSubSup
;
this
.
m_oFactoryClass
[
AscDFH
.
historyitem_type_deg
]
=
AscCommonWord
.
CDegree
;
this
.
m_oFactoryClass
[
AscDFH
.
historyitem_type_BlockLevelSdt
]
=
AscCommonWord
.
CBlockLevelSdt
;
this
.
m_oFactoryClass
[
AscDFH
.
historyitem_type_InlineLevelSdt
]
=
AscCommonWord
.
CInlineLevelSdt
;
if
(
window
[
'
AscCommonSlide
'
])
...
...
word/Editor/Document.js
View file @
f0a6e378
...
...
@@ -8138,8 +8138,12 @@ CDocument.prototype.private_UpdateTracks = function(bSelection, bEmptySelection)
else
this
.
DrawingDocument
.
Update_MathTrack
(
false
);
var
oBlockLevelSdt
=
oSelectedInfo
.
GetBlockLevelSdt
();
if
(
oBlockLevelSdt
)
var
oBlockLevelSdt
=
oSelectedInfo
.
GetBlockLevelSdt
();
var
oInlineLevelSdt
=
oSelectedInfo
.
GetInlineLevelSdt
();
if
(
oInlineLevelSdt
)
oInlineLevelSdt
.
DrawContentControlsTrack
(
false
);
else
if
(
oBlockLevelSdt
)
oBlockLevelSdt
.
DrawContentControlsTrack
(
false
);
else
this
.
DrawingDocument
.
OnDrawContentControl
(
null
,
c_oContentControlTrack
.
In
);
...
...
word/Editor/StructuredDocumentTags/InlineLevel.js
View file @
f0a6e378
...
...
@@ -48,7 +48,7 @@ function CInlineLevelSdt()
this
.
Pr
=
new
CSdtPr
();
this
.
Type
=
para_InlineLevelSdt
;
this
.
BoundsPath
=
[]
;
this
.
BoundsPath
s
=
null
;
// Добавляем данный класс в таблицу Id (обязательно в конце конструктора)
g_oTableId
.
Add
(
this
,
this
.
Id
);
...
...
@@ -198,9 +198,10 @@ CInlineLevelSdt.prototype.Recalculate_Range_Spaces = function(PRSA, _CurLine, _C
if
(
0
===
CurLine
&&
0
===
CurRange
&&
true
!==
PRSA
.
RecalcFast
)
this
.
Bounds
=
{};
var
X0
=
PRSA
.
X
;
var
Y0
=
PRSA
.
Y0
;
var
Y1
=
PRSA
.
Y1
;
var
oParagraph
=
PRSA
.
Paragraph
;
var
Y0
=
oParagraph
.
Lines
[
_CurLine
].
Top
+
oParagraph
.
Pages
[
_CurPage
].
Y
;
var
Y1
=
oParagraph
.
Lines
[
_CurLine
].
Bottom
+
oParagraph
.
Pages
[
_CurPage
].
Y
;
var
X0
=
PRSA
.
X
;
CParagraphContentWithParagraphLikeContent
.
prototype
.
Recalculate_Range_Spaces
.
apply
(
this
,
arguments
);
...
...
@@ -214,8 +215,7 @@ CInlineLevelSdt.prototype.Recalculate_Range_Spaces = function(PRSA, _CurLine, _C
Page
:
PRSA
.
Paragraph
.
Get_AbsolutePage
(
_CurPage
)
};
this
.
BoundsPath
[
_CurPage
]
=
null
;
this
.
BoundsPath
.
length
=
_CurPage
;
this
.
BoundsPath
=
null
;
};
CInlineLevelSdt
.
prototype
.
Get_LeftPos
=
function
(
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
)
{
...
...
@@ -324,30 +324,30 @@ CInlineLevelSdt.prototype.Get_WordEndPos = function(SearchPos, ContentPos, Depth
};
CInlineLevelSdt
.
prototype
.
GetBoundingPolygon
=
function
()
{
var
arrRects
=
[];
for
(
var
Key
in
this
.
Bounds
)
if
(
null
===
this
.
BoundsPaths
)
{
arrRects
.
push
(
this
.
Bounds
[
Key
]);
}
var
arrRects
=
[];
for
(
var
Key
in
this
.
Bounds
)
{
arrRects
.
push
(
this
.
Bounds
[
Key
]);
}
var
oPolygon
=
new
CPolygon
();
oPolygon
.
fill
([
arrRects
]);
var
oPolygon
=
new
CPolygon
();
oPolygon
.
fill
([
arrRects
]);
return
oPolygon
.
GetPaths
(
0
);
};
CInlineLevelSdt
.
prototype
.
DrawBoundingPolygon
=
function
(
pGraphics
,
arrPaths
)
{
pGraphics
.
p_color
(
255
,
0
,
0
,
255
);
for
(
var
nIndex
=
0
,
nCount
=
arrPaths
.
length
;
nIndex
<
nCount
;
++
nIndex
)
{
pGraphics
.
DrawPolygon
(
arrPaths
[
nIndex
],
1
,
0
);
this
.
BoundsPaths
=
oPolygon
.
GetPaths
(
0
);
}
return
this
.
BoundsPaths
;
};
CInlineLevelSdt
.
prototype
.
Draw
_Lines
=
function
(
PDSL
)
CInlineLevelSdt
.
prototype
.
Draw
ContentControlsTrack
=
function
(
isHover
)
{
CParagraphContentWithParagraphLikeContent
.
prototype
.
Draw_Lines
.
apply
(
this
,
arguments
);
if
(
!
this
.
Paragraph
)
return
;
this
.
DrawBoundingPolygon
(
PDSL
.
Graphics
,
this
.
GetBoundingPolygon
());
var
oDrawingDocument
=
this
.
Paragraph
.
Get_DrawingDocument
();
oDrawingDocument
.
OnDrawContentControl
(
this
.
GetId
(),
isHover
?
c_oContentControlTrack
.
Hover
:
c_oContentControlTrack
.
In
,
this
.
GetBoundingPolygon
(),
this
.
Get_ParentTextTransform
());
};
//----------------------------------------------------------------------------------------------------------------------
// Выставление настроек
...
...
@@ -424,7 +424,7 @@ CInlineLevelSdt.prototype.GetContentControlLock = function()
//----------------------------------------------------------------------------------------------------------------------
CInlineLevelSdt
.
prototype
.
Write_ToBinary2
=
function
(
Writer
)
{
Writer
.
WriteLong
(
AscDFH
.
historyitem_type_
Field
);
Writer
.
WriteLong
(
AscDFH
.
historyitem_type_
InlineLevelSdt
);
// String : Id
// Long : Количество элементов
...
...
@@ -469,6 +469,9 @@ CInlineLevelSdt.prototype.UpdatePath = function(CurPage, oPath)
{
this
.
BoundsPath
[
CurPage
]
=
oPath
;
};
//--------------------------------------------------------export--------------------------------------------------------
window
[
'
AscCommonWord
'
]
=
window
[
'
AscCommonWord
'
]
||
{};
window
[
'
AscCommonWord
'
].
CInlineLevelSdt
=
CInlineLevelSdt
;
function
TEST_ADD_SDT
()
{
...
...
@@ -485,7 +488,8 @@ function TEST_ADD_SDT()
oInlineContentControl
.
Add_ToContent
(
0
,
oRun
);
var
oPara
=
oLogicDocument
.
GetCurrentParagraph
();
oPara
.
Add_ToContent
(
0
,
oInlineContentControl
);
oPara
.
Add_ToContent
(
0
,
new
ParaRun
());
oPara
.
Add_ToContent
(
1
,
oInlineContentControl
);
oLogicDocument
.
Recalculate
();
...
...
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