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
54f0ce89
Commit
54f0ce89
authored
Nov 22, 2016
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactoring
parent
1fd21b34
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
303 deletions
+37
-303
cell/model/DrawingObjects/DrawingDocument.js
cell/model/DrawingObjects/DrawingDocument.js
+0
-86
cell/native/DrawingDocument.js
cell/native/DrawingDocument.js
+0
-89
common/Drawings/WorkEvents.js
common/Drawings/WorkEvents.js
+37
-0
word/Drawing/DrawingDocument.js
word/Drawing/DrawingDocument.js
+0
-128
No files found.
cell/model/DrawingObjects/DrawingDocument.js
View file @
54f0ce89
...
@@ -1465,11 +1465,6 @@ function CDrawingDocument(drawingObjects)
...
@@ -1465,11 +1465,6 @@ function CDrawingDocument(drawingObjects)
this
.
TableStylesLastLook
=
null
;
this
.
TableStylesLastLook
=
null
;
this
.
LastParagraphMargins
=
null
;
this
.
LastParagraphMargins
=
null
;
// параметры для SelectShow
this
.
min_PageAddSelection
=
100000
;
this
.
max_PageAddSelection
=
-
1
;
this
.
IsShowSelectAttack
=
false
;
this
.
AutoShapesTrack
=
null
;
this
.
AutoShapesTrack
=
null
;
this
.
AutoShapesTrackLockPageNum
=
-
1
;
this
.
AutoShapesTrackLockPageNum
=
-
1
;
...
@@ -3208,87 +3203,6 @@ function CDrawingDocument(drawingObjects)
...
@@ -3208,87 +3203,6 @@ function CDrawingDocument(drawingObjects)
}
}
}
}
this
.
AddPageSelection2
=
function
(
pageIndex
,
x
,
y
,
width
,
height
)
{
//if (pageIndex < 0 || pageIndex >= Math.max(this.m_lPagesCount, this.m_lCountCalculatePages) || Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
// return;
if
(
Math
.
abs
(
width
)
<
0.001
||
Math
.
abs
(
height
)
<
0.001
)
return
;
if
(
undefined
===
this
.
m_arrPages
[
pageIndex
])
this
.
m_arrPages
[
pageIndex
]
=
new
CPage
();
if
(
this
.
min_PageAddSelection
>
pageIndex
)
this
.
min_PageAddSelection
=
pageIndex
;
if
(
this
.
max_PageAddSelection
<
pageIndex
)
this
.
max_PageAddSelection
=
pageIndex
;
if
(
this
.
m_bIsSelection
&&
(
this
.
m_oWordControl
.
m_oOverlay
.
HtmlElement
.
style
.
display
==
"
none
"
))
{
this
.
m_oWordControl
.
ShowOverlay
();
this
.
m_oWordControl
.
m_oOverlayApi
.
m_oContext
.
globalAlpha
=
0.2
;
}
var
r
=
new
AscCommon
.
_rect
();
r
.
x
=
x
;
r
.
y
=
y
;
r
.
w
=
width
;
r
.
h
=
height
;
this
.
m_arrPages
[
pageIndex
].
selectionArray
[
this
.
m_arrPages
[
pageIndex
].
selectionArray
.
length
]
=
r
;
if
(
this
.
m_oWordControl
.
MobileTouchManager
)
{
if
(
null
==
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect1
)
{
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect1
=
r
;
this
.
m_oWordControl
.
MobileTouchManager
.
PageSelect1
=
pageIndex
;
}
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect2
=
r
;
this
.
m_oWordControl
.
MobileTouchManager
.
PageSelect2
=
pageIndex
;
}
}
this
.
AddPageSelection2
=
function
(
pageIndex
,
x
,
y
,
width
,
height
)
{
//if (pageIndex < 0 || pageIndex >= Math.max(this.m_lPagesCount, this.m_lCountCalculatePages) || Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
// return;
if
(
Math
.
abs
(
width
)
<
0.001
||
Math
.
abs
(
height
)
<
0.001
)
return
;
if
(
undefined
===
this
.
m_arrPages
[
pageIndex
])
this
.
m_arrPages
[
pageIndex
]
=
new
CPage
();
if
(
this
.
min_PageAddSelection
>
pageIndex
)
this
.
min_PageAddSelection
=
pageIndex
;
if
(
this
.
max_PageAddSelection
<
pageIndex
)
this
.
max_PageAddSelection
=
pageIndex
;
if
(
this
.
m_bIsSelection
&&
(
this
.
m_oWordControl
.
m_oOverlay
.
HtmlElement
.
style
.
display
==
"
none
"
))
{
this
.
m_oWordControl
.
ShowOverlay
();
this
.
m_oWordControl
.
m_oOverlayApi
.
m_oContext
.
globalAlpha
=
0.2
;
}
var
r
=
new
AscCommon
.
_rect
();
r
.
x
=
x
;
r
.
y
=
y
;
r
.
w
=
width
;
r
.
h
=
height
;
this
.
m_arrPages
[
pageIndex
].
selectionArray
[
this
.
m_arrPages
[
pageIndex
].
selectionArray
.
length
]
=
r
;
if
(
this
.
m_oWordControl
.
MobileTouchManager
)
{
if
(
null
==
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect1
)
{
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect1
=
r
;
this
.
m_oWordControl
.
MobileTouchManager
.
PageSelect1
=
pageIndex
;
}
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect2
=
r
;
this
.
m_oWordControl
.
MobileTouchManager
.
PageSelect2
=
pageIndex
;
}
}
this
.
SelectShow
=
function
()
this
.
SelectShow
=
function
()
{
{
this
.
drawingObjects
.
OnUpdateOverlay
();
this
.
drawingObjects
.
OnUpdateOverlay
();
...
...
cell/native/DrawingDocument.js
View file @
54f0ce89
...
@@ -1632,11 +1632,6 @@ function CDrawingDocument(drawingObjects)
...
@@ -1632,11 +1632,6 @@ function CDrawingDocument(drawingObjects)
this
.
TableStylesLastLook
=
null
;
this
.
TableStylesLastLook
=
null
;
this
.
LastParagraphMargins
=
null
;
this
.
LastParagraphMargins
=
null
;
// параметры для SelectShow
this
.
min_PageAddSelection
=
100000
;
this
.
max_PageAddSelection
=
-
1
;
this
.
IsShowSelectAttack
=
false
;
this
.
AutoShapesTrack
=
null
;
this
.
AutoShapesTrack
=
null
;
this
.
AutoShapesTrackLockPageNum
=
-
1
;
this
.
AutoShapesTrackLockPageNum
=
-
1
;
...
@@ -3067,90 +3062,6 @@ function CDrawingDocument(drawingObjects)
...
@@ -3067,90 +3062,6 @@ function CDrawingDocument(drawingObjects)
this
.
Native
[
"
DD_AddPageSelection
"
](
pageIndex
,
x
,
y
,
w
,
h
);
this
.
Native
[
"
DD_AddPageSelection
"
](
pageIndex
,
x
,
y
,
w
,
h
);
}
}
this
.
AddPageSelection2
=
function
(
pageIndex
,
x
,
y
,
width
,
height
)
{
//TODO:
// //if (pageIndex < 0 || pageIndex >= Math.max(this.m_lPagesCount, this.m_lCountCalculatePages) || Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
// // return;
// if (Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
// return;
//
// if (undefined === this.m_arrPages[pageIndex])
// this.m_arrPages[pageIndex] = new CPage();
//
// if (this.min_PageAddSelection > pageIndex)
// this.min_PageAddSelection = pageIndex;
// if (this.max_PageAddSelection < pageIndex)
// this.max_PageAddSelection = pageIndex;
//
// if (this.m_bIsSelection && (this.m_oWordControl.m_oOverlay.HtmlElement.style.display == "none"))
// {
// this.m_oWordControl.ShowOverlay();
// this.m_oWordControl.m_oOverlayApi.m_oContext.globalAlpha = 0.2;
// }
//
// var r = new _rect();
// r.x = x;
// r.y = y;
// r.w = width;
// r.h = height;
// this.m_arrPages[pageIndex].selectionArray[this.m_arrPages[pageIndex].selectionArray.length] = r;
//
// if (this.m_oWordControl.MobileTouchManager)
// {
// if (null == this.m_oWordControl.MobileTouchManager.RectSelect1)
// {
// this.m_oWordControl.MobileTouchManager.RectSelect1 = r;
// this.m_oWordControl.MobileTouchManager.PageSelect1 = pageIndex;
// }
//
// this.m_oWordControl.MobileTouchManager.RectSelect2 = r;
// this.m_oWordControl.MobileTouchManager.PageSelect2 = pageIndex;
// }
}
this
.
AddPageSelection2
=
function
(
pageIndex
,
x
,
y
,
width
,
height
)
{
//TODO:
// //if (pageIndex < 0 || pageIndex >= Math.max(this.m_lPagesCount, this.m_lCountCalculatePages) || Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
// // return;
// if (Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
// return;
//
// if (undefined === this.m_arrPages[pageIndex])
// this.m_arrPages[pageIndex] = new CPage();
//
// if (this.min_PageAddSelection > pageIndex)
// this.min_PageAddSelection = pageIndex;
// if (this.max_PageAddSelection < pageIndex)
// this.max_PageAddSelection = pageIndex;
//
// if (this.m_bIsSelection && (this.m_oWordControl.m_oOverlay.HtmlElement.style.display == "none"))
// {
// this.m_oWordControl.ShowOverlay();
// this.m_oWordControl.m_oOverlayApi.m_oContext.globalAlpha = 0.2;
// }
//
// var r = new _rect();
// r.x = x;
// r.y = y;
// r.w = width;
// r.h = height;
// this.m_arrPages[pageIndex].selectionArray[this.m_arrPages[pageIndex].selectionArray.length] = r;
//
// if (this.m_oWordControl.MobileTouchManager)
// {
// if (null == this.m_oWordControl.MobileTouchManager.RectSelect1)
// {
// this.m_oWordControl.MobileTouchManager.RectSelect1 = r;
// this.m_oWordControl.MobileTouchManager.PageSelect1 = pageIndex;
// }
//
// this.m_oWordControl.MobileTouchManager.RectSelect2 = r;
// this.m_oWordControl.MobileTouchManager.PageSelect2 = pageIndex;
// }
}
this
.
SelectShow
=
function
()
this
.
SelectShow
=
function
()
{
{
this
.
drawingObjects
.
OnUpdateOverlay
();
this
.
drawingObjects
.
OnUpdateOverlay
();
...
...
common/Drawings/WorkEvents.js
View file @
54f0ce89
...
@@ -1961,6 +1961,8 @@
...
@@ -1961,6 +1961,8 @@
this
.
CheckSelectEnd
=
function
(
bIsAttack
)
this
.
CheckSelectEnd
=
function
(
bIsAttack
)
{
{
this
.
CheckSelectRects
();
var
_bIsRet
=
false
;
var
_bIsRet
=
false
;
if
(
!
bIsAttack
)
if
(
!
bIsAttack
)
_bIsRet
=
this
.
IsTrackingCurrent
;
_bIsRet
=
this
.
IsTrackingCurrent
;
...
@@ -2092,8 +2094,42 @@
...
@@ -2092,8 +2094,42 @@
}
}
}
}
this
.
CheckSelectRects
=
function
()
{
this
.
RectSelect1
=
null
;
this
.
RectSelect2
=
null
;
if
(
!
this
.
LogicDocument
)
return
;
var
_select
=
this
.
LogicDocument
.
Get_SelectionBounds
();
if
(
!
_select
)
return
;
var
_rect1
=
_select
.
Start
;
var
_rect2
=
_select
.
End
;
if
(
!
_rect1
||
!
_rect2
)
return
;
this
.
RectSelect1
=
new
AscCommon
.
_rect
();
this
.
RectSelect1
.
x
=
_rect1
.
X
;
this
.
RectSelect1
.
y
=
_rect1
.
Y
;
this
.
RectSelect1
.
w
=
_rect1
.
W
;
this
.
RectSelect1
.
h
=
_rect1
.
H
;
this
.
PageSelect1
=
_rect1
.
Page
;
this
.
RectSelect2
=
new
AscCommon
.
_rect
();
this
.
RectSelect2
.
x
=
_rect2
.
X
;
this
.
RectSelect2
.
y
=
_rect2
.
Y
;
this
.
RectSelect2
.
w
=
_rect2
.
W
;
this
.
RectSelect2
.
h
=
_rect2
.
H
;
this
.
PageSelect2
=
_rect2
.
Page
;
}
this
.
CheckSelect
=
function
(
overlay
)
this
.
CheckSelect
=
function
(
overlay
)
{
{
this
.
CheckSelectRects
();
if
(
null
==
this
.
RectSelect1
||
null
==
this
.
RectSelect2
)
if
(
null
==
this
.
RectSelect1
||
null
==
this
.
RectSelect2
)
return
;
return
;
...
@@ -2205,6 +2241,7 @@
...
@@ -2205,6 +2241,7 @@
this
.
CheckSelect2
=
function
(
overlay
)
this
.
CheckSelect2
=
function
(
overlay
)
{
{
this
.
CheckSelectRects
();
if
(
null
==
this
.
RectSelect1
||
null
==
this
.
RectSelect2
)
if
(
null
==
this
.
RectSelect1
||
null
==
this
.
RectSelect2
)
return
;
return
;
...
...
word/Drawing/DrawingDocument.js
View file @
54f0ce89
...
@@ -2096,11 +2096,6 @@ function CDrawingDocument()
...
@@ -2096,11 +2096,6 @@ function CDrawingDocument()
this
.
TableStylesSheckLook
=
null
;
this
.
TableStylesSheckLook
=
null
;
this
.
TableStylesSheckLookFlag
=
false
;
this
.
TableStylesSheckLookFlag
=
false
;
// параметры для SelectShow
this
.
min_PageAddSelection
=
100000
;
this
.
max_PageAddSelection
=
-
1
;
this
.
IsShowSelectAttack
=
false
;
this
.
InlineTextTrackEnabled
=
false
;
this
.
InlineTextTrackEnabled
=
false
;
this
.
InlineTextTrack
=
null
;
this
.
InlineTextTrack
=
null
;
this
.
InlineTextTrackPage
=
-
1
;
this
.
InlineTextTrackPage
=
-
1
;
...
@@ -4473,28 +4468,6 @@ function CDrawingDocument()
...
@@ -4473,28 +4468,6 @@ function CDrawingDocument()
this
.
IsTextMatrixUse
=
((
null
!=
this
.
TextMatrix
)
&&
!
global_MatrixTransformer
.
IsIdentity
(
this
.
TextMatrix
));
this
.
IsTextMatrixUse
=
((
null
!=
this
.
TextMatrix
)
&&
!
global_MatrixTransformer
.
IsIdentity
(
this
.
TextMatrix
));
if
(
pageIndex
<
this
.
m_lDrawingFirst
||
pageIndex
>
this
.
m_lDrawingEnd
)
{
if
(
this
.
m_oWordControl
.
MobileTouchManager
)
{
var
r
=
new
AscCommon
.
_rect
();
r
.
x
=
x
;
r
.
y
=
y
;
r
.
w
=
w
;
r
.
h
=
h
;
if
(
null
==
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect1
)
{
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect1
=
r
;
this
.
m_oWordControl
.
MobileTouchManager
.
PageSelect1
=
pageIndex
;
}
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect2
=
r
;
this
.
m_oWordControl
.
MobileTouchManager
.
PageSelect2
=
pageIndex
;
}
return
;
}
var
page
=
this
.
m_arrPages
[
pageIndex
];
var
page
=
this
.
m_arrPages
[
pageIndex
];
var
drawPage
=
page
.
drawingPage
;
var
drawPage
=
page
.
drawingPage
;
...
@@ -4568,67 +4541,6 @@ function CDrawingDocument()
...
@@ -4568,67 +4541,6 @@ function CDrawingDocument()
ctx
.
lineTo
(
x4
,
y4
);
ctx
.
lineTo
(
x4
,
y4
);
ctx
.
closePath
();
ctx
.
closePath
();
}
}
if
(
this
.
m_oWordControl
.
MobileTouchManager
)
{
var
r
=
new
AscCommon
.
_rect
();
r
.
x
=
x
;
r
.
y
=
y
;
r
.
w
=
w
;
r
.
h
=
h
;
if
(
null
==
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect1
)
{
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect1
=
r
;
this
.
m_oWordControl
.
MobileTouchManager
.
PageSelect1
=
pageIndex
;
}
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect2
=
r
;
this
.
m_oWordControl
.
MobileTouchManager
.
PageSelect2
=
pageIndex
;
}
}
this
.
AddPageSelection2
=
function
(
pageIndex
,
x
,
y
,
width
,
height
)
{
this
.
IsTextMatrixUse
=
((
null
!=
this
.
TextMatrix
)
&&
!
global_MatrixTransformer
.
IsIdentity
(
this
.
TextMatrix
));
//if (pageIndex < 0 || pageIndex >= Math.max(this.m_lPagesCount, this.m_lCountCalculatePages) || Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
// return;
if
(
Math
.
abs
(
width
)
<
0.001
||
Math
.
abs
(
height
)
<
0.001
)
return
;
if
(
undefined
===
this
.
m_arrPages
[
pageIndex
])
this
.
m_arrPages
[
pageIndex
]
=
new
CPage
();
if
(
this
.
min_PageAddSelection
>
pageIndex
)
this
.
min_PageAddSelection
=
pageIndex
;
if
(
this
.
max_PageAddSelection
<
pageIndex
)
this
.
max_PageAddSelection
=
pageIndex
;
if
(
this
.
m_bIsSelection
&&
(
this
.
m_oWordControl
.
m_oOverlay
.
HtmlElement
.
style
.
display
==
"
none
"
))
{
this
.
m_oWordControl
.
ShowOverlay
();
this
.
m_oWordControl
.
m_oOverlayApi
.
m_oContext
.
globalAlpha
=
0.2
;
}
var
r
=
new
AscCommon
.
_rect
();
r
.
x
=
x
;
r
.
y
=
y
;
r
.
w
=
width
;
r
.
h
=
height
;
this
.
m_arrPages
[
pageIndex
].
selectionArray
[
this
.
m_arrPages
[
pageIndex
].
selectionArray
.
length
]
=
r
;
if
(
this
.
m_oWordControl
.
MobileTouchManager
)
{
if
(
null
==
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect1
)
{
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect1
=
r
;
this
.
m_oWordControl
.
MobileTouchManager
.
PageSelect1
=
pageIndex
;
}
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect2
=
r
;
this
.
m_oWordControl
.
MobileTouchManager
.
PageSelect2
=
pageIndex
;
}
}
}
this
.
CheckSelectMobile
=
function
(
overlay
)
this
.
CheckSelectMobile
=
function
(
overlay
)
...
@@ -4747,46 +4659,6 @@ function CDrawingDocument()
...
@@ -4747,46 +4659,6 @@ function CDrawingDocument()
}
}
}
}
this
.
AddPageSelection2
=
function
(
pageIndex
,
x
,
y
,
width
,
height
)
{
//if (pageIndex < 0 || pageIndex >= Math.max(this.m_lPagesCount, this.m_lCountCalculatePages) || Math.abs(width) < 0.001 || Math.abs(height) < 0.001)
// return;
if
(
Math
.
abs
(
width
)
<
0.001
||
Math
.
abs
(
height
)
<
0.001
)
return
;
if
(
undefined
===
this
.
m_arrPages
[
pageIndex
])
this
.
m_arrPages
[
pageIndex
]
=
new
CPage
();
if
(
this
.
min_PageAddSelection
>
pageIndex
)
this
.
min_PageAddSelection
=
pageIndex
;
if
(
this
.
max_PageAddSelection
<
pageIndex
)
this
.
max_PageAddSelection
=
pageIndex
;
if
(
this
.
m_bIsSelection
&&
(
this
.
m_oWordControl
.
m_oOverlay
.
HtmlElement
.
style
.
display
==
"
none
"
))
{
this
.
m_oWordControl
.
ShowOverlay
();
this
.
m_oWordControl
.
m_oOverlayApi
.
m_oContext
.
globalAlpha
=
0.2
;
}
var
r
=
new
AscCommon
.
_rect
();
r
.
x
=
x
;
r
.
y
=
y
;
r
.
w
=
width
;
r
.
h
=
height
;
this
.
m_arrPages
[
pageIndex
].
selectionArray
[
this
.
m_arrPages
[
pageIndex
].
selectionArray
.
length
]
=
r
;
if
(
this
.
m_oWordControl
.
MobileTouchManager
)
{
if
(
null
==
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect1
)
{
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect1
=
r
;
this
.
m_oWordControl
.
MobileTouchManager
.
PageSelect1
=
pageIndex
;
}
this
.
m_oWordControl
.
MobileTouchManager
.
RectSelect2
=
r
;
this
.
m_oWordControl
.
MobileTouchManager
.
PageSelect2
=
pageIndex
;
}
}
this
.
SelectShow
=
function
()
this
.
SelectShow
=
function
()
{
{
this
.
m_oWordControl
.
OnUpdateOverlay
();
this
.
m_oWordControl
.
OnUpdateOverlay
();
...
...
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