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
0363b577
Commit
0363b577
authored
May 22, 2017
by
GoshaZotov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add bExcludeHiddenRows by Worksheet
parent
c619583e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
24 deletions
+38
-24
cell/model/Workbook.js
cell/model/Workbook.js
+26
-18
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+12
-6
No files found.
cell/model/Workbook.js
View file @
0363b577
...
...
@@ -2332,6 +2332,7 @@
this
.
aComments
=
[];
this
.
aCommentsCoords
=
[];
var
oThis
=
this
;
this
.
bExcludeHiddenRows
=
false
;
this
.
mergeManager
=
new
RangeDataManager
(
function
(
data
,
from
,
to
){
if
(
History
.
Is_On
()
&&
(
null
!=
from
||
null
!=
to
))
{
...
...
@@ -4679,6 +4680,9 @@ Woorksheet.prototype.isApplyFilterBySheet = function(){
}
};
Woorksheet
.
prototype
.
excludeHiddenRows
=
function
(
bExclude
)
{
this
.
bExcludeHiddenRows
=
bExclude
;
};
//-------------------------------------------------------------------------------------------------
/**
* @constructor
...
...
@@ -5449,6 +5453,9 @@ Woorksheet.prototype.isApplyFilterBySheet = function(){
{
var
oBBox
=
this
.
bbox
;
for
(
var
i
=
oBBox
.
r1
;
i
<=
oBBox
.
r2
;
i
++
){
if
(
this
.
worksheet
.
bExcludeHiddenRows
&&
this
.
worksheet
.
getRowHidden
(
i
))
{
continue
;
}
for
(
var
j
=
oBBox
.
c1
;
j
<=
oBBox
.
c2
;
j
++
){
var
oCurCell
=
this
.
worksheet
.
_getCell
(
i
,
j
);
action
(
oCurCell
,
i
,
j
,
oBBox
.
r1
,
oBBox
.
c1
);
...
...
@@ -5461,6 +5468,9 @@ Woorksheet.prototype.isApplyFilterBySheet = function(){
{
var
oBBox
=
this
.
bbox
,
minC
=
Math
.
min
(
this
.
worksheet
.
getColsCount
(),
oBBox
.
c2
),
minR
=
Math
.
min
(
this
.
worksheet
.
getRowsCount
(),
oBBox
.
r2
);
for
(
var
i
=
oBBox
.
r1
;
i
<=
minR
;
i
++
){
if
(
this
.
worksheet
.
bExcludeHiddenRows
&&
this
.
worksheet
.
getRowHidden
(
i
))
{
continue
;
}
for
(
var
j
=
oBBox
.
c1
;
j
<=
minC
;
j
++
){
var
oCurCell
=
this
.
worksheet
.
_getCellNoEmpty
(
i
,
j
);
var
oRes
=
action
(
oCurCell
,
i
,
j
,
oBBox
.
r1
,
oBBox
.
c1
);
...
...
@@ -5475,9 +5485,9 @@ Woorksheet.prototype.isApplyFilterBySheet = function(){
{
var
oBBox
=
this
.
bbox
,
minC
=
Math
.
min
(
this
.
worksheet
.
getColsCount
(),
oBBox
.
c2
),
minR
=
Math
.
min
(
this
.
worksheet
.
getRowsCount
(),
oBBox
.
r2
);
for
(
var
i
=
oBBox
.
r1
;
i
<=
minR
;
i
++
){
if
(
excludeHiddenRows
&&
this
.
worksheet
.
getRowHidden
(
i
))
{
continue
;
}
if
((
this
.
worksheet
.
bExcludeHiddenRows
||
excludeHiddenRows
)
&&
this
.
worksheet
.
getRowHidden
(
i
))
{
continue
;
}
for
(
var
j
=
oBBox
.
c1
;
j
<=
minC
;
j
++
){
var
oCurCell
=
this
.
worksheet
.
_getCellNoEmpty
(
i
,
j
);
if
(
null
!=
oCurCell
)
...
...
@@ -5509,7 +5519,7 @@ Woorksheet.prototype.isApplyFilterBySheet = function(){
}
}
};
Range
.
prototype
.
_foreachRowNoEmpty
=
function
(
actionRow
,
actionCell
,
excludeHiddenRows
){
Range
.
prototype
.
_foreachRowNoEmpty
=
function
(
actionRow
,
actionCell
){
var
oBBox
=
this
.
bbox
;
if
(
0
==
oBBox
.
r1
&&
gc_nMaxRow0
==
oBBox
.
r2
)
{
...
...
@@ -5517,8 +5527,7 @@ Woorksheet.prototype.isApplyFilterBySheet = function(){
for
(
var
i
in
aRows
)
{
var
row
=
aRows
[
i
];
if
(
excludeHiddenRows
&&
row
.
getHidden
())
{
if
(
this
.
worksheet
.
bExcludeHiddenRows
&&
row
.
getHidden
())
{
continue
;
}
if
(
null
!=
actionRow
)
...
...
@@ -5546,8 +5555,7 @@ Woorksheet.prototype.isApplyFilterBySheet = function(){
var
row
=
this
.
worksheet
.
_getRowNoEmpty
(
i
);
if
(
row
)
{
if
(
excludeHiddenRows
&&
row
.
getHidden
())
{
if
(
this
.
worksheet
.
bExcludeHiddenRows
&&
row
.
getHidden
())
{
continue
;
}
...
...
@@ -5757,17 +5765,17 @@ Woorksheet.prototype.isApplyFilterBySheet = function(){
// this._foreachCol(actionCol, null);
}
};
Range
.
prototype
.
_setPropertyNoEmpty
=
function
(
actionRow
,
actionCol
,
actionCell
,
excludeHiddenRows
){
Range
.
prototype
.
_setPropertyNoEmpty
=
function
(
actionRow
,
actionCol
,
actionCell
){
var
nRangeType
=
this
.
_getRangeType
();
if
(
c_oRangeType
.
Range
==
nRangeType
)
return
this
.
_foreachNoEmpty
(
actionCell
,
excludeHiddenRows
);
return
this
.
_foreachNoEmpty
(
actionCell
);
else
if
(
c_oRangeType
.
Row
==
nRangeType
)
return
this
.
_foreachRowNoEmpty
(
actionRow
,
actionCell
,
excludeHiddenRows
);
return
this
.
_foreachRowNoEmpty
(
actionRow
,
actionCell
);
else
if
(
c_oRangeType
.
Col
==
nRangeType
)
return
this
.
_foreachColNoEmpty
(
actionCol
,
actionCell
);
else
{
var
oRes
=
this
.
_foreachRowNoEmpty
(
actionRow
,
actionCell
,
excludeHiddenRows
);
var
oRes
=
this
.
_foreachRowNoEmpty
(
actionRow
,
actionCell
);
if
(
null
!=
oRes
)
return
oRes
;
if
(
null
!=
actionCol
)
...
...
@@ -7710,7 +7718,7 @@ Woorksheet.prototype.isApplyFilterBySheet = function(){
cell
.
cleanCache
();
});
};
Range
.
prototype
.
cleanFormat
=
function
(
excludeHiddenRows
){
Range
.
prototype
.
cleanFormat
=
function
(){
History
.
Create_NewPoint
();
History
.
StartTransaction
();
this
.
unmerge
();
...
...
@@ -7726,10 +7734,10 @@ Woorksheet.prototype.isApplyFilterBySheet = function(){
cell
.
setStyle
(
null
);
// if(cell.isEmpty())
// cell.Remove();
}
,
excludeHiddenRows
);
});
History
.
EndTransaction
();
};
Range
.
prototype
.
cleanText
=
function
(
excludeHiddenRows
){
Range
.
prototype
.
cleanText
=
function
(){
History
.
Create_NewPoint
();
History
.
StartTransaction
();
this
.
_setPropertyNoEmpty
(
null
,
null
,
...
...
@@ -7737,10 +7745,10 @@ Woorksheet.prototype.isApplyFilterBySheet = function(){
cell
.
setValue
(
""
);
// if(cell.isEmpty())
// cell.Remove();
}
,
excludeHiddenRows
);
});
History
.
EndTransaction
();
};
Range
.
prototype
.
cleanAll
=
function
(
excludeHiddenRows
){
Range
.
prototype
.
cleanAll
=
function
(){
History
.
Create_NewPoint
();
History
.
StartTransaction
();
this
.
unmerge
();
...
...
@@ -7759,7 +7767,7 @@ Woorksheet.prototype.isApplyFilterBySheet = function(){
// col.Remove();
},
function
(
cell
,
nRow0
,
nCol0
,
nRowStart
,
nColStart
){
oThis
.
worksheet
.
_removeCell
(
nRow0
,
nCol0
);
}
,
excludeHiddenRows
);
});
this
.
worksheet
.
workbook
.
dependencyFormulas
.
calcTree
();
History
.
EndTransaction
();
...
...
cell/view/WorksheetView.js
View file @
0363b577
...
...
@@ -8506,6 +8506,11 @@
var
isLargeRange
=
t
.
_isLargeRange
(
range
.
bbox
);
var
canChangeColWidth
=
c_oAscCanChangeColWidth
.
none
;
if
(
t
.
model
.
autoFilters
.
bIsExcludeHiddenRows
(
arn
,
activeCell
))
{
t
.
model
.
excludeHiddenRows
(
true
);
}
switch
(
prop
)
{
case
"
fn
"
:
range
.
setFontname
(
val
);
...
...
@@ -8627,22 +8632,19 @@
/* отключаем отрисовку на случай необходимости пересчета ячеек, заносим ячейку, при необходимости в список перерисовываемых */
t
.
model
.
workbook
.
dependencyFormulas
.
lockRecal
();
//нужно ли удалять скрытые строки
var
excludeHiddenRows
=
t
.
model
.
autoFilters
.
bIsExcludeHiddenRows
(
arn
,
activeCell
);
switch
(
val
)
{
case
c_oAscCleanOptions
.
All
:
range
.
cleanAll
(
excludeHiddenRows
);
range
.
cleanAll
();
t
.
model
.
removeSparklines
(
arn
);
// Удаляем комментарии
t
.
cellCommentator
.
deleteCommentsRange
(
arn
);
break
;
case
c_oAscCleanOptions
.
Text
:
case
c_oAscCleanOptions
.
Formula
:
range
.
cleanText
(
excludeHiddenRows
);
range
.
cleanText
();
break
;
case
c_oAscCleanOptions
.
Format
:
range
.
cleanFormat
(
excludeHiddenRows
);
range
.
cleanFormat
();
break
;
case
c_oAscCleanOptions
.
Comments
:
t
.
cellCommentator
.
deleteCommentsRange
(
arn
);
...
...
@@ -8658,6 +8660,8 @@
break
;
}
t
.
model
.
excludeHiddenRows
(
false
);
// Если нужно удалить автофильтры - удаляем
if
(
val
===
c_oAscCleanOptions
.
All
||
val
===
c_oAscCleanOptions
.
Text
)
{
t
.
model
.
autoFilters
.
isEmptyAutoFilters
(
arn
);
...
...
@@ -8737,6 +8741,8 @@
break
;
}
t
.
model
.
excludeHiddenRows
(
false
);
if
(
bIsUpdate
)
{
hasUpdates
=
true
;
oUpdateRanges
[
i
]
=
item
;
...
...
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