Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Getopt removed for more speed |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
3d420672dd151b10fa878547f9c9c726 |
User & Date: | alex 2019-10-29 06:48:57 |
Context
2019-10-31
| ||
15:51 | TEA implemented; next todo: tcl tests check-in: 6b3980c2a9 user: alex tags: trunk | |
2019-10-30
| ||
22:05 | TEA support (Tcl Extension Architecture) check-in: 03f6df59a4 user: alex tags: TEA | |
2019-10-29
| ||
06:48 | Getopt removed for more speed check-in: 3d420672dd user: alex tags: trunk | |
2019-08-20
| ||
08:00 | Version-1.3 check-in: 3e16defd13 user: alex tags: trunk, release, version-1.3 | |
Changes
Changes to ooxml.tcl.
554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 ... 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 .... 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 .... 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 .... 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 .... 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 .... 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 .... 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 .... 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 .... 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 .... 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 .... 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 .... 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 |
} } default { } } } proc ::ooxml::Getopt { *result declaration to_parse } { if {${*result} ne {}} { upvar 1 ${*result} result } set error 0 set errmsg {} array set result {} set optopts {} set argcnt [llength $declaration] for {set argc 0} {$argc < $argcnt} {incr argc} { set opt [lindex $declaration $argc] if {[lsearch -exact {. -} [string index $opt 0]] > -1} { set error 1 lappend errmsg "option name can not start with '.' or '-'" set result(-error) $error set result(-errmsg) $errmsg return $error } if {[regsub -- {\..*$} $opt {} name]} { regsub -- (${name}) $opt {} opt } if {![regsub -- {\.arg\M} $opt {} opt]} { dict set optopts $name arg 0 set result($name) 0 } else { dict set optopts $name arg 1 incr argc if {$argc < $argcnt} { set result($name) [lindex $declaration $argc] } else { set result($name) {} set error 1 lappend errmsg "declaration of '$name' missing default value" set result(-error) $error set result(-errmsg) $errmsg return $error } } } set argcnt [llength $to_parse] for {set argc 0} {$argc < $argcnt} {incr argc} { set opt [lindex $to_parse $argc] if {$opt eq {--}} { set result(--) [lrange $to_parse ${argc}+1 end] break } elseif {[string index $opt 0] eq {-}} { set opt [string range $opt 1 end] if {[dict keys $optopts $opt] eq $opt || [llength [set opt [dict keys $optopts ${opt}*]]] == 1} { if {[dict get $optopts $opt arg]} { incr argc if {$argc < $argcnt} { set result($opt) [lindex $to_parse $argc] } else { set error 1 lappend errmsg "${opt}: missing argument" } } else { set result($opt) 1 } } else { set error 1 lappend errmsg "[lindex $to_parse $argc]: unknown or ambiguous option" } } else { set error 1 lappend errmsg "${opt}: syntax error" } } if {![info exists result(--)]} { set result(--) {} } set result(-error) $error set result(-errmsg) $errmsg return $error } proc ::ooxml::ScanDateTime { scan {iso8601 0} } { set d 1 set m 1 set ml {} set y 1970 set H 0 ................................................................................ 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] ................................................................................ my variable fonts my variable numFmts my variable styles my variable fills my variable borders my variable cols if {[::ooxml::Getopt opts {creator.arg {unknown} created.arg {} modifiedby.arg {} modified.arg {} application.arg {}} $args]} { error $opts(-errmsg) } set obj(blockPreset) 0 set obj(encoding) utf-8 set obj(indent) none ................................................................................ return 0 } method numberformat { args } { my variable obj my variable numFmts if {[::ooxml::Getopt opts {list format.arg {} general date time datetime iso8601 number decimal red separator fraction scientific percent string text} $args]} { error $opts(-errmsg) } if {$opts(list)} { array set tmp [array get ::ooxml::predefNumFmts] array set tmp [array get numFmts] return [array get tmp] } ................................................................................ } method font { args } { my variable obj my variable fonts array set a $fonts(0) if {[::ooxml::Getopt opts [list list name.arg $a(name) family.arg $a(family) size.arg $a(size) color $a(color) scheme $a(scheme) bold italic underline color.arg {}] $args]} { error $opts(-errmsg) } if {$opts(list)} { return [array get fonts] } set obj(blockPreset) 1 ................................................................................ return $idx } method fill { args } { my variable obj my variable fills if {[::ooxml::Getopt opts {list patterntype.arg none fgcolor.arg {} bgcolor.arg {}} $args]} { error $opts(-errmsg) } if {$opts(list)} { return [array get fills] } set obj(blockPreset) 1 ................................................................................ return $idx } method border { args } { my variable obj my variable borders if {[::ooxml::Getopt opts {list leftstyle.arg {} leftcolor.arg {} rightstyle.arg {} rightcolor.arg {} topstyle.arg {} topcolor.arg {} bottomstyle.arg {} bottomcolor.arg {} diagonalstyle.arg {} diagonalcolor.arg {} diagonaldirection.arg {}} $args]} { error $opts(-errmsg) } if {$opts(list)} { return [array get borders] } set obj(blockPreset) 1 ................................................................................ return $idx } method style { args } { my variable obj my variable styles if {[::ooxml::Getopt opts {list numfmt.arg 0 font.arg 0 fill.arg 0 border.arg 0 xf.arg 0 horizontal.arg {} vertical.arg {} rotate.arg {} wrap} $args]} { error $opts(-errmsg) } if {$opts(list)} { return [array get styles] } set obj(blockPreset) 1 ................................................................................ return $obj(sheets) } method column { sheet args } { my variable obj my variable cols if {[::ooxml::Getopt opts {index.arg {} to.arg {} width.arg {} style.arg {} bestfit customwidth string nozero calcfit} $args]} { error $opts(-errmsg) } if {[regexp {^\d+$} $opts(index)] && $opts(index) > -1} { set obj(gCol,$sheet) $opts(index) } elseif {[regexp {^[A-Z]+$} $opts(index)]} { set obj(gCol,$sheet) [lindex [split [::ooxml::StringToRowColumn $opts(index)] ,] end] } elseif {[string trim $opts(index)] eq {}} { ................................................................................ return $obj(gCol,$sheet) } method row { sheet args } { my variable obj if {[::ooxml::Getopt opts {index.arg {} height.arg {}} $args]} { error $opts(-errmsg) } if {![string is integer -strict $opts(height)] || $opts(height) < 1 || $opts(height) > 1024} { set opts(height) {} } if {[string is integer -strict $opts(index)] && $opts(index) > -1} { set obj(callRow,$obj(sheets)) 1 ................................................................................ method cell { sheet {data {}} args } { my variable obj my variable cells my variable cols array set opts { index "" style 0 formula "" string 0 nozero 0 globalstyle 0 height "" } set len [llength $args] set loopInd 0 while {$loopInd < $len} { switch -- [lindex $args $loopInd] { "-index" { incr loopInd if {$loopInd < $len} { set opts(index) [lindex $args $loopInd] incr loopInd } else { error "-index: missing argument" } } "-style" { incr loopInd if {$loopInd < $len} { set opts(style) [lindex $args $loopInd] incr loopInd } else { error "-style: missing argument" } } "-formula" { incr loopInd if {$loopInd < $len} { set opts(formula) [lindex $args $loopInd] incr loopInd } else { error "-formula: missing argument" } } "-string" { set opts(string) 1 incr loopInd } "-nozero" { set opts(nozero) 1 } "-globalstyle" { set opts(globalstyle) 1 incr loopInd } "-height" { incr loopInd if {$loopInd < $len} { set opts(height) [lindex $args $loopInd] incr loopInd } else { error "-height: missing argument" } } default { error "unknown option [lindex $args $loopInd]" } } } # if {[::ooxml::Getopt opts {index.arg {} style.arg 0 formula.arg {} string nozero globalstyle height.arg {}} $args]} { # error $opts(-errmsg) # } if {!$obj(callRow,$obj(sheets))} { set obj(callRow,$obj(sheets)) 1 incr obj(row,$sheet) } if {[regexp {^\d+$} $opts(index)] && $opts(index) > -1} { ................................................................................ my variable fonts my variable numFmts my variable styles my variable fills my variable borders my variable cols if {[::ooxml::Getopt opts {holdcontainerdirectory} $args]} { error $opts(-errmsg) } ooxml::InitNodeCommands namespace import ::ooxml::Tag_* ::ooxml::Text # Initialize zip file set file [string trim $file] ................................................................................ variable defaults if {![winfo exists $lb]} { tk_messageBox -message [msgcat::mc {Tablelist does not exists!}] return } if {[::ooxml::Getopt opts [list callback.arg {::ooxml::tablelist_to_xl_callback} path.arg $defaults(path) file.arg {tablelist.xlsx} creator.arg {unknown} name.arg {Tablelist1} rootonly addtimestamp globalstyle] $args]} { error $opts(-errmsg) } if {$opts(callback) eq {} || ([info commands $opts(callback)] eq {} && [info commands ::$opts(callback)] eq {})} { set opts(callback) ::ooxml::tablelist_to_xl_callback } if {[string trim $opts(path)] eq {}} { set opts(path) {.} } |
< < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | > > > > > > > > > > > > > > > > > > > > > > > > > > | | > > > > > > > > > > > > > > > > > > > > > > | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > < > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | > > > > > > > > > > > > > > > > > > > > > > > > | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | > > > > > > > > > > > > > > > > > > > | | | > | < > | < | < < | < < < < < < | | < | | < < < < < < < < < < < < < < < < | < < > < < < < < < < < < | < < < > | < > > > > > > > > > > > > > | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > |
554 555 556 557 558 559 560 561 562 563 564 565 566 567 ... 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 .... 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 .... 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 .... 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 .... 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 .... 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 .... 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 .... 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 .... 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 .... 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 .... 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 .... 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 |
} } default { } } } proc ::ooxml::ScanDateTime { scan {iso8601 0} } { set d 1 set m 1 set ml {} set y 1970 set H 0 ................................................................................ package require vfs::zip array set cellXfs {} array set numFmts [array get predefNumFmts] array set sharedStrings {} set sheets {} array set opts { valuesonly 0 keylist 0 sheets {} sheetnames {} datefmt {%Y-%m-%d %H:%M:%S} as array } set len [llength $args] set idx 0 for {set idx 0} {$idx < $len} {incr idx} { switch -- [set opt [lindex $args $idx]] { -sheets - -sheetnames - -datefmt - -as { incr idx if {$idx < $len} { set opts([string range $opt 1 end]) [lindex $args $idx] } else { error "option '$opt': missing argument" } } -valuesonly - -keylist { set opts([string range $opt 1 end]) 1 } default { error "unknown option '$opt'" } } } if {[string trim $opts(sheets)] eq {} && [string trim $opts(sheetnames)] eq {}} { set opts(sheetnames) * } set mnt [vfs::zip::Mount $file xlsx] ................................................................................ my variable fonts my variable numFmts my variable styles my variable fills my variable borders my variable cols array set opts { creator {unknown} created {} modifiedby {} modified {} application {} } set len [llength $args] set idx 0 for {set idx 0} {$idx < $len} {incr idx} { switch -- [set opt [lindex $args $idx]] { -creator - -created - -modifiedby - -modified - -application { incr idx if {$idx < $len} { set opts([string range $opt 1 end]) [lindex $args $idx] } else { error "option '$opt': missing argument" } } default { error "unknown option '$opt'" } } } set obj(blockPreset) 0 set obj(encoding) utf-8 set obj(indent) none ................................................................................ return 0 } method numberformat { args } { my variable obj my variable numFmts array set opts { list 0 format {} general 0 date 0 time 0 datetime 0 iso8601 0 number 0 decimal 0 red 0 separator 0 fraction 0 scientific 0 percent 0 string 0 text 0 } set len [llength $args] set idx 0 for {set idx 0} {$idx < $len} {incr idx} { switch -- [set opt [lindex $args $idx]] { -format { incr idx if {$idx < $len} { set opts([string range $opt 1 end]) [lindex $args $idx] } else { error "option '$opt': missing argument" } } -list - -general - -date - -time - -datetime - -iso8601 - -number - -decimal - -red - -separator - -fraction - -scientific - -percent - -string - -text { set opts([string range $opt 1 end]) 1 } default { error "unknown option '$opt'" } } } if {$opts(list)} { array set tmp [array get ::ooxml::predefNumFmts] array set tmp [array get numFmts] return [array get tmp] } ................................................................................ } method font { args } { my variable obj my variable fonts array set a $fonts(0) array set opts " list 0 name [list $a(name)] family [list $a(family)] size [list $a(size)] color [list $a(color)] scheme [list $a(scheme)] bold 0 italic 0 underline 0 " set len [llength $args] set idx 0 for {set idx 0} {$idx < $len} {incr idx} { switch -- [set opt [lindex $args $idx]] { -name - -family - -size - -color - -scheme { incr idx if {$idx < $len} { set opts([string range $opt 1 end]) [lindex $args $idx] } else { error "option '$opt': missing argument" } } -list - -bold - -italic - -underline { set opts([string range $opt 1 end]) 1 } default { error "unknown option '$opt'" } } } if {$opts(list)} { return [array get fonts] } set obj(blockPreset) 1 ................................................................................ return $idx } method fill { args } { my variable obj my variable fills array set opts { list 0 patterntype none fgcolor {} bgcolor {} } set len [llength $args] set idx 0 for {set idx 0} {$idx < $len} {incr idx} { switch -- [set opt [lindex $args $idx]] { -patterntype - -fgcolor - -bgcolor { incr idx if {$idx < $len} { set opts([string range $opt 1 end]) [lindex $args $idx] } else { error "option '$opt': missing argument" } } -list { set opts([string range $opt 1 end]) 1 } default { error "unknown option '$opt'" } } } if {$opts(list)} { return [array get fills] } set obj(blockPreset) 1 ................................................................................ return $idx } method border { args } { my variable obj my variable borders array set opts { list 0 leftstyle {} leftcolor {} rightstyle {} rightcolor {} topstyle {} topcolor {} bottomstyle {} bottomcolor {} diagonalstyle {} diagonalcolor {} diagonaldirection {} } set len [llength $args] set idx 0 for {set idx 0} {$idx < $len} {incr idx} { switch -- [set opt [lindex $args $idx]] { -leftstyle - -leftcolor - -rightstyle - -rightcolor - -topstyle - -topcolor - -bottomstyle - -bottomcolor - -diagonalstyle - -diagonalcolor - -diagonaldirection { incr idx if {$idx < $len} { set opts([string range $opt 1 end]) [lindex $args $idx] } else { error "option '$opt': missing argument" } } -list { set opts([string range $opt 1 end]) 1 } default { error "unknown option '$opt'" } } } if {$opts(list)} { return [array get borders] } set obj(blockPreset) 1 ................................................................................ return $idx } method style { args } { my variable obj my variable styles array set opts { list 0 numfmt 0 font 0 fill 0 border 0 xf 0 horizontal {} vertical {} rotate {} wrap 0 } set len [llength $args] set idx 0 for {set idx 0} {$idx < $len} {incr idx} { switch -- [set opt [lindex $args $idx]] { -numfmt - -font - -fill - -border - -xf - -horizontal - -vertical - -rotate { incr idx if {$idx < $len} { set opts([string range $opt 1 end]) [lindex $args $idx] } else { error "option '$opt': missing argument" } } -list - -wrap { set opts([string range $opt 1 end]) 1 } default { error "unknown option '$opt'" } } } if {$opts(list)} { return [array get styles] } set obj(blockPreset) 1 ................................................................................ return $obj(sheets) } method column { sheet args } { my variable obj my variable cols array set opts { index {} to {} width {} style {} bestfit 0 customwidth 0 string 0 nozero 0 calcfit 0 } set len [llength $args] set idx 0 for {set idx 0} {$idx < $len} {incr idx} { switch -- [set opt [lindex $args $idx]] { -index - -to - -width - -style { incr idx if {$idx < $len} { set opts([string range $opt 1 end]) [lindex $args $idx] } else { error "option '$opt': missing argument" } } -bestfit - -customwidth - -string - -nozero - -calcfit { set opts([string range $opt 1 end]) 1 } default { error "unknown option '$opt'" } } } if {[regexp {^\d+$} $opts(index)] && $opts(index) > -1} { set obj(gCol,$sheet) $opts(index) } elseif {[regexp {^[A-Z]+$} $opts(index)]} { set obj(gCol,$sheet) [lindex [split [::ooxml::StringToRowColumn $opts(index)] ,] end] } elseif {[string trim $opts(index)] eq {}} { ................................................................................ return $obj(gCol,$sheet) } method row { sheet args } { my variable obj array set opts { index {} height {} } set len [llength $args] set idx 0 for {set idx 0} {$idx < $len} {incr idx} { switch -- [set opt [lindex $args $idx]] { -index - -height { incr idx if {$idx < $len} { set opts([string range $opt 1 end]) [lindex $args $idx] } else { error "option '$opt': missing argument" } } default { error "unknown option '$opt'" } } } if {![string is integer -strict $opts(height)] || $opts(height) < 1 || $opts(height) > 1024} { set opts(height) {} } if {[string is integer -strict $opts(index)] && $opts(index) > -1} { set obj(callRow,$obj(sheets)) 1 ................................................................................ method cell { sheet {data {}} args } { my variable obj my variable cells my variable cols array set opts { index {} style 0 formula {} string 0 nozero 0 globalstyle 0 height {} } set len [llength $args] set idx 0 for {set idx 0} {$idx < $len} {incr idx} { switch -- [set opt [lindex $args $idx]] { -index - -style - -formula - -height { incr idx if {$idx < $len} { set opts([string range $opt 1 end]) [lindex $args $idx] } else { error "option '$opt': missing argument" } } -string - -nozero - -globalstyle { set opts([string range $opt 1 end]) 1 } default { error "unknown option '$opt'" } } } if {!$obj(callRow,$obj(sheets))} { set obj(callRow,$obj(sheets)) 1 incr obj(row,$sheet) } if {[regexp {^\d+$} $opts(index)] && $opts(index) > -1} { ................................................................................ my variable fonts my variable numFmts my variable styles my variable fills my variable borders my variable cols array set opts { holdcontainerdirectory 0 } set len [llength $args] set idx 0 for {set idx 0} {$idx < $len} {incr idx} { switch -- [set opt [lindex $args $idx]] { -holdcontainerdirectory { set opts([string range $opt 1 end]) 1 } default { error "unknown option '$opt'" } } } ooxml::InitNodeCommands namespace import ::ooxml::Tag_* ::ooxml::Text # Initialize zip file set file [string trim $file] ................................................................................ variable defaults if {![winfo exists $lb]} { tk_messageBox -message [msgcat::mc {Tablelist does not exists!}] return } array set opts " callback ::ooxml::tablelist_to_xl_callback path [list $defaults(path)] file tablelist.xlsx creator unknown name Tablelist1 rootonly 0 addtimestamp 0 globalstyle 0 " set len [llength $args] set idx 0 for {set idx 0} {$idx < $len} {incr idx} { switch -- [set opt [lindex $args $idx]] { -callback - -path - -file - -creator - -name { incr idx if {$idx < $len} { set opts([string range $opt 1 end]) [lindex $args $idx] } else { error "option '$opt': missing argument" } } -rootonly - -addtimestamp - -globalstyle { set opts([string range $opt 1 end]) 1 } default { error "unknown option '$opt'" } } } if {$opts(callback) eq {} || ([info commands $opts(callback)] eq {} && [info commands ::$opts(callback)] eq {})} { set opts(callback) ::ooxml::tablelist_to_xl_callback } if {[string trim $opts(path)] eq {}} { set opts(path) {.} } |