xmlCalcChain.go 5.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of
  2. // this source code is governed by a BSD-style license that can be found in
  3. // the LICENSE file.
  4. //
  5. // Package excelize providing a set of functions that allow you to write to
  6. // and read from XLSX files. Support reads and writes XLSX file generated by
  7. // Microsoft Excel™ 2007 and later. Support save file without losing original
  8. // charts of XLSX. This library needs Go version 1.10 or later.
  9. package excelize
  10. import "encoding/xml"
  11. // xlsxCalcChain directly maps the calcChain element. This element represents the root of the calculation chain.
  12. type xlsxCalcChain struct {
  13. XMLName xml.Name `xml:"http://schemas.openxmlformats.org/spreadsheetml/2006/main calcChain"`
  14. C []xlsxCalcChainC `xml:"c"`
  15. }
  16. // xlsxCalcChainC directly maps the c element.
  17. //
  18. // Attributes | Attributes
  19. // --------------------------+----------------------------------------------------------
  20. // a (Array) | A Boolean flag indicating whether the cell's formula
  21. // | is an array formula. True if this cell's formula is
  22. // | an array formula, false otherwise. If there is a
  23. // | conflict between this attribute and the t attribute
  24. // | of the f element (§18.3.1.40), the t attribute takes
  25. // | precedence. The possible values for this attribute
  26. // | are defined by the W3C XML Schema boolean datatype.
  27. // |
  28. // i (Sheet Id) | A sheet Id of a sheet the cell belongs to. If this is
  29. // | omitted, it is assumed to be the same as the i value
  30. // | of the previous cell.The possible values for this
  31. // | attribute are defined by the W3C XML Schema int datatype.
  32. // |
  33. // l (New Dependency Level) | A Boolean flag indicating that the cell's formula
  34. // | starts a new dependency level. True if the formula
  35. // | starts a new dependency level, false otherwise.
  36. // | Starting a new dependency level means that all
  37. // | concurrent calculations, and child calculations, shall
  38. // | be completed - and the cells have new values - before
  39. // | the calc chain can continue. In other words, this
  40. // | dependency level might depend on levels that came before
  41. // | it, and any later dependency levels might depend on
  42. // | this level; but not later dependency levels can have
  43. // | any calculations started until this dependency level
  44. // | completes.The possible values for this attribute are
  45. // | defined by the W3C XML Schema boolean datatype.
  46. // |
  47. // r (Cell Reference) | An A-1 style reference to a cell.The possible values
  48. // | for this attribute are defined by the ST_CellRef
  49. // | simple type (§18.18.7).
  50. // |
  51. // s (Child Chain) | A Boolean flag indicating whether the cell's formula
  52. // | is on a child chain. True if this cell is part of a
  53. // | child chain, false otherwise. If this is omitted, it
  54. // | is assumed to be the same as the s value of the
  55. // | previous cell .A child chain is a list of calculations
  56. // | that occur which depend on the parent to the chain.
  57. // | There shall not be cross dependencies between child
  58. // | chains. Child chains are not the same as dependency
  59. // | levels - a child chain and its parent are all on the
  60. // | same dependency level. Child chains are series of
  61. // | calculations that can be independently farmed out to
  62. // | other threads or processors.The possible values for
  63. // | this attribute are defined by the W3C XML Schema
  64. // | boolean datatype.
  65. // |
  66. // t (New Thread) | A Boolean flag indicating whether the cell's formula
  67. // | starts a new thread. True if the cell's formula starts
  68. // | a new thread, false otherwise.The possible values for
  69. // | this attribute are defined by the W3C XML Schema
  70. // | boolean datatype.
  71. //
  72. type xlsxCalcChainC struct {
  73. R string `xml:"r,attr"`
  74. I int `xml:"i,attr"`
  75. L bool `xml:"l,attr,omitempty"`
  76. S bool `xml:"s,attr,omitempty"`
  77. T bool `xml:"t,attr,omitempty"`
  78. A bool `xml:"a,attr,omitempty"`
  79. }