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
a410e150
Commit
a410e150
authored
May 19, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wokred on various locking types of an inline content control class
parent
85823ec0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
6 deletions
+101
-6
common/Private/Locks.js
common/Private/Locks.js
+43
-6
word/Editor/Paragraph.js
word/Editor/Paragraph.js
+28
-0
word/Editor/ParagraphContentBase.js
word/Editor/ParagraphContentBase.js
+24
-0
word/Editor/StructuredDocumentTags/InlineLevel.js
word/Editor/StructuredDocumentTags/InlineLevel.js
+6
-0
No files found.
common/Private/Locks.js
View file @
a410e150
...
...
@@ -381,19 +381,27 @@ CDocumentContent.prototype.CheckContentControlDeletingLock = function()
};
Paragraph
.
prototype
.
Document_Is_SelectionLocked
=
function
(
CheckType
)
{
var
isSelectionUse
=
this
.
IsSelectionUse
();
var
arrContentControls
=
this
.
GetSelectedContentControls
();
for
(
var
nIndex
=
0
,
nCount
=
arrContentControls
.
length
;
nIndex
<
nCount
;
++
nIndex
)
{
if
(
arrContentControls
[
nIndex
].
IsSelectionUse
()
===
isSelectionUse
)
arrContentControls
[
nIndex
].
Document_Is_SelectionLocked
(
CheckType
);
}
var
bCheckContentControl
=
false
;
switch
(
CheckType
)
{
case
AscCommon
.
changestype_Paragraph_Content
:
case
AscCommon
.
changestype_Paragraph_Properties
:
case
AscCommon
.
changestype_Paragraph_Properties
:
case
AscCommon
.
changestype_Document_Content
:
case
AscCommon
.
changestype_Document_Content_Add
:
case
AscCommon
.
changestype_Image_Properties
:
{
this
.
Lock
.
Check
(
this
.
Get_Id
()
);
bCheckContentControl
=
true
;
break
;
}
{
this
.
Lock
.
Check
(
this
.
Get_Id
()
);
bCheckContentControl
=
true
;
break
;
}
case
AscCommon
.
changestype_Remove
:
{
// Если у нас нет выделения, и курсор стоит в начале, мы должны проверить в том же порядке, в каком
...
...
@@ -647,6 +655,35 @@ CBlockLevelSdt.prototype.CheckContentControlDeletingLock = function()
this
.
Content
.
CheckContentControlEditingLock
();
};
CInlineLevelSdt
.
prototype
.
Document_Is_SelectionLocked
=
function
(
CheckType
)
{
var
nContentControlLock
=
this
.
GetContentControlLock
();
if
((
AscCommon
.
changestype_Paragraph_Content
===
CheckType
||
AscCommon
.
changestype_Remove
===
CheckType
||
AscCommon
.
changestype_Delete
===
CheckType
||
AscCommon
.
changestype_Document_Content
===
CheckType
||
AscCommon
.
changestype_Document_Content_Add
===
CheckType
)
&&
this
.
IsSelectionUse
()
&&
this
.
IsSelectedAll
())
{
if
(
AscCommonWord
.
sdtlock_SdtContentLocked
===
nContentControlLock
||
AscCommonWord
.
sdtlock_SdtLocked
===
nContentControlLock
)
{
return
AscCommon
.
CollaborativeEditing
.
Add_CheckLock
(
true
);
}
}
else
if
((
AscCommon
.
changestype_Paragraph_Content
===
CheckType
||
AscCommon
.
changestype_Remove
===
CheckType
||
AscCommon
.
changestype_Delete
===
CheckType
||
AscCommon
.
changestype_Document_Content
===
CheckType
||
AscCommon
.
changestype_Document_Content_Add
===
CheckType
||
AscCommon
.
changestype_Image_Properties
===
CheckType
)
&&
(
AscCommonWord
.
sdtlock_SdtContentLocked
===
nContentControlLock
||
AscCommonWord
.
sdtlock_ContentLocked
===
nContentControlLock
))
{
return
AscCommon
.
CollaborativeEditing
.
Add_CheckLock
(
true
);
}
};
CTableCell
.
prototype
.
CheckContentControlEditingLock
=
function
()
{
if
(
this
.
Row
&&
this
.
Row
.
Table
&&
this
.
Row
.
Table
.
Parent
&&
this
.
Row
.
Table
.
Parent
.
CheckContentControlEditingLock
)
...
...
word/Editor/Paragraph.js
View file @
a410e150
...
...
@@ -11984,6 +11984,34 @@ Paragraph.prototype.GetTargetPos = function()
{
return
this
.
Internal_Recalculate_CurPos
(
this
.
CurPos
.
ContentPos
,
false
,
false
,
true
);
};
Paragraph
.
prototype
.
GetSelectedContentControls
=
function
()
{
var
arrContentControls
=
[];
if
(
true
===
this
.
Selection
.
Use
)
{
var
StartPos
=
this
.
Selection
.
StartPos
;
var
EndPos
=
this
.
Selection
.
EndPos
;
if
(
StartPos
>
EndPos
)
{
StartPos
=
this
.
Selection
.
EndPos
;
EndPos
=
this
.
Selection
.
StartPos
;
}
for
(
var
Index
=
StartPos
;
Index
<=
EndPos
;
++
Index
)
{
if
(
this
.
Content
[
Index
].
GetSelectedContentControls
)
this
.
Content
[
Index
].
GetSelectedContentControls
(
arrContentControls
);
}
}
else
{
if
(
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetSelectedContentControls
)
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetSelectedContentControls
(
arrContentControls
);
}
return
arrContentControls
;
};
var
pararecalc_0_All
=
0
;
var
pararecalc_0_None
=
1
;
...
...
word/Editor/ParagraphContentBase.js
View file @
a410e150
...
...
@@ -2736,6 +2736,30 @@ CParagraphContentWithParagraphLikeContent.prototype.SelectThisElement = function
return
true
;
};
CParagraphContentWithParagraphLikeContent
.
prototype
.
GetSelectedContentControls
=
function
(
arrContentControls
)
{
if
(
true
===
this
.
Selection
.
Use
)
{
var
StartPos
=
this
.
Selection
.
StartPos
;
var
EndPos
=
this
.
Selection
.
EndPos
;
if
(
StartPos
>
EndPos
)
{
StartPos
=
this
.
Selection
.
EndPos
;
EndPos
=
this
.
Selection
.
StartPos
;
}
for
(
var
Index
=
StartPos
;
Index
<=
EndPos
;
++
Index
)
{
if
(
this
.
Content
[
Index
].
GetSelectedContentControls
)
this
.
Content
[
Index
].
GetSelectedContentControls
(
arrContentControls
);
}
}
else
{
if
(
this
.
Content
[
this
.
State
.
ContentPos
].
GetSelectedContentControls
)
this
.
Content
[
this
.
State
.
ContentPos
].
GetSelectedContentControls
(
arrContentControls
);
}
};
//----------------------------------------------------------------------------------------------------------------------
// Функции, которые должны быть реализованы в классах наследниках
//----------------------------------------------------------------------------------------------------------------------
...
...
word/Editor/StructuredDocumentTags/InlineLevel.js
View file @
a410e150
...
...
@@ -407,6 +407,7 @@ CInlineLevelSdt.prototype.SetContentControlLock = function(nLockType)
};
CInlineLevelSdt
.
prototype
.
GetContentControlLock
=
function
()
{
return
sdtlock_SdtContentLocked
;
return
(
undefined
!==
this
.
Pr
.
Lock
?
this
.
Pr
.
Lock
:
sdtlock_Unlocked
);
};
//----------------------------------------------------------------------------------------------------------------------
...
...
@@ -457,6 +458,11 @@ CInlineLevelSdt.prototype.IsStopCursorOnEntryExit = function()
{
return
true
;
};
CInlineLevelSdt
.
prototype
.
GetSelectedContentControls
=
function
(
arrContentControls
)
{
arrContentControls
.
push
(
this
);
CParagraphContentWithParagraphLikeContent
.
prototype
.
GetSelectedContentControls
.
call
(
this
,
arrContentControls
);
};
//--------------------------------------------------------export--------------------------------------------------------
window
[
'
AscCommonWord
'
]
=
window
[
'
AscCommonWord
'
]
||
{};
window
[
'
AscCommonWord
'
].
CInlineLevelSdt
=
CInlineLevelSdt
;
...
...
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