ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
PHPExcel_Style Class Reference
+ Inheritance diagram for PHPExcel_Style:
+ Collaboration diagram for PHPExcel_Style:

Public Member Functions

 __construct ($isSupervisor=false, $isConditional=false)
 Create a new PHPExcel_Style. More...
 
 getSharedComponent ()
 Get the shared style component for the currently active cell in currently active sheet. More...
 
 getParent ()
 Get parent. More...
 
 getStyleArray ($array)
 Build style array from subcomponents. More...
 
 applyFromArray ($pStyles=null, $pAdvanced=true)
 Apply styles from array. More...
 
 getFill ()
 Get Fill. More...
 
 getFont ()
 Get Font. More...
 
 setFont (PHPExcel_Style_Font $font)
 Set font. More...
 
 getBorders ()
 Get Borders. More...
 
 getAlignment ()
 Get Alignment. More...
 
 getNumberFormat ()
 Get Number Format. More...
 
 getConditionalStyles ()
 Get Conditional Styles. More...
 
 setConditionalStyles ($pValue=null)
 Set Conditional Styles. More...
 
 getProtection ()
 Get Protection. More...
 
 getQuotePrefix ()
 Get quote prefix. More...
 
 setQuotePrefix ($pValue)
 Set quote prefix. More...
 
 getHashCode ()
 Get hash code. More...
 
 getIndex ()
 Get own index in style collection. More...
 
 setIndex ($pValue)
 Set own index in style collection. More...
 
- Public Member Functions inherited from PHPExcel_Style_Supervisor
 __construct ($isSupervisor=FALSE)
 Create a new PHPExcel_Style_Alignment. More...
 
 bindParent ($parent, $parentPropertyName=NULL)
 Bind parent. More...
 
 getIsSupervisor ()
 Is this a supervisor or a cell style component? More...
 
 getActiveSheet ()
 Get the currently active sheet. More...
 
 getSelectedCells ()
 Get the currently active cell coordinate in currently active sheet. More...
 
 getActiveCell ()
 Get the currently active cell coordinate in currently active sheet. More...
 
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy. More...
 

Protected Attributes

 $_font
 
 $_fill
 
 $_borders
 
 $_alignment
 
 $_numberFormat
 
 $_conditionalStyles
 
 $_protection
 
 $_index
 
 $_quotePrefix = false
 
- Protected Attributes inherited from PHPExcel_Style_Supervisor
 $_isSupervisor
 
 $_parent
 

Detailed Description

Definition at line 36 of file Style.php.

Constructor & Destructor Documentation

◆ __construct()

PHPExcel_Style::__construct (   $isSupervisor = false,
  $isConditional = false 
)

Create a new PHPExcel_Style.

Parameters
boolean$isSupervisorFlag indicating if this is a supervisor or not Leave this value at default unless you understand exactly what its ramifications are
boolean$isConditionalFlag indicating if this is a conditional style or not Leave this value at default unless you understand exactly what its ramifications are

Definition at line 111 of file Style.php.

References array.

112  {
113  // Supervisor?
114  $this->_isSupervisor = $isSupervisor;
115 
116  // Initialise values
117  $this->_conditionalStyles = array();
118  $this->_font = new PHPExcel_Style_Font($isSupervisor, $isConditional);
119  $this->_fill = new PHPExcel_Style_Fill($isSupervisor, $isConditional);
120  $this->_borders = new PHPExcel_Style_Borders($isSupervisor, $isConditional);
121  $this->_alignment = new PHPExcel_Style_Alignment($isSupervisor, $isConditional);
122  $this->_numberFormat = new PHPExcel_Style_NumberFormat($isSupervisor, $isConditional);
123  $this->_protection = new PHPExcel_Style_Protection($isSupervisor, $isConditional);
124 
125  // bind parent if we are a supervisor
126  if ($isSupervisor) {
127  $this->_font->bindParent($this);
128  $this->_fill->bindParent($this);
129  $this->_borders->bindParent($this);
130  $this->_alignment->bindParent($this);
131  $this->_numberFormat->bindParent($this);
132  $this->_protection->bindParent($this);
133  }
134  }
Create styles array
The data for the language used.

Member Function Documentation

◆ applyFromArray()

PHPExcel_Style::applyFromArray (   $pStyles = null,
  $pAdvanced = true 
)

Apply styles from array.

$objPHPExcel->getActiveSheet()->getStyle('B2')->applyFromArray( array( 'font' => array( 'name' => 'Arial', 'bold' => true, 'italic' => false, 'underline' => PHPExcel_Style_Font::UNDERLINE_DOUBLE, 'strike' => false, 'color' => array( 'rgb' => '808080' ) ), 'borders' => array( 'bottom' => array( 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, 'color' => array( 'rgb' => '808080' ) ), 'top' => array( 'style' => PHPExcel_Style_Border::BORDER_DASHDOT, 'color' => array( 'rgb' => '808080' ) ) ), 'quotePrefix' => true ) );

Parameters
array$pStylesArray containing style information
boolean$pAdvancedAdvanced mode for setting borders.
Exceptions
PHPExcel_Exception
Returns
PHPExcel_Style

Definition at line 217 of file Style.php.

References $row, $style, $x, $y, array, PHPExcel_Cell\columnIndexFromString(), PHPExcel_Cell\coordinateFromString(), PHPExcel_Style_Supervisor\getActiveSheet(), getAlignment(), getBorders(), getFill(), getFont(), getNumberFormat(), getProtection(), PHPExcel_Style_Supervisor\getSelectedCells(), and PHPExcel_Cell\stringFromColumnIndex().

218  {
219  if (is_array($pStyles)) {
220  if ($this->_isSupervisor) {
221 
222  $pRange = $this->getSelectedCells();
223 
224  // Uppercase coordinate
225  $pRange = strtoupper($pRange);
226 
227  // Is it a cell range or a single cell?
228  if (strpos($pRange, ':') === false) {
229  $rangeA = $pRange;
230  $rangeB = $pRange;
231  } else {
232  list($rangeA, $rangeB) = explode(':', $pRange);
233  }
234 
235  // Calculate range outer borders
236  $rangeStart = PHPExcel_Cell::coordinateFromString($rangeA);
237  $rangeEnd = PHPExcel_Cell::coordinateFromString($rangeB);
238 
239  // Translate column into index
240  $rangeStart[0] = PHPExcel_Cell::columnIndexFromString($rangeStart[0]) - 1;
241  $rangeEnd[0] = PHPExcel_Cell::columnIndexFromString($rangeEnd[0]) - 1;
242 
243  // Make sure we can loop upwards on rows and columns
244  if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
245  $tmp = $rangeStart;
246  $rangeStart = $rangeEnd;
247  $rangeEnd = $tmp;
248  }
249 
250  // ADVANCED MODE:
251 
252  if ($pAdvanced && isset($pStyles['borders'])) {
253 
254  // 'allborders' is a shorthand property for 'outline' and 'inside' and
255  // it applies to components that have not been set explicitly
256  if (isset($pStyles['borders']['allborders'])) {
257  foreach (array('outline', 'inside') as $component) {
258  if (!isset($pStyles['borders'][$component])) {
259  $pStyles['borders'][$component] = $pStyles['borders']['allborders'];
260  }
261  }
262  unset($pStyles['borders']['allborders']); // not needed any more
263  }
264 
265  // 'outline' is a shorthand property for 'top', 'right', 'bottom', 'left'
266  // it applies to components that have not been set explicitly
267  if (isset($pStyles['borders']['outline'])) {
268  foreach (array('top', 'right', 'bottom', 'left') as $component) {
269  if (!isset($pStyles['borders'][$component])) {
270  $pStyles['borders'][$component] = $pStyles['borders']['outline'];
271  }
272  }
273  unset($pStyles['borders']['outline']); // not needed any more
274  }
275 
276  // 'inside' is a shorthand property for 'vertical' and 'horizontal'
277  // it applies to components that have not been set explicitly
278  if (isset($pStyles['borders']['inside'])) {
279  foreach (array('vertical', 'horizontal') as $component) {
280  if (!isset($pStyles['borders'][$component])) {
281  $pStyles['borders'][$component] = $pStyles['borders']['inside'];
282  }
283  }
284  unset($pStyles['borders']['inside']); // not needed any more
285  }
286 
287  // width and height characteristics of selection, 1, 2, or 3 (for 3 or more)
288  $xMax = min($rangeEnd[0] - $rangeStart[0] + 1, 3);
289  $yMax = min($rangeEnd[1] - $rangeStart[1] + 1, 3);
290 
291  // loop through up to 3 x 3 = 9 regions
292  for ($x = 1; $x <= $xMax; ++$x) {
293  // start column index for region
294  $colStart = ($x == 3) ?
296  : PHPExcel_Cell::stringFromColumnIndex($rangeStart[0] + $x - 1);
297 
298  // end column index for region
299  $colEnd = ($x == 1) ?
301  : PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0] - $xMax + $x);
302 
303  for ($y = 1; $y <= $yMax; ++$y) {
304 
305  // which edges are touching the region
306  $edges = array();
307 
308  // are we at left edge
309  if ($x == 1) {
310  $edges[] = 'left';
311  }
312 
313  // are we at right edge
314  if ($x == $xMax) {
315  $edges[] = 'right';
316  }
317 
318  // are we at top edge?
319  if ($y == 1) {
320  $edges[] = 'top';
321  }
322 
323  // are we at bottom edge?
324  if ($y == $yMax) {
325  $edges[] = 'bottom';
326  }
327 
328  // start row index for region
329  $rowStart = ($y == 3) ?
330  $rangeEnd[1] : $rangeStart[1] + $y - 1;
331 
332  // end row index for region
333  $rowEnd = ($y == 1) ?
334  $rangeStart[1] : $rangeEnd[1] - $yMax + $y;
335 
336  // build range for region
337  $range = $colStart . $rowStart . ':' . $colEnd . $rowEnd;
338 
339  // retrieve relevant style array for region
340  $regionStyles = $pStyles;
341  unset($regionStyles['borders']['inside']);
342 
343  // what are the inner edges of the region when looking at the selection
344  $innerEdges = array_diff( array('top', 'right', 'bottom', 'left'), $edges );
345 
346  // inner edges that are not touching the region should take the 'inside' border properties if they have been set
347  foreach ($innerEdges as $innerEdge) {
348  switch ($innerEdge) {
349  case 'top':
350  case 'bottom':
351  // should pick up 'horizontal' border property if set
352  if (isset($pStyles['borders']['horizontal'])) {
353  $regionStyles['borders'][$innerEdge] = $pStyles['borders']['horizontal'];
354  } else {
355  unset($regionStyles['borders'][$innerEdge]);
356  }
357  break;
358  case 'left':
359  case 'right':
360  // should pick up 'vertical' border property if set
361  if (isset($pStyles['borders']['vertical'])) {
362  $regionStyles['borders'][$innerEdge] = $pStyles['borders']['vertical'];
363  } else {
364  unset($regionStyles['borders'][$innerEdge]);
365  }
366  break;
367  }
368  }
369 
370  // apply region style to region by calling applyFromArray() in simple mode
371  $this->getActiveSheet()->getStyle($range)->applyFromArray($regionStyles, false);
372  }
373  }
374  return $this;
375  }
376 
377  // SIMPLE MODE:
378 
379  // Selection type, inspect
380  if (preg_match('/^[A-Z]+1:[A-Z]+1048576$/', $pRange)) {
381  $selectionType = 'COLUMN';
382  } else if (preg_match('/^A[0-9]+:XFD[0-9]+$/', $pRange)) {
383  $selectionType = 'ROW';
384  } else {
385  $selectionType = 'CELL';
386  }
387 
388  // First loop through columns, rows, or cells to find out which styles are affected by this operation
389  switch ($selectionType) {
390  case 'COLUMN':
391  $oldXfIndexes = array();
392  for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
393  $oldXfIndexes[$this->getActiveSheet()->getColumnDimensionByColumn($col)->getXfIndex()] = true;
394  }
395  break;
396 
397  case 'ROW':
398  $oldXfIndexes = array();
399  for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
400  if ($this->getActiveSheet()->getRowDimension($row)->getXfIndex() == null) {
401  $oldXfIndexes[0] = true; // row without explicit style should be formatted based on default style
402  } else {
403  $oldXfIndexes[$this->getActiveSheet()->getRowDimension($row)->getXfIndex()] = true;
404  }
405  }
406  break;
407 
408  case 'CELL':
409  $oldXfIndexes = array();
410  for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
411  for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
412  $oldXfIndexes[$this->getActiveSheet()->getCellByColumnAndRow($col, $row)->getXfIndex()] = true;
413  }
414  }
415  break;
416  }
417 
418  // clone each of the affected styles, apply the style array, and add the new styles to the workbook
419  $workbook = $this->getActiveSheet()->getParent();
420  foreach ($oldXfIndexes as $oldXfIndex => $dummy) {
421  $style = $workbook->getCellXfByIndex($oldXfIndex);
422  $newStyle = clone $style;
423  $newStyle->applyFromArray($pStyles);
424 
425  if ($existingStyle = $workbook->getCellXfByHashCode($newStyle->getHashCode())) {
426  // there is already such cell Xf in our collection
427  $newXfIndexes[$oldXfIndex] = $existingStyle->getIndex();
428  } else {
429  // we don't have such a cell Xf, need to add
430  $workbook->addCellXf($newStyle);
431  $newXfIndexes[$oldXfIndex] = $newStyle->getIndex();
432  }
433  }
434 
435  // Loop through columns, rows, or cells again and update the XF index
436  switch ($selectionType) {
437  case 'COLUMN':
438  for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
439  $columnDimension = $this->getActiveSheet()->getColumnDimensionByColumn($col);
440  $oldXfIndex = $columnDimension->getXfIndex();
441  $columnDimension->setXfIndex($newXfIndexes[$oldXfIndex]);
442  }
443  break;
444 
445  case 'ROW':
446  for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
447  $rowDimension = $this->getActiveSheet()->getRowDimension($row);
448  $oldXfIndex = $rowDimension->getXfIndex() === null ?
449  0 : $rowDimension->getXfIndex(); // row without explicit style should be formatted based on default style
450  $rowDimension->setXfIndex($newXfIndexes[$oldXfIndex]);
451  }
452  break;
453 
454  case 'CELL':
455  for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
456  for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
457  $cell = $this->getActiveSheet()->getCellByColumnAndRow($col, $row);
458  $oldXfIndex = $cell->getXfIndex();
459  $cell->setXfIndex($newXfIndexes[$oldXfIndex]);
460  }
461  }
462  break;
463  }
464 
465  } else {
466  // not a supervisor, just apply the style array directly on style object
467  if (array_key_exists('fill', $pStyles)) {
468  $this->getFill()->applyFromArray($pStyles['fill']);
469  }
470  if (array_key_exists('font', $pStyles)) {
471  $this->getFont()->applyFromArray($pStyles['font']);
472  }
473  if (array_key_exists('borders', $pStyles)) {
474  $this->getBorders()->applyFromArray($pStyles['borders']);
475  }
476  if (array_key_exists('alignment', $pStyles)) {
477  $this->getAlignment()->applyFromArray($pStyles['alignment']);
478  }
479  if (array_key_exists('numberformat', $pStyles)) {
480  $this->getNumberFormat()->applyFromArray($pStyles['numberformat']);
481  }
482  if (array_key_exists('protection', $pStyles)) {
483  $this->getProtection()->applyFromArray($pStyles['protection']);
484  }
485  if (array_key_exists('quotePrefix', $pStyles)) {
486  $this->_quotePrefix = $pStyles['quotePrefix'];
487  }
488  }
489  } else {
490  throw new PHPExcel_Exception("Invalid style array passed.");
491  }
492  return $this;
493  }
$style
Definition: example_012.php:70
static coordinateFromString($pCoordinateString='A1')
Coordinate from string.
Definition: Cell.php:580
$x
Definition: example_009.php:98
getSelectedCells()
Get the currently active cell coordinate in currently active sheet.
Definition: Supervisor.php:103
getProtection()
Get Protection.
Definition: Style.php:586
getBorders()
Get Borders.
Definition: Style.php:532
$y
Definition: example_007.php:83
Create styles array
The data for the language used.
getAlignment()
Get Alignment.
Definition: Style.php:542
getFill()
Get Fill.
Definition: Style.php:500
static columnIndexFromString($pString='A')
Column index from string.
Definition: Cell.php:782
static stringFromColumnIndex($pColumnIndex=0)
String from columnindex.
Definition: Cell.php:825
getNumberFormat()
Get Number Format.
Definition: Style.php:552
getActiveSheet()
Get the currently active sheet.
Definition: Supervisor.php:92
getFont()
Get Font.
Definition: Style.php:510
+ Here is the call graph for this function:

◆ getAlignment()

PHPExcel_Style::getAlignment ( )

Get Alignment.

Returns
PHPExcel_Style_Alignment

Definition at line 542 of file Style.php.

References $_alignment.

Referenced by PHPExcel_Writer_HTML\_createCSSStyle(), and applyFromArray().

543  {
544  return $this->_alignment;
545  }
+ Here is the caller graph for this function:

◆ getBorders()

PHPExcel_Style::getBorders ( )

Get Borders.

Returns
PHPExcel_Style_Borders

Definition at line 532 of file Style.php.

References $_borders.

Referenced by PHPExcel_Writer_HTML\_createCSSStyle(), and applyFromArray().

533  {
534  return $this->_borders;
535  }
+ Here is the caller graph for this function:

◆ getConditionalStyles()

PHPExcel_Style::getConditionalStyles ( )

Get Conditional Styles.

Only used on supervisor.

Returns
PHPExcel_Style_Conditional[]

Definition at line 562 of file Style.php.

References PHPExcel_Style_Supervisor\getActiveCell(), and PHPExcel_Style_Supervisor\getActiveSheet().

563  {
564  return $this->getActiveSheet()->getConditionalStyles($this->getActiveCell());
565  }
getActiveCell()
Get the currently active cell coordinate in currently active sheet.
Definition: Supervisor.php:114
getActiveSheet()
Get the currently active sheet.
Definition: Supervisor.php:92
+ Here is the call graph for this function:

◆ getFill()

PHPExcel_Style::getFill ( )

Get Fill.

Returns
PHPExcel_Style_Fill

Definition at line 500 of file Style.php.

References $_fill.

Referenced by PHPExcel_Writer_HTML\_createCSSStyle(), and applyFromArray().

501  {
502  return $this->_fill;
503  }
+ Here is the caller graph for this function:

◆ getFont()

PHPExcel_Style::getFont ( )

Get Font.

Returns
PHPExcel_Style_Font

Definition at line 510 of file Style.php.

References $_font.

Referenced by PHPExcel_Writer_HTML\_createCSSStyle(), applyFromArray(), and PHPExcel_Worksheet\setDefaultStyle().

511  {
512  return $this->_font;
513  }
+ Here is the caller graph for this function:

◆ getHashCode()

PHPExcel_Style::getHashCode ( )

Get hash code.

Returns
string Hash code

Implements PHPExcel_IComparable.

Definition at line 628 of file Style.php.

629  {
630  $hashConditionals = '';
631  foreach ($this->_conditionalStyles as $conditional) {
632  $hashConditionals .= $conditional->getHashCode();
633  }
634 
635  return md5(
636  $this->_fill->getHashCode()
637  . $this->_font->getHashCode()
638  . $this->_borders->getHashCode()
639  . $this->_alignment->getHashCode()
640  . $this->_numberFormat->getHashCode()
641  . $hashConditionals
642  . $this->_protection->getHashCode()
643  . ($this->_quotePrefix ? 't' : 'f')
644  . __CLASS__
645  );
646  }

◆ getIndex()

PHPExcel_Style::getIndex ( )

Get own index in style collection.

Returns
int

Definition at line 653 of file Style.php.

References $_index.

654  {
655  return $this->_index;
656  }

◆ getNumberFormat()

PHPExcel_Style::getNumberFormat ( )

Get Number Format.

Returns
PHPExcel_Style_NumberFormat

Definition at line 552 of file Style.php.

References $_numberFormat.

Referenced by applyFromArray().

553  {
554  return $this->_numberFormat;
555  }
+ Here is the caller graph for this function:

◆ getParent()

PHPExcel_Style::getParent ( )

Get parent.

Only used for style supervisor

Returns
PHPExcel

Definition at line 161 of file Style.php.

References PHPExcel_Style_Supervisor\$_parent.

162  {
163  return $this->_parent;
164  }

◆ getProtection()

PHPExcel_Style::getProtection ( )

Get Protection.

Returns
PHPExcel_Style_Protection

Definition at line 586 of file Style.php.

References $_protection.

Referenced by applyFromArray().

587  {
588  return $this->_protection;
589  }
+ Here is the caller graph for this function:

◆ getQuotePrefix()

PHPExcel_Style::getQuotePrefix ( )

Get quote prefix.

Returns
boolean

Definition at line 596 of file Style.php.

References $_quotePrefix, and getSharedComponent().

597  {
598  if ($this->_isSupervisor) {
599  return $this->getSharedComponent()->getQuotePrefix();
600  }
601  return $this->_quotePrefix;
602  }
getSharedComponent()
Get the shared style component for the currently active cell in currently active sheet.
Definition: Style.php:142
+ Here is the call graph for this function:

◆ getSharedComponent()

PHPExcel_Style::getSharedComponent ( )

Get the shared style component for the currently active cell in currently active sheet.

Only used for style supervisor

Returns
PHPExcel_Style

Definition at line 142 of file Style.php.

References PHPExcel_Style_Supervisor\getActiveCell(), and PHPExcel_Style_Supervisor\getActiveSheet().

Referenced by getQuotePrefix().

143  {
144  $activeSheet = $this->getActiveSheet();
145  $selectedCell = $this->getActiveCell(); // e.g. 'A1'
146 
147  if ($activeSheet->cellExists($selectedCell)) {
148  $xfIndex = $activeSheet->getCell($selectedCell)->getXfIndex();
149  } else {
150  $xfIndex = 0;
151  }
152 
153  return $this->_parent->getCellXfByIndex($xfIndex);
154  }
getActiveCell()
Get the currently active cell coordinate in currently active sheet.
Definition: Supervisor.php:114
getActiveSheet()
Get the currently active sheet.
Definition: Supervisor.php:92
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStyleArray()

PHPExcel_Style::getStyleArray (   $array)

Build style array from subcomponents.

Parameters
array$array
Returns
array

Definition at line 172 of file Style.php.

References array.

173  {
174  return array('quotePrefix' => $array);
175  }
Create styles array
The data for the language used.

◆ setConditionalStyles()

PHPExcel_Style::setConditionalStyles (   $pValue = null)

Set Conditional Styles.

Only used on supervisor.

Parameters
PHPExcel_Style_Conditional[]$pValue Array of condtional styles
Returns
PHPExcel_Style

Definition at line 573 of file Style.php.

References PHPExcel_Style_Supervisor\getActiveSheet(), and PHPExcel_Style_Supervisor\getSelectedCells().

574  {
575  if (is_array($pValue)) {
576  $this->getActiveSheet()->setConditionalStyles($this->getSelectedCells(), $pValue);
577  }
578  return $this;
579  }
getSelectedCells()
Get the currently active cell coordinate in currently active sheet.
Definition: Supervisor.php:103
getActiveSheet()
Get the currently active sheet.
Definition: Supervisor.php:92
+ Here is the call graph for this function:

◆ setFont()

PHPExcel_Style::setFont ( PHPExcel_Style_Font  $font)

Set font.

Parameters
PHPExcel_Style_Font$font
Returns
PHPExcel_Style

Definition at line 521 of file Style.php.

522  {
523  $this->_font = $font;
524  return $this;
525  }

◆ setIndex()

PHPExcel_Style::setIndex (   $pValue)

Set own index in style collection.

Parameters
int$pValue

Definition at line 663 of file Style.php.

Referenced by PHPExcel\addCellStyleXf(), and PHPExcel\addCellXf().

664  {
665  $this->_index = $pValue;
666  }
+ Here is the caller graph for this function:

◆ setQuotePrefix()

PHPExcel_Style::setQuotePrefix (   $pValue)

Set quote prefix.

Parameters
boolean$pValue

Definition at line 609 of file Style.php.

References array, PHPExcel_Style_Supervisor\getActiveSheet(), and PHPExcel_Style_Supervisor\getSelectedCells().

610  {
611  if ($pValue == '') {
612  $pValue = false;
613  }
614  if ($this->_isSupervisor) {
615  $styleArray = array('quotePrefix' => $pValue);
616  $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
617  } else {
618  $this->_quotePrefix = (boolean) $pValue;
619  }
620  return $this;
621  }
getSelectedCells()
Get the currently active cell coordinate in currently active sheet.
Definition: Supervisor.php:103
Create styles array
The data for the language used.
getActiveSheet()
Get the currently active sheet.
Definition: Supervisor.php:92
+ Here is the call graph for this function:

Field Documentation

◆ $_alignment

PHPExcel_Style::$_alignment
protected

Definition at line 64 of file Style.php.

Referenced by getAlignment().

◆ $_borders

PHPExcel_Style::$_borders
protected

Definition at line 57 of file Style.php.

Referenced by getBorders().

◆ $_conditionalStyles

PHPExcel_Style::$_conditionalStyles
protected

Definition at line 78 of file Style.php.

◆ $_fill

PHPExcel_Style::$_fill
protected

Definition at line 50 of file Style.php.

Referenced by getFill().

◆ $_font

PHPExcel_Style::$_font
protected

Definition at line 43 of file Style.php.

Referenced by getFont().

◆ $_index

PHPExcel_Style::$_index
protected

Definition at line 92 of file Style.php.

Referenced by getIndex().

◆ $_numberFormat

PHPExcel_Style::$_numberFormat
protected

Definition at line 71 of file Style.php.

Referenced by getNumberFormat().

◆ $_protection

PHPExcel_Style::$_protection
protected

Definition at line 85 of file Style.php.

Referenced by getProtection().

◆ $_quotePrefix

PHPExcel_Style::$_quotePrefix = false
protected

Definition at line 99 of file Style.php.

Referenced by getQuotePrefix().


The documentation for this class was generated from the following file: