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
1a05afb5
Commit
1a05afb5
authored
May 31, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug with locking an content control and deleting it trough a plugin api.
parent
9248d711
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
5 deletions
+51
-5
common/Private/Locks.js
common/Private/Locks.js
+21
-3
word/Editor/Document.js
word/Editor/Document.js
+11
-0
word/api.js
word/api.js
+19
-2
No files found.
common/Private/Locks.js
View file @
1a05afb5
...
...
@@ -622,9 +622,12 @@ CTable.prototype.CheckContentControlDeletingLock = function()
};
CBlockLevelSdt
.
prototype
.
Document_Is_SelectionLocked
=
function
(
CheckType
,
bCheckInner
)
{
var
isCheckContentControlLock
=
this
.
LogicDocument
?
this
.
LogicDocument
.
IsCheckContentControlsLock
()
:
true
;
var
nContentControlLock
=
this
.
GetContentControlLock
();
if
((
AscCommon
.
changestype_Paragraph_Content
===
CheckType
if
(
isCheckContentControlLock
&&
(
AscCommon
.
changestype_Paragraph_Content
===
CheckType
||
AscCommon
.
changestype_Remove
===
CheckType
||
AscCommon
.
changestype_Delete
===
CheckType
||
AscCommon
.
changestype_Document_Content
===
CheckType
...
...
@@ -644,7 +647,9 @@ CBlockLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType, bChec
return
;
}
}
else
if
(
AscCommonWord
.
sdtlock_SdtContentLocked
===
nContentControlLock
||
AscCommonWord
.
sdtlock_ContentLocked
===
nContentControlLock
)
else
if
(
isCheckContentControlLock
&&
(
AscCommonWord
.
sdtlock_SdtContentLocked
===
nContentControlLock
||
AscCommonWord
.
sdtlock_ContentLocked
===
nContentControlLock
))
{
return
AscCommon
.
CollaborativeEditing
.
Add_CheckLock
(
true
);
}
...
...
@@ -655,6 +660,10 @@ CBlockLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType, bChec
};
CBlockLevelSdt
.
prototype
.
CheckContentControlEditingLock
=
function
()
{
var
isCheckContentControlLock
=
this
.
LogicDocument
?
this
.
LogicDocument
.
IsCheckContentControlsLock
()
:
true
;
if
(
!
isCheckContentControlLock
)
return
;
var
nContentControlLock
=
this
.
GetContentControlLock
();
if
(
false
===
AscCommon
.
CollaborativeEditing
.
IsNeedToSkipContentControlOnCheckEditingLock
(
this
)
...
...
@@ -666,6 +675,10 @@ CBlockLevelSdt.prototype.CheckContentControlEditingLock = function()
};
CBlockLevelSdt
.
prototype
.
CheckContentControlDeletingLock
=
function
()
{
var
isCheckContentControlLock
=
this
.
LogicDocument
?
this
.
LogicDocument
.
IsCheckContentControlsLock
()
:
true
;
if
(
!
isCheckContentControlLock
)
return
;
var
nContentControlLock
=
this
.
GetContentControlLock
();
if
(
AscCommonWord
.
sdtlock_SdtContentLocked
===
nContentControlLock
||
AscCommonWord
.
sdtlock_SdtLocked
===
nContentControlLock
)
...
...
@@ -675,9 +688,14 @@ CBlockLevelSdt.prototype.CheckContentControlDeletingLock = function()
};
CInlineLevelSdt
.
prototype
.
Document_Is_SelectionLocked
=
function
(
CheckType
)
{
var
isCheckContentControlLock
=
this
.
Paragraph
&&
this
.
Paragraph
.
LogicDocument
?
this
.
Paragraph
.
LogicDocument
.
IsCheckContentControlsLock
()
:
true
;
if
(
!
isCheckContentControlLock
)
return
;
var
nContentControlLock
=
this
.
GetContentControlLock
();
if
((
AscCommon
.
changestype_Paragraph_Content
===
CheckType
if
(
CheckContentControlLock
&&
(
AscCommon
.
changestype_Paragraph_Content
===
CheckType
||
AscCommon
.
changestype_Remove
===
CheckType
||
AscCommon
.
changestype_Delete
===
CheckType
||
AscCommon
.
changestype_Document_Content
===
CheckType
...
...
word/Editor/Document.js
View file @
1a05afb5
...
...
@@ -1546,6 +1546,9 @@ function CDocument(DrawingDocument, isMainLogicDocument)
// Объект для составного ввода текста
this
.
CompositeInput
=
null
;
// Нужно ли проверять тип лока у ContentControl при проверке залоченности выделенных объектов
this
.
CheckContentControlsLock
=
true
;
// Класс для работы со сносками
this
.
Footnotes
=
new
CFootnotesController
(
this
);
this
.
LogicDocumentController
=
new
CLogicDocumentController
(
this
);
...
...
@@ -15253,6 +15256,14 @@ CDocument.prototype.GetAllSignatures = function()
{
return
this
.
DrawingObjects
.
getAllSignatures
();
};
CDocument
.
prototype
.
SetCheckContentControlsLock
=
function
(
isLocked
)
{
this
.
CheckContentControlsLock
=
isLocked
;
};
CDocument
.
prototype
.
IsCheckContentControlsLock
=
function
()
{
return
this
.
CheckContentControlsLock
;
};
function
CDocumentSelectionState
()
{
...
...
word/api.js
View file @
1a05afb5
...
...
@@ -547,14 +547,31 @@
this
.
delete
=
function
()
{
var
LogicDocument
=
this
.
api
.
WordControl
.
m_oLogicDocument
;
LogicDocument
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_InsertDocumentsByUrls
);
if
(
false
===
LogicDocument
.
Document_Is_SelectionLocked
(
AscCommon
.
changestype_Document_Content_Add
))
var
arrContentControl
=
[];
for
(
var
i
=
0
;
i
<
this
.
documents
.
length
;
i
++
)
{
var
oContentControl
=
g_oTableId
.
Get_ById
(
this
.
documents
[
i
].
InternalId
);
if
(
oContentControl
&&
(
oContentControl
instanceof
AscCommonWord
.
CBlockLevelSdt
||
oContentControl
instanceof
AscCommonWord
.
CInlineLevelSdt
))
arrContentControl
.
push
(
g_oTableId
.
Get_ById
(
this
.
documents
[
i
].
InternalId
));
}
LogicDocument
.
SetCheckContentControlsLock
(
false
);
if
(
false
===
LogicDocument
.
Document_Is_SelectionLocked
(
AscCommon
.
changestype_None
,
{
Type
:
AscCommon
.
changestype_2_ElementsArray_and_Type
,
Elements
:
arrContentControl
,
CheckType
:
AscCommon
.
changestype_Remove
}))
{
LogicDocument
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_InsertDocumentsByUrls
);
for
(
var
i
=
0
;
i
<
this
.
documents
.
length
;
i
++
)
{
LogicDocument
.
RemoveContentControl
(
this
.
documents
[
i
].
InternalId
);
}
}
LogicDocument
.
SetCheckContentControlsLock
(
true
);
this
.
api
.
asc_Recalculate
();
delete
this
.
api
.
__content_control_worker
;
};
...
...
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