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
e857a6e9
Commit
e857a6e9
authored
Jun 21, 2016
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Рефакторинг функций, работающих с таблицей.
parent
f1d2b0be
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
439 additions
and
291 deletions
+439
-291
word/Editor/Document.js
word/Editor/Document.js
+230
-289
word/Editor/DocumentControllerBase.js
word/Editor/DocumentControllerBase.js
+45
-1
word/Editor/DrawingsController.js
word/Editor/DrawingsController.js
+40
-0
word/Editor/Footnotes.js
word/Editor/Footnotes.js
+42
-1
word/Editor/HeaderFooterController.js
word/Editor/HeaderFooterController.js
+42
-0
word/Editor/LogicDocumentController.js
word/Editor/LogicDocumentController.js
+40
-0
No files found.
word/Editor/Document.js
View file @
e857a6e9
...
...
@@ -7681,311 +7681,68 @@ CDocument.prototype.Get_SelectedElementsInfo = function()
//----------------------------------------------------------------------------------------------------------------------
CDocument
.
prototype
.
Table_AddRow
=
function
(
bBefore
)
{
// Работаем с колонтитулом
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
{
this
.
HdrFtr
.
Table_AddRow
(
bBefore
);
this
.
Recalculate
();
}
else
if
(
docpostype_DrawingObjects
===
this
.
CurPos
.
Type
)
{
this
.
DrawingObjects
.
tableAddRow
(
bBefore
);
}
else
if
(
docpostype_Content
==
this
.
CurPos
.
Type
&&
(
(
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
()
)
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()
)
))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
this
.
Content
[
Pos
].
Row_Add
(
bBefore
);
if
(
false
===
this
.
Selection
.
Use
&&
true
===
this
.
Content
[
Pos
].
Is_SelectionUse
())
{
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
StartPos
=
Pos
;
this
.
Selection
.
EndPos
=
Pos
;
}
this
.
ContentLastChangePos
=
Pos
;
this
.
Controller
.
AddTableRow
(
bBefore
);
this
.
Recalculate
();
}
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateInterfaceState
();
};
CDocument
.
prototype
.
Table_AddCol
=
function
(
bBefore
)
{
// Работаем с колонтитулом
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
{
this
.
HdrFtr
.
Table_AddCol
(
bBefore
);
this
.
Controller
.
AddTableCol
(
bBefore
);
this
.
Recalculate
();
}
else
if
(
docpostype_DrawingObjects
===
this
.
CurPos
.
Type
)
{
this
.
DrawingObjects
.
tableAddCol
(
bBefore
);
}
else
if
(
docpostype_Content
==
this
.
CurPos
.
Type
&&
(
(
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
()
)
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()
)
))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
this
.
Content
[
Pos
].
Col_Add
(
bBefore
);
if
(
false
===
this
.
Selection
.
Use
&&
true
===
this
.
Content
[
Pos
].
Is_SelectionUse
())
{
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
StartPos
=
Pos
;
this
.
Selection
.
EndPos
=
Pos
;
}
this
.
ContentLastChangePos
=
Pos
;
this
.
Recalculate
();
}
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateInterfaceState
();
};
CDocument
.
prototype
.
Table_RemoveRow
=
function
()
{
// Работаем с колонтитулом
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
{
this
.
HdrFtr
.
Table_RemoveRow
();
this
.
Controller
.
RemoveTableRow
();
this
.
Recalculate
();
}
else
if
(
docpostype_DrawingObjects
==
this
.
CurPos
.
Type
)
{
this
.
DrawingObjects
.
tableRemoveRow
();
}
else
if
(
docpostype_Content
==
this
.
CurPos
.
Type
&&
(
(
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
()
)
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()
)
))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
if
(
false
===
this
.
Content
[
Pos
].
Row_Remove
())
this
.
Table_RemoveTable
();
else
{
this
.
ContentLastChangePos
=
Pos
;
this
.
Recalculate
();
}
}
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateInterfaceState
();
};
CDocument
.
prototype
.
Table_RemoveCol
=
function
()
{
// Работаем с колонтитулом
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
{
this
.
HdrFtr
.
Table_RemoveCol
();
this
.
Controller
.
RemoveTableCol
();
this
.
Recalculate
();
}
else
if
(
docpostype_DrawingObjects
===
this
.
CurPos
.
Type
)
{
this
.
DrawingObjects
.
tableRemoveCol
();
}
else
if
(
docpostype_Content
==
this
.
CurPos
.
Type
&&
(
(
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
()
)
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()
)
))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
if
(
false
===
this
.
Content
[
Pos
].
Col_Remove
())
this
.
Table_RemoveTable
();
else
{
this
.
ContentLastChangePos
=
Pos
;
this
.
Recalculate
();
}
}
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateInterfaceState
();
};
CDocument
.
prototype
.
Table_MergeCells
=
function
()
{
// Работаем с колонтитулом
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
{
this
.
HdrFtr
.
Table_MergeCells
();
this
.
Recalculate
();
}
else
if
(
docpostype_DrawingObjects
===
this
.
CurPos
.
Type
)
{
this
.
DrawingObjects
.
tableMergeCells
();
}
else
if
(
docpostype_Content
==
this
.
CurPos
.
Type
&&
(
(
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
()
)
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()
)
))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
this
.
Content
[
Pos
].
Cell_Merge
();
this
.
ContentLastChangePos
=
Pos
;
this
.
Controller
.
MergeTableCells
();
this
.
Recalculate
();
}
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateInterfaceState
();
};
CDocument
.
prototype
.
Table_SplitCell
=
function
(
Cols
,
Rows
)
{
// Работаем с колонтитулом
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
{
this
.
HdrFtr
.
Table_SplitCell
(
Cols
,
Rows
);
this
.
Controller
.
SplitTableCells
(
Cols
,
Rows
);
this
.
Recalculate
();
}
else
if
(
docpostype_DrawingObjects
===
this
.
CurPos
.
Type
)
{
this
.
DrawingObjects
.
tableSplitCell
(
Cols
,
Rows
);
}
else
if
(
docpostype_Content
==
this
.
CurPos
.
Type
&&
(
(
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
()
)
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()
)
))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
this
.
Content
[
Pos
].
Cell_Split
(
Rows
,
Cols
);
this
.
ContentLastChangePos
=
Pos
;
this
.
Recalculate
();
}
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateInterfaceState
();
};
CDocument
.
prototype
.
Table_RemoveTable
=
function
()
{
// Работаем с колонтитулом
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
{
this
.
HdrFtr
.
Table_RemoveTable
();
this
.
Controller
.
RemoveTable
();
this
.
Recalculate
();
}
else
if
(
docpostype_DrawingObjects
===
this
.
CurPos
.
Type
)
return
this
.
DrawingObjects
.
tableRemoveTable
();
else
if
(
docpostype_Content
==
this
.
CurPos
.
Type
&&
(
(
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
()
)
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()
)
))
{
var
Pos
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
var
Table
=
this
.
Content
[
Pos
];
if
(
true
===
Table
.
Is_InnerTable
())
Table
.
Remove_InnerTable
();
else
{
this
.
Selection_Remove
();
Table
.
PreDelete
();
this
.
Internal_Content_Remove
(
Pos
,
1
);
if
(
Pos
>=
this
.
Content
.
length
-
1
)
Pos
--
;
if
(
Pos
<
0
)
Pos
=
0
;
this
.
Set_DocPosType
(
docpostype_Content
);
this
.
CurPos
.
ContentPos
=
Pos
;
this
.
Content
[
Pos
].
Cursor_MoveToStartPos
();
this
.
ContentLastChangePos
=
Pos
;
this
.
Recalculate
();
}
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateRulersState
();
}
};
CDocument
.
prototype
.
Table_Select
=
function
(
Type
)
{
// Работаем с колонтитулом
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
{
this
.
HdrFtr
.
Table_Select
(
Type
);
}
else
if
(
docpostype_DrawingObjects
==
this
.
CurPos
.
Type
)
{
this
.
DrawingObjects
.
tableSelect
(
Type
);
}
else
if
(
docpostype_Content
==
this
.
CurPos
.
Type
&&
(
(
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
()
)
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()
)
))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
this
.
Content
[
Pos
].
Table_Select
(
Type
);
if
(
false
===
this
.
Selection
.
Use
&&
true
===
this
.
Content
[
Pos
].
Is_SelectionUse
())
{
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
StartPos
=
Pos
;
this
.
Selection
.
EndPos
=
Pos
;
}
}
this
.
Controller
.
SelectTable
(
Type
);
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateInterfaceState
();
//this.Document_UpdateRulersState();
};
CDocument
.
prototype
.
Table_CheckMerge
=
function
()
{
// Работаем с колонтитулом
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
return
this
.
HdrFtr
.
Table_CheckMerge
();
else
if
(
docpostype_DrawingObjects
==
this
.
CurPos
.
Type
)
{
return
this
.
DrawingObjects
.
tableCheckMerge
();
}
else
if
(
docpostype_Content
==
this
.
CurPos
.
Type
&&
(
(
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
()
)
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()
)
))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
return
this
.
Content
[
Pos
].
Check_Merge
();
}
return
false
;
return
this
.
Controller
.
CanMergeTableCells
();
};
CDocument
.
prototype
.
Table_CheckSplit
=
function
()
{
// Работаем с колонтитулом
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
return
this
.
HdrFtr
.
Table_CheckSplit
();
else
if
(
docpostype_DrawingObjects
===
this
.
CurPos
.
Type
)
return
this
.
DrawingObjects
.
tableCheckSplit
();
else
if
(
docpostype_Content
==
this
.
CurPos
.
Type
&&
(
(
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
()
)
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()
)
))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
return
this
.
Content
[
Pos
].
Check_Split
();
}
return
false
;
return
this
.
Controller
.
CanSplitTableCells
();
};
CDocument
.
prototype
.
Check_TableCoincidence
=
function
(
Table
)
{
...
...
@@ -15831,6 +15588,190 @@ CDocument.prototype.controller_GetSelectedElementsInfo = function(Info)
this
.
Content
[
this
.
CurPos
.
ContentPos
].
Get_SelectedElementsInfo
(
Info
);
}
};
CDocument
.
prototype
.
controller_AddTableRow
=
function
(
bBefore
)
{
if
((
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
())
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
this
.
Content
[
Pos
].
Row_Add
(
bBefore
);
if
(
false
===
this
.
Selection
.
Use
&&
true
===
this
.
Content
[
Pos
].
Is_SelectionUse
())
{
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
StartPos
=
Pos
;
this
.
Selection
.
EndPos
=
Pos
;
}
}
};
CDocument
.
prototype
.
controller_AddTableCol
=
function
(
bBefore
)
{
if
((
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
())
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
this
.
Content
[
Pos
].
Col_Add
(
bBefore
);
if
(
false
===
this
.
Selection
.
Use
&&
true
===
this
.
Content
[
Pos
].
Is_SelectionUse
())
{
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
StartPos
=
Pos
;
this
.
Selection
.
EndPos
=
Pos
;
}
}
};
CDocument
.
prototype
.
controller_RemoveTableRow
=
function
()
{
if
((
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
())
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
if
(
false
===
this
.
Content
[
Pos
].
Row_Remove
())
this
.
controller_RemoveTable
();
}
};
CDocument
.
prototype
.
controller_RemoveTableCol
=
function
()
{
if
((
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
())
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
if
(
false
===
this
.
Content
[
Pos
].
Col_Remove
())
this
.
controller_RemoveTable
();
}
};
CDocument
.
prototype
.
controller_MergeTableCells
=
function
()
{
if
((
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
())
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
this
.
Content
[
Pos
].
Cell_Merge
();
}
};
CDocument
.
prototype
.
controller_SplitTableCells
=
function
(
Cols
,
Rows
)
{
if
((
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
())
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
this
.
Content
[
Pos
].
Cell_Split
(
Rows
,
Cols
);
}
};
CDocument
.
prototype
.
controller_RemoveTable
=
function
()
{
if
((
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
())
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()))
{
var
Pos
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
var
Table
=
this
.
Content
[
Pos
];
if
(
true
===
Table
.
Is_InnerTable
())
Table
.
Remove_InnerTable
();
else
{
this
.
Selection_Remove
();
Table
.
PreDelete
();
this
.
Internal_Content_Remove
(
Pos
,
1
);
if
(
Pos
>=
this
.
Content
.
length
-
1
)
Pos
--
;
if
(
Pos
<
0
)
Pos
=
0
;
this
.
Set_DocPosType
(
docpostype_Content
);
this
.
CurPos
.
ContentPos
=
Pos
;
this
.
Content
[
Pos
].
Cursor_MoveToStartPos
();
}
}
};
CDocument
.
prototype
.
controller_SelectTable
=
function
(
Type
)
{
if
((
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
())
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
this
.
Content
[
Pos
].
Table_Select
(
Type
);
if
(
false
===
this
.
Selection
.
Use
&&
true
===
this
.
Content
[
Pos
].
Is_SelectionUse
())
{
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
StartPos
=
Pos
;
this
.
Selection
.
EndPos
=
Pos
;
}
}
};
CDocument
.
prototype
.
controller_CanMergeTableCells
=
function
()
{
if
((
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
())
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
return
this
.
Content
[
Pos
].
Check_Merge
();
}
return
false
;
};
CDocument
.
prototype
.
controller_CanSplitTableCells
=
function
()
{
if
((
true
===
this
.
Selection
.
Use
&&
this
.
Selection
.
StartPos
==
this
.
Selection
.
EndPos
&&
type_Table
==
this
.
Content
[
this
.
Selection
.
StartPos
].
GetType
())
||
(
false
==
this
.
Selection
.
Use
&&
type_Table
==
this
.
Content
[
this
.
CurPos
.
ContentPos
].
GetType
()))
{
var
Pos
=
0
;
if
(
true
===
this
.
Selection
.
Use
)
Pos
=
this
.
Selection
.
StartPos
;
else
Pos
=
this
.
CurPos
.
ContentPos
;
return
this
.
Content
[
Pos
].
Check_Split
();
}
return
false
;
};
CDocument
.
prototype
.
controller_AddToParagraph
=
function
(
ParaItem
,
bRecalculate
)
{
...
...
word/Editor/DocumentControllerBase.js
View file @
e857a6e9
...
...
@@ -581,7 +581,51 @@ CDocumentControllerBase.prototype.GetCurrentParagraph = function(){return null};
* @param oInfo
*/
CDocumentControllerBase
.
prototype
.
GetSelectedElementsInfo
=
function
(
oInfo
){};
/**
* Добавляем строку таблицы.
* @param bBefore
*/
CDocumentControllerBase
.
prototype
.
AddTableRow
=
function
(
bBefore
){};
/**
* Добавляем столбец таблицы.
* @param bBefore
*/
CDocumentControllerBase
.
prototype
.
AddTableCol
=
function
(
bBefore
){};
/**
* Удаляем строку таблицы.
*/
CDocumentControllerBase
.
prototype
.
RemoveTableRow
=
function
(){};
/**
* Удаляем колонку таблицы.
*/
CDocumentControllerBase
.
prototype
.
RemoveTableCol
=
function
(){};
/**
* Объединяем ячейки таблицы.
*/
CDocumentControllerBase
.
prototype
.
MergeTableCells
=
function
(){};
/**
* Разбить ячейки таблицы.
*/
CDocumentControllerBase
.
prototype
.
SplitTableCells
=
function
(
Cols
,
Rows
){};
/**
* Удаляем таблицу.
*/
CDocumentControllerBase
.
prototype
.
RemoveTable
=
function
(){};
/**
* Выделяем таблицу или ее часть.
* @param Type тип выделения
*/
CDocumentControllerBase
.
prototype
.
SelectTable
=
function
(
Type
){};
/**
* Проверяем можем ли мы произвести объединение ячеек таблицы.
* @returns {boolean}
*/
CDocumentControllerBase
.
prototype
.
CanMergeTableCells
=
function
(){
return
false
;};
/**
* Проверяем можем ли мы произвести разделение ячеек таблицы.
* @returns {boolean}
*/
CDocumentControllerBase
.
prototype
.
CanSplitTableCells
=
function
(){
return
false
;};
/**
* Добавляем элемент в параграф.
* @param oItem
...
...
word/Editor/DrawingsController.js
View file @
e857a6e9
...
...
@@ -332,6 +332,46 @@ CDrawingsController.prototype.GetSelectedElementsInfo = function(oInfo)
{
this
.
DrawingObjects
.
getSelectedElementsInfo
(
oInfo
);
};
CDrawingsController
.
prototype
.
AddTableRow
=
function
(
bBefore
)
{
this
.
DrawingObjects
.
tableAddRow
(
bBefore
);
};
CDrawingsController
.
prototype
.
AddTableCol
=
function
(
bBefore
)
{
this
.
DrawingObjects
.
tableAddCol
(
bBefore
);
};
CDrawingsController
.
prototype
.
RemoveTableRow
=
function
()
{
this
.
DrawingObjects
.
tableRemoveRow
();
};
CDrawingsController
.
prototype
.
RemoveTableCol
=
function
()
{
this
.
DrawingObjects
.
tableRemoveCol
();
};
CDrawingsController
.
prototype
.
MergeTableCells
=
function
()
{
this
.
DrawingObjects
.
tableMergeCells
();
};
CDrawingsController
.
prototype
.
SplitTableCells
=
function
(
Cols
,
Rows
)
{
this
.
DrawingObjects
.
tableSplitCell
(
Cols
,
Rows
);
};
CDrawingsController
.
prototype
.
RemoveTable
=
function
()
{
this
.
DrawingObjects
.
tableRemoveTable
();
};
CDrawingsController
.
prototype
.
SelectTable
=
function
(
Type
)
{
this
.
DrawingObjects
.
tableSelect
(
Type
);
};
CDrawingsController
.
prototype
.
CanMergeTableCells
=
function
()
{
return
this
.
DrawingObjects
.
tableCheckMerge
();
};
CDrawingsController
.
prototype
.
CanSplitTableCells
=
function
()
{
return
this
.
DrawingObjects
.
tableCheckSplit
();
};
CDrawingsController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
{
...
...
word/Editor/Footnotes.js
View file @
e857a6e9
...
...
@@ -944,7 +944,48 @@ CFootnotesController.prototype.GetCurrentParagraph = function()
CFootnotesController
.
prototype
.
GetSelectedElementsInfo
=
function
(
oInfo
)
{
// TODO: Реализовать
};
CFootnotesController
.
prototype
.
AddTableRow
=
function
(
bBefore
)
{
// TODO: Реализовать
};
CFootnotesController
.
prototype
.
AddTableCol
=
function
(
bBefore
)
{
// TODO: Реализовать
};
CFootnotesController
.
prototype
.
RemoveTableRow
=
function
()
{
// TODO: Реализовать
};
CFootnotesController
.
prototype
.
RemoveTableCol
=
function
()
{
// TODO: Реализовать
};
CFootnotesController
.
prototype
.
MergeTableCells
=
function
()
{
// TODO: Реализовать
};
CFootnotesController
.
prototype
.
SplitTableCells
=
function
(
Cols
,
Rows
)
{
// TODO: Реализовать
};
CFootnotesController
.
prototype
.
RemoveTable
=
function
()
{
// TODO: Реализовать
};
CFootnotesController
.
prototype
.
SelectTable
=
function
(
Type
)
{
// TODO: Реализовать
};
CFootnotesController
.
prototype
.
CanMergeTableCells
=
function
()
{
// TODO: Реализовать
return
false
;
};
CFootnotesController
.
prototype
.
CanSplitTableCells
=
function
()
{
// TODO: Реализовать
return
false
;
};
CFootnotesController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
...
...
word/Editor/HeaderFooterController.js
View file @
e857a6e9
...
...
@@ -281,6 +281,48 @@ CHdrFtrController.prototype.GetSelectedElementsInfo = function(oInfo)
{
this
.
HdrFtr
.
Get_SelectedElementsInfo
(
oInfo
);
};
CHdrFtrController
.
prototype
.
AddTableRow
=
function
(
bBefore
)
{
this
.
HdrFtr
.
Table_AddRow
(
bBefore
);
};
CHdrFtrController
.
prototype
.
AddTableCol
=
function
(
bBefore
)
{
this
.
HdrFtr
.
Table_AddCol
(
bBefore
);
};
CHdrFtrController
.
prototype
.
RemoveTableRow
=
function
()
{
this
.
HdrFtr
.
Table_RemoveRow
();
};
CHdrFtrController
.
prototype
.
RemoveTableCol
=
function
()
{
this
.
HdrFtr
.
Table_RemoveCol
();
};
CHdrFtrController
.
prototype
.
MergeTableCells
=
function
()
{
this
.
HdrFtr
.
Table_MergeCells
();
};
CHdrFtrController
.
prototype
.
SplitTableCells
=
function
(
Cols
,
Rows
)
{
this
.
HdrFtr
.
Table_SplitCell
(
Cols
,
Rows
);
};
CHdrFtrController
.
prototype
.
RemoveTable
=
function
()
{
this
.
HdrFtr
.
Table_RemoveTable
();
};
CHdrFtrController
.
prototype
.
SelectTable
=
function
(
Type
)
{
this
.
HdrFtr
.
Table_Select
(
Type
);
};
CHdrFtrController
.
prototype
.
CanMergeTableCells
=
function
()
{
return
this
.
HdrFtr
.
Table_CheckMerge
();
};
CHdrFtrController
.
prototype
.
CanSplitTableCells
=
function
()
{
return
this
.
HdrFtr
.
Table_CheckSplit
();
};
CHdrFtrController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
...
...
word/Editor/LogicDocumentController.js
View file @
e857a6e9
...
...
@@ -257,6 +257,46 @@ CLogicDocumentController.prototype.GetSelectedElementsInfo = function(oInfo)
{
this
.
LogicDocument
.
controller_GetSelectedElementsInfo
(
oInfo
);
};
CLogicDocumentController
.
prototype
.
AddTableRow
=
function
(
bBefore
)
{
this
.
LogicDocument
.
controller_AddTableRow
(
bBefore
);
};
CLogicDocumentController
.
prototype
.
AddTableCol
=
function
(
bBefore
)
{
this
.
LogicDocument
.
controller_AddTableCol
(
bBefore
);
};
CLogicDocumentController
.
prototype
.
RemoveTableRow
=
function
()
{
this
.
LogicDocument
.
controller_RemoveTableRow
();
};
CLogicDocumentController
.
prototype
.
RemoveTableCol
=
function
()
{
this
.
LogicDocument
.
controller_RemoveTableCol
();
};
CLogicDocumentController
.
prototype
.
MergeTableCells
=
function
()
{
this
.
LogicDocument
.
controller_MergeTableCells
();
};
CLogicDocumentController
.
prototype
.
SplitTableCells
=
function
(
Cols
,
Rows
)
{
this
.
LogicDocument
.
controller_SplitTableCells
(
Cols
,
Rows
);
};
CLogicDocumentController
.
prototype
.
RemoveTable
=
function
()
{
this
.
LogicDocument
.
controller_RemoveTable
();
};
CLogicDocumentController
.
prototype
.
SelectTable
=
function
(
Type
)
{
this
.
LogicDocument
.
controller_SelectTable
(
Type
);
};
CLogicDocumentController
.
prototype
.
CanMergeTableCells
=
function
()
{
return
this
.
LogicDocument
.
controller_CanMergeTableCells
();
};
CLogicDocumentController
.
prototype
.
CanSplitTableCells
=
function
()
{
return
this
.
LogicDocument
.
controller_CanSplitTableCells
();
};
CLogicDocumentController
.
prototype
.
AddToParagraph
=
function
(
oItem
)
...
...
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