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
a2687c6e
Commit
a2687c6e
authored
May 16, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support containsBlanks and notContainsBlanks in conditional formatting
parent
917d126d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
12 deletions
+25
-12
cell/model/Workbook.js
cell/model/Workbook.js
+25
-12
No files found.
cell/model/Workbook.js
View file @
a2687c6e
...
@@ -3479,14 +3479,17 @@ Woorksheet.prototype.initPostOpen = function(handlers){
...
@@ -3479,14 +3479,17 @@ Woorksheet.prototype.initPostOpen = function(handlers){
this
.
handlers
=
handlers
;
this
.
handlers
=
handlers
;
this
.
_setHandlersTablePart
();
this
.
_setHandlersTablePart
();
};
};
Woorksheet
.
prototype
.
_getValuesForConditionalFormatting
=
function
(
sqref
)
{
Woorksheet
.
prototype
.
_getValuesForConditionalFormatting
=
function
(
sqref
,
withEmpty
)
{
var
res
=
[];
var
res
=
[];
var
aValues
=
[],
aCells
=
[];
var
range
=
this
.
getRange3
(
sqref
.
r1
,
sqref
.
c1
,
sqref
.
r2
,
sqref
.
c2
);
this
.
getRange3
(
sqref
.
r1
,
sqref
.
c1
,
sqref
.
r2
,
sqref
.
c2
).
_setPropertyNoEmpty
(
null
,
null
,
function
(
c
)
{
var
fAction
=
function
(
c
)
{
if
(
!
c
.
isEmptyTextString
())
{
res
.
push
({
c
:
c
,
v
:
c
.
getValueWithoutFormat
()});
res
.
push
({
c
:
c
,
v
:
c
.
getValueWithoutFormat
()});
};
if
(
withEmpty
)
{
range
.
_setProperty
(
null
,
null
,
fAction
);
}
else
{
range
.
_setPropertyNoEmpty
(
null
,
null
,
fAction
);
}
}
});
return
res
;
return
res
;
};
};
Woorksheet
.
prototype
.
_updateConditionalFormatting
=
function
(
range
)
{
Woorksheet
.
prototype
.
_updateConditionalFormatting
=
function
(
range
)
{
...
@@ -3507,8 +3510,8 @@ Woorksheet.prototype._updateConditionalFormatting = function(range) {
...
@@ -3507,8 +3510,8 @@ Woorksheet.prototype._updateConditionalFormatting = function(range) {
for
(
j
=
0
;
j
<
aRules
.
length
;
++
j
)
{
for
(
j
=
0
;
j
<
aRules
.
length
;
++
j
)
{
oRule
=
aRules
[
j
];
oRule
=
aRules
[
j
];
// ToDo aboveAverage, cellIs,
containsBlanks,
// ToDo aboveAverage, cellIs,
// ToDo dataBar, expression, iconSet,
notContainsBlanks,
// ToDo dataBar, expression, iconSet,
// ToDo timePeriod (page 2679)
// ToDo timePeriod (page 2679)
if
(
Asc
.
ECfType
.
colorScale
===
oRule
.
type
)
{
if
(
Asc
.
ECfType
.
colorScale
===
oRule
.
type
)
{
if
(
1
!==
oRule
.
aRuleElements
.
length
)
{
if
(
1
!==
oRule
.
aRuleElements
.
length
)
{
...
@@ -3520,7 +3523,7 @@ Woorksheet.prototype._updateConditionalFormatting = function(range) {
...
@@ -3520,7 +3523,7 @@ Woorksheet.prototype._updateConditionalFormatting = function(range) {
}
}
min
=
Number
.
MAX_VALUE
;
min
=
Number
.
MAX_VALUE
;
max
=
-
Number
.
MAX_VALUE
;
max
=
-
Number
.
MAX_VALUE
;
values
=
this
.
_getValuesForConditionalFormatting
(
sqref
);
values
=
this
.
_getValuesForConditionalFormatting
(
sqref
,
false
);
for
(
cell
=
0
;
cell
<
values
.
v
.
length
;
++
cell
)
{
for
(
cell
=
0
;
cell
<
values
.
v
.
length
;
++
cell
)
{
value
=
values
[
cell
];
value
=
values
[
cell
];
if
(
CellValueType
.
Number
===
value
.
c
.
getType
()
&&
!
isNaN
(
tmp
=
parseFloat
(
value
.
v
)))
{
if
(
CellValueType
.
Number
===
value
.
c
.
getType
()
&&
!
isNaN
(
tmp
=
parseFloat
(
value
.
v
)))
{
...
@@ -3551,7 +3554,7 @@ Woorksheet.prototype._updateConditionalFormatting = function(range) {
...
@@ -3551,7 +3554,7 @@ Woorksheet.prototype._updateConditionalFormatting = function(range) {
}
else
if
(
Asc
.
ECfType
.
top10
===
oRule
.
type
)
{
}
else
if
(
Asc
.
ECfType
.
top10
===
oRule
.
type
)
{
if
(
oRule
.
rank
>
0
&&
oRule
.
dxf
)
{
if
(
oRule
.
rank
>
0
&&
oRule
.
dxf
)
{
nc
=
0
;
nc
=
0
;
values
=
this
.
_getValuesForConditionalFormatting
(
sqref
);
values
=
this
.
_getValuesForConditionalFormatting
(
sqref
,
false
);
o
=
oRule
.
bottom
?
-
Number
.
MAX_VALUE
:
Number
.
MAX_VALUE
;
o
=
oRule
.
bottom
?
-
Number
.
MAX_VALUE
:
Number
.
MAX_VALUE
;
for
(
cell
=
0
;
cell
<
values
.
length
;
++
cell
)
{
for
(
cell
=
0
;
cell
<
values
.
length
;
++
cell
)
{
value
=
values
[
cell
];
value
=
values
[
cell
];
...
@@ -3579,7 +3582,7 @@ Woorksheet.prototype._updateConditionalFormatting = function(range) {
...
@@ -3579,7 +3582,7 @@ Woorksheet.prototype._updateConditionalFormatting = function(range) {
if
(
!
oRule
.
dxf
)
{
if
(
!
oRule
.
dxf
)
{
continue
;
continue
;
}
}
values
=
this
.
_getValuesForConditionalFormatting
(
sqref
);
values
=
this
.
_getValuesForConditionalFormatting
(
sqref
,
true
);
switch
(
oRule
.
type
)
{
switch
(
oRule
.
type
)
{
case
Asc
.
ECfType
.
duplicateValues
:
case
Asc
.
ECfType
.
duplicateValues
:
...
@@ -3630,6 +3633,16 @@ Woorksheet.prototype._updateConditionalFormatting = function(range) {
...
@@ -3630,6 +3633,16 @@ Woorksheet.prototype._updateConditionalFormatting = function(range) {
return
CellValueType
.
Error
!==
c
.
getType
();
return
CellValueType
.
Error
!==
c
.
getType
();
};
};
break
;
break
;
case
Asc
.
ECfType
.
containsBlanks
:
compareFunction
=
function
(
val
,
c
)
{
return
c
.
isEmptyTextString
();
};
break
;
case
Asc
.
ECfType
.
notContainsBlanks
:
compareFunction
=
function
(
val
,
c
)
{
return
!
c
.
isEmptyTextString
();
};
break
;
default
:
default
:
continue
;
continue
;
break
;
break
;
...
...
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