Skip to content

Commit

Permalink
🐛 Update av Fix siyuan-note#9380
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Oct 9, 2023
1 parent 288eb24 commit 0ed6884
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/av/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,10 @@ func (table *Table) calcColSelect(col *TableColumn, colIndex int) {
uniqueValues := map[string]bool{}
for _, row := range table.Rows {
if nil != row.Cells[colIndex] && nil != row.Cells[colIndex].Value && nil != row.Cells[colIndex].Value.MSelect && 0 < len(row.Cells[colIndex].Value.MSelect) && nil != row.Cells[colIndex].Value.MSelect[0] && "" != row.Cells[colIndex].Value.MSelect[0].Content {
uniqueValues[row.Cells[colIndex].Value.MSelect[0].Content] = true
countUniqueValues++
if _, ok := uniqueValues[row.Cells[colIndex].Value.MSelect[0].Content]; !ok {
uniqueValues[row.Cells[colIndex].Value.MSelect[0].Content] = true
countUniqueValues++
}
}
}
col.Calc.Result = &Value{Number: NewFormattedValueNumber(float64(countUniqueValues), NumberFormatNone)}
Expand Down

0 comments on commit 0ed6884

Please sign in to comment.