ooxml

Check-in [5c65034ad7]
Login

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

Overview
Comment:added "-zero" and "-nostring" to reset globally set options "-nozero" and "-string" with method "column" for a single cell with method "cell"
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | coldefs
Files: files | file ages | folders
SHA3-256: 5c65034ad7b99725c47c335e1ddaabf85fa616455da57167d64ffe18f72db1c5
User & Date: alex 2020-03-05 19:28:05
Context
2020-03-05
19:35
ignore "-globalstyle" in versions > 1.5; styles are from now on predefined via method "column" and can be overwritten in method "cell" check-in: 9fc2848c8f user: alex tags: trunk
19:28
added "-zero" and "-nostring" to reset globally set options "-nozero" and "-string" with method "column" for a single cell with method "cell" Closed-Leaf check-in: 5c65034ad7 user: alex tags: coldefs
2020-02-14
18:59
First version to remove "-globalstyle" from method "cell". Instead, the options of method "column" are taken as long as no local options for "-style", "-string" and/or "-nozero" are specified for "cell". check-in: 85d6ea0ef6 user: alex tags: coldefs
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ooxml.tcl.

2272
2273
2274
2275
2276
2277
2278


2279
2280
2281
2282
2283
2284
2285
....
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303







2304
2305
2306
2307
2308
2309
2310
....
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
    my variable cols

    array set opts {
      index {}
      style -1
      formula {}
      string -1


      nozero -1
      globalstyle {}
      height {}
    }

    set len [llength $args]
    set idx 0
................................................................................
	  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\", should be: -index, -style, -formula, -height, -string or -nozero"
        }
      }
    }








    if {!$obj(callRow,$obj(sheets))} {
      set obj(callRow,$obj(sheets)) 1
      incr obj(row,$sheet)
    }

    if {[regexp {^\d+$} $opts(index)] && $opts(index) > -1} {
................................................................................
      incr obj(col,$sheet)
    }
    if {$obj(row,$sheet) < 0 || $obj(col,$sheet) < 0} {
      return -1
    }

    if {[string is integer -strict $opts(style)] && $opts(style) == -1} {
      if {[info exists cols($sheet,$obj(col,$sheet)) style] && [dict get $cols($sheet,$obj(col,$sheet)) style] >= 0} {
        set opts(style) [dict get $cols($sheet,$obj(col,$sheet)) style]
      } elseif {$opts(style) == -1} {
	set opts(style) 0
      }
    }
    if {[string is integer -strict $opts(string)] && $opts(string) == -1} {
      if {[info exists cols($sheet,$obj(col,$sheet)) string] && [dict get $cols($sheet,$obj(col,$sheet)) string] == 1} {
	set opts(string) 1
      } elseif {$opts(string) == -1} {
	set opts(string) 0
      }
    }
    if {[string is integer -strict $opts(nozero)] && $opts(nozero) == -1} {
      if {[info exists cols($sheet,$obj(col,$sheet)) nozero] && [dict get $cols($sheet,$obj(col,$sheet)) nozero] == 1} {
	set opts(nozero) 1
      } elseif {$opts(nozero) == -1} {
	set opts(nozero) 0
      }
    }

    set cell ${sheet},$obj(row,$sheet),$obj(col,$sheet)







>
>







 







|



|



>
>
>
>
>
>
>







 







|






|






|







2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
....
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
....
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
    my variable cols

    array set opts {
      index {}
      style -1
      formula {}
      string -1
      nostring -1
      zero -1
      nozero -1
      globalstyle {}
      height {}
    }

    set len [llength $args]
    set idx 0
................................................................................
	  incr idx
          if {$idx < $len} {
            set opts([string range $opt 1 end]) [lindex $args $idx]
          } else {
            error "option '$opt': missing argument"
          }            
        }
        -string - -nostring - -zero - -nozero - -globalstyle {
	  set opts([string range $opt 1 end]) 1
        }
        default {
          error "unknown option \"$opt\", should be: -index, -style, -formula, -height, -string, nostring, -zero or -nozero"
        }
      }
    }

    if {$opts(nostring) == 1} {
      set opts(string) 0
    }
    if {$opts(zero) == 1} {
      set opts(nozero) 0
    }

    if {!$obj(callRow,$obj(sheets))} {
      set obj(callRow,$obj(sheets)) 1
      incr obj(row,$sheet)
    }

    if {[regexp {^\d+$} $opts(index)] && $opts(index) > -1} {
................................................................................
      incr obj(col,$sheet)
    }
    if {$obj(row,$sheet) < 0 || $obj(col,$sheet) < 0} {
      return -1
    }

    if {[string is integer -strict $opts(style)] && $opts(style) == -1} {
      if {[info exists cols($sheet,$obj(col,$sheet))] && [dict get $cols($sheet,$obj(col,$sheet)) style] >= 0} {
        set opts(style) [dict get $cols($sheet,$obj(col,$sheet)) style]
      } elseif {$opts(style) == -1} {
	set opts(style) 0
      }
    }
    if {[string is integer -strict $opts(string)] && $opts(string) == -1} {
      if {[info exists cols($sheet,$obj(col,$sheet))] && [dict get $cols($sheet,$obj(col,$sheet)) string] == 1} {
	set opts(string) 1
      } elseif {$opts(string) == -1} {
	set opts(string) 0
      }
    }
    if {[string is integer -strict $opts(nozero)] && $opts(nozero) == -1} {
      if {[info exists cols($sheet,$obj(col,$sheet))] && [dict get $cols($sheet,$obj(col,$sheet)) nozero] == 1} {
	set opts(nozero) 1
      } elseif {$opts(nozero) == -1} {
	set opts(nozero) 0
      }
    }

    set cell ${sheet},$obj(row,$sheet),$obj(col,$sheet)