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
36d2da39
Commit
36d2da39
authored
Mar 10, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test variant of restricted moving cursor in filling forms mode.
parent
817629d2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
120 additions
and
2 deletions
+120
-2
word/Editor/Document.js
word/Editor/Document.js
+61
-2
word/Editor/Field.js
word/Editor/Field.js
+59
-0
No files found.
word/Editor/Document.js
View file @
36d2da39
...
...
@@ -4334,12 +4334,20 @@ CDocument.prototype.Cursor_MoveUp = function(AddToSelect)
{
this
.
Reset_WordSelection
();
this
.
private_UpdateTargetForCollaboration
();
if
(
true
===
this
.
IsFillingFormMode
())
this
.
MoveToFillingForm
(
false
);
else
this
.
Controller
.
MoveCursorUp
(
AddToSelect
);
};
CDocument
.
prototype
.
Cursor_MoveDown
=
function
(
AddToSelect
)
{
this
.
Reset_WordSelection
();
this
.
private_UpdateTargetForCollaboration
();
if
(
true
===
this
.
IsFillingFormMode
())
this
.
MoveToFillingForm
(
true
);
else
this
.
Controller
.
MoveCursorDown
(
AddToSelect
);
};
CDocument
.
prototype
.
Cursor_MoveEndOfLine
=
function
(
AddToSelect
)
...
...
@@ -16079,6 +16087,57 @@ CDocument.prototype.IsFormFieldEditing = function()
return
false
;
};
CDocument
.
prototype
.
MoveToFillingForm
=
function
(
bNext
)
{
var
arrAllFields
=
this
.
GetAllFormTextFields
();
if
(
arrAllFields
.
length
<=
0
)
return
;
this
.
Selection_Remove
();
var
oInfo
=
this
.
Get_SelectedElementsInfo
();
var
oField
=
oInfo
.
Get_Field
();
var
oForm
=
null
;
if
(
!
oField
||
!
oField
.
IsFillingForm
())
{
oForm
=
arrAllFields
[
0
];
}
else
{
for
(
var
nIndex
=
0
,
nCount
=
arrAllFields
.
length
;
nIndex
<
nCount
;
++
nIndex
)
{
if
(
oField
===
arrAllFields
[
nIndex
])
{
if
(
bNext
)
{
if
(
nIndex
<
nCount
-
1
)
oForm
=
arrAllFields
[
nIndex
+
1
];
else
oForm
=
arrAllFields
[
0
];
}
else
{
if
(
nIndex
>
0
)
oForm
=
arrAllFields
[
0
];
else
oForm
=
arrAllFields
[
nCount
-
1
];
}
break
;
}
}
}
if
(
oForm
)
{
oForm
.
Cursor_MoveToStartPos
();
if
(
oForm
.
Content
.
length
>=
0
&&
para_Run
===
oForm
.
Content
[
0
].
Type
)
oForm
.
Content
[
0
].
Make_ThisElementCurrent
();
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateSelectionState
();
}
};
function
CDocumentSelectionState
()
{
...
...
word/Editor/Field.js
View file @
36d2da39
...
...
@@ -325,6 +325,58 @@ ParaField.prototype.Shift_Range = function(Dx, Dy, _CurLine, _CurRange)
oRangeBounds
.
Y1
+=
Dy
;
}
};
ParaField
.
prototype
.
Get_LeftPos
=
function
(
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
)
{
var
bResult
=
ParaField
.
superclass
.
Get_LeftPos
.
call
(
this
,
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
);
if
(
true
!==
bResult
&&
this
.
Paragraph
&&
this
.
Paragraph
.
LogicDocument
&&
true
===
this
.
Paragraph
.
LogicDocument
.
IsFillingFormMode
())
{
this
.
Get_StartPos
(
SearchPos
.
Pos
,
Depth
);
SearchPos
.
Found
=
true
;
return
true
;
}
return
bResult
;
};
ParaField
.
prototype
.
Get_RightPos
=
function
(
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
,
StepEnd
)
{
var
bResult
=
ParaField
.
superclass
.
Get_RightPos
.
call
(
this
,
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
,
StepEnd
);
if
(
true
!==
bResult
&&
this
.
Paragraph
&&
this
.
Paragraph
.
LogicDocument
&&
true
===
this
.
Paragraph
.
LogicDocument
.
IsFillingFormMode
())
{
this
.
Get_EndPos
(
false
,
SearchPos
.
Pos
,
Depth
);
SearchPos
.
Found
=
true
;
return
true
;
}
return
bResult
;
};
ParaField
.
prototype
.
Get_WordStartPos
=
function
(
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
)
{
var
bResult
=
ParaField
.
superclass
.
Get_WordStartPos
.
call
(
this
,
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
);
if
(
true
!==
bResult
&&
this
.
Paragraph
&&
this
.
Paragraph
.
LogicDocument
&&
true
===
this
.
Paragraph
.
LogicDocument
.
IsFillingFormMode
())
{
this
.
Get_StartPos
(
SearchPos
.
Pos
,
Depth
);
SearchPos
.
Found
=
true
;
return
true
;
}
return
bResult
;
};
ParaField
.
prototype
.
Get_WordEndPos
=
function
(
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
,
StepEnd
)
{
var
bResult
=
ParaField
.
superclass
.
Get_WordEndPos
.
call
(
this
,
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
,
StepEnd
);
if
(
true
!==
bResult
&&
this
.
Paragraph
&&
this
.
Paragraph
.
LogicDocument
&&
true
===
this
.
Paragraph
.
LogicDocument
.
IsFillingFormMode
())
{
this
.
Get_EndPos
(
false
,
SearchPos
.
Pos
,
Depth
);
SearchPos
.
Found
=
true
;
return
true
;
}
return
bResult
;
};
//----------------------------------------------------------------------------------------------------------------------
// Работа с данными поля
//----------------------------------------------------------------------------------------------------------------------
...
...
@@ -486,6 +538,13 @@ ParaField.prototype.SetValue = function(sValue)
this
.
Add_ToContent
(
0
,
oRun
);
this
.
Cursor_MoveToStartPos
();
};
ParaField
.
prototype
.
IsFillingForm
=
function
()
{
if
(
fieldtype_FORMTEXT
===
this
.
Get_FieldType
())
return
true
;
return
false
;
};
//----------------------------------------------------------------------------------------------------------------------
// Функции совместного редактирования
//----------------------------------------------------------------------------------------------------------------------
...
...
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