Beispiel #1
0
 /**
  * @access 	protected
  * @param 	TableCell		$cell					
  * @param 	array			$styles					
  * @return	array									
  */
 protected function _getUsedCellStyles($cell, &$styles)
 {
     // Styles relatifs aux cellules (+2 parce qu'on commence au style ce2)
     $strdecimal = '';
     $str = '';
     $str .= $cell->getBackgroundColor() ? $cell->getBackgroundColor() : '';
     $str .= $cell->getBorderBottom() ? $cell->getBorderBottom() : '';
     $str .= $cell->getBorderLeft() ? $cell->getBorderLeft() : '';
     $str .= $cell->getBorderRight() ? $cell->getBorderRight() : '';
     $str .= $cell->getBorderTop() ? $cell->getBorderTop() : '';
     $str .= $cell->getFontStyle() ? $cell->getFontStyle() : '';
     $str .= $cell->getFontSize() ? $cell->getFontSize() : '';
     $str .= $cell->getFontFamily() ? $cell->getFontFamily() : '';
     $str .= $cell->getFontWeight() ? $cell->getFontWeight() : '';
     $str .= $cell->getTextAlign() ? $cell->getTextAlign() : '';
     $str .= $cell->getVerticalAlign() ? $cell->getVerticalAlign() : '';
     $str .= $cell->getColor() ? $cell->getColor() : '';
     $str .= $cell->getDecimal() ? $cell->getDecimal() : '';
     if ($cell->getDecimal() && !in_array($cell->getDecimal(), $styles['numused'])) {
         $styles['numused'][] = $cell->getDecimal();
         $strdecimal = array('val' => $cell->getDecimal(), 'pos' => 'N' . count($styles['numused']));
     }
     if (!in_array($str, $styles['celused']) && $str != '') {
         $used['cel'] = 'ce' . (count($styles['cel']) + 2);
         $styles['celused'][] = $str;
         $styles['cel'][] = array('name' => $used['cel'], 'backgroundColor' => $cell->getBackgroundColor(), 'borderBottom' => $cell->getBorderBottom(), 'borderLeft' => $cell->getBorderLeft(), 'borderRight' => $cell->getBorderRight(), 'borderTop' => $cell->getBorderTop(), 'color' => $cell->getColor(), 'fontStyle' => $cell->getFontStyle(), 'fontSize' => $cell->getFontSize(), 'fontFamily' => $cell->getFontFamily(), 'fontWeight' => $cell->getFontWeight(), 'textAlign' => $cell->getTextAlign(), 'verticalAlign' => $cell->getVerticalAlign(), 'decimal' => $strdecimal);
     } else {
         $used['cel'] = $str != '' ? 'ce' . (array_search($str, $styles['celused']) + 2) : 'ce1';
     }
     // Styles relatifs aux lignes (+2 parce qu'on commence au style ro2)
     $str = '';
     $str .= $cell->getHeight() ? $cell->getHeight() : '';
     if (!in_array($str, $styles['rowused']) && $str != '') {
         $used['row'] = 'ro' . (count($styles['row']) + 2);
         $styles['rowused'][] = $str;
         $styles['row'][] = array('name' => $used['row'], 'height' => $cell->getHeight());
     } else {
         $used['row'] = $str != '' ? 'ro' . (array_search($str, $styles['rowused']) + 2) : 'ro1';
     }
     // Styles relatifs aux colonnes (+2 parce qu'on commence au style co2)
     $str = '';
     $str .= $cell->getWidth() ? $cell->getWidth() : '';
     if (!in_array($str, $styles['colused']) && $str != '') {
         $used['col'] = 'co' . (count($styles['col']) + 2);
         $styles['colused'][] = $str;
         $styles['col'][] = array('name' => $used['col'], 'width' => $cell->getWidth());
     } else {
         $used['col'] = $str != '' ? 'co' . (array_search($str, $styles['colused']) + 2) : 'co1';
     }
     return $used;
 }