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
187b5675
Commit
187b5675
authored
Jun 16, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented function for changing content control properties.
parent
02ed3a83
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
89 additions
and
3 deletions
+89
-3
common/HistoryCommon.js
common/HistoryCommon.js
+4
-0
common/Private/Locks.js
common/Private/Locks.js
+4
-2
word/Editor/StructuredDocumentTags/InlineLevel.js
word/Editor/StructuredDocumentTags/InlineLevel.js
+25
-0
word/api.js
word/api.js
+56
-1
No files found.
common/HistoryCommon.js
View file @
187b5675
...
...
@@ -1025,6 +1025,9 @@
case
AscDFH
.
historydescription_Document_RemoveContentControlWrapper
:
sString
=
"
Document_RemoveContentControlWrapper
"
;
break
;
case
AscDFH
.
historydescription_Document_ChangeContentControlProperties
:
sString
=
"
Document_ChangeContentControlProperties
"
;
break
;
}
return
sString
;
}
...
...
@@ -2915,6 +2918,7 @@
window
[
'
AscDFH
'
].
historydescription_Document_AddInlineLevelContentControl
=
0x0142
;
window
[
'
AscDFH
'
].
historydescription_Document_RemoveContentControl
=
0x0143
;
window
[
'
AscDFH
'
].
historydescription_Document_RemoveContentControlWrapper
=
0x0144
;
window
[
'
AscDFH
'
].
historydescription_Document_ChangeContentControlProperties
=
0x0145
;
...
...
common/Private/Locks.js
View file @
187b5675
...
...
@@ -629,8 +629,10 @@ CBlockLevelSdt.prototype.Document_Is_SelectionLocked = function(CheckType, bChec
var
nContentControlLock
=
this
.
GetContentControlLock
();
if
(
AscCommon
.
changestype_ContentControl_Remove
===
CheckType
||
AscCommon
.
changestype_ContentControl_Properties
===
CheckType
)
if
(
AscCommon
.
changestype_ContentControl_Properties
===
CheckType
)
return
this
.
Lock
.
Check
(
this
.
GetId
());
if
(
AscCommon
.
changestype_ContentControl_Remove
===
CheckType
)
this
.
Lock
.
Check
(
this
.
GetId
());
if
(
isCheckContentControlLock
...
...
word/Editor/StructuredDocumentTags/InlineLevel.js
View file @
187b5675
...
...
@@ -375,6 +375,31 @@ CInlineLevelSdt.prototype.GetContentControlLock = function()
{
return
(
undefined
!==
this
.
Pr
.
Lock
?
this
.
Pr
.
Lock
:
sdtlock_Unlocked
);
};
CInlineLevelSdt
.
prototype
.
SetContentControlPr
=
function
(
oPr
)
{
if
(
!
oPr
)
return
;
if
(
undefined
!==
oPr
.
Tag
)
this
.
SetTag
(
oPr
.
Tag
);
if
(
undefined
!==
oPr
.
Id
)
this
.
SetContentControlId
(
oPr
.
Id
);
if
(
undefined
!==
oPr
.
Lock
)
this
.
SetContentControlLock
(
oPr
.
Lock
);
};
CInlineLevelSdt
.
prototype
.
GetContentControlPr
=
function
()
{
var
oPr
=
new
CContentControlPr
();
oPr
.
Tag
=
this
.
Pr
.
Tag
;
oPr
.
Id
=
this
.
Pr
.
Id
;
oPr
.
Lock
=
this
.
Pr
.
Lock
;
oPr
.
InternalId
=
this
.
GetId
();
return
oPr
;
};
//----------------------------------------------------------------------------------------------------------------------
// Функции совместного редактирования
//----------------------------------------------------------------------------------------------------------------------
...
...
word/api.js
View file @
187b5675
...
...
@@ -7355,13 +7355,68 @@ background-repeat: no-repeat;\
if
(
false
===
isLocked
)
{
oLogicDocument
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_RemoveContentControl
);
oLogicDocument
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_RemoveContentControl
Wrapper
);
oLogicDocument
.
RemoveContentControlWrapper
(
Id
);
oLogicDocument
.
Recalculate
();
oLogicDocument
.
Document_UpdateInterfaceState
();
oLogicDocument
.
Document_UpdateSelectionState
();
}
};
asc_docs_api
.
prototype
.
asc_SetContentControlProperties
=
function
(
oContentControlPr
,
Id
)
{
var
oLogicDocument
=
this
.
WordControl
.
m_oLogicDocument
;
if
(
!
oLogicDocument
)
return
;
var
isLocked
=
true
;
var
oContentControl
=
null
;
if
(
undefined
===
Id
)
{
var
oInfo
=
oLogicDocument
.
GetSelectedElementsInfo
();
var
oInlineControl
=
oInfo
.
GetInlineLevelSdt
();
var
oBlockControl
=
oInfo
.
GetBlockLevelSdt
();
if
(
oInlineControl
)
oContentControl
=
oInlineControl
;
else
if
(
oBlockControl
)
oContentControl
=
oBlockControl
;
}
else
{
oContentControl
=
AscCommon
.
g_oTableId
.
Get_ById
(
Id
);
}
if
(
oContentControl
&&
oContentControl
.
GetContentControlType
)
{
if
(
AscCommonWord
.
sdttype_BlockLevel
===
oContentControl
.
GetContentControlType
())
{
isLocked
=
oLogicDocument
.
Document_Is_SelectionLocked
(
AscCommon
.
changestype_None
,
{
Type
:
AscCommon
.
changestype_2_ElementsArray_and_Type
,
Elements
:
[
oContentControl
],
CheckType
:
AscCommon
.
changestype_ContentControl_Properties
});
}
else
if
(
AscCommonWord
.
sdttype_InlineLevel
===
oContentControl
.
GetContentControlType
())
{
var
oParagraph
=
oContentControl
.
GetParagraph
();
if
(
oParagraph
)
{
isLocked
=
oLogicDocument
.
Document_Is_SelectionLocked
(
AscCommon
.
changestype_None
,
{
Type
:
AscCommon
.
changestype_2_ElementsArray_and_Type
,
Elements
:
[
oParagraph
],
CheckType
:
AscCommon
.
changestype_Paragraph_Properties
});
}
}
}
if
(
false
===
isLocked
)
{
oLogicDocument
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_ChangeContentControlProperties
);
oContentControl
.
SetContentControlPr
(
oContentControlPr
);
oLogicDocument
.
Document_UpdateInterfaceState
();
}
};
// input
asc_docs_api
.
prototype
.
Begin_CompositeInput
=
function
()
...
...
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