You are here

private function PHPExcel_Writer_Excel2007_Style::_writePatternFill in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Style.php \PHPExcel_Writer_Excel2007_Style::_writePatternFill()

* Write Pattern Fill * *

Parameters

PHPExcel_Shared_XMLWriter $objWriter XML Writer: * @param PHPExcel_Style_Fill $pFill Fill style * @throws PHPExcel_Writer_Exception

1 call to PHPExcel_Writer_Excel2007_Style::_writePatternFill()
PHPExcel_Writer_Excel2007_Style::_writeFill in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Style.php
* Write Fill * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Style.php, line 239

Class

PHPExcel_Writer_Excel2007_Style
PHPExcel_Writer_Excel2007_Style

Code

private function _writePatternFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null) {

  // fill
  $objWriter
    ->startElement('fill');

  // patternFill
  $objWriter
    ->startElement('patternFill');
  $objWriter
    ->writeAttribute('patternType', $pFill
    ->getFillType());
  if ($pFill
    ->getFillType() !== PHPExcel_Style_Fill::FILL_NONE) {

    // fgColor
    if ($pFill
      ->getStartColor()
      ->getARGB()) {
      $objWriter
        ->startElement('fgColor');
      $objWriter
        ->writeAttribute('rgb', $pFill
        ->getStartColor()
        ->getARGB());
      $objWriter
        ->endElement();
    }
  }
  if ($pFill
    ->getFillType() !== PHPExcel_Style_Fill::FILL_NONE) {

    // bgColor
    if ($pFill
      ->getEndColor()
      ->getARGB()) {
      $objWriter
        ->startElement('bgColor');
      $objWriter
        ->writeAttribute('rgb', $pFill
        ->getEndColor()
        ->getARGB());
      $objWriter
        ->endElement();
    }
  }
  $objWriter
    ->endElement();
  $objWriter
    ->endElement();
}