ooxml

Check-in [401fec5842]
Login

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

Overview
Comment:added "-tag" to the method "border". with this you can give a style a name. in the method "style" as BORDERID you can also pass the given name.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | namedfmts
Files: files | file ages | folders
SHA3-256: 401fec584237a0d9dc99c5bfb4f15ba826aa656c68e3a407a2820f42513d9e04
User & Date: alex 2020-03-06 07:58:15
Context
2020-03-07
08:11
bug fix; added test for "named formats" Closed-Leaf check-in: 1fcc546092 user: alex tags: namedfmts
2020-03-06
07:58
added "-tag" to the method "border". with this you can give a style a name. in the method "style" as BORDERID you can also pass the given name. check-in: 401fec5842 user: alex tags: namedfmts
07:55
added "-tag" to the method "fill". with this you can give a style a name. in the method "style" as FILLID you can also pass the given name. check-in: ce8bfc62d7 user: alex tags: namedfmts
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ooxml.tcl.

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
....
2048
2049
2050
2051
2052
2053
2054













2055
2056
2057
2058
2059
2060
2061
2062
2063
....
2118
2119
2120
2121
2122
2123
2124



2125
2126
2127
2128
2129
2130
2131
2132



2133
2134
2135
2136
2137
2138
2139
....
2194
2195
2196
2197
2198
2199
2200



2201
2202
2203
2204
2205
2206
2207
    }
    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 {
................................................................................
          } else {
            error "option '$opt': missing argument"
          }            
        }
        -list {
	  set opts([string range $opt 1 end]) 1
        }













        default {
          error "unknown option \"$opt\", should be: -leftstyle, -leftcolor, -rightstyle, -rightcolor, -topstyle, -topcolor, -bottomstyle, -bottomcolor, -diagonalstyle, -diagonalcolor, -diagonaldirection or -list"
        }
      }
    }

    if {$opts(list)} {
      return [array get borders]
    }
................................................................................
	  if {[dict get $borders($idx) $key $subkey] ne [dict get $tmp $key $subkey]} {
	    set found 0
	    break
	  }
	}
      }
      if {$found} {



        return $idx
      }
    }

    set borders($obj(borders)) $tmp
    set idx $obj(borders)
    incr obj(borders)
    



    return $idx
  }

  method style { args } {
    my variable obj
    my variable styles
    my variable tags
................................................................................
      set opts(numfmt) $tags(numFmts,$opts(numfmt))
    }
    if {![string is integer -strict $opts(font)] && [info exists tags(fonts,$opts(font))]} {
      set opts(font) $tags(fonts,$opts(font))
    }
    if {![string is integer -strict $opts(fill)] && [info exists tags(fills,$opts(fill))]} {
      set opts(fill) $tags(fills,$opts(fill))



    }

    set obj(blockPreset) 1
    
    if {![string is integer -strict $opts(numfmt)] || $opts(numfmt) < 0} {
      set opts(numfmt) 0
    }







>







 







>







 







>
>
>
>
>
>
>
>
>
>
>
>
>

|







 







>
>
>








>
>
>







 







>
>
>







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
....
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
....
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
....
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
    }
    return $idx
  }

  method border { args } {
    my variable obj
    my variable borders
    my variable tags

    array set opts {
      list 0
      leftstyle {}
      leftcolor {}
      rightstyle {}
      rightcolor {}
................................................................................
      topstyle {}
      topcolor {}
      bottomstyle {}
      bottomcolor {}
      diagonalstyle {}
      diagonalcolor {}
      diagonaldirection {}
      tag {}
    }

    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 {
................................................................................
          } else {
            error "option '$opt': missing argument"
          }            
        }
        -list {
	  set opts([string range $opt 1 end]) 1
        }
        -tag {
	  incr idx
          if {$idx < $len} {
	    if {[string is integer -strict [set tag [lindex $args $idx]]]} {
	      error "option '$opt': should not be an integer value"
	    } else {
	      set opts([string range $opt 1 end]) $tag
	    } 
	    unset tag
          } else {
            error "option '$opt': missing argument"
          }            
        }
        default {
          error "unknown option \"$opt\", should be: -leftstyle, -leftcolor, -rightstyle, -rightcolor, -topstyle, -topcolor, -bottomstyle, -bottomcolor, -diagonalstyle, -diagonalcolor, -diagonaldirection, -list or -tag"
        }
      }
    }

    if {$opts(list)} {
      return [array get borders]
    }
................................................................................
	  if {[dict get $borders($idx) $key $subkey] ne [dict get $tmp $key $subkey]} {
	    set found 0
	    break
	  }
	}
      }
      if {$found} {
	if {$opts(tag) ne {}} {
	  set tags(borders,$opts(tag)) $idx
	}
        return $idx
      }
    }

    set borders($obj(borders)) $tmp
    set idx $obj(borders)
    incr obj(borders)
    
    if {$opts(tag) ne {}} {
      set tags(borders,$opts(tag)) $idx
    }
    return $idx
  }

  method style { args } {
    my variable obj
    my variable styles
    my variable tags
................................................................................
      set opts(numfmt) $tags(numFmts,$opts(numfmt))
    }
    if {![string is integer -strict $opts(font)] && [info exists tags(fonts,$opts(font))]} {
      set opts(font) $tags(fonts,$opts(font))
    }
    if {![string is integer -strict $opts(fill)] && [info exists tags(fills,$opts(fill))]} {
      set opts(fill) $tags(fills,$opts(fill))
    }
    if {![string is integer -strict $opts(border)] && [info exists tags(borders,$opts(border))]} {
      set opts(border) $tags(borders,$opts(border))
    }

    set obj(blockPreset) 1
    
    if {![string is integer -strict $opts(numfmt)] || $opts(numfmt) < 0} {
      set opts(numfmt) 0
    }