ooxml

Check-in [4ef4f97de4]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:formatcell.test borders
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tcltest
Files: files | file ages | folders
SHA3-256: 4ef4f97de45473ef90d9d366bc5440aa45b841ef4adc6907281eee4f7e568ec7
User & Date: alex 2019-11-28 08:16:10
Context
2019-11-28
09:03
formatcell.test rowheight and merge; patch preset styles after idx change check-in: d330abd2a3 user: alex tags: tcltest
08:16
formatcell.test borders check-in: 4ef4f97de4 user: alex tags: tcltest
2019-11-27
16:57
formatcell.test column check-in: 268a41f89d user: alex tags: tcltest
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ooxml.tcl.

1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
	    }
	    if {$color ne {}} {
	      dict set d [$node1 nodeName] color $color
	    }
	  }
	}
	if {[$node hasAttribute diagonalUp]} {
	  dict set d diagonal direction up
	} elseif {[$node hasAttribute diagonalDown]} {
	  dict set d diagonal direction down
	}
	set wb(s,borders,$idx) $d
      }
      lappend wb(s,@) borders [incr idx]


      set idx -1







|

|







1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
	    }
	    if {$color ne {}} {
	      dict set d [$node1 nodeName] color $color
	    }
	  }
	}
	if {[$node hasAttribute diagonalUp]} {
	  dict set d diagonal direction diagonalUp
	} elseif {[$node hasAttribute diagonalDown]} {
	  dict set d diagonal direction diagonalDown
	}
	set wb(s,borders,$idx) $d
      }
      lappend wb(s,@) borders [incr idx]


      set idx -1

Changes to tests/benchmark.test.

34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
..
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
    incr row
  }
  $spreadsheet write "$rows-$cols.xlsx"
  $spreadsheet destroy
}


if 0 {
test Benchmark-1.1 {benchmark cell generating} {
  set rc 1

  set list {msec per cell}
  set first -1
  foreach {rows cols} { 500 10 1000 10 3000 10 5000 10 } {
    set msec [lindex [time {doit $rows $cols}] 0]
................................................................................
      puts $list
      set rc 0
    }
  }

  return $rc
} 1
}


file delete -force 500-10.xlsx 1000-10.xlsx 3000-10.xlsx 5000-10.xlsx


# cleanup
::tcltest::cleanupTests
return








<







 







<









34
35
36
37
38
39
40

41
42
43
44
45
46
47
..
54
55
56
57
58
59
60

61
62
63
64
65
66
67
68
69
    incr row
  }
  $spreadsheet write "$rows-$cols.xlsx"
  $spreadsheet destroy
}



test Benchmark-1.1 {benchmark cell generating} {
  set rc 1

  set list {msec per cell}
  set first -1
  foreach {rows cols} { 500 10 1000 10 3000 10 5000 10 } {
    set msec [lindex [time {doit $rows $cols}] 0]
................................................................................
      puts $list
      set rc 0
    }
  }

  return $rc
} 1



file delete -force 500-10.xlsx 1000-10.xlsx 3000-10.xlsx 5000-10.xlsx


# cleanup
::tcltest::cleanupTests
return

Changes to tests/formatcell.test.

859
860
861
862
863
864
865
866
867
868
869



870
871
872
873
874
875
876


877
878
879
880
881
882
883
test FormatCellReadWorkbook-9.1 {Read Workbook} {
  array set workbook [ooxml::xl_read formatcell.xlsx]
  return [llength $workbook(sheets)]
} 1

test FormatCellCheckBorders-9.2 {Check Borders} {
  set rc 1
  return $rc
  for {set i 0} {$i < $w_obj(borders)} {incr i} {
    array set w $w_borders($i)
    array set r $workbook(s,borders,$i)



    foreach {n v} [array get w] {
      if {![info exists r($n)] || $r($n) ne $v} {
	puts stderr "borders $n '$v' exists [info exists r($n)]"
        set rc 0
      }
    }
    unset -nocomplain w r


  }
  return $rc
} 1

test FormatCellCheckFills-9.3 {Check Fills} {
  set rc 1
  for {set i 0} {$i < $w_obj(fills)} {incr i} {







<

|
|
>
>
>
|
|
<
|
|
|
|
>
>







859
860
861
862
863
864
865

866
867
868
869
870
871
872
873

874
875
876
877
878
879
880
881
882
883
884
885
886
test FormatCellReadWorkbook-9.1 {Read Workbook} {
  array set workbook [ooxml::xl_read formatcell.xlsx]
  return [llength $workbook(sheets)]
} 1

test FormatCellCheckBorders-9.2 {Check Borders} {
  set rc 1

  for {set i 0} {$i < $w_obj(borders)} {incr i} {
    set dw $w_borders($i)
    set dr $workbook(s,borders,$i)
    foreach key {left right top bottom diagonal} {
      array set w [dict get $dw $key]
      array set r [dict get $dr $key]
      foreach {n v} [array get w] {
	if {![info exists r($n)] || $r($n) ne $v} {

	  set rc 0
	}
      }
      unset -nocomplain w r
    }
    unset -nocomplain dw dr
  }
  return $rc
} 1

test FormatCellCheckFills-9.3 {Check Fills} {
  set rc 1
  for {set i 0} {$i < $w_obj(fills)} {incr i} {