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
5ca6ec55
Commit
5ca6ec55
authored
Nov 24, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug 33509
add method asc_getLockedSparkline
parent
fc4784bb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
136 additions
and
122 deletions
+136
-122
cell/model/CellInfo.js
cell/model/CellInfo.js
+6
-1
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+130
-121
No files found.
cell/model/CellInfo.js
View file @
5ca6ec55
...
@@ -263,7 +263,8 @@
...
@@ -263,7 +263,8 @@
this
.
hyperlink
=
null
;
this
.
hyperlink
=
null
;
this
.
comments
=
[];
this
.
comments
=
[];
this
.
isLocked
=
false
;
this
.
isLocked
=
false
;
this
.
isLockedTable
=
null
;
this
.
isLockedTable
=
false
;
this
.
isLockedSparkline
=
false
;
this
.
styleName
=
null
;
this
.
styleName
=
null
;
this
.
numFormatType
=
null
;
this
.
numFormatType
=
null
;
this
.
angle
=
null
;
this
.
angle
=
null
;
...
@@ -317,6 +318,9 @@
...
@@ -317,6 +318,9 @@
asc_CCellInfo
.
prototype
.
asc_getLockedTable
=
function
()
{
asc_CCellInfo
.
prototype
.
asc_getLockedTable
=
function
()
{
return
this
.
isLockedTable
;
return
this
.
isLockedTable
;
};
};
asc_CCellInfo
.
prototype
.
asc_getLockedSparkline
=
function
()
{
return
this
.
isLockedSparkline
;
};
asc_CCellInfo
.
prototype
.
asc_getStyleName
=
function
()
{
asc_CCellInfo
.
prototype
.
asc_getStyleName
=
function
()
{
return
this
.
styleName
;
return
this
.
styleName
;
};
};
...
@@ -461,6 +465,7 @@
...
@@ -461,6 +465,7 @@
prot
[
"
asc_getComments
"
]
=
prot
.
asc_getComments
;
prot
[
"
asc_getComments
"
]
=
prot
.
asc_getComments
;
prot
[
"
asc_getLocked
"
]
=
prot
.
asc_getLocked
;
prot
[
"
asc_getLocked
"
]
=
prot
.
asc_getLocked
;
prot
[
"
asc_getLockedTable
"
]
=
prot
.
asc_getLockedTable
;
prot
[
"
asc_getLockedTable
"
]
=
prot
.
asc_getLockedTable
;
prot
[
"
asc_getLockedSparkline
"
]
=
prot
.
asc_getLockedSparkline
;
prot
[
"
asc_getStyleName
"
]
=
prot
.
asc_getStyleName
;
prot
[
"
asc_getStyleName
"
]
=
prot
.
asc_getStyleName
;
prot
[
"
asc_getNumFormatType
"
]
=
prot
.
asc_getNumFormatType
;
prot
[
"
asc_getNumFormatType
"
]
=
prot
.
asc_getNumFormatType
;
prot
[
"
asc_getAngle
"
]
=
prot
.
asc_getAngle
;
prot
[
"
asc_getAngle
"
]
=
prot
.
asc_getAngle
;
...
...
cell/view/WorksheetView.js
View file @
5ca6ec55
...
@@ -6904,149 +6904,158 @@
...
@@ -6904,149 +6904,158 @@
this
.
_getSelectionInfoCell
();
this
.
_getSelectionInfoCell
();
};
};
WorksheetView
.
prototype
.
_getSelectionInfoCell
=
function
()
{
WorksheetView
.
prototype
.
_getSelectionInfoCell
=
function
()
{
var
c_opt
=
this
.
settings
.
cells
;
var
c_opt
=
this
.
settings
.
cells
;
var
selectionRange
=
this
.
model
.
selectionRange
;
var
selectionRange
=
this
.
model
.
selectionRange
;
var
cell
=
selectionRange
.
activeCell
;
var
cell
=
selectionRange
.
activeCell
;
var
mc
=
this
.
model
.
getMergedByCell
(
cell
.
row
,
cell
.
col
);
var
mc
=
this
.
model
.
getMergedByCell
(
cell
.
row
,
cell
.
col
);
var
c1
=
mc
?
mc
.
c1
:
cell
.
col
;
var
c1
=
mc
?
mc
.
c1
:
cell
.
col
;
var
r1
=
mc
?
mc
.
r1
:
cell
.
row
;
var
r1
=
mc
?
mc
.
r1
:
cell
.
row
;
var
c
=
this
.
_getVisibleCell
(
c1
,
r1
);
var
c
=
this
.
_getVisibleCell
(
c1
,
r1
);
if
(
c
===
undefined
)
{
if
(
c
===
undefined
)
{
asc_debug
(
"
log
"
,
"
Unknown cell's info: col =
"
+
c1
+
"
, row =
"
+
r1
);
asc_debug
(
"
log
"
,
"
Unknown cell's info: col =
"
+
c1
+
"
, row =
"
+
r1
);
return
{};
return
{};
}
}
var
fc
=
c
.
getFontcolor
();
var
bg
=
c
.
getFill
();
var
fa
=
c
.
getFontAlign
();
var
cellType
=
c
.
getType
();
var
isNumberFormat
=
(
!
cellType
||
CellValueType
.
Number
===
cellType
);
var
cell_info
=
new
asc_CCellInfo
();
cell_info
.
name
=
this
.
_getColumnTitle
(
c1
)
+
this
.
_getRowTitle
(
r1
);
cell_info
.
formula
=
c
.
getFormula
();
cell_info
.
text
=
c
.
getValueForEdit
();
cell_info
.
halign
=
AscCommonExcel
.
horizontalAlignToString
(
c
.
getAlignHorizontal
());
cell_info
.
valign
=
AscCommonExcel
.
verticalAlignToString
(
c
.
getAlignVertical
());
var
tablePartsOptions
=
selectionRange
.
isSingleRange
()
?
this
.
model
.
autoFilters
.
searchRangeInTableParts
(
selectionRange
.
getLast
())
:
-
2
;
var
curTablePart
=
tablePartsOptions
>=
0
?
this
.
model
.
TableParts
[
tablePartsOptions
]
:
null
;
var
tableStyleInfo
=
curTablePart
&&
curTablePart
.
TableStyleInfo
?
curTablePart
.
TableStyleInfo
:
null
;
cell_info
.
autoFilterInfo
=
new
asc_CAutoFilterInfo
();
if
(
-
2
===
tablePartsOptions
)
{
cell_info
.
autoFilterInfo
.
isAutoFilter
=
null
;
cell_info
.
autoFilterInfo
.
isApplyAutoFilter
=
false
;
}
else
{
var
checkApplyFilterOrSort
=
this
.
model
.
autoFilters
.
checkApplyFilterOrSort
(
tablePartsOptions
);
cell_info
.
autoFilterInfo
.
isAutoFilter
=
checkApplyFilterOrSort
.
isAutoFilter
;
cell_info
.
autoFilterInfo
.
isApplyAutoFilter
=
checkApplyFilterOrSort
.
isFilterColumns
;
}
if
(
curTablePart
!==
null
)
{
cell_info
.
formatTableInfo
=
new
AscCommonExcel
.
asc_CFormatTableInfo
();
cell_info
.
formatTableInfo
.
tableName
=
curTablePart
.
DisplayName
;
if
(
tableStyleInfo
)
{
var
fc
=
c
.
getFontcolor
();
cell_info
.
formatTableInfo
.
tableStyleName
=
tableStyleInfo
.
Name
;
var
bg
=
c
.
getFill
();
var
fa
=
c
.
getFontAlign
();
var
cellType
=
c
.
getType
();
var
isNumberFormat
=
(
!
cellType
||
CellValueType
.
Number
===
cellType
);
cell_info
.
formatTableInfo
.
bandVer
=
tableStyleInfo
.
ShowColumnStripes
;
var
cell_info
=
new
asc_CCellInfo
()
;
cell_info
.
formatTableInfo
.
firstCol
=
tableStyleInfo
.
ShowFirstColumn
;
cell_info
.
name
=
this
.
_getColumnTitle
(
c1
)
+
this
.
_getRowTitle
(
r1
)
;
cell_info
.
formatTableInfo
.
lastCol
=
tableStyleInfo
.
ShowLastColumn
;
cell_info
.
formula
=
c
.
getFormula
()
;
cell_info
.
formatTableInfo
.
bandHor
=
tableStyleInfo
.
ShowRowStripes
;
cell_info
.
text
=
c
.
getValueForEdit
();
}
cell_info
.
formatTableInfo
.
lastRow
=
curTablePart
.
TotalsRowCount
!==
null
;
cell_info
.
formatTableInfo
.
firstRow
=
curTablePart
.
HeaderRowCount
===
null
;
cell_info
.
formatTableInfo
.
tableRange
=
curTablePart
.
Ref
.
getAbsName
();
cell_info
.
formatTableInfo
.
filterButton
=
curTablePart
.
isShowButton
();
this
.
af_setDisableProps
(
curTablePart
,
cell_info
.
formatTableInfo
);
cell_info
.
halign
=
AscCommonExcel
.
horizontalAlignToString
(
c
.
getAlignHorizontal
()
);
}
cell_info
.
valign
=
AscCommonExcel
.
verticalAlignToString
(
c
.
getAlignVertical
());
cell_info
.
styleName
=
c
.
getStyleName
();
var
tablePartsOptions
=
selectionRange
.
isSingleRange
()
?
cell_info
.
angle
=
c
.
getAngle
();
this
.
model
.
autoFilters
.
searchRangeInTableParts
(
selectionRange
.
getLast
())
:
-
2
;
var
curTablePart
=
tablePartsOptions
>=
0
?
this
.
model
.
TableParts
[
tablePartsOptions
]
:
null
;
var
tableStyleInfo
=
curTablePart
&&
curTablePart
.
TableStyleInfo
?
curTablePart
.
TableStyleInfo
:
null
;
cell_info
.
flags
=
new
AscCommonExcel
.
asc_CCellFlag
();
cell_info
.
autoFilterInfo
=
new
asc_CAutoFilterInfo
();
cell_info
.
flags
.
shrinkToFit
=
c
.
getShrinkToFit
();
if
(
-
2
===
tablePartsOptions
)
{
cell_info
.
flags
.
wrapText
=
c
.
getWrap
();
cell_info
.
autoFilterInfo
.
isAutoFilter
=
null
;
cell_info
.
autoFilterInfo
.
isApplyAutoFilter
=
false
;
// ToDo activeRange type
}
else
{
cell_info
.
flags
.
selectionType
=
selectionRange
.
getLast
().
type
;
var
checkApplyFilterOrSort
=
this
.
model
.
autoFilters
.
checkApplyFilterOrSort
(
tablePartsOptions
);
cell_info
.
flags
.
multiselect
=
!
selectionRange
.
isSingleRange
();
cell_info
.
autoFilterInfo
.
isAutoFilter
=
checkApplyFilterOrSort
.
isAutoFilter
;
cell_info
.
autoFilterInfo
.
isApplyAutoFilter
=
checkApplyFilterOrSort
.
isFilterColumns
;
}
cell_info
.
flags
.
lockText
=
(
""
!==
cell_info
.
text
&&
(
isNumberFormat
||
""
!==
cell_info
.
formula
));
if
(
curTablePart
!==
null
)
{
cell_info
.
formatTableInfo
=
new
AscCommonExcel
.
asc_CFormatTableInfo
();
cell_info
.
formatTableInfo
.
tableName
=
curTablePart
.
DisplayName
;
cell_info
.
font
=
new
asc_CFont
();
if
(
tableStyleInfo
)
{
cell_info
.
font
.
name
=
c
.
getFontname
();
cell_info
.
formatTableInfo
.
tableStyleName
=
tableStyleInfo
.
Name
;
cell_info
.
font
.
size
=
c
.
getFontsize
();
cell_info
.
font
.
bold
=
c
.
getBold
();
cell_info
.
font
.
italic
=
c
.
getItalic
();
cell_info
.
font
.
underline
=
(
Asc
.
EUnderline
.
underlineNone
!==
c
.
getUnderline
());
// ToDo убрать, когда будет реализовано двойное подчеркивание
cell_info
.
font
.
strikeout
=
c
.
getStrikeout
();
cell_info
.
font
.
subscript
=
fa
===
AscCommon
.
vertalign_SubScript
;
cell_info
.
font
.
superscript
=
fa
===
AscCommon
.
vertalign_SuperScript
;
cell_info
.
font
.
color
=
(
fc
?
asc_obj2Color
(
fc
)
:
new
Asc
.
asc_CColor
(
c_opt
.
defaultState
.
color
));
cell_info
.
fill
=
new
asc_CFill
((
null
!=
bg
)
?
asc_obj2Color
(
bg
)
:
bg
);
cell_info
.
formatTableInfo
.
bandVer
=
tableStyleInfo
.
ShowColumnStripes
;
cell_info
.
formatTableInfo
.
firstCol
=
tableStyleInfo
.
ShowFirstColumn
;
cell_info
.
formatTableInfo
.
lastCol
=
tableStyleInfo
.
ShowLastColumn
;
cell_info
.
numFormatType
=
c
.
getNumFormatType
();
cell_info
.
formatTableInfo
.
bandHor
=
tableStyleInfo
.
ShowRowStripes
;
}
cell_info
.
formatTableInfo
.
lastRow
=
curTablePart
.
TotalsRowCount
!==
null
;
cell_info
.
formatTableInfo
.
firstRow
=
curTablePart
.
HeaderRowCount
===
null
;
cell_info
.
formatTableInfo
.
tableRange
=
curTablePart
.
Ref
.
getAbsName
();
cell_info
.
formatTableInfo
.
filterButton
=
curTablePart
.
isShowButton
();
// Получаем гиперссылку (//ToDo)
this
.
af_setDisableProps
(
curTablePart
,
cell_info
.
formatTableInfo
);
var
ar
=
selectionRange
.
getLast
().
clone
();
}
var
range
=
this
.
model
.
getRange3
(
ar
.
r1
,
ar
.
c1
,
ar
.
r2
,
ar
.
c2
);
var
hyperlink
=
range
.
getHyperlink
();
var
oHyperlink
;
if
(
null
!==
hyperlink
)
{
// Гиперлинк
oHyperlink
=
new
asc_CHyperlink
(
hyperlink
);
oHyperlink
.
asc_setText
(
cell_info
.
text
);
cell_info
.
hyperlink
=
oHyperlink
;
}
else
{
cell_info
.
hyperlink
=
null
;
}
cell_info
.
comments
=
this
.
cellCommentator
.
getComments
(
ar
.
c1
,
ar
.
r1
);
cell_info
.
styleName
=
c
.
getStyleName
();
cell_info
.
flags
.
merge
=
null
!==
range
.
hasMerged
();
cell_info
.
angle
=
c
.
getAngle
();
cell_info
.
flags
=
new
AscCommonExcel
.
asc_CCellFlag
();
cell_info
.
flags
.
shrinkToFit
=
c
.
getShrinkToFit
();
cell_info
.
flags
.
wrapText
=
c
.
getWrap
();
// ToDo activeRange type
cell_info
.
flags
.
selectionType
=
selectionRange
.
getLast
().
type
;
cell_info
.
flags
.
multiselect
=
!
selectionRange
.
isSingleRange
();
cell_info
.
flags
.
lockText
=
(
""
!==
cell_info
.
text
&&
(
isNumberFormat
||
""
!==
cell_info
.
formula
));
cell_info
.
font
=
new
asc_CFont
();
cell_info
.
font
.
name
=
c
.
getFontname
();
cell_info
.
font
.
size
=
c
.
getFontsize
();
cell_info
.
font
.
bold
=
c
.
getBold
();
cell_info
.
font
.
italic
=
c
.
getItalic
();
cell_info
.
font
.
underline
=
(
Asc
.
EUnderline
.
underlineNone
!==
c
.
getUnderline
());
// ToDo убрать, когда будет реализовано двойное подчеркивание
cell_info
.
font
.
strikeout
=
c
.
getStrikeout
();
cell_info
.
font
.
subscript
=
fa
===
AscCommon
.
vertalign_SubScript
;
cell_info
.
font
.
superscript
=
fa
===
AscCommon
.
vertalign_SuperScript
;
cell_info
.
font
.
color
=
(
fc
?
asc_obj2Color
(
fc
)
:
new
Asc
.
asc_CColor
(
c_opt
.
defaultState
.
color
));
cell_info
.
fill
=
new
asc_CFill
((
null
!=
bg
)
?
asc_obj2Color
(
bg
)
:
bg
);
cell_info
.
numFormatType
=
c
.
getNumFormatType
();
// Получаем гиперссылку (//ToDo)
var
ar
=
selectionRange
.
getLast
().
clone
();
var
range
=
this
.
model
.
getRange3
(
ar
.
r1
,
ar
.
c1
,
ar
.
r2
,
ar
.
c2
);
var
hyperlink
=
range
.
getHyperlink
();
var
oHyperlink
;
if
(
null
!==
hyperlink
)
{
// Гиперлинк
oHyperlink
=
new
asc_CHyperlink
(
hyperlink
);
oHyperlink
.
asc_setText
(
cell_info
.
text
);
cell_info
.
hyperlink
=
oHyperlink
;
}
else
{
cell_info
.
hyperlink
=
null
;
}
var
sheetId
=
this
.
model
.
getId
();
cell_info
.
comments
=
this
.
cellCommentator
.
getComments
(
ar
.
c1
,
ar
.
r1
);
// Пересчет для входящих ячеек в добавленные строки/столбцы
cell_info
.
flags
.
merge
=
null
!==
range
.
hasMerged
();
var
isIntersection
=
this
.
_recalcRangeByInsertRowsAndColumns
(
sheetId
,
ar
);
if
(
false
===
isIntersection
)
{
var
sheetId
=
this
.
model
.
getId
();
var
lockInfo
=
this
.
collaborativeEditing
.
getLockInfo
(
c_oAscLockTypeElem
.
Range
,
/*subType*/
null
,
sheetId
,
var
lockInfo
;
new
AscCommonExcel
.
asc_CCollaborativeRange
(
ar
.
c1
,
ar
.
r1
,
ar
.
c2
,
ar
.
r2
));
// Пересчет для входящих ячеек в добавленные строки/столбцы
var
isIntersection
=
this
.
_recalcRangeByInsertRowsAndColumns
(
sheetId
,
ar
);
if
(
false
===
isIntersection
)
{
lockInfo
=
this
.
collaborativeEditing
.
getLockInfo
(
c_oAscLockTypeElem
.
Range
,
/*subType*/
null
,
sheetId
,
new
AscCommonExcel
.
asc_CCollaborativeRange
(
ar
.
c1
,
ar
.
r1
,
ar
.
c2
,
ar
.
r2
));
if
(
false
!==
this
.
collaborativeEditing
.
getLockIntersection
(
lockInfo
,
c_oAscLockTypes
.
kLockTypeOther
,
/*bCheckOnlyLockAll*/
false
))
{
// Уже ячейку кто-то редактирует
cell_info
.
isLocked
=
true
;
}
}
if
(
false
!==
this
.
collaborativeEditing
.
getLockIntersection
(
lockInfo
,
c_oAscLockTypes
.
kLockTypeOther
,
if
(
null
!==
curTablePart
)
{
/*bCheckOnlyLockAll*/
false
))
{
// Уже ячейку кто-то редактирует
cell_info
.
isLocked
=
true
;
}
}
if
(
null
!==
curTablePart
){
var
tableAr
=
curTablePart
.
Ref
.
clone
();
var
tableAr
=
curTablePart
.
Ref
.
clone
();
var
isTable
Intersection
=
this
.
_recalcRangeByInsertRowsAndColumns
(
sheetId
,
tableAr
);
is
Intersection
=
this
.
_recalcRangeByInsertRowsAndColumns
(
sheetId
,
tableAr
);
if
(
false
===
is
Table
Intersection
)
{
if
(
false
===
isIntersection
)
{
var
tableL
ockInfo
=
this
.
collaborativeEditing
.
getLockInfo
(
c_oAscLockTypeElem
.
Range
,
/*subType*/
null
,
sheetId
,
l
ockInfo
=
this
.
collaborativeEditing
.
getLockInfo
(
c_oAscLockTypeElem
.
Range
,
/*subType*/
null
,
sheetId
,
new
AscCommonExcel
.
asc_CCollaborativeRange
(
tableAr
.
c1
,
tableAr
.
r1
,
tableAr
.
c2
,
tableAr
.
r2
));
new
AscCommonExcel
.
asc_CCollaborativeRange
(
tableAr
.
c1
,
tableAr
.
r1
,
tableAr
.
c2
,
tableAr
.
r2
));
if
(
false
!==
this
.
collaborativeEditing
.
getLockIntersection
(
tableL
ockInfo
,
c_oAscLockTypes
.
kLockTypeOther
,
if
(
false
!==
this
.
collaborativeEditing
.
getLockIntersection
(
l
ockInfo
,
c_oAscLockTypes
.
kLockTypeOther
,
/*bCheckOnlyLockAll*/
false
))
{
/*bCheckOnlyLockAll*/
false
))
{
// Уже таблицу кто-то редактирует
// Уже таблицу кто-то редактирует
cell_info
.
isLockedTable
=
true
;
cell_info
.
isLockedTable
=
true
;
}
}
}
}
}
}
cell_info
.
sparklineInfo
=
this
.
model
.
getSparklineGroup
(
c1
,
r1
);
cell_info
.
sparklineInfo
=
this
.
model
.
getSparklineGroup
(
c1
,
r1
);
if
(
sparklineInfo
)
{
lockInfo
=
this
.
collaborativeEditing
.
getLockInfo
(
c_oAscLockTypeElem
.
Object
,
/*subType*/
null
,
sheetId
,
sparklineInfo
.
Get_Id
());
if
(
false
!==
this
.
collaborativeEditing
.
getLockIntersection
(
lockInfo
,
c_oAscLockTypes
.
kLockTypeOther
,
/*bCheckOnlyLockAll*/
false
))
{
cell_info
.
isLockedSparkline
=
true
;
}
}
return
cell_info
;
return
cell_info
;
};
};
WorksheetView
.
prototype
.
_getSelectionInfoObject
=
function
()
{
WorksheetView
.
prototype
.
_getSelectionInfoObject
=
function
()
{
var
objectInfo
=
new
asc_CCellInfo
();
var
objectInfo
=
new
asc_CCellInfo
();
...
...
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