ColumnDimension.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. class PHPExcel_Worksheet_ColumnDimension extends PHPExcel_Worksheet_Dimension
  8. {
  9. /**
  10. * Column index
  11. *
  12. * @var int
  13. */
  14. private $columnIndex;
  15. /**
  16. * Column width
  17. *
  18. * When this is set to a negative value, the column width should be ignored by IWriter
  19. *
  20. * @var double
  21. */
  22. private $width = -1;
  23. /**
  24. * Auto size?
  25. *
  26. * @var bool
  27. */
  28. private $autoSize = false;
  29. /**
  30. * Create a new PHPExcel_Worksheet_ColumnDimension
  31. *
  32. * @param string $pIndex Character column index
  33. */
  34. public function __construct($pIndex = 'A')
  35. {
  36. // Initialise values
  37. $this->columnIndex = $pIndex;
  38. // set dimension as unformatted by default
  39. parent::__construct(0);
  40. }
  41. /**
  42. * Get ColumnIndex
  43. *
  44. * @return string
  45. */
  46. public function getColumnIndex()
  47. {
  48. return $this->columnIndex;
  49. }
  50. /**
  51. * Set ColumnIndex
  52. *
  53. * @param string $pValue
  54. * @return PHPExcel_Worksheet_ColumnDimension
  55. */
  56. public function setColumnIndex($pValue)
  57. {
  58. $this->columnIndex = $pValue;
  59. return $this;
  60. }
  61. /**
  62. * Get Width
  63. *
  64. * @return double
  65. */
  66. public function getWidth()
  67. {
  68. return $this->width;
  69. }
  70. /**
  71. * Set Width
  72. *
  73. * @param double $pValue
  74. * @return PHPExcel_Worksheet_ColumnDimension
  75. */
  76. public function setWidth($pValue = -1)
  77. {
  78. $this->width = $pValue;
  79. return $this;
  80. }
  81. /**
  82. * Get Auto Size
  83. *
  84. * @return bool
  85. */
  86. public function getAutoSize()
  87. {
  88. return $this->autoSize;
  89. }
  90. /**
  91. * Set Auto Size
  92. *
  93. * @param bool $pValue
  94. * @return PHPExcel_Worksheet_ColumnDimension
  95. */
  96. public function setAutoSize($pValue = false)
  97. {
  98. $this->autoSize = $pValue;
  99. return $this;
  100. }
  101. }