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
67d5f0df
Commit
67d5f0df
authored
Apr 12, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implementing several functions of the CBlockLevelSdt class.
parent
68673581
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
410 additions
and
375 deletions
+410
-375
word/Editor/Document.js
word/Editor/Document.js
+17
-33
word/Editor/DocumentContent.js
word/Editor/DocumentContent.js
+296
-337
word/Editor/DocumentContentElementBase.js
word/Editor/DocumentContentElementBase.js
+58
-0
word/Editor/Paragraph.js
word/Editor/Paragraph.js
+15
-5
word/Editor/StructuredDocumentTags/BlockLevel.js
word/Editor/StructuredDocumentTags/BlockLevel.js
+24
-0
No files found.
word/Editor/Document.js
View file @
67d5f0df
...
...
@@ -8357,7 +8357,7 @@ CDocument.prototype.Can_CopyCut = function()
{
if
(
selectionflag_Numbering
===
LogicDocument
.
Selection
.
Flag
)
bCanCopyCut
=
false
;
else
if
(
LogicDocument
.
Selection
.
StartPos
!==
LogicDocument
.
Selection
.
EndPos
||
type_Paragraph
===
LogicDocument
.
Content
[
LogicDocument
.
Selection
.
StartPos
].
Get_Type
()
)
else
if
(
LogicDocument
.
Selection
.
StartPos
!==
LogicDocument
.
Selection
.
EndPos
)
bCanCopyCut
=
true
;
else
bCanCopyCut
=
LogicDocument
.
Content
[
LogicDocument
.
Selection
.
StartPos
].
Can_CopyCut
();
...
...
@@ -14729,35 +14729,14 @@ CDocument.prototype.controller_GetCurrentParaPr = function()
EndPos
=
Temp
;
}
var
StartPr
,
Pr
;
if
(
type_Paragraph
==
this
.
Content
[
StartPos
].
GetType
())
{
StartPr
=
this
.
Content
[
StartPos
].
Get_CompiledPr2
(
false
).
ParaPr
;
Pr
=
StartPr
.
Copy
();
Pr
.
Locked
=
this
.
Content
[
StartPos
].
Lock
.
Is_Locked
();
}
else
if
(
type_Table
==
this
.
Content
[
StartPos
].
GetType
())
{
StartPr
=
this
.
Content
[
StartPos
].
Get_Paragraph_ParaPr
();
Pr
=
StartPr
.
Copy
();
var
StartPr
=
this
.
Content
[
StartPos
].
GetParagraphParaPr
();
var
Pr
=
StartPr
.
Copy
();
Pr
.
Locked
=
StartPr
.
Locked
;
}
for
(
var
Index
=
StartPos
+
1
;
Index
<=
EndPos
;
Index
++
)
{
var
Item
=
this
.
Content
[
Index
];
var
TempPr
;
if
(
type_Paragraph
==
Item
.
GetType
())
{
TempPr
=
Item
.
Get_CompiledPr2
(
false
).
ParaPr
;
TempPr
.
Locked
=
Item
.
Lock
.
Is_Locked
();
}
else
if
(
type_Table
==
Item
.
GetType
())
{
TempPr
=
Item
.
Get_Paragraph_ParaPr
();
}
var
TempPr
=
Item
.
GetParagraphParaPr
();
Pr
=
Pr
.
Compare
(
TempPr
);
}
...
...
@@ -14775,7 +14754,9 @@ CDocument.prototype.controller_GetCurrentParaPr = function()
// Если мы находимся в рамке, тогда дополняем ее свойства настройками границы и настройкой текста (если это буквица)
if
(
undefined
!=
Result_ParaPr
.
FramePr
&&
type_Paragraph
===
this
.
Content
[
StartPos
].
GetType
())
{
this
.
Content
[
StartPos
].
Supplement_FramePr
(
Result_ParaPr
.
FramePr
);
}
else
if
(
StartPos
===
EndPos
&&
StartPos
>
0
&&
type_Paragraph
===
this
.
Content
[
StartPos
-
1
].
GetType
())
{
var
PrevFrame
=
this
.
Content
[
StartPos
-
1
].
Get_FramePr
();
...
...
@@ -14801,7 +14782,9 @@ CDocument.prototype.controller_GetCurrentParaPr = function()
// Если мы находимся в рамке, тогда дополняем ее свойства настройками границы и настройкой текста (если это буквица)
if
(
undefined
!=
Result_ParaPr
.
FramePr
)
{
Item
.
Supplement_FramePr
(
Result_ParaPr
.
FramePr
);
}
else
if
(
this
.
CurPos
.
ContentPos
>
0
&&
type_Paragraph
===
this
.
Content
[
this
.
CurPos
.
ContentPos
-
1
].
GetType
())
{
var
PrevFrame
=
this
.
Content
[
this
.
CurPos
.
ContentPos
-
1
].
Get_FramePr
();
...
...
@@ -14811,17 +14794,18 @@ CDocument.prototype.controller_GetCurrentParaPr = function()
this
.
Content
[
this
.
CurPos
.
ContentPos
-
1
].
Supplement_FramePr
(
Result_ParaPr
.
FramePr
);
}
}
}
else
if
(
type_Table
==
Item
.
GetType
())
else
{
Result_ParaPr
=
Item
.
Get
_Paragraph_
ParaPr
();
Result_ParaPr
=
Item
.
Get
Paragraph
ParaPr
();
}
}
if
(
Result_ParaPr
.
Shd
&&
Result_ParaPr
.
Shd
.
Unifill
)
{
Result_ParaPr
.
Shd
.
Unifill
.
check
(
this
.
theme
,
this
.
Get_ColorMap
());
}
return
Result_ParaPr
;
};
CDocument
.
prototype
.
controller_GetCurrentTextPr
=
function
()
...
...
@@ -15176,7 +15160,7 @@ CDocument.prototype.controller_CheckPosInSelection = function(X, Y, PageAbs, Nea
{
for
(
var
Index
=
Start
;
Index
<=
End
;
Index
++
)
{
if
(
true
===
this
.
Content
[
Index
].
Selection_Check
(
0
,
0
,
0
,
NearPos
))
if
(
true
===
this
.
Content
[
Index
].
CheckPosInSelection
(
0
,
0
,
0
,
NearPos
))
return
true
;
}
...
...
@@ -15196,7 +15180,7 @@ CDocument.prototype.controller_CheckPosInSelection = function(X, Y, PageAbs, Nea
else
{
var
ElementPageIndex
=
this
.
private_GetElementPageIndexByXY
(
ContentPos
,
X
,
Y
,
PageAbs
);
return
this
.
Content
[
ContentPos
].
Selection_Check
(
X
,
Y
,
ElementPageIndex
,
undefined
);
return
this
.
Content
[
ContentPos
].
CheckPosInSelection
(
X
,
Y
,
ElementPageIndex
,
undefined
);
}
}
}
...
...
word/Editor/DocumentContent.js
View file @
67d5f0df
...
...
@@ -1857,7 +1857,7 @@ CDocumentContent.prototype.Can_CopyCut = function()
{
if
(
selectionflag_Numbering
===
LogicDocument
.
Selection
.
Flag
)
bCanCopyCut
=
false
;
else
if
(
LogicDocument
.
Selection
.
StartPos
!==
LogicDocument
.
Selection
.
EndPos
||
type_Paragraph
===
LogicDocument
.
Content
[
LogicDocument
.
Selection
.
StartPos
].
Get_Type
()
)
else
if
(
LogicDocument
.
Selection
.
StartPos
!==
LogicDocument
.
Selection
.
EndPos
)
bCanCopyCut
=
true
;
else
bCanCopyCut
=
LogicDocument
.
Content
[
LogicDocument
.
Selection
.
StartPos
].
Can_CopyCut
();
...
...
@@ -6653,35 +6653,13 @@ CDocumentContent.prototype.Get_Paragraph_ParaPr = function()
if
(
true
===
this
.
ApplyToAll
)
{
var
StartPr
,
Pr
;
if
(
type_Paragraph
==
this
.
Content
[
0
].
GetType
())
{
StartPr
=
this
.
Content
[
0
].
Get_CompiledPr2
().
ParaPr
;
Pr
=
StartPr
.
Copy
();
Pr
.
Locked
=
this
.
Content
[
0
].
Lock
.
Is_Locked
();
}
else
if
(
type_Table
==
this
.
Content
[
0
].
GetType
())
{
StartPr
=
this
.
Content
[
0
].
Get_Paragraph_ParaPr
();
Pr
=
StartPr
.
Copy
();
var
StartPr
=
this
.
Content
[
0
].
GetParagraphParaPr
();
var
Pr
=
StartPr
.
Copy
();
Pr
.
Locked
=
StartPr
.
Locked
;
}
for
(
var
Index
=
1
;
Index
<
this
.
Content
.
length
;
Index
++
)
{
var
Item
=
this
.
Content
[
Index
];
var
TempPr
;
if
(
type_Paragraph
==
Item
.
GetType
())
{
TempPr
=
Item
.
Get_CompiledPr2
(
false
).
ParaPr
.
Copy
();
TempPr
.
Locked
=
Item
.
Lock
.
Is_Locked
();
}
else
if
(
type_Table
==
Item
.
GetType
())
{
TempPr
=
Item
.
Get_Paragraph_ParaPr
();
}
var
TempPr
=
this
.
Content
[
Index
].
GetParagraphParaPr
();
Pr
=
Pr
.
Compare
(
TempPr
);
}
...
...
@@ -6704,7 +6682,9 @@ CDocumentContent.prototype.Get_Paragraph_ParaPr = function()
}
if
(
docpostype_DrawingObjects
===
this
.
CurPos
.
Type
)
{
return
this
.
LogicDocument
.
DrawingObjects
.
getParagraphParaPr
();
}
else
//if ( docpostype_Content === this.CurPos.Type )
{
if
(
true
===
this
.
Selection
.
Use
&&
selectionflag_Common
===
this
.
Selection
.
Flag
)
...
...
@@ -6718,35 +6698,13 @@ CDocumentContent.prototype.Get_Paragraph_ParaPr = function()
EndPos
=
Temp
;
}
var
StartPr
,
Pr
;
if
(
type_Paragraph
==
this
.
Content
[
StartPos
].
GetType
())
{
StartPr
=
this
.
Content
[
StartPos
].
Get_CompiledPr2
(
false
).
ParaPr
;
Pr
=
StartPr
.
Copy
();
Pr
.
Locked
=
this
.
Content
[
StartPos
].
Lock
.
Is_Locked
();
}
else
if
(
type_Table
==
this
.
Content
[
StartPos
].
GetType
())
{
StartPr
=
this
.
Content
[
StartPos
].
Get_Paragraph_ParaPr
();
Pr
=
StartPr
.
Copy
();
var
StartPr
=
this
.
Content
[
StartPos
].
GetParagraphParaPr
();
var
Pr
=
StartPr
.
Copy
();
Pr
.
Locked
=
StartPr
.
Locked
;
}
for
(
var
Index
=
StartPos
+
1
;
Index
<=
EndPos
;
Index
++
)
{
var
Item
=
this
.
Content
[
Index
];
var
TempPr
;
if
(
type_Paragraph
==
Item
.
GetType
())
{
TempPr
=
Item
.
Get_CompiledPr2
(
false
).
ParaPr
;
TempPr
.
Locked
=
Item
.
Lock
.
Is_Locked
();
}
else
if
(
type_Table
==
Item
.
GetType
())
{
TempPr
=
Item
.
Get_Paragraph_ParaPr
();
}
var
TempPr
=
this
.
Content
[
Index
].
GetParagraphParaPr
();
Pr
=
Pr
.
Compare
(
TempPr
);
}
...
...
@@ -6760,7 +6718,7 @@ CDocumentContent.prototype.Get_Paragraph_ParaPr = function()
Pr
.
Ind
.
FirstLine
=
StartPr
.
Ind
.
FirstLine
;
Result_ParaPr
=
Pr
;
Result_ParaPr
.
CanAddTable
=
(
true
===
Locked
?
false
:
true
)
&&
!
(
this
.
bPresentation
===
true
);
Result_ParaPr
.
CanAddTable
=
(
true
===
Pr
.
Locked
?
false
:
true
)
&&
!
(
this
.
bPresentation
===
true
);
}
else
{
...
...
@@ -6774,11 +6732,12 @@ CDocumentContent.prototype.Get_Paragraph_ParaPr = function()
Result_ParaPr
.
Locked
=
Locked
;
Result_ParaPr
.
CanAddTable
=
(
(
true
===
Locked
)
?
(
(
true
===
Item
.
Cursor_IsEnd
()
)
?
true
:
false
)
:
true
)
&&
!
(
this
.
bPresentation
===
true
);
}
else
if
(
type_Table
==
Item
.
GetType
())
else
{
Result_ParaPr
=
Item
.
Get_Paragraph_
ParaPr
();
Result_ParaPr
=
Item
.
GetParagraph
ParaPr
();
}
}
if
(
Result_ParaPr
.
Shd
&&
Result_ParaPr
.
Shd
.
Unifill
)
{
Result_ParaPr
.
Shd
.
Unifill
.
check
(
this
.
Get_Theme
(),
this
.
Get_ColorMap
());
...
...
@@ -7563,7 +7522,7 @@ CDocumentContent.prototype.Selection_Check = function(X, Y, CurPage, N
if
(
true
===
this
.
ApplyToAll
)
this
.
Content
[
Index
].
Set_ApplyToAll
(
true
);
if
(
true
===
this
.
Content
[
Index
].
Selection_Check
(
0
,
0
,
0
,
NearPos
))
if
(
true
===
this
.
Content
[
Index
].
CheckPosInSelection
(
0
,
0
,
0
,
NearPos
))
{
if
(
true
===
this
.
ApplyToAll
)
this
.
Content
[
Index
].
Set_ApplyToAll
(
false
);
...
...
@@ -7591,7 +7550,7 @@ CDocumentContent.prototype.Selection_Check = function(X, Y, CurPage, N
else
{
var
ElementPageIndex
=
this
.
private_GetElementPageIndexByXY
(
ContentPos
,
X
,
Y
,
CurPage
);
return
this
.
Content
[
ContentPos
].
Selection_Check
(
X
,
Y
,
ElementPageIndex
,
NearPos
);
return
this
.
Content
[
ContentPos
].
CheckPosInSelection
(
X
,
Y
,
ElementPageIndex
,
NearPos
);
}
return
false
;
...
...
word/Editor/DocumentContentElementBase.js
View file @
67d5f0df
...
...
@@ -209,6 +209,14 @@ CDocumentContentElementBase.prototype.GetParagraphTextPr = function()
{
return
this
.
Get_Paragraph_TextPr
();
};
CDocumentContentElementBase
.
prototype
.
Get_Paragraph_ParaPr
=
function
()
{
return
new
CParaPr
();
};
CDocumentContentElementBase
.
prototype
.
GetParagraphParaPr
=
function
()
{
return
this
.
Get_Paragraph_ParaPr
();
};
CDocumentContentElementBase
.
prototype
.
Hyperlink_CanAdd
=
function
(
bCheckInHyperlink
)
{
return
false
;
...
...
@@ -223,6 +231,56 @@ CDocumentContentElementBase.prototype.Selection_Draw_Page = function(CurPage)
CDocumentContentElementBase
.
prototype
.
StopSelection
=
function
()
{
};
CDocumentContentElementBase
.
prototype
.
Get_SelectionBounds
=
function
()
{
return
{
Start
:
null
,
End
:
null
,
Direction
:
0
};
};
CDocumentContentElementBase
.
prototype
.
GetSelectionBounds
=
function
()
{
return
this
.
Get_SelectionBounds
();
};
CDocumentContentElementBase
.
prototype
.
RecalculateCurPos
=
function
()
{
return
null
;
};
CDocumentContentElementBase
.
prototype
.
Can_CopyCut
=
function
()
{
return
false
;
};
CDocumentContentElementBase
.
prototype
.
CanCopyCut
=
function
()
{
return
this
.
Can_CopyCut
();
};
CDocumentContentElementBase
.
prototype
.
Selection_Check
=
function
(
X
,
Y
,
CurPage
,
NearPos
)
{
return
false
;
};
CDocumentContentElementBase
.
prototype
.
CheckPosInSelection
=
function
(
X
,
Y
,
CurPage
,
NearPos
)
{
return
this
.
Selection_Check
(
X
,
Y
,
CurPage
,
NearPos
);
};
CDocumentContentElementBase
.
prototype
.
Get_NearestPos
=
function
(
CurPage
,
X
,
Y
,
bAnchor
,
Drawing
)
{
return
{
X
:
0
,
Y
:
0
,
Height
:
0
,
PageNum
:
0
,
Internal
:
{
Line
:
0
,
Page
:
0
,
Range
:
0
},
Transform
:
null
,
Paragraph
:
null
,
ContentPos
:
null
,
SearchPos
:
null
};
};
CDocumentContentElementBase
.
prototype
.
GetNearestPos
=
function
(
CurPage
,
X
,
Y
,
bAnchor
,
Drawing
)
{
return
this
.
Get_NearestPos
(
CurPage
,
X
,
Y
,
bAnchor
,
Drawing
);
};
//----------------------------------------------------------------------------------------------------------------------
// Функции для работы с номерами страниц
//----------------------------------------------------------------------------------------------------------------------
...
...
word/Editor/Paragraph.js
View file @
67d5f0df
...
...
@@ -6352,7 +6352,7 @@ Paragraph.prototype.Selection_CheckParaEnd = function()
return
this
.
Content
[
EndPos
].
Selection_CheckParaEnd
();
};
Paragraph
.
prototype
.
Selection_Check
=
function
(
X
,
Y
,
PageIndex
,
NearPos
)
Paragraph
.
prototype
.
Selection_Check
=
function
(
X
,
Y
,
CurPage
,
NearPos
)
{
if
(
undefined
!==
NearPos
)
{
...
...
@@ -6363,10 +6363,10 @@ Paragraph.prototype.Selection_Check = function(X, Y, PageIndex, NearPos)
}
else
{
if
(
PageIndex
<
0
||
PageIndex
>=
this
.
Pages
.
length
||
true
!=
this
.
Selection
.
Use
)
if
(
CurPage
<
0
||
CurPage
>=
this
.
Pages
.
length
||
true
!=
this
.
Selection
.
Use
)
return
false
;
var
SearchPosXY
=
this
.
Get_ParaContentPosByXY
(
X
,
Y
,
PageIndex
,
false
,
false
,
false
);
var
SearchPosXY
=
this
.
Get_ParaContentPosByXY
(
X
,
Y
,
CurPage
,
false
,
false
,
false
);
if
(
true
===
SearchPosXY
.
InText
)
{
...
...
@@ -6999,6 +6999,12 @@ Paragraph.prototype.Get_Paragraph_TextPr = function()
return
TextPr
;
};
Paragraph
.
prototype
.
Get_Paragraph_ParaPr
=
function
()
{
var
ParaPr
=
this
.
Get_CompiledPr2
(
false
).
ParaPr
;
ParaPr
.
Locked
=
this
.
Lock
.
Is_Locked
();
return
ParaPr
;
};
/**
* Проверяем пустой ли параграф
*/
...
...
@@ -8838,9 +8844,9 @@ Paragraph.prototype.Internal_CorrectAnchorPos = function(Result, Drawing)
/**
* Получем ближающую возможную позицию курсора
*/
Paragraph
.
prototype
.
Get_NearestPos
=
function
(
PageIndex
,
X
,
Y
,
bAnchor
,
Drawing
)
Paragraph
.
prototype
.
Get_NearestPos
=
function
(
CurPage
,
X
,
Y
,
bAnchor
,
Drawing
)
{
var
SearchPosXY
=
this
.
Get_ParaContentPosByXY
(
X
,
Y
,
PageIndex
,
false
,
false
);
var
SearchPosXY
=
this
.
Get_ParaContentPosByXY
(
X
,
Y
,
CurPage
,
false
,
false
);
this
.
Set_ParaContentPos
(
SearchPosXY
.
Pos
,
true
,
SearchPosXY
.
Line
,
SearchPosXY
.
Range
);
var
ContentPos
=
this
.
Get_ParaContentPos
(
false
,
false
);
...
...
@@ -12007,6 +12013,10 @@ Paragraph.prototype.IsColumnBreakOnLeft = function()
return
false
;
};
Paragraph
.
prototype
.
Can_CopyCut
=
function
()
{
return
true
;
};
var
pararecalc_0_All
=
0
;
var
pararecalc_0_None
=
1
;
...
...
word/Editor/StructuredDocumentTags/BlockLevel.js
View file @
67d5f0df
...
...
@@ -183,6 +183,10 @@ CBlockLevelSdt.prototype.Get_Paragraph_TextPr = function()
{
return
this
.
Content
.
Get_Paragraph_TextPr
();
};
CBlockLevelSdt
.
prototype
.
Get_Paragraph_ParaPr
=
function
()
{
return
this
.
Content
.
Get_Paragraph_ParaPr
();
};
CBlockLevelSdt
.
prototype
.
Hyperlink_CanAdd
=
function
(
bCheckInHyperlink
)
{
return
this
.
Content
.
Hyperlink_CanAdd
(
bCheckInHyperlink
);
...
...
@@ -191,6 +195,26 @@ CBlockLevelSdt.prototype.Selection_Draw_Page = function(CurPage)
{
this
.
Content
.
Selection_Draw_Page
(
CurPage
);
};
CBlockLevelSdt
.
prototype
.
Get_SelectionBounds
=
function
()
{
return
this
.
Content
.
Get_SelectionBounds
();
};
CBlockLevelSdt
.
prototype
.
RecalculateCurPos
=
function
()
{
return
this
.
Content
.
RecalculateCurPos
();
};
CBlockLevelSdt
.
prototype
.
Can_CopyCut
=
function
()
{
return
this
.
Content
.
Can_CopyCut
();
};
CBlockLevelSdt
.
prototype
.
Selection_Check
=
function
(
X
,
Y
,
CurPage
,
NearPos
)
{
return
this
.
Content
.
Selection_Check
(
X
,
Y
,
CurPage
,
NearPos
);
};
CBlockLevelSdt
.
prototype
.
Get_NearestPos
=
function
(
CurPage
,
X
,
Y
,
bAnchor
,
Drawing
)
{
return
this
.
Content
.
Get_NearestPos
(
CurPage
,
X
,
Y
,
bAnchor
,
Drawing
);
};
//----------------------------------------------------------------------------------------------------------------------
CBlockLevelSdt
.
prototype
.
Is_HdrFtr
=
function
(
bReturnHdrFtr
)
{
...
...
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