ooxml

Check-in [0ebe84a691]
Login

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

Overview
Comment:move package require vfs::zip to procs xl_sheets and xl_read because it is only needed to read data
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | populationspeed
Files: files | file ages | folders
SHA3-256: 0ebe84a69148f431dc99acd0b9b7a58308be7b82b51b317a49d54c0ec5643e76
User & Date: alex 2019-08-15 06:42:14
Original Comment: move package require vfs__zip to procs xl_sheets and xl_read because it is only needed to read data
Context
2019-08-15
13:09
Merged from trunk check-in: 0c057761f8 user: rolf tags: populationspeed
06:42
move package require vfs::zip to procs xl_sheets and xl_read because it is only needed to read data check-in: 0ebe84a691 user: alex tags: populationspeed
2019-08-14
21:29
Added credits. Editorial clean-up. Removed the for this now not anymore used helper proc ::ooxml::Zip*. check-in: 43be3b2012 user: rolf tags: populationspeed
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ooxml.tcl.

156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
...
838
839
840
841
842
843
844


845
846
847
848
849
850
851
...
893
894
895
896
897
898
899


900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
#   -callback CALLBACK -path PATH -file FILENAME -creator CREATOR -name NAME -rootonly -addtimestamp -globalstyle
#   Callback arguments
#     spreadsheet sheet maxcol column title width align sortmode hide
#


package require Tcl 8.6
package require vfs::zip
package require tdom 0.9.0-
package require msgcat


namespace eval ::ooxml {
  namespace export xl_sheets xl_read xl_write

................................................................................


#
# ooxml::xl_sheets
#

proc ::ooxml::xl_sheets { file } {


  set sheets {}

  set mnt [vfs::zip::Mount $file xlsx]

  set rels 0
  if {![catch {open xlsx/xl/_rels/workbook.xml.rels r} fd]} {
    fconfigure $fd -encoding utf-8
................................................................................
#
# ooxml::xl_read
#

proc ::ooxml::xl_read { file args } {
  variable predefNumFmts



  array set cellXfs {}
  array set numFmts [array get predefNumFmts]
  array set sharedStrings {}
  set sheets {}

  if {[::ooxml::Getopt opts {valuesonly keylist sheets.arg {} sheetnames.arg {} datefmt.arg {%Y-%m-%d %H:%M:%S} as.arg array} $args]} {
    error $opts(-errmsg)
  }
  if {[string trim $opts(sheets)] eq {} && [string trim $opts(sheetnames)] eq {}} {
    set opts(sheetnames) *
  }


  set mnt [vfs::zip::Mount $file xlsx]

  set rels 0
  if {![catch {open xlsx/xl/_rels/workbook.xml.rels r} fd]} {
    fconfigure $fd -encoding utf-8
    if {![catch {dom parse [read $fd]} rdoc]} {







<







 







>
>







 







>
>











<







156
157
158
159
160
161
162

163
164
165
166
167
168
169
...
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
...
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913

914
915
916
917
918
919
920
#   -callback CALLBACK -path PATH -file FILENAME -creator CREATOR -name NAME -rootonly -addtimestamp -globalstyle
#   Callback arguments
#     spreadsheet sheet maxcol column title width align sortmode hide
#


package require Tcl 8.6

package require tdom 0.9.0-
package require msgcat


namespace eval ::ooxml {
  namespace export xl_sheets xl_read xl_write

................................................................................


#
# ooxml::xl_sheets
#

proc ::ooxml::xl_sheets { file } {
  package require vfs::zip

  set sheets {}

  set mnt [vfs::zip::Mount $file xlsx]

  set rels 0
  if {![catch {open xlsx/xl/_rels/workbook.xml.rels r} fd]} {
    fconfigure $fd -encoding utf-8
................................................................................
#
# ooxml::xl_read
#

proc ::ooxml::xl_read { file args } {
  variable predefNumFmts

  package require vfs::zip

  array set cellXfs {}
  array set numFmts [array get predefNumFmts]
  array set sharedStrings {}
  set sheets {}

  if {[::ooxml::Getopt opts {valuesonly keylist sheets.arg {} sheetnames.arg {} datefmt.arg {%Y-%m-%d %H:%M:%S} as.arg array} $args]} {
    error $opts(-errmsg)
  }
  if {[string trim $opts(sheets)] eq {} && [string trim $opts(sheetnames)] eq {}} {
    set opts(sheetnames) *
  }


  set mnt [vfs::zip::Mount $file xlsx]

  set rels 0
  if {![catch {open xlsx/xl/_rels/workbook.xml.rels r} fd]} {
    fconfigure $fd -encoding utf-8
    if {![catch {dom parse [read $fd]} rdoc]} {