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
97718524
Commit
97718524
authored
Apr 07, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keeping implementing of a new class CBlockLevelSdt.
parent
3e299227
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
98 additions
and
12 deletions
+98
-12
word/Editor/DocumentContent.js
word/Editor/DocumentContent.js
+16
-10
word/Editor/DocumentContentElementBase.js
word/Editor/DocumentContentElementBase.js
+32
-0
word/Editor/StructuredDocumentTags/BlockLevel.js
word/Editor/StructuredDocumentTags/BlockLevel.js
+50
-2
No files found.
word/Editor/DocumentContent.js
View file @
97718524
...
...
@@ -1667,18 +1667,24 @@ CDocumentContent.prototype.Is_InDrawing = function(X, Y, CurPag
return
false
;
}
};
CDocumentContent
.
prototype
.
Get_CurrentPage_Absolute
=
function
()
CDocumentContent
.
prototype
.
Get_CurrentPage_Absolute
=
function
()
{
if
(
docpostype_DrawingObjects
==
this
.
CurPos
.
Type
)
return
this
.
LogicDocument
.
DrawingObjects
.
getCurrentPageAbsolute
();
else
//if ( docpostype_Content === this.CurPos.Type )
{
var
Pos
=
(
true
===
this
.
Selection
.
Use
&&
selectionflag_Numbering
!==
this
.
Selection
.
Flag
?
this
.
Selection
.
EndPos
:
this
.
CurPos
.
ContentPos
);
if
(
Pos
>=
0
&&
Pos
<
this
.
Content
.
length
)
return
this
.
Content
[
Pos
].
Get_CurrentPage_Absolute
();
}
if
(
docpostype_DrawingObjects
==
this
.
CurPos
.
Type
)
{
return
this
.
LogicDocument
.
DrawingObjects
.
getCurrentPageAbsolute
();
}
else
//if ( docpostype_Content === this.CurPos.Type )
{
var
Pos
=
(
true
===
this
.
Selection
.
Use
&&
selectionflag_Numbering
!==
this
.
Selection
.
Flag
?
this
.
Selection
.
EndPos
:
this
.
CurPos
.
ContentPos
);
if
(
Pos
>=
0
&&
Pos
<
this
.
Content
.
length
)
return
this
.
Content
[
Pos
].
Get_CurrentPage_Absolute
();
}
return
0
;
return
0
;
};
CDocumentContent
.
prototype
.
Get_CurrentPage_Relative
=
function
()
{
return
this
.
CurPage
;
};
CDocumentContent
.
prototype
.
DocumentStatistics
=
function
(
Stats
)
{
...
...
word/Editor/DocumentContentElementBase.js
View file @
97718524
...
...
@@ -149,6 +149,30 @@ CDocumentContentElementBase.prototype.Get_PagesCount = function()
CDocumentContentElementBase
.
prototype
.
Document_CreateFontMap
=
function
(
FontMap
)
{
};
CDocumentContentElementBase
.
prototype
.
Is_InText
=
function
(
X
,
Y
,
CurPage
)
{
return
false
;
};
CDocumentContentElementBase
.
prototype
.
Update_CursorType
=
function
(
X
,
Y
,
CurPage
)
{
};
CDocumentContentElementBase
.
prototype
.
Selection_SetStart
=
function
(
X
,
Y
,
CurPage
,
MouseEvent
,
isTableBorder
)
{
};
CDocumentContentElementBase
.
prototype
.
Selection_SetEnd
=
function
(
X
,
Y
,
CurPage
,
MouseEvent
,
isTableBorder
)
{
};
CDocumentContentElementBase
.
prototype
.
Selection_IsEmpty
=
function
(
isCheckHidden
)
{
return
true
;
};
CDocumentContentElementBase
.
prototype
.
Get_SelectedElementsInfo
=
function
(
oInfo
)
{
};
CDocumentContentElementBase
.
prototype
.
Document_UpdateRulersState
=
function
(
CurPage
)
{
this
.
Content
.
Document_UpdateRulersState
(
CurPage
);
};
//----------------------------------------------------------------------------------------------------------------------
// Функции для работы с номерами страниц
//----------------------------------------------------------------------------------------------------------------------
...
...
@@ -194,6 +218,14 @@ CDocumentContentElementBase.prototype.private_GetColumnIndex = function(CurPage)
{
return
(
this
.
ColumnNum
+
CurPage
)
-
(((
this
.
ColumnNum
+
CurPage
)
/
this
.
ColumnsCount
|
0
)
*
this
.
ColumnsCount
);
};
CDocumentContentElementBase
.
prototype
.
Get_CurrentPage_Absolute
=
function
()
{
return
this
.
private_GetAbsolutePageIndex
(
0
);
};
CDocumentContentElementBase
.
prototype
.
Get_CurrentPage_Relative
=
function
()
{
return
this
.
private_GetRelativePageIndex
(
0
);
};
//----------------------------------------------------------------------------------------------------------------------
CDocumentContentElementBase
.
prototype
.
GetPagesCount
=
function
()
{
...
...
word/Editor/StructuredDocumentTags/BlockLevel.js
View file @
97718524
...
...
@@ -84,7 +84,12 @@ CBlockLevelSdt.prototype.Recalculate_Page = function(CurPage)
{
var
RecalcResult
=
this
.
Content
.
Recalculate_Page
(
CurPage
,
true
);
return
RecalcResult
;
if
(
recalcresult2_End
===
RecalcResult
)
return
recalcresult_NextElement
;
else
if
(
recalcresult2_NextPage
===
RecalcResult
)
return
recalcresult_NextPage
;
else
if
(
recalcresult2_CurPage
===
RecalcResult
)
return
recalcresult_CurPage
;
};
CBlockLevelSdt
.
prototype
.
Get_PageBounds
=
function
(
CurPage
)
{
...
...
@@ -118,6 +123,42 @@ CBlockLevelSdt.prototype.Draw = function(CurPage, oGraphics)
{
this
.
Content
.
Draw
(
CurPage
,
oGraphics
);
};
CBlockLevelSdt
.
prototype
.
Get_CurrentPage_Absolute
=
function
()
{
return
this
.
Content
.
Get_CurrentPage_Absolute
();
};
CBlockLevelSdt
.
prototype
.
Get_CurrentPage_Relative
=
function
()
{
return
this
.
Content
.
Get_CurrentPage_Relative
();
};
CBlockLevelSdt
.
prototype
.
Is_InText
=
function
(
X
,
Y
,
CurPage
)
{
return
this
.
Content
.
Is_InText
(
X
,
Y
,
CurPage
);
};
CBlockLevelSdt
.
prototype
.
Update_CursorType
=
function
(
X
,
Y
,
CurPage
)
{
return
this
.
Content
.
Update_CursorType
(
X
,
Y
,
CurPage
);
};
CBlockLevelSdt
.
prototype
.
Selection_SetStart
=
function
(
X
,
Y
,
CurPage
,
MouseEvent
,
isTableBorder
)
{
this
.
Content
.
Selection_SetStart
(
X
,
Y
,
CurPage
,
MouseEvent
,
isTableBorder
);
};
CBlockLevelSdt
.
prototype
.
Selection_SetEnd
=
function
(
X
,
Y
,
CurPage
,
MouseEvent
,
isTableBorder
)
{
this
.
Content
.
Selection_SetEnd
(
X
,
Y
,
CurPage
,
MouseEvent
,
isTableBorder
);
};
CBlockLevelSdt
.
prototype
.
Selection_IsEmpty
=
function
(
isCheckHidden
)
{
return
this
.
Content
.
Selection_IsEmpty
(
isCheckHidden
);
};
CBlockLevelSdt
.
prototype
.
Get_SelectedElementsInfo
=
function
(
oInfo
)
{
this
.
Content
.
Get_SelectedElementsInfo
(
oInfo
);
};
CBlockLevelSdt
.
prototype
.
Document_UpdateRulersState
=
function
(
CurPage
)
{
this
.
Content
.
Document_UpdateRulersState
(
CurPage
);
};
//----------------------------------------------------------------------------------------------------------------------
CBlockLevelSdt
.
prototype
.
Is_HdrFtr
=
function
(
bReturnHdrFtr
)
{
...
...
@@ -185,10 +226,14 @@ CBlockLevelSdt.prototype.OnContentReDraw = function(StartPageAbs, EndPageAbs)
{
this
.
Parent
.
OnContentReDraw
(
StartPageAbs
,
EndPageAbs
);
};
C
DocumentContentElementBase
.
prototype
.
Document_CreateFontMap
=
function
(
FontMap
)
C
BlockLevelSdt
.
prototype
.
Document_CreateFontMap
=
function
(
FontMap
)
{
this
.
Content
.
Document_CreateFontMap
(
FontMap
);
};
CBlockLevelSdt
.
prototype
.
Get_ParentTextTransform
=
function
()
{
return
this
.
Parent
.
Get_ParentTextTransform
();
};
//--------------------------------------------------------export--------------------------------------------------------
window
[
'
AscCommonWord
'
]
=
window
[
'
AscCommonWord
'
]
||
{};
window
[
'
AscCommonWord
'
].
CBlockLevelSdt
=
CBlockLevelSdt
;
...
...
@@ -199,6 +244,9 @@ function TEST_ADD_SDT()
{
var
oLogicDocument
=
editor
.
WordControl
.
m_oLogicDocument
;
var
oSdt
=
new
CBlockLevelSdt
(
oLogicDocument
,
oLogicDocument
);
oSdt
.
Content
.
Paragraph_Add
(
new
ParaText
(
"
S
"
));
oSdt
.
Content
.
Paragraph_Add
(
new
ParaText
(
"
d
"
));
oSdt
.
Content
.
Paragraph_Add
(
new
ParaText
(
"
t
"
));
oLogicDocument
.
Internal_Content_Add
(
1
,
oSdt
);
oLogicDocument
.
Recalculate_FromStart
();
...
...
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