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
a1397636
Commit
a1397636
authored
Apr 13, 2017
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented moving cursor right/left in the new class CBlockLevelSdt.
parent
269b40de
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
457 additions
and
509 deletions
+457
-509
word/Editor/Document.js
word/Editor/Document.js
+26
-163
word/Editor/DocumentContent.js
word/Editor/DocumentContent.js
+261
-342
word/Editor/DocumentContentElementBase.js
word/Editor/DocumentContentElementBase.js
+49
-0
word/Editor/DocumentControllerBase.js
word/Editor/DocumentControllerBase.js
+1
-1
word/Editor/LogicDocumentController.js
word/Editor/LogicDocumentController.js
+2
-2
word/Editor/Paragraph.js
word/Editor/Paragraph.js
+14
-0
word/Editor/StructuredDocumentTags/BlockLevel.js
word/Editor/StructuredDocumentTags/BlockLevel.js
+44
-0
word/Editor/Table.js
word/Editor/Table.js
+60
-1
No files found.
word/Editor/Document.js
View file @
a1397636
This diff is collapsed.
Click to expand it.
word/Editor/DocumentContent.js
View file @
a1397636
This diff is collapsed.
Click to expand it.
word/Editor/DocumentContentElementBase.js
View file @
a1397636
...
@@ -181,6 +181,10 @@ CDocumentContentElementBase.prototype.Is_SelectionUse = function()
...
@@ -181,6 +181,10 @@ CDocumentContentElementBase.prototype.Is_SelectionUse = function()
{
{
return
false
;
return
false
;
};
};
CDocumentContentElementBase
.
prototype
.
IsSelectionToEnd
=
function
()
{
return
false
;
};
CDocumentContentElementBase
.
prototype
.
Selection_Remove
=
function
()
CDocumentContentElementBase
.
prototype
.
Selection_Remove
=
function
()
{
{
};
};
...
@@ -284,6 +288,51 @@ CDocumentContentElementBase.prototype.GetNearestPos = function(CurPage, X, Y, bA
...
@@ -284,6 +288,51 @@ CDocumentContentElementBase.prototype.GetNearestPos = function(CurPage, X, Y, bA
CDocumentContentElementBase
.
prototype
.
CanUpdateTarget
=
function
(
CurPage
)
CDocumentContentElementBase
.
prototype
.
CanUpdateTarget
=
function
(
CurPage
)
{
{
return
false
;
return
false
;
};
CDocumentContentElementBase
.
prototype
.
Cursor_MoveLeft
=
function
(
Count
,
AddToSelect
,
Word
)
{
return
false
;
};
CDocumentContentElementBase
.
prototype
.
MoveCursorLeftWithSelectionFromEnd
=
function
(
Word
)
{
};
CDocumentContentElementBase
.
prototype
.
MoveCursorLeft
=
function
(
AddToSelect
,
Word
)
{
return
this
.
Cursor_MoveLeft
(
1
,
AddToSelect
,
Word
);
};
CDocumentContentElementBase
.
prototype
.
Cursor_MoveRight
=
function
(
Count
,
AddToSelect
,
Word
)
{
return
false
;
};
CDocumentContentElementBase
.
prototype
.
MoveCursorRight
=
function
(
AddToSelect
,
Word
)
{
return
this
.
Cursor_MoveRight
(
1
,
AddToSelect
,
Word
);
};
CDocumentContentElementBase
.
prototype
.
MoveCursorRightWithSelectionFromStart
=
function
(
Word
)
{
};
CDocumentContentElementBase
.
prototype
.
Cursor_MoveToStartPos
=
function
(
AddToSelect
)
{
};
CDocumentContentElementBase
.
prototype
.
MoveCursorToStartPos
=
function
(
AddToSelect
)
{
return
this
.
Cursor_MoveToStartPos
(
AddToSelect
);
};
CDocumentContentElementBase
.
prototype
.
Cursor_MoveToEndPos
=
function
(
AddToSelect
,
StartSelectFromEnd
)
{
};
CDocumentContentElementBase
.
prototype
.
MoveCursorToEndPos
=
function
(
AddToSelect
,
StartSelectFromEnd
)
{
return
this
.
Cursor_MoveToEndPos
(
AddToSelect
,
StartSelectFromEnd
);
};
CDocumentContentElementBase
.
prototype
.
Get_SelectionState
=
function
()
{
return
[];
};
CDocumentContentElementBase
.
prototype
.
Set_SelectionState
=
function
(
State
,
StateIndex
)
{
};
};
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
// Функции для работы с номерами страниц
// Функции для работы с номерами страниц
...
...
word/Editor/DocumentControllerBase.js
View file @
a1397636
...
@@ -364,7 +364,7 @@ CDocumentControllerBase.prototype.MoveCursorLeft = function(AddToSelect, Word){r
...
@@ -364,7 +364,7 @@ CDocumentControllerBase.prototype.MoveCursorLeft = function(AddToSelect, Word){r
* @param {boolean} FromPaste Пришла ли данная комнда после "вставки"
* @param {boolean} FromPaste Пришла ли данная комнда после "вставки"
* @returns {boolean} Получилось ли перемещение, или мы достигли предела.
* @returns {boolean} Получилось ли перемещение, или мы достигли предела.
*/
*/
CDocumentControllerBase
.
prototype
.
MoveCursorRight
=
function
(
AddToSelect
,
Word
,
FromPaste
){
return
false
;};
CDocumentControllerBase
.
prototype
.
MoveCursorRight
=
function
(
AddToSelect
,
Word
){
return
false
;};
/**
/**
* Смещаем курсор вверх.
* Смещаем курсор вверх.
* @param AddToSelect Добавлять ли к селекту смещение
* @param AddToSelect Добавлять ли к селекту смещение
...
...
word/Editor/LogicDocumentController.js
View file @
a1397636
...
@@ -82,9 +82,9 @@ CLogicDocumentController.prototype.MoveCursorLeft = function(AddToSelect, Word)
...
@@ -82,9 +82,9 @@ CLogicDocumentController.prototype.MoveCursorLeft = function(AddToSelect, Word)
{
{
return
this
.
LogicDocument
.
controller_MoveCursorLeft
(
AddToSelect
,
Word
);
return
this
.
LogicDocument
.
controller_MoveCursorLeft
(
AddToSelect
,
Word
);
};
};
CLogicDocumentController
.
prototype
.
MoveCursorRight
=
function
(
AddToSelect
,
Word
,
FromPaste
)
CLogicDocumentController
.
prototype
.
MoveCursorRight
=
function
(
AddToSelect
,
Word
)
{
{
return
this
.
LogicDocument
.
controller_MoveCursorRight
(
AddToSelect
,
Word
,
FromPaste
);
return
this
.
LogicDocument
.
controller_MoveCursorRight
(
AddToSelect
,
Word
);
};
};
CLogicDocumentController
.
prototype
.
MoveCursorUp
=
function
(
AddToSelect
)
CLogicDocumentController
.
prototype
.
MoveCursorUp
=
function
(
AddToSelect
)
{
{
...
...
word/Editor/Paragraph.js
View file @
a1397636
...
@@ -4106,6 +4106,11 @@ Paragraph.prototype.Cursor_MoveLeft = function(Count, AddToSelect, Word)
...
@@ -4106,6 +4106,11 @@ Paragraph.prototype.Cursor_MoveLeft = function(Count, AddToSelect, Word)
return
true
;
return
true
;
};
};
Paragraph
.
prototype
.
MoveCursorLeftWithSelectionFromEnd
=
function
(
Word
)
{
this
.
MoveCursorToEndPos
(
true
,
true
);
this
.
MoveCursorLeft
(
true
,
Word
);
};
Paragraph
.
prototype
.
Cursor_MoveRight
=
function
(
Count
,
AddToSelect
,
Word
)
Paragraph
.
prototype
.
Cursor_MoveRight
=
function
(
Count
,
AddToSelect
,
Word
)
{
{
if
(
true
===
this
.
Selection
.
Use
)
if
(
true
===
this
.
Selection
.
Use
)
...
@@ -4210,6 +4215,11 @@ Paragraph.prototype.Cursor_MoveRight = function(Count, AddToSelect, Word)
...
@@ -4210,6 +4215,11 @@ Paragraph.prototype.Cursor_MoveRight = function(Count, AddToSelect, Word)
return
true
;
return
true
;
};
};
Paragraph
.
prototype
.
MoveCursorRightWithSelectionFromStart
=
function
(
Word
)
{
this
.
MoveCursorToStartPos
(
false
);
this
.
MoveCursorRight
(
true
,
Word
);
};
Paragraph
.
prototype
.
Cursor_MoveAt
=
function
(
X
,
Y
,
bLine
,
bDontChangeRealPos
,
CurPage
)
Paragraph
.
prototype
.
Cursor_MoveAt
=
function
(
X
,
Y
,
bLine
,
bDontChangeRealPos
,
CurPage
)
{
{
var
SearchPosXY
=
this
.
Get_ParaContentPosByXY
(
X
,
Y
,
CurPage
,
bLine
,
false
);
var
SearchPosXY
=
this
.
Get_ParaContentPosByXY
(
X
,
Y
,
CurPage
,
bLine
,
false
);
...
@@ -5188,6 +5198,10 @@ Paragraph.prototype.Is_SelectionUse = function()
...
@@ -5188,6 +5198,10 @@ Paragraph.prototype.Is_SelectionUse = function()
{
{
return
this
.
Selection
.
Use
;
return
this
.
Selection
.
Use
;
};
};
Paragraph
.
prototype
.
IsSelectionToEnd
=
function
()
{
return
this
.
Selection_CheckParaEnd
();
};
/**
/**
* Функция определяет начальную позицию курсора в параграфе
* Функция определяет начальную позицию курсора в параграфе
*/
*/
...
...
word/Editor/StructuredDocumentTags/BlockLevel.js
View file @
a1397636
...
@@ -163,6 +163,10 @@ CBlockLevelSdt.prototype.Is_SelectionUse = function()
...
@@ -163,6 +163,10 @@ CBlockLevelSdt.prototype.Is_SelectionUse = function()
{
{
return
this
.
Content
.
Is_SelectionUse
();
return
this
.
Content
.
Is_SelectionUse
();
};
};
CBlockLevelSdt
.
prototype
.
IsSelectionToEnd
=
function
()
{
return
this
.
Content
.
IsSelectionToEnd
();
};
CBlockLevelSdt
.
prototype
.
Selection_Remove
=
function
()
CBlockLevelSdt
.
prototype
.
Selection_Remove
=
function
()
{
{
this
.
Content
.
Selection_Remove
();
this
.
Content
.
Selection_Remove
();
...
@@ -219,6 +223,38 @@ CBlockLevelSdt.prototype.CanUpdateTarget = function(CurPage)
...
@@ -219,6 +223,38 @@ CBlockLevelSdt.prototype.CanUpdateTarget = function(CurPage)
{
{
return
this
.
Content
.
CanUpdateTatget
(
CurPage
);
return
this
.
Content
.
CanUpdateTatget
(
CurPage
);
};
};
CBlockLevelSdt
.
prototype
.
Cursor_MoveLeft
=
function
(
Count
,
AddToSelect
,
Word
)
{
return
this
.
Content
.
Cursor_MoveLeft
(
AddToSelect
,
Word
);
};
CBlockLevelSdt
.
prototype
.
MoveCursorLeftWithSelectionFromEnd
=
function
(
Word
)
{
return
this
.
Content
.
MoveCursorLeftWithSelectionFromEnd
(
Word
);
};
CBlockLevelSdt
.
prototype
.
Cursor_MoveRight
=
function
(
Count
,
AddToSelect
,
Word
)
{
return
this
.
Content
.
Cursor_MoveRight
(
AddToSelect
,
Word
,
false
);
};
CBlockLevelSdt
.
prototype
.
MoveCursorRightWithSelectionFromStart
=
function
(
Word
)
{
return
this
.
Content
.
MoveCursorRightWithSelectionFromStart
(
Word
);
};
CBlockLevelSdt
.
prototype
.
Cursor_MoveToStartPos
=
function
(
AddToSelect
)
{
return
this
.
Content
.
Cursor_MoveToStartPos
(
AddToSelect
);
};
CBlockLevelSdt
.
prototype
.
Cursor_MoveToEndPos
=
function
(
AddToSelect
,
StartSelectFromEnd
)
{
return
this
.
Content
.
Cursor_MoveToEndPos
(
AddToSelect
,
StartSelectFromEnd
);
};
CBlockLevelSdt
.
prototype
.
Get_SelectionState
=
function
()
{
return
this
.
Content
.
Get_SelectionState
();
};
CBlockLevelSdt
.
prototype
.
Set_SelectionState
=
function
(
State
,
StateIndex
)
{
return
this
.
Content
.
Set_SelectionState
(
State
,
StateIndex
);
};
//----------------------------------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------------------------------
CBlockLevelSdt
.
prototype
.
Is_HdrFtr
=
function
(
bReturnHdrFtr
)
CBlockLevelSdt
.
prototype
.
Is_HdrFtr
=
function
(
bReturnHdrFtr
)
{
{
...
@@ -294,6 +330,14 @@ CBlockLevelSdt.prototype.Get_ParentTextTransform = function()
...
@@ -294,6 +330,14 @@ CBlockLevelSdt.prototype.Get_ParentTextTransform = function()
{
{
return
this
.
Parent
.
Get_ParentTextTransform
();
return
this
.
Parent
.
Get_ParentTextTransform
();
};
};
CBlockLevelSdt
.
prototype
.
Set_CurrentElement
=
function
(
bUpdateStates
,
PageAbs
,
oDocContent
)
{
if
(
oDocContent
===
this
.
Content
)
{
this
.
Parent
.
Update_ContentIndexing
();
this
.
Parent
.
Set_CurrentElement
(
this
.
Index
,
bUpdateStates
);
}
};
//--------------------------------------------------------export--------------------------------------------------------
//--------------------------------------------------------export--------------------------------------------------------
window
[
'
AscCommonWord
'
]
=
window
[
'
AscCommonWord
'
]
||
{};
window
[
'
AscCommonWord
'
]
=
window
[
'
AscCommonWord
'
]
||
{};
window
[
'
AscCommonWord
'
].
CBlockLevelSdt
=
CBlockLevelSdt
;
window
[
'
AscCommonWord
'
].
CBlockLevelSdt
=
CBlockLevelSdt
;
...
...
word/Editor/Table.js
View file @
a1397636
...
@@ -5146,7 +5146,7 @@ CTable.prototype.Select_All = function(nDirection)
...
@@ -5146,7 +5146,7 @@ CTable.prototype.Select_All = function(nDirection)
/**
/**
* В данной функции проверяется идет ли выделение таблицы до конца таблицы.
* В данной функции проверяется идет ли выделение таблицы до конца таблицы.
*/
*/
CTable
.
prototype
.
Selection_Is
ToEnd
=
function
()
CTable
.
prototype
.
IsSelection
ToEnd
=
function
()
{
{
if
(
true
===
this
.
ApplyToAll
||
(
true
===
this
.
Selection
.
Use
&&
table_Selection_Cell
===
this
.
Selection
.
Type
&&
this
.
Selection
.
Data
.
length
>
0
))
if
(
true
===
this
.
ApplyToAll
||
(
true
===
this
.
Selection
.
Use
&&
table_Selection_Cell
===
this
.
Selection
.
Type
&&
this
.
Selection
.
Data
.
length
>
0
))
{
{
...
@@ -5615,6 +5615,36 @@ CTable.prototype.Cursor_MoveLeft = function(Count, AddToSelect, Word)
...
@@ -5615,6 +5615,36 @@ CTable.prototype.Cursor_MoveLeft = function(Count, AddToSelect, Word)
}
}
}
}
};
};
CTable
.
prototype
.
MoveCursorLeftWithSelectionFromEnd
=
function
(
Word
)
{
if
(
true
===
this
.
IsSelectionUse
())
this
.
RemoveSelection
();
if
(
this
.
Content
.
length
<=
0
)
return
;
var
LastRow
=
this
.
Content
[
this
.
Content
.
length
-
1
];
// Нам нужно выделить последний ряд таблицы
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
Type
=
table_Selection_Cell
;
this
.
Selection
.
StartPos
.
Pos
=
{
Row
:
LastRow
.
Index
,
Cell
:
LastRow
.
Get_CellsCount
()
-
1
};
this
.
Selection
.
EndPos
.
Pos
=
{
Row
:
LastRow
.
Index
,
Cell
:
0
};
this
.
CurCell
=
LastRow
.
Get_Cell
(
0
);
this
.
Selection
.
Data
=
[];
for
(
var
CellIndex
=
0
;
CellIndex
<
LastRow
.
Get_CellsCount
();
CellIndex
++
)
{
this
.
Selection
.
Data
.
push
({
Cell
:
CellIndex
,
Row
:
LastRow
.
Index
});
}
};
CTable
.
prototype
.
Cursor_MoveRight
=
function
(
Count
,
AddToSelect
,
Word
,
FromPaste
)
CTable
.
prototype
.
Cursor_MoveRight
=
function
(
Count
,
AddToSelect
,
Word
,
FromPaste
)
{
{
if
(
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
Type
===
table_Selection_Cell
)
if
(
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
Type
===
table_Selection_Cell
)
...
@@ -5746,6 +5776,35 @@ CTable.prototype.Cursor_MoveRight = function(Count, AddToSelect, Word, FromPaste
...
@@ -5746,6 +5776,35 @@ CTable.prototype.Cursor_MoveRight = function(Count, AddToSelect, Word, FromPaste
}
}
}
}
};
};
CTable
.
prototype
.
MoveCursorRightWithSelectionFromStart
=
function
(
Word
)
{
if
(
true
===
this
.
IsSelectionUse
())
this
.
RemoveSelection
();
if
(
this
.
Content
.
length
<=
0
)
return
;
var
FirstRow
=
this
.
Content
[
0
];
// Нам нужно выделить первый ряд таблицы
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
Type
=
table_Selection_Cell
;
this
.
Selection
.
StartPos
.
Pos
=
{
Row
:
0
,
Cell
:
0
};
this
.
Selection
.
EndPos
.
Pos
=
{
Row
:
0
,
Cell
:
FirstRow
.
Get_CellsCount
()
-
1
};
this
.
CurCell
=
FirstRow
.
Get_Cell
(
FirstRow
.
Get_CellsCount
()
-
1
);
this
.
Selection
.
Data
=
[];
for
(
var
CellIndex
=
0
;
CellIndex
<
FirstRow
.
Get_CellsCount
();
CellIndex
++
)
{
this
.
Selection
.
Data
.
push
({
Cell
:
CellIndex
,
Row
:
0
});
}
};
CTable
.
prototype
.
Cursor_MoveUp
=
function
(
Count
,
AddToSelect
)
CTable
.
prototype
.
Cursor_MoveUp
=
function
(
Count
,
AddToSelect
)
{
{
if
(
true
===
this
.
Selection
.
Use
&&
table_Selection_Cell
===
this
.
Selection
.
Type
)
if
(
true
===
this
.
Selection
.
Use
&&
table_Selection_Cell
===
this
.
Selection
.
Type
)
...
...
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