ooxml

Check-in [ce8bfc62d7]
Login

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

Overview
Comment: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.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | namedfmts
Files: files | file ages | folders
SHA3-256: ce8bfc62d76f7dda6c8561b03794b7cf6d6e21ec3e3c7c06a3944c228abb828e
User & Date: alex 2020-03-06 07:55:17
Context
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
07:52
added "-tag" to the method "font". with this you can give a style a name. in the method "style" as FONTID you can also pass the given name. check-in: 2e0fa3b0bd user: alex tags: namedfmts
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ooxml.tcl.

1928
1929
1930
1931
1932
1933
1934

1935
1936
1937
1938
1939
1940

1941
1942
1943
1944
1945
1946
1947
....
1951
1952
1953
1954
1955
1956
1957













1958
1959
1960
1961
1962
1963
1964
1965
1966
....
1979
1980
1981
1982
1983
1984
1985



1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996



1997
1998
1999
2000
2001
2002
2003
....
2170
2171
2172
2173
2174
2175
2176



2177
2178
2179
2180
2181
2182
2183
    }
    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 {
................................................................................
          } else {
            error "option '$opt': missing argument"
          }            
        }
        -list {
	  set opts([string range $opt 1 end]) 1
        }













        default {
          error "unknown option \"$opt\", should be: -patterntype, -fgcolor, -bgcolor or -list"
        }
      }
    }

    if {$opts(list)} {
      return [array get fills]
    }
................................................................................
      foreach name [array names a] {
        if {$a($name) ne $opts($name)} {
	  set found 0
	  break
	}
      }
      if {$found} {



        return $idx
      }
    }

    set fills($obj(fills)) {}
    foreach item {patterntype fgcolor bgcolor} {
      lappend fills($obj(fills)) $item $opts($item)
    }
    set idx $obj(fills)
    incr obj(fills)
    



    return $idx
  }

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

................................................................................
    }

    if {![string is integer -strict $opts(numfmt)] && [info exists tags(numFmts,$opts(numfmt))]} {
      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))



    }

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







>






>







 







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

|







 







>
>
>











>
>
>







 







>
>
>







1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
....
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
....
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
....
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
    }
    return $idx
  }

  method fill { args } {
    my variable obj
    my variable fills
    my variable tags

    array set opts {
      list 0
      patterntype none
      fgcolor {}
      bgcolor {}
      tag {}
    }

    set len [llength $args]
    set idx 0
    for {set idx 0} {$idx < $len} {incr idx} {
      switch -- [set opt [lindex $args $idx]] {
        -patterntype - -fgcolor - -bgcolor {
................................................................................
          } 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: -patterntype, -fgcolor, -bgcolor, -list or -tag"
        }
      }
    }

    if {$opts(list)} {
      return [array get fills]
    }
................................................................................
      foreach name [array names a] {
        if {$a($name) ne $opts($name)} {
	  set found 0
	  break
	}
      }
      if {$found} {
	if {$opts(tag) ne {}} {
	  set tags(fills,$opts(tag)) $idx
	}
        return $idx
      }
    }

    set fills($obj(fills)) {}
    foreach item {patterntype fgcolor bgcolor} {
      lappend fills($obj(fills)) $item $opts($item)
    }
    set idx $obj(fills)
    incr obj(fills)
    
    if {$opts(tag) ne {}} {
      set tags(fills,$opts(tag)) $idx
    }
    return $idx
  }

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

................................................................................
    }

    if {![string is integer -strict $opts(numfmt)] && [info exists tags(numFmts,$opts(numfmt))]} {
      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
    }