Skip to content

Commit

Permalink
CDB: Fix show separator that was opening not needed separators
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoVgr committed May 10, 2024
1 parent 1748cb5 commit 6524995
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions hide/comp/cdb/Table.hx
Original file line number Diff line number Diff line change
Expand Up @@ -625,24 +625,23 @@ class Table extends Component {

public function showSeparator( line : Line ) {
if( separators == null ) return;
var sepIndexes = [];

// Find which separators needs to be open to show this line
var sepIndexes = [];
for( i in 0...sheet.separators.length ) {
var s = sheet.separators[i];
if( s.index > line.index ) {
if (s.level == null)
break;

for (idx in s.level...sepIndexes.length)
sepIndexes.remove(sepIndexes[idx]);

if( s.index > line.index )
break;
}

if( s.level == null )
sepIndexes = [];
sepIndexes[s.level != null ? s.level : 0] = i;

var pos = s.level != null ? s.level : 0;
sepIndexes[pos] = i;
sepIndexes = sepIndexes.slice(0, pos + 1);
}

// Open concerned separators
for( sepIdx in sepIndexes ) {
var sep = separators[sepIdx];
if( sep != null && sep.hidden ) {
Expand Down

0 comments on commit 6524995

Please sign in to comment.