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
236359aa
Commit
236359aa
authored
Apr 10, 2017
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 34678
parent
1932e924
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
239 additions
and
234 deletions
+239
-234
cell/view/WorkbookView.js
cell/view/WorkbookView.js
+12
-9
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+227
-225
No files found.
cell/view/WorkbookView.js
View file @
236359aa
...
@@ -1077,8 +1077,8 @@
...
@@ -1077,8 +1077,8 @@
if
(
undefined
!==
ct
.
userIdAllSheet
)
{
if
(
undefined
!==
ct
.
userIdAllSheet
)
{
arrMouseMoveObjects
.
push
(
new
asc_CMM
({
arrMouseMoveObjects
.
push
(
new
asc_CMM
({
type
:
c_oAscMouseMoveType
.
LockedObject
,
type
:
c_oAscMouseMoveType
.
LockedObject
,
x
:
ct
.
lockAllPosLeft
,
x
:
AscCommon
.
AscBrowser
.
convertToRetinaValue
(
ct
.
lockAllPosLeft
)
,
y
:
ct
.
lockAllPosTop
,
y
:
AscCommon
.
AscBrowser
.
convertToRetinaValue
(
ct
.
lockAllPosTop
)
,
userId
:
ct
.
userIdAllSheet
,
userId
:
ct
.
userIdAllSheet
,
lockedObjectType
:
Asc
.
c_oAscMouseMoveLockedObjectType
.
Sheet
lockedObjectType
:
Asc
.
c_oAscMouseMoveLockedObjectType
.
Sheet
}));
}));
...
@@ -1087,8 +1087,8 @@
...
@@ -1087,8 +1087,8 @@
if
(
undefined
!==
ct
.
userIdAllProps
)
{
if
(
undefined
!==
ct
.
userIdAllProps
)
{
arrMouseMoveObjects
.
push
(
new
asc_CMM
({
arrMouseMoveObjects
.
push
(
new
asc_CMM
({
type
:
c_oAscMouseMoveType
.
LockedObject
,
type
:
c_oAscMouseMoveType
.
LockedObject
,
x
:
ct
.
lockAllPosLeft
,
x
:
AscCommon
.
AscBrowser
.
convertToRetinaValue
(
ct
.
lockAllPosLeft
)
,
y
:
ct
.
lockAllPosTop
,
y
:
AscCommon
.
AscBrowser
.
convertToRetinaValue
(
ct
.
lockAllPosTop
)
,
userId
:
ct
.
userIdAllProps
,
userId
:
ct
.
userIdAllProps
,
lockedObjectType
:
Asc
.
c_oAscMouseMoveLockedObjectType
.
TableProperties
lockedObjectType
:
Asc
.
c_oAscMouseMoveLockedObjectType
.
TableProperties
}));
}));
...
@@ -1098,8 +1098,8 @@
...
@@ -1098,8 +1098,8 @@
if
(
undefined
!==
ct
.
userId
)
{
if
(
undefined
!==
ct
.
userId
)
{
arrMouseMoveObjects
.
push
(
new
asc_CMM
({
arrMouseMoveObjects
.
push
(
new
asc_CMM
({
type
:
c_oAscMouseMoveType
.
LockedObject
,
type
:
c_oAscMouseMoveType
.
LockedObject
,
x
:
ct
.
lockRangePosLeft
,
x
:
AscCommon
.
AscBrowser
.
convertToRetinaValue
(
ct
.
lockRangePosLeft
)
,
y
:
ct
.
lockRangePosTop
,
y
:
AscCommon
.
AscBrowser
.
convertToRetinaValue
(
ct
.
lockRangePosTop
)
,
userId
:
ct
.
userId
,
userId
:
ct
.
userId
,
lockedObjectType
:
Asc
.
c_oAscMouseMoveLockedObjectType
.
Range
lockedObjectType
:
Asc
.
c_oAscMouseMoveLockedObjectType
.
Range
}));
}));
...
@@ -1122,9 +1122,12 @@
...
@@ -1122,9 +1122,12 @@
}
else
{
}
else
{
ct
.
cursor
=
ct
.
cellCursor
.
cursor
;
ct
.
cursor
=
ct
.
cellCursor
.
cursor
;
}
}
arrMouseMoveObjects
.
push
(
new
asc_CMM
({
arrMouseMoveObjects
.
push
(
new
asc_CMM
({
type
:
c_oAscMouseMoveType
.
Hyperlink
,
x
:
x
,
y
:
y
,
hyperlink
:
ct
.
hyperlink
type
:
c_oAscMouseMoveType
.
Hyperlink
,
}));
x
:
AscCommon
.
AscBrowser
.
convertToRetinaValue
(
x
),
y
:
AscCommon
.
AscBrowser
.
convertToRetinaValue
(
y
),
hyperlink
:
ct
.
hyperlink
}));
}
}
/* Проверяем, может мы на никаком объекте (такая схема оказалась приемлимой
/* Проверяем, может мы на никаком объекте (такая схема оказалась приемлимой
...
...
cell/view/WorksheetView.js
View file @
236359aa
...
@@ -6034,13 +6034,14 @@
...
@@ -6034,13 +6034,14 @@
}
:
null
;
}
:
null
;
};
};
WorksheetView
.
prototype
.
getCursorTypeFromXY
=
function
(
x
,
y
,
isViewerMode
)
{
WorksheetView
.
prototype
.
getCursorTypeFromXY
=
function
(
x
,
y
,
isViewerMode
)
{
this
.
handlers
.
trigger
(
"
checkLastWork
"
);
this
.
handlers
.
trigger
(
"
checkLastWork
"
);
var
res
,
c
,
r
,
f
,
i
,
offsetX
,
offsetY
,
cellCursor
;
var
res
,
c
,
r
,
f
,
i
,
offsetX
,
offsetY
,
cellCursor
;
var
sheetId
=
this
.
model
.
getId
(),
userId
,
lockRangePosLeft
,
lockRangePosTop
,
lockInfo
,
oHyperlink
;
var
sheetId
=
this
.
model
.
getId
(),
userId
,
lockRangePosLeft
,
lockRangePosTop
,
lockInfo
,
oHyperlink
;
var
widthDiff
=
0
,
heightDiff
=
0
,
isLocked
=
false
,
target
=
c_oTargetType
.
Cells
,
row
=
-
1
,
col
=
-
1
,
isSelGraphicObject
,
isNotFirst
;
var
widthDiff
=
0
,
heightDiff
=
0
,
isLocked
=
false
,
target
=
c_oTargetType
.
Cells
,
row
=
-
1
,
col
=
-
1
,
isSelGraphicObject
,
isNotFirst
;
if
(
c_oAscSelectionDialogType
.
None
===
this
.
selectionDialogType
)
{
if
(
c_oAscSelectionDialogType
.
None
===
this
.
selectionDialogType
)
{
var
frozenCursor
=
this
.
_isFrozenAnchor
(
x
,
y
);
var
frozenCursor
=
this
.
_isFrozenAnchor
(
x
,
y
);
if
(
!
isViewerMode
&&
frozenCursor
.
result
)
{
if
(
!
isViewerMode
&&
frozenCursor
.
result
)
{
lockInfo
=
this
.
collaborativeEditing
.
getLockInfo
(
c_oAscLockTypeElem
.
Object
,
null
,
sheetId
,
lockInfo
=
this
.
collaborativeEditing
.
getLockInfo
(
c_oAscLockTypeElem
.
Object
,
null
,
sheetId
,
...
@@ -6119,241 +6120,242 @@
...
@@ -6119,241 +6120,242 @@
}
}
}
}
x
*=
asc_getcvt
(
0
/*px*/
,
1
/*pt*/
,
this
.
_getPPIX
());
x
*=
asc_getcvt
(
0
/*px*/
,
1
/*pt*/
,
this
.
_getPPIX
());
y
*=
asc_getcvt
(
0
/*px*/
,
1
/*pt*/
,
this
.
_getPPIY
());
y
*=
asc_getcvt
(
0
/*px*/
,
1
/*pt*/
,
this
.
_getPPIY
());
var
oResDefault
=
{
cursor
:
kCurDefault
,
target
:
c_oTargetType
.
None
,
col
:
-
1
,
row
:
-
1
};
var
oResDefault
=
{
cursor
:
kCurDefault
,
target
:
c_oTargetType
.
None
,
col
:
-
1
,
row
:
-
1
};
if
(
x
<
this
.
cellsLeft
&&
y
<
this
.
cellsTop
)
{
if
(
x
<
this
.
cellsLeft
&&
y
<
this
.
cellsTop
)
{
return
{
cursor
:
kCurCorner
,
target
:
c_oTargetType
.
Corner
,
col
:
-
1
,
row
:
-
1
};
return
{
cursor
:
kCurCorner
,
target
:
c_oTargetType
.
Corner
,
col
:
-
1
,
row
:
-
1
};
}
}
var
cFrozen
=
-
1
,
rFrozen
=
-
1
;
var
cFrozen
=
-
1
,
rFrozen
=
-
1
;
offsetX
=
this
.
cols
[
this
.
visibleRange
.
c1
].
left
-
this
.
cellsLeft
;
offsetX
=
this
.
cols
[
this
.
visibleRange
.
c1
].
left
-
this
.
cellsLeft
;
offsetY
=
this
.
rows
[
this
.
visibleRange
.
r1
].
top
-
this
.
cellsTop
;
offsetY
=
this
.
rows
[
this
.
visibleRange
.
r1
].
top
-
this
.
cellsTop
;
if
(
this
.
topLeftFrozenCell
)
{
if
(
this
.
topLeftFrozenCell
)
{
cFrozen
=
this
.
topLeftFrozenCell
.
getCol0
();
cFrozen
=
this
.
topLeftFrozenCell
.
getCol0
();
rFrozen
=
this
.
topLeftFrozenCell
.
getRow0
();
rFrozen
=
this
.
topLeftFrozenCell
.
getRow0
();
widthDiff
=
this
.
cols
[
cFrozen
].
left
-
this
.
cols
[
0
].
left
;
widthDiff
=
this
.
cols
[
cFrozen
].
left
-
this
.
cols
[
0
].
left
;
heightDiff
=
this
.
rows
[
rFrozen
].
top
-
this
.
rows
[
0
].
top
;
heightDiff
=
this
.
rows
[
rFrozen
].
top
-
this
.
rows
[
0
].
top
;
offsetX
=
(
x
<
this
.
cellsLeft
+
widthDiff
)
?
0
:
offsetX
-
widthDiff
;
offsetY
=
(
y
<
this
.
cellsTop
+
heightDiff
)
?
0
:
offsetY
-
heightDiff
;
}
var
epsChangeSize
=
3
*
AscCommon
.
global_mouseEvent
.
KoefPixToMM
;
if
(
x
<=
this
.
cellsLeft
&&
y
>=
this
.
cellsTop
)
{
r
=
this
.
_findRowUnderCursor
(
y
,
true
);
if
(
r
===
null
)
{
return
oResDefault
;
}
isNotFirst
=
(
r
.
row
!==
(
-
1
!==
rFrozen
?
0
:
this
.
visibleRange
.
r1
));
f
=
!
isViewerMode
&&
(
isNotFirst
&&
y
<
r
.
top
+
epsChangeSize
||
y
>=
r
.
bottom
-
epsChangeSize
);
// ToDo В Excel зависимость epsilon от размера ячейки (у нас фиксированный 3)
return
{
cursor
:
f
?
kCurRowResize
:
kCurRowSelect
,
target
:
f
?
c_oTargetType
.
RowResize
:
c_oTargetType
.
RowHeader
,
col
:
-
1
,
row
:
r
.
row
+
(
isNotFirst
&&
f
&&
y
<
r
.
top
+
3
?
-
1
:
0
),
mouseY
:
f
?
((
y
<
r
.
top
+
3
)
?
(
r
.
top
-
y
-
this
.
height_1px
)
:
(
r
.
bottom
-
y
-
this
.
height_1px
))
:
null
};
}
if
(
y
<=
this
.
cellsTop
&&
x
>=
this
.
cellsLeft
)
{
c
=
this
.
_findColUnderCursor
(
x
,
true
);
if
(
c
===
null
)
{
return
oResDefault
;
}
isNotFirst
=
c
.
col
!==
(
-
1
!==
cFrozen
?
0
:
this
.
visibleRange
.
c1
);
f
=
!
isViewerMode
&&
(
isNotFirst
&&
x
<
c
.
left
+
epsChangeSize
||
x
>=
c
.
right
-
epsChangeSize
);
// ToDo В Excel зависимость epsilon от размера ячейки (у нас фиксированный 3)
return
{
cursor
:
f
?
kCurColResize
:
kCurColSelect
,
target
:
f
?
c_oTargetType
.
ColumnResize
:
c_oTargetType
.
ColumnHeader
,
col
:
c
.
col
+
(
isNotFirst
&&
f
&&
x
<
c
.
left
+
3
?
-
1
:
0
),
row
:
-
1
,
mouseX
:
f
?
((
x
<
c
.
left
+
3
)
?
(
c
.
left
-
x
-
this
.
width_1px
)
:
(
c
.
right
-
x
-
this
.
width_1px
))
:
null
};
}
if
(
this
.
stateFormatPainter
)
{
offsetX
=
(
x
<
this
.
cellsLeft
+
widthDiff
)
?
0
:
offsetX
-
widthDiff
;
if
(
x
<=
this
.
cellsLeft
&&
y
>=
this
.
cellsTop
)
{
offsetY
=
(
y
<
this
.
cellsTop
+
heightDiff
)
?
0
:
offsetY
-
heightDiff
;
r
=
this
.
_findRowUnderCursor
(
y
,
true
);
}
if
(
r
!==
null
)
{
target
=
c_oTargetType
.
RowHeader
;
row
=
r
.
row
;
}
}
if
(
y
<=
this
.
cellsTop
&&
x
>=
this
.
cellsLeft
)
{
c
=
this
.
_findColUnderCursor
(
x
,
true
);
if
(
c
!==
null
)
{
target
=
c_oTargetType
.
ColumnHeader
;
col
=
c
.
col
;
}
}
return
{
cursor
:
kCurFormatPainterExcel
,
target
:
target
,
col
:
col
,
row
:
row
};
}
if
(
this
.
isFormulaEditMode
||
this
.
isChartAreaEditMode
)
{
var
epsChangeSize
=
3
*
AscCommon
.
global_mouseEvent
.
KoefPixToMM
;
this
.
_drawElements
(
function
(
_vr
,
_offsetX
,
_offsetY
)
{
if
(
x
<=
this
.
cellsLeft
&&
y
>=
this
.
cellsTop
)
{
return
(
null
===
(
res
=
this
.
_hitCursorFormulaOrChart
(
_vr
,
x
,
y
,
_offsetX
,
_offsetY
)));
r
=
this
.
_findRowUnderCursor
(
y
,
true
);
});
if
(
r
===
null
)
{
if
(
res
)
{
return
oResDefault
;
return
res
;
}
}
isNotFirst
=
(
r
.
row
!==
(
-
1
!==
rFrozen
?
0
:
this
.
visibleRange
.
r1
));
}
f
=
!
isViewerMode
&&
(
isNotFirst
&&
y
<
r
.
top
+
epsChangeSize
||
y
>=
r
.
bottom
-
epsChangeSize
);
// ToDo В Excel зависимость epsilon от размера ячейки (у нас фиксированный 3)
return
{
cursor
:
f
?
kCurRowResize
:
kCurRowSelect
,
target
:
f
?
c_oTargetType
.
RowResize
:
c_oTargetType
.
RowHeader
,
col
:
-
1
,
row
:
r
.
row
+
(
isNotFirst
&&
f
&&
y
<
r
.
top
+
3
?
-
1
:
0
),
mouseY
:
f
?
((
y
<
r
.
top
+
3
)
?
(
r
.
top
-
y
-
this
.
height_1px
)
:
(
r
.
bottom
-
y
-
this
.
height_1px
))
:
null
};
}
if
(
y
<=
this
.
cellsTop
&&
x
>=
this
.
cellsLeft
)
{
c
=
this
.
_findColUnderCursor
(
x
,
true
);
if
(
c
===
null
)
{
return
oResDefault
;
}
isNotFirst
=
c
.
col
!==
(
-
1
!==
cFrozen
?
0
:
this
.
visibleRange
.
c1
);
f
=
!
isViewerMode
&&
(
isNotFirst
&&
x
<
c
.
left
+
epsChangeSize
||
x
>=
c
.
right
-
epsChangeSize
);
// ToDo В Excel зависимость epsilon от размера ячейки (у нас фиксированный 3)
return
{
cursor
:
f
?
kCurColResize
:
kCurColSelect
,
target
:
f
?
c_oTargetType
.
ColumnResize
:
c_oTargetType
.
ColumnHeader
,
col
:
c
.
col
+
(
isNotFirst
&&
f
&&
x
<
c
.
left
+
3
?
-
1
:
0
),
row
:
-
1
,
mouseX
:
f
?
((
x
<
c
.
left
+
3
)
?
(
c
.
left
-
x
-
this
.
width_1px
)
:
(
c
.
right
-
x
-
this
.
width_1px
))
:
null
};
}
if
(
this
.
stateFormatPainter
)
{
if
(
x
<=
this
.
cellsLeft
&&
y
>=
this
.
cellsTop
)
{
r
=
this
.
_findRowUnderCursor
(
y
,
true
);
if
(
r
!==
null
)
{
target
=
c_oTargetType
.
RowHeader
;
row
=
r
.
row
;
}
}
if
(
y
<=
this
.
cellsTop
&&
x
>=
this
.
cellsLeft
)
{
c
=
this
.
_findColUnderCursor
(
x
,
true
);
if
(
c
!==
null
)
{
target
=
c_oTargetType
.
ColumnHeader
;
col
=
c
.
col
;
}
}
return
{
cursor
:
kCurFormatPainterExcel
,
target
:
target
,
col
:
col
,
row
:
row
};
}
if
(
this
.
isFormulaEditMode
||
this
.
isChartAreaEditMode
)
{
this
.
_drawElements
(
function
(
_vr
,
_offsetX
,
_offsetY
)
{
return
(
null
===
(
res
=
this
.
_hitCursorFormulaOrChart
(
_vr
,
x
,
y
,
_offsetX
,
_offsetY
)));
});
if
(
res
)
{
return
res
;
}
}
isSelGraphicObject
=
this
.
objectRender
.
selectedGraphicObjectsExists
();
isSelGraphicObject
=
this
.
objectRender
.
selectedGraphicObjectsExists
();
if
(
!
isViewerMode
&&
!
isSelGraphicObject
&&
this
.
model
.
selectionRange
.
isSingleRange
()
&&
if
(
!
isViewerMode
&&
!
isSelGraphicObject
&&
this
.
model
.
selectionRange
.
isSingleRange
()
&&
c_oAscSelectionDialogType
.
None
===
this
.
selectionDialogType
)
{
c_oAscSelectionDialogType
.
None
===
this
.
selectionDialogType
)
{
this
.
_drawElements
(
function
(
_vr
,
_offsetX
,
_offsetY
)
{
this
.
_drawElements
(
function
(
_vr
,
_offsetX
,
_offsetY
)
{
return
(
null
===
(
res
=
this
.
_hitCursorSelectionRange
(
_vr
,
x
,
y
,
_offsetX
,
_offsetY
)));
return
(
null
===
(
res
=
this
.
_hitCursorSelectionRange
(
_vr
,
x
,
y
,
_offsetX
,
_offsetY
)));
});
});
if
(
res
)
{
if
(
res
)
{
return
res
;
return
res
;
}
}
}
}
if
(
x
>
this
.
cellsLeft
&&
y
>
this
.
cellsTop
)
{
if
(
x
>
this
.
cellsLeft
&&
y
>
this
.
cellsTop
)
{
c
=
this
.
_findColUnderCursor
(
x
,
true
);
c
=
this
.
_findColUnderCursor
(
x
,
true
);
r
=
this
.
_findRowUnderCursor
(
y
,
true
);
r
=
this
.
_findRowUnderCursor
(
y
,
true
);
if
(
c
===
null
||
r
===
null
)
{
if
(
c
===
null
||
r
===
null
)
{
return
oResDefault
;
return
oResDefault
;
}
}
// Проверка на совместное редактирование
// Проверка на совместное редактирование
var
lockRange
=
undefined
;
var
lockRange
=
undefined
;
var
lockAllPosLeft
=
undefined
;
var
lockAllPosLeft
=
undefined
;
var
lockAllPosTop
=
undefined
;
var
lockAllPosTop
=
undefined
;
var
userIdAllProps
=
undefined
;
var
userIdAllProps
=
undefined
;
var
userIdAllSheet
=
undefined
;
var
userIdAllSheet
=
undefined
;
if
(
!
isViewerMode
&&
this
.
collaborativeEditing
.
getCollaborativeEditing
())
{
if
(
!
isViewerMode
&&
this
.
collaborativeEditing
.
getCollaborativeEditing
())
{
var
c1Recalc
=
null
,
r1Recalc
=
null
;
var
c1Recalc
=
null
,
r1Recalc
=
null
;
var
selectRangeRecalc
=
new
asc_Range
(
c
.
col
,
r
.
row
,
c
.
col
,
r
.
row
);
var
selectRangeRecalc
=
new
asc_Range
(
c
.
col
,
r
.
row
,
c
.
col
,
r
.
row
);
// Пересчет для входящих ячеек в добавленные строки/столбцы
// Пересчет для входящих ячеек в добавленные строки/столбцы
var
isIntersection
=
this
.
_recalcRangeByInsertRowsAndColumns
(
sheetId
,
selectRangeRecalc
);
var
isIntersection
=
this
.
_recalcRangeByInsertRowsAndColumns
(
sheetId
,
selectRangeRecalc
);
if
(
false
===
isIntersection
)
{
if
(
false
===
isIntersection
)
{
lockInfo
=
this
.
collaborativeEditing
.
getLockInfo
(
c_oAscLockTypeElem
.
Range
,
/*subType*/
null
,
sheetId
,
lockInfo
=
this
.
collaborativeEditing
.
getLockInfo
(
c_oAscLockTypeElem
.
Range
,
/*subType*/
null
,
sheetId
,
new
AscCommonExcel
.
asc_CCollaborativeRange
(
selectRangeRecalc
.
c1
,
selectRangeRecalc
.
r1
,
selectRangeRecalc
.
c2
,
selectRangeRecalc
.
r2
));
new
AscCommonExcel
.
asc_CCollaborativeRange
(
selectRangeRecalc
.
c1
,
selectRangeRecalc
.
r1
,
isLocked
=
this
.
collaborativeEditing
.
getLockIntersection
(
lockInfo
,
c_oAscLockTypes
.
kLockTypeOther
,
selectRangeRecalc
.
c2
,
selectRangeRecalc
.
r2
));
/*bCheckOnlyLockAll*/
false
);
isLocked
=
this
.
collaborativeEditing
.
getLockIntersection
(
lockInfo
,
c_oAscLockTypes
.
kLockTypeOther
,
if
(
false
!==
isLocked
)
{
/*bCheckOnlyLockAll*/
false
);
// Кто-то сделал lock
if
(
false
!==
isLocked
)
{
userId
=
isLocked
.
UserId
;
// Кто-то сделал lock
lockRange
=
isLocked
.
Element
[
"
rangeOrObjectId
"
];
userId
=
isLocked
.
UserId
;
lockRange
=
isLocked
.
Element
[
"
rangeOrObjectId
"
];
c1Recalc
=
this
.
collaborativeEditing
.
m_oRecalcIndexColumns
[
sheetId
].
getLockOther
(
lockRange
[
"
c1
"
],
c1Recalc
=
c_oAscLockTypes
.
kLockTypeOther
);
this
.
collaborativeEditing
.
m_oRecalcIndexColumns
[
sheetId
].
getLockOther
(
lockRange
[
"
c1
"
],
r1Recalc
=
this
.
collaborativeEditing
.
m_oRecalcIndexRows
[
sheetId
].
getLockOther
(
lockRange
[
"
r1
"
],
c_oAscLockTypes
.
kLockTypeOther
);
c_oAscLockTypes
.
kLockTypeOther
);
r1Recalc
=
this
.
collaborativeEditing
.
m_oRecalcIndexRows
[
sheetId
].
getLockOther
(
lockRange
[
"
r1
"
],
if
(
null
!==
c1Recalc
&&
null
!==
r1Recalc
)
{
c_oAscLockTypes
.
kLockTypeOther
);
lockRangePosLeft
=
this
.
getCellLeft
(
c1Recalc
,
/*pt*/
1
);
if
(
null
!==
c1Recalc
&&
null
!==
r1Recalc
)
{
lockRangePosTop
=
this
.
getCellTop
(
r1Recalc
,
/*pt*/
1
);
lockRangePosLeft
=
this
.
getCellLeft
(
c1Recalc
,
/*pt*/
1
);
// Пересчитываем X и Y относительно видимой области
lockRangePosTop
=
this
.
getCellTop
(
r1Recalc
,
/*pt*/
1
);
lockRangePosLeft
-=
offsetX
;
// Пересчитываем X и Y относительно видимой области
lockRangePosLeft
-=
offsetX
;
lockRangePosTop
-=
offsetY
;
lockRangePosTop
-=
offsetY
;
lockRangePosLeft
=
this
.
cellsLeft
>
lockRangePosLeft
?
this
.
cellsLeft
:
lockRangePosLeft
;
lockRangePosLeft
=
this
.
cellsLeft
>
lockRangePosLeft
?
this
.
cellsLeft
:
lockRangePosLeft
;
lockRangePosTop
=
this
.
cellsTop
>
lockRangePosTop
?
this
.
cellsTop
:
lockRangePosTop
;
lockRangePosTop
=
this
.
cellsTop
>
lockRangePosTop
?
this
.
cellsTop
:
lockRangePosTop
;
// Пересчитываем в px
// Пересчитываем в px
lockRangePosLeft
*=
asc_getcvt
(
1
/*pt*/
,
0
/*px*/
,
this
.
_getPPIX
());
lockRangePosLeft
*=
asc_getcvt
(
1
/*pt*/
,
0
/*px*/
,
this
.
_getPPIX
());
lockRangePosTop
*=
asc_getcvt
(
1
/*pt*/
,
0
/*px*/
,
this
.
_getPPIY
());
lockRangePosTop
*=
asc_getcvt
(
1
/*pt*/
,
0
/*px*/
,
this
.
_getPPIY
());
}
}
}
}
}
else
{
}
else
{
lockInfo
=
lockInfo
=
this
.
collaborativeEditing
.
getLockInfo
(
c_oAscLockTypeElem
.
Range
,
/*subType*/
null
,
sheetId
,
null
);
this
.
collaborativeEditing
.
getLockInfo
(
c_oAscLockTypeElem
.
Range
,
/*subType*/
null
,
sheetId
,
null
);
}
}
// Проверим не удален ли весь лист (именно удален, т.к. если просто залочен, то не рисуем рамку вокруг)
// Проверим не удален ли весь лист (именно удален, т.к. если просто залочен, то не рисуем рамку вокруг)
lockInfo
[
"
type
"
]
=
c_oAscLockTypeElem
.
Sheet
;
lockInfo
[
"
type
"
]
=
c_oAscLockTypeElem
.
Sheet
;
isLocked
=
this
.
collaborativeEditing
.
getLockIntersection
(
lockInfo
,
c_oAscLockTypes
.
kLockTypeOther
,
isLocked
=
this
.
collaborativeEditing
.
getLockIntersection
(
lockInfo
,
c_oAscLockTypes
.
kLockTypeOther
,
/*bCheckOnlyLockAll*/
true
);
/*bCheckOnlyLockAll*/
true
);
if
(
false
!==
isLocked
)
{
if
(
false
!==
isLocked
)
{
// Кто-то сделал lock
// Кто-то сделал lock
userIdAllSheet
=
isLocked
.
UserId
;
userIdAllSheet
=
isLocked
.
UserId
;
lockAllPosLeft
=
this
.
cellsLeft
*
asc_getcvt
(
1
/*pt*/
,
0
/*px*/
,
this
.
_getPPIX
());
lockAllPosLeft
=
this
.
cellsLeft
*
asc_getcvt
(
1
/*pt*/
,
0
/*px*/
,
this
.
_getPPIX
());
lockAllPosTop
=
this
.
cellsTop
*
asc_getcvt
(
1
/*pt*/
,
0
/*px*/
,
this
.
_getPPIY
());
lockAllPosTop
=
this
.
cellsTop
*
asc_getcvt
(
1
/*pt*/
,
0
/*px*/
,
this
.
_getPPIY
());
}
}
// Проверим не залочены ли все свойства листа (только если не удален весь лист)
if
(
undefined
===
userIdAllSheet
)
{
lockInfo
[
"
type
"
]
=
c_oAscLockTypeElem
.
Range
;
lockInfo
[
"
subType
"
]
=
c_oAscLockTypeElemSubType
.
InsertRows
;
isLocked
=
this
.
collaborativeEditing
.
getLockIntersection
(
lockInfo
,
c_oAscLockTypes
.
kLockTypeOther
,
/*bCheckOnlyLockAll*/
true
);
if
(
false
!==
isLocked
)
{
// Кто-то сделал lock
userIdAllProps
=
isLocked
.
UserId
;
lockAllPosLeft
=
this
.
cellsLeft
*
asc_getcvt
(
1
/*pt*/
,
0
/*px*/
,
this
.
_getPPIX
());
lockAllPosTop
=
this
.
cellsTop
*
asc_getcvt
(
1
/*pt*/
,
0
/*px*/
,
this
.
_getPPIY
());
}
}
}
var
autoFilterInfo
=
this
.
af_checkCursor
(
x
,
y
,
offsetX
,
offsetY
,
{
// Проверим не залочены ли все свойства листа (только если не удален весь лист)
cFrozen
:
cFrozen
,
rFrozen
:
rFrozen
if
(
undefined
===
userIdAllSheet
)
{
},
r
,
c
);
lockInfo
[
"
type
"
]
=
c_oAscLockTypeElem
.
Range
;
if
(
autoFilterInfo
&&
!
isViewerMode
)
{
lockInfo
[
"
subType
"
]
=
c_oAscLockTypeElemSubType
.
InsertRows
;
return
{
isLocked
=
this
.
collaborativeEditing
.
getLockIntersection
(
lockInfo
,
c_oAscLockTypes
.
kLockTypeOther
,
cursor
:
kCurAutoFilter
,
/*bCheckOnlyLockAll*/
true
);
target
:
c_oTargetType
.
FilterObject
,
if
(
false
!==
isLocked
)
{
col
:
-
1
,
// Кто-то сделал lock
row
:
-
1
,
userIdAllProps
=
isLocked
.
UserId
;
idFilter
:
autoFilterInfo
.
id
};
lockAllPosLeft
=
this
.
cellsLeft
*
asc_getcvt
(
1
/*pt*/
,
0
/*px*/
,
this
.
_getPPIX
());
}
lockAllPosTop
=
this
.
cellsTop
*
asc_getcvt
(
1
/*pt*/
,
0
/*px*/
,
this
.
_getPPIY
());
}
}
}
// Проверим есть ли комменты
var
autoFilterInfo
=
this
.
af_checkCursor
(
x
,
y
,
offsetX
,
offsetY
,
{
var
comments
=
this
.
cellCommentator
.
getComments
(
c
.
col
,
r
.
row
);
cFrozen
:
cFrozen
,
rFrozen
:
rFrozen
var
coords
=
undefined
;
},
r
,
c
);
var
indexes
=
undefined
;
if
(
autoFilterInfo
&&
!
isViewerMode
)
{
return
{
if
(
0
<
comments
.
length
)
{
cursor
:
kCurAutoFilter
,
indexes
=
[];
target
:
c_oTargetType
.
FilterObject
,
for
(
i
=
0
;
i
<
comments
.
length
;
++
i
)
{
col
:
-
1
,
indexes
.
push
(
comments
[
i
].
asc_getId
());
row
:
-
1
,
}
idFilter
:
autoFilterInfo
.
id
coords
=
this
.
cellCommentator
.
getCommentsCoords
(
comments
);
};
}
}
// Проверим, может мы в гиперлинке
oHyperlink
=
this
.
model
.
getHyperlinkByCell
(
r
.
row
,
c
.
col
);
cellCursor
=
{
cursor
:
kCurCells
,
target
:
c_oTargetType
.
Cells
,
col
:
(
c
?
c
.
col
:
-
1
),
row
:
(
r
?
r
.
row
:
-
1
),
userId
:
userId
,
lockRangePosLeft
:
lockRangePosLeft
,
lockRangePosTop
:
lockRangePosTop
,
userIdAllProps
:
userIdAllProps
,
lockAllPosLeft
:
lockAllPosLeft
,
lockAllPosTop
:
lockAllPosTop
,
userIdAllSheet
:
userIdAllSheet
,
commentIndexes
:
indexes
,
commentCoords
:
coords
};
if
(
null
!==
oHyperlink
)
{
return
{
cursor
:
kCurHyperlink
,
target
:
c_oTargetType
.
Hyperlink
,
hyperlink
:
new
asc_CHyperlink
(
oHyperlink
),
cellCursor
:
cellCursor
,
userId
:
userId
,
lockRangePosLeft
:
lockRangePosLeft
,
lockRangePosTop
:
lockRangePosTop
,
userIdAllProps
:
userIdAllProps
,
userIdAllSheet
:
userIdAllSheet
,
lockAllPosLeft
:
lockAllPosLeft
,
lockAllPosTop
:
lockAllPosTop
,
commentIndexes
:
indexes
,
commentCoords
:
coords
};
}
return
cellCursor
;
}
return
oResDefault
;
// Проверим есть ли комменты
};
var
comments
=
this
.
cellCommentator
.
getComments
(
c
.
col
,
r
.
row
);
var
coords
=
undefined
;
var
indexes
=
undefined
;
if
(
0
<
comments
.
length
)
{
indexes
=
[];
for
(
i
=
0
;
i
<
comments
.
length
;
++
i
)
{
indexes
.
push
(
comments
[
i
].
asc_getId
());
}
coords
=
this
.
cellCommentator
.
getCommentsCoords
(
comments
);
}
// Проверим, может мы в гиперлинке
oHyperlink
=
this
.
model
.
getHyperlinkByCell
(
r
.
row
,
c
.
col
);
cellCursor
=
{
cursor
:
kCurCells
,
target
:
c_oTargetType
.
Cells
,
col
:
(
c
?
c
.
col
:
-
1
),
row
:
(
r
?
r
.
row
:
-
1
),
userId
:
userId
,
lockRangePosLeft
:
lockRangePosLeft
,
lockRangePosTop
:
lockRangePosTop
,
userIdAllProps
:
userIdAllProps
,
lockAllPosLeft
:
lockAllPosLeft
,
lockAllPosTop
:
lockAllPosTop
,
userIdAllSheet
:
userIdAllSheet
,
commentIndexes
:
indexes
,
commentCoords
:
coords
};
if
(
null
!==
oHyperlink
)
{
return
{
cursor
:
kCurHyperlink
,
target
:
c_oTargetType
.
Hyperlink
,
hyperlink
:
new
asc_CHyperlink
(
oHyperlink
),
cellCursor
:
cellCursor
,
userId
:
userId
,
lockRangePosLeft
:
lockRangePosLeft
,
lockRangePosTop
:
lockRangePosTop
,
userIdAllProps
:
userIdAllProps
,
userIdAllSheet
:
userIdAllSheet
,
lockAllPosLeft
:
lockAllPosLeft
,
lockAllPosTop
:
lockAllPosTop
,
commentIndexes
:
indexes
,
commentCoords
:
coords
};
}
return
cellCursor
;
}
return
oResDefault
;
};
WorksheetView
.
prototype
.
_fixSelectionOfMergedCells
=
function
(
fixedRange
)
{
WorksheetView
.
prototype
.
_fixSelectionOfMergedCells
=
function
(
fixedRange
)
{
var
tmpSelection
=
this
.
_getSelection
();
var
tmpSelection
=
this
.
_getSelection
();
...
...
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