ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
PHPExcel_Writer_Excel2007_Style Class Reference
+ Inheritance diagram for PHPExcel_Writer_Excel2007_Style:
+ Collaboration diagram for PHPExcel_Writer_Excel2007_Style:

Public Member Functions

 writeStyles (PHPExcel $pPHPExcel=null)
 Write styles to XML format.
 allStyles (PHPExcel $pPHPExcel=null)
 Get an array of all styles.
 allConditionalStyles (PHPExcel $pPHPExcel=null)
 Get an array of all conditional styles.
 allFills (PHPExcel $pPHPExcel=null)
 Get an array of all fills.
 allFonts (PHPExcel $pPHPExcel=null)
 Get an array of all fonts.
 allBorders (PHPExcel $pPHPExcel=null)
 Get an array of all borders.
 allNumberFormats (PHPExcel $pPHPExcel=null)
 Get an array of all number formats.
- Public Member Functions inherited from PHPExcel_Writer_Excel2007_WriterPart
 setParentWriter (PHPExcel_Writer_IWriter $pWriter=null)
 Set parent IWriter object.
 getParentWriter ()
 Get parent IWriter object.
 __construct (PHPExcel_Writer_IWriter $pWriter=null)
 Set parent IWriter object.

Private Member Functions

 _writeFill (PHPExcel_Shared_XMLWriter $objWriter=null, PHPExcel_Style_Fill $pFill=null)
 Write Fill.
 _writeGradientFill (PHPExcel_Shared_XMLWriter $objWriter=null, PHPExcel_Style_Fill $pFill=null)
 Write Gradient Fill.
 _writePatternFill (PHPExcel_Shared_XMLWriter $objWriter=null, PHPExcel_Style_Fill $pFill=null)
 Write Pattern Fill.
 _writeFont (PHPExcel_Shared_XMLWriter $objWriter=null, PHPExcel_Style_Font $pFont=null)
 Write Font.
 _writeBorder (PHPExcel_Shared_XMLWriter $objWriter=null, PHPExcel_Style_Borders $pBorders=null)
 Write Border.
 _writeCellStyleXf (PHPExcel_Shared_XMLWriter $objWriter=null, PHPExcel_Style $pStyle=null, PHPExcel $pPHPExcel=null)
 Write Cell Style Xf.
 _writeCellStyleDxf (PHPExcel_Shared_XMLWriter $objWriter=null, PHPExcel_Style $pStyle=null)
 Write Cell Style Dxf.
 _writeBorderPr (PHPExcel_Shared_XMLWriter $objWriter=null, $pName= 'left', PHPExcel_Style_Border $pBorder=null)
 Write BorderPr.
 _writeNumFmt (PHPExcel_Shared_XMLWriter $objWriter=null, PHPExcel_Style_NumberFormat $pNumberFormat=null, $pId=0)
 Write NumberFormat.

Detailed Description

Definition at line 36 of file Style.php.

Member Function Documentation

PHPExcel_Writer_Excel2007_Style::_writeBorder ( PHPExcel_Shared_XMLWriter  $objWriter = null,
PHPExcel_Style_Borders  $pBorders = null 
)
private

Write Border.

Parameters
PHPExcel_Shared_XMLWriter$objWriterXML Writer
PHPExcel_Style_Borders$pBordersBorders style
Exceptions
Exception

Definition at line 333 of file Style.php.

References _writeBorderPr(), PHPExcel_Style_Borders\DIAGONAL_BOTH, PHPExcel_Style_Borders\DIAGONAL_DOWN, and PHPExcel_Style_Borders\DIAGONAL_UP.

Referenced by _writeCellStyleDxf(), and writeStyles().

{
// Write border
$objWriter->startElement('border');
// Diagonal?
switch ($pBorders->getDiagonalDirection()) {
$objWriter->writeAttribute('diagonalUp', 'true');
$objWriter->writeAttribute('diagonalDown', 'false');
break;
$objWriter->writeAttribute('diagonalUp', 'false');
$objWriter->writeAttribute('diagonalDown', 'true');
break;
$objWriter->writeAttribute('diagonalUp', 'true');
$objWriter->writeAttribute('diagonalDown', 'true');
break;
}
// BorderPr
$this->_writeBorderPr($objWriter, 'left', $pBorders->getLeft());
$this->_writeBorderPr($objWriter, 'right', $pBorders->getRight());
$this->_writeBorderPr($objWriter, 'top', $pBorders->getTop());
$this->_writeBorderPr($objWriter, 'bottom', $pBorders->getBottom());
$this->_writeBorderPr($objWriter, 'diagonal', $pBorders->getDiagonal());
$objWriter->endElement();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Writer_Excel2007_Style::_writeBorderPr ( PHPExcel_Shared_XMLWriter  $objWriter = null,
  $pName = 'left',
PHPExcel_Style_Border  $pBorder = null 
)
private

Write BorderPr.

Parameters
PHPExcel_Shared_XMLWriter$objWriterXML Writer
string$pNameElement name
PHPExcel_Style_Border$pBorderBorder style
Exceptions
Exception

Definition at line 494 of file Style.php.

References PHPExcel_Style_Border\BORDER_NONE.

Referenced by _writeBorder().

{
// Write BorderPr
$objWriter->startElement($pName);
$objWriter->writeAttribute('style', $pBorder->getBorderStyle());
// color
$objWriter->startElement('color');
$objWriter->writeAttribute('rgb', $pBorder->getColor()->getARGB());
$objWriter->endElement();
$objWriter->endElement();
}
}

+ Here is the caller graph for this function:

PHPExcel_Writer_Excel2007_Style::_writeCellStyleDxf ( PHPExcel_Shared_XMLWriter  $objWriter = null,
PHPExcel_Style  $pStyle = null 
)
private

Write Cell Style Dxf.

Parameters
PHPExcel_Shared_XMLWriter$objWriterXML Writer
PHPExcel_Style$pStyleStyle
Exceptions
Exception

Definition at line 439 of file Style.php.

References _writeBorder(), _writeFill(), _writeFont(), _writeNumFmt(), PHPExcel_Style_Protection\PROTECTION_INHERIT, and PHPExcel_Style_Protection\PROTECTION_PROTECTED.

Referenced by writeStyles().

{
// 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');
$objWriter->writeAttribute('horizontal', $pStyle->getAlignment()->getHorizontal());
$objWriter->writeAttribute('vertical', $pStyle->getAlignment()->getVertical());
$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
$objWriter->startElement('protection');
$objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
}
$objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
}
$objWriter->endElement();
}
$objWriter->endElement();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Writer_Excel2007_Style::_writeCellStyleXf ( PHPExcel_Shared_XMLWriter  $objWriter = null,
PHPExcel_Style  $pStyle = null,
PHPExcel  $pPHPExcel = null 
)
private

Write Cell Style Xf.

Parameters
PHPExcel_Shared_XMLWriter$objWriterXML Writer
PHPExcel_Style$pStyleStyle
PHPExcel$pPHPExcelWorkbook
Exceptions
Exception

Definition at line 370 of file Style.php.

References PHPExcel_Writer_Excel2007_WriterPart\getParentWriter(), PHPExcel_Style_Protection\PROTECTION_INHERIT, and PHPExcel_Style_Protection\PROTECTION_PROTECTED.

Referenced by writeStyles().

{
// xf
$objWriter->startElement('xf');
$objWriter->writeAttribute('xfId', 0);
$objWriter->writeAttribute('fontId', (int)$this->getParentWriter()->getFontHashTable()->getIndexForHashCode($pStyle->getFont()->getHashCode()));
if ($pStyle->getNumberFormat()->getBuiltInFormatCode() === false) {
$objWriter->writeAttribute('numFmtId', (int)($this->getParentWriter()->getNumFmtHashTable()->getIndexForHashCode($pStyle->getNumberFormat()->getHashCode()) + 164) );
} else {
$objWriter->writeAttribute('numFmtId', (int)$pStyle->getNumberFormat()->getBuiltInFormatCode());
}
$objWriter->writeAttribute('fillId', (int)$this->getParentWriter()->getFillHashTable()->getIndexForHashCode($pStyle->getFill()->getHashCode()));
$objWriter->writeAttribute('borderId', (int)$this->getParentWriter()->getBordersHashTable()->getIndexForHashCode($pStyle->getBorders()->getHashCode()));
// Apply styles?
$objWriter->writeAttribute('applyFont', ($pPHPExcel->getDefaultStyle()->getFont()->getHashCode() != $pStyle->getFont()->getHashCode()) ? '1' : '0');
$objWriter->writeAttribute('applyNumberFormat', ($pPHPExcel->getDefaultStyle()->getNumberFormat()->getHashCode() != $pStyle->getNumberFormat()->getHashCode()) ? '1' : '0');
$objWriter->writeAttribute('applyFill', ($pPHPExcel->getDefaultStyle()->getFill()->getHashCode() != $pStyle->getFill()->getHashCode()) ? '1' : '0');
$objWriter->writeAttribute('applyBorder', ($pPHPExcel->getDefaultStyle()->getBorders()->getHashCode() != $pStyle->getBorders()->getHashCode()) ? '1' : '0');
$objWriter->writeAttribute('applyAlignment', ($pPHPExcel->getDefaultStyle()->getAlignment()->getHashCode() != $pStyle->getAlignment()->getHashCode()) ? '1' : '0');
$objWriter->writeAttribute('applyProtection', 'true');
}
// alignment
$objWriter->startElement('alignment');
$objWriter->writeAttribute('horizontal', $pStyle->getAlignment()->getHorizontal());
$objWriter->writeAttribute('vertical', $pStyle->getAlignment()->getVertical());
$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->writeAttribute('wrapText', ($pStyle->getAlignment()->getWrapText() ? 'true' : 'false'));
$objWriter->writeAttribute('shrinkToFit', ($pStyle->getAlignment()->getShrinkToFit() ? 'true' : 'false'));
if ($pStyle->getAlignment()->getIndent() > 0) {
$objWriter->writeAttribute('indent', $pStyle->getAlignment()->getIndent());
}
$objWriter->endElement();
// protection
$objWriter->startElement('protection');
$objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
}
$objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
}
$objWriter->endElement();
}
$objWriter->endElement();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Writer_Excel2007_Style::_writeFill ( PHPExcel_Shared_XMLWriter  $objWriter = null,
PHPExcel_Style_Fill  $pFill = null 
)
private

Write Fill.

Parameters
PHPExcel_Shared_XMLWriter$objWriterXML Writer
PHPExcel_Style_Fill$pFillFill style
Exceptions
Exception

Definition at line 175 of file Style.php.

References _writeGradientFill(), _writePatternFill(), PHPExcel_Style_Fill\FILL_GRADIENT_LINEAR, and PHPExcel_Style_Fill\FILL_GRADIENT_PATH.

Referenced by _writeCellStyleDxf(), and writeStyles().

{
// Check if this is a pattern type or gradient type
// Gradient fill
$this->_writeGradientFill($objWriter, $pFill);
} else {
// Pattern fill
$this->_writePatternFill($objWriter, $pFill);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

PHPExcel_Writer_Excel2007_Style::_writeFont ( PHPExcel_Shared_XMLWriter  $objWriter = null,
PHPExcel_Style_Font  $pFont = null 
)
private

Write Font.

Parameters
PHPExcel_Shared_XMLWriter$objWriterXML Writer
PHPExcel_Style_Font$pFontFont style
Exceptions
Exception

Definition at line 270 of file Style.php.

Referenced by _writeCellStyleDxf(), and writeStyles().

{
// font
$objWriter->startElement('font');
// Name
$objWriter->startElement('name');
$objWriter->writeAttribute('val', $pFont->getName());
$objWriter->endElement();
// Size
$objWriter->startElement('sz');
$objWriter->writeAttribute('val', $pFont->getSize());
$objWriter->endElement();
// Bold. We explicitly write this element also when false (like MS Office Excel 2007 does
// for conditional formatting). Otherwise it will apparently not be picked up in conditional
// formatting style dialog
$objWriter->startElement('b');
$objWriter->writeAttribute('val', $pFont->getBold() ? '1' : '0');
$objWriter->endElement();
// Italic
$objWriter->startElement('i');
$objWriter->writeAttribute('val', $pFont->getItalic() ? '1' : '0');
$objWriter->endElement();
// Superscript / subscript
if ($pFont->getSuperScript() || $pFont->getSubScript()) {
$objWriter->startElement('vertAlign');
if ($pFont->getSuperScript()) {
$objWriter->writeAttribute('val', 'superscript');
} else if ($pFont->getSubScript()) {
$objWriter->writeAttribute('val', 'subscript');
}
$objWriter->endElement();
}
// Underline
$objWriter->startElement('u');
$objWriter->writeAttribute('val', $pFont->getUnderline());
$objWriter->endElement();
// Strikethrough
$objWriter->startElement('strike');
$objWriter->writeAttribute('val', $pFont->getStrikethrough() ? '1' : '0');
$objWriter->endElement();
// Foreground color
$objWriter->startElement('color');
$objWriter->writeAttribute('rgb', $pFont->getColor()->getARGB());
$objWriter->endElement();
$objWriter->endElement();
}

+ Here is the caller graph for this function:

PHPExcel_Writer_Excel2007_Style::_writeGradientFill ( PHPExcel_Shared_XMLWriter  $objWriter = null,
PHPExcel_Style_Fill  $pFill = null 
)
private

Write Gradient Fill.

Parameters
PHPExcel_Shared_XMLWriter$objWriterXML Writer
PHPExcel_Style_Fill$pFillFill style
Exceptions
Exception

Definition at line 195 of file Style.php.

Referenced by _writeFill().

{
// fill
$objWriter->startElement('fill');
// gradientFill
$objWriter->startElement('gradientFill');
$objWriter->writeAttribute('type', $pFill->getFillType());
$objWriter->writeAttribute('degree', $pFill->getRotation());
// stop
$objWriter->startElement('stop');
$objWriter->writeAttribute('position', '0');
// color
$objWriter->startElement('color');
$objWriter->writeAttribute('rgb', $pFill->getStartColor()->getARGB());
$objWriter->endElement();
$objWriter->endElement();
// stop
$objWriter->startElement('stop');
$objWriter->writeAttribute('position', '1');
// color
$objWriter->startElement('color');
$objWriter->writeAttribute('rgb', $pFill->getEndColor()->getARGB());
$objWriter->endElement();
$objWriter->endElement();
$objWriter->endElement();
$objWriter->endElement();
}

+ Here is the caller graph for this function:

PHPExcel_Writer_Excel2007_Style::_writeNumFmt ( PHPExcel_Shared_XMLWriter  $objWriter = null,
PHPExcel_Style_NumberFormat  $pNumberFormat = null,
  $pId = 0 
)
private

Write NumberFormat.

Parameters
PHPExcel_Shared_XMLWriter$objWriterXML Writer
PHPExcel_Style_NumberFormat$pNumberFormatNumber Format
int$pIdNumber Format identifier
Exceptions
Exception

Definition at line 518 of file Style.php.

Referenced by _writeCellStyleDxf(), and writeStyles().

{
// Translate formatcode
$formatCode = $pNumberFormat->getFormatCode();
// numFmt
$objWriter->startElement('numFmt');
$objWriter->writeAttribute('numFmtId', ($pId + 164));
$objWriter->writeAttribute('formatCode', $formatCode);
$objWriter->endElement();
}

+ Here is the caller graph for this function:

PHPExcel_Writer_Excel2007_Style::_writePatternFill ( PHPExcel_Shared_XMLWriter  $objWriter = null,
PHPExcel_Style_Fill  $pFill = null 
)
private

Write Pattern Fill.

Parameters
PHPExcel_Shared_XMLWriter$objWriterXML Writer
PHPExcel_Style_Fill$pFillFill style
Exceptions
Exception

Definition at line 239 of file Style.php.

Referenced by _writeFill().

{
// fill
$objWriter->startElement('fill');
// patternFill
$objWriter->startElement('patternFill');
$objWriter->writeAttribute('patternType', $pFill->getFillType());
// fgColor
$objWriter->startElement('fgColor');
$objWriter->writeAttribute('rgb', $pFill->getStartColor()->getARGB());
$objWriter->endElement();
// bgColor
$objWriter->startElement('bgColor');
$objWriter->writeAttribute('rgb', $pFill->getEndColor()->getARGB());
$objWriter->endElement();
$objWriter->endElement();
$objWriter->endElement();
}

+ Here is the caller graph for this function:

PHPExcel_Writer_Excel2007_Style::allBorders ( PHPExcel  $pPHPExcel = null)

Get an array of all borders.

Parameters
PHPExcel$pPHPExcel
Returns
PHPExcel_Style_Borders[] All borders in PHPExcel
Exceptions
Exception

Definition at line 629 of file Style.php.

References allStyles().

{
// Get an array of unique borders
$aBorders = array();
$aStyles = $this->allStyles($pPHPExcel);
foreach ($aStyles as $style) {
if (!array_key_exists($style->getBorders()->getHashCode(), $aBorders)) {
$aBorders[ $style->getBorders()->getHashCode() ] = $style->getBorders();
}
}
return $aBorders;
}

+ Here is the call graph for this function:

PHPExcel_Writer_Excel2007_Style::allConditionalStyles ( PHPExcel  $pPHPExcel = null)

Get an array of all conditional styles.

Parameters
PHPExcel$pPHPExcel
Returns
PHPExcel_Style_Conditional[] All conditional styles in PHPExcel
Exceptions
Exception

Definition at line 551 of file Style.php.

{
// Get an array of all styles
$aStyles = array();
$sheetCount = $pPHPExcel->getSheetCount();
for ($i = 0; $i < $sheetCount; ++$i) {
foreach ($pPHPExcel->getSheet($i)->getConditionalStylesCollection() as $conditionalStyles) {
foreach ($conditionalStyles as $conditionalStyle) {
$aStyles[] = $conditionalStyle;
}
}
}
return $aStyles;
}
PHPExcel_Writer_Excel2007_Style::allFills ( PHPExcel  $pPHPExcel = null)

Get an array of all fills.

Parameters
PHPExcel$pPHPExcel
Returns
PHPExcel_Style_Fill[] All fills in PHPExcel
Exceptions
Exception

Definition at line 575 of file Style.php.

References allStyles(), PHPExcel_Style_Fill\FILL_NONE, and PHPExcel_Style_Fill\FILL_PATTERN_GRAY125.

{
// Get an array of unique fills
$aFills = array();
// Two first fills are predefined
$fill0 = new PHPExcel_Style_Fill();
$fill0->setFillType(PHPExcel_Style_Fill::FILL_NONE);
$aFills[] = $fill0;
$fill1 = new PHPExcel_Style_Fill();
$aFills[] = $fill1;
// The remaining fills
$aStyles = $this->allStyles($pPHPExcel);
foreach ($aStyles as $style) {
if (!array_key_exists($style->getFill()->getHashCode(), $aFills)) {
$aFills[ $style->getFill()->getHashCode() ] = $style->getFill();
}
}
return $aFills;
}

+ Here is the call graph for this function:

PHPExcel_Writer_Excel2007_Style::allFonts ( PHPExcel  $pPHPExcel = null)

Get an array of all fonts.

Parameters
PHPExcel$pPHPExcel
Returns
PHPExcel_Style_Font[] All fonts in PHPExcel
Exceptions
Exception

Definition at line 607 of file Style.php.

References allStyles().

{
// Get an array of unique fonts
$aFonts = array();
$aStyles = $this->allStyles($pPHPExcel);
foreach ($aStyles as $style) {
if (!array_key_exists($style->getFont()->getHashCode(), $aFonts)) {
$aFonts[ $style->getFont()->getHashCode() ] = $style->getFont();
}
}
return $aFonts;
}

+ Here is the call graph for this function:

PHPExcel_Writer_Excel2007_Style::allNumberFormats ( PHPExcel  $pPHPExcel = null)

Get an array of all number formats.

Parameters
PHPExcel$pPHPExcel
Returns
PHPExcel_Style_NumberFormat[] All number formats in PHPExcel
Exceptions
Exception

Definition at line 651 of file Style.php.

References allStyles().

{
// Get an array of unique number formats
$aNumFmts = array();
$aStyles = $this->allStyles($pPHPExcel);
foreach ($aStyles as $style) {
if ($style->getNumberFormat()->getBuiltInFormatCode() === false && !array_key_exists($style->getNumberFormat()->getHashCode(), $aNumFmts)) {
$aNumFmts[ $style->getNumberFormat()->getHashCode() ] = $style->getNumberFormat();
}
}
return $aNumFmts;
}

+ Here is the call graph for this function:

PHPExcel_Writer_Excel2007_Style::allStyles ( PHPExcel  $pPHPExcel = null)

Get an array of all styles.

Parameters
PHPExcel$pPHPExcel
Returns
PHPExcel_Style[] All styles in PHPExcel
Exceptions
Exception

Definition at line 537 of file Style.php.

Referenced by allBorders(), allFills(), allFonts(), and allNumberFormats().

{
$aStyles = $pPHPExcel->getCellXfCollection();
return $aStyles;
}

+ Here is the caller graph for this function:

PHPExcel_Writer_Excel2007_Style::writeStyles ( PHPExcel  $pPHPExcel = null)

Write styles to XML format.

Parameters
PHPExcel$pPHPExcel
Returns
string XML Output
Exceptions
Exception

Definition at line 45 of file Style.php.

References _writeBorder(), _writeCellStyleDxf(), _writeCellStyleXf(), _writeFill(), _writeFont(), _writeNumFmt(), PHPExcel_Writer_Excel2007_WriterPart\getParentWriter(), PHPExcel_Shared_XMLWriter\STORAGE_DISK, and PHPExcel_Shared_XMLWriter\STORAGE_MEMORY.

{
// Create XML writer
$objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) {
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
} else {
}
// XML header
$objWriter->startDocument('1.0','UTF-8','yes');
// styleSheet
$objWriter->startElement('styleSheet');
$objWriter->writeAttribute('xml:space', 'preserve');
$objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main');
// numFmts
$objWriter->startElement('numFmts');
$objWriter->writeAttribute('count', $this->getParentWriter()->getNumFmtHashTable()->count());
// numFmt
for ($i = 0; $i < $this->getParentWriter()->getNumFmtHashTable()->count(); ++$i) {
$this->_writeNumFmt($objWriter, $this->getParentWriter()->getNumFmtHashTable()->getByIndex($i), $i);
}
$objWriter->endElement();
// fonts
$objWriter->startElement('fonts');
$objWriter->writeAttribute('count', $this->getParentWriter()->getFontHashTable()->count());
// font
for ($i = 0; $i < $this->getParentWriter()->getFontHashTable()->count(); ++$i) {
$this->_writeFont($objWriter, $this->getParentWriter()->getFontHashTable()->getByIndex($i));
}
$objWriter->endElement();
// fills
$objWriter->startElement('fills');
$objWriter->writeAttribute('count', $this->getParentWriter()->getFillHashTable()->count());
// fill
for ($i = 0; $i < $this->getParentWriter()->getFillHashTable()->count(); ++$i) {
$this->_writeFill($objWriter, $this->getParentWriter()->getFillHashTable()->getByIndex($i));
}
$objWriter->endElement();
// borders
$objWriter->startElement('borders');
$objWriter->writeAttribute('count', $this->getParentWriter()->getBordersHashTable()->count());
// border
for ($i = 0; $i < $this->getParentWriter()->getBordersHashTable()->count(); ++$i) {
$this->_writeBorder($objWriter, $this->getParentWriter()->getBordersHashTable()->getByIndex($i));
}
$objWriter->endElement();
// cellStyleXfs
$objWriter->startElement('cellStyleXfs');
$objWriter->writeAttribute('count', 1);
// xf
$objWriter->startElement('xf');
$objWriter->writeAttribute('numFmtId', 0);
$objWriter->writeAttribute('fontId', 0);
$objWriter->writeAttribute('fillId', 0);
$objWriter->writeAttribute('borderId', 0);
$objWriter->endElement();
$objWriter->endElement();
// cellXfs
$objWriter->startElement('cellXfs');
$objWriter->writeAttribute('count', count($pPHPExcel->getCellXfCollection()));
// xf
foreach ($pPHPExcel->getCellXfCollection() as $cellXf) {
$this->_writeCellStyleXf($objWriter, $cellXf, $pPHPExcel);
}
$objWriter->endElement();
// cellStyles
$objWriter->startElement('cellStyles');
$objWriter->writeAttribute('count', 1);
// cellStyle
$objWriter->startElement('cellStyle');
$objWriter->writeAttribute('name', 'Normal');
$objWriter->writeAttribute('xfId', 0);
$objWriter->writeAttribute('builtinId', 0);
$objWriter->endElement();
$objWriter->endElement();
// dxfs
$objWriter->startElement('dxfs');
$objWriter->writeAttribute('count', $this->getParentWriter()->getStylesConditionalHashTable()->count());
// dxf
for ($i = 0; $i < $this->getParentWriter()->getStylesConditionalHashTable()->count(); ++$i) {
$this->_writeCellStyleDxf($objWriter, $this->getParentWriter()->getStylesConditionalHashTable()->getByIndex($i)->getStyle());
}
$objWriter->endElement();
// tableStyles
$objWriter->startElement('tableStyles');
$objWriter->writeAttribute('defaultTableStyle', 'TableStyleMedium9');
$objWriter->writeAttribute('defaultPivotStyle', 'PivotTableStyle1');
$objWriter->endElement();
$objWriter->endElement();
// Return
return $objWriter->getData();
}

+ Here is the call graph for this function:


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