You are here

private function PHPExcel_Writer_Excel2007_Style::_writeCellStyleDxf 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::_writeCellStyleDxf()

* Write Cell Style Dxf * *

Parameters

PHPExcel_Shared_XMLWriter $objWriter XML Writer: * @param PHPExcel_Style $pStyle Style * @throws PHPExcel_Writer_Exception

1 call to PHPExcel_Writer_Excel2007_Style::_writeCellStyleDxf()
PHPExcel_Writer_Excel2007_Style::writeStyles in vendor/phpoffice/phpexcel/Classes/PHPExcel/Writer/Excel2007/Style.php
* Write styles to XML format * *

File

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

Class

PHPExcel_Writer_Excel2007_Style
PHPExcel_Writer_Excel2007_Style

Code

private function _writeCellStyleDxf(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style $pStyle = null) {

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

  // font
  $this
    ->_writeFont($objWriter, $pStyle
    ->getFont());

  // numFmt
  $this
    ->_writeNumFmt($objWriter, $pStyle
    ->getNumberFormat());

  // fill
  $this
    ->_writeFill($objWriter, $pStyle
    ->getFill());

  // alignment
  $objWriter
    ->startElement('alignment');
  if ($pStyle
    ->getAlignment()
    ->getHorizontal() !== NULL) {
    $objWriter
      ->writeAttribute('horizontal', $pStyle
      ->getAlignment()
      ->getHorizontal());
  }
  if ($pStyle
    ->getAlignment()
    ->getVertical() !== NULL) {
    $objWriter
      ->writeAttribute('vertical', $pStyle
      ->getAlignment()
      ->getVertical());
  }
  if ($pStyle
    ->getAlignment()
    ->getTextRotation() !== NULL) {
    $textRotation = 0;
    if ($pStyle
      ->getAlignment()
      ->getTextRotation() >= 0) {
      $textRotation = $pStyle
        ->getAlignment()
        ->getTextRotation();
    }
    else {
      if ($pStyle
        ->getAlignment()
        ->getTextRotation() < 0) {
        $textRotation = 90 - $pStyle
          ->getAlignment()
          ->getTextRotation();
      }
    }
    $objWriter
      ->writeAttribute('textRotation', $textRotation);
  }
  $objWriter
    ->endElement();

  // border
  $this
    ->_writeBorder($objWriter, $pStyle
    ->getBorders());

  // protection
  if ($pStyle
    ->getProtection()
    ->getLocked() !== NULL || $pStyle
    ->getProtection()
    ->getHidden() !== NULL) {
    if ($pStyle
      ->getProtection()
      ->getLocked() !== PHPExcel_Style_Protection::PROTECTION_INHERIT || $pStyle
      ->getProtection()
      ->getHidden() !== PHPExcel_Style_Protection::PROTECTION_INHERIT) {
      $objWriter
        ->startElement('protection');
      if ($pStyle
        ->getProtection()
        ->getLocked() !== NULL && $pStyle
        ->getProtection()
        ->getLocked() !== PHPExcel_Style_Protection::PROTECTION_INHERIT) {
        $objWriter
          ->writeAttribute('locked', $pStyle
          ->getProtection()
          ->getLocked() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false');
      }
      if ($pStyle
        ->getProtection()
        ->getHidden() !== NULL && $pStyle
        ->getProtection()
        ->getHidden() !== PHPExcel_Style_Protection::PROTECTION_INHERIT) {
        $objWriter
          ->writeAttribute('hidden', $pStyle
          ->getProtection()
          ->getHidden() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false');
      }
      $objWriter
        ->endElement();
    }
  }
  $objWriter
    ->endElement();
}