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
ade2026b
Commit
ade2026b
authored
Jun 21, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
From now in filling form mode the user can't place the cursor outside the form.
parent
3f2fd7d2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
31 deletions
+67
-31
word/Editor/Document.js
word/Editor/Document.js
+19
-3
word/Editor/Field.js
word/Editor/Field.js
+8
-12
word/Editor/StructuredDocumentTags/BlockLevel.js
word/Editor/StructuredDocumentTags/BlockLevel.js
+10
-2
word/Editor/StructuredDocumentTags/InlineLevel.js
word/Editor/StructuredDocumentTags/InlineLevel.js
+30
-14
No files found.
word/Editor/Document.js
View file @
ade2026b
...
...
@@ -6441,6 +6441,7 @@ CDocument.prototype.OnKeyDown = function(e)
}
}
this
.
private_CheckCursorPosInFillingFormMode
();
bRetValue
=
keydownresult_PreventAll
;
}
else
if
(
e
.
KeyCode
==
34
)
// PgDn
...
...
@@ -6550,6 +6551,7 @@ CDocument.prototype.OnKeyDown = function(e)
}
}
this
.
private_CheckCursorPosInFillingFormMode
();
bRetValue
=
keydownresult_PreventAll
;
}
else
if
(
e
.
KeyCode
==
35
)
// клавиша End
...
...
@@ -6566,6 +6568,7 @@ CDocument.prototype.OnKeyDown = function(e)
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateRulersState
();
this
.
private_CheckCursorPosInFillingFormMode
();
bRetValue
=
keydownresult_PreventAll
;
}
else
if
(
e
.
KeyCode
==
36
)
// клавиша Home
...
...
@@ -6582,6 +6585,7 @@ CDocument.prototype.OnKeyDown = function(e)
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateRulersState
();
this
.
private_CheckCursorPosInFillingFormMode
();
bRetValue
=
keydownresult_PreventAll
;
}
else
if
(
e
.
KeyCode
==
37
)
// Left Arrow
...
...
@@ -6592,6 +6596,7 @@ CDocument.prototype.OnKeyDown = function(e)
this
.
DrawingDocument
.
UpdateTargetFromPaint
=
true
;
this
.
MoveCursorLeft
(
true
===
e
.
ShiftKey
,
true
===
e
.
CtrlKey
);
this
.
private_CheckCursorPosInFillingFormMode
();
bRetValue
=
keydownresult_PreventAll
;
}
else
if
(
e
.
KeyCode
==
38
)
// Top Arrow
...
...
@@ -6603,6 +6608,7 @@ CDocument.prototype.OnKeyDown = function(e)
this
.
DrawingDocument
.
UpdateTargetFromPaint
=
true
;
this
.
MoveCursorUp
(
true
===
e
.
ShiftKey
,
true
===
e
.
CtrlKey
);
this
.
private_CheckCursorPosInFillingFormMode
();
bRetValue
=
keydownresult_PreventAll
;
}
else
if
(
e
.
KeyCode
==
39
)
// Right Arrow
...
...
@@ -6613,6 +6619,7 @@ CDocument.prototype.OnKeyDown = function(e)
this
.
DrawingDocument
.
UpdateTargetFromPaint
=
true
;
this
.
MoveCursorRight
(
true
===
e
.
ShiftKey
,
true
===
e
.
CtrlKey
);
this
.
private_CheckCursorPosInFillingFormMode
();
bRetValue
=
keydownresult_PreventAll
;
}
else
if
(
e
.
KeyCode
==
40
)
// Bottom Arrow
...
...
@@ -6624,6 +6631,7 @@ CDocument.prototype.OnKeyDown = function(e)
this
.
DrawingDocument
.
UpdateTargetFromPaint
=
true
;
this
.
MoveCursorDown
(
true
===
e
.
ShiftKey
,
true
===
e
.
CtrlKey
);
this
.
private_CheckCursorPosInFillingFormMode
();
bRetValue
=
keydownresult_PreventAll
;
}
else
if
(
e
.
KeyCode
==
46
)
// Delete
...
...
@@ -7318,6 +7326,8 @@ CDocument.prototype.OnMouseUp = function(e, X, Y, PageIndex)
}
}
this
.
private_CheckCursorPosInFillingFormMode
();
this
.
private_UpdateCursorXY
(
true
,
true
);
};
CDocument
.
prototype
.
OnMouseMove
=
function
(
e
,
X
,
Y
,
PageIndex
)
...
...
@@ -15133,9 +15143,6 @@ CDocument.prototype.IsInFormField = function()
var
oInlineSdt
=
oSelectedInfo
.
GetInlineLevelSdt
();
var
oBlockSdt
=
oSelectedInfo
.
GetBlockLevelSdt
();
if
(
oSelectedInfo
.
Is_MixedSelection
())
return
false
;
return
(
oBlockSdt
||
oInlineSdt
||
(
oField
&&
fieldtype_FORMTEXT
===
oField
.
Get_FieldType
()))
?
true
:
false
;
};
CDocument
.
prototype
.
IsFormFieldEditing
=
function
()
...
...
@@ -15267,6 +15274,15 @@ CDocument.prototype.CanEdit = function()
return
true
;
};
CDocument
.
prototype
.
private_CheckCursorPosInFillingFormMode
=
function
()
{
if
(
this
.
IsFillingFormMode
()
&&
!
this
.
IsInFormField
())
{
this
.
MoveToFillingForm
(
true
);
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateInterfaceState
();
}
};
function
CDocumentSelectionState
()
{
...
...
word/Editor/Field.js
View file @
ade2026b
...
...
@@ -295,29 +295,25 @@ ParaField.prototype.Get_RightPos = function(SearchPos, ContentPos, Depth, UseCon
};
ParaField
.
prototype
.
Get_WordStartPos
=
function
(
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
)
{
var
bResult
=
CParagraphContentWithParagraphLikeContent
.
prototype
.
Get_WordStartPos
.
call
(
this
,
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
);
CParagraphContentWithParagraphLikeContent
.
prototype
.
Get_WordStartPos
.
call
(
this
,
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
);
if
(
true
!==
bResult
&&
this
.
Paragraph
&&
this
.
Paragraph
.
LogicDocument
&&
true
===
this
.
Paragraph
.
LogicDocument
.
IsFillingFormMode
())
if
(
true
!==
SearchPos
.
Found
&&
this
.
Paragraph
&&
this
.
Paragraph
.
LogicDocument
&&
true
===
this
.
Paragraph
.
LogicDocument
.
IsFillingFormMode
())
{
this
.
Get_StartPos
(
SearchPos
.
Pos
,
Depth
);
SearchPos
.
Found
=
true
;
return
true
;
SearchPos
.
UpdatePos
=
true
;
SearchPos
.
Found
=
true
;
}
return
bResult
;
};
ParaField
.
prototype
.
Get_WordEndPos
=
function
(
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
,
StepEnd
)
{
var
bResult
=
CParagraphContentWithParagraphLikeContent
.
prototype
.
Get_WordEndPos
.
call
(
this
,
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
,
StepEnd
);
CParagraphContentWithParagraphLikeContent
.
prototype
.
Get_WordEndPos
.
call
(
this
,
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
,
StepEnd
);
if
(
true
!==
bResult
&&
this
.
Paragraph
&&
this
.
Paragraph
.
LogicDocument
&&
true
===
this
.
Paragraph
.
LogicDocument
.
IsFillingFormMode
())
if
(
true
!==
SearchPos
.
Found
&&
this
.
Paragraph
&&
this
.
Paragraph
.
LogicDocument
&&
true
===
this
.
Paragraph
.
LogicDocument
.
IsFillingFormMode
())
{
this
.
Get_EndPos
(
false
,
SearchPos
.
Pos
,
Depth
);
SearchPos
.
Found
=
true
;
return
true
;
SearchPos
.
UpdatePos
=
true
;
SearchPos
.
Found
=
true
;
}
return
bResult
;
};
//----------------------------------------------------------------------------------------------------------------------
// Работа с данными поля
...
...
word/Editor/StructuredDocumentTags/BlockLevel.js
View file @
ade2026b
...
...
@@ -276,7 +276,11 @@ CBlockLevelSdt.prototype.CanUpdateTarget = function(CurPage)
};
CBlockLevelSdt
.
prototype
.
MoveCursorLeft
=
function
(
AddToSelect
,
Word
)
{
return
this
.
Content
.
MoveCursorLeft
(
AddToSelect
,
Word
);
var
bResult
=
this
.
Content
.
MoveCursorLeft
(
AddToSelect
,
Word
);
if
(
!
bResult
&&
this
.
LogicDocument
.
IsFillingFormMode
())
return
true
;
return
bResult
;
};
CBlockLevelSdt
.
prototype
.
MoveCursorLeftWithSelectionFromEnd
=
function
(
Word
)
{
...
...
@@ -284,7 +288,11 @@ CBlockLevelSdt.prototype.MoveCursorLeftWithSelectionFromEnd = function(Word)
};
CBlockLevelSdt
.
prototype
.
MoveCursorRight
=
function
(
AddToSelect
,
Word
)
{
return
this
.
Content
.
MoveCursorRight
(
AddToSelect
,
Word
,
false
);
var
bResult
=
this
.
Content
.
MoveCursorRight
(
AddToSelect
,
Word
,
false
);
if
(
!
bResult
&&
this
.
LogicDocument
.
IsFillingFormMode
())
return
true
;
return
bResult
;
};
CBlockLevelSdt
.
prototype
.
MoveCursorRightWithSelectionFromStart
=
function
(
Word
)
{
...
...
word/Editor/StructuredDocumentTags/InlineLevel.js
View file @
ade2026b
...
...
@@ -144,7 +144,16 @@ CInlineLevelSdt.prototype.Get_LeftPos = function(SearchPos, ContentPos, Depth, U
return
true
;
}
CParagraphContentWithParagraphLikeContent
.
prototype
.
Get_LeftPos
.
call
(
this
,
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
);
var
bResult
=
CParagraphContentWithParagraphLikeContent
.
prototype
.
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
;
};
CInlineLevelSdt
.
prototype
.
Get_RightPos
=
function
(
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
,
StepEnd
)
{
...
...
@@ -157,7 +166,16 @@ CInlineLevelSdt.prototype.Get_RightPos = function(SearchPos, ContentPos, Depth,
return
true
;
}
CParagraphContentWithParagraphLikeContent
.
prototype
.
Get_RightPos
.
call
(
this
,
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
,
StepEnd
);
var
bResult
=
CParagraphContentWithParagraphLikeContent
.
prototype
.
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
;
};
CInlineLevelSdt
.
prototype
.
Remove
=
function
(
nDirection
,
bOnAddText
)
{
...
...
@@ -188,29 +206,27 @@ CInlineLevelSdt.prototype.Shift_Range = function(Dx, Dy, _CurLine, _CurRange)
};
CInlineLevelSdt
.
prototype
.
Get_WordStartPos
=
function
(
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
)
{
var
bResult
=
CParagraphContentWithParagraphLikeContent
.
prototype
.
Get_WordStartPos
.
call
(
this
,
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
);
CParagraphContentWithParagraphLikeContent
.
prototype
.
Get_WordStartPos
.
call
(
this
,
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
);
if
(
true
!==
bResult
&&
this
.
Paragraph
&&
this
.
Paragraph
.
LogicDocument
)
if
(
true
!==
SearchPos
.
Found
&&
this
.
Paragraph
&&
this
.
Paragraph
.
LogicDocument
&&
true
===
this
.
Paragraph
.
LogicDocument
.
IsFillingFormMode
()
)
{
this
.
Get_StartPos
(
SearchPos
.
Pos
,
Depth
);
SearchPos
.
Found
=
true
;
return
true
;
}
SearchPos
.
UpdatePos
=
true
;
SearchPos
.
Found
=
true
;
return
bResult
;
}
};
CInlineLevelSdt
.
prototype
.
Get_WordEndPos
=
function
(
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
,
StepEnd
)
{
var
bResult
=
CParagraphContentWithParagraphLikeContent
.
prototype
.
Get_WordEndPos
.
call
(
this
,
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
,
StepEnd
);
CParagraphContentWithParagraphLikeContent
.
prototype
.
Get_WordEndPos
.
call
(
this
,
SearchPos
,
ContentPos
,
Depth
,
UseContentPos
,
StepEnd
);
if
(
true
!==
bResult
&&
this
.
Paragraph
&&
this
.
Paragraph
.
LogicDocument
)
if
(
true
!==
SearchPos
.
Found
&&
this
.
Paragraph
&&
this
.
Paragraph
.
LogicDocument
&&
true
===
this
.
Paragraph
.
LogicDocument
.
IsFillingFormMode
()
)
{
this
.
Get_EndPos
(
false
,
SearchPos
.
Pos
,
Depth
);
SearchPos
.
Found
=
true
;
return
true
;
}
SearchPos
.
UpdatePos
=
true
;
SearchPos
.
Found
=
true
;
return
bResult
;
}
};
CInlineLevelSdt
.
prototype
.
GetBoundingPolygon
=
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