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
93a4d3c9
Commit
93a4d3c9
authored
Jun 21, 2016
by
Ilya Kirillov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Рефакторинг.
parent
e3730702
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1075 additions
and
1033 deletions
+1075
-1033
word/Editor/Document.js
word/Editor/Document.js
+1016
-1032
word/Editor/DocumentControllerBase.js
word/Editor/DocumentControllerBase.js
+10
-0
word/Editor/DrawingsController.js
word/Editor/DrawingsController.js
+9
-0
word/Editor/Footnotes.js
word/Editor/Footnotes.js
+24
-1
word/Editor/HeaderFooterController.js
word/Editor/HeaderFooterController.js
+8
-0
word/Editor/LogicDocumentController.js
word/Editor/LogicDocumentController.js
+8
-0
No files found.
word/Editor/Document.js
View file @
93a4d3c9
...
@@ -5256,7 +5256,7 @@ CDocument.prototype.Selection_Is_TableBorderMove = function()
...
@@ -5256,7 +5256,7 @@ CDocument.prototype.Selection_Is_TableBorderMove = function()
* Проверяем попали ли мы в селект.
* Проверяем попали ли мы в селект.
* @param X
* @param X
* @param Y
* @param Y
* @param Page
_
Abs
* @param PageAbs
* @param NearPos
* @param NearPos
* @returns {boolean}
* @returns {boolean}
*/
*/
...
@@ -5377,405 +5377,348 @@ CDocument.prototype.On_DragTextEnd = function(NearPos, bCopy)
...
@@ -5377,405 +5377,348 @@ CDocument.prototype.On_DragTextEnd = function(NearPos, bCopy)
*/
*/
CDocument
.
prototype
.
Get_SelectedContent
=
function
(
bUseHistory
)
CDocument
.
prototype
.
Get_SelectedContent
=
function
(
bUseHistory
)
{
{
var
bNeedTurnOffTableId
=
g_oTableId
.
m_bTurnOff
===
false
&&
true
!==
bUseHistory
;
var
bNeedTurnOffTableId
=
g_oTableId
.
m_bTurnOff
===
false
&&
true
!==
bUseHistory
;
if
(
!
bUseHistory
)
if
(
!
bUseHistory
)
History
.
TurnOff
();
History
.
TurnOff
();
if
(
bNeedTurnOffTableId
)
if
(
bNeedTurnOffTableId
)
{
{
g_oTableId
.
m_bTurnOff
=
true
;
g_oTableId
.
m_bTurnOff
=
true
;
}
}
var
SelectedContent
=
new
CSelectedContent
();
// Заполняем выделенный контент
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
this
.
HdrFtr
.
Get_SelectedContent
(
SelectedContent
);
else
if
(
docpostype_DrawingObjects
===
this
.
CurPos
.
Type
)
this
.
DrawingObjects
.
Get_SelectedContent
(
SelectedContent
);
else
{
if
(
true
!==
this
.
Selection
.
Use
||
this
.
Selection
.
Flag
!==
selectionflag_Common
)
{
if
(
!
bUseHistory
)
History
.
TurnOn
();
if
(
bNeedTurnOffTableId
)
{
g_oTableId
.
m_bTurnOff
=
false
;
}
return
null
;
}
var
StartPos
=
this
.
Selection
.
StartPos
;
var
EndPos
=
this
.
Selection
.
EndPos
;
if
(
StartPos
>
EndPos
)
{
StartPos
=
this
.
Selection
.
EndPos
;
EndPos
=
this
.
Selection
.
StartPos
;
}
for
(
var
Index
=
StartPos
;
Index
<=
EndPos
;
Index
++
)
{
this
.
Content
[
Index
].
Get_SelectedContent
(
SelectedContent
);
}
}
SelectedContent
.
On_EndCollectElements
(
this
,
false
);
var
SelectedContent
=
new
CSelectedContent
();
this
.
Controller
.
GetSelectedContent
(
SelectedContent
);
SelectedContent
.
On_EndCollectElements
(
this
,
false
);
if
(
!
bUseHistory
)
if
(
!
bUseHistory
)
History
.
TurnOn
();
History
.
TurnOn
();
if
(
bNeedTurnOffTableId
)
if
(
bNeedTurnOffTableId
)
{
{
g_oTableId
.
m_bTurnOff
=
false
;
g_oTableId
.
m_bTurnOff
=
false
;
}
}
return
SelectedContent
;
return
SelectedContent
;
};
};
CDocument
.
prototype
.
Can_InsertContent
=
function
(
SelectedContent
,
NearPos
)
CDocument
.
prototype
.
Can_InsertContent
=
function
(
SelectedContent
,
NearPos
)
{
{
// Проверяем, что вставка не пустая
// Проверяем, что вставка не пустая
if
(
SelectedContent
.
Elements
.
length
<=
0
)
if
(
SelectedContent
.
Elements
.
length
<=
0
)
return
false
;
return
false
;
var
Para
=
NearPos
.
Paragraph
;
var
Para
=
NearPos
.
Paragraph
;
// Автофигуры не вставляем в другие автофигуры
// Автофигуры не вставляем в другие автофигуры
if
(
true
===
Para
.
Parent
.
Is_DrawingShape
()
&&
true
===
SelectedContent
.
HaveShape
)
if
(
true
===
Para
.
Parent
.
Is_DrawingShape
()
&&
true
===
SelectedContent
.
HaveShape
)
return
false
;
return
false
;
//В заголовки диаграмм не вставляем формулы и любые DrawingObjects
//В заголовки диаграмм не вставляем формулы и любые DrawingObjects
if
(
Para
.
bFromDocument
===
false
&&
(
SelectedContent
.
DrawingObjects
.
length
>
0
||
SelectedContent
.
HaveMath
))
if
(
Para
.
bFromDocument
===
false
&&
(
SelectedContent
.
DrawingObjects
.
length
>
0
||
SelectedContent
.
HaveMath
))
return
false
;
return
false
;
// Проверяем корректность места, куда вставляем
// Проверяем корректность места, куда вставляем
var
ParaNearPos
=
NearPos
.
Paragraph
.
Get_ParaNearestPos
(
NearPos
);
var
ParaNearPos
=
NearPos
.
Paragraph
.
Get_ParaNearestPos
(
NearPos
);
if
(
null
===
ParaNearPos
||
ParaNearPos
.
Classes
.
length
<
2
)
if
(
null
===
ParaNearPos
||
ParaNearPos
.
Classes
.
length
<
2
)
return
false
;
return
false
;
var
LastClass
=
ParaNearPos
.
Classes
[
ParaNearPos
.
Classes
.
length
-
1
];
var
LastClass
=
ParaNearPos
.
Classes
[
ParaNearPos
.
Classes
.
length
-
1
];
if
(
para_Math_Run
===
LastClass
.
Type
)
if
(
para_Math_Run
===
LastClass
.
Type
)
{
{
// Проверяем, что вставляемый контент тоже формула
// Проверяем, что вставляемый контент тоже формула
var
Element
=
SelectedContent
.
Elements
[
0
].
Element
;
var
Element
=
SelectedContent
.
Elements
[
0
].
Element
;
if
(
1
!==
SelectedContent
.
Elements
.
length
||
type_Paragraph
!==
Element
.
Get_Type
()
||
null
===
LastClass
.
Parent
)
if
(
1
!==
SelectedContent
.
Elements
.
length
||
type_Paragraph
!==
Element
.
Get_Type
()
||
null
===
LastClass
.
Parent
)
return
false
;
return
false
;
var
Math
=
null
;
var
Math
=
null
;
var
Count
=
Element
.
Content
.
length
;
var
Count
=
Element
.
Content
.
length
;
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
{
{
var
Item
=
Element
.
Content
[
Index
];
var
Item
=
Element
.
Content
[
Index
];
if
(
para_Math
===
Item
.
Type
&&
null
===
Math
)
if
(
para_Math
===
Item
.
Type
&&
null
===
Math
)
Math
=
Element
.
Content
[
Index
];
Math
=
Element
.
Content
[
Index
];
else
if
(
true
!==
Item
.
Is_Empty
({
SkipEnd
:
true
}))
else
if
(
true
!==
Item
.
Is_Empty
({
SkipEnd
:
true
}))
return
false
;
return
false
;
}
}
}
}
else
if
(
para_Run
!==
LastClass
.
Type
)
else
if
(
para_Run
!==
LastClass
.
Type
)
return
false
;
return
false
;
if
(
null
===
Para
.
Parent
||
undefined
===
Para
.
Parent
)
if
(
null
===
Para
.
Parent
||
undefined
===
Para
.
Parent
)
return
false
;
return
false
;
return
true
;
return
true
;
};
};
CDocument
.
prototype
.
Insert_Content
=
function
(
SelectedContent
,
NearPos
)
CDocument
.
prototype
.
Insert_Content
=
function
(
SelectedContent
,
NearPos
)
{
{
var
Para
=
NearPos
.
Paragraph
;
var
Para
=
NearPos
.
Paragraph
;
var
ParaNearPos
=
Para
.
Get_ParaNearestPos
(
NearPos
);
var
ParaNearPos
=
Para
.
Get_ParaNearestPos
(
NearPos
);
var
LastClass
=
ParaNearPos
.
Classes
[
ParaNearPos
.
Classes
.
length
-
1
];
var
LastClass
=
ParaNearPos
.
Classes
[
ParaNearPos
.
Classes
.
length
-
1
];
if
(
para_Math_Run
===
LastClass
.
Type
)
if
(
para_Math_Run
===
LastClass
.
Type
)
{
{
var
MathRun
=
LastClass
;
var
MathRun
=
LastClass
;
var
NewMathRun
=
MathRun
.
Split
(
ParaNearPos
.
NearPos
.
ContentPos
,
ParaNearPos
.
Classes
.
length
-
1
);
var
NewMathRun
=
MathRun
.
Split
(
ParaNearPos
.
NearPos
.
ContentPos
,
ParaNearPos
.
Classes
.
length
-
1
);
var
MathContent
=
ParaNearPos
.
Classes
[
ParaNearPos
.
Classes
.
length
-
2
];
var
MathContent
=
ParaNearPos
.
Classes
[
ParaNearPos
.
Classes
.
length
-
2
];
var
MathContentPos
=
ParaNearPos
.
NearPos
.
ContentPos
.
Data
[
ParaNearPos
.
Classes
.
length
-
2
];
var
MathContentPos
=
ParaNearPos
.
NearPos
.
ContentPos
.
Data
[
ParaNearPos
.
Classes
.
length
-
2
];
var
Element
=
SelectedContent
.
Elements
[
0
].
Element
;
var
Element
=
SelectedContent
.
Elements
[
0
].
Element
;
var
InsertMathContent
=
null
;
var
InsertMathContent
=
null
;
for
(
var
nPos
=
0
,
nParaLen
=
Element
.
Content
.
length
;
nPos
<
nParaLen
;
nPos
++
)
for
(
var
nPos
=
0
,
nParaLen
=
Element
.
Content
.
length
;
nPos
<
nParaLen
;
nPos
++
)
{
{
if
(
para_Math
===
Element
.
Content
[
nPos
].
Type
)
if
(
para_Math
===
Element
.
Content
[
nPos
].
Type
)
{
{
InsertMathContent
=
Element
.
Content
[
nPos
];
InsertMathContent
=
Element
.
Content
[
nPos
];
break
;
break
;
}
}
}
}
if
(
null
!==
InsertMathContent
)
if
(
null
!==
InsertMathContent
)
{
{
MathContent
.
Add_ToContent
(
MathContentPos
+
1
,
NewMathRun
);
MathContent
.
Add_ToContent
(
MathContentPos
+
1
,
NewMathRun
);
MathContent
.
Insert_MathContent
(
InsertMathContent
.
Root
,
MathContentPos
+
1
,
true
);
MathContent
.
Insert_MathContent
(
InsertMathContent
.
Root
,
MathContentPos
+
1
,
true
);
}
}
}
}
else
if
(
para_Run
===
LastClass
.
Type
)
else
if
(
para_Run
===
LastClass
.
Type
)
{
{
var
NearContentPos
=
NearPos
.
ContentPos
;
var
NearContentPos
=
NearPos
.
ContentPos
;
// Сначала найдем номер элемента, начиная с которого мы будем производить вставку
// Сначала найдем номер элемента, начиная с которого мы будем производить вставку
var
DstIndex
=
-
1
;
var
DstIndex
=
-
1
;
var
Count
=
this
.
Content
.
length
;
var
Count
=
this
.
Content
.
length
;
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
{
{
if
(
this
.
Content
[
Index
]
===
Para
)
if
(
this
.
Content
[
Index
]
===
Para
)
{
{
DstIndex
=
Index
;
DstIndex
=
Index
;
break
;
break
;
}
}
}
}
if
(
-
1
===
DstIndex
)
if
(
-
1
===
DstIndex
)
return
false
;
return
false
;
var
Elements
=
SelectedContent
.
Elements
;
var
Elements
=
SelectedContent
.
Elements
;
var
ElementsCount
=
Elements
.
length
;
var
ElementsCount
=
Elements
.
length
;
var
FirstElement
=
SelectedContent
.
Elements
[
0
];
var
FirstElement
=
SelectedContent
.
Elements
[
0
];
if
(
1
===
ElementsCount
&&
true
!==
FirstElement
.
SelectedAll
&&
type_Paragraph
===
FirstElement
.
Element
.
GetType
()
&&
true
!==
FirstElement
.
Element
.
Is_Empty
())
if
(
1
===
ElementsCount
&&
true
!==
FirstElement
.
SelectedAll
&&
type_Paragraph
===
FirstElement
.
Element
.
GetType
()
&&
true
!==
FirstElement
.
Element
.
Is_Empty
())
{
{
// Нам нужно в заданный параграф вставить выделенный текст
// Нам нужно в заданный параграф вставить выделенный текст
var
NewPara
=
FirstElement
.
Element
;
var
NewPara
=
FirstElement
.
Element
;
var
NewElementsCount
=
NewPara
.
Content
.
length
-
1
;
// Последний ран с para_End не добавляем
var
NewElementsCount
=
NewPara
.
Content
.
length
-
1
;
// Последний ран с para_End не добавляем
var
LastClass
=
ParaNearPos
.
Classes
[
ParaNearPos
.
Classes
.
length
-
1
];
var
LastClass
=
ParaNearPos
.
Classes
[
ParaNearPos
.
Classes
.
length
-
1
];
var
NewElement
=
LastClass
.
Split
(
ParaNearPos
.
NearPos
.
ContentPos
,
ParaNearPos
.
Classes
.
length
-
1
);
var
NewElement
=
LastClass
.
Split
(
ParaNearPos
.
NearPos
.
ContentPos
,
ParaNearPos
.
Classes
.
length
-
1
);
var
PrevClass
=
ParaNearPos
.
Classes
[
ParaNearPos
.
Classes
.
length
-
2
];
var
PrevClass
=
ParaNearPos
.
Classes
[
ParaNearPos
.
Classes
.
length
-
2
];
var
PrevPos
=
ParaNearPos
.
NearPos
.
ContentPos
.
Data
[
ParaNearPos
.
Classes
.
length
-
2
];
var
PrevPos
=
ParaNearPos
.
NearPos
.
ContentPos
.
Data
[
ParaNearPos
.
Classes
.
length
-
2
];
PrevClass
.
Add_ToContent
(
PrevPos
+
1
,
NewElement
);
PrevClass
.
Add_ToContent
(
PrevPos
+
1
,
NewElement
);
// TODO: Заглушка для переноса автофигур и картинок. Когда разрулим ситуацию так, чтобы когда у нас
// TODO: Заглушка для переноса автофигур и картинок. Когда разрулим ситуацию так, чтобы когда у нас
// в текста была выделена автофигура выделение шло для автофигур, тогда здесь можно будет убрать.
// в текста была выделена автофигура выделение шло для автофигур, тогда здесь можно будет убрать.
var
bNeedSelect
=
(
true
===
SelectedContent
.
MoveDrawing
?
false
:
true
);
var
bNeedSelect
=
(
true
===
SelectedContent
.
MoveDrawing
?
false
:
true
);
for
(
var
Index
=
0
;
Index
<
NewElementsCount
;
Index
++
)
for
(
var
Index
=
0
;
Index
<
NewElementsCount
;
Index
++
)
{
{
var
Item
=
NewPara
.
Content
[
Index
];
var
Item
=
NewPara
.
Content
[
Index
];
PrevClass
.
Add_ToContent
(
PrevPos
+
1
+
Index
,
Item
);
PrevClass
.
Add_ToContent
(
PrevPos
+
1
+
Index
,
Item
);
if
(
true
===
bNeedSelect
)
if
(
true
===
bNeedSelect
)
Item
.
Select_All
();
Item
.
Select_All
();
}
}
if
(
true
===
bNeedSelect
)
if
(
true
===
bNeedSelect
)
{
{
PrevClass
.
Selection
.
Use
=
true
;
PrevClass
.
Selection
.
Use
=
true
;
PrevClass
.
Selection
.
StartPos
=
PrevPos
+
1
;
PrevClass
.
Selection
.
StartPos
=
PrevPos
+
1
;
PrevClass
.
Selection
.
EndPos
=
PrevPos
+
1
+
NewElementsCount
-
1
;
PrevClass
.
Selection
.
EndPos
=
PrevPos
+
1
+
NewElementsCount
-
1
;
for
(
var
Index
=
0
;
Index
<
ParaNearPos
.
Classes
.
length
-
2
;
Index
++
)
for
(
var
Index
=
0
;
Index
<
ParaNearPos
.
Classes
.
length
-
2
;
Index
++
)
{
{
var
Class
=
ParaNearPos
.
Classes
[
Index
];
var
Class
=
ParaNearPos
.
Classes
[
Index
];
var
ClassPos
=
ParaNearPos
.
NearPos
.
ContentPos
.
Data
[
Index
];
var
ClassPos
=
ParaNearPos
.
NearPos
.
ContentPos
.
Data
[
Index
];
Class
.
Selection
.
Use
=
true
;
Class
.
Selection
.
Use
=
true
;
Class
.
Selection
.
StartPos
=
ClassPos
;
Class
.
Selection
.
StartPos
=
ClassPos
;
Class
.
Selection
.
EndPos
=
ClassPos
;
Class
.
Selection
.
EndPos
=
ClassPos
;
}
}
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
StartPos
=
DstIndex
;
this
.
Selection
.
StartPos
=
DstIndex
;
this
.
Selection
.
EndPos
=
DstIndex
;
this
.
Selection
.
EndPos
=
DstIndex
;
}
}
if
(
PrevClass
.
Correct_Content
)
if
(
PrevClass
.
Correct_Content
)
{
{
PrevClass
.
Correct_Content
();
PrevClass
.
Correct_Content
();
}
}
}
}
else
else
{
{
var
bConcatS
=
(
type_Table
===
Elements
[
0
].
Element
.
GetType
()
?
false
:
true
);
var
bConcatS
=
(
type_Table
===
Elements
[
0
].
Element
.
GetType
()
?
false
:
true
);
var
bConcatE
=
(
type_Table
===
Elements
[
ElementsCount
-
1
].
Element
.
GetType
()
||
true
===
Elements
[
ElementsCount
-
1
].
SelectedAll
?
false
:
true
);
var
bConcatE
=
(
type_Table
===
Elements
[
ElementsCount
-
1
].
Element
.
GetType
()
||
true
===
Elements
[
ElementsCount
-
1
].
SelectedAll
?
false
:
true
);
var
ParaS
=
Para
;
var
ParaS
=
Para
;
var
ParaE
=
Para
;
var
ParaE
=
Para
;
var
ParaEIndex
=
DstIndex
;
var
ParaEIndex
=
DstIndex
;
// Нам надо разделить наш параграф в заданной позиции, если позиция в
// Нам надо разделить наш параграф в заданной позиции, если позиция в
// начале или конце параграфа, тогда делить не надо
// начале или конце параграфа, тогда делить не надо
Para
.
Cursor_MoveToNearPos
(
NearPos
);
Para
.
Cursor_MoveToNearPos
(
NearPos
);
Para
.
Selection_Remove
();
Para
.
Selection_Remove
();
var
bAddEmptyPara
=
false
;
var
bAddEmptyPara
=
false
;
var
bDoNotIncreaseDstIndex
=
false
;
var
bDoNotIncreaseDstIndex
=
false
;
if
(
true
===
Para
.
Cursor_IsEnd
())
if
(
true
===
Para
.
Cursor_IsEnd
())
{
{
bConcatE
=
false
;
bConcatE
=
false
;
if
(
1
===
ElementsCount
&&
type_Paragraph
===
FirstElement
.
Element
.
GetType
()
&&
(
true
===
FirstElement
.
Element
.
Is_Empty
()
||
true
==
FirstElement
.
SelectedAll
))
if
(
1
===
ElementsCount
&&
type_Paragraph
===
FirstElement
.
Element
.
GetType
()
&&
(
true
===
FirstElement
.
Element
.
Is_Empty
()
||
true
==
FirstElement
.
SelectedAll
))
{
{
bConcatS
=
false
;
bConcatS
=
false
;
// TODO: Возможно флаг bDoNotIncreaseDstIndex не нужен, и здесь не нужно увеличивать индекс DstIndex
// TODO: Возможно флаг bDoNotIncreaseDstIndex не нужен, и здесь не нужно увеличивать индекс DstIndex
if
(
type_Paragraph
!==
this
.
Content
[
DstIndex
].
Get_Type
()
||
true
!==
this
.
Content
[
DstIndex
].
Is_Empty
())
if
(
type_Paragraph
!==
this
.
Content
[
DstIndex
].
Get_Type
()
||
true
!==
this
.
Content
[
DstIndex
].
Is_Empty
())
{
{
DstIndex
++
;
DstIndex
++
;
bDoNotIncreaseDstIndex
=
true
;
bDoNotIncreaseDstIndex
=
true
;
}
}
}
}
else
if
(
true
===
Elements
[
ElementsCount
-
1
].
SelectedAll
&&
true
===
bConcatS
)
else
if
(
true
===
Elements
[
ElementsCount
-
1
].
SelectedAll
&&
true
===
bConcatS
)
bAddEmptyPara
=
true
;
bAddEmptyPara
=
true
;
}
}
else
if
(
true
===
Para
.
Cursor_IsStart
())
else
if
(
true
===
Para
.
Cursor_IsStart
())
{
{
bConcatS
=
false
;
bConcatS
=
false
;
}
}
else
else
{
{
// Создаем новый параграф
// Создаем новый параграф
var
NewParagraph
=
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
);
var
NewParagraph
=
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
);
Para
.
Split
(
NewParagraph
);
Para
.
Split
(
NewParagraph
);
this
.
Internal_Content_Add
(
DstIndex
+
1
,
NewParagraph
);
this
.
Internal_Content_Add
(
DstIndex
+
1
,
NewParagraph
);
ParaE
=
NewParagraph
;
ParaE
=
NewParagraph
;
ParaEIndex
=
DstIndex
+
1
;
ParaEIndex
=
DstIndex
+
1
;
}
}
if
(
true
===
bAddEmptyPara
)
if
(
true
===
bAddEmptyPara
)
{
{
// Создаем новый параграф
// Создаем новый параграф
var
NewParagraph
=
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
);
var
NewParagraph
=
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
);
NewParagraph
.
Set_Pr
(
ParaS
.
Pr
);
NewParagraph
.
Set_Pr
(
ParaS
.
Pr
);
NewParagraph
.
TextPr
.
Apply_TextPr
(
ParaS
.
TextPr
.
Value
);
NewParagraph
.
TextPr
.
Apply_TextPr
(
ParaS
.
TextPr
.
Value
);
this
.
Internal_Content_Add
(
DstIndex
+
1
,
NewParagraph
);
this
.
Internal_Content_Add
(
DstIndex
+
1
,
NewParagraph
);
}
}
var
StartIndex
=
0
;
var
StartIndex
=
0
;
if
(
true
===
bConcatS
)
if
(
true
===
bConcatS
)
{
{
// Вызываем так, чтобы выделить все внутренние элементы
// Вызываем так, чтобы выделить все внутренние элементы
var
_ParaS
=
Elements
[
0
].
Element
;
var
_ParaS
=
Elements
[
0
].
Element
;
_ParaS
.
Select_All
();
_ParaS
.
Select_All
();
var
_ParaSContentLen
=
_ParaS
.
Content
.
length
;
var
_ParaSContentLen
=
_ParaS
.
Content
.
length
;
// Если мы присоединяем новый параграф, то и копируем все настройки параграфа (так делает Word)
// Если мы присоединяем новый параграф, то и копируем все настройки параграфа (так делает Word)
ParaS
.
Concat
(
Elements
[
0
].
Element
);
ParaS
.
Concat
(
Elements
[
0
].
Element
);
ParaS
.
Set_Pr
(
Elements
[
0
].
Element
.
Pr
);
ParaS
.
Set_Pr
(
Elements
[
0
].
Element
.
Pr
);
ParaS
.
TextPr
.
Clear_Style
();
ParaS
.
TextPr
.
Clear_Style
();
ParaS
.
TextPr
.
Apply_TextPr
(
Elements
[
0
].
Element
.
TextPr
.
Value
);
ParaS
.
TextPr
.
Apply_TextPr
(
Elements
[
0
].
Element
.
TextPr
.
Value
);
StartIndex
++
;
StartIndex
++
;
ParaS
.
Selection
.
Use
=
true
;
ParaS
.
Selection
.
Use
=
true
;
ParaS
.
Selection
.
StartPos
=
ParaS
.
Content
.
length
-
_ParaSContentLen
;
ParaS
.
Selection
.
StartPos
=
ParaS
.
Content
.
length
-
_ParaSContentLen
;
ParaS
.
Selection
.
EndPos
=
ParaS
.
Content
.
length
-
1
;
ParaS
.
Selection
.
EndPos
=
ParaS
.
Content
.
length
-
1
;
}
}
else
if
(
true
!==
Para
.
Cursor_IsStart
()
&&
true
!==
bDoNotIncreaseDstIndex
)
else
if
(
true
!==
Para
.
Cursor_IsStart
()
&&
true
!==
bDoNotIncreaseDstIndex
)
{
{
DstIndex
++
;
DstIndex
++
;
}
}
var
EndIndex
=
ElementsCount
-
1
;
var
EndIndex
=
ElementsCount
-
1
;
if
(
true
===
bConcatE
&&
StartIndex
<
EndIndex
)
if
(
true
===
bConcatE
&&
StartIndex
<
EndIndex
)
{
{
var
_ParaE
=
Elements
[
ElementsCount
-
1
].
Element
;
var
_ParaE
=
Elements
[
ElementsCount
-
1
].
Element
;
var
TempCount
=
_ParaE
.
Content
.
length
-
1
;
var
TempCount
=
_ParaE
.
Content
.
length
-
1
;
_ParaE
.
Select_All
();
_ParaE
.
Select_All
();
_ParaE
.
Concat
(
ParaE
);
_ParaE
.
Concat
(
ParaE
);
_ParaE
.
Set_Pr
(
ParaE
.
Pr
);
_ParaE
.
Set_Pr
(
ParaE
.
Pr
);
this
.
Internal_Content_Add
(
ParaEIndex
,
_ParaE
);
this
.
Internal_Content_Add
(
ParaEIndex
,
_ParaE
);
this
.
Internal_Content_Remove
(
ParaEIndex
+
1
,
1
);
this
.
Internal_Content_Remove
(
ParaEIndex
+
1
,
1
);
_ParaE
.
Selection
.
Use
=
true
;
_ParaE
.
Selection
.
Use
=
true
;
_ParaE
.
Selection
.
StartPos
=
0
;
_ParaE
.
Selection
.
StartPos
=
0
;
_ParaE
.
Selection
.
EndPos
=
TempCount
;
_ParaE
.
Selection
.
EndPos
=
TempCount
;
EndIndex
--
;
EndIndex
--
;
}
}
for
(
var
Index
=
StartIndex
;
Index
<=
EndIndex
;
Index
++
)
for
(
var
Index
=
StartIndex
;
Index
<=
EndIndex
;
Index
++
)
{
{
this
.
Internal_Content_Add
(
DstIndex
+
Index
,
Elements
[
Index
].
Element
);
this
.
Internal_Content_Add
(
DstIndex
+
Index
,
Elements
[
Index
].
Element
);
this
.
Content
[
DstIndex
+
Index
].
Select_All
();
this
.
Content
[
DstIndex
+
Index
].
Select_All
();
}
}
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
StartPos
=
DstIndex
;
this
.
Selection
.
StartPos
=
DstIndex
;
this
.
Selection
.
EndPos
=
DstIndex
+
ElementsCount
-
1
;
this
.
Selection
.
EndPos
=
DstIndex
+
ElementsCount
-
1
;
}
}
if
(
docpostype_DrawingObjects
!==
this
.
CurPos
.
Type
)
if
(
docpostype_DrawingObjects
!==
this
.
CurPos
.
Type
)
this
.
Set_DocPosType
(
docpostype_Content
);
this
.
Set_DocPosType
(
docpostype_Content
);
}
}
};
};
CDocument
.
prototype
.
Document_SelectNumbering
=
function
(
NumPr
,
Index
)
CDocument
.
prototype
.
Document_SelectNumbering
=
function
(
NumPr
,
Index
)
{
{
this
.
private_UpdateTargetForCollaboration
();
this
.
private_UpdateTargetForCollaboration
();
this
.
Selection_Remove
();
this
.
Selection
.
Use
=
true
;
this
.
Selection_Remove
();
this
.
Selection
.
Flag
=
selectionflag_Numbering
;
this
.
Selection
.
Data
=
[];
this
.
Selection
.
StartPos
=
Index
;
this
.
Selection
.
EndPos
=
Index
;
//var
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
Flag
=
selectionflag_Numbering
;
this
.
Selection
.
Data
=
[];
this
.
Selection
.
StartPos
=
Index
;
this
.
Selection
.
EndPos
=
Index
;
for
(
var
Index
=
0
;
Index
<
this
.
Content
.
length
;
Index
++
)
for
(
var
Index
=
0
;
Index
<
this
.
Content
.
length
;
Index
++
)
{
{
var
Item
=
this
.
Content
[
Index
];
var
Item
=
this
.
Content
[
Index
];
var
ItemNumPr
=
null
;
var
ItemNumPr
=
null
;
if
(
type_Paragraph
==
Item
.
GetType
()
&&
undefined
!=
(
ItemNumPr
=
Item
.
Numbering_Get
()
)
&&
ItemNumPr
.
NumId
==
NumPr
.
NumId
&&
ItemNumPr
.
Lvl
==
NumPr
.
Lvl
)
if
(
type_Paragraph
==
Item
.
GetType
()
&&
undefined
!=
(
ItemNumPr
=
Item
.
Numbering_Get
()
)
&&
ItemNumPr
.
NumId
==
NumPr
.
NumId
&&
ItemNumPr
.
Lvl
==
NumPr
.
Lvl
)
{
{
this
.
Selection
.
Data
.
push
(
Index
);
this
.
Selection
.
Data
.
push
(
Index
);
Item
.
Selection_SelectNumbering
();
Item
.
Selection_SelectNumbering
();
}
}
}
}
this
.
Interface_Update_ParaPr
();
this
.
Interface_Update_ParaPr
();
this
.
Interface_Update_TextPr
();
this
.
Interface_Update_TextPr
();
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateSelectionState
();
};
};
CDocument
.
prototype
.
Remove_NumberingSelection
=
function
()
CDocument
.
prototype
.
Remove_NumberingSelection
=
function
()
{
{
if
(
true
===
this
.
Selection
.
Use
&&
selectionflag_Numbering
==
this
.
Selection
.
Flag
)
if
(
true
===
this
.
Selection
.
Use
&&
selectionflag_Numbering
==
this
.
Selection
.
Flag
)
this
.
Selection_Remove
();
this
.
Selection_Remove
();
};
};
CDocument
.
prototype
.
Update_CursorType
=
function
(
X
,
Y
,
PageIndex
,
MouseEvent
)
CDocument
.
prototype
.
Update_CursorType
=
function
(
X
,
Y
,
PageAbs
,
MouseEvent
)
{
{
if
(
null
!==
this
.
FullRecalc
.
Id
&&
this
.
FullRecalc
.
PageIndex
<=
PageIndex
)
if
(
null
!==
this
.
FullRecalc
.
Id
&&
this
.
FullRecalc
.
PageIndex
<=
PageAbs
)
return
;
return
;
editor
.
sync_MouseMoveStartCallback
();
// Ничего не делаем
if
(
true
===
this
.
DrawingDocument
.
IsCursorInTableCur
(
X
,
Y
,
PageIndex
))
{
this
.
DrawingDocument
.
SetCursorType
(
"
default
"
,
new
AscCommon
.
CMouseMoveData
());
editor
.
sync_MouseMoveEndCallback
();
return
;
}
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
{
this
.
HdrFtr
.
Update_CursorType
(
X
,
Y
,
PageIndex
);
}
else
{
var
bInText
=
(
null
===
this
.
Is_InText
(
X
,
Y
,
PageIndex
)
?
false
:
true
);
var
bTableBorder
=
(
null
===
this
.
Is_TableBorder
(
X
,
Y
,
PageIndex
)
?
false
:
true
);
// Ничего не делаем
this
.
Api
.
sync_MouseMoveStartCallback
();
if
(
true
===
this
.
DrawingObjects
.
updateCursorType
(
PageIndex
,
X
,
Y
,
MouseEvent
,
(
true
===
bInText
||
true
===
bTableBorder
?
true
:
false
)))
{
editor
.
sync_MouseMoveEndCallback
();
return
;
}
var
ContentPos
=
this
.
Internal_GetContentPosByXY
(
X
,
Y
,
PageIndex
);
if
(
true
===
this
.
DrawingDocument
.
IsCursorInTableCur
(
X
,
Y
,
PageAbs
))
var
Item
=
this
.
Content
[
ContentPos
];
{
var
ElementPageIndex
=
this
.
private_GetElementPageIndexByXY
(
ContentPos
,
X
,
Y
,
PageIndex
);
this
.
DrawingDocument
.
SetCursorType
(
"
default
"
,
new
AscCommon
.
CMouseMoveData
());
Item
.
Update_CursorType
(
X
,
Y
,
ElementPageIndex
);
this
.
Api
.
sync_MouseMoveEndCallback
();
}
return
;
}
editor
.
sync_MouseMoveEndCallback
();
this
.
Controller
.
UpdateCursorType
(
X
,
Y
,
PageAbs
,
MouseEvent
);
this
.
Api
.
sync_MouseMoveEndCallback
();
};
};
/**
/**
* Проверяем попадание в границу таблицы.
* Проверяем попадание в границу таблицы.
...
@@ -5786,31 +5729,35 @@ CDocument.prototype.Update_CursorType = function(X, Y, PageIndex, MouseE
...
@@ -5786,31 +5729,35 @@ CDocument.prototype.Update_CursorType = function(X, Y, PageIndex, MouseE
*/
*/
CDocument
.
prototype
.
Is_TableBorder
=
function
(
X
,
Y
,
PageIndex
)
CDocument
.
prototype
.
Is_TableBorder
=
function
(
X
,
Y
,
PageIndex
)
{
{
if
(
PageIndex
>=
this
.
Pages
.
length
||
PageIndex
<
0
)
if
(
PageIndex
>=
this
.
Pages
.
length
||
PageIndex
<
0
)
return
null
;
return
null
;
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
if
(
docpostype_HdrFtr
===
this
.
Get_DocPosType
())
{
{
return
this
.
HdrFtr
.
Is_TableBorder
(
X
,
Y
,
PageIndex
);
return
this
.
HdrFtr
.
Is_TableBorder
(
X
,
Y
,
PageIndex
);
}
}
else
if
(
-
1
!=
this
.
DrawingObjects
.
isPointInDrawingObjects
(
X
,
Y
,
PageIndex
,
this
))
else
{
{
return
null
;
// TODO: Добавить обработку сносок
}
if
(
-
1
!=
this
.
DrawingObjects
.
isPointInDrawingObjects
(
X
,
Y
,
PageIndex
,
this
))
else
{
{
return
null
;
var
ColumnsInfo
=
{};
}
var
ElementPos
=
this
.
Internal_GetContentPosByXY
(
X
,
Y
,
PageIndex
,
ColumnsInfo
);
else
var
Element
=
this
.
Content
[
ElementPos
];
{
var
ElementPageIndex
=
this
.
private_GetElementPageIndex
(
ElementPos
,
PageIndex
,
ColumnsInfo
.
Column
,
ColumnsInfo
.
Column
,
ColumnsInfo
.
ColumnsCount
);
var
ColumnsInfo
=
{};
var
ElementPos
=
this
.
Internal_GetContentPosByXY
(
X
,
Y
,
PageIndex
,
ColumnsInfo
);
var
Element
=
this
.
Content
[
ElementPos
];
var
ElementPageIndex
=
this
.
private_GetElementPageIndex
(
ElementPos
,
PageIndex
,
ColumnsInfo
.
Column
,
ColumnsInfo
.
Column
,
ColumnsInfo
.
ColumnsCount
);
if
(
type_Table
===
Element
.
GetType
())
if
(
type_Table
===
Element
.
GetType
())
return
Element
.
Is_TableBorder
(
X
,
Y
,
ElementPageIndex
);
return
Element
.
Is_TableBorder
(
X
,
Y
,
ElementPageIndex
);
else
else
return
null
;
return
null
;
}
}
}
return
null
;
return
null
;
};
};
/**
/**
* Проверяем, попали ли мы четко в текст (не лежащий в автофигуре)
* Проверяем, попали ли мы четко в текст (не лежащий в автофигуре)
...
@@ -5821,24 +5768,26 @@ CDocument.prototype.Is_TableBorder = function(X, Y, PageIndex)
...
@@ -5821,24 +5768,26 @@ CDocument.prototype.Is_TableBorder = function(X, Y, PageIndex)
*/
*/
CDocument
.
prototype
.
Is_InText
=
function
(
X
,
Y
,
PageIndex
)
CDocument
.
prototype
.
Is_InText
=
function
(
X
,
Y
,
PageIndex
)
{
{
if
(
PageIndex
>=
this
.
Pages
.
length
||
PageIndex
<
0
)
if
(
PageIndex
>=
this
.
Pages
.
length
||
PageIndex
<
0
)
return
null
;
return
null
;
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
if
(
docpostype_HdrFtr
===
this
.
Get_DocPosType
())
{
{
return
this
.
HdrFtr
.
Is_InText
(
X
,
Y
,
PageIndex
);
return
this
.
HdrFtr
.
Is_InText
(
X
,
Y
,
PageIndex
);
}
}
else
else
{
{
var
ContentPos
=
this
.
Internal_GetContentPosByXY
(
X
,
Y
,
PageIndex
);
// TODO: Добавить обработку сносок
var
ElementPageIndex
=
this
.
private_GetElementPageIndexByXY
(
ContentPos
,
X
,
Y
,
PageIndex
);
var
Item
=
this
.
Content
[
ContentPos
];
var
ContentPos
=
this
.
Internal_GetContentPosByXY
(
X
,
Y
,
PageIndex
);
return
Item
.
Is_InText
(
X
,
Y
,
ElementPageIndex
);
var
ElementPageIndex
=
this
.
private_GetElementPageIndexByXY
(
ContentPos
,
X
,
Y
,
PageIndex
);
}
var
Item
=
this
.
Content
[
ContentPos
];
return
Item
.
Is_InText
(
X
,
Y
,
ElementPageIndex
);
}
};
};
CDocument
.
prototype
.
Get_ParentTextTransform
=
function
()
CDocument
.
prototype
.
Get_ParentTextTransform
=
function
()
{
{
return
null
;
return
null
;
};
};
/**
/**
* Проверяем, попали ли мы в автофигуру данного DocumentContent
* Проверяем, попали ли мы в автофигуру данного DocumentContent
...
@@ -5849,39 +5798,43 @@ CDocument.prototype.Get_ParentTextTransform = function()
...
@@ -5849,39 +5798,43 @@ CDocument.prototype.Get_ParentTextTransform = function()
*/
*/
CDocument
.
prototype
.
Is_InDrawing
=
function
(
X
,
Y
,
PageIndex
)
CDocument
.
prototype
.
Is_InDrawing
=
function
(
X
,
Y
,
PageIndex
)
{
{
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
{
{
return
this
.
HdrFtr
.
Is_InDrawing
(
X
,
Y
,
PageIndex
);
return
this
.
HdrFtr
.
Is_InDrawing
(
X
,
Y
,
PageIndex
);
}
}
else
if
(
-
1
!=
this
.
DrawingObjects
.
isPointInDrawingObjects
(
X
,
Y
,
this
.
CurPage
,
this
))
else
{
{
return
true
;
// TODO: Добавить обработку сносок
}
if
(
-
1
!=
this
.
DrawingObjects
.
isPointInDrawingObjects
(
X
,
Y
,
this
.
CurPage
,
this
))
else
{
{
return
true
;
var
ContentPos
=
this
.
Internal_GetContentPosByXY
(
X
,
Y
,
PageIndex
);
}
var
Item
=
this
.
Content
[
ContentPos
];
else
if
(
type_Table
==
Item
.
GetType
())
{
{
var
ContentPos
=
this
.
Internal_GetContentPosByXY
(
X
,
Y
,
PageIndex
);
var
ElementPageIndex
=
this
.
private_GetElementPageIndexByXY
(
ContentPos
,
X
,
Y
,
PageIndex
);
var
Item
=
this
.
Content
[
ContentPos
];
return
Item
.
Is_InDrawing
(
X
,
Y
,
ElementPageIndex
);
if
(
type_Table
==
Item
.
GetType
())
}
{
var
ElementPageIndex
=
this
.
private_GetElementPageIndexByXY
(
ContentPos
,
X
,
Y
,
PageIndex
);
return
Item
.
Is_InDrawing
(
X
,
Y
,
ElementPageIndex
);
}
return
false
;
return
false
;
}
}
}
};
};
CDocument
.
prototype
.
Is_UseInDocument
=
function
(
Id
)
CDocument
.
prototype
.
Is_UseInDocument
=
function
(
Id
)
{
{
var
Count
=
this
.
Content
.
length
;
var
Count
=
this
.
Content
.
length
;
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
{
{
if
(
Id
===
this
.
Content
[
Index
].
Get_Id
())
if
(
Id
===
this
.
Content
[
Index
].
Get_Id
())
return
true
;
return
true
;
}
}
return
false
;
return
false
;
};
};
CDocument
.
prototype
.
OnKeyDown
=
function
(
e
)
CDocument
.
prototype
.
OnKeyDown
=
function
(
e
)
{
{
var
OldRecalcId
=
this
.
RecalcId
;
var
OldRecalcId
=
this
.
RecalcId
;
...
@@ -6794,412 +6747,412 @@ CDocument.prototype.OnKeyDown = function(e)
...
@@ -6794,412 +6747,412 @@ CDocument.prototype.OnKeyDown = function(e)
return
bRetValue
;
return
bRetValue
;
};
};
CDocument
.
prototype
.
OnKeyPress
=
function
(
e
)
CDocument
.
prototype
.
OnKeyPress
=
function
(
e
)
{
{
if
(
true
===
this
.
Api
.
isViewMode
)
if
(
true
===
this
.
Api
.
isViewMode
)
return
false
;
return
false
;
var
Code
;
var
Code
;
if
(
null
!=
e
.
Which
)
if
(
null
!=
e
.
Which
)
Code
=
e
.
Which
;
Code
=
e
.
Which
;
else
if
(
e
.
KeyCode
)
else
if
(
e
.
KeyCode
)
Code
=
e
.
KeyCode
;
Code
=
e
.
KeyCode
;
else
else
Code
=
0
;
//special char
Code
=
0
;
//special char
var
bRetValue
=
false
;
var
bRetValue
=
false
;
if
(
Code
>
0x20
)
if
(
Code
>
0x20
)
{
{
if
(
false
===
this
.
Document_Is_SelectionLocked
(
changestype_Paragraph_Content
,
null
,
true
))
if
(
false
===
this
.
Document_Is_SelectionLocked
(
changestype_Paragraph_Content
,
null
,
true
))
{
{
this
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_AddLetter
);
this
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_AddLetter
);
this
.
DrawingDocument
.
TargetStart
();
this
.
DrawingDocument
.
TargetStart
();
this
.
DrawingDocument
.
TargetShow
();
this
.
DrawingDocument
.
TargetShow
();
this
.
CheckLanguageOnTextAdd
=
true
;
this
.
CheckLanguageOnTextAdd
=
true
;
this
.
Paragraph_Add
(
new
ParaText
(
String
.
fromCharCode
(
Code
)));
this
.
Paragraph_Add
(
new
ParaText
(
String
.
fromCharCode
(
Code
)));
this
.
CheckLanguageOnTextAdd
=
false
;
this
.
CheckLanguageOnTextAdd
=
false
;
}
}
bRetValue
=
true
;
bRetValue
=
true
;
}
}
if
(
true
==
bRetValue
)
if
(
true
==
bRetValue
)
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateSelectionState
();
return
bRetValue
;
return
bRetValue
;
};
};
CDocument
.
prototype
.
OnMouseDown
=
function
(
e
,
X
,
Y
,
PageIndex
)
CDocument
.
prototype
.
OnMouseDown
=
function
(
e
,
X
,
Y
,
PageIndex
)
{
{
if
(
PageIndex
<
0
)
if
(
PageIndex
<
0
)
return
;
return
;
this
.
private_UpdateTargetForCollaboration
();
this
.
private_UpdateTargetForCollaboration
();
// Сбрасываем проверку Drag-n-Drop
// Сбрасываем проверку Drag-n-Drop
this
.
Selection
.
DragDrop
.
Flag
=
0
;
this
.
Selection
.
DragDrop
.
Flag
=
0
;
this
.
Selection
.
DragDrop
.
Data
=
null
;
this
.
Selection
.
DragDrop
.
Data
=
null
;
// Сбрасываем текущий элемент в поиске
// Сбрасываем текущий элемент в поиске
if
(
this
.
SearchEngine
.
Count
>
0
)
if
(
this
.
SearchEngine
.
Count
>
0
)
this
.
SearchEngine
.
Reset_Current
();
this
.
SearchEngine
.
Reset_Current
();
// Обработка правой кнопки мыши происходит на событии MouseUp
// Обработка правой кнопки мыши происходит на событии MouseUp
if
(
AscCommon
.
g_mouse_button_right
===
e
.
Button
)
if
(
AscCommon
.
g_mouse_button_right
===
e
.
Button
)
return
;
return
;
// Если мы только что расширяли документ двойным щелчком, то отменяем это действие
// Если мы только что расширяли документ двойным щелчком, то отменяем это действие
if
(
true
===
this
.
History
.
Is_ExtendDocumentToPos
())
if
(
true
===
this
.
History
.
Is_ExtendDocumentToPos
())
this
.
Document_Undo
();
this
.
Document_Undo
();
var
OldCurPage
=
this
.
CurPage
;
var
OldCurPage
=
this
.
CurPage
;
this
.
CurPage
=
PageIndex
;
this
.
CurPage
=
PageIndex
;
if
(
true
===
editor
.
isStartAddShape
&&
(
docpostype_HdrFtr
!==
this
.
CurPos
.
Type
||
null
!==
this
.
HdrFtr
.
CurHdrFtr
))
if
(
true
===
editor
.
isStartAddShape
&&
(
docpostype_HdrFtr
!==
this
.
CurPos
.
Type
||
null
!==
this
.
HdrFtr
.
CurHdrFtr
))
{
{
if
(
docpostype_HdrFtr
!==
this
.
CurPos
.
Type
)
if
(
docpostype_HdrFtr
!==
this
.
CurPos
.
Type
)
{
{
this
.
Set_DocPosType
(
docpostype_DrawingObjects
);
this
.
Set_DocPosType
(
docpostype_DrawingObjects
);
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
Start
=
true
;
this
.
Selection
.
Start
=
true
;
}
}
else
else
{
{
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
Start
=
true
;
this
.
Selection
.
Start
=
true
;
this
.
HdrFtr
.
WaitMouseDown
=
false
;
this
.
HdrFtr
.
WaitMouseDown
=
false
;
var
CurHdrFtr
=
this
.
HdrFtr
.
CurHdrFtr
;
var
CurHdrFtr
=
this
.
HdrFtr
.
CurHdrFtr
;
var
DocContent
=
CurHdrFtr
.
Content
;
var
DocContent
=
CurHdrFtr
.
Content
;
DocContent
.
Set_DocPosType
(
docpostype_DrawingObjects
);
DocContent
.
Set_DocPosType
(
docpostype_DrawingObjects
);
DocContent
.
Selection
.
Use
=
true
;
DocContent
.
Selection
.
Use
=
true
;
DocContent
.
Selection
.
Start
=
true
;
DocContent
.
Selection
.
Start
=
true
;
}
}
if
(
true
!=
this
.
DrawingObjects
.
isPolylineAddition
())
if
(
true
!=
this
.
DrawingObjects
.
isPolylineAddition
())
this
.
DrawingObjects
.
startAddShape
(
editor
.
addShapePreset
);
this
.
DrawingObjects
.
startAddShape
(
editor
.
addShapePreset
);
this
.
DrawingObjects
.
OnMouseDown
(
e
,
X
,
Y
,
this
.
CurPage
);
this
.
DrawingObjects
.
OnMouseDown
(
e
,
X
,
Y
,
this
.
CurPage
);
}
}
else
else
{
{
if
(
true
===
e
.
ShiftKey
&&
if
(
true
===
e
.
ShiftKey
&&
(
(
docpostype_DrawingObjects
!==
this
.
CurPos
.
Type
&&
!
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
&&
this
.
HdrFtr
.
CurHdrFtr
&&
this
.
HdrFtr
.
CurHdrFtr
.
Content
.
CurPos
.
Type
===
docpostype_DrawingObjects
))
(
(
docpostype_DrawingObjects
!==
this
.
CurPos
.
Type
&&
!
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
&&
this
.
HdrFtr
.
CurHdrFtr
&&
this
.
HdrFtr
.
CurHdrFtr
.
Content
.
CurPos
.
Type
===
docpostype_DrawingObjects
))
||
true
===
this
.
DrawingObjects
.
checkTextObject
(
X
,
Y
,
PageIndex
)
))
||
true
===
this
.
DrawingObjects
.
checkTextObject
(
X
,
Y
,
PageIndex
)
))
{
{
if
(
true
===
this
.
Is_SelectionUse
())
if
(
true
===
this
.
Is_SelectionUse
())
this
.
Selection
.
Start
=
false
;
this
.
Selection
.
Start
=
false
;
else
else
this
.
Start_SelectionFromCurPos
();
this
.
Start_SelectionFromCurPos
();
this
.
Selection_SetEnd
(
X
,
Y
,
e
);
this
.
Selection_SetEnd
(
X
,
Y
,
e
);
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateSelectionState
();
return
;
return
;
}
}
this
.
Selection_SetStart
(
X
,
Y
,
e
);
this
.
Selection_SetStart
(
X
,
Y
,
e
);
if
(
e
.
ClickCount
<=
1
&&
1
!==
this
.
Selection
.
DragDrop
.
Flag
)
if
(
e
.
ClickCount
<=
1
&&
1
!==
this
.
Selection
.
DragDrop
.
Flag
)
{
{
this
.
RecalculateCurPos
();
this
.
RecalculateCurPos
();
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateSelectionState
();
}
}
}
}
};
};
CDocument
.
prototype
.
OnMouseUp
=
function
(
e
,
X
,
Y
,
PageIndex
)
CDocument
.
prototype
.
OnMouseUp
=
function
(
e
,
X
,
Y
,
PageIndex
)
{
{
if
(
PageIndex
<
0
)
if
(
PageIndex
<
0
)
return
;
return
;
this
.
private_UpdateTargetForCollaboration
();
this
.
private_UpdateTargetForCollaboration
();
if
(
1
===
this
.
Selection
.
DragDrop
.
Flag
)
if
(
1
===
this
.
Selection
.
DragDrop
.
Flag
)
{
{
this
.
Selection
.
DragDrop
.
Flag
=
-
1
;
this
.
Selection
.
DragDrop
.
Flag
=
-
1
;
var
OldCurPage
=
this
.
CurPage
;
var
OldCurPage
=
this
.
CurPage
;
this
.
CurPage
=
this
.
Selection
.
DragDrop
.
Data
.
PageNum
;
this
.
CurPage
=
this
.
Selection
.
DragDrop
.
Data
.
PageNum
;
this
.
Selection_SetStart
(
this
.
Selection
.
DragDrop
.
Data
.
X
,
this
.
Selection
.
DragDrop
.
Data
.
Y
,
e
);
this
.
Selection_SetStart
(
this
.
Selection
.
DragDrop
.
Data
.
X
,
this
.
Selection
.
DragDrop
.
Data
.
Y
,
e
);
this
.
Selection
.
DragDrop
.
Flag
=
0
;
this
.
Selection
.
DragDrop
.
Flag
=
0
;
this
.
Selection
.
DragDrop
.
Data
=
null
;
this
.
Selection
.
DragDrop
.
Data
=
null
;
}
}
// Если мы нажимали правую кнопку мыши, тогда нам надо сделать
// Если мы нажимали правую кнопку мыши, тогда нам надо сделать
if
(
AscCommon
.
g_mouse_button_right
===
e
.
Button
)
if
(
AscCommon
.
g_mouse_button_right
===
e
.
Button
)
{
{
if
(
true
===
this
.
Selection
.
Start
)
if
(
true
===
this
.
Selection
.
Start
)
return
;
return
;
var
ConvertedPos
=
this
.
DrawingDocument
.
ConvertCoordsToCursorWR
(
X
,
Y
,
PageIndex
);
var
ConvertedPos
=
this
.
DrawingDocument
.
ConvertCoordsToCursorWR
(
X
,
Y
,
PageIndex
);
var
X_abs
=
ConvertedPos
.
X
;
var
X_abs
=
ConvertedPos
.
X
;
var
Y_abs
=
ConvertedPos
.
Y
;
var
Y_abs
=
ConvertedPos
.
Y
;
// Проверим попадание в значок таблицы, если в него попадаем, тогда выделяем таблицу
// Проверим попадание в значок таблицы, если в него попадаем, тогда выделяем таблицу
if
(
true
===
this
.
DrawingDocument
.
IsCursorInTableCur
(
X
,
Y
,
PageIndex
))
if
(
true
===
this
.
DrawingDocument
.
IsCursorInTableCur
(
X
,
Y
,
PageIndex
))
{
{
var
Table
=
this
.
DrawingDocument
.
TableOutlineDr
.
TableOutline
.
Table
;
var
Table
=
this
.
DrawingDocument
.
TableOutlineDr
.
TableOutline
.
Table
;
Table
.
Select_All
();
Table
.
Select_All
();
Table
.
Document_SetThisElementCurrent
(
false
);
Table
.
Document_SetThisElementCurrent
(
false
);
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateInterfaceState
();
editor
.
sync_ContextMenuCallback
({
Type
:
Asc
.
c_oAscContextMenuTypes
.
Common
,
X_abs
:
X_abs
,
Y_abs
:
Y_abs
});
editor
.
sync_ContextMenuCallback
({
Type
:
Asc
.
c_oAscContextMenuTypes
.
Common
,
X_abs
:
X_abs
,
Y_abs
:
Y_abs
});
return
;
return
;
}
}
// Сначала проверим попадание в Flow-таблицы и автофигуры
// Сначала проверим попадание в Flow-таблицы и автофигуры
var
pFlowTable
=
this
.
DrawingObjects
.
getTableByXY
(
X
,
Y
,
PageIndex
,
this
);
var
pFlowTable
=
this
.
DrawingObjects
.
getTableByXY
(
X
,
Y
,
PageIndex
,
this
);
var
nInDrawing
=
this
.
DrawingObjects
.
isPointInDrawingObjects
(
X
,
Y
,
PageIndex
,
this
);
var
nInDrawing
=
this
.
DrawingObjects
.
isPointInDrawingObjects
(
X
,
Y
,
PageIndex
,
this
);
if
(
docpostype_HdrFtr
!=
this
.
CurPos
.
Type
&&
-
1
===
nInDrawing
&&
null
===
pFlowTable
)
if
(
docpostype_HdrFtr
!=
this
.
CurPos
.
Type
&&
-
1
===
nInDrawing
&&
null
===
pFlowTable
)
{
{
var
PageMetrics
=
this
.
Get_PageContentStartPos
(
this
.
CurPage
,
this
.
Pages
[
this
.
CurPage
].
Pos
);
var
PageMetrics
=
this
.
Get_PageContentStartPos
(
this
.
CurPage
,
this
.
Pages
[
this
.
CurPage
].
Pos
);
// Проверяем, не попали ли мы в колонтитул
// Проверяем, не попали ли мы в колонтитул
if
(
Y
<=
PageMetrics
.
Y
)
if
(
Y
<=
PageMetrics
.
Y
)
{
{
editor
.
sync_ContextMenuCallback
({
editor
.
sync_ContextMenuCallback
({
Type
:
Asc
.
c_oAscContextMenuTypes
.
ChangeHdrFtr
,
Type
:
Asc
.
c_oAscContextMenuTypes
.
ChangeHdrFtr
,
X_abs
:
X_abs
,
X_abs
:
X_abs
,
Y_abs
:
Y_abs
,
Y_abs
:
Y_abs
,
Header
:
true
,
Header
:
true
,
PageNum
:
PageIndex
PageNum
:
PageIndex
});
});
return
;
return
;
}
}
else
if
(
Y
>
PageMetrics
.
YLimit
)
else
if
(
Y
>
PageMetrics
.
YLimit
)
{
{
editor
.
sync_ContextMenuCallback
({
editor
.
sync_ContextMenuCallback
({
Type
:
Asc
.
c_oAscContextMenuTypes
.
ChangeHdrFtr
,
Type
:
Asc
.
c_oAscContextMenuTypes
.
ChangeHdrFtr
,
X_abs
:
X_abs
,
X_abs
:
X_abs
,
Y_abs
:
Y_abs
,
Y_abs
:
Y_abs
,
Header
:
false
,
Header
:
false
,
PageNum
:
PageIndex
PageNum
:
PageIndex
});
});
return
;
return
;
}
}
}
}
// Проверяем попалили мы в селект
// Проверяем попалили мы в селект
if
(
false
===
this
.
Selection_Check
(
X
,
Y
,
PageIndex
,
undefined
))
if
(
false
===
this
.
Selection_Check
(
X
,
Y
,
PageIndex
,
undefined
))
{
{
this
.
CurPage
=
PageIndex
;
this
.
CurPage
=
PageIndex
;
var
MouseEvent_new
=
var
MouseEvent_new
=
{
{
// TODO : Если в MouseEvent будет использоваться что-то кроме ClickCount, Type и CtrlKey, добавить здесь
// TODO : Если в MouseEvent будет использоваться что-то кроме ClickCount, Type и CtrlKey, добавить здесь
ClickCount
:
1
,
ClickCount
:
1
,
Type
:
AscCommon
.
g_mouse_event_type_down
,
Type
:
AscCommon
.
g_mouse_event_type_down
,
CtrlKey
:
false
,
CtrlKey
:
false
,
Button
:
AscCommon
.
g_mouse_button_right
Button
:
AscCommon
.
g_mouse_button_right
};
};
this
.
Selection_SetStart
(
X
,
Y
,
MouseEvent_new
);
this
.
Selection_SetStart
(
X
,
Y
,
MouseEvent_new
);
MouseEvent_new
.
Type
=
AscCommon
.
g_mouse_event_type_up
;
MouseEvent_new
.
Type
=
AscCommon
.
g_mouse_event_type_up
;
this
.
Selection_SetEnd
(
X
,
Y
,
MouseEvent_new
);
this
.
Selection_SetEnd
(
X
,
Y
,
MouseEvent_new
);
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateRulersState
();
this
.
Document_UpdateRulersState
();
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateInterfaceState
();
}
}
editor
.
sync_ContextMenuCallback
({
Type
:
Asc
.
c_oAscContextMenuTypes
.
Common
,
X_abs
:
X_abs
,
Y_abs
:
Y_abs
});
editor
.
sync_ContextMenuCallback
({
Type
:
Asc
.
c_oAscContextMenuTypes
.
Common
,
X_abs
:
X_abs
,
Y_abs
:
Y_abs
});
this
.
private_UpdateCursorXY
(
true
,
true
);
this
.
private_UpdateCursorXY
(
true
,
true
);
return
;
return
;
}
}
else
if
(
AscCommon
.
g_mouse_button_left
===
e
.
Button
)
else
if
(
AscCommon
.
g_mouse_button_left
===
e
.
Button
)
{
{
if
(
true
===
this
.
Comments
.
Is_Use
())
if
(
true
===
this
.
Comments
.
Is_Use
())
{
{
var
Type
=
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
?
comment_type_HdrFtr
:
comment_type_Common
);
var
Type
=
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
?
comment_type_HdrFtr
:
comment_type_Common
);
// Проверяем не попали ли мы в комментарий
// Проверяем не попали ли мы в комментарий
var
Comment
=
this
.
Comments
.
Get_ByXY
(
PageIndex
,
X
,
Y
,
Type
);
var
Comment
=
this
.
Comments
.
Get_ByXY
(
PageIndex
,
X
,
Y
,
Type
);
if
(
null
!=
Comment
)
if
(
null
!=
Comment
)
{
{
var
Comment_PageNum
=
Comment
.
m_oStartInfo
.
PageNum
;
var
Comment_PageNum
=
Comment
.
m_oStartInfo
.
PageNum
;
var
Comment_Y
=
Comment
.
m_oStartInfo
.
Y
;
var
Comment_Y
=
Comment
.
m_oStartInfo
.
Y
;
var
Comment_X
=
this
.
Get_PageLimits
(
PageIndex
).
XLimit
;
var
Comment_X
=
this
.
Get_PageLimits
(
PageIndex
).
XLimit
;
var
Para
=
g_oTableId
.
Get_ById
(
Comment
.
StartId
);
var
Para
=
g_oTableId
.
Get_ById
(
Comment
.
StartId
);
var
TextTransform
=
Para
.
Get_ParentTextTransform
();
var
TextTransform
=
Para
.
Get_ParentTextTransform
();
if
(
TextTransform
)
if
(
TextTransform
)
{
{
Comment_Y
=
TextTransform
.
TransformPointY
(
Comment
.
m_oStartInfo
.
X
,
Comment
.
m_oStartInfo
.
Y
);
Comment_Y
=
TextTransform
.
TransformPointY
(
Comment
.
m_oStartInfo
.
X
,
Comment
.
m_oStartInfo
.
Y
);
}
}
var
Coords
=
this
.
DrawingDocument
.
ConvertCoordsToCursorWR
(
Comment_X
,
Comment_Y
,
Comment_PageNum
);
var
Coords
=
this
.
DrawingDocument
.
ConvertCoordsToCursorWR
(
Comment_X
,
Comment_Y
,
Comment_PageNum
);
this
.
Select_Comment
(
Comment
.
Get_Id
(),
false
);
this
.
Select_Comment
(
Comment
.
Get_Id
(),
false
);
editor
.
sync_ShowComment
(
Comment
.
Get_Id
(),
Coords
.
X
,
Coords
.
Y
);
editor
.
sync_ShowComment
(
Comment
.
Get_Id
(),
Coords
.
X
,
Coords
.
Y
);
}
}
else
else
{
{
this
.
Select_Comment
(
null
,
false
);
this
.
Select_Comment
(
null
,
false
);
editor
.
sync_HideComment
();
editor
.
sync_HideComment
();
}
}
}
}
}
}
if
(
true
===
this
.
Selection
.
Start
)
if
(
true
===
this
.
Selection
.
Start
)
{
{
this
.
CurPage
=
PageIndex
;
this
.
CurPage
=
PageIndex
;
this
.
Selection
.
Start
=
false
;
this
.
Selection
.
Start
=
false
;
this
.
Selection_SetEnd
(
X
,
Y
,
e
);
this
.
Selection_SetEnd
(
X
,
Y
,
e
);
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateSelectionState
();
if
(
c_oAscFormatPainterState
.
kOff
!==
editor
.
isPaintFormat
)
if
(
c_oAscFormatPainterState
.
kOff
!==
editor
.
isPaintFormat
)
{
{
if
(
false
===
this
.
Document_Is_SelectionLocked
(
changestype_Paragraph_Content
))
if
(
false
===
this
.
Document_Is_SelectionLocked
(
changestype_Paragraph_Content
))
{
{
this
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_FormatPasteHotKey2
);
this
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_FormatPasteHotKey2
);
this
.
Document_Format_Paste
();
this
.
Document_Format_Paste
();
}
}
if
(
c_oAscFormatPainterState
.
kOn
===
editor
.
isPaintFormat
)
if
(
c_oAscFormatPainterState
.
kOn
===
editor
.
isPaintFormat
)
editor
.
sync_PaintFormatCallback
(
c_oAscFormatPainterState
.
kOff
);
editor
.
sync_PaintFormatCallback
(
c_oAscFormatPainterState
.
kOff
);
}
}
if
(
true
===
editor
.
isMarkerFormat
&&
true
===
this
.
Is_TextSelectionUse
())
if
(
true
===
editor
.
isMarkerFormat
&&
true
===
this
.
Is_TextSelectionUse
())
{
{
if
(
false
===
this
.
Document_Is_SelectionLocked
(
changestype_Paragraph_Content
))
if
(
false
===
this
.
Document_Is_SelectionLocked
(
changestype_Paragraph_Content
))
{
{
this
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_SetTextHighlight2
);
this
.
Create_NewHistoryPoint
(
AscDFH
.
historydescription_Document_SetTextHighlight2
);
var
ParaItem
=
null
;
var
ParaItem
=
null
;
if
(
this
.
HighlightColor
!=
highlight_None
)
if
(
this
.
HighlightColor
!=
highlight_None
)
{
{
var
TextPr
=
this
.
Get_Paragraph_TextPr
();
var
TextPr
=
this
.
Get_Paragraph_TextPr
();
if
(
"
undefined
"
===
typeof
(
TextPr
.
HighLight
)
||
null
===
TextPr
.
HighLight
||
highlight_None
===
TextPr
.
HighLight
||
if
(
"
undefined
"
===
typeof
(
TextPr
.
HighLight
)
||
null
===
TextPr
.
HighLight
||
highlight_None
===
TextPr
.
HighLight
||
this
.
HighlightColor
.
r
!=
TextPr
.
HighLight
.
r
||
this
.
HighlightColor
.
g
!=
TextPr
.
HighLight
.
g
||
this
.
HighlightColor
.
b
!=
TextPr
.
HighLight
.
b
)
this
.
HighlightColor
.
r
!=
TextPr
.
HighLight
.
r
||
this
.
HighlightColor
.
g
!=
TextPr
.
HighLight
.
g
||
this
.
HighlightColor
.
b
!=
TextPr
.
HighLight
.
b
)
ParaItem
=
new
ParaTextPr
({
HighLight
:
this
.
HighlightColor
});
ParaItem
=
new
ParaTextPr
({
HighLight
:
this
.
HighlightColor
});
else
else
ParaItem
=
new
ParaTextPr
({
HighLight
:
highlight_None
});
ParaItem
=
new
ParaTextPr
({
HighLight
:
highlight_None
});
}
}
else
else
ParaItem
=
new
ParaTextPr
({
HighLight
:
this
.
HighlightColor
});
ParaItem
=
new
ParaTextPr
({
HighLight
:
this
.
HighlightColor
});
this
.
Paragraph_Add
(
ParaItem
);
this
.
Paragraph_Add
(
ParaItem
);
this
.
Cursor_MoveAt
(
X
,
Y
,
false
);
this
.
Cursor_MoveAt
(
X
,
Y
,
false
);
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateSelectionState
();
editor
.
sync_MarkerFormatCallback
(
true
);
editor
.
sync_MarkerFormatCallback
(
true
);
}
}
}
}
}
}
this
.
private_UpdateCursorXY
(
true
,
true
);
this
.
private_UpdateCursorXY
(
true
,
true
);
};
};
CDocument
.
prototype
.
OnMouseMove
=
function
(
e
,
X
,
Y
,
PageIndex
)
CDocument
.
prototype
.
OnMouseMove
=
function
(
e
,
X
,
Y
,
PageIndex
)
{
{
if
(
PageIndex
<
0
)
if
(
PageIndex
<
0
)
return
;
return
;
if
(
true
===
this
.
Selection
.
Start
)
if
(
true
===
this
.
Selection
.
Start
)
this
.
private_UpdateTargetForCollaboration
();
this
.
private_UpdateTargetForCollaboration
();
this
.
Update_CursorType
(
X
,
Y
,
PageIndex
,
e
);
this
.
Update_CursorType
(
X
,
Y
,
PageIndex
,
e
);
this
.
CollaborativeEditing
.
Check_ForeignCursorsLabels
(
X
,
Y
,
PageIndex
);
this
.
CollaborativeEditing
.
Check_ForeignCursorsLabels
(
X
,
Y
,
PageIndex
);
if
(
1
===
this
.
Selection
.
DragDrop
.
Flag
)
if
(
1
===
this
.
Selection
.
DragDrop
.
Flag
)
{
{
// Если курсор не изменил позицию, тогда ничего не делаем, а если изменил, тогда стартуем Drag-n-Drop
// Если курсор не изменил позицию, тогда ничего не делаем, а если изменил, тогда стартуем Drag-n-Drop
if
(
Math
.
abs
(
this
.
Selection
.
DragDrop
.
Data
.
X
-
X
)
>
0.001
||
Math
.
abs
(
this
.
Selection
.
DragDrop
.
Data
.
Y
-
Y
)
>
0.001
)
if
(
Math
.
abs
(
this
.
Selection
.
DragDrop
.
Data
.
X
-
X
)
>
0.001
||
Math
.
abs
(
this
.
Selection
.
DragDrop
.
Data
.
Y
-
Y
)
>
0.001
)
{
{
this
.
Selection
.
DragDrop
.
Flag
=
0
;
this
.
Selection
.
DragDrop
.
Flag
=
0
;
this
.
Selection
.
DragDrop
.
Data
=
null
;
this
.
Selection
.
DragDrop
.
Data
=
null
;
// Вызываем стандартное событие mouseMove, чтобы сбросить различные подсказки, если они были
// Вызываем стандартное событие mouseMove, чтобы сбросить различные подсказки, если они были
editor
.
sync_MouseMoveStartCallback
();
this
.
Api
.
sync_MouseMoveStartCallback
();
editor
.
sync_MouseMoveCallback
(
new
AscCommon
.
CMouseMoveData
());
this
.
Api
.
sync_MouseMoveCallback
(
new
AscCommon
.
CMouseMoveData
());
editor
.
sync_MouseMoveEndCallback
();
this
.
Api
.
sync_MouseMoveEndCallback
();
this
.
DrawingDocument
.
StartTrackText
();
this
.
DrawingDocument
.
StartTrackText
();
}
}
return
;
return
;
}
}
if
(
true
===
this
.
Selection
.
Use
&&
true
===
this
.
Selection
.
Start
)
if
(
true
===
this
.
Selection
.
Use
&&
true
===
this
.
Selection
.
Start
)
{
{
this
.
CurPage
=
PageIndex
;
this
.
CurPage
=
PageIndex
;
this
.
Selection_SetEnd
(
X
,
Y
,
e
);
this
.
Selection_SetEnd
(
X
,
Y
,
e
);
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateSelectionState
();
}
}
};
};
CDocument
.
prototype
.
Get_Numbering
=
function
()
CDocument
.
prototype
.
Get_Numbering
=
function
()
{
{
return
this
.
Numbering
;
return
this
.
Numbering
;
};
};
CDocument
.
prototype
.
Internal_GetNumInfo
=
function
(
ParaId
,
NumPr
)
CDocument
.
prototype
.
Internal_GetNumInfo
=
function
(
ParaId
,
NumPr
)
{
{
var
TopDocument
=
this
.
Get_TopDocumentContent
();
var
TopDocument
=
this
.
Get_TopDocumentContent
();
return
TopDocument
.
Get_NumberingInfo
(
null
,
ParaId
,
NumPr
);
return
TopDocument
.
Get_NumberingInfo
(
null
,
ParaId
,
NumPr
);
};
};
CDocument
.
prototype
.
Get_Styles
=
function
()
CDocument
.
prototype
.
Get_Styles
=
function
()
{
{
return
this
.
Styles
;
return
this
.
Styles
;
};
};
CDocument
.
prototype
.
CopyStyle
=
function
()
CDocument
.
prototype
.
CopyStyle
=
function
()
{
{
return
this
.
Styles
.
CopyStyle
();
return
this
.
Styles
.
CopyStyle
();
};
};
CDocument
.
prototype
.
Get_TableStyleForPara
=
function
()
CDocument
.
prototype
.
Get_TableStyleForPara
=
function
()
{
{
return
null
;
return
null
;
};
};
CDocument
.
prototype
.
Get_ShapeStyleForPara
=
function
()
CDocument
.
prototype
.
Get_ShapeStyleForPara
=
function
()
{
{
return
null
;
return
null
;
};
};
CDocument
.
prototype
.
Get_TextBackGroundColor
=
function
()
CDocument
.
prototype
.
Get_TextBackGroundColor
=
function
()
{
{
return
undefined
;
return
undefined
;
};
};
CDocument
.
prototype
.
Content_GetPrev
=
function
(
Id
)
CDocument
.
prototype
.
Content_GetPrev
=
function
(
Id
)
{
{
var
Index
=
this
.
Internal_Content_Find
(
Id
);
var
Index
=
this
.
Internal_Content_Find
(
Id
);
if
(
Index
>
0
)
if
(
Index
>
0
)
{
{
return
this
.
Content
[
Index
-
1
];
return
this
.
Content
[
Index
-
1
];
}
}
return
null
;
return
null
;
};
};
CDocument
.
prototype
.
Content_GetNext
=
function
(
Id
)
CDocument
.
prototype
.
Content_GetNext
=
function
(
Id
)
{
{
var
Index
=
this
.
Internal_Content_Find
(
Id
);
var
Index
=
this
.
Internal_Content_Find
(
Id
);
if
(
-
1
!=
Index
&&
Index
<
this
.
Content
.
length
-
1
)
if
(
-
1
!=
Index
&&
Index
<
this
.
Content
.
length
-
1
)
{
{
return
this
.
Content
[
Index
+
1
];
return
this
.
Content
[
Index
+
1
];
}
}
return
null
;
return
null
;
};
};
CDocument
.
prototype
.
Internal_Content_Find
=
function
(
Id
)
CDocument
.
prototype
.
Internal_Content_Find
=
function
(
Id
)
{
{
return
0
;
return
0
;
for
(
var
Index
=
0
;
Index
<
this
.
Content
.
length
;
Index
++
)
for
(
var
Index
=
0
;
Index
<
this
.
Content
.
length
;
Index
++
)
{
{
if
(
this
.
Content
[
Index
].
GetId
()
===
Id
)
if
(
this
.
Content
[
Index
].
GetId
()
===
Id
)
return
Index
;
return
Index
;
}
}
return
-
1
;
return
-
1
;
};
};
CDocument
.
prototype
.
Select_DrawingObject
=
function
(
Id
)
CDocument
.
prototype
.
Select_DrawingObject
=
function
(
Id
)
{
{
this
.
Selection_Remove
();
this
.
Selection_Remove
();
// Прячем курсор
// Прячем курсор
this
.
DrawingDocument
.
TargetEnd
();
this
.
DrawingDocument
.
TargetEnd
();
this
.
DrawingDocument
.
SetCurrentPage
(
this
.
CurPage
);
this
.
DrawingDocument
.
SetCurrentPage
(
this
.
CurPage
);
this
.
Selection
.
Start
=
false
;
this
.
Selection
.
Start
=
false
;
this
.
Selection
.
Use
=
true
;
this
.
Selection
.
Use
=
true
;
this
.
Set_DocPosType
(
docpostype_DrawingObjects
);
this
.
Set_DocPosType
(
docpostype_DrawingObjects
);
this
.
DrawingObjects
.
selectById
(
Id
,
this
.
CurPage
);
this
.
DrawingObjects
.
selectById
(
Id
,
this
.
CurPage
);
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateSelectionState
();
};
};
/**
/**
* Получем ближайшую возможную позицию курсора.
* Получем ближайшую возможную позицию курсора.
...
@@ -7212,138 +7165,138 @@ CDocument.prototype.Select_DrawingObject = function(Id)
...
@@ -7212,138 +7165,138 @@ CDocument.prototype.Select_DrawingObject = function(Id)
*/
*/
CDocument
.
prototype
.
Get_NearestPos
=
function
(
PageNum
,
X
,
Y
,
bAnchor
,
Drawing
)
CDocument
.
prototype
.
Get_NearestPos
=
function
(
PageNum
,
X
,
Y
,
bAnchor
,
Drawing
)
{
{
if
(
undefined
===
bAnchor
)
if
(
undefined
===
bAnchor
)
bAnchor
=
false
;
bAnchor
=
false
;
// Работаем с колонтитулом
// TODO: Доработать сноски
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
if
(
docpostype_HdrFtr
===
this
.
Get_DocPosType
()
)
return
this
.
HdrFtr
.
Get_NearestPos
(
PageNum
,
X
,
Y
,
bAnchor
,
Drawing
);
return
this
.
HdrFtr
.
Get_NearestPos
(
PageNum
,
X
,
Y
,
bAnchor
,
Drawing
);
var
bInText
=
(
null
===
this
.
Is_InText
(
X
,
Y
,
PageNum
)
?
false
:
true
);
var
bInText
=
(
null
===
this
.
Is_InText
(
X
,
Y
,
PageNum
)
?
false
:
true
);
var
nInDrawing
=
this
.
DrawingObjects
.
isPointInDrawingObjects
(
X
,
Y
,
PageNum
,
this
);
var
nInDrawing
=
this
.
DrawingObjects
.
isPointInDrawingObjects
(
X
,
Y
,
PageNum
,
this
);
if
(
true
!=
bAnchor
)
if
(
true
!=
bAnchor
)
{
{
// Проверяем попадание в графические объекты
// Проверяем попадание в графические объекты
var
NearestPos
=
this
.
DrawingObjects
.
getNearestPos
(
X
,
Y
,
PageNum
,
Drawing
);
var
NearestPos
=
this
.
DrawingObjects
.
getNearestPos
(
X
,
Y
,
PageNum
,
Drawing
);
if
((
nInDrawing
===
DRAWING_ARRAY_TYPE_BEFORE
||
nInDrawing
===
DRAWING_ARRAY_TYPE_INLINE
||
(
false
===
bInText
&&
nInDrawing
>=
0
)
)
&&
null
!=
NearestPos
)
if
((
nInDrawing
===
DRAWING_ARRAY_TYPE_BEFORE
||
nInDrawing
===
DRAWING_ARRAY_TYPE_INLINE
||
(
false
===
bInText
&&
nInDrawing
>=
0
)
)
&&
null
!=
NearestPos
)
return
NearestPos
;
return
NearestPos
;
}
}
var
ContentPos
=
this
.
Internal_GetContentPosByXY
(
X
,
Y
,
PageNum
);
var
ContentPos
=
this
.
Internal_GetContentPosByXY
(
X
,
Y
,
PageNum
);
// Делаем логику как в ворде
// Делаем логику как в ворде
if
(
true
===
bAnchor
&&
ContentPos
>
0
&&
PageNum
>
0
&&
ContentPos
===
this
.
Pages
[
PageNum
].
Pos
&&
ContentPos
===
this
.
Pages
[
PageNum
-
1
].
EndPos
&&
this
.
Pages
[
PageNum
].
EndPos
>
this
.
Pages
[
PageNum
].
Pos
&&
type_Paragraph
===
this
.
Content
[
ContentPos
].
GetType
()
&&
true
===
this
.
Content
[
ContentPos
].
Is_ContentOnFirstPage
())
if
(
true
===
bAnchor
&&
ContentPos
>
0
&&
PageNum
>
0
&&
ContentPos
===
this
.
Pages
[
PageNum
].
Pos
&&
ContentPos
===
this
.
Pages
[
PageNum
-
1
].
EndPos
&&
this
.
Pages
[
PageNum
].
EndPos
>
this
.
Pages
[
PageNum
].
Pos
&&
type_Paragraph
===
this
.
Content
[
ContentPos
].
GetType
()
&&
true
===
this
.
Content
[
ContentPos
].
Is_ContentOnFirstPage
())
ContentPos
++
;
ContentPos
++
;
var
ElementPageIndex
=
this
.
private_GetElementPageIndexByXY
(
ContentPos
,
X
,
Y
,
PageNum
);
var
ElementPageIndex
=
this
.
private_GetElementPageIndexByXY
(
ContentPos
,
X
,
Y
,
PageNum
);
return
this
.
Content
[
ContentPos
].
Get_NearestPos
(
ElementPageIndex
,
X
,
Y
,
bAnchor
,
Drawing
);
return
this
.
Content
[
ContentPos
].
Get_NearestPos
(
ElementPageIndex
,
X
,
Y
,
bAnchor
,
Drawing
);
};
};
CDocument
.
prototype
.
Internal_Content_Add
=
function
(
Position
,
NewObject
,
bCheckTable
)
CDocument
.
prototype
.
Internal_Content_Add
=
function
(
Position
,
NewObject
,
bCheckTable
)
{
{
// Position = this.Content.length допускается
// Position = this.Content.length допускается
if
(
Position
<
0
||
Position
>
this
.
Content
.
length
)
if
(
Position
<
0
||
Position
>
this
.
Content
.
length
)
return
;
return
;
var
PrevObj
=
this
.
Content
[
Position
-
1
];
var
PrevObj
=
this
.
Content
[
Position
-
1
];
var
NextObj
=
this
.
Content
[
Position
];
var
NextObj
=
this
.
Content
[
Position
];
if
(
"
undefined
"
==
typeof
(
PrevObj
))
if
(
"
undefined
"
==
typeof
(
PrevObj
))
PrevObj
=
null
;
PrevObj
=
null
;
if
(
"
undefined
"
==
typeof
(
NextObj
))
if
(
"
undefined
"
==
typeof
(
NextObj
))
NextObj
=
null
;
NextObj
=
null
;
this
.
private_RecalculateNumbering
([
NewObject
]);
this
.
private_RecalculateNumbering
([
NewObject
]);
this
.
History
.
Add
(
this
,
{
Type
:
AscDFH
.
historyitem_Document_AddItem
,
Pos
:
Position
,
Item
:
NewObject
});
this
.
History
.
Add
(
this
,
{
Type
:
AscDFH
.
historyitem_Document_AddItem
,
Pos
:
Position
,
Item
:
NewObject
});
this
.
Content
.
splice
(
Position
,
0
,
NewObject
);
this
.
Content
.
splice
(
Position
,
0
,
NewObject
);
NewObject
.
Set_Parent
(
this
);
NewObject
.
Set_Parent
(
this
);
NewObject
.
Set_DocumentNext
(
NextObj
);
NewObject
.
Set_DocumentNext
(
NextObj
);
NewObject
.
Set_DocumentPrev
(
PrevObj
);
NewObject
.
Set_DocumentPrev
(
PrevObj
);
if
(
null
!=
PrevObj
)
if
(
null
!=
PrevObj
)
PrevObj
.
Set_DocumentNext
(
NewObject
);
PrevObj
.
Set_DocumentNext
(
NewObject
);
if
(
null
!=
NextObj
)
if
(
null
!=
NextObj
)
NextObj
.
Set_DocumentPrev
(
NewObject
);
NextObj
.
Set_DocumentPrev
(
NewObject
);
// Обновим информацию о секциях
// Обновим информацию о секциях
this
.
SectionsInfo
.
Update_OnAdd
(
Position
,
[
NewObject
]);
this
.
SectionsInfo
.
Update_OnAdd
(
Position
,
[
NewObject
]);
// Проверим последний параграф
// Проверим последний параграф
this
.
Check_SectionLastParagraph
();
this
.
Check_SectionLastParagraph
();
// Проверим, что последний элемент не таблица
// Проверим, что последний элемент не таблица
if
(
false
!=
bCheckTable
&&
type_Table
==
this
.
Content
[
this
.
Content
.
length
-
1
].
GetType
())
if
(
false
!=
bCheckTable
&&
type_Table
==
this
.
Content
[
this
.
Content
.
length
-
1
].
GetType
())
this
.
Internal_Content_Add
(
this
.
Content
.
length
,
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
));
this
.
Internal_Content_Add
(
this
.
Content
.
length
,
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
));
// Запоминаем, что нам нужно произвести переиндексацию элементов
// Запоминаем, что нам нужно произвести переиндексацию элементов
this
.
private_ReindexContent
(
Position
);
this
.
private_ReindexContent
(
Position
);
};
};
CDocument
.
prototype
.
Internal_Content_Remove
=
function
(
Position
,
Count
)
CDocument
.
prototype
.
Internal_Content_Remove
=
function
(
Position
,
Count
)
{
{
var
ChangePos
=
-
1
;
var
ChangePos
=
-
1
;
if
(
Position
<
0
||
Position
>=
this
.
Content
.
length
||
Count
<=
0
)
if
(
Position
<
0
||
Position
>=
this
.
Content
.
length
||
Count
<=
0
)
return
-
1
;
return
-
1
;
var
PrevObj
=
this
.
Content
[
Position
-
1
];
var
PrevObj
=
this
.
Content
[
Position
-
1
];
var
NextObj
=
this
.
Content
[
Position
+
Count
];
var
NextObj
=
this
.
Content
[
Position
+
Count
];
if
(
"
undefined
"
==
typeof
(
PrevObj
))
if
(
"
undefined
"
==
typeof
(
PrevObj
))
PrevObj
=
null
;
PrevObj
=
null
;
if
(
"
undefined
"
==
typeof
(
NextObj
))
if
(
"
undefined
"
==
typeof
(
NextObj
))
NextObj
=
null
;
NextObj
=
null
;
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
for
(
var
Index
=
0
;
Index
<
Count
;
Index
++
)
{
{
this
.
Content
[
Position
+
Index
].
PreDelete
();
this
.
Content
[
Position
+
Index
].
PreDelete
();
}
}
this
.
History
.
Add
(
this
,
{
this
.
History
.
Add
(
this
,
{
Type
:
AscDFH
.
historyitem_Document_RemoveItem
,
Type
:
AscDFH
.
historyitem_Document_RemoveItem
,
Pos
:
Position
,
Pos
:
Position
,
Items
:
this
.
Content
.
slice
(
Position
,
Position
+
Count
)
Items
:
this
.
Content
.
slice
(
Position
,
Position
+
Count
)
});
});
var
Elements
=
this
.
Content
.
splice
(
Position
,
Count
);
var
Elements
=
this
.
Content
.
splice
(
Position
,
Count
);
this
.
private_RecalculateNumbering
(
Elements
);
this
.
private_RecalculateNumbering
(
Elements
);
if
(
null
!=
PrevObj
)
if
(
null
!=
PrevObj
)
PrevObj
.
Set_DocumentNext
(
NextObj
);
PrevObj
.
Set_DocumentNext
(
NextObj
);
if
(
null
!=
NextObj
)
if
(
null
!=
NextObj
)
NextObj
.
Set_DocumentPrev
(
PrevObj
);
NextObj
.
Set_DocumentPrev
(
PrevObj
);
// Проверим, что последний элемент не таблица
// Проверим, что последний элемент не таблица
if
(
type_Table
==
this
.
Content
[
this
.
Content
.
length
-
1
].
GetType
())
if
(
type_Table
==
this
.
Content
[
this
.
Content
.
length
-
1
].
GetType
())
this
.
Internal_Content_Add
(
this
.
Content
.
length
,
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
));
this
.
Internal_Content_Add
(
this
.
Content
.
length
,
new
Paragraph
(
this
.
DrawingDocument
,
this
,
0
,
0
,
0
,
0
,
0
));
// Обновим информацию о секциях
// Обновим информацию о секциях
this
.
SectionsInfo
.
Update_OnRemove
(
Position
,
Count
,
true
);
this
.
SectionsInfo
.
Update_OnRemove
(
Position
,
Count
,
true
);
// Проверим последний параграф
// Проверим последний параграф
this
.
Check_SectionLastParagraph
();
this
.
Check_SectionLastParagraph
();
// Проверим не является ли рамкой последний параграф
// Проверим не является ли рамкой последний параграф
this
.
Check_FramePrLastParagraph
();
this
.
Check_FramePrLastParagraph
();
// Запоминаем, что нам нужно произвести переиндексацию элементов
// Запоминаем, что нам нужно произвести переиндексацию элементов
this
.
private_ReindexContent
(
Position
);
this
.
private_ReindexContent
(
Position
);
return
ChangePos
;
return
ChangePos
;
};
};
CDocument
.
prototype
.
Clear_ContentChanges
=
function
()
CDocument
.
prototype
.
Clear_ContentChanges
=
function
()
{
{
this
.
m_oContentChanges
.
Clear
();
this
.
m_oContentChanges
.
Clear
();
};
};
CDocument
.
prototype
.
Add_ContentChanges
=
function
(
Changes
)
CDocument
.
prototype
.
Add_ContentChanges
=
function
(
Changes
)
{
{
this
.
m_oContentChanges
.
Add
(
Changes
);
this
.
m_oContentChanges
.
Add
(
Changes
);
};
};
CDocument
.
prototype
.
Refresh_ContentChanges
=
function
()
CDocument
.
prototype
.
Refresh_ContentChanges
=
function
()
{
{
this
.
m_oContentChanges
.
Refresh
();
this
.
m_oContentChanges
.
Refresh
();
};
};
/**
/**
* @param AlignV 0 - Верх, 1 - низ
* @param AlignV 0 - Верх, 1 - низ
...
@@ -7351,297 +7304,297 @@ CDocument.prototype.Refresh_ContentChanges = function()
...
@@ -7351,297 +7304,297 @@ CDocument.prototype.Refresh_ContentChanges = function()
*/
*/
CDocument
.
prototype
.
Document_AddPageNum
=
function
(
AlignV
,
AlignH
)
CDocument
.
prototype
.
Document_AddPageNum
=
function
(
AlignV
,
AlignH
)
{
{
if
(
AlignV
>=
0
)
if
(
AlignV
>=
0
)
{
{
var
PageIndex
=
this
.
CurPage
;
var
PageIndex
=
this
.
CurPage
;
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
if
(
docpostype_HdrFtr
===
this
.
Get_DocPosType
()
)
PageIndex
=
this
.
HdrFtr
.
Get_CurPage
();
PageIndex
=
this
.
HdrFtr
.
Get_CurPage
();
if
(
PageIndex
<
0
)
if
(
PageIndex
<
0
)
PageIndex
=
this
.
CurPage
;
PageIndex
=
this
.
CurPage
;
this
.
Create_HdrFtrWidthPageNum
(
PageIndex
,
AlignV
,
AlignH
);
this
.
Create_HdrFtrWidthPageNum
(
PageIndex
,
AlignV
,
AlignH
);
}
}
else
else
{
{
this
.
Paragraph_Add
(
new
ParaPageNum
());
this
.
Paragraph_Add
(
new
ParaPageNum
());
}
}
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateInterfaceState
();
};
};
CDocument
.
prototype
.
Document_SetHdrFtrFirstPage
=
function
(
Value
)
CDocument
.
prototype
.
Document_SetHdrFtrFirstPage
=
function
(
Value
)
{
{
var
CurHdrFtr
=
this
.
HdrFtr
.
CurHdrFtr
;
var
CurHdrFtr
=
this
.
HdrFtr
.
CurHdrFtr
;
if
(
null
===
CurHdrFtr
||
-
1
===
CurHdrFtr
.
RecalcInfo
.
CurPage
)
if
(
null
===
CurHdrFtr
||
-
1
===
CurHdrFtr
.
RecalcInfo
.
CurPage
)
return
;
return
;
var
CurPage
=
CurHdrFtr
.
RecalcInfo
.
CurPage
;
var
CurPage
=
CurHdrFtr
.
RecalcInfo
.
CurPage
;
var
Index
=
this
.
Pages
[
CurPage
].
Pos
;
var
Index
=
this
.
Pages
[
CurPage
].
Pos
;
var
SectPr
=
this
.
SectionsInfo
.
Get_SectPr
(
Index
).
SectPr
;
var
SectPr
=
this
.
SectionsInfo
.
Get_SectPr
(
Index
).
SectPr
;
SectPr
.
Set_TitlePage
(
Value
);
SectPr
.
Set_TitlePage
(
Value
);
if
(
true
===
Value
)
if
(
true
===
Value
)
{
{
// Если мы добавляем разные колонтитулы для первой страницы, а этих колонтитулов нет, тогда создаем их
// Если мы добавляем разные колонтитулы для первой страницы, а этих колонтитулов нет, тогда создаем их
var
FirstSectPr
=
this
.
SectionsInfo
.
Get_SectPr2
(
0
).
SectPr
;
var
FirstSectPr
=
this
.
SectionsInfo
.
Get_SectPr2
(
0
).
SectPr
;
var
FirstHeader
=
FirstSectPr
.
Get_Header_First
();
var
FirstHeader
=
FirstSectPr
.
Get_Header_First
();
var
FirstFooter
=
FirstSectPr
.
Get_Footer_First
();
var
FirstFooter
=
FirstSectPr
.
Get_Footer_First
();
if
(
null
===
FirstHeader
)
if
(
null
===
FirstHeader
)
{
{
var
Header
=
new
CHeaderFooter
(
this
.
HdrFtr
,
this
,
this
.
DrawingDocument
,
hdrftr_Header
);
var
Header
=
new
CHeaderFooter
(
this
.
HdrFtr
,
this
,
this
.
DrawingDocument
,
hdrftr_Header
);
FirstSectPr
.
Set_Header_First
(
Header
);
FirstSectPr
.
Set_Header_First
(
Header
);
this
.
HdrFtr
.
Set_CurHdrFtr
(
Header
);
this
.
HdrFtr
.
Set_CurHdrFtr
(
Header
);
}
}
else
else
this
.
HdrFtr
.
Set_CurHdrFtr
(
FirstHeader
);
this
.
HdrFtr
.
Set_CurHdrFtr
(
FirstHeader
);
if
(
null
===
FirstFooter
)
if
(
null
===
FirstFooter
)
{
{
var
Footer
=
new
CHeaderFooter
(
this
.
HdrFtr
,
this
,
this
.
DrawingDocument
,
hdrftr_Footer
);
var
Footer
=
new
CHeaderFooter
(
this
.
HdrFtr
,
this
,
this
.
DrawingDocument
,
hdrftr_Footer
);
FirstSectPr
.
Set_Footer_First
(
Footer
);
FirstSectPr
.
Set_Footer_First
(
Footer
);
}
}
}
}
else
else
{
{
var
TempSectPr
=
SectPr
;
var
TempSectPr
=
SectPr
;
var
TempIndex
=
Index
;
var
TempIndex
=
Index
;
while
(
null
===
TempSectPr
.
Get_Header_Default
())
while
(
null
===
TempSectPr
.
Get_Header_Default
())
{
{
TempIndex
--
;
TempIndex
--
;
if
(
TempIndex
<
0
)
if
(
TempIndex
<
0
)
break
;
break
;
TempSectPr
=
this
.
SectionsInfo
.
Get_SectPr
(
TempIndex
).
SectPr
;
TempSectPr
=
this
.
SectionsInfo
.
Get_SectPr
(
TempIndex
).
SectPr
;
}
}
this
.
HdrFtr
.
Set_CurHdrFtr
(
TempSectPr
.
Get_Header_Default
());
this
.
HdrFtr
.
Set_CurHdrFtr
(
TempSectPr
.
Get_Header_Default
());
}
}
if
(
null
!==
this
.
HdrFtr
.
CurHdrFtr
)
if
(
null
!==
this
.
HdrFtr
.
CurHdrFtr
)
this
.
HdrFtr
.
CurHdrFtr
.
Content
.
Cursor_MoveToStartPos
();
this
.
HdrFtr
.
CurHdrFtr
.
Content
.
Cursor_MoveToStartPos
();
this
.
Recalculate
();
this
.
Recalculate
();
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateInterfaceState
();
};
};
CDocument
.
prototype
.
Document_SetHdrFtrEvenAndOddHeaders
=
function
(
Value
)
CDocument
.
prototype
.
Document_SetHdrFtrEvenAndOddHeaders
=
function
(
Value
)
{
{
this
.
Set_DocumentEvenAndOddHeaders
(
Value
);
this
.
Set_DocumentEvenAndOddHeaders
(
Value
);
var
FirstSectPr
;
var
FirstSectPr
;
if
(
true
===
Value
)
if
(
true
===
Value
)
{
{
// Если мы добавляем разные колонтитулы для четных и нечетных страниц, а этих колонтитулов нет, тогда
// Если мы добавляем разные колонтитулы для четных и нечетных страниц, а этих колонтитулов нет, тогда
// создаем их в самой первой секции
// создаем их в самой первой секции
FirstSectPr
=
this
.
SectionsInfo
.
Get_SectPr2
(
0
).
SectPr
;
FirstSectPr
=
this
.
SectionsInfo
.
Get_SectPr2
(
0
).
SectPr
;
if
(
null
===
FirstSectPr
.
Get_Header_Even
())
if
(
null
===
FirstSectPr
.
Get_Header_Even
())
{
{
var
Header
=
new
CHeaderFooter
(
this
.
HdrFtr
,
this
,
this
.
DrawingDocument
,
hdrftr_Header
);
var
Header
=
new
CHeaderFooter
(
this
.
HdrFtr
,
this
,
this
.
DrawingDocument
,
hdrftr_Header
);
FirstSectPr
.
Set_Header_Even
(
Header
);
FirstSectPr
.
Set_Header_Even
(
Header
);
}
}
if
(
null
===
FirstSectPr
.
Get_Footer_Even
())
if
(
null
===
FirstSectPr
.
Get_Footer_Even
())
{
{
var
Footer
=
new
CHeaderFooter
(
this
.
HdrFtr
,
this
,
this
.
DrawingDocument
,
hdrftr_Footer
);
var
Footer
=
new
CHeaderFooter
(
this
.
HdrFtr
,
this
,
this
.
DrawingDocument
,
hdrftr_Footer
);
FirstSectPr
.
Set_Footer_Even
(
Footer
);
FirstSectPr
.
Set_Footer_Even
(
Footer
);
}
}
}
}
else
else
{
{
FirstSectPr
=
this
.
SectionsInfo
.
Get_SectPr2
(
0
).
SectPr
;
FirstSectPr
=
this
.
SectionsInfo
.
Get_SectPr2
(
0
).
SectPr
;
}
}
if
(
null
!==
FirstSectPr
.
Get_Header_First
()
&&
true
===
FirstSectPr
.
TitlePage
)
if
(
null
!==
FirstSectPr
.
Get_Header_First
()
&&
true
===
FirstSectPr
.
TitlePage
)
this
.
HdrFtr
.
Set_CurHdrFtr
(
FirstSectPr
.
Get_Header_First
());
this
.
HdrFtr
.
Set_CurHdrFtr
(
FirstSectPr
.
Get_Header_First
());
else
else
this
.
HdrFtr
.
Set_CurHdrFtr
(
FirstSectPr
.
Get_Header_Default
());
this
.
HdrFtr
.
Set_CurHdrFtr
(
FirstSectPr
.
Get_Header_Default
());
this
.
Recalculate
();
this
.
Recalculate
();
if
(
null
!==
this
.
HdrFtr
.
CurHdrFtr
)
if
(
null
!==
this
.
HdrFtr
.
CurHdrFtr
)
this
.
HdrFtr
.
CurHdrFtr
.
Content
.
Cursor_MoveToStartPos
();
this
.
HdrFtr
.
CurHdrFtr
.
Content
.
Cursor_MoveToStartPos
();
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateInterfaceState
();
};
};
CDocument
.
prototype
.
Document_SetHdrFtrDistance
=
function
(
Value
)
CDocument
.
prototype
.
Document_SetHdrFtrDistance
=
function
(
Value
)
{
{
var
CurHdrFtr
=
this
.
HdrFtr
.
CurHdrFtr
;
var
CurHdrFtr
=
this
.
HdrFtr
.
CurHdrFtr
;
if
(
null
===
CurHdrFtr
)
if
(
null
===
CurHdrFtr
)
return
;
return
;
var
CurPage
=
CurHdrFtr
.
RecalcInfo
.
CurPage
;
var
CurPage
=
CurHdrFtr
.
RecalcInfo
.
CurPage
;
if
(
-
1
===
CurPage
)
if
(
-
1
===
CurPage
)
return
;
return
;
var
Index
=
this
.
Pages
[
CurPage
].
Pos
;
var
Index
=
this
.
Pages
[
CurPage
].
Pos
;
var
SectPr
=
this
.
SectionsInfo
.
Get_SectPr
(
Index
).
SectPr
;
var
SectPr
=
this
.
SectionsInfo
.
Get_SectPr
(
Index
).
SectPr
;
if
(
hdrftr_Header
===
CurHdrFtr
.
Type
)
if
(
hdrftr_Header
===
CurHdrFtr
.
Type
)
SectPr
.
Set_PageMargins_Header
(
Value
);
SectPr
.
Set_PageMargins_Header
(
Value
);
else
else
SectPr
.
Set_PageMargins_Footer
(
Value
);
SectPr
.
Set_PageMargins_Footer
(
Value
);
this
.
Recalculate
();
this
.
Recalculate
();
this
.
Document_UpdateRulersState
();
this
.
Document_UpdateRulersState
();
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateSelectionState
();
};
};
CDocument
.
prototype
.
Document_SetHdrFtrBounds
=
function
(
Y0
,
Y1
)
CDocument
.
prototype
.
Document_SetHdrFtrBounds
=
function
(
Y0
,
Y1
)
{
{
var
CurHdrFtr
=
this
.
HdrFtr
.
CurHdrFtr
;
var
CurHdrFtr
=
this
.
HdrFtr
.
CurHdrFtr
;
if
(
null
===
CurHdrFtr
)
if
(
null
===
CurHdrFtr
)
return
;
return
;
var
CurPage
=
CurHdrFtr
.
RecalcInfo
.
CurPage
;
var
CurPage
=
CurHdrFtr
.
RecalcInfo
.
CurPage
;
if
(
-
1
===
CurPage
)
if
(
-
1
===
CurPage
)
return
;
return
;
var
Index
=
this
.
Pages
[
CurPage
].
Pos
;
var
Index
=
this
.
Pages
[
CurPage
].
Pos
;
var
SectPr
=
this
.
SectionsInfo
.
Get_SectPr
(
Index
).
SectPr
;
var
SectPr
=
this
.
SectionsInfo
.
Get_SectPr
(
Index
).
SectPr
;
var
Bounds
=
CurHdrFtr
.
Get_Bounds
();
var
Bounds
=
CurHdrFtr
.
Get_Bounds
();
if
(
hdrftr_Header
===
CurHdrFtr
.
Type
)
if
(
hdrftr_Header
===
CurHdrFtr
.
Type
)
{
{
if
(
null
!==
Y0
)
if
(
null
!==
Y0
)
SectPr
.
Set_PageMargins_Header
(
Y0
);
SectPr
.
Set_PageMargins_Header
(
Y0
);
if
(
null
!==
Y1
)
if
(
null
!==
Y1
)
SectPr
.
Set_PageMargins
(
undefined
,
Y1
,
undefined
,
undefined
);
SectPr
.
Set_PageMargins
(
undefined
,
Y1
,
undefined
,
undefined
);
}
}
else
else
{
{
if
(
null
!==
Y0
)
if
(
null
!==
Y0
)
{
{
var
H
=
Bounds
.
Bottom
-
Bounds
.
Top
;
var
H
=
Bounds
.
Bottom
-
Bounds
.
Top
;
var
_Y1
=
Y0
+
H
;
var
_Y1
=
Y0
+
H
;
SectPr
.
Set_PageMargins_Footer
(
SectPr
.
Get_PageHeight
()
-
_Y1
);
SectPr
.
Set_PageMargins_Footer
(
SectPr
.
Get_PageHeight
()
-
_Y1
);
}
}
}
}
this
.
Recalculate
();
this
.
Recalculate
();
this
.
Document_UpdateRulersState
();
this
.
Document_UpdateRulersState
();
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateInterfaceState
();
};
};
CDocument
.
prototype
.
Document_SetHdrFtrLink
=
function
(
bLinkToPrevious
)
CDocument
.
prototype
.
Document_SetHdrFtrLink
=
function
(
bLinkToPrevious
)
{
{
var
CurHdrFtr
=
this
.
HdrFtr
.
CurHdrFtr
;
var
CurHdrFtr
=
this
.
HdrFtr
.
CurHdrFtr
;
if
(
docpostype_HdrFtr
!==
this
.
CurPos
.
Type
||
null
===
CurHdrFtr
||
-
1
===
CurHdrFtr
.
RecalcInfo
.
CurPage
)
if
(
docpostype_HdrFtr
!==
this
.
Get_DocPosType
()
||
null
===
CurHdrFtr
||
-
1
===
CurHdrFtr
.
RecalcInfo
.
CurPage
)
return
;
return
;
var
PageIndex
=
CurHdrFtr
.
RecalcInfo
.
CurPage
;
var
PageIndex
=
CurHdrFtr
.
RecalcInfo
.
CurPage
;
var
Index
=
this
.
Pages
[
PageIndex
].
Pos
;
var
Index
=
this
.
Pages
[
PageIndex
].
Pos
;
var
SectPr
=
this
.
SectionsInfo
.
Get_SectPr
(
Index
).
SectPr
;
var
SectPr
=
this
.
SectionsInfo
.
Get_SectPr
(
Index
).
SectPr
;
// У самой первой секции не может быть повторяющихся колонтитулов, поэтому не делаем ничего
// У самой первой секции не может быть повторяющихся колонтитулов, поэтому не делаем ничего
if
(
SectPr
===
this
.
SectionsInfo
.
Get_SectPr2
(
0
).
SectPr
)
if
(
SectPr
===
this
.
SectionsInfo
.
Get_SectPr2
(
0
).
SectPr
)
return
;
return
;
// Определим тип колонтитула, в котором мы находимся
// Определим тип колонтитула, в котором мы находимся
var
SectionPageInfo
=
this
.
Get_SectionPageNumInfo
(
PageIndex
);
var
SectionPageInfo
=
this
.
Get_SectionPageNumInfo
(
PageIndex
);
var
bFirst
=
(
true
===
SectionPageInfo
.
bFirst
&&
true
===
SectPr
.
Get_TitlePage
()
?
true
:
false
);
var
bFirst
=
(
true
===
SectionPageInfo
.
bFirst
&&
true
===
SectPr
.
Get_TitlePage
()
?
true
:
false
);
var
bEven
=
(
true
===
SectionPageInfo
.
bEven
&&
true
===
EvenAndOddHeaders
?
true
:
false
);
var
bEven
=
(
true
===
SectionPageInfo
.
bEven
&&
true
===
EvenAndOddHeaders
?
true
:
false
);
var
bHeader
=
(
hdrftr_Header
===
CurHdrFtr
.
Type
?
true
:
false
);
var
bHeader
=
(
hdrftr_Header
===
CurHdrFtr
.
Type
?
true
:
false
);
var
_CurHdrFtr
=
SectPr
.
Get_HdrFtr
(
bHeader
,
bFirst
,
bEven
);
var
_CurHdrFtr
=
SectPr
.
Get_HdrFtr
(
bHeader
,
bFirst
,
bEven
);
if
(
true
===
bLinkToPrevious
)
if
(
true
===
bLinkToPrevious
)
{
{
// Если нам надо повторять колонтитул, а он уже изначально повторяющийся, тогда не делаем ничего
// Если нам надо повторять колонтитул, а он уже изначально повторяющийся, тогда не делаем ничего
if
(
null
===
_CurHdrFtr
)
if
(
null
===
_CurHdrFtr
)
return
;
return
;
// Очистим селект
// Очистим селект
_CurHdrFtr
.
Selection_Remove
();
_CurHdrFtr
.
Selection_Remove
();
// Просто удаляем запись о данном колонтитуле в секции
// Просто удаляем запись о данном колонтитуле в секции
SectPr
.
Set_HdrFtr
(
bHeader
,
bFirst
,
bEven
,
null
);
SectPr
.
Set_HdrFtr
(
bHeader
,
bFirst
,
bEven
,
null
);
var
HdrFtr
=
this
.
Get_SectionHdrFtr
(
PageIndex
,
bFirst
,
bEven
);
var
HdrFtr
=
this
.
Get_SectionHdrFtr
(
PageIndex
,
bFirst
,
bEven
);
// Заглушка. Вообще такого не должно быть, чтобы был колонтитул не в первой секции, и не было в первой,
// Заглушка. Вообще такого не должно быть, чтобы был колонтитул не в первой секции, и не было в первой,
// но, на всякий случай, обработаем такую ситуацию.
// но, на всякий случай, обработаем такую ситуацию.
if
(
true
===
bHeader
)
if
(
true
===
bHeader
)
{
{
if
(
null
===
HdrFtr
.
Header
)
if
(
null
===
HdrFtr
.
Header
)
CurHdrFtr
=
this
.
Create_SectionHdrFtr
(
hdrftr_Header
,
PageIndex
);
CurHdrFtr
=
this
.
Create_SectionHdrFtr
(
hdrftr_Header
,
PageIndex
);
else
else
CurHdrFtr
=
HdrFtr
.
Header
;
CurHdrFtr
=
HdrFtr
.
Header
;
}
}
else
else
{
{
if
(
null
===
HdrFtr
.
Footer
)
if
(
null
===
HdrFtr
.
Footer
)
CurHdrFtr
=
this
.
Create_SectionHdrFtr
(
hdrftr_Footer
,
PageIndex
);
CurHdrFtr
=
this
.
Create_SectionHdrFtr
(
hdrftr_Footer
,
PageIndex
);
else
else
CurHdrFtr
=
HdrFtr
.
Footer
;
CurHdrFtr
=
HdrFtr
.
Footer
;
}
}
this
.
HdrFtr
.
Set_CurHdrFtr
(
CurHdrFtr
);
this
.
HdrFtr
.
Set_CurHdrFtr
(
CurHdrFtr
);
this
.
HdrFtr
.
CurHdrFtr
.
Cursor_MoveToStartPos
(
false
);
this
.
HdrFtr
.
CurHdrFtr
.
Cursor_MoveToStartPos
(
false
);
}
}
else
else
{
{
// Если данный колонтитул уже не повторяющийся, тогда ничего не делаем
// Если данный колонтитул уже не повторяющийся, тогда ничего не делаем
if
(
null
!==
_CurHdrFtr
)
if
(
null
!==
_CurHdrFtr
)
return
;
return
;
var
NewHdrFtr
=
CurHdrFtr
.
Copy
();
var
NewHdrFtr
=
CurHdrFtr
.
Copy
();
SectPr
.
Set_HdrFtr
(
bHeader
,
bFirst
,
bEven
,
NewHdrFtr
);
SectPr
.
Set_HdrFtr
(
bHeader
,
bFirst
,
bEven
,
NewHdrFtr
);
this
.
HdrFtr
.
Set_CurHdrFtr
(
NewHdrFtr
);
this
.
HdrFtr
.
Set_CurHdrFtr
(
NewHdrFtr
);
this
.
HdrFtr
.
CurHdrFtr
.
Cursor_MoveToStartPos
(
false
);
this
.
HdrFtr
.
CurHdrFtr
.
Cursor_MoveToStartPos
(
false
);
}
}
this
.
Recalculate
();
this
.
Recalculate
();
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateInterfaceState
();
};
};
CDocument
.
prototype
.
Document_Format_Copy
=
function
()
CDocument
.
prototype
.
Document_Format_Copy
=
function
()
{
{
this
.
CopyTextPr
=
this
.
Get_Paragraph_TextPr_Copy
();
this
.
CopyTextPr
=
this
.
Get_Paragraph_TextPr_Copy
();
this
.
CopyParaPr
=
this
.
Get_Paragraph_ParaPr_Copy
();
this
.
CopyParaPr
=
this
.
Get_Paragraph_ParaPr_Copy
();
};
};
CDocument
.
prototype
.
Document_End_HdrFtrEditing
=
function
()
CDocument
.
prototype
.
Document_End_HdrFtrEditing
=
function
()
{
{
if
(
docpostype_HdrFtr
===
this
.
CurPos
.
Type
)
if
(
docpostype_HdrFtr
===
this
.
Get_DocPosType
()
)
{
{
this
.
Set_DocPosType
(
docpostype_Content
);
this
.
Set_DocPosType
(
docpostype_Content
);
var
CurHdrFtr
=
this
.
HdrFtr
.
Get_CurHdrFtr
();
var
CurHdrFtr
=
this
.
HdrFtr
.
Get_CurHdrFtr
();
if
(
null
===
CurHdrFtr
||
undefined
===
CurHdrFtr
)
if
(
null
===
CurHdrFtr
||
undefined
===
CurHdrFtr
)
{
{
this
.
Cursor_MoveToStartPos
(
false
);
this
.
Cursor_MoveToStartPos
(
false
);
}
}
else
else
{
{
CurHdrFtr
.
Selection_Remove
();
CurHdrFtr
.
Selection_Remove
();
if
(
hdrftr_Header
==
CurHdrFtr
.
Type
)
if
(
hdrftr_Header
==
CurHdrFtr
.
Type
)
this
.
Cursor_MoveAt
(
0
,
0
,
false
);
this
.
Cursor_MoveAt
(
0
,
0
,
false
);
else
else
this
.
Cursor_MoveAt
(
0
,
100000
,
false
);
// TODO: Переделать здесь по нормальному
this
.
Cursor_MoveAt
(
0
,
100000
,
false
);
// TODO: Переделать здесь по нормальному
}
}
this
.
DrawingDocument
.
ClearCachePages
();
this
.
DrawingDocument
.
ClearCachePages
();
this
.
DrawingDocument
.
FirePaint
();
this
.
DrawingDocument
.
FirePaint
();
this
.
Document_UpdateRulersState
();
this
.
Document_UpdateRulersState
();
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateInterfaceState
();
this
.
Document_UpdateSelectionState
();
this
.
Document_UpdateSelectionState
();
}
}
};
};
CDocument
.
prototype
.
Document_Format_Paste
=
function
()
CDocument
.
prototype
.
Document_Format_Paste
=
function
()
{
{
...
@@ -15893,7 +15846,38 @@ CDocument.prototype.controller_SelectAll = function()
...
@@ -15893,7 +15846,38 @@ CDocument.prototype.controller_SelectAll = function()
this
.
Content
[
Index
].
Select_All
();
this
.
Content
[
Index
].
Select_All
();
}
}
};
};
CDocument
.
prototype
.
controller_GetSelectedContent
=
function
(
SelectedContent
)
{
if
(
true
!==
this
.
Selection
.
Use
||
this
.
Selection
.
Flag
!==
selectionflag_Common
)
return
;
var
StartPos
=
this
.
Selection
.
StartPos
;
var
EndPos
=
this
.
Selection
.
EndPos
;
if
(
StartPos
>
EndPos
)
{
StartPos
=
this
.
Selection
.
EndPos
;
EndPos
=
this
.
Selection
.
StartPos
;
}
for
(
var
Index
=
StartPos
;
Index
<=
EndPos
;
Index
++
)
{
this
.
Content
[
Index
].
Get_SelectedContent
(
SelectedContent
);
}
};
CDocument
.
prototype
.
controller_UpdateCursorType
=
function
(
X
,
Y
,
PageAbs
,
MouseEvent
)
{
var
bInText
=
(
null
===
this
.
Is_InText
(
X
,
Y
,
PageAbs
)
?
false
:
true
);
var
bTableBorder
=
(
null
===
this
.
Is_TableBorder
(
X
,
Y
,
PageAbs
)
?
false
:
true
);
// Ничего не делаем
if
(
true
===
this
.
DrawingObjects
.
updateCursorType
(
PageAbs
,
X
,
Y
,
MouseEvent
,
(
true
===
bInText
||
true
===
bTableBorder
?
true
:
false
)))
return
;
var
ContentPos
=
this
.
Internal_GetContentPosByXY
(
X
,
Y
,
PageAbs
);
var
Item
=
this
.
Content
[
ContentPos
];
var
ElementPageIndex
=
this
.
private_GetElementPageIndexByXY
(
ContentPos
,
X
,
Y
,
PageAbs
);
Item
.
Update_CursorType
(
X
,
Y
,
ElementPageIndex
);
};
CDocument
.
prototype
.
controller_AddToParagraph
=
function
(
ParaItem
,
bRecalculate
)
CDocument
.
prototype
.
controller_AddToParagraph
=
function
(
ParaItem
,
bRecalculate
)
...
...
word/Editor/DocumentControllerBase.js
View file @
93a4d3c9
...
@@ -536,6 +536,16 @@ CDocumentControllerBase.prototype.CheckPosInSelection = function(X, Y, PageAbs,
...
@@ -536,6 +536,16 @@ CDocumentControllerBase.prototype.CheckPosInSelection = function(X, Y, PageAbs,
* Выделяем все содержимое.
* Выделяем все содержимое.
*/
*/
CDocumentControllerBase
.
prototype
.
SelectAll
=
function
(){};
CDocumentControllerBase
.
prototype
.
SelectAll
=
function
(){};
/**
* Получаем выделенный контент.
* @param SelectedContent
*/
CDocumentControllerBase
.
prototype
.
GetSelectedContent
=
function
(
SelectedContent
){};
/**
* Обновляем вид курсора.
*/
CDocumentControllerBase
.
prototype
.
UpdateCursorType
=
function
(
X
,
Y
,
PageAbs
,
MouseEvent
){};
/**
/**
* Добавляем элемент в параграф.
* Добавляем элемент в параграф.
* @param oItem
* @param oItem
...
...
word/Editor/DrawingsController.js
View file @
93a4d3c9
...
@@ -295,6 +295,15 @@ CDrawingsController.prototype.SelectAll = function()
...
@@ -295,6 +295,15 @@ CDrawingsController.prototype.SelectAll = function()
{
{
this
.
DrawingObjects
.
selectAll
();
this
.
DrawingObjects
.
selectAll
();
};
};
CDrawingsController
.
prototype
.
GetSelectedContent
=
function
(
SelectedContent
)
{
this
.
DrawingObjects
.
Get_SelectedContent
(
SelectedContent
);
};
CDrawingsController
.
prototype
.
UpdateCursorType
=
function
(
X
,
Y
,
PageAbs
,
MouseEvent
)
{
// TODO: Надо вызывать не у LogicDocument, а у DocumentContent заданного
this
.
LogicDocument
.
controller_UpdateCursorType
(
X
,
Y
,
PageAbs
,
MouseEvent
);
};
CDrawingsController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
CDrawingsController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
{
{
...
...
word/Editor/Footnotes.js
View file @
93a4d3c9
...
@@ -880,7 +880,30 @@ CFootnotesController.prototype.SelectAll = function()
...
@@ -880,7 +880,30 @@ CFootnotesController.prototype.SelectAll = function()
this
.
CurFootnote
.
Select_All
();
this
.
CurFootnote
.
Select_All
();
}
}
};
};
CFootnotesController
.
prototype
.
GetSelectedContent
=
function
(
SelectedContent
)
{
// TODO: Доделать селект и курсор
if
(
true
===
this
.
Selection
.
Use
)
{
}
else
{
if
(
null
!==
this
.
CurFootnote
)
this
.
CurFootnote
.
Get_SelectedContent
(
SelectedContent
);
}
};
CFootnotesController
.
prototype
.
UpdateCursorType
=
function
(
X
,
Y
,
PageAbs
,
MouseEvent
)
{
// TODO: Доделать селект и курсор
if
(
true
===
this
.
Selection
.
Use
)
{
}
else
{
if
(
null
!==
this
.
CurFootnote
)
this
.
CurFootnote
.
Update_CursorType
(
X
,
Y
,
PageAbs
,
MouseEvent
);
}
};
CFootnotesController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
CFootnotesController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
{
{
...
...
word/Editor/HeaderFooterController.js
View file @
93a4d3c9
...
@@ -245,6 +245,14 @@ CHdrFtrController.prototype.SelectAll = function()
...
@@ -245,6 +245,14 @@ CHdrFtrController.prototype.SelectAll = function()
{
{
this
.
HdrFtr
.
Select_All
();
this
.
HdrFtr
.
Select_All
();
};
};
CHdrFtrController
.
prototype
.
GetSelectedContent
=
function
(
SelectedContent
)
{
this
.
HdrFtr
.
Get_SelectedContent
(
SelectedContent
);
};
CHdrFtrController
.
prototype
.
UpdateCursorType
=
function
(
X
,
Y
,
PageAbs
,
MouseEvent
)
{
this
.
HdrFtr
.
Update_CursorType
(
X
,
Y
,
PageAbs
,
MouseEvent
);
};
CHdrFtrController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
CHdrFtrController
.
prototype
.
AddToParagraph
=
function
(
oItem
,
bRecalculate
)
{
{
...
...
word/Editor/LogicDocumentController.js
View file @
93a4d3c9
...
@@ -221,6 +221,14 @@ CLogicDocumentController.prototype.SelectAll = function()
...
@@ -221,6 +221,14 @@ CLogicDocumentController.prototype.SelectAll = function()
{
{
this
.
LogicDocument
.
controller_SelectAll
();
this
.
LogicDocument
.
controller_SelectAll
();
};
};
CLogicDocumentController
.
prototype
.
GetSelectedContent
=
function
(
SelectedContent
)
{
this
.
LogicDocument
.
controller_GetSelectedContent
(
SelectedContent
);
};
CLogicDocumentController
.
prototype
.
UpdateCursorType
=
function
(
X
,
Y
,
PageAbs
,
MouseEvent
)
{
this
.
LogicDocument
.
controller_UpdateCursorType
(
X
,
Y
,
PageAbs
,
MouseEvent
);
};
...
...
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