5
* Copyright (c) 2006 - 2009 PHPExcel
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Lesser General Public
9
* License as published by the Free Software Foundation; either
10
* version 2.1 of the License, or (at your option) any later version.
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Lesser General Public License for more details.
17
* You should have received a copy of the GNU Lesser General Public
18
* License along with this library; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22
* @package PHPExcel_Writer_Excel2007
23
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
24
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
25
* @version 1.7.0, 2009-08-10
29
/** PHPExcel root directory */
30
if (!defined('PHPEXCEL_ROOT')) {
34
define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../../../');
38
require_once PHPEXCEL_ROOT . 'PHPExcel.php';
40
/** PHPExcel_Writer_Excel2007 */
41
require_once PHPEXCEL_ROOT . 'PHPExcel/Writer/Excel2007.php';
43
/** PHPExcel_Writer_Excel2007_WriterPart */
44
require_once PHPEXCEL_ROOT . 'PHPExcel/Writer/Excel2007/WriterPart.php';
47
require_once PHPEXCEL_ROOT . 'PHPExcel/Style.php';
49
/** PHPExcel_Style_Borders */
50
require_once PHPEXCEL_ROOT . 'PHPExcel/Style/Borders.php';
52
/** PHPExcel_Style_Border */
53
require_once PHPEXCEL_ROOT . 'PHPExcel/Style/Border.php';
55
/** PHPExcel_Style_Color */
56
require_once PHPEXCEL_ROOT . 'PHPExcel/Style/Color.php';
58
/** PHPExcel_Style_Fill */
59
require_once PHPEXCEL_ROOT . 'PHPExcel/Style/Fill.php';
61
/** PHPExcel_Style_Font */
62
require_once PHPEXCEL_ROOT . 'PHPExcel/Style/Font.php';
64
/** PHPExcel_Style_NumberFormat */
65
require_once PHPEXCEL_ROOT . 'PHPExcel/Style/NumberFormat.php';
67
/** PHPExcel_Style_Conditional */
68
require_once PHPEXCEL_ROOT . 'PHPExcel/Style/Conditional.php';
70
/** PHPExcel_Style_Protection */
71
require_once PHPEXCEL_ROOT . 'PHPExcel/Style/Protection.php';
73
/** PHPExcel_Shared_XMLWriter */
74
require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/XMLWriter.php';
78
* PHPExcel_Writer_Excel2007_Style
81
* @package PHPExcel_Writer_Excel2007
82
* @copyright Copyright (c) 2006 - 2009 PHPExcel (http://www.codeplex.com/PHPExcel)
84
class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPart
87
* Write styles to XML format
89
* @param PHPExcel $pPHPExcel
90
* @return string XML Output
93
public function writeStyles(PHPExcel $pPHPExcel = null)
97
if ($this->getParentWriter()->getUseDiskCaching()) {
98
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
100
$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
104
$objWriter->startDocument('1.0','UTF-8','yes');
107
$objWriter->startElement('styleSheet');
108
$objWriter->writeAttribute('xml:space', 'preserve');
109
$objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main');
112
$objWriter->startElement('numFmts');
113
$objWriter->writeAttribute('count', $this->getParentWriter()->getNumFmtHashTable()->count());
116
for ($i = 0; $i < $this->getParentWriter()->getNumFmtHashTable()->count(); ++$i) {
117
$this->_writeNumFmt($objWriter, $this->getParentWriter()->getNumFmtHashTable()->getByIndex($i), $i);
120
$objWriter->endElement();
123
$objWriter->startElement('fonts');
124
$objWriter->writeAttribute('count', $this->getParentWriter()->getFontHashTable()->count());
127
for ($i = 0; $i < $this->getParentWriter()->getFontHashTable()->count(); ++$i) {
128
$this->_writeFont($objWriter, $this->getParentWriter()->getFontHashTable()->getByIndex($i));
131
$objWriter->endElement();
134
$objWriter->startElement('fills');
135
$objWriter->writeAttribute('count', $this->getParentWriter()->getFillHashTable()->count());
138
for ($i = 0; $i < $this->getParentWriter()->getFillHashTable()->count(); ++$i) {
139
$this->_writeFill($objWriter, $this->getParentWriter()->getFillHashTable()->getByIndex($i));
142
$objWriter->endElement();
145
$objWriter->startElement('borders');
146
$objWriter->writeAttribute('count', $this->getParentWriter()->getBordersHashTable()->count());
149
for ($i = 0; $i < $this->getParentWriter()->getBordersHashTable()->count(); ++$i) {
150
$this->_writeBorder($objWriter, $this->getParentWriter()->getBordersHashTable()->getByIndex($i));
153
$objWriter->endElement();
156
$objWriter->startElement('cellStyleXfs');
157
$objWriter->writeAttribute('count', 1);
160
$objWriter->startElement('xf');
161
$objWriter->writeAttribute('numFmtId', 0);
162
$objWriter->writeAttribute('fontId', 0);
163
$objWriter->writeAttribute('fillId', 0);
164
$objWriter->writeAttribute('borderId', 0);
165
$objWriter->endElement();
167
$objWriter->endElement();
170
$objWriter->startElement('cellXfs');
171
$objWriter->writeAttribute('count', count($pPHPExcel->getCellXfCollection()));
174
foreach ($pPHPExcel->getCellXfCollection() as $cellXf) {
175
$this->_writeCellStyleXf($objWriter, $cellXf, $pPHPExcel);
178
$objWriter->endElement();
181
$objWriter->startElement('cellStyles');
182
$objWriter->writeAttribute('count', 1);
185
$objWriter->startElement('cellStyle');
186
$objWriter->writeAttribute('name', 'Normal');
187
$objWriter->writeAttribute('xfId', 0);
188
$objWriter->writeAttribute('builtinId', 0);
189
$objWriter->endElement();
191
$objWriter->endElement();
194
$objWriter->startElement('dxfs');
195
$objWriter->writeAttribute('count', $this->getParentWriter()->getStylesConditionalHashTable()->count());
198
for ($i = 0; $i < $this->getParentWriter()->getStylesConditionalHashTable()->count(); ++$i) {
199
$this->_writeCellStyleDxf($objWriter, $this->getParentWriter()->getStylesConditionalHashTable()->getByIndex($i)->getStyle());
202
$objWriter->endElement();
205
$objWriter->startElement('tableStyles');
206
$objWriter->writeAttribute('defaultTableStyle', 'TableStyleMedium9');
207
$objWriter->writeAttribute('defaultPivotStyle', 'PivotTableStyle1');
208
$objWriter->endElement();
210
$objWriter->endElement();
213
return $objWriter->getData();
219
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
220
* @param PHPExcel_Style_Fill $pFill Fill style
223
private function _writeFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null)
225
// Check if this is a pattern type or gradient type
226
if ($pFill->getFillType() == PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR
227
|| $pFill->getFillType() == PHPExcel_Style_Fill::FILL_GRADIENT_PATH) {
229
$this->_writeGradientFill($objWriter, $pFill);
232
$this->_writePatternFill($objWriter, $pFill);
237
* Write Gradient Fill
239
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
240
* @param PHPExcel_Style_Fill $pFill Fill style
243
private function _writeGradientFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null)
246
$objWriter->startElement('fill');
249
$objWriter->startElement('gradientFill');
250
$objWriter->writeAttribute('type', $pFill->getFillType());
251
$objWriter->writeAttribute('degree', $pFill->getRotation());
254
$objWriter->startElement('stop');
255
$objWriter->writeAttribute('position', '0');
258
$objWriter->startElement('color');
259
$objWriter->writeAttribute('rgb', $pFill->getStartColor()->getARGB());
260
$objWriter->endElement();
262
$objWriter->endElement();
265
$objWriter->startElement('stop');
266
$objWriter->writeAttribute('position', '1');
269
$objWriter->startElement('color');
270
$objWriter->writeAttribute('rgb', $pFill->getEndColor()->getARGB());
271
$objWriter->endElement();
273
$objWriter->endElement();
275
$objWriter->endElement();
277
$objWriter->endElement();
283
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
284
* @param PHPExcel_Style_Fill $pFill Fill style
287
private function _writePatternFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null)
290
$objWriter->startElement('fill');
293
$objWriter->startElement('patternFill');
294
$objWriter->writeAttribute('patternType', $pFill->getFillType());
297
$objWriter->startElement('fgColor');
298
$objWriter->writeAttribute('rgb', $pFill->getStartColor()->getARGB());
299
$objWriter->endElement();
302
$objWriter->startElement('bgColor');
303
$objWriter->writeAttribute('rgb', $pFill->getEndColor()->getARGB());
304
$objWriter->endElement();
306
$objWriter->endElement();
308
$objWriter->endElement();
314
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
315
* @param PHPExcel_Style_Font $pFont Font style
318
private function _writeFont(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Font $pFont = null)
321
$objWriter->startElement('font');
324
$objWriter->startElement('name');
325
$objWriter->writeAttribute('val', $pFont->getName());
326
$objWriter->endElement();
329
$objWriter->startElement('sz');
330
$objWriter->writeAttribute('val', $pFont->getSize());
331
$objWriter->endElement();
334
if ($pFont->getBold()) {
335
$objWriter->startElement('b');
336
$objWriter->writeAttribute('val', 'true');
337
$objWriter->endElement();
341
if ($pFont->getItalic()) {
342
$objWriter->startElement('i');
343
$objWriter->writeAttribute('val', 'true');
344
$objWriter->endElement();
347
// Superscript / subscript
348
if ($pFont->getSuperScript() || $pFont->getSubScript()) {
349
$objWriter->startElement('vertAlign');
350
if ($pFont->getSuperScript()) {
351
$objWriter->writeAttribute('val', 'superscript');
352
} else if ($pFont->getSubScript()) {
353
$objWriter->writeAttribute('val', 'subscript');
355
$objWriter->endElement();
359
$objWriter->startElement('u');
360
$objWriter->writeAttribute('val', $pFont->getUnderline());
361
$objWriter->endElement();
364
if ($pFont->getStrikethrough()) {
365
$objWriter->startElement('strike');
366
$objWriter->writeAttribute('val', 'true');
367
$objWriter->endElement();
371
$objWriter->startElement('color');
372
$objWriter->writeAttribute('rgb', $pFont->getColor()->getARGB());
373
$objWriter->endElement();
375
$objWriter->endElement();
381
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
382
* @param PHPExcel_Style_Borders $pBorders Borders style
385
private function _writeBorder(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Borders $pBorders = null)
388
$objWriter->startElement('border');
390
switch ($pBorders->getDiagonalDirection()) {
391
case PHPExcel_Style_Borders::DIAGONAL_UP:
392
$objWriter->writeAttribute('diagonalUp', 'true');
393
$objWriter->writeAttribute('diagonalDown', 'false');
395
case PHPExcel_Style_Borders::DIAGONAL_DOWN:
396
$objWriter->writeAttribute('diagonalUp', 'false');
397
$objWriter->writeAttribute('diagonalDown', 'true');
402
$this->_writeBorderPr($objWriter, 'left', $pBorders->getLeft());
403
$this->_writeBorderPr($objWriter, 'right', $pBorders->getRight());
404
$this->_writeBorderPr($objWriter, 'top', $pBorders->getTop());
405
$this->_writeBorderPr($objWriter, 'bottom', $pBorders->getBottom());
406
$this->_writeBorderPr($objWriter, 'diagonal', $pBorders->getDiagonal());
407
$objWriter->endElement();
411
* Write Cell Style Xf
413
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
414
* @param PHPExcel_Style $pStyle Style
415
* @param PHPExcel $pPHPExcel Workbook
418
private function _writeCellStyleXf(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style $pStyle = null, PHPExcel $pPHPExcel = null)
421
$objWriter->startElement('xf');
422
$objWriter->writeAttribute('xfId', 0);
423
$objWriter->writeAttribute('fontId', (int)$this->getParentWriter()->getFontHashTable()->getIndexForHashCode($pStyle->getFont()->getHashCode()));
425
if ($pStyle->getNumberFormat()->getBuiltInFormatCode() === false) {
426
$objWriter->writeAttribute('numFmtId', (int)($this->getParentWriter()->getNumFmtHashTable()->getIndexForHashCode($pStyle->getNumberFormat()->getHashCode()) + 164) );
428
$objWriter->writeAttribute('numFmtId', (int)$pStyle->getNumberFormat()->getBuiltInFormatCode());
431
$objWriter->writeAttribute('fillId', (int)$this->getParentWriter()->getFillHashTable()->getIndexForHashCode($pStyle->getFill()->getHashCode()));
432
$objWriter->writeAttribute('borderId', (int)$this->getParentWriter()->getBordersHashTable()->getIndexForHashCode($pStyle->getBorders()->getHashCode()));
435
$objWriter->writeAttribute('applyFont', ($pPHPExcel->getDefaultStyle()->getFont()->getHashCode() != $pStyle->getFont()->getHashCode()) ? '1' : '0');
436
$objWriter->writeAttribute('applyNumberFormat', ($pPHPExcel->getDefaultStyle()->getNumberFormat()->getHashCode() != $pStyle->getNumberFormat()->getHashCode()) ? '1' : '0');
437
$objWriter->writeAttribute('applyFill', ($pPHPExcel->getDefaultStyle()->getFill()->getHashCode() != $pStyle->getFill()->getHashCode()) ? '1' : '0');
438
$objWriter->writeAttribute('applyBorder', ($pPHPExcel->getDefaultStyle()->getBorders()->getHashCode() != $pStyle->getBorders()->getHashCode()) ? '1' : '0');
439
$objWriter->writeAttribute('applyAlignment', ($pPHPExcel->getDefaultStyle()->getAlignment()->getHashCode() != $pStyle->getAlignment()->getHashCode()) ? '1' : '0');
440
if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
441
$objWriter->writeAttribute('applyProtection', 'true');
445
$objWriter->startElement('alignment');
446
$objWriter->writeAttribute('horizontal', $pStyle->getAlignment()->getHorizontal());
447
$objWriter->writeAttribute('vertical', $pStyle->getAlignment()->getVertical());
450
if ($pStyle->getAlignment()->getTextRotation() >= 0) {
451
$textRotation = $pStyle->getAlignment()->getTextRotation();
452
} else if ($pStyle->getAlignment()->getTextRotation() < 0) {
453
$textRotation = 90 - $pStyle->getAlignment()->getTextRotation();
456
$objWriter->writeAttribute('textRotation', $textRotation);
457
$objWriter->writeAttribute('wrapText', ($pStyle->getAlignment()->getWrapText() ? 'true' : 'false'));
458
$objWriter->writeAttribute('shrinkToFit', ($pStyle->getAlignment()->getShrinkToFit() ? 'true' : 'false'));
460
if ($pStyle->getAlignment()->getIndent() > 0) {
461
$objWriter->writeAttribute('indent', $pStyle->getAlignment()->getIndent());
463
$objWriter->endElement();
466
if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
467
$objWriter->startElement('protection');
468
if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
469
$objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
471
if ($pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
472
$objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
474
$objWriter->endElement();
477
$objWriter->endElement();
481
* Write Cell Style Dxf
483
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
484
* @param PHPExcel_Style $pStyle Style
487
private function _writeCellStyleDxf(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style $pStyle = null)
490
$objWriter->startElement('dxf');
493
$this->_writeFont($objWriter, $pStyle->getFont());
496
$this->_writeNumFmt($objWriter, $pStyle->getNumberFormat());
499
$this->_writeFill($objWriter, $pStyle->getFill());
502
$objWriter->startElement('alignment');
503
$objWriter->writeAttribute('horizontal', $pStyle->getAlignment()->getHorizontal());
504
$objWriter->writeAttribute('vertical', $pStyle->getAlignment()->getVertical());
507
if ($pStyle->getAlignment()->getTextRotation() >= 0) {
508
$textRotation = $pStyle->getAlignment()->getTextRotation();
509
} else if ($pStyle->getAlignment()->getTextRotation() < 0) {
510
$textRotation = 90 - $pStyle->getAlignment()->getTextRotation();
513
$objWriter->writeAttribute('textRotation', $textRotation);
514
$objWriter->endElement();
517
$this->_writeBorder($objWriter, $pStyle->getBorders());
520
if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
521
$objWriter->startElement('protection');
522
if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
523
$objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
525
if ($pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
526
$objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
528
$objWriter->endElement();
531
$objWriter->endElement();
537
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
538
* @param string $pName Element name
539
* @param PHPExcel_Style_Border $pBorder Border style
542
private function _writeBorderPr(PHPExcel_Shared_XMLWriter $objWriter = null, $pName = 'left', PHPExcel_Style_Border $pBorder = null)
545
if ($pBorder->getBorderStyle() != PHPExcel_Style_Border::BORDER_NONE) {
546
$objWriter->startElement($pName);
547
$objWriter->writeAttribute('style', $pBorder->getBorderStyle());
550
$objWriter->startElement('color');
551
$objWriter->writeAttribute('rgb', $pBorder->getColor()->getARGB());
552
$objWriter->endElement();
554
$objWriter->endElement();
561
* @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
562
* @param PHPExcel_Style_NumberFormat $pNumberFormat Number Format
563
* @param int $pId Number Format identifier
566
private function _writeNumFmt(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_NumberFormat $pNumberFormat = null, $pId = 0)
568
// Translate formatcode
569
$formatCode = $pNumberFormat->getFormatCode();
572
$objWriter->startElement('numFmt');
573
$objWriter->writeAttribute('numFmtId', ($pId + 164));
574
$objWriter->writeAttribute('formatCode', $formatCode);
575
$objWriter->endElement();
579
* Get an array of all styles
581
* @param PHPExcel $pPHPExcel
582
* @return PHPExcel_Style[] All styles in PHPExcel
585
public function allStyles(PHPExcel $pPHPExcel = null)
587
$aStyles = $pPHPExcel->getCellXfCollection();
593
* Get an array of all conditional styles
595
* @param PHPExcel $pPHPExcel
596
* @return PHPExcel_Style_Conditional[] All conditional styles in PHPExcel
599
public function allConditionalStyles(PHPExcel $pPHPExcel = null)
601
// Get an array of all styles
604
$sheetCount = $pPHPExcel->getSheetCount();
605
for ($i = 0; $i < $sheetCount; ++$i) {
606
foreach ($pPHPExcel->getSheet($i)->getConditionalStylesCollection() as $conditionalStyles) {
607
foreach ($conditionalStyles as $conditionalStyle) {
608
$aStyles[] = $conditionalStyle;
617
* Get an array of all fills
619
* @param PHPExcel $pPHPExcel
620
* @return PHPExcel_Style_Fill[] All fills in PHPExcel
623
public function allFills(PHPExcel $pPHPExcel = null)
625
// Get an array of unique fills
628
// Two first fills are predefined
629
$fill0 = new PHPExcel_Style_Fill();
630
$fill0->setFillType(PHPExcel_Style_Fill::FILL_NONE);
633
$fill1 = new PHPExcel_Style_Fill();
634
$fill1->setFillType(PHPExcel_Style_Fill::FILL_PATTERN_GRAY125);
637
// The remaining fills
638
$aStyles = $this->allStyles($pPHPExcel);
639
foreach ($aStyles as $style) {
640
if (!array_key_exists($style->getFill()->getHashCode(), $aFills)) {
641
$aFills[ $style->getFill()->getHashCode() ] = $style->getFill();
649
* Get an array of all fonts
651
* @param PHPExcel $pPHPExcel
652
* @return PHPExcel_Style_Font[] All fonts in PHPExcel
655
public function allFonts(PHPExcel $pPHPExcel = null)
657
// Get an array of unique fonts
659
$aStyles = $this->allStyles($pPHPExcel);
661
foreach ($aStyles as $style) {
662
if (!array_key_exists($style->getFont()->getHashCode(), $aFonts)) {
663
$aFonts[ $style->getFont()->getHashCode() ] = $style->getFont();
671
* Get an array of all borders
673
* @param PHPExcel $pPHPExcel
674
* @return PHPExcel_Style_Borders[] All borders in PHPExcel
677
public function allBorders(PHPExcel $pPHPExcel = null)
679
// Get an array of unique borders
681
$aStyles = $this->allStyles($pPHPExcel);
683
foreach ($aStyles as $style) {
684
if (!array_key_exists($style->getBorders()->getHashCode(), $aBorders)) {
685
$aBorders[ $style->getBorders()->getHashCode() ] = $style->getBorders();
693
* Get an array of all number formats
695
* @param PHPExcel $pPHPExcel
696
* @return PHPExcel_Style_NumberFormat[] All number formats in PHPExcel
699
public function allNumberFormats(PHPExcel $pPHPExcel = null)
701
// Get an array of unique number formats
703
$aStyles = $this->allStyles($pPHPExcel);
705
foreach ($aStyles as $style) {
706
if ($style->getNumberFormat()->getBuiltInFormatCode() === false && !array_key_exists($style->getNumberFormat()->getHashCode(), $aNumFmts)) {
707
$aNumFmts[ $style->getNumberFormat()->getHashCode() ] = $style->getNumberFormat();