From 0238ea21c4f6776f12b67828253e035ef9c4fea8 Mon Sep 17 00:00:00 2001
From: Sara Arjona
Date: Fri, 21 Jun 2019 10:20:49 +0200
Subject: [PATCH 1/2] MDL-65741 libraries: Replace PHPExcel with PHPSpreadsheet
---
.eslintignore | 2 +-
.stylelintignore | 2 +-
lib/excellib.class.php | 171 +-
lib/phpexcel/PHPExcel.php | 1152 ---
lib/phpexcel/PHPExcel/Autoloader.php | 81 -
.../PHPExcel/CachedObjectStorage/APC.php | 290 -
.../CachedObjectStorage/CacheBase.php | 368 -
.../PHPExcel/CachedObjectStorage/DiscISAM.php | 208 -
.../PHPExcel/CachedObjectStorage/ICache.php | 103 -
.../PHPExcel/CachedObjectStorage/Igbinary.php | 149 -
.../PHPExcel/CachedObjectStorage/Memcache.php | 308 -
.../PHPExcel/CachedObjectStorage/Memory.php | 118 -
.../CachedObjectStorage/MemoryGZip.php | 133 -
.../CachedObjectStorage/MemorySerialized.php | 129 -
.../PHPExcel/CachedObjectStorage/PHPTemp.php | 200 -
.../PHPExcel/CachedObjectStorage/SQLite.php | 307 -
.../PHPExcel/CachedObjectStorage/SQLite3.php | 346 -
.../PHPExcel/CachedObjectStorage/Wincache.php | 289 -
.../PHPExcel/CachedObjectStorageFactory.php | 231 -
.../CalcEngine/CyclicReferenceStack.php | 94 -
lib/phpexcel/PHPExcel/CalcEngine/Logger.php | 151 -
lib/phpexcel/PHPExcel/Calculation.php | 4413 ---------
.../PHPExcel/Calculation/Engineering.php | 2650 ------
.../PHPExcel/Calculation/Exception.php | 46 -
.../PHPExcel/Calculation/ExceptionHandler.php | 45 -
.../PHPExcel/Calculation/FormulaParser.php | 622 --
.../PHPExcel/Calculation/FormulaToken.php | 176 -
.../PHPExcel/Calculation/Function.php | 148 -
.../PHPExcel/Calculation/Functions.php | 762 --
lib/phpexcel/PHPExcel/Calculation/Logical.php | 285 -
.../PHPExcel/Calculation/LookupRef.php | 878 --
.../PHPExcel/Calculation/TextData.php | 651 --
.../PHPExcel/Calculation/Token/Stack.php | 111 -
lib/phpexcel/PHPExcel/Cell.php | 1032 ---
.../PHPExcel/Cell/AdvancedValueBinder.php | 187 -
lib/phpexcel/PHPExcel/Cell/DataType.php | 115 -
lib/phpexcel/PHPExcel/Cell/DataValidation.php | 492 -
.../PHPExcel/Cell/DefaultValueBinder.php | 102 -
lib/phpexcel/PHPExcel/Cell/Hyperlink.php | 124 -
lib/phpexcel/PHPExcel/Cell/IValueBinder.php | 47 -
lib/phpexcel/PHPExcel/Chart/DataSeries.php | 390 -
.../PHPExcel/Chart/DataSeriesValues.php | 333 -
lib/phpexcel/PHPExcel/Chart/Exception.php | 46 -
lib/phpexcel/PHPExcel/Chart/Legend.php | 170 -
lib/phpexcel/PHPExcel/Chart/PlotArea.php | 126 -
lib/phpexcel/PHPExcel/Chart/Properties.php | 363 -
.../Chart/Renderer/PHP Charting Libraries.txt | 17 -
lib/phpexcel/PHPExcel/Chart/Title.php | 86 -
lib/phpexcel/PHPExcel/Comment.php | 338 -
lib/phpexcel/PHPExcel/DocumentSecurity.php | 222 -
lib/phpexcel/PHPExcel/Exception.php | 54 -
lib/phpexcel/PHPExcel/HashTable.php | 204 -
lib/phpexcel/PHPExcel/IComparable.php | 34 -
lib/phpexcel/PHPExcel/IOFactory.php | 289 -
lib/phpexcel/PHPExcel/NamedRange.php | 249 -
lib/phpexcel/PHPExcel/Reader/Abstract.php | 253 -
lib/phpexcel/PHPExcel/Reader/CSV.php | 386 -
.../PHPExcel/Reader/DefaultReadFilter.php | 51 -
lib/phpexcel/PHPExcel/Reader/Excel2007.php | 2044 -----
.../PHPExcel/Reader/Excel2007/Theme.php | 127 -
lib/phpexcel/PHPExcel/Reader/Excel5.php | 8042 -----------------
.../PHPExcel/Reader/Excel5/Escher.php | 669 --
lib/phpexcel/PHPExcel/Reader/Excel5/MD5.php | 203 -
lib/phpexcel/PHPExcel/Reader/Excel5/RC4.php | 81 -
lib/phpexcel/PHPExcel/Reader/Exception.php | 46 -
lib/phpexcel/PHPExcel/Reader/HTML.php | 549 --
lib/phpexcel/PHPExcel/Reader/IReadFilter.php | 39 -
lib/phpexcel/PHPExcel/Reader/IReader.php | 46 -
lib/phpexcel/PHPExcel/Reader/OOCalc.php | 696 --
lib/phpexcel/PHPExcel/RichText.php | 191 -
.../PHPExcel/RichText/ITextElement.php | 56 -
lib/phpexcel/PHPExcel/RichText/Run.php | 98 -
.../PHPExcel/RichText/TextElement.php | 105 -
lib/phpexcel/PHPExcel/Settings.php | 387 -
lib/phpexcel/PHPExcel/Shared/CodePage.php | 144 -
lib/phpexcel/PHPExcel/Shared/Date.php | 409 -
lib/phpexcel/PHPExcel/Shared/Drawing.php | 270 -
lib/phpexcel/PHPExcel/Shared/Escher.php | 83 -
.../PHPExcel/Shared/Escher/DgContainer.php | 75 -
.../Escher/DgContainer/SpgrContainer.php | 102 -
.../Escher/DggContainer/BstoreContainer.php | 57 -
.../DggContainer/BstoreContainer/BSE.php | 112 -
.../DggContainer/BstoreContainer/BSE/Blip.php | 83 -
lib/phpexcel/PHPExcel/Shared/File.php | 186 -
.../Shared/JAMA/CholeskyDecomposition.php | 148 -
.../PHPExcel/Shared/JAMA/utils/Error.php | 83 -
.../PHPExcel/Shared/JAMA/utils/Maths.php | 44 -
.../Shared/OLE/ChainedBlockStream.php | 206 -
lib/phpexcel/PHPExcel/Shared/OLE/PPS.php | 230 -
lib/phpexcel/PHPExcel/Shared/OLE/PPS/File.php | 74 -
lib/phpexcel/PHPExcel/Shared/OLE/PPS/Root.php | 462 -
.../PHPExcel/Shared/PCLZip/pclzip.lib.php | 5173 -----------
.../PHPExcel/Shared/PCLZip/readme.txt | 421 -
.../PHPExcel/Shared/PasswordHasher.php | 67 -
lib/phpexcel/PHPExcel/Shared/String.php | 819 --
lib/phpexcel/PHPExcel/Shared/TimeZone.php | 144 -
lib/phpexcel/PHPExcel/Shared/XMLWriter.php | 124 -
lib/phpexcel/PHPExcel/Shared/ZipArchive.php | 163 -
.../PHPExcel/Shared/ZipStreamWrapper.php | 200 -
.../Shared/trend/exponentialBestFitClass.php | 138 -
.../Shared/trend/linearBestFitClass.php | 102 -
.../Shared/trend/logarithmicBestFitClass.php | 110 -
.../Shared/trend/polynomialBestFitClass.php | 222 -
.../Shared/trend/powerBestFitClass.php | 138 -
.../PHPExcel/Shared/trend/trendClass.php | 147 -
lib/phpexcel/PHPExcel/Style.php | 644 --
lib/phpexcel/PHPExcel/Style/Alignment.php | 464 -
lib/phpexcel/PHPExcel/Style/Border.php | 282 -
lib/phpexcel/PHPExcel/Style/Borders.php | 429 -
lib/phpexcel/PHPExcel/Style/Color.php | 443 -
lib/phpexcel/PHPExcel/Style/Conditional.php | 293 -
lib/phpexcel/PHPExcel/Style/Fill.php | 322 -
lib/phpexcel/PHPExcel/Style/Font.php | 543 --
lib/phpexcel/PHPExcel/Style/Protection.php | 204 -
lib/phpexcel/PHPExcel/Worksheet.php | 2961 ------
.../PHPExcel/Worksheet/AutoFilter.php | 846 --
.../PHPExcel/Worksheet/AutoFilter/Column.php | 405 -
.../PHPExcel/Worksheet/CellIterator.php | 88 -
lib/phpexcel/PHPExcel/Worksheet/Column.php | 86 -
.../PHPExcel/Worksheet/ColumnCellIterator.php | 216 -
.../PHPExcel/Worksheet/ColumnDimension.php | 132 -
.../PHPExcel/Worksheet/ColumnIterator.php | 193 -
lib/phpexcel/PHPExcel/Worksheet/Drawing.php | 147 -
.../PHPExcel/Worksheet/Drawing/Shadow.php | 296 -
.../Worksheet/HeaderFooterDrawing.php | 361 -
.../PHPExcel/Worksheet/MemoryDrawing.php | 201 -
.../PHPExcel/Worksheet/PageMargins.php | 233 -
.../PHPExcel/Worksheet/Protection.php | 581 --
lib/phpexcel/PHPExcel/Worksheet/Row.php | 86 -
.../PHPExcel/Worksheet/RowCellIterator.php | 225 -
.../PHPExcel/Worksheet/RowDimension.php | 132 -
.../PHPExcel/Worksheet/RowIterator.php | 184 -
lib/phpexcel/PHPExcel/WorksheetIterator.php | 108 -
lib/phpexcel/PHPExcel/Writer/Abstract.php | 157 -
lib/phpexcel/PHPExcel/Writer/CSV.php | 317 -
lib/phpexcel/PHPExcel/Writer/Excel2007.php | 533 --
.../PHPExcel/Writer/Excel2007/Comments.php | 260 -
.../PHPExcel/Writer/Excel2007/Drawing.php | 589 --
.../PHPExcel/Writer/Excel2007/RelsRibbon.php | 67 -
.../PHPExcel/Writer/Excel2007/RelsVBA.php | 63 -
.../PHPExcel/Writer/Excel2007/StringTable.php | 313 -
.../PHPExcel/Writer/Excel2007/Theme.php | 869 --
.../PHPExcel/Writer/Excel2007/Workbook.php | 448 -
.../PHPExcel/Writer/Excel2007/Worksheet.php | 1219 ---
.../PHPExcel/Writer/Excel2007/WriterPart.php | 75 -
lib/phpexcel/PHPExcel/Writer/Exception.php | 46 -
lib/phpexcel/PHPExcel/Writer/IWriter.php | 37 -
lib/phpexcel/PHPExcel/Writer/OpenDocument.php | 190 -
.../Writer/OpenDocument/Cell/Comment.php | 63 -
.../PHPExcel/Writer/OpenDocument/Content.php | 272 -
.../PHPExcel/Writer/OpenDocument/Meta.php | 95 -
.../PHPExcel/Writer/OpenDocument/MetaInf.php | 87 -
.../PHPExcel/Writer/OpenDocument/Mimetype.php | 41 -
.../PHPExcel/Writer/OpenDocument/Settings.php | 76 -
.../PHPExcel/Writer/OpenDocument/Styles.php | 92 -
.../Writer/OpenDocument/Thumbnails.php | 41 -
.../Writer/OpenDocument/WriterPart.php | 30 -
lib/phpexcel/PHPExcel/Writer/PDF.php | 89 -
lib/phpexcel/PHPExcel/Writer/PDF/Core.php | 355 -
lib/phpexcel/PHPExcel/Writer/PDF/DomPDF.php | 108 -
lib/phpexcel/PHPExcel/Writer/PDF/mPDF.php | 118 -
lib/phpexcel/PHPExcel/Writer/PDF/tcPDF.php | 123 -
lib/phpexcel/PHPExcel/locale/bg/config | 49 -
lib/phpexcel/PHPExcel/locale/cs/config | 47 -
lib/phpexcel/PHPExcel/locale/da/config | 48 -
lib/phpexcel/PHPExcel/locale/de/config | 47 -
lib/phpexcel/PHPExcel/locale/en/uk/config | 32 -
lib/phpexcel/PHPExcel/locale/es/config | 47 -
lib/phpexcel/PHPExcel/locale/fi/config | 47 -
lib/phpexcel/PHPExcel/locale/fr/config | 47 -
lib/phpexcel/PHPExcel/locale/hu/config | 47 -
lib/phpexcel/PHPExcel/locale/it/config | 47 -
lib/phpexcel/PHPExcel/locale/nl/config | 47 -
lib/phpexcel/PHPExcel/locale/no/config | 47 -
lib/phpexcel/PHPExcel/locale/pl/config | 47 -
lib/phpexcel/PHPExcel/locale/pt/br/config | 47 -
lib/phpexcel/PHPExcel/locale/pt/config | 47 -
lib/phpexcel/PHPExcel/locale/ru/config | 47 -
lib/phpexcel/PHPExcel/locale/sv/config | 47 -
lib/phpexcel/PHPExcel/locale/tr/config | 47 -
lib/phpexcel/readme_moodle.txt | 31 -
lib/phpspreadsheet/readme_moodle.txt | 54 +
lib/phpspreadsheet/vendor/autoload.php | 7 +
.../vendor/composer/ClassLoader.php | 445 +
lib/phpspreadsheet/vendor/composer/LICENSE | 56 +
.../vendor/composer/autoload_classmap.php | 9 +
.../vendor/composer/autoload_files.php | 67 +
.../vendor/composer/autoload_namespaces.php | 9 +
.../vendor/composer/autoload_psr4.php | 13 +
.../vendor/composer/autoload_real.php | 70 +
.../vendor/composer/autoload_static.php | 113 +
.../vendor/composer/installed.json | 317 +
.../vendor/markbaker/complex/README.md | 156 +
.../markbaker/complex/classes/Autoloader.php | 53 +
.../markbaker/complex/classes/Bootstrap.php | 38 +
.../markbaker/complex/classes/src/Complex.php | 387 +
.../complex/classes/src/Exception.php | 13 +
.../complex/classes/src/functions/abs.php | 29 +
.../complex/classes/src/functions/acos.php | 38 +
.../complex/classes/src/functions/acosh.php | 34 +
.../complex/classes/src/functions/acot.php | 25 +
.../complex/classes/src/functions/acoth.php | 25 +
.../complex/classes/src/functions/acsc.php | 29 +
.../complex/classes/src/functions/acsch.php | 29 +
.../classes/src/functions/argument.php | 28 +
.../complex/classes/src/functions/asec.php | 29 +
.../complex/classes/src/functions/asech.php | 29 +
.../complex/classes/src/functions/asin.php | 37 +
.../complex/classes/src/functions/asinh.php | 33 +
.../complex/classes/src/functions/atan.php | 45 +
.../complex/classes/src/functions/atanh.php | 38 +
.../classes/src/functions/conjugate.php | 28 +
.../complex/classes/src/functions/cos.php | 34 +
.../complex/classes/src/functions/cosh.php | 32 +
.../complex/classes/src/functions/cot.php | 29 +
.../complex/classes/src/functions/coth.php | 24 +
.../complex/classes/src/functions/csc.php | 29 +
.../complex/classes/src/functions/csch.php | 29 +
.../complex/classes/src/functions/exp.php | 34 +
.../complex/classes/src/functions/inverse.php | 29 +
.../complex/classes/src/functions/ln.php | 33 +
.../complex/classes/src/functions/log10.php | 32 +
.../complex/classes/src/functions/log2.php | 32 +
.../classes/src/functions/negative.php | 31 +
.../complex/classes/src/functions/pow.php | 40 +
.../complex/classes/src/functions/rho.php | 28 +
.../complex/classes/src/functions/sec.php | 25 +
.../complex/classes/src/functions/sech.php | 25 +
.../complex/classes/src/functions/sin.php | 32 +
.../complex/classes/src/functions/sinh.php | 32 +
.../complex/classes/src/functions/sqrt.php | 29 +
.../complex/classes/src/functions/tan.php | 40 +
.../complex/classes/src/functions/tanh.php | 35 +
.../complex/classes/src/functions/theta.php | 38 +
.../complex/classes/src/operations/add.php | 46 +
.../classes/src/operations/divideby.php | 56 +
.../classes/src/operations/divideinto.php | 56 +
.../classes/src/operations/multiply.php | 48 +
.../classes/src/operations/subtract.php | 46 +
.../vendor/markbaker/complex/composer.json | 91 +
.../complex/examples/complexTest.php | 154 +
.../complex/examples/testFunctions.php | 52 +
.../complex/examples/testOperations.php | 34 +
.../vendor/markbaker/complex/license.md | 25 +
.../vendor/markbaker/matrix/README.md | 165 +
.../vendor/markbaker/matrix/buildPhar.php | 62 +
.../markbaker/matrix/classes/Autoloader.php | 53 +
.../markbaker/matrix/classes/Bootstrap.php | 38 +
.../markbaker/matrix/classes/src/Builder.php | 69 +
.../matrix/classes/src/Exception.php | 13 +
.../matrix/classes/src/Functions.php | 318 +
.../markbaker/matrix/classes/src/Matrix.php | 403 +
.../matrix/classes/src/Operators/Addition.php | 68 +
.../classes/src/Operators/DirectSum.php | 65 +
.../matrix/classes/src/Operators/Division.php | 38 +
.../classes/src/Operators/Multiplication.php | 77 +
.../matrix/classes/src/Operators/Operator.php | 78 +
.../classes/src/Operators/Subtraction.php | 68 +
.../matrix/classes/src/functions/adjoint.php | 26 +
.../classes/src/functions/antidiagonal.php | 26 +
.../classes/src/functions/cofactors.php | 26 +
.../classes/src/functions/determinant.php | 26 +
.../matrix/classes/src/functions/diagonal.php | 26 +
.../matrix/classes/src/functions/identity.php | 26 +
.../matrix/classes/src/functions/inverse.php | 26 +
.../matrix/classes/src/functions/minors.php | 26 +
.../matrix/classes/src/functions/trace.php | 26 +
.../classes/src/functions/transpose.php | 26 +
.../matrix/classes/src/operations/add.php | 39 +
.../classes/src/operations/directsum.php | 39 +
.../classes/src/operations/divideby.php | 38 +
.../classes/src/operations/divideinto.php | 39 +
.../classes/src/operations/multiply.php | 39 +
.../classes/src/operations/subtract.php | 39 +
.../vendor/markbaker/matrix/composer.json | 68 +
.../vendor/markbaker/matrix/examples/test.php | 19 +
.../vendor/markbaker/matrix/license.md | 25 +
.../phpspreadsheet/CHANGELOG.PHPExcel.md | 1593 ++++
.../phpoffice/phpspreadsheet/CHANGELOG.md | 331 +
.../phpoffice/phpspreadsheet/CONTRIBUTING.md | 11 +
.../vendor/phpoffice/phpspreadsheet/LICENSE} | 849 +-
.../phpoffice/phpspreadsheet/composer.json | 87 +
.../phpoffice/phpspreadsheet/composer.lock | 3211 +++++++
.../phpoffice/phpspreadsheet/mkdocs.yml | 7 +
.../phpoffice/phpspreadsheet/phpunit.xml.dist | 22 +
.../phpspreadsheet/src/Bootstrap.php | 22 +
.../Calculation/Calculation.php | 4481 +++++++++
.../PhpSpreadsheet/Calculation/Category.php | 19 +
.../PhpSpreadsheet}/Calculation/Database.php | 290 +-
.../PhpSpreadsheet}/Calculation/DateTime.php | 982 +-
.../Engine/CyclicReferenceStack.php | 73 +
.../Calculation/Engine/Logger.php | 128 +
.../Calculation/Engineering.php | 2807 ++++++
.../PhpSpreadsheet/Calculation/Exception.php | 26 +
.../Calculation/ExceptionHandler.php | 22 +
.../PhpSpreadsheet}/Calculation/Financial.php | 1648 ++--
.../Calculation/FormulaParser.php | 623 ++
.../Calculation/FormulaToken.php | 150 +
.../PhpSpreadsheet/Calculation/Functions.php | 673 ++
.../PhpSpreadsheet/Calculation/Logical.php | 296 +
.../PhpSpreadsheet/Calculation/LookupRef.php | 926 ++
.../PhpSpreadsheet}/Calculation/MathTrig.php | 1196 ++-
.../Calculation/Statistical.php | 2314 +++--
.../PhpSpreadsheet/Calculation/TextData.php | 672 ++
.../Calculation/Token/Stack.php | 93 +
.../Calculation/functionlist.txt | 36 +-
.../Calculation/locale/bg/config | 27 +
.../Calculation/locale/bg}/functions | 855 +-
.../Calculation/locale/cs/config | 23 +
.../Calculation}/locale/cs/functions | 854 +-
.../Calculation/locale/da/config | 25 +
.../Calculation}/locale/da/functions | 854 +-
.../Calculation/locale/de/config | 24 +
.../Calculation}/locale/de/functions | 854 +-
.../Calculation/locale/en/uk/config | 8 +
.../Calculation/locale/es/config | 24 +
.../Calculation}/locale/es/functions | 854 +-
.../Calculation/locale/fi/config | 24 +
.../Calculation}/locale/fi/functions | 854 +-
.../Calculation/locale/fr/config | 24 +
.../Calculation}/locale/fr/functions | 854 +-
.../Calculation/locale/hu/config | 23 +
.../Calculation}/locale/hu/functions | 854 +-
.../Calculation/locale/it/config | 24 +
.../Calculation}/locale/it/functions | 854 +-
.../Calculation/locale/nl/config | 24 +
.../Calculation}/locale/nl/functions | 854 +-
.../Calculation/locale/no/config | 24 +
.../Calculation}/locale/no/functions | 854 +-
.../Calculation/locale/pl/config | 24 +
.../Calculation}/locale/pl/functions | 854 +-
.../Calculation/locale/pt/br/config | 24 +
.../Calculation}/locale/pt/br/functions | 816 +-
.../Calculation/locale/pt/config | 24 +
.../Calculation}/locale/pt/functions | 816 +-
.../Calculation/locale/ru/config | 24 +
.../Calculation/locale/ru/functions | 416 +
.../Calculation/locale/sv/config | 24 +
.../Calculation}/locale/sv/functions | 816 +-
.../Calculation/locale/tr/config | 24 +
.../Calculation}/locale/tr/functions | 854 +-
.../Cell/AdvancedValueBinder.php | 176 +
.../src/PhpSpreadsheet/Cell/Cell.php | 698 ++
.../src/PhpSpreadsheet/Cell/Coordinate.php | 522 ++
.../src/PhpSpreadsheet/Cell/DataType.php | 85 +
.../PhpSpreadsheet/Cell/DataValidation.php | 481 +
.../src/PhpSpreadsheet/Cell/DataValidator.php | 77 +
.../Cell/DefaultValueBinder.php | 82 +
.../src/PhpSpreadsheet/Cell/Hyperlink.php | 113 +
.../src/PhpSpreadsheet/Cell/IValueBinder.php | 16 +
.../PhpSpreadsheet/Cell/StringValueBinder.php | 31 +
.../src/PhpSpreadsheet}/Chart/Axis.php | 250 +-
.../src/PhpSpreadsheet/Chart}/Chart.php | 398 +-
.../src/PhpSpreadsheet/Chart/DataSeries.php | 390 +
.../PhpSpreadsheet/Chart/DataSeriesValues.php | 401 +
.../src/PhpSpreadsheet/Chart/Exception.php | 9 +
.../src/PhpSpreadsheet}/Chart/GridLines.php | 233 +-
.../src/PhpSpreadsheet}/Chart/Layout.php | 207 +-
.../src/PhpSpreadsheet/Chart/Legend.php | 158 +
.../src/PhpSpreadsheet/Chart/PlotArea.php | 112 +
.../src/PhpSpreadsheet/Chart/Properties.php | 369 +
.../Chart/Renderer/IRenderer.php | 24 +
.../Chart/Renderer/JpGraph.php} | 339 +-
.../Chart/Renderer/PHP Charting Libraries.txt | 20 +
.../Chart/Renderer/Polyfill.php | 9 +
.../src/PhpSpreadsheet/Chart/Title.php | 66 +
.../src/PhpSpreadsheet/Collection/Cells.php | 506 ++
.../Collection/CellsFactory.php | 23 +
.../src/PhpSpreadsheet/Collection/Memory.php | 79 +
.../src/PhpSpreadsheet/Comment.php | 331 +
.../PhpSpreadsheet/Document/Properties.php} | 298 +-
.../src/PhpSpreadsheet/Document/Security.php | 205 +
.../src/PhpSpreadsheet/Exception.php | 7 +
.../src/PhpSpreadsheet/HashTable.php | 179 +
.../src/PhpSpreadsheet/Helper/Html.php} | 77 +-
.../src/PhpSpreadsheet/Helper/Migrator.php | 333 +
.../src/PhpSpreadsheet/Helper/Sample.php | 230 +
.../src/PhpSpreadsheet/IComparable.php | 13 +
.../src/PhpSpreadsheet/IOFactory.php | 230 +
.../src/PhpSpreadsheet/NamedRange.php | 240 +
.../src/PhpSpreadsheet/Reader/BaseReader.php | 239 +
.../src/PhpSpreadsheet/Reader/Csv.php | 562 ++
.../Reader/DefaultReadFilter.php | 20 +
.../src/PhpSpreadsheet/Reader/Exception.php | 9 +
.../src/PhpSpreadsheet}/Reader/Gnumeric.php | 563 +-
.../src/PhpSpreadsheet/Reader/Html.php | 933 ++
.../src/PhpSpreadsheet/Reader/IReadFilter.php | 17 +
.../src/PhpSpreadsheet/Reader/IReader.php | 31 +
.../src/PhpSpreadsheet/Reader/Ods.php | 792 ++
.../Reader/Security/XmlScanner.php | 125 +
.../src/PhpSpreadsheet/Reader/Slk.php} | 300 +-
.../src/PhpSpreadsheet/Reader/Xlsx.php | 2609 ++++++
.../src/PhpSpreadsheet/Reader/Xlsx}/Chart.php | 344 +-
.../src/PhpSpreadsheet/Reader/Xlsx/Theme.php | 93 +
.../src/PhpSpreadsheet/Reader/Xml.php} | 749 +-
.../src/PhpSpreadsheet}/ReferenceHelper.php | 667 +-
.../PhpSpreadsheet/RichText/ITextElement.php | 36 +
.../src/PhpSpreadsheet/RichText/RichText.php | 177 +
.../src/PhpSpreadsheet/RichText/Run.php | 65 +
.../PhpSpreadsheet/RichText/TextElement.php | 86 +
.../src/PhpSpreadsheet/Settings.php | 127 +
.../src/PhpSpreadsheet/Shared/CodePage.php | 138 +
.../src/PhpSpreadsheet/Shared/Date.php | 493 +
.../src/PhpSpreadsheet/Shared/Drawing.php | 249 +
.../src/PhpSpreadsheet/Shared/Escher.php | 64 +
.../Shared/Escher/DgContainer.php | 52 +
.../Escher/DgContainer/SpgrContainer.php | 79 +
.../DgContainer/SpgrContainer/SpContainer.php | 143 +-
.../Shared/Escher/DggContainer.php | 83 +-
.../Escher/DggContainer/BstoreContainer.php | 34 +
.../DggContainer/BstoreContainer/BSE.php | 89 +
.../DggContainer/BstoreContainer/BSE/Blip.php | 60 +
.../src/PhpSpreadsheet/Shared/File.php | 150 +
.../src/PhpSpreadsheet}/Shared/Font.php | 455 +-
.../PhpSpreadsheet}/Shared/JAMA/CHANGELOG.TXT | 0
.../Shared/JAMA/CholeskyDecomposition.php | 147 +
.../Shared/JAMA/EigenvalueDecomposition.php | 381 +-
.../Shared/JAMA/LUDecomposition.php | 150 +-
.../PhpSpreadsheet}/Shared/JAMA/Matrix.php | 824 +-
.../Shared/JAMA/QRDecomposition.php | 144 +-
.../JAMA/SingularValueDecomposition.php | 238 +-
.../Shared/JAMA/utils/Maths.php | 30 +
.../PhpSpreadsheet/Shared/PasswordHasher.php | 37 +
.../PhpSpreadsheet/Shared/StringHelper.php | 724 ++
.../src/PhpSpreadsheet/Shared/TimeZone.php | 87 +
.../PhpSpreadsheet/Shared/Trend/BestFit.php} | 220 +-
.../Shared/Trend/ExponentialBestFit.php | 120 +
.../Shared/Trend/LinearBestFit.php | 79 +
.../Shared/Trend/LogarithmicBestFit.php | 88 +
.../Shared/Trend/PolynomialBestFit.php | 198 +
.../Shared/Trend/PowerBestFit.php | 112 +
.../src/PhpSpreadsheet/Shared/Trend/Trend.php | 120 +
.../src/PhpSpreadsheet/Shared/XMLWriter.php | 92 +
.../src/PhpSpreadsheet/Spreadsheet.php | 1490 +++
.../src/PhpSpreadsheet/Style/Alignment.php | 466 +
.../src/PhpSpreadsheet/Style/Border.php | 239 +
.../src/PhpSpreadsheet/Style/Borders.php | 423 +
.../src/PhpSpreadsheet/Style/Color.php | 403 +
.../src/PhpSpreadsheet/Style/Conditional.php | 272 +
.../src/PhpSpreadsheet/Style/Fill.php | 325 +
.../src/PhpSpreadsheet/Style/Font.php | 556 ++
.../PhpSpreadsheet}/Style/NumberFormat.php | 551 +-
.../src/PhpSpreadsheet/Style/Protection.php | 190 +
.../src/PhpSpreadsheet/Style/Style.php | 641 ++
.../src/PhpSpreadsheet}/Style/Supervisor.php | 70 +-
.../PhpSpreadsheet/Worksheet/AutoFilter.php | 873 ++
.../Worksheet/AutoFilter/Column.php | 388 +
.../Worksheet/AutoFilter/Column/Rule.php | 309 +-
.../PhpSpreadsheet}/Worksheet/BaseDrawing.php | 286 +-
.../PhpSpreadsheet/Worksheet/CellIterator.php | 61 +
.../src/PhpSpreadsheet/Worksheet/Column.php | 64 +
.../Worksheet/ColumnCellIterator.php | 197 +
.../Worksheet/ColumnDimension.php | 115 +
.../Worksheet/ColumnIterator.php | 175 +
.../PhpSpreadsheet}/Worksheet/Dimension.php | 87 +-
.../src/PhpSpreadsheet/Worksheet/Drawing.php | 116 +
.../Worksheet/Drawing/Shadow.php | 289 +
.../Worksheet/HeaderFooter.php | 233 +-
.../Worksheet/HeaderFooterDrawing.php | 24 +
.../src/PhpSpreadsheet/Worksheet/Iterator.php | 87 +
.../Worksheet/MemoryDrawing.php | 169 +
.../PhpSpreadsheet/Worksheet/PageMargins.php | 214 +
.../PhpSpreadsheet}/Worksheet/PageSetup.php | 572 +-
.../PhpSpreadsheet/Worksheet/Protection.php | 586 ++
.../src/PhpSpreadsheet/Worksheet/Row.php | 74 +
.../Worksheet/RowCellIterator.php | 195 +
.../PhpSpreadsheet/Worksheet/RowDimension.php | 115 +
.../PhpSpreadsheet/Worksheet/RowIterator.php | 170 +
.../PhpSpreadsheet}/Worksheet/SheetView.php | 106 +-
.../PhpSpreadsheet/Worksheet/Worksheet.php | 3066 +++++++
.../src/PhpSpreadsheet/Writer/BaseWriter.php | 141 +
.../src/PhpSpreadsheet/Writer/Csv.php | 342 +
.../src/PhpSpreadsheet/Writer/Exception.php | 9 +
.../src/PhpSpreadsheet/Writer/Html.php} | 1200 +--
.../src/PhpSpreadsheet/Writer/IWriter.php | 24 +
.../src/PhpSpreadsheet/Writer/Ods.php | 178 +
.../Writer/Ods/Cell/Comment.php | 33 +
.../src/PhpSpreadsheet/Writer/Ods/Content.php | 395 +
.../src/PhpSpreadsheet/Writer/Ods/Meta.php | 77 +
.../src/PhpSpreadsheet/Writer/Ods/MetaInf.php | 62 +
.../PhpSpreadsheet/Writer/Ods/Mimetype.php | 20 +
.../PhpSpreadsheet/Writer/Ods/Settings.php | 54 +
.../src/PhpSpreadsheet/Writer/Ods/Styles.php | 70 +
.../PhpSpreadsheet/Writer/Ods/Thumbnails.php | 20 +
.../PhpSpreadsheet/Writer/Ods/WriterPart.php | 35 +
.../src/PhpSpreadsheet/Writer/Pdf.php | 283 +
.../src/PhpSpreadsheet/Writer/Pdf/Dompdf.php | 78 +
.../src/PhpSpreadsheet/Writer/Pdf/Mpdf.php | 112 +
.../src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php | 98 +
.../src/PhpSpreadsheet/Writer/Xlsx.php | 547 ++
.../src/PhpSpreadsheet/Writer/Xlsx}/Chart.php | 649 +-
.../PhpSpreadsheet/Writer/Xlsx/Comments.php | 242 +
.../Writer/Xlsx}/ContentTypes.php | 167 +-
.../PhpSpreadsheet/Writer/Xlsx}/DocProps.php | 125 +-
.../PhpSpreadsheet/Writer/Xlsx/Drawing.php | 519 ++
.../src/PhpSpreadsheet/Writer/Xlsx}/Rels.php | 254 +-
.../PhpSpreadsheet/Writer/Xlsx/RelsRibbon.php | 49 +
.../PhpSpreadsheet/Writer/Xlsx/RelsVBA.php | 44 +
.../Writer/Xlsx/StringTable.php | 281 +
.../src/PhpSpreadsheet/Writer/Xlsx}/Style.php | 340 +-
.../src/PhpSpreadsheet/Writer/Xlsx/Theme.php | 846 ++
.../PhpSpreadsheet/Writer/Xlsx/Workbook.php | 426 +
.../PhpSpreadsheet/Writer/Xlsx/Worksheet.php | 1228 +++
.../PhpSpreadsheet/Writer/Xlsx/WriterPart.php | 35 +
.../vendor/psr/simple-cache/.editorconfig | 12 +
.../vendor/psr/simple-cache/LICENSE.md | 21 +
.../vendor/psr/simple-cache/README.md | 8 +
.../vendor/psr/simple-cache/composer.json | 25 +
.../psr/simple-cache/src/CacheException.php | 10 +
.../psr/simple-cache/src/CacheInterface.php | 114 +
.../src/InvalidArgumentException.php | 13 +
lib/tests/other/spreadsheettestpage.php | 38 +-
lib/thirdpartylibs.xml | 6 +-
513 files changed, 73316 insertions(+), 80415 deletions(-)
delete mode 100644 lib/phpexcel/PHPExcel.php
delete mode 100644 lib/phpexcel/PHPExcel/Autoloader.php
delete mode 100644 lib/phpexcel/PHPExcel/CachedObjectStorage/APC.php
delete mode 100644 lib/phpexcel/PHPExcel/CachedObjectStorage/CacheBase.php
delete mode 100644 lib/phpexcel/PHPExcel/CachedObjectStorage/DiscISAM.php
delete mode 100644 lib/phpexcel/PHPExcel/CachedObjectStorage/ICache.php
delete mode 100644 lib/phpexcel/PHPExcel/CachedObjectStorage/Igbinary.php
delete mode 100644 lib/phpexcel/PHPExcel/CachedObjectStorage/Memcache.php
delete mode 100644 lib/phpexcel/PHPExcel/CachedObjectStorage/Memory.php
delete mode 100644 lib/phpexcel/PHPExcel/CachedObjectStorage/MemoryGZip.php
delete mode 100644 lib/phpexcel/PHPExcel/CachedObjectStorage/MemorySerialized.php
delete mode 100644 lib/phpexcel/PHPExcel/CachedObjectStorage/PHPTemp.php
delete mode 100644 lib/phpexcel/PHPExcel/CachedObjectStorage/SQLite.php
delete mode 100644 lib/phpexcel/PHPExcel/CachedObjectStorage/SQLite3.php
delete mode 100644 lib/phpexcel/PHPExcel/CachedObjectStorage/Wincache.php
delete mode 100644 lib/phpexcel/PHPExcel/CachedObjectStorageFactory.php
delete mode 100644 lib/phpexcel/PHPExcel/CalcEngine/CyclicReferenceStack.php
delete mode 100644 lib/phpexcel/PHPExcel/CalcEngine/Logger.php
delete mode 100644 lib/phpexcel/PHPExcel/Calculation.php
delete mode 100644 lib/phpexcel/PHPExcel/Calculation/Engineering.php
delete mode 100644 lib/phpexcel/PHPExcel/Calculation/Exception.php
delete mode 100644 lib/phpexcel/PHPExcel/Calculation/ExceptionHandler.php
delete mode 100644 lib/phpexcel/PHPExcel/Calculation/FormulaParser.php
delete mode 100644 lib/phpexcel/PHPExcel/Calculation/FormulaToken.php
delete mode 100644 lib/phpexcel/PHPExcel/Calculation/Function.php
delete mode 100644 lib/phpexcel/PHPExcel/Calculation/Functions.php
delete mode 100644 lib/phpexcel/PHPExcel/Calculation/Logical.php
delete mode 100644 lib/phpexcel/PHPExcel/Calculation/LookupRef.php
delete mode 100644 lib/phpexcel/PHPExcel/Calculation/TextData.php
delete mode 100644 lib/phpexcel/PHPExcel/Calculation/Token/Stack.php
delete mode 100644 lib/phpexcel/PHPExcel/Cell.php
delete mode 100644 lib/phpexcel/PHPExcel/Cell/AdvancedValueBinder.php
delete mode 100644 lib/phpexcel/PHPExcel/Cell/DataType.php
delete mode 100644 lib/phpexcel/PHPExcel/Cell/DataValidation.php
delete mode 100644 lib/phpexcel/PHPExcel/Cell/DefaultValueBinder.php
delete mode 100644 lib/phpexcel/PHPExcel/Cell/Hyperlink.php
delete mode 100644 lib/phpexcel/PHPExcel/Cell/IValueBinder.php
delete mode 100644 lib/phpexcel/PHPExcel/Chart/DataSeries.php
delete mode 100644 lib/phpexcel/PHPExcel/Chart/DataSeriesValues.php
delete mode 100644 lib/phpexcel/PHPExcel/Chart/Exception.php
delete mode 100644 lib/phpexcel/PHPExcel/Chart/Legend.php
delete mode 100644 lib/phpexcel/PHPExcel/Chart/PlotArea.php
delete mode 100644 lib/phpexcel/PHPExcel/Chart/Properties.php
delete mode 100644 lib/phpexcel/PHPExcel/Chart/Renderer/PHP Charting Libraries.txt
delete mode 100644 lib/phpexcel/PHPExcel/Chart/Title.php
delete mode 100644 lib/phpexcel/PHPExcel/Comment.php
delete mode 100644 lib/phpexcel/PHPExcel/DocumentSecurity.php
delete mode 100644 lib/phpexcel/PHPExcel/Exception.php
delete mode 100644 lib/phpexcel/PHPExcel/HashTable.php
delete mode 100644 lib/phpexcel/PHPExcel/IComparable.php
delete mode 100644 lib/phpexcel/PHPExcel/IOFactory.php
delete mode 100644 lib/phpexcel/PHPExcel/NamedRange.php
delete mode 100644 lib/phpexcel/PHPExcel/Reader/Abstract.php
delete mode 100644 lib/phpexcel/PHPExcel/Reader/CSV.php
delete mode 100644 lib/phpexcel/PHPExcel/Reader/DefaultReadFilter.php
delete mode 100644 lib/phpexcel/PHPExcel/Reader/Excel2007.php
delete mode 100644 lib/phpexcel/PHPExcel/Reader/Excel2007/Theme.php
delete mode 100644 lib/phpexcel/PHPExcel/Reader/Excel5.php
delete mode 100644 lib/phpexcel/PHPExcel/Reader/Excel5/Escher.php
delete mode 100644 lib/phpexcel/PHPExcel/Reader/Excel5/MD5.php
delete mode 100644 lib/phpexcel/PHPExcel/Reader/Excel5/RC4.php
delete mode 100644 lib/phpexcel/PHPExcel/Reader/Exception.php
delete mode 100644 lib/phpexcel/PHPExcel/Reader/HTML.php
delete mode 100644 lib/phpexcel/PHPExcel/Reader/IReadFilter.php
delete mode 100644 lib/phpexcel/PHPExcel/Reader/IReader.php
delete mode 100644 lib/phpexcel/PHPExcel/Reader/OOCalc.php
delete mode 100644 lib/phpexcel/PHPExcel/RichText.php
delete mode 100644 lib/phpexcel/PHPExcel/RichText/ITextElement.php
delete mode 100644 lib/phpexcel/PHPExcel/RichText/Run.php
delete mode 100644 lib/phpexcel/PHPExcel/RichText/TextElement.php
delete mode 100644 lib/phpexcel/PHPExcel/Settings.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/CodePage.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/Date.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/Drawing.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/Escher.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/Escher/DgContainer.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/File.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/JAMA/CholeskyDecomposition.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/JAMA/utils/Error.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/JAMA/utils/Maths.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/OLE/ChainedBlockStream.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/OLE/PPS.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/OLE/PPS/File.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/OLE/PPS/Root.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/PCLZip/pclzip.lib.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/PCLZip/readme.txt
delete mode 100644 lib/phpexcel/PHPExcel/Shared/PasswordHasher.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/String.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/TimeZone.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/XMLWriter.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/ZipArchive.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/ZipStreamWrapper.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/trend/exponentialBestFitClass.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/trend/linearBestFitClass.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/trend/logarithmicBestFitClass.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/trend/polynomialBestFitClass.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/trend/powerBestFitClass.php
delete mode 100644 lib/phpexcel/PHPExcel/Shared/trend/trendClass.php
delete mode 100644 lib/phpexcel/PHPExcel/Style.php
delete mode 100644 lib/phpexcel/PHPExcel/Style/Alignment.php
delete mode 100644 lib/phpexcel/PHPExcel/Style/Border.php
delete mode 100644 lib/phpexcel/PHPExcel/Style/Borders.php
delete mode 100644 lib/phpexcel/PHPExcel/Style/Color.php
delete mode 100644 lib/phpexcel/PHPExcel/Style/Conditional.php
delete mode 100644 lib/phpexcel/PHPExcel/Style/Fill.php
delete mode 100644 lib/phpexcel/PHPExcel/Style/Font.php
delete mode 100644 lib/phpexcel/PHPExcel/Style/Protection.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet/AutoFilter.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet/AutoFilter/Column.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet/CellIterator.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet/Column.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet/ColumnCellIterator.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet/ColumnDimension.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet/ColumnIterator.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet/Drawing.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet/Drawing/Shadow.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet/HeaderFooterDrawing.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet/MemoryDrawing.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet/PageMargins.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet/Protection.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet/Row.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet/RowCellIterator.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet/RowDimension.php
delete mode 100644 lib/phpexcel/PHPExcel/Worksheet/RowIterator.php
delete mode 100644 lib/phpexcel/PHPExcel/WorksheetIterator.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/Abstract.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/CSV.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/Excel2007.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/Excel2007/Comments.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/Excel2007/Drawing.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/Excel2007/RelsRibbon.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/Excel2007/RelsVBA.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/Excel2007/StringTable.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/Excel2007/Theme.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/Excel2007/Workbook.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/Excel2007/Worksheet.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/Excel2007/WriterPart.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/Exception.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/IWriter.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/OpenDocument.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/OpenDocument/Cell/Comment.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/OpenDocument/Content.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/OpenDocument/Meta.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/OpenDocument/MetaInf.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/OpenDocument/Mimetype.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/OpenDocument/Settings.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/OpenDocument/Styles.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/OpenDocument/Thumbnails.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/OpenDocument/WriterPart.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/PDF.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/PDF/Core.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/PDF/DomPDF.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/PDF/mPDF.php
delete mode 100644 lib/phpexcel/PHPExcel/Writer/PDF/tcPDF.php
delete mode 100644 lib/phpexcel/PHPExcel/locale/bg/config
delete mode 100644 lib/phpexcel/PHPExcel/locale/cs/config
delete mode 100644 lib/phpexcel/PHPExcel/locale/da/config
delete mode 100644 lib/phpexcel/PHPExcel/locale/de/config
delete mode 100644 lib/phpexcel/PHPExcel/locale/en/uk/config
delete mode 100644 lib/phpexcel/PHPExcel/locale/es/config
delete mode 100644 lib/phpexcel/PHPExcel/locale/fi/config
delete mode 100644 lib/phpexcel/PHPExcel/locale/fr/config
delete mode 100644 lib/phpexcel/PHPExcel/locale/hu/config
delete mode 100644 lib/phpexcel/PHPExcel/locale/it/config
delete mode 100644 lib/phpexcel/PHPExcel/locale/nl/config
delete mode 100644 lib/phpexcel/PHPExcel/locale/no/config
delete mode 100644 lib/phpexcel/PHPExcel/locale/pl/config
delete mode 100644 lib/phpexcel/PHPExcel/locale/pt/br/config
delete mode 100644 lib/phpexcel/PHPExcel/locale/pt/config
delete mode 100644 lib/phpexcel/PHPExcel/locale/ru/config
delete mode 100644 lib/phpexcel/PHPExcel/locale/sv/config
delete mode 100644 lib/phpexcel/PHPExcel/locale/tr/config
delete mode 100644 lib/phpexcel/readme_moodle.txt
create mode 100644 lib/phpspreadsheet/readme_moodle.txt
create mode 100644 lib/phpspreadsheet/vendor/autoload.php
create mode 100644 lib/phpspreadsheet/vendor/composer/ClassLoader.php
create mode 100644 lib/phpspreadsheet/vendor/composer/LICENSE
create mode 100644 lib/phpspreadsheet/vendor/composer/autoload_classmap.php
create mode 100644 lib/phpspreadsheet/vendor/composer/autoload_files.php
create mode 100644 lib/phpspreadsheet/vendor/composer/autoload_namespaces.php
create mode 100644 lib/phpspreadsheet/vendor/composer/autoload_psr4.php
create mode 100644 lib/phpspreadsheet/vendor/composer/autoload_real.php
create mode 100644 lib/phpspreadsheet/vendor/composer/autoload_static.php
create mode 100644 lib/phpspreadsheet/vendor/composer/installed.json
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/README.md
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/Autoloader.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/Bootstrap.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/Complex.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/Exception.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/abs.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/acos.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/acosh.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/acot.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/acoth.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/acsc.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/acsch.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/argument.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/asec.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/asech.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/asin.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/asinh.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/atan.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/atanh.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/conjugate.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/cos.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/cosh.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/cot.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/coth.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/csc.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/csch.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/exp.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/inverse.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/ln.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/log10.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/log2.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/negative.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/pow.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/rho.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/sec.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/sech.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/sin.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/sinh.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/sqrt.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/tan.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/tanh.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/theta.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/add.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/divideby.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/divideinto.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/multiply.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/subtract.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/composer.json
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/examples/complexTest.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/examples/testFunctions.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/examples/testOperations.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/complex/license.md
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/README.md
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/buildPhar.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/Autoloader.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/Bootstrap.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Builder.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Exception.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Functions.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Matrix.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Addition.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/DirectSum.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Division.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Multiplication.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Operator.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Subtraction.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/functions/adjoint.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/functions/antidiagonal.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/functions/cofactors.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/functions/determinant.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/functions/diagonal.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/functions/identity.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/functions/inverse.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/functions/minors.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/functions/trace.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/functions/transpose.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/add.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/directsum.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/divideby.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/divideinto.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/multiply.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/subtract.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/composer.json
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/examples/test.php
create mode 100644 lib/phpspreadsheet/vendor/markbaker/matrix/license.md
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/CHANGELOG.PHPExcel.md
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/CHANGELOG.md
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md
rename lib/{phpexcel/PHPExcel/Shared/PCLZip/gnu-lgpl.txt => phpspreadsheet/vendor/phpoffice/phpspreadsheet/LICENSE} (68%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/composer.json
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/composer.lock
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/mkdocs.yml
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/phpunit.xml.dist
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/Bootstrap.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Calculation.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Category.php
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Calculation/Database.php (74%)
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Calculation/DateTime.php (59%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Logger.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Exception.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ExceptionHandler.php
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Calculation/Financial.php (54%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaParser.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaToken.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Calculation/MathTrig.php (51%)
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Calculation/Statistical.php (57%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Token/Stack.php
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Calculation/functionlist.txt (90%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/bg/config
rename lib/{phpexcel/PHPExcel/locale/ru => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/bg}/functions (97%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/cs/config
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation}/locale/cs/functions (95%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/da/config
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation}/locale/da/functions (95%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/de/config
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation}/locale/de/functions (95%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/en/uk/config
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/es/config
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation}/locale/es/functions (95%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fi/config
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation}/locale/fi/functions (95%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fr/config
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation}/locale/fr/functions (95%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/hu/config
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation}/locale/hu/functions (95%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/it/config
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation}/locale/it/functions (95%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/nl/config
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation}/locale/nl/functions (95%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/no/config
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation}/locale/no/functions (95%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pl/config
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation}/locale/pl/functions (95%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/br/config
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation}/locale/pt/br/functions (98%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/config
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation}/locale/pt/functions (98%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/config
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/functions
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/sv/config
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation}/locale/sv/functions (98%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/tr/config
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation}/locale/tr/functions (95%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataType.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidation.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidator.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DefaultValueBinder.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Hyperlink.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/IValueBinder.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/StringValueBinder.php
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Chart/Axis.php (71%)
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart}/Chart.php (51%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeries.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeriesValues.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Exception.php
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Chart/GridLines.php (73%)
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Chart/Layout.php (66%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Legend.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/PlotArea.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Properties.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/IRenderer.php
rename lib/{phpexcel/PHPExcel/Chart/Renderer/jpgraph.php => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/JpGraph.php} (78%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/PHP Charting Libraries.txt
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/Polyfill.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Title.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Cells.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/CellsFactory.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Memory.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Comment.php
rename lib/{phpexcel/PHPExcel/DocumentProperties.php => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Properties.php} (69%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Security.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Exception.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/HashTable.php
rename lib/{phpexcel/PHPExcel/Helper/HTML.php => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Html.php} (94%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Migrator.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Sample.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IComparable.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IOFactory.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/NamedRange.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/DefaultReadFilter.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Exception.php
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Reader/Gnumeric.php (62%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReadFilter.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReader.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Ods.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Security/XmlScanner.php
rename lib/{phpexcel/PHPExcel/Reader/SYLK.php => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Slk.php} (64%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php
rename lib/{phpexcel/PHPExcel/Reader/Excel2007 => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx}/Chart.php (71%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Theme.php
rename lib/{phpexcel/PHPExcel/Reader/Excel2003XML.php => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml.php} (52%)
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/ReferenceHelper.php (51%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/ITextElement.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/RichText.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/Run.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/TextElement.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Settings.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/CodePage.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Date.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Drawing.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php (62%)
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Shared/Escher/DggContainer.php (54%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/File.php
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Shared/Font.php (61%)
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Shared/JAMA/CHANGELOG.TXT (100%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Shared/JAMA/EigenvalueDecomposition.php (71%)
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Shared/JAMA/LUDecomposition.php (66%)
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Shared/JAMA/Matrix.php (52%)
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Shared/JAMA/QRDecomposition.php (62%)
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Shared/JAMA/SingularValueDecomposition.php (74%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/utils/Maths.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/PasswordHasher.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/StringHelper.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/TimeZone.php
rename lib/{phpexcel/PHPExcel/Shared/trend/bestFitClass.php => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/BestFit.php} (66%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LinearBestFit.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PowerBestFit.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Alignment.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Border.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Borders.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Color.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Conditional.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Fill.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Font.php
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Style/NumberFormat.php (55%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Protection.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Style/Supervisor.php (52%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Worksheet/AutoFilter/Column/Rule.php (53%)
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Worksheet/BaseDrawing.php (55%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/CellIterator.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Column.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnDimension.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnIterator.php
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Worksheet/Dimension.php (50%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Worksheet/HeaderFooter.php (62%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Iterator.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageMargins.php
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Worksheet/PageSetup.php (53%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Protection.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Row.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowCellIterator.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowDimension.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowIterator.php
rename lib/{phpexcel/PHPExcel => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet}/Worksheet/SheetView.php (51%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Csv.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Exception.php
rename lib/{phpexcel/PHPExcel/Writer/HTML.php => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Html.php} (50%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/IWriter.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Cell/Comment.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Content.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Meta.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/MetaInf.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Mimetype.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Settings.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Styles.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Thumbnails.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/WriterPart.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Mpdf.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php
rename lib/{phpexcel/PHPExcel/Writer/Excel2007 => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx}/Chart.php (70%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Comments.php
rename lib/{phpexcel/PHPExcel/Writer/Excel2007 => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx}/ContentTypes.php (57%)
rename lib/{phpexcel/PHPExcel/Writer/Excel2007 => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx}/DocProps.php (56%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Drawing.php
rename lib/{phpexcel/PHPExcel/Writer/Excel2007 => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx}/Rels.php (58%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsRibbon.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsVBA.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/StringTable.php
rename lib/{phpexcel/PHPExcel/Writer/Excel2007 => phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx}/Style.php (56%)
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Theme.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Workbook.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php
create mode 100644 lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/WriterPart.php
create mode 100644 lib/phpspreadsheet/vendor/psr/simple-cache/.editorconfig
create mode 100644 lib/phpspreadsheet/vendor/psr/simple-cache/LICENSE.md
create mode 100644 lib/phpspreadsheet/vendor/psr/simple-cache/README.md
create mode 100644 lib/phpspreadsheet/vendor/psr/simple-cache/composer.json
create mode 100644 lib/phpspreadsheet/vendor/psr/simple-cache/src/CacheException.php
create mode 100644 lib/phpspreadsheet/vendor/psr/simple-cache/src/CacheInterface.php
create mode 100644 lib/phpspreadsheet/vendor/psr/simple-cache/src/InvalidArgumentException.php
diff --git a/.eslintignore b/.eslintignore
index b512e29ef62..9a9f6590b11 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -20,7 +20,7 @@ lib/mlbackend/php/phpml/
lib/adodb/
lib/bennu/
lib/evalmath/
-lib/phpexcel/
+lib/phpspreadsheet/
lib/google/
lib/htmlpurifier/
lib/jabber/
diff --git a/.stylelintignore b/.stylelintignore
index da80cf568f4..48ad8b3123e 100644
--- a/.stylelintignore
+++ b/.stylelintignore
@@ -21,7 +21,7 @@ lib/mlbackend/php/phpml/
lib/adodb/
lib/bennu/
lib/evalmath/
-lib/phpexcel/
+lib/phpspreadsheet/
lib/google/
lib/htmlpurifier/
lib/jabber/
diff --git a/lib/excellib.class.php b/lib/excellib.class.php
index ef612b4bde9..f656d64bac2 100644
--- a/lib/excellib.class.php
+++ b/lib/excellib.class.php
@@ -24,6 +24,21 @@
defined('MOODLE_INTERNAL') || die();
+require_once("$CFG->libdir/phpspreadsheet/vendor/autoload.php");
+
+use \PhpOffice\PhpSpreadsheet\Spreadsheet;
+use \PhpOffice\PhpSpreadsheet\IOFactory;
+use \PhpOffice\PhpSpreadsheet\Cell\Coordinate;
+use \PhpOffice\PhpSpreadsheet\Cell\DataType;
+use \PhpOffice\PhpSpreadsheet\Shared\Date;
+use \PhpOffice\PhpSpreadsheet\Style\Alignment;
+use \PhpOffice\PhpSpreadsheet\Style\Border;
+use \PhpOffice\PhpSpreadsheet\Style\Fill;
+use \PhpOffice\PhpSpreadsheet\Style\Font;
+use \PhpOffice\PhpSpreadsheet\Style\NumberFormat;
+use \PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
+use \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
+
/**
* Define and operate over one Moodle Workbook.
*
@@ -35,8 +50,8 @@ defined('MOODLE_INTERNAL') || die();
* @package moodlecore
*/
class MoodleExcelWorkbook {
- /** @var PHPExcel */
- protected $objPHPExcel;
+ /** @var PhpSpreadsheet */
+ protected $objspreadsheet;
/** @var string */
protected $filename;
@@ -48,22 +63,21 @@ class MoodleExcelWorkbook {
* Constructs one Moodle Workbook.
*
* @param string $filename The name of the file
- * @param string $type file format type used to be 'Excel5 or Excel2007' but now only 'Excel2007'
+ * @param string $type file format type used to be 'Xls or Xlsx' but now only 'Xlsx'
*/
- public function __construct($filename, $type = 'Excel2007') {
+ public function __construct($filename, $type = 'Xlsx') {
global $CFG;
- require_once("$CFG->libdir/phpexcel/PHPExcel.php");
- $this->objPHPExcel = new PHPExcel();
- $this->objPHPExcel->removeSheetByIndex(0);
+ $this->objspreadsheet = new Spreadsheet();
+ $this->objspreadsheet->removeSheetByIndex(0);
$this->filename = $filename;
- if (strtolower($type) === 'excel5') {
- debugging('Excel5 is no longer supported, using Excel2007 instead');
- $this->type = 'Excel2007';
+ if (strtolower($type) === 'Xls') {
+ debugging('Xls is no longer supported, using Xlsx instead');
+ $this->type = 'Xlsx';
} else {
- $this->type = 'Excel2007';
+ $this->type = 'Xlsx';
}
}
@@ -74,7 +88,7 @@ class MoodleExcelWorkbook {
* @return MoodleExcelWorksheet
*/
public function add_worksheet($name = '') {
- return new MoodleExcelWorksheet($name, $this->objPHPExcel);
+ return new MoodleExcelWorksheet($name, $this->objspreadsheet);
}
/**
@@ -96,10 +110,10 @@ class MoodleExcelWorkbook {
public function close() {
global $CFG;
- foreach ($this->objPHPExcel->getAllSheets() as $sheet){
+ foreach ($this->objspreadsheet->getAllSheets() as $sheet){
$sheet->setSelectedCells('A1');
}
- $this->objPHPExcel->setActiveSheetIndex(0);
+ $this->objspreadsheet->setActiveSheetIndex(0);
$filename = preg_replace('/\.xlsx?$/i', '', $this->filename);
@@ -125,7 +139,7 @@ class MoodleExcelWorkbook {
header('Content-Type: '.$mimetype);
header('Content-Disposition: attachment;filename="'.$filename.'"');
- $objWriter = PHPExcel_IOFactory::createWriter($this->objPHPExcel, $this->type);
+ $objWriter = IOFactory::createWriter($this->objspreadsheet, $this->type);
$objWriter->save('php://output');
}
@@ -149,16 +163,16 @@ class MoodleExcelWorkbook {
* @package core
*/
class MoodleExcelWorksheet {
- /** @var PHPExcel_Worksheet */
+ /** @var Worksheet */
protected $worksheet;
/**
* Constructs one Moodle Worksheet.
*
* @param string $name The name of the file
- * @param PHPExcel $workbook The internal Workbook object we are creating.
+ * @param Spreadsheet $workbook The internal Workbook object we are creating.
*/
- public function __construct($name, PHPExcel $workbook) {
+ public function __construct($name, Spreadsheet $workbook) {
// Replace any characters in the name that Excel cannot cope with.
$name = strtr(trim($name, "'"), '[]*/\?:', ' ');
// Shorten the title if necessary.
@@ -171,7 +185,7 @@ class MoodleExcelWorksheet {
$name = 'Sheet'.($workbook->getSheetCount()+1);
}
- $this->worksheet = new PHPExcel_Worksheet($workbook, $name);
+ $this->worksheet = new Worksheet($workbook, $name);
$this->worksheet->setPrintGridlines(false);
$workbook->addSheet($this->worksheet);
@@ -186,8 +200,11 @@ class MoodleExcelWorksheet {
* @param mixed $format The XF format for the cell
*/
public function write_string($row, $col, $str, $format = null) {
- $this->worksheet->getStyleByColumnAndRow($col, $row+1)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_TEXT);
- $this->worksheet->setCellValueExplicitByColumnAndRow($col, $row+1, $str, PHPExcel_Cell_DataType::TYPE_STRING);
+ // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
+ $col += 1;
+
+ $this->worksheet->getStyleByColumnAndRow($col, $row+1)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_TEXT);
+ $this->worksheet->setCellValueExplicitByColumnAndRow($col, $row+1, $str, DataType::TYPE_STRING);
$this->apply_format($row, $col, $format);
}
@@ -200,8 +217,11 @@ class MoodleExcelWorksheet {
* @param mixed $format The XF format for the cell
*/
public function write_number($row, $col, $num, $format = null) {
- $this->worksheet->getStyleByColumnAndRow($col, $row+1)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_GENERAL);
- $this->worksheet->setCellValueExplicitByColumnAndRow($col, $row+1, $num, PHPExcel_Cell_DataType::TYPE_NUMERIC);
+ // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
+ $col += 1;
+
+ $this->worksheet->getStyleByColumnAndRow($col, $row+1)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_GENERAL);
+ $this->worksheet->setCellValueExplicitByColumnAndRow($col, $row+1, $num, DataType::TYPE_NUMERIC);
$this->apply_format($row, $col, $format);
}
@@ -214,6 +234,9 @@ class MoodleExcelWorksheet {
* @param mixed $format The XF format for the cell
*/
public function write_url($row, $col, $url, $format = null) {
+ // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
+ $col += 1;
+
$this->worksheet->setCellValueByColumnAndRow($col, $row+1, $url);
$this->worksheet->getCellByColumnAndRow($col, $row+1)->getHyperlink()->setUrl($url);
$this->apply_format($row, $col, $format);
@@ -227,8 +250,11 @@ class MoodleExcelWorksheet {
* @param mixed $format The XF format for the cell
*/
public function write_date($row, $col, $date, $format = null) {
+ // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
+ $col += 1;
+
$getdate = usergetdate($date);
- $exceldate = PHPExcel_Shared_Date::FormattedPHPToExcel(
+ $exceldate = Date::FormattedPHPToExcel(
$getdate['year'],
$getdate['mon'],
$getdate['mday'],
@@ -238,7 +264,7 @@ class MoodleExcelWorksheet {
);
$this->worksheet->setCellValueByColumnAndRow($col, $row+1, $exceldate);
- $this->worksheet->getStyleByColumnAndRow($col, $row+1)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX22);
+ $this->worksheet->getStyleByColumnAndRow($col, $row+1)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_XLSX22);
$this->apply_format($row, $col, $format);
}
@@ -251,7 +277,10 @@ class MoodleExcelWorksheet {
* @param mixed $format The XF format for the cell
*/
public function write_formula($row, $col, $formula, $format = null) {
- $this->worksheet->setCellValueExplicitByColumnAndRow($col, $row+1, $formula, PHPExcel_Cell_DataType::TYPE_FORMULA);
+ // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
+ $col += 1;
+
+ $this->worksheet->setCellValueExplicitByColumnAndRow($col, $row+1, $formula, DataType::TYPE_FORMULA);
$this->apply_format($row, $col, $format);
}
@@ -263,6 +292,9 @@ class MoodleExcelWorksheet {
* @param mixed $format The XF format for the cell
*/
public function write_blank($row, $col, $format = null) {
+ // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
+ $col += 1;
+
$this->worksheet->setCellValueByColumnAndRow($col, $row+1, '');
$this->apply_format($row, $col, $format);
}
@@ -344,8 +376,9 @@ class MoodleExcelWorksheet {
} else if ($level > 7) {
$level = 7;
}
- $i = $firstcol;
- while($i <= $lastcol) {
+ // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
+ $i = $firstcol + 1;
+ while($i <= $lastcol + 1) {
if (isset($width)) {
$this->worksheet->getColumnDimensionByColumn($i)->setWidth($width);
}
@@ -382,9 +415,12 @@ class MoodleExcelWorksheet {
* @param integer $scale_y The vertical scale
*/
public function insert_bitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1) {
- $objDrawing = new PHPExcel_Worksheet_Drawing();
+ // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
+ $col += 1;
+
+ $objDrawing = new Drawing();
$objDrawing->setPath($bitmap);
- $objDrawing->setCoordinates(PHPExcel_Cell::stringFromColumnIndex($col) . ($row+1));
+ $objDrawing->setCoordinates(Coordinate::stringFromColumnIndex($col) . ($row+1));
$objDrawing->setOffsetX($x);
$objDrawing->setOffsetY($y);
$objDrawing->setWorksheet($this->worksheet);
@@ -407,7 +443,8 @@ class MoodleExcelWorksheet {
* @param integer $last_col Last column of the area to merge
*/
public function merge_cells($first_row, $first_col, $last_row, $last_col) {
- $this->worksheet->mergeCellsByColumnAndRow($first_col, $first_row+1, $last_col, $last_row+1);
+ // For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
+ $this->worksheet->mergeCellsByColumnAndRow($first_col + 1, $first_row+1, $last_col + 1, $last_row+1);
}
protected function apply_format($row, $col, $format = null) {
@@ -425,7 +462,7 @@ class MoodleExcelWorksheet {
} else if (is_array($format)) {
$format = new MoodleExcelFormat($format);
}
- $this->worksheet->getStyle(PHPExcel_Cell::stringFromColumnIndex($col))->applyFromArray($format->get_format_array());
+ $this->worksheet->getStyle(Coordinate::stringFromColumnIndex($col))->applyFromArray($format->get_format_array());
}
protected function apply_row_format($row, $format = null) {
@@ -509,11 +546,11 @@ class MoodleExcelFormat {
*/
public function set_underline($underline) {
if ($underline == 1) {
- $this->format['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_SINGLE;
+ $this->format['font']['underline'] = Font::UNDERLINE_SINGLE;
} else if ($underline == 2) {
- $this->format['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_DOUBLE;
+ $this->format['font']['underline'] = Font::UNDERLINE_DOUBLE;
} else {
- $this->format['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_NONE;
+ $this->format['font']['underline'] = Font::UNDERLINE_NONE;
}
}
@@ -528,7 +565,7 @@ class MoodleExcelFormat {
* Set strikeout of the format.
*/
public function set_strikeout() {
- $this->format['font']['strike'] = true;
+ $this->format['font']['strikethrough'] = true;
}
/**
@@ -553,12 +590,12 @@ class MoodleExcelFormat {
*/
public function set_script($script) {
if ($script == 1) {
- $this->format['font']['superScript'] = true;
+ $this->format['font']['superscript'] = true;
} else if ($script == 2) {
- $this->format['font']['subScript'] = true;
+ $this->format['font']['subscript'] = true;
} else {
- $this->format['font']['superScript'] = false;
- $this->format['font']['subScript'] = false;
+ $this->format['font']['superscript'] = false;
+ $this->format['font']['subscript'] = false;
}
}
@@ -656,8 +693,8 @@ class MoodleExcelFormat {
* @param mixed $color either a string (like 'blue'), or an integer (range is [8...63])
*/
public function set_bg_color($color) {
- if (!isset($this->format['fill']['type'])) {
- $this->format['fill']['type'] = PHPExcel_Style_Fill::FILL_SOLID;
+ if (!isset($this->format['fill']['fillType'])) {
+ $this->format['fill']['fillType'] = Fill::FILL_SOLID;
}
$this->format['fill']['color']['rgb'] = $this->parse_color($color);
}
@@ -675,7 +712,7 @@ class MoodleExcelFormat {
}
} else {
unset($this->format['fill']['color']['rgb']);
- unset($this->format['fill']['type']);
+ unset($this->format['fill']['fillType']);
}
}
@@ -683,7 +720,7 @@ class MoodleExcelFormat {
* Set text wrap of the format.
*/
public function set_text_wrap() {
- $this->format['alignment']['wrap'] = true;
+ $this->format['alignment']['wrapText'] = true;
}
/**
@@ -708,20 +745,20 @@ class MoodleExcelFormat {
public function set_h_align($location) {
switch ($location) {
case 'left':
- $this->format['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_LEFT;
+ $this->format['alignment']['horizontal'] = Alignment::HORIZONTAL_LEFT;
break;
case 'center':
case 'centre':
- $this->format['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_CENTER;
+ $this->format['alignment']['horizontal'] = Alignment::HORIZONTAL_CENTER;
break;
case 'right':
- $this->format['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_RIGHT;
+ $this->format['alignment']['horizontal'] = Alignment::HORIZONTAL_RIGHT;
break;
case 'justify':
- $this->format['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY;
+ $this->format['alignment']['horizontal'] = Alignment::HORIZONTAL_JUSTIFY;
break;
default:
- $this->format['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL;
+ $this->format['alignment']['horizontal'] = Alignment::HORIZONTAL_GENERAL;
}
}
@@ -733,20 +770,20 @@ class MoodleExcelFormat {
public function set_v_align($location) {
switch ($location) {
case 'top':
- $this->format['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_TOP;
+ $this->format['alignment']['vertical'] = Alignment::VERTICAL_TOP;
break;
case 'vcentre':
case 'vcenter':
case 'centre':
case 'center':
- $this->format['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_CENTER;
+ $this->format['alignment']['vertical'] = Alignment::VERTICAL_CENTER;
break;
case 'vjustify':
case 'justify':
- $this->format['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_JUSTIFY;
+ $this->format['alignment']['vertical'] = Alignment::VERTICAL_JUSTIFY;
break;
default:
- $this->format['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_BOTTOM;
+ $this->format['alignment']['vertical'] = Alignment::VERTICAL_BOTTOM;
}
}
@@ -757,11 +794,11 @@ class MoodleExcelFormat {
*/
public function set_top($style) {
if ($style == 1) {
- $this->format['borders']['top']['style'] = PHPExcel_Style_Border::BORDER_THIN;
+ $this->format['borders']['top']['borderStyle'] = Border::BORDER_THIN;
} else if ($style == 2) {
- $this->format['borders']['top']['style'] = PHPExcel_Style_Border::BORDER_THICK;
+ $this->format['borders']['top']['borderStyle'] = Border::BORDER_THICK;
} else {
- $this->format['borders']['top']['style'] = PHPExcel_Style_Border::BORDER_NONE;
+ $this->format['borders']['top']['borderStyle'] = Border::BORDER_NONE;
}
}
@@ -772,11 +809,11 @@ class MoodleExcelFormat {
*/
public function set_bottom($style) {
if ($style == 1) {
- $this->format['borders']['bottom']['style'] = PHPExcel_Style_Border::BORDER_THIN;
+ $this->format['borders']['bottom']['borderStyle'] = Border::BORDER_THIN;
} else if ($style == 2) {
- $this->format['borders']['bottom']['style'] = PHPExcel_Style_Border::BORDER_THICK;
+ $this->format['borders']['bottom']['borderStyle'] = Border::BORDER_THICK;
} else {
- $this->format['borders']['bottom']['style'] = PHPExcel_Style_Border::BORDER_NONE;
+ $this->format['borders']['bottom']['borderStyle'] = Border::BORDER_NONE;
}
}
@@ -787,11 +824,11 @@ class MoodleExcelFormat {
*/
public function set_left($style) {
if ($style == 1) {
- $this->format['borders']['left']['style'] = PHPExcel_Style_Border::BORDER_THIN;
+ $this->format['borders']['left']['borderStyle'] = Border::BORDER_THIN;
} else if ($style == 2) {
- $this->format['borders']['left']['style'] = PHPExcel_Style_Border::BORDER_THICK;
+ $this->format['borders']['left']['borderStyle'] = Border::BORDER_THICK;
} else {
- $this->format['borders']['left']['style'] = PHPExcel_Style_Border::BORDER_NONE;
+ $this->format['borders']['left']['borderStyle'] = Border::BORDER_NONE;
}
}
@@ -802,11 +839,11 @@ class MoodleExcelFormat {
*/
public function set_right($style) {
if ($style == 1) {
- $this->format['borders']['right']['style'] = PHPExcel_Style_Border::BORDER_THIN;
+ $this->format['borders']['right']['borderStyle'] = Border::BORDER_THIN;
} else if ($style == 2) {
- $this->format['borders']['right']['style'] = PHPExcel_Style_Border::BORDER_THICK;
+ $this->format['borders']['right']['borderStyle'] = Border::BORDER_THICK;
} else {
- $this->format['borders']['right']['style'] = PHPExcel_Style_Border::BORDER_NONE;
+ $this->format['borders']['right']['borderStyle'] = Border::BORDER_NONE;
}
}
@@ -846,13 +883,13 @@ class MoodleExcelFormat {
$numbers[49] = '@';
if ($num_format !== 0 and in_array($num_format, $numbers)) {
- $this->format['numberformat']['code'] = $num_format;
+ $this->format['numberFormat']['formatCode'] = $num_format;
}
if (!isset($numbers[$num_format])) {
return;
}
- $this->format['numberformat']['code'] = $numbers[$num_format];
+ $this->format['numberFormat']['formatCode'] = $numbers[$num_format];
}
}
diff --git a/lib/phpexcel/PHPExcel.php b/lib/phpexcel/PHPExcel.php
deleted file mode 100644
index c3ec0519788..00000000000
--- a/lib/phpexcel/PHPExcel.php
+++ /dev/null
@@ -1,1152 +0,0 @@
-hasMacros;
- }
-
- /**
- * Define if a workbook has macros
- *
- * @param boolean $hasMacros true|false
- */
- public function setHasMacros($hasMacros = false)
- {
- $this->hasMacros = (bool) $hasMacros;
- }
-
- /**
- * Set the macros code
- *
- * @param string $MacrosCode string|null
- */
- public function setMacrosCode($MacrosCode = null)
- {
- $this->macrosCode=$MacrosCode;
- $this->setHasMacros(!is_null($MacrosCode));
- }
-
- /**
- * Return the macros code
- *
- * @return string|null
- */
- public function getMacrosCode()
- {
- return $this->macrosCode;
- }
-
- /**
- * Set the macros certificate
- *
- * @param string|null $Certificate
- */
- public function setMacrosCertificate($Certificate = null)
- {
- $this->macrosCertificate=$Certificate;
- }
-
- /**
- * Is the project signed ?
- *
- * @return boolean true|false
- */
- public function hasMacrosCertificate()
- {
- return !is_null($this->macrosCertificate);
- }
-
- /**
- * Return the macros certificate
- *
- * @return string|null
- */
- public function getMacrosCertificate()
- {
- return $this->macrosCertificate;
- }
-
- /**
- * Remove all macros, certificate from spreadsheet
- *
- */
- public function discardMacros()
- {
- $this->hasMacros=false;
- $this->macrosCode=null;
- $this->macrosCertificate=null;
- }
-
- /**
- * set ribbon XML data
- *
- */
- public function setRibbonXMLData($Target = null, $XMLData = null)
- {
- if (!is_null($Target) && !is_null($XMLData)) {
- $this->ribbonXMLData = array('target' => $Target, 'data' => $XMLData);
- } else {
- $this->ribbonXMLData = null;
- }
- }
-
- /**
- * retrieve ribbon XML Data
- *
- * return string|null|array
- */
- public function getRibbonXMLData($What = 'all') //we need some constants here...
- {
- $ReturnData = null;
- $What = strtolower($What);
- switch ($What){
- case 'all':
- $ReturnData = $this->ribbonXMLData;
- break;
- case 'target':
- case 'data':
- if (is_array($this->ribbonXMLData) && array_key_exists($What, $this->ribbonXMLData)) {
- $ReturnData = $this->ribbonXMLData[$What];
- }
- break;
- }
-
- return $ReturnData;
- }
-
- /**
- * store binaries ribbon objects (pictures)
- *
- */
- public function setRibbonBinObjects($BinObjectsNames = null, $BinObjectsData = null)
- {
- if (!is_null($BinObjectsNames) && !is_null($BinObjectsData)) {
- $this->ribbonBinObjects = array('names' => $BinObjectsNames, 'data' => $BinObjectsData);
- } else {
- $this->ribbonBinObjects = null;
- }
- }
- /**
- * return the extension of a filename. Internal use for a array_map callback (php<5.3 don't like lambda function)
- *
- */
- private function getExtensionOnly($ThePath)
- {
- return pathinfo($ThePath, PATHINFO_EXTENSION);
- }
-
- /**
- * retrieve Binaries Ribbon Objects
- *
- */
- public function getRibbonBinObjects($What = 'all')
- {
- $ReturnData = null;
- $What = strtolower($What);
- switch($What) {
- case 'all':
- return $this->ribbonBinObjects;
- break;
- case 'names':
- case 'data':
- if (is_array($this->ribbonBinObjects) && array_key_exists($What, $this->ribbonBinObjects)) {
- $ReturnData=$this->ribbonBinObjects[$What];
- }
- break;
- case 'types':
- if (is_array($this->ribbonBinObjects) &&
- array_key_exists('data', $this->ribbonBinObjects) && is_array($this->ribbonBinObjects['data'])) {
- $tmpTypes=array_keys($this->ribbonBinObjects['data']);
- $ReturnData = array_unique(array_map(array($this, 'getExtensionOnly'), $tmpTypes));
- } else {
- $ReturnData=array(); // the caller want an array... not null if empty
- }
- break;
- }
- return $ReturnData;
- }
-
- /**
- * This workbook have a custom UI ?
- *
- * @return true|false
- */
- public function hasRibbon()
- {
- return !is_null($this->ribbonXMLData);
- }
-
- /**
- * This workbook have additionnal object for the ribbon ?
- *
- * @return true|false
- */
- public function hasRibbonBinObjects()
- {
- return !is_null($this->ribbonBinObjects);
- }
-
- /**
- * Check if a sheet with a specified code name already exists
- *
- * @param string $pSheetCodeName Name of the worksheet to check
- * @return boolean
- */
- public function sheetCodeNameExists($pSheetCodeName)
- {
- return ($this->getSheetByCodeName($pSheetCodeName) !== null);
- }
-
- /**
- * Get sheet by code name. Warning : sheet don't have always a code name !
- *
- * @param string $pName Sheet name
- * @return PHPExcel_Worksheet
- */
- public function getSheetByCodeName($pName = '')
- {
- $worksheetCount = count($this->workSheetCollection);
- for ($i = 0; $i < $worksheetCount; ++$i) {
- if ($this->workSheetCollection[$i]->getCodeName() == $pName) {
- return $this->workSheetCollection[$i];
- }
- }
-
- return null;
- }
-
- /**
- * Create a new PHPExcel with one Worksheet
- */
- public function __construct()
- {
- $this->uniqueID = uniqid();
- $this->calculationEngine = PHPExcel_Calculation::getInstance($this);
-
- // Initialise worksheet collection and add one worksheet
- $this->workSheetCollection = array();
- $this->workSheetCollection[] = new PHPExcel_Worksheet($this);
- $this->activeSheetIndex = 0;
-
- // Create document properties
- $this->properties = new PHPExcel_DocumentProperties();
-
- // Create document security
- $this->security = new PHPExcel_DocumentSecurity();
-
- // Set named ranges
- $this->namedRanges = array();
-
- // Create the cellXf supervisor
- $this->cellXfSupervisor = new PHPExcel_Style(true);
- $this->cellXfSupervisor->bindParent($this);
-
- // Create the default style
- $this->addCellXf(new PHPExcel_Style);
- $this->addCellStyleXf(new PHPExcel_Style);
- }
-
- /**
- * Code to execute when this worksheet is unset()
- *
- */
- public function __destruct()
- {
- PHPExcel_Calculation::unsetInstance($this);
- $this->disconnectWorksheets();
- }
-
- /**
- * Disconnect all worksheets from this PHPExcel workbook object,
- * typically so that the PHPExcel object can be unset
- *
- */
- public function disconnectWorksheets()
- {
- $worksheet = null;
- foreach ($this->workSheetCollection as $k => &$worksheet) {
- $worksheet->disconnectCells();
- $this->workSheetCollection[$k] = null;
- }
- unset($worksheet);
- $this->workSheetCollection = array();
- }
-
- /**
- * Return the calculation engine for this worksheet
- *
- * @return PHPExcel_Calculation
- */
- public function getCalculationEngine()
- {
- return $this->calculationEngine;
- } // function getCellCacheController()
-
- /**
- * Get properties
- *
- * @return PHPExcel_DocumentProperties
- */
- public function getProperties()
- {
- return $this->properties;
- }
-
- /**
- * Set properties
- *
- * @param PHPExcel_DocumentProperties $pValue
- */
- public function setProperties(PHPExcel_DocumentProperties $pValue)
- {
- $this->properties = $pValue;
- }
-
- /**
- * Get security
- *
- * @return PHPExcel_DocumentSecurity
- */
- public function getSecurity()
- {
- return $this->security;
- }
-
- /**
- * Set security
- *
- * @param PHPExcel_DocumentSecurity $pValue
- */
- public function setSecurity(PHPExcel_DocumentSecurity $pValue)
- {
- $this->security = $pValue;
- }
-
- /**
- * Get active sheet
- *
- * @return PHPExcel_Worksheet
- *
- * @throws PHPExcel_Exception
- */
- public function getActiveSheet()
- {
- return $this->getSheet($this->activeSheetIndex);
- }
-
- /**
- * Create sheet and add it to this workbook
- *
- * @param int|null $iSheetIndex Index where sheet should go (0,1,..., or null for last)
- * @return PHPExcel_Worksheet
- * @throws PHPExcel_Exception
- */
- public function createSheet($iSheetIndex = null)
- {
- $newSheet = new PHPExcel_Worksheet($this);
- $this->addSheet($newSheet, $iSheetIndex);
- return $newSheet;
- }
-
- /**
- * Check if a sheet with a specified name already exists
- *
- * @param string $pSheetName Name of the worksheet to check
- * @return boolean
- */
- public function sheetNameExists($pSheetName)
- {
- return ($this->getSheetByName($pSheetName) !== null);
- }
-
- /**
- * Add sheet
- *
- * @param PHPExcel_Worksheet $pSheet
- * @param int|null $iSheetIndex Index where sheet should go (0,1,..., or null for last)
- * @return PHPExcel_Worksheet
- * @throws PHPExcel_Exception
- */
- public function addSheet(PHPExcel_Worksheet $pSheet, $iSheetIndex = null)
- {
- if ($this->sheetNameExists($pSheet->getTitle())) {
- throw new PHPExcel_Exception(
- "Workbook already contains a worksheet named '{$pSheet->getTitle()}'. Rename this worksheet first."
- );
- }
-
- if ($iSheetIndex === null) {
- if ($this->activeSheetIndex < 0) {
- $this->activeSheetIndex = 0;
- }
- $this->workSheetCollection[] = $pSheet;
- } else {
- // Insert the sheet at the requested index
- array_splice(
- $this->workSheetCollection,
- $iSheetIndex,
- 0,
- array($pSheet)
- );
-
- // Adjust active sheet index if necessary
- if ($this->activeSheetIndex >= $iSheetIndex) {
- ++$this->activeSheetIndex;
- }
- }
-
- if ($pSheet->getParent() === null) {
- $pSheet->rebindParent($this);
- }
-
- return $pSheet;
- }
-
- /**
- * Remove sheet by index
- *
- * @param int $pIndex Active sheet index
- * @throws PHPExcel_Exception
- */
- public function removeSheetByIndex($pIndex = 0)
- {
-
- $numSheets = count($this->workSheetCollection);
- if ($pIndex > $numSheets - 1) {
- throw new PHPExcel_Exception(
- "You tried to remove a sheet by the out of bounds index: {$pIndex}. The actual number of sheets is {$numSheets}."
- );
- } else {
- array_splice($this->workSheetCollection, $pIndex, 1);
- }
- // Adjust active sheet index if necessary
- if (($this->activeSheetIndex >= $pIndex) &&
- ($pIndex > count($this->workSheetCollection) - 1)) {
- --$this->activeSheetIndex;
- }
-
- }
-
- /**
- * Get sheet by index
- *
- * @param int $pIndex Sheet index
- * @return PHPExcel_Worksheet
- * @throws PHPExcel_Exception
- */
- public function getSheet($pIndex = 0)
- {
- if (!isset($this->workSheetCollection[$pIndex])) {
- $numSheets = $this->getSheetCount();
- throw new PHPExcel_Exception(
- "Your requested sheet index: {$pIndex} is out of bounds. The actual number of sheets is {$numSheets}."
- );
- }
-
- return $this->workSheetCollection[$pIndex];
- }
-
- /**
- * Get all sheets
- *
- * @return PHPExcel_Worksheet[]
- */
- public function getAllSheets()
- {
- return $this->workSheetCollection;
- }
-
- /**
- * Get sheet by name
- *
- * @param string $pName Sheet name
- * @return PHPExcel_Worksheet
- */
- public function getSheetByName($pName = '')
- {
- $worksheetCount = count($this->workSheetCollection);
- for ($i = 0; $i < $worksheetCount; ++$i) {
- if ($this->workSheetCollection[$i]->getTitle() === $pName) {
- return $this->workSheetCollection[$i];
- }
- }
-
- return null;
- }
-
- /**
- * Get index for sheet
- *
- * @param PHPExcel_Worksheet $pSheet
- * @return Sheet index
- * @throws PHPExcel_Exception
- */
- public function getIndex(PHPExcel_Worksheet $pSheet)
- {
- foreach ($this->workSheetCollection as $key => $value) {
- if ($value->getHashCode() == $pSheet->getHashCode()) {
- return $key;
- }
- }
-
- throw new PHPExcel_Exception("Sheet does not exist.");
- }
-
- /**
- * Set index for sheet by sheet name.
- *
- * @param string $sheetName Sheet name to modify index for
- * @param int $newIndex New index for the sheet
- * @return New sheet index
- * @throws PHPExcel_Exception
- */
- public function setIndexByName($sheetName, $newIndex)
- {
- $oldIndex = $this->getIndex($this->getSheetByName($sheetName));
- $pSheet = array_splice(
- $this->workSheetCollection,
- $oldIndex,
- 1
- );
- array_splice(
- $this->workSheetCollection,
- $newIndex,
- 0,
- $pSheet
- );
- return $newIndex;
- }
-
- /**
- * Get sheet count
- *
- * @return int
- */
- public function getSheetCount()
- {
- return count($this->workSheetCollection);
- }
-
- /**
- * Get active sheet index
- *
- * @return int Active sheet index
- */
- public function getActiveSheetIndex()
- {
- return $this->activeSheetIndex;
- }
-
- /**
- * Set active sheet index
- *
- * @param int $pIndex Active sheet index
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function setActiveSheetIndex($pIndex = 0)
- {
- $numSheets = count($this->workSheetCollection);
-
- if ($pIndex > $numSheets - 1) {
- throw new PHPExcel_Exception(
- "You tried to set a sheet active by the out of bounds index: {$pIndex}. The actual number of sheets is {$numSheets}."
- );
- } else {
- $this->activeSheetIndex = $pIndex;
- }
- return $this->getActiveSheet();
- }
-
- /**
- * Set active sheet index by name
- *
- * @param string $pValue Sheet title
- * @return PHPExcel_Worksheet
- * @throws PHPExcel_Exception
- */
- public function setActiveSheetIndexByName($pValue = '')
- {
- if (($worksheet = $this->getSheetByName($pValue)) instanceof PHPExcel_Worksheet) {
- $this->setActiveSheetIndex($this->getIndex($worksheet));
- return $worksheet;
- }
-
- throw new PHPExcel_Exception('Workbook does not contain sheet:' . $pValue);
- }
-
- /**
- * Get sheet names
- *
- * @return string[]
- */
- public function getSheetNames()
- {
- $returnValue = array();
- $worksheetCount = $this->getSheetCount();
- for ($i = 0; $i < $worksheetCount; ++$i) {
- $returnValue[] = $this->getSheet($i)->getTitle();
- }
-
- return $returnValue;
- }
-
- /**
- * Add external sheet
- *
- * @param PHPExcel_Worksheet $pSheet External sheet to add
- * @param int|null $iSheetIndex Index where sheet should go (0,1,..., or null for last)
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function addExternalSheet(PHPExcel_Worksheet $pSheet, $iSheetIndex = null)
- {
- if ($this->sheetNameExists($pSheet->getTitle())) {
- throw new PHPExcel_Exception("Workbook already contains a worksheet named '{$pSheet->getTitle()}'. Rename the external sheet first.");
- }
-
- // count how many cellXfs there are in this workbook currently, we will need this below
- $countCellXfs = count($this->cellXfCollection);
-
- // copy all the shared cellXfs from the external workbook and append them to the current
- foreach ($pSheet->getParent()->getCellXfCollection() as $cellXf) {
- $this->addCellXf(clone $cellXf);
- }
-
- // move sheet to this workbook
- $pSheet->rebindParent($this);
-
- // update the cellXfs
- foreach ($pSheet->getCellCollection(false) as $cellID) {
- $cell = $pSheet->getCell($cellID);
- $cell->setXfIndex($cell->getXfIndex() + $countCellXfs);
- }
-
- return $this->addSheet($pSheet, $iSheetIndex);
- }
-
- /**
- * Get named ranges
- *
- * @return PHPExcel_NamedRange[]
- */
- public function getNamedRanges()
- {
- return $this->namedRanges;
- }
-
- /**
- * Add named range
- *
- * @param PHPExcel_NamedRange $namedRange
- * @return PHPExcel
- */
- public function addNamedRange(PHPExcel_NamedRange $namedRange)
- {
- if ($namedRange->getScope() == null) {
- // global scope
- $this->namedRanges[$namedRange->getName()] = $namedRange;
- } else {
- // local scope
- $this->namedRanges[$namedRange->getScope()->getTitle().'!'.$namedRange->getName()] = $namedRange;
- }
- return true;
- }
-
- /**
- * Get named range
- *
- * @param string $namedRange
- * @param PHPExcel_Worksheet|null $pSheet Scope. Use null for global scope
- * @return PHPExcel_NamedRange|null
- */
- public function getNamedRange($namedRange, PHPExcel_Worksheet $pSheet = null)
- {
- $returnValue = null;
-
- if ($namedRange != '' && ($namedRange !== null)) {
- // first look for global defined name
- if (isset($this->namedRanges[$namedRange])) {
- $returnValue = $this->namedRanges[$namedRange];
- }
-
- // then look for local defined name (has priority over global defined name if both names exist)
- if (($pSheet !== null) && isset($this->namedRanges[$pSheet->getTitle() . '!' . $namedRange])) {
- $returnValue = $this->namedRanges[$pSheet->getTitle() . '!' . $namedRange];
- }
- }
-
- return $returnValue;
- }
-
- /**
- * Remove named range
- *
- * @param string $namedRange
- * @param PHPExcel_Worksheet|null $pSheet Scope: use null for global scope.
- * @return PHPExcel
- */
- public function removeNamedRange($namedRange, PHPExcel_Worksheet $pSheet = null)
- {
- if ($pSheet === null) {
- if (isset($this->namedRanges[$namedRange])) {
- unset($this->namedRanges[$namedRange]);
- }
- } else {
- if (isset($this->namedRanges[$pSheet->getTitle() . '!' . $namedRange])) {
- unset($this->namedRanges[$pSheet->getTitle() . '!' . $namedRange]);
- }
- }
- return $this;
- }
-
- /**
- * Get worksheet iterator
- *
- * @return PHPExcel_WorksheetIterator
- */
- public function getWorksheetIterator()
- {
- return new PHPExcel_WorksheetIterator($this);
- }
-
- /**
- * Copy workbook (!= clone!)
- *
- * @return PHPExcel
- */
- public function copy()
- {
- $copied = clone $this;
-
- $worksheetCount = count($this->workSheetCollection);
- for ($i = 0; $i < $worksheetCount; ++$i) {
- $this->workSheetCollection[$i] = $this->workSheetCollection[$i]->copy();
- $this->workSheetCollection[$i]->rebindParent($this);
- }
-
- return $copied;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- foreach ($this as $key => $val) {
- if (is_object($val) || (is_array($val))) {
- $this->{$key} = unserialize(serialize($val));
- }
- }
- }
-
- /**
- * Get the workbook collection of cellXfs
- *
- * @return PHPExcel_Style[]
- */
- public function getCellXfCollection()
- {
- return $this->cellXfCollection;
- }
-
- /**
- * Get cellXf by index
- *
- * @param int $pIndex
- * @return PHPExcel_Style
- */
- public function getCellXfByIndex($pIndex = 0)
- {
- return $this->cellXfCollection[$pIndex];
- }
-
- /**
- * Get cellXf by hash code
- *
- * @param string $pValue
- * @return PHPExcel_Style|false
- */
- public function getCellXfByHashCode($pValue = '')
- {
- foreach ($this->cellXfCollection as $cellXf) {
- if ($cellXf->getHashCode() == $pValue) {
- return $cellXf;
- }
- }
- return false;
- }
-
- /**
- * Check if style exists in style collection
- *
- * @param PHPExcel_Style $pCellStyle
- * @return boolean
- */
- public function cellXfExists($pCellStyle = null)
- {
- return in_array($pCellStyle, $this->cellXfCollection, true);
- }
-
- /**
- * Get default style
- *
- * @return PHPExcel_Style
- * @throws PHPExcel_Exception
- */
- public function getDefaultStyle()
- {
- if (isset($this->cellXfCollection[0])) {
- return $this->cellXfCollection[0];
- }
- throw new PHPExcel_Exception('No default style found for this workbook');
- }
-
- /**
- * Add a cellXf to the workbook
- *
- * @param PHPExcel_Style $style
- */
- public function addCellXf(PHPExcel_Style $style)
- {
- $this->cellXfCollection[] = $style;
- $style->setIndex(count($this->cellXfCollection) - 1);
- }
-
- /**
- * Remove cellXf by index. It is ensured that all cells get their xf index updated.
- *
- * @param integer $pIndex Index to cellXf
- * @throws PHPExcel_Exception
- */
- public function removeCellXfByIndex($pIndex = 0)
- {
- if ($pIndex > count($this->cellXfCollection) - 1) {
- throw new PHPExcel_Exception("CellXf index is out of bounds.");
- } else {
- // first remove the cellXf
- array_splice($this->cellXfCollection, $pIndex, 1);
-
- // then update cellXf indexes for cells
- foreach ($this->workSheetCollection as $worksheet) {
- foreach ($worksheet->getCellCollection(false) as $cellID) {
- $cell = $worksheet->getCell($cellID);
- $xfIndex = $cell->getXfIndex();
- if ($xfIndex > $pIndex) {
- // decrease xf index by 1
- $cell->setXfIndex($xfIndex - 1);
- } elseif ($xfIndex == $pIndex) {
- // set to default xf index 0
- $cell->setXfIndex(0);
- }
- }
- }
- }
- }
-
- /**
- * Get the cellXf supervisor
- *
- * @return PHPExcel_Style
- */
- public function getCellXfSupervisor()
- {
- return $this->cellXfSupervisor;
- }
-
- /**
- * Get the workbook collection of cellStyleXfs
- *
- * @return PHPExcel_Style[]
- */
- public function getCellStyleXfCollection()
- {
- return $this->cellStyleXfCollection;
- }
-
- /**
- * Get cellStyleXf by index
- *
- * @param integer $pIndex Index to cellXf
- * @return PHPExcel_Style
- */
- public function getCellStyleXfByIndex($pIndex = 0)
- {
- return $this->cellStyleXfCollection[$pIndex];
- }
-
- /**
- * Get cellStyleXf by hash code
- *
- * @param string $pValue
- * @return PHPExcel_Style|false
- */
- public function getCellStyleXfByHashCode($pValue = '')
- {
- foreach ($this->cellStyleXfCollection as $cellStyleXf) {
- if ($cellStyleXf->getHashCode() == $pValue) {
- return $cellStyleXf;
- }
- }
- return false;
- }
-
- /**
- * Add a cellStyleXf to the workbook
- *
- * @param PHPExcel_Style $pStyle
- */
- public function addCellStyleXf(PHPExcel_Style $pStyle)
- {
- $this->cellStyleXfCollection[] = $pStyle;
- $pStyle->setIndex(count($this->cellStyleXfCollection) - 1);
- }
-
- /**
- * Remove cellStyleXf by index
- *
- * @param integer $pIndex Index to cellXf
- * @throws PHPExcel_Exception
- */
- public function removeCellStyleXfByIndex($pIndex = 0)
- {
- if ($pIndex > count($this->cellStyleXfCollection) - 1) {
- throw new PHPExcel_Exception("CellStyleXf index is out of bounds.");
- } else {
- array_splice($this->cellStyleXfCollection, $pIndex, 1);
- }
- }
-
- /**
- * Eliminate all unneeded cellXf and afterwards update the xfIndex for all cells
- * and columns in the workbook
- */
- public function garbageCollect()
- {
- // how many references are there to each cellXf ?
- $countReferencesCellXf = array();
- foreach ($this->cellXfCollection as $index => $cellXf) {
- $countReferencesCellXf[$index] = 0;
- }
-
- foreach ($this->getWorksheetIterator() as $sheet) {
- // from cells
- foreach ($sheet->getCellCollection(false) as $cellID) {
- $cell = $sheet->getCell($cellID);
- ++$countReferencesCellXf[$cell->getXfIndex()];
- }
-
- // from row dimensions
- foreach ($sheet->getRowDimensions() as $rowDimension) {
- if ($rowDimension->getXfIndex() !== null) {
- ++$countReferencesCellXf[$rowDimension->getXfIndex()];
- }
- }
-
- // from column dimensions
- foreach ($sheet->getColumnDimensions() as $columnDimension) {
- ++$countReferencesCellXf[$columnDimension->getXfIndex()];
- }
- }
-
- // remove cellXfs without references and create mapping so we can update xfIndex
- // for all cells and columns
- $countNeededCellXfs = 0;
- foreach ($this->cellXfCollection as $index => $cellXf) {
- if ($countReferencesCellXf[$index] > 0 || $index == 0) { // we must never remove the first cellXf
- ++$countNeededCellXfs;
- } else {
- unset($this->cellXfCollection[$index]);
- }
- $map[$index] = $countNeededCellXfs - 1;
- }
- $this->cellXfCollection = array_values($this->cellXfCollection);
-
- // update the index for all cellXfs
- foreach ($this->cellXfCollection as $i => $cellXf) {
- $cellXf->setIndex($i);
- }
-
- // make sure there is always at least one cellXf (there should be)
- if (empty($this->cellXfCollection)) {
- $this->cellXfCollection[] = new PHPExcel_Style();
- }
-
- // update the xfIndex for all cells, row dimensions, column dimensions
- foreach ($this->getWorksheetIterator() as $sheet) {
- // for all cells
- foreach ($sheet->getCellCollection(false) as $cellID) {
- $cell = $sheet->getCell($cellID);
- $cell->setXfIndex($map[$cell->getXfIndex()]);
- }
-
- // for all row dimensions
- foreach ($sheet->getRowDimensions() as $rowDimension) {
- if ($rowDimension->getXfIndex() !== null) {
- $rowDimension->setXfIndex($map[$rowDimension->getXfIndex()]);
- }
- }
-
- // for all column dimensions
- foreach ($sheet->getColumnDimensions() as $columnDimension) {
- $columnDimension->setXfIndex($map[$columnDimension->getXfIndex()]);
- }
-
- // also do garbage collection for all the sheets
- $sheet->garbageCollect();
- }
- }
-
- /**
- * Return the unique ID value assigned to this spreadsheet workbook
- *
- * @return string
- */
- public function getID()
- {
- return $this->uniqueID;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Autoloader.php b/lib/phpexcel/PHPExcel/Autoloader.php
deleted file mode 100644
index c3b95a20c45..00000000000
--- a/lib/phpexcel/PHPExcel/Autoloader.php
+++ /dev/null
@@ -1,81 +0,0 @@
-= 0) {
- return spl_autoload_register(array('PHPExcel_Autoloader', 'load'), true, true);
- } else {
- return spl_autoload_register(array('PHPExcel_Autoloader', 'load'));
- }
- }
-
- /**
- * Autoload a class identified by name
- *
- * @param string $pClassName Name of the object to load
- */
- public static function load($pClassName)
- {
- if ((class_exists($pClassName, false)) || (strpos($pClassName, 'PHPExcel') !== 0)) {
- // Either already loaded, or not a PHPExcel class request
- return false;
- }
-
- $pClassFilePath = PHPEXCEL_ROOT .
- str_replace('_', DIRECTORY_SEPARATOR, $pClassName) .
- '.php';
-
- if ((file_exists($pClassFilePath) === false) || (is_readable($pClassFilePath) === false)) {
- // Can't load
- return false;
- }
-
- require($pClassFilePath);
- }
-}
diff --git a/lib/phpexcel/PHPExcel/CachedObjectStorage/APC.php b/lib/phpexcel/PHPExcel/CachedObjectStorage/APC.php
deleted file mode 100644
index c74b07fee53..00000000000
--- a/lib/phpexcel/PHPExcel/CachedObjectStorage/APC.php
+++ /dev/null
@@ -1,290 +0,0 @@
-currentCellIsDirty && !empty($this->currentObjectID)) {
- $this->currentObject->detach();
-
- if (!apc_store(
- $this->cachePrefix . $this->currentObjectID . '.cache',
- serialize($this->currentObject),
- $this->cacheTime
- )) {
- $this->__destruct();
- throw new PHPExcel_Exception('Failed to store cell ' . $this->currentObjectID . ' in APC');
- }
- $this->currentCellIsDirty = false;
- }
- $this->currentObjectID = $this->currentObject = null;
- }
-
- /**
- * Add or Update a cell in cache identified by coordinate address
- *
- * @access public
- * @param string $pCoord Coordinate address of the cell to update
- * @param PHPExcel_Cell $cell Cell to update
- * @return PHPExcel_Cell
- * @throws PHPExcel_Exception
- */
- public function addCacheData($pCoord, PHPExcel_Cell $cell)
- {
- if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
- $this->storeData();
- }
- $this->cellCache[$pCoord] = true;
-
- $this->currentObjectID = $pCoord;
- $this->currentObject = $cell;
- $this->currentCellIsDirty = true;
-
- return $cell;
- }
-
- /**
- * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
- *
- * @access public
- * @param string $pCoord Coordinate address of the cell to check
- * @throws PHPExcel_Exception
- * @return boolean
- */
- public function isDataSet($pCoord)
- {
- // Check if the requested entry is the current object, or exists in the cache
- if (parent::isDataSet($pCoord)) {
- if ($this->currentObjectID == $pCoord) {
- return true;
- }
- // Check if the requested entry still exists in apc
- $success = apc_fetch($this->cachePrefix.$pCoord.'.cache');
- if ($success === false) {
- // Entry no longer exists in APC, so clear it from the cache array
- parent::deleteCacheData($pCoord);
- throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in APC cache');
- }
- return true;
- }
- return false;
- }
-
- /**
- * Get cell at a specific coordinate
- *
- * @access public
- * @param string $pCoord Coordinate of the cell
- * @throws PHPExcel_Exception
- * @return PHPExcel_Cell Cell that was found, or null if not found
- */
- public function getCacheData($pCoord)
- {
- if ($pCoord === $this->currentObjectID) {
- return $this->currentObject;
- }
- $this->storeData();
-
- // Check if the entry that has been requested actually exists
- if (parent::isDataSet($pCoord)) {
- $obj = apc_fetch($this->cachePrefix . $pCoord . '.cache');
- if ($obj === false) {
- // Entry no longer exists in APC, so clear it from the cache array
- parent::deleteCacheData($pCoord);
- throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in APC cache');
- }
- } else {
- // Return null if requested entry doesn't exist in cache
- return null;
- }
-
- // Set current entry to the requested entry
- $this->currentObjectID = $pCoord;
- $this->currentObject = unserialize($obj);
- // Re-attach this as the cell's parent
- $this->currentObject->attach($this);
-
- // Return requested entry
- return $this->currentObject;
- }
-
- /**
- * Get a list of all cell addresses currently held in cache
- *
- * @return string[]
- */
- public function getCellList()
- {
- if ($this->currentObjectID !== null) {
- $this->storeData();
- }
-
- return parent::getCellList();
- }
-
- /**
- * Delete a cell in cache identified by coordinate address
- *
- * @access public
- * @param string $pCoord Coordinate address of the cell to delete
- * @throws PHPExcel_Exception
- */
- public function deleteCacheData($pCoord)
- {
- // Delete the entry from APC
- apc_delete($this->cachePrefix.$pCoord.'.cache');
-
- // Delete the entry from our cell address array
- parent::deleteCacheData($pCoord);
- }
-
- /**
- * Clone the cell collection
- *
- * @access public
- * @param PHPExcel_Worksheet $parent The new worksheet
- * @throws PHPExcel_Exception
- * @return void
- */
- public function copyCellCollection(PHPExcel_Worksheet $parent)
- {
- parent::copyCellCollection($parent);
- // Get a new id for the new file name
- $baseUnique = $this->getUniqueID();
- $newCachePrefix = substr(md5($baseUnique), 0, 8) . '.';
- $cacheList = $this->getCellList();
- foreach ($cacheList as $cellID) {
- if ($cellID != $this->currentObjectID) {
- $obj = apc_fetch($this->cachePrefix . $cellID . '.cache');
- if ($obj === false) {
- // Entry no longer exists in APC, so clear it from the cache array
- parent::deleteCacheData($cellID);
- throw new PHPExcel_Exception('Cell entry ' . $cellID . ' no longer exists in APC');
- }
- if (!apc_store($newCachePrefix . $cellID . '.cache', $obj, $this->cacheTime)) {
- $this->__destruct();
- throw new PHPExcel_Exception('Failed to store cell ' . $cellID . ' in APC');
- }
- }
- }
- $this->cachePrefix = $newCachePrefix;
- }
-
- /**
- * Clear the cell collection and disconnect from our parent
- *
- * @return void
- */
- public function unsetWorksheetCells()
- {
- if ($this->currentObject !== null) {
- $this->currentObject->detach();
- $this->currentObject = $this->currentObjectID = null;
- }
-
- // Flush the APC cache
- $this->__destruct();
-
- $this->cellCache = array();
-
- // detach ourself from the worksheet, so that it can then delete this object successfully
- $this->parent = null;
- }
-
- /**
- * Initialise this new cell collection
- *
- * @param PHPExcel_Worksheet $parent The worksheet for this cell collection
- * @param array of mixed $arguments Additional initialisation arguments
- */
- public function __construct(PHPExcel_Worksheet $parent, $arguments)
- {
- $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600;
-
- if ($this->cachePrefix === null) {
- $baseUnique = $this->getUniqueID();
- $this->cachePrefix = substr(md5($baseUnique), 0, 8) . '.';
- $this->cacheTime = $cacheTime;
-
- parent::__construct($parent);
- }
- }
-
- /**
- * Destroy this cell collection
- */
- public function __destruct()
- {
- $cacheList = $this->getCellList();
- foreach ($cacheList as $cellID) {
- apc_delete($this->cachePrefix . $cellID . '.cache');
- }
- }
-
- /**
- * Identify whether the caching method is currently available
- * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
- *
- * @return boolean
- */
- public static function cacheMethodIsAvailable()
- {
- if (!function_exists('apc_store')) {
- return false;
- }
- if (apc_sma_info() === false) {
- return false;
- }
-
- return true;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/CachedObjectStorage/CacheBase.php b/lib/phpexcel/PHPExcel/CachedObjectStorage/CacheBase.php
deleted file mode 100644
index 9a12ec86e06..00000000000
--- a/lib/phpexcel/PHPExcel/CachedObjectStorage/CacheBase.php
+++ /dev/null
@@ -1,368 +0,0 @@
-parent = $parent;
- }
-
- /**
- * Return the parent worksheet for this cell collection
- *
- * @return PHPExcel_Worksheet
- */
- public function getParent()
- {
- return $this->parent;
- }
-
- /**
- * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
- *
- * @param string $pCoord Coordinate address of the cell to check
- * @return boolean
- */
- public function isDataSet($pCoord)
- {
- if ($pCoord === $this->currentObjectID) {
- return true;
- }
- // Check if the requested entry exists in the cache
- return isset($this->cellCache[$pCoord]);
- }
-
- /**
- * Move a cell object from one address to another
- *
- * @param string $fromAddress Current address of the cell to move
- * @param string $toAddress Destination address of the cell to move
- * @return boolean
- */
- public function moveCell($fromAddress, $toAddress)
- {
- if ($fromAddress === $this->currentObjectID) {
- $this->currentObjectID = $toAddress;
- }
- $this->currentCellIsDirty = true;
- if (isset($this->cellCache[$fromAddress])) {
- $this->cellCache[$toAddress] = &$this->cellCache[$fromAddress];
- unset($this->cellCache[$fromAddress]);
- }
-
- return true;
- }
-
- /**
- * Add or Update a cell in cache
- *
- * @param PHPExcel_Cell $cell Cell to update
- * @return PHPExcel_Cell
- * @throws PHPExcel_Exception
- */
- public function updateCacheData(PHPExcel_Cell $cell)
- {
- return $this->addCacheData($cell->getCoordinate(), $cell);
- }
-
- /**
- * Delete a cell in cache identified by coordinate address
- *
- * @param string $pCoord Coordinate address of the cell to delete
- * @throws PHPExcel_Exception
- */
- public function deleteCacheData($pCoord)
- {
- if ($pCoord === $this->currentObjectID && !is_null($this->currentObject)) {
- $this->currentObject->detach();
- $this->currentObjectID = $this->currentObject = null;
- }
-
- if (is_object($this->cellCache[$pCoord])) {
- $this->cellCache[$pCoord]->detach();
- unset($this->cellCache[$pCoord]);
- }
- $this->currentCellIsDirty = false;
- }
-
- /**
- * Get a list of all cell addresses currently held in cache
- *
- * @return string[]
- */
- public function getCellList()
- {
- return array_keys($this->cellCache);
- }
-
- /**
- * Sort the list of all cell addresses currently held in cache by row and column
- *
- * @return string[]
- */
- public function getSortedCellList()
- {
- $sortKeys = array();
- foreach ($this->getCellList() as $coord) {
- sscanf($coord, '%[A-Z]%d', $column, $row);
- $sortKeys[sprintf('%09d%3s', $row, $column)] = $coord;
- }
- ksort($sortKeys);
-
- return array_values($sortKeys);
- }
-
- /**
- * Get highest worksheet column and highest row that have cell records
- *
- * @return array Highest column name and highest row number
- */
- public function getHighestRowAndColumn()
- {
- // Lookup highest column and highest row
- $col = array('A' => '1A');
- $row = array(1);
- foreach ($this->getCellList() as $coord) {
- sscanf($coord, '%[A-Z]%d', $c, $r);
- $row[$r] = $r;
- $col[$c] = strlen($c).$c;
- }
- if (!empty($row)) {
- // Determine highest column and row
- $highestRow = max($row);
- $highestColumn = substr(max($col), 1);
- }
-
- return array(
- 'row' => $highestRow,
- 'column' => $highestColumn
- );
- }
-
- /**
- * Return the cell address of the currently active cell object
- *
- * @return string
- */
- public function getCurrentAddress()
- {
- return $this->currentObjectID;
- }
-
- /**
- * Return the column address of the currently active cell object
- *
- * @return string
- */
- public function getCurrentColumn()
- {
- sscanf($this->currentObjectID, '%[A-Z]%d', $column, $row);
- return $column;
- }
-
- /**
- * Return the row address of the currently active cell object
- *
- * @return integer
- */
- public function getCurrentRow()
- {
- sscanf($this->currentObjectID, '%[A-Z]%d', $column, $row);
- return (integer) $row;
- }
-
- /**
- * Get highest worksheet column
- *
- * @param string $row Return the highest column for the specified row,
- * or the highest column of any row if no row number is passed
- * @return string Highest column name
- */
- public function getHighestColumn($row = null)
- {
- if ($row == null) {
- $colRow = $this->getHighestRowAndColumn();
- return $colRow['column'];
- }
-
- $columnList = array(1);
- foreach ($this->getCellList() as $coord) {
- sscanf($coord, '%[A-Z]%d', $c, $r);
- if ($r != $row) {
- continue;
- }
- $columnList[] = PHPExcel_Cell::columnIndexFromString($c);
- }
- return PHPExcel_Cell::stringFromColumnIndex(max($columnList) - 1);
- }
-
- /**
- * Get highest worksheet row
- *
- * @param string $column Return the highest row for the specified column,
- * or the highest row of any column if no column letter is passed
- * @return int Highest row number
- */
- public function getHighestRow($column = null)
- {
- if ($column == null) {
- $colRow = $this->getHighestRowAndColumn();
- return $colRow['row'];
- }
-
- $rowList = array(0);
- foreach ($this->getCellList() as $coord) {
- sscanf($coord, '%[A-Z]%d', $c, $r);
- if ($c != $column) {
- continue;
- }
- $rowList[] = $r;
- }
-
- return max($rowList);
- }
-
- /**
- * Generate a unique ID for cache referencing
- *
- * @return string Unique Reference
- */
- protected function getUniqueID()
- {
- if (function_exists('posix_getpid')) {
- $baseUnique = posix_getpid();
- } else {
- $baseUnique = mt_rand();
- }
- return uniqid($baseUnique, true);
- }
-
- /**
- * Clone the cell collection
- *
- * @param PHPExcel_Worksheet $parent The new worksheet
- * @return void
- */
- public function copyCellCollection(PHPExcel_Worksheet $parent)
- {
- $this->currentCellIsDirty;
- $this->storeData();
-
- $this->parent = $parent;
- if (($this->currentObject !== null) && (is_object($this->currentObject))) {
- $this->currentObject->attach($this);
- }
- } // function copyCellCollection()
-
- /**
- * Remove a row, deleting all cells in that row
- *
- * @param string $row Row number to remove
- * @return void
- */
- public function removeRow($row)
- {
- foreach ($this->getCellList() as $coord) {
- sscanf($coord, '%[A-Z]%d', $c, $r);
- if ($r == $row) {
- $this->deleteCacheData($coord);
- }
- }
- }
-
- /**
- * Remove a column, deleting all cells in that column
- *
- * @param string $column Column ID to remove
- * @return void
- */
- public function removeColumn($column)
- {
- foreach ($this->getCellList() as $coord) {
- sscanf($coord, '%[A-Z]%d', $c, $r);
- if ($c == $column) {
- $this->deleteCacheData($coord);
- }
- }
- }
-
- /**
- * Identify whether the caching method is currently available
- * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
- *
- * @return boolean
- */
- public static function cacheMethodIsAvailable()
- {
- return true;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/CachedObjectStorage/DiscISAM.php b/lib/phpexcel/PHPExcel/CachedObjectStorage/DiscISAM.php
deleted file mode 100644
index 13bc03375db..00000000000
--- a/lib/phpexcel/PHPExcel/CachedObjectStorage/DiscISAM.php
+++ /dev/null
@@ -1,208 +0,0 @@
-currentCellIsDirty && !empty($this->currentObjectID)) {
- $this->currentObject->detach();
-
- fseek($this->fileHandle, 0, SEEK_END);
-
- $this->cellCache[$this->currentObjectID] = array(
- 'ptr' => ftell($this->fileHandle),
- 'sz' => fwrite($this->fileHandle, serialize($this->currentObject))
- );
- $this->currentCellIsDirty = false;
- }
- $this->currentObjectID = $this->currentObject = null;
- }
-
- /**
- * Add or Update a cell in cache identified by coordinate address
- *
- * @param string $pCoord Coordinate address of the cell to update
- * @param PHPExcel_Cell $cell Cell to update
- * @return PHPExcel_Cell
- * @throws PHPExcel_Exception
- */
- public function addCacheData($pCoord, PHPExcel_Cell $cell)
- {
- if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
- $this->storeData();
- }
-
- $this->currentObjectID = $pCoord;
- $this->currentObject = $cell;
- $this->currentCellIsDirty = true;
-
- return $cell;
- }
-
- /**
- * Get cell at a specific coordinate
- *
- * @param string $pCoord Coordinate of the cell
- * @throws PHPExcel_Exception
- * @return PHPExcel_Cell Cell that was found, or null if not found
- */
- public function getCacheData($pCoord)
- {
- if ($pCoord === $this->currentObjectID) {
- return $this->currentObject;
- }
- $this->storeData();
-
- // Check if the entry that has been requested actually exists
- if (!isset($this->cellCache[$pCoord])) {
- // Return null if requested entry doesn't exist in cache
- return null;
- }
-
- // Set current entry to the requested entry
- $this->currentObjectID = $pCoord;
- fseek($this->fileHandle, $this->cellCache[$pCoord]['ptr']);
- $this->currentObject = unserialize(fread($this->fileHandle, $this->cellCache[$pCoord]['sz']));
- // Re-attach this as the cell's parent
- $this->currentObject->attach($this);
-
- // Return requested entry
- return $this->currentObject;
- }
-
- /**
- * Get a list of all cell addresses currently held in cache
- *
- * @return string[]
- */
- public function getCellList()
- {
- if ($this->currentObjectID !== null) {
- $this->storeData();
- }
-
- return parent::getCellList();
- }
-
- /**
- * Clone the cell collection
- *
- * @param PHPExcel_Worksheet $parent The new worksheet
- */
- public function copyCellCollection(PHPExcel_Worksheet $parent)
- {
- parent::copyCellCollection($parent);
- // Get a new id for the new file name
- $baseUnique = $this->getUniqueID();
- $newFileName = $this->cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache';
- // Copy the existing cell cache file
- copy($this->fileName, $newFileName);
- $this->fileName = $newFileName;
- // Open the copied cell cache file
- $this->fileHandle = fopen($this->fileName, 'a+');
- }
-
- /**
- * Clear the cell collection and disconnect from our parent
- *
- */
- public function unsetWorksheetCells()
- {
- if (!is_null($this->currentObject)) {
- $this->currentObject->detach();
- $this->currentObject = $this->currentObjectID = null;
- }
- $this->cellCache = array();
-
- // detach ourself from the worksheet, so that it can then delete this object successfully
- $this->parent = null;
-
- // Close down the temporary cache file
- $this->__destruct();
- }
-
- /**
- * Initialise this new cell collection
- *
- * @param PHPExcel_Worksheet $parent The worksheet for this cell collection
- * @param array of mixed $arguments Additional initialisation arguments
- */
- public function __construct(PHPExcel_Worksheet $parent, $arguments)
- {
- $this->cacheDirectory = ((isset($arguments['dir'])) && ($arguments['dir'] !== null))
- ? $arguments['dir']
- : PHPExcel_Shared_File::sys_get_temp_dir();
-
- parent::__construct($parent);
- if (is_null($this->fileHandle)) {
- $baseUnique = $this->getUniqueID();
- $this->fileName = $this->cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache';
- $this->fileHandle = fopen($this->fileName, 'a+');
- }
- }
-
- /**
- * Destroy this cell collection
- */
- public function __destruct()
- {
- if (!is_null($this->fileHandle)) {
- fclose($this->fileHandle);
- unlink($this->fileName);
- }
- $this->fileHandle = null;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/CachedObjectStorage/ICache.php b/lib/phpexcel/PHPExcel/CachedObjectStorage/ICache.php
deleted file mode 100644
index aafef6e9c25..00000000000
--- a/lib/phpexcel/PHPExcel/CachedObjectStorage/ICache.php
+++ /dev/null
@@ -1,103 +0,0 @@
-currentCellIsDirty && !empty($this->currentObjectID)) {
- $this->currentObject->detach();
-
- $this->cellCache[$this->currentObjectID] = igbinary_serialize($this->currentObject);
- $this->currentCellIsDirty = false;
- }
- $this->currentObjectID = $this->currentObject = null;
- } // function _storeData()
-
-
- /**
- * Add or Update a cell in cache identified by coordinate address
- *
- * @param string $pCoord Coordinate address of the cell to update
- * @param PHPExcel_Cell $cell Cell to update
- * @return PHPExcel_Cell
- * @throws PHPExcel_Exception
- */
- public function addCacheData($pCoord, PHPExcel_Cell $cell)
- {
- if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
- $this->storeData();
- }
-
- $this->currentObjectID = $pCoord;
- $this->currentObject = $cell;
- $this->currentCellIsDirty = true;
-
- return $cell;
- } // function addCacheData()
-
-
- /**
- * Get cell at a specific coordinate
- *
- * @param string $pCoord Coordinate of the cell
- * @throws PHPExcel_Exception
- * @return PHPExcel_Cell Cell that was found, or null if not found
- */
- public function getCacheData($pCoord)
- {
- if ($pCoord === $this->currentObjectID) {
- return $this->currentObject;
- }
- $this->storeData();
-
- // Check if the entry that has been requested actually exists
- if (!isset($this->cellCache[$pCoord])) {
- // Return null if requested entry doesn't exist in cache
- return null;
- }
-
- // Set current entry to the requested entry
- $this->currentObjectID = $pCoord;
- $this->currentObject = igbinary_unserialize($this->cellCache[$pCoord]);
- // Re-attach this as the cell's parent
- $this->currentObject->attach($this);
-
- // Return requested entry
- return $this->currentObject;
- } // function getCacheData()
-
-
- /**
- * Get a list of all cell addresses currently held in cache
- *
- * @return string[]
- */
- public function getCellList()
- {
- if ($this->currentObjectID !== null) {
- $this->storeData();
- }
-
- return parent::getCellList();
- }
-
-
- /**
- * Clear the cell collection and disconnect from our parent
- *
- * @return void
- */
- public function unsetWorksheetCells()
- {
- if (!is_null($this->currentObject)) {
- $this->currentObject->detach();
- $this->currentObject = $this->currentObjectID = null;
- }
- $this->cellCache = array();
-
- // detach ourself from the worksheet, so that it can then delete this object successfully
- $this->parent = null;
- } // function unsetWorksheetCells()
-
-
- /**
- * Identify whether the caching method is currently available
- * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
- *
- * @return boolean
- */
- public static function cacheMethodIsAvailable()
- {
- if (!function_exists('igbinary_serialize')) {
- return false;
- }
-
- return true;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/CachedObjectStorage/Memcache.php b/lib/phpexcel/PHPExcel/CachedObjectStorage/Memcache.php
deleted file mode 100644
index 07942cc3f29..00000000000
--- a/lib/phpexcel/PHPExcel/CachedObjectStorage/Memcache.php
+++ /dev/null
@@ -1,308 +0,0 @@
-currentCellIsDirty && !empty($this->currentObjectID)) {
- $this->currentObject->detach();
-
- $obj = serialize($this->currentObject);
- if (!$this->memcache->replace($this->cachePrefix . $this->currentObjectID . '.cache', $obj, null, $this->cacheTime)) {
- if (!$this->memcache->add($this->cachePrefix . $this->currentObjectID . '.cache', $obj, null, $this->cacheTime)) {
- $this->__destruct();
- throw new PHPExcel_Exception("Failed to store cell {$this->currentObjectID} in MemCache");
- }
- }
- $this->currentCellIsDirty = false;
- }
- $this->currentObjectID = $this->currentObject = null;
- } // function _storeData()
-
-
- /**
- * Add or Update a cell in cache identified by coordinate address
- *
- * @param string $pCoord Coordinate address of the cell to update
- * @param PHPExcel_Cell $cell Cell to update
- * @return PHPExcel_Cell
- * @throws PHPExcel_Exception
- */
- public function addCacheData($pCoord, PHPExcel_Cell $cell)
- {
- if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
- $this->storeData();
- }
- $this->cellCache[$pCoord] = true;
-
- $this->currentObjectID = $pCoord;
- $this->currentObject = $cell;
- $this->currentCellIsDirty = true;
-
- return $cell;
- } // function addCacheData()
-
-
- /**
- * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
- *
- * @param string $pCoord Coordinate address of the cell to check
- * @return boolean
- * @return boolean
- */
- public function isDataSet($pCoord)
- {
- // Check if the requested entry is the current object, or exists in the cache
- if (parent::isDataSet($pCoord)) {
- if ($this->currentObjectID == $pCoord) {
- return true;
- }
- // Check if the requested entry still exists in Memcache
- $success = $this->memcache->get($this->cachePrefix.$pCoord.'.cache');
- if ($success === false) {
- // Entry no longer exists in Memcache, so clear it from the cache array
- parent::deleteCacheData($pCoord);
- throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in MemCache');
- }
- return true;
- }
- return false;
- }
-
-
- /**
- * Get cell at a specific coordinate
- *
- * @param string $pCoord Coordinate of the cell
- * @throws PHPExcel_Exception
- * @return PHPExcel_Cell Cell that was found, or null if not found
- */
- public function getCacheData($pCoord)
- {
- if ($pCoord === $this->currentObjectID) {
- return $this->currentObject;
- }
- $this->storeData();
-
- // Check if the entry that has been requested actually exists
- if (parent::isDataSet($pCoord)) {
- $obj = $this->memcache->get($this->cachePrefix . $pCoord . '.cache');
- if ($obj === false) {
- // Entry no longer exists in Memcache, so clear it from the cache array
- parent::deleteCacheData($pCoord);
- throw new PHPExcel_Exception("Cell entry {$pCoord} no longer exists in MemCache");
- }
- } else {
- // Return null if requested entry doesn't exist in cache
- return null;
- }
-
- // Set current entry to the requested entry
- $this->currentObjectID = $pCoord;
- $this->currentObject = unserialize($obj);
- // Re-attach this as the cell's parent
- $this->currentObject->attach($this);
-
- // Return requested entry
- return $this->currentObject;
- }
-
- /**
- * Get a list of all cell addresses currently held in cache
- *
- * @return string[]
- */
- public function getCellList()
- {
- if ($this->currentObjectID !== null) {
- $this->storeData();
- }
-
- return parent::getCellList();
- }
-
- /**
- * Delete a cell in cache identified by coordinate address
- *
- * @param string $pCoord Coordinate address of the cell to delete
- * @throws PHPExcel_Exception
- */
- public function deleteCacheData($pCoord)
- {
- // Delete the entry from Memcache
- $this->memcache->delete($this->cachePrefix . $pCoord . '.cache');
-
- // Delete the entry from our cell address array
- parent::deleteCacheData($pCoord);
- }
-
- /**
- * Clone the cell collection
- *
- * @param PHPExcel_Worksheet $parent The new worksheet
- * @return void
- */
- public function copyCellCollection(PHPExcel_Worksheet $parent)
- {
- parent::copyCellCollection($parent);
- // Get a new id for the new file name
- $baseUnique = $this->getUniqueID();
- $newCachePrefix = substr(md5($baseUnique), 0, 8) . '.';
- $cacheList = $this->getCellList();
- foreach ($cacheList as $cellID) {
- if ($cellID != $this->currentObjectID) {
- $obj = $this->memcache->get($this->cachePrefix.$cellID.'.cache');
- if ($obj === false) {
- // Entry no longer exists in Memcache, so clear it from the cache array
- parent::deleteCacheData($cellID);
- throw new PHPExcel_Exception("Cell entry {$cellID} no longer exists in MemCache");
- }
- if (!$this->memcache->add($newCachePrefix . $cellID . '.cache', $obj, null, $this->cacheTime)) {
- $this->__destruct();
- throw new PHPExcel_Exception("Failed to store cell {$cellID} in MemCache");
- }
- }
- }
- $this->cachePrefix = $newCachePrefix;
- }
-
- /**
- * Clear the cell collection and disconnect from our parent
- *
- * @return void
- */
- public function unsetWorksheetCells()
- {
- if (!is_null($this->currentObject)) {
- $this->currentObject->detach();
- $this->currentObject = $this->currentObjectID = null;
- }
-
- // Flush the Memcache cache
- $this->__destruct();
-
- $this->cellCache = array();
-
- // detach ourself from the worksheet, so that it can then delete this object successfully
- $this->parent = null;
- }
-
- /**
- * Initialise this new cell collection
- *
- * @param PHPExcel_Worksheet $parent The worksheet for this cell collection
- * @param array of mixed $arguments Additional initialisation arguments
- */
- public function __construct(PHPExcel_Worksheet $parent, $arguments)
- {
- $memcacheServer = (isset($arguments['memcacheServer'])) ? $arguments['memcacheServer'] : 'localhost';
- $memcachePort = (isset($arguments['memcachePort'])) ? $arguments['memcachePort'] : 11211;
- $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600;
-
- if (is_null($this->cachePrefix)) {
- $baseUnique = $this->getUniqueID();
- $this->cachePrefix = substr(md5($baseUnique), 0, 8) . '.';
-
- // Set a new Memcache object and connect to the Memcache server
- $this->memcache = new Memcache();
- if (!$this->memcache->addServer($memcacheServer, $memcachePort, false, 50, 5, 5, true, array($this, 'failureCallback'))) {
- throw new PHPExcel_Exception("Could not connect to MemCache server at {$memcacheServer}:{$memcachePort}");
- }
- $this->cacheTime = $cacheTime;
-
- parent::__construct($parent);
- }
- }
-
- /**
- * Memcache error handler
- *
- * @param string $host Memcache server
- * @param integer $port Memcache port
- * @throws PHPExcel_Exception
- */
- public function failureCallback($host, $port)
- {
- throw new PHPExcel_Exception("memcache {$host}:{$port} failed");
- }
-
- /**
- * Destroy this cell collection
- */
- public function __destruct()
- {
- $cacheList = $this->getCellList();
- foreach ($cacheList as $cellID) {
- $this->memcache->delete($this->cachePrefix.$cellID . '.cache');
- }
- }
-
- /**
- * Identify whether the caching method is currently available
- * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
- *
- * @return boolean
- */
- public static function cacheMethodIsAvailable()
- {
- if (!function_exists('memcache_add')) {
- return false;
- }
-
- return true;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/CachedObjectStorage/Memory.php b/lib/phpexcel/PHPExcel/CachedObjectStorage/Memory.php
deleted file mode 100644
index 0e2ea0b0793..00000000000
--- a/lib/phpexcel/PHPExcel/CachedObjectStorage/Memory.php
+++ /dev/null
@@ -1,118 +0,0 @@
-cellCache[$pCoord] = $cell;
-
- // Set current entry to the new/updated entry
- $this->currentObjectID = $pCoord;
-
- return $cell;
- }
-
-
- /**
- * Get cell at a specific coordinate
- *
- * @param string $pCoord Coordinate of the cell
- * @throws PHPExcel_Exception
- * @return PHPExcel_Cell Cell that was found, or null if not found
- */
- public function getCacheData($pCoord)
- {
- // Check if the entry that has been requested actually exists
- if (!isset($this->cellCache[$pCoord])) {
- $this->currentObjectID = null;
- // Return null if requested entry doesn't exist in cache
- return null;
- }
-
- // Set current entry to the requested entry
- $this->currentObjectID = $pCoord;
-
- // Return requested entry
- return $this->cellCache[$pCoord];
- }
-
-
- /**
- * Clone the cell collection
- *
- * @param PHPExcel_Worksheet $parent The new worksheet
- */
- public function copyCellCollection(PHPExcel_Worksheet $parent)
- {
- parent::copyCellCollection($parent);
-
- $newCollection = array();
- foreach ($this->cellCache as $k => &$cell) {
- $newCollection[$k] = clone $cell;
- $newCollection[$k]->attach($this);
- }
-
- $this->cellCache = $newCollection;
- }
-
- /**
- * Clear the cell collection and disconnect from our parent
- *
- */
- public function unsetWorksheetCells()
- {
- // Because cells are all stored as intact objects in memory, we need to detach each one from the parent
- foreach ($this->cellCache as $k => &$cell) {
- $cell->detach();
- $this->cellCache[$k] = null;
- }
- unset($cell);
-
- $this->cellCache = array();
-
- // detach ourself from the worksheet, so that it can then delete this object successfully
- $this->parent = null;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/CachedObjectStorage/MemoryGZip.php b/lib/phpexcel/PHPExcel/CachedObjectStorage/MemoryGZip.php
deleted file mode 100644
index c06ec714f08..00000000000
--- a/lib/phpexcel/PHPExcel/CachedObjectStorage/MemoryGZip.php
+++ /dev/null
@@ -1,133 +0,0 @@
-currentCellIsDirty && !empty($this->currentObjectID)) {
- $this->currentObject->detach();
-
- $this->cellCache[$this->currentObjectID] = gzdeflate(serialize($this->currentObject));
- $this->currentCellIsDirty = false;
- }
- $this->currentObjectID = $this->currentObject = null;
- }
-
-
- /**
- * Add or Update a cell in cache identified by coordinate address
- *
- * @param string $pCoord Coordinate address of the cell to update
- * @param PHPExcel_Cell $cell Cell to update
- * @return PHPExcel_Cell
- * @throws PHPExcel_Exception
- */
- public function addCacheData($pCoord, PHPExcel_Cell $cell)
- {
- if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
- $this->storeData();
- }
-
- $this->currentObjectID = $pCoord;
- $this->currentObject = $cell;
- $this->currentCellIsDirty = true;
-
- return $cell;
- }
-
-
- /**
- * Get cell at a specific coordinate
- *
- * @param string $pCoord Coordinate of the cell
- * @throws PHPExcel_Exception
- * @return PHPExcel_Cell Cell that was found, or null if not found
- */
- public function getCacheData($pCoord)
- {
- if ($pCoord === $this->currentObjectID) {
- return $this->currentObject;
- }
- $this->storeData();
-
- // Check if the entry that has been requested actually exists
- if (!isset($this->cellCache[$pCoord])) {
- // Return null if requested entry doesn't exist in cache
- return null;
- }
-
- // Set current entry to the requested entry
- $this->currentObjectID = $pCoord;
- $this->currentObject = unserialize(gzinflate($this->cellCache[$pCoord]));
- // Re-attach this as the cell's parent
- $this->currentObject->attach($this);
-
- // Return requested entry
- return $this->currentObject;
- }
-
-
- /**
- * Get a list of all cell addresses currently held in cache
- *
- * @return string[]
- */
- public function getCellList()
- {
- if ($this->currentObjectID !== null) {
- $this->storeData();
- }
-
- return parent::getCellList();
- }
-
-
- /**
- * Clear the cell collection and disconnect from our parent
- *
- * @return void
- */
- public function unsetWorksheetCells()
- {
- if (!is_null($this->currentObject)) {
- $this->currentObject->detach();
- $this->currentObject = $this->currentObjectID = null;
- }
- $this->cellCache = array();
-
- // detach ourself from the worksheet, so that it can then delete this object successfully
- $this->parent = null;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/CachedObjectStorage/MemorySerialized.php b/lib/phpexcel/PHPExcel/CachedObjectStorage/MemorySerialized.php
deleted file mode 100644
index 13325149959..00000000000
--- a/lib/phpexcel/PHPExcel/CachedObjectStorage/MemorySerialized.php
+++ /dev/null
@@ -1,129 +0,0 @@
-currentCellIsDirty && !empty($this->currentObjectID)) {
- $this->currentObject->detach();
-
- $this->cellCache[$this->currentObjectID] = serialize($this->currentObject);
- $this->currentCellIsDirty = false;
- }
- $this->currentObjectID = $this->currentObject = null;
- }
-
- /**
- * Add or Update a cell in cache identified by coordinate address
- *
- * @param string $pCoord Coordinate address of the cell to update
- * @param PHPExcel_Cell $cell Cell to update
- * @return PHPExcel_Cell
- * @throws PHPExcel_Exception
- */
- public function addCacheData($pCoord, PHPExcel_Cell $cell)
- {
- if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
- $this->storeData();
- }
-
- $this->currentObjectID = $pCoord;
- $this->currentObject = $cell;
- $this->currentCellIsDirty = true;
-
- return $cell;
- }
-
- /**
- * Get cell at a specific coordinate
- *
- * @param string $pCoord Coordinate of the cell
- * @throws PHPExcel_Exception
- * @return PHPExcel_Cell Cell that was found, or null if not found
- */
- public function getCacheData($pCoord)
- {
- if ($pCoord === $this->currentObjectID) {
- return $this->currentObject;
- }
- $this->storeData();
-
- // Check if the entry that has been requested actually exists
- if (!isset($this->cellCache[$pCoord])) {
- // Return null if requested entry doesn't exist in cache
- return null;
- }
-
- // Set current entry to the requested entry
- $this->currentObjectID = $pCoord;
- $this->currentObject = unserialize($this->cellCache[$pCoord]);
- // Re-attach this as the cell's parent
- $this->currentObject->attach($this);
-
- // Return requested entry
- return $this->currentObject;
- }
-
- /**
- * Get a list of all cell addresses currently held in cache
- *
- * @return string[]
- */
- public function getCellList()
- {
- if ($this->currentObjectID !== null) {
- $this->storeData();
- }
-
- return parent::getCellList();
- }
-
- /**
- * Clear the cell collection and disconnect from our parent
- *
- * @return void
- */
- public function unsetWorksheetCells()
- {
- if (!is_null($this->currentObject)) {
- $this->currentObject->detach();
- $this->currentObject = $this->currentObjectID = null;
- }
- $this->cellCache = array();
-
- // detach ourself from the worksheet, so that it can then delete this object successfully
- $this->parent = null;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/CachedObjectStorage/PHPTemp.php b/lib/phpexcel/PHPExcel/CachedObjectStorage/PHPTemp.php
deleted file mode 100644
index 43c781971ad..00000000000
--- a/lib/phpexcel/PHPExcel/CachedObjectStorage/PHPTemp.php
+++ /dev/null
@@ -1,200 +0,0 @@
-currentCellIsDirty && !empty($this->currentObjectID)) {
- $this->currentObject->detach();
-
- fseek($this->fileHandle, 0, SEEK_END);
-
- $this->cellCache[$this->currentObjectID] = array(
- 'ptr' => ftell($this->fileHandle),
- 'sz' => fwrite($this->fileHandle, serialize($this->currentObject))
- );
- $this->currentCellIsDirty = false;
- }
- $this->currentObjectID = $this->currentObject = null;
- }
-
-
- /**
- * Add or Update a cell in cache identified by coordinate address
- *
- * @param string $pCoord Coordinate address of the cell to update
- * @param PHPExcel_Cell $cell Cell to update
- * @return PHPExcel_Cell
- * @throws PHPExcel_Exception
- */
- public function addCacheData($pCoord, PHPExcel_Cell $cell)
- {
- if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
- $this->storeData();
- }
-
- $this->currentObjectID = $pCoord;
- $this->currentObject = $cell;
- $this->currentCellIsDirty = true;
-
- return $cell;
- }
-
-
- /**
- * Get cell at a specific coordinate
- *
- * @param string $pCoord Coordinate of the cell
- * @throws PHPExcel_Exception
- * @return PHPExcel_Cell Cell that was found, or null if not found
- */
- public function getCacheData($pCoord)
- {
- if ($pCoord === $this->currentObjectID) {
- return $this->currentObject;
- }
- $this->storeData();
-
- // Check if the entry that has been requested actually exists
- if (!isset($this->cellCache[$pCoord])) {
- // Return null if requested entry doesn't exist in cache
- return null;
- }
-
- // Set current entry to the requested entry
- $this->currentObjectID = $pCoord;
- fseek($this->fileHandle, $this->cellCache[$pCoord]['ptr']);
- $this->currentObject = unserialize(fread($this->fileHandle, $this->cellCache[$pCoord]['sz']));
- // Re-attach this as the cell's parent
- $this->currentObject->attach($this);
-
- // Return requested entry
- return $this->currentObject;
- }
-
- /**
- * Get a list of all cell addresses currently held in cache
- *
- * @return string[]
- */
- public function getCellList()
- {
- if ($this->currentObjectID !== null) {
- $this->storeData();
- }
-
- return parent::getCellList();
- }
-
- /**
- * Clone the cell collection
- *
- * @param PHPExcel_Worksheet $parent The new worksheet
- * @return void
- */
- public function copyCellCollection(PHPExcel_Worksheet $parent)
- {
- parent::copyCellCollection($parent);
- // Open a new stream for the cell cache data
- $newFileHandle = fopen('php://temp/maxmemory:' . $this->memoryCacheSize, 'a+');
- // Copy the existing cell cache data to the new stream
- fseek($this->fileHandle, 0);
- while (!feof($this->fileHandle)) {
- fwrite($newFileHandle, fread($this->fileHandle, 1024));
- }
- $this->fileHandle = $newFileHandle;
- }
-
- /**
- * Clear the cell collection and disconnect from our parent
- *
- * @return void
- */
- public function unsetWorksheetCells()
- {
- if (!is_null($this->currentObject)) {
- $this->currentObject->detach();
- $this->currentObject = $this->currentObjectID = null;
- }
- $this->cellCache = array();
-
- // detach ourself from the worksheet, so that it can then delete this object successfully
- $this->parent = null;
-
- // Close down the php://temp file
- $this->__destruct();
- }
-
- /**
- * Initialise this new cell collection
- *
- * @param PHPExcel_Worksheet $parent The worksheet for this cell collection
- * @param array of mixed $arguments Additional initialisation arguments
- */
- public function __construct(PHPExcel_Worksheet $parent, $arguments)
- {
- $this->memoryCacheSize = (isset($arguments['memoryCacheSize'])) ? $arguments['memoryCacheSize'] : '1MB';
-
- parent::__construct($parent);
- if (is_null($this->fileHandle)) {
- $this->fileHandle = fopen('php://temp/maxmemory:' . $this->memoryCacheSize, 'a+');
- }
- }
-
- /**
- * Destroy this cell collection
- */
- public function __destruct()
- {
- if (!is_null($this->fileHandle)) {
- fclose($this->fileHandle);
- }
- $this->fileHandle = null;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/CachedObjectStorage/SQLite.php b/lib/phpexcel/PHPExcel/CachedObjectStorage/SQLite.php
deleted file mode 100644
index e7b50c5bd43..00000000000
--- a/lib/phpexcel/PHPExcel/CachedObjectStorage/SQLite.php
+++ /dev/null
@@ -1,307 +0,0 @@
-currentCellIsDirty && !empty($this->currentObjectID)) {
- $this->currentObject->detach();
-
- if (!$this->DBHandle->queryExec("INSERT OR REPLACE INTO kvp_".$this->TableName." VALUES('".$this->currentObjectID."','".sqlite_escape_string(serialize($this->currentObject))."')")) {
- throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError()));
- }
- $this->currentCellIsDirty = false;
- }
- $this->currentObjectID = $this->currentObject = null;
- }
-
- /**
- * Add or Update a cell in cache identified by coordinate address
- *
- * @param string $pCoord Coordinate address of the cell to update
- * @param PHPExcel_Cell $cell Cell to update
- * @return PHPExcel_Cell
- * @throws PHPExcel_Exception
- */
- public function addCacheData($pCoord, PHPExcel_Cell $cell)
- {
- if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
- $this->storeData();
- }
-
- $this->currentObjectID = $pCoord;
- $this->currentObject = $cell;
- $this->currentCellIsDirty = true;
-
- return $cell;
- }
-
- /**
- * Get cell at a specific coordinate
- *
- * @param string $pCoord Coordinate of the cell
- * @throws PHPExcel_Exception
- * @return PHPExcel_Cell Cell that was found, or null if not found
- */
- public function getCacheData($pCoord)
- {
- if ($pCoord === $this->currentObjectID) {
- return $this->currentObject;
- }
- $this->storeData();
-
- $query = "SELECT value FROM kvp_".$this->TableName." WHERE id='".$pCoord."'";
- $cellResultSet = $this->DBHandle->query($query, SQLITE_ASSOC);
- if ($cellResultSet === false) {
- throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError()));
- } elseif ($cellResultSet->numRows() == 0) {
- // Return null if requested entry doesn't exist in cache
- return null;
- }
-
- // Set current entry to the requested entry
- $this->currentObjectID = $pCoord;
-
- $cellResult = $cellResultSet->fetchSingle();
- $this->currentObject = unserialize($cellResult);
- // Re-attach this as the cell's parent
- $this->currentObject->attach($this);
-
- // Return requested entry
- return $this->currentObject;
- }
-
- /**
- * Is a value set for an indexed cell?
- *
- * @param string $pCoord Coordinate address of the cell to check
- * @return boolean
- */
- public function isDataSet($pCoord)
- {
- if ($pCoord === $this->currentObjectID) {
- return true;
- }
-
- // Check if the requested entry exists in the cache
- $query = "SELECT id FROM kvp_".$this->TableName." WHERE id='".$pCoord."'";
- $cellResultSet = $this->DBHandle->query($query, SQLITE_ASSOC);
- if ($cellResultSet === false) {
- throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError()));
- } elseif ($cellResultSet->numRows() == 0) {
- // Return null if requested entry doesn't exist in cache
- return false;
- }
- return true;
- }
-
- /**
- * Delete a cell in cache identified by coordinate address
- *
- * @param string $pCoord Coordinate address of the cell to delete
- * @throws PHPExcel_Exception
- */
- public function deleteCacheData($pCoord)
- {
- if ($pCoord === $this->currentObjectID) {
- $this->currentObject->detach();
- $this->currentObjectID = $this->currentObject = null;
- }
-
- // Check if the requested entry exists in the cache
- $query = "DELETE FROM kvp_".$this->TableName." WHERE id='".$pCoord."'";
- if (!$this->DBHandle->queryExec($query)) {
- throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError()));
- }
-
- $this->currentCellIsDirty = false;
- }
-
- /**
- * Move a cell object from one address to another
- *
- * @param string $fromAddress Current address of the cell to move
- * @param string $toAddress Destination address of the cell to move
- * @return boolean
- */
- public function moveCell($fromAddress, $toAddress)
- {
- if ($fromAddress === $this->currentObjectID) {
- $this->currentObjectID = $toAddress;
- }
-
- $query = "DELETE FROM kvp_".$this->TableName." WHERE id='".$toAddress."'";
- $result = $this->DBHandle->exec($query);
- if ($result === false) {
- throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
- }
-
- $query = "UPDATE kvp_".$this->TableName." SET id='".$toAddress."' WHERE id='".$fromAddress."'";
- $result = $this->DBHandle->exec($query);
- if ($result === false) {
- throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
- }
-
- return true;
- }
-
- /**
- * Get a list of all cell addresses currently held in cache
- *
- * @return string[]
- */
- public function getCellList()
- {
- if ($this->currentObjectID !== null) {
- $this->storeData();
- }
-
- $query = "SELECT id FROM kvp_".$this->TableName;
- $cellIdsResult = $this->DBHandle->unbufferedQuery($query, SQLITE_ASSOC);
- if ($cellIdsResult === false) {
- throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError()));
- }
-
- $cellKeys = array();
- foreach ($cellIdsResult as $row) {
- $cellKeys[] = $row['id'];
- }
-
- return $cellKeys;
- }
-
- /**
- * Clone the cell collection
- *
- * @param PHPExcel_Worksheet $parent The new worksheet
- * @return void
- */
- public function copyCellCollection(PHPExcel_Worksheet $parent)
- {
- $this->currentCellIsDirty;
- $this->storeData();
-
- // Get a new id for the new table name
- $tableName = str_replace('.', '_', $this->getUniqueID());
- if (!$this->DBHandle->queryExec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)
- AS SELECT * FROM kvp_'.$this->TableName)
- ) {
- throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError()));
- }
-
- // Copy the existing cell cache file
- $this->TableName = $tableName;
- }
-
- /**
- * Clear the cell collection and disconnect from our parent
- *
- * @return void
- */
- public function unsetWorksheetCells()
- {
- if (!is_null($this->currentObject)) {
- $this->currentObject->detach();
- $this->currentObject = $this->currentObjectID = null;
- }
- // detach ourself from the worksheet, so that it can then delete this object successfully
- $this->parent = null;
-
- // Close down the temporary cache file
- $this->__destruct();
- }
-
- /**
- * Initialise this new cell collection
- *
- * @param PHPExcel_Worksheet $parent The worksheet for this cell collection
- */
- public function __construct(PHPExcel_Worksheet $parent)
- {
- parent::__construct($parent);
- if (is_null($this->DBHandle)) {
- $this->TableName = str_replace('.', '_', $this->getUniqueID());
- $_DBName = ':memory:';
-
- $this->DBHandle = new SQLiteDatabase($_DBName);
- if ($this->DBHandle === false) {
- throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError()));
- }
- if (!$this->DBHandle->queryExec('CREATE TABLE kvp_'.$this->TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) {
- throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError()));
- }
- }
- }
-
- /**
- * Destroy this cell collection
- */
- public function __destruct()
- {
- if (!is_null($this->DBHandle)) {
- $this->DBHandle->queryExec('DROP TABLE kvp_'.$this->TableName);
- }
- $this->DBHandle = null;
- }
-
- /**
- * Identify whether the caching method is currently available
- * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
- *
- * @return boolean
- */
- public static function cacheMethodIsAvailable()
- {
- if (!function_exists('sqlite_open')) {
- return false;
- }
-
- return true;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/CachedObjectStorage/SQLite3.php b/lib/phpexcel/PHPExcel/CachedObjectStorage/SQLite3.php
deleted file mode 100644
index 27473d6c37e..00000000000
--- a/lib/phpexcel/PHPExcel/CachedObjectStorage/SQLite3.php
+++ /dev/null
@@ -1,346 +0,0 @@
-currentCellIsDirty && !empty($this->currentObjectID)) {
- $this->currentObject->detach();
-
- $this->insertQuery->bindValue('id', $this->currentObjectID, SQLITE3_TEXT);
- $this->insertQuery->bindValue('data', serialize($this->currentObject), SQLITE3_BLOB);
- $result = $this->insertQuery->execute();
- if ($result === false) {
- throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
- }
- $this->currentCellIsDirty = false;
- }
- $this->currentObjectID = $this->currentObject = null;
- }
-
- /**
- * Add or Update a cell in cache identified by coordinate address
- *
- * @param string $pCoord Coordinate address of the cell to update
- * @param PHPExcel_Cell $cell Cell to update
- * @return PHPExcel_Cell
- * @throws PHPExcel_Exception
- */
- public function addCacheData($pCoord, PHPExcel_Cell $cell)
- {
- if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
- $this->storeData();
- }
-
- $this->currentObjectID = $pCoord;
- $this->currentObject = $cell;
- $this->currentCellIsDirty = true;
-
- return $cell;
- }
-
- /**
- * Get cell at a specific coordinate
- *
- * @param string $pCoord Coordinate of the cell
- * @throws PHPExcel_Exception
- * @return PHPExcel_Cell Cell that was found, or null if not found
- */
- public function getCacheData($pCoord)
- {
- if ($pCoord === $this->currentObjectID) {
- return $this->currentObject;
- }
- $this->storeData();
-
- $this->selectQuery->bindValue('id', $pCoord, SQLITE3_TEXT);
- $cellResult = $this->selectQuery->execute();
- if ($cellResult === false) {
- throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
- }
- $cellData = $cellResult->fetchArray(SQLITE3_ASSOC);
- if ($cellData === false) {
- // Return null if requested entry doesn't exist in cache
- return null;
- }
-
- // Set current entry to the requested entry
- $this->currentObjectID = $pCoord;
-
- $this->currentObject = unserialize($cellData['value']);
- // Re-attach this as the cell's parent
- $this->currentObject->attach($this);
-
- // Return requested entry
- return $this->currentObject;
- }
-
- /**
- * Is a value set for an indexed cell?
- *
- * @param string $pCoord Coordinate address of the cell to check
- * @return boolean
- */
- public function isDataSet($pCoord)
- {
- if ($pCoord === $this->currentObjectID) {
- return true;
- }
-
- // Check if the requested entry exists in the cache
- $this->selectQuery->bindValue('id', $pCoord, SQLITE3_TEXT);
- $cellResult = $this->selectQuery->execute();
- if ($cellResult === false) {
- throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
- }
- $cellData = $cellResult->fetchArray(SQLITE3_ASSOC);
-
- return ($cellData === false) ? false : true;
- }
-
- /**
- * Delete a cell in cache identified by coordinate address
- *
- * @param string $pCoord Coordinate address of the cell to delete
- * @throws PHPExcel_Exception
- */
- public function deleteCacheData($pCoord)
- {
- if ($pCoord === $this->currentObjectID) {
- $this->currentObject->detach();
- $this->currentObjectID = $this->currentObject = null;
- }
-
- // Check if the requested entry exists in the cache
- $this->deleteQuery->bindValue('id', $pCoord, SQLITE3_TEXT);
- $result = $this->deleteQuery->execute();
- if ($result === false) {
- throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
- }
-
- $this->currentCellIsDirty = false;
- }
-
- /**
- * Move a cell object from one address to another
- *
- * @param string $fromAddress Current address of the cell to move
- * @param string $toAddress Destination address of the cell to move
- * @return boolean
- */
- public function moveCell($fromAddress, $toAddress)
- {
- if ($fromAddress === $this->currentObjectID) {
- $this->currentObjectID = $toAddress;
- }
-
- $this->deleteQuery->bindValue('id', $toAddress, SQLITE3_TEXT);
- $result = $this->deleteQuery->execute();
- if ($result === false) {
- throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
- }
-
- $this->updateQuery->bindValue('toid', $toAddress, SQLITE3_TEXT);
- $this->updateQuery->bindValue('fromid', $fromAddress, SQLITE3_TEXT);
- $result = $this->updateQuery->execute();
- if ($result === false) {
- throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
- }
-
- return true;
- }
-
- /**
- * Get a list of all cell addresses currently held in cache
- *
- * @return string[]
- */
- public function getCellList()
- {
- if ($this->currentObjectID !== null) {
- $this->storeData();
- }
-
- $query = "SELECT id FROM kvp_".$this->TableName;
- $cellIdsResult = $this->DBHandle->query($query);
- if ($cellIdsResult === false) {
- throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
- }
-
- $cellKeys = array();
- while ($row = $cellIdsResult->fetchArray(SQLITE3_ASSOC)) {
- $cellKeys[] = $row['id'];
- }
-
- return $cellKeys;
- }
-
- /**
- * Clone the cell collection
- *
- * @param PHPExcel_Worksheet $parent The new worksheet
- * @return void
- */
- public function copyCellCollection(PHPExcel_Worksheet $parent)
- {
- $this->currentCellIsDirty;
- $this->storeData();
-
- // Get a new id for the new table name
- $tableName = str_replace('.', '_', $this->getUniqueID());
- if (!$this->DBHandle->exec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)
- AS SELECT * FROM kvp_'.$this->TableName)
- ) {
- throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
- }
-
- // Copy the existing cell cache file
- $this->TableName = $tableName;
- }
-
- /**
- * Clear the cell collection and disconnect from our parent
- *
- * @return void
- */
- public function unsetWorksheetCells()
- {
- if (!is_null($this->currentObject)) {
- $this->currentObject->detach();
- $this->currentObject = $this->currentObjectID = null;
- }
- // detach ourself from the worksheet, so that it can then delete this object successfully
- $this->parent = null;
-
- // Close down the temporary cache file
- $this->__destruct();
- }
-
- /**
- * Initialise this new cell collection
- *
- * @param PHPExcel_Worksheet $parent The worksheet for this cell collection
- */
- public function __construct(PHPExcel_Worksheet $parent)
- {
- parent::__construct($parent);
- if (is_null($this->DBHandle)) {
- $this->TableName = str_replace('.', '_', $this->getUniqueID());
- $_DBName = ':memory:';
-
- $this->DBHandle = new SQLite3($_DBName);
- if ($this->DBHandle === false) {
- throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
- }
- if (!$this->DBHandle->exec('CREATE TABLE kvp_'.$this->TableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)')) {
- throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
- }
- }
-
- $this->selectQuery = $this->DBHandle->prepare("SELECT value FROM kvp_".$this->TableName." WHERE id = :id");
- $this->insertQuery = $this->DBHandle->prepare("INSERT OR REPLACE INTO kvp_".$this->TableName." VALUES(:id,:data)");
- $this->updateQuery = $this->DBHandle->prepare("UPDATE kvp_".$this->TableName." SET id=:toId WHERE id=:fromId");
- $this->deleteQuery = $this->DBHandle->prepare("DELETE FROM kvp_".$this->TableName." WHERE id = :id");
- }
-
- /**
- * Destroy this cell collection
- */
- public function __destruct()
- {
- if (!is_null($this->DBHandle)) {
- $this->DBHandle->exec('DROP TABLE kvp_'.$this->TableName);
- $this->DBHandle->close();
- }
- $this->DBHandle = null;
- }
-
- /**
- * Identify whether the caching method is currently available
- * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
- *
- * @return boolean
- */
- public static function cacheMethodIsAvailable()
- {
- if (!class_exists('SQLite3', false)) {
- return false;
- }
-
- return true;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/CachedObjectStorage/Wincache.php b/lib/phpexcel/PHPExcel/CachedObjectStorage/Wincache.php
deleted file mode 100644
index 1567874ffe5..00000000000
--- a/lib/phpexcel/PHPExcel/CachedObjectStorage/Wincache.php
+++ /dev/null
@@ -1,289 +0,0 @@
-currentCellIsDirty && !empty($this->currentObjectID)) {
- $this->currentObject->detach();
-
- $obj = serialize($this->currentObject);
- if (wincache_ucache_exists($this->cachePrefix.$this->currentObjectID.'.cache')) {
- if (!wincache_ucache_set($this->cachePrefix.$this->currentObjectID.'.cache', $obj, $this->cacheTime)) {
- $this->__destruct();
- throw new PHPExcel_Exception('Failed to store cell '.$this->currentObjectID.' in WinCache');
- }
- } else {
- if (!wincache_ucache_add($this->cachePrefix.$this->currentObjectID.'.cache', $obj, $this->cacheTime)) {
- $this->__destruct();
- throw new PHPExcel_Exception('Failed to store cell '.$this->currentObjectID.' in WinCache');
- }
- }
- $this->currentCellIsDirty = false;
- }
-
- $this->currentObjectID = $this->currentObject = null;
- }
-
- /**
- * Add or Update a cell in cache identified by coordinate address
- *
- * @param string $pCoord Coordinate address of the cell to update
- * @param PHPExcel_Cell $cell Cell to update
- * @return PHPExcel_Cell
- * @throws PHPExcel_Exception
- */
- public function addCacheData($pCoord, PHPExcel_Cell $cell)
- {
- if (($pCoord !== $this->currentObjectID) && ($this->currentObjectID !== null)) {
- $this->storeData();
- }
- $this->cellCache[$pCoord] = true;
-
- $this->currentObjectID = $pCoord;
- $this->currentObject = $cell;
- $this->currentCellIsDirty = true;
-
- return $cell;
- }
-
- /**
- * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell?
- *
- * @param string $pCoord Coordinate address of the cell to check
- * @return boolean
- */
- public function isDataSet($pCoord)
- {
- // Check if the requested entry is the current object, or exists in the cache
- if (parent::isDataSet($pCoord)) {
- if ($this->currentObjectID == $pCoord) {
- return true;
- }
- // Check if the requested entry still exists in cache
- $success = wincache_ucache_exists($this->cachePrefix.$pCoord.'.cache');
- if ($success === false) {
- // Entry no longer exists in Wincache, so clear it from the cache array
- parent::deleteCacheData($pCoord);
- throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in WinCache');
- }
- return true;
- }
- return false;
- }
-
-
- /**
- * Get cell at a specific coordinate
- *
- * @param string $pCoord Coordinate of the cell
- * @throws PHPExcel_Exception
- * @return PHPExcel_Cell Cell that was found, or null if not found
- */
- public function getCacheData($pCoord)
- {
- if ($pCoord === $this->currentObjectID) {
- return $this->currentObject;
- }
- $this->storeData();
-
- // Check if the entry that has been requested actually exists
- $obj = null;
- if (parent::isDataSet($pCoord)) {
- $success = false;
- $obj = wincache_ucache_get($this->cachePrefix.$pCoord.'.cache', $success);
- if ($success === false) {
- // Entry no longer exists in WinCache, so clear it from the cache array
- parent::deleteCacheData($pCoord);
- throw new PHPExcel_Exception('Cell entry '.$pCoord.' no longer exists in WinCache');
- }
- } else {
- // Return null if requested entry doesn't exist in cache
- return null;
- }
-
- // Set current entry to the requested entry
- $this->currentObjectID = $pCoord;
- $this->currentObject = unserialize($obj);
- // Re-attach this as the cell's parent
- $this->currentObject->attach($this);
-
- // Return requested entry
- return $this->currentObject;
- }
-
-
- /**
- * Get a list of all cell addresses currently held in cache
- *
- * @return string[]
- */
- public function getCellList()
- {
- if ($this->currentObjectID !== null) {
- $this->storeData();
- }
-
- return parent::getCellList();
- }
-
- /**
- * Delete a cell in cache identified by coordinate address
- *
- * @param string $pCoord Coordinate address of the cell to delete
- * @throws PHPExcel_Exception
- */
- public function deleteCacheData($pCoord)
- {
- // Delete the entry from Wincache
- wincache_ucache_delete($this->cachePrefix.$pCoord.'.cache');
-
- // Delete the entry from our cell address array
- parent::deleteCacheData($pCoord);
- }
-
- /**
- * Clone the cell collection
- *
- * @param PHPExcel_Worksheet $parent The new worksheet
- * @return void
- */
- public function copyCellCollection(PHPExcel_Worksheet $parent)
- {
- parent::copyCellCollection($parent);
- // Get a new id for the new file name
- $baseUnique = $this->getUniqueID();
- $newCachePrefix = substr(md5($baseUnique), 0, 8) . '.';
- $cacheList = $this->getCellList();
- foreach ($cacheList as $cellID) {
- if ($cellID != $this->currentObjectID) {
- $success = false;
- $obj = wincache_ucache_get($this->cachePrefix.$cellID.'.cache', $success);
- if ($success === false) {
- // Entry no longer exists in WinCache, so clear it from the cache array
- parent::deleteCacheData($cellID);
- throw new PHPExcel_Exception('Cell entry '.$cellID.' no longer exists in Wincache');
- }
- if (!wincache_ucache_add($newCachePrefix.$cellID.'.cache', $obj, $this->cacheTime)) {
- $this->__destruct();
- throw new PHPExcel_Exception('Failed to store cell '.$cellID.' in Wincache');
- }
- }
- }
- $this->cachePrefix = $newCachePrefix;
- }
-
-
- /**
- * Clear the cell collection and disconnect from our parent
- *
- * @return void
- */
- public function unsetWorksheetCells()
- {
- if (!is_null($this->currentObject)) {
- $this->currentObject->detach();
- $this->currentObject = $this->currentObjectID = null;
- }
-
- // Flush the WinCache cache
- $this->__destruct();
-
- $this->cellCache = array();
-
- // detach ourself from the worksheet, so that it can then delete this object successfully
- $this->parent = null;
- }
-
- /**
- * Initialise this new cell collection
- *
- * @param PHPExcel_Worksheet $parent The worksheet for this cell collection
- * @param array of mixed $arguments Additional initialisation arguments
- */
- public function __construct(PHPExcel_Worksheet $parent, $arguments)
- {
- $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600;
-
- if (is_null($this->cachePrefix)) {
- $baseUnique = $this->getUniqueID();
- $this->cachePrefix = substr(md5($baseUnique), 0, 8).'.';
- $this->cacheTime = $cacheTime;
-
- parent::__construct($parent);
- }
- }
-
- /**
- * Destroy this cell collection
- */
- public function __destruct()
- {
- $cacheList = $this->getCellList();
- foreach ($cacheList as $cellID) {
- wincache_ucache_delete($this->cachePrefix.$cellID.'.cache');
- }
- }
-
- /**
- * Identify whether the caching method is currently available
- * Some methods are dependent on the availability of certain extensions being enabled in the PHP build
- *
- * @return boolean
- */
- public static function cacheMethodIsAvailable()
- {
- if (!function_exists('wincache_ucache_add')) {
- return false;
- }
-
- return true;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/CachedObjectStorageFactory.php b/lib/phpexcel/PHPExcel/CachedObjectStorageFactory.php
deleted file mode 100644
index 0a969786e12..00000000000
--- a/lib/phpexcel/PHPExcel/CachedObjectStorageFactory.php
+++ /dev/null
@@ -1,231 +0,0 @@
- array(
- ),
- self::cache_in_memory_gzip => array(
- ),
- self::cache_in_memory_serialized => array(
- ),
- self::cache_igbinary => array(
- ),
- self::cache_to_phpTemp => array( 'memoryCacheSize' => '1MB'
- ),
- self::cache_to_discISAM => array( 'dir' => null
- ),
- self::cache_to_apc => array( 'cacheTime' => 600
- ),
- self::cache_to_memcache => array( 'memcacheServer' => 'localhost',
- 'memcachePort' => 11211,
- 'cacheTime' => 600
- ),
- self::cache_to_wincache => array( 'cacheTime' => 600
- ),
- self::cache_to_sqlite => array(
- ),
- self::cache_to_sqlite3 => array(
- ),
- );
-
- /**
- * Arguments for the active cache storage method
- *
- * @var array of mixed array
- */
- private static $storageMethodParameters = array();
-
- /**
- * Return the current cache storage method
- *
- * @return string|null
- **/
- public static function getCacheStorageMethod()
- {
- return self::$cacheStorageMethod;
- }
-
- /**
- * Return the current cache storage class
- *
- * @return PHPExcel_CachedObjectStorage_ICache|null
- **/
- public static function getCacheStorageClass()
- {
- return self::$cacheStorageClass;
- }
-
- /**
- * Return the list of all possible cache storage methods
- *
- * @return string[]
- **/
- public static function getAllCacheStorageMethods()
- {
- return self::$storageMethods;
- }
-
- /**
- * Return the list of all available cache storage methods
- *
- * @return string[]
- **/
- public static function getCacheStorageMethods()
- {
- $activeMethods = array();
- foreach (self::$storageMethods as $storageMethod) {
- $cacheStorageClass = 'PHPExcel_CachedObjectStorage_' . $storageMethod;
- if (call_user_func(array($cacheStorageClass, 'cacheMethodIsAvailable'))) {
- $activeMethods[] = $storageMethod;
- }
- }
- return $activeMethods;
- }
-
- /**
- * Identify the cache storage method to use
- *
- * @param string $method Name of the method to use for cell cacheing
- * @param array of mixed $arguments Additional arguments to pass to the cell caching class
- * when instantiating
- * @return boolean
- **/
- public static function initialize($method = self::cache_in_memory, $arguments = array())
- {
- if (!in_array($method, self::$storageMethods)) {
- return false;
- }
-
- $cacheStorageClass = 'PHPExcel_CachedObjectStorage_'.$method;
- if (!call_user_func(array( $cacheStorageClass,
- 'cacheMethodIsAvailable'))) {
- return false;
- }
-
- self::$storageMethodParameters[$method] = self::$storageMethodDefaultParameters[$method];
- foreach ($arguments as $k => $v) {
- if (array_key_exists($k, self::$storageMethodParameters[$method])) {
- self::$storageMethodParameters[$method][$k] = $v;
- }
- }
-
- if (self::$cacheStorageMethod === null) {
- self::$cacheStorageClass = 'PHPExcel_CachedObjectStorage_' . $method;
- self::$cacheStorageMethod = $method;
- }
- return true;
- }
-
- /**
- * Initialise the cache storage
- *
- * @param PHPExcel_Worksheet $parent Enable cell caching for this worksheet
- * @return PHPExcel_CachedObjectStorage_ICache
- **/
- public static function getInstance(PHPExcel_Worksheet $parent)
- {
- $cacheMethodIsAvailable = true;
- if (self::$cacheStorageMethod === null) {
- $cacheMethodIsAvailable = self::initialize();
- }
-
- if ($cacheMethodIsAvailable) {
- $instance = new self::$cacheStorageClass(
- $parent,
- self::$storageMethodParameters[self::$cacheStorageMethod]
- );
- if ($instance !== null) {
- return $instance;
- }
- }
-
- return false;
- }
-
- /**
- * Clear the cache storage
- *
- **/
- public static function finalize()
- {
- self::$cacheStorageMethod = null;
- self::$cacheStorageClass = null;
- self::$storageMethodParameters = array();
- }
-}
diff --git a/lib/phpexcel/PHPExcel/CalcEngine/CyclicReferenceStack.php b/lib/phpexcel/PHPExcel/CalcEngine/CyclicReferenceStack.php
deleted file mode 100644
index 1072fc75f29..00000000000
--- a/lib/phpexcel/PHPExcel/CalcEngine/CyclicReferenceStack.php
+++ /dev/null
@@ -1,94 +0,0 @@
-stack);
- }
-
- /**
- * Push a new entry onto the stack
- *
- * @param mixed $value
- */
- public function push($value)
- {
- $this->stack[$value] = $value;
- }
-
- /**
- * Pop the last entry from the stack
- *
- * @return mixed
- */
- public function pop()
- {
- return array_pop($this->stack);
- }
-
- /**
- * Test to see if a specified entry exists on the stack
- *
- * @param mixed $value The value to test
- */
- public function onStack($value)
- {
- return isset($this->stack[$value]);
- }
-
- /**
- * Clear the stack
- */
- public function clear()
- {
- $this->stack = array();
- }
-
- /**
- * Return an array of all entries on the stack
- *
- * @return mixed[]
- */
- public function showStack()
- {
- return $this->stack;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/CalcEngine/Logger.php b/lib/phpexcel/PHPExcel/CalcEngine/Logger.php
deleted file mode 100644
index c5ffe73e9c7..00000000000
--- a/lib/phpexcel/PHPExcel/CalcEngine/Logger.php
+++ /dev/null
@@ -1,151 +0,0 @@
-cellStack = $stack;
- }
-
- /**
- * Enable/Disable Calculation engine logging
- *
- * @param boolean $pValue
- */
- public function setWriteDebugLog($pValue = false)
- {
- $this->writeDebugLog = $pValue;
- }
-
- /**
- * Return whether calculation engine logging is enabled or disabled
- *
- * @return boolean
- */
- public function getWriteDebugLog()
- {
- return $this->writeDebugLog;
- }
-
- /**
- * Enable/Disable echoing of debug log information
- *
- * @param boolean $pValue
- */
- public function setEchoDebugLog($pValue = false)
- {
- $this->echoDebugLog = $pValue;
- }
-
- /**
- * Return whether echoing of debug log information is enabled or disabled
- *
- * @return boolean
- */
- public function getEchoDebugLog()
- {
- return $this->echoDebugLog;
- }
-
- /**
- * Write an entry to the calculation engine debug log
- */
- public function writeDebugLog()
- {
- // Only write the debug log if logging is enabled
- if ($this->writeDebugLog) {
- $message = implode(func_get_args());
- $cellReference = implode(' -> ', $this->cellStack->showStack());
- if ($this->echoDebugLog) {
- echo $cellReference,
- ($this->cellStack->count() > 0 ? ' => ' : ''),
- $message,
- PHP_EOL;
- }
- $this->debugLog[] = $cellReference .
- ($this->cellStack->count() > 0 ? ' => ' : '') .
- $message;
- }
- }
-
- /**
- * Clear the calculation engine debug log
- */
- public function clearLog()
- {
- $this->debugLog = array();
- }
-
- /**
- * Return the calculation engine debug log
- *
- * @return string[]
- */
- public function getLog()
- {
- return $this->debugLog;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Calculation.php b/lib/phpexcel/PHPExcel/Calculation.php
deleted file mode 100644
index 809c57157bd..00000000000
--- a/lib/phpexcel/PHPExcel/Calculation.php
+++ /dev/null
@@ -1,4413 +0,0 @@
-=-]*)|(\'[^\']*\')|(\"[^\"]*\"))!)?\$?([a-z]{1,3})\$?(\d{1,7})');
- // Named Range of cells
- define('CALCULATION_REGEXP_NAMEDRANGE', '((([^\s,!&%^\/\*\+<>=-]*)|(\'[^\']*\')|(\"[^\"]*\"))!)?([_A-Z][_A-Z0-9\.]*)');
- } else {
- // Cell reference (cell or range of cells, with or without a sheet reference)
- define('CALCULATION_REGEXP_CELLREF', '(((\w*)|(\'[^\']*\')|(\"[^\"]*\"))!)?\$?([a-z]{1,3})\$?(\d+)');
- // Named Range of cells
- define('CALCULATION_REGEXP_NAMEDRANGE', '(((\w*)|(\'.*\')|(\".*\"))!)?([_A-Z][_A-Z0-9\.]*)');
- }
-}
-
-/**
- * PHPExcel_Calculation (Multiton)
- *
- * Copyright (c) 2006 - 2015 PHPExcel
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * @category PHPExcel
- * @package PHPExcel_Calculation
- * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
- * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
- * @version ##VERSION##, ##DATE##
- */
-class PHPExcel_Calculation
-{
- /** Constants */
- /** Regular Expressions */
- // Numeric operand
- const CALCULATION_REGEXP_NUMBER = '[-+]?\d*\.?\d+(e[-+]?\d+)?';
- // String operand
- const CALCULATION_REGEXP_STRING = '"(?:[^"]|"")*"';
- // Opening bracket
- const CALCULATION_REGEXP_OPENBRACE = '\(';
- // Function (allow for the old @ symbol that could be used to prefix a function, but we'll ignore it)
- const CALCULATION_REGEXP_FUNCTION = '@?([A-Z][A-Z0-9\.]*)[\s]*\(';
- // Cell reference (cell or range of cells, with or without a sheet reference)
- const CALCULATION_REGEXP_CELLREF = CALCULATION_REGEXP_CELLREF;
- // Named Range of cells
- const CALCULATION_REGEXP_NAMEDRANGE = CALCULATION_REGEXP_NAMEDRANGE;
- // Error
- const CALCULATION_REGEXP_ERROR = '\#[A-Z][A-Z0_\/]*[!\?]?';
-
-
- /** constants */
- const RETURN_ARRAY_AS_ERROR = 'error';
- const RETURN_ARRAY_AS_VALUE = 'value';
- const RETURN_ARRAY_AS_ARRAY = 'array';
-
- private static $returnArrayAsType = self::RETURN_ARRAY_AS_VALUE;
-
-
- /**
- * Instance of this class
- *
- * @access private
- * @var PHPExcel_Calculation
- */
- private static $instance;
-
-
- /**
- * Instance of the workbook this Calculation Engine is using
- *
- * @access private
- * @var PHPExcel
- */
- private $workbook;
-
- /**
- * List of instances of the calculation engine that we've instantiated for individual workbooks
- *
- * @access private
- * @var PHPExcel_Calculation[]
- */
- private static $workbookSets;
-
- /**
- * Calculation cache
- *
- * @access private
- * @var array
- */
- private $calculationCache = array ();
-
-
- /**
- * Calculation cache enabled
- *
- * @access private
- * @var boolean
- */
- private $calculationCacheEnabled = true;
-
-
- /**
- * List of operators that can be used within formulae
- * The true/false value indicates whether it is a binary operator or a unary operator
- *
- * @access private
- * @var array
- */
- private static $operators = array(
- '+' => true, '-' => true, '*' => true, '/' => true,
- '^' => true, '&' => true, '%' => false, '~' => false,
- '>' => true, '<' => true, '=' => true, '>=' => true,
- '<=' => true, '<>' => true, '|' => true, ':' => true
- );
-
- /**
- * List of binary operators (those that expect two operands)
- *
- * @access private
- * @var array
- */
- private static $binaryOperators = array(
- '+' => true, '-' => true, '*' => true, '/' => true,
- '^' => true, '&' => true, '>' => true, '<' => true,
- '=' => true, '>=' => true, '<=' => true, '<>' => true,
- '|' => true, ':' => true
- );
-
- /**
- * The debug log generated by the calculation engine
- *
- * @access private
- * @var PHPExcel_CalcEngine_Logger
- *
- */
- private $debugLog;
-
- /**
- * Flag to determine how formula errors should be handled
- * If true, then a user error will be triggered
- * If false, then an exception will be thrown
- *
- * @access public
- * @var boolean
- *
- */
- public $suppressFormulaErrors = false;
-
- /**
- * Error message for any error that was raised/thrown by the calculation engine
- *
- * @access public
- * @var string
- *
- */
- public $formulaError = null;
-
- /**
- * An array of the nested cell references accessed by the calculation engine, used for the debug log
- *
- * @access private
- * @var array of string
- *
- */
- private $cyclicReferenceStack;
-
- private $cellStack = array();
-
- /**
- * Current iteration counter for cyclic formulae
- * If the value is 0 (or less) then cyclic formulae will throw an exception,
- * otherwise they will iterate to the limit defined here before returning a result
- *
- * @var integer
- *
- */
- private $cyclicFormulaCounter = 1;
-
- private $cyclicFormulaCell = '';
-
- /**
- * Number of iterations for cyclic formulae
- *
- * @var integer
- *
- */
- public $cyclicFormulaCount = 1;
-
- /**
- * Precision used for calculations
- *
- * @var integer
- *
- */
- private $savedPrecision = 14;
-
-
- /**
- * The current locale setting
- *
- * @var string
- *
- */
- private static $localeLanguage = 'en_us'; // US English (default locale)
-
- /**
- * List of available locale settings
- * Note that this is read for the locale subdirectory only when requested
- *
- * @var string[]
- *
- */
- private static $validLocaleLanguages = array(
- 'en' // English (default language)
- );
-
- /**
- * Locale-specific argument separator for function arguments
- *
- * @var string
- *
- */
- private static $localeArgumentSeparator = ',';
- private static $localeFunctions = array();
-
- /**
- * Locale-specific translations for Excel constants (True, False and Null)
- *
- * @var string[]
- *
- */
- public static $localeBoolean = array(
- 'TRUE' => 'TRUE',
- 'FALSE' => 'FALSE',
- 'NULL' => 'NULL'
- );
-
- /**
- * Excel constant string translations to their PHP equivalents
- * Constant conversion from text name/value to actual (datatyped) value
- *
- * @var string[]
- *
- */
- private static $excelConstants = array(
- 'TRUE' => true,
- 'FALSE' => false,
- 'NULL' => null
- );
-
- // PHPExcel functions
- private static $PHPExcelFunctions = array(
- 'ABS' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'abs',
- 'argumentCount' => '1'
- ),
- 'ACCRINT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::ACCRINT',
- 'argumentCount' => '4-7'
- ),
- 'ACCRINTM' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::ACCRINTM',
- 'argumentCount' => '3-5'
- ),
- 'ACOS' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'acos',
- 'argumentCount' => '1'
- ),
- 'ACOSH' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'acosh',
- 'argumentCount' => '1'
- ),
- 'ADDRESS' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_LookupRef::CELL_ADDRESS',
- 'argumentCount' => '2-5'
- ),
- 'AMORDEGRC' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::AMORDEGRC',
- 'argumentCount' => '6,7'
- ),
- 'AMORLINC' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::AMORLINC',
- 'argumentCount' => '6,7'
- ),
- 'AND' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL,
- 'functionCall' => 'PHPExcel_Calculation_Logical::LOGICAL_AND',
- 'argumentCount' => '1+'
- ),
- 'AREAS' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '1'
- ),
- 'ASC' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '1'
- ),
- 'ASIN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'asin',
- 'argumentCount' => '1'
- ),
- 'ASINH' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'asinh',
- 'argumentCount' => '1'
- ),
- 'ATAN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'atan',
- 'argumentCount' => '1'
- ),
- 'ATAN2' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::ATAN2',
- 'argumentCount' => '2'
- ),
- 'ATANH' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'atanh',
- 'argumentCount' => '1'
- ),
- 'AVEDEV' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::AVEDEV',
- 'argumentCount' => '1+'
- ),
- 'AVERAGE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::AVERAGE',
- 'argumentCount' => '1+'
- ),
- 'AVERAGEA' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::AVERAGEA',
- 'argumentCount' => '1+'
- ),
- 'AVERAGEIF' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::AVERAGEIF',
- 'argumentCount' => '2,3'
- ),
- 'AVERAGEIFS' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '3+'
- ),
- 'BAHTTEXT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '1'
- ),
- 'BESSELI' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::BESSELI',
- 'argumentCount' => '2'
- ),
- 'BESSELJ' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::BESSELJ',
- 'argumentCount' => '2'
- ),
- 'BESSELK' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::BESSELK',
- 'argumentCount' => '2'
- ),
- 'BESSELY' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::BESSELY',
- 'argumentCount' => '2'
- ),
- 'BETADIST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::BETADIST',
- 'argumentCount' => '3-5'
- ),
- 'BETAINV' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::BETAINV',
- 'argumentCount' => '3-5'
- ),
- 'BIN2DEC' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::BINTODEC',
- 'argumentCount' => '1'
- ),
- 'BIN2HEX' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::BINTOHEX',
- 'argumentCount' => '1,2'
- ),
- 'BIN2OCT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::BINTOOCT',
- 'argumentCount' => '1,2'
- ),
- 'BINOMDIST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::BINOMDIST',
- 'argumentCount' => '4'
- ),
- 'CEILING' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::CEILING',
- 'argumentCount' => '2'
- ),
- 'CELL' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '1,2'
- ),
- 'CHAR' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::CHARACTER',
- 'argumentCount' => '1'
- ),
- 'CHIDIST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::CHIDIST',
- 'argumentCount' => '2'
- ),
- 'CHIINV' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::CHIINV',
- 'argumentCount' => '2'
- ),
- 'CHITEST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '2'
- ),
- 'CHOOSE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_LookupRef::CHOOSE',
- 'argumentCount' => '2+'
- ),
- 'CLEAN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::TRIMNONPRINTABLE',
- 'argumentCount' => '1'
- ),
- 'CODE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::ASCIICODE',
- 'argumentCount' => '1'
- ),
- 'COLUMN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_LookupRef::COLUMN',
- 'argumentCount' => '-1',
- 'passByReference' => array(true)
- ),
- 'COLUMNS' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_LookupRef::COLUMNS',
- 'argumentCount' => '1'
- ),
- 'COMBIN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::COMBIN',
- 'argumentCount' => '2'
- ),
- 'COMPLEX' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::COMPLEX',
- 'argumentCount' => '2,3'
- ),
- 'CONCATENATE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::CONCATENATE',
- 'argumentCount' => '1+'
- ),
- 'CONFIDENCE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::CONFIDENCE',
- 'argumentCount' => '3'
- ),
- 'CONVERT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::CONVERTUOM',
- 'argumentCount' => '3'
- ),
- 'CORREL' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::CORREL',
- 'argumentCount' => '2'
- ),
- 'COS' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'cos',
- 'argumentCount' => '1'
- ),
- 'COSH' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'cosh',
- 'argumentCount' => '1'
- ),
- 'COUNT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::COUNT',
- 'argumentCount' => '1+'
- ),
- 'COUNTA' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::COUNTA',
- 'argumentCount' => '1+'
- ),
- 'COUNTBLANK' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::COUNTBLANK',
- 'argumentCount' => '1'
- ),
- 'COUNTIF' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::COUNTIF',
- 'argumentCount' => '2'
- ),
- 'COUNTIFS' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '2'
- ),
- 'COUPDAYBS' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::COUPDAYBS',
- 'argumentCount' => '3,4'
- ),
- 'COUPDAYS' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::COUPDAYS',
- 'argumentCount' => '3,4'
- ),
- 'COUPDAYSNC' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::COUPDAYSNC',
- 'argumentCount' => '3,4'
- ),
- 'COUPNCD' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::COUPNCD',
- 'argumentCount' => '3,4'
- ),
- 'COUPNUM' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::COUPNUM',
- 'argumentCount' => '3,4'
- ),
- 'COUPPCD' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::COUPPCD',
- 'argumentCount' => '3,4'
- ),
- 'COVAR' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::COVAR',
- 'argumentCount' => '2'
- ),
- 'CRITBINOM' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::CRITBINOM',
- 'argumentCount' => '3'
- ),
- 'CUBEKPIMEMBER' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '?'
- ),
- 'CUBEMEMBER' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '?'
- ),
- 'CUBEMEMBERPROPERTY' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '?'
- ),
- 'CUBERANKEDMEMBER' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '?'
- ),
- 'CUBESET' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '?'
- ),
- 'CUBESETCOUNT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '?'
- ),
- 'CUBEVALUE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_CUBE,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '?'
- ),
- 'CUMIPMT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::CUMIPMT',
- 'argumentCount' => '6'
- ),
- 'CUMPRINC' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::CUMPRINC',
- 'argumentCount' => '6'
- ),
- 'DATE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::DATE',
- 'argumentCount' => '3'
- ),
- 'DATEDIF' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::DATEDIF',
- 'argumentCount' => '2,3'
- ),
- 'DATEVALUE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::DATEVALUE',
- 'argumentCount' => '1'
- ),
- 'DAVERAGE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE,
- 'functionCall' => 'PHPExcel_Calculation_Database::DAVERAGE',
- 'argumentCount' => '3'
- ),
- 'DAY' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::DAYOFMONTH',
- 'argumentCount' => '1'
- ),
- 'DAYS360' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::DAYS360',
- 'argumentCount' => '2,3'
- ),
- 'DB' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::DB',
- 'argumentCount' => '4,5'
- ),
- 'DCOUNT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE,
- 'functionCall' => 'PHPExcel_Calculation_Database::DCOUNT',
- 'argumentCount' => '3'
- ),
- 'DCOUNTA' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE,
- 'functionCall' => 'PHPExcel_Calculation_Database::DCOUNTA',
- 'argumentCount' => '3'
- ),
- 'DDB' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::DDB',
- 'argumentCount' => '4,5'
- ),
- 'DEC2BIN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::DECTOBIN',
- 'argumentCount' => '1,2'
- ),
- 'DEC2HEX' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::DECTOHEX',
- 'argumentCount' => '1,2'
- ),
- 'DEC2OCT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::DECTOOCT',
- 'argumentCount' => '1,2'
- ),
- 'DEGREES' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'rad2deg',
- 'argumentCount' => '1'
- ),
- 'DELTA' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::DELTA',
- 'argumentCount' => '1,2'
- ),
- 'DEVSQ' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::DEVSQ',
- 'argumentCount' => '1+'
- ),
- 'DGET' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE,
- 'functionCall' => 'PHPExcel_Calculation_Database::DGET',
- 'argumentCount' => '3'
- ),
- 'DISC' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::DISC',
- 'argumentCount' => '4,5'
- ),
- 'DMAX' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE,
- 'functionCall' => 'PHPExcel_Calculation_Database::DMAX',
- 'argumentCount' => '3'
- ),
- 'DMIN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE,
- 'functionCall' => 'PHPExcel_Calculation_Database::DMIN',
- 'argumentCount' => '3'
- ),
- 'DOLLAR' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::DOLLAR',
- 'argumentCount' => '1,2'
- ),
- 'DOLLARDE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::DOLLARDE',
- 'argumentCount' => '2'
- ),
- 'DOLLARFR' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::DOLLARFR',
- 'argumentCount' => '2'
- ),
- 'DPRODUCT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE,
- 'functionCall' => 'PHPExcel_Calculation_Database::DPRODUCT',
- 'argumentCount' => '3'
- ),
- 'DSTDEV' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE,
- 'functionCall' => 'PHPExcel_Calculation_Database::DSTDEV',
- 'argumentCount' => '3'
- ),
- 'DSTDEVP' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE,
- 'functionCall' => 'PHPExcel_Calculation_Database::DSTDEVP',
- 'argumentCount' => '3'
- ),
- 'DSUM' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE,
- 'functionCall' => 'PHPExcel_Calculation_Database::DSUM',
- 'argumentCount' => '3'
- ),
- 'DURATION' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '5,6'
- ),
- 'DVAR' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE,
- 'functionCall' => 'PHPExcel_Calculation_Database::DVAR',
- 'argumentCount' => '3'
- ),
- 'DVARP' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATABASE,
- 'functionCall' => 'PHPExcel_Calculation_Database::DVARP',
- 'argumentCount' => '3'
- ),
- 'EDATE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::EDATE',
- 'argumentCount' => '2'
- ),
- 'EFFECT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::EFFECT',
- 'argumentCount' => '2'
- ),
- 'EOMONTH' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::EOMONTH',
- 'argumentCount' => '2'
- ),
- 'ERF' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::ERF',
- 'argumentCount' => '1,2'
- ),
- 'ERFC' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::ERFC',
- 'argumentCount' => '1'
- ),
- 'ERROR.TYPE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::ERROR_TYPE',
- 'argumentCount' => '1'
- ),
- 'EVEN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::EVEN',
- 'argumentCount' => '1'
- ),
- 'EXACT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '2'
- ),
- 'EXP' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'exp',
- 'argumentCount' => '1'
- ),
- 'EXPONDIST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::EXPONDIST',
- 'argumentCount' => '3'
- ),
- 'FACT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::FACT',
- 'argumentCount' => '1'
- ),
- 'FACTDOUBLE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::FACTDOUBLE',
- 'argumentCount' => '1'
- ),
- 'FALSE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL,
- 'functionCall' => 'PHPExcel_Calculation_Logical::FALSE',
- 'argumentCount' => '0'
- ),
- 'FDIST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '3'
- ),
- 'FIND' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::SEARCHSENSITIVE',
- 'argumentCount' => '2,3'
- ),
- 'FINDB' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::SEARCHSENSITIVE',
- 'argumentCount' => '2,3'
- ),
- 'FINV' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '3'
- ),
- 'FISHER' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::FISHER',
- 'argumentCount' => '1'
- ),
- 'FISHERINV' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::FISHERINV',
- 'argumentCount' => '1'
- ),
- 'FIXED' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::FIXEDFORMAT',
- 'argumentCount' => '1-3'
- ),
- 'FLOOR' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::FLOOR',
- 'argumentCount' => '2'
- ),
- 'FORECAST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::FORECAST',
- 'argumentCount' => '3'
- ),
- 'FREQUENCY' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '2'
- ),
- 'FTEST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '2'
- ),
- 'FV' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::FV',
- 'argumentCount' => '3-5'
- ),
- 'FVSCHEDULE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::FVSCHEDULE',
- 'argumentCount' => '2'
- ),
- 'GAMMADIST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::GAMMADIST',
- 'argumentCount' => '4'
- ),
- 'GAMMAINV' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::GAMMAINV',
- 'argumentCount' => '3'
- ),
- 'GAMMALN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::GAMMALN',
- 'argumentCount' => '1'
- ),
- 'GCD' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::GCD',
- 'argumentCount' => '1+'
- ),
- 'GEOMEAN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::GEOMEAN',
- 'argumentCount' => '1+'
- ),
- 'GESTEP' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::GESTEP',
- 'argumentCount' => '1,2'
- ),
- 'GETPIVOTDATA' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '2+'
- ),
- 'GROWTH' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::GROWTH',
- 'argumentCount' => '1-4'
- ),
- 'HARMEAN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::HARMEAN',
- 'argumentCount' => '1+'
- ),
- 'HEX2BIN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::HEXTOBIN',
- 'argumentCount' => '1,2'
- ),
- 'HEX2DEC' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::HEXTODEC',
- 'argumentCount' => '1'
- ),
- 'HEX2OCT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::HEXTOOCT',
- 'argumentCount' => '1,2'
- ),
- 'HLOOKUP' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_LookupRef::HLOOKUP',
- 'argumentCount' => '3,4'
- ),
- 'HOUR' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::HOUROFDAY',
- 'argumentCount' => '1'
- ),
- 'HYPERLINK' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_LookupRef::HYPERLINK',
- 'argumentCount' => '1,2',
- 'passCellReference' => true
- ),
- 'HYPGEOMDIST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::HYPGEOMDIST',
- 'argumentCount' => '4'
- ),
- 'IF' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL,
- 'functionCall' => 'PHPExcel_Calculation_Logical::STATEMENT_IF',
- 'argumentCount' => '1-3'
- ),
- 'IFERROR' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL,
- 'functionCall' => 'PHPExcel_Calculation_Logical::IFERROR',
- 'argumentCount' => '2'
- ),
- 'IMABS' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::IMABS',
- 'argumentCount' => '1'
- ),
- 'IMAGINARY' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::IMAGINARY',
- 'argumentCount' => '1'
- ),
- 'IMARGUMENT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::IMARGUMENT',
- 'argumentCount' => '1'
- ),
- 'IMCONJUGATE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::IMCONJUGATE',
- 'argumentCount' => '1'
- ),
- 'IMCOS' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::IMCOS',
- 'argumentCount' => '1'
- ),
- 'IMDIV' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::IMDIV',
- 'argumentCount' => '2'
- ),
- 'IMEXP' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::IMEXP',
- 'argumentCount' => '1'
- ),
- 'IMLN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::IMLN',
- 'argumentCount' => '1'
- ),
- 'IMLOG10' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::IMLOG10',
- 'argumentCount' => '1'
- ),
- 'IMLOG2' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::IMLOG2',
- 'argumentCount' => '1'
- ),
- 'IMPOWER' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::IMPOWER',
- 'argumentCount' => '2'
- ),
- 'IMPRODUCT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::IMPRODUCT',
- 'argumentCount' => '1+'
- ),
- 'IMREAL' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::IMREAL',
- 'argumentCount' => '1'
- ),
- 'IMSIN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::IMSIN',
- 'argumentCount' => '1'
- ),
- 'IMSQRT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::IMSQRT',
- 'argumentCount' => '1'
- ),
- 'IMSUB' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::IMSUB',
- 'argumentCount' => '2'
- ),
- 'IMSUM' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::IMSUM',
- 'argumentCount' => '1+'
- ),
- 'INDEX' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_LookupRef::INDEX',
- 'argumentCount' => '1-4'
- ),
- 'INDIRECT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_LookupRef::INDIRECT',
- 'argumentCount' => '1,2',
- 'passCellReference' => true
- ),
- 'INFO' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '1'
- ),
- 'INT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::INT',
- 'argumentCount' => '1'
- ),
- 'INTERCEPT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::INTERCEPT',
- 'argumentCount' => '2'
- ),
- 'INTRATE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::INTRATE',
- 'argumentCount' => '4,5'
- ),
- 'IPMT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::IPMT',
- 'argumentCount' => '4-6'
- ),
- 'IRR' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::IRR',
- 'argumentCount' => '1,2'
- ),
- 'ISBLANK' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::IS_BLANK',
- 'argumentCount' => '1'
- ),
- 'ISERR' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::IS_ERR',
- 'argumentCount' => '1'
- ),
- 'ISERROR' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::IS_ERROR',
- 'argumentCount' => '1'
- ),
- 'ISEVEN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::IS_EVEN',
- 'argumentCount' => '1'
- ),
- 'ISLOGICAL' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::IS_LOGICAL',
- 'argumentCount' => '1'
- ),
- 'ISNA' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::IS_NA',
- 'argumentCount' => '1'
- ),
- 'ISNONTEXT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::IS_NONTEXT',
- 'argumentCount' => '1'
- ),
- 'ISNUMBER' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::IS_NUMBER',
- 'argumentCount' => '1'
- ),
- 'ISODD' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::IS_ODD',
- 'argumentCount' => '1'
- ),
- 'ISPMT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::ISPMT',
- 'argumentCount' => '4'
- ),
- 'ISREF' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '1'
- ),
- 'ISTEXT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::IS_TEXT',
- 'argumentCount' => '1'
- ),
- 'JIS' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '1'
- ),
- 'KURT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::KURT',
- 'argumentCount' => '1+'
- ),
- 'LARGE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::LARGE',
- 'argumentCount' => '2'
- ),
- 'LCM' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::LCM',
- 'argumentCount' => '1+'
- ),
- 'LEFT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::LEFT',
- 'argumentCount' => '1,2'
- ),
- 'LEFTB' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::LEFT',
- 'argumentCount' => '1,2'
- ),
- 'LEN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::STRINGLENGTH',
- 'argumentCount' => '1'
- ),
- 'LENB' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::STRINGLENGTH',
- 'argumentCount' => '1'
- ),
- 'LINEST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::LINEST',
- 'argumentCount' => '1-4'
- ),
- 'LN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'log',
- 'argumentCount' => '1'
- ),
- 'LOG' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::LOG_BASE',
- 'argumentCount' => '1,2'
- ),
- 'LOG10' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'log10',
- 'argumentCount' => '1'
- ),
- 'LOGEST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::LOGEST',
- 'argumentCount' => '1-4'
- ),
- 'LOGINV' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::LOGINV',
- 'argumentCount' => '3'
- ),
- 'LOGNORMDIST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::LOGNORMDIST',
- 'argumentCount' => '3'
- ),
- 'LOOKUP' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_LookupRef::LOOKUP',
- 'argumentCount' => '2,3'
- ),
- 'LOWER' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::LOWERCASE',
- 'argumentCount' => '1'
- ),
- 'MATCH' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_LookupRef::MATCH',
- 'argumentCount' => '2,3'
- ),
- 'MAX' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::MAX',
- 'argumentCount' => '1+'
- ),
- 'MAXA' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::MAXA',
- 'argumentCount' => '1+'
- ),
- 'MAXIF' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::MAXIF',
- 'argumentCount' => '2+'
- ),
- 'MDETERM' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::MDETERM',
- 'argumentCount' => '1'
- ),
- 'MDURATION' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '5,6'
- ),
- 'MEDIAN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::MEDIAN',
- 'argumentCount' => '1+'
- ),
- 'MEDIANIF' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '2+'
- ),
- 'MID' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::MID',
- 'argumentCount' => '3'
- ),
- 'MIDB' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::MID',
- 'argumentCount' => '3'
- ),
- 'MIN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::MIN',
- 'argumentCount' => '1+'
- ),
- 'MINA' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::MINA',
- 'argumentCount' => '1+'
- ),
- 'MINIF' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::MINIF',
- 'argumentCount' => '2+'
- ),
- 'MINUTE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::MINUTEOFHOUR',
- 'argumentCount' => '1'
- ),
- 'MINVERSE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::MINVERSE',
- 'argumentCount' => '1'
- ),
- 'MIRR' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::MIRR',
- 'argumentCount' => '3'
- ),
- 'MMULT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::MMULT',
- 'argumentCount' => '2'
- ),
- 'MOD' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::MOD',
- 'argumentCount' => '2'
- ),
- 'MODE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::MODE',
- 'argumentCount' => '1+'
- ),
- 'MONTH' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::MONTHOFYEAR',
- 'argumentCount' => '1'
- ),
- 'MROUND' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::MROUND',
- 'argumentCount' => '2'
- ),
- 'MULTINOMIAL' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::MULTINOMIAL',
- 'argumentCount' => '1+'
- ),
- 'N' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::N',
- 'argumentCount' => '1'
- ),
- 'NA' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::NA',
- 'argumentCount' => '0'
- ),
- 'NEGBINOMDIST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::NEGBINOMDIST',
- 'argumentCount' => '3'
- ),
- 'NETWORKDAYS' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::NETWORKDAYS',
- 'argumentCount' => '2+'
- ),
- 'NOMINAL' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::NOMINAL',
- 'argumentCount' => '2'
- ),
- 'NORMDIST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::NORMDIST',
- 'argumentCount' => '4'
- ),
- 'NORMINV' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::NORMINV',
- 'argumentCount' => '3'
- ),
- 'NORMSDIST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::NORMSDIST',
- 'argumentCount' => '1'
- ),
- 'NORMSINV' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::NORMSINV',
- 'argumentCount' => '1'
- ),
- 'NOT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL,
- 'functionCall' => 'PHPExcel_Calculation_Logical::NOT',
- 'argumentCount' => '1'
- ),
- 'NOW' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::DATETIMENOW',
- 'argumentCount' => '0'
- ),
- 'NPER' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::NPER',
- 'argumentCount' => '3-5'
- ),
- 'NPV' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::NPV',
- 'argumentCount' => '2+'
- ),
- 'OCT2BIN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::OCTTOBIN',
- 'argumentCount' => '1,2'
- ),
- 'OCT2DEC' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::OCTTODEC',
- 'argumentCount' => '1'
- ),
- 'OCT2HEX' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_ENGINEERING,
- 'functionCall' => 'PHPExcel_Calculation_Engineering::OCTTOHEX',
- 'argumentCount' => '1,2'
- ),
- 'ODD' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::ODD',
- 'argumentCount' => '1'
- ),
- 'ODDFPRICE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '8,9'
- ),
- 'ODDFYIELD' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '8,9'
- ),
- 'ODDLPRICE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '7,8'
- ),
- 'ODDLYIELD' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '7,8'
- ),
- 'OFFSET' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_LookupRef::OFFSET',
- 'argumentCount' => '3,5',
- 'passCellReference' => true,
- 'passByReference' => array(true)
- ),
- 'OR' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL,
- 'functionCall' => 'PHPExcel_Calculation_Logical::LOGICAL_OR',
- 'argumentCount' => '1+'
- ),
- 'PEARSON' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::CORREL',
- 'argumentCount' => '2'
- ),
- 'PERCENTILE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::PERCENTILE',
- 'argumentCount' => '2'
- ),
- 'PERCENTRANK' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::PERCENTRANK',
- 'argumentCount' => '2,3'
- ),
- 'PERMUT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::PERMUT',
- 'argumentCount' => '2'
- ),
- 'PHONETIC' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '1'
- ),
- 'PI' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'pi',
- 'argumentCount' => '0'
- ),
- 'PMT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::PMT',
- 'argumentCount' => '3-5'
- ),
- 'POISSON' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::POISSON',
- 'argumentCount' => '3'
- ),
- 'POWER' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::POWER',
- 'argumentCount' => '2'
- ),
- 'PPMT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::PPMT',
- 'argumentCount' => '4-6'
- ),
- 'PRICE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::PRICE',
- 'argumentCount' => '6,7'
- ),
- 'PRICEDISC' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::PRICEDISC',
- 'argumentCount' => '4,5'
- ),
- 'PRICEMAT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::PRICEMAT',
- 'argumentCount' => '5,6'
- ),
- 'PROB' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '3,4'
- ),
- 'PRODUCT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::PRODUCT',
- 'argumentCount' => '1+'
- ),
- 'PROPER' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::PROPERCASE',
- 'argumentCount' => '1'
- ),
- 'PV' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::PV',
- 'argumentCount' => '3-5'
- ),
- 'QUARTILE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::QUARTILE',
- 'argumentCount' => '2'
- ),
- 'QUOTIENT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::QUOTIENT',
- 'argumentCount' => '2'
- ),
- 'RADIANS' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'deg2rad',
- 'argumentCount' => '1'
- ),
- 'RAND' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::RAND',
- 'argumentCount' => '0'
- ),
- 'RANDBETWEEN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::RAND',
- 'argumentCount' => '2'
- ),
- 'RANK' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::RANK',
- 'argumentCount' => '2,3'
- ),
- 'RATE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::RATE',
- 'argumentCount' => '3-6'
- ),
- 'RECEIVED' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::RECEIVED',
- 'argumentCount' => '4-5'
- ),
- 'REPLACE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::REPLACE',
- 'argumentCount' => '4'
- ),
- 'REPLACEB' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::REPLACE',
- 'argumentCount' => '4'
- ),
- 'REPT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'str_repeat',
- 'argumentCount' => '2'
- ),
- 'RIGHT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::RIGHT',
- 'argumentCount' => '1,2'
- ),
- 'RIGHTB' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::RIGHT',
- 'argumentCount' => '1,2'
- ),
- 'ROMAN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::ROMAN',
- 'argumentCount' => '1,2'
- ),
- 'ROUND' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'round',
- 'argumentCount' => '2'
- ),
- 'ROUNDDOWN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::ROUNDDOWN',
- 'argumentCount' => '2'
- ),
- 'ROUNDUP' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::ROUNDUP',
- 'argumentCount' => '2'
- ),
- 'ROW' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_LookupRef::ROW',
- 'argumentCount' => '-1',
- 'passByReference' => array(true)
- ),
- 'ROWS' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_LookupRef::ROWS',
- 'argumentCount' => '1'
- ),
- 'RSQ' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::RSQ',
- 'argumentCount' => '2'
- ),
- 'RTD' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '1+'
- ),
- 'SEARCH' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::SEARCHINSENSITIVE',
- 'argumentCount' => '2,3'
- ),
- 'SEARCHB' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::SEARCHINSENSITIVE',
- 'argumentCount' => '2,3'
- ),
- 'SECOND' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::SECONDOFMINUTE',
- 'argumentCount' => '1'
- ),
- 'SERIESSUM' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::SERIESSUM',
- 'argumentCount' => '4'
- ),
- 'SIGN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::SIGN',
- 'argumentCount' => '1'
- ),
- 'SIN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'sin',
- 'argumentCount' => '1'
- ),
- 'SINH' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'sinh',
- 'argumentCount' => '1'
- ),
- 'SKEW' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::SKEW',
- 'argumentCount' => '1+'
- ),
- 'SLN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::SLN',
- 'argumentCount' => '3'
- ),
- 'SLOPE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::SLOPE',
- 'argumentCount' => '2'
- ),
- 'SMALL' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::SMALL',
- 'argumentCount' => '2'
- ),
- 'SQRT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'sqrt',
- 'argumentCount' => '1'
- ),
- 'SQRTPI' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::SQRTPI',
- 'argumentCount' => '1'
- ),
- 'STANDARDIZE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::STANDARDIZE',
- 'argumentCount' => '3'
- ),
- 'STDEV' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::STDEV',
- 'argumentCount' => '1+'
- ),
- 'STDEVA' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::STDEVA',
- 'argumentCount' => '1+'
- ),
- 'STDEVP' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::STDEVP',
- 'argumentCount' => '1+'
- ),
- 'STDEVPA' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::STDEVPA',
- 'argumentCount' => '1+'
- ),
- 'STEYX' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::STEYX',
- 'argumentCount' => '2'
- ),
- 'SUBSTITUTE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::SUBSTITUTE',
- 'argumentCount' => '3,4'
- ),
- 'SUBTOTAL' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUBTOTAL',
- 'argumentCount' => '2+'
- ),
- 'SUM' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUM',
- 'argumentCount' => '1+'
- ),
- 'SUMIF' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMIF',
- 'argumentCount' => '2,3'
- ),
- 'SUMIFS' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '?'
- ),
- 'SUMPRODUCT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMPRODUCT',
- 'argumentCount' => '1+'
- ),
- 'SUMSQ' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMSQ',
- 'argumentCount' => '1+'
- ),
- 'SUMX2MY2' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMX2MY2',
- 'argumentCount' => '2'
- ),
- 'SUMX2PY2' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMX2PY2',
- 'argumentCount' => '2'
- ),
- 'SUMXMY2' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::SUMXMY2',
- 'argumentCount' => '2'
- ),
- 'SYD' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::SYD',
- 'argumentCount' => '4'
- ),
- 'T' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::RETURNSTRING',
- 'argumentCount' => '1'
- ),
- 'TAN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'tan',
- 'argumentCount' => '1'
- ),
- 'TANH' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'tanh',
- 'argumentCount' => '1'
- ),
- 'TBILLEQ' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::TBILLEQ',
- 'argumentCount' => '3'
- ),
- 'TBILLPRICE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::TBILLPRICE',
- 'argumentCount' => '3'
- ),
- 'TBILLYIELD' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::TBILLYIELD',
- 'argumentCount' => '3'
- ),
- 'TDIST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::TDIST',
- 'argumentCount' => '3'
- ),
- 'TEXT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::TEXTFORMAT',
- 'argumentCount' => '2'
- ),
- 'TIME' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::TIME',
- 'argumentCount' => '3'
- ),
- 'TIMEVALUE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::TIMEVALUE',
- 'argumentCount' => '1'
- ),
- 'TINV' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::TINV',
- 'argumentCount' => '2'
- ),
- 'TODAY' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::DATENOW',
- 'argumentCount' => '0'
- ),
- 'TRANSPOSE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_LookupRef::TRANSPOSE',
- 'argumentCount' => '1'
- ),
- 'TREND' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::TREND',
- 'argumentCount' => '1-4'
- ),
- 'TRIM' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::TRIMSPACES',
- 'argumentCount' => '1'
- ),
- 'TRIMMEAN' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::TRIMMEAN',
- 'argumentCount' => '2'
- ),
- 'TRUE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOGICAL,
- 'functionCall' => 'PHPExcel_Calculation_Logical::TRUE',
- 'argumentCount' => '0'
- ),
- 'TRUNC' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_MATH_AND_TRIG,
- 'functionCall' => 'PHPExcel_Calculation_MathTrig::TRUNC',
- 'argumentCount' => '1,2'
- ),
- 'TTEST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '4'
- ),
- 'TYPE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::TYPE',
- 'argumentCount' => '1'
- ),
- 'UPPER' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::UPPERCASE',
- 'argumentCount' => '1'
- ),
- 'USDOLLAR' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '2'
- ),
- 'VALUE' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_TEXT_AND_DATA,
- 'functionCall' => 'PHPExcel_Calculation_TextData::VALUE',
- 'argumentCount' => '1'
- ),
- 'VAR' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::VARFunc',
- 'argumentCount' => '1+'
- ),
- 'VARA' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::VARA',
- 'argumentCount' => '1+'
- ),
- 'VARP' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::VARP',
- 'argumentCount' => '1+'
- ),
- 'VARPA' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::VARPA',
- 'argumentCount' => '1+'
- ),
- 'VDB' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '5-7'
- ),
- 'VERSION' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_INFORMATION,
- 'functionCall' => 'PHPExcel_Calculation_Functions::VERSION',
- 'argumentCount' => '0'
- ),
- 'VLOOKUP' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_LOOKUP_AND_REFERENCE,
- 'functionCall' => 'PHPExcel_Calculation_LookupRef::VLOOKUP',
- 'argumentCount' => '3,4'
- ),
- 'WEEKDAY' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::DAYOFWEEK',
- 'argumentCount' => '1,2'
- ),
- 'WEEKNUM' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::WEEKOFYEAR',
- 'argumentCount' => '1,2'
- ),
- 'WEIBULL' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::WEIBULL',
- 'argumentCount' => '4'
- ),
- 'WORKDAY' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::WORKDAY',
- 'argumentCount' => '2+'
- ),
- 'XIRR' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::XIRR',
- 'argumentCount' => '2,3'
- ),
- 'XNPV' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::XNPV',
- 'argumentCount' => '3'
- ),
- 'YEAR' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::YEAR',
- 'argumentCount' => '1'
- ),
- 'YEARFRAC' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_DATE_AND_TIME,
- 'functionCall' => 'PHPExcel_Calculation_DateTime::YEARFRAC',
- 'argumentCount' => '2,3'
- ),
- 'YIELD' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Functions::DUMMY',
- 'argumentCount' => '6,7'
- ),
- 'YIELDDISC' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::YIELDDISC',
- 'argumentCount' => '4,5'
- ),
- 'YIELDMAT' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_FINANCIAL,
- 'functionCall' => 'PHPExcel_Calculation_Financial::YIELDMAT',
- 'argumentCount' => '5,6'
- ),
- 'ZTEST' => array(
- 'category' => PHPExcel_Calculation_Function::CATEGORY_STATISTICAL,
- 'functionCall' => 'PHPExcel_Calculation_Statistical::ZTEST',
- 'argumentCount' => '2-3'
- )
- );
-
- // Internal functions used for special control purposes
- private static $controlFunctions = array(
- 'MKMATRIX' => array(
- 'argumentCount' => '*',
- 'functionCall' => 'self::mkMatrix'
- )
- );
-
-
- private function __construct(PHPExcel $workbook = null)
- {
- $setPrecision = (PHP_INT_SIZE == 4) ? 14 : 16;
- $this->savedPrecision = ini_get('precision');
- if ($this->savedPrecision < $setPrecision) {
- ini_set('precision', $setPrecision);
- }
- $this->delta = 1 * pow(10, -$setPrecision);
-
- if ($workbook !== null) {
- self::$workbookSets[$workbook->getID()] = $this;
- }
-
- $this->workbook = $workbook;
- $this->cyclicReferenceStack = new PHPExcel_CalcEngine_CyclicReferenceStack();
- $this->_debugLog = new PHPExcel_CalcEngine_Logger($this->cyclicReferenceStack);
- }
-
-
- public function __destruct()
- {
- if ($this->savedPrecision != ini_get('precision')) {
- ini_set('precision', $this->savedPrecision);
- }
- }
-
- private static function loadLocales()
- {
- $localeFileDirectory = PHPEXCEL_ROOT.'PHPExcel/locale/';
- foreach (glob($localeFileDirectory.'/*', GLOB_ONLYDIR) as $filename) {
- $filename = substr($filename, strlen($localeFileDirectory)+1);
- if ($filename != 'en') {
- self::$validLocaleLanguages[] = $filename;
- }
- }
- }
-
- /**
- * Get an instance of this class
- *
- * @access public
- * @param PHPExcel $workbook Injected workbook for working with a PHPExcel object,
- * or NULL to create a standalone claculation engine
- * @return PHPExcel_Calculation
- */
- public static function getInstance(PHPExcel $workbook = null)
- {
- if ($workbook !== null) {
- if (isset(self::$workbookSets[$workbook->getID()])) {
- return self::$workbookSets[$workbook->getID()];
- }
- return new PHPExcel_Calculation($workbook);
- }
-
- if (!isset(self::$instance) || (self::$instance === null)) {
- self::$instance = new PHPExcel_Calculation();
- }
-
- return self::$instance;
- }
-
- /**
- * Unset an instance of this class
- *
- * @access public
- * @param PHPExcel $workbook Injected workbook identifying the instance to unset
- */
- public static function unsetInstance(PHPExcel $workbook = null)
- {
- if ($workbook !== null) {
- if (isset(self::$workbookSets[$workbook->getID()])) {
- unset(self::$workbookSets[$workbook->getID()]);
- }
- }
- }
-
- /**
- * Flush the calculation cache for any existing instance of this class
- * but only if a PHPExcel_Calculation instance exists
- *
- * @access public
- * @return null
- */
- public function flushInstance()
- {
- $this->clearCalculationCache();
- }
-
-
- /**
- * Get the debuglog for this claculation engine instance
- *
- * @access public
- * @return PHPExcel_CalcEngine_Logger
- */
- public function getDebugLog()
- {
- return $this->_debugLog;
- }
-
- /**
- * __clone implementation. Cloning should not be allowed in a Singleton!
- *
- * @access public
- * @throws PHPExcel_Calculation_Exception
- */
- final public function __clone()
- {
- throw new PHPExcel_Calculation_Exception('Cloning the calculation engine is not allowed!');
- }
-
-
- /**
- * Return the locale-specific translation of TRUE
- *
- * @access public
- * @return string locale-specific translation of TRUE
- */
- public static function getTRUE()
- {
- return self::$localeBoolean['TRUE'];
- }
-
- /**
- * Return the locale-specific translation of FALSE
- *
- * @access public
- * @return string locale-specific translation of FALSE
- */
- public static function getFALSE()
- {
- return self::$localeBoolean['FALSE'];
- }
-
- /**
- * Set the Array Return Type (Array or Value of first element in the array)
- *
- * @access public
- * @param string $returnType Array return type
- * @return boolean Success or failure
- */
- public static function setArrayReturnType($returnType)
- {
- if (($returnType == self::RETURN_ARRAY_AS_VALUE) ||
- ($returnType == self::RETURN_ARRAY_AS_ERROR) ||
- ($returnType == self::RETURN_ARRAY_AS_ARRAY)) {
- self::$returnArrayAsType = $returnType;
- return true;
- }
- return false;
- }
-
-
- /**
- * Return the Array Return Type (Array or Value of first element in the array)
- *
- * @access public
- * @return string $returnType Array return type
- */
- public static function getArrayReturnType()
- {
- return self::$returnArrayAsType;
- }
-
-
- /**
- * Is calculation caching enabled?
- *
- * @access public
- * @return boolean
- */
- public function getCalculationCacheEnabled()
- {
- return $this->calculationCacheEnabled;
- }
-
- /**
- * Enable/disable calculation cache
- *
- * @access public
- * @param boolean $pValue
- */
- public function setCalculationCacheEnabled($pValue = true)
- {
- $this->calculationCacheEnabled = $pValue;
- $this->clearCalculationCache();
- }
-
-
- /**
- * Enable calculation cache
- */
- public function enableCalculationCache()
- {
- $this->setCalculationCacheEnabled(true);
- }
-
-
- /**
- * Disable calculation cache
- */
- public function disableCalculationCache()
- {
- $this->setCalculationCacheEnabled(false);
- }
-
-
- /**
- * Clear calculation cache
- */
- public function clearCalculationCache()
- {
- $this->calculationCache = array();
- }
-
- /**
- * Clear calculation cache for a specified worksheet
- *
- * @param string $worksheetName
- */
- public function clearCalculationCacheForWorksheet($worksheetName)
- {
- if (isset($this->calculationCache[$worksheetName])) {
- unset($this->calculationCache[$worksheetName]);
- }
- }
-
- /**
- * Rename calculation cache for a specified worksheet
- *
- * @param string $fromWorksheetName
- * @param string $toWorksheetName
- */
- public function renameCalculationCacheForWorksheet($fromWorksheetName, $toWorksheetName)
- {
- if (isset($this->calculationCache[$fromWorksheetName])) {
- $this->calculationCache[$toWorksheetName] = &$this->calculationCache[$fromWorksheetName];
- unset($this->calculationCache[$fromWorksheetName]);
- }
- }
-
-
- /**
- * Get the currently defined locale code
- *
- * @return string
- */
- public function getLocale()
- {
- return self::$localeLanguage;
- }
-
-
- /**
- * Set the locale code
- *
- * @param string $locale The locale to use for formula translation
- * @return boolean
- */
- public function setLocale($locale = 'en_us')
- {
- // Identify our locale and language
- $language = $locale = strtolower($locale);
- if (strpos($locale, '_') !== false) {
- list($language) = explode('_', $locale);
- }
-
- if (count(self::$validLocaleLanguages) == 1) {
- self::loadLocales();
- }
- // Test whether we have any language data for this language (any locale)
- if (in_array($language, self::$validLocaleLanguages)) {
- // initialise language/locale settings
- self::$localeFunctions = array();
- self::$localeArgumentSeparator = ',';
- self::$localeBoolean = array('TRUE' => 'TRUE', 'FALSE' => 'FALSE', 'NULL' => 'NULL');
- // Default is English, if user isn't requesting english, then read the necessary data from the locale files
- if ($locale != 'en_us') {
- // Search for a file with a list of function names for locale
- $functionNamesFile = PHPEXCEL_ROOT . 'PHPExcel'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $locale).DIRECTORY_SEPARATOR.'functions';
- if (!file_exists($functionNamesFile)) {
- // If there isn't a locale specific function file, look for a language specific function file
- $functionNamesFile = PHPEXCEL_ROOT . 'PHPExcel'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.$language.DIRECTORY_SEPARATOR.'functions';
- if (!file_exists($functionNamesFile)) {
- return false;
- }
- }
- // Retrieve the list of locale or language specific function names
- $localeFunctions = file($functionNamesFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
- foreach ($localeFunctions as $localeFunction) {
- list($localeFunction) = explode('##', $localeFunction); // Strip out comments
- if (strpos($localeFunction, '=') !== false) {
- list($fName, $lfName) = explode('=', $localeFunction);
- $fName = trim($fName);
- $lfName = trim($lfName);
- if ((isset(self::$PHPExcelFunctions[$fName])) && ($lfName != '') && ($fName != $lfName)) {
- self::$localeFunctions[$fName] = $lfName;
- }
- }
- }
- // Default the TRUE and FALSE constants to the locale names of the TRUE() and FALSE() functions
- if (isset(self::$localeFunctions['TRUE'])) {
- self::$localeBoolean['TRUE'] = self::$localeFunctions['TRUE'];
- }
- if (isset(self::$localeFunctions['FALSE'])) {
- self::$localeBoolean['FALSE'] = self::$localeFunctions['FALSE'];
- }
-
- $configFile = PHPEXCEL_ROOT . 'PHPExcel'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $locale).DIRECTORY_SEPARATOR.'config';
- if (!file_exists($configFile)) {
- $configFile = PHPEXCEL_ROOT . 'PHPExcel'.DIRECTORY_SEPARATOR.'locale'.DIRECTORY_SEPARATOR.$language.DIRECTORY_SEPARATOR.'config';
- }
- if (file_exists($configFile)) {
- $localeSettings = file($configFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
- foreach ($localeSettings as $localeSetting) {
- list($localeSetting) = explode('##', $localeSetting); // Strip out comments
- if (strpos($localeSetting, '=') !== false) {
- list($settingName, $settingValue) = explode('=', $localeSetting);
- $settingName = strtoupper(trim($settingName));
- switch ($settingName) {
- case 'ARGUMENTSEPARATOR':
- self::$localeArgumentSeparator = trim($settingValue);
- break;
- }
- }
- }
- }
- }
-
- self::$functionReplaceFromExcel = self::$functionReplaceToExcel =
- self::$functionReplaceFromLocale = self::$functionReplaceToLocale = null;
- self::$localeLanguage = $locale;
- return true;
- }
- return false;
- }
-
-
-
- public static function translateSeparator($fromSeparator, $toSeparator, $formula, &$inBraces)
- {
- $strlen = mb_strlen($formula);
- for ($i = 0; $i < $strlen; ++$i) {
- $chr = mb_substr($formula, $i, 1);
- switch ($chr) {
- case '{':
- $inBraces = true;
- break;
- case '}':
- $inBraces = false;
- break;
- case $fromSeparator:
- if (!$inBraces) {
- $formula = mb_substr($formula, 0, $i).$toSeparator.mb_substr($formula, $i+1);
- }
- }
- }
- return $formula;
- }
-
- private static function translateFormula($from, $to, $formula, $fromSeparator, $toSeparator)
- {
- // Convert any Excel function names to the required language
- if (self::$localeLanguage !== 'en_us') {
- $inBraces = false;
- // If there is the possibility of braces within a quoted string, then we don't treat those as matrix indicators
- if (strpos($formula, '"') !== false) {
- // So instead we skip replacing in any quoted strings by only replacing in every other array element after we've exploded
- // the formula
- $temp = explode('"', $formula);
- $i = false;
- foreach ($temp as &$value) {
- // Only count/replace in alternating array entries
- if ($i = !$i) {
- $value = preg_replace($from, $to, $value);
- $value = self::translateSeparator($fromSeparator, $toSeparator, $value, $inBraces);
- }
- }
- unset($value);
- // Then rebuild the formula string
- $formula = implode('"', $temp);
- } else {
- // If there's no quoted strings, then we do a simple count/replace
- $formula = preg_replace($from, $to, $formula);
- $formula = self::translateSeparator($fromSeparator, $toSeparator, $formula, $inBraces);
- }
- }
-
- return $formula;
- }
-
- private static $functionReplaceFromExcel = null;
- private static $functionReplaceToLocale = null;
-
- public function _translateFormulaToLocale($formula)
- {
- if (self::$functionReplaceFromExcel === null) {
- self::$functionReplaceFromExcel = array();
- foreach (array_keys(self::$localeFunctions) as $excelFunctionName) {
- self::$functionReplaceFromExcel[] = '/(@?[^\w\.])'.preg_quote($excelFunctionName).'([\s]*\()/Ui';
- }
- foreach (array_keys(self::$localeBoolean) as $excelBoolean) {
- self::$functionReplaceFromExcel[] = '/(@?[^\w\.])'.preg_quote($excelBoolean).'([^\w\.])/Ui';
- }
-
- }
-
- if (self::$functionReplaceToLocale === null) {
- self::$functionReplaceToLocale = array();
- foreach (array_values(self::$localeFunctions) as $localeFunctionName) {
- self::$functionReplaceToLocale[] = '$1'.trim($localeFunctionName).'$2';
- }
- foreach (array_values(self::$localeBoolean) as $localeBoolean) {
- self::$functionReplaceToLocale[] = '$1'.trim($localeBoolean).'$2';
- }
- }
-
- return self::translateFormula(self::$functionReplaceFromExcel, self::$functionReplaceToLocale, $formula, ',', self::$localeArgumentSeparator);
- }
-
-
- private static $functionReplaceFromLocale = null;
- private static $functionReplaceToExcel = null;
-
- public function _translateFormulaToEnglish($formula)
- {
- if (self::$functionReplaceFromLocale === null) {
- self::$functionReplaceFromLocale = array();
- foreach (array_values(self::$localeFunctions) as $localeFunctionName) {
- self::$functionReplaceFromLocale[] = '/(@?[^\w\.])'.preg_quote($localeFunctionName).'([\s]*\()/Ui';
- }
- foreach (array_values(self::$localeBoolean) as $excelBoolean) {
- self::$functionReplaceFromLocale[] = '/(@?[^\w\.])'.preg_quote($excelBoolean).'([^\w\.])/Ui';
- }
- }
-
- if (self::$functionReplaceToExcel === null) {
- self::$functionReplaceToExcel = array();
- foreach (array_keys(self::$localeFunctions) as $excelFunctionName) {
- self::$functionReplaceToExcel[] = '$1'.trim($excelFunctionName).'$2';
- }
- foreach (array_keys(self::$localeBoolean) as $excelBoolean) {
- self::$functionReplaceToExcel[] = '$1'.trim($excelBoolean).'$2';
- }
- }
-
- return self::translateFormula(self::$functionReplaceFromLocale, self::$functionReplaceToExcel, $formula, self::$localeArgumentSeparator, ',');
- }
-
-
- public static function localeFunc($function)
- {
- if (self::$localeLanguage !== 'en_us') {
- $functionName = trim($function, '(');
- if (isset(self::$localeFunctions[$functionName])) {
- $brace = ($functionName != $function);
- $function = self::$localeFunctions[$functionName];
- if ($brace) {
- $function .= '(';
- }
- }
- }
- return $function;
- }
-
-
-
-
- /**
- * Wrap string values in quotes
- *
- * @param mixed $value
- * @return mixed
- */
- public static function wrapResult($value)
- {
- if (is_string($value)) {
- // Error values cannot be "wrapped"
- if (preg_match('/^'.self::CALCULATION_REGEXP_ERROR.'$/i', $value, $match)) {
- // Return Excel errors "as is"
- return $value;
- }
- // Return strings wrapped in quotes
- return '"'.$value.'"';
- // Convert numeric errors to NaN error
- } elseif ((is_float($value)) && ((is_nan($value)) || (is_infinite($value)))) {
- return PHPExcel_Calculation_Functions::NaN();
- }
-
- return $value;
- }
-
-
- /**
- * Remove quotes used as a wrapper to identify string values
- *
- * @param mixed $value
- * @return mixed
- */
- public static function unwrapResult($value)
- {
- if (is_string($value)) {
- if ((isset($value{0})) && ($value{0} == '"') && (substr($value, -1) == '"')) {
- return substr($value, 1, -1);
- }
- // Convert numeric errors to NaN error
- } elseif ((is_float($value)) && ((is_nan($value)) || (is_infinite($value)))) {
- return PHPExcel_Calculation_Functions::NaN();
- }
- return $value;
- }
-
-
-
-
- /**
- * Calculate cell value (using formula from a cell ID)
- * Retained for backward compatibility
- *
- * @access public
- * @param PHPExcel_Cell $pCell Cell to calculate
- * @return mixed
- * @throws PHPExcel_Calculation_Exception
- */
- public function calculate(PHPExcel_Cell $pCell = null)
- {
- try {
- return $this->calculateCellValue($pCell);
- } catch (PHPExcel_Exception $e) {
- throw new PHPExcel_Calculation_Exception($e->getMessage());
- }
- }
-
-
- /**
- * Calculate the value of a cell formula
- *
- * @access public
- * @param PHPExcel_Cell $pCell Cell to calculate
- * @param Boolean $resetLog Flag indicating whether the debug log should be reset or not
- * @return mixed
- * @throws PHPExcel_Calculation_Exception
- */
- public function calculateCellValue(PHPExcel_Cell $pCell = null, $resetLog = true)
- {
- if ($pCell === null) {
- return null;
- }
-
- $returnArrayAsType = self::$returnArrayAsType;
- if ($resetLog) {
- // Initialise the logging settings if requested
- $this->formulaError = null;
- $this->_debugLog->clearLog();
- $this->cyclicReferenceStack->clear();
- $this->cyclicFormulaCounter = 1;
-
- self::$returnArrayAsType = self::RETURN_ARRAY_AS_ARRAY;
- }
-
- // Execute the calculation for the cell formula
- $this->cellStack[] = array(
- 'sheet' => $pCell->getWorksheet()->getTitle(),
- 'cell' => $pCell->getCoordinate(),
- );
- try {
- $result = self::unwrapResult($this->_calculateFormulaValue($pCell->getValue(), $pCell->getCoordinate(), $pCell));
- $cellAddress = array_pop($this->cellStack);
- $this->workbook->getSheetByName($cellAddress['sheet'])->getCell($cellAddress['cell']);
- } catch (PHPExcel_Exception $e) {
- $cellAddress = array_pop($this->cellStack);
- $this->workbook->getSheetByName($cellAddress['sheet'])->getCell($cellAddress['cell']);
- throw new PHPExcel_Calculation_Exception($e->getMessage());
- }
-
- if ((is_array($result)) && (self::$returnArrayAsType != self::RETURN_ARRAY_AS_ARRAY)) {
- self::$returnArrayAsType = $returnArrayAsType;
- $testResult = PHPExcel_Calculation_Functions::flattenArray($result);
- if (self::$returnArrayAsType == self::RETURN_ARRAY_AS_ERROR) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- // If there's only a single cell in the array, then we allow it
- if (count($testResult) != 1) {
- // If keys are numeric, then it's a matrix result rather than a cell range result, so we permit it
- $r = array_keys($result);
- $r = array_shift($r);
- if (!is_numeric($r)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- if (is_array($result[$r])) {
- $c = array_keys($result[$r]);
- $c = array_shift($c);
- if (!is_numeric($c)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- }
- }
- $result = array_shift($testResult);
- }
- self::$returnArrayAsType = $returnArrayAsType;
-
-
- if ($result === null) {
- return 0;
- } elseif ((is_float($result)) && ((is_nan($result)) || (is_infinite($result)))) {
- return PHPExcel_Calculation_Functions::NaN();
- }
- return $result;
- }
-
-
- /**
- * Validate and parse a formula string
- *
- * @param string $formula Formula to parse
- * @return array
- * @throws PHPExcel_Calculation_Exception
- */
- public function parseFormula($formula)
- {
- // Basic validation that this is indeed a formula
- // We return an empty array if not
- $formula = trim($formula);
- if ((!isset($formula{0})) || ($formula{0} != '=')) {
- return array();
- }
- $formula = ltrim(substr($formula, 1));
- if (!isset($formula{0})) {
- return array();
- }
-
- // Parse the formula and return the token stack
- return $this->_parseFormula($formula);
- }
-
-
- /**
- * Calculate the value of a formula
- *
- * @param string $formula Formula to parse
- * @param string $cellID Address of the cell to calculate
- * @param PHPExcel_Cell $pCell Cell to calculate
- * @return mixed
- * @throws PHPExcel_Calculation_Exception
- */
- public function calculateFormula($formula, $cellID = null, PHPExcel_Cell $pCell = null)
- {
- // Initialise the logging settings
- $this->formulaError = null;
- $this->_debugLog->clearLog();
- $this->cyclicReferenceStack->clear();
-
- if ($this->workbook !== null && $cellID === null && $pCell === null) {
- $cellID = 'A1';
- $pCell = $this->workbook->getActiveSheet()->getCell($cellID);
- } else {
- // Disable calculation cacheing because it only applies to cell calculations, not straight formulae
- // But don't actually flush any cache
- $resetCache = $this->getCalculationCacheEnabled();
- $this->calculationCacheEnabled = false;
- }
-
- // Execute the calculation
- try {
- $result = self::unwrapResult($this->_calculateFormulaValue($formula, $cellID, $pCell));
- } catch (PHPExcel_Exception $e) {
- throw new PHPExcel_Calculation_Exception($e->getMessage());
- }
-
- if ($this->workbook === null) {
- // Reset calculation cacheing to its previous state
- $this->calculationCacheEnabled = $resetCache;
- }
-
- return $result;
- }
-
-
- public function getValueFromCache($cellReference, &$cellValue)
- {
- // Is calculation cacheing enabled?
- // Is the value present in calculation cache?
- $this->_debugLog->writeDebugLog('Testing cache value for cell ', $cellReference);
- if (($this->calculationCacheEnabled) && (isset($this->calculationCache[$cellReference]))) {
- $this->_debugLog->writeDebugLog('Retrieving value for cell ', $cellReference, ' from cache');
- // Return the cached result
- $cellValue = $this->calculationCache[$cellReference];
- return true;
- }
- return false;
- }
-
- public function saveValueToCache($cellReference, $cellValue)
- {
- if ($this->calculationCacheEnabled) {
- $this->calculationCache[$cellReference] = $cellValue;
- }
- }
-
- /**
- * Parse a cell formula and calculate its value
- *
- * @param string $formula The formula to parse and calculate
- * @param string $cellID The ID (e.g. A3) of the cell that we are calculating
- * @param PHPExcel_Cell $pCell Cell to calculate
- * @return mixed
- * @throws PHPExcel_Calculation_Exception
- */
- public function _calculateFormulaValue($formula, $cellID = null, PHPExcel_Cell $pCell = null)
- {
- $cellValue = null;
-
- // Basic validation that this is indeed a formula
- // We simply return the cell value if not
- $formula = trim($formula);
- if ($formula{0} != '=') {
- return self::wrapResult($formula);
- }
- $formula = ltrim(substr($formula, 1));
- if (!isset($formula{0})) {
- return self::wrapResult($formula);
- }
-
- $pCellParent = ($pCell !== null) ? $pCell->getWorksheet() : null;
- $wsTitle = ($pCellParent !== null) ? $pCellParent->getTitle() : "\x00Wrk";
- $wsCellReference = $wsTitle . '!' . $cellID;
-
- if (($cellID !== null) && ($this->getValueFromCache($wsCellReference, $cellValue))) {
- return $cellValue;
- }
-
- if (($wsTitle{0} !== "\x00") && ($this->cyclicReferenceStack->onStack($wsCellReference))) {
- if ($this->cyclicFormulaCount <= 0) {
- $this->cyclicFormulaCell = '';
- return $this->raiseFormulaError('Cyclic Reference in Formula');
- } elseif ($this->cyclicFormulaCell === $wsCellReference) {
- ++$this->cyclicFormulaCounter;
- if ($this->cyclicFormulaCounter >= $this->cyclicFormulaCount) {
- $this->cyclicFormulaCell = '';
- return $cellValue;
- }
- } elseif ($this->cyclicFormulaCell == '') {
- if ($this->cyclicFormulaCounter >= $this->cyclicFormulaCount) {
- return $cellValue;
- }
- $this->cyclicFormulaCell = $wsCellReference;
- }
- }
-
- // Parse the formula onto the token stack and calculate the value
- $this->cyclicReferenceStack->push($wsCellReference);
- $cellValue = $this->processTokenStack($this->_parseFormula($formula, $pCell), $cellID, $pCell);
- $this->cyclicReferenceStack->pop();
-
- // Save to calculation cache
- if ($cellID !== null) {
- $this->saveValueToCache($wsCellReference, $cellValue);
- }
-
- // Return the calculated value
- return $cellValue;
- }
-
-
- /**
- * Ensure that paired matrix operands are both matrices and of the same size
- *
- * @param mixed &$operand1 First matrix operand
- * @param mixed &$operand2 Second matrix operand
- * @param integer $resize Flag indicating whether the matrices should be resized to match
- * and (if so), whether the smaller dimension should grow or the
- * larger should shrink.
- * 0 = no resize
- * 1 = shrink to fit
- * 2 = extend to fit
- */
- private static function checkMatrixOperands(&$operand1, &$operand2, $resize = 1)
- {
- // Examine each of the two operands, and turn them into an array if they aren't one already
- // Note that this function should only be called if one or both of the operand is already an array
- if (!is_array($operand1)) {
- list($matrixRows, $matrixColumns) = self::getMatrixDimensions($operand2);
- $operand1 = array_fill(0, $matrixRows, array_fill(0, $matrixColumns, $operand1));
- $resize = 0;
- } elseif (!is_array($operand2)) {
- list($matrixRows, $matrixColumns) = self::getMatrixDimensions($operand1);
- $operand2 = array_fill(0, $matrixRows, array_fill(0, $matrixColumns, $operand2));
- $resize = 0;
- }
-
- list($matrix1Rows, $matrix1Columns) = self::getMatrixDimensions($operand1);
- list($matrix2Rows, $matrix2Columns) = self::getMatrixDimensions($operand2);
- if (($matrix1Rows == $matrix2Columns) && ($matrix2Rows == $matrix1Columns)) {
- $resize = 1;
- }
-
- if ($resize == 2) {
- // Given two matrices of (potentially) unequal size, convert the smaller in each dimension to match the larger
- self::resizeMatricesExtend($operand1, $operand2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns);
- } elseif ($resize == 1) {
- // Given two matrices of (potentially) unequal size, convert the larger in each dimension to match the smaller
- self::resizeMatricesShrink($operand1, $operand2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns);
- }
- return array( $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns);
- }
-
-
- /**
- * Read the dimensions of a matrix, and re-index it with straight numeric keys starting from row 0, column 0
- *
- * @param mixed &$matrix matrix operand
- * @return array An array comprising the number of rows, and number of columns
- */
- private static function getMatrixDimensions(&$matrix)
- {
- $matrixRows = count($matrix);
- $matrixColumns = 0;
- foreach ($matrix as $rowKey => $rowValue) {
- $matrixColumns = max(count($rowValue), $matrixColumns);
- if (!is_array($rowValue)) {
- $matrix[$rowKey] = array($rowValue);
- } else {
- $matrix[$rowKey] = array_values($rowValue);
- }
- }
- $matrix = array_values($matrix);
- return array($matrixRows, $matrixColumns);
- }
-
-
- /**
- * Ensure that paired matrix operands are both matrices of the same size
- *
- * @param mixed &$matrix1 First matrix operand
- * @param mixed &$matrix2 Second matrix operand
- * @param integer $matrix1Rows Row size of first matrix operand
- * @param integer $matrix1Columns Column size of first matrix operand
- * @param integer $matrix2Rows Row size of second matrix operand
- * @param integer $matrix2Columns Column size of second matrix operand
- */
- private static function resizeMatricesShrink(&$matrix1, &$matrix2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns)
- {
- if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) {
- if ($matrix2Rows < $matrix1Rows) {
- for ($i = $matrix2Rows; $i < $matrix1Rows; ++$i) {
- unset($matrix1[$i]);
- }
- }
- if ($matrix2Columns < $matrix1Columns) {
- for ($i = 0; $i < $matrix1Rows; ++$i) {
- for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) {
- unset($matrix1[$i][$j]);
- }
- }
- }
- }
-
- if (($matrix1Columns < $matrix2Columns) || ($matrix1Rows < $matrix2Rows)) {
- if ($matrix1Rows < $matrix2Rows) {
- for ($i = $matrix1Rows; $i < $matrix2Rows; ++$i) {
- unset($matrix2[$i]);
- }
- }
- if ($matrix1Columns < $matrix2Columns) {
- for ($i = 0; $i < $matrix2Rows; ++$i) {
- for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) {
- unset($matrix2[$i][$j]);
- }
- }
- }
- }
- }
-
-
- /**
- * Ensure that paired matrix operands are both matrices of the same size
- *
- * @param mixed &$matrix1 First matrix operand
- * @param mixed &$matrix2 Second matrix operand
- * @param integer $matrix1Rows Row size of first matrix operand
- * @param integer $matrix1Columns Column size of first matrix operand
- * @param integer $matrix2Rows Row size of second matrix operand
- * @param integer $matrix2Columns Column size of second matrix operand
- */
- private static function resizeMatricesExtend(&$matrix1, &$matrix2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns)
- {
- if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) {
- if ($matrix2Columns < $matrix1Columns) {
- for ($i = 0; $i < $matrix2Rows; ++$i) {
- $x = $matrix2[$i][$matrix2Columns-1];
- for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) {
- $matrix2[$i][$j] = $x;
- }
- }
- }
- if ($matrix2Rows < $matrix1Rows) {
- $x = $matrix2[$matrix2Rows-1];
- for ($i = 0; $i < $matrix1Rows; ++$i) {
- $matrix2[$i] = $x;
- }
- }
- }
-
- if (($matrix1Columns < $matrix2Columns) || ($matrix1Rows < $matrix2Rows)) {
- if ($matrix1Columns < $matrix2Columns) {
- for ($i = 0; $i < $matrix1Rows; ++$i) {
- $x = $matrix1[$i][$matrix1Columns-1];
- for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) {
- $matrix1[$i][$j] = $x;
- }
- }
- }
- if ($matrix1Rows < $matrix2Rows) {
- $x = $matrix1[$matrix1Rows-1];
- for ($i = 0; $i < $matrix2Rows; ++$i) {
- $matrix1[$i] = $x;
- }
- }
- }
- }
-
-
- /**
- * Format details of an operand for display in the log (based on operand type)
- *
- * @param mixed $value First matrix operand
- * @return mixed
- */
- private function showValue($value)
- {
- if ($this->_debugLog->getWriteDebugLog()) {
- $testArray = PHPExcel_Calculation_Functions::flattenArray($value);
- if (count($testArray) == 1) {
- $value = array_pop($testArray);
- }
-
- if (is_array($value)) {
- $returnMatrix = array();
- $pad = $rpad = ', ';
- foreach ($value as $row) {
- if (is_array($row)) {
- $returnMatrix[] = implode($pad, array_map(array($this, 'showValue'), $row));
- $rpad = '; ';
- } else {
- $returnMatrix[] = $this->showValue($row);
- }
- }
- return '{ '.implode($rpad, $returnMatrix).' }';
- } elseif (is_string($value) && (trim($value, '"') == $value)) {
- return '"'.$value.'"';
- } elseif (is_bool($value)) {
- return ($value) ? self::$localeBoolean['TRUE'] : self::$localeBoolean['FALSE'];
- }
- }
- return PHPExcel_Calculation_Functions::flattenSingleValue($value);
- }
-
-
- /**
- * Format type and details of an operand for display in the log (based on operand type)
- *
- * @param mixed $value First matrix operand
- * @return mixed
- */
- private function showTypeDetails($value)
- {
- if ($this->_debugLog->getWriteDebugLog()) {
- $testArray = PHPExcel_Calculation_Functions::flattenArray($value);
- if (count($testArray) == 1) {
- $value = array_pop($testArray);
- }
-
- if ($value === null) {
- return 'a NULL value';
- } elseif (is_float($value)) {
- $typeString = 'a floating point number';
- } elseif (is_int($value)) {
- $typeString = 'an integer number';
- } elseif (is_bool($value)) {
- $typeString = 'a boolean';
- } elseif (is_array($value)) {
- $typeString = 'a matrix';
- } else {
- if ($value == '') {
- return 'an empty string';
- } elseif ($value{0} == '#') {
- return 'a '.$value.' error';
- } else {
- $typeString = 'a string';
- }
- }
- return $typeString.' with a value of '.$this->showValue($value);
- }
- }
-
-
- private function convertMatrixReferences($formula)
- {
- static $matrixReplaceFrom = array('{', ';', '}');
- static $matrixReplaceTo = array('MKMATRIX(MKMATRIX(', '),MKMATRIX(', '))');
-
- // Convert any Excel matrix references to the MKMATRIX() function
- if (strpos($formula, '{') !== false) {
- // If there is the possibility of braces within a quoted string, then we don't treat those as matrix indicators
- if (strpos($formula, '"') !== false) {
- // So instead we skip replacing in any quoted strings by only replacing in every other array element after we've exploded
- // the formula
- $temp = explode('"', $formula);
- // Open and Closed counts used for trapping mismatched braces in the formula
- $openCount = $closeCount = 0;
- $i = false;
- foreach ($temp as &$value) {
- // Only count/replace in alternating array entries
- if ($i = !$i) {
- $openCount += substr_count($value, '{');
- $closeCount += substr_count($value, '}');
- $value = str_replace($matrixReplaceFrom, $matrixReplaceTo, $value);
- }
- }
- unset($value);
- // Then rebuild the formula string
- $formula = implode('"', $temp);
- } else {
- // If there's no quoted strings, then we do a simple count/replace
- $openCount = substr_count($formula, '{');
- $closeCount = substr_count($formula, '}');
- $formula = str_replace($matrixReplaceFrom, $matrixReplaceTo, $formula);
- }
- // Trap for mismatched braces and trigger an appropriate error
- if ($openCount < $closeCount) {
- if ($openCount > 0) {
- return $this->raiseFormulaError("Formula Error: Mismatched matrix braces '}'");
- } else {
- return $this->raiseFormulaError("Formula Error: Unexpected '}' encountered");
- }
- } elseif ($openCount > $closeCount) {
- if ($closeCount > 0) {
- return $this->raiseFormulaError("Formula Error: Mismatched matrix braces '{'");
- } else {
- return $this->raiseFormulaError("Formula Error: Unexpected '{' encountered");
- }
- }
- }
-
- return $formula;
- }
-
-
- private static function mkMatrix()
- {
- return func_get_args();
- }
-
-
- // Binary Operators
- // These operators always work on two values
- // Array key is the operator, the value indicates whether this is a left or right associative operator
- private static $operatorAssociativity = array(
- '^' => 0, // Exponentiation
- '*' => 0, '/' => 0, // Multiplication and Division
- '+' => 0, '-' => 0, // Addition and Subtraction
- '&' => 0, // Concatenation
- '|' => 0, ':' => 0, // Intersect and Range
- '>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0 // Comparison
- );
-
- // Comparison (Boolean) Operators
- // These operators work on two values, but always return a boolean result
- private static $comparisonOperators = array('>' => true, '<' => true, '=' => true, '>=' => true, '<=' => true, '<>' => true);
-
- // Operator Precedence
- // This list includes all valid operators, whether binary (including boolean) or unary (such as %)
- // Array key is the operator, the value is its precedence
- private static $operatorPrecedence = array(
- ':' => 8, // Range
- '|' => 7, // Intersect
- '~' => 6, // Negation
- '%' => 5, // Percentage
- '^' => 4, // Exponentiation
- '*' => 3, '/' => 3, // Multiplication and Division
- '+' => 2, '-' => 2, // Addition and Subtraction
- '&' => 1, // Concatenation
- '>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0 // Comparison
- );
-
- // Convert infix to postfix notation
- private function _parseFormula($formula, PHPExcel_Cell $pCell = null)
- {
- if (($formula = $this->convertMatrixReferences(trim($formula))) === false) {
- return false;
- }
-
- // If we're using cell caching, then $pCell may well be flushed back to the cache (which detaches the parent worksheet),
- // so we store the parent worksheet so that we can re-attach it when necessary
- $pCellParent = ($pCell !== null) ? $pCell->getWorksheet() : null;
-
- $regexpMatchString = '/^('.self::CALCULATION_REGEXP_FUNCTION.
- '|'.self::CALCULATION_REGEXP_CELLREF.
- '|'.self::CALCULATION_REGEXP_NUMBER.
- '|'.self::CALCULATION_REGEXP_STRING.
- '|'.self::CALCULATION_REGEXP_OPENBRACE.
- '|'.self::CALCULATION_REGEXP_NAMEDRANGE.
- '|'.self::CALCULATION_REGEXP_ERROR.
- ')/si';
-
- // Start with initialisation
- $index = 0;
- $stack = new PHPExcel_Calculation_Token_Stack;
- $output = array();
- $expectingOperator = false; // We use this test in syntax-checking the expression to determine when a
- // - is a negation or + is a positive operator rather than an operation
- $expectingOperand = false; // We use this test in syntax-checking the expression to determine whether an operand
- // should be null in a function call
- // The guts of the lexical parser
- // Loop through the formula extracting each operator and operand in turn
- while (true) {
-//echo 'Assessing Expression '.substr($formula, $index), PHP_EOL;
- $opCharacter = $formula{$index}; // Get the first character of the value at the current index position
-//echo 'Initial character of expression block is '.$opCharacter, PHP_EOL;
- if ((isset(self::$comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset(self::$comparisonOperators[$formula{$index+1}]))) {
- $opCharacter .= $formula{++$index};
-//echo 'Initial character of expression block is comparison operator '.$opCharacter.PHP_EOL;
- }
-
- // Find out if we're currently at the beginning of a number, variable, cell reference, function, parenthesis or operand
- $isOperandOrFunction = preg_match($regexpMatchString, substr($formula, $index), $match);
-//echo '$isOperandOrFunction is '.(($isOperandOrFunction) ? 'True' : 'False').PHP_EOL;
-//var_dump($match);
-
- if ($opCharacter == '-' && !$expectingOperator) { // Is it a negation instead of a minus?
-//echo 'Element is a Negation operator', PHP_EOL;
- $stack->push('Unary Operator', '~'); // Put a negation on the stack
- ++$index; // and drop the negation symbol
- } elseif ($opCharacter == '%' && $expectingOperator) {
-//echo 'Element is a Percentage operator', PHP_EOL;
- $stack->push('Unary Operator', '%'); // Put a percentage on the stack
- ++$index;
- } elseif ($opCharacter == '+' && !$expectingOperator) { // Positive (unary plus rather than binary operator plus) can be discarded?
-//echo 'Element is a Positive number, not Plus operator', PHP_EOL;
- ++$index; // Drop the redundant plus symbol
- } elseif ((($opCharacter == '~') || ($opCharacter == '|')) && (!$isOperandOrFunction)) { // We have to explicitly deny a tilde or pipe, because they are legal
- return $this->raiseFormulaError("Formula Error: Illegal character '~'"); // on the stack but not in the input expression
-
- } elseif ((isset(self::$operators[$opCharacter]) or $isOperandOrFunction) && $expectingOperator) { // Are we putting an operator on the stack?
-//echo 'Element with value '.$opCharacter.' is an Operator', PHP_EOL;
- while ($stack->count() > 0 &&
- ($o2 = $stack->last()) &&
- isset(self::$operators[$o2['value']]) &&
- @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])) {
- $output[] = $stack->pop(); // Swap operands and higher precedence operators from the stack to the output
- }
- $stack->push('Binary Operator', $opCharacter); // Finally put our current operator onto the stack
- ++$index;
- $expectingOperator = false;
-
- } elseif ($opCharacter == ')' && $expectingOperator) { // Are we expecting to close a parenthesis?
-//echo 'Element is a Closing bracket', PHP_EOL;
- $expectingOperand = false;
- while (($o2 = $stack->pop()) && $o2['value'] != '(') { // Pop off the stack back to the last (
- if ($o2 === null) {
- return $this->raiseFormulaError('Formula Error: Unexpected closing brace ")"');
- } else {
- $output[] = $o2;
- }
- }
- $d = $stack->last(2);
- if (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $d['value'], $matches)) { // Did this parenthesis just close a function?
- $functionName = $matches[1]; // Get the function name
-//echo 'Closed Function is '.$functionName, PHP_EOL;
- $d = $stack->pop();
- $argumentCount = $d['value']; // See how many arguments there were (argument count is the next value stored on the stack)
-//if ($argumentCount == 0) {
-// echo 'With no arguments', PHP_EOL;
-//} elseif ($argumentCount == 1) {
-// echo 'With 1 argument', PHP_EOL;
-//} else {
-// echo 'With '.$argumentCount.' arguments', PHP_EOL;
-//}
- $output[] = $d; // Dump the argument count on the output
- $output[] = $stack->pop(); // Pop the function and push onto the output
- if (isset(self::$controlFunctions[$functionName])) {
-//echo 'Built-in function '.$functionName, PHP_EOL;
- $expectedArgumentCount = self::$controlFunctions[$functionName]['argumentCount'];
- $functionCall = self::$controlFunctions[$functionName]['functionCall'];
- } elseif (isset(self::$PHPExcelFunctions[$functionName])) {
-//echo 'PHPExcel function '.$functionName, PHP_EOL;
- $expectedArgumentCount = self::$PHPExcelFunctions[$functionName]['argumentCount'];
- $functionCall = self::$PHPExcelFunctions[$functionName]['functionCall'];
- } else { // did we somehow push a non-function on the stack? this should never happen
- return $this->raiseFormulaError("Formula Error: Internal error, non-function on stack");
- }
- // Check the argument count
- $argumentCountError = false;
- if (is_numeric($expectedArgumentCount)) {
- if ($expectedArgumentCount < 0) {
-//echo '$expectedArgumentCount is between 0 and '.abs($expectedArgumentCount), PHP_EOL;
- if ($argumentCount > abs($expectedArgumentCount)) {
- $argumentCountError = true;
- $expectedArgumentCountString = 'no more than '.abs($expectedArgumentCount);
- }
- } else {
-//echo '$expectedArgumentCount is numeric '.$expectedArgumentCount, PHP_EOL;
- if ($argumentCount != $expectedArgumentCount) {
- $argumentCountError = true;
- $expectedArgumentCountString = $expectedArgumentCount;
- }
- }
- } elseif ($expectedArgumentCount != '*') {
- $isOperandOrFunction = preg_match('/(\d*)([-+,])(\d*)/', $expectedArgumentCount, $argMatch);
-//print_r($argMatch);
-//echo PHP_EOL;
- switch ($argMatch[2]) {
- case '+':
- if ($argumentCount < $argMatch[1]) {
- $argumentCountError = true;
- $expectedArgumentCountString = $argMatch[1].' or more ';
- }
- break;
- case '-':
- if (($argumentCount < $argMatch[1]) || ($argumentCount > $argMatch[3])) {
- $argumentCountError = true;
- $expectedArgumentCountString = 'between '.$argMatch[1].' and '.$argMatch[3];
- }
- break;
- case ',':
- if (($argumentCount != $argMatch[1]) && ($argumentCount != $argMatch[3])) {
- $argumentCountError = true;
- $expectedArgumentCountString = 'either '.$argMatch[1].' or '.$argMatch[3];
- }
- break;
- }
- }
- if ($argumentCountError) {
- return $this->raiseFormulaError("Formula Error: Wrong number of arguments for $functionName() function: $argumentCount given, ".$expectedArgumentCountString." expected");
- }
- }
- ++$index;
-
- } elseif ($opCharacter == ',') { // Is this the separator for function arguments?
-//echo 'Element is a Function argument separator', PHP_EOL;
- while (($o2 = $stack->pop()) && $o2['value'] != '(') { // Pop off the stack back to the last (
- if ($o2 === null) {
- return $this->raiseFormulaError("Formula Error: Unexpected ,");
- } else {
- $output[] = $o2; // pop the argument expression stuff and push onto the output
- }
- }
- // If we've a comma when we're expecting an operand, then what we actually have is a null operand;
- // so push a null onto the stack
- if (($expectingOperand) || (!$expectingOperator)) {
- $output[] = array('type' => 'NULL Value', 'value' => self::$excelConstants['NULL'], 'reference' => null);
- }
- // make sure there was a function
- $d = $stack->last(2);
- if (!preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $d['value'], $matches)) {
- return $this->raiseFormulaError("Formula Error: Unexpected ,");
- }
- $d = $stack->pop();
- $stack->push($d['type'], ++$d['value'], $d['reference']); // increment the argument count
- $stack->push('Brace', '('); // put the ( back on, we'll need to pop back to it again
- $expectingOperator = false;
- $expectingOperand = true;
- ++$index;
-
- } elseif ($opCharacter == '(' && !$expectingOperator) {
-// echo 'Element is an Opening Bracket
';
- $stack->push('Brace', '(');
- ++$index;
-
- } elseif ($isOperandOrFunction && !$expectingOperator) { // do we now have a function/variable/number?
- $expectingOperator = true;
- $expectingOperand = false;
- $val = $match[1];
- $length = strlen($val);
-// echo 'Element with value '.$val.' is an Operand, Variable, Constant, String, Number, Cell Reference or Function
';
-
- if (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $val, $matches)) {
- $val = preg_replace('/\s/u', '', $val);
-// echo 'Element '.$val.' is a Function
';
- if (isset(self::$PHPExcelFunctions[strtoupper($matches[1])]) || isset(self::$controlFunctions[strtoupper($matches[1])])) { // it's a function
- $stack->push('Function', strtoupper($val));
- $ax = preg_match('/^\s*(\s*\))/ui', substr($formula, $index+$length), $amatch);
- if ($ax) {
- $stack->push('Operand Count for Function '.strtoupper($val).')', 0);
- $expectingOperator = true;
- } else {
- $stack->push('Operand Count for Function '.strtoupper($val).')', 1);
- $expectingOperator = false;
- }
- $stack->push('Brace', '(');
- } else { // it's a var w/ implicit multiplication
- $output[] = array('type' => 'Value', 'value' => $matches[1], 'reference' => null);
- }
- } elseif (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $val, $matches)) {
-// echo 'Element '.$val.' is a Cell reference
';
- // Watch for this case-change when modifying to allow cell references in different worksheets...
- // Should only be applied to the actual cell column, not the worksheet name
-
- // If the last entry on the stack was a : operator, then we have a cell range reference
- $testPrevOp = $stack->last(1);
- if ($testPrevOp['value'] == ':') {
- // If we have a worksheet reference, then we're playing with a 3D reference
- if ($matches[2] == '') {
- // Otherwise, we 'inherit' the worksheet reference from the start cell reference
- // The start of the cell range reference should be the last entry in $output
- $startCellRef = $output[count($output)-1]['value'];
- preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $startCellRef, $startMatches);
- if ($startMatches[2] > '') {
- $val = $startMatches[2].'!'.$val;
- }
- } else {
- return $this->raiseFormulaError("3D Range references are not yet supported");
- }
- }
-
- $output[] = array('type' => 'Cell Reference', 'value' => $val, 'reference' => $val);
-// $expectingOperator = FALSE;
- } else { // it's a variable, constant, string, number or boolean
-// echo 'Element is a Variable, Constant, String, Number or Boolean
';
- // If the last entry on the stack was a : operator, then we may have a row or column range reference
- $testPrevOp = $stack->last(1);
- if ($testPrevOp['value'] == ':') {
- $startRowColRef = $output[count($output)-1]['value'];
- $rangeWS1 = '';
- if (strpos('!', $startRowColRef) !== false) {
- list($rangeWS1, $startRowColRef) = explode('!', $startRowColRef);
- }
- if ($rangeWS1 != '') {
- $rangeWS1 .= '!';
- }
- $rangeWS2 = $rangeWS1;
- if (strpos('!', $val) !== false) {
- list($rangeWS2, $val) = explode('!', $val);
- }
- if ($rangeWS2 != '') {
- $rangeWS2 .= '!';
- }
- if ((is_integer($startRowColRef)) && (ctype_digit($val)) &&
- ($startRowColRef <= 1048576) && ($val <= 1048576)) {
- // Row range
- $endRowColRef = ($pCellParent !== null) ? $pCellParent->getHighestColumn() : 'XFD'; // Max 16,384 columns for Excel2007
- $output[count($output)-1]['value'] = $rangeWS1.'A'.$startRowColRef;
- $val = $rangeWS2.$endRowColRef.$val;
- } elseif ((ctype_alpha($startRowColRef)) && (ctype_alpha($val)) &&
- (strlen($startRowColRef) <= 3) && (strlen($val) <= 3)) {
- // Column range
- $endRowColRef = ($pCellParent !== null) ? $pCellParent->getHighestRow() : 1048576; // Max 1,048,576 rows for Excel2007
- $output[count($output)-1]['value'] = $rangeWS1.strtoupper($startRowColRef).'1';
- $val = $rangeWS2.$val.$endRowColRef;
- }
- }
-
- $localeConstant = false;
- if ($opCharacter == '"') {
-// echo 'Element is a String
';
- // UnEscape any quotes within the string
- $val = self::wrapResult(str_replace('""', '"', self::unwrapResult($val)));
- } elseif (is_numeric($val)) {
-// echo 'Element is a Number
';
- if ((strpos($val, '.') !== false) || (stripos($val, 'e') !== false) || ($val > PHP_INT_MAX) || ($val < -PHP_INT_MAX)) {
-// echo 'Casting '.$val.' to float
';
- $val = (float) $val;
- } else {
-// echo 'Casting '.$val.' to integer
';
- $val = (integer) $val;
- }
- } elseif (isset(self::$excelConstants[trim(strtoupper($val))])) {
- $excelConstant = trim(strtoupper($val));
-// echo 'Element '.$excelConstant.' is an Excel Constant
';
- $val = self::$excelConstants[$excelConstant];
- } elseif (($localeConstant = array_search(trim(strtoupper($val)), self::$localeBoolean)) !== false) {
-// echo 'Element '.$localeConstant.' is an Excel Constant
';
- $val = self::$excelConstants[$localeConstant];
- }
- $details = array('type' => 'Value', 'value' => $val, 'reference' => null);
- if ($localeConstant) {
- $details['localeValue'] = $localeConstant;
- }
- $output[] = $details;
- }
- $index += $length;
-
- } elseif ($opCharacter == '$') { // absolute row or column range
- ++$index;
- } elseif ($opCharacter == ')') { // miscellaneous error checking
- if ($expectingOperand) {
- $output[] = array('type' => 'NULL Value', 'value' => self::$excelConstants['NULL'], 'reference' => null);
- $expectingOperand = false;
- $expectingOperator = true;
- } else {
- return $this->raiseFormulaError("Formula Error: Unexpected ')'");
- }
- } elseif (isset(self::$operators[$opCharacter]) && !$expectingOperator) {
- return $this->raiseFormulaError("Formula Error: Unexpected operator '$opCharacter'");
- } else { // I don't even want to know what you did to get here
- return $this->raiseFormulaError("Formula Error: An unexpected error occured");
- }
- // Test for end of formula string
- if ($index == strlen($formula)) {
- // Did we end with an operator?.
- // Only valid for the % unary operator
- if ((isset(self::$operators[$opCharacter])) && ($opCharacter != '%')) {
- return $this->raiseFormulaError("Formula Error: Operator '$opCharacter' has no operands");
- } else {
- break;
- }
- }
- // Ignore white space
- while (($formula{$index} == "\n") || ($formula{$index} == "\r")) {
- ++$index;
- }
- if ($formula{$index} == ' ') {
- while ($formula{$index} == ' ') {
- ++$index;
- }
- // If we're expecting an operator, but only have a space between the previous and next operands (and both are
- // Cell References) then we have an INTERSECTION operator
-// echo 'Possible Intersect Operator
';
- if (($expectingOperator) && (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'.*/Ui', substr($formula, $index), $match)) &&
- ($output[count($output)-1]['type'] == 'Cell Reference')) {
-// echo 'Element is an Intersect Operator
';
- while ($stack->count() > 0 &&
- ($o2 = $stack->last()) &&
- isset(self::$operators[$o2['value']]) &&
- @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])) {
- $output[] = $stack->pop(); // Swap operands and higher precedence operators from the stack to the output
- }
- $stack->push('Binary Operator', '|'); // Put an Intersect Operator on the stack
- $expectingOperator = false;
- }
- }
- }
-
- while (($op = $stack->pop()) !== null) { // pop everything off the stack and push onto output
- if ((is_array($op) && $op['value'] == '(') || ($op === '(')) {
- return $this->raiseFormulaError("Formula Error: Expecting ')'"); // if there are any opening braces on the stack, then braces were unbalanced
- }
- $output[] = $op;
- }
- return $output;
- }
-
-
- private static function dataTestReference(&$operandData)
- {
- $operand = $operandData['value'];
- if (($operandData['reference'] === null) && (is_array($operand))) {
- $rKeys = array_keys($operand);
- $rowKey = array_shift($rKeys);
- $cKeys = array_keys(array_keys($operand[$rowKey]));
- $colKey = array_shift($cKeys);
- if (ctype_upper($colKey)) {
- $operandData['reference'] = $colKey.$rowKey;
- }
- }
- return $operand;
- }
-
- // evaluate postfix notation
- private function processTokenStack($tokens, $cellID = null, PHPExcel_Cell $pCell = null)
- {
- if ($tokens == false) {
- return false;
- }
-
- // If we're using cell caching, then $pCell may well be flushed back to the cache (which detaches the parent cell collection),
- // so we store the parent cell collection so that we can re-attach it when necessary
- $pCellWorksheet = ($pCell !== null) ? $pCell->getWorksheet() : null;
- $pCellParent = ($pCell !== null) ? $pCell->getParent() : null;
- $stack = new PHPExcel_Calculation_Token_Stack;
-
- // Loop through each token in turn
- foreach ($tokens as $tokenData) {
-// print_r($tokenData);
-// echo '
';
- $token = $tokenData['value'];
-// echo 'Token is '.$token.'
';
- // if the token is a binary operator, pop the top two values off the stack, do the operation, and push the result back on the stack
- if (isset(self::$binaryOperators[$token])) {
-// echo 'Token is a binary operator
';
- // We must have two operands, error if we don't
- if (($operand2Data = $stack->pop()) === null) {
- return $this->raiseFormulaError('Internal error - Operand value missing from stack');
- }
- if (($operand1Data = $stack->pop()) === null) {
- return $this->raiseFormulaError('Internal error - Operand value missing from stack');
- }
-
- $operand1 = self::dataTestReference($operand1Data);
- $operand2 = self::dataTestReference($operand2Data);
-
- // Log what we're doing
- if ($token == ':') {
- $this->_debugLog->writeDebugLog('Evaluating Range ', $this->showValue($operand1Data['reference']), ' ', $token, ' ', $this->showValue($operand2Data['reference']));
- } else {
- $this->_debugLog->writeDebugLog('Evaluating ', $this->showValue($operand1), ' ', $token, ' ', $this->showValue($operand2));
- }
-
- // Process the operation in the appropriate manner
- switch ($token) {
- // Comparison (Boolean) Operators
- case '>': // Greater than
- case '<': // Less than
- case '>=': // Greater than or Equal to
- case '<=': // Less than or Equal to
- case '=': // Equality
- case '<>': // Inequality
- $this->executeBinaryComparisonOperation($cellID, $operand1, $operand2, $token, $stack);
- break;
- // Binary Operators
- case ':': // Range
- $sheet1 = $sheet2 = '';
- if (strpos($operand1Data['reference'], '!') !== false) {
- list($sheet1, $operand1Data['reference']) = explode('!', $operand1Data['reference']);
- } else {
- $sheet1 = ($pCellParent !== null) ? $pCellWorksheet->getTitle() : '';
- }
- if (strpos($operand2Data['reference'], '!') !== false) {
- list($sheet2, $operand2Data['reference']) = explode('!', $operand2Data['reference']);
- } else {
- $sheet2 = $sheet1;
- }
- if ($sheet1 == $sheet2) {
- if ($operand1Data['reference'] === null) {
- if ((trim($operand1Data['value']) != '') && (is_numeric($operand1Data['value']))) {
- $operand1Data['reference'] = $pCell->getColumn().$operand1Data['value'];
- } elseif (trim($operand1Data['reference']) == '') {
- $operand1Data['reference'] = $pCell->getCoordinate();
- } else {
- $operand1Data['reference'] = $operand1Data['value'].$pCell->getRow();
- }
- }
- if ($operand2Data['reference'] === null) {
- if ((trim($operand2Data['value']) != '') && (is_numeric($operand2Data['value']))) {
- $operand2Data['reference'] = $pCell->getColumn().$operand2Data['value'];
- } elseif (trim($operand2Data['reference']) == '') {
- $operand2Data['reference'] = $pCell->getCoordinate();
- } else {
- $operand2Data['reference'] = $operand2Data['value'].$pCell->getRow();
- }
- }
-
- $oData = array_merge(explode(':', $operand1Data['reference']), explode(':', $operand2Data['reference']));
- $oCol = $oRow = array();
- foreach ($oData as $oDatum) {
- $oCR = PHPExcel_Cell::coordinateFromString($oDatum);
- $oCol[] = PHPExcel_Cell::columnIndexFromString($oCR[0]) - 1;
- $oRow[] = $oCR[1];
- }
- $cellRef = PHPExcel_Cell::stringFromColumnIndex(min($oCol)).min($oRow).':'.PHPExcel_Cell::stringFromColumnIndex(max($oCol)).max($oRow);
- if ($pCellParent !== null) {
- $cellValue = $this->extractCellRange($cellRef, $this->workbook->getSheetByName($sheet1), false);
- } else {
- return $this->raiseFormulaError('Unable to access Cell Reference');
- }
- $stack->push('Cell Reference', $cellValue, $cellRef);
- } else {
- $stack->push('Error', PHPExcel_Calculation_Functions::REF(), null);
- }
- break;
- case '+': // Addition
- $this->executeNumericBinaryOperation($cellID, $operand1, $operand2, $token, 'plusEquals', $stack);
- break;
- case '-': // Subtraction
- $this->executeNumericBinaryOperation($cellID, $operand1, $operand2, $token, 'minusEquals', $stack);
- break;
- case '*': // Multiplication
- $this->executeNumericBinaryOperation($cellID, $operand1, $operand2, $token, 'arrayTimesEquals', $stack);
- break;
- case '/': // Division
- $this->executeNumericBinaryOperation($cellID, $operand1, $operand2, $token, 'arrayRightDivide', $stack);
- break;
- case '^': // Exponential
- $this->executeNumericBinaryOperation($cellID, $operand1, $operand2, $token, 'power', $stack);
- break;
- case '&': // Concatenation
- // If either of the operands is a matrix, we need to treat them both as matrices
- // (converting the other operand to a matrix if need be); then perform the required
- // matrix operation
- if (is_bool($operand1)) {
- $operand1 = ($operand1) ? self::$localeBoolean['TRUE'] : self::$localeBoolean['FALSE'];
- }
- if (is_bool($operand2)) {
- $operand2 = ($operand2) ? self::$localeBoolean['TRUE'] : self::$localeBoolean['FALSE'];
- }
- if ((is_array($operand1)) || (is_array($operand2))) {
- // Ensure that both operands are arrays/matrices
- self::checkMatrixOperands($operand1, $operand2, 2);
- try {
- // Convert operand 1 from a PHP array to a matrix
- $matrix = new PHPExcel_Shared_JAMA_Matrix($operand1);
- // Perform the required operation against the operand 1 matrix, passing in operand 2
- $matrixResult = $matrix->concat($operand2);
- $result = $matrixResult->getArray();
- } catch (PHPExcel_Exception $ex) {
- $this->_debugLog->writeDebugLog('JAMA Matrix Exception: ', $ex->getMessage());
- $result = '#VALUE!';
- }
- } else {
- $result = '"'.str_replace('""', '"', self::unwrapResult($operand1, '"').self::unwrapResult($operand2, '"')).'"';
- }
- $this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($result));
- $stack->push('Value', $result);
- break;
- case '|': // Intersect
- $rowIntersect = array_intersect_key($operand1, $operand2);
- $cellIntersect = $oCol = $oRow = array();
- foreach (array_keys($rowIntersect) as $row) {
- $oRow[] = $row;
- foreach ($rowIntersect[$row] as $col => $data) {
- $oCol[] = PHPExcel_Cell::columnIndexFromString($col) - 1;
- $cellIntersect[$row] = array_intersect_key($operand1[$row], $operand2[$row]);
- }
- }
- $cellRef = PHPExcel_Cell::stringFromColumnIndex(min($oCol)).min($oRow).':'.PHPExcel_Cell::stringFromColumnIndex(max($oCol)).max($oRow);
- $this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($cellIntersect));
- $stack->push('Value', $cellIntersect, $cellRef);
- break;
- }
-
- // if the token is a unary operator, pop one value off the stack, do the operation, and push it back on
- } elseif (($token === '~') || ($token === '%')) {
-// echo 'Token is a unary operator
';
- if (($arg = $stack->pop()) === null) {
- return $this->raiseFormulaError('Internal error - Operand value missing from stack');
- }
- $arg = $arg['value'];
- if ($token === '~') {
-// echo 'Token is a negation operator
';
- $this->_debugLog->writeDebugLog('Evaluating Negation of ', $this->showValue($arg));
- $multiplier = -1;
- } else {
-// echo 'Token is a percentile operator
';
- $this->_debugLog->writeDebugLog('Evaluating Percentile of ', $this->showValue($arg));
- $multiplier = 0.01;
- }
- if (is_array($arg)) {
- self::checkMatrixOperands($arg, $multiplier, 2);
- try {
- $matrix1 = new PHPExcel_Shared_JAMA_Matrix($arg);
- $matrixResult = $matrix1->arrayTimesEquals($multiplier);
- $result = $matrixResult->getArray();
- } catch (PHPExcel_Exception $ex) {
- $this->_debugLog->writeDebugLog('JAMA Matrix Exception: ', $ex->getMessage());
- $result = '#VALUE!';
- }
- $this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($result));
- $stack->push('Value', $result);
- } else {
- $this->executeNumericBinaryOperation($cellID, $multiplier, $arg, '*', 'arrayTimesEquals', $stack);
- }
-
- } elseif (preg_match('/^'.self::CALCULATION_REGEXP_CELLREF.'$/i', $token, $matches)) {
- $cellRef = null;
-// echo 'Element '.$token.' is a Cell reference
';
- if (isset($matches[8])) {
-// echo 'Reference is a Range of cells
';
- if ($pCell === null) {
-// We can't access the range, so return a REF error
- $cellValue = PHPExcel_Calculation_Functions::REF();
- } else {
- $cellRef = $matches[6].$matches[7].':'.$matches[9].$matches[10];
- if ($matches[2] > '') {
- $matches[2] = trim($matches[2], "\"'");
- if ((strpos($matches[2], '[') !== false) || (strpos($matches[2], ']') !== false)) {
- // It's a Reference to an external workbook (not currently supported)
- return $this->raiseFormulaError('Unable to access External Workbook');
- }
- $matches[2] = trim($matches[2], "\"'");
-// echo '$cellRef='.$cellRef.' in worksheet '.$matches[2].'
';
- $this->_debugLog->writeDebugLog('Evaluating Cell Range ', $cellRef, ' in worksheet ', $matches[2]);
- if ($pCellParent !== null) {
- $cellValue = $this->extractCellRange($cellRef, $this->workbook->getSheetByName($matches[2]), false);
- } else {
- return $this->raiseFormulaError('Unable to access Cell Reference');
- }
- $this->_debugLog->writeDebugLog('Evaluation Result for cells ', $cellRef, ' in worksheet ', $matches[2], ' is ', $this->showTypeDetails($cellValue));
-// $cellRef = $matches[2].'!'.$cellRef;
- } else {
-// echo '$cellRef='.$cellRef.' in current worksheet
';
- $this->_debugLog->writeDebugLog('Evaluating Cell Range ', $cellRef, ' in current worksheet');
- if ($pCellParent !== null) {
- $cellValue = $this->extractCellRange($cellRef, $pCellWorksheet, false);
- } else {
- return $this->raiseFormulaError('Unable to access Cell Reference');
- }
- $this->_debugLog->writeDebugLog('Evaluation Result for cells ', $cellRef, ' is ', $this->showTypeDetails($cellValue));
- }
- }
- } else {
-// echo 'Reference is a single Cell
';
- if ($pCell === null) {
-// We can't access the cell, so return a REF error
- $cellValue = PHPExcel_Calculation_Functions::REF();
- } else {
- $cellRef = $matches[6].$matches[7];
- if ($matches[2] > '') {
- $matches[2] = trim($matches[2], "\"'");
- if ((strpos($matches[2], '[') !== false) || (strpos($matches[2], ']') !== false)) {
- // It's a Reference to an external workbook (not currently supported)
- return $this->raiseFormulaError('Unable to access External Workbook');
- }
-// echo '$cellRef='.$cellRef.' in worksheet '.$matches[2].'
';
- $this->_debugLog->writeDebugLog('Evaluating Cell ', $cellRef, ' in worksheet ', $matches[2]);
- if ($pCellParent !== null) {
- $cellSheet = $this->workbook->getSheetByName($matches[2]);
- if ($cellSheet && $cellSheet->cellExists($cellRef)) {
- $cellValue = $this->extractCellRange($cellRef, $this->workbook->getSheetByName($matches[2]), false);
- $pCell->attach($pCellParent);
- } else {
- $cellValue = null;
- }
- } else {
- return $this->raiseFormulaError('Unable to access Cell Reference');
- }
- $this->_debugLog->writeDebugLog('Evaluation Result for cell ', $cellRef, ' in worksheet ', $matches[2], ' is ', $this->showTypeDetails($cellValue));
-// $cellRef = $matches[2].'!'.$cellRef;
- } else {
-// echo '$cellRef='.$cellRef.' in current worksheet
';
- $this->_debugLog->writeDebugLog('Evaluating Cell ', $cellRef, ' in current worksheet');
- if ($pCellParent->isDataSet($cellRef)) {
- $cellValue = $this->extractCellRange($cellRef, $pCellWorksheet, false);
- $pCell->attach($pCellParent);
- } else {
- $cellValue = null;
- }
- $this->_debugLog->writeDebugLog('Evaluation Result for cell ', $cellRef, ' is ', $this->showTypeDetails($cellValue));
- }
- }
- }
- $stack->push('Value', $cellValue, $cellRef);
-
- // if the token is a function, pop arguments off the stack, hand them to the function, and push the result back on
- } elseif (preg_match('/^'.self::CALCULATION_REGEXP_FUNCTION.'$/i', $token, $matches)) {
-// echo 'Token is a function
';
- $functionName = $matches[1];
- $argCount = $stack->pop();
- $argCount = $argCount['value'];
- if ($functionName != 'MKMATRIX') {
- $this->_debugLog->writeDebugLog('Evaluating Function ', self::localeFunc($functionName), '() with ', (($argCount == 0) ? 'no' : $argCount), ' argument', (($argCount == 1) ? '' : 's'));
- }
- if ((isset(self::$PHPExcelFunctions[$functionName])) || (isset(self::$controlFunctions[$functionName]))) { // function
- if (isset(self::$PHPExcelFunctions[$functionName])) {
- $functionCall = self::$PHPExcelFunctions[$functionName]['functionCall'];
- $passByReference = isset(self::$PHPExcelFunctions[$functionName]['passByReference']);
- $passCellReference = isset(self::$PHPExcelFunctions[$functionName]['passCellReference']);
- } elseif (isset(self::$controlFunctions[$functionName])) {
- $functionCall = self::$controlFunctions[$functionName]['functionCall'];
- $passByReference = isset(self::$controlFunctions[$functionName]['passByReference']);
- $passCellReference = isset(self::$controlFunctions[$functionName]['passCellReference']);
- }
- // get the arguments for this function
-// echo 'Function '.$functionName.' expects '.$argCount.' arguments
';
- $args = $argArrayVals = array();
- for ($i = 0; $i < $argCount; ++$i) {
- $arg = $stack->pop();
- $a = $argCount - $i - 1;
- if (($passByReference) &&
- (isset(self::$PHPExcelFunctions[$functionName]['passByReference'][$a])) &&
- (self::$PHPExcelFunctions[$functionName]['passByReference'][$a])) {
- if ($arg['reference'] === null) {
- $args[] = $cellID;
- if ($functionName != 'MKMATRIX') {
- $argArrayVals[] = $this->showValue($cellID);
- }
- } else {
- $args[] = $arg['reference'];
- if ($functionName != 'MKMATRIX') {
- $argArrayVals[] = $this->showValue($arg['reference']);
- }
- }
- } else {
- $args[] = self::unwrapResult($arg['value']);
- if ($functionName != 'MKMATRIX') {
- $argArrayVals[] = $this->showValue($arg['value']);
- }
- }
- }
- // Reverse the order of the arguments
- krsort($args);
- if (($passByReference) && ($argCount == 0)) {
- $args[] = $cellID;
- $argArrayVals[] = $this->showValue($cellID);
- }
-// echo 'Arguments are: ';
-// print_r($args);
-// echo '
';
- if ($functionName != 'MKMATRIX') {
- if ($this->_debugLog->getWriteDebugLog()) {
- krsort($argArrayVals);
- $this->_debugLog->writeDebugLog('Evaluating ', self::localeFunc($functionName), '( ', implode(self::$localeArgumentSeparator.' ', PHPExcel_Calculation_Functions::flattenArray($argArrayVals)), ' )');
- }
- }
- // Process each argument in turn, building the return value as an array
-// if (($argCount == 1) && (is_array($args[1])) && ($functionName != 'MKMATRIX')) {
-// $operand1 = $args[1];
-// $this->_debugLog->writeDebugLog('Argument is a matrix: ', $this->showValue($operand1));
-// $result = array();
-// $row = 0;
-// foreach($operand1 as $args) {
-// if (is_array($args)) {
-// foreach($args as $arg) {
-// $this->_debugLog->writeDebugLog('Evaluating ', self::localeFunc($functionName), '( ', $this->showValue($arg), ' )');
-// $r = call_user_func_array($functionCall, $arg);
-// $this->_debugLog->writeDebugLog('Evaluation Result for ', self::localeFunc($functionName), '() function call is ', $this->showTypeDetails($r));
-// $result[$row][] = $r;
-// }
-// ++$row;
-// } else {
-// $this->_debugLog->writeDebugLog('Evaluating ', self::localeFunc($functionName), '( ', $this->showValue($args), ' )');
-// $r = call_user_func_array($functionCall, $args);
-// $this->_debugLog->writeDebugLog('Evaluation Result for ', self::localeFunc($functionName), '() function call is ', $this->showTypeDetails($r));
-// $result[] = $r;
-// }
-// }
-// } else {
- // Process the argument with the appropriate function call
- if ($passCellReference) {
- $args[] = $pCell;
- }
- if (strpos($functionCall, '::') !== false) {
- $result = call_user_func_array(explode('::', $functionCall), $args);
- } else {
- foreach ($args as &$arg) {
- $arg = PHPExcel_Calculation_Functions::flattenSingleValue($arg);
- }
- unset($arg);
- $result = call_user_func_array($functionCall, $args);
- }
- if ($functionName != 'MKMATRIX') {
- $this->_debugLog->writeDebugLog('Evaluation Result for ', self::localeFunc($functionName), '() function call is ', $this->showTypeDetails($result));
- }
- $stack->push('Value', self::wrapResult($result));
- }
-
- } else {
- // if the token is a number, boolean, string or an Excel error, push it onto the stack
- if (isset(self::$excelConstants[strtoupper($token)])) {
- $excelConstant = strtoupper($token);
-// echo 'Token is a PHPExcel constant: '.$excelConstant.'
';
- $stack->push('Constant Value', self::$excelConstants[$excelConstant]);
- $this->_debugLog->writeDebugLog('Evaluating Constant ', $excelConstant, ' as ', $this->showTypeDetails(self::$excelConstants[$excelConstant]));
- } elseif ((is_numeric($token)) || ($token === null) || (is_bool($token)) || ($token == '') || ($token{0} == '"') || ($token{0} == '#')) {
-// echo 'Token is a number, boolean, string, null or an Excel error
';
- $stack->push('Value', $token);
- // if the token is a named range, push the named range name onto the stack
- } elseif (preg_match('/^'.self::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $token, $matches)) {
-// echo 'Token is a named range
';
- $namedRange = $matches[6];
-// echo 'Named Range is '.$namedRange.'
';
- $this->_debugLog->writeDebugLog('Evaluating Named Range ', $namedRange);
- $cellValue = $this->extractNamedRange($namedRange, ((null !== $pCell) ? $pCellWorksheet : null), false);
- $pCell->attach($pCellParent);
- $this->_debugLog->writeDebugLog('Evaluation Result for named range ', $namedRange, ' is ', $this->showTypeDetails($cellValue));
- $stack->push('Named Range', $cellValue, $namedRange);
- } else {
- return $this->raiseFormulaError("undefined variable '$token'");
- }
- }
- }
- // when we're out of tokens, the stack should have a single element, the final result
- if ($stack->count() != 1) {
- return $this->raiseFormulaError("internal error");
- }
- $output = $stack->pop();
- $output = $output['value'];
-
-// if ((is_array($output)) && (self::$returnArrayAsType != self::RETURN_ARRAY_AS_ARRAY)) {
-// return array_shift(PHPExcel_Calculation_Functions::flattenArray($output));
-// }
- return $output;
- }
-
-
- private function validateBinaryOperand($cellID, &$operand, &$stack)
- {
- if (is_array($operand)) {
- if ((count($operand, COUNT_RECURSIVE) - count($operand)) == 1) {
- do {
- $operand = array_pop($operand);
- } while (is_array($operand));
- }
- }
- // Numbers, matrices and booleans can pass straight through, as they're already valid
- if (is_string($operand)) {
- // We only need special validations for the operand if it is a string
- // Start by stripping off the quotation marks we use to identify true excel string values internally
- if ($operand > '' && $operand{0} == '"') {
- $operand = self::unwrapResult($operand);
- }
- // If the string is a numeric value, we treat it as a numeric, so no further testing
- if (!is_numeric($operand)) {
- // If not a numeric, test to see if the value is an Excel error, and so can't be used in normal binary operations
- if ($operand > '' && $operand{0} == '#') {
- $stack->push('Value', $operand);
- $this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($operand));
- return false;
- } elseif (!PHPExcel_Shared_String::convertToNumberIfFraction($operand)) {
- // If not a numeric or a fraction, then it's a text string, and so can't be used in mathematical binary operations
- $stack->push('Value', '#VALUE!');
- $this->_debugLog->writeDebugLog('Evaluation Result is a ', $this->showTypeDetails('#VALUE!'));
- return false;
- }
- }
- }
-
- // return a true if the value of the operand is one that we can use in normal binary operations
- return true;
- }
-
-
- private function executeBinaryComparisonOperation($cellID, $operand1, $operand2, $operation, &$stack, $recursingArrays = false)
- {
- // If we're dealing with matrix operations, we want a matrix result
- if ((is_array($operand1)) || (is_array($operand2))) {
- $result = array();
- if ((is_array($operand1)) && (!is_array($operand2))) {
- foreach ($operand1 as $x => $operandData) {
- $this->_debugLog->writeDebugLog('Evaluating Comparison ', $this->showValue($operandData), ' ', $operation, ' ', $this->showValue($operand2));
- $this->executeBinaryComparisonOperation($cellID, $operandData, $operand2, $operation, $stack);
- $r = $stack->pop();
- $result[$x] = $r['value'];
- }
- } elseif ((!is_array($operand1)) && (is_array($operand2))) {
- foreach ($operand2 as $x => $operandData) {
- $this->_debugLog->writeDebugLog('Evaluating Comparison ', $this->showValue($operand1), ' ', $operation, ' ', $this->showValue($operandData));
- $this->executeBinaryComparisonOperation($cellID, $operand1, $operandData, $operation, $stack);
- $r = $stack->pop();
- $result[$x] = $r['value'];
- }
- } else {
- if (!$recursingArrays) {
- self::checkMatrixOperands($operand1, $operand2, 2);
- }
- foreach ($operand1 as $x => $operandData) {
- $this->_debugLog->writeDebugLog('Evaluating Comparison ', $this->showValue($operandData), ' ', $operation, ' ', $this->showValue($operand2[$x]));
- $this->executeBinaryComparisonOperation($cellID, $operandData, $operand2[$x], $operation, $stack, true);
- $r = $stack->pop();
- $result[$x] = $r['value'];
- }
- }
- // Log the result details
- $this->_debugLog->writeDebugLog('Comparison Evaluation Result is ', $this->showTypeDetails($result));
- // And push the result onto the stack
- $stack->push('Array', $result);
- return true;
- }
-
- // Simple validate the two operands if they are string values
- if (is_string($operand1) && $operand1 > '' && $operand1{0} == '"') {
- $operand1 = self::unwrapResult($operand1);
- }
- if (is_string($operand2) && $operand2 > '' && $operand2{0} == '"') {
- $operand2 = self::unwrapResult($operand2);
- }
-
- // Use case insensitive comparaison if not OpenOffice mode
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() != PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
- if (is_string($operand1)) {
- $operand1 = strtoupper($operand1);
- }
- if (is_string($operand2)) {
- $operand2 = strtoupper($operand2);
- }
- }
-
- $useLowercaseFirstComparison = is_string($operand1) && is_string($operand2) && PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE;
-
- // execute the necessary operation
- switch ($operation) {
- // Greater than
- case '>':
- if ($useLowercaseFirstComparison) {
- $result = $this->strcmpLowercaseFirst($operand1, $operand2) > 0;
- } else {
- $result = ($operand1 > $operand2);
- }
- break;
- // Less than
- case '<':
- if ($useLowercaseFirstComparison) {
- $result = $this->strcmpLowercaseFirst($operand1, $operand2) < 0;
- } else {
- $result = ($operand1 < $operand2);
- }
- break;
- // Equality
- case '=':
- if (is_numeric($operand1) && is_numeric($operand2)) {
- $result = (abs($operand1 - $operand2) < $this->delta);
- } else {
- $result = strcmp($operand1, $operand2) == 0;
- }
- break;
- // Greater than or equal
- case '>=':
- if (is_numeric($operand1) && is_numeric($operand2)) {
- $result = ((abs($operand1 - $operand2) < $this->delta) || ($operand1 > $operand2));
- } elseif ($useLowercaseFirstComparison) {
- $result = $this->strcmpLowercaseFirst($operand1, $operand2) >= 0;
- } else {
- $result = strcmp($operand1, $operand2) >= 0;
- }
- break;
- // Less than or equal
- case '<=':
- if (is_numeric($operand1) && is_numeric($operand2)) {
- $result = ((abs($operand1 - $operand2) < $this->delta) || ($operand1 < $operand2));
- } elseif ($useLowercaseFirstComparison) {
- $result = $this->strcmpLowercaseFirst($operand1, $operand2) <= 0;
- } else {
- $result = strcmp($operand1, $operand2) <= 0;
- }
- break;
- // Inequality
- case '<>':
- if (is_numeric($operand1) && is_numeric($operand2)) {
- $result = (abs($operand1 - $operand2) > 1E-14);
- } else {
- $result = strcmp($operand1, $operand2) != 0;
- }
- break;
- }
-
- // Log the result details
- $this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($result));
- // And push the result onto the stack
- $stack->push('Value', $result);
- return true;
- }
-
- /**
- * Compare two strings in the same way as strcmp() except that lowercase come before uppercase letters
- * @param string $str1 First string value for the comparison
- * @param string $str2 Second string value for the comparison
- * @return integer
- */
- private function strcmpLowercaseFirst($str1, $str2)
- {
- $inversedStr1 = PHPExcel_Shared_String::StrCaseReverse($str1);
- $inversedStr2 = PHPExcel_Shared_String::StrCaseReverse($str2);
-
- return strcmp($inversedStr1, $inversedStr2);
- }
-
- private function executeNumericBinaryOperation($cellID, $operand1, $operand2, $operation, $matrixFunction, &$stack)
- {
- // Validate the two operands
- if (!$this->validateBinaryOperand($cellID, $operand1, $stack)) {
- return false;
- }
- if (!$this->validateBinaryOperand($cellID, $operand2, $stack)) {
- return false;
- }
-
- // If either of the operands is a matrix, we need to treat them both as matrices
- // (converting the other operand to a matrix if need be); then perform the required
- // matrix operation
- if ((is_array($operand1)) || (is_array($operand2))) {
- // Ensure that both operands are arrays/matrices of the same size
- self::checkMatrixOperands($operand1, $operand2, 2);
-
- try {
- // Convert operand 1 from a PHP array to a matrix
- $matrix = new PHPExcel_Shared_JAMA_Matrix($operand1);
- // Perform the required operation against the operand 1 matrix, passing in operand 2
- $matrixResult = $matrix->$matrixFunction($operand2);
- $result = $matrixResult->getArray();
- } catch (PHPExcel_Exception $ex) {
- $this->_debugLog->writeDebugLog('JAMA Matrix Exception: ', $ex->getMessage());
- $result = '#VALUE!';
- }
- } else {
- if ((PHPExcel_Calculation_Functions::getCompatibilityMode() != PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) &&
- ((is_string($operand1) && !is_numeric($operand1) && strlen($operand1)>0) ||
- (is_string($operand2) && !is_numeric($operand2) && strlen($operand2)>0))) {
- $result = PHPExcel_Calculation_Functions::VALUE();
- } else {
- // If we're dealing with non-matrix operations, execute the necessary operation
- switch ($operation) {
- // Addition
- case '+':
- $result = $operand1 + $operand2;
- break;
- // Subtraction
- case '-':
- $result = $operand1 - $operand2;
- break;
- // Multiplication
- case '*':
- $result = $operand1 * $operand2;
- break;
- // Division
- case '/':
- if ($operand2 == 0) {
- // Trap for Divide by Zero error
- $stack->push('Value', '#DIV/0!');
- $this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails('#DIV/0!'));
- return false;
- } else {
- $result = $operand1 / $operand2;
- }
- break;
- // Power
- case '^':
- $result = pow($operand1, $operand2);
- break;
- }
- }
- }
-
- // Log the result details
- $this->_debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($result));
- // And push the result onto the stack
- $stack->push('Value', $result);
- return true;
- }
-
-
- // trigger an error, but nicely, if need be
- protected function raiseFormulaError($errorMessage)
- {
- $this->formulaError = $errorMessage;
- $this->cyclicReferenceStack->clear();
- if (!$this->suppressFormulaErrors) {
- throw new PHPExcel_Calculation_Exception($errorMessage);
- }
- trigger_error($errorMessage, E_USER_ERROR);
- }
-
-
- /**
- * Extract range values
- *
- * @param string &$pRange String based range representation
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @param boolean $resetLog Flag indicating whether calculation log should be reset or not
- * @return mixed Array of values in range if range contains more than one element. Otherwise, a single value is returned.
- * @throws PHPExcel_Calculation_Exception
- */
- public function extractCellRange(&$pRange = 'A1', PHPExcel_Worksheet $pSheet = null, $resetLog = true)
- {
- // Return value
- $returnValue = array ();
-
-// echo 'extractCellRange('.$pRange.')', PHP_EOL;
- if ($pSheet !== null) {
- $pSheetName = $pSheet->getTitle();
-// echo 'Passed sheet name is '.$pSheetName.PHP_EOL;
-// echo 'Range reference is '.$pRange.PHP_EOL;
- if (strpos($pRange, '!') !== false) {
-// echo '$pRange reference includes sheet reference', PHP_EOL;
- list($pSheetName, $pRange) = PHPExcel_Worksheet::extractSheetTitle($pRange, true);
-// echo 'New sheet name is '.$pSheetName, PHP_EOL;
-// echo 'Adjusted Range reference is '.$pRange, PHP_EOL;
- $pSheet = $this->workbook->getSheetByName($pSheetName);
- }
-
- // Extract range
- $aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($pRange);
- $pRange = $pSheetName.'!'.$pRange;
- if (!isset($aReferences[1])) {
- // Single cell in range
- sscanf($aReferences[0], '%[A-Z]%d', $currentCol, $currentRow);
- $cellValue = null;
- if ($pSheet->cellExists($aReferences[0])) {
- $returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
- } else {
- $returnValue[$currentRow][$currentCol] = null;
- }
- } else {
- // Extract cell data for all cells in the range
- foreach ($aReferences as $reference) {
- // Extract range
- sscanf($reference, '%[A-Z]%d', $currentCol, $currentRow);
- $cellValue = null;
- if ($pSheet->cellExists($reference)) {
- $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog);
- } else {
- $returnValue[$currentRow][$currentCol] = null;
- }
- }
- }
- }
-
- return $returnValue;
- }
-
-
- /**
- * Extract range values
- *
- * @param string &$pRange String based range representation
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @return mixed Array of values in range if range contains more than one element. Otherwise, a single value is returned.
- * @param boolean $resetLog Flag indicating whether calculation log should be reset or not
- * @throws PHPExcel_Calculation_Exception
- */
- public function extractNamedRange(&$pRange = 'A1', PHPExcel_Worksheet $pSheet = null, $resetLog = true)
- {
- // Return value
- $returnValue = array ();
-
-// echo 'extractNamedRange('.$pRange.')
';
- if ($pSheet !== null) {
- $pSheetName = $pSheet->getTitle();
-// echo 'Current sheet name is '.$pSheetName.'
';
-// echo 'Range reference is '.$pRange.'
';
- if (strpos($pRange, '!') !== false) {
-// echo '$pRange reference includes sheet reference', PHP_EOL;
- list($pSheetName, $pRange) = PHPExcel_Worksheet::extractSheetTitle($pRange, true);
-// echo 'New sheet name is '.$pSheetName, PHP_EOL;
-// echo 'Adjusted Range reference is '.$pRange, PHP_EOL;
- $pSheet = $this->workbook->getSheetByName($pSheetName);
- }
-
- // Named range?
- $namedRange = PHPExcel_NamedRange::resolveRange($pRange, $pSheet);
- if ($namedRange !== null) {
- $pSheet = $namedRange->getWorksheet();
-// echo 'Named Range '.$pRange.' (';
- $pRange = $namedRange->getRange();
- $splitRange = PHPExcel_Cell::splitRange($pRange);
- // Convert row and column references
- if (ctype_alpha($splitRange[0][0])) {
- $pRange = $splitRange[0][0] . '1:' . $splitRange[0][1] . $namedRange->getWorksheet()->getHighestRow();
- } elseif (ctype_digit($splitRange[0][0])) {
- $pRange = 'A' . $splitRange[0][0] . ':' . $namedRange->getWorksheet()->getHighestColumn() . $splitRange[0][1];
- }
-// echo $pRange.') is in sheet '.$namedRange->getWorksheet()->getTitle().'
';
-
-// if ($pSheet->getTitle() != $namedRange->getWorksheet()->getTitle()) {
-// if (!$namedRange->getLocalOnly()) {
-// $pSheet = $namedRange->getWorksheet();
-// } else {
-// return $returnValue;
-// }
-// }
- } else {
- return PHPExcel_Calculation_Functions::REF();
- }
-
- // Extract range
- $aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($pRange);
-// var_dump($aReferences);
- if (!isset($aReferences[1])) {
- // Single cell (or single column or row) in range
- list($currentCol, $currentRow) = PHPExcel_Cell::coordinateFromString($aReferences[0]);
- $cellValue = null;
- if ($pSheet->cellExists($aReferences[0])) {
- $returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
- } else {
- $returnValue[$currentRow][$currentCol] = null;
- }
- } else {
- // Extract cell data for all cells in the range
- foreach ($aReferences as $reference) {
- // Extract range
- list($currentCol, $currentRow) = PHPExcel_Cell::coordinateFromString($reference);
-// echo 'NAMED RANGE: $currentCol='.$currentCol.' $currentRow='.$currentRow.'
';
- $cellValue = null;
- if ($pSheet->cellExists($reference)) {
- $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog);
- } else {
- $returnValue[$currentRow][$currentCol] = null;
- }
- }
- }
-// print_r($returnValue);
-// echo '
';
- }
-
- return $returnValue;
- }
-
-
- /**
- * Is a specific function implemented?
- *
- * @param string $pFunction Function Name
- * @return boolean
- */
- public function isImplemented($pFunction = '')
- {
- $pFunction = strtoupper($pFunction);
- if (isset(self::$PHPExcelFunctions[$pFunction])) {
- return (self::$PHPExcelFunctions[$pFunction]['functionCall'] != 'PHPExcel_Calculation_Functions::DUMMY');
- } else {
- return false;
- }
- }
-
-
- /**
- * Get a list of all implemented functions as an array of function objects
- *
- * @return array of PHPExcel_Calculation_Function
- */
- public function listFunctions()
- {
- $returnValue = array();
-
- foreach (self::$PHPExcelFunctions as $functionName => $function) {
- if ($function['functionCall'] != 'PHPExcel_Calculation_Functions::DUMMY') {
- $returnValue[$functionName] = new PHPExcel_Calculation_Function(
- $function['category'],
- $functionName,
- $function['functionCall']
- );
- }
- }
-
- return $returnValue;
- }
-
-
- /**
- * Get a list of all Excel function names
- *
- * @return array
- */
- public function listAllFunctionNames()
- {
- return array_keys(self::$PHPExcelFunctions);
- }
-
- /**
- * Get a list of implemented Excel function names
- *
- * @return array
- */
- public function listFunctionNames()
- {
- $returnValue = array();
- foreach (self::$PHPExcelFunctions as $functionName => $function) {
- if ($function['functionCall'] != 'PHPExcel_Calculation_Functions::DUMMY') {
- $returnValue[] = $functionName;
- }
- }
-
- return $returnValue;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Calculation/Engineering.php b/lib/phpexcel/PHPExcel/Calculation/Engineering.php
deleted file mode 100644
index 75e278474ff..00000000000
--- a/lib/phpexcel/PHPExcel/Calculation/Engineering.php
+++ /dev/null
@@ -1,2650 +0,0 @@
- array('Group' => 'Mass', 'Unit Name' => 'Gram', 'AllowPrefix' => true),
- 'sg' => array('Group' => 'Mass', 'Unit Name' => 'Slug', 'AllowPrefix' => false),
- 'lbm' => array('Group' => 'Mass', 'Unit Name' => 'Pound mass (avoirdupois)', 'AllowPrefix' => false),
- 'u' => array('Group' => 'Mass', 'Unit Name' => 'U (atomic mass unit)', 'AllowPrefix' => true),
- 'ozm' => array('Group' => 'Mass', 'Unit Name' => 'Ounce mass (avoirdupois)', 'AllowPrefix' => false),
- 'm' => array('Group' => 'Distance', 'Unit Name' => 'Meter', 'AllowPrefix' => true),
- 'mi' => array('Group' => 'Distance', 'Unit Name' => 'Statute mile', 'AllowPrefix' => false),
- 'Nmi' => array('Group' => 'Distance', 'Unit Name' => 'Nautical mile', 'AllowPrefix' => false),
- 'in' => array('Group' => 'Distance', 'Unit Name' => 'Inch', 'AllowPrefix' => false),
- 'ft' => array('Group' => 'Distance', 'Unit Name' => 'Foot', 'AllowPrefix' => false),
- 'yd' => array('Group' => 'Distance', 'Unit Name' => 'Yard', 'AllowPrefix' => false),
- 'ang' => array('Group' => 'Distance', 'Unit Name' => 'Angstrom', 'AllowPrefix' => true),
- 'Pica' => array('Group' => 'Distance', 'Unit Name' => 'Pica (1/72 in)', 'AllowPrefix' => false),
- 'yr' => array('Group' => 'Time', 'Unit Name' => 'Year', 'AllowPrefix' => false),
- 'day' => array('Group' => 'Time', 'Unit Name' => 'Day', 'AllowPrefix' => false),
- 'hr' => array('Group' => 'Time', 'Unit Name' => 'Hour', 'AllowPrefix' => false),
- 'mn' => array('Group' => 'Time', 'Unit Name' => 'Minute', 'AllowPrefix' => false),
- 'sec' => array('Group' => 'Time', 'Unit Name' => 'Second', 'AllowPrefix' => true),
- 'Pa' => array('Group' => 'Pressure', 'Unit Name' => 'Pascal', 'AllowPrefix' => true),
- 'p' => array('Group' => 'Pressure', 'Unit Name' => 'Pascal', 'AllowPrefix' => true),
- 'atm' => array('Group' => 'Pressure', 'Unit Name' => 'Atmosphere', 'AllowPrefix' => true),
- 'at' => array('Group' => 'Pressure', 'Unit Name' => 'Atmosphere', 'AllowPrefix' => true),
- 'mmHg' => array('Group' => 'Pressure', 'Unit Name' => 'mm of Mercury', 'AllowPrefix' => true),
- 'N' => array('Group' => 'Force', 'Unit Name' => 'Newton', 'AllowPrefix' => true),
- 'dyn' => array('Group' => 'Force', 'Unit Name' => 'Dyne', 'AllowPrefix' => true),
- 'dy' => array('Group' => 'Force', 'Unit Name' => 'Dyne', 'AllowPrefix' => true),
- 'lbf' => array('Group' => 'Force', 'Unit Name' => 'Pound force', 'AllowPrefix' => false),
- 'J' => array('Group' => 'Energy', 'Unit Name' => 'Joule', 'AllowPrefix' => true),
- 'e' => array('Group' => 'Energy', 'Unit Name' => 'Erg', 'AllowPrefix' => true),
- 'c' => array('Group' => 'Energy', 'Unit Name' => 'Thermodynamic calorie', 'AllowPrefix' => true),
- 'cal' => array('Group' => 'Energy', 'Unit Name' => 'IT calorie', 'AllowPrefix' => true),
- 'eV' => array('Group' => 'Energy', 'Unit Name' => 'Electron volt', 'AllowPrefix' => true),
- 'ev' => array('Group' => 'Energy', 'Unit Name' => 'Electron volt', 'AllowPrefix' => true),
- 'HPh' => array('Group' => 'Energy', 'Unit Name' => 'Horsepower-hour', 'AllowPrefix' => false),
- 'hh' => array('Group' => 'Energy', 'Unit Name' => 'Horsepower-hour', 'AllowPrefix' => false),
- 'Wh' => array('Group' => 'Energy', 'Unit Name' => 'Watt-hour', 'AllowPrefix' => true),
- 'wh' => array('Group' => 'Energy', 'Unit Name' => 'Watt-hour', 'AllowPrefix' => true),
- 'flb' => array('Group' => 'Energy', 'Unit Name' => 'Foot-pound', 'AllowPrefix' => false),
- 'BTU' => array('Group' => 'Energy', 'Unit Name' => 'BTU', 'AllowPrefix' => false),
- 'btu' => array('Group' => 'Energy', 'Unit Name' => 'BTU', 'AllowPrefix' => false),
- 'HP' => array('Group' => 'Power', 'Unit Name' => 'Horsepower', 'AllowPrefix' => false),
- 'h' => array('Group' => 'Power', 'Unit Name' => 'Horsepower', 'AllowPrefix' => false),
- 'W' => array('Group' => 'Power', 'Unit Name' => 'Watt', 'AllowPrefix' => true),
- 'w' => array('Group' => 'Power', 'Unit Name' => 'Watt', 'AllowPrefix' => true),
- 'T' => array('Group' => 'Magnetism', 'Unit Name' => 'Tesla', 'AllowPrefix' => true),
- 'ga' => array('Group' => 'Magnetism', 'Unit Name' => 'Gauss', 'AllowPrefix' => true),
- 'C' => array('Group' => 'Temperature', 'Unit Name' => 'Celsius', 'AllowPrefix' => false),
- 'cel' => array('Group' => 'Temperature', 'Unit Name' => 'Celsius', 'AllowPrefix' => false),
- 'F' => array('Group' => 'Temperature', 'Unit Name' => 'Fahrenheit', 'AllowPrefix' => false),
- 'fah' => array('Group' => 'Temperature', 'Unit Name' => 'Fahrenheit', 'AllowPrefix' => false),
- 'K' => array('Group' => 'Temperature', 'Unit Name' => 'Kelvin', 'AllowPrefix' => false),
- 'kel' => array('Group' => 'Temperature', 'Unit Name' => 'Kelvin', 'AllowPrefix' => false),
- 'tsp' => array('Group' => 'Liquid', 'Unit Name' => 'Teaspoon', 'AllowPrefix' => false),
- 'tbs' => array('Group' => 'Liquid', 'Unit Name' => 'Tablespoon', 'AllowPrefix' => false),
- 'oz' => array('Group' => 'Liquid', 'Unit Name' => 'Fluid Ounce', 'AllowPrefix' => false),
- 'cup' => array('Group' => 'Liquid', 'Unit Name' => 'Cup', 'AllowPrefix' => false),
- 'pt' => array('Group' => 'Liquid', 'Unit Name' => 'U.S. Pint', 'AllowPrefix' => false),
- 'us_pt' => array('Group' => 'Liquid', 'Unit Name' => 'U.S. Pint', 'AllowPrefix' => false),
- 'uk_pt' => array('Group' => 'Liquid', 'Unit Name' => 'U.K. Pint', 'AllowPrefix' => false),
- 'qt' => array('Group' => 'Liquid', 'Unit Name' => 'Quart', 'AllowPrefix' => false),
- 'gal' => array('Group' => 'Liquid', 'Unit Name' => 'Gallon', 'AllowPrefix' => false),
- 'l' => array('Group' => 'Liquid', 'Unit Name' => 'Litre', 'AllowPrefix' => true),
- 'lt' => array('Group' => 'Liquid', 'Unit Name' => 'Litre', 'AllowPrefix' => true),
- );
-
- /**
- * Details of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM()
- *
- * @var mixed[]
- */
- private static $conversionMultipliers = array(
- 'Y' => array('multiplier' => 1E24, 'name' => 'yotta'),
- 'Z' => array('multiplier' => 1E21, 'name' => 'zetta'),
- 'E' => array('multiplier' => 1E18, 'name' => 'exa'),
- 'P' => array('multiplier' => 1E15, 'name' => 'peta'),
- 'T' => array('multiplier' => 1E12, 'name' => 'tera'),
- 'G' => array('multiplier' => 1E9, 'name' => 'giga'),
- 'M' => array('multiplier' => 1E6, 'name' => 'mega'),
- 'k' => array('multiplier' => 1E3, 'name' => 'kilo'),
- 'h' => array('multiplier' => 1E2, 'name' => 'hecto'),
- 'e' => array('multiplier' => 1E1, 'name' => 'deka'),
- 'd' => array('multiplier' => 1E-1, 'name' => 'deci'),
- 'c' => array('multiplier' => 1E-2, 'name' => 'centi'),
- 'm' => array('multiplier' => 1E-3, 'name' => 'milli'),
- 'u' => array('multiplier' => 1E-6, 'name' => 'micro'),
- 'n' => array('multiplier' => 1E-9, 'name' => 'nano'),
- 'p' => array('multiplier' => 1E-12, 'name' => 'pico'),
- 'f' => array('multiplier' => 1E-15, 'name' => 'femto'),
- 'a' => array('multiplier' => 1E-18, 'name' => 'atto'),
- 'z' => array('multiplier' => 1E-21, 'name' => 'zepto'),
- 'y' => array('multiplier' => 1E-24, 'name' => 'yocto'),
- );
-
- /**
- * Details of the Units of measure conversion factors, organised by group
- *
- * @var mixed[]
- */
- private static $unitConversions = array(
- 'Mass' => array(
- 'g' => array(
- 'g' => 1.0,
- 'sg' => 6.85220500053478E-05,
- 'lbm' => 2.20462291469134E-03,
- 'u' => 6.02217000000000E+23,
- 'ozm' => 3.52739718003627E-02,
- ),
- 'sg' => array(
- 'g' => 1.45938424189287E+04,
- 'sg' => 1.0,
- 'lbm' => 3.21739194101647E+01,
- 'u' => 8.78866000000000E+27,
- 'ozm' => 5.14782785944229E+02,
- ),
- 'lbm' => array(
- 'g' => 4.5359230974881148E+02,
- 'sg' => 3.10810749306493E-02,
- 'lbm' => 1.0,
- 'u' => 2.73161000000000E+26,
- 'ozm' => 1.60000023429410E+01,
- ),
- 'u' => array(
- 'g' => 1.66053100460465E-24,
- 'sg' => 1.13782988532950E-28,
- 'lbm' => 3.66084470330684E-27,
- 'u' => 1.0,
- 'ozm' => 5.85735238300524E-26,
- ),
- 'ozm' => array(
- 'g' => 2.83495152079732E+01,
- 'sg' => 1.94256689870811E-03,
- 'lbm' => 6.24999908478882E-02,
- 'u' => 1.70725600000000E+25,
- 'ozm' => 1.0,
- ),
- ),
- 'Distance' => array(
- 'm' => array(
- 'm' => 1.0,
- 'mi' => 6.21371192237334E-04,
- 'Nmi' => 5.39956803455724E-04,
- 'in' => 3.93700787401575E+01,
- 'ft' => 3.28083989501312E+00,
- 'yd' => 1.09361329797891E+00,
- 'ang' => 1.00000000000000E+10,
- 'Pica' => 2.83464566929116E+03,
- ),
- 'mi' => array(
- 'm' => 1.60934400000000E+03,
- 'mi' => 1.0,
- 'Nmi' => 8.68976241900648E-01,
- 'in' => 6.33600000000000E+04,
- 'ft' => 5.28000000000000E+03,
- 'yd' => 1.76000000000000E+03,
- 'ang' => 1.60934400000000E+13,
- 'Pica' => 4.56191999999971E+06,
- ),
- 'Nmi' => array(
- 'm' => 1.85200000000000E+03,
- 'mi' => 1.15077944802354E+00,
- 'Nmi' => 1.0,
- 'in' => 7.29133858267717E+04,
- 'ft' => 6.07611548556430E+03,
- 'yd' => 2.02537182785694E+03,
- 'ang' => 1.85200000000000E+13,
- 'Pica' => 5.24976377952723E+06,
- ),
- 'in' => array(
- 'm' => 2.54000000000000E-02,
- 'mi' => 1.57828282828283E-05,
- 'Nmi' => 1.37149028077754E-05,
- 'in' => 1.0,
- 'ft' => 8.33333333333333E-02,
- 'yd' => 2.77777777686643E-02,
- 'ang' => 2.54000000000000E+08,
- 'Pica' => 7.19999999999955E+01,
- ),
- 'ft' => array(
- 'm' => 3.04800000000000E-01,
- 'mi' => 1.89393939393939E-04,
- 'Nmi' => 1.64578833693305E-04,
- 'in' => 1.20000000000000E+01,
- 'ft' => 1.0,
- 'yd' => 3.33333333223972E-01,
- 'ang' => 3.04800000000000E+09,
- 'Pica' => 8.63999999999946E+02,
- ),
- 'yd' => array(
- 'm' => 9.14400000300000E-01,
- 'mi' => 5.68181818368230E-04,
- 'Nmi' => 4.93736501241901E-04,
- 'in' => 3.60000000118110E+01,
- 'ft' => 3.00000000000000E+00,
- 'yd' => 1.0,
- 'ang' => 9.14400000300000E+09,
- 'Pica' => 2.59200000085023E+03,
- ),
- 'ang' => array(
- 'm' => 1.00000000000000E-10,
- 'mi' => 6.21371192237334E-14,
- 'Nmi' => 5.39956803455724E-14,
- 'in' => 3.93700787401575E-09,
- 'ft' => 3.28083989501312E-10,
- 'yd' => 1.09361329797891E-10,
- 'ang' => 1.0,
- 'Pica' => 2.83464566929116E-07,
- ),
- 'Pica' => array(
- 'm' => 3.52777777777800E-04,
- 'mi' => 2.19205948372629E-07,
- 'Nmi' => 1.90484761219114E-07,
- 'in' => 1.38888888888898E-02,
- 'ft' => 1.15740740740748E-03,
- 'yd' => 3.85802469009251E-04,
- 'ang' => 3.52777777777800E+06,
- 'Pica' => 1.0,
- ),
- ),
- 'Time' => array(
- 'yr' => array(
- 'yr' => 1.0,
- 'day' => 365.25,
- 'hr' => 8766.0,
- 'mn' => 525960.0,
- 'sec' => 31557600.0,
- ),
- 'day' => array(
- 'yr' => 2.73785078713210E-03,
- 'day' => 1.0,
- 'hr' => 24.0,
- 'mn' => 1440.0,
- 'sec' => 86400.0,
- ),
- 'hr' => array(
- 'yr' => 1.14077116130504E-04,
- 'day' => 4.16666666666667E-02,
- 'hr' => 1.0,
- 'mn' => 60.0,
- 'sec' => 3600.0,
- ),
- 'mn' => array(
- 'yr' => 1.90128526884174E-06,
- 'day' => 6.94444444444444E-04,
- 'hr' => 1.66666666666667E-02,
- 'mn' => 1.0,
- 'sec' => 60.0,
- ),
- 'sec' => array(
- 'yr' => 3.16880878140289E-08,
- 'day' => 1.15740740740741E-05,
- 'hr' => 2.77777777777778E-04,
- 'mn' => 1.66666666666667E-02,
- 'sec' => 1.0,
- ),
- ),
- 'Pressure' => array(
- 'Pa' => array(
- 'Pa' => 1.0,
- 'p' => 1.0,
- 'atm' => 9.86923299998193E-06,
- 'at' => 9.86923299998193E-06,
- 'mmHg' => 7.50061707998627E-03,
- ),
- 'p' => array(
- 'Pa' => 1.0,
- 'p' => 1.0,
- 'atm' => 9.86923299998193E-06,
- 'at' => 9.86923299998193E-06,
- 'mmHg' => 7.50061707998627E-03,
- ),
- 'atm' => array(
- 'Pa' => 1.01324996583000E+05,
- 'p' => 1.01324996583000E+05,
- 'atm' => 1.0,
- 'at' => 1.0,
- 'mmHg' => 760.0,
- ),
- 'at' => array(
- 'Pa' => 1.01324996583000E+05,
- 'p' => 1.01324996583000E+05,
- 'atm' => 1.0,
- 'at' => 1.0,
- 'mmHg' => 760.0,
- ),
- 'mmHg' => array(
- 'Pa' => 1.33322363925000E+02,
- 'p' => 1.33322363925000E+02,
- 'atm' => 1.31578947368421E-03,
- 'at' => 1.31578947368421E-03,
- 'mmHg' => 1.0,
- ),
- ),
- 'Force' => array(
- 'N' => array(
- 'N' => 1.0,
- 'dyn' => 1.0E+5,
- 'dy' => 1.0E+5,
- 'lbf' => 2.24808923655339E-01,
- ),
- 'dyn' => array(
- 'N' => 1.0E-5,
- 'dyn' => 1.0,
- 'dy' => 1.0,
- 'lbf' => 2.24808923655339E-06,
- ),
- 'dy' => array(
- 'N' => 1.0E-5,
- 'dyn' => 1.0,
- 'dy' => 1.0,
- 'lbf' => 2.24808923655339E-06,
- ),
- 'lbf' => array(
- 'N' => 4.448222,
- 'dyn' => 4.448222E+5,
- 'dy' => 4.448222E+5,
- 'lbf' => 1.0,
- ),
- ),
- 'Energy' => array(
- 'J' => array(
- 'J' => 1.0,
- 'e' => 9.99999519343231E+06,
- 'c' => 2.39006249473467E-01,
- 'cal' => 2.38846190642017E-01,
- 'eV' => 6.24145700000000E+18,
- 'ev' => 6.24145700000000E+18,
- 'HPh' => 3.72506430801000E-07,
- 'hh' => 3.72506430801000E-07,
- 'Wh' => 2.77777916238711E-04,
- 'wh' => 2.77777916238711E-04,
- 'flb' => 2.37304222192651E+01,
- 'BTU' => 9.47815067349015E-04,
- 'btu' => 9.47815067349015E-04,
- ),
- 'e' => array(
- 'J' => 1.00000048065700E-07,
- 'e' => 1.0,
- 'c' => 2.39006364353494E-08,
- 'cal' => 2.38846305445111E-08,
- 'eV' => 6.24146000000000E+11,
- 'ev' => 6.24146000000000E+11,
- 'HPh' => 3.72506609848824E-14,
- 'hh' => 3.72506609848824E-14,
- 'Wh' => 2.77778049754611E-11,
- 'wh' => 2.77778049754611E-11,
- 'flb' => 2.37304336254586E-06,
- 'BTU' => 9.47815522922962E-11,
- 'btu' => 9.47815522922962E-11,
- ),
- 'c' => array(
- 'J' => 4.18399101363672E+00,
- 'e' => 4.18398900257312E+07,
- 'c' => 1.0,
- 'cal' => 9.99330315287563E-01,
- 'eV' => 2.61142000000000E+19,
- 'ev' => 2.61142000000000E+19,
- 'HPh' => 1.55856355899327E-06,
- 'hh' => 1.55856355899327E-06,
- 'Wh' => 1.16222030532950E-03,
- 'wh' => 1.16222030532950E-03,
- 'flb' => 9.92878733152102E+01,
- 'BTU' => 3.96564972437776E-03,
- 'btu' => 3.96564972437776E-03,
- ),
- 'cal' => array(
- 'J' => 4.18679484613929E+00,
- 'e' => 4.18679283372801E+07,
- 'c' => 1.00067013349059E+00,
- 'cal' => 1.0,
- 'eV' => 2.61317000000000E+19,
- 'ev' => 2.61317000000000E+19,
- 'HPh' => 1.55960800463137E-06,
- 'hh' => 1.55960800463137E-06,
- 'Wh' => 1.16299914807955E-03,
- 'wh' => 1.16299914807955E-03,
- 'flb' => 9.93544094443283E+01,
- 'BTU' => 3.96830723907002E-03,
- 'btu' => 3.96830723907002E-03,
- ),
- 'eV' => array(
- 'J' => 1.60219000146921E-19,
- 'e' => 1.60218923136574E-12,
- 'c' => 3.82933423195043E-20,
- 'cal' => 3.82676978535648E-20,
- 'eV' => 1.0,
- 'ev' => 1.0,
- 'HPh' => 5.96826078912344E-26,
- 'hh' => 5.96826078912344E-26,
- 'Wh' => 4.45053000026614E-23,
- 'wh' => 4.45053000026614E-23,
- 'flb' => 3.80206452103492E-18,
- 'BTU' => 1.51857982414846E-22,
- 'btu' => 1.51857982414846E-22,
- ),
- 'ev' => array(
- 'J' => 1.60219000146921E-19,
- 'e' => 1.60218923136574E-12,
- 'c' => 3.82933423195043E-20,
- 'cal' => 3.82676978535648E-20,
- 'eV' => 1.0,
- 'ev' => 1.0,
- 'HPh' => 5.96826078912344E-26,
- 'hh' => 5.96826078912344E-26,
- 'Wh' => 4.45053000026614E-23,
- 'wh' => 4.45053000026614E-23,
- 'flb' => 3.80206452103492E-18,
- 'BTU' => 1.51857982414846E-22,
- 'btu' => 1.51857982414846E-22,
- ),
- 'HPh' => array(
- 'J' => 2.68451741316170E+06,
- 'e' => 2.68451612283024E+13,
- 'c' => 6.41616438565991E+05,
- 'cal' => 6.41186757845835E+05,
- 'eV' => 1.67553000000000E+25,
- 'ev' => 1.67553000000000E+25,
- 'HPh' => 1.0,
- 'hh' => 1.0,
- 'Wh' => 7.45699653134593E+02,
- 'wh' => 7.45699653134593E+02,
- 'flb' => 6.37047316692964E+07,
- 'BTU' => 2.54442605275546E+03,
- 'btu' => 2.54442605275546E+03,
- ),
- 'hh' => array(
- 'J' => 2.68451741316170E+06,
- 'e' => 2.68451612283024E+13,
- 'c' => 6.41616438565991E+05,
- 'cal' => 6.41186757845835E+05,
- 'eV' => 1.67553000000000E+25,
- 'ev' => 1.67553000000000E+25,
- 'HPh' => 1.0,
- 'hh' => 1.0,
- 'Wh' => 7.45699653134593E+02,
- 'wh' => 7.45699653134593E+02,
- 'flb' => 6.37047316692964E+07,
- 'BTU' => 2.54442605275546E+03,
- 'btu' => 2.54442605275546E+03,
- ),
- 'Wh' => array(
- 'J' => 3.59999820554720E+03,
- 'e' => 3.59999647518369E+10,
- 'c' => 8.60422069219046E+02,
- 'cal' => 8.59845857713046E+02,
- 'eV' => 2.24692340000000E+22,
- 'ev' => 2.24692340000000E+22,
- 'HPh' => 1.34102248243839E-03,
- 'hh' => 1.34102248243839E-03,
- 'Wh' => 1.0,
- 'wh' => 1.0,
- 'flb' => 8.54294774062316E+04,
- 'BTU' => 3.41213254164705E+00,
- 'btu' => 3.41213254164705E+00,
- ),
- 'wh' => array(
- 'J' => 3.59999820554720E+03,
- 'e' => 3.59999647518369E+10,
- 'c' => 8.60422069219046E+02,
- 'cal' => 8.59845857713046E+02,
- 'eV' => 2.24692340000000E+22,
- 'ev' => 2.24692340000000E+22,
- 'HPh' => 1.34102248243839E-03,
- 'hh' => 1.34102248243839E-03,
- 'Wh' => 1.0,
- 'wh' => 1.0,
- 'flb' => 8.54294774062316E+04,
- 'BTU' => 3.41213254164705E+00,
- 'btu' => 3.41213254164705E+00,
- ),
- 'flb' => array(
- 'J' => 4.21400003236424E-02,
- 'e' => 4.21399800687660E+05,
- 'c' => 1.00717234301644E-02,
- 'cal' => 1.00649785509554E-02,
- 'eV' => 2.63015000000000E+17,
- 'ev' => 2.63015000000000E+17,
- 'HPh' => 1.56974211145130E-08,
- 'hh' => 1.56974211145130E-08,
- 'Wh' => 1.17055614802000E-05,
- 'wh' => 1.17055614802000E-05,
- 'flb' => 1.0,
- 'BTU' => 3.99409272448406E-05,
- 'btu' => 3.99409272448406E-05,
- ),
- 'BTU' => array(
- 'J' => 1.05505813786749E+03,
- 'e' => 1.05505763074665E+10,
- 'c' => 2.52165488508168E+02,
- 'cal' => 2.51996617135510E+02,
- 'eV' => 6.58510000000000E+21,
- 'ev' => 6.58510000000000E+21,
- 'HPh' => 3.93015941224568E-04,
- 'hh' => 3.93015941224568E-04,
- 'Wh' => 2.93071851047526E-01,
- 'wh' => 2.93071851047526E-01,
- 'flb' => 2.50369750774671E+04,
- 'BTU' => 1.0,
- 'btu' => 1.0,
- ),
- 'btu' => array(
- 'J' => 1.05505813786749E+03,
- 'e' => 1.05505763074665E+10,
- 'c' => 2.52165488508168E+02,
- 'cal' => 2.51996617135510E+02,
- 'eV' => 6.58510000000000E+21,
- 'ev' => 6.58510000000000E+21,
- 'HPh' => 3.93015941224568E-04,
- 'hh' => 3.93015941224568E-04,
- 'Wh' => 2.93071851047526E-01,
- 'wh' => 2.93071851047526E-01,
- 'flb' => 2.50369750774671E+04,
- 'BTU' => 1.0,
- 'btu' => 1.0,
- ),
- ),
- 'Power' => array(
- 'HP' => array(
- 'HP' => 1.0,
- 'h' => 1.0,
- 'W' => 7.45701000000000E+02,
- 'w' => 7.45701000000000E+02,
- ),
- 'h' => array(
- 'HP' => 1.0,
- 'h' => 1.0,
- 'W' => 7.45701000000000E+02,
- 'w' => 7.45701000000000E+02,
- ),
- 'W' => array(
- 'HP' => 1.34102006031908E-03,
- 'h' => 1.34102006031908E-03,
- 'W' => 1.0,
- 'w' => 1.0,
- ),
- 'w' => array(
- 'HP' => 1.34102006031908E-03,
- 'h' => 1.34102006031908E-03,
- 'W' => 1.0,
- 'w' => 1.0,
- ),
- ),
- 'Magnetism' => array(
- 'T' => array(
- 'T' => 1.0,
- 'ga' => 10000.0,
- ),
- 'ga' => array(
- 'T' => 0.0001,
- 'ga' => 1.0,
- ),
- ),
- 'Liquid' => array(
- 'tsp' => array(
- 'tsp' => 1.0,
- 'tbs' => 3.33333333333333E-01,
- 'oz' => 1.66666666666667E-01,
- 'cup' => 2.08333333333333E-02,
- 'pt' => 1.04166666666667E-02,
- 'us_pt' => 1.04166666666667E-02,
- 'uk_pt' => 8.67558516821960E-03,
- 'qt' => 5.20833333333333E-03,
- 'gal' => 1.30208333333333E-03,
- 'l' => 4.92999408400710E-03,
- 'lt' => 4.92999408400710E-03,
- ),
- 'tbs' => array(
- 'tsp' => 3.00000000000000E+00,
- 'tbs' => 1.0,
- 'oz' => 5.00000000000000E-01,
- 'cup' => 6.25000000000000E-02,
- 'pt' => 3.12500000000000E-02,
- 'us_pt' => 3.12500000000000E-02,
- 'uk_pt' => 2.60267555046588E-02,
- 'qt' => 1.56250000000000E-02,
- 'gal' => 3.90625000000000E-03,
- 'l' => 1.47899822520213E-02,
- 'lt' => 1.47899822520213E-02,
- ),
- 'oz' => array(
- 'tsp' => 6.00000000000000E+00,
- 'tbs' => 2.00000000000000E+00,
- 'oz' => 1.0,
- 'cup' => 1.25000000000000E-01,
- 'pt' => 6.25000000000000E-02,
- 'us_pt' => 6.25000000000000E-02,
- 'uk_pt' => 5.20535110093176E-02,
- 'qt' => 3.12500000000000E-02,
- 'gal' => 7.81250000000000E-03,
- 'l' => 2.95799645040426E-02,
- 'lt' => 2.95799645040426E-02,
- ),
- 'cup' => array(
- 'tsp' => 4.80000000000000E+01,
- 'tbs' => 1.60000000000000E+01,
- 'oz' => 8.00000000000000E+00,
- 'cup' => 1.0,
- 'pt' => 5.00000000000000E-01,
- 'us_pt' => 5.00000000000000E-01,
- 'uk_pt' => 4.16428088074541E-01,
- 'qt' => 2.50000000000000E-01,
- 'gal' => 6.25000000000000E-02,
- 'l' => 2.36639716032341E-01,
- 'lt' => 2.36639716032341E-01,
- ),
- 'pt' => array(
- 'tsp' => 9.60000000000000E+01,
- 'tbs' => 3.20000000000000E+01,
- 'oz' => 1.60000000000000E+01,
- 'cup' => 2.00000000000000E+00,
- 'pt' => 1.0,
- 'us_pt' => 1.0,
- 'uk_pt' => 8.32856176149081E-01,
- 'qt' => 5.00000000000000E-01,
- 'gal' => 1.25000000000000E-01,
- 'l' => 4.73279432064682E-01,
- 'lt' => 4.73279432064682E-01,
- ),
- 'us_pt' => array(
- 'tsp' => 9.60000000000000E+01,
- 'tbs' => 3.20000000000000E+01,
- 'oz' => 1.60000000000000E+01,
- 'cup' => 2.00000000000000E+00,
- 'pt' => 1.0,
- 'us_pt' => 1.0,
- 'uk_pt' => 8.32856176149081E-01,
- 'qt' => 5.00000000000000E-01,
- 'gal' => 1.25000000000000E-01,
- 'l' => 4.73279432064682E-01,
- 'lt' => 4.73279432064682E-01,
- ),
- 'uk_pt' => array(
- 'tsp' => 1.15266000000000E+02,
- 'tbs' => 3.84220000000000E+01,
- 'oz' => 1.92110000000000E+01,
- 'cup' => 2.40137500000000E+00,
- 'pt' => 1.20068750000000E+00,
- 'us_pt' => 1.20068750000000E+00,
- 'uk_pt' => 1.0,
- 'qt' => 6.00343750000000E-01,
- 'gal' => 1.50085937500000E-01,
- 'l' => 5.68260698087162E-01,
- 'lt' => 5.68260698087162E-01,
- ),
- 'qt' => array(
- 'tsp' => 1.92000000000000E+02,
- 'tbs' => 6.40000000000000E+01,
- 'oz' => 3.20000000000000E+01,
- 'cup' => 4.00000000000000E+00,
- 'pt' => 2.00000000000000E+00,
- 'us_pt' => 2.00000000000000E+00,
- 'uk_pt' => 1.66571235229816E+00,
- 'qt' => 1.0,
- 'gal' => 2.50000000000000E-01,
- 'l' => 9.46558864129363E-01,
- 'lt' => 9.46558864129363E-01,
- ),
- 'gal' => array(
- 'tsp' => 7.68000000000000E+02,
- 'tbs' => 2.56000000000000E+02,
- 'oz' => 1.28000000000000E+02,
- 'cup' => 1.60000000000000E+01,
- 'pt' => 8.00000000000000E+00,
- 'us_pt' => 8.00000000000000E+00,
- 'uk_pt' => 6.66284940919265E+00,
- 'qt' => 4.00000000000000E+00,
- 'gal' => 1.0,
- 'l' => 3.78623545651745E+00,
- 'lt' => 3.78623545651745E+00,
- ),
- 'l' => array(
- 'tsp' => 2.02840000000000E+02,
- 'tbs' => 6.76133333333333E+01,
- 'oz' => 3.38066666666667E+01,
- 'cup' => 4.22583333333333E+00,
- 'pt' => 2.11291666666667E+00,
- 'us_pt' => 2.11291666666667E+00,
- 'uk_pt' => 1.75975569552166E+00,
- 'qt' => 1.05645833333333E+00,
- 'gal' => 2.64114583333333E-01,
- 'l' => 1.0,
- 'lt' => 1.0,
- ),
- 'lt' => array(
- 'tsp' => 2.02840000000000E+02,
- 'tbs' => 6.76133333333333E+01,
- 'oz' => 3.38066666666667E+01,
- 'cup' => 4.22583333333333E+00,
- 'pt' => 2.11291666666667E+00,
- 'us_pt' => 2.11291666666667E+00,
- 'uk_pt' => 1.75975569552166E+00,
- 'qt' => 1.05645833333333E+00,
- 'gal' => 2.64114583333333E-01,
- 'l' => 1.0,
- 'lt' => 1.0,
- ),
- ),
- );
-
-
- /**
- * parseComplex
- *
- * Parses a complex number into its real and imaginary parts, and an I or J suffix
- *
- * @param string $complexNumber The complex number
- * @return string[] Indexed on "real", "imaginary" and "suffix"
- */
- public static function parseComplex($complexNumber)
- {
- $workString = (string) $complexNumber;
-
- $realNumber = $imaginary = 0;
- // Extract the suffix, if there is one
- $suffix = substr($workString, -1);
- if (!is_numeric($suffix)) {
- $workString = substr($workString, 0, -1);
- } else {
- $suffix = '';
- }
-
- // Split the input into its Real and Imaginary components
- $leadingSign = 0;
- if (strlen($workString) > 0) {
- $leadingSign = (($workString{0} == '+') || ($workString{0} == '-')) ? 1 : 0;
- }
- $power = '';
- $realNumber = strtok($workString, '+-');
- if (strtoupper(substr($realNumber, -1)) == 'E') {
- $power = strtok('+-');
- ++$leadingSign;
- }
-
- $realNumber = substr($workString, 0, strlen($realNumber)+strlen($power)+$leadingSign);
-
- if ($suffix != '') {
- $imaginary = substr($workString, strlen($realNumber));
-
- if (($imaginary == '') && (($realNumber == '') || ($realNumber == '+') || ($realNumber == '-'))) {
- $imaginary = $realNumber.'1';
- $realNumber = '0';
- } elseif ($imaginary == '') {
- $imaginary = $realNumber;
- $realNumber = '0';
- } elseif (($imaginary == '+') || ($imaginary == '-')) {
- $imaginary .= '1';
- }
- }
-
- return array(
- 'real' => $realNumber,
- 'imaginary' => $imaginary,
- 'suffix' => $suffix
- );
- }
-
-
- /**
- * Cleans the leading characters in a complex number string
- *
- * @param string $complexNumber The complex number to clean
- * @return string The "cleaned" complex number
- */
- private static function cleanComplex($complexNumber)
- {
- if ($complexNumber{0} == '+') {
- $complexNumber = substr($complexNumber, 1);
- }
- if ($complexNumber{0} == '0') {
- $complexNumber = substr($complexNumber, 1);
- }
- if ($complexNumber{0} == '.') {
- $complexNumber = '0'.$complexNumber;
- }
- if ($complexNumber{0} == '+') {
- $complexNumber = substr($complexNumber, 1);
- }
- return $complexNumber;
- }
-
- /**
- * Formats a number base string value with leading zeroes
- *
- * @param string $xVal The "number" to pad
- * @param integer $places The length that we want to pad this value
- * @return string The padded "number"
- */
- private static function nbrConversionFormat($xVal, $places)
- {
- if (!is_null($places)) {
- if (strlen($xVal) <= $places) {
- return substr(str_pad($xVal, $places, '0', STR_PAD_LEFT), -10);
- } else {
- return PHPExcel_Calculation_Functions::NaN();
- }
- }
-
- return substr($xVal, -10);
- }
-
- /**
- * BESSELI
- *
- * Returns the modified Bessel function In(x), which is equivalent to the Bessel function evaluated
- * for purely imaginary arguments
- *
- * Excel Function:
- * BESSELI(x,ord)
- *
- * @access public
- * @category Engineering Functions
- * @param float $x The value at which to evaluate the function.
- * If x is nonnumeric, BESSELI returns the #VALUE! error value.
- * @param integer $ord The order of the Bessel function.
- * If ord is not an integer, it is truncated.
- * If $ord is nonnumeric, BESSELI returns the #VALUE! error value.
- * If $ord < 0, BESSELI returns the #NUM! error value.
- * @return float
- *
- */
- public static function BESSELI($x, $ord)
- {
- $x = (is_null($x)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($x);
- $ord = (is_null($ord)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($ord);
-
- if ((is_numeric($x)) && (is_numeric($ord))) {
- $ord = floor($ord);
- if ($ord < 0) {
- return PHPExcel_Calculation_Functions::NaN();
- }
-
- if (abs($x) <= 30) {
- $fResult = $fTerm = pow($x / 2, $ord) / PHPExcel_Calculation_MathTrig::FACT($ord);
- $ordK = 1;
- $fSqrX = ($x * $x) / 4;
- do {
- $fTerm *= $fSqrX;
- $fTerm /= ($ordK * ($ordK + $ord));
- $fResult += $fTerm;
- } while ((abs($fTerm) > 1e-12) && (++$ordK < 100));
- } else {
- $f_2_PI = 2 * M_PI;
-
- $fXAbs = abs($x);
- $fResult = exp($fXAbs) / sqrt($f_2_PI * $fXAbs);
- if (($ord & 1) && ($x < 0)) {
- $fResult = -$fResult;
- }
- }
- return (is_nan($fResult)) ? PHPExcel_Calculation_Functions::NaN() : $fResult;
- }
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
-
- /**
- * BESSELJ
- *
- * Returns the Bessel function
- *
- * Excel Function:
- * BESSELJ(x,ord)
- *
- * @access public
- * @category Engineering Functions
- * @param float $x The value at which to evaluate the function.
- * If x is nonnumeric, BESSELJ returns the #VALUE! error value.
- * @param integer $ord The order of the Bessel function. If n is not an integer, it is truncated.
- * If $ord is nonnumeric, BESSELJ returns the #VALUE! error value.
- * If $ord < 0, BESSELJ returns the #NUM! error value.
- * @return float
- *
- */
- public static function BESSELJ($x, $ord)
- {
- $x = (is_null($x)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($x);
- $ord = (is_null($ord)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($ord);
-
- if ((is_numeric($x)) && (is_numeric($ord))) {
- $ord = floor($ord);
- if ($ord < 0) {
- return PHPExcel_Calculation_Functions::NaN();
- }
-
- $fResult = 0;
- if (abs($x) <= 30) {
- $fResult = $fTerm = pow($x / 2, $ord) / PHPExcel_Calculation_MathTrig::FACT($ord);
- $ordK = 1;
- $fSqrX = ($x * $x) / -4;
- do {
- $fTerm *= $fSqrX;
- $fTerm /= ($ordK * ($ordK + $ord));
- $fResult += $fTerm;
- } while ((abs($fTerm) > 1e-12) && (++$ordK < 100));
- } else {
- $f_PI_DIV_2 = M_PI / 2;
- $f_PI_DIV_4 = M_PI / 4;
-
- $fXAbs = abs($x);
- $fResult = sqrt(M_2DIVPI / $fXAbs) * cos($fXAbs - $ord * $f_PI_DIV_2 - $f_PI_DIV_4);
- if (($ord & 1) && ($x < 0)) {
- $fResult = -$fResult;
- }
- }
- return (is_nan($fResult)) ? PHPExcel_Calculation_Functions::NaN() : $fResult;
- }
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
-
- private static function besselK0($fNum)
- {
- if ($fNum <= 2) {
- $fNum2 = $fNum * 0.5;
- $y = ($fNum2 * $fNum2);
- $fRet = -log($fNum2) * self::BESSELI($fNum, 0) +
- (-0.57721566 + $y * (0.42278420 + $y * (0.23069756 + $y * (0.3488590e-1 + $y * (0.262698e-2 + $y *
- (0.10750e-3 + $y * 0.74e-5))))));
- } else {
- $y = 2 / $fNum;
- $fRet = exp(-$fNum) / sqrt($fNum) *
- (1.25331414 + $y * (-0.7832358e-1 + $y * (0.2189568e-1 + $y * (-0.1062446e-1 + $y *
- (0.587872e-2 + $y * (-0.251540e-2 + $y * 0.53208e-3))))));
- }
- return $fRet;
- }
-
-
- private static function besselK1($fNum)
- {
- if ($fNum <= 2) {
- $fNum2 = $fNum * 0.5;
- $y = ($fNum2 * $fNum2);
- $fRet = log($fNum2) * self::BESSELI($fNum, 1) +
- (1 + $y * (0.15443144 + $y * (-0.67278579 + $y * (-0.18156897 + $y * (-0.1919402e-1 + $y *
- (-0.110404e-2 + $y * (-0.4686e-4))))))) / $fNum;
- } else {
- $y = 2 / $fNum;
- $fRet = exp(-$fNum) / sqrt($fNum) *
- (1.25331414 + $y * (0.23498619 + $y * (-0.3655620e-1 + $y * (0.1504268e-1 + $y * (-0.780353e-2 + $y *
- (0.325614e-2 + $y * (-0.68245e-3)))))));
- }
- return $fRet;
- }
-
-
- /**
- * BESSELK
- *
- * Returns the modified Bessel function Kn(x), which is equivalent to the Bessel functions evaluated
- * for purely imaginary arguments.
- *
- * Excel Function:
- * BESSELK(x,ord)
- *
- * @access public
- * @category Engineering Functions
- * @param float $x The value at which to evaluate the function.
- * If x is nonnumeric, BESSELK returns the #VALUE! error value.
- * @param integer $ord The order of the Bessel function. If n is not an integer, it is truncated.
- * If $ord is nonnumeric, BESSELK returns the #VALUE! error value.
- * If $ord < 0, BESSELK returns the #NUM! error value.
- * @return float
- *
- */
- public static function BESSELK($x, $ord)
- {
- $x = (is_null($x)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($x);
- $ord = (is_null($ord)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($ord);
-
- if ((is_numeric($x)) && (is_numeric($ord))) {
- if (($ord < 0) || ($x == 0.0)) {
- return PHPExcel_Calculation_Functions::NaN();
- }
-
- switch (floor($ord)) {
- case 0:
- return self::besselK0($x);
- case 1:
- return self::besselK1($x);
- default:
- $fTox = 2 / $x;
- $fBkm = self::besselK0($x);
- $fBk = self::besselK1($x);
- for ($n = 1; $n < $ord; ++$n) {
- $fBkp = $fBkm + $n * $fTox * $fBk;
- $fBkm = $fBk;
- $fBk = $fBkp;
- }
- }
- return (is_nan($fBk)) ? PHPExcel_Calculation_Functions::NaN() : $fBk;
- }
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
-
- private static function besselY0($fNum)
- {
- if ($fNum < 8.0) {
- $y = ($fNum * $fNum);
- $f1 = -2957821389.0 + $y * (7062834065.0 + $y * (-512359803.6 + $y * (10879881.29 + $y * (-86327.92757 + $y * 228.4622733))));
- $f2 = 40076544269.0 + $y * (745249964.8 + $y * (7189466.438 + $y * (47447.26470 + $y * (226.1030244 + $y))));
- $fRet = $f1 / $f2 + 0.636619772 * self::BESSELJ($fNum, 0) * log($fNum);
- } else {
- $z = 8.0 / $fNum;
- $y = ($z * $z);
- $xx = $fNum - 0.785398164;
- $f1 = 1 + $y * (-0.1098628627e-2 + $y * (0.2734510407e-4 + $y * (-0.2073370639e-5 + $y * 0.2093887211e-6)));
- $f2 = -0.1562499995e-1 + $y * (0.1430488765e-3 + $y * (-0.6911147651e-5 + $y * (0.7621095161e-6 + $y * (-0.934945152e-7))));
- $fRet = sqrt(0.636619772 / $fNum) * (sin($xx) * $f1 + $z * cos($xx) * $f2);
- }
- return $fRet;
- }
-
-
- private static function besselY1($fNum)
- {
- if ($fNum < 8.0) {
- $y = ($fNum * $fNum);
- $f1 = $fNum * (-0.4900604943e13 + $y * (0.1275274390e13 + $y * (-0.5153438139e11 + $y * (0.7349264551e9 + $y *
- (-0.4237922726e7 + $y * 0.8511937935e4)))));
- $f2 = 0.2499580570e14 + $y * (0.4244419664e12 + $y * (0.3733650367e10 + $y * (0.2245904002e8 + $y *
- (0.1020426050e6 + $y * (0.3549632885e3 + $y)))));
- $fRet = $f1 / $f2 + 0.636619772 * ( self::BESSELJ($fNum, 1) * log($fNum) - 1 / $fNum);
- } else {
- $fRet = sqrt(0.636619772 / $fNum) * sin($fNum - 2.356194491);
- }
- return $fRet;
- }
-
-
- /**
- * BESSELY
- *
- * Returns the Bessel function, which is also called the Weber function or the Neumann function.
- *
- * Excel Function:
- * BESSELY(x,ord)
- *
- * @access public
- * @category Engineering Functions
- * @param float $x The value at which to evaluate the function.
- * If x is nonnumeric, BESSELK returns the #VALUE! error value.
- * @param integer $ord The order of the Bessel function. If n is not an integer, it is truncated.
- * If $ord is nonnumeric, BESSELK returns the #VALUE! error value.
- * If $ord < 0, BESSELK returns the #NUM! error value.
- *
- * @return float
- */
- public static function BESSELY($x, $ord)
- {
- $x = (is_null($x)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($x);
- $ord = (is_null($ord)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($ord);
-
- if ((is_numeric($x)) && (is_numeric($ord))) {
- if (($ord < 0) || ($x == 0.0)) {
- return PHPExcel_Calculation_Functions::NaN();
- }
-
- switch (floor($ord)) {
- case 0:
- return self::besselY0($x);
- case 1:
- return self::besselY1($x);
- default:
- $fTox = 2 / $x;
- $fBym = self::besselY0($x);
- $fBy = self::besselY1($x);
- for ($n = 1; $n < $ord; ++$n) {
- $fByp = $n * $fTox * $fBy - $fBym;
- $fBym = $fBy;
- $fBy = $fByp;
- }
- }
- return (is_nan($fBy)) ? PHPExcel_Calculation_Functions::NaN() : $fBy;
- }
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
-
- /**
- * BINTODEC
- *
- * Return a binary value as decimal.
- *
- * Excel Function:
- * BIN2DEC(x)
- *
- * @access public
- * @category Engineering Functions
- * @param string $x The binary number (as a string) that you want to convert. The number
- * cannot contain more than 10 characters (10 bits). The most significant
- * bit of number is the sign bit. The remaining 9 bits are magnitude bits.
- * Negative numbers are represented using two's-complement notation.
- * If number is not a valid binary number, or if number contains more than
- * 10 characters (10 bits), BIN2DEC returns the #NUM! error value.
- * @return string
- */
- public static function BINTODEC($x)
- {
- $x = PHPExcel_Calculation_Functions::flattenSingleValue($x);
-
- if (is_bool($x)) {
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
- $x = (int) $x;
- } else {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- }
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
- $x = floor($x);
- }
- $x = (string) $x;
- if (strlen($x) > preg_match_all('/[01]/', $x, $out)) {
- return PHPExcel_Calculation_Functions::NaN();
- }
- if (strlen($x) > 10) {
- return PHPExcel_Calculation_Functions::NaN();
- } elseif (strlen($x) == 10) {
- // Two's Complement
- $x = substr($x, -9);
- return '-'.(512-bindec($x));
- }
- return bindec($x);
- }
-
-
- /**
- * BINTOHEX
- *
- * Return a binary value as hex.
- *
- * Excel Function:
- * BIN2HEX(x[,places])
- *
- * @access public
- * @category Engineering Functions
- * @param string $x The binary number (as a string) that you want to convert. The number
- * cannot contain more than 10 characters (10 bits). The most significant
- * bit of number is the sign bit. The remaining 9 bits are magnitude bits.
- * Negative numbers are represented using two's-complement notation.
- * If number is not a valid binary number, or if number contains more than
- * 10 characters (10 bits), BIN2HEX returns the #NUM! error value.
- * @param integer $places The number of characters to use. If places is omitted, BIN2HEX uses the
- * minimum number of characters necessary. Places is useful for padding the
- * return value with leading 0s (zeros).
- * If places is not an integer, it is truncated.
- * If places is nonnumeric, BIN2HEX returns the #VALUE! error value.
- * If places is negative, BIN2HEX returns the #NUM! error value.
- * @return string
- */
- public static function BINTOHEX($x, $places = null)
- {
- $x = PHPExcel_Calculation_Functions::flattenSingleValue($x);
- $places = PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
- if (is_bool($x)) {
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
- $x = (int) $x;
- } else {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- }
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
- $x = floor($x);
- }
- $x = (string) $x;
- if (strlen($x) > preg_match_all('/[01]/', $x, $out)) {
- return PHPExcel_Calculation_Functions::NaN();
- }
- if (strlen($x) > 10) {
- return PHPExcel_Calculation_Functions::NaN();
- } elseif (strlen($x) == 10) {
- // Two's Complement
- return str_repeat('F', 8).substr(strtoupper(dechex(bindec(substr($x, -9)))), -2);
- }
- $hexVal = (string) strtoupper(dechex(bindec($x)));
-
- return self::nbrConversionFormat($hexVal, $places);
- }
-
-
- /**
- * BINTOOCT
- *
- * Return a binary value as octal.
- *
- * Excel Function:
- * BIN2OCT(x[,places])
- *
- * @access public
- * @category Engineering Functions
- * @param string $x The binary number (as a string) that you want to convert. The number
- * cannot contain more than 10 characters (10 bits). The most significant
- * bit of number is the sign bit. The remaining 9 bits are magnitude bits.
- * Negative numbers are represented using two's-complement notation.
- * If number is not a valid binary number, or if number contains more than
- * 10 characters (10 bits), BIN2OCT returns the #NUM! error value.
- * @param integer $places The number of characters to use. If places is omitted, BIN2OCT uses the
- * minimum number of characters necessary. Places is useful for padding the
- * return value with leading 0s (zeros).
- * If places is not an integer, it is truncated.
- * If places is nonnumeric, BIN2OCT returns the #VALUE! error value.
- * If places is negative, BIN2OCT returns the #NUM! error value.
- * @return string
- */
- public static function BINTOOCT($x, $places = null)
- {
- $x = PHPExcel_Calculation_Functions::flattenSingleValue($x);
- $places = PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
- if (is_bool($x)) {
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
- $x = (int) $x;
- } else {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- }
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
- $x = floor($x);
- }
- $x = (string) $x;
- if (strlen($x) > preg_match_all('/[01]/', $x, $out)) {
- return PHPExcel_Calculation_Functions::NaN();
- }
- if (strlen($x) > 10) {
- return PHPExcel_Calculation_Functions::NaN();
- } elseif (strlen($x) == 10) {
- // Two's Complement
- return str_repeat('7', 7).substr(strtoupper(decoct(bindec(substr($x, -9)))), -3);
- }
- $octVal = (string) decoct(bindec($x));
-
- return self::nbrConversionFormat($octVal, $places);
- }
-
-
- /**
- * DECTOBIN
- *
- * Return a decimal value as binary.
- *
- * Excel Function:
- * DEC2BIN(x[,places])
- *
- * @access public
- * @category Engineering Functions
- * @param string $x The decimal integer you want to convert. If number is negative,
- * valid place values are ignored and DEC2BIN returns a 10-character
- * (10-bit) binary number in which the most significant bit is the sign
- * bit. The remaining 9 bits are magnitude bits. Negative numbers are
- * represented using two's-complement notation.
- * If number < -512 or if number > 511, DEC2BIN returns the #NUM! error
- * value.
- * If number is nonnumeric, DEC2BIN returns the #VALUE! error value.
- * If DEC2BIN requires more than places characters, it returns the #NUM!
- * error value.
- * @param integer $places The number of characters to use. If places is omitted, DEC2BIN uses
- * the minimum number of characters necessary. Places is useful for
- * padding the return value with leading 0s (zeros).
- * If places is not an integer, it is truncated.
- * If places is nonnumeric, DEC2BIN returns the #VALUE! error value.
- * If places is zero or negative, DEC2BIN returns the #NUM! error value.
- * @return string
- */
- public static function DECTOBIN($x, $places = null)
- {
- $x = PHPExcel_Calculation_Functions::flattenSingleValue($x);
- $places = PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
- if (is_bool($x)) {
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
- $x = (int) $x;
- } else {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- }
- $x = (string) $x;
- if (strlen($x) > preg_match_all('/[-0123456789.]/', $x, $out)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- $x = (string) floor($x);
- $r = decbin($x);
- if (strlen($r) == 32) {
- // Two's Complement
- $r = substr($r, -10);
- } elseif (strlen($r) > 11) {
- return PHPExcel_Calculation_Functions::NaN();
- }
-
- return self::nbrConversionFormat($r, $places);
- }
-
-
- /**
- * DECTOHEX
- *
- * Return a decimal value as hex.
- *
- * Excel Function:
- * DEC2HEX(x[,places])
- *
- * @access public
- * @category Engineering Functions
- * @param string $x The decimal integer you want to convert. If number is negative,
- * places is ignored and DEC2HEX returns a 10-character (40-bit)
- * hexadecimal number in which the most significant bit is the sign
- * bit. The remaining 39 bits are magnitude bits. Negative numbers
- * are represented using two's-complement notation.
- * If number < -549,755,813,888 or if number > 549,755,813,887,
- * DEC2HEX returns the #NUM! error value.
- * If number is nonnumeric, DEC2HEX returns the #VALUE! error value.
- * If DEC2HEX requires more than places characters, it returns the
- * #NUM! error value.
- * @param integer $places The number of characters to use. If places is omitted, DEC2HEX uses
- * the minimum number of characters necessary. Places is useful for
- * padding the return value with leading 0s (zeros).
- * If places is not an integer, it is truncated.
- * If places is nonnumeric, DEC2HEX returns the #VALUE! error value.
- * If places is zero or negative, DEC2HEX returns the #NUM! error value.
- * @return string
- */
- public static function DECTOHEX($x, $places = null)
- {
- $x = PHPExcel_Calculation_Functions::flattenSingleValue($x);
- $places = PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
- if (is_bool($x)) {
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
- $x = (int) $x;
- } else {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- }
- $x = (string) $x;
- if (strlen($x) > preg_match_all('/[-0123456789.]/', $x, $out)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- $x = (string) floor($x);
- $r = strtoupper(dechex($x));
- if (strlen($r) == 8) {
- // Two's Complement
- $r = 'FF'.$r;
- }
-
- return self::nbrConversionFormat($r, $places);
- }
-
-
- /**
- * DECTOOCT
- *
- * Return an decimal value as octal.
- *
- * Excel Function:
- * DEC2OCT(x[,places])
- *
- * @access public
- * @category Engineering Functions
- * @param string $x The decimal integer you want to convert. If number is negative,
- * places is ignored and DEC2OCT returns a 10-character (30-bit)
- * octal number in which the most significant bit is the sign bit.
- * The remaining 29 bits are magnitude bits. Negative numbers are
- * represented using two's-complement notation.
- * If number < -536,870,912 or if number > 536,870,911, DEC2OCT
- * returns the #NUM! error value.
- * If number is nonnumeric, DEC2OCT returns the #VALUE! error value.
- * If DEC2OCT requires more than places characters, it returns the
- * #NUM! error value.
- * @param integer $places The number of characters to use. If places is omitted, DEC2OCT uses
- * the minimum number of characters necessary. Places is useful for
- * padding the return value with leading 0s (zeros).
- * If places is not an integer, it is truncated.
- * If places is nonnumeric, DEC2OCT returns the #VALUE! error value.
- * If places is zero or negative, DEC2OCT returns the #NUM! error value.
- * @return string
- */
- public static function DECTOOCT($x, $places = null)
- {
- $x = PHPExcel_Calculation_Functions::flattenSingleValue($x);
- $places = PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
- if (is_bool($x)) {
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
- $x = (int) $x;
- } else {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- }
- $x = (string) $x;
- if (strlen($x) > preg_match_all('/[-0123456789.]/', $x, $out)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- $x = (string) floor($x);
- $r = decoct($x);
- if (strlen($r) == 11) {
- // Two's Complement
- $r = substr($r, -10);
- }
-
- return self::nbrConversionFormat($r, $places);
- }
-
-
- /**
- * HEXTOBIN
- *
- * Return a hex value as binary.
- *
- * Excel Function:
- * HEX2BIN(x[,places])
- *
- * @access public
- * @category Engineering Functions
- * @param string $x the hexadecimal number you want to convert. Number cannot
- * contain more than 10 characters. The most significant bit of
- * number is the sign bit (40th bit from the right). The remaining
- * 9 bits are magnitude bits. Negative numbers are represented
- * using two's-complement notation.
- * If number is negative, HEX2BIN ignores places and returns a
- * 10-character binary number.
- * If number is negative, it cannot be less than FFFFFFFE00, and
- * if number is positive, it cannot be greater than 1FF.
- * If number is not a valid hexadecimal number, HEX2BIN returns
- * the #NUM! error value.
- * If HEX2BIN requires more than places characters, it returns
- * the #NUM! error value.
- * @param integer $places The number of characters to use. If places is omitted,
- * HEX2BIN uses the minimum number of characters necessary. Places
- * is useful for padding the return value with leading 0s (zeros).
- * If places is not an integer, it is truncated.
- * If places is nonnumeric, HEX2BIN returns the #VALUE! error value.
- * If places is negative, HEX2BIN returns the #NUM! error value.
- * @return string
- */
- public static function HEXTOBIN($x, $places = null)
- {
- $x = PHPExcel_Calculation_Functions::flattenSingleValue($x);
- $places = PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
- if (is_bool($x)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- $x = (string) $x;
- if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/', strtoupper($x), $out)) {
- return PHPExcel_Calculation_Functions::NaN();
- }
- $binVal = decbin(hexdec($x));
-
- return substr(self::nbrConversionFormat($binVal, $places), -10);
- }
-
-
- /**
- * HEXTODEC
- *
- * Return a hex value as decimal.
- *
- * Excel Function:
- * HEX2DEC(x)
- *
- * @access public
- * @category Engineering Functions
- * @param string $x The hexadecimal number you want to convert. This number cannot
- * contain more than 10 characters (40 bits). The most significant
- * bit of number is the sign bit. The remaining 39 bits are magnitude
- * bits. Negative numbers are represented using two's-complement
- * notation.
- * If number is not a valid hexadecimal number, HEX2DEC returns the
- * #NUM! error value.
- * @return string
- */
- public static function HEXTODEC($x)
- {
- $x = PHPExcel_Calculation_Functions::flattenSingleValue($x);
-
- if (is_bool($x)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- $x = (string) $x;
- if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/', strtoupper($x), $out)) {
- return PHPExcel_Calculation_Functions::NaN();
- }
- return hexdec($x);
- }
-
-
- /**
- * HEXTOOCT
- *
- * Return a hex value as octal.
- *
- * Excel Function:
- * HEX2OCT(x[,places])
- *
- * @access public
- * @category Engineering Functions
- * @param string $x The hexadecimal number you want to convert. Number cannot
- * contain more than 10 characters. The most significant bit of
- * number is the sign bit. The remaining 39 bits are magnitude
- * bits. Negative numbers are represented using two's-complement
- * notation.
- * If number is negative, HEX2OCT ignores places and returns a
- * 10-character octal number.
- * If number is negative, it cannot be less than FFE0000000, and
- * if number is positive, it cannot be greater than 1FFFFFFF.
- * If number is not a valid hexadecimal number, HEX2OCT returns
- * the #NUM! error value.
- * If HEX2OCT requires more than places characters, it returns
- * the #NUM! error value.
- * @param integer $places The number of characters to use. If places is omitted, HEX2OCT
- * uses the minimum number of characters necessary. Places is
- * useful for padding the return value with leading 0s (zeros).
- * If places is not an integer, it is truncated.
- * If places is nonnumeric, HEX2OCT returns the #VALUE! error
- * value.
- * If places is negative, HEX2OCT returns the #NUM! error value.
- * @return string
- */
- public static function HEXTOOCT($x, $places = null)
- {
- $x = PHPExcel_Calculation_Functions::flattenSingleValue($x);
- $places = PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
- if (is_bool($x)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- $x = (string) $x;
- if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/', strtoupper($x), $out)) {
- return PHPExcel_Calculation_Functions::NaN();
- }
- $octVal = decoct(hexdec($x));
-
- return self::nbrConversionFormat($octVal, $places);
- } // function HEXTOOCT()
-
-
- /**
- * OCTTOBIN
- *
- * Return an octal value as binary.
- *
- * Excel Function:
- * OCT2BIN(x[,places])
- *
- * @access public
- * @category Engineering Functions
- * @param string $x The octal number you want to convert. Number may not
- * contain more than 10 characters. The most significant
- * bit of number is the sign bit. The remaining 29 bits
- * are magnitude bits. Negative numbers are represented
- * using two's-complement notation.
- * If number is negative, OCT2BIN ignores places and returns
- * a 10-character binary number.
- * If number is negative, it cannot be less than 7777777000,
- * and if number is positive, it cannot be greater than 777.
- * If number is not a valid octal number, OCT2BIN returns
- * the #NUM! error value.
- * If OCT2BIN requires more than places characters, it
- * returns the #NUM! error value.
- * @param integer $places The number of characters to use. If places is omitted,
- * OCT2BIN uses the minimum number of characters necessary.
- * Places is useful for padding the return value with
- * leading 0s (zeros).
- * If places is not an integer, it is truncated.
- * If places is nonnumeric, OCT2BIN returns the #VALUE!
- * error value.
- * If places is negative, OCT2BIN returns the #NUM! error
- * value.
- * @return string
- */
- public static function OCTTOBIN($x, $places = null)
- {
- $x = PHPExcel_Calculation_Functions::flattenSingleValue($x);
- $places = PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
- if (is_bool($x)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- $x = (string) $x;
- if (preg_match_all('/[01234567]/', $x, $out) != strlen($x)) {
- return PHPExcel_Calculation_Functions::NaN();
- }
- $r = decbin(octdec($x));
-
- return self::nbrConversionFormat($r, $places);
- }
-
-
- /**
- * OCTTODEC
- *
- * Return an octal value as decimal.
- *
- * Excel Function:
- * OCT2DEC(x)
- *
- * @access public
- * @category Engineering Functions
- * @param string $x The octal number you want to convert. Number may not contain
- * more than 10 octal characters (30 bits). The most significant
- * bit of number is the sign bit. The remaining 29 bits are
- * magnitude bits. Negative numbers are represented using
- * two's-complement notation.
- * If number is not a valid octal number, OCT2DEC returns the
- * #NUM! error value.
- * @return string
- */
- public static function OCTTODEC($x)
- {
- $x = PHPExcel_Calculation_Functions::flattenSingleValue($x);
-
- if (is_bool($x)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- $x = (string) $x;
- if (preg_match_all('/[01234567]/', $x, $out) != strlen($x)) {
- return PHPExcel_Calculation_Functions::NaN();
- }
- return octdec($x);
- }
-
-
- /**
- * OCTTOHEX
- *
- * Return an octal value as hex.
- *
- * Excel Function:
- * OCT2HEX(x[,places])
- *
- * @access public
- * @category Engineering Functions
- * @param string $x The octal number you want to convert. Number may not contain
- * more than 10 octal characters (30 bits). The most significant
- * bit of number is the sign bit. The remaining 29 bits are
- * magnitude bits. Negative numbers are represented using
- * two's-complement notation.
- * If number is negative, OCT2HEX ignores places and returns a
- * 10-character hexadecimal number.
- * If number is not a valid octal number, OCT2HEX returns the
- * #NUM! error value.
- * If OCT2HEX requires more than places characters, it returns
- * the #NUM! error value.
- * @param integer $places The number of characters to use. If places is omitted, OCT2HEX
- * uses the minimum number of characters necessary. Places is useful
- * for padding the return value with leading 0s (zeros).
- * If places is not an integer, it is truncated.
- * If places is nonnumeric, OCT2HEX returns the #VALUE! error value.
- * If places is negative, OCT2HEX returns the #NUM! error value.
- * @return string
- */
- public static function OCTTOHEX($x, $places = null)
- {
- $x = PHPExcel_Calculation_Functions::flattenSingleValue($x);
- $places = PHPExcel_Calculation_Functions::flattenSingleValue($places);
-
- if (is_bool($x)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- $x = (string) $x;
- if (preg_match_all('/[01234567]/', $x, $out) != strlen($x)) {
- return PHPExcel_Calculation_Functions::NaN();
- }
- $hexVal = strtoupper(dechex(octdec($x)));
-
- return self::nbrConversionFormat($hexVal, $places);
- }
-
-
- /**
- * COMPLEX
- *
- * Converts real and imaginary coefficients into a complex number of the form x + yi or x + yj.
- *
- * Excel Function:
- * COMPLEX(realNumber,imaginary[,places])
- *
- * @access public
- * @category Engineering Functions
- * @param float $realNumber The real coefficient of the complex number.
- * @param float $imaginary The imaginary coefficient of the complex number.
- * @param string $suffix The suffix for the imaginary component of the complex number.
- * If omitted, the suffix is assumed to be "i".
- * @return string
- */
- public static function COMPLEX($realNumber = 0.0, $imaginary = 0.0, $suffix = 'i')
- {
- $realNumber = (is_null($realNumber)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($realNumber);
- $imaginary = (is_null($imaginary)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($imaginary);
- $suffix = (is_null($suffix)) ? 'i' : PHPExcel_Calculation_Functions::flattenSingleValue($suffix);
-
- if (((is_numeric($realNumber)) && (is_numeric($imaginary))) &&
- (($suffix == 'i') || ($suffix == 'j') || ($suffix == ''))) {
- $realNumber = (float) $realNumber;
- $imaginary = (float) $imaginary;
-
- if ($suffix == '') {
- $suffix = 'i';
- }
- if ($realNumber == 0.0) {
- if ($imaginary == 0.0) {
- return (string) '0';
- } elseif ($imaginary == 1.0) {
- return (string) $suffix;
- } elseif ($imaginary == -1.0) {
- return (string) '-'.$suffix;
- }
- return (string) $imaginary.$suffix;
- } elseif ($imaginary == 0.0) {
- return (string) $realNumber;
- } elseif ($imaginary == 1.0) {
- return (string) $realNumber.'+'.$suffix;
- } elseif ($imaginary == -1.0) {
- return (string) $realNumber.'-'.$suffix;
- }
- if ($imaginary > 0) {
- $imaginary = (string) '+'.$imaginary;
- }
- return (string) $realNumber.$imaginary.$suffix;
- }
-
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
-
- /**
- * IMAGINARY
- *
- * Returns the imaginary coefficient of a complex number in x + yi or x + yj text format.
- *
- * Excel Function:
- * IMAGINARY(complexNumber)
- *
- * @access public
- * @category Engineering Functions
- * @param string $complexNumber The complex number for which you want the imaginary
- * coefficient.
- * @return float
- */
- public static function IMAGINARY($complexNumber)
- {
- $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
- $parsedComplex = self::parseComplex($complexNumber);
- return $parsedComplex['imaginary'];
- }
-
-
- /**
- * IMREAL
- *
- * Returns the real coefficient of a complex number in x + yi or x + yj text format.
- *
- * Excel Function:
- * IMREAL(complexNumber)
- *
- * @access public
- * @category Engineering Functions
- * @param string $complexNumber The complex number for which you want the real coefficient.
- * @return float
- */
- public static function IMREAL($complexNumber)
- {
- $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
- $parsedComplex = self::parseComplex($complexNumber);
- return $parsedComplex['real'];
- }
-
-
- /**
- * IMABS
- *
- * Returns the absolute value (modulus) of a complex number in x + yi or x + yj text format.
- *
- * Excel Function:
- * IMABS(complexNumber)
- *
- * @param string $complexNumber The complex number for which you want the absolute value.
- * @return float
- */
- public static function IMABS($complexNumber)
- {
- $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
- $parsedComplex = self::parseComplex($complexNumber);
-
- return sqrt(
- ($parsedComplex['real'] * $parsedComplex['real']) +
- ($parsedComplex['imaginary'] * $parsedComplex['imaginary'])
- );
- }
-
-
- /**
- * IMARGUMENT
- *
- * Returns the argument theta of a complex number, i.e. the angle in radians from the real
- * axis to the representation of the number in polar coordinates.
- *
- * Excel Function:
- * IMARGUMENT(complexNumber)
- *
- * @param string $complexNumber The complex number for which you want the argument theta.
- * @return float
- */
- public static function IMARGUMENT($complexNumber)
- {
- $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
- $parsedComplex = self::parseComplex($complexNumber);
-
- if ($parsedComplex['real'] == 0.0) {
- if ($parsedComplex['imaginary'] == 0.0) {
- return 0.0;
- } elseif ($parsedComplex['imaginary'] < 0.0) {
- return M_PI / -2;
- } else {
- return M_PI / 2;
- }
- } elseif ($parsedComplex['real'] > 0.0) {
- return atan($parsedComplex['imaginary'] / $parsedComplex['real']);
- } elseif ($parsedComplex['imaginary'] < 0.0) {
- return 0 - (M_PI - atan(abs($parsedComplex['imaginary']) / abs($parsedComplex['real'])));
- } else {
- return M_PI - atan($parsedComplex['imaginary'] / abs($parsedComplex['real']));
- }
- }
-
-
- /**
- * IMCONJUGATE
- *
- * Returns the complex conjugate of a complex number in x + yi or x + yj text format.
- *
- * Excel Function:
- * IMCONJUGATE(complexNumber)
- *
- * @param string $complexNumber The complex number for which you want the conjugate.
- * @return string
- */
- public static function IMCONJUGATE($complexNumber)
- {
- $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
- $parsedComplex = self::parseComplex($complexNumber);
-
- if ($parsedComplex['imaginary'] == 0.0) {
- return $parsedComplex['real'];
- } else {
- return self::cleanComplex(
- self::COMPLEX(
- $parsedComplex['real'],
- 0 - $parsedComplex['imaginary'],
- $parsedComplex['suffix']
- )
- );
- }
- }
-
-
- /**
- * IMCOS
- *
- * Returns the cosine of a complex number in x + yi or x + yj text format.
- *
- * Excel Function:
- * IMCOS(complexNumber)
- *
- * @param string $complexNumber The complex number for which you want the cosine.
- * @return string|float
- */
- public static function IMCOS($complexNumber)
- {
- $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
- $parsedComplex = self::parseComplex($complexNumber);
-
- if ($parsedComplex['imaginary'] == 0.0) {
- return cos($parsedComplex['real']);
- } else {
- return self::IMCONJUGATE(
- self::COMPLEX(
- cos($parsedComplex['real']) * cosh($parsedComplex['imaginary']),
- sin($parsedComplex['real']) * sinh($parsedComplex['imaginary']),
- $parsedComplex['suffix']
- )
- );
- }
- }
-
-
- /**
- * IMSIN
- *
- * Returns the sine of a complex number in x + yi or x + yj text format.
- *
- * Excel Function:
- * IMSIN(complexNumber)
- *
- * @param string $complexNumber The complex number for which you want the sine.
- * @return string|float
- */
- public static function IMSIN($complexNumber)
- {
- $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
- $parsedComplex = self::parseComplex($complexNumber);
-
- if ($parsedComplex['imaginary'] == 0.0) {
- return sin($parsedComplex['real']);
- } else {
- return self::COMPLEX(
- sin($parsedComplex['real']) * cosh($parsedComplex['imaginary']),
- cos($parsedComplex['real']) * sinh($parsedComplex['imaginary']),
- $parsedComplex['suffix']
- );
- }
- }
-
-
- /**
- * IMSQRT
- *
- * Returns the square root of a complex number in x + yi or x + yj text format.
- *
- * Excel Function:
- * IMSQRT(complexNumber)
- *
- * @param string $complexNumber The complex number for which you want the square root.
- * @return string
- */
- public static function IMSQRT($complexNumber)
- {
- $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
- $parsedComplex = self::parseComplex($complexNumber);
-
- $theta = self::IMARGUMENT($complexNumber);
- $d1 = cos($theta / 2);
- $d2 = sin($theta / 2);
- $r = sqrt(sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary'])));
-
- if ($parsedComplex['suffix'] == '') {
- return self::COMPLEX($d1 * $r, $d2 * $r);
- } else {
- return self::COMPLEX($d1 * $r, $d2 * $r, $parsedComplex['suffix']);
- }
- }
-
-
- /**
- * IMLN
- *
- * Returns the natural logarithm of a complex number in x + yi or x + yj text format.
- *
- * Excel Function:
- * IMLN(complexNumber)
- *
- * @param string $complexNumber The complex number for which you want the natural logarithm.
- * @return string
- */
- public static function IMLN($complexNumber)
- {
- $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
- $parsedComplex = self::parseComplex($complexNumber);
-
- if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
- return PHPExcel_Calculation_Functions::NaN();
- }
-
- $logR = log(sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary'])));
- $t = self::IMARGUMENT($complexNumber);
-
- if ($parsedComplex['suffix'] == '') {
- return self::COMPLEX($logR, $t);
- } else {
- return self::COMPLEX($logR, $t, $parsedComplex['suffix']);
- }
- }
-
-
- /**
- * IMLOG10
- *
- * Returns the common logarithm (base 10) of a complex number in x + yi or x + yj text format.
- *
- * Excel Function:
- * IMLOG10(complexNumber)
- *
- * @param string $complexNumber The complex number for which you want the common logarithm.
- * @return string
- */
- public static function IMLOG10($complexNumber)
- {
- $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
- $parsedComplex = self::parseComplex($complexNumber);
-
- if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
- return PHPExcel_Calculation_Functions::NaN();
- } elseif (($parsedComplex['real'] > 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
- return log10($parsedComplex['real']);
- }
-
- return self::IMPRODUCT(log10(EULER), self::IMLN($complexNumber));
- }
-
-
- /**
- * IMLOG2
- *
- * Returns the base-2 logarithm of a complex number in x + yi or x + yj text format.
- *
- * Excel Function:
- * IMLOG2(complexNumber)
- *
- * @param string $complexNumber The complex number for which you want the base-2 logarithm.
- * @return string
- */
- public static function IMLOG2($complexNumber)
- {
- $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
- $parsedComplex = self::parseComplex($complexNumber);
-
- if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
- return PHPExcel_Calculation_Functions::NaN();
- } elseif (($parsedComplex['real'] > 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
- return log($parsedComplex['real'], 2);
- }
-
- return self::IMPRODUCT(log(EULER, 2), self::IMLN($complexNumber));
- }
-
-
- /**
- * IMEXP
- *
- * Returns the exponential of a complex number in x + yi or x + yj text format.
- *
- * Excel Function:
- * IMEXP(complexNumber)
- *
- * @param string $complexNumber The complex number for which you want the exponential.
- * @return string
- */
- public static function IMEXP($complexNumber)
- {
- $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
-
- $parsedComplex = self::parseComplex($complexNumber);
-
- if (($parsedComplex['real'] == 0.0) && ($parsedComplex['imaginary'] == 0.0)) {
- return '1';
- }
-
- $e = exp($parsedComplex['real']);
- $eX = $e * cos($parsedComplex['imaginary']);
- $eY = $e * sin($parsedComplex['imaginary']);
-
- if ($parsedComplex['suffix'] == '') {
- return self::COMPLEX($eX, $eY);
- } else {
- return self::COMPLEX($eX, $eY, $parsedComplex['suffix']);
- }
- }
-
-
- /**
- * IMPOWER
- *
- * Returns a complex number in x + yi or x + yj text format raised to a power.
- *
- * Excel Function:
- * IMPOWER(complexNumber,realNumber)
- *
- * @param string $complexNumber The complex number you want to raise to a power.
- * @param float $realNumber The power to which you want to raise the complex number.
- * @return string
- */
- public static function IMPOWER($complexNumber, $realNumber)
- {
- $complexNumber = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber);
- $realNumber = PHPExcel_Calculation_Functions::flattenSingleValue($realNumber);
-
- if (!is_numeric($realNumber)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
- $parsedComplex = self::parseComplex($complexNumber);
-
- $r = sqrt(($parsedComplex['real'] * $parsedComplex['real']) + ($parsedComplex['imaginary'] * $parsedComplex['imaginary']));
- $rPower = pow($r, $realNumber);
- $theta = self::IMARGUMENT($complexNumber) * $realNumber;
- if ($theta == 0) {
- return 1;
- } elseif ($parsedComplex['imaginary'] == 0.0) {
- return self::COMPLEX($rPower * cos($theta), $rPower * sin($theta), $parsedComplex['suffix']);
- } else {
- return self::COMPLEX($rPower * cos($theta), $rPower * sin($theta), $parsedComplex['suffix']);
- }
- }
-
-
- /**
- * IMDIV
- *
- * Returns the quotient of two complex numbers in x + yi or x + yj text format.
- *
- * Excel Function:
- * IMDIV(complexDividend,complexDivisor)
- *
- * @param string $complexDividend The complex numerator or dividend.
- * @param string $complexDivisor The complex denominator or divisor.
- * @return string
- */
- public static function IMDIV($complexDividend, $complexDivisor)
- {
- $complexDividend = PHPExcel_Calculation_Functions::flattenSingleValue($complexDividend);
- $complexDivisor = PHPExcel_Calculation_Functions::flattenSingleValue($complexDivisor);
-
- $parsedComplexDividend = self::parseComplex($complexDividend);
- $parsedComplexDivisor = self::parseComplex($complexDivisor);
-
- if (($parsedComplexDividend['suffix'] != '') && ($parsedComplexDivisor['suffix'] != '') &&
- ($parsedComplexDividend['suffix'] != $parsedComplexDivisor['suffix'])) {
- return PHPExcel_Calculation_Functions::NaN();
- }
- if (($parsedComplexDividend['suffix'] != '') && ($parsedComplexDivisor['suffix'] == '')) {
- $parsedComplexDivisor['suffix'] = $parsedComplexDividend['suffix'];
- }
-
- $d1 = ($parsedComplexDividend['real'] * $parsedComplexDivisor['real']) + ($parsedComplexDividend['imaginary'] * $parsedComplexDivisor['imaginary']);
- $d2 = ($parsedComplexDividend['imaginary'] * $parsedComplexDivisor['real']) - ($parsedComplexDividend['real'] * $parsedComplexDivisor['imaginary']);
- $d3 = ($parsedComplexDivisor['real'] * $parsedComplexDivisor['real']) + ($parsedComplexDivisor['imaginary'] * $parsedComplexDivisor['imaginary']);
-
- $r = $d1 / $d3;
- $i = $d2 / $d3;
-
- if ($i > 0.0) {
- return self::cleanComplex($r.'+'.$i.$parsedComplexDivisor['suffix']);
- } elseif ($i < 0.0) {
- return self::cleanComplex($r.$i.$parsedComplexDivisor['suffix']);
- } else {
- return $r;
- }
- }
-
-
- /**
- * IMSUB
- *
- * Returns the difference of two complex numbers in x + yi or x + yj text format.
- *
- * Excel Function:
- * IMSUB(complexNumber1,complexNumber2)
- *
- * @param string $complexNumber1 The complex number from which to subtract complexNumber2.
- * @param string $complexNumber2 The complex number to subtract from complexNumber1.
- * @return string
- */
- public static function IMSUB($complexNumber1, $complexNumber2)
- {
- $complexNumber1 = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber1);
- $complexNumber2 = PHPExcel_Calculation_Functions::flattenSingleValue($complexNumber2);
-
- $parsedComplex1 = self::parseComplex($complexNumber1);
- $parsedComplex2 = self::parseComplex($complexNumber2);
-
- if ((($parsedComplex1['suffix'] != '') && ($parsedComplex2['suffix'] != '')) &&
- ($parsedComplex1['suffix'] != $parsedComplex2['suffix'])) {
- return PHPExcel_Calculation_Functions::NaN();
- } elseif (($parsedComplex1['suffix'] == '') && ($parsedComplex2['suffix'] != '')) {
- $parsedComplex1['suffix'] = $parsedComplex2['suffix'];
- }
-
- $d1 = $parsedComplex1['real'] - $parsedComplex2['real'];
- $d2 = $parsedComplex1['imaginary'] - $parsedComplex2['imaginary'];
-
- return self::COMPLEX($d1, $d2, $parsedComplex1['suffix']);
- }
-
-
- /**
- * IMSUM
- *
- * Returns the sum of two or more complex numbers in x + yi or x + yj text format.
- *
- * Excel Function:
- * IMSUM(complexNumber[,complexNumber[,...]])
- *
- * @param string $complexNumber,... Series of complex numbers to add
- * @return string
- */
- public static function IMSUM()
- {
- // Return value
- $returnValue = self::parseComplex('0');
- $activeSuffix = '';
-
- // Loop through the arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
- foreach ($aArgs as $arg) {
- $parsedComplex = self::parseComplex($arg);
-
- if ($activeSuffix == '') {
- $activeSuffix = $parsedComplex['suffix'];
- } elseif (($parsedComplex['suffix'] != '') && ($activeSuffix != $parsedComplex['suffix'])) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
- $returnValue['real'] += $parsedComplex['real'];
- $returnValue['imaginary'] += $parsedComplex['imaginary'];
- }
-
- if ($returnValue['imaginary'] == 0.0) {
- $activeSuffix = '';
- }
- return self::COMPLEX($returnValue['real'], $returnValue['imaginary'], $activeSuffix);
- }
-
-
- /**
- * IMPRODUCT
- *
- * Returns the product of two or more complex numbers in x + yi or x + yj text format.
- *
- * Excel Function:
- * IMPRODUCT(complexNumber[,complexNumber[,...]])
- *
- * @param string $complexNumber,... Series of complex numbers to multiply
- * @return string
- */
- public static function IMPRODUCT()
- {
- // Return value
- $returnValue = self::parseComplex('1');
- $activeSuffix = '';
-
- // Loop through the arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
- foreach ($aArgs as $arg) {
- $parsedComplex = self::parseComplex($arg);
-
- $workValue = $returnValue;
- if (($parsedComplex['suffix'] != '') && ($activeSuffix == '')) {
- $activeSuffix = $parsedComplex['suffix'];
- } elseif (($parsedComplex['suffix'] != '') && ($activeSuffix != $parsedComplex['suffix'])) {
- return PHPExcel_Calculation_Functions::NaN();
- }
- $returnValue['real'] = ($workValue['real'] * $parsedComplex['real']) - ($workValue['imaginary'] * $parsedComplex['imaginary']);
- $returnValue['imaginary'] = ($workValue['real'] * $parsedComplex['imaginary']) + ($workValue['imaginary'] * $parsedComplex['real']);
- }
-
- if ($returnValue['imaginary'] == 0.0) {
- $activeSuffix = '';
- }
- return self::COMPLEX($returnValue['real'], $returnValue['imaginary'], $activeSuffix);
- }
-
-
- /**
- * DELTA
- *
- * Tests whether two values are equal. Returns 1 if number1 = number2; returns 0 otherwise.
- * Use this function to filter a set of values. For example, by summing several DELTA
- * functions you calculate the count of equal pairs. This function is also known as the
- * Kronecker Delta function.
- *
- * Excel Function:
- * DELTA(a[,b])
- *
- * @param float $a The first number.
- * @param float $b The second number. If omitted, b is assumed to be zero.
- * @return int
- */
- public static function DELTA($a, $b = 0)
- {
- $a = PHPExcel_Calculation_Functions::flattenSingleValue($a);
- $b = PHPExcel_Calculation_Functions::flattenSingleValue($b);
-
- return (int) ($a == $b);
- }
-
-
- /**
- * GESTEP
- *
- * Excel Function:
- * GESTEP(number[,step])
- *
- * Returns 1 if number >= step; returns 0 (zero) otherwise
- * Use this function to filter a set of values. For example, by summing several GESTEP
- * functions you calculate the count of values that exceed a threshold.
- *
- * @param float $number The value to test against step.
- * @param float $step The threshold value.
- * If you omit a value for step, GESTEP uses zero.
- * @return int
- */
- public static function GESTEP($number, $step = 0)
- {
- $number = PHPExcel_Calculation_Functions::flattenSingleValue($number);
- $step = PHPExcel_Calculation_Functions::flattenSingleValue($step);
-
- return (int) ($number >= $step);
- }
-
-
- //
- // Private method to calculate the erf value
- //
- private static $twoSqrtPi = 1.128379167095512574;
-
- public static function erfVal($x)
- {
- if (abs($x) > 2.2) {
- return 1 - self::erfcVal($x);
- }
- $sum = $term = $x;
- $xsqr = ($x * $x);
- $j = 1;
- do {
- $term *= $xsqr / $j;
- $sum -= $term / (2 * $j + 1);
- ++$j;
- $term *= $xsqr / $j;
- $sum += $term / (2 * $j + 1);
- ++$j;
- if ($sum == 0.0) {
- break;
- }
- } while (abs($term / $sum) > PRECISION);
- return self::$twoSqrtPi * $sum;
- }
-
-
- /**
- * ERF
- *
- * Returns the error function integrated between the lower and upper bound arguments.
- *
- * Note: In Excel 2007 or earlier, if you input a negative value for the upper or lower bound arguments,
- * the function would return a #NUM! error. However, in Excel 2010, the function algorithm was
- * improved, so that it can now calculate the function for both positive and negative ranges.
- * PHPExcel follows Excel 2010 behaviour, and accepts nagative arguments.
- *
- * Excel Function:
- * ERF(lower[,upper])
- *
- * @param float $lower lower bound for integrating ERF
- * @param float $upper upper bound for integrating ERF.
- * If omitted, ERF integrates between zero and lower_limit
- * @return float
- */
- public static function ERF($lower, $upper = null)
- {
- $lower = PHPExcel_Calculation_Functions::flattenSingleValue($lower);
- $upper = PHPExcel_Calculation_Functions::flattenSingleValue($upper);
-
- if (is_numeric($lower)) {
- if (is_null($upper)) {
- return self::erfVal($lower);
- }
- if (is_numeric($upper)) {
- return self::erfVal($upper) - self::erfVal($lower);
- }
- }
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
-
- //
- // Private method to calculate the erfc value
- //
- private static $oneSqrtPi = 0.564189583547756287;
-
- private static function erfcVal($x)
- {
- if (abs($x) < 2.2) {
- return 1 - self::erfVal($x);
- }
- if ($x < 0) {
- return 2 - self::ERFC(-$x);
- }
- $a = $n = 1;
- $b = $c = $x;
- $d = ($x * $x) + 0.5;
- $q1 = $q2 = $b / $d;
- $t = 0;
- do {
- $t = $a * $n + $b * $x;
- $a = $b;
- $b = $t;
- $t = $c * $n + $d * $x;
- $c = $d;
- $d = $t;
- $n += 0.5;
- $q1 = $q2;
- $q2 = $b / $d;
- } while ((abs($q1 - $q2) / $q2) > PRECISION);
- return self::$oneSqrtPi * exp(-$x * $x) * $q2;
- }
-
-
- /**
- * ERFC
- *
- * Returns the complementary ERF function integrated between x and infinity
- *
- * Note: In Excel 2007 or earlier, if you input a negative value for the lower bound argument,
- * the function would return a #NUM! error. However, in Excel 2010, the function algorithm was
- * improved, so that it can now calculate the function for both positive and negative x values.
- * PHPExcel follows Excel 2010 behaviour, and accepts nagative arguments.
- *
- * Excel Function:
- * ERFC(x)
- *
- * @param float $x The lower bound for integrating ERFC
- * @return float
- */
- public static function ERFC($x)
- {
- $x = PHPExcel_Calculation_Functions::flattenSingleValue($x);
-
- if (is_numeric($x)) {
- return self::erfcVal($x);
- }
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
-
- /**
- * getConversionGroups
- * Returns a list of the different conversion groups for UOM conversions
- *
- * @return array
- */
- public static function getConversionGroups()
- {
- $conversionGroups = array();
- foreach (self::$conversionUnits as $conversionUnit) {
- $conversionGroups[] = $conversionUnit['Group'];
- }
- return array_merge(array_unique($conversionGroups));
- }
-
-
- /**
- * getConversionGroupUnits
- * Returns an array of units of measure, for a specified conversion group, or for all groups
- *
- * @param string $group The group whose units of measure you want to retrieve
- * @return array
- */
- public static function getConversionGroupUnits($group = null)
- {
- $conversionGroups = array();
- foreach (self::$conversionUnits as $conversionUnit => $conversionGroup) {
- if ((is_null($group)) || ($conversionGroup['Group'] == $group)) {
- $conversionGroups[$conversionGroup['Group']][] = $conversionUnit;
- }
- }
- return $conversionGroups;
- }
-
-
- /**
- * getConversionGroupUnitDetails
- *
- * @param string $group The group whose units of measure you want to retrieve
- * @return array
- */
- public static function getConversionGroupUnitDetails($group = null)
- {
- $conversionGroups = array();
- foreach (self::$conversionUnits as $conversionUnit => $conversionGroup) {
- if ((is_null($group)) || ($conversionGroup['Group'] == $group)) {
- $conversionGroups[$conversionGroup['Group']][] = array(
- 'unit' => $conversionUnit,
- 'description' => $conversionGroup['Unit Name']
- );
- }
- }
- return $conversionGroups;
- }
-
-
- /**
- * getConversionMultipliers
- * Returns an array of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM()
- *
- * @return array of mixed
- */
- public static function getConversionMultipliers()
- {
- return self::$conversionMultipliers;
- }
-
-
- /**
- * CONVERTUOM
- *
- * Converts a number from one measurement system to another.
- * For example, CONVERT can translate a table of distances in miles to a table of distances
- * in kilometers.
- *
- * Excel Function:
- * CONVERT(value,fromUOM,toUOM)
- *
- * @param float $value The value in fromUOM to convert.
- * @param string $fromUOM The units for value.
- * @param string $toUOM The units for the result.
- *
- * @return float
- */
- public static function CONVERTUOM($value, $fromUOM, $toUOM)
- {
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $fromUOM = PHPExcel_Calculation_Functions::flattenSingleValue($fromUOM);
- $toUOM = PHPExcel_Calculation_Functions::flattenSingleValue($toUOM);
-
- if (!is_numeric($value)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- $fromMultiplier = 1.0;
- if (isset(self::$conversionUnits[$fromUOM])) {
- $unitGroup1 = self::$conversionUnits[$fromUOM]['Group'];
- } else {
- $fromMultiplier = substr($fromUOM, 0, 1);
- $fromUOM = substr($fromUOM, 1);
- if (isset(self::$conversionMultipliers[$fromMultiplier])) {
- $fromMultiplier = self::$conversionMultipliers[$fromMultiplier]['multiplier'];
- } else {
- return PHPExcel_Calculation_Functions::NA();
- }
- if ((isset(self::$conversionUnits[$fromUOM])) && (self::$conversionUnits[$fromUOM]['AllowPrefix'])) {
- $unitGroup1 = self::$conversionUnits[$fromUOM]['Group'];
- } else {
- return PHPExcel_Calculation_Functions::NA();
- }
- }
- $value *= $fromMultiplier;
-
- $toMultiplier = 1.0;
- if (isset(self::$conversionUnits[$toUOM])) {
- $unitGroup2 = self::$conversionUnits[$toUOM]['Group'];
- } else {
- $toMultiplier = substr($toUOM, 0, 1);
- $toUOM = substr($toUOM, 1);
- if (isset(self::$conversionMultipliers[$toMultiplier])) {
- $toMultiplier = self::$conversionMultipliers[$toMultiplier]['multiplier'];
- } else {
- return PHPExcel_Calculation_Functions::NA();
- }
- if ((isset(self::$conversionUnits[$toUOM])) && (self::$conversionUnits[$toUOM]['AllowPrefix'])) {
- $unitGroup2 = self::$conversionUnits[$toUOM]['Group'];
- } else {
- return PHPExcel_Calculation_Functions::NA();
- }
- }
- if ($unitGroup1 != $unitGroup2) {
- return PHPExcel_Calculation_Functions::NA();
- }
-
- if (($fromUOM == $toUOM) && ($fromMultiplier == $toMultiplier)) {
- // We've already factored $fromMultiplier into the value, so we need
- // to reverse it again
- return $value / $fromMultiplier;
- } elseif ($unitGroup1 == 'Temperature') {
- if (($fromUOM == 'F') || ($fromUOM == 'fah')) {
- if (($toUOM == 'F') || ($toUOM == 'fah')) {
- return $value;
- } else {
- $value = (($value - 32) / 1.8);
- if (($toUOM == 'K') || ($toUOM == 'kel')) {
- $value += 273.15;
- }
- return $value;
- }
- } elseif ((($fromUOM == 'K') || ($fromUOM == 'kel')) &&
- (($toUOM == 'K') || ($toUOM == 'kel'))) {
- return $value;
- } elseif ((($fromUOM == 'C') || ($fromUOM == 'cel')) &&
- (($toUOM == 'C') || ($toUOM == 'cel'))) {
- return $value;
- }
- if (($toUOM == 'F') || ($toUOM == 'fah')) {
- if (($fromUOM == 'K') || ($fromUOM == 'kel')) {
- $value -= 273.15;
- }
- return ($value * 1.8) + 32;
- }
- if (($toUOM == 'C') || ($toUOM == 'cel')) {
- return $value - 273.15;
- }
- return $value + 273.15;
- }
- return ($value * self::$unitConversions[$unitGroup1][$fromUOM][$toUOM]) / $toMultiplier;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Calculation/Exception.php b/lib/phpexcel/PHPExcel/Calculation/Exception.php
deleted file mode 100644
index 52d73fc4f71..00000000000
--- a/lib/phpexcel/PHPExcel/Calculation/Exception.php
+++ /dev/null
@@ -1,46 +0,0 @@
-line = $line;
- $e->file = $file;
- throw $e;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Calculation/ExceptionHandler.php b/lib/phpexcel/PHPExcel/Calculation/ExceptionHandler.php
deleted file mode 100644
index 4cb0a6880f7..00000000000
--- a/lib/phpexcel/PHPExcel/Calculation/ExceptionHandler.php
+++ /dev/null
@@ -1,45 +0,0 @@
-<";
- const OPERATORS_POSTFIX = "%";
-
- /**
- * Formula
- *
- * @var string
- */
- private $formula;
-
- /**
- * Tokens
- *
- * @var PHPExcel_Calculation_FormulaToken[]
- */
- private $tokens = array();
-
- /**
- * Create a new PHPExcel_Calculation_FormulaParser
- *
- * @param string $pFormula Formula to parse
- * @throws PHPExcel_Calculation_Exception
- */
- public function __construct($pFormula = '')
- {
- // Check parameters
- if (is_null($pFormula)) {
- throw new PHPExcel_Calculation_Exception("Invalid parameter passed: formula");
- }
-
- // Initialise values
- $this->formula = trim($pFormula);
- // Parse!
- $this->parseToTokens();
- }
-
- /**
- * Get Formula
- *
- * @return string
- */
- public function getFormula()
- {
- return $this->formula;
- }
-
- /**
- * Get Token
- *
- * @param int $pId Token id
- * @return string
- * @throws PHPExcel_Calculation_Exception
- */
- public function getToken($pId = 0)
- {
- if (isset($this->tokens[$pId])) {
- return $this->tokens[$pId];
- } else {
- throw new PHPExcel_Calculation_Exception("Token with id $pId does not exist.");
- }
- }
-
- /**
- * Get Token count
- *
- * @return string
- */
- public function getTokenCount()
- {
- return count($this->tokens);
- }
-
- /**
- * Get Tokens
- *
- * @return PHPExcel_Calculation_FormulaToken[]
- */
- public function getTokens()
- {
- return $this->tokens;
- }
-
- /**
- * Parse to tokens
- */
- private function parseToTokens()
- {
- // No attempt is made to verify formulas; assumes formulas are derived from Excel, where
- // they can only exist if valid; stack overflows/underflows sunk as nulls without exceptions.
-
- // Check if the formula has a valid starting =
- $formulaLength = strlen($this->formula);
- if ($formulaLength < 2 || $this->formula{0} != '=') {
- return;
- }
-
- // Helper variables
- $tokens1 = $tokens2 = $stack = array();
- $inString = $inPath = $inRange = $inError = false;
- $token = $previousToken = $nextToken = null;
-
- $index = 1;
- $value = '';
-
- $ERRORS = array("#NULL!", "#DIV/0!", "#VALUE!", "#REF!", "#NAME?", "#NUM!", "#N/A");
- $COMPARATORS_MULTI = array(">=", "<=", "<>");
-
- while ($index < $formulaLength) {
- // state-dependent character evaluation (order is important)
-
- // double-quoted strings
- // embeds are doubled
- // end marks token
- if ($inString) {
- if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) {
- if ((($index + 2) <= $formulaLength) && ($this->formula{$index + 1} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE)) {
- $value .= PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE;
- ++$index;
- } else {
- $inString = false;
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_TEXT);
- $value = "";
- }
- } else {
- $value .= $this->formula{$index};
- }
- ++$index;
- continue;
- }
-
- // single-quoted strings (links)
- // embeds are double
- // end does not mark a token
- if ($inPath) {
- if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) {
- if ((($index + 2) <= $formulaLength) && ($this->formula{$index + 1} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE)) {
- $value .= PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE;
- ++$index;
- } else {
- $inPath = false;
- }
- } else {
- $value .= $this->formula{$index};
- }
- ++$index;
- continue;
- }
-
- // bracked strings (R1C1 range index or linked workbook name)
- // no embeds (changed to "()" by Excel)
- // end does not mark a token
- if ($inRange) {
- if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::BRACKET_CLOSE) {
- $inRange = false;
- }
- $value .= $this->formula{$index};
- ++$index;
- continue;
- }
-
- // error values
- // end marks a token, determined from absolute list of values
- if ($inError) {
- $value .= $this->formula{$index};
- ++$index;
- if (in_array($value, $ERRORS)) {
- $inError = false;
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_ERROR);
- $value = "";
- }
- continue;
- }
-
- // scientific notation check
- if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_SN, $this->formula{$index}) !== false) {
- if (strlen($value) > 1) {
- if (preg_match("/^[1-9]{1}(\.[0-9]+)?E{1}$/", $this->formula{$index}) != 0) {
- $value .= $this->formula{$index};
- ++$index;
- continue;
- }
- }
- }
-
- // independent character evaluation (order not important)
-
- // establish state-dependent character evaluations
- if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_DOUBLE) {
- if (strlen($value > 0)) {
- // unexpected
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN);
- $value = "";
- }
- $inString = true;
- ++$index;
- continue;
- }
-
- if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::QUOTE_SINGLE) {
- if (strlen($value) > 0) {
- // unexpected
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN);
- $value = "";
- }
- $inPath = true;
- ++$index;
- continue;
- }
-
- if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::BRACKET_OPEN) {
- $inRange = true;
- $value .= PHPExcel_Calculation_FormulaParser::BRACKET_OPEN;
- ++$index;
- continue;
- }
-
- if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::ERROR_START) {
- if (strlen($value) > 0) {
- // unexpected
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN);
- $value = "";
- }
- $inError = true;
- $value .= PHPExcel_Calculation_FormulaParser::ERROR_START;
- ++$index;
- continue;
- }
-
- // mark start and end of arrays and array rows
- if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::BRACE_OPEN) {
- if (strlen($value) > 0) {
- // unexpected
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN);
- $value = "";
- }
-
- $tmp = new PHPExcel_Calculation_FormulaToken("ARRAY", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START);
- $tokens1[] = $tmp;
- $stack[] = clone $tmp;
-
- $tmp = new PHPExcel_Calculation_FormulaToken("ARRAYROW", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START);
- $tokens1[] = $tmp;
- $stack[] = clone $tmp;
-
- ++$index;
- continue;
- }
-
- if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::SEMICOLON) {
- if (strlen($value) > 0) {
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
- $value = "";
- }
-
- $tmp = array_pop($stack);
- $tmp->setValue("");
- $tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP);
- $tokens1[] = $tmp;
-
- $tmp = new PHPExcel_Calculation_FormulaToken(",", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_ARGUMENT);
- $tokens1[] = $tmp;
-
- $tmp = new PHPExcel_Calculation_FormulaToken("ARRAYROW", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START);
- $tokens1[] = $tmp;
- $stack[] = clone $tmp;
-
- ++$index;
- continue;
- }
-
- if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::BRACE_CLOSE) {
- if (strlen($value) > 0) {
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
- $value = "";
- }
-
- $tmp = array_pop($stack);
- $tmp->setValue("");
- $tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP);
- $tokens1[] = $tmp;
-
- $tmp = array_pop($stack);
- $tmp->setValue("");
- $tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP);
- $tokens1[] = $tmp;
-
- ++$index;
- continue;
- }
-
- // trim white-space
- if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::WHITESPACE) {
- if (strlen($value) > 0) {
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
- $value = "";
- }
- $tokens1[] = new PHPExcel_Calculation_FormulaToken("", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_WHITESPACE);
- ++$index;
- while (($this->formula{$index} == PHPExcel_Calculation_FormulaParser::WHITESPACE) && ($index < $formulaLength)) {
- ++$index;
- }
- continue;
- }
-
- // multi-character comparators
- if (($index + 2) <= $formulaLength) {
- if (in_array(substr($this->formula, $index, 2), $COMPARATORS_MULTI)) {
- if (strlen($value) > 0) {
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
- $value = "";
- }
- $tokens1[] = new PHPExcel_Calculation_FormulaToken(substr($this->formula, $index, 2), PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_LOGICAL);
- $index += 2;
- continue;
- }
- }
-
- // standard infix operators
- if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_INFIX, $this->formula{$index}) !== false) {
- if (strlen($value) > 0) {
- $tokens1[] =new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
- $value = "";
- }
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($this->formula{$index}, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX);
- ++$index;
- continue;
- }
-
- // standard postfix operators (only one)
- if (strpos(PHPExcel_Calculation_FormulaParser::OPERATORS_POSTFIX, $this->formula{$index}) !== false) {
- if (strlen($value) > 0) {
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
- $value = "";
- }
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($this->formula{$index}, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX);
- ++$index;
- continue;
- }
-
- // start subexpression or function
- if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::PAREN_OPEN) {
- if (strlen($value) > 0) {
- $tmp = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START);
- $tokens1[] = $tmp;
- $stack[] = clone $tmp;
- $value = "";
- } else {
- $tmp = new PHPExcel_Calculation_FormulaToken("", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START);
- $tokens1[] = $tmp;
- $stack[] = clone $tmp;
- }
- ++$index;
- continue;
- }
-
- // function, subexpression, or array parameters, or operand unions
- if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::COMMA) {
- if (strlen($value) > 0) {
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
- $value = "";
- }
-
- $tmp = array_pop($stack);
- $tmp->setValue("");
- $tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP);
- $stack[] = $tmp;
-
- if ($tmp->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) {
- $tokens1[] = new PHPExcel_Calculation_FormulaToken(",", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_UNION);
- } else {
- $tokens1[] = new PHPExcel_Calculation_FormulaToken(",", PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_ARGUMENT);
- }
- ++$index;
- continue;
- }
-
- // stop subexpression
- if ($this->formula{$index} == PHPExcel_Calculation_FormulaParser::PAREN_CLOSE) {
- if (strlen($value) > 0) {
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
- $value = "";
- }
-
- $tmp = array_pop($stack);
- $tmp->setValue("");
- $tmp->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP);
- $tokens1[] = $tmp;
-
- ++$index;
- continue;
- }
-
- // token accumulation
- $value .= $this->formula{$index};
- ++$index;
- }
-
- // dump remaining accumulation
- if (strlen($value) > 0) {
- $tokens1[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND);
- }
-
- // move tokenList to new set, excluding unnecessary white-space tokens and converting necessary ones to intersections
- $tokenCount = count($tokens1);
- for ($i = 0; $i < $tokenCount; ++$i) {
- $token = $tokens1[$i];
- if (isset($tokens1[$i - 1])) {
- $previousToken = $tokens1[$i - 1];
- } else {
- $previousToken = null;
- }
- if (isset($tokens1[$i + 1])) {
- $nextToken = $tokens1[$i + 1];
- } else {
- $nextToken = null;
- }
-
- if (is_null($token)) {
- continue;
- }
-
- if ($token->getTokenType() != PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_WHITESPACE) {
- $tokens2[] = $token;
- continue;
- }
-
- if (is_null($previousToken)) {
- continue;
- }
-
- if (! (
- (($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) && ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) ||
- (($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) ||
- ($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND)
- ) ) {
- continue;
- }
-
- if (is_null($nextToken)) {
- continue;
- }
-
- if (! (
- (($nextToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) && ($nextToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START)) ||
- (($nextToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($nextToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_START)) ||
- ($nextToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND)
- ) ) {
- continue;
- }
-
- $tokens2[] = new PHPExcel_Calculation_FormulaToken($value, PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX, PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_INTERSECTION);
- }
-
- // move tokens to final list, switching infix "-" operators to prefix when appropriate, switching infix "+" operators
- // to noop when appropriate, identifying operand and infix-operator subtypes, and pulling "@" from function names
- $this->tokens = array();
-
- $tokenCount = count($tokens2);
- for ($i = 0; $i < $tokenCount; ++$i) {
- $token = $tokens2[$i];
- if (isset($tokens2[$i - 1])) {
- $previousToken = $tokens2[$i - 1];
- } else {
- $previousToken = null;
- }
- if (isset($tokens2[$i + 1])) {
- $nextToken = $tokens2[$i + 1];
- } else {
- $nextToken = null;
- }
-
- if (is_null($token)) {
- continue;
- }
-
- if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX && $token->getValue() == "-") {
- if ($i == 0) {
- $token->setTokenType(PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPREFIX);
- } elseif ((($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) &&
- ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) ||
- (($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION) &&
- ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) ||
- ($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX) ||
- ($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND)) {
- $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_MATH);
- } else {
- $token->setTokenType(PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPREFIX);
- }
-
- $this->tokens[] = $token;
- continue;
- }
-
- if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX && $token->getValue() == "+") {
- if ($i == 0) {
- continue;
- } elseif ((($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) &&
- ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) ||
- (($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_SUBEXPRESSION) &&
- ($previousToken->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_STOP)) ||
- ($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX) ||
- ($previousToken->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND)) {
- $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_MATH);
- } else {
- continue;
- }
-
- $this->tokens[] = $token;
- continue;
- }
-
- if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERATORINFIX &&
- $token->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NOTHING) {
- if (strpos("<>=", substr($token->getValue(), 0, 1)) !== false) {
- $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_LOGICAL);
- } elseif ($token->getValue() == "&") {
- $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_CONCATENATION);
- } else {
- $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_MATH);
- }
-
- $this->tokens[] = $token;
- continue;
- }
-
- if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_OPERAND &&
- $token->getTokenSubType() == PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NOTHING) {
- if (!is_numeric($token->getValue())) {
- if (strtoupper($token->getValue()) == "TRUE" || strtoupper($token->getValue() == "FALSE")) {
- $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_LOGICAL);
- } else {
- $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_RANGE);
- }
- } else {
- $token->setTokenSubType(PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NUMBER);
- }
-
- $this->tokens[] = $token;
- continue;
- }
-
- if ($token->getTokenType() == PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_FUNCTION) {
- if (strlen($token->getValue() > 0)) {
- if (substr($token->getValue(), 0, 1) == "@") {
- $token->setValue(substr($token->getValue(), 1));
- }
- }
- }
-
- $this->tokens[] = $token;
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Calculation/FormulaToken.php b/lib/phpexcel/PHPExcel/Calculation/FormulaToken.php
deleted file mode 100644
index 41c6e3d5dcf..00000000000
--- a/lib/phpexcel/PHPExcel/Calculation/FormulaToken.php
+++ /dev/null
@@ -1,176 +0,0 @@
-value = $pValue;
- $this->tokenType = $pTokenType;
- $this->tokenSubType = $pTokenSubType;
- }
-
- /**
- * Get Value
- *
- * @return string
- */
- public function getValue()
- {
- return $this->value;
- }
-
- /**
- * Set Value
- *
- * @param string $value
- */
- public function setValue($value)
- {
- $this->value = $value;
- }
-
- /**
- * Get Token Type (represented by TOKEN_TYPE_*)
- *
- * @return string
- */
- public function getTokenType()
- {
- return $this->tokenType;
- }
-
- /**
- * Set Token Type
- *
- * @param string $value
- */
- public function setTokenType($value = PHPExcel_Calculation_FormulaToken::TOKEN_TYPE_UNKNOWN)
- {
- $this->tokenType = $value;
- }
-
- /**
- * Get Token SubType (represented by TOKEN_SUBTYPE_*)
- *
- * @return string
- */
- public function getTokenSubType()
- {
- return $this->tokenSubType;
- }
-
- /**
- * Set Token SubType
- *
- * @param string $value
- */
- public function setTokenSubType($value = PHPExcel_Calculation_FormulaToken::TOKEN_SUBTYPE_NOTHING)
- {
- $this->tokenSubType = $value;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Calculation/Function.php b/lib/phpexcel/PHPExcel/Calculation/Function.php
deleted file mode 100644
index d58cef253ae..00000000000
--- a/lib/phpexcel/PHPExcel/Calculation/Function.php
+++ /dev/null
@@ -1,148 +0,0 @@
-category = $pCategory;
- $this->excelName = $pExcelName;
- $this->phpExcelName = $pPHPExcelName;
- } else {
- throw new PHPExcel_Calculation_Exception("Invalid parameters passed.");
- }
- }
-
- /**
- * Get Category (represented by CATEGORY_*)
- *
- * @return string
- */
- public function getCategory()
- {
- return $this->category;
- }
-
- /**
- * Set Category (represented by CATEGORY_*)
- *
- * @param string $value
- * @throws PHPExcel_Calculation_Exception
- */
- public function setCategory($value = null)
- {
- if (!is_null($value)) {
- $this->category = $value;
- } else {
- throw new PHPExcel_Calculation_Exception("Invalid parameter passed.");
- }
- }
-
- /**
- * Get Excel name
- *
- * @return string
- */
- public function getExcelName()
- {
- return $this->excelName;
- }
-
- /**
- * Set Excel name
- *
- * @param string $value
- */
- public function setExcelName($value)
- {
- $this->excelName = $value;
- }
-
- /**
- * Get PHPExcel name
- *
- * @return string
- */
- public function getPHPExcelName()
- {
- return $this->phpExcelName;
- }
-
- /**
- * Set PHPExcel name
- *
- * @param string $value
- */
- public function setPHPExcelName($value)
- {
- $this->phpExcelName = $value;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Calculation/Functions.php b/lib/phpexcel/PHPExcel/Calculation/Functions.php
deleted file mode 100644
index 9e7a5db1021..00000000000
--- a/lib/phpexcel/PHPExcel/Calculation/Functions.php
+++ /dev/null
@@ -1,762 +0,0 @@
- '#NULL!',
- 'divisionbyzero' => '#DIV/0!',
- 'value' => '#VALUE!',
- 'reference' => '#REF!',
- 'name' => '#NAME?',
- 'num' => '#NUM!',
- 'na' => '#N/A',
- 'gettingdata' => '#GETTING_DATA'
- );
-
-
- /**
- * Set the Compatibility Mode
- *
- * @access public
- * @category Function Configuration
- * @param string $compatibilityMode Compatibility Mode
- * Permitted values are:
- * PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL 'Excel'
- * PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC 'Gnumeric'
- * PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE 'OpenOfficeCalc'
- * @return boolean (Success or Failure)
- */
- public static function setCompatibilityMode($compatibilityMode)
- {
- if (($compatibilityMode == self::COMPATIBILITY_EXCEL) ||
- ($compatibilityMode == self::COMPATIBILITY_GNUMERIC) ||
- ($compatibilityMode == self::COMPATIBILITY_OPENOFFICE)) {
- self::$compatibilityMode = $compatibilityMode;
- return true;
- }
- return false;
- }
-
-
- /**
- * Return the current Compatibility Mode
- *
- * @access public
- * @category Function Configuration
- * @return string Compatibility Mode
- * Possible Return values are:
- * PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL 'Excel'
- * PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC 'Gnumeric'
- * PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE 'OpenOfficeCalc'
- */
- public static function getCompatibilityMode()
- {
- return self::$compatibilityMode;
- }
-
-
- /**
- * Set the Return Date Format used by functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object)
- *
- * @access public
- * @category Function Configuration
- * @param string $returnDateType Return Date Format
- * Permitted values are:
- * PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC 'P'
- * PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT 'O'
- * PHPExcel_Calculation_Functions::RETURNDATE_EXCEL 'E'
- * @return boolean Success or failure
- */
- public static function setReturnDateType($returnDateType)
- {
- if (($returnDateType == self::RETURNDATE_PHP_NUMERIC) ||
- ($returnDateType == self::RETURNDATE_PHP_OBJECT) ||
- ($returnDateType == self::RETURNDATE_EXCEL)) {
- self::$returnDateType = $returnDateType;
- return true;
- }
- return false;
- }
-
-
- /**
- * Return the current Return Date Format for functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object)
- *
- * @access public
- * @category Function Configuration
- * @return string Return Date Format
- * Possible Return values are:
- * PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC 'P'
- * PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT 'O'
- * PHPExcel_Calculation_Functions::RETURNDATE_EXCEL 'E'
- */
- public static function getReturnDateType()
- {
- return self::$returnDateType;
- }
-
-
- /**
- * DUMMY
- *
- * @access public
- * @category Error Returns
- * @return string #Not Yet Implemented
- */
- public static function DUMMY()
- {
- return '#Not Yet Implemented';
- }
-
-
- /**
- * DIV0
- *
- * @access public
- * @category Error Returns
- * @return string #Not Yet Implemented
- */
- public static function DIV0()
- {
- return self::$errorCodes['divisionbyzero'];
- }
-
-
- /**
- * NA
- *
- * Excel Function:
- * =NA()
- *
- * Returns the error value #N/A
- * #N/A is the error value that means "no value is available."
- *
- * @access public
- * @category Logical Functions
- * @return string #N/A!
- */
- public static function NA()
- {
- return self::$errorCodes['na'];
- }
-
-
- /**
- * NaN
- *
- * Returns the error value #NUM!
- *
- * @access public
- * @category Error Returns
- * @return string #NUM!
- */
- public static function NaN()
- {
- return self::$errorCodes['num'];
- }
-
-
- /**
- * NAME
- *
- * Returns the error value #NAME?
- *
- * @access public
- * @category Error Returns
- * @return string #NAME?
- */
- public static function NAME()
- {
- return self::$errorCodes['name'];
- }
-
-
- /**
- * REF
- *
- * Returns the error value #REF!
- *
- * @access public
- * @category Error Returns
- * @return string #REF!
- */
- public static function REF()
- {
- return self::$errorCodes['reference'];
- }
-
-
- /**
- * NULL
- *
- * Returns the error value #NULL!
- *
- * @access public
- * @category Error Returns
- * @return string #NULL!
- */
- public static function NULL()
- {
- return self::$errorCodes['null'];
- }
-
-
- /**
- * VALUE
- *
- * Returns the error value #VALUE!
- *
- * @access public
- * @category Error Returns
- * @return string #VALUE!
- */
- public static function VALUE()
- {
- return self::$errorCodes['value'];
- }
-
-
- public static function isMatrixValue($idx)
- {
- return ((substr_count($idx, '.') <= 1) || (preg_match('/\.[A-Z]/', $idx) > 0));
- }
-
-
- public static function isValue($idx)
- {
- return (substr_count($idx, '.') == 0);
- }
-
-
- public static function isCellValue($idx)
- {
- return (substr_count($idx, '.') > 1);
- }
-
-
- public static function ifCondition($condition)
- {
- $condition = PHPExcel_Calculation_Functions::flattenSingleValue($condition);
- if (!isset($condition{0})) {
- $condition = '=""';
- }
- if (!in_array($condition{0}, array('>', '<', '='))) {
- if (!is_numeric($condition)) {
- $condition = PHPExcel_Calculation::wrapResult(strtoupper($condition));
- }
- return '=' . $condition;
- } else {
- preg_match('/([<>=]+)(.*)/', $condition, $matches);
- list(, $operator, $operand) = $matches;
-
- if (!is_numeric($operand)) {
- $operand = str_replace('"', '""', $operand);
- $operand = PHPExcel_Calculation::wrapResult(strtoupper($operand));
- }
-
- return $operator.$operand;
- }
- }
-
- /**
- * ERROR_TYPE
- *
- * @param mixed $value Value to check
- * @return boolean
- */
- public static function ERROR_TYPE($value = '')
- {
- $value = self::flattenSingleValue($value);
-
- $i = 1;
- foreach (self::$errorCodes as $errorCode) {
- if ($value === $errorCode) {
- return $i;
- }
- ++$i;
- }
- return self::NA();
- }
-
-
- /**
- * IS_BLANK
- *
- * @param mixed $value Value to check
- * @return boolean
- */
- public static function IS_BLANK($value = null)
- {
- if (!is_null($value)) {
- $value = self::flattenSingleValue($value);
- }
-
- return is_null($value);
- }
-
-
- /**
- * IS_ERR
- *
- * @param mixed $value Value to check
- * @return boolean
- */
- public static function IS_ERR($value = '')
- {
- $value = self::flattenSingleValue($value);
-
- return self::IS_ERROR($value) && (!self::IS_NA($value));
- }
-
-
- /**
- * IS_ERROR
- *
- * @param mixed $value Value to check
- * @return boolean
- */
- public static function IS_ERROR($value = '')
- {
- $value = self::flattenSingleValue($value);
-
- if (!is_string($value)) {
- return false;
- }
- return in_array($value, array_values(self::$errorCodes));
- }
-
-
- /**
- * IS_NA
- *
- * @param mixed $value Value to check
- * @return boolean
- */
- public static function IS_NA($value = '')
- {
- $value = self::flattenSingleValue($value);
-
- return ($value === self::NA());
- }
-
-
- /**
- * IS_EVEN
- *
- * @param mixed $value Value to check
- * @return boolean
- */
- public static function IS_EVEN($value = null)
- {
- $value = self::flattenSingleValue($value);
-
- if ($value === null) {
- return self::NAME();
- } elseif ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
- return self::VALUE();
- }
-
- return ($value % 2 == 0);
- }
-
-
- /**
- * IS_ODD
- *
- * @param mixed $value Value to check
- * @return boolean
- */
- public static function IS_ODD($value = null)
- {
- $value = self::flattenSingleValue($value);
-
- if ($value === null) {
- return self::NAME();
- } elseif ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
- return self::VALUE();
- }
-
- return (abs($value) % 2 == 1);
- }
-
-
- /**
- * IS_NUMBER
- *
- * @param mixed $value Value to check
- * @return boolean
- */
- public static function IS_NUMBER($value = null)
- {
- $value = self::flattenSingleValue($value);
-
- if (is_string($value)) {
- return false;
- }
- return is_numeric($value);
- }
-
-
- /**
- * IS_LOGICAL
- *
- * @param mixed $value Value to check
- * @return boolean
- */
- public static function IS_LOGICAL($value = null)
- {
- $value = self::flattenSingleValue($value);
-
- return is_bool($value);
- }
-
-
- /**
- * IS_TEXT
- *
- * @param mixed $value Value to check
- * @return boolean
- */
- public static function IS_TEXT($value = null)
- {
- $value = self::flattenSingleValue($value);
-
- return (is_string($value) && !self::IS_ERROR($value));
- }
-
-
- /**
- * IS_NONTEXT
- *
- * @param mixed $value Value to check
- * @return boolean
- */
- public static function IS_NONTEXT($value = null)
- {
- return !self::IS_TEXT($value);
- }
-
-
- /**
- * VERSION
- *
- * @return string Version information
- */
- public static function VERSION()
- {
- return 'PHPExcel ##VERSION##, ##DATE##';
- }
-
-
- /**
- * N
- *
- * Returns a value converted to a number
- *
- * @param value The value you want converted
- * @return number N converts values listed in the following table
- * If value is or refers to N returns
- * A number That number
- * A date The serial number of that date
- * TRUE 1
- * FALSE 0
- * An error value The error value
- * Anything else 0
- */
- public static function N($value = null)
- {
- while (is_array($value)) {
- $value = array_shift($value);
- }
-
- switch (gettype($value)) {
- case 'double':
- case 'float':
- case 'integer':
- return $value;
- break;
- case 'boolean':
- return (integer) $value;
- break;
- case 'string':
- // Errors
- if ((strlen($value) > 0) && ($value{0} == '#')) {
- return $value;
- }
- break;
- }
- return 0;
- }
-
-
- /**
- * TYPE
- *
- * Returns a number that identifies the type of a value
- *
- * @param value The value you want tested
- * @return number N converts values listed in the following table
- * If value is or refers to N returns
- * A number 1
- * Text 2
- * Logical Value 4
- * An error value 16
- * Array or Matrix 64
- */
- public static function TYPE($value = null)
- {
- $value = self::flattenArrayIndexed($value);
- if (is_array($value) && (count($value) > 1)) {
- end($value);
- $a = key($value);
- // Range of cells is an error
- if (self::isCellValue($a)) {
- return 16;
- // Test for Matrix
- } elseif (self::isMatrixValue($a)) {
- return 64;
- }
- } elseif (empty($value)) {
- // Empty Cell
- return 1;
- }
- $value = self::flattenSingleValue($value);
-
- if (($value === null) || (is_float($value)) || (is_int($value))) {
- return 1;
- } elseif (is_bool($value)) {
- return 4;
- } elseif (is_array($value)) {
- return 64;
- } elseif (is_string($value)) {
- // Errors
- if ((strlen($value) > 0) && ($value{0} == '#')) {
- return 16;
- }
- return 2;
- }
- return 0;
- }
-
-
- /**
- * Convert a multi-dimensional array to a simple 1-dimensional array
- *
- * @param array $array Array to be flattened
- * @return array Flattened array
- */
- public static function flattenArray($array)
- {
- if (!is_array($array)) {
- return (array) $array;
- }
-
- $arrayValues = array();
- foreach ($array as $value) {
- if (is_array($value)) {
- foreach ($value as $val) {
- if (is_array($val)) {
- foreach ($val as $v) {
- $arrayValues[] = $v;
- }
- } else {
- $arrayValues[] = $val;
- }
- }
- } else {
- $arrayValues[] = $value;
- }
- }
-
- return $arrayValues;
- }
-
-
- /**
- * Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing
- *
- * @param array $array Array to be flattened
- * @return array Flattened array
- */
- public static function flattenArrayIndexed($array)
- {
- if (!is_array($array)) {
- return (array) $array;
- }
-
- $arrayValues = array();
- foreach ($array as $k1 => $value) {
- if (is_array($value)) {
- foreach ($value as $k2 => $val) {
- if (is_array($val)) {
- foreach ($val as $k3 => $v) {
- $arrayValues[$k1.'.'.$k2.'.'.$k3] = $v;
- }
- } else {
- $arrayValues[$k1.'.'.$k2] = $val;
- }
- }
- } else {
- $arrayValues[$k1] = $value;
- }
- }
-
- return $arrayValues;
- }
-
-
- /**
- * Convert an array to a single scalar value by extracting the first element
- *
- * @param mixed $value Array or scalar value
- * @return mixed
- */
- public static function flattenSingleValue($value = '')
- {
- while (is_array($value)) {
- $value = array_pop($value);
- }
-
- return $value;
- }
-}
-
-
-//
-// There are a few mathematical functions that aren't available on all versions of PHP for all platforms
-// These functions aren't available in Windows implementations of PHP prior to version 5.3.0
-// So we test if they do exist for this version of PHP/operating platform; and if not we create them
-//
-if (!function_exists('acosh')) {
- function acosh($x)
- {
- return 2 * log(sqrt(($x + 1) / 2) + sqrt(($x - 1) / 2));
- } // function acosh()
-}
-
-if (!function_exists('asinh')) {
- function asinh($x)
- {
- return log($x + sqrt(1 + $x * $x));
- } // function asinh()
-}
-
-if (!function_exists('atanh')) {
- function atanh($x)
- {
- return (log(1 + $x) - log(1 - $x)) / 2;
- } // function atanh()
-}
-
-
-//
-// Strangely, PHP doesn't have a mb_str_replace multibyte function
-// As we'll only ever use this function with UTF-8 characters, we can simply "hard-code" the character set
-//
-if ((!function_exists('mb_str_replace')) &&
- (function_exists('mb_substr')) && (function_exists('mb_strlen')) && (function_exists('mb_strpos'))) {
- function mb_str_replace($search, $replace, $subject)
- {
- if (is_array($subject)) {
- $ret = array();
- foreach ($subject as $key => $val) {
- $ret[$key] = mb_str_replace($search, $replace, $val);
- }
- return $ret;
- }
-
- foreach ((array) $search as $key => $s) {
- if ($s == '' && $s !== 0) {
- continue;
- }
- $r = !is_array($replace) ? $replace : (array_key_exists($key, $replace) ? $replace[$key] : '');
- $pos = mb_strpos($subject, $s, 0, 'UTF-8');
- while ($pos !== false) {
- $subject = mb_substr($subject, 0, $pos, 'UTF-8') . $r . mb_substr($subject, $pos + mb_strlen($s, 'UTF-8'), 65535, 'UTF-8');
- $pos = mb_strpos($subject, $s, $pos + mb_strlen($r, 'UTF-8'), 'UTF-8');
- }
- }
- return $subject;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Calculation/Logical.php b/lib/phpexcel/PHPExcel/Calculation/Logical.php
deleted file mode 100644
index dd65f010441..00000000000
--- a/lib/phpexcel/PHPExcel/Calculation/Logical.php
+++ /dev/null
@@ -1,285 +0,0 @@
- $arg) {
- // Is it a boolean value?
- if (is_bool($arg)) {
- $returnValue = $returnValue && $arg;
- } elseif ((is_numeric($arg)) && (!is_string($arg))) {
- $returnValue = $returnValue && ($arg != 0);
- } elseif (is_string($arg)) {
- $arg = strtoupper($arg);
- if (($arg == 'TRUE') || ($arg == PHPExcel_Calculation::getTRUE())) {
- $arg = true;
- } elseif (($arg == 'FALSE') || ($arg == PHPExcel_Calculation::getFALSE())) {
- $arg = false;
- } else {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- $returnValue = $returnValue && ($arg != 0);
- }
- }
-
- // Return
- if ($argCount < 0) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- return $returnValue;
- }
-
-
- /**
- * LOGICAL_OR
- *
- * Returns boolean TRUE if any argument is TRUE; returns FALSE if all arguments are FALSE.
- *
- * Excel Function:
- * =OR(logical1[,logical2[, ...]])
- *
- * The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays
- * or references that contain logical values.
- *
- * Boolean arguments are treated as True or False as appropriate
- * Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
- * If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
- * the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
- *
- * @access public
- * @category Logical Functions
- * @param mixed $arg,... Data values
- * @return boolean The logical OR of the arguments.
- */
- public static function LOGICAL_OR()
- {
- // Return value
- $returnValue = false;
-
- // Loop through the arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
- $argCount = -1;
- foreach ($aArgs as $argCount => $arg) {
- // Is it a boolean value?
- if (is_bool($arg)) {
- $returnValue = $returnValue || $arg;
- } elseif ((is_numeric($arg)) && (!is_string($arg))) {
- $returnValue = $returnValue || ($arg != 0);
- } elseif (is_string($arg)) {
- $arg = strtoupper($arg);
- if (($arg == 'TRUE') || ($arg == PHPExcel_Calculation::getTRUE())) {
- $arg = true;
- } elseif (($arg == 'FALSE') || ($arg == PHPExcel_Calculation::getFALSE())) {
- $arg = false;
- } else {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- $returnValue = $returnValue || ($arg != 0);
- }
- }
-
- // Return
- if ($argCount < 0) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- return $returnValue;
- }
-
-
- /**
- * NOT
- *
- * Returns the boolean inverse of the argument.
- *
- * Excel Function:
- * =NOT(logical)
- *
- * The argument must evaluate to a logical value such as TRUE or FALSE
- *
- * Boolean arguments are treated as True or False as appropriate
- * Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
- * If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
- * the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
- *
- * @access public
- * @category Logical Functions
- * @param mixed $logical A value or expression that can be evaluated to TRUE or FALSE
- * @return boolean The boolean inverse of the argument.
- */
- public static function NOT($logical = false)
- {
- $logical = PHPExcel_Calculation_Functions::flattenSingleValue($logical);
- if (is_string($logical)) {
- $logical = strtoupper($logical);
- if (($logical == 'TRUE') || ($logical == PHPExcel_Calculation::getTRUE())) {
- return false;
- } elseif (($logical == 'FALSE') || ($logical == PHPExcel_Calculation::getFALSE())) {
- return true;
- } else {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- }
-
- return !$logical;
- }
-
- /**
- * STATEMENT_IF
- *
- * Returns one value if a condition you specify evaluates to TRUE and another value if it evaluates to FALSE.
- *
- * Excel Function:
- * =IF(condition[,returnIfTrue[,returnIfFalse]])
- *
- * Condition is any value or expression that can be evaluated to TRUE or FALSE.
- * For example, A10=100 is a logical expression; if the value in cell A10 is equal to 100,
- * the expression evaluates to TRUE. Otherwise, the expression evaluates to FALSE.
- * This argument can use any comparison calculation operator.
- * ReturnIfTrue is the value that is returned if condition evaluates to TRUE.
- * For example, if this argument is the text string "Within budget" and the condition argument evaluates to TRUE,
- * then the IF function returns the text "Within budget"
- * If condition is TRUE and ReturnIfTrue is blank, this argument returns 0 (zero). To display the word TRUE, use
- * the logical value TRUE for this argument.
- * ReturnIfTrue can be another formula.
- * ReturnIfFalse is the value that is returned if condition evaluates to FALSE.
- * For example, if this argument is the text string "Over budget" and the condition argument evaluates to FALSE,
- * then the IF function returns the text "Over budget".
- * If condition is FALSE and ReturnIfFalse is omitted, then the logical value FALSE is returned.
- * If condition is FALSE and ReturnIfFalse is blank, then the value 0 (zero) is returned.
- * ReturnIfFalse can be another formula.
- *
- * @access public
- * @category Logical Functions
- * @param mixed $condition Condition to evaluate
- * @param mixed $returnIfTrue Value to return when condition is true
- * @param mixed $returnIfFalse Optional value to return when condition is false
- * @return mixed The value of returnIfTrue or returnIfFalse determined by condition
- */
- public static function STATEMENT_IF($condition = true, $returnIfTrue = 0, $returnIfFalse = false)
- {
- $condition = (is_null($condition)) ? true : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($condition);
- $returnIfTrue = (is_null($returnIfTrue)) ? 0 : PHPExcel_Calculation_Functions::flattenSingleValue($returnIfTrue);
- $returnIfFalse = (is_null($returnIfFalse)) ? false : PHPExcel_Calculation_Functions::flattenSingleValue($returnIfFalse);
-
- return ($condition) ? $returnIfTrue : $returnIfFalse;
- }
-
-
- /**
- * IFERROR
- *
- * Excel Function:
- * =IFERROR(testValue,errorpart)
- *
- * @access public
- * @category Logical Functions
- * @param mixed $testValue Value to check, is also the value returned when no error
- * @param mixed $errorpart Value to return when testValue is an error condition
- * @return mixed The value of errorpart or testValue determined by error condition
- */
- public static function IFERROR($testValue = '', $errorpart = '')
- {
- $testValue = (is_null($testValue)) ? '' : PHPExcel_Calculation_Functions::flattenSingleValue($testValue);
- $errorpart = (is_null($errorpart)) ? '' : PHPExcel_Calculation_Functions::flattenSingleValue($errorpart);
-
- return self::STATEMENT_IF(PHPExcel_Calculation_Functions::IS_ERROR($testValue), $errorpart, $testValue);
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Calculation/LookupRef.php b/lib/phpexcel/PHPExcel/Calculation/LookupRef.php
deleted file mode 100644
index d86055121c4..00000000000
--- a/lib/phpexcel/PHPExcel/Calculation/LookupRef.php
+++ /dev/null
@@ -1,878 +0,0 @@
- '') {
- if (strpos($sheetText, ' ') !== false) {
- $sheetText = "'".$sheetText."'";
- }
- $sheetText .='!';
- }
- if ((!is_bool($referenceStyle)) || $referenceStyle) {
- $rowRelative = $columnRelative = '$';
- $column = PHPExcel_Cell::stringFromColumnIndex($column-1);
- if (($relativity == 2) || ($relativity == 4)) {
- $columnRelative = '';
- }
- if (($relativity == 3) || ($relativity == 4)) {
- $rowRelative = '';
- }
- return $sheetText.$columnRelative.$column.$rowRelative.$row;
- } else {
- if (($relativity == 2) || ($relativity == 4)) {
- $column = '['.$column.']';
- }
- if (($relativity == 3) || ($relativity == 4)) {
- $row = '['.$row.']';
- }
- return $sheetText.'R'.$row.'C'.$column;
- }
- }
-
-
- /**
- * COLUMN
- *
- * Returns the column number of the given cell reference
- * If the cell reference is a range of cells, COLUMN returns the column numbers of each column in the reference as a horizontal array.
- * If cell reference is omitted, and the function is being called through the calculation engine, then it is assumed to be the
- * reference of the cell in which the COLUMN function appears; otherwise this function returns 0.
- *
- * Excel Function:
- * =COLUMN([cellAddress])
- *
- * @param cellAddress A reference to a range of cells for which you want the column numbers
- * @return integer or array of integer
- */
- public static function COLUMN($cellAddress = null)
- {
- if (is_null($cellAddress) || trim($cellAddress) === '') {
- return 0;
- }
-
- if (is_array($cellAddress)) {
- foreach ($cellAddress as $columnKey => $value) {
- $columnKey = preg_replace('/[^a-z]/i', '', $columnKey);
- return (integer) PHPExcel_Cell::columnIndexFromString($columnKey);
- }
- } else {
- if (strpos($cellAddress, '!') !== false) {
- list($sheet, $cellAddress) = explode('!', $cellAddress);
- }
- if (strpos($cellAddress, ':') !== false) {
- list($startAddress, $endAddress) = explode(':', $cellAddress);
- $startAddress = preg_replace('/[^a-z]/i', '', $startAddress);
- $endAddress = preg_replace('/[^a-z]/i', '', $endAddress);
- $returnValue = array();
- do {
- $returnValue[] = (integer) PHPExcel_Cell::columnIndexFromString($startAddress);
- } while ($startAddress++ != $endAddress);
- return $returnValue;
- } else {
- $cellAddress = preg_replace('/[^a-z]/i', '', $cellAddress);
- return (integer) PHPExcel_Cell::columnIndexFromString($cellAddress);
- }
- }
- }
-
-
- /**
- * COLUMNS
- *
- * Returns the number of columns in an array or reference.
- *
- * Excel Function:
- * =COLUMNS(cellAddress)
- *
- * @param cellAddress An array or array formula, or a reference to a range of cells for which you want the number of columns
- * @return integer The number of columns in cellAddress
- */
- public static function COLUMNS($cellAddress = null)
- {
- if (is_null($cellAddress) || $cellAddress === '') {
- return 1;
- } elseif (!is_array($cellAddress)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
- reset($cellAddress);
- $isMatrix = (is_numeric(key($cellAddress)));
- list($columns, $rows) = PHPExcel_Calculation::_getMatrixDimensions($cellAddress);
-
- if ($isMatrix) {
- return $rows;
- } else {
- return $columns;
- }
- }
-
-
- /**
- * ROW
- *
- * Returns the row number of the given cell reference
- * If the cell reference is a range of cells, ROW returns the row numbers of each row in the reference as a vertical array.
- * If cell reference is omitted, and the function is being called through the calculation engine, then it is assumed to be the
- * reference of the cell in which the ROW function appears; otherwise this function returns 0.
- *
- * Excel Function:
- * =ROW([cellAddress])
- *
- * @param cellAddress A reference to a range of cells for which you want the row numbers
- * @return integer or array of integer
- */
- public static function ROW($cellAddress = null)
- {
- if (is_null($cellAddress) || trim($cellAddress) === '') {
- return 0;
- }
-
- if (is_array($cellAddress)) {
- foreach ($cellAddress as $columnKey => $rowValue) {
- foreach ($rowValue as $rowKey => $cellValue) {
- return (integer) preg_replace('/[^0-9]/i', '', $rowKey);
- }
- }
- } else {
- if (strpos($cellAddress, '!') !== false) {
- list($sheet, $cellAddress) = explode('!', $cellAddress);
- }
- if (strpos($cellAddress, ':') !== false) {
- list($startAddress, $endAddress) = explode(':', $cellAddress);
- $startAddress = preg_replace('/[^0-9]/', '', $startAddress);
- $endAddress = preg_replace('/[^0-9]/', '', $endAddress);
- $returnValue = array();
- do {
- $returnValue[][] = (integer) $startAddress;
- } while ($startAddress++ != $endAddress);
- return $returnValue;
- } else {
- list($cellAddress) = explode(':', $cellAddress);
- return (integer) preg_replace('/[^0-9]/', '', $cellAddress);
- }
- }
- }
-
-
- /**
- * ROWS
- *
- * Returns the number of rows in an array or reference.
- *
- * Excel Function:
- * =ROWS(cellAddress)
- *
- * @param cellAddress An array or array formula, or a reference to a range of cells for which you want the number of rows
- * @return integer The number of rows in cellAddress
- */
- public static function ROWS($cellAddress = null)
- {
- if (is_null($cellAddress) || $cellAddress === '') {
- return 1;
- } elseif (!is_array($cellAddress)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
- reset($cellAddress);
- $isMatrix = (is_numeric(key($cellAddress)));
- list($columns, $rows) = PHPExcel_Calculation::_getMatrixDimensions($cellAddress);
-
- if ($isMatrix) {
- return $columns;
- } else {
- return $rows;
- }
- }
-
-
- /**
- * HYPERLINK
- *
- * Excel Function:
- * =HYPERLINK(linkURL,displayName)
- *
- * @access public
- * @category Logical Functions
- * @param string $linkURL Value to check, is also the value returned when no error
- * @param string $displayName Value to return when testValue is an error condition
- * @param PHPExcel_Cell $pCell The cell to set the hyperlink in
- * @return mixed The value of $displayName (or $linkURL if $displayName was blank)
- */
- public static function HYPERLINK($linkURL = '', $displayName = null, PHPExcel_Cell $pCell = null)
- {
- $args = func_get_args();
- $pCell = array_pop($args);
-
- $linkURL = (is_null($linkURL)) ? '' : PHPExcel_Calculation_Functions::flattenSingleValue($linkURL);
- $displayName = (is_null($displayName)) ? '' : PHPExcel_Calculation_Functions::flattenSingleValue($displayName);
-
- if ((!is_object($pCell)) || (trim($linkURL) == '')) {
- return PHPExcel_Calculation_Functions::REF();
- }
-
- if ((is_object($displayName)) || trim($displayName) == '') {
- $displayName = $linkURL;
- }
-
- $pCell->getHyperlink()->setUrl($linkURL);
-
- return $displayName;
- }
-
-
- /**
- * INDIRECT
- *
- * Returns the reference specified by a text string.
- * References are immediately evaluated to display their contents.
- *
- * Excel Function:
- * =INDIRECT(cellAddress)
- *
- * NOTE - INDIRECT() does not yet support the optional a1 parameter introduced in Excel 2010
- *
- * @param cellAddress $cellAddress The cell address of the current cell (containing this formula)
- * @param PHPExcel_Cell $pCell The current cell (containing this formula)
- * @return mixed The cells referenced by cellAddress
- *
- * @todo Support for the optional a1 parameter introduced in Excel 2010
- *
- */
- public static function INDIRECT($cellAddress = null, PHPExcel_Cell $pCell = null)
- {
- $cellAddress = PHPExcel_Calculation_Functions::flattenSingleValue($cellAddress);
- if (is_null($cellAddress) || $cellAddress === '') {
- return PHPExcel_Calculation_Functions::REF();
- }
-
- $cellAddress1 = $cellAddress;
- $cellAddress2 = null;
- if (strpos($cellAddress, ':') !== false) {
- list($cellAddress1, $cellAddress2) = explode(':', $cellAddress);
- }
-
- if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress1, $matches)) ||
- ((!is_null($cellAddress2)) && (!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $cellAddress2, $matches)))) {
- if (!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $cellAddress1, $matches)) {
- return PHPExcel_Calculation_Functions::REF();
- }
-
- if (strpos($cellAddress, '!') !== false) {
- list($sheetName, $cellAddress) = explode('!', $cellAddress);
- $sheetName = trim($sheetName, "'");
- $pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
- } else {
- $pSheet = $pCell->getWorksheet();
- }
-
- return PHPExcel_Calculation::getInstance()->extractNamedRange($cellAddress, $pSheet, false);
- }
-
- if (strpos($cellAddress, '!') !== false) {
- list($sheetName, $cellAddress) = explode('!', $cellAddress);
- $sheetName = trim($sheetName, "'");
- $pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
- } else {
- $pSheet = $pCell->getWorksheet();
- }
-
- return PHPExcel_Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false);
- }
-
-
- /**
- * OFFSET
- *
- * Returns a reference to a range that is a specified number of rows and columns from a cell or range of cells.
- * The reference that is returned can be a single cell or a range of cells. You can specify the number of rows and
- * the number of columns to be returned.
- *
- * Excel Function:
- * =OFFSET(cellAddress, rows, cols, [height], [width])
- *
- * @param cellAddress The reference from which you want to base the offset. Reference must refer to a cell or
- * range of adjacent cells; otherwise, OFFSET returns the #VALUE! error value.
- * @param rows The number of rows, up or down, that you want the upper-left cell to refer to.
- * Using 5 as the rows argument specifies that the upper-left cell in the reference is
- * five rows below reference. Rows can be positive (which means below the starting reference)
- * or negative (which means above the starting reference).
- * @param cols The number of columns, to the left or right, that you want the upper-left cell of the result
- * to refer to. Using 5 as the cols argument specifies that the upper-left cell in the
- * reference is five columns to the right of reference. Cols can be positive (which means
- * to the right of the starting reference) or negative (which means to the left of the
- * starting reference).
- * @param height The height, in number of rows, that you want the returned reference to be. Height must be a positive number.
- * @param width The width, in number of columns, that you want the returned reference to be. Width must be a positive number.
- * @return string A reference to a cell or range of cells
- */
- public static function OFFSET($cellAddress = null, $rows = 0, $columns = 0, $height = null, $width = null)
- {
- $rows = PHPExcel_Calculation_Functions::flattenSingleValue($rows);
- $columns = PHPExcel_Calculation_Functions::flattenSingleValue($columns);
- $height = PHPExcel_Calculation_Functions::flattenSingleValue($height);
- $width = PHPExcel_Calculation_Functions::flattenSingleValue($width);
- if ($cellAddress == null) {
- return 0;
- }
-
- $args = func_get_args();
- $pCell = array_pop($args);
- if (!is_object($pCell)) {
- return PHPExcel_Calculation_Functions::REF();
- }
-
- $sheetName = null;
- if (strpos($cellAddress, "!")) {
- list($sheetName, $cellAddress) = explode("!", $cellAddress);
- $sheetName = trim($sheetName, "'");
- }
- if (strpos($cellAddress, ":")) {
- list($startCell, $endCell) = explode(":", $cellAddress);
- } else {
- $startCell = $endCell = $cellAddress;
- }
- list($startCellColumn, $startCellRow) = PHPExcel_Cell::coordinateFromString($startCell);
- list($endCellColumn, $endCellRow) = PHPExcel_Cell::coordinateFromString($endCell);
-
- $startCellRow += $rows;
- $startCellColumn = PHPExcel_Cell::columnIndexFromString($startCellColumn) - 1;
- $startCellColumn += $columns;
-
- if (($startCellRow <= 0) || ($startCellColumn < 0)) {
- return PHPExcel_Calculation_Functions::REF();
- }
- $endCellColumn = PHPExcel_Cell::columnIndexFromString($endCellColumn) - 1;
- if (($width != null) && (!is_object($width))) {
- $endCellColumn = $startCellColumn + $width - 1;
- } else {
- $endCellColumn += $columns;
- }
- $startCellColumn = PHPExcel_Cell::stringFromColumnIndex($startCellColumn);
-
- if (($height != null) && (!is_object($height))) {
- $endCellRow = $startCellRow + $height - 1;
- } else {
- $endCellRow += $rows;
- }
-
- if (($endCellRow <= 0) || ($endCellColumn < 0)) {
- return PHPExcel_Calculation_Functions::REF();
- }
- $endCellColumn = PHPExcel_Cell::stringFromColumnIndex($endCellColumn);
-
- $cellAddress = $startCellColumn.$startCellRow;
- if (($startCellColumn != $endCellColumn) || ($startCellRow != $endCellRow)) {
- $cellAddress .= ':'.$endCellColumn.$endCellRow;
- }
-
- if ($sheetName !== null) {
- $pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
- } else {
- $pSheet = $pCell->getWorksheet();
- }
-
- return PHPExcel_Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false);
- }
-
-
- /**
- * CHOOSE
- *
- * Uses lookup_value to return a value from the list of value arguments.
- * Use CHOOSE to select one of up to 254 values based on the lookup_value.
- *
- * Excel Function:
- * =CHOOSE(index_num, value1, [value2], ...)
- *
- * @param index_num Specifies which value argument is selected.
- * Index_num must be a number between 1 and 254, or a formula or reference to a cell containing a number
- * between 1 and 254.
- * @param value1... Value1 is required, subsequent values are optional.
- * Between 1 to 254 value arguments from which CHOOSE selects a value or an action to perform based on
- * index_num. The arguments can be numbers, cell references, defined names, formulas, functions, or
- * text.
- * @return mixed The selected value
- */
- public static function CHOOSE()
- {
- $chooseArgs = func_get_args();
- $chosenEntry = PHPExcel_Calculation_Functions::flattenArray(array_shift($chooseArgs));
- $entryCount = count($chooseArgs) - 1;
-
- if (is_array($chosenEntry)) {
- $chosenEntry = array_shift($chosenEntry);
- }
- if ((is_numeric($chosenEntry)) && (!is_bool($chosenEntry))) {
- --$chosenEntry;
- } else {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- $chosenEntry = floor($chosenEntry);
- if (($chosenEntry < 0) || ($chosenEntry > $entryCount)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
- if (is_array($chooseArgs[$chosenEntry])) {
- return PHPExcel_Calculation_Functions::flattenArray($chooseArgs[$chosenEntry]);
- } else {
- return $chooseArgs[$chosenEntry];
- }
- }
-
-
- /**
- * MATCH
- *
- * The MATCH function searches for a specified item in a range of cells
- *
- * Excel Function:
- * =MATCH(lookup_value, lookup_array, [match_type])
- *
- * @param lookup_value The value that you want to match in lookup_array
- * @param lookup_array The range of cells being searched
- * @param match_type The number -1, 0, or 1. -1 means above, 0 means exact match, 1 means below. If match_type is 1 or -1, the list has to be ordered.
- * @return integer The relative position of the found item
- */
- public static function MATCH($lookup_value, $lookup_array, $match_type = 1)
- {
- $lookup_array = PHPExcel_Calculation_Functions::flattenArray($lookup_array);
- $lookup_value = PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value);
- $match_type = (is_null($match_type)) ? 1 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($match_type);
- // MATCH is not case sensitive
- $lookup_value = strtolower($lookup_value);
-
- // lookup_value type has to be number, text, or logical values
- if ((!is_numeric($lookup_value)) && (!is_string($lookup_value)) && (!is_bool($lookup_value))) {
- return PHPExcel_Calculation_Functions::NA();
- }
-
- // match_type is 0, 1 or -1
- if (($match_type !== 0) && ($match_type !== -1) && ($match_type !== 1)) {
- return PHPExcel_Calculation_Functions::NA();
- }
-
- // lookup_array should not be empty
- $lookupArraySize = count($lookup_array);
- if ($lookupArraySize <= 0) {
- return PHPExcel_Calculation_Functions::NA();
- }
-
- // lookup_array should contain only number, text, or logical values, or empty (null) cells
- foreach ($lookup_array as $i => $lookupArrayValue) {
- // check the type of the value
- if ((!is_numeric($lookupArrayValue)) && (!is_string($lookupArrayValue)) &&
- (!is_bool($lookupArrayValue)) && (!is_null($lookupArrayValue))) {
- return PHPExcel_Calculation_Functions::NA();
- }
- // convert strings to lowercase for case-insensitive testing
- if (is_string($lookupArrayValue)) {
- $lookup_array[$i] = strtolower($lookupArrayValue);
- }
- if ((is_null($lookupArrayValue)) && (($match_type == 1) || ($match_type == -1))) {
- $lookup_array = array_slice($lookup_array, 0, $i-1);
- }
- }
-
- // if match_type is 1 or -1, the list has to be ordered
- if ($match_type == 1) {
- asort($lookup_array);
- $keySet = array_keys($lookup_array);
- } elseif ($match_type == -1) {
- arsort($lookup_array);
- $keySet = array_keys($lookup_array);
- }
-
- // **
- // find the match
- // **
- foreach ($lookup_array as $i => $lookupArrayValue) {
- if (($match_type == 0) && ($lookupArrayValue == $lookup_value)) {
- // exact match
- return ++$i;
- } elseif (($match_type == -1) && ($lookupArrayValue <= $lookup_value)) {
- $i = array_search($i, $keySet);
- // if match_type is -1 <=> find the smallest value that is greater than or equal to lookup_value
- if ($i < 1) {
- // 1st cell was already smaller than the lookup_value
- break;
- } else {
- // the previous cell was the match
- return $keySet[$i-1]+1;
- }
- } elseif (($match_type == 1) && ($lookupArrayValue >= $lookup_value)) {
- $i = array_search($i, $keySet);
- // if match_type is 1 <=> find the largest value that is less than or equal to lookup_value
- if ($i < 1) {
- // 1st cell was already bigger than the lookup_value
- break;
- } else {
- // the previous cell was the match
- return $keySet[$i-1]+1;
- }
- }
- }
-
- // unsuccessful in finding a match, return #N/A error value
- return PHPExcel_Calculation_Functions::NA();
- }
-
-
- /**
- * INDEX
- *
- * Uses an index to choose a value from a reference or array
- *
- * Excel Function:
- * =INDEX(range_array, row_num, [column_num])
- *
- * @param range_array A range of cells or an array constant
- * @param row_num The row in array from which to return a value. If row_num is omitted, column_num is required.
- * @param column_num The column in array from which to return a value. If column_num is omitted, row_num is required.
- * @return mixed the value of a specified cell or array of cells
- */
- public static function INDEX($arrayValues, $rowNum = 0, $columnNum = 0)
- {
- if (($rowNum < 0) || ($columnNum < 0)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
- if (!is_array($arrayValues)) {
- return PHPExcel_Calculation_Functions::REF();
- }
-
- $rowKeys = array_keys($arrayValues);
- $columnKeys = @array_keys($arrayValues[$rowKeys[0]]);
-
- if ($columnNum > count($columnKeys)) {
- return PHPExcel_Calculation_Functions::VALUE();
- } elseif ($columnNum == 0) {
- if ($rowNum == 0) {
- return $arrayValues;
- }
- $rowNum = $rowKeys[--$rowNum];
- $returnArray = array();
- foreach ($arrayValues as $arrayColumn) {
- if (is_array($arrayColumn)) {
- if (isset($arrayColumn[$rowNum])) {
- $returnArray[] = $arrayColumn[$rowNum];
- } else {
- return $arrayValues[$rowNum];
- }
- } else {
- return $arrayValues[$rowNum];
- }
- }
- return $returnArray;
- }
- $columnNum = $columnKeys[--$columnNum];
- if ($rowNum > count($rowKeys)) {
- return PHPExcel_Calculation_Functions::VALUE();
- } elseif ($rowNum == 0) {
- return $arrayValues[$columnNum];
- }
- $rowNum = $rowKeys[--$rowNum];
-
- return $arrayValues[$rowNum][$columnNum];
- }
-
-
- /**
- * TRANSPOSE
- *
- * @param array $matrixData A matrix of values
- * @return array
- *
- * Unlike the Excel TRANSPOSE function, which will only work on a single row or column, this function will transpose a full matrix.
- */
- public static function TRANSPOSE($matrixData)
- {
- $returnMatrix = array();
- if (!is_array($matrixData)) {
- $matrixData = array(array($matrixData));
- }
-
- $column = 0;
- foreach ($matrixData as $matrixRow) {
- $row = 0;
- foreach ($matrixRow as $matrixCell) {
- $returnMatrix[$row][$column] = $matrixCell;
- ++$row;
- }
- ++$column;
- }
- return $returnMatrix;
- }
-
-
- private static function vlookupSort($a, $b)
- {
- reset($a);
- $firstColumn = key($a);
- if (($aLower = strtolower($a[$firstColumn])) == ($bLower = strtolower($b[$firstColumn]))) {
- return 0;
- }
- return ($aLower < $bLower) ? -1 : 1;
- }
-
-
- /**
- * VLOOKUP
- * The VLOOKUP function searches for value in the left-most column of lookup_array and returns the value in the same row based on the index_number.
- * @param lookup_value The value that you want to match in lookup_array
- * @param lookup_array The range of cells being searched
- * @param index_number The column number in table_array from which the matching value must be returned. The first column is 1.
- * @param not_exact_match Determines if you are looking for an exact match based on lookup_value.
- * @return mixed The value of the found cell
- */
- public static function VLOOKUP($lookup_value, $lookup_array, $index_number, $not_exact_match = true)
- {
- $lookup_value = PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value);
- $index_number = PHPExcel_Calculation_Functions::flattenSingleValue($index_number);
- $not_exact_match = PHPExcel_Calculation_Functions::flattenSingleValue($not_exact_match);
-
- // index_number must be greater than or equal to 1
- if ($index_number < 1) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
- // index_number must be less than or equal to the number of columns in lookup_array
- if ((!is_array($lookup_array)) || (empty($lookup_array))) {
- return PHPExcel_Calculation_Functions::REF();
- } else {
- $f = array_keys($lookup_array);
- $firstRow = array_pop($f);
- if ((!is_array($lookup_array[$firstRow])) || ($index_number > count($lookup_array[$firstRow]))) {
- return PHPExcel_Calculation_Functions::REF();
- } else {
- $columnKeys = array_keys($lookup_array[$firstRow]);
- $returnColumn = $columnKeys[--$index_number];
- $firstColumn = array_shift($columnKeys);
- }
- }
-
- if (!$not_exact_match) {
- uasort($lookup_array, array('self', 'vlookupSort'));
- }
-
- $rowNumber = $rowValue = false;
- foreach ($lookup_array as $rowKey => $rowData) {
- if ((is_numeric($lookup_value) && is_numeric($rowData[$firstColumn]) && ($rowData[$firstColumn] > $lookup_value)) ||
- (!is_numeric($lookup_value) && !is_numeric($rowData[$firstColumn]) && (strtolower($rowData[$firstColumn]) > strtolower($lookup_value)))) {
- break;
- }
- $rowNumber = $rowKey;
- $rowValue = $rowData[$firstColumn];
- }
-
- if ($rowNumber !== false) {
- if ((!$not_exact_match) && ($rowValue != $lookup_value)) {
- // if an exact match is required, we have what we need to return an appropriate response
- return PHPExcel_Calculation_Functions::NA();
- } else {
- // otherwise return the appropriate value
- return $lookup_array[$rowNumber][$returnColumn];
- }
- }
-
- return PHPExcel_Calculation_Functions::NA();
- }
-
-
- /**
- * HLOOKUP
- * The HLOOKUP function searches for value in the top-most row of lookup_array and returns the value in the same column based on the index_number.
- * @param lookup_value The value that you want to match in lookup_array
- * @param lookup_array The range of cells being searched
- * @param index_number The row number in table_array from which the matching value must be returned. The first row is 1.
- * @param not_exact_match Determines if you are looking for an exact match based on lookup_value.
- * @return mixed The value of the found cell
- */
- public static function HLOOKUP($lookup_value, $lookup_array, $index_number, $not_exact_match = true)
- {
- $lookup_value = PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value);
- $index_number = PHPExcel_Calculation_Functions::flattenSingleValue($index_number);
- $not_exact_match = PHPExcel_Calculation_Functions::flattenSingleValue($not_exact_match);
-
- // index_number must be greater than or equal to 1
- if ($index_number < 1) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
- // index_number must be less than or equal to the number of columns in lookup_array
- if ((!is_array($lookup_array)) || (empty($lookup_array))) {
- return PHPExcel_Calculation_Functions::REF();
- } else {
- $f = array_keys($lookup_array);
- $firstRow = array_pop($f);
- if ((!is_array($lookup_array[$firstRow])) || ($index_number > count($lookup_array[$firstRow]))) {
- return PHPExcel_Calculation_Functions::REF();
- } else {
- $columnKeys = array_keys($lookup_array[$firstRow]);
- $firstkey = $f[0] - 1;
- $returnColumn = $firstkey + $index_number;
- $firstColumn = array_shift($f);
- }
- }
-
- if (!$not_exact_match) {
- $firstRowH = asort($lookup_array[$firstColumn]);
- }
-
- $rowNumber = $rowValue = false;
- foreach ($lookup_array[$firstColumn] as $rowKey => $rowData) {
- if ((is_numeric($lookup_value) && is_numeric($rowData) && ($rowData > $lookup_value)) ||
- (!is_numeric($lookup_value) && !is_numeric($rowData) && (strtolower($rowData) > strtolower($lookup_value)))) {
- break;
- }
- $rowNumber = $rowKey;
- $rowValue = $rowData;
- }
-
- if ($rowNumber !== false) {
- if ((!$not_exact_match) && ($rowValue != $lookup_value)) {
- // if an exact match is required, we have what we need to return an appropriate response
- return PHPExcel_Calculation_Functions::NA();
- } else {
- // otherwise return the appropriate value
- return $lookup_array[$returnColumn][$rowNumber];
- }
- }
-
- return PHPExcel_Calculation_Functions::NA();
- }
-
-
- /**
- * LOOKUP
- * The LOOKUP function searches for value either from a one-row or one-column range or from an array.
- * @param lookup_value The value that you want to match in lookup_array
- * @param lookup_vector The range of cells being searched
- * @param result_vector The column from which the matching value must be returned
- * @return mixed The value of the found cell
- */
- public static function LOOKUP($lookup_value, $lookup_vector, $result_vector = null)
- {
- $lookup_value = PHPExcel_Calculation_Functions::flattenSingleValue($lookup_value);
-
- if (!is_array($lookup_vector)) {
- return PHPExcel_Calculation_Functions::NA();
- }
- $lookupRows = count($lookup_vector);
- $l = array_keys($lookup_vector);
- $l = array_shift($l);
- $lookupColumns = count($lookup_vector[$l]);
- if ((($lookupRows == 1) && ($lookupColumns > 1)) || (($lookupRows == 2) && ($lookupColumns != 2))) {
- $lookup_vector = self::TRANSPOSE($lookup_vector);
- $lookupRows = count($lookup_vector);
- $l = array_keys($lookup_vector);
- $lookupColumns = count($lookup_vector[array_shift($l)]);
- }
-
- if (is_null($result_vector)) {
- $result_vector = $lookup_vector;
- }
- $resultRows = count($result_vector);
- $l = array_keys($result_vector);
- $l = array_shift($l);
- $resultColumns = count($result_vector[$l]);
- if ((($resultRows == 1) && ($resultColumns > 1)) || (($resultRows == 2) && ($resultColumns != 2))) {
- $result_vector = self::TRANSPOSE($result_vector);
- $resultRows = count($result_vector);
- $r = array_keys($result_vector);
- $resultColumns = count($result_vector[array_shift($r)]);
- }
-
- if ($lookupRows == 2) {
- $result_vector = array_pop($lookup_vector);
- $lookup_vector = array_shift($lookup_vector);
- }
- if ($lookupColumns != 2) {
- foreach ($lookup_vector as &$value) {
- if (is_array($value)) {
- $k = array_keys($value);
- $key1 = $key2 = array_shift($k);
- $key2++;
- $dataValue1 = $value[$key1];
- } else {
- $key1 = 0;
- $key2 = 1;
- $dataValue1 = $value;
- }
- $dataValue2 = array_shift($result_vector);
- if (is_array($dataValue2)) {
- $dataValue2 = array_shift($dataValue2);
- }
- $value = array($key1 => $dataValue1, $key2 => $dataValue2);
- }
- unset($value);
- }
-
- return self::VLOOKUP($lookup_value, $lookup_vector, 2);
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Calculation/TextData.php b/lib/phpexcel/PHPExcel/Calculation/TextData.php
deleted file mode 100644
index 6461d060160..00000000000
--- a/lib/phpexcel/PHPExcel/Calculation/TextData.php
+++ /dev/null
@@ -1,651 +0,0 @@
-=0 && ord($c{0}) <= 127) {
- return ord($c{0});
- } elseif (ord($c{0}) >= 192 && ord($c{0}) <= 223) {
- return (ord($c{0})-192)*64 + (ord($c{1})-128);
- } elseif (ord($c{0}) >= 224 && ord($c{0}) <= 239) {
- return (ord($c{0})-224)*4096 + (ord($c{1})-128)*64 + (ord($c{2})-128);
- } elseif (ord($c{0}) >= 240 && ord($c{0}) <= 247) {
- return (ord($c{0})-240)*262144 + (ord($c{1})-128)*4096 + (ord($c{2})-128)*64 + (ord($c{3})-128);
- } elseif (ord($c{0}) >= 248 && ord($c{0}) <= 251) {
- return (ord($c{0})-248)*16777216 + (ord($c{1})-128)*262144 + (ord($c{2})-128)*4096 + (ord($c{3})-128)*64 + (ord($c{4})-128);
- } elseif (ord($c{0}) >= 252 && ord($c{0}) <= 253) {
- return (ord($c{0})-252)*1073741824 + (ord($c{1})-128)*16777216 + (ord($c{2})-128)*262144 + (ord($c{3})-128)*4096 + (ord($c{4})-128)*64 + (ord($c{5})-128);
- } elseif (ord($c{0}) >= 254 && ord($c{0}) <= 255) {
- // error
- return PHPExcel_Calculation_Functions::VALUE();
- }
- return 0;
- }
-
- /**
- * CHARACTER
- *
- * @param string $character Value
- * @return int
- */
- public static function CHARACTER($character)
- {
- $character = PHPExcel_Calculation_Functions::flattenSingleValue($character);
-
- if ((!is_numeric($character)) || ($character < 0)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
- if (function_exists('mb_convert_encoding')) {
- return mb_convert_encoding(''.intval($character).';', 'UTF-8', 'HTML-ENTITIES');
- } else {
- return chr(intval($character));
- }
- }
-
-
- /**
- * TRIMNONPRINTABLE
- *
- * @param mixed $stringValue Value to check
- * @return string
- */
- public static function TRIMNONPRINTABLE($stringValue = '')
- {
- $stringValue = PHPExcel_Calculation_Functions::flattenSingleValue($stringValue);
-
- if (is_bool($stringValue)) {
- return ($stringValue) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
- }
-
- if (self::$invalidChars == null) {
- self::$invalidChars = range(chr(0), chr(31));
- }
-
- if (is_string($stringValue) || is_numeric($stringValue)) {
- return str_replace(self::$invalidChars, '', trim($stringValue, "\x00..\x1F"));
- }
- return null;
- }
-
-
- /**
- * TRIMSPACES
- *
- * @param mixed $stringValue Value to check
- * @return string
- */
- public static function TRIMSPACES($stringValue = '')
- {
- $stringValue = PHPExcel_Calculation_Functions::flattenSingleValue($stringValue);
- if (is_bool($stringValue)) {
- return ($stringValue) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
- }
-
- if (is_string($stringValue) || is_numeric($stringValue)) {
- return trim(preg_replace('/ +/', ' ', trim($stringValue, ' ')), ' ');
- }
- return null;
- }
-
-
- /**
- * ASCIICODE
- *
- * @param string $characters Value
- * @return int
- */
- public static function ASCIICODE($characters)
- {
- if (($characters === null) || ($characters === '')) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
- $characters = PHPExcel_Calculation_Functions::flattenSingleValue($characters);
- if (is_bool($characters)) {
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
- $characters = (int) $characters;
- } else {
- $characters = ($characters) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
- }
- }
-
- $character = $characters;
- if ((function_exists('mb_strlen')) && (function_exists('mb_substr'))) {
- if (mb_strlen($characters, 'UTF-8') > 1) {
- $character = mb_substr($characters, 0, 1, 'UTF-8');
- }
- return self::unicodeToOrd($character);
- } else {
- if (strlen($characters) > 0) {
- $character = substr($characters, 0, 1);
- }
- return ord($character);
- }
- }
-
-
- /**
- * CONCATENATE
- *
- * @return string
- */
- public static function CONCATENATE()
- {
- $returnValue = '';
-
- // Loop through arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
- foreach ($aArgs as $arg) {
- if (is_bool($arg)) {
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
- $arg = (int) $arg;
- } else {
- $arg = ($arg) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
- }
- }
- $returnValue .= $arg;
- }
-
- return $returnValue;
- }
-
-
- /**
- * DOLLAR
- *
- * This function converts a number to text using currency format, with the decimals rounded to the specified place.
- * The format used is $#,##0.00_);($#,##0.00)..
- *
- * @param float $value The value to format
- * @param int $decimals The number of digits to display to the right of the decimal point.
- * If decimals is negative, number is rounded to the left of the decimal point.
- * If you omit decimals, it is assumed to be 2
- * @return string
- */
- public static function DOLLAR($value = 0, $decimals = 2)
- {
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $decimals = is_null($decimals) ? 0 : PHPExcel_Calculation_Functions::flattenSingleValue($decimals);
-
- // Validate parameters
- if (!is_numeric($value) || !is_numeric($decimals)) {
- return PHPExcel_Calculation_Functions::NaN();
- }
- $decimals = floor($decimals);
-
- $mask = '$#,##0';
- if ($decimals > 0) {
- $mask .= '.' . str_repeat('0', $decimals);
- } else {
- $round = pow(10, abs($decimals));
- if ($value < 0) {
- $round = 0-$round;
- }
- $value = PHPExcel_Calculation_MathTrig::MROUND($value, $round);
- }
-
- return PHPExcel_Style_NumberFormat::toFormattedString($value, $mask);
-
- }
-
-
- /**
- * SEARCHSENSITIVE
- *
- * @param string $needle The string to look for
- * @param string $haystack The string in which to look
- * @param int $offset Offset within $haystack
- * @return string
- */
- public static function SEARCHSENSITIVE($needle, $haystack, $offset = 1)
- {
- $needle = PHPExcel_Calculation_Functions::flattenSingleValue($needle);
- $haystack = PHPExcel_Calculation_Functions::flattenSingleValue($haystack);
- $offset = PHPExcel_Calculation_Functions::flattenSingleValue($offset);
-
- if (!is_bool($needle)) {
- if (is_bool($haystack)) {
- $haystack = ($haystack) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
- }
-
- if (($offset > 0) && (PHPExcel_Shared_String::CountCharacters($haystack) > $offset)) {
- if (PHPExcel_Shared_String::CountCharacters($needle) == 0) {
- return $offset;
- }
- if (function_exists('mb_strpos')) {
- $pos = mb_strpos($haystack, $needle, --$offset, 'UTF-8');
- } else {
- $pos = strpos($haystack, $needle, --$offset);
- }
- if ($pos !== false) {
- return ++$pos;
- }
- }
- }
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
-
- /**
- * SEARCHINSENSITIVE
- *
- * @param string $needle The string to look for
- * @param string $haystack The string in which to look
- * @param int $offset Offset within $haystack
- * @return string
- */
- public static function SEARCHINSENSITIVE($needle, $haystack, $offset = 1)
- {
- $needle = PHPExcel_Calculation_Functions::flattenSingleValue($needle);
- $haystack = PHPExcel_Calculation_Functions::flattenSingleValue($haystack);
- $offset = PHPExcel_Calculation_Functions::flattenSingleValue($offset);
-
- if (!is_bool($needle)) {
- if (is_bool($haystack)) {
- $haystack = ($haystack) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
- }
-
- if (($offset > 0) && (PHPExcel_Shared_String::CountCharacters($haystack) > $offset)) {
- if (PHPExcel_Shared_String::CountCharacters($needle) == 0) {
- return $offset;
- }
- if (function_exists('mb_stripos')) {
- $pos = mb_stripos($haystack, $needle, --$offset, 'UTF-8');
- } else {
- $pos = stripos($haystack, $needle, --$offset);
- }
- if ($pos !== false) {
- return ++$pos;
- }
- }
- }
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
-
- /**
- * FIXEDFORMAT
- *
- * @param mixed $value Value to check
- * @param integer $decimals
- * @param boolean $no_commas
- * @return boolean
- */
- public static function FIXEDFORMAT($value, $decimals = 2, $no_commas = false)
- {
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $decimals = PHPExcel_Calculation_Functions::flattenSingleValue($decimals);
- $no_commas = PHPExcel_Calculation_Functions::flattenSingleValue($no_commas);
-
- // Validate parameters
- if (!is_numeric($value) || !is_numeric($decimals)) {
- return PHPExcel_Calculation_Functions::NaN();
- }
- $decimals = floor($decimals);
-
- $valueResult = round($value, $decimals);
- if ($decimals < 0) {
- $decimals = 0;
- }
- if (!$no_commas) {
- $valueResult = number_format($valueResult, $decimals);
- }
-
- return (string) $valueResult;
- }
-
-
- /**
- * LEFT
- *
- * @param string $value Value
- * @param int $chars Number of characters
- * @return string
- */
- public static function LEFT($value = '', $chars = 1)
- {
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $chars = PHPExcel_Calculation_Functions::flattenSingleValue($chars);
-
- if ($chars < 0) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
- if (is_bool($value)) {
- $value = ($value) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
- }
-
- if (function_exists('mb_substr')) {
- return mb_substr($value, 0, $chars, 'UTF-8');
- } else {
- return substr($value, 0, $chars);
- }
- }
-
-
- /**
- * MID
- *
- * @param string $value Value
- * @param int $start Start character
- * @param int $chars Number of characters
- * @return string
- */
- public static function MID($value = '', $start = 1, $chars = null)
- {
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $start = PHPExcel_Calculation_Functions::flattenSingleValue($start);
- $chars = PHPExcel_Calculation_Functions::flattenSingleValue($chars);
-
- if (($start < 1) || ($chars < 0)) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
- if (is_bool($value)) {
- $value = ($value) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
- }
-
- if (function_exists('mb_substr')) {
- return mb_substr($value, --$start, $chars, 'UTF-8');
- } else {
- return substr($value, --$start, $chars);
- }
- }
-
-
- /**
- * RIGHT
- *
- * @param string $value Value
- * @param int $chars Number of characters
- * @return string
- */
- public static function RIGHT($value = '', $chars = 1)
- {
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $chars = PHPExcel_Calculation_Functions::flattenSingleValue($chars);
-
- if ($chars < 0) {
- return PHPExcel_Calculation_Functions::VALUE();
- }
-
- if (is_bool($value)) {
- $value = ($value) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
- }
-
- if ((function_exists('mb_substr')) && (function_exists('mb_strlen'))) {
- return mb_substr($value, mb_strlen($value, 'UTF-8') - $chars, $chars, 'UTF-8');
- } else {
- return substr($value, strlen($value) - $chars);
- }
- }
-
-
- /**
- * STRINGLENGTH
- *
- * @param string $value Value
- * @return string
- */
- public static function STRINGLENGTH($value = '')
- {
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
-
- if (is_bool($value)) {
- $value = ($value) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
- }
-
- if (function_exists('mb_strlen')) {
- return mb_strlen($value, 'UTF-8');
- } else {
- return strlen($value);
- }
- }
-
-
- /**
- * LOWERCASE
- *
- * Converts a string value to upper case.
- *
- * @param string $mixedCaseString
- * @return string
- */
- public static function LOWERCASE($mixedCaseString)
- {
- $mixedCaseString = PHPExcel_Calculation_Functions::flattenSingleValue($mixedCaseString);
-
- if (is_bool($mixedCaseString)) {
- $mixedCaseString = ($mixedCaseString) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
- }
-
- return PHPExcel_Shared_String::StrToLower($mixedCaseString);
- }
-
-
- /**
- * UPPERCASE
- *
- * Converts a string value to upper case.
- *
- * @param string $mixedCaseString
- * @return string
- */
- public static function UPPERCASE($mixedCaseString)
- {
- $mixedCaseString = PHPExcel_Calculation_Functions::flattenSingleValue($mixedCaseString);
-
- if (is_bool($mixedCaseString)) {
- $mixedCaseString = ($mixedCaseString) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
- }
-
- return PHPExcel_Shared_String::StrToUpper($mixedCaseString);
- }
-
-
- /**
- * PROPERCASE
- *
- * Converts a string value to upper case.
- *
- * @param string $mixedCaseString
- * @return string
- */
- public static function PROPERCASE($mixedCaseString)
- {
- $mixedCaseString = PHPExcel_Calculation_Functions::flattenSingleValue($mixedCaseString);
-
- if (is_bool($mixedCaseString)) {
- $mixedCaseString = ($mixedCaseString) ? PHPExcel_Calculation::getTRUE() : PHPExcel_Calculation::getFALSE();
- }
-
- return PHPExcel_Shared_String::StrToTitle($mixedCaseString);
- }
-
-
- /**
- * REPLACE
- *
- * @param string $oldText String to modify
- * @param int $start Start character
- * @param int $chars Number of characters
- * @param string $newText String to replace in defined position
- * @return string
- */
- public static function REPLACE($oldText = '', $start = 1, $chars = null, $newText)
- {
- $oldText = PHPExcel_Calculation_Functions::flattenSingleValue($oldText);
- $start = PHPExcel_Calculation_Functions::flattenSingleValue($start);
- $chars = PHPExcel_Calculation_Functions::flattenSingleValue($chars);
- $newText = PHPExcel_Calculation_Functions::flattenSingleValue($newText);
-
- $left = self::LEFT($oldText, $start-1);
- $right = self::RIGHT($oldText, self::STRINGLENGTH($oldText)-($start+$chars)+1);
-
- return $left.$newText.$right;
- }
-
-
- /**
- * SUBSTITUTE
- *
- * @param string $text Value
- * @param string $fromText From Value
- * @param string $toText To Value
- * @param integer $instance Instance Number
- * @return string
- */
- public static function SUBSTITUTE($text = '', $fromText = '', $toText = '', $instance = 0)
- {
- $text = PHPExcel_Calculation_Functions::flattenSingleValue($text);
- $fromText = PHPExcel_Calculation_Functions::flattenSingleValue($fromText);
- $toText = PHPExcel_Calculation_Functions::flattenSingleValue($toText);
- $instance = floor(PHPExcel_Calculation_Functions::flattenSingleValue($instance));
-
- if ($instance == 0) {
- if (function_exists('mb_str_replace')) {
- return mb_str_replace($fromText, $toText, $text);
- } else {
- return str_replace($fromText, $toText, $text);
- }
- } else {
- $pos = -1;
- while ($instance > 0) {
- if (function_exists('mb_strpos')) {
- $pos = mb_strpos($text, $fromText, $pos+1, 'UTF-8');
- } else {
- $pos = strpos($text, $fromText, $pos+1);
- }
- if ($pos === false) {
- break;
- }
- --$instance;
- }
- if ($pos !== false) {
- if (function_exists('mb_strlen')) {
- return self::REPLACE($text, ++$pos, mb_strlen($fromText, 'UTF-8'), $toText);
- } else {
- return self::REPLACE($text, ++$pos, strlen($fromText), $toText);
- }
- }
- }
-
- return $text;
- }
-
-
- /**
- * RETURNSTRING
- *
- * @param mixed $testValue Value to check
- * @return boolean
- */
- public static function RETURNSTRING($testValue = '')
- {
- $testValue = PHPExcel_Calculation_Functions::flattenSingleValue($testValue);
-
- if (is_string($testValue)) {
- return $testValue;
- }
- return null;
- }
-
-
- /**
- * TEXTFORMAT
- *
- * @param mixed $value Value to check
- * @param string $format Format mask to use
- * @return boolean
- */
- public static function TEXTFORMAT($value, $format)
- {
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $format = PHPExcel_Calculation_Functions::flattenSingleValue($format);
-
- if ((is_string($value)) && (!is_numeric($value)) && PHPExcel_Shared_Date::isDateTimeFormatCode($format)) {
- $value = PHPExcel_Calculation_DateTime::DATEVALUE($value);
- }
-
- return (string) PHPExcel_Style_NumberFormat::toFormattedString($value, $format);
- }
-
- /**
- * VALUE
- *
- * @param mixed $value Value to check
- * @return boolean
- */
- public static function VALUE($value = '')
- {
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
-
- if (!is_numeric($value)) {
- $numberValue = str_replace(
- PHPExcel_Shared_String::getThousandsSeparator(),
- '',
- trim($value, " \t\n\r\0\x0B" . PHPExcel_Shared_String::getCurrencyCode())
- );
- if (is_numeric($numberValue)) {
- return (float) $numberValue;
- }
-
- $dateSetting = PHPExcel_Calculation_Functions::getReturnDateType();
- PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
-
- if (strpos($value, ':') !== false) {
- $timeValue = PHPExcel_Calculation_DateTime::TIMEVALUE($value);
- if ($timeValue !== PHPExcel_Calculation_Functions::VALUE()) {
- PHPExcel_Calculation_Functions::setReturnDateType($dateSetting);
- return $timeValue;
- }
- }
- $dateValue = PHPExcel_Calculation_DateTime::DATEVALUE($value);
- if ($dateValue !== PHPExcel_Calculation_Functions::VALUE()) {
- PHPExcel_Calculation_Functions::setReturnDateType($dateSetting);
- return $dateValue;
- }
- PHPExcel_Calculation_Functions::setReturnDateType($dateSetting);
-
- return PHPExcel_Calculation_Functions::VALUE();
- }
- return (float) $value;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Calculation/Token/Stack.php b/lib/phpexcel/PHPExcel/Calculation/Token/Stack.php
deleted file mode 100644
index 02ed5aaf01b..00000000000
--- a/lib/phpexcel/PHPExcel/Calculation/Token/Stack.php
+++ /dev/null
@@ -1,111 +0,0 @@
-count;
- }
-
- /**
- * Push a new entry onto the stack
- *
- * @param mixed $type
- * @param mixed $value
- * @param mixed $reference
- */
- public function push($type, $value, $reference = null)
- {
- $this->stack[$this->count++] = array(
- 'type' => $type,
- 'value' => $value,
- 'reference' => $reference
- );
- if ($type == 'Function') {
- $localeFunction = PHPExcel_Calculation::localeFunc($value);
- if ($localeFunction != $value) {
- $this->stack[($this->count - 1)]['localeValue'] = $localeFunction;
- }
- }
- }
-
- /**
- * Pop the last entry from the stack
- *
- * @return mixed
- */
- public function pop()
- {
- if ($this->count > 0) {
- return $this->stack[--$this->count];
- }
- return null;
- }
-
- /**
- * Return an entry from the stack without removing it
- *
- * @param integer $n number indicating how far back in the stack we want to look
- * @return mixed
- */
- public function last($n = 1)
- {
- if ($this->count - $n < 0) {
- return null;
- }
- return $this->stack[$this->count - $n];
- }
-
- /**
- * Clear the stack
- */
- public function clear()
- {
- $this->stack = array();
- $this->count = 0;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Cell.php b/lib/phpexcel/PHPExcel/Cell.php
deleted file mode 100644
index c99a3c8b188..00000000000
--- a/lib/phpexcel/PHPExcel/Cell.php
+++ /dev/null
@@ -1,1032 +0,0 @@
-parent->updateCacheData($this);
-
- return $this;
- }
-
- public function detach()
- {
- $this->parent = null;
- }
-
- public function attach(PHPExcel_CachedObjectStorage_CacheBase $parent)
- {
- $this->parent = $parent;
- }
-
-
- /**
- * Create a new Cell
- *
- * @param mixed $pValue
- * @param string $pDataType
- * @param PHPExcel_Worksheet $pSheet
- * @throws PHPExcel_Exception
- */
- public function __construct($pValue = null, $pDataType = null, PHPExcel_Worksheet $pSheet = null)
- {
- // Initialise cell value
- $this->value = $pValue;
-
- // Set worksheet cache
- $this->parent = $pSheet->getCellCacheController();
-
- // Set datatype?
- if ($pDataType !== null) {
- if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2) {
- $pDataType = PHPExcel_Cell_DataType::TYPE_STRING;
- }
- $this->dataType = $pDataType;
- } elseif (!self::getValueBinder()->bindValue($this, $pValue)) {
- throw new PHPExcel_Exception("Value could not be bound to cell.");
- }
- }
-
- /**
- * Get cell coordinate column
- *
- * @return string
- */
- public function getColumn()
- {
- return $this->parent->getCurrentColumn();
- }
-
- /**
- * Get cell coordinate row
- *
- * @return int
- */
- public function getRow()
- {
- return $this->parent->getCurrentRow();
- }
-
- /**
- * Get cell coordinate
- *
- * @return string
- */
- public function getCoordinate()
- {
- return $this->parent->getCurrentAddress();
- }
-
- /**
- * Get cell value
- *
- * @return mixed
- */
- public function getValue()
- {
- return $this->value;
- }
-
- /**
- * Get cell value with formatting
- *
- * @return string
- */
- public function getFormattedValue()
- {
- return (string) PHPExcel_Style_NumberFormat::toFormattedString(
- $this->getCalculatedValue(),
- $this->getStyle()
- ->getNumberFormat()->getFormatCode()
- );
- }
-
- /**
- * Set cell value
- *
- * Sets the value for a cell, automatically determining the datatype using the value binder
- *
- * @param mixed $pValue Value
- * @return PHPExcel_Cell
- * @throws PHPExcel_Exception
- */
- public function setValue($pValue = null)
- {
- if (!self::getValueBinder()->bindValue($this, $pValue)) {
- throw new PHPExcel_Exception("Value could not be bound to cell.");
- }
- return $this;
- }
-
- /**
- * Set the value for a cell, with the explicit data type passed to the method (bypassing any use of the value binder)
- *
- * @param mixed $pValue Value
- * @param string $pDataType Explicit data type
- * @return PHPExcel_Cell
- * @throws PHPExcel_Exception
- */
- public function setValueExplicit($pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING)
- {
- // set the value according to data type
- switch ($pDataType) {
- case PHPExcel_Cell_DataType::TYPE_NULL:
- $this->value = $pValue;
- break;
- case PHPExcel_Cell_DataType::TYPE_STRING2:
- $pDataType = PHPExcel_Cell_DataType::TYPE_STRING;
- // no break
- case PHPExcel_Cell_DataType::TYPE_STRING:
- // Synonym for string
- case PHPExcel_Cell_DataType::TYPE_INLINE:
- // Rich text
- $this->value = PHPExcel_Cell_DataType::checkString($pValue);
- break;
- case PHPExcel_Cell_DataType::TYPE_NUMERIC:
- $this->value = (float) $pValue;
- break;
- case PHPExcel_Cell_DataType::TYPE_FORMULA:
- $this->value = (string) $pValue;
- break;
- case PHPExcel_Cell_DataType::TYPE_BOOL:
- $this->value = (bool) $pValue;
- break;
- case PHPExcel_Cell_DataType::TYPE_ERROR:
- $this->value = PHPExcel_Cell_DataType::checkErrorCode($pValue);
- break;
- default:
- throw new PHPExcel_Exception('Invalid datatype: ' . $pDataType);
- break;
- }
-
- // set the datatype
- $this->dataType = $pDataType;
-
- return $this->notifyCacheController();
- }
-
- /**
- * Get calculated cell value
- *
- * @deprecated Since version 1.7.8 for planned changes to cell for array formula handling
- *
- * @param boolean $resetLog Whether the calculation engine logger should be reset or not
- * @return mixed
- * @throws PHPExcel_Exception
- */
- public function getCalculatedValue($resetLog = true)
- {
-//echo 'Cell '.$this->getCoordinate().' value is a '.$this->dataType.' with a value of '.$this->getValue().PHP_EOL;
- if ($this->dataType == PHPExcel_Cell_DataType::TYPE_FORMULA) {
- try {
-//echo 'Cell value for '.$this->getCoordinate().' is a formula: Calculating value'.PHP_EOL;
- $result = PHPExcel_Calculation::getInstance(
- $this->getWorksheet()->getParent()
- )->calculateCellValue($this, $resetLog);
-//echo $this->getCoordinate().' calculation result is '.$result.PHP_EOL;
- // We don't yet handle array returns
- if (is_array($result)) {
- while (is_array($result)) {
- $result = array_pop($result);
- }
- }
- } catch (PHPExcel_Exception $ex) {
- if (($ex->getMessage() === 'Unable to access External Workbook') && ($this->calculatedValue !== null)) {
-//echo 'Returning fallback value of '.$this->calculatedValue.' for cell '.$this->getCoordinate().PHP_EOL;
- return $this->calculatedValue; // Fallback for calculations referencing external files.
- }
-//echo 'Calculation Exception: '.$ex->getMessage().PHP_EOL;
- $result = '#N/A';
- throw new PHPExcel_Calculation_Exception(
- $this->getWorksheet()->getTitle().'!'.$this->getCoordinate().' -> '.$ex->getMessage()
- );
- }
-
- if ($result === '#Not Yet Implemented') {
-//echo 'Returning fallback value of '.$this->calculatedValue.' for cell '.$this->getCoordinate().PHP_EOL;
- return $this->calculatedValue; // Fallback if calculation engine does not support the formula.
- }
-//echo 'Returning calculated value of '.$result.' for cell '.$this->getCoordinate().PHP_EOL;
- return $result;
- } elseif ($this->value instanceof PHPExcel_RichText) {
-// echo 'Cell value for '.$this->getCoordinate().' is rich text: Returning data value of '.$this->value.'
';
- return $this->value->getPlainText();
- }
-// echo 'Cell value for '.$this->getCoordinate().' is not a formula: Returning data value of '.$this->value.'
';
- return $this->value;
- }
-
- /**
- * Set old calculated value (cached)
- *
- * @param mixed $pValue Value
- * @return PHPExcel_Cell
- */
- public function setCalculatedValue($pValue = null)
- {
- if ($pValue !== null) {
- $this->calculatedValue = (is_numeric($pValue)) ? (float) $pValue : $pValue;
- }
-
- return $this->notifyCacheController();
- }
-
- /**
- * Get old calculated value (cached)
- * This returns the value last calculated by MS Excel or whichever spreadsheet program was used to
- * create the original spreadsheet file.
- * Note that this value is not guaranteed to refelect the actual calculated value because it is
- * possible that auto-calculation was disabled in the original spreadsheet, and underlying data
- * values used by the formula have changed since it was last calculated.
- *
- * @return mixed
- */
- public function getOldCalculatedValue()
- {
- return $this->calculatedValue;
- }
-
- /**
- * Get cell data type
- *
- * @return string
- */
- public function getDataType()
- {
- return $this->dataType;
- }
-
- /**
- * Set cell data type
- *
- * @param string $pDataType
- * @return PHPExcel_Cell
- */
- public function setDataType($pDataType = PHPExcel_Cell_DataType::TYPE_STRING)
- {
- if ($pDataType == PHPExcel_Cell_DataType::TYPE_STRING2) {
- $pDataType = PHPExcel_Cell_DataType::TYPE_STRING;
- }
- $this->dataType = $pDataType;
-
- return $this->notifyCacheController();
- }
-
- /**
- * Identify if the cell contains a formula
- *
- * @return boolean
- */
- public function isFormula()
- {
- return $this->dataType == PHPExcel_Cell_DataType::TYPE_FORMULA;
- }
-
- /**
- * Does this cell contain Data validation rules?
- *
- * @return boolean
- * @throws PHPExcel_Exception
- */
- public function hasDataValidation()
- {
- if (!isset($this->parent)) {
- throw new PHPExcel_Exception('Cannot check for data validation when cell is not bound to a worksheet');
- }
-
- return $this->getWorksheet()->dataValidationExists($this->getCoordinate());
- }
-
- /**
- * Get Data validation rules
- *
- * @return PHPExcel_Cell_DataValidation
- * @throws PHPExcel_Exception
- */
- public function getDataValidation()
- {
- if (!isset($this->parent)) {
- throw new PHPExcel_Exception('Cannot get data validation for cell that is not bound to a worksheet');
- }
-
- return $this->getWorksheet()->getDataValidation($this->getCoordinate());
- }
-
- /**
- * Set Data validation rules
- *
- * @param PHPExcel_Cell_DataValidation $pDataValidation
- * @return PHPExcel_Cell
- * @throws PHPExcel_Exception
- */
- public function setDataValidation(PHPExcel_Cell_DataValidation $pDataValidation = null)
- {
- if (!isset($this->parent)) {
- throw new PHPExcel_Exception('Cannot set data validation for cell that is not bound to a worksheet');
- }
-
- $this->getWorksheet()->setDataValidation($this->getCoordinate(), $pDataValidation);
-
- return $this->notifyCacheController();
- }
-
- /**
- * Does this cell contain a Hyperlink?
- *
- * @return boolean
- * @throws PHPExcel_Exception
- */
- public function hasHyperlink()
- {
- if (!isset($this->parent)) {
- throw new PHPExcel_Exception('Cannot check for hyperlink when cell is not bound to a worksheet');
- }
-
- return $this->getWorksheet()->hyperlinkExists($this->getCoordinate());
- }
-
- /**
- * Get Hyperlink
- *
- * @return PHPExcel_Cell_Hyperlink
- * @throws PHPExcel_Exception
- */
- public function getHyperlink()
- {
- if (!isset($this->parent)) {
- throw new PHPExcel_Exception('Cannot get hyperlink for cell that is not bound to a worksheet');
- }
-
- return $this->getWorksheet()->getHyperlink($this->getCoordinate());
- }
-
- /**
- * Set Hyperlink
- *
- * @param PHPExcel_Cell_Hyperlink $pHyperlink
- * @return PHPExcel_Cell
- * @throws PHPExcel_Exception
- */
- public function setHyperlink(PHPExcel_Cell_Hyperlink $pHyperlink = null)
- {
- if (!isset($this->parent)) {
- throw new PHPExcel_Exception('Cannot set hyperlink for cell that is not bound to a worksheet');
- }
-
- $this->getWorksheet()->setHyperlink($this->getCoordinate(), $pHyperlink);
-
- return $this->notifyCacheController();
- }
-
- /**
- * Get parent worksheet
- *
- * @return PHPExcel_CachedObjectStorage_CacheBase
- */
- public function getParent()
- {
- return $this->parent;
- }
-
- /**
- * Get parent worksheet
- *
- * @return PHPExcel_Worksheet
- */
- public function getWorksheet()
- {
- return $this->parent->getParent();
- }
-
- /**
- * Is this cell in a merge range
- *
- * @return boolean
- */
- public function isInMergeRange()
- {
- return (boolean) $this->getMergeRange();
- }
-
- /**
- * Is this cell the master (top left cell) in a merge range (that holds the actual data value)
- *
- * @return boolean
- */
- public function isMergeRangeValueCell()
- {
- if ($mergeRange = $this->getMergeRange()) {
- $mergeRange = PHPExcel_Cell::splitRange($mergeRange);
- list($startCell) = $mergeRange[0];
- if ($this->getCoordinate() === $startCell) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * If this cell is in a merge range, then return the range
- *
- * @return string
- */
- public function getMergeRange()
- {
- foreach ($this->getWorksheet()->getMergeCells() as $mergeRange) {
- if ($this->isInRange($mergeRange)) {
- return $mergeRange;
- }
- }
- return false;
- }
-
- /**
- * Get cell style
- *
- * @return PHPExcel_Style
- */
- public function getStyle()
- {
- return $this->getWorksheet()->getStyle($this->getCoordinate());
- }
-
- /**
- * Re-bind parent
- *
- * @param PHPExcel_Worksheet $parent
- * @return PHPExcel_Cell
- */
- public function rebindParent(PHPExcel_Worksheet $parent)
- {
- $this->parent = $parent->getCellCacheController();
-
- return $this->notifyCacheController();
- }
-
- /**
- * Is cell in a specific range?
- *
- * @param string $pRange Cell range (e.g. A1:A1)
- * @return boolean
- */
- public function isInRange($pRange = 'A1:A1')
- {
- list($rangeStart, $rangeEnd) = self::rangeBoundaries($pRange);
-
- // Translate properties
- $myColumn = self::columnIndexFromString($this->getColumn());
- $myRow = $this->getRow();
-
- // Verify if cell is in range
- return (($rangeStart[0] <= $myColumn) && ($rangeEnd[0] >= $myColumn) &&
- ($rangeStart[1] <= $myRow) && ($rangeEnd[1] >= $myRow)
- );
- }
-
- /**
- * Coordinate from string
- *
- * @param string $pCoordinateString
- * @return array Array containing column and row (indexes 0 and 1)
- * @throws PHPExcel_Exception
- */
- public static function coordinateFromString($pCoordinateString = 'A1')
- {
- if (preg_match("/^([$]?[A-Z]{1,3})([$]?\d{1,7})$/", $pCoordinateString, $matches)) {
- return array($matches[1],$matches[2]);
- } elseif ((strpos($pCoordinateString, ':') !== false) || (strpos($pCoordinateString, ',') !== false)) {
- throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells');
- } elseif ($pCoordinateString == '') {
- throw new PHPExcel_Exception('Cell coordinate can not be zero-length string');
- }
-
- throw new PHPExcel_Exception('Invalid cell coordinate '.$pCoordinateString);
- }
-
- /**
- * Make string row, column or cell coordinate absolute
- *
- * @param string $pCoordinateString e.g. 'A' or '1' or 'A1'
- * Note that this value can be a row or column reference as well as a cell reference
- * @return string Absolute coordinate e.g. '$A' or '$1' or '$A$1'
- * @throws PHPExcel_Exception
- */
- public static function absoluteReference($pCoordinateString = 'A1')
- {
- if (strpos($pCoordinateString, ':') === false && strpos($pCoordinateString, ',') === false) {
- // Split out any worksheet name from the reference
- $worksheet = '';
- $cellAddress = explode('!', $pCoordinateString);
- if (count($cellAddress) > 1) {
- list($worksheet, $pCoordinateString) = $cellAddress;
- }
- if ($worksheet > '') {
- $worksheet .= '!';
- }
-
- // Create absolute coordinate
- if (ctype_digit($pCoordinateString)) {
- return $worksheet . '$' . $pCoordinateString;
- } elseif (ctype_alpha($pCoordinateString)) {
- return $worksheet . '$' . strtoupper($pCoordinateString);
- }
- return $worksheet . self::absoluteCoordinate($pCoordinateString);
- }
-
- throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells');
- }
-
- /**
- * Make string coordinate absolute
- *
- * @param string $pCoordinateString e.g. 'A1'
- * @return string Absolute coordinate e.g. '$A$1'
- * @throws PHPExcel_Exception
- */
- public static function absoluteCoordinate($pCoordinateString = 'A1')
- {
- if (strpos($pCoordinateString, ':') === false && strpos($pCoordinateString, ',') === false) {
- // Split out any worksheet name from the coordinate
- $worksheet = '';
- $cellAddress = explode('!', $pCoordinateString);
- if (count($cellAddress) > 1) {
- list($worksheet, $pCoordinateString) = $cellAddress;
- }
- if ($worksheet > '') {
- $worksheet .= '!';
- }
-
- // Create absolute coordinate
- list($column, $row) = self::coordinateFromString($pCoordinateString);
- $column = ltrim($column, '$');
- $row = ltrim($row, '$');
- return $worksheet . '$' . $column . '$' . $row;
- }
-
- throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells');
- }
-
- /**
- * Split range into coordinate strings
- *
- * @param string $pRange e.g. 'B4:D9' or 'B4:D9,H2:O11' or 'B4'
- * @return array Array containg one or more arrays containing one or two coordinate strings
- * e.g. array('B4','D9') or array(array('B4','D9'),array('H2','O11'))
- * or array('B4')
- */
- public static function splitRange($pRange = 'A1:A1')
- {
- // Ensure $pRange is a valid range
- if (empty($pRange)) {
- $pRange = self::DEFAULT_RANGE;
- }
-
- $exploded = explode(',', $pRange);
- $counter = count($exploded);
- for ($i = 0; $i < $counter; ++$i) {
- $exploded[$i] = explode(':', $exploded[$i]);
- }
- return $exploded;
- }
-
- /**
- * Build range from coordinate strings
- *
- * @param array $pRange Array containg one or more arrays containing one or two coordinate strings
- * @return string String representation of $pRange
- * @throws PHPExcel_Exception
- */
- public static function buildRange($pRange)
- {
- // Verify range
- if (!is_array($pRange) || empty($pRange) || !is_array($pRange[0])) {
- throw new PHPExcel_Exception('Range does not contain any information');
- }
-
- // Build range
- $imploded = array();
- $counter = count($pRange);
- for ($i = 0; $i < $counter; ++$i) {
- $pRange[$i] = implode(':', $pRange[$i]);
- }
- $imploded = implode(',', $pRange);
-
- return $imploded;
- }
-
- /**
- * Calculate range boundaries
- *
- * @param string $pRange Cell range (e.g. A1:A1)
- * @return array Range coordinates array(Start Cell, End Cell)
- * where Start Cell and End Cell are arrays (Column Number, Row Number)
- */
- public static function rangeBoundaries($pRange = 'A1:A1')
- {
- // Ensure $pRange is a valid range
- if (empty($pRange)) {
- $pRange = self::DEFAULT_RANGE;
- }
-
- // Uppercase coordinate
- $pRange = strtoupper($pRange);
-
- // Extract range
- if (strpos($pRange, ':') === false) {
- $rangeA = $rangeB = $pRange;
- } else {
- list($rangeA, $rangeB) = explode(':', $pRange);
- }
-
- // Calculate range outer borders
- $rangeStart = self::coordinateFromString($rangeA);
- $rangeEnd = self::coordinateFromString($rangeB);
-
- // Translate column into index
- $rangeStart[0] = self::columnIndexFromString($rangeStart[0]);
- $rangeEnd[0] = self::columnIndexFromString($rangeEnd[0]);
-
- return array($rangeStart, $rangeEnd);
- }
-
- /**
- * Calculate range dimension
- *
- * @param string $pRange Cell range (e.g. A1:A1)
- * @return array Range dimension (width, height)
- */
- public static function rangeDimension($pRange = 'A1:A1')
- {
- // Calculate range outer borders
- list($rangeStart, $rangeEnd) = self::rangeBoundaries($pRange);
-
- return array( ($rangeEnd[0] - $rangeStart[0] + 1), ($rangeEnd[1] - $rangeStart[1] + 1) );
- }
-
- /**
- * Calculate range boundaries
- *
- * @param string $pRange Cell range (e.g. A1:A1)
- * @return array Range coordinates array(Start Cell, End Cell)
- * where Start Cell and End Cell are arrays (Column ID, Row Number)
- */
- public static function getRangeBoundaries($pRange = 'A1:A1')
- {
- // Ensure $pRange is a valid range
- if (empty($pRange)) {
- $pRange = self::DEFAULT_RANGE;
- }
-
- // Uppercase coordinate
- $pRange = strtoupper($pRange);
-
- // Extract range
- if (strpos($pRange, ':') === false) {
- $rangeA = $rangeB = $pRange;
- } else {
- list($rangeA, $rangeB) = explode(':', $pRange);
- }
-
- return array( self::coordinateFromString($rangeA), self::coordinateFromString($rangeB));
- }
-
- /**
- * Column index from string
- *
- * @param string $pString
- * @return int Column index (base 1 !!!)
- */
- public static function columnIndexFromString($pString = 'A')
- {
- // Using a lookup cache adds a slight memory overhead, but boosts speed
- // caching using a static within the method is faster than a class static,
- // though it's additional memory overhead
- static $_indexCache = array();
-
- if (isset($_indexCache[$pString])) {
- return $_indexCache[$pString];
- }
- // It's surprising how costly the strtoupper() and ord() calls actually are, so we use a lookup array rather than use ord()
- // and make it case insensitive to get rid of the strtoupper() as well. Because it's a static, there's no significant
- // memory overhead either
- static $_columnLookup = array(
- 'A' => 1, 'B' => 2, 'C' => 3, 'D' => 4, 'E' => 5, 'F' => 6, 'G' => 7, 'H' => 8, 'I' => 9, 'J' => 10, 'K' => 11, 'L' => 12, 'M' => 13,
- 'N' => 14, 'O' => 15, 'P' => 16, 'Q' => 17, 'R' => 18, 'S' => 19, 'T' => 20, 'U' => 21, 'V' => 22, 'W' => 23, 'X' => 24, 'Y' => 25, 'Z' => 26,
- 'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5, 'f' => 6, 'g' => 7, 'h' => 8, 'i' => 9, 'j' => 10, 'k' => 11, 'l' => 12, 'm' => 13,
- 'n' => 14, 'o' => 15, 'p' => 16, 'q' => 17, 'r' => 18, 's' => 19, 't' => 20, 'u' => 21, 'v' => 22, 'w' => 23, 'x' => 24, 'y' => 25, 'z' => 26
- );
-
- // We also use the language construct isset() rather than the more costly strlen() function to match the length of $pString
- // for improved performance
- if (isset($pString{0})) {
- if (!isset($pString{1})) {
- $_indexCache[$pString] = $_columnLookup[$pString];
- return $_indexCache[$pString];
- } elseif (!isset($pString{2})) {
- $_indexCache[$pString] = $_columnLookup[$pString{0}] * 26 + $_columnLookup[$pString{1}];
- return $_indexCache[$pString];
- } elseif (!isset($pString{3})) {
- $_indexCache[$pString] = $_columnLookup[$pString{0}] * 676 + $_columnLookup[$pString{1}] * 26 + $_columnLookup[$pString{2}];
- return $_indexCache[$pString];
- }
- }
- throw new PHPExcel_Exception("Column string index can not be " . ((isset($pString{0})) ? "longer than 3 characters" : "empty"));
- }
-
- /**
- * String from columnindex
- *
- * @param int $pColumnIndex Column index (base 0 !!!)
- * @return string
- */
- public static function stringFromColumnIndex($pColumnIndex = 0)
- {
- // Using a lookup cache adds a slight memory overhead, but boosts speed
- // caching using a static within the method is faster than a class static,
- // though it's additional memory overhead
- static $_indexCache = array();
-
- if (!isset($_indexCache[$pColumnIndex])) {
- // Determine column string
- if ($pColumnIndex < 26) {
- $_indexCache[$pColumnIndex] = chr(65 + $pColumnIndex);
- } elseif ($pColumnIndex < 702) {
- $_indexCache[$pColumnIndex] = chr(64 + ($pColumnIndex / 26)) .
- chr(65 + $pColumnIndex % 26);
- } else {
- $_indexCache[$pColumnIndex] = chr(64 + (($pColumnIndex - 26) / 676)) .
- chr(65 + ((($pColumnIndex - 26) % 676) / 26)) .
- chr(65 + $pColumnIndex % 26);
- }
- }
- return $_indexCache[$pColumnIndex];
- }
-
- /**
- * Extract all cell references in range
- *
- * @param string $pRange Range (e.g. A1 or A1:C10 or A1:E10 A20:E25)
- * @return array Array containing single cell references
- */
- public static function extractAllCellReferencesInRange($pRange = 'A1')
- {
- // Returnvalue
- $returnValue = array();
-
- // Explode spaces
- $cellBlocks = explode(' ', str_replace('$', '', strtoupper($pRange)));
- foreach ($cellBlocks as $cellBlock) {
- // Single cell?
- if (strpos($cellBlock, ':') === false && strpos($cellBlock, ',') === false) {
- $returnValue[] = $cellBlock;
- continue;
- }
-
- // Range...
- $ranges = self::splitRange($cellBlock);
- foreach ($ranges as $range) {
- // Single cell?
- if (!isset($range[1])) {
- $returnValue[] = $range[0];
- continue;
- }
-
- // Range...
- list($rangeStart, $rangeEnd) = $range;
- sscanf($rangeStart, '%[A-Z]%d', $startCol, $startRow);
- sscanf($rangeEnd, '%[A-Z]%d', $endCol, $endRow);
- ++$endCol;
-
- // Current data
- $currentCol = $startCol;
- $currentRow = $startRow;
-
- // Loop cells
- while ($currentCol != $endCol) {
- while ($currentRow <= $endRow) {
- $returnValue[] = $currentCol.$currentRow;
- ++$currentRow;
- }
- ++$currentCol;
- $currentRow = $startRow;
- }
- }
- }
-
- // Sort the result by column and row
- $sortKeys = array();
- foreach (array_unique($returnValue) as $coord) {
- sscanf($coord, '%[A-Z]%d', $column, $row);
- $sortKeys[sprintf('%3s%09d', $column, $row)] = $coord;
- }
- ksort($sortKeys);
-
- // Return value
- return array_values($sortKeys);
- }
-
- /**
- * Compare 2 cells
- *
- * @param PHPExcel_Cell $a Cell a
- * @param PHPExcel_Cell $b Cell b
- * @return int Result of comparison (always -1 or 1, never zero!)
- */
- public static function compareCells(PHPExcel_Cell $a, PHPExcel_Cell $b)
- {
- if ($a->getRow() < $b->getRow()) {
- return -1;
- } elseif ($a->getRow() > $b->getRow()) {
- return 1;
- } elseif (self::columnIndexFromString($a->getColumn()) < self::columnIndexFromString($b->getColumn())) {
- return -1;
- } else {
- return 1;
- }
- }
-
- /**
- * Get value binder to use
- *
- * @return PHPExcel_Cell_IValueBinder
- */
- public static function getValueBinder()
- {
- if (self::$valueBinder === null) {
- self::$valueBinder = new PHPExcel_Cell_DefaultValueBinder();
- }
-
- return self::$valueBinder;
- }
-
- /**
- * Set value binder to use
- *
- * @param PHPExcel_Cell_IValueBinder $binder
- * @throws PHPExcel_Exception
- */
- public static function setValueBinder(PHPExcel_Cell_IValueBinder $binder = null)
- {
- if ($binder === null) {
- throw new PHPExcel_Exception("A PHPExcel_Cell_IValueBinder is required for PHPExcel to function correctly.");
- }
-
- self::$valueBinder = $binder;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if ((is_object($value)) && ($key != 'parent')) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-
- /**
- * Get index to cellXf
- *
- * @return int
- */
- public function getXfIndex()
- {
- return $this->xfIndex;
- }
-
- /**
- * Set index to cellXf
- *
- * @param int $pValue
- * @return PHPExcel_Cell
- */
- public function setXfIndex($pValue = 0)
- {
- $this->xfIndex = $pValue;
-
- return $this->notifyCacheController();
- }
-
- /**
- * @deprecated Since version 1.7.8 for planned changes to cell for array formula handling
- */
- public function setFormulaAttributes($pAttributes)
- {
- $this->formulaAttributes = $pAttributes;
- return $this;
- }
-
- /**
- * @deprecated Since version 1.7.8 for planned changes to cell for array formula handling
- */
- public function getFormulaAttributes()
- {
- return $this->formulaAttributes;
- }
-
- /**
- * Convert to string
- *
- * @return string
- */
- public function __toString()
- {
- return (string) $this->getValue();
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Cell/AdvancedValueBinder.php b/lib/phpexcel/PHPExcel/Cell/AdvancedValueBinder.php
deleted file mode 100644
index 061d04eb50f..00000000000
--- a/lib/phpexcel/PHPExcel/Cell/AdvancedValueBinder.php
+++ /dev/null
@@ -1,187 +0,0 @@
-setValueExplicit(true, PHPExcel_Cell_DataType::TYPE_BOOL);
- return true;
- } elseif ($value == PHPExcel_Calculation::getFALSE()) {
- $cell->setValueExplicit(false, PHPExcel_Cell_DataType::TYPE_BOOL);
- return true;
- }
-
- // Check for number in scientific format
- if (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NUMBER.'$/', $value)) {
- $cell->setValueExplicit((float) $value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
- return true;
- }
-
- // Check for fraction
- if (preg_match('/^([+-]?)\s*([0-9]+)\s?\/\s*([0-9]+)$/', $value, $matches)) {
- // Convert value to number
- $value = $matches[2] / $matches[3];
- if ($matches[1] == '-') {
- $value = 0 - $value;
- }
- $cell->setValueExplicit((float) $value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
- // Set style
- $cell->getWorksheet()->getStyle($cell->getCoordinate())
- ->getNumberFormat()->setFormatCode('??/??');
- return true;
- } elseif (preg_match('/^([+-]?)([0-9]*) +([0-9]*)\s?\/\s*([0-9]*)$/', $value, $matches)) {
- // Convert value to number
- $value = $matches[2] + ($matches[3] / $matches[4]);
- if ($matches[1] == '-') {
- $value = 0 - $value;
- }
- $cell->setValueExplicit((float) $value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
- // Set style
- $cell->getWorksheet()->getStyle($cell->getCoordinate())
- ->getNumberFormat()->setFormatCode('# ??/??');
- return true;
- }
-
- // Check for percentage
- if (preg_match('/^\-?[0-9]*\.?[0-9]*\s?\%$/', $value)) {
- // Convert value to number
- $value = (float) str_replace('%', '', $value) / 100;
- $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
- // Set style
- $cell->getWorksheet()->getStyle($cell->getCoordinate())
- ->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00);
- return true;
- }
-
- // Check for currency
- $currencyCode = PHPExcel_Shared_String::getCurrencyCode();
- $decimalSeparator = PHPExcel_Shared_String::getDecimalSeparator();
- $thousandsSeparator = PHPExcel_Shared_String::getThousandsSeparator();
- if (preg_match('/^'.preg_quote($currencyCode).' *(\d{1,3}('.preg_quote($thousandsSeparator).'\d{3})*|(\d+))('.preg_quote($decimalSeparator).'\d{2})?$/', $value)) {
- // Convert value to number
- $value = (float) trim(str_replace(array($currencyCode, $thousandsSeparator, $decimalSeparator), array('', '', '.'), $value));
- $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
- // Set style
- $cell->getWorksheet()->getStyle($cell->getCoordinate())
- ->getNumberFormat()->setFormatCode(
- str_replace('$', $currencyCode, PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE)
- );
- return true;
- } elseif (preg_match('/^\$ *(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$/', $value)) {
- // Convert value to number
- $value = (float) trim(str_replace(array('$',','), '', $value));
- $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_NUMERIC);
- // Set style
- $cell->getWorksheet()->getStyle($cell->getCoordinate())
- ->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);
- return true;
- }
-
- // Check for time without seconds e.g. '9:45', '09:45'
- if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d$/', $value)) {
- // Convert value to number
- list($h, $m) = explode(':', $value);
- $days = $h / 24 + $m / 1440;
- $cell->setValueExplicit($days, PHPExcel_Cell_DataType::TYPE_NUMERIC);
- // Set style
- $cell->getWorksheet()->getStyle($cell->getCoordinate())
- ->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME3);
- return true;
- }
-
- // Check for time with seconds '9:45:59', '09:45:59'
- if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d:[0-5]\d$/', $value)) {
- // Convert value to number
- list($h, $m, $s) = explode(':', $value);
- $days = $h / 24 + $m / 1440 + $s / 86400;
- // Convert value to number
- $cell->setValueExplicit($days, PHPExcel_Cell_DataType::TYPE_NUMERIC);
- // Set style
- $cell->getWorksheet()->getStyle($cell->getCoordinate())
- ->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4);
- return true;
- }
-
- // Check for datetime, e.g. '2008-12-31', '2008-12-31 15:59', '2008-12-31 15:59:10'
- if (($d = PHPExcel_Shared_Date::stringToExcel($value)) !== false) {
- // Convert value to number
- $cell->setValueExplicit($d, PHPExcel_Cell_DataType::TYPE_NUMERIC);
- // Determine style. Either there is a time part or not. Look for ':'
- if (strpos($value, ':') !== false) {
- $formatCode = 'yyyy-mm-dd h:mm';
- } else {
- $formatCode = 'yyyy-mm-dd';
- }
- $cell->getWorksheet()->getStyle($cell->getCoordinate())
- ->getNumberFormat()->setFormatCode($formatCode);
- return true;
- }
-
- // Check for newline character "\n"
- if (strpos($value, "\n") !== false) {
- $value = PHPExcel_Shared_String::SanitizeUTF8($value);
- $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_STRING);
- // Set style
- $cell->getWorksheet()->getStyle($cell->getCoordinate())
- ->getAlignment()->setWrapText(true);
- return true;
- }
- }
-
- // Not bound yet? Use parent...
- return parent::bindValue($cell, $value);
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Cell/DataType.php b/lib/phpexcel/PHPExcel/Cell/DataType.php
deleted file mode 100644
index fc010e65383..00000000000
--- a/lib/phpexcel/PHPExcel/Cell/DataType.php
+++ /dev/null
@@ -1,115 +0,0 @@
- 0,
- '#DIV/0!' => 1,
- '#VALUE!' => 2,
- '#REF!' => 3,
- '#NAME?' => 4,
- '#NUM!' => 5,
- '#N/A' => 6
- );
-
- /**
- * Get list of error codes
- *
- * @return array
- */
- public static function getErrorCodes()
- {
- return self::$errorCodes;
- }
-
- /**
- * DataType for value
- *
- * @deprecated Replaced by PHPExcel_Cell_IValueBinder infrastructure, will be removed in version 1.8.0
- * @param mixed $pValue
- * @return string
- */
- public static function dataTypeForValue($pValue = null)
- {
- return PHPExcel_Cell_DefaultValueBinder::dataTypeForValue($pValue);
- }
-
- /**
- * Check a string that it satisfies Excel requirements
- *
- * @param mixed Value to sanitize to an Excel string
- * @return mixed Sanitized value
- */
- public static function checkString($pValue = null)
- {
- if ($pValue instanceof PHPExcel_RichText) {
- // TODO: Sanitize Rich-Text string (max. character count is 32,767)
- return $pValue;
- }
-
- // string must never be longer than 32,767 characters, truncate if necessary
- $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 32767);
-
- // we require that newline is represented as "\n" in core, not as "\r\n" or "\r"
- $pValue = str_replace(array("\r\n", "\r"), "\n", $pValue);
-
- return $pValue;
- }
-
- /**
- * Check a value that it is a valid error code
- *
- * @param mixed Value to sanitize to an Excel error code
- * @return string Sanitized value
- */
- public static function checkErrorCode($pValue = null)
- {
- $pValue = (string) $pValue;
-
- if (!array_key_exists($pValue, self::$errorCodes)) {
- $pValue = '#NULL!';
- }
-
- return $pValue;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Cell/DataValidation.php b/lib/phpexcel/PHPExcel/Cell/DataValidation.php
deleted file mode 100644
index 9883633e6f8..00000000000
--- a/lib/phpexcel/PHPExcel/Cell/DataValidation.php
+++ /dev/null
@@ -1,492 +0,0 @@
-formula1 = '';
- $this->formula2 = '';
- $this->type = PHPExcel_Cell_DataValidation::TYPE_NONE;
- $this->errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP;
- $this->operator = '';
- $this->allowBlank = false;
- $this->showDropDown = false;
- $this->showInputMessage = false;
- $this->showErrorMessage = false;
- $this->errorTitle = '';
- $this->error = '';
- $this->promptTitle = '';
- $this->prompt = '';
- }
-
- /**
- * Get Formula 1
- *
- * @return string
- */
- public function getFormula1()
- {
- return $this->formula1;
- }
-
- /**
- * Set Formula 1
- *
- * @param string $value
- * @return PHPExcel_Cell_DataValidation
- */
- public function setFormula1($value = '')
- {
- $this->formula1 = $value;
- return $this;
- }
-
- /**
- * Get Formula 2
- *
- * @return string
- */
- public function getFormula2()
- {
- return $this->formula2;
- }
-
- /**
- * Set Formula 2
- *
- * @param string $value
- * @return PHPExcel_Cell_DataValidation
- */
- public function setFormula2($value = '')
- {
- $this->formula2 = $value;
- return $this;
- }
-
- /**
- * Get Type
- *
- * @return string
- */
- public function getType()
- {
- return $this->type;
- }
-
- /**
- * Set Type
- *
- * @param string $value
- * @return PHPExcel_Cell_DataValidation
- */
- public function setType($value = PHPExcel_Cell_DataValidation::TYPE_NONE)
- {
- $this->type = $value;
- return $this;
- }
-
- /**
- * Get Error style
- *
- * @return string
- */
- public function getErrorStyle()
- {
- return $this->errorStyle;
- }
-
- /**
- * Set Error style
- *
- * @param string $value
- * @return PHPExcel_Cell_DataValidation
- */
- public function setErrorStyle($value = PHPExcel_Cell_DataValidation::STYLE_STOP)
- {
- $this->errorStyle = $value;
- return $this;
- }
-
- /**
- * Get Operator
- *
- * @return string
- */
- public function getOperator()
- {
- return $this->operator;
- }
-
- /**
- * Set Operator
- *
- * @param string $value
- * @return PHPExcel_Cell_DataValidation
- */
- public function setOperator($value = '')
- {
- $this->operator = $value;
- return $this;
- }
-
- /**
- * Get Allow Blank
- *
- * @return boolean
- */
- public function getAllowBlank()
- {
- return $this->allowBlank;
- }
-
- /**
- * Set Allow Blank
- *
- * @param boolean $value
- * @return PHPExcel_Cell_DataValidation
- */
- public function setAllowBlank($value = false)
- {
- $this->allowBlank = $value;
- return $this;
- }
-
- /**
- * Get Show DropDown
- *
- * @return boolean
- */
- public function getShowDropDown()
- {
- return $this->showDropDown;
- }
-
- /**
- * Set Show DropDown
- *
- * @param boolean $value
- * @return PHPExcel_Cell_DataValidation
- */
- public function setShowDropDown($value = false)
- {
- $this->showDropDown = $value;
- return $this;
- }
-
- /**
- * Get Show InputMessage
- *
- * @return boolean
- */
- public function getShowInputMessage()
- {
- return $this->showInputMessage;
- }
-
- /**
- * Set Show InputMessage
- *
- * @param boolean $value
- * @return PHPExcel_Cell_DataValidation
- */
- public function setShowInputMessage($value = false)
- {
- $this->showInputMessage = $value;
- return $this;
- }
-
- /**
- * Get Show ErrorMessage
- *
- * @return boolean
- */
- public function getShowErrorMessage()
- {
- return $this->showErrorMessage;
- }
-
- /**
- * Set Show ErrorMessage
- *
- * @param boolean $value
- * @return PHPExcel_Cell_DataValidation
- */
- public function setShowErrorMessage($value = false)
- {
- $this->showErrorMessage = $value;
- return $this;
- }
-
- /**
- * Get Error title
- *
- * @return string
- */
- public function getErrorTitle()
- {
- return $this->errorTitle;
- }
-
- /**
- * Set Error title
- *
- * @param string $value
- * @return PHPExcel_Cell_DataValidation
- */
- public function setErrorTitle($value = '')
- {
- $this->errorTitle = $value;
- return $this;
- }
-
- /**
- * Get Error
- *
- * @return string
- */
- public function getError()
- {
- return $this->error;
- }
-
- /**
- * Set Error
- *
- * @param string $value
- * @return PHPExcel_Cell_DataValidation
- */
- public function setError($value = '')
- {
- $this->error = $value;
- return $this;
- }
-
- /**
- * Get Prompt title
- *
- * @return string
- */
- public function getPromptTitle()
- {
- return $this->promptTitle;
- }
-
- /**
- * Set Prompt title
- *
- * @param string $value
- * @return PHPExcel_Cell_DataValidation
- */
- public function setPromptTitle($value = '')
- {
- $this->promptTitle = $value;
- return $this;
- }
-
- /**
- * Get Prompt
- *
- * @return string
- */
- public function getPrompt()
- {
- return $this->prompt;
- }
-
- /**
- * Set Prompt
- *
- * @param string $value
- * @return PHPExcel_Cell_DataValidation
- */
- public function setPrompt($value = '')
- {
- $this->prompt = $value;
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- return md5(
- $this->formula1 .
- $this->formula2 .
- $this->type = PHPExcel_Cell_DataValidation::TYPE_NONE .
- $this->errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP .
- $this->operator .
- ($this->allowBlank ? 't' : 'f') .
- ($this->showDropDown ? 't' : 'f') .
- ($this->showInputMessage ? 't' : 'f') .
- ($this->showErrorMessage ? 't' : 'f') .
- $this->errorTitle .
- $this->error .
- $this->promptTitle .
- $this->prompt .
- __CLASS__
- );
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Cell/DefaultValueBinder.php b/lib/phpexcel/PHPExcel/Cell/DefaultValueBinder.php
deleted file mode 100644
index dc19e6c4536..00000000000
--- a/lib/phpexcel/PHPExcel/Cell/DefaultValueBinder.php
+++ /dev/null
@@ -1,102 +0,0 @@
-format('Y-m-d H:i:s');
- } elseif (!($value instanceof PHPExcel_RichText)) {
- $value = (string) $value;
- }
- }
-
- // Set value explicit
- $cell->setValueExplicit($value, self::dataTypeForValue($value));
-
- // Done!
- return true;
- }
-
- /**
- * DataType for value
- *
- * @param mixed $pValue
- * @return string
- */
- public static function dataTypeForValue($pValue = null)
- {
- // Match the value against a few data types
- if ($pValue === null) {
- return PHPExcel_Cell_DataType::TYPE_NULL;
- } elseif ($pValue === '') {
- return PHPExcel_Cell_DataType::TYPE_STRING;
- } elseif ($pValue instanceof PHPExcel_RichText) {
- return PHPExcel_Cell_DataType::TYPE_INLINE;
- } elseif ($pValue{0} === '=' && strlen($pValue) > 1) {
- return PHPExcel_Cell_DataType::TYPE_FORMULA;
- } elseif (is_bool($pValue)) {
- return PHPExcel_Cell_DataType::TYPE_BOOL;
- } elseif (is_float($pValue) || is_int($pValue)) {
- return PHPExcel_Cell_DataType::TYPE_NUMERIC;
- } elseif (preg_match('/^[\+\-]?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)([Ee][\-\+]?[0-2]?\d{1,3})?$/', $pValue)) {
- $tValue = ltrim($pValue, '+-');
- if (is_string($pValue) && $tValue{0} === '0' && strlen($tValue) > 1 && $tValue{1} !== '.') {
- return PHPExcel_Cell_DataType::TYPE_STRING;
- } elseif ((strpos($pValue, '.') === false) && ($pValue > PHP_INT_MAX)) {
- return PHPExcel_Cell_DataType::TYPE_STRING;
- }
- return PHPExcel_Cell_DataType::TYPE_NUMERIC;
- } elseif (is_string($pValue) && array_key_exists($pValue, PHPExcel_Cell_DataType::getErrorCodes())) {
- return PHPExcel_Cell_DataType::TYPE_ERROR;
- }
-
- return PHPExcel_Cell_DataType::TYPE_STRING;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Cell/Hyperlink.php b/lib/phpexcel/PHPExcel/Cell/Hyperlink.php
deleted file mode 100644
index daab54c84a7..00000000000
--- a/lib/phpexcel/PHPExcel/Cell/Hyperlink.php
+++ /dev/null
@@ -1,124 +0,0 @@
-url = $pUrl;
- $this->tooltip = $pTooltip;
- }
-
- /**
- * Get URL
- *
- * @return string
- */
- public function getUrl()
- {
- return $this->url;
- }
-
- /**
- * Set URL
- *
- * @param string $value
- * @return PHPExcel_Cell_Hyperlink
- */
- public function setUrl($value = '')
- {
- $this->url = $value;
- return $this;
- }
-
- /**
- * Get tooltip
- *
- * @return string
- */
- public function getTooltip()
- {
- return $this->tooltip;
- }
-
- /**
- * Set tooltip
- *
- * @param string $value
- * @return PHPExcel_Cell_Hyperlink
- */
- public function setTooltip($value = '')
- {
- $this->tooltip = $value;
- return $this;
- }
-
- /**
- * Is this hyperlink internal? (to another worksheet)
- *
- * @return boolean
- */
- public function isInternal()
- {
- return strpos($this->url, 'sheet://') !== false;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- return md5(
- $this->url .
- $this->tooltip .
- __CLASS__
- );
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Cell/IValueBinder.php b/lib/phpexcel/PHPExcel/Cell/IValueBinder.php
deleted file mode 100644
index de2d0ac0c8c..00000000000
--- a/lib/phpexcel/PHPExcel/Cell/IValueBinder.php
+++ /dev/null
@@ -1,47 +0,0 @@
-plotType = $plotType;
- $this->plotGrouping = $plotGrouping;
- $this->plotOrder = $plotOrder;
- $keys = array_keys($plotValues);
- $this->plotValues = $plotValues;
- if ((count($plotLabel) == 0) || (is_null($plotLabel[$keys[0]]))) {
- $plotLabel[$keys[0]] = new PHPExcel_Chart_DataSeriesValues();
- }
-
- $this->plotLabel = $plotLabel;
- if ((count($plotCategory) == 0) || (is_null($plotCategory[$keys[0]]))) {
- $plotCategory[$keys[0]] = new PHPExcel_Chart_DataSeriesValues();
- }
- $this->plotCategory = $plotCategory;
- $this->smoothLine = $smoothLine;
- $this->plotStyle = $plotStyle;
-
- if (is_null($plotDirection)) {
- $plotDirection = self::DIRECTION_COL;
- }
- $this->plotDirection = $plotDirection;
- }
-
- /**
- * Get Plot Type
- *
- * @return string
- */
- public function getPlotType()
- {
- return $this->plotType;
- }
-
- /**
- * Set Plot Type
- *
- * @param string $plotType
- * @return PHPExcel_Chart_DataSeries
- */
- public function setPlotType($plotType = '')
- {
- $this->plotType = $plotType;
- return $this;
- }
-
- /**
- * Get Plot Grouping Type
- *
- * @return string
- */
- public function getPlotGrouping()
- {
- return $this->plotGrouping;
- }
-
- /**
- * Set Plot Grouping Type
- *
- * @param string $groupingType
- * @return PHPExcel_Chart_DataSeries
- */
- public function setPlotGrouping($groupingType = null)
- {
- $this->plotGrouping = $groupingType;
- return $this;
- }
-
- /**
- * Get Plot Direction
- *
- * @return string
- */
- public function getPlotDirection()
- {
- return $this->plotDirection;
- }
-
- /**
- * Set Plot Direction
- *
- * @param string $plotDirection
- * @return PHPExcel_Chart_DataSeries
- */
- public function setPlotDirection($plotDirection = null)
- {
- $this->plotDirection = $plotDirection;
- return $this;
- }
-
- /**
- * Get Plot Order
- *
- * @return string
- */
- public function getPlotOrder()
- {
- return $this->plotOrder;
- }
-
- /**
- * Get Plot Labels
- *
- * @return array of PHPExcel_Chart_DataSeriesValues
- */
- public function getPlotLabels()
- {
- return $this->plotLabel;
- }
-
- /**
- * Get Plot Label by Index
- *
- * @return PHPExcel_Chart_DataSeriesValues
- */
- public function getPlotLabelByIndex($index)
- {
- $keys = array_keys($this->plotLabel);
- if (in_array($index, $keys)) {
- return $this->plotLabel[$index];
- } elseif (isset($keys[$index])) {
- return $this->plotLabel[$keys[$index]];
- }
- return false;
- }
-
- /**
- * Get Plot Categories
- *
- * @return array of PHPExcel_Chart_DataSeriesValues
- */
- public function getPlotCategories()
- {
- return $this->plotCategory;
- }
-
- /**
- * Get Plot Category by Index
- *
- * @return PHPExcel_Chart_DataSeriesValues
- */
- public function getPlotCategoryByIndex($index)
- {
- $keys = array_keys($this->plotCategory);
- if (in_array($index, $keys)) {
- return $this->plotCategory[$index];
- } elseif (isset($keys[$index])) {
- return $this->plotCategory[$keys[$index]];
- }
- return false;
- }
-
- /**
- * Get Plot Style
- *
- * @return string
- */
- public function getPlotStyle()
- {
- return $this->plotStyle;
- }
-
- /**
- * Set Plot Style
- *
- * @param string $plotStyle
- * @return PHPExcel_Chart_DataSeries
- */
- public function setPlotStyle($plotStyle = null)
- {
- $this->plotStyle = $plotStyle;
- return $this;
- }
-
- /**
- * Get Plot Values
- *
- * @return array of PHPExcel_Chart_DataSeriesValues
- */
- public function getPlotValues()
- {
- return $this->plotValues;
- }
-
- /**
- * Get Plot Values by Index
- *
- * @return PHPExcel_Chart_DataSeriesValues
- */
- public function getPlotValuesByIndex($index)
- {
- $keys = array_keys($this->plotValues);
- if (in_array($index, $keys)) {
- return $this->plotValues[$index];
- } elseif (isset($keys[$index])) {
- return $this->plotValues[$keys[$index]];
- }
- return false;
- }
-
- /**
- * Get Number of Plot Series
- *
- * @return integer
- */
- public function getPlotSeriesCount()
- {
- return count($this->plotValues);
- }
-
- /**
- * Get Smooth Line
- *
- * @return boolean
- */
- public function getSmoothLine()
- {
- return $this->smoothLine;
- }
-
- /**
- * Set Smooth Line
- *
- * @param boolean $smoothLine
- * @return PHPExcel_Chart_DataSeries
- */
- public function setSmoothLine($smoothLine = true)
- {
- $this->smoothLine = $smoothLine;
- return $this;
- }
-
- public function refresh(PHPExcel_Worksheet $worksheet)
- {
- foreach ($this->plotValues as $plotValues) {
- if ($plotValues !== null) {
- $plotValues->refresh($worksheet, true);
- }
- }
- foreach ($this->plotLabel as $plotValues) {
- if ($plotValues !== null) {
- $plotValues->refresh($worksheet, true);
- }
- }
- foreach ($this->plotCategory as $plotValues) {
- if ($plotValues !== null) {
- $plotValues->refresh($worksheet, false);
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Chart/DataSeriesValues.php b/lib/phpexcel/PHPExcel/Chart/DataSeriesValues.php
deleted file mode 100644
index ea57e52a197..00000000000
--- a/lib/phpexcel/PHPExcel/Chart/DataSeriesValues.php
+++ /dev/null
@@ -1,333 +0,0 @@
-setDataType($dataType);
- $this->dataSource = $dataSource;
- $this->formatCode = $formatCode;
- $this->pointCount = $pointCount;
- $this->dataValues = $dataValues;
- $this->pointMarker = $marker;
- }
-
- /**
- * Get Series Data Type
- *
- * @return string
- */
- public function getDataType()
- {
- return $this->dataType;
- }
-
- /**
- * Set Series Data Type
- *
- * @param string $dataType Datatype of this data series
- * Typical values are:
- * PHPExcel_Chart_DataSeriesValues::DATASERIES_TYPE_STRING
- * Normally used for axis point values
- * PHPExcel_Chart_DataSeriesValues::DATASERIES_TYPE_NUMBER
- * Normally used for chart data values
- * @return PHPExcel_Chart_DataSeriesValues
- */
- public function setDataType($dataType = self::DATASERIES_TYPE_NUMBER)
- {
- if (!in_array($dataType, self::$dataTypeValues)) {
- throw new PHPExcel_Chart_Exception('Invalid datatype for chart data series values');
- }
- $this->dataType = $dataType;
-
- return $this;
- }
-
- /**
- * Get Series Data Source (formula)
- *
- * @return string
- */
- public function getDataSource()
- {
- return $this->dataSource;
- }
-
- /**
- * Set Series Data Source (formula)
- *
- * @param string $dataSource
- * @return PHPExcel_Chart_DataSeriesValues
- */
- public function setDataSource($dataSource = null, $refreshDataValues = true)
- {
- $this->dataSource = $dataSource;
-
- if ($refreshDataValues) {
- // TO DO
- }
-
- return $this;
- }
-
- /**
- * Get Point Marker
- *
- * @return string
- */
- public function getPointMarker()
- {
- return $this->pointMarker;
- }
-
- /**
- * Set Point Marker
- *
- * @param string $marker
- * @return PHPExcel_Chart_DataSeriesValues
- */
- public function setPointMarker($marker = null)
- {
- $this->pointMarker = $marker;
-
- return $this;
- }
-
- /**
- * Get Series Format Code
- *
- * @return string
- */
- public function getFormatCode()
- {
- return $this->formatCode;
- }
-
- /**
- * Set Series Format Code
- *
- * @param string $formatCode
- * @return PHPExcel_Chart_DataSeriesValues
- */
- public function setFormatCode($formatCode = null)
- {
- $this->formatCode = $formatCode;
-
- return $this;
- }
-
- /**
- * Get Series Point Count
- *
- * @return integer
- */
- public function getPointCount()
- {
- return $this->pointCount;
- }
-
- /**
- * Identify if the Data Series is a multi-level or a simple series
- *
- * @return boolean
- */
- public function isMultiLevelSeries()
- {
- if (count($this->dataValues) > 0) {
- return is_array($this->dataValues[0]);
- }
- return null;
- }
-
- /**
- * Return the level count of a multi-level Data Series
- *
- * @return boolean
- */
- public function multiLevelCount()
- {
- $levelCount = 0;
- foreach ($this->dataValues as $dataValueSet) {
- $levelCount = max($levelCount, count($dataValueSet));
- }
- return $levelCount;
- }
-
- /**
- * Get Series Data Values
- *
- * @return array of mixed
- */
- public function getDataValues()
- {
- return $this->dataValues;
- }
-
- /**
- * Get the first Series Data value
- *
- * @return mixed
- */
- public function getDataValue()
- {
- $count = count($this->dataValues);
- if ($count == 0) {
- return null;
- } elseif ($count == 1) {
- return $this->dataValues[0];
- }
- return $this->dataValues;
- }
-
- /**
- * Set Series Data Values
- *
- * @param array $dataValues
- * @param boolean $refreshDataSource
- * TRUE - refresh the value of dataSource based on the values of $dataValues
- * FALSE - don't change the value of dataSource
- * @return PHPExcel_Chart_DataSeriesValues
- */
- public function setDataValues($dataValues = array(), $refreshDataSource = true)
- {
- $this->dataValues = PHPExcel_Calculation_Functions::flattenArray($dataValues);
- $this->pointCount = count($dataValues);
-
- if ($refreshDataSource) {
- // TO DO
- }
-
- return $this;
- }
-
- private function stripNulls($var)
- {
- return $var !== null;
- }
-
- public function refresh(PHPExcel_Worksheet $worksheet, $flatten = true)
- {
- if ($this->dataSource !== null) {
- $calcEngine = PHPExcel_Calculation::getInstance($worksheet->getParent());
- $newDataValues = PHPExcel_Calculation::unwrapResult(
- $calcEngine->_calculateFormulaValue(
- '='.$this->dataSource,
- null,
- $worksheet->getCell('A1')
- )
- );
- if ($flatten) {
- $this->dataValues = PHPExcel_Calculation_Functions::flattenArray($newDataValues);
- foreach ($this->dataValues as &$dataValue) {
- if ((!empty($dataValue)) && ($dataValue[0] == '#')) {
- $dataValue = 0.0;
- }
- }
- unset($dataValue);
- } else {
- $cellRange = explode('!', $this->dataSource);
- if (count($cellRange) > 1) {
- list(, $cellRange) = $cellRange;
- }
-
- $dimensions = PHPExcel_Cell::rangeDimension(str_replace('$', '', $cellRange));
- if (($dimensions[0] == 1) || ($dimensions[1] == 1)) {
- $this->dataValues = PHPExcel_Calculation_Functions::flattenArray($newDataValues);
- } else {
- $newArray = array_values(array_shift($newDataValues));
- foreach ($newArray as $i => $newDataSet) {
- $newArray[$i] = array($newDataSet);
- }
-
- foreach ($newDataValues as $newDataSet) {
- $i = 0;
- foreach ($newDataSet as $newDataVal) {
- array_unshift($newArray[$i++], $newDataVal);
- }
- }
- $this->dataValues = $newArray;
- }
- }
- $this->pointCount = count($this->dataValues);
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Chart/Exception.php b/lib/phpexcel/PHPExcel/Chart/Exception.php
deleted file mode 100644
index e20dfa590b2..00000000000
--- a/lib/phpexcel/PHPExcel/Chart/Exception.php
+++ /dev/null
@@ -1,46 +0,0 @@
-line = $line;
- $e->file = $file;
- throw $e;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Chart/Legend.php b/lib/phpexcel/PHPExcel/Chart/Legend.php
deleted file mode 100644
index e850eb594fa..00000000000
--- a/lib/phpexcel/PHPExcel/Chart/Legend.php
+++ /dev/null
@@ -1,170 +0,0 @@
- self::POSITION_BOTTOM,
- self::xlLegendPositionCorner => self::POSITION_TOPRIGHT,
- self::xlLegendPositionCustom => '??',
- self::xlLegendPositionLeft => self::POSITION_LEFT,
- self::xlLegendPositionRight => self::POSITION_RIGHT,
- self::xlLegendPositionTop => self::POSITION_TOP
- );
-
- /**
- * Legend position
- *
- * @var string
- */
- private $position = self::POSITION_RIGHT;
-
- /**
- * Allow overlay of other elements?
- *
- * @var boolean
- */
- private $overlay = true;
-
- /**
- * Legend Layout
- *
- * @var PHPExcel_Chart_Layout
- */
- private $layout = null;
-
-
- /**
- * Create a new PHPExcel_Chart_Legend
- */
- public function __construct($position = self::POSITION_RIGHT, PHPExcel_Chart_Layout $layout = null, $overlay = false)
- {
- $this->setPosition($position);
- $this->layout = $layout;
- $this->setOverlay($overlay);
- }
-
- /**
- * Get legend position as an excel string value
- *
- * @return string
- */
- public function getPosition()
- {
- return $this->position;
- }
-
- /**
- * Get legend position using an excel string value
- *
- * @param string $position
- */
- public function setPosition($position = self::POSITION_RIGHT)
- {
- if (!in_array($position, self::$positionXLref)) {
- return false;
- }
-
- $this->position = $position;
- return true;
- }
-
- /**
- * Get legend position as an Excel internal numeric value
- *
- * @return number
- */
- public function getPositionXL()
- {
- return array_search($this->position, self::$positionXLref);
- }
-
- /**
- * Set legend position using an Excel internal numeric value
- *
- * @param number $positionXL
- */
- public function setPositionXL($positionXL = self::xlLegendPositionRight)
- {
- if (!array_key_exists($positionXL, self::$positionXLref)) {
- return false;
- }
-
- $this->position = self::$positionXLref[$positionXL];
- return true;
- }
-
- /**
- * Get allow overlay of other elements?
- *
- * @return boolean
- */
- public function getOverlay()
- {
- return $this->overlay;
- }
-
- /**
- * Set allow overlay of other elements?
- *
- * @param boolean $overlay
- * @return boolean
- */
- public function setOverlay($overlay = false)
- {
- if (!is_bool($overlay)) {
- return false;
- }
-
- $this->overlay = $overlay;
- return true;
- }
-
- /**
- * Get Layout
- *
- * @return PHPExcel_Chart_Layout
- */
- public function getLayout()
- {
- return $this->layout;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Chart/PlotArea.php b/lib/phpexcel/PHPExcel/Chart/PlotArea.php
deleted file mode 100644
index 551cc517bef..00000000000
--- a/lib/phpexcel/PHPExcel/Chart/PlotArea.php
+++ /dev/null
@@ -1,126 +0,0 @@
-layout = $layout;
- $this->plotSeries = $plotSeries;
- }
-
- /**
- * Get Layout
- *
- * @return PHPExcel_Chart_Layout
- */
- public function getLayout()
- {
- return $this->layout;
- }
-
- /**
- * Get Number of Plot Groups
- *
- * @return array of PHPExcel_Chart_DataSeries
- */
- public function getPlotGroupCount()
- {
- return count($this->plotSeries);
- }
-
- /**
- * Get Number of Plot Series
- *
- * @return integer
- */
- public function getPlotSeriesCount()
- {
- $seriesCount = 0;
- foreach ($this->plotSeries as $plot) {
- $seriesCount += $plot->getPlotSeriesCount();
- }
- return $seriesCount;
- }
-
- /**
- * Get Plot Series
- *
- * @return array of PHPExcel_Chart_DataSeries
- */
- public function getPlotGroup()
- {
- return $this->plotSeries;
- }
-
- /**
- * Get Plot Series by Index
- *
- * @return PHPExcel_Chart_DataSeries
- */
- public function getPlotGroupByIndex($index)
- {
- return $this->plotSeries[$index];
- }
-
- /**
- * Set Plot Series
- *
- * @param [PHPExcel_Chart_DataSeries]
- * @return PHPExcel_Chart_PlotArea
- */
- public function setPlotSeries($plotSeries = array())
- {
- $this->plotSeries = $plotSeries;
-
- return $this;
- }
-
- public function refresh(PHPExcel_Worksheet $worksheet)
- {
- foreach ($this->plotSeries as $plotSeries) {
- $plotSeries->refresh($worksheet);
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Chart/Properties.php b/lib/phpexcel/PHPExcel/Chart/Properties.php
deleted file mode 100644
index 9bb6e933717..00000000000
--- a/lib/phpexcel/PHPExcel/Chart/Properties.php
+++ /dev/null
@@ -1,363 +0,0 @@
- (string) $type,
- 'value' => (string) $color,
- 'alpha' => (string) $this->getTrueAlpha($alpha)
- );
- }
-
- protected function getLineStyleArrowSize($array_selector, $array_kay_selector)
- {
- $sizes = array(
- 1 => array('w' => 'sm', 'len' => 'sm'),
- 2 => array('w' => 'sm', 'len' => 'med'),
- 3 => array('w' => 'sm', 'len' => 'lg'),
- 4 => array('w' => 'med', 'len' => 'sm'),
- 5 => array('w' => 'med', 'len' => 'med'),
- 6 => array('w' => 'med', 'len' => 'lg'),
- 7 => array('w' => 'lg', 'len' => 'sm'),
- 8 => array('w' => 'lg', 'len' => 'med'),
- 9 => array('w' => 'lg', 'len' => 'lg')
- );
-
- return $sizes[$array_selector][$array_kay_selector];
- }
-
- protected function getShadowPresetsMap($shadow_presets_option)
- {
- $presets_options = array(
- //OUTER
- 1 => array(
- 'effect' => 'outerShdw',
- 'blur' => '50800',
- 'distance' => '38100',
- 'direction' => '2700000',
- 'algn' => 'tl',
- 'rotWithShape' => '0'
- ),
- 2 => array(
- 'effect' => 'outerShdw',
- 'blur' => '50800',
- 'distance' => '38100',
- 'direction' => '5400000',
- 'algn' => 't',
- 'rotWithShape' => '0'
- ),
- 3 => array(
- 'effect' => 'outerShdw',
- 'blur' => '50800',
- 'distance' => '38100',
- 'direction' => '8100000',
- 'algn' => 'tr',
- 'rotWithShape' => '0'
- ),
- 4 => array(
- 'effect' => 'outerShdw',
- 'blur' => '50800',
- 'distance' => '38100',
- 'algn' => 'l',
- 'rotWithShape' => '0'
- ),
- 5 => array(
- 'effect' => 'outerShdw',
- 'size' => array(
- 'sx' => '102000',
- 'sy' => '102000'
- )
- ,
- 'blur' => '63500',
- 'distance' => '38100',
- 'algn' => 'ctr',
- 'rotWithShape' => '0'
- ),
- 6 => array(
- 'effect' => 'outerShdw',
- 'blur' => '50800',
- 'distance' => '38100',
- 'direction' => '10800000',
- 'algn' => 'r',
- 'rotWithShape' => '0'
- ),
- 7 => array(
- 'effect' => 'outerShdw',
- 'blur' => '50800',
- 'distance' => '38100',
- 'direction' => '18900000',
- 'algn' => 'bl',
- 'rotWithShape' => '0'
- ),
- 8 => array(
- 'effect' => 'outerShdw',
- 'blur' => '50800',
- 'distance' => '38100',
- 'direction' => '16200000',
- 'rotWithShape' => '0'
- ),
- 9 => array(
- 'effect' => 'outerShdw',
- 'blur' => '50800',
- 'distance' => '38100',
- 'direction' => '13500000',
- 'algn' => 'br',
- 'rotWithShape' => '0'
- ),
- //INNER
- 10 => array(
- 'effect' => 'innerShdw',
- 'blur' => '63500',
- 'distance' => '50800',
- 'direction' => '2700000',
- ),
- 11 => array(
- 'effect' => 'innerShdw',
- 'blur' => '63500',
- 'distance' => '50800',
- 'direction' => '5400000',
- ),
- 12 => array(
- 'effect' => 'innerShdw',
- 'blur' => '63500',
- 'distance' => '50800',
- 'direction' => '8100000',
- ),
- 13 => array(
- 'effect' => 'innerShdw',
- 'blur' => '63500',
- 'distance' => '50800',
- ),
- 14 => array(
- 'effect' => 'innerShdw',
- 'blur' => '114300',
- ),
- 15 => array(
- 'effect' => 'innerShdw',
- 'blur' => '63500',
- 'distance' => '50800',
- 'direction' => '10800000',
- ),
- 16 => array(
- 'effect' => 'innerShdw',
- 'blur' => '63500',
- 'distance' => '50800',
- 'direction' => '18900000',
- ),
- 17 => array(
- 'effect' => 'innerShdw',
- 'blur' => '63500',
- 'distance' => '50800',
- 'direction' => '16200000',
- ),
- 18 => array(
- 'effect' => 'innerShdw',
- 'blur' => '63500',
- 'distance' => '50800',
- 'direction' => '13500000',
- ),
- //perspective
- 19 => array(
- 'effect' => 'outerShdw',
- 'blur' => '152400',
- 'distance' => '317500',
- 'size' => array(
- 'sx' => '90000',
- 'sy' => '-19000',
- ),
- 'direction' => '5400000',
- 'rotWithShape' => '0',
- ),
- 20 => array(
- 'effect' => 'outerShdw',
- 'blur' => '76200',
- 'direction' => '18900000',
- 'size' => array(
- 'sy' => '23000',
- 'kx' => '-1200000',
- ),
- 'algn' => 'bl',
- 'rotWithShape' => '0',
- ),
- 21 => array(
- 'effect' => 'outerShdw',
- 'blur' => '76200',
- 'direction' => '13500000',
- 'size' => array(
- 'sy' => '23000',
- 'kx' => '1200000',
- ),
- 'algn' => 'br',
- 'rotWithShape' => '0',
- ),
- 22 => array(
- 'effect' => 'outerShdw',
- 'blur' => '76200',
- 'distance' => '12700',
- 'direction' => '2700000',
- 'size' => array(
- 'sy' => '-23000',
- 'kx' => '-800400',
- ),
- 'algn' => 'bl',
- 'rotWithShape' => '0',
- ),
- 23 => array(
- 'effect' => 'outerShdw',
- 'blur' => '76200',
- 'distance' => '12700',
- 'direction' => '8100000',
- 'size' => array(
- 'sy' => '-23000',
- 'kx' => '800400',
- ),
- 'algn' => 'br',
- 'rotWithShape' => '0',
- ),
- );
-
- return $presets_options[$shadow_presets_option];
- }
-
- protected function getArrayElementsValue($properties, $elements)
- {
- $reference = & $properties;
- if (!is_array($elements)) {
- return $reference[$elements];
- } else {
- foreach ($elements as $keys) {
- $reference = & $reference[$keys];
- }
- return $reference;
- }
- return $this;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Chart/Renderer/PHP Charting Libraries.txt b/lib/phpexcel/PHPExcel/Chart/Renderer/PHP Charting Libraries.txt
deleted file mode 100644
index 20a8258850d..00000000000
--- a/lib/phpexcel/PHPExcel/Chart/Renderer/PHP Charting Libraries.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-ChartDirector
- http://www.advsofteng.com/cdphp.html
-
-GraPHPite
- http://graphpite.sourceforge.net/
-
-JpGraph
- http://www.aditus.nu/jpgraph/
-
-LibChart
- http://naku.dohcrew.com/libchart/pages/introduction/
-
-pChart
- http://pchart.sourceforge.net/
-
-TeeChart
- http://www.steema.com/products/teechart/overview.html
diff --git a/lib/phpexcel/PHPExcel/Chart/Title.php b/lib/phpexcel/PHPExcel/Chart/Title.php
deleted file mode 100644
index d8dc14f2b6b..00000000000
--- a/lib/phpexcel/PHPExcel/Chart/Title.php
+++ /dev/null
@@ -1,86 +0,0 @@
-caption = $caption;
- $this->layout = $layout;
- }
-
- /**
- * Get caption
- *
- * @return string
- */
- public function getCaption()
- {
- return $this->caption;
- }
-
- /**
- * Set caption
- *
- * @param string $caption
- * @return PHPExcel_Chart_Title
- */
- public function setCaption($caption = null)
- {
- $this->caption = $caption;
-
- return $this;
- }
-
- /**
- * Get Layout
- *
- * @return PHPExcel_Chart_Layout
- */
- public function getLayout()
- {
- return $this->layout;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Comment.php b/lib/phpexcel/PHPExcel/Comment.php
deleted file mode 100644
index d55363fd58e..00000000000
--- a/lib/phpexcel/PHPExcel/Comment.php
+++ /dev/null
@@ -1,338 +0,0 @@
-author = 'Author';
- $this->text = new PHPExcel_RichText();
- $this->fillColor = new PHPExcel_Style_Color('FFFFFFE1');
- $this->alignment = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL;
- }
-
- /**
- * Get Author
- *
- * @return string
- */
- public function getAuthor()
- {
- return $this->author;
- }
-
- /**
- * Set Author
- *
- * @param string $pValue
- * @return PHPExcel_Comment
- */
- public function setAuthor($pValue = '')
- {
- $this->author = $pValue;
- return $this;
- }
-
- /**
- * Get Rich text comment
- *
- * @return PHPExcel_RichText
- */
- public function getText()
- {
- return $this->text;
- }
-
- /**
- * Set Rich text comment
- *
- * @param PHPExcel_RichText $pValue
- * @return PHPExcel_Comment
- */
- public function setText(PHPExcel_RichText $pValue)
- {
- $this->text = $pValue;
- return $this;
- }
-
- /**
- * Get comment width (CSS style, i.e. XXpx or YYpt)
- *
- * @return string
- */
- public function getWidth()
- {
- return $this->width;
- }
-
- /**
- * Set comment width (CSS style, i.e. XXpx or YYpt)
- *
- * @param string $value
- * @return PHPExcel_Comment
- */
- public function setWidth($value = '96pt')
- {
- $this->width = $value;
- return $this;
- }
-
- /**
- * Get comment height (CSS style, i.e. XXpx or YYpt)
- *
- * @return string
- */
- public function getHeight()
- {
- return $this->height;
- }
-
- /**
- * Set comment height (CSS style, i.e. XXpx or YYpt)
- *
- * @param string $value
- * @return PHPExcel_Comment
- */
- public function setHeight($value = '55.5pt')
- {
- $this->height = $value;
- return $this;
- }
-
- /**
- * Get left margin (CSS style, i.e. XXpx or YYpt)
- *
- * @return string
- */
- public function getMarginLeft()
- {
- return $this->marginLeft;
- }
-
- /**
- * Set left margin (CSS style, i.e. XXpx or YYpt)
- *
- * @param string $value
- * @return PHPExcel_Comment
- */
- public function setMarginLeft($value = '59.25pt')
- {
- $this->marginLeft = $value;
- return $this;
- }
-
- /**
- * Get top margin (CSS style, i.e. XXpx or YYpt)
- *
- * @return string
- */
- public function getMarginTop()
- {
- return $this->marginTop;
- }
-
- /**
- * Set top margin (CSS style, i.e. XXpx or YYpt)
- *
- * @param string $value
- * @return PHPExcel_Comment
- */
- public function setMarginTop($value = '1.5pt')
- {
- $this->marginTop = $value;
- return $this;
- }
-
- /**
- * Is the comment visible by default?
- *
- * @return boolean
- */
- public function getVisible()
- {
- return $this->visible;
- }
-
- /**
- * Set comment default visibility
- *
- * @param boolean $value
- * @return PHPExcel_Comment
- */
- public function setVisible($value = false)
- {
- $this->visible = $value;
- return $this;
- }
-
- /**
- * Get fill color
- *
- * @return PHPExcel_Style_Color
- */
- public function getFillColor()
- {
- return $this->fillColor;
- }
-
- /**
- * Set Alignment
- *
- * @param string $pValue
- * @return PHPExcel_Comment
- */
- public function setAlignment($pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL)
- {
- $this->alignment = $pValue;
- return $this;
- }
-
- /**
- * Get Alignment
- *
- * @return string
- */
- public function getAlignment()
- {
- return $this->alignment;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- return md5(
- $this->author .
- $this->text->getHashCode() .
- $this->width .
- $this->height .
- $this->marginLeft .
- $this->marginTop .
- ($this->visible ? 1 : 0) .
- $this->fillColor->getHashCode() .
- $this->alignment .
- __CLASS__
- );
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-
- /**
- * Convert to string
- *
- * @return string
- */
- public function __toString()
- {
- return $this->text->getPlainText();
- }
-}
diff --git a/lib/phpexcel/PHPExcel/DocumentSecurity.php b/lib/phpexcel/PHPExcel/DocumentSecurity.php
deleted file mode 100644
index ecea0da1fa8..00000000000
--- a/lib/phpexcel/PHPExcel/DocumentSecurity.php
+++ /dev/null
@@ -1,222 +0,0 @@
-lockRevision = false;
- $this->lockStructure = false;
- $this->lockWindows = false;
- $this->revisionsPassword = '';
- $this->workbookPassword = '';
- }
-
- /**
- * Is some sort of document security enabled?
- *
- * @return boolean
- */
- public function isSecurityEnabled()
- {
- return $this->lockRevision ||
- $this->lockStructure ||
- $this->lockWindows;
- }
-
- /**
- * Get LockRevision
- *
- * @return boolean
- */
- public function getLockRevision()
- {
- return $this->lockRevision;
- }
-
- /**
- * Set LockRevision
- *
- * @param boolean $pValue
- * @return PHPExcel_DocumentSecurity
- */
- public function setLockRevision($pValue = false)
- {
- $this->lockRevision = $pValue;
- return $this;
- }
-
- /**
- * Get LockStructure
- *
- * @return boolean
- */
- public function getLockStructure()
- {
- return $this->lockStructure;
- }
-
- /**
- * Set LockStructure
- *
- * @param boolean $pValue
- * @return PHPExcel_DocumentSecurity
- */
- public function setLockStructure($pValue = false)
- {
- $this->lockStructure = $pValue;
- return $this;
- }
-
- /**
- * Get LockWindows
- *
- * @return boolean
- */
- public function getLockWindows()
- {
- return $this->lockWindows;
- }
-
- /**
- * Set LockWindows
- *
- * @param boolean $pValue
- * @return PHPExcel_DocumentSecurity
- */
- public function setLockWindows($pValue = false)
- {
- $this->lockWindows = $pValue;
- return $this;
- }
-
- /**
- * Get RevisionsPassword (hashed)
- *
- * @return string
- */
- public function getRevisionsPassword()
- {
- return $this->revisionsPassword;
- }
-
- /**
- * Set RevisionsPassword
- *
- * @param string $pValue
- * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
- * @return PHPExcel_DocumentSecurity
- */
- public function setRevisionsPassword($pValue = '', $pAlreadyHashed = false)
- {
- if (!$pAlreadyHashed) {
- $pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue);
- }
- $this->revisionsPassword = $pValue;
- return $this;
- }
-
- /**
- * Get WorkbookPassword (hashed)
- *
- * @return string
- */
- public function getWorkbookPassword()
- {
- return $this->workbookPassword;
- }
-
- /**
- * Set WorkbookPassword
- *
- * @param string $pValue
- * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
- * @return PHPExcel_DocumentSecurity
- */
- public function setWorkbookPassword($pValue = '', $pAlreadyHashed = false)
- {
- if (!$pAlreadyHashed) {
- $pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue);
- }
- $this->workbookPassword = $pValue;
- return $this;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Exception.php b/lib/phpexcel/PHPExcel/Exception.php
deleted file mode 100644
index b27750ea234..00000000000
--- a/lib/phpexcel/PHPExcel/Exception.php
+++ /dev/null
@@ -1,54 +0,0 @@
-line = $line;
- $e->file = $file;
- throw $e;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/HashTable.php b/lib/phpexcel/PHPExcel/HashTable.php
deleted file mode 100644
index c21d18c3a89..00000000000
--- a/lib/phpexcel/PHPExcel/HashTable.php
+++ /dev/null
@@ -1,204 +0,0 @@
-addFromSource($pSource);
- }
- }
-
- /**
- * Add HashTable items from source
- *
- * @param PHPExcel_IComparable[] $pSource Source array to create HashTable from
- * @throws PHPExcel_Exception
- */
- public function addFromSource($pSource = null)
- {
- // Check if an array was passed
- if ($pSource == null) {
- return;
- } elseif (!is_array($pSource)) {
- throw new PHPExcel_Exception('Invalid array parameter passed.');
- }
-
- foreach ($pSource as $item) {
- $this->add($item);
- }
- }
-
- /**
- * Add HashTable item
- *
- * @param PHPExcel_IComparable $pSource Item to add
- * @throws PHPExcel_Exception
- */
- public function add(PHPExcel_IComparable $pSource = null)
- {
- $hash = $pSource->getHashCode();
- if (!isset($this->items[$hash])) {
- $this->items[$hash] = $pSource;
- $this->keyMap[count($this->items) - 1] = $hash;
- }
- }
-
- /**
- * Remove HashTable item
- *
- * @param PHPExcel_IComparable $pSource Item to remove
- * @throws PHPExcel_Exception
- */
- public function remove(PHPExcel_IComparable $pSource = null)
- {
- $hash = $pSource->getHashCode();
- if (isset($this->items[$hash])) {
- unset($this->items[$hash]);
-
- $deleteKey = -1;
- foreach ($this->keyMap as $key => $value) {
- if ($deleteKey >= 0) {
- $this->keyMap[$key - 1] = $value;
- }
-
- if ($value == $hash) {
- $deleteKey = $key;
- }
- }
- unset($this->keyMap[count($this->keyMap) - 1]);
- }
- }
-
- /**
- * Clear HashTable
- *
- */
- public function clear()
- {
- $this->items = array();
- $this->keyMap = array();
- }
-
- /**
- * Count
- *
- * @return int
- */
- public function count()
- {
- return count($this->items);
- }
-
- /**
- * Get index for hash code
- *
- * @param string $pHashCode
- * @return int Index
- */
- public function getIndexForHashCode($pHashCode = '')
- {
- return array_search($pHashCode, $this->keyMap);
- }
-
- /**
- * Get by index
- *
- * @param int $pIndex
- * @return PHPExcel_IComparable
- *
- */
- public function getByIndex($pIndex = 0)
- {
- if (isset($this->keyMap[$pIndex])) {
- return $this->getByHashCode($this->keyMap[$pIndex]);
- }
-
- return null;
- }
-
- /**
- * Get by hashcode
- *
- * @param string $pHashCode
- * @return PHPExcel_IComparable
- *
- */
- public function getByHashCode($pHashCode = '')
- {
- if (isset($this->items[$pHashCode])) {
- return $this->items[$pHashCode];
- }
-
- return null;
- }
-
- /**
- * HashTable to array
- *
- * @return PHPExcel_IComparable[]
- */
- public function toArray()
- {
- return $this->items;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/IComparable.php b/lib/phpexcel/PHPExcel/IComparable.php
deleted file mode 100644
index 6dc36a94810..00000000000
--- a/lib/phpexcel/PHPExcel/IComparable.php
+++ /dev/null
@@ -1,34 +0,0 @@
- 'IWriter', 'path' => 'PHPExcel/Writer/{0}.php', 'class' => 'PHPExcel_Writer_{0}' ),
- array( 'type' => 'IReader', 'path' => 'PHPExcel/Reader/{0}.php', 'class' => 'PHPExcel_Reader_{0}' )
- );
-
- /**
- * Autoresolve classes
- *
- * @var array
- * @access private
- * @static
- */
- private static $autoResolveClasses = array(
- 'Excel2007',
- 'Excel5',
- 'Excel2003XML',
- 'OOCalc',
- 'SYLK',
- 'Gnumeric',
- 'HTML',
- 'CSV',
- );
-
- /**
- * Private constructor for PHPExcel_IOFactory
- */
- private function __construct()
- {
- }
-
- /**
- * Get search locations
- *
- * @static
- * @access public
- * @return array
- */
- public static function getSearchLocations()
- {
- return self::$searchLocations;
- }
-
- /**
- * Set search locations
- *
- * @static
- * @access public
- * @param array $value
- * @throws PHPExcel_Reader_Exception
- */
- public static function setSearchLocations($value)
- {
- if (is_array($value)) {
- self::$searchLocations = $value;
- } else {
- throw new PHPExcel_Reader_Exception('Invalid parameter passed.');
- }
- }
-
- /**
- * Add search location
- *
- * @static
- * @access public
- * @param string $type Example: IWriter
- * @param string $location Example: PHPExcel/Writer/{0}.php
- * @param string $classname Example: PHPExcel_Writer_{0}
- */
- public static function addSearchLocation($type = '', $location = '', $classname = '')
- {
- self::$searchLocations[] = array( 'type' => $type, 'path' => $location, 'class' => $classname );
- }
-
- /**
- * Create PHPExcel_Writer_IWriter
- *
- * @static
- * @access public
- * @param PHPExcel $phpExcel
- * @param string $writerType Example: Excel2007
- * @return PHPExcel_Writer_IWriter
- * @throws PHPExcel_Reader_Exception
- */
- public static function createWriter(PHPExcel $phpExcel, $writerType = '')
- {
- // Search type
- $searchType = 'IWriter';
-
- // Include class
- foreach (self::$searchLocations as $searchLocation) {
- if ($searchLocation['type'] == $searchType) {
- $className = str_replace('{0}', $writerType, $searchLocation['class']);
-
- $instance = new $className($phpExcel);
- if ($instance !== null) {
- return $instance;
- }
- }
- }
-
- // Nothing found...
- throw new PHPExcel_Reader_Exception("No $searchType found for type $writerType");
- }
-
- /**
- * Create PHPExcel_Reader_IReader
- *
- * @static
- * @access public
- * @param string $readerType Example: Excel2007
- * @return PHPExcel_Reader_IReader
- * @throws PHPExcel_Reader_Exception
- */
- public static function createReader($readerType = '')
- {
- // Search type
- $searchType = 'IReader';
-
- // Include class
- foreach (self::$searchLocations as $searchLocation) {
- if ($searchLocation['type'] == $searchType) {
- $className = str_replace('{0}', $readerType, $searchLocation['class']);
-
- $instance = new $className();
- if ($instance !== null) {
- return $instance;
- }
- }
- }
-
- // Nothing found...
- throw new PHPExcel_Reader_Exception("No $searchType found for type $readerType");
- }
-
- /**
- * Loads PHPExcel from file using automatic PHPExcel_Reader_IReader resolution
- *
- * @static
- * @access public
- * @param string $pFilename The name of the spreadsheet file
- * @return PHPExcel
- * @throws PHPExcel_Reader_Exception
- */
- public static function load($pFilename)
- {
- $reader = self::createReaderForFile($pFilename);
- return $reader->load($pFilename);
- }
-
- /**
- * Identify file type using automatic PHPExcel_Reader_IReader resolution
- *
- * @static
- * @access public
- * @param string $pFilename The name of the spreadsheet file to identify
- * @return string
- * @throws PHPExcel_Reader_Exception
- */
- public static function identify($pFilename)
- {
- $reader = self::createReaderForFile($pFilename);
- $className = get_class($reader);
- $classType = explode('_', $className);
- unset($reader);
- return array_pop($classType);
- }
-
- /**
- * Create PHPExcel_Reader_IReader for file using automatic PHPExcel_Reader_IReader resolution
- *
- * @static
- * @access public
- * @param string $pFilename The name of the spreadsheet file
- * @return PHPExcel_Reader_IReader
- * @throws PHPExcel_Reader_Exception
- */
- public static function createReaderForFile($pFilename)
- {
- // First, lucky guess by inspecting file extension
- $pathinfo = pathinfo($pFilename);
-
- $extensionType = null;
- if (isset($pathinfo['extension'])) {
- switch (strtolower($pathinfo['extension'])) {
- case 'xlsx': // Excel (OfficeOpenXML) Spreadsheet
- case 'xlsm': // Excel (OfficeOpenXML) Macro Spreadsheet (macros will be discarded)
- case 'xltx': // Excel (OfficeOpenXML) Template
- case 'xltm': // Excel (OfficeOpenXML) Macro Template (macros will be discarded)
- $extensionType = 'Excel2007';
- break;
- case 'xls': // Excel (BIFF) Spreadsheet
- case 'xlt': // Excel (BIFF) Template
- $extensionType = 'Excel5';
- break;
- case 'ods': // Open/Libre Offic Calc
- case 'ots': // Open/Libre Offic Calc Template
- $extensionType = 'OOCalc';
- break;
- case 'slk':
- $extensionType = 'SYLK';
- break;
- case 'xml': // Excel 2003 SpreadSheetML
- $extensionType = 'Excel2003XML';
- break;
- case 'gnumeric':
- $extensionType = 'Gnumeric';
- break;
- case 'htm':
- case 'html':
- $extensionType = 'HTML';
- break;
- case 'csv':
- // Do nothing
- // We must not try to use CSV reader since it loads
- // all files including Excel files etc.
- break;
- default:
- break;
- }
-
- if ($extensionType !== null) {
- $reader = self::createReader($extensionType);
- // Let's see if we are lucky
- if (isset($reader) && $reader->canRead($pFilename)) {
- return $reader;
- }
- }
- }
-
- // If we reach here then "lucky guess" didn't give any result
- // Try walking through all the options in self::$autoResolveClasses
- foreach (self::$autoResolveClasses as $autoResolveClass) {
- // Ignore our original guess, we know that won't work
- if ($autoResolveClass !== $extensionType) {
- $reader = self::createReader($autoResolveClass);
- if ($reader->canRead($pFilename)) {
- return $reader;
- }
- }
- }
-
- throw new PHPExcel_Reader_Exception('Unable to identify a reader for this file');
- }
-}
diff --git a/lib/phpexcel/PHPExcel/NamedRange.php b/lib/phpexcel/PHPExcel/NamedRange.php
deleted file mode 100644
index 2848db838bc..00000000000
--- a/lib/phpexcel/PHPExcel/NamedRange.php
+++ /dev/null
@@ -1,249 +0,0 @@
-worksheet)
- *
- * @var bool
- */
- private $localOnly;
-
- /**
- * Scope
- *
- * @var PHPExcel_Worksheet
- */
- private $scope;
-
- /**
- * Create a new NamedRange
- *
- * @param string $pName
- * @param PHPExcel_Worksheet $pWorksheet
- * @param string $pRange
- * @param bool $pLocalOnly
- * @param PHPExcel_Worksheet|null $pScope Scope. Only applies when $pLocalOnly = true. Null for global scope.
- * @throws PHPExcel_Exception
- */
- public function __construct($pName = null, PHPExcel_Worksheet $pWorksheet, $pRange = 'A1', $pLocalOnly = false, $pScope = null)
- {
- // Validate data
- if (($pName === null) || ($pWorksheet === null) || ($pRange === null)) {
- throw new PHPExcel_Exception('Parameters can not be null.');
- }
-
- // Set local members
- $this->name = $pName;
- $this->worksheet = $pWorksheet;
- $this->range = $pRange;
- $this->localOnly = $pLocalOnly;
- $this->scope = ($pLocalOnly == true) ? (($pScope == null) ? $pWorksheet : $pScope) : null;
- }
-
- /**
- * Get name
- *
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
-
- /**
- * Set name
- *
- * @param string $value
- * @return PHPExcel_NamedRange
- */
- public function setName($value = null)
- {
- if ($value !== null) {
- // Old title
- $oldTitle = $this->name;
-
- // Re-attach
- if ($this->worksheet !== null) {
- $this->worksheet->getParent()->removeNamedRange($this->name, $this->worksheet);
- }
- $this->name = $value;
-
- if ($this->worksheet !== null) {
- $this->worksheet->getParent()->addNamedRange($this);
- }
-
- // New title
- $newTitle = $this->name;
- PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->worksheet->getParent(), $oldTitle, $newTitle);
- }
- return $this;
- }
-
- /**
- * Get worksheet
- *
- * @return PHPExcel_Worksheet
- */
- public function getWorksheet()
- {
- return $this->worksheet;
- }
-
- /**
- * Set worksheet
- *
- * @param PHPExcel_Worksheet $value
- * @return PHPExcel_NamedRange
- */
- public function setWorksheet(PHPExcel_Worksheet $value = null)
- {
- if ($value !== null) {
- $this->worksheet = $value;
- }
- return $this;
- }
-
- /**
- * Get range
- *
- * @return string
- */
- public function getRange()
- {
- return $this->range;
- }
-
- /**
- * Set range
- *
- * @param string $value
- * @return PHPExcel_NamedRange
- */
- public function setRange($value = null)
- {
- if ($value !== null) {
- $this->range = $value;
- }
- return $this;
- }
-
- /**
- * Get localOnly
- *
- * @return bool
- */
- public function getLocalOnly()
- {
- return $this->localOnly;
- }
-
- /**
- * Set localOnly
- *
- * @param bool $value
- * @return PHPExcel_NamedRange
- */
- public function setLocalOnly($value = false)
- {
- $this->localOnly = $value;
- $this->scope = $value ? $this->worksheet : null;
- return $this;
- }
-
- /**
- * Get scope
- *
- * @return PHPExcel_Worksheet|null
- */
- public function getScope()
- {
- return $this->scope;
- }
-
- /**
- * Set scope
- *
- * @param PHPExcel_Worksheet|null $value
- * @return PHPExcel_NamedRange
- */
- public function setScope(PHPExcel_Worksheet $value = null)
- {
- $this->scope = $value;
- $this->localOnly = ($value == null) ? false : true;
- return $this;
- }
-
- /**
- * Resolve a named range to a regular cell range
- *
- * @param string $pNamedRange Named range
- * @param PHPExcel_Worksheet|null $pSheet Scope. Use null for global scope
- * @return PHPExcel_NamedRange
- */
- public static function resolveRange($pNamedRange = '', PHPExcel_Worksheet $pSheet)
- {
- return $pSheet->getParent()->getNamedRange($pNamedRange, $pSheet);
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Reader/Abstract.php b/lib/phpexcel/PHPExcel/Reader/Abstract.php
deleted file mode 100644
index 5902574b941..00000000000
--- a/lib/phpexcel/PHPExcel/Reader/Abstract.php
+++ /dev/null
@@ -1,253 +0,0 @@
-readDataOnly;
- }
-
- /**
- * Set read data only
- * Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information.
- * Set to false (the default) to advise the Reader to read both data and formatting for cells.
- *
- * @param boolean $pValue
- *
- * @return PHPExcel_Reader_IReader
- */
- public function setReadDataOnly($pValue = false)
- {
- $this->readDataOnly = $pValue;
- return $this;
- }
-
- /**
- * Read charts in workbook?
- * If this is true, then the Reader will include any charts that exist in the workbook.
- * Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value.
- * If false (the default) it will ignore any charts defined in the workbook file.
- *
- * @return boolean
- */
- public function getIncludeCharts()
- {
- return $this->includeCharts;
- }
-
- /**
- * Set read charts in workbook
- * Set to true, to advise the Reader to include any charts that exist in the workbook.
- * Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value.
- * Set to false (the default) to discard charts.
- *
- * @param boolean $pValue
- *
- * @return PHPExcel_Reader_IReader
- */
- public function setIncludeCharts($pValue = false)
- {
- $this->includeCharts = (boolean) $pValue;
- return $this;
- }
-
- /**
- * Get which sheets to load
- * Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null
- * indicating that all worksheets in the workbook should be loaded.
- *
- * @return mixed
- */
- public function getLoadSheetsOnly()
- {
- return $this->loadSheetsOnly;
- }
-
- /**
- * Set which sheets to load
- *
- * @param mixed $value
- * This should be either an array of worksheet names to be loaded, or a string containing a single worksheet name.
- * If NULL, then it tells the Reader to read all worksheets in the workbook
- *
- * @return PHPExcel_Reader_IReader
- */
- public function setLoadSheetsOnly($value = null)
- {
- if ($value === null) {
- return $this->setLoadAllSheets();
- }
-
- $this->loadSheetsOnly = is_array($value) ? $value : array($value);
- return $this;
- }
-
- /**
- * Set all sheets to load
- * Tells the Reader to load all worksheets from the workbook.
- *
- * @return PHPExcel_Reader_IReader
- */
- public function setLoadAllSheets()
- {
- $this->loadSheetsOnly = null;
- return $this;
- }
-
- /**
- * Read filter
- *
- * @return PHPExcel_Reader_IReadFilter
- */
- public function getReadFilter()
- {
- return $this->readFilter;
- }
-
- /**
- * Set read filter
- *
- * @param PHPExcel_Reader_IReadFilter $pValue
- * @return PHPExcel_Reader_IReader
- */
- public function setReadFilter(PHPExcel_Reader_IReadFilter $pValue)
- {
- $this->readFilter = $pValue;
- return $this;
- }
-
- /**
- * Open file for reading
- *
- * @param string $pFilename
- * @throws PHPExcel_Reader_Exception
- * @return resource
- */
- protected function openFile($pFilename)
- {
- // Check if file exists
- if (!file_exists($pFilename) || !is_readable($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
-
- // Open file
- $this->fileHandle = fopen($pFilename, 'r');
- if ($this->fileHandle === false) {
- throw new PHPExcel_Reader_Exception("Could not open file " . $pFilename . " for reading.");
- }
- }
-
- /**
- * Can the current PHPExcel_Reader_IReader read the file?
- *
- * @param string $pFilename
- * @return boolean
- * @throws PHPExcel_Reader_Exception
- */
- public function canRead($pFilename)
- {
- // Check if file exists
- try {
- $this->openFile($pFilename);
- } catch (Exception $e) {
- return false;
- }
-
- $readable = $this->isValidFormat();
- fclose($this->fileHandle);
- return $readable;
- }
-
- /**
- * Scan theXML for use of securityScan(file_get_contents($filestream));
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Reader/CSV.php b/lib/phpexcel/PHPExcel/Reader/CSV.php
deleted file mode 100644
index db96b608477..00000000000
--- a/lib/phpexcel/PHPExcel/Reader/CSV.php
+++ /dev/null
@@ -1,386 +0,0 @@
-readFilter = new PHPExcel_Reader_DefaultReadFilter();
- }
-
- /**
- * Validate that the current file is a CSV file
- *
- * @return boolean
- */
- protected function isValidFormat()
- {
- return true;
- }
-
- /**
- * Set input encoding
- *
- * @param string $pValue Input encoding
- */
- public function setInputEncoding($pValue = 'UTF-8')
- {
- $this->inputEncoding = $pValue;
- return $this;
- }
-
- /**
- * Get input encoding
- *
- * @return string
- */
- public function getInputEncoding()
- {
- return $this->inputEncoding;
- }
-
- /**
- * Move filepointer past any BOM marker
- *
- */
- protected function skipBOM()
- {
- rewind($this->fileHandle);
-
- switch ($this->inputEncoding) {
- case 'UTF-8':
- fgets($this->fileHandle, 4) == "\xEF\xBB\xBF" ?
- fseek($this->fileHandle, 3) : fseek($this->fileHandle, 0);
- break;
- case 'UTF-16LE':
- fgets($this->fileHandle, 3) == "\xFF\xFE" ?
- fseek($this->fileHandle, 2) : fseek($this->fileHandle, 0);
- break;
- case 'UTF-16BE':
- fgets($this->fileHandle, 3) == "\xFE\xFF" ?
- fseek($this->fileHandle, 2) : fseek($this->fileHandle, 0);
- break;
- case 'UTF-32LE':
- fgets($this->fileHandle, 5) == "\xFF\xFE\x00\x00" ?
- fseek($this->fileHandle, 4) : fseek($this->fileHandle, 0);
- break;
- case 'UTF-32BE':
- fgets($this->fileHandle, 5) == "\x00\x00\xFE\xFF" ?
- fseek($this->fileHandle, 4) : fseek($this->fileHandle, 0);
- break;
- default:
- break;
- }
- }
-
- /**
- * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)
- *
- * @param string $pFilename
- * @throws PHPExcel_Reader_Exception
- */
- public function listWorksheetInfo($pFilename)
- {
- // Open file
- $this->openFile($pFilename);
- if (!$this->isValidFormat()) {
- fclose($this->fileHandle);
- throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file.");
- }
- $fileHandle = $this->fileHandle;
-
- // Skip BOM, if any
- $this->skipBOM();
-
- $escapeEnclosures = array( "\\" . $this->enclosure, $this->enclosure . $this->enclosure );
-
- $worksheetInfo = array();
- $worksheetInfo[0]['worksheetName'] = 'Worksheet';
- $worksheetInfo[0]['lastColumnLetter'] = 'A';
- $worksheetInfo[0]['lastColumnIndex'] = 0;
- $worksheetInfo[0]['totalRows'] = 0;
- $worksheetInfo[0]['totalColumns'] = 0;
-
- // Loop through each line of the file in turn
- while (($rowData = fgetcsv($fileHandle, 0, $this->delimiter, $this->enclosure)) !== false) {
- $worksheetInfo[0]['totalRows']++;
- $worksheetInfo[0]['lastColumnIndex'] = max($worksheetInfo[0]['lastColumnIndex'], count($rowData) - 1);
- }
-
- $worksheetInfo[0]['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($worksheetInfo[0]['lastColumnIndex']);
- $worksheetInfo[0]['totalColumns'] = $worksheetInfo[0]['lastColumnIndex'] + 1;
-
- // Close file
- fclose($fileHandle);
-
- return $worksheetInfo;
- }
-
- /**
- * Loads PHPExcel from file
- *
- * @param string $pFilename
- * @return PHPExcel
- * @throws PHPExcel_Reader_Exception
- */
- public function load($pFilename)
- {
- // Create new PHPExcel
- $objPHPExcel = new PHPExcel();
-
- // Load into this instance
- return $this->loadIntoExisting($pFilename, $objPHPExcel);
- }
-
- /**
- * Loads PHPExcel from file into PHPExcel instance
- *
- * @param string $pFilename
- * @param PHPExcel $objPHPExcel
- * @return PHPExcel
- * @throws PHPExcel_Reader_Exception
- */
- public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
- {
- $lineEnding = ini_get('auto_detect_line_endings');
- ini_set('auto_detect_line_endings', true);
-
- // Open file
- $this->openFile($pFilename);
- if (!$this->isValidFormat()) {
- fclose($this->fileHandle);
- throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file.");
- }
- $fileHandle = $this->fileHandle;
-
- // Skip BOM, if any
- $this->skipBOM();
-
- // Create new PHPExcel object
- while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) {
- $objPHPExcel->createSheet();
- }
- $sheet = $objPHPExcel->setActiveSheetIndex($this->sheetIndex);
-
- $escapeEnclosures = array( "\\" . $this->enclosure,
- $this->enclosure . $this->enclosure
- );
-
- // Set our starting row based on whether we're in contiguous mode or not
- $currentRow = 1;
- if ($this->contiguous) {
- $currentRow = ($this->contiguousRow == -1) ? $sheet->getHighestRow(): $this->contiguousRow;
- }
-
- // Loop through each line of the file in turn
- while (($rowData = fgetcsv($fileHandle, 0, $this->delimiter, $this->enclosure)) !== false) {
- $columnLetter = 'A';
- foreach ($rowData as $rowDatum) {
- if ($rowDatum != '' && $this->readFilter->readCell($columnLetter, $currentRow)) {
- // Unescape enclosures
- $rowDatum = str_replace($escapeEnclosures, $this->enclosure, $rowDatum);
-
- // Convert encoding if necessary
- if ($this->inputEncoding !== 'UTF-8') {
- $rowDatum = PHPExcel_Shared_String::ConvertEncoding($rowDatum, 'UTF-8', $this->inputEncoding);
- }
-
- // Set cell value
- $sheet->getCell($columnLetter . $currentRow)->setValue($rowDatum);
- }
- ++$columnLetter;
- }
- ++$currentRow;
- }
-
- // Close file
- fclose($fileHandle);
-
- if ($this->contiguous) {
- $this->contiguousRow = $currentRow;
- }
-
- ini_set('auto_detect_line_endings', $lineEnding);
-
- // Return
- return $objPHPExcel;
- }
-
- /**
- * Get delimiter
- *
- * @return string
- */
- public function getDelimiter()
- {
- return $this->delimiter;
- }
-
- /**
- * Set delimiter
- *
- * @param string $pValue Delimiter, defaults to ,
- * @return PHPExcel_Reader_CSV
- */
- public function setDelimiter($pValue = ',')
- {
- $this->delimiter = $pValue;
- return $this;
- }
-
- /**
- * Get enclosure
- *
- * @return string
- */
- public function getEnclosure()
- {
- return $this->enclosure;
- }
-
- /**
- * Set enclosure
- *
- * @param string $pValue Enclosure, defaults to "
- * @return PHPExcel_Reader_CSV
- */
- public function setEnclosure($pValue = '"')
- {
- if ($pValue == '') {
- $pValue = '"';
- }
- $this->enclosure = $pValue;
- return $this;
- }
-
- /**
- * Get sheet index
- *
- * @return integer
- */
- public function getSheetIndex()
- {
- return $this->sheetIndex;
- }
-
- /**
- * Set sheet index
- *
- * @param integer $pValue Sheet index
- * @return PHPExcel_Reader_CSV
- */
- public function setSheetIndex($pValue = 0)
- {
- $this->sheetIndex = $pValue;
- return $this;
- }
-
- /**
- * Set Contiguous
- *
- * @param boolean $contiguous
- */
- public function setContiguous($contiguous = false)
- {
- $this->contiguous = (bool) $contiguous;
- if (!$contiguous) {
- $this->contiguousRow = -1;
- }
-
- return $this;
- }
-
- /**
- * Get Contiguous
- *
- * @return boolean
- */
- public function getContiguous()
- {
- return $this->contiguous;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Reader/DefaultReadFilter.php b/lib/phpexcel/PHPExcel/Reader/DefaultReadFilter.php
deleted file mode 100644
index ea25f63c5fa..00000000000
--- a/lib/phpexcel/PHPExcel/Reader/DefaultReadFilter.php
+++ /dev/null
@@ -1,51 +0,0 @@
-readFilter = new PHPExcel_Reader_DefaultReadFilter();
- $this->referenceHelper = PHPExcel_ReferenceHelper::getInstance();
- }
-
- /**
- * Can the current PHPExcel_Reader_IReader read the file?
- *
- * @param string $pFilename
- * @return boolean
- * @throws PHPExcel_Reader_Exception
- */
- public function canRead($pFilename)
- {
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
-
- $zipClass = PHPExcel_Settings::getZipClass();
-
- // Check if zip class exists
-// if (!class_exists($zipClass, false)) {
-// throw new PHPExcel_Reader_Exception($zipClass . " library is not enabled");
-// }
-
- $xl = false;
- // Load file
- $zip = new $zipClass;
- if ($zip->open($pFilename) === true) {
- // check if it is an OOXML archive
- $rels = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "_rels/.rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
- if ($rels !== false) {
- foreach ($rels->Relationship as $rel) {
- switch ($rel["Type"]) {
- case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument":
- if (basename($rel["Target"]) == 'workbook.xml') {
- $xl = true;
- }
- break;
-
- }
- }
- }
- $zip->close();
- }
-
- return $xl;
- }
-
-
- /**
- * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object
- *
- * @param string $pFilename
- * @throws PHPExcel_Reader_Exception
- */
- public function listWorksheetNames($pFilename)
- {
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
-
- $worksheetNames = array();
-
- $zipClass = PHPExcel_Settings::getZipClass();
-
- $zip = new $zipClass;
- $zip->open($pFilename);
-
- // The files we're looking at here are small enough that simpleXML is more efficient than XMLReader
- $rels = simplexml_load_string(
- $this->securityScan($this->getFromZipArchive($zip, "_rels/.rels"), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions())
- ); //~ http://schemas.openxmlformats.org/package/2006/relationships");
- foreach ($rels->Relationship as $rel) {
- switch ($rel["Type"]) {
- case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument":
- $xmlWorkbook = simplexml_load_string(
- $this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}"), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions())
- ); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
-
- if ($xmlWorkbook->sheets) {
- foreach ($xmlWorkbook->sheets->sheet as $eleSheet) {
- // Check if sheet should be skipped
- $worksheetNames[] = (string) $eleSheet["name"];
- }
- }
- }
- }
-
- $zip->close();
-
- return $worksheetNames;
- }
-
-
- /**
- * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)
- *
- * @param string $pFilename
- * @throws PHPExcel_Reader_Exception
- */
- public function listWorksheetInfo($pFilename)
- {
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
-
- $worksheetInfo = array();
-
- $zipClass = PHPExcel_Settings::getZipClass();
-
- $zip = new $zipClass;
- $zip->open($pFilename);
-
- $rels = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "_rels/.rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
- foreach ($rels->Relationship as $rel) {
- if ($rel["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument") {
- $dir = dirname($rel["Target"]);
- $relsWorkbook = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
- $relsWorkbook->registerXPathNamespace("rel", "http://schemas.openxmlformats.org/package/2006/relationships");
-
- $worksheets = array();
- foreach ($relsWorkbook->Relationship as $ele) {
- if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet") {
- $worksheets[(string) $ele["Id"]] = $ele["Target"];
- }
- }
-
- $xmlWorkbook = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
- if ($xmlWorkbook->sheets) {
- $dir = dirname($rel["Target"]);
- foreach ($xmlWorkbook->sheets->sheet as $eleSheet) {
- $tmpInfo = array(
- 'worksheetName' => (string) $eleSheet["name"],
- 'lastColumnLetter' => 'A',
- 'lastColumnIndex' => 0,
- 'totalRows' => 0,
- 'totalColumns' => 0,
- );
-
- $fileWorksheet = $worksheets[(string) self::getArrayItem($eleSheet->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")];
-
- $xml = new XMLReader();
- $res = $xml->xml($this->securityScanFile('zip://'.PHPExcel_Shared_File::realpath($pFilename).'#'."$dir/$fileWorksheet"), null, PHPExcel_Settings::getLibXmlLoaderOptions());
- $xml->setParserProperty(2, true);
-
- $currCells = 0;
- while ($xml->read()) {
- if ($xml->name == 'row' && $xml->nodeType == XMLReader::ELEMENT) {
- $row = $xml->getAttribute('r');
- $tmpInfo['totalRows'] = $row;
- $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells);
- $currCells = 0;
- } elseif ($xml->name == 'c' && $xml->nodeType == XMLReader::ELEMENT) {
- $currCells++;
- }
- }
- $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells);
- $xml->close();
-
- $tmpInfo['lastColumnIndex'] = $tmpInfo['totalColumns'] - 1;
- $tmpInfo['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
-
- $worksheetInfo[] = $tmpInfo;
- }
- }
- }
- }
-
- $zip->close();
-
- return $worksheetInfo;
- }
-
- private static function castToBoolean($c)
- {
-// echo 'Initial Cast to Boolean', PHP_EOL;
- $value = isset($c->v) ? (string) $c->v : null;
- if ($value == '0') {
- return false;
- } elseif ($value == '1') {
- return true;
- } else {
- return (bool)$c->v;
- }
- return $value;
- }
-
- private static function castToError($c)
- {
-// echo 'Initial Cast to Error', PHP_EOL;
- return isset($c->v) ? (string) $c->v : null;
- }
-
- private static function castToString($c)
- {
-// echo 'Initial Cast to String, PHP_EOL;
- return isset($c->v) ? (string) $c->v : null;
- }
-
- private function castToFormula($c, $r, &$cellDataType, &$value, &$calculatedValue, &$sharedFormulas, $castBaseType)
- {
-// echo 'Formula', PHP_EOL;
-// echo '$c->f is ', $c->f, PHP_EOL;
- $cellDataType = 'f';
- $value = "={$c->f}";
- $calculatedValue = self::$castBaseType($c);
-
- // Shared formula?
- if (isset($c->f['t']) && strtolower((string)$c->f['t']) == 'shared') {
-// echo 'SHARED FORMULA', PHP_EOL;
- $instance = (string)$c->f['si'];
-
-// echo 'Instance ID = ', $instance, PHP_EOL;
-//
-// echo 'Shared Formula Array:', PHP_EOL;
-// print_r($sharedFormulas);
- if (!isset($sharedFormulas[(string)$c->f['si']])) {
-// echo 'SETTING NEW SHARED FORMULA', PHP_EOL;
-// echo 'Master is ', $r, PHP_EOL;
-// echo 'Formula is ', $value, PHP_EOL;
- $sharedFormulas[$instance] = array('master' => $r, 'formula' => $value);
-// echo 'New Shared Formula Array:', PHP_EOL;
-// print_r($sharedFormulas);
- } else {
-// echo 'GETTING SHARED FORMULA', PHP_EOL;
-// echo 'Master is ', $sharedFormulas[$instance]['master'], PHP_EOL;
-// echo 'Formula is ', $sharedFormulas[$instance]['formula'], PHP_EOL;
- $master = PHPExcel_Cell::coordinateFromString($sharedFormulas[$instance]['master']);
- $current = PHPExcel_Cell::coordinateFromString($r);
-
- $difference = array(0, 0);
- $difference[0] = PHPExcel_Cell::columnIndexFromString($current[0]) - PHPExcel_Cell::columnIndexFromString($master[0]);
- $difference[1] = $current[1] - $master[1];
-
- $value = $this->referenceHelper->updateFormulaReferences($sharedFormulas[$instance]['formula'], 'A1', $difference[0], $difference[1]);
-// echo 'Adjusted Formula is ', $value, PHP_EOL;
- }
- }
- }
-
-
- private function getFromZipArchive($archive, $fileName = '')
- {
- // Root-relative paths
- if (strpos($fileName, '//') !== false) {
- $fileName = substr($fileName, strpos($fileName, '//') + 1);
- }
- $fileName = PHPExcel_Shared_File::realpath($fileName);
-
- // Apache POI fixes
- $contents = $archive->getFromName($fileName);
- if ($contents === false) {
- $contents = $archive->getFromName(substr($fileName, 1));
- }
-
- return $contents;
- }
-
-
- /**
- * Loads PHPExcel from file
- *
- * @param string $pFilename
- * @return PHPExcel
- * @throws PHPExcel_Reader_Exception
- */
- public function load($pFilename)
- {
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
-
- // Initialisations
- $excel = new PHPExcel;
- $excel->removeSheetByIndex(0);
- if (!$this->readDataOnly) {
- $excel->removeCellStyleXfByIndex(0); // remove the default style
- $excel->removeCellXfByIndex(0); // remove the default style
- }
-
- $zipClass = PHPExcel_Settings::getZipClass();
-
- $zip = new $zipClass;
- $zip->open($pFilename);
-
- // Read the theme first, because we need the colour scheme when reading the styles
- $wbRels = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "xl/_rels/workbook.xml.rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
- foreach ($wbRels->Relationship as $rel) {
- switch ($rel["Type"]) {
- case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme":
- $themeOrderArray = array('lt1', 'dk1', 'lt2', 'dk2');
- $themeOrderAdditional = count($themeOrderArray);
-
- $xmlTheme = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "xl/{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
- if (is_object($xmlTheme)) {
- $xmlThemeName = $xmlTheme->attributes();
- $xmlTheme = $xmlTheme->children("http://schemas.openxmlformats.org/drawingml/2006/main");
- $themeName = (string)$xmlThemeName['name'];
-
- $colourScheme = $xmlTheme->themeElements->clrScheme->attributes();
- $colourSchemeName = (string)$colourScheme['name'];
- $colourScheme = $xmlTheme->themeElements->clrScheme->children("http://schemas.openxmlformats.org/drawingml/2006/main");
-
- $themeColours = array();
- foreach ($colourScheme as $k => $xmlColour) {
- $themePos = array_search($k, $themeOrderArray);
- if ($themePos === false) {
- $themePos = $themeOrderAdditional++;
- }
- if (isset($xmlColour->sysClr)) {
- $xmlColourData = $xmlColour->sysClr->attributes();
- $themeColours[$themePos] = $xmlColourData['lastClr'];
- } elseif (isset($xmlColour->srgbClr)) {
- $xmlColourData = $xmlColour->srgbClr->attributes();
- $themeColours[$themePos] = $xmlColourData['val'];
- }
- }
- self::$theme = new PHPExcel_Reader_Excel2007_Theme($themeName, $colourSchemeName, $themeColours);
- }
- break;
- }
- }
-
- $rels = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "_rels/.rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
- foreach ($rels->Relationship as $rel) {
- switch ($rel["Type"]) {
- case "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties":
- $xmlCore = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
- if (is_object($xmlCore)) {
- $xmlCore->registerXPathNamespace("dc", "http://purl.org/dc/elements/1.1/");
- $xmlCore->registerXPathNamespace("dcterms", "http://purl.org/dc/terms/");
- $xmlCore->registerXPathNamespace("cp", "http://schemas.openxmlformats.org/package/2006/metadata/core-properties");
- $docProps = $excel->getProperties();
- $docProps->setCreator((string) self::getArrayItem($xmlCore->xpath("dc:creator")));
- $docProps->setLastModifiedBy((string) self::getArrayItem($xmlCore->xpath("cp:lastModifiedBy")));
- $docProps->setCreated(strtotime(self::getArrayItem($xmlCore->xpath("dcterms:created")))); //! respect xsi:type
- $docProps->setModified(strtotime(self::getArrayItem($xmlCore->xpath("dcterms:modified")))); //! respect xsi:type
- $docProps->setTitle((string) self::getArrayItem($xmlCore->xpath("dc:title")));
- $docProps->setDescription((string) self::getArrayItem($xmlCore->xpath("dc:description")));
- $docProps->setSubject((string) self::getArrayItem($xmlCore->xpath("dc:subject")));
- $docProps->setKeywords((string) self::getArrayItem($xmlCore->xpath("cp:keywords")));
- $docProps->setCategory((string) self::getArrayItem($xmlCore->xpath("cp:category")));
- }
- break;
- case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties":
- $xmlCore = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
- if (is_object($xmlCore)) {
- $docProps = $excel->getProperties();
- if (isset($xmlCore->Company)) {
- $docProps->setCompany((string) $xmlCore->Company);
- }
- if (isset($xmlCore->Manager)) {
- $docProps->setManager((string) $xmlCore->Manager);
- }
- }
- break;
- case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties":
- $xmlCore = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
- if (is_object($xmlCore)) {
- $docProps = $excel->getProperties();
- foreach ($xmlCore as $xmlProperty) {
- $cellDataOfficeAttributes = $xmlProperty->attributes();
- if (isset($cellDataOfficeAttributes['name'])) {
- $propertyName = (string) $cellDataOfficeAttributes['name'];
- $cellDataOfficeChildren = $xmlProperty->children('http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes');
- $attributeType = $cellDataOfficeChildren->getName();
- $attributeValue = (string) $cellDataOfficeChildren->{$attributeType};
- $attributeValue = PHPExcel_DocumentProperties::convertProperty($attributeValue, $attributeType);
- $attributeType = PHPExcel_DocumentProperties::convertPropertyType($attributeType);
- $docProps->setCustomProperty($propertyName, $attributeValue, $attributeType);
- }
- }
- }
- break;
- //Ribbon
- case "http://schemas.microsoft.com/office/2006/relationships/ui/extensibility":
- $customUI = $rel['Target'];
- if (!is_null($customUI)) {
- $this->readRibbon($excel, $customUI, $zip);
- }
- break;
- case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument":
- $dir = dirname($rel["Target"]);
- $relsWorkbook = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel["Target"]) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
- $relsWorkbook->registerXPathNamespace("rel", "http://schemas.openxmlformats.org/package/2006/relationships");
-
- $sharedStrings = array();
- $xpath = self::getArrayItem($relsWorkbook->xpath("rel:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings']"));
- $xmlStrings = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
- if (isset($xmlStrings) && isset($xmlStrings->si)) {
- foreach ($xmlStrings->si as $val) {
- if (isset($val->t)) {
- $sharedStrings[] = PHPExcel_Shared_String::ControlCharacterOOXML2PHP((string) $val->t);
- } elseif (isset($val->r)) {
- $sharedStrings[] = $this->parseRichText($val);
- }
- }
- }
-
- $worksheets = array();
- $macros = $customUI = null;
- foreach ($relsWorkbook->Relationship as $ele) {
- switch ($ele['Type']) {
- case "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet":
- $worksheets[(string) $ele["Id"]] = $ele["Target"];
- break;
- // a vbaProject ? (: some macros)
- case "http://schemas.microsoft.com/office/2006/relationships/vbaProject":
- $macros = $ele["Target"];
- break;
- }
- }
-
- if (!is_null($macros)) {
- $macrosCode = $this->getFromZipArchive($zip, 'xl/vbaProject.bin');//vbaProject.bin always in 'xl' dir and always named vbaProject.bin
- if ($macrosCode !== false) {
- $excel->setMacrosCode($macrosCode);
- $excel->setHasMacros(true);
- //short-circuit : not reading vbaProject.bin.rel to get Signature =>allways vbaProjectSignature.bin in 'xl' dir
- $Certificate = $this->getFromZipArchive($zip, 'xl/vbaProjectSignature.bin');
- if ($Certificate !== false) {
- $excel->setMacrosCertificate($Certificate);
- }
- }
- }
- $styles = array();
- $cellStyles = array();
- $xpath = self::getArrayItem($relsWorkbook->xpath("rel:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles']"));
- $xmlStyles = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
- //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
-
- $numFmts = null;
- if ($xmlStyles && $xmlStyles->numFmts[0]) {
- $numFmts = $xmlStyles->numFmts[0];
- }
- if (isset($numFmts) && ($numFmts !== null)) {
- $numFmts->registerXPathNamespace("sml", "http://schemas.openxmlformats.org/spreadsheetml/2006/main");
- }
- if (!$this->readDataOnly && $xmlStyles) {
- foreach ($xmlStyles->cellXfs->xf as $xf) {
- $numFmt = PHPExcel_Style_NumberFormat::FORMAT_GENERAL;
-
- if ($xf["numFmtId"]) {
- if (isset($numFmts)) {
- $tmpNumFmt = self::getArrayItem($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]"));
-
- if (isset($tmpNumFmt["formatCode"])) {
- $numFmt = (string) $tmpNumFmt["formatCode"];
- }
- }
-
- // We shouldn't override any of the built-in MS Excel values (values below id 164)
- // But there's a lot of naughty homebrew xlsx writers that do use "reserved" id values that aren't actually used
- // So we make allowance for them rather than lose formatting masks
- if ((int)$xf["numFmtId"] < 164 && PHPExcel_Style_NumberFormat::builtInFormatCodeIndex((int)$xf["numFmtId"]) !== false) {
- $numFmt = PHPExcel_Style_NumberFormat::builtInFormatCode((int)$xf["numFmtId"]);
- }
- }
- $quotePrefix = false;
- if (isset($xf["quotePrefix"])) {
- $quotePrefix = (boolean) $xf["quotePrefix"];
- }
-
- $style = (object) array(
- "numFmt" => $numFmt,
- "font" => $xmlStyles->fonts->font[intval($xf["fontId"])],
- "fill" => $xmlStyles->fills->fill[intval($xf["fillId"])],
- "border" => $xmlStyles->borders->border[intval($xf["borderId"])],
- "alignment" => $xf->alignment,
- "protection" => $xf->protection,
- "quotePrefix" => $quotePrefix,
- );
- $styles[] = $style;
-
- // add style to cellXf collection
- $objStyle = new PHPExcel_Style;
- self::readStyle($objStyle, $style);
- $excel->addCellXf($objStyle);
- }
-
- foreach ($xmlStyles->cellStyleXfs->xf as $xf) {
- $numFmt = PHPExcel_Style_NumberFormat::FORMAT_GENERAL;
- if ($numFmts && $xf["numFmtId"]) {
- $tmpNumFmt = self::getArrayItem($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]"));
- if (isset($tmpNumFmt["formatCode"])) {
- $numFmt = (string) $tmpNumFmt["formatCode"];
- } elseif ((int)$xf["numFmtId"] < 165) {
- $numFmt = PHPExcel_Style_NumberFormat::builtInFormatCode((int)$xf["numFmtId"]);
- }
- }
-
- $cellStyle = (object) array(
- "numFmt" => $numFmt,
- "font" => $xmlStyles->fonts->font[intval($xf["fontId"])],
- "fill" => $xmlStyles->fills->fill[intval($xf["fillId"])],
- "border" => $xmlStyles->borders->border[intval($xf["borderId"])],
- "alignment" => $xf->alignment,
- "protection" => $xf->protection,
- "quotePrefix" => $quotePrefix,
- );
- $cellStyles[] = $cellStyle;
-
- // add style to cellStyleXf collection
- $objStyle = new PHPExcel_Style;
- self::readStyle($objStyle, $cellStyle);
- $excel->addCellStyleXf($objStyle);
- }
- }
-
- $dxfs = array();
- if (!$this->readDataOnly && $xmlStyles) {
- // Conditional Styles
- if ($xmlStyles->dxfs) {
- foreach ($xmlStyles->dxfs->dxf as $dxf) {
- $style = new PHPExcel_Style(false, true);
- self::readStyle($style, $dxf);
- $dxfs[] = $style;
- }
- }
- // Cell Styles
- if ($xmlStyles->cellStyles) {
- foreach ($xmlStyles->cellStyles->cellStyle as $cellStyle) {
- if (intval($cellStyle['builtinId']) == 0) {
- if (isset($cellStyles[intval($cellStyle['xfId'])])) {
- // Set default style
- $style = new PHPExcel_Style;
- self::readStyle($style, $cellStyles[intval($cellStyle['xfId'])]);
-
- // normal style, currently not using it for anything
- }
- }
- }
- }
- }
-
- $xmlWorkbook = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "{$rel['Target']}")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
-
- // Set base date
- if ($xmlWorkbook->workbookPr) {
- PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900);
- if (isset($xmlWorkbook->workbookPr['date1904'])) {
- if (self::boolean((string) $xmlWorkbook->workbookPr['date1904'])) {
- PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904);
- }
- }
- }
-
- $sheetId = 0; // keep track of new sheet id in final workbook
- $oldSheetId = -1; // keep track of old sheet id in final workbook
- $countSkippedSheets = 0; // keep track of number of skipped sheets
- $mapSheetId = array(); // mapping of sheet ids from old to new
-
- $charts = $chartDetails = array();
-
- if ($xmlWorkbook->sheets) {
- foreach ($xmlWorkbook->sheets->sheet as $eleSheet) {
- ++$oldSheetId;
-
- // Check if sheet should be skipped
- if (isset($this->loadSheetsOnly) && !in_array((string) $eleSheet["name"], $this->loadSheetsOnly)) {
- ++$countSkippedSheets;
- $mapSheetId[$oldSheetId] = null;
- continue;
- }
-
- // Map old sheet id in original workbook to new sheet id.
- // They will differ if loadSheetsOnly() is being used
- $mapSheetId[$oldSheetId] = $oldSheetId - $countSkippedSheets;
-
- // Load sheet
- $docSheet = $excel->createSheet();
- // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet
- // references in formula cells... during the load, all formulae should be correct,
- // and we're simply bringing the worksheet name in line with the formula, not the
- // reverse
- $docSheet->setTitle((string) $eleSheet["name"], false);
- $fileWorksheet = $worksheets[(string) self::getArrayItem($eleSheet->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")];
- $xmlSheet = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "$dir/$fileWorksheet")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main");
-
- $sharedFormulas = array();
-
- if (isset($eleSheet["state"]) && (string) $eleSheet["state"] != '') {
- $docSheet->setSheetState((string) $eleSheet["state"]);
- }
-
- if (isset($xmlSheet->sheetViews) && isset($xmlSheet->sheetViews->sheetView)) {
- if (isset($xmlSheet->sheetViews->sheetView['zoomScale'])) {
- $docSheet->getSheetView()->setZoomScale(intval($xmlSheet->sheetViews->sheetView['zoomScale']));
- }
- if (isset($xmlSheet->sheetViews->sheetView['zoomScaleNormal'])) {
- $docSheet->getSheetView()->setZoomScaleNormal(intval($xmlSheet->sheetViews->sheetView['zoomScaleNormal']));
- }
- if (isset($xmlSheet->sheetViews->sheetView['view'])) {
- $docSheet->getSheetView()->setView((string) $xmlSheet->sheetViews->sheetView['view']);
- }
- if (isset($xmlSheet->sheetViews->sheetView['showGridLines'])) {
- $docSheet->setShowGridLines(self::boolean((string)$xmlSheet->sheetViews->sheetView['showGridLines']));
- }
- if (isset($xmlSheet->sheetViews->sheetView['showRowColHeaders'])) {
- $docSheet->setShowRowColHeaders(self::boolean((string)$xmlSheet->sheetViews->sheetView['showRowColHeaders']));
- }
- if (isset($xmlSheet->sheetViews->sheetView['rightToLeft'])) {
- $docSheet->setRightToLeft(self::boolean((string)$xmlSheet->sheetViews->sheetView['rightToLeft']));
- }
- if (isset($xmlSheet->sheetViews->sheetView->pane)) {
- if (isset($xmlSheet->sheetViews->sheetView->pane['topLeftCell'])) {
- $docSheet->freezePane((string)$xmlSheet->sheetViews->sheetView->pane['topLeftCell']);
- } else {
- $xSplit = 0;
- $ySplit = 0;
-
- if (isset($xmlSheet->sheetViews->sheetView->pane['xSplit'])) {
- $xSplit = 1 + intval($xmlSheet->sheetViews->sheetView->pane['xSplit']);
- }
-
- if (isset($xmlSheet->sheetViews->sheetView->pane['ySplit'])) {
- $ySplit = 1 + intval($xmlSheet->sheetViews->sheetView->pane['ySplit']);
- }
-
- $docSheet->freezePaneByColumnAndRow($xSplit, $ySplit);
- }
- }
-
- if (isset($xmlSheet->sheetViews->sheetView->selection)) {
- if (isset($xmlSheet->sheetViews->sheetView->selection['sqref'])) {
- $sqref = (string)$xmlSheet->sheetViews->sheetView->selection['sqref'];
- $sqref = explode(' ', $sqref);
- $sqref = $sqref[0];
- $docSheet->setSelectedCells($sqref);
- }
- }
- }
-
- if (isset($xmlSheet->sheetPr) && isset($xmlSheet->sheetPr->tabColor)) {
- if (isset($xmlSheet->sheetPr->tabColor['rgb'])) {
- $docSheet->getTabColor()->setARGB((string)$xmlSheet->sheetPr->tabColor['rgb']);
- }
- }
- if (isset($xmlSheet->sheetPr) && isset($xmlSheet->sheetPr['codeName'])) {
- $docSheet->setCodeName((string) $xmlSheet->sheetPr['codeName']);
- }
- if (isset($xmlSheet->sheetPr) && isset($xmlSheet->sheetPr->outlinePr)) {
- if (isset($xmlSheet->sheetPr->outlinePr['summaryRight']) &&
- !self::boolean((string) $xmlSheet->sheetPr->outlinePr['summaryRight'])) {
- $docSheet->setShowSummaryRight(false);
- } else {
- $docSheet->setShowSummaryRight(true);
- }
-
- if (isset($xmlSheet->sheetPr->outlinePr['summaryBelow']) &&
- !self::boolean((string) $xmlSheet->sheetPr->outlinePr['summaryBelow'])) {
- $docSheet->setShowSummaryBelow(false);
- } else {
- $docSheet->setShowSummaryBelow(true);
- }
- }
-
- if (isset($xmlSheet->sheetPr) && isset($xmlSheet->sheetPr->pageSetUpPr)) {
- if (isset($xmlSheet->sheetPr->pageSetUpPr['fitToPage']) &&
- !self::boolean((string) $xmlSheet->sheetPr->pageSetUpPr['fitToPage'])) {
- $docSheet->getPageSetup()->setFitToPage(false);
- } else {
- $docSheet->getPageSetup()->setFitToPage(true);
- }
- }
-
- if (isset($xmlSheet->sheetFormatPr)) {
- if (isset($xmlSheet->sheetFormatPr['customHeight']) &&
- self::boolean((string) $xmlSheet->sheetFormatPr['customHeight']) &&
- isset($xmlSheet->sheetFormatPr['defaultRowHeight'])) {
- $docSheet->getDefaultRowDimension()->setRowHeight((float)$xmlSheet->sheetFormatPr['defaultRowHeight']);
- }
- if (isset($xmlSheet->sheetFormatPr['defaultColWidth'])) {
- $docSheet->getDefaultColumnDimension()->setWidth((float)$xmlSheet->sheetFormatPr['defaultColWidth']);
- }
- if (isset($xmlSheet->sheetFormatPr['zeroHeight']) &&
- ((string)$xmlSheet->sheetFormatPr['zeroHeight'] == '1')) {
- $docSheet->getDefaultRowDimension()->setZeroHeight(true);
- }
- }
-
- if (isset($xmlSheet->cols) && !$this->readDataOnly) {
- foreach ($xmlSheet->cols->col as $col) {
- for ($i = intval($col["min"]) - 1; $i < intval($col["max"]); ++$i) {
- if ($col["style"] && !$this->readDataOnly) {
- $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setXfIndex(intval($col["style"]));
- }
- if (self::boolean($col["bestFit"])) {
- //$docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setAutoSize(true);
- }
- if (self::boolean($col["hidden"])) {
- // echo PHPExcel_Cell::stringFromColumnIndex($i), ': HIDDEN COLUMN',PHP_EOL;
- $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setVisible(false);
- }
- if (self::boolean($col["collapsed"])) {
- $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setCollapsed(true);
- }
- if ($col["outlineLevel"] > 0) {
- $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setOutlineLevel(intval($col["outlineLevel"]));
- }
- $docSheet->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($i))->setWidth(floatval($col["width"]));
-
- if (intval($col["max"]) == 16384) {
- break;
- }
- }
- }
- }
-
- if (isset($xmlSheet->printOptions) && !$this->readDataOnly) {
- if (self::boolean((string) $xmlSheet->printOptions['gridLinesSet'])) {
- $docSheet->setShowGridlines(true);
- }
- if (self::boolean((string) $xmlSheet->printOptions['gridLines'])) {
- $docSheet->setPrintGridlines(true);
- }
- if (self::boolean((string) $xmlSheet->printOptions['horizontalCentered'])) {
- $docSheet->getPageSetup()->setHorizontalCentered(true);
- }
- if (self::boolean((string) $xmlSheet->printOptions['verticalCentered'])) {
- $docSheet->getPageSetup()->setVerticalCentered(true);
- }
- }
-
- if ($xmlSheet && $xmlSheet->sheetData && $xmlSheet->sheetData->row) {
- foreach ($xmlSheet->sheetData->row as $row) {
- if ($row["ht"] && !$this->readDataOnly) {
- $docSheet->getRowDimension(intval($row["r"]))->setRowHeight(floatval($row["ht"]));
- }
- if (self::boolean($row["hidden"]) && !$this->readDataOnly) {
- $docSheet->getRowDimension(intval($row["r"]))->setVisible(false);
- }
- if (self::boolean($row["collapsed"])) {
- $docSheet->getRowDimension(intval($row["r"]))->setCollapsed(true);
- }
- if ($row["outlineLevel"] > 0) {
- $docSheet->getRowDimension(intval($row["r"]))->setOutlineLevel(intval($row["outlineLevel"]));
- }
- if ($row["s"] && !$this->readDataOnly) {
- $docSheet->getRowDimension(intval($row["r"]))->setXfIndex(intval($row["s"]));
- }
-
- foreach ($row->c as $c) {
- $r = (string) $c["r"];
- $cellDataType = (string) $c["t"];
- $value = null;
- $calculatedValue = null;
-
- // Read cell?
- if ($this->getReadFilter() !== null) {
- $coordinates = PHPExcel_Cell::coordinateFromString($r);
-
- if (!$this->getReadFilter()->readCell($coordinates[0], $coordinates[1], $docSheet->getTitle())) {
- continue;
- }
- }
-
- // echo 'Reading cell ', $coordinates[0], $coordinates[1], PHP_EOL;
- // print_r($c);
- // echo PHP_EOL;
- // echo 'Cell Data Type is ', $cellDataType, ': ';
- //
- // Read cell!
- switch ($cellDataType) {
- case "s":
- // echo 'String', PHP_EOL;
- if ((string)$c->v != '') {
- $value = $sharedStrings[intval($c->v)];
-
- if ($value instanceof PHPExcel_RichText) {
- $value = clone $value;
- }
- } else {
- $value = '';
- }
- break;
- case "b":
- // echo 'Boolean', PHP_EOL;
- if (!isset($c->f)) {
- $value = self::castToBoolean($c);
- } else {
- // Formula
- $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToBoolean');
- if (isset($c->f['t'])) {
- $att = array();
- $att = $c->f;
- $docSheet->getCell($r)->setFormulaAttributes($att);
- }
- // echo '$calculatedValue = ', $calculatedValue, PHP_EOL;
- }
- break;
- case "inlineStr":
-// echo 'Inline String', PHP_EOL;
- if (isset($c->f)) {
- $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToError');
- } else {
- $value = $this->parseRichText($c->is);
- }
- break;
- case "e":
- // echo 'Error', PHP_EOL;
- if (!isset($c->f)) {
- $value = self::castToError($c);
- } else {
- // Formula
- $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToError');
- // echo '$calculatedValue = ', $calculatedValue, PHP_EOL;
- }
- break;
- default:
-// echo 'Default', PHP_EOL;
- if (!isset($c->f)) {
- // echo 'Not a Formula', PHP_EOL;
- $value = self::castToString($c);
- } else {
- // echo 'Treat as Formula', PHP_EOL;
- // Formula
- $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToString');
- // echo '$calculatedValue = ', $calculatedValue, PHP_EOL;
- }
- break;
- }
- // echo 'Value is ', $value, PHP_EOL;
-
- // Check for numeric values
- if (is_numeric($value) && $cellDataType != 's') {
- if ($value == (int)$value) {
- $value = (int)$value;
- } elseif ($value == (float)$value) {
- $value = (float)$value;
- } elseif ($value == (double)$value) {
- $value = (double)$value;
- }
- }
-
- // Rich text?
- if ($value instanceof PHPExcel_RichText && $this->readDataOnly) {
- $value = $value->getPlainText();
- }
-
- $cell = $docSheet->getCell($r);
- // Assign value
- if ($cellDataType != '') {
- $cell->setValueExplicit($value, $cellDataType);
- } else {
- $cell->setValue($value);
- }
- if ($calculatedValue !== null) {
- $cell->setCalculatedValue($calculatedValue);
- }
-
- // Style information?
- if ($c["s"] && !$this->readDataOnly) {
- // no style index means 0, it seems
- $cell->setXfIndex(isset($styles[intval($c["s"])]) ?
- intval($c["s"]) : 0);
- }
- }
- }
- }
-
- $conditionals = array();
- if (!$this->readDataOnly && $xmlSheet && $xmlSheet->conditionalFormatting) {
- foreach ($xmlSheet->conditionalFormatting as $conditional) {
- foreach ($conditional->cfRule as $cfRule) {
- if (((string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_NONE || (string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_CELLIS || (string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT || (string)$cfRule["type"] == PHPExcel_Style_Conditional::CONDITION_EXPRESSION) && isset($dxfs[intval($cfRule["dxfId"])])) {
- $conditionals[(string) $conditional["sqref"]][intval($cfRule["priority"])] = $cfRule;
- }
- }
- }
-
- foreach ($conditionals as $ref => $cfRules) {
- ksort($cfRules);
- $conditionalStyles = array();
- foreach ($cfRules as $cfRule) {
- $objConditional = new PHPExcel_Style_Conditional();
- $objConditional->setConditionType((string)$cfRule["type"]);
- $objConditional->setOperatorType((string)$cfRule["operator"]);
-
- if ((string)$cfRule["text"] != '') {
- $objConditional->setText((string)$cfRule["text"]);
- }
-
- if (count($cfRule->formula) > 1) {
- foreach ($cfRule->formula as $formula) {
- $objConditional->addCondition((string)$formula);
- }
- } else {
- $objConditional->addCondition((string)$cfRule->formula);
- }
- $objConditional->setStyle(clone $dxfs[intval($cfRule["dxfId"])]);
- $conditionalStyles[] = $objConditional;
- }
-
- // Extract all cell references in $ref
- foreach (PHPExcel_Cell::extractAllCellReferencesInRange($ref) as $reference) {
- $docSheet->getStyle($reference)->setConditionalStyles($conditionalStyles);
- }
- }
- }
-
- $aKeys = array("sheet", "objects", "scenarios", "formatCells", "formatColumns", "formatRows", "insertColumns", "insertRows", "insertHyperlinks", "deleteColumns", "deleteRows", "selectLockedCells", "sort", "autoFilter", "pivotTables", "selectUnlockedCells");
- if (!$this->readDataOnly && $xmlSheet && $xmlSheet->sheetProtection) {
- foreach ($aKeys as $key) {
- $method = "set" . ucfirst($key);
- $docSheet->getProtection()->$method(self::boolean((string) $xmlSheet->sheetProtection[$key]));
- }
- }
-
- if (!$this->readDataOnly && $xmlSheet && $xmlSheet->sheetProtection) {
- $docSheet->getProtection()->setPassword((string) $xmlSheet->sheetProtection["password"], true);
- if ($xmlSheet->protectedRanges->protectedRange) {
- foreach ($xmlSheet->protectedRanges->protectedRange as $protectedRange) {
- $docSheet->protectCells((string) $protectedRange["sqref"], (string) $protectedRange["password"], true);
- }
- }
- }
-
- if ($xmlSheet && $xmlSheet->autoFilter && !$this->readDataOnly) {
- $autoFilterRange = (string) $xmlSheet->autoFilter["ref"];
- if (strpos($autoFilterRange, ':') !== false) {
- $autoFilter = $docSheet->getAutoFilter();
- $autoFilter->setRange($autoFilterRange);
-
- foreach ($xmlSheet->autoFilter->filterColumn as $filterColumn) {
- $column = $autoFilter->getColumnByOffset((integer) $filterColumn["colId"]);
- // Check for standard filters
- if ($filterColumn->filters) {
- $column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER);
- $filters = $filterColumn->filters;
- if ((isset($filters["blank"])) && ($filters["blank"] == 1)) {
- // Operator is undefined, but always treated as EQUAL
- $column->createRule()->setRule(null, '')->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER);
- }
- // Standard filters are always an OR join, so no join rule needs to be set
- // Entries can be either filter elements
- foreach ($filters->filter as $filterRule) {
- // Operator is undefined, but always treated as EQUAL
- $column->createRule()->setRule(null, (string) $filterRule["val"])->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER);
- }
- // Or Date Group elements
- foreach ($filters->dateGroupItem as $dateGroupItem) {
- $column->createRule()->setRule(
- // Operator is undefined, but always treated as EQUAL
- null,
- array(
- 'year' => (string) $dateGroupItem["year"],
- 'month' => (string) $dateGroupItem["month"],
- 'day' => (string) $dateGroupItem["day"],
- 'hour' => (string) $dateGroupItem["hour"],
- 'minute' => (string) $dateGroupItem["minute"],
- 'second' => (string) $dateGroupItem["second"],
- ),
- (string) $dateGroupItem["dateTimeGrouping"]
- )
- ->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP);
- }
- }
- // Check for custom filters
- if ($filterColumn->customFilters) {
- $column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER);
- $customFilters = $filterColumn->customFilters;
- // Custom filters can an AND or an OR join;
- // and there should only ever be one or two entries
- if ((isset($customFilters["and"])) && ($customFilters["and"] == 1)) {
- $column->setJoin(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND);
- }
- foreach ($customFilters->customFilter as $filterRule) {
- $column->createRule()->setRule(
- (string) $filterRule["operator"],
- (string) $filterRule["val"]
- )
- ->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER);
- }
- }
- // Check for dynamic filters
- if ($filterColumn->dynamicFilter) {
- $column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER);
- // We should only ever have one dynamic filter
- foreach ($filterColumn->dynamicFilter as $filterRule) {
- $column->createRule()->setRule(
- // Operator is undefined, but always treated as EQUAL
- null,
- (string) $filterRule["val"],
- (string) $filterRule["type"]
- )
- ->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER);
- if (isset($filterRule["val"])) {
- $column->setAttribute('val', (string) $filterRule["val"]);
- }
- if (isset($filterRule["maxVal"])) {
- $column->setAttribute('maxVal', (string) $filterRule["maxVal"]);
- }
- }
- }
- // Check for dynamic filters
- if ($filterColumn->top10) {
- $column->setFilterType(PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER);
- // We should only ever have one top10 filter
- foreach ($filterColumn->top10 as $filterRule) {
- $column->createRule()->setRule(
- (((isset($filterRule["percent"])) && ($filterRule["percent"] == 1))
- ? PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT
- : PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE
- ),
- (string) $filterRule["val"],
- (((isset($filterRule["top"])) && ($filterRule["top"] == 1))
- ? PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP
- : PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM
- )
- )
- ->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_TOPTENFILTER);
- }
- }
- }
- }
- }
-
- if ($xmlSheet && $xmlSheet->mergeCells && $xmlSheet->mergeCells->mergeCell && !$this->readDataOnly) {
- foreach ($xmlSheet->mergeCells->mergeCell as $mergeCell) {
- $mergeRef = (string) $mergeCell["ref"];
- if (strpos($mergeRef, ':') !== false) {
- $docSheet->mergeCells((string) $mergeCell["ref"]);
- }
- }
- }
-
- if ($xmlSheet && $xmlSheet->pageMargins && !$this->readDataOnly) {
- $docPageMargins = $docSheet->getPageMargins();
- $docPageMargins->setLeft(floatval($xmlSheet->pageMargins["left"]));
- $docPageMargins->setRight(floatval($xmlSheet->pageMargins["right"]));
- $docPageMargins->setTop(floatval($xmlSheet->pageMargins["top"]));
- $docPageMargins->setBottom(floatval($xmlSheet->pageMargins["bottom"]));
- $docPageMargins->setHeader(floatval($xmlSheet->pageMargins["header"]));
- $docPageMargins->setFooter(floatval($xmlSheet->pageMargins["footer"]));
- }
-
- if ($xmlSheet && $xmlSheet->pageSetup && !$this->readDataOnly) {
- $docPageSetup = $docSheet->getPageSetup();
-
- if (isset($xmlSheet->pageSetup["orientation"])) {
- $docPageSetup->setOrientation((string) $xmlSheet->pageSetup["orientation"]);
- }
- if (isset($xmlSheet->pageSetup["paperSize"])) {
- $docPageSetup->setPaperSize(intval($xmlSheet->pageSetup["paperSize"]));
- }
- if (isset($xmlSheet->pageSetup["scale"])) {
- $docPageSetup->setScale(intval($xmlSheet->pageSetup["scale"]), false);
- }
- if (isset($xmlSheet->pageSetup["fitToHeight"]) && intval($xmlSheet->pageSetup["fitToHeight"]) >= 0) {
- $docPageSetup->setFitToHeight(intval($xmlSheet->pageSetup["fitToHeight"]), false);
- }
- if (isset($xmlSheet->pageSetup["fitToWidth"]) && intval($xmlSheet->pageSetup["fitToWidth"]) >= 0) {
- $docPageSetup->setFitToWidth(intval($xmlSheet->pageSetup["fitToWidth"]), false);
- }
- if (isset($xmlSheet->pageSetup["firstPageNumber"]) && isset($xmlSheet->pageSetup["useFirstPageNumber"]) &&
- self::boolean((string) $xmlSheet->pageSetup["useFirstPageNumber"])) {
- $docPageSetup->setFirstPageNumber(intval($xmlSheet->pageSetup["firstPageNumber"]));
- }
- }
-
- if ($xmlSheet && $xmlSheet->headerFooter && !$this->readDataOnly) {
- $docHeaderFooter = $docSheet->getHeaderFooter();
-
- if (isset($xmlSheet->headerFooter["differentOddEven"]) &&
- self::boolean((string)$xmlSheet->headerFooter["differentOddEven"])) {
- $docHeaderFooter->setDifferentOddEven(true);
- } else {
- $docHeaderFooter->setDifferentOddEven(false);
- }
- if (isset($xmlSheet->headerFooter["differentFirst"]) &&
- self::boolean((string)$xmlSheet->headerFooter["differentFirst"])) {
- $docHeaderFooter->setDifferentFirst(true);
- } else {
- $docHeaderFooter->setDifferentFirst(false);
- }
- if (isset($xmlSheet->headerFooter["scaleWithDoc"]) &&
- !self::boolean((string)$xmlSheet->headerFooter["scaleWithDoc"])) {
- $docHeaderFooter->setScaleWithDocument(false);
- } else {
- $docHeaderFooter->setScaleWithDocument(true);
- }
- if (isset($xmlSheet->headerFooter["alignWithMargins"]) &&
- !self::boolean((string)$xmlSheet->headerFooter["alignWithMargins"])) {
- $docHeaderFooter->setAlignWithMargins(false);
- } else {
- $docHeaderFooter->setAlignWithMargins(true);
- }
-
- $docHeaderFooter->setOddHeader((string) $xmlSheet->headerFooter->oddHeader);
- $docHeaderFooter->setOddFooter((string) $xmlSheet->headerFooter->oddFooter);
- $docHeaderFooter->setEvenHeader((string) $xmlSheet->headerFooter->evenHeader);
- $docHeaderFooter->setEvenFooter((string) $xmlSheet->headerFooter->evenFooter);
- $docHeaderFooter->setFirstHeader((string) $xmlSheet->headerFooter->firstHeader);
- $docHeaderFooter->setFirstFooter((string) $xmlSheet->headerFooter->firstFooter);
- }
-
- if ($xmlSheet && $xmlSheet->rowBreaks && $xmlSheet->rowBreaks->brk && !$this->readDataOnly) {
- foreach ($xmlSheet->rowBreaks->brk as $brk) {
- if ($brk["man"]) {
- $docSheet->setBreak("A$brk[id]", PHPExcel_Worksheet::BREAK_ROW);
- }
- }
- }
- if ($xmlSheet && $xmlSheet->colBreaks && $xmlSheet->colBreaks->brk && !$this->readDataOnly) {
- foreach ($xmlSheet->colBreaks->brk as $brk) {
- if ($brk["man"]) {
- $docSheet->setBreak(PHPExcel_Cell::stringFromColumnIndex((string) $brk["id"]) . "1", PHPExcel_Worksheet::BREAK_COLUMN);
- }
- }
- }
-
- if ($xmlSheet && $xmlSheet->dataValidations && !$this->readDataOnly) {
- foreach ($xmlSheet->dataValidations->dataValidation as $dataValidation) {
- // Uppercase coordinate
- $range = strtoupper($dataValidation["sqref"]);
- $rangeSet = explode(' ', $range);
- foreach ($rangeSet as $range) {
- $stRange = $docSheet->shrinkRangeToFit($range);
-
- // Extract all cell references in $range
- foreach (PHPExcel_Cell::extractAllCellReferencesInRange($stRange) as $reference) {
- // Create validation
- $docValidation = $docSheet->getCell($reference)->getDataValidation();
- $docValidation->setType((string) $dataValidation["type"]);
- $docValidation->setErrorStyle((string) $dataValidation["errorStyle"]);
- $docValidation->setOperator((string) $dataValidation["operator"]);
- $docValidation->setAllowBlank($dataValidation["allowBlank"] != 0);
- $docValidation->setShowDropDown($dataValidation["showDropDown"] == 0);
- $docValidation->setShowInputMessage($dataValidation["showInputMessage"] != 0);
- $docValidation->setShowErrorMessage($dataValidation["showErrorMessage"] != 0);
- $docValidation->setErrorTitle((string) $dataValidation["errorTitle"]);
- $docValidation->setError((string) $dataValidation["error"]);
- $docValidation->setPromptTitle((string) $dataValidation["promptTitle"]);
- $docValidation->setPrompt((string) $dataValidation["prompt"]);
- $docValidation->setFormula1((string) $dataValidation->formula1);
- $docValidation->setFormula2((string) $dataValidation->formula2);
- }
- }
- }
- }
-
- // Add hyperlinks
- $hyperlinks = array();
- if (!$this->readDataOnly) {
- // Locate hyperlink relations
- if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) {
- $relsWorksheet = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
- foreach ($relsWorksheet->Relationship as $ele) {
- if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink") {
- $hyperlinks[(string)$ele["Id"]] = (string)$ele["Target"];
- }
- }
- }
-
- // Loop through hyperlinks
- if ($xmlSheet && $xmlSheet->hyperlinks) {
- foreach ($xmlSheet->hyperlinks->hyperlink as $hyperlink) {
- // Link url
- $linkRel = $hyperlink->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships');
-
- foreach (PHPExcel_Cell::extractAllCellReferencesInRange($hyperlink['ref']) as $cellReference) {
- $cell = $docSheet->getCell($cellReference);
- if (isset($linkRel['id'])) {
- $hyperlinkUrl = $hyperlinks[ (string)$linkRel['id'] ];
- if (isset($hyperlink['location'])) {
- $hyperlinkUrl .= '#' . (string) $hyperlink['location'];
- }
- $cell->getHyperlink()->setUrl($hyperlinkUrl);
- } elseif (isset($hyperlink['location'])) {
- $cell->getHyperlink()->setUrl('sheet://' . (string)$hyperlink['location']);
- }
-
- // Tooltip
- if (isset($hyperlink['tooltip'])) {
- $cell->getHyperlink()->setTooltip((string)$hyperlink['tooltip']);
- }
- }
- }
- }
- }
-
- // Add comments
- $comments = array();
- $vmlComments = array();
- if (!$this->readDataOnly) {
- // Locate comment relations
- if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) {
- $relsWorksheet = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
- foreach ($relsWorksheet->Relationship as $ele) {
- if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments") {
- $comments[(string)$ele["Id"]] = (string)$ele["Target"];
- }
- if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing") {
- $vmlComments[(string)$ele["Id"]] = (string)$ele["Target"];
- }
- }
- }
-
- // Loop through comments
- foreach ($comments as $relName => $relPath) {
- // Load comments file
- $relPath = PHPExcel_Shared_File::realpath(dirname("$dir/$fileWorksheet") . "/" . $relPath);
- $commentsFile = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, $relPath)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
-
- // Utility variables
- $authors = array();
-
- // Loop through authors
- foreach ($commentsFile->authors->author as $author) {
- $authors[] = (string)$author;
- }
-
- // Loop through contents
- foreach ($commentsFile->commentList->comment as $comment) {
- if (!empty($comment['authorId'])) {
- $docSheet->getComment((string)$comment['ref'])->setAuthor($authors[(string)$comment['authorId']]);
- }
- $docSheet->getComment((string)$comment['ref'])->setText($this->parseRichText($comment->text));
- }
- }
-
- // Loop through VML comments
- foreach ($vmlComments as $relName => $relPath) {
- // Load VML comments file
- $relPath = PHPExcel_Shared_File::realpath(dirname("$dir/$fileWorksheet") . "/" . $relPath);
- $vmlCommentsFile = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, $relPath)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
- $vmlCommentsFile->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');
-
- $shapes = $vmlCommentsFile->xpath('//v:shape');
- foreach ($shapes as $shape) {
- $shape->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');
-
- if (isset($shape['style'])) {
- $style = (string)$shape['style'];
- $fillColor = strtoupper(substr((string)$shape['fillcolor'], 1));
- $column = null;
- $row = null;
-
- $clientData = $shape->xpath('.//x:ClientData');
- if (is_array($clientData) && !empty($clientData)) {
- $clientData = $clientData[0];
-
- if (isset($clientData['ObjectType']) && (string)$clientData['ObjectType'] == 'Note') {
- $temp = $clientData->xpath('.//x:Row');
- if (is_array($temp)) {
- $row = $temp[0];
- }
-
- $temp = $clientData->xpath('.//x:Column');
- if (is_array($temp)) {
- $column = $temp[0];
- }
- }
- }
-
- if (($column !== null) && ($row !== null)) {
- // Set comment properties
- $comment = $docSheet->getCommentByColumnAndRow((string) $column, $row + 1);
- $comment->getFillColor()->setRGB($fillColor);
-
- // Parse style
- $styleArray = explode(';', str_replace(' ', '', $style));
- foreach ($styleArray as $stylePair) {
- $stylePair = explode(':', $stylePair);
-
- if ($stylePair[0] == 'margin-left') {
- $comment->setMarginLeft($stylePair[1]);
- }
- if ($stylePair[0] == 'margin-top') {
- $comment->setMarginTop($stylePair[1]);
- }
- if ($stylePair[0] == 'width') {
- $comment->setWidth($stylePair[1]);
- }
- if ($stylePair[0] == 'height') {
- $comment->setHeight($stylePair[1]);
- }
- if ($stylePair[0] == 'visibility') {
- $comment->setVisible($stylePair[1] == 'visible');
- }
- }
- }
- }
- }
- }
-
- // Header/footer images
- if ($xmlSheet && $xmlSheet->legacyDrawingHF && !$this->readDataOnly) {
- if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) {
- $relsWorksheet = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
- $vmlRelationship = '';
-
- foreach ($relsWorksheet->Relationship as $ele) {
- if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing") {
- $vmlRelationship = self::dirAdd("$dir/$fileWorksheet", $ele["Target"]);
- }
- }
-
- if ($vmlRelationship != '') {
- // Fetch linked images
- $relsVML = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname($vmlRelationship) . '/_rels/' . basename($vmlRelationship) . '.rels')), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
- $drawings = array();
- foreach ($relsVML->Relationship as $ele) {
- if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") {
- $drawings[(string) $ele["Id"]] = self::dirAdd($vmlRelationship, $ele["Target"]);
- }
- }
-
- // Fetch VML document
- $vmlDrawing = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, $vmlRelationship)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
- $vmlDrawing->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');
-
- $hfImages = array();
-
- $shapes = $vmlDrawing->xpath('//v:shape');
- foreach ($shapes as $idx => $shape) {
- $shape->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');
- $imageData = $shape->xpath('//v:imagedata');
- $imageData = $imageData[$idx];
-
- $imageData = $imageData->attributes('urn:schemas-microsoft-com:office:office');
- $style = self::toCSSArray((string)$shape['style']);
-
- $hfImages[ (string)$shape['id'] ] = new PHPExcel_Worksheet_HeaderFooterDrawing();
- if (isset($imageData['title'])) {
- $hfImages[ (string)$shape['id'] ]->setName((string)$imageData['title']);
- }
-
- $hfImages[ (string)$shape['id'] ]->setPath("zip://".PHPExcel_Shared_File::realpath($pFilename)."#" . $drawings[(string)$imageData['relid']], false);
- $hfImages[ (string)$shape['id'] ]->setResizeProportional(false);
- $hfImages[ (string)$shape['id'] ]->setWidth($style['width']);
- $hfImages[ (string)$shape['id'] ]->setHeight($style['height']);
- if (isset($style['margin-left'])) {
- $hfImages[ (string)$shape['id'] ]->setOffsetX($style['margin-left']);
- }
- $hfImages[ (string)$shape['id'] ]->setOffsetY($style['margin-top']);
- $hfImages[ (string)$shape['id'] ]->setResizeProportional(true);
- }
-
- $docSheet->getHeaderFooter()->setImages($hfImages);
- }
- }
- }
-
- }
-
- // TODO: Autoshapes from twoCellAnchors!
- if ($zip->locateName(dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")) {
- $relsWorksheet = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . "/_rels/" . basename($fileWorksheet) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
- $drawings = array();
- foreach ($relsWorksheet->Relationship as $ele) {
- if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing") {
- $drawings[(string) $ele["Id"]] = self::dirAdd("$dir/$fileWorksheet", $ele["Target"]);
- }
- }
- if ($xmlSheet->drawing && !$this->readDataOnly) {
- foreach ($xmlSheet->drawing as $drawing) {
- $fileDrawing = $drawings[(string) self::getArrayItem($drawing->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "id")];
- $relsDrawing = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, dirname($fileDrawing) . "/_rels/" . basename($fileDrawing) . ".rels")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions()); //~ http://schemas.openxmlformats.org/package/2006/relationships");
- $images = array();
-
- if ($relsDrawing && $relsDrawing->Relationship) {
- foreach ($relsDrawing->Relationship as $ele) {
- if ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image") {
- $images[(string) $ele["Id"]] = self::dirAdd($fileDrawing, $ele["Target"]);
- } elseif ($ele["Type"] == "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart") {
- if ($this->includeCharts) {
- $charts[self::dirAdd($fileDrawing, $ele["Target"])] = array(
- 'id' => (string) $ele["Id"],
- 'sheet' => $docSheet->getTitle()
- );
- }
- }
- }
- }
- $xmlDrawing = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, $fileDrawing)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions())->children("http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing");
-
- if ($xmlDrawing->oneCellAnchor) {
- foreach ($xmlDrawing->oneCellAnchor as $oneCellAnchor) {
- if ($oneCellAnchor->pic->blipFill) {
- $blip = $oneCellAnchor->pic->blipFill->children("http://schemas.openxmlformats.org/drawingml/2006/main")->blip;
- $xfrm = $oneCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->xfrm;
- $outerShdw = $oneCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->effectLst->outerShdw;
- $objDrawing = new PHPExcel_Worksheet_Drawing;
- $objDrawing->setName((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name"));
- $objDrawing->setDescription((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr"));
- $objDrawing->setPath("zip://".PHPExcel_Shared_File::realpath($pFilename)."#" . $images[(string) self::getArrayItem($blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "embed")], false);
- $objDrawing->setCoordinates(PHPExcel_Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1));
- $objDrawing->setOffsetX(PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->colOff));
- $objDrawing->setOffsetY(PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->rowOff));
- $objDrawing->setResizeProportional(false);
- $objDrawing->setWidth(PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx")));
- $objDrawing->setHeight(PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cy")));
- if ($xfrm) {
- $objDrawing->setRotation(PHPExcel_Shared_Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), "rot")));
- }
- if ($outerShdw) {
- $shadow = $objDrawing->getShadow();
- $shadow->setVisible(true);
- $shadow->setBlurRadius(PHPExcel_Shared_Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad")));
- $shadow->setDistance(PHPExcel_Shared_Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist")));
- $shadow->setDirection(PHPExcel_Shared_Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir")));
- $shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), "algn"));
- $shadow->getColor()->setRGB(self::getArrayItem($outerShdw->srgbClr->attributes(), "val"));
- $shadow->setAlpha(self::getArrayItem($outerShdw->srgbClr->alpha->attributes(), "val") / 1000);
- }
- $objDrawing->setWorksheet($docSheet);
- } else {
- // ? Can charts be positioned with a oneCellAnchor ?
- $coordinates = PHPExcel_Cell::stringFromColumnIndex((string) $oneCellAnchor->from->col) . ($oneCellAnchor->from->row + 1);
- $offsetX = PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->colOff);
- $offsetY = PHPExcel_Shared_Drawing::EMUToPixels($oneCellAnchor->from->rowOff);
- $width = PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cx"));
- $height = PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), "cy"));
- }
- }
- }
- if ($xmlDrawing->twoCellAnchor) {
- foreach ($xmlDrawing->twoCellAnchor as $twoCellAnchor) {
- if ($twoCellAnchor->pic->blipFill) {
- $blip = $twoCellAnchor->pic->blipFill->children("http://schemas.openxmlformats.org/drawingml/2006/main")->blip;
- $xfrm = $twoCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->xfrm;
- $outerShdw = $twoCellAnchor->pic->spPr->children("http://schemas.openxmlformats.org/drawingml/2006/main")->effectLst->outerShdw;
- $objDrawing = new PHPExcel_Worksheet_Drawing;
- $objDrawing->setName((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "name"));
- $objDrawing->setDescription((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), "descr"));
- $objDrawing->setPath("zip://".PHPExcel_Shared_File::realpath($pFilename)."#" . $images[(string) self::getArrayItem($blip->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships"), "embed")], false);
- $objDrawing->setCoordinates(PHPExcel_Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1));
- $objDrawing->setOffsetX(PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->colOff));
- $objDrawing->setOffsetY(PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->rowOff));
- $objDrawing->setResizeProportional(false);
-
- if ($xfrm) {
- $objDrawing->setWidth(PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cx")));
- $objDrawing->setHeight(PHPExcel_Shared_Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), "cy")));
- $objDrawing->setRotation(PHPExcel_Shared_Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), "rot")));
- }
- if ($outerShdw) {
- $shadow = $objDrawing->getShadow();
- $shadow->setVisible(true);
- $shadow->setBlurRadius(PHPExcel_Shared_Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "blurRad")));
- $shadow->setDistance(PHPExcel_Shared_Drawing::EMUTopixels(self::getArrayItem($outerShdw->attributes(), "dist")));
- $shadow->setDirection(PHPExcel_Shared_Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), "dir")));
- $shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), "algn"));
- $shadow->getColor()->setRGB(self::getArrayItem($outerShdw->srgbClr->attributes(), "val"));
- $shadow->setAlpha(self::getArrayItem($outerShdw->srgbClr->alpha->attributes(), "val") / 1000);
- }
- $objDrawing->setWorksheet($docSheet);
- } elseif (($this->includeCharts) && ($twoCellAnchor->graphicFrame)) {
- $fromCoordinate = PHPExcel_Cell::stringFromColumnIndex((string) $twoCellAnchor->from->col) . ($twoCellAnchor->from->row + 1);
- $fromOffsetX = PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->colOff);
- $fromOffsetY = PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->from->rowOff);
- $toCoordinate = PHPExcel_Cell::stringFromColumnIndex((string) $twoCellAnchor->to->col) . ($twoCellAnchor->to->row + 1);
- $toOffsetX = PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->to->colOff);
- $toOffsetY = PHPExcel_Shared_Drawing::EMUToPixels($twoCellAnchor->to->rowOff);
- $graphic = $twoCellAnchor->graphicFrame->children("http://schemas.openxmlformats.org/drawingml/2006/main")->graphic;
- $chartRef = $graphic->graphicData->children("http://schemas.openxmlformats.org/drawingml/2006/chart")->chart;
- $thisChart = (string) $chartRef->attributes("http://schemas.openxmlformats.org/officeDocument/2006/relationships");
-
- $chartDetails[$docSheet->getTitle().'!'.$thisChart] = array(
- 'fromCoordinate' => $fromCoordinate,
- 'fromOffsetX' => $fromOffsetX,
- 'fromOffsetY' => $fromOffsetY,
- 'toCoordinate' => $toCoordinate,
- 'toOffsetX' => $toOffsetX,
- 'toOffsetY' => $toOffsetY,
- 'worksheetTitle' => $docSheet->getTitle()
- );
- }
- }
- }
- }
- }
- }
-
- // Loop through definedNames
- if ($xmlWorkbook->definedNames) {
- foreach ($xmlWorkbook->definedNames->definedName as $definedName) {
- // Extract range
- $extractedRange = (string)$definedName;
- $extractedRange = preg_replace('/\'(\w+)\'\!/', '', $extractedRange);
- if (($spos = strpos($extractedRange, '!')) !== false) {
- $extractedRange = substr($extractedRange, 0, $spos).str_replace('$', '', substr($extractedRange, $spos));
- } else {
- $extractedRange = str_replace('$', '', $extractedRange);
- }
-
- // Valid range?
- if (stripos((string)$definedName, '#REF!') !== false || $extractedRange == '') {
- continue;
- }
-
- // Some definedNames are only applicable if we are on the same sheet...
- if ((string)$definedName['localSheetId'] != '' && (string)$definedName['localSheetId'] == $sheetId) {
- // Switch on type
- switch ((string)$definedName['name']) {
- case '_xlnm._FilterDatabase':
- if ((string)$definedName['hidden'] !== '1') {
- $extractedRange = explode(',', $extractedRange);
- foreach ($extractedRange as $range) {
- $autoFilterRange = $range;
- if (strpos($autoFilterRange, ':') !== false) {
- $docSheet->getAutoFilter()->setRange($autoFilterRange);
- }
- }
- }
- break;
- case '_xlnm.Print_Titles':
- // Split $extractedRange
- $extractedRange = explode(',', $extractedRange);
-
- // Set print titles
- foreach ($extractedRange as $range) {
- $matches = array();
- $range = str_replace('$', '', $range);
-
- // check for repeating columns, e g. 'A:A' or 'A:D'
- if (preg_match('/!?([A-Z]+)\:([A-Z]+)$/', $range, $matches)) {
- $docSheet->getPageSetup()->setColumnsToRepeatAtLeft(array($matches[1], $matches[2]));
- } elseif (preg_match('/!?(\d+)\:(\d+)$/', $range, $matches)) {
- // check for repeating rows, e.g. '1:1' or '1:5'
- $docSheet->getPageSetup()->setRowsToRepeatAtTop(array($matches[1], $matches[2]));
- }
- }
- break;
- case '_xlnm.Print_Area':
- $rangeSets = explode(',', $extractedRange); // FIXME: what if sheetname contains comma?
- $newRangeSets = array();
- foreach ($rangeSets as $rangeSet) {
- $range = explode('!', $rangeSet); // FIXME: what if sheetname contains exclamation mark?
- $rangeSet = isset($range[1]) ? $range[1] : $range[0];
- if (strpos($rangeSet, ':') === false) {
- $rangeSet = $rangeSet . ':' . $rangeSet;
- }
- $newRangeSets[] = str_replace('$', '', $rangeSet);
- }
- $docSheet->getPageSetup()->setPrintArea(implode(',', $newRangeSets));
- break;
-
- default:
- break;
- }
- }
- }
- }
-
- // Next sheet id
- ++$sheetId;
- }
-
- // Loop through definedNames
- if ($xmlWorkbook->definedNames) {
- foreach ($xmlWorkbook->definedNames->definedName as $definedName) {
- // Extract range
- $extractedRange = (string)$definedName;
- $extractedRange = preg_replace('/\'(\w+)\'\!/', '', $extractedRange);
- if (($spos = strpos($extractedRange, '!')) !== false) {
- $extractedRange = substr($extractedRange, 0, $spos).str_replace('$', '', substr($extractedRange, $spos));
- } else {
- $extractedRange = str_replace('$', '', $extractedRange);
- }
-
- // Valid range?
- if (stripos((string)$definedName, '#REF!') !== false || $extractedRange == '') {
- continue;
- }
-
- // Some definedNames are only applicable if we are on the same sheet...
- if ((string)$definedName['localSheetId'] != '') {
- // Local defined name
- // Switch on type
- switch ((string)$definedName['name']) {
- case '_xlnm._FilterDatabase':
- case '_xlnm.Print_Titles':
- case '_xlnm.Print_Area':
- break;
- default:
- if ($mapSheetId[(integer) $definedName['localSheetId']] !== null) {
- $range = explode('!', (string)$definedName);
- if (count($range) == 2) {
- $range[0] = str_replace("''", "'", $range[0]);
- $range[0] = str_replace("'", "", $range[0]);
- if ($worksheet = $docSheet->getParent()->getSheetByName($range[0])) {
- $extractedRange = str_replace('$', '', $range[1]);
- $scope = $docSheet->getParent()->getSheet($mapSheetId[(integer) $definedName['localSheetId']]);
- $excel->addNamedRange(new PHPExcel_NamedRange((string)$definedName['name'], $worksheet, $extractedRange, true, $scope));
- }
- }
- }
- break;
- }
- } elseif (!isset($definedName['localSheetId'])) {
- // "Global" definedNames
- $locatedSheet = null;
- $extractedSheetName = '';
- if (strpos((string)$definedName, '!') !== false) {
- // Extract sheet name
- $extractedSheetName = PHPExcel_Worksheet::extractSheetTitle((string)$definedName, true);
- $extractedSheetName = $extractedSheetName[0];
-
- // Locate sheet
- $locatedSheet = $excel->getSheetByName($extractedSheetName);
-
- // Modify range
- $range = explode('!', $extractedRange);
- $extractedRange = isset($range[1]) ? $range[1] : $range[0];
- }
-
- if ($locatedSheet !== null) {
- $excel->addNamedRange(new PHPExcel_NamedRange((string)$definedName['name'], $locatedSheet, $extractedRange, false));
- }
- }
- }
- }
- }
-
- if ((!$this->readDataOnly) || (!empty($this->loadSheetsOnly))) {
- // active sheet index
- $activeTab = intval($xmlWorkbook->bookViews->workbookView["activeTab"]); // refers to old sheet index
-
- // keep active sheet index if sheet is still loaded, else first sheet is set as the active
- if (isset($mapSheetId[$activeTab]) && $mapSheetId[$activeTab] !== null) {
- $excel->setActiveSheetIndex($mapSheetId[$activeTab]);
- } else {
- if ($excel->getSheetCount() == 0) {
- $excel->createSheet();
- }
- $excel->setActiveSheetIndex(0);
- }
- }
- break;
- }
- }
-
- if (!$this->readDataOnly) {
- $contentTypes = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, "[Content_Types].xml")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
- foreach ($contentTypes->Override as $contentType) {
- switch ($contentType["ContentType"]) {
- case "application/vnd.openxmlformats-officedocument.drawingml.chart+xml":
- if ($this->includeCharts) {
- $chartEntryRef = ltrim($contentType['PartName'], '/');
- $chartElements = simplexml_load_string($this->securityScan($this->getFromZipArchive($zip, $chartEntryRef)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
- $objChart = PHPExcel_Reader_Excel2007_Chart::readChart($chartElements, basename($chartEntryRef, '.xml'));
-
-// echo 'Chart ', $chartEntryRef, '
';
-// var_dump($charts[$chartEntryRef]);
-//
- if (isset($charts[$chartEntryRef])) {
- $chartPositionRef = $charts[$chartEntryRef]['sheet'].'!'.$charts[$chartEntryRef]['id'];
-// echo 'Position Ref ', $chartPositionRef, '
';
- if (isset($chartDetails[$chartPositionRef])) {
-// var_dump($chartDetails[$chartPositionRef]);
-
- $excel->getSheetByName($charts[$chartEntryRef]['sheet'])->addChart($objChart);
- $objChart->setWorksheet($excel->getSheetByName($charts[$chartEntryRef]['sheet']));
- $objChart->setTopLeftPosition($chartDetails[$chartPositionRef]['fromCoordinate'], $chartDetails[$chartPositionRef]['fromOffsetX'], $chartDetails[$chartPositionRef]['fromOffsetY']);
- $objChart->setBottomRightPosition($chartDetails[$chartPositionRef]['toCoordinate'], $chartDetails[$chartPositionRef]['toOffsetX'], $chartDetails[$chartPositionRef]['toOffsetY']);
- }
- }
- }
- }
- }
- }
-
- $zip->close();
-
- return $excel;
- }
-
- private static function readColor($color, $background = false)
- {
- if (isset($color["rgb"])) {
- return (string)$color["rgb"];
- } elseif (isset($color["indexed"])) {
- return PHPExcel_Style_Color::indexedColor($color["indexed"]-7, $background)->getARGB();
- } elseif (isset($color["theme"])) {
- if (self::$theme !== null) {
- $returnColour = self::$theme->getColourByIndex((int)$color["theme"]);
- if (isset($color["tint"])) {
- $tintAdjust = (float) $color["tint"];
- $returnColour = PHPExcel_Style_Color::changeBrightness($returnColour, $tintAdjust);
- }
- return 'FF'.$returnColour;
- }
- }
-
- if ($background) {
- return 'FFFFFFFF';
- }
- return 'FF000000';
- }
-
- private static function readStyle($docStyle, $style)
- {
- // format code
-// if (isset($style->numFmt)) {
-// if (isset($style->numFmt['formatCode'])) {
-// $docStyle->getNumberFormat()->setFormatCode((string) $style->numFmt['formatCode']);
-// } else {
- $docStyle->getNumberFormat()->setFormatCode($style->numFmt);
-// }
-// }
-
- // font
- if (isset($style->font)) {
- $docStyle->getFont()->setName((string) $style->font->name["val"]);
- $docStyle->getFont()->setSize((string) $style->font->sz["val"]);
- if (isset($style->font->b)) {
- $docStyle->getFont()->setBold(!isset($style->font->b["val"]) || self::boolean((string) $style->font->b["val"]));
- }
- if (isset($style->font->i)) {
- $docStyle->getFont()->setItalic(!isset($style->font->i["val"]) || self::boolean((string) $style->font->i["val"]));
- }
- if (isset($style->font->strike)) {
- $docStyle->getFont()->setStrikethrough(!isset($style->font->strike["val"]) || self::boolean((string) $style->font->strike["val"]));
- }
- $docStyle->getFont()->getColor()->setARGB(self::readColor($style->font->color));
-
- if (isset($style->font->u) && !isset($style->font->u["val"])) {
- $docStyle->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
- } elseif (isset($style->font->u) && isset($style->font->u["val"])) {
- $docStyle->getFont()->setUnderline((string)$style->font->u["val"]);
- }
-
- if (isset($style->font->vertAlign) && isset($style->font->vertAlign["val"])) {
- $vertAlign = strtolower((string)$style->font->vertAlign["val"]);
- if ($vertAlign == 'superscript') {
- $docStyle->getFont()->setSuperScript(true);
- }
- if ($vertAlign == 'subscript') {
- $docStyle->getFont()->setSubScript(true);
- }
- }
- }
-
- // fill
- if (isset($style->fill)) {
- if ($style->fill->gradientFill) {
- $gradientFill = $style->fill->gradientFill[0];
- if (!empty($gradientFill["type"])) {
- $docStyle->getFill()->setFillType((string) $gradientFill["type"]);
- }
- $docStyle->getFill()->setRotation(floatval($gradientFill["degree"]));
- $gradientFill->registerXPathNamespace("sml", "http://schemas.openxmlformats.org/spreadsheetml/2006/main");
- $docStyle->getFill()->getStartColor()->setARGB(self::readColor(self::getArrayItem($gradientFill->xpath("sml:stop[@position=0]"))->color));
- $docStyle->getFill()->getEndColor()->setARGB(self::readColor(self::getArrayItem($gradientFill->xpath("sml:stop[@position=1]"))->color));
- } elseif ($style->fill->patternFill) {
- $patternType = (string)$style->fill->patternFill["patternType"] != '' ? (string)$style->fill->patternFill["patternType"] : 'solid';
- $docStyle->getFill()->setFillType($patternType);
- if ($style->fill->patternFill->fgColor) {
- $docStyle->getFill()->getStartColor()->setARGB(self::readColor($style->fill->patternFill->fgColor, true));
- } else {
- $docStyle->getFill()->getStartColor()->setARGB('FF000000');
- }
- if ($style->fill->patternFill->bgColor) {
- $docStyle->getFill()->getEndColor()->setARGB(self::readColor($style->fill->patternFill->bgColor, true));
- }
- }
- }
-
- // border
- if (isset($style->border)) {
- $diagonalUp = self::boolean((string) $style->border["diagonalUp"]);
- $diagonalDown = self::boolean((string) $style->border["diagonalDown"]);
- if (!$diagonalUp && !$diagonalDown) {
- $docStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_NONE);
- } elseif ($diagonalUp && !$diagonalDown) {
- $docStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_UP);
- } elseif (!$diagonalUp && $diagonalDown) {
- $docStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_DOWN);
- } else {
- $docStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_BOTH);
- }
- self::readBorder($docStyle->getBorders()->getLeft(), $style->border->left);
- self::readBorder($docStyle->getBorders()->getRight(), $style->border->right);
- self::readBorder($docStyle->getBorders()->getTop(), $style->border->top);
- self::readBorder($docStyle->getBorders()->getBottom(), $style->border->bottom);
- self::readBorder($docStyle->getBorders()->getDiagonal(), $style->border->diagonal);
- }
-
- // alignment
- if (isset($style->alignment)) {
- $docStyle->getAlignment()->setHorizontal((string) $style->alignment["horizontal"]);
- $docStyle->getAlignment()->setVertical((string) $style->alignment["vertical"]);
-
- $textRotation = 0;
- if ((int)$style->alignment["textRotation"] <= 90) {
- $textRotation = (int)$style->alignment["textRotation"];
- } elseif ((int)$style->alignment["textRotation"] > 90) {
- $textRotation = 90 - (int)$style->alignment["textRotation"];
- }
-
- $docStyle->getAlignment()->setTextRotation(intval($textRotation));
- $docStyle->getAlignment()->setWrapText(self::boolean((string) $style->alignment["wrapText"]));
- $docStyle->getAlignment()->setShrinkToFit(self::boolean((string) $style->alignment["shrinkToFit"]));
- $docStyle->getAlignment()->setIndent(intval((string)$style->alignment["indent"]) > 0 ? intval((string)$style->alignment["indent"]) : 0);
- $docStyle->getAlignment()->setReadorder(intval((string)$style->alignment["readingOrder"]) > 0 ? intval((string)$style->alignment["readingOrder"]) : 0);
- }
-
- // protection
- if (isset($style->protection)) {
- if (isset($style->protection['locked'])) {
- if (self::boolean((string) $style->protection['locked'])) {
- $docStyle->getProtection()->setLocked(PHPExcel_Style_Protection::PROTECTION_PROTECTED);
- } else {
- $docStyle->getProtection()->setLocked(PHPExcel_Style_Protection::PROTECTION_UNPROTECTED);
- }
- }
-
- if (isset($style->protection['hidden'])) {
- if (self::boolean((string) $style->protection['hidden'])) {
- $docStyle->getProtection()->setHidden(PHPExcel_Style_Protection::PROTECTION_PROTECTED);
- } else {
- $docStyle->getProtection()->setHidden(PHPExcel_Style_Protection::PROTECTION_UNPROTECTED);
- }
- }
- }
-
- // top-level style settings
- if (isset($style->quotePrefix)) {
- $docStyle->setQuotePrefix($style->quotePrefix);
- }
- }
-
- private static function readBorder($docBorder, $eleBorder)
- {
- if (isset($eleBorder["style"])) {
- $docBorder->setBorderStyle((string) $eleBorder["style"]);
- }
- if (isset($eleBorder->color)) {
- $docBorder->getColor()->setARGB(self::readColor($eleBorder->color));
- }
- }
-
- private function parseRichText($is = null)
- {
- $value = new PHPExcel_RichText();
-
- if (isset($is->t)) {
- $value->createText(PHPExcel_Shared_String::ControlCharacterOOXML2PHP((string) $is->t));
- } else {
- if (is_object($is->r)) {
- foreach ($is->r as $run) {
- if (!isset($run->rPr)) {
- $objText = $value->createText(PHPExcel_Shared_String::ControlCharacterOOXML2PHP((string) $run->t));
-
- } else {
- $objText = $value->createTextRun(PHPExcel_Shared_String::ControlCharacterOOXML2PHP((string) $run->t));
-
- if (isset($run->rPr->rFont["val"])) {
- $objText->getFont()->setName((string) $run->rPr->rFont["val"]);
- }
- if (isset($run->rPr->sz["val"])) {
- $objText->getFont()->setSize((string) $run->rPr->sz["val"]);
- }
- if (isset($run->rPr->color)) {
- $objText->getFont()->setColor(new PHPExcel_Style_Color(self::readColor($run->rPr->color)));
- }
- if ((isset($run->rPr->b["val"]) && self::boolean((string) $run->rPr->b["val"])) ||
- (isset($run->rPr->b) && !isset($run->rPr->b["val"]))) {
- $objText->getFont()->setBold(true);
- }
- if ((isset($run->rPr->i["val"]) && self::boolean((string) $run->rPr->i["val"])) ||
- (isset($run->rPr->i) && !isset($run->rPr->i["val"]))) {
- $objText->getFont()->setItalic(true);
- }
- if (isset($run->rPr->vertAlign) && isset($run->rPr->vertAlign["val"])) {
- $vertAlign = strtolower((string)$run->rPr->vertAlign["val"]);
- if ($vertAlign == 'superscript') {
- $objText->getFont()->setSuperScript(true);
- }
- if ($vertAlign == 'subscript') {
- $objText->getFont()->setSubScript(true);
- }
- }
- if (isset($run->rPr->u) && !isset($run->rPr->u["val"])) {
- $objText->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
- } elseif (isset($run->rPr->u) && isset($run->rPr->u["val"])) {
- $objText->getFont()->setUnderline((string)$run->rPr->u["val"]);
- }
- if ((isset($run->rPr->strike["val"]) && self::boolean((string) $run->rPr->strike["val"])) ||
- (isset($run->rPr->strike) && !isset($run->rPr->strike["val"]))) {
- $objText->getFont()->setStrikethrough(true);
- }
- }
- }
- }
- }
-
- return $value;
- }
-
- private function readRibbon($excel, $customUITarget, $zip)
- {
- $baseDir = dirname($customUITarget);
- $nameCustomUI = basename($customUITarget);
- // get the xml file (ribbon)
- $localRibbon = $this->getFromZipArchive($zip, $customUITarget);
- $customUIImagesNames = array();
- $customUIImagesBinaries = array();
- // something like customUI/_rels/customUI.xml.rels
- $pathRels = $baseDir . '/_rels/' . $nameCustomUI . '.rels';
- $dataRels = $this->getFromZipArchive($zip, $pathRels);
- if ($dataRels) {
- // exists and not empty if the ribbon have some pictures (other than internal MSO)
- $UIRels = simplexml_load_string($this->securityScan($dataRels), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
- if ($UIRels) {
- // we need to save id and target to avoid parsing customUI.xml and "guess" if it's a pseudo callback who load the image
- foreach ($UIRels->Relationship as $ele) {
- if ($ele["Type"] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image') {
- // an image ?
- $customUIImagesNames[(string) $ele['Id']] = (string)$ele['Target'];
- $customUIImagesBinaries[(string)$ele['Target']] = $this->getFromZipArchive($zip, $baseDir . '/' . (string) $ele['Target']);
- }
- }
- }
- }
- if ($localRibbon) {
- $excel->setRibbonXMLData($customUITarget, $localRibbon);
- if (count($customUIImagesNames) > 0 && count($customUIImagesBinaries) > 0) {
- $excel->setRibbonBinObjects($customUIImagesNames, $customUIImagesBinaries);
- } else {
- $excel->setRibbonBinObjects(null);
- }
- } else {
- $excel->setRibbonXMLData(null);
- $excel->setRibbonBinObjects(null);
- }
- }
-
- private static function getArrayItem($array, $key = 0)
- {
- return (isset($array[$key]) ? $array[$key] : null);
- }
-
- private static function dirAdd($base, $add)
- {
- return preg_replace('~[^/]+/\.\./~', '', dirname($base) . "/$add");
- }
-
- private static function toCSSArray($style)
- {
- $style = str_replace(array("\r","\n"), "", $style);
-
- $temp = explode(';', $style);
- $style = array();
- foreach ($temp as $item) {
- $item = explode(':', $item);
-
- if (strpos($item[1], 'px') !== false) {
- $item[1] = str_replace('px', '', $item[1]);
- }
- if (strpos($item[1], 'pt') !== false) {
- $item[1] = str_replace('pt', '', $item[1]);
- $item[1] = PHPExcel_Shared_Font::fontSizeToPixels($item[1]);
- }
- if (strpos($item[1], 'in') !== false) {
- $item[1] = str_replace('in', '', $item[1]);
- $item[1] = PHPExcel_Shared_Font::inchSizeToPixels($item[1]);
- }
- if (strpos($item[1], 'cm') !== false) {
- $item[1] = str_replace('cm', '', $item[1]);
- $item[1] = PHPExcel_Shared_Font::centimeterSizeToPixels($item[1]);
- }
-
- $style[$item[0]] = $item[1];
- }
-
- return $style;
- }
-
- private static function boolean($value = null)
- {
- if (is_object($value)) {
- $value = (string) $value;
- }
- if (is_numeric($value)) {
- return (bool) $value;
- }
- return ($value === 'true' || $value === 'TRUE');
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Reader/Excel2007/Theme.php b/lib/phpexcel/PHPExcel/Reader/Excel2007/Theme.php
deleted file mode 100644
index 134f4b609cf..00000000000
--- a/lib/phpexcel/PHPExcel/Reader/Excel2007/Theme.php
+++ /dev/null
@@ -1,127 +0,0 @@
-themeName = $themeName;
- $this->colourSchemeName = $colourSchemeName;
- $this->colourMap = $colourMap;
- }
-
- /**
- * Get Theme Name
- *
- * @return string
- */
- public function getThemeName()
- {
- return $this->themeName;
- }
-
- /**
- * Get colour Scheme Name
- *
- * @return string
- */
- public function getColourSchemeName()
- {
- return $this->colourSchemeName;
- }
-
- /**
- * Get colour Map Value by Position
- *
- * @return string
- */
- public function getColourByIndex($index = 0)
- {
- if (isset($this->colourMap[$index])) {
- return $this->colourMap[$index];
- }
- return null;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if ((is_object($value)) && ($key != '_parent')) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Reader/Excel5.php b/lib/phpexcel/PHPExcel/Reader/Excel5.php
deleted file mode 100644
index ec22fe5cf47..00000000000
--- a/lib/phpexcel/PHPExcel/Reader/Excel5.php
+++ /dev/null
@@ -1,8042 +0,0 @@
-data
- *
- * @var int
- */
- private $dataSize;
-
- /**
- * Current position in stream
- *
- * @var integer
- */
- private $pos;
-
- /**
- * Workbook to be returned by the reader.
- *
- * @var PHPExcel
- */
- private $phpExcel;
-
- /**
- * Worksheet that is currently being built by the reader.
- *
- * @var PHPExcel_Worksheet
- */
- private $phpSheet;
-
- /**
- * BIFF version
- *
- * @var int
- */
- private $version;
-
- /**
- * Codepage set in the Excel file being read. Only important for BIFF5 (Excel 5.0 - Excel 95)
- * For BIFF8 (Excel 97 - Excel 2003) this will always have the value 'UTF-16LE'
- *
- * @var string
- */
- private $codepage;
-
- /**
- * Shared formats
- *
- * @var array
- */
- private $formats;
-
- /**
- * Shared fonts
- *
- * @var array
- */
- private $objFonts;
-
- /**
- * Color palette
- *
- * @var array
- */
- private $palette;
-
- /**
- * Worksheets
- *
- * @var array
- */
- private $sheets;
-
- /**
- * External books
- *
- * @var array
- */
- private $externalBooks;
-
- /**
- * REF structures. Only applies to BIFF8.
- *
- * @var array
- */
- private $ref;
-
- /**
- * External names
- *
- * @var array
- */
- private $externalNames;
-
- /**
- * Defined names
- *
- * @var array
- */
- private $definedname;
-
- /**
- * Shared strings. Only applies to BIFF8.
- *
- * @var array
- */
- private $sst;
-
- /**
- * Panes are frozen? (in sheet currently being read). See WINDOW2 record.
- *
- * @var boolean
- */
- private $frozen;
-
- /**
- * Fit printout to number of pages? (in sheet currently being read). See SHEETPR record.
- *
- * @var boolean
- */
- private $isFitToPages;
-
- /**
- * Objects. One OBJ record contributes with one entry.
- *
- * @var array
- */
- private $objs;
-
- /**
- * Text Objects. One TXO record corresponds with one entry.
- *
- * @var array
- */
- private $textObjects;
-
- /**
- * Cell Annotations (BIFF8)
- *
- * @var array
- */
- private $cellNotes;
-
- /**
- * The combined MSODRAWINGGROUP data
- *
- * @var string
- */
- private $drawingGroupData;
-
- /**
- * The combined MSODRAWING data (per sheet)
- *
- * @var string
- */
- private $drawingData;
-
- /**
- * Keep track of XF index
- *
- * @var int
- */
- private $xfIndex;
-
- /**
- * Mapping of XF index (that is a cell XF) to final index in cellXf collection
- *
- * @var array
- */
- private $mapCellXfIndex;
-
- /**
- * Mapping of XF index (that is a style XF) to final index in cellStyleXf collection
- *
- * @var array
- */
- private $mapCellStyleXfIndex;
-
- /**
- * The shared formulas in a sheet. One SHAREDFMLA record contributes with one value.
- *
- * @var array
- */
- private $sharedFormulas;
-
- /**
- * The shared formula parts in a sheet. One FORMULA record contributes with one value if it
- * refers to a shared formula.
- *
- * @var array
- */
- private $sharedFormulaParts;
-
- /**
- * The type of encryption in use
- *
- * @var int
- */
- private $encryption = 0;
-
- /**
- * The position in the stream after which contents are encrypted
- *
- * @var int
- */
- private $encryptionStartPos = false;
-
- /**
- * The current RC4 decryption object
- *
- * @var PHPExcel_Reader_Excel5_RC4
- */
- private $rc4Key = null;
-
- /**
- * The position in the stream that the RC4 decryption object was left at
- *
- * @var int
- */
- private $rc4Pos = 0;
-
- /**
- * The current MD5 context state
- *
- * @var string
- */
- private $md5Ctxt = null;
-
- /**
- * Create a new PHPExcel_Reader_Excel5 instance
- */
- public function __construct()
- {
- $this->readFilter = new PHPExcel_Reader_DefaultReadFilter();
- }
-
- /**
- * Can the current PHPExcel_Reader_IReader read the file?
- *
- * @param string $pFilename
- * @return boolean
- * @throws PHPExcel_Reader_Exception
- */
- public function canRead($pFilename)
- {
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
-
- try {
- // Use ParseXL for the hard work.
- $ole = new PHPExcel_Shared_OLERead();
-
- // get excel data
- $res = $ole->read($pFilename);
- return true;
- } catch (PHPExcel_Exception $e) {
- return false;
- }
- }
-
- /**
- * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object
- *
- * @param string $pFilename
- * @throws PHPExcel_Reader_Exception
- */
- public function listWorksheetNames($pFilename)
- {
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
-
- $worksheetNames = array();
-
- // Read the OLE file
- $this->loadOLE($pFilename);
-
- // total byte size of Excel data (workbook global substream + sheet substreams)
- $this->dataSize = strlen($this->data);
-
- $this->pos = 0;
- $this->sheets = array();
-
- // Parse Workbook Global Substream
- while ($this->pos < $this->dataSize) {
- $code = self::getInt2d($this->data, $this->pos);
-
- switch ($code) {
- case self::XLS_TYPE_BOF:
- $this->readBof();
- break;
- case self::XLS_TYPE_SHEET:
- $this->readSheet();
- break;
- case self::XLS_TYPE_EOF:
- $this->readDefault();
- break 2;
- default:
- $this->readDefault();
- break;
- }
- }
-
- foreach ($this->sheets as $sheet) {
- if ($sheet['sheetType'] != 0x00) {
- // 0x00: Worksheet, 0x02: Chart, 0x06: Visual Basic module
- continue;
- }
-
- $worksheetNames[] = $sheet['name'];
- }
-
- return $worksheetNames;
- }
-
-
- /**
- * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)
- *
- * @param string $pFilename
- * @throws PHPExcel_Reader_Exception
- */
- public function listWorksheetInfo($pFilename)
- {
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
-
- $worksheetInfo = array();
-
- // Read the OLE file
- $this->loadOLE($pFilename);
-
- // total byte size of Excel data (workbook global substream + sheet substreams)
- $this->dataSize = strlen($this->data);
-
- // initialize
- $this->pos = 0;
- $this->sheets = array();
-
- // Parse Workbook Global Substream
- while ($this->pos < $this->dataSize) {
- $code = self::getInt2d($this->data, $this->pos);
-
- switch ($code) {
- case self::XLS_TYPE_BOF:
- $this->readBof();
- break;
- case self::XLS_TYPE_SHEET:
- $this->readSheet();
- break;
- case self::XLS_TYPE_EOF:
- $this->readDefault();
- break 2;
- default:
- $this->readDefault();
- break;
- }
- }
-
- // Parse the individual sheets
- foreach ($this->sheets as $sheet) {
- if ($sheet['sheetType'] != 0x00) {
- // 0x00: Worksheet
- // 0x02: Chart
- // 0x06: Visual Basic module
- continue;
- }
-
- $tmpInfo = array();
- $tmpInfo['worksheetName'] = $sheet['name'];
- $tmpInfo['lastColumnLetter'] = 'A';
- $tmpInfo['lastColumnIndex'] = 0;
- $tmpInfo['totalRows'] = 0;
- $tmpInfo['totalColumns'] = 0;
-
- $this->pos = $sheet['offset'];
-
- while ($this->pos <= $this->dataSize - 4) {
- $code = self::getInt2d($this->data, $this->pos);
-
- switch ($code) {
- case self::XLS_TYPE_RK:
- case self::XLS_TYPE_LABELSST:
- case self::XLS_TYPE_NUMBER:
- case self::XLS_TYPE_FORMULA:
- case self::XLS_TYPE_BOOLERR:
- case self::XLS_TYPE_LABEL:
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- $rowIndex = self::getInt2d($recordData, 0) + 1;
- $columnIndex = self::getInt2d($recordData, 2);
-
- $tmpInfo['totalRows'] = max($tmpInfo['totalRows'], $rowIndex);
- $tmpInfo['lastColumnIndex'] = max($tmpInfo['lastColumnIndex'], $columnIndex);
- break;
- case self::XLS_TYPE_BOF:
- $this->readBof();
- break;
- case self::XLS_TYPE_EOF:
- $this->readDefault();
- break 2;
- default:
- $this->readDefault();
- break;
- }
- }
-
- $tmpInfo['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
- $tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1;
-
- $worksheetInfo[] = $tmpInfo;
- }
-
- return $worksheetInfo;
- }
-
-
- /**
- * Loads PHPExcel from file
- *
- * @param string $pFilename
- * @return PHPExcel
- * @throws PHPExcel_Reader_Exception
- */
- public function load($pFilename)
- {
- // Read the OLE file
- $this->loadOLE($pFilename);
-
- // Initialisations
- $this->phpExcel = new PHPExcel;
- $this->phpExcel->removeSheetByIndex(0); // remove 1st sheet
- if (!$this->readDataOnly) {
- $this->phpExcel->removeCellStyleXfByIndex(0); // remove the default style
- $this->phpExcel->removeCellXfByIndex(0); // remove the default style
- }
-
- // Read the summary information stream (containing meta data)
- $this->readSummaryInformation();
-
- // Read the Additional document summary information stream (containing application-specific meta data)
- $this->readDocumentSummaryInformation();
-
- // total byte size of Excel data (workbook global substream + sheet substreams)
- $this->dataSize = strlen($this->data);
-
- // initialize
- $this->pos = 0;
- $this->codepage = 'CP1252';
- $this->formats = array();
- $this->objFonts = array();
- $this->palette = array();
- $this->sheets = array();
- $this->externalBooks = array();
- $this->ref = array();
- $this->definedname = array();
- $this->sst = array();
- $this->drawingGroupData = '';
- $this->xfIndex = '';
- $this->mapCellXfIndex = array();
- $this->mapCellStyleXfIndex = array();
-
- // Parse Workbook Global Substream
- while ($this->pos < $this->dataSize) {
- $code = self::getInt2d($this->data, $this->pos);
-
- switch ($code) {
- case self::XLS_TYPE_BOF:
- $this->readBof();
- break;
- case self::XLS_TYPE_FILEPASS:
- $this->readFilepass();
- break;
- case self::XLS_TYPE_CODEPAGE:
- $this->readCodepage();
- break;
- case self::XLS_TYPE_DATEMODE:
- $this->readDateMode();
- break;
- case self::XLS_TYPE_FONT:
- $this->readFont();
- break;
- case self::XLS_TYPE_FORMAT:
- $this->readFormat();
- break;
- case self::XLS_TYPE_XF:
- $this->readXf();
- break;
- case self::XLS_TYPE_XFEXT:
- $this->readXfExt();
- break;
- case self::XLS_TYPE_STYLE:
- $this->readStyle();
- break;
- case self::XLS_TYPE_PALETTE:
- $this->readPalette();
- break;
- case self::XLS_TYPE_SHEET:
- $this->readSheet();
- break;
- case self::XLS_TYPE_EXTERNALBOOK:
- $this->readExternalBook();
- break;
- case self::XLS_TYPE_EXTERNNAME:
- $this->readExternName();
- break;
- case self::XLS_TYPE_EXTERNSHEET:
- $this->readExternSheet();
- break;
- case self::XLS_TYPE_DEFINEDNAME:
- $this->readDefinedName();
- break;
- case self::XLS_TYPE_MSODRAWINGGROUP:
- $this->readMsoDrawingGroup();
- break;
- case self::XLS_TYPE_SST:
- $this->readSst();
- break;
- case self::XLS_TYPE_EOF:
- $this->readDefault();
- break 2;
- default:
- $this->readDefault();
- break;
- }
- }
-
- // Resolve indexed colors for font, fill, and border colors
- // Cannot be resolved already in XF record, because PALETTE record comes afterwards
- if (!$this->readDataOnly) {
- foreach ($this->objFonts as $objFont) {
- if (isset($objFont->colorIndex)) {
- $color = self::readColor($objFont->colorIndex, $this->palette, $this->version);
- $objFont->getColor()->setRGB($color['rgb']);
- }
- }
-
- foreach ($this->phpExcel->getCellXfCollection() as $objStyle) {
- // fill start and end color
- $fill = $objStyle->getFill();
-
- if (isset($fill->startcolorIndex)) {
- $startColor = self::readColor($fill->startcolorIndex, $this->palette, $this->version);
- $fill->getStartColor()->setRGB($startColor['rgb']);
- }
- if (isset($fill->endcolorIndex)) {
- $endColor = self::readColor($fill->endcolorIndex, $this->palette, $this->version);
- $fill->getEndColor()->setRGB($endColor['rgb']);
- }
-
- // border colors
- $top = $objStyle->getBorders()->getTop();
- $right = $objStyle->getBorders()->getRight();
- $bottom = $objStyle->getBorders()->getBottom();
- $left = $objStyle->getBorders()->getLeft();
- $diagonal = $objStyle->getBorders()->getDiagonal();
-
- if (isset($top->colorIndex)) {
- $borderTopColor = self::readColor($top->colorIndex, $this->palette, $this->version);
- $top->getColor()->setRGB($borderTopColor['rgb']);
- }
- if (isset($right->colorIndex)) {
- $borderRightColor = self::readColor($right->colorIndex, $this->palette, $this->version);
- $right->getColor()->setRGB($borderRightColor['rgb']);
- }
- if (isset($bottom->colorIndex)) {
- $borderBottomColor = self::readColor($bottom->colorIndex, $this->palette, $this->version);
- $bottom->getColor()->setRGB($borderBottomColor['rgb']);
- }
- if (isset($left->colorIndex)) {
- $borderLeftColor = self::readColor($left->colorIndex, $this->palette, $this->version);
- $left->getColor()->setRGB($borderLeftColor['rgb']);
- }
- if (isset($diagonal->colorIndex)) {
- $borderDiagonalColor = self::readColor($diagonal->colorIndex, $this->palette, $this->version);
- $diagonal->getColor()->setRGB($borderDiagonalColor['rgb']);
- }
- }
- }
-
- // treat MSODRAWINGGROUP records, workbook-level Escher
- if (!$this->readDataOnly && $this->drawingGroupData) {
- $escherWorkbook = new PHPExcel_Shared_Escher();
- $reader = new PHPExcel_Reader_Excel5_Escher($escherWorkbook);
- $escherWorkbook = $reader->load($this->drawingGroupData);
-
- // debug Escher stream
- //$debug = new Debug_Escher(new PHPExcel_Shared_Escher());
- //$debug->load($this->drawingGroupData);
- }
-
- // Parse the individual sheets
- foreach ($this->sheets as $sheet) {
- if ($sheet['sheetType'] != 0x00) {
- // 0x00: Worksheet, 0x02: Chart, 0x06: Visual Basic module
- continue;
- }
-
- // check if sheet should be skipped
- if (isset($this->loadSheetsOnly) && !in_array($sheet['name'], $this->loadSheetsOnly)) {
- continue;
- }
-
- // add sheet to PHPExcel object
- $this->phpSheet = $this->phpExcel->createSheet();
- // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in formula
- // cells... during the load, all formulae should be correct, and we're simply bringing the worksheet
- // name in line with the formula, not the reverse
- $this->phpSheet->setTitle($sheet['name'], false);
- $this->phpSheet->setSheetState($sheet['sheetState']);
-
- $this->pos = $sheet['offset'];
-
- // Initialize isFitToPages. May change after reading SHEETPR record.
- $this->isFitToPages = false;
-
- // Initialize drawingData
- $this->drawingData = '';
-
- // Initialize objs
- $this->objs = array();
-
- // Initialize shared formula parts
- $this->sharedFormulaParts = array();
-
- // Initialize shared formulas
- $this->sharedFormulas = array();
-
- // Initialize text objs
- $this->textObjects = array();
-
- // Initialize cell annotations
- $this->cellNotes = array();
- $this->textObjRef = -1;
-
- while ($this->pos <= $this->dataSize - 4) {
- $code = self::getInt2d($this->data, $this->pos);
-
- switch ($code) {
- case self::XLS_TYPE_BOF:
- $this->readBof();
- break;
- case self::XLS_TYPE_PRINTGRIDLINES:
- $this->readPrintGridlines();
- break;
- case self::XLS_TYPE_DEFAULTROWHEIGHT:
- $this->readDefaultRowHeight();
- break;
- case self::XLS_TYPE_SHEETPR:
- $this->readSheetPr();
- break;
- case self::XLS_TYPE_HORIZONTALPAGEBREAKS:
- $this->readHorizontalPageBreaks();
- break;
- case self::XLS_TYPE_VERTICALPAGEBREAKS:
- $this->readVerticalPageBreaks();
- break;
- case self::XLS_TYPE_HEADER:
- $this->readHeader();
- break;
- case self::XLS_TYPE_FOOTER:
- $this->readFooter();
- break;
- case self::XLS_TYPE_HCENTER:
- $this->readHcenter();
- break;
- case self::XLS_TYPE_VCENTER:
- $this->readVcenter();
- break;
- case self::XLS_TYPE_LEFTMARGIN:
- $this->readLeftMargin();
- break;
- case self::XLS_TYPE_RIGHTMARGIN:
- $this->readRightMargin();
- break;
- case self::XLS_TYPE_TOPMARGIN:
- $this->readTopMargin();
- break;
- case self::XLS_TYPE_BOTTOMMARGIN:
- $this->readBottomMargin();
- break;
- case self::XLS_TYPE_PAGESETUP:
- $this->readPageSetup();
- break;
- case self::XLS_TYPE_PROTECT:
- $this->readProtect();
- break;
- case self::XLS_TYPE_SCENPROTECT:
- $this->readScenProtect();
- break;
- case self::XLS_TYPE_OBJECTPROTECT:
- $this->readObjectProtect();
- break;
- case self::XLS_TYPE_PASSWORD:
- $this->readPassword();
- break;
- case self::XLS_TYPE_DEFCOLWIDTH:
- $this->readDefColWidth();
- break;
- case self::XLS_TYPE_COLINFO:
- $this->readColInfo();
- break;
- case self::XLS_TYPE_DIMENSION:
- $this->readDefault();
- break;
- case self::XLS_TYPE_ROW:
- $this->readRow();
- break;
- case self::XLS_TYPE_DBCELL:
- $this->readDefault();
- break;
- case self::XLS_TYPE_RK:
- $this->readRk();
- break;
- case self::XLS_TYPE_LABELSST:
- $this->readLabelSst();
- break;
- case self::XLS_TYPE_MULRK:
- $this->readMulRk();
- break;
- case self::XLS_TYPE_NUMBER:
- $this->readNumber();
- break;
- case self::XLS_TYPE_FORMULA:
- $this->readFormula();
- break;
- case self::XLS_TYPE_SHAREDFMLA:
- $this->readSharedFmla();
- break;
- case self::XLS_TYPE_BOOLERR:
- $this->readBoolErr();
- break;
- case self::XLS_TYPE_MULBLANK:
- $this->readMulBlank();
- break;
- case self::XLS_TYPE_LABEL:
- $this->readLabel();
- break;
- case self::XLS_TYPE_BLANK:
- $this->readBlank();
- break;
- case self::XLS_TYPE_MSODRAWING:
- $this->readMsoDrawing();
- break;
- case self::XLS_TYPE_OBJ:
- $this->readObj();
- break;
- case self::XLS_TYPE_WINDOW2:
- $this->readWindow2();
- break;
- case self::XLS_TYPE_PAGELAYOUTVIEW:
- $this->readPageLayoutView();
- break;
- case self::XLS_TYPE_SCL:
- $this->readScl();
- break;
- case self::XLS_TYPE_PANE:
- $this->readPane();
- break;
- case self::XLS_TYPE_SELECTION:
- $this->readSelection();
- break;
- case self::XLS_TYPE_MERGEDCELLS:
- $this->readMergedCells();
- break;
- case self::XLS_TYPE_HYPERLINK:
- $this->readHyperLink();
- break;
- case self::XLS_TYPE_DATAVALIDATIONS:
- $this->readDataValidations();
- break;
- case self::XLS_TYPE_DATAVALIDATION:
- $this->readDataValidation();
- break;
- case self::XLS_TYPE_SHEETLAYOUT:
- $this->readSheetLayout();
- break;
- case self::XLS_TYPE_SHEETPROTECTION:
- $this->readSheetProtection();
- break;
- case self::XLS_TYPE_RANGEPROTECTION:
- $this->readRangeProtection();
- break;
- case self::XLS_TYPE_NOTE:
- $this->readNote();
- break;
- //case self::XLS_TYPE_IMDATA: $this->readImData(); break;
- case self::XLS_TYPE_TXO:
- $this->readTextObject();
- break;
- case self::XLS_TYPE_CONTINUE:
- $this->readContinue();
- break;
- case self::XLS_TYPE_EOF:
- $this->readDefault();
- break 2;
- default:
- $this->readDefault();
- break;
- }
-
- }
-
- // treat MSODRAWING records, sheet-level Escher
- if (!$this->readDataOnly && $this->drawingData) {
- $escherWorksheet = new PHPExcel_Shared_Escher();
- $reader = new PHPExcel_Reader_Excel5_Escher($escherWorksheet);
- $escherWorksheet = $reader->load($this->drawingData);
-
- // debug Escher stream
- //$debug = new Debug_Escher(new PHPExcel_Shared_Escher());
- //$debug->load($this->drawingData);
-
- // get all spContainers in one long array, so they can be mapped to OBJ records
- $allSpContainers = $escherWorksheet->getDgContainer()->getSpgrContainer()->getAllSpContainers();
- }
-
- // treat OBJ records
- foreach ($this->objs as $n => $obj) {
-// echo '
Object reference is ', $n,'
';
-// var_dump($obj);
-// echo '
';
-
- // the first shape container never has a corresponding OBJ record, hence $n + 1
- if (isset($allSpContainers[$n + 1]) && is_object($allSpContainers[$n + 1])) {
- $spContainer = $allSpContainers[$n + 1];
-
- // we skip all spContainers that are a part of a group shape since we cannot yet handle those
- if ($spContainer->getNestingLevel() > 1) {
- continue;
- }
-
- // calculate the width and height of the shape
- list($startColumn, $startRow) = PHPExcel_Cell::coordinateFromString($spContainer->getStartCoordinates());
- list($endColumn, $endRow) = PHPExcel_Cell::coordinateFromString($spContainer->getEndCoordinates());
-
- $startOffsetX = $spContainer->getStartOffsetX();
- $startOffsetY = $spContainer->getStartOffsetY();
- $endOffsetX = $spContainer->getEndOffsetX();
- $endOffsetY = $spContainer->getEndOffsetY();
-
- $width = PHPExcel_Shared_Excel5::getDistanceX($this->phpSheet, $startColumn, $startOffsetX, $endColumn, $endOffsetX);
- $height = PHPExcel_Shared_Excel5::getDistanceY($this->phpSheet, $startRow, $startOffsetY, $endRow, $endOffsetY);
-
- // calculate offsetX and offsetY of the shape
- $offsetX = $startOffsetX * PHPExcel_Shared_Excel5::sizeCol($this->phpSheet, $startColumn) / 1024;
- $offsetY = $startOffsetY * PHPExcel_Shared_Excel5::sizeRow($this->phpSheet, $startRow) / 256;
-
- switch ($obj['otObjType']) {
- case 0x19:
- // Note
-// echo 'Cell Annotation Object
';
-// echo 'Object ID is ', $obj['idObjID'],'
';
- if (isset($this->cellNotes[$obj['idObjID']])) {
- $cellNote = $this->cellNotes[$obj['idObjID']];
-
- if (isset($this->textObjects[$obj['idObjID']])) {
- $textObject = $this->textObjects[$obj['idObjID']];
- $this->cellNotes[$obj['idObjID']]['objTextData'] = $textObject;
- }
- }
- break;
- case 0x08:
-// echo 'Picture Object
';
- // picture
- // get index to BSE entry (1-based)
- $BSEindex = $spContainer->getOPT(0x0104);
- $BSECollection = $escherWorkbook->getDggContainer()->getBstoreContainer()->getBSECollection();
- $BSE = $BSECollection[$BSEindex - 1];
- $blipType = $BSE->getBlipType();
-
- // need check because some blip types are not supported by Escher reader such as EMF
- if ($blip = $BSE->getBlip()) {
- $ih = imagecreatefromstring($blip->getData());
- $drawing = new PHPExcel_Worksheet_MemoryDrawing();
- $drawing->setImageResource($ih);
-
- // width, height, offsetX, offsetY
- $drawing->setResizeProportional(false);
- $drawing->setWidth($width);
- $drawing->setHeight($height);
- $drawing->setOffsetX($offsetX);
- $drawing->setOffsetY($offsetY);
-
- switch ($blipType) {
- case PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_JPEG:
- $drawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_JPEG);
- $drawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_JPEG);
- break;
- case PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE::BLIPTYPE_PNG:
- $drawing->setRenderingFunction(PHPExcel_Worksheet_MemoryDrawing::RENDERING_PNG);
- $drawing->setMimeType(PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_PNG);
- break;
- }
-
- $drawing->setWorksheet($this->phpSheet);
- $drawing->setCoordinates($spContainer->getStartCoordinates());
- }
- break;
- default:
- // other object type
- break;
- }
- }
- }
-
- // treat SHAREDFMLA records
- if ($this->version == self::XLS_BIFF8) {
- foreach ($this->sharedFormulaParts as $cell => $baseCell) {
- list($column, $row) = PHPExcel_Cell::coordinateFromString($cell);
- if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($column, $row, $this->phpSheet->getTitle())) {
- $formula = $this->getFormulaFromStructure($this->sharedFormulas[$baseCell], $cell);
- $this->phpSheet->getCell($cell)->setValueExplicit('=' . $formula, PHPExcel_Cell_DataType::TYPE_FORMULA);
- }
- }
- }
-
- if (!empty($this->cellNotes)) {
- foreach ($this->cellNotes as $note => $noteDetails) {
- if (!isset($noteDetails['objTextData'])) {
- if (isset($this->textObjects[$note])) {
- $textObject = $this->textObjects[$note];
- $noteDetails['objTextData'] = $textObject;
- } else {
- $noteDetails['objTextData']['text'] = '';
- }
- }
-// echo 'Cell annotation ', $note,'
';
-// var_dump($noteDetails);
-// echo '
';
- $cellAddress = str_replace('$', '', $noteDetails['cellRef']);
- $this->phpSheet->getComment($cellAddress)->setAuthor($noteDetails['author'])->setText($this->parseRichText($noteDetails['objTextData']['text']));
- }
- }
- }
-
- // add the named ranges (defined names)
- foreach ($this->definedname as $definedName) {
- if ($definedName['isBuiltInName']) {
- switch ($definedName['name']) {
- case pack('C', 0x06):
- // print area
- // in general, formula looks like this: Foo!$C$7:$J$66,Bar!$A$1:$IV$2
- $ranges = explode(',', $definedName['formula']); // FIXME: what if sheetname contains comma?
-
- $extractedRanges = array();
- foreach ($ranges as $range) {
- // $range should look like one of these
- // Foo!$C$7:$J$66
- // Bar!$A$1:$IV$2
- $explodes = explode('!', $range); // FIXME: what if sheetname contains exclamation mark?
- $sheetName = trim($explodes[0], "'");
- if (count($explodes) == 2) {
- if (strpos($explodes[1], ':') === false) {
- $explodes[1] = $explodes[1] . ':' . $explodes[1];
- }
- $extractedRanges[] = str_replace('$', '', $explodes[1]); // C7:J66
- }
- }
- if ($docSheet = $this->phpExcel->getSheetByName($sheetName)) {
- $docSheet->getPageSetup()->setPrintArea(implode(',', $extractedRanges)); // C7:J66,A1:IV2
- }
- break;
- case pack('C', 0x07):
- // print titles (repeating rows)
- // Assuming BIFF8, there are 3 cases
- // 1. repeating rows
- // formula looks like this: Sheet!$A$1:$IV$2
- // rows 1-2 repeat
- // 2. repeating columns
- // formula looks like this: Sheet!$A$1:$B$65536
- // columns A-B repeat
- // 3. both repeating rows and repeating columns
- // formula looks like this: Sheet!$A$1:$B$65536,Sheet!$A$1:$IV$2
- $ranges = explode(',', $definedName['formula']); // FIXME: what if sheetname contains comma?
- foreach ($ranges as $range) {
- // $range should look like this one of these
- // Sheet!$A$1:$B$65536
- // Sheet!$A$1:$IV$2
- $explodes = explode('!', $range);
- if (count($explodes) == 2) {
- if ($docSheet = $this->phpExcel->getSheetByName($explodes[0])) {
- $extractedRange = $explodes[1];
- $extractedRange = str_replace('$', '', $extractedRange);
-
- $coordinateStrings = explode(':', $extractedRange);
- if (count($coordinateStrings) == 2) {
- list($firstColumn, $firstRow) = PHPExcel_Cell::coordinateFromString($coordinateStrings[0]);
- list($lastColumn, $lastRow) = PHPExcel_Cell::coordinateFromString($coordinateStrings[1]);
-
- if ($firstColumn == 'A' and $lastColumn == 'IV') {
- // then we have repeating rows
- $docSheet->getPageSetup()->setRowsToRepeatAtTop(array($firstRow, $lastRow));
- } elseif ($firstRow == 1 and $lastRow == 65536) {
- // then we have repeating columns
- $docSheet->getPageSetup()->setColumnsToRepeatAtLeft(array($firstColumn, $lastColumn));
- }
- }
- }
- }
- }
- break;
- }
- } else {
- // Extract range
- $explodes = explode('!', $definedName['formula']);
-
- if (count($explodes) == 2) {
- if (($docSheet = $this->phpExcel->getSheetByName($explodes[0])) ||
- ($docSheet = $this->phpExcel->getSheetByName(trim($explodes[0], "'")))) {
- $extractedRange = $explodes[1];
- $extractedRange = str_replace('$', '', $extractedRange);
-
- $localOnly = ($definedName['scope'] == 0) ? false : true;
-
- $scope = ($definedName['scope'] == 0) ? null : $this->phpExcel->getSheetByName($this->sheets[$definedName['scope'] - 1]['name']);
-
- $this->phpExcel->addNamedRange(new PHPExcel_NamedRange((string)$definedName['name'], $docSheet, $extractedRange, $localOnly, $scope));
- }
- } else {
- // Named Value
- // TODO Provide support for named values
- }
- }
- }
- $this->data = null;
-
- return $this->phpExcel;
- }
-
- /**
- * Read record data from stream, decrypting as required
- *
- * @param string $data Data stream to read from
- * @param int $pos Position to start reading from
- * @param int $length Record data length
- *
- * @return string Record data
- */
- private function readRecordData($data, $pos, $len)
- {
- $data = substr($data, $pos, $len);
-
- // File not encrypted, or record before encryption start point
- if ($this->encryption == self::MS_BIFF_CRYPTO_NONE || $pos < $this->encryptionStartPos) {
- return $data;
- }
-
- $recordData = '';
- if ($this->encryption == self::MS_BIFF_CRYPTO_RC4) {
- $oldBlock = floor($this->rc4Pos / self::REKEY_BLOCK);
- $block = floor($pos / self::REKEY_BLOCK);
- $endBlock = floor(($pos + $len) / self::REKEY_BLOCK);
-
- // Spin an RC4 decryptor to the right spot. If we have a decryptor sitting
- // at a point earlier in the current block, re-use it as we can save some time.
- if ($block != $oldBlock || $pos < $this->rc4Pos || !$this->rc4Key) {
- $this->rc4Key = $this->makeKey($block, $this->md5Ctxt);
- $step = $pos % self::REKEY_BLOCK;
- } else {
- $step = $pos - $this->rc4Pos;
- }
- $this->rc4Key->RC4(str_repeat("\0", $step));
-
- // Decrypt record data (re-keying at the end of every block)
- while ($block != $endBlock) {
- $step = self::REKEY_BLOCK - ($pos % self::REKEY_BLOCK);
- $recordData .= $this->rc4Key->RC4(substr($data, 0, $step));
- $data = substr($data, $step);
- $pos += $step;
- $len -= $step;
- $block++;
- $this->rc4Key = $this->makeKey($block, $this->md5Ctxt);
- }
- $recordData .= $this->rc4Key->RC4(substr($data, 0, $len));
-
- // Keep track of the position of this decryptor.
- // We'll try and re-use it later if we can to speed things up
- $this->rc4Pos = $pos + $len;
- } elseif ($this->encryption == self::MS_BIFF_CRYPTO_XOR) {
- throw new PHPExcel_Reader_Exception('XOr encryption not supported');
- }
- return $recordData;
- }
-
- /**
- * Use OLE reader to extract the relevant data streams from the OLE file
- *
- * @param string $pFilename
- */
- private function loadOLE($pFilename)
- {
- // OLE reader
- $ole = new PHPExcel_Shared_OLERead();
- // get excel data,
- $res = $ole->read($pFilename);
- // Get workbook data: workbook stream + sheet streams
- $this->data = $ole->getStream($ole->wrkbook);
- // Get summary information data
- $this->summaryInformation = $ole->getStream($ole->summaryInformation);
- // Get additional document summary information data
- $this->documentSummaryInformation = $ole->getStream($ole->documentSummaryInformation);
- // Get user-defined property data
-// $this->userDefinedProperties = $ole->getUserDefinedProperties();
- }
-
-
- /**
- * Read summary information
- */
- private function readSummaryInformation()
- {
- if (!isset($this->summaryInformation)) {
- return;
- }
-
- // offset: 0; size: 2; must be 0xFE 0xFF (UTF-16 LE byte order mark)
- // offset: 2; size: 2;
- // offset: 4; size: 2; OS version
- // offset: 6; size: 2; OS indicator
- // offset: 8; size: 16
- // offset: 24; size: 4; section count
- $secCount = self::getInt4d($this->summaryInformation, 24);
-
- // offset: 28; size: 16; first section's class id: e0 85 9f f2 f9 4f 68 10 ab 91 08 00 2b 27 b3 d9
- // offset: 44; size: 4
- $secOffset = self::getInt4d($this->summaryInformation, 44);
-
- // section header
- // offset: $secOffset; size: 4; section length
- $secLength = self::getInt4d($this->summaryInformation, $secOffset);
-
- // offset: $secOffset+4; size: 4; property count
- $countProperties = self::getInt4d($this->summaryInformation, $secOffset+4);
-
- // initialize code page (used to resolve string values)
- $codePage = 'CP1252';
-
- // offset: ($secOffset+8); size: var
- // loop through property decarations and properties
- for ($i = 0; $i < $countProperties; ++$i) {
- // offset: ($secOffset+8) + (8 * $i); size: 4; property ID
- $id = self::getInt4d($this->summaryInformation, ($secOffset+8) + (8 * $i));
-
- // Use value of property id as appropriate
- // offset: ($secOffset+12) + (8 * $i); size: 4; offset from beginning of section (48)
- $offset = self::getInt4d($this->summaryInformation, ($secOffset+12) + (8 * $i));
-
- $type = self::getInt4d($this->summaryInformation, $secOffset + $offset);
-
- // initialize property value
- $value = null;
-
- // extract property value based on property type
- switch ($type) {
- case 0x02: // 2 byte signed integer
- $value = self::getInt2d($this->summaryInformation, $secOffset + 4 + $offset);
- break;
- case 0x03: // 4 byte signed integer
- $value = self::getInt4d($this->summaryInformation, $secOffset + 4 + $offset);
- break;
- case 0x13: // 4 byte unsigned integer
- // not needed yet, fix later if necessary
- break;
- case 0x1E: // null-terminated string prepended by dword string length
- $byteLength = self::getInt4d($this->summaryInformation, $secOffset + 4 + $offset);
- $value = substr($this->summaryInformation, $secOffset + 8 + $offset, $byteLength);
- $value = PHPExcel_Shared_String::ConvertEncoding($value, 'UTF-8', $codePage);
- $value = rtrim($value);
- break;
- case 0x40: // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
- // PHP-time
- $value = PHPExcel_Shared_OLE::OLE2LocalDate(substr($this->summaryInformation, $secOffset + 4 + $offset, 8));
- break;
- case 0x47: // Clipboard format
- // not needed yet, fix later if necessary
- break;
- }
-
- switch ($id) {
- case 0x01: // Code Page
- $codePage = PHPExcel_Shared_CodePage::NumberToName($value);
- break;
- case 0x02: // Title
- $this->phpExcel->getProperties()->setTitle($value);
- break;
- case 0x03: // Subject
- $this->phpExcel->getProperties()->setSubject($value);
- break;
- case 0x04: // Author (Creator)
- $this->phpExcel->getProperties()->setCreator($value);
- break;
- case 0x05: // Keywords
- $this->phpExcel->getProperties()->setKeywords($value);
- break;
- case 0x06: // Comments (Description)
- $this->phpExcel->getProperties()->setDescription($value);
- break;
- case 0x07: // Template
- // Not supported by PHPExcel
- break;
- case 0x08: // Last Saved By (LastModifiedBy)
- $this->phpExcel->getProperties()->setLastModifiedBy($value);
- break;
- case 0x09: // Revision
- // Not supported by PHPExcel
- break;
- case 0x0A: // Total Editing Time
- // Not supported by PHPExcel
- break;
- case 0x0B: // Last Printed
- // Not supported by PHPExcel
- break;
- case 0x0C: // Created Date/Time
- $this->phpExcel->getProperties()->setCreated($value);
- break;
- case 0x0D: // Modified Date/Time
- $this->phpExcel->getProperties()->setModified($value);
- break;
- case 0x0E: // Number of Pages
- // Not supported by PHPExcel
- break;
- case 0x0F: // Number of Words
- // Not supported by PHPExcel
- break;
- case 0x10: // Number of Characters
- // Not supported by PHPExcel
- break;
- case 0x11: // Thumbnail
- // Not supported by PHPExcel
- break;
- case 0x12: // Name of creating application
- // Not supported by PHPExcel
- break;
- case 0x13: // Security
- // Not supported by PHPExcel
- break;
- }
- }
- }
-
-
- /**
- * Read additional document summary information
- */
- private function readDocumentSummaryInformation()
- {
- if (!isset($this->documentSummaryInformation)) {
- return;
- }
-
- // offset: 0; size: 2; must be 0xFE 0xFF (UTF-16 LE byte order mark)
- // offset: 2; size: 2;
- // offset: 4; size: 2; OS version
- // offset: 6; size: 2; OS indicator
- // offset: 8; size: 16
- // offset: 24; size: 4; section count
- $secCount = self::getInt4d($this->documentSummaryInformation, 24);
-// echo '$secCount = ', $secCount,'
';
-
- // offset: 28; size: 16; first section's class id: 02 d5 cd d5 9c 2e 1b 10 93 97 08 00 2b 2c f9 ae
- // offset: 44; size: 4; first section offset
- $secOffset = self::getInt4d($this->documentSummaryInformation, 44);
-// echo '$secOffset = ', $secOffset,'
';
-
- // section header
- // offset: $secOffset; size: 4; section length
- $secLength = self::getInt4d($this->documentSummaryInformation, $secOffset);
-// echo '$secLength = ', $secLength,'
';
-
- // offset: $secOffset+4; size: 4; property count
- $countProperties = self::getInt4d($this->documentSummaryInformation, $secOffset+4);
-// echo '$countProperties = ', $countProperties,'
';
-
- // initialize code page (used to resolve string values)
- $codePage = 'CP1252';
-
- // offset: ($secOffset+8); size: var
- // loop through property decarations and properties
- for ($i = 0; $i < $countProperties; ++$i) {
-// echo 'Property ', $i,'
';
- // offset: ($secOffset+8) + (8 * $i); size: 4; property ID
- $id = self::getInt4d($this->documentSummaryInformation, ($secOffset+8) + (8 * $i));
-// echo 'ID is ', $id,'
';
-
- // Use value of property id as appropriate
- // offset: 60 + 8 * $i; size: 4; offset from beginning of section (48)
- $offset = self::getInt4d($this->documentSummaryInformation, ($secOffset+12) + (8 * $i));
-
- $type = self::getInt4d($this->documentSummaryInformation, $secOffset + $offset);
-// echo 'Type is ', $type,', ';
-
- // initialize property value
- $value = null;
-
- // extract property value based on property type
- switch ($type) {
- case 0x02: // 2 byte signed integer
- $value = self::getInt2d($this->documentSummaryInformation, $secOffset + 4 + $offset);
- break;
- case 0x03: // 4 byte signed integer
- $value = self::getInt4d($this->documentSummaryInformation, $secOffset + 4 + $offset);
- break;
- case 0x0B: // Boolean
- $value = self::getInt2d($this->documentSummaryInformation, $secOffset + 4 + $offset);
- $value = ($value == 0 ? false : true);
- break;
- case 0x13: // 4 byte unsigned integer
- // not needed yet, fix later if necessary
- break;
- case 0x1E: // null-terminated string prepended by dword string length
- $byteLength = self::getInt4d($this->documentSummaryInformation, $secOffset + 4 + $offset);
- $value = substr($this->documentSummaryInformation, $secOffset + 8 + $offset, $byteLength);
- $value = PHPExcel_Shared_String::ConvertEncoding($value, 'UTF-8', $codePage);
- $value = rtrim($value);
- break;
- case 0x40: // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
- // PHP-Time
- $value = PHPExcel_Shared_OLE::OLE2LocalDate(substr($this->documentSummaryInformation, $secOffset + 4 + $offset, 8));
- break;
- case 0x47: // Clipboard format
- // not needed yet, fix later if necessary
- break;
- }
-
- switch ($id) {
- case 0x01: // Code Page
- $codePage = PHPExcel_Shared_CodePage::NumberToName($value);
- break;
- case 0x02: // Category
- $this->phpExcel->getProperties()->setCategory($value);
- break;
- case 0x03: // Presentation Target
- // Not supported by PHPExcel
- break;
- case 0x04: // Bytes
- // Not supported by PHPExcel
- break;
- case 0x05: // Lines
- // Not supported by PHPExcel
- break;
- case 0x06: // Paragraphs
- // Not supported by PHPExcel
- break;
- case 0x07: // Slides
- // Not supported by PHPExcel
- break;
- case 0x08: // Notes
- // Not supported by PHPExcel
- break;
- case 0x09: // Hidden Slides
- // Not supported by PHPExcel
- break;
- case 0x0A: // MM Clips
- // Not supported by PHPExcel
- break;
- case 0x0B: // Scale Crop
- // Not supported by PHPExcel
- break;
- case 0x0C: // Heading Pairs
- // Not supported by PHPExcel
- break;
- case 0x0D: // Titles of Parts
- // Not supported by PHPExcel
- break;
- case 0x0E: // Manager
- $this->phpExcel->getProperties()->setManager($value);
- break;
- case 0x0F: // Company
- $this->phpExcel->getProperties()->setCompany($value);
- break;
- case 0x10: // Links up-to-date
- // Not supported by PHPExcel
- break;
- }
- }
- }
-
-
- /**
- * Reads a general type of BIFF record. Does nothing except for moving stream pointer forward to next record.
- */
- private function readDefault()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
-// $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
- }
-
-
- /**
- * The NOTE record specifies a comment associated with a particular cell. In Excel 95 (BIFF7) and earlier versions,
- * this record stores a note (cell note). This feature was significantly enhanced in Excel 97.
- */
- private function readNote()
- {
-// echo 'Read Cell Annotation
';
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if ($this->readDataOnly) {
- return;
- }
-
- $cellAddress = $this->readBIFF8CellAddress(substr($recordData, 0, 4));
- if ($this->version == self::XLS_BIFF8) {
- $noteObjID = self::getInt2d($recordData, 6);
- $noteAuthor = self::readUnicodeStringLong(substr($recordData, 8));
- $noteAuthor = $noteAuthor['value'];
-// echo 'Note Address=', $cellAddress,'
';
-// echo 'Note Object ID=', $noteObjID,'
';
-// echo 'Note Author=', $noteAuthor,'
';
-//
- $this->cellNotes[$noteObjID] = array(
- 'cellRef' => $cellAddress,
- 'objectID' => $noteObjID,
- 'author' => $noteAuthor
- );
- } else {
- $extension = false;
- if ($cellAddress == '$B$65536') {
- // If the address row is -1 and the column is 0, (which translates as $B$65536) then this is a continuation
- // note from the previous cell annotation. We're not yet handling this, so annotations longer than the
- // max 2048 bytes will probably throw a wobbly.
- $row = self::getInt2d($recordData, 0);
- $extension = true;
- $cellAddress = array_pop(array_keys($this->phpSheet->getComments()));
- }
-// echo 'Note Address=', $cellAddress,'
';
-
- $cellAddress = str_replace('$', '', $cellAddress);
- $noteLength = self::getInt2d($recordData, 4);
- $noteText = trim(substr($recordData, 6));
-// echo 'Note Length=', $noteLength,'
';
-// echo 'Note Text=', $noteText,'
';
-
- if ($extension) {
- // Concatenate this extension with the currently set comment for the cell
- $comment = $this->phpSheet->getComment($cellAddress);
- $commentText = $comment->getText()->getPlainText();
- $comment->setText($this->parseRichText($commentText.$noteText));
- } else {
- // Set comment for the cell
- $this->phpSheet->getComment($cellAddress)->setText($this->parseRichText($noteText));
-// ->setAuthor($author)
- }
- }
-
- }
-
-
- /**
- * The TEXT Object record contains the text associated with a cell annotation.
- */
- private function readTextObject()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if ($this->readDataOnly) {
- return;
- }
-
- // recordData consists of an array of subrecords looking like this:
- // grbit: 2 bytes; Option Flags
- // rot: 2 bytes; rotation
- // cchText: 2 bytes; length of the text (in the first continue record)
- // cbRuns: 2 bytes; length of the formatting (in the second continue record)
- // followed by the continuation records containing the actual text and formatting
- $grbitOpts = self::getInt2d($recordData, 0);
- $rot = self::getInt2d($recordData, 2);
- $cchText = self::getInt2d($recordData, 10);
- $cbRuns = self::getInt2d($recordData, 12);
- $text = $this->getSplicedRecordData();
-
- $this->textObjects[$this->textObjRef] = array(
- 'text' => substr($text["recordData"], $text["spliceOffsets"][0]+1, $cchText),
- 'format' => substr($text["recordData"], $text["spliceOffsets"][1], $cbRuns),
- 'alignment' => $grbitOpts,
- 'rotation' => $rot
- );
-
-// echo '_readTextObject()
';
-// var_dump($this->textObjects[$this->textObjRef]);
-// echo '
';
- }
-
-
- /**
- * Read BOF
- */
- private function readBof()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = substr($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 2; size: 2; type of the following data
- $substreamType = self::getInt2d($recordData, 2);
-
- switch ($substreamType) {
- case self::XLS_WorkbookGlobals:
- $version = self::getInt2d($recordData, 0);
- if (($version != self::XLS_BIFF8) && ($version != self::XLS_BIFF7)) {
- throw new PHPExcel_Reader_Exception('Cannot read this Excel file. Version is too old.');
- }
- $this->version = $version;
- break;
- case self::XLS_Worksheet:
- // do not use this version information for anything
- // it is unreliable (OpenOffice doc, 5.8), use only version information from the global stream
- break;
- default:
- // substream, e.g. chart
- // just skip the entire substream
- do {
- $code = self::getInt2d($this->data, $this->pos);
- $this->readDefault();
- } while ($code != self::XLS_TYPE_EOF && $this->pos < $this->dataSize);
- break;
- }
- }
-
-
- /**
- * FILEPASS
- *
- * This record is part of the File Protection Block. It
- * contains information about the read/write password of the
- * file. All record contents following this record will be
- * encrypted.
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- *
- * The decryption functions and objects used from here on in
- * are based on the source of Spreadsheet-ParseExcel:
- * http://search.cpan.org/~jmcnamara/Spreadsheet-ParseExcel/
- */
- private function readFilepass()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
-
- if ($length != 54) {
- throw new PHPExcel_Reader_Exception('Unexpected file pass record length');
- }
-
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->verifyPassword('VelvetSweatshop', substr($recordData, 6, 16), substr($recordData, 22, 16), substr($recordData, 38, 16), $this->md5Ctxt)) {
- throw new PHPExcel_Reader_Exception('Decryption password incorrect');
- }
-
- $this->encryption = self::MS_BIFF_CRYPTO_RC4;
-
- // Decryption required from the record after next onwards
- $this->encryptionStartPos = $this->pos + self::getInt2d($this->data, $this->pos + 2);
- }
-
- /**
- * Make an RC4 decryptor for the given block
- *
- * @var int $block Block for which to create decrypto
- * @var string $valContext MD5 context state
- *
- * @return PHPExcel_Reader_Excel5_RC4
- */
- private function makeKey($block, $valContext)
- {
- $pwarray = str_repeat("\0", 64);
-
- for ($i = 0; $i < 5; $i++) {
- $pwarray[$i] = $valContext[$i];
- }
-
- $pwarray[5] = chr($block & 0xff);
- $pwarray[6] = chr(($block >> 8) & 0xff);
- $pwarray[7] = chr(($block >> 16) & 0xff);
- $pwarray[8] = chr(($block >> 24) & 0xff);
-
- $pwarray[9] = "\x80";
- $pwarray[56] = "\x48";
-
- $md5 = new PHPExcel_Reader_Excel5_MD5();
- $md5->add($pwarray);
-
- $s = $md5->getContext();
- return new PHPExcel_Reader_Excel5_RC4($s);
- }
-
- /**
- * Verify RC4 file password
- *
- * @var string $password Password to check
- * @var string $docid Document id
- * @var string $salt_data Salt data
- * @var string $hashedsalt_data Hashed salt data
- * @var string &$valContext Set to the MD5 context of the value
- *
- * @return bool Success
- */
- private function verifyPassword($password, $docid, $salt_data, $hashedsalt_data, &$valContext)
- {
- $pwarray = str_repeat("\0", 64);
-
- for ($i = 0; $i < strlen($password); $i++) {
- $o = ord(substr($password, $i, 1));
- $pwarray[2 * $i] = chr($o & 0xff);
- $pwarray[2 * $i + 1] = chr(($o >> 8) & 0xff);
- }
- $pwarray[2 * $i] = chr(0x80);
- $pwarray[56] = chr(($i << 4) & 0xff);
-
- $md5 = new PHPExcel_Reader_Excel5_MD5();
- $md5->add($pwarray);
-
- $mdContext1 = $md5->getContext();
-
- $offset = 0;
- $keyoffset = 0;
- $tocopy = 5;
-
- $md5->reset();
-
- while ($offset != 16) {
- if ((64 - $offset) < 5) {
- $tocopy = 64 - $offset;
- }
- for ($i = 0; $i <= $tocopy; $i++) {
- $pwarray[$offset + $i] = $mdContext1[$keyoffset + $i];
- }
- $offset += $tocopy;
-
- if ($offset == 64) {
- $md5->add($pwarray);
- $keyoffset = $tocopy;
- $tocopy = 5 - $tocopy;
- $offset = 0;
- continue;
- }
-
- $keyoffset = 0;
- $tocopy = 5;
- for ($i = 0; $i < 16; $i++) {
- $pwarray[$offset + $i] = $docid[$i];
- }
- $offset += 16;
- }
-
- $pwarray[16] = "\x80";
- for ($i = 0; $i < 47; $i++) {
- $pwarray[17 + $i] = "\0";
- }
- $pwarray[56] = "\x80";
- $pwarray[57] = "\x0a";
-
- $md5->add($pwarray);
- $valContext = $md5->getContext();
-
- $key = $this->makeKey(0, $valContext);
-
- $salt = $key->RC4($salt_data);
- $hashedsalt = $key->RC4($hashedsalt_data);
-
- $salt .= "\x80" . str_repeat("\0", 47);
- $salt[56] = "\x80";
-
- $md5->reset();
- $md5->add($salt);
- $mdContext2 = $md5->getContext();
-
- return $mdContext2 == $hashedsalt;
- }
-
- /**
- * CODEPAGE
- *
- * This record stores the text encoding used to write byte
- * strings, stored as MS Windows code page identifier.
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- */
- private function readCodepage()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 0; size: 2; code page identifier
- $codepage = self::getInt2d($recordData, 0);
-
- $this->codepage = PHPExcel_Shared_CodePage::NumberToName($codepage);
- }
-
-
- /**
- * DATEMODE
- *
- * This record specifies the base date for displaying date
- * values. All dates are stored as count of days past this
- * base date. In BIFF2-BIFF4 this record is part of the
- * Calculation Settings Block. In BIFF5-BIFF8 it is
- * stored in the Workbook Globals Substream.
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- */
- private function readDateMode()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 0; size: 2; 0 = base 1900, 1 = base 1904
- PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900);
- if (ord($recordData{0}) == 1) {
- PHPExcel_Shared_Date::setExcelCalendar(PHPExcel_Shared_Date::CALENDAR_MAC_1904);
- }
- }
-
-
- /**
- * Read a FONT record
- */
- private function readFont()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- $objFont = new PHPExcel_Style_Font();
-
- // offset: 0; size: 2; height of the font (in twips = 1/20 of a point)
- $size = self::getInt2d($recordData, 0);
- $objFont->setSize($size / 20);
-
- // offset: 2; size: 2; option flags
- // bit: 0; mask 0x0001; bold (redundant in BIFF5-BIFF8)
- // bit: 1; mask 0x0002; italic
- $isItalic = (0x0002 & self::getInt2d($recordData, 2)) >> 1;
- if ($isItalic) {
- $objFont->setItalic(true);
- }
-
- // bit: 2; mask 0x0004; underlined (redundant in BIFF5-BIFF8)
- // bit: 3; mask 0x0008; strike
- $isStrike = (0x0008 & self::getInt2d($recordData, 2)) >> 3;
- if ($isStrike) {
- $objFont->setStrikethrough(true);
- }
-
- // offset: 4; size: 2; colour index
- $colorIndex = self::getInt2d($recordData, 4);
- $objFont->colorIndex = $colorIndex;
-
- // offset: 6; size: 2; font weight
- $weight = self::getInt2d($recordData, 6);
- switch ($weight) {
- case 0x02BC:
- $objFont->setBold(true);
- break;
- }
-
- // offset: 8; size: 2; escapement type
- $escapement = self::getInt2d($recordData, 8);
- switch ($escapement) {
- case 0x0001:
- $objFont->setSuperScript(true);
- break;
- case 0x0002:
- $objFont->setSubScript(true);
- break;
- }
-
- // offset: 10; size: 1; underline type
- $underlineType = ord($recordData{10});
- switch ($underlineType) {
- case 0x00:
- break; // no underline
- case 0x01:
- $objFont->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
- break;
- case 0x02:
- $objFont->setUnderline(PHPExcel_Style_Font::UNDERLINE_DOUBLE);
- break;
- case 0x21:
- $objFont->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLEACCOUNTING);
- break;
- case 0x22:
- $objFont->setUnderline(PHPExcel_Style_Font::UNDERLINE_DOUBLEACCOUNTING);
- break;
- }
-
- // offset: 11; size: 1; font family
- // offset: 12; size: 1; character set
- // offset: 13; size: 1; not used
- // offset: 14; size: var; font name
- if ($this->version == self::XLS_BIFF8) {
- $string = self::readUnicodeStringShort(substr($recordData, 14));
- } else {
- $string = $this->readByteStringShort(substr($recordData, 14));
- }
- $objFont->setName($string['value']);
-
- $this->objFonts[] = $objFont;
- }
- }
-
-
- /**
- * FORMAT
- *
- * This record contains information about a number format.
- * All FORMAT records occur together in a sequential list.
- *
- * In BIFF2-BIFF4 other records referencing a FORMAT record
- * contain a zero-based index into this list. From BIFF5 on
- * the FORMAT record contains the index itself that will be
- * used by other records.
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- */
- private function readFormat()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- $indexCode = self::getInt2d($recordData, 0);
-
- if ($this->version == self::XLS_BIFF8) {
- $string = self::readUnicodeStringLong(substr($recordData, 2));
- } else {
- // BIFF7
- $string = $this->readByteStringShort(substr($recordData, 2));
- }
-
- $formatString = $string['value'];
- $this->formats[$indexCode] = $formatString;
- }
- }
-
-
- /**
- * XF - Extended Format
- *
- * This record contains formatting information for cells, rows, columns or styles.
- * According to http://support.microsoft.com/kb/147732 there are always at least 15 cell style XF
- * and 1 cell XF.
- * Inspection of Excel files generated by MS Office Excel shows that XF records 0-14 are cell style XF
- * and XF record 15 is a cell XF
- * We only read the first cell style XF and skip the remaining cell style XF records
- * We read all cell XF records.
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- */
- private function readXf()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- $objStyle = new PHPExcel_Style();
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 2; Index to FONT record
- if (self::getInt2d($recordData, 0) < 4) {
- $fontIndex = self::getInt2d($recordData, 0);
- } else {
- // this has to do with that index 4 is omitted in all BIFF versions for some strange reason
- // check the OpenOffice documentation of the FONT record
- $fontIndex = self::getInt2d($recordData, 0) - 1;
- }
- $objStyle->setFont($this->objFonts[$fontIndex]);
-
- // offset: 2; size: 2; Index to FORMAT record
- $numberFormatIndex = self::getInt2d($recordData, 2);
- if (isset($this->formats[$numberFormatIndex])) {
- // then we have user-defined format code
- $numberformat = array('code' => $this->formats[$numberFormatIndex]);
- } elseif (($code = PHPExcel_Style_NumberFormat::builtInFormatCode($numberFormatIndex)) !== '') {
- // then we have built-in format code
- $numberformat = array('code' => $code);
- } else {
- // we set the general format code
- $numberformat = array('code' => 'General');
- }
- $objStyle->getNumberFormat()->setFormatCode($numberformat['code']);
-
- // offset: 4; size: 2; XF type, cell protection, and parent style XF
- // bit 2-0; mask 0x0007; XF_TYPE_PROT
- $xfTypeProt = self::getInt2d($recordData, 4);
- // bit 0; mask 0x01; 1 = cell is locked
- $isLocked = (0x01 & $xfTypeProt) >> 0;
- $objStyle->getProtection()->setLocked($isLocked ? PHPExcel_Style_Protection::PROTECTION_INHERIT : PHPExcel_Style_Protection::PROTECTION_UNPROTECTED);
-
- // bit 1; mask 0x02; 1 = Formula is hidden
- $isHidden = (0x02 & $xfTypeProt) >> 1;
- $objStyle->getProtection()->setHidden($isHidden ? PHPExcel_Style_Protection::PROTECTION_PROTECTED : PHPExcel_Style_Protection::PROTECTION_UNPROTECTED);
-
- // bit 2; mask 0x04; 0 = Cell XF, 1 = Cell Style XF
- $isCellStyleXf = (0x04 & $xfTypeProt) >> 2;
-
- // offset: 6; size: 1; Alignment and text break
- // bit 2-0, mask 0x07; horizontal alignment
- $horAlign = (0x07 & ord($recordData{6})) >> 0;
- switch ($horAlign) {
- case 0:
- $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_GENERAL);
- break;
- case 1:
- $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
- break;
- case 2:
- $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
- break;
- case 3:
- $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_RIGHT);
- break;
- case 4:
- $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_FILL);
- break;
- case 5:
- $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY);
- break;
- case 6:
- $objStyle->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS);
- break;
- }
- // bit 3, mask 0x08; wrap text
- $wrapText = (0x08 & ord($recordData{6})) >> 3;
- switch ($wrapText) {
- case 0:
- $objStyle->getAlignment()->setWrapText(false);
- break;
- case 1:
- $objStyle->getAlignment()->setWrapText(true);
- break;
- }
- // bit 6-4, mask 0x70; vertical alignment
- $vertAlign = (0x70 & ord($recordData{6})) >> 4;
- switch ($vertAlign) {
- case 0:
- $objStyle->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_TOP);
- break;
- case 1:
- $objStyle->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
- break;
- case 2:
- $objStyle->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_BOTTOM);
- break;
- case 3:
- $objStyle->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_JUSTIFY);
- break;
- }
-
- if ($this->version == self::XLS_BIFF8) {
- // offset: 7; size: 1; XF_ROTATION: Text rotation angle
- $angle = ord($recordData{7});
- $rotation = 0;
- if ($angle <= 90) {
- $rotation = $angle;
- } elseif ($angle <= 180) {
- $rotation = 90 - $angle;
- } elseif ($angle == 255) {
- $rotation = -165;
- }
- $objStyle->getAlignment()->setTextRotation($rotation);
-
- // offset: 8; size: 1; Indentation, shrink to cell size, and text direction
- // bit: 3-0; mask: 0x0F; indent level
- $indent = (0x0F & ord($recordData{8})) >> 0;
- $objStyle->getAlignment()->setIndent($indent);
-
- // bit: 4; mask: 0x10; 1 = shrink content to fit into cell
- $shrinkToFit = (0x10 & ord($recordData{8})) >> 4;
- switch ($shrinkToFit) {
- case 0:
- $objStyle->getAlignment()->setShrinkToFit(false);
- break;
- case 1:
- $objStyle->getAlignment()->setShrinkToFit(true);
- break;
- }
-
- // offset: 9; size: 1; Flags used for attribute groups
-
- // offset: 10; size: 4; Cell border lines and background area
- // bit: 3-0; mask: 0x0000000F; left style
- if ($bordersLeftStyle = self::mapBorderStyle((0x0000000F & self::getInt4d($recordData, 10)) >> 0)) {
- $objStyle->getBorders()->getLeft()->setBorderStyle($bordersLeftStyle);
- }
- // bit: 7-4; mask: 0x000000F0; right style
- if ($bordersRightStyle = self::mapBorderStyle((0x000000F0 & self::getInt4d($recordData, 10)) >> 4)) {
- $objStyle->getBorders()->getRight()->setBorderStyle($bordersRightStyle);
- }
- // bit: 11-8; mask: 0x00000F00; top style
- if ($bordersTopStyle = self::mapBorderStyle((0x00000F00 & self::getInt4d($recordData, 10)) >> 8)) {
- $objStyle->getBorders()->getTop()->setBorderStyle($bordersTopStyle);
- }
- // bit: 15-12; mask: 0x0000F000; bottom style
- if ($bordersBottomStyle = self::mapBorderStyle((0x0000F000 & self::getInt4d($recordData, 10)) >> 12)) {
- $objStyle->getBorders()->getBottom()->setBorderStyle($bordersBottomStyle);
- }
- // bit: 22-16; mask: 0x007F0000; left color
- $objStyle->getBorders()->getLeft()->colorIndex = (0x007F0000 & self::getInt4d($recordData, 10)) >> 16;
-
- // bit: 29-23; mask: 0x3F800000; right color
- $objStyle->getBorders()->getRight()->colorIndex = (0x3F800000 & self::getInt4d($recordData, 10)) >> 23;
-
- // bit: 30; mask: 0x40000000; 1 = diagonal line from top left to right bottom
- $diagonalDown = (0x40000000 & self::getInt4d($recordData, 10)) >> 30 ? true : false;
-
- // bit: 31; mask: 0x80000000; 1 = diagonal line from bottom left to top right
- $diagonalUp = (0x80000000 & self::getInt4d($recordData, 10)) >> 31 ? true : false;
-
- if ($diagonalUp == false && $diagonalDown == false) {
- $objStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_NONE);
- } elseif ($diagonalUp == true && $diagonalDown == false) {
- $objStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_UP);
- } elseif ($diagonalUp == false && $diagonalDown == true) {
- $objStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_DOWN);
- } elseif ($diagonalUp == true && $diagonalDown == true) {
- $objStyle->getBorders()->setDiagonalDirection(PHPExcel_Style_Borders::DIAGONAL_BOTH);
- }
-
- // offset: 14; size: 4;
- // bit: 6-0; mask: 0x0000007F; top color
- $objStyle->getBorders()->getTop()->colorIndex = (0x0000007F & self::getInt4d($recordData, 14)) >> 0;
-
- // bit: 13-7; mask: 0x00003F80; bottom color
- $objStyle->getBorders()->getBottom()->colorIndex = (0x00003F80 & self::getInt4d($recordData, 14)) >> 7;
-
- // bit: 20-14; mask: 0x001FC000; diagonal color
- $objStyle->getBorders()->getDiagonal()->colorIndex = (0x001FC000 & self::getInt4d($recordData, 14)) >> 14;
-
- // bit: 24-21; mask: 0x01E00000; diagonal style
- if ($bordersDiagonalStyle = self::mapBorderStyle((0x01E00000 & self::getInt4d($recordData, 14)) >> 21)) {
- $objStyle->getBorders()->getDiagonal()->setBorderStyle($bordersDiagonalStyle);
- }
-
- // bit: 31-26; mask: 0xFC000000 fill pattern
- if ($fillType = self::mapFillPattern((0xFC000000 & self::getInt4d($recordData, 14)) >> 26)) {
- $objStyle->getFill()->setFillType($fillType);
- }
- // offset: 18; size: 2; pattern and background colour
- // bit: 6-0; mask: 0x007F; color index for pattern color
- $objStyle->getFill()->startcolorIndex = (0x007F & self::getInt2d($recordData, 18)) >> 0;
-
- // bit: 13-7; mask: 0x3F80; color index for pattern background
- $objStyle->getFill()->endcolorIndex = (0x3F80 & self::getInt2d($recordData, 18)) >> 7;
- } else {
- // BIFF5
-
- // offset: 7; size: 1; Text orientation and flags
- $orientationAndFlags = ord($recordData{7});
-
- // bit: 1-0; mask: 0x03; XF_ORIENTATION: Text orientation
- $xfOrientation = (0x03 & $orientationAndFlags) >> 0;
- switch ($xfOrientation) {
- case 0:
- $objStyle->getAlignment()->setTextRotation(0);
- break;
- case 1:
- $objStyle->getAlignment()->setTextRotation(-165);
- break;
- case 2:
- $objStyle->getAlignment()->setTextRotation(90);
- break;
- case 3:
- $objStyle->getAlignment()->setTextRotation(-90);
- break;
- }
-
- // offset: 8; size: 4; cell border lines and background area
- $borderAndBackground = self::getInt4d($recordData, 8);
-
- // bit: 6-0; mask: 0x0000007F; color index for pattern color
- $objStyle->getFill()->startcolorIndex = (0x0000007F & $borderAndBackground) >> 0;
-
- // bit: 13-7; mask: 0x00003F80; color index for pattern background
- $objStyle->getFill()->endcolorIndex = (0x00003F80 & $borderAndBackground) >> 7;
-
- // bit: 21-16; mask: 0x003F0000; fill pattern
- $objStyle->getFill()->setFillType(self::mapFillPattern((0x003F0000 & $borderAndBackground) >> 16));
-
- // bit: 24-22; mask: 0x01C00000; bottom line style
- $objStyle->getBorders()->getBottom()->setBorderStyle(self::mapBorderStyle((0x01C00000 & $borderAndBackground) >> 22));
-
- // bit: 31-25; mask: 0xFE000000; bottom line color
- $objStyle->getBorders()->getBottom()->colorIndex = (0xFE000000 & $borderAndBackground) >> 25;
-
- // offset: 12; size: 4; cell border lines
- $borderLines = self::getInt4d($recordData, 12);
-
- // bit: 2-0; mask: 0x00000007; top line style
- $objStyle->getBorders()->getTop()->setBorderStyle(self::mapBorderStyle((0x00000007 & $borderLines) >> 0));
-
- // bit: 5-3; mask: 0x00000038; left line style
- $objStyle->getBorders()->getLeft()->setBorderStyle(self::mapBorderStyle((0x00000038 & $borderLines) >> 3));
-
- // bit: 8-6; mask: 0x000001C0; right line style
- $objStyle->getBorders()->getRight()->setBorderStyle(self::mapBorderStyle((0x000001C0 & $borderLines) >> 6));
-
- // bit: 15-9; mask: 0x0000FE00; top line color index
- $objStyle->getBorders()->getTop()->colorIndex = (0x0000FE00 & $borderLines) >> 9;
-
- // bit: 22-16; mask: 0x007F0000; left line color index
- $objStyle->getBorders()->getLeft()->colorIndex = (0x007F0000 & $borderLines) >> 16;
-
- // bit: 29-23; mask: 0x3F800000; right line color index
- $objStyle->getBorders()->getRight()->colorIndex = (0x3F800000 & $borderLines) >> 23;
- }
-
- // add cellStyleXf or cellXf and update mapping
- if ($isCellStyleXf) {
- // we only read one style XF record which is always the first
- if ($this->xfIndex == 0) {
- $this->phpExcel->addCellStyleXf($objStyle);
- $this->mapCellStyleXfIndex[$this->xfIndex] = 0;
- }
- } else {
- // we read all cell XF records
- $this->phpExcel->addCellXf($objStyle);
- $this->mapCellXfIndex[$this->xfIndex] = count($this->phpExcel->getCellXfCollection()) - 1;
- }
-
- // update XF index for when we read next record
- ++$this->xfIndex;
- }
- }
-
-
- /**
- *
- */
- private function readXfExt()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 2; 0x087D = repeated header
-
- // offset: 2; size: 2
-
- // offset: 4; size: 8; not used
-
- // offset: 12; size: 2; record version
-
- // offset: 14; size: 2; index to XF record which this record modifies
- $ixfe = self::getInt2d($recordData, 14);
-
- // offset: 16; size: 2; not used
-
- // offset: 18; size: 2; number of extension properties that follow
- $cexts = self::getInt2d($recordData, 18);
-
- // start reading the actual extension data
- $offset = 20;
- while ($offset < $length) {
- // extension type
- $extType = self::getInt2d($recordData, $offset);
-
- // extension length
- $cb = self::getInt2d($recordData, $offset + 2);
-
- // extension data
- $extData = substr($recordData, $offset + 4, $cb);
-
- switch ($extType) {
- case 4: // fill start color
- $xclfType = self::getInt2d($extData, 0); // color type
- $xclrValue = substr($extData, 4, 4); // color value (value based on color type)
-
- if ($xclfType == 2) {
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2}));
-
- // modify the relevant style property
- if (isset($this->mapCellXfIndex[$ixfe])) {
- $fill = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getFill();
- $fill->getStartColor()->setRGB($rgb);
- unset($fill->startcolorIndex); // normal color index does not apply, discard
- }
- }
- break;
- case 5: // fill end color
- $xclfType = self::getInt2d($extData, 0); // color type
- $xclrValue = substr($extData, 4, 4); // color value (value based on color type)
-
- if ($xclfType == 2) {
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2}));
-
- // modify the relevant style property
- if (isset($this->mapCellXfIndex[$ixfe])) {
- $fill = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getFill();
- $fill->getEndColor()->setRGB($rgb);
- unset($fill->endcolorIndex); // normal color index does not apply, discard
- }
- }
- break;
- case 7: // border color top
- $xclfType = self::getInt2d($extData, 0); // color type
- $xclrValue = substr($extData, 4, 4); // color value (value based on color type)
-
- if ($xclfType == 2) {
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2}));
-
- // modify the relevant style property
- if (isset($this->mapCellXfIndex[$ixfe])) {
- $top = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getTop();
- $top->getColor()->setRGB($rgb);
- unset($top->colorIndex); // normal color index does not apply, discard
- }
- }
- break;
- case 8: // border color bottom
- $xclfType = self::getInt2d($extData, 0); // color type
- $xclrValue = substr($extData, 4, 4); // color value (value based on color type)
-
- if ($xclfType == 2) {
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2}));
-
- // modify the relevant style property
- if (isset($this->mapCellXfIndex[$ixfe])) {
- $bottom = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getBottom();
- $bottom->getColor()->setRGB($rgb);
- unset($bottom->colorIndex); // normal color index does not apply, discard
- }
- }
- break;
- case 9: // border color left
- $xclfType = self::getInt2d($extData, 0); // color type
- $xclrValue = substr($extData, 4, 4); // color value (value based on color type)
-
- if ($xclfType == 2) {
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2}));
-
- // modify the relevant style property
- if (isset($this->mapCellXfIndex[$ixfe])) {
- $left = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getLeft();
- $left->getColor()->setRGB($rgb);
- unset($left->colorIndex); // normal color index does not apply, discard
- }
- }
- break;
- case 10: // border color right
- $xclfType = self::getInt2d($extData, 0); // color type
- $xclrValue = substr($extData, 4, 4); // color value (value based on color type)
-
- if ($xclfType == 2) {
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2}));
-
- // modify the relevant style property
- if (isset($this->mapCellXfIndex[$ixfe])) {
- $right = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getRight();
- $right->getColor()->setRGB($rgb);
- unset($right->colorIndex); // normal color index does not apply, discard
- }
- }
- break;
- case 11: // border color diagonal
- $xclfType = self::getInt2d($extData, 0); // color type
- $xclrValue = substr($extData, 4, 4); // color value (value based on color type)
-
- if ($xclfType == 2) {
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2}));
-
- // modify the relevant style property
- if (isset($this->mapCellXfIndex[$ixfe])) {
- $diagonal = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getBorders()->getDiagonal();
- $diagonal->getColor()->setRGB($rgb);
- unset($diagonal->colorIndex); // normal color index does not apply, discard
- }
- }
- break;
- case 13: // font color
- $xclfType = self::getInt2d($extData, 0); // color type
- $xclrValue = substr($extData, 4, 4); // color value (value based on color type)
-
- if ($xclfType == 2) {
- $rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2}));
-
- // modify the relevant style property
- if (isset($this->mapCellXfIndex[$ixfe])) {
- $font = $this->phpExcel->getCellXfByIndex($this->mapCellXfIndex[$ixfe])->getFont();
- $font->getColor()->setRGB($rgb);
- unset($font->colorIndex); // normal color index does not apply, discard
- }
- }
- break;
- }
-
- $offset += $cb;
- }
- }
-
- }
-
-
- /**
- * Read STYLE record
- */
- private function readStyle()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 2; index to XF record and flag for built-in style
- $ixfe = self::getInt2d($recordData, 0);
-
- // bit: 11-0; mask 0x0FFF; index to XF record
- $xfIndex = (0x0FFF & $ixfe) >> 0;
-
- // bit: 15; mask 0x8000; 0 = user-defined style, 1 = built-in style
- $isBuiltIn = (bool) ((0x8000 & $ixfe) >> 15);
-
- if ($isBuiltIn) {
- // offset: 2; size: 1; identifier for built-in style
- $builtInId = ord($recordData{2});
-
- switch ($builtInId) {
- case 0x00:
- // currently, we are not using this for anything
- break;
- default:
- break;
- }
- } else {
- // user-defined; not supported by PHPExcel
- }
- }
- }
-
-
- /**
- * Read PALETTE record
- */
- private function readPalette()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 2; number of following colors
- $nm = self::getInt2d($recordData, 0);
-
- // list of RGB colors
- for ($i = 0; $i < $nm; ++$i) {
- $rgb = substr($recordData, 2 + 4 * $i, 4);
- $this->palette[] = self::readRGB($rgb);
- }
- }
- }
-
-
- /**
- * SHEET
- *
- * This record is located in the Workbook Globals
- * Substream and represents a sheet inside the workbook.
- * One SHEET record is written for each sheet. It stores the
- * sheet name and a stream offset to the BOF record of the
- * respective Sheet Substream within the Workbook Stream.
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- */
- private function readSheet()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // offset: 0; size: 4; absolute stream position of the BOF record of the sheet
- // NOTE: not encrypted
- $rec_offset = self::getInt4d($this->data, $this->pos + 4);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 4; size: 1; sheet state
- switch (ord($recordData{4})) {
- case 0x00:
- $sheetState = PHPExcel_Worksheet::SHEETSTATE_VISIBLE;
- break;
- case 0x01:
- $sheetState = PHPExcel_Worksheet::SHEETSTATE_HIDDEN;
- break;
- case 0x02:
- $sheetState = PHPExcel_Worksheet::SHEETSTATE_VERYHIDDEN;
- break;
- default:
- $sheetState = PHPExcel_Worksheet::SHEETSTATE_VISIBLE;
- break;
- }
-
- // offset: 5; size: 1; sheet type
- $sheetType = ord($recordData{5});
-
- // offset: 6; size: var; sheet name
- if ($this->version == self::XLS_BIFF8) {
- $string = self::readUnicodeStringShort(substr($recordData, 6));
- $rec_name = $string['value'];
- } elseif ($this->version == self::XLS_BIFF7) {
- $string = $this->readByteStringShort(substr($recordData, 6));
- $rec_name = $string['value'];
- }
-
- $this->sheets[] = array(
- 'name' => $rec_name,
- 'offset' => $rec_offset,
- 'sheetState' => $sheetState,
- 'sheetType' => $sheetType,
- );
- }
-
-
- /**
- * Read EXTERNALBOOK record
- */
- private function readExternalBook()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset within record data
- $offset = 0;
-
- // there are 4 types of records
- if (strlen($recordData) > 4) {
- // external reference
- // offset: 0; size: 2; number of sheet names ($nm)
- $nm = self::getInt2d($recordData, 0);
- $offset += 2;
-
- // offset: 2; size: var; encoded URL without sheet name (Unicode string, 16-bit length)
- $encodedUrlString = self::readUnicodeStringLong(substr($recordData, 2));
- $offset += $encodedUrlString['size'];
-
- // offset: var; size: var; list of $nm sheet names (Unicode strings, 16-bit length)
- $externalSheetNames = array();
- for ($i = 0; $i < $nm; ++$i) {
- $externalSheetNameString = self::readUnicodeStringLong(substr($recordData, $offset));
- $externalSheetNames[] = $externalSheetNameString['value'];
- $offset += $externalSheetNameString['size'];
- }
-
- // store the record data
- $this->externalBooks[] = array(
- 'type' => 'external',
- 'encodedUrl' => $encodedUrlString['value'],
- 'externalSheetNames' => $externalSheetNames,
- );
- } elseif (substr($recordData, 2, 2) == pack('CC', 0x01, 0x04)) {
- // internal reference
- // offset: 0; size: 2; number of sheet in this document
- // offset: 2; size: 2; 0x01 0x04
- $this->externalBooks[] = array(
- 'type' => 'internal',
- );
- } elseif (substr($recordData, 0, 4) == pack('vCC', 0x0001, 0x01, 0x3A)) {
- // add-in function
- // offset: 0; size: 2; 0x0001
- $this->externalBooks[] = array(
- 'type' => 'addInFunction',
- );
- } elseif (substr($recordData, 0, 2) == pack('v', 0x0000)) {
- // DDE links, OLE links
- // offset: 0; size: 2; 0x0000
- // offset: 2; size: var; encoded source document name
- $this->externalBooks[] = array(
- 'type' => 'DDEorOLE',
- );
- }
- }
-
-
- /**
- * Read EXTERNNAME record.
- */
- private function readExternName()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // external sheet references provided for named cells
- if ($this->version == self::XLS_BIFF8) {
- // offset: 0; size: 2; options
- $options = self::getInt2d($recordData, 0);
-
- // offset: 2; size: 2;
-
- // offset: 4; size: 2; not used
-
- // offset: 6; size: var
- $nameString = self::readUnicodeStringShort(substr($recordData, 6));
-
- // offset: var; size: var; formula data
- $offset = 6 + $nameString['size'];
- $formula = $this->getFormulaFromStructure(substr($recordData, $offset));
-
- $this->externalNames[] = array(
- 'name' => $nameString['value'],
- 'formula' => $formula,
- );
- }
- }
-
-
- /**
- * Read EXTERNSHEET record
- */
- private function readExternSheet()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // external sheet references provided for named cells
- if ($this->version == self::XLS_BIFF8) {
- // offset: 0; size: 2; number of following ref structures
- $nm = self::getInt2d($recordData, 0);
- for ($i = 0; $i < $nm; ++$i) {
- $this->ref[] = array(
- // offset: 2 + 6 * $i; index to EXTERNALBOOK record
- 'externalBookIndex' => self::getInt2d($recordData, 2 + 6 * $i),
- // offset: 4 + 6 * $i; index to first sheet in EXTERNALBOOK record
- 'firstSheetIndex' => self::getInt2d($recordData, 4 + 6 * $i),
- // offset: 6 + 6 * $i; index to last sheet in EXTERNALBOOK record
- 'lastSheetIndex' => self::getInt2d($recordData, 6 + 6 * $i),
- );
- }
- }
- }
-
-
- /**
- * DEFINEDNAME
- *
- * This record is part of a Link Table. It contains the name
- * and the token array of an internal defined name. Token
- * arrays of defined names contain tokens with aberrant
- * token classes.
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- */
- private function readDefinedName()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if ($this->version == self::XLS_BIFF8) {
- // retrieves named cells
-
- // offset: 0; size: 2; option flags
- $opts = self::getInt2d($recordData, 0);
-
- // bit: 5; mask: 0x0020; 0 = user-defined name, 1 = built-in-name
- $isBuiltInName = (0x0020 & $opts) >> 5;
-
- // offset: 2; size: 1; keyboard shortcut
-
- // offset: 3; size: 1; length of the name (character count)
- $nlen = ord($recordData{3});
-
- // offset: 4; size: 2; size of the formula data (it can happen that this is zero)
- // note: there can also be additional data, this is not included in $flen
- $flen = self::getInt2d($recordData, 4);
-
- // offset: 8; size: 2; 0=Global name, otherwise index to sheet (1-based)
- $scope = self::getInt2d($recordData, 8);
-
- // offset: 14; size: var; Name (Unicode string without length field)
- $string = self::readUnicodeString(substr($recordData, 14), $nlen);
-
- // offset: var; size: $flen; formula data
- $offset = 14 + $string['size'];
- $formulaStructure = pack('v', $flen) . substr($recordData, $offset);
-
- try {
- $formula = $this->getFormulaFromStructure($formulaStructure);
- } catch (PHPExcel_Exception $e) {
- $formula = '';
- }
-
- $this->definedname[] = array(
- 'isBuiltInName' => $isBuiltInName,
- 'name' => $string['value'],
- 'formula' => $formula,
- 'scope' => $scope,
- );
- }
- }
-
-
- /**
- * Read MSODRAWINGGROUP record
- */
- private function readMsoDrawingGroup()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
-
- // get spliced record data
- $splicedRecordData = $this->getSplicedRecordData();
- $recordData = $splicedRecordData['recordData'];
-
- $this->drawingGroupData .= $recordData;
- }
-
-
- /**
- * SST - Shared String Table
- *
- * This record contains a list of all strings used anywhere
- * in the workbook. Each string occurs only once. The
- * workbook uses indexes into the list to reference the
- * strings.
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- **/
- private function readSst()
- {
- // offset within (spliced) record data
- $pos = 0;
-
- // get spliced record data
- $splicedRecordData = $this->getSplicedRecordData();
-
- $recordData = $splicedRecordData['recordData'];
- $spliceOffsets = $splicedRecordData['spliceOffsets'];
-
- // offset: 0; size: 4; total number of strings in the workbook
- $pos += 4;
-
- // offset: 4; size: 4; number of following strings ($nm)
- $nm = self::getInt4d($recordData, 4);
- $pos += 4;
-
- // loop through the Unicode strings (16-bit length)
- for ($i = 0; $i < $nm; ++$i) {
- // number of characters in the Unicode string
- $numChars = self::getInt2d($recordData, $pos);
- $pos += 2;
-
- // option flags
- $optionFlags = ord($recordData{$pos});
- ++$pos;
-
- // bit: 0; mask: 0x01; 0 = compressed; 1 = uncompressed
- $isCompressed = (($optionFlags & 0x01) == 0) ;
-
- // bit: 2; mask: 0x02; 0 = ordinary; 1 = Asian phonetic
- $hasAsian = (($optionFlags & 0x04) != 0);
-
- // bit: 3; mask: 0x03; 0 = ordinary; 1 = Rich-Text
- $hasRichText = (($optionFlags & 0x08) != 0);
-
- if ($hasRichText) {
- // number of Rich-Text formatting runs
- $formattingRuns = self::getInt2d($recordData, $pos);
- $pos += 2;
- }
-
- if ($hasAsian) {
- // size of Asian phonetic setting
- $extendedRunLength = self::getInt4d($recordData, $pos);
- $pos += 4;
- }
-
- // expected byte length of character array if not split
- $len = ($isCompressed) ? $numChars : $numChars * 2;
-
- // look up limit position
- foreach ($spliceOffsets as $spliceOffset) {
- // it can happen that the string is empty, therefore we need
- // <= and not just <
- if ($pos <= $spliceOffset) {
- $limitpos = $spliceOffset;
- break;
- }
- }
-
- if ($pos + $len <= $limitpos) {
- // character array is not split between records
-
- $retstr = substr($recordData, $pos, $len);
- $pos += $len;
- } else {
- // character array is split between records
-
- // first part of character array
- $retstr = substr($recordData, $pos, $limitpos - $pos);
-
- $bytesRead = $limitpos - $pos;
-
- // remaining characters in Unicode string
- $charsLeft = $numChars - (($isCompressed) ? $bytesRead : ($bytesRead / 2));
-
- $pos = $limitpos;
-
- // keep reading the characters
- while ($charsLeft > 0) {
- // look up next limit position, in case the string span more than one continue record
- foreach ($spliceOffsets as $spliceOffset) {
- if ($pos < $spliceOffset) {
- $limitpos = $spliceOffset;
- break;
- }
- }
-
- // repeated option flags
- // OpenOffice.org documentation 5.21
- $option = ord($recordData{$pos});
- ++$pos;
-
- if ($isCompressed && ($option == 0)) {
- // 1st fragment compressed
- // this fragment compressed
- $len = min($charsLeft, $limitpos - $pos);
- $retstr .= substr($recordData, $pos, $len);
- $charsLeft -= $len;
- $isCompressed = true;
- } elseif (!$isCompressed && ($option != 0)) {
- // 1st fragment uncompressed
- // this fragment uncompressed
- $len = min($charsLeft * 2, $limitpos - $pos);
- $retstr .= substr($recordData, $pos, $len);
- $charsLeft -= $len / 2;
- $isCompressed = false;
- } elseif (!$isCompressed && ($option == 0)) {
- // 1st fragment uncompressed
- // this fragment compressed
- $len = min($charsLeft, $limitpos - $pos);
- for ($j = 0; $j < $len; ++$j) {
- $retstr .= $recordData{$pos + $j} . chr(0);
- }
- $charsLeft -= $len;
- $isCompressed = false;
- } else {
- // 1st fragment compressed
- // this fragment uncompressed
- $newstr = '';
- for ($j = 0; $j < strlen($retstr); ++$j) {
- $newstr .= $retstr[$j] . chr(0);
- }
- $retstr = $newstr;
- $len = min($charsLeft * 2, $limitpos - $pos);
- $retstr .= substr($recordData, $pos, $len);
- $charsLeft -= $len / 2;
- $isCompressed = false;
- }
-
- $pos += $len;
- }
- }
-
- // convert to UTF-8
- $retstr = self::encodeUTF16($retstr, $isCompressed);
-
- // read additional Rich-Text information, if any
- $fmtRuns = array();
- if ($hasRichText) {
- // list of formatting runs
- for ($j = 0; $j < $formattingRuns; ++$j) {
- // first formatted character; zero-based
- $charPos = self::getInt2d($recordData, $pos + $j * 4);
-
- // index to font record
- $fontIndex = self::getInt2d($recordData, $pos + 2 + $j * 4);
-
- $fmtRuns[] = array(
- 'charPos' => $charPos,
- 'fontIndex' => $fontIndex,
- );
- }
- $pos += 4 * $formattingRuns;
- }
-
- // read additional Asian phonetics information, if any
- if ($hasAsian) {
- // For Asian phonetic settings, we skip the extended string data
- $pos += $extendedRunLength;
- }
-
- // store the shared sting
- $this->sst[] = array(
- 'value' => $retstr,
- 'fmtRuns' => $fmtRuns,
- );
- }
-
- // getSplicedRecordData() takes care of moving current position in data stream
- }
-
-
- /**
- * Read PRINTGRIDLINES record
- */
- private function readPrintGridlines()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if ($this->version == self::XLS_BIFF8 && !$this->readDataOnly) {
- // offset: 0; size: 2; 0 = do not print sheet grid lines; 1 = print sheet gridlines
- $printGridlines = (bool) self::getInt2d($recordData, 0);
- $this->phpSheet->setPrintGridlines($printGridlines);
- }
- }
-
-
- /**
- * Read DEFAULTROWHEIGHT record
- */
- private function readDefaultRowHeight()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 0; size: 2; option flags
- // offset: 2; size: 2; default height for unused rows, (twips 1/20 point)
- $height = self::getInt2d($recordData, 2);
- $this->phpSheet->getDefaultRowDimension()->setRowHeight($height / 20);
- }
-
-
- /**
- * Read SHEETPR record
- */
- private function readSheetPr()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 0; size: 2
-
- // bit: 6; mask: 0x0040; 0 = outline buttons above outline group
- $isSummaryBelow = (0x0040 & self::getInt2d($recordData, 0)) >> 6;
- $this->phpSheet->setShowSummaryBelow($isSummaryBelow);
-
- // bit: 7; mask: 0x0080; 0 = outline buttons left of outline group
- $isSummaryRight = (0x0080 & self::getInt2d($recordData, 0)) >> 7;
- $this->phpSheet->setShowSummaryRight($isSummaryRight);
-
- // bit: 8; mask: 0x100; 0 = scale printout in percent, 1 = fit printout to number of pages
- // this corresponds to radio button setting in page setup dialog in Excel
- $this->isFitToPages = (bool) ((0x0100 & self::getInt2d($recordData, 0)) >> 8);
- }
-
-
- /**
- * Read HORIZONTALPAGEBREAKS record
- */
- private function readHorizontalPageBreaks()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if ($this->version == self::XLS_BIFF8 && !$this->readDataOnly) {
- // offset: 0; size: 2; number of the following row index structures
- $nm = self::getInt2d($recordData, 0);
-
- // offset: 2; size: 6 * $nm; list of $nm row index structures
- for ($i = 0; $i < $nm; ++$i) {
- $r = self::getInt2d($recordData, 2 + 6 * $i);
- $cf = self::getInt2d($recordData, 2 + 6 * $i + 2);
- $cl = self::getInt2d($recordData, 2 + 6 * $i + 4);
-
- // not sure why two column indexes are necessary?
- $this->phpSheet->setBreakByColumnAndRow($cf, $r, PHPExcel_Worksheet::BREAK_ROW);
- }
- }
- }
-
-
- /**
- * Read VERTICALPAGEBREAKS record
- */
- private function readVerticalPageBreaks()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if ($this->version == self::XLS_BIFF8 && !$this->readDataOnly) {
- // offset: 0; size: 2; number of the following column index structures
- $nm = self::getInt2d($recordData, 0);
-
- // offset: 2; size: 6 * $nm; list of $nm row index structures
- for ($i = 0; $i < $nm; ++$i) {
- $c = self::getInt2d($recordData, 2 + 6 * $i);
- $rf = self::getInt2d($recordData, 2 + 6 * $i + 2);
- $rl = self::getInt2d($recordData, 2 + 6 * $i + 4);
-
- // not sure why two row indexes are necessary?
- $this->phpSheet->setBreakByColumnAndRow($c, $rf, PHPExcel_Worksheet::BREAK_COLUMN);
- }
- }
- }
-
-
- /**
- * Read HEADER record
- */
- private function readHeader()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: var
- // realized that $recordData can be empty even when record exists
- if ($recordData) {
- if ($this->version == self::XLS_BIFF8) {
- $string = self::readUnicodeStringLong($recordData);
- } else {
- $string = $this->readByteStringShort($recordData);
- }
-
- $this->phpSheet->getHeaderFooter()->setOddHeader($string['value']);
- $this->phpSheet->getHeaderFooter()->setEvenHeader($string['value']);
- }
- }
- }
-
-
- /**
- * Read FOOTER record
- */
- private function readFooter()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: var
- // realized that $recordData can be empty even when record exists
- if ($recordData) {
- if ($this->version == self::XLS_BIFF8) {
- $string = self::readUnicodeStringLong($recordData);
- } else {
- $string = $this->readByteStringShort($recordData);
- }
- $this->phpSheet->getHeaderFooter()->setOddFooter($string['value']);
- $this->phpSheet->getHeaderFooter()->setEvenFooter($string['value']);
- }
- }
- }
-
-
- /**
- * Read HCENTER record
- */
- private function readHcenter()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 2; 0 = print sheet left aligned, 1 = print sheet centered horizontally
- $isHorizontalCentered = (bool) self::getInt2d($recordData, 0);
-
- $this->phpSheet->getPageSetup()->setHorizontalCentered($isHorizontalCentered);
- }
- }
-
-
- /**
- * Read VCENTER record
- */
- private function readVcenter()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 2; 0 = print sheet aligned at top page border, 1 = print sheet vertically centered
- $isVerticalCentered = (bool) self::getInt2d($recordData, 0);
-
- $this->phpSheet->getPageSetup()->setVerticalCentered($isVerticalCentered);
- }
- }
-
-
- /**
- * Read LEFTMARGIN record
- */
- private function readLeftMargin()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 8
- $this->phpSheet->getPageMargins()->setLeft(self::extractNumber($recordData));
- }
- }
-
-
- /**
- * Read RIGHTMARGIN record
- */
- private function readRightMargin()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 8
- $this->phpSheet->getPageMargins()->setRight(self::extractNumber($recordData));
- }
- }
-
-
- /**
- * Read TOPMARGIN record
- */
- private function readTopMargin()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 8
- $this->phpSheet->getPageMargins()->setTop(self::extractNumber($recordData));
- }
- }
-
-
- /**
- * Read BOTTOMMARGIN record
- */
- private function readBottomMargin()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 8
- $this->phpSheet->getPageMargins()->setBottom(self::extractNumber($recordData));
- }
- }
-
-
- /**
- * Read PAGESETUP record
- */
- private function readPageSetup()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 2; paper size
- $paperSize = self::getInt2d($recordData, 0);
-
- // offset: 2; size: 2; scaling factor
- $scale = self::getInt2d($recordData, 2);
-
- // offset: 6; size: 2; fit worksheet width to this number of pages, 0 = use as many as needed
- $fitToWidth = self::getInt2d($recordData, 6);
-
- // offset: 8; size: 2; fit worksheet height to this number of pages, 0 = use as many as needed
- $fitToHeight = self::getInt2d($recordData, 8);
-
- // offset: 10; size: 2; option flags
-
- // bit: 1; mask: 0x0002; 0=landscape, 1=portrait
- $isPortrait = (0x0002 & self::getInt2d($recordData, 10)) >> 1;
-
- // bit: 2; mask: 0x0004; 1= paper size, scaling factor, paper orient. not init
- // when this bit is set, do not use flags for those properties
- $isNotInit = (0x0004 & self::getInt2d($recordData, 10)) >> 2;
-
- if (!$isNotInit) {
- $this->phpSheet->getPageSetup()->setPaperSize($paperSize);
- switch ($isPortrait) {
- case 0:
- $this->phpSheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE);
- break;
- case 1:
- $this->phpSheet->getPageSetup()->setOrientation(PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT);
- break;
- }
-
- $this->phpSheet->getPageSetup()->setScale($scale, false);
- $this->phpSheet->getPageSetup()->setFitToPage((bool) $this->isFitToPages);
- $this->phpSheet->getPageSetup()->setFitToWidth($fitToWidth, false);
- $this->phpSheet->getPageSetup()->setFitToHeight($fitToHeight, false);
- }
-
- // offset: 16; size: 8; header margin (IEEE 754 floating-point value)
- $marginHeader = self::extractNumber(substr($recordData, 16, 8));
- $this->phpSheet->getPageMargins()->setHeader($marginHeader);
-
- // offset: 24; size: 8; footer margin (IEEE 754 floating-point value)
- $marginFooter = self::extractNumber(substr($recordData, 24, 8));
- $this->phpSheet->getPageMargins()->setFooter($marginFooter);
- }
- }
-
-
- /**
- * PROTECT - Sheet protection (BIFF2 through BIFF8)
- * if this record is omitted, then it also means no sheet protection
- */
- private function readProtect()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if ($this->readDataOnly) {
- return;
- }
-
- // offset: 0; size: 2;
-
- // bit 0, mask 0x01; 1 = sheet is protected
- $bool = (0x01 & self::getInt2d($recordData, 0)) >> 0;
- $this->phpSheet->getProtection()->setSheet((bool)$bool);
- }
-
-
- /**
- * SCENPROTECT
- */
- private function readScenProtect()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if ($this->readDataOnly) {
- return;
- }
-
- // offset: 0; size: 2;
-
- // bit: 0, mask 0x01; 1 = scenarios are protected
- $bool = (0x01 & self::getInt2d($recordData, 0)) >> 0;
-
- $this->phpSheet->getProtection()->setScenarios((bool)$bool);
- }
-
-
- /**
- * OBJECTPROTECT
- */
- private function readObjectProtect()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if ($this->readDataOnly) {
- return;
- }
-
- // offset: 0; size: 2;
-
- // bit: 0, mask 0x01; 1 = objects are protected
- $bool = (0x01 & self::getInt2d($recordData, 0)) >> 0;
-
- $this->phpSheet->getProtection()->setObjects((bool)$bool);
- }
-
-
- /**
- * PASSWORD - Sheet protection (hashed) password (BIFF2 through BIFF8)
- */
- private function readPassword()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 2; 16-bit hash value of password
- $password = strtoupper(dechex(self::getInt2d($recordData, 0))); // the hashed password
- $this->phpSheet->getProtection()->setPassword($password, true);
- }
- }
-
-
- /**
- * Read DEFCOLWIDTH record
- */
- private function readDefColWidth()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 0; size: 2; default column width
- $width = self::getInt2d($recordData, 0);
- if ($width != 8) {
- $this->phpSheet->getDefaultColumnDimension()->setWidth($width);
- }
- }
-
-
- /**
- * Read COLINFO record
- */
- private function readColInfo()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 2; index to first column in range
- $fc = self::getInt2d($recordData, 0); // first column index
-
- // offset: 2; size: 2; index to last column in range
- $lc = self::getInt2d($recordData, 2); // first column index
-
- // offset: 4; size: 2; width of the column in 1/256 of the width of the zero character
- $width = self::getInt2d($recordData, 4);
-
- // offset: 6; size: 2; index to XF record for default column formatting
- $xfIndex = self::getInt2d($recordData, 6);
-
- // offset: 8; size: 2; option flags
- // bit: 0; mask: 0x0001; 1= columns are hidden
- $isHidden = (0x0001 & self::getInt2d($recordData, 8)) >> 0;
-
- // bit: 10-8; mask: 0x0700; outline level of the columns (0 = no outline)
- $level = (0x0700 & self::getInt2d($recordData, 8)) >> 8;
-
- // bit: 12; mask: 0x1000; 1 = collapsed
- $isCollapsed = (0x1000 & self::getInt2d($recordData, 8)) >> 12;
-
- // offset: 10; size: 2; not used
-
- for ($i = $fc; $i <= $lc; ++$i) {
- if ($lc == 255 || $lc == 256) {
- $this->phpSheet->getDefaultColumnDimension()->setWidth($width / 256);
- break;
- }
- $this->phpSheet->getColumnDimensionByColumn($i)->setWidth($width / 256);
- $this->phpSheet->getColumnDimensionByColumn($i)->setVisible(!$isHidden);
- $this->phpSheet->getColumnDimensionByColumn($i)->setOutlineLevel($level);
- $this->phpSheet->getColumnDimensionByColumn($i)->setCollapsed($isCollapsed);
- $this->phpSheet->getColumnDimensionByColumn($i)->setXfIndex($this->mapCellXfIndex[$xfIndex]);
- }
- }
- }
-
-
- /**
- * ROW
- *
- * This record contains the properties of a single row in a
- * sheet. Rows and cells in a sheet are divided into blocks
- * of 32 rows.
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- */
- private function readRow()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 2; index of this row
- $r = self::getInt2d($recordData, 0);
-
- // offset: 2; size: 2; index to column of the first cell which is described by a cell record
-
- // offset: 4; size: 2; index to column of the last cell which is described by a cell record, increased by 1
-
- // offset: 6; size: 2;
-
- // bit: 14-0; mask: 0x7FFF; height of the row, in twips = 1/20 of a point
- $height = (0x7FFF & self::getInt2d($recordData, 6)) >> 0;
-
- // bit: 15: mask: 0x8000; 0 = row has custom height; 1= row has default height
- $useDefaultHeight = (0x8000 & self::getInt2d($recordData, 6)) >> 15;
-
- if (!$useDefaultHeight) {
- $this->phpSheet->getRowDimension($r + 1)->setRowHeight($height / 20);
- }
-
- // offset: 8; size: 2; not used
-
- // offset: 10; size: 2; not used in BIFF5-BIFF8
-
- // offset: 12; size: 4; option flags and default row formatting
-
- // bit: 2-0: mask: 0x00000007; outline level of the row
- $level = (0x00000007 & self::getInt4d($recordData, 12)) >> 0;
- $this->phpSheet->getRowDimension($r + 1)->setOutlineLevel($level);
-
- // bit: 4; mask: 0x00000010; 1 = outline group start or ends here... and is collapsed
- $isCollapsed = (0x00000010 & self::getInt4d($recordData, 12)) >> 4;
- $this->phpSheet->getRowDimension($r + 1)->setCollapsed($isCollapsed);
-
- // bit: 5; mask: 0x00000020; 1 = row is hidden
- $isHidden = (0x00000020 & self::getInt4d($recordData, 12)) >> 5;
- $this->phpSheet->getRowDimension($r + 1)->setVisible(!$isHidden);
-
- // bit: 7; mask: 0x00000080; 1 = row has explicit format
- $hasExplicitFormat = (0x00000080 & self::getInt4d($recordData, 12)) >> 7;
-
- // bit: 27-16; mask: 0x0FFF0000; only applies when hasExplicitFormat = 1; index to XF record
- $xfIndex = (0x0FFF0000 & self::getInt4d($recordData, 12)) >> 16;
-
- if ($hasExplicitFormat) {
- $this->phpSheet->getRowDimension($r + 1)->setXfIndex($this->mapCellXfIndex[$xfIndex]);
- }
- }
- }
-
-
- /**
- * Read RK record
- * This record represents a cell that contains an RK value
- * (encoded integer or floating-point value). If a
- * floating-point value cannot be encoded to an RK value,
- * a NUMBER record will be written. This record replaces the
- * record INTEGER written in BIFF2.
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- */
- private function readRk()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 0; size: 2; index to row
- $row = self::getInt2d($recordData, 0);
-
- // offset: 2; size: 2; index to column
- $column = self::getInt2d($recordData, 2);
- $columnString = PHPExcel_Cell::stringFromColumnIndex($column);
-
- // Read cell?
- if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) {
- // offset: 4; size: 2; index to XF record
- $xfIndex = self::getInt2d($recordData, 4);
-
- // offset: 6; size: 4; RK value
- $rknum = self::getInt4d($recordData, 6);
- $numValue = self::getIEEE754($rknum);
-
- $cell = $this->phpSheet->getCell($columnString . ($row + 1));
- if (!$this->readDataOnly) {
- // add style information
- $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]);
- }
-
- // add cell
- $cell->setValueExplicit($numValue, PHPExcel_Cell_DataType::TYPE_NUMERIC);
- }
- }
-
-
- /**
- * Read LABELSST record
- * This record represents a cell that contains a string. It
- * replaces the LABEL record and RSTRING record used in
- * BIFF2-BIFF5.
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- */
- private function readLabelSst()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 0; size: 2; index to row
- $row = self::getInt2d($recordData, 0);
-
- // offset: 2; size: 2; index to column
- $column = self::getInt2d($recordData, 2);
- $columnString = PHPExcel_Cell::stringFromColumnIndex($column);
-
- // Read cell?
- if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) {
- // offset: 4; size: 2; index to XF record
- $xfIndex = self::getInt2d($recordData, 4);
-
- // offset: 6; size: 4; index to SST record
- $index = self::getInt4d($recordData, 6);
-
- // add cell
- if (($fmtRuns = $this->sst[$index]['fmtRuns']) && !$this->readDataOnly) {
- // then we should treat as rich text
- $richText = new PHPExcel_RichText();
- $charPos = 0;
- $sstCount = count($this->sst[$index]['fmtRuns']);
- for ($i = 0; $i <= $sstCount; ++$i) {
- if (isset($fmtRuns[$i])) {
- $text = PHPExcel_Shared_String::Substring($this->sst[$index]['value'], $charPos, $fmtRuns[$i]['charPos'] - $charPos);
- $charPos = $fmtRuns[$i]['charPos'];
- } else {
- $text = PHPExcel_Shared_String::Substring($this->sst[$index]['value'], $charPos, PHPExcel_Shared_String::CountCharacters($this->sst[$index]['value']));
- }
-
- if (PHPExcel_Shared_String::CountCharacters($text) > 0) {
- if ($i == 0) { // first text run, no style
- $richText->createText($text);
- } else {
- $textRun = $richText->createTextRun($text);
- if (isset($fmtRuns[$i - 1])) {
- if ($fmtRuns[$i - 1]['fontIndex'] < 4) {
- $fontIndex = $fmtRuns[$i - 1]['fontIndex'];
- } else {
- // this has to do with that index 4 is omitted in all BIFF versions for some strange reason
- // check the OpenOffice documentation of the FONT record
- $fontIndex = $fmtRuns[$i - 1]['fontIndex'] - 1;
- }
- $textRun->setFont(clone $this->objFonts[$fontIndex]);
- }
- }
- }
- }
- $cell = $this->phpSheet->getCell($columnString . ($row + 1));
- $cell->setValueExplicit($richText, PHPExcel_Cell_DataType::TYPE_STRING);
- } else {
- $cell = $this->phpSheet->getCell($columnString . ($row + 1));
- $cell->setValueExplicit($this->sst[$index]['value'], PHPExcel_Cell_DataType::TYPE_STRING);
- }
-
- if (!$this->readDataOnly) {
- // add style information
- $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]);
- }
- }
- }
-
-
- /**
- * Read MULRK record
- * This record represents a cell range containing RK value
- * cells. All cells are located in the same row.
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- */
- private function readMulRk()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 0; size: 2; index to row
- $row = self::getInt2d($recordData, 0);
-
- // offset: 2; size: 2; index to first column
- $colFirst = self::getInt2d($recordData, 2);
-
- // offset: var; size: 2; index to last column
- $colLast = self::getInt2d($recordData, $length - 2);
- $columns = $colLast - $colFirst + 1;
-
- // offset within record data
- $offset = 4;
-
- for ($i = 0; $i < $columns; ++$i) {
- $columnString = PHPExcel_Cell::stringFromColumnIndex($colFirst + $i);
-
- // Read cell?
- if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) {
- // offset: var; size: 2; index to XF record
- $xfIndex = self::getInt2d($recordData, $offset);
-
- // offset: var; size: 4; RK value
- $numValue = self::getIEEE754(self::getInt4d($recordData, $offset + 2));
- $cell = $this->phpSheet->getCell($columnString . ($row + 1));
- if (!$this->readDataOnly) {
- // add style
- $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]);
- }
-
- // add cell value
- $cell->setValueExplicit($numValue, PHPExcel_Cell_DataType::TYPE_NUMERIC);
- }
-
- $offset += 6;
- }
- }
-
-
- /**
- * Read NUMBER record
- * This record represents a cell that contains a
- * floating-point value.
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- */
- private function readNumber()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 0; size: 2; index to row
- $row = self::getInt2d($recordData, 0);
-
- // offset: 2; size 2; index to column
- $column = self::getInt2d($recordData, 2);
- $columnString = PHPExcel_Cell::stringFromColumnIndex($column);
-
- // Read cell?
- if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) {
- // offset 4; size: 2; index to XF record
- $xfIndex = self::getInt2d($recordData, 4);
-
- $numValue = self::extractNumber(substr($recordData, 6, 8));
-
- $cell = $this->phpSheet->getCell($columnString . ($row + 1));
- if (!$this->readDataOnly) {
- // add cell style
- $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]);
- }
-
- // add cell value
- $cell->setValueExplicit($numValue, PHPExcel_Cell_DataType::TYPE_NUMERIC);
- }
- }
-
-
- /**
- * Read FORMULA record + perhaps a following STRING record if formula result is a string
- * This record contains the token array and the result of a
- * formula cell.
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- */
- private function readFormula()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 0; size: 2; row index
- $row = self::getInt2d($recordData, 0);
-
- // offset: 2; size: 2; col index
- $column = self::getInt2d($recordData, 2);
- $columnString = PHPExcel_Cell::stringFromColumnIndex($column);
-
- // offset: 20: size: variable; formula structure
- $formulaStructure = substr($recordData, 20);
-
- // offset: 14: size: 2; option flags, recalculate always, recalculate on open etc.
- $options = self::getInt2d($recordData, 14);
-
- // bit: 0; mask: 0x0001; 1 = recalculate always
- // bit: 1; mask: 0x0002; 1 = calculate on open
- // bit: 2; mask: 0x0008; 1 = part of a shared formula
- $isPartOfSharedFormula = (bool) (0x0008 & $options);
-
- // WARNING:
- // We can apparently not rely on $isPartOfSharedFormula. Even when $isPartOfSharedFormula = true
- // the formula data may be ordinary formula data, therefore we need to check
- // explicitly for the tExp token (0x01)
- $isPartOfSharedFormula = $isPartOfSharedFormula && ord($formulaStructure{2}) == 0x01;
-
- if ($isPartOfSharedFormula) {
- // part of shared formula which means there will be a formula with a tExp token and nothing else
- // get the base cell, grab tExp token
- $baseRow = self::getInt2d($formulaStructure, 3);
- $baseCol = self::getInt2d($formulaStructure, 5);
- $this->_baseCell = PHPExcel_Cell::stringFromColumnIndex($baseCol). ($baseRow + 1);
- }
-
- // Read cell?
- if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) {
- if ($isPartOfSharedFormula) {
- // formula is added to this cell after the sheet has been read
- $this->sharedFormulaParts[$columnString . ($row + 1)] = $this->_baseCell;
- }
-
- // offset: 16: size: 4; not used
-
- // offset: 4; size: 2; XF index
- $xfIndex = self::getInt2d($recordData, 4);
-
- // offset: 6; size: 8; result of the formula
- if ((ord($recordData{6}) == 0) && (ord($recordData{12}) == 255) && (ord($recordData{13}) == 255)) {
- // String formula. Result follows in appended STRING record
- $dataType = PHPExcel_Cell_DataType::TYPE_STRING;
-
- // read possible SHAREDFMLA record
- $code = self::getInt2d($this->data, $this->pos);
- if ($code == self::XLS_TYPE_SHAREDFMLA) {
- $this->readSharedFmla();
- }
-
- // read STRING record
- $value = $this->readString();
- } elseif ((ord($recordData{6}) == 1)
- && (ord($recordData{12}) == 255)
- && (ord($recordData{13}) == 255)) {
- // Boolean formula. Result is in +2; 0=false, 1=true
- $dataType = PHPExcel_Cell_DataType::TYPE_BOOL;
- $value = (bool) ord($recordData{8});
- } elseif ((ord($recordData{6}) == 2)
- && (ord($recordData{12}) == 255)
- && (ord($recordData{13}) == 255)) {
- // Error formula. Error code is in +2
- $dataType = PHPExcel_Cell_DataType::TYPE_ERROR;
- $value = self::mapErrorCode(ord($recordData{8}));
- } elseif ((ord($recordData{6}) == 3)
- && (ord($recordData{12}) == 255)
- && (ord($recordData{13}) == 255)) {
- // Formula result is a null string
- $dataType = PHPExcel_Cell_DataType::TYPE_NULL;
- $value = '';
- } else {
- // forumla result is a number, first 14 bytes like _NUMBER record
- $dataType = PHPExcel_Cell_DataType::TYPE_NUMERIC;
- $value = self::extractNumber(substr($recordData, 6, 8));
- }
-
- $cell = $this->phpSheet->getCell($columnString . ($row + 1));
- if (!$this->readDataOnly) {
- // add cell style
- $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]);
- }
-
- // store the formula
- if (!$isPartOfSharedFormula) {
- // not part of shared formula
- // add cell value. If we can read formula, populate with formula, otherwise just used cached value
- try {
- if ($this->version != self::XLS_BIFF8) {
- throw new PHPExcel_Reader_Exception('Not BIFF8. Can only read BIFF8 formulas');
- }
- $formula = $this->getFormulaFromStructure($formulaStructure); // get formula in human language
- $cell->setValueExplicit('=' . $formula, PHPExcel_Cell_DataType::TYPE_FORMULA);
-
- } catch (PHPExcel_Exception $e) {
- $cell->setValueExplicit($value, $dataType);
- }
- } else {
- if ($this->version == self::XLS_BIFF8) {
- // do nothing at this point, formula id added later in the code
- } else {
- $cell->setValueExplicit($value, $dataType);
- }
- }
-
- // store the cached calculated value
- $cell->setCalculatedValue($value);
- }
- }
-
-
- /**
- * Read a SHAREDFMLA record. This function just stores the binary shared formula in the reader,
- * which usually contains relative references.
- * These will be used to construct the formula in each shared formula part after the sheet is read.
- */
- private function readSharedFmla()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 0, size: 6; cell range address of the area used by the shared formula, not used for anything
- $cellRange = substr($recordData, 0, 6);
- $cellRange = $this->readBIFF5CellRangeAddressFixed($cellRange); // note: even BIFF8 uses BIFF5 syntax
-
- // offset: 6, size: 1; not used
-
- // offset: 7, size: 1; number of existing FORMULA records for this shared formula
- $no = ord($recordData{7});
-
- // offset: 8, size: var; Binary token array of the shared formula
- $formula = substr($recordData, 8);
-
- // at this point we only store the shared formula for later use
- $this->sharedFormulas[$this->_baseCell] = $formula;
- }
-
-
- /**
- * Read a STRING record from current stream position and advance the stream pointer to next record
- * This record is used for storing result from FORMULA record when it is a string, and
- * it occurs directly after the FORMULA record
- *
- * @return string The string contents as UTF-8
- */
- private function readString()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if ($this->version == self::XLS_BIFF8) {
- $string = self::readUnicodeStringLong($recordData);
- $value = $string['value'];
- } else {
- $string = $this->readByteStringLong($recordData);
- $value = $string['value'];
- }
-
- return $value;
- }
-
-
- /**
- * Read BOOLERR record
- * This record represents a Boolean value or error value
- * cell.
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- */
- private function readBoolErr()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 0; size: 2; row index
- $row = self::getInt2d($recordData, 0);
-
- // offset: 2; size: 2; column index
- $column = self::getInt2d($recordData, 2);
- $columnString = PHPExcel_Cell::stringFromColumnIndex($column);
-
- // Read cell?
- if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) {
- // offset: 4; size: 2; index to XF record
- $xfIndex = self::getInt2d($recordData, 4);
-
- // offset: 6; size: 1; the boolean value or error value
- $boolErr = ord($recordData{6});
-
- // offset: 7; size: 1; 0=boolean; 1=error
- $isError = ord($recordData{7});
-
- $cell = $this->phpSheet->getCell($columnString . ($row + 1));
- switch ($isError) {
- case 0: // boolean
- $value = (bool) $boolErr;
-
- // add cell value
- $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_BOOL);
- break;
- case 1: // error type
- $value = self::mapErrorCode($boolErr);
-
- // add cell value
- $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_ERROR);
- break;
- }
-
- if (!$this->readDataOnly) {
- // add cell style
- $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]);
- }
- }
- }
-
-
- /**
- * Read MULBLANK record
- * This record represents a cell range of empty cells. All
- * cells are located in the same row
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- */
- private function readMulBlank()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 0; size: 2; index to row
- $row = self::getInt2d($recordData, 0);
-
- // offset: 2; size: 2; index to first column
- $fc = self::getInt2d($recordData, 2);
-
- // offset: 4; size: 2 x nc; list of indexes to XF records
- // add style information
- if (!$this->readDataOnly) {
- for ($i = 0; $i < $length / 2 - 3; ++$i) {
- $columnString = PHPExcel_Cell::stringFromColumnIndex($fc + $i);
-
- // Read cell?
- if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) {
- $xfIndex = self::getInt2d($recordData, 4 + 2 * $i);
- $this->phpSheet->getCell($columnString . ($row + 1))->setXfIndex($this->mapCellXfIndex[$xfIndex]);
- }
- }
- }
-
- // offset: 6; size 2; index to last column (not needed)
- }
-
-
- /**
- * Read LABEL record
- * This record represents a cell that contains a string. In
- * BIFF8 it is usually replaced by the LABELSST record.
- * Excel still uses this record, if it copies unformatted
- * text cells to the clipboard.
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- */
- private function readLabel()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 0; size: 2; index to row
- $row = self::getInt2d($recordData, 0);
-
- // offset: 2; size: 2; index to column
- $column = self::getInt2d($recordData, 2);
- $columnString = PHPExcel_Cell::stringFromColumnIndex($column);
-
- // Read cell?
- if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) {
- // offset: 4; size: 2; XF index
- $xfIndex = self::getInt2d($recordData, 4);
-
- // add cell value
- // todo: what if string is very long? continue record
- if ($this->version == self::XLS_BIFF8) {
- $string = self::readUnicodeStringLong(substr($recordData, 6));
- $value = $string['value'];
- } else {
- $string = $this->readByteStringLong(substr($recordData, 6));
- $value = $string['value'];
- }
- $cell = $this->phpSheet->getCell($columnString . ($row + 1));
- $cell->setValueExplicit($value, PHPExcel_Cell_DataType::TYPE_STRING);
-
- if (!$this->readDataOnly) {
- // add cell style
- $cell->setXfIndex($this->mapCellXfIndex[$xfIndex]);
- }
- }
- }
-
-
- /**
- * Read BLANK record
- */
- private function readBlank()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 0; size: 2; row index
- $row = self::getInt2d($recordData, 0);
-
- // offset: 2; size: 2; col index
- $col = self::getInt2d($recordData, 2);
- $columnString = PHPExcel_Cell::stringFromColumnIndex($col);
-
- // Read cell?
- if (($this->getReadFilter() !== null) && $this->getReadFilter()->readCell($columnString, $row + 1, $this->phpSheet->getTitle())) {
- // offset: 4; size: 2; XF index
- $xfIndex = self::getInt2d($recordData, 4);
-
- // add style information
- if (!$this->readDataOnly) {
- $this->phpSheet->getCell($columnString . ($row + 1))->setXfIndex($this->mapCellXfIndex[$xfIndex]);
- }
- }
-
- }
-
-
- /**
- * Read MSODRAWING record
- */
- private function readMsoDrawing()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
-
- // get spliced record data
- $splicedRecordData = $this->getSplicedRecordData();
- $recordData = $splicedRecordData['recordData'];
-
- $this->drawingData .= $recordData;
- }
-
-
- /**
- * Read OBJ record
- */
- private function readObj()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if ($this->readDataOnly || $this->version != self::XLS_BIFF8) {
- return;
- }
-
- // recordData consists of an array of subrecords looking like this:
- // ft: 2 bytes; ftCmo type (0x15)
- // cb: 2 bytes; size in bytes of ftCmo data
- // ot: 2 bytes; Object Type
- // id: 2 bytes; Object id number
- // grbit: 2 bytes; Option Flags
- // data: var; subrecord data
-
- // for now, we are just interested in the second subrecord containing the object type
- $ftCmoType = self::getInt2d($recordData, 0);
- $cbCmoSize = self::getInt2d($recordData, 2);
- $otObjType = self::getInt2d($recordData, 4);
- $idObjID = self::getInt2d($recordData, 6);
- $grbitOpts = self::getInt2d($recordData, 6);
-
- $this->objs[] = array(
- 'ftCmoType' => $ftCmoType,
- 'cbCmoSize' => $cbCmoSize,
- 'otObjType' => $otObjType,
- 'idObjID' => $idObjID,
- 'grbitOpts' => $grbitOpts
- );
- $this->textObjRef = $idObjID;
-
-// echo '_readObj()
';
-// var_dump(end($this->objs));
-// echo '
';
- }
-
-
- /**
- * Read WINDOW2 record
- */
- private function readWindow2()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 0; size: 2; option flags
- $options = self::getInt2d($recordData, 0);
-
- // offset: 2; size: 2; index to first visible row
- $firstVisibleRow = self::getInt2d($recordData, 2);
-
- // offset: 4; size: 2; index to first visible colum
- $firstVisibleColumn = self::getInt2d($recordData, 4);
- if ($this->version === self::XLS_BIFF8) {
- // offset: 8; size: 2; not used
- // offset: 10; size: 2; cached magnification factor in page break preview (in percent); 0 = Default (60%)
- // offset: 12; size: 2; cached magnification factor in normal view (in percent); 0 = Default (100%)
- // offset: 14; size: 4; not used
- $zoomscaleInPageBreakPreview = self::getInt2d($recordData, 10);
- if ($zoomscaleInPageBreakPreview === 0) {
- $zoomscaleInPageBreakPreview = 60;
- }
- $zoomscaleInNormalView = self::getInt2d($recordData, 12);
- if ($zoomscaleInNormalView === 0) {
- $zoomscaleInNormalView = 100;
- }
- }
-
- // bit: 1; mask: 0x0002; 0 = do not show gridlines, 1 = show gridlines
- $showGridlines = (bool) ((0x0002 & $options) >> 1);
- $this->phpSheet->setShowGridlines($showGridlines);
-
- // bit: 2; mask: 0x0004; 0 = do not show headers, 1 = show headers
- $showRowColHeaders = (bool) ((0x0004 & $options) >> 2);
- $this->phpSheet->setShowRowColHeaders($showRowColHeaders);
-
- // bit: 3; mask: 0x0008; 0 = panes are not frozen, 1 = panes are frozen
- $this->frozen = (bool) ((0x0008 & $options) >> 3);
-
- // bit: 6; mask: 0x0040; 0 = columns from left to right, 1 = columns from right to left
- $this->phpSheet->setRightToLeft((bool)((0x0040 & $options) >> 6));
-
- // bit: 10; mask: 0x0400; 0 = sheet not active, 1 = sheet active
- $isActive = (bool) ((0x0400 & $options) >> 10);
- if ($isActive) {
- $this->phpExcel->setActiveSheetIndex($this->phpExcel->getIndex($this->phpSheet));
- }
-
- // bit: 11; mask: 0x0800; 0 = normal view, 1 = page break view
- $isPageBreakPreview = (bool) ((0x0800 & $options) >> 11);
-
- //FIXME: set $firstVisibleRow and $firstVisibleColumn
-
- if ($this->phpSheet->getSheetView()->getView() !== PHPExcel_Worksheet_SheetView::SHEETVIEW_PAGE_LAYOUT) {
- //NOTE: this setting is inferior to page layout view(Excel2007-)
- $view = $isPageBreakPreview ? PHPExcel_Worksheet_SheetView::SHEETVIEW_PAGE_BREAK_PREVIEW : PHPExcel_Worksheet_SheetView::SHEETVIEW_NORMAL;
- $this->phpSheet->getSheetView()->setView($view);
- if ($this->version === self::XLS_BIFF8) {
- $zoomScale = $isPageBreakPreview ? $zoomscaleInPageBreakPreview : $zoomscaleInNormalView;
- $this->phpSheet->getSheetView()->setZoomScale($zoomScale);
- $this->phpSheet->getSheetView()->setZoomScaleNormal($zoomscaleInNormalView);
- }
- }
- }
-
- /**
- * Read PLV Record(Created by Excel2007 or upper)
- */
- private function readPageLayoutView()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- //var_dump(unpack("vrt/vgrbitFrt/V2reserved/vwScalePLV/vgrbit", $recordData));
-
- // offset: 0; size: 2; rt
- //->ignore
- $rt = self::getInt2d($recordData, 0);
- // offset: 2; size: 2; grbitfr
- //->ignore
- $grbitFrt = self::getInt2d($recordData, 2);
- // offset: 4; size: 8; reserved
- //->ignore
-
- // offset: 12; size 2; zoom scale
- $wScalePLV = self::getInt2d($recordData, 12);
- // offset: 14; size 2; grbit
- $grbit = self::getInt2d($recordData, 14);
-
- // decomprise grbit
- $fPageLayoutView = $grbit & 0x01;
- $fRulerVisible = ($grbit >> 1) & 0x01; //no support
- $fWhitespaceHidden = ($grbit >> 3) & 0x01; //no support
-
- if ($fPageLayoutView === 1) {
- $this->phpSheet->getSheetView()->setView(PHPExcel_Worksheet_SheetView::SHEETVIEW_PAGE_LAYOUT);
- $this->phpSheet->getSheetView()->setZoomScale($wScalePLV); //set by Excel2007 only if SHEETVIEW_PAGE_LAYOUT
- }
- //otherwise, we cannot know whether SHEETVIEW_PAGE_LAYOUT or SHEETVIEW_PAGE_BREAK_PREVIEW.
- }
-
- /**
- * Read SCL record
- */
- private function readScl()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // offset: 0; size: 2; numerator of the view magnification
- $numerator = self::getInt2d($recordData, 0);
-
- // offset: 2; size: 2; numerator of the view magnification
- $denumerator = self::getInt2d($recordData, 2);
-
- // set the zoom scale (in percent)
- $this->phpSheet->getSheetView()->setZoomScale($numerator * 100 / $denumerator);
- }
-
-
- /**
- * Read PANE record
- */
- private function readPane()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 2; position of vertical split
- $px = self::getInt2d($recordData, 0);
-
- // offset: 2; size: 2; position of horizontal split
- $py = self::getInt2d($recordData, 2);
-
- if ($this->frozen) {
- // frozen panes
- $this->phpSheet->freezePane(PHPExcel_Cell::stringFromColumnIndex($px) . ($py + 1));
- } else {
- // unfrozen panes; split windows; not supported by PHPExcel core
- }
- }
- }
-
-
- /**
- * Read SELECTION record. There is one such record for each pane in the sheet.
- */
- private function readSelection()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 1; pane identifier
- $paneId = ord($recordData{0});
-
- // offset: 1; size: 2; index to row of the active cell
- $r = self::getInt2d($recordData, 1);
-
- // offset: 3; size: 2; index to column of the active cell
- $c = self::getInt2d($recordData, 3);
-
- // offset: 5; size: 2; index into the following cell range list to the
- // entry that contains the active cell
- $index = self::getInt2d($recordData, 5);
-
- // offset: 7; size: var; cell range address list containing all selected cell ranges
- $data = substr($recordData, 7);
- $cellRangeAddressList = $this->readBIFF5CellRangeAddressList($data); // note: also BIFF8 uses BIFF5 syntax
-
- $selectedCells = $cellRangeAddressList['cellRangeAddresses'][0];
-
- // first row '1' + last row '16384' indicates that full column is selected (apparently also in BIFF8!)
- if (preg_match('/^([A-Z]+1\:[A-Z]+)16384$/', $selectedCells)) {
- $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)16384$/', '${1}1048576', $selectedCells);
- }
-
- // first row '1' + last row '65536' indicates that full column is selected
- if (preg_match('/^([A-Z]+1\:[A-Z]+)65536$/', $selectedCells)) {
- $selectedCells = preg_replace('/^([A-Z]+1\:[A-Z]+)65536$/', '${1}1048576', $selectedCells);
- }
-
- // first column 'A' + last column 'IV' indicates that full row is selected
- if (preg_match('/^(A[0-9]+\:)IV([0-9]+)$/', $selectedCells)) {
- $selectedCells = preg_replace('/^(A[0-9]+\:)IV([0-9]+)$/', '${1}XFD${2}', $selectedCells);
- }
-
- $this->phpSheet->setSelectedCells($selectedCells);
- }
- }
-
-
- private function includeCellRangeFiltered($cellRangeAddress)
- {
- $includeCellRange = true;
- if ($this->getReadFilter() !== null) {
- $includeCellRange = false;
- $rangeBoundaries = PHPExcel_Cell::getRangeBoundaries($cellRangeAddress);
- $rangeBoundaries[1][0]++;
- for ($row = $rangeBoundaries[0][1]; $row <= $rangeBoundaries[1][1]; $row++) {
- for ($column = $rangeBoundaries[0][0]; $column != $rangeBoundaries[1][0]; $column++) {
- if ($this->getReadFilter()->readCell($column, $row, $this->phpSheet->getTitle())) {
- $includeCellRange = true;
- break 2;
- }
- }
- }
- }
- return $includeCellRange;
- }
-
-
- /**
- * MERGEDCELLS
- *
- * This record contains the addresses of merged cell ranges
- * in the current sheet.
- *
- * -- "OpenOffice.org's Documentation of the Microsoft
- * Excel File Format"
- */
- private function readMergedCells()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if ($this->version == self::XLS_BIFF8 && !$this->readDataOnly) {
- $cellRangeAddressList = $this->readBIFF8CellRangeAddressList($recordData);
- foreach ($cellRangeAddressList['cellRangeAddresses'] as $cellRangeAddress) {
- if ((strpos($cellRangeAddress, ':') !== false) &&
- ($this->includeCellRangeFiltered($cellRangeAddress))) {
- $this->phpSheet->mergeCells($cellRangeAddress);
- }
- }
- }
- }
-
-
- /**
- * Read HYPERLINK record
- */
- private function readHyperLink()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer forward to next record
- $this->pos += 4 + $length;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 8; cell range address of all cells containing this hyperlink
- try {
- $cellRange = $this->readBIFF8CellRangeAddressFixed($recordData, 0, 8);
- } catch (PHPExcel_Exception $e) {
- return;
- }
-
- // offset: 8, size: 16; GUID of StdLink
-
- // offset: 24, size: 4; unknown value
-
- // offset: 28, size: 4; option flags
- // bit: 0; mask: 0x00000001; 0 = no link or extant, 1 = file link or URL
- $isFileLinkOrUrl = (0x00000001 & self::getInt2d($recordData, 28)) >> 0;
-
- // bit: 1; mask: 0x00000002; 0 = relative path, 1 = absolute path or URL
- $isAbsPathOrUrl = (0x00000001 & self::getInt2d($recordData, 28)) >> 1;
-
- // bit: 2 (and 4); mask: 0x00000014; 0 = no description
- $hasDesc = (0x00000014 & self::getInt2d($recordData, 28)) >> 2;
-
- // bit: 3; mask: 0x00000008; 0 = no text, 1 = has text
- $hasText = (0x00000008 & self::getInt2d($recordData, 28)) >> 3;
-
- // bit: 7; mask: 0x00000080; 0 = no target frame, 1 = has target frame
- $hasFrame = (0x00000080 & self::getInt2d($recordData, 28)) >> 7;
-
- // bit: 8; mask: 0x00000100; 0 = file link or URL, 1 = UNC path (inc. server name)
- $isUNC = (0x00000100 & self::getInt2d($recordData, 28)) >> 8;
-
- // offset within record data
- $offset = 32;
-
- if ($hasDesc) {
- // offset: 32; size: var; character count of description text
- $dl = self::getInt4d($recordData, 32);
- // offset: 36; size: var; character array of description text, no Unicode string header, always 16-bit characters, zero terminated
- $desc = self::encodeUTF16(substr($recordData, 36, 2 * ($dl - 1)), false);
- $offset += 4 + 2 * $dl;
- }
- if ($hasFrame) {
- $fl = self::getInt4d($recordData, $offset);
- $offset += 4 + 2 * $fl;
- }
-
- // detect type of hyperlink (there are 4 types)
- $hyperlinkType = null;
-
- if ($isUNC) {
- $hyperlinkType = 'UNC';
- } elseif (!$isFileLinkOrUrl) {
- $hyperlinkType = 'workbook';
- } elseif (ord($recordData{$offset}) == 0x03) {
- $hyperlinkType = 'local';
- } elseif (ord($recordData{$offset}) == 0xE0) {
- $hyperlinkType = 'URL';
- }
-
- switch ($hyperlinkType) {
- case 'URL':
- // section 5.58.2: Hyperlink containing a URL
- // e.g. http://example.org/index.php
-
- // offset: var; size: 16; GUID of URL Moniker
- $offset += 16;
- // offset: var; size: 4; size (in bytes) of character array of the URL including trailing zero word
- $us = self::getInt4d($recordData, $offset);
- $offset += 4;
- // offset: var; size: $us; character array of the URL, no Unicode string header, always 16-bit characters, zero-terminated
- $url = self::encodeUTF16(substr($recordData, $offset, $us - 2), false);
- $nullOffset = strpos($url, 0x00);
- if ($nullOffset) {
- $url = substr($url, 0, $nullOffset);
- }
- $url .= $hasText ? '#' : '';
- $offset += $us;
- break;
- case 'local':
- // section 5.58.3: Hyperlink to local file
- // examples:
- // mydoc.txt
- // ../../somedoc.xls#Sheet!A1
-
- // offset: var; size: 16; GUI of File Moniker
- $offset += 16;
-
- // offset: var; size: 2; directory up-level count.
- $upLevelCount = self::getInt2d($recordData, $offset);
- $offset += 2;
-
- // offset: var; size: 4; character count of the shortened file path and name, including trailing zero word
- $sl = self::getInt4d($recordData, $offset);
- $offset += 4;
-
- // offset: var; size: sl; character array of the shortened file path and name in 8.3-DOS-format (compressed Unicode string)
- $shortenedFilePath = substr($recordData, $offset, $sl);
- $shortenedFilePath = self::encodeUTF16($shortenedFilePath, true);
- $shortenedFilePath = substr($shortenedFilePath, 0, -1); // remove trailing zero
-
- $offset += $sl;
-
- // offset: var; size: 24; unknown sequence
- $offset += 24;
-
- // extended file path
- // offset: var; size: 4; size of the following file link field including string lenth mark
- $sz = self::getInt4d($recordData, $offset);
- $offset += 4;
-
- // only present if $sz > 0
- if ($sz > 0) {
- // offset: var; size: 4; size of the character array of the extended file path and name
- $xl = self::getInt4d($recordData, $offset);
- $offset += 4;
-
- // offset: var; size 2; unknown
- $offset += 2;
-
- // offset: var; size $xl; character array of the extended file path and name.
- $extendedFilePath = substr($recordData, $offset, $xl);
- $extendedFilePath = self::encodeUTF16($extendedFilePath, false);
- $offset += $xl;
- }
-
- // construct the path
- $url = str_repeat('..\\', $upLevelCount);
- $url .= ($sz > 0) ? $extendedFilePath : $shortenedFilePath; // use extended path if available
- $url .= $hasText ? '#' : '';
-
- break;
- case 'UNC':
- // section 5.58.4: Hyperlink to a File with UNC (Universal Naming Convention) Path
- // todo: implement
- return;
- case 'workbook':
- // section 5.58.5: Hyperlink to the Current Workbook
- // e.g. Sheet2!B1:C2, stored in text mark field
- $url = 'sheet://';
- break;
- default:
- return;
- }
-
- if ($hasText) {
- // offset: var; size: 4; character count of text mark including trailing zero word
- $tl = self::getInt4d($recordData, $offset);
- $offset += 4;
- // offset: var; size: var; character array of the text mark without the # sign, no Unicode header, always 16-bit characters, zero-terminated
- $text = self::encodeUTF16(substr($recordData, $offset, 2 * ($tl - 1)), false);
- $url .= $text;
- }
-
- // apply the hyperlink to all the relevant cells
- foreach (PHPExcel_Cell::extractAllCellReferencesInRange($cellRange) as $coordinate) {
- $this->phpSheet->getCell($coordinate)->getHyperLink()->setUrl($url);
- }
- }
- }
-
-
- /**
- * Read DATAVALIDATIONS record
- */
- private function readDataValidations()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer forward to next record
- $this->pos += 4 + $length;
- }
-
-
- /**
- * Read DATAVALIDATION record
- */
- private function readDataValidation()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer forward to next record
- $this->pos += 4 + $length;
-
- if ($this->readDataOnly) {
- return;
- }
-
- // offset: 0; size: 4; Options
- $options = self::getInt4d($recordData, 0);
-
- // bit: 0-3; mask: 0x0000000F; type
- $type = (0x0000000F & $options) >> 0;
- switch ($type) {
- case 0x00:
- $type = PHPExcel_Cell_DataValidation::TYPE_NONE;
- break;
- case 0x01:
- $type = PHPExcel_Cell_DataValidation::TYPE_WHOLE;
- break;
- case 0x02:
- $type = PHPExcel_Cell_DataValidation::TYPE_DECIMAL;
- break;
- case 0x03:
- $type = PHPExcel_Cell_DataValidation::TYPE_LIST;
- break;
- case 0x04:
- $type = PHPExcel_Cell_DataValidation::TYPE_DATE;
- break;
- case 0x05:
- $type = PHPExcel_Cell_DataValidation::TYPE_TIME;
- break;
- case 0x06:
- $type = PHPExcel_Cell_DataValidation::TYPE_TEXTLENGTH;
- break;
- case 0x07:
- $type = PHPExcel_Cell_DataValidation::TYPE_CUSTOM;
- break;
- }
-
- // bit: 4-6; mask: 0x00000070; error type
- $errorStyle = (0x00000070 & $options) >> 4;
- switch ($errorStyle) {
- case 0x00:
- $errorStyle = PHPExcel_Cell_DataValidation::STYLE_STOP;
- break;
- case 0x01:
- $errorStyle = PHPExcel_Cell_DataValidation::STYLE_WARNING;
- break;
- case 0x02:
- $errorStyle = PHPExcel_Cell_DataValidation::STYLE_INFORMATION;
- break;
- }
-
- // bit: 7; mask: 0x00000080; 1= formula is explicit (only applies to list)
- // I have only seen cases where this is 1
- $explicitFormula = (0x00000080 & $options) >> 7;
-
- // bit: 8; mask: 0x00000100; 1= empty cells allowed
- $allowBlank = (0x00000100 & $options) >> 8;
-
- // bit: 9; mask: 0x00000200; 1= suppress drop down arrow in list type validity
- $suppressDropDown = (0x00000200 & $options) >> 9;
-
- // bit: 18; mask: 0x00040000; 1= show prompt box if cell selected
- $showInputMessage = (0x00040000 & $options) >> 18;
-
- // bit: 19; mask: 0x00080000; 1= show error box if invalid values entered
- $showErrorMessage = (0x00080000 & $options) >> 19;
-
- // bit: 20-23; mask: 0x00F00000; condition operator
- $operator = (0x00F00000 & $options) >> 20;
- switch ($operator) {
- case 0x00:
- $operator = PHPExcel_Cell_DataValidation::OPERATOR_BETWEEN;
- break;
- case 0x01:
- $operator = PHPExcel_Cell_DataValidation::OPERATOR_NOTBETWEEN;
- break;
- case 0x02:
- $operator = PHPExcel_Cell_DataValidation::OPERATOR_EQUAL;
- break;
- case 0x03:
- $operator = PHPExcel_Cell_DataValidation::OPERATOR_NOTEQUAL;
- break;
- case 0x04:
- $operator = PHPExcel_Cell_DataValidation::OPERATOR_GREATERTHAN;
- break;
- case 0x05:
- $operator = PHPExcel_Cell_DataValidation::OPERATOR_LESSTHAN;
- break;
- case 0x06:
- $operator = PHPExcel_Cell_DataValidation::OPERATOR_GREATERTHANOREQUAL;
- break;
- case 0x07:
- $operator = PHPExcel_Cell_DataValidation::OPERATOR_LESSTHANOREQUAL;
- break;
- }
-
- // offset: 4; size: var; title of the prompt box
- $offset = 4;
- $string = self::readUnicodeStringLong(substr($recordData, $offset));
- $promptTitle = $string['value'] !== chr(0) ? $string['value'] : '';
- $offset += $string['size'];
-
- // offset: var; size: var; title of the error box
- $string = self::readUnicodeStringLong(substr($recordData, $offset));
- $errorTitle = $string['value'] !== chr(0) ? $string['value'] : '';
- $offset += $string['size'];
-
- // offset: var; size: var; text of the prompt box
- $string = self::readUnicodeStringLong(substr($recordData, $offset));
- $prompt = $string['value'] !== chr(0) ? $string['value'] : '';
- $offset += $string['size'];
-
- // offset: var; size: var; text of the error box
- $string = self::readUnicodeStringLong(substr($recordData, $offset));
- $error = $string['value'] !== chr(0) ? $string['value'] : '';
- $offset += $string['size'];
-
- // offset: var; size: 2; size of the formula data for the first condition
- $sz1 = self::getInt2d($recordData, $offset);
- $offset += 2;
-
- // offset: var; size: 2; not used
- $offset += 2;
-
- // offset: var; size: $sz1; formula data for first condition (without size field)
- $formula1 = substr($recordData, $offset, $sz1);
- $formula1 = pack('v', $sz1) . $formula1; // prepend the length
- try {
- $formula1 = $this->getFormulaFromStructure($formula1);
-
- // in list type validity, null characters are used as item separators
- if ($type == PHPExcel_Cell_DataValidation::TYPE_LIST) {
- $formula1 = str_replace(chr(0), ',', $formula1);
- }
- } catch (PHPExcel_Exception $e) {
- return;
- }
- $offset += $sz1;
-
- // offset: var; size: 2; size of the formula data for the first condition
- $sz2 = self::getInt2d($recordData, $offset);
- $offset += 2;
-
- // offset: var; size: 2; not used
- $offset += 2;
-
- // offset: var; size: $sz2; formula data for second condition (without size field)
- $formula2 = substr($recordData, $offset, $sz2);
- $formula2 = pack('v', $sz2) . $formula2; // prepend the length
- try {
- $formula2 = $this->getFormulaFromStructure($formula2);
- } catch (PHPExcel_Exception $e) {
- return;
- }
- $offset += $sz2;
-
- // offset: var; size: var; cell range address list with
- $cellRangeAddressList = $this->readBIFF8CellRangeAddressList(substr($recordData, $offset));
- $cellRangeAddresses = $cellRangeAddressList['cellRangeAddresses'];
-
- foreach ($cellRangeAddresses as $cellRange) {
- $stRange = $this->phpSheet->shrinkRangeToFit($cellRange);
- foreach (PHPExcel_Cell::extractAllCellReferencesInRange($stRange) as $coordinate) {
- $objValidation = $this->phpSheet->getCell($coordinate)->getDataValidation();
- $objValidation->setType($type);
- $objValidation->setErrorStyle($errorStyle);
- $objValidation->setAllowBlank((bool)$allowBlank);
- $objValidation->setShowInputMessage((bool)$showInputMessage);
- $objValidation->setShowErrorMessage((bool)$showErrorMessage);
- $objValidation->setShowDropDown(!$suppressDropDown);
- $objValidation->setOperator($operator);
- $objValidation->setErrorTitle($errorTitle);
- $objValidation->setError($error);
- $objValidation->setPromptTitle($promptTitle);
- $objValidation->setPrompt($prompt);
- $objValidation->setFormula1($formula1);
- $objValidation->setFormula2($formula2);
- }
- }
- }
-
- /**
- * Read SHEETLAYOUT record. Stores sheet tab color information.
- */
- private function readSheetLayout()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // local pointer in record data
- $offset = 0;
-
- if (!$this->readDataOnly) {
- // offset: 0; size: 2; repeated record identifier 0x0862
-
- // offset: 2; size: 10; not used
-
- // offset: 12; size: 4; size of record data
- // Excel 2003 uses size of 0x14 (documented), Excel 2007 uses size of 0x28 (not documented?)
- $sz = self::getInt4d($recordData, 12);
-
- switch ($sz) {
- case 0x14:
- // offset: 16; size: 2; color index for sheet tab
- $colorIndex = self::getInt2d($recordData, 16);
- $color = self::readColor($colorIndex, $this->palette, $this->version);
- $this->phpSheet->getTabColor()->setRGB($color['rgb']);
- break;
- case 0x28:
- // TODO: Investigate structure for .xls SHEETLAYOUT record as saved by MS Office Excel 2007
- return;
- break;
- }
- }
- }
-
-
- /**
- * Read SHEETPROTECTION record (FEATHEADR)
- */
- private function readSheetProtection()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- if ($this->readDataOnly) {
- return;
- }
-
- // offset: 0; size: 2; repeated record header
-
- // offset: 2; size: 2; FRT cell reference flag (=0 currently)
-
- // offset: 4; size: 8; Currently not used and set to 0
-
- // offset: 12; size: 2; Shared feature type index (2=Enhanced Protetion, 4=SmartTag)
- $isf = self::getInt2d($recordData, 12);
- if ($isf != 2) {
- return;
- }
-
- // offset: 14; size: 1; =1 since this is a feat header
-
- // offset: 15; size: 4; size of rgbHdrSData
-
- // rgbHdrSData, assume "Enhanced Protection"
- // offset: 19; size: 2; option flags
- $options = self::getInt2d($recordData, 19);
-
- // bit: 0; mask 0x0001; 1 = user may edit objects, 0 = users must not edit objects
- $bool = (0x0001 & $options) >> 0;
- $this->phpSheet->getProtection()->setObjects(!$bool);
-
- // bit: 1; mask 0x0002; edit scenarios
- $bool = (0x0002 & $options) >> 1;
- $this->phpSheet->getProtection()->setScenarios(!$bool);
-
- // bit: 2; mask 0x0004; format cells
- $bool = (0x0004 & $options) >> 2;
- $this->phpSheet->getProtection()->setFormatCells(!$bool);
-
- // bit: 3; mask 0x0008; format columns
- $bool = (0x0008 & $options) >> 3;
- $this->phpSheet->getProtection()->setFormatColumns(!$bool);
-
- // bit: 4; mask 0x0010; format rows
- $bool = (0x0010 & $options) >> 4;
- $this->phpSheet->getProtection()->setFormatRows(!$bool);
-
- // bit: 5; mask 0x0020; insert columns
- $bool = (0x0020 & $options) >> 5;
- $this->phpSheet->getProtection()->setInsertColumns(!$bool);
-
- // bit: 6; mask 0x0040; insert rows
- $bool = (0x0040 & $options) >> 6;
- $this->phpSheet->getProtection()->setInsertRows(!$bool);
-
- // bit: 7; mask 0x0080; insert hyperlinks
- $bool = (0x0080 & $options) >> 7;
- $this->phpSheet->getProtection()->setInsertHyperlinks(!$bool);
-
- // bit: 8; mask 0x0100; delete columns
- $bool = (0x0100 & $options) >> 8;
- $this->phpSheet->getProtection()->setDeleteColumns(!$bool);
-
- // bit: 9; mask 0x0200; delete rows
- $bool = (0x0200 & $options) >> 9;
- $this->phpSheet->getProtection()->setDeleteRows(!$bool);
-
- // bit: 10; mask 0x0400; select locked cells
- $bool = (0x0400 & $options) >> 10;
- $this->phpSheet->getProtection()->setSelectLockedCells(!$bool);
-
- // bit: 11; mask 0x0800; sort cell range
- $bool = (0x0800 & $options) >> 11;
- $this->phpSheet->getProtection()->setSort(!$bool);
-
- // bit: 12; mask 0x1000; auto filter
- $bool = (0x1000 & $options) >> 12;
- $this->phpSheet->getProtection()->setAutoFilter(!$bool);
-
- // bit: 13; mask 0x2000; pivot tables
- $bool = (0x2000 & $options) >> 13;
- $this->phpSheet->getProtection()->setPivotTables(!$bool);
-
- // bit: 14; mask 0x4000; select unlocked cells
- $bool = (0x4000 & $options) >> 14;
- $this->phpSheet->getProtection()->setSelectUnlockedCells(!$bool);
-
- // offset: 21; size: 2; not used
- }
-
-
- /**
- * Read RANGEPROTECTION record
- * Reading of this record is based on Microsoft Office Excel 97-2000 Binary File Format Specification,
- * where it is referred to as FEAT record
- */
- private function readRangeProtection()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- // local pointer in record data
- $offset = 0;
-
- if (!$this->readDataOnly) {
- $offset += 12;
-
- // offset: 12; size: 2; shared feature type, 2 = enhanced protection, 4 = smart tag
- $isf = self::getInt2d($recordData, 12);
- if ($isf != 2) {
- // we only read FEAT records of type 2
- return;
- }
- $offset += 2;
-
- $offset += 5;
-
- // offset: 19; size: 2; count of ref ranges this feature is on
- $cref = self::getInt2d($recordData, 19);
- $offset += 2;
-
- $offset += 6;
-
- // offset: 27; size: 8 * $cref; list of cell ranges (like in hyperlink record)
- $cellRanges = array();
- for ($i = 0; $i < $cref; ++$i) {
- try {
- $cellRange = $this->readBIFF8CellRangeAddressFixed(substr($recordData, 27 + 8 * $i, 8));
- } catch (PHPExcel_Exception $e) {
- return;
- }
- $cellRanges[] = $cellRange;
- $offset += 8;
- }
-
- // offset: var; size: var; variable length of feature specific data
- $rgbFeat = substr($recordData, $offset);
- $offset += 4;
-
- // offset: var; size: 4; the encrypted password (only 16-bit although field is 32-bit)
- $wPassword = self::getInt4d($recordData, $offset);
- $offset += 4;
-
- // Apply range protection to sheet
- if ($cellRanges) {
- $this->phpSheet->protectCells(implode(' ', $cellRanges), strtoupper(dechex($wPassword)), true);
- }
- }
- }
-
-
- /**
- * Read IMDATA record
- */
- private function readImData()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
-
- // get spliced record data
- $splicedRecordData = $this->getSplicedRecordData();
- $recordData = $splicedRecordData['recordData'];
-
- // UNDER CONSTRUCTION
-
- // offset: 0; size: 2; image format
- $cf = self::getInt2d($recordData, 0);
-
- // offset: 2; size: 2; environment from which the file was written
- $env = self::getInt2d($recordData, 2);
-
- // offset: 4; size: 4; length of the image data
- $lcb = self::getInt4d($recordData, 4);
-
- // offset: 8; size: var; image data
- $iData = substr($recordData, 8);
-
- switch ($cf) {
- case 0x09: // Windows bitmap format
- // BITMAPCOREINFO
- // 1. BITMAPCOREHEADER
- // offset: 0; size: 4; bcSize, Specifies the number of bytes required by the structure
- $bcSize = self::getInt4d($iData, 0);
- // var_dump($bcSize);
-
- // offset: 4; size: 2; bcWidth, specifies the width of the bitmap, in pixels
- $bcWidth = self::getInt2d($iData, 4);
- // var_dump($bcWidth);
-
- // offset: 6; size: 2; bcHeight, specifies the height of the bitmap, in pixels.
- $bcHeight = self::getInt2d($iData, 6);
- // var_dump($bcHeight);
- $ih = imagecreatetruecolor($bcWidth, $bcHeight);
-
- // offset: 8; size: 2; bcPlanes, specifies the number of planes for the target device. This value must be 1
-
- // offset: 10; size: 2; bcBitCount specifies the number of bits-per-pixel. This value must be 1, 4, 8, or 24
- $bcBitCount = self::getInt2d($iData, 10);
- // var_dump($bcBitCount);
-
- $rgbString = substr($iData, 12);
- $rgbTriples = array();
- while (strlen($rgbString) > 0) {
- $rgbTriples[] = unpack('Cb/Cg/Cr', $rgbString);
- $rgbString = substr($rgbString, 3);
- }
- $x = 0;
- $y = 0;
- foreach ($rgbTriples as $i => $rgbTriple) {
- $color = imagecolorallocate($ih, $rgbTriple['r'], $rgbTriple['g'], $rgbTriple['b']);
- imagesetpixel($ih, $x, $bcHeight - 1 - $y, $color);
- $x = ($x + 1) % $bcWidth;
- $y = $y + floor(($x + 1) / $bcWidth);
- }
- //imagepng($ih, 'image.png');
-
- $drawing = new PHPExcel_Worksheet_Drawing();
- $drawing->setPath($filename);
- $drawing->setWorksheet($this->phpSheet);
- break;
- case 0x02: // Windows metafile or Macintosh PICT format
- case 0x0e: // native format
- default:
- break;
- }
-
- // getSplicedRecordData() takes care of moving current position in data stream
- }
-
-
- /**
- * Read a free CONTINUE record. Free CONTINUE record may be a camouflaged MSODRAWING record
- * When MSODRAWING data on a sheet exceeds 8224 bytes, CONTINUE records are used instead. Undocumented.
- * In this case, we must treat the CONTINUE record as a MSODRAWING record
- */
- private function readContinue()
- {
- $length = self::getInt2d($this->data, $this->pos + 2);
- $recordData = $this->readRecordData($this->data, $this->pos + 4, $length);
-
- // check if we are reading drawing data
- // this is in case a free CONTINUE record occurs in other circumstances we are unaware of
- if ($this->drawingData == '') {
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- return;
- }
-
- // check if record data is at least 4 bytes long, otherwise there is no chance this is MSODRAWING data
- if ($length < 4) {
- // move stream pointer to next record
- $this->pos += 4 + $length;
-
- return;
- }
-
- // dirty check to see if CONTINUE record could be a camouflaged MSODRAWING record
- // look inside CONTINUE record to see if it looks like a part of an Escher stream
- // we know that Escher stream may be split at least at
- // 0xF003 MsofbtSpgrContainer
- // 0xF004 MsofbtSpContainer
- // 0xF00D MsofbtClientTextbox
- $validSplitPoints = array(0xF003, 0xF004, 0xF00D); // add identifiers if we find more
-
- $splitPoint = self::getInt2d($recordData, 2);
- if (in_array($splitPoint, $validSplitPoints)) {
- // get spliced record data (and move pointer to next record)
- $splicedRecordData = $this->getSplicedRecordData();
- $this->drawingData .= $splicedRecordData['recordData'];
-
- return;
- }
-
- // move stream pointer to next record
- $this->pos += 4 + $length;
- }
-
-
- /**
- * Reads a record from current position in data stream and continues reading data as long as CONTINUE
- * records are found. Splices the record data pieces and returns the combined string as if record data
- * is in one piece.
- * Moves to next current position in data stream to start of next record different from a CONtINUE record
- *
- * @return array
- */
- private function getSplicedRecordData()
- {
- $data = '';
- $spliceOffsets = array();
-
- $i = 0;
- $spliceOffsets[0] = 0;
-
- do {
- ++$i;
-
- // offset: 0; size: 2; identifier
- $identifier = self::getInt2d($this->data, $this->pos);
- // offset: 2; size: 2; length
- $length = self::getInt2d($this->data, $this->pos + 2);
- $data .= $this->readRecordData($this->data, $this->pos + 4, $length);
-
- $spliceOffsets[$i] = $spliceOffsets[$i - 1] + $length;
-
- $this->pos += 4 + $length;
- $nextIdentifier = self::getInt2d($this->data, $this->pos);
- } while ($nextIdentifier == self::XLS_TYPE_CONTINUE);
-
- $splicedData = array(
- 'recordData' => $data,
- 'spliceOffsets' => $spliceOffsets,
- );
-
- return $splicedData;
-
- }
-
-
- /**
- * Convert formula structure into human readable Excel formula like 'A3+A5*5'
- *
- * @param string $formulaStructure The complete binary data for the formula
- * @param string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas
- * @return string Human readable formula
- */
- private function getFormulaFromStructure($formulaStructure, $baseCell = 'A1')
- {
- // offset: 0; size: 2; size of the following formula data
- $sz = self::getInt2d($formulaStructure, 0);
-
- // offset: 2; size: sz
- $formulaData = substr($formulaStructure, 2, $sz);
-
- // for debug: dump the formula data
- //echo '';
- //echo 'size: ' . $sz . "\n";
- //echo 'the entire formula data: ';
- //Debug::dump($formulaData);
- //echo "\n----\n";
-
- // offset: 2 + sz; size: variable (optional)
- if (strlen($formulaStructure) > 2 + $sz) {
- $additionalData = substr($formulaStructure, 2 + $sz);
-
- // for debug: dump the additional data
- //echo 'the entire additional data: ';
- //Debug::dump($additionalData);
- //echo "\n----\n";
- } else {
- $additionalData = '';
- }
-
- return $this->getFormulaFromData($formulaData, $additionalData, $baseCell);
- }
-
-
- /**
- * Take formula data and additional data for formula and return human readable formula
- *
- * @param string $formulaData The binary data for the formula itself
- * @param string $additionalData Additional binary data going with the formula
- * @param string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas
- * @return string Human readable formula
- */
- private function getFormulaFromData($formulaData, $additionalData = '', $baseCell = 'A1')
- {
- // start parsing the formula data
- $tokens = array();
-
- while (strlen($formulaData) > 0 and $token = $this->getNextToken($formulaData, $baseCell)) {
- $tokens[] = $token;
- $formulaData = substr($formulaData, $token['size']);
-
- // for debug: dump the token
- //var_dump($token);
- }
-
- $formulaString = $this->createFormulaFromTokens($tokens, $additionalData);
-
- return $formulaString;
- }
-
-
- /**
- * Take array of tokens together with additional data for formula and return human readable formula
- *
- * @param array $tokens
- * @param array $additionalData Additional binary data going with the formula
- * @param string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas
- * @return string Human readable formula
- */
- private function createFormulaFromTokens($tokens, $additionalData)
- {
- // empty formula?
- if (empty($tokens)) {
- return '';
- }
-
- $formulaStrings = array();
- foreach ($tokens as $token) {
- // initialize spaces
- $space0 = isset($space0) ? $space0 : ''; // spaces before next token, not tParen
- $space1 = isset($space1) ? $space1 : ''; // carriage returns before next token, not tParen
- $space2 = isset($space2) ? $space2 : ''; // spaces before opening parenthesis
- $space3 = isset($space3) ? $space3 : ''; // carriage returns before opening parenthesis
- $space4 = isset($space4) ? $space4 : ''; // spaces before closing parenthesis
- $space5 = isset($space5) ? $space5 : ''; // carriage returns before closing parenthesis
-
- switch ($token['name']) {
- case 'tAdd': // addition
- case 'tConcat': // addition
- case 'tDiv': // division
- case 'tEQ': // equality
- case 'tGE': // greater than or equal
- case 'tGT': // greater than
- case 'tIsect': // intersection
- case 'tLE': // less than or equal
- case 'tList': // less than or equal
- case 'tLT': // less than
- case 'tMul': // multiplication
- case 'tNE': // multiplication
- case 'tPower': // power
- case 'tRange': // range
- case 'tSub': // subtraction
- $op2 = array_pop($formulaStrings);
- $op1 = array_pop($formulaStrings);
- $formulaStrings[] = "$op1$space1$space0{$token['data']}$op2";
- unset($space0, $space1);
- break;
- case 'tUplus': // unary plus
- case 'tUminus': // unary minus
- $op = array_pop($formulaStrings);
- $formulaStrings[] = "$space1$space0{$token['data']}$op";
- unset($space0, $space1);
- break;
- case 'tPercent': // percent sign
- $op = array_pop($formulaStrings);
- $formulaStrings[] = "$op$space1$space0{$token['data']}";
- unset($space0, $space1);
- break;
- case 'tAttrVolatile': // indicates volatile function
- case 'tAttrIf':
- case 'tAttrSkip':
- case 'tAttrChoose':
- // token is only important for Excel formula evaluator
- // do nothing
- break;
- case 'tAttrSpace': // space / carriage return
- // space will be used when next token arrives, do not alter formulaString stack
- switch ($token['data']['spacetype']) {
- case 'type0':
- $space0 = str_repeat(' ', $token['data']['spacecount']);
- break;
- case 'type1':
- $space1 = str_repeat("\n", $token['data']['spacecount']);
- break;
- case 'type2':
- $space2 = str_repeat(' ', $token['data']['spacecount']);
- break;
- case 'type3':
- $space3 = str_repeat("\n", $token['data']['spacecount']);
- break;
- case 'type4':
- $space4 = str_repeat(' ', $token['data']['spacecount']);
- break;
- case 'type5':
- $space5 = str_repeat("\n", $token['data']['spacecount']);
- break;
- }
- break;
- case 'tAttrSum': // SUM function with one parameter
- $op = array_pop($formulaStrings);
- $formulaStrings[] = "{$space1}{$space0}SUM($op)";
- unset($space0, $space1);
- break;
- case 'tFunc': // function with fixed number of arguments
- case 'tFuncV': // function with variable number of arguments
- if ($token['data']['function'] != '') {
- // normal function
- $ops = array(); // array of operators
- for ($i = 0; $i < $token['data']['args']; ++$i) {
- $ops[] = array_pop($formulaStrings);
- }
- $ops = array_reverse($ops);
- $formulaStrings[] = "$space1$space0{$token['data']['function']}(" . implode(',', $ops) . ")";
- unset($space0, $space1);
- } else {
- // add-in function
- $ops = array(); // array of operators
- for ($i = 0; $i < $token['data']['args'] - 1; ++$i) {
- $ops[] = array_pop($formulaStrings);
- }
- $ops = array_reverse($ops);
- $function = array_pop($formulaStrings);
- $formulaStrings[] = "$space1$space0$function(" . implode(',', $ops) . ")";
- unset($space0, $space1);
- }
- break;
- case 'tParen': // parenthesis
- $expression = array_pop($formulaStrings);
- $formulaStrings[] = "$space3$space2($expression$space5$space4)";
- unset($space2, $space3, $space4, $space5);
- break;
- case 'tArray': // array constant
- $constantArray = self::_readBIFF8ConstantArray($additionalData);
- $formulaStrings[] = $space1 . $space0 . $constantArray['value'];
- $additionalData = substr($additionalData, $constantArray['size']); // bite of chunk of additional data
- unset($space0, $space1);
- break;
- case 'tMemArea':
- // bite off chunk of additional data
- $cellRangeAddressList = $this->readBIFF8CellRangeAddressList($additionalData);
- $additionalData = substr($additionalData, $cellRangeAddressList['size']);
- $formulaStrings[] = "$space1$space0{$token['data']}";
- unset($space0, $space1);
- break;
- case 'tArea': // cell range address
- case 'tBool': // boolean
- case 'tErr': // error code
- case 'tInt': // integer
- case 'tMemErr':
- case 'tMemFunc':
- case 'tMissArg':
- case 'tName':
- case 'tNameX':
- case 'tNum': // number
- case 'tRef': // single cell reference
- case 'tRef3d': // 3d cell reference
- case 'tArea3d': // 3d cell range reference
- case 'tRefN':
- case 'tAreaN':
- case 'tStr': // string
- $formulaStrings[] = "$space1$space0{$token['data']}";
- unset($space0, $space1);
- break;
- }
- }
- $formulaString = $formulaStrings[0];
-
- // for debug: dump the human readable formula
- //echo '----' . "\n";
- //echo 'Formula: ' . $formulaString;
-
- return $formulaString;
- }
-
-
- /**
- * Fetch next token from binary formula data
- *
- * @param string Formula data
- * @param string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas
- * @return array
- * @throws PHPExcel_Reader_Exception
- */
- private function getNextToken($formulaData, $baseCell = 'A1')
- {
- // offset: 0; size: 1; token id
- $id = ord($formulaData[0]); // token id
- $name = false; // initialize token name
-
- switch ($id) {
- case 0x03:
- $name = 'tAdd';
- $size = 1;
- $data = '+';
- break;
- case 0x04:
- $name = 'tSub';
- $size = 1;
- $data = '-';
- break;
- case 0x05:
- $name = 'tMul';
- $size = 1;
- $data = '*';
- break;
- case 0x06:
- $name = 'tDiv';
- $size = 1;
- $data = '/';
- break;
- case 0x07:
- $name = 'tPower';
- $size = 1;
- $data = '^';
- break;
- case 0x08:
- $name = 'tConcat';
- $size = 1;
- $data = '&';
- break;
- case 0x09:
- $name = 'tLT';
- $size = 1;
- $data = '<';
- break;
- case 0x0A:
- $name = 'tLE';
- $size = 1;
- $data = '<=';
- break;
- case 0x0B:
- $name = 'tEQ';
- $size = 1;
- $data = '=';
- break;
- case 0x0C:
- $name = 'tGE';
- $size = 1;
- $data = '>=';
- break;
- case 0x0D:
- $name = 'tGT';
- $size = 1;
- $data = '>';
- break;
- case 0x0E:
- $name = 'tNE';
- $size = 1;
- $data = '<>';
- break;
- case 0x0F:
- $name = 'tIsect';
- $size = 1;
- $data = ' ';
- break;
- case 0x10:
- $name = 'tList';
- $size = 1;
- $data = ',';
- break;
- case 0x11:
- $name = 'tRange';
- $size = 1;
- $data = ':';
- break;
- case 0x12:
- $name = 'tUplus';
- $size = 1;
- $data = '+';
- break;
- case 0x13:
- $name = 'tUminus';
- $size = 1;
- $data = '-';
- break;
- case 0x14:
- $name = 'tPercent';
- $size = 1;
- $data = '%';
- break;
- case 0x15: // parenthesis
- $name = 'tParen';
- $size = 1;
- $data = null;
- break;
- case 0x16: // missing argument
- $name = 'tMissArg';
- $size = 1;
- $data = '';
- break;
- case 0x17: // string
- $name = 'tStr';
- // offset: 1; size: var; Unicode string, 8-bit string length
- $string = self::readUnicodeStringShort(substr($formulaData, 1));
- $size = 1 + $string['size'];
- $data = self::UTF8toExcelDoubleQuoted($string['value']);
- break;
- case 0x19: // Special attribute
- // offset: 1; size: 1; attribute type flags:
- switch (ord($formulaData[1])) {
- case 0x01:
- $name = 'tAttrVolatile';
- $size = 4;
- $data = null;
- break;
- case 0x02:
- $name = 'tAttrIf';
- $size = 4;
- $data = null;
- break;
- case 0x04:
- $name = 'tAttrChoose';
- // offset: 2; size: 2; number of choices in the CHOOSE function ($nc, number of parameters decreased by 1)
- $nc = self::getInt2d($formulaData, 2);
- // offset: 4; size: 2 * $nc
- // offset: 4 + 2 * $nc; size: 2
- $size = 2 * $nc + 6;
- $data = null;
- break;
- case 0x08:
- $name = 'tAttrSkip';
- $size = 4;
- $data = null;
- break;
- case 0x10:
- $name = 'tAttrSum';
- $size = 4;
- $data = null;
- break;
- case 0x40:
- case 0x41:
- $name = 'tAttrSpace';
- $size = 4;
- // offset: 2; size: 2; space type and position
- switch (ord($formulaData[2])) {
- case 0x00:
- $spacetype = 'type0';
- break;
- case 0x01:
- $spacetype = 'type1';
- break;
- case 0x02:
- $spacetype = 'type2';
- break;
- case 0x03:
- $spacetype = 'type3';
- break;
- case 0x04:
- $spacetype = 'type4';
- break;
- case 0x05:
- $spacetype = 'type5';
- break;
- default:
- throw new PHPExcel_Reader_Exception('Unrecognized space type in tAttrSpace token');
- break;
- }
- // offset: 3; size: 1; number of inserted spaces/carriage returns
- $spacecount = ord($formulaData[3]);
-
- $data = array('spacetype' => $spacetype, 'spacecount' => $spacecount);
- break;
- default:
- throw new PHPExcel_Reader_Exception('Unrecognized attribute flag in tAttr token');
- break;
- }
- break;
- case 0x1C: // error code
- // offset: 1; size: 1; error code
- $name = 'tErr';
- $size = 2;
- $data = self::mapErrorCode(ord($formulaData[1]));
- break;
- case 0x1D: // boolean
- // offset: 1; size: 1; 0 = false, 1 = true;
- $name = 'tBool';
- $size = 2;
- $data = ord($formulaData[1]) ? 'TRUE' : 'FALSE';
- break;
- case 0x1E: // integer
- // offset: 1; size: 2; unsigned 16-bit integer
- $name = 'tInt';
- $size = 3;
- $data = self::getInt2d($formulaData, 1);
- break;
- case 0x1F: // number
- // offset: 1; size: 8;
- $name = 'tNum';
- $size = 9;
- $data = self::extractNumber(substr($formulaData, 1));
- $data = str_replace(',', '.', (string)$data); // in case non-English locale
- break;
- case 0x20: // array constant
- case 0x40:
- case 0x60:
- // offset: 1; size: 7; not used
- $name = 'tArray';
- $size = 8;
- $data = null;
- break;
- case 0x21: // function with fixed number of arguments
- case 0x41:
- case 0x61:
- $name = 'tFunc';
- $size = 3;
- // offset: 1; size: 2; index to built-in sheet function
- switch (self::getInt2d($formulaData, 1)) {
- case 2:
- $function = 'ISNA';
- $args = 1;
- break;
- case 3:
- $function = 'ISERROR';
- $args = 1;
- break;
- case 10:
- $function = 'NA';
- $args = 0;
- break;
- case 15:
- $function = 'SIN';
- $args = 1;
- break;
- case 16:
- $function = 'COS';
- $args = 1;
- break;
- case 17:
- $function = 'TAN';
- $args = 1;
- break;
- case 18:
- $function = 'ATAN';
- $args = 1;
- break;
- case 19:
- $function = 'PI';
- $args = 0;
- break;
- case 20:
- $function = 'SQRT';
- $args = 1;
- break;
- case 21:
- $function = 'EXP';
- $args = 1;
- break;
- case 22:
- $function = 'LN';
- $args = 1;
- break;
- case 23:
- $function = 'LOG10';
- $args = 1;
- break;
- case 24:
- $function = 'ABS';
- $args = 1;
- break;
- case 25:
- $function = 'INT';
- $args = 1;
- break;
- case 26:
- $function = 'SIGN';
- $args = 1;
- break;
- case 27:
- $function = 'ROUND';
- $args = 2;
- break;
- case 30:
- $function = 'REPT';
- $args = 2;
- break;
- case 31:
- $function = 'MID';
- $args = 3;
- break;
- case 32:
- $function = 'LEN';
- $args = 1;
- break;
- case 33:
- $function = 'VALUE';
- $args = 1;
- break;
- case 34:
- $function = 'TRUE';
- $args = 0;
- break;
- case 35:
- $function = 'FALSE';
- $args = 0;
- break;
- case 38:
- $function = 'NOT';
- $args = 1;
- break;
- case 39:
- $function = 'MOD';
- $args = 2;
- break;
- case 40:
- $function = 'DCOUNT';
- $args = 3;
- break;
- case 41:
- $function = 'DSUM';
- $args = 3;
- break;
- case 42:
- $function = 'DAVERAGE';
- $args = 3;
- break;
- case 43:
- $function = 'DMIN';
- $args = 3;
- break;
- case 44:
- $function = 'DMAX';
- $args = 3;
- break;
- case 45:
- $function = 'DSTDEV';
- $args = 3;
- break;
- case 48:
- $function = 'TEXT';
- $args = 2;
- break;
- case 61:
- $function = 'MIRR';
- $args = 3;
- break;
- case 63:
- $function = 'RAND';
- $args = 0;
- break;
- case 65:
- $function = 'DATE';
- $args = 3;
- break;
- case 66:
- $function = 'TIME';
- $args = 3;
- break;
- case 67:
- $function = 'DAY';
- $args = 1;
- break;
- case 68:
- $function = 'MONTH';
- $args = 1;
- break;
- case 69:
- $function = 'YEAR';
- $args = 1;
- break;
- case 71:
- $function = 'HOUR';
- $args = 1;
- break;
- case 72:
- $function = 'MINUTE';
- $args = 1;
- break;
- case 73:
- $function = 'SECOND';
- $args = 1;
- break;
- case 74:
- $function = 'NOW';
- $args = 0;
- break;
- case 75:
- $function = 'AREAS';
- $args = 1;
- break;
- case 76:
- $function = 'ROWS';
- $args = 1;
- break;
- case 77:
- $function = 'COLUMNS';
- $args = 1;
- break;
- case 83:
- $function = 'TRANSPOSE';
- $args = 1;
- break;
- case 86:
- $function = 'TYPE';
- $args = 1;
- break;
- case 97:
- $function = 'ATAN2';
- $args = 2;
- break;
- case 98:
- $function = 'ASIN';
- $args = 1;
- break;
- case 99:
- $function = 'ACOS';
- $args = 1;
- break;
- case 105:
- $function = 'ISREF';
- $args = 1;
- break;
- case 111:
- $function = 'CHAR';
- $args = 1;
- break;
- case 112:
- $function = 'LOWER';
- $args = 1;
- break;
- case 113:
- $function = 'UPPER';
- $args = 1;
- break;
- case 114:
- $function = 'PROPER';
- $args = 1;
- break;
- case 117:
- $function = 'EXACT';
- $args = 2;
- break;
- case 118:
- $function = 'TRIM';
- $args = 1;
- break;
- case 119:
- $function = 'REPLACE';
- $args = 4;
- break;
- case 121:
- $function = 'CODE';
- $args = 1;
- break;
- case 126:
- $function = 'ISERR';
- $args = 1;
- break;
- case 127:
- $function = 'ISTEXT';
- $args = 1;
- break;
- case 128:
- $function = 'ISNUMBER';
- $args = 1;
- break;
- case 129:
- $function = 'ISBLANK';
- $args = 1;
- break;
- case 130:
- $function = 'T';
- $args = 1;
- break;
- case 131:
- $function = 'N';
- $args = 1;
- break;
- case 140:
- $function = 'DATEVALUE';
- $args = 1;
- break;
- case 141:
- $function = 'TIMEVALUE';
- $args = 1;
- break;
- case 142:
- $function = 'SLN';
- $args = 3;
- break;
- case 143:
- $function = 'SYD';
- $args = 4;
- break;
- case 162:
- $function = 'CLEAN';
- $args = 1;
- break;
- case 163:
- $function = 'MDETERM';
- $args = 1;
- break;
- case 164:
- $function = 'MINVERSE';
- $args = 1;
- break;
- case 165:
- $function = 'MMULT';
- $args = 2;
- break;
- case 184:
- $function = 'FACT';
- $args = 1;
- break;
- case 189:
- $function = 'DPRODUCT';
- $args = 3;
- break;
- case 190:
- $function = 'ISNONTEXT';
- $args = 1;
- break;
- case 195:
- $function = 'DSTDEVP';
- $args = 3;
- break;
- case 196:
- $function = 'DVARP';
- $args = 3;
- break;
- case 198:
- $function = 'ISLOGICAL';
- $args = 1;
- break;
- case 199:
- $function = 'DCOUNTA';
- $args = 3;
- break;
- case 207:
- $function = 'REPLACEB';
- $args = 4;
- break;
- case 210:
- $function = 'MIDB';
- $args = 3;
- break;
- case 211:
- $function = 'LENB';
- $args = 1;
- break;
- case 212:
- $function = 'ROUNDUP';
- $args = 2;
- break;
- case 213:
- $function = 'ROUNDDOWN';
- $args = 2;
- break;
- case 214:
- $function = 'ASC';
- $args = 1;
- break;
- case 215:
- $function = 'DBCS';
- $args = 1;
- break;
- case 221:
- $function = 'TODAY';
- $args = 0;
- break;
- case 229:
- $function = 'SINH';
- $args = 1;
- break;
- case 230:
- $function = 'COSH';
- $args = 1;
- break;
- case 231:
- $function = 'TANH';
- $args = 1;
- break;
- case 232:
- $function = 'ASINH';
- $args = 1;
- break;
- case 233:
- $function = 'ACOSH';
- $args = 1;
- break;
- case 234:
- $function = 'ATANH';
- $args = 1;
- break;
- case 235:
- $function = 'DGET';
- $args = 3;
- break;
- case 244:
- $function = 'INFO';
- $args = 1;
- break;
- case 252:
- $function = 'FREQUENCY';
- $args = 2;
- break;
- case 261:
- $function = 'ERROR.TYPE';
- $args = 1;
- break;
- case 271:
- $function = 'GAMMALN';
- $args = 1;
- break;
- case 273:
- $function = 'BINOMDIST';
- $args = 4;
- break;
- case 274:
- $function = 'CHIDIST';
- $args = 2;
- break;
- case 275:
- $function = 'CHIINV';
- $args = 2;
- break;
- case 276:
- $function = 'COMBIN';
- $args = 2;
- break;
- case 277:
- $function = 'CONFIDENCE';
- $args = 3;
- break;
- case 278:
- $function = 'CRITBINOM';
- $args = 3;
- break;
- case 279:
- $function = 'EVEN';
- $args = 1;
- break;
- case 280:
- $function = 'EXPONDIST';
- $args = 3;
- break;
- case 281:
- $function = 'FDIST';
- $args = 3;
- break;
- case 282:
- $function = 'FINV';
- $args = 3;
- break;
- case 283:
- $function = 'FISHER';
- $args = 1;
- break;
- case 284:
- $function = 'FISHERINV';
- $args = 1;
- break;
- case 285:
- $function = 'FLOOR';
- $args = 2;
- break;
- case 286:
- $function = 'GAMMADIST';
- $args = 4;
- break;
- case 287:
- $function = 'GAMMAINV';
- $args = 3;
- break;
- case 288:
- $function = 'CEILING';
- $args = 2;
- break;
- case 289:
- $function = 'HYPGEOMDIST';
- $args = 4;
- break;
- case 290:
- $function = 'LOGNORMDIST';
- $args = 3;
- break;
- case 291:
- $function = 'LOGINV';
- $args = 3;
- break;
- case 292:
- $function = 'NEGBINOMDIST';
- $args = 3;
- break;
- case 293:
- $function = 'NORMDIST';
- $args = 4;
- break;
- case 294:
- $function = 'NORMSDIST';
- $args = 1;
- break;
- case 295:
- $function = 'NORMINV';
- $args = 3;
- break;
- case 296:
- $function = 'NORMSINV';
- $args = 1;
- break;
- case 297:
- $function = 'STANDARDIZE';
- $args = 3;
- break;
- case 298:
- $function = 'ODD';
- $args = 1;
- break;
- case 299:
- $function = 'PERMUT';
- $args = 2;
- break;
- case 300:
- $function = 'POISSON';
- $args = 3;
- break;
- case 301:
- $function = 'TDIST';
- $args = 3;
- break;
- case 302:
- $function = 'WEIBULL';
- $args = 4;
- break;
- case 303:
- $function = 'SUMXMY2';
- $args = 2;
- break;
- case 304:
- $function = 'SUMX2MY2';
- $args = 2;
- break;
- case 305:
- $function = 'SUMX2PY2';
- $args = 2;
- break;
- case 306:
- $function = 'CHITEST';
- $args = 2;
- break;
- case 307:
- $function = 'CORREL';
- $args = 2;
- break;
- case 308:
- $function = 'COVAR';
- $args = 2;
- break;
- case 309:
- $function = 'FORECAST';
- $args = 3;
- break;
- case 310:
- $function = 'FTEST';
- $args = 2;
- break;
- case 311:
- $function = 'INTERCEPT';
- $args = 2;
- break;
- case 312:
- $function = 'PEARSON';
- $args = 2;
- break;
- case 313:
- $function = 'RSQ';
- $args = 2;
- break;
- case 314:
- $function = 'STEYX';
- $args = 2;
- break;
- case 315:
- $function = 'SLOPE';
- $args = 2;
- break;
- case 316:
- $function = 'TTEST';
- $args = 4;
- break;
- case 325:
- $function = 'LARGE';
- $args = 2;
- break;
- case 326:
- $function = 'SMALL';
- $args = 2;
- break;
- case 327:
- $function = 'QUARTILE';
- $args = 2;
- break;
- case 328:
- $function = 'PERCENTILE';
- $args = 2;
- break;
- case 331:
- $function = 'TRIMMEAN';
- $args = 2;
- break;
- case 332:
- $function = 'TINV';
- $args = 2;
- break;
- case 337:
- $function = 'POWER';
- $args = 2;
- break;
- case 342:
- $function = 'RADIANS';
- $args = 1;
- break;
- case 343:
- $function = 'DEGREES';
- $args = 1;
- break;
- case 346:
- $function = 'COUNTIF';
- $args = 2;
- break;
- case 347:
- $function = 'COUNTBLANK';
- $args = 1;
- break;
- case 350:
- $function = 'ISPMT';
- $args = 4;
- break;
- case 351:
- $function = 'DATEDIF';
- $args = 3;
- break;
- case 352:
- $function = 'DATESTRING';
- $args = 1;
- break;
- case 353:
- $function = 'NUMBERSTRING';
- $args = 2;
- break;
- case 360:
- $function = 'PHONETIC';
- $args = 1;
- break;
- case 368:
- $function = 'BAHTTEXT';
- $args = 1;
- break;
- default:
- throw new PHPExcel_Reader_Exception('Unrecognized function in formula');
- break;
- }
- $data = array('function' => $function, 'args' => $args);
- break;
- case 0x22: // function with variable number of arguments
- case 0x42:
- case 0x62:
- $name = 'tFuncV';
- $size = 4;
- // offset: 1; size: 1; number of arguments
- $args = ord($formulaData[1]);
- // offset: 2: size: 2; index to built-in sheet function
- $index = self::getInt2d($formulaData, 2);
- switch ($index) {
- case 0:
- $function = 'COUNT';
- break;
- case 1:
- $function = 'IF';
- break;
- case 4:
- $function = 'SUM';
- break;
- case 5:
- $function = 'AVERAGE';
- break;
- case 6:
- $function = 'MIN';
- break;
- case 7:
- $function = 'MAX';
- break;
- case 8:
- $function = 'ROW';
- break;
- case 9:
- $function = 'COLUMN';
- break;
- case 11:
- $function = 'NPV';
- break;
- case 12:
- $function = 'STDEV';
- break;
- case 13:
- $function = 'DOLLAR';
- break;
- case 14:
- $function = 'FIXED';
- break;
- case 28:
- $function = 'LOOKUP';
- break;
- case 29:
- $function = 'INDEX';
- break;
- case 36:
- $function = 'AND';
- break;
- case 37:
- $function = 'OR';
- break;
- case 46:
- $function = 'VAR';
- break;
- case 49:
- $function = 'LINEST';
- break;
- case 50:
- $function = 'TREND';
- break;
- case 51:
- $function = 'LOGEST';
- break;
- case 52:
- $function = 'GROWTH';
- break;
- case 56:
- $function = 'PV';
- break;
- case 57:
- $function = 'FV';
- break;
- case 58:
- $function = 'NPER';
- break;
- case 59:
- $function = 'PMT';
- break;
- case 60:
- $function = 'RATE';
- break;
- case 62:
- $function = 'IRR';
- break;
- case 64:
- $function = 'MATCH';
- break;
- case 70:
- $function = 'WEEKDAY';
- break;
- case 78:
- $function = 'OFFSET';
- break;
- case 82:
- $function = 'SEARCH';
- break;
- case 100:
- $function = 'CHOOSE';
- break;
- case 101:
- $function = 'HLOOKUP';
- break;
- case 102:
- $function = 'VLOOKUP';
- break;
- case 109:
- $function = 'LOG';
- break;
- case 115:
- $function = 'LEFT';
- break;
- case 116:
- $function = 'RIGHT';
- break;
- case 120:
- $function = 'SUBSTITUTE';
- break;
- case 124:
- $function = 'FIND';
- break;
- case 125:
- $function = 'CELL';
- break;
- case 144:
- $function = 'DDB';
- break;
- case 148:
- $function = 'INDIRECT';
- break;
- case 167:
- $function = 'IPMT';
- break;
- case 168:
- $function = 'PPMT';
- break;
- case 169:
- $function = 'COUNTA';
- break;
- case 183:
- $function = 'PRODUCT';
- break;
- case 193:
- $function = 'STDEVP';
- break;
- case 194:
- $function = 'VARP';
- break;
- case 197:
- $function = 'TRUNC';
- break;
- case 204:
- $function = 'USDOLLAR';
- break;
- case 205:
- $function = 'FINDB';
- break;
- case 206:
- $function = 'SEARCHB';
- break;
- case 208:
- $function = 'LEFTB';
- break;
- case 209:
- $function = 'RIGHTB';
- break;
- case 216:
- $function = 'RANK';
- break;
- case 219:
- $function = 'ADDRESS';
- break;
- case 220:
- $function = 'DAYS360';
- break;
- case 222:
- $function = 'VDB';
- break;
- case 227:
- $function = 'MEDIAN';
- break;
- case 228:
- $function = 'SUMPRODUCT';
- break;
- case 247:
- $function = 'DB';
- break;
- case 255:
- $function = '';
- break;
- case 269:
- $function = 'AVEDEV';
- break;
- case 270:
- $function = 'BETADIST';
- break;
- case 272:
- $function = 'BETAINV';
- break;
- case 317:
- $function = 'PROB';
- break;
- case 318:
- $function = 'DEVSQ';
- break;
- case 319:
- $function = 'GEOMEAN';
- break;
- case 320:
- $function = 'HARMEAN';
- break;
- case 321:
- $function = 'SUMSQ';
- break;
- case 322:
- $function = 'KURT';
- break;
- case 323:
- $function = 'SKEW';
- break;
- case 324:
- $function = 'ZTEST';
- break;
- case 329:
- $function = 'PERCENTRANK';
- break;
- case 330:
- $function = 'MODE';
- break;
- case 336:
- $function = 'CONCATENATE';
- break;
- case 344:
- $function = 'SUBTOTAL';
- break;
- case 345:
- $function = 'SUMIF';
- break;
- case 354:
- $function = 'ROMAN';
- break;
- case 358:
- $function = 'GETPIVOTDATA';
- break;
- case 359:
- $function = 'HYPERLINK';
- break;
- case 361:
- $function = 'AVERAGEA';
- break;
- case 362:
- $function = 'MAXA';
- break;
- case 363:
- $function = 'MINA';
- break;
- case 364:
- $function = 'STDEVPA';
- break;
- case 365:
- $function = 'VARPA';
- break;
- case 366:
- $function = 'STDEVA';
- break;
- case 367:
- $function = 'VARA';
- break;
- default:
- throw new PHPExcel_Reader_Exception('Unrecognized function in formula');
- break;
- }
- $data = array('function' => $function, 'args' => $args);
- break;
- case 0x23: // index to defined name
- case 0x43:
- case 0x63:
- $name = 'tName';
- $size = 5;
- // offset: 1; size: 2; one-based index to definedname record
- $definedNameIndex = self::getInt2d($formulaData, 1) - 1;
- // offset: 2; size: 2; not used
- $data = $this->definedname[$definedNameIndex]['name'];
- break;
- case 0x24: // single cell reference e.g. A5
- case 0x44:
- case 0x64:
- $name = 'tRef';
- $size = 5;
- $data = $this->readBIFF8CellAddress(substr($formulaData, 1, 4));
- break;
- case 0x25: // cell range reference to cells in the same sheet (2d)
- case 0x45:
- case 0x65:
- $name = 'tArea';
- $size = 9;
- $data = $this->readBIFF8CellRangeAddress(substr($formulaData, 1, 8));
- break;
- case 0x26: // Constant reference sub-expression
- case 0x46:
- case 0x66:
- $name = 'tMemArea';
- // offset: 1; size: 4; not used
- // offset: 5; size: 2; size of the following subexpression
- $subSize = self::getInt2d($formulaData, 5);
- $size = 7 + $subSize;
- $data = $this->getFormulaFromData(substr($formulaData, 7, $subSize));
- break;
- case 0x27: // Deleted constant reference sub-expression
- case 0x47:
- case 0x67:
- $name = 'tMemErr';
- // offset: 1; size: 4; not used
- // offset: 5; size: 2; size of the following subexpression
- $subSize = self::getInt2d($formulaData, 5);
- $size = 7 + $subSize;
- $data = $this->getFormulaFromData(substr($formulaData, 7, $subSize));
- break;
- case 0x29: // Variable reference sub-expression
- case 0x49:
- case 0x69:
- $name = 'tMemFunc';
- // offset: 1; size: 2; size of the following sub-expression
- $subSize = self::getInt2d($formulaData, 1);
- $size = 3 + $subSize;
- $data = $this->getFormulaFromData(substr($formulaData, 3, $subSize));
- break;
- case 0x2C: // Relative 2d cell reference reference, used in shared formulas and some other places
- case 0x4C:
- case 0x6C:
- $name = 'tRefN';
- $size = 5;
- $data = $this->readBIFF8CellAddressB(substr($formulaData, 1, 4), $baseCell);
- break;
- case 0x2D: // Relative 2d range reference
- case 0x4D:
- case 0x6D:
- $name = 'tAreaN';
- $size = 9;
- $data = $this->readBIFF8CellRangeAddressB(substr($formulaData, 1, 8), $baseCell);
- break;
- case 0x39: // External name
- case 0x59:
- case 0x79:
- $name = 'tNameX';
- $size = 7;
- // offset: 1; size: 2; index to REF entry in EXTERNSHEET record
- // offset: 3; size: 2; one-based index to DEFINEDNAME or EXTERNNAME record
- $index = self::getInt2d($formulaData, 3);
- // assume index is to EXTERNNAME record
- $data = $this->externalNames[$index - 1]['name'];
- // offset: 5; size: 2; not used
- break;
- case 0x3A: // 3d reference to cell
- case 0x5A:
- case 0x7A:
- $name = 'tRef3d';
- $size = 7;
-
- try {
- // offset: 1; size: 2; index to REF entry
- $sheetRange = $this->readSheetRangeByRefIndex(self::getInt2d($formulaData, 1));
- // offset: 3; size: 4; cell address
- $cellAddress = $this->readBIFF8CellAddress(substr($formulaData, 3, 4));
-
- $data = "$sheetRange!$cellAddress";
- } catch (PHPExcel_Exception $e) {
- // deleted sheet reference
- $data = '#REF!';
- }
- break;
- case 0x3B: // 3d reference to cell range
- case 0x5B:
- case 0x7B:
- $name = 'tArea3d';
- $size = 11;
-
- try {
- // offset: 1; size: 2; index to REF entry
- $sheetRange = $this->readSheetRangeByRefIndex(self::getInt2d($formulaData, 1));
- // offset: 3; size: 8; cell address
- $cellRangeAddress = $this->readBIFF8CellRangeAddress(substr($formulaData, 3, 8));
-
- $data = "$sheetRange!$cellRangeAddress";
- } catch (PHPExcel_Exception $e) {
- // deleted sheet reference
- $data = '#REF!';
- }
- break;
- // Unknown cases // don't know how to deal with
- default:
- throw new PHPExcel_Reader_Exception('Unrecognized token ' . sprintf('%02X', $id) . ' in formula');
- break;
- }
-
- return array(
- 'id' => $id,
- 'name' => $name,
- 'size' => $size,
- 'data' => $data,
- );
- }
-
-
- /**
- * Reads a cell address in BIFF8 e.g. 'A2' or '$A$2'
- * section 3.3.4
- *
- * @param string $cellAddressStructure
- * @return string
- */
- private function readBIFF8CellAddress($cellAddressStructure)
- {
- // offset: 0; size: 2; index to row (0... 65535) (or offset (-32768... 32767))
- $row = self::getInt2d($cellAddressStructure, 0) + 1;
-
- // offset: 2; size: 2; index to column or column offset + relative flags
- // bit: 7-0; mask 0x00FF; column index
- $column = PHPExcel_Cell::stringFromColumnIndex(0x00FF & self::getInt2d($cellAddressStructure, 2));
-
- // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index)
- if (!(0x4000 & self::getInt2d($cellAddressStructure, 2))) {
- $column = '$' . $column;
- }
- // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index)
- if (!(0x8000 & self::getInt2d($cellAddressStructure, 2))) {
- $row = '$' . $row;
- }
-
- return $column . $row;
- }
-
-
- /**
- * Reads a cell address in BIFF8 for shared formulas. Uses positive and negative values for row and column
- * to indicate offsets from a base cell
- * section 3.3.4
- *
- * @param string $cellAddressStructure
- * @param string $baseCell Base cell, only needed when formula contains tRefN tokens, e.g. with shared formulas
- * @return string
- */
- private function readBIFF8CellAddressB($cellAddressStructure, $baseCell = 'A1')
- {
- list($baseCol, $baseRow) = PHPExcel_Cell::coordinateFromString($baseCell);
- $baseCol = PHPExcel_Cell::columnIndexFromString($baseCol) - 1;
-
- // offset: 0; size: 2; index to row (0... 65535) (or offset (-32768... 32767))
- $rowIndex = self::getInt2d($cellAddressStructure, 0);
- $row = self::getInt2d($cellAddressStructure, 0) + 1;
-
- // offset: 2; size: 2; index to column or column offset + relative flags
- // bit: 7-0; mask 0x00FF; column index
- $colIndex = 0x00FF & self::getInt2d($cellAddressStructure, 2);
-
- // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index)
- if (!(0x4000 & self::getInt2d($cellAddressStructure, 2))) {
- $column = PHPExcel_Cell::stringFromColumnIndex($colIndex);
- $column = '$' . $column;
- } else {
- $colIndex = ($colIndex <= 127) ? $colIndex : $colIndex - 256;
- $column = PHPExcel_Cell::stringFromColumnIndex($baseCol + $colIndex);
- }
-
- // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index)
- if (!(0x8000 & self::getInt2d($cellAddressStructure, 2))) {
- $row = '$' . $row;
- } else {
- $rowIndex = ($rowIndex <= 32767) ? $rowIndex : $rowIndex - 65536;
- $row = $baseRow + $rowIndex;
- }
-
- return $column . $row;
- }
-
-
- /**
- * Reads a cell range address in BIFF5 e.g. 'A2:B6' or 'A1'
- * always fixed range
- * section 2.5.14
- *
- * @param string $subData
- * @return string
- * @throws PHPExcel_Reader_Exception
- */
- private function readBIFF5CellRangeAddressFixed($subData)
- {
- // offset: 0; size: 2; index to first row
- $fr = self::getInt2d($subData, 0) + 1;
-
- // offset: 2; size: 2; index to last row
- $lr = self::getInt2d($subData, 2) + 1;
-
- // offset: 4; size: 1; index to first column
- $fc = ord($subData{4});
-
- // offset: 5; size: 1; index to last column
- $lc = ord($subData{5});
-
- // check values
- if ($fr > $lr || $fc > $lc) {
- throw new PHPExcel_Reader_Exception('Not a cell range address');
- }
-
- // column index to letter
- $fc = PHPExcel_Cell::stringFromColumnIndex($fc);
- $lc = PHPExcel_Cell::stringFromColumnIndex($lc);
-
- if ($fr == $lr and $fc == $lc) {
- return "$fc$fr";
- }
- return "$fc$fr:$lc$lr";
- }
-
-
- /**
- * Reads a cell range address in BIFF8 e.g. 'A2:B6' or 'A1'
- * always fixed range
- * section 2.5.14
- *
- * @param string $subData
- * @return string
- * @throws PHPExcel_Reader_Exception
- */
- private function readBIFF8CellRangeAddressFixed($subData)
- {
- // offset: 0; size: 2; index to first row
- $fr = self::getInt2d($subData, 0) + 1;
-
- // offset: 2; size: 2; index to last row
- $lr = self::getInt2d($subData, 2) + 1;
-
- // offset: 4; size: 2; index to first column
- $fc = self::getInt2d($subData, 4);
-
- // offset: 6; size: 2; index to last column
- $lc = self::getInt2d($subData, 6);
-
- // check values
- if ($fr > $lr || $fc > $lc) {
- throw new PHPExcel_Reader_Exception('Not a cell range address');
- }
-
- // column index to letter
- $fc = PHPExcel_Cell::stringFromColumnIndex($fc);
- $lc = PHPExcel_Cell::stringFromColumnIndex($lc);
-
- if ($fr == $lr and $fc == $lc) {
- return "$fc$fr";
- }
- return "$fc$fr:$lc$lr";
- }
-
-
- /**
- * Reads a cell range address in BIFF8 e.g. 'A2:B6' or '$A$2:$B$6'
- * there are flags indicating whether column/row index is relative
- * section 3.3.4
- *
- * @param string $subData
- * @return string
- */
- private function readBIFF8CellRangeAddress($subData)
- {
- // todo: if cell range is just a single cell, should this funciton
- // not just return e.g. 'A1' and not 'A1:A1' ?
-
- // offset: 0; size: 2; index to first row (0... 65535) (or offset (-32768... 32767))
- $fr = self::getInt2d($subData, 0) + 1;
-
- // offset: 2; size: 2; index to last row (0... 65535) (or offset (-32768... 32767))
- $lr = self::getInt2d($subData, 2) + 1;
-
- // offset: 4; size: 2; index to first column or column offset + relative flags
-
- // bit: 7-0; mask 0x00FF; column index
- $fc = PHPExcel_Cell::stringFromColumnIndex(0x00FF & self::getInt2d($subData, 4));
-
- // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index)
- if (!(0x4000 & self::getInt2d($subData, 4))) {
- $fc = '$' . $fc;
- }
-
- // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index)
- if (!(0x8000 & self::getInt2d($subData, 4))) {
- $fr = '$' . $fr;
- }
-
- // offset: 6; size: 2; index to last column or column offset + relative flags
-
- // bit: 7-0; mask 0x00FF; column index
- $lc = PHPExcel_Cell::stringFromColumnIndex(0x00FF & self::getInt2d($subData, 6));
-
- // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index)
- if (!(0x4000 & self::getInt2d($subData, 6))) {
- $lc = '$' . $lc;
- }
-
- // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index)
- if (!(0x8000 & self::getInt2d($subData, 6))) {
- $lr = '$' . $lr;
- }
-
- return "$fc$fr:$lc$lr";
- }
-
-
- /**
- * Reads a cell range address in BIFF8 for shared formulas. Uses positive and negative values for row and column
- * to indicate offsets from a base cell
- * section 3.3.4
- *
- * @param string $subData
- * @param string $baseCell Base cell
- * @return string Cell range address
- */
- private function readBIFF8CellRangeAddressB($subData, $baseCell = 'A1')
- {
- list($baseCol, $baseRow) = PHPExcel_Cell::coordinateFromString($baseCell);
- $baseCol = PHPExcel_Cell::columnIndexFromString($baseCol) - 1;
-
- // TODO: if cell range is just a single cell, should this funciton
- // not just return e.g. 'A1' and not 'A1:A1' ?
-
- // offset: 0; size: 2; first row
- $frIndex = self::getInt2d($subData, 0); // adjust below
-
- // offset: 2; size: 2; relative index to first row (0... 65535) should be treated as offset (-32768... 32767)
- $lrIndex = self::getInt2d($subData, 2); // adjust below
-
- // offset: 4; size: 2; first column with relative/absolute flags
-
- // bit: 7-0; mask 0x00FF; column index
- $fcIndex = 0x00FF & self::getInt2d($subData, 4);
-
- // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index)
- if (!(0x4000 & self::getInt2d($subData, 4))) {
- // absolute column index
- $fc = PHPExcel_Cell::stringFromColumnIndex($fcIndex);
- $fc = '$' . $fc;
- } else {
- // column offset
- $fcIndex = ($fcIndex <= 127) ? $fcIndex : $fcIndex - 256;
- $fc = PHPExcel_Cell::stringFromColumnIndex($baseCol + $fcIndex);
- }
-
- // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index)
- if (!(0x8000 & self::getInt2d($subData, 4))) {
- // absolute row index
- $fr = $frIndex + 1;
- $fr = '$' . $fr;
- } else {
- // row offset
- $frIndex = ($frIndex <= 32767) ? $frIndex : $frIndex - 65536;
- $fr = $baseRow + $frIndex;
- }
-
- // offset: 6; size: 2; last column with relative/absolute flags
-
- // bit: 7-0; mask 0x00FF; column index
- $lcIndex = 0x00FF & self::getInt2d($subData, 6);
- $lcIndex = ($lcIndex <= 127) ? $lcIndex : $lcIndex - 256;
- $lc = PHPExcel_Cell::stringFromColumnIndex($baseCol + $lcIndex);
-
- // bit: 14; mask 0x4000; (1 = relative column index, 0 = absolute column index)
- if (!(0x4000 & self::getInt2d($subData, 6))) {
- // absolute column index
- $lc = PHPExcel_Cell::stringFromColumnIndex($lcIndex);
- $lc = '$' . $lc;
- } else {
- // column offset
- $lcIndex = ($lcIndex <= 127) ? $lcIndex : $lcIndex - 256;
- $lc = PHPExcel_Cell::stringFromColumnIndex($baseCol + $lcIndex);
- }
-
- // bit: 15; mask 0x8000; (1 = relative row index, 0 = absolute row index)
- if (!(0x8000 & self::getInt2d($subData, 6))) {
- // absolute row index
- $lr = $lrIndex + 1;
- $lr = '$' . $lr;
- } else {
- // row offset
- $lrIndex = ($lrIndex <= 32767) ? $lrIndex : $lrIndex - 65536;
- $lr = $baseRow + $lrIndex;
- }
-
- return "$fc$fr:$lc$lr";
- }
-
-
- /**
- * Read BIFF8 cell range address list
- * section 2.5.15
- *
- * @param string $subData
- * @return array
- */
- private function readBIFF8CellRangeAddressList($subData)
- {
- $cellRangeAddresses = array();
-
- // offset: 0; size: 2; number of the following cell range addresses
- $nm = self::getInt2d($subData, 0);
-
- $offset = 2;
- // offset: 2; size: 8 * $nm; list of $nm (fixed) cell range addresses
- for ($i = 0; $i < $nm; ++$i) {
- $cellRangeAddresses[] = $this->readBIFF8CellRangeAddressFixed(substr($subData, $offset, 8));
- $offset += 8;
- }
-
- return array(
- 'size' => 2 + 8 * $nm,
- 'cellRangeAddresses' => $cellRangeAddresses,
- );
- }
-
-
- /**
- * Read BIFF5 cell range address list
- * section 2.5.15
- *
- * @param string $subData
- * @return array
- */
- private function readBIFF5CellRangeAddressList($subData)
- {
- $cellRangeAddresses = array();
-
- // offset: 0; size: 2; number of the following cell range addresses
- $nm = self::getInt2d($subData, 0);
-
- $offset = 2;
- // offset: 2; size: 6 * $nm; list of $nm (fixed) cell range addresses
- for ($i = 0; $i < $nm; ++$i) {
- $cellRangeAddresses[] = $this->readBIFF5CellRangeAddressFixed(substr($subData, $offset, 6));
- $offset += 6;
- }
-
- return array(
- 'size' => 2 + 6 * $nm,
- 'cellRangeAddresses' => $cellRangeAddresses,
- );
- }
-
-
- /**
- * Get a sheet range like Sheet1:Sheet3 from REF index
- * Note: If there is only one sheet in the range, one gets e.g Sheet1
- * It can also happen that the REF structure uses the -1 (FFFF) code to indicate deleted sheets,
- * in which case an PHPExcel_Reader_Exception is thrown
- *
- * @param int $index
- * @return string|false
- * @throws PHPExcel_Reader_Exception
- */
- private function readSheetRangeByRefIndex($index)
- {
- if (isset($this->ref[$index])) {
- $type = $this->externalBooks[$this->ref[$index]['externalBookIndex']]['type'];
-
- switch ($type) {
- case 'internal':
- // check if we have a deleted 3d reference
- if ($this->ref[$index]['firstSheetIndex'] == 0xFFFF or $this->ref[$index]['lastSheetIndex'] == 0xFFFF) {
- throw new PHPExcel_Reader_Exception('Deleted sheet reference');
- }
-
- // we have normal sheet range (collapsed or uncollapsed)
- $firstSheetName = $this->sheets[$this->ref[$index]['firstSheetIndex']]['name'];
- $lastSheetName = $this->sheets[$this->ref[$index]['lastSheetIndex']]['name'];
-
- if ($firstSheetName == $lastSheetName) {
- // collapsed sheet range
- $sheetRange = $firstSheetName;
- } else {
- $sheetRange = "$firstSheetName:$lastSheetName";
- }
-
- // escape the single-quotes
- $sheetRange = str_replace("'", "''", $sheetRange);
-
- // if there are special characters, we need to enclose the range in single-quotes
- // todo: check if we have identified the whole set of special characters
- // it seems that the following characters are not accepted for sheet names
- // and we may assume that they are not present: []*/:\?
- if (preg_match("/[ !\"@#£$%&{()}<>=+'|^,;-]/", $sheetRange)) {
- $sheetRange = "'$sheetRange'";
- }
-
- return $sheetRange;
- break;
- default:
- // TODO: external sheet support
- throw new PHPExcel_Reader_Exception('Excel5 reader only supports internal sheets in fomulas');
- break;
- }
- }
- return false;
- }
-
-
- /**
- * read BIFF8 constant value array from array data
- * returns e.g. array('value' => '{1,2;3,4}', 'size' => 40}
- * section 2.5.8
- *
- * @param string $arrayData
- * @return array
- */
- private static function readBIFF8ConstantArray($arrayData)
- {
- // offset: 0; size: 1; number of columns decreased by 1
- $nc = ord($arrayData[0]);
-
- // offset: 1; size: 2; number of rows decreased by 1
- $nr = self::getInt2d($arrayData, 1);
- $size = 3; // initialize
- $arrayData = substr($arrayData, 3);
-
- // offset: 3; size: var; list of ($nc + 1) * ($nr + 1) constant values
- $matrixChunks = array();
- for ($r = 1; $r <= $nr + 1; ++$r) {
- $items = array();
- for ($c = 1; $c <= $nc + 1; ++$c) {
- $constant = self::_readBIFF8Constant($arrayData);
- $items[] = $constant['value'];
- $arrayData = substr($arrayData, $constant['size']);
- $size += $constant['size'];
- }
- $matrixChunks[] = implode(',', $items); // looks like e.g. '1,"hello"'
- }
- $matrix = '{' . implode(';', $matrixChunks) . '}';
-
- return array(
- 'value' => $matrix,
- 'size' => $size,
- );
- }
-
-
- /**
- * read BIFF8 constant value which may be 'Empty Value', 'Number', 'String Value', 'Boolean Value', 'Error Value'
- * section 2.5.7
- * returns e.g. array('value' => '5', 'size' => 9)
- *
- * @param string $valueData
- * @return array
- */
- private static function readBIFF8Constant($valueData)
- {
- // offset: 0; size: 1; identifier for type of constant
- $identifier = ord($valueData[0]);
-
- switch ($identifier) {
- case 0x00: // empty constant (what is this?)
- $value = '';
- $size = 9;
- break;
- case 0x01: // number
- // offset: 1; size: 8; IEEE 754 floating-point value
- $value = self::extractNumber(substr($valueData, 1, 8));
- $size = 9;
- break;
- case 0x02: // string value
- // offset: 1; size: var; Unicode string, 16-bit string length
- $string = self::readUnicodeStringLong(substr($valueData, 1));
- $value = '"' . $string['value'] . '"';
- $size = 1 + $string['size'];
- break;
- case 0x04: // boolean
- // offset: 1; size: 1; 0 = FALSE, 1 = TRUE
- if (ord($valueData[1])) {
- $value = 'TRUE';
- } else {
- $value = 'FALSE';
- }
- $size = 9;
- break;
- case 0x10: // error code
- // offset: 1; size: 1; error code
- $value = self::mapErrorCode(ord($valueData[1]));
- $size = 9;
- break;
- }
- return array(
- 'value' => $value,
- 'size' => $size,
- );
- }
-
-
- /**
- * Extract RGB color
- * OpenOffice.org's Documentation of the Microsoft Excel File Format, section 2.5.4
- *
- * @param string $rgb Encoded RGB value (4 bytes)
- * @return array
- */
- private static function readRGB($rgb)
- {
- // offset: 0; size 1; Red component
- $r = ord($rgb{0});
-
- // offset: 1; size: 1; Green component
- $g = ord($rgb{1});
-
- // offset: 2; size: 1; Blue component
- $b = ord($rgb{2});
-
- // HEX notation, e.g. 'FF00FC'
- $rgb = sprintf('%02X%02X%02X', $r, $g, $b);
-
- return array('rgb' => $rgb);
- }
-
-
- /**
- * Read byte string (8-bit string length)
- * OpenOffice documentation: 2.5.2
- *
- * @param string $subData
- * @return array
- */
- private function readByteStringShort($subData)
- {
- // offset: 0; size: 1; length of the string (character count)
- $ln = ord($subData[0]);
-
- // offset: 1: size: var; character array (8-bit characters)
- $value = $this->decodeCodepage(substr($subData, 1, $ln));
-
- return array(
- 'value' => $value,
- 'size' => 1 + $ln, // size in bytes of data structure
- );
- }
-
-
- /**
- * Read byte string (16-bit string length)
- * OpenOffice documentation: 2.5.2
- *
- * @param string $subData
- * @return array
- */
- private function readByteStringLong($subData)
- {
- // offset: 0; size: 2; length of the string (character count)
- $ln = self::getInt2d($subData, 0);
-
- // offset: 2: size: var; character array (8-bit characters)
- $value = $this->decodeCodepage(substr($subData, 2));
-
- //return $string;
- return array(
- 'value' => $value,
- 'size' => 2 + $ln, // size in bytes of data structure
- );
- }
-
-
- /**
- * Extracts an Excel Unicode short string (8-bit string length)
- * OpenOffice documentation: 2.5.3
- * function will automatically find out where the Unicode string ends.
- *
- * @param string $subData
- * @return array
- */
- private static function readUnicodeStringShort($subData)
- {
- $value = '';
-
- // offset: 0: size: 1; length of the string (character count)
- $characterCount = ord($subData[0]);
-
- $string = self::readUnicodeString(substr($subData, 1), $characterCount);
-
- // add 1 for the string length
- $string['size'] += 1;
-
- return $string;
- }
-
-
- /**
- * Extracts an Excel Unicode long string (16-bit string length)
- * OpenOffice documentation: 2.5.3
- * this function is under construction, needs to support rich text, and Asian phonetic settings
- *
- * @param string $subData
- * @return array
- */
- private static function readUnicodeStringLong($subData)
- {
- $value = '';
-
- // offset: 0: size: 2; length of the string (character count)
- $characterCount = self::getInt2d($subData, 0);
-
- $string = self::readUnicodeString(substr($subData, 2), $characterCount);
-
- // add 2 for the string length
- $string['size'] += 2;
-
- return $string;
- }
-
-
- /**
- * Read Unicode string with no string length field, but with known character count
- * this function is under construction, needs to support rich text, and Asian phonetic settings
- * OpenOffice.org's Documentation of the Microsoft Excel File Format, section 2.5.3
- *
- * @param string $subData
- * @param int $characterCount
- * @return array
- */
- private static function readUnicodeString($subData, $characterCount)
- {
- $value = '';
-
- // offset: 0: size: 1; option flags
- // bit: 0; mask: 0x01; character compression (0 = compressed 8-bit, 1 = uncompressed 16-bit)
- $isCompressed = !((0x01 & ord($subData[0])) >> 0);
-
- // bit: 2; mask: 0x04; Asian phonetic settings
- $hasAsian = (0x04) & ord($subData[0]) >> 2;
-
- // bit: 3; mask: 0x08; Rich-Text settings
- $hasRichText = (0x08) & ord($subData[0]) >> 3;
-
- // offset: 1: size: var; character array
- // this offset assumes richtext and Asian phonetic settings are off which is generally wrong
- // needs to be fixed
- $value = self::encodeUTF16(substr($subData, 1, $isCompressed ? $characterCount : 2 * $characterCount), $isCompressed);
-
- return array(
- 'value' => $value,
- 'size' => $isCompressed ? 1 + $characterCount : 1 + 2 * $characterCount, // the size in bytes including the option flags
- );
- }
-
-
- /**
- * Convert UTF-8 string to string surounded by double quotes. Used for explicit string tokens in formulas.
- * Example: hello"world --> "hello""world"
- *
- * @param string $value UTF-8 encoded string
- * @return string
- */
- private static function UTF8toExcelDoubleQuoted($value)
- {
- return '"' . str_replace('"', '""', $value) . '"';
- }
-
-
- /**
- * Reads first 8 bytes of a string and return IEEE 754 float
- *
- * @param string $data Binary string that is at least 8 bytes long
- * @return float
- */
- private static function extractNumber($data)
- {
- $rknumhigh = self::getInt4d($data, 4);
- $rknumlow = self::getInt4d($data, 0);
- $sign = ($rknumhigh & 0x80000000) >> 31;
- $exp = (($rknumhigh & 0x7ff00000) >> 20) - 1023;
- $mantissa = (0x100000 | ($rknumhigh & 0x000fffff));
- $mantissalow1 = ($rknumlow & 0x80000000) >> 31;
- $mantissalow2 = ($rknumlow & 0x7fffffff);
- $value = $mantissa / pow(2, (20 - $exp));
-
- if ($mantissalow1 != 0) {
- $value += 1 / pow(2, (21 - $exp));
- }
-
- $value += $mantissalow2 / pow(2, (52 - $exp));
- if ($sign) {
- $value *= -1;
- }
-
- return $value;
- }
-
-
- private static function getIEEE754($rknum)
- {
- if (($rknum & 0x02) != 0) {
- $value = $rknum >> 2;
- } else {
- // changes by mmp, info on IEEE754 encoding from
- // research.microsoft.com/~hollasch/cgindex/coding/ieeefloat.html
- // The RK format calls for using only the most significant 30 bits
- // of the 64 bit floating point value. The other 34 bits are assumed
- // to be 0 so we use the upper 30 bits of $rknum as follows...
- $sign = ($rknum & 0x80000000) >> 31;
- $exp = ($rknum & 0x7ff00000) >> 20;
- $mantissa = (0x100000 | ($rknum & 0x000ffffc));
- $value = $mantissa / pow(2, (20- ($exp - 1023)));
- if ($sign) {
- $value = -1 * $value;
- }
- //end of changes by mmp
- }
- if (($rknum & 0x01) != 0) {
- $value /= 100;
- }
- return $value;
- }
-
-
- /**
- * Get UTF-8 string from (compressed or uncompressed) UTF-16 string
- *
- * @param string $string
- * @param bool $compressed
- * @return string
- */
- private static function encodeUTF16($string, $compressed = '')
- {
- if ($compressed) {
- $string = self::uncompressByteString($string);
- }
-
- return PHPExcel_Shared_String::ConvertEncoding($string, 'UTF-8', 'UTF-16LE');
- }
-
-
- /**
- * Convert UTF-16 string in compressed notation to uncompressed form. Only used for BIFF8.
- *
- * @param string $string
- * @return string
- */
- private static function uncompressByteString($string)
- {
- $uncompressedString = '';
- $strLen = strlen($string);
- for ($i = 0; $i < $strLen; ++$i) {
- $uncompressedString .= $string[$i] . "\0";
- }
-
- return $uncompressedString;
- }
-
-
- /**
- * Convert string to UTF-8. Only used for BIFF5.
- *
- * @param string $string
- * @return string
- */
- private function decodeCodepage($string)
- {
- return PHPExcel_Shared_String::ConvertEncoding($string, 'UTF-8', $this->codepage);
- }
-
-
- /**
- * Read 16-bit unsigned integer
- *
- * @param string $data
- * @param int $pos
- * @return int
- */
- public static function getInt2d($data, $pos)
- {
- return ord($data[$pos]) | (ord($data[$pos+1]) << 8);
- }
-
-
- /**
- * Read 32-bit signed integer
- *
- * @param string $data
- * @param int $pos
- * @return int
- */
- public static function getInt4d($data, $pos)
- {
- // FIX: represent numbers correctly on 64-bit system
- // http://sourceforge.net/tracker/index.php?func=detail&aid=1487372&group_id=99160&atid=623334
- // Hacked by Andreas Rehm 2006 to ensure correct result of the <<24 block on 32 and 64bit systems
- $_or_24 = ord($data[$pos + 3]);
- if ($_or_24 >= 128) {
- // negative number
- $_ord_24 = -abs((256 - $_or_24) << 24);
- } else {
- $_ord_24 = ($_or_24 & 127) << 24;
- }
- return ord($data[$pos]) | (ord($data[$pos+1]) << 8) | (ord($data[$pos+2]) << 16) | $_ord_24;
- }
-
-
- /**
- * Read color
- *
- * @param int $color Indexed color
- * @param array $palette Color palette
- * @return array RGB color value, example: array('rgb' => 'FF0000')
- */
- private static function readColor($color, $palette, $version)
- {
- if ($color <= 0x07 || $color >= 0x40) {
- // special built-in color
- return self::mapBuiltInColor($color);
- } elseif (isset($palette) && isset($palette[$color - 8])) {
- // palette color, color index 0x08 maps to pallete index 0
- return $palette[$color - 8];
- } else {
- // default color table
- if ($version == self::XLS_BIFF8) {
- return self::mapColor($color);
- } else {
- // BIFF5
- return self::mapColorBIFF5($color);
- }
- }
-
- return $color;
- }
-
-
- /**
- * Map border style
- * OpenOffice documentation: 2.5.11
- *
- * @param int $index
- * @return string
- */
- private static function mapBorderStyle($index)
- {
- switch ($index) {
- case 0x00:
- return PHPExcel_Style_Border::BORDER_NONE;
- case 0x01:
- return PHPExcel_Style_Border::BORDER_THIN;
- case 0x02:
- return PHPExcel_Style_Border::BORDER_MEDIUM;
- case 0x03:
- return PHPExcel_Style_Border::BORDER_DASHED;
- case 0x04:
- return PHPExcel_Style_Border::BORDER_DOTTED;
- case 0x05:
- return PHPExcel_Style_Border::BORDER_THICK;
- case 0x06:
- return PHPExcel_Style_Border::BORDER_DOUBLE;
- case 0x07:
- return PHPExcel_Style_Border::BORDER_HAIR;
- case 0x08:
- return PHPExcel_Style_Border::BORDER_MEDIUMDASHED;
- case 0x09:
- return PHPExcel_Style_Border::BORDER_DASHDOT;
- case 0x0A:
- return PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT;
- case 0x0B:
- return PHPExcel_Style_Border::BORDER_DASHDOTDOT;
- case 0x0C:
- return PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT;
- case 0x0D:
- return PHPExcel_Style_Border::BORDER_SLANTDASHDOT;
- default:
- return PHPExcel_Style_Border::BORDER_NONE;
- }
- }
-
-
- /**
- * Get fill pattern from index
- * OpenOffice documentation: 2.5.12
- *
- * @param int $index
- * @return string
- */
- private static function mapFillPattern($index)
- {
- switch ($index) {
- case 0x00:
- return PHPExcel_Style_Fill::FILL_NONE;
- case 0x01:
- return PHPExcel_Style_Fill::FILL_SOLID;
- case 0x02:
- return PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY;
- case 0x03:
- return PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY;
- case 0x04:
- return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY;
- case 0x05:
- return PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL;
- case 0x06:
- return PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL;
- case 0x07:
- return PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN;
- case 0x08:
- return PHPExcel_Style_Fill::FILL_PATTERN_DARKUP;
- case 0x09:
- return PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID;
- case 0x0A:
- return PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS;
- case 0x0B:
- return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL;
- case 0x0C:
- return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL;
- case 0x0D:
- return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN;
- case 0x0E:
- return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP;
- case 0x0F:
- return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID;
- case 0x10:
- return PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS;
- case 0x11:
- return PHPExcel_Style_Fill::FILL_PATTERN_GRAY125;
- case 0x12:
- return PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625;
- default:
- return PHPExcel_Style_Fill::FILL_NONE;
- }
- }
-
-
- /**
- * Map error code, e.g. '#N/A'
- *
- * @param int $subData
- * @return string
- */
- private static function mapErrorCode($subData)
- {
- switch ($subData) {
- case 0x00:
- return '#NULL!';
- break;
- case 0x07:
- return '#DIV/0!';
- break;
- case 0x0F:
- return '#VALUE!';
- break;
- case 0x17:
- return '#REF!';
- break;
- case 0x1D:
- return '#NAME?';
- break;
- case 0x24:
- return '#NUM!';
- break;
- case 0x2A:
- return '#N/A';
- break;
- default:
- return false;
- }
- }
-
-
- /**
- * Map built-in color to RGB value
- *
- * @param int $color Indexed color
- * @return array
- */
- private static function mapBuiltInColor($color)
- {
- switch ($color) {
- case 0x00:
- return array('rgb' => '000000');
- case 0x01:
- return array('rgb' => 'FFFFFF');
- case 0x02:
- return array('rgb' => 'FF0000');
- case 0x03:
- return array('rgb' => '00FF00');
- case 0x04:
- return array('rgb' => '0000FF');
- case 0x05:
- return array('rgb' => 'FFFF00');
- case 0x06:
- return array('rgb' => 'FF00FF');
- case 0x07:
- return array('rgb' => '00FFFF');
- case 0x40:
- return array('rgb' => '000000'); // system window text color
- case 0x41:
- return array('rgb' => 'FFFFFF'); // system window background color
- default:
- return array('rgb' => '000000');
- }
- }
-
-
- /**
- * Map color array from BIFF5 built-in color index
- *
- * @param int $subData
- * @return array
- */
- private static function mapColorBIFF5($subData)
- {
- switch ($subData) {
- case 0x08:
- return array('rgb' => '000000');
- case 0x09:
- return array('rgb' => 'FFFFFF');
- case 0x0A:
- return array('rgb' => 'FF0000');
- case 0x0B:
- return array('rgb' => '00FF00');
- case 0x0C:
- return array('rgb' => '0000FF');
- case 0x0D:
- return array('rgb' => 'FFFF00');
- case 0x0E:
- return array('rgb' => 'FF00FF');
- case 0x0F:
- return array('rgb' => '00FFFF');
- case 0x10:
- return array('rgb' => '800000');
- case 0x11:
- return array('rgb' => '008000');
- case 0x12:
- return array('rgb' => '000080');
- case 0x13:
- return array('rgb' => '808000');
- case 0x14:
- return array('rgb' => '800080');
- case 0x15:
- return array('rgb' => '008080');
- case 0x16:
- return array('rgb' => 'C0C0C0');
- case 0x17:
- return array('rgb' => '808080');
- case 0x18:
- return array('rgb' => '8080FF');
- case 0x19:
- return array('rgb' => '802060');
- case 0x1A:
- return array('rgb' => 'FFFFC0');
- case 0x1B:
- return array('rgb' => 'A0E0F0');
- case 0x1C:
- return array('rgb' => '600080');
- case 0x1D:
- return array('rgb' => 'FF8080');
- case 0x1E:
- return array('rgb' => '0080C0');
- case 0x1F:
- return array('rgb' => 'C0C0FF');
- case 0x20:
- return array('rgb' => '000080');
- case 0x21:
- return array('rgb' => 'FF00FF');
- case 0x22:
- return array('rgb' => 'FFFF00');
- case 0x23:
- return array('rgb' => '00FFFF');
- case 0x24:
- return array('rgb' => '800080');
- case 0x25:
- return array('rgb' => '800000');
- case 0x26:
- return array('rgb' => '008080');
- case 0x27:
- return array('rgb' => '0000FF');
- case 0x28:
- return array('rgb' => '00CFFF');
- case 0x29:
- return array('rgb' => '69FFFF');
- case 0x2A:
- return array('rgb' => 'E0FFE0');
- case 0x2B:
- return array('rgb' => 'FFFF80');
- case 0x2C:
- return array('rgb' => 'A6CAF0');
- case 0x2D:
- return array('rgb' => 'DD9CB3');
- case 0x2E:
- return array('rgb' => 'B38FEE');
- case 0x2F:
- return array('rgb' => 'E3E3E3');
- case 0x30:
- return array('rgb' => '2A6FF9');
- case 0x31:
- return array('rgb' => '3FB8CD');
- case 0x32:
- return array('rgb' => '488436');
- case 0x33:
- return array('rgb' => '958C41');
- case 0x34:
- return array('rgb' => '8E5E42');
- case 0x35:
- return array('rgb' => 'A0627A');
- case 0x36:
- return array('rgb' => '624FAC');
- case 0x37:
- return array('rgb' => '969696');
- case 0x38:
- return array('rgb' => '1D2FBE');
- case 0x39:
- return array('rgb' => '286676');
- case 0x3A:
- return array('rgb' => '004500');
- case 0x3B:
- return array('rgb' => '453E01');
- case 0x3C:
- return array('rgb' => '6A2813');
- case 0x3D:
- return array('rgb' => '85396A');
- case 0x3E:
- return array('rgb' => '4A3285');
- case 0x3F:
- return array('rgb' => '424242');
- default:
- return array('rgb' => '000000');
- }
- }
-
-
- /**
- * Map color array from BIFF8 built-in color index
- *
- * @param int $subData
- * @return array
- */
- private static function mapColor($subData)
- {
- switch ($subData) {
- case 0x08:
- return array('rgb' => '000000');
- case 0x09:
- return array('rgb' => 'FFFFFF');
- case 0x0A:
- return array('rgb' => 'FF0000');
- case 0x0B:
- return array('rgb' => '00FF00');
- case 0x0C:
- return array('rgb' => '0000FF');
- case 0x0D:
- return array('rgb' => 'FFFF00');
- case 0x0E:
- return array('rgb' => 'FF00FF');
- case 0x0F:
- return array('rgb' => '00FFFF');
- case 0x10:
- return array('rgb' => '800000');
- case 0x11:
- return array('rgb' => '008000');
- case 0x12:
- return array('rgb' => '000080');
- case 0x13:
- return array('rgb' => '808000');
- case 0x14:
- return array('rgb' => '800080');
- case 0x15:
- return array('rgb' => '008080');
- case 0x16:
- return array('rgb' => 'C0C0C0');
- case 0x17:
- return array('rgb' => '808080');
- case 0x18:
- return array('rgb' => '9999FF');
- case 0x19:
- return array('rgb' => '993366');
- case 0x1A:
- return array('rgb' => 'FFFFCC');
- case 0x1B:
- return array('rgb' => 'CCFFFF');
- case 0x1C:
- return array('rgb' => '660066');
- case 0x1D:
- return array('rgb' => 'FF8080');
- case 0x1E:
- return array('rgb' => '0066CC');
- case 0x1F:
- return array('rgb' => 'CCCCFF');
- case 0x20:
- return array('rgb' => '000080');
- case 0x21:
- return array('rgb' => 'FF00FF');
- case 0x22:
- return array('rgb' => 'FFFF00');
- case 0x23:
- return array('rgb' => '00FFFF');
- case 0x24:
- return array('rgb' => '800080');
- case 0x25:
- return array('rgb' => '800000');
- case 0x26:
- return array('rgb' => '008080');
- case 0x27:
- return array('rgb' => '0000FF');
- case 0x28:
- return array('rgb' => '00CCFF');
- case 0x29:
- return array('rgb' => 'CCFFFF');
- case 0x2A:
- return array('rgb' => 'CCFFCC');
- case 0x2B:
- return array('rgb' => 'FFFF99');
- case 0x2C:
- return array('rgb' => '99CCFF');
- case 0x2D:
- return array('rgb' => 'FF99CC');
- case 0x2E:
- return array('rgb' => 'CC99FF');
- case 0x2F:
- return array('rgb' => 'FFCC99');
- case 0x30:
- return array('rgb' => '3366FF');
- case 0x31:
- return array('rgb' => '33CCCC');
- case 0x32:
- return array('rgb' => '99CC00');
- case 0x33:
- return array('rgb' => 'FFCC00');
- case 0x34:
- return array('rgb' => 'FF9900');
- case 0x35:
- return array('rgb' => 'FF6600');
- case 0x36:
- return array('rgb' => '666699');
- case 0x37:
- return array('rgb' => '969696');
- case 0x38:
- return array('rgb' => '003366');
- case 0x39:
- return array('rgb' => '339966');
- case 0x3A:
- return array('rgb' => '003300');
- case 0x3B:
- return array('rgb' => '333300');
- case 0x3C:
- return array('rgb' => '993300');
- case 0x3D:
- return array('rgb' => '993366');
- case 0x3E:
- return array('rgb' => '333399');
- case 0x3F:
- return array('rgb' => '333333');
- default:
- return array('rgb' => '000000');
- }
- }
-
- private function parseRichText($is = '')
- {
- $value = new PHPExcel_RichText();
- $value->createText($is);
-
- return $value;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Reader/Excel5/Escher.php b/lib/phpexcel/PHPExcel/Reader/Excel5/Escher.php
deleted file mode 100644
index 2b99e222354..00000000000
--- a/lib/phpexcel/PHPExcel/Reader/Excel5/Escher.php
+++ /dev/null
@@ -1,669 +0,0 @@
-object = $object;
- }
-
- /**
- * Load Escher stream data. May be a partial Escher stream.
- *
- * @param string $data
- */
- public function load($data)
- {
- $this->data = $data;
-
- // total byte size of Excel data (workbook global substream + sheet substreams)
- $this->dataSize = strlen($this->data);
-
- $this->pos = 0;
-
- // Parse Escher stream
- while ($this->pos < $this->dataSize) {
- // offset: 2; size: 2: Record Type
- $fbt = PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos + 2);
-
- switch ($fbt) {
- case self::DGGCONTAINER:
- $this->readDggContainer();
- break;
- case self::DGG:
- $this->readDgg();
- break;
- case self::BSTORECONTAINER:
- $this->readBstoreContainer();
- break;
- case self::BSE:
- $this->readBSE();
- break;
- case self::BLIPJPEG:
- $this->readBlipJPEG();
- break;
- case self::BLIPPNG:
- $this->readBlipPNG();
- break;
- case self::OPT:
- $this->readOPT();
- break;
- case self::TERTIARYOPT:
- $this->readTertiaryOPT();
- break;
- case self::SPLITMENUCOLORS:
- $this->readSplitMenuColors();
- break;
- case self::DGCONTAINER:
- $this->readDgContainer();
- break;
- case self::DG:
- $this->readDg();
- break;
- case self::SPGRCONTAINER:
- $this->readSpgrContainer();
- break;
- case self::SPCONTAINER:
- $this->readSpContainer();
- break;
- case self::SPGR:
- $this->readSpgr();
- break;
- case self::SP:
- $this->readSp();
- break;
- case self::CLIENTTEXTBOX:
- $this->readClientTextbox();
- break;
- case self::CLIENTANCHOR:
- $this->readClientAnchor();
- break;
- case self::CLIENTDATA:
- $this->readClientData();
- break;
- default:
- $this->readDefault();
- break;
- }
- }
-
- return $this->object;
- }
-
- /**
- * Read a generic record
- */
- private function readDefault()
- {
- // offset 0; size: 2; recVer and recInstance
- $verInstance = PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos);
-
- // offset: 2; size: 2: Record Type
- $fbt = PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos + 2);
-
- // bit: 0-3; mask: 0x000F; recVer
- $recVer = (0x000F & $verInstance) >> 0;
-
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
- }
-
- /**
- * Read DggContainer record (Drawing Group Container)
- */
- private function readDggContainer()
- {
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
-
- // record is a container, read contents
- $dggContainer = new PHPExcel_Shared_Escher_DggContainer();
- $this->object->setDggContainer($dggContainer);
- $reader = new PHPExcel_Reader_Excel5_Escher($dggContainer);
- $reader->load($recordData);
- }
-
- /**
- * Read Dgg record (Drawing Group)
- */
- private function readDgg()
- {
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
- }
-
- /**
- * Read BstoreContainer record (Blip Store Container)
- */
- private function readBstoreContainer()
- {
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
-
- // record is a container, read contents
- $bstoreContainer = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer();
- $this->object->setBstoreContainer($bstoreContainer);
- $reader = new PHPExcel_Reader_Excel5_Escher($bstoreContainer);
- $reader->load($recordData);
- }
-
- /**
- * Read BSE record
- */
- private function readBSE()
- {
- // offset: 0; size: 2; recVer and recInstance
-
- // bit: 4-15; mask: 0xFFF0; recInstance
- $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4;
-
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
-
- // add BSE to BstoreContainer
- $BSE = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE();
- $this->object->addBSE($BSE);
-
- $BSE->setBLIPType($recInstance);
-
- // offset: 0; size: 1; btWin32 (MSOBLIPTYPE)
- $btWin32 = ord($recordData[0]);
-
- // offset: 1; size: 1; btWin32 (MSOBLIPTYPE)
- $btMacOS = ord($recordData[1]);
-
- // offset: 2; size: 16; MD4 digest
- $rgbUid = substr($recordData, 2, 16);
-
- // offset: 18; size: 2; tag
- $tag = PHPExcel_Reader_Excel5::getInt2d($recordData, 18);
-
- // offset: 20; size: 4; size of BLIP in bytes
- $size = PHPExcel_Reader_Excel5::getInt4d($recordData, 20);
-
- // offset: 24; size: 4; number of references to this BLIP
- $cRef = PHPExcel_Reader_Excel5::getInt4d($recordData, 24);
-
- // offset: 28; size: 4; MSOFO file offset
- $foDelay = PHPExcel_Reader_Excel5::getInt4d($recordData, 28);
-
- // offset: 32; size: 1; unused1
- $unused1 = ord($recordData{32});
-
- // offset: 33; size: 1; size of nameData in bytes (including null terminator)
- $cbName = ord($recordData{33});
-
- // offset: 34; size: 1; unused2
- $unused2 = ord($recordData{34});
-
- // offset: 35; size: 1; unused3
- $unused3 = ord($recordData{35});
-
- // offset: 36; size: $cbName; nameData
- $nameData = substr($recordData, 36, $cbName);
-
- // offset: 36 + $cbName, size: var; the BLIP data
- $blipData = substr($recordData, 36 + $cbName);
-
- // record is a container, read contents
- $reader = new PHPExcel_Reader_Excel5_Escher($BSE);
- $reader->load($blipData);
- }
-
- /**
- * Read BlipJPEG record. Holds raw JPEG image data
- */
- private function readBlipJPEG()
- {
- // offset: 0; size: 2; recVer and recInstance
-
- // bit: 4-15; mask: 0xFFF0; recInstance
- $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4;
-
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
-
- $pos = 0;
-
- // offset: 0; size: 16; rgbUid1 (MD4 digest of)
- $rgbUid1 = substr($recordData, 0, 16);
- $pos += 16;
-
- // offset: 16; size: 16; rgbUid2 (MD4 digest), only if $recInstance = 0x46B or 0x6E3
- if (in_array($recInstance, array(0x046B, 0x06E3))) {
- $rgbUid2 = substr($recordData, 16, 16);
- $pos += 16;
- }
-
- // offset: var; size: 1; tag
- $tag = ord($recordData{$pos});
- $pos += 1;
-
- // offset: var; size: var; the raw image data
- $data = substr($recordData, $pos);
-
- $blip = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip();
- $blip->setData($data);
-
- $this->object->setBlip($blip);
- }
-
- /**
- * Read BlipPNG record. Holds raw PNG image data
- */
- private function readBlipPNG()
- {
- // offset: 0; size: 2; recVer and recInstance
-
- // bit: 4-15; mask: 0xFFF0; recInstance
- $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4;
-
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
-
- $pos = 0;
-
- // offset: 0; size: 16; rgbUid1 (MD4 digest of)
- $rgbUid1 = substr($recordData, 0, 16);
- $pos += 16;
-
- // offset: 16; size: 16; rgbUid2 (MD4 digest), only if $recInstance = 0x46B or 0x6E3
- if ($recInstance == 0x06E1) {
- $rgbUid2 = substr($recordData, 16, 16);
- $pos += 16;
- }
-
- // offset: var; size: 1; tag
- $tag = ord($recordData{$pos});
- $pos += 1;
-
- // offset: var; size: var; the raw image data
- $data = substr($recordData, $pos);
-
- $blip = new PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip();
- $blip->setData($data);
-
- $this->object->setBlip($blip);
- }
-
- /**
- * Read OPT record. This record may occur within DggContainer record or SpContainer
- */
- private function readOPT()
- {
- // offset: 0; size: 2; recVer and recInstance
-
- // bit: 4-15; mask: 0xFFF0; recInstance
- $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4;
-
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
-
- $this->readOfficeArtRGFOPTE($recordData, $recInstance);
- }
-
- /**
- * Read TertiaryOPT record
- */
- private function readTertiaryOPT()
- {
- // offset: 0; size: 2; recVer and recInstance
-
- // bit: 4-15; mask: 0xFFF0; recInstance
- $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4;
-
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
- }
-
- /**
- * Read SplitMenuColors record
- */
- private function readSplitMenuColors()
- {
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
- }
-
- /**
- * Read DgContainer record (Drawing Container)
- */
- private function readDgContainer()
- {
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
-
- // record is a container, read contents
- $dgContainer = new PHPExcel_Shared_Escher_DgContainer();
- $this->object->setDgContainer($dgContainer);
- $reader = new PHPExcel_Reader_Excel5_Escher($dgContainer);
- $escher = $reader->load($recordData);
- }
-
- /**
- * Read Dg record (Drawing)
- */
- private function readDg()
- {
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
- }
-
- /**
- * Read SpgrContainer record (Shape Group Container)
- */
- private function readSpgrContainer()
- {
- // context is either context DgContainer or SpgrContainer
-
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
-
- // record is a container, read contents
- $spgrContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer();
-
- if ($this->object instanceof PHPExcel_Shared_Escher_DgContainer) {
- // DgContainer
- $this->object->setSpgrContainer($spgrContainer);
- } else {
- // SpgrContainer
- $this->object->addChild($spgrContainer);
- }
-
- $reader = new PHPExcel_Reader_Excel5_Escher($spgrContainer);
- $escher = $reader->load($recordData);
- }
-
- /**
- * Read SpContainer record (Shape Container)
- */
- private function readSpContainer()
- {
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // add spContainer to spgrContainer
- $spContainer = new PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer();
- $this->object->addChild($spContainer);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
-
- // record is a container, read contents
- $reader = new PHPExcel_Reader_Excel5_Escher($spContainer);
- $escher = $reader->load($recordData);
- }
-
- /**
- * Read Spgr record (Shape Group)
- */
- private function readSpgr()
- {
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
- }
-
- /**
- * Read Sp record (Shape)
- */
- private function readSp()
- {
- // offset: 0; size: 2; recVer and recInstance
-
- // bit: 4-15; mask: 0xFFF0; recInstance
- $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4;
-
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
- }
-
- /**
- * Read ClientTextbox record
- */
- private function readClientTextbox()
- {
- // offset: 0; size: 2; recVer and recInstance
-
- // bit: 4-15; mask: 0xFFF0; recInstance
- $recInstance = (0xFFF0 & PHPExcel_Reader_Excel5::getInt2d($this->data, $this->pos)) >> 4;
-
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
- }
-
- /**
- * Read ClientAnchor record. This record holds information about where the shape is anchored in worksheet
- */
- private function readClientAnchor()
- {
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
-
- // offset: 2; size: 2; upper-left corner column index (0-based)
- $c1 = PHPExcel_Reader_Excel5::getInt2d($recordData, 2);
-
- // offset: 4; size: 2; upper-left corner horizontal offset in 1/1024 of column width
- $startOffsetX = PHPExcel_Reader_Excel5::getInt2d($recordData, 4);
-
- // offset: 6; size: 2; upper-left corner row index (0-based)
- $r1 = PHPExcel_Reader_Excel5::getInt2d($recordData, 6);
-
- // offset: 8; size: 2; upper-left corner vertical offset in 1/256 of row height
- $startOffsetY = PHPExcel_Reader_Excel5::getInt2d($recordData, 8);
-
- // offset: 10; size: 2; bottom-right corner column index (0-based)
- $c2 = PHPExcel_Reader_Excel5::getInt2d($recordData, 10);
-
- // offset: 12; size: 2; bottom-right corner horizontal offset in 1/1024 of column width
- $endOffsetX = PHPExcel_Reader_Excel5::getInt2d($recordData, 12);
-
- // offset: 14; size: 2; bottom-right corner row index (0-based)
- $r2 = PHPExcel_Reader_Excel5::getInt2d($recordData, 14);
-
- // offset: 16; size: 2; bottom-right corner vertical offset in 1/256 of row height
- $endOffsetY = PHPExcel_Reader_Excel5::getInt2d($recordData, 16);
-
- // set the start coordinates
- $this->object->setStartCoordinates(PHPExcel_Cell::stringFromColumnIndex($c1) . ($r1 + 1));
-
- // set the start offsetX
- $this->object->setStartOffsetX($startOffsetX);
-
- // set the start offsetY
- $this->object->setStartOffsetY($startOffsetY);
-
- // set the end coordinates
- $this->object->setEndCoordinates(PHPExcel_Cell::stringFromColumnIndex($c2) . ($r2 + 1));
-
- // set the end offsetX
- $this->object->setEndOffsetX($endOffsetX);
-
- // set the end offsetY
- $this->object->setEndOffsetY($endOffsetY);
- }
-
- /**
- * Read ClientData record
- */
- private function readClientData()
- {
- $length = PHPExcel_Reader_Excel5::getInt4d($this->data, $this->pos + 4);
- $recordData = substr($this->data, $this->pos + 8, $length);
-
- // move stream pointer to next record
- $this->pos += 8 + $length;
- }
-
- /**
- * Read OfficeArtRGFOPTE table of property-value pairs
- *
- * @param string $data Binary data
- * @param int $n Number of properties
- */
- private function readOfficeArtRGFOPTE($data, $n)
- {
- $splicedComplexData = substr($data, 6 * $n);
-
- // loop through property-value pairs
- for ($i = 0; $i < $n; ++$i) {
- // read 6 bytes at a time
- $fopte = substr($data, 6 * $i, 6);
-
- // offset: 0; size: 2; opid
- $opid = PHPExcel_Reader_Excel5::getInt2d($fopte, 0);
-
- // bit: 0-13; mask: 0x3FFF; opid.opid
- $opidOpid = (0x3FFF & $opid) >> 0;
-
- // bit: 14; mask 0x4000; 1 = value in op field is BLIP identifier
- $opidFBid = (0x4000 & $opid) >> 14;
-
- // bit: 15; mask 0x8000; 1 = this is a complex property, op field specifies size of complex data
- $opidFComplex = (0x8000 & $opid) >> 15;
-
- // offset: 2; size: 4; the value for this property
- $op = PHPExcel_Reader_Excel5::getInt4d($fopte, 2);
-
- if ($opidFComplex) {
- $complexData = substr($splicedComplexData, 0, $op);
- $splicedComplexData = substr($splicedComplexData, $op);
-
- // we store string value with complex data
- $value = $complexData;
- } else {
- // we store integer value
- $value = $op;
- }
-
- $this->object->setOPT($opidOpid, $value);
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Reader/Excel5/MD5.php b/lib/phpexcel/PHPExcel/Reader/Excel5/MD5.php
deleted file mode 100644
index f14ea946956..00000000000
--- a/lib/phpexcel/PHPExcel/Reader/Excel5/MD5.php
+++ /dev/null
@@ -1,203 +0,0 @@
-reset();
- }
-
- /**
- * Reset the MD5 stream context
- */
- public function reset()
- {
- $this->a = 0x67452301;
- $this->b = 0xEFCDAB89;
- $this->c = 0x98BADCFE;
- $this->d = 0x10325476;
- }
-
- /**
- * Get MD5 stream context
- *
- * @return string
- */
- public function getContext()
- {
- $s = '';
- foreach (array('a', 'b', 'c', 'd') as $i) {
- $v = $this->{$i};
- $s .= chr($v & 0xff);
- $s .= chr(($v >> 8) & 0xff);
- $s .= chr(($v >> 16) & 0xff);
- $s .= chr(($v >> 24) & 0xff);
- }
-
- return $s;
- }
-
- /**
- * Add data to context
- *
- * @param string $data Data to add
- */
- public function add($data)
- {
- $words = array_values(unpack('V16', $data));
-
- $A = $this->a;
- $B = $this->b;
- $C = $this->c;
- $D = $this->d;
-
- $F = array('PHPExcel_Reader_Excel5_MD5','f');
- $G = array('PHPExcel_Reader_Excel5_MD5','g');
- $H = array('PHPExcel_Reader_Excel5_MD5','h');
- $I = array('PHPExcel_Reader_Excel5_MD5','i');
-
- /* ROUND 1 */
- self::step($F, $A, $B, $C, $D, $words[0], 7, 0xd76aa478);
- self::step($F, $D, $A, $B, $C, $words[1], 12, 0xe8c7b756);
- self::step($F, $C, $D, $A, $B, $words[2], 17, 0x242070db);
- self::step($F, $B, $C, $D, $A, $words[3], 22, 0xc1bdceee);
- self::step($F, $A, $B, $C, $D, $words[4], 7, 0xf57c0faf);
- self::step($F, $D, $A, $B, $C, $words[5], 12, 0x4787c62a);
- self::step($F, $C, $D, $A, $B, $words[6], 17, 0xa8304613);
- self::step($F, $B, $C, $D, $A, $words[7], 22, 0xfd469501);
- self::step($F, $A, $B, $C, $D, $words[8], 7, 0x698098d8);
- self::step($F, $D, $A, $B, $C, $words[9], 12, 0x8b44f7af);
- self::step($F, $C, $D, $A, $B, $words[10], 17, 0xffff5bb1);
- self::step($F, $B, $C, $D, $A, $words[11], 22, 0x895cd7be);
- self::step($F, $A, $B, $C, $D, $words[12], 7, 0x6b901122);
- self::step($F, $D, $A, $B, $C, $words[13], 12, 0xfd987193);
- self::step($F, $C, $D, $A, $B, $words[14], 17, 0xa679438e);
- self::step($F, $B, $C, $D, $A, $words[15], 22, 0x49b40821);
-
- /* ROUND 2 */
- self::step($G, $A, $B, $C, $D, $words[1], 5, 0xf61e2562);
- self::step($G, $D, $A, $B, $C, $words[6], 9, 0xc040b340);
- self::step($G, $C, $D, $A, $B, $words[11], 14, 0x265e5a51);
- self::step($G, $B, $C, $D, $A, $words[0], 20, 0xe9b6c7aa);
- self::step($G, $A, $B, $C, $D, $words[5], 5, 0xd62f105d);
- self::step($G, $D, $A, $B, $C, $words[10], 9, 0x02441453);
- self::step($G, $C, $D, $A, $B, $words[15], 14, 0xd8a1e681);
- self::step($G, $B, $C, $D, $A, $words[4], 20, 0xe7d3fbc8);
- self::step($G, $A, $B, $C, $D, $words[9], 5, 0x21e1cde6);
- self::step($G, $D, $A, $B, $C, $words[14], 9, 0xc33707d6);
- self::step($G, $C, $D, $A, $B, $words[3], 14, 0xf4d50d87);
- self::step($G, $B, $C, $D, $A, $words[8], 20, 0x455a14ed);
- self::step($G, $A, $B, $C, $D, $words[13], 5, 0xa9e3e905);
- self::step($G, $D, $A, $B, $C, $words[2], 9, 0xfcefa3f8);
- self::step($G, $C, $D, $A, $B, $words[7], 14, 0x676f02d9);
- self::step($G, $B, $C, $D, $A, $words[12], 20, 0x8d2a4c8a);
-
- /* ROUND 3 */
- self::step($H, $A, $B, $C, $D, $words[5], 4, 0xfffa3942);
- self::step($H, $D, $A, $B, $C, $words[8], 11, 0x8771f681);
- self::step($H, $C, $D, $A, $B, $words[11], 16, 0x6d9d6122);
- self::step($H, $B, $C, $D, $A, $words[14], 23, 0xfde5380c);
- self::step($H, $A, $B, $C, $D, $words[1], 4, 0xa4beea44);
- self::step($H, $D, $A, $B, $C, $words[4], 11, 0x4bdecfa9);
- self::step($H, $C, $D, $A, $B, $words[7], 16, 0xf6bb4b60);
- self::step($H, $B, $C, $D, $A, $words[10], 23, 0xbebfbc70);
- self::step($H, $A, $B, $C, $D, $words[13], 4, 0x289b7ec6);
- self::step($H, $D, $A, $B, $C, $words[0], 11, 0xeaa127fa);
- self::step($H, $C, $D, $A, $B, $words[3], 16, 0xd4ef3085);
- self::step($H, $B, $C, $D, $A, $words[6], 23, 0x04881d05);
- self::step($H, $A, $B, $C, $D, $words[9], 4, 0xd9d4d039);
- self::step($H, $D, $A, $B, $C, $words[12], 11, 0xe6db99e5);
- self::step($H, $C, $D, $A, $B, $words[15], 16, 0x1fa27cf8);
- self::step($H, $B, $C, $D, $A, $words[2], 23, 0xc4ac5665);
-
- /* ROUND 4 */
- self::step($I, $A, $B, $C, $D, $words[0], 6, 0xf4292244);
- self::step($I, $D, $A, $B, $C, $words[7], 10, 0x432aff97);
- self::step($I, $C, $D, $A, $B, $words[14], 15, 0xab9423a7);
- self::step($I, $B, $C, $D, $A, $words[5], 21, 0xfc93a039);
- self::step($I, $A, $B, $C, $D, $words[12], 6, 0x655b59c3);
- self::step($I, $D, $A, $B, $C, $words[3], 10, 0x8f0ccc92);
- self::step($I, $C, $D, $A, $B, $words[10], 15, 0xffeff47d);
- self::step($I, $B, $C, $D, $A, $words[1], 21, 0x85845dd1);
- self::step($I, $A, $B, $C, $D, $words[8], 6, 0x6fa87e4f);
- self::step($I, $D, $A, $B, $C, $words[15], 10, 0xfe2ce6e0);
- self::step($I, $C, $D, $A, $B, $words[6], 15, 0xa3014314);
- self::step($I, $B, $C, $D, $A, $words[13], 21, 0x4e0811a1);
- self::step($I, $A, $B, $C, $D, $words[4], 6, 0xf7537e82);
- self::step($I, $D, $A, $B, $C, $words[11], 10, 0xbd3af235);
- self::step($I, $C, $D, $A, $B, $words[2], 15, 0x2ad7d2bb);
- self::step($I, $B, $C, $D, $A, $words[9], 21, 0xeb86d391);
-
- $this->a = ($this->a + $A) & 0xffffffff;
- $this->b = ($this->b + $B) & 0xffffffff;
- $this->c = ($this->c + $C) & 0xffffffff;
- $this->d = ($this->d + $D) & 0xffffffff;
- }
-
- private static function f($X, $Y, $Z)
- {
- return (($X & $Y) | ((~ $X) & $Z)); // X AND Y OR NOT X AND Z
- }
-
- private static function g($X, $Y, $Z)
- {
- return (($X & $Z) | ($Y & (~ $Z))); // X AND Z OR Y AND NOT Z
- }
-
- private static function h($X, $Y, $Z)
- {
- return ($X ^ $Y ^ $Z); // X XOR Y XOR Z
- }
-
- private static function i($X, $Y, $Z)
- {
- return ($Y ^ ($X | (~ $Z))) ; // Y XOR (X OR NOT Z)
- }
-
- private static function step($func, &$A, $B, $C, $D, $M, $s, $t)
- {
- $A = ($A + call_user_func($func, $B, $C, $D) + $M + $t) & 0xffffffff;
- $A = self::rotate($A, $s);
- $A = ($B + $A) & 0xffffffff;
- }
-
- private static function rotate($decimal, $bits)
- {
- $binary = str_pad(decbin($decimal), 32, "0", STR_PAD_LEFT);
- return bindec(substr($binary, $bits).substr($binary, 0, $bits));
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Reader/Excel5/RC4.php b/lib/phpexcel/PHPExcel/Reader/Excel5/RC4.php
deleted file mode 100644
index 5640539cb96..00000000000
--- a/lib/phpexcel/PHPExcel/Reader/Excel5/RC4.php
+++ /dev/null
@@ -1,81 +0,0 @@
-i = 0; $this->i < 256; $this->i++) {
- $this->s[$this->i] = $this->i;
- }
-
- $this->j = 0;
- for ($this->i = 0; $this->i < 256; $this->i++) {
- $this->j = ($this->j + $this->s[$this->i] + ord($key[$this->i % $len])) % 256;
- $t = $this->s[$this->i];
- $this->s[$this->i] = $this->s[$this->j];
- $this->s[$this->j] = $t;
- }
- $this->i = $this->j = 0;
- }
-
- /**
- * Symmetric decryption/encryption function
- *
- * @param string $data Data to encrypt/decrypt
- *
- * @return string
- */
- public function RC4($data)
- {
- $len = strlen($data);
- for ($c = 0; $c < $len; $c++) {
- $this->i = ($this->i + 1) % 256;
- $this->j = ($this->j + $this->s[$this->i]) % 256;
- $t = $this->s[$this->i];
- $this->s[$this->i] = $this->s[$this->j];
- $this->s[$this->j] = $t;
-
- $t = ($this->s[$this->i] + $this->s[$this->j]) % 256;
-
- $data[$c] = chr(ord($data[$c]) ^ $this->s[$t]);
- }
- return $data;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Reader/Exception.php b/lib/phpexcel/PHPExcel/Reader/Exception.php
deleted file mode 100644
index 48b3f825356..00000000000
--- a/lib/phpexcel/PHPExcel/Reader/Exception.php
+++ /dev/null
@@ -1,46 +0,0 @@
-line = $line;
- $e->file = $file;
- throw $e;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Reader/HTML.php b/lib/phpexcel/PHPExcel/Reader/HTML.php
deleted file mode 100644
index a19eaec9dde..00000000000
--- a/lib/phpexcel/PHPExcel/Reader/HTML.php
+++ /dev/null
@@ -1,549 +0,0 @@
- array(
- 'font' => array(
- 'bold' => true,
- 'size' => 24,
- ),
- ), // Bold, 24pt
- 'h2' => array(
- 'font' => array(
- 'bold' => true,
- 'size' => 18,
- ),
- ), // Bold, 18pt
- 'h3' => array(
- 'font' => array(
- 'bold' => true,
- 'size' => 13.5,
- ),
- ), // Bold, 13.5pt
- 'h4' => array(
- 'font' => array(
- 'bold' => true,
- 'size' => 12,
- ),
- ), // Bold, 12pt
- 'h5' => array(
- 'font' => array(
- 'bold' => true,
- 'size' => 10,
- ),
- ), // Bold, 10pt
- 'h6' => array(
- 'font' => array(
- 'bold' => true,
- 'size' => 7.5,
- ),
- ), // Bold, 7.5pt
- 'a' => array(
- 'font' => array(
- 'underline' => true,
- 'color' => array(
- 'argb' => PHPExcel_Style_Color::COLOR_BLUE,
- ),
- ),
- ), // Blue underlined
- 'hr' => array(
- 'borders' => array(
- 'bottom' => array(
- 'style' => PHPExcel_Style_Border::BORDER_THIN,
- 'color' => array(
- PHPExcel_Style_Color::COLOR_BLACK,
- ),
- ),
- ),
- ), // Bottom border
- );
-
- protected $rowspan = array();
-
- /**
- * Create a new PHPExcel_Reader_HTML
- */
- public function __construct()
- {
- $this->readFilter = new PHPExcel_Reader_DefaultReadFilter();
- }
-
- /**
- * Validate that the current file is an HTML file
- *
- * @return boolean
- */
- protected function isValidFormat()
- {
- // Reading 2048 bytes should be enough to validate that the format is HTML
- $data = fread($this->fileHandle, 2048);
- if ((strpos($data, '<') !== false) &&
- (strlen($data) !== strlen(strip_tags($data)))) {
- return true;
- }
-
- return false;
- }
-
- /**
- * Loads PHPExcel from file
- *
- * @param string $pFilename
- * @return PHPExcel
- * @throws PHPExcel_Reader_Exception
- */
- public function load($pFilename)
- {
- // Create new PHPExcel
- $objPHPExcel = new PHPExcel();
-
- // Load into this instance
- return $this->loadIntoExisting($pFilename, $objPHPExcel);
- }
-
- /**
- * Set input encoding
- *
- * @param string $pValue Input encoding
- */
- public function setInputEncoding($pValue = 'ANSI')
- {
- $this->inputEncoding = $pValue;
-
- return $this;
- }
-
- /**
- * Get input encoding
- *
- * @return string
- */
- public function getInputEncoding()
- {
- return $this->inputEncoding;
- }
-
- // Data Array used for testing only, should write to PHPExcel object on completion of tests
- protected $dataArray = array();
- protected $tableLevel = 0;
- protected $nestedColumn = array('A');
-
- protected function setTableStartColumn($column)
- {
- if ($this->tableLevel == 0) {
- $column = 'A';
- }
- ++$this->tableLevel;
- $this->nestedColumn[$this->tableLevel] = $column;
-
- return $this->nestedColumn[$this->tableLevel];
- }
-
- protected function getTableStartColumn()
- {
- return $this->nestedColumn[$this->tableLevel];
- }
-
- protected function releaseTableStartColumn()
- {
- --$this->tableLevel;
-
- return array_pop($this->nestedColumn);
- }
-
- protected function flushCell($sheet, $column, $row, &$cellContent)
- {
- if (is_string($cellContent)) {
- // Simple String content
- if (trim($cellContent) > '') {
- // Only actually write it if there's content in the string
-// echo 'FLUSH CELL: ' , $column , $row , ' => ' , $cellContent , '
';
- // Write to worksheet to be done here...
- // ... we return the cell so we can mess about with styles more easily
- $sheet->setCellValue($column . $row, $cellContent, true);
- $this->dataArray[$row][$column] = $cellContent;
- }
- } else {
- // We have a Rich Text run
- // TODO
- $this->dataArray[$row][$column] = 'RICH TEXT: ' . $cellContent;
- }
- $cellContent = (string) '';
- }
-
- protected function processDomElement(DOMNode $element, $sheet, &$row, &$column, &$cellContent, $format = null)
- {
- foreach ($element->childNodes as $child) {
- if ($child instanceof DOMText) {
- $domText = preg_replace('/\s+/u', ' ', trim($child->nodeValue));
- if (is_string($cellContent)) {
- // simply append the text if the cell content is a plain text string
- $cellContent .= $domText;
- } else {
- // but if we have a rich text run instead, we need to append it correctly
- // TODO
- }
- } elseif ($child instanceof DOMElement) {
-// echo 'DOM ELEMENT: ' , strtoupper($child->nodeName) , '
';
-
- $attributeArray = array();
- foreach ($child->attributes as $attribute) {
-// echo 'ATTRIBUTE: ' , $attribute->name , ' => ' , $attribute->value , '
';
- $attributeArray[$attribute->name] = $attribute->value;
- }
-
- switch ($child->nodeName) {
- case 'meta':
- foreach ($attributeArray as $attributeName => $attributeValue) {
- switch ($attributeName) {
- case 'content':
- // TODO
- // Extract character set, so we can convert to UTF-8 if required
- break;
- }
- }
- $this->processDomElement($child, $sheet, $row, $column, $cellContent);
- break;
- case 'title':
- $this->processDomElement($child, $sheet, $row, $column, $cellContent);
- $sheet->setTitle($cellContent);
- $cellContent = '';
- break;
- case 'span':
- case 'div':
- case 'font':
- case 'i':
- case 'em':
- case 'strong':
- case 'b':
-// echo 'STYLING, SPAN OR DIV
';
- if ($cellContent > '') {
- $cellContent .= ' ';
- }
- $this->processDomElement($child, $sheet, $row, $column, $cellContent);
- if ($cellContent > '') {
- $cellContent .= ' ';
- }
-// echo 'END OF STYLING, SPAN OR DIV
';
- break;
- case 'hr':
- $this->flushCell($sheet, $column, $row, $cellContent);
- ++$row;
- if (isset($this->formats[$child->nodeName])) {
- $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
- } else {
- $cellContent = '----------';
- $this->flushCell($sheet, $column, $row, $cellContent);
- }
- ++$row;
- // Add a break after a horizontal rule, simply by allowing the code to dropthru
- case 'br':
- if ($this->tableLevel > 0) {
- // If we're inside a table, replace with a \n
- $cellContent .= "\n";
- } else {
- // Otherwise flush our existing content and move the row cursor on
- $this->flushCell($sheet, $column, $row, $cellContent);
- ++$row;
- }
-// echo 'HARD LINE BREAK: ' , '
';
- break;
- case 'a':
-// echo 'START OF HYPERLINK: ' , '
';
- foreach ($attributeArray as $attributeName => $attributeValue) {
- switch ($attributeName) {
- case 'href':
-// echo 'Link to ' , $attributeValue , '
';
- $sheet->getCell($column . $row)->getHyperlink()->setUrl($attributeValue);
- if (isset($this->formats[$child->nodeName])) {
- $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
- }
- break;
- }
- }
- $cellContent .= ' ';
- $this->processDomElement($child, $sheet, $row, $column, $cellContent);
-// echo 'END OF HYPERLINK:' , '
';
- break;
- case 'h1':
- case 'h2':
- case 'h3':
- case 'h4':
- case 'h5':
- case 'h6':
- case 'ol':
- case 'ul':
- case 'p':
- if ($this->tableLevel > 0) {
- // If we're inside a table, replace with a \n
- $cellContent .= "\n";
-// echo 'LIST ENTRY: ' , '
';
- $this->processDomElement($child, $sheet, $row, $column, $cellContent);
-// echo 'END OF LIST ENTRY:' , '
';
- } else {
- if ($cellContent > '') {
- $this->flushCell($sheet, $column, $row, $cellContent);
- $row++;
- }
-// echo 'START OF PARAGRAPH: ' , '
';
- $this->processDomElement($child, $sheet, $row, $column, $cellContent);
-// echo 'END OF PARAGRAPH:' , '
';
- $this->flushCell($sheet, $column, $row, $cellContent);
-
- if (isset($this->formats[$child->nodeName])) {
- $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
- }
-
- $row++;
- $column = 'A';
- }
- break;
- case 'li':
- if ($this->tableLevel > 0) {
- // If we're inside a table, replace with a \n
- $cellContent .= "\n";
-// echo 'LIST ENTRY: ' , '
';
- $this->processDomElement($child, $sheet, $row, $column, $cellContent);
-// echo 'END OF LIST ENTRY:' , '
';
- } else {
- if ($cellContent > '') {
- $this->flushCell($sheet, $column, $row, $cellContent);
- }
- ++$row;
-// echo 'LIST ENTRY: ' , '
';
- $this->processDomElement($child, $sheet, $row, $column, $cellContent);
-// echo 'END OF LIST ENTRY:' , '
';
- $this->flushCell($sheet, $column, $row, $cellContent);
- $column = 'A';
- }
- break;
- case 'table':
- $this->flushCell($sheet, $column, $row, $cellContent);
- $column = $this->setTableStartColumn($column);
-// echo 'START OF TABLE LEVEL ' , $this->tableLevel , '
';
- if ($this->tableLevel > 1) {
- --$row;
- }
- $this->processDomElement($child, $sheet, $row, $column, $cellContent);
-// echo 'END OF TABLE LEVEL ' , $this->tableLevel , '
';
- $column = $this->releaseTableStartColumn();
- if ($this->tableLevel > 1) {
- ++$column;
- } else {
- ++$row;
- }
- break;
- case 'thead':
- case 'tbody':
- $this->processDomElement($child, $sheet, $row, $column, $cellContent);
- break;
- case 'tr':
- $column = $this->getTableStartColumn();
- $cellContent = '';
-// echo 'START OF TABLE ' , $this->tableLevel , ' ROW
';
- $this->processDomElement($child, $sheet, $row, $column, $cellContent);
- ++$row;
-// echo 'END OF TABLE ' , $this->tableLevel , ' ROW
';
- break;
- case 'th':
- case 'td':
-// echo 'START OF TABLE ' , $this->tableLevel , ' CELL
';
- $this->processDomElement($child, $sheet, $row, $column, $cellContent);
-// echo 'END OF TABLE ' , $this->tableLevel , ' CELL
';
-
- while (isset($this->rowspan[$column . $row])) {
- ++$column;
- }
-
- $this->flushCell($sheet, $column, $row, $cellContent);
-
-// if (isset($attributeArray['style']) && !empty($attributeArray['style'])) {
-// $styleAry = $this->getPhpExcelStyleArray($attributeArray['style']);
-//
-// if (!empty($styleAry)) {
-// $sheet->getStyle($column . $row)->applyFromArray($styleAry);
-// }
-// }
-
- if (isset($attributeArray['rowspan']) && isset($attributeArray['colspan'])) {
- //create merging rowspan and colspan
- $columnTo = $column;
- for ($i = 0; $i < $attributeArray['colspan'] - 1; $i++) {
- ++$columnTo;
- }
- $range = $column . $row . ':' . $columnTo . ($row + $attributeArray['rowspan'] - 1);
- foreach (\PHPExcel_Cell::extractAllCellReferencesInRange($range) as $value) {
- $this->rowspan[$value] = true;
- }
- $sheet->mergeCells($range);
- $column = $columnTo;
- } elseif (isset($attributeArray['rowspan'])) {
- //create merging rowspan
- $range = $column . $row . ':' . $column . ($row + $attributeArray['rowspan'] - 1);
- foreach (\PHPExcel_Cell::extractAllCellReferencesInRange($range) as $value) {
- $this->rowspan[$value] = true;
- }
- $sheet->mergeCells($range);
- } elseif (isset($attributeArray['colspan'])) {
- //create merging colspan
- $columnTo = $column;
- for ($i = 0; $i < $attributeArray['colspan'] - 1; $i++) {
- ++$columnTo;
- }
- $sheet->mergeCells($column . $row . ':' . $columnTo . $row);
- $column = $columnTo;
- }
- ++$column;
- break;
- case 'body':
- $row = 1;
- $column = 'A';
- $content = '';
- $this->tableLevel = 0;
- $this->processDomElement($child, $sheet, $row, $column, $cellContent);
- break;
- default:
- $this->processDomElement($child, $sheet, $row, $column, $cellContent);
- }
- }
- }
- }
-
- /**
- * Loads PHPExcel from file into PHPExcel instance
- *
- * @param string $pFilename
- * @param PHPExcel $objPHPExcel
- * @return PHPExcel
- * @throws PHPExcel_Reader_Exception
- */
- public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
- {
- // Open file to validate
- $this->openFile($pFilename);
- if (!$this->isValidFormat()) {
- fclose($this->fileHandle);
- throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid HTML file.");
- }
- // Close after validating
- fclose($this->fileHandle);
-
- // Create new PHPExcel
- while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) {
- $objPHPExcel->createSheet();
- }
- $objPHPExcel->setActiveSheetIndex($this->sheetIndex);
-
- // Create a new DOM object
- $dom = new domDocument;
- // Reload the HTML file into the DOM object
- $loaded = $dom->loadHTML($this->securityScanFile($pFilename));
- if ($loaded === false) {
- throw new PHPExcel_Reader_Exception('Failed to load ', $pFilename, ' as a DOM Document');
- }
-
- // Discard white space
- $dom->preserveWhiteSpace = false;
-
- $row = 0;
- $column = 'A';
- $content = '';
- $this->processDomElement($dom, $objPHPExcel->getActiveSheet(), $row, $column, $content);
-
- // Return
- return $objPHPExcel;
- }
-
- /**
- * Get sheet index
- *
- * @return int
- */
- public function getSheetIndex()
- {
- return $this->sheetIndex;
- }
-
- /**
- * Set sheet index
- *
- * @param int $pValue Sheet index
- * @return PHPExcel_Reader_HTML
- */
- public function setSheetIndex($pValue = 0)
- {
- $this->sheetIndex = $pValue;
-
- return $this;
- }
-
- /**
- * Scan theXML for use of readFilter = new PHPExcel_Reader_DefaultReadFilter();
- }
-
- /**
- * Can the current PHPExcel_Reader_IReader read the file?
- *
- * @param string $pFilename
- * @return boolean
- * @throws PHPExcel_Reader_Exception
- */
- public function canRead($pFilename)
- {
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
-
- $zipClass = PHPExcel_Settings::getZipClass();
-
- // Check if zip class exists
-// if (!class_exists($zipClass, false)) {
-// throw new PHPExcel_Reader_Exception($zipClass . " library is not enabled");
-// }
-
- $mimeType = 'UNKNOWN';
- // Load file
- $zip = new $zipClass;
- if ($zip->open($pFilename) === true) {
- // check if it is an OOXML archive
- $stat = $zip->statName('mimetype');
- if ($stat && ($stat['size'] <= 255)) {
- $mimeType = $zip->getFromName($stat['name']);
- } elseif ($stat = $zip->statName('META-INF/manifest.xml')) {
- $xml = simplexml_load_string($this->securityScan($zip->getFromName('META-INF/manifest.xml')), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
- $namespacesContent = $xml->getNamespaces(true);
- if (isset($namespacesContent['manifest'])) {
- $manifest = $xml->children($namespacesContent['manifest']);
- foreach ($manifest as $manifestDataSet) {
- $manifestAttributes = $manifestDataSet->attributes($namespacesContent['manifest']);
- if ($manifestAttributes->{'full-path'} == '/') {
- $mimeType = (string) $manifestAttributes->{'media-type'};
- break;
- }
- }
- }
- }
-
- $zip->close();
-
- return ($mimeType === 'application/vnd.oasis.opendocument.spreadsheet');
- }
-
- return false;
- }
-
-
- /**
- * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object
- *
- * @param string $pFilename
- * @throws PHPExcel_Reader_Exception
- */
- public function listWorksheetNames($pFilename)
- {
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
-
- $zipClass = PHPExcel_Settings::getZipClass();
-
- $zip = new $zipClass;
- if (!$zip->open($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! Error opening file.");
- }
-
- $worksheetNames = array();
-
- $xml = new XMLReader();
- $res = $xml->xml($this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'), null, PHPExcel_Settings::getLibXmlLoaderOptions());
- $xml->setParserProperty(2, true);
-
- // Step into the first level of content of the XML
- $xml->read();
- while ($xml->read()) {
- // Quickly jump through to the office:body node
- while ($xml->name !== 'office:body') {
- if ($xml->isEmptyElement) {
- $xml->read();
- } else {
- $xml->next();
- }
- }
- // Now read each node until we find our first table:table node
- while ($xml->read()) {
- if ($xml->name == 'table:table' && $xml->nodeType == XMLReader::ELEMENT) {
- // Loop through each table:table node reading the table:name attribute for each worksheet name
- do {
- $worksheetNames[] = $xml->getAttribute('table:name');
- $xml->next();
- } while ($xml->name == 'table:table' && $xml->nodeType == XMLReader::ELEMENT);
- }
- }
- }
-
- return $worksheetNames;
- }
-
- /**
- * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)
- *
- * @param string $pFilename
- * @throws PHPExcel_Reader_Exception
- */
- public function listWorksheetInfo($pFilename)
- {
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
-
- $worksheetInfo = array();
-
- $zipClass = PHPExcel_Settings::getZipClass();
-
- $zip = new $zipClass;
- if (!$zip->open($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! Error opening file.");
- }
-
- $xml = new XMLReader();
- $res = $xml->xml($this->securityScanFile('zip://'.realpath($pFilename).'#content.xml'), null, PHPExcel_Settings::getLibXmlLoaderOptions());
- $xml->setParserProperty(2, true);
-
- // Step into the first level of content of the XML
- $xml->read();
- while ($xml->read()) {
- // Quickly jump through to the office:body node
- while ($xml->name !== 'office:body') {
- if ($xml->isEmptyElement) {
- $xml->read();
- } else {
- $xml->next();
- }
- }
- // Now read each node until we find our first table:table node
- while ($xml->read()) {
- if ($xml->name == 'table:table' && $xml->nodeType == XMLReader::ELEMENT) {
- $worksheetNames[] = $xml->getAttribute('table:name');
-
- $tmpInfo = array(
- 'worksheetName' => $xml->getAttribute('table:name'),
- 'lastColumnLetter' => 'A',
- 'lastColumnIndex' => 0,
- 'totalRows' => 0,
- 'totalColumns' => 0,
- );
-
- // Loop through each child node of the table:table element reading
- $currCells = 0;
- do {
- $xml->read();
- if ($xml->name == 'table:table-row' && $xml->nodeType == XMLReader::ELEMENT) {
- $rowspan = $xml->getAttribute('table:number-rows-repeated');
- $rowspan = empty($rowspan) ? 1 : $rowspan;
- $tmpInfo['totalRows'] += $rowspan;
- $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells);
- $currCells = 0;
- // Step into the row
- $xml->read();
- do {
- if ($xml->name == 'table:table-cell' && $xml->nodeType == XMLReader::ELEMENT) {
- if (!$xml->isEmptyElement) {
- $currCells++;
- $xml->next();
- } else {
- $xml->read();
- }
- } elseif ($xml->name == 'table:covered-table-cell' && $xml->nodeType == XMLReader::ELEMENT) {
- $mergeSize = $xml->getAttribute('table:number-columns-repeated');
- $currCells += $mergeSize;
- $xml->read();
- }
- } while ($xml->name != 'table:table-row');
- }
- } while ($xml->name != 'table:table');
-
- $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells);
- $tmpInfo['lastColumnIndex'] = $tmpInfo['totalColumns'] - 1;
- $tmpInfo['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
- $worksheetInfo[] = $tmpInfo;
- }
- }
-
-// foreach ($workbookData->table as $worksheetDataSet) {
-// $worksheetData = $worksheetDataSet->children($namespacesContent['table']);
-// $worksheetDataAttributes = $worksheetDataSet->attributes($namespacesContent['table']);
-//
-// $rowIndex = 0;
-// foreach ($worksheetData as $key => $rowData) {
-// switch ($key) {
-// case 'table-row' :
-// $rowDataTableAttributes = $rowData->attributes($namespacesContent['table']);
-// $rowRepeats = (isset($rowDataTableAttributes['number-rows-repeated'])) ?
-// $rowDataTableAttributes['number-rows-repeated'] : 1;
-// $columnIndex = 0;
-//
-// foreach ($rowData as $key => $cellData) {
-// $cellDataTableAttributes = $cellData->attributes($namespacesContent['table']);
-// $colRepeats = (isset($cellDataTableAttributes['number-columns-repeated'])) ?
-// $cellDataTableAttributes['number-columns-repeated'] : 1;
-// $cellDataOfficeAttributes = $cellData->attributes($namespacesContent['office']);
-// if (isset($cellDataOfficeAttributes['value-type'])) {
-// $tmpInfo['lastColumnIndex'] = max($tmpInfo['lastColumnIndex'], $columnIndex + $colRepeats - 1);
-// $tmpInfo['totalRows'] = max($tmpInfo['totalRows'], $rowIndex + $rowRepeats);
-// }
-// $columnIndex += $colRepeats;
-// }
-// $rowIndex += $rowRepeats;
-// break;
-// }
-// }
-//
-// $tmpInfo['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
-// $tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1;
-//
-// }
-// }
- }
-
- return $worksheetInfo;
- }
-
- /**
- * Loads PHPExcel from file
- *
- * @param string $pFilename
- * @return PHPExcel
- * @throws PHPExcel_Reader_Exception
- */
- public function load($pFilename)
- {
- // Create new PHPExcel
- $objPHPExcel = new PHPExcel();
-
- // Load into this instance
- return $this->loadIntoExisting($pFilename, $objPHPExcel);
- }
-
- private static function identifyFixedStyleValue($styleList, &$styleAttributeValue)
- {
- $styleAttributeValue = strtolower($styleAttributeValue);
- foreach ($styleList as $style) {
- if ($styleAttributeValue == strtolower($style)) {
- $styleAttributeValue = $style;
- return true;
- }
- }
- return false;
- }
-
- /**
- * Loads PHPExcel from file into PHPExcel instance
- *
- * @param string $pFilename
- * @param PHPExcel $objPHPExcel
- * @return PHPExcel
- * @throws PHPExcel_Reader_Exception
- */
- public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
- {
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
-
- $timezoneObj = new DateTimeZone('Europe/London');
- $GMT = new DateTimeZone('UTC');
-
- $zipClass = PHPExcel_Settings::getZipClass();
-
- $zip = new $zipClass;
- if (!$zip->open($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! Error opening file.");
- }
-
-// echo 'Meta Information
';
- $xml = simplexml_load_string($this->securityScan($zip->getFromName("meta.xml")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
- $namespacesMeta = $xml->getNamespaces(true);
-// echo '';
-// print_r($namespacesMeta);
-// echo '
';
-
- $docProps = $objPHPExcel->getProperties();
- $officeProperty = $xml->children($namespacesMeta['office']);
- foreach ($officeProperty as $officePropertyData) {
- $officePropertyDC = array();
- if (isset($namespacesMeta['dc'])) {
- $officePropertyDC = $officePropertyData->children($namespacesMeta['dc']);
- }
- foreach ($officePropertyDC as $propertyName => $propertyValue) {
- $propertyValue = (string) $propertyValue;
- switch ($propertyName) {
- case 'title':
- $docProps->setTitle($propertyValue);
- break;
- case 'subject':
- $docProps->setSubject($propertyValue);
- break;
- case 'creator':
- $docProps->setCreator($propertyValue);
- $docProps->setLastModifiedBy($propertyValue);
- break;
- case 'date':
- $creationDate = strtotime($propertyValue);
- $docProps->setCreated($creationDate);
- $docProps->setModified($creationDate);
- break;
- case 'description':
- $docProps->setDescription($propertyValue);
- break;
- }
- }
- $officePropertyMeta = array();
- if (isset($namespacesMeta['dc'])) {
- $officePropertyMeta = $officePropertyData->children($namespacesMeta['meta']);
- }
- foreach ($officePropertyMeta as $propertyName => $propertyValue) {
- $propertyValueAttributes = $propertyValue->attributes($namespacesMeta['meta']);
- $propertyValue = (string) $propertyValue;
- switch ($propertyName) {
- case 'initial-creator':
- $docProps->setCreator($propertyValue);
- break;
- case 'keyword':
- $docProps->setKeywords($propertyValue);
- break;
- case 'creation-date':
- $creationDate = strtotime($propertyValue);
- $docProps->setCreated($creationDate);
- break;
- case 'user-defined':
- $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_STRING;
- foreach ($propertyValueAttributes as $key => $value) {
- if ($key == 'name') {
- $propertyValueName = (string) $value;
- } elseif ($key == 'value-type') {
- switch ($value) {
- case 'date':
- $propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue, 'date');
- $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_DATE;
- break;
- case 'boolean':
- $propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue, 'bool');
- $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_BOOLEAN;
- break;
- case 'float':
- $propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue, 'r4');
- $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_FLOAT;
- break;
- default:
- $propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_STRING;
- }
- }
- }
- $docProps->setCustomProperty($propertyValueName, $propertyValue, $propertyValueType);
- break;
- }
- }
- }
-
-
-// echo 'Workbook Content
';
- $xml = simplexml_load_string($this->securityScan($zip->getFromName("content.xml")), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
- $namespacesContent = $xml->getNamespaces(true);
-// echo '';
-// print_r($namespacesContent);
-// echo '
';
-
- $workbook = $xml->children($namespacesContent['office']);
- foreach ($workbook->body->spreadsheet as $workbookData) {
- $workbookData = $workbookData->children($namespacesContent['table']);
- $worksheetID = 0;
- foreach ($workbookData->table as $worksheetDataSet) {
- $worksheetData = $worksheetDataSet->children($namespacesContent['table']);
-// print_r($worksheetData);
-// echo '
';
- $worksheetDataAttributes = $worksheetDataSet->attributes($namespacesContent['table']);
-// print_r($worksheetDataAttributes);
-// echo '
';
- if ((isset($this->loadSheetsOnly)) && (isset($worksheetDataAttributes['name'])) &&
- (!in_array($worksheetDataAttributes['name'], $this->loadSheetsOnly))) {
- continue;
- }
-
-// echo 'Worksheet '.$worksheetDataAttributes['name'].'
';
- // Create new Worksheet
- $objPHPExcel->createSheet();
- $objPHPExcel->setActiveSheetIndex($worksheetID);
- if (isset($worksheetDataAttributes['name'])) {
- $worksheetName = (string) $worksheetDataAttributes['name'];
- // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in
- // formula cells... during the load, all formulae should be correct, and we're simply
- // bringing the worksheet name in line with the formula, not the reverse
- $objPHPExcel->getActiveSheet()->setTitle($worksheetName, false);
- }
-
- $rowID = 1;
- foreach ($worksheetData as $key => $rowData) {
-// echo ''.$key.'
';
- switch ($key) {
- case 'table-header-rows':
- foreach ($rowData as $key => $cellData) {
- $rowData = $cellData;
- break;
- }
- case 'table-row':
- $rowDataTableAttributes = $rowData->attributes($namespacesContent['table']);
- $rowRepeats = (isset($rowDataTableAttributes['number-rows-repeated'])) ? $rowDataTableAttributes['number-rows-repeated'] : 1;
- $columnID = 'A';
- foreach ($rowData as $key => $cellData) {
- if ($this->getReadFilter() !== null) {
- if (!$this->getReadFilter()->readCell($columnID, $rowID, $worksheetName)) {
- continue;
- }
- }
-
-// echo ''.$columnID.$rowID.'
';
- $cellDataText = (isset($namespacesContent['text'])) ? $cellData->children($namespacesContent['text']) : '';
- $cellDataOffice = $cellData->children($namespacesContent['office']);
- $cellDataOfficeAttributes = $cellData->attributes($namespacesContent['office']);
- $cellDataTableAttributes = $cellData->attributes($namespacesContent['table']);
-
-// echo 'Office Attributes: ';
-// print_r($cellDataOfficeAttributes);
-// echo '
Table Attributes: ';
-// print_r($cellDataTableAttributes);
-// echo '
Cell Data Text';
-// print_r($cellDataText);
-// echo '
';
-//
- $type = $formatting = $hyperlink = null;
- $hasCalculatedValue = false;
- $cellDataFormula = '';
- if (isset($cellDataTableAttributes['formula'])) {
- $cellDataFormula = $cellDataTableAttributes['formula'];
- $hasCalculatedValue = true;
- }
-
- if (isset($cellDataOffice->annotation)) {
-// echo 'Cell has comment
';
- $annotationText = $cellDataOffice->annotation->children($namespacesContent['text']);
- $textArray = array();
- foreach ($annotationText as $t) {
- if (isset($t->span)) {
- foreach ($t->span as $text) {
- $textArray[] = (string)$text;
- }
- } else {
- $textArray[] = (string) $t;
- }
- }
- $text = implode("\n", $textArray);
-// echo $text, '
';
- $objPHPExcel->getActiveSheet()->getComment($columnID.$rowID)->setText($this->parseRichText($text));
-// ->setAuthor( $author )
- }
-
- if (isset($cellDataText->p)) {
- // Consolidate if there are multiple p records (maybe with spans as well)
- $dataArray = array();
- // Text can have multiple text:p and within those, multiple text:span.
- // text:p newlines, but text:span does not.
- // Also, here we assume there is no text data is span fields are specified, since
- // we have no way of knowing proper positioning anyway.
- foreach ($cellDataText->p as $pData) {
- if (isset($pData->span)) {
- // span sections do not newline, so we just create one large string here
- $spanSection = "";
- foreach ($pData->span as $spanData) {
- $spanSection .= $spanData;
- }
- array_push($dataArray, $spanSection);
- } else {
- array_push($dataArray, $pData);
- }
- }
- $allCellDataText = implode($dataArray, "\n");
-
-// echo 'Value Type is '.$cellDataOfficeAttributes['value-type'].'
';
- switch ($cellDataOfficeAttributes['value-type']) {
- case 'string':
- $type = PHPExcel_Cell_DataType::TYPE_STRING;
- $dataValue = $allCellDataText;
- if (isset($dataValue->a)) {
- $dataValue = $dataValue->a;
- $cellXLinkAttributes = $dataValue->attributes($namespacesContent['xlink']);
- $hyperlink = $cellXLinkAttributes['href'];
- }
- break;
- case 'boolean':
- $type = PHPExcel_Cell_DataType::TYPE_BOOL;
- $dataValue = ($allCellDataText == 'TRUE') ? true : false;
- break;
- case 'percentage':
- $type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
- $dataValue = (float) $cellDataOfficeAttributes['value'];
- if (floor($dataValue) == $dataValue) {
- $dataValue = (integer) $dataValue;
- }
- $formatting = PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00;
- break;
- case 'currency':
- $type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
- $dataValue = (float) $cellDataOfficeAttributes['value'];
- if (floor($dataValue) == $dataValue) {
- $dataValue = (integer) $dataValue;
- }
- $formatting = PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE;
- break;
- case 'float':
- $type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
- $dataValue = (float) $cellDataOfficeAttributes['value'];
- if (floor($dataValue) == $dataValue) {
- if ($dataValue == (integer) $dataValue) {
- $dataValue = (integer) $dataValue;
- } else {
- $dataValue = (float) $dataValue;
- }
- }
- break;
- case 'date':
- $type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
- $dateObj = new DateTime($cellDataOfficeAttributes['date-value'], $GMT);
- $dateObj->setTimeZone($timezoneObj);
- list($year, $month, $day, $hour, $minute, $second) = explode(' ', $dateObj->format('Y m d H i s'));
- $dataValue = PHPExcel_Shared_Date::FormattedPHPToExcel($year, $month, $day, $hour, $minute, $second);
- if ($dataValue != floor($dataValue)) {
- $formatting = PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX15.' '.PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4;
- } else {
- $formatting = PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX15;
- }
- break;
- case 'time':
- $type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
- $dataValue = PHPExcel_Shared_Date::PHPToExcel(strtotime('01-01-1970 '.implode(':', sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS'))));
- $formatting = PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4;
- break;
- }
-// echo 'Data value is '.$dataValue.'
';
-// if ($hyperlink !== null) {
-// echo 'Hyperlink is '.$hyperlink.'
';
-// }
- } else {
- $type = PHPExcel_Cell_DataType::TYPE_NULL;
- $dataValue = null;
- }
-
- if ($hasCalculatedValue) {
- $type = PHPExcel_Cell_DataType::TYPE_FORMULA;
-// echo 'Formula: ', $cellDataFormula, PHP_EOL;
- $cellDataFormula = substr($cellDataFormula, strpos($cellDataFormula, ':=')+1);
- $temp = explode('"', $cellDataFormula);
- $tKey = false;
- foreach ($temp as &$value) {
- // Only replace in alternate array entries (i.e. non-quoted blocks)
- if ($tKey = !$tKey) {
- $value = preg_replace('/\[([^\.]+)\.([^\.]+):\.([^\.]+)\]/Ui', '$1!$2:$3', $value); // Cell range reference in another sheet
- $value = preg_replace('/\[([^\.]+)\.([^\.]+)\]/Ui', '$1!$2', $value); // Cell reference in another sheet
- $value = preg_replace('/\[\.([^\.]+):\.([^\.]+)\]/Ui', '$1:$2', $value); // Cell range reference
- $value = preg_replace('/\[\.([^\.]+)\]/Ui', '$1', $value); // Simple cell reference
- $value = PHPExcel_Calculation::translateSeparator(';', ',', $value, $inBraces);
- }
- }
- unset($value);
- // Then rebuild the formula string
- $cellDataFormula = implode('"', $temp);
-// echo 'Adjusted Formula: ', $cellDataFormula, PHP_EOL;
- }
-
- $colRepeats = (isset($cellDataTableAttributes['number-columns-repeated'])) ? $cellDataTableAttributes['number-columns-repeated'] : 1;
- if ($type !== null) {
- for ($i = 0; $i < $colRepeats; ++$i) {
- if ($i > 0) {
- ++$columnID;
- }
- if ($type !== PHPExcel_Cell_DataType::TYPE_NULL) {
- for ($rowAdjust = 0; $rowAdjust < $rowRepeats; ++$rowAdjust) {
- $rID = $rowID + $rowAdjust;
- $objPHPExcel->getActiveSheet()->getCell($columnID.$rID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $dataValue), $type);
- if ($hasCalculatedValue) {
-// echo 'Forumla result is '.$dataValue.'
';
- $objPHPExcel->getActiveSheet()->getCell($columnID.$rID)->setCalculatedValue($dataValue);
- }
- if ($formatting !== null) {
- $objPHPExcel->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode($formatting);
- } else {
- $objPHPExcel->getActiveSheet()->getStyle($columnID.$rID)->getNumberFormat()->setFormatCode(PHPExcel_Style_NumberFormat::FORMAT_GENERAL);
- }
- if ($hyperlink !== null) {
- $objPHPExcel->getActiveSheet()->getCell($columnID.$rID)->getHyperlink()->setUrl($hyperlink);
- }
- }
- }
- }
- }
-
- // Merged cells
- if ((isset($cellDataTableAttributes['number-columns-spanned'])) || (isset($cellDataTableAttributes['number-rows-spanned']))) {
- if (($type !== PHPExcel_Cell_DataType::TYPE_NULL) || (!$this->readDataOnly)) {
- $columnTo = $columnID;
- if (isset($cellDataTableAttributes['number-columns-spanned'])) {
- $columnTo = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($columnID) + $cellDataTableAttributes['number-columns-spanned'] -2);
- }
- $rowTo = $rowID;
- if (isset($cellDataTableAttributes['number-rows-spanned'])) {
- $rowTo = $rowTo + $cellDataTableAttributes['number-rows-spanned'] - 1;
- }
- $cellRange = $columnID.$rowID.':'.$columnTo.$rowTo;
- $objPHPExcel->getActiveSheet()->mergeCells($cellRange);
- }
- }
-
- ++$columnID;
- }
- $rowID += $rowRepeats;
- break;
- }
- }
- ++$worksheetID;
- }
- }
-
- // Return
- return $objPHPExcel;
- }
-
- private function parseRichText($is = '')
- {
- $value = new PHPExcel_RichText();
-
- $value->createText($is);
-
- return $value;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/RichText.php b/lib/phpexcel/PHPExcel/RichText.php
deleted file mode 100644
index 74a3534af3a..00000000000
--- a/lib/phpexcel/PHPExcel/RichText.php
+++ /dev/null
@@ -1,191 +0,0 @@
-richTextElements = array();
-
- // Rich-Text string attached to cell?
- if ($pCell !== null) {
- // Add cell text and style
- if ($pCell->getValue() != "") {
- $objRun = new PHPExcel_RichText_Run($pCell->getValue());
- $objRun->setFont(clone $pCell->getParent()->getStyle($pCell->getCoordinate())->getFont());
- $this->addText($objRun);
- }
-
- // Set parent value
- $pCell->setValueExplicit($this, PHPExcel_Cell_DataType::TYPE_STRING);
- }
- }
-
- /**
- * Add text
- *
- * @param PHPExcel_RichText_ITextElement $pText Rich text element
- * @throws PHPExcel_Exception
- * @return PHPExcel_RichText
- */
- public function addText(PHPExcel_RichText_ITextElement $pText = null)
- {
- $this->richTextElements[] = $pText;
- return $this;
- }
-
- /**
- * Create text
- *
- * @param string $pText Text
- * @return PHPExcel_RichText_TextElement
- * @throws PHPExcel_Exception
- */
- public function createText($pText = '')
- {
- $objText = new PHPExcel_RichText_TextElement($pText);
- $this->addText($objText);
- return $objText;
- }
-
- /**
- * Create text run
- *
- * @param string $pText Text
- * @return PHPExcel_RichText_Run
- * @throws PHPExcel_Exception
- */
- public function createTextRun($pText = '')
- {
- $objText = new PHPExcel_RichText_Run($pText);
- $this->addText($objText);
- return $objText;
- }
-
- /**
- * Get plain text
- *
- * @return string
- */
- public function getPlainText()
- {
- // Return value
- $returnValue = '';
-
- // Loop through all PHPExcel_RichText_ITextElement
- foreach ($this->richTextElements as $text) {
- $returnValue .= $text->getText();
- }
-
- // Return
- return $returnValue;
- }
-
- /**
- * Convert to string
- *
- * @return string
- */
- public function __toString()
- {
- return $this->getPlainText();
- }
-
- /**
- * Get Rich Text elements
- *
- * @return PHPExcel_RichText_ITextElement[]
- */
- public function getRichTextElements()
- {
- return $this->richTextElements;
- }
-
- /**
- * Set Rich Text elements
- *
- * @param PHPExcel_RichText_ITextElement[] $pElements Array of elements
- * @throws PHPExcel_Exception
- * @return PHPExcel_RichText
- */
- public function setRichTextElements($pElements = null)
- {
- if (is_array($pElements)) {
- $this->richTextElements = $pElements;
- } else {
- throw new PHPExcel_Exception("Invalid PHPExcel_RichText_ITextElement[] array passed.");
- }
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- $hashElements = '';
- foreach ($this->richTextElements as $element) {
- $hashElements .= $element->getHashCode();
- }
-
- return md5(
- $hashElements .
- __CLASS__
- );
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/RichText/ITextElement.php b/lib/phpexcel/PHPExcel/RichText/ITextElement.php
deleted file mode 100644
index 5db3432012e..00000000000
--- a/lib/phpexcel/PHPExcel/RichText/ITextElement.php
+++ /dev/null
@@ -1,56 +0,0 @@
-setText($pText);
- $this->font = new PHPExcel_Style_Font();
- }
-
- /**
- * Get font
- *
- * @return PHPExcel_Style_Font
- */
- public function getFont()
- {
- return $this->font;
- }
-
- /**
- * Set font
- *
- * @param PHPExcel_Style_Font $pFont Font
- * @throws PHPExcel_Exception
- * @return PHPExcel_RichText_ITextElement
- */
- public function setFont(PHPExcel_Style_Font $pFont = null)
- {
- $this->font = $pFont;
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- return md5(
- $this->getText() .
- $this->font->getHashCode() .
- __CLASS__
- );
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/RichText/TextElement.php b/lib/phpexcel/PHPExcel/RichText/TextElement.php
deleted file mode 100644
index f86e703152e..00000000000
--- a/lib/phpexcel/PHPExcel/RichText/TextElement.php
+++ /dev/null
@@ -1,105 +0,0 @@
-text = $pText;
- }
-
- /**
- * Get text
- *
- * @return string Text
- */
- public function getText()
- {
- return $this->text;
- }
-
- /**
- * Set text
- *
- * @param $pText string Text
- * @return PHPExcel_RichText_ITextElement
- */
- public function setText($pText = '')
- {
- $this->text = $pText;
- return $this;
- }
-
- /**
- * Get font
- *
- * @return PHPExcel_Style_Font
- */
- public function getFont()
- {
- return null;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- return md5(
- $this->text .
- __CLASS__
- );
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Settings.php b/lib/phpexcel/PHPExcel/Settings.php
deleted file mode 100644
index eff33f0f9ac..00000000000
--- a/lib/phpexcel/PHPExcel/Settings.php
+++ /dev/null
@@ -1,387 +0,0 @@
-setLocale($locale);
- }
-
-
- /**
- * Set details of the external library that PHPExcel should use for rendering charts
- *
- * @param string $libraryName Internal reference name of the library
- * e.g. PHPExcel_Settings::CHART_RENDERER_JPGRAPH
- * @param string $libraryBaseDir Directory path to the library's base folder
- *
- * @return boolean Success or failure
- */
- public static function setChartRenderer($libraryName, $libraryBaseDir)
- {
- if (!self::setChartRendererName($libraryName)) {
- return false;
- }
- return self::setChartRendererPath($libraryBaseDir);
- }
-
-
- /**
- * Identify to PHPExcel the external library to use for rendering charts
- *
- * @param string $libraryName Internal reference name of the library
- * e.g. PHPExcel_Settings::CHART_RENDERER_JPGRAPH
- *
- * @return boolean Success or failure
- */
- public static function setChartRendererName($libraryName)
- {
- if (!in_array($libraryName, self::$chartRenderers)) {
- return false;
- }
- self::$chartRendererName = $libraryName;
-
- return true;
- }
-
-
- /**
- * Tell PHPExcel where to find the external library to use for rendering charts
- *
- * @param string $libraryBaseDir Directory path to the library's base folder
- * @return boolean Success or failure
- */
- public static function setChartRendererPath($libraryBaseDir)
- {
- if ((file_exists($libraryBaseDir) === false) || (is_readable($libraryBaseDir) === false)) {
- return false;
- }
- self::$chartRendererPath = $libraryBaseDir;
-
- return true;
- }
-
-
- /**
- * Return the Chart Rendering Library that PHPExcel is currently configured to use (e.g. jpgraph)
- *
- * @return string|NULL Internal reference name of the Chart Rendering Library that PHPExcel is
- * currently configured to use
- * e.g. PHPExcel_Settings::CHART_RENDERER_JPGRAPH
- */
- public static function getChartRendererName()
- {
- return self::$chartRendererName;
- }
-
-
- /**
- * Return the directory path to the Chart Rendering Library that PHPExcel is currently configured to use
- *
- * @return string|NULL Directory Path to the Chart Rendering Library that PHPExcel is
- * currently configured to use
- */
- public static function getChartRendererPath()
- {
- return self::$chartRendererPath;
- }
-
-
- /**
- * Set details of the external library that PHPExcel should use for rendering PDF files
- *
- * @param string $libraryName Internal reference name of the library
- * e.g. PHPExcel_Settings::PDF_RENDERER_TCPDF,
- * PHPExcel_Settings::PDF_RENDERER_DOMPDF
- * or PHPExcel_Settings::PDF_RENDERER_MPDF
- * @param string $libraryBaseDir Directory path to the library's base folder
- *
- * @return boolean Success or failure
- */
- public static function setPdfRenderer($libraryName, $libraryBaseDir)
- {
- if (!self::setPdfRendererName($libraryName)) {
- return false;
- }
- return self::setPdfRendererPath($libraryBaseDir);
- }
-
-
- /**
- * Identify to PHPExcel the external library to use for rendering PDF files
- *
- * @param string $libraryName Internal reference name of the library
- * e.g. PHPExcel_Settings::PDF_RENDERER_TCPDF,
- * PHPExcel_Settings::PDF_RENDERER_DOMPDF
- * or PHPExcel_Settings::PDF_RENDERER_MPDF
- *
- * @return boolean Success or failure
- */
- public static function setPdfRendererName($libraryName)
- {
- if (!in_array($libraryName, self::$pdfRenderers)) {
- return false;
- }
- self::$pdfRendererName = $libraryName;
-
- return true;
- }
-
-
- /**
- * Tell PHPExcel where to find the external library to use for rendering PDF files
- *
- * @param string $libraryBaseDir Directory path to the library's base folder
- * @return boolean Success or failure
- */
- public static function setPdfRendererPath($libraryBaseDir)
- {
- if ((file_exists($libraryBaseDir) === false) || (is_readable($libraryBaseDir) === false)) {
- return false;
- }
- self::$pdfRendererPath = $libraryBaseDir;
-
- return true;
- }
-
-
- /**
- * Return the PDF Rendering Library that PHPExcel is currently configured to use (e.g. dompdf)
- *
- * @return string|NULL Internal reference name of the PDF Rendering Library that PHPExcel is
- * currently configured to use
- * e.g. PHPExcel_Settings::PDF_RENDERER_TCPDF,
- * PHPExcel_Settings::PDF_RENDERER_DOMPDF
- * or PHPExcel_Settings::PDF_RENDERER_MPDF
- */
- public static function getPdfRendererName()
- {
- return self::$pdfRendererName;
- }
-
- /**
- * Return the directory path to the PDF Rendering Library that PHPExcel is currently configured to use
- *
- * @return string|NULL Directory Path to the PDF Rendering Library that PHPExcel is
- * currently configured to use
- */
- public static function getPdfRendererPath()
- {
- return self::$pdfRendererPath;
- }
-
- /**
- * Set default options for libxml loader
- *
- * @param int $options Default options for libxml loader
- */
- public static function setLibXmlLoaderOptions($options = null)
- {
- if (is_null($options) && defined(LIBXML_DTDLOAD)) {
- $options = LIBXML_DTDLOAD | LIBXML_DTDATTR;
- }
- if (version_compare(PHP_VERSION, '5.2.11') >= 0) {
- @libxml_disable_entity_loader($options == (LIBXML_DTDLOAD | LIBXML_DTDATTR));
- }
- self::$libXmlLoaderOptions = $options;
- }
-
- /**
- * Get default options for libxml loader.
- * Defaults to LIBXML_DTDLOAD | LIBXML_DTDATTR when not set explicitly.
- *
- * @return int Default options for libxml loader
- */
- public static function getLibXmlLoaderOptions()
- {
- if (is_null(self::$libXmlLoaderOptions) && defined(LIBXML_DTDLOAD)) {
- self::setLibXmlLoaderOptions(LIBXML_DTDLOAD | LIBXML_DTDATTR);
- }
- if (version_compare(PHP_VERSION, '5.2.11') >= 0) {
- @libxml_disable_entity_loader(self::$libXmlLoaderOptions == (LIBXML_DTDLOAD | LIBXML_DTDATTR));
- }
- return self::$libXmlLoaderOptions;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/CodePage.php b/lib/phpexcel/PHPExcel/Shared/CodePage.php
deleted file mode 100644
index b9df3b4d7eb..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/CodePage.php
+++ /dev/null
@@ -1,144 +0,0 @@
- 'January',
- 'Feb' => 'February',
- 'Mar' => 'March',
- 'Apr' => 'April',
- 'May' => 'May',
- 'Jun' => 'June',
- 'Jul' => 'July',
- 'Aug' => 'August',
- 'Sep' => 'September',
- 'Oct' => 'October',
- 'Nov' => 'November',
- 'Dec' => 'December',
- );
-
- /*
- * Names of the months of the year, indexed by shortname
- * Planned usage for locale settings
- *
- * @public
- * @var string[]
- */
- public static $numberSuffixes = array(
- 'st',
- 'nd',
- 'rd',
- 'th',
- );
-
- /*
- * Base calendar year to use for calculations
- *
- * @private
- * @var int
- */
- protected static $excelBaseDate = self::CALENDAR_WINDOWS_1900;
-
- /**
- * Set the Excel calendar (Windows 1900 or Mac 1904)
- *
- * @param integer $baseDate Excel base date (1900 or 1904)
- * @return boolean Success or failure
- */
- public static function setExcelCalendar($baseDate)
- {
- if (($baseDate == self::CALENDAR_WINDOWS_1900) ||
- ($baseDate == self::CALENDAR_MAC_1904)) {
- self::$excelBaseDate = $baseDate;
- return true;
- }
- return false;
- }
-
-
- /**
- * Return the Excel calendar (Windows 1900 or Mac 1904)
- *
- * @return integer Excel base date (1900 or 1904)
- */
- public static function getExcelCalendar()
- {
- return self::$excelBaseDate;
- }
-
-
- /**
- * Convert a date from Excel to PHP
- *
- * @param integer $dateValue Excel date/time value
- * @param boolean $adjustToTimezone Flag indicating whether $dateValue should be treated as
- * a UST timestamp, or adjusted to UST
- * @param string $timezone The timezone for finding the adjustment from UST
- * @return integer PHP serialized date/time
- */
- public static function ExcelToPHP($dateValue = 0, $adjustToTimezone = false, $timezone = null)
- {
- if (self::$excelBaseDate == self::CALENDAR_WINDOWS_1900) {
- $myexcelBaseDate = 25569;
- // Adjust for the spurious 29-Feb-1900 (Day 60)
- if ($dateValue < 60) {
- --$myexcelBaseDate;
- }
- } else {
- $myexcelBaseDate = 24107;
- }
-
- // Perform conversion
- if ($dateValue >= 1) {
- $utcDays = $dateValue - $myexcelBaseDate;
- $returnValue = round($utcDays * 86400);
- if (($returnValue <= PHP_INT_MAX) && ($returnValue >= -PHP_INT_MAX)) {
- $returnValue = (integer) $returnValue;
- }
- } else {
- $hours = round($dateValue * 24);
- $mins = round($dateValue * 1440) - round($hours * 60);
- $secs = round($dateValue * 86400) - round($hours * 3600) - round($mins * 60);
- $returnValue = (integer) gmmktime($hours, $mins, $secs);
- }
-
- $timezoneAdjustment = ($adjustToTimezone) ?
- PHPExcel_Shared_TimeZone::getTimezoneAdjustment($timezone, $returnValue) :
- 0;
-
- return $returnValue + $timezoneAdjustment;
- }
-
-
- /**
- * Convert a date from Excel to a PHP Date/Time object
- *
- * @param integer $dateValue Excel date/time value
- * @return DateTime PHP date/time object
- */
- public static function ExcelToPHPObject($dateValue = 0)
- {
- $dateTime = self::ExcelToPHP($dateValue);
- $days = floor($dateTime / 86400);
- $time = round((($dateTime / 86400) - $days) * 86400);
- $hours = round($time / 3600);
- $minutes = round($time / 60) - ($hours * 60);
- $seconds = round($time) - ($hours * 3600) - ($minutes * 60);
-
- $dateObj = date_create('1-Jan-1970+'.$days.' days');
- $dateObj->setTime($hours, $minutes, $seconds);
-
- return $dateObj;
- }
-
-
- /**
- * Convert a date from PHP to Excel
- *
- * @param mixed $dateValue PHP serialized date/time or date object
- * @param boolean $adjustToTimezone Flag indicating whether $dateValue should be treated as
- * a UST timestamp, or adjusted to UST
- * @param string $timezone The timezone for finding the adjustment from UST
- * @return mixed Excel date/time value
- * or boolean FALSE on failure
- */
- public static function PHPToExcel($dateValue = 0, $adjustToTimezone = false, $timezone = null)
- {
- $saveTimeZone = date_default_timezone_get();
- date_default_timezone_set('UTC');
- $retValue = false;
- if ((is_object($dateValue)) && ($dateValue instanceof DateTime)) {
- $retValue = self::FormattedPHPToExcel($dateValue->format('Y'), $dateValue->format('m'), $dateValue->format('d'), $dateValue->format('H'), $dateValue->format('i'), $dateValue->format('s'));
- } elseif (is_numeric($dateValue)) {
- $retValue = self::FormattedPHPToExcel(date('Y', $dateValue), date('m', $dateValue), date('d', $dateValue), date('H', $dateValue), date('i', $dateValue), date('s', $dateValue));
- }
- date_default_timezone_set($saveTimeZone);
-
- return $retValue;
- }
-
-
- /**
- * FormattedPHPToExcel
- *
- * @param integer $year
- * @param integer $month
- * @param integer $day
- * @param integer $hours
- * @param integer $minutes
- * @param integer $seconds
- * @return integer Excel date/time value
- */
- public static function FormattedPHPToExcel($year, $month, $day, $hours = 0, $minutes = 0, $seconds = 0)
- {
- if (self::$excelBaseDate == self::CALENDAR_WINDOWS_1900) {
- //
- // Fudge factor for the erroneous fact that the year 1900 is treated as a Leap Year in MS Excel
- // This affects every date following 28th February 1900
- //
- $excel1900isLeapYear = true;
- if (($year == 1900) && ($month <= 2)) {
- $excel1900isLeapYear = false;
- }
- $myexcelBaseDate = 2415020;
- } else {
- $myexcelBaseDate = 2416481;
- $excel1900isLeapYear = false;
- }
-
- // Julian base date Adjustment
- if ($month > 2) {
- $month -= 3;
- } else {
- $month += 9;
- --$year;
- }
-
- // Calculate the Julian Date, then subtract the Excel base date (JD 2415020 = 31-Dec-1899 Giving Excel Date of 0)
- $century = substr($year, 0, 2);
- $decade = substr($year, 2, 2);
- $excelDate = floor((146097 * $century) / 4) + floor((1461 * $decade) / 4) + floor((153 * $month + 2) / 5) + $day + 1721119 - $myexcelBaseDate + $excel1900isLeapYear;
-
- $excelTime = (($hours * 3600) + ($minutes * 60) + $seconds) / 86400;
-
- return (float) $excelDate + $excelTime;
- }
-
-
- /**
- * Is a given cell a date/time?
- *
- * @param PHPExcel_Cell $pCell
- * @return boolean
- */
- public static function isDateTime(PHPExcel_Cell $pCell)
- {
- return self::isDateTimeFormat(
- $pCell->getWorksheet()->getStyle(
- $pCell->getCoordinate()
- )->getNumberFormat()
- );
- }
-
-
- /**
- * Is a given number format a date/time?
- *
- * @param PHPExcel_Style_NumberFormat $pFormat
- * @return boolean
- */
- public static function isDateTimeFormat(PHPExcel_Style_NumberFormat $pFormat)
- {
- return self::isDateTimeFormatCode($pFormat->getFormatCode());
- }
-
-
- private static $possibleDateFormatCharacters = 'eymdHs';
-
- /**
- * Is a given number format code a date/time?
- *
- * @param string $pFormatCode
- * @return boolean
- */
- public static function isDateTimeFormatCode($pFormatCode = '')
- {
- if (strtolower($pFormatCode) === strtolower(PHPExcel_Style_NumberFormat::FORMAT_GENERAL)) {
- // "General" contains an epoch letter 'e', so we trap for it explicitly here (case-insensitive check)
- return false;
- }
- if (preg_match('/[0#]E[+-]0/i', $pFormatCode)) {
- // Scientific format
- return false;
- }
-
- // Switch on formatcode
- switch ($pFormatCode) {
- // Explicitly defined date formats
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDD:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDD2:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_DDMMYYYY:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_DMYSLASH:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_DMYMINUS:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_DMMINUS:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_MYMINUS:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_DATETIME:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME1:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME2:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME3:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME5:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME6:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME7:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME8:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_YYYYMMDDSLASH:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX14:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX15:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX16:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX17:
- case PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX22:
- return true;
- }
-
- // Typically number, currency or accounting (or occasionally fraction) formats
- if ((substr($pFormatCode, 0, 1) == '_') || (substr($pFormatCode, 0, 2) == '0 ')) {
- return false;
- }
- // Try checking for any of the date formatting characters that don't appear within square braces
- if (preg_match('/(^|\])[^\[]*['.self::$possibleDateFormatCharacters.']/i', $pFormatCode)) {
- // We might also have a format mask containing quoted strings...
- // we don't want to test for any of our characters within the quoted blocks
- if (strpos($pFormatCode, '"') !== false) {
- $segMatcher = false;
- foreach (explode('"', $pFormatCode) as $subVal) {
- // Only test in alternate array entries (the non-quoted blocks)
- if (($segMatcher = !$segMatcher) &&
- (preg_match('/(^|\])[^\[]*['.self::$possibleDateFormatCharacters.']/i', $subVal))) {
- return true;
- }
- }
- return false;
- }
- return true;
- }
-
- // No date...
- return false;
- }
-
-
- /**
- * Convert a date/time string to Excel time
- *
- * @param string $dateValue Examples: '2009-12-31', '2009-12-31 15:59', '2009-12-31 15:59:10'
- * @return float|FALSE Excel date/time serial value
- */
- public static function stringToExcel($dateValue = '')
- {
- if (strlen($dateValue) < 2) {
- return false;
- }
- if (!preg_match('/^(\d{1,4}[ \.\/\-][A-Z]{3,9}([ \.\/\-]\d{1,4})?|[A-Z]{3,9}[ \.\/\-]\d{1,4}([ \.\/\-]\d{1,4})?|\d{1,4}[ \.\/\-]\d{1,4}([ \.\/\-]\d{1,4})?)( \d{1,2}:\d{1,2}(:\d{1,2})?)?$/iu', $dateValue)) {
- return false;
- }
-
- $dateValueNew = PHPExcel_Calculation_DateTime::DATEVALUE($dateValue);
-
- if ($dateValueNew === PHPExcel_Calculation_Functions::VALUE()) {
- return false;
- }
-
- if (strpos($dateValue, ':') !== false) {
- $timeValue = PHPExcel_Calculation_DateTime::TIMEVALUE($dateValue);
- if ($timeValue === PHPExcel_Calculation_Functions::VALUE()) {
- return false;
- }
- $dateValueNew += $timeValue;
- }
- return $dateValueNew;
- }
-
- /**
- * Converts a month name (either a long or a short name) to a month number
- *
- * @param string $month Month name or abbreviation
- * @return integer|string Month number (1 - 12), or the original string argument if it isn't a valid month name
- */
- public static function monthStringToNumber($month)
- {
- $monthIndex = 1;
- foreach (self::$monthNames as $shortMonthName => $longMonthName) {
- if (($month === $longMonthName) || ($month === $shortMonthName)) {
- return $monthIndex;
- }
- ++$monthIndex;
- }
- return $month;
- }
-
- /**
- * Strips an ordinal froma numeric value
- *
- * @param string $day Day number with an ordinal
- * @return integer|string The integer value with any ordinal stripped, or the original string argument if it isn't a valid numeric
- */
- public static function dayStringToNumber($day)
- {
- $strippedDayValue = (str_replace(self::$numberSuffixes, '', $day));
- if (is_numeric($strippedDayValue)) {
- return (integer) $strippedDayValue;
- }
- return $day;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/Drawing.php b/lib/phpexcel/PHPExcel/Shared/Drawing.php
deleted file mode 100644
index 3e027b4ada8..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/Drawing.php
+++ /dev/null
@@ -1,270 +0,0 @@
-getName();
- $size = $pDefaultFont->getSize();
-
- if (isset(PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size])) {
- // Exact width can be determined
- $colWidth = $pValue * PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size]['width'] / PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size]['px'];
- } else {
- // We don't have data for this particular font and size, use approximation by
- // extrapolating from Calibri 11
- $colWidth = $pValue * 11 * PHPExcel_Shared_Font::$defaultColumnWidths['Calibri'][11]['width'] / PHPExcel_Shared_Font::$defaultColumnWidths['Calibri'][11]['px'] / $size;
- }
-
- return $colWidth;
- }
-
- /**
- * Convert column width from (intrinsic) Excel units to pixels
- *
- * @param float $pValue Value in cell dimension
- * @param PHPExcel_Style_Font $pDefaultFont Default font of the workbook
- * @return int Value in pixels
- */
- public static function cellDimensionToPixels($pValue = 0, PHPExcel_Style_Font $pDefaultFont)
- {
- // Font name and size
- $name = $pDefaultFont->getName();
- $size = $pDefaultFont->getSize();
-
- if (isset(PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size])) {
- // Exact width can be determined
- $colWidth = $pValue * PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size]['px'] / PHPExcel_Shared_Font::$defaultColumnWidths[$name][$size]['width'];
- } else {
- // We don't have data for this particular font and size, use approximation by
- // extrapolating from Calibri 11
- $colWidth = $pValue * $size * PHPExcel_Shared_Font::$defaultColumnWidths['Calibri'][11]['px'] / PHPExcel_Shared_Font::$defaultColumnWidths['Calibri'][11]['width'] / 11;
- }
-
- // Round pixels to closest integer
- $colWidth = (int) round($colWidth);
-
- return $colWidth;
- }
-
- /**
- * Convert pixels to points
- *
- * @param int $pValue Value in pixels
- * @return int Value in points
- */
- public static function pixelsToPoints($pValue = 0)
- {
- return $pValue * 0.67777777;
- }
-
- /**
- * Convert points to pixels
- *
- * @param int $pValue Value in points
- * @return int Value in pixels
- */
- public static function pointsToPixels($pValue = 0)
- {
- if ($pValue != 0) {
- return (int) ceil($pValue * 1.333333333);
- } else {
- return 0;
- }
- }
-
- /**
- * Convert degrees to angle
- *
- * @param int $pValue Degrees
- * @return int Angle
- */
- public static function degreesToAngle($pValue = 0)
- {
- return (int)round($pValue * 60000);
- }
-
- /**
- * Convert angle to degrees
- *
- * @param int $pValue Angle
- * @return int Degrees
- */
- public static function angleToDegrees($pValue = 0)
- {
- if ($pValue != 0) {
- return round($pValue / 60000);
- } else {
- return 0;
- }
- }
-
- /**
- * Create a new image from file. By alexander at alexauto dot nl
- *
- * @link http://www.php.net/manual/en/function.imagecreatefromwbmp.php#86214
- * @param string $filename Path to Windows DIB (BMP) image
- * @return resource
- */
- public static function imagecreatefrombmp($p_sFile)
- {
- // Load the image into a string
- $file = fopen($p_sFile, "rb");
- $read = fread($file, 10);
- while (!feof($file) && ($read<>"")) {
- $read .= fread($file, 1024);
- }
-
- $temp = unpack("H*", $read);
- $hex = $temp[1];
- $header = substr($hex, 0, 108);
-
- // Process the header
- // Structure: http://www.fastgraph.com/help/bmp_header_format.html
- if (substr($header, 0, 4)=="424d") {
- // Cut it in parts of 2 bytes
- $header_parts = str_split($header, 2);
-
- // Get the width 4 bytes
- $width = hexdec($header_parts[19].$header_parts[18]);
-
- // Get the height 4 bytes
- $height = hexdec($header_parts[23].$header_parts[22]);
-
- // Unset the header params
- unset($header_parts);
- }
-
- // Define starting X and Y
- $x = 0;
- $y = 1;
-
- // Create newimage
- $image = imagecreatetruecolor($width, $height);
-
- // Grab the body from the image
- $body = substr($hex, 108);
-
- // Calculate if padding at the end-line is needed
- // Divided by two to keep overview.
- // 1 byte = 2 HEX-chars
- $body_size = (strlen($body)/2);
- $header_size = ($width*$height);
-
- // Use end-line padding? Only when needed
- $usePadding = ($body_size>($header_size*3)+4);
-
- // Using a for-loop with index-calculation instaid of str_split to avoid large memory consumption
- // Calculate the next DWORD-position in the body
- for ($i = 0; $i < $body_size; $i += 3) {
- // Calculate line-ending and padding
- if ($x >= $width) {
- // If padding needed, ignore image-padding
- // Shift i to the ending of the current 32-bit-block
- if ($usePadding) {
- $i += $width%4;
- }
-
- // Reset horizontal position
- $x = 0;
-
- // Raise the height-position (bottom-up)
- $y++;
-
- // Reached the image-height? Break the for-loop
- if ($y > $height) {
- break;
- }
- }
-
- // Calculation of the RGB-pixel (defined as BGR in image-data)
- // Define $i_pos as absolute position in the body
- $i_pos = $i * 2;
- $r = hexdec($body[$i_pos+4].$body[$i_pos+5]);
- $g = hexdec($body[$i_pos+2].$body[$i_pos+3]);
- $b = hexdec($body[$i_pos].$body[$i_pos+1]);
-
- // Calculate and draw the pixel
- $color = imagecolorallocate($image, $r, $g, $b);
- imagesetpixel($image, $x, $height-$y, $color);
-
- // Raise the horizontal position
- $x++;
- }
-
- // Unset the body / free the memory
- unset($body);
-
- // Return image-object
- return $image;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/Escher.php b/lib/phpexcel/PHPExcel/Shared/Escher.php
deleted file mode 100644
index 1aedb9d2a4a..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/Escher.php
+++ /dev/null
@@ -1,83 +0,0 @@
-dggContainer;
- }
-
- /**
- * Set Drawing Group Container
- *
- * @param PHPExcel_Shared_Escher_DggContainer $dggContainer
- */
- public function setDggContainer($dggContainer)
- {
- return $this->dggContainer = $dggContainer;
- }
-
- /**
- * Get Drawing Container
- *
- * @return PHPExcel_Shared_Escher_DgContainer
- */
- public function getDgContainer()
- {
- return $this->dgContainer;
- }
-
- /**
- * Set Drawing Container
- *
- * @param PHPExcel_Shared_Escher_DgContainer $dgContainer
- */
- public function setDgContainer($dgContainer)
- {
- return $this->dgContainer = $dgContainer;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/Escher/DgContainer.php b/lib/phpexcel/PHPExcel/Shared/Escher/DgContainer.php
deleted file mode 100644
index 739cd902462..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/Escher/DgContainer.php
+++ /dev/null
@@ -1,75 +0,0 @@
-dgId;
- }
-
- public function setDgId($value)
- {
- $this->dgId = $value;
- }
-
- public function getLastSpId()
- {
- return $this->lastSpId;
- }
-
- public function setLastSpId($value)
- {
- $this->lastSpId = $value;
- }
-
- public function getSpgrContainer()
- {
- return $this->spgrContainer;
- }
-
- public function setSpgrContainer($spgrContainer)
- {
- return $this->spgrContainer = $spgrContainer;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer.php b/lib/phpexcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer.php
deleted file mode 100644
index 49e7d6856d0..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer.php
+++ /dev/null
@@ -1,102 +0,0 @@
-parent = $parent;
- }
-
- /**
- * Get the parent Shape Group Container if any
- *
- * @return PHPExcel_Shared_Escher_DgContainer_SpgrContainer|null
- */
- public function getParent()
- {
- return $this->parent;
- }
-
- /**
- * Add a child. This will be either spgrContainer or spContainer
- *
- * @param mixed $child
- */
- public function addChild($child)
- {
- $this->children[] = $child;
- $child->setParent($this);
- }
-
- /**
- * Get collection of Shape Containers
- */
- public function getChildren()
- {
- return $this->children;
- }
-
- /**
- * Recursively get all spContainers within this spgrContainer
- *
- * @return PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer[]
- */
- public function getAllSpContainers()
- {
- $allSpContainers = array();
-
- foreach ($this->children as $child) {
- if ($child instanceof PHPExcel_Shared_Escher_DgContainer_SpgrContainer) {
- $allSpContainers = array_merge($allSpContainers, $child->getAllSpContainers());
- } else {
- $allSpContainers[] = $child;
- }
- }
-
- return $allSpContainers;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer.php b/lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer.php
deleted file mode 100644
index 1af2432bd3c..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer.php
+++ /dev/null
@@ -1,57 +0,0 @@
-BSECollection[] = $BSE;
- $BSE->setParent($this);
- }
-
- /**
- * Get the collection of BLIP Store Entries
- *
- * @return PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE[]
- */
- public function getBSECollection()
- {
- return $this->BSECollection;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE.php b/lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE.php
deleted file mode 100644
index d17e91e165c..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE.php
+++ /dev/null
@@ -1,112 +0,0 @@
-parent = $parent;
- }
-
- /**
- * Get the BLIP
- *
- * @return PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip
- */
- public function getBlip()
- {
- return $this->blip;
- }
-
- /**
- * Set the BLIP
- *
- * @param PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip $blip
- */
- public function setBlip($blip)
- {
- $this->blip = $blip;
- $blip->setParent($this);
- }
-
- /**
- * Get the BLIP type
- *
- * @return int
- */
- public function getBlipType()
- {
- return $this->blipType;
- }
-
- /**
- * Set the BLIP type
- *
- * @param int
- */
- public function setBlipType($blipType)
- {
- $this->blipType = $blipType;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php b/lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php
deleted file mode 100644
index 3bcbbbe2816..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php
+++ /dev/null
@@ -1,83 +0,0 @@
-data;
- }
-
- /**
- * Set the raw image data
- *
- * @param string
- */
- public function setData($data)
- {
- $this->data = $data;
- }
-
- /**
- * Set parent BSE
- *
- * @param PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE $parent
- */
- public function setParent($parent)
- {
- $this->parent = $parent;
- }
-
- /**
- * Get parent BSE
- *
- * @return PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE $parent
- */
- public function getParent()
- {
- return $this->parent;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/File.php b/lib/phpexcel/PHPExcel/Shared/File.php
deleted file mode 100644
index d3dd2557722..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/File.php
+++ /dev/null
@@ -1,186 +0,0 @@
-open($zipFile) === true) {
- $returnValue = ($zip->getFromName($archiveFile) !== false);
- $zip->close();
- return $returnValue;
- } else {
- return false;
- }
- } else {
- // Regular file_exists
- return file_exists($pFilename);
- }
- }
-
- /**
- * Returns canonicalized absolute pathname, also for ZIP archives
- *
- * @param string $pFilename
- * @return string
- */
- public static function realpath($pFilename)
- {
- // Returnvalue
- $returnValue = '';
-
- // Try using realpath()
- if (file_exists($pFilename)) {
- $returnValue = realpath($pFilename);
- }
-
- // Found something?
- if ($returnValue == '' || ($returnValue === null)) {
- $pathArray = explode('/', $pFilename);
- while (in_array('..', $pathArray) && $pathArray[0] != '..') {
- for ($i = 0; $i < count($pathArray); ++$i) {
- if ($pathArray[$i] == '..' && $i > 0) {
- unset($pathArray[$i]);
- unset($pathArray[$i - 1]);
- break;
- }
- }
- }
- $returnValue = implode('/', $pathArray);
- }
-
- // Return
- return $returnValue;
- }
-
- /**
- * Get the systems temporary directory.
- *
- * @return string
- */
- public static function sys_get_temp_dir()
- {
- // Moodle hack!
- if (function_exists('make_temp_directory')) {
- $temp = make_temp_directory('phpexcel');
- return realpath(dirname($temp));
- }
-
- if (self::$useUploadTempDirectory) {
- // use upload-directory when defined to allow running on environments having very restricted
- // open_basedir configs
- if (ini_get('upload_tmp_dir') !== false) {
- if ($temp = ini_get('upload_tmp_dir')) {
- if (file_exists($temp)) {
- return realpath($temp);
- }
- }
- }
- }
-
- // sys_get_temp_dir is only available since PHP 5.2.1
- // http://php.net/manual/en/function.sys-get-temp-dir.php#94119
- if (!function_exists('sys_get_temp_dir')) {
- if ($temp = getenv('TMP')) {
- if ((!empty($temp)) && (file_exists($temp))) {
- return realpath($temp);
- }
- }
- if ($temp = getenv('TEMP')) {
- if ((!empty($temp)) && (file_exists($temp))) {
- return realpath($temp);
- }
- }
- if ($temp = getenv('TMPDIR')) {
- if ((!empty($temp)) && (file_exists($temp))) {
- return realpath($temp);
- }
- }
-
- // trick for creating a file in system's temporary dir
- // without knowing the path of the system's temporary dir
- $temp = tempnam(__FILE__, '');
- if (file_exists($temp)) {
- unlink($temp);
- return realpath(dirname($temp));
- }
-
- return null;
- }
-
- // use ordinary built-in PHP function
- // There should be no problem with the 5.2.4 Suhosin realpath() bug, because this line should only
- // be called if we're running 5.2.1 or earlier
- return realpath(sys_get_temp_dir());
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/JAMA/CholeskyDecomposition.php b/lib/phpexcel/PHPExcel/Shared/JAMA/CholeskyDecomposition.php
deleted file mode 100644
index d68109b314f..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/JAMA/CholeskyDecomposition.php
+++ /dev/null
@@ -1,148 +0,0 @@
-L = $A->getArray();
- $this->m = $A->getRowDimension();
-
- for ($i = 0; $i < $this->m; ++$i) {
- for ($j = $i; $j < $this->m; ++$j) {
- for ($sum = $this->L[$i][$j], $k = $i - 1; $k >= 0; --$k) {
- $sum -= $this->L[$i][$k] * $this->L[$j][$k];
- }
- if ($i == $j) {
- if ($sum >= 0) {
- $this->L[$i][$i] = sqrt($sum);
- } else {
- $this->isspd = false;
- }
- } else {
- if ($this->L[$i][$i] != 0) {
- $this->L[$j][$i] = $sum / $this->L[$i][$i];
- }
- }
- }
-
- for ($k = $i+1; $k < $this->m; ++$k) {
- $this->L[$i][$k] = 0.0;
- }
- }
- } else {
- throw new PHPExcel_Calculation_Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION));
- }
- } // function __construct()
-
- /**
- * Is the matrix symmetric and positive definite?
- *
- * @return boolean
- */
- public function isSPD()
- {
- return $this->isspd;
- } // function isSPD()
-
- /**
- * getL
- *
- * Return triangular factor.
- * @return Matrix Lower triangular matrix
- */
- public function getL()
- {
- return new Matrix($this->L);
- } // function getL()
-
- /**
- * Solve A*X = B
- *
- * @param $B Row-equal matrix
- * @return Matrix L * L' * X = B
- */
- public function solve($B = null)
- {
- if ($B instanceof Matrix) {
- if ($B->getRowDimension() == $this->m) {
- if ($this->isspd) {
- $X = $B->getArrayCopy();
- $nx = $B->getColumnDimension();
-
- for ($k = 0; $k < $this->m; ++$k) {
- for ($i = $k + 1; $i < $this->m; ++$i) {
- for ($j = 0; $j < $nx; ++$j) {
- $X[$i][$j] -= $X[$k][$j] * $this->L[$i][$k];
- }
- }
- for ($j = 0; $j < $nx; ++$j) {
- $X[$k][$j] /= $this->L[$k][$k];
- }
- }
-
- for ($k = $this->m - 1; $k >= 0; --$k) {
- for ($j = 0; $j < $nx; ++$j) {
- $X[$k][$j] /= $this->L[$k][$k];
- }
- for ($i = 0; $i < $k; ++$i) {
- for ($j = 0; $j < $nx; ++$j) {
- $X[$i][$j] -= $X[$k][$j] * $this->L[$k][$i];
- }
- }
- }
-
- return new Matrix($X, $this->m, $nx);
- } else {
- throw new PHPExcel_Calculation_Exception(JAMAError(MatrixSPDException));
- }
- } else {
- throw new PHPExcel_Calculation_Exception(JAMAError(MATRIX_DIMENSION_EXCEPTION));
- }
- } else {
- throw new PHPExcel_Calculation_Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION));
- }
- } // function solve()
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/JAMA/utils/Error.php b/lib/phpexcel/PHPExcel/Shared/JAMA/utils/Error.php
deleted file mode 100644
index 71b8c994a9b..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/JAMA/utils/Error.php
+++ /dev/null
@@ -1,83 +0,0 @@
- abs($b)) {
- $r = $b / $a;
- $r = abs($a) * sqrt(1 + $r * $r);
- } elseif ($b != 0) {
- $r = $a / $b;
- $r = abs($b) * sqrt(1 + $r * $r);
- } else {
- $r = 0.0;
- }
- return $r;
-} // function hypo()
-
-
-/**
- * Mike Bommarito's version.
- * Compute n-dimensional hyotheneuse.
- *
-function hypot() {
- $s = 0;
- foreach (func_get_args() as $d) {
- if (is_numeric($d)) {
- $s += pow($d, 2);
- } else {
- throw new PHPExcel_Calculation_Exception(JAMAError(ARGUMENT_TYPE_EXCEPTION));
- }
- }
- return sqrt($s);
-}
-*/
diff --git a/lib/phpexcel/PHPExcel/Shared/OLE/ChainedBlockStream.php b/lib/phpexcel/PHPExcel/Shared/OLE/ChainedBlockStream.php
deleted file mode 100644
index 84d2cc50bfb..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/OLE/ChainedBlockStream.php
+++ /dev/null
@@ -1,206 +0,0 @@
-params);
- if (!isset($this->params['oleInstanceId'], $this->params['blockId'], $GLOBALS['_OLE_INSTANCES'][$this->params['oleInstanceId']])) {
- if ($options & STREAM_REPORT_ERRORS) {
- trigger_error('OLE stream not found', E_USER_WARNING);
- }
- return false;
- }
- $this->ole = $GLOBALS['_OLE_INSTANCES'][$this->params['oleInstanceId']];
-
- $blockId = $this->params['blockId'];
- $this->data = '';
- if (isset($this->params['size']) && $this->params['size'] < $this->ole->bigBlockThreshold && $blockId != $this->ole->root->_StartBlock) {
- // Block id refers to small blocks
- $rootPos = $this->ole->_getBlockOffset($this->ole->root->_StartBlock);
- while ($blockId != -2) {
- $pos = $rootPos + $blockId * $this->ole->bigBlockSize;
- $blockId = $this->ole->sbat[$blockId];
- fseek($this->ole->_file_handle, $pos);
- $this->data .= fread($this->ole->_file_handle, $this->ole->bigBlockSize);
- }
- } else {
- // Block id refers to big blocks
- while ($blockId != -2) {
- $pos = $this->ole->_getBlockOffset($blockId);
- fseek($this->ole->_file_handle, $pos);
- $this->data .= fread($this->ole->_file_handle, $this->ole->bigBlockSize);
- $blockId = $this->ole->bbat[$blockId];
- }
- }
- if (isset($this->params['size'])) {
- $this->data = substr($this->data, 0, $this->params['size']);
- }
-
- if ($options & STREAM_USE_PATH) {
- $openedPath = $path;
- }
-
- return true;
- }
-
- /**
- * Implements support for fclose().
- *
- */
- public function stream_close()
- {
- $this->ole = null;
- unset($GLOBALS['_OLE_INSTANCES']);
- }
-
- /**
- * Implements support for fread(), fgets() etc.
- *
- * @param int $count maximum number of bytes to read
- * @return string
- */
- public function stream_read($count)
- {
- if ($this->stream_eof()) {
- return false;
- }
- $s = substr($this->data, $this->pos, $count);
- $this->pos += $count;
- return $s;
- }
-
- /**
- * Implements support for feof().
- *
- * @return bool TRUE if the file pointer is at EOF; otherwise FALSE
- */
- public function stream_eof()
- {
- return $this->pos >= strlen($this->data);
- }
-
- /**
- * Returns the position of the file pointer, i.e. its offset into the file
- * stream. Implements support for ftell().
- *
- * @return int
- */
- public function stream_tell()
- {
- return $this->pos;
- }
-
- /**
- * Implements support for fseek().
- *
- * @param int $offset byte offset
- * @param int $whence SEEK_SET, SEEK_CUR or SEEK_END
- * @return bool
- */
- public function stream_seek($offset, $whence)
- {
- if ($whence == SEEK_SET && $offset >= 0) {
- $this->pos = $offset;
- } elseif ($whence == SEEK_CUR && -$offset <= $this->pos) {
- $this->pos += $offset;
- } elseif ($whence == SEEK_END && -$offset <= sizeof($this->data)) {
- $this->pos = strlen($this->data) + $offset;
- } else {
- return false;
- }
- return true;
- }
-
- /**
- * Implements support for fstat(). Currently the only supported field is
- * "size".
- * @return array
- */
- public function stream_stat()
- {
- return array(
- 'size' => strlen($this->data),
- );
- }
-
- // Methods used by stream_wrapper_register() that are not implemented:
- // bool stream_flush ( void )
- // int stream_write ( string data )
- // bool rename ( string path_from, string path_to )
- // bool mkdir ( string path, int mode, int options )
- // bool rmdir ( string path, int options )
- // bool dir_opendir ( string path, int options )
- // array url_stat ( string path, int flags )
- // string dir_readdir ( void )
- // bool dir_rewinddir ( void )
- // bool dir_closedir ( void )
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/OLE/PPS.php b/lib/phpexcel/PHPExcel/Shared/OLE/PPS.php
deleted file mode 100644
index 608a892aaf0..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/OLE/PPS.php
+++ /dev/null
@@ -1,230 +0,0 @@
- |
-// | Based on OLE::Storage_Lite by Kawai, Takanori |
-// +----------------------------------------------------------------------+
-//
-// $Id: PPS.php,v 1.7 2007/02/13 21:00:42 schmidt Exp $
-
-
-/**
-* Class for creating PPS's for OLE containers
-*
-* @author Xavier Noguer
-* @category PHPExcel
-* @package PHPExcel_Shared_OLE
-*/
-class PHPExcel_Shared_OLE_PPS
-{
- /**
- * The PPS index
- * @var integer
- */
- public $No;
-
- /**
- * The PPS name (in Unicode)
- * @var string
- */
- public $Name;
-
- /**
- * The PPS type. Dir, Root or File
- * @var integer
- */
- public $Type;
-
- /**
- * The index of the previous PPS
- * @var integer
- */
- public $PrevPps;
-
- /**
- * The index of the next PPS
- * @var integer
- */
- public $NextPps;
-
- /**
- * The index of it's first child if this is a Dir or Root PPS
- * @var integer
- */
- public $DirPps;
-
- /**
- * A timestamp
- * @var integer
- */
- public $Time1st;
-
- /**
- * A timestamp
- * @var integer
- */
- public $Time2nd;
-
- /**
- * Starting block (small or big) for this PPS's data inside the container
- * @var integer
- */
- public $_StartBlock;
-
- /**
- * The size of the PPS's data (in bytes)
- * @var integer
- */
- public $Size;
-
- /**
- * The PPS's data (only used if it's not using a temporary file)
- * @var string
- */
- public $_data;
-
- /**
- * Array of child PPS's (only used by Root and Dir PPS's)
- * @var array
- */
- public $children = array();
-
- /**
- * Pointer to OLE container
- * @var OLE
- */
- public $ole;
-
- /**
- * The constructor
- *
- * @access public
- * @param integer $No The PPS index
- * @param string $name The PPS name
- * @param integer $type The PPS type. Dir, Root or File
- * @param integer $prev The index of the previous PPS
- * @param integer $next The index of the next PPS
- * @param integer $dir The index of it's first child if this is a Dir or Root PPS
- * @param integer $time_1st A timestamp
- * @param integer $time_2nd A timestamp
- * @param string $data The (usually binary) source data of the PPS
- * @param array $children Array containing children PPS for this PPS
- */
- public function __construct($No, $name, $type, $prev, $next, $dir, $time_1st, $time_2nd, $data, $children)
- {
- $this->No = $No;
- $this->Name = $name;
- $this->Type = $type;
- $this->PrevPps = $prev;
- $this->NextPps = $next;
- $this->DirPps = $dir;
- $this->Time1st = $time_1st;
- $this->Time2nd = $time_2nd;
- $this->_data = $data;
- $this->children = $children;
- if ($data != '') {
- $this->Size = strlen($data);
- } else {
- $this->Size = 0;
- }
- }
-
- /**
- * Returns the amount of data saved for this PPS
- *
- * @access public
- * @return integer The amount of data (in bytes)
- */
- public function _DataLen()
- {
- if (!isset($this->_data)) {
- return 0;
- }
- //if (isset($this->_PPS_FILE)) {
- // fseek($this->_PPS_FILE, 0);
- // $stats = fstat($this->_PPS_FILE);
- // return $stats[7];
- //} else {
- return strlen($this->_data);
- //}
- }
-
- /**
- * Returns a string with the PPS's WK (What is a WK?)
- *
- * @access public
- * @return string The binary string
- */
- public function _getPpsWk()
- {
- $ret = str_pad($this->Name, 64, "\x00");
-
- $ret .= pack("v", strlen($this->Name) + 2) // 66
- . pack("c", $this->Type) // 67
- . pack("c", 0x00) //UK // 68
- . pack("V", $this->PrevPps) //Prev // 72
- . pack("V", $this->NextPps) //Next // 76
- . pack("V", $this->DirPps) //Dir // 80
- . "\x00\x09\x02\x00" // 84
- . "\x00\x00\x00\x00" // 88
- . "\xc0\x00\x00\x00" // 92
- . "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root
- . "\x00\x00\x00\x00" // 100
- . PHPExcel_Shared_OLE::LocalDate2OLE($this->Time1st) // 108
- . PHPExcel_Shared_OLE::LocalDate2OLE($this->Time2nd) // 116
- . pack("V", isset($this->_StartBlock)?
- $this->_StartBlock:0) // 120
- . pack("V", $this->Size) // 124
- . pack("V", 0); // 128
- return $ret;
- }
-
- /**
- * Updates index and pointers to previous, next and children PPS's for this
- * PPS. I don't think it'll work with Dir PPS's.
- *
- * @access public
- * @param array &$raList Reference to the array of PPS's for the whole OLE
- * container
- * @return integer The index for this PPS
- */
- public static function _savePpsSetPnt(&$raList, $to_save, $depth = 0)
- {
- if (!is_array($to_save) || (empty($to_save))) {
- return 0xFFFFFFFF;
- } elseif (count($to_save) == 1) {
- $cnt = count($raList);
- // If the first entry, it's the root... Don't clone it!
- $raList[$cnt] = ( $depth == 0 ) ? $to_save[0] : clone $to_save[0];
- $raList[$cnt]->No = $cnt;
- $raList[$cnt]->PrevPps = 0xFFFFFFFF;
- $raList[$cnt]->NextPps = 0xFFFFFFFF;
- $raList[$cnt]->DirPps = self::_savePpsSetPnt($raList, @$raList[$cnt]->children, $depth++);
- } else {
- $iPos = floor(count($to_save) / 2);
- $aPrev = array_slice($to_save, 0, $iPos);
- $aNext = array_slice($to_save, $iPos + 1);
- $cnt = count($raList);
- // If the first entry, it's the root... Don't clone it!
- $raList[$cnt] = ( $depth == 0 ) ? $to_save[$iPos] : clone $to_save[$iPos];
- $raList[$cnt]->No = $cnt;
- $raList[$cnt]->PrevPps = self::_savePpsSetPnt($raList, $aPrev, $depth++);
- $raList[$cnt]->NextPps = self::_savePpsSetPnt($raList, $aNext, $depth++);
- $raList[$cnt]->DirPps = self::_savePpsSetPnt($raList, @$raList[$cnt]->children, $depth++);
-
- }
- return $cnt;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/OLE/PPS/File.php b/lib/phpexcel/PHPExcel/Shared/OLE/PPS/File.php
deleted file mode 100644
index 1ca337cbad2..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/OLE/PPS/File.php
+++ /dev/null
@@ -1,74 +0,0 @@
- |
-// | Based on OLE::Storage_Lite by Kawai, Takanori |
-// +----------------------------------------------------------------------+
-//
-// $Id: File.php,v 1.11 2007/02/13 21:00:42 schmidt Exp $
-
-
-/**
-* Class for creating File PPS's for OLE containers
-*
-* @author Xavier Noguer
-* @category PHPExcel
-* @package PHPExcel_Shared_OLE
-*/
-class PHPExcel_Shared_OLE_PPS_File extends PHPExcel_Shared_OLE_PPS
-{
- /**
- * The constructor
- *
- * @access public
- * @param string $name The name of the file (in Unicode)
- * @see OLE::Asc2Ucs()
- */
- public function __construct($name)
- {
- parent::__construct(null, $name, PHPExcel_Shared_OLE::OLE_PPS_TYPE_FILE, null, null, null, null, null, '', array());
- }
-
- /**
- * Initialization method. Has to be called right after OLE_PPS_File().
- *
- * @access public
- * @return mixed true on success
- */
- public function init()
- {
- return true;
- }
-
- /**
- * Append data to PPS
- *
- * @access public
- * @param string $data The data to append
- */
- public function append($data)
- {
- $this->_data .= $data;
- }
-
- /**
- * Returns a stream for reading this file using fread() etc.
- * @return resource a read-only stream
- */
- public function getStream()
- {
- $this->ole->getStream($this);
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/OLE/PPS/Root.php b/lib/phpexcel/PHPExcel/Shared/OLE/PPS/Root.php
deleted file mode 100644
index 5d4052f062c..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/OLE/PPS/Root.php
+++ /dev/null
@@ -1,462 +0,0 @@
- |
-// | Based on OLE::Storage_Lite by Kawai, Takanori |
-// +----------------------------------------------------------------------+
-//
-// $Id: Root.php,v 1.9 2005/04/23 21:53:49 dufuz Exp $
-
-
-/**
-* Class for creating Root PPS's for OLE containers
-*
-* @author Xavier Noguer
-* @category PHPExcel
-* @package PHPExcel_Shared_OLE
-*/
-class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
-{
-
- /**
- * Directory for temporary files
- * @var string
- */
- protected $tempDirectory = null;
-
- /**
- * @param integer $time_1st A timestamp
- * @param integer $time_2nd A timestamp
- */
- public function __construct($time_1st, $time_2nd, $raChild)
- {
- $this->_tempDir = PHPExcel_Shared_File::sys_get_temp_dir();
-
- parent::__construct(null, PHPExcel_Shared_OLE::Asc2Ucs('Root Entry'), PHPExcel_Shared_OLE::OLE_PPS_TYPE_ROOT, null, null, null, $time_1st, $time_2nd, null, $raChild);
- }
-
- /**
- * Method for saving the whole OLE container (including files).
- * In fact, if called with an empty argument (or '-'), it saves to a
- * temporary file and then outputs it's contents to stdout.
- * If a resource pointer to a stream created by fopen() is passed
- * it will be used, but you have to close such stream by yourself.
- *
- * @param string|resource $filename The name of the file or stream where to save the OLE container.
- * @access public
- * @return mixed true on success
- */
- public function save($filename)
- {
- // Initial Setting for saving
- $this->_BIG_BLOCK_SIZE = pow(
- 2,
- (isset($this->_BIG_BLOCK_SIZE))? self::adjust2($this->_BIG_BLOCK_SIZE) : 9
- );
- $this->_SMALL_BLOCK_SIZE= pow(
- 2,
- (isset($this->_SMALL_BLOCK_SIZE))? self::adjust2($this->_SMALL_BLOCK_SIZE) : 6
- );
-
- if (is_resource($filename)) {
- $this->_FILEH_ = $filename;
- } elseif ($filename == '-' || $filename == '') {
- if ($this->tempDirectory === null) {
- $this->tempDirectory = PHPExcel_Shared_File::sys_get_temp_dir();
- }
- $this->_tmp_filename = tempnam($this->tempDirectory, "OLE_PPS_Root");
- $this->_FILEH_ = fopen($this->_tmp_filename, "w+b");
- if ($this->_FILEH_ == false) {
- throw new PHPExcel_Writer_Exception("Can't create temporary file.");
- }
- } else {
- $this->_FILEH_ = fopen($filename, "wb");
- }
- if ($this->_FILEH_ == false) {
- throw new PHPExcel_Writer_Exception("Can't open $filename. It may be in use or protected.");
- }
- // Make an array of PPS's (for Save)
- $aList = array();
- PHPExcel_Shared_OLE_PPS::_savePpsSetPnt($aList, array($this));
- // calculate values for header
- list($iSBDcnt, $iBBcnt, $iPPScnt) = $this->_calcSize($aList); //, $rhInfo);
- // Save Header
- $this->_saveHeader($iSBDcnt, $iBBcnt, $iPPScnt);
-
- // Make Small Data string (write SBD)
- $this->_data = $this->_makeSmallData($aList);
-
- // Write BB
- $this->_saveBigData($iSBDcnt, $aList);
- // Write PPS
- $this->_savePps($aList);
- // Write Big Block Depot and BDList and Adding Header informations
- $this->_saveBbd($iSBDcnt, $iBBcnt, $iPPScnt);
-
- if (!is_resource($filename)) {
- fclose($this->_FILEH_);
- }
-
- return true;
- }
-
- /**
- * Calculate some numbers
- *
- * @access public
- * @param array $raList Reference to an array of PPS's
- * @return array The array of numbers
- */
- public function _calcSize(&$raList)
- {
- // Calculate Basic Setting
- list($iSBDcnt, $iBBcnt, $iPPScnt) = array(0,0,0);
- $iSmallLen = 0;
- $iSBcnt = 0;
- $iCount = count($raList);
- for ($i = 0; $i < $iCount; ++$i) {
- if ($raList[$i]->Type == PHPExcel_Shared_OLE::OLE_PPS_TYPE_FILE) {
- $raList[$i]->Size = $raList[$i]->_DataLen();
- if ($raList[$i]->Size < PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) {
- $iSBcnt += floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE)
- + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0);
- } else {
- $iBBcnt += (floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) +
- (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)? 1: 0));
- }
- }
- }
- $iSmallLen = $iSBcnt * $this->_SMALL_BLOCK_SIZE;
- $iSlCnt = floor($this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE);
- $iSBDcnt = floor($iSBcnt / $iSlCnt) + (($iSBcnt % $iSlCnt)? 1:0);
- $iBBcnt += (floor($iSmallLen / $this->_BIG_BLOCK_SIZE) +
- (( $iSmallLen % $this->_BIG_BLOCK_SIZE)? 1: 0));
- $iCnt = count($raList);
- $iBdCnt = $this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_PPS_SIZE;
- $iPPScnt = (floor($iCnt/$iBdCnt) + (($iCnt % $iBdCnt)? 1: 0));
-
- return array($iSBDcnt, $iBBcnt, $iPPScnt);
- }
-
- /**
- * Helper function for caculating a magic value for block sizes
- *
- * @access public
- * @param integer $i2 The argument
- * @see save()
- * @return integer
- */
- private static function adjust2($i2)
- {
- $iWk = log($i2)/log(2);
- return ($iWk > floor($iWk))? floor($iWk)+1:$iWk;
- }
-
- /**
- * Save OLE header
- *
- * @access public
- * @param integer $iSBDcnt
- * @param integer $iBBcnt
- * @param integer $iPPScnt
- */
- public function _saveHeader($iSBDcnt, $iBBcnt, $iPPScnt)
- {
- $FILE = $this->_FILEH_;
-
- // Calculate Basic Setting
- $iBlCnt = $this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE;
- $i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE;
-
- $iBdExL = 0;
- $iAll = $iBBcnt + $iPPScnt + $iSBDcnt;
- $iAllW = $iAll;
- $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0);
- $iBdCnt = floor(($iAll + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0);
-
- // Calculate BD count
- if ($iBdCnt > $i1stBdL) {
- while (1) {
- ++$iBdExL;
- ++$iAllW;
- $iBdCntW = floor($iAllW / $iBlCnt) + (($iAllW % $iBlCnt)? 1: 0);
- $iBdCnt = floor(($iAllW + $iBdCntW) / $iBlCnt) + ((($iAllW+$iBdCntW) % $iBlCnt)? 1: 0);
- if ($iBdCnt <= ($iBdExL*$iBlCnt+ $i1stBdL)) {
- break;
- }
- }
- }
-
- // Save Header
- fwrite(
- $FILE,
- "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1"
- . "\x00\x00\x00\x00"
- . "\x00\x00\x00\x00"
- . "\x00\x00\x00\x00"
- . "\x00\x00\x00\x00"
- . pack("v", 0x3b)
- . pack("v", 0x03)
- . pack("v", -2)
- . pack("v", 9)
- . pack("v", 6)
- . pack("v", 0)
- . "\x00\x00\x00\x00"
- . "\x00\x00\x00\x00"
- . pack("V", $iBdCnt)
- . pack("V", $iBBcnt+$iSBDcnt) //ROOT START
- . pack("V", 0)
- . pack("V", 0x1000)
- . pack("V", $iSBDcnt ? 0 : -2) //Small Block Depot
- . pack("V", $iSBDcnt)
- );
- // Extra BDList Start, Count
- if ($iBdCnt < $i1stBdL) {
- fwrite(
- $FILE,
- pack("V", -2) // Extra BDList Start
- . pack("V", 0)// Extra BDList Count
- );
- } else {
- fwrite($FILE, pack("V", $iAll+$iBdCnt) . pack("V", $iBdExL));
- }
-
- // BDList
- for ($i = 0; $i < $i1stBdL && $i < $iBdCnt; ++$i) {
- fwrite($FILE, pack("V", $iAll+$i));
- }
- if ($i < $i1stBdL) {
- $jB = $i1stBdL - $i;
- for ($j = 0; $j < $jB; ++$j) {
- fwrite($FILE, (pack("V", -1)));
- }
- }
- }
-
- /**
- * Saving big data (PPS's with data bigger than PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL)
- *
- * @access public
- * @param integer $iStBlk
- * @param array &$raList Reference to array of PPS's
- */
- public function _saveBigData($iStBlk, &$raList)
- {
- $FILE = $this->_FILEH_;
-
- // cycle through PPS's
- $iCount = count($raList);
- for ($i = 0; $i < $iCount; ++$i) {
- if ($raList[$i]->Type != PHPExcel_Shared_OLE::OLE_PPS_TYPE_DIR) {
- $raList[$i]->Size = $raList[$i]->_DataLen();
- if (($raList[$i]->Size >= PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) || (($raList[$i]->Type == PHPExcel_Shared_OLE::OLE_PPS_TYPE_ROOT) && isset($raList[$i]->_data))) {
- // Write Data
- //if (isset($raList[$i]->_PPS_FILE)) {
- // $iLen = 0;
- // fseek($raList[$i]->_PPS_FILE, 0); // To The Top
- // while ($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) {
- // $iLen += strlen($sBuff);
- // fwrite($FILE, $sBuff);
- // }
- //} else {
- fwrite($FILE, $raList[$i]->_data);
- //}
-
- if ($raList[$i]->Size % $this->_BIG_BLOCK_SIZE) {
- fwrite($FILE, str_repeat("\x00", $this->_BIG_BLOCK_SIZE - ($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)));
- }
- // Set For PPS
- $raList[$i]->_StartBlock = $iStBlk;
- $iStBlk +=
- (floor($raList[$i]->Size / $this->_BIG_BLOCK_SIZE) +
- (($raList[$i]->Size % $this->_BIG_BLOCK_SIZE)? 1: 0));
- }
- // Close file for each PPS, and unlink it
- //if (isset($raList[$i]->_PPS_FILE)) {
- // fclose($raList[$i]->_PPS_FILE);
- // $raList[$i]->_PPS_FILE = null;
- // unlink($raList[$i]->_tmp_filename);
- //}
- }
- }
- }
-
- /**
- * get small data (PPS's with data smaller than PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL)
- *
- * @access public
- * @param array &$raList Reference to array of PPS's
- */
- public function _makeSmallData(&$raList)
- {
- $sRes = '';
- $FILE = $this->_FILEH_;
- $iSmBlk = 0;
-
- $iCount = count($raList);
- for ($i = 0; $i < $iCount; ++$i) {
- // Make SBD, small data string
- if ($raList[$i]->Type == PHPExcel_Shared_OLE::OLE_PPS_TYPE_FILE) {
- if ($raList[$i]->Size <= 0) {
- continue;
- }
- if ($raList[$i]->Size < PHPExcel_Shared_OLE::OLE_DATA_SIZE_SMALL) {
- $iSmbCnt = floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE)
- + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0);
- // Add to SBD
- $jB = $iSmbCnt - 1;
- for ($j = 0; $j < $jB; ++$j) {
- fwrite($FILE, pack("V", $j+$iSmBlk+1));
- }
- fwrite($FILE, pack("V", -2));
-
- //// Add to Data String(this will be written for RootEntry)
- //if ($raList[$i]->_PPS_FILE) {
- // fseek($raList[$i]->_PPS_FILE, 0); // To The Top
- // while ($sBuff = fread($raList[$i]->_PPS_FILE, 4096)) {
- // $sRes .= $sBuff;
- // }
- //} else {
- $sRes .= $raList[$i]->_data;
- //}
- if ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE) {
- $sRes .= str_repeat("\x00", $this->_SMALL_BLOCK_SIZE - ($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE));
- }
- // Set for PPS
- $raList[$i]->_StartBlock = $iSmBlk;
- $iSmBlk += $iSmbCnt;
- }
- }
- }
- $iSbCnt = floor($this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE);
- if ($iSmBlk % $iSbCnt) {
- $iB = $iSbCnt - ($iSmBlk % $iSbCnt);
- for ($i = 0; $i < $iB; ++$i) {
- fwrite($FILE, pack("V", -1));
- }
- }
- return $sRes;
- }
-
- /**
- * Saves all the PPS's WKs
- *
- * @access public
- * @param array $raList Reference to an array with all PPS's
- */
- public function _savePps(&$raList)
- {
- // Save each PPS WK
- $iC = count($raList);
- for ($i = 0; $i < $iC; ++$i) {
- fwrite($this->_FILEH_, $raList[$i]->_getPpsWk());
- }
- // Adjust for Block
- $iCnt = count($raList);
- $iBCnt = $this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_PPS_SIZE;
- if ($iCnt % $iBCnt) {
- fwrite($this->_FILEH_, str_repeat("\x00", ($iBCnt - ($iCnt % $iBCnt)) * PHPExcel_Shared_OLE::OLE_PPS_SIZE));
- }
- }
-
- /**
- * Saving Big Block Depot
- *
- * @access public
- * @param integer $iSbdSize
- * @param integer $iBsize
- * @param integer $iPpsCnt
- */
- public function _saveBbd($iSbdSize, $iBsize, $iPpsCnt)
- {
- $FILE = $this->_FILEH_;
- // Calculate Basic Setting
- $iBbCnt = $this->_BIG_BLOCK_SIZE / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE;
- $i1stBdL = ($this->_BIG_BLOCK_SIZE - 0x4C) / PHPExcel_Shared_OLE::OLE_LONG_INT_SIZE;
-
- $iBdExL = 0;
- $iAll = $iBsize + $iPpsCnt + $iSbdSize;
- $iAllW = $iAll;
- $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt)? 1: 0);
- $iBdCnt = floor(($iAll + $iBdCntW) / $iBbCnt) + ((($iAllW+$iBdCntW) % $iBbCnt)? 1: 0);
- // Calculate BD count
- if ($iBdCnt >$i1stBdL) {
- while (1) {
- ++$iBdExL;
- ++$iAllW;
- $iBdCntW = floor($iAllW / $iBbCnt) + (($iAllW % $iBbCnt)? 1: 0);
- $iBdCnt = floor(($iAllW + $iBdCntW) / $iBbCnt) + ((($iAllW+$iBdCntW) % $iBbCnt)? 1: 0);
- if ($iBdCnt <= ($iBdExL*$iBbCnt+ $i1stBdL)) {
- break;
- }
- }
- }
-
- // Making BD
- // Set for SBD
- if ($iSbdSize > 0) {
- for ($i = 0; $i < ($iSbdSize - 1); ++$i) {
- fwrite($FILE, pack("V", $i+1));
- }
- fwrite($FILE, pack("V", -2));
- }
- // Set for B
- for ($i = 0; $i < ($iBsize - 1); ++$i) {
- fwrite($FILE, pack("V", $i+$iSbdSize+1));
- }
- fwrite($FILE, pack("V", -2));
-
- // Set for PPS
- for ($i = 0; $i < ($iPpsCnt - 1); ++$i) {
- fwrite($FILE, pack("V", $i+$iSbdSize+$iBsize+1));
- }
- fwrite($FILE, pack("V", -2));
- // Set for BBD itself ( 0xFFFFFFFD : BBD)
- for ($i = 0; $i < $iBdCnt; ++$i) {
- fwrite($FILE, pack("V", 0xFFFFFFFD));
- }
- // Set for ExtraBDList
- for ($i = 0; $i < $iBdExL; ++$i) {
- fwrite($FILE, pack("V", 0xFFFFFFFC));
- }
- // Adjust for Block
- if (($iAllW + $iBdCnt) % $iBbCnt) {
- $iBlock = ($iBbCnt - (($iAllW + $iBdCnt) % $iBbCnt));
- for ($i = 0; $i < $iBlock; ++$i) {
- fwrite($FILE, pack("V", -1));
- }
- }
- // Extra BDList
- if ($iBdCnt > $i1stBdL) {
- $iN=0;
- $iNb=0;
- for ($i = $i1stBdL; $i < $iBdCnt; $i++, ++$iN) {
- if ($iN >= ($iBbCnt - 1)) {
- $iN = 0;
- ++$iNb;
- fwrite($FILE, pack("V", $iAll+$iBdCnt+$iNb));
- }
- fwrite($FILE, pack("V", $iBsize+$iSbdSize+$iPpsCnt+$i));
- }
- if (($iBdCnt-$i1stBdL) % ($iBbCnt-1)) {
- $iB = ($iBbCnt - 1) - (($iBdCnt - $i1stBdL) % ($iBbCnt - 1));
- for ($i = 0; $i < $iB; ++$i) {
- fwrite($FILE, pack("V", -1));
- }
- }
- fwrite($FILE, pack("V", -2));
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/PCLZip/pclzip.lib.php b/lib/phpexcel/PHPExcel/Shared/PCLZip/pclzip.lib.php
deleted file mode 100644
index a5a9b0a8b00..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/PCLZip/pclzip.lib.php
+++ /dev/null
@@ -1,5173 +0,0 @@
-zipname = $p_zipname;
- $this->zip_fd = 0;
- $this->magic_quotes_status = -1;
-
- // ----- Return
- return;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function :
- // create($p_filelist, $p_add_dir="", $p_remove_dir="")
- // create($p_filelist, $p_option, $p_option_value, ...)
- // Description :
- // This method supports two different synopsis. The first one is historical.
- // This method creates a Zip Archive. The Zip file is created in the
- // filesystem. The files and directories indicated in $p_filelist
- // are added in the archive. See the parameters description for the
- // supported format of $p_filelist.
- // When a directory is in the list, the directory and its content is added
- // in the archive.
- // In this synopsis, the function takes an optional variable list of
- // options. See bellow the supported options.
- // Parameters :
- // $p_filelist : An array containing file or directory names, or
- // a string containing one filename or one directory name, or
- // a string containing a list of filenames and/or directory
- // names separated by spaces.
- // $p_add_dir : A path to add before the real path of the archived file,
- // in order to have it memorized in the archive.
- // $p_remove_dir : A path to remove from the real path of the file to archive,
- // in order to have a shorter path memorized in the archive.
- // When $p_add_dir and $p_remove_dir are set, $p_remove_dir
- // is removed first, before $p_add_dir is added.
- // Options :
- // PCLZIP_OPT_ADD_PATH :
- // PCLZIP_OPT_REMOVE_PATH :
- // PCLZIP_OPT_REMOVE_ALL_PATH :
- // PCLZIP_OPT_COMMENT :
- // PCLZIP_CB_PRE_ADD :
- // PCLZIP_CB_POST_ADD :
- // Return Values :
- // 0 on failure,
- // The list of the added files, with a status of the add action.
- // (see PclZip::listContent() for list entry format)
- // --------------------------------------------------------------------------------
- public function create($p_filelist)
- {
- $v_result=1;
-
- // ----- Reset the error handler
- $this->privErrorReset();
-
- // ----- Set default values
- $v_options = array();
- $v_options[PCLZIP_OPT_NO_COMPRESSION] = false;
-
- // ----- Look for variable options arguments
- $v_size = func_num_args();
-
- // ----- Look for arguments
- if ($v_size > 1) {
- // ----- Get the arguments
- $v_arg_list = func_get_args();
-
- // ----- Remove from the options list the first argument
- array_shift($v_arg_list);
- $v_size--;
-
- // ----- Look for first arg
- if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
- // ----- Parse the options
- $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array (
- PCLZIP_OPT_REMOVE_PATH => 'optional',
- PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
- PCLZIP_OPT_ADD_PATH => 'optional',
- PCLZIP_CB_PRE_ADD => 'optional',
- PCLZIP_CB_POST_ADD => 'optional',
- PCLZIP_OPT_NO_COMPRESSION => 'optional',
- PCLZIP_OPT_COMMENT => 'optional',
- PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',
- PCLZIP_OPT_TEMP_FILE_ON => 'optional',
- PCLZIP_OPT_TEMP_FILE_OFF => 'optional'
- //, PCLZIP_OPT_CRYPT => 'optional'
- ));
- if ($v_result != 1) {
- return 0;
- }
- } else {
- // ----- Look for 2 args
- // Here we need to support the first historic synopsis of the
- // method.
- // ----- Get the first argument
- $v_options[PCLZIP_OPT_ADD_PATH] = $v_arg_list[0];
-
- // ----- Look for the optional second argument
- if ($v_size == 2) {
- $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1];
- } elseif ($v_size > 2) {
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
- return 0;
- }
- }
- }
-
- // ----- Look for default option values
- $this->privOptionDefaultThreshold($v_options);
-
- // ----- Init
- $v_string_list = array();
- $v_att_list = array();
- $v_filedescr_list = array();
- $p_result_list = array();
-
- // ----- Look if the $p_filelist is really an array
- if (is_array($p_filelist)) {
- // ----- Look if the first element is also an array
- // This will mean that this is a file description entry
- if (isset($p_filelist[0]) && is_array($p_filelist[0])) {
- $v_att_list = $p_filelist;
- } else {
- // ----- The list is a list of string names
- $v_string_list = $p_filelist;
- }
- } elseif (is_string($p_filelist)) {
- // ----- Look if the $p_filelist is a string
- // ----- Create a list from the string
- $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist);
- } else {
- // ----- Invalid variable type for $p_filelist
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist");
- return 0;
- }
-
- // ----- Reformat the string list
- if (sizeof($v_string_list) != 0) {
- foreach ($v_string_list as $v_string) {
- if ($v_string != '') {
- $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;
- } else {
- }
- }
- }
-
- // ----- For each file in the list check the attributes
- $v_supported_attributes = array(
- PCLZIP_ATT_FILE_NAME => 'mandatory',
- PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional',
- PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional',
- PCLZIP_ATT_FILE_MTIME => 'optional',
- PCLZIP_ATT_FILE_CONTENT => 'optional',
- PCLZIP_ATT_FILE_COMMENT => 'optional'
- );
- foreach ($v_att_list as $v_entry) {
- $v_result = $this->privFileDescrParseAtt($v_entry, $v_filedescr_list[], $v_options, $v_supported_attributes);
- if ($v_result != 1) {
- return 0;
- }
- }
-
- // ----- Expand the filelist (expand directories)
- $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options);
- if ($v_result != 1) {
- return 0;
- }
-
- // ----- Call the create fct
- $v_result = $this->privCreate($v_filedescr_list, $p_result_list, $v_options);
- if ($v_result != 1) {
- return 0;
- }
-
- // ----- Return
- return $p_result_list;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function :
- // add($p_filelist, $p_add_dir="", $p_remove_dir="")
- // add($p_filelist, $p_option, $p_option_value, ...)
- // Description :
- // This method supports two synopsis. The first one is historical.
- // This methods add the list of files in an existing archive.
- // If a file with the same name already exists, it is added at the end of the
- // archive, the first one is still present.
- // If the archive does not exist, it is created.
- // Parameters :
- // $p_filelist : An array containing file or directory names, or
- // a string containing one filename or one directory name, or
- // a string containing a list of filenames and/or directory
- // names separated by spaces.
- // $p_add_dir : A path to add before the real path of the archived file,
- // in order to have it memorized in the archive.
- // $p_remove_dir : A path to remove from the real path of the file to archive,
- // in order to have a shorter path memorized in the archive.
- // When $p_add_dir and $p_remove_dir are set, $p_remove_dir
- // is removed first, before $p_add_dir is added.
- // Options :
- // PCLZIP_OPT_ADD_PATH :
- // PCLZIP_OPT_REMOVE_PATH :
- // PCLZIP_OPT_REMOVE_ALL_PATH :
- // PCLZIP_OPT_COMMENT :
- // PCLZIP_OPT_ADD_COMMENT :
- // PCLZIP_OPT_PREPEND_COMMENT :
- // PCLZIP_CB_PRE_ADD :
- // PCLZIP_CB_POST_ADD :
- // Return Values :
- // 0 on failure,
- // The list of the added files, with a status of the add action.
- // (see PclZip::listContent() for list entry format)
- // --------------------------------------------------------------------------------
- public function add($p_filelist)
- {
- $v_result=1;
-
- // ----- Reset the error handler
- $this->privErrorReset();
-
- // ----- Set default values
- $v_options = array();
- $v_options[PCLZIP_OPT_NO_COMPRESSION] = false;
-
- // ----- Look for variable options arguments
- $v_size = func_num_args();
-
- // ----- Look for arguments
- if ($v_size > 1) {
- // ----- Get the arguments
- $v_arg_list = func_get_args();
-
- // ----- Remove form the options list the first argument
- array_shift($v_arg_list);
- $v_size--;
-
- // ----- Look for first arg
- if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
- // ----- Parse the options
- $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array (
- PCLZIP_OPT_REMOVE_PATH => 'optional',
- PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
- PCLZIP_OPT_ADD_PATH => 'optional',
- PCLZIP_CB_PRE_ADD => 'optional',
- PCLZIP_CB_POST_ADD => 'optional',
- PCLZIP_OPT_NO_COMPRESSION => 'optional',
- PCLZIP_OPT_COMMENT => 'optional',
- PCLZIP_OPT_ADD_COMMENT => 'optional',
- PCLZIP_OPT_PREPEND_COMMENT => 'optional',
- PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',
- PCLZIP_OPT_TEMP_FILE_ON => 'optional',
- PCLZIP_OPT_TEMP_FILE_OFF => 'optional'
- //, PCLZIP_OPT_CRYPT => 'optional'
- ));
- if ($v_result != 1) {
- return 0;
- }
- } else {
- // ----- Look for 2 args
- // Here we need to support the first historic synopsis of the
- // method.
- // ----- Get the first argument
- $v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0];
-
- // ----- Look for the optional second argument
- if ($v_size == 2) {
- $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1];
- } elseif ($v_size > 2) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
-
- // ----- Return
- return 0;
- }
- }
- }
-
- // ----- Look for default option values
- $this->privOptionDefaultThreshold($v_options);
-
- // ----- Init
- $v_string_list = array();
- $v_att_list = array();
- $v_filedescr_list = array();
- $p_result_list = array();
-
- // ----- Look if the $p_filelist is really an array
- if (is_array($p_filelist)) {
- // ----- Look if the first element is also an array
- // This will mean that this is a file description entry
- if (isset($p_filelist[0]) && is_array($p_filelist[0])) {
- $v_att_list = $p_filelist;
- } else {
- // ----- The list is a list of string names
- $v_string_list = $p_filelist;
- }
- } elseif (is_string($p_filelist)) {
- // ----- Look if the $p_filelist is a string
- // ----- Create a list from the string
- $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist);
- } else {
- // ----- Invalid variable type for $p_filelist
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type '".gettype($p_filelist)."' for p_filelist");
- return 0;
- }
-
- // ----- Reformat the string list
- if (sizeof($v_string_list) != 0) {
- foreach ($v_string_list as $v_string) {
- $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string;
- }
- }
-
- // ----- For each file in the list check the attributes
- $v_supported_attributes = array(
- PCLZIP_ATT_FILE_NAME => 'mandatory',
- PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional',
- PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional',
- PCLZIP_ATT_FILE_MTIME => 'optional',
- PCLZIP_ATT_FILE_CONTENT => 'optional',
- PCLZIP_ATT_FILE_COMMENT => 'optional',
- );
- foreach ($v_att_list as $v_entry) {
- $v_result = $this->privFileDescrParseAtt($v_entry, $v_filedescr_list[], $v_options, $v_supported_attributes);
- if ($v_result != 1) {
- return 0;
- }
- }
-
- // ----- Expand the filelist (expand directories)
- $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options);
- if ($v_result != 1) {
- return 0;
- }
-
- // ----- Call the create fct
- $v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options);
- if ($v_result != 1) {
- return 0;
- }
-
- // ----- Return
- return $p_result_list;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : listContent()
- // Description :
- // This public method, gives the list of the files and directories, with their
- // properties.
- // The properties of each entries in the list are (used also in other functions) :
- // filename : Name of the file. For a create or add action it is the filename
- // given by the user. For an extract function it is the filename
- // of the extracted file.
- // stored_filename : Name of the file / directory stored in the archive.
- // size : Size of the stored file.
- // compressed_size : Size of the file's data compressed in the archive
- // (without the headers overhead)
- // mtime : Last known modification date of the file (UNIX timestamp)
- // comment : Comment associated with the file
- // folder : true | false
- // index : index of the file in the archive
- // status : status of the action (depending of the action) :
- // Values are :
- // ok : OK !
- // filtered : the file / dir is not extracted (filtered by user)
- // already_a_directory : the file can not be extracted because a
- // directory with the same name already exists
- // write_protected : the file can not be extracted because a file
- // with the same name already exists and is
- // write protected
- // newer_exist : the file was not extracted because a newer file exists
- // path_creation_fail : the file is not extracted because the folder
- // does not exist and can not be created
- // write_error : the file was not extracted because there was a
- // error while writing the file
- // read_error : the file was not extracted because there was a error
- // while reading the file
- // invalid_header : the file was not extracted because of an archive
- // format error (bad file header)
- // Note that each time a method can continue operating when there
- // is an action error on a file, the error is only logged in the file status.
- // Return Values :
- // 0 on an unrecoverable failure,
- // The list of the files in the archive.
- // --------------------------------------------------------------------------------
- public function listContent()
- {
- $v_result=1;
-
- // ----- Reset the error handler
- $this->privErrorReset();
-
- // ----- Check archive
- if (!$this->privCheckFormat()) {
- return(0);
- }
-
- // ----- Call the extracting fct
- $p_list = array();
- if (($v_result = $this->privList($p_list)) != 1) {
- unset($p_list);
- return(0);
- }
-
- // ----- Return
- return $p_list;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function :
- // extract($p_path="./", $p_remove_path="")
- // extract([$p_option, $p_option_value, ...])
- // Description :
- // This method supports two synopsis. The first one is historical.
- // This method extract all the files / directories from the archive to the
- // folder indicated in $p_path.
- // If you want to ignore the 'root' part of path of the memorized files
- // you can indicate this in the optional $p_remove_path parameter.
- // By default, if a newer file with the same name already exists, the
- // file is not extracted.
- //
- // If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH aoptions
- // are used, the path indicated in PCLZIP_OPT_ADD_PATH is append
- // at the end of the path value of PCLZIP_OPT_PATH.
- // Parameters :
- // $p_path : Path where the files and directories are to be extracted
- // $p_remove_path : First part ('root' part) of the memorized path
- // (if any similar) to remove while extracting.
- // Options :
- // PCLZIP_OPT_PATH :
- // PCLZIP_OPT_ADD_PATH :
- // PCLZIP_OPT_REMOVE_PATH :
- // PCLZIP_OPT_REMOVE_ALL_PATH :
- // PCLZIP_CB_PRE_EXTRACT :
- // PCLZIP_CB_POST_EXTRACT :
- // Return Values :
- // 0 or a negative value on failure,
- // The list of the extracted files, with a status of the action.
- // (see PclZip::listContent() for list entry format)
- // --------------------------------------------------------------------------------
- public function extract()
- {
- $v_result=1;
-
- // ----- Reset the error handler
- $this->privErrorReset();
-
- // ----- Check archive
- if (!$this->privCheckFormat()) {
- return(0);
- }
-
- // ----- Set default values
- $v_options = array();
- // $v_path = "./";
- $v_path = '';
- $v_remove_path = "";
- $v_remove_all_path = false;
-
- // ----- Look for variable options arguments
- $v_size = func_num_args();
-
- // ----- Default values for option
- $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = false;
-
- // ----- Look for arguments
- if ($v_size > 0) {
- // ----- Get the arguments
- $v_arg_list = func_get_args();
-
- // ----- Look for first arg
- if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
- // ----- Parse the options
- $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array (
- PCLZIP_OPT_PATH => 'optional',
- PCLZIP_OPT_REMOVE_PATH => 'optional',
- PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
- PCLZIP_OPT_ADD_PATH => 'optional',
- PCLZIP_CB_PRE_EXTRACT => 'optional',
- PCLZIP_CB_POST_EXTRACT => 'optional',
- PCLZIP_OPT_SET_CHMOD => 'optional',
- PCLZIP_OPT_BY_NAME => 'optional',
- PCLZIP_OPT_BY_EREG => 'optional',
- PCLZIP_OPT_BY_PREG => 'optional',
- PCLZIP_OPT_BY_INDEX => 'optional',
- PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',
- PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional',
- PCLZIP_OPT_REPLACE_NEWER => 'optional',
- PCLZIP_OPT_STOP_ON_ERROR => 'optional',
- PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional',
- PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',
- PCLZIP_OPT_TEMP_FILE_ON => 'optional',
- PCLZIP_OPT_TEMP_FILE_OFF => 'optional'
- ));
- if ($v_result != 1) {
- return 0;
- }
-
- // ----- Set the arguments
- if (isset($v_options[PCLZIP_OPT_PATH])) {
- $v_path = $v_options[PCLZIP_OPT_PATH];
- }
- if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {
- $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];
- }
- if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
- $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];
- }
- if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {
- // ----- Check for '/' in last path char
- if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {
- $v_path .= '/';
- }
- $v_path .= $v_options[PCLZIP_OPT_ADD_PATH];
- }
- } else {
- // ----- Look for 2 args
- // Here we need to support the first historic synopsis of the
- // method.
- // ----- Get the first argument
- $v_path = $v_arg_list[0];
-
- // ----- Look for the optional second argument
- if ($v_size == 2) {
- $v_remove_path = $v_arg_list[1];
- } elseif ($v_size > 2) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
-
- // ----- Return
- return 0;
- }
- }
- }
-
- // ----- Look for default option values
- $this->privOptionDefaultThreshold($v_options);
-
- // ----- Trace
-
- // ----- Call the extracting fct
- $p_list = array();
- $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options);
- if ($v_result < 1) {
- unset($p_list);
- return(0);
- }
-
- // ----- Return
- return $p_list;
- }
- // --------------------------------------------------------------------------------
-
-
- // --------------------------------------------------------------------------------
- // Function :
- // extractByIndex($p_index, $p_path="./", $p_remove_path="")
- // extractByIndex($p_index, [$p_option, $p_option_value, ...])
- // Description :
- // This method supports two synopsis. The first one is historical.
- // This method is doing a partial extract of the archive.
- // The extracted files or folders are identified by their index in the
- // archive (from 0 to n).
- // Note that if the index identify a folder, only the folder entry is
- // extracted, not all the files included in the archive.
- // Parameters :
- // $p_index : A single index (integer) or a string of indexes of files to
- // extract. The form of the string is "0,4-6,8-12" with only numbers
- // and '-' for range or ',' to separate ranges. No spaces or ';'
- // are allowed.
- // $p_path : Path where the files and directories are to be extracted
- // $p_remove_path : First part ('root' part) of the memorized path
- // (if any similar) to remove while extracting.
- // Options :
- // PCLZIP_OPT_PATH :
- // PCLZIP_OPT_ADD_PATH :
- // PCLZIP_OPT_REMOVE_PATH :
- // PCLZIP_OPT_REMOVE_ALL_PATH :
- // PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and
- // not as files.
- // The resulting content is in a new field 'content' in the file
- // structure.
- // This option must be used alone (any other options are ignored).
- // PCLZIP_CB_PRE_EXTRACT :
- // PCLZIP_CB_POST_EXTRACT :
- // Return Values :
- // 0 on failure,
- // The list of the extracted files, with a status of the action.
- // (see PclZip::listContent() for list entry format)
- // --------------------------------------------------------------------------------
- //function extractByIndex($p_index, options...)
- public function extractByIndex($p_index)
- {
- $v_result=1;
-
- // ----- Reset the error handler
- $this->privErrorReset();
-
- // ----- Check archive
- if (!$this->privCheckFormat()) {
- return(0);
- }
-
- // ----- Set default values
- $v_options = array();
- // $v_path = "./";
- $v_path = '';
- $v_remove_path = "";
- $v_remove_all_path = false;
-
- // ----- Look for variable options arguments
- $v_size = func_num_args();
-
- // ----- Default values for option
- $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = false;
-
- // ----- Look for arguments
- if ($v_size > 1) {
- // ----- Get the arguments
- $v_arg_list = func_get_args();
-
- // ----- Remove form the options list the first argument
- array_shift($v_arg_list);
- $v_size--;
-
- // ----- Look for first arg
- if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) {
- // ----- Parse the options
- $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array(
- PCLZIP_OPT_PATH => 'optional',
- PCLZIP_OPT_REMOVE_PATH => 'optional',
- PCLZIP_OPT_REMOVE_ALL_PATH => 'optional',
- PCLZIP_OPT_EXTRACT_AS_STRING => 'optional',
- PCLZIP_OPT_ADD_PATH => 'optional',
- PCLZIP_CB_PRE_EXTRACT => 'optional',
- PCLZIP_CB_POST_EXTRACT => 'optional',
- PCLZIP_OPT_SET_CHMOD => 'optional',
- PCLZIP_OPT_REPLACE_NEWER => 'optional',
- PCLZIP_OPT_STOP_ON_ERROR => 'optional',
- PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional',
- PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional',
- PCLZIP_OPT_TEMP_FILE_ON => 'optional',
- PCLZIP_OPT_TEMP_FILE_OFF => 'optional'
- ));
- if ($v_result != 1) {
- return 0;
- }
-
- // ----- Set the arguments
- if (isset($v_options[PCLZIP_OPT_PATH])) {
- $v_path = $v_options[PCLZIP_OPT_PATH];
- }
- if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) {
- $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH];
- }
- if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
- $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH];
- }
- if (isset($v_options[PCLZIP_OPT_ADD_PATH])) {
- // ----- Check for '/' in last path char
- if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) {
- $v_path .= '/';
- }
- $v_path .= $v_options[PCLZIP_OPT_ADD_PATH];
- }
- if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) {
- $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = false;
- } else {
- }
- } else {
- // ----- Look for 2 args
- // Here we need to support the first historic synopsis of the
- // method.
-
- // ----- Get the first argument
- $v_path = $v_arg_list[0];
-
- // ----- Look for the optional second argument
- if ($v_size == 2) {
- $v_remove_path = $v_arg_list[1];
- } elseif ($v_size > 2) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments");
-
- // ----- Return
- return 0;
- }
- }
- }
-
- // ----- Trace
-
- // ----- Trick
- // Here I want to reuse extractByRule(), so I need to parse the $p_index
- // with privParseOptions()
- $v_arg_trick = array (PCLZIP_OPT_BY_INDEX, $p_index);
- $v_options_trick = array();
- $v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick, array (PCLZIP_OPT_BY_INDEX => 'optional'));
- if ($v_result != 1) {
- return 0;
- }
- $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX];
-
- // ----- Look for default option values
- $this->privOptionDefaultThreshold($v_options);
-
- // ----- Call the extracting fct
- if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) {
- return(0);
- }
-
- // ----- Return
- return $p_list;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function :
- // delete([$p_option, $p_option_value, ...])
- // Description :
- // This method removes files from the archive.
- // If no parameters are given, then all the archive is emptied.
- // Parameters :
- // None or optional arguments.
- // Options :
- // PCLZIP_OPT_BY_INDEX :
- // PCLZIP_OPT_BY_NAME :
- // PCLZIP_OPT_BY_EREG :
- // PCLZIP_OPT_BY_PREG :
- // Return Values :
- // 0 on failure,
- // The list of the files which are still present in the archive.
- // (see PclZip::listContent() for list entry format)
- // --------------------------------------------------------------------------------
- public function delete()
- {
- $v_result=1;
-
- // ----- Reset the error handler
- $this->privErrorReset();
-
- // ----- Check archive
- if (!$this->privCheckFormat()) {
- return(0);
- }
-
- // ----- Set default values
- $v_options = array();
-
- // ----- Look for variable options arguments
- $v_size = func_num_args();
-
- // ----- Look for arguments
- if ($v_size > 0) {
- // ----- Get the arguments
- $v_arg_list = func_get_args();
-
- // ----- Parse the options
- $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, array (
- PCLZIP_OPT_BY_NAME => 'optional',
- PCLZIP_OPT_BY_EREG => 'optional',
- PCLZIP_OPT_BY_PREG => 'optional',
- PCLZIP_OPT_BY_INDEX => 'optional'
- ));
- if ($v_result != 1) {
- return 0;
- }
- }
-
- // ----- Magic quotes trick
- $this->privDisableMagicQuotes();
-
- // ----- Call the delete fct
- $v_list = array();
- if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) {
- $this->privSwapBackMagicQuotes();
- unset($v_list);
- return(0);
- }
-
- // ----- Magic quotes trick
- $this->privSwapBackMagicQuotes();
-
- // ----- Return
- return $v_list;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : deleteByIndex()
- // Description :
- // ***** Deprecated *****
- // delete(PCLZIP_OPT_BY_INDEX, $p_index) should be prefered.
- // --------------------------------------------------------------------------------
- public function deleteByIndex($p_index)
- {
-
- $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index);
-
- // ----- Return
- return $p_list;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : properties()
- // Description :
- // This method gives the properties of the archive.
- // The properties are :
- // nb : Number of files in the archive
- // comment : Comment associated with the archive file
- // status : not_exist, ok
- // Parameters :
- // None
- // Return Values :
- // 0 on failure,
- // An array with the archive properties.
- // --------------------------------------------------------------------------------
- public function properties()
- {
-
- // ----- Reset the error handler
- $this->privErrorReset();
-
- // ----- Magic quotes trick
- $this->privDisableMagicQuotes();
-
- // ----- Check archive
- if (!$this->privCheckFormat()) {
- $this->privSwapBackMagicQuotes();
- return(0);
- }
-
- // ----- Default properties
- $v_prop = array();
- $v_prop['comment'] = '';
- $v_prop['nb'] = 0;
- $v_prop['status'] = 'not_exist';
-
- // ----- Look if file exists
- if (@is_file($this->zipname)) {
- // ----- Open the zip file
- if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) {
- $this->privSwapBackMagicQuotes();
-
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');
-
- // ----- Return
- return 0;
- }
-
- // ----- Read the central directory informations
- $v_central_dir = array();
- if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) {
- $this->privSwapBackMagicQuotes();
- return 0;
- }
-
- // ----- Close the zip file
- $this->privCloseFd();
-
- // ----- Set the user attributes
- $v_prop['comment'] = $v_central_dir['comment'];
- $v_prop['nb'] = $v_central_dir['entries'];
- $v_prop['status'] = 'ok';
- }
-
- // ----- Magic quotes trick
- $this->privSwapBackMagicQuotes();
-
- // ----- Return
- return $v_prop;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : duplicate()
- // Description :
- // This method creates an archive by copying the content of an other one. If
- // the archive already exist, it is replaced by the new one without any warning.
- // Parameters :
- // $p_archive : The filename of a valid archive, or
- // a valid PclZip object.
- // Return Values :
- // 1 on success.
- // 0 or a negative value on error (error code).
- // --------------------------------------------------------------------------------
- public function duplicate($p_archive)
- {
- $v_result = 1;
-
- // ----- Reset the error handler
- $this->privErrorReset();
-
- // ----- Look if the $p_archive is a PclZip object
- if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip')) {
- // ----- Duplicate the archive
- $v_result = $this->privDuplicate($p_archive->zipname);
- } elseif (is_string($p_archive)) {
- // ----- Look if the $p_archive is a string (so a filename)
- // ----- Check that $p_archive is a valid zip file
- // TBC : Should also check the archive format
- if (!is_file($p_archive)) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "No file with filename '".$p_archive."'");
- $v_result = PCLZIP_ERR_MISSING_FILE;
- } else {
- // ----- Duplicate the archive
- $v_result = $this->privDuplicate($p_archive);
- }
- } else {
- // ----- Invalid variable
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add");
- $v_result = PCLZIP_ERR_INVALID_PARAMETER;
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : merge()
- // Description :
- // This method merge the $p_archive_to_add archive at the end of the current
- // one ($this).
- // If the archive ($this) does not exist, the merge becomes a duplicate.
- // If the $p_archive_to_add archive does not exist, the merge is a success.
- // Parameters :
- // $p_archive_to_add : It can be directly the filename of a valid zip archive,
- // or a PclZip object archive.
- // Return Values :
- // 1 on success,
- // 0 or negative values on error (see below).
- // --------------------------------------------------------------------------------
- public function merge($p_archive_to_add)
- {
- $v_result = 1;
-
- // ----- Reset the error handler
- $this->privErrorReset();
-
- // ----- Check archive
- if (!$this->privCheckFormat()) {
- return(0);
- }
-
- // ----- Look if the $p_archive_to_add is a PclZip object
- if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip')) {
- // ----- Merge the archive
- $v_result = $this->privMerge($p_archive_to_add);
- } elseif (is_string($p_archive_to_add)) {
- // ----- Look if the $p_archive_to_add is a string (so a filename)
- // ----- Create a temporary archive
- $v_object_archive = new PclZip($p_archive_to_add);
-
- // ----- Merge the archive
- $v_result = $this->privMerge($v_object_archive);
- } else {
- // ----- Invalid variable
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add");
- $v_result = PCLZIP_ERR_INVALID_PARAMETER;
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
-
-
- // --------------------------------------------------------------------------------
- // Function : errorCode()
- // Description :
- // Parameters :
- // --------------------------------------------------------------------------------
- public function errorCode()
- {
- if (PCLZIP_ERROR_EXTERNAL == 1) {
- return(PclErrorCode());
- } else {
- return($this->error_code);
- }
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : errorName()
- // Description :
- // Parameters :
- // --------------------------------------------------------------------------------
- public function errorName($p_with_code = false)
- {
- $v_name = array(
- PCLZIP_ERR_NO_ERROR => 'PCLZIP_ERR_NO_ERROR',
- PCLZIP_ERR_WRITE_OPEN_FAIL => 'PCLZIP_ERR_WRITE_OPEN_FAIL',
- PCLZIP_ERR_READ_OPEN_FAIL => 'PCLZIP_ERR_READ_OPEN_FAIL',
- PCLZIP_ERR_INVALID_PARAMETER => 'PCLZIP_ERR_INVALID_PARAMETER',
- PCLZIP_ERR_MISSING_FILE => 'PCLZIP_ERR_MISSING_FILE',
- PCLZIP_ERR_FILENAME_TOO_LONG => 'PCLZIP_ERR_FILENAME_TOO_LONG',
- PCLZIP_ERR_INVALID_ZIP => 'PCLZIP_ERR_INVALID_ZIP',
- PCLZIP_ERR_BAD_EXTRACTED_FILE => 'PCLZIP_ERR_BAD_EXTRACTED_FILE',
- PCLZIP_ERR_DIR_CREATE_FAIL => 'PCLZIP_ERR_DIR_CREATE_FAIL',
- PCLZIP_ERR_BAD_EXTENSION => 'PCLZIP_ERR_BAD_EXTENSION',
- PCLZIP_ERR_BAD_FORMAT => 'PCLZIP_ERR_BAD_FORMAT',
- PCLZIP_ERR_DELETE_FILE_FAIL => 'PCLZIP_ERR_DELETE_FILE_FAIL',
- PCLZIP_ERR_RENAME_FILE_FAIL => 'PCLZIP_ERR_RENAME_FILE_FAIL',
- PCLZIP_ERR_BAD_CHECKSUM => 'PCLZIP_ERR_BAD_CHECKSUM',
- PCLZIP_ERR_INVALID_ARCHIVE_ZIP => 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP',
- PCLZIP_ERR_MISSING_OPTION_VALUE => 'PCLZIP_ERR_MISSING_OPTION_VALUE',
- PCLZIP_ERR_INVALID_OPTION_VALUE => 'PCLZIP_ERR_INVALID_OPTION_VALUE',
- PCLZIP_ERR_UNSUPPORTED_COMPRESSION => 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION',
- PCLZIP_ERR_UNSUPPORTED_ENCRYPTION => 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION',
- PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE => 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE',
- PCLZIP_ERR_DIRECTORY_RESTRICTION => 'PCLZIP_ERR_DIRECTORY_RESTRICTION',
- );
-
- if (isset($v_name[$this->error_code])) {
- $v_value = $v_name[$this->error_code];
- } else {
- $v_value = 'NoName';
- }
-
- if ($p_with_code) {
- return($v_value.' ('.$this->error_code.')');
- } else {
- return($v_value);
- }
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : errorInfo()
- // Description :
- // Parameters :
- // --------------------------------------------------------------------------------
- public function errorInfo($p_full = false)
- {
- if (PCLZIP_ERROR_EXTERNAL == 1) {
- return(PclErrorString());
- } else {
- if ($p_full) {
- return($this->errorName(true)." : ".$this->error_string);
- } else {
- return($this->error_string." [code ".$this->error_code."]");
- }
- }
- }
- // --------------------------------------------------------------------------------
-
-
- // --------------------------------------------------------------------------------
- // ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS *****
- // ***** *****
- // ***** THESES FUNCTIONS MUST NOT BE USED DIRECTLY *****
- // --------------------------------------------------------------------------------
-
-
-
- // --------------------------------------------------------------------------------
- // Function : privCheckFormat()
- // Description :
- // This method check that the archive exists and is a valid zip archive.
- // Several level of check exists. (futur)
- // Parameters :
- // $p_level : Level of check. Default 0.
- // 0 : Check the first bytes (magic codes) (default value))
- // 1 : 0 + Check the central directory (futur)
- // 2 : 1 + Check each file header (futur)
- // Return Values :
- // true on success,
- // false on error, the error code is set.
- // --------------------------------------------------------------------------------
- public function privCheckFormat($p_level = 0)
- {
- $v_result = true;
-
- // ----- Reset the file system cache
- clearstatcache();
-
- // ----- Reset the error handler
- $this->privErrorReset();
-
- // ----- Look if the file exits
- if (!is_file($this->zipname)) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "Missing archive file '".$this->zipname."'");
- return(false);
- }
-
- // ----- Check that the file is readeable
- if (!is_readable($this->zipname)) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '".$this->zipname."'");
- return(false);
- }
-
- // ----- Check the magic code
- // TBC
-
- // ----- Check the central header
- // TBC
-
- // ----- Check each file header
- // TBC
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privParseOptions()
- // Description :
- // This internal methods reads the variable list of arguments ($p_options_list,
- // $p_size) and generate an array with the options and values ($v_result_list).
- // $v_requested_options contains the options that can be present and those that
- // must be present.
- // $v_requested_options is an array, with the option value as key, and 'optional',
- // or 'mandatory' as value.
- // Parameters :
- // See above.
- // Return Values :
- // 1 on success.
- // 0 on failure.
- // --------------------------------------------------------------------------------
- public function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options = false)
- {
- $v_result=1;
-
- // ----- Read the options
- $i=0;
- while ($i<$p_size) {
- // ----- Check if the option is supported
- if (!isset($v_requested_options[$p_options_list[$i]])) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid optional parameter '".$p_options_list[$i]."' for this method");
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Look for next option
- switch ($p_options_list[$i]) {
- // ----- Look for options that request a path value
- case PCLZIP_OPT_PATH:
- case PCLZIP_OPT_REMOVE_PATH:
- case PCLZIP_OPT_ADD_PATH:
- // ----- Check the number of parameters
- if (($i+1) >= $p_size) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Get the value
- $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], false);
- $i++;
- break;
-
- case PCLZIP_OPT_TEMP_FILE_THRESHOLD:
- // ----- Check the number of parameters
- if (($i+1) >= $p_size) {
- PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
- return PclZip::errorCode();
- }
-
- // ----- Check for incompatible options
- if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) {
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'");
- return PclZip::errorCode();
- }
-
- // ----- Check the value
- $v_value = $p_options_list[$i+1];
- if ((!is_integer($v_value)) || ($v_value<0)) {
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Integer expected for option '".PclZipUtilOptionText($p_options_list[$i])."'");
- return PclZip::errorCode();
- }
-
- // ----- Get the value (and convert it in bytes)
- $v_result_list[$p_options_list[$i]] = $v_value*1048576;
- $i++;
- break;
-
- case PCLZIP_OPT_TEMP_FILE_ON:
- // ----- Check for incompatible options
- if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) {
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'");
- return PclZip::errorCode();
- }
-
- $v_result_list[$p_options_list[$i]] = true;
- break;
-
- case PCLZIP_OPT_TEMP_FILE_OFF:
- // ----- Check for incompatible options
- if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_ON])) {
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_ON'");
- return PclZip::errorCode();
- }
- // ----- Check for incompatible options
- if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) {
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_THRESHOLD'");
- return PclZip::errorCode();
- }
- $v_result_list[$p_options_list[$i]] = true;
- break;
-
- case PCLZIP_OPT_EXTRACT_DIR_RESTRICTION:
- // ----- Check the number of parameters
- if (($i+1) >= $p_size) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Get the value
- if (is_string($p_options_list[$i+1]) && ($p_options_list[$i+1] != '')) {
- $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], false);
- $i++;
- } else {
- }
- break;
- // ----- Look for options that request an array of string for value
- case PCLZIP_OPT_BY_NAME:
- // ----- Check the number of parameters
- if (($i+1) >= $p_size) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Get the value
- if (is_string($p_options_list[$i+1])) {
- $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1];
- } elseif (is_array($p_options_list[$i+1])) {
- $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
- } else {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
- // ----- Return
- return PclZip::errorCode();
- }
- $i++;
- break;
- // ----- Look for options that request an EREG or PREG expression
- case PCLZIP_OPT_BY_EREG:
- // ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG
- // to PCLZIP_OPT_BY_PREG
- $p_options_list[$i] = PCLZIP_OPT_BY_PREG;
- case PCLZIP_OPT_BY_PREG:
- //case PCLZIP_OPT_CRYPT :
- // ----- Check the number of parameters
- if (($i+1) >= $p_size) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Get the value
- if (is_string($p_options_list[$i+1])) {
- $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
- } else {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
- // ----- Return
- return PclZip::errorCode();
- }
- $i++;
- break;
-
- // ----- Look for options that takes a string
- case PCLZIP_OPT_COMMENT:
- case PCLZIP_OPT_ADD_COMMENT:
- case PCLZIP_OPT_PREPEND_COMMENT:
- // ----- Check the number of parameters
- if (($i+1) >= $p_size) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Get the value
- if (is_string($p_options_list[$i+1])) {
- $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
- } else {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '" .PclZipUtilOptionText($p_options_list[$i]) ."'");
-
- // ----- Return
- return PclZip::errorCode();
- }
- $i++;
- break;
-
- // ----- Look for options that request an array of index
- case PCLZIP_OPT_BY_INDEX:
- // ----- Check the number of parameters
- if (($i+1) >= $p_size) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Get the value
- $v_work_list = array();
- if (is_string($p_options_list[$i+1])) {
- // ----- Remove spaces
- $p_options_list[$i+1] = strtr($p_options_list[$i+1], ' ', '');
-
- // ----- Parse items
- $v_work_list = explode(",", $p_options_list[$i+1]);
- } elseif (is_integer($p_options_list[$i+1])) {
- $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1];
- } elseif (is_array($p_options_list[$i+1])) {
- $v_work_list = $p_options_list[$i+1];
- } else {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Value must be integer, string or array for option '".PclZipUtilOptionText($p_options_list[$i])."'");
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Reduce the index list
- // each index item in the list must be a couple with a start and
- // an end value : [0,3], [5-5], [8-10], ...
- // ----- Check the format of each item
- $v_sort_flag=false;
- $v_sort_value=0;
- for ($j=0; $j= $p_size) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
- // ----- Return
- return PclZip::errorCode();
- }
- // ----- Get the value
- $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1];
- $i++;
- break;
-
- // ----- Look for options that request a call-back
- case PCLZIP_CB_PRE_EXTRACT:
- case PCLZIP_CB_POST_EXTRACT:
- case PCLZIP_CB_PRE_ADD:
- case PCLZIP_CB_POST_ADD:
- /* for futur use
- case PCLZIP_CB_PRE_DELETE :
- case PCLZIP_CB_POST_DELETE :
- case PCLZIP_CB_PRE_LIST :
- case PCLZIP_CB_POST_LIST :
- */
- // ----- Check the number of parameters
- if (($i+1) >= $p_size) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'");
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Get the value
- $v_function_name = $p_options_list[$i+1];
-
- // ----- Check that the value is a valid existing function
- if (!function_exists($v_function_name)) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Function '".$v_function_name."()' is not an existing function for option '".PclZipUtilOptionText($p_options_list[$i])."'");
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Set the attribute
- $v_result_list[$p_options_list[$i]] = $v_function_name;
- $i++;
- break;
- default:
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Unknown parameter '" .$p_options_list[$i]."'");
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Next options
- $i++;
- }
-
- // ----- Look for mandatory options
- if ($v_requested_options !== false) {
- for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) {
- // ----- Look for mandatory option
- if ($v_requested_options[$key] == 'mandatory') {
- // ----- Look if present
- if (!isset($v_result_list[$key])) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")");
-
- // ----- Return
- return PclZip::errorCode();
- }
- }
- }
- }
-
- // ----- Look for default values
- if (!isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) {
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privOptionDefaultThreshold()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privOptionDefaultThreshold(&$p_options)
- {
- $v_result=1;
-
- if (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) || isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) {
- return $v_result;
- }
-
- // ----- Get 'memory_limit' configuration value
- $v_memory_limit = ini_get('memory_limit');
- $v_memory_limit = trim($v_memory_limit);
- $last = strtolower(substr($v_memory_limit, -1));
-
- if ($last == 'g') {
- //$v_memory_limit = $v_memory_limit*1024*1024*1024;
- $v_memory_limit = $v_memory_limit*1073741824;
- }
- if ($last == 'm') {
- //$v_memory_limit = $v_memory_limit*1024*1024;
- $v_memory_limit = $v_memory_limit*1048576;
- }
- if ($last == 'k') {
- $v_memory_limit = $v_memory_limit*1024;
- }
-
- $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit*PCLZIP_TEMPORARY_FILE_RATIO);
-
- // ----- Sanity check : No threshold if value lower than 1M
- if ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] < 1048576) {
- unset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]);
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privFileDescrParseAtt()
- // Description :
- // Parameters :
- // Return Values :
- // 1 on success.
- // 0 on failure.
- // --------------------------------------------------------------------------------
- public function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options = false)
- {
- $v_result=1;
-
- // ----- For each file in the list check the attributes
- foreach ($p_file_list as $v_key => $v_value) {
- // ----- Check if the option is supported
- if (!isset($v_requested_options[$v_key])) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file attribute '".$v_key."' for this file");
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Look for attribute
- switch ($v_key) {
- case PCLZIP_ATT_FILE_NAME:
- if (!is_string($v_value)) {
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
- return PclZip::errorCode();
- }
-
- $p_filedescr['filename'] = PclZipUtilPathReduction($v_value);
-
- if ($p_filedescr['filename'] == '') {
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'");
- return PclZip::errorCode();
- }
- break;
- case PCLZIP_ATT_FILE_NEW_SHORT_NAME:
- if (!is_string($v_value)) {
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
- return PclZip::errorCode();
- }
-
- $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value);
-
- if ($p_filedescr['new_short_name'] == '') {
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '".PclZipUtilOptionText($v_key)."'");
- return PclZip::errorCode();
- }
- break;
- case PCLZIP_ATT_FILE_NEW_FULL_NAME:
- if (!is_string($v_value)) {
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
- return PclZip::errorCode();
- }
-
- $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value);
-
- if ($p_filedescr['new_full_name'] == '') {
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '".PclZipUtilOptionText($v_key)."'");
- return PclZip::errorCode();
- }
- break;
- // ----- Look for options that takes a string
- case PCLZIP_ATT_FILE_COMMENT:
- if (!is_string($v_value)) {
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'");
- return PclZip::errorCode();
- }
- $p_filedescr['comment'] = $v_value;
- break;
- case PCLZIP_ATT_FILE_MTIME:
- if (!is_integer($v_value)) {
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". Integer expected for attribute '".PclZipUtilOptionText($v_key)."'");
- return PclZip::errorCode();
- }
- $p_filedescr['mtime'] = $v_value;
- break;
- case PCLZIP_ATT_FILE_CONTENT:
- $p_filedescr['content'] = $v_value;
- break;
- default:
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Unknown parameter '".$v_key."'");
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Look for mandatory options
- if ($v_requested_options !== false) {
- for ($key = reset($v_requested_options); $key = key($v_requested_options); $key = next($v_requested_options)) {
- // ----- Look for mandatory option
- if ($v_requested_options[$key] == 'mandatory') {
- // ----- Look if present
- if (!isset($p_file_list[$key])) {
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")");
- return PclZip::errorCode();
- }
- }
- }
- }
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privFileDescrExpand()
- // Description :
- // This method look for each item of the list to see if its a file, a folder
- // or a string to be added as file. For any other type of files (link, other)
- // just ignore the item.
- // Then prepare the information that will be stored for that file.
- // When its a folder, expand the folder with all the files that are in that
- // folder (recursively).
- // Parameters :
- // Return Values :
- // 1 on success.
- // 0 on failure.
- // --------------------------------------------------------------------------------
- public function privFileDescrExpand(&$p_filedescr_list, &$p_options)
- {
- $v_result=1;
-
- // ----- Create a result list
- $v_result_list = array();
-
- // ----- Look each entry
- for ($i=0; $iprivCalculateStoredFilename($v_descr, $p_options);
-
- // ----- Add the descriptor in result list
- $v_result_list[sizeof($v_result_list)] = $v_descr;
-
- // ----- Look for folder
- if ($v_descr['type'] == 'folder') {
- // ----- List of items in folder
- $v_dirlist_descr = array();
- $v_dirlist_nb = 0;
- if ($v_folder_handler = @opendir($v_descr['filename'])) {
- while (($v_item_handler = @readdir($v_folder_handler)) !== false) {
- // ----- Skip '.' and '..'
- if (($v_item_handler == '.') || ($v_item_handler == '..')) {
- continue;
- }
-
- // ----- Compose the full filename
- $v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler;
-
- // ----- Look for different stored filename
- // Because the name of the folder was changed, the name of the
- // files/sub-folders also change
- if (($v_descr['stored_filename'] != $v_descr['filename'])
- && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))) {
- if ($v_descr['stored_filename'] != '') {
- $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler;
- } else {
- $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_item_handler;
- }
- }
- $v_dirlist_nb++;
- }
-
- @closedir($v_folder_handler);
- } else {
- // TBC : unable to open folder in read mode
- }
-
- // ----- Expand each element of the list
- if ($v_dirlist_nb != 0) {
- // ----- Expand
- if (($v_result = $this->privFileDescrExpand($v_dirlist_descr, $p_options)) != 1) {
- return $v_result;
- }
-
- // ----- Concat the resulting list
- $v_result_list = array_merge($v_result_list, $v_dirlist_descr);
- }
-
- // ----- Free local array
- unset($v_dirlist_descr);
- }
- }
-
- // ----- Get the result list
- $p_filedescr_list = $v_result_list;
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privCreate()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privCreate($p_filedescr_list, &$p_result_list, &$p_options)
- {
- $v_result=1;
- $v_list_detail = array();
-
- // ----- Magic quotes trick
- $this->privDisableMagicQuotes();
-
- // ----- Open the file in write mode
- if (($v_result = $this->privOpenFd('wb')) != 1) {
- // ----- Return
- return $v_result;
- }
-
- // ----- Add the list of files
- $v_result = $this->privAddList($p_filedescr_list, $p_result_list, $p_options);
-
- // ----- Close
- $this->privCloseFd();
-
- // ----- Magic quotes trick
- $this->privSwapBackMagicQuotes();
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privAdd()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privAdd($p_filedescr_list, &$p_result_list, &$p_options)
- {
- $v_result=1;
- $v_list_detail = array();
-
- // ----- Look if the archive exists or is empty
- if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0)) {
- // ----- Do a create
- $v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options);
-
- // ----- Return
- return $v_result;
- }
- // ----- Magic quotes trick
- $this->privDisableMagicQuotes();
-
- // ----- Open the zip file
- if (($v_result=$this->privOpenFd('rb')) != 1) {
- // ----- Magic quotes trick
- $this->privSwapBackMagicQuotes();
-
- // ----- Return
- return $v_result;
- }
-
- // ----- Read the central directory informations
- $v_central_dir = array();
- if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) {
- $this->privCloseFd();
- $this->privSwapBackMagicQuotes();
- return $v_result;
- }
-
- // ----- Go to beginning of File
- @rewind($this->zip_fd);
-
- // ----- Creates a temporay file
- $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';
-
- // ----- Open the temporary file in write mode
- if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) {
- $this->privCloseFd();
- $this->privSwapBackMagicQuotes();
-
- PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode');
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Copy the files from the archive to the temporary file
- // TBC : Here I should better append the file and go back to erase the central dir
- $v_size = $v_central_dir['offset'];
- while ($v_size != 0) {
- $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- $v_buffer = fread($this->zip_fd, $v_read_size);
- @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
- $v_size -= $v_read_size;
- }
-
- // ----- Swap the file descriptor
- // Here is a trick : I swap the temporary fd with the zip fd, in order to use
- // the following methods on the temporary fil and not the real archive
- $v_swap = $this->zip_fd;
- $this->zip_fd = $v_zip_temp_fd;
- $v_zip_temp_fd = $v_swap;
-
- // ----- Add the files
- $v_header_list = array();
- if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) {
- fclose($v_zip_temp_fd);
- $this->privCloseFd();
- @unlink($v_zip_temp_name);
- $this->privSwapBackMagicQuotes();
-
- // ----- Return
- return $v_result;
- }
-
- // ----- Store the offset of the central dir
- $v_offset = @ftell($this->zip_fd);
-
- // ----- Copy the block of file headers from the old archive
- $v_size = $v_central_dir['size'];
- while ($v_size != 0) {
- $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- $v_buffer = @fread($v_zip_temp_fd, $v_read_size);
- @fwrite($this->zip_fd, $v_buffer, $v_read_size);
- $v_size -= $v_read_size;
- }
-
- // ----- Create the Central Dir files header
- for ($i=0, $v_count=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) {
- fclose($v_zip_temp_fd);
- $this->privCloseFd();
- @unlink($v_zip_temp_name);
- $this->privSwapBackMagicQuotes();
-
- // ----- Return
- return $v_result;
- }
- $v_count++;
- }
-
- // ----- Transform the header to a 'usable' info
- $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);
- }
-
- // ----- Zip file comment
- $v_comment = $v_central_dir['comment'];
- if (isset($p_options[PCLZIP_OPT_COMMENT])) {
- $v_comment = $p_options[PCLZIP_OPT_COMMENT];
- }
- if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) {
- $v_comment = $v_comment.$p_options[PCLZIP_OPT_ADD_COMMENT];
- }
- if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) {
- $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT].$v_comment;
- }
-
- // ----- Calculate the size of the central header
- $v_size = @ftell($this->zip_fd)-$v_offset;
-
- // ----- Create the central dir footer
- if (($v_result = $this->privWriteCentralHeader($v_count+$v_central_dir['entries'], $v_size, $v_offset, $v_comment)) != 1) {
- // ----- Reset the file list
- unset($v_header_list);
- $this->privSwapBackMagicQuotes();
-
- // ----- Return
- return $v_result;
- }
-
- // ----- Swap back the file descriptor
- $v_swap = $this->zip_fd;
- $this->zip_fd = $v_zip_temp_fd;
- $v_zip_temp_fd = $v_swap;
-
- // ----- Close
- $this->privCloseFd();
-
- // ----- Close the temporary file
- @fclose($v_zip_temp_fd);
-
- // ----- Magic quotes trick
- $this->privSwapBackMagicQuotes();
-
- // ----- Delete the zip file
- // TBC : I should test the result ...
- @unlink($this->zipname);
-
- // ----- Rename the temporary file
- // TBC : I should test the result ...
- //@rename($v_zip_temp_name, $this->zipname);
- PclZipUtilRename($v_zip_temp_name, $this->zipname);
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privOpenFd()
- // Description :
- // Parameters :
- // --------------------------------------------------------------------------------
- public function privOpenFd($p_mode)
- {
- $v_result=1;
-
- // ----- Look if already open
- if ($this->zip_fd != 0) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \''.$this->zipname.'\' already open');
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Open the zip file
- if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in '.$p_mode.' mode');
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privCloseFd()
- // Description :
- // Parameters :
- // --------------------------------------------------------------------------------
- public function privCloseFd()
- {
- $v_result=1;
-
- if ($this->zip_fd != 0) {
- @fclose($this->zip_fd);
- }
- $this->zip_fd = 0;
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privAddList()
- // Description :
- // $p_add_dir and $p_remove_dir will give the ability to memorize a path which is
- // different from the real path of the file. This is usefull if you want to have PclTar
- // running in any directory, and memorize relative path from an other directory.
- // Parameters :
- // $p_list : An array containing the file or directory names to add in the tar
- // $p_result_list : list of added files with their properties (specially the status field)
- // $p_add_dir : Path to add in the filename path archived
- // $p_remove_dir : Path to remove in the filename path archived
- // Return Values :
- // --------------------------------------------------------------------------------
- // public function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options)
- public function privAddList($p_filedescr_list, &$p_result_list, &$p_options)
- {
- $v_result=1;
-
- // ----- Add the files
- $v_header_list = array();
- if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) {
- // ----- Return
- return $v_result;
- }
-
- // ----- Store the offset of the central dir
- $v_offset = @ftell($this->zip_fd);
-
- // ----- Create the Central Dir files header
- for ($i=0, $v_count=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) {
- // ----- Return
- return $v_result;
- }
- $v_count++;
- }
-
- // ----- Transform the header to a 'usable' info
- $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);
- }
-
- // ----- Zip file comment
- $v_comment = '';
- if (isset($p_options[PCLZIP_OPT_COMMENT])) {
- $v_comment = $p_options[PCLZIP_OPT_COMMENT];
- }
-
- // ----- Calculate the size of the central header
- $v_size = @ftell($this->zip_fd)-$v_offset;
-
- // ----- Create the central dir footer
- if (($v_result = $this->privWriteCentralHeader($v_count, $v_size, $v_offset, $v_comment)) != 1) {
- // ----- Reset the file list
- unset($v_header_list);
-
- // ----- Return
- return $v_result;
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privAddFileList()
- // Description :
- // Parameters :
- // $p_filedescr_list : An array containing the file description
- // or directory names to add in the zip
- // $p_result_list : list of added files with their properties (specially the status field)
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options)
- {
- $v_result=1;
- $v_header = array();
-
- // ----- Recuperate the current number of elt in list
- $v_nb = sizeof($p_result_list);
-
- // ----- Loop on the files
- for ($j=0; ($jprivAddFile($p_filedescr_list[$j], $v_header, $p_options);
- if ($v_result != 1) {
- return $v_result;
- }
-
- // ----- Store the file infos
- $p_result_list[$v_nb++] = $v_header;
- }
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privAddFile()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privAddFile($p_filedescr, &$p_header, &$p_options)
- {
- $v_result=1;
-
- // ----- Working variable
- $p_filename = $p_filedescr['filename'];
-
- // TBC : Already done in the fileAtt check ... ?
- if ($p_filename == "") {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)");
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Look for a stored different filename
- /* TBC : Removed
- if (isset($p_filedescr['stored_filename'])) {
- $v_stored_filename = $p_filedescr['stored_filename'];
- }
- else {
- $v_stored_filename = $p_filedescr['stored_filename'];
- }
- */
-
- // ----- Set the file properties
- clearstatcache();
- $p_header['version'] = 20;
- $p_header['version_extracted'] = 10;
- $p_header['flag'] = 0;
- $p_header['compression'] = 0;
- $p_header['crc'] = 0;
- $p_header['compressed_size'] = 0;
- $p_header['filename_len'] = strlen($p_filename);
- $p_header['extra_len'] = 0;
- $p_header['disk'] = 0;
- $p_header['internal'] = 0;
- $p_header['offset'] = 0;
- $p_header['filename'] = $p_filename;
- // TBC : Removed $p_header['stored_filename'] = $v_stored_filename;
- $p_header['stored_filename'] = $p_filedescr['stored_filename'];
- $p_header['extra'] = '';
- $p_header['status'] = 'ok';
- $p_header['index'] = -1;
-
- // ----- Look for regular file
- if ($p_filedescr['type']=='file') {
- $p_header['external'] = 0x00000000;
- $p_header['size'] = filesize($p_filename);
- } elseif ($p_filedescr['type']=='folder') {
- // ----- Look for regular folder
- $p_header['external'] = 0x00000010;
- $p_header['mtime'] = filemtime($p_filename);
- $p_header['size'] = filesize($p_filename);
- } elseif ($p_filedescr['type'] == 'virtual_file') {
- // ----- Look for virtual file
- $p_header['external'] = 0x00000000;
- $p_header['size'] = strlen($p_filedescr['content']);
- }
-
- // ----- Look for filetime
- if (isset($p_filedescr['mtime'])) {
- $p_header['mtime'] = $p_filedescr['mtime'];
- } elseif ($p_filedescr['type'] == 'virtual_file') {
- $p_header['mtime'] = time();
- } else {
- $p_header['mtime'] = filemtime($p_filename);
- }
-
- // ------ Look for file comment
- if (isset($p_filedescr['comment'])) {
- $p_header['comment_len'] = strlen($p_filedescr['comment']);
- $p_header['comment'] = $p_filedescr['comment'];
- } else {
- $p_header['comment_len'] = 0;
- $p_header['comment'] = '';
- }
-
- // ----- Look for pre-add callback
- if (isset($p_options[PCLZIP_CB_PRE_ADD])) {
- // ----- Generate a local information
- $v_local_header = array();
- $this->privConvertHeader2FileInfo($p_header, $v_local_header);
-
- // ----- Call the callback
- // Here I do not use call_user_func() because I need to send a reference to the
- // header.
- // eval('$v_result = '.$p_options[PCLZIP_CB_PRE_ADD].'(PCLZIP_CB_PRE_ADD, $v_local_header);');
- $v_result = $p_options[PCLZIP_CB_PRE_ADD](PCLZIP_CB_PRE_ADD, $v_local_header);
- if ($v_result == 0) {
- // ----- Change the file status
- $p_header['status'] = "skipped";
- $v_result = 1;
- }
-
- // ----- Update the informations
- // Only some fields can be modified
- if ($p_header['stored_filename'] != $v_local_header['stored_filename']) {
- $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']);
- }
- }
-
- // ----- Look for empty stored filename
- if ($p_header['stored_filename'] == "") {
- $p_header['status'] = "filtered";
- }
-
- // ----- Check the path length
- if (strlen($p_header['stored_filename']) > 0xFF) {
- $p_header['status'] = 'filename_too_long';
- }
-
- // ----- Look if no error, or file not skipped
- if ($p_header['status'] == 'ok') {
- // ----- Look for a file
- if ($p_filedescr['type'] == 'file') {
- // ----- Look for using temporary file to zip
- if ((!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_header['size'])))) {
- $v_result = $this->privAddFileUsingTempFile($p_filedescr, $p_header, $p_options);
- if ($v_result < PCLZIP_ERR_NO_ERROR) {
- return $v_result;
- }
- } else {
- // ----- Use "in memory" zip algo
- // ----- Open the source file
- if (($v_file = @fopen($p_filename, "rb")) == 0) {
- PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode");
- return PclZip::errorCode();
- }
-
- // ----- Read the file content
- $v_content = @fread($v_file, $p_header['size']);
-
- // ----- Close the file
- @fclose($v_file);
-
- // ----- Calculate the CRC
- $p_header['crc'] = @crc32($v_content);
-
- // ----- Look for no compression
- if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {
- // ----- Set header parameters
- $p_header['compressed_size'] = $p_header['size'];
- $p_header['compression'] = 0;
- } else {
- // ----- Look for normal compression
- // ----- Compress the content
- $v_content = @gzdeflate($v_content);
-
- // ----- Set header parameters
- $p_header['compressed_size'] = strlen($v_content);
- $p_header['compression'] = 8;
- }
-
- // ----- Call the header generation
- if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
- @fclose($v_file);
- return $v_result;
- }
-
- // ----- Write the compressed (or not) content
- @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']);
- }
- } elseif ($p_filedescr['type'] == 'virtual_file') {
- // ----- Look for a virtual file (a file from string)
- $v_content = $p_filedescr['content'];
-
- // ----- Calculate the CRC
- $p_header['crc'] = @crc32($v_content);
-
- // ----- Look for no compression
- if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) {
- // ----- Set header parameters
- $p_header['compressed_size'] = $p_header['size'];
- $p_header['compression'] = 0;
- } else {
- // ----- Look for normal compression
- // ----- Compress the content
- $v_content = @gzdeflate($v_content);
-
- // ----- Set header parameters
- $p_header['compressed_size'] = strlen($v_content);
- $p_header['compression'] = 8;
- }
-
- // ----- Call the header generation
- if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
- @fclose($v_file);
- return $v_result;
- }
-
- // ----- Write the compressed (or not) content
- @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']);
- } elseif ($p_filedescr['type'] == 'folder') {
- // ----- Look for a directory
- // ----- Look for directory last '/'
- if (@substr($p_header['stored_filename'], -1) != '/') {
- $p_header['stored_filename'] .= '/';
- }
-
- // ----- Set the file properties
- $p_header['size'] = 0;
- //$p_header['external'] = 0x41FF0010; // Value for a folder : to be checked
- $p_header['external'] = 0x00000010; // Value for a folder : to be checked
-
- // ----- Call the header generation
- if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
- return $v_result;
- }
- }
- }
-
- // ----- Look for post-add callback
- if (isset($p_options[PCLZIP_CB_POST_ADD])) {
- // ----- Generate a local information
- $v_local_header = array();
- $this->privConvertHeader2FileInfo($p_header, $v_local_header);
-
- // ----- Call the callback
- // Here I do not use call_user_func() because I need to send a reference to the
- // header.
- // eval('$v_result = '.$p_options[PCLZIP_CB_POST_ADD].'(PCLZIP_CB_POST_ADD, $v_local_header);');
- $v_result = $p_options[PCLZIP_CB_POST_ADD](PCLZIP_CB_POST_ADD, $v_local_header);
- if ($v_result == 0) {
- // ----- Ignored
- $v_result = 1;
- }
-
- // ----- Update the informations
- // Nothing can be modified
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privAddFileUsingTempFile()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privAddFileUsingTempFile($p_filedescr, &$p_header, &$p_options)
- {
- $v_result=PCLZIP_ERR_NO_ERROR;
-
- // ----- Working variable
- $p_filename = $p_filedescr['filename'];
-
-
- // ----- Open the source file
- if (($v_file = @fopen($p_filename, "rb")) == 0) {
- PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode");
- return PclZip::errorCode();
- }
-
- // ----- Creates a compressed temporary file
- $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz';
- if (($v_file_compressed = @gzopen($v_gzip_temp_name, "wb")) == 0) {
- fclose($v_file);
- PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode');
- return PclZip::errorCode();
- }
-
- // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
- $v_size = filesize($p_filename);
- while ($v_size != 0) {
- $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- $v_buffer = @fread($v_file, $v_read_size);
- //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
- @gzputs($v_file_compressed, $v_buffer, $v_read_size);
- $v_size -= $v_read_size;
- }
-
- // ----- Close the file
- @fclose($v_file);
- @gzclose($v_file_compressed);
-
- // ----- Check the minimum file size
- if (filesize($v_gzip_temp_name) < 18) {
- PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'gzip temporary file \''.$v_gzip_temp_name.'\' has invalid filesize - should be minimum 18 bytes');
- return PclZip::errorCode();
- }
-
- // ----- Extract the compressed attributes
- if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) {
- PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode');
- return PclZip::errorCode();
- }
-
- // ----- Read the gzip file header
- $v_binary_data = @fread($v_file_compressed, 10);
- $v_data_header = unpack('a1id1/a1id2/a1cm/a1flag/Vmtime/a1xfl/a1os', $v_binary_data);
-
- // ----- Check some parameters
- $v_data_header['os'] = bin2hex($v_data_header['os']);
-
- // ----- Read the gzip file footer
- @fseek($v_file_compressed, filesize($v_gzip_temp_name)-8);
- $v_binary_data = @fread($v_file_compressed, 8);
- $v_data_footer = unpack('Vcrc/Vcompressed_size', $v_binary_data);
-
- // ----- Set the attributes
- $p_header['compression'] = ord($v_data_header['cm']);
- //$p_header['mtime'] = $v_data_header['mtime'];
- $p_header['crc'] = $v_data_footer['crc'];
- $p_header['compressed_size'] = filesize($v_gzip_temp_name)-18;
-
- // ----- Close the file
- @fclose($v_file_compressed);
-
- // ----- Call the header generation
- if (($v_result = $this->privWriteFileHeader($p_header)) != 1) {
- return $v_result;
- }
-
- // ----- Add the compressed data
- if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) {
- PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode');
- return PclZip::errorCode();
- }
-
- // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
- fseek($v_file_compressed, 10);
- $v_size = $p_header['compressed_size'];
- while ($v_size != 0) {
- $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- $v_buffer = @fread($v_file_compressed, $v_read_size);
- //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
- @fwrite($this->zip_fd, $v_buffer, $v_read_size);
- $v_size -= $v_read_size;
- }
-
- // ----- Close the file
- @fclose($v_file_compressed);
-
- // ----- Unlink the temporary file
- @unlink($v_gzip_temp_name);
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privCalculateStoredFilename()
- // Description :
- // Based on file descriptor properties and global options, this method
- // calculate the filename that will be stored in the archive.
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privCalculateStoredFilename(&$p_filedescr, &$p_options)
- {
- $v_result=1;
-
- // ----- Working variables
- $p_filename = $p_filedescr['filename'];
- if (isset($p_options[PCLZIP_OPT_ADD_PATH])) {
- $p_add_dir = $p_options[PCLZIP_OPT_ADD_PATH];
- } else {
- $p_add_dir = '';
- }
- if (isset($p_options[PCLZIP_OPT_REMOVE_PATH])) {
- $p_remove_dir = $p_options[PCLZIP_OPT_REMOVE_PATH];
- } else {
- $p_remove_dir = '';
- }
- if (isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) {
- $p_remove_all_dir = $p_options[PCLZIP_OPT_REMOVE_ALL_PATH];
- } else {
- $p_remove_all_dir = 0;
- }
-
- // ----- Look for full name change
- if (isset($p_filedescr['new_full_name'])) {
- // ----- Remove drive letter if any
- $v_stored_filename = PclZipUtilTranslateWinPath($p_filedescr['new_full_name']);
- } else {
- // ----- Look for path and/or short name change
- // ----- Look for short name change
- // Its when we cahnge just the filename but not the path
- if (isset($p_filedescr['new_short_name'])) {
- $v_path_info = pathinfo($p_filename);
- $v_dir = '';
- if ($v_path_info['dirname'] != '') {
- $v_dir = $v_path_info['dirname'].'/';
- }
- $v_stored_filename = $v_dir.$p_filedescr['new_short_name'];
- } else {
- // ----- Calculate the stored filename
- $v_stored_filename = $p_filename;
- }
-
- // ----- Look for all path to remove
- if ($p_remove_all_dir) {
- $v_stored_filename = basename($p_filename);
- } elseif ($p_remove_dir != "") {
- // ----- Look for partial path remove
- if (substr($p_remove_dir, -1) != '/') {
- $p_remove_dir .= "/";
- }
-
- if ((substr($p_filename, 0, 2) == "./") || (substr($p_remove_dir, 0, 2) == "./")) {
- if ((substr($p_filename, 0, 2) == "./") && (substr($p_remove_dir, 0, 2) != "./")) {
- $p_remove_dir = "./".$p_remove_dir;
- }
- if ((substr($p_filename, 0, 2) != "./") && (substr($p_remove_dir, 0, 2) == "./")) {
- $p_remove_dir = substr($p_remove_dir, 2);
- }
- }
-
- $v_compare = PclZipUtilPathInclusion($p_remove_dir, $v_stored_filename);
- if ($v_compare > 0) {
- if ($v_compare == 2) {
- $v_stored_filename = "";
- } else {
- $v_stored_filename = substr($v_stored_filename, strlen($p_remove_dir));
- }
- }
- }
-
- // ----- Remove drive letter if any
- $v_stored_filename = PclZipUtilTranslateWinPath($v_stored_filename);
-
- // ----- Look for path to add
- if ($p_add_dir != "") {
- if (substr($p_add_dir, -1) == "/") {
- $v_stored_filename = $p_add_dir.$v_stored_filename;
- } else {
- $v_stored_filename = $p_add_dir."/".$v_stored_filename;
- }
- }
- }
-
- // ----- Filename (reduce the path of stored name)
- $v_stored_filename = PclZipUtilPathReduction($v_stored_filename);
- $p_filedescr['stored_filename'] = $v_stored_filename;
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privWriteFileHeader()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privWriteFileHeader(&$p_header)
- {
- $v_result=1;
-
- // ----- Store the offset position of the file
- $p_header['offset'] = ftell($this->zip_fd);
-
- // ----- Transform UNIX mtime to DOS format mdate/mtime
- $v_date = getdate($p_header['mtime']);
- $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;
- $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];
-
- // ----- Packed data
- $v_binary_data = pack("VvvvvvVVVvv", 0x04034b50, $p_header['version_extracted'], $p_header['flag'], $p_header['compression'], $v_mtime, $v_mdate, $p_header['crc'], $p_header['compressed_size'], $p_header['size'], strlen($p_header['stored_filename']), $p_header['extra_len']);
-
- // ----- Write the first 148 bytes of the header in the archive
- fputs($this->zip_fd, $v_binary_data, 30);
-
- // ----- Write the variable fields
- if (strlen($p_header['stored_filename']) != 0) {
- fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));
- }
- if ($p_header['extra_len'] != 0) {
- fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privWriteCentralFileHeader()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privWriteCentralFileHeader(&$p_header)
- {
- $v_result=1;
-
- // TBC
- //for(reset($p_header); $key = key($p_header); next($p_header)) {
- //}
-
- // ----- Transform UNIX mtime to DOS format mdate/mtime
- $v_date = getdate($p_header['mtime']);
- $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2;
- $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday'];
-
-
- // ----- Packed data
- $v_binary_data = pack("VvvvvvvVVVvvvvvVV", 0x02014b50, $p_header['version'], $p_header['version_extracted'], $p_header['flag'], $p_header['compression'], $v_mtime, $v_mdate, $p_header['crc'], $p_header['compressed_size'], $p_header['size'], strlen($p_header['stored_filename']), $p_header['extra_len'], $p_header['comment_len'], $p_header['disk'], $p_header['internal'], $p_header['external'], $p_header['offset']);
-
- // ----- Write the 42 bytes of the header in the zip file
- fputs($this->zip_fd, $v_binary_data, 46);
-
- // ----- Write the variable fields
- if (strlen($p_header['stored_filename']) != 0) {
- fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename']));
- }
- if ($p_header['extra_len'] != 0) {
- fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']);
- }
- if ($p_header['comment_len'] != 0) {
- fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']);
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privWriteCentralHeader()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment)
- {
- $v_result = 1;
-
- // ----- Packed data
- $v_binary_data = pack("VvvvvVVv", 0x06054b50, 0, 0, $p_nb_entries, $p_nb_entries, $p_size, $p_offset, strlen($p_comment));
-
- // ----- Write the 22 bytes of the header in the zip file
- fputs($this->zip_fd, $v_binary_data, 22);
-
- // ----- Write the variable fields
- if (strlen($p_comment) != 0) {
- fputs($this->zip_fd, $p_comment, strlen($p_comment));
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privList()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privList(&$p_list)
- {
- $v_result = 1;
-
- // ----- Magic quotes trick
- $this->privDisableMagicQuotes();
-
- // ----- Open the zip file
- if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) {
- // ----- Magic quotes trick
- $this->privSwapBackMagicQuotes();
-
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode');
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Read the central directory informations
- $v_central_dir = array();
- if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) {
- $this->privSwapBackMagicQuotes();
- return $v_result;
- }
-
- // ----- Go to beginning of Central Dir
- @rewind($this->zip_fd);
- if (@fseek($this->zip_fd, $v_central_dir['offset'])) {
- $this->privSwapBackMagicQuotes();
-
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Read each entry
- for ($i=0; $i<$v_central_dir['entries']; $i++) {
- // ----- Read the file header
- if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) {
- $this->privSwapBackMagicQuotes();
- return $v_result;
- }
- $v_header['index'] = $i;
-
- // ----- Get the only interesting attributes
- $this->privConvertHeader2FileInfo($v_header, $p_list[$i]);
- unset($v_header);
- }
-
- // ----- Close the zip file
- $this->privCloseFd();
-
- // ----- Magic quotes trick
- $this->privSwapBackMagicQuotes();
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privConvertHeader2FileInfo()
- // Description :
- // This function takes the file informations from the central directory
- // entries and extract the interesting parameters that will be given back.
- // The resulting file infos are set in the array $p_info
- // $p_info['filename'] : Filename with full path. Given by user (add),
- // extracted in the filesystem (extract).
- // $p_info['stored_filename'] : Stored filename in the archive.
- // $p_info['size'] = Size of the file.
- // $p_info['compressed_size'] = Compressed size of the file.
- // $p_info['mtime'] = Last modification date of the file.
- // $p_info['comment'] = Comment associated with the file.
- // $p_info['folder'] = true/false : indicates if the entry is a folder or not.
- // $p_info['status'] = status of the action on the file.
- // $p_info['crc'] = CRC of the file content.
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privConvertHeader2FileInfo($p_header, &$p_info)
- {
- $v_result=1;
-
- // ----- Get the interesting attributes
- $v_temp_path = PclZipUtilPathReduction($p_header['filename']);
- $p_info['filename'] = $v_temp_path;
- $v_temp_path = PclZipUtilPathReduction($p_header['stored_filename']);
- $p_info['stored_filename'] = $v_temp_path;
- $p_info['size'] = $p_header['size'];
- $p_info['compressed_size'] = $p_header['compressed_size'];
- $p_info['mtime'] = $p_header['mtime'];
- $p_info['comment'] = $p_header['comment'];
- $p_info['folder'] = (($p_header['external']&0x00000010)==0x00000010);
- $p_info['index'] = $p_header['index'];
- $p_info['status'] = $p_header['status'];
- $p_info['crc'] = $p_header['crc'];
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privExtractByRule()
- // Description :
- // Extract a file or directory depending of rules (by index, by name, ...)
- // Parameters :
- // $p_file_list : An array where will be placed the properties of each
- // extracted file
- // $p_path : Path to add while writing the extracted files
- // $p_remove_path : Path to remove (from the file memorized path) while writing the
- // extracted files. If the path does not match the file path,
- // the file is extracted with its memorized path.
- // $p_remove_path does not apply to 'list' mode.
- // $p_path and $p_remove_path are commulative.
- // Return Values :
- // 1 on success,0 or less on error (see error code list)
- // --------------------------------------------------------------------------------
- public function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)
- {
- $v_result=1;
-
- // ----- Magic quotes trick
- $this->privDisableMagicQuotes();
-
- // ----- Check the path
- if (($p_path == "") || ((substr($p_path, 0, 1) != "/") && (substr($p_path, 0, 3) != "../") && (substr($p_path, 1, 2)!=":/"))) {
- $p_path = "./".$p_path;
- }
-
- // ----- Reduce the path last (and duplicated) '/'
- if (($p_path != "./") && ($p_path != "/")) {
- // ----- Look for the path end '/'
- while (substr($p_path, -1) == "/") {
- $p_path = substr($p_path, 0, strlen($p_path)-1);
- }
- }
-
- // ----- Look for path to remove format (should end by /)
- if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/')) {
- $p_remove_path .= '/';
- }
- $p_remove_path_size = strlen($p_remove_path);
-
- // ----- Open the zip file
- if (($v_result = $this->privOpenFd('rb')) != 1) {
- $this->privSwapBackMagicQuotes();
- return $v_result;
- }
-
- // ----- Read the central directory informations
- $v_central_dir = array();
- if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) {
- // ----- Close the zip file
- $this->privCloseFd();
- $this->privSwapBackMagicQuotes();
-
- return $v_result;
- }
-
- // ----- Start at beginning of Central Dir
- $v_pos_entry = $v_central_dir['offset'];
-
- // ----- Read each entry
- $j_start = 0;
- for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) {
- // ----- Read next Central dir entry
- @rewind($this->zip_fd);
- if (@fseek($this->zip_fd, $v_pos_entry)) {
- // ----- Close the zip file
- $this->privCloseFd();
- $this->privSwapBackMagicQuotes();
-
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Read the file header
- $v_header = array();
- if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) {
- // ----- Close the zip file
- $this->privCloseFd();
- $this->privSwapBackMagicQuotes();
-
- return $v_result;
- }
-
- // ----- Store the index
- $v_header['index'] = $i;
-
- // ----- Store the file position
- $v_pos_entry = ftell($this->zip_fd);
-
- // ----- Look for the specific extract rules
- $v_extract = false;
-
- // ----- Look for extract by name rule
- if ((isset($p_options[PCLZIP_OPT_BY_NAME])) && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) {
- // ----- Look if the filename is in the list
- for ($j=0; ($j strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) && (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
- $v_extract = true;
- }
- } elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {
- // ----- Look for a filename
- $v_extract = true;
- }
- }
- } elseif ((isset($p_options[PCLZIP_OPT_BY_PREG])) && ($p_options[PCLZIP_OPT_BY_PREG] != "")) {
- // ----- Look for extract by preg rule
- if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) {
- $v_extract = true;
- }
- } elseif ((isset($p_options[PCLZIP_OPT_BY_INDEX])) && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
- // ----- Look for extract by index rule
- // ----- Look if the index is in the list
- for ($j=$j_start; ($j=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) {
- $v_extract = true;
- }
- if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {
- $j_start = $j+1;
- }
-
- if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) {
- break;
- }
- }
- } else {
- // ----- Look for no rule, which means extract all the archive
- $v_extract = true;
- }
-
- // ----- Check compression method
- if (($v_extract) && (($v_header['compression'] != 8) && ($v_header['compression'] != 0))) {
- $v_header['status'] = 'unsupported_compression';
-
- // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
- if ((isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR] === true)) {
- $this->privSwapBackMagicQuotes();
-
- PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION, "Filename '".$v_header['stored_filename']."' is compressed by an unsupported compression method (".$v_header['compression'].") ");
-
- return PclZip::errorCode();
- }
- }
-
- // ----- Check encrypted files
- if (($v_extract) && (($v_header['flag'] & 1) == 1)) {
- $v_header['status'] = 'unsupported_encryption';
- // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
- if ((isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR] === true)) {
- $this->privSwapBackMagicQuotes();
-
- PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, "Unsupported encryption for filename '".$v_header['stored_filename']."'");
-
- return PclZip::errorCode();
- }
- }
-
- // ----- Look for real extraction
- if (($v_extract) && ($v_header['status'] != 'ok')) {
- $v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++]);
- if ($v_result != 1) {
- $this->privCloseFd();
- $this->privSwapBackMagicQuotes();
- return $v_result;
- }
-
- $v_extract = false;
- }
-
- // ----- Look for real extraction
- if ($v_extract) {
- // ----- Go to the file position
- @rewind($this->zip_fd);
- if (@fseek($this->zip_fd, $v_header['offset'])) {
- // ----- Close the zip file
- $this->privCloseFd();
-
- $this->privSwapBackMagicQuotes();
-
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Look for extraction as string
- if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) {
- $v_string = '';
-
- // ----- Extracting the file
- $v_result1 = $this->privExtractFileAsString($v_header, $v_string, $p_options);
- if ($v_result1 < 1) {
- $this->privCloseFd();
- $this->privSwapBackMagicQuotes();
- return $v_result1;
- }
-
- // ----- Get the only interesting attributes
- if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted])) != 1) {
- // ----- Close the zip file
- $this->privCloseFd();
- $this->privSwapBackMagicQuotes();
-
- return $v_result;
- }
-
- // ----- Set the file content
- $p_file_list[$v_nb_extracted]['content'] = $v_string;
-
- // ----- Next extracted file
- $v_nb_extracted++;
-
- // ----- Look for user callback abort
- if ($v_result1 == 2) {
- break;
- }
- } elseif ((isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) {
- // ----- Look for extraction in standard output
- // ----- Extracting the file in standard output
- $v_result1 = $this->privExtractFileInOutput($v_header, $p_options);
- if ($v_result1 < 1) {
- $this->privCloseFd();
- $this->privSwapBackMagicQuotes();
- return $v_result1;
- }
-
- // ----- Get the only interesting attributes
- if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) {
- $this->privCloseFd();
- $this->privSwapBackMagicQuotes();
- return $v_result;
- }
-
- // ----- Look for user callback abort
- if ($v_result1 == 2) {
- break;
- }
- } else {
- // ----- Look for normal extraction
- // ----- Extracting the file
- $v_result1 = $this->privExtractFile($v_header, $p_path, $p_remove_path, $p_remove_all_path, $p_options);
- if ($v_result1 < 1) {
- $this->privCloseFd();
- $this->privSwapBackMagicQuotes();
- return $v_result1;
- }
-
- // ----- Get the only interesting attributes
- if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) {
- // ----- Close the zip file
- $this->privCloseFd();
- $this->privSwapBackMagicQuotes();
-
- return $v_result;
- }
-
- // ----- Look for user callback abort
- if ($v_result1 == 2) {
- break;
- }
- }
- }
- }
-
- // ----- Close the zip file
- $this->privCloseFd();
- $this->privSwapBackMagicQuotes();
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privExtractFile()
- // Description :
- // Parameters :
- // Return Values :
- //
- // 1 : ... ?
- // PCLZIP_ERR_USER_ABORTED(2) : User ask for extraction stop in callback
- // --------------------------------------------------------------------------------
- public function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options)
- {
- $v_result=1;
-
- // ----- Read the file header
- if (($v_result = $this->privReadFileHeader($v_header)) != 1) {
- // ----- Return
- return $v_result;
- }
-
-
- // ----- Check that the file header is coherent with $p_entry info
- if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
- // TBC
- }
-
- // ----- Look for all path to remove
- if ($p_remove_all_path == true) {
- // ----- Look for folder entry that not need to be extracted
- if (($p_entry['external']&0x00000010)==0x00000010) {
- $p_entry['status'] = "filtered";
-
- return $v_result;
- }
-
- // ----- Get the basename of the path
- $p_entry['filename'] = basename($p_entry['filename']);
- } elseif ($p_remove_path != "") {
- // ----- Look for path to remove
- if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2) {
- // ----- Change the file status
- $p_entry['status'] = "filtered";
-
- // ----- Return
- return $v_result;
- }
-
- $p_remove_path_size = strlen($p_remove_path);
- if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path) {
- // ----- Remove the path
- $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size);
- }
- }
-
- // ----- Add the path
- if ($p_path != '') {
- $p_entry['filename'] = $p_path."/".$p_entry['filename'];
- }
-
- // ----- Check a base_dir_restriction
- if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) {
- $v_inclusion = PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION], $p_entry['filename']);
- if ($v_inclusion == 0) {
- PclZip::privErrorLog(PCLZIP_ERR_DIRECTORY_RESTRICTION, "Filename '".$p_entry['filename']."' is outside PCLZIP_OPT_EXTRACT_DIR_RESTRICTION");
-
- return PclZip::errorCode();
- }
- }
-
- // ----- Look for pre-extract callback
- if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {
- // ----- Generate a local information
- $v_local_header = array();
- $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
-
- // ----- Call the callback
- // Here I do not use call_user_func() because I need to send a reference to the
- // header.
- // eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');
- $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);
- if ($v_result == 0) {
- // ----- Change the file status
- $p_entry['status'] = "skipped";
- $v_result = 1;
- }
-
- // ----- Look for abort result
- if ($v_result == 2) {
- // ----- This status is internal and will be changed in 'skipped'
- $p_entry['status'] = "aborted";
- $v_result = PCLZIP_ERR_USER_ABORTED;
- }
-
- // ----- Update the informations
- // Only some fields can be modified
- $p_entry['filename'] = $v_local_header['filename'];
- }
-
- // ----- Look if extraction should be done
- if ($p_entry['status'] == 'ok') {
- // ----- Look for specific actions while the file exist
- if (file_exists($p_entry['filename'])) {
- // ----- Look if file is a directory
- if (is_dir($p_entry['filename'])) {
- // ----- Change the file status
- $p_entry['status'] = "already_a_directory";
-
- // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
- // For historical reason first PclZip implementation does not stop
- // when this kind of error occurs.
- if ((isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) {
- PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY, "Filename '".$p_entry['filename']."' is already used by an existing directory");
- return PclZip::errorCode();
- }
- } elseif (!is_writeable($p_entry['filename'])) {
- // ----- Look if file is write protected
- // ----- Change the file status
- $p_entry['status'] = "write_protected";
-
- // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
- // For historical reason first PclZip implementation does not stop
- // when this kind of error occurs.
- if ((isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR] === true)) {
- PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, "Filename '".$p_entry['filename']."' exists and is write protected");
- return PclZip::errorCode();
- }
- } elseif (filemtime($p_entry['filename']) > $p_entry['mtime']) {
- // ----- Look if the extracted file is older
- // ----- Change the file status
- if ((isset($p_options[PCLZIP_OPT_REPLACE_NEWER])) && ($p_options[PCLZIP_OPT_REPLACE_NEWER] === true)) {
- } else {
- $p_entry['status'] = "newer_exist";
-
- // ----- Look for PCLZIP_OPT_STOP_ON_ERROR
- // For historical reason first PclZip implementation does not stop
- // when this kind of error occurs.
- if ((isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) && ($p_options[PCLZIP_OPT_STOP_ON_ERROR] === true)) {
- PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, "Newer version of '".$p_entry['filename']."' exists and option PCLZIP_OPT_REPLACE_NEWER is not selected");
- return PclZip::errorCode();
- }
- }
- } else {
- }
- } else {
- // ----- Check the directory availability and create it if necessary
- if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/')) {
- $v_dir_to_check = $p_entry['filename'];
- } elseif (!strstr($p_entry['filename'], "/")) {
- $v_dir_to_check = "";
- } else {
- $v_dir_to_check = dirname($p_entry['filename']);
- }
-
- if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) {
- // ----- Change the file status
- $p_entry['status'] = "path_creation_fail";
-
- // ----- Return
- //return $v_result;
- $v_result = 1;
- }
- }
- }
-
- // ----- Look if extraction should be done
- if ($p_entry['status'] == 'ok') {
- // ----- Do the extraction (if not a folder)
- if (!(($p_entry['external']&0x00000010) == 0x00000010)) {
- // ----- Look for not compressed file
- if ($p_entry['compression'] == 0) {
- // ----- Opening destination file
- if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {
- // ----- Change the file status
- $p_entry['status'] = "write_error";
-
- // ----- Return
- return $v_result;
- }
-
- // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
- $v_size = $p_entry['compressed_size'];
- while ($v_size != 0) {
- $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- $v_buffer = @fread($this->zip_fd, $v_read_size);
- /* Try to speed up the code
- $v_binary_data = pack('a'.$v_read_size, $v_buffer);
- @fwrite($v_dest_file, $v_binary_data, $v_read_size);
- */
- @fwrite($v_dest_file, $v_buffer, $v_read_size);
- $v_size -= $v_read_size;
- }
-
- // ----- Closing the destination file
- fclose($v_dest_file);
-
- // ----- Change the file mtime
- touch($p_entry['filename'], $p_entry['mtime']);
- } else {
- // ----- TBC
- // Need to be finished
- if (($p_entry['flag'] & 1) == 1) {
- PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, 'File \''.$p_entry['filename'].'\' is encrypted. Encrypted files are not supported.');
- return PclZip::errorCode();
- }
-
- // ----- Look for using temporary file to unzip
- if ((!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_entry['size'])))) {
- $v_result = $this->privExtractFileUsingTempFile($p_entry, $p_options);
- if ($v_result < PCLZIP_ERR_NO_ERROR) {
- return $v_result;
- }
- } else {
- // ----- Look for extract in memory
- // ----- Read the compressed file in a buffer (one shot)
- $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
-
- // ----- Decompress the file
- $v_file_content = @gzinflate($v_buffer);
- unset($v_buffer);
- if ($v_file_content === false) {
- // ----- Change the file status
- // TBC
- $p_entry['status'] = "error";
-
- return $v_result;
- }
-
- // ----- Opening destination file
- if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {
- // ----- Change the file status
- $p_entry['status'] = "write_error";
-
- return $v_result;
- }
-
- // ----- Write the uncompressed data
- @fwrite($v_dest_file, $v_file_content, $p_entry['size']);
- unset($v_file_content);
-
- // ----- Closing the destination file
- @fclose($v_dest_file);
- }
-
- // ----- Change the file mtime
- @touch($p_entry['filename'], $p_entry['mtime']);
- }
-
- // ----- Look for chmod option
- if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) {
- // ----- Change the mode of the file
- @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]);
- }
- }
- }
-
- // ----- Change abort status
- if ($p_entry['status'] == "aborted") {
- $p_entry['status'] = "skipped";
- } elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {
- // ----- Look for post-extract callback
- // ----- Generate a local information
- $v_local_header = array();
- $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
-
- // ----- Call the callback
- // Here I do not use call_user_func() because I need to send a reference to the
- // header.
- // eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);');
- $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);
-
- // ----- Look for abort result
- if ($v_result == 2) {
- $v_result = PCLZIP_ERR_USER_ABORTED;
- }
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privExtractFileUsingTempFile()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privExtractFileUsingTempFile(&$p_entry, &$p_options)
- {
- $v_result=1;
-
- // ----- Creates a temporary file
- $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz';
- if (($v_dest_file = @fopen($v_gzip_temp_name, "wb")) == 0) {
- fclose($v_file);
- PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode');
- return PclZip::errorCode();
- }
-
- // ----- Write gz file format header
- $v_binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($p_entry['compression']), Chr(0x00), time(), Chr(0x00), Chr(3));
- @fwrite($v_dest_file, $v_binary_data, 10);
-
- // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
- $v_size = $p_entry['compressed_size'];
- while ($v_size != 0) {
- $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- $v_buffer = @fread($this->zip_fd, $v_read_size);
- //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
- @fwrite($v_dest_file, $v_buffer, $v_read_size);
- $v_size -= $v_read_size;
- }
-
- // ----- Write gz file format footer
- $v_binary_data = pack('VV', $p_entry['crc'], $p_entry['size']);
- @fwrite($v_dest_file, $v_binary_data, 8);
-
- // ----- Close the temporary file
- @fclose($v_dest_file);
-
- // ----- Opening destination file
- if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) {
- $p_entry['status'] = "write_error";
- return $v_result;
- }
-
- // ----- Open the temporary gz file
- if (($v_src_file = @gzopen($v_gzip_temp_name, 'rb')) == 0) {
- @fclose($v_dest_file);
- $p_entry['status'] = "read_error";
- PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode');
- return PclZip::errorCode();
- }
-
- // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks
- $v_size = $p_entry['size'];
- while ($v_size != 0) {
- $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- $v_buffer = @gzread($v_src_file, $v_read_size);
- //$v_binary_data = pack('a'.$v_read_size, $v_buffer);
- @fwrite($v_dest_file, $v_buffer, $v_read_size);
- $v_size -= $v_read_size;
- }
- @fclose($v_dest_file);
- @gzclose($v_src_file);
-
- // ----- Delete the temporary file
- @unlink($v_gzip_temp_name);
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privExtractFileInOutput()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privExtractFileInOutput(&$p_entry, &$p_options)
- {
- $v_result=1;
-
- // ----- Read the file header
- if (($v_result = $this->privReadFileHeader($v_header)) != 1) {
- return $v_result;
- }
-
- // ----- Check that the file header is coherent with $p_entry info
- if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
- // TBC
- }
-
- // ----- Look for pre-extract callback
- if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {
- // ----- Generate a local information
- $v_local_header = array();
- $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
-
- // ----- Call the callback
- // Here I do not use call_user_func() because I need to send a reference to the
- // header.
- // eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');
- $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);
- if ($v_result == 0) {
- // ----- Change the file status
- $p_entry['status'] = "skipped";
- $v_result = 1;
- }
-
- // ----- Look for abort result
- if ($v_result == 2) {
- // ----- This status is internal and will be changed in 'skipped'
- $p_entry['status'] = "aborted";
- $v_result = PCLZIP_ERR_USER_ABORTED;
- }
-
- // ----- Update the informations
- // Only some fields can be modified
- $p_entry['filename'] = $v_local_header['filename'];
- }
-
- // ----- Trace
-
- // ----- Look if extraction should be done
- if ($p_entry['status'] == 'ok') {
- // ----- Do the extraction (if not a folder)
- if (!(($p_entry['external']&0x00000010)==0x00000010)) {
- // ----- Look for not compressed file
- if ($p_entry['compressed_size'] == $p_entry['size']) {
- // ----- Read the file in a buffer (one shot)
- $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
-
- // ----- Send the file to the output
- echo $v_buffer;
- unset($v_buffer);
- } else {
- // ----- Read the compressed file in a buffer (one shot)
- $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']);
-
- // ----- Decompress the file
- $v_file_content = gzinflate($v_buffer);
- unset($v_buffer);
-
- // ----- Send the file to the output
- echo $v_file_content;
- unset($v_file_content);
- }
- }
- }
-
- // ----- Change abort status
- if ($p_entry['status'] == "aborted") {
- $p_entry['status'] = "skipped";
- } elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {
- // ----- Look for post-extract callback
-
- // ----- Generate a local information
- $v_local_header = array();
- $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
-
- // ----- Call the callback
- // Here I do not use call_user_func() because I need to send a reference to the
- // header.
- // eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);');
- $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);
-
- // ----- Look for abort result
- if ($v_result == 2) {
- $v_result = PCLZIP_ERR_USER_ABORTED;
- }
- }
-
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privExtractFileAsString()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privExtractFileAsString(&$p_entry, &$p_string, &$p_options)
- {
- $v_result=1;
-
- // ----- Read the file header
- $v_header = array();
- if (($v_result = $this->privReadFileHeader($v_header)) != 1) {
- // ----- Return
- return $v_result;
- }
-
- // ----- Check that the file header is coherent with $p_entry info
- if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) {
- // TBC
- }
-
- // ----- Look for pre-extract callback
- if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) {
- // ----- Generate a local information
- $v_local_header = array();
- $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
-
- // ----- Call the callback
- // Here I do not use call_user_func() because I need to send a reference to the
- // header.
- // eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);');
- $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header);
- if ($v_result == 0) {
- // ----- Change the file status
- $p_entry['status'] = "skipped";
- $v_result = 1;
- }
-
- // ----- Look for abort result
- if ($v_result == 2) {
- // ----- This status is internal and will be changed in 'skipped'
- $p_entry['status'] = "aborted";
- $v_result = PCLZIP_ERR_USER_ABORTED;
- }
-
- // ----- Update the informations
- // Only some fields can be modified
- $p_entry['filename'] = $v_local_header['filename'];
- }
-
- // ----- Look if extraction should be done
- if ($p_entry['status'] == 'ok') {
- // ----- Do the extraction (if not a folder)
- if (!(($p_entry['external']&0x00000010)==0x00000010)) {
- // ----- Look for not compressed file
- // if ($p_entry['compressed_size'] == $p_entry['size'])
- if ($p_entry['compression'] == 0) {
- // ----- Reading the file
- $p_string = @fread($this->zip_fd, $p_entry['compressed_size']);
- } else {
- // ----- Reading the file
- $v_data = @fread($this->zip_fd, $p_entry['compressed_size']);
-
- // ----- Decompress the file
- if (($p_string = @gzinflate($v_data)) === false) {
- // TBC
- }
- }
- // ----- Trace
- } else {
- // TBC : error : can not extract a folder in a string
- }
- }
-
- // ----- Change abort status
- if ($p_entry['status'] == "aborted") {
- $p_entry['status'] = "skipped";
- } elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) {
- // ----- Look for post-extract callback
- // ----- Generate a local information
- $v_local_header = array();
- $this->privConvertHeader2FileInfo($p_entry, $v_local_header);
-
- // ----- Swap the content to header
- $v_local_header['content'] = $p_string;
- $p_string = '';
-
- // ----- Call the callback
- // Here I do not use call_user_func() because I need to send a reference to the
- // header.
- // eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);');
- $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header);
-
- // ----- Swap back the content to header
- $p_string = $v_local_header['content'];
- unset($v_local_header['content']);
-
- // ----- Look for abort result
- if ($v_result == 2) {
- $v_result = PCLZIP_ERR_USER_ABORTED;
- }
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privReadFileHeader()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privReadFileHeader(&$p_header)
- {
- $v_result=1;
-
- // ----- Read the 4 bytes signature
- $v_binary_data = @fread($this->zip_fd, 4);
- $v_data = unpack('Vid', $v_binary_data);
-
- // ----- Check signature
- if ($v_data['id'] != 0x04034b50) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure');
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Read the first 42 bytes of the header
- $v_binary_data = fread($this->zip_fd, 26);
-
- // ----- Look for invalid block size
- if (strlen($v_binary_data) != 26) {
- $p_header['filename'] = "";
- $p_header['status'] = "invalid_header";
-
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data));
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Extract the values
- $v_data = unpack('vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $v_binary_data);
-
- // ----- Get filename
- $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']);
-
- // ----- Get extra_fields
- if ($v_data['extra_len'] != 0) {
- $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']);
- } else {
- $p_header['extra'] = '';
- }
-
- // ----- Extract properties
- $p_header['version_extracted'] = $v_data['version'];
- $p_header['compression'] = $v_data['compression'];
- $p_header['size'] = $v_data['size'];
- $p_header['compressed_size'] = $v_data['compressed_size'];
- $p_header['crc'] = $v_data['crc'];
- $p_header['flag'] = $v_data['flag'];
- $p_header['filename_len'] = $v_data['filename_len'];
-
- // ----- Recuperate date in UNIX format
- $p_header['mdate'] = $v_data['mdate'];
- $p_header['mtime'] = $v_data['mtime'];
- if ($p_header['mdate'] && $p_header['mtime']) {
- // ----- Extract time
- $v_hour = ($p_header['mtime'] & 0xF800) >> 11;
- $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;
- $v_seconde = ($p_header['mtime'] & 0x001F)*2;
-
- // ----- Extract date
- $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980;
- $v_month = ($p_header['mdate'] & 0x01E0) >> 5;
- $v_day = $p_header['mdate'] & 0x001F;
-
- // ----- Get UNIX date format
- $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);
-
- } else {
- $p_header['mtime'] = time();
- }
-
- // TBC
- //for(reset($v_data); $key = key($v_data); next($v_data)) {
- //}
-
- // ----- Set the stored filename
- $p_header['stored_filename'] = $p_header['filename'];
-
- // ----- Set the status field
- $p_header['status'] = "ok";
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privReadCentralFileHeader()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privReadCentralFileHeader(&$p_header)
- {
- $v_result = 1;
-
- // ----- Read the 4 bytes signature
- $v_binary_data = @fread($this->zip_fd, 4);
- $v_data = unpack('Vid', $v_binary_data);
-
- // ----- Check signature
- if ($v_data['id'] != 0x02014b50) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure');
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Read the first 42 bytes of the header
- $v_binary_data = fread($this->zip_fd, 42);
-
- // ----- Look for invalid block size
- if (strlen($v_binary_data) != 42) {
- $p_header['filename'] = "";
- $p_header['status'] = "invalid_header";
-
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data));
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Extract the values
- $p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data);
-
- // ----- Get filename
- if ($p_header['filename_len'] != 0) {
- $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']);
- } else {
- $p_header['filename'] = '';
- }
-
- // ----- Get extra
- if ($p_header['extra_len'] != 0) {
- $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']);
- } else {
- $p_header['extra'] = '';
- }
-
- // ----- Get comment
- if ($p_header['comment_len'] != 0) {
- $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']);
- } else {
- $p_header['comment'] = '';
- }
-
- // ----- Extract properties
-
- // ----- Recuperate date in UNIX format
- //if ($p_header['mdate'] && $p_header['mtime'])
- // TBC : bug : this was ignoring time with 0/0/0
- if (1) {
- // ----- Extract time
- $v_hour = ($p_header['mtime'] & 0xF800) >> 11;
- $v_minute = ($p_header['mtime'] & 0x07E0) >> 5;
- $v_seconde = ($p_header['mtime'] & 0x001F)*2;
-
- // ----- Extract date
- $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980;
- $v_month = ($p_header['mdate'] & 0x01E0) >> 5;
- $v_day = $p_header['mdate'] & 0x001F;
-
- // ----- Get UNIX date format
- $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year);
-
- } else {
- $p_header['mtime'] = time();
- }
-
- // ----- Set the stored filename
- $p_header['stored_filename'] = $p_header['filename'];
-
- // ----- Set default status to ok
- $p_header['status'] = 'ok';
-
- // ----- Look if it is a directory
- if (substr($p_header['filename'], -1) == '/') {
- //$p_header['external'] = 0x41FF0010;
- $p_header['external'] = 0x00000010;
- }
-
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privCheckFileHeaders()
- // Description :
- // Parameters :
- // Return Values :
- // 1 on success,
- // 0 on error;
- // --------------------------------------------------------------------------------
- public function privCheckFileHeaders(&$p_local_header, &$p_central_header)
- {
- $v_result=1;
-
- // ----- Check the static values
- // TBC
- if ($p_local_header['filename'] != $p_central_header['filename']) {
- }
- if ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) {
- }
- if ($p_local_header['flag'] != $p_central_header['flag']) {
- }
- if ($p_local_header['compression'] != $p_central_header['compression']) {
- }
- if ($p_local_header['mtime'] != $p_central_header['mtime']) {
- }
- if ($p_local_header['filename_len'] != $p_central_header['filename_len']) {
- }
-
- // ----- Look for flag bit 3
- if (($p_local_header['flag'] & 8) == 8) {
- $p_local_header['size'] = $p_central_header['size'];
- $p_local_header['compressed_size'] = $p_central_header['compressed_size'];
- $p_local_header['crc'] = $p_central_header['crc'];
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privReadEndCentralDir()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privReadEndCentralDir(&$p_central_dir)
- {
- $v_result=1;
-
- // ----- Go to the end of the zip file
- $v_size = filesize($this->zipname);
- @fseek($this->zip_fd, $v_size);
- if (@ftell($this->zip_fd) != $v_size) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->zipname.'\'');
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- First try : look if this is an archive with no commentaries (most of the time)
- // in this case the end of central dir is at 22 bytes of the file end
- $v_found = 0;
- if ($v_size > 26) {
- @fseek($this->zip_fd, $v_size-22);
- if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22)) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\'');
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Read for bytes
- $v_binary_data = @fread($this->zip_fd, 4);
- $v_data = @unpack('Vid', $v_binary_data);
-
- // ----- Check signature
- if ($v_data['id'] == 0x06054b50) {
- $v_found = 1;
- }
-
- $v_pos = ftell($this->zip_fd);
- }
-
- // ----- Go back to the maximum possible size of the Central Dir End Record
- if (!$v_found) {
- $v_maximum_size = 65557; // 0xFFFF + 22;
- if ($v_maximum_size > $v_size) {
- $v_maximum_size = $v_size;
- }
- @fseek($this->zip_fd, $v_size-$v_maximum_size);
- if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size)) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\'');
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Read byte per byte in order to find the signature
- $v_pos = ftell($this->zip_fd);
- $v_bytes = 0x00000000;
- while ($v_pos < $v_size) {
- // ----- Read a byte
- $v_byte = @fread($this->zip_fd, 1);
-
- // ----- Add the byte
- //$v_bytes = ($v_bytes << 8) | Ord($v_byte);
- // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number
- // Otherwise on systems where we have 64bit integers the check below for the magic number will fail.
- $v_bytes = (($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte);
-
- // ----- Compare the bytes
- if ($v_bytes == 0x504b0506) {
- $v_pos++;
- break;
- }
-
- $v_pos++;
- }
-
- // ----- Look if not found end of central dir
- if ($v_pos == $v_size) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Unable to find End of Central Dir Record signature");
-
- // ----- Return
- return PclZip::errorCode();
- }
- }
-
- // ----- Read the first 18 bytes of the header
- $v_binary_data = fread($this->zip_fd, 18);
-
- // ----- Look for invalid block size
- if (strlen($v_binary_data) != 18) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid End of Central Dir Record size : ".strlen($v_binary_data));
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Extract the values
- $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data);
-
- // ----- Check the global size
- if (($v_pos + $v_data['comment_size'] + 18) != $v_size) {
- // ----- Removed in release 2.2 see readme file
- // The check of the file size is a little too strict.
- // Some bugs where found when a zip is encrypted/decrypted with 'crypt'.
- // While decrypted, zip has training 0 bytes
- if (0) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'The central dir is not at the end of the archive. Some trailing bytes exists after the archive.');
-
- // ----- Return
- return PclZip::errorCode();
- }
- }
-
- // ----- Get comment
- if ($v_data['comment_size'] != 0) {
- $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']);
- } else {
- $p_central_dir['comment'] = '';
- }
-
- $p_central_dir['entries'] = $v_data['entries'];
- $p_central_dir['disk_entries'] = $v_data['disk_entries'];
- $p_central_dir['offset'] = $v_data['offset'];
- $p_central_dir['size'] = $v_data['size'];
- $p_central_dir['disk'] = $v_data['disk'];
- $p_central_dir['disk_start'] = $v_data['disk_start'];
-
- // TBC
- //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) {
- //}
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privDeleteByRule()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privDeleteByRule(&$p_result_list, &$p_options)
- {
- $v_result=1;
- $v_list_detail = array();
-
- // ----- Open the zip file
- if (($v_result=$this->privOpenFd('rb')) != 1) {
- // ----- Return
- return $v_result;
- }
-
- // ----- Read the central directory informations
- $v_central_dir = array();
- if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) {
- $this->privCloseFd();
- return $v_result;
- }
-
- // ----- Go to beginning of File
- @rewind($this->zip_fd);
-
- // ----- Scan all the files
- // ----- Start at beginning of Central Dir
- $v_pos_entry = $v_central_dir['offset'];
- @rewind($this->zip_fd);
- if (@fseek($this->zip_fd, $v_pos_entry)) {
- // ----- Close the zip file
- $this->privCloseFd();
-
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Read each entry
- $v_header_list = array();
- $j_start = 0;
- for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) {
- // ----- Read the file header
- $v_header_list[$v_nb_extracted] = array();
- if (($v_result = $this->privReadCentralFileHeader($v_header_list[$v_nb_extracted])) != 1) {
- // ----- Close the zip file
- $this->privCloseFd();
-
- return $v_result;
- }
-
-
- // ----- Store the index
- $v_header_list[$v_nb_extracted]['index'] = $i;
-
- // ----- Look for the specific extract rules
- $v_found = false;
-
- // ----- Look for extract by name rule
- if ((isset($p_options[PCLZIP_OPT_BY_NAME])) && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) {
- // ----- Look if the filename is in the list
- for ($j=0; ($j strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
- $v_found = true;
- } elseif ((($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */ && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) {
- $v_found = true;
- }
- } elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) {
- // ----- Look for a filename
- $v_found = true;
- }
- }
- } elseif ((isset($p_options[PCLZIP_OPT_BY_PREG])) && ($p_options[PCLZIP_OPT_BY_PREG] != "")) {
- // ----- Look for extract by preg rule
- if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) {
- $v_found = true;
- }
- } elseif ((isset($p_options[PCLZIP_OPT_BY_INDEX])) && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) {
- // ----- Look for extract by index rule
- // ----- Look if the index is in the list
- for ($j=$j_start; ($j=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) {
- $v_found = true;
- }
- if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) {
- $j_start = $j+1;
- }
- if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) {
- break;
- }
- }
- } else {
- $v_found = true;
- }
-
- // ----- Look for deletion
- if ($v_found) {
- unset($v_header_list[$v_nb_extracted]);
- } else {
- $v_nb_extracted++;
- }
- }
-
- // ----- Look if something need to be deleted
- if ($v_nb_extracted > 0) {
- // ----- Creates a temporay file
- $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';
-
- // ----- Creates a temporary zip archive
- $v_temp_zip = new PclZip($v_zip_temp_name);
-
- // ----- Open the temporary zip file in write mode
- if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) {
- $this->privCloseFd();
-
- // ----- Return
- return $v_result;
- }
-
- // ----- Look which file need to be kept
- for ($i=0; $izip_fd);
- if (@fseek($this->zip_fd, $v_header_list[$i]['offset'])) {
- // ----- Close the zip file
- $this->privCloseFd();
- $v_temp_zip->privCloseFd();
- @unlink($v_zip_temp_name);
-
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size');
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Read the file header
- $v_local_header = array();
- if (($v_result = $this->privReadFileHeader($v_local_header)) != 1) {
- // ----- Close the zip file
- $this->privCloseFd();
- $v_temp_zip->privCloseFd();
- @unlink($v_zip_temp_name);
-
- // ----- Return
- return $v_result;
- }
-
- // ----- Check that local file header is same as central file header
- if ($this->privCheckFileHeaders($v_local_header, $v_header_list[$i]) != 1) {
- // TBC
- }
- unset($v_local_header);
-
- // ----- Write the file header
- if (($v_result = $v_temp_zip->privWriteFileHeader($v_header_list[$i])) != 1) {
- // ----- Close the zip file
- $this->privCloseFd();
- $v_temp_zip->privCloseFd();
- @unlink($v_zip_temp_name);
-
- // ----- Return
- return $v_result;
- }
-
- // ----- Read/write the data block
- if (($v_result = PclZipUtilCopyBlock($this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size'])) != 1) {
- // ----- Close the zip file
- $this->privCloseFd();
- $v_temp_zip->privCloseFd();
- @unlink($v_zip_temp_name);
-
- // ----- Return
- return $v_result;
- }
- }
-
- // ----- Store the offset of the central dir
- $v_offset = @ftell($v_temp_zip->zip_fd);
-
- // ----- Re-Create the Central Dir files header
- for ($i=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) {
- $v_temp_zip->privCloseFd();
- $this->privCloseFd();
- @unlink($v_zip_temp_name);
-
- // ----- Return
- return $v_result;
- }
-
- // ----- Transform the header to a 'usable' info
- $v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]);
- }
-
-
- // ----- Zip file comment
- $v_comment = '';
- if (isset($p_options[PCLZIP_OPT_COMMENT])) {
- $v_comment = $p_options[PCLZIP_OPT_COMMENT];
- }
-
- // ----- Calculate the size of the central header
- $v_size = @ftell($v_temp_zip->zip_fd)-$v_offset;
-
- // ----- Create the central dir footer
- if (($v_result = $v_temp_zip->privWriteCentralHeader(sizeof($v_header_list), $v_size, $v_offset, $v_comment)) != 1) {
- // ----- Reset the file list
- unset($v_header_list);
- $v_temp_zip->privCloseFd();
- $this->privCloseFd();
- @unlink($v_zip_temp_name);
-
- // ----- Return
- return $v_result;
- }
-
- // ----- Close
- $v_temp_zip->privCloseFd();
- $this->privCloseFd();
-
- // ----- Delete the zip file
- // TBC : I should test the result ...
- @unlink($this->zipname);
-
- // ----- Rename the temporary file
- // TBC : I should test the result ...
- //@rename($v_zip_temp_name, $this->zipname);
- PclZipUtilRename($v_zip_temp_name, $this->zipname);
-
- // ----- Destroy the temporary archive
- unset($v_temp_zip);
- } elseif ($v_central_dir['entries'] != 0) {
- // ----- Remove every files : reset the file
- $this->privCloseFd();
-
- if (($v_result = $this->privOpenFd('wb')) != 1) {
- return $v_result;
- }
-
- if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) {
- return $v_result;
- }
-
- $this->privCloseFd();
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privDirCheck()
- // Description :
- // Check if a directory exists, if not it creates it and all the parents directory
- // which may be useful.
- // Parameters :
- // $p_dir : Directory path to check.
- // Return Values :
- // 1 : OK
- // -1 : Unable to create directory
- // --------------------------------------------------------------------------------
- public function privDirCheck($p_dir, $p_is_dir = false)
- {
- $v_result = 1;
-
- // ----- Remove the final '/'
- if (($p_is_dir) && (substr($p_dir, -1)=='/')) {
- $p_dir = substr($p_dir, 0, strlen($p_dir)-1);
- }
-
- // ----- Check the directory availability
- if ((is_dir($p_dir)) || ($p_dir == "")) {
- return 1;
- }
-
- // ----- Extract parent directory
- $p_parent_dir = dirname($p_dir);
-
- // ----- Just a check
- if ($p_parent_dir != $p_dir) {
- // ----- Look for parent directory
- if ($p_parent_dir != "") {
- if (($v_result = $this->privDirCheck($p_parent_dir)) != 1) {
- return $v_result;
- }
- }
- }
-
- // ----- Create the directory
- if (!@mkdir($p_dir, 0777)) {
- // ----- Error log
- PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, "Unable to create directory '$p_dir'");
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privMerge()
- // Description :
- // If $p_archive_to_add does not exist, the function exit with a success result.
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privMerge(&$p_archive_to_add)
- {
- $v_result=1;
-
- // ----- Look if the archive_to_add exists
- if (!is_file($p_archive_to_add->zipname)) {
- // ----- Nothing to merge, so merge is a success
- $v_result = 1;
-
- // ----- Return
- return $v_result;
- }
-
- // ----- Look if the archive exists
- if (!is_file($this->zipname)) {
- // ----- Do a duplicate
- $v_result = $this->privDuplicate($p_archive_to_add->zipname);
-
- // ----- Return
- return $v_result;
- }
-
- // ----- Open the zip file
- if (($v_result=$this->privOpenFd('rb')) != 1) {
- // ----- Return
- return $v_result;
- }
-
- // ----- Read the central directory informations
- $v_central_dir = array();
- if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) {
- $this->privCloseFd();
- return $v_result;
- }
-
- // ----- Go to beginning of File
- @rewind($this->zip_fd);
-
- // ----- Open the archive_to_add file
- if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1) {
- $this->privCloseFd();
-
- // ----- Return
- return $v_result;
- }
-
- // ----- Read the central directory informations
- $v_central_dir_to_add = array();
- if (($v_result = $p_archive_to_add->privReadEndCentralDir($v_central_dir_to_add)) != 1) {
- $this->privCloseFd();
- $p_archive_to_add->privCloseFd();
-
- return $v_result;
- }
-
- // ----- Go to beginning of File
- @rewind($p_archive_to_add->zip_fd);
-
- // ----- Creates a temporay file
- $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp';
-
- // ----- Open the temporary file in write mode
- if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) {
- $this->privCloseFd();
- $p_archive_to_add->privCloseFd();
-
- PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode');
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Copy the files from the archive to the temporary file
- // TBC : Here I should better append the file and go back to erase the central dir
- $v_size = $v_central_dir['offset'];
- while ($v_size != 0) {
- $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- $v_buffer = fread($this->zip_fd, $v_read_size);
- @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
- $v_size -= $v_read_size;
- }
-
- // ----- Copy the files from the archive_to_add into the temporary file
- $v_size = $v_central_dir_to_add['offset'];
- while ($v_size != 0) {
- $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- $v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size);
- @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
- $v_size -= $v_read_size;
- }
-
- // ----- Store the offset of the central dir
- $v_offset = @ftell($v_zip_temp_fd);
-
- // ----- Copy the block of file headers from the old archive
- $v_size = $v_central_dir['size'];
- while ($v_size != 0) {
- $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- $v_buffer = @fread($this->zip_fd, $v_read_size);
- @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
- $v_size -= $v_read_size;
- }
-
- // ----- Copy the block of file headers from the archive_to_add
- $v_size = $v_central_dir_to_add['size'];
- while ($v_size != 0) {
- $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size);
- @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size);
- $v_size -= $v_read_size;
- }
-
- // ----- Merge the file comments
- $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment'];
-
- // ----- Calculate the size of the (new) central header
- $v_size = @ftell($v_zip_temp_fd)-$v_offset;
-
- // ----- Swap the file descriptor
- // Here is a trick : I swap the temporary fd with the zip fd, in order to use
- // the following methods on the temporary fil and not the real archive fd
- $v_swap = $this->zip_fd;
- $this->zip_fd = $v_zip_temp_fd;
- $v_zip_temp_fd = $v_swap;
-
- // ----- Create the central dir footer
- if (($v_result = $this->privWriteCentralHeader($v_central_dir['entries']+$v_central_dir_to_add['entries'], $v_size, $v_offset, $v_comment)) != 1) {
- $this->privCloseFd();
- $p_archive_to_add->privCloseFd();
- @fclose($v_zip_temp_fd);
- $this->zip_fd = null;
-
- // ----- Reset the file list
- unset($v_header_list);
-
- // ----- Return
- return $v_result;
- }
-
- // ----- Swap back the file descriptor
- $v_swap = $this->zip_fd;
- $this->zip_fd = $v_zip_temp_fd;
- $v_zip_temp_fd = $v_swap;
-
- // ----- Close
- $this->privCloseFd();
- $p_archive_to_add->privCloseFd();
-
- // ----- Close the temporary file
- @fclose($v_zip_temp_fd);
-
- // ----- Delete the zip file
- // TBC : I should test the result ...
- @unlink($this->zipname);
-
- // ----- Rename the temporary file
- // TBC : I should test the result ...
- //@rename($v_zip_temp_name, $this->zipname);
- PclZipUtilRename($v_zip_temp_name, $this->zipname);
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privDuplicate()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privDuplicate($p_archive_filename)
- {
- $v_result=1;
-
- // ----- Look if the $p_archive_filename exists
- if (!is_file($p_archive_filename)) {
- // ----- Nothing to duplicate, so duplicate is a success.
- $v_result = 1;
-
- // ----- Return
- return $v_result;
- }
-
- // ----- Open the zip file
- if (($v_result=$this->privOpenFd('wb')) != 1) {
- // ----- Return
- return $v_result;
- }
-
- // ----- Open the temporary file in write mode
- if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0) {
- $this->privCloseFd();
-
- PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode');
-
- // ----- Return
- return PclZip::errorCode();
- }
-
- // ----- Copy the files from the archive to the temporary file
- // TBC : Here I should better append the file and go back to erase the central dir
- $v_size = filesize($p_archive_filename);
- while ($v_size != 0) {
- $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE);
- $v_buffer = fread($v_zip_temp_fd, $v_read_size);
- @fwrite($this->zip_fd, $v_buffer, $v_read_size);
- $v_size -= $v_read_size;
- }
-
- // ----- Close
- $this->privCloseFd();
-
- // ----- Close the temporary file
- @fclose($v_zip_temp_fd);
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privErrorLog()
- // Description :
- // Parameters :
- // --------------------------------------------------------------------------------
- public function privErrorLog($p_error_code = 0, $p_error_string = '')
- {
- if (PCLZIP_ERROR_EXTERNAL == 1) {
- PclError($p_error_code, $p_error_string);
- } else {
- $this->error_code = $p_error_code;
- $this->error_string = $p_error_string;
- }
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privErrorReset()
- // Description :
- // Parameters :
- // --------------------------------------------------------------------------------
- public function privErrorReset()
- {
- if (PCLZIP_ERROR_EXTERNAL == 1) {
- PclErrorReset();
- } else {
- $this->error_code = 0;
- $this->error_string = '';
- }
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privDisableMagicQuotes()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privDisableMagicQuotes()
- {
- $v_result=1;
-
- // ----- Look if function exists
- if ((!function_exists("get_magic_quotes_runtime")) || (!function_exists("set_magic_quotes_runtime"))) {
- return $v_result;
- }
-
- // ----- Look if already done
- if ($this->magic_quotes_status != -1) {
- return $v_result;
- }
-
- // ----- Get and memorize the magic_quote value
- $this->magic_quotes_status = @get_magic_quotes_runtime();
-
- // ----- Disable magic_quotes
- if ($this->magic_quotes_status == 1) {
- @set_magic_quotes_runtime(0);
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-
- // --------------------------------------------------------------------------------
- // Function : privSwapBackMagicQuotes()
- // Description :
- // Parameters :
- // Return Values :
- // --------------------------------------------------------------------------------
- public function privSwapBackMagicQuotes()
- {
- $v_result=1;
-
- // ----- Look if function exists
- if ((!function_exists("get_magic_quotes_runtime")) || (!function_exists("set_magic_quotes_runtime"))) {
- return $v_result;
- }
-
- // ----- Look if something to do
- if ($this->magic_quotes_status != -1) {
- return $v_result;
- }
-
- // ----- Swap back magic_quotes
- if ($this->magic_quotes_status == 1) {
- @set_magic_quotes_runtime($this->magic_quotes_status);
- }
-
- // ----- Return
- return $v_result;
- }
- // --------------------------------------------------------------------------------
-}
-// End of class
-// --------------------------------------------------------------------------------
-
-// --------------------------------------------------------------------------------
-// Function : PclZipUtilPathReduction()
-// Description :
-// Parameters :
-// Return Values :
-// --------------------------------------------------------------------------------
-function PclZipUtilPathReduction($p_dir)
-{
- $v_result = "";
-
- // ----- Look for not empty path
- if ($p_dir != "") {
- // ----- Explode path by directory names
- $v_list = explode("/", $p_dir);
-
- // ----- Study directories from last to first
- $v_skip = 0;
- for ($i=sizeof($v_list)-1; $i>=0; $i--) {
- // ----- Look for current path
- if ($v_list[$i] == ".") {
- // ----- Ignore this directory
- // Should be the first $i=0, but no check is done
- } elseif ($v_list[$i] == "..") {
- $v_skip++;
- } elseif ($v_list[$i] == "") {
- // ----- First '/' i.e. root slash
- if ($i == 0) {
- $v_result = "/".$v_result;
- if ($v_skip > 0) {
- // ----- It is an invalid path, so the path is not modified
- // TBC
- $v_result = $p_dir;
- $v_skip = 0;
- }
- } elseif ($i == (sizeof($v_list)-1)) {
- // ----- Last '/' i.e. indicates a directory
- $v_result = $v_list[$i];
- } else {
- // ----- Double '/' inside the path
- // ----- Ignore only the double '//' in path,
- // but not the first and last '/'
- }
- } else {
- // ----- Look for item to skip
- if ($v_skip > 0) {
- $v_skip--;
- } else {
- $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:"");
- }
- }
- }
-
- // ----- Look for skip
- if ($v_skip > 0) {
- while ($v_skip > 0) {
- $v_result = '../'.$v_result;
- $v_skip--;
- }
- }
- }
-
- // ----- Return
- return $v_result;
-}
-// --------------------------------------------------------------------------------
-
-// --------------------------------------------------------------------------------
-// Function : PclZipUtilPathInclusion()
-// Description :
-// This function indicates if the path $p_path is under the $p_dir tree. Or,
-// said in an other way, if the file or sub-dir $p_path is inside the dir
-// $p_dir.
-// The function indicates also if the path is exactly the same as the dir.
-// This function supports path with duplicated '/' like '//', but does not
-// support '.' or '..' statements.
-// Parameters :
-// Return Values :
-// 0 if $p_path is not inside directory $p_dir
-// 1 if $p_path is inside directory $p_dir
-// 2 if $p_path is exactly the same as $p_dir
-// --------------------------------------------------------------------------------
-function PclZipUtilPathInclusion($p_dir, $p_path)
-{
- $v_result = 1;
-
- // ----- Look for path beginning by ./
- if (($p_dir == '.') || ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) {
- $p_dir = PclZipUtilTranslateWinPath(getcwd(), false).'/'.substr($p_dir, 1);
- }
- if (($p_path == '.') || ((strlen($p_path) >=2) && (substr($p_path, 0, 2) == './'))) {
- $p_path = PclZipUtilTranslateWinPath(getcwd(), false).'/'.substr($p_path, 1);
- }
-
- // ----- Explode dir and path by directory separator
- $v_list_dir = explode("/", $p_dir);
- $v_list_dir_size = sizeof($v_list_dir);
- $v_list_path = explode("/", $p_path);
- $v_list_path_size = sizeof($v_list_path);
-
- // ----- Study directories paths
- $i = 0;
- $j = 0;
- while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) {
- // ----- Look for empty dir (path reduction)
- if ($v_list_dir[$i] == '') {
- $i++;
- continue;
- }
- if ($v_list_path[$j] == '') {
- $j++;
- continue;
- }
-
- // ----- Compare the items
- if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ($v_list_path[$j] != '')) {
- $v_result = 0;
- }
-
- // ----- Next items
- $i++;
- $j++;
- }
-
- // ----- Look if everything seems to be the same
- if ($v_result) {
- // ----- Skip all the empty items
- while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) {
- $j++;
- }
- while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) {
- $i++;
- }
-
- if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) {
- // ----- There are exactly the same
- $v_result = 2;
- } elseif ($i < $v_list_dir_size) {
- // ----- The path is shorter than the dir
- $v_result = 0;
- }
- }
-
- // ----- Return
- return $v_result;
-}
-// --------------------------------------------------------------------------------
-
-// --------------------------------------------------------------------------------
-// Function : PclZipUtilCopyBlock()
-// Description :
-// Parameters :
-// $p_mode : read/write compression mode
-// 0 : src & dest normal
-// 1 : src gzip, dest normal
-// 2 : src normal, dest gzip
-// 3 : src & dest gzip
-// Return Values :
-// --------------------------------------------------------------------------------
-function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode = 0)
-{
- $v_result = 1;
-
- if ($p_mode==0) {
- while ($p_size != 0) {
- $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
- $v_buffer = @fread($p_src, $v_read_size);
- @fwrite($p_dest, $v_buffer, $v_read_size);
- $p_size -= $v_read_size;
- }
- } elseif ($p_mode==1) {
- while ($p_size != 0) {
- $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
- $v_buffer = @gzread($p_src, $v_read_size);
- @fwrite($p_dest, $v_buffer, $v_read_size);
- $p_size -= $v_read_size;
- }
- } elseif ($p_mode==2) {
- while ($p_size != 0) {
- $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
- $v_buffer = @fread($p_src, $v_read_size);
- @gzwrite($p_dest, $v_buffer, $v_read_size);
- $p_size -= $v_read_size;
- }
- } elseif ($p_mode==3) {
- while ($p_size != 0) {
- $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE);
- $v_buffer = @gzread($p_src, $v_read_size);
- @gzwrite($p_dest, $v_buffer, $v_read_size);
- $p_size -= $v_read_size;
- }
- }
-
- // ----- Return
- return $v_result;
-}
-// --------------------------------------------------------------------------------
-
-// --------------------------------------------------------------------------------
-// Function : PclZipUtilRename()
-// Description :
-// This function tries to do a simple rename() function. If it fails, it
-// tries to copy the $p_src file in a new $p_dest file and then unlink the
-// first one.
-// Parameters :
-// $p_src : Old filename
-// $p_dest : New filename
-// Return Values :
-// 1 on success, 0 on failure.
-// --------------------------------------------------------------------------------
-function PclZipUtilRename($p_src, $p_dest)
-{
- $v_result = 1;
-
- // ----- Try to rename the files
- if (!@rename($p_src, $p_dest)) {
- // ----- Try to copy & unlink the src
- if (!@copy($p_src, $p_dest)) {
- $v_result = 0;
- } elseif (!@unlink($p_src)) {
- $v_result = 0;
- }
- }
-
- // ----- Return
- return $v_result;
-}
-// --------------------------------------------------------------------------------
-
-// --------------------------------------------------------------------------------
-// Function : PclZipUtilOptionText()
-// Description :
-// Translate option value in text. Mainly for debug purpose.
-// Parameters :
-// $p_option : the option value.
-// Return Values :
-// The option text value.
-// --------------------------------------------------------------------------------
-function PclZipUtilOptionText($p_option)
-{
- $v_list = get_defined_constants();
- for (reset($v_list); $v_key = key($v_list); next($v_list)) {
- $v_prefix = substr($v_key, 0, 10);
- if ((($v_prefix == 'PCLZIP_OPT') || ($v_prefix == 'PCLZIP_CB_') || ($v_prefix == 'PCLZIP_ATT')) && ($v_list[$v_key] == $p_option)) {
- return $v_key;
- }
- }
-
- $v_result = 'Unknown';
-
- return $v_result;
-}
-// --------------------------------------------------------------------------------
-
-// --------------------------------------------------------------------------------
-// Function : PclZipUtilTranslateWinPath()
-// Description :
-// Translate windows path by replacing '\' by '/' and optionally removing
-// drive letter.
-// Parameters :
-// $p_path : path to translate.
-// $p_remove_disk_letter : true | false
-// Return Values :
-// The path translated.
-// --------------------------------------------------------------------------------
-function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter = true)
-{
- if (stristr(php_uname(), 'windows')) {
- // ----- Look for potential disk letter
- if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) {
- $p_path = substr($p_path, $v_position+1);
- }
- // ----- Change potential windows directory separator
- if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0, 1) == '\\')) {
- $p_path = strtr($p_path, '\\', '/');
- }
- }
- return $p_path;
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/PCLZip/readme.txt b/lib/phpexcel/PHPExcel/Shared/PCLZip/readme.txt
deleted file mode 100644
index 6ed88394772..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/PCLZip/readme.txt
+++ /dev/null
@@ -1,421 +0,0 @@
-// --------------------------------------------------------------------------------
-// PclZip 2.8.2 - readme.txt
-// --------------------------------------------------------------------------------
-// License GNU/LGPL - August 2009
-// Vincent Blavet - vincent@phpconcept.net
-// http://www.phpconcept.net
-// --------------------------------------------------------------------------------
-// $Id: readme.txt,v 1.60 2009/09/30 20:35:21 vblavet Exp $
-// --------------------------------------------------------------------------------
-
-
-
-0 - Sommaire
-============
- 1 - Introduction
- 2 - What's new
- 3 - Corrected bugs
- 4 - Known bugs or limitations
- 5 - License
- 6 - Warning
- 7 - Documentation
- 8 - Author
- 9 - Contribute
-
-1 - Introduction
-================
-
- PclZip is a library that allow you to manage a Zip archive.
-
- Full documentation about PclZip can be found here : http://www.phpconcept.net/pclzip
-
-2 - What's new
-==============
-
- Version 2.8.2 :
- - PCLZIP_CB_PRE_EXTRACT and PCLZIP_CB_POST_EXTRACT are now supported with
- extraction as a string (PCLZIP_OPT_EXTRACT_AS_STRING). The string
- can also be modified in the post-extract call back.
- **Bugs correction :
- - PCLZIP_OPT_REMOVE_ALL_PATH was not working correctly
- - Remove use of eval() and do direct call to callback functions
- - Correct support of 64bits systems (Thanks to WordPress team)
-
- Version 2.8.1 :
- - Move option PCLZIP_OPT_BY_EREG to PCLZIP_OPT_BY_PREG because ereg() is
- deprecated in PHP 5.3. When using option PCLZIP_OPT_BY_EREG, PclZip will
- automatically replace it by PCLZIP_OPT_BY_PREG.
-
- Version 2.8 :
- - Improve extraction of zip archive for large files by using temporary files
- This feature is working like the one defined in r2.7.
- Options are renamed : PCLZIP_OPT_TEMP_FILE_ON, PCLZIP_OPT_TEMP_FILE_OFF,
- PCLZIP_OPT_TEMP_FILE_THRESHOLD
- - Add a ratio constant PCLZIP_TEMPORARY_FILE_RATIO to configure the auto
- sense of temporary file use.
- - Bug correction : Reduce filepath in returned file list to remove ennoying
- './/' preambule in file path.
-
- Version 2.7 :
- - Improve creation of zip archive for large files :
- PclZip will now autosense the configured memory and use temporary files
- when large file is suspected.
- This feature can also ne triggered by manual options in create() and add()
- methods. 'PCLZIP_OPT_ADD_TEMP_FILE_ON' force the use of temporary files,
- 'PCLZIP_OPT_ADD_TEMP_FILE_OFF' disable the autosense technic,
- 'PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD' allow for configuration of a size
- threshold to use temporary files.
- Using "temporary files" rather than "memory" might take more time, but
- might give the ability to zip very large files :
- Tested on my win laptop with a 88Mo file :
- Zip "in-memory" : 18sec (max_execution_time=30, memory_limit=180Mo)
- Zip "tmporary-files" : 23sec (max_execution_time=30, memory_limit=30Mo)
- - Replace use of mktime() by time() to limit the E_STRICT error messages.
- - Bug correction : When adding files with full windows path (drive letter)
- PclZip is now working. Before, if the drive letter is not the default
- path, PclZip was not able to add the file.
-
- Version 2.6 :
- - Code optimisation
- - New attributes PCLZIP_ATT_FILE_COMMENT gives the ability to
- add a comment for a specific file. (Don't really know if this is usefull)
- - New attribute PCLZIP_ATT_FILE_CONTENT gives the ability to add a string
- as a file.
- - New attribute PCLZIP_ATT_FILE_MTIME modify the timestamp associated with
- a file.
- - Correct a bug. Files archived with a timestamp with 0h0m0s were extracted
- with current time
- - Add CRC value in the informations returned back for each file after an
- action.
- - Add missing closedir() statement.
- - When adding a folder, and removing the path of this folder, files were
- incorrectly added with a '/' at the beginning. Which means files are
- related to root in unix systems. Corrected.
- - Add conditional if before constant definition. This will allow users
- to redefine constants without changing the file, and then improve
- upgrade of pclzip code for new versions.
-
- Version 2.5 :
- - Introduce the ability to add file/folder with individual properties (file descriptor).
- This gives for example the ability to change the filename of a zipped file.
- . Able to add files individually
- . Able to change full name
- . Able to change short name
- . Compatible with global options
- - New attributes : PCLZIP_ATT_FILE_NAME, PCLZIP_ATT_FILE_NEW_SHORT_NAME, PCLZIP_ATT_FILE_NEW_FULL_NAME
- - New error code : PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE
- - Add a security control feature. PclZip can extract any file in any folder
- of a system. People may use this to upload a zip file and try to override
- a system file. The PCLZIP_OPT_EXTRACT_DIR_RESTRICTION will give the
- ability to forgive any directory transversal behavior.
- - New PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : check extraction path
- - New error code : PCLZIP_ERR_DIRECTORY_RESTRICTION
- - Modification in PclZipUtilPathInclusion() : dir and path beginning with ./ will be prepend
- by current path (getcwd())
-
- Version 2.4 :
- - Code improvment : try to speed up the code by removing unusefull call to pack()
- - Correct bug in delete() : delete() should be called with no argument. This was not
- the case in 2.3. This is corrected in 2.4.
- - Correct a bug in path_inclusion function. When the path has several '../../', the
- result was bad.
- - Add a check for magic_quotes_runtime configuration. If enabled, PclZip will
- disable it while working and det it back to its original value.
- This resolve a lots of bad formated archive errors.
- - Bug correction : PclZip now correctly unzip file in some specific situation,
- when compressed content has same size as uncompressed content.
- - Bug correction : When selecting option 'PCLZIP_OPT_REMOVE_ALL_PATH',
- directories are not any more created.
- - Code improvment : correct unclosed opendir(), better handling of . and .. in
- loops.
-
-
- Version 2.3 :
- - Correct a bug with PHP5 : affecting the value 0xFE49FFE0 to a variable does not
- give the same result in PHP4 and PHP5 ....
-
- Version 2.2 :
- - Try development of PCLZIP_OPT_CRYPT .....
- However this becomes to a stop. To crypt/decrypt I need to multiply 2 long integers,
- the result (greater than a long) is not supported by PHP. Even the use of bcmath
- functions does not help. I did not find yet a solution ...;
- - Add missing '/' at end of directory entries
- - Check is a file is encrypted or not. Returns status 'unsupported_encryption' and/or
- error code PCLZIP_ERR_UNSUPPORTED_ENCRYPTION.
- - Corrected : Bad "version need to extract" field in local file header
- - Add private method privCheckFileHeaders() in order to check local and central
- file headers. PclZip is now supporting purpose bit flag bit 3. Purpose bit flag bit 3 gives
- the ability to have a local file header without size, compressed size and crc filled.
- - Add a generic status 'error' for file status
- - Add control of compression type. PclZip only support deflate compression method.
- Before v2.2, PclZip does not check the compression method used in an archive while
- extracting. With v2.2 PclZip returns a new error status for a file using an unsupported
- compression method. New status is "unsupported_compression". New error code is
- PCLZIP_ERR_UNSUPPORTED_COMPRESSION.
- - Add optional attribute PCLZIP_OPT_STOP_ON_ERROR. This will stop the extract of files
- when errors like 'a folder with same name exists' or 'a newer file exists' or
- 'a write protected file' exists, rather than set a status for the concerning file
- and resume the extract of the zip.
- - Add optional attribute PCLZIP_OPT_REPLACE_NEWER. This will force, during an extract' the
- replacement of the file, even if a newer version of the file exists.
- Note that today if a file with the same name already exists but is older it will be
- replaced by the extracted one.
- - Improve PclZipUtilOption()
- - Support of zip archive with trailing bytes. Before 2.2, PclZip checks that the central
- directory structure is the last data in the archive. Crypt encryption/decryption of
- zip archive put trailing 0 bytes after decryption. PclZip is now supporting this.
-
- Version 2.1 :
- - Add the ability to abort the extraction by using a user callback function.
- The user can now return the value '2' in its callback which indicates to stop the
- extraction. For a pre call-back extract is stopped before the extration of the current
- file. For a post call back, the extraction is stopped after.
- - Add the ability to extract a file (or several files) directly in the standard output.
- This is done by the new parameter PCLZIP_OPT_EXTRACT_IN_OUTPUT with method extract().
- - Add support for parameters PCLZIP_OPT_COMMENT, PCLZIP_OPT_ADD_COMMENT,
- PCLZIP_OPT_PREPEND_COMMENT. This will create, replace, add, or prepend comments
- in the zip archive.
- - When merging two archives, the comments are not any more lost, but merged, with a
- blank space separator.
- - Corrected bug : Files are not deleted when all files are asked to be deleted.
- - Corrected bug : Folders with name '0' made PclZip to abort the create or add feature.
-
-
- Version 2.0 :
- ***** Warning : Some new features may break the backward compatibility for your scripts.
- Please carefully read the readme file.
- - Add the ability to delete by Index, name and regular expression. This feature is
- performed by the method delete(), which uses the optional parameters
- PCLZIP_OPT_BY_INDEX, PCLZIP_OPT_BY_NAME, PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG.
- - Add the ability to extract by regular expression. To extract by regexp you must use the method
- extract(), with the option PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG
- (depending if you want to use ereg() or preg_match() syntax) followed by the
- regular expression pattern.
- - Add the ability to extract by index, directly with the extract() method. This is a
- code improvment of the extractByIndex() method.
- - Add the ability to extract by name. To extract by name you must use the method
- extract(), with the option PCLZIP_OPT_BY_NAME followed by the filename to
- extract or an array of filenames to extract. To extract all a folder, use the folder
- name rather than the filename with a '/' at the end.
- - Add the ability to add files without compression. This is done with a new attribute
- which is PCLZIP_OPT_NO_COMPRESSION.
- - Add the attribute PCLZIP_OPT_EXTRACT_AS_STRING, which allow to extract a file directly
- in a string without using any file (or temporary file).
- - Add constant PCLZIP_SEPARATOR for static configuration of filename separators in a single string.
- The default separator is now a comma (,) and not any more a blank space.
- THIS BREAK THE BACKWARD COMPATIBILITY : Please check if this may have an impact with
- your script.
- - Improve algorythm performance by removing the use of temporary files when adding or
- extracting files in an archive.
- - Add (correct) detection of empty filename zipping. This can occurs when the removed
- path is the same
- as a zipped dir. The dir is not zipped (['status'] = filtered), only its content.
- - Add better support for windows paths (thanks for help from manus@manusfreedom.com).
- - Corrected bug : When the archive file already exists with size=0, the add() method
- fails. Corrected in 2.0.
- - Remove the use of OS_WINDOWS constant. Use php_uname() function rather.
- - Control the order of index ranges in extract by index feature.
- - Change the internal management of folders (better handling of internal flag).
-
-
- Version 1.3 :
- - Removing the double include check. This is now done by include_once() and require_once()
- PHP directives.
- - Changing the error handling mecanism : Remove the use of an external error library.
- The former PclError...() functions are replaced by internal equivalent methods.
- By changing the environment variable PCLZIP_ERROR_EXTERNAL you can still use the former library.
- Introducing the use of constants for error codes rather than integer values. This will help
- in futur improvment.
- Introduction of error handling functions like errorCode(), errorName() and errorInfo().
- - Remove the deprecated use of calling function with arguments passed by reference.
- - Add the calling of extract(), extractByIndex(), create() and add() functions
- with variable options rather than fixed arguments.
- - Add the ability to remove all the file path while extracting or adding,
- without any need to specify the path to remove.
- This is available for extract(), extractByIndex(), create() and add() functionS by using
- the new variable options parameters :
- - PCLZIP_OPT_REMOVE_ALL_PATH : by indicating this option while calling the fct.
- - Ability to change the mode of a file after the extraction (chmod()).
- This is available for extract() and extractByIndex() functionS by using
- the new variable options parameters.
- - PCLZIP_OPT_SET_CHMOD : by setting the value of this option.
- - Ability to definition call-back options. These call-back will be called during the adding,
- or the extracting of file (extract(), extractByIndex(), create() and add() functions) :
- - PCLZIP_CB_PRE_EXTRACT : will be called before each extraction of a file. The user
- can trigerred the change the filename of the extracted file. The user can triggered the
- skip of the extraction. This is adding a 'skipped' status in the file list result value.
- - PCLZIP_CB_POST_EXTRACT : will be called after each extraction of a file.
- Nothing can be triggered from that point.
- - PCLZIP_CB_PRE_ADD : will be called before each add of a file. The user
- can trigerred the change the stored filename of the added file. The user can triggered the
- skip of the add. This is adding a 'skipped' status in the file list result value.
- - PCLZIP_CB_POST_ADD : will be called after each add of a file.
- Nothing can be triggered from that point.
- - Two status are added in the file list returned as function result : skipped & filename_too_long
- 'skipped' is used when a call-back function ask for skipping the file.
- 'filename_too_long' is used while adding a file with a too long filename to archive (the file is
- not added)
- - Adding the function PclZipUtilPathInclusion(), that check the inclusion of a path into
- a directory.
- - Add a check of the presence of the archive file before some actions (like list, ...)
- - Add the initialisation of field "index" in header array. This means that by
- default index will be -1 when not explicitly set by the methods.
-
- Version 1.2 :
- - Adding a duplicate function.
- - Adding a merge function. The merge function is a "quick merge" function,
- it just append the content of an archive at the end of the first one. There
- is no check for duplicate files or more recent files.
- - Improve the search of the central directory end.
-
- Version 1.1.2 :
-
- - Changing the license of PclZip. PclZip is now released under the GNU / LGPL license
- (see License section).
- - Adding the optional support of a static temporary directory. You will need to configure
- the constant PCLZIP_TEMPORARY_DIR if you want to use this feature.
- - Improving the rename() function. In some cases rename() does not work (different
- Filesystems), so it will be replaced by a copy() + unlink() functions.
-
- Version 1.1.1 :
-
- - Maintenance release, no new feature.
-
- Version 1.1 :
-
- - New method Add() : adding files in the archive
- - New method ExtractByIndex() : partial extract of the archive, files are identified by
- their index in the archive
- - New method DeleteByIndex() : delete some files/folder entries from the archive,
- files are identified by their index in the archive.
- - Adding a test of the zlib extension presence. If not present abort the script.
-
- Version 1.0.1 :
-
- - No new feature
-
-
-3 - Corrected bugs
-==================
-
- Corrected in Version 2.0 :
- - Corrected : During an extraction, if a call-back fucntion is used and try to skip
- a file, all the extraction process is stopped.
-
- Corrected in Version 1.3 :
- - Corrected : Support of static synopsis for method extract() is broken.
- - Corrected : invalid size of archive content field (0xFF) should be (0xFFFF).
- - Corrected : When an extract is done with a remove_path parameter, the entry for
- the directory with exactly the same path is not skipped/filtered.
- - Corrected : extractByIndex() and deleteByIndex() were not managing index in the
- right way. For example indexes '1,3-5,11' will only extract files 1 and 11. This
- is due to a sort of the index resulting table that puts 11 before 3-5 (sort on
- string and not interger). The sort is temporarilly removed, this means that
- you must provide a sorted list of index ranges.
-
- Corrected in Version 1.2 :
-
- - Nothing.
-
- Corrected in Version 1.1.2 :
-
- - Corrected : Winzip is unable to delete or add new files in a PclZip created archives.
-
- Corrected in Version 1.1.1 :
-
- - Corrected : When archived file is not compressed (0% compression), the
- extract method fails.
-
- Corrected in Version 1.1 :
-
- - Corrected : Adding a complete tree of folder may result in a bad archive
- creation.
-
- Corrected in Version 1.0.1 :
-
- - Corrected : Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024).
-
-
-4 - Known bugs or limitations
-=============================
-
- Please publish bugs reports in SourceForge :
- http://sourceforge.net/tracker/?group_id=40254&atid=427564
-
- In Version 2.x :
- - PclZip does only support file uncompressed or compressed with deflate (compression method 8)
- - PclZip does not support password protected zip archive
- - Some concern were seen when changing mtime of a file while archiving.
- Seems to be linked to Daylight Saving Time (PclTest_changing_mtime).
-
- In Version 1.2 :
-
- - merge() methods does not check for duplicate files or last date of modifications.
-
- In Version 1.1 :
-
- - Limitation : Using 'extract' fields in the file header in the zip archive is not supported.
- - WinZip is unable to delete a single file in a PclZip created archive. It is also unable to
- add a file in a PclZip created archive. (Corrected in v.1.2)
-
- In Version 1.0.1 :
-
- - Adding a complete tree of folder may result in a bad archive
- creation. (Corrected in V.1.1).
- - Path given to methods must be in the unix format (/) and not the Windows format (\).
- Workaround : Use only / directory separators.
- - PclZip is using temporary files that are sometime the name of the file with a .tmp or .gz
- added suffix. Files with these names may already exist and may be overwritten.
- Workaround : none.
- - PclZip does not check if the zlib extension is present. If it is absent, the zip
- file is not created and the lib abort without warning.
- Workaround : enable the zlib extension on the php install
-
- In Version 1.0 :
-
- - Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024).
- (Corrected in v.1.0.1)
- - Limitation : Multi-disk zip archive are not supported.
-
-
-5 - License
-===========
-
- Since version 1.1.2, PclZip Library is released under GNU/LGPL license.
- This library is free, so you can use it at no cost.
-
- HOWEVER, if you release a script, an application, a library or any kind of
- code using PclZip library (or a part of it), YOU MUST :
- - Indicate in the documentation (or a readme file), that your work
- uses PclZip Library, and make a reference to the author and the web site
- http://www.phpconcept.net
- - Gives the ability to the final user to update the PclZip libary.
-
- I will also appreciate that you send me a mail (vincent@phpconcept.net), just to
- be aware that someone is using PclZip.
-
- For more information about GNU/LGPL license : http://www.gnu.org
-
-6 - Warning
-=================
-
- This library and the associated files are non commercial, non professional work.
- It should not have unexpected results. However if any damage is caused by this software
- the author can not be responsible.
- The use of this software is at the risk of the user.
-
-7 - Documentation
-=================
- PclZip User Manuel is available in English on PhpConcept : http://www.phpconcept.net/pclzip/man/en/index.php
- A Russian translation was done by Feskov Kuzma : http://php.russofile.ru/ru/authors/unsort/zip/
-
-8 - Author
-==========
-
- This software was written by Vincent Blavet (vincent@phpconcept.net) on its leasure time.
-
-9 - Contribute
-==============
- If you want to contribute to the development of PclZip, please contact vincent@phpconcept.net.
- If you can help in financing PhpConcept hosting service, please go to
- http://www.phpconcept.net/soutien.php
diff --git a/lib/phpexcel/PHPExcel/Shared/PasswordHasher.php b/lib/phpexcel/PHPExcel/Shared/PasswordHasher.php
deleted file mode 100644
index 946742bf67a..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/PasswordHasher.php
+++ /dev/null
@@ -1,67 +0,0 @@
-.
- *
- * @param string $pPassword Password to hash
- * @return string Hashed password
- */
- public static function hashPassword($pPassword = '')
- {
- $password = 0x0000;
- $charPos = 1; // char position
-
- // split the plain text password in its component characters
- $chars = preg_split('//', $pPassword, -1, PREG_SPLIT_NO_EMPTY);
- foreach ($chars as $char) {
- $value = ord($char) << $charPos++; // shifted ASCII value
- $rotated_bits = $value >> 15; // rotated bits beyond bit 15
- $value &= 0x7fff; // first 15 bits
- $password ^= ($value | $rotated_bits);
- }
-
- $password ^= strlen($pPassword);
- $password ^= 0xCE4B;
-
- return(strtoupper(dechex($password)));
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/String.php b/lib/phpexcel/PHPExcel/Shared/String.php
deleted file mode 100644
index fa1a64e0553..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/String.php
+++ /dev/null
@@ -1,819 +0,0 @@
- chr(0),
- "\x1B 1" => chr(1),
- "\x1B 2" => chr(2),
- "\x1B 3" => chr(3),
- "\x1B 4" => chr(4),
- "\x1B 5" => chr(5),
- "\x1B 6" => chr(6),
- "\x1B 7" => chr(7),
- "\x1B 8" => chr(8),
- "\x1B 9" => chr(9),
- "\x1B :" => chr(10),
- "\x1B ;" => chr(11),
- "\x1B <" => chr(12),
- "\x1B :" => chr(13),
- "\x1B >" => chr(14),
- "\x1B ?" => chr(15),
- "\x1B!0" => chr(16),
- "\x1B!1" => chr(17),
- "\x1B!2" => chr(18),
- "\x1B!3" => chr(19),
- "\x1B!4" => chr(20),
- "\x1B!5" => chr(21),
- "\x1B!6" => chr(22),
- "\x1B!7" => chr(23),
- "\x1B!8" => chr(24),
- "\x1B!9" => chr(25),
- "\x1B!:" => chr(26),
- "\x1B!;" => chr(27),
- "\x1B!<" => chr(28),
- "\x1B!=" => chr(29),
- "\x1B!>" => chr(30),
- "\x1B!?" => chr(31),
- "\x1B'?" => chr(127),
- "\x1B(0" => '€', // 128 in CP1252
- "\x1B(2" => '‚', // 130 in CP1252
- "\x1B(3" => 'ƒ', // 131 in CP1252
- "\x1B(4" => '„', // 132 in CP1252
- "\x1B(5" => '…', // 133 in CP1252
- "\x1B(6" => '†', // 134 in CP1252
- "\x1B(7" => '‡', // 135 in CP1252
- "\x1B(8" => 'ˆ', // 136 in CP1252
- "\x1B(9" => '‰', // 137 in CP1252
- "\x1B(:" => 'Š', // 138 in CP1252
- "\x1B(;" => '‹', // 139 in CP1252
- "\x1BNj" => 'Œ', // 140 in CP1252
- "\x1B(>" => 'Ž', // 142 in CP1252
- "\x1B)1" => '‘', // 145 in CP1252
- "\x1B)2" => '’', // 146 in CP1252
- "\x1B)3" => '“', // 147 in CP1252
- "\x1B)4" => '”', // 148 in CP1252
- "\x1B)5" => '•', // 149 in CP1252
- "\x1B)6" => '–', // 150 in CP1252
- "\x1B)7" => '—', // 151 in CP1252
- "\x1B)8" => '˜', // 152 in CP1252
- "\x1B)9" => '™', // 153 in CP1252
- "\x1B):" => 'š', // 154 in CP1252
- "\x1B);" => '›', // 155 in CP1252
- "\x1BNz" => 'œ', // 156 in CP1252
- "\x1B)>" => 'ž', // 158 in CP1252
- "\x1B)?" => 'Ÿ', // 159 in CP1252
- "\x1B*0" => ' ', // 160 in CP1252
- "\x1BN!" => '¡', // 161 in CP1252
- "\x1BN\"" => '¢', // 162 in CP1252
- "\x1BN#" => '£', // 163 in CP1252
- "\x1BN(" => '¤', // 164 in CP1252
- "\x1BN%" => '¥', // 165 in CP1252
- "\x1B*6" => '¦', // 166 in CP1252
- "\x1BN'" => '§', // 167 in CP1252
- "\x1BNH " => '¨', // 168 in CP1252
- "\x1BNS" => '©', // 169 in CP1252
- "\x1BNc" => 'ª', // 170 in CP1252
- "\x1BN+" => '«', // 171 in CP1252
- "\x1B*<" => '¬', // 172 in CP1252
- "\x1B*=" => '', // 173 in CP1252
- "\x1BNR" => '®', // 174 in CP1252
- "\x1B*?" => '¯', // 175 in CP1252
- "\x1BN0" => '°', // 176 in CP1252
- "\x1BN1" => '±', // 177 in CP1252
- "\x1BN2" => '²', // 178 in CP1252
- "\x1BN3" => '³', // 179 in CP1252
- "\x1BNB " => '´', // 180 in CP1252
- "\x1BN5" => 'µ', // 181 in CP1252
- "\x1BN6" => '¶', // 182 in CP1252
- "\x1BN7" => '·', // 183 in CP1252
- "\x1B+8" => '¸', // 184 in CP1252
- "\x1BNQ" => '¹', // 185 in CP1252
- "\x1BNk" => 'º', // 186 in CP1252
- "\x1BN;" => '»', // 187 in CP1252
- "\x1BN<" => '¼', // 188 in CP1252
- "\x1BN=" => '½', // 189 in CP1252
- "\x1BN>" => '¾', // 190 in CP1252
- "\x1BN?" => '¿', // 191 in CP1252
- "\x1BNAA" => 'À', // 192 in CP1252
- "\x1BNBA" => 'Á', // 193 in CP1252
- "\x1BNCA" => 'Â', // 194 in CP1252
- "\x1BNDA" => 'Ã', // 195 in CP1252
- "\x1BNHA" => 'Ä', // 196 in CP1252
- "\x1BNJA" => 'Å', // 197 in CP1252
- "\x1BNa" => 'Æ', // 198 in CP1252
- "\x1BNKC" => 'Ç', // 199 in CP1252
- "\x1BNAE" => 'È', // 200 in CP1252
- "\x1BNBE" => 'É', // 201 in CP1252
- "\x1BNCE" => 'Ê', // 202 in CP1252
- "\x1BNHE" => 'Ë', // 203 in CP1252
- "\x1BNAI" => 'Ì', // 204 in CP1252
- "\x1BNBI" => 'Í', // 205 in CP1252
- "\x1BNCI" => 'Î', // 206 in CP1252
- "\x1BNHI" => 'Ï', // 207 in CP1252
- "\x1BNb" => 'Ð', // 208 in CP1252
- "\x1BNDN" => 'Ñ', // 209 in CP1252
- "\x1BNAO" => 'Ò', // 210 in CP1252
- "\x1BNBO" => 'Ó', // 211 in CP1252
- "\x1BNCO" => 'Ô', // 212 in CP1252
- "\x1BNDO" => 'Õ', // 213 in CP1252
- "\x1BNHO" => 'Ö', // 214 in CP1252
- "\x1B-7" => '×', // 215 in CP1252
- "\x1BNi" => 'Ø', // 216 in CP1252
- "\x1BNAU" => 'Ù', // 217 in CP1252
- "\x1BNBU" => 'Ú', // 218 in CP1252
- "\x1BNCU" => 'Û', // 219 in CP1252
- "\x1BNHU" => 'Ü', // 220 in CP1252
- "\x1B-=" => 'Ý', // 221 in CP1252
- "\x1BNl" => 'Þ', // 222 in CP1252
- "\x1BN{" => 'ß', // 223 in CP1252
- "\x1BNAa" => 'à', // 224 in CP1252
- "\x1BNBa" => 'á', // 225 in CP1252
- "\x1BNCa" => 'â', // 226 in CP1252
- "\x1BNDa" => 'ã', // 227 in CP1252
- "\x1BNHa" => 'ä', // 228 in CP1252
- "\x1BNJa" => 'å', // 229 in CP1252
- "\x1BNq" => 'æ', // 230 in CP1252
- "\x1BNKc" => 'ç', // 231 in CP1252
- "\x1BNAe" => 'è', // 232 in CP1252
- "\x1BNBe" => 'é', // 233 in CP1252
- "\x1BNCe" => 'ê', // 234 in CP1252
- "\x1BNHe" => 'ë', // 235 in CP1252
- "\x1BNAi" => 'ì', // 236 in CP1252
- "\x1BNBi" => 'í', // 237 in CP1252
- "\x1BNCi" => 'î', // 238 in CP1252
- "\x1BNHi" => 'ï', // 239 in CP1252
- "\x1BNs" => 'ð', // 240 in CP1252
- "\x1BNDn" => 'ñ', // 241 in CP1252
- "\x1BNAo" => 'ò', // 242 in CP1252
- "\x1BNBo" => 'ó', // 243 in CP1252
- "\x1BNCo" => 'ô', // 244 in CP1252
- "\x1BNDo" => 'õ', // 245 in CP1252
- "\x1BNHo" => 'ö', // 246 in CP1252
- "\x1B/7" => '÷', // 247 in CP1252
- "\x1BNy" => 'ø', // 248 in CP1252
- "\x1BNAu" => 'ù', // 249 in CP1252
- "\x1BNBu" => 'ú', // 250 in CP1252
- "\x1BNCu" => 'û', // 251 in CP1252
- "\x1BNHu" => 'ü', // 252 in CP1252
- "\x1B/=" => 'ý', // 253 in CP1252
- "\x1BN|" => 'þ', // 254 in CP1252
- "\x1BNHy" => 'ÿ', // 255 in CP1252
- );
- }
-
- /**
- * Get whether mbstring extension is available
- *
- * @return boolean
- */
- public static function getIsMbstringEnabled()
- {
- if (isset(self::$isMbstringEnabled)) {
- return self::$isMbstringEnabled;
- }
-
- self::$isMbstringEnabled = function_exists('mb_convert_encoding') ?
- true : false;
-
- return self::$isMbstringEnabled;
- }
-
- /**
- * Get whether iconv extension is available
- *
- * @return boolean
- */
- public static function getIsIconvEnabled()
- {
- if (isset(self::$isIconvEnabled)) {
- return self::$isIconvEnabled;
- }
-
- // Fail if iconv doesn't exist
- if (!function_exists('iconv')) {
- self::$isIconvEnabled = false;
- return false;
- }
-
- // Sometimes iconv is not working, and e.g. iconv('UTF-8', 'UTF-16LE', 'x') just returns false,
- if (!@iconv('UTF-8', 'UTF-16LE', 'x')) {
- self::$isIconvEnabled = false;
- return false;
- }
-
- // Sometimes iconv_substr('A', 0, 1, 'UTF-8') just returns false in PHP 5.2.0
- // we cannot use iconv in that case either (http://bugs.php.net/bug.php?id=37773)
- if (!@iconv_substr('A', 0, 1, 'UTF-8')) {
- self::$isIconvEnabled = false;
- return false;
- }
-
- // CUSTOM: IBM AIX iconv() does not work
- if (defined('PHP_OS') && @stristr(PHP_OS, 'AIX') && defined('ICONV_IMPL') && (@strcasecmp(ICONV_IMPL, 'unknown') == 0) && defined('ICONV_VERSION') && (@strcasecmp(ICONV_VERSION, 'unknown') == 0)) {
- self::$isIconvEnabled = false;
- return false;
- }
-
- // If we reach here no problems were detected with iconv
- self::$isIconvEnabled = true;
- return true;
- }
-
- public static function buildCharacterSets()
- {
- if (empty(self::$controlCharacters)) {
- self::buildControlCharacters();
- }
- if (empty(self::$SYLKCharacters)) {
- self::buildSYLKCharacters();
- }
- }
-
- /**
- * Convert from OpenXML escaped control character to PHP control character
- *
- * Excel 2007 team:
- * ----------------
- * That's correct, control characters are stored directly in the shared-strings table.
- * We do encode characters that cannot be represented in XML using the following escape sequence:
- * _xHHHH_ where H represents a hexadecimal character in the character's value...
- * So you could end up with something like _x0008_ in a string (either in a cell value ()
- * element or in the shared string element.
- *
- * @param string $value Value to unescape
- * @return string
- */
- public static function ControlCharacterOOXML2PHP($value = '')
- {
- return str_replace(array_keys(self::$controlCharacters), array_values(self::$controlCharacters), $value);
- }
-
- /**
- * Convert from PHP control character to OpenXML escaped control character
- *
- * Excel 2007 team:
- * ----------------
- * That's correct, control characters are stored directly in the shared-strings table.
- * We do encode characters that cannot be represented in XML using the following escape sequence:
- * _xHHHH_ where H represents a hexadecimal character in the character's value...
- * So you could end up with something like _x0008_ in a string (either in a cell value ()
- * element or in the shared string element.
- *
- * @param string $value Value to escape
- * @return string
- */
- public static function ControlCharacterPHP2OOXML($value = '')
- {
- return str_replace(array_values(self::$controlCharacters), array_keys(self::$controlCharacters), $value);
- }
-
- /**
- * Try to sanitize UTF8, stripping invalid byte sequences. Not perfect. Does not surrogate characters.
- *
- * @param string $value
- * @return string
- */
- public static function SanitizeUTF8($value)
- {
- if (self::getIsIconvEnabled()) {
- $value = @iconv('UTF-8', 'UTF-8', $value);
- return $value;
- }
-
- if (self::getIsMbstringEnabled()) {
- $value = mb_convert_encoding($value, 'UTF-8', 'UTF-8');
- return $value;
- }
-
- // else, no conversion
- return $value;
- }
-
- /**
- * Check if a string contains UTF8 data
- *
- * @param string $value
- * @return boolean
- */
- public static function IsUTF8($value = '')
- {
- return $value === '' || preg_match('/^./su', $value) === 1;
- }
-
- /**
- * Formats a numeric value as a string for output in various output writers forcing
- * point as decimal separator in case locale is other than English.
- *
- * @param mixed $value
- * @return string
- */
- public static function FormatNumber($value)
- {
- if (is_float($value)) {
- return str_replace(',', '.', $value);
- }
- return (string) $value;
- }
-
- /**
- * Converts a UTF-8 string into BIFF8 Unicode string data (8-bit string length)
- * Writes the string using uncompressed notation, no rich text, no Asian phonetics
- * If mbstring extension is not available, ASCII is assumed, and compressed notation is used
- * although this will give wrong results for non-ASCII strings
- * see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect. 2.5.3
- *
- * @param string $value UTF-8 encoded string
- * @param mixed[] $arrcRuns Details of rich text runs in $value
- * @return string
- */
- public static function UTF8toBIFF8UnicodeShort($value, $arrcRuns = array())
- {
- // character count
- $ln = self::CountCharacters($value, 'UTF-8');
- // option flags
- if (empty($arrcRuns)) {
- $opt = (self::getIsIconvEnabled() || self::getIsMbstringEnabled()) ?
- 0x0001 : 0x0000;
- $data = pack('CC', $ln, $opt);
- // characters
- $data .= self::ConvertEncoding($value, 'UTF-16LE', 'UTF-8');
- } else {
- $data = pack('vC', $ln, 0x09);
- $data .= pack('v', count($arrcRuns));
- // characters
- $data .= self::ConvertEncoding($value, 'UTF-16LE', 'UTF-8');
- foreach ($arrcRuns as $cRun) {
- $data .= pack('v', $cRun['strlen']);
- $data .= pack('v', $cRun['fontidx']);
- }
- }
- return $data;
- }
-
- /**
- * Converts a UTF-8 string into BIFF8 Unicode string data (16-bit string length)
- * Writes the string using uncompressed notation, no rich text, no Asian phonetics
- * If mbstring extension is not available, ASCII is assumed, and compressed notation is used
- * although this will give wrong results for non-ASCII strings
- * see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect. 2.5.3
- *
- * @param string $value UTF-8 encoded string
- * @return string
- */
- public static function UTF8toBIFF8UnicodeLong($value)
- {
- // character count
- $ln = self::CountCharacters($value, 'UTF-8');
-
- // option flags
- $opt = (self::getIsIconvEnabled() || self::getIsMbstringEnabled()) ?
- 0x0001 : 0x0000;
-
- // characters
- $chars = self::ConvertEncoding($value, 'UTF-16LE', 'UTF-8');
-
- $data = pack('vC', $ln, $opt) . $chars;
- return $data;
- }
-
- /**
- * Convert string from one encoding to another. First try mbstring, then iconv, finally strlen
- *
- * @param string $value
- * @param string $to Encoding to convert to, e.g. 'UTF-8'
- * @param string $from Encoding to convert from, e.g. 'UTF-16LE'
- * @return string
- */
- public static function ConvertEncoding($value, $to, $from)
- {
- if (self::getIsIconvEnabled()) {
- return iconv($from, $to, $value);
- }
-
- if (self::getIsMbstringEnabled()) {
- return mb_convert_encoding($value, $to, $from);
- }
-
- if ($from == 'UTF-16LE') {
- return self::utf16_decode($value, false);
- } elseif ($from == 'UTF-16BE') {
- return self::utf16_decode($value);
- }
- // else, no conversion
- return $value;
- }
-
- /**
- * Decode UTF-16 encoded strings.
- *
- * Can handle both BOM'ed data and un-BOM'ed data.
- * Assumes Big-Endian byte order if no BOM is available.
- * This function was taken from http://php.net/manual/en/function.utf8-decode.php
- * and $bom_be parameter added.
- *
- * @param string $str UTF-16 encoded data to decode.
- * @return string UTF-8 / ISO encoded data.
- * @access public
- * @version 0.2 / 2010-05-13
- * @author Rasmus Andersson {@link http://rasmusandersson.se/}
- * @author vadik56
- */
- public static function utf16_decode($str, $bom_be = true)
- {
- if (strlen($str) < 2) {
- return $str;
- }
- $c0 = ord($str{0});
- $c1 = ord($str{1});
- if ($c0 == 0xfe && $c1 == 0xff) {
- $str = substr($str, 2);
- } elseif ($c0 == 0xff && $c1 == 0xfe) {
- $str = substr($str, 2);
- $bom_be = false;
- }
- $len = strlen($str);
- $newstr = '';
- for ($i=0; $i<$len; $i+=2) {
- if ($bom_be) {
- $val = ord($str{$i}) << 4;
- $val += ord($str{$i+1});
- } else {
- $val = ord($str{$i+1}) << 4;
- $val += ord($str{$i});
- }
- $newstr .= ($val == 0x228) ? "\n" : chr($val);
- }
- return $newstr;
- }
-
- /**
- * Get character count. First try mbstring, then iconv, finally strlen
- *
- * @param string $value
- * @param string $enc Encoding
- * @return int Character count
- */
- public static function CountCharacters($value, $enc = 'UTF-8')
- {
- if (self::getIsMbstringEnabled()) {
- return mb_strlen($value, $enc);
- }
-
- if (self::getIsIconvEnabled()) {
- return iconv_strlen($value, $enc);
- }
-
- // else strlen
- return strlen($value);
- }
-
- /**
- * Get a substring of a UTF-8 encoded string. First try mbstring, then iconv, finally strlen
- *
- * @param string $pValue UTF-8 encoded string
- * @param int $pStart Start offset
- * @param int $pLength Maximum number of characters in substring
- * @return string
- */
- public static function Substring($pValue = '', $pStart = 0, $pLength = 0)
- {
- if (self::getIsMbstringEnabled()) {
- return mb_substr($pValue, $pStart, $pLength, 'UTF-8');
- }
-
- if (self::getIsIconvEnabled()) {
- return iconv_substr($pValue, $pStart, $pLength, 'UTF-8');
- }
-
- // else substr
- return substr($pValue, $pStart, $pLength);
- }
-
- /**
- * Convert a UTF-8 encoded string to upper case
- *
- * @param string $pValue UTF-8 encoded string
- * @return string
- */
- public static function StrToUpper($pValue = '')
- {
- if (function_exists('mb_convert_case')) {
- return mb_convert_case($pValue, MB_CASE_UPPER, "UTF-8");
- }
- return strtoupper($pValue);
- }
-
- /**
- * Convert a UTF-8 encoded string to lower case
- *
- * @param string $pValue UTF-8 encoded string
- * @return string
- */
- public static function StrToLower($pValue = '')
- {
- if (function_exists('mb_convert_case')) {
- return mb_convert_case($pValue, MB_CASE_LOWER, "UTF-8");
- }
- return strtolower($pValue);
- }
-
- /**
- * Convert a UTF-8 encoded string to title/proper case
- * (uppercase every first character in each word, lower case all other characters)
- *
- * @param string $pValue UTF-8 encoded string
- * @return string
- */
- public static function StrToTitle($pValue = '')
- {
- if (function_exists('mb_convert_case')) {
- return mb_convert_case($pValue, MB_CASE_TITLE, "UTF-8");
- }
- return ucwords($pValue);
- }
-
- public static function mb_is_upper($char)
- {
- return mb_strtolower($char, "UTF-8") != $char;
- }
-
- public static function mb_str_split($string)
- {
- # Split at all position not after the start: ^
- # and not before the end: $
- return preg_split('/(?_calculateFormulaValue($fractionFormula);
- return true;
- }
- return false;
- } // function convertToNumberIfFraction()
-
- /**
- * Get the decimal separator. If it has not yet been set explicitly, try to obtain number
- * formatting information from locale.
- *
- * @return string
- */
- public static function getDecimalSeparator()
- {
- if (!isset(self::$decimalSeparator)) {
- $localeconv = localeconv();
- self::$decimalSeparator = ($localeconv['decimal_point'] != '')
- ? $localeconv['decimal_point'] : $localeconv['mon_decimal_point'];
-
- if (self::$decimalSeparator == '') {
- // Default to .
- self::$decimalSeparator = '.';
- }
- }
- return self::$decimalSeparator;
- }
-
- /**
- * Set the decimal separator. Only used by PHPExcel_Style_NumberFormat::toFormattedString()
- * to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF
- *
- * @param string $pValue Character for decimal separator
- */
- public static function setDecimalSeparator($pValue = '.')
- {
- self::$decimalSeparator = $pValue;
- }
-
- /**
- * Get the thousands separator. If it has not yet been set explicitly, try to obtain number
- * formatting information from locale.
- *
- * @return string
- */
- public static function getThousandsSeparator()
- {
- if (!isset(self::$thousandsSeparator)) {
- $localeconv = localeconv();
- self::$thousandsSeparator = ($localeconv['thousands_sep'] != '')
- ? $localeconv['thousands_sep'] : $localeconv['mon_thousands_sep'];
-
- if (self::$thousandsSeparator == '') {
- // Default to .
- self::$thousandsSeparator = ',';
- }
- }
- return self::$thousandsSeparator;
- }
-
- /**
- * Set the thousands separator. Only used by PHPExcel_Style_NumberFormat::toFormattedString()
- * to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF
- *
- * @param string $pValue Character for thousands separator
- */
- public static function setThousandsSeparator($pValue = ',')
- {
- self::$thousandsSeparator = $pValue;
- }
-
- /**
- * Get the currency code. If it has not yet been set explicitly, try to obtain the
- * symbol information from locale.
- *
- * @return string
- */
- public static function getCurrencyCode()
- {
- if (!isset(self::$currencyCode)) {
- $localeconv = localeconv();
- self::$currencyCode = ($localeconv['currency_symbol'] != '')
- ? $localeconv['currency_symbol'] : $localeconv['int_curr_symbol'];
-
- if (self::$currencyCode == '') {
- // Default to $
- self::$currencyCode = '$';
- }
- }
- return self::$currencyCode;
- }
-
- /**
- * Set the currency code. Only used by PHPExcel_Style_NumberFormat::toFormattedString()
- * to format output by PHPExcel_Writer_HTML and PHPExcel_Writer_PDF
- *
- * @param string $pValue Character for currency code
- */
- public static function setCurrencyCode($pValue = '$')
- {
- self::$currencyCode = $pValue;
- }
-
- /**
- * Convert SYLK encoded string to UTF-8
- *
- * @param string $pValue
- * @return string UTF-8 encoded string
- */
- public static function SYLKtoUTF8($pValue = '')
- {
- // If there is no escape character in the string there is nothing to do
- if (strpos($pValue, '') === false) {
- return $pValue;
- }
-
- foreach (self::$SYLKCharacters as $k => $v) {
- $pValue = str_replace($k, $v, $pValue);
- }
-
- return $pValue;
- }
-
- /**
- * Retrieve any leading numeric part of a string, or return the full string if no leading numeric
- * (handles basic integer or float, but not exponent or non decimal)
- *
- * @param string $value
- * @return mixed string or only the leading numeric part of the string
- */
- public static function testStringAsNumeric($value)
- {
- if (is_numeric($value)) {
- return $value;
- }
- $v = floatval($value);
- return (is_numeric(substr($value, 0, strlen($v)))) ? $v : $value;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/TimeZone.php b/lib/phpexcel/PHPExcel/Shared/TimeZone.php
deleted file mode 100644
index 73373e04263..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/TimeZone.php
+++ /dev/null
@@ -1,144 +0,0 @@
-getTransitions();
- $transitions = array();
- foreach ($allTransitions as $key => $transition) {
- if ($transition['ts'] > $timestamp) {
- $transitions[] = ($key > 0) ? $allTransitions[$key - 1] : $transition;
- break;
- }
- if (empty($transitions)) {
- $transitions[] = end($allTransitions);
- }
- }
-
- return $transitions;
- }
-
- /**
- * Return the Timezone offset used for date/time conversions to/from UST
- * This requires both the timezone and the calculated date/time to allow for local DST
- *
- * @param string $timezone The timezone for finding the adjustment to UST
- * @param integer $timestamp PHP date/time value
- * @return integer Number of seconds for timezone adjustment
- * @throws PHPExcel_Exception
- */
- public static function getTimeZoneAdjustment($timezone, $timestamp)
- {
- if ($timezone !== null) {
- if (!self::_validateTimezone($timezone)) {
- throw new PHPExcel_Exception("Invalid timezone " . $timezone);
- }
- } else {
- $timezone = self::$timezone;
- }
-
- if ($timezone == 'UST') {
- return 0;
- }
-
- $objTimezone = new DateTimeZone($timezone);
- if (version_compare(PHP_VERSION, '5.3.0') >= 0) {
- $transitions = $objTimezone->getTransitions($timestamp, $timestamp);
- } else {
- $transitions = self::getTimezoneTransitions($objTimezone, $timestamp);
- }
-
- return (count($transitions) > 0) ? $transitions[0]['offset'] : 0;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/XMLWriter.php b/lib/phpexcel/PHPExcel/Shared/XMLWriter.php
deleted file mode 100644
index 1dc119b50a0..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/XMLWriter.php
+++ /dev/null
@@ -1,124 +0,0 @@
-openMemory();
- } else {
- // Create temporary filename
- if ($pTemporaryStorageFolder === null) {
- $pTemporaryStorageFolder = PHPExcel_Shared_File::sys_get_temp_dir();
- }
- $this->tempFileName = @tempnam($pTemporaryStorageFolder, 'xml');
-
- // Open storage
- if ($this->openUri($this->tempFileName) === false) {
- // Fallback to memory...
- $this->openMemory();
- }
- }
-
- // Set default values
- if (DEBUGMODE_ENABLED) {
- $this->setIndent(true);
- }
- }
-
- /**
- * Destructor
- */
- public function __destruct()
- {
- // Unlink temporary files
- if ($this->tempFileName != '') {
- @unlink($this->tempFileName);
- }
- }
-
- /**
- * Get written data
- *
- * @return $data
- */
- public function getData()
- {
- if ($this->tempFileName == '') {
- return $this->outputMemory(true);
- } else {
- $this->flush();
- return file_get_contents($this->tempFileName);
- }
- }
-
- /**
- * Fallback method for writeRaw, introduced in PHP 5.2
- *
- * @param string $text
- * @return string
- */
- public function writeRawData($text)
- {
- if (is_array($text)) {
- $text = implode("\n", $text);
- }
-
- if (method_exists($this, 'writeRaw')) {
- return $this->writeRaw(htmlspecialchars($text));
- }
-
- return $this->text($text);
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/ZipArchive.php b/lib/phpexcel/PHPExcel/Shared/ZipArchive.php
deleted file mode 100644
index 806a2febd57..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/ZipArchive.php
+++ /dev/null
@@ -1,163 +0,0 @@
-tempDir = PHPExcel_Shared_File::sys_get_temp_dir();
- $this->zip = new PclZip($fileName);
-
- return true;
- }
-
-
- /**
- * Close this zip archive
- *
- */
- public function close()
- {
- }
-
-
- /**
- * Add a new file to the zip archive from a string of raw data.
- *
- * @param string $localname Directory/Name of the file to add to the zip archive
- * @param string $contents String of data to add to the zip archive
- */
- public function addFromString($localname, $contents)
- {
- $filenameParts = pathinfo($localname);
-
- $handle = fopen($this->tempDir.'/'.$filenameParts["basename"], "wb");
- fwrite($handle, $contents);
- fclose($handle);
-
- $res = $this->zip->add($this->tempDir.'/'.$filenameParts["basename"], PCLZIP_OPT_REMOVE_PATH, $this->tempDir, PCLZIP_OPT_ADD_PATH, $filenameParts["dirname"]);
- if ($res == 0) {
- throw new PHPExcel_Writer_Exception("Error zipping files : " . $this->zip->errorInfo(true));
- }
-
- unlink($this->tempDir.'/'.$filenameParts["basename"]);
- }
-
- /**
- * Find if given fileName exist in archive (Emulate ZipArchive locateName())
- *
- * @param string $fileName Filename for the file in zip archive
- * @return boolean
- */
- public function locateName($fileName)
- {
- $list = $this->zip->listContent();
- $listCount = count($list);
- $list_index = -1;
- for ($i = 0; $i < $listCount; ++$i) {
- if (strtolower($list[$i]["filename"]) == strtolower($fileName) ||
- strtolower($list[$i]["stored_filename"]) == strtolower($fileName)) {
- $list_index = $i;
- break;
- }
- }
- return ($list_index > -1);
- }
-
- /**
- * Extract file from archive by given fileName (Emulate ZipArchive getFromName())
- *
- * @param string $fileName Filename for the file in zip archive
- * @return string $contents File string contents
- */
- public function getFromName($fileName)
- {
- $list = $this->zip->listContent();
- $listCount = count($list);
- $list_index = -1;
- for ($i = 0; $i < $listCount; ++$i) {
- if (strtolower($list[$i]["filename"]) == strtolower($fileName) ||
- strtolower($list[$i]["stored_filename"]) == strtolower($fileName)) {
- $list_index = $i;
- break;
- }
- }
-
- $extracted = "";
- if ($list_index != -1) {
- $extracted = $this->zip->extractByIndex($list_index, PCLZIP_OPT_EXTRACT_AS_STRING);
- } else {
- $filename = substr($fileName, 1);
- $list_index = -1;
- for ($i = 0; $i < $listCount; ++$i) {
- if (strtolower($list[$i]["filename"]) == strtolower($fileName) ||
- strtolower($list[$i]["stored_filename"]) == strtolower($fileName)) {
- $list_index = $i;
- break;
- }
- }
- $extracted = $this->zip->extractByIndex($list_index, PCLZIP_OPT_EXTRACT_AS_STRING);
- }
- if ((is_array($extracted)) && ($extracted != 0)) {
- $contents = $extracted[0]["content"];
- }
-
- return $contents;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/ZipStreamWrapper.php b/lib/phpexcel/PHPExcel/Shared/ZipStreamWrapper.php
deleted file mode 100644
index 2e0324ce75b..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/ZipStreamWrapper.php
+++ /dev/null
@@ -1,200 +0,0 @@
-archive = new ZipArchive();
- $this->archive->open($url['host']);
-
- $this->fileNameInArchive = $url['fragment'];
- $this->position = 0;
- $this->data = $this->archive->getFromName($this->fileNameInArchive);
-
- return true;
- }
-
- /**
- * Implements support for fstat().
- *
- * @return boolean
- */
- public function statName()
- {
- return $this->fileNameInArchive;
- }
-
- /**
- * Implements support for fstat().
- *
- * @return boolean
- */
- public function url_stat()
- {
- return $this->statName($this->fileNameInArchive);
- }
-
- /**
- * Implements support for fstat().
- *
- * @return boolean
- */
- public function stream_stat()
- {
- return $this->archive->statName($this->fileNameInArchive);
- }
-
- /**
- * Implements support for fread(), fgets() etc.
- *
- * @param int $count maximum number of bytes to read
- * @return string
- */
- public function stream_read($count)
- {
- $ret = substr($this->data, $this->position, $count);
- $this->position += strlen($ret);
- return $ret;
- }
-
- /**
- * Returns the position of the file pointer, i.e. its offset into the file
- * stream. Implements support for ftell().
- *
- * @return int
- */
- public function stream_tell()
- {
- return $this->position;
- }
-
- /**
- * EOF stream
- *
- * @return bool
- */
- public function stream_eof()
- {
- return $this->position >= strlen($this->data);
- }
-
- /**
- * Seek stream
- *
- * @param int $offset byte offset
- * @param int $whence SEEK_SET, SEEK_CUR or SEEK_END
- * @return bool
- */
- public function stream_seek($offset, $whence)
- {
- switch ($whence) {
- case SEEK_SET:
- if ($offset < strlen($this->data) && $offset >= 0) {
- $this->position = $offset;
- return true;
- } else {
- return false;
- }
- break;
- case SEEK_CUR:
- if ($offset >= 0) {
- $this->position += $offset;
- return true;
- } else {
- return false;
- }
- break;
- case SEEK_END:
- if (strlen($this->data) + $offset >= 0) {
- $this->position = strlen($this->data) + $offset;
- return true;
- } else {
- return false;
- }
- break;
- default:
- return false;
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/trend/exponentialBestFitClass.php b/lib/phpexcel/PHPExcel/Shared/trend/exponentialBestFitClass.php
deleted file mode 100644
index 44487352562..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/trend/exponentialBestFitClass.php
+++ /dev/null
@@ -1,138 +0,0 @@
-getIntersect() * pow($this->getSlope(), ($xValue - $this->xOffset));
- }
-
- /**
- * Return the X-Value for a specified value of Y
- *
- * @param float $yValue Y-Value
- * @return float X-Value
- **/
- public function getValueOfXForY($yValue)
- {
- return log(($yValue + $this->yOffset) / $this->getIntersect()) / log($this->getSlope());
- }
-
- /**
- * Return the Equation of the best-fit line
- *
- * @param int $dp Number of places of decimal precision to display
- * @return string
- **/
- public function getEquation($dp = 0)
- {
- $slope = $this->getSlope($dp);
- $intersect = $this->getIntersect($dp);
-
- return 'Y = ' . $intersect . ' * ' . $slope . '^X';
- }
-
- /**
- * Return the Slope of the line
- *
- * @param int $dp Number of places of decimal precision to display
- * @return string
- **/
- public function getSlope($dp = 0)
- {
- if ($dp != 0) {
- return round(exp($this->_slope), $dp);
- }
- return exp($this->_slope);
- }
-
- /**
- * Return the Value of X where it intersects Y = 0
- *
- * @param int $dp Number of places of decimal precision to display
- * @return string
- **/
- public function getIntersect($dp = 0)
- {
- if ($dp != 0) {
- return round(exp($this->intersect), $dp);
- }
- return exp($this->intersect);
- }
-
- /**
- * Execute the regression and calculate the goodness of fit for a set of X and Y data values
- *
- * @param float[] $yValues The set of Y-values for this regression
- * @param float[] $xValues The set of X-values for this regression
- * @param boolean $const
- */
- private function exponentialRegression($yValues, $xValues, $const)
- {
- foreach ($yValues as &$value) {
- if ($value < 0.0) {
- $value = 0 - log(abs($value));
- } elseif ($value > 0.0) {
- $value = log($value);
- }
- }
- unset($value);
-
- $this->leastSquareFit($yValues, $xValues, $const);
- }
-
- /**
- * Define the regression and calculate the goodness of fit for a set of X and Y data values
- *
- * @param float[] $yValues The set of Y-values for this regression
- * @param float[] $xValues The set of X-values for this regression
- * @param boolean $const
- */
- public function __construct($yValues, $xValues = array(), $const = true)
- {
- if (parent::__construct($yValues, $xValues) !== false) {
- $this->exponentialRegression($yValues, $xValues, $const);
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/trend/linearBestFitClass.php b/lib/phpexcel/PHPExcel/Shared/trend/linearBestFitClass.php
deleted file mode 100644
index 76b55b3e7a1..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/trend/linearBestFitClass.php
+++ /dev/null
@@ -1,102 +0,0 @@
-getIntersect() + $this->getSlope() * $xValue;
- }
-
- /**
- * Return the X-Value for a specified value of Y
- *
- * @param float $yValue Y-Value
- * @return float X-Value
- **/
- public function getValueOfXForY($yValue)
- {
- return ($yValue - $this->getIntersect()) / $this->getSlope();
- }
-
-
- /**
- * Return the Equation of the best-fit line
- *
- * @param int $dp Number of places of decimal precision to display
- * @return string
- **/
- public function getEquation($dp = 0)
- {
- $slope = $this->getSlope($dp);
- $intersect = $this->getIntersect($dp);
-
- return 'Y = ' . $intersect . ' + ' . $slope . ' * X';
- }
-
- /**
- * Execute the regression and calculate the goodness of fit for a set of X and Y data values
- *
- * @param float[] $yValues The set of Y-values for this regression
- * @param float[] $xValues The set of X-values for this regression
- * @param boolean $const
- */
- private function linearRegression($yValues, $xValues, $const)
- {
- $this->leastSquareFit($yValues, $xValues, $const);
- }
-
- /**
- * Define the regression and calculate the goodness of fit for a set of X and Y data values
- *
- * @param float[] $yValues The set of Y-values for this regression
- * @param float[] $xValues The set of X-values for this regression
- * @param boolean $const
- */
- public function __construct($yValues, $xValues = array(), $const = true)
- {
- if (parent::__construct($yValues, $xValues) !== false) {
- $this->linearRegression($yValues, $xValues, $const);
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/trend/logarithmicBestFitClass.php b/lib/phpexcel/PHPExcel/Shared/trend/logarithmicBestFitClass.php
deleted file mode 100644
index 221c5386932..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/trend/logarithmicBestFitClass.php
+++ /dev/null
@@ -1,110 +0,0 @@
-getIntersect() + $this->getSlope() * log($xValue - $this->xOffset);
- }
-
- /**
- * Return the X-Value for a specified value of Y
- *
- * @param float $yValue Y-Value
- * @return float X-Value
- **/
- public function getValueOfXForY($yValue)
- {
- return exp(($yValue - $this->getIntersect()) / $this->getSlope());
- }
-
- /**
- * Return the Equation of the best-fit line
- *
- * @param int $dp Number of places of decimal precision to display
- * @return string
- **/
- public function getEquation($dp = 0)
- {
- $slope = $this->getSlope($dp);
- $intersect = $this->getIntersect($dp);
-
- return 'Y = '.$intersect.' + '.$slope.' * log(X)';
- }
-
- /**
- * Execute the regression and calculate the goodness of fit for a set of X and Y data values
- *
- * @param float[] $yValues The set of Y-values for this regression
- * @param float[] $xValues The set of X-values for this regression
- * @param boolean $const
- */
- private function logarithmicRegression($yValues, $xValues, $const)
- {
- foreach ($xValues as &$value) {
- if ($value < 0.0) {
- $value = 0 - log(abs($value));
- } elseif ($value > 0.0) {
- $value = log($value);
- }
- }
- unset($value);
-
- $this->leastSquareFit($yValues, $xValues, $const);
- }
-
- /**
- * Define the regression and calculate the goodness of fit for a set of X and Y data values
- *
- * @param float[] $yValues The set of Y-values for this regression
- * @param float[] $xValues The set of X-values for this regression
- * @param boolean $const
- */
- public function __construct($yValues, $xValues = array(), $const = true)
- {
- if (parent::__construct($yValues, $xValues) !== false) {
- $this->logarithmicRegression($yValues, $xValues, $const);
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/trend/polynomialBestFitClass.php b/lib/phpexcel/PHPExcel/Shared/trend/polynomialBestFitClass.php
deleted file mode 100644
index 8a882b743ae..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/trend/polynomialBestFitClass.php
+++ /dev/null
@@ -1,222 +0,0 @@
-order;
- }
-
-
- /**
- * Return the Y-Value for a specified value of X
- *
- * @param float $xValue X-Value
- * @return float Y-Value
- **/
- public function getValueOfYForX($xValue)
- {
- $retVal = $this->getIntersect();
- $slope = $this->getSlope();
- foreach ($slope as $key => $value) {
- if ($value != 0.0) {
- $retVal += $value * pow($xValue, $key + 1);
- }
- }
- return $retVal;
- }
-
-
- /**
- * Return the X-Value for a specified value of Y
- *
- * @param float $yValue Y-Value
- * @return float X-Value
- **/
- public function getValueOfXForY($yValue)
- {
- return ($yValue - $this->getIntersect()) / $this->getSlope();
- }
-
-
- /**
- * Return the Equation of the best-fit line
- *
- * @param int $dp Number of places of decimal precision to display
- * @return string
- **/
- public function getEquation($dp = 0)
- {
- $slope = $this->getSlope($dp);
- $intersect = $this->getIntersect($dp);
-
- $equation = 'Y = ' . $intersect;
- foreach ($slope as $key => $value) {
- if ($value != 0.0) {
- $equation .= ' + ' . $value . ' * X';
- if ($key > 0) {
- $equation .= '^' . ($key + 1);
- }
- }
- }
- return $equation;
- }
-
-
- /**
- * Return the Slope of the line
- *
- * @param int $dp Number of places of decimal precision to display
- * @return string
- **/
- public function getSlope($dp = 0)
- {
- if ($dp != 0) {
- $coefficients = array();
- foreach ($this->_slope as $coefficient) {
- $coefficients[] = round($coefficient, $dp);
- }
- return $coefficients;
- }
- return $this->_slope;
- }
-
-
- public function getCoefficients($dp = 0)
- {
- return array_merge(array($this->getIntersect($dp)), $this->getSlope($dp));
- }
-
-
- /**
- * Execute the regression and calculate the goodness of fit for a set of X and Y data values
- *
- * @param int $order Order of Polynomial for this regression
- * @param float[] $yValues The set of Y-values for this regression
- * @param float[] $xValues The set of X-values for this regression
- * @param boolean $const
- */
- private function polynomialRegression($order, $yValues, $xValues, $const)
- {
- // calculate sums
- $x_sum = array_sum($xValues);
- $y_sum = array_sum($yValues);
- $xx_sum = $xy_sum = 0;
- for ($i = 0; $i < $this->valueCount; ++$i) {
- $xy_sum += $xValues[$i] * $yValues[$i];
- $xx_sum += $xValues[$i] * $xValues[$i];
- $yy_sum += $yValues[$i] * $yValues[$i];
- }
- /*
- * This routine uses logic from the PHP port of polyfit version 0.1
- * written by Michael Bommarito and Paul Meagher
- *
- * The function fits a polynomial function of order $order through
- * a series of x-y data points using least squares.
- *
- */
- for ($i = 0; $i < $this->valueCount; ++$i) {
- for ($j = 0; $j <= $order; ++$j) {
- $A[$i][$j] = pow($xValues[$i], $j);
- }
- }
- for ($i=0; $i < $this->valueCount; ++$i) {
- $B[$i] = array($yValues[$i]);
- }
- $matrixA = new Matrix($A);
- $matrixB = new Matrix($B);
- $C = $matrixA->solve($matrixB);
-
- $coefficients = array();
- for ($i = 0; $i < $C->m; ++$i) {
- $r = $C->get($i, 0);
- if (abs($r) <= pow(10, -9)) {
- $r = 0;
- }
- $coefficients[] = $r;
- }
-
- $this->intersect = array_shift($coefficients);
- $this->_slope = $coefficients;
-
- $this->calculateGoodnessOfFit($x_sum, $y_sum, $xx_sum, $yy_sum, $xy_sum);
- foreach ($this->xValues as $xKey => $xValue) {
- $this->yBestFitValues[$xKey] = $this->getValueOfYForX($xValue);
- }
- }
-
-
- /**
- * Define the regression and calculate the goodness of fit for a set of X and Y data values
- *
- * @param int $order Order of Polynomial for this regression
- * @param float[] $yValues The set of Y-values for this regression
- * @param float[] $xValues The set of X-values for this regression
- * @param boolean $const
- */
- public function __construct($order, $yValues, $xValues = array(), $const = true)
- {
- if (parent::__construct($yValues, $xValues) !== false) {
- if ($order < $this->valueCount) {
- $this->bestFitType .= '_'.$order;
- $this->order = $order;
- $this->polynomialRegression($order, $yValues, $xValues, $const);
- if (($this->getGoodnessOfFit() < 0.0) || ($this->getGoodnessOfFit() > 1.0)) {
- $this->_error = true;
- }
- } else {
- $this->_error = true;
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/trend/powerBestFitClass.php b/lib/phpexcel/PHPExcel/Shared/trend/powerBestFitClass.php
deleted file mode 100644
index 77c473429b4..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/trend/powerBestFitClass.php
+++ /dev/null
@@ -1,138 +0,0 @@
-getIntersect() * pow(($xValue - $this->xOffset), $this->getSlope());
- }
-
-
- /**
- * Return the X-Value for a specified value of Y
- *
- * @param float $yValue Y-Value
- * @return float X-Value
- **/
- public function getValueOfXForY($yValue)
- {
- return pow((($yValue + $this->yOffset) / $this->getIntersect()), (1 / $this->getSlope()));
- }
-
-
- /**
- * Return the Equation of the best-fit line
- *
- * @param int $dp Number of places of decimal precision to display
- * @return string
- **/
- public function getEquation($dp = 0)
- {
- $slope = $this->getSlope($dp);
- $intersect = $this->getIntersect($dp);
-
- return 'Y = ' . $intersect . ' * X^' . $slope;
- }
-
-
- /**
- * Return the Value of X where it intersects Y = 0
- *
- * @param int $dp Number of places of decimal precision to display
- * @return string
- **/
- public function getIntersect($dp = 0)
- {
- if ($dp != 0) {
- return round(exp($this->intersect), $dp);
- }
- return exp($this->intersect);
- }
-
-
- /**
- * Execute the regression and calculate the goodness of fit for a set of X and Y data values
- *
- * @param float[] $yValues The set of Y-values for this regression
- * @param float[] $xValues The set of X-values for this regression
- * @param boolean $const
- */
- private function powerRegression($yValues, $xValues, $const)
- {
- foreach ($xValues as &$value) {
- if ($value < 0.0) {
- $value = 0 - log(abs($value));
- } elseif ($value > 0.0) {
- $value = log($value);
- }
- }
- unset($value);
- foreach ($yValues as &$value) {
- if ($value < 0.0) {
- $value = 0 - log(abs($value));
- } elseif ($value > 0.0) {
- $value = log($value);
- }
- }
- unset($value);
-
- $this->leastSquareFit($yValues, $xValues, $const);
- }
-
-
- /**
- * Define the regression and calculate the goodness of fit for a set of X and Y data values
- *
- * @param float[] $yValues The set of Y-values for this regression
- * @param float[] $xValues The set of X-values for this regression
- * @param boolean $const
- */
- public function __construct($yValues, $xValues = array(), $const = true)
- {
- if (parent::__construct($yValues, $xValues) !== false) {
- $this->powerRegression($yValues, $xValues, $const);
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Shared/trend/trendClass.php b/lib/phpexcel/PHPExcel/Shared/trend/trendClass.php
deleted file mode 100644
index 715cd4124fe..00000000000
--- a/lib/phpexcel/PHPExcel/Shared/trend/trendClass.php
+++ /dev/null
@@ -1,147 +0,0 @@
-getGoodnessOfFit();
- }
- if ($trendType != self::TREND_BEST_FIT_NO_POLY) {
- foreach (self::$trendTypePolynomialOrders as $trendMethod) {
- $order = substr($trendMethod, -1);
- $bestFit[$trendMethod] = new PHPExcel_Polynomial_Best_Fit($order, $yValues, $xValues, $const);
- if ($bestFit[$trendMethod]->getError()) {
- unset($bestFit[$trendMethod]);
- } else {
- $bestFitValue[$trendMethod] = $bestFit[$trendMethod]->getGoodnessOfFit();
- }
- }
- }
- // Determine which of our trend lines is the best fit, and then we return the instance of that trend class
- arsort($bestFitValue);
- $bestFitType = key($bestFitValue);
- return $bestFit[$bestFitType];
- default:
- return false;
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Style.php b/lib/phpexcel/PHPExcel/Style.php
deleted file mode 100644
index 6b952ef94d4..00000000000
--- a/lib/phpexcel/PHPExcel/Style.php
+++ /dev/null
@@ -1,644 +0,0 @@
-isSupervisor = $isSupervisor;
-
- // Initialise values
- $this->conditionalStyles = array();
- $this->font = new PHPExcel_Style_Font($isSupervisor, $isConditional);
- $this->fill = new PHPExcel_Style_Fill($isSupervisor, $isConditional);
- $this->borders = new PHPExcel_Style_Borders($isSupervisor, $isConditional);
- $this->alignment = new PHPExcel_Style_Alignment($isSupervisor, $isConditional);
- $this->numberFormat = new PHPExcel_Style_NumberFormat($isSupervisor, $isConditional);
- $this->protection = new PHPExcel_Style_Protection($isSupervisor, $isConditional);
-
- // bind parent if we are a supervisor
- if ($isSupervisor) {
- $this->font->bindParent($this);
- $this->fill->bindParent($this);
- $this->borders->bindParent($this);
- $this->alignment->bindParent($this);
- $this->numberFormat->bindParent($this);
- $this->protection->bindParent($this);
- }
- }
-
- /**
- * Get the shared style component for the currently active cell in currently active sheet.
- * Only used for style supervisor
- *
- * @return PHPExcel_Style
- */
- public function getSharedComponent()
- {
- $activeSheet = $this->getActiveSheet();
- $selectedCell = $this->getActiveCell(); // e.g. 'A1'
-
- if ($activeSheet->cellExists($selectedCell)) {
- $xfIndex = $activeSheet->getCell($selectedCell)->getXfIndex();
- } else {
- $xfIndex = 0;
- }
-
- return $this->parent->getCellXfByIndex($xfIndex);
- }
-
- /**
- * Get parent. Only used for style supervisor
- *
- * @return PHPExcel
- */
- public function getParent()
- {
- return $this->parent;
- }
-
- /**
- * Build style array from subcomponents
- *
- * @param array $array
- * @return array
- */
- public function getStyleArray($array)
- {
- return array('quotePrefix' => $array);
- }
-
- /**
- * Apply styles from array
- *
- *
- * $objPHPExcel->getActiveSheet()->getStyle('B2')->applyFromArray(
- * array(
- * 'font' => array(
- * 'name' => 'Arial',
- * 'bold' => true,
- * 'italic' => false,
- * 'underline' => PHPExcel_Style_Font::UNDERLINE_DOUBLE,
- * 'strike' => false,
- * 'color' => array(
- * 'rgb' => '808080'
- * )
- * ),
- * 'borders' => array(
- * 'bottom' => array(
- * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
- * 'color' => array(
- * 'rgb' => '808080'
- * )
- * ),
- * 'top' => array(
- * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
- * 'color' => array(
- * 'rgb' => '808080'
- * )
- * )
- * ),
- * 'quotePrefix' => true
- * )
- * );
- *
- *
- * @param array $pStyles Array containing style information
- * @param boolean $pAdvanced Advanced mode for setting borders.
- * @throws PHPExcel_Exception
- * @return PHPExcel_Style
- */
- public function applyFromArray($pStyles = null, $pAdvanced = true)
- {
- if (is_array($pStyles)) {
- if ($this->isSupervisor) {
- $pRange = $this->getSelectedCells();
-
- // Uppercase coordinate
- $pRange = strtoupper($pRange);
-
- // Is it a cell range or a single cell?
- if (strpos($pRange, ':') === false) {
- $rangeA = $pRange;
- $rangeB = $pRange;
- } else {
- list($rangeA, $rangeB) = explode(':', $pRange);
- }
-
- // Calculate range outer borders
- $rangeStart = PHPExcel_Cell::coordinateFromString($rangeA);
- $rangeEnd = PHPExcel_Cell::coordinateFromString($rangeB);
-
- // Translate column into index
- $rangeStart[0] = PHPExcel_Cell::columnIndexFromString($rangeStart[0]) - 1;
- $rangeEnd[0] = PHPExcel_Cell::columnIndexFromString($rangeEnd[0]) - 1;
-
- // Make sure we can loop upwards on rows and columns
- if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
- $tmp = $rangeStart;
- $rangeStart = $rangeEnd;
- $rangeEnd = $tmp;
- }
-
- // ADVANCED MODE:
- if ($pAdvanced && isset($pStyles['borders'])) {
- // 'allborders' is a shorthand property for 'outline' and 'inside' and
- // it applies to components that have not been set explicitly
- if (isset($pStyles['borders']['allborders'])) {
- foreach (array('outline', 'inside') as $component) {
- if (!isset($pStyles['borders'][$component])) {
- $pStyles['borders'][$component] = $pStyles['borders']['allborders'];
- }
- }
- unset($pStyles['borders']['allborders']); // not needed any more
- }
- // 'outline' is a shorthand property for 'top', 'right', 'bottom', 'left'
- // it applies to components that have not been set explicitly
- if (isset($pStyles['borders']['outline'])) {
- foreach (array('top', 'right', 'bottom', 'left') as $component) {
- if (!isset($pStyles['borders'][$component])) {
- $pStyles['borders'][$component] = $pStyles['borders']['outline'];
- }
- }
- unset($pStyles['borders']['outline']); // not needed any more
- }
- // 'inside' is a shorthand property for 'vertical' and 'horizontal'
- // it applies to components that have not been set explicitly
- if (isset($pStyles['borders']['inside'])) {
- foreach (array('vertical', 'horizontal') as $component) {
- if (!isset($pStyles['borders'][$component])) {
- $pStyles['borders'][$component] = $pStyles['borders']['inside'];
- }
- }
- unset($pStyles['borders']['inside']); // not needed any more
- }
- // width and height characteristics of selection, 1, 2, or 3 (for 3 or more)
- $xMax = min($rangeEnd[0] - $rangeStart[0] + 1, 3);
- $yMax = min($rangeEnd[1] - $rangeStart[1] + 1, 3);
-
- // loop through up to 3 x 3 = 9 regions
- for ($x = 1; $x <= $xMax; ++$x) {
- // start column index for region
- $colStart = ($x == 3) ?
- PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0])
- : PHPExcel_Cell::stringFromColumnIndex($rangeStart[0] + $x - 1);
- // end column index for region
- $colEnd = ($x == 1) ?
- PHPExcel_Cell::stringFromColumnIndex($rangeStart[0])
- : PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0] - $xMax + $x);
-
- for ($y = 1; $y <= $yMax; ++$y) {
- // which edges are touching the region
- $edges = array();
- if ($x == 1) {
- // are we at left edge
- $edges[] = 'left';
- }
- if ($x == $xMax) {
- // are we at right edge
- $edges[] = 'right';
- }
- if ($y == 1) {
- // are we at top edge?
- $edges[] = 'top';
- }
- if ($y == $yMax) {
- // are we at bottom edge?
- $edges[] = 'bottom';
- }
-
- // start row index for region
- $rowStart = ($y == 3) ?
- $rangeEnd[1] : $rangeStart[1] + $y - 1;
-
- // end row index for region
- $rowEnd = ($y == 1) ?
- $rangeStart[1] : $rangeEnd[1] - $yMax + $y;
-
- // build range for region
- $range = $colStart . $rowStart . ':' . $colEnd . $rowEnd;
-
- // retrieve relevant style array for region
- $regionStyles = $pStyles;
- unset($regionStyles['borders']['inside']);
-
- // what are the inner edges of the region when looking at the selection
- $innerEdges = array_diff(array('top', 'right', 'bottom', 'left'), $edges);
-
- // inner edges that are not touching the region should take the 'inside' border properties if they have been set
- foreach ($innerEdges as $innerEdge) {
- switch ($innerEdge) {
- case 'top':
- case 'bottom':
- // should pick up 'horizontal' border property if set
- if (isset($pStyles['borders']['horizontal'])) {
- $regionStyles['borders'][$innerEdge] = $pStyles['borders']['horizontal'];
- } else {
- unset($regionStyles['borders'][$innerEdge]);
- }
- break;
- case 'left':
- case 'right':
- // should pick up 'vertical' border property if set
- if (isset($pStyles['borders']['vertical'])) {
- $regionStyles['borders'][$innerEdge] = $pStyles['borders']['vertical'];
- } else {
- unset($regionStyles['borders'][$innerEdge]);
- }
- break;
- }
- }
-
- // apply region style to region by calling applyFromArray() in simple mode
- $this->getActiveSheet()->getStyle($range)->applyFromArray($regionStyles, false);
- }
- }
- return $this;
- }
-
- // SIMPLE MODE:
- // Selection type, inspect
- if (preg_match('/^[A-Z]+1:[A-Z]+1048576$/', $pRange)) {
- $selectionType = 'COLUMN';
- } elseif (preg_match('/^A[0-9]+:XFD[0-9]+$/', $pRange)) {
- $selectionType = 'ROW';
- } else {
- $selectionType = 'CELL';
- }
-
- // First loop through columns, rows, or cells to find out which styles are affected by this operation
- switch ($selectionType) {
- case 'COLUMN':
- $oldXfIndexes = array();
- for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
- $oldXfIndexes[$this->getActiveSheet()->getColumnDimensionByColumn($col)->getXfIndex()] = true;
- }
- break;
- case 'ROW':
- $oldXfIndexes = array();
- for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
- if ($this->getActiveSheet()->getRowDimension($row)->getXfIndex() == null) {
- $oldXfIndexes[0] = true; // row without explicit style should be formatted based on default style
- } else {
- $oldXfIndexes[$this->getActiveSheet()->getRowDimension($row)->getXfIndex()] = true;
- }
- }
- break;
- case 'CELL':
- $oldXfIndexes = array();
- for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
- for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
- $oldXfIndexes[$this->getActiveSheet()->getCellByColumnAndRow($col, $row)->getXfIndex()] = true;
- }
- }
- break;
- }
-
- // clone each of the affected styles, apply the style array, and add the new styles to the workbook
- $workbook = $this->getActiveSheet()->getParent();
- foreach ($oldXfIndexes as $oldXfIndex => $dummy) {
- $style = $workbook->getCellXfByIndex($oldXfIndex);
- $newStyle = clone $style;
- $newStyle->applyFromArray($pStyles);
-
- if ($existingStyle = $workbook->getCellXfByHashCode($newStyle->getHashCode())) {
- // there is already such cell Xf in our collection
- $newXfIndexes[$oldXfIndex] = $existingStyle->getIndex();
- } else {
- // we don't have such a cell Xf, need to add
- $workbook->addCellXf($newStyle);
- $newXfIndexes[$oldXfIndex] = $newStyle->getIndex();
- }
- }
-
- // Loop through columns, rows, or cells again and update the XF index
- switch ($selectionType) {
- case 'COLUMN':
- for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
- $columnDimension = $this->getActiveSheet()->getColumnDimensionByColumn($col);
- $oldXfIndex = $columnDimension->getXfIndex();
- $columnDimension->setXfIndex($newXfIndexes[$oldXfIndex]);
- }
- break;
-
- case 'ROW':
- for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
- $rowDimension = $this->getActiveSheet()->getRowDimension($row);
- $oldXfIndex = $rowDimension->getXfIndex() === null ?
- 0 : $rowDimension->getXfIndex(); // row without explicit style should be formatted based on default style
- $rowDimension->setXfIndex($newXfIndexes[$oldXfIndex]);
- }
- break;
-
- case 'CELL':
- for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
- for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
- $cell = $this->getActiveSheet()->getCellByColumnAndRow($col, $row);
- $oldXfIndex = $cell->getXfIndex();
- $cell->setXfIndex($newXfIndexes[$oldXfIndex]);
- }
- }
- break;
- }
-
- } else {
- // not a supervisor, just apply the style array directly on style object
- if (array_key_exists('fill', $pStyles)) {
- $this->getFill()->applyFromArray($pStyles['fill']);
- }
- if (array_key_exists('font', $pStyles)) {
- $this->getFont()->applyFromArray($pStyles['font']);
- }
- if (array_key_exists('borders', $pStyles)) {
- $this->getBorders()->applyFromArray($pStyles['borders']);
- }
- if (array_key_exists('alignment', $pStyles)) {
- $this->getAlignment()->applyFromArray($pStyles['alignment']);
- }
- if (array_key_exists('numberformat', $pStyles)) {
- $this->getNumberFormat()->applyFromArray($pStyles['numberformat']);
- }
- if (array_key_exists('protection', $pStyles)) {
- $this->getProtection()->applyFromArray($pStyles['protection']);
- }
- if (array_key_exists('quotePrefix', $pStyles)) {
- $this->quotePrefix = $pStyles['quotePrefix'];
- }
- }
- } else {
- throw new PHPExcel_Exception("Invalid style array passed.");
- }
- return $this;
- }
-
- /**
- * Get Fill
- *
- * @return PHPExcel_Style_Fill
- */
- public function getFill()
- {
- return $this->fill;
- }
-
- /**
- * Get Font
- *
- * @return PHPExcel_Style_Font
- */
- public function getFont()
- {
- return $this->font;
- }
-
- /**
- * Set font
- *
- * @param PHPExcel_Style_Font $font
- * @return PHPExcel_Style
- */
- public function setFont(PHPExcel_Style_Font $font)
- {
- $this->font = $font;
- return $this;
- }
-
- /**
- * Get Borders
- *
- * @return PHPExcel_Style_Borders
- */
- public function getBorders()
- {
- return $this->borders;
- }
-
- /**
- * Get Alignment
- *
- * @return PHPExcel_Style_Alignment
- */
- public function getAlignment()
- {
- return $this->alignment;
- }
-
- /**
- * Get Number Format
- *
- * @return PHPExcel_Style_NumberFormat
- */
- public function getNumberFormat()
- {
- return $this->numberFormat;
- }
-
- /**
- * Get Conditional Styles. Only used on supervisor.
- *
- * @return PHPExcel_Style_Conditional[]
- */
- public function getConditionalStyles()
- {
- return $this->getActiveSheet()->getConditionalStyles($this->getActiveCell());
- }
-
- /**
- * Set Conditional Styles. Only used on supervisor.
- *
- * @param PHPExcel_Style_Conditional[] $pValue Array of condtional styles
- * @return PHPExcel_Style
- */
- public function setConditionalStyles($pValue = null)
- {
- if (is_array($pValue)) {
- $this->getActiveSheet()->setConditionalStyles($this->getSelectedCells(), $pValue);
- }
- return $this;
- }
-
- /**
- * Get Protection
- *
- * @return PHPExcel_Style_Protection
- */
- public function getProtection()
- {
- return $this->protection;
- }
-
- /**
- * Get quote prefix
- *
- * @return boolean
- */
- public function getQuotePrefix()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getQuotePrefix();
- }
- return $this->quotePrefix;
- }
-
- /**
- * Set quote prefix
- *
- * @param boolean $pValue
- */
- public function setQuotePrefix($pValue)
- {
- if ($pValue == '') {
- $pValue = false;
- }
- if ($this->isSupervisor) {
- $styleArray = array('quotePrefix' => $pValue);
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->quotePrefix = (boolean) $pValue;
- }
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- $hashConditionals = '';
- foreach ($this->conditionalStyles as $conditional) {
- $hashConditionals .= $conditional->getHashCode();
- }
-
- return md5(
- $this->fill->getHashCode() .
- $this->font->getHashCode() .
- $this->borders->getHashCode() .
- $this->alignment->getHashCode() .
- $this->numberFormat->getHashCode() .
- $hashConditionals .
- $this->protection->getHashCode() .
- ($this->quotePrefix ? 't' : 'f') .
- __CLASS__
- );
- }
-
- /**
- * Get own index in style collection
- *
- * @return int
- */
- public function getIndex()
- {
- return $this->index;
- }
-
- /**
- * Set own index in style collection
- *
- * @param int $pValue
- */
- public function setIndex($pValue)
- {
- $this->index = $pValue;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Style/Alignment.php b/lib/phpexcel/PHPExcel/Style/Alignment.php
deleted file mode 100644
index bfc4947714d..00000000000
--- a/lib/phpexcel/PHPExcel/Style/Alignment.php
+++ /dev/null
@@ -1,464 +0,0 @@
-horizontal = null;
- $this->vertical = null;
- $this->textRotation = null;
- }
- }
-
- /**
- * Get the shared style component for the currently active cell in currently active sheet.
- * Only used for style supervisor
- *
- * @return PHPExcel_Style_Alignment
- */
- public function getSharedComponent()
- {
- return $this->parent->getSharedComponent()->getAlignment();
- }
-
- /**
- * Build style array from subcomponents
- *
- * @param array $array
- * @return array
- */
- public function getStyleArray($array)
- {
- return array('alignment' => $array);
- }
-
- /**
- * Apply styles from array
- *
- *
- * $objPHPExcel->getActiveSheet()->getStyle('B2')->getAlignment()->applyFromArray(
- * array(
- * 'horizontal' => PHPExcel_Style_Alignment::HORIZONTAL_CENTER,
- * 'vertical' => PHPExcel_Style_Alignment::VERTICAL_CENTER,
- * 'rotation' => 0,
- * 'wrap' => TRUE
- * )
- * );
- *
- *
- * @param array $pStyles Array containing style information
- * @throws PHPExcel_Exception
- * @return PHPExcel_Style_Alignment
- */
- public function applyFromArray($pStyles = null)
- {
- if (is_array($pStyles)) {
- if ($this->isSupervisor) {
- $this->getActiveSheet()->getStyle($this->getSelectedCells())
- ->applyFromArray($this->getStyleArray($pStyles));
- } else {
- if (isset($pStyles['horizontal'])) {
- $this->setHorizontal($pStyles['horizontal']);
- }
- if (isset($pStyles['vertical'])) {
- $this->setVertical($pStyles['vertical']);
- }
- if (isset($pStyles['rotation'])) {
- $this->setTextRotation($pStyles['rotation']);
- }
- if (isset($pStyles['wrap'])) {
- $this->setWrapText($pStyles['wrap']);
- }
- if (isset($pStyles['shrinkToFit'])) {
- $this->setShrinkToFit($pStyles['shrinkToFit']);
- }
- if (isset($pStyles['indent'])) {
- $this->setIndent($pStyles['indent']);
- }
- if (isset($pStyles['readorder'])) {
- $this->setReadorder($pStyles['readorder']);
- }
- }
- } else {
- throw new PHPExcel_Exception("Invalid style array passed.");
- }
- return $this;
- }
-
- /**
- * Get Horizontal
- *
- * @return string
- */
- public function getHorizontal()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getHorizontal();
- }
- return $this->horizontal;
- }
-
- /**
- * Set Horizontal
- *
- * @param string $pValue
- * @return PHPExcel_Style_Alignment
- */
- public function setHorizontal($pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL)
- {
- if ($pValue == '') {
- $pValue = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL;
- }
-
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('horizontal' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->horizontal = $pValue;
- }
- return $this;
- }
-
- /**
- * Get Vertical
- *
- * @return string
- */
- public function getVertical()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getVertical();
- }
- return $this->vertical;
- }
-
- /**
- * Set Vertical
- *
- * @param string $pValue
- * @return PHPExcel_Style_Alignment
- */
- public function setVertical($pValue = PHPExcel_Style_Alignment::VERTICAL_BOTTOM)
- {
- if ($pValue == '') {
- $pValue = PHPExcel_Style_Alignment::VERTICAL_BOTTOM;
- }
-
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('vertical' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->vertical = $pValue;
- }
- return $this;
- }
-
- /**
- * Get TextRotation
- *
- * @return int
- */
- public function getTextRotation()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getTextRotation();
- }
- return $this->textRotation;
- }
-
- /**
- * Set TextRotation
- *
- * @param int $pValue
- * @throws PHPExcel_Exception
- * @return PHPExcel_Style_Alignment
- */
- public function setTextRotation($pValue = 0)
- {
- // Excel2007 value 255 => PHPExcel value -165
- if ($pValue == 255) {
- $pValue = -165;
- }
-
- // Set rotation
- if (($pValue >= -90 && $pValue <= 90) || $pValue == -165) {
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('rotation' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->textRotation = $pValue;
- }
- } else {
- throw new PHPExcel_Exception("Text rotation should be a value between -90 and 90.");
- }
-
- return $this;
- }
-
- /**
- * Get Wrap Text
- *
- * @return boolean
- */
- public function getWrapText()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getWrapText();
- }
- return $this->wrapText;
- }
-
- /**
- * Set Wrap Text
- *
- * @param boolean $pValue
- * @return PHPExcel_Style_Alignment
- */
- public function setWrapText($pValue = false)
- {
- if ($pValue == '') {
- $pValue = false;
- }
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('wrap' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->wrapText = $pValue;
- }
- return $this;
- }
-
- /**
- * Get Shrink to fit
- *
- * @return boolean
- */
- public function getShrinkToFit()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getShrinkToFit();
- }
- return $this->shrinkToFit;
- }
-
- /**
- * Set Shrink to fit
- *
- * @param boolean $pValue
- * @return PHPExcel_Style_Alignment
- */
- public function setShrinkToFit($pValue = false)
- {
- if ($pValue == '') {
- $pValue = false;
- }
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('shrinkToFit' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->shrinkToFit = $pValue;
- }
- return $this;
- }
-
- /**
- * Get indent
- *
- * @return int
- */
- public function getIndent()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getIndent();
- }
- return $this->indent;
- }
-
- /**
- * Set indent
- *
- * @param int $pValue
- * @return PHPExcel_Style_Alignment
- */
- public function setIndent($pValue = 0)
- {
- if ($pValue > 0) {
- if ($this->getHorizontal() != self::HORIZONTAL_GENERAL &&
- $this->getHorizontal() != self::HORIZONTAL_LEFT &&
- $this->getHorizontal() != self::HORIZONTAL_RIGHT) {
- $pValue = 0; // indent not supported
- }
- }
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('indent' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->indent = $pValue;
- }
- return $this;
- }
-
- /**
- * Get read order
- *
- * @return integer
- */
- public function getReadorder()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getReadorder();
- }
- return $this->readorder;
- }
-
- /**
- * Set read order
- *
- * @param int $pValue
- * @return PHPExcel_Style_Alignment
- */
- public function setReadorder($pValue = 0)
- {
- if ($pValue < 0 || $pValue > 2) {
- $pValue = 0;
- }
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('readorder' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->readorder = $pValue;
- }
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getHashCode();
- }
- return md5(
- $this->horizontal .
- $this->vertical .
- $this->textRotation .
- ($this->wrapText ? 't' : 'f') .
- ($this->shrinkToFit ? 't' : 'f') .
- $this->indent .
- $this->readorder .
- __CLASS__
- );
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Style/Border.php b/lib/phpexcel/PHPExcel/Style/Border.php
deleted file mode 100644
index 55efc501e89..00000000000
--- a/lib/phpexcel/PHPExcel/Style/Border.php
+++ /dev/null
@@ -1,282 +0,0 @@
-color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor);
-
- // bind parent if we are a supervisor
- if ($isSupervisor) {
- $this->color->bindParent($this, 'color');
- }
- }
-
- /**
- * Bind parent. Only used for supervisor
- *
- * @param PHPExcel_Style_Borders $parent
- * @param string $parentPropertyName
- * @return PHPExcel_Style_Border
- */
- public function bindParent($parent, $parentPropertyName = null)
- {
- $this->parent = $parent;
- $this->parentPropertyName = $parentPropertyName;
- return $this;
- }
-
- /**
- * Get the shared style component for the currently active cell in currently active sheet.
- * Only used for style supervisor
- *
- * @return PHPExcel_Style_Border
- * @throws PHPExcel_Exception
- */
- public function getSharedComponent()
- {
- switch ($this->parentPropertyName) {
- case 'allBorders':
- case 'horizontal':
- case 'inside':
- case 'outline':
- case 'vertical':
- throw new PHPExcel_Exception('Cannot get shared component for a pseudo-border.');
- break;
- case 'bottom':
- return $this->parent->getSharedComponent()->getBottom();
- case 'diagonal':
- return $this->parent->getSharedComponent()->getDiagonal();
- case 'left':
- return $this->parent->getSharedComponent()->getLeft();
- case 'right':
- return $this->parent->getSharedComponent()->getRight();
- case 'top':
- return $this->parent->getSharedComponent()->getTop();
- }
- }
-
- /**
- * Build style array from subcomponents
- *
- * @param array $array
- * @return array
- */
- public function getStyleArray($array)
- {
- switch ($this->parentPropertyName) {
- case 'allBorders':
- case 'bottom':
- case 'diagonal':
- case 'horizontal':
- case 'inside':
- case 'left':
- case 'outline':
- case 'right':
- case 'top':
- case 'vertical':
- $key = strtolower('vertical');
- break;
- }
- return $this->parent->getStyleArray(array($key => $array));
- }
-
- /**
- * Apply styles from array
- *
- *
- * $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->getTop()->applyFromArray(
- * array(
- * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
- * 'color' => array(
- * 'rgb' => '808080'
- * )
- * )
- * );
- *
- *
- * @param array $pStyles Array containing style information
- * @throws PHPExcel_Exception
- * @return PHPExcel_Style_Border
- */
- public function applyFromArray($pStyles = null)
- {
- if (is_array($pStyles)) {
- if ($this->isSupervisor) {
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
- } else {
- if (isset($pStyles['style'])) {
- $this->setBorderStyle($pStyles['style']);
- }
- if (isset($pStyles['color'])) {
- $this->getColor()->applyFromArray($pStyles['color']);
- }
- }
- } else {
- throw new PHPExcel_Exception("Invalid style array passed.");
- }
- return $this;
- }
-
- /**
- * Get Border style
- *
- * @return string
- */
- public function getBorderStyle()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getBorderStyle();
- }
- return $this->borderStyle;
- }
-
- /**
- * Set Border style
- *
- * @param string|boolean $pValue
- * When passing a boolean, FALSE equates PHPExcel_Style_Border::BORDER_NONE
- * and TRUE to PHPExcel_Style_Border::BORDER_MEDIUM
- * @return PHPExcel_Style_Border
- */
- public function setBorderStyle($pValue = PHPExcel_Style_Border::BORDER_NONE)
- {
-
- if (empty($pValue)) {
- $pValue = PHPExcel_Style_Border::BORDER_NONE;
- } elseif (is_bool($pValue) && $pValue) {
- $pValue = PHPExcel_Style_Border::BORDER_MEDIUM;
- }
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('style' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->borderStyle = $pValue;
- }
- return $this;
- }
-
- /**
- * Get Border Color
- *
- * @return PHPExcel_Style_Color
- */
- public function getColor()
- {
- return $this->color;
- }
-
- /**
- * Set Border Color
- *
- * @param PHPExcel_Style_Color $pValue
- * @throws PHPExcel_Exception
- * @return PHPExcel_Style_Border
- */
- public function setColor(PHPExcel_Style_Color $pValue = null)
- {
- // make sure parameter is a real color and not a supervisor
- $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;
-
- if ($this->isSupervisor) {
- $styleArray = $this->getColor()->getStyleArray(array('argb' => $color->getARGB()));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->color = $color;
- }
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getHashCode();
- }
- return md5(
- $this->borderStyle .
- $this->color->getHashCode() .
- __CLASS__
- );
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Style/Borders.php b/lib/phpexcel/PHPExcel/Style/Borders.php
deleted file mode 100644
index 27c40a48ee0..00000000000
--- a/lib/phpexcel/PHPExcel/Style/Borders.php
+++ /dev/null
@@ -1,429 +0,0 @@
-left = new PHPExcel_Style_Border($isSupervisor, $isConditional);
- $this->right = new PHPExcel_Style_Border($isSupervisor, $isConditional);
- $this->top = new PHPExcel_Style_Border($isSupervisor, $isConditional);
- $this->bottom = new PHPExcel_Style_Border($isSupervisor, $isConditional);
- $this->diagonal = new PHPExcel_Style_Border($isSupervisor, $isConditional);
- $this->diagonalDirection = PHPExcel_Style_Borders::DIAGONAL_NONE;
-
- // Specially for supervisor
- if ($isSupervisor) {
- // Initialize pseudo-borders
- $this->allBorders = new PHPExcel_Style_Border(true);
- $this->outline = new PHPExcel_Style_Border(true);
- $this->inside = new PHPExcel_Style_Border(true);
- $this->vertical = new PHPExcel_Style_Border(true);
- $this->horizontal = new PHPExcel_Style_Border(true);
-
- // bind parent if we are a supervisor
- $this->left->bindParent($this, 'left');
- $this->right->bindParent($this, 'right');
- $this->top->bindParent($this, 'top');
- $this->bottom->bindParent($this, 'bottom');
- $this->diagonal->bindParent($this, 'diagonal');
- $this->allBorders->bindParent($this, 'allBorders');
- $this->outline->bindParent($this, 'outline');
- $this->inside->bindParent($this, 'inside');
- $this->vertical->bindParent($this, 'vertical');
- $this->horizontal->bindParent($this, 'horizontal');
- }
- }
-
- /**
- * Get the shared style component for the currently active cell in currently active sheet.
- * Only used for style supervisor
- *
- * @return PHPExcel_Style_Borders
- */
- public function getSharedComponent()
- {
- return $this->parent->getSharedComponent()->getBorders();
- }
-
- /**
- * Build style array from subcomponents
- *
- * @param array $array
- * @return array
- */
- public function getStyleArray($array)
- {
- return array('borders' => $array);
- }
-
- /**
- * Apply styles from array
- *
- *
- * $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray(
- * array(
- * 'bottom' => array(
- * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
- * 'color' => array(
- * 'rgb' => '808080'
- * )
- * ),
- * 'top' => array(
- * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
- * 'color' => array(
- * 'rgb' => '808080'
- * )
- * )
- * )
- * );
- *
- *
- * $objPHPExcel->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray(
- * array(
- * 'allborders' => array(
- * 'style' => PHPExcel_Style_Border::BORDER_DASHDOT,
- * 'color' => array(
- * 'rgb' => '808080'
- * )
- * )
- * )
- * );
- *
- *
- * @param array $pStyles Array containing style information
- * @throws PHPExcel_Exception
- * @return PHPExcel_Style_Borders
- */
- public function applyFromArray($pStyles = null)
- {
- if (is_array($pStyles)) {
- if ($this->isSupervisor) {
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
- } else {
- if (array_key_exists('left', $pStyles)) {
- $this->getLeft()->applyFromArray($pStyles['left']);
- }
- if (array_key_exists('right', $pStyles)) {
- $this->getRight()->applyFromArray($pStyles['right']);
- }
- if (array_key_exists('top', $pStyles)) {
- $this->getTop()->applyFromArray($pStyles['top']);
- }
- if (array_key_exists('bottom', $pStyles)) {
- $this->getBottom()->applyFromArray($pStyles['bottom']);
- }
- if (array_key_exists('diagonal', $pStyles)) {
- $this->getDiagonal()->applyFromArray($pStyles['diagonal']);
- }
- if (array_key_exists('diagonaldirection', $pStyles)) {
- $this->setDiagonalDirection($pStyles['diagonaldirection']);
- }
- if (array_key_exists('allborders', $pStyles)) {
- $this->getLeft()->applyFromArray($pStyles['allborders']);
- $this->getRight()->applyFromArray($pStyles['allborders']);
- $this->getTop()->applyFromArray($pStyles['allborders']);
- $this->getBottom()->applyFromArray($pStyles['allborders']);
- }
- }
- } else {
- throw new PHPExcel_Exception("Invalid style array passed.");
- }
- return $this;
- }
-
- /**
- * Get Left
- *
- * @return PHPExcel_Style_Border
- */
- public function getLeft()
- {
- return $this->left;
- }
-
- /**
- * Get Right
- *
- * @return PHPExcel_Style_Border
- */
- public function getRight()
- {
- return $this->right;
- }
-
- /**
- * Get Top
- *
- * @return PHPExcel_Style_Border
- */
- public function getTop()
- {
- return $this->top;
- }
-
- /**
- * Get Bottom
- *
- * @return PHPExcel_Style_Border
- */
- public function getBottom()
- {
- return $this->bottom;
- }
-
- /**
- * Get Diagonal
- *
- * @return PHPExcel_Style_Border
- */
- public function getDiagonal()
- {
- return $this->diagonal;
- }
-
- /**
- * Get AllBorders (pseudo-border). Only applies to supervisor.
- *
- * @return PHPExcel_Style_Border
- * @throws PHPExcel_Exception
- */
- public function getAllBorders()
- {
- if (!$this->isSupervisor) {
- throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.');
- }
- return $this->allBorders;
- }
-
- /**
- * Get Outline (pseudo-border). Only applies to supervisor.
- *
- * @return boolean
- * @throws PHPExcel_Exception
- */
- public function getOutline()
- {
- if (!$this->isSupervisor) {
- throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.');
- }
- return $this->outline;
- }
-
- /**
- * Get Inside (pseudo-border). Only applies to supervisor.
- *
- * @return boolean
- * @throws PHPExcel_Exception
- */
- public function getInside()
- {
- if (!$this->isSupervisor) {
- throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.');
- }
- return $this->inside;
- }
-
- /**
- * Get Vertical (pseudo-border). Only applies to supervisor.
- *
- * @return PHPExcel_Style_Border
- * @throws PHPExcel_Exception
- */
- public function getVertical()
- {
- if (!$this->isSupervisor) {
- throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.');
- }
- return $this->vertical;
- }
-
- /**
- * Get Horizontal (pseudo-border). Only applies to supervisor.
- *
- * @return PHPExcel_Style_Border
- * @throws PHPExcel_Exception
- */
- public function getHorizontal()
- {
- if (!$this->isSupervisor) {
- throw new PHPExcel_Exception('Can only get pseudo-border for supervisor.');
- }
- return $this->horizontal;
- }
-
- /**
- * Get DiagonalDirection
- *
- * @return int
- */
- public function getDiagonalDirection()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getDiagonalDirection();
- }
- return $this->diagonalDirection;
- }
-
- /**
- * Set DiagonalDirection
- *
- * @param int $pValue
- * @return PHPExcel_Style_Borders
- */
- public function setDiagonalDirection($pValue = PHPExcel_Style_Borders::DIAGONAL_NONE)
- {
- if ($pValue == '') {
- $pValue = PHPExcel_Style_Borders::DIAGONAL_NONE;
- }
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('diagonaldirection' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->diagonalDirection = $pValue;
- }
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getHashcode();
- }
- return md5(
- $this->getLeft()->getHashCode() .
- $this->getRight()->getHashCode() .
- $this->getTop()->getHashCode() .
- $this->getBottom()->getHashCode() .
- $this->getDiagonal()->getHashCode() .
- $this->getDiagonalDirection() .
- __CLASS__
- );
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Style/Color.php b/lib/phpexcel/PHPExcel/Style/Color.php
deleted file mode 100644
index 9c7790f00e3..00000000000
--- a/lib/phpexcel/PHPExcel/Style/Color.php
+++ /dev/null
@@ -1,443 +0,0 @@
-argb = $pARGB;
- }
- }
-
- /**
- * Bind parent. Only used for supervisor
- *
- * @param mixed $parent
- * @param string $parentPropertyName
- * @return PHPExcel_Style_Color
- */
- public function bindParent($parent, $parentPropertyName = null)
- {
- $this->parent = $parent;
- $this->parentPropertyName = $parentPropertyName;
- return $this;
- }
-
- /**
- * Get the shared style component for the currently active cell in currently active sheet.
- * Only used for style supervisor
- *
- * @return PHPExcel_Style_Color
- */
- public function getSharedComponent()
- {
- switch ($this->parentPropertyName) {
- case 'endColor':
- return $this->parent->getSharedComponent()->getEndColor();
- case 'color':
- return $this->parent->getSharedComponent()->getColor();
- case 'startColor':
- return $this->parent->getSharedComponent()->getStartColor();
- }
- }
-
- /**
- * Build style array from subcomponents
- *
- * @param array $array
- * @return array
- */
- public function getStyleArray($array)
- {
- switch ($this->parentPropertyName) {
- case 'endColor':
- $key = 'endcolor';
- break;
- case 'color':
- $key = 'color';
- break;
- case 'startColor':
- $key = 'startcolor';
- break;
-
- }
- return $this->parent->getStyleArray(array($key => $array));
- }
-
- /**
- * Apply styles from array
- *
- *
- * $objPHPExcel->getActiveSheet()->getStyle('B2')->getFont()->getColor()->applyFromArray( array('rgb' => '808080') );
- *
- *
- * @param array $pStyles Array containing style information
- * @throws PHPExcel_Exception
- * @return PHPExcel_Style_Color
- */
- public function applyFromArray($pStyles = null)
- {
- if (is_array($pStyles)) {
- if ($this->isSupervisor) {
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
- } else {
- if (array_key_exists('rgb', $pStyles)) {
- $this->setRGB($pStyles['rgb']);
- }
- if (array_key_exists('argb', $pStyles)) {
- $this->setARGB($pStyles['argb']);
- }
- }
- } else {
- throw new PHPExcel_Exception("Invalid style array passed.");
- }
- return $this;
- }
-
- /**
- * Get ARGB
- *
- * @return string
- */
- public function getARGB()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getARGB();
- }
- return $this->argb;
- }
-
- /**
- * Set ARGB
- *
- * @param string $pValue
- * @return PHPExcel_Style_Color
- */
- public function setARGB($pValue = PHPExcel_Style_Color::COLOR_BLACK)
- {
- if ($pValue == '') {
- $pValue = PHPExcel_Style_Color::COLOR_BLACK;
- }
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('argb' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->argb = $pValue;
- }
- return $this;
- }
-
- /**
- * Get RGB
- *
- * @return string
- */
- public function getRGB()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getRGB();
- }
- return substr($this->argb, 2);
- }
-
- /**
- * Set RGB
- *
- * @param string $pValue RGB value
- * @return PHPExcel_Style_Color
- */
- public function setRGB($pValue = '000000')
- {
- if ($pValue == '') {
- $pValue = '000000';
- }
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('argb' => 'FF' . $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->argb = 'FF' . $pValue;
- }
- return $this;
- }
-
- /**
- * Get a specified colour component of an RGB value
- *
- * @private
- * @param string $RGB The colour as an RGB value (e.g. FF00CCCC or CCDDEE
- * @param int $offset Position within the RGB value to extract
- * @param boolean $hex Flag indicating whether the component should be returned as a hex or a
- * decimal value
- * @return string The extracted colour component
- */
- private static function getColourComponent($RGB, $offset, $hex = true)
- {
- $colour = substr($RGB, $offset, 2);
- if (!$hex) {
- $colour = hexdec($colour);
- }
- return $colour;
- }
-
- /**
- * Get the red colour component of an RGB value
- *
- * @param string $RGB The colour as an RGB value (e.g. FF00CCCC or CCDDEE
- * @param boolean $hex Flag indicating whether the component should be returned as a hex or a
- * decimal value
- * @return string The red colour component
- */
- public static function getRed($RGB, $hex = true)
- {
- return self::getColourComponent($RGB, strlen($RGB) - 6, $hex);
- }
-
- /**
- * Get the green colour component of an RGB value
- *
- * @param string $RGB The colour as an RGB value (e.g. FF00CCCC or CCDDEE
- * @param boolean $hex Flag indicating whether the component should be returned as a hex or a
- * decimal value
- * @return string The green colour component
- */
- public static function getGreen($RGB, $hex = true)
- {
- return self::getColourComponent($RGB, strlen($RGB) - 4, $hex);
- }
-
- /**
- * Get the blue colour component of an RGB value
- *
- * @param string $RGB The colour as an RGB value (e.g. FF00CCCC or CCDDEE
- * @param boolean $hex Flag indicating whether the component should be returned as a hex or a
- * decimal value
- * @return string The blue colour component
- */
- public static function getBlue($RGB, $hex = true)
- {
- return self::getColourComponent($RGB, strlen($RGB) - 2, $hex);
- }
-
- /**
- * Adjust the brightness of a color
- *
- * @param string $hex The colour as an RGBA or RGB value (e.g. FF00CCCC or CCDDEE)
- * @param float $adjustPercentage The percentage by which to adjust the colour as a float from -1 to 1
- * @return string The adjusted colour as an RGBA or RGB value (e.g. FF00CCCC or CCDDEE)
- */
- public static function changeBrightness($hex, $adjustPercentage)
- {
- $rgba = (strlen($hex) == 8);
-
- $red = self::getRed($hex, false);
- $green = self::getGreen($hex, false);
- $blue = self::getBlue($hex, false);
- if ($adjustPercentage > 0) {
- $red += (255 - $red) * $adjustPercentage;
- $green += (255 - $green) * $adjustPercentage;
- $blue += (255 - $blue) * $adjustPercentage;
- } else {
- $red += $red * $adjustPercentage;
- $green += $green * $adjustPercentage;
- $blue += $blue * $adjustPercentage;
- }
-
- if ($red < 0) {
- $red = 0;
- } elseif ($red > 255) {
- $red = 255;
- }
- if ($green < 0) {
- $green = 0;
- } elseif ($green > 255) {
- $green = 255;
- }
- if ($blue < 0) {
- $blue = 0;
- } elseif ($blue > 255) {
- $blue = 255;
- }
-
- $rgb = strtoupper(
- str_pad(dechex($red), 2, '0', 0) .
- str_pad(dechex($green), 2, '0', 0) .
- str_pad(dechex($blue), 2, '0', 0)
- );
- return (($rgba) ? 'FF' : '') . $rgb;
- }
-
- /**
- * Get indexed color
- *
- * @param int $pIndex Index entry point into the colour array
- * @param boolean $background Flag to indicate whether default background or foreground colour
- * should be returned if the indexed colour doesn't exist
- * @return PHPExcel_Style_Color
- */
- public static function indexedColor($pIndex, $background = false)
- {
- // Clean parameter
- $pIndex = intval($pIndex);
-
- // Indexed colors
- if (is_null(self::$indexedColors)) {
- self::$indexedColors = array(
- 1 => 'FF000000', // System Colour #1 - Black
- 2 => 'FFFFFFFF', // System Colour #2 - White
- 3 => 'FFFF0000', // System Colour #3 - Red
- 4 => 'FF00FF00', // System Colour #4 - Green
- 5 => 'FF0000FF', // System Colour #5 - Blue
- 6 => 'FFFFFF00', // System Colour #6 - Yellow
- 7 => 'FFFF00FF', // System Colour #7- Magenta
- 8 => 'FF00FFFF', // System Colour #8- Cyan
- 9 => 'FF800000', // Standard Colour #9
- 10 => 'FF008000', // Standard Colour #10
- 11 => 'FF000080', // Standard Colour #11
- 12 => 'FF808000', // Standard Colour #12
- 13 => 'FF800080', // Standard Colour #13
- 14 => 'FF008080', // Standard Colour #14
- 15 => 'FFC0C0C0', // Standard Colour #15
- 16 => 'FF808080', // Standard Colour #16
- 17 => 'FF9999FF', // Chart Fill Colour #17
- 18 => 'FF993366', // Chart Fill Colour #18
- 19 => 'FFFFFFCC', // Chart Fill Colour #19
- 20 => 'FFCCFFFF', // Chart Fill Colour #20
- 21 => 'FF660066', // Chart Fill Colour #21
- 22 => 'FFFF8080', // Chart Fill Colour #22
- 23 => 'FF0066CC', // Chart Fill Colour #23
- 24 => 'FFCCCCFF', // Chart Fill Colour #24
- 25 => 'FF000080', // Chart Line Colour #25
- 26 => 'FFFF00FF', // Chart Line Colour #26
- 27 => 'FFFFFF00', // Chart Line Colour #27
- 28 => 'FF00FFFF', // Chart Line Colour #28
- 29 => 'FF800080', // Chart Line Colour #29
- 30 => 'FF800000', // Chart Line Colour #30
- 31 => 'FF008080', // Chart Line Colour #31
- 32 => 'FF0000FF', // Chart Line Colour #32
- 33 => 'FF00CCFF', // Standard Colour #33
- 34 => 'FFCCFFFF', // Standard Colour #34
- 35 => 'FFCCFFCC', // Standard Colour #35
- 36 => 'FFFFFF99', // Standard Colour #36
- 37 => 'FF99CCFF', // Standard Colour #37
- 38 => 'FFFF99CC', // Standard Colour #38
- 39 => 'FFCC99FF', // Standard Colour #39
- 40 => 'FFFFCC99', // Standard Colour #40
- 41 => 'FF3366FF', // Standard Colour #41
- 42 => 'FF33CCCC', // Standard Colour #42
- 43 => 'FF99CC00', // Standard Colour #43
- 44 => 'FFFFCC00', // Standard Colour #44
- 45 => 'FFFF9900', // Standard Colour #45
- 46 => 'FFFF6600', // Standard Colour #46
- 47 => 'FF666699', // Standard Colour #47
- 48 => 'FF969696', // Standard Colour #48
- 49 => 'FF003366', // Standard Colour #49
- 50 => 'FF339966', // Standard Colour #50
- 51 => 'FF003300', // Standard Colour #51
- 52 => 'FF333300', // Standard Colour #52
- 53 => 'FF993300', // Standard Colour #53
- 54 => 'FF993366', // Standard Colour #54
- 55 => 'FF333399', // Standard Colour #55
- 56 => 'FF333333' // Standard Colour #56
- );
- }
-
- if (array_key_exists($pIndex, self::$indexedColors)) {
- return new PHPExcel_Style_Color(self::$indexedColors[$pIndex]);
- }
-
- if ($background) {
- return new PHPExcel_Style_Color(self::COLOR_WHITE);
- }
- return new PHPExcel_Style_Color(self::COLOR_BLACK);
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getHashCode();
- }
- return md5(
- $this->argb .
- __CLASS__
- );
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Style/Conditional.php b/lib/phpexcel/PHPExcel/Style/Conditional.php
deleted file mode 100644
index 331362b42a6..00000000000
--- a/lib/phpexcel/PHPExcel/Style/Conditional.php
+++ /dev/null
@@ -1,293 +0,0 @@
-conditionType = PHPExcel_Style_Conditional::CONDITION_NONE;
- $this->operatorType = PHPExcel_Style_Conditional::OPERATOR_NONE;
- $this->text = null;
- $this->condition = array();
- $this->style = new PHPExcel_Style(false, true);
- }
-
- /**
- * Get Condition type
- *
- * @return string
- */
- public function getConditionType()
- {
- return $this->conditionType;
- }
-
- /**
- * Set Condition type
- *
- * @param string $pValue PHPExcel_Style_Conditional condition type
- * @return PHPExcel_Style_Conditional
- */
- public function setConditionType($pValue = PHPExcel_Style_Conditional::CONDITION_NONE)
- {
- $this->conditionType = $pValue;
- return $this;
- }
-
- /**
- * Get Operator type
- *
- * @return string
- */
- public function getOperatorType()
- {
- return $this->operatorType;
- }
-
- /**
- * Set Operator type
- *
- * @param string $pValue PHPExcel_Style_Conditional operator type
- * @return PHPExcel_Style_Conditional
- */
- public function setOperatorType($pValue = PHPExcel_Style_Conditional::OPERATOR_NONE)
- {
- $this->operatorType = $pValue;
- return $this;
- }
-
- /**
- * Get text
- *
- * @return string
- */
- public function getText()
- {
- return $this->text;
- }
-
- /**
- * Set text
- *
- * @param string $value
- * @return PHPExcel_Style_Conditional
- */
- public function setText($value = null)
- {
- $this->text = $value;
- return $this;
- }
-
- /**
- * Get Condition
- *
- * @deprecated Deprecated, use getConditions instead
- * @return string
- */
- public function getCondition()
- {
- if (isset($this->condition[0])) {
- return $this->condition[0];
- }
-
- return '';
- }
-
- /**
- * Set Condition
- *
- * @deprecated Deprecated, use setConditions instead
- * @param string $pValue Condition
- * @return PHPExcel_Style_Conditional
- */
- public function setCondition($pValue = '')
- {
- if (!is_array($pValue)) {
- $pValue = array($pValue);
- }
-
- return $this->setConditions($pValue);
- }
-
- /**
- * Get Conditions
- *
- * @return string[]
- */
- public function getConditions()
- {
- return $this->condition;
- }
-
- /**
- * Set Conditions
- *
- * @param string[] $pValue Condition
- * @return PHPExcel_Style_Conditional
- */
- public function setConditions($pValue)
- {
- if (!is_array($pValue)) {
- $pValue = array($pValue);
- }
- $this->condition = $pValue;
- return $this;
- }
-
- /**
- * Add Condition
- *
- * @param string $pValue Condition
- * @return PHPExcel_Style_Conditional
- */
- public function addCondition($pValue = '')
- {
- $this->condition[] = $pValue;
- return $this;
- }
-
- /**
- * Get Style
- *
- * @return PHPExcel_Style
- */
- public function getStyle()
- {
- return $this->style;
- }
-
- /**
- * Set Style
- *
- * @param PHPExcel_Style $pValue
- * @throws PHPExcel_Exception
- * @return PHPExcel_Style_Conditional
- */
- public function setStyle(PHPExcel_Style $pValue = null)
- {
- $this->style = $pValue;
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- return md5(
- $this->conditionType .
- $this->operatorType .
- implode(';', $this->condition) .
- $this->style->getHashCode() .
- __CLASS__
- );
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Style/Fill.php b/lib/phpexcel/PHPExcel/Style/Fill.php
deleted file mode 100644
index 26343ff5a17..00000000000
--- a/lib/phpexcel/PHPExcel/Style/Fill.php
+++ /dev/null
@@ -1,322 +0,0 @@
-fillType = null;
- }
- $this->startColor = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_WHITE, $isSupervisor, $isConditional);
- $this->endColor = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor, $isConditional);
-
- // bind parent if we are a supervisor
- if ($isSupervisor) {
- $this->startColor->bindParent($this, 'startColor');
- $this->endColor->bindParent($this, 'endColor');
- }
- }
-
- /**
- * Get the shared style component for the currently active cell in currently active sheet.
- * Only used for style supervisor
- *
- * @return PHPExcel_Style_Fill
- */
- public function getSharedComponent()
- {
- return $this->parent->getSharedComponent()->getFill();
- }
-
- /**
- * Build style array from subcomponents
- *
- * @param array $array
- * @return array
- */
- public function getStyleArray($array)
- {
- return array('fill' => $array);
- }
-
- /**
- * Apply styles from array
- *
- *
- * $objPHPExcel->getActiveSheet()->getStyle('B2')->getFill()->applyFromArray(
- * array(
- * 'type' => PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR,
- * 'rotation' => 0,
- * 'startcolor' => array(
- * 'rgb' => '000000'
- * ),
- * 'endcolor' => array(
- * 'argb' => 'FFFFFFFF'
- * )
- * )
- * );
- *
- *
- * @param array $pStyles Array containing style information
- * @throws PHPExcel_Exception
- * @return PHPExcel_Style_Fill
- */
- public function applyFromArray($pStyles = null)
- {
- if (is_array($pStyles)) {
- if ($this->isSupervisor) {
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
- } else {
- if (array_key_exists('type', $pStyles)) {
- $this->setFillType($pStyles['type']);
- }
- if (array_key_exists('rotation', $pStyles)) {
- $this->setRotation($pStyles['rotation']);
- }
- if (array_key_exists('startcolor', $pStyles)) {
- $this->getStartColor()->applyFromArray($pStyles['startcolor']);
- }
- if (array_key_exists('endcolor', $pStyles)) {
- $this->getEndColor()->applyFromArray($pStyles['endcolor']);
- }
- if (array_key_exists('color', $pStyles)) {
- $this->getStartColor()->applyFromArray($pStyles['color']);
- }
- }
- } else {
- throw new PHPExcel_Exception("Invalid style array passed.");
- }
- return $this;
- }
-
- /**
- * Get Fill Type
- *
- * @return string
- */
- public function getFillType()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getFillType();
- }
- return $this->fillType;
- }
-
- /**
- * Set Fill Type
- *
- * @param string $pValue PHPExcel_Style_Fill fill type
- * @return PHPExcel_Style_Fill
- */
- public function setFillType($pValue = PHPExcel_Style_Fill::FILL_NONE)
- {
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('type' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->fillType = $pValue;
- }
- return $this;
- }
-
- /**
- * Get Rotation
- *
- * @return double
- */
- public function getRotation()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getRotation();
- }
- return $this->rotation;
- }
-
- /**
- * Set Rotation
- *
- * @param double $pValue
- * @return PHPExcel_Style_Fill
- */
- public function setRotation($pValue = 0)
- {
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('rotation' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->rotation = $pValue;
- }
- return $this;
- }
-
- /**
- * Get Start Color
- *
- * @return PHPExcel_Style_Color
- */
- public function getStartColor()
- {
- return $this->startColor;
- }
-
- /**
- * Set Start Color
- *
- * @param PHPExcel_Style_Color $pValue
- * @throws PHPExcel_Exception
- * @return PHPExcel_Style_Fill
- */
- public function setStartColor(PHPExcel_Style_Color $pValue = null)
- {
- // make sure parameter is a real color and not a supervisor
- $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;
-
- if ($this->isSupervisor) {
- $styleArray = $this->getStartColor()->getStyleArray(array('argb' => $color->getARGB()));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->startColor = $color;
- }
- return $this;
- }
-
- /**
- * Get End Color
- *
- * @return PHPExcel_Style_Color
- */
- public function getEndColor()
- {
- return $this->endColor;
- }
-
- /**
- * Set End Color
- *
- * @param PHPExcel_Style_Color $pValue
- * @throws PHPExcel_Exception
- * @return PHPExcel_Style_Fill
- */
- public function setEndColor(PHPExcel_Style_Color $pValue = null)
- {
- // make sure parameter is a real color and not a supervisor
- $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;
-
- if ($this->isSupervisor) {
- $styleArray = $this->getEndColor()->getStyleArray(array('argb' => $color->getARGB()));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->endColor = $color;
- }
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getHashCode();
- }
- return md5(
- $this->getFillType() .
- $this->getRotation() .
- $this->getStartColor()->getHashCode() .
- $this->getEndColor()->getHashCode() .
- __CLASS__
- );
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Style/Font.php b/lib/phpexcel/PHPExcel/Style/Font.php
deleted file mode 100644
index 9566e1dfaa7..00000000000
--- a/lib/phpexcel/PHPExcel/Style/Font.php
+++ /dev/null
@@ -1,543 +0,0 @@
-name = null;
- $this->size = null;
- $this->bold = null;
- $this->italic = null;
- $this->superScript = null;
- $this->subScript = null;
- $this->underline = null;
- $this->strikethrough = null;
- $this->color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor, $isConditional);
- } else {
- $this->color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK, $isSupervisor);
- }
- // bind parent if we are a supervisor
- if ($isSupervisor) {
- $this->color->bindParent($this, 'color');
- }
- }
-
- /**
- * Get the shared style component for the currently active cell in currently active sheet.
- * Only used for style supervisor
- *
- * @return PHPExcel_Style_Font
- */
- public function getSharedComponent()
- {
- return $this->parent->getSharedComponent()->getFont();
- }
-
- /**
- * Build style array from subcomponents
- *
- * @param array $array
- * @return array
- */
- public function getStyleArray($array)
- {
- return array('font' => $array);
- }
-
- /**
- * Apply styles from array
- *
- *
- * $objPHPExcel->getActiveSheet()->getStyle('B2')->getFont()->applyFromArray(
- * array(
- * 'name' => 'Arial',
- * 'bold' => TRUE,
- * 'italic' => FALSE,
- * 'underline' => PHPExcel_Style_Font::UNDERLINE_DOUBLE,
- * 'strike' => FALSE,
- * 'color' => array(
- * 'rgb' => '808080'
- * )
- * )
- * );
- *
- *
- * @param array $pStyles Array containing style information
- * @throws PHPExcel_Exception
- * @return PHPExcel_Style_Font
- */
- public function applyFromArray($pStyles = null)
- {
- if (is_array($pStyles)) {
- if ($this->isSupervisor) {
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
- } else {
- if (array_key_exists('name', $pStyles)) {
- $this->setName($pStyles['name']);
- }
- if (array_key_exists('bold', $pStyles)) {
- $this->setBold($pStyles['bold']);
- }
- if (array_key_exists('italic', $pStyles)) {
- $this->setItalic($pStyles['italic']);
- }
- if (array_key_exists('superScript', $pStyles)) {
- $this->setSuperScript($pStyles['superScript']);
- }
- if (array_key_exists('subScript', $pStyles)) {
- $this->setSubScript($pStyles['subScript']);
- }
- if (array_key_exists('underline', $pStyles)) {
- $this->setUnderline($pStyles['underline']);
- }
- if (array_key_exists('strike', $pStyles)) {
- $this->setStrikethrough($pStyles['strike']);
- }
- if (array_key_exists('color', $pStyles)) {
- $this->getColor()->applyFromArray($pStyles['color']);
- }
- if (array_key_exists('size', $pStyles)) {
- $this->setSize($pStyles['size']);
- }
- }
- } else {
- throw new PHPExcel_Exception("Invalid style array passed.");
- }
- return $this;
- }
-
- /**
- * Get Name
- *
- * @return string
- */
- public function getName()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getName();
- }
- return $this->name;
- }
-
- /**
- * Set Name
- *
- * @param string $pValue
- * @return PHPExcel_Style_Font
- */
- public function setName($pValue = 'Calibri')
- {
- if ($pValue == '') {
- $pValue = 'Calibri';
- }
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('name' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->name = $pValue;
- }
- return $this;
- }
-
- /**
- * Get Size
- *
- * @return double
- */
- public function getSize()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getSize();
- }
- return $this->size;
- }
-
- /**
- * Set Size
- *
- * @param double $pValue
- * @return PHPExcel_Style_Font
- */
- public function setSize($pValue = 10)
- {
- if ($pValue == '') {
- $pValue = 10;
- }
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('size' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->size = $pValue;
- }
- return $this;
- }
-
- /**
- * Get Bold
- *
- * @return boolean
- */
- public function getBold()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getBold();
- }
- return $this->bold;
- }
-
- /**
- * Set Bold
- *
- * @param boolean $pValue
- * @return PHPExcel_Style_Font
- */
- public function setBold($pValue = false)
- {
- if ($pValue == '') {
- $pValue = false;
- }
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('bold' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->bold = $pValue;
- }
- return $this;
- }
-
- /**
- * Get Italic
- *
- * @return boolean
- */
- public function getItalic()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getItalic();
- }
- return $this->italic;
- }
-
- /**
- * Set Italic
- *
- * @param boolean $pValue
- * @return PHPExcel_Style_Font
- */
- public function setItalic($pValue = false)
- {
- if ($pValue == '') {
- $pValue = false;
- }
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('italic' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->italic = $pValue;
- }
- return $this;
- }
-
- /**
- * Get SuperScript
- *
- * @return boolean
- */
- public function getSuperScript()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getSuperScript();
- }
- return $this->superScript;
- }
-
- /**
- * Set SuperScript
- *
- * @param boolean $pValue
- * @return PHPExcel_Style_Font
- */
- public function setSuperScript($pValue = false)
- {
- if ($pValue == '') {
- $pValue = false;
- }
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('superScript' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->superScript = $pValue;
- $this->subScript = !$pValue;
- }
- return $this;
- }
-
- /**
- * Get SubScript
- *
- * @return boolean
- */
- public function getSubScript()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getSubScript();
- }
- return $this->subScript;
- }
-
- /**
- * Set SubScript
- *
- * @param boolean $pValue
- * @return PHPExcel_Style_Font
- */
- public function setSubScript($pValue = false)
- {
- if ($pValue == '') {
- $pValue = false;
- }
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('subScript' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->subScript = $pValue;
- $this->superScript = !$pValue;
- }
- return $this;
- }
-
- /**
- * Get Underline
- *
- * @return string
- */
- public function getUnderline()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getUnderline();
- }
- return $this->underline;
- }
-
- /**
- * Set Underline
- *
- * @param string|boolean $pValue PHPExcel_Style_Font underline type
- * If a boolean is passed, then TRUE equates to UNDERLINE_SINGLE,
- * false equates to UNDERLINE_NONE
- * @return PHPExcel_Style_Font
- */
- public function setUnderline($pValue = self::UNDERLINE_NONE)
- {
- if (is_bool($pValue)) {
- $pValue = ($pValue) ? self::UNDERLINE_SINGLE : self::UNDERLINE_NONE;
- } elseif ($pValue == '') {
- $pValue = self::UNDERLINE_NONE;
- }
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('underline' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->underline = $pValue;
- }
- return $this;
- }
-
- /**
- * Get Strikethrough
- *
- * @return boolean
- */
- public function getStrikethrough()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getStrikethrough();
- }
- return $this->strikethrough;
- }
-
- /**
- * Set Strikethrough
- *
- * @param boolean $pValue
- * @return PHPExcel_Style_Font
- */
- public function setStrikethrough($pValue = false)
- {
- if ($pValue == '') {
- $pValue = false;
- }
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('strike' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->strikethrough = $pValue;
- }
- return $this;
- }
-
- /**
- * Get Color
- *
- * @return PHPExcel_Style_Color
- */
- public function getColor()
- {
- return $this->color;
- }
-
- /**
- * Set Color
- *
- * @param PHPExcel_Style_Color $pValue
- * @throws PHPExcel_Exception
- * @return PHPExcel_Style_Font
- */
- public function setColor(PHPExcel_Style_Color $pValue = null)
- {
- // make sure parameter is a real color and not a supervisor
- $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;
-
- if ($this->isSupervisor) {
- $styleArray = $this->getColor()->getStyleArray(array('argb' => $color->getARGB()));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->color = $color;
- }
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getHashCode();
- }
- return md5(
- $this->name .
- $this->size .
- ($this->bold ? 't' : 'f') .
- ($this->italic ? 't' : 'f') .
- ($this->superScript ? 't' : 'f') .
- ($this->subScript ? 't' : 'f') .
- $this->underline .
- ($this->strikethrough ? 't' : 'f') .
- $this->color->getHashCode() .
- __CLASS__
- );
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Style/Protection.php b/lib/phpexcel/PHPExcel/Style/Protection.php
deleted file mode 100644
index d5568f655d8..00000000000
--- a/lib/phpexcel/PHPExcel/Style/Protection.php
+++ /dev/null
@@ -1,204 +0,0 @@
-locked = self::PROTECTION_INHERIT;
- $this->hidden = self::PROTECTION_INHERIT;
- }
- }
-
- /**
- * Get the shared style component for the currently active cell in currently active sheet.
- * Only used for style supervisor
- *
- * @return PHPExcel_Style_Protection
- */
- public function getSharedComponent()
- {
- return $this->parent->getSharedComponent()->getProtection();
- }
-
- /**
- * Build style array from subcomponents
- *
- * @param array $array
- * @return array
- */
- public function getStyleArray($array)
- {
- return array('protection' => $array);
- }
-
- /**
- * Apply styles from array
- *
- *
- * $objPHPExcel->getActiveSheet()->getStyle('B2')->getLocked()->applyFromArray(
- * array(
- * 'locked' => TRUE,
- * 'hidden' => FALSE
- * )
- * );
- *
- *
- * @param array $pStyles Array containing style information
- * @throws PHPExcel_Exception
- * @return PHPExcel_Style_Protection
- */
- public function applyFromArray($pStyles = null)
- {
- if (is_array($pStyles)) {
- if ($this->isSupervisor) {
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
- } else {
- if (isset($pStyles['locked'])) {
- $this->setLocked($pStyles['locked']);
- }
- if (isset($pStyles['hidden'])) {
- $this->setHidden($pStyles['hidden']);
- }
- }
- } else {
- throw new PHPExcel_Exception("Invalid style array passed.");
- }
- return $this;
- }
-
- /**
- * Get locked
- *
- * @return string
- */
- public function getLocked()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getLocked();
- }
- return $this->locked;
- }
-
- /**
- * Set locked
- *
- * @param string $pValue
- * @return PHPExcel_Style_Protection
- */
- public function setLocked($pValue = self::PROTECTION_INHERIT)
- {
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('locked' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->locked = $pValue;
- }
- return $this;
- }
-
- /**
- * Get hidden
- *
- * @return string
- */
- public function getHidden()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getHidden();
- }
- return $this->hidden;
- }
-
- /**
- * Set hidden
- *
- * @param string $pValue
- * @return PHPExcel_Style_Protection
- */
- public function setHidden($pValue = self::PROTECTION_INHERIT)
- {
- if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('hidden' => $pValue));
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
- } else {
- $this->hidden = $pValue;
- }
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- if ($this->isSupervisor) {
- return $this->getSharedComponent()->getHashCode();
- }
- return md5(
- $this->locked .
- $this->hidden .
- __CLASS__
- );
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet.php b/lib/phpexcel/PHPExcel/Worksheet.php
deleted file mode 100644
index 0f44c77446c..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet.php
+++ /dev/null
@@ -1,2961 +0,0 @@
-parent = $pParent;
- $this->setTitle($pTitle, false);
- // setTitle can change $pTitle
- $this->setCodeName($this->getTitle());
- $this->setSheetState(PHPExcel_Worksheet::SHEETSTATE_VISIBLE);
-
- $this->cellCollection = PHPExcel_CachedObjectStorageFactory::getInstance($this);
- // Set page setup
- $this->pageSetup = new PHPExcel_Worksheet_PageSetup();
- // Set page margins
- $this->pageMargins = new PHPExcel_Worksheet_PageMargins();
- // Set page header/footer
- $this->headerFooter = new PHPExcel_Worksheet_HeaderFooter();
- // Set sheet view
- $this->sheetView = new PHPExcel_Worksheet_SheetView();
- // Drawing collection
- $this->drawingCollection = new ArrayObject();
- // Chart collection
- $this->chartCollection = new ArrayObject();
- // Protection
- $this->protection = new PHPExcel_Worksheet_Protection();
- // Default row dimension
- $this->defaultRowDimension = new PHPExcel_Worksheet_RowDimension(null);
- // Default column dimension
- $this->defaultColumnDimension = new PHPExcel_Worksheet_ColumnDimension(null);
- $this->autoFilter = new PHPExcel_Worksheet_AutoFilter(null, $this);
- }
-
-
- /**
- * Disconnect all cells from this PHPExcel_Worksheet object,
- * typically so that the worksheet object can be unset
- *
- */
- public function disconnectCells()
- {
- if ($this->cellCollection !== null) {
- $this->cellCollection->unsetWorksheetCells();
- $this->cellCollection = null;
- }
- // detach ourself from the workbook, so that it can then delete this worksheet successfully
- $this->parent = null;
- }
-
- /**
- * Code to execute when this worksheet is unset()
- *
- */
- public function __destruct()
- {
- PHPExcel_Calculation::getInstance($this->parent)->clearCalculationCacheForWorksheet($this->title);
-
- $this->disconnectCells();
- }
-
- /**
- * Return the cache controller for the cell collection
- *
- * @return PHPExcel_CachedObjectStorage_xxx
- */
- public function getCellCacheController()
- {
- return $this->cellCollection;
- } // function getCellCacheController()
-
-
- /**
- * Get array of invalid characters for sheet title
- *
- * @return array
- */
- public static function getInvalidCharacters()
- {
- return self::$invalidCharacters;
- }
-
- /**
- * Check sheet code name for valid Excel syntax
- *
- * @param string $pValue The string to check
- * @return string The valid string
- * @throws Exception
- */
- private static function checkSheetCodeName($pValue)
- {
- $CharCount = PHPExcel_Shared_String::CountCharacters($pValue);
- if ($CharCount == 0) {
- throw new PHPExcel_Exception('Sheet code name cannot be empty.');
- }
- // Some of the printable ASCII characters are invalid: * : / \ ? [ ] and first and last characters cannot be a "'"
- if ((str_replace(self::$invalidCharacters, '', $pValue) !== $pValue) ||
- (PHPExcel_Shared_String::Substring($pValue, -1, 1)=='\'') ||
- (PHPExcel_Shared_String::Substring($pValue, 0, 1)=='\'')) {
- throw new PHPExcel_Exception('Invalid character found in sheet code name');
- }
-
- // Maximum 31 characters allowed for sheet title
- if ($CharCount > 31) {
- throw new PHPExcel_Exception('Maximum 31 characters allowed in sheet code name.');
- }
-
- return $pValue;
- }
-
- /**
- * Check sheet title for valid Excel syntax
- *
- * @param string $pValue The string to check
- * @return string The valid string
- * @throws PHPExcel_Exception
- */
- private static function checkSheetTitle($pValue)
- {
- // Some of the printable ASCII characters are invalid: * : / \ ? [ ]
- if (str_replace(self::$invalidCharacters, '', $pValue) !== $pValue) {
- throw new PHPExcel_Exception('Invalid character found in sheet title');
- }
-
- // Maximum 31 characters allowed for sheet title
- if (PHPExcel_Shared_String::CountCharacters($pValue) > 31) {
- throw new PHPExcel_Exception('Maximum 31 characters allowed in sheet title.');
- }
-
- return $pValue;
- }
-
- /**
- * Get collection of cells
- *
- * @param boolean $pSorted Also sort the cell collection?
- * @return PHPExcel_Cell[]
- */
- public function getCellCollection($pSorted = true)
- {
- if ($pSorted) {
- // Re-order cell collection
- return $this->sortCellCollection();
- }
- if ($this->cellCollection !== null) {
- return $this->cellCollection->getCellList();
- }
- return array();
- }
-
- /**
- * Sort collection of cells
- *
- * @return PHPExcel_Worksheet
- */
- public function sortCellCollection()
- {
- if ($this->cellCollection !== null) {
- return $this->cellCollection->getSortedCellList();
- }
- return array();
- }
-
- /**
- * Get collection of row dimensions
- *
- * @return PHPExcel_Worksheet_RowDimension[]
- */
- public function getRowDimensions()
- {
- return $this->rowDimensions;
- }
-
- /**
- * Get default row dimension
- *
- * @return PHPExcel_Worksheet_RowDimension
- */
- public function getDefaultRowDimension()
- {
- return $this->defaultRowDimension;
- }
-
- /**
- * Get collection of column dimensions
- *
- * @return PHPExcel_Worksheet_ColumnDimension[]
- */
- public function getColumnDimensions()
- {
- return $this->columnDimensions;
- }
-
- /**
- * Get default column dimension
- *
- * @return PHPExcel_Worksheet_ColumnDimension
- */
- public function getDefaultColumnDimension()
- {
- return $this->defaultColumnDimension;
- }
-
- /**
- * Get collection of drawings
- *
- * @return PHPExcel_Worksheet_BaseDrawing[]
- */
- public function getDrawingCollection()
- {
- return $this->drawingCollection;
- }
-
- /**
- * Get collection of charts
- *
- * @return PHPExcel_Chart[]
- */
- public function getChartCollection()
- {
- return $this->chartCollection;
- }
-
- /**
- * Add chart
- *
- * @param PHPExcel_Chart $pChart
- * @param int|null $iChartIndex Index where chart should go (0,1,..., or null for last)
- * @return PHPExcel_Chart
- */
- public function addChart(PHPExcel_Chart $pChart = null, $iChartIndex = null)
- {
- $pChart->setWorksheet($this);
- if (is_null($iChartIndex)) {
- $this->chartCollection[] = $pChart;
- } else {
- // Insert the chart at the requested index
- array_splice($this->chartCollection, $iChartIndex, 0, array($pChart));
- }
-
- return $pChart;
- }
-
- /**
- * Return the count of charts on this worksheet
- *
- * @return int The number of charts
- */
- public function getChartCount()
- {
- return count($this->chartCollection);
- }
-
- /**
- * Get a chart by its index position
- *
- * @param string $index Chart index position
- * @return false|PHPExcel_Chart
- * @throws PHPExcel_Exception
- */
- public function getChartByIndex($index = null)
- {
- $chartCount = count($this->chartCollection);
- if ($chartCount == 0) {
- return false;
- }
- if (is_null($index)) {
- $index = --$chartCount;
- }
- if (!isset($this->chartCollection[$index])) {
- return false;
- }
-
- return $this->chartCollection[$index];
- }
-
- /**
- * Return an array of the names of charts on this worksheet
- *
- * @return string[] The names of charts
- * @throws PHPExcel_Exception
- */
- public function getChartNames()
- {
- $chartNames = array();
- foreach ($this->chartCollection as $chart) {
- $chartNames[] = $chart->getName();
- }
- return $chartNames;
- }
-
- /**
- * Get a chart by name
- *
- * @param string $chartName Chart name
- * @return false|PHPExcel_Chart
- * @throws PHPExcel_Exception
- */
- public function getChartByName($chartName = '')
- {
- $chartCount = count($this->chartCollection);
- if ($chartCount == 0) {
- return false;
- }
- foreach ($this->chartCollection as $index => $chart) {
- if ($chart->getName() == $chartName) {
- return $this->chartCollection[$index];
- }
- }
- return false;
- }
-
- /**
- * Refresh column dimensions
- *
- * @return PHPExcel_Worksheet
- */
- public function refreshColumnDimensions()
- {
- $currentColumnDimensions = $this->getColumnDimensions();
- $newColumnDimensions = array();
-
- foreach ($currentColumnDimensions as $objColumnDimension) {
- $newColumnDimensions[$objColumnDimension->getColumnIndex()] = $objColumnDimension;
- }
-
- $this->columnDimensions = $newColumnDimensions;
-
- return $this;
- }
-
- /**
- * Refresh row dimensions
- *
- * @return PHPExcel_Worksheet
- */
- public function refreshRowDimensions()
- {
- $currentRowDimensions = $this->getRowDimensions();
- $newRowDimensions = array();
-
- foreach ($currentRowDimensions as $objRowDimension) {
- $newRowDimensions[$objRowDimension->getRowIndex()] = $objRowDimension;
- }
-
- $this->rowDimensions = $newRowDimensions;
-
- return $this;
- }
-
- /**
- * Calculate worksheet dimension
- *
- * @return string String containing the dimension of this worksheet
- */
- public function calculateWorksheetDimension()
- {
- // Return
- return 'A1' . ':' . $this->getHighestColumn() . $this->getHighestRow();
- }
-
- /**
- * Calculate worksheet data dimension
- *
- * @return string String containing the dimension of this worksheet that actually contain data
- */
- public function calculateWorksheetDataDimension()
- {
- // Return
- return 'A1' . ':' . $this->getHighestDataColumn() . $this->getHighestDataRow();
- }
-
- /**
- * Calculate widths for auto-size columns
- *
- * @param boolean $calculateMergeCells Calculate merge cell width
- * @return PHPExcel_Worksheet;
- */
- public function calculateColumnWidths($calculateMergeCells = false)
- {
- // initialize $autoSizes array
- $autoSizes = array();
- foreach ($this->getColumnDimensions() as $colDimension) {
- if ($colDimension->getAutoSize()) {
- $autoSizes[$colDimension->getColumnIndex()] = -1;
- }
- }
-
- // There is only something to do if there are some auto-size columns
- if (!empty($autoSizes)) {
- // build list of cells references that participate in a merge
- $isMergeCell = array();
- foreach ($this->getMergeCells() as $cells) {
- foreach (PHPExcel_Cell::extractAllCellReferencesInRange($cells) as $cellReference) {
- $isMergeCell[$cellReference] = true;
- }
- }
-
- // loop through all cells in the worksheet
- foreach ($this->getCellCollection(false) as $cellID) {
- $cell = $this->getCell($cellID);
- if (isset($autoSizes[$this->cellCollection->getCurrentColumn()])) {
- // Determine width if cell does not participate in a merge
- if (!isset($isMergeCell[$this->cellCollection->getCurrentAddress()])) {
- // Calculated value
- // To formatted string
- $cellValue = PHPExcel_Style_NumberFormat::toFormattedString(
- $cell->getCalculatedValue(),
- $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode()
- );
-
- $autoSizes[$this->cellCollection->getCurrentColumn()] = max(
- (float) $autoSizes[$this->cellCollection->getCurrentColumn()],
- (float)PHPExcel_Shared_Font::calculateColumnWidth(
- $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont(),
- $cellValue,
- $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getAlignment()->getTextRotation(),
- $this->getDefaultStyle()->getFont()
- )
- );
- }
- }
- }
-
- // adjust column widths
- foreach ($autoSizes as $columnIndex => $width) {
- if ($width == -1) {
- $width = $this->getDefaultColumnDimension()->getWidth();
- }
- $this->getColumnDimension($columnIndex)->setWidth($width);
- }
- }
-
- return $this;
- }
-
- /**
- * Get parent
- *
- * @return PHPExcel
- */
- public function getParent()
- {
- return $this->parent;
- }
-
- /**
- * Re-bind parent
- *
- * @param PHPExcel $parent
- * @return PHPExcel_Worksheet
- */
- public function rebindParent(PHPExcel $parent)
- {
- if ($this->parent !== null) {
- $namedRanges = $this->parent->getNamedRanges();
- foreach ($namedRanges as $namedRange) {
- $parent->addNamedRange($namedRange);
- }
-
- $this->parent->removeSheetByIndex(
- $this->parent->getIndex($this)
- );
- }
- $this->parent = $parent;
-
- return $this;
- }
-
- /**
- * Get title
- *
- * @return string
- */
- public function getTitle()
- {
- return $this->title;
- }
-
- /**
- * Set title
- *
- * @param string $pValue String containing the dimension of this worksheet
- * @param string $updateFormulaCellReferences boolean Flag indicating whether cell references in formulae should
- * be updated to reflect the new sheet name.
- * This should be left as the default true, unless you are
- * certain that no formula cells on any worksheet contain
- * references to this worksheet
- * @return PHPExcel_Worksheet
- */
- public function setTitle($pValue = 'Worksheet', $updateFormulaCellReferences = true)
- {
- // Is this a 'rename' or not?
- if ($this->getTitle() == $pValue) {
- return $this;
- }
-
- // Syntax check
- self::checkSheetTitle($pValue);
-
- // Old title
- $oldTitle = $this->getTitle();
-
- if ($this->parent) {
- // Is there already such sheet name?
- if ($this->parent->sheetNameExists($pValue)) {
- // Use name, but append with lowest possible integer
-
- if (PHPExcel_Shared_String::CountCharacters($pValue) > 29) {
- $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 29);
- }
- $i = 1;
- while ($this->parent->sheetNameExists($pValue . ' ' . $i)) {
- ++$i;
- if ($i == 10) {
- if (PHPExcel_Shared_String::CountCharacters($pValue) > 28) {
- $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 28);
- }
- } elseif ($i == 100) {
- if (PHPExcel_Shared_String::CountCharacters($pValue) > 27) {
- $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 27);
- }
- }
- }
-
- $altTitle = $pValue . ' ' . $i;
- return $this->setTitle($altTitle, $updateFormulaCellReferences);
- }
- }
-
- // Set title
- $this->title = $pValue;
- $this->dirty = true;
-
- if ($this->parent) {
- // New title
- $newTitle = $this->getTitle();
- PHPExcel_Calculation::getInstance($this->parent)
- ->renameCalculationCacheForWorksheet($oldTitle, $newTitle);
- if ($updateFormulaCellReferences) {
- PHPExcel_ReferenceHelper::getInstance()->updateNamedFormulas($this->parent, $oldTitle, $newTitle);
- }
- }
-
- return $this;
- }
-
- /**
- * Get sheet state
- *
- * @return string Sheet state (visible, hidden, veryHidden)
- */
- public function getSheetState()
- {
- return $this->sheetState;
- }
-
- /**
- * Set sheet state
- *
- * @param string $value Sheet state (visible, hidden, veryHidden)
- * @return PHPExcel_Worksheet
- */
- public function setSheetState($value = PHPExcel_Worksheet::SHEETSTATE_VISIBLE)
- {
- $this->sheetState = $value;
- return $this;
- }
-
- /**
- * Get page setup
- *
- * @return PHPExcel_Worksheet_PageSetup
- */
- public function getPageSetup()
- {
- return $this->pageSetup;
- }
-
- /**
- * Set page setup
- *
- * @param PHPExcel_Worksheet_PageSetup $pValue
- * @return PHPExcel_Worksheet
- */
- public function setPageSetup(PHPExcel_Worksheet_PageSetup $pValue)
- {
- $this->pageSetup = $pValue;
- return $this;
- }
-
- /**
- * Get page margins
- *
- * @return PHPExcel_Worksheet_PageMargins
- */
- public function getPageMargins()
- {
- return $this->pageMargins;
- }
-
- /**
- * Set page margins
- *
- * @param PHPExcel_Worksheet_PageMargins $pValue
- * @return PHPExcel_Worksheet
- */
- public function setPageMargins(PHPExcel_Worksheet_PageMargins $pValue)
- {
- $this->pageMargins = $pValue;
- return $this;
- }
-
- /**
- * Get page header/footer
- *
- * @return PHPExcel_Worksheet_HeaderFooter
- */
- public function getHeaderFooter()
- {
- return $this->headerFooter;
- }
-
- /**
- * Set page header/footer
- *
- * @param PHPExcel_Worksheet_HeaderFooter $pValue
- * @return PHPExcel_Worksheet
- */
- public function setHeaderFooter(PHPExcel_Worksheet_HeaderFooter $pValue)
- {
- $this->headerFooter = $pValue;
- return $this;
- }
-
- /**
- * Get sheet view
- *
- * @return PHPExcel_Worksheet_SheetView
- */
- public function getSheetView()
- {
- return $this->sheetView;
- }
-
- /**
- * Set sheet view
- *
- * @param PHPExcel_Worksheet_SheetView $pValue
- * @return PHPExcel_Worksheet
- */
- public function setSheetView(PHPExcel_Worksheet_SheetView $pValue)
- {
- $this->sheetView = $pValue;
- return $this;
- }
-
- /**
- * Get Protection
- *
- * @return PHPExcel_Worksheet_Protection
- */
- public function getProtection()
- {
- return $this->protection;
- }
-
- /**
- * Set Protection
- *
- * @param PHPExcel_Worksheet_Protection $pValue
- * @return PHPExcel_Worksheet
- */
- public function setProtection(PHPExcel_Worksheet_Protection $pValue)
- {
- $this->protection = $pValue;
- $this->dirty = true;
-
- return $this;
- }
-
- /**
- * Get highest worksheet column
- *
- * @param string $row Return the data highest column for the specified row,
- * or the highest column of any row if no row number is passed
- * @return string Highest column name
- */
- public function getHighestColumn($row = null)
- {
- if ($row == null) {
- return $this->cachedHighestColumn;
- }
- return $this->getHighestDataColumn($row);
- }
-
- /**
- * Get highest worksheet column that contains data
- *
- * @param string $row Return the highest data column for the specified row,
- * or the highest data column of any row if no row number is passed
- * @return string Highest column name that contains data
- */
- public function getHighestDataColumn($row = null)
- {
- return $this->cellCollection->getHighestColumn($row);
- }
-
- /**
- * Get highest worksheet row
- *
- * @param string $column Return the highest data row for the specified column,
- * or the highest row of any column if no column letter is passed
- * @return int Highest row number
- */
- public function getHighestRow($column = null)
- {
- if ($column == null) {
- return $this->cachedHighestRow;
- }
- return $this->getHighestDataRow($column);
- }
-
- /**
- * Get highest worksheet row that contains data
- *
- * @param string $column Return the highest data row for the specified column,
- * or the highest data row of any column if no column letter is passed
- * @return string Highest row number that contains data
- */
- public function getHighestDataRow($column = null)
- {
- return $this->cellCollection->getHighestRow($column);
- }
-
- /**
- * Get highest worksheet column and highest row that have cell records
- *
- * @return array Highest column name and highest row number
- */
- public function getHighestRowAndColumn()
- {
- return $this->cellCollection->getHighestRowAndColumn();
- }
-
- /**
- * Set a cell value
- *
- * @param string $pCoordinate Coordinate of the cell
- * @param mixed $pValue Value of the cell
- * @param bool $returnCell Return the worksheet (false, default) or the cell (true)
- * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified
- */
- public function setCellValue($pCoordinate = 'A1', $pValue = null, $returnCell = false)
- {
- $cell = $this->getCell(strtoupper($pCoordinate))->setValue($pValue);
- return ($returnCell) ? $cell : $this;
- }
-
- /**
- * Set a cell value by using numeric cell coordinates
- *
- * @param string $pColumn Numeric column coordinate of the cell (A = 0)
- * @param string $pRow Numeric row coordinate of the cell
- * @param mixed $pValue Value of the cell
- * @param bool $returnCell Return the worksheet (false, default) or the cell (true)
- * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified
- */
- public function setCellValueByColumnAndRow($pColumn = 0, $pRow = 1, $pValue = null, $returnCell = false)
- {
- $cell = $this->getCellByColumnAndRow($pColumn, $pRow)->setValue($pValue);
- return ($returnCell) ? $cell : $this;
- }
-
- /**
- * Set a cell value
- *
- * @param string $pCoordinate Coordinate of the cell
- * @param mixed $pValue Value of the cell
- * @param string $pDataType Explicit data type
- * @param bool $returnCell Return the worksheet (false, default) or the cell (true)
- * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified
- */
- public function setCellValueExplicit($pCoordinate = 'A1', $pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING, $returnCell = false)
- {
- // Set value
- $cell = $this->getCell(strtoupper($pCoordinate))->setValueExplicit($pValue, $pDataType);
- return ($returnCell) ? $cell : $this;
- }
-
- /**
- * Set a cell value by using numeric cell coordinates
- *
- * @param string $pColumn Numeric column coordinate of the cell
- * @param string $pRow Numeric row coordinate of the cell
- * @param mixed $pValue Value of the cell
- * @param string $pDataType Explicit data type
- * @param bool $returnCell Return the worksheet (false, default) or the cell (true)
- * @return PHPExcel_Worksheet|PHPExcel_Cell Depending on the last parameter being specified
- */
- public function setCellValueExplicitByColumnAndRow($pColumn = 0, $pRow = 1, $pValue = null, $pDataType = PHPExcel_Cell_DataType::TYPE_STRING, $returnCell = false)
- {
- $cell = $this->getCellByColumnAndRow($pColumn, $pRow)->setValueExplicit($pValue, $pDataType);
- return ($returnCell) ? $cell : $this;
- }
-
- /**
- * Get cell at a specific coordinate
- *
- * @param string $pCoordinate Coordinate of the cell
- * @throws PHPExcel_Exception
- * @return PHPExcel_Cell Cell that was found
- */
- public function getCell($pCoordinate = 'A1')
- {
- // Check cell collection
- if ($this->cellCollection->isDataSet(strtoupper($pCoordinate))) {
- return $this->cellCollection->getCacheData($pCoordinate);
- }
-
- // Worksheet reference?
- if (strpos($pCoordinate, '!') !== false) {
- $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true);
- return $this->parent->getSheetByName($worksheetReference[0])->getCell(strtoupper($worksheetReference[1]));
- }
-
- // Named range?
- if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) &&
- (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $pCoordinate, $matches))) {
- $namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this);
- if ($namedRange !== null) {
- $pCoordinate = $namedRange->getRange();
- return $namedRange->getWorksheet()->getCell($pCoordinate);
- }
- }
-
- // Uppercase coordinate
- $pCoordinate = strtoupper($pCoordinate);
-
- if (strpos($pCoordinate, ':') !== false || strpos($pCoordinate, ',') !== false) {
- throw new PHPExcel_Exception('Cell coordinate can not be a range of cells.');
- } elseif (strpos($pCoordinate, '$') !== false) {
- throw new PHPExcel_Exception('Cell coordinate must not be absolute.');
- }
-
- // Create new cell object
- return $this->createNewCell($pCoordinate);
- }
-
- /**
- * Get cell at a specific coordinate by using numeric cell coordinates
- *
- * @param string $pColumn Numeric column coordinate of the cell
- * @param string $pRow Numeric row coordinate of the cell
- * @return PHPExcel_Cell Cell that was found
- */
- public function getCellByColumnAndRow($pColumn = 0, $pRow = 1)
- {
- $columnLetter = PHPExcel_Cell::stringFromColumnIndex($pColumn);
- $coordinate = $columnLetter . $pRow;
-
- if ($this->cellCollection->isDataSet($coordinate)) {
- return $this->cellCollection->getCacheData($coordinate);
- }
-
- return $this->createNewCell($coordinate);
- }
-
- /**
- * Create a new cell at the specified coordinate
- *
- * @param string $pCoordinate Coordinate of the cell
- * @return PHPExcel_Cell Cell that was created
- */
- private function createNewCell($pCoordinate)
- {
- $cell = $this->cellCollection->addCacheData(
- $pCoordinate,
- new PHPExcel_Cell(null, PHPExcel_Cell_DataType::TYPE_NULL, $this)
- );
- $this->cellCollectionIsSorted = false;
-
- // Coordinates
- $aCoordinates = PHPExcel_Cell::coordinateFromString($pCoordinate);
- if (PHPExcel_Cell::columnIndexFromString($this->cachedHighestColumn) < PHPExcel_Cell::columnIndexFromString($aCoordinates[0])) {
- $this->cachedHighestColumn = $aCoordinates[0];
- }
- $this->cachedHighestRow = max($this->cachedHighestRow, $aCoordinates[1]);
-
- // Cell needs appropriate xfIndex from dimensions records
- // but don't create dimension records if they don't already exist
- $rowDimension = $this->getRowDimension($aCoordinates[1], false);
- $columnDimension = $this->getColumnDimension($aCoordinates[0], false);
-
- if ($rowDimension !== null && $rowDimension->getXfIndex() > 0) {
- // then there is a row dimension with explicit style, assign it to the cell
- $cell->setXfIndex($rowDimension->getXfIndex());
- } elseif ($columnDimension !== null && $columnDimension->getXfIndex() > 0) {
- // then there is a column dimension, assign it to the cell
- $cell->setXfIndex($columnDimension->getXfIndex());
- }
-
- return $cell;
- }
-
- /**
- * Does the cell at a specific coordinate exist?
- *
- * @param string $pCoordinate Coordinate of the cell
- * @throws PHPExcel_Exception
- * @return boolean
- */
- public function cellExists($pCoordinate = 'A1')
- {
- // Worksheet reference?
- if (strpos($pCoordinate, '!') !== false) {
- $worksheetReference = PHPExcel_Worksheet::extractSheetTitle($pCoordinate, true);
- return $this->parent->getSheetByName($worksheetReference[0])->cellExists(strtoupper($worksheetReference[1]));
- }
-
- // Named range?
- if ((!preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_CELLREF.'$/i', $pCoordinate, $matches)) &&
- (preg_match('/^'.PHPExcel_Calculation::CALCULATION_REGEXP_NAMEDRANGE.'$/i', $pCoordinate, $matches))) {
- $namedRange = PHPExcel_NamedRange::resolveRange($pCoordinate, $this);
- if ($namedRange !== null) {
- $pCoordinate = $namedRange->getRange();
- if ($this->getHashCode() != $namedRange->getWorksheet()->getHashCode()) {
- if (!$namedRange->getLocalOnly()) {
- return $namedRange->getWorksheet()->cellExists($pCoordinate);
- } else {
- throw new PHPExcel_Exception('Named range ' . $namedRange->getName() . ' is not accessible from within sheet ' . $this->getTitle());
- }
- }
- } else {
- return false;
- }
- }
-
- // Uppercase coordinate
- $pCoordinate = strtoupper($pCoordinate);
-
- if (strpos($pCoordinate, ':') !== false || strpos($pCoordinate, ',') !== false) {
- throw new PHPExcel_Exception('Cell coordinate can not be a range of cells.');
- } elseif (strpos($pCoordinate, '$') !== false) {
- throw new PHPExcel_Exception('Cell coordinate must not be absolute.');
- } else {
- // Coordinates
- $aCoordinates = PHPExcel_Cell::coordinateFromString($pCoordinate);
-
- // Cell exists?
- return $this->cellCollection->isDataSet($pCoordinate);
- }
- }
-
- /**
- * Cell at a specific coordinate by using numeric cell coordinates exists?
- *
- * @param string $pColumn Numeric column coordinate of the cell
- * @param string $pRow Numeric row coordinate of the cell
- * @return boolean
- */
- public function cellExistsByColumnAndRow($pColumn = 0, $pRow = 1)
- {
- return $this->cellExists(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
- }
-
- /**
- * Get row dimension at a specific row
- *
- * @param int $pRow Numeric index of the row
- * @return PHPExcel_Worksheet_RowDimension
- */
- public function getRowDimension($pRow = 1, $create = true)
- {
- // Found
- $found = null;
-
- // Get row dimension
- if (!isset($this->rowDimensions[$pRow])) {
- if (!$create) {
- return null;
- }
- $this->rowDimensions[$pRow] = new PHPExcel_Worksheet_RowDimension($pRow);
-
- $this->cachedHighestRow = max($this->cachedHighestRow, $pRow);
- }
- return $this->rowDimensions[$pRow];
- }
-
- /**
- * Get column dimension at a specific column
- *
- * @param string $pColumn String index of the column
- * @return PHPExcel_Worksheet_ColumnDimension
- */
- public function getColumnDimension($pColumn = 'A', $create = true)
- {
- // Uppercase coordinate
- $pColumn = strtoupper($pColumn);
-
- // Fetch dimensions
- if (!isset($this->columnDimensions[$pColumn])) {
- if (!$create) {
- return null;
- }
- $this->columnDimensions[$pColumn] = new PHPExcel_Worksheet_ColumnDimension($pColumn);
-
- if (PHPExcel_Cell::columnIndexFromString($this->cachedHighestColumn) < PHPExcel_Cell::columnIndexFromString($pColumn)) {
- $this->cachedHighestColumn = $pColumn;
- }
- }
- return $this->columnDimensions[$pColumn];
- }
-
- /**
- * Get column dimension at a specific column by using numeric cell coordinates
- *
- * @param string $pColumn Numeric column coordinate of the cell
- * @return PHPExcel_Worksheet_ColumnDimension
- */
- public function getColumnDimensionByColumn($pColumn = 0)
- {
- return $this->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($pColumn));
- }
-
- /**
- * Get styles
- *
- * @return PHPExcel_Style[]
- */
- public function getStyles()
- {
- return $this->styles;
- }
-
- /**
- * Get default style of workbook.
- *
- * @deprecated
- * @return PHPExcel_Style
- * @throws PHPExcel_Exception
- */
- public function getDefaultStyle()
- {
- return $this->parent->getDefaultStyle();
- }
-
- /**
- * Set default style - should only be used by PHPExcel_IReader implementations!
- *
- * @deprecated
- * @param PHPExcel_Style $pValue
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function setDefaultStyle(PHPExcel_Style $pValue)
- {
- $this->parent->getDefaultStyle()->applyFromArray(array(
- 'font' => array(
- 'name' => $pValue->getFont()->getName(),
- 'size' => $pValue->getFont()->getSize(),
- ),
- ));
- return $this;
- }
-
- /**
- * Get style for cell
- *
- * @param string $pCellCoordinate Cell coordinate (or range) to get style for
- * @return PHPExcel_Style
- * @throws PHPExcel_Exception
- */
- public function getStyle($pCellCoordinate = 'A1')
- {
- // set this sheet as active
- $this->parent->setActiveSheetIndex($this->parent->getIndex($this));
-
- // set cell coordinate as active
- $this->setSelectedCells(strtoupper($pCellCoordinate));
-
- return $this->parent->getCellXfSupervisor();
- }
-
- /**
- * Get conditional styles for a cell
- *
- * @param string $pCoordinate
- * @return PHPExcel_Style_Conditional[]
- */
- public function getConditionalStyles($pCoordinate = 'A1')
- {
- $pCoordinate = strtoupper($pCoordinate);
- if (!isset($this->conditionalStylesCollection[$pCoordinate])) {
- $this->conditionalStylesCollection[$pCoordinate] = array();
- }
- return $this->conditionalStylesCollection[$pCoordinate];
- }
-
- /**
- * Do conditional styles exist for this cell?
- *
- * @param string $pCoordinate
- * @return boolean
- */
- public function conditionalStylesExists($pCoordinate = 'A1')
- {
- if (isset($this->conditionalStylesCollection[strtoupper($pCoordinate)])) {
- return true;
- }
- return false;
- }
-
- /**
- * Removes conditional styles for a cell
- *
- * @param string $pCoordinate
- * @return PHPExcel_Worksheet
- */
- public function removeConditionalStyles($pCoordinate = 'A1')
- {
- unset($this->conditionalStylesCollection[strtoupper($pCoordinate)]);
- return $this;
- }
-
- /**
- * Get collection of conditional styles
- *
- * @return array
- */
- public function getConditionalStylesCollection()
- {
- return $this->conditionalStylesCollection;
- }
-
- /**
- * Set conditional styles
- *
- * @param $pCoordinate string E.g. 'A1'
- * @param $pValue PHPExcel_Style_Conditional[]
- * @return PHPExcel_Worksheet
- */
- public function setConditionalStyles($pCoordinate = 'A1', $pValue)
- {
- $this->conditionalStylesCollection[strtoupper($pCoordinate)] = $pValue;
- return $this;
- }
-
- /**
- * Get style for cell by using numeric cell coordinates
- *
- * @param int $pColumn Numeric column coordinate of the cell
- * @param int $pRow Numeric row coordinate of the cell
- * @param int pColumn2 Numeric column coordinate of the range cell
- * @param int pRow2 Numeric row coordinate of the range cell
- * @return PHPExcel_Style
- */
- public function getStyleByColumnAndRow($pColumn = 0, $pRow = 1, $pColumn2 = null, $pRow2 = null)
- {
- if (!is_null($pColumn2) && !is_null($pRow2)) {
- $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
- return $this->getStyle($cellRange);
- }
-
- return $this->getStyle(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
- }
-
- /**
- * Set shared cell style to a range of cells
- *
- * Please note that this will overwrite existing cell styles for cells in range!
- *
- * @deprecated
- * @param PHPExcel_Style $pSharedCellStyle Cell style to share
- * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function setSharedStyle(PHPExcel_Style $pSharedCellStyle = null, $pRange = '')
- {
- $this->duplicateStyle($pSharedCellStyle, $pRange);
- return $this;
- }
-
- /**
- * Duplicate cell style to a range of cells
- *
- * Please note that this will overwrite existing cell styles for cells in range!
- *
- * @param PHPExcel_Style $pCellStyle Cell style to duplicate
- * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function duplicateStyle(PHPExcel_Style $pCellStyle = null, $pRange = '')
- {
- // make sure we have a real style and not supervisor
- $style = $pCellStyle->getIsSupervisor() ? $pCellStyle->getSharedComponent() : $pCellStyle;
-
- // Add the style to the workbook if necessary
- $workbook = $this->parent;
- if ($existingStyle = $this->parent->getCellXfByHashCode($pCellStyle->getHashCode())) {
- // there is already such cell Xf in our collection
- $xfIndex = $existingStyle->getIndex();
- } else {
- // we don't have such a cell Xf, need to add
- $workbook->addCellXf($pCellStyle);
- $xfIndex = $pCellStyle->getIndex();
- }
-
- // Calculate range outer borders
- list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($pRange . ':' . $pRange);
-
- // Make sure we can loop upwards on rows and columns
- if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
- $tmp = $rangeStart;
- $rangeStart = $rangeEnd;
- $rangeEnd = $tmp;
- }
-
- // Loop through cells and apply styles
- for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
- for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
- $this->getCell(PHPExcel_Cell::stringFromColumnIndex($col - 1) . $row)->setXfIndex($xfIndex);
- }
- }
-
- return $this;
- }
-
- /**
- * Duplicate conditional style to a range of cells
- *
- * Please note that this will overwrite existing cell styles for cells in range!
- *
- * @param array of PHPExcel_Style_Conditional $pCellStyle Cell style to duplicate
- * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function duplicateConditionalStyle(array $pCellStyle = null, $pRange = '')
- {
- foreach ($pCellStyle as $cellStyle) {
- if (!($cellStyle instanceof PHPExcel_Style_Conditional)) {
- throw new PHPExcel_Exception('Style is not a conditional style');
- }
- }
-
- // Calculate range outer borders
- list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($pRange . ':' . $pRange);
-
- // Make sure we can loop upwards on rows and columns
- if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
- $tmp = $rangeStart;
- $rangeStart = $rangeEnd;
- $rangeEnd = $tmp;
- }
-
- // Loop through cells and apply styles
- for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
- for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
- $this->setConditionalStyles(PHPExcel_Cell::stringFromColumnIndex($col - 1) . $row, $pCellStyle);
- }
- }
-
- return $this;
- }
-
- /**
- * Duplicate cell style array to a range of cells
- *
- * Please note that this will overwrite existing cell styles for cells in range,
- * if they are in the styles array. For example, if you decide to set a range of
- * cells to font bold, only include font bold in the styles array.
- *
- * @deprecated
- * @param array $pStyles Array containing style information
- * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
- * @param boolean $pAdvanced Advanced mode for setting borders.
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function duplicateStyleArray($pStyles = null, $pRange = '', $pAdvanced = true)
- {
- $this->getStyle($pRange)->applyFromArray($pStyles, $pAdvanced);
- return $this;
- }
-
- /**
- * Set break on a cell
- *
- * @param string $pCell Cell coordinate (e.g. A1)
- * @param int $pBreak Break type (type of PHPExcel_Worksheet::BREAK_*)
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function setBreak($pCell = 'A1', $pBreak = PHPExcel_Worksheet::BREAK_NONE)
- {
- // Uppercase coordinate
- $pCell = strtoupper($pCell);
-
- if ($pCell != '') {
- if ($pBreak == PHPExcel_Worksheet::BREAK_NONE) {
- if (isset($this->breaks[$pCell])) {
- unset($this->breaks[$pCell]);
- }
- } else {
- $this->breaks[$pCell] = $pBreak;
- }
- } else {
- throw new PHPExcel_Exception('No cell coordinate specified.');
- }
-
- return $this;
- }
-
- /**
- * Set break on a cell by using numeric cell coordinates
- *
- * @param integer $pColumn Numeric column coordinate of the cell
- * @param integer $pRow Numeric row coordinate of the cell
- * @param integer $pBreak Break type (type of PHPExcel_Worksheet::BREAK_*)
- * @return PHPExcel_Worksheet
- */
- public function setBreakByColumnAndRow($pColumn = 0, $pRow = 1, $pBreak = PHPExcel_Worksheet::BREAK_NONE)
- {
- return $this->setBreak(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow, $pBreak);
- }
-
- /**
- * Get breaks
- *
- * @return array[]
- */
- public function getBreaks()
- {
- return $this->breaks;
- }
-
- /**
- * Set merge on a cell range
- *
- * @param string $pRange Cell range (e.g. A1:E1)
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function mergeCells($pRange = 'A1:A1')
- {
- // Uppercase coordinate
- $pRange = strtoupper($pRange);
-
- if (strpos($pRange, ':') !== false) {
- $this->mergeCells[$pRange] = $pRange;
-
- // make sure cells are created
-
- // get the cells in the range
- $aReferences = PHPExcel_Cell::extractAllCellReferencesInRange($pRange);
-
- // create upper left cell if it does not already exist
- $upperLeft = $aReferences[0];
- if (!$this->cellExists($upperLeft)) {
- $this->getCell($upperLeft)->setValueExplicit(null, PHPExcel_Cell_DataType::TYPE_NULL);
- }
-
- // create or blank out the rest of the cells in the range
- $count = count($aReferences);
- for ($i = 1; $i < $count; $i++) {
- $this->getCell($aReferences[$i])->setValueExplicit(null, PHPExcel_Cell_DataType::TYPE_NULL);
- }
- } else {
- throw new PHPExcel_Exception('Merge must be set on a range of cells.');
- }
-
- return $this;
- }
-
- /**
- * Set merge on a cell range by using numeric cell coordinates
- *
- * @param int $pColumn1 Numeric column coordinate of the first cell
- * @param int $pRow1 Numeric row coordinate of the first cell
- * @param int $pColumn2 Numeric column coordinate of the last cell
- * @param int $pRow2 Numeric row coordinate of the last cell
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function mergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1)
- {
- $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
- return $this->mergeCells($cellRange);
- }
-
- /**
- * Remove merge on a cell range
- *
- * @param string $pRange Cell range (e.g. A1:E1)
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function unmergeCells($pRange = 'A1:A1')
- {
- // Uppercase coordinate
- $pRange = strtoupper($pRange);
-
- if (strpos($pRange, ':') !== false) {
- if (isset($this->mergeCells[$pRange])) {
- unset($this->mergeCells[$pRange]);
- } else {
- throw new PHPExcel_Exception('Cell range ' . $pRange . ' not known as merged.');
- }
- } else {
- throw new PHPExcel_Exception('Merge can only be removed from a range of cells.');
- }
-
- return $this;
- }
-
- /**
- * Remove merge on a cell range by using numeric cell coordinates
- *
- * @param int $pColumn1 Numeric column coordinate of the first cell
- * @param int $pRow1 Numeric row coordinate of the first cell
- * @param int $pColumn2 Numeric column coordinate of the last cell
- * @param int $pRow2 Numeric row coordinate of the last cell
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function unmergeCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1)
- {
- $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
- return $this->unmergeCells($cellRange);
- }
-
- /**
- * Get merge cells array.
- *
- * @return array[]
- */
- public function getMergeCells()
- {
- return $this->mergeCells;
- }
-
- /**
- * Set merge cells array for the entire sheet. Use instead mergeCells() to merge
- * a single cell range.
- *
- * @param array
- */
- public function setMergeCells($pValue = array())
- {
- $this->mergeCells = $pValue;
- return $this;
- }
-
- /**
- * Set protection on a cell range
- *
- * @param string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1)
- * @param string $pPassword Password to unlock the protection
- * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function protectCells($pRange = 'A1', $pPassword = '', $pAlreadyHashed = false)
- {
- // Uppercase coordinate
- $pRange = strtoupper($pRange);
-
- if (!$pAlreadyHashed) {
- $pPassword = PHPExcel_Shared_PasswordHasher::hashPassword($pPassword);
- }
- $this->protectedCells[$pRange] = $pPassword;
-
- return $this;
- }
-
- /**
- * Set protection on a cell range by using numeric cell coordinates
- *
- * @param int $pColumn1 Numeric column coordinate of the first cell
- * @param int $pRow1 Numeric row coordinate of the first cell
- * @param int $pColumn2 Numeric column coordinate of the last cell
- * @param int $pRow2 Numeric row coordinate of the last cell
- * @param string $pPassword Password to unlock the protection
- * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function protectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false)
- {
- $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
- return $this->protectCells($cellRange, $pPassword, $pAlreadyHashed);
- }
-
- /**
- * Remove protection on a cell range
- *
- * @param string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1)
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function unprotectCells($pRange = 'A1')
- {
- // Uppercase coordinate
- $pRange = strtoupper($pRange);
-
- if (isset($this->protectedCells[$pRange])) {
- unset($this->protectedCells[$pRange]);
- } else {
- throw new PHPExcel_Exception('Cell range ' . $pRange . ' not known as protected.');
- }
- return $this;
- }
-
- /**
- * Remove protection on a cell range by using numeric cell coordinates
- *
- * @param int $pColumn1 Numeric column coordinate of the first cell
- * @param int $pRow1 Numeric row coordinate of the first cell
- * @param int $pColumn2 Numeric column coordinate of the last cell
- * @param int $pRow2 Numeric row coordinate of the last cell
- * @param string $pPassword Password to unlock the protection
- * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function unprotectCellsByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1, $pPassword = '', $pAlreadyHashed = false)
- {
- $cellRange = PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1 . ':' . PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2;
- return $this->unprotectCells($cellRange, $pPassword, $pAlreadyHashed);
- }
-
- /**
- * Get protected cells
- *
- * @return array[]
- */
- public function getProtectedCells()
- {
- return $this->protectedCells;
- }
-
- /**
- * Get Autofilter
- *
- * @return PHPExcel_Worksheet_AutoFilter
- */
- public function getAutoFilter()
- {
- return $this->autoFilter;
- }
-
- /**
- * Set AutoFilter
- *
- * @param PHPExcel_Worksheet_AutoFilter|string $pValue
- * A simple string containing a Cell range like 'A1:E10' is permitted for backward compatibility
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function setAutoFilter($pValue)
- {
- $pRange = strtoupper($pValue);
- if (is_string($pValue)) {
- $this->autoFilter->setRange($pValue);
- } elseif (is_object($pValue) && ($pValue instanceof PHPExcel_Worksheet_AutoFilter)) {
- $this->autoFilter = $pValue;
- }
- return $this;
- }
-
- /**
- * Set Autofilter Range by using numeric cell coordinates
- *
- * @param integer $pColumn1 Numeric column coordinate of the first cell
- * @param integer $pRow1 Numeric row coordinate of the first cell
- * @param integer $pColumn2 Numeric column coordinate of the second cell
- * @param integer $pRow2 Numeric row coordinate of the second cell
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function setAutoFilterByColumnAndRow($pColumn1 = 0, $pRow1 = 1, $pColumn2 = 0, $pRow2 = 1)
- {
- return $this->setAutoFilter(
- PHPExcel_Cell::stringFromColumnIndex($pColumn1) . $pRow1
- . ':' .
- PHPExcel_Cell::stringFromColumnIndex($pColumn2) . $pRow2
- );
- }
-
- /**
- * Remove autofilter
- *
- * @return PHPExcel_Worksheet
- */
- public function removeAutoFilter()
- {
- $this->autoFilter->setRange(null);
- return $this;
- }
-
- /**
- * Get Freeze Pane
- *
- * @return string
- */
- public function getFreezePane()
- {
- return $this->freezePane;
- }
-
- /**
- * Freeze Pane
- *
- * @param string $pCell Cell (i.e. A2)
- * Examples:
- * A2 will freeze the rows above cell A2 (i.e row 1)
- * B1 will freeze the columns to the left of cell B1 (i.e column A)
- * B2 will freeze the rows above and to the left of cell A2
- * (i.e row 1 and column A)
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function freezePane($pCell = '')
- {
- // Uppercase coordinate
- $pCell = strtoupper($pCell);
- if (strpos($pCell, ':') === false && strpos($pCell, ',') === false) {
- $this->freezePane = $pCell;
- } else {
- throw new PHPExcel_Exception('Freeze pane can not be set on a range of cells.');
- }
- return $this;
- }
-
- /**
- * Freeze Pane by using numeric cell coordinates
- *
- * @param int $pColumn Numeric column coordinate of the cell
- * @param int $pRow Numeric row coordinate of the cell
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function freezePaneByColumnAndRow($pColumn = 0, $pRow = 1)
- {
- return $this->freezePane(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
- }
-
- /**
- * Unfreeze Pane
- *
- * @return PHPExcel_Worksheet
- */
- public function unfreezePane()
- {
- return $this->freezePane('');
- }
-
- /**
- * Insert a new row, updating all possible related data
- *
- * @param int $pBefore Insert before this one
- * @param int $pNumRows Number of rows to insert
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function insertNewRowBefore($pBefore = 1, $pNumRows = 1)
- {
- if ($pBefore >= 1) {
- $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
- $objReferenceHelper->insertNewBefore('A' . $pBefore, 0, $pNumRows, $this);
- } else {
- throw new PHPExcel_Exception("Rows can only be inserted before at least row 1.");
- }
- return $this;
- }
-
- /**
- * Insert a new column, updating all possible related data
- *
- * @param int $pBefore Insert before this one
- * @param int $pNumCols Number of columns to insert
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function insertNewColumnBefore($pBefore = 'A', $pNumCols = 1)
- {
- if (!is_numeric($pBefore)) {
- $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
- $objReferenceHelper->insertNewBefore($pBefore . '1', $pNumCols, 0, $this);
- } else {
- throw new PHPExcel_Exception("Column references should not be numeric.");
- }
- return $this;
- }
-
- /**
- * Insert a new column, updating all possible related data
- *
- * @param int $pBefore Insert before this one (numeric column coordinate of the cell)
- * @param int $pNumCols Number of columns to insert
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function insertNewColumnBeforeByIndex($pBefore = 0, $pNumCols = 1)
- {
- if ($pBefore >= 0) {
- return $this->insertNewColumnBefore(PHPExcel_Cell::stringFromColumnIndex($pBefore), $pNumCols);
- } else {
- throw new PHPExcel_Exception("Columns can only be inserted before at least column A (0).");
- }
- }
-
- /**
- * Delete a row, updating all possible related data
- *
- * @param int $pRow Remove starting with this one
- * @param int $pNumRows Number of rows to remove
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function removeRow($pRow = 1, $pNumRows = 1)
- {
- if ($pRow >= 1) {
- $highestRow = $this->getHighestDataRow();
- $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
- $objReferenceHelper->insertNewBefore('A' . ($pRow + $pNumRows), 0, -$pNumRows, $this);
- for ($r = 0; $r < $pNumRows; ++$r) {
- $this->getCellCacheController()->removeRow($highestRow);
- --$highestRow;
- }
- } else {
- throw new PHPExcel_Exception("Rows to be deleted should at least start from row 1.");
- }
- return $this;
- }
-
- /**
- * Remove a column, updating all possible related data
- *
- * @param string $pColumn Remove starting with this one
- * @param int $pNumCols Number of columns to remove
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function removeColumn($pColumn = 'A', $pNumCols = 1)
- {
- if (!is_numeric($pColumn)) {
- $highestColumn = $this->getHighestDataColumn();
- $pColumn = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($pColumn) - 1 + $pNumCols);
- $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
- $objReferenceHelper->insertNewBefore($pColumn . '1', -$pNumCols, 0, $this);
- for ($c = 0; $c < $pNumCols; ++$c) {
- $this->getCellCacheController()->removeColumn($highestColumn);
- $highestColumn = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($highestColumn) - 2);
- }
- } else {
- throw new PHPExcel_Exception("Column references should not be numeric.");
- }
- return $this;
- }
-
- /**
- * Remove a column, updating all possible related data
- *
- * @param int $pColumn Remove starting with this one (numeric column coordinate of the cell)
- * @param int $pNumCols Number of columns to remove
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function removeColumnByIndex($pColumn = 0, $pNumCols = 1)
- {
- if ($pColumn >= 0) {
- return $this->removeColumn(PHPExcel_Cell::stringFromColumnIndex($pColumn), $pNumCols);
- } else {
- throw new PHPExcel_Exception("Columns to be deleted should at least start from column 0");
- }
- }
-
- /**
- * Show gridlines?
- *
- * @return boolean
- */
- public function getShowGridlines()
- {
- return $this->showGridlines;
- }
-
- /**
- * Set show gridlines
- *
- * @param boolean $pValue Show gridlines (true/false)
- * @return PHPExcel_Worksheet
- */
- public function setShowGridlines($pValue = false)
- {
- $this->showGridlines = $pValue;
- return $this;
- }
-
- /**
- * Print gridlines?
- *
- * @return boolean
- */
- public function getPrintGridlines()
- {
- return $this->printGridlines;
- }
-
- /**
- * Set print gridlines
- *
- * @param boolean $pValue Print gridlines (true/false)
- * @return PHPExcel_Worksheet
- */
- public function setPrintGridlines($pValue = false)
- {
- $this->printGridlines = $pValue;
- return $this;
- }
-
- /**
- * Show row and column headers?
- *
- * @return boolean
- */
- public function getShowRowColHeaders()
- {
- return $this->showRowColHeaders;
- }
-
- /**
- * Set show row and column headers
- *
- * @param boolean $pValue Show row and column headers (true/false)
- * @return PHPExcel_Worksheet
- */
- public function setShowRowColHeaders($pValue = false)
- {
- $this->showRowColHeaders = $pValue;
- return $this;
- }
-
- /**
- * Show summary below? (Row/Column outlining)
- *
- * @return boolean
- */
- public function getShowSummaryBelow()
- {
- return $this->showSummaryBelow;
- }
-
- /**
- * Set show summary below
- *
- * @param boolean $pValue Show summary below (true/false)
- * @return PHPExcel_Worksheet
- */
- public function setShowSummaryBelow($pValue = true)
- {
- $this->showSummaryBelow = $pValue;
- return $this;
- }
-
- /**
- * Show summary right? (Row/Column outlining)
- *
- * @return boolean
- */
- public function getShowSummaryRight()
- {
- return $this->showSummaryRight;
- }
-
- /**
- * Set show summary right
- *
- * @param boolean $pValue Show summary right (true/false)
- * @return PHPExcel_Worksheet
- */
- public function setShowSummaryRight($pValue = true)
- {
- $this->showSummaryRight = $pValue;
- return $this;
- }
-
- /**
- * Get comments
- *
- * @return PHPExcel_Comment[]
- */
- public function getComments()
- {
- return $this->comments;
- }
-
- /**
- * Set comments array for the entire sheet.
- *
- * @param array of PHPExcel_Comment
- * @return PHPExcel_Worksheet
- */
- public function setComments($pValue = array())
- {
- $this->comments = $pValue;
-
- return $this;
- }
-
- /**
- * Get comment for cell
- *
- * @param string $pCellCoordinate Cell coordinate to get comment for
- * @return PHPExcel_Comment
- * @throws PHPExcel_Exception
- */
- public function getComment($pCellCoordinate = 'A1')
- {
- // Uppercase coordinate
- $pCellCoordinate = strtoupper($pCellCoordinate);
-
- if (strpos($pCellCoordinate, ':') !== false || strpos($pCellCoordinate, ',') !== false) {
- throw new PHPExcel_Exception('Cell coordinate string can not be a range of cells.');
- } elseif (strpos($pCellCoordinate, '$') !== false) {
- throw new PHPExcel_Exception('Cell coordinate string must not be absolute.');
- } elseif ($pCellCoordinate == '') {
- throw new PHPExcel_Exception('Cell coordinate can not be zero-length string.');
- } else {
- // Check if we already have a comment for this cell.
- // If not, create a new comment.
- if (isset($this->comments[$pCellCoordinate])) {
- return $this->comments[$pCellCoordinate];
- } else {
- $newComment = new PHPExcel_Comment();
- $this->comments[$pCellCoordinate] = $newComment;
- return $newComment;
- }
- }
- }
-
- /**
- * Get comment for cell by using numeric cell coordinates
- *
- * @param int $pColumn Numeric column coordinate of the cell
- * @param int $pRow Numeric row coordinate of the cell
- * @return PHPExcel_Comment
- */
- public function getCommentByColumnAndRow($pColumn = 0, $pRow = 1)
- {
- return $this->getComment(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
- }
-
- /**
- * Get selected cell
- *
- * @deprecated
- * @return string
- */
- public function getSelectedCell()
- {
- return $this->getSelectedCells();
- }
-
- /**
- * Get active cell
- *
- * @return string Example: 'A1'
- */
- public function getActiveCell()
- {
- return $this->activeCell;
- }
-
- /**
- * Get selected cells
- *
- * @return string
- */
- public function getSelectedCells()
- {
- return $this->selectedCells;
- }
-
- /**
- * Selected cell
- *
- * @param string $pCoordinate Cell (i.e. A1)
- * @return PHPExcel_Worksheet
- */
- public function setSelectedCell($pCoordinate = 'A1')
- {
- return $this->setSelectedCells($pCoordinate);
- }
-
- /**
- * Select a range of cells.
- *
- * @param string $pCoordinate Cell range, examples: 'A1', 'B2:G5', 'A:C', '3:6'
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function setSelectedCells($pCoordinate = 'A1')
- {
- // Uppercase coordinate
- $pCoordinate = strtoupper($pCoordinate);
-
- // Convert 'A' to 'A:A'
- $pCoordinate = preg_replace('/^([A-Z]+)$/', '${1}:${1}', $pCoordinate);
-
- // Convert '1' to '1:1'
- $pCoordinate = preg_replace('/^([0-9]+)$/', '${1}:${1}', $pCoordinate);
-
- // Convert 'A:C' to 'A1:C1048576'
- $pCoordinate = preg_replace('/^([A-Z]+):([A-Z]+)$/', '${1}1:${2}1048576', $pCoordinate);
-
- // Convert '1:3' to 'A1:XFD3'
- $pCoordinate = preg_replace('/^([0-9]+):([0-9]+)$/', 'A${1}:XFD${2}', $pCoordinate);
-
- if (strpos($pCoordinate, ':') !== false || strpos($pCoordinate, ',') !== false) {
- list($first, ) = PHPExcel_Cell::splitRange($pCoordinate);
- $this->activeCell = $first[0];
- } else {
- $this->activeCell = $pCoordinate;
- }
- $this->selectedCells = $pCoordinate;
- return $this;
- }
-
- /**
- * Selected cell by using numeric cell coordinates
- *
- * @param int $pColumn Numeric column coordinate of the cell
- * @param int $pRow Numeric row coordinate of the cell
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function setSelectedCellByColumnAndRow($pColumn = 0, $pRow = 1)
- {
- return $this->setSelectedCells(PHPExcel_Cell::stringFromColumnIndex($pColumn) . $pRow);
- }
-
- /**
- * Get right-to-left
- *
- * @return boolean
- */
- public function getRightToLeft()
- {
- return $this->rightToLeft;
- }
-
- /**
- * Set right-to-left
- *
- * @param boolean $value Right-to-left true/false
- * @return PHPExcel_Worksheet
- */
- public function setRightToLeft($value = false)
- {
- $this->rightToLeft = $value;
- return $this;
- }
-
- /**
- * Fill worksheet from values in array
- *
- * @param array $source Source array
- * @param mixed $nullValue Value in source array that stands for blank cell
- * @param string $startCell Insert array starting from this cell address as the top left coordinate
- * @param boolean $strictNullComparison Apply strict comparison when testing for null values in the array
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet
- */
- public function fromArray($source = null, $nullValue = null, $startCell = 'A1', $strictNullComparison = false)
- {
- if (is_array($source)) {
- // Convert a 1-D array to 2-D (for ease of looping)
- if (!is_array(end($source))) {
- $source = array($source);
- }
-
- // start coordinate
- list ($startColumn, $startRow) = PHPExcel_Cell::coordinateFromString($startCell);
-
- // Loop through $source
- foreach ($source as $rowData) {
- $currentColumn = $startColumn;
- foreach ($rowData as $cellValue) {
- if ($strictNullComparison) {
- if ($cellValue !== $nullValue) {
- // Set cell value
- $this->getCell($currentColumn . $startRow)->setValue($cellValue);
- }
- } else {
- if ($cellValue != $nullValue) {
- // Set cell value
- $this->getCell($currentColumn . $startRow)->setValue($cellValue);
- }
- }
- ++$currentColumn;
- }
- ++$startRow;
- }
- } else {
- throw new PHPExcel_Exception("Parameter \$source should be an array.");
- }
- return $this;
- }
-
- /**
- * Create array from a range of cells
- *
- * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
- * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist
- * @param boolean $calculateFormulas Should formulas be calculated?
- * @param boolean $formatData Should formatting be applied to cell values?
- * @param boolean $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero
- * True - Return rows and columns indexed by their actual row and column IDs
- * @return array
- */
- public function rangeToArray($pRange = 'A1', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false)
- {
- // Returnvalue
- $returnValue = array();
- // Identify the range that we need to extract from the worksheet
- list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($pRange);
- $minCol = PHPExcel_Cell::stringFromColumnIndex($rangeStart[0] -1);
- $minRow = $rangeStart[1];
- $maxCol = PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0] -1);
- $maxRow = $rangeEnd[1];
-
- $maxCol++;
- // Loop through rows
- $r = -1;
- for ($row = $minRow; $row <= $maxRow; ++$row) {
- $rRef = ($returnCellRef) ? $row : ++$r;
- $c = -1;
- // Loop through columns in the current row
- for ($col = $minCol; $col != $maxCol; ++$col) {
- $cRef = ($returnCellRef) ? $col : ++$c;
- // Using getCell() will create a new cell if it doesn't already exist. We don't want that to happen
- // so we test and retrieve directly against cellCollection
- if ($this->cellCollection->isDataSet($col.$row)) {
- // Cell exists
- $cell = $this->cellCollection->getCacheData($col.$row);
- if ($cell->getValue() !== null) {
- if ($cell->getValue() instanceof PHPExcel_RichText) {
- $returnValue[$rRef][$cRef] = $cell->getValue()->getPlainText();
- } else {
- if ($calculateFormulas) {
- $returnValue[$rRef][$cRef] = $cell->getCalculatedValue();
- } else {
- $returnValue[$rRef][$cRef] = $cell->getValue();
- }
- }
-
- if ($formatData) {
- $style = $this->parent->getCellXfByIndex($cell->getXfIndex());
- $returnValue[$rRef][$cRef] = PHPExcel_Style_NumberFormat::toFormattedString(
- $returnValue[$rRef][$cRef],
- ($style && $style->getNumberFormat()) ? $style->getNumberFormat()->getFormatCode() : PHPExcel_Style_NumberFormat::FORMAT_GENERAL
- );
- }
- } else {
- // Cell holds a NULL
- $returnValue[$rRef][$cRef] = $nullValue;
- }
- } else {
- // Cell doesn't exist
- $returnValue[$rRef][$cRef] = $nullValue;
- }
- }
- }
-
- // Return
- return $returnValue;
- }
-
-
- /**
- * Create array from a range of cells
- *
- * @param string $pNamedRange Name of the Named Range
- * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist
- * @param boolean $calculateFormulas Should formulas be calculated?
- * @param boolean $formatData Should formatting be applied to cell values?
- * @param boolean $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero
- * True - Return rows and columns indexed by their actual row and column IDs
- * @return array
- * @throws PHPExcel_Exception
- */
- public function namedRangeToArray($pNamedRange = '', $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false)
- {
- $namedRange = PHPExcel_NamedRange::resolveRange($pNamedRange, $this);
- if ($namedRange !== null) {
- $pWorkSheet = $namedRange->getWorksheet();
- $pCellRange = $namedRange->getRange();
-
- return $pWorkSheet->rangeToArray($pCellRange, $nullValue, $calculateFormulas, $formatData, $returnCellRef);
- }
-
- throw new PHPExcel_Exception('Named Range '.$pNamedRange.' does not exist.');
- }
-
-
- /**
- * Create array from worksheet
- *
- * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist
- * @param boolean $calculateFormulas Should formulas be calculated?
- * @param boolean $formatData Should formatting be applied to cell values?
- * @param boolean $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero
- * True - Return rows and columns indexed by their actual row and column IDs
- * @return array
- */
- public function toArray($nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false)
- {
- // Garbage collect...
- $this->garbageCollect();
-
- // Identify the range that we need to extract from the worksheet
- $maxCol = $this->getHighestColumn();
- $maxRow = $this->getHighestRow();
- // Return
- return $this->rangeToArray('A1:'.$maxCol.$maxRow, $nullValue, $calculateFormulas, $formatData, $returnCellRef);
- }
-
- /**
- * Get row iterator
- *
- * @param integer $startRow The row number at which to start iterating
- * @param integer $endRow The row number at which to stop iterating
- *
- * @return PHPExcel_Worksheet_RowIterator
- */
- public function getRowIterator($startRow = 1, $endRow = null)
- {
- return new PHPExcel_Worksheet_RowIterator($this, $startRow, $endRow);
- }
-
- /**
- * Get column iterator
- *
- * @param string $startColumn The column address at which to start iterating
- * @param string $endColumn The column address at which to stop iterating
- *
- * @return PHPExcel_Worksheet_ColumnIterator
- */
- public function getColumnIterator($startColumn = 'A', $endColumn = null)
- {
- return new PHPExcel_Worksheet_ColumnIterator($this, $startColumn, $endColumn);
- }
-
- /**
- * Run PHPExcel garabage collector.
- *
- * @return PHPExcel_Worksheet
- */
- public function garbageCollect()
- {
- // Flush cache
- $this->cellCollection->getCacheData('A1');
- // Build a reference table from images
-// $imageCoordinates = array();
-// $iterator = $this->getDrawingCollection()->getIterator();
-// while ($iterator->valid()) {
-// $imageCoordinates[$iterator->current()->getCoordinates()] = true;
-//
-// $iterator->next();
-// }
-//
- // Lookup highest column and highest row if cells are cleaned
- $colRow = $this->cellCollection->getHighestRowAndColumn();
- $highestRow = $colRow['row'];
- $highestColumn = PHPExcel_Cell::columnIndexFromString($colRow['column']);
-
- // Loop through column dimensions
- foreach ($this->columnDimensions as $dimension) {
- $highestColumn = max($highestColumn, PHPExcel_Cell::columnIndexFromString($dimension->getColumnIndex()));
- }
-
- // Loop through row dimensions
- foreach ($this->rowDimensions as $dimension) {
- $highestRow = max($highestRow, $dimension->getRowIndex());
- }
-
- // Cache values
- if ($highestColumn < 0) {
- $this->cachedHighestColumn = 'A';
- } else {
- $this->cachedHighestColumn = PHPExcel_Cell::stringFromColumnIndex(--$highestColumn);
- }
- $this->cachedHighestRow = $highestRow;
-
- // Return
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- if ($this->dirty) {
- $this->hash = md5($this->title . $this->autoFilter . ($this->protection->isProtectionEnabled() ? 't' : 'f') . __CLASS__);
- $this->dirty = false;
- }
- return $this->hash;
- }
-
- /**
- * Extract worksheet title from range.
- *
- * Example: extractSheetTitle("testSheet!A1") ==> 'A1'
- * Example: extractSheetTitle("'testSheet 1'!A1", true) ==> array('testSheet 1', 'A1');
- *
- * @param string $pRange Range to extract title from
- * @param bool $returnRange Return range? (see example)
- * @return mixed
- */
- public static function extractSheetTitle($pRange, $returnRange = false)
- {
- // Sheet title included?
- if (($sep = strpos($pRange, '!')) === false) {
- return '';
- }
-
- if ($returnRange) {
- return array(trim(substr($pRange, 0, $sep), "'"), substr($pRange, $sep + 1));
- }
-
- return substr($pRange, $sep + 1);
- }
-
- /**
- * Get hyperlink
- *
- * @param string $pCellCoordinate Cell coordinate to get hyperlink for
- */
- public function getHyperlink($pCellCoordinate = 'A1')
- {
- // return hyperlink if we already have one
- if (isset($this->hyperlinkCollection[$pCellCoordinate])) {
- return $this->hyperlinkCollection[$pCellCoordinate];
- }
-
- // else create hyperlink
- $this->hyperlinkCollection[$pCellCoordinate] = new PHPExcel_Cell_Hyperlink();
- return $this->hyperlinkCollection[$pCellCoordinate];
- }
-
- /**
- * Set hyperlnk
- *
- * @param string $pCellCoordinate Cell coordinate to insert hyperlink
- * @param PHPExcel_Cell_Hyperlink $pHyperlink
- * @return PHPExcel_Worksheet
- */
- public function setHyperlink($pCellCoordinate = 'A1', PHPExcel_Cell_Hyperlink $pHyperlink = null)
- {
- if ($pHyperlink === null) {
- unset($this->hyperlinkCollection[$pCellCoordinate]);
- } else {
- $this->hyperlinkCollection[$pCellCoordinate] = $pHyperlink;
- }
- return $this;
- }
-
- /**
- * Hyperlink at a specific coordinate exists?
- *
- * @param string $pCoordinate
- * @return boolean
- */
- public function hyperlinkExists($pCoordinate = 'A1')
- {
- return isset($this->hyperlinkCollection[$pCoordinate]);
- }
-
- /**
- * Get collection of hyperlinks
- *
- * @return PHPExcel_Cell_Hyperlink[]
- */
- public function getHyperlinkCollection()
- {
- return $this->hyperlinkCollection;
- }
-
- /**
- * Get data validation
- *
- * @param string $pCellCoordinate Cell coordinate to get data validation for
- */
- public function getDataValidation($pCellCoordinate = 'A1')
- {
- // return data validation if we already have one
- if (isset($this->dataValidationCollection[$pCellCoordinate])) {
- return $this->dataValidationCollection[$pCellCoordinate];
- }
-
- // else create data validation
- $this->dataValidationCollection[$pCellCoordinate] = new PHPExcel_Cell_DataValidation();
- return $this->dataValidationCollection[$pCellCoordinate];
- }
-
- /**
- * Set data validation
- *
- * @param string $pCellCoordinate Cell coordinate to insert data validation
- * @param PHPExcel_Cell_DataValidation $pDataValidation
- * @return PHPExcel_Worksheet
- */
- public function setDataValidation($pCellCoordinate = 'A1', PHPExcel_Cell_DataValidation $pDataValidation = null)
- {
- if ($pDataValidation === null) {
- unset($this->dataValidationCollection[$pCellCoordinate]);
- } else {
- $this->dataValidationCollection[$pCellCoordinate] = $pDataValidation;
- }
- return $this;
- }
-
- /**
- * Data validation at a specific coordinate exists?
- *
- * @param string $pCoordinate
- * @return boolean
- */
- public function dataValidationExists($pCoordinate = 'A1')
- {
- return isset($this->dataValidationCollection[$pCoordinate]);
- }
-
- /**
- * Get collection of data validations
- *
- * @return PHPExcel_Cell_DataValidation[]
- */
- public function getDataValidationCollection()
- {
- return $this->dataValidationCollection;
- }
-
- /**
- * Accepts a range, returning it as a range that falls within the current highest row and column of the worksheet
- *
- * @param string $range
- * @return string Adjusted range value
- */
- public function shrinkRangeToFit($range)
- {
- $maxCol = $this->getHighestColumn();
- $maxRow = $this->getHighestRow();
- $maxCol = PHPExcel_Cell::columnIndexFromString($maxCol);
-
- $rangeBlocks = explode(' ', $range);
- foreach ($rangeBlocks as &$rangeSet) {
- $rangeBoundaries = PHPExcel_Cell::getRangeBoundaries($rangeSet);
-
- if (PHPExcel_Cell::columnIndexFromString($rangeBoundaries[0][0]) > $maxCol) {
- $rangeBoundaries[0][0] = PHPExcel_Cell::stringFromColumnIndex($maxCol);
- }
- if ($rangeBoundaries[0][1] > $maxRow) {
- $rangeBoundaries[0][1] = $maxRow;
- }
- if (PHPExcel_Cell::columnIndexFromString($rangeBoundaries[1][0]) > $maxCol) {
- $rangeBoundaries[1][0] = PHPExcel_Cell::stringFromColumnIndex($maxCol);
- }
- if ($rangeBoundaries[1][1] > $maxRow) {
- $rangeBoundaries[1][1] = $maxRow;
- }
- $rangeSet = $rangeBoundaries[0][0].$rangeBoundaries[0][1].':'.$rangeBoundaries[1][0].$rangeBoundaries[1][1];
- }
- unset($rangeSet);
- $stRange = implode(' ', $rangeBlocks);
-
- return $stRange;
- }
-
- /**
- * Get tab color
- *
- * @return PHPExcel_Style_Color
- */
- public function getTabColor()
- {
- if ($this->tabColor === null) {
- $this->tabColor = new PHPExcel_Style_Color();
- }
- return $this->tabColor;
- }
-
- /**
- * Reset tab color
- *
- * @return PHPExcel_Worksheet
- */
- public function resetTabColor()
- {
- $this->tabColor = null;
- unset($this->tabColor);
-
- return $this;
- }
-
- /**
- * Tab color set?
- *
- * @return boolean
- */
- public function isTabColorSet()
- {
- return ($this->tabColor !== null);
- }
-
- /**
- * Copy worksheet (!= clone!)
- *
- * @return PHPExcel_Worksheet
- */
- public function copy()
- {
- $copied = clone $this;
-
- return $copied;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- foreach ($this as $key => $val) {
- if ($key == 'parent') {
- continue;
- }
-
- if (is_object($val) || (is_array($val))) {
- if ($key == 'cellCollection') {
- $newCollection = clone $this->cellCollection;
- $newCollection->copyCellCollection($this);
- $this->cellCollection = $newCollection;
- } elseif ($key == 'drawingCollection') {
- $newCollection = clone $this->drawingCollection;
- $this->drawingCollection = $newCollection;
- } elseif (($key == 'autoFilter') && ($this->autoFilter instanceof PHPExcel_Worksheet_AutoFilter)) {
- $newAutoFilter = clone $this->autoFilter;
- $this->autoFilter = $newAutoFilter;
- $this->autoFilter->setParent($this);
- } else {
- $this->{$key} = unserialize(serialize($val));
- }
- }
- }
- }
-/**
- * Define the code name of the sheet
- *
- * @param null|string Same rule as Title minus space not allowed (but, like Excel, change silently space to underscore)
- * @return objWorksheet
- * @throws PHPExcel_Exception
- */
- public function setCodeName($pValue = null)
- {
- // Is this a 'rename' or not?
- if ($this->getCodeName() == $pValue) {
- return $this;
- }
- $pValue = str_replace(' ', '_', $pValue);//Excel does this automatically without flinching, we are doing the same
- // Syntax check
- // throw an exception if not valid
- self::checkSheetCodeName($pValue);
-
- // We use the same code that setTitle to find a valid codeName else not using a space (Excel don't like) but a '_'
-
- if ($this->getParent()) {
- // Is there already such sheet name?
- if ($this->getParent()->sheetCodeNameExists($pValue)) {
- // Use name, but append with lowest possible integer
-
- if (PHPExcel_Shared_String::CountCharacters($pValue) > 29) {
- $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 29);
- }
- $i = 1;
- while ($this->getParent()->sheetCodeNameExists($pValue . '_' . $i)) {
- ++$i;
- if ($i == 10) {
- if (PHPExcel_Shared_String::CountCharacters($pValue) > 28) {
- $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 28);
- }
- } elseif ($i == 100) {
- if (PHPExcel_Shared_String::CountCharacters($pValue) > 27) {
- $pValue = PHPExcel_Shared_String::Substring($pValue, 0, 27);
- }
- }
- }
-
- $pValue = $pValue . '_' . $i;// ok, we have a valid name
- //codeName is'nt used in formula : no need to call for an update
- //return $this->setTitle($altTitle, $updateFormulaCellReferences);
- }
- }
-
- $this->codeName=$pValue;
- return $this;
- }
- /**
- * Return the code name of the sheet
- *
- * @return null|string
- */
- public function getCodeName()
- {
- return $this->codeName;
- }
- /**
- * Sheet has a code name ?
- * @return boolean
- */
- public function hasCodeName()
- {
- return !(is_null($this->codeName));
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/AutoFilter.php b/lib/phpexcel/PHPExcel/Worksheet/AutoFilter.php
deleted file mode 100644
index 6ec8a44667f..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet/AutoFilter.php
+++ /dev/null
@@ -1,846 +0,0 @@
-range = $pRange;
- $this->workSheet = $pSheet;
- }
-
- /**
- * Get AutoFilter Parent Worksheet
- *
- * @return PHPExcel_Worksheet
- */
- public function getParent()
- {
- return $this->workSheet;
- }
-
- /**
- * Set AutoFilter Parent Worksheet
- *
- * @param PHPExcel_Worksheet $pSheet
- * @return PHPExcel_Worksheet_AutoFilter
- */
- public function setParent(PHPExcel_Worksheet $pSheet = null)
- {
- $this->workSheet = $pSheet;
-
- return $this;
- }
-
- /**
- * Get AutoFilter Range
- *
- * @return string
- */
- public function getRange()
- {
- return $this->range;
- }
-
- /**
- * Set AutoFilter Range
- *
- * @param string $pRange Cell range (i.e. A1:E10)
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter
- */
- public function setRange($pRange = '')
- {
- // Uppercase coordinate
- $cellAddress = explode('!', strtoupper($pRange));
- if (count($cellAddress) > 1) {
- list($worksheet, $pRange) = $cellAddress;
- }
-
- if (strpos($pRange, ':') !== false) {
- $this->range = $pRange;
- } elseif (empty($pRange)) {
- $this->range = '';
- } else {
- throw new PHPExcel_Exception('Autofilter must be set on a range of cells.');
- }
-
- if (empty($pRange)) {
- // Discard all column rules
- $this->columns = array();
- } else {
- // Discard any column rules that are no longer valid within this range
- list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->range);
- foreach ($this->columns as $key => $value) {
- $colIndex = PHPExcel_Cell::columnIndexFromString($key);
- if (($rangeStart[0] > $colIndex) || ($rangeEnd[0] < $colIndex)) {
- unset($this->columns[$key]);
- }
- }
- }
-
- return $this;
- }
-
- /**
- * Get all AutoFilter Columns
- *
- * @throws PHPExcel_Exception
- * @return array of PHPExcel_Worksheet_AutoFilter_Column
- */
- public function getColumns()
- {
- return $this->columns;
- }
-
- /**
- * Validate that the specified column is in the AutoFilter range
- *
- * @param string $column Column name (e.g. A)
- * @throws PHPExcel_Exception
- * @return integer The column offset within the autofilter range
- */
- public function testColumnInRange($column)
- {
- if (empty($this->range)) {
- throw new PHPExcel_Exception("No autofilter range is defined.");
- }
-
- $columnIndex = PHPExcel_Cell::columnIndexFromString($column);
- list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->range);
- if (($rangeStart[0] > $columnIndex) || ($rangeEnd[0] < $columnIndex)) {
- throw new PHPExcel_Exception("Column is outside of current autofilter range.");
- }
-
- return $columnIndex - $rangeStart[0];
- }
-
- /**
- * Get a specified AutoFilter Column Offset within the defined AutoFilter range
- *
- * @param string $pColumn Column name (e.g. A)
- * @throws PHPExcel_Exception
- * @return integer The offset of the specified column within the autofilter range
- */
- public function getColumnOffset($pColumn)
- {
- return $this->testColumnInRange($pColumn);
- }
-
- /**
- * Get a specified AutoFilter Column
- *
- * @param string $pColumn Column name (e.g. A)
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function getColumn($pColumn)
- {
- $this->testColumnInRange($pColumn);
-
- if (!isset($this->columns[$pColumn])) {
- $this->columns[$pColumn] = new PHPExcel_Worksheet_AutoFilter_Column($pColumn, $this);
- }
-
- return $this->columns[$pColumn];
- }
-
- /**
- * Get a specified AutoFilter Column by it's offset
- *
- * @param integer $pColumnOffset Column offset within range (starting from 0)
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function getColumnByOffset($pColumnOffset = 0)
- {
- list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->range);
- $pColumn = PHPExcel_Cell::stringFromColumnIndex($rangeStart[0] + $pColumnOffset - 1);
-
- return $this->getColumn($pColumn);
- }
-
- /**
- * Set AutoFilter
- *
- * @param PHPExcel_Worksheet_AutoFilter_Column|string $pColumn
- * A simple string containing a Column ID like 'A' is permitted
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter
- */
- public function setColumn($pColumn)
- {
- if ((is_string($pColumn)) && (!empty($pColumn))) {
- $column = $pColumn;
- } elseif (is_object($pColumn) && ($pColumn instanceof PHPExcel_Worksheet_AutoFilter_Column)) {
- $column = $pColumn->getColumnIndex();
- } else {
- throw new PHPExcel_Exception("Column is not within the autofilter range.");
- }
- $this->testColumnInRange($column);
-
- if (is_string($pColumn)) {
- $this->columns[$pColumn] = new PHPExcel_Worksheet_AutoFilter_Column($pColumn, $this);
- } elseif (is_object($pColumn) && ($pColumn instanceof PHPExcel_Worksheet_AutoFilter_Column)) {
- $pColumn->setParent($this);
- $this->columns[$column] = $pColumn;
- }
- ksort($this->columns);
-
- return $this;
- }
-
- /**
- * Clear a specified AutoFilter Column
- *
- * @param string $pColumn Column name (e.g. A)
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter
- */
- public function clearColumn($pColumn)
- {
- $this->testColumnInRange($pColumn);
-
- if (isset($this->columns[$pColumn])) {
- unset($this->columns[$pColumn]);
- }
-
- return $this;
- }
-
- /**
- * Shift an AutoFilter Column Rule to a different column
- *
- * Note: This method bypasses validation of the destination column to ensure it is within this AutoFilter range.
- * Nor does it verify whether any column rule already exists at $toColumn, but will simply overrideany existing value.
- * Use with caution.
- *
- * @param string $fromColumn Column name (e.g. A)
- * @param string $toColumn Column name (e.g. B)
- * @return PHPExcel_Worksheet_AutoFilter
- */
- public function shiftColumn($fromColumn = null, $toColumn = null)
- {
- $fromColumn = strtoupper($fromColumn);
- $toColumn = strtoupper($toColumn);
-
- if (($fromColumn !== null) && (isset($this->columns[$fromColumn])) && ($toColumn !== null)) {
- $this->columns[$fromColumn]->setParent();
- $this->columns[$fromColumn]->setColumnIndex($toColumn);
- $this->columns[$toColumn] = $this->columns[$fromColumn];
- $this->columns[$toColumn]->setParent($this);
- unset($this->columns[$fromColumn]);
-
- ksort($this->columns);
- }
-
- return $this;
- }
-
-
- /**
- * Test if cell value is in the defined set of values
- *
- * @param mixed $cellValue
- * @param mixed[] $dataSet
- * @return boolean
- */
- private static function filterTestInSimpleDataSet($cellValue, $dataSet)
- {
- $dataSetValues = $dataSet['filterValues'];
- $blanks = $dataSet['blanks'];
- if (($cellValue == '') || ($cellValue === null)) {
- return $blanks;
- }
- return in_array($cellValue, $dataSetValues);
- }
-
- /**
- * Test if cell value is in the defined set of Excel date values
- *
- * @param mixed $cellValue
- * @param mixed[] $dataSet
- * @return boolean
- */
- private static function filterTestInDateGroupSet($cellValue, $dataSet)
- {
- $dateSet = $dataSet['filterValues'];
- $blanks = $dataSet['blanks'];
- if (($cellValue == '') || ($cellValue === null)) {
- return $blanks;
- }
-
- if (is_numeric($cellValue)) {
- $dateValue = PHPExcel_Shared_Date::ExcelToPHP($cellValue);
- if ($cellValue < 1) {
- // Just the time part
- $dtVal = date('His', $dateValue);
- $dateSet = $dateSet['time'];
- } elseif ($cellValue == floor($cellValue)) {
- // Just the date part
- $dtVal = date('Ymd', $dateValue);
- $dateSet = $dateSet['date'];
- } else {
- // date and time parts
- $dtVal = date('YmdHis', $dateValue);
- $dateSet = $dateSet['dateTime'];
- }
- foreach ($dateSet as $dateValue) {
- // Use of substr to extract value at the appropriate group level
- if (substr($dtVal, 0, strlen($dateValue)) == $dateValue) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Test if cell value is within a set of values defined by a ruleset
- *
- * @param mixed $cellValue
- * @param mixed[] $ruleSet
- * @return boolean
- */
- private static function filterTestInCustomDataSet($cellValue, $ruleSet)
- {
- $dataSet = $ruleSet['filterRules'];
- $join = $ruleSet['join'];
- $customRuleForBlanks = isset($ruleSet['customRuleForBlanks']) ? $ruleSet['customRuleForBlanks'] : false;
-
- if (!$customRuleForBlanks) {
- // Blank cells are always ignored, so return a FALSE
- if (($cellValue == '') || ($cellValue === null)) {
- return false;
- }
- }
- $returnVal = ($join == PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND);
- foreach ($dataSet as $rule) {
- if (is_numeric($rule['value'])) {
- // Numeric values are tested using the appropriate operator
- switch ($rule['operator']) {
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL:
- $retVal = ($cellValue == $rule['value']);
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_NOTEQUAL:
- $retVal = ($cellValue != $rule['value']);
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHAN:
- $retVal = ($cellValue > $rule['value']);
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL:
- $retVal = ($cellValue >= $rule['value']);
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN:
- $retVal = ($cellValue < $rule['value']);
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL:
- $retVal = ($cellValue <= $rule['value']);
- break;
- }
- } elseif ($rule['value'] == '') {
- switch ($rule['operator']) {
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL:
- $retVal = (($cellValue == '') || ($cellValue === null));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_NOTEQUAL:
- $retVal = (($cellValue != '') && ($cellValue !== null));
- break;
- default:
- $retVal = true;
- break;
- }
- } else {
- // String values are always tested for equality, factoring in for wildcards (hence a regexp test)
- $retVal = preg_match('/^'.$rule['value'].'$/i', $cellValue);
- }
- // If there are multiple conditions, then we need to test both using the appropriate join operator
- switch ($join) {
- case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_OR:
- $returnVal = $returnVal || $retVal;
- // Break as soon as we have a TRUE match for OR joins,
- // to avoid unnecessary additional code execution
- if ($returnVal) {
- return $returnVal;
- }
- break;
- case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND:
- $returnVal = $returnVal && $retVal;
- break;
- }
- }
-
- return $returnVal;
- }
-
- /**
- * Test if cell date value is matches a set of values defined by a set of months
- *
- * @param mixed $cellValue
- * @param mixed[] $monthSet
- * @return boolean
- */
- private static function filterTestInPeriodDateSet($cellValue, $monthSet)
- {
- // Blank cells are always ignored, so return a FALSE
- if (($cellValue == '') || ($cellValue === null)) {
- return false;
- }
-
- if (is_numeric($cellValue)) {
- $dateValue = date('m', PHPExcel_Shared_Date::ExcelToPHP($cellValue));
- if (in_array($dateValue, $monthSet)) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Search/Replace arrays to convert Excel wildcard syntax to a regexp syntax for preg_matching
- *
- * @var array
- */
- private static $fromReplace = array('\*', '\?', '~~', '~.*', '~.?');
- private static $toReplace = array('.*', '.', '~', '\*', '\?');
-
-
- /**
- * Convert a dynamic rule daterange to a custom filter range expression for ease of calculation
- *
- * @param string $dynamicRuleType
- * @param PHPExcel_Worksheet_AutoFilter_Column &$filterColumn
- * @return mixed[]
- */
- private function dynamicFilterDateRange($dynamicRuleType, &$filterColumn)
- {
- $rDateType = PHPExcel_Calculation_Functions::getReturnDateType();
- PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
- $val = $maxVal = null;
-
- $ruleValues = array();
- $baseDate = PHPExcel_Calculation_DateTime::DATENOW();
- // Calculate start/end dates for the required date range based on current date
- switch ($dynamicRuleType) {
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK:
- $baseDate = strtotime('-7 days', $baseDate);
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK:
- $baseDate = strtotime('-7 days', $baseDate);
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH:
- $baseDate = strtotime('-1 month', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH:
- $baseDate = strtotime('+1 month', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER:
- $baseDate = strtotime('-3 month', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER:
- $baseDate = strtotime('+3 month', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR:
- $baseDate = strtotime('-1 year', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR:
- $baseDate = strtotime('+1 year', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
- break;
- }
-
- switch ($dynamicRuleType) {
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_TODAY:
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY:
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW:
- $maxVal = (int) PHPExcel_Shared_Date::PHPtoExcel(strtotime('+1 day', $baseDate));
- $val = (int) PHPExcel_Shared_Date::PHPToExcel($baseDate);
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE:
- $maxVal = (int) PHPExcel_Shared_Date::PHPtoExcel(strtotime('+1 day', $baseDate));
- $val = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1, date('Y', $baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISYEAR:
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR:
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR:
- $maxVal = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0, 0, 0, 31, 12, date('Y', $baseDate)));
- ++$maxVal;
- $val = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1, date('Y', $baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISQUARTER:
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER:
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER:
- $thisMonth = date('m', $baseDate);
- $thisQuarter = floor(--$thisMonth / 3);
- $maxVal = (int) PHPExcel_Shared_Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), (1+$thisQuarter)*3, date('Y', $baseDate)));
- ++$maxVal;
- $val = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1+$thisQuarter*3, date('Y', $baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISMONTH:
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH:
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH:
- $maxVal = (int) PHPExcel_Shared_Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), date('m', $baseDate), date('Y', $baseDate)));
- ++$maxVal;
- $val = (int) PHPExcel_Shared_Date::PHPToExcel(gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISWEEK:
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK:
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK:
- $dayOfWeek = date('w', $baseDate);
- $val = (int) PHPExcel_Shared_Date::PHPToExcel($baseDate) - $dayOfWeek;
- $maxVal = $val + 7;
- break;
- }
-
- switch ($dynamicRuleType) {
- // Adjust Today dates for Yesterday and Tomorrow
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY:
- --$maxVal;
- --$val;
- break;
- case PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW:
- ++$maxVal;
- ++$val;
- break;
- }
-
- // Set the filter column rule attributes ready for writing
- $filterColumn->setAttributes(array('val' => $val, 'maxVal' => $maxVal));
-
- // Set the rules for identifying rows for hide/show
- $ruleValues[] = array('operator' => PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL, 'value' => $val);
- $ruleValues[] = array('operator' => PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN, 'value' => $maxVal);
- PHPExcel_Calculation_Functions::setReturnDateType($rDateType);
-
- return array('method' => 'filterTestInCustomDataSet', 'arguments' => array('filterRules' => $ruleValues, 'join' => PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND));
- }
-
- private function calculateTopTenValue($columnID, $startRow, $endRow, $ruleType, $ruleValue)
- {
- $range = $columnID.$startRow.':'.$columnID.$endRow;
- $dataValues = PHPExcel_Calculation_Functions::flattenArray($this->workSheet->rangeToArray($range, null, true, false));
-
- $dataValues = array_filter($dataValues);
- if ($ruleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) {
- rsort($dataValues);
- } else {
- sort($dataValues);
- }
-
- return array_pop(array_slice($dataValues, 0, $ruleValue));
- }
-
- /**
- * Apply the AutoFilter rules to the AutoFilter Range
- *
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter
- */
- public function showHideRows()
- {
- list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($this->range);
-
- // The heading row should always be visible
-// echo 'AutoFilter Heading Row ', $rangeStart[1],' is always SHOWN',PHP_EOL;
- $this->workSheet->getRowDimension($rangeStart[1])->setVisible(true);
-
- $columnFilterTests = array();
- foreach ($this->columns as $columnID => $filterColumn) {
- $rules = $filterColumn->getRules();
- switch ($filterColumn->getFilterType()) {
- case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER:
- $ruleValues = array();
- // Build a list of the filter value selections
- foreach ($rules as $rule) {
- $ruleType = $rule->getRuleType();
- $ruleValues[] = $rule->getValue();
- }
- // Test if we want to include blanks in our filter criteria
- $blanks = false;
- $ruleDataSet = array_filter($ruleValues);
- if (count($ruleValues) != count($ruleDataSet)) {
- $blanks = true;
- }
- if ($ruleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER) {
- // Filter on absolute values
- $columnFilterTests[$columnID] = array(
- 'method' => 'filterTestInSimpleDataSet',
- 'arguments' => array('filterValues' => $ruleDataSet, 'blanks' => $blanks)
- );
- } else {
- // Filter on date group values
- $arguments = array(
- 'date' => array(),
- 'time' => array(),
- 'dateTime' => array(),
- );
- foreach ($ruleDataSet as $ruleValue) {
- $date = $time = '';
- if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR])) &&
- ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR] !== '')) {
- $date .= sprintf('%04d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR]);
- }
- if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH])) &&
- ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH] != '')) {
- $date .= sprintf('%02d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH]);
- }
- if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY])) &&
- ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY] !== '')) {
- $date .= sprintf('%02d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY]);
- }
- if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR])) &&
- ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR] !== '')) {
- $time .= sprintf('%02d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR]);
- }
- if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE])) &&
- ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE] !== '')) {
- $time .= sprintf('%02d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE]);
- }
- if ((isset($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND])) &&
- ($ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND] !== '')) {
- $time .= sprintf('%02d', $ruleValue[PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND]);
- }
- $dateTime = $date . $time;
- $arguments['date'][] = $date;
- $arguments['time'][] = $time;
- $arguments['dateTime'][] = $dateTime;
- }
- // Remove empty elements
- $arguments['date'] = array_filter($arguments['date']);
- $arguments['time'] = array_filter($arguments['time']);
- $arguments['dateTime'] = array_filter($arguments['dateTime']);
- $columnFilterTests[$columnID] = array(
- 'method' => 'filterTestInDateGroupSet',
- 'arguments' => array('filterValues' => $arguments, 'blanks' => $blanks)
- );
- }
- break;
- case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER:
- $customRuleForBlanks = false;
- $ruleValues = array();
- // Build a list of the filter value selections
- foreach ($rules as $rule) {
- $ruleType = $rule->getRuleType();
- $ruleValue = $rule->getValue();
- if (!is_numeric($ruleValue)) {
- // Convert to a regexp allowing for regexp reserved characters, wildcards and escaped wildcards
- $ruleValue = preg_quote($ruleValue);
- $ruleValue = str_replace(self::$fromReplace, self::$toReplace, $ruleValue);
- if (trim($ruleValue) == '') {
- $customRuleForBlanks = true;
- $ruleValue = trim($ruleValue);
- }
- }
- $ruleValues[] = array('operator' => $rule->getOperator(), 'value' => $ruleValue);
- }
- $join = $filterColumn->getJoin();
- $columnFilterTests[$columnID] = array(
- 'method' => 'filterTestInCustomDataSet',
- 'arguments' => array('filterRules' => $ruleValues, 'join' => $join, 'customRuleForBlanks' => $customRuleForBlanks)
- );
- break;
- case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER:
- $ruleValues = array();
- foreach ($rules as $rule) {
- // We should only ever have one Dynamic Filter Rule anyway
- $dynamicRuleType = $rule->getGrouping();
- if (($dynamicRuleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE) ||
- ($dynamicRuleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_BELOWAVERAGE)) {
- // Number (Average) based
- // Calculate the average
- $averageFormula = '=AVERAGE('.$columnID.($rangeStart[1]+1).':'.$columnID.$rangeEnd[1].')';
- $average = PHPExcel_Calculation::getInstance()->calculateFormula($averageFormula, null, $this->workSheet->getCell('A1'));
- // Set above/below rule based on greaterThan or LessTan
- $operator = ($dynamicRuleType === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE)
- ? PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHAN
- : PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN;
- $ruleValues[] = array('operator' => $operator,
- 'value' => $average
- );
- $columnFilterTests[$columnID] = array(
- 'method' => 'filterTestInCustomDataSet',
- 'arguments' => array('filterRules' => $ruleValues, 'join' => PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_OR)
- );
- } else {
- // Date based
- if ($dynamicRuleType{0} == 'M' || $dynamicRuleType{0} == 'Q') {
- // Month or Quarter
- sscanf($dynamicRuleType, '%[A-Z]%d', $periodType, $period);
- if ($periodType == 'M') {
- $ruleValues = array($period);
- } else {
- --$period;
- $periodEnd = (1+$period)*3;
- $periodStart = 1+$period*3;
- $ruleValues = range($periodStart, $periodEnd);
- }
- $columnFilterTests[$columnID] = array(
- 'method' => 'filterTestInPeriodDateSet',
- 'arguments' => $ruleValues
- );
- $filterColumn->setAttributes(array());
- } else {
- // Date Range
- $columnFilterTests[$columnID] = $this->dynamicFilterDateRange($dynamicRuleType, $filterColumn);
- break;
- }
- }
- }
- break;
- case PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER:
- $ruleValues = array();
- $dataRowCount = $rangeEnd[1] - $rangeStart[1];
- foreach ($rules as $rule) {
- // We should only ever have one Dynamic Filter Rule anyway
- $toptenRuleType = $rule->getGrouping();
- $ruleValue = $rule->getValue();
- $ruleOperator = $rule->getOperator();
- }
- if ($ruleOperator === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT) {
- $ruleValue = floor($ruleValue * ($dataRowCount / 100));
- }
- if ($ruleValue < 1) {
- $ruleValue = 1;
- }
- if ($ruleValue > 500) {
- $ruleValue = 500;
- }
-
- $maxVal = $this->calculateTopTenValue($columnID, $rangeStart[1]+1, $rangeEnd[1], $toptenRuleType, $ruleValue);
-
- $operator = ($toptenRuleType == PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP)
- ? PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL
- : PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL;
- $ruleValues[] = array('operator' => $operator, 'value' => $maxVal);
- $columnFilterTests[$columnID] = array(
- 'method' => 'filterTestInCustomDataSet',
- 'arguments' => array('filterRules' => $ruleValues, 'join' => PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_OR)
- );
- $filterColumn->setAttributes(array('maxVal' => $maxVal));
- break;
- }
- }
-
-// echo 'Column Filter Test CRITERIA',PHP_EOL;
-// var_dump($columnFilterTests);
-//
- // Execute the column tests for each row in the autoFilter range to determine show/hide,
- for ($row = $rangeStart[1]+1; $row <= $rangeEnd[1]; ++$row) {
-// echo 'Testing Row = ', $row,PHP_EOL;
- $result = true;
- foreach ($columnFilterTests as $columnID => $columnFilterTest) {
-// echo 'Testing cell ', $columnID.$row,PHP_EOL;
- $cellValue = $this->workSheet->getCell($columnID.$row)->getCalculatedValue();
-// echo 'Value is ', $cellValue,PHP_EOL;
- // Execute the filter test
- $result = $result &&
- call_user_func_array(
- array('PHPExcel_Worksheet_AutoFilter', $columnFilterTest['method']),
- array($cellValue, $columnFilterTest['arguments'])
- );
-// echo (($result) ? 'VALID' : 'INVALID'),PHP_EOL;
- // If filter test has resulted in FALSE, exit the loop straightaway rather than running any more tests
- if (!$result) {
- break;
- }
- }
- // Set show/hide for the row based on the result of the autoFilter result
-// echo (($result) ? 'SHOW' : 'HIDE'),PHP_EOL;
- $this->workSheet->getRowDimension($row)->setVisible($result);
- }
-
- return $this;
- }
-
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- if ($key == 'workSheet') {
- // Detach from worksheet
- $this->{$key} = null;
- } else {
- $this->{$key} = clone $value;
- }
- } elseif ((is_array($value)) && ($key == 'columns')) {
- // The columns array of PHPExcel_Worksheet_AutoFilter objects
- $this->{$key} = array();
- foreach ($value as $k => $v) {
- $this->{$key}[$k] = clone $v;
- // attach the new cloned Column to this new cloned Autofilter object
- $this->{$key}[$k]->setParent($this);
- }
- } else {
- $this->{$key} = $value;
- }
- }
- }
-
- /**
- * toString method replicates previous behavior by returning the range if object is
- * referenced as a property of its parent.
- */
- public function __toString()
- {
- return (string) $this->range;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/AutoFilter/Column.php b/lib/phpexcel/PHPExcel/Worksheet/AutoFilter/Column.php
deleted file mode 100644
index e0769c43161..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet/AutoFilter/Column.php
+++ /dev/null
@@ -1,405 +0,0 @@
-columnIndex = $pColumn;
- $this->parent = $pParent;
- }
-
- /**
- * Get AutoFilter Column Index
- *
- * @return string
- */
- public function getColumnIndex()
- {
- return $this->columnIndex;
- }
-
- /**
- * Set AutoFilter Column Index
- *
- * @param string $pColumn Column (e.g. A)
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function setColumnIndex($pColumn)
- {
- // Uppercase coordinate
- $pColumn = strtoupper($pColumn);
- if ($this->parent !== null) {
- $this->parent->testColumnInRange($pColumn);
- }
-
- $this->columnIndex = $pColumn;
-
- return $this;
- }
-
- /**
- * Get this Column's AutoFilter Parent
- *
- * @return PHPExcel_Worksheet_AutoFilter
- */
- public function getParent()
- {
- return $this->parent;
- }
-
- /**
- * Set this Column's AutoFilter Parent
- *
- * @param PHPExcel_Worksheet_AutoFilter
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function setParent(PHPExcel_Worksheet_AutoFilter $pParent = null)
- {
- $this->parent = $pParent;
-
- return $this;
- }
-
- /**
- * Get AutoFilter Type
- *
- * @return string
- */
- public function getFilterType()
- {
- return $this->filterType;
- }
-
- /**
- * Set AutoFilter Type
- *
- * @param string $pFilterType
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function setFilterType($pFilterType = self::AUTOFILTER_FILTERTYPE_FILTER)
- {
- if (!in_array($pFilterType, self::$filterTypes)) {
- throw new PHPExcel_Exception('Invalid filter type for column AutoFilter.');
- }
-
- $this->filterType = $pFilterType;
-
- return $this;
- }
-
- /**
- * Get AutoFilter Multiple Rules And/Or Join
- *
- * @return string
- */
- public function getJoin()
- {
- return $this->join;
- }
-
- /**
- * Set AutoFilter Multiple Rules And/Or
- *
- * @param string $pJoin And/Or
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function setJoin($pJoin = self::AUTOFILTER_COLUMN_JOIN_OR)
- {
- // Lowercase And/Or
- $pJoin = strtolower($pJoin);
- if (!in_array($pJoin, self::$ruleJoins)) {
- throw new PHPExcel_Exception('Invalid rule connection for column AutoFilter.');
- }
-
- $this->join = $pJoin;
-
- return $this;
- }
-
- /**
- * Set AutoFilter Attributes
- *
- * @param string[] $pAttributes
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function setAttributes($pAttributes = array())
- {
- $this->attributes = $pAttributes;
-
- return $this;
- }
-
- /**
- * Set An AutoFilter Attribute
- *
- * @param string $pName Attribute Name
- * @param string $pValue Attribute Value
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function setAttribute($pName, $pValue)
- {
- $this->attributes[$pName] = $pValue;
-
- return $this;
- }
-
- /**
- * Get AutoFilter Column Attributes
- *
- * @return string
- */
- public function getAttributes()
- {
- return $this->attributes;
- }
-
- /**
- * Get specific AutoFilter Column Attribute
- *
- * @param string $pName Attribute Name
- * @return string
- */
- public function getAttribute($pName)
- {
- if (isset($this->attributes[$pName])) {
- return $this->attributes[$pName];
- }
- return null;
- }
-
- /**
- * Get all AutoFilter Column Rules
- *
- * @throws PHPExcel_Exception
- * @return array of PHPExcel_Worksheet_AutoFilter_Column_Rule
- */
- public function getRules()
- {
- return $this->ruleset;
- }
-
- /**
- * Get a specified AutoFilter Column Rule
- *
- * @param integer $pIndex Rule index in the ruleset array
- * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
- */
- public function getRule($pIndex)
- {
- if (!isset($this->ruleset[$pIndex])) {
- $this->ruleset[$pIndex] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this);
- }
- return $this->ruleset[$pIndex];
- }
-
- /**
- * Create a new AutoFilter Column Rule in the ruleset
- *
- * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
- */
- public function createRule()
- {
- $this->ruleset[] = new PHPExcel_Worksheet_AutoFilter_Column_Rule($this);
-
- return end($this->ruleset);
- }
-
- /**
- * Add a new AutoFilter Column Rule to the ruleset
- *
- * @param PHPExcel_Worksheet_AutoFilter_Column_Rule $pRule
- * @param boolean $returnRule Flag indicating whether the rule object or the column object should be returned
- * @return PHPExcel_Worksheet_AutoFilter_Column|PHPExcel_Worksheet_AutoFilter_Column_Rule
- */
- public function addRule(PHPExcel_Worksheet_AutoFilter_Column_Rule $pRule, $returnRule = true)
- {
- $pRule->setParent($this);
- $this->ruleset[] = $pRule;
-
- return ($returnRule) ? $pRule : $this;
- }
-
- /**
- * Delete a specified AutoFilter Column Rule
- * If the number of rules is reduced to 1, then we reset And/Or logic to Or
- *
- * @param integer $pIndex Rule index in the ruleset array
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function deleteRule($pIndex)
- {
- if (isset($this->ruleset[$pIndex])) {
- unset($this->ruleset[$pIndex]);
- // If we've just deleted down to a single rule, then reset And/Or joining to Or
- if (count($this->ruleset) <= 1) {
- $this->setJoin(self::AUTOFILTER_COLUMN_JOIN_OR);
- }
- }
-
- return $this;
- }
-
- /**
- * Delete all AutoFilter Column Rules
- *
- * @return PHPExcel_Worksheet_AutoFilter_Column
- */
- public function clearRules()
- {
- $this->ruleset = array();
- $this->setJoin(self::AUTOFILTER_COLUMN_JOIN_OR);
-
- return $this;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- if ($key == 'parent') {
- // Detach from autofilter parent
- $this->$key = null;
- } else {
- $this->$key = clone $value;
- }
- } elseif ((is_array($value)) && ($key == 'ruleset')) {
- // The columns array of PHPExcel_Worksheet_AutoFilter objects
- $this->$key = array();
- foreach ($value as $k => $v) {
- $this->{$key[$k]} = clone $v;
- // attach the new cloned Rule to this new cloned Autofilter Cloned object
- $this->{$key[$k]}->setParent($this);
- }
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/CellIterator.php b/lib/phpexcel/PHPExcel/Worksheet/CellIterator.php
deleted file mode 100644
index 151c17f534a..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet/CellIterator.php
+++ /dev/null
@@ -1,88 +0,0 @@
-subject);
- }
-
- /**
- * Get loop only existing cells
- *
- * @return boolean
- */
- public function getIterateOnlyExistingCells()
- {
- return $this->onlyExistingCells;
- }
-
- /**
- * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary
- *
- * @throws PHPExcel_Exception
- */
- abstract protected function adjustForExistingOnlyRange();
-
- /**
- * Set the iterator to loop only existing cells
- *
- * @param boolean $value
- * @throws PHPExcel_Exception
- */
- public function setIterateOnlyExistingCells($value = true)
- {
- $this->onlyExistingCells = (boolean) $value;
-
- $this->adjustForExistingOnlyRange();
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/Column.php b/lib/phpexcel/PHPExcel/Worksheet/Column.php
deleted file mode 100644
index 8c561fa8cb7..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet/Column.php
+++ /dev/null
@@ -1,86 +0,0 @@
-parent = $parent;
- $this->columnIndex = $columnIndex;
- }
-
- /**
- * Destructor
- */
- public function __destruct()
- {
- unset($this->parent);
- }
-
- /**
- * Get column index
- *
- * @return int
- */
- public function getColumnIndex()
- {
- return $this->columnIndex;
- }
-
- /**
- * Get cell iterator
- *
- * @param integer $startRow The row number at which to start iterating
- * @param integer $endRow Optionally, the row number at which to stop iterating
- * @return PHPExcel_Worksheet_CellIterator
- */
- public function getCellIterator($startRow = 1, $endRow = null)
- {
- return new PHPExcel_Worksheet_ColumnCellIterator($this->parent, $this->columnIndex, $startRow, $endRow);
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/ColumnCellIterator.php b/lib/phpexcel/PHPExcel/Worksheet/ColumnCellIterator.php
deleted file mode 100644
index 7b8c2190ae6..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet/ColumnCellIterator.php
+++ /dev/null
@@ -1,216 +0,0 @@
-subject = $subject;
- $this->columnIndex = PHPExcel_Cell::columnIndexFromString($columnIndex) - 1;
- $this->resetEnd($endRow);
- $this->resetStart($startRow);
- }
-
- /**
- * Destructor
- */
- public function __destruct()
- {
- unset($this->subject);
- }
-
- /**
- * (Re)Set the start row and the current row pointer
- *
- * @param integer $startRow The row number at which to start iterating
- * @return PHPExcel_Worksheet_ColumnCellIterator
- * @throws PHPExcel_Exception
- */
- public function resetStart($startRow = 1)
- {
- $this->startRow = $startRow;
- $this->adjustForExistingOnlyRange();
- $this->seek($startRow);
-
- return $this;
- }
-
- /**
- * (Re)Set the end row
- *
- * @param integer $endRow The row number at which to stop iterating
- * @return PHPExcel_Worksheet_ColumnCellIterator
- * @throws PHPExcel_Exception
- */
- public function resetEnd($endRow = null)
- {
- $this->endRow = ($endRow) ? $endRow : $this->subject->getHighestRow();
- $this->adjustForExistingOnlyRange();
-
- return $this;
- }
-
- /**
- * Set the row pointer to the selected row
- *
- * @param integer $row The row number to set the current pointer at
- * @return PHPExcel_Worksheet_ColumnCellIterator
- * @throws PHPExcel_Exception
- */
- public function seek($row = 1)
- {
- if (($row < $this->startRow) || ($row > $this->endRow)) {
- throw new PHPExcel_Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})");
- } elseif ($this->onlyExistingCells && !($this->subject->cellExistsByColumnAndRow($this->columnIndex, $row))) {
- throw new PHPExcel_Exception('In "IterateOnlyExistingCells" mode and Cell does not exist');
- }
- $this->position = $row;
-
- return $this;
- }
-
- /**
- * Rewind the iterator to the starting row
- */
- public function rewind()
- {
- $this->position = $this->startRow;
- }
-
- /**
- * Return the current cell in this worksheet column
- *
- * @return PHPExcel_Worksheet_Row
- */
- public function current()
- {
- return $this->subject->getCellByColumnAndRow($this->columnIndex, $this->position);
- }
-
- /**
- * Return the current iterator key
- *
- * @return int
- */
- public function key()
- {
- return $this->position;
- }
-
- /**
- * Set the iterator to its next value
- */
- public function next()
- {
- do {
- ++$this->position;
- } while (($this->onlyExistingCells) &&
- (!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->position)) &&
- ($this->position <= $this->endRow));
- }
-
- /**
- * Set the iterator to its previous value
- */
- public function prev()
- {
- if ($this->position <= $this->startRow) {
- throw new PHPExcel_Exception("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})");
- }
-
- do {
- --$this->position;
- } while (($this->onlyExistingCells) &&
- (!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->position)) &&
- ($this->position >= $this->startRow));
- }
-
- /**
- * Indicate if more rows exist in the worksheet range of rows that we're iterating
- *
- * @return boolean
- */
- public function valid()
- {
- return $this->position <= $this->endRow;
- }
-
- /**
- * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary
- *
- * @throws PHPExcel_Exception
- */
- protected function adjustForExistingOnlyRange()
- {
- if ($this->onlyExistingCells) {
- while ((!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->startRow)) &&
- ($this->startRow <= $this->endRow)) {
- ++$this->startRow;
- }
- if ($this->startRow > $this->endRow) {
- throw new PHPExcel_Exception('No cells exist within the specified range');
- }
- while ((!$this->subject->cellExistsByColumnAndRow($this->columnIndex, $this->endRow)) &&
- ($this->endRow >= $this->startRow)) {
- --$this->endRow;
- }
- if ($this->endRow < $this->startRow) {
- throw new PHPExcel_Exception('No cells exist within the specified range');
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/ColumnDimension.php b/lib/phpexcel/PHPExcel/Worksheet/ColumnDimension.php
deleted file mode 100644
index 405b8258ecd..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet/ColumnDimension.php
+++ /dev/null
@@ -1,132 +0,0 @@
-columnIndex = $pIndex;
-
- // set dimension as unformatted by default
- parent::__construct(0);
- }
-
- /**
- * Get ColumnIndex
- *
- * @return string
- */
- public function getColumnIndex()
- {
- return $this->columnIndex;
- }
-
- /**
- * Set ColumnIndex
- *
- * @param string $pValue
- * @return PHPExcel_Worksheet_ColumnDimension
- */
- public function setColumnIndex($pValue)
- {
- $this->columnIndex = $pValue;
- return $this;
- }
-
- /**
- * Get Width
- *
- * @return double
- */
- public function getWidth()
- {
- return $this->width;
- }
-
- /**
- * Set Width
- *
- * @param double $pValue
- * @return PHPExcel_Worksheet_ColumnDimension
- */
- public function setWidth($pValue = -1)
- {
- $this->width = $pValue;
- return $this;
- }
-
- /**
- * Get Auto Size
- *
- * @return bool
- */
- public function getAutoSize()
- {
- return $this->autoSize;
- }
-
- /**
- * Set Auto Size
- *
- * @param bool $pValue
- * @return PHPExcel_Worksheet_ColumnDimension
- */
- public function setAutoSize($pValue = false)
- {
- $this->autoSize = $pValue;
- return $this;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/ColumnIterator.php b/lib/phpexcel/PHPExcel/Worksheet/ColumnIterator.php
deleted file mode 100644
index 270bca65e01..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet/ColumnIterator.php
+++ /dev/null
@@ -1,193 +0,0 @@
-subject = $subject;
- $this->resetEnd($endColumn);
- $this->resetStart($startColumn);
- }
-
- /**
- * Destructor
- */
- public function __destruct()
- {
- unset($this->subject);
- }
-
- /**
- * (Re)Set the start column and the current column pointer
- *
- * @param integer $startColumn The column address at which to start iterating
- * @return PHPExcel_Worksheet_ColumnIterator
- */
- public function resetStart($startColumn = 'A')
- {
- $startColumnIndex = PHPExcel_Cell::columnIndexFromString($startColumn) - 1;
- $this->startColumn = $startColumnIndex;
- $this->seek($startColumn);
-
- return $this;
- }
-
- /**
- * (Re)Set the end column
- *
- * @param string $endColumn The column address at which to stop iterating
- * @return PHPExcel_Worksheet_ColumnIterator
- */
- public function resetEnd($endColumn = null)
- {
- $endColumn = ($endColumn) ? $endColumn : $this->subject->getHighestColumn();
- $this->endColumn = PHPExcel_Cell::columnIndexFromString($endColumn) - 1;
-
- return $this;
- }
-
- /**
- * Set the column pointer to the selected column
- *
- * @param string $column The column address to set the current pointer at
- * @return PHPExcel_Worksheet_ColumnIterator
- * @throws PHPExcel_Exception
- */
- public function seek($column = 'A')
- {
- $column = PHPExcel_Cell::columnIndexFromString($column) - 1;
- if (($column < $this->startColumn) || ($column > $this->endColumn)) {
- throw new PHPExcel_Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})");
- }
- $this->position = $column;
-
- return $this;
- }
-
- /**
- * Rewind the iterator to the starting column
- */
- public function rewind()
- {
- $this->position = $this->startColumn;
- }
-
- /**
- * Return the current column in this worksheet
- *
- * @return PHPExcel_Worksheet_Column
- */
- public function current()
- {
- return new PHPExcel_Worksheet_Column($this->subject, PHPExcel_Cell::stringFromColumnIndex($this->position));
- }
-
- /**
- * Return the current iterator key
- *
- * @return string
- */
- public function key()
- {
- return PHPExcel_Cell::stringFromColumnIndex($this->position);
- }
-
- /**
- * Set the iterator to its next value
- */
- public function next()
- {
- ++$this->position;
- }
-
- /**
- * Set the iterator to its previous value
- *
- * @throws PHPExcel_Exception
- */
- public function prev()
- {
- if ($this->position <= $this->startColumn) {
- throw new PHPExcel_Exception(
- "Column is already at the beginning of range (" .
- PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . " - " .
- PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . ")"
- );
- }
-
- --$this->position;
- }
-
- /**
- * Indicate if more columns exist in the worksheet range of columns that we're iterating
- *
- * @return boolean
- */
- public function valid()
- {
- return $this->position <= $this->endColumn;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/Drawing.php b/lib/phpexcel/PHPExcel/Worksheet/Drawing.php
deleted file mode 100644
index e39d3eb9142..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet/Drawing.php
+++ /dev/null
@@ -1,147 +0,0 @@
-path = '';
-
- // Initialize parent
- parent::__construct();
- }
-
- /**
- * Get Filename
- *
- * @return string
- */
- public function getFilename()
- {
- return basename($this->path);
- }
-
- /**
- * Get indexed filename (using image index)
- *
- * @return string
- */
- public function getIndexedFilename()
- {
- $fileName = $this->getFilename();
- $fileName = str_replace(' ', '_', $fileName);
- return str_replace('.' . $this->getExtension(), '', $fileName) . $this->getImageIndex() . '.' . $this->getExtension();
- }
-
- /**
- * Get Extension
- *
- * @return string
- */
- public function getExtension()
- {
- $exploded = explode(".", basename($this->path));
- return $exploded[count($exploded) - 1];
- }
-
- /**
- * Get Path
- *
- * @return string
- */
- public function getPath()
- {
- return $this->path;
- }
-
- /**
- * Set Path
- *
- * @param string $pValue File path
- * @param boolean $pVerifyFile Verify file
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_Drawing
- */
- public function setPath($pValue = '', $pVerifyFile = true)
- {
- if ($pVerifyFile) {
- if (file_exists($pValue)) {
- $this->path = $pValue;
-
- if ($this->width == 0 && $this->height == 0) {
- // Get width/height
- list($this->width, $this->height) = getimagesize($pValue);
- }
- } else {
- throw new PHPExcel_Exception("File $pValue not found!");
- }
- } else {
- $this->path = $pValue;
- }
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- return md5(
- $this->path .
- parent::getHashCode() .
- __CLASS__
- );
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/Drawing/Shadow.php b/lib/phpexcel/PHPExcel/Worksheet/Drawing/Shadow.php
deleted file mode 100644
index 84db91d57fc..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet/Drawing/Shadow.php
+++ /dev/null
@@ -1,296 +0,0 @@
-visible = false;
- $this->blurRadius = 6;
- $this->distance = 2;
- $this->direction = 0;
- $this->alignment = PHPExcel_Worksheet_Drawing_Shadow::SHADOW_BOTTOM_RIGHT;
- $this->color = new PHPExcel_Style_Color(PHPExcel_Style_Color::COLOR_BLACK);
- $this->alpha = 50;
- }
-
- /**
- * Get Visible
- *
- * @return boolean
- */
- public function getVisible()
- {
- return $this->visible;
- }
-
- /**
- * Set Visible
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Drawing_Shadow
- */
- public function setVisible($pValue = false)
- {
- $this->visible = $pValue;
- return $this;
- }
-
- /**
- * Get Blur radius
- *
- * @return int
- */
- public function getBlurRadius()
- {
- return $this->blurRadius;
- }
-
- /**
- * Set Blur radius
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_Drawing_Shadow
- */
- public function setBlurRadius($pValue = 6)
- {
- $this->blurRadius = $pValue;
- return $this;
- }
-
- /**
- * Get Shadow distance
- *
- * @return int
- */
- public function getDistance()
- {
- return $this->distance;
- }
-
- /**
- * Set Shadow distance
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_Drawing_Shadow
- */
- public function setDistance($pValue = 2)
- {
- $this->distance = $pValue;
- return $this;
- }
-
- /**
- * Get Shadow direction (in degrees)
- *
- * @return int
- */
- public function getDirection()
- {
- return $this->direction;
- }
-
- /**
- * Set Shadow direction (in degrees)
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_Drawing_Shadow
- */
- public function setDirection($pValue = 0)
- {
- $this->direction = $pValue;
- return $this;
- }
-
- /**
- * Get Shadow alignment
- *
- * @return int
- */
- public function getAlignment()
- {
- return $this->alignment;
- }
-
- /**
- * Set Shadow alignment
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_Drawing_Shadow
- */
- public function setAlignment($pValue = 0)
- {
- $this->alignment = $pValue;
- return $this;
- }
-
- /**
- * Get Color
- *
- * @return PHPExcel_Style_Color
- */
- public function getColor()
- {
- return $this->color;
- }
-
- /**
- * Set Color
- *
- * @param PHPExcel_Style_Color $pValue
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_Drawing_Shadow
- */
- public function setColor(PHPExcel_Style_Color $pValue = null)
- {
- $this->color = $pValue;
- return $this;
- }
-
- /**
- * Get Alpha
- *
- * @return int
- */
- public function getAlpha()
- {
- return $this->alpha;
- }
-
- /**
- * Set Alpha
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_Drawing_Shadow
- */
- public function setAlpha($pValue = 0)
- {
- $this->alpha = $pValue;
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- return md5(
- ($this->visible ? 't' : 'f') .
- $this->blurRadius .
- $this->distance .
- $this->direction .
- $this->alignment .
- $this->color->getHashCode() .
- $this->alpha .
- __CLASS__
- );
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/HeaderFooterDrawing.php b/lib/phpexcel/PHPExcel/Worksheet/HeaderFooterDrawing.php
deleted file mode 100644
index a491f4ba688..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet/HeaderFooterDrawing.php
+++ /dev/null
@@ -1,361 +0,0 @@
-path = '';
- $this->name = '';
- $this->offsetX = 0;
- $this->offsetY = 0;
- $this->width = 0;
- $this->height = 0;
- $this->resizeProportional = true;
- }
-
- /**
- * Get Name
- *
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
-
- /**
- * Set Name
- *
- * @param string $pValue
- * @return PHPExcel_Worksheet_HeaderFooterDrawing
- */
- public function setName($pValue = '')
- {
- $this->name = $pValue;
- return $this;
- }
-
- /**
- * Get OffsetX
- *
- * @return int
- */
- public function getOffsetX()
- {
- return $this->offsetX;
- }
-
- /**
- * Set OffsetX
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_HeaderFooterDrawing
- */
- public function setOffsetX($pValue = 0)
- {
- $this->offsetX = $pValue;
- return $this;
- }
-
- /**
- * Get OffsetY
- *
- * @return int
- */
- public function getOffsetY()
- {
- return $this->offsetY;
- }
-
- /**
- * Set OffsetY
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_HeaderFooterDrawing
- */
- public function setOffsetY($pValue = 0)
- {
- $this->offsetY = $pValue;
- return $this;
- }
-
- /**
- * Get Width
- *
- * @return int
- */
- public function getWidth()
- {
- return $this->width;
- }
-
- /**
- * Set Width
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_HeaderFooterDrawing
- */
- public function setWidth($pValue = 0)
- {
- // Resize proportional?
- if ($this->resizeProportional && $pValue != 0) {
- $ratio = $this->width / $this->height;
- $this->height = round($ratio * $pValue);
- }
-
- // Set width
- $this->width = $pValue;
-
- return $this;
- }
-
- /**
- * Get Height
- *
- * @return int
- */
- public function getHeight()
- {
- return $this->height;
- }
-
- /**
- * Set Height
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_HeaderFooterDrawing
- */
- public function setHeight($pValue = 0)
- {
- // Resize proportional?
- if ($this->resizeProportional && $pValue != 0) {
- $ratio = $this->width / $this->height;
- $this->width = round($ratio * $pValue);
- }
-
- // Set height
- $this->height = $pValue;
-
- return $this;
- }
-
- /**
- * Set width and height with proportional resize
- * Example:
- *
- * $objDrawing->setResizeProportional(true);
- * $objDrawing->setWidthAndHeight(160,120);
- *
- *
- * @author Vincent@luo MSN:kele_100@hotmail.com
- * @param int $width
- * @param int $height
- * @return PHPExcel_Worksheet_HeaderFooterDrawing
- */
- public function setWidthAndHeight($width = 0, $height = 0)
- {
- $xratio = $width / $this->width;
- $yratio = $height / $this->height;
- if ($this->resizeProportional && !($width == 0 || $height == 0)) {
- if (($xratio * $this->height) < $height) {
- $this->height = ceil($xratio * $this->height);
- $this->width = $width;
- } else {
- $this->width = ceil($yratio * $this->width);
- $this->height = $height;
- }
- }
- return $this;
- }
-
- /**
- * Get ResizeProportional
- *
- * @return boolean
- */
- public function getResizeProportional()
- {
- return $this->resizeProportional;
- }
-
- /**
- * Set ResizeProportional
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_HeaderFooterDrawing
- */
- public function setResizeProportional($pValue = true)
- {
- $this->resizeProportional = $pValue;
- return $this;
- }
-
- /**
- * Get Filename
- *
- * @return string
- */
- public function getFilename()
- {
- return basename($this->path);
- }
-
- /**
- * Get Extension
- *
- * @return string
- */
- public function getExtension()
- {
- $parts = explode(".", basename($this->path));
- return end($parts);
- }
-
- /**
- * Get Path
- *
- * @return string
- */
- public function getPath()
- {
- return $this->path;
- }
-
- /**
- * Set Path
- *
- * @param string $pValue File path
- * @param boolean $pVerifyFile Verify file
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_HeaderFooterDrawing
- */
- public function setPath($pValue = '', $pVerifyFile = true)
- {
- if ($pVerifyFile) {
- if (file_exists($pValue)) {
- $this->path = $pValue;
-
- if ($this->width == 0 && $this->height == 0) {
- // Get width/height
- list($this->width, $this->height) = getimagesize($pValue);
- }
- } else {
- throw new PHPExcel_Exception("File $pValue not found!");
- }
- } else {
- $this->path = $pValue;
- }
- return $this;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- return md5(
- $this->path .
- $this->name .
- $this->offsetX .
- $this->offsetY .
- $this->width .
- $this->height .
- __CLASS__
- );
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/MemoryDrawing.php b/lib/phpexcel/PHPExcel/Worksheet/MemoryDrawing.php
deleted file mode 100644
index 438ed2c58f9..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet/MemoryDrawing.php
+++ /dev/null
@@ -1,201 +0,0 @@
-imageResource = null;
- $this->renderingFunction = self::RENDERING_DEFAULT;
- $this->mimeType = self::MIMETYPE_DEFAULT;
- $this->uniqueName = md5(rand(0, 9999). time() . rand(0, 9999));
-
- // Initialize parent
- parent::__construct();
- }
-
- /**
- * Get image resource
- *
- * @return resource
- */
- public function getImageResource()
- {
- return $this->imageResource;
- }
-
- /**
- * Set image resource
- *
- * @param $value resource
- * @return PHPExcel_Worksheet_MemoryDrawing
- */
- public function setImageResource($value = null)
- {
- $this->imageResource = $value;
-
- if (!is_null($this->imageResource)) {
- // Get width/height
- $this->width = imagesx($this->imageResource);
- $this->height = imagesy($this->imageResource);
- }
- return $this;
- }
-
- /**
- * Get rendering function
- *
- * @return string
- */
- public function getRenderingFunction()
- {
- return $this->renderingFunction;
- }
-
- /**
- * Set rendering function
- *
- * @param string $value
- * @return PHPExcel_Worksheet_MemoryDrawing
- */
- public function setRenderingFunction($value = PHPExcel_Worksheet_MemoryDrawing::RENDERING_DEFAULT)
- {
- $this->renderingFunction = $value;
- return $this;
- }
-
- /**
- * Get mime type
- *
- * @return string
- */
- public function getMimeType()
- {
- return $this->mimeType;
- }
-
- /**
- * Set mime type
- *
- * @param string $value
- * @return PHPExcel_Worksheet_MemoryDrawing
- */
- public function setMimeType($value = PHPExcel_Worksheet_MemoryDrawing::MIMETYPE_DEFAULT)
- {
- $this->mimeType = $value;
- return $this;
- }
-
- /**
- * Get indexed filename (using image index)
- *
- * @return string
- */
- public function getIndexedFilename()
- {
- $extension = strtolower($this->getMimeType());
- $extension = explode('/', $extension);
- $extension = $extension[1];
-
- return $this->uniqueName . $this->getImageIndex() . '.' . $extension;
- }
-
- /**
- * Get hash code
- *
- * @return string Hash code
- */
- public function getHashCode()
- {
- return md5(
- $this->renderingFunction .
- $this->mimeType .
- $this->uniqueName .
- parent::getHashCode() .
- __CLASS__
- );
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/PageMargins.php b/lib/phpexcel/PHPExcel/Worksheet/PageMargins.php
deleted file mode 100644
index 70f5ee0f551..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet/PageMargins.php
+++ /dev/null
@@ -1,233 +0,0 @@
-left;
- }
-
- /**
- * Set Left
- *
- * @param double $pValue
- * @return PHPExcel_Worksheet_PageMargins
- */
- public function setLeft($pValue)
- {
- $this->left = $pValue;
- return $this;
- }
-
- /**
- * Get Right
- *
- * @return double
- */
- public function getRight()
- {
- return $this->right;
- }
-
- /**
- * Set Right
- *
- * @param double $pValue
- * @return PHPExcel_Worksheet_PageMargins
- */
- public function setRight($pValue)
- {
- $this->right = $pValue;
- return $this;
- }
-
- /**
- * Get Top
- *
- * @return double
- */
- public function getTop()
- {
- return $this->top;
- }
-
- /**
- * Set Top
- *
- * @param double $pValue
- * @return PHPExcel_Worksheet_PageMargins
- */
- public function setTop($pValue)
- {
- $this->top = $pValue;
- return $this;
- }
-
- /**
- * Get Bottom
- *
- * @return double
- */
- public function getBottom()
- {
- return $this->bottom;
- }
-
- /**
- * Set Bottom
- *
- * @param double $pValue
- * @return PHPExcel_Worksheet_PageMargins
- */
- public function setBottom($pValue)
- {
- $this->bottom = $pValue;
- return $this;
- }
-
- /**
- * Get Header
- *
- * @return double
- */
- public function getHeader()
- {
- return $this->header;
- }
-
- /**
- * Set Header
- *
- * @param double $pValue
- * @return PHPExcel_Worksheet_PageMargins
- */
- public function setHeader($pValue)
- {
- $this->header = $pValue;
- return $this;
- }
-
- /**
- * Get Footer
- *
- * @return double
- */
- public function getFooter()
- {
- return $this->footer;
- }
-
- /**
- * Set Footer
- *
- * @param double $pValue
- * @return PHPExcel_Worksheet_PageMargins
- */
- public function setFooter($pValue)
- {
- $this->footer = $pValue;
- return $this;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/Protection.php b/lib/phpexcel/PHPExcel/Worksheet/Protection.php
deleted file mode 100644
index 00633eeb7e2..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet/Protection.php
+++ /dev/null
@@ -1,581 +0,0 @@
-sheet ||
- $this->objects ||
- $this->scenarios ||
- $this->formatCells ||
- $this->formatColumns ||
- $this->formatRows ||
- $this->insertColumns ||
- $this->insertRows ||
- $this->insertHyperlinks ||
- $this->deleteColumns ||
- $this->deleteRows ||
- $this->selectLockedCells ||
- $this->sort ||
- $this->autoFilter ||
- $this->pivotTables ||
- $this->selectUnlockedCells;
- }
-
- /**
- * Get Sheet
- *
- * @return boolean
- */
- public function getSheet()
- {
- return $this->sheet;
- }
-
- /**
- * Set Sheet
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- public function setSheet($pValue = false)
- {
- $this->sheet = $pValue;
- return $this;
- }
-
- /**
- * Get Objects
- *
- * @return boolean
- */
- public function getObjects()
- {
- return $this->objects;
- }
-
- /**
- * Set Objects
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- public function setObjects($pValue = false)
- {
- $this->objects = $pValue;
- return $this;
- }
-
- /**
- * Get Scenarios
- *
- * @return boolean
- */
- public function getScenarios()
- {
- return $this->scenarios;
- }
-
- /**
- * Set Scenarios
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- public function setScenarios($pValue = false)
- {
- $this->scenarios = $pValue;
- return $this;
- }
-
- /**
- * Get FormatCells
- *
- * @return boolean
- */
- public function getFormatCells()
- {
- return $this->formatCells;
- }
-
- /**
- * Set FormatCells
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- public function setFormatCells($pValue = false)
- {
- $this->formatCells = $pValue;
- return $this;
- }
-
- /**
- * Get FormatColumns
- *
- * @return boolean
- */
- public function getFormatColumns()
- {
- return $this->formatColumns;
- }
-
- /**
- * Set FormatColumns
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- public function setFormatColumns($pValue = false)
- {
- $this->formatColumns = $pValue;
- return $this;
- }
-
- /**
- * Get FormatRows
- *
- * @return boolean
- */
- public function getFormatRows()
- {
- return $this->formatRows;
- }
-
- /**
- * Set FormatRows
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- public function setFormatRows($pValue = false)
- {
- $this->formatRows = $pValue;
- return $this;
- }
-
- /**
- * Get InsertColumns
- *
- * @return boolean
- */
- public function getInsertColumns()
- {
- return $this->insertColumns;
- }
-
- /**
- * Set InsertColumns
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- public function setInsertColumns($pValue = false)
- {
- $this->insertColumns = $pValue;
- return $this;
- }
-
- /**
- * Get InsertRows
- *
- * @return boolean
- */
- public function getInsertRows()
- {
- return $this->insertRows;
- }
-
- /**
- * Set InsertRows
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- public function setInsertRows($pValue = false)
- {
- $this->insertRows = $pValue;
- return $this;
- }
-
- /**
- * Get InsertHyperlinks
- *
- * @return boolean
- */
- public function getInsertHyperlinks()
- {
- return $this->insertHyperlinks;
- }
-
- /**
- * Set InsertHyperlinks
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- public function setInsertHyperlinks($pValue = false)
- {
- $this->insertHyperlinks = $pValue;
- return $this;
- }
-
- /**
- * Get DeleteColumns
- *
- * @return boolean
- */
- public function getDeleteColumns()
- {
- return $this->deleteColumns;
- }
-
- /**
- * Set DeleteColumns
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- public function setDeleteColumns($pValue = false)
- {
- $this->deleteColumns = $pValue;
- return $this;
- }
-
- /**
- * Get DeleteRows
- *
- * @return boolean
- */
- public function getDeleteRows()
- {
- return $this->deleteRows;
- }
-
- /**
- * Set DeleteRows
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- public function setDeleteRows($pValue = false)
- {
- $this->deleteRows = $pValue;
- return $this;
- }
-
- /**
- * Get SelectLockedCells
- *
- * @return boolean
- */
- public function getSelectLockedCells()
- {
- return $this->selectLockedCells;
- }
-
- /**
- * Set SelectLockedCells
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- public function setSelectLockedCells($pValue = false)
- {
- $this->selectLockedCells = $pValue;
- return $this;
- }
-
- /**
- * Get Sort
- *
- * @return boolean
- */
- public function getSort()
- {
- return $this->sort;
- }
-
- /**
- * Set Sort
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- public function setSort($pValue = false)
- {
- $this->sort = $pValue;
- return $this;
- }
-
- /**
- * Get AutoFilter
- *
- * @return boolean
- */
- public function getAutoFilter()
- {
- return $this->autoFilter;
- }
-
- /**
- * Set AutoFilter
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- public function setAutoFilter($pValue = false)
- {
- $this->autoFilter = $pValue;
- return $this;
- }
-
- /**
- * Get PivotTables
- *
- * @return boolean
- */
- public function getPivotTables()
- {
- return $this->pivotTables;
- }
-
- /**
- * Set PivotTables
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- public function setPivotTables($pValue = false)
- {
- $this->pivotTables = $pValue;
- return $this;
- }
-
- /**
- * Get SelectUnlockedCells
- *
- * @return boolean
- */
- public function getSelectUnlockedCells()
- {
- return $this->selectUnlockedCells;
- }
-
- /**
- * Set SelectUnlockedCells
- *
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_Protection
- */
- public function setSelectUnlockedCells($pValue = false)
- {
- $this->selectUnlockedCells = $pValue;
- return $this;
- }
-
- /**
- * Get Password (hashed)
- *
- * @return string
- */
- public function getPassword()
- {
- return $this->password;
- }
-
- /**
- * Set Password
- *
- * @param string $pValue
- * @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
- * @return PHPExcel_Worksheet_Protection
- */
- public function setPassword($pValue = '', $pAlreadyHashed = false)
- {
- if (!$pAlreadyHashed) {
- $pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue);
- }
- $this->password = $pValue;
- return $this;
- }
-
- /**
- * Implement PHP __clone to create a deep clone, not just a shallow copy.
- */
- public function __clone()
- {
- $vars = get_object_vars($this);
- foreach ($vars as $key => $value) {
- if (is_object($value)) {
- $this->$key = clone $value;
- } else {
- $this->$key = $value;
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/Row.php b/lib/phpexcel/PHPExcel/Worksheet/Row.php
deleted file mode 100644
index 4f6034f53ae..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet/Row.php
+++ /dev/null
@@ -1,86 +0,0 @@
-parent = $parent;
- $this->rowIndex = $rowIndex;
- }
-
- /**
- * Destructor
- */
- public function __destruct()
- {
- unset($this->parent);
- }
-
- /**
- * Get row index
- *
- * @return int
- */
- public function getRowIndex()
- {
- return $this->rowIndex;
- }
-
- /**
- * Get cell iterator
- *
- * @param string $startColumn The column address at which to start iterating
- * @param string $endColumn Optionally, the column address at which to stop iterating
- * @return PHPExcel_Worksheet_CellIterator
- */
- public function getCellIterator($startColumn = 'A', $endColumn = null)
- {
- return new PHPExcel_Worksheet_RowCellIterator($this->parent, $this->rowIndex, $startColumn, $endColumn);
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/RowCellIterator.php b/lib/phpexcel/PHPExcel/Worksheet/RowCellIterator.php
deleted file mode 100644
index 90eb9c9f2f3..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet/RowCellIterator.php
+++ /dev/null
@@ -1,225 +0,0 @@
-subject = $subject;
- $this->rowIndex = $rowIndex;
- $this->resetEnd($endColumn);
- $this->resetStart($startColumn);
- }
-
- /**
- * Destructor
- */
- public function __destruct()
- {
- unset($this->subject);
- }
-
- /**
- * (Re)Set the start column and the current column pointer
- *
- * @param integer $startColumn The column address at which to start iterating
- * @return PHPExcel_Worksheet_RowCellIterator
- * @throws PHPExcel_Exception
- */
- public function resetStart($startColumn = 'A')
- {
- $startColumnIndex = PHPExcel_Cell::columnIndexFromString($startColumn) - 1;
- $this->startColumn = $startColumnIndex;
- $this->adjustForExistingOnlyRange();
- $this->seek(PHPExcel_Cell::stringFromColumnIndex($this->startColumn));
-
- return $this;
- }
-
- /**
- * (Re)Set the end column
- *
- * @param string $endColumn The column address at which to stop iterating
- * @return PHPExcel_Worksheet_RowCellIterator
- * @throws PHPExcel_Exception
- */
- public function resetEnd($endColumn = null)
- {
- $endColumn = ($endColumn) ? $endColumn : $this->subject->getHighestColumn();
- $this->endColumn = PHPExcel_Cell::columnIndexFromString($endColumn) - 1;
- $this->adjustForExistingOnlyRange();
-
- return $this;
- }
-
- /**
- * Set the column pointer to the selected column
- *
- * @param string $column The column address to set the current pointer at
- * @return PHPExcel_Worksheet_RowCellIterator
- * @throws PHPExcel_Exception
- */
- public function seek($column = 'A')
- {
- $column = PHPExcel_Cell::columnIndexFromString($column) - 1;
- if (($column < $this->startColumn) || ($column > $this->endColumn)) {
- throw new PHPExcel_Exception("Column $column is out of range ({$this->startColumn} - {$this->endColumn})");
- } elseif ($this->onlyExistingCells && !($this->subject->cellExistsByColumnAndRow($column, $this->rowIndex))) {
- throw new PHPExcel_Exception('In "IterateOnlyExistingCells" mode and Cell does not exist');
- }
- $this->position = $column;
-
- return $this;
- }
-
- /**
- * Rewind the iterator to the starting column
- */
- public function rewind()
- {
- $this->position = $this->startColumn;
- }
-
- /**
- * Return the current cell in this worksheet row
- *
- * @return PHPExcel_Cell
- */
- public function current()
- {
- return $this->subject->getCellByColumnAndRow($this->position, $this->rowIndex);
- }
-
- /**
- * Return the current iterator key
- *
- * @return string
- */
- public function key()
- {
- return PHPExcel_Cell::stringFromColumnIndex($this->position);
- }
-
- /**
- * Set the iterator to its next value
- */
- public function next()
- {
- do {
- ++$this->position;
- } while (($this->onlyExistingCells) &&
- (!$this->subject->cellExistsByColumnAndRow($this->position, $this->rowIndex)) &&
- ($this->position <= $this->endColumn));
- }
-
- /**
- * Set the iterator to its previous value
- *
- * @throws PHPExcel_Exception
- */
- public function prev()
- {
- if ($this->position <= $this->startColumn) {
- throw new PHPExcel_Exception(
- "Column is already at the beginning of range (" .
- PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . " - " .
- PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . ")"
- );
- }
-
- do {
- --$this->position;
- } while (($this->onlyExistingCells) &&
- (!$this->subject->cellExistsByColumnAndRow($this->position, $this->rowIndex)) &&
- ($this->position >= $this->startColumn));
- }
-
- /**
- * Indicate if more columns exist in the worksheet range of columns that we're iterating
- *
- * @return boolean
- */
- public function valid()
- {
- return $this->position <= $this->endColumn;
- }
-
- /**
- * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary
- *
- * @throws PHPExcel_Exception
- */
- protected function adjustForExistingOnlyRange()
- {
- if ($this->onlyExistingCells) {
- while ((!$this->subject->cellExistsByColumnAndRow($this->startColumn, $this->rowIndex)) &&
- ($this->startColumn <= $this->endColumn)) {
- ++$this->startColumn;
- }
- if ($this->startColumn > $this->endColumn) {
- throw new PHPExcel_Exception('No cells exist within the specified range');
- }
- while ((!$this->subject->cellExistsByColumnAndRow($this->endColumn, $this->rowIndex)) &&
- ($this->endColumn >= $this->startColumn)) {
- --$this->endColumn;
- }
- if ($this->endColumn < $this->startColumn) {
- throw new PHPExcel_Exception('No cells exist within the specified range');
- }
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/RowDimension.php b/lib/phpexcel/PHPExcel/Worksheet/RowDimension.php
deleted file mode 100644
index c1474862c48..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet/RowDimension.php
+++ /dev/null
@@ -1,132 +0,0 @@
-rowIndex = $pIndex;
-
- // set dimension as unformatted by default
- parent::__construct(null);
- }
-
- /**
- * Get Row Index
- *
- * @return int
- */
- public function getRowIndex()
- {
- return $this->rowIndex;
- }
-
- /**
- * Set Row Index
- *
- * @param int $pValue
- * @return PHPExcel_Worksheet_RowDimension
- */
- public function setRowIndex($pValue)
- {
- $this->rowIndex = $pValue;
- return $this;
- }
-
- /**
- * Get Row Height
- *
- * @return double
- */
- public function getRowHeight()
- {
- return $this->height;
- }
-
- /**
- * Set Row Height
- *
- * @param double $pValue
- * @return PHPExcel_Worksheet_RowDimension
- */
- public function setRowHeight($pValue = -1)
- {
- $this->height = $pValue;
- return $this;
- }
-
- /**
- * Get ZeroHeight
- *
- * @return bool
- */
- public function getZeroHeight()
- {
- return $this->zeroHeight;
- }
-
- /**
- * Set ZeroHeight
- *
- * @param bool $pValue
- * @return PHPExcel_Worksheet_RowDimension
- */
- public function setZeroHeight($pValue = false)
- {
- $this->zeroHeight = $pValue;
- return $this;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/RowIterator.php b/lib/phpexcel/PHPExcel/Worksheet/RowIterator.php
deleted file mode 100644
index 6c88d50c751..00000000000
--- a/lib/phpexcel/PHPExcel/Worksheet/RowIterator.php
+++ /dev/null
@@ -1,184 +0,0 @@
-subject = $subject;
- $this->resetEnd($endRow);
- $this->resetStart($startRow);
- }
-
- /**
- * Destructor
- */
- public function __destruct()
- {
- unset($this->subject);
- }
-
- /**
- * (Re)Set the start row and the current row pointer
- *
- * @param integer $startRow The row number at which to start iterating
- * @return PHPExcel_Worksheet_RowIterator
- */
- public function resetStart($startRow = 1)
- {
- $this->startRow = $startRow;
- $this->seek($startRow);
-
- return $this;
- }
-
- /**
- * (Re)Set the end row
- *
- * @param integer $endRow The row number at which to stop iterating
- * @return PHPExcel_Worksheet_RowIterator
- */
- public function resetEnd($endRow = null)
- {
- $this->endRow = ($endRow) ? $endRow : $this->subject->getHighestRow();
-
- return $this;
- }
-
- /**
- * Set the row pointer to the selected row
- *
- * @param integer $row The row number to set the current pointer at
- * @return PHPExcel_Worksheet_RowIterator
- * @throws PHPExcel_Exception
- */
- public function seek($row = 1)
- {
- if (($row < $this->startRow) || ($row > $this->endRow)) {
- throw new PHPExcel_Exception("Row $row is out of range ({$this->startRow} - {$this->endRow})");
- }
- $this->position = $row;
-
- return $this;
- }
-
- /**
- * Rewind the iterator to the starting row
- */
- public function rewind()
- {
- $this->position = $this->startRow;
- }
-
- /**
- * Return the current row in this worksheet
- *
- * @return PHPExcel_Worksheet_Row
- */
- public function current()
- {
- return new PHPExcel_Worksheet_Row($this->subject, $this->position);
- }
-
- /**
- * Return the current iterator key
- *
- * @return int
- */
- public function key()
- {
- return $this->position;
- }
-
- /**
- * Set the iterator to its next value
- */
- public function next()
- {
- ++$this->position;
- }
-
- /**
- * Set the iterator to its previous value
- */
- public function prev()
- {
- if ($this->position <= $this->startRow) {
- throw new PHPExcel_Exception("Row is already at the beginning of range ({$this->startRow} - {$this->endRow})");
- }
-
- --$this->position;
- }
-
- /**
- * Indicate if more rows exist in the worksheet range of rows that we're iterating
- *
- * @return boolean
- */
- public function valid()
- {
- return $this->position <= $this->endRow;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/WorksheetIterator.php b/lib/phpexcel/PHPExcel/WorksheetIterator.php
deleted file mode 100644
index cb1b28118d1..00000000000
--- a/lib/phpexcel/PHPExcel/WorksheetIterator.php
+++ /dev/null
@@ -1,108 +0,0 @@
-subject = $subject;
- }
-
- /**
- * Destructor
- */
- public function __destruct()
- {
- unset($this->subject);
- }
-
- /**
- * Rewind iterator
- */
- public function rewind()
- {
- $this->position = 0;
- }
-
- /**
- * Current PHPExcel_Worksheet
- *
- * @return PHPExcel_Worksheet
- */
- public function current()
- {
- return $this->subject->getSheet($this->position);
- }
-
- /**
- * Current key
- *
- * @return int
- */
- public function key()
- {
- return $this->position;
- }
-
- /**
- * Next value
- */
- public function next()
- {
- ++$this->position;
- }
-
- /**
- * More PHPExcel_Worksheet instances available?
- *
- * @return boolean
- */
- public function valid()
- {
- return $this->position < $this->subject->getSheetCount();
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/Abstract.php b/lib/phpexcel/PHPExcel/Writer/Abstract.php
deleted file mode 100644
index 2a797a948fb..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/Abstract.php
+++ /dev/null
@@ -1,157 +0,0 @@
-includeCharts;
- }
-
- /**
- * Set write charts in workbook
- * Set to true, to advise the Writer to include any charts that exist in the PHPExcel object.
- * Set to false (the default) to ignore charts.
- *
- * @param boolean $pValue
- * @return PHPExcel_Writer_IWriter
- */
- public function setIncludeCharts($pValue = false)
- {
- $this->includeCharts = (boolean) $pValue;
- return $this;
- }
-
- /**
- * Get Pre-Calculate Formulas flag
- * If this is true (the default), then the writer will recalculate all formulae in a workbook when saving,
- * so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet
- * viewer when opening the file
- * If false, then formulae are not calculated on save. This is faster for saving in PHPExcel, but slower
- * when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself
- *
- * @return boolean
- */
- public function getPreCalculateFormulas()
- {
- return $this->preCalculateFormulas;
- }
-
- /**
- * Set Pre-Calculate Formulas
- * Set to true (the default) to advise the Writer to calculate all formulae on save
- * Set to false to prevent precalculation of formulae on save.
- *
- * @param boolean $pValue Pre-Calculate Formulas?
- * @return PHPExcel_Writer_IWriter
- */
- public function setPreCalculateFormulas($pValue = true)
- {
- $this->preCalculateFormulas = (boolean) $pValue;
- return $this;
- }
-
- /**
- * Get use disk caching where possible?
- *
- * @return boolean
- */
- public function getUseDiskCaching()
- {
- return $this->_useDiskCaching;
- }
-
- /**
- * Set use disk caching where possible?
- *
- * @param boolean $pValue
- * @param string $pDirectory Disk caching directory
- * @throws PHPExcel_Writer_Exception when directory does not exist
- * @return PHPExcel_Writer_Excel2007
- */
- public function setUseDiskCaching($pValue = false, $pDirectory = null)
- {
- $this->_useDiskCaching = $pValue;
-
- if ($pDirectory !== null) {
- if (is_dir($pDirectory)) {
- $this->_diskCachingDirectory = $pDirectory;
- } else {
- throw new PHPExcel_Writer_Exception("Directory does not exist: $pDirectory");
- }
- }
- return $this;
- }
-
- /**
- * Get disk caching directory
- *
- * @return string
- */
- public function getDiskCachingDirectory()
- {
- return $this->_diskCachingDirectory;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/CSV.php b/lib/phpexcel/PHPExcel/Writer/CSV.php
deleted file mode 100644
index 31ca874b615..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/CSV.php
+++ /dev/null
@@ -1,317 +0,0 @@
-phpExcel = $phpExcel;
- }
-
- /**
- * Save PHPExcel to file
- *
- * @param string $pFilename
- * @throws PHPExcel_Writer_Exception
- */
- public function save($pFilename = null)
- {
- // Fetch sheet
- $sheet = $this->phpExcel->getSheet($this->sheetIndex);
-
- $saveDebugLog = PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->getWriteDebugLog();
- PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog(false);
- $saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType();
- PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
-
- // Open file
- $fileHandle = fopen($pFilename, 'wb+');
- if ($fileHandle === false) {
- throw new PHPExcel_Writer_Exception("Could not open file $pFilename for writing.");
- }
-
- if ($this->excelCompatibility) {
- fwrite($fileHandle, "\xEF\xBB\xBF"); // Enforce UTF-8 BOM Header
- $this->setEnclosure('"'); // Set enclosure to "
- $this->setDelimiter(";"); // Set delimiter to a semi-colon
- $this->setLineEnding("\r\n");
- fwrite($fileHandle, 'sep=' . $this->getDelimiter() . $this->lineEnding);
- } elseif ($this->useBOM) {
- // Write the UTF-8 BOM code if required
- fwrite($fileHandle, "\xEF\xBB\xBF");
- }
-
- // Identify the range that we need to extract from the worksheet
- $maxCol = $sheet->getHighestDataColumn();
- $maxRow = $sheet->getHighestDataRow();
-
- // Write rows to file
- for ($row = 1; $row <= $maxRow; ++$row) {
- // Convert the row to an array...
- $cellsArray = $sheet->rangeToArray('A'.$row.':'.$maxCol.$row, '', $this->preCalculateFormulas);
- // ... and write to the file
- $this->writeLine($fileHandle, $cellsArray[0]);
- }
-
- // Close file
- fclose($fileHandle);
-
- PHPExcel_Calculation::setArrayReturnType($saveArrayReturnType);
- PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog($saveDebugLog);
- }
-
- /**
- * Get delimiter
- *
- * @return string
- */
- public function getDelimiter()
- {
- return $this->delimiter;
- }
-
- /**
- * Set delimiter
- *
- * @param string $pValue Delimiter, defaults to ,
- * @return PHPExcel_Writer_CSV
- */
- public function setDelimiter($pValue = ',')
- {
- $this->delimiter = $pValue;
- return $this;
- }
-
- /**
- * Get enclosure
- *
- * @return string
- */
- public function getEnclosure()
- {
- return $this->enclosure;
- }
-
- /**
- * Set enclosure
- *
- * @param string $pValue Enclosure, defaults to "
- * @return PHPExcel_Writer_CSV
- */
- public function setEnclosure($pValue = '"')
- {
- if ($pValue == '') {
- $pValue = null;
- }
- $this->enclosure = $pValue;
- return $this;
- }
-
- /**
- * Get line ending
- *
- * @return string
- */
- public function getLineEnding()
- {
- return $this->lineEnding;
- }
-
- /**
- * Set line ending
- *
- * @param string $pValue Line ending, defaults to OS line ending (PHP_EOL)
- * @return PHPExcel_Writer_CSV
- */
- public function setLineEnding($pValue = PHP_EOL)
- {
- $this->lineEnding = $pValue;
- return $this;
- }
-
- /**
- * Get whether BOM should be used
- *
- * @return boolean
- */
- public function getUseBOM()
- {
- return $this->useBOM;
- }
-
- /**
- * Set whether BOM should be used
- *
- * @param boolean $pValue Use UTF-8 byte-order mark? Defaults to false
- * @return PHPExcel_Writer_CSV
- */
- public function setUseBOM($pValue = false)
- {
- $this->useBOM = $pValue;
- return $this;
- }
-
- /**
- * Get whether the file should be saved with full Excel Compatibility
- *
- * @return boolean
- */
- public function getExcelCompatibility()
- {
- return $this->excelCompatibility;
- }
-
- /**
- * Set whether the file should be saved with full Excel Compatibility
- *
- * @param boolean $pValue Set the file to be written as a fully Excel compatible csv file
- * Note that this overrides other settings such as useBOM, enclosure and delimiter
- * @return PHPExcel_Writer_CSV
- */
- public function setExcelCompatibility($pValue = false)
- {
- $this->excelCompatibility = $pValue;
- return $this;
- }
-
- /**
- * Get sheet index
- *
- * @return int
- */
- public function getSheetIndex()
- {
- return $this->sheetIndex;
- }
-
- /**
- * Set sheet index
- *
- * @param int $pValue Sheet index
- * @return PHPExcel_Writer_CSV
- */
- public function setSheetIndex($pValue = 0)
- {
- $this->sheetIndex = $pValue;
- return $this;
- }
-
- /**
- * Write line to CSV file
- *
- * @param mixed $pFileHandle PHP filehandle
- * @param array $pValues Array containing values in a row
- * @throws PHPExcel_Writer_Exception
- */
- private function writeLine($pFileHandle = null, $pValues = null)
- {
- if (is_array($pValues)) {
- // No leading delimiter
- $writeDelimiter = false;
-
- // Build the line
- $line = '';
-
- foreach ($pValues as $element) {
- // Escape enclosures
- $element = str_replace($this->enclosure, $this->enclosure . $this->enclosure, $element);
-
- // Add delimiter
- if ($writeDelimiter) {
- $line .= $this->delimiter;
- } else {
- $writeDelimiter = true;
- }
-
- // Add enclosed string
- $line .= $this->enclosure . $element . $this->enclosure;
- }
-
- // Add line ending
- $line .= $this->lineEnding;
-
- // Write to file
- fwrite($pFileHandle, $line);
- } else {
- throw new PHPExcel_Writer_Exception("Invalid data row passed to CSV writer.");
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/Excel2007.php b/lib/phpexcel/PHPExcel/Writer/Excel2007.php
deleted file mode 100644
index 8f2eaa00021..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/Excel2007.php
+++ /dev/null
@@ -1,533 +0,0 @@
-setPHPExcel($pPHPExcel);
-
- $writerPartsArray = array( 'stringtable' => 'PHPExcel_Writer_Excel2007_StringTable',
- 'contenttypes' => 'PHPExcel_Writer_Excel2007_ContentTypes',
- 'docprops' => 'PHPExcel_Writer_Excel2007_DocProps',
- 'rels' => 'PHPExcel_Writer_Excel2007_Rels',
- 'theme' => 'PHPExcel_Writer_Excel2007_Theme',
- 'style' => 'PHPExcel_Writer_Excel2007_Style',
- 'workbook' => 'PHPExcel_Writer_Excel2007_Workbook',
- 'worksheet' => 'PHPExcel_Writer_Excel2007_Worksheet',
- 'drawing' => 'PHPExcel_Writer_Excel2007_Drawing',
- 'comments' => 'PHPExcel_Writer_Excel2007_Comments',
- 'chart' => 'PHPExcel_Writer_Excel2007_Chart',
- 'relsvba' => 'PHPExcel_Writer_Excel2007_RelsVBA',
- 'relsribbonobjects' => 'PHPExcel_Writer_Excel2007_RelsRibbon'
- );
-
- // Initialise writer parts
- // and Assign their parent IWriters
- foreach ($writerPartsArray as $writer => $class) {
- $this->writerParts[$writer] = new $class($this);
- }
-
- $hashTablesArray = array( 'stylesConditionalHashTable', 'fillHashTable', 'fontHashTable',
- 'bordersHashTable', 'numFmtHashTable', 'drawingHashTable',
- 'styleHashTable'
- );
-
- // Set HashTable variables
- foreach ($hashTablesArray as $tableName) {
- $this->$tableName = new PHPExcel_HashTable();
- }
- }
-
- /**
- * Get writer part
- *
- * @param string $pPartName Writer part name
- * @return PHPExcel_Writer_Excel2007_WriterPart
- */
- public function getWriterPart($pPartName = '')
- {
- if ($pPartName != '' && isset($this->writerParts[strtolower($pPartName)])) {
- return $this->writerParts[strtolower($pPartName)];
- } else {
- return null;
- }
- }
-
- /**
- * Save PHPExcel to file
- *
- * @param string $pFilename
- * @throws PHPExcel_Writer_Exception
- */
- public function save($pFilename = null)
- {
- if ($this->spreadSheet !== null) {
- // garbage collect
- $this->spreadSheet->garbageCollect();
-
- // If $pFilename is php://output or php://stdout, make it a temporary file...
- $originalFilename = $pFilename;
- if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') {
- $pFilename = @tempnam(PHPExcel_Shared_File::sys_get_temp_dir(), 'phpxltmp');
- if ($pFilename == '') {
- $pFilename = $originalFilename;
- }
- }
-
- $saveDebugLog = PHPExcel_Calculation::getInstance($this->spreadSheet)->getDebugLog()->getWriteDebugLog();
- PHPExcel_Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog(false);
- $saveDateReturnType = PHPExcel_Calculation_Functions::getReturnDateType();
- PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
-
- // Create string lookup table
- $this->stringTable = array();
- for ($i = 0; $i < $this->spreadSheet->getSheetCount(); ++$i) {
- $this->stringTable = $this->getWriterPart('StringTable')->createStringTable($this->spreadSheet->getSheet($i), $this->stringTable);
- }
-
- // Create styles dictionaries
- $this->styleHashTable->addFromSource($this->getWriterPart('Style')->allStyles($this->spreadSheet));
- $this->stylesConditionalHashTable->addFromSource($this->getWriterPart('Style')->allConditionalStyles($this->spreadSheet));
- $this->fillHashTable->addFromSource($this->getWriterPart('Style')->allFills($this->spreadSheet));
- $this->fontHashTable->addFromSource($this->getWriterPart('Style')->allFonts($this->spreadSheet));
- $this->bordersHashTable->addFromSource($this->getWriterPart('Style')->allBorders($this->spreadSheet));
- $this->numFmtHashTable->addFromSource($this->getWriterPart('Style')->allNumberFormats($this->spreadSheet));
-
- // Create drawing dictionary
- $this->drawingHashTable->addFromSource($this->getWriterPart('Drawing')->allDrawings($this->spreadSheet));
-
- // Create new ZIP file and open it for writing
- $zipClass = PHPExcel_Settings::getZipClass();
- $objZip = new $zipClass();
-
- // Retrieve OVERWRITE and CREATE constants from the instantiated zip class
- // This method of accessing constant values from a dynamic class should work with all appropriate versions of PHP
- $ro = new ReflectionObject($objZip);
- $zipOverWrite = $ro->getConstant('OVERWRITE');
- $zipCreate = $ro->getConstant('CREATE');
-
- if (file_exists($pFilename)) {
- unlink($pFilename);
- }
- // Try opening the ZIP file
- if ($objZip->open($pFilename, $zipOverWrite) !== true) {
- if ($objZip->open($pFilename, $zipCreate) !== true) {
- throw new PHPExcel_Writer_Exception("Could not open " . $pFilename . " for writing.");
- }
- }
-
- // Add [Content_Types].xml to ZIP file
- $objZip->addFromString('[Content_Types].xml', $this->getWriterPart('ContentTypes')->writeContentTypes($this->spreadSheet, $this->includeCharts));
-
- //if hasMacros, add the vbaProject.bin file, Certificate file(if exists)
- if ($this->spreadSheet->hasMacros()) {
- $macrosCode=$this->spreadSheet->getMacrosCode();
- if (!is_null($macrosCode)) {// we have the code ?
- $objZip->addFromString('xl/vbaProject.bin', $macrosCode);//allways in 'xl', allways named vbaProject.bin
- if ($this->spreadSheet->hasMacrosCertificate()) {//signed macros ?
- // Yes : add the certificate file and the related rels file
- $objZip->addFromString('xl/vbaProjectSignature.bin', $this->spreadSheet->getMacrosCertificate());
- $objZip->addFromString('xl/_rels/vbaProject.bin.rels', $this->getWriterPart('RelsVBA')->writeVBARelationships($this->spreadSheet));
- }
- }
- }
- //a custom UI in this workbook ? add it ("base" xml and additional objects (pictures) and rels)
- if ($this->spreadSheet->hasRibbon()) {
- $tmpRibbonTarget=$this->spreadSheet->getRibbonXMLData('target');
- $objZip->addFromString($tmpRibbonTarget, $this->spreadSheet->getRibbonXMLData('data'));
- if ($this->spreadSheet->hasRibbonBinObjects()) {
- $tmpRootPath=dirname($tmpRibbonTarget).'/';
- $ribbonBinObjects=$this->spreadSheet->getRibbonBinObjects('data');//the files to write
- foreach ($ribbonBinObjects as $aPath => $aContent) {
- $objZip->addFromString($tmpRootPath.$aPath, $aContent);
- }
- //the rels for files
- $objZip->addFromString($tmpRootPath.'_rels/'.basename($tmpRibbonTarget).'.rels', $this->getWriterPart('RelsRibbonObjects')->writeRibbonRelationships($this->spreadSheet));
- }
- }
-
- // Add relationships to ZIP file
- $objZip->addFromString('_rels/.rels', $this->getWriterPart('Rels')->writeRelationships($this->spreadSheet));
- $objZip->addFromString('xl/_rels/workbook.xml.rels', $this->getWriterPart('Rels')->writeWorkbookRelationships($this->spreadSheet));
-
- // Add document properties to ZIP file
- $objZip->addFromString('docProps/app.xml', $this->getWriterPart('DocProps')->writeDocPropsApp($this->spreadSheet));
- $objZip->addFromString('docProps/core.xml', $this->getWriterPart('DocProps')->writeDocPropsCore($this->spreadSheet));
- $customPropertiesPart = $this->getWriterPart('DocProps')->writeDocPropsCustom($this->spreadSheet);
- if ($customPropertiesPart !== null) {
- $objZip->addFromString('docProps/custom.xml', $customPropertiesPart);
- }
-
- // Add theme to ZIP file
- $objZip->addFromString('xl/theme/theme1.xml', $this->getWriterPart('Theme')->writeTheme($this->spreadSheet));
-
- // Add string table to ZIP file
- $objZip->addFromString('xl/sharedStrings.xml', $this->getWriterPart('StringTable')->writeStringTable($this->stringTable));
-
- // Add styles to ZIP file
- $objZip->addFromString('xl/styles.xml', $this->getWriterPart('Style')->writeStyles($this->spreadSheet));
-
- // Add workbook to ZIP file
- $objZip->addFromString('xl/workbook.xml', $this->getWriterPart('Workbook')->writeWorkbook($this->spreadSheet, $this->preCalculateFormulas));
-
- $chartCount = 0;
- // Add worksheets
- for ($i = 0; $i < $this->spreadSheet->getSheetCount(); ++$i) {
- $objZip->addFromString('xl/worksheets/sheet' . ($i + 1) . '.xml', $this->getWriterPart('Worksheet')->writeWorksheet($this->spreadSheet->getSheet($i), $this->stringTable, $this->includeCharts));
- if ($this->includeCharts) {
- $charts = $this->spreadSheet->getSheet($i)->getChartCollection();
- if (count($charts) > 0) {
- foreach ($charts as $chart) {
- $objZip->addFromString('xl/charts/chart' . ($chartCount + 1) . '.xml', $this->getWriterPart('Chart')->writeChart($chart));
- $chartCount++;
- }
- }
- }
- }
-
- $chartRef1 = $chartRef2 = 0;
- // Add worksheet relationships (drawings, ...)
- for ($i = 0; $i < $this->spreadSheet->getSheetCount(); ++$i) {
- // Add relationships
- $objZip->addFromString('xl/worksheets/_rels/sheet' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeWorksheetRelationships($this->spreadSheet->getSheet($i), ($i + 1), $this->includeCharts));
-
- $drawings = $this->spreadSheet->getSheet($i)->getDrawingCollection();
- $drawingCount = count($drawings);
- if ($this->includeCharts) {
- $chartCount = $this->spreadSheet->getSheet($i)->getChartCount();
- }
-
- // Add drawing and image relationship parts
- if (($drawingCount > 0) || ($chartCount > 0)) {
- // Drawing relationships
- $objZip->addFromString('xl/drawings/_rels/drawing' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeDrawingRelationships($this->spreadSheet->getSheet($i), $chartRef1, $this->includeCharts));
-
- // Drawings
- $objZip->addFromString('xl/drawings/drawing' . ($i + 1) . '.xml', $this->getWriterPart('Drawing')->writeDrawings($this->spreadSheet->getSheet($i), $chartRef2, $this->includeCharts));
- }
-
- // Add comment relationship parts
- if (count($this->spreadSheet->getSheet($i)->getComments()) > 0) {
- // VML Comments
- $objZip->addFromString('xl/drawings/vmlDrawing' . ($i + 1) . '.vml', $this->getWriterPart('Comments')->writeVMLComments($this->spreadSheet->getSheet($i)));
-
- // Comments
- $objZip->addFromString('xl/comments' . ($i + 1) . '.xml', $this->getWriterPart('Comments')->writeComments($this->spreadSheet->getSheet($i)));
- }
-
- // Add header/footer relationship parts
- if (count($this->spreadSheet->getSheet($i)->getHeaderFooter()->getImages()) > 0) {
- // VML Drawings
- $objZip->addFromString('xl/drawings/vmlDrawingHF' . ($i + 1) . '.vml', $this->getWriterPart('Drawing')->writeVMLHeaderFooterImages($this->spreadSheet->getSheet($i)));
-
- // VML Drawing relationships
- $objZip->addFromString('xl/drawings/_rels/vmlDrawingHF' . ($i + 1) . '.vml.rels', $this->getWriterPart('Rels')->writeHeaderFooterDrawingRelationships($this->spreadSheet->getSheet($i)));
-
- // Media
- foreach ($this->spreadSheet->getSheet($i)->getHeaderFooter()->getImages() as $image) {
- $objZip->addFromString('xl/media/' . $image->getIndexedFilename(), file_get_contents($image->getPath()));
- }
- }
- }
-
- // Add media
- for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) {
- if ($this->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_Drawing) {
- $imageContents = null;
- $imagePath = $this->getDrawingHashTable()->getByIndex($i)->getPath();
- if (strpos($imagePath, 'zip://') !== false) {
- $imagePath = substr($imagePath, 6);
- $imagePathSplitted = explode('#', $imagePath);
-
- $imageZip = new ZipArchive();
- $imageZip->open($imagePathSplitted[0]);
- $imageContents = $imageZip->getFromName($imagePathSplitted[1]);
- $imageZip->close();
- unset($imageZip);
- } else {
- $imageContents = file_get_contents($imagePath);
- }
-
- $objZip->addFromString('xl/media/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents);
- } elseif ($this->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_MemoryDrawing) {
- ob_start();
- call_user_func(
- $this->getDrawingHashTable()->getByIndex($i)->getRenderingFunction(),
- $this->getDrawingHashTable()->getByIndex($i)->getImageResource()
- );
- $imageContents = ob_get_contents();
- ob_end_clean();
-
- $objZip->addFromString('xl/media/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents);
- }
- }
-
- PHPExcel_Calculation_Functions::setReturnDateType($saveDateReturnType);
- PHPExcel_Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog($saveDebugLog);
-
- // Close file
- if ($objZip->close() === false) {
- throw new PHPExcel_Writer_Exception("Could not close zip file $pFilename.");
- }
-
- // If a temporary file was used, copy it to the correct file stream
- if ($originalFilename != $pFilename) {
- if (copy($pFilename, $originalFilename) === false) {
- throw new PHPExcel_Writer_Exception("Could not copy temporary zip file $pFilename to $originalFilename.");
- }
- @unlink($pFilename);
- }
- } else {
- throw new PHPExcel_Writer_Exception("PHPExcel object unassigned.");
- }
- }
-
- /**
- * Get PHPExcel object
- *
- * @return PHPExcel
- * @throws PHPExcel_Writer_Exception
- */
- public function getPHPExcel()
- {
- if ($this->spreadSheet !== null) {
- return $this->spreadSheet;
- } else {
- throw new PHPExcel_Writer_Exception("No PHPExcel object assigned.");
- }
- }
-
- /**
- * Set PHPExcel object
- *
- * @param PHPExcel $pPHPExcel PHPExcel object
- * @throws PHPExcel_Writer_Exception
- * @return PHPExcel_Writer_Excel2007
- */
- public function setPHPExcel(PHPExcel $pPHPExcel = null)
- {
- $this->spreadSheet = $pPHPExcel;
- return $this;
- }
-
- /**
- * Get string table
- *
- * @return string[]
- */
- public function getStringTable()
- {
- return $this->stringTable;
- }
-
- /**
- * Get PHPExcel_Style HashTable
- *
- * @return PHPExcel_HashTable
- */
- public function getStyleHashTable()
- {
- return $this->styleHashTable;
- }
-
- /**
- * Get PHPExcel_Style_Conditional HashTable
- *
- * @return PHPExcel_HashTable
- */
- public function getStylesConditionalHashTable()
- {
- return $this->stylesConditionalHashTable;
- }
-
- /**
- * Get PHPExcel_Style_Fill HashTable
- *
- * @return PHPExcel_HashTable
- */
- public function getFillHashTable()
- {
- return $this->fillHashTable;
- }
-
- /**
- * Get PHPExcel_Style_Font HashTable
- *
- * @return PHPExcel_HashTable
- */
- public function getFontHashTable()
- {
- return $this->fontHashTable;
- }
-
- /**
- * Get PHPExcel_Style_Borders HashTable
- *
- * @return PHPExcel_HashTable
- */
- public function getBordersHashTable()
- {
- return $this->bordersHashTable;
- }
-
- /**
- * Get PHPExcel_Style_NumberFormat HashTable
- *
- * @return PHPExcel_HashTable
- */
- public function getNumFmtHashTable()
- {
- return $this->numFmtHashTable;
- }
-
- /**
- * Get PHPExcel_Worksheet_BaseDrawing HashTable
- *
- * @return PHPExcel_HashTable
- */
- public function getDrawingHashTable()
- {
- return $this->drawingHashTable;
- }
-
- /**
- * Get Office2003 compatibility
- *
- * @return boolean
- */
- public function getOffice2003Compatibility()
- {
- return $this->office2003compatibility;
- }
-
- /**
- * Set Office2003 compatibility
- *
- * @param boolean $pValue Office2003 compatibility?
- * @return PHPExcel_Writer_Excel2007
- */
- public function setOffice2003Compatibility($pValue = false)
- {
- $this->office2003compatibility = $pValue;
- return $this;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/Excel2007/Comments.php b/lib/phpexcel/PHPExcel/Writer/Excel2007/Comments.php
deleted file mode 100644
index 7139f6c492b..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/Excel2007/Comments.php
+++ /dev/null
@@ -1,260 +0,0 @@
-getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
- } else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
- }
-
- // XML header
- $objWriter->startDocument('1.0', 'UTF-8', 'yes');
-
- // Comments cache
- $comments = $pWorksheet->getComments();
-
- // Authors cache
- $authors = array();
- $authorId = 0;
- foreach ($comments as $comment) {
- if (!isset($authors[$comment->getAuthor()])) {
- $authors[$comment->getAuthor()] = $authorId++;
- }
- }
-
- // comments
- $objWriter->startElement('comments');
- $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main');
-
- // Loop through authors
- $objWriter->startElement('authors');
- foreach ($authors as $author => $index) {
- $objWriter->writeElement('author', $author);
- }
- $objWriter->endElement();
-
- // Loop through comments
- $objWriter->startElement('commentList');
- foreach ($comments as $key => $value) {
- $this->writeComment($objWriter, $key, $value, $authors);
- }
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // Return
- return $objWriter->getData();
- }
-
- /**
- * Write comment to XML format
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param string $pCellReference Cell reference
- * @param PHPExcel_Comment $pComment Comment
- * @param array $pAuthors Array of authors
- * @throws PHPExcel_Writer_Exception
- */
- private function writeComment(PHPExcel_Shared_XMLWriter $objWriter = null, $pCellReference = 'A1', PHPExcel_Comment $pComment = null, $pAuthors = null)
- {
- // comment
- $objWriter->startElement('comment');
- $objWriter->writeAttribute('ref', $pCellReference);
- $objWriter->writeAttribute('authorId', $pAuthors[$pComment->getAuthor()]);
-
- // text
- $objWriter->startElement('text');
- $this->getParentWriter()->getWriterPart('stringtable')->writeRichText($objWriter, $pComment->getText());
- $objWriter->endElement();
-
- $objWriter->endElement();
- }
-
- /**
- * Write VML comments to XML format
- *
- * @param PHPExcel_Worksheet $pWorksheet
- * @return string XML Output
- * @throws PHPExcel_Writer_Exception
- */
- public function writeVMLComments(PHPExcel_Worksheet $pWorksheet = null)
- {
- // Create XML writer
- $objWriter = null;
- if ($this->getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
- } else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
- }
-
- // XML header
- $objWriter->startDocument('1.0', 'UTF-8', 'yes');
-
- // Comments cache
- $comments = $pWorksheet->getComments();
-
- // xml
- $objWriter->startElement('xml');
- $objWriter->writeAttribute('xmlns:v', 'urn:schemas-microsoft-com:vml');
- $objWriter->writeAttribute('xmlns:o', 'urn:schemas-microsoft-com:office:office');
- $objWriter->writeAttribute('xmlns:x', 'urn:schemas-microsoft-com:office:excel');
-
- // o:shapelayout
- $objWriter->startElement('o:shapelayout');
- $objWriter->writeAttribute('v:ext', 'edit');
-
- // o:idmap
- $objWriter->startElement('o:idmap');
- $objWriter->writeAttribute('v:ext', 'edit');
- $objWriter->writeAttribute('data', '1');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // v:shapetype
- $objWriter->startElement('v:shapetype');
- $objWriter->writeAttribute('id', '_x0000_t202');
- $objWriter->writeAttribute('coordsize', '21600,21600');
- $objWriter->writeAttribute('o:spt', '202');
- $objWriter->writeAttribute('path', 'm,l,21600r21600,l21600,xe');
-
- // v:stroke
- $objWriter->startElement('v:stroke');
- $objWriter->writeAttribute('joinstyle', 'miter');
- $objWriter->endElement();
-
- // v:path
- $objWriter->startElement('v:path');
- $objWriter->writeAttribute('gradientshapeok', 't');
- $objWriter->writeAttribute('o:connecttype', 'rect');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // Loop through comments
- foreach ($comments as $key => $value) {
- $this->writeVMLComment($objWriter, $key, $value);
- }
-
- $objWriter->endElement();
-
- // Return
- return $objWriter->getData();
- }
-
- /**
- * Write VML comment to XML format
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param string $pCellReference Cell reference
- * @param PHPExcel_Comment $pComment Comment
- * @throws PHPExcel_Writer_Exception
- */
- private function writeVMLComment(PHPExcel_Shared_XMLWriter $objWriter = null, $pCellReference = 'A1', PHPExcel_Comment $pComment = null)
- {
- // Metadata
- list($column, $row) = PHPExcel_Cell::coordinateFromString($pCellReference);
- $column = PHPExcel_Cell::columnIndexFromString($column);
- $id = 1024 + $column + $row;
- $id = substr($id, 0, 4);
-
- // v:shape
- $objWriter->startElement('v:shape');
- $objWriter->writeAttribute('id', '_x0000_s' . $id);
- $objWriter->writeAttribute('type', '#_x0000_t202');
- $objWriter->writeAttribute('style', 'position:absolute;margin-left:' . $pComment->getMarginLeft() . ';margin-top:' . $pComment->getMarginTop() . ';width:' . $pComment->getWidth() . ';height:' . $pComment->getHeight() . ';z-index:1;visibility:' . ($pComment->getVisible() ? 'visible' : 'hidden'));
- $objWriter->writeAttribute('fillcolor', '#' . $pComment->getFillColor()->getRGB());
- $objWriter->writeAttribute('o:insetmode', 'auto');
-
- // v:fill
- $objWriter->startElement('v:fill');
- $objWriter->writeAttribute('color2', '#' . $pComment->getFillColor()->getRGB());
- $objWriter->endElement();
-
- // v:shadow
- $objWriter->startElement('v:shadow');
- $objWriter->writeAttribute('on', 't');
- $objWriter->writeAttribute('color', 'black');
- $objWriter->writeAttribute('obscured', 't');
- $objWriter->endElement();
-
- // v:path
- $objWriter->startElement('v:path');
- $objWriter->writeAttribute('o:connecttype', 'none');
- $objWriter->endElement();
-
- // v:textbox
- $objWriter->startElement('v:textbox');
- $objWriter->writeAttribute('style', 'mso-direction-alt:auto');
-
- // div
- $objWriter->startElement('div');
- $objWriter->writeAttribute('style', 'text-align:left');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // x:ClientData
- $objWriter->startElement('x:ClientData');
- $objWriter->writeAttribute('ObjectType', 'Note');
-
- // x:MoveWithCells
- $objWriter->writeElement('x:MoveWithCells', '');
-
- // x:SizeWithCells
- $objWriter->writeElement('x:SizeWithCells', '');
-
- // x:Anchor
- //$objWriter->writeElement('x:Anchor', $column . ', 15, ' . ($row - 2) . ', 10, ' . ($column + 4) . ', 15, ' . ($row + 5) . ', 18');
-
- // x:AutoFill
- $objWriter->writeElement('x:AutoFill', 'False');
-
- // x:Row
- $objWriter->writeElement('x:Row', ($row - 1));
-
- // x:Column
- $objWriter->writeElement('x:Column', ($column - 1));
-
- $objWriter->endElement();
-
- $objWriter->endElement();
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/Excel2007/Drawing.php b/lib/phpexcel/PHPExcel/Writer/Excel2007/Drawing.php
deleted file mode 100644
index 28143888919..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/Excel2007/Drawing.php
+++ /dev/null
@@ -1,589 +0,0 @@
-getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
- } else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
- }
-
- // XML header
- $objWriter->startDocument('1.0', 'UTF-8', 'yes');
-
- // xdr:wsDr
- $objWriter->startElement('xdr:wsDr');
- $objWriter->writeAttribute('xmlns:xdr', 'http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing');
- $objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main');
-
- // Loop through images and write drawings
- $i = 1;
- $iterator = $pWorksheet->getDrawingCollection()->getIterator();
- while ($iterator->valid()) {
- $this->writeDrawing($objWriter, $iterator->current(), $i);
-
- $iterator->next();
- ++$i;
- }
-
- if ($includeCharts) {
- $chartCount = $pWorksheet->getChartCount();
- // Loop through charts and write the chart position
- if ($chartCount > 0) {
- for ($c = 0; $c < $chartCount; ++$c) {
- $this->writeChart($objWriter, $pWorksheet->getChartByIndex($c), $c+$i);
- }
- }
- }
-
- $objWriter->endElement();
-
- // Return
- return $objWriter->getData();
- }
-
- /**
- * Write drawings to XML format
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Chart $pChart
- * @param int $pRelationId
- * @throws PHPExcel_Writer_Exception
- */
- public function writeChart(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Chart $pChart = null, $pRelationId = -1)
- {
- $tl = $pChart->getTopLeftPosition();
- $tl['colRow'] = PHPExcel_Cell::coordinateFromString($tl['cell']);
- $br = $pChart->getBottomRightPosition();
- $br['colRow'] = PHPExcel_Cell::coordinateFromString($br['cell']);
-
- $objWriter->startElement('xdr:twoCellAnchor');
-
- $objWriter->startElement('xdr:from');
- $objWriter->writeElement('xdr:col', PHPExcel_Cell::columnIndexFromString($tl['colRow'][0]) - 1);
- $objWriter->writeElement('xdr:colOff', PHPExcel_Shared_Drawing::pixelsToEMU($tl['xOffset']));
- $objWriter->writeElement('xdr:row', $tl['colRow'][1] - 1);
- $objWriter->writeElement('xdr:rowOff', PHPExcel_Shared_Drawing::pixelsToEMU($tl['yOffset']));
- $objWriter->endElement();
- $objWriter->startElement('xdr:to');
- $objWriter->writeElement('xdr:col', PHPExcel_Cell::columnIndexFromString($br['colRow'][0]) - 1);
- $objWriter->writeElement('xdr:colOff', PHPExcel_Shared_Drawing::pixelsToEMU($br['xOffset']));
- $objWriter->writeElement('xdr:row', $br['colRow'][1] - 1);
- $objWriter->writeElement('xdr:rowOff', PHPExcel_Shared_Drawing::pixelsToEMU($br['yOffset']));
- $objWriter->endElement();
-
- $objWriter->startElement('xdr:graphicFrame');
- $objWriter->writeAttribute('macro', '');
- $objWriter->startElement('xdr:nvGraphicFramePr');
- $objWriter->startElement('xdr:cNvPr');
- $objWriter->writeAttribute('name', 'Chart '.$pRelationId);
- $objWriter->writeAttribute('id', 1025 * $pRelationId);
- $objWriter->endElement();
- $objWriter->startElement('xdr:cNvGraphicFramePr');
- $objWriter->startElement('a:graphicFrameLocks');
- $objWriter->endElement();
- $objWriter->endElement();
- $objWriter->endElement();
-
- $objWriter->startElement('xdr:xfrm');
- $objWriter->startElement('a:off');
- $objWriter->writeAttribute('x', '0');
- $objWriter->writeAttribute('y', '0');
- $objWriter->endElement();
- $objWriter->startElement('a:ext');
- $objWriter->writeAttribute('cx', '0');
- $objWriter->writeAttribute('cy', '0');
- $objWriter->endElement();
- $objWriter->endElement();
-
- $objWriter->startElement('a:graphic');
- $objWriter->startElement('a:graphicData');
- $objWriter->writeAttribute('uri', 'http://schemas.openxmlformats.org/drawingml/2006/chart');
- $objWriter->startElement('c:chart');
- $objWriter->writeAttribute('xmlns:c', 'http://schemas.openxmlformats.org/drawingml/2006/chart');
- $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
- $objWriter->writeAttribute('r:id', 'rId'.$pRelationId);
- $objWriter->endElement();
- $objWriter->endElement();
- $objWriter->endElement();
- $objWriter->endElement();
-
- $objWriter->startElement('xdr:clientData');
- $objWriter->endElement();
-
- $objWriter->endElement();
- }
-
- /**
- * Write drawings to XML format
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet_BaseDrawing $pDrawing
- * @param int $pRelationId
- * @throws PHPExcel_Writer_Exception
- */
- public function writeDrawing(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet_BaseDrawing $pDrawing = null, $pRelationId = -1)
- {
- if ($pRelationId >= 0) {
- // xdr:oneCellAnchor
- $objWriter->startElement('xdr:oneCellAnchor');
- // Image location
- $aCoordinates = PHPExcel_Cell::coordinateFromString($pDrawing->getCoordinates());
- $aCoordinates[0] = PHPExcel_Cell::columnIndexFromString($aCoordinates[0]);
-
- // xdr:from
- $objWriter->startElement('xdr:from');
- $objWriter->writeElement('xdr:col', $aCoordinates[0] - 1);
- $objWriter->writeElement('xdr:colOff', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getOffsetX()));
- $objWriter->writeElement('xdr:row', $aCoordinates[1] - 1);
- $objWriter->writeElement('xdr:rowOff', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getOffsetY()));
- $objWriter->endElement();
-
- // xdr:ext
- $objWriter->startElement('xdr:ext');
- $objWriter->writeAttribute('cx', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getWidth()));
- $objWriter->writeAttribute('cy', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getHeight()));
- $objWriter->endElement();
-
- // xdr:pic
- $objWriter->startElement('xdr:pic');
-
- // xdr:nvPicPr
- $objWriter->startElement('xdr:nvPicPr');
-
- // xdr:cNvPr
- $objWriter->startElement('xdr:cNvPr');
- $objWriter->writeAttribute('id', $pRelationId);
- $objWriter->writeAttribute('name', $pDrawing->getName());
- $objWriter->writeAttribute('descr', $pDrawing->getDescription());
- $objWriter->endElement();
-
- // xdr:cNvPicPr
- $objWriter->startElement('xdr:cNvPicPr');
-
- // a:picLocks
- $objWriter->startElement('a:picLocks');
- $objWriter->writeAttribute('noChangeAspect', '1');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // xdr:blipFill
- $objWriter->startElement('xdr:blipFill');
-
- // a:blip
- $objWriter->startElement('a:blip');
- $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
- $objWriter->writeAttribute('r:embed', 'rId' . $pRelationId);
- $objWriter->endElement();
-
- // a:stretch
- $objWriter->startElement('a:stretch');
- $objWriter->writeElement('a:fillRect', null);
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // xdr:spPr
- $objWriter->startElement('xdr:spPr');
-
- // a:xfrm
- $objWriter->startElement('a:xfrm');
- $objWriter->writeAttribute('rot', PHPExcel_Shared_Drawing::degreesToAngle($pDrawing->getRotation()));
- $objWriter->endElement();
-
- // a:prstGeom
- $objWriter->startElement('a:prstGeom');
- $objWriter->writeAttribute('prst', 'rect');
-
- // a:avLst
- $objWriter->writeElement('a:avLst', null);
-
- $objWriter->endElement();
-
-// // a:solidFill
-// $objWriter->startElement('a:solidFill');
-
-// // a:srgbClr
-// $objWriter->startElement('a:srgbClr');
-// $objWriter->writeAttribute('val', 'FFFFFF');
-
-///* SHADE
-// // a:shade
-// $objWriter->startElement('a:shade');
-// $objWriter->writeAttribute('val', '85000');
-// $objWriter->endElement();
-//*/
-
-// $objWriter->endElement();
-
-// $objWriter->endElement();
-/*
- // a:ln
- $objWriter->startElement('a:ln');
- $objWriter->writeAttribute('w', '88900');
- $objWriter->writeAttribute('cap', 'sq');
-
- // a:solidFill
- $objWriter->startElement('a:solidFill');
-
- // a:srgbClr
- $objWriter->startElement('a:srgbClr');
- $objWriter->writeAttribute('val', 'FFFFFF');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:miter
- $objWriter->startElement('a:miter');
- $objWriter->writeAttribute('lim', '800000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-*/
-
- if ($pDrawing->getShadow()->getVisible()) {
- // a:effectLst
- $objWriter->startElement('a:effectLst');
-
- // a:outerShdw
- $objWriter->startElement('a:outerShdw');
- $objWriter->writeAttribute('blurRad', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getShadow()->getBlurRadius()));
- $objWriter->writeAttribute('dist', PHPExcel_Shared_Drawing::pixelsToEMU($pDrawing->getShadow()->getDistance()));
- $objWriter->writeAttribute('dir', PHPExcel_Shared_Drawing::degreesToAngle($pDrawing->getShadow()->getDirection()));
- $objWriter->writeAttribute('algn', $pDrawing->getShadow()->getAlignment());
- $objWriter->writeAttribute('rotWithShape', '0');
-
- // a:srgbClr
- $objWriter->startElement('a:srgbClr');
- $objWriter->writeAttribute('val', $pDrawing->getShadow()->getColor()->getRGB());
-
- // a:alpha
- $objWriter->startElement('a:alpha');
- $objWriter->writeAttribute('val', $pDrawing->getShadow()->getAlpha() * 1000);
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
- }
-/*
-
- // a:scene3d
- $objWriter->startElement('a:scene3d');
-
- // a:camera
- $objWriter->startElement('a:camera');
- $objWriter->writeAttribute('prst', 'orthographicFront');
- $objWriter->endElement();
-
- // a:lightRig
- $objWriter->startElement('a:lightRig');
- $objWriter->writeAttribute('rig', 'twoPt');
- $objWriter->writeAttribute('dir', 't');
-
- // a:rot
- $objWriter->startElement('a:rot');
- $objWriter->writeAttribute('lat', '0');
- $objWriter->writeAttribute('lon', '0');
- $objWriter->writeAttribute('rev', '0');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-*/
-/*
- // a:sp3d
- $objWriter->startElement('a:sp3d');
-
- // a:bevelT
- $objWriter->startElement('a:bevelT');
- $objWriter->writeAttribute('w', '25400');
- $objWriter->writeAttribute('h', '19050');
- $objWriter->endElement();
-
- // a:contourClr
- $objWriter->startElement('a:contourClr');
-
- // a:srgbClr
- $objWriter->startElement('a:srgbClr');
- $objWriter->writeAttribute('val', 'FFFFFF');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-*/
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // xdr:clientData
- $objWriter->writeElement('xdr:clientData', null);
-
- $objWriter->endElement();
- } else {
- throw new PHPExcel_Writer_Exception("Invalid parameters passed.");
- }
- }
-
- /**
- * Write VML header/footer images to XML format
- *
- * @param PHPExcel_Worksheet $pWorksheet
- * @return string XML Output
- * @throws PHPExcel_Writer_Exception
- */
- public function writeVMLHeaderFooterImages(PHPExcel_Worksheet $pWorksheet = null)
- {
- // Create XML writer
- $objWriter = null;
- if ($this->getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
- } else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
- }
-
- // XML header
- $objWriter->startDocument('1.0', 'UTF-8', 'yes');
-
- // Header/footer images
- $images = $pWorksheet->getHeaderFooter()->getImages();
-
- // xml
- $objWriter->startElement('xml');
- $objWriter->writeAttribute('xmlns:v', 'urn:schemas-microsoft-com:vml');
- $objWriter->writeAttribute('xmlns:o', 'urn:schemas-microsoft-com:office:office');
- $objWriter->writeAttribute('xmlns:x', 'urn:schemas-microsoft-com:office:excel');
-
- // o:shapelayout
- $objWriter->startElement('o:shapelayout');
- $objWriter->writeAttribute('v:ext', 'edit');
-
- // o:idmap
- $objWriter->startElement('o:idmap');
- $objWriter->writeAttribute('v:ext', 'edit');
- $objWriter->writeAttribute('data', '1');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // v:shapetype
- $objWriter->startElement('v:shapetype');
- $objWriter->writeAttribute('id', '_x0000_t75');
- $objWriter->writeAttribute('coordsize', '21600,21600');
- $objWriter->writeAttribute('o:spt', '75');
- $objWriter->writeAttribute('o:preferrelative', 't');
- $objWriter->writeAttribute('path', 'm@4@5l@4@11@9@11@9@5xe');
- $objWriter->writeAttribute('filled', 'f');
- $objWriter->writeAttribute('stroked', 'f');
-
- // v:stroke
- $objWriter->startElement('v:stroke');
- $objWriter->writeAttribute('joinstyle', 'miter');
- $objWriter->endElement();
-
- // v:formulas
- $objWriter->startElement('v:formulas');
-
- // v:f
- $objWriter->startElement('v:f');
- $objWriter->writeAttribute('eqn', 'if lineDrawn pixelLineWidth 0');
- $objWriter->endElement();
-
- // v:f
- $objWriter->startElement('v:f');
- $objWriter->writeAttribute('eqn', 'sum @0 1 0');
- $objWriter->endElement();
-
- // v:f
- $objWriter->startElement('v:f');
- $objWriter->writeAttribute('eqn', 'sum 0 0 @1');
- $objWriter->endElement();
-
- // v:f
- $objWriter->startElement('v:f');
- $objWriter->writeAttribute('eqn', 'prod @2 1 2');
- $objWriter->endElement();
-
- // v:f
- $objWriter->startElement('v:f');
- $objWriter->writeAttribute('eqn', 'prod @3 21600 pixelWidth');
- $objWriter->endElement();
-
- // v:f
- $objWriter->startElement('v:f');
- $objWriter->writeAttribute('eqn', 'prod @3 21600 pixelHeight');
- $objWriter->endElement();
-
- // v:f
- $objWriter->startElement('v:f');
- $objWriter->writeAttribute('eqn', 'sum @0 0 1');
- $objWriter->endElement();
-
- // v:f
- $objWriter->startElement('v:f');
- $objWriter->writeAttribute('eqn', 'prod @6 1 2');
- $objWriter->endElement();
-
- // v:f
- $objWriter->startElement('v:f');
- $objWriter->writeAttribute('eqn', 'prod @7 21600 pixelWidth');
- $objWriter->endElement();
-
- // v:f
- $objWriter->startElement('v:f');
- $objWriter->writeAttribute('eqn', 'sum @8 21600 0');
- $objWriter->endElement();
-
- // v:f
- $objWriter->startElement('v:f');
- $objWriter->writeAttribute('eqn', 'prod @7 21600 pixelHeight');
- $objWriter->endElement();
-
- // v:f
- $objWriter->startElement('v:f');
- $objWriter->writeAttribute('eqn', 'sum @10 21600 0');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // v:path
- $objWriter->startElement('v:path');
- $objWriter->writeAttribute('o:extrusionok', 'f');
- $objWriter->writeAttribute('gradientshapeok', 't');
- $objWriter->writeAttribute('o:connecttype', 'rect');
- $objWriter->endElement();
-
- // o:lock
- $objWriter->startElement('o:lock');
- $objWriter->writeAttribute('v:ext', 'edit');
- $objWriter->writeAttribute('aspectratio', 't');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // Loop through images
- foreach ($images as $key => $value) {
- $this->writeVMLHeaderFooterImage($objWriter, $key, $value);
- }
-
- $objWriter->endElement();
-
- // Return
- return $objWriter->getData();
- }
-
- /**
- * Write VML comment to XML format
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param string $pReference Reference
- * @param PHPExcel_Worksheet_HeaderFooterDrawing $pImage Image
- * @throws PHPExcel_Writer_Exception
- */
- private function writeVMLHeaderFooterImage(PHPExcel_Shared_XMLWriter $objWriter = null, $pReference = '', PHPExcel_Worksheet_HeaderFooterDrawing $pImage = null)
- {
- // Calculate object id
- preg_match('{(\d+)}', md5($pReference), $m);
- $id = 1500 + (substr($m[1], 0, 2) * 1);
-
- // Calculate offset
- $width = $pImage->getWidth();
- $height = $pImage->getHeight();
- $marginLeft = $pImage->getOffsetX();
- $marginTop = $pImage->getOffsetY();
-
- // v:shape
- $objWriter->startElement('v:shape');
- $objWriter->writeAttribute('id', $pReference);
- $objWriter->writeAttribute('o:spid', '_x0000_s' . $id);
- $objWriter->writeAttribute('type', '#_x0000_t75');
- $objWriter->writeAttribute('style', "position:absolute;margin-left:{$marginLeft}px;margin-top:{$marginTop}px;width:{$width}px;height:{$height}px;z-index:1");
-
- // v:imagedata
- $objWriter->startElement('v:imagedata');
- $objWriter->writeAttribute('o:relid', 'rId' . $pReference);
- $objWriter->writeAttribute('o:title', $pImage->getName());
- $objWriter->endElement();
-
- // o:lock
- $objWriter->startElement('o:lock');
- $objWriter->writeAttribute('v:ext', 'edit');
- $objWriter->writeAttribute('rotation', 't');
- $objWriter->endElement();
-
- $objWriter->endElement();
- }
-
-
- /**
- * Get an array of all drawings
- *
- * @param PHPExcel $pPHPExcel
- * @return PHPExcel_Worksheet_Drawing[] All drawings in PHPExcel
- * @throws PHPExcel_Writer_Exception
- */
- public function allDrawings(PHPExcel $pPHPExcel = null)
- {
- // Get an array of all drawings
- $aDrawings = array();
-
- // Loop through PHPExcel
- $sheetCount = $pPHPExcel->getSheetCount();
- for ($i = 0; $i < $sheetCount; ++$i) {
- // Loop through images and add to array
- $iterator = $pPHPExcel->getSheet($i)->getDrawingCollection()->getIterator();
- while ($iterator->valid()) {
- $aDrawings[] = $iterator->current();
-
- $iterator->next();
- }
- }
-
- return $aDrawings;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/Excel2007/RelsRibbon.php b/lib/phpexcel/PHPExcel/Writer/Excel2007/RelsRibbon.php
deleted file mode 100644
index 5a4a9fc0931..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/Excel2007/RelsRibbon.php
+++ /dev/null
@@ -1,67 +0,0 @@
-getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
- } else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
- }
-
- // XML header
- $objWriter->startDocument('1.0', 'UTF-8', 'yes');
-
- // Relationships
- $objWriter->startElement('Relationships');
- $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');
- $localRels = $pPHPExcel->getRibbonBinObjects('names');
- if (is_array($localRels)) {
- foreach ($localRels as $aId => $aTarget) {
- $objWriter->startElement('Relationship');
- $objWriter->writeAttribute('Id', $aId);
- $objWriter->writeAttribute('Type', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image');
- $objWriter->writeAttribute('Target', $aTarget);
- $objWriter->endElement();
- }
- }
- $objWriter->endElement();
-
- return $objWriter->getData();
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/Excel2007/RelsVBA.php b/lib/phpexcel/PHPExcel/Writer/Excel2007/RelsVBA.php
deleted file mode 100644
index bee0e643648..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/Excel2007/RelsVBA.php
+++ /dev/null
@@ -1,63 +0,0 @@
-getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
- } else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
- }
-
- // XML header
- $objWriter->startDocument('1.0', 'UTF-8', 'yes');
-
- // Relationships
- $objWriter->startElement('Relationships');
- $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');
- $objWriter->startElement('Relationship');
- $objWriter->writeAttribute('Id', 'rId1');
- $objWriter->writeAttribute('Type', 'http://schemas.microsoft.com/office/2006/relationships/vbaProjectSignature');
- $objWriter->writeAttribute('Target', 'vbaProjectSignature.bin');
- $objWriter->endElement();
- $objWriter->endElement();
-
- return $objWriter->getData();
-
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/Excel2007/StringTable.php b/lib/phpexcel/PHPExcel/Writer/Excel2007/StringTable.php
deleted file mode 100644
index fccec669ff7..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/Excel2007/StringTable.php
+++ /dev/null
@@ -1,313 +0,0 @@
-flipStringTable($aStringTable);
-
- // Loop through cells
- foreach ($pSheet->getCellCollection() as $cellID) {
- $cell = $pSheet->getCell($cellID);
- $cellValue = $cell->getValue();
- if (!is_object($cellValue) &&
- ($cellValue !== null) &&
- $cellValue !== '' &&
- !isset($aFlippedStringTable[$cellValue]) &&
- ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_STRING || $cell->getDataType() == PHPExcel_Cell_DataType::TYPE_STRING2 || $cell->getDataType() == PHPExcel_Cell_DataType::TYPE_NULL)) {
- $aStringTable[] = $cellValue;
- $aFlippedStringTable[$cellValue] = true;
- } elseif ($cellValue instanceof PHPExcel_RichText &&
- ($cellValue !== null) &&
- !isset($aFlippedStringTable[$cellValue->getHashCode()])) {
- $aStringTable[] = $cellValue;
- $aFlippedStringTable[$cellValue->getHashCode()] = true;
- }
- }
-
- return $aStringTable;
- } else {
- throw new PHPExcel_Writer_Exception("Invalid PHPExcel_Worksheet object passed.");
- }
- }
-
- /**
- * Write string table to XML format
- *
- * @param string[] $pStringTable
- * @return string XML Output
- * @throws PHPExcel_Writer_Exception
- */
- public function writeStringTable($pStringTable = null)
- {
- if ($pStringTable !== null) {
- // Create XML writer
- $objWriter = null;
- if ($this->getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
- } else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
- }
-
- // XML header
- $objWriter->startDocument('1.0', 'UTF-8', 'yes');
-
- // String table
- $objWriter->startElement('sst');
- $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main');
- $objWriter->writeAttribute('uniqueCount', count($pStringTable));
-
- // Loop through string table
- foreach ($pStringTable as $textElement) {
- $objWriter->startElement('si');
-
- if (! $textElement instanceof PHPExcel_RichText) {
- $textToWrite = PHPExcel_Shared_String::ControlCharacterPHP2OOXML($textElement);
- $objWriter->startElement('t');
- if ($textToWrite !== trim($textToWrite)) {
- $objWriter->writeAttribute('xml:space', 'preserve');
- }
- $objWriter->writeRawData($textToWrite);
- $objWriter->endElement();
- } elseif ($textElement instanceof PHPExcel_RichText) {
- $this->writeRichText($objWriter, $textElement);
- }
-
- $objWriter->endElement();
- }
-
- $objWriter->endElement();
-
- return $objWriter->getData();
- } else {
- throw new PHPExcel_Writer_Exception("Invalid string table array passed.");
- }
- }
-
- /**
- * Write Rich Text
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_RichText $pRichText Rich text
- * @param string $prefix Optional Namespace prefix
- * @throws PHPExcel_Writer_Exception
- */
- public function writeRichText(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_RichText $pRichText = null, $prefix = null)
- {
- if ($prefix !== null) {
- $prefix .= ':';
- }
-
- // Loop through rich text elements
- $elements = $pRichText->getRichTextElements();
- foreach ($elements as $element) {
- // r
- $objWriter->startElement($prefix.'r');
-
- // rPr
- if ($element instanceof PHPExcel_RichText_Run) {
- // rPr
- $objWriter->startElement($prefix.'rPr');
-
- // rFont
- $objWriter->startElement($prefix.'rFont');
- $objWriter->writeAttribute('val', $element->getFont()->getName());
- $objWriter->endElement();
-
- // Bold
- $objWriter->startElement($prefix.'b');
- $objWriter->writeAttribute('val', ($element->getFont()->getBold() ? 'true' : 'false'));
- $objWriter->endElement();
-
- // Italic
- $objWriter->startElement($prefix.'i');
- $objWriter->writeAttribute('val', ($element->getFont()->getItalic() ? 'true' : 'false'));
- $objWriter->endElement();
-
- // Superscript / subscript
- if ($element->getFont()->getSuperScript() || $element->getFont()->getSubScript()) {
- $objWriter->startElement($prefix.'vertAlign');
- if ($element->getFont()->getSuperScript()) {
- $objWriter->writeAttribute('val', 'superscript');
- } elseif ($element->getFont()->getSubScript()) {
- $objWriter->writeAttribute('val', 'subscript');
- }
- $objWriter->endElement();
- }
-
- // Strikethrough
- $objWriter->startElement($prefix.'strike');
- $objWriter->writeAttribute('val', ($element->getFont()->getStrikethrough() ? 'true' : 'false'));
- $objWriter->endElement();
-
- // Color
- $objWriter->startElement($prefix.'color');
- $objWriter->writeAttribute('rgb', $element->getFont()->getColor()->getARGB());
- $objWriter->endElement();
-
- // Size
- $objWriter->startElement($prefix.'sz');
- $objWriter->writeAttribute('val', $element->getFont()->getSize());
- $objWriter->endElement();
-
- // Underline
- $objWriter->startElement($prefix.'u');
- $objWriter->writeAttribute('val', $element->getFont()->getUnderline());
- $objWriter->endElement();
-
- $objWriter->endElement();
- }
-
- // t
- $objWriter->startElement($prefix.'t');
- $objWriter->writeAttribute('xml:space', 'preserve');
- $objWriter->writeRawData(PHPExcel_Shared_String::ControlCharacterPHP2OOXML($element->getText()));
- $objWriter->endElement();
-
- $objWriter->endElement();
- }
- }
-
- /**
- * Write Rich Text
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param string|PHPExcel_RichText $pRichText text string or Rich text
- * @param string $prefix Optional Namespace prefix
- * @throws PHPExcel_Writer_Exception
- */
- public function writeRichTextForCharts(PHPExcel_Shared_XMLWriter $objWriter = null, $pRichText = null, $prefix = null)
- {
- if (!$pRichText instanceof PHPExcel_RichText) {
- $textRun = $pRichText;
- $pRichText = new PHPExcel_RichText();
- $pRichText->createTextRun($textRun);
- }
-
- if ($prefix !== null) {
- $prefix .= ':';
- }
-
- // Loop through rich text elements
- $elements = $pRichText->getRichTextElements();
- foreach ($elements as $element) {
- // r
- $objWriter->startElement($prefix.'r');
-
- // rPr
- $objWriter->startElement($prefix.'rPr');
-
- // Bold
- $objWriter->writeAttribute('b', ($element->getFont()->getBold() ? 1 : 0));
- // Italic
- $objWriter->writeAttribute('i', ($element->getFont()->getItalic() ? 1 : 0));
- // Underline
- $underlineType = $element->getFont()->getUnderline();
- switch ($underlineType) {
- case 'single':
- $underlineType = 'sng';
- break;
- case 'double':
- $underlineType = 'dbl';
- break;
- }
- $objWriter->writeAttribute('u', $underlineType);
- // Strikethrough
- $objWriter->writeAttribute('strike', ($element->getFont()->getStrikethrough() ? 'sngStrike' : 'noStrike'));
-
- // rFont
- $objWriter->startElement($prefix.'latin');
- $objWriter->writeAttribute('typeface', $element->getFont()->getName());
- $objWriter->endElement();
-
- // Superscript / subscript
-// if ($element->getFont()->getSuperScript() || $element->getFont()->getSubScript()) {
-// $objWriter->startElement($prefix.'vertAlign');
-// if ($element->getFont()->getSuperScript()) {
-// $objWriter->writeAttribute('val', 'superscript');
-// } elseif ($element->getFont()->getSubScript()) {
-// $objWriter->writeAttribute('val', 'subscript');
-// }
-// $objWriter->endElement();
-// }
-//
- $objWriter->endElement();
-
- // t
- $objWriter->startElement($prefix.'t');
-// $objWriter->writeAttribute('xml:space', 'preserve'); // Excel2010 accepts, Excel2007 complains
- $objWriter->writeRawData(PHPExcel_Shared_String::ControlCharacterPHP2OOXML($element->getText()));
- $objWriter->endElement();
-
- $objWriter->endElement();
- }
- }
-
- /**
- * Flip string table (for index searching)
- *
- * @param array $stringTable Stringtable
- * @return array
- */
- public function flipStringTable($stringTable = array())
- {
- // Return value
- $returnValue = array();
-
- // Loop through stringtable and add flipped items to $returnValue
- foreach ($stringTable as $key => $value) {
- if (! $value instanceof PHPExcel_RichText) {
- $returnValue[$value] = $key;
- } elseif ($value instanceof PHPExcel_RichText) {
- $returnValue[$value->getHashCode()] = $key;
- }
- }
-
- return $returnValue;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/Excel2007/Theme.php b/lib/phpexcel/PHPExcel/Writer/Excel2007/Theme.php
deleted file mode 100644
index 223e4024169..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/Excel2007/Theme.php
+++ /dev/null
@@ -1,869 +0,0 @@
- 'MS Pゴシック',
- 'Hang' => '맑은 고딕',
- 'Hans' => '宋体',
- 'Hant' => '新細明體',
- 'Arab' => 'Times New Roman',
- 'Hebr' => 'Times New Roman',
- 'Thai' => 'Tahoma',
- 'Ethi' => 'Nyala',
- 'Beng' => 'Vrinda',
- 'Gujr' => 'Shruti',
- 'Khmr' => 'MoolBoran',
- 'Knda' => 'Tunga',
- 'Guru' => 'Raavi',
- 'Cans' => 'Euphemia',
- 'Cher' => 'Plantagenet Cherokee',
- 'Yiii' => 'Microsoft Yi Baiti',
- 'Tibt' => 'Microsoft Himalaya',
- 'Thaa' => 'MV Boli',
- 'Deva' => 'Mangal',
- 'Telu' => 'Gautami',
- 'Taml' => 'Latha',
- 'Syrc' => 'Estrangelo Edessa',
- 'Orya' => 'Kalinga',
- 'Mlym' => 'Kartika',
- 'Laoo' => 'DokChampa',
- 'Sinh' => 'Iskoola Pota',
- 'Mong' => 'Mongolian Baiti',
- 'Viet' => 'Times New Roman',
- 'Uigh' => 'Microsoft Uighur',
- 'Geor' => 'Sylfaen',
- );
-
- /**
- * Map of Minor fonts to write
- * @static array of string
- *
- */
- private static $minorFonts = array(
- 'Jpan' => 'MS Pゴシック',
- 'Hang' => '맑은 고딕',
- 'Hans' => '宋体',
- 'Hant' => '新細明體',
- 'Arab' => 'Arial',
- 'Hebr' => 'Arial',
- 'Thai' => 'Tahoma',
- 'Ethi' => 'Nyala',
- 'Beng' => 'Vrinda',
- 'Gujr' => 'Shruti',
- 'Khmr' => 'DaunPenh',
- 'Knda' => 'Tunga',
- 'Guru' => 'Raavi',
- 'Cans' => 'Euphemia',
- 'Cher' => 'Plantagenet Cherokee',
- 'Yiii' => 'Microsoft Yi Baiti',
- 'Tibt' => 'Microsoft Himalaya',
- 'Thaa' => 'MV Boli',
- 'Deva' => 'Mangal',
- 'Telu' => 'Gautami',
- 'Taml' => 'Latha',
- 'Syrc' => 'Estrangelo Edessa',
- 'Orya' => 'Kalinga',
- 'Mlym' => 'Kartika',
- 'Laoo' => 'DokChampa',
- 'Sinh' => 'Iskoola Pota',
- 'Mong' => 'Mongolian Baiti',
- 'Viet' => 'Arial',
- 'Uigh' => 'Microsoft Uighur',
- 'Geor' => 'Sylfaen',
- );
-
- /**
- * Map of core colours
- * @static array of string
- *
- */
- private static $colourScheme = array(
- 'dk2' => '1F497D',
- 'lt2' => 'EEECE1',
- 'accent1' => '4F81BD',
- 'accent2' => 'C0504D',
- 'accent3' => '9BBB59',
- 'accent4' => '8064A2',
- 'accent5' => '4BACC6',
- 'accent6' => 'F79646',
- 'hlink' => '0000FF',
- 'folHlink' => '800080',
- );
-
- /**
- * Write theme to XML format
- *
- * @param PHPExcel $pPHPExcel
- * @return string XML Output
- * @throws PHPExcel_Writer_Exception
- */
- public function writeTheme(PHPExcel $pPHPExcel = null)
- {
- // Create XML writer
- $objWriter = null;
- if ($this->getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
- } else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
- }
-
- // XML header
- $objWriter->startDocument('1.0', 'UTF-8', 'yes');
-
- // a:theme
- $objWriter->startElement('a:theme');
- $objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main');
- $objWriter->writeAttribute('name', 'Office Theme');
-
- // a:themeElements
- $objWriter->startElement('a:themeElements');
-
- // a:clrScheme
- $objWriter->startElement('a:clrScheme');
- $objWriter->writeAttribute('name', 'Office');
-
- // a:dk1
- $objWriter->startElement('a:dk1');
-
- // a:sysClr
- $objWriter->startElement('a:sysClr');
- $objWriter->writeAttribute('val', 'windowText');
- $objWriter->writeAttribute('lastClr', '000000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:lt1
- $objWriter->startElement('a:lt1');
-
- // a:sysClr
- $objWriter->startElement('a:sysClr');
- $objWriter->writeAttribute('val', 'window');
- $objWriter->writeAttribute('lastClr', 'FFFFFF');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:dk2
- $this->writeColourScheme($objWriter);
-
- $objWriter->endElement();
-
- // a:fontScheme
- $objWriter->startElement('a:fontScheme');
- $objWriter->writeAttribute('name', 'Office');
-
- // a:majorFont
- $objWriter->startElement('a:majorFont');
- $this->writeFonts($objWriter, 'Cambria', self::$majorFonts);
- $objWriter->endElement();
-
- // a:minorFont
- $objWriter->startElement('a:minorFont');
- $this->writeFonts($objWriter, 'Calibri', self::$minorFonts);
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:fmtScheme
- $objWriter->startElement('a:fmtScheme');
- $objWriter->writeAttribute('name', 'Office');
-
- // a:fillStyleLst
- $objWriter->startElement('a:fillStyleLst');
-
- // a:solidFill
- $objWriter->startElement('a:solidFill');
-
- // a:schemeClr
- $objWriter->startElement('a:schemeClr');
- $objWriter->writeAttribute('val', 'phClr');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:gradFill
- $objWriter->startElement('a:gradFill');
- $objWriter->writeAttribute('rotWithShape', '1');
-
- // a:gsLst
- $objWriter->startElement('a:gsLst');
-
- // a:gs
- $objWriter->startElement('a:gs');
- $objWriter->writeAttribute('pos', '0');
-
- // a:schemeClr
- $objWriter->startElement('a:schemeClr');
- $objWriter->writeAttribute('val', 'phClr');
-
- // a:tint
- $objWriter->startElement('a:tint');
- $objWriter->writeAttribute('val', '50000');
- $objWriter->endElement();
-
- // a:satMod
- $objWriter->startElement('a:satMod');
- $objWriter->writeAttribute('val', '300000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:gs
- $objWriter->startElement('a:gs');
- $objWriter->writeAttribute('pos', '35000');
-
- // a:schemeClr
- $objWriter->startElement('a:schemeClr');
- $objWriter->writeAttribute('val', 'phClr');
-
- // a:tint
- $objWriter->startElement('a:tint');
- $objWriter->writeAttribute('val', '37000');
- $objWriter->endElement();
-
- // a:satMod
- $objWriter->startElement('a:satMod');
- $objWriter->writeAttribute('val', '300000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:gs
- $objWriter->startElement('a:gs');
- $objWriter->writeAttribute('pos', '100000');
-
- // a:schemeClr
- $objWriter->startElement('a:schemeClr');
- $objWriter->writeAttribute('val', 'phClr');
-
- // a:tint
- $objWriter->startElement('a:tint');
- $objWriter->writeAttribute('val', '15000');
- $objWriter->endElement();
-
- // a:satMod
- $objWriter->startElement('a:satMod');
- $objWriter->writeAttribute('val', '350000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:lin
- $objWriter->startElement('a:lin');
- $objWriter->writeAttribute('ang', '16200000');
- $objWriter->writeAttribute('scaled', '1');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:gradFill
- $objWriter->startElement('a:gradFill');
- $objWriter->writeAttribute('rotWithShape', '1');
-
- // a:gsLst
- $objWriter->startElement('a:gsLst');
-
- // a:gs
- $objWriter->startElement('a:gs');
- $objWriter->writeAttribute('pos', '0');
-
- // a:schemeClr
- $objWriter->startElement('a:schemeClr');
- $objWriter->writeAttribute('val', 'phClr');
-
- // a:shade
- $objWriter->startElement('a:shade');
- $objWriter->writeAttribute('val', '51000');
- $objWriter->endElement();
-
- // a:satMod
- $objWriter->startElement('a:satMod');
- $objWriter->writeAttribute('val', '130000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:gs
- $objWriter->startElement('a:gs');
- $objWriter->writeAttribute('pos', '80000');
-
- // a:schemeClr
- $objWriter->startElement('a:schemeClr');
- $objWriter->writeAttribute('val', 'phClr');
-
- // a:shade
- $objWriter->startElement('a:shade');
- $objWriter->writeAttribute('val', '93000');
- $objWriter->endElement();
-
- // a:satMod
- $objWriter->startElement('a:satMod');
- $objWriter->writeAttribute('val', '130000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:gs
- $objWriter->startElement('a:gs');
- $objWriter->writeAttribute('pos', '100000');
-
- // a:schemeClr
- $objWriter->startElement('a:schemeClr');
- $objWriter->writeAttribute('val', 'phClr');
-
- // a:shade
- $objWriter->startElement('a:shade');
- $objWriter->writeAttribute('val', '94000');
- $objWriter->endElement();
-
- // a:satMod
- $objWriter->startElement('a:satMod');
- $objWriter->writeAttribute('val', '135000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:lin
- $objWriter->startElement('a:lin');
- $objWriter->writeAttribute('ang', '16200000');
- $objWriter->writeAttribute('scaled', '0');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:lnStyleLst
- $objWriter->startElement('a:lnStyleLst');
-
- // a:ln
- $objWriter->startElement('a:ln');
- $objWriter->writeAttribute('w', '9525');
- $objWriter->writeAttribute('cap', 'flat');
- $objWriter->writeAttribute('cmpd', 'sng');
- $objWriter->writeAttribute('algn', 'ctr');
-
- // a:solidFill
- $objWriter->startElement('a:solidFill');
-
- // a:schemeClr
- $objWriter->startElement('a:schemeClr');
- $objWriter->writeAttribute('val', 'phClr');
-
- // a:shade
- $objWriter->startElement('a:shade');
- $objWriter->writeAttribute('val', '95000');
- $objWriter->endElement();
-
- // a:satMod
- $objWriter->startElement('a:satMod');
- $objWriter->writeAttribute('val', '105000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:prstDash
- $objWriter->startElement('a:prstDash');
- $objWriter->writeAttribute('val', 'solid');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:ln
- $objWriter->startElement('a:ln');
- $objWriter->writeAttribute('w', '25400');
- $objWriter->writeAttribute('cap', 'flat');
- $objWriter->writeAttribute('cmpd', 'sng');
- $objWriter->writeAttribute('algn', 'ctr');
-
- // a:solidFill
- $objWriter->startElement('a:solidFill');
-
- // a:schemeClr
- $objWriter->startElement('a:schemeClr');
- $objWriter->writeAttribute('val', 'phClr');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:prstDash
- $objWriter->startElement('a:prstDash');
- $objWriter->writeAttribute('val', 'solid');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:ln
- $objWriter->startElement('a:ln');
- $objWriter->writeAttribute('w', '38100');
- $objWriter->writeAttribute('cap', 'flat');
- $objWriter->writeAttribute('cmpd', 'sng');
- $objWriter->writeAttribute('algn', 'ctr');
-
- // a:solidFill
- $objWriter->startElement('a:solidFill');
-
- // a:schemeClr
- $objWriter->startElement('a:schemeClr');
- $objWriter->writeAttribute('val', 'phClr');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:prstDash
- $objWriter->startElement('a:prstDash');
- $objWriter->writeAttribute('val', 'solid');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
-
-
- // a:effectStyleLst
- $objWriter->startElement('a:effectStyleLst');
-
- // a:effectStyle
- $objWriter->startElement('a:effectStyle');
-
- // a:effectLst
- $objWriter->startElement('a:effectLst');
-
- // a:outerShdw
- $objWriter->startElement('a:outerShdw');
- $objWriter->writeAttribute('blurRad', '40000');
- $objWriter->writeAttribute('dist', '20000');
- $objWriter->writeAttribute('dir', '5400000');
- $objWriter->writeAttribute('rotWithShape', '0');
-
- // a:srgbClr
- $objWriter->startElement('a:srgbClr');
- $objWriter->writeAttribute('val', '000000');
-
- // a:alpha
- $objWriter->startElement('a:alpha');
- $objWriter->writeAttribute('val', '38000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:effectStyle
- $objWriter->startElement('a:effectStyle');
-
- // a:effectLst
- $objWriter->startElement('a:effectLst');
-
- // a:outerShdw
- $objWriter->startElement('a:outerShdw');
- $objWriter->writeAttribute('blurRad', '40000');
- $objWriter->writeAttribute('dist', '23000');
- $objWriter->writeAttribute('dir', '5400000');
- $objWriter->writeAttribute('rotWithShape', '0');
-
- // a:srgbClr
- $objWriter->startElement('a:srgbClr');
- $objWriter->writeAttribute('val', '000000');
-
- // a:alpha
- $objWriter->startElement('a:alpha');
- $objWriter->writeAttribute('val', '35000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:effectStyle
- $objWriter->startElement('a:effectStyle');
-
- // a:effectLst
- $objWriter->startElement('a:effectLst');
-
- // a:outerShdw
- $objWriter->startElement('a:outerShdw');
- $objWriter->writeAttribute('blurRad', '40000');
- $objWriter->writeAttribute('dist', '23000');
- $objWriter->writeAttribute('dir', '5400000');
- $objWriter->writeAttribute('rotWithShape', '0');
-
- // a:srgbClr
- $objWriter->startElement('a:srgbClr');
- $objWriter->writeAttribute('val', '000000');
-
- // a:alpha
- $objWriter->startElement('a:alpha');
- $objWriter->writeAttribute('val', '35000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:scene3d
- $objWriter->startElement('a:scene3d');
-
- // a:camera
- $objWriter->startElement('a:camera');
- $objWriter->writeAttribute('prst', 'orthographicFront');
-
- // a:rot
- $objWriter->startElement('a:rot');
- $objWriter->writeAttribute('lat', '0');
- $objWriter->writeAttribute('lon', '0');
- $objWriter->writeAttribute('rev', '0');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:lightRig
- $objWriter->startElement('a:lightRig');
- $objWriter->writeAttribute('rig', 'threePt');
- $objWriter->writeAttribute('dir', 't');
-
- // a:rot
- $objWriter->startElement('a:rot');
- $objWriter->writeAttribute('lat', '0');
- $objWriter->writeAttribute('lon', '0');
- $objWriter->writeAttribute('rev', '1200000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:sp3d
- $objWriter->startElement('a:sp3d');
-
- // a:bevelT
- $objWriter->startElement('a:bevelT');
- $objWriter->writeAttribute('w', '63500');
- $objWriter->writeAttribute('h', '25400');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:bgFillStyleLst
- $objWriter->startElement('a:bgFillStyleLst');
-
- // a:solidFill
- $objWriter->startElement('a:solidFill');
-
- // a:schemeClr
- $objWriter->startElement('a:schemeClr');
- $objWriter->writeAttribute('val', 'phClr');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:gradFill
- $objWriter->startElement('a:gradFill');
- $objWriter->writeAttribute('rotWithShape', '1');
-
- // a:gsLst
- $objWriter->startElement('a:gsLst');
-
- // a:gs
- $objWriter->startElement('a:gs');
- $objWriter->writeAttribute('pos', '0');
-
- // a:schemeClr
- $objWriter->startElement('a:schemeClr');
- $objWriter->writeAttribute('val', 'phClr');
-
- // a:tint
- $objWriter->startElement('a:tint');
- $objWriter->writeAttribute('val', '40000');
- $objWriter->endElement();
-
- // a:satMod
- $objWriter->startElement('a:satMod');
- $objWriter->writeAttribute('val', '350000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:gs
- $objWriter->startElement('a:gs');
- $objWriter->writeAttribute('pos', '40000');
-
- // a:schemeClr
- $objWriter->startElement('a:schemeClr');
- $objWriter->writeAttribute('val', 'phClr');
-
- // a:tint
- $objWriter->startElement('a:tint');
- $objWriter->writeAttribute('val', '45000');
- $objWriter->endElement();
-
- // a:shade
- $objWriter->startElement('a:shade');
- $objWriter->writeAttribute('val', '99000');
- $objWriter->endElement();
-
- // a:satMod
- $objWriter->startElement('a:satMod');
- $objWriter->writeAttribute('val', '350000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:gs
- $objWriter->startElement('a:gs');
- $objWriter->writeAttribute('pos', '100000');
-
- // a:schemeClr
- $objWriter->startElement('a:schemeClr');
- $objWriter->writeAttribute('val', 'phClr');
-
- // a:shade
- $objWriter->startElement('a:shade');
- $objWriter->writeAttribute('val', '20000');
- $objWriter->endElement();
-
- // a:satMod
- $objWriter->startElement('a:satMod');
- $objWriter->writeAttribute('val', '255000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:path
- $objWriter->startElement('a:path');
- $objWriter->writeAttribute('path', 'circle');
-
- // a:fillToRect
- $objWriter->startElement('a:fillToRect');
- $objWriter->writeAttribute('l', '50000');
- $objWriter->writeAttribute('t', '-80000');
- $objWriter->writeAttribute('r', '50000');
- $objWriter->writeAttribute('b', '180000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:gradFill
- $objWriter->startElement('a:gradFill');
- $objWriter->writeAttribute('rotWithShape', '1');
-
- // a:gsLst
- $objWriter->startElement('a:gsLst');
-
- // a:gs
- $objWriter->startElement('a:gs');
- $objWriter->writeAttribute('pos', '0');
-
- // a:schemeClr
- $objWriter->startElement('a:schemeClr');
- $objWriter->writeAttribute('val', 'phClr');
-
- // a:tint
- $objWriter->startElement('a:tint');
- $objWriter->writeAttribute('val', '80000');
- $objWriter->endElement();
-
- // a:satMod
- $objWriter->startElement('a:satMod');
- $objWriter->writeAttribute('val', '300000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:gs
- $objWriter->startElement('a:gs');
- $objWriter->writeAttribute('pos', '100000');
-
- // a:schemeClr
- $objWriter->startElement('a:schemeClr');
- $objWriter->writeAttribute('val', 'phClr');
-
- // a:shade
- $objWriter->startElement('a:shade');
- $objWriter->writeAttribute('val', '30000');
- $objWriter->endElement();
-
- // a:satMod
- $objWriter->startElement('a:satMod');
- $objWriter->writeAttribute('val', '200000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:path
- $objWriter->startElement('a:path');
- $objWriter->writeAttribute('path', 'circle');
-
- // a:fillToRect
- $objWriter->startElement('a:fillToRect');
- $objWriter->writeAttribute('l', '50000');
- $objWriter->writeAttribute('t', '50000');
- $objWriter->writeAttribute('r', '50000');
- $objWriter->writeAttribute('b', '50000');
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- // a:objectDefaults
- $objWriter->writeElement('a:objectDefaults', null);
-
- // a:extraClrSchemeLst
- $objWriter->writeElement('a:extraClrSchemeLst', null);
-
- $objWriter->endElement();
-
- // Return
- return $objWriter->getData();
- }
-
- /**
- * Write fonts to XML format
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter
- * @param string $latinFont
- * @param array of string $fontSet
- * @return string XML Output
- * @throws PHPExcel_Writer_Exception
- */
- private function writeFonts($objWriter, $latinFont, $fontSet)
- {
- // a:latin
- $objWriter->startElement('a:latin');
- $objWriter->writeAttribute('typeface', $latinFont);
- $objWriter->endElement();
-
- // a:ea
- $objWriter->startElement('a:ea');
- $objWriter->writeAttribute('typeface', '');
- $objWriter->endElement();
-
- // a:cs
- $objWriter->startElement('a:cs');
- $objWriter->writeAttribute('typeface', '');
- $objWriter->endElement();
-
- foreach ($fontSet as $fontScript => $typeface) {
- $objWriter->startElement('a:font');
- $objWriter->writeAttribute('script', $fontScript);
- $objWriter->writeAttribute('typeface', $typeface);
- $objWriter->endElement();
- }
- }
-
- /**
- * Write colour scheme to XML format
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter
- * @return string XML Output
- * @throws PHPExcel_Writer_Exception
- */
- private function writeColourScheme($objWriter)
- {
- foreach (self::$colourScheme as $colourName => $colourValue) {
- $objWriter->startElement('a:'.$colourName);
-
- $objWriter->startElement('a:srgbClr');
- $objWriter->writeAttribute('val', $colourValue);
- $objWriter->endElement();
-
- $objWriter->endElement();
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/Excel2007/Workbook.php b/lib/phpexcel/PHPExcel/Writer/Excel2007/Workbook.php
deleted file mode 100644
index 87c877ea971..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/Excel2007/Workbook.php
+++ /dev/null
@@ -1,448 +0,0 @@
-getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
- } else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
- }
-
- // XML header
- $objWriter->startDocument('1.0', 'UTF-8', 'yes');
-
- // workbook
- $objWriter->startElement('workbook');
- $objWriter->writeAttribute('xml:space', 'preserve');
- $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main');
- $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
-
- // fileVersion
- $this->writeFileVersion($objWriter);
-
- // workbookPr
- $this->writeWorkbookPr($objWriter);
-
- // workbookProtection
- $this->writeWorkbookProtection($objWriter, $pPHPExcel);
-
- // bookViews
- if ($this->getParentWriter()->getOffice2003Compatibility() === false) {
- $this->writeBookViews($objWriter, $pPHPExcel);
- }
-
- // sheets
- $this->writeSheets($objWriter, $pPHPExcel);
-
- // definedNames
- $this->writeDefinedNames($objWriter, $pPHPExcel);
-
- // calcPr
- $this->writeCalcPr($objWriter, $recalcRequired);
-
- $objWriter->endElement();
-
- // Return
- return $objWriter->getData();
- }
-
- /**
- * Write file version
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @throws PHPExcel_Writer_Exception
- */
- private function writeFileVersion(PHPExcel_Shared_XMLWriter $objWriter = null)
- {
- $objWriter->startElement('fileVersion');
- $objWriter->writeAttribute('appName', 'xl');
- $objWriter->writeAttribute('lastEdited', '4');
- $objWriter->writeAttribute('lowestEdited', '4');
- $objWriter->writeAttribute('rupBuild', '4505');
- $objWriter->endElement();
- }
-
- /**
- * Write WorkbookPr
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @throws PHPExcel_Writer_Exception
- */
- private function writeWorkbookPr(PHPExcel_Shared_XMLWriter $objWriter = null)
- {
- $objWriter->startElement('workbookPr');
-
- if (PHPExcel_Shared_Date::getExcelCalendar() == PHPExcel_Shared_Date::CALENDAR_MAC_1904) {
- $objWriter->writeAttribute('date1904', '1');
- }
-
- $objWriter->writeAttribute('codeName', 'ThisWorkbook');
-
- $objWriter->endElement();
- }
-
- /**
- * Write BookViews
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel $pPHPExcel
- * @throws PHPExcel_Writer_Exception
- */
- private function writeBookViews(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null)
- {
- // bookViews
- $objWriter->startElement('bookViews');
-
- // workbookView
- $objWriter->startElement('workbookView');
-
- $objWriter->writeAttribute('activeTab', $pPHPExcel->getActiveSheetIndex());
- $objWriter->writeAttribute('autoFilterDateGrouping', '1');
- $objWriter->writeAttribute('firstSheet', '0');
- $objWriter->writeAttribute('minimized', '0');
- $objWriter->writeAttribute('showHorizontalScroll', '1');
- $objWriter->writeAttribute('showSheetTabs', '1');
- $objWriter->writeAttribute('showVerticalScroll', '1');
- $objWriter->writeAttribute('tabRatio', '600');
- $objWriter->writeAttribute('visibility', 'visible');
-
- $objWriter->endElement();
-
- $objWriter->endElement();
- }
-
- /**
- * Write WorkbookProtection
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel $pPHPExcel
- * @throws PHPExcel_Writer_Exception
- */
- private function writeWorkbookProtection(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null)
- {
- if ($pPHPExcel->getSecurity()->isSecurityEnabled()) {
- $objWriter->startElement('workbookProtection');
- $objWriter->writeAttribute('lockRevision', ($pPHPExcel->getSecurity()->getLockRevision() ? 'true' : 'false'));
- $objWriter->writeAttribute('lockStructure', ($pPHPExcel->getSecurity()->getLockStructure() ? 'true' : 'false'));
- $objWriter->writeAttribute('lockWindows', ($pPHPExcel->getSecurity()->getLockWindows() ? 'true' : 'false'));
-
- if ($pPHPExcel->getSecurity()->getRevisionsPassword() != '') {
- $objWriter->writeAttribute('revisionsPassword', $pPHPExcel->getSecurity()->getRevisionsPassword());
- }
-
- if ($pPHPExcel->getSecurity()->getWorkbookPassword() != '') {
- $objWriter->writeAttribute('workbookPassword', $pPHPExcel->getSecurity()->getWorkbookPassword());
- }
-
- $objWriter->endElement();
- }
- }
-
- /**
- * Write calcPr
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param boolean $recalcRequired Indicate whether formulas should be recalculated before writing
- * @throws PHPExcel_Writer_Exception
- */
- private function writeCalcPr(PHPExcel_Shared_XMLWriter $objWriter = null, $recalcRequired = true)
- {
- $objWriter->startElement('calcPr');
-
- // Set the calcid to a higher value than Excel itself will use, otherwise Excel will always recalc
- // If MS Excel does do a recalc, then users opening a file in MS Excel will be prompted to save on exit
- // because the file has changed
- $objWriter->writeAttribute('calcId', '999999');
- $objWriter->writeAttribute('calcMode', 'auto');
- // fullCalcOnLoad isn't needed if we've recalculating for the save
- $objWriter->writeAttribute('calcCompleted', ($recalcRequired) ? 1 : 0);
- $objWriter->writeAttribute('fullCalcOnLoad', ($recalcRequired) ? 0 : 1);
-
- $objWriter->endElement();
- }
-
- /**
- * Write sheets
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel $pPHPExcel
- * @throws PHPExcel_Writer_Exception
- */
- private function writeSheets(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null)
- {
- // Write sheets
- $objWriter->startElement('sheets');
- $sheetCount = $pPHPExcel->getSheetCount();
- for ($i = 0; $i < $sheetCount; ++$i) {
- // sheet
- $this->writeSheet(
- $objWriter,
- $pPHPExcel->getSheet($i)->getTitle(),
- ($i + 1),
- ($i + 1 + 3),
- $pPHPExcel->getSheet($i)->getSheetState()
- );
- }
-
- $objWriter->endElement();
- }
-
- /**
- * Write sheet
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param string $pSheetname Sheet name
- * @param int $pSheetId Sheet id
- * @param int $pRelId Relationship ID
- * @param string $sheetState Sheet state (visible, hidden, veryHidden)
- * @throws PHPExcel_Writer_Exception
- */
- private function writeSheet(PHPExcel_Shared_XMLWriter $objWriter = null, $pSheetname = '', $pSheetId = 1, $pRelId = 1, $sheetState = 'visible')
- {
- if ($pSheetname != '') {
- // Write sheet
- $objWriter->startElement('sheet');
- $objWriter->writeAttribute('name', $pSheetname);
- $objWriter->writeAttribute('sheetId', $pSheetId);
- if ($sheetState != 'visible' && $sheetState != '') {
- $objWriter->writeAttribute('state', $sheetState);
- }
- $objWriter->writeAttribute('r:id', 'rId' . $pRelId);
- $objWriter->endElement();
- } else {
- throw new PHPExcel_Writer_Exception("Invalid parameters passed.");
- }
- }
-
- /**
- * Write Defined Names
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel $pPHPExcel
- * @throws PHPExcel_Writer_Exception
- */
- private function writeDefinedNames(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel = null)
- {
- // Write defined names
- $objWriter->startElement('definedNames');
-
- // Named ranges
- if (count($pPHPExcel->getNamedRanges()) > 0) {
- // Named ranges
- $this->writeNamedRanges($objWriter, $pPHPExcel);
- }
-
- // Other defined names
- $sheetCount = $pPHPExcel->getSheetCount();
- for ($i = 0; $i < $sheetCount; ++$i) {
- // definedName for autoFilter
- $this->writeDefinedNameForAutofilter($objWriter, $pPHPExcel->getSheet($i), $i);
-
- // definedName for Print_Titles
- $this->writeDefinedNameForPrintTitles($objWriter, $pPHPExcel->getSheet($i), $i);
-
- // definedName for Print_Area
- $this->writeDefinedNameForPrintArea($objWriter, $pPHPExcel->getSheet($i), $i);
- }
-
- $objWriter->endElement();
- }
-
- /**
- * Write named ranges
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel $pPHPExcel
- * @throws PHPExcel_Writer_Exception
- */
- private function writeNamedRanges(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel $pPHPExcel)
- {
- // Loop named ranges
- $namedRanges = $pPHPExcel->getNamedRanges();
- foreach ($namedRanges as $namedRange) {
- $this->writeDefinedNameForNamedRange($objWriter, $namedRange);
- }
- }
-
- /**
- * Write Defined Name for named range
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_NamedRange $pNamedRange
- * @throws PHPExcel_Writer_Exception
- */
- private function writeDefinedNameForNamedRange(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_NamedRange $pNamedRange)
- {
- // definedName for named range
- $objWriter->startElement('definedName');
- $objWriter->writeAttribute('name', $pNamedRange->getName());
- if ($pNamedRange->getLocalOnly()) {
- $objWriter->writeAttribute('localSheetId', $pNamedRange->getScope()->getParent()->getIndex($pNamedRange->getScope()));
- }
-
- // Create absolute coordinate and write as raw text
- $range = PHPExcel_Cell::splitRange($pNamedRange->getRange());
- for ($i = 0; $i < count($range); $i++) {
- $range[$i][0] = '\'' . str_replace("'", "''", $pNamedRange->getWorksheet()->getTitle()) . '\'!' . PHPExcel_Cell::absoluteReference($range[$i][0]);
- if (isset($range[$i][1])) {
- $range[$i][1] = PHPExcel_Cell::absoluteReference($range[$i][1]);
- }
- }
- $range = PHPExcel_Cell::buildRange($range);
-
- $objWriter->writeRawData($range);
-
- $objWriter->endElement();
- }
-
- /**
- * Write Defined Name for autoFilter
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet
- * @param int $pSheetId
- * @throws PHPExcel_Writer_Exception
- */
- private function writeDefinedNameForAutofilter(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pSheetId = 0)
- {
- // definedName for autoFilter
- $autoFilterRange = $pSheet->getAutoFilter()->getRange();
- if (!empty($autoFilterRange)) {
- $objWriter->startElement('definedName');
- $objWriter->writeAttribute('name', '_xlnm._FilterDatabase');
- $objWriter->writeAttribute('localSheetId', $pSheetId);
- $objWriter->writeAttribute('hidden', '1');
-
- // Create absolute coordinate and write as raw text
- $range = PHPExcel_Cell::splitRange($autoFilterRange);
- $range = $range[0];
- // Strip any worksheet ref so we can make the cell ref absolute
- if (strpos($range[0], '!') !== false) {
- list($ws, $range[0]) = explode('!', $range[0]);
- }
-
- $range[0] = PHPExcel_Cell::absoluteCoordinate($range[0]);
- $range[1] = PHPExcel_Cell::absoluteCoordinate($range[1]);
- $range = implode(':', $range);
-
- $objWriter->writeRawData('\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . $range);
-
- $objWriter->endElement();
- }
- }
-
- /**
- * Write Defined Name for PrintTitles
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet
- * @param int $pSheetId
- * @throws PHPExcel_Writer_Exception
- */
- private function writeDefinedNameForPrintTitles(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pSheetId = 0)
- {
- // definedName for PrintTitles
- if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet() || $pSheet->getPageSetup()->isRowsToRepeatAtTopSet()) {
- $objWriter->startElement('definedName');
- $objWriter->writeAttribute('name', '_xlnm.Print_Titles');
- $objWriter->writeAttribute('localSheetId', $pSheetId);
-
- // Setting string
- $settingString = '';
-
- // Columns to repeat
- if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet()) {
- $repeat = $pSheet->getPageSetup()->getColumnsToRepeatAtLeft();
-
- $settingString .= '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!$' . $repeat[0] . ':$' . $repeat[1];
- }
-
- // Rows to repeat
- if ($pSheet->getPageSetup()->isRowsToRepeatAtTopSet()) {
- if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet()) {
- $settingString .= ',';
- }
-
- $repeat = $pSheet->getPageSetup()->getRowsToRepeatAtTop();
-
- $settingString .= '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!$' . $repeat[0] . ':$' . $repeat[1];
- }
-
- $objWriter->writeRawData($settingString);
-
- $objWriter->endElement();
- }
- }
-
- /**
- * Write Defined Name for PrintTitles
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet
- * @param int $pSheetId
- * @throws PHPExcel_Writer_Exception
- */
- private function writeDefinedNameForPrintArea(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pSheetId = 0)
- {
- // definedName for PrintArea
- if ($pSheet->getPageSetup()->isPrintAreaSet()) {
- $objWriter->startElement('definedName');
- $objWriter->writeAttribute('name', '_xlnm.Print_Area');
- $objWriter->writeAttribute('localSheetId', $pSheetId);
-
- // Setting string
- $settingString = '';
-
- // Print area
- $printArea = PHPExcel_Cell::splitRange($pSheet->getPageSetup()->getPrintArea());
-
- $chunks = array();
- foreach ($printArea as $printAreaRect) {
- $printAreaRect[0] = PHPExcel_Cell::absoluteReference($printAreaRect[0]);
- $printAreaRect[1] = PHPExcel_Cell::absoluteReference($printAreaRect[1]);
- $chunks[] = '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . implode(':', $printAreaRect);
- }
-
- $objWriter->writeRawData(implode(',', $chunks));
-
- $objWriter->endElement();
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/Excel2007/Worksheet.php b/lib/phpexcel/PHPExcel/Writer/Excel2007/Worksheet.php
deleted file mode 100644
index 290bbe77136..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/Excel2007/Worksheet.php
+++ /dev/null
@@ -1,1219 +0,0 @@
-getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
- } else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
- }
-
- // XML header
- $objWriter->startDocument('1.0', 'UTF-8', 'yes');
-
- // Worksheet
- $objWriter->startElement('worksheet');
- $objWriter->writeAttribute('xml:space', 'preserve');
- $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main');
- $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
-
- // sheetPr
- $this->writeSheetPr($objWriter, $pSheet);
-
- // Dimension
- $this->writeDimension($objWriter, $pSheet);
-
- // sheetViews
- $this->writeSheetViews($objWriter, $pSheet);
-
- // sheetFormatPr
- $this->writeSheetFormatPr($objWriter, $pSheet);
-
- // cols
- $this->writeCols($objWriter, $pSheet);
-
- // sheetData
- $this->writeSheetData($objWriter, $pSheet, $pStringTable);
-
- // sheetProtection
- $this->writeSheetProtection($objWriter, $pSheet);
-
- // protectedRanges
- $this->writeProtectedRanges($objWriter, $pSheet);
-
- // autoFilter
- $this->writeAutoFilter($objWriter, $pSheet);
-
- // mergeCells
- $this->writeMergeCells($objWriter, $pSheet);
-
- // conditionalFormatting
- $this->writeConditionalFormatting($objWriter, $pSheet);
-
- // dataValidations
- $this->writeDataValidations($objWriter, $pSheet);
-
- // hyperlinks
- $this->writeHyperlinks($objWriter, $pSheet);
-
- // Print options
- $this->writePrintOptions($objWriter, $pSheet);
-
- // Page margins
- $this->writePageMargins($objWriter, $pSheet);
-
- // Page setup
- $this->writePageSetup($objWriter, $pSheet);
-
- // Header / footer
- $this->writeHeaderFooter($objWriter, $pSheet);
-
- // Breaks
- $this->writeBreaks($objWriter, $pSheet);
-
- // Drawings and/or Charts
- $this->writeDrawings($objWriter, $pSheet, $includeCharts);
-
- // LegacyDrawing
- $this->writeLegacyDrawing($objWriter, $pSheet);
-
- // LegacyDrawingHF
- $this->writeLegacyDrawingHF($objWriter, $pSheet);
-
- $objWriter->endElement();
-
- // Return
- return $objWriter->getData();
- } else {
- throw new PHPExcel_Writer_Exception("Invalid PHPExcel_Worksheet object passed.");
- }
- }
-
- /**
- * Write SheetPr
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writeSheetPr(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- // sheetPr
- $objWriter->startElement('sheetPr');
- //$objWriter->writeAttribute('codeName', $pSheet->getTitle());
- if ($pSheet->getParent()->hasMacros()) {//if the workbook have macros, we need to have codeName for the sheet
- if ($pSheet->hasCodeName()==false) {
- $pSheet->setCodeName($pSheet->getTitle());
- }
- $objWriter->writeAttribute('codeName', $pSheet->getCodeName());
- }
- $autoFilterRange = $pSheet->getAutoFilter()->getRange();
- if (!empty($autoFilterRange)) {
- $objWriter->writeAttribute('filterMode', 1);
- $pSheet->getAutoFilter()->showHideRows();
- }
-
- // tabColor
- if ($pSheet->isTabColorSet()) {
- $objWriter->startElement('tabColor');
- $objWriter->writeAttribute('rgb', $pSheet->getTabColor()->getARGB());
- $objWriter->endElement();
- }
-
- // outlinePr
- $objWriter->startElement('outlinePr');
- $objWriter->writeAttribute('summaryBelow', ($pSheet->getShowSummaryBelow() ? '1' : '0'));
- $objWriter->writeAttribute('summaryRight', ($pSheet->getShowSummaryRight() ? '1' : '0'));
- $objWriter->endElement();
-
- // pageSetUpPr
- if ($pSheet->getPageSetup()->getFitToPage()) {
- $objWriter->startElement('pageSetUpPr');
- $objWriter->writeAttribute('fitToPage', '1');
- $objWriter->endElement();
- }
-
- $objWriter->endElement();
- }
-
- /**
- * Write Dimension
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writeDimension(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- // dimension
- $objWriter->startElement('dimension');
- $objWriter->writeAttribute('ref', $pSheet->calculateWorksheetDimension());
- $objWriter->endElement();
- }
-
- /**
- * Write SheetViews
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writeSheetViews(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- // sheetViews
- $objWriter->startElement('sheetViews');
-
- // Sheet selected?
- $sheetSelected = false;
- if ($this->getParentWriter()->getPHPExcel()->getIndex($pSheet) == $this->getParentWriter()->getPHPExcel()->getActiveSheetIndex()) {
- $sheetSelected = true;
- }
-
- // sheetView
- $objWriter->startElement('sheetView');
- $objWriter->writeAttribute('tabSelected', $sheetSelected ? '1' : '0');
- $objWriter->writeAttribute('workbookViewId', '0');
-
- // Zoom scales
- if ($pSheet->getSheetView()->getZoomScale() != 100) {
- $objWriter->writeAttribute('zoomScale', $pSheet->getSheetView()->getZoomScale());
- }
- if ($pSheet->getSheetView()->getZoomScaleNormal() != 100) {
- $objWriter->writeAttribute('zoomScaleNormal', $pSheet->getSheetView()->getZoomScaleNormal());
- }
-
- // View Layout Type
- if ($pSheet->getSheetView()->getView() !== PHPExcel_Worksheet_SheetView::SHEETVIEW_NORMAL) {
- $objWriter->writeAttribute('view', $pSheet->getSheetView()->getView());
- }
-
- // Gridlines
- if ($pSheet->getShowGridlines()) {
- $objWriter->writeAttribute('showGridLines', 'true');
- } else {
- $objWriter->writeAttribute('showGridLines', 'false');
- }
-
- // Row and column headers
- if ($pSheet->getShowRowColHeaders()) {
- $objWriter->writeAttribute('showRowColHeaders', '1');
- } else {
- $objWriter->writeAttribute('showRowColHeaders', '0');
- }
-
- // Right-to-left
- if ($pSheet->getRightToLeft()) {
- $objWriter->writeAttribute('rightToLeft', 'true');
- }
-
- $activeCell = $pSheet->getActiveCell();
-
- // Pane
- $pane = '';
- $topLeftCell = $pSheet->getFreezePane();
- if (($topLeftCell != '') && ($topLeftCell != 'A1')) {
- $activeCell = $topLeftCell;
- // Calculate freeze coordinates
- $xSplit = $ySplit = 0;
-
- list($xSplit, $ySplit) = PHPExcel_Cell::coordinateFromString($topLeftCell);
- $xSplit = PHPExcel_Cell::columnIndexFromString($xSplit);
-
- // pane
- $pane = 'topRight';
- $objWriter->startElement('pane');
- if ($xSplit > 1) {
- $objWriter->writeAttribute('xSplit', $xSplit - 1);
- }
- if ($ySplit > 1) {
- $objWriter->writeAttribute('ySplit', $ySplit - 1);
- $pane = ($xSplit > 1) ? 'bottomRight' : 'bottomLeft';
- }
- $objWriter->writeAttribute('topLeftCell', $topLeftCell);
- $objWriter->writeAttribute('activePane', $pane);
- $objWriter->writeAttribute('state', 'frozen');
- $objWriter->endElement();
-
- if (($xSplit > 1) && ($ySplit > 1)) {
- // Write additional selections if more than two panes (ie both an X and a Y split)
- $objWriter->startElement('selection');
- $objWriter->writeAttribute('pane', 'topRight');
- $objWriter->endElement();
- $objWriter->startElement('selection');
- $objWriter->writeAttribute('pane', 'bottomLeft');
- $objWriter->endElement();
- }
- }
-
- // Selection
-// if ($pane != '') {
- // Only need to write selection element if we have a split pane
- // We cheat a little by over-riding the active cell selection, setting it to the split cell
- $objWriter->startElement('selection');
- if ($pane != '') {
- $objWriter->writeAttribute('pane', $pane);
- }
- $objWriter->writeAttribute('activeCell', $activeCell);
- $objWriter->writeAttribute('sqref', $activeCell);
- $objWriter->endElement();
-// }
-
- $objWriter->endElement();
-
- $objWriter->endElement();
- }
-
- /**
- * Write SheetFormatPr
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writeSheetFormatPr(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- // sheetFormatPr
- $objWriter->startElement('sheetFormatPr');
-
- // Default row height
- if ($pSheet->getDefaultRowDimension()->getRowHeight() >= 0) {
- $objWriter->writeAttribute('customHeight', 'true');
- $objWriter->writeAttribute('defaultRowHeight', PHPExcel_Shared_String::FormatNumber($pSheet->getDefaultRowDimension()->getRowHeight()));
- } else {
- $objWriter->writeAttribute('defaultRowHeight', '14.4');
- }
-
- // Set Zero Height row
- if ((string)$pSheet->getDefaultRowDimension()->getZeroHeight() == '1' ||
- strtolower((string)$pSheet->getDefaultRowDimension()->getZeroHeight()) == 'true') {
- $objWriter->writeAttribute('zeroHeight', '1');
- }
-
- // Default column width
- if ($pSheet->getDefaultColumnDimension()->getWidth() >= 0) {
- $objWriter->writeAttribute('defaultColWidth', PHPExcel_Shared_String::FormatNumber($pSheet->getDefaultColumnDimension()->getWidth()));
- }
-
- // Outline level - row
- $outlineLevelRow = 0;
- foreach ($pSheet->getRowDimensions() as $dimension) {
- if ($dimension->getOutlineLevel() > $outlineLevelRow) {
- $outlineLevelRow = $dimension->getOutlineLevel();
- }
- }
- $objWriter->writeAttribute('outlineLevelRow', (int)$outlineLevelRow);
-
- // Outline level - column
- $outlineLevelCol = 0;
- foreach ($pSheet->getColumnDimensions() as $dimension) {
- if ($dimension->getOutlineLevel() > $outlineLevelCol) {
- $outlineLevelCol = $dimension->getOutlineLevel();
- }
- }
- $objWriter->writeAttribute('outlineLevelCol', (int)$outlineLevelCol);
-
- $objWriter->endElement();
- }
-
- /**
- * Write Cols
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writeCols(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- // cols
- if (count($pSheet->getColumnDimensions()) > 0) {
- $objWriter->startElement('cols');
-
- $pSheet->calculateColumnWidths();
-
- // Loop through column dimensions
- foreach ($pSheet->getColumnDimensions() as $colDimension) {
- // col
- $objWriter->startElement('col');
- $objWriter->writeAttribute('min', PHPExcel_Cell::columnIndexFromString($colDimension->getColumnIndex()));
- $objWriter->writeAttribute('max', PHPExcel_Cell::columnIndexFromString($colDimension->getColumnIndex()));
-
- if ($colDimension->getWidth() < 0) {
- // No width set, apply default of 10
- $objWriter->writeAttribute('width', '9.10');
- } else {
- // Width set
- $objWriter->writeAttribute('width', PHPExcel_Shared_String::FormatNumber($colDimension->getWidth()));
- }
-
- // Column visibility
- if ($colDimension->getVisible() == false) {
- $objWriter->writeAttribute('hidden', 'true');
- }
-
- // Auto size?
- if ($colDimension->getAutoSize()) {
- $objWriter->writeAttribute('bestFit', 'true');
- }
-
- // Custom width?
- if ($colDimension->getWidth() != $pSheet->getDefaultColumnDimension()->getWidth()) {
- $objWriter->writeAttribute('customWidth', 'true');
- }
-
- // Collapsed
- if ($colDimension->getCollapsed() == true) {
- $objWriter->writeAttribute('collapsed', 'true');
- }
-
- // Outline level
- if ($colDimension->getOutlineLevel() > 0) {
- $objWriter->writeAttribute('outlineLevel', $colDimension->getOutlineLevel());
- }
-
- // Style
- $objWriter->writeAttribute('style', $colDimension->getXfIndex());
-
- $objWriter->endElement();
- }
-
- $objWriter->endElement();
- }
- }
-
- /**
- * Write SheetProtection
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writeSheetProtection(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- // sheetProtection
- $objWriter->startElement('sheetProtection');
-
- if ($pSheet->getProtection()->getPassword() != '') {
- $objWriter->writeAttribute('password', $pSheet->getProtection()->getPassword());
- }
-
- $objWriter->writeAttribute('sheet', ($pSheet->getProtection()->getSheet() ? 'true' : 'false'));
- $objWriter->writeAttribute('objects', ($pSheet->getProtection()->getObjects() ? 'true' : 'false'));
- $objWriter->writeAttribute('scenarios', ($pSheet->getProtection()->getScenarios() ? 'true' : 'false'));
- $objWriter->writeAttribute('formatCells', ($pSheet->getProtection()->getFormatCells() ? 'true' : 'false'));
- $objWriter->writeAttribute('formatColumns', ($pSheet->getProtection()->getFormatColumns() ? 'true' : 'false'));
- $objWriter->writeAttribute('formatRows', ($pSheet->getProtection()->getFormatRows() ? 'true' : 'false'));
- $objWriter->writeAttribute('insertColumns', ($pSheet->getProtection()->getInsertColumns() ? 'true' : 'false'));
- $objWriter->writeAttribute('insertRows', ($pSheet->getProtection()->getInsertRows() ? 'true' : 'false'));
- $objWriter->writeAttribute('insertHyperlinks', ($pSheet->getProtection()->getInsertHyperlinks() ? 'true' : 'false'));
- $objWriter->writeAttribute('deleteColumns', ($pSheet->getProtection()->getDeleteColumns() ? 'true' : 'false'));
- $objWriter->writeAttribute('deleteRows', ($pSheet->getProtection()->getDeleteRows() ? 'true' : 'false'));
- $objWriter->writeAttribute('selectLockedCells', ($pSheet->getProtection()->getSelectLockedCells() ? 'true' : 'false'));
- $objWriter->writeAttribute('sort', ($pSheet->getProtection()->getSort() ? 'true' : 'false'));
- $objWriter->writeAttribute('autoFilter', ($pSheet->getProtection()->getAutoFilter() ? 'true' : 'false'));
- $objWriter->writeAttribute('pivotTables', ($pSheet->getProtection()->getPivotTables() ? 'true' : 'false'));
- $objWriter->writeAttribute('selectUnlockedCells', ($pSheet->getProtection()->getSelectUnlockedCells() ? 'true' : 'false'));
- $objWriter->endElement();
- }
-
- /**
- * Write ConditionalFormatting
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writeConditionalFormatting(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- // Conditional id
- $id = 1;
-
- // Loop through styles in the current worksheet
- foreach ($pSheet->getConditionalStylesCollection() as $cellCoordinate => $conditionalStyles) {
- foreach ($conditionalStyles as $conditional) {
- // WHY was this again?
- // if ($this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode($conditional->getHashCode()) == '') {
- // continue;
- // }
- if ($conditional->getConditionType() != PHPExcel_Style_Conditional::CONDITION_NONE) {
- // conditionalFormatting
- $objWriter->startElement('conditionalFormatting');
- $objWriter->writeAttribute('sqref', $cellCoordinate);
-
- // cfRule
- $objWriter->startElement('cfRule');
- $objWriter->writeAttribute('type', $conditional->getConditionType());
- $objWriter->writeAttribute('dxfId', $this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode($conditional->getHashCode()));
- $objWriter->writeAttribute('priority', $id++);
-
- if (($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS || $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT)
- && $conditional->getOperatorType() != PHPExcel_Style_Conditional::OPERATOR_NONE) {
- $objWriter->writeAttribute('operator', $conditional->getOperatorType());
- }
-
- if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT
- && !is_null($conditional->getText())) {
- $objWriter->writeAttribute('text', $conditional->getText());
- }
-
- if ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT
- && $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_CONTAINSTEXT
- && !is_null($conditional->getText())) {
- $objWriter->writeElement('formula', 'NOT(ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . ')))');
- } elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT
- && $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_BEGINSWITH
- && !is_null($conditional->getText())) {
- $objWriter->writeElement('formula', 'LEFT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"');
- } elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT
- && $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_ENDSWITH
- && !is_null($conditional->getText())) {
- $objWriter->writeElement('formula', 'RIGHT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"');
- } elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT
- && $conditional->getOperatorType() == PHPExcel_Style_Conditional::OPERATOR_NOTCONTAINS
- && !is_null($conditional->getText())) {
- $objWriter->writeElement('formula', 'ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . '))');
- } elseif ($conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CELLIS
- || $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT
- || $conditional->getConditionType() == PHPExcel_Style_Conditional::CONDITION_EXPRESSION) {
- foreach ($conditional->getConditions() as $formula) {
- // Formula
- $objWriter->writeElement('formula', $formula);
- }
- }
-
- $objWriter->endElement();
-
- $objWriter->endElement();
- }
- }
- }
- }
-
- /**
- * Write DataValidations
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writeDataValidations(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- // Datavalidation collection
- $dataValidationCollection = $pSheet->getDataValidationCollection();
-
- // Write data validations?
- if (!empty($dataValidationCollection)) {
- $objWriter->startElement('dataValidations');
- $objWriter->writeAttribute('count', count($dataValidationCollection));
-
- foreach ($dataValidationCollection as $coordinate => $dv) {
- $objWriter->startElement('dataValidation');
-
- if ($dv->getType() != '') {
- $objWriter->writeAttribute('type', $dv->getType());
- }
-
- if ($dv->getErrorStyle() != '') {
- $objWriter->writeAttribute('errorStyle', $dv->getErrorStyle());
- }
-
- if ($dv->getOperator() != '') {
- $objWriter->writeAttribute('operator', $dv->getOperator());
- }
-
- $objWriter->writeAttribute('allowBlank', ($dv->getAllowBlank() ? '1' : '0'));
- $objWriter->writeAttribute('showDropDown', (!$dv->getShowDropDown() ? '1' : '0'));
- $objWriter->writeAttribute('showInputMessage', ($dv->getShowInputMessage() ? '1' : '0'));
- $objWriter->writeAttribute('showErrorMessage', ($dv->getShowErrorMessage() ? '1' : '0'));
-
- if ($dv->getErrorTitle() !== '') {
- $objWriter->writeAttribute('errorTitle', $dv->getErrorTitle());
- }
- if ($dv->getError() !== '') {
- $objWriter->writeAttribute('error', $dv->getError());
- }
- if ($dv->getPromptTitle() !== '') {
- $objWriter->writeAttribute('promptTitle', $dv->getPromptTitle());
- }
- if ($dv->getPrompt() !== '') {
- $objWriter->writeAttribute('prompt', $dv->getPrompt());
- }
-
- $objWriter->writeAttribute('sqref', $coordinate);
-
- if ($dv->getFormula1() !== '') {
- $objWriter->writeElement('formula1', $dv->getFormula1());
- }
- if ($dv->getFormula2() !== '') {
- $objWriter->writeElement('formula2', $dv->getFormula2());
- }
-
- $objWriter->endElement();
- }
-
- $objWriter->endElement();
- }
- }
-
- /**
- * Write Hyperlinks
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writeHyperlinks(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- // Hyperlink collection
- $hyperlinkCollection = $pSheet->getHyperlinkCollection();
-
- // Relation ID
- $relationId = 1;
-
- // Write hyperlinks?
- if (!empty($hyperlinkCollection)) {
- $objWriter->startElement('hyperlinks');
-
- foreach ($hyperlinkCollection as $coordinate => $hyperlink) {
- $objWriter->startElement('hyperlink');
-
- $objWriter->writeAttribute('ref', $coordinate);
- if (!$hyperlink->isInternal()) {
- $objWriter->writeAttribute('r:id', 'rId_hyperlink_' . $relationId);
- ++$relationId;
- } else {
- $objWriter->writeAttribute('location', str_replace('sheet://', '', $hyperlink->getUrl()));
- }
-
- if ($hyperlink->getTooltip() != '') {
- $objWriter->writeAttribute('tooltip', $hyperlink->getTooltip());
- }
-
- $objWriter->endElement();
- }
-
- $objWriter->endElement();
- }
- }
-
- /**
- * Write ProtectedRanges
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writeProtectedRanges(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- if (count($pSheet->getProtectedCells()) > 0) {
- // protectedRanges
- $objWriter->startElement('protectedRanges');
-
- // Loop protectedRanges
- foreach ($pSheet->getProtectedCells() as $protectedCell => $passwordHash) {
- // protectedRange
- $objWriter->startElement('protectedRange');
- $objWriter->writeAttribute('name', 'p' . md5($protectedCell));
- $objWriter->writeAttribute('sqref', $protectedCell);
- if (!empty($passwordHash)) {
- $objWriter->writeAttribute('password', $passwordHash);
- }
- $objWriter->endElement();
- }
-
- $objWriter->endElement();
- }
- }
-
- /**
- * Write MergeCells
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writeMergeCells(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- if (count($pSheet->getMergeCells()) > 0) {
- // mergeCells
- $objWriter->startElement('mergeCells');
-
- // Loop mergeCells
- foreach ($pSheet->getMergeCells() as $mergeCell) {
- // mergeCell
- $objWriter->startElement('mergeCell');
- $objWriter->writeAttribute('ref', $mergeCell);
- $objWriter->endElement();
- }
-
- $objWriter->endElement();
- }
- }
-
- /**
- * Write PrintOptions
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writePrintOptions(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- // printOptions
- $objWriter->startElement('printOptions');
-
- $objWriter->writeAttribute('gridLines', ($pSheet->getPrintGridlines() ? 'true': 'false'));
- $objWriter->writeAttribute('gridLinesSet', 'true');
-
- if ($pSheet->getPageSetup()->getHorizontalCentered()) {
- $objWriter->writeAttribute('horizontalCentered', 'true');
- }
-
- if ($pSheet->getPageSetup()->getVerticalCentered()) {
- $objWriter->writeAttribute('verticalCentered', 'true');
- }
-
- $objWriter->endElement();
- }
-
- /**
- * Write PageMargins
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writePageMargins(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- // pageMargins
- $objWriter->startElement('pageMargins');
- $objWriter->writeAttribute('left', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getLeft()));
- $objWriter->writeAttribute('right', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getRight()));
- $objWriter->writeAttribute('top', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getTop()));
- $objWriter->writeAttribute('bottom', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getBottom()));
- $objWriter->writeAttribute('header', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getHeader()));
- $objWriter->writeAttribute('footer', PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getFooter()));
- $objWriter->endElement();
- }
-
- /**
- * Write AutoFilter
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writeAutoFilter(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- $autoFilterRange = $pSheet->getAutoFilter()->getRange();
- if (!empty($autoFilterRange)) {
- // autoFilter
- $objWriter->startElement('autoFilter');
-
- // Strip any worksheet reference from the filter coordinates
- $range = PHPExcel_Cell::splitRange($autoFilterRange);
- $range = $range[0];
- // Strip any worksheet ref
- if (strpos($range[0], '!') !== false) {
- list($ws, $range[0]) = explode('!', $range[0]);
- }
- $range = implode(':', $range);
-
- $objWriter->writeAttribute('ref', str_replace('$', '', $range));
-
- $columns = $pSheet->getAutoFilter()->getColumns();
- if (count($columns > 0)) {
- foreach ($columns as $columnID => $column) {
- $rules = $column->getRules();
- if (count($rules) > 0) {
- $objWriter->startElement('filterColumn');
- $objWriter->writeAttribute('colId', $pSheet->getAutoFilter()->getColumnOffset($columnID));
-
- $objWriter->startElement($column->getFilterType());
- if ($column->getJoin() == PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_COLUMN_JOIN_AND) {
- $objWriter->writeAttribute('and', 1);
- }
-
- foreach ($rules as $rule) {
- if (($column->getFilterType() === PHPExcel_Worksheet_AutoFilter_Column::AUTOFILTER_FILTERTYPE_FILTER) &&
- ($rule->getOperator() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL) &&
- ($rule->getValue() === '')) {
- // Filter rule for Blanks
- $objWriter->writeAttribute('blank', 1);
- } elseif ($rule->getRuleType() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER) {
- // Dynamic Filter Rule
- $objWriter->writeAttribute('type', $rule->getGrouping());
- $val = $column->getAttribute('val');
- if ($val !== null) {
- $objWriter->writeAttribute('val', $val);
- }
- $maxVal = $column->getAttribute('maxVal');
- if ($maxVal !== null) {
- $objWriter->writeAttribute('maxVal', $maxVal);
- }
- } elseif ($rule->getRuleType() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_TOPTENFILTER) {
- // Top 10 Filter Rule
- $objWriter->writeAttribute('val', $rule->getValue());
- $objWriter->writeAttribute('percent', (($rule->getOperator() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT) ? '1' : '0'));
- $objWriter->writeAttribute('top', (($rule->getGrouping() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) ? '1': '0'));
- } else {
- // Filter, DateGroupItem or CustomFilter
- $objWriter->startElement($rule->getRuleType());
-
- if ($rule->getOperator() !== PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_COLUMN_RULE_EQUAL) {
- $objWriter->writeAttribute('operator', $rule->getOperator());
- }
- if ($rule->getRuleType() === PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_DATEGROUP) {
- // Date Group filters
- foreach ($rule->getValue() as $key => $value) {
- if ($value > '') {
- $objWriter->writeAttribute($key, $value);
- }
- }
- $objWriter->writeAttribute('dateTimeGrouping', $rule->getGrouping());
- } else {
- $objWriter->writeAttribute('val', $rule->getValue());
- }
-
- $objWriter->endElement();
- }
- }
-
- $objWriter->endElement();
-
- $objWriter->endElement();
- }
- }
- }
- $objWriter->endElement();
- }
- }
-
- /**
- * Write PageSetup
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writePageSetup(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- // pageSetup
- $objWriter->startElement('pageSetup');
- $objWriter->writeAttribute('paperSize', $pSheet->getPageSetup()->getPaperSize());
- $objWriter->writeAttribute('orientation', $pSheet->getPageSetup()->getOrientation());
-
- if (!is_null($pSheet->getPageSetup()->getScale())) {
- $objWriter->writeAttribute('scale', $pSheet->getPageSetup()->getScale());
- }
- if (!is_null($pSheet->getPageSetup()->getFitToHeight())) {
- $objWriter->writeAttribute('fitToHeight', $pSheet->getPageSetup()->getFitToHeight());
- } else {
- $objWriter->writeAttribute('fitToHeight', '0');
- }
- if (!is_null($pSheet->getPageSetup()->getFitToWidth())) {
- $objWriter->writeAttribute('fitToWidth', $pSheet->getPageSetup()->getFitToWidth());
- } else {
- $objWriter->writeAttribute('fitToWidth', '0');
- }
- if (!is_null($pSheet->getPageSetup()->getFirstPageNumber())) {
- $objWriter->writeAttribute('firstPageNumber', $pSheet->getPageSetup()->getFirstPageNumber());
- $objWriter->writeAttribute('useFirstPageNumber', '1');
- }
-
- $objWriter->endElement();
- }
-
- /**
- * Write Header / Footer
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writeHeaderFooter(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- // headerFooter
- $objWriter->startElement('headerFooter');
- $objWriter->writeAttribute('differentOddEven', ($pSheet->getHeaderFooter()->getDifferentOddEven() ? 'true' : 'false'));
- $objWriter->writeAttribute('differentFirst', ($pSheet->getHeaderFooter()->getDifferentFirst() ? 'true' : 'false'));
- $objWriter->writeAttribute('scaleWithDoc', ($pSheet->getHeaderFooter()->getScaleWithDocument() ? 'true' : 'false'));
- $objWriter->writeAttribute('alignWithMargins', ($pSheet->getHeaderFooter()->getAlignWithMargins() ? 'true' : 'false'));
-
- $objWriter->writeElement('oddHeader', $pSheet->getHeaderFooter()->getOddHeader());
- $objWriter->writeElement('oddFooter', $pSheet->getHeaderFooter()->getOddFooter());
- $objWriter->writeElement('evenHeader', $pSheet->getHeaderFooter()->getEvenHeader());
- $objWriter->writeElement('evenFooter', $pSheet->getHeaderFooter()->getEvenFooter());
- $objWriter->writeElement('firstHeader', $pSheet->getHeaderFooter()->getFirstHeader());
- $objWriter->writeElement('firstFooter', $pSheet->getHeaderFooter()->getFirstFooter());
- $objWriter->endElement();
- }
-
- /**
- * Write Breaks
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writeBreaks(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- // Get row and column breaks
- $aRowBreaks = array();
- $aColumnBreaks = array();
- foreach ($pSheet->getBreaks() as $cell => $breakType) {
- if ($breakType == PHPExcel_Worksheet::BREAK_ROW) {
- $aRowBreaks[] = $cell;
- } elseif ($breakType == PHPExcel_Worksheet::BREAK_COLUMN) {
- $aColumnBreaks[] = $cell;
- }
- }
-
- // rowBreaks
- if (!empty($aRowBreaks)) {
- $objWriter->startElement('rowBreaks');
- $objWriter->writeAttribute('count', count($aRowBreaks));
- $objWriter->writeAttribute('manualBreakCount', count($aRowBreaks));
-
- foreach ($aRowBreaks as $cell) {
- $coords = PHPExcel_Cell::coordinateFromString($cell);
-
- $objWriter->startElement('brk');
- $objWriter->writeAttribute('id', $coords[1]);
- $objWriter->writeAttribute('man', '1');
- $objWriter->endElement();
- }
-
- $objWriter->endElement();
- }
-
- // Second, write column breaks
- if (!empty($aColumnBreaks)) {
- $objWriter->startElement('colBreaks');
- $objWriter->writeAttribute('count', count($aColumnBreaks));
- $objWriter->writeAttribute('manualBreakCount', count($aColumnBreaks));
-
- foreach ($aColumnBreaks as $cell) {
- $coords = PHPExcel_Cell::coordinateFromString($cell);
-
- $objWriter->startElement('brk');
- $objWriter->writeAttribute('id', PHPExcel_Cell::columnIndexFromString($coords[0]) - 1);
- $objWriter->writeAttribute('man', '1');
- $objWriter->endElement();
- }
-
- $objWriter->endElement();
- }
- }
-
- /**
- * Write SheetData
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @param string[] $pStringTable String table
- * @throws PHPExcel_Writer_Exception
- */
- private function writeSheetData(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pStringTable = null)
- {
- if (is_array($pStringTable)) {
- // Flipped stringtable, for faster index searching
- $aFlippedStringTable = $this->getParentWriter()->getWriterPart('stringtable')->flipStringTable($pStringTable);
-
- // sheetData
- $objWriter->startElement('sheetData');
-
- // Get column count
- $colCount = PHPExcel_Cell::columnIndexFromString($pSheet->getHighestColumn());
-
- // Highest row number
- $highestRow = $pSheet->getHighestRow();
-
- // Loop through cells
- $cellsByRow = array();
- foreach ($pSheet->getCellCollection() as $cellID) {
- $cellAddress = PHPExcel_Cell::coordinateFromString($cellID);
- $cellsByRow[$cellAddress[1]][] = $cellID;
- }
-
- $currentRow = 0;
- while ($currentRow++ < $highestRow) {
- // Get row dimension
- $rowDimension = $pSheet->getRowDimension($currentRow);
-
- // Write current row?
- $writeCurrentRow = isset($cellsByRow[$currentRow]) || $rowDimension->getRowHeight() >= 0 || $rowDimension->getVisible() == false || $rowDimension->getCollapsed() == true || $rowDimension->getOutlineLevel() > 0 || $rowDimension->getXfIndex() !== null;
-
- if ($writeCurrentRow) {
- // Start a new row
- $objWriter->startElement('row');
- $objWriter->writeAttribute('r', $currentRow);
- $objWriter->writeAttribute('spans', '1:' . $colCount);
-
- // Row dimensions
- if ($rowDimension->getRowHeight() >= 0) {
- $objWriter->writeAttribute('customHeight', '1');
- $objWriter->writeAttribute('ht', PHPExcel_Shared_String::FormatNumber($rowDimension->getRowHeight()));
- }
-
- // Row visibility
- if ($rowDimension->getVisible() == false) {
- $objWriter->writeAttribute('hidden', 'true');
- }
-
- // Collapsed
- if ($rowDimension->getCollapsed() == true) {
- $objWriter->writeAttribute('collapsed', 'true');
- }
-
- // Outline level
- if ($rowDimension->getOutlineLevel() > 0) {
- $objWriter->writeAttribute('outlineLevel', $rowDimension->getOutlineLevel());
- }
-
- // Style
- if ($rowDimension->getXfIndex() !== null) {
- $objWriter->writeAttribute('s', $rowDimension->getXfIndex());
- $objWriter->writeAttribute('customFormat', '1');
- }
-
- // Write cells
- if (isset($cellsByRow[$currentRow])) {
- foreach ($cellsByRow[$currentRow] as $cellAddress) {
- // Write cell
- $this->writeCell($objWriter, $pSheet, $cellAddress, $pStringTable, $aFlippedStringTable);
- }
- }
-
- // End row
- $objWriter->endElement();
- }
- }
-
- $objWriter->endElement();
- } else {
- throw new PHPExcel_Writer_Exception("Invalid parameters passed.");
- }
- }
-
- /**
- * Write Cell
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @param PHPExcel_Cell $pCellAddress Cell Address
- * @param string[] $pStringTable String table
- * @param string[] $pFlippedStringTable String table (flipped), for faster index searching
- * @throws PHPExcel_Writer_Exception
- */
- private function writeCell(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $pCellAddress = null, $pStringTable = null, $pFlippedStringTable = null)
- {
- if (is_array($pStringTable) && is_array($pFlippedStringTable)) {
- // Cell
- $pCell = $pSheet->getCell($pCellAddress);
- $objWriter->startElement('c');
- $objWriter->writeAttribute('r', $pCellAddress);
-
- // Sheet styles
- if ($pCell->getXfIndex() != '') {
- $objWriter->writeAttribute('s', $pCell->getXfIndex());
- }
-
- // If cell value is supplied, write cell value
- $cellValue = $pCell->getValue();
- if (is_object($cellValue) || $cellValue !== '') {
- // Map type
- $mappedType = $pCell->getDataType();
-
- // Write data type depending on its type
- switch (strtolower($mappedType)) {
- case 'inlinestr': // Inline string
- case 's': // String
- case 'b': // Boolean
- $objWriter->writeAttribute('t', $mappedType);
- break;
- case 'f': // Formula
- $calculatedValue = ($this->getParentWriter()->getPreCalculateFormulas()) ?
- $pCell->getCalculatedValue() :
- $cellValue;
- if (is_string($calculatedValue)) {
- $objWriter->writeAttribute('t', 'str');
- }
- break;
- case 'e': // Error
- $objWriter->writeAttribute('t', $mappedType);
- }
-
- // Write data depending on its type
- switch (strtolower($mappedType)) {
- case 'inlinestr': // Inline string
- if (! $cellValue instanceof PHPExcel_RichText) {
- $objWriter->writeElement('t', PHPExcel_Shared_String::ControlCharacterPHP2OOXML(htmlspecialchars($cellValue)));
- } elseif ($cellValue instanceof PHPExcel_RichText) {
- $objWriter->startElement('is');
- $this->getParentWriter()->getWriterPart('stringtable')->writeRichText($objWriter, $cellValue);
- $objWriter->endElement();
- }
-
- break;
- case 's': // String
- if (! $cellValue instanceof PHPExcel_RichText) {
- if (isset($pFlippedStringTable[$cellValue])) {
- $objWriter->writeElement('v', $pFlippedStringTable[$cellValue]);
- }
- } elseif ($cellValue instanceof PHPExcel_RichText) {
- $objWriter->writeElement('v', $pFlippedStringTable[$cellValue->getHashCode()]);
- }
-
- break;
- case 'f': // Formula
- $attributes = $pCell->getFormulaAttributes();
- if ($attributes['t'] == 'array') {
- $objWriter->startElement('f');
- $objWriter->writeAttribute('t', 'array');
- $objWriter->writeAttribute('ref', $pCellAddress);
- $objWriter->writeAttribute('aca', '1');
- $objWriter->writeAttribute('ca', '1');
- $objWriter->text(substr($cellValue, 1));
- $objWriter->endElement();
- } else {
- $objWriter->writeElement('f', substr($cellValue, 1));
- }
- if ($this->getParentWriter()->getOffice2003Compatibility() === false) {
- if ($this->getParentWriter()->getPreCalculateFormulas()) {
-// $calculatedValue = $pCell->getCalculatedValue();
- if (!is_array($calculatedValue) && substr($calculatedValue, 0, 1) != '#') {
- $objWriter->writeElement('v', PHPExcel_Shared_String::FormatNumber($calculatedValue));
- } else {
- $objWriter->writeElement('v', '0');
- }
- } else {
- $objWriter->writeElement('v', '0');
- }
- }
- break;
- case 'n': // Numeric
- // force point as decimal separator in case current locale uses comma
- $objWriter->writeElement('v', str_replace(',', '.', $cellValue));
- break;
- case 'b': // Boolean
- $objWriter->writeElement('v', ($cellValue ? '1' : '0'));
- break;
- case 'e': // Error
- if (substr($cellValue, 0, 1) == '=') {
- $objWriter->writeElement('f', substr($cellValue, 1));
- $objWriter->writeElement('v', substr($cellValue, 1));
- } else {
- $objWriter->writeElement('v', $cellValue);
- }
-
- break;
- }
- }
-
- $objWriter->endElement();
- } else {
- throw new PHPExcel_Writer_Exception("Invalid parameters passed.");
- }
- }
-
- /**
- * Write Drawings
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @param boolean $includeCharts Flag indicating if we should include drawing details for charts
- * @throws PHPExcel_Writer_Exception
- */
- private function writeDrawings(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null, $includeCharts = false)
- {
- $chartCount = ($includeCharts) ? $pSheet->getChartCollection()->count() : 0;
- // If sheet contains drawings, add the relationships
- if (($pSheet->getDrawingCollection()->count() > 0) ||
- ($chartCount > 0)) {
- $objWriter->startElement('drawing');
- $objWriter->writeAttribute('r:id', 'rId1');
- $objWriter->endElement();
- }
- }
-
- /**
- * Write LegacyDrawing
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writeLegacyDrawing(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- // If sheet contains comments, add the relationships
- if (count($pSheet->getComments()) > 0) {
- $objWriter->startElement('legacyDrawing');
- $objWriter->writeAttribute('r:id', 'rId_comments_vml1');
- $objWriter->endElement();
- }
- }
-
- /**
- * Write LegacyDrawingHF
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Worksheet $pSheet Worksheet
- * @throws PHPExcel_Writer_Exception
- */
- private function writeLegacyDrawingHF(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
- {
- // If sheet contains images, add the relationships
- if (count($pSheet->getHeaderFooter()->getImages()) > 0) {
- $objWriter->startElement('legacyDrawingHF');
- $objWriter->writeAttribute('r:id', 'rId_headerfooter_vml1');
- $objWriter->endElement();
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/Excel2007/WriterPart.php b/lib/phpexcel/PHPExcel/Writer/Excel2007/WriterPart.php
deleted file mode 100644
index 806ebe510a6..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/Excel2007/WriterPart.php
+++ /dev/null
@@ -1,75 +0,0 @@
-parentWriter = $pWriter;
- }
-
- /**
- * Get parent IWriter object
- *
- * @return PHPExcel_Writer_IWriter
- * @throws PHPExcel_Writer_Exception
- */
- public function getParentWriter()
- {
- if (!is_null($this->parentWriter)) {
- return $this->parentWriter;
- } else {
- throw new PHPExcel_Writer_Exception("No parent PHPExcel_Writer_IWriter assigned.");
- }
- }
-
- /**
- * Set parent IWriter object
- *
- * @param PHPExcel_Writer_IWriter $pWriter
- * @throws PHPExcel_Writer_Exception
- */
- public function __construct(PHPExcel_Writer_IWriter $pWriter = null)
- {
- if (!is_null($pWriter)) {
- $this->parentWriter = $pWriter;
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/Exception.php b/lib/phpexcel/PHPExcel/Writer/Exception.php
deleted file mode 100644
index bfa0056815d..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/Exception.php
+++ /dev/null
@@ -1,46 +0,0 @@
-line = $line;
- $e->file = $file;
- throw $e;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/IWriter.php b/lib/phpexcel/PHPExcel/Writer/IWriter.php
deleted file mode 100644
index c7cfe740586..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/IWriter.php
+++ /dev/null
@@ -1,37 +0,0 @@
-setPHPExcel($pPHPExcel);
-
- $writerPartsArray = array(
- 'content' => 'PHPExcel_Writer_OpenDocument_Content',
- 'meta' => 'PHPExcel_Writer_OpenDocument_Meta',
- 'meta_inf' => 'PHPExcel_Writer_OpenDocument_MetaInf',
- 'mimetype' => 'PHPExcel_Writer_OpenDocument_Mimetype',
- 'settings' => 'PHPExcel_Writer_OpenDocument_Settings',
- 'styles' => 'PHPExcel_Writer_OpenDocument_Styles',
- 'thumbnails' => 'PHPExcel_Writer_OpenDocument_Thumbnails'
- );
-
- foreach ($writerPartsArray as $writer => $class) {
- $this->writerParts[$writer] = new $class($this);
- }
- }
-
- /**
- * Get writer part
- *
- * @param string $pPartName Writer part name
- * @return PHPExcel_Writer_Excel2007_WriterPart
- */
- public function getWriterPart($pPartName = '')
- {
- if ($pPartName != '' && isset($this->writerParts[strtolower($pPartName)])) {
- return $this->writerParts[strtolower($pPartName)];
- } else {
- return null;
- }
- }
-
- /**
- * Save PHPExcel to file
- *
- * @param string $pFilename
- * @throws PHPExcel_Writer_Exception
- */
- public function save($pFilename = null)
- {
- if (!$this->spreadSheet) {
- throw new PHPExcel_Writer_Exception('PHPExcel object unassigned.');
- }
-
- // garbage collect
- $this->spreadSheet->garbageCollect();
-
- // If $pFilename is php://output or php://stdout, make it a temporary file...
- $originalFilename = $pFilename;
- if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') {
- $pFilename = @tempnam(PHPExcel_Shared_File::sys_get_temp_dir(), 'phpxltmp');
- if ($pFilename == '') {
- $pFilename = $originalFilename;
- }
- }
-
- $objZip = $this->createZip($pFilename);
-
- $objZip->addFromString('META-INF/manifest.xml', $this->getWriterPart('meta_inf')->writeManifest());
- $objZip->addFromString('Thumbnails/thumbnail.png', $this->getWriterPart('thumbnails')->writeThumbnail());
- $objZip->addFromString('content.xml', $this->getWriterPart('content')->write());
- $objZip->addFromString('meta.xml', $this->getWriterPart('meta')->write());
- $objZip->addFromString('mimetype', $this->getWriterPart('mimetype')->write());
- $objZip->addFromString('settings.xml', $this->getWriterPart('settings')->write());
- $objZip->addFromString('styles.xml', $this->getWriterPart('styles')->write());
-
- // Close file
- if ($objZip->close() === false) {
- throw new PHPExcel_Writer_Exception("Could not close zip file $pFilename.");
- }
-
- // If a temporary file was used, copy it to the correct file stream
- if ($originalFilename != $pFilename) {
- if (copy($pFilename, $originalFilename) === false) {
- throw new PHPExcel_Writer_Exception("Could not copy temporary zip file $pFilename to $originalFilename.");
- }
- @unlink($pFilename);
- }
- }
-
- /**
- * Create zip object
- *
- * @param string $pFilename
- * @throws PHPExcel_Writer_Exception
- * @return ZipArchive
- */
- private function createZip($pFilename)
- {
- // Create new ZIP file and open it for writing
- $zipClass = PHPExcel_Settings::getZipClass();
- $objZip = new $zipClass();
-
- // Retrieve OVERWRITE and CREATE constants from the instantiated zip class
- // This method of accessing constant values from a dynamic class should work with all appropriate versions of PHP
- $ro = new ReflectionObject($objZip);
- $zipOverWrite = $ro->getConstant('OVERWRITE');
- $zipCreate = $ro->getConstant('CREATE');
-
- if (file_exists($pFilename)) {
- unlink($pFilename);
- }
- // Try opening the ZIP file
- if ($objZip->open($pFilename, $zipOverWrite) !== true) {
- if ($objZip->open($pFilename, $zipCreate) !== true) {
- throw new PHPExcel_Writer_Exception("Could not open $pFilename for writing.");
- }
- }
-
- return $objZip;
- }
-
- /**
- * Get PHPExcel object
- *
- * @return PHPExcel
- * @throws PHPExcel_Writer_Exception
- */
- public function getPHPExcel()
- {
- if ($this->spreadSheet !== null) {
- return $this->spreadSheet;
- } else {
- throw new PHPExcel_Writer_Exception('No PHPExcel assigned.');
- }
- }
-
- /**
- * Set PHPExcel object
- *
- * @param PHPExcel $pPHPExcel PHPExcel object
- * @throws PHPExcel_Writer_Exception
- * @return PHPExcel_Writer_Excel2007
- */
- public function setPHPExcel(PHPExcel $pPHPExcel = null)
- {
- $this->spreadSheet = $pPHPExcel;
- return $this;
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/OpenDocument/Cell/Comment.php b/lib/phpexcel/PHPExcel/Writer/OpenDocument/Cell/Comment.php
deleted file mode 100644
index f1e98a16e6b..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/OpenDocument/Cell/Comment.php
+++ /dev/null
@@ -1,63 +0,0 @@
-
- */
-class PHPExcel_Writer_OpenDocument_Cell_Comment
-{
- public static function write(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Cell $cell)
- {
- $comments = $cell->getWorksheet()->getComments();
- if (!isset($comments[$cell->getCoordinate()])) {
- return;
- }
- $comment = $comments[$cell->getCoordinate()];
-
- $objWriter->startElement('office:annotation');
- //$objWriter->writeAttribute('draw:style-name', 'gr1');
- //$objWriter->writeAttribute('draw:text-style-name', 'P1');
- $objWriter->writeAttribute('svg:width', $comment->getWidth());
- $objWriter->writeAttribute('svg:height', $comment->getHeight());
- $objWriter->writeAttribute('svg:x', $comment->getMarginLeft());
- $objWriter->writeAttribute('svg:y', $comment->getMarginTop());
- //$objWriter->writeAttribute('draw:caption-point-x', $comment->getMarginLeft());
- //$objWriter->writeAttribute('draw:caption-point-y', $comment->getMarginTop());
- $objWriter->writeElement('dc:creator', $comment->getAuthor());
- // TODO: Not realized in PHPExcel_Comment yet.
- //$objWriter->writeElement('dc:date', $comment->getDate());
- $objWriter->writeElement('text:p', $comment->getText()->getPlainText());
- //$objWriter->writeAttribute('draw:text-style-name', 'P1');
- $objWriter->endElement();
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/OpenDocument/Content.php b/lib/phpexcel/PHPExcel/Writer/OpenDocument/Content.php
deleted file mode 100644
index a34b1670c89..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/OpenDocument/Content.php
+++ /dev/null
@@ -1,272 +0,0 @@
-
- */
-class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_WriterPart
-{
- const NUMBER_COLS_REPEATED_MAX = 1024;
- const NUMBER_ROWS_REPEATED_MAX = 1048576;
-
- /**
- * Write content.xml to XML format
- *
- * @param PHPExcel $pPHPExcel
- * @return string XML Output
- * @throws PHPExcel_Writer_Exception
- */
- public function write(PHPExcel $pPHPExcel = null)
- {
- if (!$pPHPExcel) {
- $pPHPExcel = $this->getParentWriter()->getPHPExcel(); /* @var $pPHPExcel PHPExcel */
- }
-
- $objWriter = null;
- if ($this->getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
- } else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
- }
-
- // XML header
- $objWriter->startDocument('1.0', 'UTF-8');
-
- // Content
- $objWriter->startElement('office:document-content');
- $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
- $objWriter->writeAttribute('xmlns:style', 'urn:oasis:names:tc:opendocument:xmlns:style:1.0');
- $objWriter->writeAttribute('xmlns:text', 'urn:oasis:names:tc:opendocument:xmlns:text:1.0');
- $objWriter->writeAttribute('xmlns:table', 'urn:oasis:names:tc:opendocument:xmlns:table:1.0');
- $objWriter->writeAttribute('xmlns:draw', 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0');
- $objWriter->writeAttribute('xmlns:fo', 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0');
- $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
- $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
- $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
- $objWriter->writeAttribute('xmlns:number', 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0');
- $objWriter->writeAttribute('xmlns:presentation', 'urn:oasis:names:tc:opendocument:xmlns:presentation:1.0');
- $objWriter->writeAttribute('xmlns:svg', 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0');
- $objWriter->writeAttribute('xmlns:chart', 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0');
- $objWriter->writeAttribute('xmlns:dr3d', 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0');
- $objWriter->writeAttribute('xmlns:math', 'http://www.w3.org/1998/Math/MathML');
- $objWriter->writeAttribute('xmlns:form', 'urn:oasis:names:tc:opendocument:xmlns:form:1.0');
- $objWriter->writeAttribute('xmlns:script', 'urn:oasis:names:tc:opendocument:xmlns:script:1.0');
- $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
- $objWriter->writeAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer');
- $objWriter->writeAttribute('xmlns:oooc', 'http://openoffice.org/2004/calc');
- $objWriter->writeAttribute('xmlns:dom', 'http://www.w3.org/2001/xml-events');
- $objWriter->writeAttribute('xmlns:xforms', 'http://www.w3.org/2002/xforms');
- $objWriter->writeAttribute('xmlns:xsd', 'http://www.w3.org/2001/XMLSchema');
- $objWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
- $objWriter->writeAttribute('xmlns:rpt', 'http://openoffice.org/2005/report');
- $objWriter->writeAttribute('xmlns:of', 'urn:oasis:names:tc:opendocument:xmlns:of:1.2');
- $objWriter->writeAttribute('xmlns:xhtml', 'http://www.w3.org/1999/xhtml');
- $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');
- $objWriter->writeAttribute('xmlns:tableooo', 'http://openoffice.org/2009/table');
- $objWriter->writeAttribute('xmlns:field', 'urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0');
- $objWriter->writeAttribute('xmlns:formx', 'urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0');
- $objWriter->writeAttribute('xmlns:css3t', 'http://www.w3.org/TR/css3-text/');
- $objWriter->writeAttribute('office:version', '1.2');
-
- $objWriter->writeElement('office:scripts');
- $objWriter->writeElement('office:font-face-decls');
- $objWriter->writeElement('office:automatic-styles');
-
- $objWriter->startElement('office:body');
- $objWriter->startElement('office:spreadsheet');
- $objWriter->writeElement('table:calculation-settings');
- $this->writeSheets($objWriter);
- $objWriter->writeElement('table:named-expressions');
- $objWriter->endElement();
- $objWriter->endElement();
- $objWriter->endElement();
-
- return $objWriter->getData();
- }
-
- /**
- * Write sheets
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter
- */
- private function writeSheets(PHPExcel_Shared_XMLWriter $objWriter)
- {
- $pPHPExcel = $this->getParentWriter()->getPHPExcel(); /* @var $pPHPExcel PHPExcel */
-
- $sheet_count = $pPHPExcel->getSheetCount();
- for ($i = 0; $i < $sheet_count; $i++) {
- //$this->getWriterPart('Worksheet')->writeWorksheet());
- $objWriter->startElement('table:table');
- $objWriter->writeAttribute('table:name', $pPHPExcel->getSheet($i)->getTitle());
- $objWriter->writeElement('office:forms');
- $objWriter->startElement('table:table-column');
- $objWriter->writeAttribute('table:number-columns-repeated', self::NUMBER_COLS_REPEATED_MAX);
- $objWriter->endElement();
- $this->writeRows($objWriter, $pPHPExcel->getSheet($i));
- $objWriter->endElement();
- }
- }
-
- /**
- * Write rows of the specified sheet
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter
- * @param PHPExcel_Worksheet $sheet
- */
- private function writeRows(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Worksheet $sheet)
- {
- $number_rows_repeated = self::NUMBER_ROWS_REPEATED_MAX;
- $span_row = 0;
- $rows = $sheet->getRowIterator();
- while ($rows->valid()) {
- $number_rows_repeated--;
- $row = $rows->current();
- if ($row->getCellIterator()->valid()) {
- if ($span_row) {
- $objWriter->startElement('table:table-row');
- if ($span_row > 1) {
- $objWriter->writeAttribute('table:number-rows-repeated', $span_row);
- }
- $objWriter->startElement('table:table-cell');
- $objWriter->writeAttribute('table:number-columns-repeated', self::NUMBER_COLS_REPEATED_MAX);
- $objWriter->endElement();
- $objWriter->endElement();
- $span_row = 0;
- }
- $objWriter->startElement('table:table-row');
- $this->writeCells($objWriter, $row);
- $objWriter->endElement();
- } else {
- $span_row++;
- }
- $rows->next();
- }
- }
-
- /**
- * Write cells of the specified row
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter
- * @param PHPExcel_Worksheet_Row $row
- * @throws PHPExcel_Writer_Exception
- */
- private function writeCells(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Worksheet_Row $row)
- {
- $number_cols_repeated = self::NUMBER_COLS_REPEATED_MAX;
- $prev_column = -1;
- $cells = $row->getCellIterator();
- while ($cells->valid()) {
- $cell = $cells->current();
- $column = PHPExcel_Cell::columnIndexFromString($cell->getColumn()) - 1;
-
- $this->writeCellSpan($objWriter, $column, $prev_column);
- $objWriter->startElement('table:table-cell');
-
- switch ($cell->getDataType()) {
- case PHPExcel_Cell_DataType::TYPE_BOOL:
- $objWriter->writeAttribute('office:value-type', 'boolean');
- $objWriter->writeAttribute('office:value', $cell->getValue());
- $objWriter->writeElement('text:p', $cell->getValue());
- break;
-
- case PHPExcel_Cell_DataType::TYPE_ERROR:
- throw new PHPExcel_Writer_Exception('Writing of error not implemented yet.');
- break;
-
- case PHPExcel_Cell_DataType::TYPE_FORMULA:
- try {
- $formula_value = $cell->getCalculatedValue();
- } catch (Exception $e) {
- $formula_value = $cell->getValue();
- }
- $objWriter->writeAttribute('table:formula', 'of:' . $cell->getValue());
- if (is_numeric($formula_value)) {
- $objWriter->writeAttribute('office:value-type', 'float');
- } else {
- $objWriter->writeAttribute('office:value-type', 'string');
- }
- $objWriter->writeAttribute('office:value', $formula_value);
- $objWriter->writeElement('text:p', $formula_value);
- break;
-
- case PHPExcel_Cell_DataType::TYPE_INLINE:
- throw new PHPExcel_Writer_Exception('Writing of inline not implemented yet.');
- break;
-
- case PHPExcel_Cell_DataType::TYPE_NUMERIC:
- $objWriter->writeAttribute('office:value-type', 'float');
- $objWriter->writeAttribute('office:value', $cell->getValue());
- $objWriter->writeElement('text:p', $cell->getValue());
- break;
-
- case PHPExcel_Cell_DataType::TYPE_STRING:
- $objWriter->writeAttribute('office:value-type', 'string');
- $objWriter->writeElement('text:p', $cell->getValue());
- break;
- }
- PHPExcel_Writer_OpenDocument_Cell_Comment::write($objWriter, $cell);
- $objWriter->endElement();
- $prev_column = $column;
- $cells->next();
- }
- $number_cols_repeated = $number_cols_repeated - $prev_column - 1;
- if ($number_cols_repeated > 0) {
- if ($number_cols_repeated > 1) {
- $objWriter->startElement('table:table-cell');
- $objWriter->writeAttribute('table:number-columns-repeated', $number_cols_repeated);
- $objWriter->endElement();
- } else {
- $objWriter->writeElement('table:table-cell');
- }
- }
- }
-
- /**
- * Write span
- *
- * @param PHPExcel_Shared_XMLWriter $objWriter
- * @param integer $curColumn
- * @param integer $prevColumn
- */
- private function writeCellSpan(PHPExcel_Shared_XMLWriter $objWriter, $curColumn, $prevColumn)
- {
- $diff = $curColumn - $prevColumn - 1;
- if (1 === $diff) {
- $objWriter->writeElement('table:table-cell');
- } elseif ($diff > 1) {
- $objWriter->startElement('table:table-cell');
- $objWriter->writeAttribute('table:number-columns-repeated', $diff);
- $objWriter->endElement();
- }
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/OpenDocument/Meta.php b/lib/phpexcel/PHPExcel/Writer/OpenDocument/Meta.php
deleted file mode 100644
index 1a5c5fd0b28..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/OpenDocument/Meta.php
+++ /dev/null
@@ -1,95 +0,0 @@
-getParentWriter()->getPHPExcel();
- }
-
- $objWriter = null;
- if ($this->getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
- } else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
- }
-
- // XML header
- $objWriter->startDocument('1.0', 'UTF-8');
-
- // Meta
- $objWriter->startElement('office:document-meta');
-
- $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
- $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
- $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
- $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
- $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
- $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');
- $objWriter->writeAttribute('office:version', '1.2');
-
- $objWriter->startElement('office:meta');
-
- $objWriter->writeElement('meta:initial-creator', $pPHPExcel->getProperties()->getCreator());
- $objWriter->writeElement('dc:creator', $pPHPExcel->getProperties()->getCreator());
- $objWriter->writeElement('meta:creation-date', date(DATE_W3C, $pPHPExcel->getProperties()->getCreated()));
- $objWriter->writeElement('dc:date', date(DATE_W3C, $pPHPExcel->getProperties()->getCreated()));
- $objWriter->writeElement('dc:title', $pPHPExcel->getProperties()->getTitle());
- $objWriter->writeElement('dc:description', $pPHPExcel->getProperties()->getDescription());
- $objWriter->writeElement('dc:subject', $pPHPExcel->getProperties()->getSubject());
- $keywords = explode(' ', $pPHPExcel->getProperties()->getKeywords());
- foreach ($keywords as $keyword) {
- $objWriter->writeElement('meta:keyword', $keyword);
- }
-
- //
- $objWriter->startElement('meta:user-defined');
- $objWriter->writeAttribute('meta:name', 'Company');
- $objWriter->writeRaw($pPHPExcel->getProperties()->getCompany());
- $objWriter->endElement();
-
- $objWriter->startElement('meta:user-defined');
- $objWriter->writeAttribute('meta:name', 'category');
- $objWriter->writeRaw($pPHPExcel->getProperties()->getCategory());
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- $objWriter->endElement();
-
- return $objWriter->getData();
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/OpenDocument/MetaInf.php b/lib/phpexcel/PHPExcel/Writer/OpenDocument/MetaInf.php
deleted file mode 100644
index c43b72334b4..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/OpenDocument/MetaInf.php
+++ /dev/null
@@ -1,87 +0,0 @@
-getParentWriter()->getPHPExcel();
- }
-
- $objWriter = null;
- if ($this->getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
- } else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
- }
-
- // XML header
- $objWriter->startDocument('1.0', 'UTF-8');
-
- // Manifest
- $objWriter->startElement('manifest:manifest');
- $objWriter->writeAttribute('xmlns:manifest', 'urn:oasis:names:tc:opendocument:xmlns:manifest:1.0');
- $objWriter->writeAttribute('manifest:version', '1.2');
-
- $objWriter->startElement('manifest:file-entry');
- $objWriter->writeAttribute('manifest:full-path', '/');
- $objWriter->writeAttribute('manifest:version', '1.2');
- $objWriter->writeAttribute('manifest:media-type', 'application/vnd.oasis.opendocument.spreadsheet');
- $objWriter->endElement();
- $objWriter->startElement('manifest:file-entry');
- $objWriter->writeAttribute('manifest:full-path', 'meta.xml');
- $objWriter->writeAttribute('manifest:media-type', 'text/xml');
- $objWriter->endElement();
- $objWriter->startElement('manifest:file-entry');
- $objWriter->writeAttribute('manifest:full-path', 'settings.xml');
- $objWriter->writeAttribute('manifest:media-type', 'text/xml');
- $objWriter->endElement();
- $objWriter->startElement('manifest:file-entry');
- $objWriter->writeAttribute('manifest:full-path', 'content.xml');
- $objWriter->writeAttribute('manifest:media-type', 'text/xml');
- $objWriter->endElement();
- $objWriter->startElement('manifest:file-entry');
- $objWriter->writeAttribute('manifest:full-path', 'Thumbnails/thumbnail.png');
- $objWriter->writeAttribute('manifest:media-type', 'image/png');
- $objWriter->endElement();
- $objWriter->startElement('manifest:file-entry');
- $objWriter->writeAttribute('manifest:full-path', 'styles.xml');
- $objWriter->writeAttribute('manifest:media-type', 'text/xml');
- $objWriter->endElement();
- $objWriter->endElement();
-
- return $objWriter->getData();
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/OpenDocument/Mimetype.php b/lib/phpexcel/PHPExcel/Writer/OpenDocument/Mimetype.php
deleted file mode 100644
index d51a8b97083..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/OpenDocument/Mimetype.php
+++ /dev/null
@@ -1,41 +0,0 @@
-getParentWriter()->getPHPExcel();
- }
-
- $objWriter = null;
- if ($this->getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
- } else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
- }
-
- // XML header
- $objWriter->startDocument('1.0', 'UTF-8');
-
- // Settings
- $objWriter->startElement('office:document-settings');
- $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
- $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
- $objWriter->writeAttribute('xmlns:config', 'urn:oasis:names:tc:opendocument:xmlns:config:1.0');
- $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
- $objWriter->writeAttribute('office:version', '1.2');
-
- $objWriter->startElement('office:settings');
- $objWriter->startElement('config:config-item-set');
- $objWriter->writeAttribute('config:name', 'ooo:view-settings');
- $objWriter->startElement('config:config-item-map-indexed');
- $objWriter->writeAttribute('config:name', 'Views');
- $objWriter->endElement();
- $objWriter->endElement();
- $objWriter->startElement('config:config-item-set');
- $objWriter->writeAttribute('config:name', 'ooo:configuration-settings');
- $objWriter->endElement();
- $objWriter->endElement();
- $objWriter->endElement();
-
- return $objWriter->getData();
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/OpenDocument/Styles.php b/lib/phpexcel/PHPExcel/Writer/OpenDocument/Styles.php
deleted file mode 100644
index cc6e25b4810..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/OpenDocument/Styles.php
+++ /dev/null
@@ -1,92 +0,0 @@
-getParentWriter()->getPHPExcel();
- }
-
- $objWriter = null;
- if ($this->getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
- } else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
- }
-
- // XML header
- $objWriter->startDocument('1.0', 'UTF-8');
-
- // Content
- $objWriter->startElement('office:document-styles');
- $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
- $objWriter->writeAttribute('xmlns:style', 'urn:oasis:names:tc:opendocument:xmlns:style:1.0');
- $objWriter->writeAttribute('xmlns:text', 'urn:oasis:names:tc:opendocument:xmlns:text:1.0');
- $objWriter->writeAttribute('xmlns:table', 'urn:oasis:names:tc:opendocument:xmlns:table:1.0');
- $objWriter->writeAttribute('xmlns:draw', 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0');
- $objWriter->writeAttribute('xmlns:fo', 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0');
- $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
- $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
- $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
- $objWriter->writeAttribute('xmlns:number', 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0');
- $objWriter->writeAttribute('xmlns:presentation', 'urn:oasis:names:tc:opendocument:xmlns:presentation:1.0');
- $objWriter->writeAttribute('xmlns:svg', 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0');
- $objWriter->writeAttribute('xmlns:chart', 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0');
- $objWriter->writeAttribute('xmlns:dr3d', 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0');
- $objWriter->writeAttribute('xmlns:math', 'http://www.w3.org/1998/Math/MathML');
- $objWriter->writeAttribute('xmlns:form', 'urn:oasis:names:tc:opendocument:xmlns:form:1.0');
- $objWriter->writeAttribute('xmlns:script', 'urn:oasis:names:tc:opendocument:xmlns:script:1.0');
- $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
- $objWriter->writeAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer');
- $objWriter->writeAttribute('xmlns:oooc', 'http://openoffice.org/2004/calc');
- $objWriter->writeAttribute('xmlns:dom', 'http://www.w3.org/2001/xml-events');
- $objWriter->writeAttribute('xmlns:rpt', 'http://openoffice.org/2005/report');
- $objWriter->writeAttribute('xmlns:of', 'urn:oasis:names:tc:opendocument:xmlns:of:1.2');
- $objWriter->writeAttribute('xmlns:xhtml', 'http://www.w3.org/1999/xhtml');
- $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');
- $objWriter->writeAttribute('xmlns:tableooo', 'http://openoffice.org/2009/table');
- $objWriter->writeAttribute('xmlns:css3t', 'http://www.w3.org/TR/css3-text/');
- $objWriter->writeAttribute('office:version', '1.2');
-
- $objWriter->writeElement('office:font-face-decls');
- $objWriter->writeElement('office:styles');
- $objWriter->writeElement('office:automatic-styles');
- $objWriter->writeElement('office:master-styles');
- $objWriter->endElement();
-
- return $objWriter->getData();
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/OpenDocument/Thumbnails.php b/lib/phpexcel/PHPExcel/Writer/OpenDocument/Thumbnails.php
deleted file mode 100644
index 54247ae2a4b..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/OpenDocument/Thumbnails.php
+++ /dev/null
@@ -1,41 +0,0 @@
-renderer = new $rendererName($phpExcel);
- }
-
-
- /**
- * Magic method to handle direct calls to the configured PDF renderer wrapper class.
- *
- * @param string $name Renderer library method name
- * @param mixed[] $arguments Array of arguments to pass to the renderer method
- * @return mixed Returned data from the PDF renderer wrapper method
- */
- public function __call($name, $arguments)
- {
- if ($this->renderer === null) {
- throw new PHPExcel_Writer_Exception("PDF Rendering library has not been defined.");
- }
-
- return call_user_func_array(array($this->renderer, $name), $arguments);
- }
-
- /**
- * {@inheritdoc}
- */
- public function save($pFilename = null)
- {
- $this->renderer->save($pFilename);
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/PDF/Core.php b/lib/phpexcel/PHPExcel/Writer/PDF/Core.php
deleted file mode 100644
index 4fed84a7173..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/PDF/Core.php
+++ /dev/null
@@ -1,355 +0,0 @@
- 'LETTER', // (8.5 in. by 11 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_SMALL
- => 'LETTER', // (8.5 in. by 11 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_TABLOID
- => array(792.00, 1224.00), // (11 in. by 17 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_LEDGER
- => array(1224.00, 792.00), // (17 in. by 11 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_LEGAL
- => 'LEGAL', // (8.5 in. by 14 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_STATEMENT
- => array(396.00, 612.00), // (5.5 in. by 8.5 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_EXECUTIVE
- => 'EXECUTIVE', // (7.25 in. by 10.5 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3
- => 'A3', // (297 mm by 420 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4
- => 'A4', // (210 mm by 297 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_SMALL
- => 'A4', // (210 mm by 297 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5
- => 'A5', // (148 mm by 210 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_B4
- => 'B4', // (250 mm by 353 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_B5
- => 'B5', // (176 mm by 250 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_FOLIO
- => 'FOLIO', // (8.5 in. by 13 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_QUARTO
- => array(609.45, 779.53), // (215 mm by 275 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_1
- => array(720.00, 1008.00), // (10 in. by 14 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_2
- => array(792.00, 1224.00), // (11 in. by 17 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_NOTE
- => 'LETTER', // (8.5 in. by 11 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO9_ENVELOPE
- => array(279.00, 639.00), // (3.875 in. by 8.875 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO10_ENVELOPE
- => array(297.00, 684.00), // (4.125 in. by 9.5 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO11_ENVELOPE
- => array(324.00, 747.00), // (4.5 in. by 10.375 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO12_ENVELOPE
- => array(342.00, 792.00), // (4.75 in. by 11 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_NO14_ENVELOPE
- => array(360.00, 828.00), // (5 in. by 11.5 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_C
- => array(1224.00, 1584.00), // (17 in. by 22 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_D
- => array(1584.00, 2448.00), // (22 in. by 34 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_E
- => array(2448.00, 3168.00), // (34 in. by 44 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_DL_ENVELOPE
- => array(311.81, 623.62), // (110 mm by 220 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_C5_ENVELOPE
- => 'C5', // (162 mm by 229 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_C3_ENVELOPE
- => 'C3', // (324 mm by 458 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_C4_ENVELOPE
- => 'C4', // (229 mm by 324 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_C6_ENVELOPE
- => 'C6', // (114 mm by 162 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_C65_ENVELOPE
- => array(323.15, 649.13), // (114 mm by 229 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_B4_ENVELOPE
- => 'B4', // (250 mm by 353 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_B5_ENVELOPE
- => 'B5', // (176 mm by 250 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_B6_ENVELOPE
- => array(498.90, 354.33), // (176 mm by 125 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_ITALY_ENVELOPE
- => array(311.81, 651.97), // (110 mm by 230 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_MONARCH_ENVELOPE
- => array(279.00, 540.00), // (3.875 in. by 7.5 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_6_3_4_ENVELOPE
- => array(261.00, 468.00), // (3.625 in. by 6.5 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_US_STANDARD_FANFOLD
- => array(1071.00, 792.00), // (14.875 in. by 11 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_GERMAN_STANDARD_FANFOLD
- => array(612.00, 864.00), // (8.5 in. by 12 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_GERMAN_LEGAL_FANFOLD
- => 'FOLIO', // (8.5 in. by 13 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_ISO_B4
- => 'B4', // (250 mm by 353 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_JAPANESE_DOUBLE_POSTCARD
- => array(566.93, 419.53), // (200 mm by 148 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_PAPER_1
- => array(648.00, 792.00), // (9 in. by 11 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_PAPER_2
- => array(720.00, 792.00), // (10 in. by 11 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_STANDARD_PAPER_3
- => array(1080.00, 792.00), // (15 in. by 11 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_INVITE_ENVELOPE
- => array(623.62, 623.62), // (220 mm by 220 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_EXTRA_PAPER
- => array(667.80, 864.00), // (9.275 in. by 12 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_LEGAL_EXTRA_PAPER
- => array(667.80, 1080.00), // (9.275 in. by 15 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_TABLOID_EXTRA_PAPER
- => array(841.68, 1296.00), // (11.69 in. by 18 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_EXTRA_PAPER
- => array(668.98, 912.76), // (236 mm by 322 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_TRANSVERSE_PAPER
- => array(595.80, 792.00), // (8.275 in. by 11 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_TRANSVERSE_PAPER
- => 'A4', // (210 mm by 297 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER
- => array(667.80, 864.00), // (9.275 in. by 12 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_SUPERA_SUPERA_A4_PAPER
- => array(643.46, 1009.13), // (227 mm by 356 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_SUPERB_SUPERB_A3_PAPER
- => array(864.57, 1380.47), // (305 mm by 487 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER_PLUS_PAPER
- => array(612.00, 913.68), // (8.5 in. by 12.69 in.)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_A4_PLUS_PAPER
- => array(595.28, 935.43), // (210 mm by 330 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5_TRANSVERSE_PAPER
- => 'A5', // (148 mm by 210 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_JIS_B5_TRANSVERSE_PAPER
- => array(515.91, 728.50), // (182 mm by 257 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3_EXTRA_PAPER
- => array(912.76, 1261.42), // (322 mm by 445 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_A5_EXTRA_PAPER
- => array(493.23, 666.14), // (174 mm by 235 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_ISO_B5_EXTRA_PAPER
- => array(569.76, 782.36), // (201 mm by 276 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_A2_PAPER
- => 'A2', // (420 mm by 594 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3_TRANSVERSE_PAPER
- => 'A3', // (297 mm by 420 mm)
- PHPExcel_Worksheet_PageSetup::PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER
- => array(912.76, 1261.42) // (322 mm by 445 mm)
- );
-
- /**
- * Create a new PHPExcel_Writer_PDF
- *
- * @param PHPExcel $phpExcel PHPExcel object
- */
- public function __construct(PHPExcel $phpExcel)
- {
- parent::__construct($phpExcel);
- $this->setUseInlineCss(true);
- $this->tempDir = PHPExcel_Shared_File::sys_get_temp_dir();
- }
-
- /**
- * Get Font
- *
- * @return string
- */
- public function getFont()
- {
- return $this->font;
- }
-
- /**
- * Set font. Examples:
- * 'arialunicid0-chinese-simplified'
- * 'arialunicid0-chinese-traditional'
- * 'arialunicid0-korean'
- * 'arialunicid0-japanese'
- *
- * @param string $fontName
- */
- public function setFont($fontName)
- {
- $this->font = $fontName;
- return $this;
- }
-
- /**
- * Get Paper Size
- *
- * @return int
- */
- public function getPaperSize()
- {
- return $this->paperSize;
- }
-
- /**
- * Set Paper Size
- *
- * @param string $pValue Paper size
- * @return PHPExcel_Writer_PDF
- */
- public function setPaperSize($pValue = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER)
- {
- $this->paperSize = $pValue;
- return $this;
- }
-
- /**
- * Get Orientation
- *
- * @return string
- */
- public function getOrientation()
- {
- return $this->orientation;
- }
-
- /**
- * Set Orientation
- *
- * @param string $pValue Page orientation
- * @return PHPExcel_Writer_PDF
- */
- public function setOrientation($pValue = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT)
- {
- $this->orientation = $pValue;
- return $this;
- }
-
- /**
- * Get temporary storage directory
- *
- * @return string
- */
- public function getTempDir()
- {
- return $this->tempDir;
- }
-
- /**
- * Set temporary storage directory
- *
- * @param string $pValue Temporary storage directory
- * @throws PHPExcel_Writer_Exception when directory does not exist
- * @return PHPExcel_Writer_PDF
- */
- public function setTempDir($pValue = '')
- {
- if (is_dir($pValue)) {
- $this->tempDir = $pValue;
- } else {
- throw new PHPExcel_Writer_Exception("Directory does not exist: $pValue");
- }
- return $this;
- }
-
- /**
- * Save PHPExcel to PDF file, pre-save
- *
- * @param string $pFilename Name of the file to save as
- * @throws PHPExcel_Writer_Exception
- */
- protected function prepareForSave($pFilename = null)
- {
- // garbage collect
- $this->phpExcel->garbageCollect();
-
- $this->saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType();
- PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
-
- // Open file
- $fileHandle = fopen($pFilename, 'w');
- if ($fileHandle === false) {
- throw new PHPExcel_Writer_Exception("Could not open file $pFilename for writing.");
- }
-
- // Set PDF
- $this->isPdf = true;
- // Build CSS
- $this->buildCSS(true);
-
- return $fileHandle;
- }
-
- /**
- * Save PHPExcel to PDF file, post-save
- *
- * @param resource $fileHandle
- * @throws PHPExcel_Writer_Exception
- */
- protected function restoreStateAfterSave($fileHandle)
- {
- // Close file
- fclose($fileHandle);
-
- PHPExcel_Calculation::setArrayReturnType($this->saveArrayReturnType);
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/PDF/DomPDF.php b/lib/phpexcel/PHPExcel/Writer/PDF/DomPDF.php
deleted file mode 100644
index 83761acb33f..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/PDF/DomPDF.php
+++ /dev/null
@@ -1,108 +0,0 @@
-getSheetIndex())) {
- $orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation()
- == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
- $printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
- $printMargins = $this->phpExcel->getSheet(0)->getPageMargins();
- } else {
- $orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
- == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
- $printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
- $printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins();
- }
-
- $orientation = ($orientation == 'L') ? 'landscape' : 'portrait';
-
- // Override Page Orientation
- if (!is_null($this->getOrientation())) {
- $orientation = ($this->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT)
- ? PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT
- : $this->getOrientation();
- }
- // Override Paper Size
- if (!is_null($this->getPaperSize())) {
- $printPaperSize = $this->getPaperSize();
- }
-
- if (isset(self::$paperSizes[$printPaperSize])) {
- $paperSize = self::$paperSizes[$printPaperSize];
- }
-
-
- // Create PDF
- $pdf = new DOMPDF();
- $pdf->set_paper(strtolower($paperSize), $orientation);
-
- $pdf->load_html(
- $this->generateHTMLHeader(false) .
- $this->generateSheetData() .
- $this->generateHTMLFooter()
- );
- $pdf->render();
-
- // Write to file
- fwrite($fileHandle, $pdf->output());
-
- parent::restoreStateAfterSave($fileHandle);
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/PDF/mPDF.php b/lib/phpexcel/PHPExcel/Writer/PDF/mPDF.php
deleted file mode 100644
index e4e6057d74c..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/PDF/mPDF.php
+++ /dev/null
@@ -1,118 +0,0 @@
-getSheetIndex())) {
- $orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation()
- == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
- $printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
- $printMargins = $this->phpExcel->getSheet(0)->getPageMargins();
- } else {
- $orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
- == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
- $printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
- $printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins();
- }
- $this->setOrientation($orientation);
-
- // Override Page Orientation
- if (!is_null($this->getOrientation())) {
- $orientation = ($this->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT)
- ? PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT
- : $this->getOrientation();
- }
- $orientation = strtoupper($orientation);
-
- // Override Paper Size
- if (!is_null($this->getPaperSize())) {
- $printPaperSize = $this->getPaperSize();
- }
-
- if (isset(self::$paperSizes[$printPaperSize])) {
- $paperSize = self::$paperSizes[$printPaperSize];
- }
-
-
- // Create PDF
- $pdf = new mpdf();
- $ortmp = $orientation;
- $pdf->_setPageSize(strtoupper($paperSize), $ortmp);
- $pdf->DefOrientation = $orientation;
- $pdf->AddPage($orientation);
-
- // Document info
- $pdf->SetTitle($this->phpExcel->getProperties()->getTitle());
- $pdf->SetAuthor($this->phpExcel->getProperties()->getCreator());
- $pdf->SetSubject($this->phpExcel->getProperties()->getSubject());
- $pdf->SetKeywords($this->phpExcel->getProperties()->getKeywords());
- $pdf->SetCreator($this->phpExcel->getProperties()->getCreator());
-
- $pdf->WriteHTML(
- $this->generateHTMLHeader(false) .
- $this->generateSheetData() .
- $this->generateHTMLFooter()
- );
-
- // Write to file
- fwrite($fileHandle, $pdf->Output('', 'S'));
-
- parent::restoreStateAfterSave($fileHandle);
- }
-}
diff --git a/lib/phpexcel/PHPExcel/Writer/PDF/tcPDF.php b/lib/phpexcel/PHPExcel/Writer/PDF/tcPDF.php
deleted file mode 100644
index dea33a352b3..00000000000
--- a/lib/phpexcel/PHPExcel/Writer/PDF/tcPDF.php
+++ /dev/null
@@ -1,123 +0,0 @@
-getSheetIndex())) {
- $orientation = ($this->phpExcel->getSheet(0)->getPageSetup()->getOrientation()
- == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
- $printPaperSize = $this->phpExcel->getSheet(0)->getPageSetup()->getPaperSize();
- $printMargins = $this->phpExcel->getSheet(0)->getPageMargins();
- } else {
- $orientation = ($this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
- == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
- $printPaperSize = $this->phpExcel->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
- $printMargins = $this->phpExcel->getSheet($this->getSheetIndex())->getPageMargins();
- }
-
- // Override Page Orientation
- if (!is_null($this->getOrientation())) {
- $orientation = ($this->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_LANDSCAPE)
- ? 'L'
- : 'P';
- }
- // Override Paper Size
- if (!is_null($this->getPaperSize())) {
- $printPaperSize = $this->getPaperSize();
- }
-
- if (isset(self::$paperSizes[$printPaperSize])) {
- $paperSize = self::$paperSizes[$printPaperSize];
- }
-
-
- // Create PDF
- $pdf = new TCPDF($orientation, 'pt', $paperSize);
- $pdf->setFontSubsetting(false);
- // Set margins, converting inches to points (using 72 dpi)
- $pdf->SetMargins($printMargins->getLeft() * 72, $printMargins->getTop() * 72, $printMargins->getRight() * 72);
- $pdf->SetAutoPageBreak(true, $printMargins->getBottom() * 72);
-
- $pdf->setPrintHeader(false);
- $pdf->setPrintFooter(false);
-
- $pdf->AddPage();
-
- // Set the appropriate font
- $pdf->SetFont($this->getFont());
- $pdf->writeHTML(
- $this->generateHTMLHeader(false) .
- $this->generateSheetData() .
- $this->generateHTMLFooter()
- );
-
- // Document info
- $pdf->SetTitle($this->phpExcel->getProperties()->getTitle());
- $pdf->SetAuthor($this->phpExcel->getProperties()->getCreator());
- $pdf->SetSubject($this->phpExcel->getProperties()->getSubject());
- $pdf->SetKeywords($this->phpExcel->getProperties()->getKeywords());
- $pdf->SetCreator($this->phpExcel->getProperties()->getCreator());
-
- // Write to file
- fwrite($fileHandle, $pdf->output($pFilename, 'S'));
-
- parent::restoreStateAfterSave($fileHandle);
- }
-}
diff --git a/lib/phpexcel/PHPExcel/locale/bg/config b/lib/phpexcel/PHPExcel/locale/bg/config
deleted file mode 100644
index 4cecddb3c3c..00000000000
--- a/lib/phpexcel/PHPExcel/locale/bg/config
+++ /dev/null
@@ -1,49 +0,0 @@
-##
-## PHPExcel
-##
-
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-ArgumentSeparator = ;
-
-
-##
-## (For future use)
-##
-currencySymbol = лв
-
-
-##
-## Excel Error Codes (For future use)
-
-##
-NULL = #ПРАЗНО!
-DIV0 = #ДЕЛ/0!
-VALUE = #СТОЙНОСТ!
-REF = #РЕФ!
-NAME = #ИМЕ?
-NUM = #ЧИСЛО!
-NA = #Н/Д
diff --git a/lib/phpexcel/PHPExcel/locale/cs/config b/lib/phpexcel/PHPExcel/locale/cs/config
deleted file mode 100644
index 42cdf326704..00000000000
--- a/lib/phpexcel/PHPExcel/locale/cs/config
+++ /dev/null
@@ -1,47 +0,0 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-ArgumentSeparator = ;
-
-
-##
-## (For future use)
-##
-currencySymbol = Kč
-
-
-##
-## Excel Error Codes (For future use)
-##
-NULL = #NULL!
-DIV0 = #DIV/0!
-VALUE = #HODNOTA!
-REF = #REF!
-NAME = #NÁZEV?
-NUM = #NUM!
-NA = #N/A
diff --git a/lib/phpexcel/PHPExcel/locale/da/config b/lib/phpexcel/PHPExcel/locale/da/config
deleted file mode 100644
index ae5900311e8..00000000000
--- a/lib/phpexcel/PHPExcel/locale/da/config
+++ /dev/null
@@ -1,48 +0,0 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-ArgumentSeparator = ;
-
-
-##
-## (For future use)
-##
-currencySymbol = kr
-
-
-
-##
-## Excel Error Codes (For future use)
-##
-NULL = #NUL!
-DIV0 = #DIVISION/0!
-VALUE = #VÆRDI!
-REF = #REFERENCE!
-NAME = #NAVN?
-NUM = #NUM!
-NA = #I/T
diff --git a/lib/phpexcel/PHPExcel/locale/de/config b/lib/phpexcel/PHPExcel/locale/de/config
deleted file mode 100644
index aa0228e7f97..00000000000
--- a/lib/phpexcel/PHPExcel/locale/de/config
+++ /dev/null
@@ -1,47 +0,0 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-ArgumentSeparator = ;
-
-
-##
-## (For future use)
-##
-currencySymbol = €
-
-
-##
-## Excel Error Codes (For future use)
-##
-NULL = #NULL!
-DIV0 = #DIV/0!
-VALUE = #WERT!
-REF = #BEZUG!
-NAME = #NAME?
-NUM = #ZAHL!
-NA = #NV
diff --git a/lib/phpexcel/PHPExcel/locale/en/uk/config b/lib/phpexcel/PHPExcel/locale/en/uk/config
deleted file mode 100644
index 532080b57b0..00000000000
--- a/lib/phpexcel/PHPExcel/locale/en/uk/config
+++ /dev/null
@@ -1,32 +0,0 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-##
-## (For future use)
-##
-currencySymbol = £
diff --git a/lib/phpexcel/PHPExcel/locale/es/config b/lib/phpexcel/PHPExcel/locale/es/config
deleted file mode 100644
index 96cfa69db17..00000000000
--- a/lib/phpexcel/PHPExcel/locale/es/config
+++ /dev/null
@@ -1,47 +0,0 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-ArgumentSeparator = ;
-
-
-##
-## (For future use)
-##
-currencySymbol = $ ## I'm surprised that the Excel Documentation suggests $ rather than €
-
-
-##
-## Excel Error Codes (For future use)
-##
-NULL = #¡NULO!
-DIV0 = #¡DIV/0!
-VALUE = #¡VALOR!
-REF = #¡REF!
-NAME = #¿NOMBRE?
-NUM = #¡NÚM!
-NA = #N/A
diff --git a/lib/phpexcel/PHPExcel/locale/fi/config b/lib/phpexcel/PHPExcel/locale/fi/config
deleted file mode 100644
index 498cf4ceb8e..00000000000
--- a/lib/phpexcel/PHPExcel/locale/fi/config
+++ /dev/null
@@ -1,47 +0,0 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-ArgumentSeparator = ;
-
-
-##
-## (For future use)
-##
-currencySymbol = $ # Symbol not known, should it be a € (Euro)?
-
-
-##
-## Excel Error Codes (For future use)
-##
-NULL = #TYHJÄ!
-DIV0 = #JAKO/0!
-VALUE = #ARVO!
-REF = #VIITTAUS!
-NAME = #NIMI?
-NUM = #LUKU!
-NA = #PUUTTUU
diff --git a/lib/phpexcel/PHPExcel/locale/fr/config b/lib/phpexcel/PHPExcel/locale/fr/config
deleted file mode 100644
index 1f5db88c43b..00000000000
--- a/lib/phpexcel/PHPExcel/locale/fr/config
+++ /dev/null
@@ -1,47 +0,0 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-ArgumentSeparator = ;
-
-
-##
-## (For future use)
-##
-currencySymbol = €
-
-
-##
-## Excel Error Codes (For future use)
-##
-NULL = #NUL!
-DIV0 = #DIV/0!
-VALUE = #VALEUR!
-REF = #REF!
-NAME = #NOM?
-NUM = #NOMBRE!
-NA = #N/A
diff --git a/lib/phpexcel/PHPExcel/locale/hu/config b/lib/phpexcel/PHPExcel/locale/hu/config
deleted file mode 100644
index 080b2018faa..00000000000
--- a/lib/phpexcel/PHPExcel/locale/hu/config
+++ /dev/null
@@ -1,47 +0,0 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-ArgumentSeparator = ;
-
-
-##
-## (For future use)
-##
-currencySymbol = Ft
-
-
-##
-## Excel Error Codes (For future use)
-##
-NULL = #NULLA!
-DIV0 = #ZÉRÓOSZTÓ!
-VALUE = #ÉRTÉK!
-REF = #HIV!
-NAME = #NÉV?
-NUM = #SZÁM!
-NA = #HIÁNYZIK
diff --git a/lib/phpexcel/PHPExcel/locale/it/config b/lib/phpexcel/PHPExcel/locale/it/config
deleted file mode 100644
index c3afa754b90..00000000000
--- a/lib/phpexcel/PHPExcel/locale/it/config
+++ /dev/null
@@ -1,47 +0,0 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-ArgumentSeparator = ;
-
-
-##
-## (For future use)
-##
-currencySymbol = €
-
-
-##
-## Excel Error Codes (For future use)
-##
-NULL = #NULLO!
-DIV0 = #DIV/0!
-VALUE = #VALORE!
-REF = #RIF!
-NAME = #NOME?
-NUM = #NUM!
-NA = #N/D
diff --git a/lib/phpexcel/PHPExcel/locale/nl/config b/lib/phpexcel/PHPExcel/locale/nl/config
deleted file mode 100644
index 48dcc15b507..00000000000
--- a/lib/phpexcel/PHPExcel/locale/nl/config
+++ /dev/null
@@ -1,47 +0,0 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-ArgumentSeparator = ;
-
-
-##
-## (For future use)
-##
-currencySymbol = €
-
-
-##
-## Excel Error Codes (For future use)
-##
-NULL = #LEEG!
-DIV0 = #DEEL/0!
-VALUE = #WAARDE!
-REF = #VERW!
-NAME = #NAAM?
-NUM = #GETAL!
-NA = #N/B
diff --git a/lib/phpexcel/PHPExcel/locale/no/config b/lib/phpexcel/PHPExcel/locale/no/config
deleted file mode 100644
index bf2d34a7f2c..00000000000
--- a/lib/phpexcel/PHPExcel/locale/no/config
+++ /dev/null
@@ -1,47 +0,0 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-ArgumentSeparator = ;
-
-
-##
-## (For future use)
-##
-currencySymbol = kr
-
-
-##
-## Excel Error Codes (For future use)
-##
-NULL = #NULL!
-DIV0 = #DIV/0!
-VALUE = #VERDI!
-REF = #REF!
-NAME = #NAVN?
-NUM = #NUM!
-NA = #I/T
diff --git a/lib/phpexcel/PHPExcel/locale/pl/config b/lib/phpexcel/PHPExcel/locale/pl/config
deleted file mode 100644
index 4dd75bee69c..00000000000
--- a/lib/phpexcel/PHPExcel/locale/pl/config
+++ /dev/null
@@ -1,47 +0,0 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-ArgumentSeparator = ;
-
-
-##
-## (For future use)
-##
-currencySymbol = zł
-
-
-##
-## Excel Error Codes (For future use)
-##
-NULL = #ZERO!
-DIV0 = #DZIEL/0!
-VALUE = #ARG!
-REF = #ADR!
-NAME = #NAZWA?
-NUM = #LICZBA!
-NA = #N/D!
diff --git a/lib/phpexcel/PHPExcel/locale/pt/br/config b/lib/phpexcel/PHPExcel/locale/pt/br/config
deleted file mode 100644
index 45b6fbd92d1..00000000000
--- a/lib/phpexcel/PHPExcel/locale/pt/br/config
+++ /dev/null
@@ -1,47 +0,0 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-ArgumentSeparator = ;
-
-
-##
-## (For future use)
-##
-currencySymbol = R$
-
-
-##
-## Excel Error Codes (For future use)
-##
-NULL = #NULO!
-DIV0 = #DIV/0!
-VALUE = #VALOR!
-REF = #REF!
-NAME = #NOME?
-NUM = #NÚM!
-NA = #N/D
diff --git a/lib/phpexcel/PHPExcel/locale/pt/config b/lib/phpexcel/PHPExcel/locale/pt/config
deleted file mode 100644
index 8bb8d8b8ea0..00000000000
--- a/lib/phpexcel/PHPExcel/locale/pt/config
+++ /dev/null
@@ -1,47 +0,0 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-ArgumentSeparator = ;
-
-
-##
-## (For future use)
-##
-currencySymbol = €
-
-
-##
-## Excel Error Codes (For future use)
-##
-NULL = #NULO!
-DIV0 = #DIV/0!
-VALUE = #VALOR!
-REF = #REF!
-NAME = #NOME?
-NUM = #NÚM!
-NA = #N/D
diff --git a/lib/phpexcel/PHPExcel/locale/ru/config b/lib/phpexcel/PHPExcel/locale/ru/config
deleted file mode 100644
index 56e45bfda8f..00000000000
--- a/lib/phpexcel/PHPExcel/locale/ru/config
+++ /dev/null
@@ -1,47 +0,0 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-ArgumentSeparator = ;
-
-
-##
-## (For future use)
-##
-currencySymbol = р
-
-
-##
-## Excel Error Codes (For future use)
-##
-NULL = #ПУСТО!
-DIV0 = #ДЕЛ/0!
-VALUE = #ЗНАЧ!
-REF = #ССЫЛ!
-NAME = #ИМЯ?
-NUM = #ЧИСЛО!
-NA = #Н/Д
diff --git a/lib/phpexcel/PHPExcel/locale/sv/config b/lib/phpexcel/PHPExcel/locale/sv/config
deleted file mode 100644
index 726f77164e4..00000000000
--- a/lib/phpexcel/PHPExcel/locale/sv/config
+++ /dev/null
@@ -1,47 +0,0 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-ArgumentSeparator = ;
-
-
-##
-## (For future use)
-##
-currencySymbol = kr
-
-
-##
-## Excel Error Codes (For future use)
-##
-NULL = #Skärning!
-DIV0 = #Division/0!
-VALUE = #Värdefel!
-REF = #Referens!
-NAME = #Namn?
-NUM = #Ogiltigt!
-NA = #Saknas!
diff --git a/lib/phpexcel/PHPExcel/locale/tr/config b/lib/phpexcel/PHPExcel/locale/tr/config
deleted file mode 100644
index b69d4257a50..00000000000
--- a/lib/phpexcel/PHPExcel/locale/tr/config
+++ /dev/null
@@ -1,47 +0,0 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Settings
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-##
-
-
-ArgumentSeparator = ;
-
-
-##
-## (For future use)
-##
-currencySymbol = YTL
-
-
-##
-## Excel Error Codes (For future use)
-##
-NULL = #BOŞ!
-DIV0 = #SAYI/0!
-VALUE = #DEĞER!
-REF = #BAŞV!
-NAME = #AD?
-NUM = #SAYI!
-NA = #YOK
diff --git a/lib/phpexcel/readme_moodle.txt b/lib/phpexcel/readme_moodle.txt
deleted file mode 100644
index 1a428cc131e..00000000000
--- a/lib/phpexcel/readme_moodle.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-Description of PHPExcel 1.8.0 import into Moodle
-
-Steps:
- * download release package from https://github.com/PHPOffice/PHPExcel
- * copy contents of Classes directory
- * update lib/thirdpartylibs.xml
- * apply changes
- * go to http://127.0.0.1/lib/tests/other/spreadsheettestpage.php
- and test the generated files
-
-Changes:
- * Shared/File/sys_get_temp_dir() - we can not guarantee sys_get_temp_dir() works everywhere
- * Shared/OLE has been removed. OLE is not DFSG compliant and is not being used in core code.
- * Excel5 files have been removed. These files are for Excel version 5 (created in 1993) and are not used in core code.
- The files removed are:
- - PHPExcel/Shared/Excel5.php
- - PHPExcel/Shared/OLE.php
- - PHPExcel/Shared/OLERead.php
- - PHPExcel/Writer/Excel5.php
- - PHPExcel/Writer/Excel5/BIFFwriter.php
- - PHPExcel/Writer/Excel5/Escher.php
- - PHPExcel/Writer/Excel5/Font.php
- - PHPExcel/Writer/Excel5/Parser.php
- - PHPExcel/Writer/Excel5/Workbook.php
- - PHPExcel/Writer/Excel5/Worksheet.php
- - PHPExcel/Writer/Excel5/Xf.php
- lib/excellib.class.php has been updated so that only 2007 excel spreadsheets will be produced.
- * MDL-52336 patch for PHP7 compatibility, after upgrade make sure that these changes are included and remove this line
-
-
-
diff --git a/lib/phpspreadsheet/readme_moodle.txt b/lib/phpspreadsheet/readme_moodle.txt
new file mode 100644
index 00000000000..6625044db13
--- /dev/null
+++ b/lib/phpspreadsheet/readme_moodle.txt
@@ -0,0 +1,54 @@
+Description of PhpSpreadsheet 1.7.0 import into Moodle
+
+Last release package can be found in https://github.com/PHPOffice/PhpSpreadsheet/releases
+
+STEPS:
+ * Create a temporary folder outside your moodle installation
+ * Execute `composer require phpoffice/phpspreadsheet`
+ * Copy contents of 'vendor' directory
+ * Update lib/thirdpartylibs.xml
+ * Apply the modifications described in the CHANGES section
+ * Go to http://localhost/lib/tests/other/spreadsheettestpage.php and test the generated files
+
+
+CHANGES:
+ * Remove the following folders (and their content):
+ - vendor/phpoffice/phpspreadsheet/bin
+ - vendor/phpoffice/phpspreadsheet/docs
+ - vendor/phpoffice/phpspreadsheet/samples
+
+* Remove the hidden folders and files in vendor/phpoffice/phpspreadsheet/:
+ - .github/*
+ - .gitattributes
+ - .gitignore
+ - .php_cs.dist
+ - .sami.php
+ - .scrutinizer.yml
+ - .travis.yml
+
+ * Add the Moodle hack in vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/File/sys_get_temp_dir() because we
+ can not guarantee sys_get_temp_dir() works everywhere:
+
+ // Moodle hack!
+ if (function_exists('make_temp_directory')) {
+ $temp = make_temp_directory('phpspreadsheet');
+ return realpath(dirname($temp));
+ }
+
+ * Shared/OLE has been removed because OLE is not DFSG compliant and is not being used in core code.
+ Remove the files/folders:
+ - PhpSpreadsheet/Shared/OLE.php
+ - PhpSpreadsheet/Shared/OLERead.php
+ - PhpSpreadsheet/Shared/OLE/*
+
+ * Xsl files have been removed. These files are for Excel version 5 (created in 1993) and are not used in core code.
+ Remove the files/folders:
+ - PhpSpreadsheet/Reader/Xls.php
+ - PhpSpreadsheet/Reader/Xls/*
+ - PhpSpreadsheet/Shared/Xls.php
+ - PhpSpreadsheet/Writer/Xls.php
+ - PhpSpreadsheet/Writer/Xls/*
+
+
+COMMENTS:
+ * lib/excellib.class.php has been updated so that only xslx spreadsheets will be produced.
diff --git a/lib/phpspreadsheet/vendor/autoload.php b/lib/phpspreadsheet/vendor/autoload.php
new file mode 100644
index 00000000000..f3b1a2af60e
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/autoload.php
@@ -0,0 +1,7 @@
+
+ * Jordi Boggiano
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Composer\Autoload;
+
+/**
+ * ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
+ *
+ * $loader = new \Composer\Autoload\ClassLoader();
+ *
+ * // register classes with namespaces
+ * $loader->add('Symfony\Component', __DIR__.'/component');
+ * $loader->add('Symfony', __DIR__.'/framework');
+ *
+ * // activate the autoloader
+ * $loader->register();
+ *
+ * // to enable searching the include path (eg. for PEAR packages)
+ * $loader->setUseIncludePath(true);
+ *
+ * In this example, if you try to use a class in the Symfony\Component
+ * namespace or one of its children (Symfony\Component\Console for instance),
+ * the autoloader will first look for the class under the component/
+ * directory, and it will then fallback to the framework/ directory if not
+ * found before giving up.
+ *
+ * This class is loosely based on the Symfony UniversalClassLoader.
+ *
+ * @author Fabien Potencier
+ * @author Jordi Boggiano
+ * @see http://www.php-fig.org/psr/psr-0/
+ * @see http://www.php-fig.org/psr/psr-4/
+ */
+class ClassLoader
+{
+ // PSR-4
+ private $prefixLengthsPsr4 = array();
+ private $prefixDirsPsr4 = array();
+ private $fallbackDirsPsr4 = array();
+
+ // PSR-0
+ private $prefixesPsr0 = array();
+ private $fallbackDirsPsr0 = array();
+
+ private $useIncludePath = false;
+ private $classMap = array();
+ private $classMapAuthoritative = false;
+ private $missingClasses = array();
+ private $apcuPrefix;
+
+ public function getPrefixes()
+ {
+ if (!empty($this->prefixesPsr0)) {
+ return call_user_func_array('array_merge', $this->prefixesPsr0);
+ }
+
+ return array();
+ }
+
+ public function getPrefixesPsr4()
+ {
+ return $this->prefixDirsPsr4;
+ }
+
+ public function getFallbackDirs()
+ {
+ return $this->fallbackDirsPsr0;
+ }
+
+ public function getFallbackDirsPsr4()
+ {
+ return $this->fallbackDirsPsr4;
+ }
+
+ public function getClassMap()
+ {
+ return $this->classMap;
+ }
+
+ /**
+ * @param array $classMap Class to filename map
+ */
+ public function addClassMap(array $classMap)
+ {
+ if ($this->classMap) {
+ $this->classMap = array_merge($this->classMap, $classMap);
+ } else {
+ $this->classMap = $classMap;
+ }
+ }
+
+ /**
+ * Registers a set of PSR-0 directories for a given prefix, either
+ * appending or prepending to the ones previously set for this prefix.
+ *
+ * @param string $prefix The prefix
+ * @param array|string $paths The PSR-0 root directories
+ * @param bool $prepend Whether to prepend the directories
+ */
+ public function add($prefix, $paths, $prepend = false)
+ {
+ if (!$prefix) {
+ if ($prepend) {
+ $this->fallbackDirsPsr0 = array_merge(
+ (array) $paths,
+ $this->fallbackDirsPsr0
+ );
+ } else {
+ $this->fallbackDirsPsr0 = array_merge(
+ $this->fallbackDirsPsr0,
+ (array) $paths
+ );
+ }
+
+ return;
+ }
+
+ $first = $prefix[0];
+ if (!isset($this->prefixesPsr0[$first][$prefix])) {
+ $this->prefixesPsr0[$first][$prefix] = (array) $paths;
+
+ return;
+ }
+ if ($prepend) {
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
+ (array) $paths,
+ $this->prefixesPsr0[$first][$prefix]
+ );
+ } else {
+ $this->prefixesPsr0[$first][$prefix] = array_merge(
+ $this->prefixesPsr0[$first][$prefix],
+ (array) $paths
+ );
+ }
+ }
+
+ /**
+ * Registers a set of PSR-4 directories for a given namespace, either
+ * appending or prepending to the ones previously set for this namespace.
+ *
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param array|string $paths The PSR-4 base directories
+ * @param bool $prepend Whether to prepend the directories
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function addPsr4($prefix, $paths, $prepend = false)
+ {
+ if (!$prefix) {
+ // Register directories for the root namespace.
+ if ($prepend) {
+ $this->fallbackDirsPsr4 = array_merge(
+ (array) $paths,
+ $this->fallbackDirsPsr4
+ );
+ } else {
+ $this->fallbackDirsPsr4 = array_merge(
+ $this->fallbackDirsPsr4,
+ (array) $paths
+ );
+ }
+ } elseif (!isset($this->prefixDirsPsr4[$prefix])) {
+ // Register directories for a new namespace.
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+ }
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
+ } elseif ($prepend) {
+ // Prepend directories for an already registered namespace.
+ $this->prefixDirsPsr4[$prefix] = array_merge(
+ (array) $paths,
+ $this->prefixDirsPsr4[$prefix]
+ );
+ } else {
+ // Append directories for an already registered namespace.
+ $this->prefixDirsPsr4[$prefix] = array_merge(
+ $this->prefixDirsPsr4[$prefix],
+ (array) $paths
+ );
+ }
+ }
+
+ /**
+ * Registers a set of PSR-0 directories for a given prefix,
+ * replacing any others previously set for this prefix.
+ *
+ * @param string $prefix The prefix
+ * @param array|string $paths The PSR-0 base directories
+ */
+ public function set($prefix, $paths)
+ {
+ if (!$prefix) {
+ $this->fallbackDirsPsr0 = (array) $paths;
+ } else {
+ $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths;
+ }
+ }
+
+ /**
+ * Registers a set of PSR-4 directories for a given namespace,
+ * replacing any others previously set for this namespace.
+ *
+ * @param string $prefix The prefix/namespace, with trailing '\\'
+ * @param array|string $paths The PSR-4 base directories
+ *
+ * @throws \InvalidArgumentException
+ */
+ public function setPsr4($prefix, $paths)
+ {
+ if (!$prefix) {
+ $this->fallbackDirsPsr4 = (array) $paths;
+ } else {
+ $length = strlen($prefix);
+ if ('\\' !== $prefix[$length - 1]) {
+ throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
+ }
+ $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
+ $this->prefixDirsPsr4[$prefix] = (array) $paths;
+ }
+ }
+
+ /**
+ * Turns on searching the include path for class files.
+ *
+ * @param bool $useIncludePath
+ */
+ public function setUseIncludePath($useIncludePath)
+ {
+ $this->useIncludePath = $useIncludePath;
+ }
+
+ /**
+ * Can be used to check if the autoloader uses the include path to check
+ * for classes.
+ *
+ * @return bool
+ */
+ public function getUseIncludePath()
+ {
+ return $this->useIncludePath;
+ }
+
+ /**
+ * Turns off searching the prefix and fallback directories for classes
+ * that have not been registered with the class map.
+ *
+ * @param bool $classMapAuthoritative
+ */
+ public function setClassMapAuthoritative($classMapAuthoritative)
+ {
+ $this->classMapAuthoritative = $classMapAuthoritative;
+ }
+
+ /**
+ * Should class lookup fail if not found in the current class map?
+ *
+ * @return bool
+ */
+ public function isClassMapAuthoritative()
+ {
+ return $this->classMapAuthoritative;
+ }
+
+ /**
+ * APCu prefix to use to cache found/not-found classes, if the extension is enabled.
+ *
+ * @param string|null $apcuPrefix
+ */
+ public function setApcuPrefix($apcuPrefix)
+ {
+ $this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null;
+ }
+
+ /**
+ * The APCu prefix in use, or null if APCu caching is not enabled.
+ *
+ * @return string|null
+ */
+ public function getApcuPrefix()
+ {
+ return $this->apcuPrefix;
+ }
+
+ /**
+ * Registers this instance as an autoloader.
+ *
+ * @param bool $prepend Whether to prepend the autoloader or not
+ */
+ public function register($prepend = false)
+ {
+ spl_autoload_register(array($this, 'loadClass'), true, $prepend);
+ }
+
+ /**
+ * Unregisters this instance as an autoloader.
+ */
+ public function unregister()
+ {
+ spl_autoload_unregister(array($this, 'loadClass'));
+ }
+
+ /**
+ * Loads the given class or interface.
+ *
+ * @param string $class The name of the class
+ * @return bool|null True if loaded, null otherwise
+ */
+ public function loadClass($class)
+ {
+ if ($file = $this->findFile($class)) {
+ includeFile($file);
+
+ return true;
+ }
+ }
+
+ /**
+ * Finds the path to the file where the class is defined.
+ *
+ * @param string $class The name of the class
+ *
+ * @return string|false The path if found, false otherwise
+ */
+ public function findFile($class)
+ {
+ // class map lookup
+ if (isset($this->classMap[$class])) {
+ return $this->classMap[$class];
+ }
+ if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) {
+ return false;
+ }
+ if (null !== $this->apcuPrefix) {
+ $file = apcu_fetch($this->apcuPrefix.$class, $hit);
+ if ($hit) {
+ return $file;
+ }
+ }
+
+ $file = $this->findFileWithExtension($class, '.php');
+
+ // Search for Hack files if we are running on HHVM
+ if (false === $file && defined('HHVM_VERSION')) {
+ $file = $this->findFileWithExtension($class, '.hh');
+ }
+
+ if (null !== $this->apcuPrefix) {
+ apcu_add($this->apcuPrefix.$class, $file);
+ }
+
+ if (false === $file) {
+ // Remember that this class does not exist.
+ $this->missingClasses[$class] = true;
+ }
+
+ return $file;
+ }
+
+ private function findFileWithExtension($class, $ext)
+ {
+ // PSR-4 lookup
+ $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
+
+ $first = $class[0];
+ if (isset($this->prefixLengthsPsr4[$first])) {
+ $subPath = $class;
+ while (false !== $lastPos = strrpos($subPath, '\\')) {
+ $subPath = substr($subPath, 0, $lastPos);
+ $search = $subPath.'\\';
+ if (isset($this->prefixDirsPsr4[$search])) {
+ $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
+ foreach ($this->prefixDirsPsr4[$search] as $dir) {
+ if (file_exists($file = $dir . $pathEnd)) {
+ return $file;
+ }
+ }
+ }
+ }
+ }
+
+ // PSR-4 fallback dirs
+ foreach ($this->fallbackDirsPsr4 as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) {
+ return $file;
+ }
+ }
+
+ // PSR-0 lookup
+ if (false !== $pos = strrpos($class, '\\')) {
+ // namespaced class name
+ $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1)
+ . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR);
+ } else {
+ // PEAR-like class name
+ $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext;
+ }
+
+ if (isset($this->prefixesPsr0[$first])) {
+ foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) {
+ if (0 === strpos($class, $prefix)) {
+ foreach ($dirs as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ return $file;
+ }
+ }
+ }
+ }
+ }
+
+ // PSR-0 fallback dirs
+ foreach ($this->fallbackDirsPsr0 as $dir) {
+ if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) {
+ return $file;
+ }
+ }
+
+ // PSR-0 include paths.
+ if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) {
+ return $file;
+ }
+
+ return false;
+ }
+}
+
+/**
+ * Scope isolated include.
+ *
+ * Prevents access to $this/self from included files.
+ */
+function includeFile($file)
+{
+ include $file;
+}
diff --git a/lib/phpspreadsheet/vendor/composer/LICENSE b/lib/phpspreadsheet/vendor/composer/LICENSE
new file mode 100644
index 00000000000..f0157a6ed02
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/composer/LICENSE
@@ -0,0 +1,56 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: Composer
+Upstream-Contact: Jordi Boggiano
+Source: https://github.com/composer/composer
+
+Files: *
+Copyright: 2016, Nils Adermann
+ 2016, Jordi Boggiano
+License: Expat
+
+Files: src/Composer/Util/TlsHelper.php
+Copyright: 2016, Nils Adermann
+ 2016, Jordi Boggiano
+ 2013, Evan Coury
+License: Expat and BSD-2-Clause
+
+License: BSD-2-Clause
+ Redistribution and use in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+ .
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ .
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ .
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
+ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+License: Expat
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is furnished
+ to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
diff --git a/lib/phpspreadsheet/vendor/composer/autoload_classmap.php b/lib/phpspreadsheet/vendor/composer/autoload_classmap.php
new file mode 100644
index 00000000000..7a91153b0d8
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/composer/autoload_classmap.php
@@ -0,0 +1,9 @@
+ $vendorDir . '/markbaker/complex/classes/src/functions/abs.php',
+ '21a5860fbef5be28db5ddfbc3cca67c4' => $vendorDir . '/markbaker/complex/classes/src/functions/acos.php',
+ '1546e3f9d127f2a9bb2d1b6c31c26ef1' => $vendorDir . '/markbaker/complex/classes/src/functions/acosh.php',
+ 'd2516f7f4fba5ea5905f494b4a8262e0' => $vendorDir . '/markbaker/complex/classes/src/functions/acot.php',
+ '4511163d560956219b96882c0980b65e' => $vendorDir . '/markbaker/complex/classes/src/functions/acoth.php',
+ 'c361f5616dc2a8da4fa3e137077cd4ea' => $vendorDir . '/markbaker/complex/classes/src/functions/acsc.php',
+ '02d68920fc98da71991ce569c91df0f6' => $vendorDir . '/markbaker/complex/classes/src/functions/acsch.php',
+ '88e19525eae308b4a6aa3419364875d3' => $vendorDir . '/markbaker/complex/classes/src/functions/argument.php',
+ '60e8e2d0827b58bfc904f13957e51849' => $vendorDir . '/markbaker/complex/classes/src/functions/asec.php',
+ '13d2f040713999eab66c359b4d79871d' => $vendorDir . '/markbaker/complex/classes/src/functions/asech.php',
+ '838ab38beb32c68a79d3cd2c007d5a04' => $vendorDir . '/markbaker/complex/classes/src/functions/asin.php',
+ 'bb28eccd0f8f008333a1b3c163d604ac' => $vendorDir . '/markbaker/complex/classes/src/functions/asinh.php',
+ '9e483de83558c98f7d3feaa402c78cb3' => $vendorDir . '/markbaker/complex/classes/src/functions/atan.php',
+ '36b74b5b765ded91ee58c8ee3c0e85e3' => $vendorDir . '/markbaker/complex/classes/src/functions/atanh.php',
+ '05c15ee9510da7fd6bf6136f436500c0' => $vendorDir . '/markbaker/complex/classes/src/functions/conjugate.php',
+ 'd3208dfbce2505e370788f9f22f6785f' => $vendorDir . '/markbaker/complex/classes/src/functions/cos.php',
+ '141cf1fb3a3046f8b64534b0ebab33ca' => $vendorDir . '/markbaker/complex/classes/src/functions/cosh.php',
+ 'be660df75fd0dbe7fa7c03b7434b3294' => $vendorDir . '/markbaker/complex/classes/src/functions/cot.php',
+ '01e31ea298a51bc9e91517e3ce6b9e76' => $vendorDir . '/markbaker/complex/classes/src/functions/coth.php',
+ '803ddd97f7b1da68982a7b087c3476f6' => $vendorDir . '/markbaker/complex/classes/src/functions/csc.php',
+ '3001cdfd101ec3c32da34ee43c2e149b' => $vendorDir . '/markbaker/complex/classes/src/functions/csch.php',
+ '77b2d7629ef2a93fabb8c56754a91051' => $vendorDir . '/markbaker/complex/classes/src/functions/exp.php',
+ '4a4471296dec796c21d4f4b6552396a9' => $vendorDir . '/markbaker/complex/classes/src/functions/inverse.php',
+ 'c3e9897e1744b88deb56fcdc39d34d85' => $vendorDir . '/markbaker/complex/classes/src/functions/ln.php',
+ 'a83cacf2de942cff288de15a83afd26d' => $vendorDir . '/markbaker/complex/classes/src/functions/log2.php',
+ '6a861dacc9ee2f3061241d4c7772fa21' => $vendorDir . '/markbaker/complex/classes/src/functions/log10.php',
+ '4d2522d968c8ba78d6c13548a1b4200e' => $vendorDir . '/markbaker/complex/classes/src/functions/negative.php',
+ 'fd587ca933fc0447fa5ab4843bdd97f7' => $vendorDir . '/markbaker/complex/classes/src/functions/pow.php',
+ '383ef01c62028fc78cd4388082fce3c2' => $vendorDir . '/markbaker/complex/classes/src/functions/rho.php',
+ '150fbd1b95029dc47292da97ecab9375' => $vendorDir . '/markbaker/complex/classes/src/functions/sec.php',
+ '549abd9bae174286d660bdaa07407c68' => $vendorDir . '/markbaker/complex/classes/src/functions/sech.php',
+ '6bfbf5eaea6b17a0ed85cb21ba80370c' => $vendorDir . '/markbaker/complex/classes/src/functions/sin.php',
+ '22efe13f1a497b8e199540ae2d9dc59c' => $vendorDir . '/markbaker/complex/classes/src/functions/sinh.php',
+ 'e90135ab8e787795a509ed7147de207d' => $vendorDir . '/markbaker/complex/classes/src/functions/sqrt.php',
+ 'bb0a7923ffc6a90919cd64ec54ff06bc' => $vendorDir . '/markbaker/complex/classes/src/functions/tan.php',
+ '2d302f32ce0fd4e433dd91c5bb404a28' => $vendorDir . '/markbaker/complex/classes/src/functions/tanh.php',
+ '24dd4658a952171a4ee79218c4f9fd06' => $vendorDir . '/markbaker/complex/classes/src/functions/theta.php',
+ 'e49b7876281d6f5bc39536dde96d1f4a' => $vendorDir . '/markbaker/complex/classes/src/operations/add.php',
+ '47596e02b43cd6da7700134fd08f88cf' => $vendorDir . '/markbaker/complex/classes/src/operations/subtract.php',
+ '883af48563631547925fa4c3b48ead07' => $vendorDir . '/markbaker/complex/classes/src/operations/multiply.php',
+ 'f190e3308e6ca23234a2875edc985c03' => $vendorDir . '/markbaker/complex/classes/src/operations/divideby.php',
+ 'ac9e33ce6841aa5bf5d16d465a2f03a7' => $vendorDir . '/markbaker/complex/classes/src/operations/divideinto.php',
+ '9d8e013a5160a09477beb8e44f8ae97b' => $vendorDir . '/markbaker/matrix/classes/src/functions/adjoint.php',
+ '6e78d1bdea6248d6aa117229efae50f2' => $vendorDir . '/markbaker/matrix/classes/src/functions/antidiagonal.php',
+ '4623d87924d94f5412fe5afbf1cef31d' => $vendorDir . '/markbaker/matrix/classes/src/functions/cofactors.php',
+ '901fd1f6950a637ca85f66b701a45e13' => $vendorDir . '/markbaker/matrix/classes/src/functions/determinant.php',
+ '83057abc0e4acc99ba80154ee5d02a49' => $vendorDir . '/markbaker/matrix/classes/src/functions/diagonal.php',
+ '07b7fd7a434451149b4fd477fca0ce06' => $vendorDir . '/markbaker/matrix/classes/src/functions/identity.php',
+ 'c8d43b340583e07ae89f2a3baef2cf89' => $vendorDir . '/markbaker/matrix/classes/src/functions/inverse.php',
+ '499bb10ed7a3aee2ba4c09a31a85e8d1' => $vendorDir . '/markbaker/matrix/classes/src/functions/minors.php',
+ '1cad2e6414d652e8b1c64e8967f6f37d' => $vendorDir . '/markbaker/matrix/classes/src/functions/trace.php',
+ '95a7f134ac17161d07def442b3b737e8' => $vendorDir . '/markbaker/matrix/classes/src/functions/transpose.php',
+ 'b3a6bc628377118d4b4b8ba08d1eb949' => $vendorDir . '/markbaker/matrix/classes/src/operations/add.php',
+ '5fef6d0e407f3f8887266dfa4a6c534c' => $vendorDir . '/markbaker/matrix/classes/src/operations/directsum.php',
+ '684ba247e1385946e3babdaa054119de' => $vendorDir . '/markbaker/matrix/classes/src/operations/subtract.php',
+ 'aa53dcba601214d17ad405b7c291b7e8' => $vendorDir . '/markbaker/matrix/classes/src/operations/multiply.php',
+ '75c79eb1b25749b05a47976f32b0d8a2' => $vendorDir . '/markbaker/matrix/classes/src/operations/divideby.php',
+ '6ab8ad87a734f276a6bcd5a0fe1289be' => $vendorDir . '/markbaker/matrix/classes/src/operations/divideinto.php',
+);
diff --git a/lib/phpspreadsheet/vendor/composer/autoload_namespaces.php b/lib/phpspreadsheet/vendor/composer/autoload_namespaces.php
new file mode 100644
index 00000000000..b7fc0125dbc
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/composer/autoload_namespaces.php
@@ -0,0 +1,9 @@
+ array($vendorDir . '/psr/simple-cache/src'),
+ 'PhpOffice\\PhpSpreadsheet\\' => array($vendorDir . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet'),
+ 'Matrix\\' => array($vendorDir . '/markbaker/matrix/classes/src'),
+ 'Complex\\' => array($vendorDir . '/markbaker/complex/classes/src'),
+);
diff --git a/lib/phpspreadsheet/vendor/composer/autoload_real.php b/lib/phpspreadsheet/vendor/composer/autoload_real.php
new file mode 100644
index 00000000000..9305b8f149e
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/composer/autoload_real.php
@@ -0,0 +1,70 @@
+= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
+ if ($useStaticLoader) {
+ require_once __DIR__ . '/autoload_static.php';
+
+ call_user_func(\Composer\Autoload\ComposerStaticInitd2fe1bff8f5edf0dba7c9d9b0345247c::getInitializer($loader));
+ } else {
+ $map = require __DIR__ . '/autoload_namespaces.php';
+ foreach ($map as $namespace => $path) {
+ $loader->set($namespace, $path);
+ }
+
+ $map = require __DIR__ . '/autoload_psr4.php';
+ foreach ($map as $namespace => $path) {
+ $loader->setPsr4($namespace, $path);
+ }
+
+ $classMap = require __DIR__ . '/autoload_classmap.php';
+ if ($classMap) {
+ $loader->addClassMap($classMap);
+ }
+ }
+
+ $loader->register(true);
+
+ if ($useStaticLoader) {
+ $includeFiles = Composer\Autoload\ComposerStaticInitd2fe1bff8f5edf0dba7c9d9b0345247c::$files;
+ } else {
+ $includeFiles = require __DIR__ . '/autoload_files.php';
+ }
+ foreach ($includeFiles as $fileIdentifier => $file) {
+ composerRequired2fe1bff8f5edf0dba7c9d9b0345247c($fileIdentifier, $file);
+ }
+
+ return $loader;
+ }
+}
+
+function composerRequired2fe1bff8f5edf0dba7c9d9b0345247c($fileIdentifier, $file)
+{
+ if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
+ require $file;
+
+ $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/composer/autoload_static.php b/lib/phpspreadsheet/vendor/composer/autoload_static.php
new file mode 100644
index 00000000000..75b744ae31b
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/composer/autoload_static.php
@@ -0,0 +1,113 @@
+ __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/abs.php',
+ '21a5860fbef5be28db5ddfbc3cca67c4' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acos.php',
+ '1546e3f9d127f2a9bb2d1b6c31c26ef1' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acosh.php',
+ 'd2516f7f4fba5ea5905f494b4a8262e0' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acot.php',
+ '4511163d560956219b96882c0980b65e' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acoth.php',
+ 'c361f5616dc2a8da4fa3e137077cd4ea' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acsc.php',
+ '02d68920fc98da71991ce569c91df0f6' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/acsch.php',
+ '88e19525eae308b4a6aa3419364875d3' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/argument.php',
+ '60e8e2d0827b58bfc904f13957e51849' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/asec.php',
+ '13d2f040713999eab66c359b4d79871d' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/asech.php',
+ '838ab38beb32c68a79d3cd2c007d5a04' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/asin.php',
+ 'bb28eccd0f8f008333a1b3c163d604ac' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/asinh.php',
+ '9e483de83558c98f7d3feaa402c78cb3' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/atan.php',
+ '36b74b5b765ded91ee58c8ee3c0e85e3' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/atanh.php',
+ '05c15ee9510da7fd6bf6136f436500c0' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/conjugate.php',
+ 'd3208dfbce2505e370788f9f22f6785f' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/cos.php',
+ '141cf1fb3a3046f8b64534b0ebab33ca' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/cosh.php',
+ 'be660df75fd0dbe7fa7c03b7434b3294' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/cot.php',
+ '01e31ea298a51bc9e91517e3ce6b9e76' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/coth.php',
+ '803ddd97f7b1da68982a7b087c3476f6' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/csc.php',
+ '3001cdfd101ec3c32da34ee43c2e149b' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/csch.php',
+ '77b2d7629ef2a93fabb8c56754a91051' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/exp.php',
+ '4a4471296dec796c21d4f4b6552396a9' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/inverse.php',
+ 'c3e9897e1744b88deb56fcdc39d34d85' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/ln.php',
+ 'a83cacf2de942cff288de15a83afd26d' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/log2.php',
+ '6a861dacc9ee2f3061241d4c7772fa21' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/log10.php',
+ '4d2522d968c8ba78d6c13548a1b4200e' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/negative.php',
+ 'fd587ca933fc0447fa5ab4843bdd97f7' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/pow.php',
+ '383ef01c62028fc78cd4388082fce3c2' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/rho.php',
+ '150fbd1b95029dc47292da97ecab9375' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sec.php',
+ '549abd9bae174286d660bdaa07407c68' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sech.php',
+ '6bfbf5eaea6b17a0ed85cb21ba80370c' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sin.php',
+ '22efe13f1a497b8e199540ae2d9dc59c' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sinh.php',
+ 'e90135ab8e787795a509ed7147de207d' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/sqrt.php',
+ 'bb0a7923ffc6a90919cd64ec54ff06bc' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/tan.php',
+ '2d302f32ce0fd4e433dd91c5bb404a28' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/tanh.php',
+ '24dd4658a952171a4ee79218c4f9fd06' => __DIR__ . '/..' . '/markbaker/complex/classes/src/functions/theta.php',
+ 'e49b7876281d6f5bc39536dde96d1f4a' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/add.php',
+ '47596e02b43cd6da7700134fd08f88cf' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/subtract.php',
+ '883af48563631547925fa4c3b48ead07' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/multiply.php',
+ 'f190e3308e6ca23234a2875edc985c03' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/divideby.php',
+ 'ac9e33ce6841aa5bf5d16d465a2f03a7' => __DIR__ . '/..' . '/markbaker/complex/classes/src/operations/divideinto.php',
+ '9d8e013a5160a09477beb8e44f8ae97b' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/adjoint.php',
+ '6e78d1bdea6248d6aa117229efae50f2' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/antidiagonal.php',
+ '4623d87924d94f5412fe5afbf1cef31d' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/cofactors.php',
+ '901fd1f6950a637ca85f66b701a45e13' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/determinant.php',
+ '83057abc0e4acc99ba80154ee5d02a49' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/diagonal.php',
+ '07b7fd7a434451149b4fd477fca0ce06' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/identity.php',
+ 'c8d43b340583e07ae89f2a3baef2cf89' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/inverse.php',
+ '499bb10ed7a3aee2ba4c09a31a85e8d1' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/minors.php',
+ '1cad2e6414d652e8b1c64e8967f6f37d' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/trace.php',
+ '95a7f134ac17161d07def442b3b737e8' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/functions/transpose.php',
+ 'b3a6bc628377118d4b4b8ba08d1eb949' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/add.php',
+ '5fef6d0e407f3f8887266dfa4a6c534c' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/directsum.php',
+ '684ba247e1385946e3babdaa054119de' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/subtract.php',
+ 'aa53dcba601214d17ad405b7c291b7e8' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/multiply.php',
+ '75c79eb1b25749b05a47976f32b0d8a2' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/divideby.php',
+ '6ab8ad87a734f276a6bcd5a0fe1289be' => __DIR__ . '/..' . '/markbaker/matrix/classes/src/operations/divideinto.php',
+ );
+
+ public static $prefixLengthsPsr4 = array (
+ 'P' =>
+ array (
+ 'Psr\\SimpleCache\\' => 16,
+ 'PhpOffice\\PhpSpreadsheet\\' => 25,
+ ),
+ 'M' =>
+ array (
+ 'Matrix\\' => 7,
+ ),
+ 'C' =>
+ array (
+ 'Complex\\' => 8,
+ ),
+ );
+
+ public static $prefixDirsPsr4 = array (
+ 'Psr\\SimpleCache\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/psr/simple-cache/src',
+ ),
+ 'PhpOffice\\PhpSpreadsheet\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/phpoffice/phpspreadsheet/src/PhpSpreadsheet',
+ ),
+ 'Matrix\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/markbaker/matrix/classes/src',
+ ),
+ 'Complex\\' =>
+ array (
+ 0 => __DIR__ . '/..' . '/markbaker/complex/classes/src',
+ ),
+ );
+
+ public static function getInitializer(ClassLoader $loader)
+ {
+ return \Closure::bind(function () use ($loader) {
+ $loader->prefixLengthsPsr4 = ComposerStaticInitd2fe1bff8f5edf0dba7c9d9b0345247c::$prefixLengthsPsr4;
+ $loader->prefixDirsPsr4 = ComposerStaticInitd2fe1bff8f5edf0dba7c9d9b0345247c::$prefixDirsPsr4;
+
+ }, null, ClassLoader::class);
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/composer/installed.json b/lib/phpspreadsheet/vendor/composer/installed.json
new file mode 100644
index 00000000000..9a379b78042
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/composer/installed.json
@@ -0,0 +1,317 @@
+[
+ {
+ "name": "markbaker/complex",
+ "version": "1.4.7",
+ "version_normalized": "1.4.7.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/MarkBaker/PHPComplex.git",
+ "reference": "1ea674a8308baf547cbcbd30c5fcd6d301b7c000"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/1ea674a8308baf547cbcbd30c5fcd6d301b7c000",
+ "reference": "1ea674a8308baf547cbcbd30c5fcd6d301b7c000",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.6.0|^7.0.0"
+ },
+ "require-dev": {
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3",
+ "phpcompatibility/php-compatibility": "^8.0",
+ "phpdocumentor/phpdocumentor": "2.*",
+ "phploc/phploc": "2.*",
+ "phpmd/phpmd": "2.*",
+ "phpunit/phpunit": "^4.8.35|^5.4.0",
+ "sebastian/phpcpd": "2.*",
+ "squizlabs/php_codesniffer": "^3.3.0"
+ },
+ "time": "2018-10-13T23:28:42+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Complex\\": "classes/src/"
+ },
+ "files": [
+ "classes/src/functions/abs.php",
+ "classes/src/functions/acos.php",
+ "classes/src/functions/acosh.php",
+ "classes/src/functions/acot.php",
+ "classes/src/functions/acoth.php",
+ "classes/src/functions/acsc.php",
+ "classes/src/functions/acsch.php",
+ "classes/src/functions/argument.php",
+ "classes/src/functions/asec.php",
+ "classes/src/functions/asech.php",
+ "classes/src/functions/asin.php",
+ "classes/src/functions/asinh.php",
+ "classes/src/functions/atan.php",
+ "classes/src/functions/atanh.php",
+ "classes/src/functions/conjugate.php",
+ "classes/src/functions/cos.php",
+ "classes/src/functions/cosh.php",
+ "classes/src/functions/cot.php",
+ "classes/src/functions/coth.php",
+ "classes/src/functions/csc.php",
+ "classes/src/functions/csch.php",
+ "classes/src/functions/exp.php",
+ "classes/src/functions/inverse.php",
+ "classes/src/functions/ln.php",
+ "classes/src/functions/log2.php",
+ "classes/src/functions/log10.php",
+ "classes/src/functions/negative.php",
+ "classes/src/functions/pow.php",
+ "classes/src/functions/rho.php",
+ "classes/src/functions/sec.php",
+ "classes/src/functions/sech.php",
+ "classes/src/functions/sin.php",
+ "classes/src/functions/sinh.php",
+ "classes/src/functions/sqrt.php",
+ "classes/src/functions/tan.php",
+ "classes/src/functions/tanh.php",
+ "classes/src/functions/theta.php",
+ "classes/src/operations/add.php",
+ "classes/src/operations/subtract.php",
+ "classes/src/operations/multiply.php",
+ "classes/src/operations/divideby.php",
+ "classes/src/operations/divideinto.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mark Baker",
+ "email": "mark@lange.demon.co.uk"
+ }
+ ],
+ "description": "PHP Class for working with complex numbers",
+ "homepage": "https://github.com/MarkBaker/PHPComplex",
+ "keywords": [
+ "complex",
+ "mathematics"
+ ]
+ },
+ {
+ "name": "markbaker/matrix",
+ "version": "1.1.4",
+ "version_normalized": "1.1.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/MarkBaker/PHPMatrix.git",
+ "reference": "6ea97472b5baf12119b4f31f802835b820dd6d64"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/6ea97472b5baf12119b4f31f802835b820dd6d64",
+ "reference": "6ea97472b5baf12119b4f31f802835b820dd6d64",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.6.0|^7.0.0"
+ },
+ "require-dev": {
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3",
+ "phpcompatibility/php-compatibility": "^8.0",
+ "phpdocumentor/phpdocumentor": "2.*",
+ "phploc/phploc": "2.*",
+ "phpmd/phpmd": "2.*",
+ "phpunit/phpunit": "^4.8.35|^5.4.0",
+ "sebastian/phpcpd": "2.*",
+ "squizlabs/php_codesniffer": "^3.3.0"
+ },
+ "time": "2018-11-04T22:12:12+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Matrix\\": "classes/src/"
+ },
+ "files": [
+ "classes/src/functions/adjoint.php",
+ "classes/src/functions/antidiagonal.php",
+ "classes/src/functions/cofactors.php",
+ "classes/src/functions/determinant.php",
+ "classes/src/functions/diagonal.php",
+ "classes/src/functions/identity.php",
+ "classes/src/functions/inverse.php",
+ "classes/src/functions/minors.php",
+ "classes/src/functions/trace.php",
+ "classes/src/functions/transpose.php",
+ "classes/src/operations/add.php",
+ "classes/src/operations/directsum.php",
+ "classes/src/operations/subtract.php",
+ "classes/src/operations/multiply.php",
+ "classes/src/operations/divideby.php",
+ "classes/src/operations/divideinto.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mark Baker",
+ "email": "mark@lange.demon.co.uk"
+ }
+ ],
+ "description": "PHP Class for working with matrices",
+ "homepage": "https://github.com/MarkBaker/PHPMatrix",
+ "keywords": [
+ "mathematics",
+ "matrix",
+ "vector"
+ ]
+ },
+ {
+ "name": "phpoffice/phpspreadsheet",
+ "version": "1.7.0",
+ "version_normalized": "1.7.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PHPOffice/PhpSpreadsheet.git",
+ "reference": "84e09df79855ed3da84e2eab6850eb7741d8cbda"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PHPOffice/PhpSpreadsheet/zipball/84e09df79855ed3da84e2eab6850eb7741d8cbda",
+ "reference": "84e09df79855ed3da84e2eab6850eb7741d8cbda",
+ "shasum": ""
+ },
+ "require": {
+ "ext-ctype": "*",
+ "ext-dom": "*",
+ "ext-fileinfo": "*",
+ "ext-gd": "*",
+ "ext-iconv": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "ext-simplexml": "*",
+ "ext-xml": "*",
+ "ext-xmlreader": "*",
+ "ext-xmlwriter": "*",
+ "ext-zip": "*",
+ "ext-zlib": "*",
+ "markbaker/complex": "^1.4",
+ "markbaker/matrix": "^1.1",
+ "php": "^5.6|^7.0",
+ "psr/simple-cache": "^1.0"
+ },
+ "require-dev": {
+ "doctrine/instantiator": "^1.0.0",
+ "dompdf/dompdf": "^0.8.0",
+ "friendsofphp/php-cs-fixer": "@stable",
+ "jpgraph/jpgraph": "^4.0",
+ "mpdf/mpdf": "^7.0.0",
+ "phpcompatibility/php-compatibility": "^8.0",
+ "phpunit/phpunit": "^5.7",
+ "squizlabs/php_codesniffer": "^3.3",
+ "tecnickcom/tcpdf": "^6.2"
+ },
+ "suggest": {
+ "dompdf/dompdf": "Option for rendering PDF with PDF Writer",
+ "jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers",
+ "mpdf/mpdf": "Option for rendering PDF with PDF Writer",
+ "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer"
+ },
+ "time": "2019-05-26T02:50:36+00:00",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-2.1-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Erik Tilt"
+ },
+ {
+ "name": "Adrien Crivelli"
+ },
+ {
+ "name": "Maarten Balliauw",
+ "homepage": "https://blog.maartenballiauw.be"
+ },
+ {
+ "name": "Mark Baker",
+ "homepage": "https://markbakeruk.net"
+ },
+ {
+ "name": "Franck Lefevre",
+ "homepage": "https://rootslabs.net"
+ }
+ ],
+ "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
+ "homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
+ "keywords": [
+ "OpenXML",
+ "excel",
+ "gnumeric",
+ "ods",
+ "php",
+ "spreadsheet",
+ "xls",
+ "xlsx"
+ ]
+ },
+ {
+ "name": "psr/simple-cache",
+ "version": "1.0.1",
+ "version_normalized": "1.0.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/simple-cache.git",
+ "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
+ "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "time": "2017-10-23T01:57:42+00:00",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "dist",
+ "autoload": {
+ "psr-4": {
+ "Psr\\SimpleCache\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interfaces for simple caching",
+ "keywords": [
+ "cache",
+ "caching",
+ "psr",
+ "psr-16",
+ "simple-cache"
+ ]
+ }
+]
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/README.md b/lib/phpspreadsheet/vendor/markbaker/complex/README.md
new file mode 100644
index 00000000000..c306394eeb6
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/README.md
@@ -0,0 +1,156 @@
+PHPComplex
+==========
+
+---
+
+PHP Class for handling Complex numbers
+
+Master: [](http://travis-ci.org/MarkBaker/PHPComplex)
+
+Develop: [](http://travis-ci.org/MarkBaker/PHPComplex)
+
+[](https://xkcd.com/2028/)
+
+---
+
+The library currently provides the following operations:
+
+ - addition
+ - subtraction
+ - multiplication
+ - division
+ - division by
+ - division into
+
+together with functions for
+
+ - theta (polar theta angle)
+ - rho (polar distance/radius)
+ - conjugate
+ * negative
+ - inverse (1 / complex)
+ - cos (cosine)
+ - acos (inverse cosine)
+ - cosh (hyperbolic cosine)
+ - acosh (inverse hyperbolic cosine)
+ - sin (sine)
+ - asin (inverse sine)
+ - sinh (hyperbolic sine)
+ - asinh (inverse hyperbolic sine)
+ - sec (secant)
+ - asec (inverse secant)
+ - sech (hyperbolic secant)
+ - asech (inverse hyperbolic secant)
+ - csc (cosecant)
+ - acsc (inverse cosecant)
+ - csch (hyperbolic secant)
+ - acsch (inverse hyperbolic secant)
+ - tan (tangent)
+ - atan (inverse tangent)
+ - tanh (hyperbolic tangent)
+ - atanh (inverse hyperbolic tangent)
+ - cot (cotangent)
+ - acot (inverse cotangent)
+ - coth (hyperbolic cotangent)
+ - acoth (inverse hyperbolic cotangent)
+ - sqrt (square root)
+ - exp (exponential)
+ - ln (natural log)
+ - log10 (base-10 log)
+ - log2 (base-2 log)
+ - pow (raised to the power of a real number)
+
+
+---
+
+# Usage
+
+To create a new complex object, you can provide either the real, imaginary and suffix parts as individual values, or as an array of values passed passed to the constructor; or a string representing the value. e.g
+
+```
+$real = 1.23;
+$imaginary = -4.56;
+$suffix = 'i';
+
+$complexObject = new Complex\Complex($real, $imaginary, $suffix);
+```
+or
+```
+$real = 1.23;
+$imaginary = -4.56;
+$suffix = 'i';
+
+$arguments = [$real, $imaginary, $suffix];
+
+$complexObject = new Complex\Complex($arguments);
+```
+or
+```
+$complexString = '1.23-4.56i';
+
+$complexObject = new Complex\Complex($complexString);
+```
+
+Complex objects are immutable: whenever you call a method or pass a complex value to a function that returns a complex value, a new Complex object will be returned, and the original will remain unchanged.
+This also allows you to chain multiple methods as you would for a fluent interface (as long as they are methods that will return a Complex result).
+
+## Performing Mathematical Operations
+
+To perform mathematical operations with Complex values, you can call the appropriate method against a complex value, passing other values as arguments
+
+```
+$complexString1 = '1.23-4.56i';
+$complexString2 = '2.34+5.67i';
+
+$complexObject = new Complex\Complex($complexString1);
+echo $complexObject->add($complexString2);
+```
+or pass all values to the appropriate function
+```
+$complexString1 = '1.23-4.56i';
+$complexString2 = '2.34+5.67i';
+
+echo Complex\add($complexString1, $complexString2);
+```
+If you want to perform the same operation against multiple values (e.g. to add three or more complex numbers), then you can pass multiple arguments to any of the operations.
+
+You can pass these arguments as Complex objects, or as an array or string that will parse to a complex object.
+
+## Using functions
+
+When calling any of the available functions for a complex value, you can either call the relevant method for the Complex object
+```
+$complexString = '1.23-4.56i';
+
+$complexObject = new Complex\Complex($complexString);
+echo $complexObject->sinh();
+```
+or you can call the function as you would in procedural code, passing the Complex object as an argument
+```
+$complexString = '1.23-4.56i';
+
+$complexObject = new Complex\Complex($complexString);
+echo Complex\sinh($complexObject);
+```
+When called procedurally using the function, you can pass in the argument as a Complex object, or as an array or string that will parse to a complex object.
+```
+$complexString = '1.23-4.56i';
+
+echo Complex\sinh($complexString);
+```
+
+In the case of the `pow()` function (the only implemented function that requires an additional argument) you need to pass both arguments when calling the function procedurally
+
+```
+$complexString = '1.23-4.56i';
+
+$complexObject = new Complex\Complex($complexString);
+echo Complex\pow($complexObject, 2);
+```
+or pass the additional argument when calling the method
+```
+$complexString = '1.23-4.56i';
+
+$complexObject = new Complex\Complex($complexString);
+echo $complexObject->pow(2);
+```
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/Autoloader.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/Autoloader.php
new file mode 100644
index 00000000000..e6e03ac0e9b
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/Autoloader.php
@@ -0,0 +1,53 @@
+regex = $regex;
+ parent::__construct($it, $regex);
+ }
+}
+
+class FilenameFilter extends FilesystemRegexFilter
+{
+ // Filter files against the regex
+ public function accept()
+ {
+ return (!$this->isFile() || preg_match($this->regex, $this->getFilename()));
+ }
+}
+
+
+$srcFolder = __DIR__ . DIRECTORY_SEPARATOR . 'src';
+$srcDirectory = new RecursiveDirectoryIterator($srcFolder);
+
+$filteredFileList = new FilenameFilter($srcDirectory, '/(?:php)$/i');
+$filteredFileList = new FilenameFilter($filteredFileList, '/^(?!.*(Complex|Exception)\.php).*$/i');
+
+foreach (new RecursiveIteratorIterator($filteredFileList) as $file) {
+ if ($file->isFile()) {
+ include_once $file;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/Complex.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/Complex.php
new file mode 100644
index 00000000000..5671eb28e2b
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/Complex.php
@@ -0,0 +1,387 @@
+ 0.0 && empty($suffix)) {
+ $suffix = 'i';
+ }
+
+ // Set parsed values in our properties
+ $this->realPart = (float) $realPart;
+ $this->imaginaryPart = (float) $imaginaryPart;
+ $this->suffix = strtolower($suffix);
+ }
+
+ /**
+ * Gets the real part of this complex number
+ *
+ * @return Float
+ */
+ public function getReal()
+ {
+ return $this->realPart;
+ }
+
+ /**
+ * Gets the imaginary part of this complex number
+ *
+ * @return Float
+ */
+ public function getImaginary()
+ {
+ return $this->imaginaryPart;
+ }
+
+ /**
+ * Gets the suffix of this complex number
+ *
+ * @return String
+ */
+ public function getSuffix()
+ {
+ return $this->suffix;
+ }
+
+ /**
+ * Returns true if this is a real value, false if a complex value
+ *
+ * @return Bool
+ */
+ public function isReal()
+ {
+ return $this->imaginaryPart == 0.0;
+ }
+
+ /**
+ * Returns true if this is a complex value, false if a real value
+ *
+ * @return Bool
+ */
+ public function isComplex()
+ {
+ return !$this->isReal();
+ }
+
+ public function format()
+ {
+ $str = "";
+ if ($this->imaginaryPart != 0.0) {
+ if (\abs($this->imaginaryPart) != 1.0) {
+ $str .= $this->imaginaryPart . $this->suffix;
+ } else {
+ $str .= (($this->imaginaryPart < 0.0) ? '-' : '') . $this->suffix;
+ }
+ }
+ if ($this->realPart != 0.0) {
+ if (($str) && ($this->imaginaryPart > 0.0)) {
+ $str = "+" . $str;
+ }
+ $str = $this->realPart . $str;
+ }
+ if (!$str) {
+ $str = "0.0";
+ }
+
+ return $str;
+ }
+
+ public function __toString()
+ {
+ return $this->format();
+ }
+
+ /**
+ * Validates whether the argument is a valid complex number, converting scalar or array values if possible
+ *
+ * @param mixed $complex The value to validate
+ * @return Complex
+ * @throws Exception If the argument isn't a Complex number or cannot be converted to one
+ */
+ public static function validateComplexArgument($complex)
+ {
+ if (is_scalar($complex) || is_array($complex)) {
+ $complex = new Complex($complex);
+ } elseif (!is_object($complex) || !($complex instanceof Complex)) {
+ throw new Exception('Value is not a valid complex number');
+ }
+
+ return $complex;
+ }
+
+ /**
+ * Returns the reverse of this complex number
+ *
+ * @return Complex
+ */
+ public function reverse()
+ {
+ return new Complex(
+ $this->imaginaryPart,
+ $this->realPart,
+ ($this->realPart == 0.0) ? null : $this->suffix
+ );
+ }
+
+ public function invertImaginary()
+ {
+ return new Complex(
+ $this->realPart,
+ $this->imaginaryPart * -1,
+ ($this->imaginaryPart == 0.0) ? null : $this->suffix
+ );
+ }
+
+ public function invertReal()
+ {
+ return new Complex(
+ $this->realPart * -1,
+ $this->imaginaryPart,
+ ($this->imaginaryPart == 0.0) ? null : $this->suffix
+ );
+ }
+
+ protected static $functions = [
+ 'abs',
+ 'acos',
+ 'acosh',
+ 'acot',
+ 'acoth',
+ 'acsc',
+ 'acsch',
+ 'argument',
+ 'asec',
+ 'asech',
+ 'asin',
+ 'asinh',
+ 'atan',
+ 'atanh',
+ 'conjugate',
+ 'cos',
+ 'cosh',
+ 'cot',
+ 'coth',
+ 'csc',
+ 'csch',
+ 'exp',
+ 'inverse',
+ 'ln',
+ 'log2',
+ 'log10',
+ 'negative',
+ 'pow',
+ 'rho',
+ 'sec',
+ 'sech',
+ 'sin',
+ 'sinh',
+ 'sqrt',
+ 'tan',
+ 'tanh',
+ 'theta',
+ ];
+
+ protected static $operations = [
+ 'add',
+ 'subtract',
+ 'multiply',
+ 'divideby',
+ 'divideinto',
+ ];
+
+ /**
+ * Returns the result of the function call or operation
+ *
+ * @return Complex|float
+ * @throws Exception|\InvalidArgumentException
+ */
+ public function __call($functionName, $arguments)
+ {
+ $functionName = strtolower(str_replace('_', '', $functionName));
+
+ // Test for function calls
+ if (in_array($functionName, self::$functions)) {
+ $functionName = "\\" . __NAMESPACE__ . "\\{$functionName}";
+ return $functionName($this, ...$arguments);
+ }
+ // Test for operation calls
+ if (in_array($functionName, self::$operations)) {
+ $functionName = "\\" . __NAMESPACE__ . "\\{$functionName}";
+ return $functionName($this, ...$arguments);
+ }
+ throw new Exception('Function or Operation does not exist');
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/Exception.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/Exception.php
new file mode 100644
index 00000000000..a2beb732ca8
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/Exception.php
@@ -0,0 +1,13 @@
+getReal() - $invsqrt->getImaginary(),
+ $complex->getImaginary() + $invsqrt->getReal()
+ );
+ $log = ln($adjust);
+
+ return new Complex(
+ $log->getImaginary(),
+ -1 * $log->getReal()
+ );
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/acosh.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/acosh.php
new file mode 100644
index 00000000000..18a992e4308
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/acosh.php
@@ -0,0 +1,34 @@
+isReal() && ($complex->getReal() > 1)) {
+ return new Complex(\acosh($complex->getReal()));
+ }
+
+ $acosh = acos($complex)
+ ->reverse();
+ if ($acosh->getReal() < 0.0) {
+ $acosh = $acosh->invertReal();
+ }
+
+ return $acosh;
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/acot.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/acot.php
new file mode 100644
index 00000000000..11bee4666bd
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/acot.php
@@ -0,0 +1,25 @@
+getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return INF;
+ }
+
+ return asin(inverse($complex));
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/acsch.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/acsch.php
new file mode 100644
index 00000000000..bb45d34775d
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/acsch.php
@@ -0,0 +1,29 @@
+getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return INF;
+ }
+
+ return asinh(inverse($complex));
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/argument.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/argument.php
new file mode 100644
index 00000000000..d7209cc4849
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/argument.php
@@ -0,0 +1,28 @@
+getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return INF;
+ }
+
+ return acos(inverse($complex));
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/asech.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/asech.php
new file mode 100644
index 00000000000..b36c40e2ca7
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/asech.php
@@ -0,0 +1,29 @@
+getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return INF;
+ }
+
+ return acosh(inverse($complex));
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/asin.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/asin.php
new file mode 100644
index 00000000000..9c982aca8ea
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/asin.php
@@ -0,0 +1,37 @@
+getReal() - $complex->getImaginary(),
+ $invsqrt->getImaginary() + $complex->getReal()
+ );
+ $log = ln($adjust);
+
+ return new Complex(
+ $log->getImaginary(),
+ -1 * $log->getReal()
+ );
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/asinh.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/asinh.php
new file mode 100644
index 00000000000..c1243fd7f50
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/asinh.php
@@ -0,0 +1,33 @@
+isReal() && ($complex->getReal() > 1)) {
+ return new Complex(\asinh($complex->getReal()));
+ }
+
+ $asinh = clone $complex;
+ $asinh = $asinh->reverse()
+ ->invertReal();
+ $asinh = asin($asinh);
+ return $asinh->reverse()
+ ->invertImaginary();
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/atan.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/atan.php
new file mode 100644
index 00000000000..2c75dcf8e45
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/atan.php
@@ -0,0 +1,45 @@
+isReal()) {
+ return new Complex(\atan($complex->getReal()));
+ }
+
+ $t1Value = new Complex(-1 * $complex->getImaginary(), $complex->getReal());
+ $uValue = new Complex(1, 0);
+
+ $d1Value = clone $uValue;
+ $d1Value = subtract($d1Value, $t1Value);
+ $d2Value = add($t1Value, $uValue);
+ $uResult = $d1Value->divideBy($d2Value);
+ $uResult = ln($uResult);
+
+ return new Complex(
+ (($uResult->getImaginary() == M_PI) ? -M_PI : $uResult->getImaginary()) * -0.5,
+ $uResult->getReal() * 0.5,
+ $complex->getSuffix()
+ );
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/atanh.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/atanh.php
new file mode 100644
index 00000000000..c53f2a9a087
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/atanh.php
@@ -0,0 +1,38 @@
+isReal()) {
+ $real = $complex->getReal();
+ if ($real >= -1.0 && $real <= 1.0) {
+ return new Complex(\atanh($real));
+ } else {
+ return new Complex(\atanh(1 / $real), (($real < 0.0) ? M_PI_2 : -1 * M_PI_2));
+ }
+ }
+
+ $iComplex = clone $complex;
+ $iComplex = $iComplex->invertImaginary()
+ ->reverse();
+ return atan($iComplex)
+ ->invertReal()
+ ->reverse();
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/conjugate.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/conjugate.php
new file mode 100644
index 00000000000..bd1984b7840
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/conjugate.php
@@ -0,0 +1,28 @@
+getReal(),
+ -1 * $complex->getImaginary(),
+ $complex->getSuffix()
+ );
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/cos.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/cos.php
new file mode 100644
index 00000000000..80a4683d599
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/cos.php
@@ -0,0 +1,34 @@
+isReal()) {
+ return new Complex(\cos($complex->getReal()));
+ }
+
+ return conjugate(
+ new Complex(
+ \cos($complex->getReal()) * \cosh($complex->getImaginary()),
+ \sin($complex->getReal()) * \sinh($complex->getImaginary()),
+ $complex->getSuffix()
+ )
+ );
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/cosh.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/cosh.php
new file mode 100644
index 00000000000..a4bea65369d
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/cosh.php
@@ -0,0 +1,32 @@
+isReal()) {
+ return new Complex(\cosh($complex->getReal()));
+ }
+
+ return new Complex(
+ \cosh($complex->getReal()) * \cos($complex->getImaginary()),
+ \sinh($complex->getReal()) * \sin($complex->getImaginary()),
+ $complex->getSuffix()
+ );
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/cot.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/cot.php
new file mode 100644
index 00000000000..339101e1b12
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/cot.php
@@ -0,0 +1,29 @@
+getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return new Complex(INF);
+ }
+
+ return inverse(tan($complex));
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/coth.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/coth.php
new file mode 100644
index 00000000000..7fe705a4dbb
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/coth.php
@@ -0,0 +1,24 @@
+getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return INF;
+ }
+
+ return inverse(sin($complex));
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/csch.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/csch.php
new file mode 100644
index 00000000000..f4500981dbc
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/csch.php
@@ -0,0 +1,29 @@
+getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return INF;
+ }
+
+ return inverse(sinh($complex));
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/exp.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/exp.php
new file mode 100644
index 00000000000..4cac6967ec4
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/exp.php
@@ -0,0 +1,34 @@
+getReal() == 0.0) && (\abs($complex->getImaginary()) == M_PI)) {
+ return new Complex(-1.0, 0.0);
+ }
+
+ $rho = \exp($complex->getReal());
+
+ return new Complex(
+ $rho * \cos($complex->getImaginary()),
+ $rho * \sin($complex->getImaginary()),
+ $complex->getSuffix()
+ );
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/inverse.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/inverse.php
new file mode 100644
index 00000000000..7d3182adad4
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/inverse.php
@@ -0,0 +1,29 @@
+getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ throw new \InvalidArgumentException('Division by zero');
+ }
+
+ return $complex->divideInto(1.0);
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/ln.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/ln.php
new file mode 100644
index 00000000000..39071cf67e5
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/ln.php
@@ -0,0 +1,33 @@
+getReal() == 0.0) && ($complex->getImaginary() == 0.0)) {
+ throw new \InvalidArgumentException();
+ }
+
+ return new Complex(
+ \log(rho($complex)),
+ theta($complex),
+ $complex->getSuffix()
+ );
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/log10.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/log10.php
new file mode 100644
index 00000000000..694d3d08eaf
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/log10.php
@@ -0,0 +1,32 @@
+getReal() == 0.0) && ($complex->getImaginary() == 0.0)) {
+ throw new \InvalidArgumentException();
+ } elseif (($complex->getReal() > 0.0) && ($complex->getImaginary() == 0.0)) {
+ return new Complex(\log10($complex->getReal()), 0.0, $complex->getSuffix());
+ }
+
+ return ln($complex)
+ ->multiply(\log10(Complex::EULER));
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/log2.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/log2.php
new file mode 100644
index 00000000000..081f2c499f1
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/log2.php
@@ -0,0 +1,32 @@
+getReal() == 0.0) && ($complex->getImaginary() == 0.0)) {
+ throw new \InvalidArgumentException();
+ } elseif (($complex->getReal() > 0.0) && ($complex->getImaginary() == 0.0)) {
+ return new Complex(\log($complex->getReal(), 2), 0.0, $complex->getSuffix());
+ }
+
+ return ln($complex)
+ ->multiply(\log(Complex::EULER, 2));
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/negative.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/negative.php
new file mode 100644
index 00000000000..dbd11922cb2
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/negative.php
@@ -0,0 +1,31 @@
+getReal(),
+ -1 * $complex->getImaginary(),
+ $complex->getSuffix()
+ );
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/pow.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/pow.php
new file mode 100644
index 00000000000..18ee2690951
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/pow.php
@@ -0,0 +1,40 @@
+getImaginary() == 0.0 && $complex->getReal() >= 0.0) {
+ return new Complex(\pow($complex->getReal(), $power));
+ }
+
+ $rValue = \sqrt(($complex->getReal() * $complex->getReal()) + ($complex->getImaginary() * $complex->getImaginary()));
+ $rPower = \pow($rValue, $power);
+ $theta = $complex->argument() * $power;
+ if ($theta == 0) {
+ return new Complex(1);
+ }
+
+ return new Complex($rPower * \cos($theta), $rPower * \sin($theta), $complex->getSuffix());
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/rho.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/rho.php
new file mode 100644
index 00000000000..750f3f99e2a
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/rho.php
@@ -0,0 +1,28 @@
+getReal() * $complex->getReal()) +
+ ($complex->getImaginary() * $complex->getImaginary())
+ );
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/sec.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/sec.php
new file mode 100644
index 00000000000..7dd43eaf037
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/sec.php
@@ -0,0 +1,25 @@
+isReal()) {
+ return new Complex(\sin($complex->getReal()));
+ }
+
+ return new Complex(
+ \sin($complex->getReal()) * \cosh($complex->getImaginary()),
+ \cos($complex->getReal()) * \sinh($complex->getImaginary()),
+ $complex->getSuffix()
+ );
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/sinh.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/sinh.php
new file mode 100644
index 00000000000..4c0f6503e3e
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/sinh.php
@@ -0,0 +1,32 @@
+isReal()) {
+ return new Complex(\sinh($complex->getReal()));
+ }
+
+ return new Complex(
+ \sinh($complex->getReal()) * \cos($complex->getImaginary()),
+ \cosh($complex->getReal()) * \sin($complex->getImaginary()),
+ $complex->getSuffix()
+ );
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/sqrt.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/sqrt.php
new file mode 100644
index 00000000000..9c171b880b1
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/sqrt.php
@@ -0,0 +1,29 @@
+getSuffix());
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/tan.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/tan.php
new file mode 100644
index 00000000000..014d7981b47
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/tan.php
@@ -0,0 +1,40 @@
+isReal()) {
+ return new Complex(\tan($complex->getReal()));
+ }
+
+ $real = $complex->getReal();
+ $imaginary = $complex->getImaginary();
+ $divisor = 1 + \pow(\tan($real), 2) * \pow(\tanh($imaginary), 2);
+ if ($divisor == 0.0) {
+ throw new \InvalidArgumentException('Division by zero');
+ }
+
+ return new Complex(
+ \pow(sech($imaginary)->getReal(), 2) * \tan($real) / $divisor,
+ \pow(sec($real)->getReal(), 2) * \tanh($imaginary) / $divisor,
+ $complex->getSuffix()
+ );
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/tanh.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/tanh.php
new file mode 100644
index 00000000000..028741d6be7
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/tanh.php
@@ -0,0 +1,35 @@
+getReal();
+ $imaginary = $complex->getImaginary();
+ $divisor = \cos($imaginary) * \cos($imaginary) + \sinh($real) * \sinh($real);
+ if ($divisor == 0.0) {
+ throw new \InvalidArgumentException('Division by zero');
+ }
+
+ return new Complex(
+ \sinh($real) * \cosh($real) / $divisor,
+ 0.5 * \sin(2 * $imaginary) / $divisor,
+ $complex->getSuffix()
+ );
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/theta.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/theta.php
new file mode 100644
index 00000000000..d12866cd83f
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/functions/theta.php
@@ -0,0 +1,38 @@
+getReal() == 0.0) {
+ if ($complex->isReal()) {
+ return 0.0;
+ } elseif ($complex->getImaginary() < 0.0) {
+ return M_PI / -2;
+ }
+ return M_PI / 2;
+ } elseif ($complex->getReal() > 0.0) {
+ return \atan($complex->getImaginary() / $complex->getReal());
+ } elseif ($complex->getImaginary() < 0.0) {
+ return -(M_PI - \atan(\abs($complex->getImaginary()) / \abs($complex->getReal())));
+ }
+
+ return M_PI - \atan($complex->getImaginary() / \abs($complex->getReal()));
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/add.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/add.php
new file mode 100644
index 00000000000..10bd42f4f60
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/add.php
@@ -0,0 +1,46 @@
+isComplex() && $complex->isComplex() &&
+ $result->getSuffix() !== $complex->getSuffix()) {
+ throw new Exception('Suffix Mismatch');
+ }
+
+ $real = $result->getReal() + $complex->getReal();
+ $imaginary = $result->getImaginary() + $complex->getImaginary();
+
+ $result = new Complex(
+ $real,
+ $imaginary,
+ ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix())
+ );
+ }
+
+ return $result;
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/divideby.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/divideby.php
new file mode 100644
index 00000000000..089e0ef99e4
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/divideby.php
@@ -0,0 +1,56 @@
+isComplex() && $complex->isComplex() &&
+ $result->getSuffix() !== $complex->getSuffix()) {
+ throw new Exception('Suffix Mismatch');
+ }
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ throw new \InvalidArgumentException('Division by zero');
+ }
+
+ $delta1 = ($result->getReal() * $complex->getReal()) +
+ ($result->getImaginary() * $complex->getImaginary());
+ $delta2 = ($result->getImaginary() * $complex->getReal()) -
+ ($result->getReal() * $complex->getImaginary());
+ $delta3 = ($complex->getReal() * $complex->getReal()) +
+ ($complex->getImaginary() * $complex->getImaginary());
+
+ $real = $delta1 / $delta3;
+ $imaginary = $delta2 / $delta3;
+
+ $result = new Complex(
+ $real,
+ $imaginary,
+ ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix())
+ );
+ }
+
+ return $result;
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/divideinto.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/divideinto.php
new file mode 100644
index 00000000000..3dfe085e20c
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/divideinto.php
@@ -0,0 +1,56 @@
+isComplex() && $complex->isComplex() &&
+ $result->getSuffix() !== $complex->getSuffix()) {
+ throw new Exception('Suffix Mismatch');
+ }
+ if ($result->getReal() == 0.0 && $result->getImaginary() == 0.0) {
+ throw new \InvalidArgumentException('Division by zero');
+ }
+
+ $delta1 = ($complex->getReal() * $result->getReal()) +
+ ($complex->getImaginary() * $result->getImaginary());
+ $delta2 = ($complex->getImaginary() * $result->getReal()) -
+ ($complex->getReal() * $result->getImaginary());
+ $delta3 = ($result->getReal() * $result->getReal()) +
+ ($result->getImaginary() * $result->getImaginary());
+
+ $real = $delta1 / $delta3;
+ $imaginary = $delta2 / $delta3;
+
+ $result = new Complex(
+ $real,
+ $imaginary,
+ ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix())
+ );
+ }
+
+ return $result;
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/multiply.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/multiply.php
new file mode 100644
index 00000000000..bf2473ea78e
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/multiply.php
@@ -0,0 +1,48 @@
+isComplex() && $complex->isComplex() &&
+ $result->getSuffix() !== $complex->getSuffix()) {
+ throw new Exception('Suffix Mismatch');
+ }
+
+ $real = ($result->getReal() * $complex->getReal()) -
+ ($result->getImaginary() * $complex->getImaginary());
+ $imaginary = ($result->getReal() * $complex->getImaginary()) +
+ ($result->getImaginary() * $complex->getReal());
+
+ $result = new Complex(
+ $real,
+ $imaginary,
+ ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix())
+ );
+ }
+
+ return $result;
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/subtract.php b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/subtract.php
new file mode 100644
index 00000000000..075ef443698
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/classes/src/operations/subtract.php
@@ -0,0 +1,46 @@
+isComplex() && $complex->isComplex() &&
+ $result->getSuffix() !== $complex->getSuffix()) {
+ throw new Exception('Suffix Mismatch');
+ }
+
+ $real = $result->getReal() - $complex->getReal();
+ $imaginary = $result->getImaginary() - $complex->getImaginary();
+
+ $result = new Complex(
+ $real,
+ $imaginary,
+ ($imaginary == 0.0) ? null : max($result->getSuffix(), $complex->getSuffix())
+ );
+ }
+
+ return $result;
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/composer.json b/lib/phpspreadsheet/vendor/markbaker/complex/composer.json
new file mode 100644
index 00000000000..91e9e231885
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/composer.json
@@ -0,0 +1,91 @@
+{
+ "name": "markbaker/complex",
+ "type": "library",
+ "description": "PHP Class for working with complex numbers",
+ "keywords": ["complex", "mathematics"],
+ "homepage": "https://github.com/MarkBaker/PHPComplex",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Mark Baker",
+ "email": "mark@lange.demon.co.uk"
+ }
+ ],
+ "require": {
+ "php": "^5.6.0|^7.0.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35|^5.4.0",
+ "phpdocumentor/phpdocumentor":"2.*",
+ "phpmd/phpmd": "2.*",
+ "sebastian/phpcpd": "2.*",
+ "phploc/phploc": "2.*",
+ "squizlabs/php_codesniffer": "^3.3.0",
+ "phpcompatibility/php-compatibility": "^8.0",
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3"
+ },
+ "autoload": {
+ "psr-4": {
+ "Complex\\": "classes/src/"
+ },
+ "files": [
+ "classes/src/functions/abs.php",
+ "classes/src/functions/acos.php",
+ "classes/src/functions/acosh.php",
+ "classes/src/functions/acot.php",
+ "classes/src/functions/acoth.php",
+ "classes/src/functions/acsc.php",
+ "classes/src/functions/acsch.php",
+ "classes/src/functions/argument.php",
+ "classes/src/functions/asec.php",
+ "classes/src/functions/asech.php",
+ "classes/src/functions/asin.php",
+ "classes/src/functions/asinh.php",
+ "classes/src/functions/atan.php",
+ "classes/src/functions/atanh.php",
+ "classes/src/functions/conjugate.php",
+ "classes/src/functions/cos.php",
+ "classes/src/functions/cosh.php",
+ "classes/src/functions/cot.php",
+ "classes/src/functions/coth.php",
+ "classes/src/functions/csc.php",
+ "classes/src/functions/csch.php",
+ "classes/src/functions/exp.php",
+ "classes/src/functions/inverse.php",
+ "classes/src/functions/ln.php",
+ "classes/src/functions/log2.php",
+ "classes/src/functions/log10.php",
+ "classes/src/functions/negative.php",
+ "classes/src/functions/pow.php",
+ "classes/src/functions/rho.php",
+ "classes/src/functions/sec.php",
+ "classes/src/functions/sech.php",
+ "classes/src/functions/sin.php",
+ "classes/src/functions/sinh.php",
+ "classes/src/functions/sqrt.php",
+ "classes/src/functions/tan.php",
+ "classes/src/functions/tanh.php",
+ "classes/src/functions/theta.php",
+ "classes/src/operations/add.php",
+ "classes/src/operations/subtract.php",
+ "classes/src/operations/multiply.php",
+ "classes/src/operations/divideby.php",
+ "classes/src/operations/divideinto.php"
+ ]
+ },
+ "scripts": {
+ "style": [
+ "phpcs --report-width=200 --report-summary --report-full classes/src/ --standard=PSR2 -n"
+ ],
+ "mess": [
+ "phpmd classes/src/ xml codesize,unusedcode,design,naming -n"
+ ],
+ "lines": [
+ "phploc classes/src/ -n"
+ ],
+ "cpd": [
+ "phpcpd classes/src/ -n"
+ ]
+ },
+ "minimum-stability": "dev"
+}
\ No newline at end of file
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/examples/complexTest.php b/lib/phpspreadsheet/vendor/markbaker/complex/examples/complexTest.php
new file mode 100644
index 00000000000..7dafd8a6392
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/examples/complexTest.php
@@ -0,0 +1,154 @@
+add(456);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456);
+$x->add(789.012);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->add(new Complex(-987.654, -32.1));
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->add(-987.654);
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->add(new Complex(0, 1));
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->add(new Complex(0, -1));
+echo $x, PHP_EOL;
+
+
+echo PHP_EOL, 'Subtract', PHP_EOL;
+
+$x = new Complex(123);
+$x->subtract(456);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456);
+$x->subtract(789.012);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->subtract(new Complex(-987.654, -32.1));
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->subtract(-987.654);
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->subtract(new Complex(0, 1));
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->subtract(new Complex(0, -1));
+echo $x, PHP_EOL;
+
+
+echo PHP_EOL, 'Multiply', PHP_EOL;
+
+$x = new Complex(123);
+$x->multiply(456);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456);
+$x->multiply(789.012);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->multiply(new Complex(-987.654, -32.1));
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->multiply(-987.654);
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->multiply(new Complex(0, 1));
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->multiply(new Complex(0, -1));
+echo $x, PHP_EOL;
+
+
+echo PHP_EOL, 'Divide By', PHP_EOL;
+
+$x = new Complex(123);
+$x->divideBy(456);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456);
+$x->divideBy(789.012);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->divideBy(new Complex(-987.654, -32.1));
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->divideBy(-987.654);
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->divideBy(new Complex(0, 1));
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->divideBy(new Complex(0, -1));
+echo $x, PHP_EOL;
+
+
+echo PHP_EOL, 'Divide Into', PHP_EOL;
+
+$x = new Complex(123);
+$x->divideInto(456);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456);
+$x->divideInto(789.012);
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->divideInto(new Complex(-987.654, -32.1));
+echo $x, PHP_EOL;
+
+$x = new Complex(123.456, 78.90);
+$x->divideInto(-987.654);
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->divideInto(new Complex(0, 1));
+echo $x, PHP_EOL;
+
+$x = new Complex(-987.654, -32.1);
+$x->divideInto(new Complex(0, -1));
+echo $x, PHP_EOL;
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/examples/testFunctions.php b/lib/phpspreadsheet/vendor/markbaker/complex/examples/testFunctions.php
new file mode 100644
index 00000000000..4d5ed7358b4
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/examples/testFunctions.php
@@ -0,0 +1,52 @@
+getMessage(), PHP_EOL;
+ }
+ }
+ echo PHP_EOL;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/examples/testOperations.php b/lib/phpspreadsheet/vendor/markbaker/complex/examples/testOperations.php
new file mode 100644
index 00000000000..f791263efd3
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/examples/testOperations.php
@@ -0,0 +1,34 @@
+ ', $result, PHP_EOL;
+
+echo PHP_EOL;
+
+echo 'Subtraction', PHP_EOL;
+
+$result = \Complex\subtract(...$values);
+echo '=> ', $result, PHP_EOL;
+
+echo PHP_EOL;
+
+echo 'Multiplication', PHP_EOL;
+
+$result = \Complex\multiply(...$values);
+echo '=> ', $result, PHP_EOL;
diff --git a/lib/phpspreadsheet/vendor/markbaker/complex/license.md b/lib/phpspreadsheet/vendor/markbaker/complex/license.md
new file mode 100644
index 00000000000..5b4b156196a
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/complex/license.md
@@ -0,0 +1,25 @@
+The MIT License (MIT)
+=====================
+
+Copyright © `2017` `Mark Baker`
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the “Software”), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/README.md b/lib/phpspreadsheet/vendor/markbaker/matrix/README.md
new file mode 100644
index 00000000000..66a1de4d387
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/README.md
@@ -0,0 +1,165 @@
+PHPMatrix
+==========
+
+---
+
+PHP Class for handling Matrices
+
+Master: [](http://travis-ci.org/MarkBaker/PHPMatrix)
+
+Develop: [](http://travis-ci.org/MarkBaker/PHPMatrix)
+
+[](https://xkcd.com/184/)
+
+Matrix Transform
+
+---
+
+This library currently provides the following operations:
+
+ - addition
+ - direct sum
+ - subtraction
+ - multiplication
+ - division (using [A].[B]-1)
+ - division by
+ - division into
+
+together with functions for
+
+ - adjoint
+ - antidiagonal
+ - cofactors
+ - determinant
+ - diagonal
+ - identity
+ - inverse
+ - minors
+ - trace
+ - transpose
+
+
+## TO DO
+
+ - power()
+ - EigenValues
+ - EigenVectors
+ - Decomposition
+
+---
+
+# Usage
+
+To create a new Matrix object, provide an array as the constructor argument
+
+```
+$grid = [
+ [16, 3, 2, 13],
+ [ 5, 10, 11, 8],
+ [ 9, 6, 7, 12],
+ [ 4, 15, 14, 1],
+];
+
+$matrix = new Matrix\Matrix($grid);
+```
+The `Builder` class provides helper methods for creating specific matrices, specifically an identity matrix of a specified size; or a matrix of a specified dimensions, with every cell containing a set value.
+```
+$matrix = new Matrix\Builder::createFilledMatrix(1, 5, 3);
+```
+Will create a matrix of 5 rows and 3 columns, filled with a `1` in every cell; while
+```
+$matrix = new Matrix\Builder::createIdentityMatrix(3);
+```
+will create a 3x3 identity matrix.
+
+
+Matrix objects are immutable: whenever you call a method or pass a grid to a function that returns a matrix value, a new Matrix object will be returned, and the original will remain unchanged. This also allows you to chain multiple methods as you would for a fluent interface (as long as they are methods that will return a Matrix result).
+
+## Performing Mathematical Operations
+
+To perform mathematical operations with Matrices, you can call the appropriate method against a matrix value, passing other values as arguments
+
+```
+$matrix1 = new Matrix([
+ [2, 7, 6],
+ [9, 5, 1],
+ [4, 3, 8],
+]);
+$matrix2 = new Matrix([
+ [1, 2, 3],
+ [4, 5, 6],
+ [7, 8, 9],
+]);
+
+echo $matrix1->multiply($matrix2);
+```
+or pass all values to the appropriate function
+```
+$matrix1 = new Matrix([
+ [2, 7, 6],
+ [9, 5, 1],
+ [4, 3, 8],
+]);
+$matrix2 = new Matrix([
+ [1, 2, 3],
+ [4, 5, 6],
+ [7, 8, 9],
+]);
+
+echo Matrix\multiply($matrix1, $matrix2);
+```
+You can pass in the arguments as Matrix objects, or as arrays.
+
+If you want to perform the same operation against multiple values (e.g. to add three or more matrices), then you can pass multiple arguments to any of the operations.
+
+## Using functions
+
+When calling any of the available functions for a matrix value, you can either call the relevant method for the Matrix object
+```
+$grid = [
+ [16, 3, 2, 13],
+ [ 5, 10, 11, 8],
+ [ 9, 6, 7, 12],
+ [ 4, 15, 14, 1],
+];
+
+$matrix = new Matrix\Matrix($grid);
+
+echo $matrix->trace();
+```
+or you can call the function as you would in procedural code, passing the Matrix object as an argument
+```
+$grid = [
+ [16, 3, 2, 13],
+ [ 5, 10, 11, 8],
+ [ 9, 6, 7, 12],
+ [ 4, 15, 14, 1],
+];
+
+$matrix = new Matrix\Matrix($grid);
+echo Matrix\trace($matrix);
+```
+When called procedurally using the function, you can pass in the argument as a Matrix object, or as an array.
+```
+$grid = [
+ [16, 3, 2, 13],
+ [ 5, 10, 11, 8],
+ [ 9, 6, 7, 12],
+ [ 4, 15, 14, 1],
+];
+
+echo Matrix\trace($grid);
+```
+As an alternative, it is also possible to call the method directly from the `Functions` class.
+```
+$grid = [
+ [16, 3, 2, 13],
+ [ 5, 10, 11, 8],
+ [ 9, 6, 7, 12],
+ [ 4, 15, 14, 1],
+];
+
+$matrix = new Matrix\Matrix($grid);
+echo Matrix\Functions::trace($matrix);
+```
+Used this way, methods must be called statically, and the argument must be the Matrix object, and cannot be an array.
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/buildPhar.php b/lib/phpspreadsheet/vendor/markbaker/matrix/buildPhar.php
new file mode 100644
index 00000000000..e1b8f96fbe1
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/buildPhar.php
@@ -0,0 +1,62 @@
+ 'Mark Baker ',
+ 'Description' => 'PHP Class for working with Matrix numbers',
+ 'Copyright' => 'Mark Baker (c) 2013-' . date('Y'),
+ 'Timestamp' => time(),
+ 'Version' => '0.1.0',
+ 'Date' => date('Y-m-d')
+);
+
+// cleanup
+if (file_exists($pharName)) {
+ echo "Removed: {$pharName}\n";
+ unlink($pharName);
+}
+
+echo "Building phar file...\n";
+
+// the phar object
+$phar = new Phar($pharName, null, 'Matrix');
+$phar->buildFromDirectory($sourceDir);
+$phar->setStub(
+<<<'EOT'
+getMessage());
+ exit(1);
+ }
+
+ include 'phar://functions/sqrt.php';
+
+ __HALT_COMPILER();
+EOT
+);
+$phar->setMetadata($metaData);
+$phar->compressFiles(Phar::GZ);
+
+echo "Complete.\n";
+
+exit();
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/classes/Autoloader.php b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/Autoloader.php
new file mode 100644
index 00000000000..279d176eff7
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/Autoloader.php
@@ -0,0 +1,53 @@
+regex = $regex;
+ parent::__construct($it, $regex);
+ }
+}
+
+class FilenameFilter extends FilesystemRegexFilter
+{
+ // Filter files against the regex
+ public function accept()
+ {
+ return (!$this->isFile() || preg_match($this->regex, $this->getFilename()));
+ }
+}
+
+
+$srcFolder = __DIR__ . DIRECTORY_SEPARATOR . 'src';
+$srcDirectory = new RecursiveDirectoryIterator($srcFolder);
+
+$filteredFileList = new FilenameFilter($srcDirectory, '/(?:php)$/i');
+$filteredFileList = new FilenameFilter($filteredFileList, '/^(?!.*(Matrix|Exception)\.php).*$/i');
+
+foreach (new RecursiveIteratorIterator($filteredFileList) as $file) {
+ if ($file->isFile()) {
+ include_once $file;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Builder.php b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Builder.php
new file mode 100644
index 00000000000..8d0116f60ae
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Builder.php
@@ -0,0 +1,69 @@
+toArray();
+
+ for ($x = 0; $x < $dimensions; ++$x) {
+ $grid[$x][$x] = 1;
+ }
+
+ return new Matrix($grid);
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Exception.php b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Exception.php
new file mode 100644
index 00000000000..55a428ca5a8
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Exception.php
@@ -0,0 +1,13 @@
+isSquare()) {
+ throw new Exception('Adjoint can only be calculated for a square matrix');
+ }
+
+ return self::getAdjoint($matrix);
+ }
+
+ /**
+ * Calculate the cofactors of the matrix
+ *
+ * @param Matrix $matrix The matrix whose cofactors we wish to calculate
+ * @return Matrix
+ **/
+ private static function getCofactors(Matrix $matrix)
+ {
+ $cofactors = self::getMinors($matrix);
+ $dimensions = $matrix->rows;
+
+ $cof = 1;
+ for ($i = 0; $i < $dimensions; ++$i) {
+ $cofs = $cof;
+ for ($j = 0; $j < $dimensions; ++$j) {
+ $cofactors[$i][$j] *= $cofs;
+ $cofs = -$cofs;
+ }
+ $cof = -$cof;
+ }
+
+ return new Matrix($cofactors);
+ }
+
+ /**
+ * Return the cofactors of this matrix
+ *
+ * @param Matrix $matrix The matrix whose cofactors we wish to calculate
+ * @return Matrix
+ * @throws Exception
+ **/
+ public static function cofactors(Matrix $matrix)
+ {
+ if (!$matrix->isSquare()) {
+ throw new Exception('Cofactors can only be calculated for a square matrix');
+ }
+
+ return self::getCofactors($matrix);
+ }
+
+ private static function getDeterminantSegment(Matrix $matrix, $row, $column)
+ {
+ $tmpMatrix = $matrix->toArray();
+ unset($tmpMatrix[$row]);
+ array_walk(
+ $tmpMatrix,
+ function (&$row) use ($column) {
+ unset($row[$column]);
+ }
+ );
+
+ return self::getDeterminant(new Matrix($tmpMatrix));
+ }
+
+ /**
+ * Calculate the determinant of the matrix
+ *
+ * @param Matrix $matrix The matrix whose determinant we wish to calculate
+ * @return float
+ **/
+ private static function getDeterminant(Matrix $matrix)
+ {
+ $dimensions = $matrix->rows;
+ if ($dimensions == 1) {
+ return $matrix->getValue(1, 1);
+ } elseif ($dimensions == 2) {
+ return $matrix->getValue(1, 1) * $matrix->getValue(2, 2) - $matrix->getValue(1, 2) * $matrix->getValue(2, 1);
+ }
+
+ $determinant = 0;
+ for ($i = 1; $i <= $dimensions; ++$i) {
+ $det = $matrix->getValue(1, $i) * self::getDeterminantSegment($matrix, 0, $i-1);
+ if (($i % 2) == 0) {
+ $determinant -= $det;
+ } else {
+ $determinant += $det;
+ }
+ }
+
+ return $determinant;
+ }
+
+ /**
+ * Return the determinant of this matrix
+ *
+ * @param Matrix $matrix The matrix whose determinant we wish to calculate
+ * @return float
+ * @throws Exception
+ **/
+ public static function determinant(Matrix $matrix)
+ {
+ if (!$matrix->isSquare()) {
+ throw new Exception('Determinant can only be calculated for a square matrix');
+ }
+
+ return self::getDeterminant($matrix);
+ }
+
+ /**
+ * Return the diagonal of this matrix
+ *
+ * @param Matrix $matrix The matrix whose diagonal we wish to calculate
+ * @return Matrix
+ * @throws Exception
+ **/
+ public static function diagonal(Matrix $matrix)
+ {
+ if (!$matrix->isSquare()) {
+ throw new Exception('Diagonal can only be extracted from a square matrix');
+ }
+
+ $dimensions = $matrix->rows;
+ $grid = Builder::createFilledMatrix(0, $dimensions, $dimensions)
+ ->toArray();
+
+ for ($i = 0; $i < $dimensions; ++$i) {
+ $grid[$i][$i] = $matrix->getValue($i + 1, $i + 1);
+ }
+
+ return new Matrix($grid);
+ }
+
+ /**
+ * Return the antidiagonal of this matrix
+ *
+ * @param Matrix $matrix The matrix whose antidiagonal we wish to calculate
+ * @return Matrix
+ * @throws Exception
+ **/
+ public static function antidiagonal(Matrix $matrix)
+ {
+ if (!$matrix->isSquare()) {
+ throw new Exception('Anti-Diagonal can only be extracted from a square matrix');
+ }
+
+ $dimensions = $matrix->rows;
+ $grid = Builder::createFilledMatrix(0, $dimensions, $dimensions)
+ ->toArray();
+
+ for ($i = 0; $i < $dimensions; ++$i) {
+ $grid[$i][$dimensions - $i - 1] = $matrix->getValue($i + 1, $dimensions - $i);
+ }
+
+ return new Matrix($grid);
+ }
+
+ /**
+ * Return the identity matrix
+ * The identity matrix, or sometimes ambiguously called a unit matrix, of size n is the n × n square matrix
+ * with ones on the main diagonal and zeros elsewhere
+ *
+ * @param Matrix $matrix The matrix whose identity we wish to calculate
+ * @return Matrix
+ * @throws Exception
+ **/
+ public static function identity(Matrix $matrix)
+ {
+ if (!$matrix->isSquare()) {
+ throw new Exception('Identity can only be created for a square matrix');
+ }
+
+ $dimensions = $matrix->rows;
+
+ return Builder::createIdentityMatrix($dimensions);
+ }
+
+ /**
+ * Return the inverse of this matrix
+ *
+ * @param Matrix $matrix The matrix whose inverse we wish to calculate
+ * @return Matrix
+ * @throws Exception
+ **/
+ public static function inverse(Matrix $matrix)
+ {
+ if (!$matrix->isSquare()) {
+ throw new Exception('Inverse can only be calculated for a square matrix');
+ }
+
+ $determinant = self::getDeterminant($matrix);
+ if ($determinant == 0.0) {
+ throw new Exception('Inverse can only be calculated for a matrix with a non-zero determinant');
+ }
+
+ if ($matrix->rows == 1) {
+ return new Matrix([[1 / $matrix->getValue(1, 1)]]);
+ }
+
+ return self::getAdjoint($matrix)
+ ->multiply(1 / $determinant);
+ }
+
+ /**
+ * Calculate the minors of the matrix
+ *
+ * @param Matrix $matrix The matrix whose minors we wish to calculate
+ * @return array[]
+ **/
+ protected static function getMinors(Matrix $matrix)
+ {
+ $minors = $matrix->toArray();
+ $dimensions = $matrix->rows;
+ if ($dimensions == 1) {
+ return $minors;
+ }
+
+ for ($i = 0; $i < $dimensions; ++$i) {
+ for ($j = 0; $j < $dimensions; ++$j) {
+ $minors[$i][$j] = self::getDeterminantSegment($matrix, $i, $j);
+ }
+ }
+
+ return $minors;
+ }
+
+ /**
+ * Return the minors of the matrix
+ * The minor of a matrix A is the determinant of some smaller square matrix, cut down from A by removing one or
+ * more of its rows or columns.
+ * Minors obtained by removing just one row and one column from square matrices (first minors) are required for
+ * calculating matrix cofactors, which in turn are useful for computing both the determinant and inverse of
+ * square matrices.
+ *
+ * @param Matrix $matrix The matrix whose minors we wish to calculate
+ * @return Matrix
+ * @throws Exception
+ **/
+ public static function minors(Matrix $matrix)
+ {
+ if (!$matrix->isSquare()) {
+ throw new Exception('Minors can only be calculated for a square matrix');
+ }
+
+ return new Matrix(self::getMinors($matrix));
+ }
+
+ /**
+ * Return the trace of this matrix
+ * The trace is defined as the sum of the elements on the main diagonal (the diagonal from the upper left to the lower right)
+ * of the matrix
+ *
+ * @param Matrix $matrix The matrix whose trace we wish to calculate
+ * @return float
+ * @throws Exception
+ **/
+ public static function trace(Matrix $matrix)
+ {
+ if (!$matrix->isSquare()) {
+ throw new Exception('Trace can only be extracted from a square matrix');
+ }
+
+ $dimensions = $matrix->rows;
+ $result = 0;
+ for ($i = 1; $i <= $dimensions; ++$i) {
+ $result += $matrix->getValue($i, $i);
+ }
+
+ return $result;
+ }
+
+ /**
+ * Return the transpose of this matrix
+ *
+ * @param Matrix $matrix The matrix whose transpose we wish to calculate
+ * @return Matrix
+ * @throws Exception
+ **/
+ public static function transpose(Matrix $matrix)
+ {
+ $grid = call_user_func_array(
+ 'array_map',
+ array_merge(
+ [null],
+ $matrix->toArray()
+ )
+ );
+
+ return new Matrix($grid);
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Matrix.php b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Matrix.php
new file mode 100644
index 00000000000..c2a4594f092
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Matrix.php
@@ -0,0 +1,403 @@
+buildFromArray(array_values($grid));
+ }
+
+ /*
+ * Create a new Matrix object from an array of values
+ *
+ * @param array $grid
+ */
+ protected function buildFromArray(array $grid)
+ {
+ $this->rows = count($grid);
+ $columns = array_reduce(
+ $grid,
+ function ($carry, $value) {
+ return max($carry, is_array($value) ? count($value) : 1);
+ },
+ 0
+ );
+ $this->columns = $columns;
+
+ array_walk(
+ $grid,
+ function (&$value) use ($columns) {
+ if (!is_array($value)) {
+ $value = [$value];
+ }
+ $value = array_pad(array_values($value), $columns, null);
+ }
+ );
+
+ $this->grid = $grid;
+ }
+
+ /**
+ * Validate that a row number is a positive integer
+ *
+ * @param $row
+ * @return int
+ * @throws Exception
+ */
+ public static function validateRow($row)
+ {
+ if ((!is_numeric($row)) || (intval($row) < 1)) {
+ throw new Exception('Invalid Row');
+ }
+
+ return (int) $row;
+ }
+
+ /**
+ * Validate that a column number is a positive integer
+ *
+ * @param $column
+ * @return int
+ * @throws Exception
+ */
+ public static function validateColumn($column)
+ {
+ if ((!is_numeric($column)) || (intval($column) < 1)) {
+ throw new Exception('Invalid Column');
+ }
+
+ return (int) $column;
+ }
+
+ /**
+ * Validate that a row number falls within the set of rows for this matrix
+ *
+ * @param $row
+ * @return int
+ * @throws Exception
+ */
+ protected function validateRowInRange($row)
+ {
+ $row = static::validateRow($row);
+ if ($row > $this->rows) {
+ throw new Exception('Requested Row exceeds matrix size');
+ }
+
+ return $row;
+ }
+
+ /**
+ * Validate that a column number falls within the set of columns for this matrix
+ *
+ * @param $column
+ * @return int
+ * @throws Exception
+ */
+ protected function validateColumnInRange($column)
+ {
+ $column = static::validateColumn($column);
+ if ($column > $this->columns) {
+ throw new Exception('Requested Column exceeds matrix size');
+ }
+
+ return $column;
+ }
+
+ /**
+ * Return a new matrix as a subset of rows from this matrix, starting at row number $row, and $rowCount rows
+ * A $rowCount value of 0 will return all rows of the matrix from $row
+ * A negative $rowCount value will return rows until that many rows from the end of the matrix
+ *
+ * Note that row numbers start from 1, not from 0
+ *
+ * @param $row
+ * @param int $rowCount
+ * @return static
+ * @throws Exception
+ */
+ public function getRows($row, $rowCount = 1)
+ {
+ $row = $this->validateRowInRange($row);
+ if ($rowCount == 0) {
+ $rowCount = $this->rows - $row + 1;
+ }
+
+ return new static(array_slice($this->grid, $row - 1, $rowCount));
+ }
+
+ /**
+ * Return a new matrix as a subset of columns from this matrix, starting at column number $column, and $columnCount columns
+ * A $columnCount value of 0 will return all columns of the matrix from $column
+ * A negative $columnCount value will return columns until that many columns from the end of the matrix
+ *
+ * Note that column numbers start from 1, not from 0
+ *
+ * @param $column
+ * @param int $columnCount
+ * @return static
+ * @throws Exception
+ */
+ public function getColumns($column, $columnCount = 1)
+ {
+ $column = $this->validateColumnInRange($column);
+ if ($columnCount < 1) {
+ $columnCount = $this->columns + $columnCount - $column + 1;
+ }
+
+ $grid = [];
+ for ($i = $column - 1; $i < $column + $columnCount - 1; ++$i) {
+ $grid[] = array_column($this->grid, $i);
+ }
+
+ return (new static($grid))->transpose();
+ }
+
+ /**
+ * Return a new matrix as a subset of rows from this matrix, dropping rows starting at row number $row,
+ * and $rowCount rows
+ * A negative $rowCount value will drop rows until that many rows from the end of the matrix
+ * A $rowCount value of 0 will remove all rows of the matrix from $row
+ *
+ * Note that row numbers start from 1, not from 0
+ *
+ * @param $row
+ * @param int $rowCount
+ * @return static
+ * @throws Exception
+ */
+ public function dropRows($row, $rowCount = 1)
+ {
+ $this->validateRowInRange($row);
+ if ($rowCount == 0) {
+ $rowCount = $this->rows - $row + 1;
+ }
+
+ $grid = $this->grid;
+ array_splice($grid, $row - 1, $rowCount);
+
+ return new static($grid);
+ }
+
+ /**
+ * Return a new matrix as a subset of columns from this matrix, dropping columns starting at column number $column,
+ * and $columnCount columns
+ * A negative $columnCount value will drop columns until that many columns from the end of the matrix
+ * A $columnCount value of 0 will remove all columns of the matrix from $column
+ *
+ * Note that column numbers start from 1, not from 0
+ *
+ * @param $column
+ * @param int $columnCount
+ * @return static
+ * @throws Exception
+ */
+ public function dropColumns($column, $columnCount = 1)
+ {
+ $this->validateColumnInRange($column);
+ if ($columnCount < 1) {
+ $columnCount = $this->columns + $columnCount - $column + 1;
+ }
+
+ $grid = $this->grid;
+ array_walk(
+ $grid,
+ function (&$row) use ($column, $columnCount) {
+ array_splice($row, $column - 1, $columnCount);
+ }
+ );
+
+ return new static($grid);
+ }
+
+ /**
+ * Return a value from this matrix, from the "cell" identified by the row and column numbers
+ * Note that row and column numbers start from 1, not from 0
+ *
+ * @param $row
+ * @param $column
+ * @return static
+ * @throws Exception
+ */
+ public function getValue($row, $column)
+ {
+ $row = $this->validateRowInRange($row);
+ $column = $this->validateColumnInRange($column);
+
+ return $this->grid[$row - 1][$column - 1];
+ }
+
+ /**
+ * Returns a Generator that will yield each row of the matrix in turn as a vector matrix
+ * or the value of each cell if the matrix is a vector
+ *
+ * @return \Generator|Matrix[]|mixed[]
+ */
+ public function rows()
+ {
+ foreach ($this->grid as $i => $row) {
+ yield $i + 1 => ($this->columns == 1)
+ ? $row[0]
+ : new static([$row]);
+ }
+ }
+
+ /**
+ * Returns a Generator that will yield each column of the matrix in turn as a vector matrix
+ * or the value of each cell if the matrix is a vector
+ *
+ * @return \Generator|Matrix[]|mixed[]
+ */
+ public function columns()
+ {
+ for ($i = 0; $i < $this->columns; ++$i) {
+ yield $i + 1 => ($this->rows == 1)
+ ? $this->grid[0][$i]
+ : new static(array_column($this->grid, $i));
+ }
+ }
+
+ /**
+ * Identify if the row and column dimensions of this matrix are equal,
+ * i.e. if it is a "square" matrix
+ *
+ * @return bool
+ */
+ public function isSquare()
+ {
+ return $this->rows == $this->columns;
+ }
+
+ /**
+ * Identify if this matrix is a vector
+ * i.e. if it comprises only a single row or a single column
+ *
+ * @return bool
+ */
+ public function isVector()
+ {
+ return $this->rows == 1 || $this->columns == 1;
+ }
+
+ /**
+ * Return the matrix as a 2-dimensional array
+ *
+ * @return array
+ */
+ public function toArray()
+ {
+ return $this->grid;
+ }
+
+ protected static $getters = [
+ 'rows',
+ 'columns',
+ ];
+
+ /**
+ * Access specific properties as read-only (no setters)
+ *
+ * @param $propertyName
+ * @return mixed
+ * @throws Exception
+ */
+ public function __get($propertyName)
+ {
+ $propertyName = strtolower($propertyName);
+
+ // Test for function calls
+ if (in_array($propertyName, self::$getters)) {
+ return $this->$propertyName;
+ }
+
+ throw new Exception('Property does not exist');
+ }
+
+ protected static $functions = [
+ 'antidiagonal',
+ 'adjoint',
+ 'cofactors',
+ 'determinant',
+ 'diagonal',
+ 'identity',
+ 'inverse',
+ 'minors',
+ 'trace',
+ 'transpose',
+ ];
+
+ protected static $operations = [
+ 'add',
+ 'subtract',
+ 'multiply',
+ 'divideby',
+ 'divideinto',
+ 'directsum',
+ ];
+
+ /**
+ * Returns the result of the function call or operation
+ *
+ * @param string $functionName
+ * @param mixed[] $arguments
+ * @return Matrix|float
+ * @throws Exception|\InvalidArgumentException
+ */
+ public function __call($functionName, $arguments)
+ {
+ $functionName = strtolower(str_replace('_', '', $functionName));
+
+ // Test for function calls
+ if (in_array($functionName, self::$functions)) {
+ $functionName = "\\" . __NAMESPACE__ . "\\{$functionName}";
+ return $functionName($this, ...$arguments);
+ }
+ // Test for operation calls
+ if (in_array($functionName, self::$operations)) {
+ $functionName = "\\" . __NAMESPACE__ . "\\{$functionName}";
+ return $functionName($this, ...$arguments);
+ }
+ throw new Exception('Function or Operation does not exist');
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Addition.php b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Addition.php
new file mode 100644
index 00000000000..e78c6d7d906
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Addition.php
@@ -0,0 +1,68 @@
+addMatrix($value);
+ } elseif (is_numeric($value)) {
+ return $this->addScalar($value);
+ }
+
+ throw new Exception('Invalid argument for addition');
+ }
+
+ /**
+ * Execute the addition for a scalar
+ *
+ * @param mixed $value The numeric value to add to the current base value
+ * @return $this The operation object, allowing multiple additions to be chained
+ **/
+ protected function addScalar($value)
+ {
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ $this->matrix[$row][$column] += $value;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Execute the addition for a matrix
+ *
+ * @param Matrix $value The numeric value to add to the current base value
+ * @return $this The operation object, allowing multiple additions to be chained
+ * @throws Exception If the provided argument is not appropriate for the operation
+ **/
+ protected function addMatrix(Matrix $value)
+ {
+ $this->validateMatchingDimensions($value);
+
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ $this->matrix[$row][$column] += $value->getValue($row + 1, $column + 1);
+ }
+ }
+
+ return $this;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/DirectSum.php b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/DirectSum.php
new file mode 100644
index 00000000000..bbf104a7fe4
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/DirectSum.php
@@ -0,0 +1,65 @@
+directSumMatrix($value);
+ }
+
+ throw new Exception('Invalid argument for addition');
+ }
+
+ /**
+ * Execute the direct sum for a matrix
+ *
+ * @param Matrix $value The numeric value to concatenate/direct sum with the current base value
+ * @return $this The operation object, allowing multiple additions to be chained
+ * @throws Exception If the provided argument is not appropriate for the operation
+ **/
+ protected function directSumMatrix(Matrix $value)
+ {
+ $originalColumnCount = count($this->matrix[0]);
+ $originalRowCount = count($this->matrix);
+ $additionalColumnCount = $value->columns;
+ $additionalRowCount = $value->rows;
+ $value = $value->toArray();
+
+ for ($row = 0; $row < $this->rows; ++$row) {
+ $this->matrix[$row] = array_merge($this->matrix[$row], array_fill(0, $additionalColumnCount, 0));
+ }
+
+ $this->matrix = array_merge(
+ $this->matrix,
+ array_fill(0, $additionalRowCount, array_fill(0, $originalColumnCount, 0))
+ );
+
+ for ($row = $originalRowCount; $row < $originalRowCount + $additionalRowCount; ++$row) {
+ array_splice(
+ $this->matrix[$row],
+ $originalColumnCount,
+ $additionalColumnCount,
+ $value[$row - $originalRowCount]
+ );
+ }
+
+ return $this;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Division.php b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Division.php
new file mode 100644
index 00000000000..2a573f5500e
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Division.php
@@ -0,0 +1,38 @@
+multiplyMatrix($value);
+ } elseif (is_numeric($value)) {
+ return $this->multiplyScalar(1 / $value);
+ }
+
+ throw new Exception('Invalid argument for division');
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Multiplication.php b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Multiplication.php
new file mode 100644
index 00000000000..63df162d6b0
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Multiplication.php
@@ -0,0 +1,77 @@
+multiplyMatrix($value);
+ } elseif (is_numeric($value)) {
+ return $this->multiplyScalar($value);
+ }
+
+ throw new Exception('Invalid argument for multiplication');
+ }
+
+ /**
+ * Execute the multiplication for a scalar
+ *
+ * @param mixed $value The numeric value to multiply with the current base value
+ * @return $this The operation object, allowing multiple mutiplications to be chained
+ **/
+ protected function multiplyScalar($value)
+ {
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ $this->matrix[$row][$column] *= $value;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Execute the multiplication for a matrix
+ *
+ * @param Matrix $value The numeric value to multiply with the current base value
+ * @return $this The operation object, allowing multiple mutiplications to be chained
+ * @throws Exception If the provided argument is not appropriate for the operation
+ **/
+ protected function multiplyMatrix(Matrix $value)
+ {
+ $this->validateReflectingDimensions($value);
+
+ $newRows = $this->rows;
+ $newColumns = $value->columns;
+ $matrix = Builder::createFilledMatrix(0, $newRows, $newColumns)
+ ->toArray();
+ for ($row = 0; $row < $newRows; ++$row) {
+ for ($column = 0; $column < $newColumns; ++$column) {
+ $columnData = $value->getColumns($column + 1)->toArray();
+ foreach ($this->matrix[$row] as $key => $valueData) {
+ $matrix[$row][$column] += $valueData * $columnData[$key][0];
+ }
+ }
+ }
+ $this->matrix = $matrix;
+
+ return $this;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Operator.php b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Operator.php
new file mode 100644
index 00000000000..87d3f3b5d77
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Operator.php
@@ -0,0 +1,78 @@
+rows = $matrix->rows;
+ $this->columns = $matrix->columns;
+ $this->matrix = $matrix->toArray();
+ }
+
+ /**
+ * Compare the dimensions of the matrices being operated on to see if they are valid for addition/subtraction
+ *
+ * @param Matrix $matrix The second Matrix object on which the operation will be performed
+ * @throws Exception
+ */
+ protected function validateMatchingDimensions(Matrix $matrix)
+ {
+ if (($this->rows != $matrix->rows) || ($this->columns != $matrix->columns)) {
+ throw new Exception('Matrices have mismatched dimensions');
+ }
+ }
+
+ /**
+ * Compare the dimensions of the matrices being operated on to see if they are valid for multiplication/division
+ *
+ * @param Matrix $matrix The second Matrix object on which the operation will be performed
+ * @throws Exception
+ */
+ protected function validateReflectingDimensions(Matrix $matrix)
+ {
+ if ($this->columns != $matrix->rows) {
+ throw new Exception('Matrices have mismatched dimensions');
+ }
+ }
+
+ /**
+ * Return the result of the operation
+ *
+ * @return Matrix
+ */
+ public function result()
+ {
+ return new Matrix($this->matrix);
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Subtraction.php b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Subtraction.php
new file mode 100644
index 00000000000..57c0b147c19
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/Operators/Subtraction.php
@@ -0,0 +1,68 @@
+subtractMatrix($value);
+ } elseif (is_numeric($value)) {
+ return $this->subtractScalar($value);
+ }
+
+ throw new Exception('Invalid argument for subtraction');
+ }
+
+ /**
+ * Execute the subtraction for a scalar
+ *
+ * @param mixed $value The numeric value to subtracted from the current base value
+ * @return $this The operation object, allowing multiple additions to be chained
+ **/
+ protected function subtractScalar($value)
+ {
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ $this->matrix[$row][$column] -= $value;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Execute the subtraction for a matrix
+ *
+ * @param Matrix $value The numeric value to subtract from the current base value
+ * @return $this The operation object, allowing multiple subtractions to be chained
+ * @throws Exception If the provided argument is not appropriate for the operation
+ **/
+ protected function subtractMatrix(Matrix $value)
+ {
+ $this->validateMatchingDimensions($value);
+
+ for ($row = 0; $row < $this->rows; ++$row) {
+ for ($column = 0; $column < $this->columns; ++$column) {
+ $this->matrix[$row][$column] -= $value->getValue($row + 1, $column + 1);
+ }
+ }
+
+ return $this;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/functions/adjoint.php b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/functions/adjoint.php
new file mode 100644
index 00000000000..d40283306c9
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/functions/adjoint.php
@@ -0,0 +1,26 @@
+execute($matrix);
+ }
+
+ return $result->result();
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/directsum.php b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/directsum.php
new file mode 100644
index 00000000000..16001ceef37
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/directsum.php
@@ -0,0 +1,39 @@
+execute($matrix);
+ }
+
+ return $result->result();
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/divideby.php b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/divideby.php
new file mode 100644
index 00000000000..80a8f1b2c7e
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/divideby.php
@@ -0,0 +1,38 @@
+execute($matrix);
+ }
+
+ return $result->result();
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/divideinto.php b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/divideinto.php
new file mode 100644
index 00000000000..8a26b52ca56
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/divideinto.php
@@ -0,0 +1,39 @@
+execute($matrix);
+ }
+
+ return $result->result();
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/multiply.php b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/multiply.php
new file mode 100644
index 00000000000..be60d7a96ed
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/multiply.php
@@ -0,0 +1,39 @@
+execute($matrix);
+ }
+
+ return $result->result();
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/subtract.php b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/subtract.php
new file mode 100644
index 00000000000..de61806f6e9
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/classes/src/operations/subtract.php
@@ -0,0 +1,39 @@
+execute($matrix);
+ }
+
+ return $result->result();
+}
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/composer.json b/lib/phpspreadsheet/vendor/markbaker/matrix/composer.json
new file mode 100644
index 00000000000..6627bd2228b
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/composer.json
@@ -0,0 +1,68 @@
+{
+ "name": "markbaker/matrix",
+ "type": "library",
+ "description": "PHP Class for working with matrices",
+ "keywords": ["matrix", "vector", "mathematics"],
+ "homepage": "https://github.com/MarkBaker/PHPMatrix",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Mark Baker",
+ "email": "mark@lange.demon.co.uk"
+ }
+ ],
+ "require": {
+ "php": "^5.6.0|^7.0.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35|^5.4.0",
+ "phpdocumentor/phpdocumentor":"2.*",
+ "phpmd/phpmd": "2.*",
+ "sebastian/phpcpd": "2.*",
+ "phploc/phploc": "2.*",
+ "squizlabs/php_codesniffer": "^3.3.0",
+ "phpcompatibility/php-compatibility": "^8.0",
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3"
+ },
+ "autoload": {
+ "psr-4": {
+ "Matrix\\": "classes/src/"
+ },
+ "files": [
+ "classes/src/functions/adjoint.php",
+ "classes/src/functions/antidiagonal.php",
+ "classes/src/functions/cofactors.php",
+ "classes/src/functions/determinant.php",
+ "classes/src/functions/diagonal.php",
+ "classes/src/functions/identity.php",
+ "classes/src/functions/inverse.php",
+ "classes/src/functions/minors.php",
+ "classes/src/functions/trace.php",
+ "classes/src/functions/transpose.php",
+ "classes/src/operations/add.php",
+ "classes/src/operations/directsum.php",
+ "classes/src/operations/subtract.php",
+ "classes/src/operations/multiply.php",
+ "classes/src/operations/divideby.php",
+ "classes/src/operations/divideinto.php"
+ ]
+ },
+ "scripts": {
+ "style": [
+ "phpcs --report-width=200 --report-summary --report-full classes/src/ --standard=PSR2 -n"
+ ],
+ "test": [
+ "phpunit"
+ ],
+ "mess": [
+ "phpmd classes/src/ xml codesize,unusedcode,design,naming -n"
+ ],
+ "lines": [
+ "phploc classes/src/ -n"
+ ],
+ "cpd": [
+ "phpcpd classes/src/ -n"
+ ]
+ },
+ "minimum-stability": "dev"
+}
\ No newline at end of file
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/examples/test.php b/lib/phpspreadsheet/vendor/markbaker/matrix/examples/test.php
new file mode 100644
index 00000000000..d8b56dcd9a7
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/examples/test.php
@@ -0,0 +1,19 @@
+directsum(new Matrix\Matrix($grid2));
+
+var_dump($new);
diff --git a/lib/phpspreadsheet/vendor/markbaker/matrix/license.md b/lib/phpspreadsheet/vendor/markbaker/matrix/license.md
new file mode 100644
index 00000000000..7329058f52b
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/markbaker/matrix/license.md
@@ -0,0 +1,25 @@
+The MIT License (MIT)
+=====================
+
+Copyright © `2018` `Mark Baker`
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the “Software”), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/CHANGELOG.PHPExcel.md b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/CHANGELOG.PHPExcel.md
new file mode 100644
index 00000000000..3c299020ed0
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/CHANGELOG.PHPExcel.md
@@ -0,0 +1,1593 @@
+# Changelog for PHPExcel
+
+This is the historic changelog of the project when it was still called PHPExcel.
+It exists only for historical purposes and versions mentioned here should not be
+confused with PhpSpreadsheet versions.
+
+## [1.8.1] - 2015-04-30
+
+### Bugfixes
+
+- Fix for Writing an Open Document cell with non-numeric formula - @goncons [#397](https://github.com/PHPOffice/PHPExcel/issues/397)
+- Avoid potential divide by zero in basedrawing - @sarciszewski [#329](https://github.com/PHPOffice/PHPExcel/issues/329)
+- XML External Entity (XXE) Processing, different behaviour between simplexml_load_string() and simplexml_load_file(). - @ymaerschalck [#405](https://github.com/PHPOffice/PHPExcel/issues/405)
+- Fix to ensure that current cell is maintained when executing formula calculations - @MarkBaker
+- Keep/set the value on Reader _loadSheetsOnly as NULL, courtesy of Restless-ET - @MarkBaker [#350](https://github.com/PHPOffice/PHPExcel/issues/350)
+- Loading an Excel 2007 spreadsheet throws an "Autofilter must be set on a range of cells" exception - @MarkBaker [CodePlex #18105](https://phpexcel.codeplex.com/workitem/18105)
+- Fix to autoloader registration for backward compatibility with PHP 5.2.0 not accepting the prepend flag - @MarkBaker [#388](https://github.com/PHPOffice/PHPExcel/issues/388)
+- DOM loadHTMLFile() failing with options flags when using PHP < 5.4.0 - @MarkBaker [#384](https://github.com/PHPOffice/PHPExcel/issues/384)
+- Fix for percentage operator in formulae for BIFF Writer - @MarkBaker
+- Fix to getStyle() call for cell object - @MarkBaker
+- Discard Autofilters in Excel2007 Reader when filter range isn't a valid range - @MarkBaker
+- Fix invalid NA return in VLOOKUP - @frozenstupidity [#423](https://github.com/PHPOffice/PHPExcel/issues/423)
+- "No Impact" conditional formatting fix for NumberFormat - @wiseloren [CodePlex #21454](https://phpexcel.codeplex.com/workitem/21454)
+- Bug in Excel2003XML reader, parsing merged cells - @bobwitlox [#467](https://github.com/PHPOffice/PHPExcel/issues/467)
+- Fix for CEIL() and FLOOR() when number argument is zero - @MarkBaker [#302](https://github.com/PHPOffice/PHPExcel/issues/302)
+
+### General
+
+- Remove cells cleanly when calling RemoveRow() or RemoveColumn() - @MarkBaker
+- Small performance improvement for autosize columns - @MarkBaker
+- Change the getter/setter for zeroHeight to camel case - @frost-nzcr4 [#379](https://github.com/PHPOffice/PHPExcel/issues/379)
+- DefaultValueBinder is too much aggressive when converting string to numeric - @MarkBaker [#394](https://github.com/PHPOffice/PHPExcel/issues/394)
+- Default precalculate formulas to false for writers - @MarkBaker
+- Set default Cyclic Reference behaviour to 1 to eliminate exception when using a single cyclic iteration in formulae - @MarkBaker
+
+### Features
+
+- Some Excel writer libraries erroneously use Codepage 21010 for UTF-16LE - @MarkBaker [#396](https://github.com/PHPOffice/PHPExcel/issues/396)
+- Methods to manage most of the existing options for Chart Axis, Major Grid-lines and Minor Grid-lines - @WiktrzGE [#404](https://github.com/PHPOffice/PHPExcel/issues/404)
+- ODS read/write comments in the cell - @frost-nzcr4 [#403](https://github.com/PHPOffice/PHPExcel/issues/403)
+- Additional Mac CJK codepage definitions - @CQD [#389](https://github.com/PHPOffice/PHPExcel/issues/389)
+- Update Worksheet.php getStyleByColumnAndRow() to allow a range of cells rather than just a single cell - @bolovincev [#269](https://github.com/PHPOffice/PHPExcel/issues/269)
+- New methods added for testing cell status within merge groups - @MarkBaker
+- Handling merge cells in HTML Reader - @cifren/MBaker [#205](https://github.com/PHPOffice/PHPExcel/issues/205)
+- Helper to convert basic HTML markup to a Rich Text object - @MarkBaker
+- Improved Iterators - @MarkBaker
+ - New Column Iterator
+ - Support for row and column ranges
+ - Improved handling for next/prev
+
+### Security
+
+- XML filescan in XML-based Readers to prevent XML Entity Expansion (XEE) - @MarkBaker
+ - (see http://projects.webappsec.org/w/page/13247002/XML%20Entity%20Expansion for an explanation of XEE injection) attacks
+ - Reference CVE-2015-3542 - Identification of problem courtesy of Dawid Golunski (Pentest Ltd.)
+
+## [1.8.0] - 2014-03-02
+
+### Bugfixes
+
+- Undefined variable: fileHandle in CSV Reader - @MarkBaker [CodePlex #19830](https://phpexcel.codeplex.com/workitem/19830)
+- Out of memory in style/supervisor.php - @MarkBaker [CodePlex #19968](https://phpexcel.codeplex.com/workitem/19968)
+- Style error with merged cells in PDF Writer - @MarkBaker
+- Problem with cloning worksheets - @MarkBaker
+- Bug fix reading Open Office files - @tavoarcila [#259](https://github.com/PHPOffice/PHPExcel/issues/259)
+- Serious bug in absolute cell reference used in shared formula - @MarkBaker [CodePlex #20397](https://phpexcel.codeplex.com/workitem/20397)
+ - Would also have affected insert/delete column/row- CHOOSE() returns "#VALUE!" if the 1st entry is chosen - @RomanSyroeshko [#267](https://github.com/PHPOffice/PHPExcel/issues/267)
+- When duplicating styles, styles shifted by one column to the right - @Gemorroj [#268](https://github.com/PHPOffice/PHPExcel/issues/268)
+ - Fix also applied to duplicating conditional styles- Fix for formulae that reference a sheet whose name begins with a digit: - @IndrekHaav [#212](https://github.com/PHPOffice/PHPExcel/issues/212)
+ - these were erroneously identified as numeric values, causing the parser to throw an undefined variable error.- Fixed undefined variable error due to $styleArray being used before it's initialised - @IndrekHaav [CodePlex #16208](https://phpexcel.codeplex.com/workitem/16208)
+- ISTEXT() return wrong result if referencing an empty but formatted cell - @PowerKiKi [#273](https://github.com/PHPOffice/PHPExcel/issues/273)
+- Binary comparison of strings are case insensitive - @PowerKiKi [#270](https://github.com/PHPOffice/PHPExcel/issues/270), [#31](https://github.com/PHPOffice/PHPExcel/issues/31)
+- Insert New Row/Column Before is not correctly updating formula references - @MarkBaker [#275](https://github.com/PHPOffice/PHPExcel/issues/275)
+- Passing an array of cells to _generateRow() in the HTML/PDF Writer causes caching problems with last cell in the range - @MarkBaker [#257](https://github.com/PHPOffice/PHPExcel/issues/257)
+- Fix to empty worksheet garbage collection when using cell caching - @MarkBaker [#193](https://github.com/PHPOffice/PHPExcel/issues/193)
+- Excel2007 does not correctly mark rows as hidden - @Jazzo [#248](https://github.com/PHPOffice/PHPExcel/issues/248)
+- Fixed typo in Chart/Layout set/getYMode() - @Roy Shahbazian [#299](https://github.com/PHPOffice/PHPExcel/issues/299)
+- Fatal error: Call to a member function cellExists() line: 3327 in calculation.php if referenced worksheet doesn't exist - @EliuFlorez [#279](https://github.com/PHPOffice/PHPExcel/issues/279)
+- AdvancedValueBinder "Division by zero"-error - @MarkBaker [#290](https://github.com/PHPOffice/PHPExcel/issues/290)
+- Adding Sheet to Workbook Bug - @MarkBaker [CodePlex #20604](https://phpexcel.codeplex.com/workitem/20604)
+- Calculation engine incorrectly evaluates empty cells as #VALUE - @MarkBaker [CodePlex #20703](https://phpexcel.codeplex.com/workitem/20703)
+- Formula references to cell on another sheet in ODS files - @MarkBaker [CodePlex #20760](https://phpexcel.codeplex.com/workitem/20760)
+
+### Features
+
+- LibreOffice created XLSX files results in an empty file. - @MarkBaker [#321](https://github.com/PHPOffice/PHPExcel/issues/321), [#158](https://github.com/PHPOffice/PHPExcel/issues/158), [CodePlex #17824](https://phpexcel.codeplex.com/workitem/17824)
+- Implementation of the Excel HLOOKUP() function - @amerov
+- Added "Quote Prefix" to style settings (Excel2007 Reader and Writer only) - @MarkBaker
+- Added Horizontal FILL alignment for Excel5 and Excel2007 Readers/Writers, and Horizontal DISTRIBUTED alignment for Excel2007 Reader/Writer - @MarkBaker
+- Add support for reading protected (RC4 encrypted) .xls files - @trvrnrth [#261](https://github.com/PHPOffice/PHPExcel/issues/261)
+
+### General
+
+- Adding support for macros, Ribbon in Excel 2007 - @LWol [#252](https://github.com/PHPOffice/PHPExcel/issues/252)
+- Remove array_shift in ReferenceHelper::insertNewBefore improves column or row delete speed - @cdhutch [CodePlex #20055](https://phpexcel.codeplex.com/workitem/20055)
+- Improve stock chart handling and rendering, with help from Swashata Ghosh - @MarkBaker
+- Fix to calculation properties for Excel2007 so that the opening application will only recalculate on load if it's actually required - @MarkBaker
+- Modified Excel2007 Writer to default preCalculateFormulas to false - @MarkBaker
+ - Note that autosize columns will still recalculate affected formulae internally- Functionality to getHighestRow() for a specified column, and getHighestColumn() for a specified row - @dresenhista [#242](https://github.com/PHPOffice/PHPExcel/issues/242)
+- Modify PHPExcel_Reader_Excel2007 to use zipClass from PHPExcel_Settings::getZipClass() - @adamriyadi [#247](https://github.com/PHPOffice/PHPExcel/issues/247)
+ - This allows the use of PCLZip when reading for people that don't have access to ZipArchive
+### Security
+
+- Convert properties to string in OOCalc reader - @infojunkie [#276](https://github.com/PHPOffice/PHPExcel/issues/276)
+- Disable libxml external entity loading by default. - @maartenba [#322](https://github.com/PHPOffice/PHPExcel/issues/322)
+ - This is to prevent XML External Entity Processing (XXE) injection attacks (see https://websec.io/2012/08/27/Preventing-XEE-in-PHP.html for an explanation of XXE injection).
+ - Reference CVE-2014-2054
+
+## [1.7.9] - 2013-06-02
+
+### Features
+
+- Include charts option for HTML Writer - @MarkBaker
+- Added composer file - @MarkBaker
+- cache_in_memory_gzip "eats" last worksheet line, cache_in_memory doesn't - @MarkBaker [CodePlex #18844](https://phpexcel.codeplex.com/workitem/18844)
+- echo statements in HTML.php - @MarkBaker [#104](https://github.com/PHPOffice/PHPExcel/issues/104)
+
+### Bugfixes
+
+- Added getStyle() method to Cell object - @MarkBaker
+- Error in PHPEXCEL/Calculation.php script on line 2976 (stack pop check) - @Asker [CodePlex #18777](https://phpexcel.codeplex.com/workitem/18777)
+- CSV files without a file extension being identified as HTML - @MarkBaker [CodePlex #18794](https://phpexcel.codeplex.com/workitem/18794)
+- Wrong check for maximum number of rows in Excel5 Writer - @AndreKR [#66](https://github.com/PHPOffice/PHPExcel/issues/66)
+- Cache directory for DiscISAM cache storage cannot be set - @MarkBaker [#67](https://github.com/PHPOffice/PHPExcel/issues/67)
+- Fix to Excel2007 Reader for hyperlinks with an anchor fragment (following a #), otherwise they were treated as sheet references - @MarkBaker [CodePlex #17976](https://phpexcel.codeplex.com/workitem/17976)
+- getSheetNames() fails on numeric (floating point style) names with trailing zeroes - @MarkBaker [CodePlex #18963](https://phpexcel.codeplex.com/workitem/18963)
+- Modify cell's getCalculatedValue() method to return the content of RichText objects rather than the RichText object itself - @MarkBaker
+- Fixed formula/formatting bug when removing rows - @techhead [#70](https://github.com/PHPOffice/PHPExcel/issues/70)
+- Fix to cellExists for non-existent namedRanges - @alexgann [#63](https://github.com/PHPOffice/PHPExcel/issues/63)
+- Sheet View in Excel5 Writer - @Progi1984 [#22](https://github.com/PHPOffice/PHPExcel/issues/22)
+- PHPExcel_Worksheet::getCellCollection() may not return last cached cell - @amironov [#82](https://github.com/PHPOffice/PHPExcel/issues/82)
+- Rich Text containing UTF-8 characters creating unreadable content with Excel5 Writer - @teso [CodePlex #18551](https://phpexcel.codeplex.com/workitem/18551)
+- Work item GH-8/CP11704 : Conditional formatting in Excel 5 Writer - @Progi1984
+- canRead() Error for GoogleDocs ODS files: in ODS files from Google Docs there is no mimetype file - @MarkBaker [#113](https://github.com/PHPOffice/PHPExcel/issues/113)
+- "Sheet index is out of bounds." Exception - @MarkBaker [#80](https://github.com/PHPOffice/PHPExcel/issues/80)
+- Fixed number format fatal error - @ccorliss [#105](https://github.com/PHPOffice/PHPExcel/issues/105)
+- Add DROP TABLE in destructor for SQLite and SQLite3 cache controllers - @MarkBaker
+- Fix merged-cell borders on HTML/PDF output - @alexgann [#154](https://github.com/PHPOffice/PHPExcel/issues/154)
+- Fix: Hyperlinks break when removing rows - @Shanto [#161](https://github.com/PHPOffice/PHPExcel/issues/161)
+- Fix Extra Table Row From Images and Charts - @neclimdul [#166](https://github.com/PHPOffice/PHPExcel/issues/166)
+
+### General
+
+- Single cell print area - @MarkBaker [#130](https://github.com/PHPOffice/PHPExcel/issues/130)
+- Improved AdvancedValueBinder for currency - @kea [#69](https://github.com/PHPOffice/PHPExcel/issues/69)
+- Fix for environments where there is no access to /tmp but to upload_tmp_dir - @MarkBaker
+ - Provided an option to set the sys_get_temp_dir() call to use the upload_tmp_dir; though by default the standard temp directory will still be used- Search style by identity in PHPExcel_Worksheet::duplicateStyle() - @amironov [#84](https://github.com/PHPOffice/PHPExcel/issues/84)
+- Fill SheetView IO in Excel5 - @karak [#85](https://github.com/PHPOffice/PHPExcel/issues/85)
+- Memory and Speed improvements in PHPExcel_Reader_Excel5 - @cfhay [CodePlex #18958](https://phpexcel.codeplex.com/workitem/18958)
+- Modify listWorksheetNames() and listWorksheetInfo to use XMLReader with streamed XML rather than SimpleXML - @MarkBaker [#78](https://github.com/PHPOffice/PHPExcel/issues/78)
+- Restructuring of PHPExcel Exceptions - @dbonsch
+- Refactor Calculation Engine from singleton to a Multiton - @MarkBaker
+ - Ensures that calculation cache is maintained independently for different workbooks
+
+## [1.7.8] - 2012-10-12
+
+### Features
+
+- Phar builder script to add phar file as a distribution option - @kkamkou
+- Refactor PDF Writer to allow use with a choice of PDF Rendering library - @MarkBaker
+ - rather than restricting to tcPDF
+ - Current options are tcPDF, mPDF, DomPDF
+ - tcPDF Library has now been removed from the deployment bundle- Initial version of HTML Reader - @MarkBaker
+- Implement support for AutoFilter in PHPExcel_Writer_Excel5 - @Progi1984
+- Modified ERF and ERFC Engineering functions to accept Excel 2010's modified acceptance of negative arguments - @MarkBaker
+- Support SheetView `view` attribute (Excel2007) - @k1LoW
+- Excel compatibility option added for writing CSV files - @MarkBaker
+ - While Excel 2010 can read CSV files with a simple UTF-8 BOM, Excel2007 and earlier require UTF-16LE encoded tab-separated files.
+ - The new setExcelCompatibility(TRUE) option for the CSV Writer will generate files with this formatting for easy import into Excel2007 and below.- Language implementations for Turkish (tr) - @MarkBaker
+- Added fraction tests to advanced value binder - @MarkBaker
+
+### General
+
+- Allow call to font setUnderline() for underline format to specify a simple boolean for UNDERLINE_NONE or UNDERLINE_SINGLE - @MarkBaker
+- Add Currency detection to the Advanced Value Binder - @alexgann
+- setCellValueExplicitByColumnAndRow() do not return PHPExcel_Worksheet - @MarkBaker [CodePlex #18404](https://phpexcel.codeplex.com/workitem/18404)
+- Reader factory doesn't read anymore XLTX and XLT files - @MarkBaker [CodePlex #18324](https://phpexcel.codeplex.com/workitem/18324)
+- Magic __toString() method added to Cell object to return raw data value as a string - @MarkBaker
+- Add cell indent to html rendering - @alexgann
+
+### Bugfixes
+
+- ZeroHeight for rows in sheet format - @Raghav1981
+- OOCalc cells containing inside the tag - @cyberconte
+- Fix to listWorksheetInfo() method for OOCalc Reader - @schir1964
+- Support for "e" (epoch) date format mask - @MarkBaker
+ - Rendered as a 4-digit CE year in non-Excel outputs- Background color cell is always black when editing cell - @MarkBaker
+- Allow "no impact" to formats on Conditional Formatting - @MarkBaker
+- OOCalc Reader fix for NULL cells - @wackonline
+- Fix to excel2007 Chart Writer when a $plotSeriesValues is empty - @seltzlab
+- Various fixes to Chart handling - @MarkBaker
+- Error loading xlsx file with column breaks - @MarkBaker [CodePlex #18370](https://phpexcel.codeplex.com/workitem/18370)
+- OOCalc Reader now handles percentage and currency data types - @MarkBaker
+- mb_stripos empty delimiter - @MarkBaker
+- getNestingLevel() Error on Excel5 Read - @takaakik
+- Fix to Excel5 Reader when cell annotations are defined before their referenced text objects - @MarkBaker
+- OOCalc Reader modified to process number-rows-repeated - @MarkBaker
+- Chart Title compatibility on Excel 2007 - @MarkBaker [CodePlex #18377](https://phpexcel.codeplex.com/workitem/18377)
+- Chart Refresh returning cell reference rather than values - @MarkBaker [CodePlex #18146](https://phpexcel.codeplex.com/workitem/18146)
+- Autoshape being identified in twoCellAnchor when includeCharts is TRUE triggering load error - @MarkBaker [CodePlex #18145](https://phpexcel.codeplex.com/workitem/18145)
+- v-type texts for series labels now recognised and parsed correctly - @MarkBaker [CodePlex #18325](https://phpexcel.codeplex.com/workitem/18325)
+- load file failed if the file has no extensionType - @wolf5x [CodePlex #18492](https://phpexcel.codeplex.com/workitem/18492)
+- Pattern fill colours in Excel2007 Style Writer - @dverspui
+- Excel2007 Writer order of font style elements to conform with Excel2003 using compatibility pack - @MarkBaker
+- Problems with $_activeSheetIndex when decreased below 0. - @MarkBaker [CodePlex #18425](https://phpexcel.codeplex.com/workitem/18425)
+- PHPExcel_CachedObjectStorage_SQLite3::cacheMethodIsAvailable() uses class_exists - autoloader throws error - @MarkBaker [CodePlex #18597](https://phpexcel.codeplex.com/workitem/18597)
+- Cannot access private property PHPExcel_CachedObjectStorageFactory::$_cacheStorageMethod - @MarkBaker [CodePlex #18598](https://phpexcel.codeplex.com/workitem/18598)
+- Data titles for charts - @MarkBaker [CodePlex #18397](https://phpexcel.codeplex.com/workitem/18397)
+ - PHPExcel_Chart_Layout now has methods for getting/setting switches for displaying/hiding chart data labels- Discard single cell merge ranges when reading (stupid that Excel allows them in the first place) - @MarkBaker
+- Discard hidden autoFilter named ranges - @MarkBaker
+
+## [1.7.7] - 2012-05-19
+
+### Bugfixes
+
+- Support for Rich-Text in PHPExcel_Writer_Excel5 - @Progi1984 [CodePlex #8916](https://phpexcel.codeplex.com/workitem/8916)
+- Change iterators to implement Iterator rather than extend CachingIterator, as a fix for PHP 5.4. changes in SPL - @MarkBaker
+- Invalid cell coordinate in Autofilter for Excel2007 Writer - @MarkBaker [CodePlex #15459](https://phpexcel.codeplex.com/workitem/15459)
+- PCLZip library issue - @MarkBaker [CodePlex #15518](https://phpexcel.codeplex.com/workitem/15518)
+- Excel2007 Reader canRead function bug - @MarkBaker [CodePlex #15537](https://phpexcel.codeplex.com/workitem/15537)
+- Support for Excel functions whose return can be used as either a value or as a cell reference depending on its context within a formula - @MarkBaker
+- ini_set() call in Calculation class destructor - @gilles06 [CodePlex #15707](https://phpexcel.codeplex.com/workitem/15707)
+- RangeToArray strange array keys - @MarkBaker [CodePlex #15786](https://phpexcel.codeplex.com/workitem/15786)
+- INDIRECT() function doesn't work with named ranges - @MarkBaker [CodePlex #15762](https://phpexcel.codeplex.com/workitem/15762)
+- Locale-specific fix to text functions when passing a boolean argument instead of a string - @MarkBaker
+- reader/CSV fails on this file - @MarkBaker [CodePlex #16246](https://phpexcel.codeplex.com/workitem/16246)
+ - auto_detect_line_endings now set in CSV reader- $arguments improperly used in CachedObjectStorage/PHPTemp.php - @MarkBaker [CodePlex #16212](https://phpexcel.codeplex.com/workitem/16212)
+- Bug In Cache System (cell reference when throwing caching errors) - @MarkBaker [CodePlex #16643](https://phpexcel.codeplex.com/workitem/16643)
+- PHP Invalid index notice on writing excel file when active sheet has been deleted - @MarkBaker [CodePlex #16895](https://phpexcel.codeplex.com/workitem/16895)
+- External links in Excel2010 files cause Fatal error - @MarkBaker [CodePlex #16956](https://phpexcel.codeplex.com/workitem/16956)
+- Previous calculation engine error conditions trigger cyclic reference errors - @MarkBaker [CodePlex #16960](https://phpexcel.codeplex.com/workitem/16960)
+- PHPExcel_Style::applyFromArray() returns null rather than style object in advanced mode - @mkopinsky [CodePlex #16266](https://phpexcel.codeplex.com/workitem/16266)
+- Cell::getFormattedValue returns RichText object instead of string - @fauvel [CodePlex #16958](https://phpexcel.codeplex.com/workitem/16958)
+- Indexed colors do not refer to Excel's indexed colors? - @MarkBaker [CodePlex #17166](https://phpexcel.codeplex.com/workitem/17166)
+- Indexed colors should be consistent with Excel and start from 1 (current index starts at 0) - @MarkBaker [CodePlex #17199](https://phpexcel.codeplex.com/workitem/17199)
+- Named Range definition in .xls when sheet reeference is quote wrapped - @MarkBaker [CodePlex #17262](https://phpexcel.codeplex.com/workitem/17262)
+- duplicateStyle() method doesn't duplicate conditional formats - @MarkBaker [CodePlex #17403](https://phpexcel.codeplex.com/workitem/17403)
+ - Added an equivalent duplicateConditionalStyle() method for duplicating conditional styles- =sumproduct(A,B) <> =sumproduct(B,A) in xlsx - @bnr [CodePlex #17501](https://phpexcel.codeplex.com/workitem/17501)
+
+### Features
+
+- OOCalc cells contain same data bug? - @cyberconte [CodePlex #17471](https://phpexcel.codeplex.com/workitem/17471)
+- listWorksheetInfo() method added to Readers... courtesy of Christopher Mullins - @schir1964
+- Options for cell caching using Igbinary and SQLite/SQlite3. - @MarkBaker
+- Additional row iterator options: allow a start row to be defined in the constructor; seek(), and prev() methods added. - @MarkBaker
+- Implement document properties in Excel5 writer - @Progi1984 [CodePlex #9759](https://phpexcel.codeplex.com/workitem/9759)
+
+### General
+
+- Implement chart functionality (EXPERIMENTAL) - @MarkBaker [CodePlex #16](https://phpexcel.codeplex.com/workitem/16)
+ - Initial definition of chart objects.
+ - Reading Chart definitions through the Excel2007 Reader
+ - Facility to render charts to images using the 3rd-party jpgraph library
+ - Writing Charts using the Excel2007 Writer- Fix to build to ensure that Examples are included with the documentation - @MarkBaker
+- Reduce cell caching overhead using dirty flag to ensure that cells are only rewritten to the cache if they have actually been changed - @MarkBaker
+- Improved memory usage in CSV Writer - @MarkBaker
+- Improved speed and memory usage in Excel5 Writer - @MarkBaker
+- Experimental - @MarkBaker
+ - Added getHighestDataColumn(), getHighestDataRow(), getHighestRowAndColumn() and calculateWorksheetDataDimension() methods for the worksheet that return the highest row and column that have cell records- Support for Rich-Text in PHPExcel_Writer_Excel5 - @Progi1984 [CodePlex #8916](https://phpexcel.codeplex.com/workitem/8916)
+- Two easy to fix Issues concerning PHPExcel_Token_Stack (l10n/UC) - @MarkBaker [CodePlex #15405](https://phpexcel.codeplex.com/workitem/15405)
+- Locale file paths not fit for windows - @MarkBaker [CodePlex #15461](https://phpexcel.codeplex.com/workitem/15461)
+- Add file directory as a cache option for cache_to_discISAM - @MarkBaker [CodePlex #16643](https://phpexcel.codeplex.com/workitem/16643)
+- Datatype.php & constant TYPE_NULL - @MarkBaker [CodePlex #16923](https://phpexcel.codeplex.com/workitem/16923)
+- Ensure use of system temp directory for all temporary work files, unless explicitly specified - @MarkBaker
+- [Patch] faster stringFromColumnIndex() - @char101 [CodePlex #16359](https://phpexcel.codeplex.com/workitem/16359)
+- Fix for projects that still use old autoloaders - @whit1206 [CodePlex #16028](https://phpexcel.codeplex.com/workitem/16028)
+- Unknown codepage: 10007 - @atz [CodePlex #17024](https://phpexcel.codeplex.com/workitem/17024)
+ - Additional Mac codepages
+
+## [1.7.6] - 2011-02-27
+
+### Features
+
+- Provide option to use PCLZip as an alternative to ZipArchive. - @MarkBaker
+ - This allows the writing of Excel2007 files, even without ZipArchive enabled (it does require zlib), or when php_zip is one of the buggy PHP 5.2.6 or 5.2.8 versions
+ - It can be enabled using PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);
+ - Note that it is not yet implemented as an alternative to ZipArchive for those Readers that are extracting from zips- Added listWorksheetNames() method to Readers that support multiple worksheets in a workbook, allowing a user to extract a list of all the worksheet names from a file without parsing/loading the whole file. - @MarkBaker [CodePlex #14979](https://phpexcel.codeplex.com/workitem/14979)
+- Speed boost and memory reduction in the Worksheet toArray() method. - @MarkBaker
+- Added new rangeToArray() and namedRangeToArray() methods to the PHPExcel_Worksheet object. - @MarkBaker
+ - Functionally, these are identical to the toArray() method, except that they take an additional first parameter of a Range (e.g. 'B2:C3') or a Named Range name.
+ - Modified the toArray() method so that it actually uses rangeToArray().- Added support for cell comments in the OOCalc, Gnumeric and Excel2003XML Readers, and in the Excel5 Reader - @MarkBaker
+- Improved toFormattedString() handling for Currency and Accounting formats to render currency symbols - @MarkBaker
+
+### Bugfixes
+
+- Implement more Excel calculation functions - @MarkBaker
+ - Implemented the DAVERAGE(), DCOUNT(), DCOUNTA(), DGET(), DMAX(), DMIN(), DPRODUCT(), DSTDEV(), DSTDEVP(), DSUM(), DVAR() and DVARP() Database functions- Simple =IF() formula disappears - @MarkBaker [CodePlex #14888](https://phpexcel.codeplex.com/workitem/14888)
+- PHP Warning: preg_match(): Compilation failed: PCRE does not support \\L, \\l, \\N, \\P, \\p, \\U, \\u, or \\X - @MarkBaker [CodePlex #14898](https://phpexcel.codeplex.com/workitem/14898)
+- VLOOKUP choking on parameters in PHPExcel.1.7.5/PHPExcel_Writer_Excel2007 - @MarkBaker [CodePlex #14901](https://phpexcel.codeplex.com/workitem/14901)
+- PHPExcel_Cell::isInRange() incorrect results - offset by one column - @MarkBaker [CodePlex #14973](https://phpexcel.codeplex.com/workitem/14973)
+- Treat CodePage of 0 as CP1251 (for .xls files written by applications that don't set the CodePage correctly, such as Apple Numbers) - @MarkBaker
+- Need method for removing autoFilter - @MarkBaker [CodePlex #11583](https://phpexcel.codeplex.com/workitem/11583)
+- coordinateFromString throws exception for rows greater than 99,999 - @MarkBaker [CodePlex #15029](https://phpexcel.codeplex.com/workitem/15029)
+- PHPExcel Excel2007 Reader colour problems with solidfill - @MarkBaker [CodePlex #14999](https://phpexcel.codeplex.com/workitem/14999)
+- Formatting get lost and edit a template XLSX file - @MarkBaker [CodePlex #13215](https://phpexcel.codeplex.com/workitem/13215)
+- Excel 2007 Reader /writer lost fontcolor - @MarkBaker [CodePlex #14029](https://phpexcel.codeplex.com/workitem/14029)
+- file that makes cells go black - @MarkBaker [CodePlex #13374](https://phpexcel.codeplex.com/workitem/13374)
+- Minor patchfix for Excel2003XML Reader when XML is defined with a charset attribute - @MarkBaker
+- PHPExcel_Worksheet->toArray() index problem - @MarkBaker [CodePlex #15089](https://phpexcel.codeplex.com/workitem/15089)
+- Merge cells 'un-merge' when using an existing spreadsheet - @MarkBaker [CodePlex #15094](https://phpexcel.codeplex.com/workitem/15094)
+- Worksheet fromArray() only working with 2-D arrays - @MarkBaker [CodePlex #15129](https://phpexcel.codeplex.com/workitem/15129)
+- rangeToarray function modified for non-existent cells - @xkeshav [CodePlex #15172](https://phpexcel.codeplex.com/workitem/15172)
+- Images not getting copyied with the ->clone function - @MarkBaker [CodePlex #14980](https://phpexcel.codeplex.com/workitem/14980)
+- AdvancedValueBinder.php: String sometimes becomes a date when it shouldn't - @MarkBaker [CodePlex #11576](https://phpexcel.codeplex.com/workitem/11576)
+- Fix Excel5 Writer so that it only writes column dimensions for columns that are actually used rather than the full range (A to IV) - @MarkBaker
+- FreezePane causing damaged or modified error - @MarkBaker [CodePlex #15198](https://phpexcel.codeplex.com/workitem/15198)
+ - The freezePaneByColumnAndRow() method row argument should default to 1 rather than 0.
+ - Default row argument for all __ByColumnAndRow() methods should be 1- Column reference rather than cell reference in Print Area definition - @MarkBaker [CodePlex #15121](https://phpexcel.codeplex.com/workitem/15121)
+ - Fix Excel2007 Writer to handle print areas that are defined as row or column ranges rather than just as cell ranges- Reduced false positives from isDateTimeFormatCode() method by suppressing testing within quoted strings - @MarkBaker
+- Caching and tmp partition exhaustion - @MarkBaker [CodePlex #15312](https://phpexcel.codeplex.com/workitem/15312)
+- Writing to Variable No Longer Works. $_tmp_dir Missing in PHPExcel\PHPExcel\Shared\OLE\PPS\Root.php - @MarkBaker [CodePlex #15308](https://phpexcel.codeplex.com/workitem/15308)
+- Named ranges with dot don't get parsed properly - @MarkBaker [CodePlex #15379](https://phpexcel.codeplex.com/workitem/15379)
+- insertNewRowBefore fails to consistently update references - @MarkBaker [CodePlex #15096](https://phpexcel.codeplex.com/workitem/15096)
+- "i" is not a valid character for Excel date format masks (in isDateTimeFormatCode() method) - @MarkBaker
+- PHPExcel_ReferenceHelper::insertNewBefore() is missing an 'Update worksheet: comments' section - @MKunert [CodePlex #15421](https://phpexcel.codeplex.com/workitem/15421)
+
+### General
+
+- Full column/row references in named ranges not supported by updateCellReference() - @MarkBaker [CodePlex #15409](https://phpexcel.codeplex.com/workitem/15409)
+- Improved performance (speed), for building the Shared Strings table in the Excel2007 Writer. - @MarkBaker
+- Improved performance (speed), for PHP to Excel date conversions - @MarkBaker
+- Enhanced SheetViews element structures in the Excel2007 Writer for frozen panes. - @MarkBaker
+- Removed Serialized Reader/Writer as these no longer work. - @MarkBaker
+
+## [1.7.5] - 2010-12-10
+
+### Features
+
+- Implement Gnumeric File Format - @MarkBaker [CodePlex #8769](https://phpexcel.codeplex.com/workitem/8769)
+ - Initial work on Gnumeric Reader (Worksheet Data, Document Properties and basic Formatting)- Support for Extended Workbook Properties in Excel2007, Excel5 and OOCalc Readers; support for User-defined Workbook Properties in Excel2007 and OOCalc Readers - @MarkBaker
+- Support for Extended and User-defined Workbook Properties in Excel2007 Writer - @MarkBaker
+- Provided a setGenerateSheetNavigationBlock(false); option to suppress generation of the sheet navigation block when writing multiple worksheets to HTML - @MarkBaker
+- Advanced Value Binder now recognises TRUE/FALSE strings (locale-specific) and converts to boolean - @MarkBaker
+- PHPExcel_Worksheet->toArray() is returning truncated values - @MarkBaker [CodePlex #14301](https://phpexcel.codeplex.com/workitem/14301)
+- Configure PDF Writer margins based on Excel Worksheet Margin Settings value - @MarkBaker
+- Added Contiguous flag for the CSV Reader, when working with Read Filters - @MarkBaker
+- Added getFormattedValue() method for cell object - @MarkBaker
+- Added strictNullComparison argument to the worksheet fromArray() method - @MarkBaker
+
+### Bugfixes
+
+- Fix to toFormattedString() method in PHPExcel_Style_NumberFormat to handle fractions with a # code for the integer part - @MarkBaker
+- NA() doesn't propagate in matrix calc - quick fix in JAMA/Matrix.php - @MarkBaker [CodePlex #14143](https://phpexcel.codeplex.com/workitem/14143)
+- Excel5 : Formula : String constant containing double quotation mark - @Progi1984 [CodePlex #7895](https://phpexcel.codeplex.com/workitem/7895)
+- Excel5 : Formula : Percent - @Progi1984 [CodePlex #7895](https://phpexcel.codeplex.com/workitem/7895)
+- Excel5 : Formula : Error constant - @Progi1984 [CodePlex #7895](https://phpexcel.codeplex.com/workitem/7895)
+- Excel5 : Formula : Concatenation operator - @Progi1984 [CodePlex #7895](https://phpexcel.codeplex.com/workitem/7895)
+- Worksheet clone broken for CachedObjectStorage_Memory - @MarkBaker [CodePlex #14146](https://phpexcel.codeplex.com/workitem/14146)
+- PHPExcel_Reader_Excel2007 fails when gradient fill without type is present in a file - @MarkBaker [CodePlex #12998](https://phpexcel.codeplex.com/workitem/12998)
+- @ format for numeric strings in XLSX to CSV conversion - @MarkBaker [CodePlex #14176](https://phpexcel.codeplex.com/workitem/14176)
+- Advanced Value Binder Not Working? - @MarkBaker [CodePlex #14223](https://phpexcel.codeplex.com/workitem/14223)
+- unassigned object variable in PHPExcel->removeCellXfByIndex - @MarkBaker [CodePlex #14226](https://phpexcel.codeplex.com/workitem/14226)
+- problem with getting cell values from another worksheet... (if cell doesn't exist) - @MarkBaker [CodePlex #14236](https://phpexcel.codeplex.com/workitem/14236)
+- Setting cell values to one char strings & Trouble reading one character string (thanks gorfou) - @MarkBaker
+- Worksheet title exception when duplicate worksheet is being renamed but exceeds the 31 character limit - @MarkBaker [CodePlex #14256](https://phpexcel.codeplex.com/workitem/14256)
+- Named range with sheet name that contains the $ throws exception when getting the cell - @MarkBaker [CodePlex #14086](https://phpexcel.codeplex.com/workitem/14086)
+- Added autoloader to DefaultValueBinder and AdvancedValueBinder - @MarkBaker
+- Modified PHPExcel_Shared_Date::isDateTimeFormatCode() to return false if format code begins with "_" or with "0 " to prevent false positives - @MarkBaker
+ - These leading characters are most commonly associated with number, currency or accounting (or occasionally fraction) formats- BUG : Excel5 and setReadFilter ? - @MarkBaker [CodePlex #14374](https://phpexcel.codeplex.com/workitem/14374)
+- Wrong exception message while deleting column - @MarkBaker [CodePlex #14425](https://phpexcel.codeplex.com/workitem/14425)
+- Formula evaluation fails with Japanese sheet refs - @MarkBaker [CodePlex #14679](https://phpexcel.codeplex.com/workitem/14679)
+- PHPExcel_Writer_PDF does not handle cell borders correctly - @MarkBaker [CodePlex #13559](https://phpexcel.codeplex.com/workitem/13559)
+- Style : applyFromArray() for 'allborders' not working - @MarkBaker [CodePlex #14831](https://phpexcel.codeplex.com/workitem/14831)
+
+### General
+
+- Using $this when not in object context in Excel5 Reader - @MarkBaker [CodePlex #14837](https://phpexcel.codeplex.com/workitem/14837)
+- Removes a unnecessary loop through each cell when applying conditional formatting to a range. - @MarkBaker
+- Removed spurious PHP end tags (?>) - @MarkBaker
+- Improved performance (speed) and reduced memory overheads, particularly for the Writers, but across the whole library. - @MarkBaker
+
+## [1.7.4] - 2010-08-26
+
+### Bugfixes
+
+- Excel5 : Formula : Power - @Progi1984 [CodePlex #7895](https://phpexcel.codeplex.com/workitem/7895)
+- Excel5 : Formula : Unary plus - @Progi1984 [CodePlex #7895](https://phpexcel.codeplex.com/workitem/7895)
+- Excel5 : Just write the Escher stream if necessary in Worksheet - @Progi1984
+- Syntax errors in memcache.php 1.7.3c - @MarkBaker [CodePlex #13433](https://phpexcel.codeplex.com/workitem/13433)
+- Support for row or column ranges in the calculation engine, e.g. =SUM(C:C) or =SUM(1:2) - @MarkBaker
+ - Also support in the calculation engine for absolute row or column ranges e.g. =SUM($C:$E) or =SUM($3:5)- Picture problem with Excel 2003 - @Erik Tilt [CodePlex #13455](https://phpexcel.codeplex.com/workitem/13455)
+- Wrong variable used in addExternalSheet in PHPExcel.php - @MarkBaker [CodePlex #13484](https://phpexcel.codeplex.com/workitem/13484)
+- "Invalid cell coordinate" error when formula access data from an other sheet - @MarkBaker [CodePlex #13515](https://phpexcel.codeplex.com/workitem/13515)
+- (related to Work item 13515) Calculation engine confusing cell range worksheet when referencing cells in a different worksheet to the formula - @MarkBaker
+- Wrong var naming in Worksheet->garbageCollect() - @MarkBaker [CodePlex #13752](https://phpexcel.codeplex.com/workitem/13752)
+- PHPExcel_Style_*::__clone() methods cause cloning loops? - @MarkBaker [CodePlex #13764](https://phpexcel.codeplex.com/workitem/13764)
+- Recent builds causing problems loading xlsx files? (ZipArchive issue?) - @MarkBaker [CodePlex #11488](https://phpexcel.codeplex.com/workitem/11488)
+- cache_to_apc causes fatal error when processing large data sets - @MarkBaker [CodePlex #13856](https://phpexcel.codeplex.com/workitem/13856)
+- OOCalc reader misses first line if it's a 'table-header-row' - @MarkBaker [CodePlex #13880](https://phpexcel.codeplex.com/workitem/13880)
+- using cache with copy or clone bug? - @MarkBaker [CodePlex #14011](https://phpexcel.codeplex.com/workitem/14011)
+ - Fixed $worksheet->copy() or clone $worksheet when using cache_in_memory, cache_in_memory_gzip, cache_in_memory_serialized, cache_to_discISAM, cache_to_phpTemp, cache_to_apc and cache_to_memcache;
+ - Fixed but untested when using cache_to_wincache.
+### Features
+
+- Standard Deviation functions returning DIV/0 Error when Standard Deviation is zero - @MarkBaker [CodePlex #13450](https://phpexcel.codeplex.com/workitem/13450)
+- Support for print area with several ranges in the Excel2007 reader, and improved features for editing print area with several ranges - @MarkBaker
+- Improved Cell Exception Reporting - @MarkBaker [CodePlex #13769](https://phpexcel.codeplex.com/workitem/13769)
+
+### General
+
+- Fixed problems with reading Excel2007 Properties - @MarkBaker
+- PHP Strict Standards: Non-static method PHPExcel_Shared_String::utf16_decode() should not be called statically - @MarkBaker
+- Array functions were ignored when loading an existing file containing them, and as a result, they would lose their 'cse' status. - @MarkBaker
+- Minor memory tweaks to Excel2007 Writer - @MarkBaker
+- Modified ReferenceHelper updateFormulaReferences() method to handle updates to row and column cell ranges (including absolute references e.g. =SUM(A:$E) or =SUM($5:5), and range/cell references that reference a worksheet by name), and to provide both performance and memory improvements. - @MarkBaker
+- Modified Excel2007 Reader so that ReferenceHelper class is instantiated only once rather than for every shared formula in a workbook. - @MarkBaker
+- Correct handling for additional (synonym) formula tokens in Excel5 Reader - @MarkBaker
+- Additional reading of some Excel2007 Extended Properties (Company, Manager) - @MarkBaker
+
+## [1.7.3c] - 2010-06-01
+
+### Bugfixes
+
+- Fatal error: Class 'ZipArchive' not found... ...Reader/Excel2007.php on line 217 - @MarkBaker [CodePlex #13012](https://phpexcel.codeplex.com/workitem/13012)
+- PHPExcel_Writer_Excel2007 error after 1.7.3b - @MarkBaker [CodePlex #13398](https://phpexcel.codeplex.com/workitem/13398)
+
+## [1.7.3b] - 2010-05-31
+
+### Bugfixes
+
+- Infinite loop when reading - @MarkBaker [CodePlex #12903](https://phpexcel.codeplex.com/workitem/12903)
+- Wrong method chaining on PHPExcel_Worksheet class - @MarkBaker [CodePlex #13381](https://phpexcel.codeplex.com/workitem/13381)
+
+## [1.7.3] - 2010-05-17
+
+### General
+
+- Applied patch 4990 (modified) - @Erik Tilt
+- Applied patch 5568 (modified) - @MarkBaker
+- Applied patch 5943 - @MarkBaker
+- Upgrade build script to use Phing - @MarkBaker [CodePlex #13042](https://phpexcel.codeplex.com/workitem/13042)
+- Replacing var with public/private - @Erik Tilt [CodePlex #11586](https://phpexcel.codeplex.com/workitem/11586)
+- Applied Anthony's Sterling's Class Autoloader to reduce memory overhead by "Lazy Loading" of classes - @MarkBaker
+- Modification to functions that accept a date parameter to support string values containing ordinals as per Excel (English language only) - @MarkBaker
+- Modify PHPExcel_Style_NumberFormat::toFormattedString() to handle dates that fall outside of PHP's 32-bit date range - @MarkBaker
+- Applied patch 5207 - @MarkBaker
+
+### Features
+
+- PHPExcel developer documentation: Set page margins - @Erik Tilt [CodePlex #11970](https://phpexcel.codeplex.com/workitem/11970)
+- Special characters and accents in SYLK reader - @Erik Tilt [CodePlex #11038](https://phpexcel.codeplex.com/workitem/11038)
+- Implement more Excel calculation functions - @MarkBaker
+ - Implemented the COUPDAYS(), COUPDAYBS(), COUPDAYSNC(), COUPNCD(), COUPPCD() and PRICE() Financial functions
+ - Implemented the N() and TYPE() Information functions
+ - Implemented the HYPERLINK() Lookup and Reference function- Horizontal page break support in PHPExcel_Writer_PDF - @Erik Tilt [CodePlex #11526](https://phpexcel.codeplex.com/workitem/11526)
+- Introduce method setActiveSheetIndexByName() - @Erik Tilt [CodePlex #11529](https://phpexcel.codeplex.com/workitem/11529)
+- AdvancedValueBinder.php: Automatically wrap text when there is new line in string (ALT+"Enter") - @Erik Tilt [CodePlex #11550](https://phpexcel.codeplex.com/workitem/11550)
+- Data validation support in PHPExcel_Reader_Excel5 and PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #10300](https://phpexcel.codeplex.com/workitem/10300)
+- Improve autosize calculation - @MarkBaker [CodePlex #11616](https://phpexcel.codeplex.com/workitem/11616)
+- Methods to translate locale-specific function names in formulae - @MarkBaker
+ - Language implementations for Czech (cs), Danish (da), German (de), English (uk), Spanish (es), Finnish (fi), French (fr), Hungarian (hu), Italian (it), Dutch (nl), Norwegian (no), Polish (pl), Portuguese (pt), Brazilian Portuguese (pt_br), Russian (ru) and Swedish (sv)- Implement document properties in Excel5 reader/writer - @Erik Tilt [CodePlex #9759](https://phpexcel.codeplex.com/workitem/9759)
+ - Fixed so far for PHPExcel_Reader_Excel5- Show/hide row and column headers in worksheet - @Erik Tilt [CodePlex #11849](https://phpexcel.codeplex.com/workitem/11849)
+- Can't set font on writing PDF (by key) - @Erik Tilt [CodePlex #11919](https://phpexcel.codeplex.com/workitem/11919)
+- Thousands scale (1000^n) support in PHPExcel_Style_NumberFormat::toFormattedString - @Erik Tilt [CodePlex #12096](https://phpexcel.codeplex.com/workitem/12096)
+- Implement repeating rows in PDF and HTML writer - @Erik Tilt
+- Sheet tabs in PHPExcel_Writer_HTML - @Erik Tilt [CodePlex #12289](https://phpexcel.codeplex.com/workitem/12289)
+- Add Wincache CachedObjectProvider - @MarkBaker [CodePlex #13041](https://phpexcel.codeplex.com/workitem/13041)
+- Configure PDF Writer paper size based on Excel Page Settings value, and provided methods to override paper size and page orientation with the writer - @MarkBaker
+ - Note PHPExcel defaults to Letter size, while the previous PDF writer enforced A4 size, so PDF writer will now default to Letter- Initial implementation of cell caching: allowing larger workbooks to be managed, but at a cost in speed - @MarkBaker
+
+### Bugfixes
+
+- Added an identify() method to the IO Factory that identifies the reader which will be used to load a particular file without actually loading it. - @MarkBaker
+- Warning messages with INDEX function having 2 arguments - @MarkBaker [CodePlex #10979](https://phpexcel.codeplex.com/workitem/10979)
+- setValue('=') should result in string instead of formula - @Erik Tilt [CodePlex #11473](https://phpexcel.codeplex.com/workitem/11473)
+- method _raiseFormulaError should no be private - @MarkBaker [CodePlex #11471](https://phpexcel.codeplex.com/workitem/11471)
+- Fatal error: Call to undefined function mb_substr() in ...Classes\PHPExcel\Reader\Excel5.php on line 2903 - @Erik Tilt [CodePlex #11485](https://phpexcel.codeplex.com/workitem/11485)
+- getBold(), getItallic(), getStrikeThrough() not always working with PHPExcel_Reader_Excel2007 - @Erik Tilt [CodePlex #11487](https://phpexcel.codeplex.com/workitem/11487)
+- AdvancedValueBinder.php not working correctly for $cell->setValue('hh:mm:ss') - @Erik Tilt [CodePlex #11492](https://phpexcel.codeplex.com/workitem/11492)
+- Fixed leap year handling for the YEARFRAC() Date/Time function when basis ia 1 (Actual/actual) - @MarkBaker
+- Warning messages - @MarkBaker [CodePlex #11490](https://phpexcel.codeplex.com/workitem/11490)
+ - Calculation Engine code modified to enforce strict standards for pass by reference- PHPExcel_Cell_AdvancedValueBinder doesnt work for dates in far future - @Erik Tilt [CodePlex #11483](https://phpexcel.codeplex.com/workitem/11483)
+- MSODRAWING bug with long CONTINUE record in PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #11528](https://phpexcel.codeplex.com/workitem/11528)
+- PHPExcel_Reader_Excel2007 reads print titles as named range when there is more than one sheet - @Erik Tilt [CodePlex #11571](https://phpexcel.codeplex.com/workitem/11571)
+- missing @return in phpdocblock in reader classes - @Erik Tilt [CodePlex #11561](https://phpexcel.codeplex.com/workitem/11561)
+- AdvancedValueBinder.php: String sometimes becomes a date when it shouldn't - @Erik Tilt [CodePlex #11576](https://phpexcel.codeplex.com/workitem/11576)
+- Small numbers escape treatment in PHPExcel_Style_NumberFormat::toFormattedString() - @Erik Tilt [CodePlex #11588](https://phpexcel.codeplex.com/workitem/11588)
+- Blank styled cells are not blank in output by HTML writer due to - @Erik Tilt [CodePlex #11590](https://phpexcel.codeplex.com/workitem/11590)
+- Calculation engine bug: Existing, blank cell + number gives #NUM - @MarkBaker [CodePlex #11587](https://phpexcel.codeplex.com/workitem/11587)
+- AutoSize only measures length of first line in cell with multiple lines (ALT+Enter) - @Erik Tilt [CodePlex #11608](https://phpexcel.codeplex.com/workitem/11608)
+- Fatal error running Tests/12serializedfileformat.php (PHPExcel 1.7.2) - @Erik Tilt [CodePlex #11608](https://phpexcel.codeplex.com/workitem/11608)
+- Fixed various errors in the WORKDAY() and NETWORKDAYS() Date/Time functions (particularly related to holidays) - @MarkBaker
+- Uncaught exception 'Exception' with message 'Valid scale is between 10 and 400.' in Classes/PHPExcel/Worksheet/SheetView.php:115 - @Erik Tilt [CodePlex #11660](https://phpexcel.codeplex.com/workitem/11660)
+- "Unrecognized token 39 in formula" with PHPExcel_Reader_Excel5 (occuring with add-in functions) - @Erik Tilt [CodePlex #11551](https://phpexcel.codeplex.com/workitem/11551)
+- Excel2007 reader not reading PHPExcel_Style_Conditional::CONDITION_EXPRESSION - @Erik Tilt [CodePlex #11668](https://phpexcel.codeplex.com/workitem/11668)
+- Fix to the BESSELI(), BESSELJ(), BESSELK(), BESSELY() and COMPLEX() Engineering functions to use correct default values for parameters - @MarkBaker
+- DATEVALUE function not working for pure time values + allow DATEVALUE() function to handle partial dates (e.g. "1-Jun" or "12/2010") - @MarkBaker [CodePlex #11525](https://phpexcel.codeplex.com/workitem/11525)
+- Fix for empty quoted strings in formulae - @MarkBaker
+- Trap for division by zero in Bessel functions - @MarkBaker
+- Fix to OOCalc Reader to convert semi-colon (;) argument separator in formulae to a comma (,) - @MarkBaker
+- PHPExcel_Writer_Excel5_Parser cannot parse formula like =SUM(C$5:C5) - @Erik Tilt [CodePlex #11693](https://phpexcel.codeplex.com/workitem/11693)
+- Fix to OOCalc Reader to handle dates that fall outside 32-bit PHP's date range - @MarkBaker
+- File->sys_get_temp_dir() can fail in safe mode - @Erik Tilt [CodePlex #11692](https://phpexcel.codeplex.com/workitem/11692)
+- Sheet references in Excel5 writer do not work when referenced sheet title contains non-Latin symbols - @Erik Tilt [CodePlex #11727](https://phpexcel.codeplex.com/workitem/11727)
+- Bug in HTML writer can result in missing rows in output - @Erik Tilt [CodePlex #11743](https://phpexcel.codeplex.com/workitem/11743)
+- setShowGridLines(true) not working with PHPExcel_Writer_PDF - @Erik Tilt [CodePlex #11674](https://phpexcel.codeplex.com/workitem/11674)
+- PHPExcel_Worksheet_RowIterator initial position incorrect - @Erik Tilt [CodePlex #11836](https://phpexcel.codeplex.com/workitem/11836)
+- PHPExcel_Worksheet_HeaderFooterDrawing Strict Exception thrown (by jshaw86) - @Erik Tilt [CodePlex #11835](https://phpexcel.codeplex.com/workitem/11835)
+- Parts of worksheet lost when there are embedded charts (Excel5 reader) - @Erik Tilt [CodePlex #11850](https://phpexcel.codeplex.com/workitem/11850)
+- VLOOKUP() function error when lookup value is passed as a cell reference rather than an absolute value - @MarkBaker
+- First segment of Rich-Text not read correctly by PHPExcel_Reader_Excel2007 - @Erik Tilt [CodePlex #12041](https://phpexcel.codeplex.com/workitem/12041)
+- Fatal Error with getCell('name') when name matches the pattern for a cell reference - @MarkBaker [CodePlex #12048](https://phpexcel.codeplex.com/workitem/12048)
+- excel5 writer appears to be swapping image locations - @Erik Tilt [CodePlex #12039](https://phpexcel.codeplex.com/workitem/12039)
+- Undefined index: host in ZipStreamWrapper.php, line 94 and line 101 - @Erik Tilt [CodePlex #11954](https://phpexcel.codeplex.com/workitem/11954)
+- BIFF8 File Format problem (too short COLINFO record) - @Erik Tilt [CodePlex #11672](https://phpexcel.codeplex.com/workitem/11672)
+- Column width sometimes changed after read/write with Excel2007 reader/writer - @Erik Tilt [CodePlex #12121](https://phpexcel.codeplex.com/workitem/12121)
+- Worksheet.php throws a fatal error when styling is turned off via setReadDataOnly on the reader - @Erik Tilt [CodePlex #11964](https://phpexcel.codeplex.com/workitem/11964)
+- Checking for Circular References in Formulae - @MarkBaker [CodePlex #11851](https://phpexcel.codeplex.com/workitem/11851)
+ - Calculation Engine code now traps for cyclic references, raising an error or throwing an exception, or allows 1 or more iterations through cyclic references, based on a configuration setting- PNG transparency using Excel2007 writer - @Erik Tilt [CodePlex #12244](https://phpexcel.codeplex.com/workitem/12244)
+- Custom readfilter error when cell formulas reference excluded cells (Excel5 reader) - @Erik Tilt [CodePlex #12221](https://phpexcel.codeplex.com/workitem/12221)
+- Protection problem in XLS - @Erik Tilt [CodePlex #12288](https://phpexcel.codeplex.com/workitem/12288)
+- getColumnDimension()->setAutoSize() incorrect on cells with Number Formatting - @Erik Tilt [CodePlex #12300](https://phpexcel.codeplex.com/workitem/12300)
+- Notices reading Excel file with Add-in funcitons (PHPExcel_Reader_Excel5) - @Erik Tilt [CodePlex #12378](https://phpexcel.codeplex.com/workitem/12378)
+- Excel5 reader not reading formulas with deleted sheet references - @Erik Tilt [CodePlex #12380](https://phpexcel.codeplex.com/workitem/12380)
+- Named range (defined name) scope problems for in PHPExcel - @Erik Tilt [CodePlex #12404](https://phpexcel.codeplex.com/workitem/12404)
+- PHP Parse error: syntax error, unexpected T_PUBLIC in PHPExcel/Calculation.php on line 3482 - @Erik Tilt [CodePlex #12423](https://phpexcel.codeplex.com/workitem/12423)
+- Named ranges don't appear in name box using Excel5 writer - @Erik Tilt [CodePlex #12505](https://phpexcel.codeplex.com/workitem/12505)
+- Many merged cells + autoSize column -> slows down the writer - @Erik Tilt [CodePlex #12509](https://phpexcel.codeplex.com/workitem/12509)
+- Incorrect fallback order comment in Shared/Strings.php ConvertEncoding() - @Erik Tilt [CodePlex #12539](https://phpexcel.codeplex.com/workitem/12539)
+- IBM AIX iconv() will not work, should revert to mbstring etc. instead - @Erik Tilt [CodePlex #12538](https://phpexcel.codeplex.com/workitem/12538)
+- Excel5 writer and mbstring functions overload - @Erik Tilt [CodePlex #12568](https://phpexcel.codeplex.com/workitem/12568)
+- OFFSET needs to flattenSingleValue the $rows and $columns args - @MarkBaker [CodePlex #12672](https://phpexcel.codeplex.com/workitem/12672)
+- Formula with DMAX(): Notice: Undefined offset: 2 in ...\PHPExcel\Calculation.php on line 2365 - @MarkBaker [CodePlex #12546](https://phpexcel.codeplex.com/workitem/12546)
+ - Note that the Database functions have not yet been implemented- Call to a member function getParent() on a non-object in Classes\\PHPExcel\\Calculation.php Title is required - @MarkBaker [CodePlex #12839](https://phpexcel.codeplex.com/workitem/12839)
+- Cyclic Reference in Formula - @MarkBaker [CodePlex #12935](https://phpexcel.codeplex.com/workitem/12935)
+- Memory error...data validation? - @MarkBaker [CodePlex #13025](https://phpexcel.codeplex.com/workitem/13025)
+
+## [1.7.2] - 2010-01-11
+
+### General
+
+- Applied patch 4362 - @Erik Tilt
+- Applied patch 4363 (modified) - @Erik Tilt
+- 1.7.1 Extremely Slow - Refactored PHPExcel_Calculation_Functions::flattenArray() method and set calculation cache timer default to 2.5 seconds - @MarkBaker [CodePlex #10874](https://phpexcel.codeplex.com/workitem/10874)
+- Allow formulae to contain line breaks - @MarkBaker
+- split() function deprecated in PHP 5.3.0 - @Erik Tilt [CodePlex #10910](https://phpexcel.codeplex.com/workitem/10910)
+- sys_get_temp_dir() requires PHP 5.2.1, not PHP 5.2 [provide fallback function for PHP 5.2.0] - @Erik Tilt
+- Implementation of the ISPMT() Financial function by Matt Groves - @MarkBaker
+- Put the example of formula with more arguments in documentation - @MarkBaker [CodePlex #11052](https://phpexcel.codeplex.com/workitem/11052)
+
+### Features
+
+- Improved accuracy for the GAMMAINV() Statistical Function - @MarkBaker
+- XFEXT record support to fix colors change from Excel5 reader, and copy/paste color change with Excel5 writer - @Erik Tilt [CodePlex #10409](https://phpexcel.codeplex.com/workitem/10409)
+ - Excel5 reader reads RGB color information in XFEXT records for borders, font color and fill color- Implement more Excel calculation functions - @MarkBaker
+ - Implemented the FVSCHEDULE(), XNPV(), IRR(), MIRR(), XIRR() and RATE() Financial functions
+ - Implemented the SUMPRODUCT() Mathematical function
+ - Implemented the ZTEST() Statistical Function- Multiple print areas in one sheet - @Erik Tilt [CodePlex #10919](https://phpexcel.codeplex.com/workitem/10919)
+- Store calculated values in output by PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #10930](https://phpexcel.codeplex.com/workitem/10930)
+- Sheet protection options in Excel5 reader/writer - @Erik Tilt [CodePlex #10939](https://phpexcel.codeplex.com/workitem/10939)
+- Modification of the COUNT(), AVERAGE(), AVERAGEA(), DEVSQ, AVEDEV(), STDEV(), STDEVA(), STDEVP(), STDEVPA(), VARA() and VARPA() SKEW() and KURT() functions to correctly handle boolean values depending on whether they're passed in as values, values within a matrix or values within a range of cells. - @MarkBaker
+- Cell range selection - @Erik Tilt
+- Root-relative path handling - @MarkBaker [CodePlex #10266](https://phpexcel.codeplex.com/workitem/10266)
+
+### Bugfixes
+
+- Named Ranges not working with PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #11315](https://phpexcel.codeplex.com/workitem/11315)
+- Excel2007 Reader fails to load Apache POI generated Excel - @MarkBaker [CodePlex #11206](https://phpexcel.codeplex.com/workitem/11206)
+- Number format is broken when system's thousands separator is empty - @MarkBaker [CodePlex #11154](https://phpexcel.codeplex.com/workitem/11154)
+- ReferenceHelper::updateNamedFormulas throws errors if oldName is empty - @MarkBaker [CodePlex #11401](https://phpexcel.codeplex.com/workitem/11401)
+- parse_url() fails to parse path to an image in xlsx - @MarkBaker [CodePlex #11296](https://phpexcel.codeplex.com/workitem/11296)
+- Workaround for iconv_substr() bug in PHP 5.2.0 - @Erik Tilt [CodePlex #10876](https://phpexcel.codeplex.com/workitem/10876)
+- 1 pixel error for image width and height with PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #10877](https://phpexcel.codeplex.com/workitem/10877)
+- Fix to GEOMEAN() Statistical function - @MarkBaker
+- setValue('-') and setValue('.') sets numeric 0 instead of 1-character string - @Erik Tilt [CodePlex #10884](https://phpexcel.codeplex.com/workitem/10884)
+- Row height sometimes much too low after read with PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #10885](https://phpexcel.codeplex.com/workitem/10885)
+- Diagonal border. Miscellaneous missing support. - @Erik Tilt [CodePlex #10888](https://phpexcel.codeplex.com/workitem/10888)
+ - Constant PHPExcel_Style_Borders::DIAGONAL_BOTH added to support double-diagonal (cross)
+ - PHPExcel_Reader_Excel2007 not always reading diagonal borders (only recognizes 'true' and not '1')
+ - PHPExcel_Reader_Excel5 support for diagonal borders
+ - PHPExcel_Writer_Excel5 support for diagonal borders- Session bug: Fatal error: Call to a member function bindValue() on a non-object in ...\Classes\PHPExcel\Cell.php on line 217 - @Erik Tilt [CodePlex #10894](https://phpexcel.codeplex.com/workitem/10894)
+- Colors messed up saving twice with same instance of PHPExcel_Writer_Excel5 (regression since 1.7.0) - @Erik Tilt [CodePlex #10896](https://phpexcel.codeplex.com/workitem/10896)
+- Method PHPExcel_Worksheet::setDefaultStyle is not working - @Erik Tilt [CodePlex #10917](https://phpexcel.codeplex.com/workitem/10917)
+- PHPExcel_Reader_CSV::canRead() sometimes says false when it shouldn't - @Erik Tilt [CodePlex #10897](https://phpexcel.codeplex.com/workitem/10897)
+- Changes in workbook not picked up between two saves with PHPExcel_Writer_Excel2007 - @Erik Tilt [CodePlex #10922](https://phpexcel.codeplex.com/workitem/10922)
+- Decimal and thousands separators missing in HTML and PDF output - @Erik Tilt [CodePlex #10913](https://phpexcel.codeplex.com/workitem/10913)
+- Notices with PHPExcel_Reader_Excel5 and named array constants - @Erik Tilt [CodePlex #10936](https://phpexcel.codeplex.com/workitem/10936)
+- Calculation engine limitation on 32-bit platform with integers > 2147483647 - @MarkBaker [CodePlex #10938](https://phpexcel.codeplex.com/workitem/10938)
+- Shared(?) formulae containing absolute cell references not read correctly using Excel5 Reader - @Erik Tilt [CodePlex #10959](https://phpexcel.codeplex.com/workitem/10959)
+- Warning messages with intersection operator involving single cell - @MarkBaker [CodePlex #10962](https://phpexcel.codeplex.com/workitem/10962)
+- Infinite loop in Excel5 reader caused by zero-length string in SST - @Erik Tilt [CodePlex #10980](https://phpexcel.codeplex.com/workitem/10980)
+- Remove unnecessary cell sorting to improve speed by approx. 18% in HTML and PDF writers - @Erik Tilt [CodePlex #10983](https://phpexcel.codeplex.com/workitem/10983)
+- Cannot read A1 cell content - OO_Reader - @MarkBaker [CodePlex #10977](https://phpexcel.codeplex.com/workitem/10977)
+- Transliteration failed, invalid encoding - @Erik Tilt [CodePlex #11000](https://phpexcel.codeplex.com/workitem/11000)
+
+## [1.7.1] - 2009-11-02
+
+### General
+
+- ereg() function deprecated in PHP 5.3.0 - @Erik Tilt [CodePlex #10687](https://phpexcel.codeplex.com/workitem/10687)
+- Writer Interface Inconsequence - setTempDir and setUseDiskCaching - @MarkBaker [CodePlex #10739](https://phpexcel.codeplex.com/workitem/10739)
+
+### Features
+
+- Upgrade to TCPDF 4.8.009 - @Erik Tilt
+- Support for row and column styles (feature request) - @Erik Tilt
+ - Basic implementation for Excel2007/Excel5 reader/writer- Hyperlink to local file in Excel5 reader/writer - @Erik Tilt [CodePlex #10459](https://phpexcel.codeplex.com/workitem/10459)
+- Color Tab (Color Sheet's name) - @MarkBaker [CodePlex #10472](https://phpexcel.codeplex.com/workitem/10472)
+- Border style "double" support in PHPExcel_Writer_HTML - @Erik Tilt [CodePlex #10488](https://phpexcel.codeplex.com/workitem/10488)
+- Multi-section number format support in HTML/PDF/CSV writers - @Erik Tilt [CodePlex #10492](https://phpexcel.codeplex.com/workitem/10492)
+- Some additional performance tweaks in the calculation engine - @MarkBaker
+- Fix result of DB() and DDB() Financial functions to 2dp when in Gnumeric Compatibility mode - @MarkBaker
+- Added AMORDEGRC(), AMORLINC() and COUPNUM() Financial function (no validation of parameters yet) - @MarkBaker
+- Improved accuracy of TBILLEQ(), TBILLPRICE() and TBILLYIELD() Financial functions when in Excel or Gnumeric mode - @MarkBaker
+- Added INDIRECT() Lookup/Reference function (only supports full addresses at the moment) - @MarkBaker
+- PHPExcel_Reader_CSV::canRead() improvements - @MarkBaker [CodePlex #10498](https://phpexcel.codeplex.com/workitem/10498)
+- Input encoding option for PHPExcel_Reader_CSV - @Erik Tilt [CodePlex #10500](https://phpexcel.codeplex.com/workitem/10500)
+- Colored number format support, e.g. [Red], in HTML/PDF output - @Erik Tilt [CodePlex #10493](https://phpexcel.codeplex.com/workitem/10493)
+- Color Tab (Color Sheet's name) [Excel5 reader/writer support] - @Erik Tilt [CodePlex #10559](https://phpexcel.codeplex.com/workitem/10559)
+- Initial version of SYLK (slk) and Excel 2003 XML Readers (Cell data and basic cell formatting) - @MarkBaker
+- Initial version of Open Office Calc (ods) Reader (Cell data only) - @MarkBaker
+- Initial use of "pass by reference" in the calculation engine for ROW() and COLUMN() Lookup/Reference functions - @MarkBaker
+- COLUMNS() and ROWS() Lookup/Reference functions, and SUBSTITUTE() Text function - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- AdvancedValueBinder(): Re-enable zero-padded string-to-number conversion, e.g '0004' -> 4 - @Erik Tilt [CodePlex #10502](https://phpexcel.codeplex.com/workitem/10502)
+- Make PHP type match Excel datatype - @Erik Tilt [CodePlex #10600](https://phpexcel.codeplex.com/workitem/10600)
+- Change first page number on header - @MarkBaker [CodePlex #10630](https://phpexcel.codeplex.com/workitem/10630)
+- Applied patch 3941 - @MarkBaker
+- Hidden sheets - @MB,ET [CodePlex #10745](https://phpexcel.codeplex.com/workitem/10745)
+- mbstring fallback when iconv is broken - @Erik Tilt [CodePlex #10761](https://phpexcel.codeplex.com/workitem/10761)
+- Note, can't yet handle comparison of two matrices - @MarkBaker
+- Improved handling for validation and error trapping in a number of functions - @MarkBaker
+- Improved support for fraction number formatting - @MarkBaker
+- Support Reading CSV with Byte Order Mark (BOM) - @Erik Tilt [CodePlex #10455](https://phpexcel.codeplex.com/workitem/10455)
+
+### Bugfixes
+
+- addExternalSheet() at specified index - @Erik Tilt [CodePlex #10860](https://phpexcel.codeplex.com/workitem/10860)
+- Named range can no longer be passed to worksheet->getCell() - @MarkBaker [CodePlex #10684](https://phpexcel.codeplex.com/workitem/10684)
+- RichText HTML entities no longer working in PHPExcel 1.7.0 - @Erik Tilt [CodePlex #10455](https://phpexcel.codeplex.com/workitem/10455)
+- Fit-to-width value of 1 is lost after read/write of Excel2007 spreadsheet [+ support for simultaneous scale/fitToPage] - @Erik Tilt
+- Performance issue identified by profiling - @MarkBaker [CodePlex #10469](https://phpexcel.codeplex.com/workitem/10469)
+- setSelectedCell is wrong - @Erik Tilt [CodePlex #10473](https://phpexcel.codeplex.com/workitem/10473)
+- Images get squeezed/stretched with (Mac) Verdana 10 Excel files using Excel5 reader/writer - @Erik Tilt [CodePlex #10481](https://phpexcel.codeplex.com/workitem/10481)
+- Error in argument count for DATEDIF() function - @MarkBaker [CodePlex #10482](https://phpexcel.codeplex.com/workitem/10482)
+- updateFormulaReferences is buggy - @MarkBaker [CodePlex #10452](https://phpexcel.codeplex.com/workitem/10452)
+- CellIterator returns null Cell if onlyExistingCells is set and key() is in use - @MarkBaker [CodePlex #10485](https://phpexcel.codeplex.com/workitem/10485)
+- Wrong RegEx for parsing cell references in formulas - @MarkBaker [CodePlex #10453](https://phpexcel.codeplex.com/workitem/10453)
+- Optimisation subverted to devastating effect if IterateOnlyExistingCells is clear - @MarkBaker [CodePlex #10486](https://phpexcel.codeplex.com/workitem/10486)
+- Fatal error: Uncaught exception 'Exception' with message 'Unrecognized token 6C in formula'... with PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #10494](https://phpexcel.codeplex.com/workitem/10494)
+- Fractions stored as text are not treated as numbers by PHPExcel's calculation engine - @MarkBaker [CodePlex #10490](https://phpexcel.codeplex.com/workitem/10490)
+- AutoFit (autosize) row height not working in PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #10503](https://phpexcel.codeplex.com/workitem/10503)
+- Fixed problem with null values breaking the calculation stack - @MarkBaker
+- Date number formats sometimes fail with PHPExcel_Style_NumberFormat::toFormattedString, e.g. [$-40047]mmmm d yyyy - @Erik Tilt [CodePlex #10524](https://phpexcel.codeplex.com/workitem/10524)
+- Fixed minor problem with DATEDIFF YM calculation - @MarkBaker
+- Applied patch 3695 - @MarkBaker
+- setAutosize() and Date cells not working properly - @Erik Tilt [CodePlex #10536](https://phpexcel.codeplex.com/workitem/10536)
+- Time value hour offset in output by HTML/PDF/CSV writers (system timezone problem) - @Erik Tilt [CodePlex #10556](https://phpexcel.codeplex.com/workitem/10556)
+- Control characters 0x14-0x1F are not treated by PHPExcel - @Erik Tilt [CodePlex #10558](https://phpexcel.codeplex.com/workitem/10558)
+- PHPExcel_Writer_Excel5 not working when open_basedir restriction is in effect - @Erik Tilt [CodePlex #10560](https://phpexcel.codeplex.com/workitem/10560)
+- IF formula calculation problem in PHPExcel 1.7.0 (string comparisons) - @MarkBaker [CodePlex #10563](https://phpexcel.codeplex.com/workitem/10563)
+- Improved CODE() Text function result for UTF-8 characters - @MarkBaker
+- Empty rows are collapsed with HTML/PDF writer - @Erik Tilt [CodePlex #10568](https://phpexcel.codeplex.com/workitem/10568)
+- Gaps between rows in output by PHPExcel_Writer_PDF (Upgrading to TCPDF 4.7.003) - @Erik Tilt [CodePlex #10569](https://phpexcel.codeplex.com/workitem/10569)
+- Problem reading formulas (Excel5 reader problem with "fake" shared formulas) - @Erik Tilt [CodePlex #10575](https://phpexcel.codeplex.com/workitem/10575)
+- Error type in formula: "_raiseFormulaError message is Formula Error: An unexpected error occured" - @MarkBaker [CodePlex #10588](https://phpexcel.codeplex.com/workitem/10588)
+- Miscellaneous column width problems in Excel5/Excel2007 writer - @Erik Tilt [CodePlex #10599](https://phpexcel.codeplex.com/workitem/10599)
+- Reader/Excel5 'Unrecognized token 2D in formula' in latest version - @Erik Tilt [CodePlex #10615](https://phpexcel.codeplex.com/workitem/10615)
+- on php 5.3 PHPExcel 1.7 Excel 5 reader fails in _getNextToken, token = 2C, throws exception - @Erik Tilt [CodePlex #10623](https://phpexcel.codeplex.com/workitem/10623)
+- Fatal error when altering styles after workbook has been saved - @Erik Tilt [CodePlex #10617](https://phpexcel.codeplex.com/workitem/10617)
+- Images vertically stretched or squeezed when default font size is changed (PHPExcel_Writer_Excel5) - @Erik Tilt [CodePlex #10661](https://phpexcel.codeplex.com/workitem/10661)
+- Styles not read in "manipulated" Excel2007 workbook - @Erik Tilt [CodePlex #10676](https://phpexcel.codeplex.com/workitem/10676)
+- Windows 7 says corrupt file by PHPExcel_Writer_Excel5 when opening in Excel - @Erik Tilt [CodePlex #10059](https://phpexcel.codeplex.com/workitem/10059)
+- Calculations sometimes not working with cell references to other sheets - @MarkBaker [CodePlex #10708](https://phpexcel.codeplex.com/workitem/10708)
+- Problem with merged cells after insertNewRowBefore() - @Erik Tilt [CodePlex #10706](https://phpexcel.codeplex.com/workitem/10706)
+- Applied patch 4023 - @MarkBaker
+- Fix to SUMIF() and COUNTIF() Statistical functions for when condition is a match against a string value - @MarkBaker
+- PHPExcel_Cell::coordinateFromString should throw exception for bad string parameter - @Erik Tilt [CodePlex #10721](https://phpexcel.codeplex.com/workitem/10721)
+- EucrosiaUPC (Thai font) not working with PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #10723](https://phpexcel.codeplex.com/workitem/10723)
+- Improved the return of calculated results when the result value is an array - @MarkBaker
+- Allow calculation engine to support Functions prefixed with @ within formulae - @MarkBaker
+- Intersection operator (space operator) fatal error with calculation engine - @MarkBaker [CodePlex #10632](https://phpexcel.codeplex.com/workitem/10632)
+- Chinese, Japanese, Korean characters show as squares in PDF - @Erik Tilt [CodePlex #10742](https://phpexcel.codeplex.com/workitem/10742)
+- sheet title allows invalid characters - @Erik Tilt [CodePlex #10756](https://phpexcel.codeplex.com/workitem/10756)
+- Sheet!$A$1 as function argument in formula causes infinite loop in Excel5 writer - @Erik Tilt [CodePlex #10757](https://phpexcel.codeplex.com/workitem/10757)
+- Cell range involving name not working with calculation engine - Modified calculation parser to handle range operator (:), but doesn't currently handle worksheet references with spaces or other non-alphameric characters, or trap erroneous references - @MarkBaker [CodePlex #10740](https://phpexcel.codeplex.com/workitem/10740)
+- DATE function problem with calculation engine (says too few arguments given) - @MarkBaker [CodePlex #10798](https://phpexcel.codeplex.com/workitem/10798)
+- Blank cell can cause wrong calculated value - @MarkBaker [CodePlex #10799](https://phpexcel.codeplex.com/workitem/10799)
+- Modified ROW() and COLUMN() Lookup/Reference Functions to return an array when passed a cell range, plus some additional work on INDEX() - @MarkBaker
+- Images not showing in Excel 97 using PHPExcel_Writer_Excel5 (patch by Jordi Gutiérrez Hermoso) - @Erik Tilt [CodePlex #10817](https://phpexcel.codeplex.com/workitem/10817)
+- When figures are contained in the excel sheet, Reader was stopped - @Erik Tilt [CodePlex #10785](https://phpexcel.codeplex.com/workitem/10785)
+- Formulas changed after insertNewRowBefore() - @MarkBaker [CodePlex #10818](https://phpexcel.codeplex.com/workitem/10818)
+- Cell range row offset problem with shared formulas using PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #10825](https://phpexcel.codeplex.com/workitem/10825)
+- Warning: Call-time pass-by-reference has been deprecated - @MarkBaker [CodePlex #10832](https://phpexcel.codeplex.com/workitem/10832)
+- Image should "Move but don't size with cells" instead of "Move and size with cells" with PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #10849](https://phpexcel.codeplex.com/workitem/10849)
+- Opening a Excel5 generated XLS in Excel 2007 results in header/footer entry not showing on input - @Erik Tilt [CodePlex #10856](https://phpexcel.codeplex.com/workitem/10856)
+- addExternalSheet() not returning worksheet - @Erik Tilt [CodePlex #10859](https://phpexcel.codeplex.com/workitem/10859)
+- Invalid results in formulas with named ranges - @MarkBaker [CodePlex #10629](https://phpexcel.codeplex.com/workitem/10629)
+
+## [1.7.0] - 2009-08-10
+
+### General
+
+- Expand documentation: Number formats - @Erik Tilt
+- Class 'PHPExcel_Cell_AdvancedValueBinder' not found - @Erik Tilt
+
+### Features
+
+- Change return type of date functions to PHPExcel_Calculation_Functions::RETURNDATE_EXCEL - @MarkBaker
+- New RPN and stack-based calculation engine for improved performance of formula calculation - @MarkBaker
+ - Faster (anything between 2 and 12 times faster than the old parser, depending on the complexity and nature of the formula)
+ - Significantly more memory efficient when formulae reference cells across worksheets
+ - Correct behaviour when referencing Named Ranges that exist on several worksheets
+ - Support for Excel ^ (Exponential) and % (Percentage) operators
+ - Support for matrices within basic arithmetic formulae (e.g. ={1,2,3;4,5,6;7,8,9}/2)
+ - Better trapping/handling of NaN and infinity results (return #NUM! error)
+ - Improved handling of empty parameters for Excel functions
+ - Optional logging of calculation steps- New calculation engine can be accessed independently of workbooks (for use as a standalone calculator) - @MarkBaker
+- Implement more Excel calculation functions - @MarkBaker
+ - Initial implementation of the COUNTIF() and SUMIF() Statistical functions
+ - Added ACCRINT() Financial function- Modifications to number format handling for dddd and ddd masks in dates, use of thousand separators even when locale only implements it for money, and basic fraction masks (0 ?/? and ?/?) - @MarkBaker
+- Support arbitrary fixed number of decimals in PHPExcel_Style_NumberFormat::toFormattedString() - @Erik Tilt
+- Improving performance and memory on data dumps - @Erik Tilt
+ - Various style optimizations (merging from branch wi6857-memory)
+ - Moving hyperlink and dataValidation properties from cell to worksheet for lower PHP memory usage- Provide fluent interfaces where possible - @MarkBaker
+- Make easy way to apply a border to a rectangular selection - @Erik Tilt
+- Support for system window colors in PHPExcel_Reader_Excel5 - @Erik Tilt
+- Horizontal center across selection - @Erik Tilt
+- Merged cells record, write to full record size in PHPExcel_Writer_Excel5 - @Erik Tilt
+- Add page break between sheets in exported PDF - @MarkBaker
+- Sanitization of UTF-8 input for cell values - @Erik Tilt
+- Read cached calculated value with PHPExcel_Reader_Excel5 - @Erik Tilt
+- Miscellaneous CSS improvements for PHPExcel_Writer_HTML - @Erik Tilt
+- getProperties: setCompany feature request - @Erik Tilt
+- Insert worksheet at a specified index - @MarkBaker
+- Change worksheet index - @MarkBaker
+- Readfilter for CSV reader - @MarkBaker
+- Check value of mbstring.func_overload when saving with PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #10172](https://phpexcel.codeplex.com/workitem/10172)
+- Eliminate dependency of an include path pointing to class directory - @Erik Tilt [CodePlex #10251](https://phpexcel.codeplex.com/workitem/10251)
+- Method for getting the correct reader for a certain file (contribution) - @Erik Tilt [CodePlex #10292](https://phpexcel.codeplex.com/workitem/10292)
+- Choosing specific row in fromArray method - @Erik Tilt [CodePlex #10287](https://phpexcel.codeplex.com/workitem/10287)
+- Shared formula support in PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #10319](https://phpexcel.codeplex.com/workitem/10319)
+
+### Bugfixes
+
+- Right-to-left column direction in worksheet - @MB,ET [CodePlex #10345](https://phpexcel.codeplex.com/workitem/10345)
+- PHPExcel_Reader_Excel5 not reading PHPExcel_Style_NumberFormat::FORMAT_NUMBER ('0') - @Erik Tilt
+- Fractional row height in locale other than English results in corrupt output using PHPExcel_Writer_Excel2007 - @Erik Tilt
+- Fractional (decimal) numbers not inserted correctly when locale is other than English - @Erik Tilt
+- Fractional calculated value in locale other than English results in corrupt output using PHPExcel_Writer_Excel2007 - @Erik Tilt
+- Locale aware decimal and thousands separator in exported formats HTML, CSV, PDF - @Erik Tilt
+- Cannot Add Image with Space on its Name - @MarkBaker
+- Black line at top of every page in output by PHPExcel_Writer_PDF - @Erik Tilt
+- Border styles and border colors not showing in HTML output (regression since 1.6.4) - @Erik Tilt
+- Hidden screen gridlines setting in worksheet not read by PHPExcel_Reader_Excel2007 - @Erik Tilt
+- Some valid sheet names causes corrupt output using PHPExcel_Writer_Excel2007 - @MarkBaker
+- More than 32,767 characters in a cell gives corrupt Excel file - @Erik Tilt
+- Images not getting copyied with the ->copy() function - @Erik Tilt
+- Bad calculation of column width setAutoSize(true) function - @Erik Tilt
+- Dates are sometimes offset by 1 day in output by HTML and PDF writers depending on system timezone setting - @Erik Tilt
+- Wingdings symbol fonts not working with PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #10003](https://phpexcel.codeplex.com/workitem/10003)
+- White space string prefix stripped by PHPExcel_Writer_Excel2007 - @MarkBaker [CodePlex #10010](https://phpexcel.codeplex.com/workitem/10010)
+- The name of the Workbook stream MUST be "Workbook", not "Book" - @Erik Tilt [CodePlex #10023](https://phpexcel.codeplex.com/workitem/10023)
+- Avoid message "Microsoft Excel recalculates formulas..." when closing xls file from Excel - @Erik Tilt [CodePlex #10030](https://phpexcel.codeplex.com/workitem/10030)
+- Non-unique newline representation causes problems with LEN formula - @Erik Tilt [CodePlex #10031](https://phpexcel.codeplex.com/workitem/10031)
+- Newline in cell not showing with PHPExcel_Writer_HTML and PHPExcel_Writer_PDF - @Erik Tilt [CodePlex #10033](https://phpexcel.codeplex.com/workitem/10033)
+- Rich-Text strings get prefixed by when output by HTML writer - @Erik Tilt [CodePlex #10046](https://phpexcel.codeplex.com/workitem/10046)
+- Leading spaces do not appear in output by HTML/PDF writers - @Erik Tilt [CodePlex #10052](https://phpexcel.codeplex.com/workitem/10052)
+- Empty Apache POI-generated file can not be read - @MarkBaker [CodePlex #10061](https://phpexcel.codeplex.com/workitem/10061)
+- Column width not scaling correctly with font size in HTML and PDF writers - @Erik Tilt [CodePlex #10068](https://phpexcel.codeplex.com/workitem/10068)
+- Inaccurate row heights with HTML writer - @Erik Tilt [CodePlex #10069](https://phpexcel.codeplex.com/workitem/10069)
+- Reference helper - @MarkBaker
+- Excel 5 Named ranges should not be local to the worksheet, but accessible from all worksheets - @MarkBaker
+- Row heights are ignored by PHPExcel_Writer_PDF - @Erik Tilt [CodePlex #10088](https://phpexcel.codeplex.com/workitem/10088)
+- Write raw XML - @MarkBaker
+- removeRow(), removeColumn() not always clearing cell values - @Erik Tilt [CodePlex #10098](https://phpexcel.codeplex.com/workitem/10098)
+- Problem reading certain hyperlink records with PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #10142](https://phpexcel.codeplex.com/workitem/10142)
+- Hyperlink cell range read failure with PHPExcel_Reader_Excel2007 - @Erik Tilt [CodePlex #10143](https://phpexcel.codeplex.com/workitem/10143)
+- 'Column string index can not be empty.' - @MarkBaker [CodePlex #10149](https://phpexcel.codeplex.com/workitem/10149)
+- getHighestColumn() sometimes says there are 256 columns with PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #10204](https://phpexcel.codeplex.com/workitem/10204)
+- extractSheetTitle fails when sheet title contains exclamation mark (!) - @Erik Tilt [CodePlex #10220](https://phpexcel.codeplex.com/workitem/10220)
+- setTitle() sometimes erroneously appends integer to sheet name - @Erik Tilt [CodePlex #10221](https://phpexcel.codeplex.com/workitem/10221)
+- Mac BIFF5 Excel file read failure (missing support for Mac OS Roman character set) - @Erik Tilt [CodePlex #10229](https://phpexcel.codeplex.com/workitem/10229)
+- BIFF5 header and footer incorrectly read by PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #10230](https://phpexcel.codeplex.com/workitem/10230)
+- iconv notices when reading hyperlinks with PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #10259](https://phpexcel.codeplex.com/workitem/10259)
+- Excel5 reader OLE read failure with small Mac BIFF5 Excel files - @Erik Tilt [CodePlex #10252](https://phpexcel.codeplex.com/workitem/10252)
+- Problem in reading formula : IF( IF ) with PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #10272](https://phpexcel.codeplex.com/workitem/10272)
+- Error reading formulas referencing external sheets with PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #10274](https://phpexcel.codeplex.com/workitem/10274)
+- Image horizontally stretched when default font size is increased (PHPExcel_Writer_Excel5) - @Erik Tilt [CodePlex #10291](https://phpexcel.codeplex.com/workitem/10291)
+- Undefined offset in Reader\Excel5.php on line 3572 - @Erik Tilt [CodePlex #10333](https://phpexcel.codeplex.com/workitem/10333)
+- PDF output different then XLS (copied data) - @MarkBaker [CodePlex #10340](https://phpexcel.codeplex.com/workitem/10340)
+- Internal hyperlinks with UTF-8 sheet names not working in PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #10352](https://phpexcel.codeplex.com/workitem/10352)
+- String shared formula result read error with PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #10361](https://phpexcel.codeplex.com/workitem/10361)
+- Uncaught exception 'Exception' with message 'Valid scale is between 10 and 400.' in Classes/PHPExcel/Worksheet/PageSetup.php:338 - @Erik Tilt [CodePlex #10363](https://phpexcel.codeplex.com/workitem/10363)
+- Using setLoadSheetsOnly fails if you do not use setReadDataOnly(true) and sheet is not the first sheet - @Erik Tilt [CodePlex #10355](https://phpexcel.codeplex.com/workitem/10355)
+- getCalculatedValue() sometimes incorrect with IF formula and 0-values - @MarkBaker [CodePlex #10362](https://phpexcel.codeplex.com/workitem/10362)
+- Excel Reader 2007 problem with "shared" formulae when "master" is an error - @MarkBaker
+- Named Range Bug, using the same range name on different worksheets - @MarkBaker
+- Java code in JAMA classes - @MarkBaker
+- getCalculatedValue() not working with some formulas involving error types - @MarkBaker
+- evaluation of both return values in an IF() statement returning an error if either result was an error, irrespective of the IF evaluation - @MarkBaker
+- Power in formulas: new calculation engine no longer treats ^ as a bitwise XOR operator - @MarkBaker
+- Bugfixes and improvements to many of the Excel functions in PHPExcel - @MarkBaker
+ - Added optional "places" parameter in the BIN2HEX(), BIN2OCT, DEC2BIN(), DEC2OCT(), DEC2HEX(), HEX2BIN(), HEX2OCT(), OCT2BIN() and OCT2HEX() Engineering Functions
+ - Trap for unbalanced matrix sizes in MDETERM() and MINVERSE() Mathematic and Trigonometric functions
+ - Fix for default characters parameter value for LEFT() and RIGHT() Text functions
+ - Fix for GCD() and LCB() Mathematical functions when the parameters include a zero (0) value
+ - Fix for BIN2OCT() Engineering Function for 2s complement values (which were returning hex values)
+ - Fix for BESSELK() and BESSELY() Engineering functions
+ - Fix for IMDIV() Engineering Function when result imaginary component is positive (wasn't setting the sign)
+ - Fix for ERF() Engineering Function when called with an upper limit value for the integration
+ - Fix to DATE() Date/Time Function for year value of 0
+ - Set ISPMT() function as category FINANCIAL
+ - Fix for DOLLARDE() and DOLLARFR() Financial functions
+ - Fix to EFFECT() Financial function (treating $nominal_rate value as a variable name rather than a value)
+ - Fix to CRITBINOM() Statistical function (CurrentValue and EssentiallyZero treated as constants rather than variables)
+ - Note that an Error in the function logic can still lead to a permanent loop
+ - Fix to MOD() Mathematical function to work with floating point results
+ - Fix for QUOTIENT() Mathematical function
+ - Fix to HOUR(), MINUTE() and SECOND() Date/Time functions to return an error when passing in a floating point value of 1.0 or greater, or less than 0
+ - LOG() Function now correctly returns base-10 log when called with only one parameter, rather than the natural log as the default base
+ - Modified text functions to handle multibyte character set (UTF-8).
+
+## [1.6.7] - 2009-04-22
+
+### BREAKING CHANGE
+
+In previous versions of PHPExcel up to and including 1.6.6,
+when a cell had a date-like number format code, it was possible to enter a date
+directly using an integer PHP-time without converting to Excel date format.
+Starting with PHPExcel 1.6.7 this is no longer supported. Refer to the developer
+documentation for more information on entering dates into a cell.
+
+### General
+
+- Deprecate misspelled setStriketrough() and getStriketrough() methods - @MarkBaker [CodePlex #9416](https://phpexcel.codeplex.com/workitem/9416)
+
+### Features
+
+- Performance improvement when saving file - @MarkBaker [CodePlex #9526](https://phpexcel.codeplex.com/workitem/9526)
+- Check that sheet title has maximum 31 characters - @MarkBaker [CodePlex #9598](https://phpexcel.codeplex.com/workitem/9598)
+- True support for Excel built-in number format codes - @MB, ET [CodePlex #9631](https://phpexcel.codeplex.com/workitem/9631)
+- Ability to read defect BIFF5 Excel file without CODEPAGE record - @Erik Tilt [CodePlex #9683](https://phpexcel.codeplex.com/workitem/9683)
+- Auto-detect which reader to invoke - @MarkBaker [CodePlex #9701](https://phpexcel.codeplex.com/workitem/9701)
+- Deprecate insertion of dates using PHP-time (Unix time) [request for removal of feature] - @Erik Tilt [CodePlex #9214](https://phpexcel.codeplex.com/workitem/9214)
+- Support for entering time values like '9:45', '09:45' using AdvancedValueBinder - @Erik Tilt [CodePlex #9747](https://phpexcel.codeplex.com/workitem/9747)
+
+### Bugfixes
+
+- DataType dependent horizontal alignment in HTML and PDF writer - @Erik Tilt [CodePlex #9797](https://phpexcel.codeplex.com/workitem/9797)
+- Cloning data validation object causes script to stop - @MarkBaker [CodePlex #9375](https://phpexcel.codeplex.com/workitem/9375)
+- Simultaneous repeating rows and repeating columns not working with PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #9400](https://phpexcel.codeplex.com/workitem/9400)
+- Simultaneous repeating rows and repeating columns not working with PHPExcel_Writer_Excel2007 - @MarkBaker [CodePlex #9399](https://phpexcel.codeplex.com/workitem/9399)
+- Row outline level not working with PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #9437](https://phpexcel.codeplex.com/workitem/9437)
+- Occasional notices with PHPExcel_Reader_Excel5 when Excel file contains drawing elements - @Erik Tilt [CodePlex #9452](https://phpexcel.codeplex.com/workitem/9452)
+- PHPExcel_Reader_Excel5 fails as a whole when workbook contains images other than JPEG/PNG - @Erik Tilt [CodePlex #9453](https://phpexcel.codeplex.com/workitem/9453)
+- Excel5 writer checks for iconv but does not necessarily use it - @Erik Tilt [CodePlex #9444](https://phpexcel.codeplex.com/workitem/9444)
+- Altering a style on copied worksheet alters also the original - @Erik Tilt [CodePlex #9463](https://phpexcel.codeplex.com/workitem/9463)
+- Formulas are incorrectly updated when a sheet is renamed - @MarkBaker [CodePlex #9480](https://phpexcel.codeplex.com/workitem/9480)
+- PHPExcel_Worksheet::extractSheetTitle not treating single quotes correctly - @MarkBaker [CodePlex #9513](https://phpexcel.codeplex.com/workitem/9513)
+- PHP Warning raised in function array_key_exists - @MarkBaker [CodePlex #9477](https://phpexcel.codeplex.com/workitem/9477)
+- getAlignWithMargins() gives wrong value when using PHPExcel_Reader_Excel2007 - @MarkBaker [CodePlex #9599](https://phpexcel.codeplex.com/workitem/9599)
+- getScaleWithDocument() gives wrong value when using PHPExcel_Reader_Excel2007 - @MarkBaker [CodePlex #9600](https://phpexcel.codeplex.com/workitem/9600)
+- PHPExcel_Reader_Excel2007 not reading the first user-defined number format - @MarkBaker [CodePlex #9630](https://phpexcel.codeplex.com/workitem/9630)
+- Print area converted to uppercase after read with PHPExcel_Reader_Excel2007 - @MarkBaker [CodePlex #9647](https://phpexcel.codeplex.com/workitem/9647)
+- Incorrect reading of scope for named range using PHPExcel_Reader_Excel2007 - @MarkBaker [CodePlex #9661](https://phpexcel.codeplex.com/workitem/9661)
+- Error with pattern (getFillType) and rbg (getRGB) - @MarkBaker [CodePlex #9690](https://phpexcel.codeplex.com/workitem/9690)
+- AdvancedValueBinder affected by system timezone setting when inserting date values - @Erik Tilt [CodePlex #9712](https://phpexcel.codeplex.com/workitem/9712)
+- PHPExcel_Reader_Excel2007 not reading value of active sheet index - @Erik Tilt [CodePlex #9743](https://phpexcel.codeplex.com/workitem/9743)
+- getARGB() sometimes returns SimpleXMLElement object instead of string with PHPExcel_Reader_Excel2007 - @Erik Tilt [CodePlex #9742](https://phpexcel.codeplex.com/workitem/9742)
+- Negative image offset causes defects in 14excel5.xls and 20readexcel5.xlsx - @Erik Tilt [CodePlex #9731](https://phpexcel.codeplex.com/workitem/9731)
+- HTML & PDF Writer not working with mergeCells (regression since 1.6.5) - @Erik Tilt [CodePlex #9758](https://phpexcel.codeplex.com/workitem/9758)
+- Too wide columns with HTML and PDF writer - @Erik Tilt [CodePlex #9774](https://phpexcel.codeplex.com/workitem/9774)
+- PDF and cyrillic fonts - @MarkBaker [CodePlex #9775](https://phpexcel.codeplex.com/workitem/9775)
+- Percentages not working correctly with HTML and PDF writers (shows 0.25% instead of 25%) - @Erik Tilt [CodePlex #9793](https://phpexcel.codeplex.com/workitem/9793)
+- PHPExcel_Writer_HTML creates extra borders around cell contents using setUseInlineCss(true) - @Erik Tilt [CodePlex #9791](https://phpexcel.codeplex.com/workitem/9791)
+- Problem with text wrap + merged cells in HTML and PDF writer - @Erik Tilt [CodePlex #9784](https://phpexcel.codeplex.com/workitem/9784)
+- Adjacent path separators in include_path causing IOFactory to violate open_basedir restriction - @Erik Tilt [CodePlex #9814](https://phpexcel.codeplex.com/workitem/9814)
+
+## [1.6.6] - 2009-03-02
+
+### General
+
+- Improve support for built-in number formats in PHPExcel_Reader_Excel2007 - @MarkBaker [CodePlex #9102](https://phpexcel.codeplex.com/workitem/9102)
+- Source files are in both UNIX and DOS formats - changed to UNIX - @Erik Tilt [CodePlex #9281](https://phpexcel.codeplex.com/workitem/9281)
+
+### Features
+
+- Update documentation: Which language to write formulas in? - @MarkBaker [CodePlex #9338](https://phpexcel.codeplex.com/workitem/9338)
+- Ignore DEFCOLWIDTH records with value 8 in PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #8817](https://phpexcel.codeplex.com/workitem/8817)
+- Support for width, height, offsetX, offsetY for images in PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #8847](https://phpexcel.codeplex.com/workitem/8847)
+- Disk Caching in specific folder - @MarkBaker [CodePlex #8870](https://phpexcel.codeplex.com/workitem/8870)
+- Added SUMX2MY2, SUMX2PY2, SUMXMY2, MDETERM and MINVERSE Mathematical and Trigonometric Functions - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Added CONVERT Engineering Function - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Added DB, DDB, DISC, DOLLARDE, DOLLARFR, INTRATE, IPMT, PPMT, PRICEDISC, PRICEMAT and RECEIVED Financial Functions - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Added ACCRINTM, CUMIPMT, CUMPRINC, TBILLEQ, TBILLPRICE, TBILLYIELD, YIELDDISC and YIELDMAT Financial Functions - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Added DOLLAR Text Function - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Added CORREL, COVAR, FORECAST, INTERCEPT, RSQ, SLOPE and STEYX Statistical Functions - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Added PEARSON Statistical Functions as a synonym for CORREL - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Added LINEST, LOGEST (currently only valid for stats = false), TREND and GROWTH Statistical Functions - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Added RANK and PERCENTRANK Statistical Functions - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Added ROMAN Mathematical Function (Classic form only) - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Update documentation to show example of getCellByColumnAndRow($col, $row) - @MarkBaker [CodePlex #8931](https://phpexcel.codeplex.com/workitem/8931)
+- Implement worksheet, row and cell iterators - @MarkBaker [CodePlex #8770](https://phpexcel.codeplex.com/workitem/8770)
+- Support for arbitrary defined names (named range) - @MarkBaker [CodePlex #9001](https://phpexcel.codeplex.com/workitem/9001)
+- Update formulas when sheet title / named range title changes - @MB, ET [CodePlex #9016](https://phpexcel.codeplex.com/workitem/9016)
+- Ability to read cached calculated value - @MarkBaker [CodePlex #9103](https://phpexcel.codeplex.com/workitem/9103)
+- Support for Excel 1904 calendar date mode (Mac) - @MBaker, ET [CodePlex #8483](https://phpexcel.codeplex.com/workitem/8483)
+- PHPExcel_Writer_Excel5 improvements writing shared strings table - @Erik Tilt [CodePlex #9194](https://phpexcel.codeplex.com/workitem/9194)
+- PHPExcel_Writer_Excel5 iconv fallback when mbstring extension is not enabled - @Erik Tilt [CodePlex #9248](https://phpexcel.codeplex.com/workitem/9248)
+- UTF-8 support in font names in PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #9253](https://phpexcel.codeplex.com/workitem/9253)
+- Implement value binding architecture - @MarkBaker [CodePlex #9215](https://phpexcel.codeplex.com/workitem/9215)
+- PDF writer not working with UTF-8 - @MarkBaker [CodePlex #6742](https://phpexcel.codeplex.com/workitem/6742)
+
+### Bugfixes
+
+- Eliminate duplicate style entries in multisheet workbook written by PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #9355](https://phpexcel.codeplex.com/workitem/9355)
+- Redirect to client browser fails due to trailing white space in class definitions - @Erik Tilt [CodePlex #8810](https://phpexcel.codeplex.com/workitem/8810)
+- Spurious column dimension element introduced in blank worksheet after using PHPExcel_Writer_Excel2007 - @MarkBaker [CodePlex #8816](https://phpexcel.codeplex.com/workitem/8816)
+- Image gets slightly narrower than expected when using PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #8830](https://phpexcel.codeplex.com/workitem/8830)
+- Image laid over non-visible row gets squeezed in height when using PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #8831](https://phpexcel.codeplex.com/workitem/8831)
+- PHPExcel_Reader_Excel5 fails when there are 10 or more images in the workbook - @Erik Tilt [CodePlex #8860](https://phpexcel.codeplex.com/workitem/8860)
+- Different header/footer images in different sheets not working with PHPExcel_Writer_Excel2007 - @MarkBaker [CodePlex #8909](https://phpexcel.codeplex.com/workitem/8909)
+- Fractional seconds disappear when using PHPExcel_Reader_Excel2007 and PHPExcel_Reader_Excel5 - @MB, ET [CodePlex #8924](https://phpexcel.codeplex.com/workitem/8924)
+- Images not showing in OpenOffice when using PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #7994](https://phpexcel.codeplex.com/workitem/7994)
+- Images not showing on print using PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #9047](https://phpexcel.codeplex.com/workitem/9047)
+- PHPExcel_Writer_Excel5 maximum allowed record size 4 bytes too short - @Erik Tilt [CodePlex #9085](https://phpexcel.codeplex.com/workitem/9085)
+- Not numeric strings are formatted as dates and numbers using worksheet's toArray method - @MarkBaker [CodePlex #9119](https://phpexcel.codeplex.com/workitem/9119)
+- Excel5 simple formula parsing error - @Erik Tilt [CodePlex #9132](https://phpexcel.codeplex.com/workitem/9132)
+- Problems writing dates with CSV - @Erik Tilt [CodePlex #9206](https://phpexcel.codeplex.com/workitem/9206)
+- PHPExcel_Reader_Excel5 reader fails with fatal error when reading group shapes - @Erik Tilt [CodePlex #9203](https://phpexcel.codeplex.com/workitem/9203)
+- PHPExcel_Writer_Excel5 fails completely when workbook contains more than 57 colors - @Erik Tilt [CodePlex #9231](https://phpexcel.codeplex.com/workitem/9231)
+- PHPExcel_Writer_PDF not compatible with autoload - @Erik Tilt [CodePlex #9244](https://phpexcel.codeplex.com/workitem/9244)
+- Fatal error: Call to a member function getNestingLevel() on a non-object in PHPExcel/Reader/Excel5.php on line 690 - @Erik Tilt [CodePlex #9250](https://phpexcel.codeplex.com/workitem/9250)
+- Notices when running test 04printing.php on PHP 5.2.8 - @MarkBaker [CodePlex #9246](https://phpexcel.codeplex.com/workitem/9246)
+- insertColumn() spawns creation of spurious RowDimension - @MarkBaker [CodePlex #9294](https://phpexcel.codeplex.com/workitem/9294)
+- Fix declarations for methods in extended Trend classes - @MarkBaker [CodePlex #9296](https://phpexcel.codeplex.com/workitem/9296)
+- Fix to parameters for the FORECAST Statistical Function - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- PDF writer problems with cell height and text wrapping - @MarkBaker [CodePlex #7083](https://phpexcel.codeplex.com/workitem/7083)
+- Fix test for calculated value in case the returned result is an array - @MarkBaker
+- Column greater than 256 results in corrupt Excel file using PHPExcel_Writer_Excel5 - @Erik Tilt
+- Excel Numberformat 0.00 results in non internal decimal places values in toArray() Method - @MarkBaker [CodePlex #9351](https://phpexcel.codeplex.com/workitem/9351)
+- setAutoSize not taking into account text rotation - @MB,ET [CodePlex #9356](https://phpexcel.codeplex.com/workitem/9356)
+- Call to undefined method PHPExcel_Worksheet_MemoryDrawing::getPath() in PHPExcel/Writer/HTML.php - @Erik Tilt [CodePlex #9372](https://phpexcel.codeplex.com/workitem/9372)
+
+## [1.6.5] - 2009-01-05
+
+### General
+
+- Applied patch 2063 - @MarkBaker
+- Optimise Shared Strings - @MarkBaker
+- Optimise Cell Sorting - @MarkBaker
+- Optimise Style Hashing - @MarkBaker
+- UTF-8 enhancements - @Erik Tilt
+- PHPExcel_Writer_HTML validation errors against strict HTML 4.01 / CSS 2.1 - @Erik Tilt
+- Documented work items 6203 and 8110 in manual - @MarkBaker
+- Restructure package hierachy so classes can be found more easily in auto-generated API (from work item 8468) - @Erik Tilt
+
+### Features
+
+- Redirect output to a client's browser: Update recommendation in documentation - @MarkBaker [CodePlex #8806](https://phpexcel.codeplex.com/workitem/8806)
+- PHPExcel_Reader_Excel5 support for print gridlines - @Erik Tilt [CodePlex #7897](https://phpexcel.codeplex.com/workitem/7897)
+- Screen gridlines support in Excel5 reader/writer - @Erik Tilt [CodePlex #7899](https://phpexcel.codeplex.com/workitem/7899)
+- Option for adding image to spreadsheet from image resource in memory - @MB, ET [CodePlex #7552](https://phpexcel.codeplex.com/workitem/7552)
+- PHPExcel_Reader_Excel5 style support for BIFF5 files (Excel 5.0 - Excel 95) - @Erik Tilt [CodePlex #7862](https://phpexcel.codeplex.com/workitem/7862)
+- PHPExcel_Reader_Excel5 support for user-defined colors and special built-in colors - @Erik Tilt [CodePlex #7918](https://phpexcel.codeplex.com/workitem/7918)
+- Support for freeze panes in PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #7992](https://phpexcel.codeplex.com/workitem/7992)
+- Support for header and footer margins in PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #7996](https://phpexcel.codeplex.com/workitem/7996)
+- Support for active sheet index in Excel5 reader/writer - @Erik Tilt [CodePlex #7997](https://phpexcel.codeplex.com/workitem/7997)
+- Freeze panes not read by PHPExcel_Reader_Excel2007 - @MarkBaker [CodePlex #7991](https://phpexcel.codeplex.com/workitem/7991)
+- Support for screen zoom level (feature request) - @MB, ET [CodePlex #7993](https://phpexcel.codeplex.com/workitem/7993)
+- Support for default style in PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #8012](https://phpexcel.codeplex.com/workitem/8012)
+- Apple iWork / Numbers.app incompatibility - @MarkBaker [CodePlex #8094](https://phpexcel.codeplex.com/workitem/8094)
+- Support "between rule" in conditional formatting - @MarkBaker [CodePlex #7931](https://phpexcel.codeplex.com/workitem/7931)
+- Comment size, width and height control (feature request) - @MarkBaker [CodePlex #8308](https://phpexcel.codeplex.com/workitem/8308)
+- Improve method for storing MERGEDCELLS records in PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #8418](https://phpexcel.codeplex.com/workitem/8418)
+- Support for protectCells() in Excel5 reader/writer - @Erik Tilt [CodePlex #8435](https://phpexcel.codeplex.com/workitem/8435)
+- Support for fitToWidth and fitToHeight pagesetup properties in PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #8472](https://phpexcel.codeplex.com/workitem/8472)
+- Support for setShowSummaryBelow() and setShowSummaryRight() in PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #8489](https://phpexcel.codeplex.com/workitem/8489)
+- Support for Excel 1904 calendar date mode (Mac) - @MarkBaker [CodePlex #8483](https://phpexcel.codeplex.com/workitem/8483)
+- Excel5 reader: Support for reading images (bitmaps) - @Erik Tilt [CodePlex #7538](https://phpexcel.codeplex.com/workitem/7538)
+- Support for default style in PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #8787](https://phpexcel.codeplex.com/workitem/8787)
+- Modified calculate() method to return either an array or the first value from the array for those functions that return arrays rather than single values (e.g the MMULT and TRANSPOSE function). This performance can be modified based on the $returnArrayAsType which can be set/retrieved by calling the setArrayReturnType() and getArrayReturnType() methods of the PHPExcel_Calculation class. - @MarkBaker
+
+### Bugfixes
+
+- Added ERROR.TYPE Information Function, MMULT Mathematical and Trigonometry Function, and TRANSPOSE Lookup and Reference Function - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- setPrintGridlines(true) not working with PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #7896](https://phpexcel.codeplex.com/workitem/7896)
+- Incorrect mapping of fill patterns in PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #7907](https://phpexcel.codeplex.com/workitem/7907)
+- setShowGridlines(false) not working with PHPExcel_Writer_Excel2007 - @MarkBaker [CodePlex #7898](https://phpexcel.codeplex.com/workitem/7898)
+- getShowGridlines() gives inverted value when reading sheet with PHPExcel_Reader_Excel2007 - @MarkBaker [CodePlex #7905](https://phpexcel.codeplex.com/workitem/7905)
+- User-defined column width becomes slightly larger after read/write with Excel5 - @Erik Tilt [CodePlex #7944](https://phpexcel.codeplex.com/workitem/7944)
+- Incomplete border style support in PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #7949](https://phpexcel.codeplex.com/workitem/7949)
+- Conditional formatting "containsText" read/write results in MS Office Excel 2007 crash - @MarkBaker [CodePlex #7928](https://phpexcel.codeplex.com/workitem/7928)
+- All sheets are always selected in output when using PHPExcel_Writer_Excel2007 - @MarkBaker [CodePlex #7995](https://phpexcel.codeplex.com/workitem/7995)
+- COLUMN function warning message during plain read/write - @MarkBaker [CodePlex #8013](https://phpexcel.codeplex.com/workitem/8013)
+- setValue(0) results in string data type '0' - @MarkBaker [CodePlex #8155](https://phpexcel.codeplex.com/workitem/8155)
+- Styles not removed when removing rows from sheet - @MarkBaker [CodePlex #8226](https://phpexcel.codeplex.com/workitem/8226)
+- =IF formula causes fatal error during $objWriter->save() in Excel2007 format - @MarkBaker [CodePlex #8301](https://phpexcel.codeplex.com/workitem/8301)
+- Exception thrown reading valid xls file: "Excel file is corrupt. Didn't find CONTINUE record while reading shared strings" - @Erik Tilt [CodePlex #8333](https://phpexcel.codeplex.com/workitem/8333)
+- MS Outlook corrupts files generated by PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #8320](https://phpexcel.codeplex.com/workitem/8320)
+- Undefined method PHPExcel_Worksheet::setFreezePane() in ReferenceHelper.php on line 271 - @MarkBaker [CodePlex #8351](https://phpexcel.codeplex.com/workitem/8351)
+- Ampersands (&), left and right angles (<, >) in Rich-Text strings leads to corrupt output using PHPExcel_Writer_Excel2007 - @MarkBaker [CodePlex #8401](https://phpexcel.codeplex.com/workitem/8401)
+- Print header and footer not supporting UTF-8 in PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #8408](https://phpexcel.codeplex.com/workitem/8408)
+- Vertical page breaks not working with PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #8463](https://phpexcel.codeplex.com/workitem/8463)
+- Missing support for accounting underline types in PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #8476](https://phpexcel.codeplex.com/workitem/8476)
+- Infinite loops when reading corrupt xls file using PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #8482](https://phpexcel.codeplex.com/workitem/8482)
+- Sheet protection password not working with PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #8566](https://phpexcel.codeplex.com/workitem/8566)
+- PHPExcel_Style_NumberFormat::FORMAT_NUMBER ignored by PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #8596](https://phpexcel.codeplex.com/workitem/8596)
+- PHPExcel_Reader_Excel5 fails a whole when workbook contains a chart - @Erik Tilt [CodePlex #8781](https://phpexcel.codeplex.com/workitem/8781)
+- Occasional loss of column widths using PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #8788](https://phpexcel.codeplex.com/workitem/8788)
+- Notices while reading formulas with deleted sheet references using PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #8795](https://phpexcel.codeplex.com/workitem/8795)
+- Default style not read by PHPExcel_Reader_Excel2007 - @MarkBaker [CodePlex #8807](https://phpexcel.codeplex.com/workitem/8807)
+- Blank rows occupy too much space in file generated by PHPExcel_Writer_Excel2007 - @MarkBaker [CodePlex #9341](https://phpexcel.codeplex.com/workitem/9341)
+
+## [1.6.4] - 2008-10-27
+
+### Features
+
+- RK record number error in MS developer documentation: 0x007E should be 0x027E - @Erik Tilt [CodePlex #7882](https://phpexcel.codeplex.com/workitem/7882)
+- getHighestColumn() returning "@" for blank worksheet causes corrupt output - @MarkBaker [CodePlex #7878](https://phpexcel.codeplex.com/workitem/7878)
+- Implement ROW and COLUMN Lookup/Reference Functions (when specified with a parameter) - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Implement initial work on OFFSET Lookup/Reference Function (returning address rather than value at address) - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Excel5 reader: Page margins - @Erik Tilt [CodePlex #7416](https://phpexcel.codeplex.com/workitem/7416)
+- Excel5 reader: Header & Footer - @Erik Tilt [CodePlex #7417](https://phpexcel.codeplex.com/workitem/7417)
+- Excel5 reader support for page setup (paper size etc.) - @Erik Tilt [CodePlex #7449](https://phpexcel.codeplex.com/workitem/7449)
+- Improve speed and memory consumption of PHPExcel_Writer_CSV - @MarkBaker [CodePlex #7445](https://phpexcel.codeplex.com/workitem/7445)
+- Better recognition of number format in HTML, CSV, and PDF writer - @MarkBaker [CodePlex #7432](https://phpexcel.codeplex.com/workitem/7432)
+- Font support: Superscript and Subscript - @MarkBaker [CodePlex #7485](https://phpexcel.codeplex.com/workitem/7485)
+- Excel5 reader font support: Super- and subscript - @Erik Tilt [CodePlex #7509](https://phpexcel.codeplex.com/workitem/7509)
+- Excel5 reader style support: Text rotation and stacked text - @Erik Tilt [CodePlex #7521](https://phpexcel.codeplex.com/workitem/7521)
+- Excel5 reader: Support for hyperlinks - @Erik Tilt [CodePlex #7530](https://phpexcel.codeplex.com/workitem/7530)
+- Import sheet by request - @MB, ET [CodePlex #7557](https://phpexcel.codeplex.com/workitem/7557)
+- PHPExcel_Reader_Excel5 support for page breaks - @Erik Tilt [CodePlex #7607](https://phpexcel.codeplex.com/workitem/7607)
+- PHPExcel_Reader_Excel5 support for shrink-to-fit - @Erik Tilt [CodePlex #7622](https://phpexcel.codeplex.com/workitem/7622)
+- Support for error types - @MB, ET [CodePlex #7675](https://phpexcel.codeplex.com/workitem/7675)
+- Excel5 reader true formula support - @Erik Tilt [CodePlex #7388](https://phpexcel.codeplex.com/workitem/7388)
+- Support for named ranges (defined names) in PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #7701](https://phpexcel.codeplex.com/workitem/7701)
+- Support for repeating rows and repeating columns (print titles) in PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #7781](https://phpexcel.codeplex.com/workitem/7781)
+- Support for print area in PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #7783](https://phpexcel.codeplex.com/workitem/7783)
+- Excel5 reader and writer support for horizontal and vertical centering of page - @Erik Tilt [CodePlex #7795](https://phpexcel.codeplex.com/workitem/7795)
+- Applied patch 1962 - @MarkBaker
+- Excel5 reader and writer support for hidden cells (formulas) - @Erik Tilt [CodePlex #7866](https://phpexcel.codeplex.com/workitem/7866)
+- Support for indentation in cells (feature request) - @MB, ET [CodePlex #7612](https://phpexcel.codeplex.com/workitem/7612)
+
+### Bugfixes
+
+- Option for reading only specified interval of rows in a sheet - @MB, ET [CodePlex #7828](https://phpexcel.codeplex.com/workitem/7828)
+- PHPExcel_Calculation_Functions::DATETIMENOW() and PHPExcel_Calculation_Functions::DATENOW() to force UTC - @MarkBaker [CodePlex #7367](https://phpexcel.codeplex.com/workitem/7367)
+- Modified PHPExcel_Shared_Date::FormattedPHPToExcel() and PHPExcel_Shared_Date::ExcelToPHP to force datatype for return values - @MarkBaker [CodePlex #7395](https://phpexcel.codeplex.com/workitem/7395)
+- Excel5 reader not producing UTF-8 strings with BIFF5 files - @Erik Tilt [CodePlex #7450](https://phpexcel.codeplex.com/workitem/7450)
+- Array constant in formula gives run-time notice with Excel2007 writer - @MarkBaker [CodePlex #7470](https://phpexcel.codeplex.com/workitem/7470)
+- PHPExcel_Reader_Excel2007 setReadDataOnly(true) returns Rich-Text - @MarkBaker [CodePlex #7494](https://phpexcel.codeplex.com/workitem/7494)
+- PHPExcel_Reader_Excel5 setReadDataOnly(true) returns Rich-Text - @Erik Tilt [CodePlex #7496](https://phpexcel.codeplex.com/workitem/7496)
+- Characters before superscript or subscript losing style - @MarkBaker [CodePlex #7497](https://phpexcel.codeplex.com/workitem/7497)
+- Subscript not working with HTML writer - @MarkBaker [CodePlex #7507](https://phpexcel.codeplex.com/workitem/7507)
+- DefaultColumnDimension not working on first column (A) - @MarkBaker [CodePlex #7508](https://phpexcel.codeplex.com/workitem/7508)
+- Negative numbers are stored as text in PHPExcel_Writer_2007 - @MarkBaker [CodePlex #7527](https://phpexcel.codeplex.com/workitem/7527)
+- Text rotation and stacked text not working with PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #7531](https://phpexcel.codeplex.com/workitem/7531)
+- PHPExcel_Shared_Date::isDateTimeFormatCode erroneously says true - @MarkBaker [CodePlex #7536](https://phpexcel.codeplex.com/workitem/7536)
+- Different images with same filename in separate directories become duplicates - @MarkBaker [CodePlex #7559](https://phpexcel.codeplex.com/workitem/7559)
+- PHPExcel_Reader_Excel5 not returning sheet names as UTF-8 using for Excel 95 files - @Erik Tilt [CodePlex #7568](https://phpexcel.codeplex.com/workitem/7568)
+- setAutoSize(true) on empty column gives column width of 10 using PHPExcel_Writer_Excel2007 - @MarkBaker [CodePlex #7575](https://phpexcel.codeplex.com/workitem/7575)
+- setAutoSize(true) on empty column gives column width of 255 using PHPExcel_Writer_Excel5 - @MB, ET [CodePlex #7573](https://phpexcel.codeplex.com/workitem/7573)
+- Worksheet_Drawing bug - @MarkBaker [CodePlex #7514](https://phpexcel.codeplex.com/workitem/7514)
+- getCalculatedValue() with REPT function causes script to stop - @MarkBaker [CodePlex #7593](https://phpexcel.codeplex.com/workitem/7593)
+- getCalculatedValue() with LEN function causes script to stop - @MarkBaker [CodePlex #7594](https://phpexcel.codeplex.com/workitem/7594)
+- Explicit fit-to-width (page setup) results in fit-to-height becoming 1 - @MarkBaker [CodePlex #7600](https://phpexcel.codeplex.com/workitem/7600)
+- Fit-to-width value of 1 is lost after read/write of Excel2007 spreadsheet - @MarkBaker [CodePlex #7610](https://phpexcel.codeplex.com/workitem/7610)
+- Conditional styles not read properly using PHPExcel_Reader_Excel2007 - @MarkBaker [CodePlex #7516](https://phpexcel.codeplex.com/workitem/7516)
+- PHPExcel_Writer_2007: Default worksheet style works only for first sheet - @MarkBaker [CodePlex #7611](https://phpexcel.codeplex.com/workitem/7611)
+- Cannot Lock Cells using PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #6940](https://phpexcel.codeplex.com/workitem/6940)
+- Incorrect cell protection values found when using Excel5 reader - @Erik Tilt [CodePlex #7621](https://phpexcel.codeplex.com/workitem/7621)
+- Default row height not working above highest row using PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #7623](https://phpexcel.codeplex.com/workitem/7623)
+- Default column width does not get applied when using PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #7637](https://phpexcel.codeplex.com/workitem/7637)
+- Broken support for UTF-8 string formula results in PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #7642](https://phpexcel.codeplex.com/workitem/7642)
+- UTF-8 sheet names not working with PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #7643](https://phpexcel.codeplex.com/workitem/7643)
+- getCalculatedValue() with ISNONTEXT function causes script to stop - @MarkBaker [CodePlex #7631](https://phpexcel.codeplex.com/workitem/7631)
+- Missing BIFF3 functions in PHPExcel_Writer_Excel5: USDOLLAR (YEN), FINDB, SEARCHB, REPLACEB, LEFTB, RIGHTB, MIDB, LENB, ASC, DBCS (JIS) - @Erik Tilt [CodePlex #7652](https://phpexcel.codeplex.com/workitem/7652)
+- Excel5 reader doesn't read numbers correctly in 64-bit systems - @Erik Tilt [CodePlex #7663](https://phpexcel.codeplex.com/workitem/7663)
+- Missing BIFF5 functions in PHPExcel_Writer_Excel5: ISPMT, DATEDIF, DATESTRING, NUMBERSTRING - @Erik Tilt [CodePlex #7667](https://phpexcel.codeplex.com/workitem/7667)
+- Missing BIFF8 functions in PHPExcel_Writer_Excel5: GETPIVOTDATA, HYPERLINK, PHONETIC, AVERAGEA, MAXA, MINA, STDEVPA, VARPA, STDEVA, VARA - @Erik Tilt [CodePlex #7668](https://phpexcel.codeplex.com/workitem/7668)
+- Wrong host value in PHPExcel_Shared_ZipStreamWrapper::stream_open() - @MarkBaker [CodePlex #7657](https://phpexcel.codeplex.com/workitem/7657)
+- PHPExcel_Reader_Excel5 not reading explicitly entered error types in cells - @Erik Tilt [CodePlex #7676](https://phpexcel.codeplex.com/workitem/7676)
+- Boolean and error data types not preserved for formula results in PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #7678](https://phpexcel.codeplex.com/workitem/7678)
+- PHPExcel_Reader_Excel2007 ignores cell data type - @MarkBaker [CodePlex #7695](https://phpexcel.codeplex.com/workitem/7695)
+- PHPExcel_Reader_Excel5 ignores cell data type - @Erik Tilt [CodePlex #7712](https://phpexcel.codeplex.com/workitem/7712)
+- PHPExcel_Writer_Excel5 not aware of data type - @Erik Tilt [CodePlex #7587](https://phpexcel.codeplex.com/workitem/7587)
+- Long strings sometimes truncated when using PHPExcel_Reader_Excel5 - @Erik Tilt [CodePlex #7713](https://phpexcel.codeplex.com/workitem/7713)
+- Direct entry of boolean or error type in cell not supported by PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #7727](https://phpexcel.codeplex.com/workitem/7727)
+- PHPExcel_Reader_Excel2007: Error reading cell with data type string, date number format, and numeric-like cell value - @MarkBaker [CodePlex #7714](https://phpexcel.codeplex.com/workitem/7714)
+- Row and column outlines (group indent level) not showing after using PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #7735](https://phpexcel.codeplex.com/workitem/7735)
+- Missing UTF-8 support in number format codes for PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #7737](https://phpexcel.codeplex.com/workitem/7737)
+- Missing UTF-8 support with PHPExcel_Writer_Excel5 for explicit string in formula - @Erik Tilt [CodePlex #7750](https://phpexcel.codeplex.com/workitem/7750)
+- Problem with class constants in PHPExcel_Style_NumberFormat - @MarkBaker [CodePlex #7726](https://phpexcel.codeplex.com/workitem/7726)
+- Sometimes errors with PHPExcel_Reader_Excel5 reading hyperlinks - @Erik Tilt [CodePlex #7758](https://phpexcel.codeplex.com/workitem/7758)
+- Hyperlink in cell always results in string data type when using PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #7759](https://phpexcel.codeplex.com/workitem/7759)
+- Excel file with blank sheet seen as broken in MS Office Excel 2007 when created by PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #7771](https://phpexcel.codeplex.com/workitem/7771)
+- PHPExcel_Reader_Excel5: Incorrect reading of formula with explicit string containing (escaped) double-quote - @Erik Tilt [CodePlex #7785](https://phpexcel.codeplex.com/workitem/7785)
+- getCalculatedValue() fails on formula with sheet name containing (escaped) single-quote - @MarkBaker [CodePlex #7787](https://phpexcel.codeplex.com/workitem/7787)
+- getCalculatedValue() fails on formula with explicit string containing (escaped) double-quote - @MarkBaker [CodePlex #7786](https://phpexcel.codeplex.com/workitem/7786)
+- Problems with simultaneous repeatRowsAtTop and repeatColumnsAtLeft using Excel2007 reader and writer - @MarkBaker [CodePlex #7780](https://phpexcel.codeplex.com/workitem/7780)
+- PHPExcel_Reader_Excel5: Error reading formulas with sheet reference containing special characters - @Erik Tilt [CodePlex #7802](https://phpexcel.codeplex.com/workitem/7802)
+- Off-sheet references sheet!A1 not working with PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #7831](https://phpexcel.codeplex.com/workitem/7831)
+- Repeating rows/columns (print titles), print area not working with PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #7834](https://phpexcel.codeplex.com/workitem/7834)
+- Formula having datetime number format shows as text when using PHPExcel_Writer_Excel5 - @Erik Tilt [CodePlex #7849](https://phpexcel.codeplex.com/workitem/7849)
+- Cannot set formula to hidden using applyFromArray() - @MarkBaker [CodePlex #7863](https://phpexcel.codeplex.com/workitem/7863)
+- HTML/PDF Writers limited to 26 columns by calculateWorksheetDimension (erroneous comparison in getHighestColumn() method) - @MarkBaker [CodePlex #7805](https://phpexcel.codeplex.com/workitem/7805)
+- Formula returning error type is lost when read by PHPExcel_Reader_Excel2007 - @MarkBaker [CodePlex #7873](https://phpexcel.codeplex.com/workitem/7873)
+- PHPExcel_Reader_Excel5: Cell style lost for last column in group of blank cells - @Erik Tilt [CodePlex #7883](https://phpexcel.codeplex.com/workitem/7883)
+- Column width sometimes collapses to auto size using Excel2007 reader/writer - @MarkBaker [CodePlex #7886](https://phpexcel.codeplex.com/workitem/7886)
+- Data Validation Formula = 0 crashes Excel - @MarkBaker [CodePlex #9343](https://phpexcel.codeplex.com/workitem/9343)
+
+## [1.6.3] - 2008-08-25
+
+### General
+
+- Modified PHPExcel_Shared_Date::PHPToExcel() to force UTC - @MarkBaker [CodePlex #7367](https://phpexcel.codeplex.com/workitem/7367)
+- Applied patch 1629 - @MarkBaker
+- Applied patch 1644 - @MarkBaker
+- Implement repeatRow and repeatColumn in Excel5 writer - @MarkBaker [CodePlex #6485](https://phpexcel.codeplex.com/workitem/6485)
+
+### Features
+
+- Remove scene3d filter in Excel2007 drawing - @MarkBaker [CodePlex #6838](https://phpexcel.codeplex.com/workitem/6838)
+- Implement CHOOSE and INDEX Lookup/Reference Functions - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Implement CLEAN Text Functions - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Implement YEARFRAC Date/Time Functions - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Implement 2 options for print/show gridlines - @MarkBaker [CodePlex #6508](https://phpexcel.codeplex.com/workitem/6508)
+- Add VLOOKUP function (contribution) - @MarkBaker [CodePlex #7270](https://phpexcel.codeplex.com/workitem/7270)
+- Implemented: ShrinkToFit - @MarkBaker [CodePlex #7182](https://phpexcel.codeplex.com/workitem/7182)
+- Row heights not updated correctly when inserting new rows - @MarkBaker [CodePlex #7218](https://phpexcel.codeplex.com/workitem/7218)
+- Copy worksheets within the same workbook - @MarkBaker [CodePlex #7157](https://phpexcel.codeplex.com/workitem/7157)
+- Excel5 reader style support: horizontal and vertical alignment plus text wrap - @Erik Tilt [CodePlex #7290](https://phpexcel.codeplex.com/workitem/7290)
+- Excel5 reader support for merged cells - @Erik Tilt [CodePlex #7294](https://phpexcel.codeplex.com/workitem/7294)
+- Excel5 reader: Sheet Protection - @Erik Tilt [CodePlex #7296](https://phpexcel.codeplex.com/workitem/7296)
+- Excel5 reader: Password for sheet protection - @Erik Tilt [CodePlex #7297](https://phpexcel.codeplex.com/workitem/7297)
+- Excel5 reader: Column width - @Erik Tilt [CodePlex #7299](https://phpexcel.codeplex.com/workitem/7299)
+- Excel5 reader: Row height - @Erik Tilt [CodePlex #7301](https://phpexcel.codeplex.com/workitem/7301)
+- Excel5 reader: Font support - @Erik Tilt [CodePlex #7304](https://phpexcel.codeplex.com/workitem/7304)
+- Excel5 reader: support for locked cells - @Erik Tilt [CodePlex #7324](https://phpexcel.codeplex.com/workitem/7324)
+- Excel5 reader style support: Fill (background colors and patterns) - @Erik Tilt [CodePlex #7330](https://phpexcel.codeplex.com/workitem/7330)
+- Excel5 reader style support: Borders (style and color) - @Erik Tilt [CodePlex #7332](https://phpexcel.codeplex.com/workitem/7332)
+- Excel5 reader: Rich-Text support - @Erik Tilt [CodePlex #7346](https://phpexcel.codeplex.com/workitem/7346)
+- Read Excel built-in number formats with Excel 2007 reader - @MarkBaker [CodePlex #7313](https://phpexcel.codeplex.com/workitem/7313)
+- Excel5 reader: Number format support - @Erik Tilt [CodePlex #7317](https://phpexcel.codeplex.com/workitem/7317)
+- Creating a copy of PHPExcel object - @MarkBaker [CodePlex #7362](https://phpexcel.codeplex.com/workitem/7362)
+- Excel5 reader: support for row / column outline (group) - @Erik Tilt [CodePlex #7373](https://phpexcel.codeplex.com/workitem/7373)
+- Implement default row/column sizes - @MarkBaker [CodePlex #7380](https://phpexcel.codeplex.com/workitem/7380)
+- Writer HTML - option to return styles and table separately - @MarkBaker [CodePlex #7364](https://phpexcel.codeplex.com/workitem/7364)
+
+### Bugfixes
+
+- Excel5 reader: Support for remaining built-in number formats - @Erik Tilt [CodePlex #7393](https://phpexcel.codeplex.com/workitem/7393)
+- Fixed rounding in HOUR MINUTE and SECOND Time functions, and improved performance for these - @MarkBaker
+- Fix to TRIM function - @MarkBaker
+- Fixed range validation in TIME Functions.php - @MarkBaker
+- EDATE and EOMONTH functions now return date values based on the returnDateType flag - @MarkBaker
+- Write date values that are the result of a calculation function correctly as Excel serialized dates rather than PHP serialized date values - @MarkBaker
+- Excel2007 reader not always reading boolean correctly - @MarkBaker [CodePlex #6690](https://phpexcel.codeplex.com/workitem/6690)
+- Columns above IZ - @MarkBaker [CodePlex #6275](https://phpexcel.codeplex.com/workitem/6275)
+- Other locale than English causes Excel2007 writer to produce broken xlsx - @MarkBaker [CodePlex #6853](https://phpexcel.codeplex.com/workitem/6853)
+- Typo: Number_fromat in NumberFormat.php - @MarkBaker [CodePlex #7061](https://phpexcel.codeplex.com/workitem/7061)
+- Bug in Worksheet_BaseDrawing setWidth() - @MarkBaker [CodePlex #6865](https://phpexcel.codeplex.com/workitem/6865)
+- PDF writer collapses column width for merged cells - @MarkBaker [CodePlex #6891](https://phpexcel.codeplex.com/workitem/6891)
+- Issues with drawings filenames - @MarkBaker [CodePlex #6867](https://phpexcel.codeplex.com/workitem/6867)
+- fromArray() local variable isn't defined - @MarkBaker [CodePlex #7073](https://phpexcel.codeplex.com/workitem/7073)
+- PHPExcel_Writer_Excel5->setTempDir() not passed to all classes involved in writing to a file - @MarkBaker [CodePlex #7276](https://phpexcel.codeplex.com/workitem/7276)
+- Excel5 reader not handling UTF-8 properly - @MarkBaker [CodePlex #7277](https://phpexcel.codeplex.com/workitem/7277)
+- If you write a 0 value in cell, cell shows as empty - @MarkBaker [CodePlex #7327](https://phpexcel.codeplex.com/workitem/7327)
+- Excel2007 writer: Row height ignored for empty rows - @MarkBaker [CodePlex #7302](https://phpexcel.codeplex.com/workitem/7302)
+- Excel2007 (comments related error) - @MarkBaker [CodePlex #7281](https://phpexcel.codeplex.com/workitem/7281)
+- Column width in other locale - @MarkBaker [CodePlex #7345](https://phpexcel.codeplex.com/workitem/7345)
+- Excel2007 reader not reading underlined Rich-Text - @MarkBaker [CodePlex #7347](https://phpexcel.codeplex.com/workitem/7347)
+- Excel5 reader converting booleans to strings - @Erik Tilt [CodePlex #7357](https://phpexcel.codeplex.com/workitem/7357)
+- Recursive Object Memory Leak - @MarkBaker [CodePlex #7365](https://phpexcel.codeplex.com/workitem/7365)
+- Excel2007 writer ignoring row dimensions without cells - @MarkBaker [CodePlex #7372](https://phpexcel.codeplex.com/workitem/7372)
+- Excel5 reader is converting formatted numbers / dates to strings - @Erik Tilt [CodePlex #7382](https://phpexcel.codeplex.com/workitem/7382)
+
+## [1.6.2] - 2008-06-23
+
+### General
+
+- Document style array values - @MarkBaker [CodePlex #6088](https://phpexcel.codeplex.com/workitem/6088)
+- Applied patch 1195 - @MarkBaker
+- Redirecting output to a client’s web browser - http headers - @MarkBaker [CodePlex #6178](https://phpexcel.codeplex.com/workitem/6178)
+- Improve worksheet garbage collection - @MarkBaker [CodePlex #6187](https://phpexcel.codeplex.com/workitem/6187)
+- Functions that return date values can now be configured to return as Excel serialized date/time, PHP serialized date/time, or a PHP date/time object. - @MarkBaker
+- Functions that explicitly accept dates as parameters now permit values as Excel serialized date/time, PHP serialized date/time, a valid date string, or a PHP date/time object. - @MarkBaker
+- Implement ACOSH, ASINH and ATANH functions for those operating platforms/PHP versions that don't include these functions - @MarkBaker
+- Implement ATAN2 logic reversing the arguments as per Excel - @MarkBaker
+- Additional validation of parameters for COMBIN - @MarkBaker
+
+### Features
+
+- Fixed validation for CEILING and FLOOR when the value and significance parameters have different signs; and allowed default value of 1 or -1 for significance when in GNUMERIC compatibility mode - @MarkBaker
+- Implement ADDRESS, ISLOGICAL, ISTEXT and ISNONTEXT functions - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Implement COMPLEX, IMAGINARY, IMREAL, IMARGUMENT, IMCONJUGATE, IMABS, IMSUB, IMDIV, IMSUM, IMPRODUCT, IMSQRT, IMEXP, IMLN, IMLOG10, IMLOG2, IMPOWER IMCOS and IMSIN Engineering functions - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Implement NETWORKDAYS and WORKDAY Date/Time functions - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+- Make cell column AAA available - @MarkBaker [CodePlex #6100](https://phpexcel.codeplex.com/workitem/6100)
+- Mark particular cell as selected when opening Excel - @MarkBaker [CodePlex #6095](https://phpexcel.codeplex.com/workitem/6095)
+- Multiple sheets in PDF and HTML - @MarkBaker [CodePlex #6120](https://phpexcel.codeplex.com/workitem/6120)
+- Implement PHPExcel_ReaderFactory and PHPExcel_WriterFactory - @MarkBaker [CodePlex #6227](https://phpexcel.codeplex.com/workitem/6227)
+- Set image root of PHPExcel_Writer_HTML - @MarkBaker [CodePlex #6249](https://phpexcel.codeplex.com/workitem/6249)
+- Enable/disable calculation cache - @MarkBaker [CodePlex #6264](https://phpexcel.codeplex.com/workitem/6264)
+- PDF writer and multi-line text - @MarkBaker [CodePlex #6259](https://phpexcel.codeplex.com/workitem/6259)
+- Feature request - setCacheExpirationTime() - @MarkBaker [CodePlex #6350](https://phpexcel.codeplex.com/workitem/6350)
+- Implement late-binding mechanisms to reduce memory footprint - @JB [CodePlex #6370](https://phpexcel.codeplex.com/workitem/6370)
+- Implement shared styles - @JB [CodePlex #6430](https://phpexcel.codeplex.com/workitem/6430)
+- Copy sheet from external Workbook to active Workbook - @MarkBaker [CodePlex #6391](https://phpexcel.codeplex.com/workitem/6391)
+
+### Bugfixes
+
+- Functions in Conditional Formatting - @MarkBaker [CodePlex #6428](https://phpexcel.codeplex.com/workitem/6428)
+- Default Style in Excel5 - @MarkBaker [CodePlex #6096](https://phpexcel.codeplex.com/workitem/6096)
+- Numbers starting with '+' cause Excel 2007 errors - @MarkBaker [CodePlex #6150](https://phpexcel.codeplex.com/workitem/6150)
+- ExcelWriter5 is not PHP5 compatible, using it with E_STRICT results in a bunch of errors (applied patches) - @MarkBaker [CodePlex #6092](https://phpexcel.codeplex.com/workitem/6092)
+- Error Reader Excel2007 line 653 foreach ($relsDrawing->Relationship as $ele) - @MarkBaker [CodePlex #6179](https://phpexcel.codeplex.com/workitem/6179)
+- Worksheet toArray() screws up DATE - @MarkBaker [CodePlex #6229](https://phpexcel.codeplex.com/workitem/6229)
+- References to a Richtext cell in a formula - @MarkBaker [CodePlex #6253](https://phpexcel.codeplex.com/workitem/6253)
+- insertNewColumnBefore Bug - @MarkBaker [CodePlex #6285](https://phpexcel.codeplex.com/workitem/6285)
+- Error reading Excel2007 file with shapes - @MarkBaker [CodePlex #6319](https://phpexcel.codeplex.com/workitem/6319)
+- Determine whether date values need conversion from PHP dates to Excel dates before writing to file, based on the data type (float or integer) - @MarkBaker [CodePlex #6302](https://phpexcel.codeplex.com/workitem/6302)
+- Fixes to DATE function when it is given negative input parameters - @MarkBaker
+- PHPExcel handles empty cells other than Excel - @MarkBaker [CodePlex #6347](https://phpexcel.codeplex.com/workitem/6347)
+- PHPExcel handles 0 and "" as being the same - @MarkBaker [CodePlex #6348](https://phpexcel.codeplex.com/workitem/6348)
+- Problem Using Excel2007 Reader for Spreadsheets containing images - @MarkBaker [CodePlex #6357](https://phpexcel.codeplex.com/workitem/6357)
+- ShowGridLines ignored when reading/writing Excel 2007 - @MarkBaker [CodePlex #6359](https://phpexcel.codeplex.com/workitem/6359)
+- Bug With Word Wrap in Excel 2007 Reader - @MarkBaker [CodePlex #6426](https://phpexcel.codeplex.com/workitem/6426)
+
+## [1.6.1] - 2008-04-28
+
+### General
+
+- Fix documentation printing - @MarkBaker [CodePlex #5532](https://phpexcel.codeplex.com/workitem/5532)
+- Memory usage improvements - @MarkBaker [CodePlex #5586](https://phpexcel.codeplex.com/workitem/5586)
+- Applied patch 990 - @MarkBaker
+
+### Features
+
+- Applied patch 991 - @MarkBaker
+- Implement PHPExcel_Reader_Excel5 - @BM [CodePlex #2841](https://phpexcel.codeplex.com/workitem/2841)
+- Implement "toArray" and "fromArray" method - @MarkBaker [CodePlex #5564](https://phpexcel.codeplex.com/workitem/5564)
+- Read shared formula - @MarkBaker [CodePlex #5665](https://phpexcel.codeplex.com/workitem/5665)
+- Read image twoCellAnchor - @MarkBaker [CodePlex #5681](https://phpexcel.codeplex.com/workitem/5681)
+- &G Image as bg for headerfooter - @MarkBaker [CodePlex #4446](https://phpexcel.codeplex.com/workitem/4446)
+- Implement page layout functionality for Excel5 format - @MarkBaker [CodePlex #5834](https://phpexcel.codeplex.com/workitem/5834)
+
+### Bugfixes
+
+- Feature request: PHPExcel_Writer_PDF - @MarkBaker [CodePlex #6039](https://phpexcel.codeplex.com/workitem/6039)
+- DefinedNames null check - @MarkBaker [CodePlex #5517](https://phpexcel.codeplex.com/workitem/5517)
+- Hyperlinks should not always have trailing slash - @MarkBaker [CodePlex #5463](https://phpexcel.codeplex.com/workitem/5463)
+- Saving Error - Uncaught exception (#REF! named range) - @MarkBaker [CodePlex #5592](https://phpexcel.codeplex.com/workitem/5592)
+- Error when creating Zip file on Linux System (Not Windows) - @MarkBaker [CodePlex #5634](https://phpexcel.codeplex.com/workitem/5634)
+- Time incorrecly formated - @MarkBaker [CodePlex #5876](https://phpexcel.codeplex.com/workitem/5876)
+- Conditional formatting - second rule not applied - @MarkBaker [CodePlex #5914](https://phpexcel.codeplex.com/workitem/5914)
+- PHPExcel_Reader_Excel2007 cannot load PHPExcel_Shared_File - @MarkBaker [CodePlex #5978](https://phpexcel.codeplex.com/workitem/5978)
+- Output redirection to web browser - @MarkBaker [CodePlex #6020](https://phpexcel.codeplex.com/workitem/6020)
+
+## [1.6.0] - 2008-02-14
+
+### Features
+
+- Use PHPExcel datatypes in formula calculation - @MarkBaker [CodePlex #3156](https://phpexcel.codeplex.com/workitem/3156)
+- Center on page when printing - @MarkBaker [CodePlex #5019](https://phpexcel.codeplex.com/workitem/5019)
+- Hyperlink to other spreadsheet - @MarkBaker [CodePlex #5099](https://phpexcel.codeplex.com/workitem/5099)
+- Set the print area of a worksheet - @MarkBaker [CodePlex #5104](https://phpexcel.codeplex.com/workitem/5104)
+- Read "definedNames" property of worksheet - @MarkBaker [CodePlex #5118](https://phpexcel.codeplex.com/workitem/5118)
+- Set default style for all cells - @MarkBaker [CodePlex #5338](https://phpexcel.codeplex.com/workitem/5338)
+- Named Ranges - @MarkBaker [CodePlex #4216](https://phpexcel.codeplex.com/workitem/4216)
+
+### Bugfixes
+
+- Implement worksheet references (Sheet1!A1) - @MarkBaker [CodePlex #5398](https://phpexcel.codeplex.com/workitem/5398)
+- Redirect output to a client's web browser - @MarkBaker [CodePlex #4967](https://phpexcel.codeplex.com/workitem/4967)
+- "File Error: data may have been lost." seen in Excel 2007 and Excel 2003 SP3 when opening XLS file - @MarkBaker [CodePlex #5008](https://phpexcel.codeplex.com/workitem/5008)
+- Bug in style's getHashCode() - @MarkBaker [CodePlex #5165](https://phpexcel.codeplex.com/workitem/5165)
+- PHPExcel_Reader not correctly reading numeric values - @MarkBaker [CodePlex #5165](https://phpexcel.codeplex.com/workitem/5165)
+- Text rotation is read incorrectly - @MarkBaker [CodePlex #5324](https://phpexcel.codeplex.com/workitem/5324)
+- Enclosure " and data " result a bad data : \" instead of "" - @MarkBaker [CodePlex #5326](https://phpexcel.codeplex.com/workitem/5326)
+- Formula parser - IF statement returning array instead of scalar - @MarkBaker [CodePlex #5332](https://phpexcel.codeplex.com/workitem/5332)
+- setFitToWidth(nbpage) & setFitToWidth(nbpage) work partially - @MarkBaker [CodePlex #5351](https://phpexcel.codeplex.com/workitem/5351)
+- Worksheet::setTitle() causes unwanted renaming - @MarkBaker [CodePlex #5361](https://phpexcel.codeplex.com/workitem/5361)
+- Hyperlinks not working. Results in broken xlsx file. - @MarkBaker [CodePlex #5407](https://phpexcel.codeplex.com/workitem/5407)
+
+## [1.5.5] - 2007-12-24
+
+### General
+
+- Grouping Rows - @MarkBaker [CodePlex #4135](https://phpexcel.codeplex.com/workitem/4135)
+
+### Features
+
+- Semi-nightly builds - @MarkBaker [CodePlex #4427](https://phpexcel.codeplex.com/workitem/4427)
+- Implement "date" datatype - @MarkBaker [CodePlex #3155](https://phpexcel.codeplex.com/workitem/3155)
+- Date format not honored in CSV writer - @MarkBaker [CodePlex #4150](https://phpexcel.codeplex.com/workitem/4150)
+- RichText and sharedStrings - @MarkBaker [CodePlex #4199](https://phpexcel.codeplex.com/workitem/4199)
+- Implement more Excel calculation functions - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+ - Addition of DATE, DATEDIF, DATEVALUE, DAY, DAYS360- Implement more Excel calculation functions - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+ - Addition of AVEDEV, HARMEAN and GEOMEAN
+ - Addition of the BINOMDIST (Non-cumulative only), COUNTBLANK, EXPONDIST, FISHER, FISHERINV, NORMDIST, NORMSDIST, PERMUT, POISSON (Non-cumulative only) and STANDARDIZE Statistical Functions
+ - Addition of the CEILING, COMBIN, EVEN, FACT, FACTDOUBLE, FLOOR, MULTINOMIAL, ODD, ROUNDDOWN, ROUNDUP, SIGN, SQRTPI and SUMSQ Mathematical Functions
+ - Addition of the NORMINV, NORMSINV, CONFIDENCE and SKEW Statistical Functions
+ - Addition of the CRITBINOM, HYPGEOMDIST, KURT, LOGINV, LOGNORMDIST, NEGBINOMDIST and WEIBULL Statistical Functions
+ - Addition of the LARGE, PERCENTILE, QUARTILE, SMALL and TRIMMEAN Statistical Functions
+ - Addition of the BIN2HEX, BIN2OCT, DELTA, ERF, ERFC, GESTEP, HEX2BIN, HEX2DEC, HEX2OCT, OCT2BIN and OCT2HEX Engineering Functions
+ - Addition of the CHIDIST, GAMMADIST and GAMMALN Statistical Functions
+ - Addition of the GCD, LCM, MROUND and SUBTOTAL Mathematical Functions
+ - Addition of the LOWER, PROPER and UPPER Text Functions
+ - Addition of the BETADIST and BETAINV Statistical Functions
+ - Addition of the CHIINV and GAMMAINV Statistical Functions
+ - Addition of the SERIESSUM Mathematical Function
+ - Addition of the CHAR, CODE, FIND, LEN, REPT, SEARCH, T, TRIM Text Functions
+ - Addition of the FALSE and TRUE Boolean Functions
+ - Addition of the TDIST and TINV Statistical Functions
+ - Addition of the EDATE, EOMONTH, YEAR, MONTH, TIME, TIMEVALUE, HOUR, MINUTE, SECOND, WEEKDAY, WEEKNUM, NOW, TODAY and Date/Time Function
+ - Addition of the BESSELI, BESSELJ, BESSELK and BESSELY Engineering Functions
+ - Addition of the SLN and SYD Financial Functions
+ - reworked MODE calculation to handle floating point numbers
+ - Improved error trapping for invalid input values
+ - Fix to SMALL, LARGE, PERCENTILE and TRIMMEAN to eliminate non-numeric values
+ - Added CDF to BINOMDIST and POISSON
+ - Fix to a potential endless loop in CRITBINOM, together with other bugfixes to the algorithm
+ - Fix to SQRTPI so that it will work with a real value parameter rather than just integers
+ - Trap for passing negative values to FACT
+ - Improved accuracy of the NORMDIST cumulative function, and of the ERF and ERFC functions
+ - Replicated Excel data-type and error handling for BIN, DEC, OCT and HEX conversion functions
+ - Replicated Excel data-type and error handling for AND and OR Boolean functions
+ - Bugfix to MROUND
+ - Rework of the DATE, DATEVALUE, DAY, DAYS360 and DATEDIF date/Time functions to use Excel dates rather than straight PHP dates
+ - Rework of the AND, OR Boolean functions to ignore string values
+ - Rework of the BIN2DEC, BIN2HEX, BIN2OCT, DEC2BIN, DEC2HEX, DEC2OCT Engineering functions to handle two's complement
+ - Excel, Gnumeric and OpenOffice Calc compatibility flag for functions
+ - Note, not all functions have yet been written to work with the Gnumeric and OpenOffice Calc compatibility flags
+ - 1900 or 1904 Calendar flag for date functions
+ - Reworked ExcelToPHP date method to handle the Excel 1900 leap year
+ - Note that this will not correctly return values prior to 13-Dec-1901 20:45:52 as this is the minimum value that PHP date serial values can handle. If you need to work with dates prior to this, then an ExcelToPHPObject method has been added which will work correctly with values between Excel's 1900 calendar base date of 1-Jan-1900, and 13-Dec-1901
+ - Addition of ExcelToPHPObject date method to return a PHP DateTime object from an Excel date serial value
+ - PHPToExcel method modified to accept either PHP date serial numbers or PHP DateTime objects
+ - Addition of FormattedPHPToExcel which will accept a date and time broken to into year, month, day, hour, minute, second and return an Excel date serial value- Control characters in Excel 2007 - @MarkBaker [CodePlex #4485](https://phpexcel.codeplex.com/workitem/4485)
+- BaseDrawing::setWidthAndHeight method request - @MarkBaker [CodePlex #4796](https://phpexcel.codeplex.com/workitem/4796)
+- Page Setup -> Print Titles -> Sheet -> 'Rows to repeat at top' - @MarkBaker [CodePlex #4798](https://phpexcel.codeplex.com/workitem/4798)
+
+### Bugfixes
+
+- Comment functionality - @MarkBaker [CodePlex #4433](https://phpexcel.codeplex.com/workitem/4433)
+- Undefined variable in PHPExcel_Writer_Serialized - @MarkBaker [CodePlex #4124](https://phpexcel.codeplex.com/workitem/4124)
+- Notice: Object of class PHPExcel_RichText could not be converted to int - @MarkBaker [CodePlex #4125](https://phpexcel.codeplex.com/workitem/4125)
+- Excel5Writer: utf8 string not converted to utf16 - @MarkBaker [CodePlex #4126](https://phpexcel.codeplex.com/workitem/4126)
+- PHPExcel_RichText and autosize - @MarkBaker [CodePlex #4180](https://phpexcel.codeplex.com/workitem/4180)
+- Excel5Writer produces broken xls files after change mentioned in work item 4126 - @MarkBaker [CodePlex #4574](https://phpexcel.codeplex.com/workitem/4574)
+- Small bug in PHPExcel_Reader_Excel2007 function _readStyle - @MarkBaker [CodePlex #4797](https://phpexcel.codeplex.com/workitem/4797)
+
+## [1.5.0] - 2007-10-23
+
+### Features
+
+- Refactor PHPExcel Drawing - @MarkBaker [CodePlex #3265](https://phpexcel.codeplex.com/workitem/3265)
+- Update Shared/OLE.php to latest version from PEAR - @CS [CodePlex #3079](https://phpexcel.codeplex.com/workitem/3079)
+- Excel2007 vs Excel2003 compatibility pack - @MarkBaker [CodePlex #3217](https://phpexcel.codeplex.com/workitem/3217)
+- Cell protection (lock/unlock) - @MarkBaker [CodePlex #3234](https://phpexcel.codeplex.com/workitem/3234)
+- Create clickable links (hyperlinks) - @MarkBaker [CodePlex #3543](https://phpexcel.codeplex.com/workitem/3543)
+- Additional page setup parameters - @MarkBaker [CodePlex #3241](https://phpexcel.codeplex.com/workitem/3241)
+- Make temporary file path configurable (Excel5) - @MarkBaker [CodePlex #3300](https://phpexcel.codeplex.com/workitem/3300)
+- Small addition to applyFromArray for font - @MarkBaker [CodePlex #3306](https://phpexcel.codeplex.com/workitem/3306)
+
+### Bugfixes
+
+- Better feedback when save of file is not possible - @MarkBaker [CodePlex #3373](https://phpexcel.codeplex.com/workitem/3373)
+- Text Rotation - @MarkBaker [CodePlex #3181](https://phpexcel.codeplex.com/workitem/3181)
+- Small bug in Page Orientation - @MarkBaker [CodePlex #3237](https://phpexcel.codeplex.com/workitem/3237)
+- insertNewColumnBeforeByColumn undefined - @MarkBaker [CodePlex #3812](https://phpexcel.codeplex.com/workitem/3812)
+- Sheet references not working in formula (Excel5 Writer) - @MarkBaker [CodePlex #3893](https://phpexcel.codeplex.com/workitem/3893)
+
+## [1.4.5] - 2007-08-23
+
+### General
+
+- Class file endings - @MarkBaker [CodePlex #3003](https://phpexcel.codeplex.com/workitem/3003)
+- Different calculation engine improvements - @MarkBaker [CodePlex #3081](https://phpexcel.codeplex.com/workitem/3081)
+- Different improvements in PHPExcel_Reader_Excel2007 - @MarkBaker [CodePlex #3082](https://phpexcel.codeplex.com/workitem/3082)
+
+### Features
+
+- Set XML indentation in PHPExcel_Writer_Excel2007 - @MarkBaker [CodePlex #3146](https://phpexcel.codeplex.com/workitem/3146)
+- Optionally store temporary Excel2007 writer data in file instead of memory - @MarkBaker [CodePlex #3159](https://phpexcel.codeplex.com/workitem/3159)
+- Implement show/hide gridlines - @MarkBaker [CodePlex #3063](https://phpexcel.codeplex.com/workitem/3063)
+- Implement option to read only data - @MarkBaker [CodePlex #3064](https://phpexcel.codeplex.com/workitem/3064)
+- Optionally disable formula precalculation - @MarkBaker [CodePlex #3080](https://phpexcel.codeplex.com/workitem/3080)
+- Explicitly set cell datatype - @MarkBaker [CodePlex #3154](https://phpexcel.codeplex.com/workitem/3154)
+
+### Bugfixes
+
+- Implement more Excel calculation functions - @MarkBaker [CodePlex #2346](https://phpexcel.codeplex.com/workitem/2346)
+ - Addition of MINA, MAXA, COUNTA, AVERAGEA, MEDIAN, MODE, DEVSQ, STDEV, STDEVA, STDEVP, STDEVPA, VAR, VARA, VARP and VARPA Excel Functions
+ - Fix to SUM, PRODUCT, QUOTIENT, MIN, MAX, COUNT and AVERAGE functions when cell contains a numeric value in a string datatype, bringing it in line with MS Excel behaviour- File_exists on ZIP fails on some installations - @MarkBaker [CodePlex #2881](https://phpexcel.codeplex.com/workitem/2881)
+- Argument in textRotation should be -90..90 - @MarkBaker [CodePlex #2879](https://phpexcel.codeplex.com/workitem/2879)
+- Excel2007 reader/writer not implementing OpenXML/SpreadsheetML styles 100% correct - @MarkBaker [CodePlex #2883](https://phpexcel.codeplex.com/workitem/2883)
+- Active sheet index not read/saved - @MarkBaker [CodePlex #2513](https://phpexcel.codeplex.com/workitem/2513)
+- Print and print preview of generated XLSX causes Excel2007 to crash - @MarkBaker [CodePlex #2935](https://phpexcel.codeplex.com/workitem/2935)
+- Error in Calculations - COUNT() function - @MarkBaker [CodePlex #2952](https://phpexcel.codeplex.com/workitem/2952)
+- HTML and CSV writer not writing last row - @MarkBaker [CodePlex #3002](https://phpexcel.codeplex.com/workitem/3002)
+- Memory leak in Excel5 writer - @MarkBaker [CodePlex #3017](https://phpexcel.codeplex.com/workitem/3017)
+- Printing (PHPExcel_Writer_Excel5) - @MarkBaker [CodePlex #3044](https://phpexcel.codeplex.com/workitem/3044)
+- Problems reading zip:// - @MarkBaker [CodePlex #3046](https://phpexcel.codeplex.com/workitem/3046)
+- Error reading conditional formatting - @MarkBaker [CodePlex #3047](https://phpexcel.codeplex.com/workitem/3047)
+- Bug in Excel5 writer (storePanes) - @MarkBaker [CodePlex #3067](https://phpexcel.codeplex.com/workitem/3067)
+- Memory leak in PHPExcel_Style_Color - @MarkBaker [CodePlex #3077](https://phpexcel.codeplex.com/workitem/3077)
+
+## [1.4.0] - 2007-07-23
+
+### General
+
+- Coding convention / code cleanup - @MarkBaker [CodePlex #2687](https://phpexcel.codeplex.com/workitem/2687)
+- Use set_include_path in tests - @MarkBaker [CodePlex #2717](https://phpexcel.codeplex.com/workitem/2717)
+
+### Features
+
+- Move PHPExcel_Writer_Excel5 OLE to PHPExcel_Shared_OLE - @MarkBaker [CodePlex #2812](https://phpexcel.codeplex.com/workitem/2812)
+- Hide/Unhide Column or Row - @MarkBaker [CodePlex #2679](https://phpexcel.codeplex.com/workitem/2679)
+- Implement multi-cell styling - @MarkBaker [CodePlex #2271](https://phpexcel.codeplex.com/workitem/2271)
+- Implement CSV file format (reader/writer) - @MarkBaker [CodePlex #2720](https://phpexcel.codeplex.com/workitem/2720)
+
+### Bugfixes
+
+- Implement HTML file format - @MarkBaker [CodePlex #2845](https://phpexcel.codeplex.com/workitem/2845)
+- Active sheet index not read/saved - @MarkBaker [CodePlex #2513](https://phpexcel.codeplex.com/workitem/2513)
+- Freeze Panes with PHPExcel_Writer_Excel5 - @MarkBaker [CodePlex #2678](https://phpexcel.codeplex.com/workitem/2678)
+- OLE.php - @MarkBaker [CodePlex #2680](https://phpexcel.codeplex.com/workitem/2680)
+- Copy and pasting multiple drop-down list cells breaks reader - @MarkBaker [CodePlex #2736](https://phpexcel.codeplex.com/workitem/2736)
+- Function setAutoFilterByColumnAndRow takes wrong arguments - @MarkBaker [CodePlex #2775](https://phpexcel.codeplex.com/workitem/2775)
+- Simplexml_load_file fails on ZipArchive - @MarkBaker [CodePlex #2858](https://phpexcel.codeplex.com/workitem/2858)
+
+## [1.3.5] - 2007-06-27
+
+### Features
+
+- Documentation - @MarkBaker [CodePlex #15](https://phpexcel.codeplex.com/workitem/15)
+- PHPExcel_Writer_Excel5 - @JV
+- PHPExcel_Reader_Excel2007: Image shadows - @JV
+- Data validation - @MarkBaker [CodePlex #2385](https://phpexcel.codeplex.com/workitem/2385)
+
+### Bugfixes
+
+- Implement richtext strings - @MarkBaker
+- Empty relations when adding image to any sheet but the first one - @MarkBaker [CodePlex #2443](https://phpexcel.codeplex.com/workitem/2443)
+- Excel2007 crashes on print preview - @MarkBaker [CodePlex #2536](https://phpexcel.codeplex.com/workitem/2536)
+
+## [1.3.0] - 2007-06-05
+
+### General
+
+- Create PEAR package - @MarkBaker [CodePlex #1942](https://phpexcel.codeplex.com/workitem/1942)
+
+### Features
+
+- Replace *->duplicate() by __clone() - @MarkBaker [CodePlex #2331](https://phpexcel.codeplex.com/workitem/2331)
+- PHPExcel_Reader_Excel2007: Column auto-size, Protection, Merged cells, Wrap text, Page breaks, Auto filter, Images - @JV
+- Implement "freezing" panes - @MarkBaker [CodePlex #245](https://phpexcel.codeplex.com/workitem/245)
+- Cell addressing alternative - @MarkBaker [CodePlex #2273](https://phpexcel.codeplex.com/workitem/2273)
+- Implement cell word-wrap attribute - @MarkBaker [CodePlex #2270](https://phpexcel.codeplex.com/workitem/2270)
+- Auto-size column - @MarkBaker [CodePlex #2282](https://phpexcel.codeplex.com/workitem/2282)
+- Implement formula calculation - @MarkBaker [CodePlex #241](https://phpexcel.codeplex.com/workitem/241)
+
+### Bugfixes
+
+- Insert/remove row/column - @MarkBaker [CodePlex #2375](https://phpexcel.codeplex.com/workitem/2375)
+- PHPExcel_Worksheet::getCell() should not accept absolute coordinates - @MarkBaker [CodePlex #1931](https://phpexcel.codeplex.com/workitem/1931)
+- Cell reference without row number - @MarkBaker [CodePlex #2272](https://phpexcel.codeplex.com/workitem/2272)
+- Styles with same coordinate but different worksheet - @MarkBaker [CodePlex #2276](https://phpexcel.codeplex.com/workitem/2276)
+- PHPExcel_Worksheet->getCellCollection() usort error - @MarkBaker [CodePlex #2290](https://phpexcel.codeplex.com/workitem/2290)
+- Bug in PHPExcel_Cell::stringFromColumnIndex - @SS [CodePlex #2353](https://phpexcel.codeplex.com/workitem/2353)
+- Reader: numFmts can be missing, use cellStyleXfs instead of cellXfs in styles - @JV [CodePlex #2353](https://phpexcel.codeplex.com/workitem/2353)
+
+## [1.2.0] - 2007-04-26
+
+### General
+
+- Stringtable attribute "count" not necessary, provides wrong info to Excel sometimes... - @MarkBaker
+- Updated tests to address more document properties - @MarkBaker
+- Some refactoring in PHPExcel_Writer_Excel2007_Workbook - @MarkBaker
+- New package: PHPExcel_Shared - @MarkBaker
+- Password hashing algorithm implemented in PHPExcel_Shared_PasswordHasher - @MarkBaker
+- Moved pixel conversion functions to PHPExcel_Shared_Drawing - @MarkBaker
+- Switch over to LGPL license - @MarkBaker [CodePlex #244](https://phpexcel.codeplex.com/workitem/244)
+
+### Features
+
+- Include PHPExcel version in file headers - @MarkBaker [CodePlex #5](https://phpexcel.codeplex.com/workitem/5)
+- Autofilter - @MarkBaker [CodePlex #6](https://phpexcel.codeplex.com/workitem/6)
+- Extra document property: keywords - @MarkBaker [CodePlex #7](https://phpexcel.codeplex.com/workitem/7)
+- Extra document property: category - @MarkBaker [CodePlex #8](https://phpexcel.codeplex.com/workitem/8)
+- Document security - @MarkBaker [CodePlex #9](https://phpexcel.codeplex.com/workitem/9)
+- PHPExcel_Writer_Serialized and PHPExcel_Reader_Serialized - @MarkBaker [CodePlex #10](https://phpexcel.codeplex.com/workitem/10)
+- Alternative syntax: Addressing a cell - @MarkBaker [CodePlex #11](https://phpexcel.codeplex.com/workitem/11)
+- Merge cells - @MarkBaker [CodePlex #12](https://phpexcel.codeplex.com/workitem/12)
+
+### Bugfixes
+
+- Protect ranges of cells with a password - @MarkBaker [CodePlex #13](https://phpexcel.codeplex.com/workitem/13)
+- (style/fill/patternFill/fgColor or bgColor can be empty) - @JV [CodePlex #14](https://phpexcel.codeplex.com/workitem/14)
+
+## [1.1.1] - 2007-03-26
+
+### General
+
+- Syntax error in "Classes/PHPExcel/Writer/Excel2007.php" on line 243 - @MarkBaker [CodePlex #1250](https://phpexcel.codeplex.com/workitem/1250)
+- Reader should check if file exists and throws an exception when it doesn't - @MarkBaker [CodePlex #1282](https://phpexcel.codeplex.com/workitem/1282)
+
+## [1.1.0] - 2007-03-22
+
+### Bugfixes
+
+- Style information lost after passing trough Excel2007_Reader - @MarkBaker [CodePlex #836](https://phpexcel.codeplex.com/workitem/836)
+
+### General
+
+- Number of columns > AZ fails fixed in PHPExcel_Cell::columnIndexFromString - @MarkBaker [CodePlex #913](https://phpexcel.codeplex.com/workitem/913)
+
+### Features
+
+- Added a brief file with installation instructions - @MarkBaker
+- Page breaks (horizontal and vertical) - @MarkBaker
+- Image shadows - @MarkBaker
+
+## [1.0.0] - 2007-02-22
+
+### Bugfixes
+
+- PHPExcel->removeSheetByIndex now re-orders sheets after deletion, so no array indexes are lost - @JV
+- PHPExcel_Writer_Excel2007_Worksheet::_writeCols() used direct assignment to $pSheet->getColumnDimension('A')->Width instead of $pSheet->getColumnDimension('A')->setWidth() - @JV
+- DocumentProperties used $this->LastModifiedBy instead of $this->_lastModifiedBy. - @JV
+
+### General
+
+- Only first = should be removed when writing formula in PHPExcel_Writer_Excel2007_Worksheet. - @JV
+- Consistency of method names to camelCase - @JV
+- Updated tests to match consistency changes - @JV
+- Detection of mime-types now with image_type_to_mime_type() - @JV
+- Constants now hold string value used in Excel 2007 - @JV
+
+### Features
+
+- Fixed folder name case (WorkSheet -> Worksheet) - @MarkBaker
+- PHPExcel classes (not the Writer classes) can be duplicated, using a duplicate() method. - @MarkBaker
+- Cell styles can now be duplicated to a range of cells using PHPExcel_Worksheet->duplicateStyle() - @MarkBaker
+- Conditional formatting - @MarkBaker
+- Reader for Excel 2007 (not supporting full specification yet!) - @JV
+
+## [1.0.0 RC] - 2007-01-31
+
+- Project name has been changed to PHPExcel
+- Project homepage is now http://www.codeplex.com/PHPExcel
+- Started versioning at number: PHPExcel 1.0.0 RC
+
+## 2007-01-22
+
+- Fixed some performance issues on large-scale worksheets (mainly loops vs. indexed arrays)
+- Performance on creating StringTable has been increased
+- Performance on writing Excel2007 worksheet has been increased
+
+## 2007-01-18
+
+- Images can now be rotated
+- Fixed bug: When drawings have full path specified, no mime type can be deducted
+- Fixed bug: Only one drawing can be added to a worksheet
+
+## 2007-01-12
+
+- Refactoring of some classes to use ArrayObject instead of array()
+- Cell style now has support for number format (i.e. #,##0)
+- Implemented embedding images
+
+## 2007-01-02
+
+- Cell style now has support for fills, including gradient fills
+- Cell style now has support for fonts
+- Cell style now has support for border colors
+- Cell style now has support for font colors
+- Cell style now has support for alignment
+
+## 2006-12-21
+
+- Support for cell style borders
+- Support for cell styles
+- Refactoring of Excel2007 Writer into multiple classes in package SpreadSheet_Writer_Excel2007
+- Refactoring of all classes, changed public members to public properties using getter/setter
+- Worksheet names are now unique. On duplicate worksheet names, a number is appended.
+- Worksheet now has parent SpreadSheet object
+- Worksheet now has support for page header and footer
+- Worksheet now has support for page margins
+- Worksheet now has support for page setup (only Paper size and Orientation)
+- Worksheet properties now accessible by using getProperties()
+- Worksheet now has support for row and column dimensions (height / width)
+- Exceptions thrown have a more clear description
+
+## Initial version
+
+- Create a Spreadsheet object
+- Add one or more Worksheet objects
+- Add cells to Worksheet objects
+- Export Spreadsheet object to Excel 2007 OpenXML format
+- Each cell supports the following data formats: string, number, formula, boolean.
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/CHANGELOG.md b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/CHANGELOG.md
new file mode 100644
index 00000000000..1bfda7f63d5
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/CHANGELOG.md
@@ -0,0 +1,331 @@
+# Changelog
+
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](https://keepachangelog.com)
+and this project adheres to [Semantic Versioning](https://semver.org).
+
+## [1.7.0] - 2019-05-26
+
+### Added
+
+- Added support for inline styles in Html reader (borders, alignment, width, height)
+- QuotedText cells no longer treated as formulae if the content begins with a `=`
+- Clean handling for DDE in formulae
+
+### Fixed
+
+- Fix handling for escaped enclosures and new lines in CSV Separator Inference
+- Fix MATCH an error was appearing when comparing strings against 0 (always true)
+- Fix wrong calculation of highest column with specified row [#700](https://github.com/PHPOffice/PhpSpreadsheet/issues/700)
+- Fix VLOOKUP
+- Fix return type hint
+
+## [1.6.0] - 2019-01-02
+
+### Added
+
+- Refactored Matrix Functions to use external Matrix library
+- Possibility to specify custom colors of values for pie and donut charts - [#768](https://github.com/PHPOffice/PhpSpreadsheet/pull/768)
+
+### Fixed
+
+- Improve XLSX parsing speed if no readFilter is applied - [#772](https://github.com/PHPOffice/PhpSpreadsheet/issues/772)
+- Fix column names if read filter calls in XLSX reader skip columns - [#777](https://github.com/PHPOffice/PhpSpreadsheet/pull/777)
+- XLSX reader can now ignore blank cells, using the setReadEmptyCells(false) method. - [#810](https://github.com/PHPOffice/PhpSpreadsheet/issues/810)
+- Fix LOOKUP function which was breaking on edge cases - [#796](https://github.com/PHPOffice/PhpSpreadsheet/issues/796)
+- Fix VLOOKUP with exact matches - [#809](https://github.com/PHPOffice/PhpSpreadsheet/pull/809)
+- Support COUNTIFS multiple arguments - [#830](https://github.com/PHPOffice/PhpSpreadsheet/pull/830)
+- Change `libxml_disable_entity_loader()` as shortly as possible - [#819](https://github.com/PHPOffice/PhpSpreadsheet/pull/819)
+- Improved memory usage and performance when loading large spreadsheets - [#822](https://github.com/PHPOffice/PhpSpreadsheet/pull/822)
+- Improved performance when loading large spreadsheets - [#825](https://github.com/PHPOffice/PhpSpreadsheet/pull/825)
+- Improved performance when loading large spreadsheets - [#824](https://github.com/PHPOffice/PhpSpreadsheet/pull/824)
+- Fix color from CSS when reading from HTML - [#831](https://github.com/PHPOffice/PhpSpreadsheet/pull/831)
+- Fix infinite loop when reading invalid ODS files - [#832](https://github.com/PHPOffice/PhpSpreadsheet/pull/832)
+- Fix time format for duration is incorrect - [#666](https://github.com/PHPOffice/PhpSpreadsheet/pull/666)
+- Fix iconv unsupported `//IGNORE//TRANSLIT` on IBM i - [#791](https://github.com/PHPOffice/PhpSpreadsheet/issues/791)
+
+### Changed
+
+- `master` is the new default branch, `develop` does not exist anymore
+
+## [1.5.2] - 2018-11-25
+
+### Security
+
+- Improvements to the design of the XML Security Scanner - [#771](https://github.com/PHPOffice/PhpSpreadsheet/issues/771)
+
+## [1.5.1] - 2018-11-20
+
+### Security
+
+- Fix and improve XXE security scanning for XML-based and HTML Readers - [#771](https://github.com/PHPOffice/PhpSpreadsheet/issues/771)
+
+### Added
+
+- Support page margin in mPDF - [#750](https://github.com/PHPOffice/PhpSpreadsheet/issues/750)
+
+### Fixed
+
+- Support numeric condition in SUMIF, SUMIFS, AVERAGEIF, COUNTIF, MAXIF and MINIF - [#683](https://github.com/PHPOffice/PhpSpreadsheet/issues/683)
+- SUMIFS containing multiple conditions - [#704](https://github.com/PHPOffice/PhpSpreadsheet/issues/704)
+- Csv reader avoid notice when the file is empty - [#743](https://github.com/PHPOffice/PhpSpreadsheet/pull/743)
+- Fix print area parser for XLSX reader - [#734](https://github.com/PHPOffice/PhpSpreadsheet/pull/734)
+- Support overriding `DefaultValueBinder::dataTypeForValue()` without overriding `DefaultValueBinder::bindValue()` - [#735](https://github.com/PHPOffice/PhpSpreadsheet/pull/735)
+- Mpdf export can exceed pcre.backtrack_limit - [#637](https://github.com/PHPOffice/PhpSpreadsheet/issues/637)
+- Fix index overflow on data values array - [#748](https://github.com/PHPOffice/PhpSpreadsheet/pull/748)
+
+## [1.5.0] - 2018-10-21
+
+### Added
+
+- PHP 7.3 support
+- Add the DAYS() function - [#594](https://github.com/PHPOffice/PhpSpreadsheet/pull/594)
+
+### Fixed
+
+- Sheet title can contain exclamation mark - [#325](https://github.com/PHPOffice/PhpSpreadsheet/issues/325)
+- Xls file cause the exception during open by Xls reader - [#402](https://github.com/PHPOffice/PhpSpreadsheet/issues/402)
+- Skip non numeric value in SUMIF - [#618](https://github.com/PHPOffice/PhpSpreadsheet/pull/618)
+- OFFSET should allow omitted height and width - [#561](https://github.com/PHPOffice/PhpSpreadsheet/issues/561)
+- Correctly determine delimiter when CSV contains line breaks inside enclosures - [#716](https://github.com/PHPOffice/PhpSpreadsheet/issues/716)
+
+## [1.4.1] - 2018-09-30
+
+### Fixed
+
+- Remove locale from formatting string - [#644](https://github.com/PHPOffice/PhpSpreadsheet/pull/644)
+- Allow iterators to go out of bounds with prev - [#587](https://github.com/PHPOffice/PhpSpreadsheet/issues/587)
+- Fix warning when reading xlsx without styles - [#631](https://github.com/PHPOffice/PhpSpreadsheet/pull/631)
+- Fix broken sample links on windows due to $baseDir having backslash - [#653](https://github.com/PHPOffice/PhpSpreadsheet/pull/653)
+
+## [1.4.0] - 2018-08-06
+
+### Added
+
+- Add excel function EXACT(value1, value2) support - [#595](https://github.com/PHPOffice/PhpSpreadsheet/pull/595)
+- Support workbook view attributes for Xlsx format - [#523](https://github.com/PHPOffice/PhpSpreadsheet/issues/523)
+- Read and write hyperlink for drawing image - [#490](https://github.com/PHPOffice/PhpSpreadsheet/pull/490)
+- Added calculation engine support for the new bitwise functions that were added in MS Excel 2013
+ - BITAND() Returns a Bitwise 'And' of two numbers
+ - BITOR() Returns a Bitwise 'Or' of two number
+ - BITXOR() Returns a Bitwise 'Exclusive Or' of two numbers
+ - BITLSHIFT() Returns a number shifted left by a specified number of bits
+ - BITRSHIFT() Returns a number shifted right by a specified number of bits
+- Added calculation engine support for other new functions that were added in MS Excel 2013 and MS Excel 2016
+ - Text Functions
+ - CONCAT() Synonym for CONCATENATE()
+ - NUMBERVALUE() Converts text to a number, in a locale-independent way
+ - UNICHAR() Synonym for CHAR() in PHPSpreadsheet, which has always used UTF-8 internally
+ - UNIORD() Synonym for ORD() in PHPSpreadsheet, which has always used UTF-8 internally
+ - TEXTJOIN() Joins together two or more text strings, separated by a delimiter
+ - Logical Functions
+ - XOR() Returns a logical Exclusive Or of all arguments
+ - Date/Time Functions
+ - ISOWEEKNUM() Returns the ISO 8601 week number of the year for a given date
+ - Lookup and Reference Functions
+ - FORMULATEXT() Returns a formula as a string
+ - Financial Functions
+ - PDURATION() Calculates the number of periods required for an investment to reach a specified value
+ - RRI() Calculates the interest rate required for an investment to grow to a specified future value
+ - Engineering Functions
+ - ERF.PRECISE() Returns the error function integrated between 0 and a supplied limit
+ - ERFC.PRECISE() Synonym for ERFC
+ - Math and Trig Functions
+ - SEC() Returns the secant of an angle
+ - SECH() Returns the hyperbolic secant of an angle
+ - CSC() Returns the cosecant of an angle
+ - CSCH() Returns the hyperbolic cosecant of an angle
+ - COT() Returns the cotangent of an angle
+ - COTH() Returns the hyperbolic cotangent of an angle
+ - ACOT() Returns the cotangent of an angle
+ - ACOTH() Returns the hyperbolic cotangent of an angle
+- Refactored Complex Engineering Functions to use external complex number library
+- Added calculation engine support for the new complex number functions that were added in MS Excel 2013
+ - IMCOSH() Returns the hyperbolic cosine of a complex number
+ - IMCOT() Returns the cotangent of a complex number
+ - IMCSC() Returns the cosecant of a complex number
+ - IMCSCH() Returns the hyperbolic cosecant of a complex number
+ - IMSEC() Returns the secant of a complex number
+ - IMSECH() Returns the hyperbolic secant of a complex number
+ - IMSINH() Returns the hyperbolic sine of a complex number
+ - IMTAN() Returns the tangent of a complex number
+
+### Fixed
+
+- Fix ISFORMULA() function to work with a cell reference to another worksheet
+- Xlsx reader crashed when reading a file with workbook protection - [#553](https://github.com/PHPOffice/PhpSpreadsheet/pull/553)
+- Cell formats with escaped spaces were causing incorrect date formatting - [#557](https://github.com/PHPOffice/PhpSpreadsheet/issues/557)
+- Could not open CSV file containing HTML fragment - [#564](https://github.com/PHPOffice/PhpSpreadsheet/issues/564)
+- Exclude the vendor folder in migration - [#481](https://github.com/PHPOffice/PhpSpreadsheet/issues/481)
+- Chained operations on cell ranges involving borders operated on last cell only [#428](https://github.com/PHPOffice/PhpSpreadsheet/issues/428)
+- Avoid memory exhaustion when cloning worksheet with a drawing [#437](https://github.com/PHPOffice/PhpSpreadsheet/issues/437)
+- Migration tool keep variables containing $PHPExcel untouched [#598](https://github.com/PHPOffice/PhpSpreadsheet/issues/598)
+- Rowspans/colspans were incorrect when adding worksheet using loadIntoExisting [#619](https://github.com/PHPOffice/PhpSpreadsheet/issues/619)
+
+## [1.3.1] - 2018-06-12
+
+### Fixed
+
+- Ranges across Z and AA columns incorrectly threw an exception - [#545](https://github.com/PHPOffice/PhpSpreadsheet/issues/545)
+
+## [1.3.0] - 2018-06-10
+
+### Added
+
+- Support to read Xlsm templates with form elements, macros, printer settings, protected elements and back compatibility drawing, and save result without losing important elements of document - [#435](https://github.com/PHPOffice/PhpSpreadsheet/issues/435)
+- Expose sheet title maximum length as `Worksheet::SHEET_TITLE_MAXIMUM_LENGTH` - [#482](https://github.com/PHPOffice/PhpSpreadsheet/issues/482)
+- Allow escape character to be set in CSV reader – [#492](https://github.com/PHPOffice/PhpSpreadsheet/issues/492)
+
+### Fixed
+
+- Subtotal 9 in a group that has other subtotals 9 exclude the totals of the other subtotals in the range - [#332](https://github.com/PHPOffice/PhpSpreadsheet/issues/332)
+- `Helper\Html` support UTF-8 HTML input - [#444](https://github.com/PHPOffice/PhpSpreadsheet/issues/444)
+- Xlsx loaded an extra empty comment for each real comment - [#375](https://github.com/PHPOffice/PhpSpreadsheet/issues/375)
+- Xlsx reader do not read rows and columns filtered out in readFilter at all - [#370](https://github.com/PHPOffice/PhpSpreadsheet/issues/370)
+- Make newer Excel versions properly recalculate formulas on document open - [#456](https://github.com/PHPOffice/PhpSpreadsheet/issues/456)
+- `Coordinate::extractAllCellReferencesInRange()` throws an exception for an invalid range – [#519](https://github.com/PHPOffice/PhpSpreadsheet/issues/519)
+- Fixed parsing of conditionals in COUNTIF functions - [#526](https://github.com/PHPOffice/PhpSpreadsheet/issues/526)
+- Corruption errors for saved Xlsx docs with frozen panes - [#532](https://github.com/PHPOffice/PhpSpreadsheet/issues/532)
+
+## [1.2.1] - 2018-04-10
+
+### Fixed
+
+- Plain text and richtext mixed in same cell can be read - [#442](https://github.com/PHPOffice/PhpSpreadsheet/issues/442)
+
+## [1.2.0] - 2018-03-04
+
+### Added
+
+- HTML writer creates a generator meta tag - [#312](https://github.com/PHPOffice/PhpSpreadsheet/issues/312)
+- Support invalid zoom value in XLSX format - [#350](https://github.com/PHPOffice/PhpSpreadsheet/pull/350)
+- Support for `_xlfn.` prefixed functions and `ISFORMULA`, `MODE.SNGL`, `STDEV.S`, `STDEV.P` - [#390](https://github.com/PHPOffice/PhpSpreadsheet/pull/390)
+
+### Fixed
+
+- Avoid potentially unsupported PSR-16 cache keys - [#354](https://github.com/PHPOffice/PhpSpreadsheet/issues/354)
+- Check for MIME type to know if CSV reader can read a file - [#167](https://github.com/PHPOffice/PhpSpreadsheet/issues/167)
+- Use proper € symbol for currency format - [#379](https://github.com/PHPOffice/PhpSpreadsheet/pull/379)
+- Read printing area correctly when skipping some sheets - [#371](https://github.com/PHPOffice/PhpSpreadsheet/issues/371)
+- Avoid incorrectly overwriting calculated value type - [#394](https://github.com/PHPOffice/PhpSpreadsheet/issues/394)
+- Select correct cell when calling freezePane - [#389](https://github.com/PHPOffice/PhpSpreadsheet/issues/389)
+- `setStrikethrough()` did not set the font - [#403](https://github.com/PHPOffice/PhpSpreadsheet/issues/403)
+
+## [1.1.0] - 2018-01-28
+
+### Added
+
+- Support for PHP 7.2
+- Support cell comments in HTML writer and reader - [#308](https://github.com/PHPOffice/PhpSpreadsheet/issues/308)
+- Option to stop at a conditional styling, if it matches (only XLSX format) - [#292](https://github.com/PHPOffice/PhpSpreadsheet/pull/292)
+- Support for line width for data series when rendering Xlsx - [#329](https://github.com/PHPOffice/PhpSpreadsheet/pull/329)
+
+### Fixed
+
+- Better auto-detection of CSV separators - [#305](https://github.com/PHPOffice/PhpSpreadsheet/issues/305)
+- Support for shape style ending with `;` - [#304](https://github.com/PHPOffice/PhpSpreadsheet/issues/304)
+- Freeze Panes takes wrong coordinates for XLSX - [#322](https://github.com/PHPOffice/PhpSpreadsheet/issues/322)
+- `COLUMNS` and `ROWS` functions crashed in some cases - [#336](https://github.com/PHPOffice/PhpSpreadsheet/issues/336)
+- Support XML file without styles - [#331](https://github.com/PHPOffice/PhpSpreadsheet/pull/331)
+- Cell coordinates which are already a range cause an exception [#319](https://github.com/PHPOffice/PhpSpreadsheet/issues/319)
+
+## [1.0.0] - 2017-12-25
+
+### Added
+
+- Support to write merged cells in ODS format - [#287](https://github.com/PHPOffice/PhpSpreadsheet/issues/287)
+- Able to set the `topLeftCell` in freeze panes - [#261](https://github.com/PHPOffice/PhpSpreadsheet/pull/261)
+- Support `DateTimeImmutable` as cell value
+- Support migration of prefixed classes
+
+### Fixed
+
+- Can read very small HTML files - [#194](https://github.com/PHPOffice/PhpSpreadsheet/issues/194)
+- Written DataValidation was corrupted - [#290](https://github.com/PHPOffice/PhpSpreadsheet/issues/290)
+- Date format compatible with both LibreOffice and Excel - [#298](https://github.com/PHPOffice/PhpSpreadsheet/issues/298)
+
+### BREAKING CHANGE
+
+- Constant `TYPE_DOUGHTNUTCHART` is now `TYPE_DOUGHNUTCHART`.
+
+## [1.0.0-beta2] - 2017-11-26
+
+### Added
+
+- Support for chart fill color - @CrazyBite [#158](https://github.com/PHPOffice/PhpSpreadsheet/pull/158)
+- Support for read Hyperlink for xml - @GreatHumorist [#223](https://github.com/PHPOffice/PhpSpreadsheet/pull/223)
+- Support for cell value validation according to data validation rules - @SailorMax [#257](https://github.com/PHPOffice/PhpSpreadsheet/pull/257)
+- Support for custom implementation, or configuration, of PDF libraries - @SailorMax [#266](https://github.com/PHPOffice/PhpSpreadsheet/pull/266)
+
+### Changed
+
+- Merge data-validations to reduce written worksheet size - @billblume [#131](https://github.com/PHPOffice/PhpSpreadSheet/issues/131)
+- Throws exception if a XML file is invalid - @GreatHumorist [#222](https://github.com/PHPOffice/PhpSpreadsheet/pull/222)
+- Upgrade to mPDF 7.0+ - [#144](https://github.com/PHPOffice/PhpSpreadsheet/issues/144)
+
+### Fixed
+
+- Control characters in cell values are automatically escaped - [#212](https://github.com/PHPOffice/PhpSpreadsheet/issues/212)
+- Prevent color changing when copy/pasting xls files written by PhpSpreadsheet to another file - @al-lala [#218](https://github.com/PHPOffice/PhpSpreadsheet/issues/218)
+- Add cell reference automatic when there is no cell reference('r' attribute) in Xlsx file. - @GreatHumorist [#225](https://github.com/PHPOffice/PhpSpreadsheet/pull/225) Refer to [issue#201](https://github.com/PHPOffice/PhpSpreadsheet/issues/201)
+- `Reader\Xlsx::getFromZipArchive()` function return false if the zip entry could not be located. - @anton-harvey [#268](https://github.com/PHPOffice/PhpSpreadsheet/pull/268)
+
+### BREAKING CHANGE
+
+- Extracted coordinate method to dedicate class [migration guide](./docs/topics/migration-from-PHPExcel.md).
+- Column indexes are based on 1, see the [migration guide](./docs/topics/migration-from-PHPExcel.md).
+- Standardization of array keys used for style, see the [migration guide](./docs/topics/migration-from-PHPExcel.md).
+- Easier usage of PDF writers, and other custom readers and writers, see the [migration guide](./docs/topics/migration-from-PHPExcel.md).
+- Easier usage of chart renderers, see the [migration guide](./docs/topics/migration-from-PHPExcel.md).
+- Rename a few more classes to keep them in their related namespaces:
+ - `CalcEngine` => `Calculation\Engine`
+ - `PhpSpreadsheet\Calculation` => `PhpSpreadsheet\Calculation\Calculation`
+ - `PhpSpreadsheet\Cell` => `PhpSpreadsheet\Cell\Cell`
+ - `PhpSpreadsheet\Chart` => `PhpSpreadsheet\Chart\Chart`
+ - `PhpSpreadsheet\RichText` => `PhpSpreadsheet\RichText\RichText`
+ - `PhpSpreadsheet\Style` => `PhpSpreadsheet\Style\Style`
+ - `PhpSpreadsheet\Worksheet` => `PhpSpreadsheet\Worksheet\Worksheet`
+
+## [1.0.0-beta] - 2017-08-17
+
+### Added
+
+- Initial implementation of SUMIFS() function
+- Additional codepages
+- MemoryDrawing not working in HTML writer [#808](https://github.com/PHPOffice/PHPExcel/issues/808)
+- CSV Reader can auto-detect the separator used in file [#141](https://github.com/PHPOffice/PhpSpreadsheet/pull/141)
+- HTML Reader supports some basic inline styles [#180](https://github.com/PHPOffice/PhpSpreadsheet/pull/180)
+
+### Changed
+
+- Start following [SemVer](https://semver.org) properly.
+
+### Fixed
+
+- Fix to getCell() method when cell reference includes a worksheet reference - @MarkBaker
+- Ignore inlineStr type if formula element exists - @ncrypthic [#570](https://github.com/PHPOffice/PHPExcel/issues/570)
+- Excel 2007 Reader freezes because of conditional formatting - @rentalhost [#575](https://github.com/PHPOffice/PHPExcel/issues/575)
+- Readers will now parse files containing worksheet titles over 31 characters [#176](https://github.com/PHPOffice/PhpSpreadsheet/pull/176)
+
+### General
+
+- Whitespace after toRichTextObject() - @MarkBaker [#554](https://github.com/PHPOffice/PHPExcel/issues/554)
+- Optimize vlookup() sort - @umpirsky [#548](https://github.com/PHPOffice/PHPExcel/issues/548)
+- c:max and c:min elements shall NOT be inside c:orientation elements - @vitalyrepin [#869](https://github.com/PHPOffice/PHPExcel/pull/869)
+- Implement actual timezone adjustment into PHPExcel_Shared_Date::PHPToExcel - @sim642 [#489](https://github.com/PHPOffice/PHPExcel/pull/489)
+
+### BREAKING CHANGE
+
+- Introduction of namespaces for all classes, eg: `PHPExcel_Calculation_Functions` becomes `PhpOffice\PhpSpreadsheet\Calculation\Functions`
+- Some classes were renamed for clarity and/or consistency:
+
+For a comprehensive list of all class changes, and a semi-automated migration path, read the [migration guide](./docs/topics/migration-from-PHPExcel.md).
+
+- Dropped `PHPExcel_Calculation_Functions::VERSION()`. Composer or git should be used to know the version.
+- Dropped `PHPExcel_Settings::setPdfRenderer()` and `PHPExcel_Settings::setPdfRenderer()`. Composer should be used to autoload PDF libs.
+- Dropped support for HHVM
+
+## Previous versions of PHPExcel
+
+The changelog for the project when it was called PHPExcel is [still available](./CHANGELOG.PHPExcel.md).
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md
new file mode 100644
index 00000000000..aed13fe2db2
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/CONTRIBUTING.md
@@ -0,0 +1,11 @@
+# Want to contribute?
+
+If you would like to contribute, here are some notes and guidelines:
+
+ - All new development happens on feature/fix branches, and are then merged to the `master` branch once stable; so the `master` branch is always the most up-to-date, working code
+ - Tagged releases are made from the `master` branch
+ - If you are going to be submitting a pull request, please fork from `master`, and submit your pull request back as a fix/feature branch referencing the GitHub issue number
+ - Code style might be automatically fixed by `composer fix`
+ - All code changes must be validated by `composer check`
+ - [Helpful article about forking](https://help.github.com/articles/fork-a-repo/ "Forking a GitHub repository")
+ - [Helpful article about pull requests](https://help.github.com/articles/using-pull-requests/ "Pull Requests")
diff --git a/lib/phpexcel/PHPExcel/Shared/PCLZip/gnu-lgpl.txt b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/LICENSE
similarity index 68%
rename from lib/phpexcel/PHPExcel/Shared/PCLZip/gnu-lgpl.txt
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/LICENSE
index cbee875ba6d..c7338e3c2e4 100644
--- a/lib/phpexcel/PHPExcel/Shared/PCLZip/gnu-lgpl.txt
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/LICENSE
@@ -1,504 +1,345 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL. It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
- Preamble
-
- The licenses for most software are designed to take away your
-freedom to share and change it. By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
- This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it. You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
- When we speak of free software, we are referring to freedom of use,
-not price. Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
- To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights. These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
- For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you. You must make sure that they, too, receive or can get the source
-code. If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it. And you must show them these terms so they know their rights.
-
- We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
- To protect each distributor, we want to make it very clear that
-there is no warranty for the free library. Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
- Finally, software patents pose a constant threat to the existence of
-any free program. We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder. Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
- Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License. This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License. We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
- When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library. The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom. The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
- We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License. It also provides other free software developers Less
-of an advantage over competing non-free programs. These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries. However, the Lesser license provides advantages in certain
-special circumstances.
-
- For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard. To achieve this, non-free programs must be
-allowed to use the library. A more frequent case is that a free
-library does the same job as widely used non-free libraries. In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
- In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software. For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
- Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
- The precise terms and conditions for copying, distribution and
-modification follow. Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library". The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
- GNU LESSER GENERAL PUBLIC LICENSE
- TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
- 0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
- A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
- The "Library", below, refers to any such software library or work
-which has been distributed under these terms. A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language. (Hereinafter, translation is
-included without limitation in the term "modification".)
-
- "Source code" for a work means the preferred form of the work for
-making modifications to it. For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
- Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope. The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it). Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-
- 1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
- You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
- 2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
- a) The modified work must itself be a software library.
-
- b) You must cause the files modified to carry prominent notices
- stating that you changed the files and the date of any change.
-
- c) You must cause the whole of the work to be licensed at no
- charge to all third parties under the terms of this License.
-
- d) If a facility in the modified Library refers to a function or a
- table of data to be supplied by an application program that uses
- the facility, other than as an argument passed when the facility
- is invoked, then you must make a good faith effort to ensure that,
- in the event an application does not supply such function or
- table, the facility still operates, and performs whatever part of
- its purpose remains meaningful.
-
- (For example, a function in a library to compute square roots has
- a purpose that is entirely well-defined independent of the
- application. Therefore, Subsection 2d requires that any
- application-supplied function or table used by this function must
- be optional: if the application does not supply it, the square
- root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole. If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works. But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
- 3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library. To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License. (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.) Do not make any other change in
-these notices.
-
- Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
- This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
- 4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
- If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
- 5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library". Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
- However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library". The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
- When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library. The
-threshold for this to be true is not precisely defined by law.
-
- If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work. (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
- Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
- 6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
- You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License. You must supply a copy of this License. If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License. Also, you must do one
-of these things:
-
- a) Accompany the work with the complete corresponding
- machine-readable source code for the Library including whatever
- changes were used in the work (which must be distributed under
- Sections 1 and 2 above); and, if the work is an executable linked
- with the Library, with the complete machine-readable "work that
- uses the Library", as object code and/or source code, so that the
- user can modify the Library and then relink to produce a modified
- executable containing the modified Library. (It is understood
- that the user who changes the contents of definitions files in the
- Library will not necessarily be able to recompile the application
- to use the modified definitions.)
-
- b) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (1) uses at run time a
- copy of the library already present on the user's computer system,
- rather than copying library functions into the executable, and (2)
- will operate properly with a modified version of the library, if
- the user installs one, as long as the modified version is
- interface-compatible with the version that the work was made with.
-
- c) Accompany the work with a written offer, valid for at
- least three years, to give the same user the materials
- specified in Subsection 6a, above, for a charge no more
- than the cost of performing this distribution.
-
- d) If distribution of the work is made by offering access to copy
- from a designated place, offer equivalent access to copy the above
- specified materials from the same place.
-
- e) Verify that the user has already received a copy of these
- materials or that you have already sent this user a copy.
-
- For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it. However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
- It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system. Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
- 7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities. This must be distributed under the terms of the
- Sections above.
-
- b) Give prominent notice with the combined library of the fact
- that part of it is a work based on the Library, and explaining
- where to find the accompanying uncombined form of the same work.
-
- 8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License. Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License. However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
- 9. You are not required to accept this License, since you have not
-signed it. However, nothing else grants you permission to modify or
-distribute the Library or its derivative works. These actions are
-prohibited by law if you do not accept this License. Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
- 10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions. You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
- 11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all. For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices. Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
- 12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded. In such case, this License incorporates the limitation as if
-written in the body of this License.
-
- 13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation. If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
- 14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission. For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this. Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
- NO WARRANTY
-
- 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Libraries
-
- If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change. You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
- To apply these terms, attach the following notices to the library. It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-
- Copyright (C)
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary. Here is a sample; alter the names:
-
- Yoyodyne, Inc., hereby disclaims all copyright interest in the
- library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
- , 1 April 1990
- Ty Coon, President of Vice
-
-That's all there is to it!
-
-
+GNU LESSER GENERAL PUBLIC LICENSE
+
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/composer.json b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/composer.json
new file mode 100644
index 00000000000..6a2a9e37369
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/composer.json
@@ -0,0 +1,87 @@
+{
+ "name": "phpoffice/phpspreadsheet",
+ "description": "PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine",
+ "keywords": ["PHP", "OpenXML", "Excel", "xlsx", "xls", "ods", "gnumeric", "spreadsheet"],
+ "homepage": "https://github.com/PHPOffice/PhpSpreadsheet",
+ "type": "library",
+ "license": "LGPL-2.1-or-later",
+ "authors": [
+ {
+ "name": "Maarten Balliauw",
+ "homepage": "https://blog.maartenballiauw.be"
+ },
+ {
+ "name": "Mark Baker",
+ "homepage": "https://markbakeruk.net"
+ },
+ {
+ "name": "Franck Lefevre",
+ "homepage": "https://rootslabs.net"
+ },
+ {
+ "name": "Erik Tilt"
+ },
+ {
+ "name": "Adrien Crivelli"
+ }
+ ],
+ "scripts": {
+ "check": [
+ "php-cs-fixer fix --ansi --dry-run --diff",
+ "phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PSR2 -n",
+ "phpunit --color=always"
+ ],
+ "fix": [
+ "php-cs-fixer fix --ansi"
+ ],
+ "versions": [
+ "phpcs --report-width=200 samples/ src/ tests/ --ignore=samples/Header.php --standard=PHPCompatibility --runtime-set testVersion 5.6- -n"
+ ]
+ },
+ "require": {
+ "php": "^5.6|^7.0",
+ "ext-ctype": "*",
+ "ext-dom": "*",
+ "ext-gd": "*",
+ "ext-iconv": "*",
+ "ext-fileinfo": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "ext-SimpleXML": "*",
+ "ext-xml": "*",
+ "ext-xmlreader": "*",
+ "ext-xmlwriter": "*",
+ "ext-zip": "*",
+ "ext-zlib": "*",
+ "psr/simple-cache": "^1.0",
+ "markbaker/complex": "^1.4",
+ "markbaker/matrix": "^1.1"
+ },
+ "require-dev": {
+ "tecnickcom/tcpdf": "^6.2",
+ "phpunit/phpunit": "^5.7",
+ "doctrine/instantiator": "^1.0.0",
+ "dompdf/dompdf": "^0.8.0",
+ "mpdf/mpdf": "^7.0.0",
+ "jpgraph/jpgraph": "^4.0",
+ "friendsofphp/php-cs-fixer": "@stable",
+ "phpcompatibility/php-compatibility": "^8.0",
+ "squizlabs/php_codesniffer": "^3.3"
+ },
+ "suggest": {
+ "mpdf/mpdf": "Option for rendering PDF with PDF Writer",
+ "dompdf/dompdf": "Option for rendering PDF with PDF Writer",
+ "tecnickcom/tcpdf": "Option for rendering PDF with PDF Writer",
+ "jpgraph/jpgraph": "Option for rendering charts, or including charts with PDF or HTML Writers"
+ },
+ "autoload": {
+ "psr-4": {
+ "PhpOffice\\PhpSpreadsheet\\": "src/PhpSpreadsheet"
+ }
+ },
+ "autoload-dev": {
+ "psr-4": {
+ "PhpOffice\\PhpSpreadsheetTests\\": "tests/PhpSpreadsheetTests"
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/composer.lock b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/composer.lock
new file mode 100644
index 00000000000..19940ce89e1
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/composer.lock
@@ -0,0 +1,3211 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
+ "This file is @generated automatically"
+ ],
+ "content-hash": "d70247696f417581626dde9641b53bdc",
+ "packages": [
+ {
+ "name": "markbaker/complex",
+ "version": "1.4.7",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/MarkBaker/PHPComplex.git",
+ "reference": "1ea674a8308baf547cbcbd30c5fcd6d301b7c000"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/MarkBaker/PHPComplex/zipball/1ea674a8308baf547cbcbd30c5fcd6d301b7c000",
+ "reference": "1ea674a8308baf547cbcbd30c5fcd6d301b7c000",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.6.0|^7.0.0"
+ },
+ "require-dev": {
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3",
+ "phpcompatibility/php-compatibility": "^8.0",
+ "phpdocumentor/phpdocumentor": "2.*",
+ "phploc/phploc": "2.*",
+ "phpmd/phpmd": "2.*",
+ "phpunit/phpunit": "^4.8.35|^5.4.0",
+ "sebastian/phpcpd": "2.*",
+ "squizlabs/php_codesniffer": "^3.3.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Complex\\": "classes/src/"
+ },
+ "files": [
+ "classes/src/functions/abs.php",
+ "classes/src/functions/acos.php",
+ "classes/src/functions/acosh.php",
+ "classes/src/functions/acot.php",
+ "classes/src/functions/acoth.php",
+ "classes/src/functions/acsc.php",
+ "classes/src/functions/acsch.php",
+ "classes/src/functions/argument.php",
+ "classes/src/functions/asec.php",
+ "classes/src/functions/asech.php",
+ "classes/src/functions/asin.php",
+ "classes/src/functions/asinh.php",
+ "classes/src/functions/atan.php",
+ "classes/src/functions/atanh.php",
+ "classes/src/functions/conjugate.php",
+ "classes/src/functions/cos.php",
+ "classes/src/functions/cosh.php",
+ "classes/src/functions/cot.php",
+ "classes/src/functions/coth.php",
+ "classes/src/functions/csc.php",
+ "classes/src/functions/csch.php",
+ "classes/src/functions/exp.php",
+ "classes/src/functions/inverse.php",
+ "classes/src/functions/ln.php",
+ "classes/src/functions/log2.php",
+ "classes/src/functions/log10.php",
+ "classes/src/functions/negative.php",
+ "classes/src/functions/pow.php",
+ "classes/src/functions/rho.php",
+ "classes/src/functions/sec.php",
+ "classes/src/functions/sech.php",
+ "classes/src/functions/sin.php",
+ "classes/src/functions/sinh.php",
+ "classes/src/functions/sqrt.php",
+ "classes/src/functions/tan.php",
+ "classes/src/functions/tanh.php",
+ "classes/src/functions/theta.php",
+ "classes/src/operations/add.php",
+ "classes/src/operations/subtract.php",
+ "classes/src/operations/multiply.php",
+ "classes/src/operations/divideby.php",
+ "classes/src/operations/divideinto.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mark Baker",
+ "email": "mark@lange.demon.co.uk"
+ }
+ ],
+ "description": "PHP Class for working with complex numbers",
+ "homepage": "https://github.com/MarkBaker/PHPComplex",
+ "keywords": [
+ "complex",
+ "mathematics"
+ ],
+ "time": "2018-10-13T23:28:42+00:00"
+ },
+ {
+ "name": "markbaker/matrix",
+ "version": "1.1.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/MarkBaker/PHPMatrix.git",
+ "reference": "6ea97472b5baf12119b4f31f802835b820dd6d64"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/MarkBaker/PHPMatrix/zipball/6ea97472b5baf12119b4f31f802835b820dd6d64",
+ "reference": "6ea97472b5baf12119b4f31f802835b820dd6d64",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.6.0|^7.0.0"
+ },
+ "require-dev": {
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3",
+ "phpcompatibility/php-compatibility": "^8.0",
+ "phpdocumentor/phpdocumentor": "2.*",
+ "phploc/phploc": "2.*",
+ "phpmd/phpmd": "2.*",
+ "phpunit/phpunit": "^4.8.35|^5.4.0",
+ "sebastian/phpcpd": "2.*",
+ "squizlabs/php_codesniffer": "^3.3.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Matrix\\": "classes/src/"
+ },
+ "files": [
+ "classes/src/functions/adjoint.php",
+ "classes/src/functions/antidiagonal.php",
+ "classes/src/functions/cofactors.php",
+ "classes/src/functions/determinant.php",
+ "classes/src/functions/diagonal.php",
+ "classes/src/functions/identity.php",
+ "classes/src/functions/inverse.php",
+ "classes/src/functions/minors.php",
+ "classes/src/functions/trace.php",
+ "classes/src/functions/transpose.php",
+ "classes/src/operations/add.php",
+ "classes/src/operations/directsum.php",
+ "classes/src/operations/subtract.php",
+ "classes/src/operations/multiply.php",
+ "classes/src/operations/divideby.php",
+ "classes/src/operations/divideinto.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mark Baker",
+ "email": "mark@lange.demon.co.uk"
+ }
+ ],
+ "description": "PHP Class for working with matrices",
+ "homepage": "https://github.com/MarkBaker/PHPMatrix",
+ "keywords": [
+ "mathematics",
+ "matrix",
+ "vector"
+ ],
+ "time": "2018-11-04T22:12:12+00:00"
+ },
+ {
+ "name": "psr/simple-cache",
+ "version": "1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/simple-cache.git",
+ "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
+ "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\SimpleCache\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interfaces for simple caching",
+ "keywords": [
+ "cache",
+ "caching",
+ "psr",
+ "psr-16",
+ "simple-cache"
+ ],
+ "time": "2017-10-23T01:57:42+00:00"
+ }
+ ],
+ "packages-dev": [
+ {
+ "name": "composer/semver",
+ "version": "1.4.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/semver.git",
+ "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/semver/zipball/c7cb9a2095a074d131b65a8a0cd294479d785573",
+ "reference": "c7cb9a2095a074d131b65a8a0cd294479d785573",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.2 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.5 || ^5.0.5",
+ "phpunit/phpunit-mock-objects": "2.3.0 || ^3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Composer\\Semver\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nils Adermann",
+ "email": "naderman@naderman.de",
+ "homepage": "http://www.naderman.de"
+ },
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be"
+ },
+ {
+ "name": "Rob Bast",
+ "email": "rob.bast@gmail.com",
+ "homepage": "http://robbast.nl"
+ }
+ ],
+ "description": "Semver library that offers utilities, version constraint parsing and validation.",
+ "keywords": [
+ "semantic",
+ "semver",
+ "validation",
+ "versioning"
+ ],
+ "time": "2016-08-30T16:08:34+00:00"
+ },
+ {
+ "name": "composer/xdebug-handler",
+ "version": "1.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/composer/xdebug-handler.git",
+ "reference": "b8e9745fb9b06ea6664d8872c4505fb16df4611c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/b8e9745fb9b06ea6664d8872c4505fb16df4611c",
+ "reference": "b8e9745fb9b06ea6664d8872c4505fb16df4611c",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.2 || ^7.0",
+ "psr/log": "^1.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "Composer\\XdebugHandler\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "John Stevenson",
+ "email": "john-stevenson@blueyonder.co.uk"
+ }
+ ],
+ "description": "Restarts a process without xdebug.",
+ "keywords": [
+ "Xdebug",
+ "performance"
+ ],
+ "time": "2018-08-31T19:07:57+00:00"
+ },
+ {
+ "name": "doctrine/annotations",
+ "version": "v1.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/annotations.git",
+ "reference": "54cacc9b81758b14e3ce750f205a393d52339e97"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/annotations/zipball/54cacc9b81758b14e3ce750f205a393d52339e97",
+ "reference": "54cacc9b81758b14e3ce750f205a393d52339e97",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/lexer": "1.*",
+ "php": "^5.6 || ^7.0"
+ },
+ "require-dev": {
+ "doctrine/cache": "1.*",
+ "phpunit/phpunit": "^5.7"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Benjamin Eberlei",
+ "email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Docblock Annotations Parser",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "annotations",
+ "docblock",
+ "parser"
+ ],
+ "time": "2017-02-24T16:22:25+00:00"
+ },
+ {
+ "name": "doctrine/instantiator",
+ "version": "1.0.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/instantiator.git",
+ "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d",
+ "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3,<8.0-DEV"
+ },
+ "require-dev": {
+ "athletic/athletic": "~0.1.8",
+ "ext-pdo": "*",
+ "ext-phar": "*",
+ "phpunit/phpunit": "~4.0",
+ "squizlabs/php_codesniffer": "~2.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Marco Pivetta",
+ "email": "ocramius@gmail.com",
+ "homepage": "http://ocramius.github.com/"
+ }
+ ],
+ "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors",
+ "homepage": "https://github.com/doctrine/instantiator",
+ "keywords": [
+ "constructor",
+ "instantiate"
+ ],
+ "time": "2015-06-14T21:17:01+00:00"
+ },
+ {
+ "name": "doctrine/lexer",
+ "version": "v1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/doctrine/lexer.git",
+ "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/doctrine/lexer/zipball/83893c552fd2045dd78aef794c31e694c37c0b8c",
+ "reference": "83893c552fd2045dd78aef794c31e694c37c0b8c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Doctrine\\Common\\Lexer\\": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Roman Borschel",
+ "email": "roman@code-factory.org"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Johannes Schmitt",
+ "email": "schmittjoh@gmail.com"
+ }
+ ],
+ "description": "Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.",
+ "homepage": "http://www.doctrine-project.org",
+ "keywords": [
+ "lexer",
+ "parser"
+ ],
+ "time": "2014-09-09T13:34:57+00:00"
+ },
+ {
+ "name": "dompdf/dompdf",
+ "version": "v0.8.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/dompdf/dompdf.git",
+ "reference": "5113accd9ae5d466077cce5208dcf3fb871bf8f6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/dompdf/dompdf/zipball/5113accd9ae5d466077cce5208dcf3fb871bf8f6",
+ "reference": "5113accd9ae5d466077cce5208dcf3fb871bf8f6",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-gd": "*",
+ "ext-mbstring": "*",
+ "phenx/php-font-lib": "0.5.*",
+ "phenx/php-svg-lib": "0.3.*",
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.8.*",
+ "squizlabs/php_codesniffer": "2.*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-develop": "0.7-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Dompdf\\": "src/"
+ },
+ "classmap": [
+ "lib/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-2.1"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Ménager",
+ "email": "fabien.menager@gmail.com"
+ },
+ {
+ "name": "Brian Sweeney",
+ "email": "eclecticgeek@gmail.com"
+ },
+ {
+ "name": "Gabriel Bull",
+ "email": "me@gabrielbull.com"
+ }
+ ],
+ "description": "DOMPDF is a CSS 2.1 compliant HTML to PDF converter",
+ "homepage": "https://github.com/dompdf/dompdf",
+ "time": "2017-11-26T14:49:08+00:00"
+ },
+ {
+ "name": "friendsofphp/php-cs-fixer",
+ "version": "v2.13.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git",
+ "reference": "54814c62d5beef3ba55297b9b3186ed8b8a1b161"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/54814c62d5beef3ba55297b9b3186ed8b8a1b161",
+ "reference": "54814c62d5beef3ba55297b9b3186ed8b8a1b161",
+ "shasum": ""
+ },
+ "require": {
+ "composer/semver": "^1.4",
+ "composer/xdebug-handler": "^1.2",
+ "doctrine/annotations": "^1.2",
+ "ext-json": "*",
+ "ext-tokenizer": "*",
+ "php": "^5.6 || >=7.0 <7.3",
+ "php-cs-fixer/diff": "^1.3",
+ "symfony/console": "^3.4.17 || ^4.1.6",
+ "symfony/event-dispatcher": "^3.0 || ^4.0",
+ "symfony/filesystem": "^3.0 || ^4.0",
+ "symfony/finder": "^3.0 || ^4.0",
+ "symfony/options-resolver": "^3.0 || ^4.0",
+ "symfony/polyfill-php70": "^1.0",
+ "symfony/polyfill-php72": "^1.4",
+ "symfony/process": "^3.0 || ^4.0",
+ "symfony/stopwatch": "^3.0 || ^4.0"
+ },
+ "conflict": {
+ "hhvm": "*"
+ },
+ "require-dev": {
+ "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0",
+ "justinrainbow/json-schema": "^5.0",
+ "keradus/cli-executor": "^1.1",
+ "mikey179/vfsstream": "^1.6",
+ "php-coveralls/php-coveralls": "^2.1",
+ "php-cs-fixer/accessible-object": "^1.0",
+ "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.0.1",
+ "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.0.1",
+ "phpunit/phpunit": "^5.7.27 || ^6.5.8 || ^7.1",
+ "phpunitgoodpractices/traits": "^1.5.1",
+ "symfony/phpunit-bridge": "^4.0"
+ },
+ "suggest": {
+ "ext-mbstring": "For handling non-UTF8 characters in cache signature.",
+ "php-cs-fixer/phpunit-constraint-isidenticalstring": "For IsIdenticalString constraint.",
+ "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "For XmlMatchesXsd constraint.",
+ "symfony/polyfill-mbstring": "When enabling `ext-mbstring` is not possible."
+ },
+ "bin": [
+ "php-cs-fixer"
+ ],
+ "type": "application",
+ "autoload": {
+ "psr-4": {
+ "PhpCsFixer\\": "src/"
+ },
+ "classmap": [
+ "tests/Test/AbstractFixerTestCase.php",
+ "tests/Test/AbstractIntegrationCaseFactory.php",
+ "tests/Test/AbstractIntegrationTestCase.php",
+ "tests/Test/Assert/AssertTokensTrait.php",
+ "tests/Test/IntegrationCase.php",
+ "tests/Test/IntegrationCaseFactory.php",
+ "tests/Test/IntegrationCaseFactoryInterface.php",
+ "tests/Test/InternalIntegrationCaseFactory.php",
+ "tests/TestCase.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Dariusz Rumiński",
+ "email": "dariusz.ruminski@gmail.com"
+ },
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "A tool to automatically fix PHP code style",
+ "time": "2018-10-21T00:32:10+00:00"
+ },
+ {
+ "name": "jpgraph/jpgraph",
+ "version": "4.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/ztec/JpGraph.git",
+ "reference": "e82db7da6a546d3926c24c9a346226da7aa49094"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/ztec/JpGraph/zipball/e82db7da6a546d3926c24c9a346226da7aa49094",
+ "reference": "e82db7da6a546d3926c24c9a346226da7aa49094",
+ "shasum": ""
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "lib/JpGraph.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "QPL 1.0"
+ ],
+ "authors": [
+ {
+ "name": "JpGraph team"
+ }
+ ],
+ "description": "jpGraph, library to make graphs and charts",
+ "homepage": "http://jpgraph.net/",
+ "keywords": [
+ "chart",
+ "data",
+ "graph",
+ "jpgraph",
+ "pie"
+ ],
+ "time": "2017-02-23T09:44:15+00:00"
+ },
+ {
+ "name": "mpdf/mpdf",
+ "version": "v7.1.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/mpdf/mpdf.git",
+ "reference": "ef5d8cf2c63def40fb76fc0a9e286721cb4dffcd"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/mpdf/mpdf/zipball/ef5d8cf2c63def40fb76fc0a9e286721cb4dffcd",
+ "reference": "ef5d8cf2c63def40fb76fc0a9e286721cb4dffcd",
+ "shasum": ""
+ },
+ "require": {
+ "ext-gd": "*",
+ "ext-mbstring": "*",
+ "myclabs/deep-copy": "^1.7",
+ "paragonie/random_compat": "^1.4|^2.0|9.99.99",
+ "php": "^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0",
+ "psr/log": "^1.0",
+ "setasign/fpdi": "1.6.*"
+ },
+ "require-dev": {
+ "mockery/mockery": "^0.9.5",
+ "phpunit/phpunit": "^5.0",
+ "squizlabs/php_codesniffer": "^2.7.0",
+ "tracy/tracy": "^2.4"
+ },
+ "suggest": {
+ "ext-bcmath": "Needed for generation of some types of barcodes",
+ "ext-xml": "Needed mainly for SVG manipulation",
+ "ext-zlib": "Needed for compression of embedded resources, such as fonts"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-development": "7.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Mpdf\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "GPL-2.0-only"
+ ],
+ "authors": [
+ {
+ "name": "Matěj Humpál",
+ "role": "Developer, maintainer"
+ },
+ {
+ "name": "Ian Back",
+ "role": "Developer (retired)"
+ }
+ ],
+ "description": "A PHP class to generate PDF files from HTML with Unicode/UTF-8 and CJK support",
+ "homepage": "https://mpdf.github.io",
+ "keywords": [
+ "pdf",
+ "php",
+ "utf-8"
+ ],
+ "time": "2018-10-18T11:37:12+00:00"
+ },
+ {
+ "name": "myclabs/deep-copy",
+ "version": "1.7.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/myclabs/DeepCopy.git",
+ "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e",
+ "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.6 || ^7.0"
+ },
+ "require-dev": {
+ "doctrine/collections": "^1.0",
+ "doctrine/common": "^2.6",
+ "phpunit/phpunit": "^4.1"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "DeepCopy\\": "src/DeepCopy/"
+ },
+ "files": [
+ "src/DeepCopy/deep_copy.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Create deep copies (clones) of your objects",
+ "keywords": [
+ "clone",
+ "copy",
+ "duplicate",
+ "object",
+ "object graph"
+ ],
+ "time": "2017-10-19T19:58:43+00:00"
+ },
+ {
+ "name": "paragonie/random_compat",
+ "version": "v2.0.17",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/paragonie/random_compat.git",
+ "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/paragonie/random_compat/zipball/29af24f25bab834fcbb38ad2a69fa93b867e070d",
+ "reference": "29af24f25bab834fcbb38ad2a69fa93b867e070d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.2.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.*|5.*"
+ },
+ "suggest": {
+ "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
+ },
+ "type": "library",
+ "autoload": {
+ "files": [
+ "lib/random.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Paragon Initiative Enterprises",
+ "email": "security@paragonie.com",
+ "homepage": "https://paragonie.com"
+ }
+ ],
+ "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
+ "keywords": [
+ "csprng",
+ "polyfill",
+ "pseudorandom",
+ "random"
+ ],
+ "time": "2018-07-04T16:31:37+00:00"
+ },
+ {
+ "name": "phenx/php-font-lib",
+ "version": "0.5.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PhenX/php-font-lib.git",
+ "reference": "760148820110a1ae0936e5cc35851e25a938bc97"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PhenX/php-font-lib/zipball/760148820110a1ae0936e5cc35851e25a938bc97",
+ "reference": "760148820110a1ae0936e5cc35851e25a938bc97",
+ "shasum": ""
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "FontLib\\": "src/FontLib"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Ménager",
+ "email": "fabien.menager@gmail.com"
+ }
+ ],
+ "description": "A library to read, parse, export and make subsets of different types of font files.",
+ "homepage": "https://github.com/PhenX/php-font-lib",
+ "time": "2017-09-13T16:14:37+00:00"
+ },
+ {
+ "name": "phenx/php-svg-lib",
+ "version": "v0.3.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PhenX/php-svg-lib.git",
+ "reference": "ccc46ef6340d4b8a4a68047e68d8501ea961442c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PhenX/php-svg-lib/zipball/ccc46ef6340d4b8a4a68047e68d8501ea961442c",
+ "reference": "ccc46ef6340d4b8a4a68047e68d8501ea961442c",
+ "shasum": ""
+ },
+ "require": {
+ "sabberworm/php-css-parser": "8.1.*"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~5.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Svg\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Ménager",
+ "email": "fabien.menager@gmail.com"
+ }
+ ],
+ "description": "A library to read, parse and export to PDF SVG files.",
+ "homepage": "https://github.com/PhenX/php-svg-lib",
+ "time": "2018-06-03T10:10:03+00:00"
+ },
+ {
+ "name": "php-cs-fixer/diff",
+ "version": "v1.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PHP-CS-Fixer/diff.git",
+ "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/78bb099e9c16361126c86ce82ec4405ebab8e756",
+ "reference": "78bb099e9c16361126c86ce82ec4405ebab8e756",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.6 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^5.7.23 || ^6.4.3",
+ "symfony/process": "^3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "SpacePossum"
+ }
+ ],
+ "description": "sebastian/diff v2 backport support for PHP5.6",
+ "homepage": "https://github.com/PHP-CS-Fixer",
+ "keywords": [
+ "diff"
+ ],
+ "time": "2018-02-15T16:58:55+00:00"
+ },
+ {
+ "name": "phpcompatibility/php-compatibility",
+ "version": "8.2.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
+ "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/eaf613c1a8265bcfd7b0ab690783f2aef519f78a",
+ "reference": "eaf613c1a8265bcfd7b0ab690783f2aef519f78a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3",
+ "squizlabs/php_codesniffer": "^2.3 || ^3.0.2"
+ },
+ "conflict": {
+ "squizlabs/php_codesniffer": "2.6.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0"
+ },
+ "suggest": {
+ "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.",
+ "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
+ },
+ "type": "phpcodesniffer-standard",
+ "autoload": {
+ "psr-4": {
+ "PHPCompatibility\\": "PHPCompatibility/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0-or-later"
+ ],
+ "authors": [
+ {
+ "name": "Wim Godden",
+ "role": "lead"
+ }
+ ],
+ "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP version compatibility.",
+ "homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
+ "keywords": [
+ "compatibility",
+ "phpcs",
+ "standards"
+ ],
+ "time": "2018-07-17T13:42:26+00:00"
+ },
+ {
+ "name": "phpdocumentor/reflection-common",
+ "version": "1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpDocumentor/ReflectionCommon.git",
+ "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
+ "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.5"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.6"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": [
+ "src"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jaap van Otterdijk",
+ "email": "opensource@ijaap.nl"
+ }
+ ],
+ "description": "Common reflection classes used by phpdocumentor to reflect the code structure",
+ "homepage": "http://www.phpdoc.org",
+ "keywords": [
+ "FQSEN",
+ "phpDocumentor",
+ "phpdoc",
+ "reflection",
+ "static analysis"
+ ],
+ "time": "2017-09-11T18:02:19+00:00"
+ },
+ {
+ "name": "phpdocumentor/reflection-docblock",
+ "version": "3.3.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git",
+ "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2",
+ "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.6 || ^7.0",
+ "phpdocumentor/reflection-common": "^1.0.0",
+ "phpdocumentor/type-resolver": "^0.4.0",
+ "webmozart/assert": "^1.0"
+ },
+ "require-dev": {
+ "mockery/mockery": "^0.9.4",
+ "phpunit/phpunit": "^4.4"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": [
+ "src/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mike van Riel",
+ "email": "me@mikevanriel.com"
+ }
+ ],
+ "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.",
+ "time": "2017-11-10T14:09:06+00:00"
+ },
+ {
+ "name": "phpdocumentor/type-resolver",
+ "version": "0.4.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpDocumentor/TypeResolver.git",
+ "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7",
+ "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5 || ^7.0",
+ "phpdocumentor/reflection-common": "^1.0"
+ },
+ "require-dev": {
+ "mockery/mockery": "^0.9.4",
+ "phpunit/phpunit": "^5.2||^4.8.24"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "phpDocumentor\\Reflection\\": [
+ "src/"
+ ]
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Mike van Riel",
+ "email": "me@mikevanriel.com"
+ }
+ ],
+ "time": "2017-07-14T14:27:02+00:00"
+ },
+ {
+ "name": "phpspec/prophecy",
+ "version": "1.8.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/phpspec/prophecy.git",
+ "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06",
+ "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/instantiator": "^1.0.2",
+ "php": "^5.3|^7.0",
+ "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0",
+ "sebastian/comparator": "^1.1|^2.0|^3.0",
+ "sebastian/recursion-context": "^1.0|^2.0|^3.0"
+ },
+ "require-dev": {
+ "phpspec/phpspec": "^2.5|^3.2",
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.8.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Prophecy\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Konstantin Kudryashov",
+ "email": "ever.zet@gmail.com",
+ "homepage": "http://everzet.com"
+ },
+ {
+ "name": "Marcello Duarte",
+ "email": "marcello.duarte@gmail.com"
+ }
+ ],
+ "description": "Highly opinionated mocking framework for PHP 5.3+",
+ "homepage": "https://github.com/phpspec/prophecy",
+ "keywords": [
+ "Double",
+ "Dummy",
+ "fake",
+ "mock",
+ "spy",
+ "stub"
+ ],
+ "time": "2018-08-05T17:53:17+00:00"
+ },
+ {
+ "name": "phpunit/php-code-coverage",
+ "version": "4.0.8",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
+ "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
+ "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-xmlwriter": "*",
+ "php": "^5.6 || ^7.0",
+ "phpunit/php-file-iterator": "^1.3",
+ "phpunit/php-text-template": "^1.2",
+ "phpunit/php-token-stream": "^1.4.2 || ^2.0",
+ "sebastian/code-unit-reverse-lookup": "^1.0",
+ "sebastian/environment": "^1.3.2 || ^2.0",
+ "sebastian/version": "^1.0 || ^2.0"
+ },
+ "require-dev": {
+ "ext-xdebug": "^2.1.4",
+ "phpunit/phpunit": "^5.7"
+ },
+ "suggest": {
+ "ext-xdebug": "^2.5.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "4.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.",
+ "homepage": "https://github.com/sebastianbergmann/php-code-coverage",
+ "keywords": [
+ "coverage",
+ "testing",
+ "xunit"
+ ],
+ "time": "2017-04-02T07:44:40+00:00"
+ },
+ {
+ "name": "phpunit/php-file-iterator",
+ "version": "1.4.5",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-file-iterator.git",
+ "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4",
+ "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "FilterIterator implementation that filters files based on a list of suffixes.",
+ "homepage": "https://github.com/sebastianbergmann/php-file-iterator/",
+ "keywords": [
+ "filesystem",
+ "iterator"
+ ],
+ "time": "2017-11-27T13:52:08+00:00"
+ },
+ {
+ "name": "phpunit/php-text-template",
+ "version": "1.2.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-text-template.git",
+ "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+ "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Simple template engine.",
+ "homepage": "https://github.com/sebastianbergmann/php-text-template/",
+ "keywords": [
+ "template"
+ ],
+ "time": "2015-06-21T13:50:34+00:00"
+ },
+ {
+ "name": "phpunit/php-timer",
+ "version": "1.0.9",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-timer.git",
+ "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
+ "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.3 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Utility class for timing",
+ "homepage": "https://github.com/sebastianbergmann/php-timer/",
+ "keywords": [
+ "timer"
+ ],
+ "time": "2017-02-26T11:10:40+00:00"
+ },
+ {
+ "name": "phpunit/php-token-stream",
+ "version": "1.4.12",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/php-token-stream.git",
+ "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16",
+ "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16",
+ "shasum": ""
+ },
+ "require": {
+ "ext-tokenizer": "*",
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.2"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Wrapper around PHP's tokenizer extension.",
+ "homepage": "https://github.com/sebastianbergmann/php-token-stream/",
+ "keywords": [
+ "tokenizer"
+ ],
+ "time": "2017-12-04T08:55:13+00:00"
+ },
+ {
+ "name": "phpunit/phpunit",
+ "version": "5.7.27",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/phpunit.git",
+ "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c",
+ "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-json": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "ext-xml": "*",
+ "myclabs/deep-copy": "~1.3",
+ "php": "^5.6 || ^7.0",
+ "phpspec/prophecy": "^1.6.2",
+ "phpunit/php-code-coverage": "^4.0.4",
+ "phpunit/php-file-iterator": "~1.4",
+ "phpunit/php-text-template": "~1.2",
+ "phpunit/php-timer": "^1.0.6",
+ "phpunit/phpunit-mock-objects": "^3.2",
+ "sebastian/comparator": "^1.2.4",
+ "sebastian/diff": "^1.4.3",
+ "sebastian/environment": "^1.3.4 || ^2.0",
+ "sebastian/exporter": "~2.0",
+ "sebastian/global-state": "^1.1",
+ "sebastian/object-enumerator": "~2.0",
+ "sebastian/resource-operations": "~1.0",
+ "sebastian/version": "^1.0.6|^2.0.1",
+ "symfony/yaml": "~2.1|~3.0|~4.0"
+ },
+ "conflict": {
+ "phpdocumentor/reflection-docblock": "3.0.2"
+ },
+ "require-dev": {
+ "ext-pdo": "*"
+ },
+ "suggest": {
+ "ext-xdebug": "*",
+ "phpunit/php-invoker": "~1.1"
+ },
+ "bin": [
+ "phpunit"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "5.7.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "The PHP Unit Testing framework.",
+ "homepage": "https://phpunit.de/",
+ "keywords": [
+ "phpunit",
+ "testing",
+ "xunit"
+ ],
+ "time": "2018-02-01T05:50:59+00:00"
+ },
+ {
+ "name": "phpunit/phpunit-mock-objects",
+ "version": "3.4.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
+ "reference": "a23b761686d50a560cc56233b9ecf49597cc9118"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118",
+ "reference": "a23b761686d50a560cc56233b9ecf49597cc9118",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/instantiator": "^1.0.2",
+ "php": "^5.6 || ^7.0",
+ "phpunit/php-text-template": "^1.2",
+ "sebastian/exporter": "^1.2 || ^2.0"
+ },
+ "conflict": {
+ "phpunit/phpunit": "<5.4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^5.4"
+ },
+ "suggest": {
+ "ext-soap": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.2.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sb@sebastian-bergmann.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Mock Object library for PHPUnit",
+ "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/",
+ "keywords": [
+ "mock",
+ "xunit"
+ ],
+ "time": "2017-06-30T09:13:00+00:00"
+ },
+ {
+ "name": "psr/log",
+ "version": "1.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/php-fig/log.git",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\Log\\": "Psr/Log/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "description": "Common interface for logging libraries",
+ "homepage": "https://github.com/php-fig/log",
+ "keywords": [
+ "log",
+ "psr",
+ "psr-3"
+ ],
+ "time": "2016-10-10T12:19:37+00:00"
+ },
+ {
+ "name": "sabberworm/php-css-parser",
+ "version": "8.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sabberworm/PHP-CSS-Parser.git",
+ "reference": "850cbbcbe7fbb155387a151ea562897a67e242ef"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sabberworm/PHP-CSS-Parser/zipball/850cbbcbe7fbb155387a151ea562897a67e242ef",
+ "reference": "850cbbcbe7fbb155387a151ea562897a67e242ef",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.2"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "*"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Sabberworm\\CSS": "lib/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Raphael Schweikert"
+ }
+ ],
+ "description": "Parser for CSS Files written in PHP",
+ "homepage": "http://www.sabberworm.com/blog/2010/6/10/php-css-parser",
+ "keywords": [
+ "css",
+ "parser",
+ "stylesheet"
+ ],
+ "time": "2016-07-19T19:14:21+00:00"
+ },
+ {
+ "name": "sebastian/code-unit-reverse-lookup",
+ "version": "1.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git",
+ "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
+ "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.6 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^5.7 || ^6.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Looks up which function or method a line of code belongs to",
+ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
+ "time": "2017-03-04T06:30:41+00:00"
+ },
+ {
+ "name": "sebastian/comparator",
+ "version": "1.2.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/comparator.git",
+ "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
+ "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "sebastian/diff": "~1.2",
+ "sebastian/exporter": "~1.2 || ~2.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.2.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides the functionality to compare PHP values for equality",
+ "homepage": "http://www.github.com/sebastianbergmann/comparator",
+ "keywords": [
+ "comparator",
+ "compare",
+ "equality"
+ ],
+ "time": "2017-01-29T09:50:25+00:00"
+ },
+ {
+ "name": "sebastian/diff",
+ "version": "1.4.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/diff.git",
+ "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4",
+ "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.3 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Diff implementation",
+ "homepage": "https://github.com/sebastianbergmann/diff",
+ "keywords": [
+ "diff"
+ ],
+ "time": "2017-05-22T07:24:03+00:00"
+ },
+ {
+ "name": "sebastian/environment",
+ "version": "2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/environment.git",
+ "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
+ "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.6 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^5.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides functionality to handle HHVM/PHP environments",
+ "homepage": "http://www.github.com/sebastianbergmann/environment",
+ "keywords": [
+ "Xdebug",
+ "environment",
+ "hhvm"
+ ],
+ "time": "2016-11-26T07:53:53+00:00"
+ },
+ {
+ "name": "sebastian/exporter",
+ "version": "2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/exporter.git",
+ "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
+ "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "sebastian/recursion-context": "~2.0"
+ },
+ "require-dev": {
+ "ext-mbstring": "*",
+ "phpunit/phpunit": "~4.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Volker Dusch",
+ "email": "github@wallbash.com"
+ },
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@2bepublished.at"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ }
+ ],
+ "description": "Provides the functionality to export PHP variables for visualization",
+ "homepage": "http://www.github.com/sebastianbergmann/exporter",
+ "keywords": [
+ "export",
+ "exporter"
+ ],
+ "time": "2016-11-19T08:54:04+00:00"
+ },
+ {
+ "name": "sebastian/global-state",
+ "version": "1.1.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/global-state.git",
+ "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4",
+ "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.2"
+ },
+ "suggest": {
+ "ext-uopz": "*"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Snapshotting of global state",
+ "homepage": "http://www.github.com/sebastianbergmann/global-state",
+ "keywords": [
+ "global state"
+ ],
+ "time": "2015-10-12T03:26:01+00:00"
+ },
+ {
+ "name": "sebastian/object-enumerator",
+ "version": "2.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/object-enumerator.git",
+ "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7",
+ "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.6",
+ "sebastian/recursion-context": "~2.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~5"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Traverses array structures and object graphs to enumerate all referenced objects",
+ "homepage": "https://github.com/sebastianbergmann/object-enumerator/",
+ "time": "2017-02-18T15:18:39+00:00"
+ },
+ {
+ "name": "sebastian/recursion-context",
+ "version": "2.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/recursion-context.git",
+ "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a",
+ "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "~4.4"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Jeff Welch",
+ "email": "whatthejeff@gmail.com"
+ },
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Adam Harvey",
+ "email": "aharvey@php.net"
+ }
+ ],
+ "description": "Provides functionality to recursively process PHP variables",
+ "homepage": "http://www.github.com/sebastianbergmann/recursion-context",
+ "time": "2016-11-19T07:33:16+00:00"
+ },
+ {
+ "name": "sebastian/resource-operations",
+ "version": "1.0.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/resource-operations.git",
+ "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
+ "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.6.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ }
+ ],
+ "description": "Provides a list of PHP built-in functions that operate on resources",
+ "homepage": "https://www.github.com/sebastianbergmann/resource-operations",
+ "time": "2015-07-28T20:34:47+00:00"
+ },
+ {
+ "name": "sebastian/version",
+ "version": "2.0.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/sebastianbergmann/version.git",
+ "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019",
+ "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.6"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de",
+ "role": "lead"
+ }
+ ],
+ "description": "Library that helps with managing the version number of Git-hosted PHP projects",
+ "homepage": "https://github.com/sebastianbergmann/version",
+ "time": "2016-10-03T07:35:21+00:00"
+ },
+ {
+ "name": "setasign/fpdi",
+ "version": "1.6.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Setasign/FPDI.git",
+ "reference": "a6ad58897a6d97cc2d2cd2adaeda343b25a368ea"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Setasign/FPDI/zipball/a6ad58897a6d97cc2d2cd2adaeda343b25a368ea",
+ "reference": "a6ad58897a6d97cc2d2cd2adaeda343b25a368ea",
+ "shasum": ""
+ },
+ "suggest": {
+ "setasign/fpdf": "FPDI will extend this class but as it is also possible to use \"tecnickcom/tcpdf\" as an alternative there's no fixed dependency configured.",
+ "setasign/fpdi-fpdf": "Use this package to automatically evaluate dependencies to FPDF.",
+ "setasign/fpdi-tcpdf": "Use this package to automatically evaluate dependencies to TCPDF."
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "filters/",
+ "fpdi.php",
+ "fpdf_tpl.php",
+ "fpdi_pdf_parser.php",
+ "pdf_context.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jan Slabon",
+ "email": "jan.slabon@setasign.com",
+ "homepage": "https://www.setasign.com"
+ }
+ ],
+ "description": "FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined. Please see suggestions for packages which evaluates the dependencies automatically.",
+ "homepage": "https://www.setasign.com/fpdi",
+ "keywords": [
+ "fpdf",
+ "fpdi",
+ "pdf"
+ ],
+ "time": "2017-05-11T14:25:49+00:00"
+ },
+ {
+ "name": "squizlabs/php_codesniffer",
+ "version": "3.3.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
+ "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6ad28354c04b364c3c71a34e4a18b629cc3b231e",
+ "reference": "6ad28354c04b364c3c71a34e4a18b629cc3b231e",
+ "shasum": ""
+ },
+ "require": {
+ "ext-simplexml": "*",
+ "ext-tokenizer": "*",
+ "ext-xmlwriter": "*",
+ "php": ">=5.4.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
+ },
+ "bin": [
+ "bin/phpcs",
+ "bin/phpcbf"
+ ],
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.x-dev"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "authors": [
+ {
+ "name": "Greg Sherwood",
+ "role": "lead"
+ }
+ ],
+ "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
+ "homepage": "http://www.squizlabs.com/php-codesniffer",
+ "keywords": [
+ "phpcs",
+ "standards"
+ ],
+ "time": "2018-09-23T23:08:17+00:00"
+ },
+ {
+ "name": "symfony/console",
+ "version": "v3.4.18",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/console.git",
+ "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/console/zipball/1d228fb4602047d7b26a0554e0d3efd567da5803",
+ "reference": "1d228fb4602047d7b26a0554e0d3efd567da5803",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5.9|>=7.0.8",
+ "symfony/debug": "~2.8|~3.0|~4.0",
+ "symfony/polyfill-mbstring": "~1.0"
+ },
+ "conflict": {
+ "symfony/dependency-injection": "<3.4",
+ "symfony/process": "<3.3"
+ },
+ "require-dev": {
+ "psr/log": "~1.0",
+ "symfony/config": "~3.3|~4.0",
+ "symfony/dependency-injection": "~3.4|~4.0",
+ "symfony/event-dispatcher": "~2.8|~3.0|~4.0",
+ "symfony/lock": "~3.4|~4.0",
+ "symfony/process": "~3.3|~4.0"
+ },
+ "suggest": {
+ "psr/log-implementation": "For using the console logger",
+ "symfony/event-dispatcher": "",
+ "symfony/lock": "",
+ "symfony/process": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Console\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Console Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-10-30T16:50:50+00:00"
+ },
+ {
+ "name": "symfony/debug",
+ "version": "v3.4.18",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/debug.git",
+ "reference": "fe9793af008b651c5441bdeab21ede8172dab097"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/fe9793af008b651c5441bdeab21ede8172dab097",
+ "reference": "fe9793af008b651c5441bdeab21ede8172dab097",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5.9|>=7.0.8",
+ "psr/log": "~1.0"
+ },
+ "conflict": {
+ "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
+ },
+ "require-dev": {
+ "symfony/http-kernel": "~2.8|~3.0|~4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Debug\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Debug Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-10-31T09:06:03+00:00"
+ },
+ {
+ "name": "symfony/event-dispatcher",
+ "version": "v3.4.18",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/event-dispatcher.git",
+ "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14",
+ "reference": "db9e829c8f34c3d35cf37fcd4cdb4293bc4a2f14",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5.9|>=7.0.8"
+ },
+ "conflict": {
+ "symfony/dependency-injection": "<3.3"
+ },
+ "require-dev": {
+ "psr/log": "~1.0",
+ "symfony/config": "~2.8|~3.0|~4.0",
+ "symfony/dependency-injection": "~3.3|~4.0",
+ "symfony/expression-language": "~2.8|~3.0|~4.0",
+ "symfony/stopwatch": "~2.8|~3.0|~4.0"
+ },
+ "suggest": {
+ "symfony/dependency-injection": "",
+ "symfony/http-kernel": ""
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\EventDispatcher\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony EventDispatcher Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-10-30T16:50:50+00:00"
+ },
+ {
+ "name": "symfony/filesystem",
+ "version": "v3.4.18",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/filesystem.git",
+ "reference": "d69930fc337d767607267d57c20a7403d0a822a4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/d69930fc337d767607267d57c20a7403d0a822a4",
+ "reference": "d69930fc337d767607267d57c20a7403d0a822a4",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5.9|>=7.0.8",
+ "symfony/polyfill-ctype": "~1.8"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Filesystem\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Filesystem Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-10-02T12:28:39+00:00"
+ },
+ {
+ "name": "symfony/finder",
+ "version": "v3.4.18",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/finder.git",
+ "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/54ba444dddc5bd5708a34bd095ea67c6eb54644d",
+ "reference": "54ba444dddc5bd5708a34bd095ea67c6eb54644d",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5.9|>=7.0.8"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Finder\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Finder Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-10-03T08:46:40+00:00"
+ },
+ {
+ "name": "symfony/options-resolver",
+ "version": "v3.4.18",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/options-resolver.git",
+ "reference": "1cf7d8e704a9cc4164c92e430f2dfa3e6983661d"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/options-resolver/zipball/1cf7d8e704a9cc4164c92e430f2dfa3e6983661d",
+ "reference": "1cf7d8e704a9cc4164c92e430f2dfa3e6983661d",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5.9|>=7.0.8"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\OptionsResolver\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony OptionsResolver Component",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "config",
+ "configuration",
+ "options"
+ ],
+ "time": "2018-09-17T17:29:18+00:00"
+ },
+ {
+ "name": "symfony/polyfill-ctype",
+ "version": "v1.10.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-ctype.git",
+ "reference": "e3d826245268269cd66f8326bd8bc066687b4a19"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19",
+ "reference": "e3d826245268269cd66f8326bd8bc066687b4a19",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "suggest": {
+ "ext-ctype": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.9-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Ctype\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ },
+ {
+ "name": "Gert de Pagter",
+ "email": "BackEndTea@gmail.com"
+ }
+ ],
+ "description": "Symfony polyfill for ctype functions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "ctype",
+ "polyfill",
+ "portable"
+ ],
+ "time": "2018-08-06T14:22:27+00:00"
+ },
+ {
+ "name": "symfony/polyfill-mbstring",
+ "version": "v1.10.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-mbstring.git",
+ "reference": "c79c051f5b3a46be09205c73b80b346e4153e494"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494",
+ "reference": "c79c051f5b3a46be09205c73b80b346e4153e494",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "suggest": {
+ "ext-mbstring": "For best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.9-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Mbstring\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill for the Mbstring extension",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "mbstring",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "time": "2018-09-21T13:07:52+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php70",
+ "version": "v1.10.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php70.git",
+ "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/6b88000cdd431cd2e940caa2cb569201f3f84224",
+ "reference": "6b88000cdd431cd2e940caa2cb569201f3f84224",
+ "shasum": ""
+ },
+ "require": {
+ "paragonie/random_compat": "~1.0|~2.0|~9.99",
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.9-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Php70\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ],
+ "classmap": [
+ "Resources/stubs"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "time": "2018-09-21T06:26:08+00:00"
+ },
+ {
+ "name": "symfony/polyfill-php72",
+ "version": "v1.10.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/polyfill-php72.git",
+ "reference": "9050816e2ca34a8e916c3a0ae8b9c2fccf68b631"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/9050816e2ca34a8e916c3a0ae8b9c2fccf68b631",
+ "reference": "9050816e2ca34a8e916c3a0ae8b9c2fccf68b631",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.9-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Polyfill\\Php72\\": ""
+ },
+ "files": [
+ "bootstrap.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions",
+ "homepage": "https://symfony.com",
+ "keywords": [
+ "compatibility",
+ "polyfill",
+ "portable",
+ "shim"
+ ],
+ "time": "2018-09-21T13:07:52+00:00"
+ },
+ {
+ "name": "symfony/process",
+ "version": "v3.4.18",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/process.git",
+ "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/process/zipball/35c2914a9f50519bd207164c353ae4d59182c2cb",
+ "reference": "35c2914a9f50519bd207164c353ae4d59182c2cb",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5.9|>=7.0.8"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Process\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Process Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-10-14T17:33:21+00:00"
+ },
+ {
+ "name": "symfony/stopwatch",
+ "version": "v3.4.18",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/stopwatch.git",
+ "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/stopwatch/zipball/05e52a39de52ba690aebaed462b2bc8a9649f0a4",
+ "reference": "05e52a39de52ba690aebaed462b2bc8a9649f0a4",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5.9|>=7.0.8"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Stopwatch\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Stopwatch Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-10-02T12:28:39+00:00"
+ },
+ {
+ "name": "symfony/yaml",
+ "version": "v3.4.18",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/yaml.git",
+ "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/640b6c27fed4066d64b64d5903a86043f4a4de7f",
+ "reference": "640b6c27fed4066d64b64d5903a86043f4a4de7f",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.5.9|>=7.0.8",
+ "symfony/polyfill-ctype": "~1.8"
+ },
+ "conflict": {
+ "symfony/console": "<3.4"
+ },
+ "require-dev": {
+ "symfony/console": "~3.4|~4.0"
+ },
+ "suggest": {
+ "symfony/console": "For validating YAML files using the lint command"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "3.4-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Yaml\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Yaml Component",
+ "homepage": "https://symfony.com",
+ "time": "2018-10-02T16:33:53+00:00"
+ },
+ {
+ "name": "tecnickcom/tcpdf",
+ "version": "6.2.26",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tecnickcom/TCPDF.git",
+ "reference": "367241059ca166e3a76490f4448c284e0a161f15"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/367241059ca166e3a76490f4448c284e0a161f15",
+ "reference": "367241059ca166e3a76490f4448c284e0a161f15",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "config",
+ "include",
+ "tcpdf.php",
+ "tcpdf_parser.php",
+ "tcpdf_import.php",
+ "tcpdf_barcodes_1d.php",
+ "tcpdf_barcodes_2d.php",
+ "include/tcpdf_colors.php",
+ "include/tcpdf_filters.php",
+ "include/tcpdf_font_data.php",
+ "include/tcpdf_fonts.php",
+ "include/tcpdf_images.php",
+ "include/tcpdf_static.php",
+ "include/barcodes/datamatrix.php",
+ "include/barcodes/pdf417.php",
+ "include/barcodes/qrcode.php"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "LGPL-3.0"
+ ],
+ "authors": [
+ {
+ "name": "Nicola Asuni",
+ "email": "info@tecnick.com",
+ "role": "lead"
+ }
+ ],
+ "description": "TCPDF is a PHP class for generating PDF documents and barcodes.",
+ "homepage": "http://www.tcpdf.org/",
+ "keywords": [
+ "PDFD32000-2008",
+ "TCPDF",
+ "barcodes",
+ "datamatrix",
+ "pdf",
+ "pdf417",
+ "qrcode"
+ ],
+ "time": "2018-10-16T17:24:05+00:00"
+ },
+ {
+ "name": "webmozart/assert",
+ "version": "1.3.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/webmozart/assert.git",
+ "reference": "0df1908962e7a3071564e857d86874dad1ef204a"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a",
+ "reference": "0df1908962e7a3071564e857d86874dad1ef204a",
+ "shasum": ""
+ },
+ "require": {
+ "php": "^5.3.3 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.6",
+ "sebastian/version": "^1.0.1"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.3-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Webmozart\\Assert\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Bernhard Schussek",
+ "email": "bschussek@gmail.com"
+ }
+ ],
+ "description": "Assertions to validate method input/output with nice error messages.",
+ "keywords": [
+ "assert",
+ "check",
+ "validate"
+ ],
+ "time": "2018-01-29T19:49:41+00:00"
+ }
+ ],
+ "aliases": [],
+ "minimum-stability": "stable",
+ "stability-flags": {
+ "friendsofphp/php-cs-fixer": 0
+ },
+ "prefer-stable": false,
+ "prefer-lowest": false,
+ "platform": {
+ "php": "^5.6|^7.0",
+ "ext-ctype": "*",
+ "ext-dom": "*",
+ "ext-gd": "*",
+ "ext-iconv": "*",
+ "ext-fileinfo": "*",
+ "ext-libxml": "*",
+ "ext-mbstring": "*",
+ "ext-simplexml": "*",
+ "ext-xml": "*",
+ "ext-xmlreader": "*",
+ "ext-xmlwriter": "*",
+ "ext-zip": "*",
+ "ext-zlib": "*"
+ },
+ "platform-dev": []
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/mkdocs.yml b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/mkdocs.yml
new file mode 100644
index 00000000000..cf87a142a33
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/mkdocs.yml
@@ -0,0 +1,7 @@
+site_name: PhpSpreadsheet Documentation
+repo_url: https://github.com/PHPOffice/phpspreadsheet
+edit_uri: edit/master/docs/
+
+theme: readthedocs
+extra_css:
+ - extra/extra.css
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/phpunit.xml.dist b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/phpunit.xml.dist
new file mode 100644
index 00000000000..6880d23e488
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/phpunit.xml.dist
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+ ./tests/PhpSpreadsheetTests
+
+
+
+ ./src
+
+ ./src/PhpSpreadsheet/Shared/JAMA
+ ./src/PhpSpreadsheet/Writer/PDF
+
+
+
+
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/Bootstrap.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/Bootstrap.php
new file mode 100644
index 00000000000..f15de26a6c4
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/Bootstrap.php
@@ -0,0 +1,22 @@
+=-]*)|(\'[^\']*\')|(\"[^\"]*\"))!)?\$?([a-z]{1,3})\$?(\d{1,7})';
+ // Named Range of cells
+ const CALCULATION_REGEXP_NAMEDRANGE = '((([^\s,!&%^\/\*\+<>=-]*)|(\'[^\']*\')|(\"[^\"]*\"))!)?([_A-Z][_A-Z0-9\.]*)';
+ // Error
+ const CALCULATION_REGEXP_ERROR = '\#[A-Z][A-Z0_\/]*[!\?]?';
+
+ /** constants */
+ const RETURN_ARRAY_AS_ERROR = 'error';
+ const RETURN_ARRAY_AS_VALUE = 'value';
+ const RETURN_ARRAY_AS_ARRAY = 'array';
+
+ private static $returnArrayAsType = self::RETURN_ARRAY_AS_VALUE;
+
+ /**
+ * Instance of this class.
+ *
+ * @var Calculation
+ */
+ private static $instance;
+
+ /**
+ * Instance of the spreadsheet this Calculation Engine is using.
+ *
+ * @var Spreadsheet
+ */
+ private $spreadsheet;
+
+ /**
+ * Calculation cache.
+ *
+ * @var array
+ */
+ private $calculationCache = [];
+
+ /**
+ * Calculation cache enabled.
+ *
+ * @var bool
+ */
+ private $calculationCacheEnabled = true;
+
+ /**
+ * List of operators that can be used within formulae
+ * The true/false value indicates whether it is a binary operator or a unary operator.
+ *
+ * @var array
+ */
+ private static $operators = [
+ '+' => true, '-' => true, '*' => true, '/' => true,
+ '^' => true, '&' => true, '%' => false, '~' => false,
+ '>' => true, '<' => true, '=' => true, '>=' => true,
+ '<=' => true, '<>' => true, '|' => true, ':' => true,
+ ];
+
+ /**
+ * List of binary operators (those that expect two operands).
+ *
+ * @var array
+ */
+ private static $binaryOperators = [
+ '+' => true, '-' => true, '*' => true, '/' => true,
+ '^' => true, '&' => true, '>' => true, '<' => true,
+ '=' => true, '>=' => true, '<=' => true, '<>' => true,
+ '|' => true, ':' => true,
+ ];
+
+ /**
+ * The debug log generated by the calculation engine.
+ *
+ * @var Logger
+ */
+ private $debugLog;
+
+ /**
+ * Flag to determine how formula errors should be handled
+ * If true, then a user error will be triggered
+ * If false, then an exception will be thrown.
+ *
+ * @var bool
+ */
+ public $suppressFormulaErrors = false;
+
+ /**
+ * Error message for any error that was raised/thrown by the calculation engine.
+ *
+ * @var string
+ */
+ public $formulaError;
+
+ /**
+ * An array of the nested cell references accessed by the calculation engine, used for the debug log.
+ *
+ * @var array of string
+ */
+ private $cyclicReferenceStack;
+
+ private $cellStack = [];
+
+ /**
+ * Current iteration counter for cyclic formulae
+ * If the value is 0 (or less) then cyclic formulae will throw an exception,
+ * otherwise they will iterate to the limit defined here before returning a result.
+ *
+ * @var int
+ */
+ private $cyclicFormulaCounter = 1;
+
+ private $cyclicFormulaCell = '';
+
+ /**
+ * Number of iterations for cyclic formulae.
+ *
+ * @var int
+ */
+ public $cyclicFormulaCount = 1;
+
+ /**
+ * Epsilon Precision used for comparisons in calculations.
+ *
+ * @var float
+ */
+ private $delta = 0.1e-12;
+
+ /**
+ * The current locale setting.
+ *
+ * @var string
+ */
+ private static $localeLanguage = 'en_us'; // US English (default locale)
+
+ /**
+ * List of available locale settings
+ * Note that this is read for the locale subdirectory only when requested.
+ *
+ * @var string[]
+ */
+ private static $validLocaleLanguages = [
+ 'en', // English (default language)
+ ];
+
+ /**
+ * Locale-specific argument separator for function arguments.
+ *
+ * @var string
+ */
+ private static $localeArgumentSeparator = ',';
+
+ private static $localeFunctions = [];
+
+ /**
+ * Locale-specific translations for Excel constants (True, False and Null).
+ *
+ * @var string[]
+ */
+ public static $localeBoolean = [
+ 'TRUE' => 'TRUE',
+ 'FALSE' => 'FALSE',
+ 'NULL' => 'NULL',
+ ];
+
+ /**
+ * Excel constant string translations to their PHP equivalents
+ * Constant conversion from text name/value to actual (datatyped) value.
+ *
+ * @var string[]
+ */
+ private static $excelConstants = [
+ 'TRUE' => true,
+ 'FALSE' => false,
+ 'NULL' => null,
+ ];
+
+ // PhpSpreadsheet functions
+ private static $phpSpreadsheetFunctions = [
+ 'ABS' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'abs',
+ 'argumentCount' => '1',
+ ],
+ 'ACCRINT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'ACCRINT'],
+ 'argumentCount' => '4-7',
+ ],
+ 'ACCRINTM' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'ACCRINTM'],
+ 'argumentCount' => '3-5',
+ ],
+ 'ACOS' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'acos',
+ 'argumentCount' => '1',
+ ],
+ 'ACOSH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'acosh',
+ 'argumentCount' => '1',
+ ],
+ 'ACOT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'ACOT'],
+ 'argumentCount' => '1',
+ ],
+ 'ACOTH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'ACOTH'],
+ 'argumentCount' => '1',
+ ],
+ 'ADDRESS' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef::class, 'cellAddress'],
+ 'argumentCount' => '2-5',
+ ],
+ 'AMORDEGRC' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'AMORDEGRC'],
+ 'argumentCount' => '6,7',
+ ],
+ 'AMORLINC' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'AMORLINC'],
+ 'argumentCount' => '6,7',
+ ],
+ 'AND' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical::class, 'logicalAnd'],
+ 'argumentCount' => '1+',
+ ],
+ 'AREAS' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1',
+ ],
+ 'ASC' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1',
+ ],
+ 'ASIN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'asin',
+ 'argumentCount' => '1',
+ ],
+ 'ASINH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'asinh',
+ 'argumentCount' => '1',
+ ],
+ 'ATAN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'atan',
+ 'argumentCount' => '1',
+ ],
+ 'ATAN2' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'ATAN2'],
+ 'argumentCount' => '2',
+ ],
+ 'ATANH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'atanh',
+ 'argumentCount' => '1',
+ ],
+ 'AVEDEV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'AVEDEV'],
+ 'argumentCount' => '1+',
+ ],
+ 'AVERAGE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'AVERAGE'],
+ 'argumentCount' => '1+',
+ ],
+ 'AVERAGEA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'AVERAGEA'],
+ 'argumentCount' => '1+',
+ ],
+ 'AVERAGEIF' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'AVERAGEIF'],
+ 'argumentCount' => '2,3',
+ ],
+ 'AVERAGEIFS' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '3+',
+ ],
+ 'BAHTTEXT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1',
+ ],
+ 'BESSELI' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'BESSELI'],
+ 'argumentCount' => '2',
+ ],
+ 'BESSELJ' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'BESSELJ'],
+ 'argumentCount' => '2',
+ ],
+ 'BESSELK' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'BESSELK'],
+ 'argumentCount' => '2',
+ ],
+ 'BESSELY' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'BESSELY'],
+ 'argumentCount' => '2',
+ ],
+ 'BETADIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'BETADIST'],
+ 'argumentCount' => '3-5',
+ ],
+ 'BETAINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'BETAINV'],
+ 'argumentCount' => '3-5',
+ ],
+ 'BIN2DEC' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'BINTODEC'],
+ 'argumentCount' => '1',
+ ],
+ 'BIN2HEX' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'BINTOHEX'],
+ 'argumentCount' => '1,2',
+ ],
+ 'BIN2OCT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'BINTOOCT'],
+ 'argumentCount' => '1,2',
+ ],
+ 'BINOMDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'BINOMDIST'],
+ 'argumentCount' => '4',
+ ],
+ 'BITAND' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'BITAND'],
+ 'argumentCount' => '2',
+ ],
+ 'BITOR' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'BITOR'],
+ 'argumentCount' => '2',
+ ],
+ 'BITXOR' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'BITOR'],
+ 'argumentCount' => '2',
+ ],
+ 'BITLSHIFT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'BITLSHIFT'],
+ 'argumentCount' => '2',
+ ],
+ 'BITRSHIFT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'BITRSHIFT'],
+ 'argumentCount' => '2',
+ ],
+ 'CEILING' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'CEILING'],
+ 'argumentCount' => '2',
+ ],
+ 'CELL' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1,2',
+ ],
+ 'CHAR' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'CHARACTER'],
+ 'argumentCount' => '1',
+ ],
+ 'CHIDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'CHIDIST'],
+ 'argumentCount' => '2',
+ ],
+ 'CHIINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'CHIINV'],
+ 'argumentCount' => '2',
+ ],
+ 'CHITEST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2',
+ ],
+ 'CHOOSE' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef::class, 'CHOOSE'],
+ 'argumentCount' => '2+',
+ ],
+ 'CLEAN' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'TRIMNONPRINTABLE'],
+ 'argumentCount' => '1',
+ ],
+ 'CODE' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'ASCIICODE'],
+ 'argumentCount' => '1',
+ ],
+ 'COLUMN' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef::class, 'COLUMN'],
+ 'argumentCount' => '-1',
+ 'passByReference' => [true],
+ ],
+ 'COLUMNS' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef::class, 'COLUMNS'],
+ 'argumentCount' => '1',
+ ],
+ 'COMBIN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'COMBIN'],
+ 'argumentCount' => '2',
+ ],
+ 'COMPLEX' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'COMPLEX'],
+ 'argumentCount' => '2,3',
+ ],
+ 'CONCAT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'CONCATENATE'],
+ 'argumentCount' => '1+',
+ ],
+ 'CONCATENATE' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'CONCATENATE'],
+ 'argumentCount' => '1+',
+ ],
+ 'CONFIDENCE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'CONFIDENCE'],
+ 'argumentCount' => '3',
+ ],
+ 'CONVERT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'CONVERTUOM'],
+ 'argumentCount' => '3',
+ ],
+ 'CORREL' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'CORREL'],
+ 'argumentCount' => '2',
+ ],
+ 'COS' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'cos',
+ 'argumentCount' => '1',
+ ],
+ 'COSH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'cosh',
+ 'argumentCount' => '1',
+ ],
+ 'COT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'COT'],
+ 'argumentCount' => '1',
+ ],
+ 'COTH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'COTH'],
+ 'argumentCount' => '1',
+ ],
+ 'COUNT' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'COUNT'],
+ 'argumentCount' => '1+',
+ ],
+ 'COUNTA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'COUNTA'],
+ 'argumentCount' => '1+',
+ ],
+ 'COUNTBLANK' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'COUNTBLANK'],
+ 'argumentCount' => '1',
+ ],
+ 'COUNTIF' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'COUNTIF'],
+ 'argumentCount' => '2',
+ ],
+ 'COUNTIFS' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2+',
+ ],
+ 'COUPDAYBS' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'COUPDAYBS'],
+ 'argumentCount' => '3,4',
+ ],
+ 'COUPDAYS' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'COUPDAYS'],
+ 'argumentCount' => '3,4',
+ ],
+ 'COUPDAYSNC' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'COUPDAYSNC'],
+ 'argumentCount' => '3,4',
+ ],
+ 'COUPNCD' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'COUPNCD'],
+ 'argumentCount' => '3,4',
+ ],
+ 'COUPNUM' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'COUPNUM'],
+ 'argumentCount' => '3,4',
+ ],
+ 'COUPPCD' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'COUPPCD'],
+ 'argumentCount' => '3,4',
+ ],
+ 'COVAR' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'COVAR'],
+ 'argumentCount' => '2',
+ ],
+ 'CRITBINOM' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'CRITBINOM'],
+ 'argumentCount' => '3',
+ ],
+ 'CSC' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'CSC'],
+ 'argumentCount' => '1',
+ ],
+ 'CSCH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'CSCH'],
+ 'argumentCount' => '1',
+ ],
+ 'CUBEKPIMEMBER' => [
+ 'category' => Category::CATEGORY_CUBE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'CUBEMEMBER' => [
+ 'category' => Category::CATEGORY_CUBE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'CUBEMEMBERPROPERTY' => [
+ 'category' => Category::CATEGORY_CUBE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'CUBERANKEDMEMBER' => [
+ 'category' => Category::CATEGORY_CUBE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'CUBESET' => [
+ 'category' => Category::CATEGORY_CUBE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'CUBESETCOUNT' => [
+ 'category' => Category::CATEGORY_CUBE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'CUBEVALUE' => [
+ 'category' => Category::CATEGORY_CUBE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '?',
+ ],
+ 'CUMIPMT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'CUMIPMT'],
+ 'argumentCount' => '6',
+ ],
+ 'CUMPRINC' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'CUMPRINC'],
+ 'argumentCount' => '6',
+ ],
+ 'DATE' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'DATE'],
+ 'argumentCount' => '3',
+ ],
+ 'DATEDIF' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'DATEDIF'],
+ 'argumentCount' => '2,3',
+ ],
+ 'DATEVALUE' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'DATEVALUE'],
+ 'argumentCount' => '1',
+ ],
+ 'DAVERAGE' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database::class, 'DAVERAGE'],
+ 'argumentCount' => '3',
+ ],
+ 'DAY' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'DAYOFMONTH'],
+ 'argumentCount' => '1',
+ ],
+ 'DAYS' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'DAYS'],
+ 'argumentCount' => '2',
+ ],
+ 'DAYS360' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'DAYS360'],
+ 'argumentCount' => '2,3',
+ ],
+ 'DB' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'DB'],
+ 'argumentCount' => '4,5',
+ ],
+ 'DCOUNT' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database::class, 'DCOUNT'],
+ 'argumentCount' => '3',
+ ],
+ 'DCOUNTA' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database::class, 'DCOUNTA'],
+ 'argumentCount' => '3',
+ ],
+ 'DDB' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'DDB'],
+ 'argumentCount' => '4,5',
+ ],
+ 'DEC2BIN' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'DECTOBIN'],
+ 'argumentCount' => '1,2',
+ ],
+ 'DEC2HEX' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'DECTOHEX'],
+ 'argumentCount' => '1,2',
+ ],
+ 'DEC2OCT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'DECTOOCT'],
+ 'argumentCount' => '1,2',
+ ],
+ 'DEGREES' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'rad2deg',
+ 'argumentCount' => '1',
+ ],
+ 'DELTA' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'DELTA'],
+ 'argumentCount' => '1,2',
+ ],
+ 'DEVSQ' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'DEVSQ'],
+ 'argumentCount' => '1+',
+ ],
+ 'DGET' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database::class, 'DGET'],
+ 'argumentCount' => '3',
+ ],
+ 'DISC' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'DISC'],
+ 'argumentCount' => '4,5',
+ ],
+ 'DMAX' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database::class, 'DMAX'],
+ 'argumentCount' => '3',
+ ],
+ 'DMIN' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database::class, 'DMIN'],
+ 'argumentCount' => '3',
+ ],
+ 'DOLLAR' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'DOLLAR'],
+ 'argumentCount' => '1,2',
+ ],
+ 'DOLLARDE' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'DOLLARDE'],
+ 'argumentCount' => '2',
+ ],
+ 'DOLLARFR' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'DOLLARFR'],
+ 'argumentCount' => '2',
+ ],
+ 'DPRODUCT' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database::class, 'DPRODUCT'],
+ 'argumentCount' => '3',
+ ],
+ 'DSTDEV' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database::class, 'DSTDEV'],
+ 'argumentCount' => '3',
+ ],
+ 'DSTDEVP' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database::class, 'DSTDEVP'],
+ 'argumentCount' => '3',
+ ],
+ 'DSUM' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database::class, 'DSUM'],
+ 'argumentCount' => '3',
+ ],
+ 'DURATION' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '5,6',
+ ],
+ 'DVAR' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database::class, 'DVAR'],
+ 'argumentCount' => '3',
+ ],
+ 'DVARP' => [
+ 'category' => Category::CATEGORY_DATABASE,
+ 'functionCall' => [Database::class, 'DVARP'],
+ 'argumentCount' => '3',
+ ],
+ 'EDATE' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'EDATE'],
+ 'argumentCount' => '2',
+ ],
+ 'EFFECT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'EFFECT'],
+ 'argumentCount' => '2',
+ ],
+ 'EOMONTH' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'EOMONTH'],
+ 'argumentCount' => '2',
+ ],
+ 'ERF' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'ERF'],
+ 'argumentCount' => '1,2',
+ ],
+ 'ERF.PRECISE' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'ERFPRECISE'],
+ 'argumentCount' => '1',
+ ],
+ 'ERFC' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'ERFC'],
+ 'argumentCount' => '1',
+ ],
+ 'ERFC.PRECISE' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'ERFC'],
+ 'argumentCount' => '1',
+ ],
+ 'ERROR.TYPE' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'errorType'],
+ 'argumentCount' => '1',
+ ],
+ 'EVEN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'EVEN'],
+ 'argumentCount' => '1',
+ ],
+ 'EXACT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'EXACT'],
+ 'argumentCount' => '2',
+ ],
+ 'EXP' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'exp',
+ 'argumentCount' => '1',
+ ],
+ 'EXPONDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'EXPONDIST'],
+ 'argumentCount' => '3',
+ ],
+ 'FACT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'FACT'],
+ 'argumentCount' => '1',
+ ],
+ 'FACTDOUBLE' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'FACTDOUBLE'],
+ 'argumentCount' => '1',
+ ],
+ 'FALSE' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical::class, 'FALSE'],
+ 'argumentCount' => '0',
+ ],
+ 'FDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '3',
+ ],
+ 'FIND' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'SEARCHSENSITIVE'],
+ 'argumentCount' => '2,3',
+ ],
+ 'FINDB' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'SEARCHSENSITIVE'],
+ 'argumentCount' => '2,3',
+ ],
+ 'FINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '3',
+ ],
+ 'FISHER' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'FISHER'],
+ 'argumentCount' => '1',
+ ],
+ 'FISHERINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'FISHERINV'],
+ 'argumentCount' => '1',
+ ],
+ 'FIXED' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'FIXEDFORMAT'],
+ 'argumentCount' => '1-3',
+ ],
+ 'FLOOR' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'FLOOR'],
+ 'argumentCount' => '2',
+ ],
+ 'FORECAST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'FORECAST'],
+ 'argumentCount' => '3',
+ ],
+ 'FORMULATEXT' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef::class, 'FORMULATEXT'],
+ 'argumentCount' => '1',
+ 'passCellReference' => true,
+ 'passByReference' => [true],
+ ],
+ 'FREQUENCY' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2',
+ ],
+ 'FTEST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2',
+ ],
+ 'FV' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'FV'],
+ 'argumentCount' => '3-5',
+ ],
+ 'FVSCHEDULE' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'FVSCHEDULE'],
+ 'argumentCount' => '2',
+ ],
+ 'GAMMADIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'GAMMADIST'],
+ 'argumentCount' => '4',
+ ],
+ 'GAMMAINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'GAMMAINV'],
+ 'argumentCount' => '3',
+ ],
+ 'GAMMALN' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'GAMMALN'],
+ 'argumentCount' => '1',
+ ],
+ 'GCD' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'GCD'],
+ 'argumentCount' => '1+',
+ ],
+ 'GEOMEAN' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'GEOMEAN'],
+ 'argumentCount' => '1+',
+ ],
+ 'GESTEP' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'GESTEP'],
+ 'argumentCount' => '1,2',
+ ],
+ 'GETPIVOTDATA' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2+',
+ ],
+ 'GROWTH' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'GROWTH'],
+ 'argumentCount' => '1-4',
+ ],
+ 'HARMEAN' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'HARMEAN'],
+ 'argumentCount' => '1+',
+ ],
+ 'HEX2BIN' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'HEXTOBIN'],
+ 'argumentCount' => '1,2',
+ ],
+ 'HEX2DEC' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'HEXTODEC'],
+ 'argumentCount' => '1',
+ ],
+ 'HEX2OCT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'HEXTOOCT'],
+ 'argumentCount' => '1,2',
+ ],
+ 'HLOOKUP' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef::class, 'HLOOKUP'],
+ 'argumentCount' => '3,4',
+ ],
+ 'HOUR' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'HOUROFDAY'],
+ 'argumentCount' => '1',
+ ],
+ 'HYPERLINK' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef::class, 'HYPERLINK'],
+ 'argumentCount' => '1,2',
+ 'passCellReference' => true,
+ ],
+ 'HYPGEOMDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'HYPGEOMDIST'],
+ 'argumentCount' => '4',
+ ],
+ 'IF' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical::class, 'statementIf'],
+ 'argumentCount' => '1-3',
+ ],
+ 'IFERROR' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical::class, 'IFERROR'],
+ 'argumentCount' => '2',
+ ],
+ 'IMABS' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMABS'],
+ 'argumentCount' => '1',
+ ],
+ 'IMAGINARY' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMAGINARY'],
+ 'argumentCount' => '1',
+ ],
+ 'IMARGUMENT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMARGUMENT'],
+ 'argumentCount' => '1',
+ ],
+ 'IMCONJUGATE' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMCONJUGATE'],
+ 'argumentCount' => '1',
+ ],
+ 'IMCOS' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMCOS'],
+ 'argumentCount' => '1',
+ ],
+ 'IMCOSH' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMCOSH'],
+ 'argumentCount' => '1',
+ ],
+ 'IMCOT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMCOT'],
+ 'argumentCount' => '1',
+ ],
+ 'IMCSC' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMCSC'],
+ 'argumentCount' => '1',
+ ],
+ 'IMCSCH' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMCSCH'],
+ 'argumentCount' => '1',
+ ],
+ 'IMDIV' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMDIV'],
+ 'argumentCount' => '2',
+ ],
+ 'IMEXP' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMEXP'],
+ 'argumentCount' => '1',
+ ],
+ 'IMLN' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMLN'],
+ 'argumentCount' => '1',
+ ],
+ 'IMLOG10' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMLOG10'],
+ 'argumentCount' => '1',
+ ],
+ 'IMLOG2' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMLOG2'],
+ 'argumentCount' => '1',
+ ],
+ 'IMPOWER' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMPOWER'],
+ 'argumentCount' => '2',
+ ],
+ 'IMPRODUCT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMPRODUCT'],
+ 'argumentCount' => '1+',
+ ],
+ 'IMREAL' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMREAL'],
+ 'argumentCount' => '1',
+ ],
+ 'IMSEC' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMSEC'],
+ 'argumentCount' => '1',
+ ],
+ 'IMSECH' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMSECH'],
+ 'argumentCount' => '1',
+ ],
+ 'IMSIN' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMSIN'],
+ 'argumentCount' => '1',
+ ],
+ 'IMSINH' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMSINH'],
+ 'argumentCount' => '1',
+ ],
+ 'IMSQRT' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMSQRT'],
+ 'argumentCount' => '1',
+ ],
+ 'IMSUB' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMSUB'],
+ 'argumentCount' => '2',
+ ],
+ 'IMSUM' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMSUM'],
+ 'argumentCount' => '1+',
+ ],
+ 'IMTAN' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'IMTAN'],
+ 'argumentCount' => '1',
+ ],
+ 'INDEX' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef::class, 'INDEX'],
+ 'argumentCount' => '1-4',
+ ],
+ 'INDIRECT' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef::class, 'INDIRECT'],
+ 'argumentCount' => '1,2',
+ 'passCellReference' => true,
+ ],
+ 'INFO' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1',
+ ],
+ 'INT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'INT'],
+ 'argumentCount' => '1',
+ ],
+ 'INTERCEPT' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'INTERCEPT'],
+ 'argumentCount' => '2',
+ ],
+ 'INTRATE' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'INTRATE'],
+ 'argumentCount' => '4,5',
+ ],
+ 'IPMT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'IPMT'],
+ 'argumentCount' => '4-6',
+ ],
+ 'IRR' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'IRR'],
+ 'argumentCount' => '1,2',
+ ],
+ 'ISBLANK' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'isBlank'],
+ 'argumentCount' => '1',
+ ],
+ 'ISERR' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'isErr'],
+ 'argumentCount' => '1',
+ ],
+ 'ISERROR' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'isError'],
+ 'argumentCount' => '1',
+ ],
+ 'ISEVEN' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'isEven'],
+ 'argumentCount' => '1',
+ ],
+ 'ISFORMULA' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'isFormula'],
+ 'argumentCount' => '1',
+ 'passCellReference' => true,
+ 'passByReference' => [true],
+ ],
+ 'ISLOGICAL' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'isLogical'],
+ 'argumentCount' => '1',
+ ],
+ 'ISNA' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'isNa'],
+ 'argumentCount' => '1',
+ ],
+ 'ISNONTEXT' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'isNonText'],
+ 'argumentCount' => '1',
+ ],
+ 'ISNUMBER' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'isNumber'],
+ 'argumentCount' => '1',
+ ],
+ 'ISODD' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'isOdd'],
+ 'argumentCount' => '1',
+ ],
+ 'ISOWEEKNUM' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'ISOWEEKNUM'],
+ 'argumentCount' => '1',
+ ],
+ 'ISPMT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'ISPMT'],
+ 'argumentCount' => '4',
+ ],
+ 'ISREF' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1',
+ ],
+ 'ISTEXT' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'isText'],
+ 'argumentCount' => '1',
+ ],
+ 'JIS' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1',
+ ],
+ 'KURT' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'KURT'],
+ 'argumentCount' => '1+',
+ ],
+ 'LARGE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'LARGE'],
+ 'argumentCount' => '2',
+ ],
+ 'LCM' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'LCM'],
+ 'argumentCount' => '1+',
+ ],
+ 'LEFT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'LEFT'],
+ 'argumentCount' => '1,2',
+ ],
+ 'LEFTB' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'LEFT'],
+ 'argumentCount' => '1,2',
+ ],
+ 'LEN' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'STRINGLENGTH'],
+ 'argumentCount' => '1',
+ ],
+ 'LENB' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'STRINGLENGTH'],
+ 'argumentCount' => '1',
+ ],
+ 'LINEST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'LINEST'],
+ 'argumentCount' => '1-4',
+ ],
+ 'LN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'log',
+ 'argumentCount' => '1',
+ ],
+ 'LOG' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'logBase'],
+ 'argumentCount' => '1,2',
+ ],
+ 'LOG10' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'log10',
+ 'argumentCount' => '1',
+ ],
+ 'LOGEST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'LOGEST'],
+ 'argumentCount' => '1-4',
+ ],
+ 'LOGINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'LOGINV'],
+ 'argumentCount' => '3',
+ ],
+ 'LOGNORMDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'LOGNORMDIST'],
+ 'argumentCount' => '3',
+ ],
+ 'LOOKUP' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef::class, 'LOOKUP'],
+ 'argumentCount' => '2,3',
+ ],
+ 'LOWER' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'LOWERCASE'],
+ 'argumentCount' => '1',
+ ],
+ 'MATCH' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef::class, 'MATCH'],
+ 'argumentCount' => '2,3',
+ ],
+ 'MAX' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'MAX'],
+ 'argumentCount' => '1+',
+ ],
+ 'MAXA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'MAXA'],
+ 'argumentCount' => '1+',
+ ],
+ 'MAXIF' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'MAXIF'],
+ 'argumentCount' => '2+',
+ ],
+ 'MDETERM' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'MDETERM'],
+ 'argumentCount' => '1',
+ ],
+ 'MDURATION' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '5,6',
+ ],
+ 'MEDIAN' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'MEDIAN'],
+ 'argumentCount' => '1+',
+ ],
+ 'MEDIANIF' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2+',
+ ],
+ 'MID' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'MID'],
+ 'argumentCount' => '3',
+ ],
+ 'MIDB' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'MID'],
+ 'argumentCount' => '3',
+ ],
+ 'MIN' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'MIN'],
+ 'argumentCount' => '1+',
+ ],
+ 'MINA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'MINA'],
+ 'argumentCount' => '1+',
+ ],
+ 'MINIF' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'MINIF'],
+ 'argumentCount' => '2+',
+ ],
+ 'MINUTE' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'MINUTE'],
+ 'argumentCount' => '1',
+ ],
+ 'MINVERSE' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'MINVERSE'],
+ 'argumentCount' => '1',
+ ],
+ 'MIRR' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'MIRR'],
+ 'argumentCount' => '3',
+ ],
+ 'MMULT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'MMULT'],
+ 'argumentCount' => '2',
+ ],
+ 'MOD' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'MOD'],
+ 'argumentCount' => '2',
+ ],
+ 'MODE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'MODE'],
+ 'argumentCount' => '1+',
+ ],
+ 'MODE.SNGL' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'MODE'],
+ 'argumentCount' => '1+',
+ ],
+ 'MONTH' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'MONTHOFYEAR'],
+ 'argumentCount' => '1',
+ ],
+ 'MROUND' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'MROUND'],
+ 'argumentCount' => '2',
+ ],
+ 'MULTINOMIAL' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'MULTINOMIAL'],
+ 'argumentCount' => '1+',
+ ],
+ 'N' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'n'],
+ 'argumentCount' => '1',
+ ],
+ 'NA' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'NA'],
+ 'argumentCount' => '0',
+ ],
+ 'NEGBINOMDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'NEGBINOMDIST'],
+ 'argumentCount' => '3',
+ ],
+ 'NETWORKDAYS' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'NETWORKDAYS'],
+ 'argumentCount' => '2+',
+ ],
+ 'NOMINAL' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'NOMINAL'],
+ 'argumentCount' => '2',
+ ],
+ 'NORMDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'NORMDIST'],
+ 'argumentCount' => '4',
+ ],
+ 'NORMINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'NORMINV'],
+ 'argumentCount' => '3',
+ ],
+ 'NORMSDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'NORMSDIST'],
+ 'argumentCount' => '1',
+ ],
+ 'NORMSINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'NORMSINV'],
+ 'argumentCount' => '1',
+ ],
+ 'NOT' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical::class, 'NOT'],
+ 'argumentCount' => '1',
+ ],
+ 'NOW' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'DATETIMENOW'],
+ 'argumentCount' => '0',
+ ],
+ 'NPER' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'NPER'],
+ 'argumentCount' => '3-5',
+ ],
+ 'NPV' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'NPV'],
+ 'argumentCount' => '2+',
+ ],
+ 'NUMBERVALUE' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'NUMBERVALUE'],
+ 'argumentCount' => '1+',
+ ],
+ 'OCT2BIN' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'OCTTOBIN'],
+ 'argumentCount' => '1,2',
+ ],
+ 'OCT2DEC' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'OCTTODEC'],
+ 'argumentCount' => '1',
+ ],
+ 'OCT2HEX' => [
+ 'category' => Category::CATEGORY_ENGINEERING,
+ 'functionCall' => [Engineering::class, 'OCTTOHEX'],
+ 'argumentCount' => '1,2',
+ ],
+ 'ODD' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'ODD'],
+ 'argumentCount' => '1',
+ ],
+ 'ODDFPRICE' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '8,9',
+ ],
+ 'ODDFYIELD' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '8,9',
+ ],
+ 'ODDLPRICE' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '7,8',
+ ],
+ 'ODDLYIELD' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '7,8',
+ ],
+ 'OFFSET' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef::class, 'OFFSET'],
+ 'argumentCount' => '3-5',
+ 'passCellReference' => true,
+ 'passByReference' => [true],
+ ],
+ 'OR' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical::class, 'logicalOr'],
+ 'argumentCount' => '1+',
+ ],
+ 'PDURATION' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'PDURATION'],
+ 'argumentCount' => '3',
+ ],
+ 'PEARSON' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'CORREL'],
+ 'argumentCount' => '2',
+ ],
+ 'PERCENTILE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'PERCENTILE'],
+ 'argumentCount' => '2',
+ ],
+ 'PERCENTRANK' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'PERCENTRANK'],
+ 'argumentCount' => '2,3',
+ ],
+ 'PERMUT' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'PERMUT'],
+ 'argumentCount' => '2',
+ ],
+ 'PHONETIC' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1',
+ ],
+ 'PI' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'pi',
+ 'argumentCount' => '0',
+ ],
+ 'PMT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'PMT'],
+ 'argumentCount' => '3-5',
+ ],
+ 'POISSON' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'POISSON'],
+ 'argumentCount' => '3',
+ ],
+ 'POWER' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'POWER'],
+ 'argumentCount' => '2',
+ ],
+ 'PPMT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'PPMT'],
+ 'argumentCount' => '4-6',
+ ],
+ 'PRICE' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'PRICE'],
+ 'argumentCount' => '6,7',
+ ],
+ 'PRICEDISC' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'PRICEDISC'],
+ 'argumentCount' => '4,5',
+ ],
+ 'PRICEMAT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'PRICEMAT'],
+ 'argumentCount' => '5,6',
+ ],
+ 'PROB' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '3,4',
+ ],
+ 'PRODUCT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'PRODUCT'],
+ 'argumentCount' => '1+',
+ ],
+ 'PROPER' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'PROPERCASE'],
+ 'argumentCount' => '1',
+ ],
+ 'PV' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'PV'],
+ 'argumentCount' => '3-5',
+ ],
+ 'QUARTILE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'QUARTILE'],
+ 'argumentCount' => '2',
+ ],
+ 'QUOTIENT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'QUOTIENT'],
+ 'argumentCount' => '2',
+ ],
+ 'RADIANS' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'deg2rad',
+ 'argumentCount' => '1',
+ ],
+ 'RAND' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'RAND'],
+ 'argumentCount' => '0',
+ ],
+ 'RANDBETWEEN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'RAND'],
+ 'argumentCount' => '2',
+ ],
+ 'RANK' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'RANK'],
+ 'argumentCount' => '2,3',
+ ],
+ 'RATE' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'RATE'],
+ 'argumentCount' => '3-6',
+ ],
+ 'RECEIVED' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'RECEIVED'],
+ 'argumentCount' => '4-5',
+ ],
+ 'REPLACE' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'REPLACE'],
+ 'argumentCount' => '4',
+ ],
+ 'REPLACEB' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'REPLACE'],
+ 'argumentCount' => '4',
+ ],
+ 'REPT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => 'str_repeat',
+ 'argumentCount' => '2',
+ ],
+ 'RIGHT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'RIGHT'],
+ 'argumentCount' => '1,2',
+ ],
+ 'RIGHTB' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'RIGHT'],
+ 'argumentCount' => '1,2',
+ ],
+ 'ROMAN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'ROMAN'],
+ 'argumentCount' => '1,2',
+ ],
+ 'ROUND' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'round',
+ 'argumentCount' => '2',
+ ],
+ 'ROUNDDOWN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'ROUNDDOWN'],
+ 'argumentCount' => '2',
+ ],
+ 'ROUNDUP' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'ROUNDUP'],
+ 'argumentCount' => '2',
+ ],
+ 'ROW' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef::class, 'ROW'],
+ 'argumentCount' => '-1',
+ 'passByReference' => [true],
+ ],
+ 'ROWS' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef::class, 'ROWS'],
+ 'argumentCount' => '1',
+ ],
+ 'RRI' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'RRI'],
+ 'argumentCount' => '3',
+ ],
+ 'RSQ' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'RSQ'],
+ 'argumentCount' => '2',
+ ],
+ 'RTD' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '1+',
+ ],
+ 'SEARCH' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'SEARCHINSENSITIVE'],
+ 'argumentCount' => '2,3',
+ ],
+ 'SEARCHB' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'SEARCHINSENSITIVE'],
+ 'argumentCount' => '2,3',
+ ],
+ 'SEC' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'SEC'],
+ 'argumentCount' => '1',
+ ],
+ 'SECH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'SECH'],
+ 'argumentCount' => '1',
+ ],
+ 'SECOND' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'SECOND'],
+ 'argumentCount' => '1',
+ ],
+ 'SERIESSUM' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'SERIESSUM'],
+ 'argumentCount' => '4',
+ ],
+ 'SIGN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'SIGN'],
+ 'argumentCount' => '1',
+ ],
+ 'SIN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'sin',
+ 'argumentCount' => '1',
+ ],
+ 'SINH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'sinh',
+ 'argumentCount' => '1',
+ ],
+ 'SKEW' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'SKEW'],
+ 'argumentCount' => '1+',
+ ],
+ 'SLN' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'SLN'],
+ 'argumentCount' => '3',
+ ],
+ 'SLOPE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'SLOPE'],
+ 'argumentCount' => '2',
+ ],
+ 'SMALL' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'SMALL'],
+ 'argumentCount' => '2',
+ ],
+ 'SQRT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'sqrt',
+ 'argumentCount' => '1',
+ ],
+ 'SQRTPI' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'SQRTPI'],
+ 'argumentCount' => '1',
+ ],
+ 'STANDARDIZE' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'STANDARDIZE'],
+ 'argumentCount' => '3',
+ ],
+ 'STDEV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'STDEV'],
+ 'argumentCount' => '1+',
+ ],
+ 'STDEV.S' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'STDEV'],
+ 'argumentCount' => '1+',
+ ],
+ 'STDEV.P' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'STDEVP'],
+ 'argumentCount' => '1+',
+ ],
+ 'STDEVA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'STDEVA'],
+ 'argumentCount' => '1+',
+ ],
+ 'STDEVP' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'STDEVP'],
+ 'argumentCount' => '1+',
+ ],
+ 'STDEVPA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'STDEVPA'],
+ 'argumentCount' => '1+',
+ ],
+ 'STEYX' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'STEYX'],
+ 'argumentCount' => '2',
+ ],
+ 'SUBSTITUTE' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'SUBSTITUTE'],
+ 'argumentCount' => '3,4',
+ ],
+ 'SUBTOTAL' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'SUBTOTAL'],
+ 'argumentCount' => '2+',
+ 'passCellReference' => true,
+ ],
+ 'SUM' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'SUM'],
+ 'argumentCount' => '1+',
+ ],
+ 'SUMIF' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'SUMIF'],
+ 'argumentCount' => '2,3',
+ ],
+ 'SUMIFS' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'SUMIFS'],
+ 'argumentCount' => '3+',
+ ],
+ 'SUMPRODUCT' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'SUMPRODUCT'],
+ 'argumentCount' => '1+',
+ ],
+ 'SUMSQ' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'SUMSQ'],
+ 'argumentCount' => '1+',
+ ],
+ 'SUMX2MY2' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'SUMX2MY2'],
+ 'argumentCount' => '2',
+ ],
+ 'SUMX2PY2' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'SUMX2PY2'],
+ 'argumentCount' => '2',
+ ],
+ 'SUMXMY2' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'SUMXMY2'],
+ 'argumentCount' => '2',
+ ],
+ 'SYD' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'SYD'],
+ 'argumentCount' => '4',
+ ],
+ 'T' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'RETURNSTRING'],
+ 'argumentCount' => '1',
+ ],
+ 'TAN' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'tan',
+ 'argumentCount' => '1',
+ ],
+ 'TANH' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => 'tanh',
+ 'argumentCount' => '1',
+ ],
+ 'TBILLEQ' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'TBILLEQ'],
+ 'argumentCount' => '3',
+ ],
+ 'TBILLPRICE' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'TBILLPRICE'],
+ 'argumentCount' => '3',
+ ],
+ 'TBILLYIELD' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'TBILLYIELD'],
+ 'argumentCount' => '3',
+ ],
+ 'TDIST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'TDIST'],
+ 'argumentCount' => '3',
+ ],
+ 'TEXT' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'TEXTFORMAT'],
+ 'argumentCount' => '2',
+ ],
+ 'TEXTJOIN' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'TEXTJOIN'],
+ 'argumentCount' => '3+',
+ ],
+ 'TIME' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'TIME'],
+ 'argumentCount' => '3',
+ ],
+ 'TIMEVALUE' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'TIMEVALUE'],
+ 'argumentCount' => '1',
+ ],
+ 'TINV' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'TINV'],
+ 'argumentCount' => '2',
+ ],
+ 'TODAY' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'DATENOW'],
+ 'argumentCount' => '0',
+ ],
+ 'TRANSPOSE' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef::class, 'TRANSPOSE'],
+ 'argumentCount' => '1',
+ ],
+ 'TREND' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'TREND'],
+ 'argumentCount' => '1-4',
+ ],
+ 'TRIM' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'TRIMSPACES'],
+ 'argumentCount' => '1',
+ ],
+ 'TRIMMEAN' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'TRIMMEAN'],
+ 'argumentCount' => '2',
+ ],
+ 'TRUE' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical::class, 'TRUE'],
+ 'argumentCount' => '0',
+ ],
+ 'TRUNC' => [
+ 'category' => Category::CATEGORY_MATH_AND_TRIG,
+ 'functionCall' => [MathTrig::class, 'TRUNC'],
+ 'argumentCount' => '1,2',
+ ],
+ 'TTEST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '4',
+ ],
+ 'TYPE' => [
+ 'category' => Category::CATEGORY_INFORMATION,
+ 'functionCall' => [Functions::class, 'TYPE'],
+ 'argumentCount' => '1',
+ ],
+ 'UNICHAR' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'CHARACTER'],
+ 'argumentCount' => '1',
+ ],
+ 'UNICODE' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'ASCIICODE'],
+ 'argumentCount' => '1',
+ ],
+ 'UPPER' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'UPPERCASE'],
+ 'argumentCount' => '1',
+ ],
+ 'USDOLLAR' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '2',
+ ],
+ 'VALUE' => [
+ 'category' => Category::CATEGORY_TEXT_AND_DATA,
+ 'functionCall' => [TextData::class, 'VALUE'],
+ 'argumentCount' => '1',
+ ],
+ 'VAR' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'VARFunc'],
+ 'argumentCount' => '1+',
+ ],
+ 'VAR.P' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'VARP'],
+ 'argumentCount' => '1+',
+ ],
+ 'VAR.S' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'VARFunc'],
+ 'argumentCount' => '1+',
+ ],
+ 'VARA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'VARA'],
+ 'argumentCount' => '1+',
+ ],
+ 'VARP' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'VARP'],
+ 'argumentCount' => '1+',
+ ],
+ 'VARPA' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'VARPA'],
+ 'argumentCount' => '1+',
+ ],
+ 'VDB' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '5-7',
+ ],
+ 'VLOOKUP' => [
+ 'category' => Category::CATEGORY_LOOKUP_AND_REFERENCE,
+ 'functionCall' => [LookupRef::class, 'VLOOKUP'],
+ 'argumentCount' => '3,4',
+ ],
+ 'WEEKDAY' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'WEEKDAY'],
+ 'argumentCount' => '1,2',
+ ],
+ 'WEEKNUM' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'WEEKNUM'],
+ 'argumentCount' => '1,2',
+ ],
+ 'WEIBULL' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'WEIBULL'],
+ 'argumentCount' => '4',
+ ],
+ 'WORKDAY' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'WORKDAY'],
+ 'argumentCount' => '2+',
+ ],
+ 'XIRR' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'XIRR'],
+ 'argumentCount' => '2,3',
+ ],
+ 'XNPV' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'XNPV'],
+ 'argumentCount' => '3',
+ ],
+ 'XOR' => [
+ 'category' => Category::CATEGORY_LOGICAL,
+ 'functionCall' => [Logical::class, 'logicalXor'],
+ 'argumentCount' => '1+',
+ ],
+ 'YEAR' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'YEAR'],
+ 'argumentCount' => '1',
+ ],
+ 'YEARFRAC' => [
+ 'category' => Category::CATEGORY_DATE_AND_TIME,
+ 'functionCall' => [DateTime::class, 'YEARFRAC'],
+ 'argumentCount' => '2,3',
+ ],
+ 'YIELD' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Functions::class, 'DUMMY'],
+ 'argumentCount' => '6,7',
+ ],
+ 'YIELDDISC' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'YIELDDISC'],
+ 'argumentCount' => '4,5',
+ ],
+ 'YIELDMAT' => [
+ 'category' => Category::CATEGORY_FINANCIAL,
+ 'functionCall' => [Financial::class, 'YIELDMAT'],
+ 'argumentCount' => '5,6',
+ ],
+ 'ZTEST' => [
+ 'category' => Category::CATEGORY_STATISTICAL,
+ 'functionCall' => [Statistical::class, 'ZTEST'],
+ 'argumentCount' => '2-3',
+ ],
+ ];
+
+ // Internal functions used for special control purposes
+ private static $controlFunctions = [
+ 'MKMATRIX' => [
+ 'argumentCount' => '*',
+ 'functionCall' => 'self::mkMatrix',
+ ],
+ ];
+
+ public function __construct(Spreadsheet $spreadsheet = null)
+ {
+ $this->delta = 1 * pow(10, 0 - ini_get('precision'));
+
+ $this->spreadsheet = $spreadsheet;
+ $this->cyclicReferenceStack = new CyclicReferenceStack();
+ $this->debugLog = new Logger($this->cyclicReferenceStack);
+ }
+
+ private static function loadLocales()
+ {
+ $localeFileDirectory = __DIR__ . '/locale/';
+ foreach (glob($localeFileDirectory . '*', GLOB_ONLYDIR) as $filename) {
+ $filename = substr($filename, strlen($localeFileDirectory));
+ if ($filename != 'en') {
+ self::$validLocaleLanguages[] = $filename;
+ }
+ }
+ }
+
+ /**
+ * Get an instance of this class.
+ *
+ * @param Spreadsheet $spreadsheet Injected spreadsheet for working with a PhpSpreadsheet Spreadsheet object,
+ * or NULL to create a standalone claculation engine
+ *
+ * @return Calculation
+ */
+ public static function getInstance(Spreadsheet $spreadsheet = null)
+ {
+ if ($spreadsheet !== null) {
+ $instance = $spreadsheet->getCalculationEngine();
+ if (isset($instance)) {
+ return $instance;
+ }
+ }
+
+ if (!isset(self::$instance) || (self::$instance === null)) {
+ self::$instance = new self();
+ }
+
+ return self::$instance;
+ }
+
+ /**
+ * Flush the calculation cache for any existing instance of this class
+ * but only if a Calculation instance exists.
+ */
+ public function flushInstance()
+ {
+ $this->clearCalculationCache();
+ }
+
+ /**
+ * Get the Logger for this calculation engine instance.
+ *
+ * @return Logger
+ */
+ public function getDebugLog()
+ {
+ return $this->debugLog;
+ }
+
+ /**
+ * __clone implementation. Cloning should not be allowed in a Singleton!
+ *
+ * @throws Exception
+ */
+ final public function __clone()
+ {
+ throw new Exception('Cloning the calculation engine is not allowed!');
+ }
+
+ /**
+ * Return the locale-specific translation of TRUE.
+ *
+ * @return string locale-specific translation of TRUE
+ */
+ public static function getTRUE()
+ {
+ return self::$localeBoolean['TRUE'];
+ }
+
+ /**
+ * Return the locale-specific translation of FALSE.
+ *
+ * @return string locale-specific translation of FALSE
+ */
+ public static function getFALSE()
+ {
+ return self::$localeBoolean['FALSE'];
+ }
+
+ /**
+ * Set the Array Return Type (Array or Value of first element in the array).
+ *
+ * @param string $returnType Array return type
+ *
+ * @return bool Success or failure
+ */
+ public static function setArrayReturnType($returnType)
+ {
+ if (($returnType == self::RETURN_ARRAY_AS_VALUE) ||
+ ($returnType == self::RETURN_ARRAY_AS_ERROR) ||
+ ($returnType == self::RETURN_ARRAY_AS_ARRAY)) {
+ self::$returnArrayAsType = $returnType;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Return the Array Return Type (Array or Value of first element in the array).
+ *
+ * @return string $returnType Array return type
+ */
+ public static function getArrayReturnType()
+ {
+ return self::$returnArrayAsType;
+ }
+
+ /**
+ * Is calculation caching enabled?
+ *
+ * @return bool
+ */
+ public function getCalculationCacheEnabled()
+ {
+ return $this->calculationCacheEnabled;
+ }
+
+ /**
+ * Enable/disable calculation cache.
+ *
+ * @param bool $pValue
+ */
+ public function setCalculationCacheEnabled($pValue)
+ {
+ $this->calculationCacheEnabled = $pValue;
+ $this->clearCalculationCache();
+ }
+
+ /**
+ * Enable calculation cache.
+ */
+ public function enableCalculationCache()
+ {
+ $this->setCalculationCacheEnabled(true);
+ }
+
+ /**
+ * Disable calculation cache.
+ */
+ public function disableCalculationCache()
+ {
+ $this->setCalculationCacheEnabled(false);
+ }
+
+ /**
+ * Clear calculation cache.
+ */
+ public function clearCalculationCache()
+ {
+ $this->calculationCache = [];
+ }
+
+ /**
+ * Clear calculation cache for a specified worksheet.
+ *
+ * @param string $worksheetName
+ */
+ public function clearCalculationCacheForWorksheet($worksheetName)
+ {
+ if (isset($this->calculationCache[$worksheetName])) {
+ unset($this->calculationCache[$worksheetName]);
+ }
+ }
+
+ /**
+ * Rename calculation cache for a specified worksheet.
+ *
+ * @param string $fromWorksheetName
+ * @param string $toWorksheetName
+ */
+ public function renameCalculationCacheForWorksheet($fromWorksheetName, $toWorksheetName)
+ {
+ if (isset($this->calculationCache[$fromWorksheetName])) {
+ $this->calculationCache[$toWorksheetName] = &$this->calculationCache[$fromWorksheetName];
+ unset($this->calculationCache[$fromWorksheetName]);
+ }
+ }
+
+ /**
+ * Get the currently defined locale code.
+ *
+ * @return string
+ */
+ public function getLocale()
+ {
+ return self::$localeLanguage;
+ }
+
+ /**
+ * Set the locale code.
+ *
+ * @param string $locale The locale to use for formula translation, eg: 'en_us'
+ *
+ * @return bool
+ */
+ public function setLocale($locale)
+ {
+ // Identify our locale and language
+ $language = $locale = strtolower($locale);
+ if (strpos($locale, '_') !== false) {
+ list($language) = explode('_', $locale);
+ }
+ if (count(self::$validLocaleLanguages) == 1) {
+ self::loadLocales();
+ }
+ // Test whether we have any language data for this language (any locale)
+ if (in_array($language, self::$validLocaleLanguages)) {
+ // initialise language/locale settings
+ self::$localeFunctions = [];
+ self::$localeArgumentSeparator = ',';
+ self::$localeBoolean = ['TRUE' => 'TRUE', 'FALSE' => 'FALSE', 'NULL' => 'NULL'];
+ // Default is English, if user isn't requesting english, then read the necessary data from the locale files
+ if ($locale != 'en_us') {
+ // Search for a file with a list of function names for locale
+ $functionNamesFile = __DIR__ . '/locale/' . str_replace('_', DIRECTORY_SEPARATOR, $locale) . DIRECTORY_SEPARATOR . 'functions';
+ if (!file_exists($functionNamesFile)) {
+ // If there isn't a locale specific function file, look for a language specific function file
+ $functionNamesFile = __DIR__ . '/locale/' . $language . DIRECTORY_SEPARATOR . 'functions';
+ if (!file_exists($functionNamesFile)) {
+ return false;
+ }
+ }
+ // Retrieve the list of locale or language specific function names
+ $localeFunctions = file($functionNamesFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
+ foreach ($localeFunctions as $localeFunction) {
+ list($localeFunction) = explode('##', $localeFunction); // Strip out comments
+ if (strpos($localeFunction, '=') !== false) {
+ list($fName, $lfName) = explode('=', $localeFunction);
+ $fName = trim($fName);
+ $lfName = trim($lfName);
+ if ((isset(self::$phpSpreadsheetFunctions[$fName])) && ($lfName != '') && ($fName != $lfName)) {
+ self::$localeFunctions[$fName] = $lfName;
+ }
+ }
+ }
+ // Default the TRUE and FALSE constants to the locale names of the TRUE() and FALSE() functions
+ if (isset(self::$localeFunctions['TRUE'])) {
+ self::$localeBoolean['TRUE'] = self::$localeFunctions['TRUE'];
+ }
+ if (isset(self::$localeFunctions['FALSE'])) {
+ self::$localeBoolean['FALSE'] = self::$localeFunctions['FALSE'];
+ }
+
+ $configFile = __DIR__ . '/locale/' . str_replace('_', DIRECTORY_SEPARATOR, $locale) . DIRECTORY_SEPARATOR . 'config';
+ if (!file_exists($configFile)) {
+ $configFile = __DIR__ . '/locale/' . $language . DIRECTORY_SEPARATOR . 'config';
+ }
+ if (file_exists($configFile)) {
+ $localeSettings = file($configFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
+ foreach ($localeSettings as $localeSetting) {
+ list($localeSetting) = explode('##', $localeSetting); // Strip out comments
+ if (strpos($localeSetting, '=') !== false) {
+ list($settingName, $settingValue) = explode('=', $localeSetting);
+ $settingName = strtoupper(trim($settingName));
+ switch ($settingName) {
+ case 'ARGUMENTSEPARATOR':
+ self::$localeArgumentSeparator = trim($settingValue);
+
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ self::$functionReplaceFromExcel = self::$functionReplaceToExcel =
+ self::$functionReplaceFromLocale = self::$functionReplaceToLocale = null;
+ self::$localeLanguage = $locale;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * @param string $fromSeparator
+ * @param string $toSeparator
+ * @param string $formula
+ * @param bool $inBraces
+ *
+ * @return string
+ */
+ public static function translateSeparator($fromSeparator, $toSeparator, $formula, &$inBraces)
+ {
+ $strlen = mb_strlen($formula);
+ for ($i = 0; $i < $strlen; ++$i) {
+ $chr = mb_substr($formula, $i, 1);
+ switch ($chr) {
+ case '{':
+ $inBraces = true;
+
+ break;
+ case '}':
+ $inBraces = false;
+
+ break;
+ case $fromSeparator:
+ if (!$inBraces) {
+ $formula = mb_substr($formula, 0, $i) . $toSeparator . mb_substr($formula, $i + 1);
+ }
+ }
+ }
+
+ return $formula;
+ }
+
+ /**
+ * @param string[] $from
+ * @param string[] $to
+ * @param string $formula
+ * @param string $fromSeparator
+ * @param string $toSeparator
+ *
+ * @return string
+ */
+ private static function translateFormula(array $from, array $to, $formula, $fromSeparator, $toSeparator)
+ {
+ // Convert any Excel function names to the required language
+ if (self::$localeLanguage !== 'en_us') {
+ $inBraces = false;
+ // If there is the possibility of braces within a quoted string, then we don't treat those as matrix indicators
+ if (strpos($formula, '"') !== false) {
+ // So instead we skip replacing in any quoted strings by only replacing in every other array element after we've exploded
+ // the formula
+ $temp = explode('"', $formula);
+ $i = false;
+ foreach ($temp as &$value) {
+ // Only count/replace in alternating array entries
+ if ($i = !$i) {
+ $value = preg_replace($from, $to, $value);
+ $value = self::translateSeparator($fromSeparator, $toSeparator, $value, $inBraces);
+ }
+ }
+ unset($value);
+ // Then rebuild the formula string
+ $formula = implode('"', $temp);
+ } else {
+ // If there's no quoted strings, then we do a simple count/replace
+ $formula = preg_replace($from, $to, $formula);
+ $formula = self::translateSeparator($fromSeparator, $toSeparator, $formula, $inBraces);
+ }
+ }
+
+ return $formula;
+ }
+
+ private static $functionReplaceFromExcel = null;
+
+ private static $functionReplaceToLocale = null;
+
+ public function _translateFormulaToLocale($formula)
+ {
+ if (self::$functionReplaceFromExcel === null) {
+ self::$functionReplaceFromExcel = [];
+ foreach (array_keys(self::$localeFunctions) as $excelFunctionName) {
+ self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelFunctionName, '/') . '([\s]*\()/Ui';
+ }
+ foreach (array_keys(self::$localeBoolean) as $excelBoolean) {
+ self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelBoolean, '/') . '([^\w\.])/Ui';
+ }
+ }
+
+ if (self::$functionReplaceToLocale === null) {
+ self::$functionReplaceToLocale = [];
+ foreach (self::$localeFunctions as $localeFunctionName) {
+ self::$functionReplaceToLocale[] = '$1' . trim($localeFunctionName) . '$2';
+ }
+ foreach (self::$localeBoolean as $localeBoolean) {
+ self::$functionReplaceToLocale[] = '$1' . trim($localeBoolean) . '$2';
+ }
+ }
+
+ return self::translateFormula(self::$functionReplaceFromExcel, self::$functionReplaceToLocale, $formula, ',', self::$localeArgumentSeparator);
+ }
+
+ private static $functionReplaceFromLocale = null;
+
+ private static $functionReplaceToExcel = null;
+
+ public function _translateFormulaToEnglish($formula)
+ {
+ if (self::$functionReplaceFromLocale === null) {
+ self::$functionReplaceFromLocale = [];
+ foreach (self::$localeFunctions as $localeFunctionName) {
+ self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($localeFunctionName, '/') . '([\s]*\()/Ui';
+ }
+ foreach (self::$localeBoolean as $excelBoolean) {
+ self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($excelBoolean, '/') . '([^\w\.])/Ui';
+ }
+ }
+
+ if (self::$functionReplaceToExcel === null) {
+ self::$functionReplaceToExcel = [];
+ foreach (array_keys(self::$localeFunctions) as $excelFunctionName) {
+ self::$functionReplaceToExcel[] = '$1' . trim($excelFunctionName) . '$2';
+ }
+ foreach (array_keys(self::$localeBoolean) as $excelBoolean) {
+ self::$functionReplaceToExcel[] = '$1' . trim($excelBoolean) . '$2';
+ }
+ }
+
+ return self::translateFormula(self::$functionReplaceFromLocale, self::$functionReplaceToExcel, $formula, self::$localeArgumentSeparator, ',');
+ }
+
+ public static function localeFunc($function)
+ {
+ if (self::$localeLanguage !== 'en_us') {
+ $functionName = trim($function, '(');
+ if (isset(self::$localeFunctions[$functionName])) {
+ $brace = ($functionName != $function);
+ $function = self::$localeFunctions[$functionName];
+ if ($brace) {
+ $function .= '(';
+ }
+ }
+ }
+
+ return $function;
+ }
+
+ /**
+ * Wrap string values in quotes.
+ *
+ * @param mixed $value
+ *
+ * @return mixed
+ */
+ public static function wrapResult($value)
+ {
+ if (is_string($value)) {
+ // Error values cannot be "wrapped"
+ if (preg_match('/^' . self::CALCULATION_REGEXP_ERROR . '$/i', $value, $match)) {
+ // Return Excel errors "as is"
+ return $value;
+ }
+ // Return strings wrapped in quotes
+ return '"' . $value . '"';
+ // Convert numeric errors to NaN error
+ } elseif ((is_float($value)) && ((is_nan($value)) || (is_infinite($value)))) {
+ return Functions::NAN();
+ }
+
+ return $value;
+ }
+
+ /**
+ * Remove quotes used as a wrapper to identify string values.
+ *
+ * @param mixed $value
+ *
+ * @return mixed
+ */
+ public static function unwrapResult($value)
+ {
+ if (is_string($value)) {
+ if ((isset($value[0])) && ($value[0] == '"') && (substr($value, -1) == '"')) {
+ return substr($value, 1, -1);
+ }
+ // Convert numeric errors to NAN error
+ } elseif ((is_float($value)) && ((is_nan($value)) || (is_infinite($value)))) {
+ return Functions::NAN();
+ }
+
+ return $value;
+ }
+
+ /**
+ * Calculate cell value (using formula from a cell ID)
+ * Retained for backward compatibility.
+ *
+ * @param Cell $pCell Cell to calculate
+ *
+ * @throws Exception
+ *
+ * @return mixed
+ */
+ public function calculate(Cell $pCell = null)
+ {
+ try {
+ return $this->calculateCellValue($pCell);
+ } catch (\Exception $e) {
+ throw new Exception($e->getMessage());
+ }
+ }
+
+ /**
+ * Calculate the value of a cell formula.
+ *
+ * @param Cell $pCell Cell to calculate
+ * @param bool $resetLog Flag indicating whether the debug log should be reset or not
+ *
+ * @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
+ * @return mixed
+ */
+ public function calculateCellValue(Cell $pCell = null, $resetLog = true)
+ {
+ if ($pCell === null) {
+ return null;
+ }
+
+ $returnArrayAsType = self::$returnArrayAsType;
+ if ($resetLog) {
+ // Initialise the logging settings if requested
+ $this->formulaError = null;
+ $this->debugLog->clearLog();
+ $this->cyclicReferenceStack->clear();
+ $this->cyclicFormulaCounter = 1;
+
+ self::$returnArrayAsType = self::RETURN_ARRAY_AS_ARRAY;
+ }
+
+ // Execute the calculation for the cell formula
+ $this->cellStack[] = [
+ 'sheet' => $pCell->getWorksheet()->getTitle(),
+ 'cell' => $pCell->getCoordinate(),
+ ];
+
+ try {
+ $result = self::unwrapResult($this->_calculateFormulaValue($pCell->getValue(), $pCell->getCoordinate(), $pCell));
+ $cellAddress = array_pop($this->cellStack);
+ $this->spreadsheet->getSheetByName($cellAddress['sheet'])->getCell($cellAddress['cell']);
+ } catch (\Exception $e) {
+ $cellAddress = array_pop($this->cellStack);
+ $this->spreadsheet->getSheetByName($cellAddress['sheet'])->getCell($cellAddress['cell']);
+
+ throw new Exception($e->getMessage());
+ }
+
+ if ((is_array($result)) && (self::$returnArrayAsType != self::RETURN_ARRAY_AS_ARRAY)) {
+ self::$returnArrayAsType = $returnArrayAsType;
+ $testResult = Functions::flattenArray($result);
+ if (self::$returnArrayAsType == self::RETURN_ARRAY_AS_ERROR) {
+ return Functions::VALUE();
+ }
+ // If there's only a single cell in the array, then we allow it
+ if (count($testResult) != 1) {
+ // If keys are numeric, then it's a matrix result rather than a cell range result, so we permit it
+ $r = array_keys($result);
+ $r = array_shift($r);
+ if (!is_numeric($r)) {
+ return Functions::VALUE();
+ }
+ if (is_array($result[$r])) {
+ $c = array_keys($result[$r]);
+ $c = array_shift($c);
+ if (!is_numeric($c)) {
+ return Functions::VALUE();
+ }
+ }
+ }
+ $result = array_shift($testResult);
+ }
+ self::$returnArrayAsType = $returnArrayAsType;
+
+ if ($result === null) {
+ return 0;
+ } elseif ((is_float($result)) && ((is_nan($result)) || (is_infinite($result)))) {
+ return Functions::NAN();
+ }
+
+ return $result;
+ }
+
+ /**
+ * Validate and parse a formula string.
+ *
+ * @param string $formula Formula to parse
+ *
+ * @return array|bool
+ */
+ public function parseFormula($formula)
+ {
+ // Basic validation that this is indeed a formula
+ // We return an empty array if not
+ $formula = trim($formula);
+ if ((!isset($formula[0])) || ($formula[0] != '=')) {
+ return [];
+ }
+ $formula = ltrim(substr($formula, 1));
+ if (!isset($formula[0])) {
+ return [];
+ }
+
+ // Parse the formula and return the token stack
+ return $this->_parseFormula($formula);
+ }
+
+ /**
+ * Calculate the value of a formula.
+ *
+ * @param string $formula Formula to parse
+ * @param string $cellID Address of the cell to calculate
+ * @param Cell $pCell Cell to calculate
+ *
+ * @throws \PhpOffice\PhpSpreadsheet\Exception
+ *
+ * @return mixed
+ */
+ public function calculateFormula($formula, $cellID = null, Cell $pCell = null)
+ {
+ // Initialise the logging settings
+ $this->formulaError = null;
+ $this->debugLog->clearLog();
+ $this->cyclicReferenceStack->clear();
+
+ if ($this->spreadsheet !== null && $cellID === null && $pCell === null) {
+ $cellID = 'A1';
+ $pCell = $this->spreadsheet->getActiveSheet()->getCell($cellID);
+ } else {
+ // Disable calculation cacheing because it only applies to cell calculations, not straight formulae
+ // But don't actually flush any cache
+ $resetCache = $this->getCalculationCacheEnabled();
+ $this->calculationCacheEnabled = false;
+ }
+
+ // Execute the calculation
+ try {
+ $result = self::unwrapResult($this->_calculateFormulaValue($formula, $cellID, $pCell));
+ } catch (\Exception $e) {
+ throw new Exception($e->getMessage());
+ }
+
+ if ($this->spreadsheet === null) {
+ // Reset calculation cacheing to its previous state
+ $this->calculationCacheEnabled = $resetCache;
+ }
+
+ return $result;
+ }
+
+ /**
+ * @param string $cellReference
+ * @param mixed $cellValue
+ *
+ * @return bool
+ */
+ public function getValueFromCache($cellReference, &$cellValue)
+ {
+ // Is calculation cacheing enabled?
+ // Is the value present in calculation cache?
+ $this->debugLog->writeDebugLog('Testing cache value for cell ', $cellReference);
+ if (($this->calculationCacheEnabled) && (isset($this->calculationCache[$cellReference]))) {
+ $this->debugLog->writeDebugLog('Retrieving value for cell ', $cellReference, ' from cache');
+ // Return the cached result
+ $cellValue = $this->calculationCache[$cellReference];
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * @param string $cellReference
+ * @param mixed $cellValue
+ */
+ public function saveValueToCache($cellReference, $cellValue)
+ {
+ if ($this->calculationCacheEnabled) {
+ $this->calculationCache[$cellReference] = $cellValue;
+ }
+ }
+
+ /**
+ * Parse a cell formula and calculate its value.
+ *
+ * @param string $formula The formula to parse and calculate
+ * @param string $cellID The ID (e.g. A3) of the cell that we are calculating
+ * @param Cell $pCell Cell to calculate
+ *
+ * @throws Exception
+ *
+ * @return mixed
+ */
+ public function _calculateFormulaValue($formula, $cellID = null, Cell $pCell = null)
+ {
+ $cellValue = null;
+
+ // Quote-Prefixed cell values cannot be formulae, but are treated as strings
+ if ($pCell !== null && $pCell->getStyle()->getQuotePrefix() === true) {
+ return self::wrapResult((string) $formula);
+ }
+
+ if (preg_match('/^=\s*cmd\s*\|/miu', $formula) !== 0) {
+ return self::wrapResult($formula);
+ }
+
+ // Basic validation that this is indeed a formula
+ // We simply return the cell value if not
+ $formula = trim($formula);
+ if ($formula[0] != '=') {
+ return self::wrapResult($formula);
+ }
+ $formula = ltrim(substr($formula, 1));
+ if (!isset($formula[0])) {
+ return self::wrapResult($formula);
+ }
+
+ $pCellParent = ($pCell !== null) ? $pCell->getWorksheet() : null;
+ $wsTitle = ($pCellParent !== null) ? $pCellParent->getTitle() : "\x00Wrk";
+ $wsCellReference = $wsTitle . '!' . $cellID;
+
+ if (($cellID !== null) && ($this->getValueFromCache($wsCellReference, $cellValue))) {
+ return $cellValue;
+ }
+
+ if (($wsTitle[0] !== "\x00") && ($this->cyclicReferenceStack->onStack($wsCellReference))) {
+ if ($this->cyclicFormulaCount <= 0) {
+ $this->cyclicFormulaCell = '';
+
+ return $this->raiseFormulaError('Cyclic Reference in Formula');
+ } elseif ($this->cyclicFormulaCell === $wsCellReference) {
+ ++$this->cyclicFormulaCounter;
+ if ($this->cyclicFormulaCounter >= $this->cyclicFormulaCount) {
+ $this->cyclicFormulaCell = '';
+
+ return $cellValue;
+ }
+ } elseif ($this->cyclicFormulaCell == '') {
+ if ($this->cyclicFormulaCounter >= $this->cyclicFormulaCount) {
+ return $cellValue;
+ }
+ $this->cyclicFormulaCell = $wsCellReference;
+ }
+ }
+
+ // Parse the formula onto the token stack and calculate the value
+ $this->cyclicReferenceStack->push($wsCellReference);
+ $cellValue = $this->processTokenStack($this->_parseFormula($formula, $pCell), $cellID, $pCell);
+ $this->cyclicReferenceStack->pop();
+
+ // Save to calculation cache
+ if ($cellID !== null) {
+ $this->saveValueToCache($wsCellReference, $cellValue);
+ }
+
+ // Return the calculated value
+ return $cellValue;
+ }
+
+ /**
+ * Ensure that paired matrix operands are both matrices and of the same size.
+ *
+ * @param mixed &$operand1 First matrix operand
+ * @param mixed &$operand2 Second matrix operand
+ * @param int $resize Flag indicating whether the matrices should be resized to match
+ * and (if so), whether the smaller dimension should grow or the
+ * larger should shrink.
+ * 0 = no resize
+ * 1 = shrink to fit
+ * 2 = extend to fit
+ *
+ * @return array
+ */
+ private static function checkMatrixOperands(&$operand1, &$operand2, $resize = 1)
+ {
+ // Examine each of the two operands, and turn them into an array if they aren't one already
+ // Note that this function should only be called if one or both of the operand is already an array
+ if (!is_array($operand1)) {
+ list($matrixRows, $matrixColumns) = self::getMatrixDimensions($operand2);
+ $operand1 = array_fill(0, $matrixRows, array_fill(0, $matrixColumns, $operand1));
+ $resize = 0;
+ } elseif (!is_array($operand2)) {
+ list($matrixRows, $matrixColumns) = self::getMatrixDimensions($operand1);
+ $operand2 = array_fill(0, $matrixRows, array_fill(0, $matrixColumns, $operand2));
+ $resize = 0;
+ }
+
+ list($matrix1Rows, $matrix1Columns) = self::getMatrixDimensions($operand1);
+ list($matrix2Rows, $matrix2Columns) = self::getMatrixDimensions($operand2);
+ if (($matrix1Rows == $matrix2Columns) && ($matrix2Rows == $matrix1Columns)) {
+ $resize = 1;
+ }
+
+ if ($resize == 2) {
+ // Given two matrices of (potentially) unequal size, convert the smaller in each dimension to match the larger
+ self::resizeMatricesExtend($operand1, $operand2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns);
+ } elseif ($resize == 1) {
+ // Given two matrices of (potentially) unequal size, convert the larger in each dimension to match the smaller
+ self::resizeMatricesShrink($operand1, $operand2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns);
+ }
+
+ return [$matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns];
+ }
+
+ /**
+ * Read the dimensions of a matrix, and re-index it with straight numeric keys starting from row 0, column 0.
+ *
+ * @param array &$matrix matrix operand
+ *
+ * @return int[] An array comprising the number of rows, and number of columns
+ */
+ public static function getMatrixDimensions(array &$matrix)
+ {
+ $matrixRows = count($matrix);
+ $matrixColumns = 0;
+ foreach ($matrix as $rowKey => $rowValue) {
+ if (!is_array($rowValue)) {
+ $matrix[$rowKey] = [$rowValue];
+ $matrixColumns = max(1, $matrixColumns);
+ } else {
+ $matrix[$rowKey] = array_values($rowValue);
+ $matrixColumns = max(count($rowValue), $matrixColumns);
+ }
+ }
+ $matrix = array_values($matrix);
+
+ return [$matrixRows, $matrixColumns];
+ }
+
+ /**
+ * Ensure that paired matrix operands are both matrices of the same size.
+ *
+ * @param mixed &$matrix1 First matrix operand
+ * @param mixed &$matrix2 Second matrix operand
+ * @param int $matrix1Rows Row size of first matrix operand
+ * @param int $matrix1Columns Column size of first matrix operand
+ * @param int $matrix2Rows Row size of second matrix operand
+ * @param int $matrix2Columns Column size of second matrix operand
+ */
+ private static function resizeMatricesShrink(&$matrix1, &$matrix2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns)
+ {
+ if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) {
+ if ($matrix2Rows < $matrix1Rows) {
+ for ($i = $matrix2Rows; $i < $matrix1Rows; ++$i) {
+ unset($matrix1[$i]);
+ }
+ }
+ if ($matrix2Columns < $matrix1Columns) {
+ for ($i = 0; $i < $matrix1Rows; ++$i) {
+ for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) {
+ unset($matrix1[$i][$j]);
+ }
+ }
+ }
+ }
+
+ if (($matrix1Columns < $matrix2Columns) || ($matrix1Rows < $matrix2Rows)) {
+ if ($matrix1Rows < $matrix2Rows) {
+ for ($i = $matrix1Rows; $i < $matrix2Rows; ++$i) {
+ unset($matrix2[$i]);
+ }
+ }
+ if ($matrix1Columns < $matrix2Columns) {
+ for ($i = 0; $i < $matrix2Rows; ++$i) {
+ for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) {
+ unset($matrix2[$i][$j]);
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Ensure that paired matrix operands are both matrices of the same size.
+ *
+ * @param mixed &$matrix1 First matrix operand
+ * @param mixed &$matrix2 Second matrix operand
+ * @param int $matrix1Rows Row size of first matrix operand
+ * @param int $matrix1Columns Column size of first matrix operand
+ * @param int $matrix2Rows Row size of second matrix operand
+ * @param int $matrix2Columns Column size of second matrix operand
+ */
+ private static function resizeMatricesExtend(&$matrix1, &$matrix2, $matrix1Rows, $matrix1Columns, $matrix2Rows, $matrix2Columns)
+ {
+ if (($matrix2Columns < $matrix1Columns) || ($matrix2Rows < $matrix1Rows)) {
+ if ($matrix2Columns < $matrix1Columns) {
+ for ($i = 0; $i < $matrix2Rows; ++$i) {
+ $x = $matrix2[$i][$matrix2Columns - 1];
+ for ($j = $matrix2Columns; $j < $matrix1Columns; ++$j) {
+ $matrix2[$i][$j] = $x;
+ }
+ }
+ }
+ if ($matrix2Rows < $matrix1Rows) {
+ $x = $matrix2[$matrix2Rows - 1];
+ for ($i = 0; $i < $matrix1Rows; ++$i) {
+ $matrix2[$i] = $x;
+ }
+ }
+ }
+
+ if (($matrix1Columns < $matrix2Columns) || ($matrix1Rows < $matrix2Rows)) {
+ if ($matrix1Columns < $matrix2Columns) {
+ for ($i = 0; $i < $matrix1Rows; ++$i) {
+ $x = $matrix1[$i][$matrix1Columns - 1];
+ for ($j = $matrix1Columns; $j < $matrix2Columns; ++$j) {
+ $matrix1[$i][$j] = $x;
+ }
+ }
+ }
+ if ($matrix1Rows < $matrix2Rows) {
+ $x = $matrix1[$matrix1Rows - 1];
+ for ($i = 0; $i < $matrix2Rows; ++$i) {
+ $matrix1[$i] = $x;
+ }
+ }
+ }
+ }
+
+ /**
+ * Format details of an operand for display in the log (based on operand type).
+ *
+ * @param mixed $value First matrix operand
+ *
+ * @return mixed
+ */
+ private function showValue($value)
+ {
+ if ($this->debugLog->getWriteDebugLog()) {
+ $testArray = Functions::flattenArray($value);
+ if (count($testArray) == 1) {
+ $value = array_pop($testArray);
+ }
+
+ if (is_array($value)) {
+ $returnMatrix = [];
+ $pad = $rpad = ', ';
+ foreach ($value as $row) {
+ if (is_array($row)) {
+ $returnMatrix[] = implode($pad, array_map([$this, 'showValue'], $row));
+ $rpad = '; ';
+ } else {
+ $returnMatrix[] = $this->showValue($row);
+ }
+ }
+
+ return '{ ' . implode($rpad, $returnMatrix) . ' }';
+ } elseif (is_string($value) && (trim($value, '"') == $value)) {
+ return '"' . $value . '"';
+ } elseif (is_bool($value)) {
+ return ($value) ? self::$localeBoolean['TRUE'] : self::$localeBoolean['FALSE'];
+ }
+ }
+
+ return Functions::flattenSingleValue($value);
+ }
+
+ /**
+ * Format type and details of an operand for display in the log (based on operand type).
+ *
+ * @param mixed $value First matrix operand
+ *
+ * @return null|string
+ */
+ private function showTypeDetails($value)
+ {
+ if ($this->debugLog->getWriteDebugLog()) {
+ $testArray = Functions::flattenArray($value);
+ if (count($testArray) == 1) {
+ $value = array_pop($testArray);
+ }
+
+ if ($value === null) {
+ return 'a NULL value';
+ } elseif (is_float($value)) {
+ $typeString = 'a floating point number';
+ } elseif (is_int($value)) {
+ $typeString = 'an integer number';
+ } elseif (is_bool($value)) {
+ $typeString = 'a boolean';
+ } elseif (is_array($value)) {
+ $typeString = 'a matrix';
+ } else {
+ if ($value == '') {
+ return 'an empty string';
+ } elseif ($value[0] == '#') {
+ return 'a ' . $value . ' error';
+ }
+ $typeString = 'a string';
+ }
+
+ return $typeString . ' with a value of ' . $this->showValue($value);
+ }
+ }
+
+ /**
+ * @param string $formula
+ *
+ * @return string
+ */
+ private function convertMatrixReferences($formula)
+ {
+ static $matrixReplaceFrom = ['{', ';', '}'];
+ static $matrixReplaceTo = ['MKMATRIX(MKMATRIX(', '),MKMATRIX(', '))'];
+
+ // Convert any Excel matrix references to the MKMATRIX() function
+ if (strpos($formula, '{') !== false) {
+ // If there is the possibility of braces within a quoted string, then we don't treat those as matrix indicators
+ if (strpos($formula, '"') !== false) {
+ // So instead we skip replacing in any quoted strings by only replacing in every other array element after we've exploded
+ // the formula
+ $temp = explode('"', $formula);
+ // Open and Closed counts used for trapping mismatched braces in the formula
+ $openCount = $closeCount = 0;
+ $i = false;
+ foreach ($temp as &$value) {
+ // Only count/replace in alternating array entries
+ if ($i = !$i) {
+ $openCount += substr_count($value, '{');
+ $closeCount += substr_count($value, '}');
+ $value = str_replace($matrixReplaceFrom, $matrixReplaceTo, $value);
+ }
+ }
+ unset($value);
+ // Then rebuild the formula string
+ $formula = implode('"', $temp);
+ } else {
+ // If there's no quoted strings, then we do a simple count/replace
+ $openCount = substr_count($formula, '{');
+ $closeCount = substr_count($formula, '}');
+ $formula = str_replace($matrixReplaceFrom, $matrixReplaceTo, $formula);
+ }
+ // Trap for mismatched braces and trigger an appropriate error
+ if ($openCount < $closeCount) {
+ if ($openCount > 0) {
+ return $this->raiseFormulaError("Formula Error: Mismatched matrix braces '}'");
+ }
+
+ return $this->raiseFormulaError("Formula Error: Unexpected '}' encountered");
+ } elseif ($openCount > $closeCount) {
+ if ($closeCount > 0) {
+ return $this->raiseFormulaError("Formula Error: Mismatched matrix braces '{'");
+ }
+
+ return $this->raiseFormulaError("Formula Error: Unexpected '{' encountered");
+ }
+ }
+
+ return $formula;
+ }
+
+ private static function mkMatrix(...$args)
+ {
+ return $args;
+ }
+
+ // Binary Operators
+ // These operators always work on two values
+ // Array key is the operator, the value indicates whether this is a left or right associative operator
+ private static $operatorAssociativity = [
+ '^' => 0, // Exponentiation
+ '*' => 0, '/' => 0, // Multiplication and Division
+ '+' => 0, '-' => 0, // Addition and Subtraction
+ '&' => 0, // Concatenation
+ '|' => 0, ':' => 0, // Intersect and Range
+ '>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0, // Comparison
+ ];
+
+ // Comparison (Boolean) Operators
+ // These operators work on two values, but always return a boolean result
+ private static $comparisonOperators = ['>' => true, '<' => true, '=' => true, '>=' => true, '<=' => true, '<>' => true];
+
+ // Operator Precedence
+ // This list includes all valid operators, whether binary (including boolean) or unary (such as %)
+ // Array key is the operator, the value is its precedence
+ private static $operatorPrecedence = [
+ ':' => 8, // Range
+ '|' => 7, // Intersect
+ '~' => 6, // Negation
+ '%' => 5, // Percentage
+ '^' => 4, // Exponentiation
+ '*' => 3, '/' => 3, // Multiplication and Division
+ '+' => 2, '-' => 2, // Addition and Subtraction
+ '&' => 1, // Concatenation
+ '>' => 0, '<' => 0, '=' => 0, '>=' => 0, '<=' => 0, '<>' => 0, // Comparison
+ ];
+
+ // Convert infix to postfix notation
+
+ /**
+ * @param string $formula
+ * @param null|\PhpOffice\PhpSpreadsheet\Cell\Cell $pCell
+ *
+ * @return bool
+ */
+ private function _parseFormula($formula, Cell $pCell = null)
+ {
+ if (($formula = $this->convertMatrixReferences(trim($formula))) === false) {
+ return false;
+ }
+
+ // If we're using cell caching, then $pCell may well be flushed back to the cache (which detaches the parent worksheet),
+ // so we store the parent worksheet so that we can re-attach it when necessary
+ $pCellParent = ($pCell !== null) ? $pCell->getWorksheet() : null;
+
+ $regexpMatchString = '/^(' . self::CALCULATION_REGEXP_FUNCTION .
+ '|' . self::CALCULATION_REGEXP_CELLREF .
+ '|' . self::CALCULATION_REGEXP_NUMBER .
+ '|' . self::CALCULATION_REGEXP_STRING .
+ '|' . self::CALCULATION_REGEXP_OPENBRACE .
+ '|' . self::CALCULATION_REGEXP_NAMEDRANGE .
+ '|' . self::CALCULATION_REGEXP_ERROR .
+ ')/si';
+
+ // Start with initialisation
+ $index = 0;
+ $stack = new Stack();
+ $output = [];
+ $expectingOperator = false; // We use this test in syntax-checking the expression to determine when a
+ // - is a negation or + is a positive operator rather than an operation
+ $expectingOperand = false; // We use this test in syntax-checking the expression to determine whether an operand
+ // should be null in a function call
+ // The guts of the lexical parser
+ // Loop through the formula extracting each operator and operand in turn
+ while (true) {
+ $opCharacter = $formula[$index]; // Get the first character of the value at the current index position
+ if ((isset(self::$comparisonOperators[$opCharacter])) && (strlen($formula) > $index) && (isset(self::$comparisonOperators[$formula[$index + 1]]))) {
+ $opCharacter .= $formula[++$index];
+ }
+
+ // Find out if we're currently at the beginning of a number, variable, cell reference, function, parenthesis or operand
+ $isOperandOrFunction = preg_match($regexpMatchString, substr($formula, $index), $match);
+
+ if ($opCharacter == '-' && !$expectingOperator) { // Is it a negation instead of a minus?
+ $stack->push('Unary Operator', '~'); // Put a negation on the stack
+ ++$index; // and drop the negation symbol
+ } elseif ($opCharacter == '%' && $expectingOperator) {
+ $stack->push('Unary Operator', '%'); // Put a percentage on the stack
+ ++$index;
+ } elseif ($opCharacter == '+' && !$expectingOperator) { // Positive (unary plus rather than binary operator plus) can be discarded?
+ ++$index; // Drop the redundant plus symbol
+ } elseif ((($opCharacter == '~') || ($opCharacter == '|')) && (!$isOperandOrFunction)) { // We have to explicitly deny a tilde or pipe, because they are legal
+ return $this->raiseFormulaError("Formula Error: Illegal character '~'"); // on the stack but not in the input expression
+ } elseif ((isset(self::$operators[$opCharacter]) or $isOperandOrFunction) && $expectingOperator) { // Are we putting an operator on the stack?
+ while ($stack->count() > 0 &&
+ ($o2 = $stack->last()) &&
+ isset(self::$operators[$o2['value']]) &&
+ @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])) {
+ $output[] = $stack->pop(); // Swap operands and higher precedence operators from the stack to the output
+ }
+ $stack->push('Binary Operator', $opCharacter); // Finally put our current operator onto the stack
+ ++$index;
+ $expectingOperator = false;
+ } elseif ($opCharacter == ')' && $expectingOperator) { // Are we expecting to close a parenthesis?
+ $expectingOperand = false;
+ while (($o2 = $stack->pop()) && $o2['value'] != '(') { // Pop off the stack back to the last (
+ if ($o2 === null) {
+ return $this->raiseFormulaError('Formula Error: Unexpected closing brace ")"');
+ }
+ $output[] = $o2;
+ }
+ $d = $stack->last(2);
+ if (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $d['value'], $matches)) { // Did this parenthesis just close a function?
+ $functionName = $matches[1]; // Get the function name
+ $d = $stack->pop();
+ $argumentCount = $d['value']; // See how many arguments there were (argument count is the next value stored on the stack)
+ $output[] = $d; // Dump the argument count on the output
+ $output[] = $stack->pop(); // Pop the function and push onto the output
+ if (isset(self::$controlFunctions[$functionName])) {
+ $expectedArgumentCount = self::$controlFunctions[$functionName]['argumentCount'];
+ $functionCall = self::$controlFunctions[$functionName]['functionCall'];
+ } elseif (isset(self::$phpSpreadsheetFunctions[$functionName])) {
+ $expectedArgumentCount = self::$phpSpreadsheetFunctions[$functionName]['argumentCount'];
+ $functionCall = self::$phpSpreadsheetFunctions[$functionName]['functionCall'];
+ } else { // did we somehow push a non-function on the stack? this should never happen
+ return $this->raiseFormulaError('Formula Error: Internal error, non-function on stack');
+ }
+ // Check the argument count
+ $argumentCountError = false;
+ if (is_numeric($expectedArgumentCount)) {
+ if ($expectedArgumentCount < 0) {
+ if ($argumentCount > abs($expectedArgumentCount)) {
+ $argumentCountError = true;
+ $expectedArgumentCountString = 'no more than ' . abs($expectedArgumentCount);
+ }
+ } else {
+ if ($argumentCount != $expectedArgumentCount) {
+ $argumentCountError = true;
+ $expectedArgumentCountString = $expectedArgumentCount;
+ }
+ }
+ } elseif ($expectedArgumentCount != '*') {
+ $isOperandOrFunction = preg_match('/(\d*)([-+,])(\d*)/', $expectedArgumentCount, $argMatch);
+ switch ($argMatch[2]) {
+ case '+':
+ if ($argumentCount < $argMatch[1]) {
+ $argumentCountError = true;
+ $expectedArgumentCountString = $argMatch[1] . ' or more ';
+ }
+
+ break;
+ case '-':
+ if (($argumentCount < $argMatch[1]) || ($argumentCount > $argMatch[3])) {
+ $argumentCountError = true;
+ $expectedArgumentCountString = 'between ' . $argMatch[1] . ' and ' . $argMatch[3];
+ }
+
+ break;
+ case ',':
+ if (($argumentCount != $argMatch[1]) && ($argumentCount != $argMatch[3])) {
+ $argumentCountError = true;
+ $expectedArgumentCountString = 'either ' . $argMatch[1] . ' or ' . $argMatch[3];
+ }
+
+ break;
+ }
+ }
+ if ($argumentCountError) {
+ return $this->raiseFormulaError("Formula Error: Wrong number of arguments for $functionName() function: $argumentCount given, " . $expectedArgumentCountString . ' expected');
+ }
+ }
+ ++$index;
+ } elseif ($opCharacter == ',') { // Is this the separator for function arguments?
+ while (($o2 = $stack->pop()) && $o2['value'] != '(') { // Pop off the stack back to the last (
+ if ($o2 === null) {
+ return $this->raiseFormulaError('Formula Error: Unexpected ,');
+ }
+ $output[] = $o2; // pop the argument expression stuff and push onto the output
+ }
+ // If we've a comma when we're expecting an operand, then what we actually have is a null operand;
+ // so push a null onto the stack
+ if (($expectingOperand) || (!$expectingOperator)) {
+ $output[] = ['type' => 'NULL Value', 'value' => self::$excelConstants['NULL'], 'reference' => null];
+ }
+ // make sure there was a function
+ $d = $stack->last(2);
+ if (!preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $d['value'], $matches)) {
+ return $this->raiseFormulaError('Formula Error: Unexpected ,');
+ }
+ $d = $stack->pop();
+ $stack->push($d['type'], ++$d['value'], $d['reference']); // increment the argument count
+ $stack->push('Brace', '('); // put the ( back on, we'll need to pop back to it again
+ $expectingOperator = false;
+ $expectingOperand = true;
+ ++$index;
+ } elseif ($opCharacter == '(' && !$expectingOperator) {
+ $stack->push('Brace', '(');
+ ++$index;
+ } elseif ($isOperandOrFunction && !$expectingOperator) { // do we now have a function/variable/number?
+ $expectingOperator = true;
+ $expectingOperand = false;
+ $val = $match[1];
+ $length = strlen($val);
+
+ if (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $val, $matches)) {
+ $val = preg_replace('/\s/u', '', $val);
+ if (isset(self::$phpSpreadsheetFunctions[strtoupper($matches[1])]) || isset(self::$controlFunctions[strtoupper($matches[1])])) { // it's a function
+ $stack->push('Function', strtoupper($val));
+ $ax = preg_match('/^\s*(\s*\))/ui', substr($formula, $index + $length), $amatch);
+ if ($ax) {
+ $stack->push('Operand Count for Function ' . strtoupper($val) . ')', 0);
+ $expectingOperator = true;
+ } else {
+ $stack->push('Operand Count for Function ' . strtoupper($val) . ')', 1);
+ $expectingOperator = false;
+ }
+ $stack->push('Brace', '(');
+ } else { // it's a var w/ implicit multiplication
+ $output[] = ['type' => 'Value', 'value' => $matches[1], 'reference' => null];
+ }
+ } elseif (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/i', $val, $matches)) {
+ // Watch for this case-change when modifying to allow cell references in different worksheets...
+ // Should only be applied to the actual cell column, not the worksheet name
+
+ // If the last entry on the stack was a : operator, then we have a cell range reference
+ $testPrevOp = $stack->last(1);
+ if ($testPrevOp['value'] == ':') {
+ // If we have a worksheet reference, then we're playing with a 3D reference
+ if ($matches[2] == '') {
+ // Otherwise, we 'inherit' the worksheet reference from the start cell reference
+ // The start of the cell range reference should be the last entry in $output
+ $startCellRef = $output[count($output) - 1]['value'];
+ preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/i', $startCellRef, $startMatches);
+ if ($startMatches[2] > '') {
+ $val = $startMatches[2] . '!' . $val;
+ }
+ } else {
+ return $this->raiseFormulaError('3D Range references are not yet supported');
+ }
+ }
+
+ $output[] = ['type' => 'Cell Reference', 'value' => $val, 'reference' => $val];
+ } else { // it's a variable, constant, string, number or boolean
+ // If the last entry on the stack was a : operator, then we may have a row or column range reference
+ $testPrevOp = $stack->last(1);
+ if ($testPrevOp['value'] == ':') {
+ $startRowColRef = $output[count($output) - 1]['value'];
+ list($rangeWS1, $startRowColRef) = Worksheet::extractSheetTitle($startRowColRef, true);
+ if ($rangeWS1 != '') {
+ $rangeWS1 .= '!';
+ }
+ list($rangeWS2, $val) = Worksheet::extractSheetTitle($val, true);
+ if ($rangeWS2 != '') {
+ $rangeWS2 .= '!';
+ } else {
+ $rangeWS2 = $rangeWS1;
+ }
+ if ((is_int($startRowColRef)) && (ctype_digit($val)) &&
+ ($startRowColRef <= 1048576) && ($val <= 1048576)) {
+ // Row range
+ $endRowColRef = ($pCellParent !== null) ? $pCellParent->getHighestColumn() : 'XFD'; // Max 16,384 columns for Excel2007
+ $output[count($output) - 1]['value'] = $rangeWS1 . 'A' . $startRowColRef;
+ $val = $rangeWS2 . $endRowColRef . $val;
+ } elseif ((ctype_alpha($startRowColRef)) && (ctype_alpha($val)) &&
+ (strlen($startRowColRef) <= 3) && (strlen($val) <= 3)) {
+ // Column range
+ $endRowColRef = ($pCellParent !== null) ? $pCellParent->getHighestRow() : 1048576; // Max 1,048,576 rows for Excel2007
+ $output[count($output) - 1]['value'] = $rangeWS1 . strtoupper($startRowColRef) . '1';
+ $val = $rangeWS2 . $val . $endRowColRef;
+ }
+ }
+
+ $localeConstant = false;
+ if ($opCharacter == '"') {
+ // UnEscape any quotes within the string
+ $val = self::wrapResult(str_replace('""', '"', self::unwrapResult($val)));
+ } elseif (is_numeric($val)) {
+ if ((strpos($val, '.') !== false) || (stripos($val, 'e') !== false) || ($val > PHP_INT_MAX) || ($val < -PHP_INT_MAX)) {
+ $val = (float) $val;
+ } else {
+ $val = (int) $val;
+ }
+ } elseif (isset(self::$excelConstants[trim(strtoupper($val))])) {
+ $excelConstant = trim(strtoupper($val));
+ $val = self::$excelConstants[$excelConstant];
+ } elseif (($localeConstant = array_search(trim(strtoupper($val)), self::$localeBoolean)) !== false) {
+ $val = self::$excelConstants[$localeConstant];
+ }
+ $details = ['type' => 'Value', 'value' => $val, 'reference' => null];
+ if ($localeConstant) {
+ $details['localeValue'] = $localeConstant;
+ }
+ $output[] = $details;
+ }
+ $index += $length;
+ } elseif ($opCharacter == '$') { // absolute row or column range
+ ++$index;
+ } elseif ($opCharacter == ')') { // miscellaneous error checking
+ if ($expectingOperand) {
+ $output[] = ['type' => 'NULL Value', 'value' => self::$excelConstants['NULL'], 'reference' => null];
+ $expectingOperand = false;
+ $expectingOperator = true;
+ } else {
+ return $this->raiseFormulaError("Formula Error: Unexpected ')'");
+ }
+ } elseif (isset(self::$operators[$opCharacter]) && !$expectingOperator) {
+ return $this->raiseFormulaError("Formula Error: Unexpected operator '$opCharacter'");
+ } else { // I don't even want to know what you did to get here
+ return $this->raiseFormulaError('Formula Error: An unexpected error occured');
+ }
+ // Test for end of formula string
+ if ($index == strlen($formula)) {
+ // Did we end with an operator?.
+ // Only valid for the % unary operator
+ if ((isset(self::$operators[$opCharacter])) && ($opCharacter != '%')) {
+ return $this->raiseFormulaError("Formula Error: Operator '$opCharacter' has no operands");
+ }
+
+ break;
+ }
+ // Ignore white space
+ while (($formula[$index] == "\n") || ($formula[$index] == "\r")) {
+ ++$index;
+ }
+ if ($formula[$index] == ' ') {
+ while ($formula[$index] == ' ') {
+ ++$index;
+ }
+ // If we're expecting an operator, but only have a space between the previous and next operands (and both are
+ // Cell References) then we have an INTERSECTION operator
+ if (($expectingOperator) && (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '.*/Ui', substr($formula, $index), $match)) &&
+ ($output[count($output) - 1]['type'] == 'Cell Reference')) {
+ while ($stack->count() > 0 &&
+ ($o2 = $stack->last()) &&
+ isset(self::$operators[$o2['value']]) &&
+ @(self::$operatorAssociativity[$opCharacter] ? self::$operatorPrecedence[$opCharacter] < self::$operatorPrecedence[$o2['value']] : self::$operatorPrecedence[$opCharacter] <= self::$operatorPrecedence[$o2['value']])) {
+ $output[] = $stack->pop(); // Swap operands and higher precedence operators from the stack to the output
+ }
+ $stack->push('Binary Operator', '|'); // Put an Intersect Operator on the stack
+ $expectingOperator = false;
+ }
+ }
+ }
+
+ while (($op = $stack->pop()) !== null) { // pop everything off the stack and push onto output
+ if ((is_array($op) && $op['value'] == '(') || ($op === '(')) {
+ return $this->raiseFormulaError("Formula Error: Expecting ')'"); // if there are any opening braces on the stack, then braces were unbalanced
+ }
+ $output[] = $op;
+ }
+
+ return $output;
+ }
+
+ private static function dataTestReference(&$operandData)
+ {
+ $operand = $operandData['value'];
+ if (($operandData['reference'] === null) && (is_array($operand))) {
+ $rKeys = array_keys($operand);
+ $rowKey = array_shift($rKeys);
+ $cKeys = array_keys(array_keys($operand[$rowKey]));
+ $colKey = array_shift($cKeys);
+ if (ctype_upper($colKey)) {
+ $operandData['reference'] = $colKey . $rowKey;
+ }
+ }
+
+ return $operand;
+ }
+
+ // evaluate postfix notation
+
+ /**
+ * @param mixed $tokens
+ * @param null|string $cellID
+ * @param null|Cell $pCell
+ *
+ * @return bool
+ */
+ private function processTokenStack($tokens, $cellID = null, Cell $pCell = null)
+ {
+ if ($tokens == false) {
+ return false;
+ }
+
+ // If we're using cell caching, then $pCell may well be flushed back to the cache (which detaches the parent cell collection),
+ // so we store the parent cell collection so that we can re-attach it when necessary
+ $pCellWorksheet = ($pCell !== null) ? $pCell->getWorksheet() : null;
+ $pCellParent = ($pCell !== null) ? $pCell->getParent() : null;
+ $stack = new Stack();
+
+ // Loop through each token in turn
+ foreach ($tokens as $tokenData) {
+ $token = $tokenData['value'];
+ // if the token is a binary operator, pop the top two values off the stack, do the operation, and push the result back on the stack
+ if (isset(self::$binaryOperators[$token])) {
+ // We must have two operands, error if we don't
+ if (($operand2Data = $stack->pop()) === null) {
+ return $this->raiseFormulaError('Internal error - Operand value missing from stack');
+ }
+ if (($operand1Data = $stack->pop()) === null) {
+ return $this->raiseFormulaError('Internal error - Operand value missing from stack');
+ }
+
+ $operand1 = self::dataTestReference($operand1Data);
+ $operand2 = self::dataTestReference($operand2Data);
+
+ // Log what we're doing
+ if ($token == ':') {
+ $this->debugLog->writeDebugLog('Evaluating Range ', $this->showValue($operand1Data['reference']), ' ', $token, ' ', $this->showValue($operand2Data['reference']));
+ } else {
+ $this->debugLog->writeDebugLog('Evaluating ', $this->showValue($operand1), ' ', $token, ' ', $this->showValue($operand2));
+ }
+
+ // Process the operation in the appropriate manner
+ switch ($token) {
+ // Comparison (Boolean) Operators
+ case '>': // Greater than
+ case '<': // Less than
+ case '>=': // Greater than or Equal to
+ case '<=': // Less than or Equal to
+ case '=': // Equality
+ case '<>': // Inequality
+ $this->executeBinaryComparisonOperation($cellID, $operand1, $operand2, $token, $stack);
+
+ break;
+ // Binary Operators
+ case ':': // Range
+ if (strpos($operand1Data['reference'], '!') !== false) {
+ list($sheet1, $operand1Data['reference']) = Worksheet::extractSheetTitle($operand1Data['reference'], true);
+ } else {
+ $sheet1 = ($pCellParent !== null) ? $pCellWorksheet->getTitle() : '';
+ }
+
+ list($sheet2, $operand2Data['reference']) = Worksheet::extractSheetTitle($operand2Data['reference'], true);
+ if (empty($sheet2)) {
+ $sheet2 = $sheet1;
+ }
+
+ if ($sheet1 == $sheet2) {
+ if ($operand1Data['reference'] === null) {
+ if ((trim($operand1Data['value']) != '') && (is_numeric($operand1Data['value']))) {
+ $operand1Data['reference'] = $pCell->getColumn() . $operand1Data['value'];
+ } elseif (trim($operand1Data['reference']) == '') {
+ $operand1Data['reference'] = $pCell->getCoordinate();
+ } else {
+ $operand1Data['reference'] = $operand1Data['value'] . $pCell->getRow();
+ }
+ }
+ if ($operand2Data['reference'] === null) {
+ if ((trim($operand2Data['value']) != '') && (is_numeric($operand2Data['value']))) {
+ $operand2Data['reference'] = $pCell->getColumn() . $operand2Data['value'];
+ } elseif (trim($operand2Data['reference']) == '') {
+ $operand2Data['reference'] = $pCell->getCoordinate();
+ } else {
+ $operand2Data['reference'] = $operand2Data['value'] . $pCell->getRow();
+ }
+ }
+
+ $oData = array_merge(explode(':', $operand1Data['reference']), explode(':', $operand2Data['reference']));
+ $oCol = $oRow = [];
+ foreach ($oData as $oDatum) {
+ $oCR = Coordinate::coordinateFromString($oDatum);
+ $oCol[] = Coordinate::columnIndexFromString($oCR[0]) - 1;
+ $oRow[] = $oCR[1];
+ }
+ $cellRef = Coordinate::stringFromColumnIndex(min($oCol) + 1) . min($oRow) . ':' . Coordinate::stringFromColumnIndex(max($oCol) + 1) . max($oRow);
+ if ($pCellParent !== null) {
+ $cellValue = $this->extractCellRange($cellRef, $this->spreadsheet->getSheetByName($sheet1), false);
+ } else {
+ return $this->raiseFormulaError('Unable to access Cell Reference');
+ }
+ $stack->push('Cell Reference', $cellValue, $cellRef);
+ } else {
+ $stack->push('Error', Functions::REF(), null);
+ }
+
+ break;
+ case '+': // Addition
+ $this->executeNumericBinaryOperation($operand1, $operand2, $token, 'plusEquals', $stack);
+
+ break;
+ case '-': // Subtraction
+ $this->executeNumericBinaryOperation($operand1, $operand2, $token, 'minusEquals', $stack);
+
+ break;
+ case '*': // Multiplication
+ $this->executeNumericBinaryOperation($operand1, $operand2, $token, 'arrayTimesEquals', $stack);
+
+ break;
+ case '/': // Division
+ $this->executeNumericBinaryOperation($operand1, $operand2, $token, 'arrayRightDivide', $stack);
+
+ break;
+ case '^': // Exponential
+ $this->executeNumericBinaryOperation($operand1, $operand2, $token, 'power', $stack);
+
+ break;
+ case '&': // Concatenation
+ // If either of the operands is a matrix, we need to treat them both as matrices
+ // (converting the other operand to a matrix if need be); then perform the required
+ // matrix operation
+ if (is_bool($operand1)) {
+ $operand1 = ($operand1) ? self::$localeBoolean['TRUE'] : self::$localeBoolean['FALSE'];
+ }
+ if (is_bool($operand2)) {
+ $operand2 = ($operand2) ? self::$localeBoolean['TRUE'] : self::$localeBoolean['FALSE'];
+ }
+ if ((is_array($operand1)) || (is_array($operand2))) {
+ // Ensure that both operands are arrays/matrices
+ self::checkMatrixOperands($operand1, $operand2, 2);
+
+ try {
+ // Convert operand 1 from a PHP array to a matrix
+ $matrix = new Shared\JAMA\Matrix($operand1);
+ // Perform the required operation against the operand 1 matrix, passing in operand 2
+ $matrixResult = $matrix->concat($operand2);
+ $result = $matrixResult->getArray();
+ } catch (\Exception $ex) {
+ $this->debugLog->writeDebugLog('JAMA Matrix Exception: ', $ex->getMessage());
+ $result = '#VALUE!';
+ }
+ } else {
+ $result = '"' . str_replace('""', '"', self::unwrapResult($operand1) . self::unwrapResult($operand2)) . '"';
+ }
+ $this->debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($result));
+ $stack->push('Value', $result);
+
+ break;
+ case '|': // Intersect
+ $rowIntersect = array_intersect_key($operand1, $operand2);
+ $cellIntersect = $oCol = $oRow = [];
+ foreach (array_keys($rowIntersect) as $row) {
+ $oRow[] = $row;
+ foreach ($rowIntersect[$row] as $col => $data) {
+ $oCol[] = Coordinate::columnIndexFromString($col) - 1;
+ $cellIntersect[$row] = array_intersect_key($operand1[$row], $operand2[$row]);
+ }
+ }
+ $cellRef = Coordinate::stringFromColumnIndex(min($oCol) + 1) . min($oRow) . ':' . Coordinate::stringFromColumnIndex(max($oCol) + 1) . max($oRow);
+ $this->debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($cellIntersect));
+ $stack->push('Value', $cellIntersect, $cellRef);
+
+ break;
+ }
+
+ // if the token is a unary operator, pop one value off the stack, do the operation, and push it back on
+ } elseif (($token === '~') || ($token === '%')) {
+ if (($arg = $stack->pop()) === null) {
+ return $this->raiseFormulaError('Internal error - Operand value missing from stack');
+ }
+ $arg = $arg['value'];
+ if ($token === '~') {
+ $this->debugLog->writeDebugLog('Evaluating Negation of ', $this->showValue($arg));
+ $multiplier = -1;
+ } else {
+ $this->debugLog->writeDebugLog('Evaluating Percentile of ', $this->showValue($arg));
+ $multiplier = 0.01;
+ }
+ if (is_array($arg)) {
+ self::checkMatrixOperands($arg, $multiplier, 2);
+
+ try {
+ $matrix1 = new Shared\JAMA\Matrix($arg);
+ $matrixResult = $matrix1->arrayTimesEquals($multiplier);
+ $result = $matrixResult->getArray();
+ } catch (\Exception $ex) {
+ $this->debugLog->writeDebugLog('JAMA Matrix Exception: ', $ex->getMessage());
+ $result = '#VALUE!';
+ }
+ $this->debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($result));
+ $stack->push('Value', $result);
+ } else {
+ $this->executeNumericBinaryOperation($multiplier, $arg, '*', 'arrayTimesEquals', $stack);
+ }
+ } elseif (preg_match('/^' . self::CALCULATION_REGEXP_CELLREF . '$/i', $token, $matches)) {
+ $cellRef = null;
+ if (isset($matches[8])) {
+ if ($pCell === null) {
+ // We can't access the range, so return a REF error
+ $cellValue = Functions::REF();
+ } else {
+ $cellRef = $matches[6] . $matches[7] . ':' . $matches[9] . $matches[10];
+ if ($matches[2] > '') {
+ $matches[2] = trim($matches[2], "\"'");
+ if ((strpos($matches[2], '[') !== false) || (strpos($matches[2], ']') !== false)) {
+ // It's a Reference to an external spreadsheet (not currently supported)
+ return $this->raiseFormulaError('Unable to access External Workbook');
+ }
+ $matches[2] = trim($matches[2], "\"'");
+ $this->debugLog->writeDebugLog('Evaluating Cell Range ', $cellRef, ' in worksheet ', $matches[2]);
+ if ($pCellParent !== null) {
+ $cellValue = $this->extractCellRange($cellRef, $this->spreadsheet->getSheetByName($matches[2]), false);
+ } else {
+ return $this->raiseFormulaError('Unable to access Cell Reference');
+ }
+ $this->debugLog->writeDebugLog('Evaluation Result for cells ', $cellRef, ' in worksheet ', $matches[2], ' is ', $this->showTypeDetails($cellValue));
+ } else {
+ $this->debugLog->writeDebugLog('Evaluating Cell Range ', $cellRef, ' in current worksheet');
+ if ($pCellParent !== null) {
+ $cellValue = $this->extractCellRange($cellRef, $pCellWorksheet, false);
+ } else {
+ return $this->raiseFormulaError('Unable to access Cell Reference');
+ }
+ $this->debugLog->writeDebugLog('Evaluation Result for cells ', $cellRef, ' is ', $this->showTypeDetails($cellValue));
+ }
+ }
+ } else {
+ if ($pCell === null) {
+ // We can't access the cell, so return a REF error
+ $cellValue = Functions::REF();
+ } else {
+ $cellRef = $matches[6] . $matches[7];
+ if ($matches[2] > '') {
+ $matches[2] = trim($matches[2], "\"'");
+ if ((strpos($matches[2], '[') !== false) || (strpos($matches[2], ']') !== false)) {
+ // It's a Reference to an external spreadsheet (not currently supported)
+ return $this->raiseFormulaError('Unable to access External Workbook');
+ }
+ $this->debugLog->writeDebugLog('Evaluating Cell ', $cellRef, ' in worksheet ', $matches[2]);
+ if ($pCellParent !== null) {
+ $cellSheet = $this->spreadsheet->getSheetByName($matches[2]);
+ if ($cellSheet && $cellSheet->cellExists($cellRef)) {
+ $cellValue = $this->extractCellRange($cellRef, $this->spreadsheet->getSheetByName($matches[2]), false);
+ $pCell->attach($pCellParent);
+ } else {
+ $cellValue = null;
+ }
+ } else {
+ return $this->raiseFormulaError('Unable to access Cell Reference');
+ }
+ $this->debugLog->writeDebugLog('Evaluation Result for cell ', $cellRef, ' in worksheet ', $matches[2], ' is ', $this->showTypeDetails($cellValue));
+ } else {
+ $this->debugLog->writeDebugLog('Evaluating Cell ', $cellRef, ' in current worksheet');
+ if ($pCellParent->has($cellRef)) {
+ $cellValue = $this->extractCellRange($cellRef, $pCellWorksheet, false);
+ $pCell->attach($pCellParent);
+ } else {
+ $cellValue = null;
+ }
+ $this->debugLog->writeDebugLog('Evaluation Result for cell ', $cellRef, ' is ', $this->showTypeDetails($cellValue));
+ }
+ }
+ }
+ $stack->push('Value', $cellValue, $cellRef);
+
+ // if the token is a function, pop arguments off the stack, hand them to the function, and push the result back on
+ } elseif (preg_match('/^' . self::CALCULATION_REGEXP_FUNCTION . '$/i', $token, $matches)) {
+ $functionName = $matches[1];
+ $argCount = $stack->pop();
+ $argCount = $argCount['value'];
+ if ($functionName != 'MKMATRIX') {
+ $this->debugLog->writeDebugLog('Evaluating Function ', self::localeFunc($functionName), '() with ', (($argCount == 0) ? 'no' : $argCount), ' argument', (($argCount == 1) ? '' : 's'));
+ }
+ if ((isset(self::$phpSpreadsheetFunctions[$functionName])) || (isset(self::$controlFunctions[$functionName]))) { // function
+ if (isset(self::$phpSpreadsheetFunctions[$functionName])) {
+ $functionCall = self::$phpSpreadsheetFunctions[$functionName]['functionCall'];
+ $passByReference = isset(self::$phpSpreadsheetFunctions[$functionName]['passByReference']);
+ $passCellReference = isset(self::$phpSpreadsheetFunctions[$functionName]['passCellReference']);
+ } elseif (isset(self::$controlFunctions[$functionName])) {
+ $functionCall = self::$controlFunctions[$functionName]['functionCall'];
+ $passByReference = isset(self::$controlFunctions[$functionName]['passByReference']);
+ $passCellReference = isset(self::$controlFunctions[$functionName]['passCellReference']);
+ }
+ // get the arguments for this function
+ $args = $argArrayVals = [];
+ for ($i = 0; $i < $argCount; ++$i) {
+ $arg = $stack->pop();
+ $a = $argCount - $i - 1;
+ if (($passByReference) &&
+ (isset(self::$phpSpreadsheetFunctions[$functionName]['passByReference'][$a])) &&
+ (self::$phpSpreadsheetFunctions[$functionName]['passByReference'][$a])) {
+ if ($arg['reference'] === null) {
+ $args[] = $cellID;
+ if ($functionName != 'MKMATRIX') {
+ $argArrayVals[] = $this->showValue($cellID);
+ }
+ } else {
+ $args[] = $arg['reference'];
+ if ($functionName != 'MKMATRIX') {
+ $argArrayVals[] = $this->showValue($arg['reference']);
+ }
+ }
+ } else {
+ $args[] = self::unwrapResult($arg['value']);
+ if ($functionName != 'MKMATRIX') {
+ $argArrayVals[] = $this->showValue($arg['value']);
+ }
+ }
+ }
+ // Reverse the order of the arguments
+ krsort($args);
+
+ if (($passByReference) && ($argCount == 0)) {
+ $args[] = $cellID;
+ $argArrayVals[] = $this->showValue($cellID);
+ }
+
+ if ($functionName != 'MKMATRIX') {
+ if ($this->debugLog->getWriteDebugLog()) {
+ krsort($argArrayVals);
+ $this->debugLog->writeDebugLog('Evaluating ', self::localeFunc($functionName), '( ', implode(self::$localeArgumentSeparator . ' ', Functions::flattenArray($argArrayVals)), ' )');
+ }
+ }
+
+ // Process the argument with the appropriate function call
+ $args = $this->addCellReference($args, $passCellReference, $functionCall, $pCell);
+
+ if (!is_array($functionCall)) {
+ foreach ($args as &$arg) {
+ $arg = Functions::flattenSingleValue($arg);
+ }
+ unset($arg);
+ }
+ $result = call_user_func_array($functionCall, $args);
+
+ if ($functionName != 'MKMATRIX') {
+ $this->debugLog->writeDebugLog('Evaluation Result for ', self::localeFunc($functionName), '() function call is ', $this->showTypeDetails($result));
+ }
+ $stack->push('Value', self::wrapResult($result));
+ }
+ } else {
+ // if the token is a number, boolean, string or an Excel error, push it onto the stack
+ if (isset(self::$excelConstants[strtoupper($token)])) {
+ $excelConstant = strtoupper($token);
+ $stack->push('Constant Value', self::$excelConstants[$excelConstant]);
+ $this->debugLog->writeDebugLog('Evaluating Constant ', $excelConstant, ' as ', $this->showTypeDetails(self::$excelConstants[$excelConstant]));
+ } elseif ((is_numeric($token)) || ($token === null) || (is_bool($token)) || ($token == '') || ($token[0] == '"') || ($token[0] == '#')) {
+ $stack->push('Value', $token);
+ // if the token is a named range, push the named range name onto the stack
+ } elseif (preg_match('/^' . self::CALCULATION_REGEXP_NAMEDRANGE . '$/i', $token, $matches)) {
+ $namedRange = $matches[6];
+ $this->debugLog->writeDebugLog('Evaluating Named Range ', $namedRange);
+
+ $cellValue = $this->extractNamedRange($namedRange, ((null !== $pCell) ? $pCellWorksheet : null), false);
+ $pCell->attach($pCellParent);
+ $this->debugLog->writeDebugLog('Evaluation Result for named range ', $namedRange, ' is ', $this->showTypeDetails($cellValue));
+ $stack->push('Named Range', $cellValue, $namedRange);
+ } else {
+ return $this->raiseFormulaError("undefined variable '$token'");
+ }
+ }
+ }
+ // when we're out of tokens, the stack should have a single element, the final result
+ if ($stack->count() != 1) {
+ return $this->raiseFormulaError('internal error');
+ }
+ $output = $stack->pop();
+ $output = $output['value'];
+
+ return $output;
+ }
+
+ private function validateBinaryOperand(&$operand, &$stack)
+ {
+ if (is_array($operand)) {
+ if ((count($operand, COUNT_RECURSIVE) - count($operand)) == 1) {
+ do {
+ $operand = array_pop($operand);
+ } while (is_array($operand));
+ }
+ }
+ // Numbers, matrices and booleans can pass straight through, as they're already valid
+ if (is_string($operand)) {
+ // We only need special validations for the operand if it is a string
+ // Start by stripping off the quotation marks we use to identify true excel string values internally
+ if ($operand > '' && $operand[0] == '"') {
+ $operand = self::unwrapResult($operand);
+ }
+ // If the string is a numeric value, we treat it as a numeric, so no further testing
+ if (!is_numeric($operand)) {
+ // If not a numeric, test to see if the value is an Excel error, and so can't be used in normal binary operations
+ if ($operand > '' && $operand[0] == '#') {
+ $stack->push('Value', $operand);
+ $this->debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($operand));
+
+ return false;
+ } elseif (!Shared\StringHelper::convertToNumberIfFraction($operand)) {
+ // If not a numeric or a fraction, then it's a text string, and so can't be used in mathematical binary operations
+ $stack->push('Value', '#VALUE!');
+ $this->debugLog->writeDebugLog('Evaluation Result is a ', $this->showTypeDetails('#VALUE!'));
+
+ return false;
+ }
+ }
+ }
+
+ // return a true if the value of the operand is one that we can use in normal binary operations
+ return true;
+ }
+
+ /**
+ * @param null|string $cellID
+ * @param mixed $operand1
+ * @param mixed $operand2
+ * @param string $operation
+ * @param Stack $stack
+ * @param bool $recursingArrays
+ *
+ * @return bool
+ */
+ private function executeBinaryComparisonOperation($cellID, $operand1, $operand2, $operation, Stack &$stack, $recursingArrays = false)
+ {
+ // If we're dealing with matrix operations, we want a matrix result
+ if ((is_array($operand1)) || (is_array($operand2))) {
+ $result = [];
+ if ((is_array($operand1)) && (!is_array($operand2))) {
+ foreach ($operand1 as $x => $operandData) {
+ $this->debugLog->writeDebugLog('Evaluating Comparison ', $this->showValue($operandData), ' ', $operation, ' ', $this->showValue($operand2));
+ $this->executeBinaryComparisonOperation($cellID, $operandData, $operand2, $operation, $stack);
+ $r = $stack->pop();
+ $result[$x] = $r['value'];
+ }
+ } elseif ((!is_array($operand1)) && (is_array($operand2))) {
+ foreach ($operand2 as $x => $operandData) {
+ $this->debugLog->writeDebugLog('Evaluating Comparison ', $this->showValue($operand1), ' ', $operation, ' ', $this->showValue($operandData));
+ $this->executeBinaryComparisonOperation($cellID, $operand1, $operandData, $operation, $stack);
+ $r = $stack->pop();
+ $result[$x] = $r['value'];
+ }
+ } else {
+ if (!$recursingArrays) {
+ self::checkMatrixOperands($operand1, $operand2, 2);
+ }
+ foreach ($operand1 as $x => $operandData) {
+ $this->debugLog->writeDebugLog('Evaluating Comparison ', $this->showValue($operandData), ' ', $operation, ' ', $this->showValue($operand2[$x]));
+ $this->executeBinaryComparisonOperation($cellID, $operandData, $operand2[$x], $operation, $stack, true);
+ $r = $stack->pop();
+ $result[$x] = $r['value'];
+ }
+ }
+ // Log the result details
+ $this->debugLog->writeDebugLog('Comparison Evaluation Result is ', $this->showTypeDetails($result));
+ // And push the result onto the stack
+ $stack->push('Array', $result);
+
+ return true;
+ }
+
+ // Simple validate the two operands if they are string values
+ if (is_string($operand1) && $operand1 > '' && $operand1[0] == '"') {
+ $operand1 = self::unwrapResult($operand1);
+ }
+ if (is_string($operand2) && $operand2 > '' && $operand2[0] == '"') {
+ $operand2 = self::unwrapResult($operand2);
+ }
+
+ // Use case insensitive comparaison if not OpenOffice mode
+ if (Functions::getCompatibilityMode() != Functions::COMPATIBILITY_OPENOFFICE) {
+ if (is_string($operand1)) {
+ $operand1 = strtoupper($operand1);
+ }
+ if (is_string($operand2)) {
+ $operand2 = strtoupper($operand2);
+ }
+ }
+
+ $useLowercaseFirstComparison = is_string($operand1) && is_string($operand2) && Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE;
+
+ // execute the necessary operation
+ switch ($operation) {
+ // Greater than
+ case '>':
+ if ($useLowercaseFirstComparison) {
+ $result = $this->strcmpLowercaseFirst($operand1, $operand2) > 0;
+ } else {
+ $result = ($operand1 > $operand2);
+ }
+
+ break;
+ // Less than
+ case '<':
+ if ($useLowercaseFirstComparison) {
+ $result = $this->strcmpLowercaseFirst($operand1, $operand2) < 0;
+ } else {
+ $result = ($operand1 < $operand2);
+ }
+
+ break;
+ // Equality
+ case '=':
+ if (is_numeric($operand1) && is_numeric($operand2)) {
+ $result = (abs($operand1 - $operand2) < $this->delta);
+ } else {
+ $result = strcmp($operand1, $operand2) == 0;
+ }
+
+ break;
+ // Greater than or equal
+ case '>=':
+ if (is_numeric($operand1) && is_numeric($operand2)) {
+ $result = ((abs($operand1 - $operand2) < $this->delta) || ($operand1 > $operand2));
+ } elseif ($useLowercaseFirstComparison) {
+ $result = $this->strcmpLowercaseFirst($operand1, $operand2) >= 0;
+ } else {
+ $result = strcmp($operand1, $operand2) >= 0;
+ }
+
+ break;
+ // Less than or equal
+ case '<=':
+ if (is_numeric($operand1) && is_numeric($operand2)) {
+ $result = ((abs($operand1 - $operand2) < $this->delta) || ($operand1 < $operand2));
+ } elseif ($useLowercaseFirstComparison) {
+ $result = $this->strcmpLowercaseFirst($operand1, $operand2) <= 0;
+ } else {
+ $result = strcmp($operand1, $operand2) <= 0;
+ }
+
+ break;
+ // Inequality
+ case '<>':
+ if (is_numeric($operand1) && is_numeric($operand2)) {
+ $result = (abs($operand1 - $operand2) > 1E-14);
+ } else {
+ $result = strcmp($operand1, $operand2) != 0;
+ }
+
+ break;
+ }
+
+ // Log the result details
+ $this->debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($result));
+ // And push the result onto the stack
+ $stack->push('Value', $result);
+
+ return true;
+ }
+
+ /**
+ * Compare two strings in the same way as strcmp() except that lowercase come before uppercase letters.
+ *
+ * @param string $str1 First string value for the comparison
+ * @param string $str2 Second string value for the comparison
+ *
+ * @return int
+ */
+ private function strcmpLowercaseFirst($str1, $str2)
+ {
+ $inversedStr1 = Shared\StringHelper::strCaseReverse($str1);
+ $inversedStr2 = Shared\StringHelper::strCaseReverse($str2);
+
+ return strcmp($inversedStr1, $inversedStr2);
+ }
+
+ /**
+ * @param mixed $operand1
+ * @param mixed $operand2
+ * @param mixed $operation
+ * @param string $matrixFunction
+ * @param mixed $stack
+ *
+ * @return bool
+ */
+ private function executeNumericBinaryOperation($operand1, $operand2, $operation, $matrixFunction, &$stack)
+ {
+ // Validate the two operands
+ if (!$this->validateBinaryOperand($operand1, $stack)) {
+ return false;
+ }
+ if (!$this->validateBinaryOperand($operand2, $stack)) {
+ return false;
+ }
+
+ // If either of the operands is a matrix, we need to treat them both as matrices
+ // (converting the other operand to a matrix if need be); then perform the required
+ // matrix operation
+ if ((is_array($operand1)) || (is_array($operand2))) {
+ // Ensure that both operands are arrays/matrices of the same size
+ self::checkMatrixOperands($operand1, $operand2, 2);
+
+ try {
+ // Convert operand 1 from a PHP array to a matrix
+ $matrix = new Shared\JAMA\Matrix($operand1);
+ // Perform the required operation against the operand 1 matrix, passing in operand 2
+ $matrixResult = $matrix->$matrixFunction($operand2);
+ $result = $matrixResult->getArray();
+ } catch (\Exception $ex) {
+ $this->debugLog->writeDebugLog('JAMA Matrix Exception: ', $ex->getMessage());
+ $result = '#VALUE!';
+ }
+ } else {
+ if ((Functions::getCompatibilityMode() != Functions::COMPATIBILITY_OPENOFFICE) &&
+ ((is_string($operand1) && !is_numeric($operand1) && strlen($operand1) > 0) ||
+ (is_string($operand2) && !is_numeric($operand2) && strlen($operand2) > 0))) {
+ $result = Functions::VALUE();
+ } else {
+ // If we're dealing with non-matrix operations, execute the necessary operation
+ switch ($operation) {
+ // Addition
+ case '+':
+ $result = $operand1 + $operand2;
+
+ break;
+ // Subtraction
+ case '-':
+ $result = $operand1 - $operand2;
+
+ break;
+ // Multiplication
+ case '*':
+ $result = $operand1 * $operand2;
+
+ break;
+ // Division
+ case '/':
+ if ($operand2 == 0) {
+ // Trap for Divide by Zero error
+ $stack->push('Value', '#DIV/0!');
+ $this->debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails('#DIV/0!'));
+
+ return false;
+ }
+ $result = $operand1 / $operand2;
+
+ break;
+ // Power
+ case '^':
+ $result = pow($operand1, $operand2);
+
+ break;
+ }
+ }
+ }
+
+ // Log the result details
+ $this->debugLog->writeDebugLog('Evaluation Result is ', $this->showTypeDetails($result));
+ // And push the result onto the stack
+ $stack->push('Value', $result);
+
+ return true;
+ }
+
+ // trigger an error, but nicely, if need be
+ protected function raiseFormulaError($errorMessage)
+ {
+ $this->formulaError = $errorMessage;
+ $this->cyclicReferenceStack->clear();
+ if (!$this->suppressFormulaErrors) {
+ throw new Exception($errorMessage);
+ }
+ trigger_error($errorMessage, E_USER_ERROR);
+
+ return false;
+ }
+
+ /**
+ * Extract range values.
+ *
+ * @param string &$pRange String based range representation
+ * @param Worksheet $pSheet Worksheet
+ * @param bool $resetLog Flag indicating whether calculation log should be reset or not
+ *
+ * @return mixed Array of values in range if range contains more than one element. Otherwise, a single value is returned.
+ */
+ public function extractCellRange(&$pRange = 'A1', Worksheet $pSheet = null, $resetLog = true)
+ {
+ // Return value
+ $returnValue = [];
+
+ if ($pSheet !== null) {
+ $pSheetName = $pSheet->getTitle();
+ if (strpos($pRange, '!') !== false) {
+ list($pSheetName, $pRange) = Worksheet::extractSheetTitle($pRange, true);
+ $pSheet = $this->spreadsheet->getSheetByName($pSheetName);
+ }
+
+ // Extract range
+ $aReferences = Coordinate::extractAllCellReferencesInRange($pRange);
+ $pRange = $pSheetName . '!' . $pRange;
+ if (!isset($aReferences[1])) {
+ $currentCol = '';
+ $currentRow = 0;
+ // Single cell in range
+ sscanf($aReferences[0], '%[A-Z]%d', $currentCol, $currentRow);
+ if ($pSheet->cellExists($aReferences[0])) {
+ $returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
+ } else {
+ $returnValue[$currentRow][$currentCol] = null;
+ }
+ } else {
+ // Extract cell data for all cells in the range
+ foreach ($aReferences as $reference) {
+ $currentCol = '';
+ $currentRow = 0;
+ // Extract range
+ sscanf($reference, '%[A-Z]%d', $currentCol, $currentRow);
+ if ($pSheet->cellExists($reference)) {
+ $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog);
+ } else {
+ $returnValue[$currentRow][$currentCol] = null;
+ }
+ }
+ }
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * Extract range values.
+ *
+ * @param string &$pRange String based range representation
+ * @param Worksheet $pSheet Worksheet
+ * @param bool $resetLog Flag indicating whether calculation log should be reset or not
+ *
+ * @return mixed Array of values in range if range contains more than one element. Otherwise, a single value is returned.
+ */
+ public function extractNamedRange(&$pRange = 'A1', Worksheet $pSheet = null, $resetLog = true)
+ {
+ // Return value
+ $returnValue = [];
+
+ if ($pSheet !== null) {
+ $pSheetName = $pSheet->getTitle();
+ if (strpos($pRange, '!') !== false) {
+ list($pSheetName, $pRange) = Worksheet::extractSheetTitle($pRange, true);
+ $pSheet = $this->spreadsheet->getSheetByName($pSheetName);
+ }
+
+ // Named range?
+ $namedRange = NamedRange::resolveRange($pRange, $pSheet);
+ if ($namedRange !== null) {
+ $pSheet = $namedRange->getWorksheet();
+ $pRange = $namedRange->getRange();
+ $splitRange = Coordinate::splitRange($pRange);
+ // Convert row and column references
+ if (ctype_alpha($splitRange[0][0])) {
+ $pRange = $splitRange[0][0] . '1:' . $splitRange[0][1] . $namedRange->getWorksheet()->getHighestRow();
+ } elseif (ctype_digit($splitRange[0][0])) {
+ $pRange = 'A' . $splitRange[0][0] . ':' . $namedRange->getWorksheet()->getHighestColumn() . $splitRange[0][1];
+ }
+ } else {
+ return Functions::REF();
+ }
+
+ // Extract range
+ $aReferences = Coordinate::extractAllCellReferencesInRange($pRange);
+ if (!isset($aReferences[1])) {
+ // Single cell (or single column or row) in range
+ list($currentCol, $currentRow) = Coordinate::coordinateFromString($aReferences[0]);
+ if ($pSheet->cellExists($aReferences[0])) {
+ $returnValue[$currentRow][$currentCol] = $pSheet->getCell($aReferences[0])->getCalculatedValue($resetLog);
+ } else {
+ $returnValue[$currentRow][$currentCol] = null;
+ }
+ } else {
+ // Extract cell data for all cells in the range
+ foreach ($aReferences as $reference) {
+ // Extract range
+ list($currentCol, $currentRow) = Coordinate::coordinateFromString($reference);
+ if ($pSheet->cellExists($reference)) {
+ $returnValue[$currentRow][$currentCol] = $pSheet->getCell($reference)->getCalculatedValue($resetLog);
+ } else {
+ $returnValue[$currentRow][$currentCol] = null;
+ }
+ }
+ }
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * Is a specific function implemented?
+ *
+ * @param string $pFunction Function Name
+ *
+ * @return bool
+ */
+ public function isImplemented($pFunction)
+ {
+ $pFunction = strtoupper($pFunction);
+ $notImplemented = !isset(self::$phpSpreadsheetFunctions[$pFunction]) || (is_array(self::$phpSpreadsheetFunctions[$pFunction]['functionCall']) && self::$phpSpreadsheetFunctions[$pFunction]['functionCall'][1] === 'DUMMY');
+
+ return !$notImplemented;
+ }
+
+ /**
+ * Get a list of all implemented functions as an array of function objects.
+ *
+ * @return array of Category
+ */
+ public function getFunctions()
+ {
+ return self::$phpSpreadsheetFunctions;
+ }
+
+ /**
+ * Get a list of implemented Excel function names.
+ *
+ * @return array
+ */
+ public function getImplementedFunctionNames()
+ {
+ $returnValue = [];
+ foreach (self::$phpSpreadsheetFunctions as $functionName => $function) {
+ if ($this->isImplemented($functionName)) {
+ $returnValue[] = $functionName;
+ }
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * Add cell reference if needed while making sure that it is the last argument.
+ *
+ * @param array $args
+ * @param bool $passCellReference
+ * @param array|string $functionCall
+ * @param null|Cell $pCell
+ *
+ * @return array
+ */
+ private function addCellReference(array $args, $passCellReference, $functionCall, Cell $pCell = null)
+ {
+ if ($passCellReference) {
+ if (is_array($functionCall)) {
+ $className = $functionCall[0];
+ $methodName = $functionCall[1];
+
+ $reflectionMethod = new \ReflectionMethod($className, $methodName);
+ $argumentCount = count($reflectionMethod->getParameters());
+ while (count($args) < $argumentCount - 1) {
+ $args[] = null;
+ }
+ }
+
+ $args[] = $pCell;
+ }
+
+ return $args;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Category.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Category.php
new file mode 100644
index 00000000000..7574cb4766a
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Category.php
@@ -0,0 +1,19 @@
+ $criteriaName) {
- $testCondition = array();
+ $testCondition = [];
$testConditionCount = 0;
foreach ($criteria as $row => $criterion) {
if ($criterion[$key] > '') {
- $testCondition[] = '[:'.$criteriaName.']'.PHPExcel_Calculation_Functions::ifCondition($criterion[$key]);
- $testConditionCount++;
+ $testCondition[] = '[:' . $criteriaName . ']' . Functions::ifCondition($criterion[$key]);
+ ++$testConditionCount;
}
}
if ($testConditionCount > 1) {
$testConditions[] = 'OR(' . implode(',', $testCondition) . ')';
- $testConditionsCount++;
+ ++$testConditionsCount;
} elseif ($testConditionCount == 1) {
$testConditions[] = $testCondition[0];
- $testConditionsCount++;
+ ++$testConditionsCount;
}
}
@@ -126,12 +94,12 @@ class PHPExcel_Calculation_Database
$k = array_search($criteriaName, $fieldNames);
if (isset($dataValues[$k])) {
$dataValue = $dataValues[$k];
- $dataValue = (is_string($dataValue)) ? PHPExcel_Calculation::wrapResult(strtoupper($dataValue)) : $dataValue;
+ $dataValue = (is_string($dataValue)) ? Calculation::wrapResult(strtoupper($dataValue)) : $dataValue;
$testConditionList = str_replace('[:' . $criteriaName . ']', $dataValue, $testConditionList);
}
}
// evaluate the criteria against the row data
- $result = PHPExcel_Calculation::getInstance()->_calculateFormulaValue('='.$testConditionList);
+ $result = Calculation::getInstance()->_calculateFormulaValue('=' . $testConditionList);
// If the row failed to meet the criteria, remove it from the database
if (!$result) {
unset($database[$dataRow]);
@@ -141,63 +109,61 @@ class PHPExcel_Calculation_Database
return $database;
}
-
private static function getFilteredColumn($database, $field, $criteria)
{
// reduce the database to a set of rows that match all the criteria
$database = self::filter($database, $criteria);
// extract an array of values for the requested column
- $colData = array();
+ $colData = [];
foreach ($database as $row) {
$colData[] = $row[$field];
}
-
+
return $colData;
}
/**
- * DAVERAGE
+ * DAVERAGE.
*
* Averages the values in a column of a list or database that match conditions you specify.
*
* Excel Function:
* DAVERAGE(database,field,criteria)
*
- * @access public
* @category Database Functions
- * @param mixed[] $database The range of cells that makes up the list or database.
+ *
+ * @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param string|integer $field Indicates which column is used in the function. Enter the
+ * @param int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
- * @return float
*
+ * @return float
*/
public static function DAVERAGE($database, $field, $criteria)
{
$field = self::fieldExtract($database, $field);
- if (is_null($field)) {
+ if ($field === null) {
return null;
}
// Return
- return PHPExcel_Calculation_Statistical::AVERAGE(
+ return Statistical::AVERAGE(
self::getFilteredColumn($database, $field, $criteria)
);
}
-
/**
- * DCOUNT
+ * DCOUNT.
*
* Counts the cells that contain numbers in a column of a list or database that match conditions
* that you specify.
@@ -208,96 +174,94 @@ class PHPExcel_Calculation_Database
* Excel Function:
* DAVERAGE(database,field,criteria)
*
- * @access public
* @category Database Functions
- * @param mixed[] $database The range of cells that makes up the list or database.
+ *
+ * @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param string|integer $field Indicates which column is used in the function. Enter the
+ * @param int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
- * @return integer
+ *
+ * @return int
*
* @TODO The field argument is optional. If field is omitted, DCOUNT counts all records in the
* database that match the criteria.
- *
*/
public static function DCOUNT($database, $field, $criteria)
{
$field = self::fieldExtract($database, $field);
- if (is_null($field)) {
+ if ($field === null) {
return null;
}
// Return
- return PHPExcel_Calculation_Statistical::COUNT(
+ return Statistical::COUNT(
self::getFilteredColumn($database, $field, $criteria)
);
}
-
/**
- * DCOUNTA
+ * DCOUNTA.
*
* Counts the nonblank cells in a column of a list or database that match conditions that you specify.
*
* Excel Function:
* DCOUNTA(database,[field],criteria)
*
- * @access public
* @category Database Functions
- * @param mixed[] $database The range of cells that makes up the list or database.
+ *
+ * @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param string|integer $field Indicates which column is used in the function. Enter the
+ * @param int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
- * @return integer
+ *
+ * @return int
*
* @TODO The field argument is optional. If field is omitted, DCOUNTA counts all records in the
* database that match the criteria.
- *
*/
public static function DCOUNTA($database, $field, $criteria)
{
$field = self::fieldExtract($database, $field);
- if (is_null($field)) {
+ if ($field === null) {
return null;
}
// reduce the database to a set of rows that match all the criteria
$database = self::filter($database, $criteria);
// extract an array of values for the requested column
- $colData = array();
+ $colData = [];
foreach ($database as $row) {
$colData[] = $row[$field];
}
// Return
- return PHPExcel_Calculation_Statistical::COUNTA(
+ return Statistical::COUNTA(
self::getFilteredColumn($database, $field, $criteria)
);
}
-
/**
- * DGET
+ * DGET.
*
* Extracts a single value from a column of a list or database that matches conditions that you
* specify.
@@ -305,44 +269,43 @@ class PHPExcel_Calculation_Database
* Excel Function:
* DGET(database,field,criteria)
*
- * @access public
* @category Database Functions
- * @param mixed[] $database The range of cells that makes up the list or database.
+ *
+ * @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param string|integer $field Indicates which column is used in the function. Enter the
+ * @param int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
- * @return mixed
*
+ * @return mixed
*/
public static function DGET($database, $field, $criteria)
{
$field = self::fieldExtract($database, $field);
- if (is_null($field)) {
+ if ($field === null) {
return null;
}
// Return
$colData = self::getFilteredColumn($database, $field, $criteria);
if (count($colData) > 1) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
return $colData[0];
}
-
/**
- * DMAX
+ * DMAX.
*
* Returns the largest number in a column of a list or database that matches conditions you that
* specify.
@@ -350,41 +313,40 @@ class PHPExcel_Calculation_Database
* Excel Function:
* DMAX(database,field,criteria)
*
- * @access public
* @category Database Functions
- * @param mixed[] $database The range of cells that makes up the list or database.
+ *
+ * @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param string|integer $field Indicates which column is used in the function. Enter the
+ * @param int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
- * @return float
*
+ * @return float
*/
public static function DMAX($database, $field, $criteria)
{
$field = self::fieldExtract($database, $field);
- if (is_null($field)) {
+ if ($field === null) {
return null;
}
// Return
- return PHPExcel_Calculation_Statistical::MAX(
+ return Statistical::MAX(
self::getFilteredColumn($database, $field, $criteria)
);
}
-
/**
- * DMIN
+ * DMIN.
*
* Returns the smallest number in a column of a list or database that matches conditions you that
* specify.
@@ -392,82 +354,80 @@ class PHPExcel_Calculation_Database
* Excel Function:
* DMIN(database,field,criteria)
*
- * @access public
* @category Database Functions
- * @param mixed[] $database The range of cells that makes up the list or database.
+ *
+ * @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param string|integer $field Indicates which column is used in the function. Enter the
+ * @param int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
- * @return float
*
+ * @return float
*/
public static function DMIN($database, $field, $criteria)
{
$field = self::fieldExtract($database, $field);
- if (is_null($field)) {
+ if ($field === null) {
return null;
}
// Return
- return PHPExcel_Calculation_Statistical::MIN(
+ return Statistical::MIN(
self::getFilteredColumn($database, $field, $criteria)
);
}
-
/**
- * DPRODUCT
+ * DPRODUCT.
*
* Multiplies the values in a column of a list or database that match conditions that you specify.
*
* Excel Function:
* DPRODUCT(database,field,criteria)
*
- * @access public
* @category Database Functions
- * @param mixed[] $database The range of cells that makes up the list or database.
+ *
+ * @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param string|integer $field Indicates which column is used in the function. Enter the
+ * @param int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
- * @return float
*
+ * @return float
*/
public static function DPRODUCT($database, $field, $criteria)
{
$field = self::fieldExtract($database, $field);
- if (is_null($field)) {
+ if ($field === null) {
return null;
}
// Return
- return PHPExcel_Calculation_MathTrig::PRODUCT(
+ return MathTrig::PRODUCT(
self::getFilteredColumn($database, $field, $criteria)
);
}
-
/**
- * DSTDEV
+ * DSTDEV.
*
* Estimates the standard deviation of a population based on a sample by using the numbers in a
* column of a list or database that match conditions that you specify.
@@ -475,41 +435,40 @@ class PHPExcel_Calculation_Database
* Excel Function:
* DSTDEV(database,field,criteria)
*
- * @access public
* @category Database Functions
- * @param mixed[] $database The range of cells that makes up the list or database.
+ *
+ * @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param string|integer $field Indicates which column is used in the function. Enter the
+ * @param int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
- * @return float
*
+ * @return float
*/
public static function DSTDEV($database, $field, $criteria)
{
$field = self::fieldExtract($database, $field);
- if (is_null($field)) {
+ if ($field === null) {
return null;
}
// Return
- return PHPExcel_Calculation_Statistical::STDEV(
+ return Statistical::STDEV(
self::getFilteredColumn($database, $field, $criteria)
);
}
-
/**
- * DSTDEVP
+ * DSTDEVP.
*
* Calculates the standard deviation of a population based on the entire population by using the
* numbers in a column of a list or database that match conditions that you specify.
@@ -517,82 +476,80 @@ class PHPExcel_Calculation_Database
* Excel Function:
* DSTDEVP(database,field,criteria)
*
- * @access public
* @category Database Functions
- * @param mixed[] $database The range of cells that makes up the list or database.
+ *
+ * @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param string|integer $field Indicates which column is used in the function. Enter the
+ * @param int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
- * @return float
*
+ * @return float
*/
public static function DSTDEVP($database, $field, $criteria)
{
$field = self::fieldExtract($database, $field);
- if (is_null($field)) {
+ if ($field === null) {
return null;
}
// Return
- return PHPExcel_Calculation_Statistical::STDEVP(
+ return Statistical::STDEVP(
self::getFilteredColumn($database, $field, $criteria)
);
}
-
/**
- * DSUM
+ * DSUM.
*
* Adds the numbers in a column of a list or database that match conditions that you specify.
*
* Excel Function:
* DSUM(database,field,criteria)
*
- * @access public
* @category Database Functions
- * @param mixed[] $database The range of cells that makes up the list or database.
+ *
+ * @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param string|integer $field Indicates which column is used in the function. Enter the
+ * @param int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
- * @return float
*
+ * @return float
*/
public static function DSUM($database, $field, $criteria)
{
$field = self::fieldExtract($database, $field);
- if (is_null($field)) {
+ if ($field === null) {
return null;
}
// Return
- return PHPExcel_Calculation_MathTrig::SUM(
+ return MathTrig::SUM(
self::getFilteredColumn($database, $field, $criteria)
);
}
-
/**
- * DVAR
+ * DVAR.
*
* Estimates the variance of a population based on a sample by using the numbers in a column
* of a list or database that match conditions that you specify.
@@ -600,41 +557,40 @@ class PHPExcel_Calculation_Database
* Excel Function:
* DVAR(database,field,criteria)
*
- * @access public
* @category Database Functions
- * @param mixed[] $database The range of cells that makes up the list or database.
+ *
+ * @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param string|integer $field Indicates which column is used in the function. Enter the
+ * @param int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
- * @return float
*
+ * @return float
*/
public static function DVAR($database, $field, $criteria)
{
$field = self::fieldExtract($database, $field);
- if (is_null($field)) {
+ if ($field === null) {
return null;
}
// Return
- return PHPExcel_Calculation_Statistical::VARFunc(
+ return Statistical::VARFunc(
self::getFilteredColumn($database, $field, $criteria)
);
}
-
/**
- * DVARP
+ * DVARP.
*
* Calculates the variance of a population based on the entire population by using the numbers
* in a column of a list or database that match conditions that you specify.
@@ -642,34 +598,34 @@ class PHPExcel_Calculation_Database
* Excel Function:
* DVARP(database,field,criteria)
*
- * @access public
* @category Database Functions
- * @param mixed[] $database The range of cells that makes up the list or database.
+ *
+ * @param mixed[] $database The range of cells that makes up the list or database.
* A database is a list of related data in which rows of related
* information are records, and columns of data are fields. The
* first row of the list contains labels for each column.
- * @param string|integer $field Indicates which column is used in the function. Enter the
+ * @param int|string $field Indicates which column is used in the function. Enter the
* column label enclosed between double quotation marks, such as
* "Age" or "Yield," or a number (without quotation marks) that
* represents the position of the column within the list: 1 for
* the first column, 2 for the second column, and so on.
- * @param mixed[] $criteria The range of cells that contains the conditions you specify.
+ * @param mixed[] $criteria The range of cells that contains the conditions you specify.
* You can use any range for the criteria argument, as long as it
* includes at least one column label and at least one cell below
* the column label in which you specify a condition for the
* column.
- * @return float
*
+ * @return float
*/
public static function DVARP($database, $field, $criteria)
{
$field = self::fieldExtract($database, $field);
- if (is_null($field)) {
+ if ($field === null) {
return null;
}
// Return
- return PHPExcel_Calculation_Statistical::VARP(
+ return Statistical::VARP(
self::getFilteredColumn($database, $field, $criteria)
);
}
diff --git a/lib/phpexcel/PHPExcel/Calculation/DateTime.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTime.php
similarity index 59%
rename from lib/phpexcel/PHPExcel/Calculation/DateTime.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTime.php
index 72f4c7a23b5..3c39db2af7f 100644
--- a/lib/phpexcel/PHPExcel/Calculation/DateTime.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/DateTime.php
@@ -1,64 +1,36 @@
format('m');
$oYear = (int) $PHPDateObject->format('Y');
$adjustmentMonthsString = (string) $adjustmentMonths;
if ($adjustmentMonths > 0) {
- $adjustmentMonthsString = '+'.$adjustmentMonths;
+ $adjustmentMonthsString = '+' . $adjustmentMonths;
}
if ($adjustmentMonths != 0) {
- $PHPDateObject->modify($adjustmentMonthsString.' months');
+ $PHPDateObject->modify($adjustmentMonthsString . ' months');
}
$nMonth = (int) $PHPDateObject->format('m');
$nYear = (int) $PHPDateObject->format('Y');
@@ -147,15 +120,15 @@ class PHPExcel_Calculation_DateTime
$monthDiff = ($nMonth - $oMonth) + (($nYear - $oYear) * 12);
if ($monthDiff != $adjustmentMonths) {
$adjustDays = (int) $PHPDateObject->format('d');
- $adjustDaysString = '-'.$adjustDays.' days';
+ $adjustDaysString = '-' . $adjustDays . ' days';
$PHPDateObject->modify($adjustDaysString);
}
+
return $PHPDateObject;
}
-
/**
- * DATETIMENOW
+ * DATETIMENOW.
*
* Returns the current date and time.
* The NOW function is useful when you need to display the current date and time on a worksheet or
@@ -163,14 +136,14 @@ class PHPExcel_Calculation_DateTime
* open the worksheet.
*
* NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
- * and time format of your regional settings. PHPExcel does not change cell formatting in this way.
+ * and time format of your regional settings. PhpSpreadsheet does not change cell formatting in this way.
*
* Excel Function:
* NOW()
*
- * @access public
* @category Date/Time Functions
- * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ *
+ * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
public static function DATETIMENOW()
@@ -178,15 +151,18 @@ class PHPExcel_Calculation_DateTime
$saveTimeZone = date_default_timezone_get();
date_default_timezone_set('UTC');
$retValue = false;
- switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
- case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL:
- $retValue = (float) PHPExcel_Shared_Date::PHPToExcel(time());
+ switch (Functions::getReturnDateType()) {
+ case Functions::RETURNDATE_EXCEL:
+ $retValue = (float) Date::PHPToExcel(time());
+
break;
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC:
- $retValue = (integer) time();
+ case Functions::RETURNDATE_PHP_NUMERIC:
+ $retValue = (int) time();
+
break;
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT:
- $retValue = new DateTime();
+ case Functions::RETURNDATE_PHP_OBJECT:
+ $retValue = new \DateTime();
+
break;
}
date_default_timezone_set($saveTimeZone);
@@ -194,9 +170,8 @@ class PHPExcel_Calculation_DateTime
return $retValue;
}
-
/**
- * DATENOW
+ * DATENOW.
*
* Returns the current date.
* The NOW function is useful when you need to display the current date and time on a worksheet or
@@ -204,14 +179,14 @@ class PHPExcel_Calculation_DateTime
* open the worksheet.
*
* NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
- * and time format of your regional settings. PHPExcel does not change cell formatting in this way.
+ * and time format of your regional settings. PhpSpreadsheet does not change cell formatting in this way.
*
* Excel Function:
* TODAY()
*
- * @access public
* @category Date/Time Functions
- * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ *
+ * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
public static function DATENOW()
@@ -219,16 +194,19 @@ class PHPExcel_Calculation_DateTime
$saveTimeZone = date_default_timezone_get();
date_default_timezone_set('UTC');
$retValue = false;
- $excelDateTime = floor(PHPExcel_Shared_Date::PHPToExcel(time()));
- switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
- case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL:
+ $excelDateTime = floor(Date::PHPToExcel(time()));
+ switch (Functions::getReturnDateType()) {
+ case Functions::RETURNDATE_EXCEL:
$retValue = (float) $excelDateTime;
+
break;
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC:
- $retValue = (integer) PHPExcel_Shared_Date::ExcelToPHP($excelDateTime);
+ case Functions::RETURNDATE_PHP_NUMERIC:
+ $retValue = (int) Date::excelToTimestamp($excelDateTime);
+
break;
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT:
- $retValue = PHPExcel_Shared_Date::ExcelToPHPObject($excelDateTime);
+ case Functions::RETURNDATE_PHP_OBJECT:
+ $retValue = Date::excelToDateTimeObject($excelDateTime);
+
break;
}
date_default_timezone_set($saveTimeZone);
@@ -236,25 +214,24 @@ class PHPExcel_Calculation_DateTime
return $retValue;
}
-
/**
- * DATE
+ * DATE.
*
* The DATE function returns a value that represents a particular date.
*
* NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
- * format of your regional settings. PHPExcel does not change cell formatting in this way.
+ * format of your regional settings. PhpSpreadsheet does not change cell formatting in this way.
*
* Excel Function:
* DATE(year,month,day)
*
- * PHPExcel is a lot more forgiving than MS Excel when passing non numeric values to this function.
+ * PhpSpreadsheet is a lot more forgiving than MS Excel when passing non numeric values to this function.
* A Month name or abbreviation (English only at this point) such as 'January' or 'Jan' will still be accepted,
* as will a day value with a suffix (e.g. '21st' rather than simply 21); again only English language.
*
- * @access public
* @category Date/Time Functions
- * @param integer $year The value of the year argument can include one to four digits.
+ *
+ * @param int $year The value of the year argument can include one to four digits.
* Excel interprets the year argument according to the configured
* date system: 1900 or 1904.
* If year is between 0 (zero) and 1899 (inclusive), Excel adds that
@@ -265,7 +242,7 @@ class PHPExcel_Calculation_DateTime
* 2008.
* If year is less than 0 or is 10000 or greater, Excel returns the
* #NUM! error value.
- * @param integer $month A positive or negative integer representing the month of the year
+ * @param int $month A positive or negative integer representing the month of the year
* from 1 to 12 (January to December).
* If month is greater than 12, month adds that number of months to
* the first month in the year specified. For example, DATE(2008,14,2)
@@ -274,7 +251,7 @@ class PHPExcel_Calculation_DateTime
* number of months, plus 1, from the first month in the year
* specified. For example, DATE(2008,-3,2) returns the serial number
* representing September 2, 2007.
- * @param integer $day A positive or negative integer representing the day of the month
+ * @param int $day A positive or negative integer representing the day of the month
* from 1 to 31.
* If day is greater than the number of days in the month specified,
* day adds that number of days to the first day in the month. For
@@ -284,45 +261,46 @@ class PHPExcel_Calculation_DateTime
* days, plus one, from the first day of the month specified. For
* example, DATE(2008,1,-15) returns the serial number representing
* December 16, 2007.
- * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ *
+ * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
public static function DATE($year = 0, $month = 1, $day = 1)
{
- $year = PHPExcel_Calculation_Functions::flattenSingleValue($year);
- $month = PHPExcel_Calculation_Functions::flattenSingleValue($month);
- $day = PHPExcel_Calculation_Functions::flattenSingleValue($day);
+ $year = Functions::flattenSingleValue($year);
+ $month = Functions::flattenSingleValue($month);
+ $day = Functions::flattenSingleValue($day);
if (($month !== null) && (!is_numeric($month))) {
- $month = PHPExcel_Shared_Date::monthStringToNumber($month);
+ $month = Date::monthStringToNumber($month);
}
if (($day !== null) && (!is_numeric($day))) {
- $day = PHPExcel_Shared_Date::dayStringToNumber($day);
+ $day = Date::dayStringToNumber($day);
}
- $year = ($year !== null) ? PHPExcel_Shared_String::testStringAsNumeric($year) : 0;
- $month = ($month !== null) ? PHPExcel_Shared_String::testStringAsNumeric($month) : 0;
- $day = ($day !== null) ? PHPExcel_Shared_String::testStringAsNumeric($day) : 0;
+ $year = ($year !== null) ? StringHelper::testStringAsNumeric($year) : 0;
+ $month = ($month !== null) ? StringHelper::testStringAsNumeric($month) : 0;
+ $day = ($day !== null) ? StringHelper::testStringAsNumeric($day) : 0;
if ((!is_numeric($year)) ||
(!is_numeric($month)) ||
(!is_numeric($day))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
- $year = (integer) $year;
- $month = (integer) $month;
- $day = (integer) $day;
+ $year = (int) $year;
+ $month = (int) $month;
+ $day = (int) $day;
- $baseYear = PHPExcel_Shared_Date::getExcelCalendar();
+ $baseYear = Date::getExcelCalendar();
// Validate parameters
- if ($year < ($baseYear-1900)) {
- return PHPExcel_Calculation_Functions::NaN();
+ if ($year < ($baseYear - 1900)) {
+ return Functions::NAN();
}
- if ((($baseYear-1900) != 0) && ($year < $baseYear) && ($year >= 1900)) {
- return PHPExcel_Calculation_Functions::NaN();
+ if ((($baseYear - 1900) != 0) && ($year < $baseYear) && ($year >= 1900)) {
+ return Functions::NAN();
}
- if (($year < $baseYear) && ($year >= ($baseYear-1900))) {
+ if (($year < $baseYear) && ($year >= ($baseYear - 1900))) {
$year += 1900;
}
@@ -339,54 +317,54 @@ class PHPExcel_Calculation_DateTime
// Re-validate the year parameter after adjustments
if (($year < $baseYear) || ($year >= 10000)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
// Execute function
- $excelDateValue = PHPExcel_Shared_Date::FormattedPHPToExcel($year, $month, $day);
- switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
- case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL:
+ $excelDateValue = Date::formattedPHPToExcel($year, $month, $day);
+ switch (Functions::getReturnDateType()) {
+ case Functions::RETURNDATE_EXCEL:
return (float) $excelDateValue;
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC:
- return (integer) PHPExcel_Shared_Date::ExcelToPHP($excelDateValue);
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT:
- return PHPExcel_Shared_Date::ExcelToPHPObject($excelDateValue);
+ case Functions::RETURNDATE_PHP_NUMERIC:
+ return (int) Date::excelToTimestamp($excelDateValue);
+ case Functions::RETURNDATE_PHP_OBJECT:
+ return Date::excelToDateTimeObject($excelDateValue);
}
}
-
/**
- * TIME
+ * TIME.
*
* The TIME function returns a value that represents a particular time.
*
* NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the time
- * format of your regional settings. PHPExcel does not change cell formatting in this way.
+ * format of your regional settings. PhpSpreadsheet does not change cell formatting in this way.
*
* Excel Function:
* TIME(hour,minute,second)
*
- * @access public
* @category Date/Time Functions
- * @param integer $hour A number from 0 (zero) to 32767 representing the hour.
+ *
+ * @param int $hour A number from 0 (zero) to 32767 representing the hour.
* Any value greater than 23 will be divided by 24 and the remainder
* will be treated as the hour value. For example, TIME(27,0,0) =
* TIME(3,0,0) = .125 or 3:00 AM.
- * @param integer $minute A number from 0 to 32767 representing the minute.
+ * @param int $minute A number from 0 to 32767 representing the minute.
* Any value greater than 59 will be converted to hours and minutes.
* For example, TIME(0,750,0) = TIME(12,30,0) = .520833 or 12:30 PM.
- * @param integer $second A number from 0 to 32767 representing the second.
+ * @param int $second A number from 0 to 32767 representing the second.
* Any value greater than 59 will be converted to hours, minutes,
* and seconds. For example, TIME(0,0,2000) = TIME(0,33,22) = .023148
* or 12:33:20 AM
- * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ *
+ * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
public static function TIME($hour = 0, $minute = 0, $second = 0)
{
- $hour = PHPExcel_Calculation_Functions::flattenSingleValue($hour);
- $minute = PHPExcel_Calculation_Functions::flattenSingleValue($minute);
- $second = PHPExcel_Calculation_Functions::flattenSingleValue($second);
+ $hour = Functions::flattenSingleValue($hour);
+ $minute = Functions::flattenSingleValue($minute);
+ $second = Functions::flattenSingleValue($second);
if ($hour == '') {
$hour = 0;
@@ -399,11 +377,11 @@ class PHPExcel_Calculation_DateTime
}
if ((!is_numeric($hour)) || (!is_numeric($minute)) || (!is_numeric($second))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
- $hour = (integer) $hour;
- $minute = (integer) $minute;
- $second = (integer) $second;
+ $hour = (int) $hour;
+ $minute = (int) $minute;
+ $second = (int) $second;
if ($second < 0) {
$minute += floor($second / 60);
@@ -429,21 +407,22 @@ class PHPExcel_Calculation_DateTime
if ($hour > 23) {
$hour = $hour % 24;
} elseif ($hour < 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
// Execute function
- switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
- case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL:
+ switch (Functions::getReturnDateType()) {
+ case Functions::RETURNDATE_EXCEL:
$date = 0;
- $calendar = PHPExcel_Shared_Date::getExcelCalendar();
- if ($calendar != PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900) {
+ $calendar = Date::getExcelCalendar();
+ if ($calendar != Date::CALENDAR_WINDOWS_1900) {
$date = 1;
}
- return (float) PHPExcel_Shared_Date::FormattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second);
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC:
- return (integer) PHPExcel_Shared_Date::ExcelToPHP(PHPExcel_Shared_Date::FormattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT:
+
+ return (float) Date::formattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second);
+ case Functions::RETURNDATE_PHP_NUMERIC:
+ return (int) Date::excelToTimestamp(Date::formattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600
+ case Functions::RETURNDATE_PHP_OBJECT:
$dayAdjust = 0;
if ($hour < 0) {
$dayAdjust = floor($hour / 24);
@@ -455,31 +434,31 @@ class PHPExcel_Calculation_DateTime
$dayAdjust = floor($hour / 24);
$hour = $hour % 24;
}
- $phpDateObject = new DateTime('1900-01-01 '.$hour.':'.$minute.':'.$second);
+ $phpDateObject = new \DateTime('1900-01-01 ' . $hour . ':' . $minute . ':' . $second);
if ($dayAdjust != 0) {
- $phpDateObject->modify($dayAdjust.' days');
+ $phpDateObject->modify($dayAdjust . ' days');
}
+
return $phpDateObject;
}
}
-
/**
- * DATEVALUE
+ * DATEVALUE.
*
* Returns a value that represents a particular date.
* Use DATEVALUE to convert a date represented by a text string to an Excel or PHP date/time stamp
* value.
*
* NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the date
- * format of your regional settings. PHPExcel does not change cell formatting in this way.
+ * format of your regional settings. PhpSpreadsheet does not change cell formatting in this way.
*
* Excel Function:
* DATEVALUE(dateValue)
*
- * @access public
* @category Date/Time Functions
- * @param string $dateValue Text that represents a date in a Microsoft Excel date format.
+ *
+ * @param string $dateValue Text that represents a date in a Microsoft Excel date format.
* For example, "1/30/2008" or "30-Jan-2008" are text strings within
* quotation marks that represent dates. Using the default date
* system in Excel for Windows, date_text must represent a date from
@@ -487,29 +466,30 @@ class PHPExcel_Calculation_DateTime
* system in Excel for the Macintosh, date_text must represent a date
* from January 1, 1904, to December 31, 9999. DATEVALUE returns the
* #VALUE! error value if date_text is out of this range.
- * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ *
+ * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
public static function DATEVALUE($dateValue = 1)
{
- $dateValue = trim(PHPExcel_Calculation_Functions::flattenSingleValue($dateValue), '"');
+ $dateValueOrig = $dateValue;
+ $dateValue = trim(Functions::flattenSingleValue($dateValue), '"');
// Strip any ordinals because they're allowed in Excel (English only)
$dateValue = preg_replace('/(\d)(st|nd|rd|th)([ -\/])/Ui', '$1$3', $dateValue);
// Convert separators (/ . or space) to hyphens (should also handle dot used for ordinals in some countries, e.g. Denmark, Germany)
- $dateValue = str_replace(array('/', '.', '-', ' '), array(' ', ' ', ' ', ' '), $dateValue);
+ $dateValue = str_replace(['/', '.', '-', ' '], ' ', $dateValue);
$yearFound = false;
$t1 = explode(' ', $dateValue);
foreach ($t1 as &$t) {
if ((is_numeric($t)) && ($t > 31)) {
if ($yearFound) {
- return PHPExcel_Calculation_Functions::VALUE();
- } else {
- if ($t < 100) {
- $t += 1900;
- }
- $yearFound = true;
+ return Functions::VALUE();
}
+ if ($t < 100) {
+ $t += 1900;
+ }
+ $yearFound = true;
}
}
if ((count($t1) == 1) && (strpos($t, ':') != false)) {
@@ -520,7 +500,12 @@ class PHPExcel_Calculation_DateTime
if ($yearFound) {
array_unshift($t1, 1);
} else {
- array_push($t1, date('Y'));
+ if ($t1[1] > 29) {
+ $t1[1] += 1900;
+ array_unshift($t1, 1);
+ } else {
+ $t1[] = date('Y');
+ }
}
}
unset($t);
@@ -537,16 +522,19 @@ class PHPExcel_Calculation_DateTime
$testVal3 = strftime('%Y');
}
} else {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
} else {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
- $PHPDateArray = date_parse($testVal1.'-'.$testVal2.'-'.$testVal3);
+ if ($testVal1 < 31 && $testVal2 < 12 && $testVal3 < 12 && strlen($testVal3) == 2) {
+ $testVal3 += 2000;
+ }
+ $PHPDateArray = date_parse($testVal1 . '-' . $testVal2 . '-' . $testVal3);
if (($PHPDateArray === false) || ($PHPDateArray['error_count'] > 0)) {
- $PHPDateArray = date_parse($testVal2.'-'.$testVal1.'-'.$testVal3);
+ $PHPDateArray = date_parse($testVal2 . '-' . $testVal1 . '-' . $testVal3);
if (($PHPDateArray === false) || ($PHPDateArray['error_count'] > 0)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
}
}
@@ -557,7 +545,7 @@ class PHPExcel_Calculation_DateTime
$PHPDateArray['year'] = strftime('%Y');
}
if ($PHPDateArray['year'] < 1900) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
if ($PHPDateArray['month'] == '') {
$PHPDateArray['month'] = strftime('%m');
@@ -565,8 +553,11 @@ class PHPExcel_Calculation_DateTime
if ($PHPDateArray['day'] == '') {
$PHPDateArray['day'] = strftime('%d');
}
+ if (!checkdate($PHPDateArray['month'], $PHPDateArray['day'], $PHPDateArray['year'])) {
+ return Functions::VALUE();
+ }
$excelDateValue = floor(
- PHPExcel_Shared_Date::FormattedPHPToExcel(
+ Date::formattedPHPToExcel(
$PHPDateArray['year'],
$PHPDateArray['month'],
$PHPDateArray['day'],
@@ -575,51 +566,57 @@ class PHPExcel_Calculation_DateTime
$PHPDateArray['second']
)
);
-
- switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
- case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL:
+ switch (Functions::getReturnDateType()) {
+ case Functions::RETURNDATE_EXCEL:
return (float) $excelDateValue;
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC:
- return (integer) PHPExcel_Shared_Date::ExcelToPHP($excelDateValue);
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT:
- return new DateTime($PHPDateArray['year'].'-'.$PHPDateArray['month'].'-'.$PHPDateArray['day'].' 00:00:00');
+ case Functions::RETURNDATE_PHP_NUMERIC:
+ return (int) Date::excelToTimestamp($excelDateValue);
+ case Functions::RETURNDATE_PHP_OBJECT:
+ return new \DateTime($PHPDateArray['year'] . '-' . $PHPDateArray['month'] . '-' . $PHPDateArray['day'] . ' 00:00:00');
}
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * TIMEVALUE
+ * TIMEVALUE.
*
* Returns a value that represents a particular time.
* Use TIMEVALUE to convert a time represented by a text string to an Excel or PHP date/time stamp
* value.
*
* NOTE: When used in a Cell Formula, MS Excel changes the cell format so that it matches the time
- * format of your regional settings. PHPExcel does not change cell formatting in this way.
+ * format of your regional settings. PhpSpreadsheet does not change cell formatting in this way.
*
* Excel Function:
* TIMEVALUE(timeValue)
*
- * @access public
* @category Date/Time Functions
- * @param string $timeValue A text string that represents a time in any one of the Microsoft
+ *
+ * @param string $timeValue A text string that represents a time in any one of the Microsoft
* Excel time formats; for example, "6:45 PM" and "18:45" text strings
* within quotation marks that represent time.
* Date information in time_text is ignored.
- * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ *
+ * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
public static function TIMEVALUE($timeValue)
{
- $timeValue = trim(PHPExcel_Calculation_Functions::flattenSingleValue($timeValue), '"');
- $timeValue = str_replace(array('/', '.'), array('-', '-'), $timeValue);
+ $timeValue = trim(Functions::flattenSingleValue($timeValue), '"');
+ $timeValue = str_replace(['/', '.'], '-', $timeValue);
+
+ $arraySplit = preg_split('/[\/:\-\s]/', $timeValue);
+ if ((count($arraySplit) == 2 || count($arraySplit) == 3) && $arraySplit[0] > 24) {
+ $arraySplit[0] = ($arraySplit[0] % 24);
+ $timeValue = implode(':', $arraySplit);
+ }
$PHPDateArray = date_parse($timeValue);
if (($PHPDateArray !== false) && ($PHPDateArray['error_count'] == 0)) {
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
- $excelDateValue = PHPExcel_Shared_Date::FormattedPHPToExcel(
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
+ $excelDateValue = Date::formattedPHPToExcel(
$PHPDateArray['year'],
$PHPDateArray['month'],
$PHPDateArray['day'],
@@ -628,98 +625,104 @@ class PHPExcel_Calculation_DateTime
$PHPDateArray['second']
);
} else {
- $excelDateValue = PHPExcel_Shared_Date::FormattedPHPToExcel(1900, 1, 1, $PHPDateArray['hour'], $PHPDateArray['minute'], $PHPDateArray['second']) - 1;
+ $excelDateValue = Date::formattedPHPToExcel(1900, 1, 1, $PHPDateArray['hour'], $PHPDateArray['minute'], $PHPDateArray['second']) - 1;
}
- switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
- case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL:
+ switch (Functions::getReturnDateType()) {
+ case Functions::RETURNDATE_EXCEL:
return (float) $excelDateValue;
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC:
- return (integer) $phpDateValue = PHPExcel_Shared_Date::ExcelToPHP($excelDateValue+25569) - 3600;
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT:
- return new DateTime('1900-01-01 '.$PHPDateArray['hour'].':'.$PHPDateArray['minute'].':'.$PHPDateArray['second']);
+ case Functions::RETURNDATE_PHP_NUMERIC:
+ return (int) $phpDateValue = Date::excelToTimestamp($excelDateValue + 25569) - 3600;
+ case Functions::RETURNDATE_PHP_OBJECT:
+ return new \DateTime('1900-01-01 ' . $PHPDateArray['hour'] . ':' . $PHPDateArray['minute'] . ':' . $PHPDateArray['second']);
}
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * DATEDIF
+ * DATEDIF.
*
- * @param mixed $startDate Excel date serial value, PHP date/time stamp, PHP DateTime object
+ * @param mixed $startDate Excel date serial value, PHP date/time stamp, PHP DateTime object
* or a standard date string
- * @param mixed $endDate Excel date serial value, PHP date/time stamp, PHP DateTime object
+ * @param mixed $endDate Excel date serial value, PHP date/time stamp, PHP DateTime object
* or a standard date string
- * @param string $unit
- * @return integer Interval between the dates
+ * @param string $unit
+ *
+ * @return int|string Interval between the dates
*/
public static function DATEDIF($startDate = 0, $endDate = 0, $unit = 'D')
{
- $startDate = PHPExcel_Calculation_Functions::flattenSingleValue($startDate);
- $endDate = PHPExcel_Calculation_Functions::flattenSingleValue($endDate);
- $unit = strtoupper(PHPExcel_Calculation_Functions::flattenSingleValue($unit));
+ $startDate = Functions::flattenSingleValue($startDate);
+ $endDate = Functions::flattenSingleValue($endDate);
+ $unit = strtoupper(Functions::flattenSingleValue($unit));
if (is_string($startDate = self::getDateValue($startDate))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
if (is_string($endDate = self::getDateValue($endDate))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
// Validate parameters
- if ($startDate >= $endDate) {
- return PHPExcel_Calculation_Functions::NaN();
+ if ($startDate > $endDate) {
+ return Functions::NAN();
}
// Execute function
$difference = $endDate - $startDate;
- $PHPStartDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($startDate);
+ $PHPStartDateObject = Date::excelToDateTimeObject($startDate);
$startDays = $PHPStartDateObject->format('j');
$startMonths = $PHPStartDateObject->format('n');
$startYears = $PHPStartDateObject->format('Y');
- $PHPEndDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($endDate);
+ $PHPEndDateObject = Date::excelToDateTimeObject($endDate);
$endDays = $PHPEndDateObject->format('j');
$endMonths = $PHPEndDateObject->format('n');
$endYears = $PHPEndDateObject->format('Y');
- $retVal = PHPExcel_Calculation_Functions::NaN();
+ $retVal = Functions::NAN();
switch ($unit) {
case 'D':
- $retVal = intval($difference);
+ $retVal = (int) $difference;
+
break;
case 'M':
- $retVal = intval($endMonths - $startMonths) + (intval($endYears - $startYears) * 12);
+ $retVal = (int) ($endMonths - $startMonths) + ((int) ($endYears - $startYears) * 12);
// We're only interested in full months
if ($endDays < $startDays) {
--$retVal;
}
+
break;
case 'Y':
- $retVal = intval($endYears - $startYears);
+ $retVal = (int) ($endYears - $startYears);
// We're only interested in full months
if ($endMonths < $startMonths) {
--$retVal;
} elseif (($endMonths == $startMonths) && ($endDays < $startDays)) {
+ // Remove start month
+ --$retVal;
+ // Remove end month
--$retVal;
}
+
break;
case 'MD':
if ($endDays < $startDays) {
$retVal = $endDays;
- $PHPEndDateObject->modify('-'.$endDays.' days');
+ $PHPEndDateObject->modify('-' . $endDays . ' days');
$adjustDays = $PHPEndDateObject->format('j');
- if ($adjustDays > $startDays) {
- $retVal += ($adjustDays - $startDays);
- }
+ $retVal += ($adjustDays - $startDays);
} else {
$retVal = $endDays - $startDays;
}
+
break;
case 'YM':
- $retVal = intval($endMonths - $startMonths);
+ $retVal = (int) ($endMonths - $startMonths);
if ($retVal < 0) {
$retVal += 12;
}
@@ -727,29 +730,88 @@ class PHPExcel_Calculation_DateTime
if ($endDays < $startDays) {
--$retVal;
}
+
break;
case 'YD':
- $retVal = intval($difference);
+ $retVal = (int) $difference;
if ($endYears > $startYears) {
- while ($endYears > $startYears) {
+ $isLeapStartYear = $PHPStartDateObject->format('L');
+ $wasLeapEndYear = $PHPEndDateObject->format('L');
+
+ // Adjust end year to be as close as possible as start year
+ while ($PHPEndDateObject >= $PHPStartDateObject) {
$PHPEndDateObject->modify('-1 year');
$endYears = $PHPEndDateObject->format('Y');
}
- $retVal = $PHPEndDateObject->format('z') - $PHPStartDateObject->format('z');
- if ($retVal < 0) {
- $retVal += 365;
+ $PHPEndDateObject->modify('+1 year');
+
+ // Get the result
+ $retVal = $PHPEndDateObject->diff($PHPStartDateObject)->days;
+
+ // Adjust for leap years cases
+ $isLeapEndYear = $PHPEndDateObject->format('L');
+ $limit = new \DateTime($PHPEndDateObject->format('Y-02-29'));
+ if (!$isLeapStartYear && !$wasLeapEndYear && $isLeapEndYear && $PHPEndDateObject >= $limit) {
+ --$retVal;
}
}
+
break;
default:
- $retVal = PHPExcel_Calculation_Functions::NaN();
+ $retVal = Functions::VALUE();
}
+
return $retVal;
}
+ /**
+ * DAYS.
+ *
+ * Returns the number of days between two dates
+ *
+ * Excel Function:
+ * DAYS(endDate, startDate)
+ *
+ * @category Date/Time Functions
+ *
+ * @param \DateTimeImmutable|float|int|string $endDate Excel date serial value (float),
+ * PHP date timestamp (integer), PHP DateTime object, or a standard date string
+ * @param \DateTimeImmutable|float|int|string $startDate Excel date serial value (float),
+ * PHP date timestamp (integer), PHP DateTime object, or a standard date string
+ *
+ * @return int|string Number of days between start date and end date or an error
+ */
+ public static function DAYS($endDate = 0, $startDate = 0)
+ {
+ $startDate = Functions::flattenSingleValue($startDate);
+ $endDate = Functions::flattenSingleValue($endDate);
+
+ $startDate = self::getDateValue($startDate);
+ if (is_string($startDate)) {
+ return Functions::VALUE();
+ }
+
+ $endDate = self::getDateValue($endDate);
+ if (is_string($endDate)) {
+ return Functions::VALUE();
+ }
+
+ // Execute function
+ $PHPStartDateObject = Date::excelToDateTimeObject($startDate);
+ $PHPEndDateObject = Date::excelToDateTimeObject($endDate);
+
+ $diff = $PHPStartDateObject->diff($PHPEndDateObject);
+ $days = $diff->days;
+
+ if ($diff->invert) {
+ $days = -$days;
+ }
+
+ return $days;
+ }
/**
- * DAYS360
+ * DAYS360.
*
* Returns the number of days between two dates based on a 360-day year (twelve 30-day months),
* which is used in some accounting calculations. Use this function to help compute payments if
@@ -758,13 +820,13 @@ class PHPExcel_Calculation_DateTime
* Excel Function:
* DAYS360(startDate,endDate[,method])
*
- * @access public
* @category Date/Time Functions
- * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer),
+ *
+ * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
- * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer),
+ * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
- * @param boolean $method US or European Method
+ * @param bool $method US or European Method
* FALSE or omitted: U.S. (NASD) method. If the starting date is
* the last day of a month, it becomes equal to the 30th of the
* same month. If the ending date is the last day of a month and
@@ -775,31 +837,32 @@ class PHPExcel_Calculation_DateTime
* TRUE: European method. Starting dates and ending dates that
* occur on the 31st of a month become equal to the 30th of the
* same month.
- * @return integer Number of days between start date and end date
+ *
+ * @return int|string Number of days between start date and end date
*/
public static function DAYS360($startDate = 0, $endDate = 0, $method = false)
{
- $startDate = PHPExcel_Calculation_Functions::flattenSingleValue($startDate);
- $endDate = PHPExcel_Calculation_Functions::flattenSingleValue($endDate);
+ $startDate = Functions::flattenSingleValue($startDate);
+ $endDate = Functions::flattenSingleValue($endDate);
if (is_string($startDate = self::getDateValue($startDate))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
if (is_string($endDate = self::getDateValue($endDate))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
if (!is_bool($method)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
// Execute function
- $PHPStartDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($startDate);
+ $PHPStartDateObject = Date::excelToDateTimeObject($startDate);
$startDay = $PHPStartDateObject->format('j');
$startMonth = $PHPStartDateObject->format('n');
$startYear = $PHPStartDateObject->format('Y');
- $PHPEndDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($endDate);
+ $PHPEndDateObject = Date::excelToDateTimeObject($endDate);
$endDay = $PHPEndDateObject->format('j');
$endMonth = $PHPEndDateObject->format('n');
$endYear = $PHPEndDateObject->format('Y');
@@ -807,9 +870,8 @@ class PHPExcel_Calculation_DateTime
return self::dateDiff360($startDay, $startMonth, $startYear, $endDay, $endMonth, $endYear, !$method);
}
-
/**
- * YEARFRAC
+ * YEARFRAC.
*
* Calculates the fraction of the year represented by the number of whole days between two dates
* (the start_date and the end_date).
@@ -819,31 +881,32 @@ class PHPExcel_Calculation_DateTime
* Excel Function:
* YEARFRAC(startDate,endDate[,method])
*
- * @access public
* @category Date/Time Functions
- * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer),
+ *
+ * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
- * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer),
+ * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
- * @param integer $method Method used for the calculation
+ * @param int $method Method used for the calculation
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return float fraction of the year
+ *
+ * @return float fraction of the year
*/
public static function YEARFRAC($startDate = 0, $endDate = 0, $method = 0)
{
- $startDate = PHPExcel_Calculation_Functions::flattenSingleValue($startDate);
- $endDate = PHPExcel_Calculation_Functions::flattenSingleValue($endDate);
- $method = PHPExcel_Calculation_Functions::flattenSingleValue($method);
+ $startDate = Functions::flattenSingleValue($startDate);
+ $endDate = Functions::flattenSingleValue($endDate);
+ $method = Functions::flattenSingleValue($method);
if (is_string($startDate = self::getDateValue($startDate))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
if (is_string($endDate = self::getDateValue($endDate))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
if (((is_numeric($method)) && (!is_string($method))) || ($method == '')) {
@@ -863,7 +926,7 @@ class PHPExcel_Calculation_DateTime
$endDay = self::DAYOFMONTH($endDate);
if (($startMonth < 3) ||
(($endMonth * 100 + $endDay) >= (2 * 100 + 29))) {
- $leapDays += 1;
+ $leapDays += 1;
}
}
} else {
@@ -893,6 +956,7 @@ class PHPExcel_Calculation_DateTime
}
$leapDays /= $years;
}
+
return $days / (365 + $leapDays);
case 2:
return self::DATEDIF($startDate, $endDate) / 360;
@@ -902,12 +966,12 @@ class PHPExcel_Calculation_DateTime
return self::DAYS360($startDate, $endDate, true) / 360;
}
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * NETWORKDAYS
+ * NETWORKDAYS.
*
* Returns the number of whole working days between start_date and end_date. Working days
* exclude weekends and any dates identified in holidays.
@@ -917,35 +981,30 @@ class PHPExcel_Calculation_DateTime
* Excel Function:
* NETWORKDAYS(startDate,endDate[,holidays[,holiday[,...]]])
*
- * @access public
* @category Date/Time Functions
- * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer),
+ *
+ * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
- * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer),
+ * @param mixed $endDate Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
- * @param mixed $holidays,... Optional series of Excel date serial value (float), PHP date
- * timestamp (integer), PHP DateTime object, or a standard date
- * strings that will be excluded from the working calendar, such
- * as state and federal holidays and floating holidays.
- * @return integer Interval between the dates
+ *
+ * @return int|string Interval between the dates
*/
- public static function NETWORKDAYS($startDate, $endDate)
+ public static function NETWORKDAYS($startDate, $endDate, ...$dateArgs)
{
// Retrieve the mandatory start and end date that are referenced in the function definition
- $startDate = PHPExcel_Calculation_Functions::flattenSingleValue($startDate);
- $endDate = PHPExcel_Calculation_Functions::flattenSingleValue($endDate);
- // Flush the mandatory start and end date that are referenced in the function definition, and get the optional days
- $dateArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
- array_shift($dateArgs);
- array_shift($dateArgs);
+ $startDate = Functions::flattenSingleValue($startDate);
+ $endDate = Functions::flattenSingleValue($endDate);
+ // Get the optional days
+ $dateArgs = Functions::flattenArray($dateArgs);
// Validate the start and end dates
if (is_string($startDate = $sDate = self::getDateValue($startDate))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$startDate = (float) floor($startDate);
if (is_string($endDate = $eDate = self::getDateValue($endDate))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$endDate = (float) floor($endDate);
@@ -955,11 +1014,11 @@ class PHPExcel_Calculation_DateTime
}
// Execute function
- $startDoW = 6 - self::DAYOFWEEK($startDate, 2);
+ $startDoW = 6 - self::WEEKDAY($startDate, 2);
if ($startDoW < 0) {
$startDoW = 0;
}
- $endDoW = self::DAYOFWEEK($endDate, 2);
+ $endDoW = self::WEEKDAY($endDate, 2);
if ($endDoW >= 6) {
$endDoW = 0;
}
@@ -971,13 +1030,13 @@ class PHPExcel_Calculation_DateTime
}
// Test any extra holiday parameters
- $holidayCountedArray = array();
+ $holidayCountedArray = [];
foreach ($dateArgs as $holidayDate) {
if (is_string($holidayDate = self::getDateValue($holidayDate))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
if (($holidayDate >= $startDate) && ($holidayDate <= $endDate)) {
- if ((self::DAYOFWEEK($holidayDate, 2) < 6) && (!in_array($holidayDate, $holidayCountedArray))) {
+ if ((self::WEEKDAY($holidayDate, 2) < 6) && (!in_array($holidayDate, $holidayCountedArray))) {
--$partWeekDays;
$holidayCountedArray[] = $holidayDate;
}
@@ -987,12 +1046,12 @@ class PHPExcel_Calculation_DateTime
if ($sDate > $eDate) {
return 0 - ($wholeWeekDays + $partWeekDays);
}
+
return $wholeWeekDays + $partWeekDays;
}
-
/**
- * WORKDAY
+ * WORKDAY.
*
* Returns the date that is the indicated number of working days before or after a date (the
* starting date). Working days exclude weekends and any dates identified as holidays.
@@ -1002,32 +1061,27 @@ class PHPExcel_Calculation_DateTime
* Excel Function:
* WORKDAY(startDate,endDays[,holidays[,holiday[,...]]])
*
- * @access public
* @category Date/Time Functions
- * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer),
+ *
+ * @param mixed $startDate Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
- * @param integer $endDays The number of nonweekend and nonholiday days before or after
+ * @param int $endDays The number of nonweekend and nonholiday days before or after
* startDate. A positive value for days yields a future date; a
* negative value yields a past date.
- * @param mixed $holidays,... Optional series of Excel date serial value (float), PHP date
- * timestamp (integer), PHP DateTime object, or a standard date
- * strings that will be excluded from the working calendar, such
- * as state and federal holidays and floating holidays.
- * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ *
+ * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
- public static function WORKDAY($startDate, $endDays)
+ public static function WORKDAY($startDate, $endDays, ...$dateArgs)
{
// Retrieve the mandatory start date and days that are referenced in the function definition
- $startDate = PHPExcel_Calculation_Functions::flattenSingleValue($startDate);
- $endDays = PHPExcel_Calculation_Functions::flattenSingleValue($endDays);
- // Flush the mandatory start date and days that are referenced in the function definition, and get the optional days
- $dateArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
- array_shift($dateArgs);
- array_shift($dateArgs);
+ $startDate = Functions::flattenSingleValue($startDate);
+ $endDays = Functions::flattenSingleValue($endDays);
+ // Get the optional days
+ $dateArgs = Functions::flattenArray($dateArgs);
if ((is_string($startDate = self::getDateValue($startDate))) || (!is_numeric($endDays))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$startDate = (float) floor($startDate);
$endDays = (int) floor($endDays);
@@ -1036,34 +1090,34 @@ class PHPExcel_Calculation_DateTime
return $startDate;
}
- $decrementing = ($endDays < 0) ? true : false;
+ $decrementing = $endDays < 0;
// Adjust the start date if it falls over a weekend
- $startDoW = self::DAYOFWEEK($startDate, 3);
- if (self::DAYOFWEEK($startDate, 3) >= 5) {
- $startDate += ($decrementing) ? -$startDoW + 4: 7 - $startDoW;
+ $startDoW = self::WEEKDAY($startDate, 3);
+ if (self::WEEKDAY($startDate, 3) >= 5) {
+ $startDate += ($decrementing) ? -$startDoW + 4 : 7 - $startDoW;
($decrementing) ? $endDays++ : $endDays--;
}
// Add endDays
- $endDate = (float) $startDate + (intval($endDays / 5) * 7) + ($endDays % 5);
+ $endDate = (float) $startDate + ((int) ($endDays / 5) * 7) + ($endDays % 5);
// Adjust the calculated end date if it falls over a weekend
- $endDoW = self::DAYOFWEEK($endDate, 3);
+ $endDoW = self::WEEKDAY($endDate, 3);
if ($endDoW >= 5) {
- $endDate += ($decrementing) ? -$endDoW + 4: 7 - $endDoW;
+ $endDate += ($decrementing) ? -$endDoW + 4 : 7 - $endDoW;
}
// Test any extra holiday parameters
if (!empty($dateArgs)) {
- $holidayCountedArray = $holidayDates = array();
+ $holidayCountedArray = $holidayDates = [];
foreach ($dateArgs as $holidayDate) {
if (($holidayDate !== null) && (trim($holidayDate) > '')) {
if (is_string($holidayDate = self::getDateValue($holidayDate))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
- if (self::DAYOFWEEK($holidayDate, 3) < 5) {
+ if (self::WEEKDAY($holidayDate, 3) < 5) {
$holidayDates[] = $holidayDate;
}
}
@@ -1090,26 +1144,25 @@ class PHPExcel_Calculation_DateTime
}
}
// Adjust the calculated end date if it falls over a weekend
- $endDoW = self::DAYOFWEEK($endDate, 3);
+ $endDoW = self::WEEKDAY($endDate, 3);
if ($endDoW >= 5) {
$endDate += ($decrementing) ? -$endDoW + 4 : 7 - $endDoW;
}
}
}
- switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
- case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL:
+ switch (Functions::getReturnDateType()) {
+ case Functions::RETURNDATE_EXCEL:
return (float) $endDate;
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC:
- return (integer) PHPExcel_Shared_Date::ExcelToPHP($endDate);
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT:
- return PHPExcel_Shared_Date::ExcelToPHPObject($endDate);
+ case Functions::RETURNDATE_PHP_NUMERIC:
+ return (int) Date::excelToTimestamp($endDate);
+ case Functions::RETURNDATE_PHP_OBJECT:
+ return Date::excelToDateTimeObject($endDate);
}
}
-
/**
- * DAYOFMONTH
+ * DAYOFMONTH.
*
* Returns the day of the month, for a specified date. The day is given as an integer
* ranging from 1 to 31.
@@ -1117,33 +1170,37 @@ class PHPExcel_Calculation_DateTime
* Excel Function:
* DAY(dateValue)
*
- * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
+ * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
- * @return int Day of the month
+ *
+ * @return int|string Day of the month
*/
public static function DAYOFMONTH($dateValue = 1)
{
- $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue);
+ $dateValue = Functions::flattenSingleValue($dateValue);
if ($dateValue === null) {
$dateValue = 1;
} elseif (is_string($dateValue = self::getDateValue($dateValue))) {
- return PHPExcel_Calculation_Functions::VALUE();
- } elseif ($dateValue == 0.0) {
- return 0;
- } elseif ($dateValue < 0.0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::VALUE();
+ }
+
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_EXCEL) {
+ if ($dateValue < 0.0) {
+ return Functions::NAN();
+ } elseif ($dateValue < 1.0) {
+ return 0;
+ }
}
// Execute function
- $PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue);
+ $PHPDateObject = Date::excelToDateTimeObject($dateValue);
return (int) $PHPDateObject->format('j');
}
-
/**
- * DAYOFWEEK
+ * WEEKDAY.
*
* Returns the day of the week for a specified date. The day is given as an integer
* ranging from 0 to 7 (dependent on the requested style).
@@ -1151,47 +1208,50 @@ class PHPExcel_Calculation_DateTime
* Excel Function:
* WEEKDAY(dateValue[,style])
*
- * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
+ * @param int $dateValue Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
- * @param int $style A number that determines the type of return value
+ * @param int $style A number that determines the type of return value
* 1 or omitted Numbers 1 (Sunday) through 7 (Saturday).
* 2 Numbers 1 (Monday) through 7 (Sunday).
* 3 Numbers 0 (Monday) through 6 (Sunday).
- * @return int Day of the week value
+ *
+ * @return int|string Day of the week value
*/
- public static function DAYOFWEEK($dateValue = 1, $style = 1)
+ public static function WEEKDAY($dateValue = 1, $style = 1)
{
- $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue);
- $style = PHPExcel_Calculation_Functions::flattenSingleValue($style);
+ $dateValue = Functions::flattenSingleValue($dateValue);
+ $style = Functions::flattenSingleValue($style);
if (!is_numeric($style)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
} elseif (($style < 1) || ($style > 3)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
$style = floor($style);
if ($dateValue === null) {
$dateValue = 1;
} elseif (is_string($dateValue = self::getDateValue($dateValue))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
} elseif ($dateValue < 0.0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
// Execute function
- $PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue);
+ $PHPDateObject = Date::excelToDateTimeObject($dateValue);
$DoW = $PHPDateObject->format('w');
$firstDay = 1;
switch ($style) {
case 1:
++$DoW;
+
break;
case 2:
if ($DoW == 0) {
$DoW = 7;
}
+
break;
case 3:
if ($DoW == 0) {
@@ -1199,9 +1259,10 @@ class PHPExcel_Calculation_DateTime
}
$firstDay = 0;
--$DoW;
+
break;
}
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_EXCEL) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_EXCEL) {
// Test for Excel's 1900 leap year, and introduce the error as required
if (($PHPDateObject->format('Y') == 1900) && ($PHPDateObject->format('n') <= 2)) {
--$DoW;
@@ -1214,9 +1275,8 @@ class PHPExcel_Calculation_DateTime
return (int) $DoW;
}
-
/**
- * WEEKOFYEAR
+ * WEEKNUM.
*
* Returns the week of the year for a specified date.
* The WEEKNUM function considers the week containing January 1 to be the first week of the year.
@@ -1228,49 +1288,83 @@ class PHPExcel_Calculation_DateTime
* Excel Function:
* WEEKNUM(dateValue[,style])
*
- * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
+ * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
- * @param boolean $method Week begins on Sunday or Monday
+ * @param int $method Week begins on Sunday or Monday
* 1 or omitted Week begins on Sunday.
* 2 Week begins on Monday.
- * @return int Week Number
+ *
+ * @return int|string Week Number
*/
- public static function WEEKOFYEAR($dateValue = 1, $method = 1)
+ public static function WEEKNUM($dateValue = 1, $method = 1)
{
- $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue);
- $method = PHPExcel_Calculation_Functions::flattenSingleValue($method);
+ $dateValue = Functions::flattenSingleValue($dateValue);
+ $method = Functions::flattenSingleValue($method);
if (!is_numeric($method)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
} elseif (($method < 1) || ($method > 2)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
$method = floor($method);
if ($dateValue === null) {
$dateValue = 1;
} elseif (is_string($dateValue = self::getDateValue($dateValue))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
} elseif ($dateValue < 0.0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
// Execute function
- $PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue);
+ $PHPDateObject = Date::excelToDateTimeObject($dateValue);
$dayOfYear = $PHPDateObject->format('z');
- $dow = $PHPDateObject->format('w');
$PHPDateObject->modify('-' . $dayOfYear . ' days');
- $dow = $PHPDateObject->format('w');
- $daysInFirstWeek = 7 - (($dow + (2 - $method)) % 7);
- $dayOfYear -= $daysInFirstWeek;
- $weekOfYear = ceil($dayOfYear / 7) + 1;
+ $firstDayOfFirstWeek = $PHPDateObject->format('w');
+ $daysInFirstWeek = (6 - $firstDayOfFirstWeek + $method) % 7;
+ $interval = $dayOfYear - $daysInFirstWeek;
+ $weekOfYear = floor($interval / 7) + 1;
+
+ if ($daysInFirstWeek) {
+ ++$weekOfYear;
+ }
return (int) $weekOfYear;
}
+ /**
+ * ISOWEEKNUM.
+ *
+ * Returns the ISO 8601 week number of the year for a specified date.
+ *
+ * Excel Function:
+ * ISOWEEKNUM(dateValue)
+ *
+ * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
+ * PHP DateTime object, or a standard date string
+ *
+ * @return int|string Week Number
+ */
+ public static function ISOWEEKNUM($dateValue = 1)
+ {
+ $dateValue = Functions::flattenSingleValue($dateValue);
+
+ if ($dateValue === null) {
+ $dateValue = 1;
+ } elseif (is_string($dateValue = self::getDateValue($dateValue))) {
+ return Functions::VALUE();
+ } elseif ($dateValue < 0.0) {
+ return Functions::NAN();
+ }
+
+ // Execute function
+ $PHPDateObject = Date::excelToDateTimeObject($dateValue);
+
+ return (int) $PHPDateObject->format('W');
+ }
/**
- * MONTHOFYEAR
+ * MONTHOFYEAR.
*
* Returns the month of a date represented by a serial number.
* The month is given as an integer, ranging from 1 (January) to 12 (December).
@@ -1278,31 +1372,32 @@ class PHPExcel_Calculation_DateTime
* Excel Function:
* MONTH(dateValue)
*
- * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
+ * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
- * @return int Month of the year
+ *
+ * @return int|string Month of the year
*/
public static function MONTHOFYEAR($dateValue = 1)
{
- $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue);
+ $dateValue = Functions::flattenSingleValue($dateValue);
- if ($dateValue === null) {
+ if (empty($dateValue)) {
$dateValue = 1;
- } elseif (is_string($dateValue = self::getDateValue($dateValue))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ }
+ if (is_string($dateValue = self::getDateValue($dateValue))) {
+ return Functions::VALUE();
} elseif ($dateValue < 0.0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
// Execute function
- $PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue);
+ $PHPDateObject = Date::excelToDateTimeObject($dateValue);
return (int) $PHPDateObject->format('n');
}
-
/**
- * YEAR
+ * YEAR.
*
* Returns the year corresponding to a date.
* The year is returned as an integer in the range 1900-9999.
@@ -1310,31 +1405,31 @@ class PHPExcel_Calculation_DateTime
* Excel Function:
* YEAR(dateValue)
*
- * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
+ * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
- * @return int Year
+ *
+ * @return int|string Year
*/
public static function YEAR($dateValue = 1)
{
- $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue);
+ $dateValue = Functions::flattenSingleValue($dateValue);
if ($dateValue === null) {
$dateValue = 1;
} elseif (is_string($dateValue = self::getDateValue($dateValue))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
} elseif ($dateValue < 0.0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
// Execute function
- $PHPDateObject = PHPExcel_Shared_Date::ExcelToPHPObject($dateValue);
+ $PHPDateObject = Date::excelToDateTimeObject($dateValue);
return (int) $PHPDateObject->format('Y');
}
-
/**
- * HOUROFDAY
+ * HOUROFDAY.
*
* Returns the hour of a time value.
* The hour is given as an integer, ranging from 0 (12:00 A.M.) to 23 (11:00 P.M.).
@@ -1342,40 +1437,40 @@ class PHPExcel_Calculation_DateTime
* Excel Function:
* HOUR(timeValue)
*
- * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer),
+ * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard time string
- * @return int Hour
+ *
+ * @return int|string Hour
*/
public static function HOUROFDAY($timeValue = 0)
{
- $timeValue = PHPExcel_Calculation_Functions::flattenSingleValue($timeValue);
+ $timeValue = Functions::flattenSingleValue($timeValue);
if (!is_numeric($timeValue)) {
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) {
$testVal = strtok($timeValue, '/-: ');
if (strlen($testVal) < strlen($timeValue)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
}
$timeValue = self::getTimeValue($timeValue);
if (is_string($timeValue)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
}
// Execute function
if ($timeValue >= 1) {
$timeValue = fmod($timeValue, 1);
} elseif ($timeValue < 0.0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- $timeValue = PHPExcel_Shared_Date::ExcelToPHP($timeValue);
+ $timeValue = Date::excelToTimestamp($timeValue);
return (int) gmdate('G', $timeValue);
}
-
/**
- * MINUTEOFHOUR
+ * MINUTE.
*
* Returns the minutes of a time value.
* The minute is given as an integer, ranging from 0 to 59.
@@ -1383,40 +1478,40 @@ class PHPExcel_Calculation_DateTime
* Excel Function:
* MINUTE(timeValue)
*
- * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer),
+ * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard time string
- * @return int Minute
+ *
+ * @return int|string Minute
*/
- public static function MINUTEOFHOUR($timeValue = 0)
+ public static function MINUTE($timeValue = 0)
{
- $timeValue = $timeTester = PHPExcel_Calculation_Functions::flattenSingleValue($timeValue);
+ $timeValue = $timeTester = Functions::flattenSingleValue($timeValue);
if (!is_numeric($timeValue)) {
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) {
$testVal = strtok($timeValue, '/-: ');
if (strlen($testVal) < strlen($timeValue)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
}
$timeValue = self::getTimeValue($timeValue);
if (is_string($timeValue)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
}
// Execute function
if ($timeValue >= 1) {
$timeValue = fmod($timeValue, 1);
} elseif ($timeValue < 0.0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- $timeValue = PHPExcel_Shared_Date::ExcelToPHP($timeValue);
+ $timeValue = Date::excelToTimestamp($timeValue);
return (int) gmdate('i', $timeValue);
}
-
/**
- * SECONDOFMINUTE
+ * SECOND.
*
* Returns the seconds of a time value.
* The second is given as an integer in the range 0 (zero) to 59.
@@ -1424,40 +1519,40 @@ class PHPExcel_Calculation_DateTime
* Excel Function:
* SECOND(timeValue)
*
- * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer),
+ * @param mixed $timeValue Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard time string
- * @return int Second
+ *
+ * @return int|string Second
*/
- public static function SECONDOFMINUTE($timeValue = 0)
+ public static function SECOND($timeValue = 0)
{
- $timeValue = PHPExcel_Calculation_Functions::flattenSingleValue($timeValue);
+ $timeValue = Functions::flattenSingleValue($timeValue);
if (!is_numeric($timeValue)) {
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) {
$testVal = strtok($timeValue, '/-: ');
if (strlen($testVal) < strlen($timeValue)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
}
$timeValue = self::getTimeValue($timeValue);
if (is_string($timeValue)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
}
// Execute function
if ($timeValue >= 1) {
$timeValue = fmod($timeValue, 1);
} elseif ($timeValue < 0.0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- $timeValue = PHPExcel_Shared_Date::ExcelToPHP($timeValue);
+ $timeValue = Date::excelToTimestamp($timeValue);
return (int) gmdate('s', $timeValue);
}
-
/**
- * EDATE
+ * EDATE.
*
* Returns the serial number that represents the date that is the indicated number of months
* before or after a specified date (the start_date).
@@ -1467,44 +1562,44 @@ class PHPExcel_Calculation_DateTime
* Excel Function:
* EDATE(dateValue,adjustmentMonths)
*
- * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
+ * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
- * @param int $adjustmentMonths The number of months before or after start_date.
+ * @param int $adjustmentMonths The number of months before or after start_date.
* A positive value for months yields a future date;
* a negative value yields a past date.
- * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ *
+ * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
public static function EDATE($dateValue = 1, $adjustmentMonths = 0)
{
- $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue);
- $adjustmentMonths = PHPExcel_Calculation_Functions::flattenSingleValue($adjustmentMonths);
+ $dateValue = Functions::flattenSingleValue($dateValue);
+ $adjustmentMonths = Functions::flattenSingleValue($adjustmentMonths);
if (!is_numeric($adjustmentMonths)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$adjustmentMonths = floor($adjustmentMonths);
if (is_string($dateValue = self::getDateValue($dateValue))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
// Execute function
$PHPDateObject = self::adjustDateByMonths($dateValue, $adjustmentMonths);
- switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
- case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL:
- return (float) PHPExcel_Shared_Date::PHPToExcel($PHPDateObject);
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC:
- return (integer) PHPExcel_Shared_Date::ExcelToPHP(PHPExcel_Shared_Date::PHPToExcel($PHPDateObject));
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT:
+ switch (Functions::getReturnDateType()) {
+ case Functions::RETURNDATE_EXCEL:
+ return (float) Date::PHPToExcel($PHPDateObject);
+ case Functions::RETURNDATE_PHP_NUMERIC:
+ return (int) Date::excelToTimestamp(Date::PHPToExcel($PHPDateObject));
+ case Functions::RETURNDATE_PHP_OBJECT:
return $PHPDateObject;
}
}
-
/**
- * EOMONTH
+ * EOMONTH.
*
* Returns the date value for the last day of the month that is the indicated number of months
* before or after start_date.
@@ -1513,40 +1608,41 @@ class PHPExcel_Calculation_DateTime
* Excel Function:
* EOMONTH(dateValue,adjustmentMonths)
*
- * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
+ * @param mixed $dateValue Excel date serial value (float), PHP date timestamp (integer),
* PHP DateTime object, or a standard date string
- * @param int $adjustmentMonths The number of months before or after start_date.
+ * @param int $adjustmentMonths The number of months before or after start_date.
* A positive value for months yields a future date;
* a negative value yields a past date.
- * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ *
+ * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
public static function EOMONTH($dateValue = 1, $adjustmentMonths = 0)
{
- $dateValue = PHPExcel_Calculation_Functions::flattenSingleValue($dateValue);
- $adjustmentMonths = PHPExcel_Calculation_Functions::flattenSingleValue($adjustmentMonths);
+ $dateValue = Functions::flattenSingleValue($dateValue);
+ $adjustmentMonths = Functions::flattenSingleValue($adjustmentMonths);
if (!is_numeric($adjustmentMonths)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$adjustmentMonths = floor($adjustmentMonths);
if (is_string($dateValue = self::getDateValue($dateValue))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
// Execute function
- $PHPDateObject = self::adjustDateByMonths($dateValue, $adjustmentMonths+1);
+ $PHPDateObject = self::adjustDateByMonths($dateValue, $adjustmentMonths + 1);
$adjustDays = (int) $PHPDateObject->format('d');
$adjustDaysString = '-' . $adjustDays . ' days';
$PHPDateObject->modify($adjustDaysString);
- switch (PHPExcel_Calculation_Functions::getReturnDateType()) {
- case PHPExcel_Calculation_Functions::RETURNDATE_EXCEL:
- return (float) PHPExcel_Shared_Date::PHPToExcel($PHPDateObject);
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC:
- return (integer) PHPExcel_Shared_Date::ExcelToPHP(PHPExcel_Shared_Date::PHPToExcel($PHPDateObject));
- case PHPExcel_Calculation_Functions::RETURNDATE_PHP_OBJECT:
+ switch (Functions::getReturnDateType()) {
+ case Functions::RETURNDATE_EXCEL:
+ return (float) Date::PHPToExcel($PHPDateObject);
+ case Functions::RETURNDATE_PHP_NUMERIC:
+ return (int) Date::excelToTimestamp(Date::PHPToExcel($PHPDateObject));
+ case Functions::RETURNDATE_PHP_OBJECT:
return $PHPDateObject;
}
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php
new file mode 100644
index 00000000000..5a54d83ac03
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/CyclicReferenceStack.php
@@ -0,0 +1,73 @@
+stack);
+ }
+
+ /**
+ * Push a new entry onto the stack.
+ *
+ * @param mixed $value
+ */
+ public function push($value)
+ {
+ $this->stack[$value] = $value;
+ }
+
+ /**
+ * Pop the last entry from the stack.
+ *
+ * @return mixed
+ */
+ public function pop()
+ {
+ return array_pop($this->stack);
+ }
+
+ /**
+ * Test to see if a specified entry exists on the stack.
+ *
+ * @param mixed $value The value to test
+ *
+ * @return bool
+ */
+ public function onStack($value)
+ {
+ return isset($this->stack[$value]);
+ }
+
+ /**
+ * Clear the stack.
+ */
+ public function clear()
+ {
+ $this->stack = [];
+ }
+
+ /**
+ * Return an array of all entries on the stack.
+ *
+ * @return mixed[]
+ */
+ public function showStack()
+ {
+ return $this->stack;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Logger.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Logger.php
new file mode 100644
index 00000000000..6793dade78e
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engine/Logger.php
@@ -0,0 +1,128 @@
+cellStack = $stack;
+ }
+
+ /**
+ * Enable/Disable Calculation engine logging.
+ *
+ * @param bool $pValue
+ */
+ public function setWriteDebugLog($pValue)
+ {
+ $this->writeDebugLog = $pValue;
+ }
+
+ /**
+ * Return whether calculation engine logging is enabled or disabled.
+ *
+ * @return bool
+ */
+ public function getWriteDebugLog()
+ {
+ return $this->writeDebugLog;
+ }
+
+ /**
+ * Enable/Disable echoing of debug log information.
+ *
+ * @param bool $pValue
+ */
+ public function setEchoDebugLog($pValue)
+ {
+ $this->echoDebugLog = $pValue;
+ }
+
+ /**
+ * Return whether echoing of debug log information is enabled or disabled.
+ *
+ * @return bool
+ */
+ public function getEchoDebugLog()
+ {
+ return $this->echoDebugLog;
+ }
+
+ /**
+ * Write an entry to the calculation engine debug log.
+ */
+ public function writeDebugLog(...$args)
+ {
+ // Only write the debug log if logging is enabled
+ if ($this->writeDebugLog) {
+ $message = implode($args);
+ $cellReference = implode(' -> ', $this->cellStack->showStack());
+ if ($this->echoDebugLog) {
+ echo $cellReference,
+ ($this->cellStack->count() > 0 ? ' => ' : ''),
+ $message,
+ PHP_EOL;
+ }
+ $this->debugLog[] = $cellReference .
+ ($this->cellStack->count() > 0 ? ' => ' : '') .
+ $message;
+ }
+ }
+
+ /**
+ * Clear the calculation engine debug log.
+ */
+ public function clearLog()
+ {
+ $this->debugLog = [];
+ }
+
+ /**
+ * Return the calculation engine debug log.
+ *
+ * @return string[]
+ */
+ public function getLog()
+ {
+ return $this->debugLog;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering.php
new file mode 100644
index 00000000000..3f1b48bd74c
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Engineering.php
@@ -0,0 +1,2807 @@
+ ['Group' => 'Mass', 'Unit Name' => 'Gram', 'AllowPrefix' => true],
+ 'sg' => ['Group' => 'Mass', 'Unit Name' => 'Slug', 'AllowPrefix' => false],
+ 'lbm' => ['Group' => 'Mass', 'Unit Name' => 'Pound mass (avoirdupois)', 'AllowPrefix' => false],
+ 'u' => ['Group' => 'Mass', 'Unit Name' => 'U (atomic mass unit)', 'AllowPrefix' => true],
+ 'ozm' => ['Group' => 'Mass', 'Unit Name' => 'Ounce mass (avoirdupois)', 'AllowPrefix' => false],
+ 'm' => ['Group' => 'Distance', 'Unit Name' => 'Meter', 'AllowPrefix' => true],
+ 'mi' => ['Group' => 'Distance', 'Unit Name' => 'Statute mile', 'AllowPrefix' => false],
+ 'Nmi' => ['Group' => 'Distance', 'Unit Name' => 'Nautical mile', 'AllowPrefix' => false],
+ 'in' => ['Group' => 'Distance', 'Unit Name' => 'Inch', 'AllowPrefix' => false],
+ 'ft' => ['Group' => 'Distance', 'Unit Name' => 'Foot', 'AllowPrefix' => false],
+ 'yd' => ['Group' => 'Distance', 'Unit Name' => 'Yard', 'AllowPrefix' => false],
+ 'ang' => ['Group' => 'Distance', 'Unit Name' => 'Angstrom', 'AllowPrefix' => true],
+ 'Pica' => ['Group' => 'Distance', 'Unit Name' => 'Pica (1/72 in)', 'AllowPrefix' => false],
+ 'yr' => ['Group' => 'Time', 'Unit Name' => 'Year', 'AllowPrefix' => false],
+ 'day' => ['Group' => 'Time', 'Unit Name' => 'Day', 'AllowPrefix' => false],
+ 'hr' => ['Group' => 'Time', 'Unit Name' => 'Hour', 'AllowPrefix' => false],
+ 'mn' => ['Group' => 'Time', 'Unit Name' => 'Minute', 'AllowPrefix' => false],
+ 'sec' => ['Group' => 'Time', 'Unit Name' => 'Second', 'AllowPrefix' => true],
+ 'Pa' => ['Group' => 'Pressure', 'Unit Name' => 'Pascal', 'AllowPrefix' => true],
+ 'p' => ['Group' => 'Pressure', 'Unit Name' => 'Pascal', 'AllowPrefix' => true],
+ 'atm' => ['Group' => 'Pressure', 'Unit Name' => 'Atmosphere', 'AllowPrefix' => true],
+ 'at' => ['Group' => 'Pressure', 'Unit Name' => 'Atmosphere', 'AllowPrefix' => true],
+ 'mmHg' => ['Group' => 'Pressure', 'Unit Name' => 'mm of Mercury', 'AllowPrefix' => true],
+ 'N' => ['Group' => 'Force', 'Unit Name' => 'Newton', 'AllowPrefix' => true],
+ 'dyn' => ['Group' => 'Force', 'Unit Name' => 'Dyne', 'AllowPrefix' => true],
+ 'dy' => ['Group' => 'Force', 'Unit Name' => 'Dyne', 'AllowPrefix' => true],
+ 'lbf' => ['Group' => 'Force', 'Unit Name' => 'Pound force', 'AllowPrefix' => false],
+ 'J' => ['Group' => 'Energy', 'Unit Name' => 'Joule', 'AllowPrefix' => true],
+ 'e' => ['Group' => 'Energy', 'Unit Name' => 'Erg', 'AllowPrefix' => true],
+ 'c' => ['Group' => 'Energy', 'Unit Name' => 'Thermodynamic calorie', 'AllowPrefix' => true],
+ 'cal' => ['Group' => 'Energy', 'Unit Name' => 'IT calorie', 'AllowPrefix' => true],
+ 'eV' => ['Group' => 'Energy', 'Unit Name' => 'Electron volt', 'AllowPrefix' => true],
+ 'ev' => ['Group' => 'Energy', 'Unit Name' => 'Electron volt', 'AllowPrefix' => true],
+ 'HPh' => ['Group' => 'Energy', 'Unit Name' => 'Horsepower-hour', 'AllowPrefix' => false],
+ 'hh' => ['Group' => 'Energy', 'Unit Name' => 'Horsepower-hour', 'AllowPrefix' => false],
+ 'Wh' => ['Group' => 'Energy', 'Unit Name' => 'Watt-hour', 'AllowPrefix' => true],
+ 'wh' => ['Group' => 'Energy', 'Unit Name' => 'Watt-hour', 'AllowPrefix' => true],
+ 'flb' => ['Group' => 'Energy', 'Unit Name' => 'Foot-pound', 'AllowPrefix' => false],
+ 'BTU' => ['Group' => 'Energy', 'Unit Name' => 'BTU', 'AllowPrefix' => false],
+ 'btu' => ['Group' => 'Energy', 'Unit Name' => 'BTU', 'AllowPrefix' => false],
+ 'HP' => ['Group' => 'Power', 'Unit Name' => 'Horsepower', 'AllowPrefix' => false],
+ 'h' => ['Group' => 'Power', 'Unit Name' => 'Horsepower', 'AllowPrefix' => false],
+ 'W' => ['Group' => 'Power', 'Unit Name' => 'Watt', 'AllowPrefix' => true],
+ 'w' => ['Group' => 'Power', 'Unit Name' => 'Watt', 'AllowPrefix' => true],
+ 'T' => ['Group' => 'Magnetism', 'Unit Name' => 'Tesla', 'AllowPrefix' => true],
+ 'ga' => ['Group' => 'Magnetism', 'Unit Name' => 'Gauss', 'AllowPrefix' => true],
+ 'C' => ['Group' => 'Temperature', 'Unit Name' => 'Celsius', 'AllowPrefix' => false],
+ 'cel' => ['Group' => 'Temperature', 'Unit Name' => 'Celsius', 'AllowPrefix' => false],
+ 'F' => ['Group' => 'Temperature', 'Unit Name' => 'Fahrenheit', 'AllowPrefix' => false],
+ 'fah' => ['Group' => 'Temperature', 'Unit Name' => 'Fahrenheit', 'AllowPrefix' => false],
+ 'K' => ['Group' => 'Temperature', 'Unit Name' => 'Kelvin', 'AllowPrefix' => false],
+ 'kel' => ['Group' => 'Temperature', 'Unit Name' => 'Kelvin', 'AllowPrefix' => false],
+ 'tsp' => ['Group' => 'Liquid', 'Unit Name' => 'Teaspoon', 'AllowPrefix' => false],
+ 'tbs' => ['Group' => 'Liquid', 'Unit Name' => 'Tablespoon', 'AllowPrefix' => false],
+ 'oz' => ['Group' => 'Liquid', 'Unit Name' => 'Fluid Ounce', 'AllowPrefix' => false],
+ 'cup' => ['Group' => 'Liquid', 'Unit Name' => 'Cup', 'AllowPrefix' => false],
+ 'pt' => ['Group' => 'Liquid', 'Unit Name' => 'U.S. Pint', 'AllowPrefix' => false],
+ 'us_pt' => ['Group' => 'Liquid', 'Unit Name' => 'U.S. Pint', 'AllowPrefix' => false],
+ 'uk_pt' => ['Group' => 'Liquid', 'Unit Name' => 'U.K. Pint', 'AllowPrefix' => false],
+ 'qt' => ['Group' => 'Liquid', 'Unit Name' => 'Quart', 'AllowPrefix' => false],
+ 'gal' => ['Group' => 'Liquid', 'Unit Name' => 'Gallon', 'AllowPrefix' => false],
+ 'l' => ['Group' => 'Liquid', 'Unit Name' => 'Litre', 'AllowPrefix' => true],
+ 'lt' => ['Group' => 'Liquid', 'Unit Name' => 'Litre', 'AllowPrefix' => true],
+ ];
+
+ /**
+ * Details of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM().
+ *
+ * @var mixed[]
+ */
+ private static $conversionMultipliers = [
+ 'Y' => ['multiplier' => 1E24, 'name' => 'yotta'],
+ 'Z' => ['multiplier' => 1E21, 'name' => 'zetta'],
+ 'E' => ['multiplier' => 1E18, 'name' => 'exa'],
+ 'P' => ['multiplier' => 1E15, 'name' => 'peta'],
+ 'T' => ['multiplier' => 1E12, 'name' => 'tera'],
+ 'G' => ['multiplier' => 1E9, 'name' => 'giga'],
+ 'M' => ['multiplier' => 1E6, 'name' => 'mega'],
+ 'k' => ['multiplier' => 1E3, 'name' => 'kilo'],
+ 'h' => ['multiplier' => 1E2, 'name' => 'hecto'],
+ 'e' => ['multiplier' => 1E1, 'name' => 'deka'],
+ 'd' => ['multiplier' => 1E-1, 'name' => 'deci'],
+ 'c' => ['multiplier' => 1E-2, 'name' => 'centi'],
+ 'm' => ['multiplier' => 1E-3, 'name' => 'milli'],
+ 'u' => ['multiplier' => 1E-6, 'name' => 'micro'],
+ 'n' => ['multiplier' => 1E-9, 'name' => 'nano'],
+ 'p' => ['multiplier' => 1E-12, 'name' => 'pico'],
+ 'f' => ['multiplier' => 1E-15, 'name' => 'femto'],
+ 'a' => ['multiplier' => 1E-18, 'name' => 'atto'],
+ 'z' => ['multiplier' => 1E-21, 'name' => 'zepto'],
+ 'y' => ['multiplier' => 1E-24, 'name' => 'yocto'],
+ ];
+
+ /**
+ * Details of the Units of measure conversion factors, organised by group.
+ *
+ * @var mixed[]
+ */
+ private static $unitConversions = [
+ 'Mass' => [
+ 'g' => [
+ 'g' => 1.0,
+ 'sg' => 6.85220500053478E-05,
+ 'lbm' => 2.20462291469134E-03,
+ 'u' => 6.02217000000000E+23,
+ 'ozm' => 3.52739718003627E-02,
+ ],
+ 'sg' => [
+ 'g' => 1.45938424189287E+04,
+ 'sg' => 1.0,
+ 'lbm' => 3.21739194101647E+01,
+ 'u' => 8.78866000000000E+27,
+ 'ozm' => 5.14782785944229E+02,
+ ],
+ 'lbm' => [
+ 'g' => 4.5359230974881148E+02,
+ 'sg' => 3.10810749306493E-02,
+ 'lbm' => 1.0,
+ 'u' => 2.73161000000000E+26,
+ 'ozm' => 1.60000023429410E+01,
+ ],
+ 'u' => [
+ 'g' => 1.66053100460465E-24,
+ 'sg' => 1.13782988532950E-28,
+ 'lbm' => 3.66084470330684E-27,
+ 'u' => 1.0,
+ 'ozm' => 5.85735238300524E-26,
+ ],
+ 'ozm' => [
+ 'g' => 2.83495152079732E+01,
+ 'sg' => 1.94256689870811E-03,
+ 'lbm' => 6.24999908478882E-02,
+ 'u' => 1.70725600000000E+25,
+ 'ozm' => 1.0,
+ ],
+ ],
+ 'Distance' => [
+ 'm' => [
+ 'm' => 1.0,
+ 'mi' => 6.21371192237334E-04,
+ 'Nmi' => 5.39956803455724E-04,
+ 'in' => 3.93700787401575E+01,
+ 'ft' => 3.28083989501312E+00,
+ 'yd' => 1.09361329797891E+00,
+ 'ang' => 1.00000000000000E+10,
+ 'Pica' => 2.83464566929116E+03,
+ ],
+ 'mi' => [
+ 'm' => 1.60934400000000E+03,
+ 'mi' => 1.0,
+ 'Nmi' => 8.68976241900648E-01,
+ 'in' => 6.33600000000000E+04,
+ 'ft' => 5.28000000000000E+03,
+ 'yd' => 1.76000000000000E+03,
+ 'ang' => 1.60934400000000E+13,
+ 'Pica' => 4.56191999999971E+06,
+ ],
+ 'Nmi' => [
+ 'm' => 1.85200000000000E+03,
+ 'mi' => 1.15077944802354E+00,
+ 'Nmi' => 1.0,
+ 'in' => 7.29133858267717E+04,
+ 'ft' => 6.07611548556430E+03,
+ 'yd' => 2.02537182785694E+03,
+ 'ang' => 1.85200000000000E+13,
+ 'Pica' => 5.24976377952723E+06,
+ ],
+ 'in' => [
+ 'm' => 2.54000000000000E-02,
+ 'mi' => 1.57828282828283E-05,
+ 'Nmi' => 1.37149028077754E-05,
+ 'in' => 1.0,
+ 'ft' => 8.33333333333333E-02,
+ 'yd' => 2.77777777686643E-02,
+ 'ang' => 2.54000000000000E+08,
+ 'Pica' => 7.19999999999955E+01,
+ ],
+ 'ft' => [
+ 'm' => 3.04800000000000E-01,
+ 'mi' => 1.89393939393939E-04,
+ 'Nmi' => 1.64578833693305E-04,
+ 'in' => 1.20000000000000E+01,
+ 'ft' => 1.0,
+ 'yd' => 3.33333333223972E-01,
+ 'ang' => 3.04800000000000E+09,
+ 'Pica' => 8.63999999999946E+02,
+ ],
+ 'yd' => [
+ 'm' => 9.14400000300000E-01,
+ 'mi' => 5.68181818368230E-04,
+ 'Nmi' => 4.93736501241901E-04,
+ 'in' => 3.60000000118110E+01,
+ 'ft' => 3.00000000000000E+00,
+ 'yd' => 1.0,
+ 'ang' => 9.14400000300000E+09,
+ 'Pica' => 2.59200000085023E+03,
+ ],
+ 'ang' => [
+ 'm' => 1.00000000000000E-10,
+ 'mi' => 6.21371192237334E-14,
+ 'Nmi' => 5.39956803455724E-14,
+ 'in' => 3.93700787401575E-09,
+ 'ft' => 3.28083989501312E-10,
+ 'yd' => 1.09361329797891E-10,
+ 'ang' => 1.0,
+ 'Pica' => 2.83464566929116E-07,
+ ],
+ 'Pica' => [
+ 'm' => 3.52777777777800E-04,
+ 'mi' => 2.19205948372629E-07,
+ 'Nmi' => 1.90484761219114E-07,
+ 'in' => 1.38888888888898E-02,
+ 'ft' => 1.15740740740748E-03,
+ 'yd' => 3.85802469009251E-04,
+ 'ang' => 3.52777777777800E+06,
+ 'Pica' => 1.0,
+ ],
+ ],
+ 'Time' => [
+ 'yr' => [
+ 'yr' => 1.0,
+ 'day' => 365.25,
+ 'hr' => 8766.0,
+ 'mn' => 525960.0,
+ 'sec' => 31557600.0,
+ ],
+ 'day' => [
+ 'yr' => 2.73785078713210E-03,
+ 'day' => 1.0,
+ 'hr' => 24.0,
+ 'mn' => 1440.0,
+ 'sec' => 86400.0,
+ ],
+ 'hr' => [
+ 'yr' => 1.14077116130504E-04,
+ 'day' => 4.16666666666667E-02,
+ 'hr' => 1.0,
+ 'mn' => 60.0,
+ 'sec' => 3600.0,
+ ],
+ 'mn' => [
+ 'yr' => 1.90128526884174E-06,
+ 'day' => 6.94444444444444E-04,
+ 'hr' => 1.66666666666667E-02,
+ 'mn' => 1.0,
+ 'sec' => 60.0,
+ ],
+ 'sec' => [
+ 'yr' => 3.16880878140289E-08,
+ 'day' => 1.15740740740741E-05,
+ 'hr' => 2.77777777777778E-04,
+ 'mn' => 1.66666666666667E-02,
+ 'sec' => 1.0,
+ ],
+ ],
+ 'Pressure' => [
+ 'Pa' => [
+ 'Pa' => 1.0,
+ 'p' => 1.0,
+ 'atm' => 9.86923299998193E-06,
+ 'at' => 9.86923299998193E-06,
+ 'mmHg' => 7.50061707998627E-03,
+ ],
+ 'p' => [
+ 'Pa' => 1.0,
+ 'p' => 1.0,
+ 'atm' => 9.86923299998193E-06,
+ 'at' => 9.86923299998193E-06,
+ 'mmHg' => 7.50061707998627E-03,
+ ],
+ 'atm' => [
+ 'Pa' => 1.01324996583000E+05,
+ 'p' => 1.01324996583000E+05,
+ 'atm' => 1.0,
+ 'at' => 1.0,
+ 'mmHg' => 760.0,
+ ],
+ 'at' => [
+ 'Pa' => 1.01324996583000E+05,
+ 'p' => 1.01324996583000E+05,
+ 'atm' => 1.0,
+ 'at' => 1.0,
+ 'mmHg' => 760.0,
+ ],
+ 'mmHg' => [
+ 'Pa' => 1.33322363925000E+02,
+ 'p' => 1.33322363925000E+02,
+ 'atm' => 1.31578947368421E-03,
+ 'at' => 1.31578947368421E-03,
+ 'mmHg' => 1.0,
+ ],
+ ],
+ 'Force' => [
+ 'N' => [
+ 'N' => 1.0,
+ 'dyn' => 1.0E+5,
+ 'dy' => 1.0E+5,
+ 'lbf' => 2.24808923655339E-01,
+ ],
+ 'dyn' => [
+ 'N' => 1.0E-5,
+ 'dyn' => 1.0,
+ 'dy' => 1.0,
+ 'lbf' => 2.24808923655339E-06,
+ ],
+ 'dy' => [
+ 'N' => 1.0E-5,
+ 'dyn' => 1.0,
+ 'dy' => 1.0,
+ 'lbf' => 2.24808923655339E-06,
+ ],
+ 'lbf' => [
+ 'N' => 4.448222,
+ 'dyn' => 4.448222E+5,
+ 'dy' => 4.448222E+5,
+ 'lbf' => 1.0,
+ ],
+ ],
+ 'Energy' => [
+ 'J' => [
+ 'J' => 1.0,
+ 'e' => 9.99999519343231E+06,
+ 'c' => 2.39006249473467E-01,
+ 'cal' => 2.38846190642017E-01,
+ 'eV' => 6.24145700000000E+18,
+ 'ev' => 6.24145700000000E+18,
+ 'HPh' => 3.72506430801000E-07,
+ 'hh' => 3.72506430801000E-07,
+ 'Wh' => 2.77777916238711E-04,
+ 'wh' => 2.77777916238711E-04,
+ 'flb' => 2.37304222192651E+01,
+ 'BTU' => 9.47815067349015E-04,
+ 'btu' => 9.47815067349015E-04,
+ ],
+ 'e' => [
+ 'J' => 1.00000048065700E-07,
+ 'e' => 1.0,
+ 'c' => 2.39006364353494E-08,
+ 'cal' => 2.38846305445111E-08,
+ 'eV' => 6.24146000000000E+11,
+ 'ev' => 6.24146000000000E+11,
+ 'HPh' => 3.72506609848824E-14,
+ 'hh' => 3.72506609848824E-14,
+ 'Wh' => 2.77778049754611E-11,
+ 'wh' => 2.77778049754611E-11,
+ 'flb' => 2.37304336254586E-06,
+ 'BTU' => 9.47815522922962E-11,
+ 'btu' => 9.47815522922962E-11,
+ ],
+ 'c' => [
+ 'J' => 4.18399101363672E+00,
+ 'e' => 4.18398900257312E+07,
+ 'c' => 1.0,
+ 'cal' => 9.99330315287563E-01,
+ 'eV' => 2.61142000000000E+19,
+ 'ev' => 2.61142000000000E+19,
+ 'HPh' => 1.55856355899327E-06,
+ 'hh' => 1.55856355899327E-06,
+ 'Wh' => 1.16222030532950E-03,
+ 'wh' => 1.16222030532950E-03,
+ 'flb' => 9.92878733152102E+01,
+ 'BTU' => 3.96564972437776E-03,
+ 'btu' => 3.96564972437776E-03,
+ ],
+ 'cal' => [
+ 'J' => 4.18679484613929E+00,
+ 'e' => 4.18679283372801E+07,
+ 'c' => 1.00067013349059E+00,
+ 'cal' => 1.0,
+ 'eV' => 2.61317000000000E+19,
+ 'ev' => 2.61317000000000E+19,
+ 'HPh' => 1.55960800463137E-06,
+ 'hh' => 1.55960800463137E-06,
+ 'Wh' => 1.16299914807955E-03,
+ 'wh' => 1.16299914807955E-03,
+ 'flb' => 9.93544094443283E+01,
+ 'BTU' => 3.96830723907002E-03,
+ 'btu' => 3.96830723907002E-03,
+ ],
+ 'eV' => [
+ 'J' => 1.60219000146921E-19,
+ 'e' => 1.60218923136574E-12,
+ 'c' => 3.82933423195043E-20,
+ 'cal' => 3.82676978535648E-20,
+ 'eV' => 1.0,
+ 'ev' => 1.0,
+ 'HPh' => 5.96826078912344E-26,
+ 'hh' => 5.96826078912344E-26,
+ 'Wh' => 4.45053000026614E-23,
+ 'wh' => 4.45053000026614E-23,
+ 'flb' => 3.80206452103492E-18,
+ 'BTU' => 1.51857982414846E-22,
+ 'btu' => 1.51857982414846E-22,
+ ],
+ 'ev' => [
+ 'J' => 1.60219000146921E-19,
+ 'e' => 1.60218923136574E-12,
+ 'c' => 3.82933423195043E-20,
+ 'cal' => 3.82676978535648E-20,
+ 'eV' => 1.0,
+ 'ev' => 1.0,
+ 'HPh' => 5.96826078912344E-26,
+ 'hh' => 5.96826078912344E-26,
+ 'Wh' => 4.45053000026614E-23,
+ 'wh' => 4.45053000026614E-23,
+ 'flb' => 3.80206452103492E-18,
+ 'BTU' => 1.51857982414846E-22,
+ 'btu' => 1.51857982414846E-22,
+ ],
+ 'HPh' => [
+ 'J' => 2.68451741316170E+06,
+ 'e' => 2.68451612283024E+13,
+ 'c' => 6.41616438565991E+05,
+ 'cal' => 6.41186757845835E+05,
+ 'eV' => 1.67553000000000E+25,
+ 'ev' => 1.67553000000000E+25,
+ 'HPh' => 1.0,
+ 'hh' => 1.0,
+ 'Wh' => 7.45699653134593E+02,
+ 'wh' => 7.45699653134593E+02,
+ 'flb' => 6.37047316692964E+07,
+ 'BTU' => 2.54442605275546E+03,
+ 'btu' => 2.54442605275546E+03,
+ ],
+ 'hh' => [
+ 'J' => 2.68451741316170E+06,
+ 'e' => 2.68451612283024E+13,
+ 'c' => 6.41616438565991E+05,
+ 'cal' => 6.41186757845835E+05,
+ 'eV' => 1.67553000000000E+25,
+ 'ev' => 1.67553000000000E+25,
+ 'HPh' => 1.0,
+ 'hh' => 1.0,
+ 'Wh' => 7.45699653134593E+02,
+ 'wh' => 7.45699653134593E+02,
+ 'flb' => 6.37047316692964E+07,
+ 'BTU' => 2.54442605275546E+03,
+ 'btu' => 2.54442605275546E+03,
+ ],
+ 'Wh' => [
+ 'J' => 3.59999820554720E+03,
+ 'e' => 3.59999647518369E+10,
+ 'c' => 8.60422069219046E+02,
+ 'cal' => 8.59845857713046E+02,
+ 'eV' => 2.24692340000000E+22,
+ 'ev' => 2.24692340000000E+22,
+ 'HPh' => 1.34102248243839E-03,
+ 'hh' => 1.34102248243839E-03,
+ 'Wh' => 1.0,
+ 'wh' => 1.0,
+ 'flb' => 8.54294774062316E+04,
+ 'BTU' => 3.41213254164705E+00,
+ 'btu' => 3.41213254164705E+00,
+ ],
+ 'wh' => [
+ 'J' => 3.59999820554720E+03,
+ 'e' => 3.59999647518369E+10,
+ 'c' => 8.60422069219046E+02,
+ 'cal' => 8.59845857713046E+02,
+ 'eV' => 2.24692340000000E+22,
+ 'ev' => 2.24692340000000E+22,
+ 'HPh' => 1.34102248243839E-03,
+ 'hh' => 1.34102248243839E-03,
+ 'Wh' => 1.0,
+ 'wh' => 1.0,
+ 'flb' => 8.54294774062316E+04,
+ 'BTU' => 3.41213254164705E+00,
+ 'btu' => 3.41213254164705E+00,
+ ],
+ 'flb' => [
+ 'J' => 4.21400003236424E-02,
+ 'e' => 4.21399800687660E+05,
+ 'c' => 1.00717234301644E-02,
+ 'cal' => 1.00649785509554E-02,
+ 'eV' => 2.63015000000000E+17,
+ 'ev' => 2.63015000000000E+17,
+ 'HPh' => 1.56974211145130E-08,
+ 'hh' => 1.56974211145130E-08,
+ 'Wh' => 1.17055614802000E-05,
+ 'wh' => 1.17055614802000E-05,
+ 'flb' => 1.0,
+ 'BTU' => 3.99409272448406E-05,
+ 'btu' => 3.99409272448406E-05,
+ ],
+ 'BTU' => [
+ 'J' => 1.05505813786749E+03,
+ 'e' => 1.05505763074665E+10,
+ 'c' => 2.52165488508168E+02,
+ 'cal' => 2.51996617135510E+02,
+ 'eV' => 6.58510000000000E+21,
+ 'ev' => 6.58510000000000E+21,
+ 'HPh' => 3.93015941224568E-04,
+ 'hh' => 3.93015941224568E-04,
+ 'Wh' => 2.93071851047526E-01,
+ 'wh' => 2.93071851047526E-01,
+ 'flb' => 2.50369750774671E+04,
+ 'BTU' => 1.0,
+ 'btu' => 1.0,
+ ],
+ 'btu' => [
+ 'J' => 1.05505813786749E+03,
+ 'e' => 1.05505763074665E+10,
+ 'c' => 2.52165488508168E+02,
+ 'cal' => 2.51996617135510E+02,
+ 'eV' => 6.58510000000000E+21,
+ 'ev' => 6.58510000000000E+21,
+ 'HPh' => 3.93015941224568E-04,
+ 'hh' => 3.93015941224568E-04,
+ 'Wh' => 2.93071851047526E-01,
+ 'wh' => 2.93071851047526E-01,
+ 'flb' => 2.50369750774671E+04,
+ 'BTU' => 1.0,
+ 'btu' => 1.0,
+ ],
+ ],
+ 'Power' => [
+ 'HP' => [
+ 'HP' => 1.0,
+ 'h' => 1.0,
+ 'W' => 7.45701000000000E+02,
+ 'w' => 7.45701000000000E+02,
+ ],
+ 'h' => [
+ 'HP' => 1.0,
+ 'h' => 1.0,
+ 'W' => 7.45701000000000E+02,
+ 'w' => 7.45701000000000E+02,
+ ],
+ 'W' => [
+ 'HP' => 1.34102006031908E-03,
+ 'h' => 1.34102006031908E-03,
+ 'W' => 1.0,
+ 'w' => 1.0,
+ ],
+ 'w' => [
+ 'HP' => 1.34102006031908E-03,
+ 'h' => 1.34102006031908E-03,
+ 'W' => 1.0,
+ 'w' => 1.0,
+ ],
+ ],
+ 'Magnetism' => [
+ 'T' => [
+ 'T' => 1.0,
+ 'ga' => 10000.0,
+ ],
+ 'ga' => [
+ 'T' => 0.0001,
+ 'ga' => 1.0,
+ ],
+ ],
+ 'Liquid' => [
+ 'tsp' => [
+ 'tsp' => 1.0,
+ 'tbs' => 3.33333333333333E-01,
+ 'oz' => 1.66666666666667E-01,
+ 'cup' => 2.08333333333333E-02,
+ 'pt' => 1.04166666666667E-02,
+ 'us_pt' => 1.04166666666667E-02,
+ 'uk_pt' => 8.67558516821960E-03,
+ 'qt' => 5.20833333333333E-03,
+ 'gal' => 1.30208333333333E-03,
+ 'l' => 4.92999408400710E-03,
+ 'lt' => 4.92999408400710E-03,
+ ],
+ 'tbs' => [
+ 'tsp' => 3.00000000000000E+00,
+ 'tbs' => 1.0,
+ 'oz' => 5.00000000000000E-01,
+ 'cup' => 6.25000000000000E-02,
+ 'pt' => 3.12500000000000E-02,
+ 'us_pt' => 3.12500000000000E-02,
+ 'uk_pt' => 2.60267555046588E-02,
+ 'qt' => 1.56250000000000E-02,
+ 'gal' => 3.90625000000000E-03,
+ 'l' => 1.47899822520213E-02,
+ 'lt' => 1.47899822520213E-02,
+ ],
+ 'oz' => [
+ 'tsp' => 6.00000000000000E+00,
+ 'tbs' => 2.00000000000000E+00,
+ 'oz' => 1.0,
+ 'cup' => 1.25000000000000E-01,
+ 'pt' => 6.25000000000000E-02,
+ 'us_pt' => 6.25000000000000E-02,
+ 'uk_pt' => 5.20535110093176E-02,
+ 'qt' => 3.12500000000000E-02,
+ 'gal' => 7.81250000000000E-03,
+ 'l' => 2.95799645040426E-02,
+ 'lt' => 2.95799645040426E-02,
+ ],
+ 'cup' => [
+ 'tsp' => 4.80000000000000E+01,
+ 'tbs' => 1.60000000000000E+01,
+ 'oz' => 8.00000000000000E+00,
+ 'cup' => 1.0,
+ 'pt' => 5.00000000000000E-01,
+ 'us_pt' => 5.00000000000000E-01,
+ 'uk_pt' => 4.16428088074541E-01,
+ 'qt' => 2.50000000000000E-01,
+ 'gal' => 6.25000000000000E-02,
+ 'l' => 2.36639716032341E-01,
+ 'lt' => 2.36639716032341E-01,
+ ],
+ 'pt' => [
+ 'tsp' => 9.60000000000000E+01,
+ 'tbs' => 3.20000000000000E+01,
+ 'oz' => 1.60000000000000E+01,
+ 'cup' => 2.00000000000000E+00,
+ 'pt' => 1.0,
+ 'us_pt' => 1.0,
+ 'uk_pt' => 8.32856176149081E-01,
+ 'qt' => 5.00000000000000E-01,
+ 'gal' => 1.25000000000000E-01,
+ 'l' => 4.73279432064682E-01,
+ 'lt' => 4.73279432064682E-01,
+ ],
+ 'us_pt' => [
+ 'tsp' => 9.60000000000000E+01,
+ 'tbs' => 3.20000000000000E+01,
+ 'oz' => 1.60000000000000E+01,
+ 'cup' => 2.00000000000000E+00,
+ 'pt' => 1.0,
+ 'us_pt' => 1.0,
+ 'uk_pt' => 8.32856176149081E-01,
+ 'qt' => 5.00000000000000E-01,
+ 'gal' => 1.25000000000000E-01,
+ 'l' => 4.73279432064682E-01,
+ 'lt' => 4.73279432064682E-01,
+ ],
+ 'uk_pt' => [
+ 'tsp' => 1.15266000000000E+02,
+ 'tbs' => 3.84220000000000E+01,
+ 'oz' => 1.92110000000000E+01,
+ 'cup' => 2.40137500000000E+00,
+ 'pt' => 1.20068750000000E+00,
+ 'us_pt' => 1.20068750000000E+00,
+ 'uk_pt' => 1.0,
+ 'qt' => 6.00343750000000E-01,
+ 'gal' => 1.50085937500000E-01,
+ 'l' => 5.68260698087162E-01,
+ 'lt' => 5.68260698087162E-01,
+ ],
+ 'qt' => [
+ 'tsp' => 1.92000000000000E+02,
+ 'tbs' => 6.40000000000000E+01,
+ 'oz' => 3.20000000000000E+01,
+ 'cup' => 4.00000000000000E+00,
+ 'pt' => 2.00000000000000E+00,
+ 'us_pt' => 2.00000000000000E+00,
+ 'uk_pt' => 1.66571235229816E+00,
+ 'qt' => 1.0,
+ 'gal' => 2.50000000000000E-01,
+ 'l' => 9.46558864129363E-01,
+ 'lt' => 9.46558864129363E-01,
+ ],
+ 'gal' => [
+ 'tsp' => 7.68000000000000E+02,
+ 'tbs' => 2.56000000000000E+02,
+ 'oz' => 1.28000000000000E+02,
+ 'cup' => 1.60000000000000E+01,
+ 'pt' => 8.00000000000000E+00,
+ 'us_pt' => 8.00000000000000E+00,
+ 'uk_pt' => 6.66284940919265E+00,
+ 'qt' => 4.00000000000000E+00,
+ 'gal' => 1.0,
+ 'l' => 3.78623545651745E+00,
+ 'lt' => 3.78623545651745E+00,
+ ],
+ 'l' => [
+ 'tsp' => 2.02840000000000E+02,
+ 'tbs' => 6.76133333333333E+01,
+ 'oz' => 3.38066666666667E+01,
+ 'cup' => 4.22583333333333E+00,
+ 'pt' => 2.11291666666667E+00,
+ 'us_pt' => 2.11291666666667E+00,
+ 'uk_pt' => 1.75975569552166E+00,
+ 'qt' => 1.05645833333333E+00,
+ 'gal' => 2.64114583333333E-01,
+ 'l' => 1.0,
+ 'lt' => 1.0,
+ ],
+ 'lt' => [
+ 'tsp' => 2.02840000000000E+02,
+ 'tbs' => 6.76133333333333E+01,
+ 'oz' => 3.38066666666667E+01,
+ 'cup' => 4.22583333333333E+00,
+ 'pt' => 2.11291666666667E+00,
+ 'us_pt' => 2.11291666666667E+00,
+ 'uk_pt' => 1.75975569552166E+00,
+ 'qt' => 1.05645833333333E+00,
+ 'gal' => 2.64114583333333E-01,
+ 'l' => 1.0,
+ 'lt' => 1.0,
+ ],
+ ],
+ ];
+
+ /**
+ * parseComplex.
+ *
+ * Parses a complex number into its real and imaginary parts, and an I or J suffix
+ *
+ * @deprecated 2.0.0 No longer used by internal code. Please use the Complex\Complex class instead
+ *
+ * @param string $complexNumber The complex number
+ *
+ * @return mixed[] Indexed on "real", "imaginary" and "suffix"
+ */
+ public static function parseComplex($complexNumber)
+ {
+ $complex = new Complex($complexNumber);
+
+ return [
+ 'real' => $complex->getReal(),
+ 'imaginary' => $complex->getImaginary(),
+ 'suffix' => $complex->getSuffix(),
+ ];
+ }
+
+ /**
+ * Formats a number base string value with leading zeroes.
+ *
+ * @param string $xVal The "number" to pad
+ * @param int $places The length that we want to pad this value
+ *
+ * @return string The padded "number"
+ */
+ private static function nbrConversionFormat($xVal, $places)
+ {
+ if ($places !== null) {
+ if (is_numeric($places)) {
+ $places = (int) $places;
+ } else {
+ return Functions::VALUE();
+ }
+ if ($places < 0) {
+ return Functions::NAN();
+ }
+ if (strlen($xVal) <= $places) {
+ return substr(str_pad($xVal, $places, '0', STR_PAD_LEFT), -10);
+ }
+
+ return Functions::NAN();
+ }
+
+ return substr($xVal, -10);
+ }
+
+ /**
+ * BESSELI.
+ *
+ * Returns the modified Bessel function In(x), which is equivalent to the Bessel function evaluated
+ * for purely imaginary arguments
+ *
+ * Excel Function:
+ * BESSELI(x,ord)
+ *
+ * @category Engineering Functions
+ *
+ * @param float $x The value at which to evaluate the function.
+ * If x is nonnumeric, BESSELI returns the #VALUE! error value.
+ * @param int $ord The order of the Bessel function.
+ * If ord is not an integer, it is truncated.
+ * If $ord is nonnumeric, BESSELI returns the #VALUE! error value.
+ * If $ord < 0, BESSELI returns the #NUM! error value.
+ *
+ * @return float
+ */
+ public static function BESSELI($x, $ord)
+ {
+ $x = ($x === null) ? 0.0 : Functions::flattenSingleValue($x);
+ $ord = ($ord === null) ? 0.0 : Functions::flattenSingleValue($ord);
+
+ if ((is_numeric($x)) && (is_numeric($ord))) {
+ $ord = floor($ord);
+ if ($ord < 0) {
+ return Functions::NAN();
+ }
+
+ if (abs($x) <= 30) {
+ $fResult = $fTerm = pow($x / 2, $ord) / MathTrig::FACT($ord);
+ $ordK = 1;
+ $fSqrX = ($x * $x) / 4;
+ do {
+ $fTerm *= $fSqrX;
+ $fTerm /= ($ordK * ($ordK + $ord));
+ $fResult += $fTerm;
+ } while ((abs($fTerm) > 1e-12) && (++$ordK < 100));
+ } else {
+ $f_2_PI = 2 * M_PI;
+
+ $fXAbs = abs($x);
+ $fResult = exp($fXAbs) / sqrt($f_2_PI * $fXAbs);
+ if (($ord & 1) && ($x < 0)) {
+ $fResult = -$fResult;
+ }
+ }
+
+ return (is_nan($fResult)) ? Functions::NAN() : $fResult;
+ }
+
+ return Functions::VALUE();
+ }
+
+ /**
+ * BESSELJ.
+ *
+ * Returns the Bessel function
+ *
+ * Excel Function:
+ * BESSELJ(x,ord)
+ *
+ * @category Engineering Functions
+ *
+ * @param float $x The value at which to evaluate the function.
+ * If x is nonnumeric, BESSELJ returns the #VALUE! error value.
+ * @param int $ord The order of the Bessel function. If n is not an integer, it is truncated.
+ * If $ord is nonnumeric, BESSELJ returns the #VALUE! error value.
+ * If $ord < 0, BESSELJ returns the #NUM! error value.
+ *
+ * @return float
+ */
+ public static function BESSELJ($x, $ord)
+ {
+ $x = ($x === null) ? 0.0 : Functions::flattenSingleValue($x);
+ $ord = ($ord === null) ? 0.0 : Functions::flattenSingleValue($ord);
+
+ if ((is_numeric($x)) && (is_numeric($ord))) {
+ $ord = floor($ord);
+ if ($ord < 0) {
+ return Functions::NAN();
+ }
+
+ $fResult = 0;
+ if (abs($x) <= 30) {
+ $fResult = $fTerm = pow($x / 2, $ord) / MathTrig::FACT($ord);
+ $ordK = 1;
+ $fSqrX = ($x * $x) / -4;
+ do {
+ $fTerm *= $fSqrX;
+ $fTerm /= ($ordK * ($ordK + $ord));
+ $fResult += $fTerm;
+ } while ((abs($fTerm) > 1e-12) && (++$ordK < 100));
+ } else {
+ $f_PI_DIV_2 = M_PI / 2;
+ $f_PI_DIV_4 = M_PI / 4;
+
+ $fXAbs = abs($x);
+ $fResult = sqrt(Functions::M_2DIVPI / $fXAbs) * cos($fXAbs - $ord * $f_PI_DIV_2 - $f_PI_DIV_4);
+ if (($ord & 1) && ($x < 0)) {
+ $fResult = -$fResult;
+ }
+ }
+
+ return (is_nan($fResult)) ? Functions::NAN() : $fResult;
+ }
+
+ return Functions::VALUE();
+ }
+
+ private static function besselK0($fNum)
+ {
+ if ($fNum <= 2) {
+ $fNum2 = $fNum * 0.5;
+ $y = ($fNum2 * $fNum2);
+ $fRet = -log($fNum2) * self::BESSELI($fNum, 0) +
+ (-0.57721566 + $y * (0.42278420 + $y * (0.23069756 + $y * (0.3488590e-1 + $y * (0.262698e-2 + $y *
+ (0.10750e-3 + $y * 0.74e-5))))));
+ } else {
+ $y = 2 / $fNum;
+ $fRet = exp(-$fNum) / sqrt($fNum) *
+ (1.25331414 + $y * (-0.7832358e-1 + $y * (0.2189568e-1 + $y * (-0.1062446e-1 + $y *
+ (0.587872e-2 + $y * (-0.251540e-2 + $y * 0.53208e-3))))));
+ }
+
+ return $fRet;
+ }
+
+ private static function besselK1($fNum)
+ {
+ if ($fNum <= 2) {
+ $fNum2 = $fNum * 0.5;
+ $y = ($fNum2 * $fNum2);
+ $fRet = log($fNum2) * self::BESSELI($fNum, 1) +
+ (1 + $y * (0.15443144 + $y * (-0.67278579 + $y * (-0.18156897 + $y * (-0.1919402e-1 + $y *
+ (-0.110404e-2 + $y * (-0.4686e-4))))))) / $fNum;
+ } else {
+ $y = 2 / $fNum;
+ $fRet = exp(-$fNum) / sqrt($fNum) *
+ (1.25331414 + $y * (0.23498619 + $y * (-0.3655620e-1 + $y * (0.1504268e-1 + $y * (-0.780353e-2 + $y *
+ (0.325614e-2 + $y * (-0.68245e-3)))))));
+ }
+
+ return $fRet;
+ }
+
+ /**
+ * BESSELK.
+ *
+ * Returns the modified Bessel function Kn(x), which is equivalent to the Bessel functions evaluated
+ * for purely imaginary arguments.
+ *
+ * Excel Function:
+ * BESSELK(x,ord)
+ *
+ * @category Engineering Functions
+ *
+ * @param float $x The value at which to evaluate the function.
+ * If x is nonnumeric, BESSELK returns the #VALUE! error value.
+ * @param int $ord The order of the Bessel function. If n is not an integer, it is truncated.
+ * If $ord is nonnumeric, BESSELK returns the #VALUE! error value.
+ * If $ord < 0, BESSELK returns the #NUM! error value.
+ *
+ * @return float
+ */
+ public static function BESSELK($x, $ord)
+ {
+ $x = ($x === null) ? 0.0 : Functions::flattenSingleValue($x);
+ $ord = ($ord === null) ? 0.0 : Functions::flattenSingleValue($ord);
+
+ if ((is_numeric($x)) && (is_numeric($ord))) {
+ if (($ord < 0) || ($x == 0.0)) {
+ return Functions::NAN();
+ }
+
+ switch (floor($ord)) {
+ case 0:
+ $fBk = self::besselK0($x);
+
+ break;
+ case 1:
+ $fBk = self::besselK1($x);
+
+ break;
+ default:
+ $fTox = 2 / $x;
+ $fBkm = self::besselK0($x);
+ $fBk = self::besselK1($x);
+ for ($n = 1; $n < $ord; ++$n) {
+ $fBkp = $fBkm + $n * $fTox * $fBk;
+ $fBkm = $fBk;
+ $fBk = $fBkp;
+ }
+ }
+
+ return (is_nan($fBk)) ? Functions::NAN() : $fBk;
+ }
+
+ return Functions::VALUE();
+ }
+
+ private static function besselY0($fNum)
+ {
+ if ($fNum < 8.0) {
+ $y = ($fNum * $fNum);
+ $f1 = -2957821389.0 + $y * (7062834065.0 + $y * (-512359803.6 + $y * (10879881.29 + $y * (-86327.92757 + $y * 228.4622733))));
+ $f2 = 40076544269.0 + $y * (745249964.8 + $y * (7189466.438 + $y * (47447.26470 + $y * (226.1030244 + $y))));
+ $fRet = $f1 / $f2 + 0.636619772 * self::BESSELJ($fNum, 0) * log($fNum);
+ } else {
+ $z = 8.0 / $fNum;
+ $y = ($z * $z);
+ $xx = $fNum - 0.785398164;
+ $f1 = 1 + $y * (-0.1098628627e-2 + $y * (0.2734510407e-4 + $y * (-0.2073370639e-5 + $y * 0.2093887211e-6)));
+ $f2 = -0.1562499995e-1 + $y * (0.1430488765e-3 + $y * (-0.6911147651e-5 + $y * (0.7621095161e-6 + $y * (-0.934945152e-7))));
+ $fRet = sqrt(0.636619772 / $fNum) * (sin($xx) * $f1 + $z * cos($xx) * $f2);
+ }
+
+ return $fRet;
+ }
+
+ private static function besselY1($fNum)
+ {
+ if ($fNum < 8.0) {
+ $y = ($fNum * $fNum);
+ $f1 = $fNum * (-0.4900604943e13 + $y * (0.1275274390e13 + $y * (-0.5153438139e11 + $y * (0.7349264551e9 + $y *
+ (-0.4237922726e7 + $y * 0.8511937935e4)))));
+ $f2 = 0.2499580570e14 + $y * (0.4244419664e12 + $y * (0.3733650367e10 + $y * (0.2245904002e8 + $y *
+ (0.1020426050e6 + $y * (0.3549632885e3 + $y)))));
+ $fRet = $f1 / $f2 + 0.636619772 * (self::BESSELJ($fNum, 1) * log($fNum) - 1 / $fNum);
+ } else {
+ $fRet = sqrt(0.636619772 / $fNum) * sin($fNum - 2.356194491);
+ }
+
+ return $fRet;
+ }
+
+ /**
+ * BESSELY.
+ *
+ * Returns the Bessel function, which is also called the Weber function or the Neumann function.
+ *
+ * Excel Function:
+ * BESSELY(x,ord)
+ *
+ * @category Engineering Functions
+ *
+ * @param float $x The value at which to evaluate the function.
+ * If x is nonnumeric, BESSELK returns the #VALUE! error value.
+ * @param int $ord The order of the Bessel function. If n is not an integer, it is truncated.
+ * If $ord is nonnumeric, BESSELK returns the #VALUE! error value.
+ * If $ord < 0, BESSELK returns the #NUM! error value.
+ *
+ * @return float
+ */
+ public static function BESSELY($x, $ord)
+ {
+ $x = ($x === null) ? 0.0 : Functions::flattenSingleValue($x);
+ $ord = ($ord === null) ? 0.0 : Functions::flattenSingleValue($ord);
+
+ if ((is_numeric($x)) && (is_numeric($ord))) {
+ if (($ord < 0) || ($x == 0.0)) {
+ return Functions::NAN();
+ }
+
+ switch (floor($ord)) {
+ case 0:
+ $fBy = self::besselY0($x);
+
+ break;
+ case 1:
+ $fBy = self::besselY1($x);
+
+ break;
+ default:
+ $fTox = 2 / $x;
+ $fBym = self::besselY0($x);
+ $fBy = self::besselY1($x);
+ for ($n = 1; $n < $ord; ++$n) {
+ $fByp = $n * $fTox * $fBy - $fBym;
+ $fBym = $fBy;
+ $fBy = $fByp;
+ }
+ }
+
+ return (is_nan($fBy)) ? Functions::NAN() : $fBy;
+ }
+
+ return Functions::VALUE();
+ }
+
+ /**
+ * BINTODEC.
+ *
+ * Return a binary value as decimal.
+ *
+ * Excel Function:
+ * BIN2DEC(x)
+ *
+ * @category Engineering Functions
+ *
+ * @param string $x The binary number (as a string) that you want to convert. The number
+ * cannot contain more than 10 characters (10 bits). The most significant
+ * bit of number is the sign bit. The remaining 9 bits are magnitude bits.
+ * Negative numbers are represented using two's-complement notation.
+ * If number is not a valid binary number, or if number contains more than
+ * 10 characters (10 bits), BIN2DEC returns the #NUM! error value.
+ *
+ * @return string
+ */
+ public static function BINTODEC($x)
+ {
+ $x = Functions::flattenSingleValue($x);
+
+ if (is_bool($x)) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
+ $x = (int) $x;
+ } else {
+ return Functions::VALUE();
+ }
+ }
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) {
+ $x = floor($x);
+ }
+ $x = (string) $x;
+ if (strlen($x) > preg_match_all('/[01]/', $x, $out)) {
+ return Functions::NAN();
+ }
+ if (strlen($x) > 10) {
+ return Functions::NAN();
+ } elseif (strlen($x) == 10) {
+ // Two's Complement
+ $x = substr($x, -9);
+
+ return '-' . (512 - bindec($x));
+ }
+
+ return bindec($x);
+ }
+
+ /**
+ * BINTOHEX.
+ *
+ * Return a binary value as hex.
+ *
+ * Excel Function:
+ * BIN2HEX(x[,places])
+ *
+ * @category Engineering Functions
+ *
+ * @param string $x The binary number (as a string) that you want to convert. The number
+ * cannot contain more than 10 characters (10 bits). The most significant
+ * bit of number is the sign bit. The remaining 9 bits are magnitude bits.
+ * Negative numbers are represented using two's-complement notation.
+ * If number is not a valid binary number, or if number contains more than
+ * 10 characters (10 bits), BIN2HEX returns the #NUM! error value.
+ * @param int $places The number of characters to use. If places is omitted, BIN2HEX uses the
+ * minimum number of characters necessary. Places is useful for padding the
+ * return value with leading 0s (zeros).
+ * If places is not an integer, it is truncated.
+ * If places is nonnumeric, BIN2HEX returns the #VALUE! error value.
+ * If places is negative, BIN2HEX returns the #NUM! error value.
+ *
+ * @return string
+ */
+ public static function BINTOHEX($x, $places = null)
+ {
+ $x = Functions::flattenSingleValue($x);
+ $places = Functions::flattenSingleValue($places);
+
+ // Argument X
+ if (is_bool($x)) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
+ $x = (int) $x;
+ } else {
+ return Functions::VALUE();
+ }
+ }
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) {
+ $x = floor($x);
+ }
+ $x = (string) $x;
+ if (strlen($x) > preg_match_all('/[01]/', $x, $out)) {
+ return Functions::NAN();
+ }
+ if (strlen($x) > 10) {
+ return Functions::NAN();
+ } elseif (strlen($x) == 10) {
+ // Two's Complement
+ return str_repeat('F', 8) . substr(strtoupper(dechex(bindec(substr($x, -9)))), -2);
+ }
+ $hexVal = (string) strtoupper(dechex(bindec($x)));
+
+ return self::nbrConversionFormat($hexVal, $places);
+ }
+
+ /**
+ * BINTOOCT.
+ *
+ * Return a binary value as octal.
+ *
+ * Excel Function:
+ * BIN2OCT(x[,places])
+ *
+ * @category Engineering Functions
+ *
+ * @param string $x The binary number (as a string) that you want to convert. The number
+ * cannot contain more than 10 characters (10 bits). The most significant
+ * bit of number is the sign bit. The remaining 9 bits are magnitude bits.
+ * Negative numbers are represented using two's-complement notation.
+ * If number is not a valid binary number, or if number contains more than
+ * 10 characters (10 bits), BIN2OCT returns the #NUM! error value.
+ * @param int $places The number of characters to use. If places is omitted, BIN2OCT uses the
+ * minimum number of characters necessary. Places is useful for padding the
+ * return value with leading 0s (zeros).
+ * If places is not an integer, it is truncated.
+ * If places is nonnumeric, BIN2OCT returns the #VALUE! error value.
+ * If places is negative, BIN2OCT returns the #NUM! error value.
+ *
+ * @return string
+ */
+ public static function BINTOOCT($x, $places = null)
+ {
+ $x = Functions::flattenSingleValue($x);
+ $places = Functions::flattenSingleValue($places);
+
+ if (is_bool($x)) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
+ $x = (int) $x;
+ } else {
+ return Functions::VALUE();
+ }
+ }
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) {
+ $x = floor($x);
+ }
+ $x = (string) $x;
+ if (strlen($x) > preg_match_all('/[01]/', $x, $out)) {
+ return Functions::NAN();
+ }
+ if (strlen($x) > 10) {
+ return Functions::NAN();
+ } elseif (strlen($x) == 10) {
+ // Two's Complement
+ return str_repeat('7', 7) . substr(strtoupper(decoct(bindec(substr($x, -9)))), -3);
+ }
+ $octVal = (string) decoct(bindec($x));
+
+ return self::nbrConversionFormat($octVal, $places);
+ }
+
+ /**
+ * DECTOBIN.
+ *
+ * Return a decimal value as binary.
+ *
+ * Excel Function:
+ * DEC2BIN(x[,places])
+ *
+ * @category Engineering Functions
+ *
+ * @param string $x The decimal integer you want to convert. If number is negative,
+ * valid place values are ignored and DEC2BIN returns a 10-character
+ * (10-bit) binary number in which the most significant bit is the sign
+ * bit. The remaining 9 bits are magnitude bits. Negative numbers are
+ * represented using two's-complement notation.
+ * If number < -512 or if number > 511, DEC2BIN returns the #NUM! error
+ * value.
+ * If number is nonnumeric, DEC2BIN returns the #VALUE! error value.
+ * If DEC2BIN requires more than places characters, it returns the #NUM!
+ * error value.
+ * @param int $places The number of characters to use. If places is omitted, DEC2BIN uses
+ * the minimum number of characters necessary. Places is useful for
+ * padding the return value with leading 0s (zeros).
+ * If places is not an integer, it is truncated.
+ * If places is nonnumeric, DEC2BIN returns the #VALUE! error value.
+ * If places is zero or negative, DEC2BIN returns the #NUM! error value.
+ *
+ * @return string
+ */
+ public static function DECTOBIN($x, $places = null)
+ {
+ $x = Functions::flattenSingleValue($x);
+ $places = Functions::flattenSingleValue($places);
+
+ if (is_bool($x)) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
+ $x = (int) $x;
+ } else {
+ return Functions::VALUE();
+ }
+ }
+ $x = (string) $x;
+ if (strlen($x) > preg_match_all('/[-0123456789.]/', $x, $out)) {
+ return Functions::VALUE();
+ }
+
+ $x = (string) floor($x);
+ if ($x < -512 || $x > 511) {
+ return Functions::NAN();
+ }
+
+ $r = decbin($x);
+ // Two's Complement
+ $r = substr($r, -10);
+ if (strlen($r) >= 11) {
+ return Functions::NAN();
+ }
+
+ return self::nbrConversionFormat($r, $places);
+ }
+
+ /**
+ * DECTOHEX.
+ *
+ * Return a decimal value as hex.
+ *
+ * Excel Function:
+ * DEC2HEX(x[,places])
+ *
+ * @category Engineering Functions
+ *
+ * @param string $x The decimal integer you want to convert. If number is negative,
+ * places is ignored and DEC2HEX returns a 10-character (40-bit)
+ * hexadecimal number in which the most significant bit is the sign
+ * bit. The remaining 39 bits are magnitude bits. Negative numbers
+ * are represented using two's-complement notation.
+ * If number < -549,755,813,888 or if number > 549,755,813,887,
+ * DEC2HEX returns the #NUM! error value.
+ * If number is nonnumeric, DEC2HEX returns the #VALUE! error value.
+ * If DEC2HEX requires more than places characters, it returns the
+ * #NUM! error value.
+ * @param int $places The number of characters to use. If places is omitted, DEC2HEX uses
+ * the minimum number of characters necessary. Places is useful for
+ * padding the return value with leading 0s (zeros).
+ * If places is not an integer, it is truncated.
+ * If places is nonnumeric, DEC2HEX returns the #VALUE! error value.
+ * If places is zero or negative, DEC2HEX returns the #NUM! error value.
+ *
+ * @return string
+ */
+ public static function DECTOHEX($x, $places = null)
+ {
+ $x = Functions::flattenSingleValue($x);
+ $places = Functions::flattenSingleValue($places);
+
+ if (is_bool($x)) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
+ $x = (int) $x;
+ } else {
+ return Functions::VALUE();
+ }
+ }
+ $x = (string) $x;
+ if (strlen($x) > preg_match_all('/[-0123456789.]/', $x, $out)) {
+ return Functions::VALUE();
+ }
+ $x = (string) floor($x);
+ $r = strtoupper(dechex($x));
+ if (strlen($r) == 8) {
+ // Two's Complement
+ $r = 'FF' . $r;
+ }
+
+ return self::nbrConversionFormat($r, $places);
+ }
+
+ /**
+ * DECTOOCT.
+ *
+ * Return an decimal value as octal.
+ *
+ * Excel Function:
+ * DEC2OCT(x[,places])
+ *
+ * @category Engineering Functions
+ *
+ * @param string $x The decimal integer you want to convert. If number is negative,
+ * places is ignored and DEC2OCT returns a 10-character (30-bit)
+ * octal number in which the most significant bit is the sign bit.
+ * The remaining 29 bits are magnitude bits. Negative numbers are
+ * represented using two's-complement notation.
+ * If number < -536,870,912 or if number > 536,870,911, DEC2OCT
+ * returns the #NUM! error value.
+ * If number is nonnumeric, DEC2OCT returns the #VALUE! error value.
+ * If DEC2OCT requires more than places characters, it returns the
+ * #NUM! error value.
+ * @param int $places The number of characters to use. If places is omitted, DEC2OCT uses
+ * the minimum number of characters necessary. Places is useful for
+ * padding the return value with leading 0s (zeros).
+ * If places is not an integer, it is truncated.
+ * If places is nonnumeric, DEC2OCT returns the #VALUE! error value.
+ * If places is zero or negative, DEC2OCT returns the #NUM! error value.
+ *
+ * @return string
+ */
+ public static function DECTOOCT($x, $places = null)
+ {
+ $xorig = $x;
+ $x = Functions::flattenSingleValue($x);
+ $places = Functions::flattenSingleValue($places);
+
+ if (is_bool($x)) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
+ $x = (int) $x;
+ } else {
+ return Functions::VALUE();
+ }
+ }
+ $x = (string) $x;
+ if (strlen($x) > preg_match_all('/[-0123456789.]/', $x, $out)) {
+ return Functions::VALUE();
+ }
+ $x = (string) floor($x);
+ $r = decoct($x);
+ if (strlen($r) == 11) {
+ // Two's Complement
+ $r = substr($r, -10);
+ }
+
+ return self::nbrConversionFormat($r, $places);
+ }
+
+ /**
+ * HEXTOBIN.
+ *
+ * Return a hex value as binary.
+ *
+ * Excel Function:
+ * HEX2BIN(x[,places])
+ *
+ * @category Engineering Functions
+ *
+ * @param string $x the hexadecimal number you want to convert.
+ * Number cannot contain more than 10 characters.
+ * The most significant bit of number is the sign bit (40th bit from the right).
+ * The remaining 9 bits are magnitude bits.
+ * Negative numbers are represented using two's-complement notation.
+ * If number is negative, HEX2BIN ignores places and returns a 10-character binary number.
+ * If number is negative, it cannot be less than FFFFFFFE00,
+ * and if number is positive, it cannot be greater than 1FF.
+ * If number is not a valid hexadecimal number, HEX2BIN returns the #NUM! error value.
+ * If HEX2BIN requires more than places characters, it returns the #NUM! error value.
+ * @param int $places The number of characters to use. If places is omitted,
+ * HEX2BIN uses the minimum number of characters necessary. Places
+ * is useful for padding the return value with leading 0s (zeros).
+ * If places is not an integer, it is truncated.
+ * If places is nonnumeric, HEX2BIN returns the #VALUE! error value.
+ * If places is negative, HEX2BIN returns the #NUM! error value.
+ *
+ * @return string
+ */
+ public static function HEXTOBIN($x, $places = null)
+ {
+ $x = Functions::flattenSingleValue($x);
+ $places = Functions::flattenSingleValue($places);
+
+ if (is_bool($x)) {
+ return Functions::VALUE();
+ }
+ $x = (string) $x;
+ if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/', strtoupper($x), $out)) {
+ return Functions::NAN();
+ }
+
+ return self::DECTOBIN(self::HEXTODEC($x), $places);
+ }
+
+ /**
+ * HEXTODEC.
+ *
+ * Return a hex value as decimal.
+ *
+ * Excel Function:
+ * HEX2DEC(x)
+ *
+ * @category Engineering Functions
+ *
+ * @param string $x The hexadecimal number you want to convert. This number cannot
+ * contain more than 10 characters (40 bits). The most significant
+ * bit of number is the sign bit. The remaining 39 bits are magnitude
+ * bits. Negative numbers are represented using two's-complement
+ * notation.
+ * If number is not a valid hexadecimal number, HEX2DEC returns the
+ * #NUM! error value.
+ *
+ * @return string
+ */
+ public static function HEXTODEC($x)
+ {
+ $x = Functions::flattenSingleValue($x);
+
+ if (is_bool($x)) {
+ return Functions::VALUE();
+ }
+ $x = (string) $x;
+ if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/', strtoupper($x), $out)) {
+ return Functions::NAN();
+ }
+
+ if (strlen($x) > 10) {
+ return Functions::NAN();
+ }
+
+ $binX = '';
+ foreach (str_split($x) as $char) {
+ $binX .= str_pad(base_convert($char, 16, 2), 4, '0', STR_PAD_LEFT);
+ }
+ if (strlen($binX) == 40 && $binX[0] == '1') {
+ for ($i = 0; $i < 40; ++$i) {
+ $binX[$i] = ($binX[$i] == '1' ? '0' : '1');
+ }
+
+ return (bindec($binX) + 1) * -1;
+ }
+
+ return bindec($binX);
+ }
+
+ /**
+ * HEXTOOCT.
+ *
+ * Return a hex value as octal.
+ *
+ * Excel Function:
+ * HEX2OCT(x[,places])
+ *
+ * @category Engineering Functions
+ *
+ * @param string $x The hexadecimal number you want to convert. Number cannot
+ * contain more than 10 characters. The most significant bit of
+ * number is the sign bit. The remaining 39 bits are magnitude
+ * bits. Negative numbers are represented using two's-complement
+ * notation.
+ * If number is negative, HEX2OCT ignores places and returns a
+ * 10-character octal number.
+ * If number is negative, it cannot be less than FFE0000000, and
+ * if number is positive, it cannot be greater than 1FFFFFFF.
+ * If number is not a valid hexadecimal number, HEX2OCT returns
+ * the #NUM! error value.
+ * If HEX2OCT requires more than places characters, it returns
+ * the #NUM! error value.
+ * @param int $places The number of characters to use. If places is omitted, HEX2OCT
+ * uses the minimum number of characters necessary. Places is
+ * useful for padding the return value with leading 0s (zeros).
+ * If places is not an integer, it is truncated.
+ * If places is nonnumeric, HEX2OCT returns the #VALUE! error
+ * value.
+ * If places is negative, HEX2OCT returns the #NUM! error value.
+ *
+ * @return string
+ */
+ public static function HEXTOOCT($x, $places = null)
+ {
+ $x = Functions::flattenSingleValue($x);
+ $places = Functions::flattenSingleValue($places);
+
+ if (is_bool($x)) {
+ return Functions::VALUE();
+ }
+ $x = (string) $x;
+ if (strlen($x) > preg_match_all('/[0123456789ABCDEF]/', strtoupper($x), $out)) {
+ return Functions::NAN();
+ }
+
+ $decimal = self::HEXTODEC($x);
+ if ($decimal < -536870912 || $decimal > 536870911) {
+ return Functions::NAN();
+ }
+
+ return self::DECTOOCT($decimal, $places);
+ }
+
+ /**
+ * OCTTOBIN.
+ *
+ * Return an octal value as binary.
+ *
+ * Excel Function:
+ * OCT2BIN(x[,places])
+ *
+ * @category Engineering Functions
+ *
+ * @param string $x The octal number you want to convert. Number may not
+ * contain more than 10 characters. The most significant
+ * bit of number is the sign bit. The remaining 29 bits
+ * are magnitude bits. Negative numbers are represented
+ * using two's-complement notation.
+ * If number is negative, OCT2BIN ignores places and returns
+ * a 10-character binary number.
+ * If number is negative, it cannot be less than 7777777000,
+ * and if number is positive, it cannot be greater than 777.
+ * If number is not a valid octal number, OCT2BIN returns
+ * the #NUM! error value.
+ * If OCT2BIN requires more than places characters, it
+ * returns the #NUM! error value.
+ * @param int $places The number of characters to use. If places is omitted,
+ * OCT2BIN uses the minimum number of characters necessary.
+ * Places is useful for padding the return value with
+ * leading 0s (zeros).
+ * If places is not an integer, it is truncated.
+ * If places is nonnumeric, OCT2BIN returns the #VALUE!
+ * error value.
+ * If places is negative, OCT2BIN returns the #NUM! error
+ * value.
+ *
+ * @return string
+ */
+ public static function OCTTOBIN($x, $places = null)
+ {
+ $x = Functions::flattenSingleValue($x);
+ $places = Functions::flattenSingleValue($places);
+
+ if (is_bool($x)) {
+ return Functions::VALUE();
+ }
+ $x = (string) $x;
+ if (preg_match_all('/[01234567]/', $x, $out) != strlen($x)) {
+ return Functions::NAN();
+ }
+
+ return self::DECTOBIN(self::OCTTODEC($x), $places);
+ }
+
+ /**
+ * OCTTODEC.
+ *
+ * Return an octal value as decimal.
+ *
+ * Excel Function:
+ * OCT2DEC(x)
+ *
+ * @category Engineering Functions
+ *
+ * @param string $x The octal number you want to convert. Number may not contain
+ * more than 10 octal characters (30 bits). The most significant
+ * bit of number is the sign bit. The remaining 29 bits are
+ * magnitude bits. Negative numbers are represented using
+ * two's-complement notation.
+ * If number is not a valid octal number, OCT2DEC returns the
+ * #NUM! error value.
+ *
+ * @return string
+ */
+ public static function OCTTODEC($x)
+ {
+ $x = Functions::flattenSingleValue($x);
+
+ if (is_bool($x)) {
+ return Functions::VALUE();
+ }
+ $x = (string) $x;
+ if (preg_match_all('/[01234567]/', $x, $out) != strlen($x)) {
+ return Functions::NAN();
+ }
+ $binX = '';
+ foreach (str_split($x) as $char) {
+ $binX .= str_pad(decbin((int) $char), 3, '0', STR_PAD_LEFT);
+ }
+ if (strlen($binX) == 30 && $binX[0] == '1') {
+ for ($i = 0; $i < 30; ++$i) {
+ $binX[$i] = ($binX[$i] == '1' ? '0' : '1');
+ }
+
+ return (bindec($binX) + 1) * -1;
+ }
+
+ return bindec($binX);
+ }
+
+ /**
+ * OCTTOHEX.
+ *
+ * Return an octal value as hex.
+ *
+ * Excel Function:
+ * OCT2HEX(x[,places])
+ *
+ * @category Engineering Functions
+ *
+ * @param string $x The octal number you want to convert. Number may not contain
+ * more than 10 octal characters (30 bits). The most significant
+ * bit of number is the sign bit. The remaining 29 bits are
+ * magnitude bits. Negative numbers are represented using
+ * two's-complement notation.
+ * If number is negative, OCT2HEX ignores places and returns a
+ * 10-character hexadecimal number.
+ * If number is not a valid octal number, OCT2HEX returns the
+ * #NUM! error value.
+ * If OCT2HEX requires more than places characters, it returns
+ * the #NUM! error value.
+ * @param int $places The number of characters to use. If places is omitted, OCT2HEX
+ * uses the minimum number of characters necessary. Places is useful
+ * for padding the return value with leading 0s (zeros).
+ * If places is not an integer, it is truncated.
+ * If places is nonnumeric, OCT2HEX returns the #VALUE! error value.
+ * If places is negative, OCT2HEX returns the #NUM! error value.
+ *
+ * @return string
+ */
+ public static function OCTTOHEX($x, $places = null)
+ {
+ $x = Functions::flattenSingleValue($x);
+ $places = Functions::flattenSingleValue($places);
+
+ if (is_bool($x)) {
+ return Functions::VALUE();
+ }
+ $x = (string) $x;
+ if (preg_match_all('/[01234567]/', $x, $out) != strlen($x)) {
+ return Functions::NAN();
+ }
+ $hexVal = strtoupper(dechex(self::OCTTODEC($x)));
+
+ return self::nbrConversionFormat($hexVal, $places);
+ }
+
+ /**
+ * COMPLEX.
+ *
+ * Converts real and imaginary coefficients into a complex number of the form x +/- yi or x +/- yj.
+ *
+ * Excel Function:
+ * COMPLEX(realNumber,imaginary[,suffix])
+ *
+ * @category Engineering Functions
+ *
+ * @param float $realNumber the real coefficient of the complex number
+ * @param float $imaginary the imaginary coefficient of the complex number
+ * @param string $suffix The suffix for the imaginary component of the complex number.
+ * If omitted, the suffix is assumed to be "i".
+ *
+ * @return string
+ */
+ public static function COMPLEX($realNumber = 0.0, $imaginary = 0.0, $suffix = 'i')
+ {
+ $realNumber = ($realNumber === null) ? 0.0 : Functions::flattenSingleValue($realNumber);
+ $imaginary = ($imaginary === null) ? 0.0 : Functions::flattenSingleValue($imaginary);
+ $suffix = ($suffix === null) ? 'i' : Functions::flattenSingleValue($suffix);
+
+ if (((is_numeric($realNumber)) && (is_numeric($imaginary))) &&
+ (($suffix == 'i') || ($suffix == 'j') || ($suffix == ''))
+ ) {
+ $complex = new Complex($realNumber, $imaginary, $suffix);
+
+ return (string) $complex;
+ }
+
+ return Functions::VALUE();
+ }
+
+ /**
+ * IMAGINARY.
+ *
+ * Returns the imaginary coefficient of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMAGINARY(complexNumber)
+ *
+ * @category Engineering Functions
+ *
+ * @param string $complexNumber the complex number for which you want the imaginary
+ * coefficient
+ *
+ * @return float
+ */
+ public static function IMAGINARY($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ return (new Complex($complexNumber))->getImaginary();
+ }
+
+ /**
+ * IMREAL.
+ *
+ * Returns the real coefficient of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMREAL(complexNumber)
+ *
+ * @category Engineering Functions
+ *
+ * @param string $complexNumber the complex number for which you want the real coefficient
+ *
+ * @return float
+ */
+ public static function IMREAL($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ return (new Complex($complexNumber))->getReal();
+ }
+
+ /**
+ * IMABS.
+ *
+ * Returns the absolute value (modulus) of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMABS(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the absolute value
+ *
+ * @return float
+ */
+ public static function IMABS($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ return (new Complex($complexNumber))->abs();
+ }
+
+ /**
+ * IMARGUMENT.
+ *
+ * Returns the argument theta of a complex number, i.e. the angle in radians from the real
+ * axis to the representation of the number in polar coordinates.
+ *
+ * Excel Function:
+ * IMARGUMENT(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the argument theta
+ *
+ * @return float|string
+ */
+ public static function IMARGUMENT($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ $complex = new Complex($complexNumber);
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return Functions::DIV0();
+ }
+
+ return $complex->argument();
+ }
+
+ /**
+ * IMCONJUGATE.
+ *
+ * Returns the complex conjugate of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMCONJUGATE(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the conjugate
+ *
+ * @return string
+ */
+ public static function IMCONJUGATE($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ return (string) (new Complex($complexNumber))->conjugate();
+ }
+
+ /**
+ * IMCOS.
+ *
+ * Returns the cosine of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMCOS(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the cosine
+ *
+ * @return float|string
+ */
+ public static function IMCOS($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ return (string) (new Complex($complexNumber))->cos();
+ }
+
+ /**
+ * IMCOSH.
+ *
+ * Returns the hyperbolic cosine of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMCOSH(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the hyperbolic cosine
+ *
+ * @return float|string
+ */
+ public static function IMCOSH($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ return (string) (new Complex($complexNumber))->cosh();
+ }
+
+ /**
+ * IMCOT.
+ *
+ * Returns the cotangent of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMCOT(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the cotangent
+ *
+ * @return float|string
+ */
+ public static function IMCOT($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ return (string) (new Complex($complexNumber))->cot();
+ }
+
+ /**
+ * IMCSC.
+ *
+ * Returns the cosecant of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMCSC(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the cosecant
+ *
+ * @return float|string
+ */
+ public static function IMCSC($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ return (string) (new Complex($complexNumber))->csc();
+ }
+
+ /**
+ * IMCSCH.
+ *
+ * Returns the hyperbolic cosecant of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMCSCH(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the hyperbolic cosecant
+ *
+ * @return float|string
+ */
+ public static function IMCSCH($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ return (string) (new Complex($complexNumber))->csch();
+ }
+
+ /**
+ * IMSIN.
+ *
+ * Returns the sine of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMSIN(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the sine
+ *
+ * @return float|string
+ */
+ public static function IMSIN($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ return (string) (new Complex($complexNumber))->sin();
+ }
+
+ /**
+ * IMSINH.
+ *
+ * Returns the hyperbolic sine of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMSINH(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the hyperbolic sine
+ *
+ * @return float|string
+ */
+ public static function IMSINH($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ return (string) (new Complex($complexNumber))->sinh();
+ }
+
+ /**
+ * IMSEC.
+ *
+ * Returns the secant of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMSEC(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the secant
+ *
+ * @return float|string
+ */
+ public static function IMSEC($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ return (string) (new Complex($complexNumber))->sec();
+ }
+
+ /**
+ * IMSECH.
+ *
+ * Returns the hyperbolic secant of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMSECH(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the hyperbolic secant
+ *
+ * @return float|string
+ */
+ public static function IMSECH($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ return (string) (new Complex($complexNumber))->sech();
+ }
+
+ /**
+ * IMTAN.
+ *
+ * Returns the tangent of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMTAN(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the tangent
+ *
+ * @return float|string
+ */
+ public static function IMTAN($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ return (string) (new Complex($complexNumber))->tan();
+ }
+
+ /**
+ * IMSQRT.
+ *
+ * Returns the square root of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMSQRT(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the square root
+ *
+ * @return string
+ */
+ public static function IMSQRT($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ $theta = self::IMARGUMENT($complexNumber);
+ if ($theta === Functions::DIV0()) {
+ return '0';
+ }
+
+ return (string) (new Complex($complexNumber))->sqrt();
+ }
+
+ /**
+ * IMLN.
+ *
+ * Returns the natural logarithm of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMLN(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the natural logarithm
+ *
+ * @return string
+ */
+ public static function IMLN($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ $complex = new Complex($complexNumber);
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return Functions::NAN();
+ }
+
+ return (string) (new Complex($complexNumber))->ln();
+ }
+
+ /**
+ * IMLOG10.
+ *
+ * Returns the common logarithm (base 10) of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMLOG10(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the common logarithm
+ *
+ * @return string
+ */
+ public static function IMLOG10($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ $complex = new Complex($complexNumber);
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return Functions::NAN();
+ }
+
+ return (string) (new Complex($complexNumber))->log10();
+ }
+
+ /**
+ * IMLOG2.
+ *
+ * Returns the base-2 logarithm of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMLOG2(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the base-2 logarithm
+ *
+ * @return string
+ */
+ public static function IMLOG2($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ $complex = new Complex($complexNumber);
+ if ($complex->getReal() == 0.0 && $complex->getImaginary() == 0.0) {
+ return Functions::NAN();
+ }
+
+ return (string) (new Complex($complexNumber))->log2();
+ }
+
+ /**
+ * IMEXP.
+ *
+ * Returns the exponential of a complex number in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMEXP(complexNumber)
+ *
+ * @param string $complexNumber the complex number for which you want the exponential
+ *
+ * @return string
+ */
+ public static function IMEXP($complexNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+
+ return (string) (new Complex($complexNumber))->exp();
+ }
+
+ /**
+ * IMPOWER.
+ *
+ * Returns a complex number in x + yi or x + yj text format raised to a power.
+ *
+ * Excel Function:
+ * IMPOWER(complexNumber,realNumber)
+ *
+ * @param string $complexNumber the complex number you want to raise to a power
+ * @param float $realNumber the power to which you want to raise the complex number
+ *
+ * @return string
+ */
+ public static function IMPOWER($complexNumber, $realNumber)
+ {
+ $complexNumber = Functions::flattenSingleValue($complexNumber);
+ $realNumber = Functions::flattenSingleValue($realNumber);
+
+ if (!is_numeric($realNumber)) {
+ return Functions::VALUE();
+ }
+
+ return (string) (new Complex($complexNumber))->pow($realNumber);
+ }
+
+ /**
+ * IMDIV.
+ *
+ * Returns the quotient of two complex numbers in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMDIV(complexDividend,complexDivisor)
+ *
+ * @param string $complexDividend the complex numerator or dividend
+ * @param string $complexDivisor the complex denominator or divisor
+ *
+ * @return string
+ */
+ public static function IMDIV($complexDividend, $complexDivisor)
+ {
+ $complexDividend = Functions::flattenSingleValue($complexDividend);
+ $complexDivisor = Functions::flattenSingleValue($complexDivisor);
+
+ try {
+ return (string) (new Complex($complexDividend))->divideby(new Complex($complexDivisor));
+ } catch (ComplexException $e) {
+ return Functions::NAN();
+ }
+ }
+
+ /**
+ * IMSUB.
+ *
+ * Returns the difference of two complex numbers in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMSUB(complexNumber1,complexNumber2)
+ *
+ * @param string $complexNumber1 the complex number from which to subtract complexNumber2
+ * @param string $complexNumber2 the complex number to subtract from complexNumber1
+ *
+ * @return string
+ */
+ public static function IMSUB($complexNumber1, $complexNumber2)
+ {
+ $complexNumber1 = Functions::flattenSingleValue($complexNumber1);
+ $complexNumber2 = Functions::flattenSingleValue($complexNumber2);
+
+ try {
+ return (string) (new Complex($complexNumber1))->subtract(new Complex($complexNumber2));
+ } catch (ComplexException $e) {
+ return Functions::NAN();
+ }
+ }
+
+ /**
+ * IMSUM.
+ *
+ * Returns the sum of two or more complex numbers in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMSUM(complexNumber[,complexNumber[,...]])
+ *
+ * @param string ...$complexNumbers Series of complex numbers to add
+ *
+ * @return string
+ */
+ public static function IMSUM(...$complexNumbers)
+ {
+ // Return value
+ $returnValue = new Complex(0.0);
+ $aArgs = Functions::flattenArray($complexNumbers);
+
+ try {
+ // Loop through the arguments
+ foreach ($aArgs as $complex) {
+ $returnValue = $returnValue->add(new Complex($complex));
+ }
+ } catch (ComplexException $e) {
+ return Functions::NAN();
+ }
+
+ return (string) $returnValue;
+ }
+
+ /**
+ * IMPRODUCT.
+ *
+ * Returns the product of two or more complex numbers in x + yi or x + yj text format.
+ *
+ * Excel Function:
+ * IMPRODUCT(complexNumber[,complexNumber[,...]])
+ *
+ * @param string ...$complexNumbers Series of complex numbers to multiply
+ *
+ * @return string
+ */
+ public static function IMPRODUCT(...$complexNumbers)
+ {
+ // Return value
+ $returnValue = new Complex(1.0);
+ $aArgs = Functions::flattenArray($complexNumbers);
+
+ try {
+ // Loop through the arguments
+ foreach ($aArgs as $complex) {
+ $returnValue = $returnValue->multiply(new Complex($complex));
+ }
+ } catch (ComplexException $e) {
+ return Functions::NAN();
+ }
+
+ return (string) $returnValue;
+ }
+
+ /**
+ * DELTA.
+ *
+ * Tests whether two values are equal. Returns 1 if number1 = number2; returns 0 otherwise.
+ * Use this function to filter a set of values. For example, by summing several DELTA
+ * functions you calculate the count of equal pairs. This function is also known as the
+ * Kronecker Delta function.
+ *
+ * Excel Function:
+ * DELTA(a[,b])
+ *
+ * @param float $a the first number
+ * @param float $b The second number. If omitted, b is assumed to be zero.
+ *
+ * @return int
+ */
+ public static function DELTA($a, $b = 0)
+ {
+ $a = Functions::flattenSingleValue($a);
+ $b = Functions::flattenSingleValue($b);
+
+ return (int) ($a == $b);
+ }
+
+ /**
+ * GESTEP.
+ *
+ * Excel Function:
+ * GESTEP(number[,step])
+ *
+ * Returns 1 if number >= step; returns 0 (zero) otherwise
+ * Use this function to filter a set of values. For example, by summing several GESTEP
+ * functions you calculate the count of values that exceed a threshold.
+ *
+ * @param float $number the value to test against step
+ * @param float $step The threshold value.
+ * If you omit a value for step, GESTEP uses zero.
+ *
+ * @return int
+ */
+ public static function GESTEP($number, $step = 0)
+ {
+ $number = Functions::flattenSingleValue($number);
+ $step = Functions::flattenSingleValue($step);
+
+ return (int) ($number >= $step);
+ }
+
+ //
+ // Private method to calculate the erf value
+ //
+ private static $twoSqrtPi = 1.128379167095512574;
+
+ public static function erfVal($x)
+ {
+ if (abs($x) > 2.2) {
+ return 1 - self::erfcVal($x);
+ }
+ $sum = $term = $x;
+ $xsqr = ($x * $x);
+ $j = 1;
+ do {
+ $term *= $xsqr / $j;
+ $sum -= $term / (2 * $j + 1);
+ ++$j;
+ $term *= $xsqr / $j;
+ $sum += $term / (2 * $j + 1);
+ ++$j;
+ if ($sum == 0.0) {
+ break;
+ }
+ } while (abs($term / $sum) > Functions::PRECISION);
+
+ return self::$twoSqrtPi * $sum;
+ }
+
+ /**
+ * Validate arguments passed to the bitwise functions.
+ *
+ * @param mixed $value
+ *
+ * @throws Exception
+ *
+ * @return int
+ */
+ private static function validateBitwiseArgument($value)
+ {
+ $value = Functions::flattenSingleValue($value);
+
+ if (is_int($value)) {
+ return $value;
+ } elseif (is_numeric($value)) {
+ if ($value == (int) ($value)) {
+ $value = (int) ($value);
+ if (($value > pow(2, 48) - 1) || ($value < 0)) {
+ throw new Exception(Functions::NAN());
+ }
+
+ return $value;
+ }
+
+ throw new Exception(Functions::NAN());
+ }
+
+ throw new Exception(Functions::VALUE());
+ }
+
+ /**
+ * BITAND.
+ *
+ * Returns the bitwise AND of two integer values.
+ *
+ * Excel Function:
+ * BITAND(number1, number2)
+ *
+ * @category Engineering Functions
+ *
+ * @param int $number1
+ * @param int $number2
+ *
+ * @return int|string
+ */
+ public static function BITAND($number1, $number2)
+ {
+ try {
+ $number1 = self::validateBitwiseArgument($number1);
+ $number2 = self::validateBitwiseArgument($number2);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return $number1 & $number2;
+ }
+
+ /**
+ * BITOR.
+ *
+ * Returns the bitwise OR of two integer values.
+ *
+ * Excel Function:
+ * BITOR(number1, number2)
+ *
+ * @category Engineering Functions
+ *
+ * @param int $number1
+ * @param int $number2
+ *
+ * @return int|string
+ */
+ public static function BITOR($number1, $number2)
+ {
+ try {
+ $number1 = self::validateBitwiseArgument($number1);
+ $number2 = self::validateBitwiseArgument($number2);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return $number1 | $number2;
+ }
+
+ /**
+ * BITXOR.
+ *
+ * Returns the bitwise XOR of two integer values.
+ *
+ * Excel Function:
+ * BITXOR(number1, number2)
+ *
+ * @category Engineering Functions
+ *
+ * @param int $number1
+ * @param int $number2
+ *
+ * @return int|string
+ */
+ public static function BITXOR($number1, $number2)
+ {
+ try {
+ $number1 = self::validateBitwiseArgument($number1);
+ $number2 = self::validateBitwiseArgument($number2);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ return $number1 ^ $number2;
+ }
+
+ /**
+ * BITLSHIFT.
+ *
+ * Returns the number value shifted left by shift_amount bits.
+ *
+ * Excel Function:
+ * BITLSHIFT(number, shift_amount)
+ *
+ * @category Engineering Functions
+ *
+ * @param int $number
+ * @param int $shiftAmount
+ *
+ * @return int|string
+ */
+ public static function BITLSHIFT($number, $shiftAmount)
+ {
+ try {
+ $number = self::validateBitwiseArgument($number);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $shiftAmount = Functions::flattenSingleValue($shiftAmount);
+
+ $result = $number << $shiftAmount;
+ if ($result > pow(2, 48) - 1) {
+ return Functions::NAN();
+ }
+
+ return $result;
+ }
+
+ /**
+ * BITRSHIFT.
+ *
+ * Returns the number value shifted right by shift_amount bits.
+ *
+ * Excel Function:
+ * BITRSHIFT(number, shift_amount)
+ *
+ * @category Engineering Functions
+ *
+ * @param int $number
+ * @param int $shiftAmount
+ *
+ * @return int|string
+ */
+ public static function BITRSHIFT($number, $shiftAmount)
+ {
+ try {
+ $number = self::validateBitwiseArgument($number);
+ } catch (Exception $e) {
+ return $e->getMessage();
+ }
+
+ $shiftAmount = Functions::flattenSingleValue($shiftAmount);
+
+ return $number >> $shiftAmount;
+ }
+
+ /**
+ * ERF.
+ *
+ * Returns the error function integrated between the lower and upper bound arguments.
+ *
+ * Note: In Excel 2007 or earlier, if you input a negative value for the upper or lower bound arguments,
+ * the function would return a #NUM! error. However, in Excel 2010, the function algorithm was
+ * improved, so that it can now calculate the function for both positive and negative ranges.
+ * PhpSpreadsheet follows Excel 2010 behaviour, and accepts negative arguments.
+ *
+ * Excel Function:
+ * ERF(lower[,upper])
+ *
+ * @param float $lower lower bound for integrating ERF
+ * @param float $upper upper bound for integrating ERF.
+ * If omitted, ERF integrates between zero and lower_limit
+ *
+ * @return float|string
+ */
+ public static function ERF($lower, $upper = null)
+ {
+ $lower = Functions::flattenSingleValue($lower);
+ $upper = Functions::flattenSingleValue($upper);
+
+ if (is_numeric($lower)) {
+ if ($upper === null) {
+ return self::erfVal($lower);
+ }
+ if (is_numeric($upper)) {
+ return self::erfVal($upper) - self::erfVal($lower);
+ }
+ }
+
+ return Functions::VALUE();
+ }
+
+ /**
+ * ERFPRECISE.
+ *
+ * Returns the error function integrated between the lower and upper bound arguments.
+ *
+ * Excel Function:
+ * ERF.PRECISE(limit)
+ *
+ * @param float $limit bound for integrating ERF
+ *
+ * @return float|string
+ */
+ public static function ERFPRECISE($limit)
+ {
+ $limit = Functions::flattenSingleValue($limit);
+
+ return self::ERF($limit);
+ }
+
+ //
+ // Private method to calculate the erfc value
+ //
+ private static $oneSqrtPi = 0.564189583547756287;
+
+ private static function erfcVal($x)
+ {
+ if (abs($x) < 2.2) {
+ return 1 - self::erfVal($x);
+ }
+ if ($x < 0) {
+ return 2 - self::ERFC(-$x);
+ }
+ $a = $n = 1;
+ $b = $c = $x;
+ $d = ($x * $x) + 0.5;
+ $q1 = $q2 = $b / $d;
+ $t = 0;
+ do {
+ $t = $a * $n + $b * $x;
+ $a = $b;
+ $b = $t;
+ $t = $c * $n + $d * $x;
+ $c = $d;
+ $d = $t;
+ $n += 0.5;
+ $q1 = $q2;
+ $q2 = $b / $d;
+ } while ((abs($q1 - $q2) / $q2) > Functions::PRECISION);
+
+ return self::$oneSqrtPi * exp(-$x * $x) * $q2;
+ }
+
+ /**
+ * ERFC.
+ *
+ * Returns the complementary ERF function integrated between x and infinity
+ *
+ * Note: In Excel 2007 or earlier, if you input a negative value for the lower bound argument,
+ * the function would return a #NUM! error. However, in Excel 2010, the function algorithm was
+ * improved, so that it can now calculate the function for both positive and negative x values.
+ * PhpSpreadsheet follows Excel 2010 behaviour, and accepts nagative arguments.
+ *
+ * Excel Function:
+ * ERFC(x)
+ *
+ * @param float $x The lower bound for integrating ERFC
+ *
+ * @return float|string
+ */
+ public static function ERFC($x)
+ {
+ $x = Functions::flattenSingleValue($x);
+
+ if (is_numeric($x)) {
+ return self::erfcVal($x);
+ }
+
+ return Functions::VALUE();
+ }
+
+ /**
+ * getConversionGroups
+ * Returns a list of the different conversion groups for UOM conversions.
+ *
+ * @return array
+ */
+ public static function getConversionGroups()
+ {
+ $conversionGroups = [];
+ foreach (self::$conversionUnits as $conversionUnit) {
+ $conversionGroups[] = $conversionUnit['Group'];
+ }
+
+ return array_merge(array_unique($conversionGroups));
+ }
+
+ /**
+ * getConversionGroupUnits
+ * Returns an array of units of measure, for a specified conversion group, or for all groups.
+ *
+ * @param string $group The group whose units of measure you want to retrieve
+ *
+ * @return array
+ */
+ public static function getConversionGroupUnits($group = null)
+ {
+ $conversionGroups = [];
+ foreach (self::$conversionUnits as $conversionUnit => $conversionGroup) {
+ if (($group === null) || ($conversionGroup['Group'] == $group)) {
+ $conversionGroups[$conversionGroup['Group']][] = $conversionUnit;
+ }
+ }
+
+ return $conversionGroups;
+ }
+
+ /**
+ * getConversionGroupUnitDetails.
+ *
+ * @param string $group The group whose units of measure you want to retrieve
+ *
+ * @return array
+ */
+ public static function getConversionGroupUnitDetails($group = null)
+ {
+ $conversionGroups = [];
+ foreach (self::$conversionUnits as $conversionUnit => $conversionGroup) {
+ if (($group === null) || ($conversionGroup['Group'] == $group)) {
+ $conversionGroups[$conversionGroup['Group']][] = [
+ 'unit' => $conversionUnit,
+ 'description' => $conversionGroup['Unit Name'],
+ ];
+ }
+ }
+
+ return $conversionGroups;
+ }
+
+ /**
+ * getConversionMultipliers
+ * Returns an array of the Multiplier prefixes that can be used with Units of Measure in CONVERTUOM().
+ *
+ * @return array of mixed
+ */
+ public static function getConversionMultipliers()
+ {
+ return self::$conversionMultipliers;
+ }
+
+ /**
+ * CONVERTUOM.
+ *
+ * Converts a number from one measurement system to another.
+ * For example, CONVERT can translate a table of distances in miles to a table of distances
+ * in kilometers.
+ *
+ * Excel Function:
+ * CONVERT(value,fromUOM,toUOM)
+ *
+ * @param float $value the value in fromUOM to convert
+ * @param string $fromUOM the units for value
+ * @param string $toUOM the units for the result
+ *
+ * @return float
+ */
+ public static function CONVERTUOM($value, $fromUOM, $toUOM)
+ {
+ $value = Functions::flattenSingleValue($value);
+ $fromUOM = Functions::flattenSingleValue($fromUOM);
+ $toUOM = Functions::flattenSingleValue($toUOM);
+
+ if (!is_numeric($value)) {
+ return Functions::VALUE();
+ }
+ $fromMultiplier = 1.0;
+ if (isset(self::$conversionUnits[$fromUOM])) {
+ $unitGroup1 = self::$conversionUnits[$fromUOM]['Group'];
+ } else {
+ $fromMultiplier = substr($fromUOM, 0, 1);
+ $fromUOM = substr($fromUOM, 1);
+ if (isset(self::$conversionMultipliers[$fromMultiplier])) {
+ $fromMultiplier = self::$conversionMultipliers[$fromMultiplier]['multiplier'];
+ } else {
+ return Functions::NA();
+ }
+ if ((isset(self::$conversionUnits[$fromUOM])) && (self::$conversionUnits[$fromUOM]['AllowPrefix'])) {
+ $unitGroup1 = self::$conversionUnits[$fromUOM]['Group'];
+ } else {
+ return Functions::NA();
+ }
+ }
+ $value *= $fromMultiplier;
+
+ $toMultiplier = 1.0;
+ if (isset(self::$conversionUnits[$toUOM])) {
+ $unitGroup2 = self::$conversionUnits[$toUOM]['Group'];
+ } else {
+ $toMultiplier = substr($toUOM, 0, 1);
+ $toUOM = substr($toUOM, 1);
+ if (isset(self::$conversionMultipliers[$toMultiplier])) {
+ $toMultiplier = self::$conversionMultipliers[$toMultiplier]['multiplier'];
+ } else {
+ return Functions::NA();
+ }
+ if ((isset(self::$conversionUnits[$toUOM])) && (self::$conversionUnits[$toUOM]['AllowPrefix'])) {
+ $unitGroup2 = self::$conversionUnits[$toUOM]['Group'];
+ } else {
+ return Functions::NA();
+ }
+ }
+ if ($unitGroup1 != $unitGroup2) {
+ return Functions::NA();
+ }
+
+ if (($fromUOM == $toUOM) && ($fromMultiplier == $toMultiplier)) {
+ // We've already factored $fromMultiplier into the value, so we need
+ // to reverse it again
+ return $value / $fromMultiplier;
+ } elseif ($unitGroup1 == 'Temperature') {
+ if (($fromUOM == 'F') || ($fromUOM == 'fah')) {
+ if (($toUOM == 'F') || ($toUOM == 'fah')) {
+ return $value;
+ }
+ $value = (($value - 32) / 1.8);
+ if (($toUOM == 'K') || ($toUOM == 'kel')) {
+ $value += 273.15;
+ }
+
+ return $value;
+ } elseif ((($fromUOM == 'K') || ($fromUOM == 'kel')) &&
+ (($toUOM == 'K') || ($toUOM == 'kel'))
+ ) {
+ return $value;
+ } elseif ((($fromUOM == 'C') || ($fromUOM == 'cel')) &&
+ (($toUOM == 'C') || ($toUOM == 'cel'))
+ ) {
+ return $value;
+ }
+ if (($toUOM == 'F') || ($toUOM == 'fah')) {
+ if (($fromUOM == 'K') || ($fromUOM == 'kel')) {
+ $value -= 273.15;
+ }
+
+ return ($value * 1.8) + 32;
+ }
+ if (($toUOM == 'C') || ($toUOM == 'cel')) {
+ return $value - 273.15;
+ }
+
+ return $value + 273.15;
+ }
+
+ return ($value * self::$unitConversions[$unitGroup1][$fromUOM][$toUOM]) / $toMultiplier;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Exception.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Exception.php
new file mode 100644
index 00000000000..fccf0af70fd
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Exception.php
@@ -0,0 +1,26 @@
+line = $line;
+ $e->file = $file;
+
+ throw $e;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ExceptionHandler.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ExceptionHandler.php
new file mode 100644
index 00000000000..41e51d4aea6
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/ExceptionHandler.php
@@ -0,0 +1,22 @@
+format('d') == $testDate->format('t'));
- }
-
-
- /**
- * isFirstDayOfMonth
+ * @param \DateTime $testDate The date for testing
*
- * Returns a boolean TRUE/FALSE indicating if this date is the first date of the month
- *
- * @param DateTime $testDate The date for testing
- * @return boolean
+ * @return bool
*/
- private static function isFirstDayOfMonth($testDate)
+ private static function isLastDayOfMonth(\DateTime $testDate)
{
- return ($testDate->format('d') == 1);
+ return $testDate->format('d') == $testDate->format('t');
}
-
private static function couponFirstPeriodDate($settlement, $maturity, $frequency, $next)
{
$months = 12 / $frequency;
- $result = PHPExcel_Shared_Date::ExcelToPHPObject($maturity);
+ $result = Date::excelToDateTimeObject($maturity);
$eom = self::isLastDayOfMonth($result);
- while ($settlement < PHPExcel_Shared_Date::PHPToExcel($result)) {
- $result->modify('-'.$months.' months');
+ while ($settlement < Date::PHPToExcel($result)) {
+ $result->modify('-' . $months . ' months');
}
if ($next) {
- $result->modify('+'.$months.' months');
+ $result->modify('+' . $months . ' months');
}
if ($eom) {
$result->modify('-1 day');
}
- return PHPExcel_Shared_Date::PHPToExcel($result);
+ return Date::PHPToExcel($result);
}
-
private static function isValidFrequency($frequency)
{
if (($frequency == 1) || ($frequency == 2) || ($frequency == 4)) {
return true;
}
- if ((PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) &&
+ if ((Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) &&
(($frequency == 6) || ($frequency == 12))) {
return true;
}
+
return false;
}
-
/**
- * daysPerYear
+ * daysPerYear.
*
* Returns the number of days in a specified year, as defined by the "basis" value
*
- * @param integer $year The year against which we're testing
- * @param integer $basis The type of day count:
+ * @param int|string $year The year against which we're testing
+ * @param int|string $basis The type of day count:
* 0 or omitted US (NASD) 360
* 1 Actual (365 or 366 in a leap year)
* 2 360
* 3 365
* 4 European 360
- * @return integer
+ *
+ * @return int
*/
private static function daysPerYear($year, $basis = 0)
{
@@ -126,52 +80,55 @@ class PHPExcel_Calculation_Financial
case 2:
case 4:
$daysPerYear = 360;
+
break;
case 3:
$daysPerYear = 365;
+
break;
case 1:
- $daysPerYear = (PHPExcel_Calculation_DateTime::isLeapYear($year)) ? 366 : 365;
+ $daysPerYear = (DateTime::isLeapYear($year)) ? 366 : 365;
+
break;
default:
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
+
return $daysPerYear;
}
-
private static function interestAndPrincipal($rate = 0, $per = 0, $nper = 0, $pv = 0, $fv = 0, $type = 0)
{
$pmt = self::PMT($rate, $nper, $pv, $fv, $type);
$capital = $pv;
- for ($i = 1; $i<= $per; ++$i) {
+ for ($i = 1; $i <= $per; ++$i) {
$interest = ($type && $i == 1) ? 0 : -$capital * $rate;
$principal = $pmt - $interest;
$capital += $principal;
}
- return array($interest, $principal);
+
+ return [$interest, $principal];
}
-
/**
- * ACCRINT
+ * ACCRINT.
*
* Returns the accrued interest for a security that pays periodic interest.
*
* Excel Function:
* ACCRINT(issue,firstinterest,settlement,rate,par,frequency[,basis])
*
- * @access public
* @category Financial Functions
- * @param mixed $issue The security's issue date.
- * @param mixed $firstinterest The security's first interest date.
- * @param mixed $settlement The security's settlement date.
+ *
+ * @param mixed $issue the security's issue date
+ * @param mixed $firstinterest the security's first interest date
+ * @param mixed $settlement The security's settlement date.
* The security settlement date is the date after the issue date
* when the security is traded to the buyer.
- * @param float $rate The security's annual coupon rate.
- * @param float $par The security's par value.
+ * @param float $rate the security's annual coupon rate
+ * @param float $par The security's par value.
* If you omit par, ACCRINT uses $1,000.
- * @param integer $frequency the number of coupon payments per year.
+ * @param int $frequency the number of coupon payments per year.
* Valid frequency values are:
* 1 Annual
* 2 Semi-Annual
@@ -180,32 +137,33 @@ class PHPExcel_Calculation_Financial
* also available
* 6 Bimonthly
* 12 Monthly
- * @param integer $basis The type of day count to use.
+ * @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return float
+ *
+ * @return float|string
*/
public static function ACCRINT($issue, $firstinterest, $settlement, $rate, $par = 1000, $frequency = 1, $basis = 0)
{
- $issue = PHPExcel_Calculation_Functions::flattenSingleValue($issue);
- $firstinterest = PHPExcel_Calculation_Functions::flattenSingleValue($firstinterest);
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate);
- $par = (is_null($par)) ? 1000 : PHPExcel_Calculation_Functions::flattenSingleValue($par);
- $frequency = (is_null($frequency)) ? 1 : PHPExcel_Calculation_Functions::flattenSingleValue($frequency);
- $basis = (is_null($basis)) ? 0 : PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $issue = Functions::flattenSingleValue($issue);
+ $firstinterest = Functions::flattenSingleValue($firstinterest);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $rate = Functions::flattenSingleValue($rate);
+ $par = ($par === null) ? 1000 : Functions::flattenSingleValue($par);
+ $frequency = ($frequency === null) ? 1 : Functions::flattenSingleValue($frequency);
+ $basis = ($basis === null) ? 0 : Functions::flattenSingleValue($basis);
// Validate
if ((is_numeric($rate)) && (is_numeric($par))) {
- $rate = (float) $rate;
- $par = (float) $par;
+ $rate = (float) $rate;
+ $par = (float) $par;
if (($rate <= 0) || ($par <= 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- $daysBetweenIssueAndSettlement = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $settlement, $basis);
+ $daysBetweenIssueAndSettlement = DateTime::YEARFRAC($issue, $settlement, $basis);
if (!is_numeric($daysBetweenIssueAndSettlement)) {
// return date error
return $daysBetweenIssueAndSettlement;
@@ -213,61 +171,63 @@ class PHPExcel_Calculation_Financial
return $par * $rate * $daysBetweenIssueAndSettlement;
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * ACCRINTM
+ * ACCRINTM.
*
* Returns the accrued interest for a security that pays interest at maturity.
*
* Excel Function:
* ACCRINTM(issue,settlement,rate[,par[,basis]])
*
- * @access public
* @category Financial Functions
- * @param mixed issue The security's issue date.
- * @param mixed settlement The security's settlement (or maturity) date.
- * @param float rate The security's annual coupon rate.
- * @param float par The security's par value.
+ *
+ * @param mixed $issue The security's issue date
+ * @param mixed $settlement The security's settlement (or maturity) date
+ * @param float $rate The security's annual coupon rate
+ * @param float $par The security's par value.
* If you omit par, ACCRINT uses $1,000.
- * @param integer basis The type of day count to use.
+ * @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return float
+ *
+ * @return float|string
*/
public static function ACCRINTM($issue, $settlement, $rate, $par = 1000, $basis = 0)
{
- $issue = PHPExcel_Calculation_Functions::flattenSingleValue($issue);
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate);
- $par = (is_null($par)) ? 1000 : PHPExcel_Calculation_Functions::flattenSingleValue($par);
- $basis = (is_null($basis)) ? 0 : PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $issue = Functions::flattenSingleValue($issue);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $rate = Functions::flattenSingleValue($rate);
+ $par = ($par === null) ? 1000 : Functions::flattenSingleValue($par);
+ $basis = ($basis === null) ? 0 : Functions::flattenSingleValue($basis);
// Validate
if ((is_numeric($rate)) && (is_numeric($par))) {
- $rate = (float) $rate;
- $par = (float) $par;
+ $rate = (float) $rate;
+ $par = (float) $par;
if (($rate <= 0) || ($par <= 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- $daysBetweenIssueAndSettlement = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $settlement, $basis);
+ $daysBetweenIssueAndSettlement = DateTime::YEARFRAC($issue, $settlement, $basis);
if (!is_numeric($daysBetweenIssueAndSettlement)) {
// return date error
return $daysBetweenIssueAndSettlement;
}
+
return $par * $rate * $daysBetweenIssueAndSettlement;
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * AMORDEGRC
+ * AMORDEGRC.
*
* Returns the depreciation for each accounting period.
* This function is provided for the French accounting system. If an asset is purchased in
@@ -281,31 +241,32 @@ class PHPExcel_Calculation_Financial
* Excel Function:
* AMORDEGRC(cost,purchased,firstPeriod,salvage,period,rate[,basis])
*
- * @access public
* @category Financial Functions
- * @param float cost The cost of the asset.
- * @param mixed purchased Date of the purchase of the asset.
- * @param mixed firstPeriod Date of the end of the first period.
- * @param mixed salvage The salvage value at the end of the life of the asset.
- * @param float period The period.
- * @param float rate Rate of depreciation.
- * @param integer basis The type of day count to use.
+ *
+ * @param float $cost The cost of the asset
+ * @param mixed $purchased Date of the purchase of the asset
+ * @param mixed $firstPeriod Date of the end of the first period
+ * @param mixed $salvage The salvage value at the end of the life of the asset
+ * @param float $period The period
+ * @param float $rate Rate of depreciation
+ * @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return float
+ *
+ * @return float
*/
public static function AMORDEGRC($cost, $purchased, $firstPeriod, $salvage, $period, $rate, $basis = 0)
{
- $cost = PHPExcel_Calculation_Functions::flattenSingleValue($cost);
- $purchased = PHPExcel_Calculation_Functions::flattenSingleValue($purchased);
- $firstPeriod = PHPExcel_Calculation_Functions::flattenSingleValue($firstPeriod);
- $salvage = PHPExcel_Calculation_Functions::flattenSingleValue($salvage);
- $period = floor(PHPExcel_Calculation_Functions::flattenSingleValue($period));
- $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate);
- $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $cost = Functions::flattenSingleValue($cost);
+ $purchased = Functions::flattenSingleValue($purchased);
+ $firstPeriod = Functions::flattenSingleValue($firstPeriod);
+ $salvage = Functions::flattenSingleValue($salvage);
+ $period = floor(Functions::flattenSingleValue($period));
+ $rate = Functions::flattenSingleValue($rate);
+ $basis = ($basis === null) ? 0 : (int) Functions::flattenSingleValue($basis);
// The depreciation coefficients are:
// Life of assets (1/rate) Depreciation coefficient
@@ -325,7 +286,7 @@ class PHPExcel_Calculation_Financial
}
$rate *= $amortiseCoeff;
- $fNRate = round(PHPExcel_Calculation_DateTime::YEARFRAC($purchased, $firstPeriod, $basis) * $rate * $cost, 0);
+ $fNRate = round(DateTime::YEARFRAC($purchased, $firstPeriod, $basis) * $rate * $cost, 0);
$cost -= $fNRate;
$fRest = $cost - $salvage;
@@ -344,12 +305,12 @@ class PHPExcel_Calculation_Financial
}
$cost -= $fNRate;
}
+
return $fNRate;
}
-
/**
- * AMORLINC
+ * AMORLINC.
*
* Returns the depreciation for each accounting period.
* This function is provided for the French accounting system. If an asset is purchased in
@@ -358,73 +319,73 @@ class PHPExcel_Calculation_Financial
* Excel Function:
* AMORLINC(cost,purchased,firstPeriod,salvage,period,rate[,basis])
*
- * @access public
* @category Financial Functions
- * @param float cost The cost of the asset.
- * @param mixed purchased Date of the purchase of the asset.
- * @param mixed firstPeriod Date of the end of the first period.
- * @param mixed salvage The salvage value at the end of the life of the asset.
- * @param float period The period.
- * @param float rate Rate of depreciation.
- * @param integer basis The type of day count to use.
+ *
+ * @param float $cost The cost of the asset
+ * @param mixed $purchased Date of the purchase of the asset
+ * @param mixed $firstPeriod Date of the end of the first period
+ * @param mixed $salvage The salvage value at the end of the life of the asset
+ * @param float $period The period
+ * @param float $rate Rate of depreciation
+ * @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return float
+ *
+ * @return float
*/
public static function AMORLINC($cost, $purchased, $firstPeriod, $salvage, $period, $rate, $basis = 0)
{
- $cost = PHPExcel_Calculation_Functions::flattenSingleValue($cost);
- $purchased = PHPExcel_Calculation_Functions::flattenSingleValue($purchased);
- $firstPeriod = PHPExcel_Calculation_Functions::flattenSingleValue($firstPeriod);
- $salvage = PHPExcel_Calculation_Functions::flattenSingleValue($salvage);
- $period = PHPExcel_Calculation_Functions::flattenSingleValue($period);
- $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate);
- $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $cost = Functions::flattenSingleValue($cost);
+ $purchased = Functions::flattenSingleValue($purchased);
+ $firstPeriod = Functions::flattenSingleValue($firstPeriod);
+ $salvage = Functions::flattenSingleValue($salvage);
+ $period = Functions::flattenSingleValue($period);
+ $rate = Functions::flattenSingleValue($rate);
+ $basis = ($basis === null) ? 0 : (int) Functions::flattenSingleValue($basis);
$fOneRate = $cost * $rate;
$fCostDelta = $cost - $salvage;
// Note, quirky variation for leap years on the YEARFRAC for this function
- $purchasedYear = PHPExcel_Calculation_DateTime::YEAR($purchased);
- $yearFrac = PHPExcel_Calculation_DateTime::YEARFRAC($purchased, $firstPeriod, $basis);
+ $purchasedYear = DateTime::YEAR($purchased);
+ $yearFrac = DateTime::YEARFRAC($purchased, $firstPeriod, $basis);
- if (($basis == 1) && ($yearFrac < 1) && (PHPExcel_Calculation_DateTime::isLeapYear($purchasedYear))) {
+ if (($basis == 1) && ($yearFrac < 1) && (DateTime::isLeapYear($purchasedYear))) {
$yearFrac *= 365 / 366;
}
$f0Rate = $yearFrac * $rate * $cost;
- $nNumOfFullPeriods = intval(($cost - $salvage - $f0Rate) / $fOneRate);
+ $nNumOfFullPeriods = (int) (($cost - $salvage - $f0Rate) / $fOneRate);
if ($period == 0) {
return $f0Rate;
} elseif ($period <= $nNumOfFullPeriods) {
return $fOneRate;
} elseif ($period == ($nNumOfFullPeriods + 1)) {
- return ($fCostDelta - $fOneRate * $nNumOfFullPeriods - $f0Rate);
- } else {
- return 0.0;
+ return $fCostDelta - $fOneRate * $nNumOfFullPeriods - $f0Rate;
}
+
+ return 0.0;
}
-
/**
- * COUPDAYBS
+ * COUPDAYBS.
*
* Returns the number of days from the beginning of the coupon period to the settlement date.
*
* Excel Function:
* COUPDAYBS(settlement,maturity,frequency[,basis])
*
- * @access public
* @category Financial Functions
- * @param mixed settlement The security's settlement date.
+ *
+ * @param mixed $settlement The security's settlement date.
* The security settlement date is the date after the issue
* date when the security is traded to the buyer.
- * @param mixed maturity The security's maturity date.
+ * @param mixed $maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param mixed frequency the number of coupon payments per year.
+ * @param int $frequency the number of coupon payments per year.
* Valid frequency values are:
* 1 Annual
* 2 Semi-Annual
@@ -433,57 +394,57 @@ class PHPExcel_Calculation_Financial
* also available
* 6 Bimonthly
* 12 Monthly
- * @param integer basis The type of day count to use.
+ * @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return float
+ *
+ * @return float|string
*/
public static function COUPDAYBS($settlement, $maturity, $frequency, $basis = 0)
{
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
- $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency);
- $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $frequency = (int) Functions::flattenSingleValue($frequency);
+ $basis = ($basis === null) ? 0 : (int) Functions::flattenSingleValue($basis);
- if (is_string($settlement = PHPExcel_Calculation_DateTime::getDateValue($settlement))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ if (is_string($settlement = DateTime::getDateValue($settlement))) {
+ return Functions::VALUE();
}
- if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ if (is_string($maturity = DateTime::getDateValue($maturity))) {
+ return Functions::VALUE();
}
if (($settlement > $maturity) ||
(!self::isValidFrequency($frequency)) ||
(($basis < 0) || ($basis > 4))) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- $daysPerYear = self::daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement), $basis);
+ $daysPerYear = self::daysPerYear(DateTime::YEAR($settlement), $basis);
$prev = self::couponFirstPeriodDate($settlement, $maturity, $frequency, false);
- return PHPExcel_Calculation_DateTime::YEARFRAC($prev, $settlement, $basis) * $daysPerYear;
+ return DateTime::YEARFRAC($prev, $settlement, $basis) * $daysPerYear;
}
-
/**
- * COUPDAYS
+ * COUPDAYS.
*
* Returns the number of days in the coupon period that contains the settlement date.
*
* Excel Function:
* COUPDAYS(settlement,maturity,frequency[,basis])
*
- * @access public
* @category Financial Functions
- * @param mixed settlement The security's settlement date.
+ *
+ * @param mixed $settlement The security's settlement date.
* The security settlement date is the date after the issue
* date when the security is traded to the buyer.
- * @param mixed maturity The security's maturity date.
+ * @param mixed $maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param mixed frequency the number of coupon payments per year.
+ * @param mixed $frequency the number of coupon payments per year.
* Valid frequency values are:
* 1 Annual
* 2 Semi-Annual
@@ -492,32 +453,33 @@ class PHPExcel_Calculation_Financial
* also available
* 6 Bimonthly
* 12 Monthly
- * @param integer basis The type of day count to use.
+ * @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return float
+ *
+ * @return float|string
*/
public static function COUPDAYS($settlement, $maturity, $frequency, $basis = 0)
{
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
- $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency);
- $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $frequency = (int) Functions::flattenSingleValue($frequency);
+ $basis = ($basis === null) ? 0 : (int) Functions::flattenSingleValue($basis);
- if (is_string($settlement = PHPExcel_Calculation_DateTime::getDateValue($settlement))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ if (is_string($settlement = DateTime::getDateValue($settlement))) {
+ return Functions::VALUE();
}
- if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ if (is_string($maturity = DateTime::getDateValue($maturity))) {
+ return Functions::VALUE();
}
if (($settlement > $maturity) ||
(!self::isValidFrequency($frequency)) ||
(($basis < 0) || ($basis > 4))) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
switch ($basis) {
@@ -527,36 +489,36 @@ class PHPExcel_Calculation_Financial
case 1:
// Actual/actual
if ($frequency == 1) {
- $daysPerYear = self::daysPerYear(PHPExcel_Calculation_DateTime::YEAR($maturity), $basis);
- return ($daysPerYear / $frequency);
+ $daysPerYear = self::daysPerYear(DateTime::YEAR($settlement), $basis);
+
+ return $daysPerYear / $frequency;
}
$prev = self::couponFirstPeriodDate($settlement, $maturity, $frequency, false);
$next = self::couponFirstPeriodDate($settlement, $maturity, $frequency, true);
- return ($next - $prev);
+
+ return $next - $prev;
default:
// US (NASD) 30/360, Actual/360 or European 30/360
return 360 / $frequency;
}
- return PHPExcel_Calculation_Functions::VALUE();
}
-
/**
- * COUPDAYSNC
+ * COUPDAYSNC.
*
* Returns the number of days from the settlement date to the next coupon date.
*
* Excel Function:
* COUPDAYSNC(settlement,maturity,frequency[,basis])
*
- * @access public
* @category Financial Functions
- * @param mixed settlement The security's settlement date.
+ *
+ * @param mixed $settlement The security's settlement date.
* The security settlement date is the date after the issue
* date when the security is traded to the buyer.
- * @param mixed maturity The security's maturity date.
+ * @param mixed $maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param mixed frequency the number of coupon payments per year.
+ * @param mixed $frequency the number of coupon payments per year.
* Valid frequency values are:
* 1 Annual
* 2 Semi-Annual
@@ -565,57 +527,57 @@ class PHPExcel_Calculation_Financial
* also available
* 6 Bimonthly
* 12 Monthly
- * @param integer basis The type of day count to use.
+ * @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return float
+ *
+ * @return float|string
*/
public static function COUPDAYSNC($settlement, $maturity, $frequency, $basis = 0)
{
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
- $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency);
- $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $frequency = (int) Functions::flattenSingleValue($frequency);
+ $basis = ($basis === null) ? 0 : (int) Functions::flattenSingleValue($basis);
- if (is_string($settlement = PHPExcel_Calculation_DateTime::getDateValue($settlement))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ if (is_string($settlement = DateTime::getDateValue($settlement))) {
+ return Functions::VALUE();
}
- if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ if (is_string($maturity = DateTime::getDateValue($maturity))) {
+ return Functions::VALUE();
}
if (($settlement > $maturity) ||
(!self::isValidFrequency($frequency)) ||
(($basis < 0) || ($basis > 4))) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- $daysPerYear = self::daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement), $basis);
+ $daysPerYear = self::daysPerYear(DateTime::YEAR($settlement), $basis);
$next = self::couponFirstPeriodDate($settlement, $maturity, $frequency, true);
- return PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $next, $basis) * $daysPerYear;
+ return DateTime::YEARFRAC($settlement, $next, $basis) * $daysPerYear;
}
-
/**
- * COUPNCD
+ * COUPNCD.
*
* Returns the next coupon date after the settlement date.
*
* Excel Function:
* COUPNCD(settlement,maturity,frequency[,basis])
*
- * @access public
* @category Financial Functions
- * @param mixed settlement The security's settlement date.
+ *
+ * @param mixed $settlement The security's settlement date.
* The security settlement date is the date after the issue
* date when the security is traded to the buyer.
- * @param mixed maturity The security's maturity date.
+ * @param mixed $maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param mixed frequency the number of coupon payments per year.
+ * @param mixed $frequency the number of coupon payments per year.
* Valid frequency values are:
* 1 Annual
* 2 Semi-Annual
@@ -624,41 +586,41 @@ class PHPExcel_Calculation_Financial
* also available
* 6 Bimonthly
* 12 Monthly
- * @param integer basis The type of day count to use.
+ * @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ *
+ * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
public static function COUPNCD($settlement, $maturity, $frequency, $basis = 0)
{
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
- $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency);
- $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $frequency = (int) Functions::flattenSingleValue($frequency);
+ $basis = ($basis === null) ? 0 : (int) Functions::flattenSingleValue($basis);
- if (is_string($settlement = PHPExcel_Calculation_DateTime::getDateValue($settlement))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ if (is_string($settlement = DateTime::getDateValue($settlement))) {
+ return Functions::VALUE();
}
- if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ if (is_string($maturity = DateTime::getDateValue($maturity))) {
+ return Functions::VALUE();
}
if (($settlement > $maturity) ||
(!self::isValidFrequency($frequency)) ||
(($basis < 0) || ($basis > 4))) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
return self::couponFirstPeriodDate($settlement, $maturity, $frequency, true);
}
-
/**
- * COUPNUM
+ * COUPNUM.
*
* Returns the number of coupons payable between the settlement date and maturity date,
* rounded up to the nearest whole coupon.
@@ -666,14 +628,14 @@ class PHPExcel_Calculation_Financial
* Excel Function:
* COUPNUM(settlement,maturity,frequency[,basis])
*
- * @access public
* @category Financial Functions
- * @param mixed settlement The security's settlement date.
+ *
+ * @param mixed $settlement The security's settlement date.
* The security settlement date is the date after the issue
* date when the security is traded to the buyer.
- * @param mixed maturity The security's maturity date.
+ * @param mixed $maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param mixed frequency the number of coupon payments per year.
+ * @param mixed $frequency the number of coupon payments per year.
* Valid frequency values are:
* 1 Annual
* 2 Semi-Annual
@@ -682,36 +644,37 @@ class PHPExcel_Calculation_Financial
* also available
* 6 Bimonthly
* 12 Monthly
- * @param integer basis The type of day count to use.
+ * @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return integer
+ *
+ * @return int|string
*/
public static function COUPNUM($settlement, $maturity, $frequency, $basis = 0)
{
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
- $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency);
- $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $frequency = (int) Functions::flattenSingleValue($frequency);
+ $basis = ($basis === null) ? 0 : (int) Functions::flattenSingleValue($basis);
- if (is_string($settlement = PHPExcel_Calculation_DateTime::getDateValue($settlement))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ if (is_string($settlement = DateTime::getDateValue($settlement))) {
+ return Functions::VALUE();
}
- if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ if (is_string($maturity = DateTime::getDateValue($maturity))) {
+ return Functions::VALUE();
}
if (($settlement > $maturity) ||
(!self::isValidFrequency($frequency)) ||
(($basis < 0) || ($basis > 4))) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
$settlement = self::couponFirstPeriodDate($settlement, $maturity, $frequency, true);
- $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis) * 365;
+ $daysBetweenSettlementAndMaturity = DateTime::YEARFRAC($settlement, $maturity, $basis) * 365;
switch ($frequency) {
case 1: // annual payments
@@ -725,26 +688,26 @@ class PHPExcel_Calculation_Financial
case 12: // monthly
return ceil($daysBetweenSettlementAndMaturity / 30);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * COUPPCD
+ * COUPPCD.
*
* Returns the previous coupon date before the settlement date.
*
* Excel Function:
* COUPPCD(settlement,maturity,frequency[,basis])
*
- * @access public
* @category Financial Functions
- * @param mixed settlement The security's settlement date.
+ *
+ * @param mixed $settlement The security's settlement date.
* The security settlement date is the date after the issue
* date when the security is traded to the buyer.
- * @param mixed maturity The security's maturity date.
+ * @param mixed $maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param mixed frequency the number of coupon payments per year.
+ * @param mixed $frequency the number of coupon payments per year.
* Valid frequency values are:
* 1 Annual
* 2 Semi-Annual
@@ -753,75 +716,76 @@ class PHPExcel_Calculation_Financial
* also available
* 6 Bimonthly
* 12 Monthly
- * @param integer basis The type of day count to use.
+ * @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
+ *
+ * @return mixed Excel date/time serial value, PHP date/time serial value or PHP date/time object,
* depending on the value of the ReturnDateType flag
*/
public static function COUPPCD($settlement, $maturity, $frequency, $basis = 0)
{
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
- $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency);
- $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $frequency = (int) Functions::flattenSingleValue($frequency);
+ $basis = ($basis === null) ? 0 : (int) Functions::flattenSingleValue($basis);
- if (is_string($settlement = PHPExcel_Calculation_DateTime::getDateValue($settlement))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ if (is_string($settlement = DateTime::getDateValue($settlement))) {
+ return Functions::VALUE();
}
- if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ if (is_string($maturity = DateTime::getDateValue($maturity))) {
+ return Functions::VALUE();
}
if (($settlement > $maturity) ||
(!self::isValidFrequency($frequency)) ||
(($basis < 0) || ($basis > 4))) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
return self::couponFirstPeriodDate($settlement, $maturity, $frequency, false);
}
-
/**
- * CUMIPMT
+ * CUMIPMT.
*
* Returns the cumulative interest paid on a loan between the start and end periods.
*
* Excel Function:
* CUMIPMT(rate,nper,pv,start,end[,type])
*
- * @access public
* @category Financial Functions
- * @param float $rate The Interest rate
- * @param integer $nper The total number of payment periods
- * @param float $pv Present Value
- * @param integer $start The first period in the calculation.
+ *
+ * @param float $rate The Interest rate
+ * @param int $nper The total number of payment periods
+ * @param float $pv Present Value
+ * @param int $start The first period in the calculation.
* Payment periods are numbered beginning with 1.
- * @param integer $end The last period in the calculation.
- * @param integer $type A number 0 or 1 and indicates when payments are due:
+ * @param int $end the last period in the calculation
+ * @param int $type A number 0 or 1 and indicates when payments are due:
* 0 or omitted At the end of the period.
* 1 At the beginning of the period.
- * @return float
+ *
+ * @return float|string
*/
public static function CUMIPMT($rate, $nper, $pv, $start, $end, $type = 0)
{
- $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate);
- $nper = (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper);
- $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv);
- $start = (int) PHPExcel_Calculation_Functions::flattenSingleValue($start);
- $end = (int) PHPExcel_Calculation_Functions::flattenSingleValue($end);
- $type = (int) PHPExcel_Calculation_Functions::flattenSingleValue($type);
+ $rate = Functions::flattenSingleValue($rate);
+ $nper = (int) Functions::flattenSingleValue($nper);
+ $pv = Functions::flattenSingleValue($pv);
+ $start = (int) Functions::flattenSingleValue($start);
+ $end = (int) Functions::flattenSingleValue($end);
+ $type = (int) Functions::flattenSingleValue($type);
// Validate parameters
if ($type != 0 && $type != 1) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if ($start < 1 || $start > $end) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
// Calculate
@@ -833,43 +797,43 @@ class PHPExcel_Calculation_Financial
return $interest;
}
-
/**
- * CUMPRINC
+ * CUMPRINC.
*
* Returns the cumulative principal paid on a loan between the start and end periods.
*
* Excel Function:
* CUMPRINC(rate,nper,pv,start,end[,type])
*
- * @access public
* @category Financial Functions
- * @param float $rate The Interest rate
- * @param integer $nper The total number of payment periods
- * @param float $pv Present Value
- * @param integer $start The first period in the calculation.
+ *
+ * @param float $rate The Interest rate
+ * @param int $nper The total number of payment periods
+ * @param float $pv Present Value
+ * @param int $start The first period in the calculation.
* Payment periods are numbered beginning with 1.
- * @param integer $end The last period in the calculation.
- * @param integer $type A number 0 or 1 and indicates when payments are due:
+ * @param int $end the last period in the calculation
+ * @param int $type A number 0 or 1 and indicates when payments are due:
* 0 or omitted At the end of the period.
* 1 At the beginning of the period.
- * @return float
+ *
+ * @return float|string
*/
public static function CUMPRINC($rate, $nper, $pv, $start, $end, $type = 0)
{
- $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate);
- $nper = (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper);
- $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv);
- $start = (int) PHPExcel_Calculation_Functions::flattenSingleValue($start);
- $end = (int) PHPExcel_Calculation_Functions::flattenSingleValue($end);
- $type = (int) PHPExcel_Calculation_Functions::flattenSingleValue($type);
+ $rate = Functions::flattenSingleValue($rate);
+ $nper = (int) Functions::flattenSingleValue($nper);
+ $pv = Functions::flattenSingleValue($pv);
+ $start = (int) Functions::flattenSingleValue($start);
+ $end = (int) Functions::flattenSingleValue($end);
+ $type = (int) Functions::flattenSingleValue($type);
// Validate parameters
if ($type != 0 && $type != 1) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if ($start < 1 || $start > $end) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
// Calculate
@@ -881,9 +845,8 @@ class PHPExcel_Calculation_Financial
return $principal;
}
-
/**
- * DB
+ * DB.
*
* Returns the depreciation of an asset for a specified period using the
* fixed-declining balance method.
@@ -895,38 +858,39 @@ class PHPExcel_Calculation_Financial
* Excel Function:
* DB(cost,salvage,life,period[,month])
*
- * @access public
* @category Financial Functions
- * @param float cost Initial cost of the asset.
- * @param float salvage Value at the end of the depreciation.
+ *
+ * @param float $cost Initial cost of the asset
+ * @param float $salvage Value at the end of the depreciation.
* (Sometimes called the salvage value of the asset)
- * @param integer life Number of periods over which the asset is depreciated.
+ * @param int $life Number of periods over which the asset is depreciated.
* (Sometimes called the useful life of the asset)
- * @param integer period The period for which you want to calculate the
+ * @param int $period The period for which you want to calculate the
* depreciation. Period must use the same units as life.
- * @param integer month Number of months in the first year. If month is omitted,
+ * @param int $month Number of months in the first year. If month is omitted,
* it defaults to 12.
- * @return float
+ *
+ * @return float|string
*/
public static function DB($cost, $salvage, $life, $period, $month = 12)
{
- $cost = PHPExcel_Calculation_Functions::flattenSingleValue($cost);
- $salvage = PHPExcel_Calculation_Functions::flattenSingleValue($salvage);
- $life = PHPExcel_Calculation_Functions::flattenSingleValue($life);
- $period = PHPExcel_Calculation_Functions::flattenSingleValue($period);
- $month = PHPExcel_Calculation_Functions::flattenSingleValue($month);
+ $cost = Functions::flattenSingleValue($cost);
+ $salvage = Functions::flattenSingleValue($salvage);
+ $life = Functions::flattenSingleValue($life);
+ $period = Functions::flattenSingleValue($period);
+ $month = Functions::flattenSingleValue($month);
// Validate
if ((is_numeric($cost)) && (is_numeric($salvage)) && (is_numeric($life)) && (is_numeric($period)) && (is_numeric($month))) {
- $cost = (float) $cost;
+ $cost = (float) $cost;
$salvage = (float) $salvage;
- $life = (int) $life;
- $period = (int) $period;
- $month = (int) $month;
+ $life = (int) $life;
+ $period = (int) $period;
+ $month = (int) $month;
if ($cost == 0) {
return 0.0;
} elseif (($cost < 0) || (($salvage / $cost) < 0) || ($life <= 0) || ($period < 1) || ($month < 1)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
// Set Fixed Depreciation Rate
$fixedDepreciationRate = 1 - pow(($salvage / $cost), (1 / $life));
@@ -944,17 +908,18 @@ class PHPExcel_Calculation_Financial
}
$previousDepreciation += $depreciation;
}
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) {
$depreciation = round($depreciation, 2);
}
+
return $depreciation;
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * DDB
+ * DDB.
*
* Returns the depreciation of an asset for a specified period using the
* double-declining balance method or some other method you specify.
@@ -962,37 +927,38 @@ class PHPExcel_Calculation_Financial
* Excel Function:
* DDB(cost,salvage,life,period[,factor])
*
- * @access public
* @category Financial Functions
- * @param float cost Initial cost of the asset.
- * @param float salvage Value at the end of the depreciation.
+ *
+ * @param float $cost Initial cost of the asset
+ * @param float $salvage Value at the end of the depreciation.
* (Sometimes called the salvage value of the asset)
- * @param integer life Number of periods over which the asset is depreciated.
+ * @param int $life Number of periods over which the asset is depreciated.
* (Sometimes called the useful life of the asset)
- * @param integer period The period for which you want to calculate the
+ * @param int $period The period for which you want to calculate the
* depreciation. Period must use the same units as life.
- * @param float factor The rate at which the balance declines.
+ * @param float $factor The rate at which the balance declines.
* If factor is omitted, it is assumed to be 2 (the
* double-declining balance method).
- * @return float
+ *
+ * @return float|string
*/
public static function DDB($cost, $salvage, $life, $period, $factor = 2.0)
{
- $cost = PHPExcel_Calculation_Functions::flattenSingleValue($cost);
- $salvage = PHPExcel_Calculation_Functions::flattenSingleValue($salvage);
- $life = PHPExcel_Calculation_Functions::flattenSingleValue($life);
- $period = PHPExcel_Calculation_Functions::flattenSingleValue($period);
- $factor = PHPExcel_Calculation_Functions::flattenSingleValue($factor);
+ $cost = Functions::flattenSingleValue($cost);
+ $salvage = Functions::flattenSingleValue($salvage);
+ $life = Functions::flattenSingleValue($life);
+ $period = Functions::flattenSingleValue($period);
+ $factor = Functions::flattenSingleValue($factor);
// Validate
if ((is_numeric($cost)) && (is_numeric($salvage)) && (is_numeric($life)) && (is_numeric($period)) && (is_numeric($factor))) {
- $cost = (float) $cost;
+ $cost = (float) $cost;
$salvage = (float) $salvage;
- $life = (int) $life;
- $period = (int) $period;
- $factor = (float) $factor;
+ $life = (int) $life;
+ $period = (int) $period;
+ $factor = (float) $factor;
if (($cost <= 0) || (($salvage / $cost) < 0) || ($life <= 0) || ($period < 1) || ($factor <= 0.0) || ($period > $life)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
// Set Fixed Depreciation Rate
$fixedDepreciationRate = 1 - pow(($salvage / $cost), (1 / $life));
@@ -1004,70 +970,72 @@ class PHPExcel_Calculation_Financial
$depreciation = min(($cost - $previousDepreciation) * ($factor / $life), ($cost - $salvage - $previousDepreciation));
$previousDepreciation += $depreciation;
}
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) {
$depreciation = round($depreciation, 2);
}
+
return $depreciation;
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * DISC
+ * DISC.
*
* Returns the discount rate for a security.
*
* Excel Function:
* DISC(settlement,maturity,price,redemption[,basis])
*
- * @access public
* @category Financial Functions
- * @param mixed settlement The security's settlement date.
+ *
+ * @param mixed $settlement The security's settlement date.
* The security settlement date is the date after the issue
* date when the security is traded to the buyer.
- * @param mixed maturity The security's maturity date.
+ * @param mixed $maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param integer price The security's price per $100 face value.
- * @param integer redemption The security's redemption value per $100 face value.
- * @param integer basis The type of day count to use.
+ * @param int $price The security's price per $100 face value
+ * @param int $redemption The security's redemption value per $100 face value
+ * @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return float
+ *
+ * @return float|string
*/
public static function DISC($settlement, $maturity, $price, $redemption, $basis = 0)
{
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
- $price = PHPExcel_Calculation_Functions::flattenSingleValue($price);
- $redemption = PHPExcel_Calculation_Functions::flattenSingleValue($redemption);
- $basis = PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $price = Functions::flattenSingleValue($price);
+ $redemption = Functions::flattenSingleValue($redemption);
+ $basis = Functions::flattenSingleValue($basis);
// Validate
if ((is_numeric($price)) && (is_numeric($redemption)) && (is_numeric($basis))) {
- $price = (float) $price;
- $redemption = (float) $redemption;
- $basis = (int) $basis;
+ $price = (float) $price;
+ $redemption = (float) $redemption;
+ $basis = (int) $basis;
if (($price <= 0) || ($redemption <= 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis);
+ $daysBetweenSettlementAndMaturity = DateTime::YEARFRAC($settlement, $maturity, $basis);
if (!is_numeric($daysBetweenSettlementAndMaturity)) {
// return date error
return $daysBetweenSettlementAndMaturity;
}
- return ((1 - $price / $redemption) / $daysBetweenSettlementAndMaturity);
+ return (1 - $price / $redemption) / $daysBetweenSettlementAndMaturity;
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * DOLLARDE
+ * DOLLARDE.
*
* Converts a dollar price expressed as an integer part and a fraction
* part into a dollar price expressed as a decimal number.
@@ -1076,35 +1044,36 @@ class PHPExcel_Calculation_Financial
* Excel Function:
* DOLLARDE(fractional_dollar,fraction)
*
- * @access public
* @category Financial Functions
- * @param float $fractional_dollar Fractional Dollar
- * @param integer $fraction Fraction
- * @return float
+ *
+ * @param float $fractional_dollar Fractional Dollar
+ * @param int $fraction Fraction
+ *
+ * @return float|string
*/
public static function DOLLARDE($fractional_dollar = null, $fraction = 0)
{
- $fractional_dollar = PHPExcel_Calculation_Functions::flattenSingleValue($fractional_dollar);
- $fraction = (int)PHPExcel_Calculation_Functions::flattenSingleValue($fraction);
+ $fractional_dollar = Functions::flattenSingleValue($fractional_dollar);
+ $fraction = (int) Functions::flattenSingleValue($fraction);
// Validate parameters
- if (is_null($fractional_dollar) || $fraction < 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ if ($fractional_dollar === null || $fraction < 0) {
+ return Functions::NAN();
}
if ($fraction == 0) {
- return PHPExcel_Calculation_Functions::DIV0();
+ return Functions::DIV0();
}
$dollars = floor($fractional_dollar);
$cents = fmod($fractional_dollar, 1);
$cents /= $fraction;
$cents *= pow(10, ceil(log10($fraction)));
+
return $dollars + $cents;
}
-
/**
- * DOLLARFR
+ * DOLLARFR.
*
* Converts a dollar price expressed as a decimal number into a dollar price
* expressed as a fraction.
@@ -1113,35 +1082,36 @@ class PHPExcel_Calculation_Financial
* Excel Function:
* DOLLARFR(decimal_dollar,fraction)
*
- * @access public
* @category Financial Functions
- * @param float $decimal_dollar Decimal Dollar
- * @param integer $fraction Fraction
- * @return float
+ *
+ * @param float $decimal_dollar Decimal Dollar
+ * @param int $fraction Fraction
+ *
+ * @return float|string
*/
public static function DOLLARFR($decimal_dollar = null, $fraction = 0)
{
- $decimal_dollar = PHPExcel_Calculation_Functions::flattenSingleValue($decimal_dollar);
- $fraction = (int)PHPExcel_Calculation_Functions::flattenSingleValue($fraction);
+ $decimal_dollar = Functions::flattenSingleValue($decimal_dollar);
+ $fraction = (int) Functions::flattenSingleValue($fraction);
// Validate parameters
- if (is_null($decimal_dollar) || $fraction < 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ if ($decimal_dollar === null || $fraction < 0) {
+ return Functions::NAN();
}
if ($fraction == 0) {
- return PHPExcel_Calculation_Functions::DIV0();
+ return Functions::DIV0();
}
$dollars = floor($decimal_dollar);
$cents = fmod($decimal_dollar, 1);
$cents *= $fraction;
$cents *= pow(10, -ceil(log10($fraction)));
+
return $dollars + $cents;
}
-
/**
- * EFFECT
+ * EFFECT.
*
* Returns the effective interest rate given the nominal rate and the number of
* compounding payments per year.
@@ -1149,71 +1119,72 @@ class PHPExcel_Calculation_Financial
* Excel Function:
* EFFECT(nominal_rate,npery)
*
- * @access public
* @category Financial Functions
- * @param float $nominal_rate Nominal interest rate
- * @param integer $npery Number of compounding payments per year
- * @return float
+ *
+ * @param float $nominal_rate Nominal interest rate
+ * @param int $npery Number of compounding payments per year
+ *
+ * @return float|string
*/
public static function EFFECT($nominal_rate = 0, $npery = 0)
{
- $nominal_rate = PHPExcel_Calculation_Functions::flattenSingleValue($nominal_rate);
- $npery = (int)PHPExcel_Calculation_Functions::flattenSingleValue($npery);
+ $nominal_rate = Functions::flattenSingleValue($nominal_rate);
+ $npery = (int) Functions::flattenSingleValue($npery);
// Validate parameters
if ($nominal_rate <= 0 || $npery < 1) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
return pow((1 + $nominal_rate / $npery), $npery) - 1;
}
-
/**
- * FV
+ * FV.
*
* Returns the Future Value of a cash flow with constant payments and interest rate (annuities).
*
* Excel Function:
* FV(rate,nper,pmt[,pv[,type]])
*
- * @access public
* @category Financial Functions
- * @param float $rate The interest rate per period
- * @param int $nper Total number of payment periods in an annuity
- * @param float $pmt The payment made each period: it cannot change over the
+ *
+ * @param float $rate The interest rate per period
+ * @param int $nper Total number of payment periods in an annuity
+ * @param float $pmt The payment made each period: it cannot change over the
* life of the annuity. Typically, pmt contains principal
* and interest but no other fees or taxes.
- * @param float $pv Present Value, or the lump-sum amount that a series of
- * future payments is worth right now.
- * @param integer $type A number 0 or 1 and indicates when payments are due:
+ * @param float $pv present Value, or the lump-sum amount that a series of
+ * future payments is worth right now
+ * @param int $type A number 0 or 1 and indicates when payments are due:
* 0 or omitted At the end of the period.
* 1 At the beginning of the period.
- * @return float
+ *
+ * @return float|string
*/
public static function FV($rate = 0, $nper = 0, $pmt = 0, $pv = 0, $type = 0)
{
- $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate);
- $nper = PHPExcel_Calculation_Functions::flattenSingleValue($nper);
- $pmt = PHPExcel_Calculation_Functions::flattenSingleValue($pmt);
- $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv);
- $type = PHPExcel_Calculation_Functions::flattenSingleValue($type);
+ $rate = Functions::flattenSingleValue($rate);
+ $nper = Functions::flattenSingleValue($nper);
+ $pmt = Functions::flattenSingleValue($pmt);
+ $pv = Functions::flattenSingleValue($pv);
+ $type = Functions::flattenSingleValue($type);
// Validate parameters
if ($type != 0 && $type != 1) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
// Calculate
- if (!is_null($rate) && $rate != 0) {
+ if ($rate !== null && $rate != 0) {
return -$pv * pow(1 + $rate, $nper) - $pmt * (1 + $rate * $type) * (pow(1 + $rate, $nper) - 1) / $rate;
}
+
return -$pv - $pmt * $nper;
}
-
/**
- * FVSCHEDULE
+ * FVSCHEDULE.
*
* Returns the future value of an initial principal after applying a series of compound interest rates.
* Use FVSCHEDULE to calculate the future value of an investment with a variable or adjustable rate.
@@ -1221,14 +1192,15 @@ class PHPExcel_Calculation_Financial
* Excel Function:
* FVSCHEDULE(principal,schedule)
*
- * @param float $principal The present value.
- * @param float[] $schedule An array of interest rates to apply.
- * @return float
+ * @param float $principal the present value
+ * @param float[] $schedule an array of interest rates to apply
+ *
+ * @return float
*/
public static function FVSCHEDULE($principal, $schedule)
{
- $principal = PHPExcel_Calculation_Functions::flattenSingleValue($principal);
- $schedule = PHPExcel_Calculation_Functions::flattenArray($schedule);
+ $principal = Functions::flattenSingleValue($principal);
+ $schedule = Functions::flattenArray($schedule);
foreach ($schedule as $rate) {
$principal *= 1 + $rate;
@@ -1237,46 +1209,46 @@ class PHPExcel_Calculation_Financial
return $principal;
}
-
/**
- * INTRATE
+ * INTRATE.
*
* Returns the interest rate for a fully invested security.
*
* Excel Function:
* INTRATE(settlement,maturity,investment,redemption[,basis])
*
- * @param mixed $settlement The security's settlement date.
+ * @param mixed $settlement The security's settlement date.
* The security settlement date is the date after the issue date when the security is traded to the buyer.
- * @param mixed $maturity The security's maturity date.
+ * @param mixed $maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param integer $investment The amount invested in the security.
- * @param integer $redemption The amount to be received at maturity.
- * @param integer $basis The type of day count to use.
+ * @param int $investment the amount invested in the security
+ * @param int $redemption the amount to be received at maturity
+ * @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return float
+ *
+ * @return float|string
*/
public static function INTRATE($settlement, $maturity, $investment, $redemption, $basis = 0)
{
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
- $investment = PHPExcel_Calculation_Functions::flattenSingleValue($investment);
- $redemption = PHPExcel_Calculation_Functions::flattenSingleValue($redemption);
- $basis = PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $investment = Functions::flattenSingleValue($investment);
+ $redemption = Functions::flattenSingleValue($redemption);
+ $basis = Functions::flattenSingleValue($basis);
// Validate
if ((is_numeric($investment)) && (is_numeric($redemption)) && (is_numeric($basis))) {
- $investment = (float) $investment;
- $redemption = (float) $redemption;
- $basis = (int) $basis;
+ $investment = (float) $investment;
+ $redemption = (float) $redemption;
+ $basis = (int) $basis;
if (($investment <= 0) || ($redemption <= 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis);
+ $daysBetweenSettlementAndMaturity = DateTime::YEARFRAC($settlement, $maturity, $basis);
if (!is_numeric($daysBetweenSettlementAndMaturity)) {
// return date error
return $daysBetweenSettlementAndMaturity;
@@ -1284,50 +1256,52 @@ class PHPExcel_Calculation_Financial
return (($redemption / $investment) - 1) / ($daysBetweenSettlementAndMaturity);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * IPMT
+ * IPMT.
*
* Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate.
*
* Excel Function:
* IPMT(rate,per,nper,pv[,fv][,type])
*
- * @param float $rate Interest rate per period
- * @param int $per Period for which we want to find the interest
- * @param int $nper Number of periods
- * @param float $pv Present Value
- * @param float $fv Future Value
- * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
- * @return float
+ * @param float $rate Interest rate per period
+ * @param int $per Period for which we want to find the interest
+ * @param int $nper Number of periods
+ * @param float $pv Present Value
+ * @param float $fv Future Value
+ * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
+ *
+ * @return float|string
*/
public static function IPMT($rate, $per, $nper, $pv, $fv = 0, $type = 0)
{
- $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate);
- $per = (int) PHPExcel_Calculation_Functions::flattenSingleValue($per);
- $nper = (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper);
- $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv);
- $fv = PHPExcel_Calculation_Functions::flattenSingleValue($fv);
- $type = (int) PHPExcel_Calculation_Functions::flattenSingleValue($type);
+ $rate = Functions::flattenSingleValue($rate);
+ $per = (int) Functions::flattenSingleValue($per);
+ $nper = (int) Functions::flattenSingleValue($nper);
+ $pv = Functions::flattenSingleValue($pv);
+ $fv = Functions::flattenSingleValue($fv);
+ $type = (int) Functions::flattenSingleValue($type);
// Validate parameters
if ($type != 0 && $type != 1) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if ($per <= 0 || $per > $nper) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
// Calculate
$interestAndPrincipal = self::interestAndPrincipal($rate, $per, $nper, $pv, $fv, $type);
+
return $interestAndPrincipal[0];
}
/**
- * IRR
+ * IRR.
*
* Returns the internal rate of return for a series of cash flows represented by the numbers in values.
* These cash flows do not have to be even, as they would be for an annuity. However, the cash flows must occur
@@ -1338,27 +1312,28 @@ class PHPExcel_Calculation_Financial
* Excel Function:
* IRR(values[,guess])
*
- * @param float[] $values An array or a reference to cells that contain numbers for which you want
+ * @param float[] $values An array or a reference to cells that contain numbers for which you want
* to calculate the internal rate of return.
* Values must contain at least one positive value and one negative value to
* calculate the internal rate of return.
- * @param float $guess A number that you guess is close to the result of IRR
- * @return float
+ * @param float $guess A number that you guess is close to the result of IRR
+ *
+ * @return float|string
*/
public static function IRR($values, $guess = 0.1)
{
if (!is_array($values)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
- $values = PHPExcel_Calculation_Functions::flattenArray($values);
- $guess = PHPExcel_Calculation_Functions::flattenSingleValue($guess);
+ $values = Functions::flattenArray($values);
+ $guess = Functions::flattenSingleValue($guess);
// create an initial range, with a root somewhere between 0 and guess
$x1 = 0.0;
$x2 = $guess;
$f1 = self::NPV($x1, $values);
$f2 = self::NPV($x2, $values);
- for ($i = 0; $i < FINANCIAL_MAX_ITERATIONS; ++$i) {
+ for ($i = 0; $i < self::FINANCIAL_MAX_ITERATIONS; ++$i) {
if (($f1 * $f2) < 0.0) {
break;
}
@@ -1369,7 +1344,7 @@ class PHPExcel_Calculation_Financial
}
}
if (($f1 * $f2) > 0.0) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$f = self::NPV($x1, $values);
@@ -1381,23 +1356,23 @@ class PHPExcel_Calculation_Financial
$dx = $x1 - $x2;
}
- for ($i = 0; $i < FINANCIAL_MAX_ITERATIONS; ++$i) {
+ for ($i = 0; $i < self::FINANCIAL_MAX_ITERATIONS; ++$i) {
$dx *= 0.5;
$x_mid = $rtb + $dx;
$f_mid = self::NPV($x_mid, $values);
if ($f_mid <= 0.0) {
$rtb = $x_mid;
}
- if ((abs($f_mid) < FINANCIAL_PRECISION) || (abs($dx) < FINANCIAL_PRECISION)) {
+ if ((abs($f_mid) < self::FINANCIAL_PRECISION) || (abs($dx) < self::FINANCIAL_PRECISION)) {
return $x_mid;
}
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * ISPMT
+ * ISPMT.
*
* Returns the interest payment for an investment based on an interest rate and a constant payment schedule.
*
@@ -1412,13 +1387,13 @@ class PHPExcel_Calculation_Financial
*
* PV is the loan amount or present value of the payments
*/
- public static function ISPMT()
+ public static function ISPMT(...$args)
{
// Return value
$returnValue = 0;
// Get the parameters
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
$interestRate = array_shift($aArgs);
$period = array_shift($aArgs);
$numberPeriods = array_shift($aArgs);
@@ -1426,7 +1401,7 @@ class PHPExcel_Calculation_Financial
// Calculate
$principlePayment = ($principleRemaining * 1.0) / ($numberPeriods * 1.0);
- for ($i=0; $i <= $period; ++$i) {
+ for ($i = 0; $i <= $period; ++$i) {
$returnValue = $interestRate * $principleRemaining * -1;
$principleRemaining -= $principlePayment;
// principle needs to be 0 after the last payment, don't let floating point screw it up
@@ -1434,12 +1409,12 @@ class PHPExcel_Calculation_Financial
$returnValue = 0;
}
}
- return($returnValue);
+
+ return $returnValue;
}
-
/**
- * MIRR
+ * MIRR.
*
* Returns the modified internal rate of return for a series of periodic cash flows. MIRR considers both
* the cost of the investment and the interest received on reinvestment of cash.
@@ -1447,21 +1422,22 @@ class PHPExcel_Calculation_Financial
* Excel Function:
* MIRR(values,finance_rate, reinvestment_rate)
*
- * @param float[] $values An array or a reference to cells that contain a series of payments and
+ * @param float[] $values An array or a reference to cells that contain a series of payments and
* income occurring at regular intervals.
* Payments are negative value, income is positive values.
- * @param float $finance_rate The interest rate you pay on the money used in the cash flows
- * @param float $reinvestment_rate The interest rate you receive on the cash flows as you reinvest them
- * @return float
+ * @param float $finance_rate The interest rate you pay on the money used in the cash flows
+ * @param float $reinvestment_rate The interest rate you receive on the cash flows as you reinvest them
+ *
+ * @return float|string
*/
public static function MIRR($values, $finance_rate, $reinvestment_rate)
{
if (!is_array($values)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
- $values = PHPExcel_Calculation_Functions::flattenArray($values);
- $finance_rate = PHPExcel_Calculation_Functions::flattenSingleValue($finance_rate);
- $reinvestment_rate = PHPExcel_Calculation_Functions::flattenSingleValue($reinvestment_rate);
+ $values = Functions::flattenArray($values);
+ $finance_rate = Functions::flattenSingleValue($finance_rate);
+ $reinvestment_rate = Functions::flattenSingleValue($reinvestment_rate);
$n = count($values);
$rr = 1.0 + $reinvestment_rate;
@@ -1477,96 +1453,99 @@ class PHPExcel_Calculation_Financial
}
if (($npv_neg == 0) || ($npv_pos == 0) || ($reinvestment_rate <= -1)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$mirr = pow((-$npv_pos * pow($rr, $n))
/ ($npv_neg * ($rr)), (1.0 / ($n - 1))) - 1.0;
- return (is_finite($mirr) ? $mirr : PHPExcel_Calculation_Functions::VALUE());
+ return is_finite($mirr) ? $mirr : Functions::VALUE();
}
-
/**
- * NOMINAL
+ * NOMINAL.
*
* Returns the nominal interest rate given the effective rate and the number of compounding payments per year.
*
- * @param float $effect_rate Effective interest rate
- * @param int $npery Number of compounding payments per year
- * @return float
+ * @param float $effect_rate Effective interest rate
+ * @param int $npery Number of compounding payments per year
+ *
+ * @return float|string
*/
public static function NOMINAL($effect_rate = 0, $npery = 0)
{
- $effect_rate = PHPExcel_Calculation_Functions::flattenSingleValue($effect_rate);
- $npery = (int)PHPExcel_Calculation_Functions::flattenSingleValue($npery);
+ $effect_rate = Functions::flattenSingleValue($effect_rate);
+ $npery = (int) Functions::flattenSingleValue($npery);
// Validate parameters
if ($effect_rate <= 0 || $npery < 1) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
// Calculate
return $npery * (pow($effect_rate + 1, 1 / $npery) - 1);
}
-
/**
- * NPER
+ * NPER.
*
* Returns the number of periods for a cash flow with constant periodic payments (annuities), and interest rate.
*
- * @param float $rate Interest rate per period
- * @param int $pmt Periodic payment (annuity)
- * @param float $pv Present Value
- * @param float $fv Future Value
- * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
- * @return float
+ * @param float $rate Interest rate per period
+ * @param int $pmt Periodic payment (annuity)
+ * @param float $pv Present Value
+ * @param float $fv Future Value
+ * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
+ *
+ * @return float|string
*/
public static function NPER($rate = 0, $pmt = 0, $pv = 0, $fv = 0, $type = 0)
{
- $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate);
- $pmt = PHPExcel_Calculation_Functions::flattenSingleValue($pmt);
- $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv);
- $fv = PHPExcel_Calculation_Functions::flattenSingleValue($fv);
- $type = PHPExcel_Calculation_Functions::flattenSingleValue($type);
+ $rate = Functions::flattenSingleValue($rate);
+ $pmt = Functions::flattenSingleValue($pmt);
+ $pv = Functions::flattenSingleValue($pv);
+ $fv = Functions::flattenSingleValue($fv);
+ $type = Functions::flattenSingleValue($type);
// Validate parameters
if ($type != 0 && $type != 1) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
// Calculate
- if (!is_null($rate) && $rate != 0) {
+ if ($rate !== null && $rate != 0) {
if ($pmt == 0 && $pv == 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
+
return log(($pmt * (1 + $rate * $type) / $rate - $fv) / ($pv + $pmt * (1 + $rate * $type) / $rate)) / log(1 + $rate);
}
if ($pmt == 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- return (-$pv -$fv) / $pmt;
+
+ return (-$pv - $fv) / $pmt;
}
/**
- * NPV
+ * NPV.
*
* Returns the Net Present Value of a cash flow series given a discount rate.
*
- * @return float
+ * @return float
*/
- public static function NPV()
+ public static function NPV(...$args)
{
// Return value
$returnValue = 0;
// Loop through arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
// Calculate
$rate = array_shift($aArgs);
- for ($i = 1; $i <= count($aArgs); ++$i) {
+ $countArgs = count($aArgs);
+ for ($i = 1; $i <= $countArgs; ++$i) {
// Is it a numeric value?
if (is_numeric($aArgs[$i - 1])) {
$returnValue += $aArgs[$i - 1] / pow(1 + $rate, $i);
@@ -1578,95 +1557,124 @@ class PHPExcel_Calculation_Financial
}
/**
- * PMT
+ * PDURATION.
+ *
+ * Calculates the number of periods required for an investment to reach a specified value.
+ *
+ * @param float $rate Interest rate per period
+ * @param float $pv Present Value
+ * @param float $fv Future Value
+ *
+ * @return float|string
+ */
+ public static function PDURATION($rate = 0, $pv = 0, $fv = 0)
+ {
+ $rate = Functions::flattenSingleValue($rate);
+ $pv = Functions::flattenSingleValue($pv);
+ $fv = Functions::flattenSingleValue($fv);
+
+ // Validate parameters
+ if (!is_numeric($rate) || !is_numeric($pv) || !is_numeric($fv)) {
+ return Functions::VALUE();
+ } elseif ($rate <= 0.0 || $pv <= 0.0 || $fv <= 0.0) {
+ return Functions::NAN();
+ }
+
+ return (log($fv) - log($pv)) / log(1 + $rate);
+ }
+
+ /**
+ * PMT.
*
* Returns the constant payment (annuity) for a cash flow with a constant interest rate.
*
- * @param float $rate Interest rate per period
- * @param int $nper Number of periods
- * @param float $pv Present Value
- * @param float $fv Future Value
- * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
- * @return float
+ * @param float $rate Interest rate per period
+ * @param int $nper Number of periods
+ * @param float $pv Present Value
+ * @param float $fv Future Value
+ * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
+ *
+ * @return float
*/
public static function PMT($rate = 0, $nper = 0, $pv = 0, $fv = 0, $type = 0)
{
- $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate);
- $nper = PHPExcel_Calculation_Functions::flattenSingleValue($nper);
- $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv);
- $fv = PHPExcel_Calculation_Functions::flattenSingleValue($fv);
- $type = PHPExcel_Calculation_Functions::flattenSingleValue($type);
+ $rate = Functions::flattenSingleValue($rate);
+ $nper = Functions::flattenSingleValue($nper);
+ $pv = Functions::flattenSingleValue($pv);
+ $fv = Functions::flattenSingleValue($fv);
+ $type = Functions::flattenSingleValue($type);
// Validate parameters
if ($type != 0 && $type != 1) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
// Calculate
- if (!is_null($rate) && $rate != 0) {
+ if ($rate !== null && $rate != 0) {
return (-$fv - $pv * pow(1 + $rate, $nper)) / (1 + $rate * $type) / ((pow(1 + $rate, $nper) - 1) / $rate);
}
+
return (-$pv - $fv) / $nper;
}
-
/**
- * PPMT
+ * PPMT.
*
* Returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate.
*
- * @param float $rate Interest rate per period
- * @param int $per Period for which we want to find the interest
- * @param int $nper Number of periods
- * @param float $pv Present Value
- * @param float $fv Future Value
- * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
- * @return float
+ * @param float $rate Interest rate per period
+ * @param int $per Period for which we want to find the interest
+ * @param int $nper Number of periods
+ * @param float $pv Present Value
+ * @param float $fv Future Value
+ * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
+ *
+ * @return float
*/
public static function PPMT($rate, $per, $nper, $pv, $fv = 0, $type = 0)
{
- $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate);
- $per = (int) PHPExcel_Calculation_Functions::flattenSingleValue($per);
- $nper = (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper);
- $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv);
- $fv = PHPExcel_Calculation_Functions::flattenSingleValue($fv);
- $type = (int) PHPExcel_Calculation_Functions::flattenSingleValue($type);
+ $rate = Functions::flattenSingleValue($rate);
+ $per = (int) Functions::flattenSingleValue($per);
+ $nper = (int) Functions::flattenSingleValue($nper);
+ $pv = Functions::flattenSingleValue($pv);
+ $fv = Functions::flattenSingleValue($fv);
+ $type = (int) Functions::flattenSingleValue($type);
// Validate parameters
if ($type != 0 && $type != 1) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if ($per <= 0 || $per > $nper) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
// Calculate
$interestAndPrincipal = self::interestAndPrincipal($rate, $per, $nper, $pv, $fv, $type);
+
return $interestAndPrincipal[1];
}
-
public static function PRICE($settlement, $maturity, $rate, $yield, $redemption, $frequency, $basis = 0)
{
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
- $rate = (float) PHPExcel_Calculation_Functions::flattenSingleValue($rate);
- $yield = (float) PHPExcel_Calculation_Functions::flattenSingleValue($yield);
- $redemption = (float) PHPExcel_Calculation_Functions::flattenSingleValue($redemption);
- $frequency = (int) PHPExcel_Calculation_Functions::flattenSingleValue($frequency);
- $basis = (is_null($basis)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $rate = (float) Functions::flattenSingleValue($rate);
+ $yield = (float) Functions::flattenSingleValue($yield);
+ $redemption = (float) Functions::flattenSingleValue($redemption);
+ $frequency = (int) Functions::flattenSingleValue($frequency);
+ $basis = ($basis === null) ? 0 : (int) Functions::flattenSingleValue($basis);
- if (is_string($settlement = PHPExcel_Calculation_DateTime::getDateValue($settlement))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ if (is_string($settlement = DateTime::getDateValue($settlement))) {
+ return Functions::VALUE();
}
- if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ if (is_string($maturity = DateTime::getDateValue($maturity))) {
+ return Functions::VALUE();
}
if (($settlement > $maturity) ||
(!self::isValidFrequency($frequency)) ||
(($basis < 0) || ($basis > 4))) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
$dsc = self::COUPDAYSNC($settlement, $maturity, $frequency, $basis);
@@ -1674,9 +1682,9 @@ class PHPExcel_Calculation_Financial
$n = self::COUPNUM($settlement, $maturity, $frequency, $basis);
$a = self::COUPDAYBS($settlement, $maturity, $frequency, $basis);
- $baseYF = 1.0 + ($yield / $frequency);
- $rfp = 100 * ($rate / $frequency);
- $de = $dsc / $e;
+ $baseYF = 1.0 + ($yield / $frequency);
+ $rfp = 100 * ($rate / $frequency);
+ $de = $dsc / $e;
$result = $redemption / pow($baseYF, (--$n + $de));
for ($k = 0; $k <= $n; ++$k) {
@@ -1687,40 +1695,40 @@ class PHPExcel_Calculation_Financial
return $result;
}
-
/**
- * PRICEDISC
+ * PRICEDISC.
*
* Returns the price per $100 face value of a discounted security.
*
- * @param mixed settlement The security's settlement date.
+ * @param mixed $settlement The security's settlement date.
* The security settlement date is the date after the issue date when the security is traded to the buyer.
- * @param mixed maturity The security's maturity date.
+ * @param mixed $maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param int discount The security's discount rate.
- * @param int redemption The security's redemption value per $100 face value.
- * @param int basis The type of day count to use.
+ * @param int $discount The security's discount rate
+ * @param int $redemption The security's redemption value per $100 face value
+ * @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return float
+ *
+ * @return float
*/
public static function PRICEDISC($settlement, $maturity, $discount, $redemption, $basis = 0)
{
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
- $discount = (float) PHPExcel_Calculation_Functions::flattenSingleValue($discount);
- $redemption = (float) PHPExcel_Calculation_Functions::flattenSingleValue($redemption);
- $basis = (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $discount = (float) Functions::flattenSingleValue($discount);
+ $redemption = (float) Functions::flattenSingleValue($redemption);
+ $basis = (int) Functions::flattenSingleValue($basis);
// Validate
if ((is_numeric($discount)) && (is_numeric($redemption)) && (is_numeric($basis))) {
if (($discount <= 0) || ($redemption <= 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis);
+ $daysBetweenSettlementAndMaturity = DateTime::YEARFRAC($settlement, $maturity, $basis);
if (!is_numeric($daysBetweenSettlementAndMaturity)) {
// return date error
return $daysBetweenSettlementAndMaturity;
@@ -1728,110 +1736,112 @@ class PHPExcel_Calculation_Financial
return $redemption * (1 - $discount * $daysBetweenSettlementAndMaturity);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * PRICEMAT
+ * PRICEMAT.
*
* Returns the price per $100 face value of a security that pays interest at maturity.
*
- * @param mixed settlement The security's settlement date.
+ * @param mixed $settlement The security's settlement date.
* The security's settlement date is the date after the issue date when the security is traded to the buyer.
- * @param mixed maturity The security's maturity date.
+ * @param mixed $maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param mixed issue The security's issue date.
- * @param int rate The security's interest rate at date of issue.
- * @param int yield The security's annual yield.
- * @param int basis The type of day count to use.
+ * @param mixed $issue The security's issue date
+ * @param int $rate The security's interest rate at date of issue
+ * @param int $yield The security's annual yield
+ * @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return float
+ *
+ * @return float
*/
public static function PRICEMAT($settlement, $maturity, $issue, $rate, $yield, $basis = 0)
{
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
- $issue = PHPExcel_Calculation_Functions::flattenSingleValue($issue);
- $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate);
- $yield = PHPExcel_Calculation_Functions::flattenSingleValue($yield);
- $basis = (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $issue = Functions::flattenSingleValue($issue);
+ $rate = Functions::flattenSingleValue($rate);
+ $yield = Functions::flattenSingleValue($yield);
+ $basis = (int) Functions::flattenSingleValue($basis);
// Validate
if (is_numeric($rate) && is_numeric($yield)) {
if (($rate <= 0) || ($yield <= 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- $daysPerYear = self::daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement), $basis);
+ $daysPerYear = self::daysPerYear(DateTime::YEAR($settlement), $basis);
if (!is_numeric($daysPerYear)) {
return $daysPerYear;
}
- $daysBetweenIssueAndSettlement = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $settlement, $basis);
+ $daysBetweenIssueAndSettlement = DateTime::YEARFRAC($issue, $settlement, $basis);
if (!is_numeric($daysBetweenIssueAndSettlement)) {
// return date error
return $daysBetweenIssueAndSettlement;
}
$daysBetweenIssueAndSettlement *= $daysPerYear;
- $daysBetweenIssueAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $maturity, $basis);
+ $daysBetweenIssueAndMaturity = DateTime::YEARFRAC($issue, $maturity, $basis);
if (!is_numeric($daysBetweenIssueAndMaturity)) {
// return date error
return $daysBetweenIssueAndMaturity;
}
$daysBetweenIssueAndMaturity *= $daysPerYear;
- $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis);
+ $daysBetweenSettlementAndMaturity = DateTime::YEARFRAC($settlement, $maturity, $basis);
if (!is_numeric($daysBetweenSettlementAndMaturity)) {
// return date error
return $daysBetweenSettlementAndMaturity;
}
$daysBetweenSettlementAndMaturity *= $daysPerYear;
- return ((100 + (($daysBetweenIssueAndMaturity / $daysPerYear) * $rate * 100)) /
+ return (100 + (($daysBetweenIssueAndMaturity / $daysPerYear) * $rate * 100)) /
(1 + (($daysBetweenSettlementAndMaturity / $daysPerYear) * $yield)) -
- (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate * 100));
+ (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate * 100);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * PV
+ * PV.
*
* Returns the Present Value of a cash flow with constant payments and interest rate (annuities).
*
- * @param float $rate Interest rate per period
- * @param int $nper Number of periods
- * @param float $pmt Periodic payment (annuity)
- * @param float $fv Future Value
- * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
- * @return float
+ * @param float $rate Interest rate per period
+ * @param int $nper Number of periods
+ * @param float $pmt Periodic payment (annuity)
+ * @param float $fv Future Value
+ * @param int $type Payment type: 0 = at the end of each period, 1 = at the beginning of each period
+ *
+ * @return float
*/
public static function PV($rate = 0, $nper = 0, $pmt = 0, $fv = 0, $type = 0)
{
- $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate);
- $nper = PHPExcel_Calculation_Functions::flattenSingleValue($nper);
- $pmt = PHPExcel_Calculation_Functions::flattenSingleValue($pmt);
- $fv = PHPExcel_Calculation_Functions::flattenSingleValue($fv);
- $type = PHPExcel_Calculation_Functions::flattenSingleValue($type);
+ $rate = Functions::flattenSingleValue($rate);
+ $nper = Functions::flattenSingleValue($nper);
+ $pmt = Functions::flattenSingleValue($pmt);
+ $fv = Functions::flattenSingleValue($fv);
+ $type = Functions::flattenSingleValue($type);
// Validate parameters
if ($type != 0 && $type != 1) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
// Calculate
- if (!is_null($rate) && $rate != 0) {
+ if ($rate !== null && $rate != 0) {
return (-$pmt * (1 + $rate * $type) * ((pow(1 + $rate, $nper) - 1) / $rate) - $fv) / pow(1 + $rate, $nper);
}
+
return -$fv - $pmt * $nper;
}
-
/**
- * RATE
+ * RATE.
*
* Returns the interest rate per period of an annuity.
* RATE is calculated by iteration and can have zero or more solutions.
@@ -1841,36 +1851,37 @@ class PHPExcel_Calculation_Financial
* Excel Function:
* RATE(nper,pmt,pv[,fv[,type[,guess]]])
*
- * @access public
* @category Financial Functions
- * @param float nper The total number of payment periods in an annuity.
- * @param float pmt The payment made each period and cannot change over the life
+ *
+ * @param float $nper The total number of payment periods in an annuity
+ * @param float $pmt The payment made each period and cannot change over the life
* of the annuity.
* Typically, pmt includes principal and interest but no other
* fees or taxes.
- * @param float pv The present value - the total amount that a series of future
- * payments is worth now.
- * @param float fv The future value, or a cash balance you want to attain after
+ * @param float $pv The present value - the total amount that a series of future
+ * payments is worth now
+ * @param float $fv The future value, or a cash balance you want to attain after
* the last payment is made. If fv is omitted, it is assumed
* to be 0 (the future value of a loan, for example, is 0).
- * @param integer type A number 0 or 1 and indicates when payments are due:
+ * @param int $type A number 0 or 1 and indicates when payments are due:
* 0 or omitted At the end of the period.
* 1 At the beginning of the period.
- * @param float guess Your guess for what the rate will be.
+ * @param float $guess Your guess for what the rate will be.
* If you omit guess, it is assumed to be 10 percent.
- * @return float
- **/
+ *
+ * @return float
+ */
public static function RATE($nper, $pmt, $pv, $fv = 0.0, $type = 0, $guess = 0.1)
{
- $nper = (int) PHPExcel_Calculation_Functions::flattenSingleValue($nper);
- $pmt = PHPExcel_Calculation_Functions::flattenSingleValue($pmt);
- $pv = PHPExcel_Calculation_Functions::flattenSingleValue($pv);
- $fv = (is_null($fv)) ? 0.0 : PHPExcel_Calculation_Functions::flattenSingleValue($fv);
- $type = (is_null($type)) ? 0 : (int) PHPExcel_Calculation_Functions::flattenSingleValue($type);
- $guess = (is_null($guess)) ? 0.1 : PHPExcel_Calculation_Functions::flattenSingleValue($guess);
+ $nper = (int) Functions::flattenSingleValue($nper);
+ $pmt = Functions::flattenSingleValue($pmt);
+ $pv = Functions::flattenSingleValue($pv);
+ $fv = ($fv === null) ? 0.0 : Functions::flattenSingleValue($fv);
+ $type = ($type === null) ? 0 : (int) Functions::flattenSingleValue($type);
+ $guess = ($guess === null) ? 0.1 : Functions::flattenSingleValue($guess);
$rate = $guess;
- if (abs($rate) < FINANCIAL_PRECISION) {
+ if (abs($rate) < self::FINANCIAL_PRECISION) {
$y = $pv * (1 + $nper * $rate) + $pmt * (1 + $rate * $type) * $nper + $fv;
} else {
$f = exp($nper * log(1 + $rate));
@@ -1880,16 +1891,16 @@ class PHPExcel_Calculation_Financial
$y1 = $pv * $f + $pmt * (1 / $rate + $type) * ($f - 1) + $fv;
// find root by secant method
- $i = $x0 = 0.0;
+ $i = $x0 = 0.0;
$x1 = $rate;
- while ((abs($y0 - $y1) > FINANCIAL_PRECISION) && ($i < FINANCIAL_MAX_ITERATIONS)) {
+ while ((abs($y0 - $y1) > self::FINANCIAL_PRECISION) && ($i < self::FINANCIAL_MAX_ITERATIONS)) {
$rate = ($y1 * $x0 - $y0 * $x1) / ($y1 - $y0);
$x0 = $x1;
$x1 = $rate;
if (($nper * abs($pmt)) > ($pv - $fv)) {
$x1 = abs($x1);
}
- if (abs($rate) < FINANCIAL_PRECISION) {
+ if (abs($rate) < self::FINANCIAL_PRECISION) {
$y = $pv * (1 + $nper * $rate) + $pmt * (1 + $rate * $type) * $nper + $fv;
} else {
$f = exp($nper * log(1 + $rate));
@@ -1900,127 +1911,160 @@ class PHPExcel_Calculation_Financial
$y1 = $y;
++$i;
}
+
return $rate;
}
-
/**
- * RECEIVED
+ * RECEIVED.
*
* Returns the price per $100 face value of a discounted security.
*
- * @param mixed settlement The security's settlement date.
+ * @param mixed $settlement The security's settlement date.
* The security settlement date is the date after the issue date when the security is traded to the buyer.
- * @param mixed maturity The security's maturity date.
+ * @param mixed $maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param int investment The amount invested in the security.
- * @param int discount The security's discount rate.
- * @param int basis The type of day count to use.
+ * @param int $investment The amount invested in the security
+ * @param int $discount The security's discount rate
+ * @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return float
+ *
+ * @return float
*/
public static function RECEIVED($settlement, $maturity, $investment, $discount, $basis = 0)
{
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
- $investment = (float) PHPExcel_Calculation_Functions::flattenSingleValue($investment);
- $discount = (float) PHPExcel_Calculation_Functions::flattenSingleValue($discount);
- $basis = (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $investment = (float) Functions::flattenSingleValue($investment);
+ $discount = (float) Functions::flattenSingleValue($discount);
+ $basis = (int) Functions::flattenSingleValue($basis);
// Validate
if ((is_numeric($investment)) && (is_numeric($discount)) && (is_numeric($basis))) {
if (($investment <= 0) || ($discount <= 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis);
+ $daysBetweenSettlementAndMaturity = DateTime::YEARFRAC($settlement, $maturity, $basis);
if (!is_numeric($daysBetweenSettlementAndMaturity)) {
// return date error
return $daysBetweenSettlementAndMaturity;
}
- return $investment / ( 1 - ($discount * $daysBetweenSettlementAndMaturity));
+ return $investment / (1 - ($discount * $daysBetweenSettlementAndMaturity));
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
+ /**
+ * RRI.
+ *
+ * Calculates the interest rate required for an investment to grow to a specified future value .
+ *
+ * @param float $nper The number of periods over which the investment is made
+ * @param float $pv Present Value
+ * @param float $fv Future Value
+ *
+ * @return float|string
+ */
+ public static function RRI($nper = 0, $pv = 0, $fv = 0)
+ {
+ $nper = Functions::flattenSingleValue($nper);
+ $pv = Functions::flattenSingleValue($pv);
+ $fv = Functions::flattenSingleValue($fv);
+
+ // Validate parameters
+ if (!is_numeric($nper) || !is_numeric($pv) || !is_numeric($fv)) {
+ return Functions::VALUE();
+ } elseif ($nper <= 0.0 || $pv <= 0.0 || $fv < 0.0) {
+ return Functions::NAN();
+ }
+
+ return pow($fv / $pv, 1 / $nper) - 1;
+ }
/**
- * SLN
+ * SLN.
*
* Returns the straight-line depreciation of an asset for one period
*
- * @param cost Initial cost of the asset
- * @param salvage Value at the end of the depreciation
- * @param life Number of periods over which the asset is depreciated
- * @return float
+ * @param mixed $cost Initial cost of the asset
+ * @param mixed $salvage Value at the end of the depreciation
+ * @param mixed $life Number of periods over which the asset is depreciated
+ *
+ * @return float|string
*/
public static function SLN($cost, $salvage, $life)
{
- $cost = PHPExcel_Calculation_Functions::flattenSingleValue($cost);
- $salvage = PHPExcel_Calculation_Functions::flattenSingleValue($salvage);
- $life = PHPExcel_Calculation_Functions::flattenSingleValue($life);
+ $cost = Functions::flattenSingleValue($cost);
+ $salvage = Functions::flattenSingleValue($salvage);
+ $life = Functions::flattenSingleValue($life);
// Calculate
if ((is_numeric($cost)) && (is_numeric($salvage)) && (is_numeric($life))) {
if ($life < 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
+
return ($cost - $salvage) / $life;
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * SYD
+ * SYD.
*
* Returns the sum-of-years' digits depreciation of an asset for a specified period.
*
- * @param cost Initial cost of the asset
- * @param salvage Value at the end of the depreciation
- * @param life Number of periods over which the asset is depreciated
- * @param period Period
- * @return float
+ * @param mixed $cost Initial cost of the asset
+ * @param mixed $salvage Value at the end of the depreciation
+ * @param mixed $life Number of periods over which the asset is depreciated
+ * @param mixed $period Period
+ *
+ * @return float|string
*/
public static function SYD($cost, $salvage, $life, $period)
{
- $cost = PHPExcel_Calculation_Functions::flattenSingleValue($cost);
- $salvage = PHPExcel_Calculation_Functions::flattenSingleValue($salvage);
- $life = PHPExcel_Calculation_Functions::flattenSingleValue($life);
- $period = PHPExcel_Calculation_Functions::flattenSingleValue($period);
+ $cost = Functions::flattenSingleValue($cost);
+ $salvage = Functions::flattenSingleValue($salvage);
+ $life = Functions::flattenSingleValue($life);
+ $period = Functions::flattenSingleValue($period);
// Calculate
if ((is_numeric($cost)) && (is_numeric($salvage)) && (is_numeric($life)) && (is_numeric($period))) {
if (($life < 1) || ($period > $life)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
+
return (($cost - $salvage) * ($life - $period + 1) * 2) / ($life * ($life + 1));
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * TBILLEQ
+ * TBILLEQ.
*
* Returns the bond-equivalent yield for a Treasury bill.
*
- * @param mixed settlement The Treasury bill's settlement date.
+ * @param mixed $settlement The Treasury bill's settlement date.
* The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer.
- * @param mixed maturity The Treasury bill's maturity date.
+ * @param mixed $maturity The Treasury bill's maturity date.
* The maturity date is the date when the Treasury bill expires.
- * @param int discount The Treasury bill's discount rate.
- * @return float
+ * @param int $discount The Treasury bill's discount rate
+ *
+ * @return float
*/
public static function TBILLEQ($settlement, $maturity, $discount)
{
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
- $discount = PHPExcel_Calculation_Functions::flattenSingleValue($discount);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $discount = Functions::flattenSingleValue($discount);
// Use TBILLPRICE for validation
$testValue = self::TBILLPRICE($settlement, $maturity, $discount);
@@ -2028,129 +2072,131 @@ class PHPExcel_Calculation_Financial
return $testValue;
}
- if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ if (is_string($maturity = DateTime::getDateValue($maturity))) {
+ return Functions::VALUE();
}
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
++$maturity;
- $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity) * 360;
+ $daysBetweenSettlementAndMaturity = DateTime::YEARFRAC($settlement, $maturity) * 360;
} else {
- $daysBetweenSettlementAndMaturity = (PHPExcel_Calculation_DateTime::getDateValue($maturity) - PHPExcel_Calculation_DateTime::getDateValue($settlement));
+ $daysBetweenSettlementAndMaturity = (DateTime::getDateValue($maturity) - DateTime::getDateValue($settlement));
}
return (365 * $discount) / (360 - $discount * $daysBetweenSettlementAndMaturity);
}
-
/**
- * TBILLPRICE
+ * TBILLPRICE.
*
* Returns the yield for a Treasury bill.
*
- * @param mixed settlement The Treasury bill's settlement date.
+ * @param mixed $settlement The Treasury bill's settlement date.
* The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer.
- * @param mixed maturity The Treasury bill's maturity date.
+ * @param mixed $maturity The Treasury bill's maturity date.
* The maturity date is the date when the Treasury bill expires.
- * @param int discount The Treasury bill's discount rate.
- * @return float
+ * @param int $discount The Treasury bill's discount rate
+ *
+ * @return float
*/
public static function TBILLPRICE($settlement, $maturity, $discount)
{
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
- $discount = PHPExcel_Calculation_Functions::flattenSingleValue($discount);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $discount = Functions::flattenSingleValue($discount);
- if (is_string($maturity = PHPExcel_Calculation_DateTime::getDateValue($maturity))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ if (is_string($maturity = DateTime::getDateValue($maturity))) {
+ return Functions::VALUE();
}
// Validate
if (is_numeric($discount)) {
if ($discount <= 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
++$maturity;
- $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity) * 360;
+ $daysBetweenSettlementAndMaturity = DateTime::YEARFRAC($settlement, $maturity) * 360;
if (!is_numeric($daysBetweenSettlementAndMaturity)) {
// return date error
return $daysBetweenSettlementAndMaturity;
}
} else {
- $daysBetweenSettlementAndMaturity = (PHPExcel_Calculation_DateTime::getDateValue($maturity) - PHPExcel_Calculation_DateTime::getDateValue($settlement));
+ $daysBetweenSettlementAndMaturity = (DateTime::getDateValue($maturity) - DateTime::getDateValue($settlement));
}
if ($daysBetweenSettlementAndMaturity > 360) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
$price = 100 * (1 - (($discount * $daysBetweenSettlementAndMaturity) / 360));
if ($price <= 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
+
return $price;
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * TBILLYIELD
+ * TBILLYIELD.
*
* Returns the yield for a Treasury bill.
*
- * @param mixed settlement The Treasury bill's settlement date.
+ * @param mixed $settlement The Treasury bill's settlement date.
* The Treasury bill's settlement date is the date after the issue date when the Treasury bill is traded to the buyer.
- * @param mixed maturity The Treasury bill's maturity date.
+ * @param mixed $maturity The Treasury bill's maturity date.
* The maturity date is the date when the Treasury bill expires.
- * @param int price The Treasury bill's price per $100 face value.
- * @return float
+ * @param int $price The Treasury bill's price per $100 face value
+ *
+ * @return float
*/
public static function TBILLYIELD($settlement, $maturity, $price)
{
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
- $price = PHPExcel_Calculation_Functions::flattenSingleValue($price);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $price = Functions::flattenSingleValue($price);
// Validate
if (is_numeric($price)) {
if ($price <= 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
++$maturity;
- $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity) * 360;
+ $daysBetweenSettlementAndMaturity = DateTime::YEARFRAC($settlement, $maturity) * 360;
if (!is_numeric($daysBetweenSettlementAndMaturity)) {
// return date error
return $daysBetweenSettlementAndMaturity;
}
} else {
- $daysBetweenSettlementAndMaturity = (PHPExcel_Calculation_DateTime::getDateValue($maturity) - PHPExcel_Calculation_DateTime::getDateValue($settlement));
+ $daysBetweenSettlementAndMaturity = (DateTime::getDateValue($maturity) - DateTime::getDateValue($settlement));
}
if ($daysBetweenSettlementAndMaturity > 360) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
return ((100 - $price) / $price) * (360 / $daysBetweenSettlementAndMaturity);
}
- return PHPExcel_Calculation_Functions::VALUE();
- }
+ return Functions::VALUE();
+ }
public static function XIRR($values, $dates, $guess = 0.1)
{
if ((!is_array($values)) && (!is_array($dates))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
- $values = PHPExcel_Calculation_Functions::flattenArray($values);
- $dates = PHPExcel_Calculation_Functions::flattenArray($dates);
- $guess = PHPExcel_Calculation_Functions::flattenSingleValue($guess);
+ $values = Functions::flattenArray($values);
+ $dates = Functions::flattenArray($dates);
+ $guess = Functions::flattenSingleValue($guess);
if (count($values) != count($dates)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
// create an initial range, with a root somewhere between 0 and guess
@@ -2158,7 +2204,7 @@ class PHPExcel_Calculation_Financial
$x2 = $guess;
$f1 = self::XNPV($x1, $values, $dates);
$f2 = self::XNPV($x2, $values, $dates);
- for ($i = 0; $i < FINANCIAL_MAX_ITERATIONS; ++$i) {
+ for ($i = 0; $i < self::FINANCIAL_MAX_ITERATIONS; ++$i) {
if (($f1 * $f2) < 0.0) {
break;
} elseif (abs($f1) < abs($f2)) {
@@ -2168,7 +2214,7 @@ class PHPExcel_Calculation_Financial
}
}
if (($f1 * $f2) > 0.0) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$f = self::XNPV($x1, $values, $dates);
@@ -2180,23 +2226,23 @@ class PHPExcel_Calculation_Financial
$dx = $x1 - $x2;
}
- for ($i = 0; $i < FINANCIAL_MAX_ITERATIONS; ++$i) {
+ for ($i = 0; $i < self::FINANCIAL_MAX_ITERATIONS; ++$i) {
$dx *= 0.5;
$x_mid = $rtb + $dx;
$f_mid = self::XNPV($x_mid, $values, $dates);
if ($f_mid <= 0.0) {
$rtb = $x_mid;
}
- if ((abs($f_mid) < FINANCIAL_PRECISION) || (abs($dx) < FINANCIAL_PRECISION)) {
+ if ((abs($f_mid) < self::FINANCIAL_PRECISION) || (abs($dx) < self::FINANCIAL_PRECISION)) {
return $x_mid;
}
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * XNPV
+ * XNPV.
*
* Returns the net present value for a schedule of cash flows that is not necessarily periodic.
* To calculate the net present value for a series of cash flows that is periodic, use the NPV function.
@@ -2204,83 +2250,85 @@ class PHPExcel_Calculation_Financial
* Excel Function:
* =XNPV(rate,values,dates)
*
- * @param float $rate The discount rate to apply to the cash flows.
- * @param array of float $values A series of cash flows that corresponds to a schedule of payments in dates.
+ * @param float $rate the discount rate to apply to the cash flows
+ * @param array of float $values A series of cash flows that corresponds to a schedule of payments in dates.
* The first payment is optional and corresponds to a cost or payment that occurs at the beginning of the investment.
* If the first value is a cost or payment, it must be a negative value. All succeeding payments are discounted based on a 365-day year.
* The series of values must contain at least one positive value and one negative value.
- * @param array of mixed $dates A schedule of payment dates that corresponds to the cash flow payments.
+ * @param array of mixed $dates A schedule of payment dates that corresponds to the cash flow payments.
* The first payment date indicates the beginning of the schedule of payments.
* All other dates must be later than this date, but they may occur in any order.
- * @return float
+ *
+ * @return float
*/
public static function XNPV($rate, $values, $dates)
{
- $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate);
+ $rate = Functions::flattenSingleValue($rate);
if (!is_numeric($rate)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
if ((!is_array($values)) || (!is_array($dates))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
- $values = PHPExcel_Calculation_Functions::flattenArray($values);
- $dates = PHPExcel_Calculation_Functions::flattenArray($dates);
+ $values = Functions::flattenArray($values);
+ $dates = Functions::flattenArray($dates);
$valCount = count($values);
if ($valCount != count($dates)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if ((min($values) > 0) || (max($values) < 0)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$xnpv = 0.0;
for ($i = 0; $i < $valCount; ++$i) {
if (!is_numeric($values[$i])) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
- $xnpv += $values[$i] / pow(1 + $rate, PHPExcel_Calculation_DateTime::DATEDIF($dates[0], $dates[$i], 'd') / 365);
+ $xnpv += $values[$i] / pow(1 + $rate, DateTime::DATEDIF($dates[0], $dates[$i], 'd') / 365);
}
- return (is_finite($xnpv)) ? $xnpv : PHPExcel_Calculation_Functions::VALUE();
+
+ return (is_finite($xnpv)) ? $xnpv : Functions::VALUE();
}
-
/**
- * YIELDDISC
+ * YIELDDISC.
*
* Returns the annual yield of a security that pays interest at maturity.
*
- * @param mixed settlement The security's settlement date.
+ * @param mixed $settlement The security's settlement date.
* The security's settlement date is the date after the issue date when the security is traded to the buyer.
- * @param mixed maturity The security's maturity date.
+ * @param mixed $maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param int price The security's price per $100 face value.
- * @param int redemption The security's redemption value per $100 face value.
- * @param int basis The type of day count to use.
+ * @param int $price The security's price per $100 face value
+ * @param int $redemption The security's redemption value per $100 face value
+ * @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return float
+ *
+ * @return float
*/
public static function YIELDDISC($settlement, $maturity, $price, $redemption, $basis = 0)
{
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
- $price = PHPExcel_Calculation_Functions::flattenSingleValue($price);
- $redemption = PHPExcel_Calculation_Functions::flattenSingleValue($redemption);
- $basis = (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $price = Functions::flattenSingleValue($price);
+ $redemption = Functions::flattenSingleValue($redemption);
+ $basis = (int) Functions::flattenSingleValue($basis);
// Validate
if (is_numeric($price) && is_numeric($redemption)) {
if (($price <= 0) || ($redemption <= 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- $daysPerYear = self::daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement), $basis);
+ $daysPerYear = self::daysPerYear(DateTime::YEAR($settlement), $basis);
if (!is_numeric($daysPerYear)) {
return $daysPerYear;
}
- $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis);
+ $daysBetweenSettlementAndMaturity = DateTime::YEARFRAC($settlement, $maturity, $basis);
if (!is_numeric($daysBetweenSettlementAndMaturity)) {
// return date error
return $daysBetweenSettlementAndMaturity;
@@ -2289,61 +2337,62 @@ class PHPExcel_Calculation_Financial
return (($redemption - $price) / $price) * ($daysPerYear / $daysBetweenSettlementAndMaturity);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * YIELDMAT
+ * YIELDMAT.
*
* Returns the annual yield of a security that pays interest at maturity.
*
- * @param mixed settlement The security's settlement date.
+ * @param mixed $settlement The security's settlement date.
* The security's settlement date is the date after the issue date when the security is traded to the buyer.
- * @param mixed maturity The security's maturity date.
+ * @param mixed $maturity The security's maturity date.
* The maturity date is the date when the security expires.
- * @param mixed issue The security's issue date.
- * @param int rate The security's interest rate at date of issue.
- * @param int price The security's price per $100 face value.
- * @param int basis The type of day count to use.
+ * @param mixed $issue The security's issue date
+ * @param int $rate The security's interest rate at date of issue
+ * @param int $price The security's price per $100 face value
+ * @param int $basis The type of day count to use.
* 0 or omitted US (NASD) 30/360
* 1 Actual/actual
* 2 Actual/360
* 3 Actual/365
* 4 European 30/360
- * @return float
+ *
+ * @return float
*/
public static function YIELDMAT($settlement, $maturity, $issue, $rate, $price, $basis = 0)
{
- $settlement = PHPExcel_Calculation_Functions::flattenSingleValue($settlement);
- $maturity = PHPExcel_Calculation_Functions::flattenSingleValue($maturity);
- $issue = PHPExcel_Calculation_Functions::flattenSingleValue($issue);
- $rate = PHPExcel_Calculation_Functions::flattenSingleValue($rate);
- $price = PHPExcel_Calculation_Functions::flattenSingleValue($price);
- $basis = (int) PHPExcel_Calculation_Functions::flattenSingleValue($basis);
+ $settlement = Functions::flattenSingleValue($settlement);
+ $maturity = Functions::flattenSingleValue($maturity);
+ $issue = Functions::flattenSingleValue($issue);
+ $rate = Functions::flattenSingleValue($rate);
+ $price = Functions::flattenSingleValue($price);
+ $basis = (int) Functions::flattenSingleValue($basis);
// Validate
if (is_numeric($rate) && is_numeric($price)) {
if (($rate <= 0) || ($price <= 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- $daysPerYear = self::daysPerYear(PHPExcel_Calculation_DateTime::YEAR($settlement), $basis);
+ $daysPerYear = self::daysPerYear(DateTime::YEAR($settlement), $basis);
if (!is_numeric($daysPerYear)) {
return $daysPerYear;
}
- $daysBetweenIssueAndSettlement = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $settlement, $basis);
+ $daysBetweenIssueAndSettlement = DateTime::YEARFRAC($issue, $settlement, $basis);
if (!is_numeric($daysBetweenIssueAndSettlement)) {
// return date error
return $daysBetweenIssueAndSettlement;
}
$daysBetweenIssueAndSettlement *= $daysPerYear;
- $daysBetweenIssueAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($issue, $maturity, $basis);
+ $daysBetweenIssueAndMaturity = DateTime::YEARFRAC($issue, $maturity, $basis);
if (!is_numeric($daysBetweenIssueAndMaturity)) {
// return date error
return $daysBetweenIssueAndMaturity;
}
$daysBetweenIssueAndMaturity *= $daysPerYear;
- $daysBetweenSettlementAndMaturity = PHPExcel_Calculation_DateTime::YEARFRAC($settlement, $maturity, $basis);
+ $daysBetweenSettlementAndMaturity = DateTime::YEARFRAC($settlement, $maturity, $basis);
if (!is_numeric($daysBetweenSettlementAndMaturity)) {
// return date error
return $daysBetweenSettlementAndMaturity;
@@ -2354,6 +2403,7 @@ class PHPExcel_Calculation_Financial
(($price / 100) + (($daysBetweenIssueAndSettlement / $daysPerYear) * $rate))) *
($daysPerYear / $daysBetweenSettlementAndMaturity);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaParser.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaParser.php
new file mode 100644
index 00000000000..9b3c66e9e86
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaParser.php
@@ -0,0 +1,623 @@
+<';
+ const OPERATORS_POSTFIX = '%';
+
+ /**
+ * Formula.
+ *
+ * @var string
+ */
+ private $formula;
+
+ /**
+ * Tokens.
+ *
+ * @var FormulaToken[]
+ */
+ private $tokens = [];
+
+ /**
+ * Create a new FormulaParser.
+ *
+ * @param string $pFormula Formula to parse
+ *
+ * @throws Exception
+ */
+ public function __construct($pFormula = '')
+ {
+ // Check parameters
+ if ($pFormula === null) {
+ throw new Exception('Invalid parameter passed: formula');
+ }
+
+ // Initialise values
+ $this->formula = trim($pFormula);
+ // Parse!
+ $this->parseToTokens();
+ }
+
+ /**
+ * Get Formula.
+ *
+ * @return string
+ */
+ public function getFormula()
+ {
+ return $this->formula;
+ }
+
+ /**
+ * Get Token.
+ *
+ * @param int $pId Token id
+ *
+ * @throws Exception
+ *
+ * @return string
+ */
+ public function getToken($pId = 0)
+ {
+ if (isset($this->tokens[$pId])) {
+ return $this->tokens[$pId];
+ }
+
+ throw new Exception("Token with id $pId does not exist.");
+ }
+
+ /**
+ * Get Token count.
+ *
+ * @return int
+ */
+ public function getTokenCount()
+ {
+ return count($this->tokens);
+ }
+
+ /**
+ * Get Tokens.
+ *
+ * @return FormulaToken[]
+ */
+ public function getTokens()
+ {
+ return $this->tokens;
+ }
+
+ /**
+ * Parse to tokens.
+ */
+ private function parseToTokens()
+ {
+ // No attempt is made to verify formulas; assumes formulas are derived from Excel, where
+ // they can only exist if valid; stack overflows/underflows sunk as nulls without exceptions.
+
+ // Check if the formula has a valid starting =
+ $formulaLength = strlen($this->formula);
+ if ($formulaLength < 2 || $this->formula[0] != '=') {
+ return;
+ }
+
+ // Helper variables
+ $tokens1 = $tokens2 = $stack = [];
+ $inString = $inPath = $inRange = $inError = false;
+ $token = $previousToken = $nextToken = null;
+
+ $index = 1;
+ $value = '';
+
+ $ERRORS = ['#NULL!', '#DIV/0!', '#VALUE!', '#REF!', '#NAME?', '#NUM!', '#N/A'];
+ $COMPARATORS_MULTI = ['>=', '<=', '<>'];
+
+ while ($index < $formulaLength) {
+ // state-dependent character evaluation (order is important)
+
+ // double-quoted strings
+ // embeds are doubled
+ // end marks token
+ if ($inString) {
+ if ($this->formula[$index] == self::QUOTE_DOUBLE) {
+ if ((($index + 2) <= $formulaLength) && ($this->formula[$index + 1] == self::QUOTE_DOUBLE)) {
+ $value .= self::QUOTE_DOUBLE;
+ ++$index;
+ } else {
+ $inString = false;
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND, FormulaToken::TOKEN_SUBTYPE_TEXT);
+ $value = '';
+ }
+ } else {
+ $value .= $this->formula[$index];
+ }
+ ++$index;
+
+ continue;
+ }
+
+ // single-quoted strings (links)
+ // embeds are double
+ // end does not mark a token
+ if ($inPath) {
+ if ($this->formula[$index] == self::QUOTE_SINGLE) {
+ if ((($index + 2) <= $formulaLength) && ($this->formula[$index + 1] == self::QUOTE_SINGLE)) {
+ $value .= self::QUOTE_SINGLE;
+ ++$index;
+ } else {
+ $inPath = false;
+ }
+ } else {
+ $value .= $this->formula[$index];
+ }
+ ++$index;
+
+ continue;
+ }
+
+ // bracked strings (R1C1 range index or linked workbook name)
+ // no embeds (changed to "()" by Excel)
+ // end does not mark a token
+ if ($inRange) {
+ if ($this->formula[$index] == self::BRACKET_CLOSE) {
+ $inRange = false;
+ }
+ $value .= $this->formula[$index];
+ ++$index;
+
+ continue;
+ }
+
+ // error values
+ // end marks a token, determined from absolute list of values
+ if ($inError) {
+ $value .= $this->formula[$index];
+ ++$index;
+ if (in_array($value, $ERRORS)) {
+ $inError = false;
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND, FormulaToken::TOKEN_SUBTYPE_ERROR);
+ $value = '';
+ }
+
+ continue;
+ }
+
+ // scientific notation check
+ if (strpos(self::OPERATORS_SN, $this->formula[$index]) !== false) {
+ if (strlen($value) > 1) {
+ if (preg_match('/^[1-9]{1}(\\.\\d+)?E{1}$/', $this->formula[$index]) != 0) {
+ $value .= $this->formula[$index];
+ ++$index;
+
+ continue;
+ }
+ }
+ }
+
+ // independent character evaluation (order not important)
+
+ // establish state-dependent character evaluations
+ if ($this->formula[$index] == self::QUOTE_DOUBLE) {
+ if (strlen($value) > 0) {
+ // unexpected
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_UNKNOWN);
+ $value = '';
+ }
+ $inString = true;
+ ++$index;
+
+ continue;
+ }
+
+ if ($this->formula[$index] == self::QUOTE_SINGLE) {
+ if (strlen($value) > 0) {
+ // unexpected
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_UNKNOWN);
+ $value = '';
+ }
+ $inPath = true;
+ ++$index;
+
+ continue;
+ }
+
+ if ($this->formula[$index] == self::BRACKET_OPEN) {
+ $inRange = true;
+ $value .= self::BRACKET_OPEN;
+ ++$index;
+
+ continue;
+ }
+
+ if ($this->formula[$index] == self::ERROR_START) {
+ if (strlen($value) > 0) {
+ // unexpected
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_UNKNOWN);
+ $value = '';
+ }
+ $inError = true;
+ $value .= self::ERROR_START;
+ ++$index;
+
+ continue;
+ }
+
+ // mark start and end of arrays and array rows
+ if ($this->formula[$index] == self::BRACE_OPEN) {
+ if (strlen($value) > 0) {
+ // unexpected
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_UNKNOWN);
+ $value = '';
+ }
+
+ $tmp = new FormulaToken('ARRAY', FormulaToken::TOKEN_TYPE_FUNCTION, FormulaToken::TOKEN_SUBTYPE_START);
+ $tokens1[] = $tmp;
+ $stack[] = clone $tmp;
+
+ $tmp = new FormulaToken('ARRAYROW', FormulaToken::TOKEN_TYPE_FUNCTION, FormulaToken::TOKEN_SUBTYPE_START);
+ $tokens1[] = $tmp;
+ $stack[] = clone $tmp;
+
+ ++$index;
+
+ continue;
+ }
+
+ if ($this->formula[$index] == self::SEMICOLON) {
+ if (strlen($value) > 0) {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ $value = '';
+ }
+
+ $tmp = array_pop($stack);
+ $tmp->setValue('');
+ $tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
+ $tokens1[] = $tmp;
+
+ $tmp = new FormulaToken(',', FormulaToken::TOKEN_TYPE_ARGUMENT);
+ $tokens1[] = $tmp;
+
+ $tmp = new FormulaToken('ARRAYROW', FormulaToken::TOKEN_TYPE_FUNCTION, FormulaToken::TOKEN_SUBTYPE_START);
+ $tokens1[] = $tmp;
+ $stack[] = clone $tmp;
+
+ ++$index;
+
+ continue;
+ }
+
+ if ($this->formula[$index] == self::BRACE_CLOSE) {
+ if (strlen($value) > 0) {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ $value = '';
+ }
+
+ $tmp = array_pop($stack);
+ $tmp->setValue('');
+ $tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
+ $tokens1[] = $tmp;
+
+ $tmp = array_pop($stack);
+ $tmp->setValue('');
+ $tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
+ $tokens1[] = $tmp;
+
+ ++$index;
+
+ continue;
+ }
+
+ // trim white-space
+ if ($this->formula[$index] == self::WHITESPACE) {
+ if (strlen($value) > 0) {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ $value = '';
+ }
+ $tokens1[] = new FormulaToken('', FormulaToken::TOKEN_TYPE_WHITESPACE);
+ ++$index;
+ while (($this->formula[$index] == self::WHITESPACE) && ($index < $formulaLength)) {
+ ++$index;
+ }
+
+ continue;
+ }
+
+ // multi-character comparators
+ if (($index + 2) <= $formulaLength) {
+ if (in_array(substr($this->formula, $index, 2), $COMPARATORS_MULTI)) {
+ if (strlen($value) > 0) {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ $value = '';
+ }
+ $tokens1[] = new FormulaToken(substr($this->formula, $index, 2), FormulaToken::TOKEN_TYPE_OPERATORINFIX, FormulaToken::TOKEN_SUBTYPE_LOGICAL);
+ $index += 2;
+
+ continue;
+ }
+ }
+
+ // standard infix operators
+ if (strpos(self::OPERATORS_INFIX, $this->formula[$index]) !== false) {
+ if (strlen($value) > 0) {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ $value = '';
+ }
+ $tokens1[] = new FormulaToken($this->formula[$index], FormulaToken::TOKEN_TYPE_OPERATORINFIX);
+ ++$index;
+
+ continue;
+ }
+
+ // standard postfix operators (only one)
+ if (strpos(self::OPERATORS_POSTFIX, $this->formula[$index]) !== false) {
+ if (strlen($value) > 0) {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ $value = '';
+ }
+ $tokens1[] = new FormulaToken($this->formula[$index], FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX);
+ ++$index;
+
+ continue;
+ }
+
+ // start subexpression or function
+ if ($this->formula[$index] == self::PAREN_OPEN) {
+ if (strlen($value) > 0) {
+ $tmp = new FormulaToken($value, FormulaToken::TOKEN_TYPE_FUNCTION, FormulaToken::TOKEN_SUBTYPE_START);
+ $tokens1[] = $tmp;
+ $stack[] = clone $tmp;
+ $value = '';
+ } else {
+ $tmp = new FormulaToken('', FormulaToken::TOKEN_TYPE_SUBEXPRESSION, FormulaToken::TOKEN_SUBTYPE_START);
+ $tokens1[] = $tmp;
+ $stack[] = clone $tmp;
+ }
+ ++$index;
+
+ continue;
+ }
+
+ // function, subexpression, or array parameters, or operand unions
+ if ($this->formula[$index] == self::COMMA) {
+ if (strlen($value) > 0) {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ $value = '';
+ }
+
+ $tmp = array_pop($stack);
+ $tmp->setValue('');
+ $tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
+ $stack[] = $tmp;
+
+ if ($tmp->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) {
+ $tokens1[] = new FormulaToken(',', FormulaToken::TOKEN_TYPE_OPERATORINFIX, FormulaToken::TOKEN_SUBTYPE_UNION);
+ } else {
+ $tokens1[] = new FormulaToken(',', FormulaToken::TOKEN_TYPE_ARGUMENT);
+ }
+ ++$index;
+
+ continue;
+ }
+
+ // stop subexpression
+ if ($this->formula[$index] == self::PAREN_CLOSE) {
+ if (strlen($value) > 0) {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ $value = '';
+ }
+
+ $tmp = array_pop($stack);
+ $tmp->setValue('');
+ $tmp->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_STOP);
+ $tokens1[] = $tmp;
+
+ ++$index;
+
+ continue;
+ }
+
+ // token accumulation
+ $value .= $this->formula[$index];
+ ++$index;
+ }
+
+ // dump remaining accumulation
+ if (strlen($value) > 0) {
+ $tokens1[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERAND);
+ }
+
+ // move tokenList to new set, excluding unnecessary white-space tokens and converting necessary ones to intersections
+ $tokenCount = count($tokens1);
+ for ($i = 0; $i < $tokenCount; ++$i) {
+ $token = $tokens1[$i];
+ if (isset($tokens1[$i - 1])) {
+ $previousToken = $tokens1[$i - 1];
+ } else {
+ $previousToken = null;
+ }
+ if (isset($tokens1[$i + 1])) {
+ $nextToken = $tokens1[$i + 1];
+ } else {
+ $nextToken = null;
+ }
+
+ if ($token === null) {
+ continue;
+ }
+
+ if ($token->getTokenType() != FormulaToken::TOKEN_TYPE_WHITESPACE) {
+ $tokens2[] = $token;
+
+ continue;
+ }
+
+ if ($previousToken === null) {
+ continue;
+ }
+
+ if (!(
+ (($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) && ($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP)) ||
+ (($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP)) ||
+ ($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND)
+ )) {
+ continue;
+ }
+
+ if ($nextToken === null) {
+ continue;
+ }
+
+ if (!(
+ (($nextToken->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) && ($nextToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_START)) ||
+ (($nextToken->getTokenType() == FormulaToken::TOKEN_TYPE_SUBEXPRESSION) && ($nextToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_START)) ||
+ ($nextToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND)
+ )) {
+ continue;
+ }
+
+ $tokens2[] = new FormulaToken($value, FormulaToken::TOKEN_TYPE_OPERATORINFIX, FormulaToken::TOKEN_SUBTYPE_INTERSECTION);
+ }
+
+ // move tokens to final list, switching infix "-" operators to prefix when appropriate, switching infix "+" operators
+ // to noop when appropriate, identifying operand and infix-operator subtypes, and pulling "@" from function names
+ $this->tokens = [];
+
+ $tokenCount = count($tokens2);
+ for ($i = 0; $i < $tokenCount; ++$i) {
+ $token = $tokens2[$i];
+ if (isset($tokens2[$i - 1])) {
+ $previousToken = $tokens2[$i - 1];
+ } else {
+ $previousToken = null;
+ }
+ if (isset($tokens2[$i + 1])) {
+ $nextToken = $tokens2[$i + 1];
+ } else {
+ $nextToken = null;
+ }
+
+ if ($token === null) {
+ continue;
+ }
+
+ if ($token->getTokenType() == FormulaToken::TOKEN_TYPE_OPERATORINFIX && $token->getValue() == '-') {
+ if ($i == 0) {
+ $token->setTokenType(FormulaToken::TOKEN_TYPE_OPERATORPREFIX);
+ } elseif ((($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) &&
+ ($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP)) ||
+ (($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_SUBEXPRESSION) &&
+ ($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP)) ||
+ ($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX) ||
+ ($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND)) {
+ $token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_MATH);
+ } else {
+ $token->setTokenType(FormulaToken::TOKEN_TYPE_OPERATORPREFIX);
+ }
+
+ $this->tokens[] = $token;
+
+ continue;
+ }
+
+ if ($token->getTokenType() == FormulaToken::TOKEN_TYPE_OPERATORINFIX && $token->getValue() == '+') {
+ if ($i == 0) {
+ continue;
+ } elseif ((($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) &&
+ ($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP)) ||
+ (($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_SUBEXPRESSION) &&
+ ($previousToken->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_STOP)) ||
+ ($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERATORPOSTFIX) ||
+ ($previousToken->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND)) {
+ $token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_MATH);
+ } else {
+ continue;
+ }
+
+ $this->tokens[] = $token;
+
+ continue;
+ }
+
+ if ($token->getTokenType() == FormulaToken::TOKEN_TYPE_OPERATORINFIX &&
+ $token->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_NOTHING) {
+ if (strpos('<>=', substr($token->getValue(), 0, 1)) !== false) {
+ $token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_LOGICAL);
+ } elseif ($token->getValue() == '&') {
+ $token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_CONCATENATION);
+ } else {
+ $token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_MATH);
+ }
+
+ $this->tokens[] = $token;
+
+ continue;
+ }
+
+ if ($token->getTokenType() == FormulaToken::TOKEN_TYPE_OPERAND &&
+ $token->getTokenSubType() == FormulaToken::TOKEN_SUBTYPE_NOTHING) {
+ if (!is_numeric($token->getValue())) {
+ if (strtoupper($token->getValue()) == 'TRUE' || strtoupper($token->getValue()) == 'FALSE') {
+ $token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_LOGICAL);
+ } else {
+ $token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_RANGE);
+ }
+ } else {
+ $token->setTokenSubType(FormulaToken::TOKEN_SUBTYPE_NUMBER);
+ }
+
+ $this->tokens[] = $token;
+
+ continue;
+ }
+
+ if ($token->getTokenType() == FormulaToken::TOKEN_TYPE_FUNCTION) {
+ if (strlen($token->getValue()) > 0) {
+ if (substr($token->getValue(), 0, 1) == '@') {
+ $token->setValue(substr($token->getValue(), 1));
+ }
+ }
+ }
+
+ $this->tokens[] = $token;
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaToken.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaToken.php
new file mode 100644
index 00000000000..66618d4a0c0
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/FormulaToken.php
@@ -0,0 +1,150 @@
+value = $pValue;
+ $this->tokenType = $pTokenType;
+ $this->tokenSubType = $pTokenSubType;
+ }
+
+ /**
+ * Get Value.
+ *
+ * @return string
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * Set Value.
+ *
+ * @param string $value
+ */
+ public function setValue($value)
+ {
+ $this->value = $value;
+ }
+
+ /**
+ * Get Token Type (represented by TOKEN_TYPE_*).
+ *
+ * @return string
+ */
+ public function getTokenType()
+ {
+ return $this->tokenType;
+ }
+
+ /**
+ * Set Token Type (represented by TOKEN_TYPE_*).
+ *
+ * @param string $value
+ */
+ public function setTokenType($value)
+ {
+ $this->tokenType = $value;
+ }
+
+ /**
+ * Get Token SubType (represented by TOKEN_SUBTYPE_*).
+ *
+ * @return string
+ */
+ public function getTokenSubType()
+ {
+ return $this->tokenSubType;
+ }
+
+ /**
+ * Set Token SubType (represented by TOKEN_SUBTYPE_*).
+ *
+ * @param string $value
+ */
+ public function setTokenSubType($value)
+ {
+ $this->tokenSubType = $value;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php
new file mode 100644
index 00000000000..0a607c702ab
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Functions.php
@@ -0,0 +1,673 @@
+ '#NULL!',
+ 'divisionbyzero' => '#DIV/0!',
+ 'value' => '#VALUE!',
+ 'reference' => '#REF!',
+ 'name' => '#NAME?',
+ 'num' => '#NUM!',
+ 'na' => '#N/A',
+ 'gettingdata' => '#GETTING_DATA',
+ ];
+
+ /**
+ * Set the Compatibility Mode.
+ *
+ * @category Function Configuration
+ *
+ * @param string $compatibilityMode Compatibility Mode
+ * Permitted values are:
+ * Functions::COMPATIBILITY_EXCEL 'Excel'
+ * Functions::COMPATIBILITY_GNUMERIC 'Gnumeric'
+ * Functions::COMPATIBILITY_OPENOFFICE 'OpenOfficeCalc'
+ *
+ * @return bool (Success or Failure)
+ */
+ public static function setCompatibilityMode($compatibilityMode)
+ {
+ if (($compatibilityMode == self::COMPATIBILITY_EXCEL) ||
+ ($compatibilityMode == self::COMPATIBILITY_GNUMERIC) ||
+ ($compatibilityMode == self::COMPATIBILITY_OPENOFFICE)
+ ) {
+ self::$compatibilityMode = $compatibilityMode;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Return the current Compatibility Mode.
+ *
+ * @category Function Configuration
+ *
+ * @return string Compatibility Mode
+ * Possible Return values are:
+ * Functions::COMPATIBILITY_EXCEL 'Excel'
+ * Functions::COMPATIBILITY_GNUMERIC 'Gnumeric'
+ * Functions::COMPATIBILITY_OPENOFFICE 'OpenOfficeCalc'
+ */
+ public static function getCompatibilityMode()
+ {
+ return self::$compatibilityMode;
+ }
+
+ /**
+ * Set the Return Date Format used by functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object).
+ *
+ * @category Function Configuration
+ *
+ * @param string $returnDateType Return Date Format
+ * Permitted values are:
+ * Functions::RETURNDATE_PHP_NUMERIC 'P'
+ * Functions::RETURNDATE_PHP_OBJECT 'O'
+ * Functions::RETURNDATE_EXCEL 'E'
+ *
+ * @return bool Success or failure
+ */
+ public static function setReturnDateType($returnDateType)
+ {
+ if (($returnDateType == self::RETURNDATE_PHP_NUMERIC) ||
+ ($returnDateType == self::RETURNDATE_PHP_OBJECT) ||
+ ($returnDateType == self::RETURNDATE_EXCEL)
+ ) {
+ self::$returnDateType = $returnDateType;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Return the current Return Date Format for functions that return a date/time (Excel, PHP Serialized Numeric or PHP Object).
+ *
+ * @category Function Configuration
+ *
+ * @return string Return Date Format
+ * Possible Return values are:
+ * Functions::RETURNDATE_PHP_NUMERIC 'P'
+ * Functions::RETURNDATE_PHP_OBJECT 'O'
+ * Functions::RETURNDATE_EXCEL 'E'
+ */
+ public static function getReturnDateType()
+ {
+ return self::$returnDateType;
+ }
+
+ /**
+ * DUMMY.
+ *
+ * @category Error Returns
+ *
+ * @return string #Not Yet Implemented
+ */
+ public static function DUMMY()
+ {
+ return '#Not Yet Implemented';
+ }
+
+ /**
+ * DIV0.
+ *
+ * @category Error Returns
+ *
+ * @return string #Not Yet Implemented
+ */
+ public static function DIV0()
+ {
+ return self::$errorCodes['divisionbyzero'];
+ }
+
+ /**
+ * NA.
+ *
+ * Excel Function:
+ * =NA()
+ *
+ * Returns the error value #N/A
+ * #N/A is the error value that means "no value is available."
+ *
+ * @category Logical Functions
+ *
+ * @return string #N/A!
+ */
+ public static function NA()
+ {
+ return self::$errorCodes['na'];
+ }
+
+ /**
+ * NaN.
+ *
+ * Returns the error value #NUM!
+ *
+ * @category Error Returns
+ *
+ * @return string #NUM!
+ */
+ public static function NAN()
+ {
+ return self::$errorCodes['num'];
+ }
+
+ /**
+ * NAME.
+ *
+ * Returns the error value #NAME?
+ *
+ * @category Error Returns
+ *
+ * @return string #NAME?
+ */
+ public static function NAME()
+ {
+ return self::$errorCodes['name'];
+ }
+
+ /**
+ * REF.
+ *
+ * Returns the error value #REF!
+ *
+ * @category Error Returns
+ *
+ * @return string #REF!
+ */
+ public static function REF()
+ {
+ return self::$errorCodes['reference'];
+ }
+
+ /**
+ * NULL.
+ *
+ * Returns the error value #NULL!
+ *
+ * @category Error Returns
+ *
+ * @return string #NULL!
+ */
+ public static function null()
+ {
+ return self::$errorCodes['null'];
+ }
+
+ /**
+ * VALUE.
+ *
+ * Returns the error value #VALUE!
+ *
+ * @category Error Returns
+ *
+ * @return string #VALUE!
+ */
+ public static function VALUE()
+ {
+ return self::$errorCodes['value'];
+ }
+
+ public static function isMatrixValue($idx)
+ {
+ return (substr_count($idx, '.') <= 1) || (preg_match('/\.[A-Z]/', $idx) > 0);
+ }
+
+ public static function isValue($idx)
+ {
+ return substr_count($idx, '.') == 0;
+ }
+
+ public static function isCellValue($idx)
+ {
+ return substr_count($idx, '.') > 1;
+ }
+
+ public static function ifCondition($condition)
+ {
+ $condition = self::flattenSingleValue($condition);
+ if (!isset($condition[0]) && !is_numeric($condition)) {
+ $condition = '=""';
+ }
+ if (!in_array($condition[0], ['>', '<', '='])) {
+ if (!is_numeric($condition)) {
+ $condition = Calculation::wrapResult(strtoupper($condition));
+ }
+
+ return '=' . $condition;
+ }
+ preg_match('/(=|<[>=]?|>=?)(.*)/', $condition, $matches);
+ list(, $operator, $operand) = $matches;
+
+ if (!is_numeric($operand)) {
+ $operand = str_replace('"', '""', $operand);
+ $operand = Calculation::wrapResult(strtoupper($operand));
+ }
+
+ return $operator . $operand;
+ }
+
+ /**
+ * ERROR_TYPE.
+ *
+ * @param mixed $value Value to check
+ *
+ * @return bool
+ */
+ public static function errorType($value = '')
+ {
+ $value = self::flattenSingleValue($value);
+
+ $i = 1;
+ foreach (self::$errorCodes as $errorCode) {
+ if ($value === $errorCode) {
+ return $i;
+ }
+ ++$i;
+ }
+
+ return self::NA();
+ }
+
+ /**
+ * IS_BLANK.
+ *
+ * @param mixed $value Value to check
+ *
+ * @return bool
+ */
+ public static function isBlank($value = null)
+ {
+ if ($value !== null) {
+ $value = self::flattenSingleValue($value);
+ }
+
+ return $value === null;
+ }
+
+ /**
+ * IS_ERR.
+ *
+ * @param mixed $value Value to check
+ *
+ * @return bool
+ */
+ public static function isErr($value = '')
+ {
+ $value = self::flattenSingleValue($value);
+
+ return self::isError($value) && (!self::isNa(($value)));
+ }
+
+ /**
+ * IS_ERROR.
+ *
+ * @param mixed $value Value to check
+ *
+ * @return bool
+ */
+ public static function isError($value = '')
+ {
+ $value = self::flattenSingleValue($value);
+
+ if (!is_string($value)) {
+ return false;
+ }
+
+ return in_array($value, self::$errorCodes);
+ }
+
+ /**
+ * IS_NA.
+ *
+ * @param mixed $value Value to check
+ *
+ * @return bool
+ */
+ public static function isNa($value = '')
+ {
+ $value = self::flattenSingleValue($value);
+
+ return $value === self::NA();
+ }
+
+ /**
+ * IS_EVEN.
+ *
+ * @param mixed $value Value to check
+ *
+ * @return bool|string
+ */
+ public static function isEven($value = null)
+ {
+ $value = self::flattenSingleValue($value);
+
+ if ($value === null) {
+ return self::NAME();
+ } elseif ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
+ return self::VALUE();
+ }
+
+ return $value % 2 == 0;
+ }
+
+ /**
+ * IS_ODD.
+ *
+ * @param mixed $value Value to check
+ *
+ * @return bool|string
+ */
+ public static function isOdd($value = null)
+ {
+ $value = self::flattenSingleValue($value);
+
+ if ($value === null) {
+ return self::NAME();
+ } elseif ((is_bool($value)) || ((is_string($value)) && (!is_numeric($value)))) {
+ return self::VALUE();
+ }
+
+ return abs($value) % 2 == 1;
+ }
+
+ /**
+ * IS_NUMBER.
+ *
+ * @param mixed $value Value to check
+ *
+ * @return bool
+ */
+ public static function isNumber($value = null)
+ {
+ $value = self::flattenSingleValue($value);
+
+ if (is_string($value)) {
+ return false;
+ }
+
+ return is_numeric($value);
+ }
+
+ /**
+ * IS_LOGICAL.
+ *
+ * @param mixed $value Value to check
+ *
+ * @return bool
+ */
+ public static function isLogical($value = null)
+ {
+ $value = self::flattenSingleValue($value);
+
+ return is_bool($value);
+ }
+
+ /**
+ * IS_TEXT.
+ *
+ * @param mixed $value Value to check
+ *
+ * @return bool
+ */
+ public static function isText($value = null)
+ {
+ $value = self::flattenSingleValue($value);
+
+ return is_string($value) && !self::isError($value);
+ }
+
+ /**
+ * IS_NONTEXT.
+ *
+ * @param mixed $value Value to check
+ *
+ * @return bool
+ */
+ public static function isNonText($value = null)
+ {
+ return !self::isText($value);
+ }
+
+ /**
+ * N.
+ *
+ * Returns a value converted to a number
+ *
+ * @param null|mixed $value The value you want converted
+ *
+ * @return number N converts values listed in the following table
+ * If value is or refers to N returns
+ * A number That number
+ * A date The serial number of that date
+ * TRUE 1
+ * FALSE 0
+ * An error value The error value
+ * Anything else 0
+ */
+ public static function n($value = null)
+ {
+ while (is_array($value)) {
+ $value = array_shift($value);
+ }
+
+ switch (gettype($value)) {
+ case 'double':
+ case 'float':
+ case 'integer':
+ return $value;
+ case 'boolean':
+ return (int) $value;
+ case 'string':
+ // Errors
+ if ((strlen($value) > 0) && ($value[0] == '#')) {
+ return $value;
+ }
+
+ break;
+ }
+
+ return 0;
+ }
+
+ /**
+ * TYPE.
+ *
+ * Returns a number that identifies the type of a value
+ *
+ * @param null|mixed $value The value you want tested
+ *
+ * @return number N converts values listed in the following table
+ * If value is or refers to N returns
+ * A number 1
+ * Text 2
+ * Logical Value 4
+ * An error value 16
+ * Array or Matrix 64
+ */
+ public static function TYPE($value = null)
+ {
+ $value = self::flattenArrayIndexed($value);
+ if (is_array($value) && (count($value) > 1)) {
+ end($value);
+ $a = key($value);
+ // Range of cells is an error
+ if (self::isCellValue($a)) {
+ return 16;
+ // Test for Matrix
+ } elseif (self::isMatrixValue($a)) {
+ return 64;
+ }
+ } elseif (empty($value)) {
+ // Empty Cell
+ return 1;
+ }
+ $value = self::flattenSingleValue($value);
+
+ if (($value === null) || (is_float($value)) || (is_int($value))) {
+ return 1;
+ } elseif (is_bool($value)) {
+ return 4;
+ } elseif (is_array($value)) {
+ return 64;
+ } elseif (is_string($value)) {
+ // Errors
+ if ((strlen($value) > 0) && ($value[0] == '#')) {
+ return 16;
+ }
+
+ return 2;
+ }
+
+ return 0;
+ }
+
+ /**
+ * Convert a multi-dimensional array to a simple 1-dimensional array.
+ *
+ * @param array $array Array to be flattened
+ *
+ * @return array Flattened array
+ */
+ public static function flattenArray($array)
+ {
+ if (!is_array($array)) {
+ return (array) $array;
+ }
+
+ $arrayValues = [];
+ foreach ($array as $value) {
+ if (is_array($value)) {
+ foreach ($value as $val) {
+ if (is_array($val)) {
+ foreach ($val as $v) {
+ $arrayValues[] = $v;
+ }
+ } else {
+ $arrayValues[] = $val;
+ }
+ }
+ } else {
+ $arrayValues[] = $value;
+ }
+ }
+
+ return $arrayValues;
+ }
+
+ /**
+ * Convert a multi-dimensional array to a simple 1-dimensional array, but retain an element of indexing.
+ *
+ * @param array $array Array to be flattened
+ *
+ * @return array Flattened array
+ */
+ public static function flattenArrayIndexed($array)
+ {
+ if (!is_array($array)) {
+ return (array) $array;
+ }
+
+ $arrayValues = [];
+ foreach ($array as $k1 => $value) {
+ if (is_array($value)) {
+ foreach ($value as $k2 => $val) {
+ if (is_array($val)) {
+ foreach ($val as $k3 => $v) {
+ $arrayValues[$k1 . '.' . $k2 . '.' . $k3] = $v;
+ }
+ } else {
+ $arrayValues[$k1 . '.' . $k2] = $val;
+ }
+ }
+ } else {
+ $arrayValues[$k1] = $value;
+ }
+ }
+
+ return $arrayValues;
+ }
+
+ /**
+ * Convert an array to a single scalar value by extracting the first element.
+ *
+ * @param mixed $value Array or scalar value
+ *
+ * @return mixed
+ */
+ public static function flattenSingleValue($value = '')
+ {
+ while (is_array($value)) {
+ $value = array_pop($value);
+ }
+
+ return $value;
+ }
+
+ /**
+ * ISFORMULA.
+ *
+ * @param mixed $cellReference The cell to check
+ * @param Cell $pCell The current cell (containing this formula)
+ *
+ * @return bool|string
+ */
+ public static function isFormula($cellReference = '', Cell $pCell = null)
+ {
+ if ($pCell === null) {
+ return self::REF();
+ }
+
+ preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellReference, $matches);
+
+ $cellReference = $matches[6] . $matches[7];
+ $worksheetName = trim($matches[3], "'");
+
+ $worksheet = (!empty($worksheetName))
+ ? $pCell->getWorksheet()->getParent()->getSheetByName($worksheetName)
+ : $pCell->getWorksheet();
+
+ return $worksheet->getCell($cellReference)->isFormula();
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical.php
new file mode 100644
index 00000000000..c36e3fca74f
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Logical.php
@@ -0,0 +1,296 @@
+ 0) && ($returnValue == $argCount);
+ }
+
+ /**
+ * LOGICAL_OR.
+ *
+ * Returns boolean TRUE if any argument is TRUE; returns FALSE if all arguments are FALSE.
+ *
+ * Excel Function:
+ * =OR(logical1[,logical2[, ...]])
+ *
+ * The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays
+ * or references that contain logical values.
+ *
+ * Boolean arguments are treated as True or False as appropriate
+ * Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
+ * If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
+ * the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
+ *
+ * @category Logical Functions
+ *
+ * @param mixed $args Data values
+ *
+ * @return bool|string the logical OR of the arguments
+ */
+ public static function logicalOr(...$args)
+ {
+ $args = Functions::flattenArray($args);
+
+ if (count($args) == 0) {
+ return Functions::VALUE();
+ }
+
+ $args = array_filter($args, function ($value) {
+ return $value !== null || (is_string($value) && trim($value) == '');
+ });
+
+ $returnValue = self::countTrueValues($args);
+ if (is_string($returnValue)) {
+ return $returnValue;
+ }
+
+ return $returnValue > 0;
+ }
+
+ /**
+ * LOGICAL_XOR.
+ *
+ * Returns the Exclusive Or logical operation for one or more supplied conditions.
+ * i.e. the Xor function returns TRUE if an odd number of the supplied conditions evaluate to TRUE, and FALSE otherwise.
+ *
+ * Excel Function:
+ * =XOR(logical1[,logical2[, ...]])
+ *
+ * The arguments must evaluate to logical values such as TRUE or FALSE, or the arguments must be arrays
+ * or references that contain logical values.
+ *
+ * Boolean arguments are treated as True or False as appropriate
+ * Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
+ * If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
+ * the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
+ *
+ * @category Logical Functions
+ *
+ * @param mixed $args Data values
+ *
+ * @return bool|string the logical XOR of the arguments
+ */
+ public static function logicalXor(...$args)
+ {
+ $args = Functions::flattenArray($args);
+
+ if (count($args) == 0) {
+ return Functions::VALUE();
+ }
+
+ $args = array_filter($args, function ($value) {
+ return $value !== null || (is_string($value) && trim($value) == '');
+ });
+
+ $returnValue = self::countTrueValues($args);
+ if (is_string($returnValue)) {
+ return $returnValue;
+ }
+
+ return $returnValue % 2 == 1;
+ }
+
+ /**
+ * NOT.
+ *
+ * Returns the boolean inverse of the argument.
+ *
+ * Excel Function:
+ * =NOT(logical)
+ *
+ * The argument must evaluate to a logical value such as TRUE or FALSE
+ *
+ * Boolean arguments are treated as True or False as appropriate
+ * Integer or floating point arguments are treated as True, except for 0 or 0.0 which are False
+ * If any argument value is a string, or a Null, the function returns a #VALUE! error, unless the string holds
+ * the value TRUE or FALSE, in which case it is evaluated as the corresponding boolean value
+ *
+ * @category Logical Functions
+ *
+ * @param mixed $logical A value or expression that can be evaluated to TRUE or FALSE
+ *
+ * @return bool|string the boolean inverse of the argument
+ */
+ public static function NOT($logical = false)
+ {
+ $logical = Functions::flattenSingleValue($logical);
+
+ if (is_string($logical)) {
+ $logical = strtoupper($logical);
+ if (($logical == 'TRUE') || ($logical == Calculation::getTRUE())) {
+ return false;
+ } elseif (($logical == 'FALSE') || ($logical == Calculation::getFALSE())) {
+ return true;
+ }
+
+ return Functions::VALUE();
+ }
+
+ return !$logical;
+ }
+
+ /**
+ * STATEMENT_IF.
+ *
+ * Returns one value if a condition you specify evaluates to TRUE and another value if it evaluates to FALSE.
+ *
+ * Excel Function:
+ * =IF(condition[,returnIfTrue[,returnIfFalse]])
+ *
+ * Condition is any value or expression that can be evaluated to TRUE or FALSE.
+ * For example, A10=100 is a logical expression; if the value in cell A10 is equal to 100,
+ * the expression evaluates to TRUE. Otherwise, the expression evaluates to FALSE.
+ * This argument can use any comparison calculation operator.
+ * ReturnIfTrue is the value that is returned if condition evaluates to TRUE.
+ * For example, if this argument is the text string "Within budget" and the condition argument evaluates to TRUE,
+ * then the IF function returns the text "Within budget"
+ * If condition is TRUE and ReturnIfTrue is blank, this argument returns 0 (zero). To display the word TRUE, use
+ * the logical value TRUE for this argument.
+ * ReturnIfTrue can be another formula.
+ * ReturnIfFalse is the value that is returned if condition evaluates to FALSE.
+ * For example, if this argument is the text string "Over budget" and the condition argument evaluates to FALSE,
+ * then the IF function returns the text "Over budget".
+ * If condition is FALSE and ReturnIfFalse is omitted, then the logical value FALSE is returned.
+ * If condition is FALSE and ReturnIfFalse is blank, then the value 0 (zero) is returned.
+ * ReturnIfFalse can be another formula.
+ *
+ * @category Logical Functions
+ *
+ * @param mixed $condition Condition to evaluate
+ * @param mixed $returnIfTrue Value to return when condition is true
+ * @param mixed $returnIfFalse Optional value to return when condition is false
+ *
+ * @return mixed The value of returnIfTrue or returnIfFalse determined by condition
+ */
+ public static function statementIf($condition = true, $returnIfTrue = 0, $returnIfFalse = false)
+ {
+ $condition = ($condition === null) ? true : (bool) Functions::flattenSingleValue($condition);
+ $returnIfTrue = ($returnIfTrue === null) ? 0 : Functions::flattenSingleValue($returnIfTrue);
+ $returnIfFalse = ($returnIfFalse === null) ? false : Functions::flattenSingleValue($returnIfFalse);
+
+ return ($condition) ? $returnIfTrue : $returnIfFalse;
+ }
+
+ /**
+ * IFERROR.
+ *
+ * Excel Function:
+ * =IFERROR(testValue,errorpart)
+ *
+ * @category Logical Functions
+ *
+ * @param mixed $testValue Value to check, is also the value returned when no error
+ * @param mixed $errorpart Value to return when testValue is an error condition
+ *
+ * @return mixed The value of errorpart or testValue determined by error condition
+ */
+ public static function IFERROR($testValue = '', $errorpart = '')
+ {
+ $testValue = ($testValue === null) ? '' : Functions::flattenSingleValue($testValue);
+ $errorpart = ($errorpart === null) ? '' : Functions::flattenSingleValue($errorpart);
+
+ return self::statementIf(Functions::isError($testValue), $errorpart, $testValue);
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php
new file mode 100644
index 00000000000..e6b0f3203f8
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/LookupRef.php
@@ -0,0 +1,926 @@
+ '') {
+ if (strpos($sheetText, ' ') !== false) {
+ $sheetText = "'" . $sheetText . "'";
+ }
+ $sheetText .= '!';
+ }
+ if ((!is_bool($referenceStyle)) || $referenceStyle) {
+ $rowRelative = $columnRelative = '$';
+ $column = Coordinate::stringFromColumnIndex($column);
+ if (($relativity == 2) || ($relativity == 4)) {
+ $columnRelative = '';
+ }
+ if (($relativity == 3) || ($relativity == 4)) {
+ $rowRelative = '';
+ }
+
+ return $sheetText . $columnRelative . $column . $rowRelative . $row;
+ }
+ if (($relativity == 2) || ($relativity == 4)) {
+ $column = '[' . $column . ']';
+ }
+ if (($relativity == 3) || ($relativity == 4)) {
+ $row = '[' . $row . ']';
+ }
+
+ return $sheetText . 'R' . $row . 'C' . $column;
+ }
+
+ /**
+ * COLUMN.
+ *
+ * Returns the column number of the given cell reference
+ * If the cell reference is a range of cells, COLUMN returns the column numbers of each column in the reference as a horizontal array.
+ * If cell reference is omitted, and the function is being called through the calculation engine, then it is assumed to be the
+ * reference of the cell in which the COLUMN function appears; otherwise this function returns 0.
+ *
+ * Excel Function:
+ * =COLUMN([cellAddress])
+ *
+ * @param null|array|string $cellAddress A reference to a range of cells for which you want the column numbers
+ *
+ * @return int|int[]
+ */
+ public static function COLUMN($cellAddress = null)
+ {
+ if ($cellAddress === null || trim($cellAddress) === '') {
+ return 0;
+ }
+
+ if (is_array($cellAddress)) {
+ foreach ($cellAddress as $columnKey => $value) {
+ $columnKey = preg_replace('/[^a-z]/i', '', $columnKey);
+
+ return (int) Coordinate::columnIndexFromString($columnKey);
+ }
+ } else {
+ list($sheet, $cellAddress) = Worksheet::extractSheetTitle($cellAddress, true);
+ if (strpos($cellAddress, ':') !== false) {
+ list($startAddress, $endAddress) = explode(':', $cellAddress);
+ $startAddress = preg_replace('/[^a-z]/i', '', $startAddress);
+ $endAddress = preg_replace('/[^a-z]/i', '', $endAddress);
+ $returnValue = [];
+ do {
+ $returnValue[] = (int) Coordinate::columnIndexFromString($startAddress);
+ } while ($startAddress++ != $endAddress);
+
+ return $returnValue;
+ }
+ $cellAddress = preg_replace('/[^a-z]/i', '', $cellAddress);
+
+ return (int) Coordinate::columnIndexFromString($cellAddress);
+ }
+ }
+
+ /**
+ * COLUMNS.
+ *
+ * Returns the number of columns in an array or reference.
+ *
+ * Excel Function:
+ * =COLUMNS(cellAddress)
+ *
+ * @param null|array|string $cellAddress An array or array formula, or a reference to a range of cells for which you want the number of columns
+ *
+ * @return int The number of columns in cellAddress
+ */
+ public static function COLUMNS($cellAddress = null)
+ {
+ if ($cellAddress === null || $cellAddress === '') {
+ return 1;
+ } elseif (!is_array($cellAddress)) {
+ return Functions::VALUE();
+ }
+
+ reset($cellAddress);
+ $isMatrix = (is_numeric(key($cellAddress)));
+ list($columns, $rows) = Calculation::getMatrixDimensions($cellAddress);
+
+ if ($isMatrix) {
+ return $rows;
+ }
+
+ return $columns;
+ }
+
+ /**
+ * ROW.
+ *
+ * Returns the row number of the given cell reference
+ * If the cell reference is a range of cells, ROW returns the row numbers of each row in the reference as a vertical array.
+ * If cell reference is omitted, and the function is being called through the calculation engine, then it is assumed to be the
+ * reference of the cell in which the ROW function appears; otherwise this function returns 0.
+ *
+ * Excel Function:
+ * =ROW([cellAddress])
+ *
+ * @param null|array|string $cellAddress A reference to a range of cells for which you want the row numbers
+ *
+ * @return int or array of integer
+ */
+ public static function ROW($cellAddress = null)
+ {
+ if ($cellAddress === null || trim($cellAddress) === '') {
+ return 0;
+ }
+
+ if (is_array($cellAddress)) {
+ foreach ($cellAddress as $columnKey => $rowValue) {
+ foreach ($rowValue as $rowKey => $cellValue) {
+ return (int) preg_replace('/\D/', '', $rowKey);
+ }
+ }
+ } else {
+ list($sheet, $cellAddress) = Worksheet::extractSheetTitle($cellAddress, true);
+ if (strpos($cellAddress, ':') !== false) {
+ list($startAddress, $endAddress) = explode(':', $cellAddress);
+ $startAddress = preg_replace('/\D/', '', $startAddress);
+ $endAddress = preg_replace('/\D/', '', $endAddress);
+ $returnValue = [];
+ do {
+ $returnValue[][] = (int) $startAddress;
+ } while ($startAddress++ != $endAddress);
+
+ return $returnValue;
+ }
+ list($cellAddress) = explode(':', $cellAddress);
+
+ return (int) preg_replace('/\D/', '', $cellAddress);
+ }
+ }
+
+ /**
+ * ROWS.
+ *
+ * Returns the number of rows in an array or reference.
+ *
+ * Excel Function:
+ * =ROWS(cellAddress)
+ *
+ * @param null|array|string $cellAddress An array or array formula, or a reference to a range of cells for which you want the number of rows
+ *
+ * @return int The number of rows in cellAddress
+ */
+ public static function ROWS($cellAddress = null)
+ {
+ if ($cellAddress === null || $cellAddress === '') {
+ return 1;
+ } elseif (!is_array($cellAddress)) {
+ return Functions::VALUE();
+ }
+
+ reset($cellAddress);
+ $isMatrix = (is_numeric(key($cellAddress)));
+ list($columns, $rows) = Calculation::getMatrixDimensions($cellAddress);
+
+ if ($isMatrix) {
+ return $columns;
+ }
+
+ return $rows;
+ }
+
+ /**
+ * HYPERLINK.
+ *
+ * Excel Function:
+ * =HYPERLINK(linkURL,displayName)
+ *
+ * @category Logical Functions
+ *
+ * @param string $linkURL Value to check, is also the value returned when no error
+ * @param string $displayName Value to return when testValue is an error condition
+ * @param Cell $pCell The cell to set the hyperlink in
+ *
+ * @return mixed The value of $displayName (or $linkURL if $displayName was blank)
+ */
+ public static function HYPERLINK($linkURL = '', $displayName = null, Cell $pCell = null)
+ {
+ $linkURL = ($linkURL === null) ? '' : Functions::flattenSingleValue($linkURL);
+ $displayName = ($displayName === null) ? '' : Functions::flattenSingleValue($displayName);
+
+ if ((!is_object($pCell)) || (trim($linkURL) == '')) {
+ return Functions::REF();
+ }
+
+ if ((is_object($displayName)) || trim($displayName) == '') {
+ $displayName = $linkURL;
+ }
+
+ $pCell->getHyperlink()->setUrl($linkURL);
+ $pCell->getHyperlink()->setTooltip($displayName);
+
+ return $displayName;
+ }
+
+ /**
+ * INDIRECT.
+ *
+ * Returns the reference specified by a text string.
+ * References are immediately evaluated to display their contents.
+ *
+ * Excel Function:
+ * =INDIRECT(cellAddress)
+ *
+ * NOTE - INDIRECT() does not yet support the optional a1 parameter introduced in Excel 2010
+ *
+ * @param null|array|string $cellAddress $cellAddress The cell address of the current cell (containing this formula)
+ * @param Cell $pCell The current cell (containing this formula)
+ *
+ * @return mixed The cells referenced by cellAddress
+ *
+ * @todo Support for the optional a1 parameter introduced in Excel 2010
+ */
+ public static function INDIRECT($cellAddress = null, Cell $pCell = null)
+ {
+ $cellAddress = Functions::flattenSingleValue($cellAddress);
+ if ($cellAddress === null || $cellAddress === '') {
+ return Functions::REF();
+ }
+
+ $cellAddress1 = $cellAddress;
+ $cellAddress2 = null;
+ if (strpos($cellAddress, ':') !== false) {
+ list($cellAddress1, $cellAddress2) = explode(':', $cellAddress);
+ }
+
+ if ((!preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellAddress1, $matches)) ||
+ (($cellAddress2 !== null) && (!preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellAddress2, $matches)))) {
+ if (!preg_match('/^' . Calculation::CALCULATION_REGEXP_NAMEDRANGE . '$/i', $cellAddress1, $matches)) {
+ return Functions::REF();
+ }
+
+ if (strpos($cellAddress, '!') !== false) {
+ list($sheetName, $cellAddress) = Worksheet::extractSheetTitle($cellAddress, true);
+ $sheetName = trim($sheetName, "'");
+ $pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
+ } else {
+ $pSheet = $pCell->getWorksheet();
+ }
+
+ return Calculation::getInstance()->extractNamedRange($cellAddress, $pSheet, false);
+ }
+
+ if (strpos($cellAddress, '!') !== false) {
+ list($sheetName, $cellAddress) = Worksheet::extractSheetTitle($cellAddress, true);
+ $sheetName = trim($sheetName, "'");
+ $pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
+ } else {
+ $pSheet = $pCell->getWorksheet();
+ }
+
+ return Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false);
+ }
+
+ /**
+ * OFFSET.
+ *
+ * Returns a reference to a range that is a specified number of rows and columns from a cell or range of cells.
+ * The reference that is returned can be a single cell or a range of cells. You can specify the number of rows and
+ * the number of columns to be returned.
+ *
+ * Excel Function:
+ * =OFFSET(cellAddress, rows, cols, [height], [width])
+ *
+ * @param null|string $cellAddress The reference from which you want to base the offset. Reference must refer to a cell or
+ * range of adjacent cells; otherwise, OFFSET returns the #VALUE! error value.
+ * @param mixed $rows The number of rows, up or down, that you want the upper-left cell to refer to.
+ * Using 5 as the rows argument specifies that the upper-left cell in the reference is
+ * five rows below reference. Rows can be positive (which means below the starting reference)
+ * or negative (which means above the starting reference).
+ * @param mixed $columns The number of columns, to the left or right, that you want the upper-left cell of the result
+ * to refer to. Using 5 as the cols argument specifies that the upper-left cell in the
+ * reference is five columns to the right of reference. Cols can be positive (which means
+ * to the right of the starting reference) or negative (which means to the left of the
+ * starting reference).
+ * @param mixed $height The height, in number of rows, that you want the returned reference to be. Height must be a positive number.
+ * @param mixed $width The width, in number of columns, that you want the returned reference to be. Width must be a positive number.
+ * @param null|Cell $pCell
+ *
+ * @return string A reference to a cell or range of cells
+ */
+ public static function OFFSET($cellAddress = null, $rows = 0, $columns = 0, $height = null, $width = null, Cell $pCell = null)
+ {
+ $rows = Functions::flattenSingleValue($rows);
+ $columns = Functions::flattenSingleValue($columns);
+ $height = Functions::flattenSingleValue($height);
+ $width = Functions::flattenSingleValue($width);
+ if ($cellAddress === null) {
+ return 0;
+ }
+
+ if (!is_object($pCell)) {
+ return Functions::REF();
+ }
+
+ $sheetName = null;
+ if (strpos($cellAddress, '!')) {
+ list($sheetName, $cellAddress) = Worksheet::extractSheetTitle($cellAddress, true);
+ $sheetName = trim($sheetName, "'");
+ }
+ if (strpos($cellAddress, ':')) {
+ list($startCell, $endCell) = explode(':', $cellAddress);
+ } else {
+ $startCell = $endCell = $cellAddress;
+ }
+ list($startCellColumn, $startCellRow) = Coordinate::coordinateFromString($startCell);
+ list($endCellColumn, $endCellRow) = Coordinate::coordinateFromString($endCell);
+
+ $startCellRow += $rows;
+ $startCellColumn = Coordinate::columnIndexFromString($startCellColumn) - 1;
+ $startCellColumn += $columns;
+
+ if (($startCellRow <= 0) || ($startCellColumn < 0)) {
+ return Functions::REF();
+ }
+ $endCellColumn = Coordinate::columnIndexFromString($endCellColumn) - 1;
+ if (($width != null) && (!is_object($width))) {
+ $endCellColumn = $startCellColumn + $width - 1;
+ } else {
+ $endCellColumn += $columns;
+ }
+ $startCellColumn = Coordinate::stringFromColumnIndex($startCellColumn + 1);
+
+ if (($height != null) && (!is_object($height))) {
+ $endCellRow = $startCellRow + $height - 1;
+ } else {
+ $endCellRow += $rows;
+ }
+
+ if (($endCellRow <= 0) || ($endCellColumn < 0)) {
+ return Functions::REF();
+ }
+ $endCellColumn = Coordinate::stringFromColumnIndex($endCellColumn + 1);
+
+ $cellAddress = $startCellColumn . $startCellRow;
+ if (($startCellColumn != $endCellColumn) || ($startCellRow != $endCellRow)) {
+ $cellAddress .= ':' . $endCellColumn . $endCellRow;
+ }
+
+ if ($sheetName !== null) {
+ $pSheet = $pCell->getWorksheet()->getParent()->getSheetByName($sheetName);
+ } else {
+ $pSheet = $pCell->getWorksheet();
+ }
+
+ return Calculation::getInstance()->extractCellRange($cellAddress, $pSheet, false);
+ }
+
+ /**
+ * CHOOSE.
+ *
+ * Uses lookup_value to return a value from the list of value arguments.
+ * Use CHOOSE to select one of up to 254 values based on the lookup_value.
+ *
+ * Excel Function:
+ * =CHOOSE(index_num, value1, [value2], ...)
+ *
+ * @param mixed $index_num Specifies which value argument is selected.
+ * Index_num must be a number between 1 and 254, or a formula or reference to a cell containing a number
+ * between 1 and 254.
+ * @param mixed $value1 ... Value1 is required, subsequent values are optional.
+ * Between 1 to 254 value arguments from which CHOOSE selects a value or an action to perform based on
+ * index_num. The arguments can be numbers, cell references, defined names, formulas, functions, or
+ * text.
+ *
+ * @return mixed The selected value
+ */
+ public static function CHOOSE(...$chooseArgs)
+ {
+ $chosenEntry = Functions::flattenArray(array_shift($chooseArgs));
+ $entryCount = count($chooseArgs) - 1;
+
+ if (is_array($chosenEntry)) {
+ $chosenEntry = array_shift($chosenEntry);
+ }
+ if ((is_numeric($chosenEntry)) && (!is_bool($chosenEntry))) {
+ --$chosenEntry;
+ } else {
+ return Functions::VALUE();
+ }
+ $chosenEntry = floor($chosenEntry);
+ if (($chosenEntry < 0) || ($chosenEntry > $entryCount)) {
+ return Functions::VALUE();
+ }
+
+ if (is_array($chooseArgs[$chosenEntry])) {
+ return Functions::flattenArray($chooseArgs[$chosenEntry]);
+ }
+
+ return $chooseArgs[$chosenEntry];
+ }
+
+ /**
+ * MATCH.
+ *
+ * The MATCH function searches for a specified item in a range of cells
+ *
+ * Excel Function:
+ * =MATCH(lookup_value, lookup_array, [match_type])
+ *
+ * @param mixed $lookupValue The value that you want to match in lookup_array
+ * @param mixed $lookupArray The range of cells being searched
+ * @param mixed $matchType The number -1, 0, or 1. -1 means above, 0 means exact match, 1 means below. If match_type is 1 or -1, the list has to be ordered.
+ *
+ * @return int The relative position of the found item
+ */
+ public static function MATCH($lookupValue, $lookupArray, $matchType = 1)
+ {
+ $lookupArray = Functions::flattenArray($lookupArray);
+ $lookupValue = Functions::flattenSingleValue($lookupValue);
+ $matchType = ($matchType === null) ? 1 : (int) Functions::flattenSingleValue($matchType);
+
+ $initialLookupValue = $lookupValue;
+ // MATCH is not case sensitive
+ $lookupValue = StringHelper::strToLower($lookupValue);
+
+ // Lookup_value type has to be number, text, or logical values
+ if ((!is_numeric($lookupValue)) && (!is_string($lookupValue)) && (!is_bool($lookupValue))) {
+ return Functions::NA();
+ }
+
+ // Match_type is 0, 1 or -1
+ if (($matchType !== 0) && ($matchType !== -1) && ($matchType !== 1)) {
+ return Functions::NA();
+ }
+
+ // Lookup_array should not be empty
+ $lookupArraySize = count($lookupArray);
+ if ($lookupArraySize <= 0) {
+ return Functions::NA();
+ }
+
+ // Lookup_array should contain only number, text, or logical values, or empty (null) cells
+ foreach ($lookupArray as $i => $lookupArrayValue) {
+ // check the type of the value
+ if ((!is_numeric($lookupArrayValue)) && (!is_string($lookupArrayValue)) &&
+ (!is_bool($lookupArrayValue)) && ($lookupArrayValue !== null)
+ ) {
+ return Functions::NA();
+ }
+ // Convert strings to lowercase for case-insensitive testing
+ if (is_string($lookupArrayValue)) {
+ $lookupArray[$i] = StringHelper::strToLower($lookupArrayValue);
+ }
+ if (($lookupArrayValue === null) && (($matchType == 1) || ($matchType == -1))) {
+ $lookupArray = array_slice($lookupArray, 0, $i - 1);
+ }
+ }
+
+ if ($matchType == 1) {
+ // If match_type is 1 the list has to be processed from last to first
+
+ $lookupArray = array_reverse($lookupArray);
+ $keySet = array_reverse(array_keys($lookupArray));
+ }
+
+ // **
+ // find the match
+ // **
+
+ if ($matchType == 0 || $matchType == 1) {
+ foreach ($lookupArray as $i => $lookupArrayValue) {
+ $onlyNumeric = is_numeric($lookupArrayValue) && is_numeric($lookupValue);
+ $onlyNumericExactMatch = $onlyNumeric && $lookupArrayValue == $lookupValue;
+ $nonOnlyNumericExactMatch = !$onlyNumeric && $lookupArrayValue === $lookupValue;
+ $exactMatch = $onlyNumericExactMatch || $nonOnlyNumericExactMatch;
+ if (($matchType == 0) && $exactMatch) {
+ // exact match
+ return $i + 1;
+ } elseif (($matchType == 1) && ($lookupArrayValue <= $lookupValue)) {
+ $i = array_search($i, $keySet);
+
+ // The current value is the (first) match
+ return $i + 1;
+ }
+ }
+ } else {
+ // matchType = -1
+
+ // "Special" case: since the array it's supposed to be ordered in descending order, the
+ // Excel algorithm gives up immediately if the first element is smaller than the searched value
+ if ($lookupArray[0] < $lookupValue) {
+ return Functions::NA();
+ }
+
+ $maxValueKey = null;
+
+ // The basic algorithm is:
+ // Iterate and keep the highest match until the next element is smaller than the searched value.
+ // Return immediately if perfect match is found
+ foreach ($lookupArray as $i => $lookupArrayValue) {
+ if ($lookupArrayValue == $lookupValue) {
+ // Another "special" case. If a perfect match is found,
+ // the algorithm gives up immediately
+ return $i + 1;
+ } elseif ($lookupArrayValue >= $lookupValue) {
+ $maxValueKey = $i + 1;
+ }
+ }
+
+ if ($maxValueKey !== null) {
+ return $maxValueKey;
+ }
+ }
+
+ // Unsuccessful in finding a match, return #N/A error value
+ return Functions::NA();
+ }
+
+ /**
+ * INDEX.
+ *
+ * Uses an index to choose a value from a reference or array
+ *
+ * Excel Function:
+ * =INDEX(range_array, row_num, [column_num])
+ *
+ * @param mixed $arrayValues A range of cells or an array constant
+ * @param mixed $rowNum The row in array from which to return a value. If row_num is omitted, column_num is required.
+ * @param mixed $columnNum The column in array from which to return a value. If column_num is omitted, row_num is required.
+ *
+ * @return mixed the value of a specified cell or array of cells
+ */
+ public static function INDEX($arrayValues, $rowNum = 0, $columnNum = 0)
+ {
+ $rowNum = Functions::flattenSingleValue($rowNum);
+ $columnNum = Functions::flattenSingleValue($columnNum);
+
+ if (($rowNum < 0) || ($columnNum < 0)) {
+ return Functions::VALUE();
+ }
+
+ if (!is_array($arrayValues) || ($rowNum > count($arrayValues))) {
+ return Functions::REF();
+ }
+
+ $rowKeys = array_keys($arrayValues);
+ $columnKeys = @array_keys($arrayValues[$rowKeys[0]]);
+
+ if ($columnNum > count($columnKeys)) {
+ return Functions::VALUE();
+ } elseif ($columnNum == 0) {
+ if ($rowNum == 0) {
+ return $arrayValues;
+ }
+ $rowNum = $rowKeys[--$rowNum];
+ $returnArray = [];
+ foreach ($arrayValues as $arrayColumn) {
+ if (is_array($arrayColumn)) {
+ if (isset($arrayColumn[$rowNum])) {
+ $returnArray[] = $arrayColumn[$rowNum];
+ } else {
+ return [$rowNum => $arrayValues[$rowNum]];
+ }
+ } else {
+ return $arrayValues[$rowNum];
+ }
+ }
+
+ return $returnArray;
+ }
+ $columnNum = $columnKeys[--$columnNum];
+ if ($rowNum > count($rowKeys)) {
+ return Functions::VALUE();
+ } elseif ($rowNum == 0) {
+ return $arrayValues[$columnNum];
+ }
+ $rowNum = $rowKeys[--$rowNum];
+
+ return $arrayValues[$rowNum][$columnNum];
+ }
+
+ /**
+ * TRANSPOSE.
+ *
+ * @param array $matrixData A matrix of values
+ *
+ * @return array
+ *
+ * Unlike the Excel TRANSPOSE function, which will only work on a single row or column, this function will transpose a full matrix
+ */
+ public static function TRANSPOSE($matrixData)
+ {
+ $returnMatrix = [];
+ if (!is_array($matrixData)) {
+ $matrixData = [[$matrixData]];
+ }
+
+ $column = 0;
+ foreach ($matrixData as $matrixRow) {
+ $row = 0;
+ foreach ($matrixRow as $matrixCell) {
+ $returnMatrix[$row][$column] = $matrixCell;
+ ++$row;
+ }
+ ++$column;
+ }
+
+ return $returnMatrix;
+ }
+
+ private static function vlookupSort($a, $b)
+ {
+ reset($a);
+ $firstColumn = key($a);
+ $aLower = StringHelper::strToLower($a[$firstColumn]);
+ $bLower = StringHelper::strToLower($b[$firstColumn]);
+ if ($aLower == $bLower) {
+ return 0;
+ }
+
+ return ($aLower < $bLower) ? -1 : 1;
+ }
+
+ /**
+ * VLOOKUP
+ * The VLOOKUP function searches for value in the left-most column of lookup_array and returns the value in the same row based on the index_number.
+ *
+ * @param mixed $lookup_value The value that you want to match in lookup_array
+ * @param mixed $lookup_array The range of cells being searched
+ * @param mixed $index_number The column number in table_array from which the matching value must be returned. The first column is 1.
+ * @param mixed $not_exact_match determines if you are looking for an exact match based on lookup_value
+ *
+ * @return mixed The value of the found cell
+ */
+ public static function VLOOKUP($lookup_value, $lookup_array, $index_number, $not_exact_match = true)
+ {
+ $lookup_value = Functions::flattenSingleValue($lookup_value);
+ $index_number = Functions::flattenSingleValue($index_number);
+ $not_exact_match = Functions::flattenSingleValue($not_exact_match);
+
+ // index_number must be greater than or equal to 1
+ if ($index_number < 1) {
+ return Functions::VALUE();
+ }
+
+ // index_number must be less than or equal to the number of columns in lookup_array
+ if ((!is_array($lookup_array)) || (empty($lookup_array))) {
+ return Functions::REF();
+ }
+ $f = array_keys($lookup_array);
+ $firstRow = array_pop($f);
+ if ((!is_array($lookup_array[$firstRow])) || ($index_number > count($lookup_array[$firstRow]))) {
+ return Functions::REF();
+ }
+ $columnKeys = array_keys($lookup_array[$firstRow]);
+ $returnColumn = $columnKeys[--$index_number];
+ $firstColumn = array_shift($columnKeys);
+
+ if (!$not_exact_match) {
+ uasort($lookup_array, ['self', 'vlookupSort']);
+ }
+
+ $lookupLower = StringHelper::strToLower($lookup_value);
+ $rowNumber = $rowValue = false;
+ foreach ($lookup_array as $rowKey => $rowData) {
+ $firstLower = StringHelper::strToLower($rowData[$firstColumn]);
+
+ // break if we have passed possible keys
+ if ((is_numeric($lookup_value) && is_numeric($rowData[$firstColumn]) && ($rowData[$firstColumn] > $lookup_value)) ||
+ (!is_numeric($lookup_value) && !is_numeric($rowData[$firstColumn]) && ($firstLower > $lookupLower))) {
+ break;
+ }
+ // remember the last key, but only if datatypes match
+ if ((is_numeric($lookup_value) && is_numeric($rowData[$firstColumn])) ||
+ (!is_numeric($lookup_value) && !is_numeric($rowData[$firstColumn]))) {
+ if ($not_exact_match) {
+ $rowNumber = $rowKey;
+
+ continue;
+ } elseif (($firstLower == $lookupLower)
+ // Spreadsheets software returns first exact match,
+ // we have sorted and we might have broken key orders
+ // we want the first one (by its initial index)
+ && (($rowNumber == false) || ($rowKey < $rowNumber))
+ ) {
+ $rowNumber = $rowKey;
+ }
+ }
+ }
+
+ if ($rowNumber !== false) {
+ // return the appropriate value
+ return $lookup_array[$rowNumber][$returnColumn];
+ }
+
+ return Functions::NA();
+ }
+
+ /**
+ * HLOOKUP
+ * The HLOOKUP function searches for value in the top-most row of lookup_array and returns the value in the same column based on the index_number.
+ *
+ * @param mixed $lookup_value The value that you want to match in lookup_array
+ * @param mixed $lookup_array The range of cells being searched
+ * @param mixed $index_number The row number in table_array from which the matching value must be returned. The first row is 1.
+ * @param mixed $not_exact_match determines if you are looking for an exact match based on lookup_value
+ *
+ * @return mixed The value of the found cell
+ */
+ public static function HLOOKUP($lookup_value, $lookup_array, $index_number, $not_exact_match = true)
+ {
+ $lookup_value = Functions::flattenSingleValue($lookup_value);
+ $index_number = Functions::flattenSingleValue($index_number);
+ $not_exact_match = Functions::flattenSingleValue($not_exact_match);
+
+ // index_number must be greater than or equal to 1
+ if ($index_number < 1) {
+ return Functions::VALUE();
+ }
+
+ // index_number must be less than or equal to the number of columns in lookup_array
+ if ((!is_array($lookup_array)) || (empty($lookup_array))) {
+ return Functions::REF();
+ }
+ $f = array_keys($lookup_array);
+ $firstRow = array_pop($f);
+ if ((!is_array($lookup_array[$firstRow])) || ($index_number > count($lookup_array))) {
+ return Functions::REF();
+ }
+
+ $firstkey = $f[0] - 1;
+ $returnColumn = $firstkey + $index_number;
+ $firstColumn = array_shift($f);
+ $rowNumber = null;
+ foreach ($lookup_array[$firstColumn] as $rowKey => $rowData) {
+ // break if we have passed possible keys
+ $bothNumeric = is_numeric($lookup_value) && is_numeric($rowData);
+ $bothNotNumeric = !is_numeric($lookup_value) && !is_numeric($rowData);
+ $lookupLower = StringHelper::strToLower($lookup_value);
+ $rowDataLower = StringHelper::strToLower($rowData);
+
+ if (($bothNumeric && $rowData > $lookup_value) ||
+ ($bothNotNumeric && $rowDataLower > $lookupLower)) {
+ break;
+ }
+
+ // Remember the last key, but only if datatypes match (as in VLOOKUP)
+ if ($bothNumeric || $bothNotNumeric) {
+ if ($not_exact_match) {
+ $rowNumber = $rowKey;
+
+ continue;
+ } elseif ($rowDataLower === $lookupLower
+ && ($rowNumber === null || $rowKey < $rowNumber)
+ ) {
+ $rowNumber = $rowKey;
+ }
+ }
+ }
+
+ if ($rowNumber !== null) {
+ // otherwise return the appropriate value
+ return $lookup_array[$returnColumn][$rowNumber];
+ }
+
+ return Functions::NA();
+ }
+
+ /**
+ * LOOKUP
+ * The LOOKUP function searches for value either from a one-row or one-column range or from an array.
+ *
+ * @param mixed $lookup_value The value that you want to match in lookup_array
+ * @param mixed $lookup_vector The range of cells being searched
+ * @param null|mixed $result_vector The column from which the matching value must be returned
+ *
+ * @return mixed The value of the found cell
+ */
+ public static function LOOKUP($lookup_value, $lookup_vector, $result_vector = null)
+ {
+ $lookup_value = Functions::flattenSingleValue($lookup_value);
+
+ if (!is_array($lookup_vector)) {
+ return Functions::NA();
+ }
+ $hasResultVector = isset($result_vector);
+ $lookupRows = count($lookup_vector);
+ $l = array_keys($lookup_vector);
+ $l = array_shift($l);
+ $lookupColumns = count($lookup_vector[$l]);
+ // we correctly orient our results
+ if (($lookupRows === 1 && $lookupColumns > 1) || (!$hasResultVector && $lookupRows === 2 && $lookupColumns !== 2)) {
+ $lookup_vector = self::TRANSPOSE($lookup_vector);
+ $lookupRows = count($lookup_vector);
+ $l = array_keys($lookup_vector);
+ $lookupColumns = count($lookup_vector[array_shift($l)]);
+ }
+
+ if ($result_vector === null) {
+ $result_vector = $lookup_vector;
+ }
+ $resultRows = count($result_vector);
+ $l = array_keys($result_vector);
+ $l = array_shift($l);
+ $resultColumns = count($result_vector[$l]);
+ // we correctly orient our results
+ if ($resultRows === 1 && $resultColumns > 1) {
+ $result_vector = self::TRANSPOSE($result_vector);
+ $resultRows = count($result_vector);
+ $r = array_keys($result_vector);
+ $resultColumns = count($result_vector[array_shift($r)]);
+ }
+
+ if ($lookupRows === 2 && !$hasResultVector) {
+ $result_vector = array_pop($lookup_vector);
+ $lookup_vector = array_shift($lookup_vector);
+ }
+
+ if ($lookupColumns !== 2) {
+ foreach ($lookup_vector as &$value) {
+ if (is_array($value)) {
+ $k = array_keys($value);
+ $key1 = $key2 = array_shift($k);
+ ++$key2;
+ $dataValue1 = $value[$key1];
+ } else {
+ $key1 = 0;
+ $key2 = 1;
+ $dataValue1 = $value;
+ }
+ $dataValue2 = array_shift($result_vector);
+ if (is_array($dataValue2)) {
+ $dataValue2 = array_shift($dataValue2);
+ }
+ $value = [$key1 => $dataValue1, $key2 => $dataValue2];
+ }
+ unset($value);
+ }
+
+ return self::VLOOKUP($lookup_value, $lookup_vector, 2);
+ }
+
+ /**
+ * FORMULATEXT.
+ *
+ * @param mixed $cellReference The cell to check
+ * @param Cell $pCell The current cell (containing this formula)
+ *
+ * @return string
+ */
+ public static function FORMULATEXT($cellReference = '', Cell $pCell = null)
+ {
+ if ($pCell === null) {
+ return Functions::REF();
+ }
+
+ preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $cellReference, $matches);
+
+ $cellReference = $matches[6] . $matches[7];
+ $worksheetName = trim($matches[3], "'");
+ $worksheet = (!empty($worksheetName))
+ ? $pCell->getWorksheet()->getParent()->getSheetByName($worksheetName)
+ : $pCell->getWorksheet();
+
+ if (!$worksheet->getCell($cellReference)->isFormula()) {
+ return Functions::NA();
+ }
+
+ return $worksheet->getCell($cellReference)->getValue();
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Calculation/MathTrig.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig.php
similarity index 51%
rename from lib/phpexcel/PHPExcel/Calculation/MathTrig.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig.php
index dae2aa1ef3b..9170196bae5 100644
--- a/lib/phpexcel/PHPExcel/Calculation/MathTrig.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/MathTrig.php
@@ -1,40 +1,11 @@
1; --$i) {
if (($value % $i) == 0) {
$factorArray = array_merge($factorArray, self::factors($value / $i));
@@ -55,21 +26,20 @@ class PHPExcel_Calculation_MathTrig
}
if (!empty($factorArray)) {
rsort($factorArray);
- return $factorArray;
- } else {
- return array((integer) $value);
- }
- }
+ return $factorArray;
+ }
+
+ return [(int) $value];
+ }
private static function romanCut($num, $n)
{
- return ($num - ($num % $n ) ) / $n;
+ return ($num - ($num % $n)) / $n;
}
-
/**
- * ATAN2
+ * ATAN2.
*
* This function calculates the arc tangent of the two variables x and y. It is similar to
* calculating the arc tangent of y ÷ x, except that the signs of both arguments are used
@@ -84,37 +54,38 @@ class PHPExcel_Calculation_MathTrig
* Excel Function:
* ATAN2(xCoordinate,yCoordinate)
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param float $xCoordinate The x-coordinate of the point.
- * @param float $yCoordinate The y-coordinate of the point.
- * @return float The inverse tangent of the specified x- and y-coordinates.
+ *
+ * @param float $xCoordinate the x-coordinate of the point
+ * @param float $yCoordinate the y-coordinate of the point
+ *
+ * @return float the inverse tangent of the specified x- and y-coordinates
*/
public static function ATAN2($xCoordinate = null, $yCoordinate = null)
{
- $xCoordinate = PHPExcel_Calculation_Functions::flattenSingleValue($xCoordinate);
- $yCoordinate = PHPExcel_Calculation_Functions::flattenSingleValue($yCoordinate);
+ $xCoordinate = Functions::flattenSingleValue($xCoordinate);
+ $yCoordinate = Functions::flattenSingleValue($yCoordinate);
$xCoordinate = ($xCoordinate !== null) ? $xCoordinate : 0.0;
$yCoordinate = ($yCoordinate !== null) ? $yCoordinate : 0.0;
if (((is_numeric($xCoordinate)) || (is_bool($xCoordinate))) &&
- ((is_numeric($yCoordinate))) || (is_bool($yCoordinate))) {
- $xCoordinate = (float) $xCoordinate;
- $yCoordinate = (float) $yCoordinate;
+ ((is_numeric($yCoordinate))) || (is_bool($yCoordinate))) {
+ $xCoordinate = (float) $xCoordinate;
+ $yCoordinate = (float) $yCoordinate;
if (($xCoordinate == 0) && ($yCoordinate == 0)) {
- return PHPExcel_Calculation_Functions::DIV0();
+ return Functions::DIV0();
}
return atan2($yCoordinate, $xCoordinate);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * CEILING
+ * CEILING.
*
* Returns number rounded up, away from zero, to the nearest multiple of significance.
* For example, if you want to avoid using pennies in your prices and your product is
@@ -124,37 +95,38 @@ class PHPExcel_Calculation_MathTrig
* Excel Function:
* CEILING(number[,significance])
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param float $number The number you want to round.
- * @param float $significance The multiple to which you want to round.
- * @return float Rounded Number
+ *
+ * @param float $number the number you want to round
+ * @param float $significance the multiple to which you want to round
+ *
+ * @return float Rounded Number
*/
public static function CEILING($number, $significance = null)
{
- $number = PHPExcel_Calculation_Functions::flattenSingleValue($number);
- $significance = PHPExcel_Calculation_Functions::flattenSingleValue($significance);
+ $number = Functions::flattenSingleValue($number);
+ $significance = Functions::flattenSingleValue($significance);
- if ((is_null($significance)) &&
- (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC)) {
+ if (($significance === null) &&
+ (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC)) {
$significance = $number / abs($number);
}
if ((is_numeric($number)) && (is_numeric($significance))) {
- if (($number == 0.0 ) || ($significance == 0.0)) {
+ if (($number == 0.0) || ($significance == 0.0)) {
return 0.0;
} elseif (self::SIGN($number) == self::SIGN($significance)) {
return ceil($number / $significance) * $significance;
- } else {
- return PHPExcel_Calculation_Functions::NaN();
}
+
+ return Functions::NAN();
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * COMBIN
+ * COMBIN.
*
* Returns the number of combinations for a given number of items. Use COMBIN to
* determine the total possible number of groups for a given number of items.
@@ -162,31 +134,33 @@ class PHPExcel_Calculation_MathTrig
* Excel Function:
* COMBIN(numObjs,numInSet)
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param int $numObjs Number of different objects
- * @param int $numInSet Number of objects in each combination
- * @return int Number of combinations
+ *
+ * @param int $numObjs Number of different objects
+ * @param int $numInSet Number of objects in each combination
+ *
+ * @return int Number of combinations
*/
public static function COMBIN($numObjs, $numInSet)
{
- $numObjs = PHPExcel_Calculation_Functions::flattenSingleValue($numObjs);
- $numInSet = PHPExcel_Calculation_Functions::flattenSingleValue($numInSet);
+ $numObjs = Functions::flattenSingleValue($numObjs);
+ $numInSet = Functions::flattenSingleValue($numInSet);
if ((is_numeric($numObjs)) && (is_numeric($numInSet))) {
if ($numObjs < $numInSet) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
} elseif ($numInSet < 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
+
return round(self::FACT($numObjs) / self::FACT($numObjs - $numInSet)) / self::FACT($numInSet);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * EVEN
+ * EVEN.
*
* Returns number rounded up to the nearest even integer.
* You can use this function for processing items that come in twos. For example,
@@ -197,16 +171,17 @@ class PHPExcel_Calculation_MathTrig
* Excel Function:
* EVEN(number)
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param float $number Number to round
- * @return int Rounded Number
+ *
+ * @param float $number Number to round
+ *
+ * @return int Rounded Number
*/
public static function EVEN($number)
{
- $number = PHPExcel_Calculation_Functions::flattenSingleValue($number);
+ $number = Functions::flattenSingleValue($number);
- if (is_null($number)) {
+ if ($number === null) {
return 0;
} elseif (is_bool($number)) {
$number = (int) $number;
@@ -214,14 +189,15 @@ class PHPExcel_Calculation_MathTrig
if (is_numeric($number)) {
$significance = 2 * self::SIGN($number);
+
return (int) self::CEILING($number, $significance);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * FACT
+ * FACT.
*
* Returns the factorial of a number.
* The factorial of a number is equal to 1*2*3*...* number.
@@ -229,23 +205,24 @@ class PHPExcel_Calculation_MathTrig
* Excel Function:
* FACT(factVal)
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param float $factVal Factorial Value
- * @return int Factorial
+ *
+ * @param float $factVal Factorial Value
+ *
+ * @return int Factorial
*/
public static function FACT($factVal)
{
- $factVal = PHPExcel_Calculation_Functions::flattenSingleValue($factVal);
+ $factVal = Functions::flattenSingleValue($factVal);
if (is_numeric($factVal)) {
if ($factVal < 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
$factLoop = floor($factVal);
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) {
if ($factVal > $factLoop) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
}
@@ -253,87 +230,95 @@ class PHPExcel_Calculation_MathTrig
while ($factLoop > 1) {
$factorial *= $factLoop--;
}
- return $factorial ;
+
+ return $factorial;
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * FACTDOUBLE
+ * FACTDOUBLE.
*
* Returns the double factorial of a number.
*
* Excel Function:
* FACTDOUBLE(factVal)
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param float $factVal Factorial Value
- * @return int Double Factorial
+ *
+ * @param float $factVal Factorial Value
+ *
+ * @return int Double Factorial
*/
public static function FACTDOUBLE($factVal)
{
- $factLoop = PHPExcel_Calculation_Functions::flattenSingleValue($factVal);
+ $factLoop = Functions::flattenSingleValue($factVal);
if (is_numeric($factLoop)) {
- $factLoop = floor($factLoop);
+ $factLoop = floor($factLoop);
if ($factVal < 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
$factorial = 1;
while ($factLoop > 1) {
$factorial *= $factLoop--;
--$factLoop;
}
- return $factorial ;
+
+ return $factorial;
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * FLOOR
+ * FLOOR.
*
* Rounds number down, toward zero, to the nearest multiple of significance.
*
* Excel Function:
* FLOOR(number[,significance])
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param float $number Number to round
- * @param float $significance Significance
- * @return float Rounded Number
+ *
+ * @param float $number Number to round
+ * @param float $significance Significance
+ *
+ * @return float Rounded Number
*/
public static function FLOOR($number, $significance = null)
{
- $number = PHPExcel_Calculation_Functions::flattenSingleValue($number);
- $significance = PHPExcel_Calculation_Functions::flattenSingleValue($significance);
+ $number = Functions::flattenSingleValue($number);
+ $significance = Functions::flattenSingleValue($significance);
- if ((is_null($significance)) &&
- (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC)) {
- $significance = $number/abs($number);
+ if (($significance === null) &&
+ (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC)) {
+ $significance = $number / abs($number);
}
if ((is_numeric($number)) && (is_numeric($significance))) {
if ($significance == 0.0) {
- return PHPExcel_Calculation_Functions::DIV0();
+ return Functions::DIV0();
} elseif ($number == 0.0) {
return 0.0;
} elseif (self::SIGN($number) == self::SIGN($significance)) {
return floor($number / $significance) * $significance;
- } else {
- return PHPExcel_Calculation_Functions::NaN();
}
+
+ return Functions::NAN();
}
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
+ private static function evaluateGCD($a, $b)
+ {
+ return $b ? self::evaluateGCD($b, $a % $b) : $a;
+ }
/**
- * GCD
+ * GCD.
*
* Returns the greatest common divisor of a series of numbers.
* The greatest common divisor is the largest integer that divides both
@@ -342,91 +327,51 @@ class PHPExcel_Calculation_MathTrig
* Excel Function:
* GCD(number1[,number2[, ...]])
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param mixed $arg,... Data values
- * @return integer Greatest Common Divisor
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return int Greatest Common Divisor
*/
- public static function GCD()
+ public static function GCD(...$args)
{
- $returnValue = 1;
- $allValuesFactors = array();
+ $args = Functions::flattenArray($args);
// Loop through arguments
- foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $value) {
+ foreach (Functions::flattenArray($args) as $value) {
if (!is_numeric($value)) {
- return PHPExcel_Calculation_Functions::VALUE();
- } elseif ($value == 0) {
- continue;
+ return Functions::VALUE();
} elseif ($value < 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- $myFactors = self::factors($value);
- $myCountedFactors = array_count_values($myFactors);
- $allValuesFactors[] = $myCountedFactors;
- }
- $allValuesCount = count($allValuesFactors);
- if ($allValuesCount == 0) {
- return 0;
}
- $mergedArray = $allValuesFactors[0];
- for ($i=1; $i < $allValuesCount; ++$i) {
- $mergedArray = array_intersect_key($mergedArray, $allValuesFactors[$i]);
- }
- $mergedArrayValues = count($mergedArray);
- if ($mergedArrayValues == 0) {
- return $returnValue;
- } elseif ($mergedArrayValues > 1) {
- foreach ($mergedArray as $mergedKey => $mergedValue) {
- foreach ($allValuesFactors as $highestPowerTest) {
- foreach ($highestPowerTest as $testKey => $testValue) {
- if (($testKey == $mergedKey) && ($testValue < $mergedValue)) {
- $mergedArray[$mergedKey] = $testValue;
- $mergedValue = $testValue;
- }
- }
- }
- }
+ $gcd = (int) array_pop($args);
+ do {
+ $gcd = self::evaluateGCD($gcd, (int) array_pop($args));
+ } while (!empty($args));
- $returnValue = 1;
- foreach ($mergedArray as $key => $value) {
- $returnValue *= pow($key, $value);
- }
- return $returnValue;
- } else {
- $keys = array_keys($mergedArray);
- $key = $keys[0];
- $value = $mergedArray[$key];
- foreach ($allValuesFactors as $testValue) {
- foreach ($testValue as $mergedKey => $mergedValue) {
- if (($mergedKey == $key) && ($mergedValue < $value)) {
- $value = $mergedValue;
- }
- }
- }
- return pow($key, $value);
- }
+ return $gcd;
}
-
/**
- * INT
+ * INT.
*
* Casts a floating point value to an integer
*
* Excel Function:
* INT(number)
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param float $number Number to cast to an integer
- * @return integer Integer value
+ *
+ * @param float $number Number to cast to an integer
+ *
+ * @return int Integer value
*/
public static function INT($number)
{
- $number = PHPExcel_Calculation_Functions::flattenSingleValue($number);
+ $number = Functions::flattenSingleValue($number);
- if (is_null($number)) {
+ if ($number === null) {
return 0;
} elseif (is_bool($number)) {
return (int) $number;
@@ -434,12 +379,12 @@ class PHPExcel_Calculation_MathTrig
if (is_numeric($number)) {
return (int) floor($number);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * LCM
+ * LCM.
*
* Returns the lowest common multiplier of a series of numbers
* The least common multiple is the smallest positive integer that is a multiple
@@ -449,33 +394,34 @@ class PHPExcel_Calculation_MathTrig
* Excel Function:
* LCM(number1[,number2[, ...]])
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param mixed $arg,... Data values
- * @return int Lowest Common Multiplier
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return int Lowest Common Multiplier
*/
- public static function LCM()
+ public static function LCM(...$args)
{
$returnValue = 1;
- $allPoweredFactors = array();
+ $allPoweredFactors = [];
// Loop through arguments
- foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $value) {
+ foreach (Functions::flattenArray($args) as $value) {
if (!is_numeric($value)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
if ($value == 0) {
return 0;
} elseif ($value < 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
$myFactors = self::factors(floor($value));
$myCountedFactors = array_count_values($myFactors);
- $myPoweredFactors = array();
+ $myPoweredFactors = [];
foreach ($myCountedFactors as $myCountedFactor => $myCountedPower) {
$myPoweredFactors[$myCountedFactor] = pow($myCountedFactor, $myCountedPower);
}
foreach ($myPoweredFactors as $myPoweredValue => $myPoweredFactor) {
- if (array_key_exists($myPoweredValue, $allPoweredFactors)) {
+ if (isset($allPoweredFactors[$myPoweredValue])) {
if ($allPoweredFactors[$myPoweredValue] < $myPoweredFactor) {
$allPoweredFactors[$myPoweredValue] = $myPoweredFactor;
}
@@ -485,72 +431,74 @@ class PHPExcel_Calculation_MathTrig
}
}
foreach ($allPoweredFactors as $allPoweredFactor) {
- $returnValue *= (integer) $allPoweredFactor;
+ $returnValue *= (int) $allPoweredFactor;
}
+
return $returnValue;
}
-
/**
- * LOG_BASE
+ * LOG_BASE.
*
* Returns the logarithm of a number to a specified base. The default base is 10.
*
* Excel Function:
* LOG(number[,base])
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param float $number The positive real number for which you want the logarithm
- * @param float $base The base of the logarithm. If base is omitted, it is assumed to be 10.
- * @return float
+ *
+ * @param float $number The positive real number for which you want the logarithm
+ * @param float $base The base of the logarithm. If base is omitted, it is assumed to be 10.
+ *
+ * @return float
*/
- public static function LOG_BASE($number = null, $base = 10)
+ public static function logBase($number = null, $base = 10)
{
- $number = PHPExcel_Calculation_Functions::flattenSingleValue($number);
- $base = (is_null($base)) ? 10 : (float) PHPExcel_Calculation_Functions::flattenSingleValue($base);
+ $number = Functions::flattenSingleValue($number);
+ $base = ($base === null) ? 10 : (float) Functions::flattenSingleValue($base);
if ((!is_numeric($base)) || (!is_numeric($number))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
if (($base <= 0) || ($number <= 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
+
return log($number, $base);
}
-
/**
- * MDETERM
+ * MDETERM.
*
* Returns the matrix determinant of an array.
*
* Excel Function:
* MDETERM(array)
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param array $matrixValues A matrix of values
- * @return float
+ *
+ * @param array $matrixValues A matrix of values
+ *
+ * @return float
*/
public static function MDETERM($matrixValues)
{
- $matrixData = array();
+ $matrixData = [];
if (!is_array($matrixValues)) {
- $matrixValues = array(array($matrixValues));
+ $matrixValues = [[$matrixValues]];
}
$row = $maxColumn = 0;
foreach ($matrixValues as $matrixRow) {
if (!is_array($matrixRow)) {
- $matrixRow = array($matrixRow);
+ $matrixRow = [$matrixRow];
}
$column = 0;
foreach ($matrixRow as $matrixCell) {
if ((is_string($matrixCell)) || ($matrixCell === null)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
- $matrixData[$column][$row] = $matrixCell;
+ $matrixData[$row][$column] = $matrixCell;
++$column;
}
if ($column > $maxColumn) {
@@ -558,50 +506,51 @@ class PHPExcel_Calculation_MathTrig
}
++$row;
}
- if ($row != $maxColumn) {
- return PHPExcel_Calculation_Functions::VALUE();
+
+ $matrix = new Matrix($matrixData);
+ if (!$matrix->isSquare()) {
+ return Functions::VALUE();
}
try {
- $matrix = new PHPExcel_Shared_JAMA_Matrix($matrixData);
- return $matrix->det();
- } catch (PHPExcel_Exception $ex) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return $matrix->determinant();
+ } catch (MatrixException $ex) {
+ return Functions::VALUE();
}
}
-
/**
- * MINVERSE
+ * MINVERSE.
*
* Returns the inverse matrix for the matrix stored in an array.
*
* Excel Function:
* MINVERSE(array)
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param array $matrixValues A matrix of values
- * @return array
+ *
+ * @param array $matrixValues A matrix of values
+ *
+ * @return array
*/
public static function MINVERSE($matrixValues)
{
- $matrixData = array();
+ $matrixData = [];
if (!is_array($matrixValues)) {
- $matrixValues = array(array($matrixValues));
+ $matrixValues = [[$matrixValues]];
}
$row = $maxColumn = 0;
foreach ($matrixValues as $matrixRow) {
if (!is_array($matrixRow)) {
- $matrixRow = array($matrixRow);
+ $matrixRow = [$matrixRow];
}
$column = 0;
foreach ($matrixRow as $matrixCell) {
if ((is_string($matrixCell)) || ($matrixCell === null)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
- $matrixData[$column][$row] = $matrixCell;
+ $matrixData[$row][$column] = $matrixCell;
++$column;
}
if ($column > $maxColumn) {
@@ -609,96 +558,100 @@ class PHPExcel_Calculation_MathTrig
}
++$row;
}
- if ($row != $maxColumn) {
- return PHPExcel_Calculation_Functions::VALUE();
+
+ $matrix = new Matrix($matrixData);
+ if (!$matrix->isSquare()) {
+ return Functions::VALUE();
+ }
+
+ if ($matrix->determinant() == 0.0) {
+ return Functions::NAN();
}
try {
- $matrix = new PHPExcel_Shared_JAMA_Matrix($matrixData);
- return $matrix->inverse()->getArray();
- } catch (PHPExcel_Exception $ex) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return $matrix->inverse()->toArray();
+ } catch (MatrixException $ex) {
+ return Functions::VALUE();
}
}
-
/**
- * MMULT
+ * MMULT.
*
- * @param array $matrixData1 A matrix of values
- * @param array $matrixData2 A matrix of values
- * @return array
+ * @param array $matrixData1 A matrix of values
+ * @param array $matrixData2 A matrix of values
+ *
+ * @return array
*/
public static function MMULT($matrixData1, $matrixData2)
{
- $matrixAData = $matrixBData = array();
+ $matrixAData = $matrixBData = [];
if (!is_array($matrixData1)) {
- $matrixData1 = array(array($matrixData1));
+ $matrixData1 = [[$matrixData1]];
}
if (!is_array($matrixData2)) {
- $matrixData2 = array(array($matrixData2));
+ $matrixData2 = [[$matrixData2]];
}
try {
$rowA = 0;
foreach ($matrixData1 as $matrixRow) {
if (!is_array($matrixRow)) {
- $matrixRow = array($matrixRow);
+ $matrixRow = [$matrixRow];
}
$columnA = 0;
foreach ($matrixRow as $matrixCell) {
if ((!is_numeric($matrixCell)) || ($matrixCell === null)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$matrixAData[$rowA][$columnA] = $matrixCell;
++$columnA;
}
++$rowA;
}
- $matrixA = new PHPExcel_Shared_JAMA_Matrix($matrixAData);
+ $matrixA = new Matrix($matrixAData);
$rowB = 0;
foreach ($matrixData2 as $matrixRow) {
if (!is_array($matrixRow)) {
- $matrixRow = array($matrixRow);
+ $matrixRow = [$matrixRow];
}
$columnB = 0;
foreach ($matrixRow as $matrixCell) {
if ((!is_numeric($matrixCell)) || ($matrixCell === null)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$matrixBData[$rowB][$columnB] = $matrixCell;
++$columnB;
}
++$rowB;
}
- $matrixB = new PHPExcel_Shared_JAMA_Matrix($matrixBData);
+ $matrixB = new Matrix($matrixBData);
if ($columnA != $rowB) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
- return $matrixA->times($matrixB)->getArray();
- } catch (PHPExcel_Exception $ex) {
- var_dump($ex->getMessage());
- return PHPExcel_Calculation_Functions::VALUE();
+ return $matrixA->multiply($matrixB)->toArray();
+ } catch (MatrixException $ex) {
+ return Functions::VALUE();
}
}
-
/**
- * MOD
+ * MOD.
*
- * @param int $a Dividend
- * @param int $b Divisor
- * @return int Remainder
+ * @param int $a Dividend
+ * @param int $b Divisor
+ *
+ * @return int Remainder
*/
public static function MOD($a = 1, $b = 1)
{
- $a = PHPExcel_Calculation_Functions::flattenSingleValue($a);
- $b = PHPExcel_Calculation_Functions::flattenSingleValue($b);
+ $a = (float) Functions::flattenSingleValue($a);
+ $b = (float) Functions::flattenSingleValue($b);
if ($b == 0.0) {
- return PHPExcel_Calculation_Functions::DIV0();
+ return Functions::DIV0();
} elseif (($a < 0.0) && ($b > 0.0)) {
return $b - fmod(abs($a), $b);
} elseif (($a > 0.0) && ($b < 0.0)) {
@@ -708,20 +661,20 @@ class PHPExcel_Calculation_MathTrig
return fmod($a, $b);
}
-
/**
- * MROUND
+ * MROUND.
*
* Rounds a number to the nearest multiple of a specified value
*
- * @param float $number Number to round
- * @param int $multiple Multiple to which you want to round $number
- * @return float Rounded Number
+ * @param float $number Number to round
+ * @param int $multiple Multiple to which you want to round $number
+ *
+ * @return float Rounded Number
*/
public static function MROUND($number, $multiple)
{
- $number = PHPExcel_Calculation_Functions::flattenSingleValue($number);
- $multiple = PHPExcel_Calculation_Functions::flattenSingleValue($multiple);
+ $number = Functions::flattenSingleValue($number);
+ $multiple = Functions::flattenSingleValue($multiple);
if ((is_numeric($number)) && (is_numeric($multiple))) {
if ($multiple == 0) {
@@ -729,62 +682,67 @@ class PHPExcel_Calculation_MathTrig
}
if ((self::SIGN($number)) == (self::SIGN($multiple))) {
$multiplier = 1 / $multiple;
+
return round($number * $multiplier) / $multiplier;
}
- return PHPExcel_Calculation_Functions::NaN();
+
+ return Functions::NAN();
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * MULTINOMIAL
+ * MULTINOMIAL.
*
* Returns the ratio of the factorial of a sum of values to the product of factorials.
*
- * @param array of mixed Data Series
- * @return float
+ * @param array of mixed Data Series
+ *
+ * @return float
*/
- public static function MULTINOMIAL()
+ public static function MULTINOMIAL(...$args)
{
$summer = 0;
$divisor = 1;
// Loop through arguments
- foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) {
+ foreach (Functions::flattenArray($args) as $arg) {
// Is it a numeric value?
if (is_numeric($arg)) {
if ($arg < 1) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
$summer += floor($arg);
$divisor *= self::FACT($arg);
} else {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
}
// Return
if ($summer > 0) {
$summer = self::FACT($summer);
+
return $summer / $divisor;
}
+
return 0;
}
-
/**
- * ODD
+ * ODD.
*
* Returns number rounded up to the nearest odd integer.
*
- * @param float $number Number to round
- * @return int Rounded Number
+ * @param float $number Number to round
+ *
+ * @return int Rounded Number
*/
public static function ODD($number)
{
- $number = PHPExcel_Calculation_Functions::flattenSingleValue($number);
+ $number = Functions::flattenSingleValue($number);
- if (is_null($number)) {
+ if ($number === null) {
return 1;
} elseif (is_bool($number)) {
return 1;
@@ -801,60 +759,62 @@ class PHPExcel_Calculation_MathTrig
return (int) $result;
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * POWER
+ * POWER.
*
* Computes x raised to the power y.
*
- * @param float $x
- * @param float $y
- * @return float
+ * @param float $x
+ * @param float $y
+ *
+ * @return float
*/
public static function POWER($x = 0, $y = 2)
{
- $x = PHPExcel_Calculation_Functions::flattenSingleValue($x);
- $y = PHPExcel_Calculation_Functions::flattenSingleValue($y);
+ $x = Functions::flattenSingleValue($x);
+ $y = Functions::flattenSingleValue($y);
// Validate parameters
if ($x == 0.0 && $y == 0.0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
} elseif ($x == 0.0 && $y < 0.0) {
- return PHPExcel_Calculation_Functions::DIV0();
+ return Functions::DIV0();
}
// Return
$result = pow($x, $y);
- return (!is_nan($result) && !is_infinite($result)) ? $result : PHPExcel_Calculation_Functions::NaN();
+
+ return (!is_nan($result) && !is_infinite($result)) ? $result : Functions::NAN();
}
-
/**
- * PRODUCT
+ * PRODUCT.
*
* PRODUCT returns the product of all the values and cells referenced in the argument list.
*
* Excel Function:
* PRODUCT(value1[,value2[, ...]])
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function PRODUCT()
+ public static function PRODUCT(...$args)
{
// Return value
$returnValue = null;
// Loop through arguments
- foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) {
+ foreach (Functions::flattenArray($args) as $arg) {
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
- if (is_null($returnValue)) {
+ if ($returnValue === null) {
$returnValue = $arg;
} else {
$returnValue *= $arg;
@@ -863,15 +823,15 @@ class PHPExcel_Calculation_MathTrig
}
// Return
- if (is_null($returnValue)) {
+ if ($returnValue === null) {
return 0;
}
+
return $returnValue;
}
-
/**
- * QUOTIENT
+ * QUOTIENT.
*
* QUOTIENT function returns the integer portion of a division. Numerator is the divided number
* and denominator is the divisor.
@@ -879,21 +839,22 @@ class PHPExcel_Calculation_MathTrig
* Excel Function:
* QUOTIENT(value1[,value2[, ...]])
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function QUOTIENT()
+ public static function QUOTIENT(...$args)
{
// Return value
$returnValue = null;
// Loop through arguments
- foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) {
+ foreach (Functions::flattenArray($args) as $arg) {
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
- if (is_null($returnValue)) {
+ if ($returnValue === null) {
$returnValue = ($arg == 0) ? 0 : $arg;
} else {
if (($returnValue == 0) || ($arg == 0)) {
@@ -906,46 +867,45 @@ class PHPExcel_Calculation_MathTrig
}
// Return
- return intval($returnValue);
+ return (int) $returnValue;
}
-
/**
- * RAND
+ * RAND.
*
- * @param int $min Minimal value
- * @param int $max Maximal value
- * @return int Random number
+ * @param int $min Minimal value
+ * @param int $max Maximal value
+ *
+ * @return int Random number
*/
public static function RAND($min = 0, $max = 0)
{
- $min = PHPExcel_Calculation_Functions::flattenSingleValue($min);
- $max = PHPExcel_Calculation_Functions::flattenSingleValue($max);
+ $min = Functions::flattenSingleValue($min);
+ $max = Functions::flattenSingleValue($max);
if ($min == 0 && $max == 0) {
return (mt_rand(0, 10000000)) / 10000000;
- } else {
- return mt_rand($min, $max);
}
- }
+ return mt_rand($min, $max);
+ }
public static function ROMAN($aValue, $style = 0)
{
- $aValue = PHPExcel_Calculation_Functions::flattenSingleValue($aValue);
- $style = (is_null($style)) ? 0 : (integer) PHPExcel_Calculation_Functions::flattenSingleValue($style);
+ $aValue = Functions::flattenSingleValue($aValue);
+ $style = ($style === null) ? 0 : (int) Functions::flattenSingleValue($style);
if ((!is_numeric($aValue)) || ($aValue < 0) || ($aValue >= 4000)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
- $aValue = (integer) $aValue;
+ $aValue = (int) $aValue;
if ($aValue == 0) {
return '';
}
- $mill = array('', 'M', 'MM', 'MMM', 'MMMM', 'MMMMM');
- $cent = array('', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM');
- $tens = array('', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC');
- $ones = array('', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX');
+ $mill = ['', 'M', 'MM', 'MMM', 'MMMM', 'MMMMM'];
+ $cent = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM'];
+ $tens = ['', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC'];
+ $ones = ['', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX'];
$roman = '';
while ($aValue > 5999) {
@@ -959,79 +919,81 @@ class PHPExcel_Calculation_MathTrig
$t = self::romanCut($aValue, 10);
$aValue %= 10;
- return $roman.$mill[$m].$cent[$c].$tens[$t].$ones[$aValue];
+ return $roman . $mill[$m] . $cent[$c] . $tens[$t] . $ones[$aValue];
}
-
/**
- * ROUNDUP
+ * ROUNDUP.
*
* Rounds a number up to a specified number of decimal places
*
- * @param float $number Number to round
- * @param int $digits Number of digits to which you want to round $number
- * @return float Rounded Number
+ * @param float $number Number to round
+ * @param int $digits Number of digits to which you want to round $number
+ *
+ * @return float Rounded Number
*/
public static function ROUNDUP($number, $digits)
{
- $number = PHPExcel_Calculation_Functions::flattenSingleValue($number);
- $digits = PHPExcel_Calculation_Functions::flattenSingleValue($digits);
+ $number = Functions::flattenSingleValue($number);
+ $digits = Functions::flattenSingleValue($digits);
if ((is_numeric($number)) && (is_numeric($digits))) {
$significance = pow(10, (int) $digits);
if ($number < 0.0) {
return floor($number * $significance) / $significance;
- } else {
- return ceil($number * $significance) / $significance;
}
+
+ return ceil($number * $significance) / $significance;
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * ROUNDDOWN
+ * ROUNDDOWN.
*
* Rounds a number down to a specified number of decimal places
*
- * @param float $number Number to round
- * @param int $digits Number of digits to which you want to round $number
- * @return float Rounded Number
+ * @param float $number Number to round
+ * @param int $digits Number of digits to which you want to round $number
+ *
+ * @return float Rounded Number
*/
public static function ROUNDDOWN($number, $digits)
{
- $number = PHPExcel_Calculation_Functions::flattenSingleValue($number);
- $digits = PHPExcel_Calculation_Functions::flattenSingleValue($digits);
+ $number = Functions::flattenSingleValue($number);
+ $digits = Functions::flattenSingleValue($digits);
if ((is_numeric($number)) && (is_numeric($digits))) {
$significance = pow(10, (int) $digits);
if ($number < 0.0) {
return ceil($number * $significance) / $significance;
- } else {
- return floor($number * $significance) / $significance;
}
+
+ return floor($number * $significance) / $significance;
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * SERIESSUM
+ * SERIESSUM.
*
* Returns the sum of a power series
*
- * @param float $x Input value to the power series
- * @param float $n Initial power to which you want to raise $x
- * @param float $m Step by which to increase $n for each term in the series
- * @param array of mixed Data Series
- * @return float
+ * @param float $x Input value to the power series
+ * @param float $n Initial power to which you want to raise $x
+ * @param float $m Step by which to increase $n for each term in the series
+ * @param array of mixed Data Series
+ *
+ * @return float
*/
- public static function SERIESSUM()
+ public static function SERIESSUM(...$args)
{
$returnValue = 0;
// Loop through arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
$x = array_shift($aArgs);
$n = array_shift($aArgs);
@@ -1045,27 +1007,29 @@ class PHPExcel_Calculation_MathTrig
if ((is_numeric($arg)) && (!is_string($arg))) {
$returnValue += $arg * pow($x, $n + ($m * $i++));
} else {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
}
+
return $returnValue;
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * SIGN
+ * SIGN.
*
* Determines the sign of a number. Returns 1 if the number is positive, zero (0)
* if the number is 0, and -1 if the number is negative.
*
- * @param float $number Number to round
- * @return int sign value
+ * @param float $number Number to round
+ *
+ * @return int sign value
*/
public static function SIGN($number)
{
- $number = PHPExcel_Calculation_Functions::flattenSingleValue($number);
+ $number = Functions::flattenSingleValue($number);
if (is_bool($number)) {
return (int) $number;
@@ -1074,100 +1038,149 @@ class PHPExcel_Calculation_MathTrig
if ($number == 0.0) {
return 0;
}
+
return $number / abs($number);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * SQRTPI
+ * SQRTPI.
*
* Returns the square root of (number * pi).
*
- * @param float $number Number
- * @return float Square Root of Number * Pi
+ * @param float $number Number
+ *
+ * @return float Square Root of Number * Pi
*/
public static function SQRTPI($number)
{
- $number = PHPExcel_Calculation_Functions::flattenSingleValue($number);
+ $number = Functions::flattenSingleValue($number);
if (is_numeric($number)) {
if ($number < 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- return sqrt($number * M_PI) ;
+
+ return sqrt($number * M_PI);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
+ protected static function filterHiddenArgs($cellReference, $args)
+ {
+ return array_filter(
+ $args,
+ function ($index) use ($cellReference) {
+ list(, $row, $column) = explode('.', $index);
+
+ return $cellReference->getWorksheet()->getRowDimension($row)->getVisible() &&
+ $cellReference->getWorksheet()->getColumnDimension($column)->getVisible();
+ },
+ ARRAY_FILTER_USE_KEY
+ );
+ }
+
+ protected static function filterFormulaArgs($cellReference, $args)
+ {
+ return array_filter(
+ $args,
+ function ($index) use ($cellReference) {
+ list(, $row, $column) = explode('.', $index);
+ if ($cellReference->getWorksheet()->cellExists($column . $row)) {
+ //take this cell out if it contains the SUBTOTAL or AGGREGATE functions in a formula
+ $isFormula = $cellReference->getWorksheet()->getCell($column . $row)->isFormula();
+ $cellFormula = !preg_match('/^=.*\b(SUBTOTAL|AGGREGATE)\s*\(/i', $cellReference->getWorksheet()->getCell($column . $row)->getValue());
+
+ return !$isFormula || $cellFormula;
+ }
+
+ return true;
+ },
+ ARRAY_FILTER_USE_KEY
+ );
+ }
/**
- * SUBTOTAL
+ * SUBTOTAL.
*
* Returns a subtotal in a list or database.
*
- * @param int the number 1 to 11 that specifies which function to
- * use in calculating subtotals within a list.
- * @param array of mixed Data Series
- * @return float
+ * @param int the number 1 to 11 that specifies which function to
+ * use in calculating subtotals within a range
+ * list
+ * Numbers 101 to 111 shadow the functions of 1 to 11
+ * but ignore any values in the range that are
+ * in hidden rows or columns
+ * @param array of mixed Data Series
+ *
+ * @return float
*/
- public static function SUBTOTAL()
+ public static function SUBTOTAL(...$args)
{
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
-
- // Calculate
+ $cellReference = array_pop($args);
+ $aArgs = Functions::flattenArrayIndexed($args);
$subtotal = array_shift($aArgs);
+ // Calculate
if ((is_numeric($subtotal)) && (!is_string($subtotal))) {
+ if ($subtotal > 100) {
+ $aArgs = self::filterHiddenArgs($cellReference, $aArgs);
+ $subtotal -= 100;
+ }
+
+ $aArgs = self::filterFormulaArgs($cellReference, $aArgs);
switch ($subtotal) {
case 1:
- return PHPExcel_Calculation_Statistical::AVERAGE($aArgs);
+ return Statistical::AVERAGE($aArgs);
case 2:
- return PHPExcel_Calculation_Statistical::COUNT($aArgs);
+ return Statistical::COUNT($aArgs);
case 3:
- return PHPExcel_Calculation_Statistical::COUNTA($aArgs);
+ return Statistical::COUNTA($aArgs);
case 4:
- return PHPExcel_Calculation_Statistical::MAX($aArgs);
+ return Statistical::MAX($aArgs);
case 5:
- return PHPExcel_Calculation_Statistical::MIN($aArgs);
+ return Statistical::MIN($aArgs);
case 6:
return self::PRODUCT($aArgs);
case 7:
- return PHPExcel_Calculation_Statistical::STDEV($aArgs);
+ return Statistical::STDEV($aArgs);
case 8:
- return PHPExcel_Calculation_Statistical::STDEVP($aArgs);
+ return Statistical::STDEVP($aArgs);
case 9:
return self::SUM($aArgs);
case 10:
- return PHPExcel_Calculation_Statistical::VARFunc($aArgs);
+ return Statistical::VARFunc($aArgs);
case 11:
- return PHPExcel_Calculation_Statistical::VARP($aArgs);
+ return Statistical::VARP($aArgs);
}
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * SUM
+ * SUM.
*
* SUM computes the sum of all the values and cells referenced in the argument list.
*
* Excel Function:
* SUM(value1[,value2[, ...]])
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function SUM()
+ public static function SUM(...$args)
{
$returnValue = 0;
// Loop through the arguments
- foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) {
+ foreach (Functions::flattenArray($args) as $arg) {
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
$returnValue += $arg;
@@ -1177,41 +1190,44 @@ class PHPExcel_Calculation_MathTrig
return $returnValue;
}
-
/**
- * SUMIF
+ * SUMIF.
*
* Counts the number of cells that contain numbers within the list of arguments
*
* Excel Function:
* SUMIF(value1[,value2[, ...]],condition)
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param mixed $arg,... Data values
- * @param string $condition The criteria that defines which cells will be summed.
- * @return float
+ *
+ * @param mixed $aArgs Data values
+ * @param string $condition the criteria that defines which cells will be summed
+ * @param mixed $sumArgs
+ *
+ * @return float
*/
- public static function SUMIF($aArgs, $condition, $sumArgs = array())
+ public static function SUMIF($aArgs, $condition, $sumArgs = [])
{
$returnValue = 0;
- $aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs);
- $sumArgs = PHPExcel_Calculation_Functions::flattenArray($sumArgs);
+ $aArgs = Functions::flattenArray($aArgs);
+ $sumArgs = Functions::flattenArray($sumArgs);
if (empty($sumArgs)) {
$sumArgs = $aArgs;
}
- $condition = PHPExcel_Calculation_Functions::ifCondition($condition);
+ $condition = Functions::ifCondition($condition);
// Loop through arguments
foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) {
$arg = str_replace('"', '""', $arg);
- $arg = PHPExcel_Calculation::wrapResult(strtoupper($arg));
+ $arg = Calculation::wrapResult(strtoupper($arg));
}
- $testCondition = '='.$arg.$condition;
- if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
- // Is it a value within our criteria
+ $testCondition = '=' . $arg . $condition;
+
+ if (is_numeric($sumArgs[$key]) &&
+ Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
+ // Is it a value within our criteria and only numeric can be added to the result
$returnValue += $sumArgs[$key];
}
}
@@ -1219,36 +1235,96 @@ class PHPExcel_Calculation_MathTrig
return $returnValue;
}
+ /**
+ * SUMIFS.
+ *
+ * Counts the number of cells that contain numbers within the list of arguments
+ *
+ * Excel Function:
+ * SUMIFS(value1[,value2[, ...]],condition)
+ *
+ * @category Mathematical and Trigonometric Functions
+ *
+ * @param mixed $args Data values
+ * @param string $condition the criteria that defines which cells will be summed
+ *
+ * @return float
+ */
+ public static function SUMIFS(...$args)
+ {
+ $arrayList = $args;
+
+ // Return value
+ $returnValue = 0;
+
+ $sumArgs = Functions::flattenArray(array_shift($arrayList));
+ $aArgsArray = [];
+ $conditions = [];
+
+ while (count($arrayList) > 0) {
+ $aArgsArray[] = Functions::flattenArray(array_shift($arrayList));
+ $conditions[] = Functions::ifCondition(array_shift($arrayList));
+ }
+
+ // Loop through each sum and see if arguments and conditions are true
+ foreach ($sumArgs as $index => $value) {
+ $valid = true;
+
+ foreach ($conditions as $cidx => $condition) {
+ $arg = $aArgsArray[$cidx][$index];
+
+ // Loop through arguments
+ if (!is_numeric($arg)) {
+ $arg = Calculation::wrapResult(strtoupper($arg));
+ }
+ $testCondition = '=' . $arg . $condition;
+ if (!Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
+ // Is not a value within our criteria
+ $valid = false;
+
+ break; // if false found, don't need to check other conditions
+ }
+ }
+
+ if ($valid) {
+ $returnValue += $value;
+ }
+ }
+
+ // Return
+ return $returnValue;
+ }
/**
- * SUMPRODUCT
+ * SUMPRODUCT.
*
* Excel Function:
* SUMPRODUCT(value1[,value2[, ...]])
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function SUMPRODUCT()
+ public static function SUMPRODUCT(...$args)
{
- $arrayList = func_get_args();
+ $arrayList = $args;
- $wrkArray = PHPExcel_Calculation_Functions::flattenArray(array_shift($arrayList));
+ $wrkArray = Functions::flattenArray(array_shift($arrayList));
$wrkCellCount = count($wrkArray);
- for ($i=0; $i< $wrkCellCount; ++$i) {
+ for ($i = 0; $i < $wrkCellCount; ++$i) {
if ((!is_numeric($wrkArray[$i])) || (is_string($wrkArray[$i]))) {
$wrkArray[$i] = 0;
}
}
foreach ($arrayList as $matrixData) {
- $array2 = PHPExcel_Calculation_Functions::flattenArray($matrixData);
+ $array2 = Functions::flattenArray($matrixData);
$count = count($array2);
if ($wrkCellCount != $count) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
foreach ($array2 as $i => $val) {
@@ -1262,26 +1338,26 @@ class PHPExcel_Calculation_MathTrig
return array_sum($wrkArray);
}
-
/**
- * SUMSQ
+ * SUMSQ.
*
* SUMSQ returns the sum of the squares of the arguments
*
* Excel Function:
* SUMSQ(value1[,value2[, ...]])
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function SUMSQ()
+ public static function SUMSQ(...$args)
{
$returnValue = 0;
// Loop through arguments
- foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) {
+ foreach (Functions::flattenArray($args) as $arg) {
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
$returnValue += ($arg * $arg);
@@ -1291,18 +1367,18 @@ class PHPExcel_Calculation_MathTrig
return $returnValue;
}
-
/**
- * SUMX2MY2
+ * SUMX2MY2.
*
- * @param mixed[] $matrixData1 Matrix #1
- * @param mixed[] $matrixData2 Matrix #2
- * @return float
+ * @param mixed[] $matrixData1 Matrix #1
+ * @param mixed[] $matrixData2 Matrix #2
+ *
+ * @return float
*/
public static function SUMX2MY2($matrixData1, $matrixData2)
{
- $array1 = PHPExcel_Calculation_Functions::flattenArray($matrixData1);
- $array2 = PHPExcel_Calculation_Functions::flattenArray($matrixData2);
+ $array1 = Functions::flattenArray($matrixData1);
+ $array2 = Functions::flattenArray($matrixData2);
$count = min(count($array1), count($array2));
$result = 0;
@@ -1316,18 +1392,18 @@ class PHPExcel_Calculation_MathTrig
return $result;
}
-
/**
- * SUMX2PY2
+ * SUMX2PY2.
*
- * @param mixed[] $matrixData1 Matrix #1
- * @param mixed[] $matrixData2 Matrix #2
- * @return float
+ * @param mixed[] $matrixData1 Matrix #1
+ * @param mixed[] $matrixData2 Matrix #2
+ *
+ * @return float
*/
public static function SUMX2PY2($matrixData1, $matrixData2)
{
- $array1 = PHPExcel_Calculation_Functions::flattenArray($matrixData1);
- $array2 = PHPExcel_Calculation_Functions::flattenArray($matrixData2);
+ $array1 = Functions::flattenArray($matrixData1);
+ $array2 = Functions::flattenArray($matrixData2);
$count = min(count($array1), count($array2));
$result = 0;
@@ -1341,18 +1417,18 @@ class PHPExcel_Calculation_MathTrig
return $result;
}
-
/**
- * SUMXMY2
+ * SUMXMY2.
*
- * @param mixed[] $matrixData1 Matrix #1
- * @param mixed[] $matrixData2 Matrix #2
- * @return float
+ * @param mixed[] $matrixData1 Matrix #1
+ * @param mixed[] $matrixData2 Matrix #2
+ *
+ * @return float
*/
public static function SUMXMY2($matrixData1, $matrixData2)
{
- $array1 = PHPExcel_Calculation_Functions::flattenArray($matrixData1);
- $array2 = PHPExcel_Calculation_Functions::flattenArray($matrixData2);
+ $array1 = Functions::flattenArray($matrixData1);
+ $array2 = Functions::flattenArray($matrixData2);
$count = min(count($array1), count($array2));
$result = 0;
@@ -1366,34 +1442,208 @@ class PHPExcel_Calculation_MathTrig
return $result;
}
-
/**
- * TRUNC
+ * TRUNC.
*
* Truncates value to the number of fractional digits by number_digits.
*
- * @param float $value
- * @param int $digits
- * @return float Truncated value
+ * @param float $value
+ * @param int $digits
+ *
+ * @return float Truncated value
*/
public static function TRUNC($value = 0, $digits = 0)
{
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $digits = PHPExcel_Calculation_Functions::flattenSingleValue($digits);
+ $value = Functions::flattenSingleValue($value);
+ $digits = Functions::flattenSingleValue($digits);
// Validate parameters
if ((!is_numeric($value)) || (!is_numeric($digits))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$digits = floor($digits);
// Truncate
$adjust = pow(10, $digits);
- if (($digits > 0) && (rtrim(intval((abs($value) - abs(intval($value))) * $adjust), '0') < $adjust/10)) {
+ if (($digits > 0) && (rtrim((int) ((abs($value) - abs((int) $value)) * $adjust), '0') < $adjust / 10)) {
return $value;
}
- return (intval($value * $adjust)) / $adjust;
+ return ((int) ($value * $adjust)) / $adjust;
+ }
+
+ /**
+ * SEC.
+ *
+ * Returns the secant of an angle.
+ *
+ * @param float $angle Number
+ *
+ * @return float|string The secant of the angle
+ */
+ public static function SEC($angle)
+ {
+ $angle = Functions::flattenSingleValue($angle);
+
+ if (!is_numeric($angle)) {
+ return Functions::VALUE();
+ }
+
+ $result = cos($angle);
+
+ return ($result == 0.0) ? Functions::DIV0() : 1 / $result;
+ }
+
+ /**
+ * SECH.
+ *
+ * Returns the hyperbolic secant of an angle.
+ *
+ * @param float $angle Number
+ *
+ * @return float|string The hyperbolic secant of the angle
+ */
+ public static function SECH($angle)
+ {
+ $angle = Functions::flattenSingleValue($angle);
+
+ if (!is_numeric($angle)) {
+ return Functions::VALUE();
+ }
+
+ $result = cosh($angle);
+
+ return ($result == 0.0) ? Functions::DIV0() : 1 / $result;
+ }
+
+ /**
+ * CSC.
+ *
+ * Returns the cosecant of an angle.
+ *
+ * @param float $angle Number
+ *
+ * @return float|string The cosecant of the angle
+ */
+ public static function CSC($angle)
+ {
+ $angle = Functions::flattenSingleValue($angle);
+
+ if (!is_numeric($angle)) {
+ return Functions::VALUE();
+ }
+
+ $result = sin($angle);
+
+ return ($result == 0.0) ? Functions::DIV0() : 1 / $result;
+ }
+
+ /**
+ * CSCH.
+ *
+ * Returns the hyperbolic cosecant of an angle.
+ *
+ * @param float $angle Number
+ *
+ * @return float|string The hyperbolic cosecant of the angle
+ */
+ public static function CSCH($angle)
+ {
+ $angle = Functions::flattenSingleValue($angle);
+
+ if (!is_numeric($angle)) {
+ return Functions::VALUE();
+ }
+
+ $result = sinh($angle);
+
+ return ($result == 0.0) ? Functions::DIV0() : 1 / $result;
+ }
+
+ /**
+ * COT.
+ *
+ * Returns the cotangent of an angle.
+ *
+ * @param float $angle Number
+ *
+ * @return float|string The cotangent of the angle
+ */
+ public static function COT($angle)
+ {
+ $angle = Functions::flattenSingleValue($angle);
+
+ if (!is_numeric($angle)) {
+ return Functions::VALUE();
+ }
+
+ $result = tan($angle);
+
+ return ($result == 0.0) ? Functions::DIV0() : 1 / $result;
+ }
+
+ /**
+ * COTH.
+ *
+ * Returns the hyperbolic cotangent of an angle.
+ *
+ * @param float $angle Number
+ *
+ * @return float|string The hyperbolic cotangent of the angle
+ */
+ public static function COTH($angle)
+ {
+ $angle = Functions::flattenSingleValue($angle);
+
+ if (!is_numeric($angle)) {
+ return Functions::VALUE();
+ }
+
+ $result = tanh($angle);
+
+ return ($result == 0.0) ? Functions::DIV0() : 1 / $result;
+ }
+
+ /**
+ * ACOT.
+ *
+ * Returns the arccotangent of a number.
+ *
+ * @param float $number Number
+ *
+ * @return float|string The arccotangent of the number
+ */
+ public static function ACOT($number)
+ {
+ $number = Functions::flattenSingleValue($number);
+
+ if (!is_numeric($number)) {
+ return Functions::VALUE();
+ }
+
+ return (M_PI / 2) - atan($number);
+ }
+
+ /**
+ * ACOTH.
+ *
+ * Returns the hyperbolic arccotangent of a number.
+ *
+ * @param float $number Number
+ *
+ * @return float|string The hyperbolic arccotangent of the number
+ */
+ public static function ACOTH($number)
+ {
+ $number = Functions::flattenSingleValue($number);
+
+ if (!is_numeric($number)) {
+ return Functions::VALUE();
+ }
+
+ $result = log(($number + 1) / ($number - 1)) / 2;
+
+ return is_nan($result) ? Functions::NAN() : $result;
}
}
diff --git a/lib/phpexcel/PHPExcel/Calculation/Statistical.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical.php
similarity index 57%
rename from lib/phpexcel/PHPExcel/Calculation/Statistical.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical.php
index 500f95096b5..395b46ae7ca 100644
--- a/lib/phpexcel/PHPExcel/Calculation/Statistical.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Statistical.php
@@ -1,78 +1,37 @@
$value) {
- if ((is_bool($value)) || (is_string($value)) || (is_null($value))) {
- unset($array1[$key]);
- unset($array2[$key]);
+ if ((is_bool($value)) || (is_string($value)) || ($value === null)) {
+ unset($array1[$key], $array2[$key]);
}
}
foreach ($array2 as $key => $value) {
- if ((is_bool($value)) || (is_string($value)) || (is_null($value))) {
- unset($array1[$key]);
- unset($array2[$key]);
+ if ((is_bool($value)) || (is_string($value)) || ($value === null)) {
+ unset($array1[$key], $array2[$key]);
}
}
$array1 = array_merge($array1);
@@ -81,37 +40,19 @@ class PHPExcel_Calculation_Statistical
return true;
}
-
/**
- * Beta function.
- *
- * @author Jaco van Kooten
- *
- * @param p require p>0
- * @param q require q>0
- * @return 0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow
- */
- private static function beta($p, $q)
- {
- if ($p <= 0.0 || $q <= 0.0 || ($p + $q) > LOG_GAMMA_X_MAX_VALUE) {
- return 0.0;
- } else {
- return exp(self::logBeta($p, $q));
- }
- }
-
-
- /**
- * Incomplete beta function
+ * Incomplete beta function.
*
* @author Jaco van Kooten
* @author Paul Meagher
*
* The computation is based on formulas from Numerical Recipes, Chapter 6.4 (W.H. Press et al, 1992).
- * @param x require 0<=x<=1
- * @param p require p>0
- * @param q require q>0
- * @return 0 if x<0, p<=0, q<=0 or p+q>2.55E305 and 1 if x>1 to avoid errors and over/underflow
+ *
+ * @param mixed $x require 0<=x<=1
+ * @param mixed $p require p>0
+ * @param mixed $q require q>0
+ *
+ * @return float 0 if x<0, p<=0, q<=0 or p+q>2.55E305 and 1 if x>1 to avoid errors and over/underflow
*/
private static function incompleteBeta($x, $p, $q)
{
@@ -119,29 +60,32 @@ class PHPExcel_Calculation_Statistical
return 0.0;
} elseif ($x >= 1.0) {
return 1.0;
- } elseif (($p <= 0.0) || ($q <= 0.0) || (($p + $q) > LOG_GAMMA_X_MAX_VALUE)) {
+ } elseif (($p <= 0.0) || ($q <= 0.0) || (($p + $q) > self::LOG_GAMMA_X_MAX_VALUE)) {
return 0.0;
}
$beta_gam = exp((0 - self::logBeta($p, $q)) + $p * log($x) + $q * log(1.0 - $x));
if ($x < ($p + 1.0) / ($p + $q + 2.0)) {
return $beta_gam * self::betaFraction($x, $p, $q) / $p;
- } else {
- return 1.0 - ($beta_gam * self::betaFraction(1 - $x, $q, $p) / $q);
}
+
+ return 1.0 - ($beta_gam * self::betaFraction(1 - $x, $q, $p) / $q);
}
-
// Function cache for logBeta function
- private static $logBetaCacheP = 0.0;
- private static $logBetaCacheQ = 0.0;
+ private static $logBetaCacheP = 0.0;
+
+ private static $logBetaCacheQ = 0.0;
+
private static $logBetaCacheResult = 0.0;
/**
* The natural logarithm of the beta function.
*
- * @param p require p>0
- * @param q require q>0
- * @return 0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow
+ * @param mixed $p require p>0
+ * @param mixed $q require q>0
+ *
+ * @return float 0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow
+ *
* @author Jaco van Kooten
*/
private static function logBeta($p, $q)
@@ -149,20 +93,27 @@ class PHPExcel_Calculation_Statistical
if ($p != self::$logBetaCacheP || $q != self::$logBetaCacheQ) {
self::$logBetaCacheP = $p;
self::$logBetaCacheQ = $q;
- if (($p <= 0.0) || ($q <= 0.0) || (($p + $q) > LOG_GAMMA_X_MAX_VALUE)) {
+ if (($p <= 0.0) || ($q <= 0.0) || (($p + $q) > self::LOG_GAMMA_X_MAX_VALUE)) {
self::$logBetaCacheResult = 0.0;
} else {
self::$logBetaCacheResult = self::logGamma($p) + self::logGamma($q) - self::logGamma($p + $q);
}
}
+
return self::$logBetaCacheResult;
}
-
/**
* Evaluates of continued fraction part of incomplete beta function.
* Based on an idea from Numerical Recipes (W.H. Press et al, 1992).
+ *
* @author Jaco van Kooten
+ *
+ * @param mixed $x
+ * @param mixed $p
+ * @param mixed $q
+ *
+ * @return float
*/
private static function betaFraction($x, $p, $q)
{
@@ -171,50 +122,51 @@ class PHPExcel_Calculation_Statistical
$p_plus = $p + 1.0;
$p_minus = $p - 1.0;
$h = 1.0 - $sum_pq * $x / $p_plus;
- if (abs($h) < XMININ) {
- $h = XMININ;
+ if (abs($h) < self::XMININ) {
+ $h = self::XMININ;
}
$h = 1.0 / $h;
$frac = $h;
- $m = 1;
+ $m = 1;
$delta = 0.0;
- while ($m <= MAX_ITERATIONS && abs($delta-1.0) > PRECISION) {
+ while ($m <= self::MAX_ITERATIONS && abs($delta - 1.0) > Functions::PRECISION) {
$m2 = 2 * $m;
// even index for d
- $d = $m * ($q - $m) * $x / ( ($p_minus + $m2) * ($p + $m2));
+ $d = $m * ($q - $m) * $x / (($p_minus + $m2) * ($p + $m2));
$h = 1.0 + $d * $h;
- if (abs($h) < XMININ) {
- $h = XMININ;
+ if (abs($h) < self::XMININ) {
+ $h = self::XMININ;
}
$h = 1.0 / $h;
$c = 1.0 + $d / $c;
- if (abs($c) < XMININ) {
- $c = XMININ;
+ if (abs($c) < self::XMININ) {
+ $c = self::XMININ;
}
$frac *= $h * $c;
// odd index for d
$d = -($p + $m) * ($sum_pq + $m) * $x / (($p + $m2) * ($p_plus + $m2));
$h = 1.0 + $d * $h;
- if (abs($h) < XMININ) {
- $h = XMININ;
+ if (abs($h) < self::XMININ) {
+ $h = self::XMININ;
}
$h = 1.0 / $h;
$c = 1.0 + $d / $c;
- if (abs($c) < XMININ) {
- $c = XMININ;
+ if (abs($c) < self::XMININ) {
+ $c = self::XMININ;
}
$delta = $h * $c;
$frac *= $delta;
++$m;
}
+
return $frac;
}
-
/**
- * logGamma function
+ * logGamma function.
*
* @version 1.1
+ *
* @author Jaco van Kooten
*
* Original author was Jaco van Kooten. Ported to PHP by Paul Meagher.
@@ -251,12 +203,14 @@ class PHPExcel_Calculation_Statistical
* The program returns the value XINF for X .LE. 0.0 or when overflow would occur.
* The computation is believed to be free of underflow and overflow.
*
- * @return MAX_VALUE for x < 0.0 or when overflow would occur, i.e. x > 2.55E305
+ *
+ * @return float MAX_VALUE for x < 0.0 or when overflow would occur, i.e. x > 2.55E305
*/
// Function cache for logGamma
private static $logGammaCacheResult = 0.0;
- private static $logGammaCacheX = 0.0;
+
+ private static $logGammaCacheX = 0.0;
private static function logGamma($x)
{
@@ -265,7 +219,7 @@ class PHPExcel_Calculation_Statistical
static $lg_d2 = 0.4227843350984671393993777;
static $lg_d4 = 1.791759469228055000094023;
- static $lg_p1 = array(
+ static $lg_p1 = [
4.945235359296727046734888,
201.8112620856775083915565,
2290.838373831346393026739,
@@ -273,9 +227,9 @@ class PHPExcel_Calculation_Statistical
28557.24635671635335736389,
38484.96228443793359990269,
26377.48787624195437963534,
- 7225.813979700288197698961
- );
- static $lg_p2 = array(
+ 7225.813979700288197698961,
+ ];
+ static $lg_p2 = [
4.974607845568932035012064,
542.4138599891070494101986,
15506.93864978364947665077,
@@ -283,9 +237,9 @@ class PHPExcel_Calculation_Statistical
1088204.76946882876749847,
3338152.967987029735917223,
5106661.678927352456275255,
- 3074109.054850539556250927
- );
- static $lg_p4 = array(
+ 3074109.054850539556250927,
+ ];
+ static $lg_p4 = [
14745.02166059939948905062,
2426813.369486704502836312,
121475557.4045093227939592,
@@ -293,9 +247,9 @@ class PHPExcel_Calculation_Statistical
29403789566.34553899906876,
170266573776.5398868392998,
492612579337.743088758812,
- 560625185622.3951465078242
- );
- static $lg_q1 = array(
+ 560625185622.3951465078242,
+ ];
+ static $lg_q1 = [
67.48212550303777196073036,
1113.332393857199323513008,
7738.757056935398733233834,
@@ -303,9 +257,9 @@ class PHPExcel_Calculation_Statistical
54993.10206226157329794414,
61611.22180066002127833352,
36351.27591501940507276287,
- 8785.536302431013170870835
- );
- static $lg_q2 = array(
+ 8785.536302431013170870835,
+ ];
+ static $lg_q2 = [
183.0328399370592604055942,
7765.049321445005871323047,
133190.3827966074194402448,
@@ -313,9 +267,9 @@ class PHPExcel_Calculation_Statistical
5267964.117437946917577538,
13467014.54311101692290052,
17827365.30353274213975932,
- 9533095.591844353613395747
- );
- static $lg_q4 = array(
+ 9533095.591844353613395747,
+ ];
+ static $lg_q4 = [
2690.530175870899333379843,
639388.5654300092398984238,
41355999.30241388052042842,
@@ -323,30 +277,29 @@ class PHPExcel_Calculation_Statistical
14886137286.78813811542398,
101680358627.2438228077304,
341747634550.7377132798597,
- 446315818741.9713286462081
- );
- static $lg_c = array(
+ 446315818741.9713286462081,
+ ];
+ static $lg_c = [
-0.001910444077728,
8.4171387781295e-4,
-5.952379913043012e-4,
7.93650793500350248e-4,
-0.002777777777777681622553,
0.08333333333333333331554247,
- 0.0057083835261
- );
+ 0.0057083835261,
+ ];
// Rough estimate of the fourth root of logGamma_xBig
static $lg_frtbig = 2.25e76;
- static $pnt68 = 0.6796875;
-
+ static $pnt68 = 0.6796875;
if ($x == self::$logGammaCacheX) {
return self::$logGammaCacheResult;
}
$y = $x;
- if ($y > 0.0 && $y <= LOG_GAMMA_X_MAX_VALUE) {
- if ($y <= EPS) {
- $res = -log(y);
+ if ($y > 0.0 && $y <= self::LOG_GAMMA_X_MAX_VALUE) {
+ if ($y <= self::EPS) {
+ $res = -log($y);
} elseif ($y <= 1.5) {
// ---------------------
// EPS .LT. X .LE. 1.5
@@ -413,7 +366,7 @@ class PHPExcel_Calculation_Statistical
}
$res /= $y;
$corr = log($y);
- $res = $res + log(SQRT2PI) - 0.5 * $corr;
+ $res = $res + log(self::SQRT2PI) - 0.5 * $corr;
$res += $y * ($corr - 1.0);
}
}
@@ -421,17 +374,17 @@ class PHPExcel_Calculation_Statistical
// --------------------------
// Return for bad arguments
// --------------------------
- $res = MAX_VALUE;
+ $res = self::MAX_VALUE;
}
// ------------------------------
// Final adjustments and return
// ------------------------------
self::$logGammaCacheX = $x;
self::$logGammaCacheResult = $res;
+
return $res;
}
-
//
// Private implementation of the incomplete Gamma function
//
@@ -439,16 +392,16 @@ class PHPExcel_Calculation_Statistical
{
static $max = 32;
$summer = 0;
- for ($n=0; $n<=$max; ++$n) {
+ for ($n = 0; $n <= $max; ++$n) {
$divisor = $a;
- for ($i=1; $i<=$n; ++$i) {
+ for ($i = 1; $i <= $n; ++$i) {
$divisor *= ($a + $i);
}
$summer += (pow($x, $n) / $divisor);
}
- return pow($x, $a) * exp(0-$x) * $summer;
- }
+ return pow($x, $a) * exp(0 - $x) * $summer;
+ }
//
// Private implementation of the Gamma function
@@ -460,35 +413,35 @@ class PHPExcel_Calculation_Statistical
}
static $p0 = 1.000000000190015;
- static $p = array(
+ static $p = [
1 => 76.18009172947146,
2 => -86.50532032941677,
3 => 24.01409824083091,
4 => -1.231739572450155,
5 => 1.208650973866179e-3,
- 6 => -5.395239384953e-6
- );
+ 6 => -5.395239384953e-6,
+ ];
$y = $x = $data;
$tmp = $x + 5.5;
$tmp -= ($x + 0.5) * log($tmp);
$summer = $p0;
- for ($j=1; $j<=6; ++$j) {
+ for ($j = 1; $j <= 6; ++$j) {
$summer += ($p[$j] / ++$y);
}
- return exp(0 - $tmp + log(SQRT2PI * $summer / $x));
+
+ return exp(0 - $tmp + log(self::SQRT2PI * $summer / $x));
}
-
- /***************************************************************************
+ /*
* inverse_ncdf.php
* -------------------
* begin : Friday, January 16, 2004
* copyright : (C) 2004 Michael Nickerson
* email : nickersonm@yahoo.com
*
- ***************************************************************************/
+ */
private static function inverseNcdf($p)
{
// Inverse ncdf approximation by Peter J. Acklam, implementation adapted to
@@ -504,212 +457,69 @@ class PHPExcel_Calculation_Statistical
// Input paramater is $p - probability - where 0 < p < 1.
// Coefficients in rational approximations
- static $a = array(
+ static $a = [
1 => -3.969683028665376e+01,
2 => 2.209460984245205e+02,
3 => -2.759285104469687e+02,
4 => 1.383577518672690e+02,
5 => -3.066479806614716e+01,
- 6 => 2.506628277459239e+00
- );
+ 6 => 2.506628277459239e+00,
+ ];
- static $b = array(
+ static $b = [
1 => -5.447609879822406e+01,
2 => 1.615858368580409e+02,
3 => -1.556989798598866e+02,
4 => 6.680131188771972e+01,
- 5 => -1.328068155288572e+01
- );
+ 5 => -1.328068155288572e+01,
+ ];
- static $c = array(
+ static $c = [
1 => -7.784894002430293e-03,
2 => -3.223964580411365e-01,
3 => -2.400758277161838e+00,
4 => -2.549732539343734e+00,
5 => 4.374664141464968e+00,
- 6 => 2.938163982698783e+00
- );
+ 6 => 2.938163982698783e+00,
+ ];
- static $d = array(
+ static $d = [
1 => 7.784695709041462e-03,
2 => 3.224671290700398e-01,
3 => 2.445134137142996e+00,
- 4 => 3.754408661907416e+00
- );
+ 4 => 3.754408661907416e+00,
+ ];
// Define lower and upper region break-points.
- $p_low = 0.02425; //Use lower region approx. below this
- $p_high = 1 - $p_low; //Use upper region approx. above this
+ $p_low = 0.02425; //Use lower region approx. below this
+ $p_high = 1 - $p_low; //Use upper region approx. above this
if (0 < $p && $p < $p_low) {
// Rational approximation for lower region.
$q = sqrt(-2 * log($p));
+
return ((((($c[1] * $q + $c[2]) * $q + $c[3]) * $q + $c[4]) * $q + $c[5]) * $q + $c[6]) /
(((($d[1] * $q + $d[2]) * $q + $d[3]) * $q + $d[4]) * $q + 1);
} elseif ($p_low <= $p && $p <= $p_high) {
// Rational approximation for central region.
$q = $p - 0.5;
$r = $q * $q;
+
return ((((($a[1] * $r + $a[2]) * $r + $a[3]) * $r + $a[4]) * $r + $a[5]) * $r + $a[6]) * $q /
((((($b[1] * $r + $b[2]) * $r + $b[3]) * $r + $b[4]) * $r + $b[5]) * $r + 1);
} elseif ($p_high < $p && $p < 1) {
// Rational approximation for upper region.
$q = sqrt(-2 * log(1 - $p));
+
return -((((($c[1] * $q + $c[2]) * $q + $c[3]) * $q + $c[4]) * $q + $c[5]) * $q + $c[6]) /
(((($d[1] * $q + $d[2]) * $q + $d[3]) * $q + $d[4]) * $q + 1);
}
// If 0 < p < 1, return a null value
- return PHPExcel_Calculation_Functions::NULL();
+ return Functions::NULL();
}
-
- private static function inverseNcdf2($prob)
- {
- // Approximation of inverse standard normal CDF developed by
- // B. Moro, "The Full Monte," Risk 8(2), Feb 1995, 57-58.
-
- $a1 = 2.50662823884;
- $a2 = -18.61500062529;
- $a3 = 41.39119773534;
- $a4 = -25.44106049637;
-
- $b1 = -8.4735109309;
- $b2 = 23.08336743743;
- $b3 = -21.06224101826;
- $b4 = 3.13082909833;
-
- $c1 = 0.337475482272615;
- $c2 = 0.976169019091719;
- $c3 = 0.160797971491821;
- $c4 = 2.76438810333863E-02;
- $c5 = 3.8405729373609E-03;
- $c6 = 3.951896511919E-04;
- $c7 = 3.21767881768E-05;
- $c8 = 2.888167364E-07;
- $c9 = 3.960315187E-07;
-
- $y = $prob - 0.5;
- if (abs($y) < 0.42) {
- $z = ($y * $y);
- $z = $y * ((($a4 * $z + $a3) * $z + $a2) * $z + $a1) / (((($b4 * $z + $b3) * $z + $b2) * $z + $b1) * $z + 1);
- } else {
- if ($y > 0) {
- $z = log(-log(1 - $prob));
- } else {
- $z = log(-log($prob));
- }
- $z = $c1 + $z * ($c2 + $z * ($c3 + $z * ($c4 + $z * ($c5 + $z * ($c6 + $z * ($c7 + $z * ($c8 + $z * $c9)))))));
- if ($y < 0) {
- $z = -$z;
- }
- }
- return $z;
- } // function inverseNcdf2()
-
-
- private static function inverseNcdf3($p)
- {
- // ALGORITHM AS241 APPL. STATIST. (1988) VOL. 37, NO. 3.
- // Produces the normal deviate Z corresponding to a given lower
- // tail area of P; Z is accurate to about 1 part in 10**16.
- //
- // This is a PHP version of the original FORTRAN code that can
- // be found at http://lib.stat.cmu.edu/apstat/
- $split1 = 0.425;
- $split2 = 5;
- $const1 = 0.180625;
- $const2 = 1.6;
-
- // coefficients for p close to 0.5
- $a0 = 3.3871328727963666080;
- $a1 = 1.3314166789178437745E+2;
- $a2 = 1.9715909503065514427E+3;
- $a3 = 1.3731693765509461125E+4;
- $a4 = 4.5921953931549871457E+4;
- $a5 = 6.7265770927008700853E+4;
- $a6 = 3.3430575583588128105E+4;
- $a7 = 2.5090809287301226727E+3;
-
- $b1 = 4.2313330701600911252E+1;
- $b2 = 6.8718700749205790830E+2;
- $b3 = 5.3941960214247511077E+3;
- $b4 = 2.1213794301586595867E+4;
- $b5 = 3.9307895800092710610E+4;
- $b6 = 2.8729085735721942674E+4;
- $b7 = 5.2264952788528545610E+3;
-
- // coefficients for p not close to 0, 0.5 or 1.
- $c0 = 1.42343711074968357734;
- $c1 = 4.63033784615654529590;
- $c2 = 5.76949722146069140550;
- $c3 = 3.64784832476320460504;
- $c4 = 1.27045825245236838258;
- $c5 = 2.41780725177450611770E-1;
- $c6 = 2.27238449892691845833E-2;
- $c7 = 7.74545014278341407640E-4;
-
- $d1 = 2.05319162663775882187;
- $d2 = 1.67638483018380384940;
- $d3 = 6.89767334985100004550E-1;
- $d4 = 1.48103976427480074590E-1;
- $d5 = 1.51986665636164571966E-2;
- $d6 = 5.47593808499534494600E-4;
- $d7 = 1.05075007164441684324E-9;
-
- // coefficients for p near 0 or 1.
- $e0 = 6.65790464350110377720;
- $e1 = 5.46378491116411436990;
- $e2 = 1.78482653991729133580;
- $e3 = 2.96560571828504891230E-1;
- $e4 = 2.65321895265761230930E-2;
- $e5 = 1.24266094738807843860E-3;
- $e6 = 2.71155556874348757815E-5;
- $e7 = 2.01033439929228813265E-7;
-
- $f1 = 5.99832206555887937690E-1;
- $f2 = 1.36929880922735805310E-1;
- $f3 = 1.48753612908506148525E-2;
- $f4 = 7.86869131145613259100E-4;
- $f5 = 1.84631831751005468180E-5;
- $f6 = 1.42151175831644588870E-7;
- $f7 = 2.04426310338993978564E-15;
-
- $q = $p - 0.5;
-
- // computation for p close to 0.5
- if (abs($q) <= split1) {
- $R = $const1 - $q * $q;
- $z = $q * ((((((($a7 * $R + $a6) * $R + $a5) * $R + $a4) * $R + $a3) * $R + $a2) * $R + $a1) * $R + $a0) /
- ((((((($b7 * $R + $b6) * $R + $b5) * $R + $b4) * $R + $b3) * $R + $b2) * $R + $b1) * $R + 1);
- } else {
- if ($q < 0) {
- $R = $p;
- } else {
- $R = 1 - $p;
- }
- $R = pow(-log($R), 2);
-
- // computation for p not close to 0, 0.5 or 1.
- if ($R <= $split2) {
- $R = $R - $const2;
- $z = ((((((($c7 * $R + $c6) * $R + $c5) * $R + $c4) * $R + $c3) * $R + $c2) * $R + $c1) * $R + $c0) /
- ((((((($d7 * $R + $d6) * $R + $d5) * $R + $d4) * $R + $d3) * $R + $d2) * $R + $d1) * $R + 1);
- } else {
- // computation for p near 0 or 1.
- $R = $R - $split2;
- $z = ((((((($e7 * $R + $e6) * $R + $e5) * $R + $e4) * $R + $e3) * $R + $e2) * $R + $e1) * $R + $e0) /
- ((((((($f7 * $R + $f6) * $R + $f5) * $R + $f4) * $R + $f3) * $R + $f2) * $R + $f1) * $R + 1);
- }
- if ($q < 0) {
- $z = -$z;
- }
- }
- return $z;
- }
-
-
/**
- * AVEDEV
+ * AVEDEV.
*
* Returns the average of the absolute deviations of data points from their mean.
* AVEDEV is a measure of the variability in a data set.
@@ -717,29 +527,30 @@ class PHPExcel_Calculation_Statistical
* Excel Function:
* AVEDEV(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function AVEDEV()
+ public static function AVEDEV(...$args)
{
- $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
+ $aArgs = Functions::flattenArrayIndexed($args);
// Return value
$returnValue = null;
$aMean = self::AVERAGE($aArgs);
- if ($aMean != PHPExcel_Calculation_Functions::DIV0()) {
+ if ($aMean != Functions::DIV0()) {
$aCount = 0;
foreach ($aArgs as $k => $arg) {
if ((is_bool($arg)) &&
- ((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) {
- $arg = (integer) $arg;
+ ((!Functions::isCellValue($k)) || (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE))) {
+ $arg = (int) $arg;
}
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
- if (is_null($returnValue)) {
+ if ($returnValue === null) {
$returnValue = abs($arg - $aMean);
} else {
$returnValue += abs($arg - $aMean);
@@ -750,40 +561,42 @@ class PHPExcel_Calculation_Statistical
// Return
if ($aCount == 0) {
- return PHPExcel_Calculation_Functions::DIV0();
+ return Functions::DIV0();
}
+
return $returnValue / $aCount;
}
- return PHPExcel_Calculation_Functions::NaN();
+
+ return Functions::NAN();
}
-
/**
- * AVERAGE
+ * AVERAGE.
*
* Returns the average (arithmetic mean) of the arguments
*
* Excel Function:
* AVERAGE(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function AVERAGE()
+ public static function AVERAGE(...$args)
{
$returnValue = $aCount = 0;
// Loop through arguments
- foreach (PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()) as $k => $arg) {
+ foreach (Functions::flattenArrayIndexed($args) as $k => $arg) {
if ((is_bool($arg)) &&
- ((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) {
- $arg = (integer) $arg;
+ ((!Functions::isCellValue($k)) || (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE))) {
+ $arg = (int) $arg;
}
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
- if (is_null($returnValue)) {
+ if ($returnValue === null) {
$returnValue = $arg;
} else {
$returnValue += $arg;
@@ -795,42 +608,42 @@ class PHPExcel_Calculation_Statistical
// Return
if ($aCount > 0) {
return $returnValue / $aCount;
- } else {
- return PHPExcel_Calculation_Functions::DIV0();
}
+
+ return Functions::DIV0();
}
-
/**
- * AVERAGEA
+ * AVERAGEA.
*
* Returns the average of its arguments, including numbers, text, and logical values
*
* Excel Function:
* AVERAGEA(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function AVERAGEA()
+ public static function AVERAGEA(...$args)
{
$returnValue = null;
$aCount = 0;
// Loop through arguments
- foreach (PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args()) as $k => $arg) {
+ foreach (Functions::flattenArrayIndexed($args) as $k => $arg) {
if ((is_bool($arg)) &&
- (!PHPExcel_Calculation_Functions::isMatrixValue($k))) {
+ (!Functions::isMatrixValue($k))) {
} else {
if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) {
if (is_bool($arg)) {
- $arg = (integer) $arg;
+ $arg = (int) $arg;
} elseif (is_string($arg)) {
$arg = 0;
}
- if (is_null($returnValue)) {
+ if ($returnValue === null) {
$returnValue = $arg;
} else {
$returnValue += $arg;
@@ -842,46 +655,46 @@ class PHPExcel_Calculation_Statistical
if ($aCount > 0) {
return $returnValue / $aCount;
- } else {
- return PHPExcel_Calculation_Functions::DIV0();
}
+
+ return Functions::DIV0();
}
-
/**
- * AVERAGEIF
+ * AVERAGEIF.
*
* Returns the average value from a range of cells that contain numbers within the list of arguments
*
* Excel Function:
* AVERAGEIF(value1[,value2[, ...]],condition)
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param mixed $arg,... Data values
- * @param string $condition The criteria that defines which cells will be checked.
- * @param mixed[] $averageArgs Data values
- * @return float
+ *
+ * @param mixed $aArgs Data values
+ * @param string $condition the criteria that defines which cells will be checked
+ * @param mixed[] $averageArgs Data values
+ *
+ * @return float
*/
- public static function AVERAGEIF($aArgs, $condition, $averageArgs = array())
+ public static function AVERAGEIF($aArgs, $condition, $averageArgs = [])
{
$returnValue = 0;
- $aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs);
- $averageArgs = PHPExcel_Calculation_Functions::flattenArray($averageArgs);
+ $aArgs = Functions::flattenArray($aArgs);
+ $averageArgs = Functions::flattenArray($averageArgs);
if (empty($averageArgs)) {
$averageArgs = $aArgs;
}
- $condition = PHPExcel_Calculation_Functions::ifCondition($condition);
+ $condition = Functions::ifCondition($condition);
// Loop through arguments
$aCount = 0;
foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) {
- $arg = PHPExcel_Calculation::wrapResult(strtoupper($arg));
+ $arg = Calculation::wrapResult(strtoupper($arg));
}
- $testCondition = '='.$arg.$condition;
- if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
- if ((is_null($returnValue)) || ($arg > $returnValue)) {
+ $testCondition = '=' . $arg . $condition;
+ if (Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
+ if (($returnValue === null) || ($arg > $returnValue)) {
$returnValue += $arg;
++$aCount;
}
@@ -891,33 +704,34 @@ class PHPExcel_Calculation_Statistical
if ($aCount > 0) {
return $returnValue / $aCount;
}
- return PHPExcel_Calculation_Functions::DIV0();
+
+ return Functions::DIV0();
}
-
/**
- * BETADIST
+ * BETADIST.
*
* Returns the beta distribution.
*
- * @param float $value Value at which you want to evaluate the distribution
- * @param float $alpha Parameter to the distribution
- * @param float $beta Parameter to the distribution
- * @param boolean $cumulative
- * @return float
+ * @param float $value Value at which you want to evaluate the distribution
+ * @param float $alpha Parameter to the distribution
+ * @param float $beta Parameter to the distribution
+ * @param mixed $rMin
+ * @param mixed $rMax
*
+ * @return float
*/
public static function BETADIST($value, $alpha, $beta, $rMin = 0, $rMax = 1)
{
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha);
- $beta = PHPExcel_Calculation_Functions::flattenSingleValue($beta);
- $rMin = PHPExcel_Calculation_Functions::flattenSingleValue($rMin);
- $rMax = PHPExcel_Calculation_Functions::flattenSingleValue($rMax);
+ $value = Functions::flattenSingleValue($value);
+ $alpha = Functions::flattenSingleValue($alpha);
+ $beta = Functions::flattenSingleValue($beta);
+ $rMin = Functions::flattenSingleValue($rMin);
+ $rMax = Functions::flattenSingleValue($rMax);
if ((is_numeric($value)) && (is_numeric($alpha)) && (is_numeric($beta)) && (is_numeric($rMin)) && (is_numeric($rMax))) {
if (($value < $rMin) || ($value > $rMax) || ($alpha <= 0) || ($beta <= 0) || ($rMin == $rMax)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if ($rMin > $rMax) {
$tmp = $rMin;
@@ -926,37 +740,37 @@ class PHPExcel_Calculation_Statistical
}
$value -= $rMin;
$value /= ($rMax - $rMin);
+
return self::incompleteBeta($value, $alpha, $beta);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * BETAINV
+ * BETAINV.
*
* Returns the inverse of the beta distribution.
*
- * @param float $probability Probability at which you want to evaluate the distribution
- * @param float $alpha Parameter to the distribution
- * @param float $beta Parameter to the distribution
- * @param float $rMin Minimum value
- * @param float $rMax Maximum value
- * @param boolean $cumulative
- * @return float
+ * @param float $probability Probability at which you want to evaluate the distribution
+ * @param float $alpha Parameter to the distribution
+ * @param float $beta Parameter to the distribution
+ * @param float $rMin Minimum value
+ * @param float $rMax Maximum value
*
+ * @return float
*/
public static function BETAINV($probability, $alpha, $beta, $rMin = 0, $rMax = 1)
{
- $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability);
- $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha);
- $beta = PHPExcel_Calculation_Functions::flattenSingleValue($beta);
- $rMin = PHPExcel_Calculation_Functions::flattenSingleValue($rMin);
- $rMax = PHPExcel_Calculation_Functions::flattenSingleValue($rMax);
+ $probability = Functions::flattenSingleValue($probability);
+ $alpha = Functions::flattenSingleValue($alpha);
+ $beta = Functions::flattenSingleValue($beta);
+ $rMin = Functions::flattenSingleValue($rMin);
+ $rMax = Functions::flattenSingleValue($rMax);
if ((is_numeric($probability)) && (is_numeric($alpha)) && (is_numeric($beta)) && (is_numeric($rMin)) && (is_numeric($rMax))) {
if (($alpha <= 0) || ($beta <= 0) || ($rMin == $rMax) || ($probability <= 0) || ($probability > 1)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if ($rMin > $rMax) {
$tmp = $rMin;
@@ -967,7 +781,7 @@ class PHPExcel_Calculation_Statistical
$b = 2;
$i = 0;
- while ((($b - $a) > PRECISION) && ($i++ < MAX_ITERATIONS)) {
+ while ((($b - $a) > Functions::PRECISION) && ($i++ < self::MAX_ITERATIONS)) {
$guess = ($a + $b) / 2;
$result = self::BETADIST($guess, $alpha, $beta);
if (($result == $probability) || ($result == 0)) {
@@ -978,17 +792,18 @@ class PHPExcel_Calculation_Statistical
$a = $guess;
}
}
- if ($i == MAX_ITERATIONS) {
- return PHPExcel_Calculation_Functions::NA();
+ if ($i == self::MAX_ITERATIONS) {
+ return Functions::NA();
}
+
return round($rMin + $guess * ($rMax - $rMin), 12);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * BINOMDIST
+ * BINOMDIST.
*
* Returns the individual term binomial distribution probability. Use BINOMDIST in problems with
* a fixed number of tests or trials, when the outcomes of any trial are only success or failure,
@@ -996,97 +811,102 @@ class PHPExcel_Calculation_Statistical
* experiment. For example, BINOMDIST can calculate the probability that two of the next three
* babies born are male.
*
- * @param float $value Number of successes in trials
- * @param float $trials Number of trials
- * @param float $probability Probability of success on each trial
- * @param boolean $cumulative
- * @return float
+ * @param float $value Number of successes in trials
+ * @param float $trials Number of trials
+ * @param float $probability Probability of success on each trial
+ * @param bool $cumulative
+ *
+ * @return float
*
* @todo Cumulative distribution function
- *
*/
public static function BINOMDIST($value, $trials, $probability, $cumulative)
{
- $value = floor(PHPExcel_Calculation_Functions::flattenSingleValue($value));
- $trials = floor(PHPExcel_Calculation_Functions::flattenSingleValue($trials));
- $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability);
+ $value = floor(Functions::flattenSingleValue($value));
+ $trials = floor(Functions::flattenSingleValue($trials));
+ $probability = Functions::flattenSingleValue($probability);
if ((is_numeric($value)) && (is_numeric($trials)) && (is_numeric($probability))) {
if (($value < 0) || ($value > $trials)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if (($probability < 0) || ($probability > 1)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if ((is_numeric($cumulative)) || (is_bool($cumulative))) {
if ($cumulative) {
$summer = 0;
for ($i = 0; $i <= $value; ++$i) {
- $summer += PHPExcel_Calculation_MathTrig::COMBIN($trials, $i) * pow($probability, $i) * pow(1 - $probability, $trials - $i);
+ $summer += MathTrig::COMBIN($trials, $i) * pow($probability, $i) * pow(1 - $probability, $trials - $i);
}
+
return $summer;
- } else {
- return PHPExcel_Calculation_MathTrig::COMBIN($trials, $value) * pow($probability, $value) * pow(1 - $probability, $trials - $value) ;
}
+
+ return MathTrig::COMBIN($trials, $value) * pow($probability, $value) * pow(1 - $probability, $trials - $value);
}
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * CHIDIST
+ * CHIDIST.
*
* Returns the one-tailed probability of the chi-squared distribution.
*
- * @param float $value Value for the function
- * @param float $degrees degrees of freedom
- * @return float
+ * @param float $value Value for the function
+ * @param float $degrees degrees of freedom
+ *
+ * @return float
*/
public static function CHIDIST($value, $degrees)
{
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $degrees = floor(PHPExcel_Calculation_Functions::flattenSingleValue($degrees));
+ $value = Functions::flattenSingleValue($value);
+ $degrees = floor(Functions::flattenSingleValue($degrees));
if ((is_numeric($value)) && (is_numeric($degrees))) {
if ($degrees < 1) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if ($value < 0) {
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) {
return 1;
}
- return PHPExcel_Calculation_Functions::NaN();
+
+ return Functions::NAN();
}
- return 1 - (self::incompleteGamma($degrees/2, $value/2) / self::gamma($degrees/2));
+
+ return 1 - (self::incompleteGamma($degrees / 2, $value / 2) / self::gamma($degrees / 2));
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * CHIINV
+ * CHIINV.
*
* Returns the one-tailed probability of the chi-squared distribution.
*
- * @param float $probability Probability for the function
- * @param float $degrees degrees of freedom
- * @return float
+ * @param float $probability Probability for the function
+ * @param float $degrees degrees of freedom
+ *
+ * @return float
*/
public static function CHIINV($probability, $degrees)
{
- $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability);
- $degrees = floor(PHPExcel_Calculation_Functions::flattenSingleValue($degrees));
+ $probability = Functions::flattenSingleValue($probability);
+ $degrees = floor(Functions::flattenSingleValue($degrees));
if ((is_numeric($probability)) && (is_numeric($degrees))) {
$xLo = 100;
$xHi = 0;
$x = $xNew = 1;
- $dx = 1;
+ $dx = 1;
$i = 0;
- while ((abs($dx) > PRECISION) && ($i++ < MAX_ITERATIONS)) {
+ while ((abs($dx) > Functions::PRECISION) && ($i++ < self::MAX_ITERATIONS)) {
// Apply Newton-Raphson step
$result = self::CHIDIST($x, $degrees);
$error = $result - $probability;
@@ -1111,99 +931,103 @@ class PHPExcel_Calculation_Statistical
}
$x = $xNew;
}
- if ($i == MAX_ITERATIONS) {
- return PHPExcel_Calculation_Functions::NA();
+ if ($i == self::MAX_ITERATIONS) {
+ return Functions::NA();
}
+
return round($x, 12);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * CONFIDENCE
+ * CONFIDENCE.
*
* Returns the confidence interval for a population mean
*
- * @param float $alpha
- * @param float $stdDev Standard Deviation
- * @param float $size
- * @return float
+ * @param float $alpha
+ * @param float $stdDev Standard Deviation
+ * @param float $size
*
+ * @return float
*/
public static function CONFIDENCE($alpha, $stdDev, $size)
{
- $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha);
- $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev);
- $size = floor(PHPExcel_Calculation_Functions::flattenSingleValue($size));
+ $alpha = Functions::flattenSingleValue($alpha);
+ $stdDev = Functions::flattenSingleValue($stdDev);
+ $size = floor(Functions::flattenSingleValue($size));
if ((is_numeric($alpha)) && (is_numeric($stdDev)) && (is_numeric($size))) {
if (($alpha <= 0) || ($alpha >= 1)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if (($stdDev <= 0) || ($size < 1)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
+
return self::NORMSINV(1 - $alpha / 2) * $stdDev / sqrt($size);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * CORREL
+ * CORREL.
*
* Returns covariance, the average of the products of deviations for each data point pair.
*
- * @param array of mixed Data Series Y
- * @param array of mixed Data Series X
- * @return float
+ * @param mixed $yValues array of mixed Data Series Y
+ * @param null|mixed $xValues array of mixed Data Series X
+ *
+ * @return float
*/
public static function CORREL($yValues, $xValues = null)
{
- if ((is_null($xValues)) || (!is_array($yValues)) || (!is_array($xValues))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ if (($xValues === null) || (!is_array($yValues)) || (!is_array($xValues))) {
+ return Functions::VALUE();
}
if (!self::checkTrendArrays($yValues, $xValues)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$yValueCount = count($yValues);
$xValueCount = count($xValues);
if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
- return PHPExcel_Calculation_Functions::NA();
+ return Functions::NA();
} elseif ($yValueCount == 1) {
- return PHPExcel_Calculation_Functions::DIV0();
+ return Functions::DIV0();
}
- $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues);
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues);
+
return $bestFitLinear->getCorrelation();
}
-
/**
- * COUNT
+ * COUNT.
*
* Counts the number of cells that contain numbers within the list of arguments
*
* Excel Function:
* COUNT(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return int
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return int
*/
- public static function COUNT()
+ public static function COUNT(...$args)
{
$returnValue = 0;
// Loop through arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
+ $aArgs = Functions::flattenArrayIndexed($args);
foreach ($aArgs as $k => $arg) {
if ((is_bool($arg)) &&
- ((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) {
- $arg = (integer) $arg;
+ ((!Functions::isCellValue($k)) || (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE))) {
+ $arg = (int) $arg;
}
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
@@ -1214,26 +1038,26 @@ class PHPExcel_Calculation_Statistical
return $returnValue;
}
-
/**
- * COUNTA
+ * COUNTA.
*
* Counts the number of cells that are not empty within the list of arguments
*
* Excel Function:
* COUNTA(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return int
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return int
*/
- public static function COUNTA()
+ public static function COUNTA(...$args)
{
$returnValue = 0;
// Loop through arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
foreach ($aArgs as $arg) {
// Is it a numeric, boolean or string value?
if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) {
@@ -1244,29 +1068,29 @@ class PHPExcel_Calculation_Statistical
return $returnValue;
}
-
/**
- * COUNTBLANK
+ * COUNTBLANK.
*
* Counts the number of empty cells within the list of arguments
*
* Excel Function:
* COUNTBLANK(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return int
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return int
*/
- public static function COUNTBLANK()
+ public static function COUNTBLANK(...$args)
{
$returnValue = 0;
// Loop through arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
foreach ($aArgs as $arg) {
// Is it a blank cell?
- if ((is_null($arg)) || ((is_string($arg)) && ($arg == ''))) {
+ if (($arg === null) || ((is_string($arg)) && ($arg == ''))) {
++$returnValue;
}
}
@@ -1274,34 +1098,34 @@ class PHPExcel_Calculation_Statistical
return $returnValue;
}
-
/**
- * COUNTIF
+ * COUNTIF.
*
* Counts the number of cells that contain numbers within the list of arguments
*
* Excel Function:
* COUNTIF(value1[,value2[, ...]],condition)
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @param string $condition The criteria that defines which cells will be counted.
- * @return int
+ *
+ * @param mixed $aArgs Data values
+ * @param string $condition the criteria that defines which cells will be counted
+ *
+ * @return int
*/
public static function COUNTIF($aArgs, $condition)
{
$returnValue = 0;
- $aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs);
- $condition = PHPExcel_Calculation_Functions::ifCondition($condition);
+ $aArgs = Functions::flattenArray($aArgs);
+ $condition = Functions::ifCondition($condition);
// Loop through arguments
foreach ($aArgs as $arg) {
if (!is_numeric($arg)) {
- $arg = PHPExcel_Calculation::wrapResult(strtoupper($arg));
+ $arg = Calculation::wrapResult(strtoupper($arg));
}
- $testCondition = '='.$arg.$condition;
- if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
+ $testCondition = '=' . $arg . $condition;
+ if (Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
// Is it a value within our criteria
++$returnValue;
}
@@ -1310,67 +1134,67 @@ class PHPExcel_Calculation_Statistical
return $returnValue;
}
-
/**
- * COVAR
+ * COVAR.
*
* Returns covariance, the average of the products of deviations for each data point pair.
*
- * @param array of mixed Data Series Y
- * @param array of mixed Data Series X
- * @return float
+ * @param mixed $yValues array of mixed Data Series Y
+ * @param mixed $xValues array of mixed Data Series X
+ *
+ * @return float
*/
public static function COVAR($yValues, $xValues)
{
if (!self::checkTrendArrays($yValues, $xValues)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$yValueCount = count($yValues);
$xValueCount = count($xValues);
if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
- return PHPExcel_Calculation_Functions::NA();
+ return Functions::NA();
} elseif ($yValueCount == 1) {
- return PHPExcel_Calculation_Functions::DIV0();
+ return Functions::DIV0();
}
- $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues);
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues);
+
return $bestFitLinear->getCovariance();
}
-
/**
- * CRITBINOM
+ * CRITBINOM.
*
* Returns the smallest value for which the cumulative binomial distribution is greater
* than or equal to a criterion value
*
- * See http://support.microsoft.com/kb/828117/ for details of the algorithm used
+ * See https://support.microsoft.com/en-us/help/828117/ for details of the algorithm used
*
- * @param float $trials number of Bernoulli trials
- * @param float $probability probability of a success on each trial
- * @param float $alpha criterion value
- * @return int
+ * @param float $trials number of Bernoulli trials
+ * @param float $probability probability of a success on each trial
+ * @param float $alpha criterion value
+ *
+ * @return int
*
* @todo Warning. This implementation differs from the algorithm detailed on the MS
* web site in that $CumPGuessMinus1 = $CumPGuess - 1 rather than $CumPGuess - $PGuess
* This eliminates a potential endless loop error, but may have an adverse affect on the
* accuracy of the function (although all my tests have so far returned correct results).
- *
*/
public static function CRITBINOM($trials, $probability, $alpha)
{
- $trials = floor(PHPExcel_Calculation_Functions::flattenSingleValue($trials));
- $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability);
- $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha);
+ $trials = floor(Functions::flattenSingleValue($trials));
+ $probability = Functions::flattenSingleValue($probability);
+ $alpha = Functions::flattenSingleValue($alpha);
if ((is_numeric($trials)) && (is_numeric($probability)) && (is_numeric($alpha))) {
if ($trials < 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
} elseif (($probability < 0) || ($probability > 1)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
} elseif (($alpha < 0) || ($alpha > 1)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
} elseif ($alpha <= 0.5) {
$t = sqrt(log(1 / ($alpha * $alpha)));
$trialsApprox = 0 - ($t + (2.515517 + 0.802853 * $t + 0.010328 * $t * $t) / (1 + 1.432788 * $t + 0.189269 * $t * $t + 0.001308 * $t * $t * $t));
@@ -1438,7 +1262,6 @@ class PHPExcel_Calculation_Statistical
$PGuess = $UnscaledPGuess / $TotalUnscaledProbability;
$CumPGuess = $UnscaledCumPGuess / $TotalUnscaledProbability;
-// $CumPGuessMinus1 = $CumPGuess - $PGuess;
$CumPGuessMinus1 = $CumPGuess - 1;
while (true) {
@@ -1459,42 +1282,43 @@ class PHPExcel_Calculation_Statistical
}
}
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * DEVSQ
+ * DEVSQ.
*
* Returns the sum of squares of deviations of data points from their sample mean.
*
* Excel Function:
* DEVSQ(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function DEVSQ()
+ public static function DEVSQ(...$args)
{
- $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
+ $aArgs = Functions::flattenArrayIndexed($args);
// Return value
$returnValue = null;
$aMean = self::AVERAGE($aArgs);
- if ($aMean != PHPExcel_Calculation_Functions::DIV0()) {
+ if ($aMean != Functions::DIV0()) {
$aCount = -1;
foreach ($aArgs as $k => $arg) {
// Is it a numeric value?
if ((is_bool($arg)) &&
- ((!PHPExcel_Calculation_Functions::isCellValue($k)) ||
- (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) {
- $arg = (integer) $arg;
+ ((!Functions::isCellValue($k)) ||
+ (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE))) {
+ $arg = (int) $arg;
}
if ((is_numeric($arg)) && (!is_string($arg))) {
- if (is_null($returnValue)) {
+ if ($returnValue === null) {
$returnValue = pow(($arg - $aMean), 2);
} else {
$returnValue += pow(($arg - $aMean), 2);
@@ -1504,181 +1328,186 @@ class PHPExcel_Calculation_Statistical
}
// Return
- if (is_null($returnValue)) {
- return PHPExcel_Calculation_Functions::NaN();
- } else {
- return $returnValue;
+ if ($returnValue === null) {
+ return Functions::NAN();
}
+
+ return $returnValue;
}
+
return self::NA();
}
-
/**
- * EXPONDIST
+ * EXPONDIST.
*
* Returns the exponential distribution. Use EXPONDIST to model the time between events,
* such as how long an automated bank teller takes to deliver cash. For example, you can
* use EXPONDIST to determine the probability that the process takes at most 1 minute.
*
- * @param float $value Value of the function
- * @param float $lambda The parameter value
- * @param boolean $cumulative
- * @return float
+ * @param float $value Value of the function
+ * @param float $lambda The parameter value
+ * @param bool $cumulative
+ *
+ * @return float
*/
public static function EXPONDIST($value, $lambda, $cumulative)
{
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $lambda = PHPExcel_Calculation_Functions::flattenSingleValue($lambda);
- $cumulative = PHPExcel_Calculation_Functions::flattenSingleValue($cumulative);
+ $value = Functions::flattenSingleValue($value);
+ $lambda = Functions::flattenSingleValue($lambda);
+ $cumulative = Functions::flattenSingleValue($cumulative);
if ((is_numeric($value)) && (is_numeric($lambda))) {
if (($value < 0) || ($lambda < 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if ((is_numeric($cumulative)) || (is_bool($cumulative))) {
if ($cumulative) {
- return 1 - exp(0-$value*$lambda);
- } else {
- return $lambda * exp(0-$value*$lambda);
+ return 1 - exp(0 - $value * $lambda);
}
+
+ return $lambda * exp(0 - $value * $lambda);
}
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * FISHER
+ * FISHER.
*
* Returns the Fisher transformation at x. This transformation produces a function that
* is normally distributed rather than skewed. Use this function to perform hypothesis
* testing on the correlation coefficient.
*
- * @param float $value
- * @return float
+ * @param float $value
+ *
+ * @return float
*/
public static function FISHER($value)
{
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
+ $value = Functions::flattenSingleValue($value);
if (is_numeric($value)) {
if (($value <= -1) || ($value >= 1)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- return 0.5 * log((1+$value)/(1-$value));
+
+ return 0.5 * log((1 + $value) / (1 - $value));
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * FISHERINV
+ * FISHERINV.
*
* Returns the inverse of the Fisher transformation. Use this transformation when
* analyzing correlations between ranges or arrays of data. If y = FISHER(x), then
* FISHERINV(y) = x.
*
- * @param float $value
- * @return float
+ * @param float $value
+ *
+ * @return float
*/
public static function FISHERINV($value)
{
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
+ $value = Functions::flattenSingleValue($value);
if (is_numeric($value)) {
return (exp(2 * $value) - 1) / (exp(2 * $value) + 1);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * FORECAST
+ * FORECAST.
*
* Calculates, or predicts, a future value by using existing values. The predicted value is a y-value for a given x-value.
*
- * @param float Value of X for which we want to find Y
- * @param array of mixed Data Series Y
- * @param array of mixed Data Series X
- * @return float
+ * @param float $xValue Value of X for which we want to find Y
+ * @param mixed $yValues array of mixed Data Series Y
+ * @param mixed $xValues of mixed Data Series X
+ *
+ * @return float
*/
public static function FORECAST($xValue, $yValues, $xValues)
{
- $xValue = PHPExcel_Calculation_Functions::flattenSingleValue($xValue);
+ $xValue = Functions::flattenSingleValue($xValue);
if (!is_numeric($xValue)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
} elseif (!self::checkTrendArrays($yValues, $xValues)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$yValueCount = count($yValues);
$xValueCount = count($xValues);
if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
- return PHPExcel_Calculation_Functions::NA();
+ return Functions::NA();
} elseif ($yValueCount == 1) {
- return PHPExcel_Calculation_Functions::DIV0();
+ return Functions::DIV0();
}
- $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues);
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues);
+
return $bestFitLinear->getValueOfYForX($xValue);
}
-
/**
- * GAMMADIST
+ * GAMMADIST.
*
* Returns the gamma distribution.
*
- * @param float $value Value at which you want to evaluate the distribution
- * @param float $a Parameter to the distribution
- * @param float $b Parameter to the distribution
- * @param boolean $cumulative
- * @return float
+ * @param float $value Value at which you want to evaluate the distribution
+ * @param float $a Parameter to the distribution
+ * @param float $b Parameter to the distribution
+ * @param bool $cumulative
*
+ * @return float
*/
public static function GAMMADIST($value, $a, $b, $cumulative)
{
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $a = PHPExcel_Calculation_Functions::flattenSingleValue($a);
- $b = PHPExcel_Calculation_Functions::flattenSingleValue($b);
+ $value = Functions::flattenSingleValue($value);
+ $a = Functions::flattenSingleValue($a);
+ $b = Functions::flattenSingleValue($b);
if ((is_numeric($value)) && (is_numeric($a)) && (is_numeric($b))) {
if (($value < 0) || ($a <= 0) || ($b <= 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if ((is_numeric($cumulative)) || (is_bool($cumulative))) {
if ($cumulative) {
return self::incompleteGamma($a, $value / $b) / self::gamma($a);
- } else {
- return (1 / (pow($b, $a) * self::gamma($a))) * pow($value, $a-1) * exp(0-($value / $b));
}
+
+ return (1 / (pow($b, $a) * self::gamma($a))) * pow($value, $a - 1) * exp(0 - ($value / $b));
}
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * GAMMAINV
+ * GAMMAINV.
*
* Returns the inverse of the beta distribution.
*
- * @param float $probability Probability at which you want to evaluate the distribution
- * @param float $alpha Parameter to the distribution
- * @param float $beta Parameter to the distribution
- * @return float
+ * @param float $probability Probability at which you want to evaluate the distribution
+ * @param float $alpha Parameter to the distribution
+ * @param float $beta Parameter to the distribution
*
+ * @return float
*/
public static function GAMMAINV($probability, $alpha, $beta)
{
- $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability);
- $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha);
- $beta = PHPExcel_Calculation_Functions::flattenSingleValue($beta);
+ $probability = Functions::flattenSingleValue($probability);
+ $alpha = Functions::flattenSingleValue($alpha);
+ $beta = Functions::flattenSingleValue($beta);
if ((is_numeric($probability)) && (is_numeric($alpha)) && (is_numeric($beta))) {
if (($alpha <= 0) || ($beta <= 0) || ($probability < 0) || ($probability > 1)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
$xLo = 0;
@@ -1686,10 +1515,10 @@ class PHPExcel_Calculation_Statistical
$x = $xNew = 1;
$error = $pdf = 0;
- $dx = 1024;
+ $dx = 1024;
$i = 0;
- while ((abs($dx) > PRECISION) && ($i++ < MAX_ITERATIONS)) {
+ while ((abs($dx) > Functions::PRECISION) && ($i++ < self::MAX_ITERATIONS)) {
// Apply Newton-Raphson step
$error = self::GAMMADIST($x, $alpha, $beta, true) - $probability;
if ($error < 0.0) {
@@ -1712,39 +1541,42 @@ class PHPExcel_Calculation_Statistical
}
$x = $xNew;
}
- if ($i == MAX_ITERATIONS) {
- return PHPExcel_Calculation_Functions::NA();
+ if ($i == self::MAX_ITERATIONS) {
+ return Functions::NA();
}
+
return $x;
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * GAMMALN
+ * GAMMALN.
*
* Returns the natural logarithm of the gamma function.
*
- * @param float $value
- * @return float
+ * @param float $value
+ *
+ * @return float
*/
public static function GAMMALN($value)
{
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
+ $value = Functions::flattenSingleValue($value);
if (is_numeric($value)) {
if ($value <= 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
+
return log(self::gamma($value));
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * GEOMEAN
+ * GEOMEAN.
*
* Returns the geometric mean of an array or range of positive data. For example, you
* can use GEOMEAN to calculate average growth rate given compound interest with
@@ -1753,50 +1585,52 @@ class PHPExcel_Calculation_Statistical
* Excel Function:
* GEOMEAN(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function GEOMEAN()
+ public static function GEOMEAN(...$args)
{
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
- $aMean = PHPExcel_Calculation_MathTrig::PRODUCT($aArgs);
+ $aMean = MathTrig::PRODUCT($aArgs);
if (is_numeric($aMean) && ($aMean > 0)) {
- $aCount = self::COUNT($aArgs) ;
+ $aCount = self::COUNT($aArgs);
if (self::MIN($aArgs) > 0) {
return pow($aMean, (1 / $aCount));
}
}
- return PHPExcel_Calculation_Functions::NaN();
+
+ return Functions::NAN();
}
-
/**
- * GROWTH
+ * GROWTH.
*
- * Returns values along a predicted emponential trend
+ * Returns values along a predicted emponential Trend
*
- * @param array of mixed Data Series Y
- * @param array of mixed Data Series X
- * @param array of mixed Values of X for which we want to find Y
- * @param boolean A logical value specifying whether to force the intersect to equal 0.
- * @return array of float
+ * @param mixed[] $yValues Data Series Y
+ * @param mixed[] $xValues Data Series X
+ * @param mixed[] $newValues Values of X for which we want to find Y
+ * @param bool $const a logical value specifying whether to force the intersect to equal 0
+ *
+ * @return array of float
*/
- public static function GROWTH($yValues, $xValues = array(), $newValues = array(), $const = true)
+ public static function GROWTH($yValues, $xValues = [], $newValues = [], $const = true)
{
- $yValues = PHPExcel_Calculation_Functions::flattenArray($yValues);
- $xValues = PHPExcel_Calculation_Functions::flattenArray($xValues);
- $newValues = PHPExcel_Calculation_Functions::flattenArray($newValues);
- $const = (is_null($const)) ? true : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($const);
+ $yValues = Functions::flattenArray($yValues);
+ $xValues = Functions::flattenArray($xValues);
+ $newValues = Functions::flattenArray($newValues);
+ $const = ($const === null) ? true : (bool) Functions::flattenSingleValue($const);
- $bestFitExponential = trendClass::calculate(trendClass::TREND_EXPONENTIAL, $yValues, $xValues, $const);
+ $bestFitExponential = Trend::calculate(Trend::TREND_EXPONENTIAL, $yValues, $xValues, $const);
if (empty($newValues)) {
$newValues = $bestFitExponential->getXValues();
}
- $returnArray = array();
+ $returnArray = [];
foreach ($newValues as $xValue) {
$returnArray[0][] = $bestFitExponential->getValueOfYForX($xValue);
}
@@ -1804,9 +1638,8 @@ class PHPExcel_Calculation_Statistical
return $returnArray;
}
-
/**
- * HARMEAN
+ * HARMEAN.
*
* Returns the harmonic mean of a data set. The harmonic mean is the reciprocal of the
* arithmetic mean of reciprocals.
@@ -1814,29 +1647,30 @@ class PHPExcel_Calculation_Statistical
* Excel Function:
* HARMEAN(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function HARMEAN()
+ public static function HARMEAN(...$args)
{
// Return value
- $returnValue = PHPExcel_Calculation_Functions::NA();
+ $returnValue = Functions::NA();
// Loop through arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
if (self::MIN($aArgs) < 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
$aCount = 0;
foreach ($aArgs as $arg) {
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
if ($arg <= 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- if (is_null($returnValue)) {
+ if ($returnValue === null) {
$returnValue = (1 / $arg);
} else {
$returnValue += (1 / $arg);
@@ -1848,92 +1682,94 @@ class PHPExcel_Calculation_Statistical
// Return
if ($aCount > 0) {
return 1 / ($returnValue / $aCount);
- } else {
- return $returnValue;
}
+
+ return $returnValue;
}
-
/**
- * HYPGEOMDIST
+ * HYPGEOMDIST.
*
* Returns the hypergeometric distribution. HYPGEOMDIST returns the probability of a given number of
* sample successes, given the sample size, population successes, and population size.
*
- * @param float $sampleSuccesses Number of successes in the sample
- * @param float $sampleNumber Size of the sample
- * @param float $populationSuccesses Number of successes in the population
- * @param float $populationNumber Population size
- * @return float
+ * @param float $sampleSuccesses Number of successes in the sample
+ * @param float $sampleNumber Size of the sample
+ * @param float $populationSuccesses Number of successes in the population
+ * @param float $populationNumber Population size
*
+ * @return float
*/
public static function HYPGEOMDIST($sampleSuccesses, $sampleNumber, $populationSuccesses, $populationNumber)
{
- $sampleSuccesses = floor(PHPExcel_Calculation_Functions::flattenSingleValue($sampleSuccesses));
- $sampleNumber = floor(PHPExcel_Calculation_Functions::flattenSingleValue($sampleNumber));
- $populationSuccesses = floor(PHPExcel_Calculation_Functions::flattenSingleValue($populationSuccesses));
- $populationNumber = floor(PHPExcel_Calculation_Functions::flattenSingleValue($populationNumber));
+ $sampleSuccesses = floor(Functions::flattenSingleValue($sampleSuccesses));
+ $sampleNumber = floor(Functions::flattenSingleValue($sampleNumber));
+ $populationSuccesses = floor(Functions::flattenSingleValue($populationSuccesses));
+ $populationNumber = floor(Functions::flattenSingleValue($populationNumber));
if ((is_numeric($sampleSuccesses)) && (is_numeric($sampleNumber)) && (is_numeric($populationSuccesses)) && (is_numeric($populationNumber))) {
if (($sampleSuccesses < 0) || ($sampleSuccesses > $sampleNumber) || ($sampleSuccesses > $populationSuccesses)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if (($sampleNumber <= 0) || ($sampleNumber > $populationNumber)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if (($populationSuccesses <= 0) || ($populationSuccesses > $populationNumber)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- return PHPExcel_Calculation_MathTrig::COMBIN($populationSuccesses, $sampleSuccesses) *
- PHPExcel_Calculation_MathTrig::COMBIN($populationNumber - $populationSuccesses, $sampleNumber - $sampleSuccesses) /
- PHPExcel_Calculation_MathTrig::COMBIN($populationNumber, $sampleNumber);
+
+ return MathTrig::COMBIN($populationSuccesses, $sampleSuccesses) *
+ MathTrig::COMBIN($populationNumber - $populationSuccesses, $sampleNumber - $sampleSuccesses) /
+ MathTrig::COMBIN($populationNumber, $sampleNumber);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * INTERCEPT
+ * INTERCEPT.
*
* Calculates the point at which a line will intersect the y-axis by using existing x-values and y-values.
*
- * @param array of mixed Data Series Y
- * @param array of mixed Data Series X
- * @return float
+ * @param mixed[] $yValues Data Series Y
+ * @param mixed[] $xValues Data Series X
+ *
+ * @return float
*/
public static function INTERCEPT($yValues, $xValues)
{
if (!self::checkTrendArrays($yValues, $xValues)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$yValueCount = count($yValues);
$xValueCount = count($xValues);
if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
- return PHPExcel_Calculation_Functions::NA();
+ return Functions::NA();
} elseif ($yValueCount == 1) {
- return PHPExcel_Calculation_Functions::DIV0();
+ return Functions::DIV0();
}
- $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues);
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues);
+
return $bestFitLinear->getIntersect();
}
-
/**
- * KURT
+ * KURT.
*
* Returns the kurtosis of a data set. Kurtosis characterizes the relative peakedness
* or flatness of a distribution compared with the normal distribution. Positive
* kurtosis indicates a relatively peaked distribution. Negative kurtosis indicates a
* relatively flat distribution.
*
- * @param array Data Series
- * @return float
+ * @param array ...$args Data Series
+ *
+ * @return float
*/
- public static function KURT()
+ public static function KURT(...$args)
{
- $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
+ $aArgs = Functions::flattenArrayIndexed($args);
$mean = self::AVERAGE($aArgs);
$stdDev = self::STDEV($aArgs);
@@ -1942,7 +1778,7 @@ class PHPExcel_Calculation_Statistical
// Loop through arguments
foreach ($aArgs as $k => $arg) {
if ((is_bool($arg)) &&
- (!PHPExcel_Calculation_Functions::isMatrixValue($k))) {
+ (!Functions::isMatrixValue($k))) {
} else {
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
@@ -1954,15 +1790,15 @@ class PHPExcel_Calculation_Statistical
// Return
if ($count > 3) {
- return $summer * ($count * ($count+1) / (($count-1) * ($count-2) * ($count-3))) - (3 * pow($count-1, 2) / (($count-2) * ($count-3)));
+ return $summer * ($count * ($count + 1) / (($count - 1) * ($count - 2) * ($count - 3))) - (3 * pow($count - 1, 2) / (($count - 2) * ($count - 3)));
}
}
- return PHPExcel_Calculation_Functions::DIV0();
+
+ return Functions::DIV0();
}
-
/**
- * LARGE
+ * LARGE.
*
* Returns the nth largest value in a data set. You can use this function to
* select a value based on its relative standing.
@@ -1970,22 +1806,22 @@ class PHPExcel_Calculation_Statistical
* Excel Function:
* LARGE(value1[,value2[, ...]],entry)
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @param int $entry Position (ordered from the largest) in the array or range of data to return
- * @return float
*
+ * @param mixed $args Data values
+ * @param int $entry Position (ordered from the largest) in the array or range of data to return
+ *
+ * @return float
*/
- public static function LARGE()
+ public static function LARGE(...$args)
{
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
// Calculate
$entry = floor(array_pop($aArgs));
if ((is_numeric($entry)) && (!is_string($entry))) {
- $mArgs = array();
+ $mArgs = [];
foreach ($aArgs as $arg) {
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
@@ -1995,150 +1831,150 @@ class PHPExcel_Calculation_Statistical
$count = self::COUNT($mArgs);
$entry = floor(--$entry);
if (($entry < 0) || ($entry >= $count) || ($count == 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
rsort($mArgs);
+
return $mArgs[$entry];
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * LINEST
+ * LINEST.
*
* Calculates the statistics for a line by using the "least squares" method to calculate a straight line that best fits your data,
* and then returns an array that describes the line.
*
- * @param array of mixed Data Series Y
- * @param array of mixed Data Series X
- * @param boolean A logical value specifying whether to force the intersect to equal 0.
- * @param boolean A logical value specifying whether to return additional regression statistics.
- * @return array
+ * @param mixed[] $yValues Data Series Y
+ * @param null|mixed[] $xValues Data Series X
+ * @param bool $const a logical value specifying whether to force the intersect to equal 0
+ * @param bool $stats a logical value specifying whether to return additional regression statistics
+ *
+ * @return array
*/
public static function LINEST($yValues, $xValues = null, $const = true, $stats = false)
{
- $const = (is_null($const)) ? true : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($const);
- $stats = (is_null($stats)) ? false : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($stats);
- if (is_null($xValues)) {
- $xValues = range(1, count(PHPExcel_Calculation_Functions::flattenArray($yValues)));
+ $const = ($const === null) ? true : (bool) Functions::flattenSingleValue($const);
+ $stats = ($stats === null) ? false : (bool) Functions::flattenSingleValue($stats);
+ if ($xValues === null) {
+ $xValues = range(1, count(Functions::flattenArray($yValues)));
}
if (!self::checkTrendArrays($yValues, $xValues)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$yValueCount = count($yValues);
$xValueCount = count($xValues);
-
if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
- return PHPExcel_Calculation_Functions::NA();
+ return Functions::NA();
} elseif ($yValueCount == 1) {
return 0;
}
- $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues, $const);
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues, $const);
if ($stats) {
- return array(
- array(
+ return [
+ [
$bestFitLinear->getSlope(),
$bestFitLinear->getSlopeSE(),
$bestFitLinear->getGoodnessOfFit(),
$bestFitLinear->getF(),
$bestFitLinear->getSSRegression(),
- ),
- array(
+ ],
+ [
$bestFitLinear->getIntersect(),
$bestFitLinear->getIntersectSE(),
$bestFitLinear->getStdevOfResiduals(),
$bestFitLinear->getDFResiduals(),
- $bestFitLinear->getSSResiduals()
- )
- );
- } else {
- return array(
- $bestFitLinear->getSlope(),
- $bestFitLinear->getIntersect()
- );
+ $bestFitLinear->getSSResiduals(),
+ ],
+ ];
}
+
+ return [
+ $bestFitLinear->getSlope(),
+ $bestFitLinear->getIntersect(),
+ ];
}
-
/**
- * LOGEST
+ * LOGEST.
*
* Calculates an exponential curve that best fits the X and Y data series,
* and then returns an array that describes the line.
*
- * @param array of mixed Data Series Y
- * @param array of mixed Data Series X
- * @param boolean A logical value specifying whether to force the intersect to equal 0.
- * @param boolean A logical value specifying whether to return additional regression statistics.
- * @return array
+ * @param mixed[] $yValues Data Series Y
+ * @param null|mixed[] $xValues Data Series X
+ * @param bool $const a logical value specifying whether to force the intersect to equal 0
+ * @param bool $stats a logical value specifying whether to return additional regression statistics
+ *
+ * @return array
*/
public static function LOGEST($yValues, $xValues = null, $const = true, $stats = false)
{
- $const = (is_null($const)) ? true : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($const);
- $stats = (is_null($stats)) ? false : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($stats);
- if (is_null($xValues)) {
- $xValues = range(1, count(PHPExcel_Calculation_Functions::flattenArray($yValues)));
+ $const = ($const === null) ? true : (bool) Functions::flattenSingleValue($const);
+ $stats = ($stats === null) ? false : (bool) Functions::flattenSingleValue($stats);
+ if ($xValues === null) {
+ $xValues = range(1, count(Functions::flattenArray($yValues)));
}
if (!self::checkTrendArrays($yValues, $xValues)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$yValueCount = count($yValues);
$xValueCount = count($xValues);
foreach ($yValues as $value) {
if ($value <= 0.0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
}
-
if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
- return PHPExcel_Calculation_Functions::NA();
+ return Functions::NA();
} elseif ($yValueCount == 1) {
return 1;
}
- $bestFitExponential = trendClass::calculate(trendClass::TREND_EXPONENTIAL, $yValues, $xValues, $const);
+ $bestFitExponential = Trend::calculate(Trend::TREND_EXPONENTIAL, $yValues, $xValues, $const);
if ($stats) {
- return array(
- array(
+ return [
+ [
$bestFitExponential->getSlope(),
$bestFitExponential->getSlopeSE(),
$bestFitExponential->getGoodnessOfFit(),
$bestFitExponential->getF(),
$bestFitExponential->getSSRegression(),
- ),
- array(
+ ],
+ [
$bestFitExponential->getIntersect(),
$bestFitExponential->getIntersectSE(),
$bestFitExponential->getStdevOfResiduals(),
$bestFitExponential->getDFResiduals(),
- $bestFitExponential->getSSResiduals()
- )
- );
- } else {
- return array(
- $bestFitExponential->getSlope(),
- $bestFitExponential->getIntersect()
- );
+ $bestFitExponential->getSSResiduals(),
+ ],
+ ];
}
+
+ return [
+ $bestFitExponential->getSlope(),
+ $bestFitExponential->getIntersect(),
+ ];
}
-
/**
- * LOGINV
+ * LOGINV.
*
* Returns the inverse of the normal cumulative distribution
*
- * @param float $probability
- * @param float $mean
- * @param float $stdDev
- * @return float
+ * @param float $probability
+ * @param float $mean
+ * @param float $stdDev
+ *
+ * @return float
*
* @todo Try implementing P J Acklam's refinement algorithm for greater
* accuracy if I can get my head round the mathematics
@@ -2146,49 +1982,52 @@ class PHPExcel_Calculation_Statistical
*/
public static function LOGINV($probability, $mean, $stdDev)
{
- $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability);
- $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean);
- $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev);
+ $probability = Functions::flattenSingleValue($probability);
+ $mean = Functions::flattenSingleValue($mean);
+ $stdDev = Functions::flattenSingleValue($stdDev);
if ((is_numeric($probability)) && (is_numeric($mean)) && (is_numeric($stdDev))) {
if (($probability < 0) || ($probability > 1) || ($stdDev <= 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
+
return exp($mean + $stdDev * self::NORMSINV($probability));
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * LOGNORMDIST
+ * LOGNORMDIST.
*
* Returns the cumulative lognormal distribution of x, where ln(x) is normally distributed
* with parameters mean and standard_dev.
*
- * @param float $value
- * @param float $mean
- * @param float $stdDev
- * @return float
+ * @param float $value
+ * @param float $mean
+ * @param float $stdDev
+ *
+ * @return float
*/
public static function LOGNORMDIST($value, $mean, $stdDev)
{
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean);
- $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev);
+ $value = Functions::flattenSingleValue($value);
+ $mean = Functions::flattenSingleValue($mean);
+ $stdDev = Functions::flattenSingleValue($stdDev);
if ((is_numeric($value)) && (is_numeric($mean)) && (is_numeric($stdDev))) {
if (($value <= 0) || ($stdDev <= 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
+
return self::NORMSDIST((log($value) - $mean) / $stdDev);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * MAX
+ * MAX.
*
* MAX returns the value of the element of the values passed that has the highest value,
* with negative numbers considered smaller than positive numbers.
@@ -2196,105 +2035,109 @@ class PHPExcel_Calculation_Statistical
* Excel Function:
* MAX(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function MAX()
+ public static function MAX(...$args)
{
$returnValue = null;
// Loop through arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
foreach ($aArgs as $arg) {
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
- if ((is_null($returnValue)) || ($arg > $returnValue)) {
+ if (($returnValue === null) || ($arg > $returnValue)) {
$returnValue = $arg;
}
}
}
- if (is_null($returnValue)) {
+ if ($returnValue === null) {
return 0;
}
+
return $returnValue;
}
-
/**
- * MAXA
+ * MAXA.
*
* Returns the greatest value in a list of arguments, including numbers, text, and logical values
*
* Excel Function:
* MAXA(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function MAXA()
+ public static function MAXA(...$args)
{
$returnValue = null;
// Loop through arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
foreach ($aArgs as $arg) {
// Is it a numeric value?
if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) {
if (is_bool($arg)) {
- $arg = (integer) $arg;
+ $arg = (int) $arg;
} elseif (is_string($arg)) {
$arg = 0;
}
- if ((is_null($returnValue)) || ($arg > $returnValue)) {
+ if (($returnValue === null) || ($arg > $returnValue)) {
$returnValue = $arg;
}
}
}
- if (is_null($returnValue)) {
+ if ($returnValue === null) {
return 0;
}
+
return $returnValue;
}
-
/**
- * MAXIF
+ * MAXIF.
*
* Counts the maximum value within a range of cells that contain numbers within the list of arguments
*
* Excel Function:
* MAXIF(value1[,value2[, ...]],condition)
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param mixed $arg,... Data values
- * @param string $condition The criteria that defines which cells will be checked.
- * @return float
+ *
+ * @param mixed $aArgs Data values
+ * @param string $condition the criteria that defines which cells will be checked
+ * @param mixed $sumArgs
+ *
+ * @return float
*/
- public static function MAXIF($aArgs, $condition, $sumArgs = array())
+ public static function MAXIF($aArgs, $condition, $sumArgs = [])
{
$returnValue = null;
- $aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs);
- $sumArgs = PHPExcel_Calculation_Functions::flattenArray($sumArgs);
+ $aArgs = Functions::flattenArray($aArgs);
+ $sumArgs = Functions::flattenArray($sumArgs);
if (empty($sumArgs)) {
$sumArgs = $aArgs;
}
- $condition = PHPExcel_Calculation_Functions::ifCondition($condition);
+ $condition = Functions::ifCondition($condition);
// Loop through arguments
foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) {
- $arg = PHPExcel_Calculation::wrapResult(strtoupper($arg));
+ $arg = Calculation::wrapResult(strtoupper($arg));
}
- $testCondition = '='.$arg.$condition;
- if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
- if ((is_null($returnValue)) || ($arg > $returnValue)) {
+ $testCondition = '=' . $arg . $condition;
+ if (Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
+ if (($returnValue === null) || ($arg > $returnValue)) {
$returnValue = $arg;
}
}
@@ -2304,25 +2147,26 @@ class PHPExcel_Calculation_Statistical
}
/**
- * MEDIAN
+ * MEDIAN.
*
* Returns the median of the given numbers. The median is the number in the middle of a set of numbers.
*
* Excel Function:
* MEDIAN(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function MEDIAN()
+ public static function MEDIAN(...$args)
{
- $returnValue = PHPExcel_Calculation_Functions::NaN();
+ $returnValue = Functions::NAN();
- $mArgs = array();
+ $mArgs = [];
// Loop through arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
foreach ($aArgs as $arg) {
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
@@ -2337,7 +2181,7 @@ class PHPExcel_Calculation_Statistical
if ($mValueCount == floor($mValueCount)) {
$returnValue = ($mArgs[$mValueCount--] + $mArgs[$mValueCount]) / 2;
} else {
- $mValueCount == floor($mValueCount);
+ $mValueCount = floor($mValueCount);
$returnValue = $mArgs[$mValueCount];
}
}
@@ -2345,9 +2189,8 @@ class PHPExcel_Calculation_Statistical
return $returnValue;
}
-
/**
- * MIN
+ * MIN.
*
* MIN returns the value of the element of the values passed that has the smallest value,
* with negative numbers considered smaller than positive numbers.
@@ -2355,105 +2198,109 @@ class PHPExcel_Calculation_Statistical
* Excel Function:
* MIN(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function MIN()
+ public static function MIN(...$args)
{
$returnValue = null;
// Loop through arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
foreach ($aArgs as $arg) {
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
- if ((is_null($returnValue)) || ($arg < $returnValue)) {
+ if (($returnValue === null) || ($arg < $returnValue)) {
$returnValue = $arg;
}
}
}
- if (is_null($returnValue)) {
+ if ($returnValue === null) {
return 0;
}
+
return $returnValue;
}
-
/**
- * MINA
+ * MINA.
*
* Returns the smallest value in a list of arguments, including numbers, text, and logical values
*
* Excel Function:
* MINA(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function MINA()
+ public static function MINA(...$args)
{
$returnValue = null;
// Loop through arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
foreach ($aArgs as $arg) {
// Is it a numeric value?
if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) && ($arg != '')))) {
if (is_bool($arg)) {
- $arg = (integer) $arg;
+ $arg = (int) $arg;
} elseif (is_string($arg)) {
$arg = 0;
}
- if ((is_null($returnValue)) || ($arg < $returnValue)) {
+ if (($returnValue === null) || ($arg < $returnValue)) {
$returnValue = $arg;
}
}
}
- if (is_null($returnValue)) {
+ if ($returnValue === null) {
return 0;
}
+
return $returnValue;
}
-
/**
- * MINIF
+ * MINIF.
*
* Returns the minimum value within a range of cells that contain numbers within the list of arguments
*
* Excel Function:
* MINIF(value1[,value2[, ...]],condition)
*
- * @access public
* @category Mathematical and Trigonometric Functions
- * @param mixed $arg,... Data values
- * @param string $condition The criteria that defines which cells will be checked.
- * @return float
+ *
+ * @param mixed $aArgs Data values
+ * @param string $condition the criteria that defines which cells will be checked
+ * @param mixed $sumArgs
+ *
+ * @return float
*/
- public static function MINIF($aArgs, $condition, $sumArgs = array())
+ public static function MINIF($aArgs, $condition, $sumArgs = [])
{
$returnValue = null;
- $aArgs = PHPExcel_Calculation_Functions::flattenArray($aArgs);
- $sumArgs = PHPExcel_Calculation_Functions::flattenArray($sumArgs);
+ $aArgs = Functions::flattenArray($aArgs);
+ $sumArgs = Functions::flattenArray($sumArgs);
if (empty($sumArgs)) {
$sumArgs = $aArgs;
}
- $condition = PHPExcel_Calculation_Functions::ifCondition($condition);
+ $condition = Functions::ifCondition($condition);
// Loop through arguments
foreach ($aArgs as $key => $arg) {
if (!is_numeric($arg)) {
- $arg = PHPExcel_Calculation::wrapResult(strtoupper($arg));
+ $arg = Calculation::wrapResult(strtoupper($arg));
}
- $testCondition = '='.$arg.$condition;
- if (PHPExcel_Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
- if ((is_null($returnValue)) || ($arg < $returnValue)) {
+ $testCondition = '=' . $arg . $condition;
+ if (Calculation::getInstance()->_calculateFormulaValue($testCondition)) {
+ if (($returnValue === null) || ($arg < $returnValue)) {
$returnValue = $arg;
}
}
@@ -2462,28 +2309,28 @@ class PHPExcel_Calculation_Statistical
return $returnValue;
}
-
//
// Special variant of array_count_values that isn't limited to strings and integers,
// but can work with floating point numbers as values
//
private static function modeCalc($data)
{
- $frequencyArray = array();
+ $frequencyArray = [];
foreach ($data as $datum) {
$found = false;
foreach ($frequencyArray as $key => $value) {
if ((string) $value['value'] == (string) $datum) {
++$frequencyArray[$key]['frequency'];
$found = true;
+
break;
}
}
if (!$found) {
- $frequencyArray[] = array(
- 'value' => $datum,
- 'frequency' => 1
- );
+ $frequencyArray[] = [
+ 'value' => $datum,
+ 'frequency' => 1,
+ ];
}
}
@@ -2494,33 +2341,34 @@ class PHPExcel_Calculation_Statistical
array_multisort($frequencyList, SORT_DESC, $valueList, SORT_ASC, SORT_NUMERIC, $frequencyArray);
if ($frequencyArray[0]['frequency'] == 1) {
- return PHPExcel_Calculation_Functions::NA();
+ return Functions::NA();
}
+
return $frequencyArray[0]['value'];
}
-
/**
- * MODE
+ * MODE.
*
* Returns the most frequently occurring, or repetitive, value in an array or range of data
*
* Excel Function:
* MODE(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function MODE()
+ public static function MODE(...$args)
{
- $returnValue = PHPExcel_Calculation_Functions::NA();
+ $returnValue = Functions::NA();
// Loop through arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
- $mArgs = array();
+ $mArgs = [];
foreach ($aArgs as $arg) {
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
@@ -2535,9 +2383,8 @@ class PHPExcel_Calculation_Statistical
return $returnValue;
}
-
/**
- * NEGBINOMDIST
+ * NEGBINOMDIST.
*
* Returns the negative binomial distribution. NEGBINOMDIST returns the probability that
* there will be number_f failures before the number_s-th success, when the constant
@@ -2545,159 +2392,162 @@ class PHPExcel_Calculation_Statistical
* distribution, except that the number of successes is fixed, and the number of trials is
* variable. Like the binomial, trials are assumed to be independent.
*
- * @param float $failures Number of Failures
- * @param float $successes Threshold number of Successes
- * @param float $probability Probability of success on each trial
- * @return float
+ * @param float $failures Number of Failures
+ * @param float $successes Threshold number of Successes
+ * @param float $probability Probability of success on each trial
*
+ * @return float
*/
public static function NEGBINOMDIST($failures, $successes, $probability)
{
- $failures = floor(PHPExcel_Calculation_Functions::flattenSingleValue($failures));
- $successes = floor(PHPExcel_Calculation_Functions::flattenSingleValue($successes));
- $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability);
+ $failures = floor(Functions::flattenSingleValue($failures));
+ $successes = floor(Functions::flattenSingleValue($successes));
+ $probability = Functions::flattenSingleValue($probability);
if ((is_numeric($failures)) && (is_numeric($successes)) && (is_numeric($probability))) {
if (($failures < 0) || ($successes < 1)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
} elseif (($probability < 0) || ($probability > 1)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- if (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_GNUMERIC) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_GNUMERIC) {
if (($failures + $successes - 1) <= 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
}
- return (PHPExcel_Calculation_MathTrig::COMBIN($failures + $successes - 1, $successes - 1)) * (pow($probability, $successes)) * (pow(1 - $probability, $failures));
+
+ return (MathTrig::COMBIN($failures + $successes - 1, $successes - 1)) * (pow($probability, $successes)) * (pow(1 - $probability, $failures));
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * NORMDIST
+ * NORMDIST.
*
* Returns the normal distribution for the specified mean and standard deviation. This
* function has a very wide range of applications in statistics, including hypothesis
* testing.
*
- * @param float $value
- * @param float $mean Mean Value
- * @param float $stdDev Standard Deviation
- * @param boolean $cumulative
- * @return float
+ * @param float $value
+ * @param float $mean Mean Value
+ * @param float $stdDev Standard Deviation
+ * @param bool $cumulative
*
+ * @return float
*/
public static function NORMDIST($value, $mean, $stdDev, $cumulative)
{
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean);
- $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev);
+ $value = Functions::flattenSingleValue($value);
+ $mean = Functions::flattenSingleValue($mean);
+ $stdDev = Functions::flattenSingleValue($stdDev);
if ((is_numeric($value)) && (is_numeric($mean)) && (is_numeric($stdDev))) {
if ($stdDev < 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if ((is_numeric($cumulative)) || (is_bool($cumulative))) {
if ($cumulative) {
- return 0.5 * (1 + PHPExcel_Calculation_Engineering::erfVal(($value - $mean) / ($stdDev * sqrt(2))));
- } else {
- return (1 / (SQRT2PI * $stdDev)) * exp(0 - (pow($value - $mean, 2) / (2 * ($stdDev * $stdDev))));
+ return 0.5 * (1 + Engineering::erfVal(($value - $mean) / ($stdDev * sqrt(2))));
}
+
+ return (1 / (self::SQRT2PI * $stdDev)) * exp(0 - (pow($value - $mean, 2) / (2 * ($stdDev * $stdDev))));
}
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * NORMINV
+ * NORMINV.
*
* Returns the inverse of the normal cumulative distribution for the specified mean and standard deviation.
*
- * @param float $value
- * @param float $mean Mean Value
- * @param float $stdDev Standard Deviation
- * @return float
+ * @param float $probability
+ * @param float $mean Mean Value
+ * @param float $stdDev Standard Deviation
*
+ * @return float
*/
public static function NORMINV($probability, $mean, $stdDev)
{
- $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability);
- $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean);
- $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev);
+ $probability = Functions::flattenSingleValue($probability);
+ $mean = Functions::flattenSingleValue($mean);
+ $stdDev = Functions::flattenSingleValue($stdDev);
if ((is_numeric($probability)) && (is_numeric($mean)) && (is_numeric($stdDev))) {
if (($probability < 0) || ($probability > 1)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if ($stdDev < 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
+
return (self::inverseNcdf($probability) * $stdDev) + $mean;
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * NORMSDIST
+ * NORMSDIST.
*
* Returns the standard normal cumulative distribution function. The distribution has
* a mean of 0 (zero) and a standard deviation of one. Use this function in place of a
* table of standard normal curve areas.
*
- * @param float $value
- * @return float
+ * @param float $value
+ *
+ * @return float
*/
public static function NORMSDIST($value)
{
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
+ $value = Functions::flattenSingleValue($value);
return self::NORMDIST($value, 0, 1, true);
}
-
/**
- * NORMSINV
+ * NORMSINV.
*
* Returns the inverse of the standard normal cumulative distribution
*
- * @param float $value
- * @return float
+ * @param float $value
+ *
+ * @return float
*/
public static function NORMSINV($value)
{
return self::NORMINV($value, 0, 1);
}
-
/**
- * PERCENTILE
+ * PERCENTILE.
*
* Returns the nth percentile of values in a range..
*
* Excel Function:
* PERCENTILE(value1[,value2[, ...]],entry)
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @param float $entry Percentile value in the range 0..1, inclusive.
- * @return float
+ *
+ * @param mixed $args Data values
+ * @param float $entry Percentile value in the range 0..1, inclusive.
+ *
+ * @return float
*/
- public static function PERCENTILE()
+ public static function PERCENTILE(...$args)
{
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
// Calculate
$entry = array_pop($aArgs);
if ((is_numeric($entry)) && (!is_string($entry))) {
if (($entry < 0) || ($entry > 1)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- $mArgs = array();
+ $mArgs = [];
foreach ($aArgs as $arg) {
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
@@ -2708,36 +2558,37 @@ class PHPExcel_Calculation_Statistical
if ($mValueCount > 0) {
sort($mArgs);
$count = self::COUNT($mArgs);
- $index = $entry * ($count-1);
+ $index = $entry * ($count - 1);
$iBase = floor($index);
if ($index == $iBase) {
return $mArgs[$index];
- } else {
- $iNext = $iBase + 1;
- $iProportion = $index - $iBase;
- return $mArgs[$iBase] + (($mArgs[$iNext] - $mArgs[$iBase]) * $iProportion) ;
}
+ $iNext = $iBase + 1;
+ $iProportion = $index - $iBase;
+
+ return $mArgs[$iBase] + (($mArgs[$iNext] - $mArgs[$iBase]) * $iProportion);
}
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * PERCENTRANK
+ * PERCENTRANK.
*
* Returns the rank of a value in a data set as a percentage of the data set.
*
- * @param array of number An array of, or a reference to, a list of numbers.
- * @param number The number whose rank you want to find.
- * @param number The number of significant digits for the returned percentage value.
- * @return float
+ * @param float[] $valueSet An array of, or a reference to, a list of numbers
+ * @param int $value the number whose rank you want to find
+ * @param int $significance the number of significant digits for the returned percentage value
+ *
+ * @return float
*/
public static function PERCENTRANK($valueSet, $value, $significance = 3)
{
- $valueSet = PHPExcel_Calculation_Functions::flattenArray($valueSet);
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $significance = (is_null($significance)) ? 3 : (integer) PHPExcel_Calculation_Functions::flattenSingleValue($significance);
+ $valueSet = Functions::flattenArray($valueSet);
+ $value = Functions::flattenSingleValue($value);
+ $significance = ($significance === null) ? 3 : (int) Functions::flattenSingleValue($significance);
foreach ($valueSet as $key => $valueEntry) {
if (!is_numeric($valueEntry)) {
@@ -2747,12 +2598,12 @@ class PHPExcel_Calculation_Statistical
sort($valueSet, SORT_NUMERIC);
$valueCount = count($valueSet);
if ($valueCount == 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
$valueAdjustor = $valueCount - 1;
if (($value < $valueSet[0]) || ($value > $valueSet[$valueAdjustor])) {
- return PHPExcel_Calculation_Functions::NA();
+ return Functions::NA();
}
$pos = array_search($value, $valueSet);
@@ -2769,9 +2620,8 @@ class PHPExcel_Calculation_Statistical
return round($pos / $valueAdjustor, $significance);
}
-
/**
- * PERMUT
+ * PERMUT.
*
* Returns the number of permutations for a given number of objects that can be
* selected from number objects. A permutation is any set or subset of objects or
@@ -2779,81 +2629,86 @@ class PHPExcel_Calculation_Statistical
* combinations, for which the internal order is not significant. Use this function
* for lottery-style probability calculations.
*
- * @param int $numObjs Number of different objects
- * @param int $numInSet Number of objects in each permutation
- * @return int Number of permutations
+ * @param int $numObjs Number of different objects
+ * @param int $numInSet Number of objects in each permutation
+ *
+ * @return int Number of permutations
*/
public static function PERMUT($numObjs, $numInSet)
{
- $numObjs = PHPExcel_Calculation_Functions::flattenSingleValue($numObjs);
- $numInSet = PHPExcel_Calculation_Functions::flattenSingleValue($numInSet);
+ $numObjs = Functions::flattenSingleValue($numObjs);
+ $numInSet = Functions::flattenSingleValue($numInSet);
if ((is_numeric($numObjs)) && (is_numeric($numInSet))) {
$numInSet = floor($numInSet);
if ($numObjs < $numInSet) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- return round(PHPExcel_Calculation_MathTrig::FACT($numObjs) / PHPExcel_Calculation_MathTrig::FACT($numObjs - $numInSet));
+
+ return round(MathTrig::FACT($numObjs) / MathTrig::FACT($numObjs - $numInSet));
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * POISSON
+ * POISSON.
*
* Returns the Poisson distribution. A common application of the Poisson distribution
* is predicting the number of events over a specific time, such as the number of
* cars arriving at a toll plaza in 1 minute.
*
- * @param float $value
- * @param float $mean Mean Value
- * @param boolean $cumulative
- * @return float
+ * @param float $value
+ * @param float $mean Mean Value
+ * @param bool $cumulative
*
+ * @return float
*/
public static function POISSON($value, $mean, $cumulative)
{
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean);
+ $value = Functions::flattenSingleValue($value);
+ $mean = Functions::flattenSingleValue($mean);
if ((is_numeric($value)) && (is_numeric($mean))) {
if (($value < 0) || ($mean <= 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if ((is_numeric($cumulative)) || (is_bool($cumulative))) {
if ($cumulative) {
$summer = 0;
- for ($i = 0; $i <= floor($value); ++$i) {
- $summer += pow($mean, $i) / PHPExcel_Calculation_MathTrig::FACT($i);
+ $floor = floor($value);
+ for ($i = 0; $i <= $floor; ++$i) {
+ $summer += pow($mean, $i) / MathTrig::FACT($i);
}
- return exp(0-$mean) * $summer;
- } else {
- return (exp(0-$mean) * pow($mean, $value)) / PHPExcel_Calculation_MathTrig::FACT($value);
+
+ return exp(0 - $mean) * $summer;
}
+
+ return (exp(0 - $mean) * pow($mean, $value)) / MathTrig::FACT($value);
}
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * QUARTILE
+ * QUARTILE.
*
* Returns the quartile of a data set.
*
* Excel Function:
* QUARTILE(value1[,value2[, ...]],entry)
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @param int $entry Quartile value in the range 1..3, inclusive.
- * @return float
+ *
+ * @param mixed $args Data values
+ * @param int $entry Quartile value in the range 1..3, inclusive.
+ *
+ * @return float
*/
- public static function QUARTILE()
+ public static function QUARTILE(...$args)
{
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
// Calculate
$entry = floor(array_pop($aArgs));
@@ -2861,29 +2716,31 @@ class PHPExcel_Calculation_Statistical
if ((is_numeric($entry)) && (!is_string($entry))) {
$entry /= 4;
if (($entry < 0) || ($entry > 1)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
+
return self::PERCENTILE($aArgs, $entry);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * RANK
+ * RANK.
*
* Returns the rank of a number in a list of numbers.
*
- * @param number The number whose rank you want to find.
- * @param array of number An array of, or a reference to, a list of numbers.
- * @param mixed Order to sort the values in the value set
- * @return float
+ * @param int $value the number whose rank you want to find
+ * @param float[] $valueSet An array of, or a reference to, a list of numbers
+ * @param int $order Order to sort the values in the value set
+ *
+ * @return float
*/
public static function RANK($value, $valueSet, $order = 0)
{
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $valueSet = PHPExcel_Calculation_Functions::flattenArray($valueSet);
- $order = (is_null($order)) ? 0 : (integer) PHPExcel_Calculation_Functions::flattenSingleValue($order);
+ $value = Functions::flattenSingleValue($value);
+ $valueSet = Functions::flattenArray($valueSet);
+ $order = ($order === null) ? 0 : (int) Functions::flattenSingleValue($order);
foreach ($valueSet as $key => $valueEntry) {
if (!is_numeric($valueEntry)) {
@@ -2898,55 +2755,56 @@ class PHPExcel_Calculation_Statistical
}
$pos = array_search($value, $valueSet);
if ($pos === false) {
- return PHPExcel_Calculation_Functions::NA();
+ return Functions::NA();
}
return ++$pos;
}
-
/**
- * RSQ
+ * RSQ.
*
* Returns the square of the Pearson product moment correlation coefficient through data points in known_y's and known_x's.
*
- * @param array of mixed Data Series Y
- * @param array of mixed Data Series X
- * @return float
+ * @param mixed[] $yValues Data Series Y
+ * @param mixed[] $xValues Data Series X
+ *
+ * @return float
*/
public static function RSQ($yValues, $xValues)
{
if (!self::checkTrendArrays($yValues, $xValues)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$yValueCount = count($yValues);
$xValueCount = count($xValues);
if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
- return PHPExcel_Calculation_Functions::NA();
+ return Functions::NA();
} elseif ($yValueCount == 1) {
- return PHPExcel_Calculation_Functions::DIV0();
+ return Functions::DIV0();
}
- $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues);
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues);
+
return $bestFitLinear->getGoodnessOfFit();
}
-
/**
- * SKEW
+ * SKEW.
*
* Returns the skewness of a distribution. Skewness characterizes the degree of asymmetry
* of a distribution around its mean. Positive skewness indicates a distribution with an
* asymmetric tail extending toward more positive values. Negative skewness indicates a
* distribution with an asymmetric tail extending toward more negative values.
*
- * @param array Data Series
- * @return float
+ * @param array ...$args Data Series
+ *
+ * @return float
*/
- public static function SKEW()
+ public static function SKEW(...$args)
{
- $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
+ $aArgs = Functions::flattenArrayIndexed($args);
$mean = self::AVERAGE($aArgs);
$stdDev = self::STDEV($aArgs);
@@ -2954,7 +2812,7 @@ class PHPExcel_Calculation_Statistical
// Loop through arguments
foreach ($aArgs as $k => $arg) {
if ((is_bool($arg)) &&
- (!PHPExcel_Calculation_Functions::isMatrixValue($k))) {
+ (!Functions::isMatrixValue($k))) {
} else {
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
@@ -2965,42 +2823,43 @@ class PHPExcel_Calculation_Statistical
}
if ($count > 2) {
- return $summer * ($count / (($count-1) * ($count-2)));
+ return $summer * ($count / (($count - 1) * ($count - 2)));
}
- return PHPExcel_Calculation_Functions::DIV0();
+
+ return Functions::DIV0();
}
-
/**
- * SLOPE
+ * SLOPE.
*
* Returns the slope of the linear regression line through data points in known_y's and known_x's.
*
- * @param array of mixed Data Series Y
- * @param array of mixed Data Series X
- * @return float
+ * @param mixed[] $yValues Data Series Y
+ * @param mixed[] $xValues Data Series X
+ *
+ * @return float
*/
public static function SLOPE($yValues, $xValues)
{
if (!self::checkTrendArrays($yValues, $xValues)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$yValueCount = count($yValues);
$xValueCount = count($xValues);
if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
- return PHPExcel_Calculation_Functions::NA();
+ return Functions::NA();
} elseif ($yValueCount == 1) {
- return PHPExcel_Calculation_Functions::DIV0();
+ return Functions::DIV0();
}
- $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues);
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues);
+
return $bestFitLinear->getSlope();
}
-
/**
- * SMALL
+ * SMALL.
*
* Returns the nth smallest value in a data set. You can use this function to
* select a value based on its relative standing.
@@ -3008,21 +2867,22 @@ class PHPExcel_Calculation_Statistical
* Excel Function:
* SMALL(value1[,value2[, ...]],entry)
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @param int $entry Position (ordered from the smallest) in the array or range of data to return
- * @return float
+ *
+ * @param mixed $args Data values
+ * @param int $entry Position (ordered from the smallest) in the array or range of data to return
+ *
+ * @return float
*/
- public static function SMALL()
+ public static function SMALL(...$args)
{
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
// Calculate
$entry = array_pop($aArgs);
if ((is_numeric($entry)) && (!is_string($entry))) {
- $mArgs = array();
+ $mArgs = [];
foreach ($aArgs as $arg) {
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
@@ -3032,43 +2892,46 @@ class PHPExcel_Calculation_Statistical
$count = self::COUNT($mArgs);
$entry = floor(--$entry);
if (($entry < 0) || ($entry >= $count) || ($count == 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
sort($mArgs);
+
return $mArgs[$entry];
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * STANDARDIZE
+ * STANDARDIZE.
*
* Returns a normalized value from a distribution characterized by mean and standard_dev.
*
- * @param float $value Value to normalize
- * @param float $mean Mean Value
- * @param float $stdDev Standard Deviation
- * @return float Standardized value
+ * @param float $value Value to normalize
+ * @param float $mean Mean Value
+ * @param float $stdDev Standard Deviation
+ *
+ * @return float Standardized value
*/
public static function STANDARDIZE($value, $mean, $stdDev)
{
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $mean = PHPExcel_Calculation_Functions::flattenSingleValue($mean);
- $stdDev = PHPExcel_Calculation_Functions::flattenSingleValue($stdDev);
+ $value = Functions::flattenSingleValue($value);
+ $mean = Functions::flattenSingleValue($mean);
+ $stdDev = Functions::flattenSingleValue($stdDev);
if ((is_numeric($value)) && (is_numeric($mean)) && (is_numeric($stdDev))) {
if ($stdDev <= 0) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- return ($value - $mean) / $stdDev ;
+
+ return ($value - $mean) / $stdDev;
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * STDEV
+ * STDEV.
*
* Estimates standard deviation based on a sample. The standard deviation is a measure of how
* widely values are dispersed from the average value (the mean).
@@ -3076,29 +2939,30 @@ class PHPExcel_Calculation_Statistical
* Excel Function:
* STDEV(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function STDEV()
+ public static function STDEV(...$args)
{
- $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
+ $aArgs = Functions::flattenArrayIndexed($args);
// Return value
$returnValue = null;
$aMean = self::AVERAGE($aArgs);
- if (!is_null($aMean)) {
+ if ($aMean !== null) {
$aCount = -1;
foreach ($aArgs as $k => $arg) {
if ((is_bool($arg)) &&
- ((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) {
- $arg = (integer) $arg;
+ ((!Functions::isCellValue($k)) || (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE))) {
+ $arg = (int) $arg;
}
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
- if (is_null($returnValue)) {
+ if ($returnValue === null) {
$returnValue = pow(($arg - $aMean), 2);
} else {
$returnValue += pow(($arg - $aMean), 2);
@@ -3112,44 +2976,45 @@ class PHPExcel_Calculation_Statistical
return sqrt($returnValue / $aCount);
}
}
- return PHPExcel_Calculation_Functions::DIV0();
+
+ return Functions::DIV0();
}
-
/**
- * STDEVA
+ * STDEVA.
*
* Estimates standard deviation based on a sample, including numbers, text, and logical values
*
* Excel Function:
* STDEVA(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function STDEVA()
+ public static function STDEVA(...$args)
{
- $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
+ $aArgs = Functions::flattenArrayIndexed($args);
$returnValue = null;
$aMean = self::AVERAGEA($aArgs);
- if (!is_null($aMean)) {
+ if ($aMean !== null) {
$aCount = -1;
foreach ($aArgs as $k => $arg) {
if ((is_bool($arg)) &&
- (!PHPExcel_Calculation_Functions::isMatrixValue($k))) {
+ (!Functions::isMatrixValue($k))) {
} else {
// Is it a numeric value?
if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) & ($arg != '')))) {
if (is_bool($arg)) {
- $arg = (integer) $arg;
+ $arg = (int) $arg;
} elseif (is_string($arg)) {
$arg = 0;
}
- if (is_null($returnValue)) {
+ if ($returnValue === null) {
$returnValue = pow(($arg - $aMean), 2);
} else {
$returnValue += pow(($arg - $aMean), 2);
@@ -3163,40 +3028,41 @@ class PHPExcel_Calculation_Statistical
return sqrt($returnValue / $aCount);
}
}
- return PHPExcel_Calculation_Functions::DIV0();
+
+ return Functions::DIV0();
}
-
/**
- * STDEVP
+ * STDEVP.
*
* Calculates standard deviation based on the entire population
*
* Excel Function:
* STDEVP(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function STDEVP()
+ public static function STDEVP(...$args)
{
- $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
+ $aArgs = Functions::flattenArrayIndexed($args);
$returnValue = null;
$aMean = self::AVERAGE($aArgs);
- if (!is_null($aMean)) {
+ if ($aMean !== null) {
$aCount = 0;
foreach ($aArgs as $k => $arg) {
if ((is_bool($arg)) &&
- ((!PHPExcel_Calculation_Functions::isCellValue($k)) || (PHPExcel_Calculation_Functions::getCompatibilityMode() == PHPExcel_Calculation_Functions::COMPATIBILITY_OPENOFFICE))) {
- $arg = (integer) $arg;
+ ((!Functions::isCellValue($k)) || (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE))) {
+ $arg = (int) $arg;
}
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
- if (is_null($returnValue)) {
+ if ($returnValue === null) {
$returnValue = pow(($arg - $aMean), 2);
} else {
$returnValue += pow(($arg - $aMean), 2);
@@ -3209,44 +3075,45 @@ class PHPExcel_Calculation_Statistical
return sqrt($returnValue / $aCount);
}
}
- return PHPExcel_Calculation_Functions::DIV0();
+
+ return Functions::DIV0();
}
-
/**
- * STDEVPA
+ * STDEVPA.
*
* Calculates standard deviation based on the entire population, including numbers, text, and logical values
*
* Excel Function:
* STDEVPA(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function STDEVPA()
+ public static function STDEVPA(...$args)
{
- $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
+ $aArgs = Functions::flattenArrayIndexed($args);
$returnValue = null;
$aMean = self::AVERAGEA($aArgs);
- if (!is_null($aMean)) {
+ if ($aMean !== null) {
$aCount = 0;
foreach ($aArgs as $k => $arg) {
if ((is_bool($arg)) &&
- (!PHPExcel_Calculation_Functions::isMatrixValue($k))) {
+ (!Functions::isMatrixValue($k))) {
} else {
// Is it a numeric value?
if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) & ($arg != '')))) {
if (is_bool($arg)) {
- $arg = (integer) $arg;
+ $arg = (int) $arg;
} elseif (is_string($arg)) {
$arg = 0;
}
- if (is_null($returnValue)) {
+ if ($returnValue === null) {
$returnValue = pow(($arg - $aMean), 2);
} else {
$returnValue += pow(($arg - $aMean), 2);
@@ -3260,57 +3127,59 @@ class PHPExcel_Calculation_Statistical
return sqrt($returnValue / $aCount);
}
}
- return PHPExcel_Calculation_Functions::DIV0();
+
+ return Functions::DIV0();
}
-
/**
- * STEYX
+ * STEYX.
*
* Returns the standard error of the predicted y-value for each x in the regression.
*
- * @param array of mixed Data Series Y
- * @param array of mixed Data Series X
- * @return float
+ * @param mixed[] $yValues Data Series Y
+ * @param mixed[] $xValues Data Series X
+ *
+ * @return float
*/
public static function STEYX($yValues, $xValues)
{
if (!self::checkTrendArrays($yValues, $xValues)) {
- return PHPExcel_Calculation_Functions::VALUE();
+ return Functions::VALUE();
}
$yValueCount = count($yValues);
$xValueCount = count($xValues);
if (($yValueCount == 0) || ($yValueCount != $xValueCount)) {
- return PHPExcel_Calculation_Functions::NA();
+ return Functions::NA();
} elseif ($yValueCount == 1) {
- return PHPExcel_Calculation_Functions::DIV0();
+ return Functions::DIV0();
}
- $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues);
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues);
+
return $bestFitLinear->getStdevOfResiduals();
}
-
/**
- * TDIST
+ * TDIST.
*
* Returns the probability of Student's T distribution.
*
- * @param float $value Value for the function
- * @param float $degrees degrees of freedom
- * @param float $tails number of tails (1 or 2)
- * @return float
+ * @param float $value Value for the function
+ * @param float $degrees degrees of freedom
+ * @param float $tails number of tails (1 or 2)
+ *
+ * @return float
*/
public static function TDIST($value, $degrees, $tails)
{
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $degrees = floor(PHPExcel_Calculation_Functions::flattenSingleValue($degrees));
- $tails = floor(PHPExcel_Calculation_Functions::flattenSingleValue($tails));
+ $value = Functions::flattenSingleValue($value);
+ $degrees = floor(Functions::flattenSingleValue($degrees));
+ $tails = floor(Functions::flattenSingleValue($tails));
if ((is_numeric($value)) && (is_numeric($degrees)) && (is_numeric($tails))) {
if (($value < 0) || ($degrees < 1) || ($tails < 1) || ($tails > 2)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
// tdist, which finds the probability that corresponds to a given value
// of t with k degrees of freedom. This algorithm is translated from a
@@ -3343,42 +3212,43 @@ class PHPExcel_Calculation_Statistical
}
$tsum *= $ts;
if (($degrees % 2) == 1) {
- $tsum = M_2DIVPI * ($tsum + $ttheta);
+ $tsum = Functions::M_2DIVPI * ($tsum + $ttheta);
}
$tValue = 0.5 * (1 + $tsum);
if ($tails == 1) {
return 1 - abs($tValue);
- } else {
- return 1 - abs((1 - $tValue) - $tValue);
}
+
+ return 1 - abs((1 - $tValue) - $tValue);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * TINV
+ * TINV.
*
* Returns the one-tailed probability of the chi-squared distribution.
*
- * @param float $probability Probability for the function
- * @param float $degrees degrees of freedom
- * @return float
+ * @param float $probability Probability for the function
+ * @param float $degrees degrees of freedom
+ *
+ * @return float
*/
public static function TINV($probability, $degrees)
{
- $probability = PHPExcel_Calculation_Functions::flattenSingleValue($probability);
- $degrees = floor(PHPExcel_Calculation_Functions::flattenSingleValue($degrees));
+ $probability = Functions::flattenSingleValue($probability);
+ $degrees = floor(Functions::flattenSingleValue($degrees));
if ((is_numeric($probability)) && (is_numeric($degrees))) {
$xLo = 100;
$xHi = 0;
$x = $xNew = 1;
- $dx = 1;
+ $dx = 1;
$i = 0;
- while ((abs($dx) > PRECISION) && ($i++ < MAX_ITERATIONS)) {
+ while ((abs($dx) > Functions::PRECISION) && ($i++ < self::MAX_ITERATIONS)) {
// Apply Newton-Raphson step
$result = self::TDIST($x, $degrees, 2);
$error = $result - $probability;
@@ -3403,39 +3273,41 @@ class PHPExcel_Calculation_Statistical
}
$x = $xNew;
}
- if ($i == MAX_ITERATIONS) {
- return PHPExcel_Calculation_Functions::NA();
+ if ($i == self::MAX_ITERATIONS) {
+ return Functions::NA();
}
+
return round($x, 12);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * TREND
+ * TREND.
*
- * Returns values along a linear trend
+ * Returns values along a linear Trend
*
- * @param array of mixed Data Series Y
- * @param array of mixed Data Series X
- * @param array of mixed Values of X for which we want to find Y
- * @param boolean A logical value specifying whether to force the intersect to equal 0.
- * @return array of float
+ * @param mixed[] $yValues Data Series Y
+ * @param mixed[] $xValues Data Series X
+ * @param mixed[] $newValues Values of X for which we want to find Y
+ * @param bool $const a logical value specifying whether to force the intersect to equal 0
+ *
+ * @return array of float
*/
- public static function TREND($yValues, $xValues = array(), $newValues = array(), $const = true)
+ public static function TREND($yValues, $xValues = [], $newValues = [], $const = true)
{
- $yValues = PHPExcel_Calculation_Functions::flattenArray($yValues);
- $xValues = PHPExcel_Calculation_Functions::flattenArray($xValues);
- $newValues = PHPExcel_Calculation_Functions::flattenArray($newValues);
- $const = (is_null($const)) ? true : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($const);
+ $yValues = Functions::flattenArray($yValues);
+ $xValues = Functions::flattenArray($xValues);
+ $newValues = Functions::flattenArray($newValues);
+ $const = ($const === null) ? true : (bool) Functions::flattenSingleValue($const);
- $bestFitLinear = trendClass::calculate(trendClass::TREND_LINEAR, $yValues, $xValues, $const);
+ $bestFitLinear = Trend::calculate(Trend::TREND_LINEAR, $yValues, $xValues, $const);
if (empty($newValues)) {
$newValues = $bestFitLinear->getXValues();
}
- $returnArray = array();
+ $returnArray = [];
foreach ($newValues as $xValue) {
$returnArray[0][] = $bestFitLinear->getValueOfYForX($xValue);
}
@@ -3443,9 +3315,8 @@ class PHPExcel_Calculation_Statistical
return $returnArray;
}
-
/**
- * TRIMMEAN
+ * TRIMMEAN.
*
* Returns the mean of the interior of a data set. TRIMMEAN calculates the mean
* taken by excluding a percentage of data points from the top and bottom tails
@@ -3454,24 +3325,25 @@ class PHPExcel_Calculation_Statistical
* Excel Function:
* TRIMEAN(value1[,value2[, ...]], $discard)
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @param float $discard Percentage to discard
- * @return float
+ *
+ * @param mixed $args Data values
+ * @param float $discard Percentage to discard
+ *
+ * @return float
*/
- public static function TRIMMEAN()
+ public static function TRIMMEAN(...$args)
{
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
// Calculate
$percent = array_pop($aArgs);
if ((is_numeric($percent)) && (!is_string($percent))) {
if (($percent < 0) || ($percent > 1)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
- $mArgs = array();
+ $mArgs = [];
foreach ($aArgs as $arg) {
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
@@ -3480,41 +3352,43 @@ class PHPExcel_Calculation_Statistical
}
$discard = floor(self::COUNT($mArgs) * $percent / 2);
sort($mArgs);
- for ($i=0; $i < $discard; ++$i) {
+ for ($i = 0; $i < $discard; ++$i) {
array_pop($mArgs);
array_shift($mArgs);
}
+
return self::AVERAGE($mArgs);
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * VARFunc
+ * VARFunc.
*
* Estimates variance based on a sample.
*
* Excel Function:
* VAR(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function VARFunc()
+ public static function VARFunc(...$args)
{
- $returnValue = PHPExcel_Calculation_Functions::DIV0();
+ $returnValue = Functions::DIV0();
$summerA = $summerB = 0;
// Loop through arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
$aCount = 0;
foreach ($aArgs as $arg) {
if (is_bool($arg)) {
- $arg = (integer) $arg;
+ $arg = (int) $arg;
}
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
@@ -3529,43 +3403,44 @@ class PHPExcel_Calculation_Statistical
$summerB *= $summerB;
$returnValue = ($summerA - $summerB) / ($aCount * ($aCount - 1));
}
+
return $returnValue;
}
-
/**
- * VARA
+ * VARA.
*
* Estimates variance based on a sample, including numbers, text, and logical values
*
* Excel Function:
* VARA(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function VARA()
+ public static function VARA(...$args)
{
- $returnValue = PHPExcel_Calculation_Functions::DIV0();
+ $returnValue = Functions::DIV0();
$summerA = $summerB = 0;
// Loop through arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
+ $aArgs = Functions::flattenArrayIndexed($args);
$aCount = 0;
foreach ($aArgs as $k => $arg) {
if ((is_string($arg)) &&
- (PHPExcel_Calculation_Functions::isValue($k))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ (Functions::isValue($k))) {
+ return Functions::VALUE();
} elseif ((is_string($arg)) &&
- (!PHPExcel_Calculation_Functions::isMatrixValue($k))) {
+ (!Functions::isMatrixValue($k))) {
} else {
// Is it a numeric value?
if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) & ($arg != '')))) {
if (is_bool($arg)) {
- $arg = (integer) $arg;
+ $arg = (int) $arg;
} elseif (is_string($arg)) {
$arg = 0;
}
@@ -3581,36 +3456,37 @@ class PHPExcel_Calculation_Statistical
$summerB *= $summerB;
$returnValue = ($summerA - $summerB) / ($aCount * ($aCount - 1));
}
+
return $returnValue;
}
-
/**
- * VARP
+ * VARP.
*
* Calculates variance based on the entire population
*
* Excel Function:
* VARP(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function VARP()
+ public static function VARP(...$args)
{
// Return value
- $returnValue = PHPExcel_Calculation_Functions::DIV0();
+ $returnValue = Functions::DIV0();
$summerA = $summerB = 0;
// Loop through arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
+ $aArgs = Functions::flattenArray($args);
$aCount = 0;
foreach ($aArgs as $arg) {
if (is_bool($arg)) {
- $arg = (integer) $arg;
+ $arg = (int) $arg;
}
// Is it a numeric value?
if ((is_numeric($arg)) && (!is_string($arg))) {
@@ -3625,43 +3501,44 @@ class PHPExcel_Calculation_Statistical
$summerB *= $summerB;
$returnValue = ($summerA - $summerB) / ($aCount * $aCount);
}
+
return $returnValue;
}
-
/**
- * VARPA
+ * VARPA.
*
* Calculates variance based on the entire population, including numbers, text, and logical values
*
* Excel Function:
* VARPA(value1[,value2[, ...]])
*
- * @access public
* @category Statistical Functions
- * @param mixed $arg,... Data values
- * @return float
+ *
+ * @param mixed ...$args Data values
+ *
+ * @return float
*/
- public static function VARPA()
+ public static function VARPA(...$args)
{
- $returnValue = PHPExcel_Calculation_Functions::DIV0();
+ $returnValue = Functions::DIV0();
$summerA = $summerB = 0;
// Loop through arguments
- $aArgs = PHPExcel_Calculation_Functions::flattenArrayIndexed(func_get_args());
+ $aArgs = Functions::flattenArrayIndexed($args);
$aCount = 0;
foreach ($aArgs as $k => $arg) {
if ((is_string($arg)) &&
- (PHPExcel_Calculation_Functions::isValue($k))) {
- return PHPExcel_Calculation_Functions::VALUE();
+ (Functions::isValue($k))) {
+ return Functions::VALUE();
} elseif ((is_string($arg)) &&
- (!PHPExcel_Calculation_Functions::isMatrixValue($k))) {
+ (!Functions::isMatrixValue($k))) {
} else {
// Is it a numeric value?
if ((is_numeric($arg)) || (is_bool($arg)) || ((is_string($arg) & ($arg != '')))) {
if (is_bool($arg)) {
- $arg = (integer) $arg;
+ $arg = (int) $arg;
} elseif (is_string($arg)) {
$arg = 0;
}
@@ -3677,69 +3554,68 @@ class PHPExcel_Calculation_Statistical
$summerB *= $summerB;
$returnValue = ($summerA - $summerB) / ($aCount * $aCount);
}
+
return $returnValue;
}
-
/**
- * WEIBULL
+ * WEIBULL.
*
* Returns the Weibull distribution. Use this distribution in reliability
* analysis, such as calculating a device's mean time to failure.
*
- * @param float $value
- * @param float $alpha Alpha Parameter
- * @param float $beta Beta Parameter
- * @param boolean $cumulative
- * @return float
+ * @param float $value
+ * @param float $alpha Alpha Parameter
+ * @param float $beta Beta Parameter
+ * @param bool $cumulative
*
+ * @return float
*/
public static function WEIBULL($value, $alpha, $beta, $cumulative)
{
- $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
- $alpha = PHPExcel_Calculation_Functions::flattenSingleValue($alpha);
- $beta = PHPExcel_Calculation_Functions::flattenSingleValue($beta);
+ $value = Functions::flattenSingleValue($value);
+ $alpha = Functions::flattenSingleValue($alpha);
+ $beta = Functions::flattenSingleValue($beta);
if ((is_numeric($value)) && (is_numeric($alpha)) && (is_numeric($beta))) {
if (($value < 0) || ($alpha <= 0) || ($beta <= 0)) {
- return PHPExcel_Calculation_Functions::NaN();
+ return Functions::NAN();
}
if ((is_numeric($cumulative)) || (is_bool($cumulative))) {
if ($cumulative) {
return 1 - exp(0 - pow($value / $beta, $alpha));
- } else {
- return ($alpha / pow($beta, $alpha)) * pow($value, $alpha - 1) * exp(0 - pow($value / $beta, $alpha));
}
+
+ return ($alpha / pow($beta, $alpha)) * pow($value, $alpha - 1) * exp(0 - pow($value / $beta, $alpha));
}
}
- return PHPExcel_Calculation_Functions::VALUE();
+
+ return Functions::VALUE();
}
-
/**
- * ZTEST
+ * ZTEST.
*
* Returns the Weibull distribution. Use this distribution in reliability
* analysis, such as calculating a device's mean time to failure.
*
- * @param float $dataSet
- * @param float $m0 Alpha Parameter
- * @param float $sigma Beta Parameter
- * @param boolean $cumulative
- * @return float
+ * @param float $dataSet
+ * @param float $m0 Alpha Parameter
+ * @param float $sigma Beta Parameter
*
+ * @return float
*/
public static function ZTEST($dataSet, $m0, $sigma = null)
{
- $dataSet = PHPExcel_Calculation_Functions::flattenArrayIndexed($dataSet);
- $m0 = PHPExcel_Calculation_Functions::flattenSingleValue($m0);
- $sigma = PHPExcel_Calculation_Functions::flattenSingleValue($sigma);
+ $dataSet = Functions::flattenArrayIndexed($dataSet);
+ $m0 = Functions::flattenSingleValue($m0);
+ $sigma = Functions::flattenSingleValue($sigma);
- if (is_null($sigma)) {
+ if ($sigma === null) {
$sigma = self::STDEV($dataSet);
}
$n = count($dataSet);
- return 1 - self::NORMSDIST((self::AVERAGE($dataSet) - $m0) / ($sigma / SQRT($n)));
+ return 1 - self::NORMSDIST((self::AVERAGE($dataSet) - $m0) / ($sigma / sqrt($n)));
}
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData.php
new file mode 100644
index 00000000000..e30b2ff7e89
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/TextData.php
@@ -0,0 +1,672 @@
+ 1) {
+ $character = mb_substr($characters, 0, 1, 'UTF-8');
+ }
+
+ return self::unicodeToOrd($character);
+ }
+
+ /**
+ * CONCATENATE.
+ *
+ * @return string
+ */
+ public static function CONCATENATE(...$args)
+ {
+ $returnValue = '';
+
+ // Loop through arguments
+ $aArgs = Functions::flattenArray($args);
+ foreach ($aArgs as $arg) {
+ if (is_bool($arg)) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
+ $arg = (int) $arg;
+ } else {
+ $arg = ($arg) ? Calculation::getTRUE() : Calculation::getFALSE();
+ }
+ }
+ $returnValue .= $arg;
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * DOLLAR.
+ *
+ * This function converts a number to text using currency format, with the decimals rounded to the specified place.
+ * The format used is $#,##0.00_);($#,##0.00)..
+ *
+ * @param float $value The value to format
+ * @param int $decimals The number of digits to display to the right of the decimal point.
+ * If decimals is negative, number is rounded to the left of the decimal point.
+ * If you omit decimals, it is assumed to be 2
+ *
+ * @return string
+ */
+ public static function DOLLAR($value = 0, $decimals = 2)
+ {
+ $value = Functions::flattenSingleValue($value);
+ $decimals = $decimals === null ? 0 : Functions::flattenSingleValue($decimals);
+
+ // Validate parameters
+ if (!is_numeric($value) || !is_numeric($decimals)) {
+ return Functions::NAN();
+ }
+ $decimals = floor($decimals);
+
+ $mask = '$#,##0';
+ if ($decimals > 0) {
+ $mask .= '.' . str_repeat('0', $decimals);
+ } else {
+ $round = pow(10, abs($decimals));
+ if ($value < 0) {
+ $round = 0 - $round;
+ }
+ $value = MathTrig::MROUND($value, $round);
+ }
+
+ return NumberFormat::toFormattedString($value, $mask);
+ }
+
+ /**
+ * SEARCHSENSITIVE.
+ *
+ * @param string $needle The string to look for
+ * @param string $haystack The string in which to look
+ * @param int $offset Offset within $haystack
+ *
+ * @return string
+ */
+ public static function SEARCHSENSITIVE($needle, $haystack, $offset = 1)
+ {
+ $needle = Functions::flattenSingleValue($needle);
+ $haystack = Functions::flattenSingleValue($haystack);
+ $offset = Functions::flattenSingleValue($offset);
+
+ if (!is_bool($needle)) {
+ if (is_bool($haystack)) {
+ $haystack = ($haystack) ? Calculation::getTRUE() : Calculation::getFALSE();
+ }
+
+ if (($offset > 0) && (StringHelper::countCharacters($haystack) > $offset)) {
+ if (StringHelper::countCharacters($needle) == 0) {
+ return $offset;
+ }
+
+ $pos = mb_strpos($haystack, $needle, --$offset, 'UTF-8');
+ if ($pos !== false) {
+ return ++$pos;
+ }
+ }
+ }
+
+ return Functions::VALUE();
+ }
+
+ /**
+ * SEARCHINSENSITIVE.
+ *
+ * @param string $needle The string to look for
+ * @param string $haystack The string in which to look
+ * @param int $offset Offset within $haystack
+ *
+ * @return string
+ */
+ public static function SEARCHINSENSITIVE($needle, $haystack, $offset = 1)
+ {
+ $needle = Functions::flattenSingleValue($needle);
+ $haystack = Functions::flattenSingleValue($haystack);
+ $offset = Functions::flattenSingleValue($offset);
+
+ if (!is_bool($needle)) {
+ if (is_bool($haystack)) {
+ $haystack = ($haystack) ? Calculation::getTRUE() : Calculation::getFALSE();
+ }
+
+ if (($offset > 0) && (StringHelper::countCharacters($haystack) > $offset)) {
+ if (StringHelper::countCharacters($needle) == 0) {
+ return $offset;
+ }
+
+ $pos = mb_stripos($haystack, $needle, --$offset, 'UTF-8');
+ if ($pos !== false) {
+ return ++$pos;
+ }
+ }
+ }
+
+ return Functions::VALUE();
+ }
+
+ /**
+ * FIXEDFORMAT.
+ *
+ * @param mixed $value Value to check
+ * @param int $decimals
+ * @param bool $no_commas
+ *
+ * @return string
+ */
+ public static function FIXEDFORMAT($value, $decimals = 2, $no_commas = false)
+ {
+ $value = Functions::flattenSingleValue($value);
+ $decimals = Functions::flattenSingleValue($decimals);
+ $no_commas = Functions::flattenSingleValue($no_commas);
+
+ // Validate parameters
+ if (!is_numeric($value) || !is_numeric($decimals)) {
+ return Functions::NAN();
+ }
+ $decimals = floor($decimals);
+
+ $valueResult = round($value, $decimals);
+ if ($decimals < 0) {
+ $decimals = 0;
+ }
+ if (!$no_commas) {
+ $valueResult = number_format($valueResult, $decimals);
+ }
+
+ return (string) $valueResult;
+ }
+
+ /**
+ * LEFT.
+ *
+ * @param string $value Value
+ * @param int $chars Number of characters
+ *
+ * @return string
+ */
+ public static function LEFT($value = '', $chars = 1)
+ {
+ $value = Functions::flattenSingleValue($value);
+ $chars = Functions::flattenSingleValue($chars);
+
+ if ($chars < 0) {
+ return Functions::VALUE();
+ }
+
+ if (is_bool($value)) {
+ $value = ($value) ? Calculation::getTRUE() : Calculation::getFALSE();
+ }
+
+ return mb_substr($value, 0, $chars, 'UTF-8');
+ }
+
+ /**
+ * MID.
+ *
+ * @param string $value Value
+ * @param int $start Start character
+ * @param int $chars Number of characters
+ *
+ * @return string
+ */
+ public static function MID($value = '', $start = 1, $chars = null)
+ {
+ $value = Functions::flattenSingleValue($value);
+ $start = Functions::flattenSingleValue($start);
+ $chars = Functions::flattenSingleValue($chars);
+
+ if (($start < 1) || ($chars < 0)) {
+ return Functions::VALUE();
+ }
+
+ if (is_bool($value)) {
+ $value = ($value) ? Calculation::getTRUE() : Calculation::getFALSE();
+ }
+
+ if (empty($chars)) {
+ return '';
+ }
+
+ return mb_substr($value, --$start, $chars, 'UTF-8');
+ }
+
+ /**
+ * RIGHT.
+ *
+ * @param string $value Value
+ * @param int $chars Number of characters
+ *
+ * @return string
+ */
+ public static function RIGHT($value = '', $chars = 1)
+ {
+ $value = Functions::flattenSingleValue($value);
+ $chars = Functions::flattenSingleValue($chars);
+
+ if ($chars < 0) {
+ return Functions::VALUE();
+ }
+
+ if (is_bool($value)) {
+ $value = ($value) ? Calculation::getTRUE() : Calculation::getFALSE();
+ }
+
+ return mb_substr($value, mb_strlen($value, 'UTF-8') - $chars, $chars, 'UTF-8');
+ }
+
+ /**
+ * STRINGLENGTH.
+ *
+ * @param string $value Value
+ *
+ * @return int
+ */
+ public static function STRINGLENGTH($value = '')
+ {
+ $value = Functions::flattenSingleValue($value);
+
+ if (is_bool($value)) {
+ $value = ($value) ? Calculation::getTRUE() : Calculation::getFALSE();
+ }
+
+ return mb_strlen($value, 'UTF-8');
+ }
+
+ /**
+ * LOWERCASE.
+ *
+ * Converts a string value to upper case.
+ *
+ * @param string $mixedCaseString
+ *
+ * @return string
+ */
+ public static function LOWERCASE($mixedCaseString)
+ {
+ $mixedCaseString = Functions::flattenSingleValue($mixedCaseString);
+
+ if (is_bool($mixedCaseString)) {
+ $mixedCaseString = ($mixedCaseString) ? Calculation::getTRUE() : Calculation::getFALSE();
+ }
+
+ return StringHelper::strToLower($mixedCaseString);
+ }
+
+ /**
+ * UPPERCASE.
+ *
+ * Converts a string value to upper case.
+ *
+ * @param string $mixedCaseString
+ *
+ * @return string
+ */
+ public static function UPPERCASE($mixedCaseString)
+ {
+ $mixedCaseString = Functions::flattenSingleValue($mixedCaseString);
+
+ if (is_bool($mixedCaseString)) {
+ $mixedCaseString = ($mixedCaseString) ? Calculation::getTRUE() : Calculation::getFALSE();
+ }
+
+ return StringHelper::strToUpper($mixedCaseString);
+ }
+
+ /**
+ * PROPERCASE.
+ *
+ * Converts a string value to upper case.
+ *
+ * @param string $mixedCaseString
+ *
+ * @return string
+ */
+ public static function PROPERCASE($mixedCaseString)
+ {
+ $mixedCaseString = Functions::flattenSingleValue($mixedCaseString);
+
+ if (is_bool($mixedCaseString)) {
+ $mixedCaseString = ($mixedCaseString) ? Calculation::getTRUE() : Calculation::getFALSE();
+ }
+
+ return StringHelper::strToTitle($mixedCaseString);
+ }
+
+ /**
+ * REPLACE.
+ *
+ * @param string $oldText String to modify
+ * @param int $start Start character
+ * @param int $chars Number of characters
+ * @param string $newText String to replace in defined position
+ *
+ * @return string
+ */
+ public static function REPLACE($oldText, $start, $chars, $newText)
+ {
+ $oldText = Functions::flattenSingleValue($oldText);
+ $start = Functions::flattenSingleValue($start);
+ $chars = Functions::flattenSingleValue($chars);
+ $newText = Functions::flattenSingleValue($newText);
+
+ $left = self::LEFT($oldText, $start - 1);
+ $right = self::RIGHT($oldText, self::STRINGLENGTH($oldText) - ($start + $chars) + 1);
+
+ return $left . $newText . $right;
+ }
+
+ /**
+ * SUBSTITUTE.
+ *
+ * @param string $text Value
+ * @param string $fromText From Value
+ * @param string $toText To Value
+ * @param int $instance Instance Number
+ *
+ * @return string
+ */
+ public static function SUBSTITUTE($text = '', $fromText = '', $toText = '', $instance = 0)
+ {
+ $text = Functions::flattenSingleValue($text);
+ $fromText = Functions::flattenSingleValue($fromText);
+ $toText = Functions::flattenSingleValue($toText);
+ $instance = floor(Functions::flattenSingleValue($instance));
+
+ if ($instance == 0) {
+ return str_replace($fromText, $toText, $text);
+ }
+
+ $pos = -1;
+ while ($instance > 0) {
+ $pos = mb_strpos($text, $fromText, $pos + 1, 'UTF-8');
+ if ($pos === false) {
+ break;
+ }
+ --$instance;
+ }
+
+ if ($pos !== false) {
+ return self::REPLACE($text, ++$pos, mb_strlen($fromText, 'UTF-8'), $toText);
+ }
+
+ return $text;
+ }
+
+ /**
+ * RETURNSTRING.
+ *
+ * @param mixed $testValue Value to check
+ *
+ * @return null|string
+ */
+ public static function RETURNSTRING($testValue = '')
+ {
+ $testValue = Functions::flattenSingleValue($testValue);
+
+ if (is_string($testValue)) {
+ return $testValue;
+ }
+
+ return null;
+ }
+
+ /**
+ * TEXTFORMAT.
+ *
+ * @param mixed $value Value to check
+ * @param string $format Format mask to use
+ *
+ * @return string
+ */
+ public static function TEXTFORMAT($value, $format)
+ {
+ $value = Functions::flattenSingleValue($value);
+ $format = Functions::flattenSingleValue($format);
+
+ if ((is_string($value)) && (!is_numeric($value)) && Date::isDateTimeFormatCode($format)) {
+ $value = DateTime::DATEVALUE($value);
+ }
+
+ return (string) NumberFormat::toFormattedString($value, $format);
+ }
+
+ /**
+ * VALUE.
+ *
+ * @param mixed $value Value to check
+ *
+ * @return bool
+ */
+ public static function VALUE($value = '')
+ {
+ $value = Functions::flattenSingleValue($value);
+
+ if (!is_numeric($value)) {
+ $numberValue = str_replace(
+ StringHelper::getThousandsSeparator(),
+ '',
+ trim($value, " \t\n\r\0\x0B" . StringHelper::getCurrencyCode())
+ );
+ if (is_numeric($numberValue)) {
+ return (float) $numberValue;
+ }
+
+ $dateSetting = Functions::getReturnDateType();
+ Functions::setReturnDateType(Functions::RETURNDATE_EXCEL);
+
+ if (strpos($value, ':') !== false) {
+ $timeValue = DateTime::TIMEVALUE($value);
+ if ($timeValue !== Functions::VALUE()) {
+ Functions::setReturnDateType($dateSetting);
+
+ return $timeValue;
+ }
+ }
+ $dateValue = DateTime::DATEVALUE($value);
+ if ($dateValue !== Functions::VALUE()) {
+ Functions::setReturnDateType($dateSetting);
+
+ return $dateValue;
+ }
+ Functions::setReturnDateType($dateSetting);
+
+ return Functions::VALUE();
+ }
+
+ return (float) $value;
+ }
+
+ /**
+ * NUMBERVALUE.
+ *
+ * @param mixed $value Value to check
+ * @param string $decimalSeparator decimal separator, defaults to locale defined value
+ * @param string $groupSeparator group/thosands separator, defaults to locale defined value
+ *
+ * @return float|string
+ */
+ public static function NUMBERVALUE($value = '', $decimalSeparator = null, $groupSeparator = null)
+ {
+ $value = Functions::flattenSingleValue($value);
+ $decimalSeparator = Functions::flattenSingleValue($decimalSeparator);
+ $groupSeparator = Functions::flattenSingleValue($groupSeparator);
+
+ if (!is_numeric($value)) {
+ $decimalSeparator = empty($decimalSeparator) ? StringHelper::getDecimalSeparator() : $decimalSeparator;
+ $groupSeparator = empty($groupSeparator) ? StringHelper::getThousandsSeparator() : $groupSeparator;
+
+ $decimalPositions = preg_match_all('/' . preg_quote($decimalSeparator) . '/', $value, $matches, PREG_OFFSET_CAPTURE);
+ if ($decimalPositions > 1) {
+ return Functions::VALUE();
+ }
+ $decimalOffset = array_pop($matches[0])[1];
+ if (strpos($value, $groupSeparator, $decimalOffset) !== false) {
+ return Functions::VALUE();
+ }
+
+ $value = str_replace([$groupSeparator, $decimalSeparator], ['', '.'], $value);
+
+ // Handle the special case of trailing % signs
+ $percentageString = rtrim($value, '%');
+ if (!is_numeric($percentageString)) {
+ return Functions::VALUE();
+ }
+
+ $percentageAdjustment = strlen($value) - strlen($percentageString);
+ if ($percentageAdjustment) {
+ $value = (float) $percentageString;
+ $value /= pow(10, $percentageAdjustment * 2);
+ }
+ }
+
+ return (float) $value;
+ }
+
+ /**
+ * Compares two text strings and returns TRUE if they are exactly the same, FALSE otherwise.
+ * EXACT is case-sensitive but ignores formatting differences.
+ * Use EXACT to test text being entered into a document.
+ *
+ * @param $value1
+ * @param $value2
+ *
+ * @return bool
+ */
+ public static function EXACT($value1, $value2)
+ {
+ $value1 = Functions::flattenSingleValue($value1);
+ $value2 = Functions::flattenSingleValue($value2);
+
+ return (string) $value2 === (string) $value1;
+ }
+
+ /**
+ * TEXTJOIN.
+ *
+ * @param mixed $delimiter
+ * @param mixed $ignoreEmpty
+ * @param mixed $args
+ *
+ * @return string
+ */
+ public static function TEXTJOIN($delimiter, $ignoreEmpty, ...$args)
+ {
+ // Loop through arguments
+ $aArgs = Functions::flattenArray($args);
+ foreach ($aArgs as $key => &$arg) {
+ if ($ignoreEmpty && trim($arg) == '') {
+ unset($aArgs[$key]);
+ } elseif (is_bool($arg)) {
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
+ $arg = (int) $arg;
+ } else {
+ $arg = ($arg) ? Calculation::getTRUE() : Calculation::getFALSE();
+ }
+ }
+ }
+
+ return implode($delimiter, $aArgs);
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Token/Stack.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Token/Stack.php
new file mode 100644
index 00000000000..b8dccf95c2f
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/Token/Stack.php
@@ -0,0 +1,93 @@
+count;
+ }
+
+ /**
+ * Push a new entry onto the stack.
+ *
+ * @param mixed $type
+ * @param mixed $value
+ * @param mixed $reference
+ */
+ public function push($type, $value, $reference = null)
+ {
+ $this->stack[$this->count++] = [
+ 'type' => $type,
+ 'value' => $value,
+ 'reference' => $reference,
+ ];
+ if ($type == 'Function') {
+ $localeFunction = Calculation::localeFunc($value);
+ if ($localeFunction != $value) {
+ $this->stack[($this->count - 1)]['localeValue'] = $localeFunction;
+ }
+ }
+ }
+
+ /**
+ * Pop the last entry from the stack.
+ *
+ * @return mixed
+ */
+ public function pop()
+ {
+ if ($this->count > 0) {
+ return $this->stack[--$this->count];
+ }
+
+ return null;
+ }
+
+ /**
+ * Return an entry from the stack without removing it.
+ *
+ * @param int $n number indicating how far back in the stack we want to look
+ *
+ * @return mixed
+ */
+ public function last($n = 1)
+ {
+ if ($this->count - $n < 0) {
+ return null;
+ }
+
+ return $this->stack[$this->count - $n];
+ }
+
+ /**
+ * Clear the stack.
+ */
+ public function clear()
+ {
+ $this->stack = [];
+ $this->count = 0;
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Calculation/functionlist.txt b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/functionlist.txt
similarity index 90%
rename from lib/phpexcel/PHPExcel/Calculation/functionlist.txt
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/functionlist.txt
index 67dbd49cf55..ee87c17f63c 100644
--- a/lib/phpexcel/PHPExcel/Calculation/functionlist.txt
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/functionlist.txt
@@ -3,6 +3,8 @@ ACCRINT
ACCRINTM
ACOS
ACOSH
+ACOT
+ACOTH
ADDRESS
AMORDEGRC
AMORLINC
@@ -30,6 +32,11 @@ BIN2DEC
BIN2HEX
BIN2OCT
BINOMDIST
+BITAND
+BITLSHIFT
+BITOR
+BITRSHIFT
+BITXOR
CEILING
CELL
CHAR
@@ -43,12 +50,15 @@ COLUMN
COLUMNS
COMBIN
COMPLEX
+CONCAT
CONCATENATE
CONFIDENCE
CONVERT
CORREL
COS
COSH
+COT
+COTH
COUNT
COUNTA
COUNTBLANK
@@ -62,6 +72,8 @@ COUPNUM
COUPPCD
COVAR
CRITBINOM
+CSC
+CSCH
CUBEKPIMEMBER
CUBEMEMBER
CUBEMEMBERPROPERTY
@@ -76,6 +88,7 @@ DATEDIF
DATEVALUE
DAVERAGE
DAY
+DAYS
DAYS360
DB
DCOUNT
@@ -105,7 +118,9 @@ EDATE
EFFECT
EOMONTH
ERF
+ERF.PRECISE
ERFC
+ERFC.PRECISE
ERROR.TYPE
EVEN
EXACT
@@ -149,6 +164,10 @@ IMAGINARY
IMARGUMENT
IMCONJUGATE
IMCOS
+IMCOSH
+IMCOT
+IMCSC
+IMCSCH
IMEXP
IMLN
IMLOG10
@@ -156,10 +175,14 @@ IMLOG2
IMPOWER
IMPRODUCT
IMREAL
+IMSEC
+IMSECH
IMSIN
+IMSINH
IMSQRT
IMSUB
IMSUM
+IMTAN
INDEX
INDIRECT
INFO
@@ -177,6 +200,7 @@ ISNA
ISNONTEXT
ISNUMBER
ISODD
+ISOWEEKNUM
ISPMT
ISREF
ISTEXT
@@ -229,6 +253,7 @@ NOT
NOW
NPER
NPV
+NUMBERVALUE
OCT2BIN
OCT2DEC
OCT2HEX
@@ -239,6 +264,7 @@ ODDLPRICE
ODDLYIELD
OFFSET
OR
+PDURATION
PEARSON
PERCENTILE
PERCENTRANK
@@ -275,10 +301,13 @@ ROUNDDOWN
ROUNDUP
ROW
ROWS
+RRI
RSQ
RTD
SEARCH
SEARCHB
+SEC
+SECH
SECOND
SERIESSUM
SIGN
@@ -292,6 +321,8 @@ SQRT
SQRTPI
STANDARDIZE
STDEV
+STDEV.A
+STDEV.P
STDEVA
STDEVP
STDEVPA
@@ -315,6 +346,7 @@ TBILLPRICE
TBILLYIELD
TDIST
TEXT
+TEXTJOIN
TIME
TIMEVALUE
TINV
@@ -327,6 +359,8 @@ TRUE
TRUNC
TTEST
TYPE
+UNICHAR
+UNIORD
UPPER
USDOLLAR
VALUE
@@ -335,7 +369,6 @@ VARA
VARP
VARPA
VDB
-VERSION
VLOOKUP
WEEKDAY
WEEKNUM
@@ -343,6 +376,7 @@ WEIBULL
WORKDAY
XIRR
XNPV
+XOR
YEAR
YEARFRAC
YIELD
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/bg/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/bg/config
new file mode 100644
index 00000000000..86f94d36218
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/bg/config
@@ -0,0 +1,27 @@
+##
+## PhpSpreadsheet
+##
+##
+##
+
+
+ArgumentSeparator = ;
+
+
+##
+## (For future use)
+##
+currencySymbol = лв
+
+
+##
+## Excel Error Codes (For future use)
+
+##
+NULL = #ПРАЗНО!
+DIV0 = #ДЕЛ/0!
+VALUE = #СТОЙНОСТ!
+REF = #РЕФ!
+NAME = #ИМЕ?
+NUM = #ЧИСЛО!
+NA = #Н/Д
diff --git a/lib/phpexcel/PHPExcel/locale/ru/functions b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/bg/functions
similarity index 97%
rename from lib/phpexcel/PHPExcel/locale/ru/functions
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/bg/functions
index 5ff6d4fbfe9..4bc1574ee27 100644
--- a/lib/phpexcel/PHPExcel/locale/ru/functions
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/bg/functions
@@ -1,438 +1,417 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Calculation
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-## Data in this file derived from information provided by web-junior (http://www.web-junior.net/)
-##
-##
-
-
-##
-## Add-in and Automation functions Функции надстроек и автоматизации
-##
-GETPIVOTDATA = ПОЛУЧИТЬ.ДАННЫЕ.СВОДНОЙ.ТАБЛИЦЫ ## Возвращает данные, хранящиеся в отчете сводной таблицы.
-
-
-##
-## Cube functions Функции Куб
-##
-CUBEKPIMEMBER = КУБЭЛЕМЕНТКИП ## Возвращает свойство ключевого индикатора производительности «(КИП)» и отображает имя «КИП» в ячейке. «КИП» представляет собой количественную величину, такую как ежемесячная валовая прибыль или ежеквартальная текучесть кадров, используемой для контроля эффективности работы организации.
-CUBEMEMBER = КУБЭЛЕМЕНТ ## Возвращает элемент или кортеж из куба. Используется для проверки существования элемента или кортежа в кубе.
-CUBEMEMBERPROPERTY = КУБСВОЙСТВОЭЛЕМЕНТА ## Возвращает значение свойства элемента из куба. Используется для проверки существования имени элемента в кубе и возвращает указанное свойство для этого элемента.
-CUBERANKEDMEMBER = КУБПОРЭЛЕМЕНТ ## Возвращает n-ый или ранжированный элемент в множество. Используется для возвращения одного или нескольких элементов в множество, например, лучшего продавца или 10 лучших студентов.
-CUBESET = КУБМНОЖ ## Определяет вычислительное множество элементов или кортежей, отправляя на сервер выражение, которое создает множество, а затем возвращает его в Microsoft Office Excel.
-CUBESETCOUNT = КУБЧИСЛОЭЛМНОЖ ## Возвращает число элементов множества.
-CUBEVALUE = КУБЗНАЧЕНИЕ ## Возвращает обобщенное значение из куба.
-
-
-##
-## Database functions Функции для работы с базами данных
-##
-DAVERAGE = ДСРЗНАЧ ## Возвращает среднее значение выбранных записей базы данных.
-DCOUNT = БСЧЁТ ## Подсчитывает количество числовых ячеек в базе данных.
-DCOUNTA = БСЧЁТА ## Подсчитывает количество непустых ячеек в базе данных.
-DGET = БИЗВЛЕЧЬ ## Извлекает из базы данных одну запись, удовлетворяющую заданному условию.
-DMAX = ДМАКС ## Возвращает максимальное значение среди выделенных записей базы данных.
-DMIN = ДМИН ## Возвращает минимальное значение среди выделенных записей базы данных.
-DPRODUCT = БДПРОИЗВЕД ## Перемножает значения определенного поля в записях базы данных, удовлетворяющих условию.
-DSTDEV = ДСТАНДОТКЛ ## Оценивает стандартное отклонение по выборке для выделенных записей базы данных.
-DSTDEVP = ДСТАНДОТКЛП ## Вычисляет стандартное отклонение по генеральной совокупности для выделенных записей базы данных
-DSUM = БДСУММ ## Суммирует числа в поле для записей базы данных, удовлетворяющих условию.
-DVAR = БДДИСП ## Оценивает дисперсию по выборке из выделенных записей базы данных
-DVARP = БДДИСПП ## Вычисляет дисперсию по генеральной совокупности для выделенных записей базы данных
-
-
-##
-## Date and time functions Функции даты и времени
-##
-DATE = ДАТА ## Возвращает заданную дату в числовом формате.
-DATEVALUE = ДАТАЗНАЧ ## Преобразует дату из текстового формата в числовой формат.
-DAY = ДЕНЬ ## Преобразует дату в числовом формате в день месяца.
-DAYS360 = ДНЕЙ360 ## Вычисляет количество дней между двумя датами на основе 360-дневного года.
-EDATE = ДАТАМЕС ## Возвращает дату в числовом формате, отстоящую на заданное число месяцев вперед или назад от начальной даты.
-EOMONTH = КОНМЕСЯЦА ## Возвращает дату в числовом формате для последнего дня месяца, отстоящего вперед или назад на заданное число месяцев.
-HOUR = ЧАС ## Преобразует дату в числовом формате в часы.
-MINUTE = МИНУТЫ ## Преобразует дату в числовом формате в минуты.
-MONTH = МЕСЯЦ ## Преобразует дату в числовом формате в месяцы.
-NETWORKDAYS = ЧИСТРАБДНИ ## Возвращает количество рабочих дней между двумя датами.
-NOW = ТДАТА ## Возвращает текущую дату и время в числовом формате.
-SECOND = СЕКУНДЫ ## Преобразует дату в числовом формате в секунды.
-TIME = ВРЕМЯ ## Возвращает заданное время в числовом формате.
-TIMEVALUE = ВРЕМЗНАЧ ## Преобразует время из текстового формата в числовой формат.
-TODAY = СЕГОДНЯ ## Возвращает текущую дату в числовом формате.
-WEEKDAY = ДЕНЬНЕД ## Преобразует дату в числовом формате в день недели.
-WEEKNUM = НОМНЕДЕЛИ ## Преобразует числовое представление в число, которое указывает, на какую неделю года приходится указанная дата.
-WORKDAY = РАБДЕНЬ ## Возвращает дату в числовом формате, отстоящую вперед или назад на заданное количество рабочих дней.
-YEAR = ГОД ## Преобразует дату в числовом формате в год.
-YEARFRAC = ДОЛЯГОДА ## Возвращает долю года, которую составляет количество дней между начальной и конечной датами.
-
-
-##
-## Engineering functions Инженерные функции
-##
-BESSELI = БЕССЕЛЬ.I ## Возвращает модифицированную функцию Бесселя In(x).
-BESSELJ = БЕССЕЛЬ.J ## Возвращает функцию Бесселя Jn(x).
-BESSELK = БЕССЕЛЬ.K ## Возвращает модифицированную функцию Бесселя Kn(x).
-BESSELY = БЕССЕЛЬ.Y ## Возвращает функцию Бесселя Yn(x).
-BIN2DEC = ДВ.В.ДЕС ## Преобразует двоичное число в десятичное.
-BIN2HEX = ДВ.В.ШЕСТН ## Преобразует двоичное число в шестнадцатеричное.
-BIN2OCT = ДВ.В.ВОСЬМ ## Преобразует двоичное число в восьмеричное.
-COMPLEX = КОМПЛЕКСН ## Преобразует коэффициенты при вещественной и мнимой частях комплексного числа в комплексное число.
-CONVERT = ПРЕОБР ## Преобразует число из одной системы единиц измерения в другую.
-DEC2BIN = ДЕС.В.ДВ ## Преобразует десятичное число в двоичное.
-DEC2HEX = ДЕС.В.ШЕСТН ## Преобразует десятичное число в шестнадцатеричное.
-DEC2OCT = ДЕС.В.ВОСЬМ ## Преобразует десятичное число в восьмеричное.
-DELTA = ДЕЛЬТА ## Проверяет равенство двух значений.
-ERF = ФОШ ## Возвращает функцию ошибки.
-ERFC = ДФОШ ## Возвращает дополнительную функцию ошибки.
-GESTEP = ПОРОГ ## Проверяет, не превышает ли данное число порогового значения.
-HEX2BIN = ШЕСТН.В.ДВ ## Преобразует шестнадцатеричное число в двоичное.
-HEX2DEC = ШЕСТН.В.ДЕС ## Преобразует шестнадцатеричное число в десятичное.
-HEX2OCT = ШЕСТН.В.ВОСЬМ ## Преобразует шестнадцатеричное число в восьмеричное.
-IMABS = МНИМ.ABS ## Возвращает абсолютную величину (модуль) комплексного числа.
-IMAGINARY = МНИМ.ЧАСТЬ ## Возвращает коэффициент при мнимой части комплексного числа.
-IMARGUMENT = МНИМ.АРГУМЕНТ ## Возвращает значение аргумента комплексного числа (тета) — угол, выраженный в радианах.
-IMCONJUGATE = МНИМ.СОПРЯЖ ## Возвращает комплексно-сопряженное комплексное число.
-IMCOS = МНИМ.COS ## Возвращает косинус комплексного числа.
-IMDIV = МНИМ.ДЕЛ ## Возвращает частное от деления двух комплексных чисел.
-IMEXP = МНИМ.EXP ## Возвращает экспоненту комплексного числа.
-IMLN = МНИМ.LN ## Возвращает натуральный логарифм комплексного числа.
-IMLOG10 = МНИМ.LOG10 ## Возвращает обычный (десятичный) логарифм комплексного числа.
-IMLOG2 = МНИМ.LOG2 ## Возвращает двоичный логарифм комплексного числа.
-IMPOWER = МНИМ.СТЕПЕНЬ ## Возвращает комплексное число, возведенное в целую степень.
-IMPRODUCT = МНИМ.ПРОИЗВЕД ## Возвращает произведение от 2 до 29 комплексных чисел.
-IMREAL = МНИМ.ВЕЩ ## Возвращает коэффициент при вещественной части комплексного числа.
-IMSIN = МНИМ.SIN ## Возвращает синус комплексного числа.
-IMSQRT = МНИМ.КОРЕНЬ ## Возвращает значение квадратного корня из комплексного числа.
-IMSUB = МНИМ.РАЗН ## Возвращает разность двух комплексных чисел.
-IMSUM = МНИМ.СУММ ## Возвращает сумму комплексных чисел.
-OCT2BIN = ВОСЬМ.В.ДВ ## Преобразует восьмеричное число в двоичное.
-OCT2DEC = ВОСЬМ.В.ДЕС ## Преобразует восьмеричное число в десятичное.
-OCT2HEX = ВОСЬМ.В.ШЕСТН ## Преобразует восьмеричное число в шестнадцатеричное.
-
-
-##
-## Financial functions Финансовые функции
-##
-ACCRINT = НАКОПДОХОД ## Возвращает накопленный процент по ценным бумагам с периодической выплатой процентов.
-ACCRINTM = НАКОПДОХОДПОГАШ ## Возвращает накопленный процент по ценным бумагам, проценты по которым выплачиваются в срок погашения.
-AMORDEGRC = АМОРУМ ## Возвращает величину амортизации для каждого периода, используя коэффициент амортизации.
-AMORLINC = АМОРУВ ## Возвращает величину амортизации для каждого периода.
-COUPDAYBS = ДНЕЙКУПОНДО ## Возвращает количество дней от начала действия купона до даты соглашения.
-COUPDAYS = ДНЕЙКУПОН ## Возвращает число дней в периоде купона, содержащем дату соглашения.
-COUPDAYSNC = ДНЕЙКУПОНПОСЛЕ ## Возвращает число дней от даты соглашения до срока следующего купона.
-COUPNCD = ДАТАКУПОНПОСЛЕ ## Возвращает следующую дату купона после даты соглашения.
-COUPNUM = ЧИСЛКУПОН ## Возвращает количество купонов, которые могут быть оплачены между датой соглашения и сроком вступления в силу.
-COUPPCD = ДАТАКУПОНДО ## Возвращает предыдущую дату купона перед датой соглашения.
-CUMIPMT = ОБЩПЛАТ ## Возвращает общую выплату, произведенную между двумя периодическими выплатами.
-CUMPRINC = ОБЩДОХОД ## Возвращает общую выплату по займу между двумя периодами.
-DB = ФУО ## Возвращает величину амортизации актива для заданного периода, рассчитанную методом фиксированного уменьшения остатка.
-DDB = ДДОБ ## Возвращает величину амортизации актива за данный период, используя метод двойного уменьшения остатка или иной явно указанный метод.
-DISC = СКИДКА ## Возвращает норму скидки для ценных бумаг.
-DOLLARDE = РУБЛЬ.ДЕС ## Преобразует цену в рублях, выраженную в виде дроби, в цену в рублях, выраженную десятичным числом.
-DOLLARFR = РУБЛЬ.ДРОБЬ ## Преобразует цену в рублях, выраженную десятичным числом, в цену в рублях, выраженную в виде дроби.
-DURATION = ДЛИТ ## Возвращает ежегодную продолжительность действия ценных бумаг с периодическими выплатами по процентам.
-EFFECT = ЭФФЕКТ ## Возвращает действующие ежегодные процентные ставки.
-FV = БС ## Возвращает будущую стоимость инвестиции.
-FVSCHEDULE = БЗРАСПИС ## Возвращает будущую стоимость первоначальной основной суммы после начисления ряда сложных процентов.
-INTRATE = ИНОРМА ## Возвращает процентную ставку для полностью инвестированных ценных бумаг.
-IPMT = ПРПЛТ ## Возвращает величину выплаты прибыли на вложения за данный период.
-IRR = ВСД ## Возвращает внутреннюю ставку доходности для ряда потоков денежных средств.
-ISPMT = ПРОЦПЛАТ ## Вычисляет выплаты за указанный период инвестиции.
-MDURATION = МДЛИТ ## Возвращает модифицированную длительность Маколея для ценных бумаг с предполагаемой номинальной стоимостью 100 рублей.
-MIRR = МВСД ## Возвращает внутреннюю ставку доходности, при которой положительные и отрицательные денежные потоки имеют разные значения ставки.
-NOMINAL = НОМИНАЛ ## Возвращает номинальную годовую процентную ставку.
-NPER = КПЕР ## Возвращает общее количество периодов выплаты для данного вклада.
-NPV = ЧПС ## Возвращает чистую приведенную стоимость инвестиции, основанной на серии периодических денежных потоков и ставке дисконтирования.
-ODDFPRICE = ЦЕНАПЕРВНЕРЕГ ## Возвращает цену за 100 рублей нарицательной стоимости ценных бумаг с нерегулярным первым периодом.
-ODDFYIELD = ДОХОДПЕРВНЕРЕГ ## Возвращает доход по ценным бумагам с нерегулярным первым периодом.
-ODDLPRICE = ЦЕНАПОСЛНЕРЕГ ## Возвращает цену за 100 рублей нарицательной стоимости ценных бумаг с нерегулярным последним периодом.
-ODDLYIELD = ДОХОДПОСЛНЕРЕГ ## Возвращает доход по ценным бумагам с нерегулярным последним периодом.
-PMT = ПЛТ ## Возвращает величину выплаты за один период аннуитета.
-PPMT = ОСПЛТ ## Возвращает величину выплат в погашение основной суммы по инвестиции за заданный период.
-PRICE = ЦЕНА ## Возвращает цену за 100 рублей нарицательной стоимости ценных бумаг, по которым производится периодическая выплата процентов.
-PRICEDISC = ЦЕНАСКИДКА ## Возвращает цену за 100 рублей номинальной стоимости ценных бумаг, на которые сделана скидка.
-PRICEMAT = ЦЕНАПОГАШ ## Возвращает цену за 100 рублей номинальной стоимости ценных бумаг, проценты по которым выплачиваются в срок погашения.
-PV = ПС ## Возвращает приведенную (к текущему моменту) стоимость инвестиции.
-RATE = СТАВКА ## Возвращает процентную ставку по аннуитету за один период.
-RECEIVED = ПОЛУЧЕНО ## Возвращает сумму, полученную к сроку погашения полностью обеспеченных ценных бумаг.
-SLN = АПЛ ## Возвращает величину линейной амортизации актива за один период.
-SYD = АСЧ ## Возвращает величину амортизации актива за данный период, рассчитанную методом суммы годовых чисел.
-TBILLEQ = РАВНОКЧЕК ## Возвращает эквивалентный облигации доход по казначейскому чеку.
-TBILLPRICE = ЦЕНАКЧЕК ## Возвращает цену за 100 рублей нарицательной стоимости для казначейского чека.
-TBILLYIELD = ДОХОДКЧЕК ## Возвращает доход по казначейскому чеку.
-VDB = ПУО ## Возвращает величину амортизации актива для указанного или частичного периода при использовании метода сокращающегося баланса.
-XIRR = ЧИСТВНДОХ ## Возвращает внутреннюю ставку доходности для графика денежных потоков, которые не обязательно носят периодический характер.
-XNPV = ЧИСТНЗ ## Возвращает чистую приведенную стоимость для денежных потоков, которые не обязательно являются периодическими.
-YIELD = ДОХОД ## Возвращает доход от ценных бумаг, по которым производятся периодические выплаты процентов.
-YIELDDISC = ДОХОДСКИДКА ## Возвращает годовой доход по ценным бумагам, на которые сделана скидка (пример — казначейские чеки).
-YIELDMAT = ДОХОДПОГАШ ## Возвращает годовой доход от ценных бумаг, проценты по которым выплачиваются в срок погашения.
-
-
-##
-## Information functions Информационные функции
-##
-CELL = ЯЧЕЙКА ## Возвращает информацию о формате, расположении или содержимом ячейки.
-ERROR.TYPE = ТИП.ОШИБКИ ## Возвращает числовой код, соответствующий типу ошибки.
-INFO = ИНФОРМ ## Возвращает информацию о текущей операционной среде.
-ISBLANK = ЕПУСТО ## Возвращает значение ИСТИНА, если аргумент является ссылкой на пустую ячейку.
-ISERR = ЕОШ ## Возвращает значение ИСТИНА, если аргумент ссылается на любое значение ошибки, кроме #Н/Д.
-ISERROR = ЕОШИБКА ## Возвращает значение ИСТИНА, если аргумент ссылается на любое значение ошибки.
-ISEVEN = ЕЧЁТН ## Возвращает значение ИСТИНА, если значение аргумента является четным числом.
-ISLOGICAL = ЕЛОГИЧ ## Возвращает значение ИСТИНА, если аргумент ссылается на логическое значение.
-ISNA = ЕНД ## Возвращает значение ИСТИНА, если аргумент ссылается на значение ошибки #Н/Д.
-ISNONTEXT = ЕНЕТЕКСТ ## Возвращает значение ИСТИНА, если значение аргумента не является текстом.
-ISNUMBER = ЕЧИСЛО ## Возвращает значение ИСТИНА, если аргумент ссылается на число.
-ISODD = ЕНЕЧЁТ ## Возвращает значение ИСТИНА, если значение аргумента является нечетным числом.
-ISREF = ЕССЫЛКА ## Возвращает значение ИСТИНА, если значение аргумента является ссылкой.
-ISTEXT = ЕТЕКСТ ## Возвращает значение ИСТИНА, если значение аргумента является текстом.
-N = Ч ## Возвращает значение, преобразованное в число.
-NA = НД ## Возвращает значение ошибки #Н/Д.
-TYPE = ТИП ## Возвращает число, обозначающее тип данных значения.
-
-
-##
-## Logical functions Логические функции
-##
-AND = И ## Renvoie VRAI si tous ses arguments sont VRAI.
-FALSE = ЛОЖЬ ## Возвращает логическое значение ЛОЖЬ.
-IF = ЕСЛИ ## Выполняет проверку условия.
-IFERROR = ЕСЛИОШИБКА ## Возвращает введённое значение, если вычисление по формуле вызывает ошибку; в противном случае функция возвращает результат вычисления.
-NOT = НЕ ## Меняет логическое значение своего аргумента на противоположное.
-OR = ИЛИ ## Возвращает значение ИСТИНА, если хотя бы один аргумент имеет значение ИСТИНА.
-TRUE = ИСТИНА ## Возвращает логическое значение ИСТИНА.
-
-
-##
-## Lookup and reference functions Функции ссылки и поиска
-##
-ADDRESS = АДРЕС ## Возвращает ссылку на отдельную ячейку листа в виде текста.
-AREAS = ОБЛАСТИ ## Возвращает количество областей в ссылке.
-CHOOSE = ВЫБОР ## Выбирает значение из списка значений по индексу.
-COLUMN = СТОЛБЕЦ ## Возвращает номер столбца, на который указывает ссылка.
-COLUMNS = ЧИСЛСТОЛБ ## Возвращает количество столбцов в ссылке.
-HLOOKUP = ГПР ## Ищет в первой строке массива и возвращает значение отмеченной ячейки
-HYPERLINK = ГИПЕРССЫЛКА ## Создает ссылку, открывающую документ, который находится на сервере сети, в интрасети или в Интернете.
-INDEX = ИНДЕКС ## Использует индекс для выбора значения из ссылки или массива.
-INDIRECT = ДВССЫЛ ## Возвращает ссылку, заданную текстовым значением.
-LOOKUP = ПРОСМОТР ## Ищет значения в векторе или массиве.
-MATCH = ПОИСКПОЗ ## Ищет значения в ссылке или массиве.
-OFFSET = СМЕЩ ## Возвращает смещение ссылки относительно заданной ссылки.
-ROW = СТРОКА ## Возвращает номер строки, определяемой ссылкой.
-ROWS = ЧСТРОК ## Возвращает количество строк в ссылке.
-RTD = ДРВ ## Извлекает данные реального времени из программ, поддерживающих автоматизацию COM (Программирование объектов. Стандартное средство для работы с объектами некоторого приложения из другого приложения или средства разработки. Программирование объектов (ранее называемое программированием OLE) является функцией модели COM (Component Object Model, модель компонентных объектов).).
-TRANSPOSE = ТРАНСП ## Возвращает транспонированный массив.
-VLOOKUP = ВПР ## Ищет значение в первом столбце массива и возвращает значение из ячейки в найденной строке и указанном столбце.
-
-
-##
-## Math and trigonometry functions Математические и тригонометрические функции
-##
-ABS = ABS ## Возвращает модуль (абсолютную величину) числа.
-ACOS = ACOS ## Возвращает арккосинус числа.
-ACOSH = ACOSH ## Возвращает гиперболический арккосинус числа.
-ASIN = ASIN ## Возвращает арксинус числа.
-ASINH = ASINH ## Возвращает гиперболический арксинус числа.
-ATAN = ATAN ## Возвращает арктангенс числа.
-ATAN2 = ATAN2 ## Возвращает арктангенс для заданных координат x и y.
-ATANH = ATANH ## Возвращает гиперболический арктангенс числа.
-CEILING = ОКРВВЕРХ ## Округляет число до ближайшего целого или до ближайшего кратного указанному значению.
-COMBIN = ЧИСЛКОМБ ## Возвращает количество комбинаций для заданного числа объектов.
-COS = COS ## Возвращает косинус числа.
-COSH = COSH ## Возвращает гиперболический косинус числа.
-DEGREES = ГРАДУСЫ ## Преобразует радианы в градусы.
-EVEN = ЧЁТН ## Округляет число до ближайшего четного целого.
-EXP = EXP ## Возвращает число e, возведенное в указанную степень.
-FACT = ФАКТР ## Возвращает факториал числа.
-FACTDOUBLE = ДВФАКТР ## Возвращает двойной факториал числа.
-FLOOR = ОКРВНИЗ ## Округляет число до ближайшего меньшего по модулю значения.
-GCD = НОД ## Возвращает наибольший общий делитель.
-INT = ЦЕЛОЕ ## Округляет число до ближайшего меньшего целого.
-LCM = НОК ## Возвращает наименьшее общее кратное.
-LN = LN ## Возвращает натуральный логарифм числа.
-LOG = LOG ## Возвращает логарифм числа по заданному основанию.
-LOG10 = LOG10 ## Возвращает десятичный логарифм числа.
-MDETERM = МОПРЕД ## Возвращает определитель матрицы массива.
-MINVERSE = МОБР ## Возвращает обратную матрицу массива.
-MMULT = МУМНОЖ ## Возвращает произведение матриц двух массивов.
-MOD = ОСТАТ ## Возвращает остаток от деления.
-MROUND = ОКРУГЛТ ## Возвращает число, округленное с требуемой точностью.
-MULTINOMIAL = МУЛЬТИНОМ ## Возвращает мультиномиальный коэффициент множества чисел.
-ODD = НЕЧЁТ ## Округляет число до ближайшего нечетного целого.
-PI = ПИ ## Возвращает число пи.
-POWER = СТЕПЕНЬ ## Возвращает результат возведения числа в степень.
-PRODUCT = ПРОИЗВЕД ## Возвращает произведение аргументов.
-QUOTIENT = ЧАСТНОЕ ## Возвращает целую часть частного при делении.
-RADIANS = РАДИАНЫ ## Преобразует градусы в радианы.
-RAND = СЛЧИС ## Возвращает случайное число в интервале от 0 до 1.
-RANDBETWEEN = СЛУЧМЕЖДУ ## Возвращает случайное число в интервале между двумя заданными числами.
-ROMAN = РИМСКОЕ ## Преобразует арабские цифры в римские в виде текста.
-ROUND = ОКРУГЛ ## Округляет число до указанного количества десятичных разрядов.
-ROUNDDOWN = ОКРУГЛВНИЗ ## Округляет число до ближайшего меньшего по модулю значения.
-ROUNDUP = ОКРУГЛВВЕРХ ## Округляет число до ближайшего большего по модулю значения.
-SERIESSUM = РЯД.СУММ ## Возвращает сумму степенного ряда, вычисленную по формуле.
-SIGN = ЗНАК ## Возвращает знак числа.
-SIN = SIN ## Возвращает синус заданного угла.
-SINH = SINH ## Возвращает гиперболический синус числа.
-SQRT = КОРЕНЬ ## Возвращает положительное значение квадратного корня.
-SQRTPI = КОРЕНЬПИ ## Возвращает квадратный корень из значения выражения (число * ПИ).
-SUBTOTAL = ПРОМЕЖУТОЧНЫЕ.ИТОГИ ## Возвращает промежуточный итог в списке или базе данных.
-SUM = СУММ ## Суммирует аргументы.
-SUMIF = СУММЕСЛИ ## Суммирует ячейки, удовлетворяющие заданному условию.
-SUMIFS = СУММЕСЛИМН ## Суммирует диапазон ячеек, удовлетворяющих нескольким условиям.
-SUMPRODUCT = СУММПРОИЗВ ## Возвращает сумму произведений соответствующих элементов массивов.
-SUMSQ = СУММКВ ## Возвращает сумму квадратов аргументов.
-SUMX2MY2 = СУММРАЗНКВ ## Возвращает сумму разностей квадратов соответствующих значений в двух массивах.
-SUMX2PY2 = СУММСУММКВ ## Возвращает сумму сумм квадратов соответствующих элементов двух массивов.
-SUMXMY2 = СУММКВРАЗН ## Возвращает сумму квадратов разностей соответствующих значений в двух массивах.
-TAN = TAN ## Возвращает тангенс числа.
-TANH = TANH ## Возвращает гиперболический тангенс числа.
-TRUNC = ОТБР ## Отбрасывает дробную часть числа.
-
-
-##
-## Statistical functions Статистические функции
-##
-AVEDEV = СРОТКЛ ## Возвращает среднее арифметическое абсолютных значений отклонений точек данных от среднего.
-AVERAGE = СРЗНАЧ ## Возвращает среднее арифметическое аргументов.
-AVERAGEA = СРЗНАЧА ## Возвращает среднее арифметическое аргументов, включая числа, текст и логические значения.
-AVERAGEIF = СРЗНАЧЕСЛИ ## Возвращает среднее значение (среднее арифметическое) всех ячеек в диапазоне, которые удовлетворяют данному условию.
-AVERAGEIFS = СРЗНАЧЕСЛИМН ## Возвращает среднее значение (среднее арифметическое) всех ячеек, которые удовлетворяют нескольким условиям.
-BETADIST = БЕТАРАСП ## Возвращает интегральную функцию бета-распределения.
-BETAINV = БЕТАОБР ## Возвращает обратную интегральную функцию указанного бета-распределения.
-BINOMDIST = БИНОМРАСП ## Возвращает отдельное значение биномиального распределения.
-CHIDIST = ХИ2РАСП ## Возвращает одностороннюю вероятность распределения хи-квадрат.
-CHIINV = ХИ2ОБР ## Возвращает обратное значение односторонней вероятности распределения хи-квадрат.
-CHITEST = ХИ2ТЕСТ ## Возвращает тест на независимость.
-CONFIDENCE = ДОВЕРИТ ## Возвращает доверительный интервал для среднего значения по генеральной совокупности.
-CORREL = КОРРЕЛ ## Возвращает коэффициент корреляции между двумя множествами данных.
-COUNT = СЧЁТ ## Подсчитывает количество чисел в списке аргументов.
-COUNTA = СЧЁТЗ ## Подсчитывает количество значений в списке аргументов.
-COUNTBLANK = СЧИТАТЬПУСТОТЫ ## Подсчитывает количество пустых ячеек в диапазоне
-COUNTIF = СЧЁТЕСЛИ ## Подсчитывает количество ячеек в диапазоне, удовлетворяющих заданному условию
-COUNTIFS = СЧЁТЕСЛИМН ## Подсчитывает количество ячеек внутри диапазона, удовлетворяющих нескольким условиям.
-COVAR = КОВАР ## Возвращает ковариацию, среднее произведений парных отклонений
-CRITBINOM = КРИТБИНОМ ## Возвращает наименьшее значение, для которого интегральное биномиальное распределение меньше или равно заданному критерию.
-DEVSQ = КВАДРОТКЛ ## Возвращает сумму квадратов отклонений.
-EXPONDIST = ЭКСПРАСП ## Возвращает экспоненциальное распределение.
-FDIST = FРАСП ## Возвращает F-распределение вероятности.
-FINV = FРАСПОБР ## Возвращает обратное значение для F-распределения вероятности.
-FISHER = ФИШЕР ## Возвращает преобразование Фишера.
-FISHERINV = ФИШЕРОБР ## Возвращает обратное преобразование Фишера.
-FORECAST = ПРЕДСКАЗ ## Возвращает значение линейного тренда.
-FREQUENCY = ЧАСТОТА ## Возвращает распределение частот в виде вертикального массива.
-FTEST = ФТЕСТ ## Возвращает результат F-теста.
-GAMMADIST = ГАММАРАСП ## Возвращает гамма-распределение.
-GAMMAINV = ГАММАОБР ## Возвращает обратное гамма-распределение.
-GAMMALN = ГАММАНЛОГ ## Возвращает натуральный логарифм гамма функции, Γ(x).
-GEOMEAN = СРГЕОМ ## Возвращает среднее геометрическое.
-GROWTH = РОСТ ## Возвращает значения в соответствии с экспоненциальным трендом.
-HARMEAN = СРГАРМ ## Возвращает среднее гармоническое.
-HYPGEOMDIST = ГИПЕРГЕОМЕТ ## Возвращает гипергеометрическое распределение.
-INTERCEPT = ОТРЕЗОК ## Возвращает отрезок, отсекаемый на оси линией линейной регрессии.
-KURT = ЭКСЦЕСС ## Возвращает эксцесс множества данных.
-LARGE = НАИБОЛЬШИЙ ## Возвращает k-ое наибольшее значение в множестве данных.
-LINEST = ЛИНЕЙН ## Возвращает параметры линейного тренда.
-LOGEST = ЛГРФПРИБЛ ## Возвращает параметры экспоненциального тренда.
-LOGINV = ЛОГНОРМОБР ## Возвращает обратное логарифмическое нормальное распределение.
-LOGNORMDIST = ЛОГНОРМРАСП ## Возвращает интегральное логарифмическое нормальное распределение.
-MAX = МАКС ## Возвращает наибольшее значение в списке аргументов.
-MAXA = МАКСА ## Возвращает наибольшее значение в списке аргументов, включая числа, текст и логические значения.
-MEDIAN = МЕДИАНА ## Возвращает медиану заданных чисел.
-MIN = МИН ## Возвращает наименьшее значение в списке аргументов.
-MINA = МИНА ## Возвращает наименьшее значение в списке аргументов, включая числа, текст и логические значения.
-MODE = МОДА ## Возвращает значение моды множества данных.
-NEGBINOMDIST = ОТРБИНОМРАСП ## Возвращает отрицательное биномиальное распределение.
-NORMDIST = НОРМРАСП ## Возвращает нормальную функцию распределения.
-NORMINV = НОРМОБР ## Возвращает обратное нормальное распределение.
-NORMSDIST = НОРМСТРАСП ## Возвращает стандартное нормальное интегральное распределение.
-NORMSINV = НОРМСТОБР ## Возвращает обратное значение стандартного нормального распределения.
-PEARSON = ПИРСОН ## Возвращает коэффициент корреляции Пирсона.
-PERCENTILE = ПЕРСЕНТИЛЬ ## Возвращает k-ую персентиль для значений диапазона.
-PERCENTRANK = ПРОЦЕНТРАНГ ## Возвращает процентную норму значения в множестве данных.
-PERMUT = ПЕРЕСТ ## Возвращает количество перестановок для заданного числа объектов.
-POISSON = ПУАССОН ## Возвращает распределение Пуассона.
-PROB = ВЕРОЯТНОСТЬ ## Возвращает вероятность того, что значение из диапазона находится внутри заданных пределов.
-QUARTILE = КВАРТИЛЬ ## Возвращает квартиль множества данных.
-RANK = РАНГ ## Возвращает ранг числа в списке чисел.
-RSQ = КВПИРСОН ## Возвращает квадрат коэффициента корреляции Пирсона.
-SKEW = СКОС ## Возвращает асимметрию распределения.
-SLOPE = НАКЛОН ## Возвращает наклон линии линейной регрессии.
-SMALL = НАИМЕНЬШИЙ ## Возвращает k-ое наименьшее значение в множестве данных.
-STANDARDIZE = НОРМАЛИЗАЦИЯ ## Возвращает нормализованное значение.
-STDEV = СТАНДОТКЛОН ## Оценивает стандартное отклонение по выборке.
-STDEVA = СТАНДОТКЛОНА ## Оценивает стандартное отклонение по выборке, включая числа, текст и логические значения.
-STDEVP = СТАНДОТКЛОНП ## Вычисляет стандартное отклонение по генеральной совокупности.
-STDEVPA = СТАНДОТКЛОНПА ## Вычисляет стандартное отклонение по генеральной совокупности, включая числа, текст и логические значения.
-STEYX = СТОШYX ## Возвращает стандартную ошибку предсказанных значений y для каждого значения x в регрессии.
-TDIST = СТЬЮДРАСП ## Возвращает t-распределение Стьюдента.
-TINV = СТЬЮДРАСПОБР ## Возвращает обратное t-распределение Стьюдента.
-TREND = ТЕНДЕНЦИЯ ## Возвращает значения в соответствии с линейным трендом.
-TRIMMEAN = УРЕЗСРЕДНЕЕ ## Возвращает среднее внутренности множества данных.
-TTEST = ТТЕСТ ## Возвращает вероятность, соответствующую критерию Стьюдента.
-VAR = ДИСП ## Оценивает дисперсию по выборке.
-VARA = ДИСПА ## Оценивает дисперсию по выборке, включая числа, текст и логические значения.
-VARP = ДИСПР ## Вычисляет дисперсию для генеральной совокупности.
-VARPA = ДИСПРА ## Вычисляет дисперсию для генеральной совокупности, включая числа, текст и логические значения.
-WEIBULL = ВЕЙБУЛЛ ## Возвращает распределение Вейбулла.
-ZTEST = ZТЕСТ ## Возвращает двустороннее P-значение z-теста.
-
-
-##
-## Text functions Текстовые функции
-##
-ASC = ASC ## Для языков с двухбайтовыми наборами знаков (например, катакана) преобразует полноширинные (двухбайтовые) знаки в полуширинные (однобайтовые).
-BAHTTEXT = БАТТЕКСТ ## Преобразует число в текст, используя денежный формат ß (БАТ).
-CHAR = СИМВОЛ ## Возвращает знак с заданным кодом.
-CLEAN = ПЕЧСИМВ ## Удаляет все непечатаемые знаки из текста.
-CODE = КОДСИМВ ## Возвращает числовой код первого знака в текстовой строке.
-CONCATENATE = СЦЕПИТЬ ## Объединяет несколько текстовых элементов в один.
-DOLLAR = РУБЛЬ ## Преобразует число в текст, используя денежный формат.
-EXACT = СОВПАД ## Проверяет идентичность двух текстовых значений.
-FIND = НАЙТИ ## Ищет вхождения одного текстового значения в другом (с учетом регистра).
-FINDB = НАЙТИБ ## Ищет вхождения одного текстового значения в другом (с учетом регистра).
-FIXED = ФИКСИРОВАННЫЙ ## Форматирует число и преобразует его в текст с заданным числом десятичных знаков.
-JIS = JIS ## Для языков с двухбайтовыми наборами знаков (например, катакана) преобразует полуширинные (однобайтовые) знаки в текстовой строке в полноширинные (двухбайтовые).
-LEFT = ЛЕВСИМВ ## Возвращает крайние слева знаки текстового значения.
-LEFTB = ЛЕВБ ## Возвращает крайние слева знаки текстового значения.
-LEN = ДЛСТР ## Возвращает количество знаков в текстовой строке.
-LENB = ДЛИНБ ## Возвращает количество знаков в текстовой строке.
-LOWER = СТРОЧН ## Преобразует все буквы текста в строчные.
-MID = ПСТР ## Возвращает заданное число знаков из строки текста, начиная с указанной позиции.
-MIDB = ПСТРБ ## Возвращает заданное число знаков из строки текста, начиная с указанной позиции.
-PHONETIC = PHONETIC ## Извлекает фонетические (фуригана) знаки из текстовой строки.
-PROPER = ПРОПНАЧ ## Преобразует первую букву в каждом слове текста в прописную.
-REPLACE = ЗАМЕНИТЬ ## Заменяет знаки в тексте.
-REPLACEB = ЗАМЕНИТЬБ ## Заменяет знаки в тексте.
-REPT = ПОВТОР ## Повторяет текст заданное число раз.
-RIGHT = ПРАВСИМВ ## Возвращает крайние справа знаки текстовой строки.
-RIGHTB = ПРАВБ ## Возвращает крайние справа знаки текстовой строки.
-SEARCH = ПОИСК ## Ищет вхождения одного текстового значения в другом (без учета регистра).
-SEARCHB = ПОИСКБ ## Ищет вхождения одного текстового значения в другом (без учета регистра).
-SUBSTITUTE = ПОДСТАВИТЬ ## Заменяет в текстовой строке старый текст новым.
-T = Т ## Преобразует аргументы в текст.
-TEXT = ТЕКСТ ## Форматирует число и преобразует его в текст.
-TRIM = СЖПРОБЕЛЫ ## Удаляет из текста пробелы.
-UPPER = ПРОПИСН ## Преобразует все буквы текста в прописные.
-VALUE = ЗНАЧЕН ## Преобразует текстовый аргумент в число.
+##
+## PhpSpreadsheet
+##
+##
+## Data in this file derived from information provided by web-junior (http://www.web-junior.net/)
+##
+##
+
+
+##
+## Add-in and Automation functions Функции надстроек и автоматизации
+##
+GETPIVOTDATA = ПОЛУЧИТЬ.ДАННЫЕ.СВОДНОЙ.ТАБЛИЦЫ ## Возвращает данные, хранящиеся в отчете сводной таблицы.
+
+
+##
+## Cube functions Функции Куб
+##
+CUBEKPIMEMBER = КУБЭЛЕМЕНТКИП ## Возвращает свойство ключевого индикатора производительности «(КИП)» и отображает имя «КИП» в ячейке. «КИП» представляет собой количественную величину, такую как ежемесячная валовая прибыль или ежеквартальная текучесть кадров, используемой для контроля эффективности работы организации.
+CUBEMEMBER = КУБЭЛЕМЕНТ ## Возвращает элемент или кортеж из куба. Используется для проверки существования элемента или кортежа в кубе.
+CUBEMEMBERPROPERTY = КУБСВОЙСТВОЭЛЕМЕНТА ## Возвращает значение свойства элемента из куба. Используется для проверки существования имени элемента в кубе и возвращает указанное свойство для этого элемента.
+CUBERANKEDMEMBER = КУБПОРЭЛЕМЕНТ ## Возвращает n-ый или ранжированный элемент в множество. Используется для возвращения одного или нескольких элементов в множество, например, лучшего продавца или 10 лучших студентов.
+CUBESET = КУБМНОЖ ## Определяет вычислительное множество элементов или кортежей, отправляя на сервер выражение, которое создает множество, а затем возвращает его в Microsoft Office Excel.
+CUBESETCOUNT = КУБЧИСЛОЭЛМНОЖ ## Возвращает число элементов множества.
+CUBEVALUE = КУБЗНАЧЕНИЕ ## Возвращает обобщенное значение из куба.
+
+
+##
+## Database functions Функции для работы с базами данных
+##
+DAVERAGE = ДСРЗНАЧ ## Возвращает среднее значение выбранных записей базы данных.
+DCOUNT = БСЧЁТ ## Подсчитывает количество числовых ячеек в базе данных.
+DCOUNTA = БСЧЁТА ## Подсчитывает количество непустых ячеек в базе данных.
+DGET = БИЗВЛЕЧЬ ## Извлекает из базы данных одну запись, удовлетворяющую заданному условию.
+DMAX = ДМАКС ## Возвращает максимальное значение среди выделенных записей базы данных.
+DMIN = ДМИН ## Возвращает минимальное значение среди выделенных записей базы данных.
+DPRODUCT = БДПРОИЗВЕД ## Перемножает значения определенного поля в записях базы данных, удовлетворяющих условию.
+DSTDEV = ДСТАНДОТКЛ ## Оценивает стандартное отклонение по выборке для выделенных записей базы данных.
+DSTDEVP = ДСТАНДОТКЛП ## Вычисляет стандартное отклонение по генеральной совокупности для выделенных записей базы данных
+DSUM = БДСУММ ## Суммирует числа в поле для записей базы данных, удовлетворяющих условию.
+DVAR = БДДИСП ## Оценивает дисперсию по выборке из выделенных записей базы данных
+DVARP = БДДИСПП ## Вычисляет дисперсию по генеральной совокупности для выделенных записей базы данных
+
+
+##
+## Date and time functions Функции даты и времени
+##
+DATE = ДАТА ## Возвращает заданную дату в числовом формате.
+DATEVALUE = ДАТАЗНАЧ ## Преобразует дату из текстового формата в числовой формат.
+DAY = ДЕНЬ ## Преобразует дату в числовом формате в день месяца.
+DAYS360 = ДНЕЙ360 ## Вычисляет количество дней между двумя датами на основе 360-дневного года.
+EDATE = ДАТАМЕС ## Возвращает дату в числовом формате, отстоящую на заданное число месяцев вперед или назад от начальной даты.
+EOMONTH = КОНМЕСЯЦА ## Возвращает дату в числовом формате для последнего дня месяца, отстоящего вперед или назад на заданное число месяцев.
+HOUR = ЧАС ## Преобразует дату в числовом формате в часы.
+MINUTE = МИНУТЫ ## Преобразует дату в числовом формате в минуты.
+MONTH = МЕСЯЦ ## Преобразует дату в числовом формате в месяцы.
+NETWORKDAYS = ЧИСТРАБДНИ ## Возвращает количество рабочих дней между двумя датами.
+NOW = ТДАТА ## Возвращает текущую дату и время в числовом формате.
+SECOND = СЕКУНДЫ ## Преобразует дату в числовом формате в секунды.
+TIME = ВРЕМЯ ## Возвращает заданное время в числовом формате.
+TIMEVALUE = ВРЕМЗНАЧ ## Преобразует время из текстового формата в числовой формат.
+TODAY = СЕГОДНЯ ## Возвращает текущую дату в числовом формате.
+WEEKDAY = ДЕНЬНЕД ## Преобразует дату в числовом формате в день недели.
+WEEKNUM = НОМНЕДЕЛИ ## Преобразует числовое представление в число, которое указывает, на какую неделю года приходится указанная дата.
+WORKDAY = РАБДЕНЬ ## Возвращает дату в числовом формате, отстоящую вперед или назад на заданное количество рабочих дней.
+YEAR = ГОД ## Преобразует дату в числовом формате в год.
+YEARFRAC = ДОЛЯГОДА ## Возвращает долю года, которую составляет количество дней между начальной и конечной датами.
+
+
+##
+## Engineering functions Инженерные функции
+##
+BESSELI = БЕССЕЛЬ.I ## Возвращает модифицированную функцию Бесселя In(x).
+BESSELJ = БЕССЕЛЬ.J ## Возвращает функцию Бесселя Jn(x).
+BESSELK = БЕССЕЛЬ.K ## Возвращает модифицированную функцию Бесселя Kn(x).
+BESSELY = БЕССЕЛЬ.Y ## Возвращает функцию Бесселя Yn(x).
+BIN2DEC = ДВ.В.ДЕС ## Преобразует двоичное число в десятичное.
+BIN2HEX = ДВ.В.ШЕСТН ## Преобразует двоичное число в шестнадцатеричное.
+BIN2OCT = ДВ.В.ВОСЬМ ## Преобразует двоичное число в восьмеричное.
+COMPLEX = КОМПЛЕКСН ## Преобразует коэффициенты при вещественной и мнимой частях комплексного числа в комплексное число.
+CONVERT = ПРЕОБР ## Преобразует число из одной системы единиц измерения в другую.
+DEC2BIN = ДЕС.В.ДВ ## Преобразует десятичное число в двоичное.
+DEC2HEX = ДЕС.В.ШЕСТН ## Преобразует десятичное число в шестнадцатеричное.
+DEC2OCT = ДЕС.В.ВОСЬМ ## Преобразует десятичное число в восьмеричное.
+DELTA = ДЕЛЬТА ## Проверяет равенство двух значений.
+ERF = ФОШ ## Возвращает функцию ошибки.
+ERFC = ДФОШ ## Возвращает дополнительную функцию ошибки.
+GESTEP = ПОРОГ ## Проверяет, не превышает ли данное число порогового значения.
+HEX2BIN = ШЕСТН.В.ДВ ## Преобразует шестнадцатеричное число в двоичное.
+HEX2DEC = ШЕСТН.В.ДЕС ## Преобразует шестнадцатеричное число в десятичное.
+HEX2OCT = ШЕСТН.В.ВОСЬМ ## Преобразует шестнадцатеричное число в восьмеричное.
+IMABS = МНИМ.ABS ## Возвращает абсолютную величину (модуль) комплексного числа.
+IMAGINARY = МНИМ.ЧАСТЬ ## Возвращает коэффициент при мнимой части комплексного числа.
+IMARGUMENT = МНИМ.АРГУМЕНТ ## Возвращает значение аргумента комплексного числа (тета) — угол, выраженный в радианах.
+IMCONJUGATE = МНИМ.СОПРЯЖ ## Возвращает комплексно-сопряженное комплексное число.
+IMCOS = МНИМ.COS ## Возвращает косинус комплексного числа.
+IMDIV = МНИМ.ДЕЛ ## Возвращает частное от деления двух комплексных чисел.
+IMEXP = МНИМ.EXP ## Возвращает экспоненту комплексного числа.
+IMLN = МНИМ.LN ## Возвращает натуральный логарифм комплексного числа.
+IMLOG10 = МНИМ.LOG10 ## Возвращает обычный (десятичный) логарифм комплексного числа.
+IMLOG2 = МНИМ.LOG2 ## Возвращает двоичный логарифм комплексного числа.
+IMPOWER = МНИМ.СТЕПЕНЬ ## Возвращает комплексное число, возведенное в целую степень.
+IMPRODUCT = МНИМ.ПРОИЗВЕД ## Возвращает произведение от 2 до 29 комплексных чисел.
+IMREAL = МНИМ.ВЕЩ ## Возвращает коэффициент при вещественной части комплексного числа.
+IMSIN = МНИМ.SIN ## Возвращает синус комплексного числа.
+IMSQRT = МНИМ.КОРЕНЬ ## Возвращает значение квадратного корня из комплексного числа.
+IMSUB = МНИМ.РАЗН ## Возвращает разность двух комплексных чисел.
+IMSUM = МНИМ.СУММ ## Возвращает сумму комплексных чисел.
+OCT2BIN = ВОСЬМ.В.ДВ ## Преобразует восьмеричное число в двоичное.
+OCT2DEC = ВОСЬМ.В.ДЕС ## Преобразует восьмеричное число в десятичное.
+OCT2HEX = ВОСЬМ.В.ШЕСТН ## Преобразует восьмеричное число в шестнадцатеричное.
+
+
+##
+## Financial functions Финансовые функции
+##
+ACCRINT = НАКОПДОХОД ## Возвращает накопленный процент по ценным бумагам с периодической выплатой процентов.
+ACCRINTM = НАКОПДОХОДПОГАШ ## Возвращает накопленный процент по ценным бумагам, проценты по которым выплачиваются в срок погашения.
+AMORDEGRC = АМОРУМ ## Возвращает величину амортизации для каждого периода, используя коэффициент амортизации.
+AMORLINC = АМОРУВ ## Возвращает величину амортизации для каждого периода.
+COUPDAYBS = ДНЕЙКУПОНДО ## Возвращает количество дней от начала действия купона до даты соглашения.
+COUPDAYS = ДНЕЙКУПОН ## Возвращает число дней в периоде купона, содержащем дату соглашения.
+COUPDAYSNC = ДНЕЙКУПОНПОСЛЕ ## Возвращает число дней от даты соглашения до срока следующего купона.
+COUPNCD = ДАТАКУПОНПОСЛЕ ## Возвращает следующую дату купона после даты соглашения.
+COUPNUM = ЧИСЛКУПОН ## Возвращает количество купонов, которые могут быть оплачены между датой соглашения и сроком вступления в силу.
+COUPPCD = ДАТАКУПОНДО ## Возвращает предыдущую дату купона перед датой соглашения.
+CUMIPMT = ОБЩПЛАТ ## Возвращает общую выплату, произведенную между двумя периодическими выплатами.
+CUMPRINC = ОБЩДОХОД ## Возвращает общую выплату по займу между двумя периодами.
+DB = ФУО ## Возвращает величину амортизации актива для заданного периода, рассчитанную методом фиксированного уменьшения остатка.
+DDB = ДДОБ ## Возвращает величину амортизации актива за данный период, используя метод двойного уменьшения остатка или иной явно указанный метод.
+DISC = СКИДКА ## Возвращает норму скидки для ценных бумаг.
+DOLLARDE = РУБЛЬ.ДЕС ## Преобразует цену в рублях, выраженную в виде дроби, в цену в рублях, выраженную десятичным числом.
+DOLLARFR = РУБЛЬ.ДРОБЬ ## Преобразует цену в рублях, выраженную десятичным числом, в цену в рублях, выраженную в виде дроби.
+DURATION = ДЛИТ ## Возвращает ежегодную продолжительность действия ценных бумаг с периодическими выплатами по процентам.
+EFFECT = ЭФФЕКТ ## Возвращает действующие ежегодные процентные ставки.
+FV = БС ## Возвращает будущую стоимость инвестиции.
+FVSCHEDULE = БЗРАСПИС ## Возвращает будущую стоимость первоначальной основной суммы после начисления ряда сложных процентов.
+INTRATE = ИНОРМА ## Возвращает процентную ставку для полностью инвестированных ценных бумаг.
+IPMT = ПРПЛТ ## Возвращает величину выплаты прибыли на вложения за данный период.
+IRR = ВСД ## Возвращает внутреннюю ставку доходности для ряда потоков денежных средств.
+ISPMT = ПРОЦПЛАТ ## Вычисляет выплаты за указанный период инвестиции.
+MDURATION = МДЛИТ ## Возвращает модифицированную длительность Маколея для ценных бумаг с предполагаемой номинальной стоимостью 100 рублей.
+MIRR = МВСД ## Возвращает внутреннюю ставку доходности, при которой положительные и отрицательные денежные потоки имеют разные значения ставки.
+NOMINAL = НОМИНАЛ ## Возвращает номинальную годовую процентную ставку.
+NPER = КПЕР ## Возвращает общее количество периодов выплаты для данного вклада.
+NPV = ЧПС ## Возвращает чистую приведенную стоимость инвестиции, основанной на серии периодических денежных потоков и ставке дисконтирования.
+ODDFPRICE = ЦЕНАПЕРВНЕРЕГ ## Возвращает цену за 100 рублей нарицательной стоимости ценных бумаг с нерегулярным первым периодом.
+ODDFYIELD = ДОХОДПЕРВНЕРЕГ ## Возвращает доход по ценным бумагам с нерегулярным первым периодом.
+ODDLPRICE = ЦЕНАПОСЛНЕРЕГ ## Возвращает цену за 100 рублей нарицательной стоимости ценных бумаг с нерегулярным последним периодом.
+ODDLYIELD = ДОХОДПОСЛНЕРЕГ ## Возвращает доход по ценным бумагам с нерегулярным последним периодом.
+PMT = ПЛТ ## Возвращает величину выплаты за один период аннуитета.
+PPMT = ОСПЛТ ## Возвращает величину выплат в погашение основной суммы по инвестиции за заданный период.
+PRICE = ЦЕНА ## Возвращает цену за 100 рублей нарицательной стоимости ценных бумаг, по которым производится периодическая выплата процентов.
+PRICEDISC = ЦЕНАСКИДКА ## Возвращает цену за 100 рублей номинальной стоимости ценных бумаг, на которые сделана скидка.
+PRICEMAT = ЦЕНАПОГАШ ## Возвращает цену за 100 рублей номинальной стоимости ценных бумаг, проценты по которым выплачиваются в срок погашения.
+PV = ПС ## Возвращает приведенную (к текущему моменту) стоимость инвестиции.
+RATE = СТАВКА ## Возвращает процентную ставку по аннуитету за один период.
+RECEIVED = ПОЛУЧЕНО ## Возвращает сумму, полученную к сроку погашения полностью обеспеченных ценных бумаг.
+SLN = АПЛ ## Возвращает величину линейной амортизации актива за один период.
+SYD = АСЧ ## Возвращает величину амортизации актива за данный период, рассчитанную методом суммы годовых чисел.
+TBILLEQ = РАВНОКЧЕК ## Возвращает эквивалентный облигации доход по казначейскому чеку.
+TBILLPRICE = ЦЕНАКЧЕК ## Возвращает цену за 100 рублей нарицательной стоимости для казначейского чека.
+TBILLYIELD = ДОХОДКЧЕК ## Возвращает доход по казначейскому чеку.
+VDB = ПУО ## Возвращает величину амортизации актива для указанного или частичного периода при использовании метода сокращающегося баланса.
+XIRR = ЧИСТВНДОХ ## Возвращает внутреннюю ставку доходности для графика денежных потоков, которые не обязательно носят периодический характер.
+XNPV = ЧИСТНЗ ## Возвращает чистую приведенную стоимость для денежных потоков, которые не обязательно являются периодическими.
+YIELD = ДОХОД ## Возвращает доход от ценных бумаг, по которым производятся периодические выплаты процентов.
+YIELDDISC = ДОХОДСКИДКА ## Возвращает годовой доход по ценным бумагам, на которые сделана скидка (пример — казначейские чеки).
+YIELDMAT = ДОХОДПОГАШ ## Возвращает годовой доход от ценных бумаг, проценты по которым выплачиваются в срок погашения.
+
+
+##
+## Information functions Информационные функции
+##
+CELL = ЯЧЕЙКА ## Возвращает информацию о формате, расположении или содержимом ячейки.
+ERROR.TYPE = ТИП.ОШИБКИ ## Возвращает числовой код, соответствующий типу ошибки.
+INFO = ИНФОРМ ## Возвращает информацию о текущей операционной среде.
+ISBLANK = ЕПУСТО ## Возвращает значение ИСТИНА, если аргумент является ссылкой на пустую ячейку.
+ISERR = ЕОШ ## Возвращает значение ИСТИНА, если аргумент ссылается на любое значение ошибки, кроме #Н/Д.
+ISERROR = ЕОШИБКА ## Возвращает значение ИСТИНА, если аргумент ссылается на любое значение ошибки.
+ISEVEN = ЕЧЁТН ## Возвращает значение ИСТИНА, если значение аргумента является четным числом.
+ISLOGICAL = ЕЛОГИЧ ## Возвращает значение ИСТИНА, если аргумент ссылается на логическое значение.
+ISNA = ЕНД ## Возвращает значение ИСТИНА, если аргумент ссылается на значение ошибки #Н/Д.
+ISNONTEXT = ЕНЕТЕКСТ ## Возвращает значение ИСТИНА, если значение аргумента не является текстом.
+ISNUMBER = ЕЧИСЛО ## Возвращает значение ИСТИНА, если аргумент ссылается на число.
+ISODD = ЕНЕЧЁТ ## Возвращает значение ИСТИНА, если значение аргумента является нечетным числом.
+ISREF = ЕССЫЛКА ## Возвращает значение ИСТИНА, если значение аргумента является ссылкой.
+ISTEXT = ЕТЕКСТ ## Возвращает значение ИСТИНА, если значение аргумента является текстом.
+N = Ч ## Возвращает значение, преобразованное в число.
+NA = НД ## Возвращает значение ошибки #Н/Д.
+TYPE = ТИП ## Возвращает число, обозначающее тип данных значения.
+
+
+##
+## Logical functions Логические функции
+##
+AND = И ## Renvoie VRAI si tous ses arguments sont VRAI.
+FALSE = ЛОЖЬ ## Возвращает логическое значение ЛОЖЬ.
+IF = ЕСЛИ ## Выполняет проверку условия.
+IFERROR = ЕСЛИОШИБКА ## Возвращает введённое значение, если вычисление по формуле вызывает ошибку; в противном случае функция возвращает результат вычисления.
+NOT = НЕ ## Меняет логическое значение своего аргумента на противоположное.
+OR = ИЛИ ## Возвращает значение ИСТИНА, если хотя бы один аргумент имеет значение ИСТИНА.
+TRUE = ИСТИНА ## Возвращает логическое значение ИСТИНА.
+
+
+##
+## Lookup and reference functions Функции ссылки и поиска
+##
+ADDRESS = АДРЕС ## Возвращает ссылку на отдельную ячейку листа в виде текста.
+AREAS = ОБЛАСТИ ## Возвращает количество областей в ссылке.
+CHOOSE = ВЫБОР ## Выбирает значение из списка значений по индексу.
+COLUMN = СТОЛБЕЦ ## Возвращает номер столбца, на который указывает ссылка.
+COLUMNS = ЧИСЛСТОЛБ ## Возвращает количество столбцов в ссылке.
+HLOOKUP = ГПР ## Ищет в первой строке массива и возвращает значение отмеченной ячейки
+HYPERLINK = ГИПЕРССЫЛКА ## Создает ссылку, открывающую документ, который находится на сервере сети, в интрасети или в Интернете.
+INDEX = ИНДЕКС ## Использует индекс для выбора значения из ссылки или массива.
+INDIRECT = ДВССЫЛ ## Возвращает ссылку, заданную текстовым значением.
+LOOKUP = ПРОСМОТР ## Ищет значения в векторе или массиве.
+MATCH = ПОИСКПОЗ ## Ищет значения в ссылке или массиве.
+OFFSET = СМЕЩ ## Возвращает смещение ссылки относительно заданной ссылки.
+ROW = СТРОКА ## Возвращает номер строки, определяемой ссылкой.
+ROWS = ЧСТРОК ## Возвращает количество строк в ссылке.
+RTD = ДРВ ## Извлекает данные реального времени из программ, поддерживающих автоматизацию COM (Программирование объектов. Стандартное средство для работы с объектами некоторого приложения из другого приложения или средства разработки. Программирование объектов (ранее называемое программированием OLE) является функцией модели COM (Component Object Model, модель компонентных объектов).).
+TRANSPOSE = ТРАНСП ## Возвращает транспонированный массив.
+VLOOKUP = ВПР ## Ищет значение в первом столбце массива и возвращает значение из ячейки в найденной строке и указанном столбце.
+
+
+##
+## Math and trigonometry functions Математические и тригонометрические функции
+##
+ABS = ABS ## Возвращает модуль (абсолютную величину) числа.
+ACOS = ACOS ## Возвращает арккосинус числа.
+ACOSH = ACOSH ## Возвращает гиперболический арккосинус числа.
+ASIN = ASIN ## Возвращает арксинус числа.
+ASINH = ASINH ## Возвращает гиперболический арксинус числа.
+ATAN = ATAN ## Возвращает арктангенс числа.
+ATAN2 = ATAN2 ## Возвращает арктангенс для заданных координат x и y.
+ATANH = ATANH ## Возвращает гиперболический арктангенс числа.
+CEILING = ОКРВВЕРХ ## Округляет число до ближайшего целого или до ближайшего кратного указанному значению.
+COMBIN = ЧИСЛКОМБ ## Возвращает количество комбинаций для заданного числа объектов.
+COS = COS ## Возвращает косинус числа.
+COSH = COSH ## Возвращает гиперболический косинус числа.
+DEGREES = ГРАДУСЫ ## Преобразует радианы в градусы.
+EVEN = ЧЁТН ## Округляет число до ближайшего четного целого.
+EXP = EXP ## Возвращает число e, возведенное в указанную степень.
+FACT = ФАКТР ## Возвращает факториал числа.
+FACTDOUBLE = ДВФАКТР ## Возвращает двойной факториал числа.
+FLOOR = ОКРВНИЗ ## Округляет число до ближайшего меньшего по модулю значения.
+GCD = НОД ## Возвращает наибольший общий делитель.
+INT = ЦЕЛОЕ ## Округляет число до ближайшего меньшего целого.
+LCM = НОК ## Возвращает наименьшее общее кратное.
+LN = LN ## Возвращает натуральный логарифм числа.
+LOG = LOG ## Возвращает логарифм числа по заданному основанию.
+LOG10 = LOG10 ## Возвращает десятичный логарифм числа.
+MDETERM = МОПРЕД ## Возвращает определитель матрицы массива.
+MINVERSE = МОБР ## Возвращает обратную матрицу массива.
+MMULT = МУМНОЖ ## Возвращает произведение матриц двух массивов.
+MOD = ОСТАТ ## Возвращает остаток от деления.
+MROUND = ОКРУГЛТ ## Возвращает число, округленное с требуемой точностью.
+MULTINOMIAL = МУЛЬТИНОМ ## Возвращает мультиномиальный коэффициент множества чисел.
+ODD = НЕЧЁТ ## Округляет число до ближайшего нечетного целого.
+PI = ПИ ## Возвращает число пи.
+POWER = СТЕПЕНЬ ## Возвращает результат возведения числа в степень.
+PRODUCT = ПРОИЗВЕД ## Возвращает произведение аргументов.
+QUOTIENT = ЧАСТНОЕ ## Возвращает целую часть частного при делении.
+RADIANS = РАДИАНЫ ## Преобразует градусы в радианы.
+RAND = СЛЧИС ## Возвращает случайное число в интервале от 0 до 1.
+RANDBETWEEN = СЛУЧМЕЖДУ ## Возвращает случайное число в интервале между двумя заданными числами.
+ROMAN = РИМСКОЕ ## Преобразует арабские цифры в римские в виде текста.
+ROUND = ОКРУГЛ ## Округляет число до указанного количества десятичных разрядов.
+ROUNDDOWN = ОКРУГЛВНИЗ ## Округляет число до ближайшего меньшего по модулю значения.
+ROUNDUP = ОКРУГЛВВЕРХ ## Округляет число до ближайшего большего по модулю значения.
+SERIESSUM = РЯД.СУММ ## Возвращает сумму степенного ряда, вычисленную по формуле.
+SIGN = ЗНАК ## Возвращает знак числа.
+SIN = SIN ## Возвращает синус заданного угла.
+SINH = SINH ## Возвращает гиперболический синус числа.
+SQRT = КОРЕНЬ ## Возвращает положительное значение квадратного корня.
+SQRTPI = КОРЕНЬПИ ## Возвращает квадратный корень из значения выражения (число * ПИ).
+SUBTOTAL = ПРОМЕЖУТОЧНЫЕ.ИТОГИ ## Возвращает промежуточный итог в списке или базе данных.
+SUM = СУММ ## Суммирует аргументы.
+SUMIF = СУММЕСЛИ ## Суммирует ячейки, удовлетворяющие заданному условию.
+SUMIFS = СУММЕСЛИМН ## Суммирует диапазон ячеек, удовлетворяющих нескольким условиям.
+SUMPRODUCT = СУММПРОИЗВ ## Возвращает сумму произведений соответствующих элементов массивов.
+SUMSQ = СУММКВ ## Возвращает сумму квадратов аргументов.
+SUMX2MY2 = СУММРАЗНКВ ## Возвращает сумму разностей квадратов соответствующих значений в двух массивах.
+SUMX2PY2 = СУММСУММКВ ## Возвращает сумму сумм квадратов соответствующих элементов двух массивов.
+SUMXMY2 = СУММКВРАЗН ## Возвращает сумму квадратов разностей соответствующих значений в двух массивах.
+TAN = TAN ## Возвращает тангенс числа.
+TANH = TANH ## Возвращает гиперболический тангенс числа.
+TRUNC = ОТБР ## Отбрасывает дробную часть числа.
+
+
+##
+## Statistical functions Статистические функции
+##
+AVEDEV = СРОТКЛ ## Возвращает среднее арифметическое абсолютных значений отклонений точек данных от среднего.
+AVERAGE = СРЗНАЧ ## Возвращает среднее арифметическое аргументов.
+AVERAGEA = СРЗНАЧА ## Возвращает среднее арифметическое аргументов, включая числа, текст и логические значения.
+AVERAGEIF = СРЗНАЧЕСЛИ ## Возвращает среднее значение (среднее арифметическое) всех ячеек в диапазоне, которые удовлетворяют данному условию.
+AVERAGEIFS = СРЗНАЧЕСЛИМН ## Возвращает среднее значение (среднее арифметическое) всех ячеек, которые удовлетворяют нескольким условиям.
+BETADIST = БЕТАРАСП ## Возвращает интегральную функцию бета-распределения.
+BETAINV = БЕТАОБР ## Возвращает обратную интегральную функцию указанного бета-распределения.
+BINOMDIST = БИНОМРАСП ## Возвращает отдельное значение биномиального распределения.
+CHIDIST = ХИ2РАСП ## Возвращает одностороннюю вероятность распределения хи-квадрат.
+CHIINV = ХИ2ОБР ## Возвращает обратное значение односторонней вероятности распределения хи-квадрат.
+CHITEST = ХИ2ТЕСТ ## Возвращает тест на независимость.
+CONFIDENCE = ДОВЕРИТ ## Возвращает доверительный интервал для среднего значения по генеральной совокупности.
+CORREL = КОРРЕЛ ## Возвращает коэффициент корреляции между двумя множествами данных.
+COUNT = СЧЁТ ## Подсчитывает количество чисел в списке аргументов.
+COUNTA = СЧЁТЗ ## Подсчитывает количество значений в списке аргументов.
+COUNTBLANK = СЧИТАТЬПУСТОТЫ ## Подсчитывает количество пустых ячеек в диапазоне
+COUNTIF = СЧЁТЕСЛИ ## Подсчитывает количество ячеек в диапазоне, удовлетворяющих заданному условию
+COUNTIFS = СЧЁТЕСЛИМН ## Подсчитывает количество ячеек внутри диапазона, удовлетворяющих нескольким условиям.
+COVAR = КОВАР ## Возвращает ковариацию, среднее произведений парных отклонений
+CRITBINOM = КРИТБИНОМ ## Возвращает наименьшее значение, для которого интегральное биномиальное распределение меньше или равно заданному критерию.
+DEVSQ = КВАДРОТКЛ ## Возвращает сумму квадратов отклонений.
+EXPONDIST = ЭКСПРАСП ## Возвращает экспоненциальное распределение.
+FDIST = FРАСП ## Возвращает F-распределение вероятности.
+FINV = FРАСПОБР ## Возвращает обратное значение для F-распределения вероятности.
+FISHER = ФИШЕР ## Возвращает преобразование Фишера.
+FISHERINV = ФИШЕРОБР ## Возвращает обратное преобразование Фишера.
+FORECAST = ПРЕДСКАЗ ## Возвращает значение линейного тренда.
+FREQUENCY = ЧАСТОТА ## Возвращает распределение частот в виде вертикального массива.
+FTEST = ФТЕСТ ## Возвращает результат F-теста.
+GAMMADIST = ГАММАРАСП ## Возвращает гамма-распределение.
+GAMMAINV = ГАММАОБР ## Возвращает обратное гамма-распределение.
+GAMMALN = ГАММАНЛОГ ## Возвращает натуральный логарифм гамма функции, Γ(x).
+GEOMEAN = СРГЕОМ ## Возвращает среднее геометрическое.
+GROWTH = РОСТ ## Возвращает значения в соответствии с экспоненциальным трендом.
+HARMEAN = СРГАРМ ## Возвращает среднее гармоническое.
+HYPGEOMDIST = ГИПЕРГЕОМЕТ ## Возвращает гипергеометрическое распределение.
+INTERCEPT = ОТРЕЗОК ## Возвращает отрезок, отсекаемый на оси линией линейной регрессии.
+KURT = ЭКСЦЕСС ## Возвращает эксцесс множества данных.
+LARGE = НАИБОЛЬШИЙ ## Возвращает k-ое наибольшее значение в множестве данных.
+LINEST = ЛИНЕЙН ## Возвращает параметры линейного тренда.
+LOGEST = ЛГРФПРИБЛ ## Возвращает параметры экспоненциального тренда.
+LOGINV = ЛОГНОРМОБР ## Возвращает обратное логарифмическое нормальное распределение.
+LOGNORMDIST = ЛОГНОРМРАСП ## Возвращает интегральное логарифмическое нормальное распределение.
+MAX = МАКС ## Возвращает наибольшее значение в списке аргументов.
+MAXA = МАКСА ## Возвращает наибольшее значение в списке аргументов, включая числа, текст и логические значения.
+MEDIAN = МЕДИАНА ## Возвращает медиану заданных чисел.
+MIN = МИН ## Возвращает наименьшее значение в списке аргументов.
+MINA = МИНА ## Возвращает наименьшее значение в списке аргументов, включая числа, текст и логические значения.
+MODE = МОДА ## Возвращает значение моды множества данных.
+NEGBINOMDIST = ОТРБИНОМРАСП ## Возвращает отрицательное биномиальное распределение.
+NORMDIST = НОРМРАСП ## Возвращает нормальную функцию распределения.
+NORMINV = НОРМОБР ## Возвращает обратное нормальное распределение.
+NORMSDIST = НОРМСТРАСП ## Возвращает стандартное нормальное интегральное распределение.
+NORMSINV = НОРМСТОБР ## Возвращает обратное значение стандартного нормального распределения.
+PEARSON = ПИРСОН ## Возвращает коэффициент корреляции Пирсона.
+PERCENTILE = ПЕРСЕНТИЛЬ ## Возвращает k-ую персентиль для значений диапазона.
+PERCENTRANK = ПРОЦЕНТРАНГ ## Возвращает процентную норму значения в множестве данных.
+PERMUT = ПЕРЕСТ ## Возвращает количество перестановок для заданного числа объектов.
+POISSON = ПУАССОН ## Возвращает распределение Пуассона.
+PROB = ВЕРОЯТНОСТЬ ## Возвращает вероятность того, что значение из диапазона находится внутри заданных пределов.
+QUARTILE = КВАРТИЛЬ ## Возвращает квартиль множества данных.
+RANK = РАНГ ## Возвращает ранг числа в списке чисел.
+RSQ = КВПИРСОН ## Возвращает квадрат коэффициента корреляции Пирсона.
+SKEW = СКОС ## Возвращает асимметрию распределения.
+SLOPE = НАКЛОН ## Возвращает наклон линии линейной регрессии.
+SMALL = НАИМЕНЬШИЙ ## Возвращает k-ое наименьшее значение в множестве данных.
+STANDARDIZE = НОРМАЛИЗАЦИЯ ## Возвращает нормализованное значение.
+STDEV = СТАНДОТКЛОН ## Оценивает стандартное отклонение по выборке.
+STDEVA = СТАНДОТКЛОНА ## Оценивает стандартное отклонение по выборке, включая числа, текст и логические значения.
+STDEVP = СТАНДОТКЛОНП ## Вычисляет стандартное отклонение по генеральной совокупности.
+STDEVPA = СТАНДОТКЛОНПА ## Вычисляет стандартное отклонение по генеральной совокупности, включая числа, текст и логические значения.
+STEYX = СТОШYX ## Возвращает стандартную ошибку предсказанных значений y для каждого значения x в регрессии.
+TDIST = СТЬЮДРАСП ## Возвращает t-распределение Стьюдента.
+TINV = СТЬЮДРАСПОБР ## Возвращает обратное t-распределение Стьюдента.
+TREND = ТЕНДЕНЦИЯ ## Возвращает значения в соответствии с линейным трендом.
+TRIMMEAN = УРЕЗСРЕДНЕЕ ## Возвращает среднее внутренности множества данных.
+TTEST = ТТЕСТ ## Возвращает вероятность, соответствующую критерию Стьюдента.
+VAR = ДИСП ## Оценивает дисперсию по выборке.
+VARA = ДИСПА ## Оценивает дисперсию по выборке, включая числа, текст и логические значения.
+VARP = ДИСПР ## Вычисляет дисперсию для генеральной совокупности.
+VARPA = ДИСПРА ## Вычисляет дисперсию для генеральной совокупности, включая числа, текст и логические значения.
+WEIBULL = ВЕЙБУЛЛ ## Возвращает распределение Вейбулла.
+ZTEST = ZТЕСТ ## Возвращает двустороннее P-значение z-теста.
+
+
+##
+## Text functions Текстовые функции
+##
+ASC = ASC ## Для языков с двухбайтовыми наборами знаков (например, катакана) преобразует полноширинные (двухбайтовые) знаки в полуширинные (однобайтовые).
+BAHTTEXT = БАТТЕКСТ ## Преобразует число в текст, используя денежный формат ß (БАТ).
+CHAR = СИМВОЛ ## Возвращает знак с заданным кодом.
+CLEAN = ПЕЧСИМВ ## Удаляет все непечатаемые знаки из текста.
+CODE = КОДСИМВ ## Возвращает числовой код первого знака в текстовой строке.
+CONCATENATE = СЦЕПИТЬ ## Объединяет несколько текстовых элементов в один.
+DOLLAR = РУБЛЬ ## Преобразует число в текст, используя денежный формат.
+EXACT = СОВПАД ## Проверяет идентичность двух текстовых значений.
+FIND = НАЙТИ ## Ищет вхождения одного текстового значения в другом (с учетом регистра).
+FINDB = НАЙТИБ ## Ищет вхождения одного текстового значения в другом (с учетом регистра).
+FIXED = ФИКСИРОВАННЫЙ ## Форматирует число и преобразует его в текст с заданным числом десятичных знаков.
+JIS = JIS ## Для языков с двухбайтовыми наборами знаков (например, катакана) преобразует полуширинные (однобайтовые) знаки в текстовой строке в полноширинные (двухбайтовые).
+LEFT = ЛЕВСИМВ ## Возвращает крайние слева знаки текстового значения.
+LEFTB = ЛЕВБ ## Возвращает крайние слева знаки текстового значения.
+LEN = ДЛСТР ## Возвращает количество знаков в текстовой строке.
+LENB = ДЛИНБ ## Возвращает количество знаков в текстовой строке.
+LOWER = СТРОЧН ## Преобразует все буквы текста в строчные.
+MID = ПСТР ## Возвращает заданное число знаков из строки текста, начиная с указанной позиции.
+MIDB = ПСТРБ ## Возвращает заданное число знаков из строки текста, начиная с указанной позиции.
+PHONETIC = PHONETIC ## Извлекает фонетические (фуригана) знаки из текстовой строки.
+PROPER = ПРОПНАЧ ## Преобразует первую букву в каждом слове текста в прописную.
+REPLACE = ЗАМЕНИТЬ ## Заменяет знаки в тексте.
+REPLACEB = ЗАМЕНИТЬБ ## Заменяет знаки в тексте.
+REPT = ПОВТОР ## Повторяет текст заданное число раз.
+RIGHT = ПРАВСИМВ ## Возвращает крайние справа знаки текстовой строки.
+RIGHTB = ПРАВБ ## Возвращает крайние справа знаки текстовой строки.
+SEARCH = ПОИСК ## Ищет вхождения одного текстового значения в другом (без учета регистра).
+SEARCHB = ПОИСКБ ## Ищет вхождения одного текстового значения в другом (без учета регистра).
+SUBSTITUTE = ПОДСТАВИТЬ ## Заменяет в текстовой строке старый текст новым.
+T = Т ## Преобразует аргументы в текст.
+TEXT = ТЕКСТ ## Форматирует число и преобразует его в текст.
+TRIM = СЖПРОБЕЛЫ ## Удаляет из текста пробелы.
+UPPER = ПРОПИСН ## Преобразует все буквы текста в прописные.
+VALUE = ЗНАЧЕН ## Преобразует текстовый аргумент в число.
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/cs/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/cs/config
new file mode 100644
index 00000000000..df513734c3f
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/cs/config
@@ -0,0 +1,23 @@
+##
+## PhpSpreadsheet
+##
+
+ArgumentSeparator = ;
+
+
+##
+## (For future use)
+##
+currencySymbol = Kč
+
+
+##
+## Excel Error Codes (For future use)
+##
+NULL = #NULL!
+DIV0 = #DIV/0!
+VALUE = #HODNOTA!
+REF = #REF!
+NAME = #NÁZEV?
+NUM = #NUM!
+NA = #N/A
diff --git a/lib/phpexcel/PHPExcel/locale/cs/functions b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/cs/functions
similarity index 95%
rename from lib/phpexcel/PHPExcel/locale/cs/functions
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/cs/functions
index c0a3cbbf9da..733d406f14f 100644
--- a/lib/phpexcel/PHPExcel/locale/cs/functions
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/cs/functions
@@ -1,438 +1,416 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Calculation
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/
-##
-##
-
-
-##
-## Add-in and Automation functions Funkce doplňků a automatizace
-##
-GETPIVOTDATA = ZÍSKATKONTDATA ## Vrátí data uložená v kontingenční tabulce. Pomocí funkce ZÍSKATKONTDATA můžete načíst souhrnná data z kontingenční tabulky, pokud jsou tato data v kontingenční sestavě zobrazena.
-
-
-##
-## Cube functions Funkce pro práci s krychlemi
-##
-CUBEKPIMEMBER = CUBEKPIMEMBER ## Vrátí název, vlastnost a velikost klíčového ukazatele výkonu (KUV) a zobrazí v buňce název a vlastnost. Klíčový ukazatel výkonu je kvantifikovatelná veličina, například hrubý měsíční zisk nebo čtvrtletní obrat na zaměstnance, která se používá pro sledování výkonnosti organizace.
-CUBEMEMBER = CUBEMEMBER ## Vrátí člen nebo n-tici v hierarchii krychle. Slouží k ověření, zda v krychli existuje člen nebo n-tice.
-CUBEMEMBERPROPERTY = CUBEMEMBERPROPERTY ## Vrátí hodnotu vlastnosti člena v krychli. Slouží k ověření, zda v krychli existuje člen s daným názvem, a k vrácení konkrétní vlastnosti tohoto člena.
-CUBERANKEDMEMBER = CUBERANKEDMEMBER ## Vrátí n-tý nebo pořadový člen sady. Použijte ji pro vrácení jednoho nebo více prvků sady, například obchodníka s nejvyšším obratem nebo deseti nejlepších studentů.
-CUBESET = CUBESET ## Definuje vypočtenou sadu členů nebo n-tic odesláním výrazu sady do krychle na serveru, který vytvoří sadu a potom ji vrátí do aplikace Microsoft Office Excel.
-CUBESETCOUNT = CUBESETCOUNT ## Vrátí počet položek v množině
-CUBEVALUE = CUBEVALUE ## Vrátí úhrnnou hodnotu z krychle.
-
-
-##
-## Database functions Funkce databáze
-##
-DAVERAGE = DPRŮMĚR ## Vrátí průměr vybraných položek databáze.
-DCOUNT = DPOČET ## Spočítá buňky databáze obsahující čísla.
-DCOUNTA = DPOČET2 ## Spočítá buňky databáze, které nejsou prázdné.
-DGET = DZÍSKAT ## Extrahuje z databáze jeden záznam splňující zadaná kritéria.
-DMAX = DMAX ## Vrátí maximální hodnotu z vybraných položek databáze.
-DMIN = DMIN ## Vrátí minimální hodnotu z vybraných položek databáze.
-DPRODUCT = DSOUČIN ## Vynásobí hodnoty určitého pole záznamů v databázi, které splňují daná kritéria.
-DSTDEV = DSMODCH.VÝBĚR ## Odhadne směrodatnou odchylku výběru vybraných položek databáze.
-DSTDEVP = DSMODCH ## Vypočte směrodatnou odchylku základního souboru vybraných položek databáze.
-DSUM = DSUMA ## Sečte čísla ve sloupcovém poli záznamů databáze, která splňují daná kritéria.
-DVAR = DVAR.VÝBĚR ## Odhadne rozptyl výběru vybraných položek databáze.
-DVARP = DVAR ## Vypočte rozptyl základního souboru vybraných položek databáze.
-
-
-##
-## Date and time functions Funkce data a času
-##
-DATE = DATUM ## Vrátí pořadové číslo určitého data.
-DATEVALUE = DATUMHODN ## Převede datum ve formě textu na pořadové číslo.
-DAY = DEN ## Převede pořadové číslo na den v měsíci.
-DAYS360 = ROK360 ## Vrátí počet dní mezi dvěma daty na základě roku s 360 dny.
-EDATE = EDATE ## Vrátí pořadové číslo data, které označuje určený počet měsíců před nebo po počátečním datu.
-EOMONTH = EOMONTH ## Vrátí pořadové číslo posledního dne měsíce před nebo po zadaném počtu měsíců.
-HOUR = HODINA ## Převede pořadové číslo na hodinu.
-MINUTE = MINUTA ## Převede pořadové číslo na minutu.
-MONTH = MĚSÍC ## Převede pořadové číslo na měsíc.
-NETWORKDAYS = NETWORKDAYS ## Vrátí počet celých pracovních dní mezi dvěma daty.
-NOW = NYNÍ ## Vrátí pořadové číslo aktuálního data a času.
-SECOND = SEKUNDA ## Převede pořadové číslo na sekundu.
-TIME = ČAS ## Vrátí pořadové číslo určitého času.
-TIMEVALUE = ČASHODN ## Převede čas ve formě textu na pořadové číslo.
-TODAY = DNES ## Vrátí pořadové číslo dnešního data.
-WEEKDAY = DENTÝDNE ## Převede pořadové číslo na den v týdnu.
-WEEKNUM = WEEKNUM ## Převede pořadové číslo na číslo představující číselnou pozici týdne v roce.
-WORKDAY = WORKDAY ## Vrátí pořadové číslo data před nebo po zadaném počtu pracovních dní.
-YEAR = ROK ## Převede pořadové číslo na rok.
-YEARFRAC = YEARFRAC ## Vrátí část roku vyjádřenou zlomkem a představující počet celých dní mezi počátečním a koncovým datem.
-
-
-##
-## Engineering functions Inženýrské funkce (Technické funkce)
-##
-BESSELI = BESSELI ## Vrátí modifikovanou Besselovu funkci In(x).
-BESSELJ = BESSELJ ## Vrátí modifikovanou Besselovu funkci Jn(x).
-BESSELK = BESSELK ## Vrátí modifikovanou Besselovu funkci Kn(x).
-BESSELY = BESSELY ## Vrátí Besselovu funkci Yn(x).
-BIN2DEC = BIN2DEC ## Převede binární číslo na desítkové.
-BIN2HEX = BIN2HEX ## Převede binární číslo na šestnáctkové.
-BIN2OCT = BIN2OCT ## Převede binární číslo na osmičkové.
-COMPLEX = COMPLEX ## Převede reálnou a imaginární část na komplexní číslo.
-CONVERT = CONVERT ## Převede číslo do jiného jednotkového měrného systému.
-DEC2BIN = DEC2BIN ## Převede desítkového čísla na dvojkové
-DEC2HEX = DEC2HEX ## Převede desítkové číslo na šestnáctkové.
-DEC2OCT = DEC2OCT ## Převede desítkové číslo na osmičkové.
-DELTA = DELTA ## Testuje rovnost dvou hodnot.
-ERF = ERF ## Vrátí chybovou funkci.
-ERFC = ERFC ## Vrátí doplňkovou chybovou funkci.
-GESTEP = GESTEP ## Testuje, zda je číslo větší než mezní hodnota.
-HEX2BIN = HEX2BIN ## Převede šestnáctkové číslo na binární.
-HEX2DEC = HEX2DEC ## Převede šestnáctkové číslo na desítkové.
-HEX2OCT = HEX2OCT ## Převede šestnáctkové číslo na osmičkové.
-IMABS = IMABS ## Vrátí absolutní hodnotu (modul) komplexního čísla.
-IMAGINARY = IMAGINARY ## Vrátí imaginární část komplexního čísla.
-IMARGUMENT = IMARGUMENT ## Vrátí argument théta, úhel vyjádřený v radiánech.
-IMCONJUGATE = IMCONJUGATE ## Vrátí komplexně sdružené číslo ke komplexnímu číslu.
-IMCOS = IMCOS ## Vrátí kosinus komplexního čísla.
-IMDIV = IMDIV ## Vrátí podíl dvou komplexních čísel.
-IMEXP = IMEXP ## Vrátí exponenciální tvar komplexního čísla.
-IMLN = IMLN ## Vrátí přirozený logaritmus komplexního čísla.
-IMLOG10 = IMLOG10 ## Vrátí dekadický logaritmus komplexního čísla.
-IMLOG2 = IMLOG2 ## Vrátí logaritmus komplexního čísla při základu 2.
-IMPOWER = IMPOWER ## Vrátí komplexní číslo umocněné na celé číslo.
-IMPRODUCT = IMPRODUCT ## Vrátí součin komplexních čísel.
-IMREAL = IMREAL ## Vrátí reálnou část komplexního čísla.
-IMSIN = IMSIN ## Vrátí sinus komplexního čísla.
-IMSQRT = IMSQRT ## Vrátí druhou odmocninu komplexního čísla.
-IMSUB = IMSUB ## Vrátí rozdíl mezi dvěma komplexními čísly.
-IMSUM = IMSUM ## Vrátí součet dvou komplexních čísel.
-OCT2BIN = OCT2BIN ## Převede osmičkové číslo na binární.
-OCT2DEC = OCT2DEC ## Převede osmičkové číslo na desítkové.
-OCT2HEX = OCT2HEX ## Převede osmičkové číslo na šestnáctkové.
-
-
-##
-## Financial functions Finanční funkce
-##
-ACCRINT = ACCRINT ## Vrátí nahromaděný úrok z cenného papíru, ze kterého je úrok placen v pravidelných termínech.
-ACCRINTM = ACCRINTM ## Vrátí nahromaděný úrok z cenného papíru, ze kterého je úrok placen k datu splatnosti.
-AMORDEGRC = AMORDEGRC ## Vrátí lineární amortizaci v každém účetním období pomocí koeficientu amortizace.
-AMORLINC = AMORLINC ## Vrátí lineární amortizaci v každém účetním období.
-COUPDAYBS = COUPDAYBS ## Vrátí počet dnů od začátku období placení kupónů do data splatnosti.
-COUPDAYS = COUPDAYS ## Vrátí počet dnů v období placení kupónů, které obsahuje den zúčtování.
-COUPDAYSNC = COUPDAYSNC ## Vrátí počet dnů od data zúčtování do následujícího data placení kupónu.
-COUPNCD = COUPNCD ## Vrátí následující datum placení kupónu po datu zúčtování.
-COUPNUM = COUPNUM ## Vrátí počet kupónů splatných mezi datem zúčtování a datem splatnosti.
-COUPPCD = COUPPCD ## Vrátí předchozí datum placení kupónu před datem zúčtování.
-CUMIPMT = CUMIPMT ## Vrátí kumulativní úrok splacený mezi dvěma obdobími.
-CUMPRINC = CUMPRINC ## Vrátí kumulativní jistinu splacenou mezi dvěma obdobími půjčky.
-DB = ODPIS.ZRYCH ## Vrátí odpis aktiva za určité období pomocí degresivní metody odpisu s pevným zůstatkem.
-DDB = ODPIS.ZRYCH2 ## Vrátí odpis aktiva za určité období pomocí dvojité degresivní metody odpisu nebo jiné metody, kterou zadáte.
-DISC = DISC ## Vrátí diskontní sazbu cenného papíru.
-DOLLARDE = DOLLARDE ## Převede částku v korunách vyjádřenou zlomkem na částku v korunách vyjádřenou desetinným číslem.
-DOLLARFR = DOLLARFR ## Převede částku v korunách vyjádřenou desetinným číslem na částku v korunách vyjádřenou zlomkem.
-DURATION = DURATION ## Vrátí roční dobu cenného papíru s pravidelnými úrokovými sazbami.
-EFFECT = EFFECT ## Vrátí efektivní roční úrokovou sazbu.
-FV = BUDHODNOTA ## Vrátí budoucí hodnotu investice.
-FVSCHEDULE = FVSCHEDULE ## Vrátí budoucí hodnotu počáteční jistiny po použití série sazeb složitého úroku.
-INTRATE = INTRATE ## Vrátí úrokovou sazbu plně investovaného cenného papíru.
-IPMT = PLATBA.ÚROK ## Vrátí výšku úroku investice za dané období.
-IRR = MÍRA.VÝNOSNOSTI ## Vrátí vnitřní výnosové procento série peněžních toků.
-ISPMT = ISPMT ## Vypočte výši úroku z investice zaplaceného během určitého období.
-MDURATION = MDURATION ## Vrátí Macauleyho modifikovanou dobu cenného papíru o nominální hodnotě 100 Kč.
-MIRR = MOD.MÍRA.VÝNOSNOSTI ## Vrátí vnitřní sazbu výnosu, přičemž kladné a záporné hodnoty peněžních prostředků jsou financovány podle různých sazeb.
-NOMINAL = NOMINAL ## Vrátí nominální roční úrokovou sazbu.
-NPER = POČET.OBDOBÍ ## Vrátí počet období pro investici.
-NPV = ČISTÁ.SOUČHODNOTA ## Vrátí čistou současnou hodnotu investice vypočítanou na základě série pravidelných peněžních toků a diskontní sazby.
-ODDFPRICE = ODDFPRICE ## Vrátí cenu cenného papíru o nominální hodnotě 100 Kč s odlišným prvním obdobím.
-ODDFYIELD = ODDFYIELD ## Vrátí výnos cenného papíru s odlišným prvním obdobím.
-ODDLPRICE = ODDLPRICE ## Vrátí cenu cenného papíru o nominální hodnotě 100 Kč s odlišným posledním obdobím.
-ODDLYIELD = ODDLYIELD ## Vrátí výnos cenného papíru s odlišným posledním obdobím.
-PMT = PLATBA ## Vrátí hodnotu pravidelné splátky anuity.
-PPMT = PLATBA.ZÁKLAD ## Vrátí hodnotu splátky jistiny pro zadanou investici za dané období.
-PRICE = PRICE ## Vrátí cenu cenného papíru o nominální hodnotě 100 Kč, ze kterého je úrok placen v pravidelných termínech.
-PRICEDISC = PRICEDISC ## Vrátí cenu diskontního cenného papíru o nominální hodnotě 100 Kč.
-PRICEMAT = PRICEMAT ## Vrátí cenu cenného papíru o nominální hodnotě 100 Kč, ze kterého je úrok placen k datu splatnosti.
-PV = SOUČHODNOTA ## Vrátí současnou hodnotu investice.
-RATE = ÚROKOVÁ.MÍRA ## Vrátí úrokovou sazbu vztaženou na období anuity.
-RECEIVED = RECEIVED ## Vrátí částku obdrženou k datu splatnosti plně investovaného cenného papíru.
-SLN = ODPIS.LIN ## Vrátí přímé odpisy aktiva pro jedno období.
-SYD = ODPIS.NELIN ## Vrátí směrné číslo ročních odpisů aktiva pro zadané období.
-TBILLEQ = TBILLEQ ## Vrátí výnos směnky státní pokladny ekvivalentní výnosu obligace.
-TBILLPRICE = TBILLPRICE ## Vrátí cenu směnky státní pokladny o nominální hodnotě 100 Kč.
-TBILLYIELD = TBILLYIELD ## Vrátí výnos směnky státní pokladny.
-VDB = ODPIS.ZA.INT ## Vrátí odpis aktiva pro určité období nebo část období pomocí degresivní metody odpisu.
-XIRR = XIRR ## Vrátí vnitřní výnosnost pro harmonogram peněžních toků, který nemusí být nutně periodický.
-XNPV = XNPV ## Vrátí čistou současnou hodnotu pro harmonogram peněžních toků, který nemusí být nutně periodický.
-YIELD = YIELD ## Vrátí výnos cenného papíru, ze kterého je úrok placen v pravidelných termínech.
-YIELDDISC = YIELDDISC ## Vrátí roční výnos diskontního cenného papíru, například směnky státní pokladny.
-YIELDMAT = YIELDMAT ## Vrátí roční výnos cenného papíru, ze kterého je úrok placen k datu splatnosti.
-
-
-##
-## Information functions Informační funkce
-##
-CELL = POLÍČKO ## Vrátí informace o formátování, umístění nebo obsahu buňky.
-ERROR.TYPE = CHYBA.TYP ## Vrátí číslo odpovídající typu chyby.
-INFO = O.PROSTŘEDÍ ## Vrátí informace o aktuálním pracovním prostředí.
-ISBLANK = JE.PRÁZDNÉ ## Vrátí hodnotu PRAVDA, pokud se argument hodnota odkazuje na prázdnou buňku.
-ISERR = JE.CHYBA ## Vrátí hodnotu PRAVDA, pokud je argument hodnota libovolná chybová hodnota (kromě #N/A).
-ISERROR = JE.CHYBHODN ## Vrátí hodnotu PRAVDA, pokud je argument hodnota libovolná chybová hodnota.
-ISEVEN = ISEVEN ## Vrátí hodnotu PRAVDA, pokud je číslo sudé.
-ISLOGICAL = JE.LOGHODN ## Vrátí hodnotu PRAVDA, pokud je argument hodnota logická hodnota.
-ISNA = JE.NEDEF ## Vrátí hodnotu PRAVDA, pokud je argument hodnota chybová hodnota #N/A.
-ISNONTEXT = JE.NETEXT ## Vrátí hodnotu PRAVDA, pokud argument hodnota není text.
-ISNUMBER = JE.ČÍSLO ## Vrátí hodnotu PRAVDA, pokud je argument hodnota číslo.
-ISODD = ISODD ## Vrátí hodnotu PRAVDA, pokud je číslo liché.
-ISREF = JE.ODKAZ ## Vrátí hodnotu PRAVDA, pokud je argument hodnota odkaz.
-ISTEXT = JE.TEXT ## Vrátí hodnotu PRAVDA, pokud je argument hodnota text.
-N = N ## Vrátí hodnotu převedenou na číslo.
-NA = NEDEF ## Vrátí chybovou hodnotu #N/A.
-TYPE = TYP ## Vrátí číslo označující datový typ hodnoty.
-
-
-##
-## Logical functions Logické funkce
-##
-AND = A ## Vrátí hodnotu PRAVDA, mají-li všechny argumenty hodnotu PRAVDA.
-FALSE = NEPRAVDA ## Vrátí logickou hodnotu NEPRAVDA.
-IF = KDYŽ ## Určí, který logický test má proběhnout.
-IFERROR = IFERROR ## Pokud je vzorec vyhodnocen jako chyba, vrátí zadanou hodnotu. V opačném případě vrátí výsledek vzorce.
-NOT = NE ## Provede logickou negaci argumentu funkce.
-OR = NEBO ## Vrátí hodnotu PRAVDA, je-li alespoň jeden argument roven hodnotě PRAVDA.
-TRUE = PRAVDA ## Vrátí logickou hodnotu PRAVDA.
-
-
-##
-## Lookup and reference functions Vyhledávací funkce
-##
-ADDRESS = ODKAZ ## Vrátí textový odkaz na jednu buňku listu.
-AREAS = POČET.BLOKŮ ## Vrátí počet oblastí v odkazu.
-CHOOSE = ZVOLIT ## Zvolí hodnotu ze seznamu hodnot.
-COLUMN = SLOUPEC ## Vrátí číslo sloupce odkazu.
-COLUMNS = SLOUPCE ## Vrátí počet sloupců v odkazu.
-HLOOKUP = VVYHLEDAT ## Prohledá horní řádek matice a vrátí hodnotu určené buňky.
-HYPERLINK = HYPERTEXTOVÝ.ODKAZ ## Vytvoří zástupce nebo odkaz, který otevře dokument uložený na síťovém serveru, v síti intranet nebo Internet.
-INDEX = INDEX ## Pomocí rejstříku zvolí hodnotu z odkazu nebo matice.
-INDIRECT = NEPŘÍMÝ.ODKAZ ## Vrátí odkaz určený textovou hodnotou.
-LOOKUP = VYHLEDAT ## Vyhledá hodnoty ve vektoru nebo matici.
-MATCH = POZVYHLEDAT ## Vyhledá hodnoty v odkazu nebo matici.
-OFFSET = POSUN ## Vrátí posun odkazu od zadaného odkazu.
-ROW = ŘÁDEK ## Vrátí číslo řádku odkazu.
-ROWS = ŘÁDKY ## Vrátí počet řádků v odkazu.
-RTD = RTD ## Načte data reálného času z programu, který podporuje automatizaci modelu COM (Automatizace: Způsob práce s objekty určité aplikace z jiné aplikace nebo nástroje pro vývoj. Automatizace (dříve nazývaná automatizace OLE) je počítačovým standardem a je funkcí modelu COM (Component Object Model).).
-TRANSPOSE = TRANSPOZICE ## Vrátí transponovanou matici.
-VLOOKUP = SVYHLEDAT ## Prohledá první sloupec matice, přesune kurzor v řádku a vrátí hodnotu buňky.
-
-
-##
-## Math and trigonometry functions Matematické a trigonometrické funkce
-##
-ABS = ABS ## Vrátí absolutní hodnotu čísla.
-ACOS = ARCCOS ## Vrátí arkuskosinus čísla.
-ACOSH = ARCCOSH ## Vrátí hyperbolický arkuskosinus čísla.
-ASIN = ARCSIN ## Vrátí arkussinus čísla.
-ASINH = ARCSINH ## Vrátí hyperbolický arkussinus čísla.
-ATAN = ARCTG ## Vrátí arkustangens čísla.
-ATAN2 = ARCTG2 ## Vrátí arkustangens x-ové a y-ové souřadnice.
-ATANH = ARCTGH ## Vrátí hyperbolický arkustangens čísla.
-CEILING = ZAOKR.NAHORU ## Zaokrouhlí číslo na nejbližší celé číslo nebo na nejbližší násobek zadané hodnoty.
-COMBIN = KOMBINACE ## Vrátí počet kombinací pro daný počet položek.
-COS = COS ## Vrátí kosinus čísla.
-COSH = COSH ## Vrátí hyperbolický kosinus čísla.
-DEGREES = DEGREES ## Převede radiány na stupně.
-EVEN = ZAOKROUHLIT.NA.SUDÉ ## Zaokrouhlí číslo nahoru na nejbližší celé sudé číslo.
-EXP = EXP ## Vrátí základ přirozeného logaritmu e umocněný na zadané číslo.
-FACT = FAKTORIÁL ## Vrátí faktoriál čísla.
-FACTDOUBLE = FACTDOUBLE ## Vrátí dvojitý faktoriál čísla.
-FLOOR = ZAOKR.DOLŮ ## Zaokrouhlí číslo dolů, směrem k nule.
-GCD = GCD ## Vrátí největší společný dělitel.
-INT = CELÁ.ČÁST ## Zaokrouhlí číslo dolů na nejbližší celé číslo.
-LCM = LCM ## Vrátí nejmenší společný násobek.
-LN = LN ## Vrátí přirozený logaritmus čísla.
-LOG = LOGZ ## Vrátí logaritmus čísla při zadaném základu.
-LOG10 = LOG ## Vrátí dekadický logaritmus čísla.
-MDETERM = DETERMINANT ## Vrátí determinant matice.
-MINVERSE = INVERZE ## Vrátí inverzní matici.
-MMULT = SOUČIN.MATIC ## Vrátí součin dvou matic.
-MOD = MOD ## Vrátí zbytek po dělení.
-MROUND = MROUND ## Vrátí číslo zaokrouhlené na požadovaný násobek.
-MULTINOMIAL = MULTINOMIAL ## Vrátí mnohočlen z množiny čísel.
-ODD = ZAOKROUHLIT.NA.LICHÉ ## Zaokrouhlí číslo nahoru na nejbližší celé liché číslo.
-PI = PI ## Vrátí hodnotu čísla pí.
-POWER = POWER ## Umocní číslo na zadanou mocninu.
-PRODUCT = SOUČIN ## Vynásobí argumenty funkce.
-QUOTIENT = QUOTIENT ## Vrátí celou část dělení.
-RADIANS = RADIANS ## Převede stupně na radiány.
-RAND = NÁHČÍSLO ## Vrátí náhodné číslo mezi 0 a 1.
-RANDBETWEEN = RANDBETWEEN ## Vrátí náhodné číslo mezi zadanými čísly.
-ROMAN = ROMAN ## Převede arabskou číslici na římskou ve formátu textu.
-ROUND = ZAOKROUHLIT ## Zaokrouhlí číslo na zadaný počet číslic.
-ROUNDDOWN = ROUNDDOWN ## Zaokrouhlí číslo dolů, směrem k nule.
-ROUNDUP = ROUNDUP ## Zaokrouhlí číslo nahoru, směrem od nuly.
-SERIESSUM = SERIESSUM ## Vrátí součet mocninné řady určené podle vzorce.
-SIGN = SIGN ## Vrátí znaménko čísla.
-SIN = SIN ## Vrátí sinus daného úhlu.
-SINH = SINH ## Vrátí hyperbolický sinus čísla.
-SQRT = ODMOCNINA ## Vrátí kladnou druhou odmocninu.
-SQRTPI = SQRTPI ## Vrátí druhou odmocninu výrazu (číslo * pí).
-SUBTOTAL = SUBTOTAL ## Vrátí souhrn v seznamu nebo databázi.
-SUM = SUMA ## Sečte argumenty funkce.
-SUMIF = SUMIF ## Sečte buňky vybrané podle zadaných kritérií.
-SUMIFS = SUMIFS ## Sečte buňky určené více zadanými podmínkami.
-SUMPRODUCT = SOUČIN.SKALÁRNÍ ## Vrátí součet součinů odpovídajících prvků matic.
-SUMSQ = SUMA.ČTVERCŮ ## Vrátí součet čtverců argumentů.
-SUMX2MY2 = SUMX2MY2 ## Vrátí součet rozdílu čtverců odpovídajících hodnot ve dvou maticích.
-SUMX2PY2 = SUMX2PY2 ## Vrátí součet součtu čtverců odpovídajících hodnot ve dvou maticích.
-SUMXMY2 = SUMXMY2 ## Vrátí součet čtverců rozdílů odpovídajících hodnot ve dvou maticích.
-TAN = TGTG ## Vrátí tangens čísla.
-TANH = TGH ## Vrátí hyperbolický tangens čísla.
-TRUNC = USEKNOUT ## Zkrátí číslo na celé číslo.
-
-
-##
-## Statistical functions Statistické funkce
-##
-AVEDEV = PRŮMODCHYLKA ## Vrátí průměrnou hodnotu absolutních odchylek datových bodů od jejich střední hodnoty.
-AVERAGE = PRŮMĚR ## Vrátí průměrnou hodnotu argumentů.
-AVERAGEA = AVERAGEA ## Vrátí průměrnou hodnotu argumentů včetně čísel, textu a logických hodnot.
-AVERAGEIF = AVERAGEIF ## Vrátí průměrnou hodnotu (aritmetický průměr) všech buněk v oblasti, které vyhovují příslušné podmínce.
-AVERAGEIFS = AVERAGEIFS ## Vrátí průměrnou hodnotu (aritmetický průměr) všech buněk vyhovujících několika podmínkám.
-BETADIST = BETADIST ## Vrátí hodnotu součtového rozdělení beta.
-BETAINV = BETAINV ## Vrátí inverzní hodnotu součtového rozdělení pro zadané rozdělení beta.
-BINOMDIST = BINOMDIST ## Vrátí hodnotu binomického rozdělení pravděpodobnosti jednotlivých veličin.
-CHIDIST = CHIDIST ## Vrátí jednostrannou pravděpodobnost rozdělení chí-kvadrát.
-CHIINV = CHIINV ## Vrátí hodnotu funkce inverzní k distribuční funkci jednostranné pravděpodobnosti rozdělení chí-kvadrát.
-CHITEST = CHITEST ## Vrátí test nezávislosti.
-CONFIDENCE = CONFIDENCE ## Vrátí interval spolehlivosti pro střední hodnotu základního souboru.
-CORREL = CORREL ## Vrátí korelační koeficient mezi dvěma množinami dat.
-COUNT = POČET ## Vrátí počet čísel v seznamu argumentů.
-COUNTA = POČET2 ## Vrátí počet hodnot v seznamu argumentů.
-COUNTBLANK = COUNTBLANK ## Spočítá počet prázdných buněk v oblasti.
-COUNTIF = COUNTIF ## Spočítá buňky v oblasti, které odpovídají zadaným kritériím.
-COUNTIFS = COUNTIFS ## Spočítá buňky v oblasti, které odpovídají více kritériím.
-COVAR = COVAR ## Vrátí hodnotu kovariance, průměrnou hodnotu součinů párových odchylek
-CRITBINOM = CRITBINOM ## Vrátí nejmenší hodnotu, pro kterou má součtové binomické rozdělení hodnotu větší nebo rovnu hodnotě kritéria.
-DEVSQ = DEVSQ ## Vrátí součet čtverců odchylek.
-EXPONDIST = EXPONDIST ## Vrátí hodnotu exponenciálního rozdělení.
-FDIST = FDIST ## Vrátí hodnotu rozdělení pravděpodobnosti F.
-FINV = FINV ## Vrátí hodnotu inverzní funkce k distribuční funkci rozdělení F.
-FISHER = FISHER ## Vrátí hodnotu Fisherovy transformace.
-FISHERINV = FISHERINV ## Vrátí hodnotu inverzní funkce k Fisherově transformaci.
-FORECAST = FORECAST ## Vrátí hodnotu lineárního trendu.
-FREQUENCY = ČETNOSTI ## Vrátí četnost rozdělení jako svislou matici.
-FTEST = FTEST ## Vrátí výsledek F-testu.
-GAMMADIST = GAMMADIST ## Vrátí hodnotu rozdělení gama.
-GAMMAINV = GAMMAINV ## Vrátí hodnotu inverzní funkce k distribuční funkci součtového rozdělení gama.
-GAMMALN = GAMMALN ## Vrátí přirozený logaritmus funkce gama, Γ(x).
-GEOMEAN = GEOMEAN ## Vrátí geometrický průměr.
-GROWTH = LOGLINTREND ## Vrátí hodnoty exponenciálního trendu.
-HARMEAN = HARMEAN ## Vrátí harmonický průměr.
-HYPGEOMDIST = HYPGEOMDIST ## Vrátí hodnotu hypergeometrického rozdělení.
-INTERCEPT = INTERCEPT ## Vrátí úsek lineární regresní čáry.
-KURT = KURT ## Vrátí hodnotu excesu množiny dat.
-LARGE = LARGE ## Vrátí k-tou největší hodnotu množiny dat.
-LINEST = LINREGRESE ## Vrátí parametry lineárního trendu.
-LOGEST = LOGLINREGRESE ## Vrátí parametry exponenciálního trendu.
-LOGINV = LOGINV ## Vrátí inverzní funkci k distribuční funkci logaritmicko-normálního rozdělení.
-LOGNORMDIST = LOGNORMDIST ## Vrátí hodnotu součtového logaritmicko-normálního rozdělení.
-MAX = MAX ## Vrátí maximální hodnotu seznamu argumentů.
-MAXA = MAXA ## Vrátí maximální hodnotu seznamu argumentů včetně čísel, textu a logických hodnot.
-MEDIAN = MEDIAN ## Vrátí střední hodnotu zadaných čísel.
-MIN = MIN ## Vrátí minimální hodnotu seznamu argumentů.
-MINA = MINA ## Vrátí nejmenší hodnotu v seznamu argumentů včetně čísel, textu a logických hodnot.
-MODE = MODE ## Vrátí hodnotu, která se v množině dat vyskytuje nejčastěji.
-NEGBINOMDIST = NEGBINOMDIST ## Vrátí hodnotu negativního binomického rozdělení.
-NORMDIST = NORMDIST ## Vrátí hodnotu normálního součtového rozdělení.
-NORMINV = NORMINV ## Vrátí inverzní funkci k funkci normálního součtového rozdělení.
-NORMSDIST = NORMSDIST ## Vrátí hodnotu standardního normálního součtového rozdělení.
-NORMSINV = NORMSINV ## Vrátí inverzní funkci k funkci standardního normálního součtového rozdělení.
-PEARSON = PEARSON ## Vrátí Pearsonův výsledný momentový korelační koeficient.
-PERCENTILE = PERCENTIL ## Vrátí hodnotu k-tého percentilu hodnot v oblasti.
-PERCENTRANK = PERCENTRANK ## Vrátí pořadí hodnoty v množině dat vyjádřené procentuální částí množiny dat.
-PERMUT = PERMUTACE ## Vrátí počet permutací pro zadaný počet objektů.
-POISSON = POISSON ## Vrátí hodnotu distribuční funkce Poissonova rozdělení.
-PROB = PROB ## Vrátí pravděpodobnost výskytu hodnot v oblasti mezi dvěma mezními hodnotami.
-QUARTILE = QUARTIL ## Vrátí hodnotu kvartilu množiny dat.
-RANK = RANK ## Vrátí pořadí čísla v seznamu čísel.
-RSQ = RKQ ## Vrátí druhou mocninu Pearsonova výsledného momentového korelačního koeficientu.
-SKEW = SKEW ## Vrátí zešikmení rozdělení.
-SLOPE = SLOPE ## Vrátí směrnici lineární regresní čáry.
-SMALL = SMALL ## Vrátí k-tou nejmenší hodnotu množiny dat.
-STANDARDIZE = STANDARDIZE ## Vrátí normalizovanou hodnotu.
-STDEV = SMODCH.VÝBĚR ## Vypočte směrodatnou odchylku výběru.
-STDEVA = STDEVA ## Vypočte směrodatnou odchylku výběru včetně čísel, textu a logických hodnot.
-STDEVP = SMODCH ## Vypočte směrodatnou odchylku základního souboru.
-STDEVPA = STDEVPA ## Vypočte směrodatnou odchylku základního souboru včetně čísel, textu a logických hodnot.
-STEYX = STEYX ## Vrátí standardní chybu předpovězené hodnoty y pro každou hodnotu x v regresi.
-TDIST = TDIST ## Vrátí hodnotu Studentova t-rozdělení.
-TINV = TINV ## Vrátí inverzní funkci k distribuční funkci Studentova t-rozdělení.
-TREND = LINTREND ## Vrátí hodnoty lineárního trendu.
-TRIMMEAN = TRIMMEAN ## Vrátí střední hodnotu vnitřní části množiny dat.
-TTEST = TTEST ## Vrátí pravděpodobnost spojenou se Studentovým t-testem.
-VAR = VAR.VÝBĚR ## Vypočte rozptyl výběru.
-VARA = VARA ## Vypočte rozptyl výběru včetně čísel, textu a logických hodnot.
-VARP = VAR ## Vypočte rozptyl základního souboru.
-VARPA = VARPA ## Vypočte rozptyl základního souboru včetně čísel, textu a logických hodnot.
-WEIBULL = WEIBULL ## Vrátí hodnotu Weibullova rozdělení.
-ZTEST = ZTEST ## Vrátí jednostrannou P-hodnotu z-testu.
-
-
-##
-## Text functions Textové funkce
-##
-ASC = ASC ## Změní znaky s plnou šířkou (dvoubajtové)v řetězci znaků na znaky s poloviční šířkou (jednobajtové).
-BAHTTEXT = BAHTTEXT ## Převede číslo na text ve formátu, měny ß (baht).
-CHAR = ZNAK ## Vrátí znak určený číslem kódu.
-CLEAN = VYČISTIT ## Odebere z textu všechny netisknutelné znaky.
-CODE = KÓD ## Vrátí číselný kód prvního znaku zadaného textového řetězce.
-CONCATENATE = CONCATENATE ## Spojí několik textových položek do jedné.
-DOLLAR = KČ ## Převede číslo na text ve formátu měny Kč (česká koruna).
-EXACT = STEJNÉ ## Zkontroluje, zda jsou dvě textové hodnoty shodné.
-FIND = NAJÍT ## Nalezne textovou hodnotu uvnitř jiné (rozlišuje malá a velká písmena).
-FINDB = FINDB ## Nalezne textovou hodnotu uvnitř jiné (rozlišuje malá a velká písmena).
-FIXED = ZAOKROUHLIT.NA.TEXT ## Zformátuje číslo jako text s pevným počtem desetinných míst.
-JIS = JIS ## Změní znaky s poloviční šířkou (jednobajtové) v řetězci znaků na znaky s plnou šířkou (dvoubajtové).
-LEFT = ZLEVA ## Vrátí první znaky textové hodnoty umístěné nejvíce vlevo.
-LEFTB = LEFTB ## Vrátí první znaky textové hodnoty umístěné nejvíce vlevo.
-LEN = DÉLKA ## Vrátí počet znaků textového řetězce.
-LENB = LENB ## Vrátí počet znaků textového řetězce.
-LOWER = MALÁ ## Převede text na malá písmena.
-MID = ČÁST ## Vrátí určitý počet znaků textového řetězce počínaje zadaným místem.
-MIDB = MIDB ## Vrátí určitý počet znaků textového řetězce počínaje zadaným místem.
-PHONETIC = ZVUKOVÉ ## Extrahuje fonetické znaky (furigana) z textového řetězce.
-PROPER = VELKÁ2 ## Převede první písmeno každého slova textové hodnoty na velké.
-REPLACE = NAHRADIT ## Nahradí znaky uvnitř textu.
-REPLACEB = NAHRADITB ## Nahradí znaky uvnitř textu.
-REPT = OPAKOVAT ## Zopakuje text podle zadaného počtu opakování.
-RIGHT = ZPRAVA ## Vrátí první znaky textové hodnoty umístěné nejvíce vpravo.
-RIGHTB = RIGHTB ## Vrátí první znaky textové hodnoty umístěné nejvíce vpravo.
-SEARCH = HLEDAT ## Nalezne textovou hodnotu uvnitř jiné (malá a velká písmena nejsou rozlišována).
-SEARCHB = SEARCHB ## Nalezne textovou hodnotu uvnitř jiné (malá a velká písmena nejsou rozlišována).
-SUBSTITUTE = DOSADIT ## V textovém řetězci nahradí starý text novým.
-T = T ## Převede argumenty na text.
-TEXT = HODNOTA.NA.TEXT ## Zformátuje číslo a převede ho na text.
-TRIM = PROČISTIT ## Odstraní z textu mezery.
-UPPER = VELKÁ ## Převede text na velká písmena.
-VALUE = HODNOTA ## Převede textový argument na číslo.
+##
+## PhpSpreadsheet
+##
+## Data in this file derived from https://www.excel-function-translation.com/
+##
+##
+
+
+##
+## Add-in and Automation functions Funkce doplňků a automatizace
+##
+GETPIVOTDATA = ZÍSKATKONTDATA ## Vrátí data uložená v kontingenční tabulce. Pomocí funkce ZÍSKATKONTDATA můžete načíst souhrnná data z kontingenční tabulky, pokud jsou tato data v kontingenční sestavě zobrazena.
+
+
+##
+## Cube functions Funkce pro práci s krychlemi
+##
+CUBEKPIMEMBER = CUBEKPIMEMBER ## Vrátí název, vlastnost a velikost klíčového ukazatele výkonu (KUV) a zobrazí v buňce název a vlastnost. Klíčový ukazatel výkonu je kvantifikovatelná veličina, například hrubý měsíční zisk nebo čtvrtletní obrat na zaměstnance, která se používá pro sledování výkonnosti organizace.
+CUBEMEMBER = CUBEMEMBER ## Vrátí člen nebo n-tici v hierarchii krychle. Slouží k ověření, zda v krychli existuje člen nebo n-tice.
+CUBEMEMBERPROPERTY = CUBEMEMBERPROPERTY ## Vrátí hodnotu vlastnosti člena v krychli. Slouží k ověření, zda v krychli existuje člen s daným názvem, a k vrácení konkrétní vlastnosti tohoto člena.
+CUBERANKEDMEMBER = CUBERANKEDMEMBER ## Vrátí n-tý nebo pořadový člen sady. Použijte ji pro vrácení jednoho nebo více prvků sady, například obchodníka s nejvyšším obratem nebo deseti nejlepších studentů.
+CUBESET = CUBESET ## Definuje vypočtenou sadu členů nebo n-tic odesláním výrazu sady do krychle na serveru, který vytvoří sadu a potom ji vrátí do aplikace Microsoft Office Excel.
+CUBESETCOUNT = CUBESETCOUNT ## Vrátí počet položek v množině
+CUBEVALUE = CUBEVALUE ## Vrátí úhrnnou hodnotu z krychle.
+
+
+##
+## Database functions Funkce databáze
+##
+DAVERAGE = DPRŮMĚR ## Vrátí průměr vybraných položek databáze.
+DCOUNT = DPOČET ## Spočítá buňky databáze obsahující čísla.
+DCOUNTA = DPOČET2 ## Spočítá buňky databáze, které nejsou prázdné.
+DGET = DZÍSKAT ## Extrahuje z databáze jeden záznam splňující zadaná kritéria.
+DMAX = DMAX ## Vrátí maximální hodnotu z vybraných položek databáze.
+DMIN = DMIN ## Vrátí minimální hodnotu z vybraných položek databáze.
+DPRODUCT = DSOUČIN ## Vynásobí hodnoty určitého pole záznamů v databázi, které splňují daná kritéria.
+DSTDEV = DSMODCH.VÝBĚR ## Odhadne směrodatnou odchylku výběru vybraných položek databáze.
+DSTDEVP = DSMODCH ## Vypočte směrodatnou odchylku základního souboru vybraných položek databáze.
+DSUM = DSUMA ## Sečte čísla ve sloupcovém poli záznamů databáze, která splňují daná kritéria.
+DVAR = DVAR.VÝBĚR ## Odhadne rozptyl výběru vybraných položek databáze.
+DVARP = DVAR ## Vypočte rozptyl základního souboru vybraných položek databáze.
+
+
+##
+## Date and time functions Funkce data a času
+##
+DATE = DATUM ## Vrátí pořadové číslo určitého data.
+DATEVALUE = DATUMHODN ## Převede datum ve formě textu na pořadové číslo.
+DAY = DEN ## Převede pořadové číslo na den v měsíci.
+DAYS360 = ROK360 ## Vrátí počet dní mezi dvěma daty na základě roku s 360 dny.
+EDATE = EDATE ## Vrátí pořadové číslo data, které označuje určený počet měsíců před nebo po počátečním datu.
+EOMONTH = EOMONTH ## Vrátí pořadové číslo posledního dne měsíce před nebo po zadaném počtu měsíců.
+HOUR = HODINA ## Převede pořadové číslo na hodinu.
+MINUTE = MINUTA ## Převede pořadové číslo na minutu.
+MONTH = MĚSÍC ## Převede pořadové číslo na měsíc.
+NETWORKDAYS = NETWORKDAYS ## Vrátí počet celých pracovních dní mezi dvěma daty.
+NOW = NYNÍ ## Vrátí pořadové číslo aktuálního data a času.
+SECOND = SEKUNDA ## Převede pořadové číslo na sekundu.
+TIME = ČAS ## Vrátí pořadové číslo určitého času.
+TIMEVALUE = ČASHODN ## Převede čas ve formě textu na pořadové číslo.
+TODAY = DNES ## Vrátí pořadové číslo dnešního data.
+WEEKDAY = DENTÝDNE ## Převede pořadové číslo na den v týdnu.
+WEEKNUM = WEEKNUM ## Převede pořadové číslo na číslo představující číselnou pozici týdne v roce.
+WORKDAY = WORKDAY ## Vrátí pořadové číslo data před nebo po zadaném počtu pracovních dní.
+YEAR = ROK ## Převede pořadové číslo na rok.
+YEARFRAC = YEARFRAC ## Vrátí část roku vyjádřenou zlomkem a představující počet celých dní mezi počátečním a koncovým datem.
+
+
+##
+## Engineering functions Inženýrské funkce (Technické funkce)
+##
+BESSELI = BESSELI ## Vrátí modifikovanou Besselovu funkci In(x).
+BESSELJ = BESSELJ ## Vrátí modifikovanou Besselovu funkci Jn(x).
+BESSELK = BESSELK ## Vrátí modifikovanou Besselovu funkci Kn(x).
+BESSELY = BESSELY ## Vrátí Besselovu funkci Yn(x).
+BIN2DEC = BIN2DEC ## Převede binární číslo na desítkové.
+BIN2HEX = BIN2HEX ## Převede binární číslo na šestnáctkové.
+BIN2OCT = BIN2OCT ## Převede binární číslo na osmičkové.
+COMPLEX = COMPLEX ## Převede reálnou a imaginární část na komplexní číslo.
+CONVERT = CONVERT ## Převede číslo do jiného jednotkového měrného systému.
+DEC2BIN = DEC2BIN ## Převede desítkového čísla na dvojkové
+DEC2HEX = DEC2HEX ## Převede desítkové číslo na šestnáctkové.
+DEC2OCT = DEC2OCT ## Převede desítkové číslo na osmičkové.
+DELTA = DELTA ## Testuje rovnost dvou hodnot.
+ERF = ERF ## Vrátí chybovou funkci.
+ERFC = ERFC ## Vrátí doplňkovou chybovou funkci.
+GESTEP = GESTEP ## Testuje, zda je číslo větší než mezní hodnota.
+HEX2BIN = HEX2BIN ## Převede šestnáctkové číslo na binární.
+HEX2DEC = HEX2DEC ## Převede šestnáctkové číslo na desítkové.
+HEX2OCT = HEX2OCT ## Převede šestnáctkové číslo na osmičkové.
+IMABS = IMABS ## Vrátí absolutní hodnotu (modul) komplexního čísla.
+IMAGINARY = IMAGINARY ## Vrátí imaginární část komplexního čísla.
+IMARGUMENT = IMARGUMENT ## Vrátí argument théta, úhel vyjádřený v radiánech.
+IMCONJUGATE = IMCONJUGATE ## Vrátí komplexně sdružené číslo ke komplexnímu číslu.
+IMCOS = IMCOS ## Vrátí kosinus komplexního čísla.
+IMDIV = IMDIV ## Vrátí podíl dvou komplexních čísel.
+IMEXP = IMEXP ## Vrátí exponenciální tvar komplexního čísla.
+IMLN = IMLN ## Vrátí přirozený logaritmus komplexního čísla.
+IMLOG10 = IMLOG10 ## Vrátí dekadický logaritmus komplexního čísla.
+IMLOG2 = IMLOG2 ## Vrátí logaritmus komplexního čísla při základu 2.
+IMPOWER = IMPOWER ## Vrátí komplexní číslo umocněné na celé číslo.
+IMPRODUCT = IMPRODUCT ## Vrátí součin komplexních čísel.
+IMREAL = IMREAL ## Vrátí reálnou část komplexního čísla.
+IMSIN = IMSIN ## Vrátí sinus komplexního čísla.
+IMSQRT = IMSQRT ## Vrátí druhou odmocninu komplexního čísla.
+IMSUB = IMSUB ## Vrátí rozdíl mezi dvěma komplexními čísly.
+IMSUM = IMSUM ## Vrátí součet dvou komplexních čísel.
+OCT2BIN = OCT2BIN ## Převede osmičkové číslo na binární.
+OCT2DEC = OCT2DEC ## Převede osmičkové číslo na desítkové.
+OCT2HEX = OCT2HEX ## Převede osmičkové číslo na šestnáctkové.
+
+
+##
+## Financial functions Finanční funkce
+##
+ACCRINT = ACCRINT ## Vrátí nahromaděný úrok z cenného papíru, ze kterého je úrok placen v pravidelných termínech.
+ACCRINTM = ACCRINTM ## Vrátí nahromaděný úrok z cenného papíru, ze kterého je úrok placen k datu splatnosti.
+AMORDEGRC = AMORDEGRC ## Vrátí lineární amortizaci v každém účetním období pomocí koeficientu amortizace.
+AMORLINC = AMORLINC ## Vrátí lineární amortizaci v každém účetním období.
+COUPDAYBS = COUPDAYBS ## Vrátí počet dnů od začátku období placení kupónů do data splatnosti.
+COUPDAYS = COUPDAYS ## Vrátí počet dnů v období placení kupónů, které obsahuje den zúčtování.
+COUPDAYSNC = COUPDAYSNC ## Vrátí počet dnů od data zúčtování do následujícího data placení kupónu.
+COUPNCD = COUPNCD ## Vrátí následující datum placení kupónu po datu zúčtování.
+COUPNUM = COUPNUM ## Vrátí počet kupónů splatných mezi datem zúčtování a datem splatnosti.
+COUPPCD = COUPPCD ## Vrátí předchozí datum placení kupónu před datem zúčtování.
+CUMIPMT = CUMIPMT ## Vrátí kumulativní úrok splacený mezi dvěma obdobími.
+CUMPRINC = CUMPRINC ## Vrátí kumulativní jistinu splacenou mezi dvěma obdobími půjčky.
+DB = ODPIS.ZRYCH ## Vrátí odpis aktiva za určité období pomocí degresivní metody odpisu s pevným zůstatkem.
+DDB = ODPIS.ZRYCH2 ## Vrátí odpis aktiva za určité období pomocí dvojité degresivní metody odpisu nebo jiné metody, kterou zadáte.
+DISC = DISC ## Vrátí diskontní sazbu cenného papíru.
+DOLLARDE = DOLLARDE ## Převede částku v korunách vyjádřenou zlomkem na částku v korunách vyjádřenou desetinným číslem.
+DOLLARFR = DOLLARFR ## Převede částku v korunách vyjádřenou desetinným číslem na částku v korunách vyjádřenou zlomkem.
+DURATION = DURATION ## Vrátí roční dobu cenného papíru s pravidelnými úrokovými sazbami.
+EFFECT = EFFECT ## Vrátí efektivní roční úrokovou sazbu.
+FV = BUDHODNOTA ## Vrátí budoucí hodnotu investice.
+FVSCHEDULE = FVSCHEDULE ## Vrátí budoucí hodnotu počáteční jistiny po použití série sazeb složitého úroku.
+INTRATE = INTRATE ## Vrátí úrokovou sazbu plně investovaného cenného papíru.
+IPMT = PLATBA.ÚROK ## Vrátí výšku úroku investice za dané období.
+IRR = MÍRA.VÝNOSNOSTI ## Vrátí vnitřní výnosové procento série peněžních toků.
+ISPMT = ISPMT ## Vypočte výši úroku z investice zaplaceného během určitého období.
+MDURATION = MDURATION ## Vrátí Macauleyho modifikovanou dobu cenného papíru o nominální hodnotě 100 Kč.
+MIRR = MOD.MÍRA.VÝNOSNOSTI ## Vrátí vnitřní sazbu výnosu, přičemž kladné a záporné hodnoty peněžních prostředků jsou financovány podle různých sazeb.
+NOMINAL = NOMINAL ## Vrátí nominální roční úrokovou sazbu.
+NPER = POČET.OBDOBÍ ## Vrátí počet období pro investici.
+NPV = ČISTÁ.SOUČHODNOTA ## Vrátí čistou současnou hodnotu investice vypočítanou na základě série pravidelných peněžních toků a diskontní sazby.
+ODDFPRICE = ODDFPRICE ## Vrátí cenu cenného papíru o nominální hodnotě 100 Kč s odlišným prvním obdobím.
+ODDFYIELD = ODDFYIELD ## Vrátí výnos cenného papíru s odlišným prvním obdobím.
+ODDLPRICE = ODDLPRICE ## Vrátí cenu cenného papíru o nominální hodnotě 100 Kč s odlišným posledním obdobím.
+ODDLYIELD = ODDLYIELD ## Vrátí výnos cenného papíru s odlišným posledním obdobím.
+PMT = PLATBA ## Vrátí hodnotu pravidelné splátky anuity.
+PPMT = PLATBA.ZÁKLAD ## Vrátí hodnotu splátky jistiny pro zadanou investici za dané období.
+PRICE = PRICE ## Vrátí cenu cenného papíru o nominální hodnotě 100 Kč, ze kterého je úrok placen v pravidelných termínech.
+PRICEDISC = PRICEDISC ## Vrátí cenu diskontního cenného papíru o nominální hodnotě 100 Kč.
+PRICEMAT = PRICEMAT ## Vrátí cenu cenného papíru o nominální hodnotě 100 Kč, ze kterého je úrok placen k datu splatnosti.
+PV = SOUČHODNOTA ## Vrátí současnou hodnotu investice.
+RATE = ÚROKOVÁ.MÍRA ## Vrátí úrokovou sazbu vztaženou na období anuity.
+RECEIVED = RECEIVED ## Vrátí částku obdrženou k datu splatnosti plně investovaného cenného papíru.
+SLN = ODPIS.LIN ## Vrátí přímé odpisy aktiva pro jedno období.
+SYD = ODPIS.NELIN ## Vrátí směrné číslo ročních odpisů aktiva pro zadané období.
+TBILLEQ = TBILLEQ ## Vrátí výnos směnky státní pokladny ekvivalentní výnosu obligace.
+TBILLPRICE = TBILLPRICE ## Vrátí cenu směnky státní pokladny o nominální hodnotě 100 Kč.
+TBILLYIELD = TBILLYIELD ## Vrátí výnos směnky státní pokladny.
+VDB = ODPIS.ZA.INT ## Vrátí odpis aktiva pro určité období nebo část období pomocí degresivní metody odpisu.
+XIRR = XIRR ## Vrátí vnitřní výnosnost pro harmonogram peněžních toků, který nemusí být nutně periodický.
+XNPV = XNPV ## Vrátí čistou současnou hodnotu pro harmonogram peněžních toků, který nemusí být nutně periodický.
+YIELD = YIELD ## Vrátí výnos cenného papíru, ze kterého je úrok placen v pravidelných termínech.
+YIELDDISC = YIELDDISC ## Vrátí roční výnos diskontního cenného papíru, například směnky státní pokladny.
+YIELDMAT = YIELDMAT ## Vrátí roční výnos cenného papíru, ze kterého je úrok placen k datu splatnosti.
+
+
+##
+## Information functions Informační funkce
+##
+CELL = POLÍČKO ## Vrátí informace o formátování, umístění nebo obsahu buňky.
+ERROR.TYPE = CHYBA.TYP ## Vrátí číslo odpovídající typu chyby.
+INFO = O.PROSTŘEDÍ ## Vrátí informace o aktuálním pracovním prostředí.
+ISBLANK = JE.PRÁZDNÉ ## Vrátí hodnotu PRAVDA, pokud se argument hodnota odkazuje na prázdnou buňku.
+ISERR = JE.CHYBA ## Vrátí hodnotu PRAVDA, pokud je argument hodnota libovolná chybová hodnota (kromě #N/A).
+ISERROR = JE.CHYBHODN ## Vrátí hodnotu PRAVDA, pokud je argument hodnota libovolná chybová hodnota.
+ISEVEN = ISEVEN ## Vrátí hodnotu PRAVDA, pokud je číslo sudé.
+ISLOGICAL = JE.LOGHODN ## Vrátí hodnotu PRAVDA, pokud je argument hodnota logická hodnota.
+ISNA = JE.NEDEF ## Vrátí hodnotu PRAVDA, pokud je argument hodnota chybová hodnota #N/A.
+ISNONTEXT = JE.NETEXT ## Vrátí hodnotu PRAVDA, pokud argument hodnota není text.
+ISNUMBER = JE.ČÍSLO ## Vrátí hodnotu PRAVDA, pokud je argument hodnota číslo.
+ISODD = ISODD ## Vrátí hodnotu PRAVDA, pokud je číslo liché.
+ISREF = JE.ODKAZ ## Vrátí hodnotu PRAVDA, pokud je argument hodnota odkaz.
+ISTEXT = JE.TEXT ## Vrátí hodnotu PRAVDA, pokud je argument hodnota text.
+N = N ## Vrátí hodnotu převedenou na číslo.
+NA = NEDEF ## Vrátí chybovou hodnotu #N/A.
+TYPE = TYP ## Vrátí číslo označující datový typ hodnoty.
+
+
+##
+## Logical functions Logické funkce
+##
+AND = A ## Vrátí hodnotu PRAVDA, mají-li všechny argumenty hodnotu PRAVDA.
+FALSE = NEPRAVDA ## Vrátí logickou hodnotu NEPRAVDA.
+IF = KDYŽ ## Určí, který logický test má proběhnout.
+IFERROR = IFERROR ## Pokud je vzorec vyhodnocen jako chyba, vrátí zadanou hodnotu. V opačném případě vrátí výsledek vzorce.
+NOT = NE ## Provede logickou negaci argumentu funkce.
+OR = NEBO ## Vrátí hodnotu PRAVDA, je-li alespoň jeden argument roven hodnotě PRAVDA.
+TRUE = PRAVDA ## Vrátí logickou hodnotu PRAVDA.
+
+
+##
+## Lookup and reference functions Vyhledávací funkce
+##
+ADDRESS = ODKAZ ## Vrátí textový odkaz na jednu buňku listu.
+AREAS = POČET.BLOKŮ ## Vrátí počet oblastí v odkazu.
+CHOOSE = ZVOLIT ## Zvolí hodnotu ze seznamu hodnot.
+COLUMN = SLOUPEC ## Vrátí číslo sloupce odkazu.
+COLUMNS = SLOUPCE ## Vrátí počet sloupců v odkazu.
+HLOOKUP = VVYHLEDAT ## Prohledá horní řádek matice a vrátí hodnotu určené buňky.
+HYPERLINK = HYPERTEXTOVÝ.ODKAZ ## Vytvoří zástupce nebo odkaz, který otevře dokument uložený na síťovém serveru, v síti intranet nebo Internet.
+INDEX = INDEX ## Pomocí rejstříku zvolí hodnotu z odkazu nebo matice.
+INDIRECT = NEPŘÍMÝ.ODKAZ ## Vrátí odkaz určený textovou hodnotou.
+LOOKUP = VYHLEDAT ## Vyhledá hodnoty ve vektoru nebo matici.
+MATCH = POZVYHLEDAT ## Vyhledá hodnoty v odkazu nebo matici.
+OFFSET = POSUN ## Vrátí posun odkazu od zadaného odkazu.
+ROW = ŘÁDEK ## Vrátí číslo řádku odkazu.
+ROWS = ŘÁDKY ## Vrátí počet řádků v odkazu.
+RTD = RTD ## Načte data reálného času z programu, který podporuje automatizaci modelu COM (Automatizace: Způsob práce s objekty určité aplikace z jiné aplikace nebo nástroje pro vývoj. Automatizace (dříve nazývaná automatizace OLE) je počítačovým standardem a je funkcí modelu COM (Component Object Model).).
+TRANSPOSE = TRANSPOZICE ## Vrátí transponovanou matici.
+VLOOKUP = SVYHLEDAT ## Prohledá první sloupec matice, přesune kurzor v řádku a vrátí hodnotu buňky.
+
+
+##
+## Math and trigonometry functions Matematické a trigonometrické funkce
+##
+ABS = ABS ## Vrátí absolutní hodnotu čísla.
+ACOS = ARCCOS ## Vrátí arkuskosinus čísla.
+ACOSH = ARCCOSH ## Vrátí hyperbolický arkuskosinus čísla.
+ASIN = ARCSIN ## Vrátí arkussinus čísla.
+ASINH = ARCSINH ## Vrátí hyperbolický arkussinus čísla.
+ATAN = ARCTG ## Vrátí arkustangens čísla.
+ATAN2 = ARCTG2 ## Vrátí arkustangens x-ové a y-ové souřadnice.
+ATANH = ARCTGH ## Vrátí hyperbolický arkustangens čísla.
+CEILING = ZAOKR.NAHORU ## Zaokrouhlí číslo na nejbližší celé číslo nebo na nejbližší násobek zadané hodnoty.
+COMBIN = KOMBINACE ## Vrátí počet kombinací pro daný počet položek.
+COS = COS ## Vrátí kosinus čísla.
+COSH = COSH ## Vrátí hyperbolický kosinus čísla.
+DEGREES = DEGREES ## Převede radiány na stupně.
+EVEN = ZAOKROUHLIT.NA.SUDÉ ## Zaokrouhlí číslo nahoru na nejbližší celé sudé číslo.
+EXP = EXP ## Vrátí základ přirozeného logaritmu e umocněný na zadané číslo.
+FACT = FAKTORIÁL ## Vrátí faktoriál čísla.
+FACTDOUBLE = FACTDOUBLE ## Vrátí dvojitý faktoriál čísla.
+FLOOR = ZAOKR.DOLŮ ## Zaokrouhlí číslo dolů, směrem k nule.
+GCD = GCD ## Vrátí největší společný dělitel.
+INT = CELÁ.ČÁST ## Zaokrouhlí číslo dolů na nejbližší celé číslo.
+LCM = LCM ## Vrátí nejmenší společný násobek.
+LN = LN ## Vrátí přirozený logaritmus čísla.
+LOG = LOGZ ## Vrátí logaritmus čísla při zadaném základu.
+LOG10 = LOG ## Vrátí dekadický logaritmus čísla.
+MDETERM = DETERMINANT ## Vrátí determinant matice.
+MINVERSE = INVERZE ## Vrátí inverzní matici.
+MMULT = SOUČIN.MATIC ## Vrátí součin dvou matic.
+MOD = MOD ## Vrátí zbytek po dělení.
+MROUND = MROUND ## Vrátí číslo zaokrouhlené na požadovaný násobek.
+MULTINOMIAL = MULTINOMIAL ## Vrátí mnohočlen z množiny čísel.
+ODD = ZAOKROUHLIT.NA.LICHÉ ## Zaokrouhlí číslo nahoru na nejbližší celé liché číslo.
+PI = PI ## Vrátí hodnotu čísla pí.
+POWER = POWER ## Umocní číslo na zadanou mocninu.
+PRODUCT = SOUČIN ## Vynásobí argumenty funkce.
+QUOTIENT = QUOTIENT ## Vrátí celou část dělení.
+RADIANS = RADIANS ## Převede stupně na radiány.
+RAND = NÁHČÍSLO ## Vrátí náhodné číslo mezi 0 a 1.
+RANDBETWEEN = RANDBETWEEN ## Vrátí náhodné číslo mezi zadanými čísly.
+ROMAN = ROMAN ## Převede arabskou číslici na římskou ve formátu textu.
+ROUND = ZAOKROUHLIT ## Zaokrouhlí číslo na zadaný počet číslic.
+ROUNDDOWN = ROUNDDOWN ## Zaokrouhlí číslo dolů, směrem k nule.
+ROUNDUP = ROUNDUP ## Zaokrouhlí číslo nahoru, směrem od nuly.
+SERIESSUM = SERIESSUM ## Vrátí součet mocninné řady určené podle vzorce.
+SIGN = SIGN ## Vrátí znaménko čísla.
+SIN = SIN ## Vrátí sinus daného úhlu.
+SINH = SINH ## Vrátí hyperbolický sinus čísla.
+SQRT = ODMOCNINA ## Vrátí kladnou druhou odmocninu.
+SQRTPI = SQRTPI ## Vrátí druhou odmocninu výrazu (číslo * pí).
+SUBTOTAL = SUBTOTAL ## Vrátí souhrn v seznamu nebo databázi.
+SUM = SUMA ## Sečte argumenty funkce.
+SUMIF = SUMIF ## Sečte buňky vybrané podle zadaných kritérií.
+SUMIFS = SUMIFS ## Sečte buňky určené více zadanými podmínkami.
+SUMPRODUCT = SOUČIN.SKALÁRNÍ ## Vrátí součet součinů odpovídajících prvků matic.
+SUMSQ = SUMA.ČTVERCŮ ## Vrátí součet čtverců argumentů.
+SUMX2MY2 = SUMX2MY2 ## Vrátí součet rozdílu čtverců odpovídajících hodnot ve dvou maticích.
+SUMX2PY2 = SUMX2PY2 ## Vrátí součet součtu čtverců odpovídajících hodnot ve dvou maticích.
+SUMXMY2 = SUMXMY2 ## Vrátí součet čtverců rozdílů odpovídajících hodnot ve dvou maticích.
+TAN = TGTG ## Vrátí tangens čísla.
+TANH = TGH ## Vrátí hyperbolický tangens čísla.
+TRUNC = USEKNOUT ## Zkrátí číslo na celé číslo.
+
+
+##
+## Statistical functions Statistické funkce
+##
+AVEDEV = PRŮMODCHYLKA ## Vrátí průměrnou hodnotu absolutních odchylek datových bodů od jejich střední hodnoty.
+AVERAGE = PRŮMĚR ## Vrátí průměrnou hodnotu argumentů.
+AVERAGEA = AVERAGEA ## Vrátí průměrnou hodnotu argumentů včetně čísel, textu a logických hodnot.
+AVERAGEIF = AVERAGEIF ## Vrátí průměrnou hodnotu (aritmetický průměr) všech buněk v oblasti, které vyhovují příslušné podmínce.
+AVERAGEIFS = AVERAGEIFS ## Vrátí průměrnou hodnotu (aritmetický průměr) všech buněk vyhovujících několika podmínkám.
+BETADIST = BETADIST ## Vrátí hodnotu součtového rozdělení beta.
+BETAINV = BETAINV ## Vrátí inverzní hodnotu součtového rozdělení pro zadané rozdělení beta.
+BINOMDIST = BINOMDIST ## Vrátí hodnotu binomického rozdělení pravděpodobnosti jednotlivých veličin.
+CHIDIST = CHIDIST ## Vrátí jednostrannou pravděpodobnost rozdělení chí-kvadrát.
+CHIINV = CHIINV ## Vrátí hodnotu funkce inverzní k distribuční funkci jednostranné pravděpodobnosti rozdělení chí-kvadrát.
+CHITEST = CHITEST ## Vrátí test nezávislosti.
+CONFIDENCE = CONFIDENCE ## Vrátí interval spolehlivosti pro střední hodnotu základního souboru.
+CORREL = CORREL ## Vrátí korelační koeficient mezi dvěma množinami dat.
+COUNT = POČET ## Vrátí počet čísel v seznamu argumentů.
+COUNTA = POČET2 ## Vrátí počet hodnot v seznamu argumentů.
+COUNTBLANK = COUNTBLANK ## Spočítá počet prázdných buněk v oblasti.
+COUNTIF = COUNTIF ## Spočítá buňky v oblasti, které odpovídají zadaným kritériím.
+COUNTIFS = COUNTIFS ## Spočítá buňky v oblasti, které odpovídají více kritériím.
+COVAR = COVAR ## Vrátí hodnotu kovariance, průměrnou hodnotu součinů párových odchylek
+CRITBINOM = CRITBINOM ## Vrátí nejmenší hodnotu, pro kterou má součtové binomické rozdělení hodnotu větší nebo rovnu hodnotě kritéria.
+DEVSQ = DEVSQ ## Vrátí součet čtverců odchylek.
+EXPONDIST = EXPONDIST ## Vrátí hodnotu exponenciálního rozdělení.
+FDIST = FDIST ## Vrátí hodnotu rozdělení pravděpodobnosti F.
+FINV = FINV ## Vrátí hodnotu inverzní funkce k distribuční funkci rozdělení F.
+FISHER = FISHER ## Vrátí hodnotu Fisherovy transformace.
+FISHERINV = FISHERINV ## Vrátí hodnotu inverzní funkce k Fisherově transformaci.
+FORECAST = FORECAST ## Vrátí hodnotu lineárního trendu.
+FREQUENCY = ČETNOSTI ## Vrátí četnost rozdělení jako svislou matici.
+FTEST = FTEST ## Vrátí výsledek F-testu.
+GAMMADIST = GAMMADIST ## Vrátí hodnotu rozdělení gama.
+GAMMAINV = GAMMAINV ## Vrátí hodnotu inverzní funkce k distribuční funkci součtového rozdělení gama.
+GAMMALN = GAMMALN ## Vrátí přirozený logaritmus funkce gama, Γ(x).
+GEOMEAN = GEOMEAN ## Vrátí geometrický průměr.
+GROWTH = LOGLINTREND ## Vrátí hodnoty exponenciálního trendu.
+HARMEAN = HARMEAN ## Vrátí harmonický průměr.
+HYPGEOMDIST = HYPGEOMDIST ## Vrátí hodnotu hypergeometrického rozdělení.
+INTERCEPT = INTERCEPT ## Vrátí úsek lineární regresní čáry.
+KURT = KURT ## Vrátí hodnotu excesu množiny dat.
+LARGE = LARGE ## Vrátí k-tou největší hodnotu množiny dat.
+LINEST = LINREGRESE ## Vrátí parametry lineárního trendu.
+LOGEST = LOGLINREGRESE ## Vrátí parametry exponenciálního trendu.
+LOGINV = LOGINV ## Vrátí inverzní funkci k distribuční funkci logaritmicko-normálního rozdělení.
+LOGNORMDIST = LOGNORMDIST ## Vrátí hodnotu součtového logaritmicko-normálního rozdělení.
+MAX = MAX ## Vrátí maximální hodnotu seznamu argumentů.
+MAXA = MAXA ## Vrátí maximální hodnotu seznamu argumentů včetně čísel, textu a logických hodnot.
+MEDIAN = MEDIAN ## Vrátí střední hodnotu zadaných čísel.
+MIN = MIN ## Vrátí minimální hodnotu seznamu argumentů.
+MINA = MINA ## Vrátí nejmenší hodnotu v seznamu argumentů včetně čísel, textu a logických hodnot.
+MODE = MODE ## Vrátí hodnotu, která se v množině dat vyskytuje nejčastěji.
+NEGBINOMDIST = NEGBINOMDIST ## Vrátí hodnotu negativního binomického rozdělení.
+NORMDIST = NORMDIST ## Vrátí hodnotu normálního součtového rozdělení.
+NORMINV = NORMINV ## Vrátí inverzní funkci k funkci normálního součtového rozdělení.
+NORMSDIST = NORMSDIST ## Vrátí hodnotu standardního normálního součtového rozdělení.
+NORMSINV = NORMSINV ## Vrátí inverzní funkci k funkci standardního normálního součtového rozdělení.
+PEARSON = PEARSON ## Vrátí Pearsonův výsledný momentový korelační koeficient.
+PERCENTILE = PERCENTIL ## Vrátí hodnotu k-tého percentilu hodnot v oblasti.
+PERCENTRANK = PERCENTRANK ## Vrátí pořadí hodnoty v množině dat vyjádřené procentuální částí množiny dat.
+PERMUT = PERMUTACE ## Vrátí počet permutací pro zadaný počet objektů.
+POISSON = POISSON ## Vrátí hodnotu distribuční funkce Poissonova rozdělení.
+PROB = PROB ## Vrátí pravděpodobnost výskytu hodnot v oblasti mezi dvěma mezními hodnotami.
+QUARTILE = QUARTIL ## Vrátí hodnotu kvartilu množiny dat.
+RANK = RANK ## Vrátí pořadí čísla v seznamu čísel.
+RSQ = RKQ ## Vrátí druhou mocninu Pearsonova výsledného momentového korelačního koeficientu.
+SKEW = SKEW ## Vrátí zešikmení rozdělení.
+SLOPE = SLOPE ## Vrátí směrnici lineární regresní čáry.
+SMALL = SMALL ## Vrátí k-tou nejmenší hodnotu množiny dat.
+STANDARDIZE = STANDARDIZE ## Vrátí normalizovanou hodnotu.
+STDEV = SMODCH.VÝBĚR ## Vypočte směrodatnou odchylku výběru.
+STDEVA = STDEVA ## Vypočte směrodatnou odchylku výběru včetně čísel, textu a logických hodnot.
+STDEVP = SMODCH ## Vypočte směrodatnou odchylku základního souboru.
+STDEVPA = STDEVPA ## Vypočte směrodatnou odchylku základního souboru včetně čísel, textu a logických hodnot.
+STEYX = STEYX ## Vrátí standardní chybu předpovězené hodnoty y pro každou hodnotu x v regresi.
+TDIST = TDIST ## Vrátí hodnotu Studentova t-rozdělení.
+TINV = TINV ## Vrátí inverzní funkci k distribuční funkci Studentova t-rozdělení.
+TREND = LINTREND ## Vrátí hodnoty lineárního trendu.
+TRIMMEAN = TRIMMEAN ## Vrátí střední hodnotu vnitřní části množiny dat.
+TTEST = TTEST ## Vrátí pravděpodobnost spojenou se Studentovým t-testem.
+VAR = VAR.VÝBĚR ## Vypočte rozptyl výběru.
+VARA = VARA ## Vypočte rozptyl výběru včetně čísel, textu a logických hodnot.
+VARP = VAR ## Vypočte rozptyl základního souboru.
+VARPA = VARPA ## Vypočte rozptyl základního souboru včetně čísel, textu a logických hodnot.
+WEIBULL = WEIBULL ## Vrátí hodnotu Weibullova rozdělení.
+ZTEST = ZTEST ## Vrátí jednostrannou P-hodnotu z-testu.
+
+
+##
+## Text functions Textové funkce
+##
+ASC = ASC ## Změní znaky s plnou šířkou (dvoubajtové)v řetězci znaků na znaky s poloviční šířkou (jednobajtové).
+BAHTTEXT = BAHTTEXT ## Převede číslo na text ve formátu, měny ß (baht).
+CHAR = ZNAK ## Vrátí znak určený číslem kódu.
+CLEAN = VYČISTIT ## Odebere z textu všechny netisknutelné znaky.
+CODE = KÓD ## Vrátí číselný kód prvního znaku zadaného textového řetězce.
+CONCATENATE = CONCATENATE ## Spojí několik textových položek do jedné.
+DOLLAR = KČ ## Převede číslo na text ve formátu měny Kč (česká koruna).
+EXACT = STEJNÉ ## Zkontroluje, zda jsou dvě textové hodnoty shodné.
+FIND = NAJÍT ## Nalezne textovou hodnotu uvnitř jiné (rozlišuje malá a velká písmena).
+FINDB = FINDB ## Nalezne textovou hodnotu uvnitř jiné (rozlišuje malá a velká písmena).
+FIXED = ZAOKROUHLIT.NA.TEXT ## Zformátuje číslo jako text s pevným počtem desetinných míst.
+JIS = JIS ## Změní znaky s poloviční šířkou (jednobajtové) v řetězci znaků na znaky s plnou šířkou (dvoubajtové).
+LEFT = ZLEVA ## Vrátí první znaky textové hodnoty umístěné nejvíce vlevo.
+LEFTB = LEFTB ## Vrátí první znaky textové hodnoty umístěné nejvíce vlevo.
+LEN = DÉLKA ## Vrátí počet znaků textového řetězce.
+LENB = LENB ## Vrátí počet znaků textového řetězce.
+LOWER = MALÁ ## Převede text na malá písmena.
+MID = ČÁST ## Vrátí určitý počet znaků textového řetězce počínaje zadaným místem.
+MIDB = MIDB ## Vrátí určitý počet znaků textového řetězce počínaje zadaným místem.
+PHONETIC = ZVUKOVÉ ## Extrahuje fonetické znaky (furigana) z textového řetězce.
+PROPER = VELKÁ2 ## Převede první písmeno každého slova textové hodnoty na velké.
+REPLACE = NAHRADIT ## Nahradí znaky uvnitř textu.
+REPLACEB = NAHRADITB ## Nahradí znaky uvnitř textu.
+REPT = OPAKOVAT ## Zopakuje text podle zadaného počtu opakování.
+RIGHT = ZPRAVA ## Vrátí první znaky textové hodnoty umístěné nejvíce vpravo.
+RIGHTB = RIGHTB ## Vrátí první znaky textové hodnoty umístěné nejvíce vpravo.
+SEARCH = HLEDAT ## Nalezne textovou hodnotu uvnitř jiné (malá a velká písmena nejsou rozlišována).
+SEARCHB = SEARCHB ## Nalezne textovou hodnotu uvnitř jiné (malá a velká písmena nejsou rozlišována).
+SUBSTITUTE = DOSADIT ## V textovém řetězci nahradí starý text novým.
+T = T ## Převede argumenty na text.
+TEXT = HODNOTA.NA.TEXT ## Zformátuje číslo a převede ho na text.
+TRIM = PROČISTIT ## Odstraní z textu mezery.
+UPPER = VELKÁ ## Převede text na velká písmena.
+VALUE = HODNOTA ## Převede textový argument na číslo.
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/da/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/da/config
new file mode 100644
index 00000000000..a7aa8fee9d9
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/da/config
@@ -0,0 +1,25 @@
+##
+## PhpSpreadsheet
+##
+
+ArgumentSeparator = ;
+
+
+##
+## (For future use)
+##
+currencySymbol = kr
+
+
+
+##
+## Excel Error Codes (For future use)
+
+##
+NULL = #NUL!
+DIV0 = #DIVISION/0!
+VALUE = #VÆRDI!
+REF = #REFERENCE!
+NAME = #NAVN?
+NUM = #NUM!
+NA = #I/T
diff --git a/lib/phpexcel/PHPExcel/locale/da/functions b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/da/functions
similarity index 95%
rename from lib/phpexcel/PHPExcel/locale/da/functions
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/da/functions
index 26e0310c1a1..d02aa2ec9be 100644
--- a/lib/phpexcel/PHPExcel/locale/da/functions
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/da/functions
@@ -1,438 +1,416 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Calculation
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/
-##
-##
-
-
-##
-## Add-in and Automation functions Tilføjelsesprogram- og automatiseringsfunktioner
-##
-GETPIVOTDATA = HENTPIVOTDATA ## Returnerer data, der er lagret i en pivottabelrapport
-
-
-##
-## Cube functions Kubefunktioner
-##
-CUBEKPIMEMBER = KUBE.KPI.MEDLEM ## Returnerer navn, egenskab og mål for en KPI-indikator og viser navnet og egenskaben i cellen. En KPI-indikator er en målbar størrelse, f.eks. bruttooverskud pr. måned eller personaleudskiftning pr. kvartal, der bruges til at overvåge en organisations præstationer.
-CUBEMEMBER = KUBE.MEDLEM ## Returnerer et medlem eller en tupel fra kubehierarkiet. Bruges til at validere, om et medlem eller en tupel findes i kuben.
-CUBEMEMBERPROPERTY = KUBEMEDLEM.EGENSKAB ## Returnerer værdien af en egenskab for et medlem i kuben. Bruges til at validere, om et medlemsnavn findes i kuben, og returnere den angivne egenskab for medlemmet.
-CUBERANKEDMEMBER = KUBEMEDLEM.RANG ## Returnerer det n'te eller rangordnede medlem i et sæt. Bruges til at returnere et eller flere elementer i et sæt, f.eks. topsælgere eller de 10 bedste elever.
-CUBESET = KUBESÆT ## Definerer et beregnet sæt medlemmer eller tupler ved at sende et sætudtryk til kuben på serveren, som opretter sættet og returnerer det til Microsoft Office Excel.
-CUBESETCOUNT = KUBESÆT.TÆL ## Returnerer antallet af elementer i et sæt.
-CUBEVALUE = KUBEVÆRDI ## Returnerer en sammenlagt (aggregeret) værdi fra en kube.
-
-
-##
-## Database functions Databasefunktioner
-##
-DAVERAGE = DMIDDEL ## Returnerer gennemsnittet af markerede databaseposter
-DCOUNT = DTÆL ## Tæller de celler, der indeholder tal, i en database
-DCOUNTA = DTÆLV ## Tæller udfyldte celler i en database
-DGET = DHENT ## Uddrager en enkelt post, der opfylder de angivne kriterier, fra en database
-DMAX = DMAKS ## Returnerer den største værdi blandt markerede databaseposter
-DMIN = DMIN ## Returnerer den mindste værdi blandt markerede databaseposter
-DPRODUCT = DPRODUKT ## Ganger værdierne i et bestemt felt med poster, der opfylder kriterierne i en database
-DSTDEV = DSTDAFV ## Beregner et skøn over standardafvigelsen baseret på en stikprøve af markerede databaseposter
-DSTDEVP = DSTDAFVP ## Beregner standardafvigelsen baseret på hele populationen af markerede databaseposter
-DSUM = DSUM ## Sammenlægger de tal i feltkolonnen i databasen, der opfylder kriterierne
-DVAR = DVARIANS ## Beregner varians baseret på en stikprøve af markerede databaseposter
-DVARP = DVARIANSP ## Beregner varians baseret på hele populationen af markerede databaseposter
-
-
-##
-## Date and time functions Dato- og klokkeslætsfunktioner
-##
-DATE = DATO ## Returnerer serienummeret for en bestemt dato
-DATEVALUE = DATOVÆRDI ## Konverterer en dato i form af tekst til et serienummer
-DAY = DAG ## Konverterer et serienummer til en dag i måneden
-DAYS360 = DAGE360 ## Beregner antallet af dage mellem to datoer på grundlag af et år med 360 dage
-EDATE = EDATO ## Returnerer serienummeret for den dato, der ligger det angivne antal måneder før eller efter startdatoen
-EOMONTH = SLUT.PÅ.MÅNED ## Returnerer serienummeret på den sidste dag i måneden før eller efter et angivet antal måneder
-HOUR = TIME ## Konverterer et serienummer til en time
-MINUTE = MINUT ## Konverterer et serienummer til et minut
-MONTH = MÅNED ## Konverterer et serienummer til en måned
-NETWORKDAYS = ANTAL.ARBEJDSDAGE ## Returnerer antallet af hele arbejdsdage mellem to datoer
-NOW = NU ## Returnerer serienummeret for den aktuelle dato eller det aktuelle klokkeslæt
-SECOND = SEKUND ## Konverterer et serienummer til et sekund
-TIME = KLOKKESLÆT ## Returnerer serienummeret for et bestemt klokkeslæt
-TIMEVALUE = TIDSVÆRDI ## Konverterer et klokkeslæt i form af tekst til et serienummer
-TODAY = IDAG ## Returnerer serienummeret for dags dato
-WEEKDAY = UGEDAG ## Konverterer et serienummer til en ugedag
-WEEKNUM = UGE.NR ## Konverterer et serienummer til et tal, der angiver ugenummeret i året
-WORKDAY = ARBEJDSDAG ## Returnerer serienummeret for dagen før eller efter det angivne antal arbejdsdage
-YEAR = ÅR ## Konverterer et serienummer til et år
-YEARFRAC = ÅR.BRØK ## Returnerer årsbrøken, der repræsenterer antallet af hele dage mellem startdato og slutdato
-
-
-##
-## Engineering functions Tekniske funktioner
-##
-BESSELI = BESSELI ## Returnerer den modificerede Bessel-funktion In(x)
-BESSELJ = BESSELJ ## Returnerer Bessel-funktionen Jn(x)
-BESSELK = BESSELK ## Returnerer den modificerede Bessel-funktion Kn(x)
-BESSELY = BESSELY ## Returnerer Bessel-funktionen Yn(x)
-BIN2DEC = BIN.TIL.DEC ## Konverterer et binært tal til et decimaltal
-BIN2HEX = BIN.TIL.HEX ## Konverterer et binært tal til et heksadecimalt tal
-BIN2OCT = BIN.TIL.OKT ## Konverterer et binært tal til et oktaltal.
-COMPLEX = KOMPLEKS ## Konverterer reelle og imaginære koefficienter til et komplekst tal
-CONVERT = KONVERTER ## Konverterer et tal fra én måleenhed til en anden
-DEC2BIN = DEC.TIL.BIN ## Konverterer et decimaltal til et binært tal
-DEC2HEX = DEC.TIL.HEX ## Konverterer et decimaltal til et heksadecimalt tal
-DEC2OCT = DEC.TIL.OKT ## Konverterer et decimaltal til et oktaltal
-DELTA = DELTA ## Tester, om to værdier er ens
-ERF = FEJLFUNK ## Returner fejlfunktionen
-ERFC = FEJLFUNK.KOMP ## Returnerer den komplementære fejlfunktion
-GESTEP = GETRIN ## Tester, om et tal er større end en grænseværdi
-HEX2BIN = HEX.TIL.BIN ## Konverterer et heksadecimalt tal til et binært tal
-HEX2DEC = HEX.TIL.DEC ## Konverterer et decimaltal til et heksadecimalt tal
-HEX2OCT = HEX.TIL.OKT ## Konverterer et heksadecimalt tal til et oktaltal
-IMABS = IMAGABS ## Returnerer den absolutte værdi (modulus) for et komplekst tal
-IMAGINARY = IMAGINÆR ## Returnerer den imaginære koefficient for et komplekst tal
-IMARGUMENT = IMAGARGUMENT ## Returnerer argumentet theta, en vinkel udtrykt i radianer
-IMCONJUGATE = IMAGKONJUGERE ## Returnerer den komplekse konjugation af et komplekst tal
-IMCOS = IMAGCOS ## Returnerer et komplekst tals cosinus
-IMDIV = IMAGDIV ## Returnerer kvotienten for to komplekse tal
-IMEXP = IMAGEKSP ## Returnerer et komplekst tals eksponentialfunktion
-IMLN = IMAGLN ## Returnerer et komplekst tals naturlige logaritme
-IMLOG10 = IMAGLOG10 ## Returnerer et komplekst tals sædvanlige logaritme (titalslogaritme)
-IMLOG2 = IMAGLOG2 ## Returnerer et komplekst tals sædvanlige logaritme (totalslogaritme)
-IMPOWER = IMAGPOTENS ## Returnerer et komplekst tal opløftet i en heltalspotens
-IMPRODUCT = IMAGPRODUKT ## Returnerer produktet af komplekse tal
-IMREAL = IMAGREELT ## Returnerer den reelle koefficient for et komplekst tal
-IMSIN = IMAGSIN ## Returnerer et komplekst tals sinus
-IMSQRT = IMAGKVROD ## Returnerer et komplekst tals kvadratrod
-IMSUB = IMAGSUB ## Returnerer forskellen mellem to komplekse tal
-IMSUM = IMAGSUM ## Returnerer summen af komplekse tal
-OCT2BIN = OKT.TIL.BIN ## Konverterer et oktaltal til et binært tal
-OCT2DEC = OKT.TIL.DEC ## Konverterer et oktaltal til et decimaltal
-OCT2HEX = OKT.TIL.HEX ## Konverterer et oktaltal til et heksadecimalt tal
-
-
-##
-## Financial functions Finansielle funktioner
-##
-ACCRINT = PÅLØBRENTE ## Returnerer den påløbne rente for et værdipapir med periodiske renteudbetalinger
-ACCRINTM = PÅLØBRENTE.UDLØB ## Returnerer den påløbne rente for et værdipapir, hvor renteudbetalingen finder sted ved papirets udløb
-AMORDEGRC = AMORDEGRC ## Returnerer afskrivningsbeløbet for hver regnskabsperiode ved hjælp af en afskrivningskoefficient
-AMORLINC = AMORLINC ## Returnerer afskrivningsbeløbet for hver regnskabsperiode
-COUPDAYBS = KUPONDAGE.SA ## Returnerer antallet af dage fra starten af kuponperioden til afregningsdatoen
-COUPDAYS = KUPONDAGE.A ## Returnerer antallet af dage fra begyndelsen af kuponperioden til afregningsdatoen
-COUPDAYSNC = KUPONDAGE.ANK ## Returnerer antallet af dage i den kuponperiode, der indeholder afregningsdatoen
-COUPNCD = KUPONDAG.NÆSTE ## Returnerer den næste kupondato efter afregningsdatoen
-COUPNUM = KUPONBETALINGER ## Returnerer antallet af kuponudbetalinger mellem afregnings- og udløbsdatoen
-COUPPCD = KUPONDAG.FORRIGE ## Returnerer den forrige kupondato før afregningsdatoen
-CUMIPMT = AKKUM.RENTE ## Returnerer den akkumulerede rente, der betales på et lån mellem to perioder
-CUMPRINC = AKKUM.HOVEDSTOL ## Returnerer den akkumulerede nedbringelse af hovedstol mellem to perioder
-DB = DB ## Returnerer afskrivningen på et aktiv i en angivet periode ved anvendelse af saldometoden
-DDB = DSA ## Returnerer afskrivningsbeløbet for et aktiv over en bestemt periode ved anvendelse af dobbeltsaldometoden eller en anden afskrivningsmetode, som du angiver
-DISC = DISKONTO ## Returnerer et værdipapirs diskonto
-DOLLARDE = KR.DECIMAL ## Konverterer en kronepris udtrykt som brøk til en kronepris udtrykt som decimaltal
-DOLLARFR = KR.BRØK ## Konverterer en kronepris udtrykt som decimaltal til en kronepris udtrykt som brøk
-DURATION = VARIGHED ## Returnerer den årlige løbetid for et værdipapir med periodiske renteudbetalinger
-EFFECT = EFFEKTIV.RENTE ## Returnerer den årlige effektive rente
-FV = FV ## Returnerer fremtidsværdien af en investering
-FVSCHEDULE = FVTABEL ## Returnerer den fremtidige værdi af en hovedstol, når der er tilskrevet rente og rentes rente efter forskellige rentesatser
-INTRATE = RENTEFOD ## Returnerer renten på et fuldt ud investeret værdipapir
-IPMT = R.YDELSE ## Returnerer renten fra en investering for en given periode
-IRR = IA ## Returnerer den interne rente for en række pengestrømme
-ISPMT = ISPMT ## Beregner den betalte rente i løbet af en bestemt investeringsperiode
-MDURATION = MVARIGHED ## Returnerer Macauleys modificerede løbetid for et værdipapir med en formodet pari på kr. 100
-MIRR = MIA ## Returnerer den interne forrentning, hvor positive og negative pengestrømme finansieres til forskellig rente
-NOMINAL = NOMINEL ## Returnerer den årlige nominelle rente
-NPER = NPER ## Returnerer antallet af perioder for en investering
-NPV = NUTIDSVÆRDI ## Returnerer nettonutidsværdien for en investering baseret på en række periodiske pengestrømme og en diskonteringssats
-ODDFPRICE = ULIGE.KURS.PÅLYDENDE ## Returnerer kursen pr. kr. 100 nominel værdi for et værdipapir med en ulige (kort eller lang) første periode
-ODDFYIELD = ULIGE.FØRSTE.AFKAST ## Returnerer afkastet for et værdipapir med ulige første periode
-ODDLPRICE = ULIGE.SIDSTE.KURS ## Returnerer kursen pr. kr. 100 nominel værdi for et værdipapir med ulige sidste periode
-ODDLYIELD = ULIGE.SIDSTE.AFKAST ## Returnerer afkastet for et værdipapir med ulige sidste periode
-PMT = YDELSE ## Returnerer renten fra en investering for en given periode
-PPMT = H.YDELSE ## Returnerer ydelsen på hovedstolen for en investering i en given periode
-PRICE = KURS ## Returnerer kursen pr. kr 100 nominel værdi for et værdipapir med periodiske renteudbetalinger
-PRICEDISC = KURS.DISKONTO ## Returnerer kursen pr. kr 100 nominel værdi for et diskonteret værdipapir
-PRICEMAT = KURS.UDLØB ## Returnerer kursen pr. kr 100 nominel værdi for et værdipapir, hvor renten udbetales ved papirets udløb
-PV = NV ## Returnerer den nuværende værdi af en investering
-RATE = RENTE ## Returnerer renten i hver periode for en annuitet
-RECEIVED = MODTAGET.VED.UDLØB ## Returnerer det beløb, der modtages ved udløbet af et fuldt ud investeret værdipapir
-SLN = LA ## Returnerer den lineære afskrivning for et aktiv i en enkelt periode
-SYD = ÅRSAFSKRIVNING ## Returnerer den årlige afskrivning på et aktiv i en bestemt periode
-TBILLEQ = STATSOBLIGATION ## Returnerer det obligationsækvivalente afkast for en statsobligation
-TBILLPRICE = STATSOBLIGATION.KURS ## Returnerer kursen pr. kr 100 nominel værdi for en statsobligation
-TBILLYIELD = STATSOBLIGATION.AFKAST ## Returnerer en afkastet på en statsobligation
-VDB = VSA ## Returnerer afskrivningen på et aktiv i en angivet periode, herunder delperioder, ved brug af dobbeltsaldometoden
-XIRR = INTERN.RENTE ## Returnerer den interne rente for en plan over pengestrømme, der ikke behøver at være periodiske
-XNPV = NETTO.NUTIDSVÆRDI ## Returnerer nutidsværdien for en plan over pengestrømme, der ikke behøver at være periodiske
-YIELD = AFKAST ## Returnerer afkastet for et værdipapir med periodiske renteudbetalinger
-YIELDDISC = AFKAST.DISKONTO ## Returnerer det årlige afkast for et diskonteret værdipapir, f.eks. en statsobligation
-YIELDMAT = AFKAST.UDLØBSDATO ## Returnerer det årlige afkast for et værdipapir, hvor renten udbetales ved papirets udløb
-
-
-##
-## Information functions Informationsfunktioner
-##
-CELL = CELLE ## Returnerer oplysninger om formatering, placering eller indhold af en celle
-ERROR.TYPE = FEJLTYPE ## Returnerer et tal, der svarer til en fejltype
-INFO = INFO ## Returnerer oplysninger om det aktuelle operativmiljø
-ISBLANK = ER.TOM ## Returnerer SAND, hvis værdien er tom
-ISERR = ER.FJL ## Returnerer SAND, hvis værdien er en fejlværdi undtagen #I/T
-ISERROR = ER.FEJL ## Returnerer SAND, hvis værdien er en fejlværdi
-ISEVEN = ER.LIGE ## Returnerer SAND, hvis tallet er lige
-ISLOGICAL = ER.LOGISK ## Returnerer SAND, hvis værdien er en logisk værdi
-ISNA = ER.IKKE.TILGÆNGELIG ## Returnerer SAND, hvis værdien er fejlværdien #I/T
-ISNONTEXT = ER.IKKE.TEKST ## Returnerer SAND, hvis værdien ikke er tekst
-ISNUMBER = ER.TAL ## Returnerer SAND, hvis værdien er et tal
-ISODD = ER.ULIGE ## Returnerer SAND, hvis tallet er ulige
-ISREF = ER.REFERENCE ## Returnerer SAND, hvis værdien er en reference
-ISTEXT = ER.TEKST ## Returnerer SAND, hvis værdien er tekst
-N = TAL ## Returnerer en værdi konverteret til et tal
-NA = IKKE.TILGÆNGELIG ## Returnerer fejlværdien #I/T
-TYPE = VÆRDITYPE ## Returnerer et tal, der angiver datatypen for en værdi
-
-
-##
-## Logical functions Logiske funktioner
-##
-AND = OG ## Returnerer SAND, hvis alle argumenterne er sande
-FALSE = FALSK ## Returnerer den logiske værdi FALSK
-IF = HVIS ## Angiver en logisk test, der skal udføres
-IFERROR = HVIS.FEJL ## Returnerer en værdi, du angiver, hvis en formel evauleres som en fejl. Returnerer i modsat fald resultatet af formlen
-NOT = IKKE ## Vender argumentets logik om
-OR = ELLER ## Returneret værdien SAND, hvis mindst ét argument er sandt
-TRUE = SAND ## Returnerer den logiske værdi SAND
-
-
-##
-## Lookup and reference functions Opslags- og referencefunktioner
-##
-ADDRESS = ADRESSE ## Returnerer en reference som tekst til en enkelt celle i et regneark
-AREAS = OMRÅDER ## Returnerer antallet af områder i en reference
-CHOOSE = VÆLG ## Vælger en værdi på en liste med værdier
-COLUMN = KOLONNE ## Returnerer kolonnenummeret i en reference
-COLUMNS = KOLONNER ## Returnerer antallet af kolonner i en reference
-HLOOKUP = VOPSLAG ## Søger i den øverste række af en matrix og returnerer værdien af den angivne celle
-HYPERLINK = HYPERLINK ## Opretter en genvej kaldet et hyperlink, der åbner et dokument, som er lagret på en netværksserver, på et intranet eller på internettet
-INDEX = INDEKS ## Anvender et indeks til at vælge en værdi fra en reference eller en matrix
-INDIRECT = INDIREKTE ## Returnerer en reference, der er angivet af en tekstværdi
-LOOKUP = SLÅ.OP ## Søger værdier i en vektor eller en matrix
-MATCH = SAMMENLIGN ## Søger værdier i en reference eller en matrix
-OFFSET = FORSKYDNING ## Returnerer en reference forskudt i forhold til en given reference
-ROW = RÆKKE ## Returnerer rækkenummeret for en reference
-ROWS = RÆKKER ## Returnerer antallet af rækker i en reference
-RTD = RTD ## Henter realtidsdata fra et program, der understøtter COM-automatisering (Automation: En metode til at arbejde med objekter fra et andet program eller udviklingsværktøj. Automation, som tidligere blev kaldt OLE Automation, er en industristandard og en funktion i COM (Component Object Model).)
-TRANSPOSE = TRANSPONER ## Returnerer en transponeret matrix
-VLOOKUP = LOPSLAG ## Søger i øverste række af en matrix og flytter på tværs af rækken for at returnere en celleværdi
-
-
-##
-## Math and trigonometry functions Matematiske og trigonometriske funktioner
-##
-ABS = ABS ## Returnerer den absolutte værdi af et tal
-ACOS = ARCCOS ## Returnerer et tals arcus cosinus
-ACOSH = ARCCOSH ## Returnerer den inverse hyperbolske cosinus af tal
-ASIN = ARCSIN ## Returnerer et tals arcus sinus
-ASINH = ARCSINH ## Returnerer den inverse hyperbolske sinus for tal
-ATAN = ARCTAN ## Returnerer et tals arcus tangens
-ATAN2 = ARCTAN2 ## Returnerer de angivne x- og y-koordinaters arcus tangens
-ATANH = ARCTANH ## Returnerer et tals inverse hyperbolske tangens
-CEILING = AFRUND.LOFT ## Afrunder et tal til nærmeste heltal eller til nærmeste multiplum af betydning
-COMBIN = KOMBIN ## Returnerer antallet af kombinationer for et givet antal objekter
-COS = COS ## Returnerer et tals cosinus
-COSH = COSH ## Returnerer den inverse hyperbolske cosinus af et tal
-DEGREES = GRADER ## Konverterer radianer til grader
-EVEN = LIGE ## Runder et tal op til nærmeste lige heltal
-EXP = EKSP ## Returnerer e opløftet til en potens af et angivet tal
-FACT = FAKULTET ## Returnerer et tals fakultet
-FACTDOUBLE = DOBBELT.FAKULTET ## Returnerer et tals dobbelte fakultet
-FLOOR = AFRUND.GULV ## Runder et tal ned mod nul
-GCD = STØRSTE.FÆLLES.DIVISOR ## Returnerer den største fælles divisor
-INT = HELTAL ## Nedrunder et tal til det nærmeste heltal
-LCM = MINDSTE.FÆLLES.MULTIPLUM ## Returnerer det mindste fælles multiplum
-LN = LN ## Returnerer et tals naturlige logaritme
-LOG = LOG ## Returnerer logaritmen for et tal på grundlag af et angivet grundtal
-LOG10 = LOG10 ## Returnerer titalslogaritmen af et tal
-MDETERM = MDETERM ## Returnerer determinanten for en matrix
-MINVERSE = MINVERT ## Returnerer den inverse matrix for en matrix
-MMULT = MPRODUKT ## Returnerer matrixproduktet af to matrixer
-MOD = REST ## Returnerer restværdien fra division
-MROUND = MAFRUND ## Returnerer et tal afrundet til det ønskede multiplum
-MULTINOMIAL = MULTINOMIAL ## Returnerer et multinomialt talsæt
-ODD = ULIGE ## Runder et tal op til nærmeste ulige heltal
-PI = PI ## Returnerer værdien af pi
-POWER = POTENS ## Returnerer resultatet af et tal opløftet til en potens
-PRODUCT = PRODUKT ## Multiplicerer argumenterne
-QUOTIENT = KVOTIENT ## Returnerer heltalsdelen ved division
-RADIANS = RADIANER ## Konverterer grader til radianer
-RAND = SLUMP ## Returnerer et tilfældigt tal mellem 0 og 1
-RANDBETWEEN = SLUMP.MELLEM ## Returnerer et tilfældigt tal mellem de tal, der angives
-ROMAN = ROMERTAL ## Konverterer et arabertal til romertal som tekst
-ROUND = AFRUND ## Afrunder et tal til et angivet antal decimaler
-ROUNDDOWN = RUND.NED ## Runder et tal ned mod nul
-ROUNDUP = RUND.OP ## Runder et tal op, væk fra 0 (nul)
-SERIESSUM = SERIESUM ## Returnerer summen af en potensserie baseret på en formel
-SIGN = FORTEGN ## Returnerer et tals fortegn
-SIN = SIN ## Returnerer en given vinkels sinusværdi
-SINH = SINH ## Returnerer den hyperbolske sinus af et tal
-SQRT = KVROD ## Returnerer en positiv kvadratrod
-SQRTPI = KVRODPI ## Returnerer kvadratroden af (tal * pi;)
-SUBTOTAL = SUBTOTAL ## Returnerer en subtotal på en liste eller i en database
-SUM = SUM ## Lægger argumenterne sammen
-SUMIF = SUM.HVIS ## Lægger de celler sammen, der er specificeret af et givet kriterium.
-SUMIFS = SUM.HVISER ## Lægger de celler i et område sammen, der opfylder flere kriterier.
-SUMPRODUCT = SUMPRODUKT ## Returnerer summen af produkter af ens matrixkomponenter
-SUMSQ = SUMKV ## Returnerer summen af argumenternes kvadrater
-SUMX2MY2 = SUMX2MY2 ## Returnerer summen af differensen mellem kvadrater af ens værdier i to matrixer
-SUMX2PY2 = SUMX2PY2 ## Returnerer summen af summen af kvadrater af tilsvarende værdier i to matrixer
-SUMXMY2 = SUMXMY2 ## Returnerer summen af kvadrater af differenser mellem ens værdier i to matrixer
-TAN = TAN ## Returnerer et tals tangens
-TANH = TANH ## Returnerer et tals hyperbolske tangens
-TRUNC = AFKORT ## Afkorter et tal til et heltal
-
-
-##
-## Statistical functions Statistiske funktioner
-##
-AVEDEV = MAD ## Returnerer den gennemsnitlige numeriske afvigelse fra stikprøvens middelværdi
-AVERAGE = MIDDEL ## Returnerer middelværdien af argumenterne
-AVERAGEA = MIDDELV ## Returnerer middelværdien af argumenterne og medtager tal, tekst og logiske værdier
-AVERAGEIF = MIDDEL.HVIS ## Returnerer gennemsnittet (den aritmetiske middelværdi) af alle de celler, der opfylder et givet kriterium, i et område
-AVERAGEIFS = MIDDEL.HVISER ## Returnerer gennemsnittet (den aritmetiske middelværdi) af alle de celler, der opfylder flere kriterier.
-BETADIST = BETAFORDELING ## Returnerer den kumulative betafordelingsfunktion
-BETAINV = BETAINV ## Returnerer den inverse kumulative fordelingsfunktion for en angivet betafordeling
-BINOMDIST = BINOMIALFORDELING ## Returnerer punktsandsynligheden for binomialfordelingen
-CHIDIST = CHIFORDELING ## Returnerer fraktilsandsynligheden for en chi2-fordeling
-CHIINV = CHIINV ## Returnerer den inverse fraktilsandsynlighed for en chi2-fordeling
-CHITEST = CHITEST ## Foretager en test for uafhængighed
-CONFIDENCE = KONFIDENSINTERVAL ## Returnerer et konfidensinterval for en population
-CORREL = KORRELATION ## Returnerer korrelationskoefficienten mellem to datasæt
-COUNT = TÆL ## Tæller antallet af tal på en liste med argumenter
-COUNTA = TÆLV ## Tæller antallet af værdier på en liste med argumenter
-COUNTBLANK = ANTAL.BLANKE ## Tæller antallet af tomme celler i et område
-COUNTIF = TÆLHVIS ## Tæller antallet af celler, som opfylder de givne kriterier, i et område
-COUNTIFS = TÆL.HVISER ## Tæller antallet af de celler, som opfylder flere kriterier, i et område
-COVAR = KOVARIANS ## Beregner kovariansen mellem to stokastiske variabler
-CRITBINOM = KRITBINOM ## Returnerer den mindste værdi for x, for hvilken det gælder, at fordelingsfunktionen er mindre end eller lig med kriterieværdien.
-DEVSQ = SAK ## Returnerer summen af de kvadrerede afvigelser fra middelværdien
-EXPONDIST = EKSPFORDELING ## Returnerer eksponentialfordelingen
-FDIST = FFORDELING ## Returnerer fraktilsandsynligheden for F-fordelingen
-FINV = FINV ## Returnerer den inverse fraktilsandsynlighed for F-fordelingen
-FISHER = FISHER ## Returnerer Fisher-transformationen
-FISHERINV = FISHERINV ## Returnerer den inverse Fisher-transformation
-FORECAST = PROGNOSE ## Returnerer en prognoseværdi baseret på lineær tendens
-FREQUENCY = FREKVENS ## Returnerer en frekvensfordeling i en søjlevektor
-FTEST = FTEST ## Returnerer resultatet af en F-test til sammenligning af varians
-GAMMADIST = GAMMAFORDELING ## Returnerer fordelingsfunktionen for gammafordelingen
-GAMMAINV = GAMMAINV ## Returnerer den inverse fordelingsfunktion for gammafordelingen
-GAMMALN = GAMMALN ## Returnerer den naturlige logaritme til gammafordelingen, G(x)
-GEOMEAN = GEOMIDDELVÆRDI ## Returnerer det geometriske gennemsnit
-GROWTH = FORØGELSE ## Returnerer værdier langs en eksponentiel tendens
-HARMEAN = HARMIDDELVÆRDI ## Returnerer det harmoniske gennemsnit
-HYPGEOMDIST = HYPGEOFORDELING ## Returnerer punktsandsynligheden i en hypergeometrisk fordeling
-INTERCEPT = SKÆRING ## Returnerer afskæringsværdien på y-aksen i en lineær regression
-KURT = TOPSTEJL ## Returnerer kurtosisværdien for en stokastisk variabel
-LARGE = STOR ## Returnerer den k'te største værdi i et datasæt
-LINEST = LINREGR ## Returnerer parameterestimaterne for en lineær tendens
-LOGEST = LOGREGR ## Returnerer parameterestimaterne for en eksponentiel tendens
-LOGINV = LOGINV ## Returnerer den inverse fordelingsfunktion for lognormalfordelingen
-LOGNORMDIST = LOGNORMFORDELING ## Returnerer fordelingsfunktionen for lognormalfordelingen
-MAX = MAKS ## Returnerer den maksimale værdi på en liste med argumenter.
-MAXA = MAKSV ## Returnerer den maksimale værdi på en liste med argumenter og medtager tal, tekst og logiske værdier
-MEDIAN = MEDIAN ## Returnerer medianen for de angivne tal
-MIN = MIN ## Returnerer den mindste værdi på en liste med argumenter.
-MINA = MINV ## Returnerer den mindste værdi på en liste med argumenter og medtager tal, tekst og logiske værdier
-MODE = HYPPIGST ## Returnerer den hyppigste værdi i et datasæt
-NEGBINOMDIST = NEGBINOMFORDELING ## Returnerer den negative binomialfordeling
-NORMDIST = NORMFORDELING ## Returnerer fordelingsfunktionen for normalfordelingen
-NORMINV = NORMINV ## Returnerer den inverse fordelingsfunktion for normalfordelingen
-NORMSDIST = STANDARDNORMFORDELING ## Returnerer fordelingsfunktionen for standardnormalfordelingen
-NORMSINV = STANDARDNORMINV ## Returnerer den inverse fordelingsfunktion for standardnormalfordelingen
-PEARSON = PEARSON ## Returnerer Pearsons korrelationskoefficient
-PERCENTILE = FRAKTIL ## Returnerer den k'te fraktil for datasættet
-PERCENTRANK = PROCENTPLADS ## Returnerer den procentuelle rang for en given værdi i et datasæt
-PERMUT = PERMUT ## Returnerer antallet af permutationer for et givet sæt objekter
-POISSON = POISSON ## Returnerer fordelingsfunktionen for en Poisson-fordeling
-PROB = SANDSYNLIGHED ## Returnerer intervalsandsynligheden
-QUARTILE = KVARTIL ## Returnerer kvartilen i et givet datasæt
-RANK = PLADS ## Returnerer rangen for et tal på en liste med tal
-RSQ = FORKLARINGSGRAD ## Returnerer R2-værdien fra en simpel lineær regression
-SKEW = SKÆVHED ## Returnerer skævheden for en stokastisk variabel
-SLOPE = HÆLDNING ## Returnerer estimatet på hældningen fra en simpel lineær regression
-SMALL = MINDSTE ## Returnerer den k'te mindste værdi i datasættet
-STANDARDIZE = STANDARDISER ## Returnerer en standardiseret værdi
-STDEV = STDAFV ## Estimerer standardafvigelsen på basis af en stikprøve
-STDEVA = STDAFVV ## Beregner standardafvigelsen på basis af en prøve og medtager tal, tekst og logiske værdier
-STDEVP = STDAFVP ## Beregner standardafvigelsen på basis af en hel population
-STDEVPA = STDAFVPV ## Beregner standardafvigelsen på basis af en hel population og medtager tal, tekst og logiske værdier
-STEYX = STFYX ## Returnerer standardafvigelsen for de estimerede y-værdier i den simple lineære regression
-TDIST = TFORDELING ## Returnerer fordelingsfunktionen for Student's t-fordeling
-TINV = TINV ## Returnerer den inverse fordelingsfunktion for Student's t-fordeling
-TREND = TENDENS ## Returnerer værdi under antagelse af en lineær tendens
-TRIMMEAN = TRIMMIDDELVÆRDI ## Returnerer den trimmede middelværdi for datasættet
-TTEST = TTEST ## Returnerer den sandsynlighed, der er forbundet med Student's t-test
-VAR = VARIANS ## Beregner variansen på basis af en prøve
-VARA = VARIANSV ## Beregner variansen på basis af en prøve og medtager tal, tekst og logiske værdier
-VARP = VARIANSP ## Beregner variansen på basis af hele populationen
-VARPA = VARIANSPV ## Beregner variansen på basis af hele populationen og medtager tal, tekst og logiske værdier
-WEIBULL = WEIBULL ## Returnerer fordelingsfunktionen for Weibull-fordelingen
-ZTEST = ZTEST ## Returnerer sandsynlighedsværdien ved en en-sidet z-test
-
-
-##
-## Text functions Tekstfunktioner
-##
-ASC = ASC ## Ændrer engelske tegn i fuld bredde (dobbelt-byte) eller katakana i en tegnstreng til tegn i halv bredde (enkelt-byte)
-BAHTTEXT = BAHTTEKST ## Konverterer et tal til tekst ved hjælp af valutaformatet ß (baht)
-CHAR = TEGN ## Returnerer det tegn, der svarer til kodenummeret
-CLEAN = RENS ## Fjerner alle tegn, der ikke kan udskrives, fra tekst
-CODE = KODE ## Returnerer en numerisk kode for det første tegn i en tekststreng
-CONCATENATE = SAMMENKÆDNING ## Sammenkæder adskillige tekstelementer til ét tekstelement
-DOLLAR = KR ## Konverterer et tal til tekst ved hjælp af valutaformatet kr. (kroner)
-EXACT = EKSAKT ## Kontrollerer, om to tekstværdier er identiske
-FIND = FIND ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes mellem store og små bogstaver)
-FINDB = FINDB ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes mellem store og små bogstaver)
-FIXED = FAST ## Formaterer et tal som tekst med et fast antal decimaler
-JIS = JIS ## Ændrer engelske tegn i halv bredde (enkelt-byte) eller katakana i en tegnstreng til tegn i fuld bredde (dobbelt-byte)
-LEFT = VENSTRE ## Returnerer tegnet længst til venstre i en tekstværdi
-LEFTB = VENSTREB ## Returnerer tegnet længst til venstre i en tekstværdi
-LEN = LÆNGDE ## Returnerer antallet af tegn i en tekststreng
-LENB = LÆNGDEB ## Returnerer antallet af tegn i en tekststreng
-LOWER = SMÅ.BOGSTAVER ## Konverterer tekst til små bogstaver
-MID = MIDT ## Returnerer et bestemt antal tegn fra en tekststreng fra og med den angivne startposition
-MIDB = MIDTB ## Returnerer et bestemt antal tegn fra en tekststreng fra og med den angivne startposition
-PHONETIC = FONETISK ## Uddrager de fonetiske (furigana) tegn fra en tekststreng
-PROPER = STORT.FORBOGSTAV ## Konverterer første bogstav i hvert ord i teksten til stort bogstav
-REPLACE = ERSTAT ## Erstatter tegn i tekst
-REPLACEB = ERSTATB ## Erstatter tegn i tekst
-REPT = GENTAG ## Gentager tekst et givet antal gange
-RIGHT = HØJRE ## Returnerer tegnet længste til højre i en tekstværdi
-RIGHTB = HØJREB ## Returnerer tegnet længste til højre i en tekstværdi
-SEARCH = SØG ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes ikke mellem store og små bogstaver)
-SEARCHB = SØGB ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes ikke mellem store og små bogstaver)
-SUBSTITUTE = UDSKIFT ## Udskifter gammel tekst med ny tekst i en tekststreng
-T = T ## Konverterer argumenterne til tekst
-TEXT = TEKST ## Formaterer et tal og konverterer det til tekst
-TRIM = FJERN.OVERFLØDIGE.BLANKE ## Fjerner mellemrum fra tekst
-UPPER = STORE.BOGSTAVER ## Konverterer tekst til store bogstaver
-VALUE = VÆRDI ## Konverterer et tekstargument til et tal
+##
+## PhpSpreadsheet
+##
+## Data in this file derived from https://www.excel-function-translation.com/
+##
+##
+
+
+##
+## Add-in and Automation functions Tilføjelsesprogram- og automatiseringsfunktioner
+##
+GETPIVOTDATA = HENTPIVOTDATA ## Returnerer data, der er lagret i en pivottabelrapport
+
+
+##
+## Cube functions Kubefunktioner
+##
+CUBEKPIMEMBER = KUBE.KPI.MEDLEM ## Returnerer navn, egenskab og mål for en KPI-indikator og viser navnet og egenskaben i cellen. En KPI-indikator er en målbar størrelse, f.eks. bruttooverskud pr. måned eller personaleudskiftning pr. kvartal, der bruges til at overvåge en organisations præstationer.
+CUBEMEMBER = KUBE.MEDLEM ## Returnerer et medlem eller en tupel fra kubehierarkiet. Bruges til at validere, om et medlem eller en tupel findes i kuben.
+CUBEMEMBERPROPERTY = KUBEMEDLEM.EGENSKAB ## Returnerer værdien af en egenskab for et medlem i kuben. Bruges til at validere, om et medlemsnavn findes i kuben, og returnere den angivne egenskab for medlemmet.
+CUBERANKEDMEMBER = KUBEMEDLEM.RANG ## Returnerer det n'te eller rangordnede medlem i et sæt. Bruges til at returnere et eller flere elementer i et sæt, f.eks. topsælgere eller de 10 bedste elever.
+CUBESET = KUBESÆT ## Definerer et beregnet sæt medlemmer eller tupler ved at sende et sætudtryk til kuben på serveren, som opretter sættet og returnerer det til Microsoft Office Excel.
+CUBESETCOUNT = KUBESÆT.TÆL ## Returnerer antallet af elementer i et sæt.
+CUBEVALUE = KUBEVÆRDI ## Returnerer en sammenlagt (aggregeret) værdi fra en kube.
+
+
+##
+## Database functions Databasefunktioner
+##
+DAVERAGE = DMIDDEL ## Returnerer gennemsnittet af markerede databaseposter
+DCOUNT = DTÆL ## Tæller de celler, der indeholder tal, i en database
+DCOUNTA = DTÆLV ## Tæller udfyldte celler i en database
+DGET = DHENT ## Uddrager en enkelt post, der opfylder de angivne kriterier, fra en database
+DMAX = DMAKS ## Returnerer den største værdi blandt markerede databaseposter
+DMIN = DMIN ## Returnerer den mindste værdi blandt markerede databaseposter
+DPRODUCT = DPRODUKT ## Ganger værdierne i et bestemt felt med poster, der opfylder kriterierne i en database
+DSTDEV = DSTDAFV ## Beregner et skøn over standardafvigelsen baseret på en stikprøve af markerede databaseposter
+DSTDEVP = DSTDAFVP ## Beregner standardafvigelsen baseret på hele populationen af markerede databaseposter
+DSUM = DSUM ## Sammenlægger de tal i feltkolonnen i databasen, der opfylder kriterierne
+DVAR = DVARIANS ## Beregner varians baseret på en stikprøve af markerede databaseposter
+DVARP = DVARIANSP ## Beregner varians baseret på hele populationen af markerede databaseposter
+
+
+##
+## Date and time functions Dato- og klokkeslætsfunktioner
+##
+DATE = DATO ## Returnerer serienummeret for en bestemt dato
+DATEVALUE = DATOVÆRDI ## Konverterer en dato i form af tekst til et serienummer
+DAY = DAG ## Konverterer et serienummer til en dag i måneden
+DAYS360 = DAGE360 ## Beregner antallet af dage mellem to datoer på grundlag af et år med 360 dage
+EDATE = EDATO ## Returnerer serienummeret for den dato, der ligger det angivne antal måneder før eller efter startdatoen
+EOMONTH = SLUT.PÅ.MÅNED ## Returnerer serienummeret på den sidste dag i måneden før eller efter et angivet antal måneder
+HOUR = TIME ## Konverterer et serienummer til en time
+MINUTE = MINUT ## Konverterer et serienummer til et minut
+MONTH = MÅNED ## Konverterer et serienummer til en måned
+NETWORKDAYS = ANTAL.ARBEJDSDAGE ## Returnerer antallet af hele arbejdsdage mellem to datoer
+NOW = NU ## Returnerer serienummeret for den aktuelle dato eller det aktuelle klokkeslæt
+SECOND = SEKUND ## Konverterer et serienummer til et sekund
+TIME = KLOKKESLÆT ## Returnerer serienummeret for et bestemt klokkeslæt
+TIMEVALUE = TIDSVÆRDI ## Konverterer et klokkeslæt i form af tekst til et serienummer
+TODAY = IDAG ## Returnerer serienummeret for dags dato
+WEEKDAY = UGEDAG ## Konverterer et serienummer til en ugedag
+WEEKNUM = UGE.NR ## Konverterer et serienummer til et tal, der angiver ugenummeret i året
+WORKDAY = ARBEJDSDAG ## Returnerer serienummeret for dagen før eller efter det angivne antal arbejdsdage
+YEAR = ÅR ## Konverterer et serienummer til et år
+YEARFRAC = ÅR.BRØK ## Returnerer årsbrøken, der repræsenterer antallet af hele dage mellem startdato og slutdato
+
+
+##
+## Engineering functions Tekniske funktioner
+##
+BESSELI = BESSELI ## Returnerer den modificerede Bessel-funktion In(x)
+BESSELJ = BESSELJ ## Returnerer Bessel-funktionen Jn(x)
+BESSELK = BESSELK ## Returnerer den modificerede Bessel-funktion Kn(x)
+BESSELY = BESSELY ## Returnerer Bessel-funktionen Yn(x)
+BIN2DEC = BIN.TIL.DEC ## Konverterer et binært tal til et decimaltal
+BIN2HEX = BIN.TIL.HEX ## Konverterer et binært tal til et heksadecimalt tal
+BIN2OCT = BIN.TIL.OKT ## Konverterer et binært tal til et oktaltal.
+COMPLEX = KOMPLEKS ## Konverterer reelle og imaginære koefficienter til et komplekst tal
+CONVERT = KONVERTER ## Konverterer et tal fra én måleenhed til en anden
+DEC2BIN = DEC.TIL.BIN ## Konverterer et decimaltal til et binært tal
+DEC2HEX = DEC.TIL.HEX ## Konverterer et decimaltal til et heksadecimalt tal
+DEC2OCT = DEC.TIL.OKT ## Konverterer et decimaltal til et oktaltal
+DELTA = DELTA ## Tester, om to værdier er ens
+ERF = FEJLFUNK ## Returner fejlfunktionen
+ERFC = FEJLFUNK.KOMP ## Returnerer den komplementære fejlfunktion
+GESTEP = GETRIN ## Tester, om et tal er større end en grænseværdi
+HEX2BIN = HEX.TIL.BIN ## Konverterer et heksadecimalt tal til et binært tal
+HEX2DEC = HEX.TIL.DEC ## Konverterer et decimaltal til et heksadecimalt tal
+HEX2OCT = HEX.TIL.OKT ## Konverterer et heksadecimalt tal til et oktaltal
+IMABS = IMAGABS ## Returnerer den absolutte værdi (modulus) for et komplekst tal
+IMAGINARY = IMAGINÆR ## Returnerer den imaginære koefficient for et komplekst tal
+IMARGUMENT = IMAGARGUMENT ## Returnerer argumentet theta, en vinkel udtrykt i radianer
+IMCONJUGATE = IMAGKONJUGERE ## Returnerer den komplekse konjugation af et komplekst tal
+IMCOS = IMAGCOS ## Returnerer et komplekst tals cosinus
+IMDIV = IMAGDIV ## Returnerer kvotienten for to komplekse tal
+IMEXP = IMAGEKSP ## Returnerer et komplekst tals eksponentialfunktion
+IMLN = IMAGLN ## Returnerer et komplekst tals naturlige logaritme
+IMLOG10 = IMAGLOG10 ## Returnerer et komplekst tals sædvanlige logaritme (titalslogaritme)
+IMLOG2 = IMAGLOG2 ## Returnerer et komplekst tals sædvanlige logaritme (totalslogaritme)
+IMPOWER = IMAGPOTENS ## Returnerer et komplekst tal opløftet i en heltalspotens
+IMPRODUCT = IMAGPRODUKT ## Returnerer produktet af komplekse tal
+IMREAL = IMAGREELT ## Returnerer den reelle koefficient for et komplekst tal
+IMSIN = IMAGSIN ## Returnerer et komplekst tals sinus
+IMSQRT = IMAGKVROD ## Returnerer et komplekst tals kvadratrod
+IMSUB = IMAGSUB ## Returnerer forskellen mellem to komplekse tal
+IMSUM = IMAGSUM ## Returnerer summen af komplekse tal
+OCT2BIN = OKT.TIL.BIN ## Konverterer et oktaltal til et binært tal
+OCT2DEC = OKT.TIL.DEC ## Konverterer et oktaltal til et decimaltal
+OCT2HEX = OKT.TIL.HEX ## Konverterer et oktaltal til et heksadecimalt tal
+
+
+##
+## Financial functions Finansielle funktioner
+##
+ACCRINT = PÅLØBRENTE ## Returnerer den påløbne rente for et værdipapir med periodiske renteudbetalinger
+ACCRINTM = PÅLØBRENTE.UDLØB ## Returnerer den påløbne rente for et værdipapir, hvor renteudbetalingen finder sted ved papirets udløb
+AMORDEGRC = AMORDEGRC ## Returnerer afskrivningsbeløbet for hver regnskabsperiode ved hjælp af en afskrivningskoefficient
+AMORLINC = AMORLINC ## Returnerer afskrivningsbeløbet for hver regnskabsperiode
+COUPDAYBS = KUPONDAGE.SA ## Returnerer antallet af dage fra starten af kuponperioden til afregningsdatoen
+COUPDAYS = KUPONDAGE.A ## Returnerer antallet af dage fra begyndelsen af kuponperioden til afregningsdatoen
+COUPDAYSNC = KUPONDAGE.ANK ## Returnerer antallet af dage i den kuponperiode, der indeholder afregningsdatoen
+COUPNCD = KUPONDAG.NÆSTE ## Returnerer den næste kupondato efter afregningsdatoen
+COUPNUM = KUPONBETALINGER ## Returnerer antallet af kuponudbetalinger mellem afregnings- og udløbsdatoen
+COUPPCD = KUPONDAG.FORRIGE ## Returnerer den forrige kupondato før afregningsdatoen
+CUMIPMT = AKKUM.RENTE ## Returnerer den akkumulerede rente, der betales på et lån mellem to perioder
+CUMPRINC = AKKUM.HOVEDSTOL ## Returnerer den akkumulerede nedbringelse af hovedstol mellem to perioder
+DB = DB ## Returnerer afskrivningen på et aktiv i en angivet periode ved anvendelse af saldometoden
+DDB = DSA ## Returnerer afskrivningsbeløbet for et aktiv over en bestemt periode ved anvendelse af dobbeltsaldometoden eller en anden afskrivningsmetode, som du angiver
+DISC = DISKONTO ## Returnerer et værdipapirs diskonto
+DOLLARDE = KR.DECIMAL ## Konverterer en kronepris udtrykt som brøk til en kronepris udtrykt som decimaltal
+DOLLARFR = KR.BRØK ## Konverterer en kronepris udtrykt som decimaltal til en kronepris udtrykt som brøk
+DURATION = VARIGHED ## Returnerer den årlige løbetid for et værdipapir med periodiske renteudbetalinger
+EFFECT = EFFEKTIV.RENTE ## Returnerer den årlige effektive rente
+FV = FV ## Returnerer fremtidsværdien af en investering
+FVSCHEDULE = FVTABEL ## Returnerer den fremtidige værdi af en hovedstol, når der er tilskrevet rente og rentes rente efter forskellige rentesatser
+INTRATE = RENTEFOD ## Returnerer renten på et fuldt ud investeret værdipapir
+IPMT = R.YDELSE ## Returnerer renten fra en investering for en given periode
+IRR = IA ## Returnerer den interne rente for en række pengestrømme
+ISPMT = ISPMT ## Beregner den betalte rente i løbet af en bestemt investeringsperiode
+MDURATION = MVARIGHED ## Returnerer Macauleys modificerede løbetid for et værdipapir med en formodet pari på kr. 100
+MIRR = MIA ## Returnerer den interne forrentning, hvor positive og negative pengestrømme finansieres til forskellig rente
+NOMINAL = NOMINEL ## Returnerer den årlige nominelle rente
+NPER = NPER ## Returnerer antallet af perioder for en investering
+NPV = NUTIDSVÆRDI ## Returnerer nettonutidsværdien for en investering baseret på en række periodiske pengestrømme og en diskonteringssats
+ODDFPRICE = ULIGE.KURS.PÅLYDENDE ## Returnerer kursen pr. kr. 100 nominel værdi for et værdipapir med en ulige (kort eller lang) første periode
+ODDFYIELD = ULIGE.FØRSTE.AFKAST ## Returnerer afkastet for et værdipapir med ulige første periode
+ODDLPRICE = ULIGE.SIDSTE.KURS ## Returnerer kursen pr. kr. 100 nominel værdi for et værdipapir med ulige sidste periode
+ODDLYIELD = ULIGE.SIDSTE.AFKAST ## Returnerer afkastet for et værdipapir med ulige sidste periode
+PMT = YDELSE ## Returnerer renten fra en investering for en given periode
+PPMT = H.YDELSE ## Returnerer ydelsen på hovedstolen for en investering i en given periode
+PRICE = KURS ## Returnerer kursen pr. kr 100 nominel værdi for et værdipapir med periodiske renteudbetalinger
+PRICEDISC = KURS.DISKONTO ## Returnerer kursen pr. kr 100 nominel værdi for et diskonteret værdipapir
+PRICEMAT = KURS.UDLØB ## Returnerer kursen pr. kr 100 nominel værdi for et værdipapir, hvor renten udbetales ved papirets udløb
+PV = NV ## Returnerer den nuværende værdi af en investering
+RATE = RENTE ## Returnerer renten i hver periode for en annuitet
+RECEIVED = MODTAGET.VED.UDLØB ## Returnerer det beløb, der modtages ved udløbet af et fuldt ud investeret værdipapir
+SLN = LA ## Returnerer den lineære afskrivning for et aktiv i en enkelt periode
+SYD = ÅRSAFSKRIVNING ## Returnerer den årlige afskrivning på et aktiv i en bestemt periode
+TBILLEQ = STATSOBLIGATION ## Returnerer det obligationsækvivalente afkast for en statsobligation
+TBILLPRICE = STATSOBLIGATION.KURS ## Returnerer kursen pr. kr 100 nominel værdi for en statsobligation
+TBILLYIELD = STATSOBLIGATION.AFKAST ## Returnerer en afkastet på en statsobligation
+VDB = VSA ## Returnerer afskrivningen på et aktiv i en angivet periode, herunder delperioder, ved brug af dobbeltsaldometoden
+XIRR = INTERN.RENTE ## Returnerer den interne rente for en plan over pengestrømme, der ikke behøver at være periodiske
+XNPV = NETTO.NUTIDSVÆRDI ## Returnerer nutidsværdien for en plan over pengestrømme, der ikke behøver at være periodiske
+YIELD = AFKAST ## Returnerer afkastet for et værdipapir med periodiske renteudbetalinger
+YIELDDISC = AFKAST.DISKONTO ## Returnerer det årlige afkast for et diskonteret værdipapir, f.eks. en statsobligation
+YIELDMAT = AFKAST.UDLØBSDATO ## Returnerer det årlige afkast for et værdipapir, hvor renten udbetales ved papirets udløb
+
+
+##
+## Information functions Informationsfunktioner
+##
+CELL = CELLE ## Returnerer oplysninger om formatering, placering eller indhold af en celle
+ERROR.TYPE = FEJLTYPE ## Returnerer et tal, der svarer til en fejltype
+INFO = INFO ## Returnerer oplysninger om det aktuelle operativmiljø
+ISBLANK = ER.TOM ## Returnerer SAND, hvis værdien er tom
+ISERR = ER.FJL ## Returnerer SAND, hvis værdien er en fejlværdi undtagen #I/T
+ISERROR = ER.FEJL ## Returnerer SAND, hvis værdien er en fejlværdi
+ISEVEN = ER.LIGE ## Returnerer SAND, hvis tallet er lige
+ISLOGICAL = ER.LOGISK ## Returnerer SAND, hvis værdien er en logisk værdi
+ISNA = ER.IKKE.TILGÆNGELIG ## Returnerer SAND, hvis værdien er fejlværdien #I/T
+ISNONTEXT = ER.IKKE.TEKST ## Returnerer SAND, hvis værdien ikke er tekst
+ISNUMBER = ER.TAL ## Returnerer SAND, hvis værdien er et tal
+ISODD = ER.ULIGE ## Returnerer SAND, hvis tallet er ulige
+ISREF = ER.REFERENCE ## Returnerer SAND, hvis værdien er en reference
+ISTEXT = ER.TEKST ## Returnerer SAND, hvis værdien er tekst
+N = TAL ## Returnerer en værdi konverteret til et tal
+NA = IKKE.TILGÆNGELIG ## Returnerer fejlværdien #I/T
+TYPE = VÆRDITYPE ## Returnerer et tal, der angiver datatypen for en værdi
+
+
+##
+## Logical functions Logiske funktioner
+##
+AND = OG ## Returnerer SAND, hvis alle argumenterne er sande
+FALSE = FALSK ## Returnerer den logiske værdi FALSK
+IF = HVIS ## Angiver en logisk test, der skal udføres
+IFERROR = HVIS.FEJL ## Returnerer en værdi, du angiver, hvis en formel evauleres som en fejl. Returnerer i modsat fald resultatet af formlen
+NOT = IKKE ## Vender argumentets logik om
+OR = ELLER ## Returneret værdien SAND, hvis mindst ét argument er sandt
+TRUE = SAND ## Returnerer den logiske værdi SAND
+
+
+##
+## Lookup and reference functions Opslags- og referencefunktioner
+##
+ADDRESS = ADRESSE ## Returnerer en reference som tekst til en enkelt celle i et regneark
+AREAS = OMRÅDER ## Returnerer antallet af områder i en reference
+CHOOSE = VÆLG ## Vælger en værdi på en liste med værdier
+COLUMN = KOLONNE ## Returnerer kolonnenummeret i en reference
+COLUMNS = KOLONNER ## Returnerer antallet af kolonner i en reference
+HLOOKUP = VOPSLAG ## Søger i den øverste række af en matrix og returnerer værdien af den angivne celle
+HYPERLINK = HYPERLINK ## Opretter en genvej kaldet et hyperlink, der åbner et dokument, som er lagret på en netværksserver, på et intranet eller på internettet
+INDEX = INDEKS ## Anvender et indeks til at vælge en værdi fra en reference eller en matrix
+INDIRECT = INDIREKTE ## Returnerer en reference, der er angivet af en tekstværdi
+LOOKUP = SLÅ.OP ## Søger værdier i en vektor eller en matrix
+MATCH = SAMMENLIGN ## Søger værdier i en reference eller en matrix
+OFFSET = FORSKYDNING ## Returnerer en reference forskudt i forhold til en given reference
+ROW = RÆKKE ## Returnerer rækkenummeret for en reference
+ROWS = RÆKKER ## Returnerer antallet af rækker i en reference
+RTD = RTD ## Henter realtidsdata fra et program, der understøtter COM-automatisering (Automation: En metode til at arbejde med objekter fra et andet program eller udviklingsværktøj. Automation, som tidligere blev kaldt OLE Automation, er en industristandard og en funktion i COM (Component Object Model).)
+TRANSPOSE = TRANSPONER ## Returnerer en transponeret matrix
+VLOOKUP = LOPSLAG ## Søger i øverste række af en matrix og flytter på tværs af rækken for at returnere en celleværdi
+
+
+##
+## Math and trigonometry functions Matematiske og trigonometriske funktioner
+##
+ABS = ABS ## Returnerer den absolutte værdi af et tal
+ACOS = ARCCOS ## Returnerer et tals arcus cosinus
+ACOSH = ARCCOSH ## Returnerer den inverse hyperbolske cosinus af tal
+ASIN = ARCSIN ## Returnerer et tals arcus sinus
+ASINH = ARCSINH ## Returnerer den inverse hyperbolske sinus for tal
+ATAN = ARCTAN ## Returnerer et tals arcus tangens
+ATAN2 = ARCTAN2 ## Returnerer de angivne x- og y-koordinaters arcus tangens
+ATANH = ARCTANH ## Returnerer et tals inverse hyperbolske tangens
+CEILING = AFRUND.LOFT ## Afrunder et tal til nærmeste heltal eller til nærmeste multiplum af betydning
+COMBIN = KOMBIN ## Returnerer antallet af kombinationer for et givet antal objekter
+COS = COS ## Returnerer et tals cosinus
+COSH = COSH ## Returnerer den inverse hyperbolske cosinus af et tal
+DEGREES = GRADER ## Konverterer radianer til grader
+EVEN = LIGE ## Runder et tal op til nærmeste lige heltal
+EXP = EKSP ## Returnerer e opløftet til en potens af et angivet tal
+FACT = FAKULTET ## Returnerer et tals fakultet
+FACTDOUBLE = DOBBELT.FAKULTET ## Returnerer et tals dobbelte fakultet
+FLOOR = AFRUND.GULV ## Runder et tal ned mod nul
+GCD = STØRSTE.FÆLLES.DIVISOR ## Returnerer den største fælles divisor
+INT = HELTAL ## Nedrunder et tal til det nærmeste heltal
+LCM = MINDSTE.FÆLLES.MULTIPLUM ## Returnerer det mindste fælles multiplum
+LN = LN ## Returnerer et tals naturlige logaritme
+LOG = LOG ## Returnerer logaritmen for et tal på grundlag af et angivet grundtal
+LOG10 = LOG10 ## Returnerer titalslogaritmen af et tal
+MDETERM = MDETERM ## Returnerer determinanten for en matrix
+MINVERSE = MINVERT ## Returnerer den inverse matrix for en matrix
+MMULT = MPRODUKT ## Returnerer matrixproduktet af to matrixer
+MOD = REST ## Returnerer restværdien fra division
+MROUND = MAFRUND ## Returnerer et tal afrundet til det ønskede multiplum
+MULTINOMIAL = MULTINOMIAL ## Returnerer et multinomialt talsæt
+ODD = ULIGE ## Runder et tal op til nærmeste ulige heltal
+PI = PI ## Returnerer værdien af pi
+POWER = POTENS ## Returnerer resultatet af et tal opløftet til en potens
+PRODUCT = PRODUKT ## Multiplicerer argumenterne
+QUOTIENT = KVOTIENT ## Returnerer heltalsdelen ved division
+RADIANS = RADIANER ## Konverterer grader til radianer
+RAND = SLUMP ## Returnerer et tilfældigt tal mellem 0 og 1
+RANDBETWEEN = SLUMP.MELLEM ## Returnerer et tilfældigt tal mellem de tal, der angives
+ROMAN = ROMERTAL ## Konverterer et arabertal til romertal som tekst
+ROUND = AFRUND ## Afrunder et tal til et angivet antal decimaler
+ROUNDDOWN = RUND.NED ## Runder et tal ned mod nul
+ROUNDUP = RUND.OP ## Runder et tal op, væk fra 0 (nul)
+SERIESSUM = SERIESUM ## Returnerer summen af en potensserie baseret på en formel
+SIGN = FORTEGN ## Returnerer et tals fortegn
+SIN = SIN ## Returnerer en given vinkels sinusværdi
+SINH = SINH ## Returnerer den hyperbolske sinus af et tal
+SQRT = KVROD ## Returnerer en positiv kvadratrod
+SQRTPI = KVRODPI ## Returnerer kvadratroden af (tal * pi;)
+SUBTOTAL = SUBTOTAL ## Returnerer en subtotal på en liste eller i en database
+SUM = SUM ## Lægger argumenterne sammen
+SUMIF = SUM.HVIS ## Lægger de celler sammen, der er specificeret af et givet kriterium.
+SUMIFS = SUM.HVISER ## Lægger de celler i et område sammen, der opfylder flere kriterier.
+SUMPRODUCT = SUMPRODUKT ## Returnerer summen af produkter af ens matrixkomponenter
+SUMSQ = SUMKV ## Returnerer summen af argumenternes kvadrater
+SUMX2MY2 = SUMX2MY2 ## Returnerer summen af differensen mellem kvadrater af ens værdier i to matrixer
+SUMX2PY2 = SUMX2PY2 ## Returnerer summen af summen af kvadrater af tilsvarende værdier i to matrixer
+SUMXMY2 = SUMXMY2 ## Returnerer summen af kvadrater af differenser mellem ens værdier i to matrixer
+TAN = TAN ## Returnerer et tals tangens
+TANH = TANH ## Returnerer et tals hyperbolske tangens
+TRUNC = AFKORT ## Afkorter et tal til et heltal
+
+
+##
+## Statistical functions Statistiske funktioner
+##
+AVEDEV = MAD ## Returnerer den gennemsnitlige numeriske afvigelse fra stikprøvens middelværdi
+AVERAGE = MIDDEL ## Returnerer middelværdien af argumenterne
+AVERAGEA = MIDDELV ## Returnerer middelværdien af argumenterne og medtager tal, tekst og logiske værdier
+AVERAGEIF = MIDDEL.HVIS ## Returnerer gennemsnittet (den aritmetiske middelværdi) af alle de celler, der opfylder et givet kriterium, i et område
+AVERAGEIFS = MIDDEL.HVISER ## Returnerer gennemsnittet (den aritmetiske middelværdi) af alle de celler, der opfylder flere kriterier.
+BETADIST = BETAFORDELING ## Returnerer den kumulative betafordelingsfunktion
+BETAINV = BETAINV ## Returnerer den inverse kumulative fordelingsfunktion for en angivet betafordeling
+BINOMDIST = BINOMIALFORDELING ## Returnerer punktsandsynligheden for binomialfordelingen
+CHIDIST = CHIFORDELING ## Returnerer fraktilsandsynligheden for en chi2-fordeling
+CHIINV = CHIINV ## Returnerer den inverse fraktilsandsynlighed for en chi2-fordeling
+CHITEST = CHITEST ## Foretager en test for uafhængighed
+CONFIDENCE = KONFIDENSINTERVAL ## Returnerer et konfidensinterval for en population
+CORREL = KORRELATION ## Returnerer korrelationskoefficienten mellem to datasæt
+COUNT = TÆL ## Tæller antallet af tal på en liste med argumenter
+COUNTA = TÆLV ## Tæller antallet af værdier på en liste med argumenter
+COUNTBLANK = ANTAL.BLANKE ## Tæller antallet af tomme celler i et område
+COUNTIF = TÆLHVIS ## Tæller antallet af celler, som opfylder de givne kriterier, i et område
+COUNTIFS = TÆL.HVISER ## Tæller antallet af de celler, som opfylder flere kriterier, i et område
+COVAR = KOVARIANS ## Beregner kovariansen mellem to stokastiske variabler
+CRITBINOM = KRITBINOM ## Returnerer den mindste værdi for x, for hvilken det gælder, at fordelingsfunktionen er mindre end eller lig med kriterieværdien.
+DEVSQ = SAK ## Returnerer summen af de kvadrerede afvigelser fra middelværdien
+EXPONDIST = EKSPFORDELING ## Returnerer eksponentialfordelingen
+FDIST = FFORDELING ## Returnerer fraktilsandsynligheden for F-fordelingen
+FINV = FINV ## Returnerer den inverse fraktilsandsynlighed for F-fordelingen
+FISHER = FISHER ## Returnerer Fisher-transformationen
+FISHERINV = FISHERINV ## Returnerer den inverse Fisher-transformation
+FORECAST = PROGNOSE ## Returnerer en prognoseværdi baseret på lineær tendens
+FREQUENCY = FREKVENS ## Returnerer en frekvensfordeling i en søjlevektor
+FTEST = FTEST ## Returnerer resultatet af en F-test til sammenligning af varians
+GAMMADIST = GAMMAFORDELING ## Returnerer fordelingsfunktionen for gammafordelingen
+GAMMAINV = GAMMAINV ## Returnerer den inverse fordelingsfunktion for gammafordelingen
+GAMMALN = GAMMALN ## Returnerer den naturlige logaritme til gammafordelingen, G(x)
+GEOMEAN = GEOMIDDELVÆRDI ## Returnerer det geometriske gennemsnit
+GROWTH = FORØGELSE ## Returnerer værdier langs en eksponentiel tendens
+HARMEAN = HARMIDDELVÆRDI ## Returnerer det harmoniske gennemsnit
+HYPGEOMDIST = HYPGEOFORDELING ## Returnerer punktsandsynligheden i en hypergeometrisk fordeling
+INTERCEPT = SKÆRING ## Returnerer afskæringsværdien på y-aksen i en lineær regression
+KURT = TOPSTEJL ## Returnerer kurtosisværdien for en stokastisk variabel
+LARGE = STOR ## Returnerer den k'te største værdi i et datasæt
+LINEST = LINREGR ## Returnerer parameterestimaterne for en lineær tendens
+LOGEST = LOGREGR ## Returnerer parameterestimaterne for en eksponentiel tendens
+LOGINV = LOGINV ## Returnerer den inverse fordelingsfunktion for lognormalfordelingen
+LOGNORMDIST = LOGNORMFORDELING ## Returnerer fordelingsfunktionen for lognormalfordelingen
+MAX = MAKS ## Returnerer den maksimale værdi på en liste med argumenter.
+MAXA = MAKSV ## Returnerer den maksimale værdi på en liste med argumenter og medtager tal, tekst og logiske værdier
+MEDIAN = MEDIAN ## Returnerer medianen for de angivne tal
+MIN = MIN ## Returnerer den mindste værdi på en liste med argumenter.
+MINA = MINV ## Returnerer den mindste værdi på en liste med argumenter og medtager tal, tekst og logiske værdier
+MODE = HYPPIGST ## Returnerer den hyppigste værdi i et datasæt
+NEGBINOMDIST = NEGBINOMFORDELING ## Returnerer den negative binomialfordeling
+NORMDIST = NORMFORDELING ## Returnerer fordelingsfunktionen for normalfordelingen
+NORMINV = NORMINV ## Returnerer den inverse fordelingsfunktion for normalfordelingen
+NORMSDIST = STANDARDNORMFORDELING ## Returnerer fordelingsfunktionen for standardnormalfordelingen
+NORMSINV = STANDARDNORMINV ## Returnerer den inverse fordelingsfunktion for standardnormalfordelingen
+PEARSON = PEARSON ## Returnerer Pearsons korrelationskoefficient
+PERCENTILE = FRAKTIL ## Returnerer den k'te fraktil for datasættet
+PERCENTRANK = PROCENTPLADS ## Returnerer den procentuelle rang for en given værdi i et datasæt
+PERMUT = PERMUT ## Returnerer antallet af permutationer for et givet sæt objekter
+POISSON = POISSON ## Returnerer fordelingsfunktionen for en Poisson-fordeling
+PROB = SANDSYNLIGHED ## Returnerer intervalsandsynligheden
+QUARTILE = KVARTIL ## Returnerer kvartilen i et givet datasæt
+RANK = PLADS ## Returnerer rangen for et tal på en liste med tal
+RSQ = FORKLARINGSGRAD ## Returnerer R2-værdien fra en simpel lineær regression
+SKEW = SKÆVHED ## Returnerer skævheden for en stokastisk variabel
+SLOPE = HÆLDNING ## Returnerer estimatet på hældningen fra en simpel lineær regression
+SMALL = MINDSTE ## Returnerer den k'te mindste værdi i datasættet
+STANDARDIZE = STANDARDISER ## Returnerer en standardiseret værdi
+STDEV = STDAFV ## Estimerer standardafvigelsen på basis af en stikprøve
+STDEVA = STDAFVV ## Beregner standardafvigelsen på basis af en prøve og medtager tal, tekst og logiske værdier
+STDEVP = STDAFVP ## Beregner standardafvigelsen på basis af en hel population
+STDEVPA = STDAFVPV ## Beregner standardafvigelsen på basis af en hel population og medtager tal, tekst og logiske værdier
+STEYX = STFYX ## Returnerer standardafvigelsen for de estimerede y-værdier i den simple lineære regression
+TDIST = TFORDELING ## Returnerer fordelingsfunktionen for Student's t-fordeling
+TINV = TINV ## Returnerer den inverse fordelingsfunktion for Student's t-fordeling
+TREND = TENDENS ## Returnerer værdi under antagelse af en lineær tendens
+TRIMMEAN = TRIMMIDDELVÆRDI ## Returnerer den trimmede middelværdi for datasættet
+TTEST = TTEST ## Returnerer den sandsynlighed, der er forbundet med Student's t-test
+VAR = VARIANS ## Beregner variansen på basis af en prøve
+VARA = VARIANSV ## Beregner variansen på basis af en prøve og medtager tal, tekst og logiske værdier
+VARP = VARIANSP ## Beregner variansen på basis af hele populationen
+VARPA = VARIANSPV ## Beregner variansen på basis af hele populationen og medtager tal, tekst og logiske værdier
+WEIBULL = WEIBULL ## Returnerer fordelingsfunktionen for Weibull-fordelingen
+ZTEST = ZTEST ## Returnerer sandsynlighedsværdien ved en en-sidet z-test
+
+
+##
+## Text functions Tekstfunktioner
+##
+ASC = ASC ## Ændrer engelske tegn i fuld bredde (dobbelt-byte) eller katakana i en tegnstreng til tegn i halv bredde (enkelt-byte)
+BAHTTEXT = BAHTTEKST ## Konverterer et tal til tekst ved hjælp af valutaformatet ß (baht)
+CHAR = TEGN ## Returnerer det tegn, der svarer til kodenummeret
+CLEAN = RENS ## Fjerner alle tegn, der ikke kan udskrives, fra tekst
+CODE = KODE ## Returnerer en numerisk kode for det første tegn i en tekststreng
+CONCATENATE = SAMMENKÆDNING ## Sammenkæder adskillige tekstelementer til ét tekstelement
+DOLLAR = KR ## Konverterer et tal til tekst ved hjælp af valutaformatet kr. (kroner)
+EXACT = EKSAKT ## Kontrollerer, om to tekstværdier er identiske
+FIND = FIND ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes mellem store og små bogstaver)
+FINDB = FINDB ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes mellem store og små bogstaver)
+FIXED = FAST ## Formaterer et tal som tekst med et fast antal decimaler
+JIS = JIS ## Ændrer engelske tegn i halv bredde (enkelt-byte) eller katakana i en tegnstreng til tegn i fuld bredde (dobbelt-byte)
+LEFT = VENSTRE ## Returnerer tegnet længst til venstre i en tekstværdi
+LEFTB = VENSTREB ## Returnerer tegnet længst til venstre i en tekstværdi
+LEN = LÆNGDE ## Returnerer antallet af tegn i en tekststreng
+LENB = LÆNGDEB ## Returnerer antallet af tegn i en tekststreng
+LOWER = SMÅ.BOGSTAVER ## Konverterer tekst til små bogstaver
+MID = MIDT ## Returnerer et bestemt antal tegn fra en tekststreng fra og med den angivne startposition
+MIDB = MIDTB ## Returnerer et bestemt antal tegn fra en tekststreng fra og med den angivne startposition
+PHONETIC = FONETISK ## Uddrager de fonetiske (furigana) tegn fra en tekststreng
+PROPER = STORT.FORBOGSTAV ## Konverterer første bogstav i hvert ord i teksten til stort bogstav
+REPLACE = ERSTAT ## Erstatter tegn i tekst
+REPLACEB = ERSTATB ## Erstatter tegn i tekst
+REPT = GENTAG ## Gentager tekst et givet antal gange
+RIGHT = HØJRE ## Returnerer tegnet længste til højre i en tekstværdi
+RIGHTB = HØJREB ## Returnerer tegnet længste til højre i en tekstværdi
+SEARCH = SØG ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes ikke mellem store og små bogstaver)
+SEARCHB = SØGB ## Søger efter en tekstværdi i en anden tekstværdi (der skelnes ikke mellem store og små bogstaver)
+SUBSTITUTE = UDSKIFT ## Udskifter gammel tekst med ny tekst i en tekststreng
+T = T ## Konverterer argumenterne til tekst
+TEXT = TEKST ## Formaterer et tal og konverterer det til tekst
+TRIM = FJERN.OVERFLØDIGE.BLANKE ## Fjerner mellemrum fra tekst
+UPPER = STORE.BOGSTAVER ## Konverterer tekst til store bogstaver
+VALUE = VÆRDI ## Konverterer et tekstargument til et tal
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/de/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/de/config
new file mode 100644
index 00000000000..9751c4b6b41
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/de/config
@@ -0,0 +1,24 @@
+##
+## PhpSpreadsheet
+##
+
+ArgumentSeparator = ;
+
+
+##
+## (For future use)
+##
+currencySymbol = €
+
+
+##
+## Excel Error Codes (For future use)
+
+##
+NULL = #NULL!
+DIV0 = #DIV/0!
+VALUE = #WERT!
+REF = #BEZUG!
+NAME = #NAME?
+NUM = #ZAHL!
+NA = #NV
diff --git a/lib/phpexcel/PHPExcel/locale/de/functions b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/de/functions
similarity index 95%
rename from lib/phpexcel/PHPExcel/locale/de/functions
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/de/functions
index 3147f9c8be7..01df42f6412 100644
--- a/lib/phpexcel/PHPExcel/locale/de/functions
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/de/functions
@@ -1,438 +1,416 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Calculation
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/
-##
-##
-
-
-##
-## Add-in and Automation functions Add-In- und Automatisierungsfunktionen
-##
-GETPIVOTDATA = PIVOTDATENZUORDNEN ## In einem PivotTable-Bericht gespeicherte Daten werden zurückgegeben.
-
-
-##
-## Cube functions Cubefunktionen
-##
-CUBEKPIMEMBER = CUBEKPIELEMENT ## Gibt Name, Eigenschaft und Measure eines Key Performance Indicators (KPI) zurück und zeigt den Namen und die Eigenschaft in der Zelle an. Ein KPI ist ein quantifizierbares Maß, wie z. B. der monatliche Bruttogewinn oder die vierteljährliche Mitarbeiterfluktuation, mit dessen Hilfe das Leistungsverhalten eines Unternehmens überwacht werden kann.
-CUBEMEMBER = CUBEELEMENT ## Gibt ein Element oder ein Tuple in einer Cubehierarchie zurück. Wird verwendet, um zu überprüfen, ob das Element oder Tuple im Cube vorhanden ist.
-CUBEMEMBERPROPERTY = CUBEELEMENTEIGENSCHAFT ## Gibt den Wert einer Elementeigenschaft im Cube zurück. Wird verwendet, um zu überprüfen, ob ein Elementname im Cube vorhanden ist, und um die für dieses Element angegebene Eigenschaft zurückzugeben.
-CUBERANKEDMEMBER = CUBERANGELEMENT ## Gibt das n-te oder n-rangige Element in einer Menge zurück. Wird verwendet, um mindestens ein Element in einer Menge zurückzugeben, wie z. B. bester Vertriebsmitarbeiter oder 10 beste Kursteilnehmer.
-CUBESET = CUBEMENGE ## Definiert eine berechnete Menge Elemente oder Tuples durch Senden eines Mengenausdrucks an den Cube auf dem Server, der die Menge erstellt und an Microsoft Office Excel zurückgibt.
-CUBESETCOUNT = CUBEMENGENANZAHL ## Gibt die Anzahl der Elemente in einer Menge zurück.
-CUBEVALUE = CUBEWERT ## Gibt einen Aggregatwert aus einem Cube zurück.
-
-
-##
-## Database functions Datenbankfunktionen
-##
-DAVERAGE = DBMITTELWERT ## Gibt den Mittelwert der ausgewählten Datenbankeinträge zurück
-DCOUNT = DBANZAHL ## Zählt die Zellen mit Zahlen in einer Datenbank
-DCOUNTA = DBANZAHL2 ## Zählt nicht leere Zellen in einer Datenbank
-DGET = DBAUSZUG ## Extrahiert aus einer Datenbank einen einzelnen Datensatz, der den angegebenen Kriterien entspricht
-DMAX = DBMAX ## Gibt den größten Wert aus ausgewählten Datenbankeinträgen zurück
-DMIN = DBMIN ## Gibt den kleinsten Wert aus ausgewählten Datenbankeinträgen zurück
-DPRODUCT = DBPRODUKT ## Multipliziert die Werte in einem bestimmten Feld mit Datensätzen, die den Kriterien in einer Datenbank entsprechen
-DSTDEV = DBSTDABW ## Schätzt die Standardabweichung auf der Grundlage einer Stichprobe aus ausgewählten Datenbankeinträgen
-DSTDEVP = DBSTDABWN ## Berechnet die Standardabweichung auf der Grundlage der Grundgesamtheit ausgewählter Datenbankeinträge
-DSUM = DBSUMME ## Addiert die Zahlen in der Feldspalte mit Datensätzen in der Datenbank, die den Kriterien entsprechen
-DVAR = DBVARIANZ ## Schätzt die Varianz auf der Grundlage ausgewählter Datenbankeinträge
-DVARP = DBVARIANZEN ## Berechnet die Varianz auf der Grundlage der Grundgesamtheit ausgewählter Datenbankeinträge
-
-
-##
-## Date and time functions Datums- und Zeitfunktionen
-##
-DATE = DATUM ## Gibt die fortlaufende Zahl eines bestimmten Datums zurück
-DATEVALUE = DATWERT ## Wandelt ein Datum in Form von Text in eine fortlaufende Zahl um
-DAY = TAG ## Wandelt eine fortlaufende Zahl in den Tag des Monats um
-DAYS360 = TAGE360 ## Berechnet die Anzahl der Tage zwischen zwei Datumsangaben ausgehend von einem Jahr, das 360 Tage hat
-EDATE = EDATUM ## Gibt die fortlaufende Zahl des Datums zurück, bei dem es sich um die angegebene Anzahl von Monaten vor oder nach dem Anfangstermin handelt
-EOMONTH = MONATSENDE ## Gibt die fortlaufende Zahl des letzten Tags des Monats vor oder nach einer festgelegten Anzahl von Monaten zurück
-HOUR = STUNDE ## Wandelt eine fortlaufende Zahl in eine Stunde um
-MINUTE = MINUTE ## Wandelt eine fortlaufende Zahl in eine Minute um
-MONTH = MONAT ## Wandelt eine fortlaufende Zahl in einen Monat um
-NETWORKDAYS = NETTOARBEITSTAGE ## Gibt die Anzahl von ganzen Arbeitstagen zwischen zwei Datumswerten zurück
-NOW = JETZT ## Gibt die fortlaufende Zahl des aktuellen Datums und der aktuellen Uhrzeit zurück
-SECOND = SEKUNDE ## Wandelt eine fortlaufende Zahl in eine Sekunde um
-TIME = ZEIT ## Gibt die fortlaufende Zahl einer bestimmten Uhrzeit zurück
-TIMEVALUE = ZEITWERT ## Wandelt eine Uhrzeit in Form von Text in eine fortlaufende Zahl um
-TODAY = HEUTE ## Gibt die fortlaufende Zahl des heutigen Datums zurück
-WEEKDAY = WOCHENTAG ## Wandelt eine fortlaufende Zahl in den Wochentag um
-WEEKNUM = KALENDERWOCHE ## Wandelt eine fortlaufende Zahl in eine Zahl um, die angibt, in welche Woche eines Jahres das angegebene Datum fällt
-WORKDAY = ARBEITSTAG ## Gibt die fortlaufende Zahl des Datums vor oder nach einer bestimmten Anzahl von Arbeitstagen zurück
-YEAR = JAHR ## Wandelt eine fortlaufende Zahl in ein Jahr um
-YEARFRAC = BRTEILJAHRE ## Gibt die Anzahl der ganzen Tage zwischen Ausgangsdatum und Enddatum in Bruchteilen von Jahren zurück
-
-
-##
-## Engineering functions Konstruktionsfunktionen
-##
-BESSELI = BESSELI ## Gibt die geänderte Besselfunktion In(x) zurück
-BESSELJ = BESSELJ ## Gibt die Besselfunktion Jn(x) zurück
-BESSELK = BESSELK ## Gibt die geänderte Besselfunktion Kn(x) zurück
-BESSELY = BESSELY ## Gibt die Besselfunktion Yn(x) zurück
-BIN2DEC = BININDEZ ## Wandelt eine binäre Zahl (Dualzahl) in eine dezimale Zahl um
-BIN2HEX = BININHEX ## Wandelt eine binäre Zahl (Dualzahl) in eine hexadezimale Zahl um
-BIN2OCT = BININOKT ## Wandelt eine binäre Zahl (Dualzahl) in eine oktale Zahl um
-COMPLEX = KOMPLEXE ## Wandelt den Real- und Imaginärteil in eine komplexe Zahl um
-CONVERT = UMWANDELN ## Wandelt eine Zahl von einem Maßsystem in ein anderes um
-DEC2BIN = DEZINBIN ## Wandelt eine dezimale Zahl in eine binäre Zahl (Dualzahl) um
-DEC2HEX = DEZINHEX ## Wandelt eine dezimale Zahl in eine hexadezimale Zahl um
-DEC2OCT = DEZINOKT ## Wandelt eine dezimale Zahl in eine oktale Zahl um
-DELTA = DELTA ## Überprüft, ob zwei Werte gleich sind
-ERF = GAUSSFEHLER ## Gibt die Gauss'sche Fehlerfunktion zurück
-ERFC = GAUSSFKOMPL ## Gibt das Komplement zur Gauss'schen Fehlerfunktion zurück
-GESTEP = GGANZZAHL ## Überprüft, ob eine Zahl größer als ein gegebener Schwellenwert ist
-HEX2BIN = HEXINBIN ## Wandelt eine hexadezimale Zahl in eine Binärzahl um
-HEX2DEC = HEXINDEZ ## Wandelt eine hexadezimale Zahl in eine dezimale Zahl um
-HEX2OCT = HEXINOKT ## Wandelt eine hexadezimale Zahl in eine Oktalzahl um
-IMABS = IMABS ## Gibt den Absolutbetrag (Modulo) einer komplexen Zahl zurück
-IMAGINARY = IMAGINÄRTEIL ## Gibt den Imaginärteil einer komplexen Zahl zurück
-IMARGUMENT = IMARGUMENT ## Gibt das Argument Theta zurück, einen Winkel, der als Bogenmaß ausgedrückt wird
-IMCONJUGATE = IMKONJUGIERTE ## Gibt die konjugierte komplexe Zahl zu einer komplexen Zahl zurück
-IMCOS = IMCOS ## Gibt den Kosinus einer komplexen Zahl zurück
-IMDIV = IMDIV ## Gibt den Quotienten zweier komplexer Zahlen zurück
-IMEXP = IMEXP ## Gibt die algebraische Form einer in exponentieller Schreibweise vorliegenden komplexen Zahl zurück
-IMLN = IMLN ## Gibt den natürlichen Logarithmus einer komplexen Zahl zurück
-IMLOG10 = IMLOG10 ## Gibt den Logarithmus einer komplexen Zahl zur Basis 10 zurück
-IMLOG2 = IMLOG2 ## Gibt den Logarithmus einer komplexen Zahl zur Basis 2 zurück
-IMPOWER = IMAPOTENZ ## Potenziert eine komplexe Zahl mit einer ganzen Zahl
-IMPRODUCT = IMPRODUKT ## Gibt das Produkt von komplexen Zahlen zurück
-IMREAL = IMREALTEIL ## Gibt den Realteil einer komplexen Zahl zurück
-IMSIN = IMSIN ## Gibt den Sinus einer komplexen Zahl zurück
-IMSQRT = IMWURZEL ## Gibt die Quadratwurzel einer komplexen Zahl zurück
-IMSUB = IMSUB ## Gibt die Differenz zwischen zwei komplexen Zahlen zurück
-IMSUM = IMSUMME ## Gibt die Summe von komplexen Zahlen zurück
-OCT2BIN = OKTINBIN ## Wandelt eine oktale Zahl in eine binäre Zahl (Dualzahl) um
-OCT2DEC = OKTINDEZ ## Wandelt eine oktale Zahl in eine dezimale Zahl um
-OCT2HEX = OKTINHEX ## Wandelt eine oktale Zahl in eine hexadezimale Zahl um
-
-
-##
-## Financial functions Finanzmathematische Funktionen
-##
-ACCRINT = AUFGELZINS ## Gibt die aufgelaufenen Zinsen (Stückzinsen) eines Wertpapiers mit periodischen Zinszahlungen zurück
-ACCRINTM = AUFGELZINSF ## Gibt die aufgelaufenen Zinsen (Stückzinsen) eines Wertpapiers zurück, die bei Fälligkeit ausgezahlt werden
-AMORDEGRC = AMORDEGRK ## Gibt die Abschreibung für die einzelnen Abschreibungszeiträume mithilfe eines Abschreibungskoeffizienten zurück
-AMORLINC = AMORLINEARK ## Gibt die Abschreibung für die einzelnen Abschreibungszeiträume zurück
-COUPDAYBS = ZINSTERMTAGVA ## Gibt die Anzahl der Tage vom Anfang des Zinstermins bis zum Abrechnungstermin zurück
-COUPDAYS = ZINSTERMTAGE ## Gibt die Anzahl der Tage der Zinsperiode zurück, die den Abrechnungstermin einschließt
-COUPDAYSNC = ZINSTERMTAGNZ ## Gibt die Anzahl der Tage vom Abrechnungstermin bis zum nächsten Zinstermin zurück
-COUPNCD = ZINSTERMNZ ## Gibt das Datum des ersten Zinstermins nach dem Abrechnungstermin zurück
-COUPNUM = ZINSTERMZAHL ## Gibt die Anzahl der Zinstermine zwischen Abrechnungs- und Fälligkeitsdatum zurück
-COUPPCD = ZINSTERMVZ ## Gibt das Datum des letzten Zinstermins vor dem Abrechnungstermin zurück
-CUMIPMT = KUMZINSZ ## Berechnet die kumulierten Zinsen, die zwischen zwei Perioden zu zahlen sind
-CUMPRINC = KUMKAPITAL ## Berechnet die aufgelaufene Tilgung eines Darlehens, die zwischen zwei Perioden zu zahlen ist
-DB = GDA2 ## Gibt die geometrisch-degressive Abschreibung eines Wirtschaftsguts für eine bestimmte Periode zurück
-DDB = GDA ## Gibt die Abschreibung eines Anlageguts für einen angegebenen Zeitraum unter Verwendung der degressiven Doppelraten-Abschreibung oder eines anderen von Ihnen angegebenen Abschreibungsverfahrens zurück
-DISC = DISAGIO ## Gibt den in Prozent ausgedrückten Abzinsungssatz eines Wertpapiers zurück
-DOLLARDE = NOTIERUNGDEZ ## Wandelt eine Notierung, die als Dezimalbruch ausgedrückt wurde, in eine Dezimalzahl um
-DOLLARFR = NOTIERUNGBRU ## Wandelt eine Notierung, die als Dezimalzahl ausgedrückt wurde, in einen Dezimalbruch um
-DURATION = DURATION ## Gibt die jährliche Duration eines Wertpapiers mit periodischen Zinszahlungen zurück
-EFFECT = EFFEKTIV ## Gibt die jährliche Effektivverzinsung zurück
-FV = ZW ## Gibt den zukünftigen Wert (Endwert) einer Investition zurück
-FVSCHEDULE = ZW2 ## Gibt den aufgezinsten Wert des Anfangskapitals für eine Reihe periodisch unterschiedlicher Zinssätze zurück
-INTRATE = ZINSSATZ ## Gibt den Zinssatz eines voll investierten Wertpapiers zurück
-IPMT = ZINSZ ## Gibt die Zinszahlung einer Investition für die angegebene Periode zurück
-IRR = IKV ## Gibt den internen Zinsfuß einer Investition ohne Finanzierungskosten oder Reinvestitionsgewinne zurück
-ISPMT = ISPMT ## Berechnet die während eines bestimmten Zeitraums für eine Investition gezahlten Zinsen
-MDURATION = MDURATION ## Gibt die geänderte Dauer für ein Wertpapier mit einem angenommenen Nennwert von 100 € zurück
-MIRR = QIKV ## Gibt den internen Zinsfuß zurück, wobei positive und negative Zahlungen zu unterschiedlichen Sätzen finanziert werden
-NOMINAL = NOMINAL ## Gibt die jährliche Nominalverzinsung zurück
-NPER = ZZR ## Gibt die Anzahl der Zahlungsperioden einer Investition zurück
-NPV = NBW ## Gibt den Nettobarwert einer Investition auf Basis periodisch anfallender Zahlungen und eines Abzinsungsfaktors zurück
-ODDFPRICE = UNREGER.KURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers mit einem unregelmäßigen ersten Zinstermin zurück
-ODDFYIELD = UNREGER.REND ## Gibt die Rendite eines Wertpapiers mit einem unregelmäßigen ersten Zinstermin zurück
-ODDLPRICE = UNREGLE.KURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers mit einem unregelmäßigen letzten Zinstermin zurück
-ODDLYIELD = UNREGLE.REND ## Gibt die Rendite eines Wertpapiers mit einem unregelmäßigen letzten Zinstermin zurück
-PMT = RMZ ## Gibt die periodische Zahlung für eine Annuität zurück
-PPMT = KAPZ ## Gibt die Kapitalrückzahlung einer Investition für eine angegebene Periode zurück
-PRICE = KURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers zurück, das periodisch Zinsen auszahlt
-PRICEDISC = KURSDISAGIO ## Gibt den Kurs pro 100 € Nennwert eines unverzinslichen Wertpapiers zurück
-PRICEMAT = KURSFÄLLIG ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers zurück, das Zinsen am Fälligkeitsdatum auszahlt
-PV = BW ## Gibt den Barwert einer Investition zurück
-RATE = ZINS ## Gibt den Zinssatz pro Zeitraum einer Annuität zurück
-RECEIVED = AUSZAHLUNG ## Gibt den Auszahlungsbetrag eines voll investierten Wertpapiers am Fälligkeitstermin zurück
-SLN = LIA ## Gibt die lineare Abschreibung eines Wirtschaftsguts pro Periode zurück
-SYD = DIA ## Gibt die arithmetisch-degressive Abschreibung eines Wirtschaftsguts für eine bestimmte Periode zurück
-TBILLEQ = TBILLÄQUIV ## Gibt die Rendite für ein Wertpapier zurück
-TBILLPRICE = TBILLKURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers zurück
-TBILLYIELD = TBILLRENDITE ## Gibt die Rendite für ein Wertpapier zurück
-VDB = VDB ## Gibt die degressive Abschreibung eines Wirtschaftsguts für eine bestimmte Periode oder Teilperiode zurück
-XIRR = XINTZINSFUSS ## Gibt den internen Zinsfuß einer Reihe nicht periodisch anfallender Zahlungen zurück
-XNPV = XKAPITALWERT ## Gibt den Nettobarwert (Kapitalwert) einer Reihe nicht periodisch anfallender Zahlungen zurück
-YIELD = RENDITE ## Gibt die Rendite eines Wertpapiers zurück, das periodisch Zinsen auszahlt
-YIELDDISC = RENDITEDIS ## Gibt die jährliche Rendite eines unverzinslichen Wertpapiers zurück
-YIELDMAT = RENDITEFÄLL ## Gibt die jährliche Rendite eines Wertpapiers zurück, das Zinsen am Fälligkeitsdatum auszahlt
-
-
-##
-## Information functions Informationsfunktionen
-##
-CELL = ZELLE ## Gibt Informationen zu Formatierung, Position oder Inhalt einer Zelle zurück
-ERROR.TYPE = FEHLER.TYP ## Gibt eine Zahl zurück, die einem Fehlertyp entspricht
-INFO = INFO ## Gibt Informationen zur aktuellen Betriebssystemumgebung zurück
-ISBLANK = ISTLEER ## Gibt WAHR zurück, wenn der Wert leer ist
-ISERR = ISTFEHL ## Gibt WAHR zurück, wenn der Wert ein beliebiger Fehlerwert außer #N/V ist
-ISERROR = ISTFEHLER ## Gibt WAHR zurück, wenn der Wert ein beliebiger Fehlerwert ist
-ISEVEN = ISTGERADE ## Gibt WAHR zurück, wenn es sich um eine gerade Zahl handelt
-ISLOGICAL = ISTLOG ## Gibt WAHR zurück, wenn der Wert ein Wahrheitswert ist
-ISNA = ISTNV ## Gibt WAHR zurück, wenn der Wert der Fehlerwert #N/V ist
-ISNONTEXT = ISTKTEXT ## Gibt WAHR zurück, wenn der Wert ein Element ist, das keinen Text enthält
-ISNUMBER = ISTZAHL ## Gibt WAHR zurück, wenn der Wert eine Zahl ist
-ISODD = ISTUNGERADE ## Gibt WAHR zurück, wenn es sich um eine ungerade Zahl handelt
-ISREF = ISTBEZUG ## Gibt WAHR zurück, wenn der Wert ein Bezug ist
-ISTEXT = ISTTEXT ## Gibt WAHR zurück, wenn der Wert ein Element ist, das Text enthält
-N = N ## Gibt den in eine Zahl umgewandelten Wert zurück
-NA = NV ## Gibt den Fehlerwert #NV zurück
-TYPE = TYP ## Gibt eine Zahl zurück, die den Datentyp des angegebenen Werts anzeigt
-
-
-##
-## Logical functions Logische Funktionen
-##
-AND = UND ## Gibt WAHR zurück, wenn alle zugehörigen Argumente WAHR sind
-FALSE = FALSCH ## Gibt den Wahrheitswert FALSCH zurück
-IF = WENN ## Gibt einen logischen Test zum Ausführen an
-IFERROR = WENNFEHLER ## Gibt einen von Ihnen festgelegten Wert zurück, wenn die Auswertung der Formel zu einem Fehler führt; andernfalls wird das Ergebnis der Formel zurückgegeben
-NOT = NICHT ## Kehrt den Wahrheitswert der zugehörigen Argumente um
-OR = ODER ## Gibt WAHR zurück, wenn ein Argument WAHR ist
-TRUE = WAHR ## Gibt den Wahrheitswert WAHR zurück
-
-
-##
-## Lookup and reference functions Nachschlage- und Verweisfunktionen
-##
-ADDRESS = ADRESSE ## Gibt einen Bezug auf eine einzelne Zelle in einem Tabellenblatt als Text zurück
-AREAS = BEREICHE ## Gibt die Anzahl der innerhalb eines Bezugs aufgeführten Bereiche zurück
-CHOOSE = WAHL ## Wählt einen Wert aus eine Liste mit Werten aus
-COLUMN = SPALTE ## Gibt die Spaltennummer eines Bezugs zurück
-COLUMNS = SPALTEN ## Gibt die Anzahl der Spalten in einem Bezug zurück
-HLOOKUP = HVERWEIS ## Sucht in der obersten Zeile einer Matrix und gibt den Wert der angegebenen Zelle zurück
-HYPERLINK = HYPERLINK ## Erstellt eine Verknüpfung, über die ein auf einem Netzwerkserver, in einem Intranet oder im Internet gespeichertes Dokument geöffnet wird
-INDEX = INDEX ## Verwendet einen Index, um einen Wert aus einem Bezug oder einer Matrix auszuwählen
-INDIRECT = INDIREKT ## Gibt einen Bezug zurück, der von einem Textwert angegeben wird
-LOOKUP = LOOKUP ## Sucht Werte in einem Vektor oder einer Matrix
-MATCH = VERGLEICH ## Sucht Werte in einem Bezug oder einer Matrix
-OFFSET = BEREICH.VERSCHIEBEN ## Gibt einen Bezugoffset aus einem gegebenen Bezug zurück
-ROW = ZEILE ## Gibt die Zeilennummer eines Bezugs zurück
-ROWS = ZEILEN ## Gibt die Anzahl der Zeilen in einem Bezug zurück
-RTD = RTD ## Ruft Echtzeitdaten von einem Programm ab, das die COM-Automatisierung (Automatisierung: Ein Verfahren, bei dem aus einer Anwendung oder einem Entwicklungstool heraus mit den Objekten einer anderen Anwendung gearbeitet wird. Die früher als OLE-Automatisierung bezeichnete Automatisierung ist ein Industriestandard und eine Funktion von COM (Component Object Model).) unterstützt
-TRANSPOSE = MTRANS ## Gibt die transponierte Matrix einer Matrix zurück
-VLOOKUP = SVERWEIS ## Sucht in der ersten Spalte einer Matrix und arbeitet sich durch die Zeile, um den Wert einer Zelle zurückzugeben
-
-
-##
-## Math and trigonometry functions Mathematische und trigonometrische Funktionen
-##
-ABS = ABS ## Gibt den Absolutwert einer Zahl zurück
-ACOS = ARCCOS ## Gibt den Arkuskosinus einer Zahl zurück
-ACOSH = ARCCOSHYP ## Gibt den umgekehrten hyperbolischen Kosinus einer Zahl zurück
-ASIN = ARCSIN ## Gibt den Arkussinus einer Zahl zurück
-ASINH = ARCSINHYP ## Gibt den umgekehrten hyperbolischen Sinus einer Zahl zurück
-ATAN = ARCTAN ## Gibt den Arkustangens einer Zahl zurück
-ATAN2 = ARCTAN2 ## Gibt den Arkustangens einer x- und einer y-Koordinate zurück
-ATANH = ARCTANHYP ## Gibt den umgekehrten hyperbolischen Tangens einer Zahl zurück
-CEILING = OBERGRENZE ## Rundet eine Zahl auf die nächste ganze Zahl oder das nächste Vielfache von Schritt
-COMBIN = KOMBINATIONEN ## Gibt die Anzahl der Kombinationen für eine bestimmte Anzahl von Objekten zurück
-COS = COS ## Gibt den Kosinus einer Zahl zurück
-COSH = COSHYP ## Gibt den hyperbolischen Kosinus einer Zahl zurück
-DEGREES = GRAD ## Wandelt Bogenmaß (Radiant) in Grad um
-EVEN = GERADE ## Rundet eine Zahl auf die nächste gerade ganze Zahl auf
-EXP = EXP ## Potenziert die Basis e mit der als Argument angegebenen Zahl
-FACT = FAKULTÄT ## Gibt die Fakultät einer Zahl zurück
-FACTDOUBLE = ZWEIFAKULTÄT ## Gibt die Fakultät zu Zahl mit Schrittlänge 2 zurück
-FLOOR = UNTERGRENZE ## Rundet die Zahl auf Anzahl_Stellen ab
-GCD = GGT ## Gibt den größten gemeinsamen Teiler zurück
-INT = GANZZAHL ## Rundet eine Zahl auf die nächstkleinere ganze Zahl ab
-LCM = KGV ## Gibt das kleinste gemeinsame Vielfache zurück
-LN = LN ## Gibt den natürlichen Logarithmus einer Zahl zurück
-LOG = LOG ## Gibt den Logarithmus einer Zahl zu der angegebenen Basis zurück
-LOG10 = LOG10 ## Gibt den Logarithmus einer Zahl zur Basis 10 zurück
-MDETERM = MDET ## Gibt die Determinante einer Matrix zurück
-MINVERSE = MINV ## Gibt die inverse Matrix einer Matrix zurück
-MMULT = MMULT ## Gibt das Produkt zweier Matrizen zurück
-MOD = REST ## Gibt den Rest einer Division zurück
-MROUND = VRUNDEN ## Gibt eine auf das gewünschte Vielfache gerundete Zahl zurück
-MULTINOMIAL = POLYNOMIAL ## Gibt den Polynomialkoeffizienten einer Gruppe von Zahlen zurück
-ODD = UNGERADE ## Rundet eine Zahl auf die nächste ungerade ganze Zahl auf
-PI = PI ## Gibt den Wert Pi zurück
-POWER = POTENZ ## Gibt als Ergebnis eine potenzierte Zahl zurück
-PRODUCT = PRODUKT ## Multipliziert die zugehörigen Argumente
-QUOTIENT = QUOTIENT ## Gibt den ganzzahligen Anteil einer Division zurück
-RADIANS = BOGENMASS ## Wandelt Grad in Bogenmaß (Radiant) um
-RAND = ZUFALLSZAHL ## Gibt eine Zufallszahl zwischen 0 und 1 zurück
-RANDBETWEEN = ZUFALLSBEREICH ## Gibt eine Zufallszahl aus dem festgelegten Bereich zurück
-ROMAN = RÖMISCH ## Wandelt eine arabische Zahl in eine römische Zahl als Text um
-ROUND = RUNDEN ## Rundet eine Zahl auf eine bestimmte Anzahl von Dezimalstellen
-ROUNDDOWN = ABRUNDEN ## Rundet die Zahl auf Anzahl_Stellen ab
-ROUNDUP = AUFRUNDEN ## Rundet die Zahl auf Anzahl_Stellen auf
-SERIESSUM = POTENZREIHE ## Gibt die Summe von Potenzen (zur Berechnung von Potenzreihen und dichotomen Wahrscheinlichkeiten) zurück
-SIGN = VORZEICHEN ## Gibt das Vorzeichen einer Zahl zurück
-SIN = SIN ## Gibt den Sinus einer Zahl zurück
-SINH = SINHYP ## Gibt den hyperbolischen Sinus einer Zahl zurück
-SQRT = WURZEL ## Gibt die Quadratwurzel einer Zahl zurück
-SQRTPI = WURZELPI ## Gibt die Wurzel aus der mit Pi (pi) multiplizierten Zahl zurück
-SUBTOTAL = TEILERGEBNIS ## Gibt ein Teilergebnis in einer Liste oder Datenbank zurück
-SUM = SUMME ## Addiert die zugehörigen Argumente
-SUMIF = SUMMEWENN ## Addiert Zahlen, die mit den Suchkriterien übereinstimmen
-SUMIFS = SUMMEWENNS ## Die Zellen, die mehrere Kriterien erfüllen, werden in einem Bereich hinzugefügt
-SUMPRODUCT = SUMMENPRODUKT ## Gibt die Summe der Produkte zusammengehöriger Matrixkomponenten zurück
-SUMSQ = QUADRATESUMME ## Gibt die Summe der quadrierten Argumente zurück
-SUMX2MY2 = SUMMEX2MY2 ## Gibt die Summe der Differenzen der Quadrate für zusammengehörige Komponenten zweier Matrizen zurück
-SUMX2PY2 = SUMMEX2PY2 ## Gibt die Summe der Quadrate für zusammengehörige Komponenten zweier Matrizen zurück
-SUMXMY2 = SUMMEXMY2 ## Gibt die Summe der quadrierten Differenzen für zusammengehörige Komponenten zweier Matrizen zurück
-TAN = TAN ## Gibt den Tangens einer Zahl zurück
-TANH = TANHYP ## Gibt den hyperbolischen Tangens einer Zahl zurück
-TRUNC = KÜRZEN ## Schneidet die Kommastellen einer Zahl ab und gibt als Ergebnis eine ganze Zahl zurück
-
-
-##
-## Statistical functions Statistische Funktionen
-##
-AVEDEV = MITTELABW ## Gibt die durchschnittliche absolute Abweichung einer Reihe von Merkmalsausprägungen und ihrem Mittelwert zurück
-AVERAGE = MITTELWERT ## Gibt den Mittelwert der zugehörigen Argumente zurück
-AVERAGEA = MITTELWERTA ## Gibt den Mittelwert der zugehörigen Argumente, die Zahlen, Text und Wahrheitswerte enthalten, zurück
-AVERAGEIF = MITTELWERTWENN ## Der Durchschnittswert (arithmetisches Mittel) für alle Zellen in einem Bereich, die einem angegebenen Kriterium entsprechen, wird zurückgegeben
-AVERAGEIFS = MITTELWERTWENNS ## Gibt den Durchschnittswert (arithmetisches Mittel) aller Zellen zurück, die mehreren Kriterien entsprechen
-BETADIST = BETAVERT ## Gibt die Werte der kumulierten Betaverteilungsfunktion zurück
-BETAINV = BETAINV ## Gibt das Quantil der angegebenen Betaverteilung zurück
-BINOMDIST = BINOMVERT ## Gibt Wahrscheinlichkeiten einer binomialverteilten Zufallsvariablen zurück
-CHIDIST = CHIVERT ## Gibt Werte der Verteilungsfunktion (1-Alpha) einer Chi-Quadrat-verteilten Zufallsgröße zurück
-CHIINV = CHIINV ## Gibt Quantile der Verteilungsfunktion (1-Alpha) der Chi-Quadrat-Verteilung zurück
-CHITEST = CHITEST ## Gibt die Teststatistik eines Unabhängigkeitstests zurück
-CONFIDENCE = KONFIDENZ ## Ermöglicht die Berechnung des 1-Alpha Konfidenzintervalls für den Erwartungswert einer Zufallsvariablen
-CORREL = KORREL ## Gibt den Korrelationskoeffizienten zweier Reihen von Merkmalsausprägungen zurück
-COUNT = ANZAHL ## Gibt die Anzahl der Zahlen in der Liste mit Argumenten an
-COUNTA = ANZAHL2 ## Gibt die Anzahl der Werte in der Liste mit Argumenten an
-COUNTBLANK = ANZAHLLEEREZELLEN ## Gibt die Anzahl der leeren Zellen in einem Bereich an
-COUNTIF = ZÄHLENWENN ## Gibt die Anzahl der Zellen in einem Bereich an, deren Inhalte mit den Suchkriterien übereinstimmen
-COUNTIFS = ZÄHLENWENNS ## Gibt die Anzahl der Zellen in einem Bereich an, deren Inhalte mit mehreren Suchkriterien übereinstimmen
-COVAR = KOVAR ## Gibt die Kovarianz zurück, den Mittelwert der für alle Datenpunktpaare gebildeten Produkte der Abweichungen
-CRITBINOM = KRITBINOM ## Gibt den kleinsten Wert zurück, für den die kumulierten Wahrscheinlichkeiten der Binomialverteilung kleiner oder gleich einer Grenzwahrscheinlichkeit sind
-DEVSQ = SUMQUADABW ## Gibt die Summe der quadrierten Abweichungen der Datenpunkte von ihrem Stichprobenmittelwert zurück
-EXPONDIST = EXPONVERT ## Gibt Wahrscheinlichkeiten einer exponential verteilten Zufallsvariablen zurück
-FDIST = FVERT ## Gibt Werte der Verteilungsfunktion (1-Alpha) einer F-verteilten Zufallsvariablen zurück
-FINV = FINV ## Gibt Quantile der F-Verteilung zurück
-FISHER = FISHER ## Gibt die Fisher-Transformation zurück
-FISHERINV = FISHERINV ## Gibt die Umkehrung der Fisher-Transformation zurück
-FORECAST = PROGNOSE ## Gibt einen Wert zurück, der sich aus einem linearen Trend ergibt
-FREQUENCY = HÄUFIGKEIT ## Gibt eine Häufigkeitsverteilung als vertikale Matrix zurück
-FTEST = FTEST ## Gibt die Teststatistik eines F-Tests zurück
-GAMMADIST = GAMMAVERT ## Gibt Wahrscheinlichkeiten einer gammaverteilten Zufallsvariablen zurück
-GAMMAINV = GAMMAINV ## Gibt Quantile der Gammaverteilung zurück
-GAMMALN = GAMMALN ## Gibt den natürlichen Logarithmus der Gammafunktion zurück, Γ(x)
-GEOMEAN = GEOMITTEL ## Gibt das geometrische Mittel zurück
-GROWTH = VARIATION ## Gibt Werte zurück, die sich aus einem exponentiellen Trend ergeben
-HARMEAN = HARMITTEL ## Gibt das harmonische Mittel zurück
-HYPGEOMDIST = HYPGEOMVERT ## Gibt Wahrscheinlichkeiten einer hypergeometrisch-verteilten Zufallsvariablen zurück
-INTERCEPT = ACHSENABSCHNITT ## Gibt den Schnittpunkt der Regressionsgeraden zurück
-KURT = KURT ## Gibt die Kurtosis (Exzess) einer Datengruppe zurück
-LARGE = KGRÖSSTE ## Gibt den k-größten Wert einer Datengruppe zurück
-LINEST = RGP ## Gibt die Parameter eines linearen Trends zurück
-LOGEST = RKP ## Gibt die Parameter eines exponentiellen Trends zurück
-LOGINV = LOGINV ## Gibt Quantile der Lognormalverteilung zurück
-LOGNORMDIST = LOGNORMVERT ## Gibt Werte der Verteilungsfunktion einer lognormalverteilten Zufallsvariablen zurück
-MAX = MAX ## Gibt den Maximalwert einer Liste mit Argumenten zurück
-MAXA = MAXA ## Gibt den Maximalwert einer Liste mit Argumenten zurück, die Zahlen, Text und Wahrheitswerte enthalten
-MEDIAN = MEDIAN ## Gibt den Median der angegebenen Zahlen zurück
-MIN = MIN ## Gibt den Minimalwert einer Liste mit Argumenten zurück
-MINA = MINA ## Gibt den kleinsten Wert einer Liste mit Argumenten zurück, die Zahlen, Text und Wahrheitswerte enthalten
-MODE = MODALWERT ## Gibt den am häufigsten vorkommenden Wert in einer Datengruppe zurück
-NEGBINOMDIST = NEGBINOMVERT ## Gibt Wahrscheinlichkeiten einer negativen, binominal verteilten Zufallsvariablen zurück
-NORMDIST = NORMVERT ## Gibt Wahrscheinlichkeiten einer normal verteilten Zufallsvariablen zurück
-NORMINV = NORMINV ## Gibt Quantile der Normalverteilung zurück
-NORMSDIST = STANDNORMVERT ## Gibt Werte der Verteilungsfunktion einer standardnormalverteilten Zufallsvariablen zurück
-NORMSINV = STANDNORMINV ## Gibt Quantile der Standardnormalverteilung zurück
-PEARSON = PEARSON ## Gibt den Pearsonschen Korrelationskoeffizienten zurück
-PERCENTILE = QUANTIL ## Gibt das Alpha-Quantil einer Gruppe von Daten zurück
-PERCENTRANK = QUANTILSRANG ## Gibt den prozentualen Rang (Alpha) eines Werts in einer Datengruppe zurück
-PERMUT = VARIATIONEN ## Gibt die Anzahl der Möglichkeiten zurück, um k Elemente aus einer Menge von n Elementen ohne Zurücklegen zu ziehen
-POISSON = POISSON ## Gibt Wahrscheinlichkeiten einer poissonverteilten Zufallsvariablen zurück
-PROB = WAHRSCHBEREICH ## Gibt die Wahrscheinlichkeit für ein von zwei Werten eingeschlossenes Intervall zurück
-QUARTILE = QUARTILE ## Gibt die Quartile der Datengruppe zurück
-RANK = RANG ## Gibt den Rang zurück, den eine Zahl innerhalb einer Liste von Zahlen einnimmt
-RSQ = BESTIMMTHEITSMASS ## Gibt das Quadrat des Pearsonschen Korrelationskoeffizienten zurück
-SKEW = SCHIEFE ## Gibt die Schiefe einer Verteilung zurück
-SLOPE = STEIGUNG ## Gibt die Steigung der Regressionsgeraden zurück
-SMALL = KKLEINSTE ## Gibt den k-kleinsten Wert einer Datengruppe zurück
-STANDARDIZE = STANDARDISIERUNG ## Gibt den standardisierten Wert zurück
-STDEV = STABW ## Schätzt die Standardabweichung ausgehend von einer Stichprobe
-STDEVA = STABWA ## Schätzt die Standardabweichung ausgehend von einer Stichprobe, die Zahlen, Text und Wahrheitswerte enthält
-STDEVP = STABWN ## Berechnet die Standardabweichung ausgehend von der Grundgesamtheit
-STDEVPA = STABWNA ## Berechnet die Standardabweichung ausgehend von der Grundgesamtheit, die Zahlen, Text und Wahrheitswerte enthält
-STEYX = STFEHLERYX ## Gibt den Standardfehler der geschätzten y-Werte für alle x-Werte der Regression zurück
-TDIST = TVERT ## Gibt Werte der Verteilungsfunktion (1-Alpha) einer (Student) t-verteilten Zufallsvariablen zurück
-TINV = TINV ## Gibt Quantile der t-Verteilung zurück
-TREND = TREND ## Gibt Werte zurück, die sich aus einem linearen Trend ergeben
-TRIMMEAN = GESTUTZTMITTEL ## Gibt den Mittelwert einer Datengruppe zurück, ohne die Randwerte zu berücksichtigen
-TTEST = TTEST ## Gibt die Teststatistik eines Student'schen t-Tests zurück
-VAR = VARIANZ ## Schätzt die Varianz ausgehend von einer Stichprobe
-VARA = VARIANZA ## Schätzt die Varianz ausgehend von einer Stichprobe, die Zahlen, Text und Wahrheitswerte enthält
-VARP = VARIANZEN ## Berechnet die Varianz ausgehend von der Grundgesamtheit
-VARPA = VARIANZENA ## Berechnet die Varianz ausgehend von der Grundgesamtheit, die Zahlen, Text und Wahrheitswerte enthält
-WEIBULL = WEIBULL ## Gibt Wahrscheinlichkeiten einer weibullverteilten Zufallsvariablen zurück
-ZTEST = GTEST ## Gibt den einseitigen Wahrscheinlichkeitswert für einen Gausstest (Normalverteilung) zurück
-
-
-##
-## Text functions Textfunktionen
-##
-ASC = ASC ## Konvertiert DB-Text in einer Zeichenfolge (lateinische Buchstaben oder Katakana) in SB-Text
-BAHTTEXT = BAHTTEXT ## Wandelt eine Zahl in Text im Währungsformat ß (Baht) um
-CHAR = ZEICHEN ## Gibt das der Codezahl entsprechende Zeichen zurück
-CLEAN = SÄUBERN ## Löscht alle nicht druckbaren Zeichen aus einem Text
-CODE = CODE ## Gibt die Codezahl des ersten Zeichens in einem Text zurück
-CONCATENATE = VERKETTEN ## Verknüpft mehrere Textelemente zu einem Textelement
-DOLLAR = DM ## Wandelt eine Zahl in Text im Währungsformat € (Euro) um
-EXACT = IDENTISCH ## Prüft, ob zwei Textwerte identisch sind
-FIND = FINDEN ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird unterschieden)
-FINDB = FINDENB ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird unterschieden)
-FIXED = FEST ## Formatiert eine Zahl als Text mit einer festen Anzahl von Dezimalstellen
-JIS = JIS ## Konvertiert SB-Text in einer Zeichenfolge (lateinische Buchstaben oder Katakana) in DB-Text
-LEFT = LINKS ## Gibt die Zeichen ganz links in einem Textwert zurück
-LEFTB = LINKSB ## Gibt die Zeichen ganz links in einem Textwert zurück
-LEN = LÄNGE ## Gibt die Anzahl der Zeichen in einer Zeichenfolge zurück
-LENB = LÄNGEB ## Gibt die Anzahl der Zeichen in einer Zeichenfolge zurück
-LOWER = KLEIN ## Wandelt Text in Kleinbuchstaben um
-MID = TEIL ## Gibt eine bestimmte Anzahl Zeichen aus einer Zeichenfolge ab der von Ihnen angegebenen Stelle zurück
-MIDB = TEILB ## Gibt eine bestimmte Anzahl Zeichen aus einer Zeichenfolge ab der von Ihnen angegebenen Stelle zurück
-PHONETIC = PHONETIC ## Extrahiert die phonetischen (Furigana-)Zeichen aus einer Textzeichenfolge
-PROPER = GROSS2 ## Wandelt den ersten Buchstaben aller Wörter eines Textwerts in Großbuchstaben um
-REPLACE = ERSETZEN ## Ersetzt Zeichen in Text
-REPLACEB = ERSETZENB ## Ersetzt Zeichen in Text
-REPT = WIEDERHOLEN ## Wiederholt einen Text so oft wie angegeben
-RIGHT = RECHTS ## Gibt die Zeichen ganz rechts in einem Textwert zurück
-RIGHTB = RECHTSB ## Gibt die Zeichen ganz rechts in einem Textwert zurück
-SEARCH = SUCHEN ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird nicht unterschieden)
-SEARCHB = SUCHENB ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird nicht unterschieden)
-SUBSTITUTE = WECHSELN ## Ersetzt in einer Zeichenfolge neuen Text gegen alten
-T = T ## Wandelt die zugehörigen Argumente in Text um
-TEXT = TEXT ## Formatiert eine Zahl und wandelt sie in Text um
-TRIM = GLÄTTEN ## Entfernt Leerzeichen aus Text
-UPPER = GROSS ## Wandelt Text in Großbuchstaben um
-VALUE = WERT ## Wandelt ein Textargument in eine Zahl um
+##
+## PhpSpreadsheet
+##
+## Data in this file derived from https://www.excel-function-translation.com/
+##
+##
+
+
+##
+## Add-in and Automation functions Add-In- und Automatisierungsfunktionen
+##
+GETPIVOTDATA = PIVOTDATENZUORDNEN ## In einem PivotTable-Bericht gespeicherte Daten werden zurückgegeben.
+
+
+##
+## Cube functions Cubefunktionen
+##
+CUBEKPIMEMBER = CUBEKPIELEMENT ## Gibt Name, Eigenschaft und Measure eines Key Performance Indicators (KPI) zurück und zeigt den Namen und die Eigenschaft in der Zelle an. Ein KPI ist ein quantifizierbares Maß, wie z. B. der monatliche Bruttogewinn oder die vierteljährliche Mitarbeiterfluktuation, mit dessen Hilfe das Leistungsverhalten eines Unternehmens überwacht werden kann.
+CUBEMEMBER = CUBEELEMENT ## Gibt ein Element oder ein Tuple in einer Cubehierarchie zurück. Wird verwendet, um zu überprüfen, ob das Element oder Tuple im Cube vorhanden ist.
+CUBEMEMBERPROPERTY = CUBEELEMENTEIGENSCHAFT ## Gibt den Wert einer Elementeigenschaft im Cube zurück. Wird verwendet, um zu überprüfen, ob ein Elementname im Cube vorhanden ist, und um die für dieses Element angegebene Eigenschaft zurückzugeben.
+CUBERANKEDMEMBER = CUBERANGELEMENT ## Gibt das n-te oder n-rangige Element in einer Menge zurück. Wird verwendet, um mindestens ein Element in einer Menge zurückzugeben, wie z. B. bester Vertriebsmitarbeiter oder 10 beste Kursteilnehmer.
+CUBESET = CUBEMENGE ## Definiert eine berechnete Menge Elemente oder Tuples durch Senden eines Mengenausdrucks an den Cube auf dem Server, der die Menge erstellt und an Microsoft Office Excel zurückgibt.
+CUBESETCOUNT = CUBEMENGENANZAHL ## Gibt die Anzahl der Elemente in einer Menge zurück.
+CUBEVALUE = CUBEWERT ## Gibt einen Aggregatwert aus einem Cube zurück.
+
+
+##
+## Database functions Datenbankfunktionen
+##
+DAVERAGE = DBMITTELWERT ## Gibt den Mittelwert der ausgewählten Datenbankeinträge zurück
+DCOUNT = DBANZAHL ## Zählt die Zellen mit Zahlen in einer Datenbank
+DCOUNTA = DBANZAHL2 ## Zählt nicht leere Zellen in einer Datenbank
+DGET = DBAUSZUG ## Extrahiert aus einer Datenbank einen einzelnen Datensatz, der den angegebenen Kriterien entspricht
+DMAX = DBMAX ## Gibt den größten Wert aus ausgewählten Datenbankeinträgen zurück
+DMIN = DBMIN ## Gibt den kleinsten Wert aus ausgewählten Datenbankeinträgen zurück
+DPRODUCT = DBPRODUKT ## Multipliziert die Werte in einem bestimmten Feld mit Datensätzen, die den Kriterien in einer Datenbank entsprechen
+DSTDEV = DBSTDABW ## Schätzt die Standardabweichung auf der Grundlage einer Stichprobe aus ausgewählten Datenbankeinträgen
+DSTDEVP = DBSTDABWN ## Berechnet die Standardabweichung auf der Grundlage der Grundgesamtheit ausgewählter Datenbankeinträge
+DSUM = DBSUMME ## Addiert die Zahlen in der Feldspalte mit Datensätzen in der Datenbank, die den Kriterien entsprechen
+DVAR = DBVARIANZ ## Schätzt die Varianz auf der Grundlage ausgewählter Datenbankeinträge
+DVARP = DBVARIANZEN ## Berechnet die Varianz auf der Grundlage der Grundgesamtheit ausgewählter Datenbankeinträge
+
+
+##
+## Date and time functions Datums- und Zeitfunktionen
+##
+DATE = DATUM ## Gibt die fortlaufende Zahl eines bestimmten Datums zurück
+DATEVALUE = DATWERT ## Wandelt ein Datum in Form von Text in eine fortlaufende Zahl um
+DAY = TAG ## Wandelt eine fortlaufende Zahl in den Tag des Monats um
+DAYS360 = TAGE360 ## Berechnet die Anzahl der Tage zwischen zwei Datumsangaben ausgehend von einem Jahr, das 360 Tage hat
+EDATE = EDATUM ## Gibt die fortlaufende Zahl des Datums zurück, bei dem es sich um die angegebene Anzahl von Monaten vor oder nach dem Anfangstermin handelt
+EOMONTH = MONATSENDE ## Gibt die fortlaufende Zahl des letzten Tags des Monats vor oder nach einer festgelegten Anzahl von Monaten zurück
+HOUR = STUNDE ## Wandelt eine fortlaufende Zahl in eine Stunde um
+MINUTE = MINUTE ## Wandelt eine fortlaufende Zahl in eine Minute um
+MONTH = MONAT ## Wandelt eine fortlaufende Zahl in einen Monat um
+NETWORKDAYS = NETTOARBEITSTAGE ## Gibt die Anzahl von ganzen Arbeitstagen zwischen zwei Datumswerten zurück
+NOW = JETZT ## Gibt die fortlaufende Zahl des aktuellen Datums und der aktuellen Uhrzeit zurück
+SECOND = SEKUNDE ## Wandelt eine fortlaufende Zahl in eine Sekunde um
+TIME = ZEIT ## Gibt die fortlaufende Zahl einer bestimmten Uhrzeit zurück
+TIMEVALUE = ZEITWERT ## Wandelt eine Uhrzeit in Form von Text in eine fortlaufende Zahl um
+TODAY = HEUTE ## Gibt die fortlaufende Zahl des heutigen Datums zurück
+WEEKDAY = WOCHENTAG ## Wandelt eine fortlaufende Zahl in den Wochentag um
+WEEKNUM = KALENDERWOCHE ## Wandelt eine fortlaufende Zahl in eine Zahl um, die angibt, in welche Woche eines Jahres das angegebene Datum fällt
+WORKDAY = ARBEITSTAG ## Gibt die fortlaufende Zahl des Datums vor oder nach einer bestimmten Anzahl von Arbeitstagen zurück
+YEAR = JAHR ## Wandelt eine fortlaufende Zahl in ein Jahr um
+YEARFRAC = BRTEILJAHRE ## Gibt die Anzahl der ganzen Tage zwischen Ausgangsdatum und Enddatum in Bruchteilen von Jahren zurück
+
+
+##
+## Engineering functions Konstruktionsfunktionen
+##
+BESSELI = BESSELI ## Gibt die geänderte Besselfunktion In(x) zurück
+BESSELJ = BESSELJ ## Gibt die Besselfunktion Jn(x) zurück
+BESSELK = BESSELK ## Gibt die geänderte Besselfunktion Kn(x) zurück
+BESSELY = BESSELY ## Gibt die Besselfunktion Yn(x) zurück
+BIN2DEC = BININDEZ ## Wandelt eine binäre Zahl (Dualzahl) in eine dezimale Zahl um
+BIN2HEX = BININHEX ## Wandelt eine binäre Zahl (Dualzahl) in eine hexadezimale Zahl um
+BIN2OCT = BININOKT ## Wandelt eine binäre Zahl (Dualzahl) in eine oktale Zahl um
+COMPLEX = KOMPLEXE ## Wandelt den Real- und Imaginärteil in eine komplexe Zahl um
+CONVERT = UMWANDELN ## Wandelt eine Zahl von einem Maßsystem in ein anderes um
+DEC2BIN = DEZINBIN ## Wandelt eine dezimale Zahl in eine binäre Zahl (Dualzahl) um
+DEC2HEX = DEZINHEX ## Wandelt eine dezimale Zahl in eine hexadezimale Zahl um
+DEC2OCT = DEZINOKT ## Wandelt eine dezimale Zahl in eine oktale Zahl um
+DELTA = DELTA ## Überprüft, ob zwei Werte gleich sind
+ERF = GAUSSFEHLER ## Gibt die Gauss'sche Fehlerfunktion zurück
+ERFC = GAUSSFKOMPL ## Gibt das Komplement zur Gauss'schen Fehlerfunktion zurück
+GESTEP = GGANZZAHL ## Überprüft, ob eine Zahl größer als ein gegebener Schwellenwert ist
+HEX2BIN = HEXINBIN ## Wandelt eine hexadezimale Zahl in eine Binärzahl um
+HEX2DEC = HEXINDEZ ## Wandelt eine hexadezimale Zahl in eine dezimale Zahl um
+HEX2OCT = HEXINOKT ## Wandelt eine hexadezimale Zahl in eine Oktalzahl um
+IMABS = IMABS ## Gibt den Absolutbetrag (Modulo) einer komplexen Zahl zurück
+IMAGINARY = IMAGINÄRTEIL ## Gibt den Imaginärteil einer komplexen Zahl zurück
+IMARGUMENT = IMARGUMENT ## Gibt das Argument Theta zurück, einen Winkel, der als Bogenmaß ausgedrückt wird
+IMCONJUGATE = IMKONJUGIERTE ## Gibt die konjugierte komplexe Zahl zu einer komplexen Zahl zurück
+IMCOS = IMCOS ## Gibt den Kosinus einer komplexen Zahl zurück
+IMDIV = IMDIV ## Gibt den Quotienten zweier komplexer Zahlen zurück
+IMEXP = IMEXP ## Gibt die algebraische Form einer in exponentieller Schreibweise vorliegenden komplexen Zahl zurück
+IMLN = IMLN ## Gibt den natürlichen Logarithmus einer komplexen Zahl zurück
+IMLOG10 = IMLOG10 ## Gibt den Logarithmus einer komplexen Zahl zur Basis 10 zurück
+IMLOG2 = IMLOG2 ## Gibt den Logarithmus einer komplexen Zahl zur Basis 2 zurück
+IMPOWER = IMAPOTENZ ## Potenziert eine komplexe Zahl mit einer ganzen Zahl
+IMPRODUCT = IMPRODUKT ## Gibt das Produkt von komplexen Zahlen zurück
+IMREAL = IMREALTEIL ## Gibt den Realteil einer komplexen Zahl zurück
+IMSIN = IMSIN ## Gibt den Sinus einer komplexen Zahl zurück
+IMSQRT = IMWURZEL ## Gibt die Quadratwurzel einer komplexen Zahl zurück
+IMSUB = IMSUB ## Gibt die Differenz zwischen zwei komplexen Zahlen zurück
+IMSUM = IMSUMME ## Gibt die Summe von komplexen Zahlen zurück
+OCT2BIN = OKTINBIN ## Wandelt eine oktale Zahl in eine binäre Zahl (Dualzahl) um
+OCT2DEC = OKTINDEZ ## Wandelt eine oktale Zahl in eine dezimale Zahl um
+OCT2HEX = OKTINHEX ## Wandelt eine oktale Zahl in eine hexadezimale Zahl um
+
+
+##
+## Financial functions Finanzmathematische Funktionen
+##
+ACCRINT = AUFGELZINS ## Gibt die aufgelaufenen Zinsen (Stückzinsen) eines Wertpapiers mit periodischen Zinszahlungen zurück
+ACCRINTM = AUFGELZINSF ## Gibt die aufgelaufenen Zinsen (Stückzinsen) eines Wertpapiers zurück, die bei Fälligkeit ausgezahlt werden
+AMORDEGRC = AMORDEGRK ## Gibt die Abschreibung für die einzelnen Abschreibungszeiträume mithilfe eines Abschreibungskoeffizienten zurück
+AMORLINC = AMORLINEARK ## Gibt die Abschreibung für die einzelnen Abschreibungszeiträume zurück
+COUPDAYBS = ZINSTERMTAGVA ## Gibt die Anzahl der Tage vom Anfang des Zinstermins bis zum Abrechnungstermin zurück
+COUPDAYS = ZINSTERMTAGE ## Gibt die Anzahl der Tage der Zinsperiode zurück, die den Abrechnungstermin einschließt
+COUPDAYSNC = ZINSTERMTAGNZ ## Gibt die Anzahl der Tage vom Abrechnungstermin bis zum nächsten Zinstermin zurück
+COUPNCD = ZINSTERMNZ ## Gibt das Datum des ersten Zinstermins nach dem Abrechnungstermin zurück
+COUPNUM = ZINSTERMZAHL ## Gibt die Anzahl der Zinstermine zwischen Abrechnungs- und Fälligkeitsdatum zurück
+COUPPCD = ZINSTERMVZ ## Gibt das Datum des letzten Zinstermins vor dem Abrechnungstermin zurück
+CUMIPMT = KUMZINSZ ## Berechnet die kumulierten Zinsen, die zwischen zwei Perioden zu zahlen sind
+CUMPRINC = KUMKAPITAL ## Berechnet die aufgelaufene Tilgung eines Darlehens, die zwischen zwei Perioden zu zahlen ist
+DB = GDA2 ## Gibt die geometrisch-degressive Abschreibung eines Wirtschaftsguts für eine bestimmte Periode zurück
+DDB = GDA ## Gibt die Abschreibung eines Anlageguts für einen angegebenen Zeitraum unter Verwendung der degressiven Doppelraten-Abschreibung oder eines anderen von Ihnen angegebenen Abschreibungsverfahrens zurück
+DISC = DISAGIO ## Gibt den in Prozent ausgedrückten Abzinsungssatz eines Wertpapiers zurück
+DOLLARDE = NOTIERUNGDEZ ## Wandelt eine Notierung, die als Dezimalbruch ausgedrückt wurde, in eine Dezimalzahl um
+DOLLARFR = NOTIERUNGBRU ## Wandelt eine Notierung, die als Dezimalzahl ausgedrückt wurde, in einen Dezimalbruch um
+DURATION = DURATION ## Gibt die jährliche Duration eines Wertpapiers mit periodischen Zinszahlungen zurück
+EFFECT = EFFEKTIV ## Gibt die jährliche Effektivverzinsung zurück
+FV = ZW ## Gibt den zukünftigen Wert (Endwert) einer Investition zurück
+FVSCHEDULE = ZW2 ## Gibt den aufgezinsten Wert des Anfangskapitals für eine Reihe periodisch unterschiedlicher Zinssätze zurück
+INTRATE = ZINSSATZ ## Gibt den Zinssatz eines voll investierten Wertpapiers zurück
+IPMT = ZINSZ ## Gibt die Zinszahlung einer Investition für die angegebene Periode zurück
+IRR = IKV ## Gibt den internen Zinsfuß einer Investition ohne Finanzierungskosten oder Reinvestitionsgewinne zurück
+ISPMT = ISPMT ## Berechnet die während eines bestimmten Zeitraums für eine Investition gezahlten Zinsen
+MDURATION = MDURATION ## Gibt die geänderte Dauer für ein Wertpapier mit einem angenommenen Nennwert von 100 € zurück
+MIRR = QIKV ## Gibt den internen Zinsfuß zurück, wobei positive und negative Zahlungen zu unterschiedlichen Sätzen finanziert werden
+NOMINAL = NOMINAL ## Gibt die jährliche Nominalverzinsung zurück
+NPER = ZZR ## Gibt die Anzahl der Zahlungsperioden einer Investition zurück
+NPV = NBW ## Gibt den Nettobarwert einer Investition auf Basis periodisch anfallender Zahlungen und eines Abzinsungsfaktors zurück
+ODDFPRICE = UNREGER.KURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers mit einem unregelmäßigen ersten Zinstermin zurück
+ODDFYIELD = UNREGER.REND ## Gibt die Rendite eines Wertpapiers mit einem unregelmäßigen ersten Zinstermin zurück
+ODDLPRICE = UNREGLE.KURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers mit einem unregelmäßigen letzten Zinstermin zurück
+ODDLYIELD = UNREGLE.REND ## Gibt die Rendite eines Wertpapiers mit einem unregelmäßigen letzten Zinstermin zurück
+PMT = RMZ ## Gibt die periodische Zahlung für eine Annuität zurück
+PPMT = KAPZ ## Gibt die Kapitalrückzahlung einer Investition für eine angegebene Periode zurück
+PRICE = KURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers zurück, das periodisch Zinsen auszahlt
+PRICEDISC = KURSDISAGIO ## Gibt den Kurs pro 100 € Nennwert eines unverzinslichen Wertpapiers zurück
+PRICEMAT = KURSFÄLLIG ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers zurück, das Zinsen am Fälligkeitsdatum auszahlt
+PV = BW ## Gibt den Barwert einer Investition zurück
+RATE = ZINS ## Gibt den Zinssatz pro Zeitraum einer Annuität zurück
+RECEIVED = AUSZAHLUNG ## Gibt den Auszahlungsbetrag eines voll investierten Wertpapiers am Fälligkeitstermin zurück
+SLN = LIA ## Gibt die lineare Abschreibung eines Wirtschaftsguts pro Periode zurück
+SYD = DIA ## Gibt die arithmetisch-degressive Abschreibung eines Wirtschaftsguts für eine bestimmte Periode zurück
+TBILLEQ = TBILLÄQUIV ## Gibt die Rendite für ein Wertpapier zurück
+TBILLPRICE = TBILLKURS ## Gibt den Kurs pro 100 € Nennwert eines Wertpapiers zurück
+TBILLYIELD = TBILLRENDITE ## Gibt die Rendite für ein Wertpapier zurück
+VDB = VDB ## Gibt die degressive Abschreibung eines Wirtschaftsguts für eine bestimmte Periode oder Teilperiode zurück
+XIRR = XINTZINSFUSS ## Gibt den internen Zinsfuß einer Reihe nicht periodisch anfallender Zahlungen zurück
+XNPV = XKAPITALWERT ## Gibt den Nettobarwert (Kapitalwert) einer Reihe nicht periodisch anfallender Zahlungen zurück
+YIELD = RENDITE ## Gibt die Rendite eines Wertpapiers zurück, das periodisch Zinsen auszahlt
+YIELDDISC = RENDITEDIS ## Gibt die jährliche Rendite eines unverzinslichen Wertpapiers zurück
+YIELDMAT = RENDITEFÄLL ## Gibt die jährliche Rendite eines Wertpapiers zurück, das Zinsen am Fälligkeitsdatum auszahlt
+
+
+##
+## Information functions Informationsfunktionen
+##
+CELL = ZELLE ## Gibt Informationen zu Formatierung, Position oder Inhalt einer Zelle zurück
+ERROR.TYPE = FEHLER.TYP ## Gibt eine Zahl zurück, die einem Fehlertyp entspricht
+INFO = INFO ## Gibt Informationen zur aktuellen Betriebssystemumgebung zurück
+ISBLANK = ISTLEER ## Gibt WAHR zurück, wenn der Wert leer ist
+ISERR = ISTFEHL ## Gibt WAHR zurück, wenn der Wert ein beliebiger Fehlerwert außer #N/V ist
+ISERROR = ISTFEHLER ## Gibt WAHR zurück, wenn der Wert ein beliebiger Fehlerwert ist
+ISEVEN = ISTGERADE ## Gibt WAHR zurück, wenn es sich um eine gerade Zahl handelt
+ISLOGICAL = ISTLOG ## Gibt WAHR zurück, wenn der Wert ein Wahrheitswert ist
+ISNA = ISTNV ## Gibt WAHR zurück, wenn der Wert der Fehlerwert #N/V ist
+ISNONTEXT = ISTKTEXT ## Gibt WAHR zurück, wenn der Wert ein Element ist, das keinen Text enthält
+ISNUMBER = ISTZAHL ## Gibt WAHR zurück, wenn der Wert eine Zahl ist
+ISODD = ISTUNGERADE ## Gibt WAHR zurück, wenn es sich um eine ungerade Zahl handelt
+ISREF = ISTBEZUG ## Gibt WAHR zurück, wenn der Wert ein Bezug ist
+ISTEXT = ISTTEXT ## Gibt WAHR zurück, wenn der Wert ein Element ist, das Text enthält
+N = N ## Gibt den in eine Zahl umgewandelten Wert zurück
+NA = NV ## Gibt den Fehlerwert #NV zurück
+TYPE = TYP ## Gibt eine Zahl zurück, die den Datentyp des angegebenen Werts anzeigt
+
+
+##
+## Logical functions Logische Funktionen
+##
+AND = UND ## Gibt WAHR zurück, wenn alle zugehörigen Argumente WAHR sind
+FALSE = FALSCH ## Gibt den Wahrheitswert FALSCH zurück
+IF = WENN ## Gibt einen logischen Test zum Ausführen an
+IFERROR = WENNFEHLER ## Gibt einen von Ihnen festgelegten Wert zurück, wenn die Auswertung der Formel zu einem Fehler führt; andernfalls wird das Ergebnis der Formel zurückgegeben
+NOT = NICHT ## Kehrt den Wahrheitswert der zugehörigen Argumente um
+OR = ODER ## Gibt WAHR zurück, wenn ein Argument WAHR ist
+TRUE = WAHR ## Gibt den Wahrheitswert WAHR zurück
+
+
+##
+## Lookup and reference functions Nachschlage- und Verweisfunktionen
+##
+ADDRESS = ADRESSE ## Gibt einen Bezug auf eine einzelne Zelle in einem Tabellenblatt als Text zurück
+AREAS = BEREICHE ## Gibt die Anzahl der innerhalb eines Bezugs aufgeführten Bereiche zurück
+CHOOSE = WAHL ## Wählt einen Wert aus eine Liste mit Werten aus
+COLUMN = SPALTE ## Gibt die Spaltennummer eines Bezugs zurück
+COLUMNS = SPALTEN ## Gibt die Anzahl der Spalten in einem Bezug zurück
+HLOOKUP = HVERWEIS ## Sucht in der obersten Zeile einer Matrix und gibt den Wert der angegebenen Zelle zurück
+HYPERLINK = HYPERLINK ## Erstellt eine Verknüpfung, über die ein auf einem Netzwerkserver, in einem Intranet oder im Internet gespeichertes Dokument geöffnet wird
+INDEX = INDEX ## Verwendet einen Index, um einen Wert aus einem Bezug oder einer Matrix auszuwählen
+INDIRECT = INDIREKT ## Gibt einen Bezug zurück, der von einem Textwert angegeben wird
+LOOKUP = LOOKUP ## Sucht Werte in einem Vektor oder einer Matrix
+MATCH = VERGLEICH ## Sucht Werte in einem Bezug oder einer Matrix
+OFFSET = BEREICH.VERSCHIEBEN ## Gibt einen Bezugoffset aus einem gegebenen Bezug zurück
+ROW = ZEILE ## Gibt die Zeilennummer eines Bezugs zurück
+ROWS = ZEILEN ## Gibt die Anzahl der Zeilen in einem Bezug zurück
+RTD = RTD ## Ruft Echtzeitdaten von einem Programm ab, das die COM-Automatisierung (Automatisierung: Ein Verfahren, bei dem aus einer Anwendung oder einem Entwicklungstool heraus mit den Objekten einer anderen Anwendung gearbeitet wird. Die früher als OLE-Automatisierung bezeichnete Automatisierung ist ein Industriestandard und eine Funktion von COM (Component Object Model).) unterstützt
+TRANSPOSE = MTRANS ## Gibt die transponierte Matrix einer Matrix zurück
+VLOOKUP = SVERWEIS ## Sucht in der ersten Spalte einer Matrix und arbeitet sich durch die Zeile, um den Wert einer Zelle zurückzugeben
+
+
+##
+## Math and trigonometry functions Mathematische und trigonometrische Funktionen
+##
+ABS = ABS ## Gibt den Absolutwert einer Zahl zurück
+ACOS = ARCCOS ## Gibt den Arkuskosinus einer Zahl zurück
+ACOSH = ARCCOSHYP ## Gibt den umgekehrten hyperbolischen Kosinus einer Zahl zurück
+ASIN = ARCSIN ## Gibt den Arkussinus einer Zahl zurück
+ASINH = ARCSINHYP ## Gibt den umgekehrten hyperbolischen Sinus einer Zahl zurück
+ATAN = ARCTAN ## Gibt den Arkustangens einer Zahl zurück
+ATAN2 = ARCTAN2 ## Gibt den Arkustangens einer x- und einer y-Koordinate zurück
+ATANH = ARCTANHYP ## Gibt den umgekehrten hyperbolischen Tangens einer Zahl zurück
+CEILING = OBERGRENZE ## Rundet eine Zahl auf die nächste ganze Zahl oder das nächste Vielfache von Schritt
+COMBIN = KOMBINATIONEN ## Gibt die Anzahl der Kombinationen für eine bestimmte Anzahl von Objekten zurück
+COS = COS ## Gibt den Kosinus einer Zahl zurück
+COSH = COSHYP ## Gibt den hyperbolischen Kosinus einer Zahl zurück
+DEGREES = GRAD ## Wandelt Bogenmaß (Radiant) in Grad um
+EVEN = GERADE ## Rundet eine Zahl auf die nächste gerade ganze Zahl auf
+EXP = EXP ## Potenziert die Basis e mit der als Argument angegebenen Zahl
+FACT = FAKULTÄT ## Gibt die Fakultät einer Zahl zurück
+FACTDOUBLE = ZWEIFAKULTÄT ## Gibt die Fakultät zu Zahl mit Schrittlänge 2 zurück
+FLOOR = UNTERGRENZE ## Rundet die Zahl auf Anzahl_Stellen ab
+GCD = GGT ## Gibt den größten gemeinsamen Teiler zurück
+INT = GANZZAHL ## Rundet eine Zahl auf die nächstkleinere ganze Zahl ab
+LCM = KGV ## Gibt das kleinste gemeinsame Vielfache zurück
+LN = LN ## Gibt den natürlichen Logarithmus einer Zahl zurück
+LOG = LOG ## Gibt den Logarithmus einer Zahl zu der angegebenen Basis zurück
+LOG10 = LOG10 ## Gibt den Logarithmus einer Zahl zur Basis 10 zurück
+MDETERM = MDET ## Gibt die Determinante einer Matrix zurück
+MINVERSE = MINV ## Gibt die inverse Matrix einer Matrix zurück
+MMULT = MMULT ## Gibt das Produkt zweier Matrizen zurück
+MOD = REST ## Gibt den Rest einer Division zurück
+MROUND = VRUNDEN ## Gibt eine auf das gewünschte Vielfache gerundete Zahl zurück
+MULTINOMIAL = POLYNOMIAL ## Gibt den Polynomialkoeffizienten einer Gruppe von Zahlen zurück
+ODD = UNGERADE ## Rundet eine Zahl auf die nächste ungerade ganze Zahl auf
+PI = PI ## Gibt den Wert Pi zurück
+POWER = POTENZ ## Gibt als Ergebnis eine potenzierte Zahl zurück
+PRODUCT = PRODUKT ## Multipliziert die zugehörigen Argumente
+QUOTIENT = QUOTIENT ## Gibt den ganzzahligen Anteil einer Division zurück
+RADIANS = BOGENMASS ## Wandelt Grad in Bogenmaß (Radiant) um
+RAND = ZUFALLSZAHL ## Gibt eine Zufallszahl zwischen 0 und 1 zurück
+RANDBETWEEN = ZUFALLSBEREICH ## Gibt eine Zufallszahl aus dem festgelegten Bereich zurück
+ROMAN = RÖMISCH ## Wandelt eine arabische Zahl in eine römische Zahl als Text um
+ROUND = RUNDEN ## Rundet eine Zahl auf eine bestimmte Anzahl von Dezimalstellen
+ROUNDDOWN = ABRUNDEN ## Rundet die Zahl auf Anzahl_Stellen ab
+ROUNDUP = AUFRUNDEN ## Rundet die Zahl auf Anzahl_Stellen auf
+SERIESSUM = POTENZREIHE ## Gibt die Summe von Potenzen (zur Berechnung von Potenzreihen und dichotomen Wahrscheinlichkeiten) zurück
+SIGN = VORZEICHEN ## Gibt das Vorzeichen einer Zahl zurück
+SIN = SIN ## Gibt den Sinus einer Zahl zurück
+SINH = SINHYP ## Gibt den hyperbolischen Sinus einer Zahl zurück
+SQRT = WURZEL ## Gibt die Quadratwurzel einer Zahl zurück
+SQRTPI = WURZELPI ## Gibt die Wurzel aus der mit Pi (pi) multiplizierten Zahl zurück
+SUBTOTAL = TEILERGEBNIS ## Gibt ein Teilergebnis in einer Liste oder Datenbank zurück
+SUM = SUMME ## Addiert die zugehörigen Argumente
+SUMIF = SUMMEWENN ## Addiert Zahlen, die mit den Suchkriterien übereinstimmen
+SUMIFS = SUMMEWENNS ## Die Zellen, die mehrere Kriterien erfüllen, werden in einem Bereich hinzugefügt
+SUMPRODUCT = SUMMENPRODUKT ## Gibt die Summe der Produkte zusammengehöriger Matrixkomponenten zurück
+SUMSQ = QUADRATESUMME ## Gibt die Summe der quadrierten Argumente zurück
+SUMX2MY2 = SUMMEX2MY2 ## Gibt die Summe der Differenzen der Quadrate für zusammengehörige Komponenten zweier Matrizen zurück
+SUMX2PY2 = SUMMEX2PY2 ## Gibt die Summe der Quadrate für zusammengehörige Komponenten zweier Matrizen zurück
+SUMXMY2 = SUMMEXMY2 ## Gibt die Summe der quadrierten Differenzen für zusammengehörige Komponenten zweier Matrizen zurück
+TAN = TAN ## Gibt den Tangens einer Zahl zurück
+TANH = TANHYP ## Gibt den hyperbolischen Tangens einer Zahl zurück
+TRUNC = KÜRZEN ## Schneidet die Kommastellen einer Zahl ab und gibt als Ergebnis eine ganze Zahl zurück
+
+
+##
+## Statistical functions Statistische Funktionen
+##
+AVEDEV = MITTELABW ## Gibt die durchschnittliche absolute Abweichung einer Reihe von Merkmalsausprägungen und ihrem Mittelwert zurück
+AVERAGE = MITTELWERT ## Gibt den Mittelwert der zugehörigen Argumente zurück
+AVERAGEA = MITTELWERTA ## Gibt den Mittelwert der zugehörigen Argumente, die Zahlen, Text und Wahrheitswerte enthalten, zurück
+AVERAGEIF = MITTELWERTWENN ## Der Durchschnittswert (arithmetisches Mittel) für alle Zellen in einem Bereich, die einem angegebenen Kriterium entsprechen, wird zurückgegeben
+AVERAGEIFS = MITTELWERTWENNS ## Gibt den Durchschnittswert (arithmetisches Mittel) aller Zellen zurück, die mehreren Kriterien entsprechen
+BETADIST = BETAVERT ## Gibt die Werte der kumulierten Betaverteilungsfunktion zurück
+BETAINV = BETAINV ## Gibt das Quantil der angegebenen Betaverteilung zurück
+BINOMDIST = BINOMVERT ## Gibt Wahrscheinlichkeiten einer binomialverteilten Zufallsvariablen zurück
+CHIDIST = CHIVERT ## Gibt Werte der Verteilungsfunktion (1-Alpha) einer Chi-Quadrat-verteilten Zufallsgröße zurück
+CHIINV = CHIINV ## Gibt Quantile der Verteilungsfunktion (1-Alpha) der Chi-Quadrat-Verteilung zurück
+CHITEST = CHITEST ## Gibt die Teststatistik eines Unabhängigkeitstests zurück
+CONFIDENCE = KONFIDENZ ## Ermöglicht die Berechnung des 1-Alpha Konfidenzintervalls für den Erwartungswert einer Zufallsvariablen
+CORREL = KORREL ## Gibt den Korrelationskoeffizienten zweier Reihen von Merkmalsausprägungen zurück
+COUNT = ANZAHL ## Gibt die Anzahl der Zahlen in der Liste mit Argumenten an
+COUNTA = ANZAHL2 ## Gibt die Anzahl der Werte in der Liste mit Argumenten an
+COUNTBLANK = ANZAHLLEEREZELLEN ## Gibt die Anzahl der leeren Zellen in einem Bereich an
+COUNTIF = ZÄHLENWENN ## Gibt die Anzahl der Zellen in einem Bereich an, deren Inhalte mit den Suchkriterien übereinstimmen
+COUNTIFS = ZÄHLENWENNS ## Gibt die Anzahl der Zellen in einem Bereich an, deren Inhalte mit mehreren Suchkriterien übereinstimmen
+COVAR = KOVAR ## Gibt die Kovarianz zurück, den Mittelwert der für alle Datenpunktpaare gebildeten Produkte der Abweichungen
+CRITBINOM = KRITBINOM ## Gibt den kleinsten Wert zurück, für den die kumulierten Wahrscheinlichkeiten der Binomialverteilung kleiner oder gleich einer Grenzwahrscheinlichkeit sind
+DEVSQ = SUMQUADABW ## Gibt die Summe der quadrierten Abweichungen der Datenpunkte von ihrem Stichprobenmittelwert zurück
+EXPONDIST = EXPONVERT ## Gibt Wahrscheinlichkeiten einer exponential verteilten Zufallsvariablen zurück
+FDIST = FVERT ## Gibt Werte der Verteilungsfunktion (1-Alpha) einer F-verteilten Zufallsvariablen zurück
+FINV = FINV ## Gibt Quantile der F-Verteilung zurück
+FISHER = FISHER ## Gibt die Fisher-Transformation zurück
+FISHERINV = FISHERINV ## Gibt die Umkehrung der Fisher-Transformation zurück
+FORECAST = PROGNOSE ## Gibt einen Wert zurück, der sich aus einem linearen Trend ergibt
+FREQUENCY = HÄUFIGKEIT ## Gibt eine Häufigkeitsverteilung als vertikale Matrix zurück
+FTEST = FTEST ## Gibt die Teststatistik eines F-Tests zurück
+GAMMADIST = GAMMAVERT ## Gibt Wahrscheinlichkeiten einer gammaverteilten Zufallsvariablen zurück
+GAMMAINV = GAMMAINV ## Gibt Quantile der Gammaverteilung zurück
+GAMMALN = GAMMALN ## Gibt den natürlichen Logarithmus der Gammafunktion zurück, Γ(x)
+GEOMEAN = GEOMITTEL ## Gibt das geometrische Mittel zurück
+GROWTH = VARIATION ## Gibt Werte zurück, die sich aus einem exponentiellen Trend ergeben
+HARMEAN = HARMITTEL ## Gibt das harmonische Mittel zurück
+HYPGEOMDIST = HYPGEOMVERT ## Gibt Wahrscheinlichkeiten einer hypergeometrisch-verteilten Zufallsvariablen zurück
+INTERCEPT = ACHSENABSCHNITT ## Gibt den Schnittpunkt der Regressionsgeraden zurück
+KURT = KURT ## Gibt die Kurtosis (Exzess) einer Datengruppe zurück
+LARGE = KGRÖSSTE ## Gibt den k-größten Wert einer Datengruppe zurück
+LINEST = RGP ## Gibt die Parameter eines linearen Trends zurück
+LOGEST = RKP ## Gibt die Parameter eines exponentiellen Trends zurück
+LOGINV = LOGINV ## Gibt Quantile der Lognormalverteilung zurück
+LOGNORMDIST = LOGNORMVERT ## Gibt Werte der Verteilungsfunktion einer lognormalverteilten Zufallsvariablen zurück
+MAX = MAX ## Gibt den Maximalwert einer Liste mit Argumenten zurück
+MAXA = MAXA ## Gibt den Maximalwert einer Liste mit Argumenten zurück, die Zahlen, Text und Wahrheitswerte enthalten
+MEDIAN = MEDIAN ## Gibt den Median der angegebenen Zahlen zurück
+MIN = MIN ## Gibt den Minimalwert einer Liste mit Argumenten zurück
+MINA = MINA ## Gibt den kleinsten Wert einer Liste mit Argumenten zurück, die Zahlen, Text und Wahrheitswerte enthalten
+MODE = MODALWERT ## Gibt den am häufigsten vorkommenden Wert in einer Datengruppe zurück
+NEGBINOMDIST = NEGBINOMVERT ## Gibt Wahrscheinlichkeiten einer negativen, binominal verteilten Zufallsvariablen zurück
+NORMDIST = NORMVERT ## Gibt Wahrscheinlichkeiten einer normal verteilten Zufallsvariablen zurück
+NORMINV = NORMINV ## Gibt Quantile der Normalverteilung zurück
+NORMSDIST = STANDNORMVERT ## Gibt Werte der Verteilungsfunktion einer standardnormalverteilten Zufallsvariablen zurück
+NORMSINV = STANDNORMINV ## Gibt Quantile der Standardnormalverteilung zurück
+PEARSON = PEARSON ## Gibt den Pearsonschen Korrelationskoeffizienten zurück
+PERCENTILE = QUANTIL ## Gibt das Alpha-Quantil einer Gruppe von Daten zurück
+PERCENTRANK = QUANTILSRANG ## Gibt den prozentualen Rang (Alpha) eines Werts in einer Datengruppe zurück
+PERMUT = VARIATIONEN ## Gibt die Anzahl der Möglichkeiten zurück, um k Elemente aus einer Menge von n Elementen ohne Zurücklegen zu ziehen
+POISSON = POISSON ## Gibt Wahrscheinlichkeiten einer poissonverteilten Zufallsvariablen zurück
+PROB = WAHRSCHBEREICH ## Gibt die Wahrscheinlichkeit für ein von zwei Werten eingeschlossenes Intervall zurück
+QUARTILE = QUARTILE ## Gibt die Quartile der Datengruppe zurück
+RANK = RANG ## Gibt den Rang zurück, den eine Zahl innerhalb einer Liste von Zahlen einnimmt
+RSQ = BESTIMMTHEITSMASS ## Gibt das Quadrat des Pearsonschen Korrelationskoeffizienten zurück
+SKEW = SCHIEFE ## Gibt die Schiefe einer Verteilung zurück
+SLOPE = STEIGUNG ## Gibt die Steigung der Regressionsgeraden zurück
+SMALL = KKLEINSTE ## Gibt den k-kleinsten Wert einer Datengruppe zurück
+STANDARDIZE = STANDARDISIERUNG ## Gibt den standardisierten Wert zurück
+STDEV = STABW ## Schätzt die Standardabweichung ausgehend von einer Stichprobe
+STDEVA = STABWA ## Schätzt die Standardabweichung ausgehend von einer Stichprobe, die Zahlen, Text und Wahrheitswerte enthält
+STDEVP = STABWN ## Berechnet die Standardabweichung ausgehend von der Grundgesamtheit
+STDEVPA = STABWNA ## Berechnet die Standardabweichung ausgehend von der Grundgesamtheit, die Zahlen, Text und Wahrheitswerte enthält
+STEYX = STFEHLERYX ## Gibt den Standardfehler der geschätzten y-Werte für alle x-Werte der Regression zurück
+TDIST = TVERT ## Gibt Werte der Verteilungsfunktion (1-Alpha) einer (Student) t-verteilten Zufallsvariablen zurück
+TINV = TINV ## Gibt Quantile der t-Verteilung zurück
+TREND = TREND ## Gibt Werte zurück, die sich aus einem linearen Trend ergeben
+TRIMMEAN = GESTUTZTMITTEL ## Gibt den Mittelwert einer Datengruppe zurück, ohne die Randwerte zu berücksichtigen
+TTEST = TTEST ## Gibt die Teststatistik eines Student'schen t-Tests zurück
+VAR = VARIANZ ## Schätzt die Varianz ausgehend von einer Stichprobe
+VARA = VARIANZA ## Schätzt die Varianz ausgehend von einer Stichprobe, die Zahlen, Text und Wahrheitswerte enthält
+VARP = VARIANZEN ## Berechnet die Varianz ausgehend von der Grundgesamtheit
+VARPA = VARIANZENA ## Berechnet die Varianz ausgehend von der Grundgesamtheit, die Zahlen, Text und Wahrheitswerte enthält
+WEIBULL = WEIBULL ## Gibt Wahrscheinlichkeiten einer weibullverteilten Zufallsvariablen zurück
+ZTEST = GTEST ## Gibt den einseitigen Wahrscheinlichkeitswert für einen Gausstest (Normalverteilung) zurück
+
+
+##
+## Text functions Textfunktionen
+##
+ASC = ASC ## Konvertiert DB-Text in einer Zeichenfolge (lateinische Buchstaben oder Katakana) in SB-Text
+BAHTTEXT = BAHTTEXT ## Wandelt eine Zahl in Text im Währungsformat ß (Baht) um
+CHAR = ZEICHEN ## Gibt das der Codezahl entsprechende Zeichen zurück
+CLEAN = SÄUBERN ## Löscht alle nicht druckbaren Zeichen aus einem Text
+CODE = CODE ## Gibt die Codezahl des ersten Zeichens in einem Text zurück
+CONCATENATE = VERKETTEN ## Verknüpft mehrere Textelemente zu einem Textelement
+DOLLAR = DM ## Wandelt eine Zahl in Text im Währungsformat € (Euro) um
+EXACT = IDENTISCH ## Prüft, ob zwei Textwerte identisch sind
+FIND = FINDEN ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird unterschieden)
+FINDB = FINDENB ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird unterschieden)
+FIXED = FEST ## Formatiert eine Zahl als Text mit einer festen Anzahl von Dezimalstellen
+JIS = JIS ## Konvertiert SB-Text in einer Zeichenfolge (lateinische Buchstaben oder Katakana) in DB-Text
+LEFT = LINKS ## Gibt die Zeichen ganz links in einem Textwert zurück
+LEFTB = LINKSB ## Gibt die Zeichen ganz links in einem Textwert zurück
+LEN = LÄNGE ## Gibt die Anzahl der Zeichen in einer Zeichenfolge zurück
+LENB = LÄNGEB ## Gibt die Anzahl der Zeichen in einer Zeichenfolge zurück
+LOWER = KLEIN ## Wandelt Text in Kleinbuchstaben um
+MID = TEIL ## Gibt eine bestimmte Anzahl Zeichen aus einer Zeichenfolge ab der von Ihnen angegebenen Stelle zurück
+MIDB = TEILB ## Gibt eine bestimmte Anzahl Zeichen aus einer Zeichenfolge ab der von Ihnen angegebenen Stelle zurück
+PHONETIC = PHONETIC ## Extrahiert die phonetischen (Furigana-)Zeichen aus einer Textzeichenfolge
+PROPER = GROSS2 ## Wandelt den ersten Buchstaben aller Wörter eines Textwerts in Großbuchstaben um
+REPLACE = ERSETZEN ## Ersetzt Zeichen in Text
+REPLACEB = ERSETZENB ## Ersetzt Zeichen in Text
+REPT = WIEDERHOLEN ## Wiederholt einen Text so oft wie angegeben
+RIGHT = RECHTS ## Gibt die Zeichen ganz rechts in einem Textwert zurück
+RIGHTB = RECHTSB ## Gibt die Zeichen ganz rechts in einem Textwert zurück
+SEARCH = SUCHEN ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird nicht unterschieden)
+SEARCHB = SUCHENB ## Sucht nach einem Textwert, der in einem anderen Textwert enthalten ist (Groß-/Kleinschreibung wird nicht unterschieden)
+SUBSTITUTE = WECHSELN ## Ersetzt in einer Zeichenfolge neuen Text gegen alten
+T = T ## Wandelt die zugehörigen Argumente in Text um
+TEXT = TEXT ## Formatiert eine Zahl und wandelt sie in Text um
+TRIM = GLÄTTEN ## Entfernt Leerzeichen aus Text
+UPPER = GROSS ## Wandelt Text in Großbuchstaben um
+VALUE = WERT ## Wandelt ein Textargument in eine Zahl um
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/en/uk/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/en/uk/config
new file mode 100644
index 00000000000..859e4beed9b
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/en/uk/config
@@ -0,0 +1,8 @@
+##
+## PhpSpreadsheet
+##
+
+##
+## (For future use)
+##
+currencySymbol = £
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/es/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/es/config
new file mode 100644
index 00000000000..5b9b9488d37
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/es/config
@@ -0,0 +1,24 @@
+##
+## PhpSpreadsheet
+##
+
+ArgumentSeparator = ;
+
+
+##
+## (For future use)
+##
+currencySymbol = $ ## I'm surprised that the Excel Documentation suggests $ rather than €
+
+
+##
+## Excel Error Codes (For future use)
+
+##
+NULL = #¡NULO!
+DIV0 = #¡DIV/0!
+VALUE = #¡VALOR!
+REF = #¡REF!
+NAME = #¿NOMBRE?
+NUM = #¡NÚM!
+NA = #N/A
diff --git a/lib/phpexcel/PHPExcel/locale/es/functions b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/es/functions
similarity index 95%
rename from lib/phpexcel/PHPExcel/locale/es/functions
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/es/functions
index 48762695bf8..ac1ac86a55f 100644
--- a/lib/phpexcel/PHPExcel/locale/es/functions
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/es/functions
@@ -1,438 +1,416 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Calculation
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/
-##
-##
-
-
-##
-## Add-in and Automation functions Funciones de complementos y automatización
-##
-GETPIVOTDATA = IMPORTARDATOSDINAMICOS ## Devuelve los datos almacenados en un informe de tabla dinámica.
-
-
-##
-## Cube functions Funciones de cubo
-##
-CUBEKPIMEMBER = MIEMBROKPICUBO ## Devuelve un nombre, propiedad y medida de indicador de rendimiento clave (KPI) y muestra el nombre y la propiedad en la celda. Un KPI es una medida cuantificable, como los beneficios brutos mensuales o la facturación trimestral por empleado, que se usa para supervisar el rendimiento de una organización.
-CUBEMEMBER = MIEMBROCUBO ## Devuelve un miembro o tupla en una jerarquía de cubo. Se usa para validar la existencia del miembro o la tupla en el cubo.
-CUBEMEMBERPROPERTY = PROPIEDADMIEMBROCUBO ## Devuelve el valor de una propiedad de miembro del cubo Se usa para validar la existencia de un nombre de miembro en el cubo y para devolver la propiedad especificada para este miembro.
-CUBERANKEDMEMBER = MIEMBRORANGOCUBO ## Devuelve el miembro n, o clasificado, de un conjunto. Se usa para devolver uno o más elementos de un conjunto, por ejemplo, el representante con mejores ventas o los diez mejores alumnos.
-CUBESET = CONJUNTOCUBO ## Define un conjunto calculado de miembros o tuplas mediante el envío de una expresión de conjunto al cubo en el servidor, lo que crea el conjunto y, después, devuelve dicho conjunto a Microsoft Office Excel.
-CUBESETCOUNT = RECUENTOCONJUNTOCUBO ## Devuelve el número de elementos de un conjunto.
-CUBEVALUE = VALORCUBO ## Devuelve un valor agregado de un cubo.
-
-
-##
-## Database functions Funciones de base de datos
-##
-DAVERAGE = BDPROMEDIO ## Devuelve el promedio de las entradas seleccionadas en la base de datos.
-DCOUNT = BDCONTAR ## Cuenta el número de celdas que contienen números en una base de datos.
-DCOUNTA = BDCONTARA ## Cuenta el número de celdas no vacías en una base de datos.
-DGET = BDEXTRAER ## Extrae de una base de datos un único registro que cumple los criterios especificados.
-DMAX = BDMAX ## Devuelve el valor máximo de las entradas seleccionadas de la base de datos.
-DMIN = BDMIN ## Devuelve el valor mínimo de las entradas seleccionadas de la base de datos.
-DPRODUCT = BDPRODUCTO ## Multiplica los valores de un campo concreto de registros de una base de datos que cumplen los criterios especificados.
-DSTDEV = BDDESVEST ## Calcula la desviación estándar a partir de una muestra de entradas seleccionadas en la base de datos.
-DSTDEVP = BDDESVESTP ## Calcula la desviación estándar en función de la población total de las entradas seleccionadas de la base de datos.
-DSUM = BDSUMA ## Suma los números de la columna de campo de los registros de la base de datos que cumplen los criterios.
-DVAR = BDVAR ## Calcula la varianza a partir de una muestra de entradas seleccionadas de la base de datos.
-DVARP = BDVARP ## Calcula la varianza a partir de la población total de entradas seleccionadas de la base de datos.
-
-
-##
-## Date and time functions Funciones de fecha y hora
-##
-DATE = FECHA ## Devuelve el número de serie correspondiente a una fecha determinada.
-DATEVALUE = FECHANUMERO ## Convierte una fecha con formato de texto en un valor de número de serie.
-DAY = DIA ## Convierte un número de serie en un valor de día del mes.
-DAYS360 = DIAS360 ## Calcula el número de días entre dos fechas a partir de un año de 360 días.
-EDATE = FECHA.MES ## Devuelve el número de serie de la fecha equivalente al número indicado de meses anteriores o posteriores a la fecha inicial.
-EOMONTH = FIN.MES ## Devuelve el número de serie correspondiente al último día del mes anterior o posterior a un número de meses especificado.
-HOUR = HORA ## Convierte un número de serie en un valor de hora.
-MINUTE = MINUTO ## Convierte un número de serie en un valor de minuto.
-MONTH = MES ## Convierte un número de serie en un valor de mes.
-NETWORKDAYS = DIAS.LAB ## Devuelve el número de todos los días laborables existentes entre dos fechas.
-NOW = AHORA ## Devuelve el número de serie correspondiente a la fecha y hora actuales.
-SECOND = SEGUNDO ## Convierte un número de serie en un valor de segundo.
-TIME = HORA ## Devuelve el número de serie correspondiente a una hora determinada.
-TIMEVALUE = HORANUMERO ## Convierte una hora con formato de texto en un valor de número de serie.
-TODAY = HOY ## Devuelve el número de serie correspondiente al día actual.
-WEEKDAY = DIASEM ## Convierte un número de serie en un valor de día de la semana.
-WEEKNUM = NUM.DE.SEMANA ## Convierte un número de serie en un número que representa el lugar numérico correspondiente a una semana de un año.
-WORKDAY = DIA.LAB ## Devuelve el número de serie de la fecha que tiene lugar antes o después de un número determinado de días laborables.
-YEAR = AÑO ## Convierte un número de serie en un valor de año.
-YEARFRAC = FRAC.AÑO ## Devuelve la fracción de año que representa el número total de días existentes entre el valor de fecha_inicial y el de fecha_final.
-
-
-##
-## Engineering functions Funciones de ingeniería
-##
-BESSELI = BESSELI ## Devuelve la función Bessel In(x) modificada.
-BESSELJ = BESSELJ ## Devuelve la función Bessel Jn(x).
-BESSELK = BESSELK ## Devuelve la función Bessel Kn(x) modificada.
-BESSELY = BESSELY ## Devuelve la función Bessel Yn(x).
-BIN2DEC = BIN.A.DEC ## Convierte un número binario en decimal.
-BIN2HEX = BIN.A.HEX ## Convierte un número binario en hexadecimal.
-BIN2OCT = BIN.A.OCT ## Convierte un número binario en octal.
-COMPLEX = COMPLEJO ## Convierte coeficientes reales e imaginarios en un número complejo.
-CONVERT = CONVERTIR ## Convierte un número de un sistema de medida a otro.
-DEC2BIN = DEC.A.BIN ## Convierte un número decimal en binario.
-DEC2HEX = DEC.A.HEX ## Convierte un número decimal en hexadecimal.
-DEC2OCT = DEC.A.OCT ## Convierte un número decimal en octal.
-DELTA = DELTA ## Comprueba si dos valores son iguales.
-ERF = FUN.ERROR ## Devuelve la función de error.
-ERFC = FUN.ERROR.COMPL ## Devuelve la función de error complementario.
-GESTEP = MAYOR.O.IGUAL ## Comprueba si un número es mayor que un valor de umbral.
-HEX2BIN = HEX.A.BIN ## Convierte un número hexadecimal en binario.
-HEX2DEC = HEX.A.DEC ## Convierte un número hexadecimal en decimal.
-HEX2OCT = HEX.A.OCT ## Convierte un número hexadecimal en octal.
-IMABS = IM.ABS ## Devuelve el valor absoluto (módulo) de un número complejo.
-IMAGINARY = IMAGINARIO ## Devuelve el coeficiente imaginario de un número complejo.
-IMARGUMENT = IM.ANGULO ## Devuelve el argumento theta, un ángulo expresado en radianes.
-IMCONJUGATE = IM.CONJUGADA ## Devuelve la conjugada compleja de un número complejo.
-IMCOS = IM.COS ## Devuelve el coseno de un número complejo.
-IMDIV = IM.DIV ## Devuelve el cociente de dos números complejos.
-IMEXP = IM.EXP ## Devuelve el valor exponencial de un número complejo.
-IMLN = IM.LN ## Devuelve el logaritmo natural (neperiano) de un número complejo.
-IMLOG10 = IM.LOG10 ## Devuelve el logaritmo en base 10 de un número complejo.
-IMLOG2 = IM.LOG2 ## Devuelve el logaritmo en base 2 de un número complejo.
-IMPOWER = IM.POT ## Devuelve un número complejo elevado a una potencia entera.
-IMPRODUCT = IM.PRODUCT ## Devuelve el producto de números complejos.
-IMREAL = IM.REAL ## Devuelve el coeficiente real de un número complejo.
-IMSIN = IM.SENO ## Devuelve el seno de un número complejo.
-IMSQRT = IM.RAIZ2 ## Devuelve la raíz cuadrada de un número complejo.
-IMSUB = IM.SUSTR ## Devuelve la diferencia entre dos números complejos.
-IMSUM = IM.SUM ## Devuelve la suma de números complejos.
-OCT2BIN = OCT.A.BIN ## Convierte un número octal en binario.
-OCT2DEC = OCT.A.DEC ## Convierte un número octal en decimal.
-OCT2HEX = OCT.A.HEX ## Convierte un número octal en hexadecimal.
-
-
-##
-## Financial functions Funciones financieras
-##
-ACCRINT = INT.ACUM ## Devuelve el interés acumulado de un valor bursátil con pagos de interés periódicos.
-ACCRINTM = INT.ACUM.V ## Devuelve el interés acumulado de un valor bursátil con pagos de interés al vencimiento.
-AMORDEGRC = AMORTIZ.PROGRE ## Devuelve la amortización de cada período contable mediante el uso de un coeficiente de amortización.
-AMORLINC = AMORTIZ.LIN ## Devuelve la amortización de cada uno de los períodos contables.
-COUPDAYBS = CUPON.DIAS.L1 ## Devuelve el número de días desde el principio del período de un cupón hasta la fecha de liquidación.
-COUPDAYS = CUPON.DIAS ## Devuelve el número de días del período (entre dos cupones) donde se encuentra la fecha de liquidación.
-COUPDAYSNC = CUPON.DIAS.L2 ## Devuelve el número de días desde la fecha de liquidación hasta la fecha del próximo cupón.
-COUPNCD = CUPON.FECHA.L2 ## Devuelve la fecha del próximo cupón después de la fecha de liquidación.
-COUPNUM = CUPON.NUM ## Devuelve el número de pagos de cupón entre la fecha de liquidación y la fecha de vencimiento.
-COUPPCD = CUPON.FECHA.L1 ## Devuelve la fecha de cupón anterior a la fecha de liquidación.
-CUMIPMT = PAGO.INT.ENTRE ## Devuelve el interés acumulado pagado entre dos períodos.
-CUMPRINC = PAGO.PRINC.ENTRE ## Devuelve el capital acumulado pagado de un préstamo entre dos períodos.
-DB = DB ## Devuelve la amortización de un bien durante un período específico a través del método de amortización de saldo fijo.
-DDB = DDB ## Devuelve la amortización de un bien durante un período específico a través del método de amortización por doble disminución de saldo u otro método que se especifique.
-DISC = TASA.DESC ## Devuelve la tasa de descuento de un valor bursátil.
-DOLLARDE = MONEDA.DEC ## Convierte una cotización de un valor bursátil expresada en forma fraccionaria en una cotización de un valor bursátil expresada en forma decimal.
-DOLLARFR = MONEDA.FRAC ## Convierte una cotización de un valor bursátil expresada en forma decimal en una cotización de un valor bursátil expresada en forma fraccionaria.
-DURATION = DURACION ## Devuelve la duración anual de un valor bursátil con pagos de interés periódico.
-EFFECT = INT.EFECTIVO ## Devuelve la tasa de interés anual efectiva.
-FV = VF ## Devuelve el valor futuro de una inversión.
-FVSCHEDULE = VF.PLAN ## Devuelve el valor futuro de un capital inicial después de aplicar una serie de tasas de interés compuesto.
-INTRATE = TASA.INT ## Devuelve la tasa de interés para la inversión total de un valor bursátil.
-IPMT = PAGOINT ## Devuelve el pago de intereses de una inversión durante un período determinado.
-IRR = TIR ## Devuelve la tasa interna de retorno para una serie de flujos de efectivo periódicos.
-ISPMT = INT.PAGO.DIR ## Calcula el interés pagado durante un período específico de una inversión.
-MDURATION = DURACION.MODIF ## Devuelve la duración de Macauley modificada de un valor bursátil con un valor nominal supuesto de 100 $.
-MIRR = TIRM ## Devuelve la tasa interna de retorno donde se financian flujos de efectivo positivos y negativos a tasas diferentes.
-NOMINAL = TASA.NOMINAL ## Devuelve la tasa nominal de interés anual.
-NPER = NPER ## Devuelve el número de períodos de una inversión.
-NPV = VNA ## Devuelve el valor neto actual de una inversión en función de una serie de flujos periódicos de efectivo y una tasa de descuento.
-ODDFPRICE = PRECIO.PER.IRREGULAR.1 ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil con un primer período impar.
-ODDFYIELD = RENDTO.PER.IRREGULAR.1 ## Devuelve el rendimiento de un valor bursátil con un primer período impar.
-ODDLPRICE = PRECIO.PER.IRREGULAR.2 ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil con un último período impar.
-ODDLYIELD = RENDTO.PER.IRREGULAR.2 ## Devuelve el rendimiento de un valor bursátil con un último período impar.
-PMT = PAGO ## Devuelve el pago periódico de una anualidad.
-PPMT = PAGOPRIN ## Devuelve el pago de capital de una inversión durante un período determinado.
-PRICE = PRECIO ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil que paga una tasa de interés periódico.
-PRICEDISC = PRECIO.DESCUENTO ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil con descuento.
-PRICEMAT = PRECIO.VENCIMIENTO ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil que paga interés a su vencimiento.
-PV = VALACT ## Devuelve el valor actual de una inversión.
-RATE = TASA ## Devuelve la tasa de interés por período de una anualidad.
-RECEIVED = CANTIDAD.RECIBIDA ## Devuelve la cantidad recibida al vencimiento de un valor bursátil completamente invertido.
-SLN = SLN ## Devuelve la amortización por método directo de un bien en un período dado.
-SYD = SYD ## Devuelve la amortización por suma de dígitos de los años de un bien durante un período especificado.
-TBILLEQ = LETRA.DE.TES.EQV.A.BONO ## Devuelve el rendimiento de un bono equivalente a una letra del Tesoro (de EE.UU.)
-TBILLPRICE = LETRA.DE.TES.PRECIO ## Devuelve el precio por un valor nominal de 100 $ de una letra del Tesoro (de EE.UU.)
-TBILLYIELD = LETRA.DE.TES.RENDTO ## Devuelve el rendimiento de una letra del Tesoro (de EE.UU.)
-VDB = DVS ## Devuelve la amortización de un bien durante un período específico o parcial a través del método de cálculo del saldo en disminución.
-XIRR = TIR.NO.PER ## Devuelve la tasa interna de retorno para un flujo de efectivo que no es necesariamente periódico.
-XNPV = VNA.NO.PER ## Devuelve el valor neto actual para un flujo de efectivo que no es necesariamente periódico.
-YIELD = RENDTO ## Devuelve el rendimiento de un valor bursátil que paga intereses periódicos.
-YIELDDISC = RENDTO.DESC ## Devuelve el rendimiento anual de un valor bursátil con descuento; por ejemplo, una letra del Tesoro (de EE.UU.)
-YIELDMAT = RENDTO.VENCTO ## Devuelve el rendimiento anual de un valor bursátil que paga intereses al vencimiento.
-
-
-##
-## Information functions Funciones de información
-##
-CELL = CELDA ## Devuelve información acerca del formato, la ubicación o el contenido de una celda.
-ERROR.TYPE = TIPO.DE.ERROR ## Devuelve un número que corresponde a un tipo de error.
-INFO = INFO ## Devuelve información acerca del entorno operativo en uso.
-ISBLANK = ESBLANCO ## Devuelve VERDADERO si el valor está en blanco.
-ISERR = ESERR ## Devuelve VERDADERO si el valor es cualquier valor de error excepto #N/A.
-ISERROR = ESERROR ## Devuelve VERDADERO si el valor es cualquier valor de error.
-ISEVEN = ES.PAR ## Devuelve VERDADERO si el número es par.
-ISLOGICAL = ESLOGICO ## Devuelve VERDADERO si el valor es un valor lógico.
-ISNA = ESNOD ## Devuelve VERDADERO si el valor es el valor de error #N/A.
-ISNONTEXT = ESNOTEXTO ## Devuelve VERDADERO si el valor no es texto.
-ISNUMBER = ESNUMERO ## Devuelve VERDADERO si el valor es un número.
-ISODD = ES.IMPAR ## Devuelve VERDADERO si el número es impar.
-ISREF = ESREF ## Devuelve VERDADERO si el valor es una referencia.
-ISTEXT = ESTEXTO ## Devuelve VERDADERO si el valor es texto.
-N = N ## Devuelve un valor convertido en un número.
-NA = ND ## Devuelve el valor de error #N/A.
-TYPE = TIPO ## Devuelve un número que indica el tipo de datos de un valor.
-
-
-##
-## Logical functions Funciones lógicas
-##
-AND = Y ## Devuelve VERDADERO si todos sus argumentos son VERDADERO.
-FALSE = FALSO ## Devuelve el valor lógico FALSO.
-IF = SI ## Especifica una prueba lógica que realizar.
-IFERROR = SI.ERROR ## Devuelve un valor que se especifica si una fórmula lo evalúa como un error; de lo contrario, devuelve el resultado de la fórmula.
-NOT = NO ## Invierte el valor lógico del argumento.
-OR = O ## Devuelve VERDADERO si cualquier argumento es VERDADERO.
-TRUE = VERDADERO ## Devuelve el valor lógico VERDADERO.
-
-
-##
-## Lookup and reference functions Funciones de búsqueda y referencia
-##
-ADDRESS = DIRECCION ## Devuelve una referencia como texto a una sola celda de una hoja de cálculo.
-AREAS = AREAS ## Devuelve el número de áreas de una referencia.
-CHOOSE = ELEGIR ## Elige un valor de una lista de valores.
-COLUMN = COLUMNA ## Devuelve el número de columna de una referencia.
-COLUMNS = COLUMNAS ## Devuelve el número de columnas de una referencia.
-HLOOKUP = BUSCARH ## Busca en la fila superior de una matriz y devuelve el valor de la celda indicada.
-HYPERLINK = HIPERVINCULO ## Crea un acceso directo o un salto que abre un documento almacenado en un servidor de red, en una intranet o en Internet.
-INDEX = INDICE ## Usa un índice para elegir un valor de una referencia o matriz.
-INDIRECT = INDIRECTO ## Devuelve una referencia indicada por un valor de texto.
-LOOKUP = BUSCAR ## Busca valores de un vector o una matriz.
-MATCH = COINCIDIR ## Busca valores de una referencia o matriz.
-OFFSET = DESREF ## Devuelve un desplazamiento de referencia respecto a una referencia dada.
-ROW = FILA ## Devuelve el número de fila de una referencia.
-ROWS = FILAS ## Devuelve el número de filas de una referencia.
-RTD = RDTR ## Recupera datos en tiempo real desde un programa compatible con la automatización COM (automatización: modo de trabajar con los objetos de una aplicación desde otra aplicación o herramienta de entorno. La automatización, antes denominada automatización OLE, es un estándar de la industria y una función del Modelo de objetos componentes (COM).).
-TRANSPOSE = TRANSPONER ## Devuelve la transposición de una matriz.
-VLOOKUP = BUSCARV ## Busca en la primera columna de una matriz y se mueve en horizontal por la fila para devolver el valor de una celda.
-
-
-##
-## Math and trigonometry functions Funciones matemáticas y trigonométricas
-##
-ABS = ABS ## Devuelve el valor absoluto de un número.
-ACOS = ACOS ## Devuelve el arcocoseno de un número.
-ACOSH = ACOSH ## Devuelve el coseno hiperbólico inverso de un número.
-ASIN = ASENO ## Devuelve el arcoseno de un número.
-ASINH = ASENOH ## Devuelve el seno hiperbólico inverso de un número.
-ATAN = ATAN ## Devuelve la arcotangente de un número.
-ATAN2 = ATAN2 ## Devuelve la arcotangente de las coordenadas "x" e "y".
-ATANH = ATANH ## Devuelve la tangente hiperbólica inversa de un número.
-CEILING = MULTIPLO.SUPERIOR ## Redondea un número al entero más próximo o al múltiplo significativo más cercano.
-COMBIN = COMBINAT ## Devuelve el número de combinaciones para un número determinado de objetos.
-COS = COS ## Devuelve el coseno de un número.
-COSH = COSH ## Devuelve el coseno hiperbólico de un número.
-DEGREES = GRADOS ## Convierte radianes en grados.
-EVEN = REDONDEA.PAR ## Redondea un número hasta el entero par más próximo.
-EXP = EXP ## Devuelve e elevado a la potencia de un número dado.
-FACT = FACT ## Devuelve el factorial de un número.
-FACTDOUBLE = FACT.DOBLE ## Devuelve el factorial doble de un número.
-FLOOR = MULTIPLO.INFERIOR ## Redondea un número hacia abajo, en dirección hacia cero.
-GCD = M.C.D ## Devuelve el máximo común divisor.
-INT = ENTERO ## Redondea un número hacia abajo hasta el entero más próximo.
-LCM = M.C.M ## Devuelve el mínimo común múltiplo.
-LN = LN ## Devuelve el logaritmo natural (neperiano) de un número.
-LOG = LOG ## Devuelve el logaritmo de un número en una base especificada.
-LOG10 = LOG10 ## Devuelve el logaritmo en base 10 de un número.
-MDETERM = MDETERM ## Devuelve la determinante matricial de una matriz.
-MINVERSE = MINVERSA ## Devuelve la matriz inversa de una matriz.
-MMULT = MMULT ## Devuelve el producto de matriz de dos matrices.
-MOD = RESIDUO ## Devuelve el resto de la división.
-MROUND = REDOND.MULT ## Devuelve un número redondeado al múltiplo deseado.
-MULTINOMIAL = MULTINOMIAL ## Devuelve el polinomio de un conjunto de números.
-ODD = REDONDEA.IMPAR ## Redondea un número hacia arriba hasta el entero impar más próximo.
-PI = PI ## Devuelve el valor de pi.
-POWER = POTENCIA ## Devuelve el resultado de elevar un número a una potencia.
-PRODUCT = PRODUCTO ## Multiplica sus argumentos.
-QUOTIENT = COCIENTE ## Devuelve la parte entera de una división.
-RADIANS = RADIANES ## Convierte grados en radianes.
-RAND = ALEATORIO ## Devuelve un número aleatorio entre 0 y 1.
-RANDBETWEEN = ALEATORIO.ENTRE ## Devuelve un número aleatorio entre los números que especifique.
-ROMAN = NUMERO.ROMANO ## Convierte un número arábigo en número romano, con formato de texto.
-ROUND = REDONDEAR ## Redondea un número al número de decimales especificado.
-ROUNDDOWN = REDONDEAR.MENOS ## Redondea un número hacia abajo, en dirección hacia cero.
-ROUNDUP = REDONDEAR.MAS ## Redondea un número hacia arriba, en dirección contraria a cero.
-SERIESSUM = SUMA.SERIES ## Devuelve la suma de una serie de potencias en función de la fórmula.
-SIGN = SIGNO ## Devuelve el signo de un número.
-SIN = SENO ## Devuelve el seno de un ángulo determinado.
-SINH = SENOH ## Devuelve el seno hiperbólico de un número.
-SQRT = RAIZ ## Devuelve la raíz cuadrada positiva de un número.
-SQRTPI = RAIZ2PI ## Devuelve la raíz cuadrada de un número multiplicado por PI (número * pi).
-SUBTOTAL = SUBTOTALES ## Devuelve un subtotal en una lista o base de datos.
-SUM = SUMA ## Suma sus argumentos.
-SUMIF = SUMAR.SI ## Suma las celdas especificadas que cumplen unos criterios determinados.
-SUMIFS = SUMAR.SI.CONJUNTO ## Suma las celdas de un rango que cumplen varios criterios.
-SUMPRODUCT = SUMAPRODUCTO ## Devuelve la suma de los productos de los correspondientes componentes de matriz.
-SUMSQ = SUMA.CUADRADOS ## Devuelve la suma de los cuadrados de los argumentos.
-SUMX2MY2 = SUMAX2MENOSY2 ## Devuelve la suma de la diferencia de los cuadrados de los valores correspondientes de dos matrices.
-SUMX2PY2 = SUMAX2MASY2 ## Devuelve la suma de la suma de los cuadrados de los valores correspondientes de dos matrices.
-SUMXMY2 = SUMAXMENOSY2 ## Devuelve la suma de los cuadrados de las diferencias de los valores correspondientes de dos matrices.
-TAN = TAN ## Devuelve la tangente de un número.
-TANH = TANH ## Devuelve la tangente hiperbólica de un número.
-TRUNC = TRUNCAR ## Trunca un número a un entero.
-
-
-##
-## Statistical functions Funciones estadísticas
-##
-AVEDEV = DESVPROM ## Devuelve el promedio de las desviaciones absolutas de la media de los puntos de datos.
-AVERAGE = PROMEDIO ## Devuelve el promedio de sus argumentos.
-AVERAGEA = PROMEDIOA ## Devuelve el promedio de sus argumentos, incluidos números, texto y valores lógicos.
-AVERAGEIF = PROMEDIO.SI ## Devuelve el promedio (media aritmética) de todas las celdas de un rango que cumplen unos criterios determinados.
-AVERAGEIFS = PROMEDIO.SI.CONJUNTO ## Devuelve el promedio (media aritmética) de todas las celdas que cumplen múltiples criterios.
-BETADIST = DISTR.BETA ## Devuelve la función de distribución beta acumulativa.
-BETAINV = DISTR.BETA.INV ## Devuelve la función inversa de la función de distribución acumulativa de una distribución beta especificada.
-BINOMDIST = DISTR.BINOM ## Devuelve la probabilidad de una variable aleatoria discreta siguiendo una distribución binomial.
-CHIDIST = DISTR.CHI ## Devuelve la probabilidad de una variable aleatoria continua siguiendo una distribución chi cuadrado de una sola cola.
-CHIINV = PRUEBA.CHI.INV ## Devuelve la función inversa de la probabilidad de una variable aleatoria continua siguiendo una distribución chi cuadrado de una sola cola.
-CHITEST = PRUEBA.CHI ## Devuelve la prueba de independencia.
-CONFIDENCE = INTERVALO.CONFIANZA ## Devuelve el intervalo de confianza de la media de una población.
-CORREL = COEF.DE.CORREL ## Devuelve el coeficiente de correlación entre dos conjuntos de datos.
-COUNT = CONTAR ## Cuenta cuántos números hay en la lista de argumentos.
-COUNTA = CONTARA ## Cuenta cuántos valores hay en la lista de argumentos.
-COUNTBLANK = CONTAR.BLANCO ## Cuenta el número de celdas en blanco de un rango.
-COUNTIF = CONTAR.SI ## Cuenta el número de celdas, dentro del rango, que cumplen el criterio especificado.
-COUNTIFS = CONTAR.SI.CONJUNTO ## Cuenta el número de celdas, dentro del rango, que cumplen varios criterios.
-COVAR = COVAR ## Devuelve la covarianza, que es el promedio de los productos de las desviaciones para cada pareja de puntos de datos.
-CRITBINOM = BINOM.CRIT ## Devuelve el menor valor cuya distribución binomial acumulativa es menor o igual a un valor de criterio.
-DEVSQ = DESVIA2 ## Devuelve la suma de los cuadrados de las desviaciones.
-EXPONDIST = DISTR.EXP ## Devuelve la distribución exponencial.
-FDIST = DISTR.F ## Devuelve la distribución de probabilidad F.
-FINV = DISTR.F.INV ## Devuelve la función inversa de la distribución de probabilidad F.
-FISHER = FISHER ## Devuelve la transformación Fisher.
-FISHERINV = PRUEBA.FISHER.INV ## Devuelve la función inversa de la transformación Fisher.
-FORECAST = PRONOSTICO ## Devuelve un valor en una tendencia lineal.
-FREQUENCY = FRECUENCIA ## Devuelve una distribución de frecuencia como una matriz vertical.
-FTEST = PRUEBA.F ## Devuelve el resultado de una prueba F.
-GAMMADIST = DISTR.GAMMA ## Devuelve la distribución gamma.
-GAMMAINV = DISTR.GAMMA.INV ## Devuelve la función inversa de la distribución gamma acumulativa.
-GAMMALN = GAMMA.LN ## Devuelve el logaritmo natural de la función gamma, G(x).
-GEOMEAN = MEDIA.GEOM ## Devuelve la media geométrica.
-GROWTH = CRECIMIENTO ## Devuelve valores en una tendencia exponencial.
-HARMEAN = MEDIA.ARMO ## Devuelve la media armónica.
-HYPGEOMDIST = DISTR.HIPERGEOM ## Devuelve la distribución hipergeométrica.
-INTERCEPT = INTERSECCION.EJE ## Devuelve la intersección de la línea de regresión lineal.
-KURT = CURTOSIS ## Devuelve la curtosis de un conjunto de datos.
-LARGE = K.ESIMO.MAYOR ## Devuelve el k-ésimo mayor valor de un conjunto de datos.
-LINEST = ESTIMACION.LINEAL ## Devuelve los parámetros de una tendencia lineal.
-LOGEST = ESTIMACION.LOGARITMICA ## Devuelve los parámetros de una tendencia exponencial.
-LOGINV = DISTR.LOG.INV ## Devuelve la función inversa de la distribución logarítmico-normal.
-LOGNORMDIST = DISTR.LOG.NORM ## Devuelve la distribución logarítmico-normal acumulativa.
-MAX = MAX ## Devuelve el valor máximo de una lista de argumentos.
-MAXA = MAXA ## Devuelve el valor máximo de una lista de argumentos, incluidos números, texto y valores lógicos.
-MEDIAN = MEDIANA ## Devuelve la mediana de los números dados.
-MIN = MIN ## Devuelve el valor mínimo de una lista de argumentos.
-MINA = MINA ## Devuelve el valor mínimo de una lista de argumentos, incluidos números, texto y valores lógicos.
-MODE = MODA ## Devuelve el valor más común de un conjunto de datos.
-NEGBINOMDIST = NEGBINOMDIST ## Devuelve la distribución binomial negativa.
-NORMDIST = DISTR.NORM ## Devuelve la distribución normal acumulativa.
-NORMINV = DISTR.NORM.INV ## Devuelve la función inversa de la distribución normal acumulativa.
-NORMSDIST = DISTR.NORM.ESTAND ## Devuelve la distribución normal estándar acumulativa.
-NORMSINV = DISTR.NORM.ESTAND.INV ## Devuelve la función inversa de la distribución normal estándar acumulativa.
-PEARSON = PEARSON ## Devuelve el coeficiente de momento de correlación de producto Pearson.
-PERCENTILE = PERCENTIL ## Devuelve el k-ésimo percentil de los valores de un rango.
-PERCENTRANK = RANGO.PERCENTIL ## Devuelve el rango porcentual de un valor de un conjunto de datos.
-PERMUT = PERMUTACIONES ## Devuelve el número de permutaciones de un número determinado de objetos.
-POISSON = POISSON ## Devuelve la distribución de Poisson.
-PROB = PROBABILIDAD ## Devuelve la probabilidad de que los valores de un rango se encuentren entre dos límites.
-QUARTILE = CUARTIL ## Devuelve el cuartil de un conjunto de datos.
-RANK = JERARQUIA ## Devuelve la jerarquía de un número en una lista de números.
-RSQ = COEFICIENTE.R2 ## Devuelve el cuadrado del coeficiente de momento de correlación de producto Pearson.
-SKEW = COEFICIENTE.ASIMETRIA ## Devuelve la asimetría de una distribución.
-SLOPE = PENDIENTE ## Devuelve la pendiente de la línea de regresión lineal.
-SMALL = K.ESIMO.MENOR ## Devuelve el k-ésimo menor valor de un conjunto de datos.
-STANDARDIZE = NORMALIZACION ## Devuelve un valor normalizado.
-STDEV = DESVEST ## Calcula la desviación estándar a partir de una muestra.
-STDEVA = DESVESTA ## Calcula la desviación estándar a partir de una muestra, incluidos números, texto y valores lógicos.
-STDEVP = DESVESTP ## Calcula la desviación estándar en función de toda la población.
-STDEVPA = DESVESTPA ## Calcula la desviación estándar en función de toda la población, incluidos números, texto y valores lógicos.
-STEYX = ERROR.TIPICO.XY ## Devuelve el error estándar del valor de "y" previsto para cada "x" de la regresión.
-TDIST = DISTR.T ## Devuelve la distribución de t de Student.
-TINV = DISTR.T.INV ## Devuelve la función inversa de la distribución de t de Student.
-TREND = TENDENCIA ## Devuelve valores en una tendencia lineal.
-TRIMMEAN = MEDIA.ACOTADA ## Devuelve la media del interior de un conjunto de datos.
-TTEST = PRUEBA.T ## Devuelve la probabilidad asociada a una prueba t de Student.
-VAR = VAR ## Calcula la varianza en función de una muestra.
-VARA = VARA ## Calcula la varianza en función de una muestra, incluidos números, texto y valores lógicos.
-VARP = VARP ## Calcula la varianza en función de toda la población.
-VARPA = VARPA ## Calcula la varianza en función de toda la población, incluidos números, texto y valores lógicos.
-WEIBULL = DIST.WEIBULL ## Devuelve la distribución de Weibull.
-ZTEST = PRUEBA.Z ## Devuelve el valor de una probabilidad de una cola de una prueba z.
-
-
-##
-## Text functions Funciones de texto
-##
-ASC = ASC ## Convierte las letras inglesas o katakana de ancho completo (de dos bytes) dentro de una cadena de caracteres en caracteres de ancho medio (de un byte).
-BAHTTEXT = TEXTOBAHT ## Convierte un número en texto, con el formato de moneda ß (Baht).
-CHAR = CARACTER ## Devuelve el carácter especificado por el número de código.
-CLEAN = LIMPIAR ## Quita del texto todos los caracteres no imprimibles.
-CODE = CODIGO ## Devuelve un código numérico del primer carácter de una cadena de texto.
-CONCATENATE = CONCATENAR ## Concatena varios elementos de texto en uno solo.
-DOLLAR = MONEDA ## Convierte un número en texto, con el formato de moneda $ (dólar).
-EXACT = IGUAL ## Comprueba si dos valores de texto son idénticos.
-FIND = ENCONTRAR ## Busca un valor de texto dentro de otro (distingue mayúsculas de minúsculas).
-FINDB = ENCONTRARB ## Busca un valor de texto dentro de otro (distingue mayúsculas de minúsculas).
-FIXED = DECIMAL ## Da formato a un número como texto con un número fijo de decimales.
-JIS = JIS ## Convierte las letras inglesas o katakana de ancho medio (de un byte) dentro de una cadena de caracteres en caracteres de ancho completo (de dos bytes).
-LEFT = IZQUIERDA ## Devuelve los caracteres del lado izquierdo de un valor de texto.
-LEFTB = IZQUIERDAB ## Devuelve los caracteres del lado izquierdo de un valor de texto.
-LEN = LARGO ## Devuelve el número de caracteres de una cadena de texto.
-LENB = LARGOB ## Devuelve el número de caracteres de una cadena de texto.
-LOWER = MINUSC ## Pone el texto en minúsculas.
-MID = EXTRAE ## Devuelve un número específico de caracteres de una cadena de texto que comienza en la posición que se especifique.
-MIDB = EXTRAEB ## Devuelve un número específico de caracteres de una cadena de texto que comienza en la posición que se especifique.
-PHONETIC = FONETICO ## Extrae los caracteres fonéticos (furigana) de una cadena de texto.
-PROPER = NOMPROPIO ## Pone en mayúscula la primera letra de cada palabra de un valor de texto.
-REPLACE = REEMPLAZAR ## Reemplaza caracteres de texto.
-REPLACEB = REEMPLAZARB ## Reemplaza caracteres de texto.
-REPT = REPETIR ## Repite el texto un número determinado de veces.
-RIGHT = DERECHA ## Devuelve los caracteres del lado derecho de un valor de texto.
-RIGHTB = DERECHAB ## Devuelve los caracteres del lado derecho de un valor de texto.
-SEARCH = HALLAR ## Busca un valor de texto dentro de otro (no distingue mayúsculas de minúsculas).
-SEARCHB = HALLARB ## Busca un valor de texto dentro de otro (no distingue mayúsculas de minúsculas).
-SUBSTITUTE = SUSTITUIR ## Sustituye texto nuevo por texto antiguo en una cadena de texto.
-T = T ## Convierte sus argumentos a texto.
-TEXT = TEXTO ## Da formato a un número y lo convierte en texto.
-TRIM = ESPACIOS ## Quita los espacios del texto.
-UPPER = MAYUSC ## Pone el texto en mayúsculas.
-VALUE = VALOR ## Convierte un argumento de texto en un número.
+##
+## PhpSpreadsheet
+##
+## Data in this file derived from https://www.excel-function-translation.com/
+##
+##
+
+
+##
+## Add-in and Automation functions Funciones de complementos y automatización
+##
+GETPIVOTDATA = IMPORTARDATOSDINAMICOS ## Devuelve los datos almacenados en un informe de tabla dinámica.
+
+
+##
+## Cube functions Funciones de cubo
+##
+CUBEKPIMEMBER = MIEMBROKPICUBO ## Devuelve un nombre, propiedad y medida de indicador de rendimiento clave (KPI) y muestra el nombre y la propiedad en la celda. Un KPI es una medida cuantificable, como los beneficios brutos mensuales o la facturación trimestral por empleado, que se usa para supervisar el rendimiento de una organización.
+CUBEMEMBER = MIEMBROCUBO ## Devuelve un miembro o tupla en una jerarquía de cubo. Se usa para validar la existencia del miembro o la tupla en el cubo.
+CUBEMEMBERPROPERTY = PROPIEDADMIEMBROCUBO ## Devuelve el valor de una propiedad de miembro del cubo Se usa para validar la existencia de un nombre de miembro en el cubo y para devolver la propiedad especificada para este miembro.
+CUBERANKEDMEMBER = MIEMBRORANGOCUBO ## Devuelve el miembro n, o clasificado, de un conjunto. Se usa para devolver uno o más elementos de un conjunto, por ejemplo, el representante con mejores ventas o los diez mejores alumnos.
+CUBESET = CONJUNTOCUBO ## Define un conjunto calculado de miembros o tuplas mediante el envío de una expresión de conjunto al cubo en el servidor, lo que crea el conjunto y, después, devuelve dicho conjunto a Microsoft Office Excel.
+CUBESETCOUNT = RECUENTOCONJUNTOCUBO ## Devuelve el número de elementos de un conjunto.
+CUBEVALUE = VALORCUBO ## Devuelve un valor agregado de un cubo.
+
+
+##
+## Database functions Funciones de base de datos
+##
+DAVERAGE = BDPROMEDIO ## Devuelve el promedio de las entradas seleccionadas en la base de datos.
+DCOUNT = BDCONTAR ## Cuenta el número de celdas que contienen números en una base de datos.
+DCOUNTA = BDCONTARA ## Cuenta el número de celdas no vacías en una base de datos.
+DGET = BDEXTRAER ## Extrae de una base de datos un único registro que cumple los criterios especificados.
+DMAX = BDMAX ## Devuelve el valor máximo de las entradas seleccionadas de la base de datos.
+DMIN = BDMIN ## Devuelve el valor mínimo de las entradas seleccionadas de la base de datos.
+DPRODUCT = BDPRODUCTO ## Multiplica los valores de un campo concreto de registros de una base de datos que cumplen los criterios especificados.
+DSTDEV = BDDESVEST ## Calcula la desviación estándar a partir de una muestra de entradas seleccionadas en la base de datos.
+DSTDEVP = BDDESVESTP ## Calcula la desviación estándar en función de la población total de las entradas seleccionadas de la base de datos.
+DSUM = BDSUMA ## Suma los números de la columna de campo de los registros de la base de datos que cumplen los criterios.
+DVAR = BDVAR ## Calcula la varianza a partir de una muestra de entradas seleccionadas de la base de datos.
+DVARP = BDVARP ## Calcula la varianza a partir de la población total de entradas seleccionadas de la base de datos.
+
+
+##
+## Date and time functions Funciones de fecha y hora
+##
+DATE = FECHA ## Devuelve el número de serie correspondiente a una fecha determinada.
+DATEVALUE = FECHANUMERO ## Convierte una fecha con formato de texto en un valor de número de serie.
+DAY = DIA ## Convierte un número de serie en un valor de día del mes.
+DAYS360 = DIAS360 ## Calcula el número de días entre dos fechas a partir de un año de 360 días.
+EDATE = FECHA.MES ## Devuelve el número de serie de la fecha equivalente al número indicado de meses anteriores o posteriores a la fecha inicial.
+EOMONTH = FIN.MES ## Devuelve el número de serie correspondiente al último día del mes anterior o posterior a un número de meses especificado.
+HOUR = HORA ## Convierte un número de serie en un valor de hora.
+MINUTE = MINUTO ## Convierte un número de serie en un valor de minuto.
+MONTH = MES ## Convierte un número de serie en un valor de mes.
+NETWORKDAYS = DIAS.LAB ## Devuelve el número de todos los días laborables existentes entre dos fechas.
+NOW = AHORA ## Devuelve el número de serie correspondiente a la fecha y hora actuales.
+SECOND = SEGUNDO ## Convierte un número de serie en un valor de segundo.
+TIME = HORA ## Devuelve el número de serie correspondiente a una hora determinada.
+TIMEVALUE = HORANUMERO ## Convierte una hora con formato de texto en un valor de número de serie.
+TODAY = HOY ## Devuelve el número de serie correspondiente al día actual.
+WEEKDAY = DIASEM ## Convierte un número de serie en un valor de día de la semana.
+WEEKNUM = NUM.DE.SEMANA ## Convierte un número de serie en un número que representa el lugar numérico correspondiente a una semana de un año.
+WORKDAY = DIA.LAB ## Devuelve el número de serie de la fecha que tiene lugar antes o después de un número determinado de días laborables.
+YEAR = AÑO ## Convierte un número de serie en un valor de año.
+YEARFRAC = FRAC.AÑO ## Devuelve la fracción de año que representa el número total de días existentes entre el valor de fecha_inicial y el de fecha_final.
+
+
+##
+## Engineering functions Funciones de ingeniería
+##
+BESSELI = BESSELI ## Devuelve la función Bessel In(x) modificada.
+BESSELJ = BESSELJ ## Devuelve la función Bessel Jn(x).
+BESSELK = BESSELK ## Devuelve la función Bessel Kn(x) modificada.
+BESSELY = BESSELY ## Devuelve la función Bessel Yn(x).
+BIN2DEC = BIN.A.DEC ## Convierte un número binario en decimal.
+BIN2HEX = BIN.A.HEX ## Convierte un número binario en hexadecimal.
+BIN2OCT = BIN.A.OCT ## Convierte un número binario en octal.
+COMPLEX = COMPLEJO ## Convierte coeficientes reales e imaginarios en un número complejo.
+CONVERT = CONVERTIR ## Convierte un número de un sistema de medida a otro.
+DEC2BIN = DEC.A.BIN ## Convierte un número decimal en binario.
+DEC2HEX = DEC.A.HEX ## Convierte un número decimal en hexadecimal.
+DEC2OCT = DEC.A.OCT ## Convierte un número decimal en octal.
+DELTA = DELTA ## Comprueba si dos valores son iguales.
+ERF = FUN.ERROR ## Devuelve la función de error.
+ERFC = FUN.ERROR.COMPL ## Devuelve la función de error complementario.
+GESTEP = MAYOR.O.IGUAL ## Comprueba si un número es mayor que un valor de umbral.
+HEX2BIN = HEX.A.BIN ## Convierte un número hexadecimal en binario.
+HEX2DEC = HEX.A.DEC ## Convierte un número hexadecimal en decimal.
+HEX2OCT = HEX.A.OCT ## Convierte un número hexadecimal en octal.
+IMABS = IM.ABS ## Devuelve el valor absoluto (módulo) de un número complejo.
+IMAGINARY = IMAGINARIO ## Devuelve el coeficiente imaginario de un número complejo.
+IMARGUMENT = IM.ANGULO ## Devuelve el argumento theta, un ángulo expresado en radianes.
+IMCONJUGATE = IM.CONJUGADA ## Devuelve la conjugada compleja de un número complejo.
+IMCOS = IM.COS ## Devuelve el coseno de un número complejo.
+IMDIV = IM.DIV ## Devuelve el cociente de dos números complejos.
+IMEXP = IM.EXP ## Devuelve el valor exponencial de un número complejo.
+IMLN = IM.LN ## Devuelve el logaritmo natural (neperiano) de un número complejo.
+IMLOG10 = IM.LOG10 ## Devuelve el logaritmo en base 10 de un número complejo.
+IMLOG2 = IM.LOG2 ## Devuelve el logaritmo en base 2 de un número complejo.
+IMPOWER = IM.POT ## Devuelve un número complejo elevado a una potencia entera.
+IMPRODUCT = IM.PRODUCT ## Devuelve el producto de números complejos.
+IMREAL = IM.REAL ## Devuelve el coeficiente real de un número complejo.
+IMSIN = IM.SENO ## Devuelve el seno de un número complejo.
+IMSQRT = IM.RAIZ2 ## Devuelve la raíz cuadrada de un número complejo.
+IMSUB = IM.SUSTR ## Devuelve la diferencia entre dos números complejos.
+IMSUM = IM.SUM ## Devuelve la suma de números complejos.
+OCT2BIN = OCT.A.BIN ## Convierte un número octal en binario.
+OCT2DEC = OCT.A.DEC ## Convierte un número octal en decimal.
+OCT2HEX = OCT.A.HEX ## Convierte un número octal en hexadecimal.
+
+
+##
+## Financial functions Funciones financieras
+##
+ACCRINT = INT.ACUM ## Devuelve el interés acumulado de un valor bursátil con pagos de interés periódicos.
+ACCRINTM = INT.ACUM.V ## Devuelve el interés acumulado de un valor bursátil con pagos de interés al vencimiento.
+AMORDEGRC = AMORTIZ.PROGRE ## Devuelve la amortización de cada período contable mediante el uso de un coeficiente de amortización.
+AMORLINC = AMORTIZ.LIN ## Devuelve la amortización de cada uno de los períodos contables.
+COUPDAYBS = CUPON.DIAS.L1 ## Devuelve el número de días desde el principio del período de un cupón hasta la fecha de liquidación.
+COUPDAYS = CUPON.DIAS ## Devuelve el número de días del período (entre dos cupones) donde se encuentra la fecha de liquidación.
+COUPDAYSNC = CUPON.DIAS.L2 ## Devuelve el número de días desde la fecha de liquidación hasta la fecha del próximo cupón.
+COUPNCD = CUPON.FECHA.L2 ## Devuelve la fecha del próximo cupón después de la fecha de liquidación.
+COUPNUM = CUPON.NUM ## Devuelve el número de pagos de cupón entre la fecha de liquidación y la fecha de vencimiento.
+COUPPCD = CUPON.FECHA.L1 ## Devuelve la fecha de cupón anterior a la fecha de liquidación.
+CUMIPMT = PAGO.INT.ENTRE ## Devuelve el interés acumulado pagado entre dos períodos.
+CUMPRINC = PAGO.PRINC.ENTRE ## Devuelve el capital acumulado pagado de un préstamo entre dos períodos.
+DB = DB ## Devuelve la amortización de un bien durante un período específico a través del método de amortización de saldo fijo.
+DDB = DDB ## Devuelve la amortización de un bien durante un período específico a través del método de amortización por doble disminución de saldo u otro método que se especifique.
+DISC = TASA.DESC ## Devuelve la tasa de descuento de un valor bursátil.
+DOLLARDE = MONEDA.DEC ## Convierte una cotización de un valor bursátil expresada en forma fraccionaria en una cotización de un valor bursátil expresada en forma decimal.
+DOLLARFR = MONEDA.FRAC ## Convierte una cotización de un valor bursátil expresada en forma decimal en una cotización de un valor bursátil expresada en forma fraccionaria.
+DURATION = DURACION ## Devuelve la duración anual de un valor bursátil con pagos de interés periódico.
+EFFECT = INT.EFECTIVO ## Devuelve la tasa de interés anual efectiva.
+FV = VF ## Devuelve el valor futuro de una inversión.
+FVSCHEDULE = VF.PLAN ## Devuelve el valor futuro de un capital inicial después de aplicar una serie de tasas de interés compuesto.
+INTRATE = TASA.INT ## Devuelve la tasa de interés para la inversión total de un valor bursátil.
+IPMT = PAGOINT ## Devuelve el pago de intereses de una inversión durante un período determinado.
+IRR = TIR ## Devuelve la tasa interna de retorno para una serie de flujos de efectivo periódicos.
+ISPMT = INT.PAGO.DIR ## Calcula el interés pagado durante un período específico de una inversión.
+MDURATION = DURACION.MODIF ## Devuelve la duración de Macauley modificada de un valor bursátil con un valor nominal supuesto de 100 $.
+MIRR = TIRM ## Devuelve la tasa interna de retorno donde se financian flujos de efectivo positivos y negativos a tasas diferentes.
+NOMINAL = TASA.NOMINAL ## Devuelve la tasa nominal de interés anual.
+NPER = NPER ## Devuelve el número de períodos de una inversión.
+NPV = VNA ## Devuelve el valor neto actual de una inversión en función de una serie de flujos periódicos de efectivo y una tasa de descuento.
+ODDFPRICE = PRECIO.PER.IRREGULAR.1 ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil con un primer período impar.
+ODDFYIELD = RENDTO.PER.IRREGULAR.1 ## Devuelve el rendimiento de un valor bursátil con un primer período impar.
+ODDLPRICE = PRECIO.PER.IRREGULAR.2 ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil con un último período impar.
+ODDLYIELD = RENDTO.PER.IRREGULAR.2 ## Devuelve el rendimiento de un valor bursátil con un último período impar.
+PMT = PAGO ## Devuelve el pago periódico de una anualidad.
+PPMT = PAGOPRIN ## Devuelve el pago de capital de una inversión durante un período determinado.
+PRICE = PRECIO ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil que paga una tasa de interés periódico.
+PRICEDISC = PRECIO.DESCUENTO ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil con descuento.
+PRICEMAT = PRECIO.VENCIMIENTO ## Devuelve el precio por un valor nominal de 100 $ de un valor bursátil que paga interés a su vencimiento.
+PV = VALACT ## Devuelve el valor actual de una inversión.
+RATE = TASA ## Devuelve la tasa de interés por período de una anualidad.
+RECEIVED = CANTIDAD.RECIBIDA ## Devuelve la cantidad recibida al vencimiento de un valor bursátil completamente invertido.
+SLN = SLN ## Devuelve la amortización por método directo de un bien en un período dado.
+SYD = SYD ## Devuelve la amortización por suma de dígitos de los años de un bien durante un período especificado.
+TBILLEQ = LETRA.DE.TES.EQV.A.BONO ## Devuelve el rendimiento de un bono equivalente a una letra del Tesoro (de EE.UU.)
+TBILLPRICE = LETRA.DE.TES.PRECIO ## Devuelve el precio por un valor nominal de 100 $ de una letra del Tesoro (de EE.UU.)
+TBILLYIELD = LETRA.DE.TES.RENDTO ## Devuelve el rendimiento de una letra del Tesoro (de EE.UU.)
+VDB = DVS ## Devuelve la amortización de un bien durante un período específico o parcial a través del método de cálculo del saldo en disminución.
+XIRR = TIR.NO.PER ## Devuelve la tasa interna de retorno para un flujo de efectivo que no es necesariamente periódico.
+XNPV = VNA.NO.PER ## Devuelve el valor neto actual para un flujo de efectivo que no es necesariamente periódico.
+YIELD = RENDTO ## Devuelve el rendimiento de un valor bursátil que paga intereses periódicos.
+YIELDDISC = RENDTO.DESC ## Devuelve el rendimiento anual de un valor bursátil con descuento; por ejemplo, una letra del Tesoro (de EE.UU.)
+YIELDMAT = RENDTO.VENCTO ## Devuelve el rendimiento anual de un valor bursátil que paga intereses al vencimiento.
+
+
+##
+## Information functions Funciones de información
+##
+CELL = CELDA ## Devuelve información acerca del formato, la ubicación o el contenido de una celda.
+ERROR.TYPE = TIPO.DE.ERROR ## Devuelve un número que corresponde a un tipo de error.
+INFO = INFO ## Devuelve información acerca del entorno operativo en uso.
+ISBLANK = ESBLANCO ## Devuelve VERDADERO si el valor está en blanco.
+ISERR = ESERR ## Devuelve VERDADERO si el valor es cualquier valor de error excepto #N/A.
+ISERROR = ESERROR ## Devuelve VERDADERO si el valor es cualquier valor de error.
+ISEVEN = ES.PAR ## Devuelve VERDADERO si el número es par.
+ISLOGICAL = ESLOGICO ## Devuelve VERDADERO si el valor es un valor lógico.
+ISNA = ESNOD ## Devuelve VERDADERO si el valor es el valor de error #N/A.
+ISNONTEXT = ESNOTEXTO ## Devuelve VERDADERO si el valor no es texto.
+ISNUMBER = ESNUMERO ## Devuelve VERDADERO si el valor es un número.
+ISODD = ES.IMPAR ## Devuelve VERDADERO si el número es impar.
+ISREF = ESREF ## Devuelve VERDADERO si el valor es una referencia.
+ISTEXT = ESTEXTO ## Devuelve VERDADERO si el valor es texto.
+N = N ## Devuelve un valor convertido en un número.
+NA = ND ## Devuelve el valor de error #N/A.
+TYPE = TIPO ## Devuelve un número que indica el tipo de datos de un valor.
+
+
+##
+## Logical functions Funciones lógicas
+##
+AND = Y ## Devuelve VERDADERO si todos sus argumentos son VERDADERO.
+FALSE = FALSO ## Devuelve el valor lógico FALSO.
+IF = SI ## Especifica una prueba lógica que realizar.
+IFERROR = SI.ERROR ## Devuelve un valor que se especifica si una fórmula lo evalúa como un error; de lo contrario, devuelve el resultado de la fórmula.
+NOT = NO ## Invierte el valor lógico del argumento.
+OR = O ## Devuelve VERDADERO si cualquier argumento es VERDADERO.
+TRUE = VERDADERO ## Devuelve el valor lógico VERDADERO.
+
+
+##
+## Lookup and reference functions Funciones de búsqueda y referencia
+##
+ADDRESS = DIRECCION ## Devuelve una referencia como texto a una sola celda de una hoja de cálculo.
+AREAS = AREAS ## Devuelve el número de áreas de una referencia.
+CHOOSE = ELEGIR ## Elige un valor de una lista de valores.
+COLUMN = COLUMNA ## Devuelve el número de columna de una referencia.
+COLUMNS = COLUMNAS ## Devuelve el número de columnas de una referencia.
+HLOOKUP = BUSCARH ## Busca en la fila superior de una matriz y devuelve el valor de la celda indicada.
+HYPERLINK = HIPERVINCULO ## Crea un acceso directo o un salto que abre un documento almacenado en un servidor de red, en una intranet o en Internet.
+INDEX = INDICE ## Usa un índice para elegir un valor de una referencia o matriz.
+INDIRECT = INDIRECTO ## Devuelve una referencia indicada por un valor de texto.
+LOOKUP = BUSCAR ## Busca valores de un vector o una matriz.
+MATCH = COINCIDIR ## Busca valores de una referencia o matriz.
+OFFSET = DESREF ## Devuelve un desplazamiento de referencia respecto a una referencia dada.
+ROW = FILA ## Devuelve el número de fila de una referencia.
+ROWS = FILAS ## Devuelve el número de filas de una referencia.
+RTD = RDTR ## Recupera datos en tiempo real desde un programa compatible con la automatización COM (automatización: modo de trabajar con los objetos de una aplicación desde otra aplicación o herramienta de entorno. La automatización, antes denominada automatización OLE, es un estándar de la industria y una función del Modelo de objetos componentes (COM).).
+TRANSPOSE = TRANSPONER ## Devuelve la transposición de una matriz.
+VLOOKUP = BUSCARV ## Busca en la primera columna de una matriz y se mueve en horizontal por la fila para devolver el valor de una celda.
+
+
+##
+## Math and trigonometry functions Funciones matemáticas y trigonométricas
+##
+ABS = ABS ## Devuelve el valor absoluto de un número.
+ACOS = ACOS ## Devuelve el arcocoseno de un número.
+ACOSH = ACOSH ## Devuelve el coseno hiperbólico inverso de un número.
+ASIN = ASENO ## Devuelve el arcoseno de un número.
+ASINH = ASENOH ## Devuelve el seno hiperbólico inverso de un número.
+ATAN = ATAN ## Devuelve la arcotangente de un número.
+ATAN2 = ATAN2 ## Devuelve la arcotangente de las coordenadas "x" e "y".
+ATANH = ATANH ## Devuelve la tangente hiperbólica inversa de un número.
+CEILING = MULTIPLO.SUPERIOR ## Redondea un número al entero más próximo o al múltiplo significativo más cercano.
+COMBIN = COMBINAT ## Devuelve el número de combinaciones para un número determinado de objetos.
+COS = COS ## Devuelve el coseno de un número.
+COSH = COSH ## Devuelve el coseno hiperbólico de un número.
+DEGREES = GRADOS ## Convierte radianes en grados.
+EVEN = REDONDEA.PAR ## Redondea un número hasta el entero par más próximo.
+EXP = EXP ## Devuelve e elevado a la potencia de un número dado.
+FACT = FACT ## Devuelve el factorial de un número.
+FACTDOUBLE = FACT.DOBLE ## Devuelve el factorial doble de un número.
+FLOOR = MULTIPLO.INFERIOR ## Redondea un número hacia abajo, en dirección hacia cero.
+GCD = M.C.D ## Devuelve el máximo común divisor.
+INT = ENTERO ## Redondea un número hacia abajo hasta el entero más próximo.
+LCM = M.C.M ## Devuelve el mínimo común múltiplo.
+LN = LN ## Devuelve el logaritmo natural (neperiano) de un número.
+LOG = LOG ## Devuelve el logaritmo de un número en una base especificada.
+LOG10 = LOG10 ## Devuelve el logaritmo en base 10 de un número.
+MDETERM = MDETERM ## Devuelve la determinante matricial de una matriz.
+MINVERSE = MINVERSA ## Devuelve la matriz inversa de una matriz.
+MMULT = MMULT ## Devuelve el producto de matriz de dos matrices.
+MOD = RESIDUO ## Devuelve el resto de la división.
+MROUND = REDOND.MULT ## Devuelve un número redondeado al múltiplo deseado.
+MULTINOMIAL = MULTINOMIAL ## Devuelve el polinomio de un conjunto de números.
+ODD = REDONDEA.IMPAR ## Redondea un número hacia arriba hasta el entero impar más próximo.
+PI = PI ## Devuelve el valor de pi.
+POWER = POTENCIA ## Devuelve el resultado de elevar un número a una potencia.
+PRODUCT = PRODUCTO ## Multiplica sus argumentos.
+QUOTIENT = COCIENTE ## Devuelve la parte entera de una división.
+RADIANS = RADIANES ## Convierte grados en radianes.
+RAND = ALEATORIO ## Devuelve un número aleatorio entre 0 y 1.
+RANDBETWEEN = ALEATORIO.ENTRE ## Devuelve un número aleatorio entre los números que especifique.
+ROMAN = NUMERO.ROMANO ## Convierte un número arábigo en número romano, con formato de texto.
+ROUND = REDONDEAR ## Redondea un número al número de decimales especificado.
+ROUNDDOWN = REDONDEAR.MENOS ## Redondea un número hacia abajo, en dirección hacia cero.
+ROUNDUP = REDONDEAR.MAS ## Redondea un número hacia arriba, en dirección contraria a cero.
+SERIESSUM = SUMA.SERIES ## Devuelve la suma de una serie de potencias en función de la fórmula.
+SIGN = SIGNO ## Devuelve el signo de un número.
+SIN = SENO ## Devuelve el seno de un ángulo determinado.
+SINH = SENOH ## Devuelve el seno hiperbólico de un número.
+SQRT = RAIZ ## Devuelve la raíz cuadrada positiva de un número.
+SQRTPI = RAIZ2PI ## Devuelve la raíz cuadrada de un número multiplicado por PI (número * pi).
+SUBTOTAL = SUBTOTALES ## Devuelve un subtotal en una lista o base de datos.
+SUM = SUMA ## Suma sus argumentos.
+SUMIF = SUMAR.SI ## Suma las celdas especificadas que cumplen unos criterios determinados.
+SUMIFS = SUMAR.SI.CONJUNTO ## Suma las celdas de un rango que cumplen varios criterios.
+SUMPRODUCT = SUMAPRODUCTO ## Devuelve la suma de los productos de los correspondientes componentes de matriz.
+SUMSQ = SUMA.CUADRADOS ## Devuelve la suma de los cuadrados de los argumentos.
+SUMX2MY2 = SUMAX2MENOSY2 ## Devuelve la suma de la diferencia de los cuadrados de los valores correspondientes de dos matrices.
+SUMX2PY2 = SUMAX2MASY2 ## Devuelve la suma de la suma de los cuadrados de los valores correspondientes de dos matrices.
+SUMXMY2 = SUMAXMENOSY2 ## Devuelve la suma de los cuadrados de las diferencias de los valores correspondientes de dos matrices.
+TAN = TAN ## Devuelve la tangente de un número.
+TANH = TANH ## Devuelve la tangente hiperbólica de un número.
+TRUNC = TRUNCAR ## Trunca un número a un entero.
+
+
+##
+## Statistical functions Funciones estadísticas
+##
+AVEDEV = DESVPROM ## Devuelve el promedio de las desviaciones absolutas de la media de los puntos de datos.
+AVERAGE = PROMEDIO ## Devuelve el promedio de sus argumentos.
+AVERAGEA = PROMEDIOA ## Devuelve el promedio de sus argumentos, incluidos números, texto y valores lógicos.
+AVERAGEIF = PROMEDIO.SI ## Devuelve el promedio (media aritmética) de todas las celdas de un rango que cumplen unos criterios determinados.
+AVERAGEIFS = PROMEDIO.SI.CONJUNTO ## Devuelve el promedio (media aritmética) de todas las celdas que cumplen múltiples criterios.
+BETADIST = DISTR.BETA ## Devuelve la función de distribución beta acumulativa.
+BETAINV = DISTR.BETA.INV ## Devuelve la función inversa de la función de distribución acumulativa de una distribución beta especificada.
+BINOMDIST = DISTR.BINOM ## Devuelve la probabilidad de una variable aleatoria discreta siguiendo una distribución binomial.
+CHIDIST = DISTR.CHI ## Devuelve la probabilidad de una variable aleatoria continua siguiendo una distribución chi cuadrado de una sola cola.
+CHIINV = PRUEBA.CHI.INV ## Devuelve la función inversa de la probabilidad de una variable aleatoria continua siguiendo una distribución chi cuadrado de una sola cola.
+CHITEST = PRUEBA.CHI ## Devuelve la prueba de independencia.
+CONFIDENCE = INTERVALO.CONFIANZA ## Devuelve el intervalo de confianza de la media de una población.
+CORREL = COEF.DE.CORREL ## Devuelve el coeficiente de correlación entre dos conjuntos de datos.
+COUNT = CONTAR ## Cuenta cuántos números hay en la lista de argumentos.
+COUNTA = CONTARA ## Cuenta cuántos valores hay en la lista de argumentos.
+COUNTBLANK = CONTAR.BLANCO ## Cuenta el número de celdas en blanco de un rango.
+COUNTIF = CONTAR.SI ## Cuenta el número de celdas, dentro del rango, que cumplen el criterio especificado.
+COUNTIFS = CONTAR.SI.CONJUNTO ## Cuenta el número de celdas, dentro del rango, que cumplen varios criterios.
+COVAR = COVAR ## Devuelve la covarianza, que es el promedio de los productos de las desviaciones para cada pareja de puntos de datos.
+CRITBINOM = BINOM.CRIT ## Devuelve el menor valor cuya distribución binomial acumulativa es menor o igual a un valor de criterio.
+DEVSQ = DESVIA2 ## Devuelve la suma de los cuadrados de las desviaciones.
+EXPONDIST = DISTR.EXP ## Devuelve la distribución exponencial.
+FDIST = DISTR.F ## Devuelve la distribución de probabilidad F.
+FINV = DISTR.F.INV ## Devuelve la función inversa de la distribución de probabilidad F.
+FISHER = FISHER ## Devuelve la transformación Fisher.
+FISHERINV = PRUEBA.FISHER.INV ## Devuelve la función inversa de la transformación Fisher.
+FORECAST = PRONOSTICO ## Devuelve un valor en una tendencia lineal.
+FREQUENCY = FRECUENCIA ## Devuelve una distribución de frecuencia como una matriz vertical.
+FTEST = PRUEBA.F ## Devuelve el resultado de una prueba F.
+GAMMADIST = DISTR.GAMMA ## Devuelve la distribución gamma.
+GAMMAINV = DISTR.GAMMA.INV ## Devuelve la función inversa de la distribución gamma acumulativa.
+GAMMALN = GAMMA.LN ## Devuelve el logaritmo natural de la función gamma, G(x).
+GEOMEAN = MEDIA.GEOM ## Devuelve la media geométrica.
+GROWTH = CRECIMIENTO ## Devuelve valores en una tendencia exponencial.
+HARMEAN = MEDIA.ARMO ## Devuelve la media armónica.
+HYPGEOMDIST = DISTR.HIPERGEOM ## Devuelve la distribución hipergeométrica.
+INTERCEPT = INTERSECCION.EJE ## Devuelve la intersección de la línea de regresión lineal.
+KURT = CURTOSIS ## Devuelve la curtosis de un conjunto de datos.
+LARGE = K.ESIMO.MAYOR ## Devuelve el k-ésimo mayor valor de un conjunto de datos.
+LINEST = ESTIMACION.LINEAL ## Devuelve los parámetros de una tendencia lineal.
+LOGEST = ESTIMACION.LOGARITMICA ## Devuelve los parámetros de una tendencia exponencial.
+LOGINV = DISTR.LOG.INV ## Devuelve la función inversa de la distribución logarítmico-normal.
+LOGNORMDIST = DISTR.LOG.NORM ## Devuelve la distribución logarítmico-normal acumulativa.
+MAX = MAX ## Devuelve el valor máximo de una lista de argumentos.
+MAXA = MAXA ## Devuelve el valor máximo de una lista de argumentos, incluidos números, texto y valores lógicos.
+MEDIAN = MEDIANA ## Devuelve la mediana de los números dados.
+MIN = MIN ## Devuelve el valor mínimo de una lista de argumentos.
+MINA = MINA ## Devuelve el valor mínimo de una lista de argumentos, incluidos números, texto y valores lógicos.
+MODE = MODA ## Devuelve el valor más común de un conjunto de datos.
+NEGBINOMDIST = NEGBINOMDIST ## Devuelve la distribución binomial negativa.
+NORMDIST = DISTR.NORM ## Devuelve la distribución normal acumulativa.
+NORMINV = DISTR.NORM.INV ## Devuelve la función inversa de la distribución normal acumulativa.
+NORMSDIST = DISTR.NORM.ESTAND ## Devuelve la distribución normal estándar acumulativa.
+NORMSINV = DISTR.NORM.ESTAND.INV ## Devuelve la función inversa de la distribución normal estándar acumulativa.
+PEARSON = PEARSON ## Devuelve el coeficiente de momento de correlación de producto Pearson.
+PERCENTILE = PERCENTIL ## Devuelve el k-ésimo percentil de los valores de un rango.
+PERCENTRANK = RANGO.PERCENTIL ## Devuelve el rango porcentual de un valor de un conjunto de datos.
+PERMUT = PERMUTACIONES ## Devuelve el número de permutaciones de un número determinado de objetos.
+POISSON = POISSON ## Devuelve la distribución de Poisson.
+PROB = PROBABILIDAD ## Devuelve la probabilidad de que los valores de un rango se encuentren entre dos límites.
+QUARTILE = CUARTIL ## Devuelve el cuartil de un conjunto de datos.
+RANK = JERARQUIA ## Devuelve la jerarquía de un número en una lista de números.
+RSQ = COEFICIENTE.R2 ## Devuelve el cuadrado del coeficiente de momento de correlación de producto Pearson.
+SKEW = COEFICIENTE.ASIMETRIA ## Devuelve la asimetría de una distribución.
+SLOPE = PENDIENTE ## Devuelve la pendiente de la línea de regresión lineal.
+SMALL = K.ESIMO.MENOR ## Devuelve el k-ésimo menor valor de un conjunto de datos.
+STANDARDIZE = NORMALIZACION ## Devuelve un valor normalizado.
+STDEV = DESVEST ## Calcula la desviación estándar a partir de una muestra.
+STDEVA = DESVESTA ## Calcula la desviación estándar a partir de una muestra, incluidos números, texto y valores lógicos.
+STDEVP = DESVESTP ## Calcula la desviación estándar en función de toda la población.
+STDEVPA = DESVESTPA ## Calcula la desviación estándar en función de toda la población, incluidos números, texto y valores lógicos.
+STEYX = ERROR.TIPICO.XY ## Devuelve el error estándar del valor de "y" previsto para cada "x" de la regresión.
+TDIST = DISTR.T ## Devuelve la distribución de t de Student.
+TINV = DISTR.T.INV ## Devuelve la función inversa de la distribución de t de Student.
+TREND = TENDENCIA ## Devuelve valores en una tendencia lineal.
+TRIMMEAN = MEDIA.ACOTADA ## Devuelve la media del interior de un conjunto de datos.
+TTEST = PRUEBA.T ## Devuelve la probabilidad asociada a una prueba t de Student.
+VAR = VAR ## Calcula la varianza en función de una muestra.
+VARA = VARA ## Calcula la varianza en función de una muestra, incluidos números, texto y valores lógicos.
+VARP = VARP ## Calcula la varianza en función de toda la población.
+VARPA = VARPA ## Calcula la varianza en función de toda la población, incluidos números, texto y valores lógicos.
+WEIBULL = DIST.WEIBULL ## Devuelve la distribución de Weibull.
+ZTEST = PRUEBA.Z ## Devuelve el valor de una probabilidad de una cola de una prueba z.
+
+
+##
+## Text functions Funciones de texto
+##
+ASC = ASC ## Convierte las letras inglesas o katakana de ancho completo (de dos bytes) dentro de una cadena de caracteres en caracteres de ancho medio (de un byte).
+BAHTTEXT = TEXTOBAHT ## Convierte un número en texto, con el formato de moneda ß (Baht).
+CHAR = CARACTER ## Devuelve el carácter especificado por el número de código.
+CLEAN = LIMPIAR ## Quita del texto todos los caracteres no imprimibles.
+CODE = CODIGO ## Devuelve un código numérico del primer carácter de una cadena de texto.
+CONCATENATE = CONCATENAR ## Concatena varios elementos de texto en uno solo.
+DOLLAR = MONEDA ## Convierte un número en texto, con el formato de moneda $ (dólar).
+EXACT = IGUAL ## Comprueba si dos valores de texto son idénticos.
+FIND = ENCONTRAR ## Busca un valor de texto dentro de otro (distingue mayúsculas de minúsculas).
+FINDB = ENCONTRARB ## Busca un valor de texto dentro de otro (distingue mayúsculas de minúsculas).
+FIXED = DECIMAL ## Da formato a un número como texto con un número fijo de decimales.
+JIS = JIS ## Convierte las letras inglesas o katakana de ancho medio (de un byte) dentro de una cadena de caracteres en caracteres de ancho completo (de dos bytes).
+LEFT = IZQUIERDA ## Devuelve los caracteres del lado izquierdo de un valor de texto.
+LEFTB = IZQUIERDAB ## Devuelve los caracteres del lado izquierdo de un valor de texto.
+LEN = LARGO ## Devuelve el número de caracteres de una cadena de texto.
+LENB = LARGOB ## Devuelve el número de caracteres de una cadena de texto.
+LOWER = MINUSC ## Pone el texto en minúsculas.
+MID = EXTRAE ## Devuelve un número específico de caracteres de una cadena de texto que comienza en la posición que se especifique.
+MIDB = EXTRAEB ## Devuelve un número específico de caracteres de una cadena de texto que comienza en la posición que se especifique.
+PHONETIC = FONETICO ## Extrae los caracteres fonéticos (furigana) de una cadena de texto.
+PROPER = NOMPROPIO ## Pone en mayúscula la primera letra de cada palabra de un valor de texto.
+REPLACE = REEMPLAZAR ## Reemplaza caracteres de texto.
+REPLACEB = REEMPLAZARB ## Reemplaza caracteres de texto.
+REPT = REPETIR ## Repite el texto un número determinado de veces.
+RIGHT = DERECHA ## Devuelve los caracteres del lado derecho de un valor de texto.
+RIGHTB = DERECHAB ## Devuelve los caracteres del lado derecho de un valor de texto.
+SEARCH = HALLAR ## Busca un valor de texto dentro de otro (no distingue mayúsculas de minúsculas).
+SEARCHB = HALLARB ## Busca un valor de texto dentro de otro (no distingue mayúsculas de minúsculas).
+SUBSTITUTE = SUSTITUIR ## Sustituye texto nuevo por texto antiguo en una cadena de texto.
+T = T ## Convierte sus argumentos a texto.
+TEXT = TEXTO ## Da formato a un número y lo convierte en texto.
+TRIM = ESPACIOS ## Quita los espacios del texto.
+UPPER = MAYUSC ## Pone el texto en mayúsculas.
+VALUE = VALOR ## Convierte un argumento de texto en un número.
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fi/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fi/config
new file mode 100644
index 00000000000..22aaf58b98d
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fi/config
@@ -0,0 +1,24 @@
+##
+## PhpSpreadsheet
+##
+
+ArgumentSeparator = ;
+
+
+##
+## (For future use)
+##
+currencySymbol = $ # Symbol not known, should it be a € (Euro)?
+
+
+##
+## Excel Error Codes (For future use)
+
+##
+NULL = #TYHJÄ!
+DIV0 = #JAKO/0!
+VALUE = #ARVO!
+REF = #VIITTAUS!
+NAME = #NIMI?
+NUM = #LUKU!
+NA = #PUUTTUU
diff --git a/lib/phpexcel/PHPExcel/locale/fi/functions b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fi/functions
similarity index 95%
rename from lib/phpexcel/PHPExcel/locale/fi/functions
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fi/functions
index 6a7c2b36f87..289e0eaca48 100644
--- a/lib/phpexcel/PHPExcel/locale/fi/functions
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fi/functions
@@ -1,438 +1,416 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Calculation
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/
-##
-##
-
-
-##
-## Add-in and Automation functions Apuohjelma- ja automaatiofunktiot
-##
-GETPIVOTDATA = NOUDA.PIVOT.TIEDOT ## Palauttaa pivot-taulukkoraporttiin tallennettuja tietoja.
-
-
-##
-## Cube functions Kuutiofunktiot
-##
-CUBEKPIMEMBER = KUUTIOKPIJÄSEN ## Palauttaa suorituskykyilmaisimen (KPI) nimen, ominaisuuden sekä mitan ja näyttää nimen sekä ominaisuuden solussa. KPI on mitattavissa oleva suure, kuten kuukauden bruttotuotto tai vuosineljänneksen työntekijäkohtainen liikevaihto, joiden avulla tarkkaillaan organisaation suorituskykyä.
-CUBEMEMBER = KUUTIONJÄSEN ## Palauttaa kuutiohierarkian jäsenen tai monikon. Tällä funktiolla voit tarkistaa, että jäsen tai monikko on olemassa kuutiossa.
-CUBEMEMBERPROPERTY = KUUTIONJÄSENENOMINAISUUS ## Palauttaa kuution jäsenominaisuuden arvon. Tällä funktiolla voit tarkistaa, että nimi on olemassa kuutiossa, ja palauttaa tämän jäsenen määritetyn ominaisuuden.
-CUBERANKEDMEMBER = KUUTIONLUOKITELTUJÄSEN ## Palauttaa joukon n:nnen jäsenen. Tällä funktiolla voit palauttaa joukosta elementtejä, kuten parhaan myyjän tai 10 parasta opiskelijaa.
-CUBESET = KUUTIOJOUKKO ## Määrittää lasketun jäsen- tai monikkojoukon lähettämällä joukon lausekkeita palvelimessa olevalle kuutiolle. Palvelin luo joukon ja palauttaa sen Microsoft Office Excelille.
-CUBESETCOUNT = KUUTIOJOUKKOJENMÄÄRÄ ## Palauttaa joukon kohteiden määrän.
-CUBEVALUE = KUUTIONARVO ## Palauttaa koostetun arvon kuutiosta.
-
-
-##
-## Database functions Tietokantafunktiot
-##
-DAVERAGE = TKESKIARVO ## Palauttaa valittujen tietokantamerkintöjen keskiarvon.
-DCOUNT = TLASKE ## Laskee tietokannan lukuja sisältävien solujen määrän.
-DCOUNTA = TLASKEA ## Laskee tietokannan tietoja sisältävien solujen määrän.
-DGET = TNOUDA ## Hakee määritettyjä ehtoja vastaavan tietueen tietokannasta.
-DMAX = TMAKS ## Palauttaa suurimman arvon tietokannasta valittujen arvojen joukosta.
-DMIN = TMIN ## Palauttaa pienimmän arvon tietokannasta valittujen arvojen joukosta.
-DPRODUCT = TTULO ## Kertoo määritetyn ehdon täyttävien tietokannan tietueiden tietyssä kentässä olevat arvot.
-DSTDEV = TKESKIHAJONTA ## Laskee keskihajonnan tietokannasta valituista arvoista muodostuvan otoksen perusteella.
-DSTDEVP = TKESKIHAJONTAP ## Laskee keskihajonnan tietokannasta valittujen arvojen koko populaation perusteella.
-DSUM = TSUMMA ## Lisää luvut määritetyn ehdon täyttävien tietokannan tietueiden kenttäsarakkeeseen.
-DVAR = TVARIANSSI ## Laskee varianssin tietokannasta valittujen arvojen otoksen perusteella.
-DVARP = TVARIANSSIP ## Laskee varianssin tietokannasta valittujen arvojen koko populaation perusteella.
-
-
-##
-## Date and time functions Päivämäärä- ja aikafunktiot
-##
-DATE = PÄIVÄYS ## Palauttaa annetun päivämäärän järjestysluvun.
-DATEVALUE = PÄIVÄYSARVO ## Muuntaa tekstimuodossa olevan päivämäärän järjestysluvuksi.
-DAY = PÄIVÄ ## Muuntaa järjestysluvun kuukauden päiväksi.
-DAYS360 = PÄIVÄT360 ## Laskee kahden päivämäärän välisten päivien määrän käyttäen perustana 360-päiväistä vuotta.
-EDATE = PÄIVÄ.KUUKAUSI ## Palauttaa järjestyslukuna päivämäärän, joka poikkeaa aloituspäivän päivämäärästä annetun kuukausimäärän verran joko eteen- tai taaksepäin.
-EOMONTH = KUUKAUSI.LOPPU ## Palauttaa järjestyslukuna sen kuukauden viimeisen päivämäärän, joka poikkeaa annetun kuukausimäärän verran eteen- tai taaksepäin.
-HOUR = TUNNIT ## Muuntaa järjestysluvun tunneiksi.
-MINUTE = MINUUTIT ## Muuntaa järjestysluvun minuuteiksi.
-MONTH = KUUKAUSI ## Muuntaa järjestysluvun kuukausiksi.
-NETWORKDAYS = TYÖPÄIVÄT ## Palauttaa kahden päivämäärän välissä olevien täysien työpäivien määrän.
-NOW = NYT ## Palauttaa kuluvan päivämäärän ja ajan järjestysnumeron.
-SECOND = SEKUNNIT ## Muuntaa järjestysluvun sekunneiksi.
-TIME = AIKA ## Palauttaa annetun kellonajan järjestysluvun.
-TIMEVALUE = AIKA_ARVO ## Muuntaa tekstimuodossa olevan kellonajan järjestysluvuksi.
-TODAY = TÄMÄ.PÄIVÄ ## Palauttaa kuluvan päivän päivämäärän järjestysluvun.
-WEEKDAY = VIIKONPÄIVÄ ## Muuntaa järjestysluvun viikonpäiväksi.
-WEEKNUM = VIIKKO.NRO ## Muuntaa järjestysluvun luvuksi, joka ilmaisee viikon järjestysluvun vuoden alusta laskettuna.
-WORKDAY = TYÖPÄIVÄ ## Palauttaa järjestysluvun päivämäärälle, joka sijaitsee annettujen työpäivien verran eteen tai taaksepäin.
-YEAR = VUOSI ## Muuntaa järjestysluvun vuosiksi.
-YEARFRAC = VUOSI.OSA ## Palauttaa määritettyjen päivämäärien (aloituspäivä ja lopetuspäivä) välisen osan vuodesta.
-
-
-##
-## Engineering functions Tekniset funktiot
-##
-BESSELI = BESSELI ## Palauttaa muunnetun Bessel-funktion In(x).
-BESSELJ = BESSELJ ## Palauttaa Bessel-funktion Jn(x).
-BESSELK = BESSELK ## Palauttaa muunnetun Bessel-funktion Kn(x).
-BESSELY = BESSELY ## Palauttaa Bessel-funktion Yn(x).
-BIN2DEC = BINDES ## Muuntaa binaariluvun desimaaliluvuksi.
-BIN2HEX = BINHEKSA ## Muuntaa binaariluvun heksadesimaaliluvuksi.
-BIN2OCT = BINOKT ## Muuntaa binaariluvun oktaaliluvuksi.
-COMPLEX = KOMPLEKSI ## Muuntaa reaali- ja imaginaariosien kertoimet kompleksiluvuksi.
-CONVERT = MUUNNA ## Muuntaa luvun toisen mittajärjestelmän mukaiseksi.
-DEC2BIN = DESBIN ## Muuntaa desimaaliluvun binaariluvuksi.
-DEC2HEX = DESHEKSA ## Muuntaa kymmenjärjestelmän luvun heksadesimaaliluvuksi.
-DEC2OCT = DESOKT ## Muuntaa kymmenjärjestelmän luvun oktaaliluvuksi.
-DELTA = SAMA.ARVO ## Tarkistaa, ovatko kaksi arvoa yhtä suuria.
-ERF = VIRHEFUNKTIO ## Palauttaa virhefunktion.
-ERFC = VIRHEFUNKTIO.KOMPLEMENTTI ## Palauttaa komplementtivirhefunktion.
-GESTEP = RAJA ## Testaa, onko luku suurempi kuin kynnysarvo.
-HEX2BIN = HEKSABIN ## Muuntaa heksadesimaaliluvun binaariluvuksi.
-HEX2DEC = HEKSADES ## Muuntaa heksadesimaaliluvun desimaaliluvuksi.
-HEX2OCT = HEKSAOKT ## Muuntaa heksadesimaaliluvun oktaaliluvuksi.
-IMABS = KOMPLEKSI.ITSEISARVO ## Palauttaa kompleksiluvun itseisarvon (moduluksen).
-IMAGINARY = KOMPLEKSI.IMAG ## Palauttaa kompleksiluvun imaginaariosan kertoimen.
-IMARGUMENT = KOMPLEKSI.ARG ## Palauttaa theeta-argumentin, joka on radiaaneina annettu kulma.
-IMCONJUGATE = KOMPLEKSI.KONJ ## Palauttaa kompleksiluvun konjugaattiluvun.
-IMCOS = KOMPLEKSI.COS ## Palauttaa kompleksiluvun kosinin.
-IMDIV = KOMPLEKSI.OSAM ## Palauttaa kahden kompleksiluvun osamäärän.
-IMEXP = KOMPLEKSI.EKSP ## Palauttaa kompleksiluvun eksponentin.
-IMLN = KOMPLEKSI.LN ## Palauttaa kompleksiluvun luonnollisen logaritmin.
-IMLOG10 = KOMPLEKSI.LOG10 ## Palauttaa kompleksiluvun kymmenkantaisen logaritmin.
-IMLOG2 = KOMPLEKSI.LOG2 ## Palauttaa kompleksiluvun kaksikantaisen logaritmin.
-IMPOWER = KOMPLEKSI.POT ## Palauttaa kokonaislukupotenssiin korotetun kompleksiluvun.
-IMPRODUCT = KOMPLEKSI.TULO ## Palauttaa kompleksilukujen tulon.
-IMREAL = KOMPLEKSI.REAALI ## Palauttaa kompleksiluvun reaaliosan kertoimen.
-IMSIN = KOMPLEKSI.SIN ## Palauttaa kompleksiluvun sinin.
-IMSQRT = KOMPLEKSI.NELIÖJ ## Palauttaa kompleksiluvun neliöjuuren.
-IMSUB = KOMPLEKSI.EROTUS ## Palauttaa kahden kompleksiluvun erotuksen.
-IMSUM = KOMPLEKSI.SUM ## Palauttaa kompleksilukujen summan.
-OCT2BIN = OKTBIN ## Muuntaa oktaaliluvun binaariluvuksi.
-OCT2DEC = OKTDES ## Muuntaa oktaaliluvun desimaaliluvuksi.
-OCT2HEX = OKTHEKSA ## Muuntaa oktaaliluvun heksadesimaaliluvuksi.
-
-
-##
-## Financial functions Rahoitusfunktiot
-##
-ACCRINT = KERTYNYT.KORKO ## Laskee arvopaperille kertyneen koron, kun korko kertyy säännöllisin väliajoin.
-ACCRINTM = KERTYNYT.KORKO.LOPUSSA ## Laskee arvopaperille kertyneen koron, kun korko maksetaan eräpäivänä.
-AMORDEGRC = AMORDEGRC ## Laskee kunkin laskentakauden poiston poistokerrointa käyttämällä.
-AMORLINC = AMORLINC ## Palauttaa kunkin laskentakauden poiston.
-COUPDAYBS = KORKOPÄIVÄT.ALUSTA ## Palauttaa koronmaksukauden aloituspäivän ja tilityspäivän välisen ajanjakson päivien määrän.
-COUPDAYS = KORKOPÄIVÄT ## Palauttaa päivien määrän koronmaksukaudelta, johon tilityspäivä kuuluu.
-COUPDAYSNC = KORKOPÄIVÄT.SEURAAVA ## Palauttaa tilityspäivän ja seuraavan koronmaksupäivän välisen ajanjakson päivien määrän.
-COUPNCD = KORKOMAKSU.SEURAAVA ## Palauttaa tilityspäivän jälkeisen seuraavan koronmaksupäivän.
-COUPNUM = KORKOPÄIVÄJAKSOT ## Palauttaa arvopaperin ostopäivän ja erääntymispäivän välisten koronmaksupäivien määrän.
-COUPPCD = KORKOPÄIVÄ.EDELLINEN ## Palauttaa tilityspäivää edeltävän koronmaksupäivän.
-CUMIPMT = MAKSETTU.KORKO ## Palauttaa kahden jakson välisenä aikana kertyneen koron.
-CUMPRINC = MAKSETTU.LYHENNYS ## Palauttaa lainalle kahden jakson välisenä aikana kertyneen lyhennyksen.
-DB = DB ## Palauttaa kauden kirjanpidollisen poiston amerikkalaisen DB-menetelmän (Fixed-declining balance) mukaan.
-DDB = DDB ## Palauttaa kauden kirjanpidollisen poiston amerikkalaisen DDB-menetelmän (Double-Declining Balance) tai jonkin muun määrittämäsi menetelmän mukaan.
-DISC = DISKONTTOKORKO ## Palauttaa arvopaperin diskonttokoron.
-DOLLARDE = VALUUTTA.DES ## Muuntaa murtolukuna ilmoitetun valuuttamäärän desimaaliluvuksi.
-DOLLARFR = VALUUTTA.MURTO ## Muuntaa desimaalilukuna ilmaistun valuuttamäärän murtoluvuksi.
-DURATION = KESTO ## Palauttaa keston arvopaperille, jonka koronmaksu tapahtuu säännöllisesti.
-EFFECT = KORKO.EFEKT ## Palauttaa todellisen vuosikoron.
-FV = TULEVA.ARVO ## Palauttaa sijoituksen tulevan arvon.
-FVSCHEDULE = TULEVA.ARVO.ERIKORKO ## Palauttaa pääoman tulevan arvon, kun pääomalle on kertynyt korkoa vaihtelevasti.
-INTRATE = KORKO.ARVOPAPERI ## Palauttaa arvopaperin korkokannan täysin sijoitetulle arvopaperille.
-IPMT = IPMT ## Laskee sijoitukselle tai lainalle tiettynä ajanjaksona kertyvän koron.
-IRR = SISÄINEN.KORKO ## Laskee sisäisen korkokannan kassavirrasta muodostuvalle sarjalle.
-ISPMT = ONMAKSU ## Laskee sijoituksen maksetun koron tietyllä jaksolla.
-MDURATION = KESTO.MUUNN ## Palauttaa muunnetun Macauley-keston arvopaperille, jonka oletettu nimellisarvo on 100 euroa.
-MIRR = MSISÄINEN ## Palauttaa sisäisen korkokannan, kun positiivisten ja negatiivisten kassavirtojen rahoituskorko on erilainen.
-NOMINAL = KORKO.VUOSI ## Palauttaa vuosittaisen nimelliskoron.
-NPER = NJAKSO ## Palauttaa sijoituksen jaksojen määrän.
-NPV = NNA ## Palauttaa sijoituksen nykyarvon toistuvista kassavirroista muodostuvan sarjan ja diskonttokoron perusteella.
-ODDFPRICE = PARITON.ENS.NIMELLISARVO ## Palauttaa arvopaperin hinnan tilanteessa, jossa ensimmäinen jakso on pariton.
-ODDFYIELD = PARITON.ENS.TUOTTO ## Palauttaa arvopaperin tuoton tilanteessa, jossa ensimmäinen jakso on pariton.
-ODDLPRICE = PARITON.VIIM.NIMELLISARVO ## Palauttaa arvopaperin hinnan tilanteessa, jossa viimeinen jakso on pariton.
-ODDLYIELD = PARITON.VIIM.TUOTTO ## Palauttaa arvopaperin tuoton tilanteessa, jossa viimeinen jakso on pariton.
-PMT = MAKSU ## Palauttaa annuiteetin kausittaisen maksuerän.
-PPMT = PPMT ## Laskee sijoitukselle tai lainalle tiettynä ajanjaksona maksettavan lyhennyksen.
-PRICE = HINTA ## Palauttaa hinnan 100 euron nimellisarvoa kohden arvopaperille, jonka korko maksetaan säännöllisin väliajoin.
-PRICEDISC = HINTA.DISK ## Palauttaa diskontatun arvopaperin hinnan 100 euron nimellisarvoa kohden.
-PRICEMAT = HINTA.LUNASTUS ## Palauttaa hinnan 100 euron nimellisarvoa kohden arvopaperille, jonka korko maksetaan erääntymispäivänä.
-PV = NA ## Palauttaa sijoituksen nykyarvon.
-RATE = KORKO ## Palauttaa annuiteetin kausittaisen korkokannan.
-RECEIVED = SAATU.HINTA ## Palauttaa arvopaperin tuoton erääntymispäivänä kokonaan maksetulle sijoitukselle.
-SLN = STP ## Palauttaa sijoituksen tasapoiston yhdeltä jaksolta.
-SYD = VUOSIPOISTO ## Palauttaa sijoituksen vuosipoiston annettuna kautena amerikkalaisen SYD-menetelmän (Sum-of-Year's Digits) avulla.
-TBILLEQ = OBLIG.TUOTTOPROS ## Palauttaa valtion obligaation tuoton vastaavana joukkovelkakirjan tuottona.
-TBILLPRICE = OBLIG.HINTA ## Palauttaa obligaation hinnan 100 euron nimellisarvoa kohden.
-TBILLYIELD = OBLIG.TUOTTO ## Palauttaa obligaation tuoton.
-VDB = VDB ## Palauttaa annetun kauden tai kauden osan kirjanpidollisen poiston amerikkalaisen DB-menetelmän (Fixed-declining balance) mukaan.
-XIRR = SISÄINEN.KORKO.JAKSOTON ## Palauttaa sisäisen korkokannan kassavirtojen sarjoille, jotka eivät välttämättä ole säännöllisiä.
-XNPV = NNA.JAKSOTON ## Palauttaa nettonykyarvon kassavirtasarjalle, joka ei välttämättä ole kausittainen.
-YIELD = TUOTTO ## Palauttaa tuoton arvopaperille, jonka korko maksetaan säännöllisin väliajoin.
-YIELDDISC = TUOTTO.DISK ## Palauttaa diskontatun arvopaperin, kuten obligaation, vuosittaisen tuoton.
-YIELDMAT = TUOTTO.ERÄP ## Palauttaa erääntymispäivänään korkoa tuottavan arvopaperin vuosittaisen tuoton.
-
-
-##
-## Information functions Erikoisfunktiot
-##
-CELL = SOLU ## Palauttaa tietoja solun muotoilusta, sijainnista ja sisällöstä.
-ERROR.TYPE = VIRHEEN.LAJI ## Palauttaa virhetyyppiä vastaavan luvun.
-INFO = KUVAUS ## Palauttaa tietoja nykyisestä käyttöympäristöstä.
-ISBLANK = ONTYHJÄ ## Palauttaa arvon TOSI, jos arvo on tyhjä.
-ISERR = ONVIRH ## Palauttaa arvon TOSI, jos arvo on mikä tahansa virhearvo paitsi arvo #PUUTTUU!.
-ISERROR = ONVIRHE ## Palauttaa arvon TOSI, jos arvo on mikä tahansa virhearvo.
-ISEVEN = ONPARILLINEN ## Palauttaa arvon TOSI, jos arvo on parillinen.
-ISLOGICAL = ONTOTUUS ## Palauttaa arvon TOSI, jos arvo on mikä tahansa looginen arvo.
-ISNA = ONPUUTTUU ## Palauttaa arvon TOSI, jos virhearvo on #PUUTTUU!.
-ISNONTEXT = ONEI_TEKSTI ## Palauttaa arvon TOSI, jos arvo ei ole teksti.
-ISNUMBER = ONLUKU ## Palauttaa arvon TOSI, jos arvo on luku.
-ISODD = ONPARITON ## Palauttaa arvon TOSI, jos arvo on pariton.
-ISREF = ONVIITT ## Palauttaa arvon TOSI, jos arvo on viittaus.
-ISTEXT = ONTEKSTI ## Palauttaa arvon TOSI, jos arvo on teksti.
-N = N ## Palauttaa arvon luvuksi muunnettuna.
-NA = PUUTTUU ## Palauttaa virhearvon #PUUTTUU!.
-TYPE = TYYPPI ## Palauttaa luvun, joka ilmaisee arvon tietotyypin.
-
-
-##
-## Logical functions Loogiset funktiot
-##
-AND = JA ## Palauttaa arvon TOSI, jos kaikkien argumenttien arvo on TOSI.
-FALSE = EPÄTOSI ## Palauttaa totuusarvon EPÄTOSI.
-IF = JOS ## Määrittää suoritettavan loogisen testin.
-IFERROR = JOSVIRHE ## Palauttaa määrittämäsi arvon, jos kaavan tulos on virhe; muussa tapauksessa palauttaa kaavan tuloksen.
-NOT = EI ## Kääntää argumentin loogisen arvon.
-OR = TAI ## Palauttaa arvon TOSI, jos minkä tahansa argumentin arvo on TOSI.
-TRUE = TOSI ## Palauttaa totuusarvon TOSI.
-
-
-##
-## Lookup and reference functions Haku- ja viitefunktiot
-##
-ADDRESS = OSOITE ## Palauttaa laskentataulukon soluun osoittavan viittauksen tekstinä.
-AREAS = ALUEET ## Palauttaa viittauksessa olevien alueiden määrän.
-CHOOSE = VALITSE.INDEKSI ## Valitsee arvon arvoluettelosta.
-COLUMN = SARAKE ## Palauttaa viittauksen sarakenumeron.
-COLUMNS = SARAKKEET ## Palauttaa viittauksessa olevien sarakkeiden määrän.
-HLOOKUP = VHAKU ## Suorittaa haun matriisin ylimmältä riviltä ja palauttaa määritetyn solun arvon.
-HYPERLINK = HYPERLINKKI ## Luo pikakuvakkeen tai tekstin, joka avaa verkkopalvelimeen, intranetiin tai Internetiin tallennetun tiedoston.
-INDEX = INDEKSI ## Valitsee arvon viittauksesta tai matriisista indeksin mukaan.
-INDIRECT = EPÄSUORA ## Palauttaa tekstiarvona ilmaistun viittauksen.
-LOOKUP = HAKU ## Etsii arvoja vektorista tai matriisista.
-MATCH = VASTINE ## Etsii arvoja viittauksesta tai matriisista.
-OFFSET = SIIRTYMÄ ## Palauttaa annetun viittauksen siirtymän.
-ROW = RIVI ## Palauttaa viittauksen rivinumeron.
-ROWS = RIVIT ## Palauttaa viittauksessa olevien rivien määrän.
-RTD = RTD ## Noutaa COM-automaatiota (automaatio: Tapa käsitellä sovelluksen objekteja toisesta sovelluksesta tai kehitystyökalusta. Automaatio, jota aiemmin kutsuttiin OLE-automaatioksi, on teollisuusstandardi ja COM-mallin (Component Object Model) ominaisuus.) tukevasta ohjelmasta reaaliaikaisia tietoja.
-TRANSPOSE = TRANSPONOI ## Palauttaa matriisin käänteismatriisin.
-VLOOKUP = PHAKU ## Suorittaa haun matriisin ensimmäisestä sarakkeesta ja palauttaa rivillä olevan solun arvon.
-
-
-##
-## Math and trigonometry functions Matemaattiset ja trigonometriset funktiot
-##
-ABS = ITSEISARVO ## Palauttaa luvun itseisarvon.
-ACOS = ACOS ## Palauttaa luvun arkuskosinin.
-ACOSH = ACOSH ## Palauttaa luvun käänteisen hyperbolisen kosinin.
-ASIN = ASIN ## Palauttaa luvun arkussinin.
-ASINH = ASINH ## Palauttaa luvun käänteisen hyperbolisen sinin.
-ATAN = ATAN ## Palauttaa luvun arkustangentin.
-ATAN2 = ATAN2 ## Palauttaa arkustangentin x- ja y-koordinaatin perusteella.
-ATANH = ATANH ## Palauttaa luvun käänteisen hyperbolisen tangentin.
-CEILING = PYÖRISTÄ.KERR.YLÖS ## Pyöristää luvun lähimpään kokonaislukuun tai tarkkuusargumentin lähimpään kerrannaiseen.
-COMBIN = KOMBINAATIO ## Palauttaa mahdollisten kombinaatioiden määrän annetulle objektien määrälle.
-COS = COS ## Palauttaa luvun kosinin.
-COSH = COSH ## Palauttaa luvun hyperbolisen kosinin.
-DEGREES = ASTEET ## Muuntaa radiaanit asteiksi.
-EVEN = PARILLINEN ## Pyöristää luvun ylöspäin lähimpään parilliseen kokonaislukuun.
-EXP = EKSPONENTTI ## Palauttaa e:n korotettuna annetun luvun osoittamaan potenssiin.
-FACT = KERTOMA ## Palauttaa luvun kertoman.
-FACTDOUBLE = KERTOMA.OSA ## Palauttaa luvun osakertoman.
-FLOOR = PYÖRISTÄ.KERR.ALAS ## Pyöristää luvun alaspäin (nollaa kohti).
-GCD = SUURIN.YHT.TEKIJÄ ## Palauttaa suurimman yhteisen tekijän.
-INT = KOKONAISLUKU ## Pyöristää luvun alaspäin lähimpään kokonaislukuun.
-LCM = PIENIN.YHT.JAETTAVA ## Palauttaa pienimmän yhteisen tekijän.
-LN = LUONNLOG ## Palauttaa luvun luonnollisen logaritmin.
-LOG = LOG ## Laskee luvun logaritmin käyttämällä annettua kantalukua.
-LOG10 = LOG10 ## Palauttaa luvun kymmenkantaisen logaritmin.
-MDETERM = MDETERM ## Palauttaa matriisin matriisideterminantin.
-MINVERSE = MKÄÄNTEINEN ## Palauttaa matriisin käänteismatriisin.
-MMULT = MKERRO ## Palauttaa kahden matriisin tulon.
-MOD = JAKOJ ## Palauttaa jakolaskun jäännöksen.
-MROUND = PYÖRISTÄ.KERR ## Palauttaa luvun pyöristettynä annetun luvun kerrannaiseen.
-MULTINOMIAL = MULTINOMI ## Palauttaa lukujoukon multinomin.
-ODD = PARITON ## Pyöristää luvun ylöspäin lähimpään parittomaan kokonaislukuun.
-PI = PII ## Palauttaa piin arvon.
-POWER = POTENSSI ## Palauttaa luvun korotettuna haluttuun potenssiin.
-PRODUCT = TULO ## Kertoo annetut argumentit.
-QUOTIENT = OSAMÄÄRÄ ## Palauttaa osamäärän kokonaislukuosan.
-RADIANS = RADIAANIT ## Muuntaa asteet radiaaneiksi.
-RAND = SATUNNAISLUKU ## Palauttaa satunnaisluvun väliltä 0–1.
-RANDBETWEEN = SATUNNAISLUKU.VÄLILTÄ ## Palauttaa satunnaisluvun määritettyjen lukujen väliltä.
-ROMAN = ROMAN ## Muuntaa arabialaisen numeron tekstimuotoiseksi roomalaiseksi numeroksi.
-ROUND = PYÖRISTÄ ## Pyöristää luvun annettuun määrään desimaaleja.
-ROUNDDOWN = PYÖRISTÄ.DES.ALAS ## Pyöristää luvun alaspäin (nollaa kohti).
-ROUNDUP = PYÖRISTÄ.DES.YLÖS ## Pyöristää luvun ylöspäin (poispäin nollasta).
-SERIESSUM = SARJA.SUMMA ## Palauttaa kaavaan perustuvan potenssisarjan arvon.
-SIGN = ETUMERKKI ## Palauttaa luvun etumerkin.
-SIN = SIN ## Palauttaa annetun kulman sinin.
-SINH = SINH ## Palauttaa luvun hyperbolisen sinin.
-SQRT = NELIÖJUURI ## Palauttaa positiivisen neliöjuuren.
-SQRTPI = NELIÖJUURI.PII ## Palauttaa tulon (luku * pii) neliöjuuren.
-SUBTOTAL = VÄLISUMMA ## Palauttaa luettelon tai tietokannan välisumman.
-SUM = SUMMA ## Laskee yhteen annetut argumentit.
-SUMIF = SUMMA.JOS ## Laskee ehdot täyttävien solujen summan.
-SUMIFS = SUMMA.JOS.JOUKKO ## Laskee yhteen solualueen useita ehtoja vastaavat solut.
-SUMPRODUCT = TULOJEN.SUMMA ## Palauttaa matriisin toisiaan vastaavien osien tulojen summan.
-SUMSQ = NELIÖSUMMA ## Palauttaa argumenttien neliöiden summan.
-SUMX2MY2 = NELIÖSUMMIEN.EROTUS ## Palauttaa kahden matriisin toisiaan vastaavien arvojen laskettujen neliösummien erotuksen.
-SUMX2PY2 = NELIÖSUMMIEN.SUMMA ## Palauttaa kahden matriisin toisiaan vastaavien arvojen neliösummien summan.
-SUMXMY2 = EROTUSTEN.NELIÖSUMMA ## Palauttaa kahden matriisin toisiaan vastaavien arvojen erotusten neliösumman.
-TAN = TAN ## Palauttaa luvun tangentin.
-TANH = TANH ## Palauttaa luvun hyperbolisen tangentin.
-TRUNC = KATKAISE ## Katkaisee luvun kokonaisluvuksi.
-
-
-##
-## Statistical functions Tilastolliset funktiot
-##
-AVEDEV = KESKIPOIKKEAMA ## Palauttaa hajontojen itseisarvojen keskiarvon.
-AVERAGE = KESKIARVO ## Palauttaa argumenttien keskiarvon.
-AVERAGEA = KESKIARVOA ## Palauttaa argumenttien, mukaan lukien lukujen, tekstin ja loogisten arvojen, keskiarvon.
-AVERAGEIF = KESKIARVO.JOS ## Palauttaa alueen niiden solujen keskiarvon (aritmeettisen keskiarvon), jotka täyttävät annetut ehdot.
-AVERAGEIFS = KESKIARVO.JOS.JOUKKO ## Palauttaa niiden solujen keskiarvon (aritmeettisen keskiarvon), jotka vastaavat useita ehtoja.
-BETADIST = BEETAJAKAUMA ## Palauttaa kumulatiivisen beetajakaumafunktion arvon.
-BETAINV = BEETAJAKAUMA.KÄÄNT ## Palauttaa määritetyn beetajakauman käänteisen kumulatiivisen jakaumafunktion arvon.
-BINOMDIST = BINOMIJAKAUMA ## Palauttaa yksittäisen termin binomijakaumatodennäköisyyden.
-CHIDIST = CHIJAKAUMA ## Palauttaa yksisuuntaisen chi-neliön jakauman todennäköisyyden.
-CHIINV = CHIJAKAUMA.KÄÄNT ## Palauttaa yksisuuntaisen chi-neliön jakauman todennäköisyyden käänteisarvon.
-CHITEST = CHITESTI ## Palauttaa riippumattomuustestin tuloksen.
-CONFIDENCE = LUOTTAMUSVÄLI ## Palauttaa luottamusvälin populaation keskiarvolle.
-CORREL = KORRELAATIO ## Palauttaa kahden arvojoukon korrelaatiokertoimen.
-COUNT = LASKE ## Laskee argumenttiluettelossa olevien lukujen määrän.
-COUNTA = LASKE.A ## Laskee argumenttiluettelossa olevien arvojen määrän.
-COUNTBLANK = LASKE.TYHJÄT ## Laskee alueella olevien tyhjien solujen määrän.
-COUNTIF = LASKE.JOS ## Laskee alueella olevien sellaisten solujen määrän, joiden sisältö vastaa annettuja ehtoja.
-COUNTIFS = LASKE.JOS.JOUKKO ## Laskee alueella olevien sellaisten solujen määrän, joiden sisältö vastaa useita ehtoja.
-COVAR = KOVARIANSSI ## Palauttaa kovarianssin, joka on keskiarvo havaintoaineiston kunkin pisteparin poikkeamien tuloista.
-CRITBINOM = BINOMIJAKAUMA.KRIT ## Palauttaa pienimmän arvon, jossa binomijakauman kertymäfunktion arvo on pienempi tai yhtä suuri kuin vertailuarvo.
-DEVSQ = OIKAISTU.NELIÖSUMMA ## Palauttaa keskipoikkeamien neliösumman.
-EXPONDIST = EKSPONENTIAALIJAKAUMA ## Palauttaa eksponentiaalijakauman.
-FDIST = FJAKAUMA ## Palauttaa F-todennäköisyysjakauman.
-FINV = FJAKAUMA.KÄÄNT ## Palauttaa F-todennäköisyysjakauman käänteisfunktion.
-FISHER = FISHER ## Palauttaa Fisher-muunnoksen.
-FISHERINV = FISHER.KÄÄNT ## Palauttaa käänteisen Fisher-muunnoksen.
-FORECAST = ENNUSTE ## Palauttaa lineaarisen trendin arvon.
-FREQUENCY = TAAJUUS ## Palauttaa frekvenssijakautuman pystysuuntaisena matriisina.
-FTEST = FTESTI ## Palauttaa F-testin tuloksen.
-GAMMADIST = GAMMAJAKAUMA ## Palauttaa gammajakauman.
-GAMMAINV = GAMMAJAKAUMA.KÄÄNT ## Palauttaa käänteisen gammajakauman kertymäfunktion.
-GAMMALN = GAMMALN ## Palauttaa gammafunktion luonnollisen logaritmin G(x).
-GEOMEAN = KESKIARVO.GEOM ## Palauttaa geometrisen keskiarvon.
-GROWTH = KASVU ## Palauttaa eksponentiaalisen trendin arvon.
-HARMEAN = KESKIARVO.HARM ## Palauttaa harmonisen keskiarvon.
-HYPGEOMDIST = HYPERGEOM.JAKAUMA ## Palauttaa hypergeometrisen jakauman.
-INTERCEPT = LEIKKAUSPISTE ## Palauttaa lineaarisen regressiosuoran leikkauspisteen.
-KURT = KURT ## Palauttaa tietoalueen vinous-arvon eli huipukkuuden.
-LARGE = SUURI ## Palauttaa tietojoukon k:nneksi suurimman arvon.
-LINEST = LINREGR ## Palauttaa lineaarisen trendin parametrit.
-LOGEST = LOGREGR ## Palauttaa eksponentiaalisen trendin parametrit.
-LOGINV = LOGNORM.JAKAUMA.KÄÄNT ## Palauttaa lognormeeratun jakauman käänteisfunktion.
-LOGNORMDIST = LOGNORM.JAKAUMA ## Palauttaa lognormaalisen jakauman kertymäfunktion.
-MAX = MAKS ## Palauttaa suurimman arvon argumenttiluettelosta.
-MAXA = MAKSA ## Palauttaa argumenttien, mukaan lukien lukujen, tekstin ja loogisten arvojen, suurimman arvon.
-MEDIAN = MEDIAANI ## Palauttaa annettujen lukujen mediaanin.
-MIN = MIN ## Palauttaa pienimmän arvon argumenttiluettelosta.
-MINA = MINA ## Palauttaa argumenttien, mukaan lukien lukujen, tekstin ja loogisten arvojen, pienimmän arvon.
-MODE = MOODI ## Palauttaa tietojoukossa useimmin esiintyvän arvon.
-NEGBINOMDIST = BINOMIJAKAUMA.NEG ## Palauttaa negatiivisen binomijakauman.
-NORMDIST = NORM.JAKAUMA ## Palauttaa normaalijakauman kertymäfunktion.
-NORMINV = NORM.JAKAUMA.KÄÄNT ## Palauttaa käänteisen normaalijakauman kertymäfunktion.
-NORMSDIST = NORM.JAKAUMA.NORMIT ## Palauttaa normitetun normaalijakauman kertymäfunktion.
-NORMSINV = NORM.JAKAUMA.NORMIT.KÄÄNT ## Palauttaa normitetun normaalijakauman kertymäfunktion käänteisarvon.
-PEARSON = PEARSON ## Palauttaa Pearsonin tulomomenttikorrelaatiokertoimen.
-PERCENTILE = PROSENTTIPISTE ## Palauttaa alueen arvojen k:nnen prosenttipisteen.
-PERCENTRANK = PROSENTTIJÄRJESTYS ## Palauttaa tietojoukon arvon prosentuaalisen järjestysluvun.
-PERMUT = PERMUTAATIO ## Palauttaa mahdollisten permutaatioiden määrän annetulle objektien määrälle.
-POISSON = POISSON ## Palauttaa Poissonin todennäköisyysjakauman.
-PROB = TODENNÄKÖISYYS ## Palauttaa todennäköisyyden sille, että arvot ovat tietyltä väliltä.
-QUARTILE = NELJÄNNES ## Palauttaa tietoalueen neljänneksen.
-RANK = ARVON.MUKAAN ## Palauttaa luvun paikan lukuarvoluettelossa.
-RSQ = PEARSON.NELIÖ ## Palauttaa Pearsonin tulomomenttikorrelaatiokertoimen neliön.
-SKEW = JAKAUMAN.VINOUS ## Palauttaa jakauman vinouden.
-SLOPE = KULMAKERROIN ## Palauttaa lineaarisen regressiosuoran kulmakertoimen.
-SMALL = PIENI ## Palauttaa tietojoukon k:nneksi pienimmän arvon.
-STANDARDIZE = NORMITA ## Palauttaa normitetun arvon.
-STDEV = KESKIHAJONTA ## Laskee populaation keskihajonnan otoksen perusteella.
-STDEVA = KESKIHAJONTAA ## Laskee populaation keskihajonnan otoksen perusteella, mukaan lukien luvut, tekstin ja loogiset arvot.
-STDEVP = KESKIHAJONTAP ## Laskee normaalijakautuman koko populaation perusteella.
-STDEVPA = KESKIHAJONTAPA ## Laskee populaation keskihajonnan koko populaation perusteella, mukaan lukien luvut, tekstin ja totuusarvot.
-STEYX = KESKIVIRHE ## Palauttaa regression kutakin x-arvoa vastaavan ennustetun y-arvon keskivirheen.
-TDIST = TJAKAUMA ## Palauttaa t-jakautuman.
-TINV = TJAKAUMA.KÄÄNT ## Palauttaa käänteisen t-jakauman.
-TREND = SUUNTAUS ## Palauttaa lineaarisen trendin arvoja.
-TRIMMEAN = KESKIARVO.TASATTU ## Palauttaa tietojoukon tasatun keskiarvon.
-TTEST = TTESTI ## Palauttaa t-testiin liittyvän todennäköisyyden.
-VAR = VAR ## Arvioi populaation varianssia otoksen perusteella.
-VARA = VARA ## Laskee populaation varianssin otoksen perusteella, mukaan lukien luvut, tekstin ja loogiset arvot.
-VARP = VARP ## Laskee varianssin koko populaation perusteella.
-VARPA = VARPA ## Laskee populaation varianssin koko populaation perusteella, mukaan lukien luvut, tekstin ja totuusarvot.
-WEIBULL = WEIBULL ## Palauttaa Weibullin jakauman.
-ZTEST = ZTESTI ## Palauttaa z-testin yksisuuntaisen todennäköisyysarvon.
-
-
-##
-## Text functions Tekstifunktiot
-##
-ASC = ASC ## Muuntaa merkkijonossa olevat englanninkieliset DBCS- tai katakana-merkit SBCS-merkeiksi.
-BAHTTEXT = BAHTTEKSTI ## Muuntaa luvun tekstiksi ß (baht) -valuuttamuotoa käyttämällä.
-CHAR = MERKKI ## Palauttaa koodin lukua vastaavan merkin.
-CLEAN = SIIVOA ## Poistaa tekstistä kaikki tulostumattomat merkit.
-CODE = KOODI ## Palauttaa tekstimerkkijonon ensimmäisen merkin numerokoodin.
-CONCATENATE = KETJUTA ## Yhdistää useat merkkijonot yhdeksi merkkijonoksi.
-DOLLAR = VALUUTTA ## Muuntaa luvun tekstiksi $ (dollari) -valuuttamuotoa käyttämällä.
-EXACT = VERTAA ## Tarkistaa, ovatko kaksi tekstiarvoa samanlaiset.
-FIND = ETSI ## Etsii tekstiarvon toisen tekstin sisältä (tunnistaa isot ja pienet kirjaimet).
-FINDB = ETSIB ## Etsii tekstiarvon toisen tekstin sisältä (tunnistaa isot ja pienet kirjaimet).
-FIXED = KIINTEÄ ## Muotoilee luvun tekstiksi, jossa on kiinteä määrä desimaaleja.
-JIS = JIS ## Muuntaa merkkijonossa olevat englanninkieliset SBCS- tai katakana-merkit DBCS-merkeiksi.
-LEFT = VASEN ## Palauttaa tekstiarvon vasemmanpuoliset merkit.
-LEFTB = VASENB ## Palauttaa tekstiarvon vasemmanpuoliset merkit.
-LEN = PITUUS ## Palauttaa tekstimerkkijonon merkkien määrän.
-LENB = PITUUSB ## Palauttaa tekstimerkkijonon merkkien määrän.
-LOWER = PIENET ## Muuntaa tekstin pieniksi kirjaimiksi.
-MID = POIMI.TEKSTI ## Palauttaa määritetyn määrän merkkejä merkkijonosta alkaen annetusta kohdasta.
-MIDB = POIMI.TEKSTIB ## Palauttaa määritetyn määrän merkkejä merkkijonosta alkaen annetusta kohdasta.
-PHONETIC = FONEETTINEN ## Hakee foneettiset (furigana) merkit merkkijonosta.
-PROPER = ERISNIMI ## Muuttaa merkkijonon kunkin sanan ensimmäisen kirjaimen isoksi.
-REPLACE = KORVAA ## Korvaa tekstissä olevat merkit.
-REPLACEB = KORVAAB ## Korvaa tekstissä olevat merkit.
-REPT = TOISTA ## Toistaa tekstin annetun määrän kertoja.
-RIGHT = OIKEA ## Palauttaa tekstiarvon oikeanpuoliset merkit.
-RIGHTB = OIKEAB ## Palauttaa tekstiarvon oikeanpuoliset merkit.
-SEARCH = KÄY.LÄPI ## Etsii tekstiarvon toisen tekstin sisältä (isot ja pienet kirjaimet tulkitaan samoiksi merkeiksi).
-SEARCHB = KÄY.LÄPIB ## Etsii tekstiarvon toisen tekstin sisältä (isot ja pienet kirjaimet tulkitaan samoiksi merkeiksi).
-SUBSTITUTE = VAIHDA ## Korvaa merkkijonossa olevan tekstin toisella.
-T = T ## Muuntaa argumentit tekstiksi.
-TEXT = TEKSTI ## Muotoilee luvun ja muuntaa sen tekstiksi.
-TRIM = POISTA.VÄLIT ## Poistaa välilyönnit tekstistä.
-UPPER = ISOT ## Muuntaa tekstin isoiksi kirjaimiksi.
-VALUE = ARVO ## Muuntaa tekstiargumentin luvuksi.
+##
+## PhpSpreadsheet
+##
+## Data in this file derived from https://www.excel-function-translation.com/
+##
+##
+
+
+##
+## Add-in and Automation functions Apuohjelma- ja automaatiofunktiot
+##
+GETPIVOTDATA = NOUDA.PIVOT.TIEDOT ## Palauttaa pivot-taulukkoraporttiin tallennettuja tietoja.
+
+
+##
+## Cube functions Kuutiofunktiot
+##
+CUBEKPIMEMBER = KUUTIOKPIJÄSEN ## Palauttaa suorituskykyilmaisimen (KPI) nimen, ominaisuuden sekä mitan ja näyttää nimen sekä ominaisuuden solussa. KPI on mitattavissa oleva suure, kuten kuukauden bruttotuotto tai vuosineljänneksen työntekijäkohtainen liikevaihto, joiden avulla tarkkaillaan organisaation suorituskykyä.
+CUBEMEMBER = KUUTIONJÄSEN ## Palauttaa kuutiohierarkian jäsenen tai monikon. Tällä funktiolla voit tarkistaa, että jäsen tai monikko on olemassa kuutiossa.
+CUBEMEMBERPROPERTY = KUUTIONJÄSENENOMINAISUUS ## Palauttaa kuution jäsenominaisuuden arvon. Tällä funktiolla voit tarkistaa, että nimi on olemassa kuutiossa, ja palauttaa tämän jäsenen määritetyn ominaisuuden.
+CUBERANKEDMEMBER = KUUTIONLUOKITELTUJÄSEN ## Palauttaa joukon n:nnen jäsenen. Tällä funktiolla voit palauttaa joukosta elementtejä, kuten parhaan myyjän tai 10 parasta opiskelijaa.
+CUBESET = KUUTIOJOUKKO ## Määrittää lasketun jäsen- tai monikkojoukon lähettämällä joukon lausekkeita palvelimessa olevalle kuutiolle. Palvelin luo joukon ja palauttaa sen Microsoft Office Excelille.
+CUBESETCOUNT = KUUTIOJOUKKOJENMÄÄRÄ ## Palauttaa joukon kohteiden määrän.
+CUBEVALUE = KUUTIONARVO ## Palauttaa koostetun arvon kuutiosta.
+
+
+##
+## Database functions Tietokantafunktiot
+##
+DAVERAGE = TKESKIARVO ## Palauttaa valittujen tietokantamerkintöjen keskiarvon.
+DCOUNT = TLASKE ## Laskee tietokannan lukuja sisältävien solujen määrän.
+DCOUNTA = TLASKEA ## Laskee tietokannan tietoja sisältävien solujen määrän.
+DGET = TNOUDA ## Hakee määritettyjä ehtoja vastaavan tietueen tietokannasta.
+DMAX = TMAKS ## Palauttaa suurimman arvon tietokannasta valittujen arvojen joukosta.
+DMIN = TMIN ## Palauttaa pienimmän arvon tietokannasta valittujen arvojen joukosta.
+DPRODUCT = TTULO ## Kertoo määritetyn ehdon täyttävien tietokannan tietueiden tietyssä kentässä olevat arvot.
+DSTDEV = TKESKIHAJONTA ## Laskee keskihajonnan tietokannasta valituista arvoista muodostuvan otoksen perusteella.
+DSTDEVP = TKESKIHAJONTAP ## Laskee keskihajonnan tietokannasta valittujen arvojen koko populaation perusteella.
+DSUM = TSUMMA ## Lisää luvut määritetyn ehdon täyttävien tietokannan tietueiden kenttäsarakkeeseen.
+DVAR = TVARIANSSI ## Laskee varianssin tietokannasta valittujen arvojen otoksen perusteella.
+DVARP = TVARIANSSIP ## Laskee varianssin tietokannasta valittujen arvojen koko populaation perusteella.
+
+
+##
+## Date and time functions Päivämäärä- ja aikafunktiot
+##
+DATE = PÄIVÄYS ## Palauttaa annetun päivämäärän järjestysluvun.
+DATEVALUE = PÄIVÄYSARVO ## Muuntaa tekstimuodossa olevan päivämäärän järjestysluvuksi.
+DAY = PÄIVÄ ## Muuntaa järjestysluvun kuukauden päiväksi.
+DAYS360 = PÄIVÄT360 ## Laskee kahden päivämäärän välisten päivien määrän käyttäen perustana 360-päiväistä vuotta.
+EDATE = PÄIVÄ.KUUKAUSI ## Palauttaa järjestyslukuna päivämäärän, joka poikkeaa aloituspäivän päivämäärästä annetun kuukausimäärän verran joko eteen- tai taaksepäin.
+EOMONTH = KUUKAUSI.LOPPU ## Palauttaa järjestyslukuna sen kuukauden viimeisen päivämäärän, joka poikkeaa annetun kuukausimäärän verran eteen- tai taaksepäin.
+HOUR = TUNNIT ## Muuntaa järjestysluvun tunneiksi.
+MINUTE = MINUUTIT ## Muuntaa järjestysluvun minuuteiksi.
+MONTH = KUUKAUSI ## Muuntaa järjestysluvun kuukausiksi.
+NETWORKDAYS = TYÖPÄIVÄT ## Palauttaa kahden päivämäärän välissä olevien täysien työpäivien määrän.
+NOW = NYT ## Palauttaa kuluvan päivämäärän ja ajan järjestysnumeron.
+SECOND = SEKUNNIT ## Muuntaa järjestysluvun sekunneiksi.
+TIME = AIKA ## Palauttaa annetun kellonajan järjestysluvun.
+TIMEVALUE = AIKA_ARVO ## Muuntaa tekstimuodossa olevan kellonajan järjestysluvuksi.
+TODAY = TÄMÄ.PÄIVÄ ## Palauttaa kuluvan päivän päivämäärän järjestysluvun.
+WEEKDAY = VIIKONPÄIVÄ ## Muuntaa järjestysluvun viikonpäiväksi.
+WEEKNUM = VIIKKO.NRO ## Muuntaa järjestysluvun luvuksi, joka ilmaisee viikon järjestysluvun vuoden alusta laskettuna.
+WORKDAY = TYÖPÄIVÄ ## Palauttaa järjestysluvun päivämäärälle, joka sijaitsee annettujen työpäivien verran eteen tai taaksepäin.
+YEAR = VUOSI ## Muuntaa järjestysluvun vuosiksi.
+YEARFRAC = VUOSI.OSA ## Palauttaa määritettyjen päivämäärien (aloituspäivä ja lopetuspäivä) välisen osan vuodesta.
+
+
+##
+## Engineering functions Tekniset funktiot
+##
+BESSELI = BESSELI ## Palauttaa muunnetun Bessel-funktion In(x).
+BESSELJ = BESSELJ ## Palauttaa Bessel-funktion Jn(x).
+BESSELK = BESSELK ## Palauttaa muunnetun Bessel-funktion Kn(x).
+BESSELY = BESSELY ## Palauttaa Bessel-funktion Yn(x).
+BIN2DEC = BINDES ## Muuntaa binaariluvun desimaaliluvuksi.
+BIN2HEX = BINHEKSA ## Muuntaa binaariluvun heksadesimaaliluvuksi.
+BIN2OCT = BINOKT ## Muuntaa binaariluvun oktaaliluvuksi.
+COMPLEX = KOMPLEKSI ## Muuntaa reaali- ja imaginaariosien kertoimet kompleksiluvuksi.
+CONVERT = MUUNNA ## Muuntaa luvun toisen mittajärjestelmän mukaiseksi.
+DEC2BIN = DESBIN ## Muuntaa desimaaliluvun binaariluvuksi.
+DEC2HEX = DESHEKSA ## Muuntaa kymmenjärjestelmän luvun heksadesimaaliluvuksi.
+DEC2OCT = DESOKT ## Muuntaa kymmenjärjestelmän luvun oktaaliluvuksi.
+DELTA = SAMA.ARVO ## Tarkistaa, ovatko kaksi arvoa yhtä suuria.
+ERF = VIRHEFUNKTIO ## Palauttaa virhefunktion.
+ERFC = VIRHEFUNKTIO.KOMPLEMENTTI ## Palauttaa komplementtivirhefunktion.
+GESTEP = RAJA ## Testaa, onko luku suurempi kuin kynnysarvo.
+HEX2BIN = HEKSABIN ## Muuntaa heksadesimaaliluvun binaariluvuksi.
+HEX2DEC = HEKSADES ## Muuntaa heksadesimaaliluvun desimaaliluvuksi.
+HEX2OCT = HEKSAOKT ## Muuntaa heksadesimaaliluvun oktaaliluvuksi.
+IMABS = KOMPLEKSI.ITSEISARVO ## Palauttaa kompleksiluvun itseisarvon (moduluksen).
+IMAGINARY = KOMPLEKSI.IMAG ## Palauttaa kompleksiluvun imaginaariosan kertoimen.
+IMARGUMENT = KOMPLEKSI.ARG ## Palauttaa theeta-argumentin, joka on radiaaneina annettu kulma.
+IMCONJUGATE = KOMPLEKSI.KONJ ## Palauttaa kompleksiluvun konjugaattiluvun.
+IMCOS = KOMPLEKSI.COS ## Palauttaa kompleksiluvun kosinin.
+IMDIV = KOMPLEKSI.OSAM ## Palauttaa kahden kompleksiluvun osamäärän.
+IMEXP = KOMPLEKSI.EKSP ## Palauttaa kompleksiluvun eksponentin.
+IMLN = KOMPLEKSI.LN ## Palauttaa kompleksiluvun luonnollisen logaritmin.
+IMLOG10 = KOMPLEKSI.LOG10 ## Palauttaa kompleksiluvun kymmenkantaisen logaritmin.
+IMLOG2 = KOMPLEKSI.LOG2 ## Palauttaa kompleksiluvun kaksikantaisen logaritmin.
+IMPOWER = KOMPLEKSI.POT ## Palauttaa kokonaislukupotenssiin korotetun kompleksiluvun.
+IMPRODUCT = KOMPLEKSI.TULO ## Palauttaa kompleksilukujen tulon.
+IMREAL = KOMPLEKSI.REAALI ## Palauttaa kompleksiluvun reaaliosan kertoimen.
+IMSIN = KOMPLEKSI.SIN ## Palauttaa kompleksiluvun sinin.
+IMSQRT = KOMPLEKSI.NELIÖJ ## Palauttaa kompleksiluvun neliöjuuren.
+IMSUB = KOMPLEKSI.EROTUS ## Palauttaa kahden kompleksiluvun erotuksen.
+IMSUM = KOMPLEKSI.SUM ## Palauttaa kompleksilukujen summan.
+OCT2BIN = OKTBIN ## Muuntaa oktaaliluvun binaariluvuksi.
+OCT2DEC = OKTDES ## Muuntaa oktaaliluvun desimaaliluvuksi.
+OCT2HEX = OKTHEKSA ## Muuntaa oktaaliluvun heksadesimaaliluvuksi.
+
+
+##
+## Financial functions Rahoitusfunktiot
+##
+ACCRINT = KERTYNYT.KORKO ## Laskee arvopaperille kertyneen koron, kun korko kertyy säännöllisin väliajoin.
+ACCRINTM = KERTYNYT.KORKO.LOPUSSA ## Laskee arvopaperille kertyneen koron, kun korko maksetaan eräpäivänä.
+AMORDEGRC = AMORDEGRC ## Laskee kunkin laskentakauden poiston poistokerrointa käyttämällä.
+AMORLINC = AMORLINC ## Palauttaa kunkin laskentakauden poiston.
+COUPDAYBS = KORKOPÄIVÄT.ALUSTA ## Palauttaa koronmaksukauden aloituspäivän ja tilityspäivän välisen ajanjakson päivien määrän.
+COUPDAYS = KORKOPÄIVÄT ## Palauttaa päivien määrän koronmaksukaudelta, johon tilityspäivä kuuluu.
+COUPDAYSNC = KORKOPÄIVÄT.SEURAAVA ## Palauttaa tilityspäivän ja seuraavan koronmaksupäivän välisen ajanjakson päivien määrän.
+COUPNCD = KORKOMAKSU.SEURAAVA ## Palauttaa tilityspäivän jälkeisen seuraavan koronmaksupäivän.
+COUPNUM = KORKOPÄIVÄJAKSOT ## Palauttaa arvopaperin ostopäivän ja erääntymispäivän välisten koronmaksupäivien määrän.
+COUPPCD = KORKOPÄIVÄ.EDELLINEN ## Palauttaa tilityspäivää edeltävän koronmaksupäivän.
+CUMIPMT = MAKSETTU.KORKO ## Palauttaa kahden jakson välisenä aikana kertyneen koron.
+CUMPRINC = MAKSETTU.LYHENNYS ## Palauttaa lainalle kahden jakson välisenä aikana kertyneen lyhennyksen.
+DB = DB ## Palauttaa kauden kirjanpidollisen poiston amerikkalaisen DB-menetelmän (Fixed-declining balance) mukaan.
+DDB = DDB ## Palauttaa kauden kirjanpidollisen poiston amerikkalaisen DDB-menetelmän (Double-Declining Balance) tai jonkin muun määrittämäsi menetelmän mukaan.
+DISC = DISKONTTOKORKO ## Palauttaa arvopaperin diskonttokoron.
+DOLLARDE = VALUUTTA.DES ## Muuntaa murtolukuna ilmoitetun valuuttamäärän desimaaliluvuksi.
+DOLLARFR = VALUUTTA.MURTO ## Muuntaa desimaalilukuna ilmaistun valuuttamäärän murtoluvuksi.
+DURATION = KESTO ## Palauttaa keston arvopaperille, jonka koronmaksu tapahtuu säännöllisesti.
+EFFECT = KORKO.EFEKT ## Palauttaa todellisen vuosikoron.
+FV = TULEVA.ARVO ## Palauttaa sijoituksen tulevan arvon.
+FVSCHEDULE = TULEVA.ARVO.ERIKORKO ## Palauttaa pääoman tulevan arvon, kun pääomalle on kertynyt korkoa vaihtelevasti.
+INTRATE = KORKO.ARVOPAPERI ## Palauttaa arvopaperin korkokannan täysin sijoitetulle arvopaperille.
+IPMT = IPMT ## Laskee sijoitukselle tai lainalle tiettynä ajanjaksona kertyvän koron.
+IRR = SISÄINEN.KORKO ## Laskee sisäisen korkokannan kassavirrasta muodostuvalle sarjalle.
+ISPMT = ONMAKSU ## Laskee sijoituksen maksetun koron tietyllä jaksolla.
+MDURATION = KESTO.MUUNN ## Palauttaa muunnetun Macauley-keston arvopaperille, jonka oletettu nimellisarvo on 100 euroa.
+MIRR = MSISÄINEN ## Palauttaa sisäisen korkokannan, kun positiivisten ja negatiivisten kassavirtojen rahoituskorko on erilainen.
+NOMINAL = KORKO.VUOSI ## Palauttaa vuosittaisen nimelliskoron.
+NPER = NJAKSO ## Palauttaa sijoituksen jaksojen määrän.
+NPV = NNA ## Palauttaa sijoituksen nykyarvon toistuvista kassavirroista muodostuvan sarjan ja diskonttokoron perusteella.
+ODDFPRICE = PARITON.ENS.NIMELLISARVO ## Palauttaa arvopaperin hinnan tilanteessa, jossa ensimmäinen jakso on pariton.
+ODDFYIELD = PARITON.ENS.TUOTTO ## Palauttaa arvopaperin tuoton tilanteessa, jossa ensimmäinen jakso on pariton.
+ODDLPRICE = PARITON.VIIM.NIMELLISARVO ## Palauttaa arvopaperin hinnan tilanteessa, jossa viimeinen jakso on pariton.
+ODDLYIELD = PARITON.VIIM.TUOTTO ## Palauttaa arvopaperin tuoton tilanteessa, jossa viimeinen jakso on pariton.
+PMT = MAKSU ## Palauttaa annuiteetin kausittaisen maksuerän.
+PPMT = PPMT ## Laskee sijoitukselle tai lainalle tiettynä ajanjaksona maksettavan lyhennyksen.
+PRICE = HINTA ## Palauttaa hinnan 100 euron nimellisarvoa kohden arvopaperille, jonka korko maksetaan säännöllisin väliajoin.
+PRICEDISC = HINTA.DISK ## Palauttaa diskontatun arvopaperin hinnan 100 euron nimellisarvoa kohden.
+PRICEMAT = HINTA.LUNASTUS ## Palauttaa hinnan 100 euron nimellisarvoa kohden arvopaperille, jonka korko maksetaan erääntymispäivänä.
+PV = NA ## Palauttaa sijoituksen nykyarvon.
+RATE = KORKO ## Palauttaa annuiteetin kausittaisen korkokannan.
+RECEIVED = SAATU.HINTA ## Palauttaa arvopaperin tuoton erääntymispäivänä kokonaan maksetulle sijoitukselle.
+SLN = STP ## Palauttaa sijoituksen tasapoiston yhdeltä jaksolta.
+SYD = VUOSIPOISTO ## Palauttaa sijoituksen vuosipoiston annettuna kautena amerikkalaisen SYD-menetelmän (Sum-of-Year's Digits) avulla.
+TBILLEQ = OBLIG.TUOTTOPROS ## Palauttaa valtion obligaation tuoton vastaavana joukkovelkakirjan tuottona.
+TBILLPRICE = OBLIG.HINTA ## Palauttaa obligaation hinnan 100 euron nimellisarvoa kohden.
+TBILLYIELD = OBLIG.TUOTTO ## Palauttaa obligaation tuoton.
+VDB = VDB ## Palauttaa annetun kauden tai kauden osan kirjanpidollisen poiston amerikkalaisen DB-menetelmän (Fixed-declining balance) mukaan.
+XIRR = SISÄINEN.KORKO.JAKSOTON ## Palauttaa sisäisen korkokannan kassavirtojen sarjoille, jotka eivät välttämättä ole säännöllisiä.
+XNPV = NNA.JAKSOTON ## Palauttaa nettonykyarvon kassavirtasarjalle, joka ei välttämättä ole kausittainen.
+YIELD = TUOTTO ## Palauttaa tuoton arvopaperille, jonka korko maksetaan säännöllisin väliajoin.
+YIELDDISC = TUOTTO.DISK ## Palauttaa diskontatun arvopaperin, kuten obligaation, vuosittaisen tuoton.
+YIELDMAT = TUOTTO.ERÄP ## Palauttaa erääntymispäivänään korkoa tuottavan arvopaperin vuosittaisen tuoton.
+
+
+##
+## Information functions Erikoisfunktiot
+##
+CELL = SOLU ## Palauttaa tietoja solun muotoilusta, sijainnista ja sisällöstä.
+ERROR.TYPE = VIRHEEN.LAJI ## Palauttaa virhetyyppiä vastaavan luvun.
+INFO = KUVAUS ## Palauttaa tietoja nykyisestä käyttöympäristöstä.
+ISBLANK = ONTYHJÄ ## Palauttaa arvon TOSI, jos arvo on tyhjä.
+ISERR = ONVIRH ## Palauttaa arvon TOSI, jos arvo on mikä tahansa virhearvo paitsi arvo #PUUTTUU!.
+ISERROR = ONVIRHE ## Palauttaa arvon TOSI, jos arvo on mikä tahansa virhearvo.
+ISEVEN = ONPARILLINEN ## Palauttaa arvon TOSI, jos arvo on parillinen.
+ISLOGICAL = ONTOTUUS ## Palauttaa arvon TOSI, jos arvo on mikä tahansa looginen arvo.
+ISNA = ONPUUTTUU ## Palauttaa arvon TOSI, jos virhearvo on #PUUTTUU!.
+ISNONTEXT = ONEI_TEKSTI ## Palauttaa arvon TOSI, jos arvo ei ole teksti.
+ISNUMBER = ONLUKU ## Palauttaa arvon TOSI, jos arvo on luku.
+ISODD = ONPARITON ## Palauttaa arvon TOSI, jos arvo on pariton.
+ISREF = ONVIITT ## Palauttaa arvon TOSI, jos arvo on viittaus.
+ISTEXT = ONTEKSTI ## Palauttaa arvon TOSI, jos arvo on teksti.
+N = N ## Palauttaa arvon luvuksi muunnettuna.
+NA = PUUTTUU ## Palauttaa virhearvon #PUUTTUU!.
+TYPE = TYYPPI ## Palauttaa luvun, joka ilmaisee arvon tietotyypin.
+
+
+##
+## Logical functions Loogiset funktiot
+##
+AND = JA ## Palauttaa arvon TOSI, jos kaikkien argumenttien arvo on TOSI.
+FALSE = EPÄTOSI ## Palauttaa totuusarvon EPÄTOSI.
+IF = JOS ## Määrittää suoritettavan loogisen testin.
+IFERROR = JOSVIRHE ## Palauttaa määrittämäsi arvon, jos kaavan tulos on virhe; muussa tapauksessa palauttaa kaavan tuloksen.
+NOT = EI ## Kääntää argumentin loogisen arvon.
+OR = TAI ## Palauttaa arvon TOSI, jos minkä tahansa argumentin arvo on TOSI.
+TRUE = TOSI ## Palauttaa totuusarvon TOSI.
+
+
+##
+## Lookup and reference functions Haku- ja viitefunktiot
+##
+ADDRESS = OSOITE ## Palauttaa laskentataulukon soluun osoittavan viittauksen tekstinä.
+AREAS = ALUEET ## Palauttaa viittauksessa olevien alueiden määrän.
+CHOOSE = VALITSE.INDEKSI ## Valitsee arvon arvoluettelosta.
+COLUMN = SARAKE ## Palauttaa viittauksen sarakenumeron.
+COLUMNS = SARAKKEET ## Palauttaa viittauksessa olevien sarakkeiden määrän.
+HLOOKUP = VHAKU ## Suorittaa haun matriisin ylimmältä riviltä ja palauttaa määritetyn solun arvon.
+HYPERLINK = HYPERLINKKI ## Luo pikakuvakkeen tai tekstin, joka avaa verkkopalvelimeen, intranetiin tai Internetiin tallennetun tiedoston.
+INDEX = INDEKSI ## Valitsee arvon viittauksesta tai matriisista indeksin mukaan.
+INDIRECT = EPÄSUORA ## Palauttaa tekstiarvona ilmaistun viittauksen.
+LOOKUP = HAKU ## Etsii arvoja vektorista tai matriisista.
+MATCH = VASTINE ## Etsii arvoja viittauksesta tai matriisista.
+OFFSET = SIIRTYMÄ ## Palauttaa annetun viittauksen siirtymän.
+ROW = RIVI ## Palauttaa viittauksen rivinumeron.
+ROWS = RIVIT ## Palauttaa viittauksessa olevien rivien määrän.
+RTD = RTD ## Noutaa COM-automaatiota (automaatio: Tapa käsitellä sovelluksen objekteja toisesta sovelluksesta tai kehitystyökalusta. Automaatio, jota aiemmin kutsuttiin OLE-automaatioksi, on teollisuusstandardi ja COM-mallin (Component Object Model) ominaisuus.) tukevasta ohjelmasta reaaliaikaisia tietoja.
+TRANSPOSE = TRANSPONOI ## Palauttaa matriisin käänteismatriisin.
+VLOOKUP = PHAKU ## Suorittaa haun matriisin ensimmäisestä sarakkeesta ja palauttaa rivillä olevan solun arvon.
+
+
+##
+## Math and trigonometry functions Matemaattiset ja trigonometriset funktiot
+##
+ABS = ITSEISARVO ## Palauttaa luvun itseisarvon.
+ACOS = ACOS ## Palauttaa luvun arkuskosinin.
+ACOSH = ACOSH ## Palauttaa luvun käänteisen hyperbolisen kosinin.
+ASIN = ASIN ## Palauttaa luvun arkussinin.
+ASINH = ASINH ## Palauttaa luvun käänteisen hyperbolisen sinin.
+ATAN = ATAN ## Palauttaa luvun arkustangentin.
+ATAN2 = ATAN2 ## Palauttaa arkustangentin x- ja y-koordinaatin perusteella.
+ATANH = ATANH ## Palauttaa luvun käänteisen hyperbolisen tangentin.
+CEILING = PYÖRISTÄ.KERR.YLÖS ## Pyöristää luvun lähimpään kokonaislukuun tai tarkkuusargumentin lähimpään kerrannaiseen.
+COMBIN = KOMBINAATIO ## Palauttaa mahdollisten kombinaatioiden määrän annetulle objektien määrälle.
+COS = COS ## Palauttaa luvun kosinin.
+COSH = COSH ## Palauttaa luvun hyperbolisen kosinin.
+DEGREES = ASTEET ## Muuntaa radiaanit asteiksi.
+EVEN = PARILLINEN ## Pyöristää luvun ylöspäin lähimpään parilliseen kokonaislukuun.
+EXP = EKSPONENTTI ## Palauttaa e:n korotettuna annetun luvun osoittamaan potenssiin.
+FACT = KERTOMA ## Palauttaa luvun kertoman.
+FACTDOUBLE = KERTOMA.OSA ## Palauttaa luvun osakertoman.
+FLOOR = PYÖRISTÄ.KERR.ALAS ## Pyöristää luvun alaspäin (nollaa kohti).
+GCD = SUURIN.YHT.TEKIJÄ ## Palauttaa suurimman yhteisen tekijän.
+INT = KOKONAISLUKU ## Pyöristää luvun alaspäin lähimpään kokonaislukuun.
+LCM = PIENIN.YHT.JAETTAVA ## Palauttaa pienimmän yhteisen tekijän.
+LN = LUONNLOG ## Palauttaa luvun luonnollisen logaritmin.
+LOG = LOG ## Laskee luvun logaritmin käyttämällä annettua kantalukua.
+LOG10 = LOG10 ## Palauttaa luvun kymmenkantaisen logaritmin.
+MDETERM = MDETERM ## Palauttaa matriisin matriisideterminantin.
+MINVERSE = MKÄÄNTEINEN ## Palauttaa matriisin käänteismatriisin.
+MMULT = MKERRO ## Palauttaa kahden matriisin tulon.
+MOD = JAKOJ ## Palauttaa jakolaskun jäännöksen.
+MROUND = PYÖRISTÄ.KERR ## Palauttaa luvun pyöristettynä annetun luvun kerrannaiseen.
+MULTINOMIAL = MULTINOMI ## Palauttaa lukujoukon multinomin.
+ODD = PARITON ## Pyöristää luvun ylöspäin lähimpään parittomaan kokonaislukuun.
+PI = PII ## Palauttaa piin arvon.
+POWER = POTENSSI ## Palauttaa luvun korotettuna haluttuun potenssiin.
+PRODUCT = TULO ## Kertoo annetut argumentit.
+QUOTIENT = OSAMÄÄRÄ ## Palauttaa osamäärän kokonaislukuosan.
+RADIANS = RADIAANIT ## Muuntaa asteet radiaaneiksi.
+RAND = SATUNNAISLUKU ## Palauttaa satunnaisluvun väliltä 0–1.
+RANDBETWEEN = SATUNNAISLUKU.VÄLILTÄ ## Palauttaa satunnaisluvun määritettyjen lukujen väliltä.
+ROMAN = ROMAN ## Muuntaa arabialaisen numeron tekstimuotoiseksi roomalaiseksi numeroksi.
+ROUND = PYÖRISTÄ ## Pyöristää luvun annettuun määrään desimaaleja.
+ROUNDDOWN = PYÖRISTÄ.DES.ALAS ## Pyöristää luvun alaspäin (nollaa kohti).
+ROUNDUP = PYÖRISTÄ.DES.YLÖS ## Pyöristää luvun ylöspäin (poispäin nollasta).
+SERIESSUM = SARJA.SUMMA ## Palauttaa kaavaan perustuvan potenssisarjan arvon.
+SIGN = ETUMERKKI ## Palauttaa luvun etumerkin.
+SIN = SIN ## Palauttaa annetun kulman sinin.
+SINH = SINH ## Palauttaa luvun hyperbolisen sinin.
+SQRT = NELIÖJUURI ## Palauttaa positiivisen neliöjuuren.
+SQRTPI = NELIÖJUURI.PII ## Palauttaa tulon (luku * pii) neliöjuuren.
+SUBTOTAL = VÄLISUMMA ## Palauttaa luettelon tai tietokannan välisumman.
+SUM = SUMMA ## Laskee yhteen annetut argumentit.
+SUMIF = SUMMA.JOS ## Laskee ehdot täyttävien solujen summan.
+SUMIFS = SUMMA.JOS.JOUKKO ## Laskee yhteen solualueen useita ehtoja vastaavat solut.
+SUMPRODUCT = TULOJEN.SUMMA ## Palauttaa matriisin toisiaan vastaavien osien tulojen summan.
+SUMSQ = NELIÖSUMMA ## Palauttaa argumenttien neliöiden summan.
+SUMX2MY2 = NELIÖSUMMIEN.EROTUS ## Palauttaa kahden matriisin toisiaan vastaavien arvojen laskettujen neliösummien erotuksen.
+SUMX2PY2 = NELIÖSUMMIEN.SUMMA ## Palauttaa kahden matriisin toisiaan vastaavien arvojen neliösummien summan.
+SUMXMY2 = EROTUSTEN.NELIÖSUMMA ## Palauttaa kahden matriisin toisiaan vastaavien arvojen erotusten neliösumman.
+TAN = TAN ## Palauttaa luvun tangentin.
+TANH = TANH ## Palauttaa luvun hyperbolisen tangentin.
+TRUNC = KATKAISE ## Katkaisee luvun kokonaisluvuksi.
+
+
+##
+## Statistical functions Tilastolliset funktiot
+##
+AVEDEV = KESKIPOIKKEAMA ## Palauttaa hajontojen itseisarvojen keskiarvon.
+AVERAGE = KESKIARVO ## Palauttaa argumenttien keskiarvon.
+AVERAGEA = KESKIARVOA ## Palauttaa argumenttien, mukaan lukien lukujen, tekstin ja loogisten arvojen, keskiarvon.
+AVERAGEIF = KESKIARVO.JOS ## Palauttaa alueen niiden solujen keskiarvon (aritmeettisen keskiarvon), jotka täyttävät annetut ehdot.
+AVERAGEIFS = KESKIARVO.JOS.JOUKKO ## Palauttaa niiden solujen keskiarvon (aritmeettisen keskiarvon), jotka vastaavat useita ehtoja.
+BETADIST = BEETAJAKAUMA ## Palauttaa kumulatiivisen beetajakaumafunktion arvon.
+BETAINV = BEETAJAKAUMA.KÄÄNT ## Palauttaa määritetyn beetajakauman käänteisen kumulatiivisen jakaumafunktion arvon.
+BINOMDIST = BINOMIJAKAUMA ## Palauttaa yksittäisen termin binomijakaumatodennäköisyyden.
+CHIDIST = CHIJAKAUMA ## Palauttaa yksisuuntaisen chi-neliön jakauman todennäköisyyden.
+CHIINV = CHIJAKAUMA.KÄÄNT ## Palauttaa yksisuuntaisen chi-neliön jakauman todennäköisyyden käänteisarvon.
+CHITEST = CHITESTI ## Palauttaa riippumattomuustestin tuloksen.
+CONFIDENCE = LUOTTAMUSVÄLI ## Palauttaa luottamusvälin populaation keskiarvolle.
+CORREL = KORRELAATIO ## Palauttaa kahden arvojoukon korrelaatiokertoimen.
+COUNT = LASKE ## Laskee argumenttiluettelossa olevien lukujen määrän.
+COUNTA = LASKE.A ## Laskee argumenttiluettelossa olevien arvojen määrän.
+COUNTBLANK = LASKE.TYHJÄT ## Laskee alueella olevien tyhjien solujen määrän.
+COUNTIF = LASKE.JOS ## Laskee alueella olevien sellaisten solujen määrän, joiden sisältö vastaa annettuja ehtoja.
+COUNTIFS = LASKE.JOS.JOUKKO ## Laskee alueella olevien sellaisten solujen määrän, joiden sisältö vastaa useita ehtoja.
+COVAR = KOVARIANSSI ## Palauttaa kovarianssin, joka on keskiarvo havaintoaineiston kunkin pisteparin poikkeamien tuloista.
+CRITBINOM = BINOMIJAKAUMA.KRIT ## Palauttaa pienimmän arvon, jossa binomijakauman kertymäfunktion arvo on pienempi tai yhtä suuri kuin vertailuarvo.
+DEVSQ = OIKAISTU.NELIÖSUMMA ## Palauttaa keskipoikkeamien neliösumman.
+EXPONDIST = EKSPONENTIAALIJAKAUMA ## Palauttaa eksponentiaalijakauman.
+FDIST = FJAKAUMA ## Palauttaa F-todennäköisyysjakauman.
+FINV = FJAKAUMA.KÄÄNT ## Palauttaa F-todennäköisyysjakauman käänteisfunktion.
+FISHER = FISHER ## Palauttaa Fisher-muunnoksen.
+FISHERINV = FISHER.KÄÄNT ## Palauttaa käänteisen Fisher-muunnoksen.
+FORECAST = ENNUSTE ## Palauttaa lineaarisen trendin arvon.
+FREQUENCY = TAAJUUS ## Palauttaa frekvenssijakautuman pystysuuntaisena matriisina.
+FTEST = FTESTI ## Palauttaa F-testin tuloksen.
+GAMMADIST = GAMMAJAKAUMA ## Palauttaa gammajakauman.
+GAMMAINV = GAMMAJAKAUMA.KÄÄNT ## Palauttaa käänteisen gammajakauman kertymäfunktion.
+GAMMALN = GAMMALN ## Palauttaa gammafunktion luonnollisen logaritmin G(x).
+GEOMEAN = KESKIARVO.GEOM ## Palauttaa geometrisen keskiarvon.
+GROWTH = KASVU ## Palauttaa eksponentiaalisen trendin arvon.
+HARMEAN = KESKIARVO.HARM ## Palauttaa harmonisen keskiarvon.
+HYPGEOMDIST = HYPERGEOM.JAKAUMA ## Palauttaa hypergeometrisen jakauman.
+INTERCEPT = LEIKKAUSPISTE ## Palauttaa lineaarisen regressiosuoran leikkauspisteen.
+KURT = KURT ## Palauttaa tietoalueen vinous-arvon eli huipukkuuden.
+LARGE = SUURI ## Palauttaa tietojoukon k:nneksi suurimman arvon.
+LINEST = LINREGR ## Palauttaa lineaarisen trendin parametrit.
+LOGEST = LOGREGR ## Palauttaa eksponentiaalisen trendin parametrit.
+LOGINV = LOGNORM.JAKAUMA.KÄÄNT ## Palauttaa lognormeeratun jakauman käänteisfunktion.
+LOGNORMDIST = LOGNORM.JAKAUMA ## Palauttaa lognormaalisen jakauman kertymäfunktion.
+MAX = MAKS ## Palauttaa suurimman arvon argumenttiluettelosta.
+MAXA = MAKSA ## Palauttaa argumenttien, mukaan lukien lukujen, tekstin ja loogisten arvojen, suurimman arvon.
+MEDIAN = MEDIAANI ## Palauttaa annettujen lukujen mediaanin.
+MIN = MIN ## Palauttaa pienimmän arvon argumenttiluettelosta.
+MINA = MINA ## Palauttaa argumenttien, mukaan lukien lukujen, tekstin ja loogisten arvojen, pienimmän arvon.
+MODE = MOODI ## Palauttaa tietojoukossa useimmin esiintyvän arvon.
+NEGBINOMDIST = BINOMIJAKAUMA.NEG ## Palauttaa negatiivisen binomijakauman.
+NORMDIST = NORM.JAKAUMA ## Palauttaa normaalijakauman kertymäfunktion.
+NORMINV = NORM.JAKAUMA.KÄÄNT ## Palauttaa käänteisen normaalijakauman kertymäfunktion.
+NORMSDIST = NORM.JAKAUMA.NORMIT ## Palauttaa normitetun normaalijakauman kertymäfunktion.
+NORMSINV = NORM.JAKAUMA.NORMIT.KÄÄNT ## Palauttaa normitetun normaalijakauman kertymäfunktion käänteisarvon.
+PEARSON = PEARSON ## Palauttaa Pearsonin tulomomenttikorrelaatiokertoimen.
+PERCENTILE = PROSENTTIPISTE ## Palauttaa alueen arvojen k:nnen prosenttipisteen.
+PERCENTRANK = PROSENTTIJÄRJESTYS ## Palauttaa tietojoukon arvon prosentuaalisen järjestysluvun.
+PERMUT = PERMUTAATIO ## Palauttaa mahdollisten permutaatioiden määrän annetulle objektien määrälle.
+POISSON = POISSON ## Palauttaa Poissonin todennäköisyysjakauman.
+PROB = TODENNÄKÖISYYS ## Palauttaa todennäköisyyden sille, että arvot ovat tietyltä väliltä.
+QUARTILE = NELJÄNNES ## Palauttaa tietoalueen neljänneksen.
+RANK = ARVON.MUKAAN ## Palauttaa luvun paikan lukuarvoluettelossa.
+RSQ = PEARSON.NELIÖ ## Palauttaa Pearsonin tulomomenttikorrelaatiokertoimen neliön.
+SKEW = JAKAUMAN.VINOUS ## Palauttaa jakauman vinouden.
+SLOPE = KULMAKERROIN ## Palauttaa lineaarisen regressiosuoran kulmakertoimen.
+SMALL = PIENI ## Palauttaa tietojoukon k:nneksi pienimmän arvon.
+STANDARDIZE = NORMITA ## Palauttaa normitetun arvon.
+STDEV = KESKIHAJONTA ## Laskee populaation keskihajonnan otoksen perusteella.
+STDEVA = KESKIHAJONTAA ## Laskee populaation keskihajonnan otoksen perusteella, mukaan lukien luvut, tekstin ja loogiset arvot.
+STDEVP = KESKIHAJONTAP ## Laskee normaalijakautuman koko populaation perusteella.
+STDEVPA = KESKIHAJONTAPA ## Laskee populaation keskihajonnan koko populaation perusteella, mukaan lukien luvut, tekstin ja totuusarvot.
+STEYX = KESKIVIRHE ## Palauttaa regression kutakin x-arvoa vastaavan ennustetun y-arvon keskivirheen.
+TDIST = TJAKAUMA ## Palauttaa t-jakautuman.
+TINV = TJAKAUMA.KÄÄNT ## Palauttaa käänteisen t-jakauman.
+TREND = SUUNTAUS ## Palauttaa lineaarisen trendin arvoja.
+TRIMMEAN = KESKIARVO.TASATTU ## Palauttaa tietojoukon tasatun keskiarvon.
+TTEST = TTESTI ## Palauttaa t-testiin liittyvän todennäköisyyden.
+VAR = VAR ## Arvioi populaation varianssia otoksen perusteella.
+VARA = VARA ## Laskee populaation varianssin otoksen perusteella, mukaan lukien luvut, tekstin ja loogiset arvot.
+VARP = VARP ## Laskee varianssin koko populaation perusteella.
+VARPA = VARPA ## Laskee populaation varianssin koko populaation perusteella, mukaan lukien luvut, tekstin ja totuusarvot.
+WEIBULL = WEIBULL ## Palauttaa Weibullin jakauman.
+ZTEST = ZTESTI ## Palauttaa z-testin yksisuuntaisen todennäköisyysarvon.
+
+
+##
+## Text functions Tekstifunktiot
+##
+ASC = ASC ## Muuntaa merkkijonossa olevat englanninkieliset DBCS- tai katakana-merkit SBCS-merkeiksi.
+BAHTTEXT = BAHTTEKSTI ## Muuntaa luvun tekstiksi ß (baht) -valuuttamuotoa käyttämällä.
+CHAR = MERKKI ## Palauttaa koodin lukua vastaavan merkin.
+CLEAN = SIIVOA ## Poistaa tekstistä kaikki tulostumattomat merkit.
+CODE = KOODI ## Palauttaa tekstimerkkijonon ensimmäisen merkin numerokoodin.
+CONCATENATE = KETJUTA ## Yhdistää useat merkkijonot yhdeksi merkkijonoksi.
+DOLLAR = VALUUTTA ## Muuntaa luvun tekstiksi $ (dollari) -valuuttamuotoa käyttämällä.
+EXACT = VERTAA ## Tarkistaa, ovatko kaksi tekstiarvoa samanlaiset.
+FIND = ETSI ## Etsii tekstiarvon toisen tekstin sisältä (tunnistaa isot ja pienet kirjaimet).
+FINDB = ETSIB ## Etsii tekstiarvon toisen tekstin sisältä (tunnistaa isot ja pienet kirjaimet).
+FIXED = KIINTEÄ ## Muotoilee luvun tekstiksi, jossa on kiinteä määrä desimaaleja.
+JIS = JIS ## Muuntaa merkkijonossa olevat englanninkieliset SBCS- tai katakana-merkit DBCS-merkeiksi.
+LEFT = VASEN ## Palauttaa tekstiarvon vasemmanpuoliset merkit.
+LEFTB = VASENB ## Palauttaa tekstiarvon vasemmanpuoliset merkit.
+LEN = PITUUS ## Palauttaa tekstimerkkijonon merkkien määrän.
+LENB = PITUUSB ## Palauttaa tekstimerkkijonon merkkien määrän.
+LOWER = PIENET ## Muuntaa tekstin pieniksi kirjaimiksi.
+MID = POIMI.TEKSTI ## Palauttaa määritetyn määrän merkkejä merkkijonosta alkaen annetusta kohdasta.
+MIDB = POIMI.TEKSTIB ## Palauttaa määritetyn määrän merkkejä merkkijonosta alkaen annetusta kohdasta.
+PHONETIC = FONEETTINEN ## Hakee foneettiset (furigana) merkit merkkijonosta.
+PROPER = ERISNIMI ## Muuttaa merkkijonon kunkin sanan ensimmäisen kirjaimen isoksi.
+REPLACE = KORVAA ## Korvaa tekstissä olevat merkit.
+REPLACEB = KORVAAB ## Korvaa tekstissä olevat merkit.
+REPT = TOISTA ## Toistaa tekstin annetun määrän kertoja.
+RIGHT = OIKEA ## Palauttaa tekstiarvon oikeanpuoliset merkit.
+RIGHTB = OIKEAB ## Palauttaa tekstiarvon oikeanpuoliset merkit.
+SEARCH = KÄY.LÄPI ## Etsii tekstiarvon toisen tekstin sisältä (isot ja pienet kirjaimet tulkitaan samoiksi merkeiksi).
+SEARCHB = KÄY.LÄPIB ## Etsii tekstiarvon toisen tekstin sisältä (isot ja pienet kirjaimet tulkitaan samoiksi merkeiksi).
+SUBSTITUTE = VAIHDA ## Korvaa merkkijonossa olevan tekstin toisella.
+T = T ## Muuntaa argumentit tekstiksi.
+TEXT = TEKSTI ## Muotoilee luvun ja muuntaa sen tekstiksi.
+TRIM = POISTA.VÄLIT ## Poistaa välilyönnit tekstistä.
+UPPER = ISOT ## Muuntaa tekstin isoiksi kirjaimiksi.
+VALUE = ARVO ## Muuntaa tekstiargumentin luvuksi.
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fr/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fr/config
new file mode 100644
index 00000000000..81895986f49
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fr/config
@@ -0,0 +1,24 @@
+##
+## PhpSpreadsheet
+##
+
+ArgumentSeparator = ;
+
+
+##
+## (For future use)
+##
+currencySymbol = €
+
+
+##
+## Excel Error Codes (For future use)
+
+##
+NULL = #NUL!
+DIV0 = #DIV/0!
+VALUE = #VALEUR!
+REF = #REF!
+NAME = #NOM?
+NUM = #NOMBRE!
+NA = #N/A
diff --git a/lib/phpexcel/PHPExcel/locale/fr/functions b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fr/functions
similarity index 95%
rename from lib/phpexcel/PHPExcel/locale/fr/functions
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fr/functions
index 03b80e5a401..7f40d5fdeb0 100644
--- a/lib/phpexcel/PHPExcel/locale/fr/functions
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/fr/functions
@@ -1,438 +1,416 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Calculation
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/
-##
-##
-
-
-##
-## Add-in and Automation functions Fonctions de complément et d’automatisation
-##
-GETPIVOTDATA = LIREDONNEESTABCROISDYNAMIQUE ## Renvoie les données stockées dans un rapport de tableau croisé dynamique.
-
-
-##
-## Cube functions Fonctions Cube
-##
-CUBEKPIMEMBER = MEMBREKPICUBE ## Renvoie un nom, une propriété et une mesure d’indicateur de performance clé et affiche le nom et la propriété dans la cellule. Un indicateur de performance clé est une mesure quantifiable, telle que la marge bénéficiaire brute mensuelle ou la rotation trimestrielle du personnel, utilisée pour évaluer les performances d’une entreprise.
-CUBEMEMBER = MEMBRECUBE ## Renvoie un membre ou un uplet dans une hiérarchie de cubes. Utilisez cette fonction pour valider l’existence du membre ou de l’uplet dans le cube.
-CUBEMEMBERPROPERTY = PROPRIETEMEMBRECUBE ## Renvoie la valeur d’une propriété de membre du cube. Utilisez cette fonction pour valider l’existence d’un nom de membre dans le cube et pour renvoyer la propriété spécifiée pour ce membre.
-CUBERANKEDMEMBER = RANGMEMBRECUBE ## Renvoie le nième membre ou le membre placé à un certain rang dans un ensemble. Utilisez cette fonction pour renvoyer un ou plusieurs éléments d’un ensemble, tels que les meilleurs vendeurs ou les 10 meilleurs étudiants.
-CUBESET = JEUCUBE ## Définit un ensemble calculé de membres ou d’uplets en envoyant une expression définie au cube sur le serveur qui crée l’ensemble et le renvoie à Microsoft Office Excel.
-CUBESETCOUNT = NBJEUCUBE ## Renvoie le nombre d’éléments dans un jeu.
-CUBEVALUE = VALEURCUBE ## Renvoie une valeur d’agrégation issue d’un cube.
-
-
-##
-## Database functions Fonctions de base de données
-##
-DAVERAGE = BDMOYENNE ## Renvoie la moyenne des entrées de base de données sélectionnées.
-DCOUNT = BCOMPTE ## Compte le nombre de cellules d’une base de données qui contiennent des nombres.
-DCOUNTA = BDNBVAL ## Compte les cellules non vides d’une base de données.
-DGET = BDLIRE ## Extrait d’une base de données un enregistrement unique répondant aux critères spécifiés.
-DMAX = BDMAX ## Renvoie la valeur maximale des entrées de base de données sélectionnées.
-DMIN = BDMIN ## Renvoie la valeur minimale des entrées de base de données sélectionnées.
-DPRODUCT = BDPRODUIT ## Multiplie les valeurs d’un champ particulier des enregistrements d’une base de données, qui répondent aux critères spécifiés.
-DSTDEV = BDECARTYPE ## Calcule l’écart type pour un échantillon d’entrées de base de données sélectionnées.
-DSTDEVP = BDECARTYPEP ## Calcule l’écart type pour l’ensemble d’une population d’entrées de base de données sélectionnées.
-DSUM = BDSOMME ## Ajoute les nombres dans la colonne de champ des enregistrements de la base de données, qui répondent aux critères.
-DVAR = BDVAR ## Calcule la variance pour un échantillon d’entrées de base de données sélectionnées.
-DVARP = BDVARP ## Calcule la variance pour l’ensemble d’une population d’entrées de base de données sélectionnées.
-
-
-##
-## Date and time functions Fonctions de date et d’heure
-##
-DATE = DATE ## Renvoie le numéro de série d’une date précise.
-DATEVALUE = DATEVAL ## Convertit une date représentée sous forme de texte en numéro de série.
-DAY = JOUR ## Convertit un numéro de série en jour du mois.
-DAYS360 = JOURS360 ## Calcule le nombre de jours qui séparent deux dates sur la base d’une année de 360 jours.
-EDATE = MOIS.DECALER ## Renvoie le numéro séquentiel de la date qui représente une date spécifiée (l’argument date_départ), corrigée en plus ou en moins du nombre de mois indiqué.
-EOMONTH = FIN.MOIS ## Renvoie le numéro séquentiel de la date du dernier jour du mois précédant ou suivant la date_départ du nombre de mois indiqué.
-HOUR = HEURE ## Convertit un numéro de série en heure.
-MINUTE = MINUTE ## Convertit un numéro de série en minute.
-MONTH = MOIS ## Convertit un numéro de série en mois.
-NETWORKDAYS = NB.JOURS.OUVRES ## Renvoie le nombre de jours ouvrés entiers compris entre deux dates.
-NOW = MAINTENANT ## Renvoie le numéro de série de la date et de l’heure du jour.
-SECOND = SECONDE ## Convertit un numéro de série en seconde.
-TIME = TEMPS ## Renvoie le numéro de série d’une heure précise.
-TIMEVALUE = TEMPSVAL ## Convertit une date représentée sous forme de texte en numéro de série.
-TODAY = AUJOURDHUI ## Renvoie le numéro de série de la date du jour.
-WEEKDAY = JOURSEM ## Convertit un numéro de série en jour de la semaine.
-WEEKNUM = NO.SEMAINE ## Convertit un numéro de série en un numéro représentant l’ordre de la semaine dans l’année.
-WORKDAY = SERIE.JOUR.OUVRE ## Renvoie le numéro de série de la date avant ou après le nombre de jours ouvrés spécifiés.
-YEAR = ANNEE ## Convertit un numéro de série en année.
-YEARFRAC = FRACTION.ANNEE ## Renvoie la fraction de l’année représentant le nombre de jours entre la date de début et la date de fin.
-
-
-##
-## Engineering functions Fonctions d’ingénierie
-##
-BESSELI = BESSELI ## Renvoie la fonction Bessel modifiée In(x).
-BESSELJ = BESSELJ ## Renvoie la fonction Bessel Jn(x).
-BESSELK = BESSELK ## Renvoie la fonction Bessel modifiée Kn(x).
-BESSELY = BESSELY ## Renvoie la fonction Bessel Yn(x).
-BIN2DEC = BINDEC ## Convertit un nombre binaire en nombre décimal.
-BIN2HEX = BINHEX ## Convertit un nombre binaire en nombre hexadécimal.
-BIN2OCT = BINOCT ## Convertit un nombre binaire en nombre octal.
-COMPLEX = COMPLEXE ## Convertit des coefficients réel et imaginaire en un nombre complexe.
-CONVERT = CONVERT ## Convertit un nombre d’une unité de mesure à une autre.
-DEC2BIN = DECBIN ## Convertit un nombre décimal en nombre binaire.
-DEC2HEX = DECHEX ## Convertit un nombre décimal en nombre hexadécimal.
-DEC2OCT = DECOCT ## Convertit un nombre décimal en nombre octal.
-DELTA = DELTA ## Teste l’égalité de deux nombres.
-ERF = ERF ## Renvoie la valeur de la fonction d’erreur.
-ERFC = ERFC ## Renvoie la valeur de la fonction d’erreur complémentaire.
-GESTEP = SUP.SEUIL ## Teste si un nombre est supérieur à une valeur de seuil.
-HEX2BIN = HEXBIN ## Convertit un nombre hexadécimal en nombre binaire.
-HEX2DEC = HEXDEC ## Convertit un nombre hexadécimal en nombre décimal.
-HEX2OCT = HEXOCT ## Convertit un nombre hexadécimal en nombre octal.
-IMABS = COMPLEXE.MODULE ## Renvoie la valeur absolue (module) d’un nombre complexe.
-IMAGINARY = COMPLEXE.IMAGINAIRE ## Renvoie le coefficient imaginaire d’un nombre complexe.
-IMARGUMENT = COMPLEXE.ARGUMENT ## Renvoie l’argument thêta, un angle exprimé en radians.
-IMCONJUGATE = COMPLEXE.CONJUGUE ## Renvoie le nombre complexe conjugué d’un nombre complexe.
-IMCOS = IMCOS ## Renvoie le cosinus d’un nombre complexe.
-IMDIV = COMPLEXE.DIV ## Renvoie le quotient de deux nombres complexes.
-IMEXP = COMPLEXE.EXP ## Renvoie la fonction exponentielle d’un nombre complexe.
-IMLN = COMPLEXE.LN ## Renvoie le logarithme népérien d’un nombre complexe.
-IMLOG10 = COMPLEXE.LOG10 ## Calcule le logarithme en base 10 d’un nombre complexe.
-IMLOG2 = COMPLEXE.LOG2 ## Calcule le logarithme en base 2 d’un nombre complexe.
-IMPOWER = COMPLEXE.PUISSANCE ## Renvoie un nombre complexe élevé à une puissance entière.
-IMPRODUCT = COMPLEXE.PRODUIT ## Renvoie le produit de plusieurs nombres complexes.
-IMREAL = COMPLEXE.REEL ## Renvoie le coefficient réel d’un nombre complexe.
-IMSIN = COMPLEXE.SIN ## Renvoie le sinus d’un nombre complexe.
-IMSQRT = COMPLEXE.RACINE ## Renvoie la racine carrée d’un nombre complexe.
-IMSUB = COMPLEXE.DIFFERENCE ## Renvoie la différence entre deux nombres complexes.
-IMSUM = COMPLEXE.SOMME ## Renvoie la somme de plusieurs nombres complexes.
-OCT2BIN = OCTBIN ## Convertit un nombre octal en nombre binaire.
-OCT2DEC = OCTDEC ## Convertit un nombre octal en nombre décimal.
-OCT2HEX = OCTHEX ## Convertit un nombre octal en nombre hexadécimal.
-
-
-##
-## Financial functions Fonctions financières
-##
-ACCRINT = INTERET.ACC ## Renvoie l’intérêt couru non échu d’un titre dont l’intérêt est perçu périodiquement.
-ACCRINTM = INTERET.ACC.MAT ## Renvoie l’intérêt couru non échu d’un titre dont l’intérêt est perçu à l’échéance.
-AMORDEGRC = AMORDEGRC ## Renvoie l’amortissement correspondant à chaque période comptable en utilisant un coefficient d’amortissement.
-AMORLINC = AMORLINC ## Renvoie l’amortissement d’un bien à la fin d’une période fiscale donnée.
-COUPDAYBS = NB.JOURS.COUPON.PREC ## Renvoie le nombre de jours entre le début de la période de coupon et la date de liquidation.
-COUPDAYS = NB.JOURS.COUPONS ## Renvoie le nombre de jours pour la période du coupon contenant la date de liquidation.
-COUPDAYSNC = NB.JOURS.COUPON.SUIV ## Renvoie le nombre de jours entre la date de liquidation et la date du coupon suivant la date de liquidation.
-COUPNCD = DATE.COUPON.SUIV ## Renvoie la première date de coupon ultérieure à la date de règlement.
-COUPNUM = NB.COUPONS ## Renvoie le nombre de coupons dus entre la date de règlement et la date d’échéance.
-COUPPCD = DATE.COUPON.PREC ## Renvoie la date de coupon précédant la date de règlement.
-CUMIPMT = CUMUL.INTER ## Renvoie l’intérêt cumulé payé sur un emprunt entre deux périodes.
-CUMPRINC = CUMUL.PRINCPER ## Renvoie le montant cumulé des remboursements du capital d’un emprunt effectués entre deux périodes.
-DB = DB ## Renvoie l’amortissement d’un bien pour une période spécifiée en utilisant la méthode de l’amortissement dégressif à taux fixe.
-DDB = DDB ## Renvoie l’amortissement d’un bien pour toute période spécifiée, en utilisant la méthode de l’amortissement dégressif à taux double ou selon un coefficient à spécifier.
-DISC = TAUX.ESCOMPTE ## Calcule le taux d’escompte d’une transaction.
-DOLLARDE = PRIX.DEC ## Convertit un prix en euros, exprimé sous forme de fraction, en un prix en euros exprimé sous forme de nombre décimal.
-DOLLARFR = PRIX.FRAC ## Convertit un prix en euros, exprimé sous forme de nombre décimal, en un prix en euros exprimé sous forme de fraction.
-DURATION = DUREE ## Renvoie la durée, en années, d’un titre dont l’intérêt est perçu périodiquement.
-EFFECT = TAUX.EFFECTIF ## Renvoie le taux d’intérêt annuel effectif.
-FV = VC ## Renvoie la valeur future d’un investissement.
-FVSCHEDULE = VC.PAIEMENTS ## Calcule la valeur future d’un investissement en appliquant une série de taux d’intérêt composites.
-INTRATE = TAUX.INTERET ## Affiche le taux d’intérêt d’un titre totalement investi.
-IPMT = INTPER ## Calcule le montant des intérêts d’un investissement pour une période donnée.
-IRR = TRI ## Calcule le taux de rentabilité interne d’un investissement pour une succession de trésoreries.
-ISPMT = ISPMT ## Calcule le montant des intérêts d’un investissement pour une période donnée.
-MDURATION = DUREE.MODIFIEE ## Renvoie la durée de Macauley modifiée pour un titre ayant une valeur nominale hypothétique de 100_euros.
-MIRR = TRIM ## Calcule le taux de rentabilité interne lorsque les paiements positifs et négatifs sont financés à des taux différents.
-NOMINAL = TAUX.NOMINAL ## Calcule le taux d’intérêt nominal annuel.
-NPER = NPM ## Renvoie le nombre de versements nécessaires pour rembourser un emprunt.
-NPV = VAN ## Calcule la valeur actuelle nette d’un investissement basé sur une série de décaissements et un taux d’escompte.
-ODDFPRICE = PRIX.PCOUPON.IRREG ## Renvoie le prix par tranche de valeur nominale de 100 euros d’un titre dont la première période de coupon est irrégulière.
-ODDFYIELD = REND.PCOUPON.IRREG ## Renvoie le taux de rendement d’un titre dont la première période de coupon est irrégulière.
-ODDLPRICE = PRIX.DCOUPON.IRREG ## Renvoie le prix par tranche de valeur nominale de 100 euros d’un titre dont la première période de coupon est irrégulière.
-ODDLYIELD = REND.DCOUPON.IRREG ## Renvoie le taux de rendement d’un titre dont la dernière période de coupon est irrégulière.
-PMT = VPM ## Calcule le paiement périodique d’un investissement donné.
-PPMT = PRINCPER ## Calcule, pour une période donnée, la part de remboursement du principal d’un investissement.
-PRICE = PRIX.TITRE ## Renvoie le prix d’un titre rapportant des intérêts périodiques, pour une valeur nominale de 100 euros.
-PRICEDISC = VALEUR.ENCAISSEMENT ## Renvoie la valeur d’encaissement d’un escompte commercial, pour une valeur nominale de 100 euros.
-PRICEMAT = PRIX.TITRE.ECHEANCE ## Renvoie le prix d’un titre dont la valeur nominale est 100 euros et qui rapporte des intérêts à l’échéance.
-PV = PV ## Calcule la valeur actuelle d’un investissement.
-RATE = TAUX ## Calcule le taux d’intérêt par période pour une annuité.
-RECEIVED = VALEUR.NOMINALE ## Renvoie la valeur nominale à échéance d’un effet de commerce.
-SLN = AMORLIN ## Calcule l’amortissement linéaire d’un bien pour une période donnée.
-SYD = SYD ## Calcule l’amortissement d’un bien pour une période donnée sur la base de la méthode américaine Sum-of-Years Digits (amortissement dégressif à taux décroissant appliqué à une valeur constante).
-TBILLEQ = TAUX.ESCOMPTE.R ## Renvoie le taux d’escompte rationnel d’un bon du Trésor.
-TBILLPRICE = PRIX.BON.TRESOR ## Renvoie le prix d’un bon du Trésor d’une valeur nominale de 100 euros.
-TBILLYIELD = RENDEMENT.BON.TRESOR ## Calcule le taux de rendement d’un bon du Trésor.
-VDB = VDB ## Renvoie l’amortissement d’un bien pour une période spécifiée ou partielle en utilisant une méthode de l’amortissement dégressif à taux fixe.
-XIRR = TRI.PAIEMENTS ## Calcule le taux de rentabilité interne d’un ensemble de paiements non périodiques.
-XNPV = VAN.PAIEMENTS ## Renvoie la valeur actuelle nette d’un ensemble de paiements non périodiques.
-YIELD = RENDEMENT.TITRE ## Calcule le rendement d’un titre rapportant des intérêts périodiquement.
-YIELDDISC = RENDEMENT.SIMPLE ## Calcule le taux de rendement d’un emprunt à intérêt simple (par exemple, un bon du Trésor).
-YIELDMAT = RENDEMENT.TITRE.ECHEANCE ## Renvoie le rendement annuel d’un titre qui rapporte des intérêts à l’échéance.
-
-
-##
-## Information functions Fonctions d’information
-##
-CELL = CELLULE ## Renvoie des informations sur la mise en forme, l’emplacement et le contenu d’une cellule.
-ERROR.TYPE = TYPE.ERREUR ## Renvoie un nombre correspondant à un type d’erreur.
-INFO = INFORMATIONS ## Renvoie des informations sur l’environnement d’exploitation actuel.
-ISBLANK = ESTVIDE ## Renvoie VRAI si l’argument valeur est vide.
-ISERR = ESTERR ## Renvoie VRAI si l’argument valeur fait référence à une valeur d’erreur, sauf #N/A.
-ISERROR = ESTERREUR ## Renvoie VRAI si l’argument valeur fait référence à une valeur d’erreur.
-ISEVEN = EST.PAIR ## Renvoie VRAI si le chiffre est pair.
-ISLOGICAL = ESTLOGIQUE ## Renvoie VRAI si l’argument valeur fait référence à une valeur logique.
-ISNA = ESTNA ## Renvoie VRAI si l’argument valeur fait référence à la valeur d’erreur #N/A.
-ISNONTEXT = ESTNONTEXTE ## Renvoie VRAI si l’argument valeur ne se présente pas sous forme de texte.
-ISNUMBER = ESTNUM ## Renvoie VRAI si l’argument valeur représente un nombre.
-ISODD = EST.IMPAIR ## Renvoie VRAI si le chiffre est impair.
-ISREF = ESTREF ## Renvoie VRAI si l’argument valeur est une référence.
-ISTEXT = ESTTEXTE ## Renvoie VRAI si l’argument valeur se présente sous forme de texte.
-N = N ## Renvoie une valeur convertie en nombre.
-NA = NA ## Renvoie la valeur d’erreur #N/A.
-TYPE = TYPE ## Renvoie un nombre indiquant le type de données d’une valeur.
-
-
-##
-## Logical functions Fonctions logiques
-##
-AND = ET ## Renvoie VRAI si tous ses arguments sont VRAI.
-FALSE = FAUX ## Renvoie la valeur logique FAUX.
-IF = SI ## Spécifie un test logique à effectuer.
-IFERROR = SIERREUR ## Renvoie une valeur que vous spécifiez si une formule génère une erreur ; sinon, elle renvoie le résultat de la formule.
-NOT = NON ## Inverse la logique de cet argument.
-OR = OU ## Renvoie VRAI si un des arguments est VRAI.
-TRUE = VRAI ## Renvoie la valeur logique VRAI.
-
-
-##
-## Lookup and reference functions Fonctions de recherche et de référence
-##
-ADDRESS = ADRESSE ## Renvoie une référence sous forme de texte à une seule cellule d’une feuille de calcul.
-AREAS = ZONES ## Renvoie le nombre de zones dans une référence.
-CHOOSE = CHOISIR ## Choisit une valeur dans une liste.
-COLUMN = COLONNE ## Renvoie le numéro de colonne d’une référence.
-COLUMNS = COLONNES ## Renvoie le nombre de colonnes dans une référence.
-HLOOKUP = RECHERCHEH ## Effectue une recherche dans la première ligne d’une matrice et renvoie la valeur de la cellule indiquée.
-HYPERLINK = LIEN_HYPERTEXTE ## Crée un raccourci ou un renvoi qui ouvre un document stocké sur un serveur réseau, sur un réseau Intranet ou sur Internet.
-INDEX = INDEX ## Utilise un index pour choisir une valeur provenant d’une référence ou d’une matrice.
-INDIRECT = INDIRECT ## Renvoie une référence indiquée par une valeur de texte.
-LOOKUP = RECHERCHE ## Recherche des valeurs dans un vecteur ou une matrice.
-MATCH = EQUIV ## Recherche des valeurs dans une référence ou une matrice.
-OFFSET = DECALER ## Renvoie une référence décalée par rapport à une référence donnée.
-ROW = LIGNE ## Renvoie le numéro de ligne d’une référence.
-ROWS = LIGNES ## Renvoie le nombre de lignes dans une référence.
-RTD = RTD ## Extrait les données en temps réel à partir d’un programme prenant en charge l’automation COM (Automation : utilisation des objets d'une application à partir d'une autre application ou d'un autre outil de développement. Autrefois appelée OLE Automation, Automation est une norme industrielle et une fonctionnalité du modèle d'objet COM (Component Object Model).).
-TRANSPOSE = TRANSPOSE ## Renvoie la transposition d’une matrice.
-VLOOKUP = RECHERCHEV ## Effectue une recherche dans la première colonne d’une matrice et se déplace sur la ligne pour renvoyer la valeur d’une cellule.
-
-
-##
-## Math and trigonometry functions Fonctions mathématiques et trigonométriques
-##
-ABS = ABS ## Renvoie la valeur absolue d’un nombre.
-ACOS = ACOS ## Renvoie l’arccosinus d’un nombre.
-ACOSH = ACOSH ## Renvoie le cosinus hyperbolique inverse d’un nombre.
-ASIN = ASIN ## Renvoie l’arcsinus d’un nombre.
-ASINH = ASINH ## Renvoie le sinus hyperbolique inverse d’un nombre.
-ATAN = ATAN ## Renvoie l’arctangente d’un nombre.
-ATAN2 = ATAN2 ## Renvoie l’arctangente des coordonnées x et y.
-ATANH = ATANH ## Renvoie la tangente hyperbolique inverse d’un nombre.
-CEILING = PLAFOND ## Arrondit un nombre au nombre entier le plus proche ou au multiple le plus proche de l’argument précision en s’éloignant de zéro.
-COMBIN = COMBIN ## Renvoie le nombre de combinaisons que l’on peut former avec un nombre donné d’objets.
-COS = COS ## Renvoie le cosinus d’un nombre.
-COSH = COSH ## Renvoie le cosinus hyperbolique d’un nombre.
-DEGREES = DEGRES ## Convertit des radians en degrés.
-EVEN = PAIR ## Arrondit un nombre au nombre entier pair le plus proche en s’éloignant de zéro.
-EXP = EXP ## Renvoie e élevé à la puissance d’un nombre donné.
-FACT = FACT ## Renvoie la factorielle d’un nombre.
-FACTDOUBLE = FACTDOUBLE ## Renvoie la factorielle double d’un nombre.
-FLOOR = PLANCHER ## Arrondit un nombre en tendant vers 0 (zéro).
-GCD = PGCD ## Renvoie le plus grand commun diviseur.
-INT = ENT ## Arrondit un nombre à l’entier immédiatement inférieur.
-LCM = PPCM ## Renvoie le plus petit commun multiple.
-LN = LN ## Renvoie le logarithme népérien d’un nombre.
-LOG = LOG ## Renvoie le logarithme d’un nombre dans la base spécifiée.
-LOG10 = LOG10 ## Calcule le logarithme en base 10 d’un nombre.
-MDETERM = DETERMAT ## Renvoie le déterminant d’une matrice.
-MINVERSE = INVERSEMAT ## Renvoie la matrice inverse d’une matrice.
-MMULT = PRODUITMAT ## Renvoie le produit de deux matrices.
-MOD = MOD ## Renvoie le reste d’une division.
-MROUND = ARRONDI.AU.MULTIPLE ## Donne l’arrondi d’un nombre au multiple spécifié.
-MULTINOMIAL = MULTINOMIALE ## Calcule la multinomiale d’un ensemble de nombres.
-ODD = IMPAIR ## Renvoie le nombre, arrondi à la valeur du nombre entier impair le plus proche en s’éloignant de zéro.
-PI = PI ## Renvoie la valeur de pi.
-POWER = PUISSANCE ## Renvoie la valeur du nombre élevé à une puissance.
-PRODUCT = PRODUIT ## Multiplie ses arguments.
-QUOTIENT = QUOTIENT ## Renvoie la partie entière du résultat d’une division.
-RADIANS = RADIANS ## Convertit des degrés en radians.
-RAND = ALEA ## Renvoie un nombre aléatoire compris entre 0 et 1.
-RANDBETWEEN = ALEA.ENTRE.BORNES ## Renvoie un nombre aléatoire entre les nombres que vous spécifiez.
-ROMAN = ROMAIN ## Convertit des chiffres arabes en chiffres romains, sous forme de texte.
-ROUND = ARRONDI ## Arrondit un nombre au nombre de chiffres indiqué.
-ROUNDDOWN = ARRONDI.INF ## Arrondit un nombre en tendant vers 0 (zéro).
-ROUNDUP = ARRONDI.SUP ## Arrondit un nombre à l’entier supérieur, en s’éloignant de zéro.
-SERIESSUM = SOMME.SERIES ## Renvoie la somme d’une série géométrique en s’appuyant sur la formule suivante :
-SIGN = SIGNE ## Renvoie le signe d’un nombre.
-SIN = SIN ## Renvoie le sinus d’un angle donné.
-SINH = SINH ## Renvoie le sinus hyperbolique d’un nombre.
-SQRT = RACINE ## Renvoie la racine carrée d’un nombre.
-SQRTPI = RACINE.PI ## Renvoie la racine carrée de (nombre * pi).
-SUBTOTAL = SOUS.TOTAL ## Renvoie un sous-total dans une liste ou une base de données.
-SUM = SOMME ## Calcule la somme de ses arguments.
-SUMIF = SOMME.SI ## Additionne les cellules spécifiées si elles répondent à un critère donné.
-SUMIFS = SOMME.SI.ENS ## Ajoute les cellules d’une plage qui répondent à plusieurs critères.
-SUMPRODUCT = SOMMEPROD ## Multiplie les valeurs correspondantes des matrices spécifiées et calcule la somme de ces produits.
-SUMSQ = SOMME.CARRES ## Renvoie la somme des carrés des arguments.
-SUMX2MY2 = SOMME.X2MY2 ## Renvoie la somme de la différence des carrés des valeurs correspondantes de deux matrices.
-SUMX2PY2 = SOMME.X2PY2 ## Renvoie la somme de la somme des carrés des valeurs correspondantes de deux matrices.
-SUMXMY2 = SOMME.XMY2 ## Renvoie la somme des carrés des différences entre les valeurs correspondantes de deux matrices.
-TAN = TAN ## Renvoie la tangente d’un nombre.
-TANH = TANH ## Renvoie la tangente hyperbolique d’un nombre.
-TRUNC = TRONQUE ## Renvoie la partie entière d’un nombre.
-
-
-##
-## Statistical functions Fonctions statistiques
-##
-AVEDEV = ECART.MOYEN ## Renvoie la moyenne des écarts absolus observés dans la moyenne des points de données.
-AVERAGE = MOYENNE ## Renvoie la moyenne de ses arguments.
-AVERAGEA = AVERAGEA ## Renvoie la moyenne de ses arguments, nombres, texte et valeurs logiques inclus.
-AVERAGEIF = MOYENNE.SI ## Renvoie la moyenne (arithmétique) de toutes les cellules d’une plage qui répondent à des critères donnés.
-AVERAGEIFS = MOYENNE.SI.ENS ## Renvoie la moyenne (arithmétique) de toutes les cellules qui répondent à plusieurs critères.
-BETADIST = LOI.BETA ## Renvoie la fonction de distribution cumulée.
-BETAINV = BETA.INVERSE ## Renvoie l’inverse de la fonction de distribution cumulée pour une distribution bêta spécifiée.
-BINOMDIST = LOI.BINOMIALE ## Renvoie la probabilité d’une variable aléatoire discrète suivant la loi binomiale.
-CHIDIST = LOI.KHIDEUX ## Renvoie la probabilité unilatérale de la distribution khi-deux.
-CHIINV = KHIDEUX.INVERSE ## Renvoie l’inverse de la probabilité unilatérale de la distribution khi-deux.
-CHITEST = TEST.KHIDEUX ## Renvoie le test d’indépendance.
-CONFIDENCE = INTERVALLE.CONFIANCE ## Renvoie l’intervalle de confiance pour une moyenne de population.
-CORREL = COEFFICIENT.CORRELATION ## Renvoie le coefficient de corrélation entre deux séries de données.
-COUNT = NB ## Détermine les nombres compris dans la liste des arguments.
-COUNTA = NBVAL ## Détermine le nombre de valeurs comprises dans la liste des arguments.
-COUNTBLANK = NB.VIDE ## Compte le nombre de cellules vides dans une plage.
-COUNTIF = NB.SI ## Compte le nombre de cellules qui répondent à un critère donné dans une plage.
-COUNTIFS = NB.SI.ENS ## Compte le nombre de cellules à l’intérieur d’une plage qui répondent à plusieurs critères.
-COVAR = COVARIANCE ## Renvoie la covariance, moyenne des produits des écarts pour chaque série d’observations.
-CRITBINOM = CRITERE.LOI.BINOMIALE ## Renvoie la plus petite valeur pour laquelle la distribution binomiale cumulée est inférieure ou égale à une valeur de critère.
-DEVSQ = SOMME.CARRES.ECARTS ## Renvoie la somme des carrés des écarts.
-EXPONDIST = LOI.EXPONENTIELLE ## Renvoie la distribution exponentielle.
-FDIST = LOI.F ## Renvoie la distribution de probabilité F.
-FINV = INVERSE.LOI.F ## Renvoie l’inverse de la distribution de probabilité F.
-FISHER = FISHER ## Renvoie la transformation de Fisher.
-FISHERINV = FISHER.INVERSE ## Renvoie l’inverse de la transformation de Fisher.
-FORECAST = PREVISION ## Calcule une valeur par rapport à une tendance linéaire.
-FREQUENCY = FREQUENCE ## Calcule la fréquence d’apparition des valeurs dans une plage de valeurs, puis renvoie des nombres sous forme de matrice verticale.
-FTEST = TEST.F ## Renvoie le résultat d’un test F.
-GAMMADIST = LOI.GAMMA ## Renvoie la probabilité d’une variable aléatoire suivant une loi Gamma.
-GAMMAINV = LOI.GAMMA.INVERSE ## Renvoie, pour une probabilité donnée, la valeur d’une variable aléatoire suivant une loi Gamma.
-GAMMALN = LNGAMMA ## Renvoie le logarithme népérien de la fonction Gamma, G(x)
-GEOMEAN = MOYENNE.GEOMETRIQUE ## Renvoie la moyenne géométrique.
-GROWTH = CROISSANCE ## Calcule des valeurs par rapport à une tendance exponentielle.
-HARMEAN = MOYENNE.HARMONIQUE ## Renvoie la moyenne harmonique.
-HYPGEOMDIST = LOI.HYPERGEOMETRIQUE ## Renvoie la probabilité d’une variable aléatoire discrète suivant une loi hypergéométrique.
-INTERCEPT = ORDONNEE.ORIGINE ## Renvoie l’ordonnée à l’origine d’une droite de régression linéaire.
-KURT = KURTOSIS ## Renvoie le kurtosis d’une série de données.
-LARGE = GRANDE.VALEUR ## Renvoie la k-ième plus grande valeur d’une série de données.
-LINEST = DROITEREG ## Renvoie les paramètres d’une tendance linéaire.
-LOGEST = LOGREG ## Renvoie les paramètres d’une tendance exponentielle.
-LOGINV = LOI.LOGNORMALE.INVERSE ## Renvoie l’inverse de la probabilité pour une variable aléatoire suivant la loi lognormale.
-LOGNORMDIST = LOI.LOGNORMALE ## Renvoie la probabilité d’une variable aléatoire continue suivant une loi lognormale.
-MAX = MAX ## Renvoie la valeur maximale contenue dans une liste d’arguments.
-MAXA = MAXA ## Renvoie la valeur maximale d’une liste d’arguments, nombres, texte et valeurs logiques inclus.
-MEDIAN = MEDIANE ## Renvoie la valeur médiane des nombres donnés.
-MIN = MIN ## Renvoie la valeur minimale contenue dans une liste d’arguments.
-MINA = MINA ## Renvoie la plus petite valeur d’une liste d’arguments, nombres, texte et valeurs logiques inclus.
-MODE = MODE ## Renvoie la valeur la plus courante d’une série de données.
-NEGBINOMDIST = LOI.BINOMIALE.NEG ## Renvoie la probabilité d’une variable aléatoire discrète suivant une loi binomiale négative.
-NORMDIST = LOI.NORMALE ## Renvoie la probabilité d’une variable aléatoire continue suivant une loi normale.
-NORMINV = LOI.NORMALE.INVERSE ## Renvoie, pour une probabilité donnée, la valeur d’une variable aléatoire suivant une loi normale standard.
-NORMSDIST = LOI.NORMALE.STANDARD ## Renvoie la probabilité d’une variable aléatoire continue suivant une loi normale standard.
-NORMSINV = LOI.NORMALE.STANDARD.INVERSE ## Renvoie l’inverse de la distribution cumulée normale standard.
-PEARSON = PEARSON ## Renvoie le coefficient de corrélation d’échantillonnage de Pearson.
-PERCENTILE = CENTILE ## Renvoie le k-ième centile des valeurs d’une plage.
-PERCENTRANK = RANG.POURCENTAGE ## Renvoie le rang en pourcentage d’une valeur d’une série de données.
-PERMUT = PERMUTATION ## Renvoie le nombre de permutations pour un nombre donné d’objets.
-POISSON = LOI.POISSON ## Renvoie la probabilité d’une variable aléatoire suivant une loi de Poisson.
-PROB = PROBABILITE ## Renvoie la probabilité que des valeurs d’une plage soient comprises entre deux limites.
-QUARTILE = QUARTILE ## Renvoie le quartile d’une série de données.
-RANK = RANG ## Renvoie le rang d’un nombre contenu dans une liste.
-RSQ = COEFFICIENT.DETERMINATION ## Renvoie la valeur du coefficient de détermination R^2 d’une régression linéaire.
-SKEW = COEFFICIENT.ASYMETRIE ## Renvoie l’asymétrie d’une distribution.
-SLOPE = PENTE ## Renvoie la pente d’une droite de régression linéaire.
-SMALL = PETITE.VALEUR ## Renvoie la k-ième plus petite valeur d’une série de données.
-STANDARDIZE = CENTREE.REDUITE ## Renvoie une valeur centrée réduite.
-STDEV = ECARTYPE ## Évalue l’écart type d’une population en se basant sur un échantillon de cette population.
-STDEVA = STDEVA ## Évalue l’écart type d’une population en se basant sur un échantillon de cette population, nombres, texte et valeurs logiques inclus.
-STDEVP = ECARTYPEP ## Calcule l’écart type d’une population à partir de la population entière.
-STDEVPA = STDEVPA ## Calcule l’écart type d’une population à partir de l’ensemble de la population, nombres, texte et valeurs logiques inclus.
-STEYX = ERREUR.TYPE.XY ## Renvoie l’erreur type de la valeur y prévue pour chaque x de la régression.
-TDIST = LOI.STUDENT ## Renvoie la probabilité d’une variable aléatoire suivant une loi T de Student.
-TINV = LOI.STUDENT.INVERSE ## Renvoie, pour une probabilité donnée, la valeur d’une variable aléatoire suivant une loi T de Student.
-TREND = TENDANCE ## Renvoie des valeurs par rapport à une tendance linéaire.
-TRIMMEAN = MOYENNE.REDUITE ## Renvoie la moyenne de l’intérieur d’une série de données.
-TTEST = TEST.STUDENT ## Renvoie la probabilité associée à un test T de Student.
-VAR = VAR ## Calcule la variance sur la base d’un échantillon.
-VARA = VARA ## Estime la variance d’une population en se basant sur un échantillon de cette population, nombres, texte et valeurs logiques incluses.
-VARP = VAR.P ## Calcule la variance sur la base de l’ensemble de la population.
-VARPA = VARPA ## Calcule la variance d’une population en se basant sur la population entière, nombres, texte et valeurs logiques inclus.
-WEIBULL = LOI.WEIBULL ## Renvoie la probabilité d’une variable aléatoire suivant une loi de Weibull.
-ZTEST = TEST.Z ## Renvoie la valeur de probabilité unilatérale d’un test z.
-
-
-##
-## Text functions Fonctions de texte
-##
-ASC = ASC ## Change les caractères anglais ou katakana à pleine chasse (codés sur deux octets) à l’intérieur d’une chaîne de caractères en caractères à demi-chasse (codés sur un octet).
-BAHTTEXT = BAHTTEXT ## Convertit un nombre en texte en utilisant le format monétaire ß (baht).
-CHAR = CAR ## Renvoie le caractère spécifié par le code numérique.
-CLEAN = EPURAGE ## Supprime tous les caractères de contrôle du texte.
-CODE = CODE ## Renvoie le numéro de code du premier caractère du texte.
-CONCATENATE = CONCATENER ## Assemble plusieurs éléments textuels de façon à n’en former qu’un seul.
-DOLLAR = EURO ## Convertit un nombre en texte en utilisant le format monétaire € (euro).
-EXACT = EXACT ## Vérifie si deux valeurs de texte sont identiques.
-FIND = TROUVE ## Trouve un valeur textuelle dans une autre, en respectant la casse.
-FINDB = TROUVERB ## Trouve un valeur textuelle dans une autre, en respectant la casse.
-FIXED = CTXT ## Convertit un nombre au format texte avec un nombre de décimales spécifié.
-JIS = JIS ## Change les caractères anglais ou katakana à demi-chasse (codés sur un octet) à l’intérieur d’une chaîne de caractères en caractères à à pleine chasse (codés sur deux octets).
-LEFT = GAUCHE ## Renvoie des caractères situés à l’extrême gauche d’une chaîne de caractères.
-LEFTB = GAUCHEB ## Renvoie des caractères situés à l’extrême gauche d’une chaîne de caractères.
-LEN = NBCAR ## Renvoie le nombre de caractères contenus dans une chaîne de texte.
-LENB = LENB ## Renvoie le nombre de caractères contenus dans une chaîne de texte.
-LOWER = MINUSCULE ## Convertit le texte en minuscules.
-MID = STXT ## Renvoie un nombre déterminé de caractères d’une chaîne de texte à partir de la position que vous indiquez.
-MIDB = STXTB ## Renvoie un nombre déterminé de caractères d’une chaîne de texte à partir de la position que vous indiquez.
-PHONETIC = PHONETIQUE ## Extrait les caractères phonétiques (furigana) d’une chaîne de texte.
-PROPER = NOMPROPRE ## Met en majuscules la première lettre de chaque mot dans une chaîne textuelle.
-REPLACE = REMPLACER ## Remplace des caractères dans un texte.
-REPLACEB = REMPLACERB ## Remplace des caractères dans un texte.
-REPT = REPT ## Répète un texte un certain nombre de fois.
-RIGHT = DROITE ## Renvoie des caractères situés à l’extrême droite d’une chaîne de caractères.
-RIGHTB = DROITEB ## Renvoie des caractères situés à l’extrême droite d’une chaîne de caractères.
-SEARCH = CHERCHE ## Trouve un texte dans un autre texte (sans respecter la casse).
-SEARCHB = CHERCHERB ## Trouve un texte dans un autre texte (sans respecter la casse).
-SUBSTITUTE = SUBSTITUE ## Remplace l’ancien texte d’une chaîne de caractères par un nouveau.
-T = T ## Convertit ses arguments en texte.
-TEXT = TEXTE ## Convertit un nombre au format texte.
-TRIM = SUPPRESPACE ## Supprime les espaces du texte.
-UPPER = MAJUSCULE ## Convertit le texte en majuscules.
-VALUE = CNUM ## Convertit un argument textuel en nombre
+##
+## PhpSpreadsheet
+##
+## Data in this file derived from https://www.excel-function-translation.com/
+##
+##
+
+
+##
+## Add-in and Automation functions Fonctions de complément et d’automatisation
+##
+GETPIVOTDATA = LIREDONNEESTABCROISDYNAMIQUE ## Renvoie les données stockées dans un rapport de tableau croisé dynamique.
+
+
+##
+## Cube functions Fonctions Cube
+##
+CUBEKPIMEMBER = MEMBREKPICUBE ## Renvoie un nom, une propriété et une mesure d’indicateur de performance clé et affiche le nom et la propriété dans la cellule. Un indicateur de performance clé est une mesure quantifiable, telle que la marge bénéficiaire brute mensuelle ou la rotation trimestrielle du personnel, utilisée pour évaluer les performances d’une entreprise.
+CUBEMEMBER = MEMBRECUBE ## Renvoie un membre ou un uplet dans une hiérarchie de cubes. Utilisez cette fonction pour valider l’existence du membre ou de l’uplet dans le cube.
+CUBEMEMBERPROPERTY = PROPRIETEMEMBRECUBE ## Renvoie la valeur d’une propriété de membre du cube. Utilisez cette fonction pour valider l’existence d’un nom de membre dans le cube et pour renvoyer la propriété spécifiée pour ce membre.
+CUBERANKEDMEMBER = RANGMEMBRECUBE ## Renvoie le nième membre ou le membre placé à un certain rang dans un ensemble. Utilisez cette fonction pour renvoyer un ou plusieurs éléments d’un ensemble, tels que les meilleurs vendeurs ou les 10 meilleurs étudiants.
+CUBESET = JEUCUBE ## Définit un ensemble calculé de membres ou d’uplets en envoyant une expression définie au cube sur le serveur qui crée l’ensemble et le renvoie à Microsoft Office Excel.
+CUBESETCOUNT = NBJEUCUBE ## Renvoie le nombre d’éléments dans un jeu.
+CUBEVALUE = VALEURCUBE ## Renvoie une valeur d’agrégation issue d’un cube.
+
+
+##
+## Database functions Fonctions de base de données
+##
+DAVERAGE = BDMOYENNE ## Renvoie la moyenne des entrées de base de données sélectionnées.
+DCOUNT = BCOMPTE ## Compte le nombre de cellules d’une base de données qui contiennent des nombres.
+DCOUNTA = BDNBVAL ## Compte les cellules non vides d’une base de données.
+DGET = BDLIRE ## Extrait d’une base de données un enregistrement unique répondant aux critères spécifiés.
+DMAX = BDMAX ## Renvoie la valeur maximale des entrées de base de données sélectionnées.
+DMIN = BDMIN ## Renvoie la valeur minimale des entrées de base de données sélectionnées.
+DPRODUCT = BDPRODUIT ## Multiplie les valeurs d’un champ particulier des enregistrements d’une base de données, qui répondent aux critères spécifiés.
+DSTDEV = BDECARTYPE ## Calcule l’écart type pour un échantillon d’entrées de base de données sélectionnées.
+DSTDEVP = BDECARTYPEP ## Calcule l’écart type pour l’ensemble d’une population d’entrées de base de données sélectionnées.
+DSUM = BDSOMME ## Ajoute les nombres dans la colonne de champ des enregistrements de la base de données, qui répondent aux critères.
+DVAR = BDVAR ## Calcule la variance pour un échantillon d’entrées de base de données sélectionnées.
+DVARP = BDVARP ## Calcule la variance pour l’ensemble d’une population d’entrées de base de données sélectionnées.
+
+
+##
+## Date and time functions Fonctions de date et d’heure
+##
+DATE = DATE ## Renvoie le numéro de série d’une date précise.
+DATEVALUE = DATEVAL ## Convertit une date représentée sous forme de texte en numéro de série.
+DAY = JOUR ## Convertit un numéro de série en jour du mois.
+DAYS360 = JOURS360 ## Calcule le nombre de jours qui séparent deux dates sur la base d’une année de 360 jours.
+EDATE = MOIS.DECALER ## Renvoie le numéro séquentiel de la date qui représente une date spécifiée (l’argument date_départ), corrigée en plus ou en moins du nombre de mois indiqué.
+EOMONTH = FIN.MOIS ## Renvoie le numéro séquentiel de la date du dernier jour du mois précédant ou suivant la date_départ du nombre de mois indiqué.
+HOUR = HEURE ## Convertit un numéro de série en heure.
+MINUTE = MINUTE ## Convertit un numéro de série en minute.
+MONTH = MOIS ## Convertit un numéro de série en mois.
+NETWORKDAYS = NB.JOURS.OUVRES ## Renvoie le nombre de jours ouvrés entiers compris entre deux dates.
+NOW = MAINTENANT ## Renvoie le numéro de série de la date et de l’heure du jour.
+SECOND = SECONDE ## Convertit un numéro de série en seconde.
+TIME = TEMPS ## Renvoie le numéro de série d’une heure précise.
+TIMEVALUE = TEMPSVAL ## Convertit une date représentée sous forme de texte en numéro de série.
+TODAY = AUJOURDHUI ## Renvoie le numéro de série de la date du jour.
+WEEKDAY = JOURSEM ## Convertit un numéro de série en jour de la semaine.
+WEEKNUM = NO.SEMAINE ## Convertit un numéro de série en un numéro représentant l’ordre de la semaine dans l’année.
+WORKDAY = SERIE.JOUR.OUVRE ## Renvoie le numéro de série de la date avant ou après le nombre de jours ouvrés spécifiés.
+YEAR = ANNEE ## Convertit un numéro de série en année.
+YEARFRAC = FRACTION.ANNEE ## Renvoie la fraction de l’année représentant le nombre de jours entre la date de début et la date de fin.
+
+
+##
+## Engineering functions Fonctions d’ingénierie
+##
+BESSELI = BESSELI ## Renvoie la fonction Bessel modifiée In(x).
+BESSELJ = BESSELJ ## Renvoie la fonction Bessel Jn(x).
+BESSELK = BESSELK ## Renvoie la fonction Bessel modifiée Kn(x).
+BESSELY = BESSELY ## Renvoie la fonction Bessel Yn(x).
+BIN2DEC = BINDEC ## Convertit un nombre binaire en nombre décimal.
+BIN2HEX = BINHEX ## Convertit un nombre binaire en nombre hexadécimal.
+BIN2OCT = BINOCT ## Convertit un nombre binaire en nombre octal.
+COMPLEX = COMPLEXE ## Convertit des coefficients réel et imaginaire en un nombre complexe.
+CONVERT = CONVERT ## Convertit un nombre d’une unité de mesure à une autre.
+DEC2BIN = DECBIN ## Convertit un nombre décimal en nombre binaire.
+DEC2HEX = DECHEX ## Convertit un nombre décimal en nombre hexadécimal.
+DEC2OCT = DECOCT ## Convertit un nombre décimal en nombre octal.
+DELTA = DELTA ## Teste l’égalité de deux nombres.
+ERF = ERF ## Renvoie la valeur de la fonction d’erreur.
+ERFC = ERFC ## Renvoie la valeur de la fonction d’erreur complémentaire.
+GESTEP = SUP.SEUIL ## Teste si un nombre est supérieur à une valeur de seuil.
+HEX2BIN = HEXBIN ## Convertit un nombre hexadécimal en nombre binaire.
+HEX2DEC = HEXDEC ## Convertit un nombre hexadécimal en nombre décimal.
+HEX2OCT = HEXOCT ## Convertit un nombre hexadécimal en nombre octal.
+IMABS = COMPLEXE.MODULE ## Renvoie la valeur absolue (module) d’un nombre complexe.
+IMAGINARY = COMPLEXE.IMAGINAIRE ## Renvoie le coefficient imaginaire d’un nombre complexe.
+IMARGUMENT = COMPLEXE.ARGUMENT ## Renvoie l’argument thêta, un angle exprimé en radians.
+IMCONJUGATE = COMPLEXE.CONJUGUE ## Renvoie le nombre complexe conjugué d’un nombre complexe.
+IMCOS = IMCOS ## Renvoie le cosinus d’un nombre complexe.
+IMDIV = COMPLEXE.DIV ## Renvoie le quotient de deux nombres complexes.
+IMEXP = COMPLEXE.EXP ## Renvoie la fonction exponentielle d’un nombre complexe.
+IMLN = COMPLEXE.LN ## Renvoie le logarithme népérien d’un nombre complexe.
+IMLOG10 = COMPLEXE.LOG10 ## Calcule le logarithme en base 10 d’un nombre complexe.
+IMLOG2 = COMPLEXE.LOG2 ## Calcule le logarithme en base 2 d’un nombre complexe.
+IMPOWER = COMPLEXE.PUISSANCE ## Renvoie un nombre complexe élevé à une puissance entière.
+IMPRODUCT = COMPLEXE.PRODUIT ## Renvoie le produit de plusieurs nombres complexes.
+IMREAL = COMPLEXE.REEL ## Renvoie le coefficient réel d’un nombre complexe.
+IMSIN = COMPLEXE.SIN ## Renvoie le sinus d’un nombre complexe.
+IMSQRT = COMPLEXE.RACINE ## Renvoie la racine carrée d’un nombre complexe.
+IMSUB = COMPLEXE.DIFFERENCE ## Renvoie la différence entre deux nombres complexes.
+IMSUM = COMPLEXE.SOMME ## Renvoie la somme de plusieurs nombres complexes.
+OCT2BIN = OCTBIN ## Convertit un nombre octal en nombre binaire.
+OCT2DEC = OCTDEC ## Convertit un nombre octal en nombre décimal.
+OCT2HEX = OCTHEX ## Convertit un nombre octal en nombre hexadécimal.
+
+
+##
+## Financial functions Fonctions financières
+##
+ACCRINT = INTERET.ACC ## Renvoie l’intérêt couru non échu d’un titre dont l’intérêt est perçu périodiquement.
+ACCRINTM = INTERET.ACC.MAT ## Renvoie l’intérêt couru non échu d’un titre dont l’intérêt est perçu à l’échéance.
+AMORDEGRC = AMORDEGRC ## Renvoie l’amortissement correspondant à chaque période comptable en utilisant un coefficient d’amortissement.
+AMORLINC = AMORLINC ## Renvoie l’amortissement d’un bien à la fin d’une période fiscale donnée.
+COUPDAYBS = NB.JOURS.COUPON.PREC ## Renvoie le nombre de jours entre le début de la période de coupon et la date de liquidation.
+COUPDAYS = NB.JOURS.COUPONS ## Renvoie le nombre de jours pour la période du coupon contenant la date de liquidation.
+COUPDAYSNC = NB.JOURS.COUPON.SUIV ## Renvoie le nombre de jours entre la date de liquidation et la date du coupon suivant la date de liquidation.
+COUPNCD = DATE.COUPON.SUIV ## Renvoie la première date de coupon ultérieure à la date de règlement.
+COUPNUM = NB.COUPONS ## Renvoie le nombre de coupons dus entre la date de règlement et la date d’échéance.
+COUPPCD = DATE.COUPON.PREC ## Renvoie la date de coupon précédant la date de règlement.
+CUMIPMT = CUMUL.INTER ## Renvoie l’intérêt cumulé payé sur un emprunt entre deux périodes.
+CUMPRINC = CUMUL.PRINCPER ## Renvoie le montant cumulé des remboursements du capital d’un emprunt effectués entre deux périodes.
+DB = DB ## Renvoie l’amortissement d’un bien pour une période spécifiée en utilisant la méthode de l’amortissement dégressif à taux fixe.
+DDB = DDB ## Renvoie l’amortissement d’un bien pour toute période spécifiée, en utilisant la méthode de l’amortissement dégressif à taux double ou selon un coefficient à spécifier.
+DISC = TAUX.ESCOMPTE ## Calcule le taux d’escompte d’une transaction.
+DOLLARDE = PRIX.DEC ## Convertit un prix en euros, exprimé sous forme de fraction, en un prix en euros exprimé sous forme de nombre décimal.
+DOLLARFR = PRIX.FRAC ## Convertit un prix en euros, exprimé sous forme de nombre décimal, en un prix en euros exprimé sous forme de fraction.
+DURATION = DUREE ## Renvoie la durée, en années, d’un titre dont l’intérêt est perçu périodiquement.
+EFFECT = TAUX.EFFECTIF ## Renvoie le taux d’intérêt annuel effectif.
+FV = VC ## Renvoie la valeur future d’un investissement.
+FVSCHEDULE = VC.PAIEMENTS ## Calcule la valeur future d’un investissement en appliquant une série de taux d’intérêt composites.
+INTRATE = TAUX.INTERET ## Affiche le taux d’intérêt d’un titre totalement investi.
+IPMT = INTPER ## Calcule le montant des intérêts d’un investissement pour une période donnée.
+IRR = TRI ## Calcule le taux de rentabilité interne d’un investissement pour une succession de trésoreries.
+ISPMT = ISPMT ## Calcule le montant des intérêts d’un investissement pour une période donnée.
+MDURATION = DUREE.MODIFIEE ## Renvoie la durée de Macauley modifiée pour un titre ayant une valeur nominale hypothétique de 100_euros.
+MIRR = TRIM ## Calcule le taux de rentabilité interne lorsque les paiements positifs et négatifs sont financés à des taux différents.
+NOMINAL = TAUX.NOMINAL ## Calcule le taux d’intérêt nominal annuel.
+NPER = NPM ## Renvoie le nombre de versements nécessaires pour rembourser un emprunt.
+NPV = VAN ## Calcule la valeur actuelle nette d’un investissement basé sur une série de décaissements et un taux d’escompte.
+ODDFPRICE = PRIX.PCOUPON.IRREG ## Renvoie le prix par tranche de valeur nominale de 100 euros d’un titre dont la première période de coupon est irrégulière.
+ODDFYIELD = REND.PCOUPON.IRREG ## Renvoie le taux de rendement d’un titre dont la première période de coupon est irrégulière.
+ODDLPRICE = PRIX.DCOUPON.IRREG ## Renvoie le prix par tranche de valeur nominale de 100 euros d’un titre dont la première période de coupon est irrégulière.
+ODDLYIELD = REND.DCOUPON.IRREG ## Renvoie le taux de rendement d’un titre dont la dernière période de coupon est irrégulière.
+PMT = VPM ## Calcule le paiement périodique d’un investissement donné.
+PPMT = PRINCPER ## Calcule, pour une période donnée, la part de remboursement du principal d’un investissement.
+PRICE = PRIX.TITRE ## Renvoie le prix d’un titre rapportant des intérêts périodiques, pour une valeur nominale de 100 euros.
+PRICEDISC = VALEUR.ENCAISSEMENT ## Renvoie la valeur d’encaissement d’un escompte commercial, pour une valeur nominale de 100 euros.
+PRICEMAT = PRIX.TITRE.ECHEANCE ## Renvoie le prix d’un titre dont la valeur nominale est 100 euros et qui rapporte des intérêts à l’échéance.
+PV = PV ## Calcule la valeur actuelle d’un investissement.
+RATE = TAUX ## Calcule le taux d’intérêt par période pour une annuité.
+RECEIVED = VALEUR.NOMINALE ## Renvoie la valeur nominale à échéance d’un effet de commerce.
+SLN = AMORLIN ## Calcule l’amortissement linéaire d’un bien pour une période donnée.
+SYD = SYD ## Calcule l’amortissement d’un bien pour une période donnée sur la base de la méthode américaine Sum-of-Years Digits (amortissement dégressif à taux décroissant appliqué à une valeur constante).
+TBILLEQ = TAUX.ESCOMPTE.R ## Renvoie le taux d’escompte rationnel d’un bon du Trésor.
+TBILLPRICE = PRIX.BON.TRESOR ## Renvoie le prix d’un bon du Trésor d’une valeur nominale de 100 euros.
+TBILLYIELD = RENDEMENT.BON.TRESOR ## Calcule le taux de rendement d’un bon du Trésor.
+VDB = VDB ## Renvoie l’amortissement d’un bien pour une période spécifiée ou partielle en utilisant une méthode de l’amortissement dégressif à taux fixe.
+XIRR = TRI.PAIEMENTS ## Calcule le taux de rentabilité interne d’un ensemble de paiements non périodiques.
+XNPV = VAN.PAIEMENTS ## Renvoie la valeur actuelle nette d’un ensemble de paiements non périodiques.
+YIELD = RENDEMENT.TITRE ## Calcule le rendement d’un titre rapportant des intérêts périodiquement.
+YIELDDISC = RENDEMENT.SIMPLE ## Calcule le taux de rendement d’un emprunt à intérêt simple (par exemple, un bon du Trésor).
+YIELDMAT = RENDEMENT.TITRE.ECHEANCE ## Renvoie le rendement annuel d’un titre qui rapporte des intérêts à l’échéance.
+
+
+##
+## Information functions Fonctions d’information
+##
+CELL = CELLULE ## Renvoie des informations sur la mise en forme, l’emplacement et le contenu d’une cellule.
+ERROR.TYPE = TYPE.ERREUR ## Renvoie un nombre correspondant à un type d’erreur.
+INFO = INFORMATIONS ## Renvoie des informations sur l’environnement d’exploitation actuel.
+ISBLANK = ESTVIDE ## Renvoie VRAI si l’argument valeur est vide.
+ISERR = ESTERR ## Renvoie VRAI si l’argument valeur fait référence à une valeur d’erreur, sauf #N/A.
+ISERROR = ESTERREUR ## Renvoie VRAI si l’argument valeur fait référence à une valeur d’erreur.
+ISEVEN = EST.PAIR ## Renvoie VRAI si le chiffre est pair.
+ISLOGICAL = ESTLOGIQUE ## Renvoie VRAI si l’argument valeur fait référence à une valeur logique.
+ISNA = ESTNA ## Renvoie VRAI si l’argument valeur fait référence à la valeur d’erreur #N/A.
+ISNONTEXT = ESTNONTEXTE ## Renvoie VRAI si l’argument valeur ne se présente pas sous forme de texte.
+ISNUMBER = ESTNUM ## Renvoie VRAI si l’argument valeur représente un nombre.
+ISODD = EST.IMPAIR ## Renvoie VRAI si le chiffre est impair.
+ISREF = ESTREF ## Renvoie VRAI si l’argument valeur est une référence.
+ISTEXT = ESTTEXTE ## Renvoie VRAI si l’argument valeur se présente sous forme de texte.
+N = N ## Renvoie une valeur convertie en nombre.
+NA = NA ## Renvoie la valeur d’erreur #N/A.
+TYPE = TYPE ## Renvoie un nombre indiquant le type de données d’une valeur.
+
+
+##
+## Logical functions Fonctions logiques
+##
+AND = ET ## Renvoie VRAI si tous ses arguments sont VRAI.
+FALSE = FAUX ## Renvoie la valeur logique FAUX.
+IF = SI ## Spécifie un test logique à effectuer.
+IFERROR = SIERREUR ## Renvoie une valeur que vous spécifiez si une formule génère une erreur ; sinon, elle renvoie le résultat de la formule.
+NOT = NON ## Inverse la logique de cet argument.
+OR = OU ## Renvoie VRAI si un des arguments est VRAI.
+TRUE = VRAI ## Renvoie la valeur logique VRAI.
+
+
+##
+## Lookup and reference functions Fonctions de recherche et de référence
+##
+ADDRESS = ADRESSE ## Renvoie une référence sous forme de texte à une seule cellule d’une feuille de calcul.
+AREAS = ZONES ## Renvoie le nombre de zones dans une référence.
+CHOOSE = CHOISIR ## Choisit une valeur dans une liste.
+COLUMN = COLONNE ## Renvoie le numéro de colonne d’une référence.
+COLUMNS = COLONNES ## Renvoie le nombre de colonnes dans une référence.
+HLOOKUP = RECHERCHEH ## Effectue une recherche dans la première ligne d’une matrice et renvoie la valeur de la cellule indiquée.
+HYPERLINK = LIEN_HYPERTEXTE ## Crée un raccourci ou un renvoi qui ouvre un document stocké sur un serveur réseau, sur un réseau Intranet ou sur Internet.
+INDEX = INDEX ## Utilise un index pour choisir une valeur provenant d’une référence ou d’une matrice.
+INDIRECT = INDIRECT ## Renvoie une référence indiquée par une valeur de texte.
+LOOKUP = RECHERCHE ## Recherche des valeurs dans un vecteur ou une matrice.
+MATCH = EQUIV ## Recherche des valeurs dans une référence ou une matrice.
+OFFSET = DECALER ## Renvoie une référence décalée par rapport à une référence donnée.
+ROW = LIGNE ## Renvoie le numéro de ligne d’une référence.
+ROWS = LIGNES ## Renvoie le nombre de lignes dans une référence.
+RTD = RTD ## Extrait les données en temps réel à partir d’un programme prenant en charge l’automation COM (Automation : utilisation des objets d'une application à partir d'une autre application ou d'un autre outil de développement. Autrefois appelée OLE Automation, Automation est une norme industrielle et une fonctionnalité du modèle d'objet COM (Component Object Model).).
+TRANSPOSE = TRANSPOSE ## Renvoie la transposition d’une matrice.
+VLOOKUP = RECHERCHEV ## Effectue une recherche dans la première colonne d’une matrice et se déplace sur la ligne pour renvoyer la valeur d’une cellule.
+
+
+##
+## Math and trigonometry functions Fonctions mathématiques et trigonométriques
+##
+ABS = ABS ## Renvoie la valeur absolue d’un nombre.
+ACOS = ACOS ## Renvoie l’arccosinus d’un nombre.
+ACOSH = ACOSH ## Renvoie le cosinus hyperbolique inverse d’un nombre.
+ASIN = ASIN ## Renvoie l’arcsinus d’un nombre.
+ASINH = ASINH ## Renvoie le sinus hyperbolique inverse d’un nombre.
+ATAN = ATAN ## Renvoie l’arctangente d’un nombre.
+ATAN2 = ATAN2 ## Renvoie l’arctangente des coordonnées x et y.
+ATANH = ATANH ## Renvoie la tangente hyperbolique inverse d’un nombre.
+CEILING = PLAFOND ## Arrondit un nombre au nombre entier le plus proche ou au multiple le plus proche de l’argument précision en s’éloignant de zéro.
+COMBIN = COMBIN ## Renvoie le nombre de combinaisons que l’on peut former avec un nombre donné d’objets.
+COS = COS ## Renvoie le cosinus d’un nombre.
+COSH = COSH ## Renvoie le cosinus hyperbolique d’un nombre.
+DEGREES = DEGRES ## Convertit des radians en degrés.
+EVEN = PAIR ## Arrondit un nombre au nombre entier pair le plus proche en s’éloignant de zéro.
+EXP = EXP ## Renvoie e élevé à la puissance d’un nombre donné.
+FACT = FACT ## Renvoie la factorielle d’un nombre.
+FACTDOUBLE = FACTDOUBLE ## Renvoie la factorielle double d’un nombre.
+FLOOR = PLANCHER ## Arrondit un nombre en tendant vers 0 (zéro).
+GCD = PGCD ## Renvoie le plus grand commun diviseur.
+INT = ENT ## Arrondit un nombre à l’entier immédiatement inférieur.
+LCM = PPCM ## Renvoie le plus petit commun multiple.
+LN = LN ## Renvoie le logarithme népérien d’un nombre.
+LOG = LOG ## Renvoie le logarithme d’un nombre dans la base spécifiée.
+LOG10 = LOG10 ## Calcule le logarithme en base 10 d’un nombre.
+MDETERM = DETERMAT ## Renvoie le déterminant d’une matrice.
+MINVERSE = INVERSEMAT ## Renvoie la matrice inverse d’une matrice.
+MMULT = PRODUITMAT ## Renvoie le produit de deux matrices.
+MOD = MOD ## Renvoie le reste d’une division.
+MROUND = ARRONDI.AU.MULTIPLE ## Donne l’arrondi d’un nombre au multiple spécifié.
+MULTINOMIAL = MULTINOMIALE ## Calcule la multinomiale d’un ensemble de nombres.
+ODD = IMPAIR ## Renvoie le nombre, arrondi à la valeur du nombre entier impair le plus proche en s’éloignant de zéro.
+PI = PI ## Renvoie la valeur de pi.
+POWER = PUISSANCE ## Renvoie la valeur du nombre élevé à une puissance.
+PRODUCT = PRODUIT ## Multiplie ses arguments.
+QUOTIENT = QUOTIENT ## Renvoie la partie entière du résultat d’une division.
+RADIANS = RADIANS ## Convertit des degrés en radians.
+RAND = ALEA ## Renvoie un nombre aléatoire compris entre 0 et 1.
+RANDBETWEEN = ALEA.ENTRE.BORNES ## Renvoie un nombre aléatoire entre les nombres que vous spécifiez.
+ROMAN = ROMAIN ## Convertit des chiffres arabes en chiffres romains, sous forme de texte.
+ROUND = ARRONDI ## Arrondit un nombre au nombre de chiffres indiqué.
+ROUNDDOWN = ARRONDI.INF ## Arrondit un nombre en tendant vers 0 (zéro).
+ROUNDUP = ARRONDI.SUP ## Arrondit un nombre à l’entier supérieur, en s’éloignant de zéro.
+SERIESSUM = SOMME.SERIES ## Renvoie la somme d’une série géométrique en s’appuyant sur la formule suivante :
+SIGN = SIGNE ## Renvoie le signe d’un nombre.
+SIN = SIN ## Renvoie le sinus d’un angle donné.
+SINH = SINH ## Renvoie le sinus hyperbolique d’un nombre.
+SQRT = RACINE ## Renvoie la racine carrée d’un nombre.
+SQRTPI = RACINE.PI ## Renvoie la racine carrée de (nombre * pi).
+SUBTOTAL = SOUS.TOTAL ## Renvoie un sous-total dans une liste ou une base de données.
+SUM = SOMME ## Calcule la somme de ses arguments.
+SUMIF = SOMME.SI ## Additionne les cellules spécifiées si elles répondent à un critère donné.
+SUMIFS = SOMME.SI.ENS ## Ajoute les cellules d’une plage qui répondent à plusieurs critères.
+SUMPRODUCT = SOMMEPROD ## Multiplie les valeurs correspondantes des matrices spécifiées et calcule la somme de ces produits.
+SUMSQ = SOMME.CARRES ## Renvoie la somme des carrés des arguments.
+SUMX2MY2 = SOMME.X2MY2 ## Renvoie la somme de la différence des carrés des valeurs correspondantes de deux matrices.
+SUMX2PY2 = SOMME.X2PY2 ## Renvoie la somme de la somme des carrés des valeurs correspondantes de deux matrices.
+SUMXMY2 = SOMME.XMY2 ## Renvoie la somme des carrés des différences entre les valeurs correspondantes de deux matrices.
+TAN = TAN ## Renvoie la tangente d’un nombre.
+TANH = TANH ## Renvoie la tangente hyperbolique d’un nombre.
+TRUNC = TRONQUE ## Renvoie la partie entière d’un nombre.
+
+
+##
+## Statistical functions Fonctions statistiques
+##
+AVEDEV = ECART.MOYEN ## Renvoie la moyenne des écarts absolus observés dans la moyenne des points de données.
+AVERAGE = MOYENNE ## Renvoie la moyenne de ses arguments.
+AVERAGEA = AVERAGEA ## Renvoie la moyenne de ses arguments, nombres, texte et valeurs logiques inclus.
+AVERAGEIF = MOYENNE.SI ## Renvoie la moyenne (arithmétique) de toutes les cellules d’une plage qui répondent à des critères donnés.
+AVERAGEIFS = MOYENNE.SI.ENS ## Renvoie la moyenne (arithmétique) de toutes les cellules qui répondent à plusieurs critères.
+BETADIST = LOI.BETA ## Renvoie la fonction de distribution cumulée.
+BETAINV = BETA.INVERSE ## Renvoie l’inverse de la fonction de distribution cumulée pour une distribution bêta spécifiée.
+BINOMDIST = LOI.BINOMIALE ## Renvoie la probabilité d’une variable aléatoire discrète suivant la loi binomiale.
+CHIDIST = LOI.KHIDEUX ## Renvoie la probabilité unilatérale de la distribution khi-deux.
+CHIINV = KHIDEUX.INVERSE ## Renvoie l’inverse de la probabilité unilatérale de la distribution khi-deux.
+CHITEST = TEST.KHIDEUX ## Renvoie le test d’indépendance.
+CONFIDENCE = INTERVALLE.CONFIANCE ## Renvoie l’intervalle de confiance pour une moyenne de population.
+CORREL = COEFFICIENT.CORRELATION ## Renvoie le coefficient de corrélation entre deux séries de données.
+COUNT = NB ## Détermine les nombres compris dans la liste des arguments.
+COUNTA = NBVAL ## Détermine le nombre de valeurs comprises dans la liste des arguments.
+COUNTBLANK = NB.VIDE ## Compte le nombre de cellules vides dans une plage.
+COUNTIF = NB.SI ## Compte le nombre de cellules qui répondent à un critère donné dans une plage.
+COUNTIFS = NB.SI.ENS ## Compte le nombre de cellules à l’intérieur d’une plage qui répondent à plusieurs critères.
+COVAR = COVARIANCE ## Renvoie la covariance, moyenne des produits des écarts pour chaque série d’observations.
+CRITBINOM = CRITERE.LOI.BINOMIALE ## Renvoie la plus petite valeur pour laquelle la distribution binomiale cumulée est inférieure ou égale à une valeur de critère.
+DEVSQ = SOMME.CARRES.ECARTS ## Renvoie la somme des carrés des écarts.
+EXPONDIST = LOI.EXPONENTIELLE ## Renvoie la distribution exponentielle.
+FDIST = LOI.F ## Renvoie la distribution de probabilité F.
+FINV = INVERSE.LOI.F ## Renvoie l’inverse de la distribution de probabilité F.
+FISHER = FISHER ## Renvoie la transformation de Fisher.
+FISHERINV = FISHER.INVERSE ## Renvoie l’inverse de la transformation de Fisher.
+FORECAST = PREVISION ## Calcule une valeur par rapport à une tendance linéaire.
+FREQUENCY = FREQUENCE ## Calcule la fréquence d’apparition des valeurs dans une plage de valeurs, puis renvoie des nombres sous forme de matrice verticale.
+FTEST = TEST.F ## Renvoie le résultat d’un test F.
+GAMMADIST = LOI.GAMMA ## Renvoie la probabilité d’une variable aléatoire suivant une loi Gamma.
+GAMMAINV = LOI.GAMMA.INVERSE ## Renvoie, pour une probabilité donnée, la valeur d’une variable aléatoire suivant une loi Gamma.
+GAMMALN = LNGAMMA ## Renvoie le logarithme népérien de la fonction Gamma, G(x)
+GEOMEAN = MOYENNE.GEOMETRIQUE ## Renvoie la moyenne géométrique.
+GROWTH = CROISSANCE ## Calcule des valeurs par rapport à une tendance exponentielle.
+HARMEAN = MOYENNE.HARMONIQUE ## Renvoie la moyenne harmonique.
+HYPGEOMDIST = LOI.HYPERGEOMETRIQUE ## Renvoie la probabilité d’une variable aléatoire discrète suivant une loi hypergéométrique.
+INTERCEPT = ORDONNEE.ORIGINE ## Renvoie l’ordonnée à l’origine d’une droite de régression linéaire.
+KURT = KURTOSIS ## Renvoie le kurtosis d’une série de données.
+LARGE = GRANDE.VALEUR ## Renvoie la k-ième plus grande valeur d’une série de données.
+LINEST = DROITEREG ## Renvoie les paramètres d’une tendance linéaire.
+LOGEST = LOGREG ## Renvoie les paramètres d’une tendance exponentielle.
+LOGINV = LOI.LOGNORMALE.INVERSE ## Renvoie l’inverse de la probabilité pour une variable aléatoire suivant la loi lognormale.
+LOGNORMDIST = LOI.LOGNORMALE ## Renvoie la probabilité d’une variable aléatoire continue suivant une loi lognormale.
+MAX = MAX ## Renvoie la valeur maximale contenue dans une liste d’arguments.
+MAXA = MAXA ## Renvoie la valeur maximale d’une liste d’arguments, nombres, texte et valeurs logiques inclus.
+MEDIAN = MEDIANE ## Renvoie la valeur médiane des nombres donnés.
+MIN = MIN ## Renvoie la valeur minimale contenue dans une liste d’arguments.
+MINA = MINA ## Renvoie la plus petite valeur d’une liste d’arguments, nombres, texte et valeurs logiques inclus.
+MODE = MODE ## Renvoie la valeur la plus courante d’une série de données.
+NEGBINOMDIST = LOI.BINOMIALE.NEG ## Renvoie la probabilité d’une variable aléatoire discrète suivant une loi binomiale négative.
+NORMDIST = LOI.NORMALE ## Renvoie la probabilité d’une variable aléatoire continue suivant une loi normale.
+NORMINV = LOI.NORMALE.INVERSE ## Renvoie, pour une probabilité donnée, la valeur d’une variable aléatoire suivant une loi normale standard.
+NORMSDIST = LOI.NORMALE.STANDARD ## Renvoie la probabilité d’une variable aléatoire continue suivant une loi normale standard.
+NORMSINV = LOI.NORMALE.STANDARD.INVERSE ## Renvoie l’inverse de la distribution cumulée normale standard.
+PEARSON = PEARSON ## Renvoie le coefficient de corrélation d’échantillonnage de Pearson.
+PERCENTILE = CENTILE ## Renvoie le k-ième centile des valeurs d’une plage.
+PERCENTRANK = RANG.POURCENTAGE ## Renvoie le rang en pourcentage d’une valeur d’une série de données.
+PERMUT = PERMUTATION ## Renvoie le nombre de permutations pour un nombre donné d’objets.
+POISSON = LOI.POISSON ## Renvoie la probabilité d’une variable aléatoire suivant une loi de Poisson.
+PROB = PROBABILITE ## Renvoie la probabilité que des valeurs d’une plage soient comprises entre deux limites.
+QUARTILE = QUARTILE ## Renvoie le quartile d’une série de données.
+RANK = RANG ## Renvoie le rang d’un nombre contenu dans une liste.
+RSQ = COEFFICIENT.DETERMINATION ## Renvoie la valeur du coefficient de détermination R^2 d’une régression linéaire.
+SKEW = COEFFICIENT.ASYMETRIE ## Renvoie l’asymétrie d’une distribution.
+SLOPE = PENTE ## Renvoie la pente d’une droite de régression linéaire.
+SMALL = PETITE.VALEUR ## Renvoie la k-ième plus petite valeur d’une série de données.
+STANDARDIZE = CENTREE.REDUITE ## Renvoie une valeur centrée réduite.
+STDEV = ECARTYPE ## Évalue l’écart type d’une population en se basant sur un échantillon de cette population.
+STDEVA = STDEVA ## Évalue l’écart type d’une population en se basant sur un échantillon de cette population, nombres, texte et valeurs logiques inclus.
+STDEVP = ECARTYPEP ## Calcule l’écart type d’une population à partir de la population entière.
+STDEVPA = STDEVPA ## Calcule l’écart type d’une population à partir de l’ensemble de la population, nombres, texte et valeurs logiques inclus.
+STEYX = ERREUR.TYPE.XY ## Renvoie l’erreur type de la valeur y prévue pour chaque x de la régression.
+TDIST = LOI.STUDENT ## Renvoie la probabilité d’une variable aléatoire suivant une loi T de Student.
+TINV = LOI.STUDENT.INVERSE ## Renvoie, pour une probabilité donnée, la valeur d’une variable aléatoire suivant une loi T de Student.
+TREND = TENDANCE ## Renvoie des valeurs par rapport à une tendance linéaire.
+TRIMMEAN = MOYENNE.REDUITE ## Renvoie la moyenne de l’intérieur d’une série de données.
+TTEST = TEST.STUDENT ## Renvoie la probabilité associée à un test T de Student.
+VAR = VAR ## Calcule la variance sur la base d’un échantillon.
+VARA = VARA ## Estime la variance d’une population en se basant sur un échantillon de cette population, nombres, texte et valeurs logiques incluses.
+VARP = VAR.P ## Calcule la variance sur la base de l’ensemble de la population.
+VARPA = VARPA ## Calcule la variance d’une population en se basant sur la population entière, nombres, texte et valeurs logiques inclus.
+WEIBULL = LOI.WEIBULL ## Renvoie la probabilité d’une variable aléatoire suivant une loi de Weibull.
+ZTEST = TEST.Z ## Renvoie la valeur de probabilité unilatérale d’un test z.
+
+
+##
+## Text functions Fonctions de texte
+##
+ASC = ASC ## Change les caractères anglais ou katakana à pleine chasse (codés sur deux octets) à l’intérieur d’une chaîne de caractères en caractères à demi-chasse (codés sur un octet).
+BAHTTEXT = BAHTTEXT ## Convertit un nombre en texte en utilisant le format monétaire ß (baht).
+CHAR = CAR ## Renvoie le caractère spécifié par le code numérique.
+CLEAN = EPURAGE ## Supprime tous les caractères de contrôle du texte.
+CODE = CODE ## Renvoie le numéro de code du premier caractère du texte.
+CONCATENATE = CONCATENER ## Assemble plusieurs éléments textuels de façon à n’en former qu’un seul.
+DOLLAR = EURO ## Convertit un nombre en texte en utilisant le format monétaire € (euro).
+EXACT = EXACT ## Vérifie si deux valeurs de texte sont identiques.
+FIND = TROUVE ## Trouve un valeur textuelle dans une autre, en respectant la casse.
+FINDB = TROUVERB ## Trouve un valeur textuelle dans une autre, en respectant la casse.
+FIXED = CTXT ## Convertit un nombre au format texte avec un nombre de décimales spécifié.
+JIS = JIS ## Change les caractères anglais ou katakana à demi-chasse (codés sur un octet) à l’intérieur d’une chaîne de caractères en caractères à à pleine chasse (codés sur deux octets).
+LEFT = GAUCHE ## Renvoie des caractères situés à l’extrême gauche d’une chaîne de caractères.
+LEFTB = GAUCHEB ## Renvoie des caractères situés à l’extrême gauche d’une chaîne de caractères.
+LEN = NBCAR ## Renvoie le nombre de caractères contenus dans une chaîne de texte.
+LENB = LENB ## Renvoie le nombre de caractères contenus dans une chaîne de texte.
+LOWER = MINUSCULE ## Convertit le texte en minuscules.
+MID = STXT ## Renvoie un nombre déterminé de caractères d’une chaîne de texte à partir de la position que vous indiquez.
+MIDB = STXTB ## Renvoie un nombre déterminé de caractères d’une chaîne de texte à partir de la position que vous indiquez.
+PHONETIC = PHONETIQUE ## Extrait les caractères phonétiques (furigana) d’une chaîne de texte.
+PROPER = NOMPROPRE ## Met en majuscules la première lettre de chaque mot dans une chaîne textuelle.
+REPLACE = REMPLACER ## Remplace des caractères dans un texte.
+REPLACEB = REMPLACERB ## Remplace des caractères dans un texte.
+REPT = REPT ## Répète un texte un certain nombre de fois.
+RIGHT = DROITE ## Renvoie des caractères situés à l’extrême droite d’une chaîne de caractères.
+RIGHTB = DROITEB ## Renvoie des caractères situés à l’extrême droite d’une chaîne de caractères.
+SEARCH = CHERCHE ## Trouve un texte dans un autre texte (sans respecter la casse).
+SEARCHB = CHERCHERB ## Trouve un texte dans un autre texte (sans respecter la casse).
+SUBSTITUTE = SUBSTITUE ## Remplace l’ancien texte d’une chaîne de caractères par un nouveau.
+T = T ## Convertit ses arguments en texte.
+TEXT = TEXTE ## Convertit un nombre au format texte.
+TRIM = SUPPRESPACE ## Supprime les espaces du texte.
+UPPER = MAJUSCULE ## Convertit le texte en majuscules.
+VALUE = CNUM ## Convertit un argument textuel en nombre
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/hu/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/hu/config
new file mode 100644
index 00000000000..db61436c1ed
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/hu/config
@@ -0,0 +1,23 @@
+##
+## PhpSpreadsheet
+##
+
+ArgumentSeparator = ;
+
+
+##
+## (For future use)
+##
+currencySymbol = Ft
+
+
+##
+## Excel Error Codes (For future use)
+##
+NULL = #NULLA!
+DIV0 = #ZÉRÓOSZTÓ!
+VALUE = #ÉRTÉK!
+REF = #HIV!
+NAME = #NÉV?
+NUM = #SZÁM!
+NA = #HIÁNYZIK
diff --git a/lib/phpexcel/PHPExcel/locale/hu/functions b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/hu/functions
similarity index 95%
rename from lib/phpexcel/PHPExcel/locale/hu/functions
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/hu/functions
index 200d3f71fe2..3adffeb148d 100644
--- a/lib/phpexcel/PHPExcel/locale/hu/functions
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/hu/functions
@@ -1,438 +1,416 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Calculation
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/
-##
-##
-
-
-##
-## Add-in and Automation functions Bővítmények és automatizálási függvények
-##
-GETPIVOTDATA = KIMUTATÁSADATOT.VESZ ## A kimutatásokban tárolt adatok visszaadására használható.
-
-
-##
-## Cube functions Kockafüggvények
-##
-CUBEKPIMEMBER = KOCKA.FŐTELJMUT ## Egy fő teljesítménymutató (KPI) nevét, tulajdonságát és mértékegységét adja eredményül, a nevet és a tulajdonságot megjeleníti a cellában. A KPI-k számszerűsíthető mérési lehetőséget jelentenek – ilyen mutató például a havi bruttó nyereség vagy az egy alkalmazottra jutó negyedéves forgalom –, egy szervezet teljesítményének nyomonkövetésére használhatók.
-CUBEMEMBER = KOCKA.TAG ## Kockahierachia tagját vagy rekordját adja eredményül. Ellenőrizhető vele, hogy szerepel-e a kockában az adott tag vagy rekord.
-CUBEMEMBERPROPERTY = KOCKA.TAG.TUL ## A kocka egyik tagtulajdonságának értékét adja eredményül. Használatával ellenőrizhető, hogy szerepel-e egy tagnév a kockában, eredménye pedig az erre a tagra vonatkozó, megadott tulajdonság.
-CUBERANKEDMEMBER = KOCKA.HALM.ELEM ## Egy halmaz rangsor szerinti n-edik tagját adja eredményül. Használatával egy halmaz egy vagy több elemét kaphatja meg, például a legnagyobb teljesítményű üzletkötőt vagy a 10 legjobb tanulót.
-CUBESET = KOCKA.HALM ## Számított tagok vagy rekordok halmazát adja eredményül, ehhez egy beállított kifejezést elküld a kiszolgálón található kockának, majd ezt a halmazt adja vissza a Microsoft Office Excel alkalmazásnak.
-CUBESETCOUNT = KOCKA.HALM.DB ## Egy halmaz elemszámát adja eredményül.
-CUBEVALUE = KOCKA.ÉRTÉK ## Kockából összesített értéket ad eredményül.
-
-
-##
-## Database functions Adatbázis-kezelő függvények
-##
-DAVERAGE = AB.ÁTLAG ## A kijelölt adatbáziselemek átlagát számítja ki.
-DCOUNT = AB.DARAB ## Megszámolja, hogy az adatbázisban hány cella tartalmaz számokat.
-DCOUNTA = AB.DARAB2 ## Megszámolja az adatbázisban lévő nem üres cellákat.
-DGET = AB.MEZŐ ## Egy adatbázisból egyetlen olyan rekordot ad vissza, amely megfelel a megadott feltételeknek.
-DMAX = AB.MAX ## A kiválasztott adatbáziselemek közül a legnagyobb értéket adja eredményül.
-DMIN = AB.MIN ## A kijelölt adatbáziselemek közül a legkisebb értéket adja eredményül.
-DPRODUCT = AB.SZORZAT ## Az adatbázis megadott feltételeknek eleget tevő rekordjaira összeszorozza a megadott mezőben található számértékeket, és eredményül ezt a szorzatot adja.
-DSTDEV = AB.SZÓRÁS ## A kijelölt adatbáziselemek egy mintája alapján megbecsüli a szórást.
-DSTDEVP = AB.SZÓRÁS2 ## A kijelölt adatbáziselemek teljes sokasága alapján kiszámítja a szórást.
-DSUM = AB.SZUM ## Összeadja a feltételnek megfelelő adatbázisrekordok mezőoszlopában a számokat.
-DVAR = AB.VAR ## A kijelölt adatbáziselemek mintája alapján becslést ad a szórásnégyzetre.
-DVARP = AB.VAR2 ## A kijelölt adatbáziselemek teljes sokasága alapján kiszámítja a szórásnégyzetet.
-
-
-##
-## Date and time functions Dátumfüggvények
-##
-DATE = DÁTUM ## Adott dátum dátumértékét adja eredményül.
-DATEVALUE = DÁTUMÉRTÉK ## Szövegként megadott dátumot dátumértékké alakít át.
-DAY = NAP ## Dátumértéket a hónap egy napjává (0-31) alakít.
-DAYS360 = NAP360 ## Két dátum közé eső napok számát számítja ki a 360 napos év alapján.
-EDATE = EDATE ## Adott dátumnál adott számú hónappal korábbi vagy későbbi dátum dátumértékét adja eredményül.
-EOMONTH = EOMONTH ## Adott dátumnál adott számú hónappal korábbi vagy későbbi hónap utolsó napjának dátumértékét adja eredményül.
-HOUR = ÓRA ## Időértéket órákká alakít.
-MINUTE = PERC ## Időértéket percekké alakít.
-MONTH = HÓNAP ## Időértéket hónapokká alakít.
-NETWORKDAYS = NETWORKDAYS ## Két dátum között a teljes munkanapok számát adja meg.
-NOW = MOST ## A napi dátum dátumértékét és a pontos idő időértékét adja eredményül.
-SECOND = MPERC ## Időértéket másodpercekké alakít át.
-TIME = IDŐ ## Adott időpont időértékét adja meg.
-TIMEVALUE = IDŐÉRTÉK ## Szövegként megadott időpontot időértékké alakít át.
-TODAY = MA ## A napi dátum dátumértékét adja eredményül.
-WEEKDAY = HÉT.NAPJA ## Dátumértéket a hét napjává alakítja át.
-WEEKNUM = WEEKNUM ## Visszatérési értéke egy szám, amely azt mutatja meg, hogy a megadott dátum az év hányadik hetére esik.
-WORKDAY = WORKDAY ## Adott dátumnál adott munkanappal korábbi vagy későbbi dátum dátumértékét adja eredményül.
-YEAR = ÉV ## Sorszámot évvé alakít át.
-YEARFRAC = YEARFRAC ## Az adott dátumok közötti teljes napok számát törtévként adja meg.
-
-
-##
-## Engineering functions Mérnöki függvények
-##
-BESSELI = BESSELI ## Az In(x) módosított Bessel-függvény értékét adja eredményül.
-BESSELJ = BESSELJ ## A Jn(x) Bessel-függvény értékét adja eredményül.
-BESSELK = BESSELK ## A Kn(x) módosított Bessel-függvény értékét adja eredményül.
-BESSELY = BESSELY ## Az Yn(x) módosított Bessel-függvény értékét adja eredményül.
-BIN2DEC = BIN2DEC ## Bináris számot decimálissá alakít át.
-BIN2HEX = BIN2HEX ## Bináris számot hexadecimálissá alakít át.
-BIN2OCT = BIN2OCT ## Bináris számot oktálissá alakít át.
-COMPLEX = COMPLEX ## Valós és képzetes részből komplex számot képez.
-CONVERT = CONVERT ## Mértékegységeket vált át.
-DEC2BIN = DEC2BIN ## Decimális számot binárissá alakít át.
-DEC2HEX = DEC2HEX ## Decimális számot hexadecimálissá alakít át.
-DEC2OCT = DEC2OCT ## Decimális számot oktálissá alakít át.
-DELTA = DELTA ## Azt vizsgálja, hogy két érték egyenlő-e.
-ERF = ERF ## A hibafüggvény értékét adja eredményül.
-ERFC = ERFC ## A kiegészített hibafüggvény értékét adja eredményül.
-GESTEP = GESTEP ## Azt vizsgálja, hogy egy szám nagyobb-e adott küszöbértéknél.
-HEX2BIN = HEX2BIN ## Hexadecimális számot binárissá alakít át.
-HEX2DEC = HEX2DEC ## Hexadecimális számot decimálissá alakít át.
-HEX2OCT = HEX2OCT ## Hexadecimális számot oktálissá alakít át.
-IMABS = IMABS ## Komplex szám abszolút értékét (modulusát) adja eredményül.
-IMAGINARY = IMAGINARY ## Komplex szám képzetes részét adja eredményül.
-IMARGUMENT = IMARGUMENT ## A komplex szám radiánban kifejezett théta argumentumát adja eredményül.
-IMCONJUGATE = IMCONJUGATE ## Komplex szám komplex konjugáltját adja eredményül.
-IMCOS = IMCOS ## Komplex szám koszinuszát adja eredményül.
-IMDIV = IMDIV ## Két komplex szám hányadosát adja eredményül.
-IMEXP = IMEXP ## Az e szám komplex kitevőjű hatványát adja eredményül.
-IMLN = IMLN ## Komplex szám természetes logaritmusát adja eredményül.
-IMLOG10 = IMLOG10 ## Komplex szám tízes alapú logaritmusát adja eredményül.
-IMLOG2 = IMLOG2 ## Komplex szám kettes alapú logaritmusát adja eredményül.
-IMPOWER = IMPOWER ## Komplex szám hatványát adja eredményül.
-IMPRODUCT = IMPRODUCT ## Komplex számok szorzatát adja eredményül.
-IMREAL = IMREAL ## Komplex szám valós részét adja eredményül.
-IMSIN = IMSIN ## Komplex szám szinuszát adja eredményül.
-IMSQRT = IMSQRT ## Komplex szám négyzetgyökét adja eredményül.
-IMSUB = IMSUB ## Két komplex szám különbségét adja eredményül.
-IMSUM = IMSUM ## Komplex számok összegét adja eredményül.
-OCT2BIN = OCT2BIN ## Oktális számot binárissá alakít át.
-OCT2DEC = OCT2DEC ## Oktális számot decimálissá alakít át.
-OCT2HEX = OCT2HEX ## Oktális számot hexadecimálissá alakít át.
-
-
-##
-## Financial functions Pénzügyi függvények
-##
-ACCRINT = ACCRINT ## Periodikusan kamatozó értékpapír felszaporodott kamatát adja eredményül.
-ACCRINTM = ACCRINTM ## Lejáratkor kamatozó értékpapír felszaporodott kamatát adja eredményül.
-AMORDEGRC = AMORDEGRC ## Állóeszköz lineáris értékcsökkenését adja meg az egyes könyvelési időszakokra vonatkozóan.
-AMORLINC = AMORLINC ## Az egyes könyvelési időszakokban az értékcsökkenést adja meg.
-COUPDAYBS = COUPDAYBS ## A szelvényidőszak kezdetétől a kifizetés időpontjáig eltelt napokat adja vissza.
-COUPDAYS = COUPDAYS ## A kifizetés időpontját magában foglaló szelvényperiódus hosszát adja meg napokban.
-COUPDAYSNC = COUPDAYSNC ## A kifizetés időpontja és a legközelebbi szelvénydátum közötti napok számát adja meg.
-COUPNCD = COUPNCD ## A kifizetést követő legelső szelvénydátumot adja eredményül.
-COUPNUM = COUPNUM ## A kifizetés és a lejárat időpontja között kifizetendő szelvények számát adja eredményül.
-COUPPCD = COUPPCD ## A kifizetés előtti utolsó szelvénydátumot adja eredményül.
-CUMIPMT = CUMIPMT ## Két fizetési időszak között kifizetett kamat halmozott értékét adja eredményül.
-CUMPRINC = CUMPRINC ## Két fizetési időszak között kifizetett részletek halmozott (kamatot nem tartalmazó) értékét adja eredményül.
-DB = KCS2 ## Eszköz adott időszak alatti értékcsökkenését számítja ki a lineáris leírási modell alkalmazásával.
-DDB = KCSA ## Eszköz értékcsökkenését számítja ki adott időszakra vonatkozóan a progresszív vagy egyéb megadott leírási modell alkalmazásával.
-DISC = DISC ## Értékpapír leszámítolási kamatlábát adja eredményül.
-DOLLARDE = DOLLARDE ## Egy közönséges törtként megadott számot tizedes törtté alakít át.
-DOLLARFR = DOLLARFR ## Tizedes törtként megadott számot közönséges törtté alakít át.
-DURATION = DURATION ## Periodikus kamatfizetésű értékpapír éves kamatérzékenységét adja eredményül.
-EFFECT = EFFECT ## Az éves tényleges kamatláb értékét adja eredményül.
-FV = JBÉ ## Befektetés jövőbeli értékét számítja ki.
-FVSCHEDULE = FVSCHEDULE ## A kezdőtőke adott kamatlábak szerint megnövelt jövőbeli értékét adja eredményül.
-INTRATE = INTRATE ## A lejáratig teljesen lekötött értékpapír kamatrátáját adja eredményül.
-IPMT = RRÉSZLET ## Hiteltörlesztésen belül a tőketörlesztés nagyságát számítja ki adott időszakra.
-IRR = BMR ## A befektetés belső megtérülési rátáját számítja ki pénzáramláshoz.
-ISPMT = LRÉSZLETKAMAT ## A befektetés adott időszakára fizetett kamatot számítja ki.
-MDURATION = MDURATION ## Egy 100 Ft névértékű értékpapír Macauley-féle módosított kamatérzékenységét adja eredményül.
-MIRR = MEGTÉRÜLÉS ## A befektetés belső megtérülési rátáját számítja ki a költségek és a bevételek különböző kamatlába mellett.
-NOMINAL = NOMINAL ## Az éves névleges kamatláb értékét adja eredményül.
-NPER = PER.SZÁM ## A törlesztési időszakok számát adja meg.
-NPV = NMÉ ## Befektetéshez kapcsolódó pénzáramlás nettó jelenértékét számítja ki ismert pénzáramlás és kamatláb mellett.
-ODDFPRICE = ODDFPRICE ## Egy 100 Ft névértékű, a futamidő elején töredék-időszakos értékpapír árát adja eredményül.
-ODDFYIELD = ODDFYIELD ## A futamidő elején töredék-időszakos értékpapír hozamát adja eredményül.
-ODDLPRICE = ODDLPRICE ## Egy 100 Ft névértékű, a futamidő végén töredék-időszakos értékpapír árát adja eredményül.
-ODDLYIELD = ODDLYIELD ## A futamidő végén töredék-időszakos értékpapír hozamát adja eredményül.
-PMT = RÉSZLET ## A törlesztési időszakra vonatkozó törlesztési összeget számítja ki.
-PPMT = PRÉSZLET ## Hiteltörlesztésen belül a tőketörlesztés nagyságát számítja ki adott időszakra.
-PRICE = PRICE ## Egy 100 Ft névértékű, periodikusan kamatozó értékpapír árát adja eredményül.
-PRICEDISC = PRICEDISC ## Egy 100 Ft névértékű leszámítolt értékpapír árát adja eredményül.
-PRICEMAT = PRICEMAT ## Egy 100 Ft névértékű, a lejáratkor kamatozó értékpapír árát adja eredményül.
-PV = MÉ ## Befektetés jelenlegi értékét számítja ki.
-RATE = RÁTA ## Egy törlesztési időszakban az egy időszakra eső kamatláb nagyságát számítja ki.
-RECEIVED = RECEIVED ## A lejáratig teljesen lekötött értékpapír lejáratakor kapott összegét adja eredményül.
-SLN = LCSA ## Tárgyi eszköz egy időszakra eső amortizációját adja meg bruttó érték szerinti lineáris leírási kulcsot alkalmazva.
-SYD = SYD ## Tárgyi eszköz értékcsökkenését számítja ki adott időszakra az évek számjegyösszegével dolgozó módszer alapján.
-TBILLEQ = TBILLEQ ## Kincstárjegy kötvény-egyenértékű hozamát adja eredményül.
-TBILLPRICE = TBILLPRICE ## Egy 100 Ft névértékű kincstárjegy árát adja eredményül.
-TBILLYIELD = TBILLYIELD ## Kincstárjegy hozamát adja eredményül.
-VDB = ÉCSRI ## Tárgyi eszköz amortizációját számítja ki megadott vagy részidőszakra a csökkenő egyenleg módszerének alkalmazásával.
-XIRR = XIRR ## Ütemezett készpénzforgalom (cash flow) belső megtérülési kamatrátáját adja eredményül.
-XNPV = XNPV ## Ütemezett készpénzforgalom (cash flow) nettó jelenlegi értékét adja eredményül.
-YIELD = YIELD ## Periodikusan kamatozó értékpapír hozamát adja eredményül.
-YIELDDISC = YIELDDISC ## Leszámítolt értékpapír (például kincstárjegy) éves hozamát adja eredményül.
-YIELDMAT = YIELDMAT ## Lejáratkor kamatozó értékpapír éves hozamát adja eredményül.
-
-
-##
-## Information functions Információs függvények
-##
-CELL = CELLA ## Egy cella formátumára, elhelyezkedésére vagy tartalmára vonatkozó adatokat ad eredményül.
-ERROR.TYPE = HIBA.TÍPUS ## Egy hibatípushoz tartozó számot ad eredményül.
-INFO = INFÓ ## A rendszer- és munkakörnyezet pillanatnyi állapotáról ad felvilágosítást.
-ISBLANK = ÜRES ## Eredménye IGAZ, ha az érték üres.
-ISERR = HIBA ## Eredménye IGAZ, ha az érték valamelyik hibaérték a #HIÁNYZIK kivételével.
-ISERROR = HIBÁS ## Eredménye IGAZ, ha az érték valamelyik hibaérték.
-ISEVEN = ISEVEN ## Eredménye IGAZ, ha argumentuma páros szám.
-ISLOGICAL = LOGIKAI ## Eredménye IGAZ, ha az érték logikai érték.
-ISNA = NINCS ## Eredménye IGAZ, ha az érték a #HIÁNYZIK hibaérték.
-ISNONTEXT = NEM.SZÖVEG ## Eredménye IGAZ, ha az érték nem szöveg.
-ISNUMBER = SZÁM ## Eredménye IGAZ, ha az érték szám.
-ISODD = ISODD ## Eredménye IGAZ, ha argumentuma páratlan szám.
-ISREF = HIVATKOZÁS ## Eredménye IGAZ, ha az érték hivatkozás.
-ISTEXT = SZÖVEG.E ## Eredménye IGAZ, ha az érték szöveg.
-N = N ## Argumentumának értékét számmá alakítja.
-NA = HIÁNYZIK ## Eredménye a #HIÁNYZIK hibaérték.
-TYPE = TÍPUS ## Érték adattípusának azonosítószámát adja eredményül.
-
-
-##
-## Logical functions Logikai függvények
-##
-AND = ÉS ## Eredménye IGAZ, ha minden argumentuma IGAZ.
-FALSE = HAMIS ## A HAMIS logikai értéket adja eredményül.
-IF = HA ## Logikai vizsgálatot hajt végre.
-IFERROR = HAHIBA ## A megadott értéket adja vissza, ha egy képlet hibához vezet; más esetben a képlet értékét adja eredményül.
-NOT = NEM ## Argumentuma értékének ellentettjét adja eredményül.
-OR = VAGY ## Eredménye IGAZ, ha bármely argumentuma IGAZ.
-TRUE = IGAZ ## Az IGAZ logikai értéket adja eredményül.
-
-
-##
-## Lookup and reference functions Keresési és hivatkozási függvények
-##
-ADDRESS = CÍM ## A munkalap egy cellájára való hivatkozást adja szövegként eredményül.
-AREAS = TERÜLET ## Hivatkozásban a területek számát adja eredményül.
-CHOOSE = VÁLASZT ## Értékek listájából választ ki egy elemet.
-COLUMN = OSZLOP ## Egy hivatkozás oszlopszámát adja eredményül.
-COLUMNS = OSZLOPOK ## A hivatkozásban található oszlopok számát adja eredményül.
-HLOOKUP = VKERES ## A megadott tömb felső sorában adott értékű elemet keres, és a megtalált elem oszlopából adott sorban elhelyezkedő értékkel tér vissza.
-HYPERLINK = HIPERHIVATKOZÁS ## Hálózati kiszolgálón, intraneten vagy az interneten tárolt dokumentumot megnyitó parancsikont vagy hivatkozást hoz létre.
-INDEX = INDEX ## Tömb- vagy hivatkozás indexszel megadott értékét adja vissza.
-INDIRECT = INDIREKT ## Szöveg megadott hivatkozást ad eredményül.
-LOOKUP = KERES ## Vektorban vagy tömbben keres meg értékeket.
-MATCH = HOL.VAN ## Hivatkozásban vagy tömbben értékeket keres.
-OFFSET = OFSZET ## Hivatkozás egy másik hivatkozástól számított távolságát adja meg.
-ROW = SOR ## Egy hivatkozás sorának számát adja meg.
-ROWS = SOROK ## Egy hivatkozás sorainak számát adja meg.
-RTD = RTD ## Valós idejű adatokat keres vissza a COM automatizmust (automatizálás: Egy alkalmazás objektumaival való munka másik alkalmazásból vagy fejlesztőeszközből. A korábban OLE automatizmusnak nevezett automatizálás iparági szabvány, a Component Object Model (COM) szolgáltatása.) támogató programból.
-TRANSPOSE = TRANSZPONÁLÁS ## Egy tömb transzponáltját adja eredményül.
-VLOOKUP = FKERES ## A megadott tömb bal szélső oszlopában megkeres egy értéket, majd annak sora és a megadott oszlop metszéspontjában levő értéked adja eredményül.
-
-
-##
-## Math and trigonometry functions Matematikai és trigonometrikus függvények
-##
-ABS = ABS ## Egy szám abszolút értékét adja eredményül.
-ACOS = ARCCOS ## Egy szám arkusz koszinuszát számítja ki.
-ACOSH = ACOSH ## Egy szám inverz koszinusz hiperbolikuszát számítja ki.
-ASIN = ARCSIN ## Egy szám arkusz szinuszát számítja ki.
-ASINH = ASINH ## Egy szám inverz szinusz hiperbolikuszát számítja ki.
-ATAN = ARCTAN ## Egy szám arkusz tangensét számítja ki.
-ATAN2 = ARCTAN2 ## X és y koordináták alapján számítja ki az arkusz tangens értéket.
-ATANH = ATANH ## A szám inverz tangens hiperbolikuszát számítja ki.
-CEILING = PLAFON ## Egy számot a legközelebbi egészre vagy a pontosságként megadott érték legközelebb eső többszörösére kerekít.
-COMBIN = KOMBINÁCIÓK ## Adott számú objektum összes lehetséges kombinációinak számát számítja ki.
-COS = COS ## Egy szám koszinuszát számítja ki.
-COSH = COSH ## Egy szám koszinusz hiperbolikuszát számítja ki.
-DEGREES = FOK ## Radiánt fokká alakít át.
-EVEN = PÁROS ## Egy számot a legközelebbi páros egész számra kerekít.
-EXP = KITEVŐ ## Az e adott kitevőjű hatványát adja eredményül.
-FACT = FAKT ## Egy szám faktoriálisát számítja ki.
-FACTDOUBLE = FACTDOUBLE ## Egy szám dupla faktoriálisát adja eredményül.
-FLOOR = PADLÓ ## Egy számot lefelé, a nulla felé kerekít.
-GCD = GCD ## A legnagyobb közös osztót adja eredményül.
-INT = INT ## Egy számot lefelé kerekít a legközelebbi egészre.
-LCM = LCM ## A legkisebb közös többszöröst adja eredményül.
-LN = LN ## Egy szám természetes logaritmusát számítja ki.
-LOG = LOG ## Egy szám adott alapú logaritmusát számítja ki.
-LOG10 = LOG10 ## Egy szám 10-es alapú logaritmusát számítja ki.
-MDETERM = MDETERM ## Egy tömb mátrix-determinánsát számítja ki.
-MINVERSE = INVERZ.MÁTRIX ## Egy tömb mátrix inverzét adja eredményül.
-MMULT = MSZORZAT ## Két tömb mátrix-szorzatát adja meg.
-MOD = MARADÉK ## Egy szám osztási maradékát adja eredményül.
-MROUND = MROUND ## A kívánt többszörösére kerekített értéket ad eredményül.
-MULTINOMIAL = MULTINOMIAL ## Számhalmaz multinomiálisát adja eredményül.
-ODD = PÁRATLAN ## Egy számot a legközelebbi páratlan számra kerekít.
-PI = PI ## A pi matematikai állandót adja vissza.
-POWER = HATVÁNY ## Egy szám adott kitevőjű hatványát számítja ki.
-PRODUCT = SZORZAT ## Argumentumai szorzatát számítja ki.
-QUOTIENT = QUOTIENT ## Egy hányados egész részét adja eredményül.
-RADIANS = RADIÁN ## Fokot radiánná alakít át.
-RAND = VÉL ## Egy 0 és 1 közötti véletlen számot ad eredményül.
-RANDBETWEEN = RANDBETWEEN ## Megadott számok közé eső véletlen számot állít elő.
-ROMAN = RÓMAI ## Egy számot római számokkal kifejezve szövegként ad eredményül.
-ROUND = KEREKÍTÉS ## Egy számot adott számú számjegyre kerekít.
-ROUNDDOWN = KEREKÍTÉS.LE ## Egy számot lefelé, a nulla felé kerekít.
-ROUNDUP = KEREKÍTÉS.FEL ## Egy számot felfelé, a nullától távolabbra kerekít.
-SERIESSUM = SERIESSUM ## Hatványsor összegét adja eredményül.
-SIGN = ELŐJEL ## Egy szám előjelét adja meg.
-SIN = SIN ## Egy szög szinuszát számítja ki.
-SINH = SINH ## Egy szám szinusz hiperbolikuszát számítja ki.
-SQRT = GYÖK ## Egy szám pozitív négyzetgyökét számítja ki.
-SQRTPI = SQRTPI ## A (szám*pi) négyzetgyökét adja eredményül.
-SUBTOTAL = RÉSZÖSSZEG ## Lista vagy adatbázis részösszegét adja eredményül.
-SUM = SZUM ## Összeadja az argumentumlistájában lévő számokat.
-SUMIF = SZUMHA ## A megadott feltételeknek eleget tevő cellákban található értékeket adja össze.
-SUMIFS = SZUMHATÖBB ## Több megadott feltételnek eleget tévő tartománycellák összegét adja eredményül.
-SUMPRODUCT = SZORZATÖSSZEG ## A megfelelő tömbelemek szorzatának összegét számítja ki.
-SUMSQ = NÉGYZETÖSSZEG ## Argumentumai négyzetének összegét számítja ki.
-SUMX2MY2 = SZUMX2BŐLY2 ## Két tömb megfelelő elemei négyzetének különbségét összegzi.
-SUMX2PY2 = SZUMX2MEGY2 ## Két tömb megfelelő elemei négyzetének összegét összegzi.
-SUMXMY2 = SZUMXBŐLY2 ## Két tömb megfelelő elemei különbségének négyzetösszegét számítja ki.
-TAN = TAN ## Egy szám tangensét számítja ki.
-TANH = TANH ## Egy szám tangens hiperbolikuszát számítja ki.
-TRUNC = CSONK ## Egy számot egésszé csonkít.
-
-
-##
-## Statistical functions Statisztikai függvények
-##
-AVEDEV = ÁTL.ELTÉRÉS ## Az adatpontoknak átlaguktól való átlagos abszolút eltérését számítja ki.
-AVERAGE = ÁTLAG ## Argumentumai átlagát számítja ki.
-AVERAGEA = ÁTLAGA ## Argumentumai átlagát számítja ki (beleértve a számokat, szöveget és logikai értékeket).
-AVERAGEIF = ÁTLAGHA ## A megadott feltételnek eleget tévő tartomány celláinak átlagát (számtani közepét) adja eredményül.
-AVERAGEIFS = ÁTLAGHATÖBB ## A megadott feltételeknek eleget tévő cellák átlagát (számtani közepét) adja eredményül.
-BETADIST = BÉTA.ELOSZLÁS ## A béta-eloszlás függvényt számítja ki.
-BETAINV = INVERZ.BÉTA ## Adott béta-eloszláshoz kiszámítja a béta eloszlásfüggvény inverzét.
-BINOMDIST = BINOM.ELOSZLÁS ## A diszkrét binomiális eloszlás valószínűségértékét számítja ki.
-CHIDIST = KHI.ELOSZLÁS ## A khi-négyzet-eloszlás egyszélű valószínűségértékét számítja ki.
-CHIINV = INVERZ.KHI ## A khi-négyzet-eloszlás egyszélű valószínűségértékének inverzét számítja ki.
-CHITEST = KHI.PRÓBA ## Függetlenségvizsgálatot hajt végre.
-CONFIDENCE = MEGBÍZHATÓSÁG ## Egy statisztikai sokaság várható értékének megbízhatósági intervallumát adja eredményül.
-CORREL = KORREL ## Két adathalmaz korrelációs együtthatóját számítja ki.
-COUNT = DARAB ## Megszámolja, hogy argumentumlistájában hány szám található.
-COUNTA = DARAB2 ## Megszámolja, hogy argumentumlistájában hány érték található.
-COUNTBLANK = DARABÜRES ## Egy tartományban összeszámolja az üres cellákat.
-COUNTIF = DARABTELI ## Egy tartományban összeszámolja azokat a cellákat, amelyek eleget tesznek a megadott feltételnek.
-COUNTIFS = DARABHATÖBB ## Egy tartományban összeszámolja azokat a cellákat, amelyek eleget tesznek több feltételnek.
-COVAR = KOVAR ## A kovarianciát, azaz a páronkénti eltérések szorzatának átlagát számítja ki.
-CRITBINOM = KRITBINOM ## Azt a legkisebb számot adja eredményül, amelyre a binomiális eloszlásfüggvény értéke nem kisebb egy adott határértéknél.
-DEVSQ = SQ ## Az átlagtól való eltérések négyzetének összegét számítja ki.
-EXPONDIST = EXP.ELOSZLÁS ## Az exponenciális eloszlás értékét számítja ki.
-FDIST = F.ELOSZLÁS ## Az F-eloszlás értékét számítja ki.
-FINV = INVERZ.F ## Az F-eloszlás inverzének értékét számítja ki.
-FISHER = FISHER ## Fisher-transzformációt hajt végre.
-FISHERINV = INVERZ.FISHER ## A Fisher-transzformáció inverzét hajtja végre.
-FORECAST = ELŐREJELZÉS ## Az ismert értékek alapján lineáris regresszióval becsült értéket ad eredményül.
-FREQUENCY = GYAKORISÁG ## A gyakorisági vagy empirikus eloszlás értékét függőleges tömbként adja eredményül.
-FTEST = F.PRÓBA ## Az F-próba értékét adja eredményül.
-GAMMADIST = GAMMA.ELOSZLÁS ## A gamma-eloszlás értékét számítja ki.
-GAMMAINV = INVERZ.GAMMA ## A gamma-eloszlás eloszlásfüggvénye inverzének értékét számítja ki.
-GAMMALN = GAMMALN ## A gamma-függvény természetes logaritmusát számítja ki.
-GEOMEAN = MÉRTANI.KÖZÉP ## Argumentumai mértani középértékét számítja ki.
-GROWTH = NÖV ## Exponenciális regresszió alapján ad becslést.
-HARMEAN = HARM.KÖZÉP ## Argumentumai harmonikus átlagát számítja ki.
-HYPGEOMDIST = HIPERGEOM.ELOSZLÁS ## A hipergeometriai eloszlás értékét számítja ki.
-INTERCEPT = METSZ ## A regressziós egyenes y tengellyel való metszéspontját határozza meg.
-KURT = CSÚCSOSSÁG ## Egy adathalmaz csúcsosságát számítja ki.
-LARGE = NAGY ## Egy adathalmaz k-adik legnagyobb elemét adja eredményül.
-LINEST = LIN.ILL ## A legkisebb négyzetek módszerével az adatokra illesztett egyenes paramétereit határozza meg.
-LOGEST = LOG.ILL ## Az adatokra illesztett exponenciális görbe paramétereit határozza meg.
-LOGINV = INVERZ.LOG.ELOSZLÁS ## A lognormális eloszlás inverzét számítja ki.
-LOGNORMDIST = LOG.ELOSZLÁS ## A lognormális eloszlásfüggvény értékét számítja ki.
-MAX = MAX ## Az argumentumai között szereplő legnagyobb számot adja meg.
-MAXA = MAX2 ## Az argumentumai között szereplő legnagyobb számot adja meg (beleértve a számokat, szöveget és logikai értékeket).
-MEDIAN = MEDIÁN ## Adott számhalmaz mediánját számítja ki.
-MIN = MIN ## Az argumentumai között szereplő legkisebb számot adja meg.
-MINA = MIN2 ## Az argumentumai között szereplő legkisebb számot adja meg, beleértve a számokat, szöveget és logikai értékeket.
-MODE = MÓDUSZ ## Egy adathalmazból kiválasztja a leggyakrabban előforduló számot.
-NEGBINOMDIST = NEGBINOM.ELOSZL ## A negatív binomiális eloszlás értékét számítja ki.
-NORMDIST = NORM.ELOSZL ## A normális eloszlás értékét számítja ki.
-NORMINV = INVERZ.NORM ## A normális eloszlás eloszlásfüggvénye inverzének értékét számítja ki.
-NORMSDIST = STNORMELOSZL ## A standard normális eloszlás eloszlásfüggvényének értékét számítja ki.
-NORMSINV = INVERZ.STNORM ## A standard normális eloszlás eloszlásfüggvénye inverzének értékét számítja ki.
-PEARSON = PEARSON ## A Pearson-féle korrelációs együtthatót számítja ki.
-PERCENTILE = PERCENTILIS ## Egy tartományban található értékek k-adik percentilisét, azaz százalékosztályát adja eredményül.
-PERCENTRANK = SZÁZALÉKRANG ## Egy értéknek egy adathalmazon belül vett százalékos rangját (elhelyezkedését) számítja ki.
-PERMUT = VARIÁCIÓK ## Adott számú objektum k-ad osztályú ismétlés nélküli variációinak számát számítja ki.
-POISSON = POISSON ## A Poisson-eloszlás értékét számítja ki.
-PROB = VALÓSZÍNŰSÉG ## Annak valószínűségét számítja ki, hogy adott értékek két határérték közé esnek.
-QUARTILE = KVARTILIS ## Egy adathalmaz kvartilisét (negyedszintjét) számítja ki.
-RANK = SORSZÁM ## Kiszámítja, hogy egy szám hányadik egy számsorozatban.
-RSQ = RNÉGYZET ## Kiszámítja a Pearson-féle szorzatmomentum korrelációs együtthatójának négyzetét.
-SKEW = FERDESÉG ## Egy eloszlás ferdeségét határozza meg.
-SLOPE = MEREDEKSÉG ## Egy lineáris regressziós egyenes meredekségét számítja ki.
-SMALL = KICSI ## Egy adathalmaz k-adik legkisebb elemét adja meg.
-STANDARDIZE = NORMALIZÁLÁS ## Normalizált értéket ad eredményül.
-STDEV = SZÓRÁS ## Egy statisztikai sokaság mintájából kiszámítja annak szórását.
-STDEVA = SZÓRÁSA ## Egy statisztikai sokaság mintájából kiszámítja annak szórását (beleértve a számokat, szöveget és logikai értékeket).
-STDEVP = SZÓRÁSP ## Egy statisztikai sokaság egészéből kiszámítja annak szórását.
-STDEVPA = SZÓRÁSPA ## Egy statisztikai sokaság egészéből kiszámítja annak szórását (beleértve számokat, szöveget és logikai értékeket).
-STEYX = STHIBAYX ## Egy regresszió esetén az egyes x-értékek alapján meghatározott y-értékek standard hibáját számítja ki.
-TDIST = T.ELOSZLÁS ## A Student-féle t-eloszlás értékét számítja ki.
-TINV = INVERZ.T ## A Student-féle t-eloszlás inverzét számítja ki.
-TREND = TREND ## Lineáris trend értékeit számítja ki.
-TRIMMEAN = RÉSZÁTLAG ## Egy adathalmaz középső részének átlagát számítja ki.
-TTEST = T.PRÓBA ## A Student-féle t-próbához tartozó valószínűséget számítja ki.
-VAR = VAR ## Minta alapján becslést ad a varianciára.
-VARA = VARA ## Minta alapján becslést ad a varianciára (beleértve számokat, szöveget és logikai értékeket).
-VARP = VARP ## Egy statisztikai sokaság varianciáját számítja ki.
-VARPA = VARPA ## Egy statisztikai sokaság varianciáját számítja ki (beleértve számokat, szöveget és logikai értékeket).
-WEIBULL = WEIBULL ## A Weibull-féle eloszlás értékét számítja ki.
-ZTEST = Z.PRÓBA ## Az egyszélű z-próbával kapott valószínűségértéket számítja ki.
-
-
-##
-## Text functions Szövegműveletekhez használható függvények
-##
-ASC = ASC ## Szöveg teljes szélességű (kétbájtos) latin és katakana karaktereit félszélességű (egybájtos) karakterekké alakítja.
-BAHTTEXT = BAHTSZÖVEG ## Számot szöveggé alakít a ß (baht) pénznemformátum használatával.
-CHAR = KARAKTER ## A kódszámmal meghatározott karaktert adja eredményül.
-CLEAN = TISZTÍT ## A szövegből eltávolítja az összes nem nyomtatható karaktert.
-CODE = KÓD ## Karaktersorozat első karakterének numerikus kódját adja eredményül.
-CONCATENATE = ÖSSZEFŰZ ## Több szövegelemet egyetlen szöveges elemmé fűz össze.
-DOLLAR = FORINT ## Számot pénznem formátumú szöveggé alakít át.
-EXACT = AZONOS ## Megvizsgálja, hogy két érték azonos-e.
-FIND = SZÖVEG.TALÁL ## Karaktersorozatot keres egy másikban (a kis- és nagybetűk megkülönböztetésével).
-FINDB = SZÖVEG.TALÁL2 ## Karaktersorozatot keres egy másikban (a kis- és nagybetűk megkülönböztetésével).
-FIXED = FIX ## Számot szöveges formátumúra alakít adott számú tizedesjegyre kerekítve.
-JIS = JIS ## A félszélességű (egybájtos) latin és a katakana karaktereket teljes szélességű (kétbájtos) karakterekké alakítja.
-LEFT = BAL ## Szöveg bal szélső karaktereit adja eredményül.
-LEFTB = BAL2 ## Szöveg bal szélső karaktereit adja eredményül.
-LEN = HOSSZ ## Szöveg karakterekben mért hosszát adja eredményül.
-LENB = HOSSZ2 ## Szöveg karakterekben mért hosszát adja eredményül.
-LOWER = KISBETŰ ## Szöveget kisbetűssé alakít át.
-MID = KÖZÉP ## A szöveg adott pozíciójától kezdve megadott számú karaktert ad vissza eredményként.
-MIDB = KÖZÉP2 ## A szöveg adott pozíciójától kezdve megadott számú karaktert ad vissza eredményként.
-PHONETIC = PHONETIC ## Szöveg furigana (fonetikus) karaktereit adja vissza.
-PROPER = TNÉV ## Szöveg minden szavának kezdőbetűjét nagybetűsre cseréli.
-REPLACE = CSERE ## A szövegen belül karaktereket cserél.
-REPLACEB = CSERE2 ## A szövegen belül karaktereket cserél.
-REPT = SOKSZOR ## Megadott számú alkalommal megismétel egy szövegrészt.
-RIGHT = JOBB ## Szövegrész jobb szélső karaktereit adja eredményül.
-RIGHTB = JOBB2 ## Szövegrész jobb szélső karaktereit adja eredményül.
-SEARCH = SZÖVEG.KERES ## Karaktersorozatot keres egy másikban (a kis- és nagybetűk között nem tesz különbséget).
-SEARCHB = SZÖVEG.KERES2 ## Karaktersorozatot keres egy másikban (a kis- és nagybetűk között nem tesz különbséget).
-SUBSTITUTE = HELYETTE ## Szövegben adott karaktereket másikra cserél.
-T = T ## Argumentumát szöveggé alakítja át.
-TEXT = SZÖVEG ## Számértéket alakít át adott számformátumú szöveggé.
-TRIM = TRIM ## A szövegből eltávolítja a szóközöket.
-UPPER = NAGYBETŰS ## Szöveget nagybetűssé alakít át.
-VALUE = ÉRTÉK ## Szöveget számmá alakít át.
+##
+## PhpSpreadsheet
+##
+## Data in this file derived from https://www.excel-function-translation.com/
+##
+##
+
+
+##
+## Add-in and Automation functions Bővítmények és automatizálási függvények
+##
+GETPIVOTDATA = KIMUTATÁSADATOT.VESZ ## A kimutatásokban tárolt adatok visszaadására használható.
+
+
+##
+## Cube functions Kockafüggvények
+##
+CUBEKPIMEMBER = KOCKA.FŐTELJMUT ## Egy fő teljesítménymutató (KPI) nevét, tulajdonságát és mértékegységét adja eredményül, a nevet és a tulajdonságot megjeleníti a cellában. A KPI-k számszerűsíthető mérési lehetőséget jelentenek – ilyen mutató például a havi bruttó nyereség vagy az egy alkalmazottra jutó negyedéves forgalom –, egy szervezet teljesítményének nyomonkövetésére használhatók.
+CUBEMEMBER = KOCKA.TAG ## Kockahierachia tagját vagy rekordját adja eredményül. Ellenőrizhető vele, hogy szerepel-e a kockában az adott tag vagy rekord.
+CUBEMEMBERPROPERTY = KOCKA.TAG.TUL ## A kocka egyik tagtulajdonságának értékét adja eredményül. Használatával ellenőrizhető, hogy szerepel-e egy tagnév a kockában, eredménye pedig az erre a tagra vonatkozó, megadott tulajdonság.
+CUBERANKEDMEMBER = KOCKA.HALM.ELEM ## Egy halmaz rangsor szerinti n-edik tagját adja eredményül. Használatával egy halmaz egy vagy több elemét kaphatja meg, például a legnagyobb teljesítményű üzletkötőt vagy a 10 legjobb tanulót.
+CUBESET = KOCKA.HALM ## Számított tagok vagy rekordok halmazát adja eredményül, ehhez egy beállított kifejezést elküld a kiszolgálón található kockának, majd ezt a halmazt adja vissza a Microsoft Office Excel alkalmazásnak.
+CUBESETCOUNT = KOCKA.HALM.DB ## Egy halmaz elemszámát adja eredményül.
+CUBEVALUE = KOCKA.ÉRTÉK ## Kockából összesített értéket ad eredményül.
+
+
+##
+## Database functions Adatbázis-kezelő függvények
+##
+DAVERAGE = AB.ÁTLAG ## A kijelölt adatbáziselemek átlagát számítja ki.
+DCOUNT = AB.DARAB ## Megszámolja, hogy az adatbázisban hány cella tartalmaz számokat.
+DCOUNTA = AB.DARAB2 ## Megszámolja az adatbázisban lévő nem üres cellákat.
+DGET = AB.MEZŐ ## Egy adatbázisból egyetlen olyan rekordot ad vissza, amely megfelel a megadott feltételeknek.
+DMAX = AB.MAX ## A kiválasztott adatbáziselemek közül a legnagyobb értéket adja eredményül.
+DMIN = AB.MIN ## A kijelölt adatbáziselemek közül a legkisebb értéket adja eredményül.
+DPRODUCT = AB.SZORZAT ## Az adatbázis megadott feltételeknek eleget tevő rekordjaira összeszorozza a megadott mezőben található számértékeket, és eredményül ezt a szorzatot adja.
+DSTDEV = AB.SZÓRÁS ## A kijelölt adatbáziselemek egy mintája alapján megbecsüli a szórást.
+DSTDEVP = AB.SZÓRÁS2 ## A kijelölt adatbáziselemek teljes sokasága alapján kiszámítja a szórást.
+DSUM = AB.SZUM ## Összeadja a feltételnek megfelelő adatbázisrekordok mezőoszlopában a számokat.
+DVAR = AB.VAR ## A kijelölt adatbáziselemek mintája alapján becslést ad a szórásnégyzetre.
+DVARP = AB.VAR2 ## A kijelölt adatbáziselemek teljes sokasága alapján kiszámítja a szórásnégyzetet.
+
+
+##
+## Date and time functions Dátumfüggvények
+##
+DATE = DÁTUM ## Adott dátum dátumértékét adja eredményül.
+DATEVALUE = DÁTUMÉRTÉK ## Szövegként megadott dátumot dátumértékké alakít át.
+DAY = NAP ## Dátumértéket a hónap egy napjává (0-31) alakít.
+DAYS360 = NAP360 ## Két dátum közé eső napok számát számítja ki a 360 napos év alapján.
+EDATE = EDATE ## Adott dátumnál adott számú hónappal korábbi vagy későbbi dátum dátumértékét adja eredményül.
+EOMONTH = EOMONTH ## Adott dátumnál adott számú hónappal korábbi vagy későbbi hónap utolsó napjának dátumértékét adja eredményül.
+HOUR = ÓRA ## Időértéket órákká alakít.
+MINUTE = PERC ## Időértéket percekké alakít.
+MONTH = HÓNAP ## Időértéket hónapokká alakít.
+NETWORKDAYS = NETWORKDAYS ## Két dátum között a teljes munkanapok számát adja meg.
+NOW = MOST ## A napi dátum dátumértékét és a pontos idő időértékét adja eredményül.
+SECOND = MPERC ## Időértéket másodpercekké alakít át.
+TIME = IDŐ ## Adott időpont időértékét adja meg.
+TIMEVALUE = IDŐÉRTÉK ## Szövegként megadott időpontot időértékké alakít át.
+TODAY = MA ## A napi dátum dátumértékét adja eredményül.
+WEEKDAY = HÉT.NAPJA ## Dátumértéket a hét napjává alakítja át.
+WEEKNUM = WEEKNUM ## Visszatérési értéke egy szám, amely azt mutatja meg, hogy a megadott dátum az év hányadik hetére esik.
+WORKDAY = WORKDAY ## Adott dátumnál adott munkanappal korábbi vagy későbbi dátum dátumértékét adja eredményül.
+YEAR = ÉV ## Sorszámot évvé alakít át.
+YEARFRAC = YEARFRAC ## Az adott dátumok közötti teljes napok számát törtévként adja meg.
+
+
+##
+## Engineering functions Mérnöki függvények
+##
+BESSELI = BESSELI ## Az In(x) módosított Bessel-függvény értékét adja eredményül.
+BESSELJ = BESSELJ ## A Jn(x) Bessel-függvény értékét adja eredményül.
+BESSELK = BESSELK ## A Kn(x) módosított Bessel-függvény értékét adja eredményül.
+BESSELY = BESSELY ## Az Yn(x) módosított Bessel-függvény értékét adja eredményül.
+BIN2DEC = BIN2DEC ## Bináris számot decimálissá alakít át.
+BIN2HEX = BIN2HEX ## Bináris számot hexadecimálissá alakít át.
+BIN2OCT = BIN2OCT ## Bináris számot oktálissá alakít át.
+COMPLEX = COMPLEX ## Valós és képzetes részből komplex számot képez.
+CONVERT = CONVERT ## Mértékegységeket vált át.
+DEC2BIN = DEC2BIN ## Decimális számot binárissá alakít át.
+DEC2HEX = DEC2HEX ## Decimális számot hexadecimálissá alakít át.
+DEC2OCT = DEC2OCT ## Decimális számot oktálissá alakít át.
+DELTA = DELTA ## Azt vizsgálja, hogy két érték egyenlő-e.
+ERF = ERF ## A hibafüggvény értékét adja eredményül.
+ERFC = ERFC ## A kiegészített hibafüggvény értékét adja eredményül.
+GESTEP = GESTEP ## Azt vizsgálja, hogy egy szám nagyobb-e adott küszöbértéknél.
+HEX2BIN = HEX2BIN ## Hexadecimális számot binárissá alakít át.
+HEX2DEC = HEX2DEC ## Hexadecimális számot decimálissá alakít át.
+HEX2OCT = HEX2OCT ## Hexadecimális számot oktálissá alakít át.
+IMABS = IMABS ## Komplex szám abszolút értékét (modulusát) adja eredményül.
+IMAGINARY = IMAGINARY ## Komplex szám képzetes részét adja eredményül.
+IMARGUMENT = IMARGUMENT ## A komplex szám radiánban kifejezett théta argumentumát adja eredményül.
+IMCONJUGATE = IMCONJUGATE ## Komplex szám komplex konjugáltját adja eredményül.
+IMCOS = IMCOS ## Komplex szám koszinuszát adja eredményül.
+IMDIV = IMDIV ## Két komplex szám hányadosát adja eredményül.
+IMEXP = IMEXP ## Az e szám komplex kitevőjű hatványát adja eredményül.
+IMLN = IMLN ## Komplex szám természetes logaritmusát adja eredményül.
+IMLOG10 = IMLOG10 ## Komplex szám tízes alapú logaritmusát adja eredményül.
+IMLOG2 = IMLOG2 ## Komplex szám kettes alapú logaritmusát adja eredményül.
+IMPOWER = IMPOWER ## Komplex szám hatványát adja eredményül.
+IMPRODUCT = IMPRODUCT ## Komplex számok szorzatát adja eredményül.
+IMREAL = IMREAL ## Komplex szám valós részét adja eredményül.
+IMSIN = IMSIN ## Komplex szám szinuszát adja eredményül.
+IMSQRT = IMSQRT ## Komplex szám négyzetgyökét adja eredményül.
+IMSUB = IMSUB ## Két komplex szám különbségét adja eredményül.
+IMSUM = IMSUM ## Komplex számok összegét adja eredményül.
+OCT2BIN = OCT2BIN ## Oktális számot binárissá alakít át.
+OCT2DEC = OCT2DEC ## Oktális számot decimálissá alakít át.
+OCT2HEX = OCT2HEX ## Oktális számot hexadecimálissá alakít át.
+
+
+##
+## Financial functions Pénzügyi függvények
+##
+ACCRINT = ACCRINT ## Periodikusan kamatozó értékpapír felszaporodott kamatát adja eredményül.
+ACCRINTM = ACCRINTM ## Lejáratkor kamatozó értékpapír felszaporodott kamatát adja eredményül.
+AMORDEGRC = AMORDEGRC ## Állóeszköz lineáris értékcsökkenését adja meg az egyes könyvelési időszakokra vonatkozóan.
+AMORLINC = AMORLINC ## Az egyes könyvelési időszakokban az értékcsökkenést adja meg.
+COUPDAYBS = COUPDAYBS ## A szelvényidőszak kezdetétől a kifizetés időpontjáig eltelt napokat adja vissza.
+COUPDAYS = COUPDAYS ## A kifizetés időpontját magában foglaló szelvényperiódus hosszát adja meg napokban.
+COUPDAYSNC = COUPDAYSNC ## A kifizetés időpontja és a legközelebbi szelvénydátum közötti napok számát adja meg.
+COUPNCD = COUPNCD ## A kifizetést követő legelső szelvénydátumot adja eredményül.
+COUPNUM = COUPNUM ## A kifizetés és a lejárat időpontja között kifizetendő szelvények számát adja eredményül.
+COUPPCD = COUPPCD ## A kifizetés előtti utolsó szelvénydátumot adja eredményül.
+CUMIPMT = CUMIPMT ## Két fizetési időszak között kifizetett kamat halmozott értékét adja eredményül.
+CUMPRINC = CUMPRINC ## Két fizetési időszak között kifizetett részletek halmozott (kamatot nem tartalmazó) értékét adja eredményül.
+DB = KCS2 ## Eszköz adott időszak alatti értékcsökkenését számítja ki a lineáris leírási modell alkalmazásával.
+DDB = KCSA ## Eszköz értékcsökkenését számítja ki adott időszakra vonatkozóan a progresszív vagy egyéb megadott leírási modell alkalmazásával.
+DISC = DISC ## Értékpapír leszámítolási kamatlábát adja eredményül.
+DOLLARDE = DOLLARDE ## Egy közönséges törtként megadott számot tizedes törtté alakít át.
+DOLLARFR = DOLLARFR ## Tizedes törtként megadott számot közönséges törtté alakít át.
+DURATION = DURATION ## Periodikus kamatfizetésű értékpapír éves kamatérzékenységét adja eredményül.
+EFFECT = EFFECT ## Az éves tényleges kamatláb értékét adja eredményül.
+FV = JBÉ ## Befektetés jövőbeli értékét számítja ki.
+FVSCHEDULE = FVSCHEDULE ## A kezdőtőke adott kamatlábak szerint megnövelt jövőbeli értékét adja eredményül.
+INTRATE = INTRATE ## A lejáratig teljesen lekötött értékpapír kamatrátáját adja eredményül.
+IPMT = RRÉSZLET ## Hiteltörlesztésen belül a tőketörlesztés nagyságát számítja ki adott időszakra.
+IRR = BMR ## A befektetés belső megtérülési rátáját számítja ki pénzáramláshoz.
+ISPMT = LRÉSZLETKAMAT ## A befektetés adott időszakára fizetett kamatot számítja ki.
+MDURATION = MDURATION ## Egy 100 Ft névértékű értékpapír Macauley-féle módosított kamatérzékenységét adja eredményül.
+MIRR = MEGTÉRÜLÉS ## A befektetés belső megtérülési rátáját számítja ki a költségek és a bevételek különböző kamatlába mellett.
+NOMINAL = NOMINAL ## Az éves névleges kamatláb értékét adja eredményül.
+NPER = PER.SZÁM ## A törlesztési időszakok számát adja meg.
+NPV = NMÉ ## Befektetéshez kapcsolódó pénzáramlás nettó jelenértékét számítja ki ismert pénzáramlás és kamatláb mellett.
+ODDFPRICE = ODDFPRICE ## Egy 100 Ft névértékű, a futamidő elején töredék-időszakos értékpapír árát adja eredményül.
+ODDFYIELD = ODDFYIELD ## A futamidő elején töredék-időszakos értékpapír hozamát adja eredményül.
+ODDLPRICE = ODDLPRICE ## Egy 100 Ft névértékű, a futamidő végén töredék-időszakos értékpapír árát adja eredményül.
+ODDLYIELD = ODDLYIELD ## A futamidő végén töredék-időszakos értékpapír hozamát adja eredményül.
+PMT = RÉSZLET ## A törlesztési időszakra vonatkozó törlesztési összeget számítja ki.
+PPMT = PRÉSZLET ## Hiteltörlesztésen belül a tőketörlesztés nagyságát számítja ki adott időszakra.
+PRICE = PRICE ## Egy 100 Ft névértékű, periodikusan kamatozó értékpapír árát adja eredményül.
+PRICEDISC = PRICEDISC ## Egy 100 Ft névértékű leszámítolt értékpapír árát adja eredményül.
+PRICEMAT = PRICEMAT ## Egy 100 Ft névértékű, a lejáratkor kamatozó értékpapír árát adja eredményül.
+PV = MÉ ## Befektetés jelenlegi értékét számítja ki.
+RATE = RÁTA ## Egy törlesztési időszakban az egy időszakra eső kamatláb nagyságát számítja ki.
+RECEIVED = RECEIVED ## A lejáratig teljesen lekötött értékpapír lejáratakor kapott összegét adja eredményül.
+SLN = LCSA ## Tárgyi eszköz egy időszakra eső amortizációját adja meg bruttó érték szerinti lineáris leírási kulcsot alkalmazva.
+SYD = SYD ## Tárgyi eszköz értékcsökkenését számítja ki adott időszakra az évek számjegyösszegével dolgozó módszer alapján.
+TBILLEQ = TBILLEQ ## Kincstárjegy kötvény-egyenértékű hozamát adja eredményül.
+TBILLPRICE = TBILLPRICE ## Egy 100 Ft névértékű kincstárjegy árát adja eredményül.
+TBILLYIELD = TBILLYIELD ## Kincstárjegy hozamát adja eredményül.
+VDB = ÉCSRI ## Tárgyi eszköz amortizációját számítja ki megadott vagy részidőszakra a csökkenő egyenleg módszerének alkalmazásával.
+XIRR = XIRR ## Ütemezett készpénzforgalom (cash flow) belső megtérülési kamatrátáját adja eredményül.
+XNPV = XNPV ## Ütemezett készpénzforgalom (cash flow) nettó jelenlegi értékét adja eredményül.
+YIELD = YIELD ## Periodikusan kamatozó értékpapír hozamát adja eredményül.
+YIELDDISC = YIELDDISC ## Leszámítolt értékpapír (például kincstárjegy) éves hozamát adja eredményül.
+YIELDMAT = YIELDMAT ## Lejáratkor kamatozó értékpapír éves hozamát adja eredményül.
+
+
+##
+## Information functions Információs függvények
+##
+CELL = CELLA ## Egy cella formátumára, elhelyezkedésére vagy tartalmára vonatkozó adatokat ad eredményül.
+ERROR.TYPE = HIBA.TÍPUS ## Egy hibatípushoz tartozó számot ad eredményül.
+INFO = INFÓ ## A rendszer- és munkakörnyezet pillanatnyi állapotáról ad felvilágosítást.
+ISBLANK = ÜRES ## Eredménye IGAZ, ha az érték üres.
+ISERR = HIBA ## Eredménye IGAZ, ha az érték valamelyik hibaérték a #HIÁNYZIK kivételével.
+ISERROR = HIBÁS ## Eredménye IGAZ, ha az érték valamelyik hibaérték.
+ISEVEN = ISEVEN ## Eredménye IGAZ, ha argumentuma páros szám.
+ISLOGICAL = LOGIKAI ## Eredménye IGAZ, ha az érték logikai érték.
+ISNA = NINCS ## Eredménye IGAZ, ha az érték a #HIÁNYZIK hibaérték.
+ISNONTEXT = NEM.SZÖVEG ## Eredménye IGAZ, ha az érték nem szöveg.
+ISNUMBER = SZÁM ## Eredménye IGAZ, ha az érték szám.
+ISODD = ISODD ## Eredménye IGAZ, ha argumentuma páratlan szám.
+ISREF = HIVATKOZÁS ## Eredménye IGAZ, ha az érték hivatkozás.
+ISTEXT = SZÖVEG.E ## Eredménye IGAZ, ha az érték szöveg.
+N = N ## Argumentumának értékét számmá alakítja.
+NA = HIÁNYZIK ## Eredménye a #HIÁNYZIK hibaérték.
+TYPE = TÍPUS ## Érték adattípusának azonosítószámát adja eredményül.
+
+
+##
+## Logical functions Logikai függvények
+##
+AND = ÉS ## Eredménye IGAZ, ha minden argumentuma IGAZ.
+FALSE = HAMIS ## A HAMIS logikai értéket adja eredményül.
+IF = HA ## Logikai vizsgálatot hajt végre.
+IFERROR = HAHIBA ## A megadott értéket adja vissza, ha egy képlet hibához vezet; más esetben a képlet értékét adja eredményül.
+NOT = NEM ## Argumentuma értékének ellentettjét adja eredményül.
+OR = VAGY ## Eredménye IGAZ, ha bármely argumentuma IGAZ.
+TRUE = IGAZ ## Az IGAZ logikai értéket adja eredményül.
+
+
+##
+## Lookup and reference functions Keresési és hivatkozási függvények
+##
+ADDRESS = CÍM ## A munkalap egy cellájára való hivatkozást adja szövegként eredményül.
+AREAS = TERÜLET ## Hivatkozásban a területek számát adja eredményül.
+CHOOSE = VÁLASZT ## Értékek listájából választ ki egy elemet.
+COLUMN = OSZLOP ## Egy hivatkozás oszlopszámát adja eredményül.
+COLUMNS = OSZLOPOK ## A hivatkozásban található oszlopok számát adja eredményül.
+HLOOKUP = VKERES ## A megadott tömb felső sorában adott értékű elemet keres, és a megtalált elem oszlopából adott sorban elhelyezkedő értékkel tér vissza.
+HYPERLINK = HIPERHIVATKOZÁS ## Hálózati kiszolgálón, intraneten vagy az interneten tárolt dokumentumot megnyitó parancsikont vagy hivatkozást hoz létre.
+INDEX = INDEX ## Tömb- vagy hivatkozás indexszel megadott értékét adja vissza.
+INDIRECT = INDIREKT ## Szöveg megadott hivatkozást ad eredményül.
+LOOKUP = KERES ## Vektorban vagy tömbben keres meg értékeket.
+MATCH = HOL.VAN ## Hivatkozásban vagy tömbben értékeket keres.
+OFFSET = OFSZET ## Hivatkozás egy másik hivatkozástól számított távolságát adja meg.
+ROW = SOR ## Egy hivatkozás sorának számát adja meg.
+ROWS = SOROK ## Egy hivatkozás sorainak számát adja meg.
+RTD = RTD ## Valós idejű adatokat keres vissza a COM automatizmust (automatizálás: Egy alkalmazás objektumaival való munka másik alkalmazásból vagy fejlesztőeszközből. A korábban OLE automatizmusnak nevezett automatizálás iparági szabvány, a Component Object Model (COM) szolgáltatása.) támogató programból.
+TRANSPOSE = TRANSZPONÁLÁS ## Egy tömb transzponáltját adja eredményül.
+VLOOKUP = FKERES ## A megadott tömb bal szélső oszlopában megkeres egy értéket, majd annak sora és a megadott oszlop metszéspontjában levő értéked adja eredményül.
+
+
+##
+## Math and trigonometry functions Matematikai és trigonometrikus függvények
+##
+ABS = ABS ## Egy szám abszolút értékét adja eredményül.
+ACOS = ARCCOS ## Egy szám arkusz koszinuszát számítja ki.
+ACOSH = ACOSH ## Egy szám inverz koszinusz hiperbolikuszát számítja ki.
+ASIN = ARCSIN ## Egy szám arkusz szinuszát számítja ki.
+ASINH = ASINH ## Egy szám inverz szinusz hiperbolikuszát számítja ki.
+ATAN = ARCTAN ## Egy szám arkusz tangensét számítja ki.
+ATAN2 = ARCTAN2 ## X és y koordináták alapján számítja ki az arkusz tangens értéket.
+ATANH = ATANH ## A szám inverz tangens hiperbolikuszát számítja ki.
+CEILING = PLAFON ## Egy számot a legközelebbi egészre vagy a pontosságként megadott érték legközelebb eső többszörösére kerekít.
+COMBIN = KOMBINÁCIÓK ## Adott számú objektum összes lehetséges kombinációinak számát számítja ki.
+COS = COS ## Egy szám koszinuszát számítja ki.
+COSH = COSH ## Egy szám koszinusz hiperbolikuszát számítja ki.
+DEGREES = FOK ## Radiánt fokká alakít át.
+EVEN = PÁROS ## Egy számot a legközelebbi páros egész számra kerekít.
+EXP = KITEVŐ ## Az e adott kitevőjű hatványát adja eredményül.
+FACT = FAKT ## Egy szám faktoriálisát számítja ki.
+FACTDOUBLE = FACTDOUBLE ## Egy szám dupla faktoriálisát adja eredményül.
+FLOOR = PADLÓ ## Egy számot lefelé, a nulla felé kerekít.
+GCD = GCD ## A legnagyobb közös osztót adja eredményül.
+INT = INT ## Egy számot lefelé kerekít a legközelebbi egészre.
+LCM = LCM ## A legkisebb közös többszöröst adja eredményül.
+LN = LN ## Egy szám természetes logaritmusát számítja ki.
+LOG = LOG ## Egy szám adott alapú logaritmusát számítja ki.
+LOG10 = LOG10 ## Egy szám 10-es alapú logaritmusát számítja ki.
+MDETERM = MDETERM ## Egy tömb mátrix-determinánsát számítja ki.
+MINVERSE = INVERZ.MÁTRIX ## Egy tömb mátrix inverzét adja eredményül.
+MMULT = MSZORZAT ## Két tömb mátrix-szorzatát adja meg.
+MOD = MARADÉK ## Egy szám osztási maradékát adja eredményül.
+MROUND = MROUND ## A kívánt többszörösére kerekített értéket ad eredményül.
+MULTINOMIAL = MULTINOMIAL ## Számhalmaz multinomiálisát adja eredményül.
+ODD = PÁRATLAN ## Egy számot a legközelebbi páratlan számra kerekít.
+PI = PI ## A pi matematikai állandót adja vissza.
+POWER = HATVÁNY ## Egy szám adott kitevőjű hatványát számítja ki.
+PRODUCT = SZORZAT ## Argumentumai szorzatát számítja ki.
+QUOTIENT = QUOTIENT ## Egy hányados egész részét adja eredményül.
+RADIANS = RADIÁN ## Fokot radiánná alakít át.
+RAND = VÉL ## Egy 0 és 1 közötti véletlen számot ad eredményül.
+RANDBETWEEN = RANDBETWEEN ## Megadott számok közé eső véletlen számot állít elő.
+ROMAN = RÓMAI ## Egy számot római számokkal kifejezve szövegként ad eredményül.
+ROUND = KEREKÍTÉS ## Egy számot adott számú számjegyre kerekít.
+ROUNDDOWN = KEREKÍTÉS.LE ## Egy számot lefelé, a nulla felé kerekít.
+ROUNDUP = KEREKÍTÉS.FEL ## Egy számot felfelé, a nullától távolabbra kerekít.
+SERIESSUM = SERIESSUM ## Hatványsor összegét adja eredményül.
+SIGN = ELŐJEL ## Egy szám előjelét adja meg.
+SIN = SIN ## Egy szög szinuszát számítja ki.
+SINH = SINH ## Egy szám szinusz hiperbolikuszát számítja ki.
+SQRT = GYÖK ## Egy szám pozitív négyzetgyökét számítja ki.
+SQRTPI = SQRTPI ## A (szám*pi) négyzetgyökét adja eredményül.
+SUBTOTAL = RÉSZÖSSZEG ## Lista vagy adatbázis részösszegét adja eredményül.
+SUM = SZUM ## Összeadja az argumentumlistájában lévő számokat.
+SUMIF = SZUMHA ## A megadott feltételeknek eleget tevő cellákban található értékeket adja össze.
+SUMIFS = SZUMHATÖBB ## Több megadott feltételnek eleget tévő tartománycellák összegét adja eredményül.
+SUMPRODUCT = SZORZATÖSSZEG ## A megfelelő tömbelemek szorzatának összegét számítja ki.
+SUMSQ = NÉGYZETÖSSZEG ## Argumentumai négyzetének összegét számítja ki.
+SUMX2MY2 = SZUMX2BŐLY2 ## Két tömb megfelelő elemei négyzetének különbségét összegzi.
+SUMX2PY2 = SZUMX2MEGY2 ## Két tömb megfelelő elemei négyzetének összegét összegzi.
+SUMXMY2 = SZUMXBŐLY2 ## Két tömb megfelelő elemei különbségének négyzetösszegét számítja ki.
+TAN = TAN ## Egy szám tangensét számítja ki.
+TANH = TANH ## Egy szám tangens hiperbolikuszát számítja ki.
+TRUNC = CSONK ## Egy számot egésszé csonkít.
+
+
+##
+## Statistical functions Statisztikai függvények
+##
+AVEDEV = ÁTL.ELTÉRÉS ## Az adatpontoknak átlaguktól való átlagos abszolút eltérését számítja ki.
+AVERAGE = ÁTLAG ## Argumentumai átlagát számítja ki.
+AVERAGEA = ÁTLAGA ## Argumentumai átlagát számítja ki (beleértve a számokat, szöveget és logikai értékeket).
+AVERAGEIF = ÁTLAGHA ## A megadott feltételnek eleget tévő tartomány celláinak átlagát (számtani közepét) adja eredményül.
+AVERAGEIFS = ÁTLAGHATÖBB ## A megadott feltételeknek eleget tévő cellák átlagát (számtani közepét) adja eredményül.
+BETADIST = BÉTA.ELOSZLÁS ## A béta-eloszlás függvényt számítja ki.
+BETAINV = INVERZ.BÉTA ## Adott béta-eloszláshoz kiszámítja a béta eloszlásfüggvény inverzét.
+BINOMDIST = BINOM.ELOSZLÁS ## A diszkrét binomiális eloszlás valószínűségértékét számítja ki.
+CHIDIST = KHI.ELOSZLÁS ## A khi-négyzet-eloszlás egyszélű valószínűségértékét számítja ki.
+CHIINV = INVERZ.KHI ## A khi-négyzet-eloszlás egyszélű valószínűségértékének inverzét számítja ki.
+CHITEST = KHI.PRÓBA ## Függetlenségvizsgálatot hajt végre.
+CONFIDENCE = MEGBÍZHATÓSÁG ## Egy statisztikai sokaság várható értékének megbízhatósági intervallumát adja eredményül.
+CORREL = KORREL ## Két adathalmaz korrelációs együtthatóját számítja ki.
+COUNT = DARAB ## Megszámolja, hogy argumentumlistájában hány szám található.
+COUNTA = DARAB2 ## Megszámolja, hogy argumentumlistájában hány érték található.
+COUNTBLANK = DARABÜRES ## Egy tartományban összeszámolja az üres cellákat.
+COUNTIF = DARABTELI ## Egy tartományban összeszámolja azokat a cellákat, amelyek eleget tesznek a megadott feltételnek.
+COUNTIFS = DARABHATÖBB ## Egy tartományban összeszámolja azokat a cellákat, amelyek eleget tesznek több feltételnek.
+COVAR = KOVAR ## A kovarianciát, azaz a páronkénti eltérések szorzatának átlagát számítja ki.
+CRITBINOM = KRITBINOM ## Azt a legkisebb számot adja eredményül, amelyre a binomiális eloszlásfüggvény értéke nem kisebb egy adott határértéknél.
+DEVSQ = SQ ## Az átlagtól való eltérések négyzetének összegét számítja ki.
+EXPONDIST = EXP.ELOSZLÁS ## Az exponenciális eloszlás értékét számítja ki.
+FDIST = F.ELOSZLÁS ## Az F-eloszlás értékét számítja ki.
+FINV = INVERZ.F ## Az F-eloszlás inverzének értékét számítja ki.
+FISHER = FISHER ## Fisher-transzformációt hajt végre.
+FISHERINV = INVERZ.FISHER ## A Fisher-transzformáció inverzét hajtja végre.
+FORECAST = ELŐREJELZÉS ## Az ismert értékek alapján lineáris regresszióval becsült értéket ad eredményül.
+FREQUENCY = GYAKORISÁG ## A gyakorisági vagy empirikus eloszlás értékét függőleges tömbként adja eredményül.
+FTEST = F.PRÓBA ## Az F-próba értékét adja eredményül.
+GAMMADIST = GAMMA.ELOSZLÁS ## A gamma-eloszlás értékét számítja ki.
+GAMMAINV = INVERZ.GAMMA ## A gamma-eloszlás eloszlásfüggvénye inverzének értékét számítja ki.
+GAMMALN = GAMMALN ## A gamma-függvény természetes logaritmusát számítja ki.
+GEOMEAN = MÉRTANI.KÖZÉP ## Argumentumai mértani középértékét számítja ki.
+GROWTH = NÖV ## Exponenciális regresszió alapján ad becslést.
+HARMEAN = HARM.KÖZÉP ## Argumentumai harmonikus átlagát számítja ki.
+HYPGEOMDIST = HIPERGEOM.ELOSZLÁS ## A hipergeometriai eloszlás értékét számítja ki.
+INTERCEPT = METSZ ## A regressziós egyenes y tengellyel való metszéspontját határozza meg.
+KURT = CSÚCSOSSÁG ## Egy adathalmaz csúcsosságát számítja ki.
+LARGE = NAGY ## Egy adathalmaz k-adik legnagyobb elemét adja eredményül.
+LINEST = LIN.ILL ## A legkisebb négyzetek módszerével az adatokra illesztett egyenes paramétereit határozza meg.
+LOGEST = LOG.ILL ## Az adatokra illesztett exponenciális görbe paramétereit határozza meg.
+LOGINV = INVERZ.LOG.ELOSZLÁS ## A lognormális eloszlás inverzét számítja ki.
+LOGNORMDIST = LOG.ELOSZLÁS ## A lognormális eloszlásfüggvény értékét számítja ki.
+MAX = MAX ## Az argumentumai között szereplő legnagyobb számot adja meg.
+MAXA = MAX2 ## Az argumentumai között szereplő legnagyobb számot adja meg (beleértve a számokat, szöveget és logikai értékeket).
+MEDIAN = MEDIÁN ## Adott számhalmaz mediánját számítja ki.
+MIN = MIN ## Az argumentumai között szereplő legkisebb számot adja meg.
+MINA = MIN2 ## Az argumentumai között szereplő legkisebb számot adja meg, beleértve a számokat, szöveget és logikai értékeket.
+MODE = MÓDUSZ ## Egy adathalmazból kiválasztja a leggyakrabban előforduló számot.
+NEGBINOMDIST = NEGBINOM.ELOSZL ## A negatív binomiális eloszlás értékét számítja ki.
+NORMDIST = NORM.ELOSZL ## A normális eloszlás értékét számítja ki.
+NORMINV = INVERZ.NORM ## A normális eloszlás eloszlásfüggvénye inverzének értékét számítja ki.
+NORMSDIST = STNORMELOSZL ## A standard normális eloszlás eloszlásfüggvényének értékét számítja ki.
+NORMSINV = INVERZ.STNORM ## A standard normális eloszlás eloszlásfüggvénye inverzének értékét számítja ki.
+PEARSON = PEARSON ## A Pearson-féle korrelációs együtthatót számítja ki.
+PERCENTILE = PERCENTILIS ## Egy tartományban található értékek k-adik percentilisét, azaz százalékosztályát adja eredményül.
+PERCENTRANK = SZÁZALÉKRANG ## Egy értéknek egy adathalmazon belül vett százalékos rangját (elhelyezkedését) számítja ki.
+PERMUT = VARIÁCIÓK ## Adott számú objektum k-ad osztályú ismétlés nélküli variációinak számát számítja ki.
+POISSON = POISSON ## A Poisson-eloszlás értékét számítja ki.
+PROB = VALÓSZÍNŰSÉG ## Annak valószínűségét számítja ki, hogy adott értékek két határérték közé esnek.
+QUARTILE = KVARTILIS ## Egy adathalmaz kvartilisét (negyedszintjét) számítja ki.
+RANK = SORSZÁM ## Kiszámítja, hogy egy szám hányadik egy számsorozatban.
+RSQ = RNÉGYZET ## Kiszámítja a Pearson-féle szorzatmomentum korrelációs együtthatójának négyzetét.
+SKEW = FERDESÉG ## Egy eloszlás ferdeségét határozza meg.
+SLOPE = MEREDEKSÉG ## Egy lineáris regressziós egyenes meredekségét számítja ki.
+SMALL = KICSI ## Egy adathalmaz k-adik legkisebb elemét adja meg.
+STANDARDIZE = NORMALIZÁLÁS ## Normalizált értéket ad eredményül.
+STDEV = SZÓRÁS ## Egy statisztikai sokaság mintájából kiszámítja annak szórását.
+STDEVA = SZÓRÁSA ## Egy statisztikai sokaság mintájából kiszámítja annak szórását (beleértve a számokat, szöveget és logikai értékeket).
+STDEVP = SZÓRÁSP ## Egy statisztikai sokaság egészéből kiszámítja annak szórását.
+STDEVPA = SZÓRÁSPA ## Egy statisztikai sokaság egészéből kiszámítja annak szórását (beleértve számokat, szöveget és logikai értékeket).
+STEYX = STHIBAYX ## Egy regresszió esetén az egyes x-értékek alapján meghatározott y-értékek standard hibáját számítja ki.
+TDIST = T.ELOSZLÁS ## A Student-féle t-eloszlás értékét számítja ki.
+TINV = INVERZ.T ## A Student-féle t-eloszlás inverzét számítja ki.
+TREND = TREND ## Lineáris trend értékeit számítja ki.
+TRIMMEAN = RÉSZÁTLAG ## Egy adathalmaz középső részének átlagát számítja ki.
+TTEST = T.PRÓBA ## A Student-féle t-próbához tartozó valószínűséget számítja ki.
+VAR = VAR ## Minta alapján becslést ad a varianciára.
+VARA = VARA ## Minta alapján becslést ad a varianciára (beleértve számokat, szöveget és logikai értékeket).
+VARP = VARP ## Egy statisztikai sokaság varianciáját számítja ki.
+VARPA = VARPA ## Egy statisztikai sokaság varianciáját számítja ki (beleértve számokat, szöveget és logikai értékeket).
+WEIBULL = WEIBULL ## A Weibull-féle eloszlás értékét számítja ki.
+ZTEST = Z.PRÓBA ## Az egyszélű z-próbával kapott valószínűségértéket számítja ki.
+
+
+##
+## Text functions Szövegműveletekhez használható függvények
+##
+ASC = ASC ## Szöveg teljes szélességű (kétbájtos) latin és katakana karaktereit félszélességű (egybájtos) karakterekké alakítja.
+BAHTTEXT = BAHTSZÖVEG ## Számot szöveggé alakít a ß (baht) pénznemformátum használatával.
+CHAR = KARAKTER ## A kódszámmal meghatározott karaktert adja eredményül.
+CLEAN = TISZTÍT ## A szövegből eltávolítja az összes nem nyomtatható karaktert.
+CODE = KÓD ## Karaktersorozat első karakterének numerikus kódját adja eredményül.
+CONCATENATE = ÖSSZEFŰZ ## Több szövegelemet egyetlen szöveges elemmé fűz össze.
+DOLLAR = FORINT ## Számot pénznem formátumú szöveggé alakít át.
+EXACT = AZONOS ## Megvizsgálja, hogy két érték azonos-e.
+FIND = SZÖVEG.TALÁL ## Karaktersorozatot keres egy másikban (a kis- és nagybetűk megkülönböztetésével).
+FINDB = SZÖVEG.TALÁL2 ## Karaktersorozatot keres egy másikban (a kis- és nagybetűk megkülönböztetésével).
+FIXED = FIX ## Számot szöveges formátumúra alakít adott számú tizedesjegyre kerekítve.
+JIS = JIS ## A félszélességű (egybájtos) latin és a katakana karaktereket teljes szélességű (kétbájtos) karakterekké alakítja.
+LEFT = BAL ## Szöveg bal szélső karaktereit adja eredményül.
+LEFTB = BAL2 ## Szöveg bal szélső karaktereit adja eredményül.
+LEN = HOSSZ ## Szöveg karakterekben mért hosszát adja eredményül.
+LENB = HOSSZ2 ## Szöveg karakterekben mért hosszát adja eredményül.
+LOWER = KISBETŰ ## Szöveget kisbetűssé alakít át.
+MID = KÖZÉP ## A szöveg adott pozíciójától kezdve megadott számú karaktert ad vissza eredményként.
+MIDB = KÖZÉP2 ## A szöveg adott pozíciójától kezdve megadott számú karaktert ad vissza eredményként.
+PHONETIC = PHONETIC ## Szöveg furigana (fonetikus) karaktereit adja vissza.
+PROPER = TNÉV ## Szöveg minden szavának kezdőbetűjét nagybetűsre cseréli.
+REPLACE = CSERE ## A szövegen belül karaktereket cserél.
+REPLACEB = CSERE2 ## A szövegen belül karaktereket cserél.
+REPT = SOKSZOR ## Megadott számú alkalommal megismétel egy szövegrészt.
+RIGHT = JOBB ## Szövegrész jobb szélső karaktereit adja eredményül.
+RIGHTB = JOBB2 ## Szövegrész jobb szélső karaktereit adja eredményül.
+SEARCH = SZÖVEG.KERES ## Karaktersorozatot keres egy másikban (a kis- és nagybetűk között nem tesz különbséget).
+SEARCHB = SZÖVEG.KERES2 ## Karaktersorozatot keres egy másikban (a kis- és nagybetűk között nem tesz különbséget).
+SUBSTITUTE = HELYETTE ## Szövegben adott karaktereket másikra cserél.
+T = T ## Argumentumát szöveggé alakítja át.
+TEXT = SZÖVEG ## Számértéket alakít át adott számformátumú szöveggé.
+TRIM = TRIM ## A szövegből eltávolítja a szóközöket.
+UPPER = NAGYBETŰS ## Szöveget nagybetűssé alakít át.
+VALUE = ÉRTÉK ## Szöveget számmá alakít át.
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/it/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/it/config
new file mode 100644
index 00000000000..6cc013aec23
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/it/config
@@ -0,0 +1,24 @@
+##
+## PhpSpreadsheet
+##
+
+ArgumentSeparator = ;
+
+
+##
+## (For future use)
+##
+currencySymbol = €
+
+
+##
+## Excel Error Codes (For future use)
+
+##
+NULL = #NULLO!
+DIV0 = #DIV/0!
+VALUE = #VALORE!
+REF = #RIF!
+NAME = #NOME?
+NUM = #NUM!
+NA = #N/D
diff --git a/lib/phpexcel/PHPExcel/locale/it/functions b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/it/functions
similarity index 95%
rename from lib/phpexcel/PHPExcel/locale/it/functions
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/it/functions
index d371f3d72eb..1901bafa7a1 100644
--- a/lib/phpexcel/PHPExcel/locale/it/functions
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/it/functions
@@ -1,438 +1,416 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Calculation
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/
-##
-##
-
-
-##
-## Add-in and Automation functions Funzioni di automazione e dei componenti aggiuntivi
-##
-GETPIVOTDATA = INFO.DATI.TAB.PIVOT ## Restituisce i dati memorizzati in un rapporto di tabella pivot
-
-
-##
-## Cube functions Funzioni cubo
-##
-CUBEKPIMEMBER = MEMBRO.KPI.CUBO ## Restituisce il nome, la proprietà e la misura di un indicatore di prestazioni chiave (KPI) e visualizza il nome e la proprietà nella cella. Un KPI è una misura quantificabile, ad esempio l'utile lordo mensile o il fatturato trimestrale dei dipendenti, utilizzata per il monitoraggio delle prestazioni di un'organizzazione.
-CUBEMEMBER = MEMBRO.CUBO ## Restituisce un membro o una tupla in una gerarchia di cubi. Consente di verificare l'esistenza del membro o della tupla nel cubo.
-CUBEMEMBERPROPERTY = PROPRIETÀ.MEMBRO.CUBO ## Restituisce il valore di una proprietà di un membro del cubo. Consente di verificare l'esistenza di un nome di membro all'interno del cubo e di restituire la proprietà specificata per tale membro.
-CUBERANKEDMEMBER = MEMBRO.CUBO.CON.RANGO ## Restituisce l'n-esimo membro o il membro ordinato di un insieme. Consente di restituire uno o più elementi in un insieme, ad esempio l'agente di vendita migliore o i primi 10 studenti.
-CUBESET = SET.CUBO ## Definisce un insieme di tuple o membri calcolati mediante l'invio di un'espressione di insieme al cubo sul server. In questo modo l'insieme viene creato e restituito a Microsoft Office Excel.
-CUBESETCOUNT = CONTA.SET.CUBO ## Restituisce il numero di elementi di un insieme.
-CUBEVALUE = VALORE.CUBO ## Restituisce un valore aggregato da un cubo.
-
-
-##
-## Database functions Funzioni di database
-##
-DAVERAGE = DB.MEDIA ## Restituisce la media di voci del database selezionate
-DCOUNT = DB.CONTA.NUMERI ## Conta le celle di un database contenenti numeri
-DCOUNTA = DB.CONTA.VALORI ## Conta le celle non vuote in un database
-DGET = DB.VALORI ## Estrae da un database un singolo record che soddisfa i criteri specificati
-DMAX = DB.MAX ## Restituisce il valore massimo dalle voci selezionate in un database
-DMIN = DB.MIN ## Restituisce il valore minimo dalle voci di un database selezionate
-DPRODUCT = DB.PRODOTTO ## Moltiplica i valori in un determinato campo di record che soddisfano i criteri del database
-DSTDEV = DB.DEV.ST ## Restituisce una stima della deviazione standard sulla base di un campione di voci di un database selezionate
-DSTDEVP = DB.DEV.ST.POP ## Calcola la deviazione standard sulla base di tutte le voci di un database selezionate
-DSUM = DB.SOMMA ## Aggiunge i numeri nel campo colonna di record del database che soddisfa determinati criteri
-DVAR = DB.VAR ## Restituisce una stima della varianza sulla base di un campione da voci di un database selezionate
-DVARP = DB.VAR.POP ## Calcola la varianza sulla base di tutte le voci di un database selezionate
-
-
-##
-## Date and time functions Funzioni data e ora
-##
-DATE = DATA ## Restituisce il numero seriale di una determinata data
-DATEVALUE = DATA.VALORE ## Converte una data sotto forma di testo in un numero seriale
-DAY = GIORNO ## Converte un numero seriale in un giorno del mese
-DAYS360 = GIORNO360 ## Calcola il numero di giorni compreso tra due date basandosi su un anno di 360 giorni
-EDATE = DATA.MESE ## Restituisce il numero seriale della data che rappresenta il numero di mesi prima o dopo la data di inizio
-EOMONTH = FINE.MESE ## Restituisce il numero seriale dell'ultimo giorno del mese, prima o dopo un determinato numero di mesi
-HOUR = ORA ## Converte un numero seriale in un'ora
-MINUTE = MINUTO ## Converte un numero seriale in un minuto
-MONTH = MESE ## Converte un numero seriale in un mese
-NETWORKDAYS = GIORNI.LAVORATIVI.TOT ## Restituisce il numero di tutti i giorni lavorativi compresi fra due date
-NOW = ADESSO ## Restituisce il numero seriale della data e dell'ora corrente
-SECOND = SECONDO ## Converte un numero seriale in un secondo
-TIME = ORARIO ## Restituisce il numero seriale di una determinata ora
-TIMEVALUE = ORARIO.VALORE ## Converte un orario in forma di testo in un numero seriale
-TODAY = OGGI ## Restituisce il numero seriale relativo alla data odierna
-WEEKDAY = GIORNO.SETTIMANA ## Converte un numero seriale in un giorno della settimana
-WEEKNUM = NUM.SETTIMANA ## Converte un numero seriale in un numero che rappresenta la posizione numerica di una settimana nell'anno
-WORKDAY = GIORNO.LAVORATIVO ## Restituisce il numero della data prima o dopo un determinato numero di giorni lavorativi
-YEAR = ANNO ## Converte un numero seriale in un anno
-YEARFRAC = FRAZIONE.ANNO ## Restituisce la frazione dell'anno che rappresenta il numero dei giorni compresi tra una data_ iniziale e una data_finale
-
-
-##
-## Engineering functions Funzioni ingegneristiche
-##
-BESSELI = BESSEL.I ## Restituisce la funzione di Bessel modificata In(x)
-BESSELJ = BESSEL.J ## Restituisce la funzione di Bessel Jn(x)
-BESSELK = BESSEL.K ## Restituisce la funzione di Bessel modificata Kn(x)
-BESSELY = BESSEL.Y ## Restituisce la funzione di Bessel Yn(x)
-BIN2DEC = BINARIO.DECIMALE ## Converte un numero binario in decimale
-BIN2HEX = BINARIO.HEX ## Converte un numero binario in esadecimale
-BIN2OCT = BINARIO.OCT ## Converte un numero binario in ottale
-COMPLEX = COMPLESSO ## Converte i coefficienti reali e immaginari in numeri complessi
-CONVERT = CONVERTI ## Converte un numero da un sistema di misura in un altro
-DEC2BIN = DECIMALE.BINARIO ## Converte un numero decimale in binario
-DEC2HEX = DECIMALE.HEX ## Converte un numero decimale in esadecimale
-DEC2OCT = DECIMALE.OCT ## Converte un numero decimale in ottale
-DELTA = DELTA ## Verifica se due valori sono uguali
-ERF = FUNZ.ERRORE ## Restituisce la funzione di errore
-ERFC = FUNZ.ERRORE.COMP ## Restituisce la funzione di errore complementare
-GESTEP = SOGLIA ## Verifica se un numero è maggiore del valore di soglia
-HEX2BIN = HEX.BINARIO ## Converte un numero esadecimale in binario
-HEX2DEC = HEX.DECIMALE ## Converte un numero esadecimale in decimale
-HEX2OCT = HEX.OCT ## Converte un numero esadecimale in ottale
-IMABS = COMP.MODULO ## Restituisce il valore assoluto (modulo) di un numero complesso
-IMAGINARY = COMP.IMMAGINARIO ## Restituisce il coefficiente immaginario di un numero complesso
-IMARGUMENT = COMP.ARGOMENTO ## Restituisce l'argomento theta, un angolo espresso in radianti
-IMCONJUGATE = COMP.CONIUGATO ## Restituisce il complesso coniugato del numero complesso
-IMCOS = COMP.COS ## Restituisce il coseno di un numero complesso
-IMDIV = COMP.DIV ## Restituisce il quoziente di due numeri complessi
-IMEXP = COMP.EXP ## Restituisce il valore esponenziale di un numero complesso
-IMLN = COMP.LN ## Restituisce il logaritmo naturale di un numero complesso
-IMLOG10 = COMP.LOG10 ## Restituisce il logaritmo in base 10 di un numero complesso
-IMLOG2 = COMP.LOG2 ## Restituisce un logaritmo in base 2 di un numero complesso
-IMPOWER = COMP.POTENZA ## Restituisce il numero complesso elevato a una potenza intera
-IMPRODUCT = COMP.PRODOTTO ## Restituisce il prodotto di numeri complessi compresi tra 2 e 29
-IMREAL = COMP.PARTE.REALE ## Restituisce il coefficiente reale di un numero complesso
-IMSIN = COMP.SEN ## Restituisce il seno di un numero complesso
-IMSQRT = COMP.RADQ ## Restituisce la radice quadrata di un numero complesso
-IMSUB = COMP.DIFF ## Restituisce la differenza fra due numeri complessi
-IMSUM = COMP.SOMMA ## Restituisce la somma di numeri complessi
-OCT2BIN = OCT.BINARIO ## Converte un numero ottale in binario
-OCT2DEC = OCT.DECIMALE ## Converte un numero ottale in decimale
-OCT2HEX = OCT.HEX ## Converte un numero ottale in esadecimale
-
-
-##
-## Financial functions Funzioni finanziarie
-##
-ACCRINT = INT.MATURATO.PER ## Restituisce l'interesse maturato di un titolo che paga interessi periodici
-ACCRINTM = INT.MATURATO.SCAD ## Restituisce l'interesse maturato di un titolo che paga interessi alla scadenza
-AMORDEGRC = AMMORT.DEGR ## Restituisce l'ammortamento per ogni periodo contabile utilizzando un coefficiente di ammortamento
-AMORLINC = AMMORT.PER ## Restituisce l'ammortamento per ogni periodo contabile
-COUPDAYBS = GIORNI.CED.INIZ.LIQ ## Restituisce il numero dei giorni che vanno dall'inizio del periodo di durata della cedola alla data di liquidazione
-COUPDAYS = GIORNI.CED ## Restituisce il numero dei giorni relativi al periodo della cedola che contiene la data di liquidazione
-COUPDAYSNC = GIORNI.CED.NUOVA ## Restituisce il numero di giorni che vanno dalla data di liquidazione alla data della cedola successiva
-COUPNCD = DATA.CED.SUCC ## Restituisce un numero che rappresenta la data della cedola successiva alla data di liquidazione
-COUPNUM = NUM.CED ## Restituisce il numero di cedole pagabili fra la data di liquidazione e la data di scadenza
-COUPPCD = DATA.CED.PREC ## Restituisce un numero che rappresenta la data della cedola precedente alla data di liquidazione
-CUMIPMT = INT.CUMUL ## Restituisce l'interesse cumulativo pagato fra due periodi
-CUMPRINC = CAP.CUM ## Restituisce il capitale cumulativo pagato per estinguere un debito fra due periodi
-DB = DB ## Restituisce l'ammortamento di un bene per un periodo specificato utilizzando il metodo di ammortamento a quote fisse decrescenti
-DDB = AMMORT ## Restituisce l'ammortamento di un bene per un periodo specificato utilizzando il metodo di ammortamento a doppie quote decrescenti o altri metodi specificati
-DISC = TASSO.SCONTO ## Restituisce il tasso di sconto per un titolo
-DOLLARDE = VALUTA.DEC ## Converte un prezzo valuta, espresso come frazione, in prezzo valuta, espresso come numero decimale
-DOLLARFR = VALUTA.FRAZ ## Converte un prezzo valuta, espresso come numero decimale, in prezzo valuta, espresso come frazione
-DURATION = DURATA ## Restituisce la durata annuale di un titolo con i pagamenti di interesse periodico
-EFFECT = EFFETTIVO ## Restituisce l'effettivo tasso di interesse annuo
-FV = VAL.FUT ## Restituisce il valore futuro di un investimento
-FVSCHEDULE = VAL.FUT.CAPITALE ## Restituisce il valore futuro di un capitale iniziale dopo aver applicato una serie di tassi di interesse composti
-INTRATE = TASSO.INT ## Restituisce il tasso di interesse per un titolo interamente investito
-IPMT = INTERESSI ## Restituisce il valore degli interessi per un investimento relativo a un periodo specifico
-IRR = TIR.COST ## Restituisce il tasso di rendimento interno per una serie di flussi di cassa
-ISPMT = INTERESSE.RATA ## Calcola l'interesse di un investimento pagato durante un periodo specifico
-MDURATION = DURATA.M ## Restituisce la durata Macauley modificata per un titolo con un valore presunto di € 100
-MIRR = TIR.VAR ## Restituisce il tasso di rendimento interno in cui i flussi di cassa positivi e negativi sono finanziati a tassi differenti
-NOMINAL = NOMINALE ## Restituisce il tasso di interesse nominale annuale
-NPER = NUM.RATE ## Restituisce un numero di periodi relativi a un investimento
-NPV = VAN ## Restituisce il valore attuale netto di un investimento basato su una serie di flussi di cassa periodici e sul tasso di sconto
-ODDFPRICE = PREZZO.PRIMO.IRR ## Restituisce il prezzo di un titolo dal valore nominale di € 100 avente il primo periodo di durata irregolare
-ODDFYIELD = REND.PRIMO.IRR ## Restituisce il rendimento di un titolo avente il primo periodo di durata irregolare
-ODDLPRICE = PREZZO.ULTIMO.IRR ## Restituisce il prezzo di un titolo dal valore nominale di € 100 avente l'ultimo periodo di durata irregolare
-ODDLYIELD = REND.ULTIMO.IRR ## Restituisce il rendimento di un titolo avente l'ultimo periodo di durata irregolare
-PMT = RATA ## Restituisce il pagamento periodico di una rendita annua
-PPMT = P.RATA ## Restituisce il pagamento sul capitale di un investimento per un dato periodo
-PRICE = PREZZO ## Restituisce il prezzo di un titolo dal valore nominale di € 100 che paga interessi periodici
-PRICEDISC = PREZZO.SCONT ## Restituisce il prezzo di un titolo scontato dal valore nominale di € 100
-PRICEMAT = PREZZO.SCAD ## Restituisce il prezzo di un titolo dal valore nominale di € 100 che paga gli interessi alla scadenza
-PV = VA ## Restituisce il valore attuale di un investimento
-RATE = TASSO ## Restituisce il tasso di interesse per un periodo di un'annualità
-RECEIVED = RICEV.SCAD ## Restituisce l'ammontare ricevuto alla scadenza di un titolo interamente investito
-SLN = AMMORT.COST ## Restituisce l'ammortamento a quote costanti di un bene per un singolo periodo
-SYD = AMMORT.ANNUO ## Restituisce l'ammortamento a somma degli anni di un bene per un periodo specificato
-TBILLEQ = BOT.EQUIV ## Restituisce il rendimento equivalente ad un'obbligazione per un Buono ordinario del Tesoro
-TBILLPRICE = BOT.PREZZO ## Restituisce il prezzo di un Buono del Tesoro dal valore nominale di € 100
-TBILLYIELD = BOT.REND ## Restituisce il rendimento di un Buono del Tesoro
-VDB = AMMORT.VAR ## Restituisce l'ammortamento di un bene per un periodo specificato o parziale utilizzando il metodo a doppie quote proporzionali ai valori residui
-XIRR = TIR.X ## Restituisce il tasso di rendimento interno di un impiego di flussi di cassa
-XNPV = VAN.X ## Restituisce il valore attuale netto di un impiego di flussi di cassa non necessariamente periodici
-YIELD = REND ## Restituisce il rendimento di un titolo che frutta interessi periodici
-YIELDDISC = REND.TITOLI.SCONT ## Restituisce il rendimento annuale di un titolo scontato, ad esempio un Buono del Tesoro
-YIELDMAT = REND.SCAD ## Restituisce il rendimento annuo di un titolo che paga interessi alla scadenza
-
-
-##
-## Information functions Funzioni relative alle informazioni
-##
-CELL = CELLA ## Restituisce le informazioni sulla formattazione, la posizione o i contenuti di una cella
-ERROR.TYPE = ERRORE.TIPO ## Restituisce un numero che corrisponde a un tipo di errore
-INFO = INFO ## Restituisce le informazioni sull'ambiente operativo corrente
-ISBLANK = VAL.VUOTO ## Restituisce VERO se il valore è vuoto
-ISERR = VAL.ERR ## Restituisce VERO se il valore è un valore di errore qualsiasi tranne #N/D
-ISERROR = VAL.ERRORE ## Restituisce VERO se il valore è un valore di errore qualsiasi
-ISEVEN = VAL.PARI ## Restituisce VERO se il numero è pari
-ISLOGICAL = VAL.LOGICO ## Restituisce VERO se il valore è un valore logico
-ISNA = VAL.NON.DISP ## Restituisce VERO se il valore è un valore di errore #N/D
-ISNONTEXT = VAL.NON.TESTO ## Restituisce VERO se il valore non è in formato testo
-ISNUMBER = VAL.NUMERO ## Restituisce VERO se il valore è un numero
-ISODD = VAL.DISPARI ## Restituisce VERO se il numero è dispari
-ISREF = VAL.RIF ## Restituisce VERO se il valore è un riferimento
-ISTEXT = VAL.TESTO ## Restituisce VERO se il valore è in formato testo
-N = NUM ## Restituisce un valore convertito in numero
-NA = NON.DISP ## Restituisce il valore di errore #N/D
-TYPE = TIPO ## Restituisce un numero che indica il tipo di dati relativi a un valore
-
-
-##
-## Logical functions Funzioni logiche
-##
-AND = E ## Restituisce VERO se tutti gli argomenti sono VERO
-FALSE = FALSO ## Restituisce il valore logico FALSO
-IF = SE ## Specifica un test logico da eseguire
-IFERROR = SE.ERRORE ## Restituisce un valore specificato se una formula fornisce un errore come risultato; in caso contrario, restituisce il risultato della formula
-NOT = NON ## Inverte la logica degli argomenti
-OR = O ## Restituisce VERO se un argomento qualsiasi è VERO
-TRUE = VERO ## Restituisce il valore logico VERO
-
-
-##
-## Lookup and reference functions Funzioni di ricerca e di riferimento
-##
-ADDRESS = INDIRIZZO ## Restituisce un riferimento come testo in una singola cella di un foglio di lavoro
-AREAS = AREE ## Restituisce il numero di aree in un riferimento
-CHOOSE = SCEGLI ## Sceglie un valore da un elenco di valori
-COLUMN = RIF.COLONNA ## Restituisce il numero di colonna di un riferimento
-COLUMNS = COLONNE ## Restituisce il numero di colonne in un riferimento
-HLOOKUP = CERCA.ORIZZ ## Effettua una ricerca nella riga superiore di una matrice e restituisce il valore della cella specificata
-HYPERLINK = COLLEG.IPERTESTUALE ## Crea un collegamento che apre un documento memorizzato in un server di rete, una rete Intranet o Internet
-INDEX = INDICE ## Utilizza un indice per scegliere un valore da un riferimento o da una matrice
-INDIRECT = INDIRETTO ## Restituisce un riferimento specificato da un valore testo
-LOOKUP = CERCA ## Ricerca i valori in un vettore o in una matrice
-MATCH = CONFRONTA ## Ricerca i valori in un riferimento o in una matrice
-OFFSET = SCARTO ## Restituisce uno scarto di riferimento da un riferimento dato
-ROW = RIF.RIGA ## Restituisce il numero di riga di un riferimento
-ROWS = RIGHE ## Restituisce il numero delle righe in un riferimento
-RTD = DATITEMPOREALE ## Recupera dati in tempo reale da un programma che supporta l'automazione COM (automazione: Metodo per utilizzare gli oggetti di un'applicazione da un'altra applicazione o da un altro strumento di sviluppo. Precedentemente nota come automazione OLE, l'automazione è uno standard del settore e una caratteristica del modello COM (Component Object Model).)
-TRANSPOSE = MATR.TRASPOSTA ## Restituisce la trasposizione di una matrice
-VLOOKUP = CERCA.VERT ## Effettua una ricerca nella prima colonna di una matrice e si sposta attraverso la riga per restituire il valore di una cella
-
-
-##
-## Math and trigonometry functions Funzioni matematiche e trigonometriche
-##
-ABS = ASS ## Restituisce il valore assoluto di un numero.
-ACOS = ARCCOS ## Restituisce l'arcocoseno di un numero
-ACOSH = ARCCOSH ## Restituisce l'inverso del coseno iperbolico di un numero
-ASIN = ARCSEN ## Restituisce l'arcoseno di un numero
-ASINH = ARCSENH ## Restituisce l'inverso del seno iperbolico di un numero
-ATAN = ARCTAN ## Restituisce l'arcotangente di un numero
-ATAN2 = ARCTAN.2 ## Restituisce l'arcotangente delle coordinate x e y specificate
-ATANH = ARCTANH ## Restituisce l'inverso della tangente iperbolica di un numero
-CEILING = ARROTONDA.ECCESSO ## Arrotonda un numero per eccesso all'intero più vicino o al multiplo più vicino a peso
-COMBIN = COMBINAZIONE ## Restituisce il numero di combinazioni possibili per un numero assegnato di elementi
-COS = COS ## Restituisce il coseno dell'angolo specificato
-COSH = COSH ## Restituisce il coseno iperbolico di un numero
-DEGREES = GRADI ## Converte i radianti in gradi
-EVEN = PARI ## Arrotonda il valore assoluto di un numero per eccesso al più vicino intero pari
-EXP = ESP ## Restituisce il numero e elevato alla potenza di num
-FACT = FATTORIALE ## Restituisce il fattoriale di un numero
-FACTDOUBLE = FATT.DOPPIO ## Restituisce il fattoriale doppio di un numero
-FLOOR = ARROTONDA.DIFETTO ## Arrotonda un numero per difetto al multiplo più vicino a zero
-GCD = MCD ## Restituisce il massimo comune divisore
-INT = INT ## Arrotonda un numero per difetto al numero intero più vicino
-LCM = MCM ## Restituisce il minimo comune multiplo
-LN = LN ## Restituisce il logaritmo naturale di un numero
-LOG = LOG ## Restituisce il logaritmo di un numero in una specificata base
-LOG10 = LOG10 ## Restituisce il logaritmo in base 10 di un numero
-MDETERM = MATR.DETERM ## Restituisce il determinante di una matrice
-MINVERSE = MATR.INVERSA ## Restituisce l'inverso di una matrice
-MMULT = MATR.PRODOTTO ## Restituisce il prodotto di due matrici
-MOD = RESTO ## Restituisce il resto della divisione
-MROUND = ARROTONDA.MULTIPLO ## Restituisce un numero arrotondato al multiplo desiderato
-MULTINOMIAL = MULTINOMIALE ## Restituisce il multinomiale di un insieme di numeri
-ODD = DISPARI ## Arrotonda un numero per eccesso al più vicino intero dispari
-PI = PI.GRECO ## Restituisce il valore di pi greco
-POWER = POTENZA ## Restituisce il risultato di un numero elevato a potenza
-PRODUCT = PRODOTTO ## Moltiplica i suoi argomenti
-QUOTIENT = QUOZIENTE ## Restituisce la parte intera di una divisione
-RADIANS = RADIANTI ## Converte i gradi in radianti
-RAND = CASUALE ## Restituisce un numero casuale compreso tra 0 e 1
-RANDBETWEEN = CASUALE.TRA ## Restituisce un numero casuale compreso tra i numeri specificati
-ROMAN = ROMANO ## Restituisce il numero come numero romano sotto forma di testo
-ROUND = ARROTONDA ## Arrotonda il numero al numero di cifre specificato
-ROUNDDOWN = ARROTONDA.PER.DIF ## Arrotonda il valore assoluto di un numero per difetto
-ROUNDUP = ARROTONDA.PER.ECC ## Arrotonda il valore assoluto di un numero per eccesso
-SERIESSUM = SOMMA.SERIE ## Restituisce la somma di una serie di potenze in base alla formula
-SIGN = SEGNO ## Restituisce il segno di un numero
-SIN = SEN ## Restituisce il seno di un dato angolo
-SINH = SENH ## Restituisce il seno iperbolico di un numero
-SQRT = RADQ ## Restituisce una radice quadrata
-SQRTPI = RADQ.PI.GRECO ## Restituisce la radice quadrata di un numero (numero * pi greco)
-SUBTOTAL = SUBTOTALE ## Restituisce un subtotale in un elenco o in un database
-SUM = SOMMA ## Somma i suoi argomenti
-SUMIF = SOMMA.SE ## Somma le celle specificate da un dato criterio
-SUMIFS = SOMMA.PIÙ.SE ## Somma le celle in un intervallo che soddisfano più criteri
-SUMPRODUCT = MATR.SOMMA.PRODOTTO ## Restituisce la somma dei prodotti dei componenti corrispondenti della matrice
-SUMSQ = SOMMA.Q ## Restituisce la somma dei quadrati degli argomenti
-SUMX2MY2 = SOMMA.DIFF.Q ## Restituisce la somma della differenza dei quadrati dei corrispondenti elementi in due matrici
-SUMX2PY2 = SOMMA.SOMMA.Q ## Restituisce la somma della somma dei quadrati dei corrispondenti elementi in due matrici
-SUMXMY2 = SOMMA.Q.DIFF ## Restituisce la somma dei quadrati delle differenze dei corrispondenti elementi in due matrici
-TAN = TAN ## Restituisce la tangente di un numero
-TANH = TANH ## Restituisce la tangente iperbolica di un numero
-TRUNC = TRONCA ## Tronca la parte decimale di un numero
-
-
-##
-## Statistical functions Funzioni statistiche
-##
-AVEDEV = MEDIA.DEV ## Restituisce la media delle deviazioni assolute delle coordinate rispetto alla loro media
-AVERAGE = MEDIA ## Restituisce la media degli argomenti
-AVERAGEA = MEDIA.VALORI ## Restituisce la media degli argomenti, inclusi i numeri, il testo e i valori logici
-AVERAGEIF = MEDIA.SE ## Restituisce la media aritmetica di tutte le celle in un intervallo che soddisfano un determinato criterio
-AVERAGEIFS = MEDIA.PIÙ.SE ## Restituisce la media aritmetica di tutte le celle che soddisfano più criteri
-BETADIST = DISTRIB.BETA ## Restituisce la funzione di distribuzione cumulativa beta
-BETAINV = INV.BETA ## Restituisce l'inverso della funzione di distribuzione cumulativa per una distribuzione beta specificata
-BINOMDIST = DISTRIB.BINOM ## Restituisce la distribuzione binomiale per il termine individuale
-CHIDIST = DISTRIB.CHI ## Restituisce la probabilità a una coda per la distribuzione del chi quadrato
-CHIINV = INV.CHI ## Restituisce l'inverso della probabilità ad una coda per la distribuzione del chi quadrato
-CHITEST = TEST.CHI ## Restituisce il test per l'indipendenza
-CONFIDENCE = CONFIDENZA ## Restituisce l'intervallo di confidenza per una popolazione
-CORREL = CORRELAZIONE ## Restituisce il coefficiente di correlazione tra due insiemi di dati
-COUNT = CONTA.NUMERI ## Conta la quantità di numeri nell'elenco di argomenti
-COUNTA = CONTA.VALORI ## Conta il numero di valori nell'elenco di argomenti
-COUNTBLANK = CONTA.VUOTE ## Conta il numero di celle vuote all'interno di un intervallo
-COUNTIF = CONTA.SE ## Conta il numero di celle all'interno di un intervallo che soddisfa i criteri specificati
-COUNTIFS = CONTA.PIÙ.SE ## Conta il numero di celle in un intervallo che soddisfano più criteri.
-COVAR = COVARIANZA ## Calcola la covarianza, la media dei prodotti delle deviazioni accoppiate
-CRITBINOM = CRIT.BINOM ## Restituisce il più piccolo valore per il quale la distribuzione cumulativa binomiale risulta maggiore o uguale ad un valore di criterio
-DEVSQ = DEV.Q ## Restituisce la somma dei quadrati delle deviazioni
-EXPONDIST = DISTRIB.EXP ## Restituisce la distribuzione esponenziale
-FDIST = DISTRIB.F ## Restituisce la distribuzione di probabilità F
-FINV = INV.F ## Restituisce l'inverso della distribuzione della probabilità F
-FISHER = FISHER ## Restituisce la trasformazione di Fisher
-FISHERINV = INV.FISHER ## Restituisce l'inverso della trasformazione di Fisher
-FORECAST = PREVISIONE ## Restituisce i valori lungo una tendenza lineare
-FREQUENCY = FREQUENZA ## Restituisce la distribuzione di frequenza come matrice verticale
-FTEST = TEST.F ## Restituisce il risultato di un test F
-GAMMADIST = DISTRIB.GAMMA ## Restituisce la distribuzione gamma
-GAMMAINV = INV.GAMMA ## Restituisce l'inverso della distribuzione cumulativa gamma
-GAMMALN = LN.GAMMA ## Restituisce il logaritmo naturale della funzione gamma, G(x)
-GEOMEAN = MEDIA.GEOMETRICA ## Restituisce la media geometrica
-GROWTH = CRESCITA ## Restituisce i valori lungo una linea di tendenza esponenziale
-HARMEAN = MEDIA.ARMONICA ## Restituisce la media armonica
-HYPGEOMDIST = DISTRIB.IPERGEOM ## Restituisce la distribuzione ipergeometrica
-INTERCEPT = INTERCETTA ## Restituisce l'intercetta della retta di regressione lineare
-KURT = CURTOSI ## Restituisce la curtosi di un insieme di dati
-LARGE = GRANDE ## Restituisce il k-esimo valore più grande in un insieme di dati
-LINEST = REGR.LIN ## Restituisce i parametri di una tendenza lineare
-LOGEST = REGR.LOG ## Restituisce i parametri di una linea di tendenza esponenziale
-LOGINV = INV.LOGNORM ## Restituisce l'inverso di una distribuzione lognormale
-LOGNORMDIST = DISTRIB.LOGNORM ## Restituisce la distribuzione lognormale cumulativa
-MAX = MAX ## Restituisce il valore massimo in un elenco di argomenti
-MAXA = MAX.VALORI ## Restituisce il valore massimo in un elenco di argomenti, inclusi i numeri, il testo e i valori logici
-MEDIAN = MEDIANA ## Restituisce la mediana dei numeri specificati
-MIN = MIN ## Restituisce il valore minimo in un elenco di argomenti
-MINA = MIN.VALORI ## Restituisce il più piccolo valore in un elenco di argomenti, inclusi i numeri, il testo e i valori logici
-MODE = MODA ## Restituisce il valore più comune in un insieme di dati
-NEGBINOMDIST = DISTRIB.BINOM.NEG ## Restituisce la distribuzione binomiale negativa
-NORMDIST = DISTRIB.NORM ## Restituisce la distribuzione cumulativa normale
-NORMINV = INV.NORM ## Restituisce l'inverso della distribuzione cumulativa normale standard
-NORMSDIST = DISTRIB.NORM.ST ## Restituisce la distribuzione cumulativa normale standard
-NORMSINV = INV.NORM.ST ## Restituisce l'inverso della distribuzione cumulativa normale
-PEARSON = PEARSON ## Restituisce il coefficiente del momento di correlazione di Pearson
-PERCENTILE = PERCENTILE ## Restituisce il k-esimo dato percentile di valori in un intervallo
-PERCENTRANK = PERCENT.RANGO ## Restituisce il rango di un valore in un insieme di dati come percentuale
-PERMUT = PERMUTAZIONE ## Restituisce il numero delle permutazioni per un determinato numero di oggetti
-POISSON = POISSON ## Restituisce la distribuzione di Poisson
-PROB = PROBABILITÀ ## Calcola la probabilità che dei valori in un intervallo siano compresi tra due limiti
-QUARTILE = QUARTILE ## Restituisce il quartile di un insieme di dati
-RANK = RANGO ## Restituisce il rango di un numero in un elenco di numeri
-RSQ = RQ ## Restituisce la radice quadrata del coefficiente di momento di correlazione di Pearson
-SKEW = ASIMMETRIA ## Restituisce il grado di asimmetria di una distribuzione
-SLOPE = PENDENZA ## Restituisce la pendenza di una retta di regressione lineare
-SMALL = PICCOLO ## Restituisce il k-esimo valore più piccolo in un insieme di dati
-STANDARDIZE = NORMALIZZA ## Restituisce un valore normalizzato
-STDEV = DEV.ST ## Restituisce una stima della deviazione standard sulla base di un campione
-STDEVA = DEV.ST.VALORI ## Restituisce una stima della deviazione standard sulla base di un campione, inclusi i numeri, il testo e i valori logici
-STDEVP = DEV.ST.POP ## Calcola la deviazione standard sulla base di un'intera popolazione
-STDEVPA = DEV.ST.POP.VALORI ## Calcola la deviazione standard sulla base sull'intera popolazione, inclusi i numeri, il testo e i valori logici
-STEYX = ERR.STD.YX ## Restituisce l'errore standard del valore previsto per y per ogni valore x nella regressione
-TDIST = DISTRIB.T ## Restituisce la distribuzione t di Student
-TINV = INV.T ## Restituisce l'inversa della distribuzione t di Student
-TREND = TENDENZA ## Restituisce i valori lungo una linea di tendenza lineare
-TRIMMEAN = MEDIA.TRONCATA ## Restituisce la media della parte interna di un insieme di dati
-TTEST = TEST.T ## Restituisce la probabilità associata ad un test t di Student
-VAR = VAR ## Stima la varianza sulla base di un campione
-VARA = VAR.VALORI ## Stima la varianza sulla base di un campione, inclusi i numeri, il testo e i valori logici
-VARP = VAR.POP ## Calcola la varianza sulla base dell'intera popolazione
-VARPA = VAR.POP.VALORI ## Calcola la deviazione standard sulla base sull'intera popolazione, inclusi i numeri, il testo e i valori logici
-WEIBULL = WEIBULL ## Restituisce la distribuzione di Weibull
-ZTEST = TEST.Z ## Restituisce il valore di probabilità a una coda per un test z
-
-
-##
-## Text functions Funzioni di testo
-##
-ASC = ASC ## Modifica le lettere inglesi o il katakana a doppio byte all'interno di una stringa di caratteri in caratteri a singolo byte
-BAHTTEXT = BAHTTESTO ## Converte un numero in testo, utilizzando il formato valuta ß (baht)
-CHAR = CODICE.CARATT ## Restituisce il carattere specificato dal numero di codice
-CLEAN = LIBERA ## Elimina dal testo tutti i caratteri che non è possibile stampare
-CODE = CODICE ## Restituisce il codice numerico del primo carattere di una stringa di testo
-CONCATENATE = CONCATENA ## Unisce diversi elementi di testo in un unico elemento di testo
-DOLLAR = VALUTA ## Converte un numero in testo, utilizzando il formato valuta € (euro)
-EXACT = IDENTICO ## Verifica se due valori di testo sono uguali
-FIND = TROVA ## Rileva un valore di testo all'interno di un altro (distinzione tra maiuscole e minuscole)
-FINDB = TROVA.B ## Rileva un valore di testo all'interno di un altro (distinzione tra maiuscole e minuscole)
-FIXED = FISSO ## Formatta un numero come testo con un numero fisso di decimali
-JIS = ORDINAMENTO.JIS ## Modifica le lettere inglesi o i caratteri katakana a byte singolo all'interno di una stringa di caratteri in caratteri a byte doppio.
-LEFT = SINISTRA ## Restituisce il carattere più a sinistra di un valore di testo
-LEFTB = SINISTRA.B ## Restituisce il carattere più a sinistra di un valore di testo
-LEN = LUNGHEZZA ## Restituisce il numero di caratteri di una stringa di testo
-LENB = LUNB ## Restituisce il numero di caratteri di una stringa di testo
-LOWER = MINUSC ## Converte il testo in lettere minuscole
-MID = MEDIA ## Restituisce un numero specifico di caratteri di una stringa di testo a partire dalla posizione specificata
-MIDB = MEDIA.B ## Restituisce un numero specifico di caratteri di una stringa di testo a partire dalla posizione specificata
-PHONETIC = FURIGANA ## Estrae i caratteri fonetici (furigana) da una stringa di testo.
-PROPER = MAIUSC.INIZ ## Converte in maiuscolo la prima lettera di ogni parola di un valore di testo
-REPLACE = RIMPIAZZA ## Sostituisce i caratteri all'interno di un testo
-REPLACEB = SOSTITUISCI.B ## Sostituisce i caratteri all'interno di un testo
-REPT = RIPETI ## Ripete un testo per un dato numero di volte
-RIGHT = DESTRA ## Restituisce il carattere più a destra di un valore di testo
-RIGHTB = DESTRA.B ## Restituisce il carattere più a destra di un valore di testo
-SEARCH = RICERCA ## Rileva un valore di testo all'interno di un altro (non è sensibile alle maiuscole e minuscole)
-SEARCHB = CERCA.B ## Rileva un valore di testo all'interno di un altro (non è sensibile alle maiuscole e minuscole)
-SUBSTITUTE = SOSTITUISCI ## Sostituisce il nuovo testo al testo contenuto in una stringa
-T = T ## Converte gli argomenti in testo
-TEXT = TESTO ## Formatta un numero e lo converte in testo
-TRIM = ANNULLA.SPAZI ## Elimina gli spazi dal testo
-UPPER = MAIUSC ## Converte il testo in lettere maiuscole
-VALUE = VALORE ## Converte un argomento di testo in numero
+##
+## PhpSpreadsheet
+##
+## Data in this file derived from https://www.excel-function-translation.com/
+##
+##
+
+
+##
+## Add-in and Automation functions Funzioni di automazione e dei componenti aggiuntivi
+##
+GETPIVOTDATA = INFO.DATI.TAB.PIVOT ## Restituisce i dati memorizzati in un rapporto di tabella pivot
+
+
+##
+## Cube functions Funzioni cubo
+##
+CUBEKPIMEMBER = MEMBRO.KPI.CUBO ## Restituisce il nome, la proprietà e la misura di un indicatore di prestazioni chiave (KPI) e visualizza il nome e la proprietà nella cella. Un KPI è una misura quantificabile, ad esempio l'utile lordo mensile o il fatturato trimestrale dei dipendenti, utilizzata per il monitoraggio delle prestazioni di un'organizzazione.
+CUBEMEMBER = MEMBRO.CUBO ## Restituisce un membro o una tupla in una gerarchia di cubi. Consente di verificare l'esistenza del membro o della tupla nel cubo.
+CUBEMEMBERPROPERTY = PROPRIETÀ.MEMBRO.CUBO ## Restituisce il valore di una proprietà di un membro del cubo. Consente di verificare l'esistenza di un nome di membro all'interno del cubo e di restituire la proprietà specificata per tale membro.
+CUBERANKEDMEMBER = MEMBRO.CUBO.CON.RANGO ## Restituisce l'n-esimo membro o il membro ordinato di un insieme. Consente di restituire uno o più elementi in un insieme, ad esempio l'agente di vendita migliore o i primi 10 studenti.
+CUBESET = SET.CUBO ## Definisce un insieme di tuple o membri calcolati mediante l'invio di un'espressione di insieme al cubo sul server. In questo modo l'insieme viene creato e restituito a Microsoft Office Excel.
+CUBESETCOUNT = CONTA.SET.CUBO ## Restituisce il numero di elementi di un insieme.
+CUBEVALUE = VALORE.CUBO ## Restituisce un valore aggregato da un cubo.
+
+
+##
+## Database functions Funzioni di database
+##
+DAVERAGE = DB.MEDIA ## Restituisce la media di voci del database selezionate
+DCOUNT = DB.CONTA.NUMERI ## Conta le celle di un database contenenti numeri
+DCOUNTA = DB.CONTA.VALORI ## Conta le celle non vuote in un database
+DGET = DB.VALORI ## Estrae da un database un singolo record che soddisfa i criteri specificati
+DMAX = DB.MAX ## Restituisce il valore massimo dalle voci selezionate in un database
+DMIN = DB.MIN ## Restituisce il valore minimo dalle voci di un database selezionate
+DPRODUCT = DB.PRODOTTO ## Moltiplica i valori in un determinato campo di record che soddisfano i criteri del database
+DSTDEV = DB.DEV.ST ## Restituisce una stima della deviazione standard sulla base di un campione di voci di un database selezionate
+DSTDEVP = DB.DEV.ST.POP ## Calcola la deviazione standard sulla base di tutte le voci di un database selezionate
+DSUM = DB.SOMMA ## Aggiunge i numeri nel campo colonna di record del database che soddisfa determinati criteri
+DVAR = DB.VAR ## Restituisce una stima della varianza sulla base di un campione da voci di un database selezionate
+DVARP = DB.VAR.POP ## Calcola la varianza sulla base di tutte le voci di un database selezionate
+
+
+##
+## Date and time functions Funzioni data e ora
+##
+DATE = DATA ## Restituisce il numero seriale di una determinata data
+DATEVALUE = DATA.VALORE ## Converte una data sotto forma di testo in un numero seriale
+DAY = GIORNO ## Converte un numero seriale in un giorno del mese
+DAYS360 = GIORNO360 ## Calcola il numero di giorni compreso tra due date basandosi su un anno di 360 giorni
+EDATE = DATA.MESE ## Restituisce il numero seriale della data che rappresenta il numero di mesi prima o dopo la data di inizio
+EOMONTH = FINE.MESE ## Restituisce il numero seriale dell'ultimo giorno del mese, prima o dopo un determinato numero di mesi
+HOUR = ORA ## Converte un numero seriale in un'ora
+MINUTE = MINUTO ## Converte un numero seriale in un minuto
+MONTH = MESE ## Converte un numero seriale in un mese
+NETWORKDAYS = GIORNI.LAVORATIVI.TOT ## Restituisce il numero di tutti i giorni lavorativi compresi fra due date
+NOW = ADESSO ## Restituisce il numero seriale della data e dell'ora corrente
+SECOND = SECONDO ## Converte un numero seriale in un secondo
+TIME = ORARIO ## Restituisce il numero seriale di una determinata ora
+TIMEVALUE = ORARIO.VALORE ## Converte un orario in forma di testo in un numero seriale
+TODAY = OGGI ## Restituisce il numero seriale relativo alla data odierna
+WEEKDAY = GIORNO.SETTIMANA ## Converte un numero seriale in un giorno della settimana
+WEEKNUM = NUM.SETTIMANA ## Converte un numero seriale in un numero che rappresenta la posizione numerica di una settimana nell'anno
+WORKDAY = GIORNO.LAVORATIVO ## Restituisce il numero della data prima o dopo un determinato numero di giorni lavorativi
+YEAR = ANNO ## Converte un numero seriale in un anno
+YEARFRAC = FRAZIONE.ANNO ## Restituisce la frazione dell'anno che rappresenta il numero dei giorni compresi tra una data_ iniziale e una data_finale
+
+
+##
+## Engineering functions Funzioni ingegneristiche
+##
+BESSELI = BESSEL.I ## Restituisce la funzione di Bessel modificata In(x)
+BESSELJ = BESSEL.J ## Restituisce la funzione di Bessel Jn(x)
+BESSELK = BESSEL.K ## Restituisce la funzione di Bessel modificata Kn(x)
+BESSELY = BESSEL.Y ## Restituisce la funzione di Bessel Yn(x)
+BIN2DEC = BINARIO.DECIMALE ## Converte un numero binario in decimale
+BIN2HEX = BINARIO.HEX ## Converte un numero binario in esadecimale
+BIN2OCT = BINARIO.OCT ## Converte un numero binario in ottale
+COMPLEX = COMPLESSO ## Converte i coefficienti reali e immaginari in numeri complessi
+CONVERT = CONVERTI ## Converte un numero da un sistema di misura in un altro
+DEC2BIN = DECIMALE.BINARIO ## Converte un numero decimale in binario
+DEC2HEX = DECIMALE.HEX ## Converte un numero decimale in esadecimale
+DEC2OCT = DECIMALE.OCT ## Converte un numero decimale in ottale
+DELTA = DELTA ## Verifica se due valori sono uguali
+ERF = FUNZ.ERRORE ## Restituisce la funzione di errore
+ERFC = FUNZ.ERRORE.COMP ## Restituisce la funzione di errore complementare
+GESTEP = SOGLIA ## Verifica se un numero è maggiore del valore di soglia
+HEX2BIN = HEX.BINARIO ## Converte un numero esadecimale in binario
+HEX2DEC = HEX.DECIMALE ## Converte un numero esadecimale in decimale
+HEX2OCT = HEX.OCT ## Converte un numero esadecimale in ottale
+IMABS = COMP.MODULO ## Restituisce il valore assoluto (modulo) di un numero complesso
+IMAGINARY = COMP.IMMAGINARIO ## Restituisce il coefficiente immaginario di un numero complesso
+IMARGUMENT = COMP.ARGOMENTO ## Restituisce l'argomento theta, un angolo espresso in radianti
+IMCONJUGATE = COMP.CONIUGATO ## Restituisce il complesso coniugato del numero complesso
+IMCOS = COMP.COS ## Restituisce il coseno di un numero complesso
+IMDIV = COMP.DIV ## Restituisce il quoziente di due numeri complessi
+IMEXP = COMP.EXP ## Restituisce il valore esponenziale di un numero complesso
+IMLN = COMP.LN ## Restituisce il logaritmo naturale di un numero complesso
+IMLOG10 = COMP.LOG10 ## Restituisce il logaritmo in base 10 di un numero complesso
+IMLOG2 = COMP.LOG2 ## Restituisce un logaritmo in base 2 di un numero complesso
+IMPOWER = COMP.POTENZA ## Restituisce il numero complesso elevato a una potenza intera
+IMPRODUCT = COMP.PRODOTTO ## Restituisce il prodotto di numeri complessi compresi tra 2 e 29
+IMREAL = COMP.PARTE.REALE ## Restituisce il coefficiente reale di un numero complesso
+IMSIN = COMP.SEN ## Restituisce il seno di un numero complesso
+IMSQRT = COMP.RADQ ## Restituisce la radice quadrata di un numero complesso
+IMSUB = COMP.DIFF ## Restituisce la differenza fra due numeri complessi
+IMSUM = COMP.SOMMA ## Restituisce la somma di numeri complessi
+OCT2BIN = OCT.BINARIO ## Converte un numero ottale in binario
+OCT2DEC = OCT.DECIMALE ## Converte un numero ottale in decimale
+OCT2HEX = OCT.HEX ## Converte un numero ottale in esadecimale
+
+
+##
+## Financial functions Funzioni finanziarie
+##
+ACCRINT = INT.MATURATO.PER ## Restituisce l'interesse maturato di un titolo che paga interessi periodici
+ACCRINTM = INT.MATURATO.SCAD ## Restituisce l'interesse maturato di un titolo che paga interessi alla scadenza
+AMORDEGRC = AMMORT.DEGR ## Restituisce l'ammortamento per ogni periodo contabile utilizzando un coefficiente di ammortamento
+AMORLINC = AMMORT.PER ## Restituisce l'ammortamento per ogni periodo contabile
+COUPDAYBS = GIORNI.CED.INIZ.LIQ ## Restituisce il numero dei giorni che vanno dall'inizio del periodo di durata della cedola alla data di liquidazione
+COUPDAYS = GIORNI.CED ## Restituisce il numero dei giorni relativi al periodo della cedola che contiene la data di liquidazione
+COUPDAYSNC = GIORNI.CED.NUOVA ## Restituisce il numero di giorni che vanno dalla data di liquidazione alla data della cedola successiva
+COUPNCD = DATA.CED.SUCC ## Restituisce un numero che rappresenta la data della cedola successiva alla data di liquidazione
+COUPNUM = NUM.CED ## Restituisce il numero di cedole pagabili fra la data di liquidazione e la data di scadenza
+COUPPCD = DATA.CED.PREC ## Restituisce un numero che rappresenta la data della cedola precedente alla data di liquidazione
+CUMIPMT = INT.CUMUL ## Restituisce l'interesse cumulativo pagato fra due periodi
+CUMPRINC = CAP.CUM ## Restituisce il capitale cumulativo pagato per estinguere un debito fra due periodi
+DB = DB ## Restituisce l'ammortamento di un bene per un periodo specificato utilizzando il metodo di ammortamento a quote fisse decrescenti
+DDB = AMMORT ## Restituisce l'ammortamento di un bene per un periodo specificato utilizzando il metodo di ammortamento a doppie quote decrescenti o altri metodi specificati
+DISC = TASSO.SCONTO ## Restituisce il tasso di sconto per un titolo
+DOLLARDE = VALUTA.DEC ## Converte un prezzo valuta, espresso come frazione, in prezzo valuta, espresso come numero decimale
+DOLLARFR = VALUTA.FRAZ ## Converte un prezzo valuta, espresso come numero decimale, in prezzo valuta, espresso come frazione
+DURATION = DURATA ## Restituisce la durata annuale di un titolo con i pagamenti di interesse periodico
+EFFECT = EFFETTIVO ## Restituisce l'effettivo tasso di interesse annuo
+FV = VAL.FUT ## Restituisce il valore futuro di un investimento
+FVSCHEDULE = VAL.FUT.CAPITALE ## Restituisce il valore futuro di un capitale iniziale dopo aver applicato una serie di tassi di interesse composti
+INTRATE = TASSO.INT ## Restituisce il tasso di interesse per un titolo interamente investito
+IPMT = INTERESSI ## Restituisce il valore degli interessi per un investimento relativo a un periodo specifico
+IRR = TIR.COST ## Restituisce il tasso di rendimento interno per una serie di flussi di cassa
+ISPMT = INTERESSE.RATA ## Calcola l'interesse di un investimento pagato durante un periodo specifico
+MDURATION = DURATA.M ## Restituisce la durata Macauley modificata per un titolo con un valore presunto di € 100
+MIRR = TIR.VAR ## Restituisce il tasso di rendimento interno in cui i flussi di cassa positivi e negativi sono finanziati a tassi differenti
+NOMINAL = NOMINALE ## Restituisce il tasso di interesse nominale annuale
+NPER = NUM.RATE ## Restituisce un numero di periodi relativi a un investimento
+NPV = VAN ## Restituisce il valore attuale netto di un investimento basato su una serie di flussi di cassa periodici e sul tasso di sconto
+ODDFPRICE = PREZZO.PRIMO.IRR ## Restituisce il prezzo di un titolo dal valore nominale di € 100 avente il primo periodo di durata irregolare
+ODDFYIELD = REND.PRIMO.IRR ## Restituisce il rendimento di un titolo avente il primo periodo di durata irregolare
+ODDLPRICE = PREZZO.ULTIMO.IRR ## Restituisce il prezzo di un titolo dal valore nominale di € 100 avente l'ultimo periodo di durata irregolare
+ODDLYIELD = REND.ULTIMO.IRR ## Restituisce il rendimento di un titolo avente l'ultimo periodo di durata irregolare
+PMT = RATA ## Restituisce il pagamento periodico di una rendita annua
+PPMT = P.RATA ## Restituisce il pagamento sul capitale di un investimento per un dato periodo
+PRICE = PREZZO ## Restituisce il prezzo di un titolo dal valore nominale di € 100 che paga interessi periodici
+PRICEDISC = PREZZO.SCONT ## Restituisce il prezzo di un titolo scontato dal valore nominale di € 100
+PRICEMAT = PREZZO.SCAD ## Restituisce il prezzo di un titolo dal valore nominale di € 100 che paga gli interessi alla scadenza
+PV = VA ## Restituisce il valore attuale di un investimento
+RATE = TASSO ## Restituisce il tasso di interesse per un periodo di un'annualità
+RECEIVED = RICEV.SCAD ## Restituisce l'ammontare ricevuto alla scadenza di un titolo interamente investito
+SLN = AMMORT.COST ## Restituisce l'ammortamento a quote costanti di un bene per un singolo periodo
+SYD = AMMORT.ANNUO ## Restituisce l'ammortamento a somma degli anni di un bene per un periodo specificato
+TBILLEQ = BOT.EQUIV ## Restituisce il rendimento equivalente ad un'obbligazione per un Buono ordinario del Tesoro
+TBILLPRICE = BOT.PREZZO ## Restituisce il prezzo di un Buono del Tesoro dal valore nominale di € 100
+TBILLYIELD = BOT.REND ## Restituisce il rendimento di un Buono del Tesoro
+VDB = AMMORT.VAR ## Restituisce l'ammortamento di un bene per un periodo specificato o parziale utilizzando il metodo a doppie quote proporzionali ai valori residui
+XIRR = TIR.X ## Restituisce il tasso di rendimento interno di un impiego di flussi di cassa
+XNPV = VAN.X ## Restituisce il valore attuale netto di un impiego di flussi di cassa non necessariamente periodici
+YIELD = REND ## Restituisce il rendimento di un titolo che frutta interessi periodici
+YIELDDISC = REND.TITOLI.SCONT ## Restituisce il rendimento annuale di un titolo scontato, ad esempio un Buono del Tesoro
+YIELDMAT = REND.SCAD ## Restituisce il rendimento annuo di un titolo che paga interessi alla scadenza
+
+
+##
+## Information functions Funzioni relative alle informazioni
+##
+CELL = CELLA ## Restituisce le informazioni sulla formattazione, la posizione o i contenuti di una cella
+ERROR.TYPE = ERRORE.TIPO ## Restituisce un numero che corrisponde a un tipo di errore
+INFO = INFO ## Restituisce le informazioni sull'ambiente operativo corrente
+ISBLANK = VAL.VUOTO ## Restituisce VERO se il valore è vuoto
+ISERR = VAL.ERR ## Restituisce VERO se il valore è un valore di errore qualsiasi tranne #N/D
+ISERROR = VAL.ERRORE ## Restituisce VERO se il valore è un valore di errore qualsiasi
+ISEVEN = VAL.PARI ## Restituisce VERO se il numero è pari
+ISLOGICAL = VAL.LOGICO ## Restituisce VERO se il valore è un valore logico
+ISNA = VAL.NON.DISP ## Restituisce VERO se il valore è un valore di errore #N/D
+ISNONTEXT = VAL.NON.TESTO ## Restituisce VERO se il valore non è in formato testo
+ISNUMBER = VAL.NUMERO ## Restituisce VERO se il valore è un numero
+ISODD = VAL.DISPARI ## Restituisce VERO se il numero è dispari
+ISREF = VAL.RIF ## Restituisce VERO se il valore è un riferimento
+ISTEXT = VAL.TESTO ## Restituisce VERO se il valore è in formato testo
+N = NUM ## Restituisce un valore convertito in numero
+NA = NON.DISP ## Restituisce il valore di errore #N/D
+TYPE = TIPO ## Restituisce un numero che indica il tipo di dati relativi a un valore
+
+
+##
+## Logical functions Funzioni logiche
+##
+AND = E ## Restituisce VERO se tutti gli argomenti sono VERO
+FALSE = FALSO ## Restituisce il valore logico FALSO
+IF = SE ## Specifica un test logico da eseguire
+IFERROR = SE.ERRORE ## Restituisce un valore specificato se una formula fornisce un errore come risultato; in caso contrario, restituisce il risultato della formula
+NOT = NON ## Inverte la logica degli argomenti
+OR = O ## Restituisce VERO se un argomento qualsiasi è VERO
+TRUE = VERO ## Restituisce il valore logico VERO
+
+
+##
+## Lookup and reference functions Funzioni di ricerca e di riferimento
+##
+ADDRESS = INDIRIZZO ## Restituisce un riferimento come testo in una singola cella di un foglio di lavoro
+AREAS = AREE ## Restituisce il numero di aree in un riferimento
+CHOOSE = SCEGLI ## Sceglie un valore da un elenco di valori
+COLUMN = RIF.COLONNA ## Restituisce il numero di colonna di un riferimento
+COLUMNS = COLONNE ## Restituisce il numero di colonne in un riferimento
+HLOOKUP = CERCA.ORIZZ ## Effettua una ricerca nella riga superiore di una matrice e restituisce il valore della cella specificata
+HYPERLINK = COLLEG.IPERTESTUALE ## Crea un collegamento che apre un documento memorizzato in un server di rete, una rete Intranet o Internet
+INDEX = INDICE ## Utilizza un indice per scegliere un valore da un riferimento o da una matrice
+INDIRECT = INDIRETTO ## Restituisce un riferimento specificato da un valore testo
+LOOKUP = CERCA ## Ricerca i valori in un vettore o in una matrice
+MATCH = CONFRONTA ## Ricerca i valori in un riferimento o in una matrice
+OFFSET = SCARTO ## Restituisce uno scarto di riferimento da un riferimento dato
+ROW = RIF.RIGA ## Restituisce il numero di riga di un riferimento
+ROWS = RIGHE ## Restituisce il numero delle righe in un riferimento
+RTD = DATITEMPOREALE ## Recupera dati in tempo reale da un programma che supporta l'automazione COM (automazione: Metodo per utilizzare gli oggetti di un'applicazione da un'altra applicazione o da un altro strumento di sviluppo. Precedentemente nota come automazione OLE, l'automazione è uno standard del settore e una caratteristica del modello COM (Component Object Model).)
+TRANSPOSE = MATR.TRASPOSTA ## Restituisce la trasposizione di una matrice
+VLOOKUP = CERCA.VERT ## Effettua una ricerca nella prima colonna di una matrice e si sposta attraverso la riga per restituire il valore di una cella
+
+
+##
+## Math and trigonometry functions Funzioni matematiche e trigonometriche
+##
+ABS = ASS ## Restituisce il valore assoluto di un numero.
+ACOS = ARCCOS ## Restituisce l'arcocoseno di un numero
+ACOSH = ARCCOSH ## Restituisce l'inverso del coseno iperbolico di un numero
+ASIN = ARCSEN ## Restituisce l'arcoseno di un numero
+ASINH = ARCSENH ## Restituisce l'inverso del seno iperbolico di un numero
+ATAN = ARCTAN ## Restituisce l'arcotangente di un numero
+ATAN2 = ARCTAN.2 ## Restituisce l'arcotangente delle coordinate x e y specificate
+ATANH = ARCTANH ## Restituisce l'inverso della tangente iperbolica di un numero
+CEILING = ARROTONDA.ECCESSO ## Arrotonda un numero per eccesso all'intero più vicino o al multiplo più vicino a peso
+COMBIN = COMBINAZIONE ## Restituisce il numero di combinazioni possibili per un numero assegnato di elementi
+COS = COS ## Restituisce il coseno dell'angolo specificato
+COSH = COSH ## Restituisce il coseno iperbolico di un numero
+DEGREES = GRADI ## Converte i radianti in gradi
+EVEN = PARI ## Arrotonda il valore assoluto di un numero per eccesso al più vicino intero pari
+EXP = ESP ## Restituisce il numero e elevato alla potenza di num
+FACT = FATTORIALE ## Restituisce il fattoriale di un numero
+FACTDOUBLE = FATT.DOPPIO ## Restituisce il fattoriale doppio di un numero
+FLOOR = ARROTONDA.DIFETTO ## Arrotonda un numero per difetto al multiplo più vicino a zero
+GCD = MCD ## Restituisce il massimo comune divisore
+INT = INT ## Arrotonda un numero per difetto al numero intero più vicino
+LCM = MCM ## Restituisce il minimo comune multiplo
+LN = LN ## Restituisce il logaritmo naturale di un numero
+LOG = LOG ## Restituisce il logaritmo di un numero in una specificata base
+LOG10 = LOG10 ## Restituisce il logaritmo in base 10 di un numero
+MDETERM = MATR.DETERM ## Restituisce il determinante di una matrice
+MINVERSE = MATR.INVERSA ## Restituisce l'inverso di una matrice
+MMULT = MATR.PRODOTTO ## Restituisce il prodotto di due matrici
+MOD = RESTO ## Restituisce il resto della divisione
+MROUND = ARROTONDA.MULTIPLO ## Restituisce un numero arrotondato al multiplo desiderato
+MULTINOMIAL = MULTINOMIALE ## Restituisce il multinomiale di un insieme di numeri
+ODD = DISPARI ## Arrotonda un numero per eccesso al più vicino intero dispari
+PI = PI.GRECO ## Restituisce il valore di pi greco
+POWER = POTENZA ## Restituisce il risultato di un numero elevato a potenza
+PRODUCT = PRODOTTO ## Moltiplica i suoi argomenti
+QUOTIENT = QUOZIENTE ## Restituisce la parte intera di una divisione
+RADIANS = RADIANTI ## Converte i gradi in radianti
+RAND = CASUALE ## Restituisce un numero casuale compreso tra 0 e 1
+RANDBETWEEN = CASUALE.TRA ## Restituisce un numero casuale compreso tra i numeri specificati
+ROMAN = ROMANO ## Restituisce il numero come numero romano sotto forma di testo
+ROUND = ARROTONDA ## Arrotonda il numero al numero di cifre specificato
+ROUNDDOWN = ARROTONDA.PER.DIF ## Arrotonda il valore assoluto di un numero per difetto
+ROUNDUP = ARROTONDA.PER.ECC ## Arrotonda il valore assoluto di un numero per eccesso
+SERIESSUM = SOMMA.SERIE ## Restituisce la somma di una serie di potenze in base alla formula
+SIGN = SEGNO ## Restituisce il segno di un numero
+SIN = SEN ## Restituisce il seno di un dato angolo
+SINH = SENH ## Restituisce il seno iperbolico di un numero
+SQRT = RADQ ## Restituisce una radice quadrata
+SQRTPI = RADQ.PI.GRECO ## Restituisce la radice quadrata di un numero (numero * pi greco)
+SUBTOTAL = SUBTOTALE ## Restituisce un subtotale in un elenco o in un database
+SUM = SOMMA ## Somma i suoi argomenti
+SUMIF = SOMMA.SE ## Somma le celle specificate da un dato criterio
+SUMIFS = SOMMA.PIÙ.SE ## Somma le celle in un intervallo che soddisfano più criteri
+SUMPRODUCT = MATR.SOMMA.PRODOTTO ## Restituisce la somma dei prodotti dei componenti corrispondenti della matrice
+SUMSQ = SOMMA.Q ## Restituisce la somma dei quadrati degli argomenti
+SUMX2MY2 = SOMMA.DIFF.Q ## Restituisce la somma della differenza dei quadrati dei corrispondenti elementi in due matrici
+SUMX2PY2 = SOMMA.SOMMA.Q ## Restituisce la somma della somma dei quadrati dei corrispondenti elementi in due matrici
+SUMXMY2 = SOMMA.Q.DIFF ## Restituisce la somma dei quadrati delle differenze dei corrispondenti elementi in due matrici
+TAN = TAN ## Restituisce la tangente di un numero
+TANH = TANH ## Restituisce la tangente iperbolica di un numero
+TRUNC = TRONCA ## Tronca la parte decimale di un numero
+
+
+##
+## Statistical functions Funzioni statistiche
+##
+AVEDEV = MEDIA.DEV ## Restituisce la media delle deviazioni assolute delle coordinate rispetto alla loro media
+AVERAGE = MEDIA ## Restituisce la media degli argomenti
+AVERAGEA = MEDIA.VALORI ## Restituisce la media degli argomenti, inclusi i numeri, il testo e i valori logici
+AVERAGEIF = MEDIA.SE ## Restituisce la media aritmetica di tutte le celle in un intervallo che soddisfano un determinato criterio
+AVERAGEIFS = MEDIA.PIÙ.SE ## Restituisce la media aritmetica di tutte le celle che soddisfano più criteri
+BETADIST = DISTRIB.BETA ## Restituisce la funzione di distribuzione cumulativa beta
+BETAINV = INV.BETA ## Restituisce l'inverso della funzione di distribuzione cumulativa per una distribuzione beta specificata
+BINOMDIST = DISTRIB.BINOM ## Restituisce la distribuzione binomiale per il termine individuale
+CHIDIST = DISTRIB.CHI ## Restituisce la probabilità a una coda per la distribuzione del chi quadrato
+CHIINV = INV.CHI ## Restituisce l'inverso della probabilità ad una coda per la distribuzione del chi quadrato
+CHITEST = TEST.CHI ## Restituisce il test per l'indipendenza
+CONFIDENCE = CONFIDENZA ## Restituisce l'intervallo di confidenza per una popolazione
+CORREL = CORRELAZIONE ## Restituisce il coefficiente di correlazione tra due insiemi di dati
+COUNT = CONTA.NUMERI ## Conta la quantità di numeri nell'elenco di argomenti
+COUNTA = CONTA.VALORI ## Conta il numero di valori nell'elenco di argomenti
+COUNTBLANK = CONTA.VUOTE ## Conta il numero di celle vuote all'interno di un intervallo
+COUNTIF = CONTA.SE ## Conta il numero di celle all'interno di un intervallo che soddisfa i criteri specificati
+COUNTIFS = CONTA.PIÙ.SE ## Conta il numero di celle in un intervallo che soddisfano più criteri.
+COVAR = COVARIANZA ## Calcola la covarianza, la media dei prodotti delle deviazioni accoppiate
+CRITBINOM = CRIT.BINOM ## Restituisce il più piccolo valore per il quale la distribuzione cumulativa binomiale risulta maggiore o uguale ad un valore di criterio
+DEVSQ = DEV.Q ## Restituisce la somma dei quadrati delle deviazioni
+EXPONDIST = DISTRIB.EXP ## Restituisce la distribuzione esponenziale
+FDIST = DISTRIB.F ## Restituisce la distribuzione di probabilità F
+FINV = INV.F ## Restituisce l'inverso della distribuzione della probabilità F
+FISHER = FISHER ## Restituisce la trasformazione di Fisher
+FISHERINV = INV.FISHER ## Restituisce l'inverso della trasformazione di Fisher
+FORECAST = PREVISIONE ## Restituisce i valori lungo una tendenza lineare
+FREQUENCY = FREQUENZA ## Restituisce la distribuzione di frequenza come matrice verticale
+FTEST = TEST.F ## Restituisce il risultato di un test F
+GAMMADIST = DISTRIB.GAMMA ## Restituisce la distribuzione gamma
+GAMMAINV = INV.GAMMA ## Restituisce l'inverso della distribuzione cumulativa gamma
+GAMMALN = LN.GAMMA ## Restituisce il logaritmo naturale della funzione gamma, G(x)
+GEOMEAN = MEDIA.GEOMETRICA ## Restituisce la media geometrica
+GROWTH = CRESCITA ## Restituisce i valori lungo una linea di tendenza esponenziale
+HARMEAN = MEDIA.ARMONICA ## Restituisce la media armonica
+HYPGEOMDIST = DISTRIB.IPERGEOM ## Restituisce la distribuzione ipergeometrica
+INTERCEPT = INTERCETTA ## Restituisce l'intercetta della retta di regressione lineare
+KURT = CURTOSI ## Restituisce la curtosi di un insieme di dati
+LARGE = GRANDE ## Restituisce il k-esimo valore più grande in un insieme di dati
+LINEST = REGR.LIN ## Restituisce i parametri di una tendenza lineare
+LOGEST = REGR.LOG ## Restituisce i parametri di una linea di tendenza esponenziale
+LOGINV = INV.LOGNORM ## Restituisce l'inverso di una distribuzione lognormale
+LOGNORMDIST = DISTRIB.LOGNORM ## Restituisce la distribuzione lognormale cumulativa
+MAX = MAX ## Restituisce il valore massimo in un elenco di argomenti
+MAXA = MAX.VALORI ## Restituisce il valore massimo in un elenco di argomenti, inclusi i numeri, il testo e i valori logici
+MEDIAN = MEDIANA ## Restituisce la mediana dei numeri specificati
+MIN = MIN ## Restituisce il valore minimo in un elenco di argomenti
+MINA = MIN.VALORI ## Restituisce il più piccolo valore in un elenco di argomenti, inclusi i numeri, il testo e i valori logici
+MODE = MODA ## Restituisce il valore più comune in un insieme di dati
+NEGBINOMDIST = DISTRIB.BINOM.NEG ## Restituisce la distribuzione binomiale negativa
+NORMDIST = DISTRIB.NORM ## Restituisce la distribuzione cumulativa normale
+NORMINV = INV.NORM ## Restituisce l'inverso della distribuzione cumulativa normale standard
+NORMSDIST = DISTRIB.NORM.ST ## Restituisce la distribuzione cumulativa normale standard
+NORMSINV = INV.NORM.ST ## Restituisce l'inverso della distribuzione cumulativa normale
+PEARSON = PEARSON ## Restituisce il coefficiente del momento di correlazione di Pearson
+PERCENTILE = PERCENTILE ## Restituisce il k-esimo dato percentile di valori in un intervallo
+PERCENTRANK = PERCENT.RANGO ## Restituisce il rango di un valore in un insieme di dati come percentuale
+PERMUT = PERMUTAZIONE ## Restituisce il numero delle permutazioni per un determinato numero di oggetti
+POISSON = POISSON ## Restituisce la distribuzione di Poisson
+PROB = PROBABILITÀ ## Calcola la probabilità che dei valori in un intervallo siano compresi tra due limiti
+QUARTILE = QUARTILE ## Restituisce il quartile di un insieme di dati
+RANK = RANGO ## Restituisce il rango di un numero in un elenco di numeri
+RSQ = RQ ## Restituisce la radice quadrata del coefficiente di momento di correlazione di Pearson
+SKEW = ASIMMETRIA ## Restituisce il grado di asimmetria di una distribuzione
+SLOPE = PENDENZA ## Restituisce la pendenza di una retta di regressione lineare
+SMALL = PICCOLO ## Restituisce il k-esimo valore più piccolo in un insieme di dati
+STANDARDIZE = NORMALIZZA ## Restituisce un valore normalizzato
+STDEV = DEV.ST ## Restituisce una stima della deviazione standard sulla base di un campione
+STDEVA = DEV.ST.VALORI ## Restituisce una stima della deviazione standard sulla base di un campione, inclusi i numeri, il testo e i valori logici
+STDEVP = DEV.ST.POP ## Calcola la deviazione standard sulla base di un'intera popolazione
+STDEVPA = DEV.ST.POP.VALORI ## Calcola la deviazione standard sulla base sull'intera popolazione, inclusi i numeri, il testo e i valori logici
+STEYX = ERR.STD.YX ## Restituisce l'errore standard del valore previsto per y per ogni valore x nella regressione
+TDIST = DISTRIB.T ## Restituisce la distribuzione t di Student
+TINV = INV.T ## Restituisce l'inversa della distribuzione t di Student
+TREND = TENDENZA ## Restituisce i valori lungo una linea di tendenza lineare
+TRIMMEAN = MEDIA.TRONCATA ## Restituisce la media della parte interna di un insieme di dati
+TTEST = TEST.T ## Restituisce la probabilità associata ad un test t di Student
+VAR = VAR ## Stima la varianza sulla base di un campione
+VARA = VAR.VALORI ## Stima la varianza sulla base di un campione, inclusi i numeri, il testo e i valori logici
+VARP = VAR.POP ## Calcola la varianza sulla base dell'intera popolazione
+VARPA = VAR.POP.VALORI ## Calcola la deviazione standard sulla base sull'intera popolazione, inclusi i numeri, il testo e i valori logici
+WEIBULL = WEIBULL ## Restituisce la distribuzione di Weibull
+ZTEST = TEST.Z ## Restituisce il valore di probabilità a una coda per un test z
+
+
+##
+## Text functions Funzioni di testo
+##
+ASC = ASC ## Modifica le lettere inglesi o il katakana a doppio byte all'interno di una stringa di caratteri in caratteri a singolo byte
+BAHTTEXT = BAHTTESTO ## Converte un numero in testo, utilizzando il formato valuta ß (baht)
+CHAR = CODICE.CARATT ## Restituisce il carattere specificato dal numero di codice
+CLEAN = LIBERA ## Elimina dal testo tutti i caratteri che non è possibile stampare
+CODE = CODICE ## Restituisce il codice numerico del primo carattere di una stringa di testo
+CONCATENATE = CONCATENA ## Unisce diversi elementi di testo in un unico elemento di testo
+DOLLAR = VALUTA ## Converte un numero in testo, utilizzando il formato valuta € (euro)
+EXACT = IDENTICO ## Verifica se due valori di testo sono uguali
+FIND = TROVA ## Rileva un valore di testo all'interno di un altro (distinzione tra maiuscole e minuscole)
+FINDB = TROVA.B ## Rileva un valore di testo all'interno di un altro (distinzione tra maiuscole e minuscole)
+FIXED = FISSO ## Formatta un numero come testo con un numero fisso di decimali
+JIS = ORDINAMENTO.JIS ## Modifica le lettere inglesi o i caratteri katakana a byte singolo all'interno di una stringa di caratteri in caratteri a byte doppio.
+LEFT = SINISTRA ## Restituisce il carattere più a sinistra di un valore di testo
+LEFTB = SINISTRA.B ## Restituisce il carattere più a sinistra di un valore di testo
+LEN = LUNGHEZZA ## Restituisce il numero di caratteri di una stringa di testo
+LENB = LUNB ## Restituisce il numero di caratteri di una stringa di testo
+LOWER = MINUSC ## Converte il testo in lettere minuscole
+MID = MEDIA ## Restituisce un numero specifico di caratteri di una stringa di testo a partire dalla posizione specificata
+MIDB = MEDIA.B ## Restituisce un numero specifico di caratteri di una stringa di testo a partire dalla posizione specificata
+PHONETIC = FURIGANA ## Estrae i caratteri fonetici (furigana) da una stringa di testo.
+PROPER = MAIUSC.INIZ ## Converte in maiuscolo la prima lettera di ogni parola di un valore di testo
+REPLACE = RIMPIAZZA ## Sostituisce i caratteri all'interno di un testo
+REPLACEB = SOSTITUISCI.B ## Sostituisce i caratteri all'interno di un testo
+REPT = RIPETI ## Ripete un testo per un dato numero di volte
+RIGHT = DESTRA ## Restituisce il carattere più a destra di un valore di testo
+RIGHTB = DESTRA.B ## Restituisce il carattere più a destra di un valore di testo
+SEARCH = RICERCA ## Rileva un valore di testo all'interno di un altro (non è sensibile alle maiuscole e minuscole)
+SEARCHB = CERCA.B ## Rileva un valore di testo all'interno di un altro (non è sensibile alle maiuscole e minuscole)
+SUBSTITUTE = SOSTITUISCI ## Sostituisce il nuovo testo al testo contenuto in una stringa
+T = T ## Converte gli argomenti in testo
+TEXT = TESTO ## Formatta un numero e lo converte in testo
+TRIM = ANNULLA.SPAZI ## Elimina gli spazi dal testo
+UPPER = MAIUSC ## Converte il testo in lettere maiuscole
+VALUE = VALORE ## Converte un argomento di testo in numero
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/nl/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/nl/config
new file mode 100644
index 00000000000..8376022d1c1
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/nl/config
@@ -0,0 +1,24 @@
+##
+## PhpSpreadsheet
+##
+
+ArgumentSeparator = ;
+
+
+##
+## (For future use)
+##
+currencySymbol = €
+
+
+##
+## Excel Error Codes (For future use)
+
+##
+NULL = #LEEG!
+DIV0 = #DEEL/0!
+VALUE = #WAARDE!
+REF = #VERW!
+NAME = #NAAM?
+NUM = #GETAL!
+NA = #N/B
diff --git a/lib/phpexcel/PHPExcel/locale/nl/functions b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/nl/functions
similarity index 95%
rename from lib/phpexcel/PHPExcel/locale/nl/functions
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/nl/functions
index 573600aca45..2518f421672 100644
--- a/lib/phpexcel/PHPExcel/locale/nl/functions
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/nl/functions
@@ -1,438 +1,416 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Calculation
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/
-##
-##
-
-
-##
-## Add-in and Automation functions Automatiseringsfuncties en functies in invoegtoepassingen
-##
-GETPIVOTDATA = DRAAITABEL.OPHALEN ## Geeft gegevens uit een draaitabelrapport als resultaat
-
-
-##
-## Cube functions Kubusfuncties
-##
-CUBEKPIMEMBER = KUBUSKPILID ## Retourneert de naam, eigenschap en waarde van een KPI (prestatie-indicator) en geeft de naam en de eigenschap in de cel weer. Een KPI is een meetbare waarde, zoals de maandelijkse brutowinst of de omzet per kwartaal per werknemer, die wordt gebruikt om de prestaties van een organisatie te bewaken
-CUBEMEMBER = KUBUSLID ## Retourneert een lid of tupel in een kubushiërarchie. Wordt gebruikt om te controleren of het lid of de tupel in de kubus aanwezig is
-CUBEMEMBERPROPERTY = KUBUSLIDEIGENSCHAP ## Retourneert de waarde van een lideigenschap in de kubus. Wordt gebruikt om te controleren of de lidnaam in de kubus bestaat en retourneert de opgegeven eigenschap voor dit lid
-CUBERANKEDMEMBER = KUBUSGERANGCHIKTLID ## Retourneert het zoveelste, gerangschikte lid in een set. Wordt gebruikt om een of meer elementen in een set te retourneren, zoals de tien beste verkopers of de tien beste studenten
-CUBESET = KUBUSSET ## Definieert een berekende set leden of tupels door een ingestelde expressie naar de kubus op de server te sturen, alwaar de set wordt gemaakt en vervolgens wordt geretourneerd naar Microsoft Office Excel
-CUBESETCOUNT = KUBUSSETAANTAL ## Retourneert het aantal onderdelen in een set
-CUBEVALUE = KUBUSWAARDE ## Retourneert een samengestelde waarde van een kubus
-
-
-##
-## Database functions Databasefuncties
-##
-DAVERAGE = DBGEMIDDELDE ## Berekent de gemiddelde waarde in geselecteerde databasegegevens
-DCOUNT = DBAANTAL ## Telt de cellen met getallen in een database
-DCOUNTA = DBAANTALC ## Telt de niet-lege cellen in een database
-DGET = DBLEZEN ## Retourneert één record dat voldoet aan de opgegeven criteria uit een database
-DMAX = DBMAX ## Retourneert de maximumwaarde in de geselecteerde databasegegevens
-DMIN = DBMIN ## Retourneert de minimumwaarde in de geselecteerde databasegegevens
-DPRODUCT = DBPRODUCT ## Vermenigvuldigt de waarden in een bepaald veld van de records die voldoen aan de criteria in een database
-DSTDEV = DBSTDEV ## Maakt een schatting van de standaarddeviatie op basis van een steekproef uit geselecteerde databasegegevens
-DSTDEVP = DBSTDEVP ## Berekent de standaarddeviatie op basis van de volledige populatie van geselecteerde databasegegevens
-DSUM = DBSOM ## Telt de getallen uit een kolom records in de database op die voldoen aan de criteria
-DVAR = DBVAR ## Maakt een schatting van de variantie op basis van een steekproef uit geselecteerde databasegegevens
-DVARP = DBVARP ## Berekent de variantie op basis van de volledige populatie van geselecteerde databasegegevens
-
-
-##
-## Date and time functions Datum- en tijdfuncties
-##
-DATE = DATUM ## Geeft als resultaat het seriële getal van een opgegeven datum
-DATEVALUE = DATUMWAARDE ## Converteert een datum in de vorm van tekst naar een serieel getal
-DAY = DAG ## Converteert een serieel getal naar een dag van de maand
-DAYS360 = DAGEN360 ## Berekent het aantal dagen tussen twee datums op basis van een jaar met 360 dagen
-EDATE = ZELFDE.DAG ## Geeft als resultaat het seriële getal van een datum die het opgegeven aantal maanden voor of na de begindatum ligt
-EOMONTH = LAATSTE.DAG ## Geeft als resultaat het seriële getal van de laatste dag van de maand voor of na het opgegeven aantal maanden
-HOUR = UUR ## Converteert een serieel getal naar uren
-MINUTE = MINUUT ## Converteert een serieel naar getal minuten
-MONTH = MAAND ## Converteert een serieel getal naar een maand
-NETWORKDAYS = NETTO.WERKDAGEN ## Geeft als resultaat het aantal hele werkdagen tussen twee datums
-NOW = NU ## Geeft als resultaat het seriële getal van de huidige datum en tijd
-SECOND = SECONDE ## Converteert een serieel getal naar seconden
-TIME = TIJD ## Geeft als resultaat het seriële getal van een bepaald tijdstip
-TIMEVALUE = TIJDWAARDE ## Converteert de tijd in de vorm van tekst naar een serieel getal
-TODAY = VANDAAG ## Geeft als resultaat het seriële getal van de huidige datum
-WEEKDAY = WEEKDAG ## Converteert een serieel getal naar een weekdag
-WEEKNUM = WEEKNUMMER ## Converteert een serieel getal naar een weeknummer
-WORKDAY = WERKDAG ## Geeft als resultaat het seriële getal van de datum voor of na een bepaald aantal werkdagen
-YEAR = JAAR ## Converteert een serieel getal naar een jaar
-YEARFRAC = JAAR.DEEL ## Geeft als resultaat het gedeelte van het jaar, uitgedrukt in het aantal hele dagen tussen begindatum en einddatum
-
-
-##
-## Engineering functions Technische functies
-##
-BESSELI = BESSEL.Y ## Geeft als resultaat de gewijzigde Bessel-functie In(x)
-BESSELJ = BESSEL.J ## Geeft als resultaat de Bessel-functie Jn(x)
-BESSELK = BESSEL.K ## Geeft als resultaat de gewijzigde Bessel-functie Kn(x)
-BESSELY = BESSEL.Y ## Geeft als resultaat de gewijzigde Bessel-functie Yn(x)
-BIN2DEC = BIN.N.DEC ## Converteert een binair getal naar een decimaal getal
-BIN2HEX = BIN.N.HEX ## Converteert een binair getal naar een hexadecimaal getal
-BIN2OCT = BIN.N.OCT ## Converteert een binair getal naar een octaal getal
-COMPLEX = COMPLEX ## Converteert reële en imaginaire coëfficiënten naar een complex getal
-CONVERT = CONVERTEREN ## Converteert een getal in de ene maateenheid naar een getal in een andere maateenheid
-DEC2BIN = DEC.N.BIN ## Converteert een decimaal getal naar een binair getal
-DEC2HEX = DEC.N.HEX ## Converteert een decimaal getal naar een hexadecimaal getal
-DEC2OCT = DEC.N.OCT ## Converteert een decimaal getal naar een octaal getal
-DELTA = DELTA ## Test of twee waarden gelijk zijn
-ERF = FOUTFUNCTIE ## Geeft als resultaat de foutfunctie
-ERFC = FOUT.COMPLEMENT ## Geeft als resultaat de complementaire foutfunctie
-GESTEP = GROTER.DAN ## Test of een getal groter is dan de drempelwaarde
-HEX2BIN = HEX.N.BIN ## Converteert een hexadecimaal getal naar een binair getal
-HEX2DEC = HEX.N.DEC ## Converteert een hexadecimaal getal naar een decimaal getal
-HEX2OCT = HEX.N.OCT ## Converteert een hexadecimaal getal naar een octaal getal
-IMABS = C.ABS ## Geeft als resultaat de absolute waarde (modulus) van een complex getal
-IMAGINARY = C.IM.DEEL ## Geeft als resultaat de imaginaire coëfficiënt van een complex getal
-IMARGUMENT = C.ARGUMENT ## Geeft als resultaat het argument thèta, een hoek uitgedrukt in radialen
-IMCONJUGATE = C.TOEGEVOEGD ## Geeft als resultaat het complexe toegevoegde getal van een complex getal
-IMCOS = C.COS ## Geeft als resultaat de cosinus van een complex getal
-IMDIV = C.QUOTIENT ## Geeft als resultaat het quotiënt van twee complexe getallen
-IMEXP = C.EXP ## Geeft als resultaat de exponent van een complex getal
-IMLN = C.LN ## Geeft als resultaat de natuurlijke logaritme van een complex getal
-IMLOG10 = C.LOG10 ## Geeft als resultaat de logaritme met grondtal 10 van een complex getal
-IMLOG2 = C.LOG2 ## Geeft als resultaat de logaritme met grondtal 2 van een complex getal
-IMPOWER = C.MACHT ## Geeft als resultaat een complex getal dat is verheven tot de macht van een geheel getal
-IMPRODUCT = C.PRODUCT ## Geeft als resultaat het product van complexe getallen
-IMREAL = C.REEEL.DEEL ## Geeft als resultaat de reële coëfficiënt van een complex getal
-IMSIN = C.SIN ## Geeft als resultaat de sinus van een complex getal
-IMSQRT = C.WORTEL ## Geeft als resultaat de vierkantswortel van een complex getal
-IMSUB = C.VERSCHIL ## Geeft als resultaat het verschil tussen twee complexe getallen
-IMSUM = C.SOM ## Geeft als resultaat de som van complexe getallen
-OCT2BIN = OCT.N.BIN ## Converteert een octaal getal naar een binair getal
-OCT2DEC = OCT.N.DEC ## Converteert een octaal getal naar een decimaal getal
-OCT2HEX = OCT.N.HEX ## Converteert een octaal getal naar een hexadecimaal getal
-
-
-##
-## Financial functions Financiële functies
-##
-ACCRINT = SAMENG.RENTE ## Berekent de opgelopen rente voor een waardepapier waarvan de rente periodiek wordt uitgekeerd
-ACCRINTM = SAMENG.RENTE.V ## Berekent de opgelopen rente voor een waardepapier waarvan de rente op de vervaldatum wordt uitgekeerd
-AMORDEGRC = AMORDEGRC ## Geeft als resultaat de afschrijving voor elke boekingsperiode door een afschrijvingscoëfficiënt toe te passen
-AMORLINC = AMORLINC ## Berekent de afschrijving voor elke boekingsperiode
-COUPDAYBS = COUP.DAGEN.BB ## Berekent het aantal dagen vanaf het begin van de coupontermijn tot de stortingsdatum
-COUPDAYS = COUP.DAGEN ## Geeft als resultaat het aantal dagen in de coupontermijn waarin de stortingsdatum valt
-COUPDAYSNC = COUP.DAGEN.VV ## Geeft als resultaat het aantal dagen vanaf de stortingsdatum tot de volgende couponvervaldatum
-COUPNCD = COUP.DATUM.NB ## Geeft als resultaat de volgende coupondatum na de stortingsdatum
-COUPNUM = COUP.AANTAL ## Geeft als resultaat het aantal coupons dat nog moet worden uitbetaald tussen de stortingsdatum en de vervaldatum
-COUPPCD = COUP.DATUM.VB ## Geeft als resultaat de vorige couponvervaldatum vóór de stortingsdatum
-CUMIPMT = CUM.RENTE ## Geeft als resultaat de cumulatieve rente die tussen twee termijnen is uitgekeerd
-CUMPRINC = CUM.HOOFDSOM ## Geeft als resultaat de cumulatieve hoofdsom van een lening die tussen twee termijnen is terugbetaald
-DB = DB ## Geeft als resultaat de afschrijving van activa voor een bepaalde periode met behulp van de 'fixed declining balance'-methode
-DDB = DDB ## Geeft als resultaat de afschrijving van activa over een bepaalde termijn met behulp van de 'double declining balance'-methode of een andere methode die u opgeeft
-DISC = DISCONTO ## Geeft als resultaat het discontopercentage voor een waardepapier
-DOLLARDE = EURO.DE ## Converteert een prijs in euro's, uitgedrukt in een breuk, naar een prijs in euro's, uitgedrukt in een decimaal getal
-DOLLARFR = EURO.BR ## Converteert een prijs in euro's, uitgedrukt in een decimaal getal, naar een prijs in euro's, uitgedrukt in een breuk
-DURATION = DUUR ## Geeft als resultaat de gewogen gemiddelde looptijd voor een waardepapier met periodieke rentebetalingen
-EFFECT = EFFECT.RENTE ## Geeft als resultaat het effectieve jaarlijkse rentepercentage
-FV = TW ## Geeft als resultaat de toekomstige waarde van een investering
-FVSCHEDULE = TOEK.WAARDE2 ## Geeft als resultaat de toekomstige waarde van een bepaalde hoofdsom na het toepassen van een reeks samengestelde rentepercentages
-INTRATE = RENTEPERCENTAGE ## Geeft als resultaat het rentepercentage voor een volgestort waardepapier
-IPMT = IBET ## Geeft als resultaat de te betalen rente voor een investering over een bepaalde termijn
-IRR = IR ## Geeft als resultaat de interne rentabiliteit voor een reeks cashflows
-ISPMT = ISBET ## Geeft als resultaat de rente die is betaald tijdens een bepaalde termijn van een investering
-MDURATION = AANG.DUUR ## Geeft als resultaat de aangepaste Macauley-looptijd voor een waardepapier, aangenomen dat de nominale waarde € 100 bedraagt
-MIRR = GIR ## Geeft als resultaat de interne rentabiliteit voor een serie cashflows, waarbij voor betalingen een ander rentepercentage geldt dan voor inkomsten
-NOMINAL = NOMINALE.RENTE ## Geeft als resultaat het nominale jaarlijkse rentepercentage
-NPER = NPER ## Geeft als resultaat het aantal termijnen van een investering
-NPV = NHW ## Geeft als resultaat de netto huidige waarde van een investering op basis van een reeks periodieke cashflows en een discontopercentage
-ODDFPRICE = AFW.ET.PRIJS ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier met een afwijkende eerste termijn
-ODDFYIELD = AFW.ET.REND ## Geeft als resultaat het rendement voor een waardepapier met een afwijkende eerste termijn
-ODDLPRICE = AFW.LT.PRIJS ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier met een afwijkende laatste termijn
-ODDLYIELD = AFW.LT.REND ## Geeft als resultaat het rendement voor een waardepapier met een afwijkende laatste termijn
-PMT = BET ## Geeft als resultaat de periodieke betaling voor een annuïteit
-PPMT = PBET ## Geeft als resultaat de afbetaling op de hoofdsom voor een bepaalde termijn
-PRICE = PRIJS.NOM ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier waarvan de rente periodiek wordt uitgekeerd
-PRICEDISC = PRIJS.DISCONTO ## Geeft als resultaat de prijs per € 100 nominale waarde voor een verdisconteerd waardepapier
-PRICEMAT = PRIJS.VERVALDAG ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier waarvan de rente wordt uitgekeerd op de vervaldatum
-PV = HW ## Geeft als resultaat de huidige waarde van een investering
-RATE = RENTE ## Geeft als resultaat het periodieke rentepercentage voor een annuïteit
-RECEIVED = OPBRENGST ## Geeft als resultaat het bedrag dat op de vervaldatum wordt uitgekeerd voor een volgestort waardepapier
-SLN = LIN.AFSCHR ## Geeft als resultaat de lineaire afschrijving van activa over één termijn
-SYD = SYD ## Geeft als resultaat de afschrijving van activa over een bepaalde termijn met behulp van de 'Sum-Of-Years-Digits'-methode
-TBILLEQ = SCHATK.OBL ## Geeft als resultaat het rendement op schatkistpapier, dat op dezelfde manier wordt berekend als het rendement op obligaties
-TBILLPRICE = SCHATK.PRIJS ## Bepaalt de prijs per € 100 nominale waarde voor schatkistpapier
-TBILLYIELD = SCHATK.REND ## Berekent het rendement voor schatkistpapier
-VDB = VDB ## Geeft als resultaat de afschrijving van activa over een gehele of gedeeltelijke termijn met behulp van de 'declining balance'-methode
-XIRR = IR.SCHEMA ## Berekent de interne rentabiliteit voor een betalingsschema van cashflows
-XNPV = NHW2 ## Berekent de huidige nettowaarde voor een betalingsschema van cashflows
-YIELD = RENDEMENT ## Geeft als resultaat het rendement voor een waardepapier waarvan de rente periodiek wordt uitgekeerd
-YIELDDISC = REND.DISCONTO ## Geeft als resultaat het jaarlijkse rendement voor een verdisconteerd waardepapier, bijvoorbeeld schatkistpapier
-YIELDMAT = REND.VERVAL ## Geeft als resultaat het jaarlijkse rendement voor een waardepapier waarvan de rente wordt uitgekeerd op de vervaldatum
-
-
-##
-## Information functions Informatiefuncties
-##
-CELL = CEL ## Geeft als resultaat informatie over de opmaak, locatie of inhoud van een cel
-ERROR.TYPE = TYPE.FOUT ## Geeft als resultaat een getal dat overeenkomt met een van de foutwaarden van Microsoft Excel
-INFO = INFO ## Geeft als resultaat informatie over de huidige besturingsomgeving
-ISBLANK = ISLEEG ## Geeft als resultaat WAAR als de waarde leeg is
-ISERR = ISFOUT2 ## Geeft als resultaat WAAR als de waarde een foutwaarde is, met uitzondering van #N/B
-ISERROR = ISFOUT ## Geeft als resultaat WAAR als de waarde een foutwaarde is
-ISEVEN = IS.EVEN ## Geeft als resultaat WAAR als het getal even is
-ISLOGICAL = ISLOGISCH ## Geeft als resultaat WAAR als de waarde een logische waarde is
-ISNA = ISNB ## Geeft als resultaat WAAR als de waarde de foutwaarde #N/B is
-ISNONTEXT = ISGEENTEKST ## Geeft als resultaat WAAR als de waarde geen tekst is
-ISNUMBER = ISGETAL ## Geeft als resultaat WAAR als de waarde een getal is
-ISODD = IS.ONEVEN ## Geeft als resultaat WAAR als het getal oneven is
-ISREF = ISVERWIJZING ## Geeft als resultaat WAAR als de waarde een verwijzing is
-ISTEXT = ISTEKST ## Geeft als resultaat WAAR als de waarde tekst is
-N = N ## Geeft als resultaat een waarde die is geconverteerd naar een getal
-NA = NB ## Geeft als resultaat de foutwaarde #N/B
-TYPE = TYPE ## Geeft als resultaat een getal dat het gegevenstype van een waarde aangeeft
-
-
-##
-## Logical functions Logische functies
-##
-AND = EN ## Geeft als resultaat WAAR als alle argumenten WAAR zijn
-FALSE = ONWAAR ## Geeft als resultaat de logische waarde ONWAAR
-IF = ALS ## Geeft een logische test aan
-IFERROR = ALS.FOUT ## Retourneert een waarde die u opgeeft als een formule een fout oplevert, anders wordt het resultaat van de formule geretourneerd
-NOT = NIET ## Keert de logische waarde van het argument om
-OR = OF ## Geeft als resultaat WAAR als minimaal een van de argumenten WAAR is
-TRUE = WAAR ## Geeft als resultaat de logische waarde WAAR
-
-
-##
-## Lookup and reference functions Zoek- en verwijzingsfuncties
-##
-ADDRESS = ADRES ## Geeft als resultaat een verwijzing, in de vorm van tekst, naar één bepaalde cel in een werkblad
-AREAS = BEREIKEN ## Geeft als resultaat het aantal bereiken in een verwijzing
-CHOOSE = KIEZEN ## Kiest een waarde uit een lijst met waarden
-COLUMN = KOLOM ## Geeft als resultaat het kolomnummer van een verwijzing
-COLUMNS = KOLOMMEN ## Geeft als resultaat het aantal kolommen in een verwijzing
-HLOOKUP = HORIZ.ZOEKEN ## Zoekt in de bovenste rij van een matrix naar een bepaalde waarde en geeft als resultaat de gevonden waarde in de opgegeven cel
-HYPERLINK = HYPERLINK ## Maakt een snelkoppeling of een sprong waarmee een document wordt geopend dat is opgeslagen op een netwerkserver, een intranet of op internet
-INDEX = INDEX ## Kiest met een index een waarde uit een verwijzing of een matrix
-INDIRECT = INDIRECT ## Geeft als resultaat een verwijzing die wordt aangegeven met een tekstwaarde
-LOOKUP = ZOEKEN ## Zoekt naar bepaalde waarden in een vector of een matrix
-MATCH = VERGELIJKEN ## Zoekt naar bepaalde waarden in een verwijzing of een matrix
-OFFSET = VERSCHUIVING ## Geeft als resultaat een nieuwe verwijzing die is verschoven ten opzichte van een bepaalde verwijzing
-ROW = RIJ ## Geeft als resultaat het rijnummer van een verwijzing
-ROWS = RIJEN ## Geeft als resultaat het aantal rijen in een verwijzing
-RTD = RTG ## Haalt realtimegegevens op uit een programma dat COM-automatisering (automatisering: een methode waarmee de ene toepassing objecten van een andere toepassing of ontwikkelprogramma kan besturen. Automatisering werd vroeger OLE-automatisering genoemd. Automatisering is een industrienorm die deel uitmaakt van het Component Object Model (COM).) ondersteunt
-TRANSPOSE = TRANSPONEREN ## Geeft als resultaat de getransponeerde van een matrix
-VLOOKUP = VERT.ZOEKEN ## Zoekt in de meest linkse kolom van een matrix naar een bepaalde waarde en geeft als resultaat de waarde in de opgegeven cel
-
-
-##
-## Math and trigonometry functions Wiskundige en trigonometrische functies
-##
-ABS = ABS ## Geeft als resultaat de absolute waarde van een getal
-ACOS = BOOGCOS ## Geeft als resultaat de boogcosinus van een getal
-ACOSH = BOOGCOSH ## Geeft als resultaat de inverse cosinus hyperbolicus van een getal
-ASIN = BOOGSIN ## Geeft als resultaat de boogsinus van een getal
-ASINH = BOOGSINH ## Geeft als resultaat de inverse sinus hyperbolicus van een getal
-ATAN = BOOGTAN ## Geeft als resultaat de boogtangens van een getal
-ATAN2 = BOOGTAN2 ## Geeft als resultaat de boogtangens van de x- en y-coördinaten
-ATANH = BOOGTANH ## Geeft als resultaat de inverse tangens hyperbolicus van een getal
-CEILING = AFRONDEN.BOVEN ## Rondt de absolute waarde van een getal naar boven af op het dichtstbijzijnde gehele getal of het dichtstbijzijnde significante veelvoud
-COMBIN = COMBINATIES ## Geeft als resultaat het aantal combinaties voor een bepaald aantal objecten
-COS = COS ## Geeft als resultaat de cosinus van een getal
-COSH = COSH ## Geeft als resultaat de cosinus hyperbolicus van een getal
-DEGREES = GRADEN ## Converteert radialen naar graden
-EVEN = EVEN ## Rondt het getal af op het dichtstbijzijnde gehele even getal
-EXP = EXP ## Verheft e tot de macht van een bepaald getal
-FACT = FACULTEIT ## Geeft als resultaat de faculteit van een getal
-FACTDOUBLE = DUBBELE.FACULTEIT ## Geeft als resultaat de dubbele faculteit van een getal
-FLOOR = AFRONDEN.BENEDEN ## Rondt de absolute waarde van een getal naar beneden af
-GCD = GGD ## Geeft als resultaat de grootste gemene deler
-INT = INTEGER ## Rondt een getal naar beneden af op het dichtstbijzijnde gehele getal
-LCM = KGV ## Geeft als resultaat het kleinste gemene veelvoud
-LN = LN ## Geeft als resultaat de natuurlijke logaritme van een getal
-LOG = LOG ## Geeft als resultaat de logaritme met het opgegeven grondtal van een getal
-LOG10 = LOG10 ## Geeft als resultaat de logaritme met grondtal 10 van een getal
-MDETERM = DETERMINANTMAT ## Geeft als resultaat de determinant van een matrix
-MINVERSE = INVERSEMAT ## Geeft als resultaat de inverse van een matrix
-MMULT = PRODUCTMAT ## Geeft als resultaat het product van twee matrices
-MOD = REST ## Geeft als resultaat het restgetal van een deling
-MROUND = AFRONDEN.N.VEELVOUD ## Geeft als resultaat een getal afgerond op het gewenste veelvoud
-MULTINOMIAL = MULTINOMIAAL ## Geeft als resultaat de multinomiaalcoëfficiënt van een reeks getallen
-ODD = ONEVEN ## Rondt de absolute waarde van het getal naar boven af op het dichtstbijzijnde gehele oneven getal
-PI = PI ## Geeft als resultaat de waarde van pi
-POWER = MACHT ## Verheft een getal tot een macht
-PRODUCT = PRODUCT ## Vermenigvuldigt de argumenten met elkaar
-QUOTIENT = QUOTIENT ## Geeft als resultaat de uitkomst van een deling als geheel getal
-RADIANS = RADIALEN ## Converteert graden naar radialen
-RAND = ASELECT ## Geeft als resultaat een willekeurig getal tussen 0 en 1
-RANDBETWEEN = ASELECTTUSSEN ## Geeft een willekeurig getal tussen de getallen die u hebt opgegeven
-ROMAN = ROMEINS ## Converteert een Arabisch getal naar een Romeins getal en geeft het resultaat weer in de vorm van tekst
-ROUND = AFRONDEN ## Rondt een getal af op het opgegeven aantal decimalen
-ROUNDDOWN = AFRONDEN.NAAR.BENEDEN ## Rondt de absolute waarde van een getal naar beneden af
-ROUNDUP = AFRONDEN.NAAR.BOVEN ## Rondt de absolute waarde van een getal naar boven af
-SERIESSUM = SOM.MACHTREEKS ## Geeft als resultaat de som van een machtreeks die is gebaseerd op de formule
-SIGN = POS.NEG ## Geeft als resultaat het teken van een getal
-SIN = SIN ## Geeft als resultaat de sinus van de opgegeven hoek
-SINH = SINH ## Geeft als resultaat de sinus hyperbolicus van een getal
-SQRT = WORTEL ## Geeft als resultaat de positieve vierkantswortel van een getal
-SQRTPI = WORTEL.PI ## Geeft als resultaat de vierkantswortel van (getal * pi)
-SUBTOTAL = SUBTOTAAL ## Geeft als resultaat een subtotaal voor een bereik
-SUM = SOM ## Telt de argumenten op
-SUMIF = SOM.ALS ## Telt de getallen bij elkaar op die voldoen aan een bepaald criterium
-SUMIFS = SOMMEN.ALS ## Telt de cellen in een bereik op die aan meerdere criteria voldoen
-SUMPRODUCT = SOMPRODUCT ## Geeft als resultaat de som van de producten van de corresponderende matrixelementen
-SUMSQ = KWADRATENSOM ## Geeft als resultaat de som van de kwadraten van de argumenten
-SUMX2MY2 = SOM.X2MINY2 ## Geeft als resultaat de som van het verschil tussen de kwadraten van corresponderende waarden in twee matrices
-SUMX2PY2 = SOM.X2PLUSY2 ## Geeft als resultaat de som van de kwadratensom van corresponderende waarden in twee matrices
-SUMXMY2 = SOM.XMINY.2 ## Geeft als resultaat de som van de kwadraten van de verschillen tussen de corresponderende waarden in twee matrices
-TAN = TAN ## Geeft als resultaat de tangens van een getal
-TANH = TANH ## Geeft als resultaat de tangens hyperbolicus van een getal
-TRUNC = GEHEEL ## Kapt een getal af tot een geheel getal
-
-
-##
-## Statistical functions Statistische functies
-##
-AVEDEV = GEM.DEVIATIE ## Geeft als resultaat het gemiddelde van de absolute deviaties van gegevenspunten ten opzichte van hun gemiddelde waarde
-AVERAGE = GEMIDDELDE ## Geeft als resultaat het gemiddelde van de argumenten
-AVERAGEA = GEMIDDELDEA ## Geeft als resultaat het gemiddelde van de argumenten, inclusief getallen, tekst en logische waarden
-AVERAGEIF = GEMIDDELDE.ALS ## Geeft het gemiddelde (rekenkundig gemiddelde) als resultaat van alle cellen in een bereik die voldoen aan de opgegeven criteria
-AVERAGEIFS = GEMIDDELDEN.ALS ## Geeft het gemiddelde (rekenkundig gemiddelde) als resultaat van alle cellen die aan meerdere criteria voldoen
-BETADIST = BETA.VERD ## Geeft als resultaat de cumulatieve bèta-verdelingsfunctie
-BETAINV = BETA.INV ## Geeft als resultaat de inverse van de cumulatieve verdelingsfunctie voor een gegeven bèta-verdeling
-BINOMDIST = BINOMIALE.VERD ## Geeft als resultaat de binomiale verdeling
-CHIDIST = CHI.KWADRAAT ## Geeft als resultaat de eenzijdige kans van de chi-kwadraatverdeling
-CHIINV = CHI.KWADRAAT.INV ## Geeft als resultaat de inverse van een eenzijdige kans van de chi-kwadraatverdeling
-CHITEST = CHI.TOETS ## Geeft als resultaat de onafhankelijkheidstoets
-CONFIDENCE = BETROUWBAARHEID ## Geeft als resultaat het betrouwbaarheidsinterval van een gemiddelde waarde voor de elementen van een populatie
-CORREL = CORRELATIE ## Geeft als resultaat de correlatiecoëfficiënt van twee gegevensverzamelingen
-COUNT = AANTAL ## Telt het aantal getallen in de argumentenlijst
-COUNTA = AANTALARG ## Telt het aantal waarden in de argumentenlijst
-COUNTBLANK = AANTAL.LEGE.CELLEN ## Telt het aantal lege cellen in een bereik
-COUNTIF = AANTAL.ALS ## Telt in een bereik het aantal cellen die voldoen aan een bepaald criterium
-COUNTIFS = AANTALLEN.ALS ## Telt in een bereik het aantal cellen die voldoen aan meerdere criteria
-COVAR = COVARIANTIE ## Geeft als resultaat de covariantie, het gemiddelde van de producten van de gepaarde deviaties
-CRITBINOM = CRIT.BINOM ## Geeft als resultaat de kleinste waarde waarvoor de binomiale verdeling kleiner is dan of gelijk is aan het criterium
-DEVSQ = DEV.KWAD ## Geeft als resultaat de som van de deviaties in het kwadraat
-EXPONDIST = EXPON.VERD ## Geeft als resultaat de exponentiële verdeling
-FDIST = F.VERDELING ## Geeft als resultaat de F-verdeling
-FINV = F.INVERSE ## Geeft als resultaat de inverse van de F-verdeling
-FISHER = FISHER ## Geeft als resultaat de Fisher-transformatie
-FISHERINV = FISHER.INV ## Geeft als resultaat de inverse van de Fisher-transformatie
-FORECAST = VOORSPELLEN ## Geeft als resultaat een waarde op basis van een lineaire trend
-FREQUENCY = FREQUENTIE ## Geeft als resultaat een frequentieverdeling in de vorm van een verticale matrix
-FTEST = F.TOETS ## Geeft als resultaat een F-toets
-GAMMADIST = GAMMA.VERD ## Geeft als resultaat de gamma-verdeling
-GAMMAINV = GAMMA.INV ## Geeft als resultaat de inverse van de cumulatieve gamma-verdeling
-GAMMALN = GAMMA.LN ## Geeft als resultaat de natuurlijke logaritme van de gamma-functie, G(x)
-GEOMEAN = MEETK.GEM ## Geeft als resultaat het meetkundige gemiddelde
-GROWTH = GROEI ## Geeft als resultaat de waarden voor een exponentiële trend
-HARMEAN = HARM.GEM ## Geeft als resultaat het harmonische gemiddelde
-HYPGEOMDIST = HYPERGEO.VERD ## Geeft als resultaat de hypergeometrische verdeling
-INTERCEPT = SNIJPUNT ## Geeft als resultaat het snijpunt van de lineaire regressielijn met de y-as
-KURT = KURTOSIS ## Geeft als resultaat de kurtosis van een gegevensverzameling
-LARGE = GROOTSTE ## Geeft als resultaat de op k-1 na grootste waarde in een gegevensverzameling
-LINEST = LIJNSCH ## Geeft als resultaat de parameters van een lineaire trend
-LOGEST = LOGSCH ## Geeft als resultaat de parameters van een exponentiële trend
-LOGINV = LOG.NORM.INV ## Geeft als resultaat de inverse van de logaritmische normale verdeling
-LOGNORMDIST = LOG.NORM.VERD ## Geeft als resultaat de cumulatieve logaritmische normale verdeling
-MAX = MAX ## Geeft als resultaat de maximumwaarde in een lijst met argumenten
-MAXA = MAXA ## Geeft als resultaat de maximumwaarde in een lijst met argumenten, inclusief getallen, tekst en logische waarden
-MEDIAN = MEDIAAN ## Geeft als resultaat de mediaan van de opgegeven getallen
-MIN = MIN ## Geeft als resultaat de minimumwaarde in een lijst met argumenten
-MINA = MINA ## Geeft als resultaat de minimumwaarde in een lijst met argumenten, inclusief getallen, tekst en logische waarden
-MODE = MODUS ## Geeft als resultaat de meest voorkomende waarde in een gegevensverzameling
-NEGBINOMDIST = NEG.BINOM.VERD ## Geeft als resultaat de negatieve binomiaalverdeling
-NORMDIST = NORM.VERD ## Geeft als resultaat de cumulatieve normale verdeling
-NORMINV = NORM.INV ## Geeft als resultaat de inverse van de cumulatieve standaardnormale verdeling
-NORMSDIST = STAND.NORM.VERD ## Geeft als resultaat de cumulatieve standaardnormale verdeling
-NORMSINV = STAND.NORM.INV ## Geeft als resultaat de inverse van de cumulatieve normale verdeling
-PEARSON = PEARSON ## Geeft als resultaat de correlatiecoëfficiënt van Pearson
-PERCENTILE = PERCENTIEL ## Geeft als resultaat het k-de percentiel van waarden in een bereik
-PERCENTRANK = PERCENT.RANG ## Geeft als resultaat de positie, in procenten uitgedrukt, van een waarde in de rangorde van een gegevensverzameling
-PERMUT = PERMUTATIES ## Geeft als resultaat het aantal permutaties voor een gegeven aantal objecten
-POISSON = POISSON ## Geeft als resultaat de Poisson-verdeling
-PROB = KANS ## Geeft als resultaat de kans dat waarden zich tussen twee grenzen bevinden
-QUARTILE = KWARTIEL ## Geeft als resultaat het kwartiel van een gegevensverzameling
-RANK = RANG ## Geeft als resultaat het rangnummer van een getal in een lijst getallen
-RSQ = R.KWADRAAT ## Geeft als resultaat het kwadraat van de Pearson-correlatiecoëfficiënt
-SKEW = SCHEEFHEID ## Geeft als resultaat de mate van asymmetrie van een verdeling
-SLOPE = RICHTING ## Geeft als resultaat de richtingscoëfficiënt van een lineaire regressielijn
-SMALL = KLEINSTE ## Geeft als resultaat de op k-1 na kleinste waarde in een gegevensverzameling
-STANDARDIZE = NORMALISEREN ## Geeft als resultaat een genormaliseerde waarde
-STDEV = STDEV ## Maakt een schatting van de standaarddeviatie op basis van een steekproef
-STDEVA = STDEVA ## Maakt een schatting van de standaarddeviatie op basis van een steekproef, inclusief getallen, tekst en logische waarden
-STDEVP = STDEVP ## Berekent de standaarddeviatie op basis van de volledige populatie
-STDEVPA = STDEVPA ## Berekent de standaarddeviatie op basis van de volledige populatie, inclusief getallen, tekst en logische waarden
-STEYX = STAND.FOUT.YX ## Geeft als resultaat de standaardfout in de voorspelde y-waarde voor elke x in een regressie
-TDIST = T.VERD ## Geeft als resultaat de Student T-verdeling
-TINV = T.INV ## Geeft als resultaat de inverse van de Student T-verdeling
-TREND = TREND ## Geeft als resultaat de waarden voor een lineaire trend
-TRIMMEAN = GETRIMD.GEM ## Geeft als resultaat het gemiddelde van waarden in een gegevensverzameling
-TTEST = T.TOETS ## Geeft als resultaat de kans met behulp van de Student T-toets
-VAR = VAR ## Maakt een schatting van de variantie op basis van een steekproef
-VARA = VARA ## Maakt een schatting van de variantie op basis van een steekproef, inclusief getallen, tekst en logische waarden
-VARP = VARP ## Berekent de variantie op basis van de volledige populatie
-VARPA = VARPA ## Berekent de standaarddeviatie op basis van de volledige populatie, inclusief getallen, tekst en logische waarden
-WEIBULL = WEIBULL ## Geeft als resultaat de Weibull-verdeling
-ZTEST = Z.TOETS ## Geeft als resultaat de eenzijdige kanswaarde van een Z-toets
-
-
-##
-## Text functions Tekstfuncties
-##
-ASC = ASC ## Wijzigt Nederlandse letters of katakanatekens over de volle breedte (dubbel-bytetekens) binnen een tekenreeks in tekens over de halve breedte (enkel-bytetekens)
-BAHTTEXT = BAHT.TEKST ## Converteert een getal naar tekst met de valutanotatie ß (baht)
-CHAR = TEKEN ## Geeft als resultaat het teken dat hoort bij de opgegeven code
-CLEAN = WISSEN.CONTROL ## Verwijdert alle niet-afdrukbare tekens uit een tekst
-CODE = CODE ## Geeft als resultaat de numerieke code voor het eerste teken in een tekenreeks
-CONCATENATE = TEKST.SAMENVOEGEN ## Voegt verschillende tekstfragmenten samen tot één tekstfragment
-DOLLAR = EURO ## Converteert een getal naar tekst met de valutanotatie € (euro)
-EXACT = GELIJK ## Controleert of twee tekenreeksen identiek zijn
-FIND = VIND.ALLES ## Zoekt een bepaalde tekenreeks in een tekst (waarbij onderscheid wordt gemaakt tussen hoofdletters en kleine letters)
-FINDB = VIND.ALLES.B ## Zoekt een bepaalde tekenreeks in een tekst (waarbij onderscheid wordt gemaakt tussen hoofdletters en kleine letters)
-FIXED = VAST ## Maakt een getal als tekst met een vast aantal decimalen op
-JIS = JIS ## Wijzigt Nederlandse letters of katakanatekens over de halve breedte (enkel-bytetekens) binnen een tekenreeks in tekens over de volle breedte (dubbel-bytetekens)
-LEFT = LINKS ## Geeft als resultaat de meest linkse tekens in een tekenreeks
-LEFTB = LINKSB ## Geeft als resultaat de meest linkse tekens in een tekenreeks
-LEN = LENGTE ## Geeft als resultaat het aantal tekens in een tekenreeks
-LENB = LENGTEB ## Geeft als resultaat het aantal tekens in een tekenreeks
-LOWER = KLEINE.LETTERS ## Zet tekst om in kleine letters
-MID = MIDDEN ## Geeft als resultaat een bepaald aantal tekens van een tekenreeks vanaf de positie die u opgeeft
-MIDB = DEELB ## Geeft als resultaat een bepaald aantal tekens van een tekenreeks vanaf de positie die u opgeeft
-PHONETIC = FONETISCH ## Haalt de fonetische tekens (furigana) uit een tekenreeks op
-PROPER = BEGINLETTERS ## Zet de eerste letter van elk woord in een tekst om in een hoofdletter
-REPLACE = VERVANG ## Vervangt tekens binnen een tekst
-REPLACEB = VERVANGENB ## Vervangt tekens binnen een tekst
-REPT = HERHALING ## Herhaalt een tekst een aantal malen
-RIGHT = RECHTS ## Geeft als resultaat de meest rechtse tekens in een tekenreeks
-RIGHTB = RECHTSB ## Geeft als resultaat de meest rechtse tekens in een tekenreeks
-SEARCH = VIND.SPEC ## Zoekt een bepaalde tekenreeks in een tekst (waarbij geen onderscheid wordt gemaakt tussen hoofdletters en kleine letters)
-SEARCHB = VIND.SPEC.B ## Zoekt een bepaalde tekenreeks in een tekst (waarbij geen onderscheid wordt gemaakt tussen hoofdletters en kleine letters)
-SUBSTITUTE = SUBSTITUEREN ## Vervangt oude tekst door nieuwe tekst in een tekenreeks
-T = T ## Converteert de argumenten naar tekst
-TEXT = TEKST ## Maakt een getal op en converteert het getal naar tekst
-TRIM = SPATIES.WISSEN ## Verwijdert de spaties uit een tekst
-UPPER = HOOFDLETTERS ## Zet tekst om in hoofdletters
-VALUE = WAARDE ## Converteert tekst naar een getal
+##
+## PhpSpreadsheet
+##
+## Data in this file derived from https://www.excel-function-translation.com/
+##
+##
+
+
+##
+## Add-in and Automation functions Automatiseringsfuncties en functies in invoegtoepassingen
+##
+GETPIVOTDATA = DRAAITABEL.OPHALEN ## Geeft gegevens uit een draaitabelrapport als resultaat
+
+
+##
+## Cube functions Kubusfuncties
+##
+CUBEKPIMEMBER = KUBUSKPILID ## Retourneert de naam, eigenschap en waarde van een KPI (prestatie-indicator) en geeft de naam en de eigenschap in de cel weer. Een KPI is een meetbare waarde, zoals de maandelijkse brutowinst of de omzet per kwartaal per werknemer, die wordt gebruikt om de prestaties van een organisatie te bewaken
+CUBEMEMBER = KUBUSLID ## Retourneert een lid of tupel in een kubushiërarchie. Wordt gebruikt om te controleren of het lid of de tupel in de kubus aanwezig is
+CUBEMEMBERPROPERTY = KUBUSLIDEIGENSCHAP ## Retourneert de waarde van een lideigenschap in de kubus. Wordt gebruikt om te controleren of de lidnaam in de kubus bestaat en retourneert de opgegeven eigenschap voor dit lid
+CUBERANKEDMEMBER = KUBUSGERANGCHIKTLID ## Retourneert het zoveelste, gerangschikte lid in een set. Wordt gebruikt om een of meer elementen in een set te retourneren, zoals de tien beste verkopers of de tien beste studenten
+CUBESET = KUBUSSET ## Definieert een berekende set leden of tupels door een ingestelde expressie naar de kubus op de server te sturen, alwaar de set wordt gemaakt en vervolgens wordt geretourneerd naar Microsoft Office Excel
+CUBESETCOUNT = KUBUSSETAANTAL ## Retourneert het aantal onderdelen in een set
+CUBEVALUE = KUBUSWAARDE ## Retourneert een samengestelde waarde van een kubus
+
+
+##
+## Database functions Databasefuncties
+##
+DAVERAGE = DBGEMIDDELDE ## Berekent de gemiddelde waarde in geselecteerde databasegegevens
+DCOUNT = DBAANTAL ## Telt de cellen met getallen in een database
+DCOUNTA = DBAANTALC ## Telt de niet-lege cellen in een database
+DGET = DBLEZEN ## Retourneert één record dat voldoet aan de opgegeven criteria uit een database
+DMAX = DBMAX ## Retourneert de maximumwaarde in de geselecteerde databasegegevens
+DMIN = DBMIN ## Retourneert de minimumwaarde in de geselecteerde databasegegevens
+DPRODUCT = DBPRODUCT ## Vermenigvuldigt de waarden in een bepaald veld van de records die voldoen aan de criteria in een database
+DSTDEV = DBSTDEV ## Maakt een schatting van de standaarddeviatie op basis van een steekproef uit geselecteerde databasegegevens
+DSTDEVP = DBSTDEVP ## Berekent de standaarddeviatie op basis van de volledige populatie van geselecteerde databasegegevens
+DSUM = DBSOM ## Telt de getallen uit een kolom records in de database op die voldoen aan de criteria
+DVAR = DBVAR ## Maakt een schatting van de variantie op basis van een steekproef uit geselecteerde databasegegevens
+DVARP = DBVARP ## Berekent de variantie op basis van de volledige populatie van geselecteerde databasegegevens
+
+
+##
+## Date and time functions Datum- en tijdfuncties
+##
+DATE = DATUM ## Geeft als resultaat het seriële getal van een opgegeven datum
+DATEVALUE = DATUMWAARDE ## Converteert een datum in de vorm van tekst naar een serieel getal
+DAY = DAG ## Converteert een serieel getal naar een dag van de maand
+DAYS360 = DAGEN360 ## Berekent het aantal dagen tussen twee datums op basis van een jaar met 360 dagen
+EDATE = ZELFDE.DAG ## Geeft als resultaat het seriële getal van een datum die het opgegeven aantal maanden voor of na de begindatum ligt
+EOMONTH = LAATSTE.DAG ## Geeft als resultaat het seriële getal van de laatste dag van de maand voor of na het opgegeven aantal maanden
+HOUR = UUR ## Converteert een serieel getal naar uren
+MINUTE = MINUUT ## Converteert een serieel naar getal minuten
+MONTH = MAAND ## Converteert een serieel getal naar een maand
+NETWORKDAYS = NETTO.WERKDAGEN ## Geeft als resultaat het aantal hele werkdagen tussen twee datums
+NOW = NU ## Geeft als resultaat het seriële getal van de huidige datum en tijd
+SECOND = SECONDE ## Converteert een serieel getal naar seconden
+TIME = TIJD ## Geeft als resultaat het seriële getal van een bepaald tijdstip
+TIMEVALUE = TIJDWAARDE ## Converteert de tijd in de vorm van tekst naar een serieel getal
+TODAY = VANDAAG ## Geeft als resultaat het seriële getal van de huidige datum
+WEEKDAY = WEEKDAG ## Converteert een serieel getal naar een weekdag
+WEEKNUM = WEEKNUMMER ## Converteert een serieel getal naar een weeknummer
+WORKDAY = WERKDAG ## Geeft als resultaat het seriële getal van de datum voor of na een bepaald aantal werkdagen
+YEAR = JAAR ## Converteert een serieel getal naar een jaar
+YEARFRAC = JAAR.DEEL ## Geeft als resultaat het gedeelte van het jaar, uitgedrukt in het aantal hele dagen tussen begindatum en einddatum
+
+
+##
+## Engineering functions Technische functies
+##
+BESSELI = BESSEL.Y ## Geeft als resultaat de gewijzigde Bessel-functie In(x)
+BESSELJ = BESSEL.J ## Geeft als resultaat de Bessel-functie Jn(x)
+BESSELK = BESSEL.K ## Geeft als resultaat de gewijzigde Bessel-functie Kn(x)
+BESSELY = BESSEL.Y ## Geeft als resultaat de gewijzigde Bessel-functie Yn(x)
+BIN2DEC = BIN.N.DEC ## Converteert een binair getal naar een decimaal getal
+BIN2HEX = BIN.N.HEX ## Converteert een binair getal naar een hexadecimaal getal
+BIN2OCT = BIN.N.OCT ## Converteert een binair getal naar een octaal getal
+COMPLEX = COMPLEX ## Converteert reële en imaginaire coëfficiënten naar een complex getal
+CONVERT = CONVERTEREN ## Converteert een getal in de ene maateenheid naar een getal in een andere maateenheid
+DEC2BIN = DEC.N.BIN ## Converteert een decimaal getal naar een binair getal
+DEC2HEX = DEC.N.HEX ## Converteert een decimaal getal naar een hexadecimaal getal
+DEC2OCT = DEC.N.OCT ## Converteert een decimaal getal naar een octaal getal
+DELTA = DELTA ## Test of twee waarden gelijk zijn
+ERF = FOUTFUNCTIE ## Geeft als resultaat de foutfunctie
+ERFC = FOUT.COMPLEMENT ## Geeft als resultaat de complementaire foutfunctie
+GESTEP = GROTER.DAN ## Test of een getal groter is dan de drempelwaarde
+HEX2BIN = HEX.N.BIN ## Converteert een hexadecimaal getal naar een binair getal
+HEX2DEC = HEX.N.DEC ## Converteert een hexadecimaal getal naar een decimaal getal
+HEX2OCT = HEX.N.OCT ## Converteert een hexadecimaal getal naar een octaal getal
+IMABS = C.ABS ## Geeft als resultaat de absolute waarde (modulus) van een complex getal
+IMAGINARY = C.IM.DEEL ## Geeft als resultaat de imaginaire coëfficiënt van een complex getal
+IMARGUMENT = C.ARGUMENT ## Geeft als resultaat het argument thèta, een hoek uitgedrukt in radialen
+IMCONJUGATE = C.TOEGEVOEGD ## Geeft als resultaat het complexe toegevoegde getal van een complex getal
+IMCOS = C.COS ## Geeft als resultaat de cosinus van een complex getal
+IMDIV = C.QUOTIENT ## Geeft als resultaat het quotiënt van twee complexe getallen
+IMEXP = C.EXP ## Geeft als resultaat de exponent van een complex getal
+IMLN = C.LN ## Geeft als resultaat de natuurlijke logaritme van een complex getal
+IMLOG10 = C.LOG10 ## Geeft als resultaat de logaritme met grondtal 10 van een complex getal
+IMLOG2 = C.LOG2 ## Geeft als resultaat de logaritme met grondtal 2 van een complex getal
+IMPOWER = C.MACHT ## Geeft als resultaat een complex getal dat is verheven tot de macht van een geheel getal
+IMPRODUCT = C.PRODUCT ## Geeft als resultaat het product van complexe getallen
+IMREAL = C.REEEL.DEEL ## Geeft als resultaat de reële coëfficiënt van een complex getal
+IMSIN = C.SIN ## Geeft als resultaat de sinus van een complex getal
+IMSQRT = C.WORTEL ## Geeft als resultaat de vierkantswortel van een complex getal
+IMSUB = C.VERSCHIL ## Geeft als resultaat het verschil tussen twee complexe getallen
+IMSUM = C.SOM ## Geeft als resultaat de som van complexe getallen
+OCT2BIN = OCT.N.BIN ## Converteert een octaal getal naar een binair getal
+OCT2DEC = OCT.N.DEC ## Converteert een octaal getal naar een decimaal getal
+OCT2HEX = OCT.N.HEX ## Converteert een octaal getal naar een hexadecimaal getal
+
+
+##
+## Financial functions Financiële functies
+##
+ACCRINT = SAMENG.RENTE ## Berekent de opgelopen rente voor een waardepapier waarvan de rente periodiek wordt uitgekeerd
+ACCRINTM = SAMENG.RENTE.V ## Berekent de opgelopen rente voor een waardepapier waarvan de rente op de vervaldatum wordt uitgekeerd
+AMORDEGRC = AMORDEGRC ## Geeft als resultaat de afschrijving voor elke boekingsperiode door een afschrijvingscoëfficiënt toe te passen
+AMORLINC = AMORLINC ## Berekent de afschrijving voor elke boekingsperiode
+COUPDAYBS = COUP.DAGEN.BB ## Berekent het aantal dagen vanaf het begin van de coupontermijn tot de stortingsdatum
+COUPDAYS = COUP.DAGEN ## Geeft als resultaat het aantal dagen in de coupontermijn waarin de stortingsdatum valt
+COUPDAYSNC = COUP.DAGEN.VV ## Geeft als resultaat het aantal dagen vanaf de stortingsdatum tot de volgende couponvervaldatum
+COUPNCD = COUP.DATUM.NB ## Geeft als resultaat de volgende coupondatum na de stortingsdatum
+COUPNUM = COUP.AANTAL ## Geeft als resultaat het aantal coupons dat nog moet worden uitbetaald tussen de stortingsdatum en de vervaldatum
+COUPPCD = COUP.DATUM.VB ## Geeft als resultaat de vorige couponvervaldatum vóór de stortingsdatum
+CUMIPMT = CUM.RENTE ## Geeft als resultaat de cumulatieve rente die tussen twee termijnen is uitgekeerd
+CUMPRINC = CUM.HOOFDSOM ## Geeft als resultaat de cumulatieve hoofdsom van een lening die tussen twee termijnen is terugbetaald
+DB = DB ## Geeft als resultaat de afschrijving van activa voor een bepaalde periode met behulp van de 'fixed declining balance'-methode
+DDB = DDB ## Geeft als resultaat de afschrijving van activa over een bepaalde termijn met behulp van de 'double declining balance'-methode of een andere methode die u opgeeft
+DISC = DISCONTO ## Geeft als resultaat het discontopercentage voor een waardepapier
+DOLLARDE = EURO.DE ## Converteert een prijs in euro's, uitgedrukt in een breuk, naar een prijs in euro's, uitgedrukt in een decimaal getal
+DOLLARFR = EURO.BR ## Converteert een prijs in euro's, uitgedrukt in een decimaal getal, naar een prijs in euro's, uitgedrukt in een breuk
+DURATION = DUUR ## Geeft als resultaat de gewogen gemiddelde looptijd voor een waardepapier met periodieke rentebetalingen
+EFFECT = EFFECT.RENTE ## Geeft als resultaat het effectieve jaarlijkse rentepercentage
+FV = TW ## Geeft als resultaat de toekomstige waarde van een investering
+FVSCHEDULE = TOEK.WAARDE2 ## Geeft als resultaat de toekomstige waarde van een bepaalde hoofdsom na het toepassen van een reeks samengestelde rentepercentages
+INTRATE = RENTEPERCENTAGE ## Geeft als resultaat het rentepercentage voor een volgestort waardepapier
+IPMT = IBET ## Geeft als resultaat de te betalen rente voor een investering over een bepaalde termijn
+IRR = IR ## Geeft als resultaat de interne rentabiliteit voor een reeks cashflows
+ISPMT = ISBET ## Geeft als resultaat de rente die is betaald tijdens een bepaalde termijn van een investering
+MDURATION = AANG.DUUR ## Geeft als resultaat de aangepaste Macauley-looptijd voor een waardepapier, aangenomen dat de nominale waarde € 100 bedraagt
+MIRR = GIR ## Geeft als resultaat de interne rentabiliteit voor een serie cashflows, waarbij voor betalingen een ander rentepercentage geldt dan voor inkomsten
+NOMINAL = NOMINALE.RENTE ## Geeft als resultaat het nominale jaarlijkse rentepercentage
+NPER = NPER ## Geeft als resultaat het aantal termijnen van een investering
+NPV = NHW ## Geeft als resultaat de netto huidige waarde van een investering op basis van een reeks periodieke cashflows en een discontopercentage
+ODDFPRICE = AFW.ET.PRIJS ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier met een afwijkende eerste termijn
+ODDFYIELD = AFW.ET.REND ## Geeft als resultaat het rendement voor een waardepapier met een afwijkende eerste termijn
+ODDLPRICE = AFW.LT.PRIJS ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier met een afwijkende laatste termijn
+ODDLYIELD = AFW.LT.REND ## Geeft als resultaat het rendement voor een waardepapier met een afwijkende laatste termijn
+PMT = BET ## Geeft als resultaat de periodieke betaling voor een annuïteit
+PPMT = PBET ## Geeft als resultaat de afbetaling op de hoofdsom voor een bepaalde termijn
+PRICE = PRIJS.NOM ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier waarvan de rente periodiek wordt uitgekeerd
+PRICEDISC = PRIJS.DISCONTO ## Geeft als resultaat de prijs per € 100 nominale waarde voor een verdisconteerd waardepapier
+PRICEMAT = PRIJS.VERVALDAG ## Geeft als resultaat de prijs per € 100 nominale waarde voor een waardepapier waarvan de rente wordt uitgekeerd op de vervaldatum
+PV = HW ## Geeft als resultaat de huidige waarde van een investering
+RATE = RENTE ## Geeft als resultaat het periodieke rentepercentage voor een annuïteit
+RECEIVED = OPBRENGST ## Geeft als resultaat het bedrag dat op de vervaldatum wordt uitgekeerd voor een volgestort waardepapier
+SLN = LIN.AFSCHR ## Geeft als resultaat de lineaire afschrijving van activa over één termijn
+SYD = SYD ## Geeft als resultaat de afschrijving van activa over een bepaalde termijn met behulp van de 'Sum-Of-Years-Digits'-methode
+TBILLEQ = SCHATK.OBL ## Geeft als resultaat het rendement op schatkistpapier, dat op dezelfde manier wordt berekend als het rendement op obligaties
+TBILLPRICE = SCHATK.PRIJS ## Bepaalt de prijs per € 100 nominale waarde voor schatkistpapier
+TBILLYIELD = SCHATK.REND ## Berekent het rendement voor schatkistpapier
+VDB = VDB ## Geeft als resultaat de afschrijving van activa over een gehele of gedeeltelijke termijn met behulp van de 'declining balance'-methode
+XIRR = IR.SCHEMA ## Berekent de interne rentabiliteit voor een betalingsschema van cashflows
+XNPV = NHW2 ## Berekent de huidige nettowaarde voor een betalingsschema van cashflows
+YIELD = RENDEMENT ## Geeft als resultaat het rendement voor een waardepapier waarvan de rente periodiek wordt uitgekeerd
+YIELDDISC = REND.DISCONTO ## Geeft als resultaat het jaarlijkse rendement voor een verdisconteerd waardepapier, bijvoorbeeld schatkistpapier
+YIELDMAT = REND.VERVAL ## Geeft als resultaat het jaarlijkse rendement voor een waardepapier waarvan de rente wordt uitgekeerd op de vervaldatum
+
+
+##
+## Information functions Informatiefuncties
+##
+CELL = CEL ## Geeft als resultaat informatie over de opmaak, locatie of inhoud van een cel
+ERROR.TYPE = TYPE.FOUT ## Geeft als resultaat een getal dat overeenkomt met een van de foutwaarden van Microsoft Excel
+INFO = INFO ## Geeft als resultaat informatie over de huidige besturingsomgeving
+ISBLANK = ISLEEG ## Geeft als resultaat WAAR als de waarde leeg is
+ISERR = ISFOUT2 ## Geeft als resultaat WAAR als de waarde een foutwaarde is, met uitzondering van #N/B
+ISERROR = ISFOUT ## Geeft als resultaat WAAR als de waarde een foutwaarde is
+ISEVEN = IS.EVEN ## Geeft als resultaat WAAR als het getal even is
+ISLOGICAL = ISLOGISCH ## Geeft als resultaat WAAR als de waarde een logische waarde is
+ISNA = ISNB ## Geeft als resultaat WAAR als de waarde de foutwaarde #N/B is
+ISNONTEXT = ISGEENTEKST ## Geeft als resultaat WAAR als de waarde geen tekst is
+ISNUMBER = ISGETAL ## Geeft als resultaat WAAR als de waarde een getal is
+ISODD = IS.ONEVEN ## Geeft als resultaat WAAR als het getal oneven is
+ISREF = ISVERWIJZING ## Geeft als resultaat WAAR als de waarde een verwijzing is
+ISTEXT = ISTEKST ## Geeft als resultaat WAAR als de waarde tekst is
+N = N ## Geeft als resultaat een waarde die is geconverteerd naar een getal
+NA = NB ## Geeft als resultaat de foutwaarde #N/B
+TYPE = TYPE ## Geeft als resultaat een getal dat het gegevenstype van een waarde aangeeft
+
+
+##
+## Logical functions Logische functies
+##
+AND = EN ## Geeft als resultaat WAAR als alle argumenten WAAR zijn
+FALSE = ONWAAR ## Geeft als resultaat de logische waarde ONWAAR
+IF = ALS ## Geeft een logische test aan
+IFERROR = ALS.FOUT ## Retourneert een waarde die u opgeeft als een formule een fout oplevert, anders wordt het resultaat van de formule geretourneerd
+NOT = NIET ## Keert de logische waarde van het argument om
+OR = OF ## Geeft als resultaat WAAR als minimaal een van de argumenten WAAR is
+TRUE = WAAR ## Geeft als resultaat de logische waarde WAAR
+
+
+##
+## Lookup and reference functions Zoek- en verwijzingsfuncties
+##
+ADDRESS = ADRES ## Geeft als resultaat een verwijzing, in de vorm van tekst, naar één bepaalde cel in een werkblad
+AREAS = BEREIKEN ## Geeft als resultaat het aantal bereiken in een verwijzing
+CHOOSE = KIEZEN ## Kiest een waarde uit een lijst met waarden
+COLUMN = KOLOM ## Geeft als resultaat het kolomnummer van een verwijzing
+COLUMNS = KOLOMMEN ## Geeft als resultaat het aantal kolommen in een verwijzing
+HLOOKUP = HORIZ.ZOEKEN ## Zoekt in de bovenste rij van een matrix naar een bepaalde waarde en geeft als resultaat de gevonden waarde in de opgegeven cel
+HYPERLINK = HYPERLINK ## Maakt een snelkoppeling of een sprong waarmee een document wordt geopend dat is opgeslagen op een netwerkserver, een intranet of op internet
+INDEX = INDEX ## Kiest met een index een waarde uit een verwijzing of een matrix
+INDIRECT = INDIRECT ## Geeft als resultaat een verwijzing die wordt aangegeven met een tekstwaarde
+LOOKUP = ZOEKEN ## Zoekt naar bepaalde waarden in een vector of een matrix
+MATCH = VERGELIJKEN ## Zoekt naar bepaalde waarden in een verwijzing of een matrix
+OFFSET = VERSCHUIVING ## Geeft als resultaat een nieuwe verwijzing die is verschoven ten opzichte van een bepaalde verwijzing
+ROW = RIJ ## Geeft als resultaat het rijnummer van een verwijzing
+ROWS = RIJEN ## Geeft als resultaat het aantal rijen in een verwijzing
+RTD = RTG ## Haalt realtimegegevens op uit een programma dat COM-automatisering (automatisering: een methode waarmee de ene toepassing objecten van een andere toepassing of ontwikkelprogramma kan besturen. Automatisering werd vroeger OLE-automatisering genoemd. Automatisering is een industrienorm die deel uitmaakt van het Component Object Model (COM).) ondersteunt
+TRANSPOSE = TRANSPONEREN ## Geeft als resultaat de getransponeerde van een matrix
+VLOOKUP = VERT.ZOEKEN ## Zoekt in de meest linkse kolom van een matrix naar een bepaalde waarde en geeft als resultaat de waarde in de opgegeven cel
+
+
+##
+## Math and trigonometry functions Wiskundige en trigonometrische functies
+##
+ABS = ABS ## Geeft als resultaat de absolute waarde van een getal
+ACOS = BOOGCOS ## Geeft als resultaat de boogcosinus van een getal
+ACOSH = BOOGCOSH ## Geeft als resultaat de inverse cosinus hyperbolicus van een getal
+ASIN = BOOGSIN ## Geeft als resultaat de boogsinus van een getal
+ASINH = BOOGSINH ## Geeft als resultaat de inverse sinus hyperbolicus van een getal
+ATAN = BOOGTAN ## Geeft als resultaat de boogtangens van een getal
+ATAN2 = BOOGTAN2 ## Geeft als resultaat de boogtangens van de x- en y-coördinaten
+ATANH = BOOGTANH ## Geeft als resultaat de inverse tangens hyperbolicus van een getal
+CEILING = AFRONDEN.BOVEN ## Rondt de absolute waarde van een getal naar boven af op het dichtstbijzijnde gehele getal of het dichtstbijzijnde significante veelvoud
+COMBIN = COMBINATIES ## Geeft als resultaat het aantal combinaties voor een bepaald aantal objecten
+COS = COS ## Geeft als resultaat de cosinus van een getal
+COSH = COSH ## Geeft als resultaat de cosinus hyperbolicus van een getal
+DEGREES = GRADEN ## Converteert radialen naar graden
+EVEN = EVEN ## Rondt het getal af op het dichtstbijzijnde gehele even getal
+EXP = EXP ## Verheft e tot de macht van een bepaald getal
+FACT = FACULTEIT ## Geeft als resultaat de faculteit van een getal
+FACTDOUBLE = DUBBELE.FACULTEIT ## Geeft als resultaat de dubbele faculteit van een getal
+FLOOR = AFRONDEN.BENEDEN ## Rondt de absolute waarde van een getal naar beneden af
+GCD = GGD ## Geeft als resultaat de grootste gemene deler
+INT = INTEGER ## Rondt een getal naar beneden af op het dichtstbijzijnde gehele getal
+LCM = KGV ## Geeft als resultaat het kleinste gemene veelvoud
+LN = LN ## Geeft als resultaat de natuurlijke logaritme van een getal
+LOG = LOG ## Geeft als resultaat de logaritme met het opgegeven grondtal van een getal
+LOG10 = LOG10 ## Geeft als resultaat de logaritme met grondtal 10 van een getal
+MDETERM = DETERMINANTMAT ## Geeft als resultaat de determinant van een matrix
+MINVERSE = INVERSEMAT ## Geeft als resultaat de inverse van een matrix
+MMULT = PRODUCTMAT ## Geeft als resultaat het product van twee matrices
+MOD = REST ## Geeft als resultaat het restgetal van een deling
+MROUND = AFRONDEN.N.VEELVOUD ## Geeft als resultaat een getal afgerond op het gewenste veelvoud
+MULTINOMIAL = MULTINOMIAAL ## Geeft als resultaat de multinomiaalcoëfficiënt van een reeks getallen
+ODD = ONEVEN ## Rondt de absolute waarde van het getal naar boven af op het dichtstbijzijnde gehele oneven getal
+PI = PI ## Geeft als resultaat de waarde van pi
+POWER = MACHT ## Verheft een getal tot een macht
+PRODUCT = PRODUCT ## Vermenigvuldigt de argumenten met elkaar
+QUOTIENT = QUOTIENT ## Geeft als resultaat de uitkomst van een deling als geheel getal
+RADIANS = RADIALEN ## Converteert graden naar radialen
+RAND = ASELECT ## Geeft als resultaat een willekeurig getal tussen 0 en 1
+RANDBETWEEN = ASELECTTUSSEN ## Geeft een willekeurig getal tussen de getallen die u hebt opgegeven
+ROMAN = ROMEINS ## Converteert een Arabisch getal naar een Romeins getal en geeft het resultaat weer in de vorm van tekst
+ROUND = AFRONDEN ## Rondt een getal af op het opgegeven aantal decimalen
+ROUNDDOWN = AFRONDEN.NAAR.BENEDEN ## Rondt de absolute waarde van een getal naar beneden af
+ROUNDUP = AFRONDEN.NAAR.BOVEN ## Rondt de absolute waarde van een getal naar boven af
+SERIESSUM = SOM.MACHTREEKS ## Geeft als resultaat de som van een machtreeks die is gebaseerd op de formule
+SIGN = POS.NEG ## Geeft als resultaat het teken van een getal
+SIN = SIN ## Geeft als resultaat de sinus van de opgegeven hoek
+SINH = SINH ## Geeft als resultaat de sinus hyperbolicus van een getal
+SQRT = WORTEL ## Geeft als resultaat de positieve vierkantswortel van een getal
+SQRTPI = WORTEL.PI ## Geeft als resultaat de vierkantswortel van (getal * pi)
+SUBTOTAL = SUBTOTAAL ## Geeft als resultaat een subtotaal voor een bereik
+SUM = SOM ## Telt de argumenten op
+SUMIF = SOM.ALS ## Telt de getallen bij elkaar op die voldoen aan een bepaald criterium
+SUMIFS = SOMMEN.ALS ## Telt de cellen in een bereik op die aan meerdere criteria voldoen
+SUMPRODUCT = SOMPRODUCT ## Geeft als resultaat de som van de producten van de corresponderende matrixelementen
+SUMSQ = KWADRATENSOM ## Geeft als resultaat de som van de kwadraten van de argumenten
+SUMX2MY2 = SOM.X2MINY2 ## Geeft als resultaat de som van het verschil tussen de kwadraten van corresponderende waarden in twee matrices
+SUMX2PY2 = SOM.X2PLUSY2 ## Geeft als resultaat de som van de kwadratensom van corresponderende waarden in twee matrices
+SUMXMY2 = SOM.XMINY.2 ## Geeft als resultaat de som van de kwadraten van de verschillen tussen de corresponderende waarden in twee matrices
+TAN = TAN ## Geeft als resultaat de tangens van een getal
+TANH = TANH ## Geeft als resultaat de tangens hyperbolicus van een getal
+TRUNC = GEHEEL ## Kapt een getal af tot een geheel getal
+
+
+##
+## Statistical functions Statistische functies
+##
+AVEDEV = GEM.DEVIATIE ## Geeft als resultaat het gemiddelde van de absolute deviaties van gegevenspunten ten opzichte van hun gemiddelde waarde
+AVERAGE = GEMIDDELDE ## Geeft als resultaat het gemiddelde van de argumenten
+AVERAGEA = GEMIDDELDEA ## Geeft als resultaat het gemiddelde van de argumenten, inclusief getallen, tekst en logische waarden
+AVERAGEIF = GEMIDDELDE.ALS ## Geeft het gemiddelde (rekenkundig gemiddelde) als resultaat van alle cellen in een bereik die voldoen aan de opgegeven criteria
+AVERAGEIFS = GEMIDDELDEN.ALS ## Geeft het gemiddelde (rekenkundig gemiddelde) als resultaat van alle cellen die aan meerdere criteria voldoen
+BETADIST = BETA.VERD ## Geeft als resultaat de cumulatieve bèta-verdelingsfunctie
+BETAINV = BETA.INV ## Geeft als resultaat de inverse van de cumulatieve verdelingsfunctie voor een gegeven bèta-verdeling
+BINOMDIST = BINOMIALE.VERD ## Geeft als resultaat de binomiale verdeling
+CHIDIST = CHI.KWADRAAT ## Geeft als resultaat de eenzijdige kans van de chi-kwadraatverdeling
+CHIINV = CHI.KWADRAAT.INV ## Geeft als resultaat de inverse van een eenzijdige kans van de chi-kwadraatverdeling
+CHITEST = CHI.TOETS ## Geeft als resultaat de onafhankelijkheidstoets
+CONFIDENCE = BETROUWBAARHEID ## Geeft als resultaat het betrouwbaarheidsinterval van een gemiddelde waarde voor de elementen van een populatie
+CORREL = CORRELATIE ## Geeft als resultaat de correlatiecoëfficiënt van twee gegevensverzamelingen
+COUNT = AANTAL ## Telt het aantal getallen in de argumentenlijst
+COUNTA = AANTALARG ## Telt het aantal waarden in de argumentenlijst
+COUNTBLANK = AANTAL.LEGE.CELLEN ## Telt het aantal lege cellen in een bereik
+COUNTIF = AANTAL.ALS ## Telt in een bereik het aantal cellen die voldoen aan een bepaald criterium
+COUNTIFS = AANTALLEN.ALS ## Telt in een bereik het aantal cellen die voldoen aan meerdere criteria
+COVAR = COVARIANTIE ## Geeft als resultaat de covariantie, het gemiddelde van de producten van de gepaarde deviaties
+CRITBINOM = CRIT.BINOM ## Geeft als resultaat de kleinste waarde waarvoor de binomiale verdeling kleiner is dan of gelijk is aan het criterium
+DEVSQ = DEV.KWAD ## Geeft als resultaat de som van de deviaties in het kwadraat
+EXPONDIST = EXPON.VERD ## Geeft als resultaat de exponentiële verdeling
+FDIST = F.VERDELING ## Geeft als resultaat de F-verdeling
+FINV = F.INVERSE ## Geeft als resultaat de inverse van de F-verdeling
+FISHER = FISHER ## Geeft als resultaat de Fisher-transformatie
+FISHERINV = FISHER.INV ## Geeft als resultaat de inverse van de Fisher-transformatie
+FORECAST = VOORSPELLEN ## Geeft als resultaat een waarde op basis van een lineaire trend
+FREQUENCY = FREQUENTIE ## Geeft als resultaat een frequentieverdeling in de vorm van een verticale matrix
+FTEST = F.TOETS ## Geeft als resultaat een F-toets
+GAMMADIST = GAMMA.VERD ## Geeft als resultaat de gamma-verdeling
+GAMMAINV = GAMMA.INV ## Geeft als resultaat de inverse van de cumulatieve gamma-verdeling
+GAMMALN = GAMMA.LN ## Geeft als resultaat de natuurlijke logaritme van de gamma-functie, G(x)
+GEOMEAN = MEETK.GEM ## Geeft als resultaat het meetkundige gemiddelde
+GROWTH = GROEI ## Geeft als resultaat de waarden voor een exponentiële trend
+HARMEAN = HARM.GEM ## Geeft als resultaat het harmonische gemiddelde
+HYPGEOMDIST = HYPERGEO.VERD ## Geeft als resultaat de hypergeometrische verdeling
+INTERCEPT = SNIJPUNT ## Geeft als resultaat het snijpunt van de lineaire regressielijn met de y-as
+KURT = KURTOSIS ## Geeft als resultaat de kurtosis van een gegevensverzameling
+LARGE = GROOTSTE ## Geeft als resultaat de op k-1 na grootste waarde in een gegevensverzameling
+LINEST = LIJNSCH ## Geeft als resultaat de parameters van een lineaire trend
+LOGEST = LOGSCH ## Geeft als resultaat de parameters van een exponentiële trend
+LOGINV = LOG.NORM.INV ## Geeft als resultaat de inverse van de logaritmische normale verdeling
+LOGNORMDIST = LOG.NORM.VERD ## Geeft als resultaat de cumulatieve logaritmische normale verdeling
+MAX = MAX ## Geeft als resultaat de maximumwaarde in een lijst met argumenten
+MAXA = MAXA ## Geeft als resultaat de maximumwaarde in een lijst met argumenten, inclusief getallen, tekst en logische waarden
+MEDIAN = MEDIAAN ## Geeft als resultaat de mediaan van de opgegeven getallen
+MIN = MIN ## Geeft als resultaat de minimumwaarde in een lijst met argumenten
+MINA = MINA ## Geeft als resultaat de minimumwaarde in een lijst met argumenten, inclusief getallen, tekst en logische waarden
+MODE = MODUS ## Geeft als resultaat de meest voorkomende waarde in een gegevensverzameling
+NEGBINOMDIST = NEG.BINOM.VERD ## Geeft als resultaat de negatieve binomiaalverdeling
+NORMDIST = NORM.VERD ## Geeft als resultaat de cumulatieve normale verdeling
+NORMINV = NORM.INV ## Geeft als resultaat de inverse van de cumulatieve standaardnormale verdeling
+NORMSDIST = STAND.NORM.VERD ## Geeft als resultaat de cumulatieve standaardnormale verdeling
+NORMSINV = STAND.NORM.INV ## Geeft als resultaat de inverse van de cumulatieve normale verdeling
+PEARSON = PEARSON ## Geeft als resultaat de correlatiecoëfficiënt van Pearson
+PERCENTILE = PERCENTIEL ## Geeft als resultaat het k-de percentiel van waarden in een bereik
+PERCENTRANK = PERCENT.RANG ## Geeft als resultaat de positie, in procenten uitgedrukt, van een waarde in de rangorde van een gegevensverzameling
+PERMUT = PERMUTATIES ## Geeft als resultaat het aantal permutaties voor een gegeven aantal objecten
+POISSON = POISSON ## Geeft als resultaat de Poisson-verdeling
+PROB = KANS ## Geeft als resultaat de kans dat waarden zich tussen twee grenzen bevinden
+QUARTILE = KWARTIEL ## Geeft als resultaat het kwartiel van een gegevensverzameling
+RANK = RANG ## Geeft als resultaat het rangnummer van een getal in een lijst getallen
+RSQ = R.KWADRAAT ## Geeft als resultaat het kwadraat van de Pearson-correlatiecoëfficiënt
+SKEW = SCHEEFHEID ## Geeft als resultaat de mate van asymmetrie van een verdeling
+SLOPE = RICHTING ## Geeft als resultaat de richtingscoëfficiënt van een lineaire regressielijn
+SMALL = KLEINSTE ## Geeft als resultaat de op k-1 na kleinste waarde in een gegevensverzameling
+STANDARDIZE = NORMALISEREN ## Geeft als resultaat een genormaliseerde waarde
+STDEV = STDEV ## Maakt een schatting van de standaarddeviatie op basis van een steekproef
+STDEVA = STDEVA ## Maakt een schatting van de standaarddeviatie op basis van een steekproef, inclusief getallen, tekst en logische waarden
+STDEVP = STDEVP ## Berekent de standaarddeviatie op basis van de volledige populatie
+STDEVPA = STDEVPA ## Berekent de standaarddeviatie op basis van de volledige populatie, inclusief getallen, tekst en logische waarden
+STEYX = STAND.FOUT.YX ## Geeft als resultaat de standaardfout in de voorspelde y-waarde voor elke x in een regressie
+TDIST = T.VERD ## Geeft als resultaat de Student T-verdeling
+TINV = T.INV ## Geeft als resultaat de inverse van de Student T-verdeling
+TREND = TREND ## Geeft als resultaat de waarden voor een lineaire trend
+TRIMMEAN = GETRIMD.GEM ## Geeft als resultaat het gemiddelde van waarden in een gegevensverzameling
+TTEST = T.TOETS ## Geeft als resultaat de kans met behulp van de Student T-toets
+VAR = VAR ## Maakt een schatting van de variantie op basis van een steekproef
+VARA = VARA ## Maakt een schatting van de variantie op basis van een steekproef, inclusief getallen, tekst en logische waarden
+VARP = VARP ## Berekent de variantie op basis van de volledige populatie
+VARPA = VARPA ## Berekent de standaarddeviatie op basis van de volledige populatie, inclusief getallen, tekst en logische waarden
+WEIBULL = WEIBULL ## Geeft als resultaat de Weibull-verdeling
+ZTEST = Z.TOETS ## Geeft als resultaat de eenzijdige kanswaarde van een Z-toets
+
+
+##
+## Text functions Tekstfuncties
+##
+ASC = ASC ## Wijzigt Nederlandse letters of katakanatekens over de volle breedte (dubbel-bytetekens) binnen een tekenreeks in tekens over de halve breedte (enkel-bytetekens)
+BAHTTEXT = BAHT.TEKST ## Converteert een getal naar tekst met de valutanotatie ß (baht)
+CHAR = TEKEN ## Geeft als resultaat het teken dat hoort bij de opgegeven code
+CLEAN = WISSEN.CONTROL ## Verwijdert alle niet-afdrukbare tekens uit een tekst
+CODE = CODE ## Geeft als resultaat de numerieke code voor het eerste teken in een tekenreeks
+CONCATENATE = TEKST.SAMENVOEGEN ## Voegt verschillende tekstfragmenten samen tot één tekstfragment
+DOLLAR = EURO ## Converteert een getal naar tekst met de valutanotatie € (euro)
+EXACT = GELIJK ## Controleert of twee tekenreeksen identiek zijn
+FIND = VIND.ALLES ## Zoekt een bepaalde tekenreeks in een tekst (waarbij onderscheid wordt gemaakt tussen hoofdletters en kleine letters)
+FINDB = VIND.ALLES.B ## Zoekt een bepaalde tekenreeks in een tekst (waarbij onderscheid wordt gemaakt tussen hoofdletters en kleine letters)
+FIXED = VAST ## Maakt een getal als tekst met een vast aantal decimalen op
+JIS = JIS ## Wijzigt Nederlandse letters of katakanatekens over de halve breedte (enkel-bytetekens) binnen een tekenreeks in tekens over de volle breedte (dubbel-bytetekens)
+LEFT = LINKS ## Geeft als resultaat de meest linkse tekens in een tekenreeks
+LEFTB = LINKSB ## Geeft als resultaat de meest linkse tekens in een tekenreeks
+LEN = LENGTE ## Geeft als resultaat het aantal tekens in een tekenreeks
+LENB = LENGTEB ## Geeft als resultaat het aantal tekens in een tekenreeks
+LOWER = KLEINE.LETTERS ## Zet tekst om in kleine letters
+MID = MIDDEN ## Geeft als resultaat een bepaald aantal tekens van een tekenreeks vanaf de positie die u opgeeft
+MIDB = DEELB ## Geeft als resultaat een bepaald aantal tekens van een tekenreeks vanaf de positie die u opgeeft
+PHONETIC = FONETISCH ## Haalt de fonetische tekens (furigana) uit een tekenreeks op
+PROPER = BEGINLETTERS ## Zet de eerste letter van elk woord in een tekst om in een hoofdletter
+REPLACE = VERVANG ## Vervangt tekens binnen een tekst
+REPLACEB = VERVANGENB ## Vervangt tekens binnen een tekst
+REPT = HERHALING ## Herhaalt een tekst een aantal malen
+RIGHT = RECHTS ## Geeft als resultaat de meest rechtse tekens in een tekenreeks
+RIGHTB = RECHTSB ## Geeft als resultaat de meest rechtse tekens in een tekenreeks
+SEARCH = VIND.SPEC ## Zoekt een bepaalde tekenreeks in een tekst (waarbij geen onderscheid wordt gemaakt tussen hoofdletters en kleine letters)
+SEARCHB = VIND.SPEC.B ## Zoekt een bepaalde tekenreeks in een tekst (waarbij geen onderscheid wordt gemaakt tussen hoofdletters en kleine letters)
+SUBSTITUTE = SUBSTITUEREN ## Vervangt oude tekst door nieuwe tekst in een tekenreeks
+T = T ## Converteert de argumenten naar tekst
+TEXT = TEKST ## Maakt een getal op en converteert het getal naar tekst
+TRIM = SPATIES.WISSEN ## Verwijdert de spaties uit een tekst
+UPPER = HOOFDLETTERS ## Zet tekst om in hoofdletters
+VALUE = WAARDE ## Converteert tekst naar een getal
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/no/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/no/config
new file mode 100644
index 00000000000..c7f4152a319
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/no/config
@@ -0,0 +1,24 @@
+##
+## PhpSpreadsheet
+##
+
+ArgumentSeparator = ;
+
+
+##
+## (For future use)
+##
+currencySymbol = kr
+
+
+##
+## Excel Error Codes (For future use)
+
+##
+NULL = #NULL!
+DIV0 = #DIV/0!
+VALUE = #VERDI!
+REF = #REF!
+NAME = #NAVN?
+NUM = #NUM!
+NA = #I/T
diff --git a/lib/phpexcel/PHPExcel/locale/no/functions b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/no/functions
similarity index 95%
rename from lib/phpexcel/PHPExcel/locale/no/functions
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/no/functions
index 10d0a20762e..ab2a3793703 100644
--- a/lib/phpexcel/PHPExcel/locale/no/functions
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/no/functions
@@ -1,438 +1,416 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Calculation
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/
-##
-##
-
-
-##
-## Add-in and Automation functions Funksjonene Tillegg og Automatisering
-##
-GETPIVOTDATA = HENTPIVOTDATA ## Returnerer data som er lagret i en pivottabellrapport
-
-
-##
-## Cube functions Kubefunksjoner
-##
-CUBEKPIMEMBER = KUBEKPIMEDLEM ## Returnerer navnet, egenskapen og målet for en viktig ytelsesindikator (KPI), og viser navnet og egenskapen i cellen. En KPI er en målbar enhet, for eksempel månedlig bruttoinntjening eller kvartalsvis inntjening per ansatt, og brukes til å overvåke ytelsen i en organisasjon.
-CUBEMEMBER = KUBEMEDLEM ## Returnerer et medlem eller en tuppel i et kubehierarki. Brukes til å validere at medlemmet eller tuppelen finnes i kuben.
-CUBEMEMBERPROPERTY = KUBEMEDLEMEGENSKAP ## Returnerer verdien til en medlemsegenskap i kuben. Brukes til å validere at et medlemsnavn finnes i kuben, og til å returnere den angitte egenskapen for dette medlemmet.
-CUBERANKEDMEMBER = KUBERANGERTMEDLEM ## Returnerer det n-te, eller rangerte, medlemmet i et sett. Brukes til å returnere ett eller flere elementer i et sett, for eksempel de 10 beste studentene.
-CUBESET = KUBESETT ## Definerer et beregnet sett av medlemmer eller tuppeler ved å sende et settuttrykk til kuben på serveren, noe som oppretter settet og deretter returnerer dette settet til Microsoft Office Excel.
-CUBESETCOUNT = KUBESETTANTALL ## Returnerer antallet elementer i et sett.
-CUBEVALUE = KUBEVERDI ## Returnerer en aggregert verdi fra en kube.
-
-
-##
-## Database functions Databasefunksjoner
-##
-DAVERAGE = DGJENNOMSNITT ## Returnerer gjennomsnittet av merkede databaseposter
-DCOUNT = DANTALL ## Teller celler som inneholder tall i en database
-DCOUNTA = DANTALLA ## Teller celler som ikke er tomme i en database
-DGET = DHENT ## Trekker ut fra en database en post som oppfyller angitte vilkår
-DMAX = DMAKS ## Returnerer maksimumsverdien fra merkede databaseposter
-DMIN = DMIN ## Returnerer minimumsverdien fra merkede databaseposter
-DPRODUCT = DPRODUKT ## Multipliserer verdiene i et bestemt felt med poster som oppfyller vilkårene i en database
-DSTDEV = DSTDAV ## Estimerer standardavviket basert på et utvalg av merkede databaseposter
-DSTDEVP = DSTAVP ## Beregner standardavviket basert på at merkede databaseposter utgjør hele populasjonen
-DSUM = DSUMMER ## Legger til tallene i feltkolonnen med poster, i databasen som oppfyller vilkårene
-DVAR = DVARIANS ## Estimerer variansen basert på et utvalg av merkede databaseposter
-DVARP = DVARIANSP ## Beregner variansen basert på at merkede databaseposter utgjør hele populasjonen
-
-
-##
-## Date and time functions Dato- og tidsfunksjoner
-##
-DATE = DATO ## Returnerer serienummeret som svarer til en bestemt dato
-DATEVALUE = DATOVERDI ## Konverterer en dato med tekstformat til et serienummer
-DAY = DAG ## Konverterer et serienummer til en dag i måneden
-DAYS360 = DAGER360 ## Beregner antall dager mellom to datoer basert på et år med 360 dager
-EDATE = DAG.ETTER ## Returnerer serienummeret som svarer til datoen som er det indikerte antall måneder før eller etter startdatoen
-EOMONTH = MÅNEDSSLUTT ## Returnerer serienummeret som svarer til siste dag i måneden, før eller etter et angitt antall måneder
-HOUR = TIME ## Konverterer et serienummer til en time
-MINUTE = MINUTT ## Konverterer et serienummer til et minutt
-MONTH = MÅNED ## Konverterer et serienummer til en måned
-NETWORKDAYS = NETT.ARBEIDSDAGER ## Returnerer antall hele arbeidsdager mellom to datoer
-NOW = NÅ ## Returnerer serienummeret som svarer til gjeldende dato og klokkeslett
-SECOND = SEKUND ## Konverterer et serienummer til et sekund
-TIME = TID ## Returnerer serienummeret som svarer til et bestemt klokkeslett
-TIMEVALUE = TIDSVERDI ## Konverterer et klokkeslett i tekstformat til et serienummer
-TODAY = IDAG ## Returnerer serienummeret som svarer til dagens dato
-WEEKDAY = UKEDAG ## Konverterer et serienummer til en ukedag
-WEEKNUM = UKENR ## Konverterer et serienummer til et tall som representerer hvilket nummer uken har i et år
-WORKDAY = ARBEIDSDAG ## Returnerer serienummeret som svarer til datoen før eller etter et angitt antall arbeidsdager
-YEAR = ÅR ## Konverterer et serienummer til et år
-YEARFRAC = ÅRDEL ## Returnerer brøkdelen for året, som svarer til antall hele dager mellom startdato og sluttdato
-
-
-##
-## Engineering functions Tekniske funksjoner
-##
-BESSELI = BESSELI ## Returnerer den endrede Bessel-funksjonen In(x)
-BESSELJ = BESSELJ ## Returnerer Bessel-funksjonen Jn(x)
-BESSELK = BESSELK ## Returnerer den endrede Bessel-funksjonen Kn(x)
-BESSELY = BESSELY ## Returnerer Bessel-funksjonen Yn(x)
-BIN2DEC = BINTILDES ## Konverterer et binært tall til et desimaltall
-BIN2HEX = BINTILHEKS ## Konverterer et binært tall til et heksadesimaltall
-BIN2OCT = BINTILOKT ## Konverterer et binært tall til et oktaltall
-COMPLEX = KOMPLEKS ## Konverterer reelle og imaginære koeffisienter til et komplekst tall
-CONVERT = KONVERTER ## Konverterer et tall fra ett målsystem til et annet
-DEC2BIN = DESTILBIN ## Konverterer et desimaltall til et binærtall
-DEC2HEX = DESTILHEKS ## Konverterer et heltall i 10-tallsystemet til et heksadesimalt tall
-DEC2OCT = DESTILOKT ## Konverterer et heltall i 10-tallsystemet til et oktaltall
-DELTA = DELTA ## Undersøker om to verdier er like
-ERF = FEILF ## Returnerer feilfunksjonen
-ERFC = FEILFK ## Returnerer den komplementære feilfunksjonen
-GESTEP = GRENSEVERDI ## Tester om et tall er større enn en terskelverdi
-HEX2BIN = HEKSTILBIN ## Konverterer et heksadesimaltall til et binært tall
-HEX2DEC = HEKSTILDES ## Konverterer et heksadesimalt tall til et heltall i 10-tallsystemet
-HEX2OCT = HEKSTILOKT ## Konverterer et heksadesimalt tall til et oktaltall
-IMABS = IMABS ## Returnerer absoluttverdien (koeffisienten) til et komplekst tall
-IMAGINARY = IMAGINÆR ## Returnerer den imaginære koeffisienten til et komplekst tall
-IMARGUMENT = IMARGUMENT ## Returnerer argumentet theta, som er en vinkel uttrykt i radianer
-IMCONJUGATE = IMKONJUGERT ## Returnerer den komplekse konjugaten til et komplekst tall
-IMCOS = IMCOS ## Returnerer cosinus til et komplekst tall
-IMDIV = IMDIV ## Returnerer kvotienten til to komplekse tall
-IMEXP = IMEKSP ## Returnerer eksponenten til et komplekst tall
-IMLN = IMLN ## Returnerer den naturlige logaritmen for et komplekst tall
-IMLOG10 = IMLOG10 ## Returnerer logaritmen med grunntall 10 for et komplekst tall
-IMLOG2 = IMLOG2 ## Returnerer logaritmen med grunntall 2 for et komplekst tall
-IMPOWER = IMOPPHØY ## Returnerer et komplekst tall opphøyd til en heltallspotens
-IMPRODUCT = IMPRODUKT ## Returnerer produktet av komplekse tall
-IMREAL = IMREELL ## Returnerer den reelle koeffisienten til et komplekst tall
-IMSIN = IMSIN ## Returnerer sinus til et komplekst tall
-IMSQRT = IMROT ## Returnerer kvadratroten av et komplekst tall
-IMSUB = IMSUB ## Returnerer differansen mellom to komplekse tall
-IMSUM = IMSUMMER ## Returnerer summen av komplekse tall
-OCT2BIN = OKTTILBIN ## Konverterer et oktaltall til et binært tall
-OCT2DEC = OKTTILDES ## Konverterer et oktaltall til et desimaltall
-OCT2HEX = OKTTILHEKS ## Konverterer et oktaltall til et heksadesimaltall
-
-
-##
-## Financial functions Økonomiske funksjoner
-##
-ACCRINT = PÅLØPT.PERIODISK.RENTE ## Returnerer påløpte renter for et verdipapir som betaler periodisk rente
-ACCRINTM = PÅLØPT.FORFALLSRENTE ## Returnerer den påløpte renten for et verdipapir som betaler rente ved forfall
-AMORDEGRC = AMORDEGRC ## Returnerer avskrivningen for hver regnskapsperiode ved hjelp av en avskrivingskoeffisient
-AMORLINC = AMORLINC ## Returnerer avskrivingen for hver regnskapsperiode
-COUPDAYBS = OBLIG.DAGER.FF ## Returnerer antall dager fra begynnelsen av den rentebærende perioden til innløsningsdatoen
-COUPDAYS = OBLIG.DAGER ## Returnerer antall dager i den rentebærende perioden som inneholder innløsningsdatoen
-COUPDAYSNC = OBLIG.DAGER.NF ## Returnerer antall dager fra betalingsdato til neste renteinnbetalingsdato
-COUPNCD = OBLIG.DAGER.EF ## Returnerer obligasjonsdatoen som kommer etter oppgjørsdatoen
-COUPNUM = OBLIG.ANTALL ## Returnerer antall obligasjoner som skal betales mellom oppgjørsdatoen og forfallsdatoen
-COUPPCD = OBLIG.DAG.FORRIGE ## Returnerer obligasjonsdatoen som kommer før oppgjørsdatoen
-CUMIPMT = SAMLET.RENTE ## Returnerer den kumulative renten som er betalt mellom to perioder
-CUMPRINC = SAMLET.HOVEDSTOL ## Returnerer den kumulative hovedstolen som er betalt for et lån mellom to perioder
-DB = DAVSKR ## Returnerer avskrivningen for et aktivum i en angitt periode, foretatt med fast degressiv avskrivning
-DDB = DEGRAVS ## Returnerer avskrivningen for et aktivum for en gitt periode, ved hjelp av dobbel degressiv avskrivning eller en metode som du selv angir
-DISC = DISKONTERT ## Returnerer diskonteringsraten for et verdipapir
-DOLLARDE = DOLLARDE ## Konverterer en valutapris uttrykt som en brøk, til en valutapris uttrykt som et desimaltall
-DOLLARFR = DOLLARBR ## Konverterer en valutapris uttrykt som et desimaltall, til en valutapris uttrykt som en brøk
-DURATION = VARIGHET ## Returnerer årlig varighet for et verdipapir med renter som betales periodisk
-EFFECT = EFFEKTIV.RENTE ## Returnerer den effektive årlige rentesatsen
-FV = SLUTTVERDI ## Returnerer fremtidig verdi for en investering
-FVSCHEDULE = SVPLAN ## Returnerer den fremtidige verdien av en inngående hovedstol etter å ha anvendt en serie med sammensatte rentesatser
-INTRATE = RENTESATS ## Returnerer rentefoten av et fullfinansiert verdipapir
-IPMT = RAVDRAG ## Returnerer betalte renter på en investering for en gitt periode
-IRR = IR ## Returnerer internrenten for en serie kontantstrømmer
-ISPMT = ER.AVDRAG ## Beregner renten som er betalt for en investering i løpet av en bestemt periode
-MDURATION = MVARIGHET ## Returnerer Macauleys modifiserte varighet for et verdipapir med en antatt pålydende verdi på kr 100,00
-MIRR = MODIR ## Returnerer internrenten der positive og negative kontantstrømmer finansieres med forskjellige satser
-NOMINAL = NOMINELL ## Returnerer årlig nominell rentesats
-NPER = PERIODER ## Returnerer antall perioder for en investering
-NPV = NNV ## Returnerer netto nåverdi for en investering, basert på en serie periodiske kontantstrømmer og en rentesats
-ODDFPRICE = AVVIKFP.PRIS ## Returnerer pris pålydende kr 100 for et verdipapir med en odde første periode
-ODDFYIELD = AVVIKFP.AVKASTNING ## Returnerer avkastingen for et verdipapir med en odde første periode
-ODDLPRICE = AVVIKSP.PRIS ## Returnerer pris pålydende kr 100 for et verdipapir med en odde siste periode
-ODDLYIELD = AVVIKSP.AVKASTNING ## Returnerer avkastingen for et verdipapir med en odde siste periode
-PMT = AVDRAG ## Returnerer periodisk betaling for en annuitet
-PPMT = AMORT ## Returnerer betalingen på hovedstolen for en investering i en gitt periode
-PRICE = PRIS ## Returnerer prisen per pålydende kr 100 for et verdipapir som gir periodisk avkastning
-PRICEDISC = PRIS.DISKONTERT ## Returnerer prisen per pålydende kr 100 for et diskontert verdipapir
-PRICEMAT = PRIS.FORFALL ## Returnerer prisen per pålydende kr 100 av et verdipapir som betaler rente ved forfall
-PV = NÅVERDI ## Returnerer nåverdien av en investering
-RATE = RENTE ## Returnerer rentesatsen per periode for en annuitet
-RECEIVED = MOTTATT.AVKAST ## Returnerer summen som mottas ved forfallsdato for et fullinvestert verdipapir
-SLN = LINAVS ## Returnerer den lineære avskrivningen for et aktivum i én periode
-SYD = ÅRSAVS ## Returnerer årsavskrivningen for et aktivum i en angitt periode
-TBILLEQ = TBILLEKV ## Returnerer den obligasjonsekvivalente avkastningen for en statsobligasjon
-TBILLPRICE = TBILLPRIS ## Returnerer prisen per pålydende kr 100 for en statsobligasjon
-TBILLYIELD = TBILLAVKASTNING ## Returnerer avkastningen til en statsobligasjon
-VDB = VERDIAVS ## Returnerer avskrivningen for et aktivum i en angitt periode eller delperiode, ved hjelp av degressiv avskrivning
-XIRR = XIR ## Returnerer internrenten for en serie kontantstrømmer som ikke nødvendigvis er periodiske
-XNPV = XNNV ## Returnerer netto nåverdi for en serie kontantstrømmer som ikke nødvendigvis er periodiske
-YIELD = AVKAST ## Returnerer avkastningen på et verdipapir som betaler periodisk rente
-YIELDDISC = AVKAST.DISKONTERT ## Returnerer årlig avkastning for et diskontert verdipapir, for eksempel en statskasseveksel
-YIELDMAT = AVKAST.FORFALL ## Returnerer den årlige avkastningen for et verdipapir som betaler rente ved forfallsdato
-
-
-##
-## Information functions Informasjonsfunksjoner
-##
-CELL = CELLE ## Returnerer informasjon om formatering, plassering eller innholdet til en celle
-ERROR.TYPE = FEIL.TYPE ## Returnerer et tall som svarer til en feiltype
-INFO = INFO ## Returnerer informasjon om gjeldende operativmiljø
-ISBLANK = ERTOM ## Returnerer SANN hvis verdien er tom
-ISERR = ERFEIL ## Returnerer SANN hvis verdien er en hvilken som helst annen feilverdi enn #I/T
-ISERROR = ERFEIL ## Returnerer SANN hvis verdien er en hvilken som helst feilverdi
-ISEVEN = ERPARTALL ## Returnerer SANN hvis tallet er et partall
-ISLOGICAL = ERLOGISK ## Returnerer SANN hvis verdien er en logisk verdi
-ISNA = ERIT ## Returnerer SANN hvis verdien er feilverdien #I/T
-ISNONTEXT = ERIKKETEKST ## Returnerer SANN hvis verdien ikke er tekst
-ISNUMBER = ERTALL ## Returnerer SANN hvis verdien er et tall
-ISODD = ERODDETALL ## Returnerer SANN hvis tallet er et oddetall
-ISREF = ERREF ## Returnerer SANN hvis verdien er en referanse
-ISTEXT = ERTEKST ## Returnerer SANN hvis verdien er tekst
-N = N ## Returnerer en verdi som er konvertert til et tall
-NA = IT ## Returnerer feilverdien #I/T
-TYPE = VERDITYPE ## Returnerer et tall som indikerer datatypen til en verdi
-
-
-##
-## Logical functions Logiske funksjoner
-##
-AND = OG ## Returnerer SANN hvis alle argumentene er lik SANN
-FALSE = USANN ## Returnerer den logiske verdien USANN
-IF = HVIS ## Angir en logisk test som skal utføres
-IFERROR = HVISFEIL ## Returnerer en verdi du angir hvis en formel evaluerer til en feil. Ellers returnerer den resultatet av formelen.
-NOT = IKKE ## Reverserer logikken til argumentet
-OR = ELLER ## Returnerer SANN hvis ett eller flere argumenter er lik SANN
-TRUE = SANN ## Returnerer den logiske verdien SANN
-
-
-##
-## Lookup and reference functions Oppslag- og referansefunksjoner
-##
-ADDRESS = ADRESSE ## Returnerer en referanse som tekst til en enkelt celle i et regneark
-AREAS = OMRÅDER ## Returnerer antall områder i en referanse
-CHOOSE = VELG ## Velger en verdi fra en liste med verdier
-COLUMN = KOLONNE ## Returnerer kolonnenummeret for en referanse
-COLUMNS = KOLONNER ## Returnerer antall kolonner i en referanse
-HLOOKUP = FINN.KOLONNE ## Leter i den øverste raden i en matrise og returnerer verdien for den angitte cellen
-HYPERLINK = HYPERKOBLING ## Oppretter en snarvei eller et hopp som åpner et dokument som er lagret på en nettverksserver, et intranett eller Internett
-INDEX = INDEKS ## Bruker en indeks til å velge en verdi fra en referanse eller matrise
-INDIRECT = INDIREKTE ## Returnerer en referanse angitt av en tekstverdi
-LOOKUP = SLÅ.OPP ## Slår opp verdier i en vektor eller matrise
-MATCH = SAMMENLIGNE ## Slår opp verdier i en referanse eller matrise
-OFFSET = FORSKYVNING ## Returnerer en referanseforskyvning fra en gitt referanse
-ROW = RAD ## Returnerer radnummeret for en referanse
-ROWS = RADER ## Returnerer antall rader i en referanse
-RTD = RTD ## Henter sanntidsdata fra et program som støtter COM-automatisering (automatisering: En måte å arbeide på med programobjekter fra et annet program- eller utviklingsverktøy. Tidligere kalt OLE-automatisering. Automatisering er en bransjestandard og en funksjon i Component Object Model (COM).)
-TRANSPOSE = TRANSPONER ## Returnerer transponeringen av en matrise
-VLOOKUP = FINN.RAD ## Leter i den første kolonnen i en matrise og flytter bortover raden for å returnere verdien til en celle
-
-
-##
-## Math and trigonometry functions Matematikk- og trigonometrifunksjoner
-##
-ABS = ABS ## Returnerer absoluttverdien til et tall
-ACOS = ARCCOS ## Returnerer arcus cosinus til et tall
-ACOSH = ARCCOSH ## Returnerer den inverse hyperbolske cosinus til et tall
-ASIN = ARCSIN ## Returnerer arcus sinus til et tall
-ASINH = ARCSINH ## Returnerer den inverse hyperbolske sinus til et tall
-ATAN = ARCTAN ## Returnerer arcus tangens til et tall
-ATAN2 = ARCTAN2 ## Returnerer arcus tangens fra x- og y-koordinater
-ATANH = ARCTANH ## Returnerer den inverse hyperbolske tangens til et tall
-CEILING = AVRUND.GJELDENDE.MULTIPLUM ## Runder av et tall til nærmeste heltall eller til nærmeste signifikante multiplum
-COMBIN = KOMBINASJON ## Returnerer antall kombinasjoner for ett gitt antall objekter
-COS = COS ## Returnerer cosinus til et tall
-COSH = COSH ## Returnerer den hyperbolske cosinus til et tall
-DEGREES = GRADER ## Konverterer radianer til grader
-EVEN = AVRUND.TIL.PARTALL ## Runder av et tall oppover til nærmeste heltall som er et partall
-EXP = EKSP ## Returnerer e opphøyd i en angitt potens
-FACT = FAKULTET ## Returnerer fakultet til et tall
-FACTDOUBLE = DOBBELFAKT ## Returnerer et talls doble fakultet
-FLOOR = AVRUND.GJELDENDE.MULTIPLUM.NED ## Avrunder et tall nedover, mot null
-GCD = SFF ## Returnerer høyeste felles divisor
-INT = HELTALL ## Avrunder et tall nedover til nærmeste heltall
-LCM = MFM ## Returnerer minste felles multiplum
-LN = LN ## Returnerer den naturlige logaritmen til et tall
-LOG = LOG ## Returnerer logaritmen for et tall til et angitt grunntall
-LOG10 = LOG10 ## Returnerer logaritmen med grunntall 10 for et tall
-MDETERM = MDETERM ## Returnerer matrisedeterminanten til en matrise
-MINVERSE = MINVERS ## Returnerer den inverse matrisen til en matrise
-MMULT = MMULT ## Returnerer matriseproduktet av to matriser
-MOD = REST ## Returnerer resten fra en divisjon
-MROUND = MRUND ## Returnerer et tall avrundet til det ønskede multiplum
-MULTINOMIAL = MULTINOMINELL ## Returnerer det multinominelle for et sett med tall
-ODD = AVRUND.TIL.ODDETALL ## Runder av et tall oppover til nærmeste heltall som er et oddetall
-PI = PI ## Returnerer verdien av pi
-POWER = OPPHØYD.I ## Returnerer resultatet av et tall opphøyd i en potens
-PRODUCT = PRODUKT ## Multipliserer argumentene
-QUOTIENT = KVOTIENT ## Returnerer heltallsdelen av en divisjon
-RADIANS = RADIANER ## Konverterer grader til radianer
-RAND = TILFELDIG ## Returnerer et tilfeldig tall mellom 0 og 1
-RANDBETWEEN = TILFELDIGMELLOM ## Returnerer et tilfeldig tall innenfor et angitt område
-ROMAN = ROMERTALL ## Konverterer vanlige tall til romertall, som tekst
-ROUND = AVRUND ## Avrunder et tall til et angitt antall sifre
-ROUNDDOWN = AVRUND.NED ## Avrunder et tall nedover, mot null
-ROUNDUP = AVRUND.OPP ## Runder av et tall oppover, bort fra null
-SERIESSUM = SUMMER.REKKE ## Returnerer summen av en geometrisk rekke, basert på formelen
-SIGN = FORTEGN ## Returnerer fortegnet for et tall
-SIN = SIN ## Returnerer sinus til en gitt vinkel
-SINH = SINH ## Returnerer den hyperbolske sinus til et tall
-SQRT = ROT ## Returnerer en positiv kvadratrot
-SQRTPI = ROTPI ## Returnerer kvadratroten av (tall * pi)
-SUBTOTAL = DELSUM ## Returnerer en delsum i en liste eller database
-SUM = SUMMER ## Legger sammen argumentene
-SUMIF = SUMMERHVIS ## Legger sammen cellene angitt ved et gitt vilkår
-SUMIFS = SUMMER.HVIS.SETT ## Legger sammen cellene i et område som oppfyller flere vilkår
-SUMPRODUCT = SUMMERPRODUKT ## Returnerer summen av produktene av tilsvarende matrisekomponenter
-SUMSQ = SUMMERKVADRAT ## Returnerer kvadratsummen av argumentene
-SUMX2MY2 = SUMMERX2MY2 ## Returnerer summen av differansen av kvadratene for tilsvarende verdier i to matriser
-SUMX2PY2 = SUMMERX2PY2 ## Returnerer summen av kvadratsummene for tilsvarende verdier i to matriser
-SUMXMY2 = SUMMERXMY2 ## Returnerer summen av kvadratene av differansen for tilsvarende verdier i to matriser
-TAN = TAN ## Returnerer tangens for et tall
-TANH = TANH ## Returnerer den hyperbolske tangens for et tall
-TRUNC = AVKORT ## Korter av et tall til et heltall
-
-
-##
-## Statistical functions Statistiske funksjoner
-##
-AVEDEV = GJENNOMSNITTSAVVIK ## Returnerer datapunktenes gjennomsnittlige absoluttavvik fra middelverdien
-AVERAGE = GJENNOMSNITT ## Returnerer gjennomsnittet for argumentene
-AVERAGEA = GJENNOMSNITTA ## Returnerer gjennomsnittet for argumentene, inkludert tall, tekst og logiske verdier
-AVERAGEIF = GJENNOMSNITTHVIS ## Returnerer gjennomsnittet (aritmetisk gjennomsnitt) av alle cellene i et område som oppfyller et bestemt vilkår
-AVERAGEIFS = GJENNOMSNITT.HVIS.SETT ## Returnerer gjennomsnittet (aritmetisk middelverdi) av alle celler som oppfyller flere vilkår.
-BETADIST = BETA.FORDELING ## Returnerer den kumulative betafordelingsfunksjonen
-BETAINV = INVERS.BETA.FORDELING ## Returnerer den inverse verdien til fordelingsfunksjonen for en angitt betafordeling
-BINOMDIST = BINOM.FORDELING ## Returnerer den individuelle binomiske sannsynlighetsfordelingen
-CHIDIST = KJI.FORDELING ## Returnerer den ensidige sannsynligheten for en kjikvadrert fordeling
-CHIINV = INVERS.KJI.FORDELING ## Returnerer den inverse av den ensidige sannsynligheten for den kjikvadrerte fordelingen
-CHITEST = KJI.TEST ## Utfører testen for uavhengighet
-CONFIDENCE = KONFIDENS ## Returnerer konfidensintervallet til gjennomsnittet for en populasjon
-CORREL = KORRELASJON ## Returnerer korrelasjonskoeffisienten mellom to datasett
-COUNT = ANTALL ## Teller hvor mange tall som er i argumentlisten
-COUNTA = ANTALLA ## Teller hvor mange verdier som er i argumentlisten
-COUNTBLANK = TELLBLANKE ## Teller antall tomme celler i et område.
-COUNTIF = ANTALL.HVIS ## Teller antall celler i et område som oppfyller gitte vilkår
-COUNTIFS = ANTALL.HVIS.SETT ## Teller antallet ikke-tomme celler i et område som oppfyller flere vilkår
-COVAR = KOVARIANS ## Returnerer kovariansen, gjennomsnittet av produktene av parvise avvik
-CRITBINOM = GRENSE.BINOM ## Returnerer den minste verdien der den kumulative binomiske fordelingen er mindre enn eller lik en vilkårsverdi
-DEVSQ = AVVIK.KVADRERT ## Returnerer summen av kvadrerte avvik
-EXPONDIST = EKSP.FORDELING ## Returnerer eksponentialfordelingen
-FDIST = FFORDELING ## Returnerer F-sannsynlighetsfordelingen
-FINV = FFORDELING.INVERS ## Returnerer den inverse av den sannsynlige F-fordelingen
-FISHER = FISHER ## Returnerer Fisher-transformasjonen
-FISHERINV = FISHERINV ## Returnerer den inverse av Fisher-transformasjonen
-FORECAST = PROGNOSE ## Returnerer en verdi langs en lineær trend
-FREQUENCY = FREKVENS ## Returnerer en frekvensdistribusjon som en loddrett matrise
-FTEST = FTEST ## Returnerer resultatet av en F-test
-GAMMADIST = GAMMAFORDELING ## Returnerer gammafordelingen
-GAMMAINV = GAMMAINV ## Returnerer den inverse av den gammakumulative fordelingen
-GAMMALN = GAMMALN ## Returnerer den naturlige logaritmen til gammafunksjonen G(x)
-GEOMEAN = GJENNOMSNITT.GEOMETRISK ## Returnerer den geometriske middelverdien
-GROWTH = VEKST ## Returnerer verdier langs en eksponentiell trend
-HARMEAN = GJENNOMSNITT.HARMONISK ## Returnerer den harmoniske middelverdien
-HYPGEOMDIST = HYPGEOM.FORDELING ## Returnerer den hypergeometriske fordelingen
-INTERCEPT = SKJÆRINGSPUNKT ## Returnerer skjæringspunktet til den lineære regresjonslinjen
-KURT = KURT ## Returnerer kurtosen til et datasett
-LARGE = N.STØRST ## Returnerer den n-te største verdien i et datasett
-LINEST = RETTLINJE ## Returnerer parameterne til en lineær trend
-LOGEST = KURVE ## Returnerer parameterne til en eksponentiell trend
-LOGINV = LOGINV ## Returnerer den inverse lognormale fordelingen
-LOGNORMDIST = LOGNORMFORD ## Returnerer den kumulative lognormale fordelingen
-MAX = STØRST ## Returnerer maksimumsverdien i en argumentliste
-MAXA = MAKSA ## Returnerer maksimumsverdien i en argumentliste, inkludert tall, tekst og logiske verdier
-MEDIAN = MEDIAN ## Returnerer medianen til tallene som er gitt
-MIN = MIN ## Returnerer minimumsverdien i en argumentliste
-MINA = MINA ## Returnerer den minste verdien i en argumentliste, inkludert tall, tekst og logiske verdier
-MODE = MODUS ## Returnerer den vanligste verdien i et datasett
-NEGBINOMDIST = NEGBINOM.FORDELING ## Returnerer den negative binomiske fordelingen
-NORMDIST = NORMALFORDELING ## Returnerer den kumulative normalfordelingen
-NORMINV = NORMINV ## Returnerer den inverse kumulative normalfordelingen
-NORMSDIST = NORMSFORDELING ## Returnerer standard kumulativ normalfordeling
-NORMSINV = NORMSINV ## Returnerer den inverse av den den kumulative standard normalfordelingen
-PEARSON = PEARSON ## Returnerer produktmomentkorrelasjonskoeffisienten, Pearson
-PERCENTILE = PERSENTIL ## Returnerer den n-te persentil av verdiene i et område
-PERCENTRANK = PROSENTDEL ## Returnerer prosentrangeringen av en verdi i et datasett
-PERMUT = PERMUTER ## Returnerer antall permutasjoner for et gitt antall objekter
-POISSON = POISSON ## Returnerer Poissons sannsynlighetsfordeling
-PROB = SANNSYNLIG ## Returnerer sannsynligheten for at verdier i et område ligger mellom to grenser
-QUARTILE = KVARTIL ## Returnerer kvartilen til et datasett
-RANK = RANG ## Returnerer rangeringen av et tall, eller plassen tallet har i en rekke
-RSQ = RKVADRAT ## Returnerer kvadratet av produktmomentkorrelasjonskoeffisienten (Pearsons r)
-SKEW = SKJEVFORDELING ## Returnerer skjevheten i en fordeling
-SLOPE = STIGNINGSTALL ## Returnerer stigningtallet for den lineære regresjonslinjen
-SMALL = N.MINST ## Returnerer den n-te minste verdien i et datasett
-STANDARDIZE = NORMALISER ## Returnerer en normalisert verdi
-STDEV = STDAV ## Estimere standardavvik på grunnlag av et utvalg
-STDEVA = STDAVVIKA ## Estimerer standardavvik basert på et utvalg, inkludert tall, tekst og logiske verdier
-STDEVP = STDAVP ## Beregner standardavvik basert på hele populasjonen
-STDEVPA = STDAVVIKPA ## Beregner standardavvik basert på hele populasjonen, inkludert tall, tekst og logiske verdier
-STEYX = STANDARDFEIL ## Returnerer standardfeilen for den predikerte y-verdien for hver x i regresjonen
-TDIST = TFORDELING ## Returnerer en Student t-fordeling
-TINV = TINV ## Returnerer den inverse Student t-fordelingen
-TREND = TREND ## Returnerer verdier langs en lineær trend
-TRIMMEAN = TRIMMET.GJENNOMSNITT ## Returnerer den interne middelverdien til et datasett
-TTEST = TTEST ## Returnerer sannsynligheten assosiert med en Student t-test
-VAR = VARIANS ## Estimerer varians basert på et utvalg
-VARA = VARIANSA ## Estimerer varians basert på et utvalg, inkludert tall, tekst og logiske verdier
-VARP = VARIANSP ## Beregner varians basert på hele populasjonen
-VARPA = VARIANSPA ## Beregner varians basert på hele populasjonen, inkludert tall, tekst og logiske verdier
-WEIBULL = WEIBULL.FORDELING ## Returnerer Weibull-fordelingen
-ZTEST = ZTEST ## Returnerer den ensidige sannsynlighetsverdien for en z-test
-
-
-##
-## Text functions Tekstfunksjoner
-##
-ASC = STIGENDE ## Endrer fullbreddes (dobbeltbyte) engelske bokstaver eller katakana i en tegnstreng, til halvbreddes (enkeltbyte) tegn
-BAHTTEXT = BAHTTEKST ## Konverterer et tall til tekst, og bruker valutaformatet ß (baht)
-CHAR = TEGNKODE ## Returnerer tegnet som svarer til kodenummeret
-CLEAN = RENSK ## Fjerner alle tegn som ikke kan skrives ut, fra teksten
-CODE = KODE ## Returnerer en numerisk kode for det første tegnet i en tekststreng
-CONCATENATE = KJEDE.SAMMEN ## Slår sammen flere tekstelementer til ett tekstelement
-DOLLAR = VALUTA ## Konverterer et tall til tekst, og bruker valutaformatet $ (dollar)
-EXACT = EKSAKT ## Kontrollerer om to tekstverdier er like
-FIND = FINN ## Finner en tekstverdi inne i en annen (skiller mellom store og små bokstaver)
-FINDB = FINNB ## Finner en tekstverdi inne i en annen (skiller mellom store og små bokstaver)
-FIXED = FASTSATT ## Formaterer et tall som tekst med et bestemt antall desimaler
-JIS = JIS ## Endrer halvbreddes (enkeltbyte) engelske bokstaver eller katakana i en tegnstreng, til fullbreddes (dobbeltbyte) tegn
-LEFT = VENSTRE ## Returnerer tegnene lengst til venstre i en tekstverdi
-LEFTB = VENSTREB ## Returnerer tegnene lengst til venstre i en tekstverdi
-LEN = LENGDE ## Returnerer antall tegn i en tekststreng
-LENB = LENGDEB ## Returnerer antall tegn i en tekststreng
-LOWER = SMÅ ## Konverterer tekst til små bokstaver
-MID = DELTEKST ## Returnerer et angitt antall tegn fra en tekststreng, og begynner fra posisjonen du angir
-MIDB = DELTEKSTB ## Returnerer et angitt antall tegn fra en tekststreng, og begynner fra posisjonen du angir
-PHONETIC = FURIGANA ## Trekker ut fonetiske tegn (furigana) fra en tekststreng
-PROPER = STOR.FORBOKSTAV ## Gir den første bokstaven i hvert ord i en tekstverdi stor forbokstav
-REPLACE = ERSTATT ## Erstatter tegn i en tekst
-REPLACEB = ERSTATTB ## Erstatter tegn i en tekst
-REPT = GJENTA ## Gjentar tekst et gitt antall ganger
-RIGHT = HØYRE ## Returnerer tegnene lengst til høyre i en tekstverdi
-RIGHTB = HØYREB ## Returnerer tegnene lengst til høyre i en tekstverdi
-SEARCH = SØK ## Finner en tekstverdi inne i en annen (skiller ikke mellom store og små bokstaver)
-SEARCHB = SØKB ## Finner en tekstverdi inne i en annen (skiller ikke mellom store og små bokstaver)
-SUBSTITUTE = BYTT.UT ## Bytter ut gammel tekst med ny tekst i en tekststreng
-T = T ## Konverterer argumentene til tekst
-TEXT = TEKST ## Formaterer et tall og konverterer det til tekst
-TRIM = TRIMME ## Fjerner mellomrom fra tekst
-UPPER = STORE ## Konverterer tekst til store bokstaver
-VALUE = VERDI ## Konverterer et tekstargument til et tall
+##
+## PhpSpreadsheet
+##
+## Data in this file derived from https://www.excel-function-translation.com/
+##
+##
+
+
+##
+## Add-in and Automation functions Funksjonene Tillegg og Automatisering
+##
+GETPIVOTDATA = HENTPIVOTDATA ## Returnerer data som er lagret i en pivottabellrapport
+
+
+##
+## Cube functions Kubefunksjoner
+##
+CUBEKPIMEMBER = KUBEKPIMEDLEM ## Returnerer navnet, egenskapen og målet for en viktig ytelsesindikator (KPI), og viser navnet og egenskapen i cellen. En KPI er en målbar enhet, for eksempel månedlig bruttoinntjening eller kvartalsvis inntjening per ansatt, og brukes til å overvåke ytelsen i en organisasjon.
+CUBEMEMBER = KUBEMEDLEM ## Returnerer et medlem eller en tuppel i et kubehierarki. Brukes til å validere at medlemmet eller tuppelen finnes i kuben.
+CUBEMEMBERPROPERTY = KUBEMEDLEMEGENSKAP ## Returnerer verdien til en medlemsegenskap i kuben. Brukes til å validere at et medlemsnavn finnes i kuben, og til å returnere den angitte egenskapen for dette medlemmet.
+CUBERANKEDMEMBER = KUBERANGERTMEDLEM ## Returnerer det n-te, eller rangerte, medlemmet i et sett. Brukes til å returnere ett eller flere elementer i et sett, for eksempel de 10 beste studentene.
+CUBESET = KUBESETT ## Definerer et beregnet sett av medlemmer eller tuppeler ved å sende et settuttrykk til kuben på serveren, noe som oppretter settet og deretter returnerer dette settet til Microsoft Office Excel.
+CUBESETCOUNT = KUBESETTANTALL ## Returnerer antallet elementer i et sett.
+CUBEVALUE = KUBEVERDI ## Returnerer en aggregert verdi fra en kube.
+
+
+##
+## Database functions Databasefunksjoner
+##
+DAVERAGE = DGJENNOMSNITT ## Returnerer gjennomsnittet av merkede databaseposter
+DCOUNT = DANTALL ## Teller celler som inneholder tall i en database
+DCOUNTA = DANTALLA ## Teller celler som ikke er tomme i en database
+DGET = DHENT ## Trekker ut fra en database en post som oppfyller angitte vilkår
+DMAX = DMAKS ## Returnerer maksimumsverdien fra merkede databaseposter
+DMIN = DMIN ## Returnerer minimumsverdien fra merkede databaseposter
+DPRODUCT = DPRODUKT ## Multipliserer verdiene i et bestemt felt med poster som oppfyller vilkårene i en database
+DSTDEV = DSTDAV ## Estimerer standardavviket basert på et utvalg av merkede databaseposter
+DSTDEVP = DSTAVP ## Beregner standardavviket basert på at merkede databaseposter utgjør hele populasjonen
+DSUM = DSUMMER ## Legger til tallene i feltkolonnen med poster, i databasen som oppfyller vilkårene
+DVAR = DVARIANS ## Estimerer variansen basert på et utvalg av merkede databaseposter
+DVARP = DVARIANSP ## Beregner variansen basert på at merkede databaseposter utgjør hele populasjonen
+
+
+##
+## Date and time functions Dato- og tidsfunksjoner
+##
+DATE = DATO ## Returnerer serienummeret som svarer til en bestemt dato
+DATEVALUE = DATOVERDI ## Konverterer en dato med tekstformat til et serienummer
+DAY = DAG ## Konverterer et serienummer til en dag i måneden
+DAYS360 = DAGER360 ## Beregner antall dager mellom to datoer basert på et år med 360 dager
+EDATE = DAG.ETTER ## Returnerer serienummeret som svarer til datoen som er det indikerte antall måneder før eller etter startdatoen
+EOMONTH = MÅNEDSSLUTT ## Returnerer serienummeret som svarer til siste dag i måneden, før eller etter et angitt antall måneder
+HOUR = TIME ## Konverterer et serienummer til en time
+MINUTE = MINUTT ## Konverterer et serienummer til et minutt
+MONTH = MÅNED ## Konverterer et serienummer til en måned
+NETWORKDAYS = NETT.ARBEIDSDAGER ## Returnerer antall hele arbeidsdager mellom to datoer
+NOW = NÅ ## Returnerer serienummeret som svarer til gjeldende dato og klokkeslett
+SECOND = SEKUND ## Konverterer et serienummer til et sekund
+TIME = TID ## Returnerer serienummeret som svarer til et bestemt klokkeslett
+TIMEVALUE = TIDSVERDI ## Konverterer et klokkeslett i tekstformat til et serienummer
+TODAY = IDAG ## Returnerer serienummeret som svarer til dagens dato
+WEEKDAY = UKEDAG ## Konverterer et serienummer til en ukedag
+WEEKNUM = UKENR ## Konverterer et serienummer til et tall som representerer hvilket nummer uken har i et år
+WORKDAY = ARBEIDSDAG ## Returnerer serienummeret som svarer til datoen før eller etter et angitt antall arbeidsdager
+YEAR = ÅR ## Konverterer et serienummer til et år
+YEARFRAC = ÅRDEL ## Returnerer brøkdelen for året, som svarer til antall hele dager mellom startdato og sluttdato
+
+
+##
+## Engineering functions Tekniske funksjoner
+##
+BESSELI = BESSELI ## Returnerer den endrede Bessel-funksjonen In(x)
+BESSELJ = BESSELJ ## Returnerer Bessel-funksjonen Jn(x)
+BESSELK = BESSELK ## Returnerer den endrede Bessel-funksjonen Kn(x)
+BESSELY = BESSELY ## Returnerer Bessel-funksjonen Yn(x)
+BIN2DEC = BINTILDES ## Konverterer et binært tall til et desimaltall
+BIN2HEX = BINTILHEKS ## Konverterer et binært tall til et heksadesimaltall
+BIN2OCT = BINTILOKT ## Konverterer et binært tall til et oktaltall
+COMPLEX = KOMPLEKS ## Konverterer reelle og imaginære koeffisienter til et komplekst tall
+CONVERT = KONVERTER ## Konverterer et tall fra ett målsystem til et annet
+DEC2BIN = DESTILBIN ## Konverterer et desimaltall til et binærtall
+DEC2HEX = DESTILHEKS ## Konverterer et heltall i 10-tallsystemet til et heksadesimalt tall
+DEC2OCT = DESTILOKT ## Konverterer et heltall i 10-tallsystemet til et oktaltall
+DELTA = DELTA ## Undersøker om to verdier er like
+ERF = FEILF ## Returnerer feilfunksjonen
+ERFC = FEILFK ## Returnerer den komplementære feilfunksjonen
+GESTEP = GRENSEVERDI ## Tester om et tall er større enn en terskelverdi
+HEX2BIN = HEKSTILBIN ## Konverterer et heksadesimaltall til et binært tall
+HEX2DEC = HEKSTILDES ## Konverterer et heksadesimalt tall til et heltall i 10-tallsystemet
+HEX2OCT = HEKSTILOKT ## Konverterer et heksadesimalt tall til et oktaltall
+IMABS = IMABS ## Returnerer absoluttverdien (koeffisienten) til et komplekst tall
+IMAGINARY = IMAGINÆR ## Returnerer den imaginære koeffisienten til et komplekst tall
+IMARGUMENT = IMARGUMENT ## Returnerer argumentet theta, som er en vinkel uttrykt i radianer
+IMCONJUGATE = IMKONJUGERT ## Returnerer den komplekse konjugaten til et komplekst tall
+IMCOS = IMCOS ## Returnerer cosinus til et komplekst tall
+IMDIV = IMDIV ## Returnerer kvotienten til to komplekse tall
+IMEXP = IMEKSP ## Returnerer eksponenten til et komplekst tall
+IMLN = IMLN ## Returnerer den naturlige logaritmen for et komplekst tall
+IMLOG10 = IMLOG10 ## Returnerer logaritmen med grunntall 10 for et komplekst tall
+IMLOG2 = IMLOG2 ## Returnerer logaritmen med grunntall 2 for et komplekst tall
+IMPOWER = IMOPPHØY ## Returnerer et komplekst tall opphøyd til en heltallspotens
+IMPRODUCT = IMPRODUKT ## Returnerer produktet av komplekse tall
+IMREAL = IMREELL ## Returnerer den reelle koeffisienten til et komplekst tall
+IMSIN = IMSIN ## Returnerer sinus til et komplekst tall
+IMSQRT = IMROT ## Returnerer kvadratroten av et komplekst tall
+IMSUB = IMSUB ## Returnerer differansen mellom to komplekse tall
+IMSUM = IMSUMMER ## Returnerer summen av komplekse tall
+OCT2BIN = OKTTILBIN ## Konverterer et oktaltall til et binært tall
+OCT2DEC = OKTTILDES ## Konverterer et oktaltall til et desimaltall
+OCT2HEX = OKTTILHEKS ## Konverterer et oktaltall til et heksadesimaltall
+
+
+##
+## Financial functions Økonomiske funksjoner
+##
+ACCRINT = PÅLØPT.PERIODISK.RENTE ## Returnerer påløpte renter for et verdipapir som betaler periodisk rente
+ACCRINTM = PÅLØPT.FORFALLSRENTE ## Returnerer den påløpte renten for et verdipapir som betaler rente ved forfall
+AMORDEGRC = AMORDEGRC ## Returnerer avskrivningen for hver regnskapsperiode ved hjelp av en avskrivingskoeffisient
+AMORLINC = AMORLINC ## Returnerer avskrivingen for hver regnskapsperiode
+COUPDAYBS = OBLIG.DAGER.FF ## Returnerer antall dager fra begynnelsen av den rentebærende perioden til innløsningsdatoen
+COUPDAYS = OBLIG.DAGER ## Returnerer antall dager i den rentebærende perioden som inneholder innløsningsdatoen
+COUPDAYSNC = OBLIG.DAGER.NF ## Returnerer antall dager fra betalingsdato til neste renteinnbetalingsdato
+COUPNCD = OBLIG.DAGER.EF ## Returnerer obligasjonsdatoen som kommer etter oppgjørsdatoen
+COUPNUM = OBLIG.ANTALL ## Returnerer antall obligasjoner som skal betales mellom oppgjørsdatoen og forfallsdatoen
+COUPPCD = OBLIG.DAG.FORRIGE ## Returnerer obligasjonsdatoen som kommer før oppgjørsdatoen
+CUMIPMT = SAMLET.RENTE ## Returnerer den kumulative renten som er betalt mellom to perioder
+CUMPRINC = SAMLET.HOVEDSTOL ## Returnerer den kumulative hovedstolen som er betalt for et lån mellom to perioder
+DB = DAVSKR ## Returnerer avskrivningen for et aktivum i en angitt periode, foretatt med fast degressiv avskrivning
+DDB = DEGRAVS ## Returnerer avskrivningen for et aktivum for en gitt periode, ved hjelp av dobbel degressiv avskrivning eller en metode som du selv angir
+DISC = DISKONTERT ## Returnerer diskonteringsraten for et verdipapir
+DOLLARDE = DOLLARDE ## Konverterer en valutapris uttrykt som en brøk, til en valutapris uttrykt som et desimaltall
+DOLLARFR = DOLLARBR ## Konverterer en valutapris uttrykt som et desimaltall, til en valutapris uttrykt som en brøk
+DURATION = VARIGHET ## Returnerer årlig varighet for et verdipapir med renter som betales periodisk
+EFFECT = EFFEKTIV.RENTE ## Returnerer den effektive årlige rentesatsen
+FV = SLUTTVERDI ## Returnerer fremtidig verdi for en investering
+FVSCHEDULE = SVPLAN ## Returnerer den fremtidige verdien av en inngående hovedstol etter å ha anvendt en serie med sammensatte rentesatser
+INTRATE = RENTESATS ## Returnerer rentefoten av et fullfinansiert verdipapir
+IPMT = RAVDRAG ## Returnerer betalte renter på en investering for en gitt periode
+IRR = IR ## Returnerer internrenten for en serie kontantstrømmer
+ISPMT = ER.AVDRAG ## Beregner renten som er betalt for en investering i løpet av en bestemt periode
+MDURATION = MVARIGHET ## Returnerer Macauleys modifiserte varighet for et verdipapir med en antatt pålydende verdi på kr 100,00
+MIRR = MODIR ## Returnerer internrenten der positive og negative kontantstrømmer finansieres med forskjellige satser
+NOMINAL = NOMINELL ## Returnerer årlig nominell rentesats
+NPER = PERIODER ## Returnerer antall perioder for en investering
+NPV = NNV ## Returnerer netto nåverdi for en investering, basert på en serie periodiske kontantstrømmer og en rentesats
+ODDFPRICE = AVVIKFP.PRIS ## Returnerer pris pålydende kr 100 for et verdipapir med en odde første periode
+ODDFYIELD = AVVIKFP.AVKASTNING ## Returnerer avkastingen for et verdipapir med en odde første periode
+ODDLPRICE = AVVIKSP.PRIS ## Returnerer pris pålydende kr 100 for et verdipapir med en odde siste periode
+ODDLYIELD = AVVIKSP.AVKASTNING ## Returnerer avkastingen for et verdipapir med en odde siste periode
+PMT = AVDRAG ## Returnerer periodisk betaling for en annuitet
+PPMT = AMORT ## Returnerer betalingen på hovedstolen for en investering i en gitt periode
+PRICE = PRIS ## Returnerer prisen per pålydende kr 100 for et verdipapir som gir periodisk avkastning
+PRICEDISC = PRIS.DISKONTERT ## Returnerer prisen per pålydende kr 100 for et diskontert verdipapir
+PRICEMAT = PRIS.FORFALL ## Returnerer prisen per pålydende kr 100 av et verdipapir som betaler rente ved forfall
+PV = NÅVERDI ## Returnerer nåverdien av en investering
+RATE = RENTE ## Returnerer rentesatsen per periode for en annuitet
+RECEIVED = MOTTATT.AVKAST ## Returnerer summen som mottas ved forfallsdato for et fullinvestert verdipapir
+SLN = LINAVS ## Returnerer den lineære avskrivningen for et aktivum i én periode
+SYD = ÅRSAVS ## Returnerer årsavskrivningen for et aktivum i en angitt periode
+TBILLEQ = TBILLEKV ## Returnerer den obligasjonsekvivalente avkastningen for en statsobligasjon
+TBILLPRICE = TBILLPRIS ## Returnerer prisen per pålydende kr 100 for en statsobligasjon
+TBILLYIELD = TBILLAVKASTNING ## Returnerer avkastningen til en statsobligasjon
+VDB = VERDIAVS ## Returnerer avskrivningen for et aktivum i en angitt periode eller delperiode, ved hjelp av degressiv avskrivning
+XIRR = XIR ## Returnerer internrenten for en serie kontantstrømmer som ikke nødvendigvis er periodiske
+XNPV = XNNV ## Returnerer netto nåverdi for en serie kontantstrømmer som ikke nødvendigvis er periodiske
+YIELD = AVKAST ## Returnerer avkastningen på et verdipapir som betaler periodisk rente
+YIELDDISC = AVKAST.DISKONTERT ## Returnerer årlig avkastning for et diskontert verdipapir, for eksempel en statskasseveksel
+YIELDMAT = AVKAST.FORFALL ## Returnerer den årlige avkastningen for et verdipapir som betaler rente ved forfallsdato
+
+
+##
+## Information functions Informasjonsfunksjoner
+##
+CELL = CELLE ## Returnerer informasjon om formatering, plassering eller innholdet til en celle
+ERROR.TYPE = FEIL.TYPE ## Returnerer et tall som svarer til en feiltype
+INFO = INFO ## Returnerer informasjon om gjeldende operativmiljø
+ISBLANK = ERTOM ## Returnerer SANN hvis verdien er tom
+ISERR = ERFEIL ## Returnerer SANN hvis verdien er en hvilken som helst annen feilverdi enn #I/T
+ISERROR = ERFEIL ## Returnerer SANN hvis verdien er en hvilken som helst feilverdi
+ISEVEN = ERPARTALL ## Returnerer SANN hvis tallet er et partall
+ISLOGICAL = ERLOGISK ## Returnerer SANN hvis verdien er en logisk verdi
+ISNA = ERIT ## Returnerer SANN hvis verdien er feilverdien #I/T
+ISNONTEXT = ERIKKETEKST ## Returnerer SANN hvis verdien ikke er tekst
+ISNUMBER = ERTALL ## Returnerer SANN hvis verdien er et tall
+ISODD = ERODDETALL ## Returnerer SANN hvis tallet er et oddetall
+ISREF = ERREF ## Returnerer SANN hvis verdien er en referanse
+ISTEXT = ERTEKST ## Returnerer SANN hvis verdien er tekst
+N = N ## Returnerer en verdi som er konvertert til et tall
+NA = IT ## Returnerer feilverdien #I/T
+TYPE = VERDITYPE ## Returnerer et tall som indikerer datatypen til en verdi
+
+
+##
+## Logical functions Logiske funksjoner
+##
+AND = OG ## Returnerer SANN hvis alle argumentene er lik SANN
+FALSE = USANN ## Returnerer den logiske verdien USANN
+IF = HVIS ## Angir en logisk test som skal utføres
+IFERROR = HVISFEIL ## Returnerer en verdi du angir hvis en formel evaluerer til en feil. Ellers returnerer den resultatet av formelen.
+NOT = IKKE ## Reverserer logikken til argumentet
+OR = ELLER ## Returnerer SANN hvis ett eller flere argumenter er lik SANN
+TRUE = SANN ## Returnerer den logiske verdien SANN
+
+
+##
+## Lookup and reference functions Oppslag- og referansefunksjoner
+##
+ADDRESS = ADRESSE ## Returnerer en referanse som tekst til en enkelt celle i et regneark
+AREAS = OMRÅDER ## Returnerer antall områder i en referanse
+CHOOSE = VELG ## Velger en verdi fra en liste med verdier
+COLUMN = KOLONNE ## Returnerer kolonnenummeret for en referanse
+COLUMNS = KOLONNER ## Returnerer antall kolonner i en referanse
+HLOOKUP = FINN.KOLONNE ## Leter i den øverste raden i en matrise og returnerer verdien for den angitte cellen
+HYPERLINK = HYPERKOBLING ## Oppretter en snarvei eller et hopp som åpner et dokument som er lagret på en nettverksserver, et intranett eller Internett
+INDEX = INDEKS ## Bruker en indeks til å velge en verdi fra en referanse eller matrise
+INDIRECT = INDIREKTE ## Returnerer en referanse angitt av en tekstverdi
+LOOKUP = SLÅ.OPP ## Slår opp verdier i en vektor eller matrise
+MATCH = SAMMENLIGNE ## Slår opp verdier i en referanse eller matrise
+OFFSET = FORSKYVNING ## Returnerer en referanseforskyvning fra en gitt referanse
+ROW = RAD ## Returnerer radnummeret for en referanse
+ROWS = RADER ## Returnerer antall rader i en referanse
+RTD = RTD ## Henter sanntidsdata fra et program som støtter COM-automatisering (automatisering: En måte å arbeide på med programobjekter fra et annet program- eller utviklingsverktøy. Tidligere kalt OLE-automatisering. Automatisering er en bransjestandard og en funksjon i Component Object Model (COM).)
+TRANSPOSE = TRANSPONER ## Returnerer transponeringen av en matrise
+VLOOKUP = FINN.RAD ## Leter i den første kolonnen i en matrise og flytter bortover raden for å returnere verdien til en celle
+
+
+##
+## Math and trigonometry functions Matematikk- og trigonometrifunksjoner
+##
+ABS = ABS ## Returnerer absoluttverdien til et tall
+ACOS = ARCCOS ## Returnerer arcus cosinus til et tall
+ACOSH = ARCCOSH ## Returnerer den inverse hyperbolske cosinus til et tall
+ASIN = ARCSIN ## Returnerer arcus sinus til et tall
+ASINH = ARCSINH ## Returnerer den inverse hyperbolske sinus til et tall
+ATAN = ARCTAN ## Returnerer arcus tangens til et tall
+ATAN2 = ARCTAN2 ## Returnerer arcus tangens fra x- og y-koordinater
+ATANH = ARCTANH ## Returnerer den inverse hyperbolske tangens til et tall
+CEILING = AVRUND.GJELDENDE.MULTIPLUM ## Runder av et tall til nærmeste heltall eller til nærmeste signifikante multiplum
+COMBIN = KOMBINASJON ## Returnerer antall kombinasjoner for ett gitt antall objekter
+COS = COS ## Returnerer cosinus til et tall
+COSH = COSH ## Returnerer den hyperbolske cosinus til et tall
+DEGREES = GRADER ## Konverterer radianer til grader
+EVEN = AVRUND.TIL.PARTALL ## Runder av et tall oppover til nærmeste heltall som er et partall
+EXP = EKSP ## Returnerer e opphøyd i en angitt potens
+FACT = FAKULTET ## Returnerer fakultet til et tall
+FACTDOUBLE = DOBBELFAKT ## Returnerer et talls doble fakultet
+FLOOR = AVRUND.GJELDENDE.MULTIPLUM.NED ## Avrunder et tall nedover, mot null
+GCD = SFF ## Returnerer høyeste felles divisor
+INT = HELTALL ## Avrunder et tall nedover til nærmeste heltall
+LCM = MFM ## Returnerer minste felles multiplum
+LN = LN ## Returnerer den naturlige logaritmen til et tall
+LOG = LOG ## Returnerer logaritmen for et tall til et angitt grunntall
+LOG10 = LOG10 ## Returnerer logaritmen med grunntall 10 for et tall
+MDETERM = MDETERM ## Returnerer matrisedeterminanten til en matrise
+MINVERSE = MINVERS ## Returnerer den inverse matrisen til en matrise
+MMULT = MMULT ## Returnerer matriseproduktet av to matriser
+MOD = REST ## Returnerer resten fra en divisjon
+MROUND = MRUND ## Returnerer et tall avrundet til det ønskede multiplum
+MULTINOMIAL = MULTINOMINELL ## Returnerer det multinominelle for et sett med tall
+ODD = AVRUND.TIL.ODDETALL ## Runder av et tall oppover til nærmeste heltall som er et oddetall
+PI = PI ## Returnerer verdien av pi
+POWER = OPPHØYD.I ## Returnerer resultatet av et tall opphøyd i en potens
+PRODUCT = PRODUKT ## Multipliserer argumentene
+QUOTIENT = KVOTIENT ## Returnerer heltallsdelen av en divisjon
+RADIANS = RADIANER ## Konverterer grader til radianer
+RAND = TILFELDIG ## Returnerer et tilfeldig tall mellom 0 og 1
+RANDBETWEEN = TILFELDIGMELLOM ## Returnerer et tilfeldig tall innenfor et angitt område
+ROMAN = ROMERTALL ## Konverterer vanlige tall til romertall, som tekst
+ROUND = AVRUND ## Avrunder et tall til et angitt antall sifre
+ROUNDDOWN = AVRUND.NED ## Avrunder et tall nedover, mot null
+ROUNDUP = AVRUND.OPP ## Runder av et tall oppover, bort fra null
+SERIESSUM = SUMMER.REKKE ## Returnerer summen av en geometrisk rekke, basert på formelen
+SIGN = FORTEGN ## Returnerer fortegnet for et tall
+SIN = SIN ## Returnerer sinus til en gitt vinkel
+SINH = SINH ## Returnerer den hyperbolske sinus til et tall
+SQRT = ROT ## Returnerer en positiv kvadratrot
+SQRTPI = ROTPI ## Returnerer kvadratroten av (tall * pi)
+SUBTOTAL = DELSUM ## Returnerer en delsum i en liste eller database
+SUM = SUMMER ## Legger sammen argumentene
+SUMIF = SUMMERHVIS ## Legger sammen cellene angitt ved et gitt vilkår
+SUMIFS = SUMMER.HVIS.SETT ## Legger sammen cellene i et område som oppfyller flere vilkår
+SUMPRODUCT = SUMMERPRODUKT ## Returnerer summen av produktene av tilsvarende matrisekomponenter
+SUMSQ = SUMMERKVADRAT ## Returnerer kvadratsummen av argumentene
+SUMX2MY2 = SUMMERX2MY2 ## Returnerer summen av differansen av kvadratene for tilsvarende verdier i to matriser
+SUMX2PY2 = SUMMERX2PY2 ## Returnerer summen av kvadratsummene for tilsvarende verdier i to matriser
+SUMXMY2 = SUMMERXMY2 ## Returnerer summen av kvadratene av differansen for tilsvarende verdier i to matriser
+TAN = TAN ## Returnerer tangens for et tall
+TANH = TANH ## Returnerer den hyperbolske tangens for et tall
+TRUNC = AVKORT ## Korter av et tall til et heltall
+
+
+##
+## Statistical functions Statistiske funksjoner
+##
+AVEDEV = GJENNOMSNITTSAVVIK ## Returnerer datapunktenes gjennomsnittlige absoluttavvik fra middelverdien
+AVERAGE = GJENNOMSNITT ## Returnerer gjennomsnittet for argumentene
+AVERAGEA = GJENNOMSNITTA ## Returnerer gjennomsnittet for argumentene, inkludert tall, tekst og logiske verdier
+AVERAGEIF = GJENNOMSNITTHVIS ## Returnerer gjennomsnittet (aritmetisk gjennomsnitt) av alle cellene i et område som oppfyller et bestemt vilkår
+AVERAGEIFS = GJENNOMSNITT.HVIS.SETT ## Returnerer gjennomsnittet (aritmetisk middelverdi) av alle celler som oppfyller flere vilkår.
+BETADIST = BETA.FORDELING ## Returnerer den kumulative betafordelingsfunksjonen
+BETAINV = INVERS.BETA.FORDELING ## Returnerer den inverse verdien til fordelingsfunksjonen for en angitt betafordeling
+BINOMDIST = BINOM.FORDELING ## Returnerer den individuelle binomiske sannsynlighetsfordelingen
+CHIDIST = KJI.FORDELING ## Returnerer den ensidige sannsynligheten for en kjikvadrert fordeling
+CHIINV = INVERS.KJI.FORDELING ## Returnerer den inverse av den ensidige sannsynligheten for den kjikvadrerte fordelingen
+CHITEST = KJI.TEST ## Utfører testen for uavhengighet
+CONFIDENCE = KONFIDENS ## Returnerer konfidensintervallet til gjennomsnittet for en populasjon
+CORREL = KORRELASJON ## Returnerer korrelasjonskoeffisienten mellom to datasett
+COUNT = ANTALL ## Teller hvor mange tall som er i argumentlisten
+COUNTA = ANTALLA ## Teller hvor mange verdier som er i argumentlisten
+COUNTBLANK = TELLBLANKE ## Teller antall tomme celler i et område.
+COUNTIF = ANTALL.HVIS ## Teller antall celler i et område som oppfyller gitte vilkår
+COUNTIFS = ANTALL.HVIS.SETT ## Teller antallet ikke-tomme celler i et område som oppfyller flere vilkår
+COVAR = KOVARIANS ## Returnerer kovariansen, gjennomsnittet av produktene av parvise avvik
+CRITBINOM = GRENSE.BINOM ## Returnerer den minste verdien der den kumulative binomiske fordelingen er mindre enn eller lik en vilkårsverdi
+DEVSQ = AVVIK.KVADRERT ## Returnerer summen av kvadrerte avvik
+EXPONDIST = EKSP.FORDELING ## Returnerer eksponentialfordelingen
+FDIST = FFORDELING ## Returnerer F-sannsynlighetsfordelingen
+FINV = FFORDELING.INVERS ## Returnerer den inverse av den sannsynlige F-fordelingen
+FISHER = FISHER ## Returnerer Fisher-transformasjonen
+FISHERINV = FISHERINV ## Returnerer den inverse av Fisher-transformasjonen
+FORECAST = PROGNOSE ## Returnerer en verdi langs en lineær trend
+FREQUENCY = FREKVENS ## Returnerer en frekvensdistribusjon som en loddrett matrise
+FTEST = FTEST ## Returnerer resultatet av en F-test
+GAMMADIST = GAMMAFORDELING ## Returnerer gammafordelingen
+GAMMAINV = GAMMAINV ## Returnerer den inverse av den gammakumulative fordelingen
+GAMMALN = GAMMALN ## Returnerer den naturlige logaritmen til gammafunksjonen G(x)
+GEOMEAN = GJENNOMSNITT.GEOMETRISK ## Returnerer den geometriske middelverdien
+GROWTH = VEKST ## Returnerer verdier langs en eksponentiell trend
+HARMEAN = GJENNOMSNITT.HARMONISK ## Returnerer den harmoniske middelverdien
+HYPGEOMDIST = HYPGEOM.FORDELING ## Returnerer den hypergeometriske fordelingen
+INTERCEPT = SKJÆRINGSPUNKT ## Returnerer skjæringspunktet til den lineære regresjonslinjen
+KURT = KURT ## Returnerer kurtosen til et datasett
+LARGE = N.STØRST ## Returnerer den n-te største verdien i et datasett
+LINEST = RETTLINJE ## Returnerer parameterne til en lineær trend
+LOGEST = KURVE ## Returnerer parameterne til en eksponentiell trend
+LOGINV = LOGINV ## Returnerer den inverse lognormale fordelingen
+LOGNORMDIST = LOGNORMFORD ## Returnerer den kumulative lognormale fordelingen
+MAX = STØRST ## Returnerer maksimumsverdien i en argumentliste
+MAXA = MAKSA ## Returnerer maksimumsverdien i en argumentliste, inkludert tall, tekst og logiske verdier
+MEDIAN = MEDIAN ## Returnerer medianen til tallene som er gitt
+MIN = MIN ## Returnerer minimumsverdien i en argumentliste
+MINA = MINA ## Returnerer den minste verdien i en argumentliste, inkludert tall, tekst og logiske verdier
+MODE = MODUS ## Returnerer den vanligste verdien i et datasett
+NEGBINOMDIST = NEGBINOM.FORDELING ## Returnerer den negative binomiske fordelingen
+NORMDIST = NORMALFORDELING ## Returnerer den kumulative normalfordelingen
+NORMINV = NORMINV ## Returnerer den inverse kumulative normalfordelingen
+NORMSDIST = NORMSFORDELING ## Returnerer standard kumulativ normalfordeling
+NORMSINV = NORMSINV ## Returnerer den inverse av den den kumulative standard normalfordelingen
+PEARSON = PEARSON ## Returnerer produktmomentkorrelasjonskoeffisienten, Pearson
+PERCENTILE = PERSENTIL ## Returnerer den n-te persentil av verdiene i et område
+PERCENTRANK = PROSENTDEL ## Returnerer prosentrangeringen av en verdi i et datasett
+PERMUT = PERMUTER ## Returnerer antall permutasjoner for et gitt antall objekter
+POISSON = POISSON ## Returnerer Poissons sannsynlighetsfordeling
+PROB = SANNSYNLIG ## Returnerer sannsynligheten for at verdier i et område ligger mellom to grenser
+QUARTILE = KVARTIL ## Returnerer kvartilen til et datasett
+RANK = RANG ## Returnerer rangeringen av et tall, eller plassen tallet har i en rekke
+RSQ = RKVADRAT ## Returnerer kvadratet av produktmomentkorrelasjonskoeffisienten (Pearsons r)
+SKEW = SKJEVFORDELING ## Returnerer skjevheten i en fordeling
+SLOPE = STIGNINGSTALL ## Returnerer stigningtallet for den lineære regresjonslinjen
+SMALL = N.MINST ## Returnerer den n-te minste verdien i et datasett
+STANDARDIZE = NORMALISER ## Returnerer en normalisert verdi
+STDEV = STDAV ## Estimere standardavvik på grunnlag av et utvalg
+STDEVA = STDAVVIKA ## Estimerer standardavvik basert på et utvalg, inkludert tall, tekst og logiske verdier
+STDEVP = STDAVP ## Beregner standardavvik basert på hele populasjonen
+STDEVPA = STDAVVIKPA ## Beregner standardavvik basert på hele populasjonen, inkludert tall, tekst og logiske verdier
+STEYX = STANDARDFEIL ## Returnerer standardfeilen for den predikerte y-verdien for hver x i regresjonen
+TDIST = TFORDELING ## Returnerer en Student t-fordeling
+TINV = TINV ## Returnerer den inverse Student t-fordelingen
+TREND = TREND ## Returnerer verdier langs en lineær trend
+TRIMMEAN = TRIMMET.GJENNOMSNITT ## Returnerer den interne middelverdien til et datasett
+TTEST = TTEST ## Returnerer sannsynligheten assosiert med en Student t-test
+VAR = VARIANS ## Estimerer varians basert på et utvalg
+VARA = VARIANSA ## Estimerer varians basert på et utvalg, inkludert tall, tekst og logiske verdier
+VARP = VARIANSP ## Beregner varians basert på hele populasjonen
+VARPA = VARIANSPA ## Beregner varians basert på hele populasjonen, inkludert tall, tekst og logiske verdier
+WEIBULL = WEIBULL.FORDELING ## Returnerer Weibull-fordelingen
+ZTEST = ZTEST ## Returnerer den ensidige sannsynlighetsverdien for en z-test
+
+
+##
+## Text functions Tekstfunksjoner
+##
+ASC = STIGENDE ## Endrer fullbreddes (dobbeltbyte) engelske bokstaver eller katakana i en tegnstreng, til halvbreddes (enkeltbyte) tegn
+BAHTTEXT = BAHTTEKST ## Konverterer et tall til tekst, og bruker valutaformatet ß (baht)
+CHAR = TEGNKODE ## Returnerer tegnet som svarer til kodenummeret
+CLEAN = RENSK ## Fjerner alle tegn som ikke kan skrives ut, fra teksten
+CODE = KODE ## Returnerer en numerisk kode for det første tegnet i en tekststreng
+CONCATENATE = KJEDE.SAMMEN ## Slår sammen flere tekstelementer til ett tekstelement
+DOLLAR = VALUTA ## Konverterer et tall til tekst, og bruker valutaformatet $ (dollar)
+EXACT = EKSAKT ## Kontrollerer om to tekstverdier er like
+FIND = FINN ## Finner en tekstverdi inne i en annen (skiller mellom store og små bokstaver)
+FINDB = FINNB ## Finner en tekstverdi inne i en annen (skiller mellom store og små bokstaver)
+FIXED = FASTSATT ## Formaterer et tall som tekst med et bestemt antall desimaler
+JIS = JIS ## Endrer halvbreddes (enkeltbyte) engelske bokstaver eller katakana i en tegnstreng, til fullbreddes (dobbeltbyte) tegn
+LEFT = VENSTRE ## Returnerer tegnene lengst til venstre i en tekstverdi
+LEFTB = VENSTREB ## Returnerer tegnene lengst til venstre i en tekstverdi
+LEN = LENGDE ## Returnerer antall tegn i en tekststreng
+LENB = LENGDEB ## Returnerer antall tegn i en tekststreng
+LOWER = SMÅ ## Konverterer tekst til små bokstaver
+MID = DELTEKST ## Returnerer et angitt antall tegn fra en tekststreng, og begynner fra posisjonen du angir
+MIDB = DELTEKSTB ## Returnerer et angitt antall tegn fra en tekststreng, og begynner fra posisjonen du angir
+PHONETIC = FURIGANA ## Trekker ut fonetiske tegn (furigana) fra en tekststreng
+PROPER = STOR.FORBOKSTAV ## Gir den første bokstaven i hvert ord i en tekstverdi stor forbokstav
+REPLACE = ERSTATT ## Erstatter tegn i en tekst
+REPLACEB = ERSTATTB ## Erstatter tegn i en tekst
+REPT = GJENTA ## Gjentar tekst et gitt antall ganger
+RIGHT = HØYRE ## Returnerer tegnene lengst til høyre i en tekstverdi
+RIGHTB = HØYREB ## Returnerer tegnene lengst til høyre i en tekstverdi
+SEARCH = SØK ## Finner en tekstverdi inne i en annen (skiller ikke mellom store og små bokstaver)
+SEARCHB = SØKB ## Finner en tekstverdi inne i en annen (skiller ikke mellom store og små bokstaver)
+SUBSTITUTE = BYTT.UT ## Bytter ut gammel tekst med ny tekst i en tekststreng
+T = T ## Konverterer argumentene til tekst
+TEXT = TEKST ## Formaterer et tall og konverterer det til tekst
+TRIM = TRIMME ## Fjerner mellomrom fra tekst
+UPPER = STORE ## Konverterer tekst til store bokstaver
+VALUE = VERDI ## Konverterer et tekstargument til et tall
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pl/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pl/config
new file mode 100644
index 00000000000..00f8b9a340b
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pl/config
@@ -0,0 +1,24 @@
+##
+## PhpSpreadsheet
+##
+
+ArgumentSeparator = ;
+
+
+##
+## (For future use)
+##
+currencySymbol = zł
+
+
+##
+## Excel Error Codes (For future use)
+
+##
+NULL = #ZERO!
+DIV0 = #DZIEL/0!
+VALUE = #ARG!
+REF = #ADR!
+NAME = #NAZWA?
+NUM = #LICZBA!
+NA = #N/D!
diff --git a/lib/phpexcel/PHPExcel/locale/pl/functions b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pl/functions
similarity index 95%
rename from lib/phpexcel/PHPExcel/locale/pl/functions
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pl/functions
index 1881a71e57f..907a4ff0f8e 100644
--- a/lib/phpexcel/PHPExcel/locale/pl/functions
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pl/functions
@@ -1,438 +1,416 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Calculation
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/
-##
-##
-
-
-##
-## Add-in and Automation functions Funkcje dodatków i automatyzacji
-##
-GETPIVOTDATA = WEŹDANETABELI ## Zwraca dane przechowywane w raporcie tabeli przestawnej.
-
-
-##
-## Cube functions Funkcje modułów
-##
-CUBEKPIMEMBER = ELEMENT.KPI.MODUŁU ## Zwraca nazwę, właściwość i miarę kluczowego wskaźnika wydajności (KPI) oraz wyświetla nazwę i właściwość w komórce. Wskaźnik KPI jest miarą ilościową, taką jak miesięczny zysk brutto lub kwartalna fluktuacja pracowników, używaną do monitorowania wydajności organizacji.
-CUBEMEMBER = ELEMENT.MODUŁU ## Zwraca element lub krotkę z hierarchii modułu. Służy do sprawdzania, czy element lub krotka istnieje w module.
-CUBEMEMBERPROPERTY = WŁAŚCIWOŚĆ.ELEMENTU.MODUŁU ## Zwraca wartość właściwości elementu w module. Służy do sprawdzania, czy nazwa elementu istnieje w module, i zwracania określonej właściwości dla tego elementu.
-CUBERANKEDMEMBER = USZEREGOWANY.ELEMENT.MODUŁU ## Zwraca n-ty (albo uszeregowany) element zestawu. Służy do zwracania elementu lub elementów zestawu, na przykład najlepszego sprzedawcy lub 10 najlepszych studentów.
-CUBESET = ZESTAW.MODUŁÓW ## Definiuje obliczony zestaw elementów lub krotek, wysyłając wyrażenie zestawu do serwera modułu, który tworzy zestaw i zwraca go do programu Microsoft Office Excel.
-CUBESETCOUNT = LICZNIK.MODUŁÓW.ZESTAWU ## Zwraca liczbę elementów zestawu.
-CUBEVALUE = WARTOŚĆ.MODUŁU ## Zwraca zagregowaną wartość z modułu.
-
-
-##
-## Database functions Funkcje baz danych
-##
-DAVERAGE = BD.ŚREDNIA ## Zwraca wartość średniej wybranych wpisów bazy danych.
-DCOUNT = BD.ILE.REKORDÓW ## Zlicza komórki zawierające liczby w bazie danych.
-DCOUNTA = BD.ILE.REKORDÓW.A ## Zlicza niepuste komórki w bazie danych.
-DGET = BD.POLE ## Wyodrębnia z bazy danych jeden rekord spełniający określone kryteria.
-DMAX = BD.MAX ## Zwraca wartość maksymalną z wybranych wpisów bazy danych.
-DMIN = BD.MIN ## Zwraca wartość minimalną z wybranych wpisów bazy danych.
-DPRODUCT = BD.ILOCZYN ## Mnoży wartości w konkretnym, spełniającym kryteria polu rekordów bazy danych.
-DSTDEV = BD.ODCH.STANDARD ## Szacuje odchylenie standardowe na podstawie próbki z wybranych wpisów bazy danych.
-DSTDEVP = BD.ODCH.STANDARD.POPUL ## Oblicza odchylenie standardowe na podstawie całej populacji wybranych wpisów bazy danych.
-DSUM = BD.SUMA ## Dodaje liczby w kolumnie pól rekordów bazy danych, które spełniają kryteria.
-DVAR = BD.WARIANCJA ## Szacuje wariancję na podstawie próbki z wybranych wpisów bazy danych.
-DVARP = BD.WARIANCJA.POPUL ## Oblicza wariancję na podstawie całej populacji wybranych wpisów bazy danych.
-
-
-##
-## Date and time functions Funkcje dat, godzin i czasu
-##
-DATE = DATA ## Zwraca liczbę seryjną dla wybranej daty.
-DATEVALUE = DATA.WARTOŚĆ ## Konwertuje datę w formie tekstu na liczbę seryjną.
-DAY = DZIEŃ ## Konwertuje liczbę seryjną na dzień miesiąca.
-DAYS360 = DNI.360 ## Oblicza liczbę dni między dwiema datami na podstawie roku 360-dniowego.
-EDATE = UPŁDNI ## Zwraca liczbę seryjną daty jako wskazaną liczbę miesięcy przed określoną datą początkową lub po niej.
-EOMONTH = EOMONTH ## Zwraca liczbę seryjną ostatniego dnia miesiąca przed określoną liczbą miesięcy lub po niej.
-HOUR = GODZINA ## Konwertuje liczbę seryjną na godzinę.
-MINUTE = MINUTA ## Konwertuje liczbę seryjną na minutę.
-MONTH = MIESIĄC ## Konwertuje liczbę seryjną na miesiąc.
-NETWORKDAYS = NETWORKDAYS ## Zwraca liczbę pełnych dni roboczych między dwiema datami.
-NOW = TERAZ ## Zwraca liczbę seryjną bieżącej daty i godziny.
-SECOND = SEKUNDA ## Konwertuje liczbę seryjną na sekundę.
-TIME = CZAS ## Zwraca liczbę seryjną określonego czasu.
-TIMEVALUE = CZAS.WARTOŚĆ ## Konwertuje czas w formie tekstu na liczbę seryjną.
-TODAY = DZIŚ ## Zwraca liczbę seryjną dla daty bieżącej.
-WEEKDAY = DZIEŃ.TYG ## Konwertuje liczbę seryjną na dzień tygodnia.
-WEEKNUM = WEEKNUM ## Konwertuje liczbę seryjną na liczbę reprezentującą numer tygodnia w roku.
-WORKDAY = WORKDAY ## Zwraca liczbę seryjną dla daty przed określoną liczbą dni roboczych lub po niej.
-YEAR = ROK ## Konwertuje liczbę seryjną na rok.
-YEARFRAC = YEARFRAC ## Zwraca część roku reprezentowaną przez pełną liczbę dni między datą początkową a datą końcową.
-
-
-##
-## Engineering functions Funkcje inżynierskie
-##
-BESSELI = BESSELI ## Zwraca wartość zmodyfikowanej funkcji Bessela In(x).
-BESSELJ = BESSELJ ## Zwraca wartość funkcji Bessela Jn(x).
-BESSELK = BESSELK ## Zwraca wartość zmodyfikowanej funkcji Bessela Kn(x).
-BESSELY = BESSELY ## Zwraca wartość funkcji Bessela Yn(x).
-BIN2DEC = BIN2DEC ## Konwertuje liczbę w postaci dwójkowej na liczbę w postaci dziesiętnej.
-BIN2HEX = BIN2HEX ## Konwertuje liczbę w postaci dwójkowej na liczbę w postaci szesnastkowej.
-BIN2OCT = BIN2OCT ## Konwertuje liczbę w postaci dwójkowej na liczbę w postaci ósemkowej.
-COMPLEX = COMPLEX ## Konwertuje część rzeczywistą i urojoną na liczbę zespoloną.
-CONVERT = CONVERT ## Konwertuje liczbę z jednego systemu miar na inny.
-DEC2BIN = DEC2BIN ## Konwertuje liczbę w postaci dziesiętnej na postać dwójkową.
-DEC2HEX = DEC2HEX ## Konwertuje liczbę w postaci dziesiętnej na liczbę w postaci szesnastkowej.
-DEC2OCT = DEC2OCT ## Konwertuje liczbę w postaci dziesiętnej na liczbę w postaci ósemkowej.
-DELTA = DELTA ## Sprawdza, czy dwie wartości są równe.
-ERF = ERF ## Zwraca wartość funkcji błędu.
-ERFC = ERFC ## Zwraca wartość komplementarnej funkcji błędu.
-GESTEP = GESTEP ## Sprawdza, czy liczba jest większa niż wartość progowa.
-HEX2BIN = HEX2BIN ## Konwertuje liczbę w postaci szesnastkowej na liczbę w postaci dwójkowej.
-HEX2DEC = HEX2DEC ## Konwertuje liczbę w postaci szesnastkowej na liczbę w postaci dziesiętnej.
-HEX2OCT = HEX2OCT ## Konwertuje liczbę w postaci szesnastkowej na liczbę w postaci ósemkowej.
-IMABS = IMABS ## Zwraca wartość bezwzględną (moduł) liczby zespolonej.
-IMAGINARY = IMAGINARY ## Zwraca wartość części urojonej liczby zespolonej.
-IMARGUMENT = IMARGUMENT ## Zwraca wartość argumentu liczby zespolonej, przy czym kąt wyrażony jest w radianach.
-IMCONJUGATE = IMCONJUGATE ## Zwraca wartość liczby sprzężonej danej liczby zespolonej.
-IMCOS = IMCOS ## Zwraca wartość cosinusa liczby zespolonej.
-IMDIV = IMDIV ## Zwraca wartość ilorazu dwóch liczb zespolonych.
-IMEXP = IMEXP ## Zwraca postać wykładniczą liczby zespolonej.
-IMLN = IMLN ## Zwraca wartość logarytmu naturalnego liczby zespolonej.
-IMLOG10 = IMLOG10 ## Zwraca wartość logarytmu dziesiętnego liczby zespolonej.
-IMLOG2 = IMLOG2 ## Zwraca wartość logarytmu liczby zespolonej przy podstawie 2.
-IMPOWER = IMPOWER ## Zwraca wartość liczby zespolonej podniesionej do potęgi całkowitej.
-IMPRODUCT = IMPRODUCT ## Zwraca wartość iloczynu liczb zespolonych.
-IMREAL = IMREAL ## Zwraca wartość części rzeczywistej liczby zespolonej.
-IMSIN = IMSIN ## Zwraca wartość sinusa liczby zespolonej.
-IMSQRT = IMSQRT ## Zwraca wartość pierwiastka kwadratowego z liczby zespolonej.
-IMSUB = IMSUB ## Zwraca wartość różnicy dwóch liczb zespolonych.
-IMSUM = IMSUM ## Zwraca wartość sumy liczb zespolonych.
-OCT2BIN = OCT2BIN ## Konwertuje liczbę w postaci ósemkowej na liczbę w postaci dwójkowej.
-OCT2DEC = OCT2DEC ## Konwertuje liczbę w postaci ósemkowej na liczbę w postaci dziesiętnej.
-OCT2HEX = OCT2HEX ## Konwertuje liczbę w postaci ósemkowej na liczbę w postaci szesnastkowej.
-
-
-##
-## Financial functions Funkcje finansowe
-##
-ACCRINT = ACCRINT ## Zwraca narosłe odsetki dla papieru wartościowego z oprocentowaniem okresowym.
-ACCRINTM = ACCRINTM ## Zwraca narosłe odsetki dla papieru wartościowego z oprocentowaniem w terminie wykupu.
-AMORDEGRC = AMORDEGRC ## Zwraca amortyzację dla każdego okresu rozliczeniowego z wykorzystaniem współczynnika amortyzacji.
-AMORLINC = AMORLINC ## Zwraca amortyzację dla każdego okresu rozliczeniowego.
-COUPDAYBS = COUPDAYBS ## Zwraca liczbę dni od początku okresu dywidendy do dnia rozliczeniowego.
-COUPDAYS = COUPDAYS ## Zwraca liczbę dni w okresie dywidendy, z uwzględnieniem dnia rozliczeniowego.
-COUPDAYSNC = COUPDAYSNC ## Zwraca liczbę dni od dnia rozliczeniowego do daty następnego dnia dywidendy.
-COUPNCD = COUPNCD ## Zwraca dzień następnej dywidendy po dniu rozliczeniowym.
-COUPNUM = COUPNUM ## Zwraca liczbę dywidend płatnych między dniem rozliczeniowym a dniem wykupu.
-COUPPCD = COUPPCD ## Zwraca dzień poprzedniej dywidendy przed dniem rozliczeniowym.
-CUMIPMT = CUMIPMT ## Zwraca wartość procentu składanego płatnego między dwoma okresami.
-CUMPRINC = CUMPRINC ## Zwraca wartość kapitału skumulowanego spłaty pożyczki między dwoma okresami.
-DB = DB ## Zwraca amortyzację środka trwałego w danym okresie metodą degresywną z zastosowaniem stałej bazowej.
-DDB = DDB ## Zwraca amortyzację środka trwałego za podany okres metodą degresywną z zastosowaniem podwójnej bazowej lub metodą określoną przez użytkownika.
-DISC = DISC ## Zwraca wartość stopy dyskontowej papieru wartościowego.
-DOLLARDE = DOLLARDE ## Konwertuje cenę w postaci ułamkowej na cenę wyrażoną w postaci dziesiętnej.
-DOLLARFR = DOLLARFR ## Konwertuje cenę wyrażoną w postaci dziesiętnej na cenę wyrażoną w postaci ułamkowej.
-DURATION = DURATION ## Zwraca wartość rocznego przychodu z papieru wartościowego o okresowych wypłatach oprocentowania.
-EFFECT = EFFECT ## Zwraca wartość efektywnej rocznej stopy procentowej.
-FV = FV ## Zwraca przyszłą wartość lokaty.
-FVSCHEDULE = FVSCHEDULE ## Zwraca przyszłą wartość kapitału początkowego wraz z szeregiem procentów składanych.
-INTRATE = INTRATE ## Zwraca wartość stopy procentowej papieru wartościowego całkowicie ulokowanego.
-IPMT = IPMT ## Zwraca wysokość spłaty oprocentowania lokaty za dany okres.
-IRR = IRR ## Zwraca wartość wewnętrznej stopy zwrotu dla serii przepływów gotówkowych.
-ISPMT = ISPMT ## Oblicza wysokość spłaty oprocentowania za dany okres lokaty.
-MDURATION = MDURATION ## Zwraca wartość zmodyfikowanego okresu Macauleya dla papieru wartościowego o założonej wartości nominalnej 100 zł.
-MIRR = MIRR ## Zwraca wartość wewnętrznej stopy zwrotu dla przypadku, gdy dodatnie i ujemne przepływy gotówkowe mają różne stopy.
-NOMINAL = NOMINAL ## Zwraca wysokość nominalnej rocznej stopy procentowej.
-NPER = NPER ## Zwraca liczbę okresów dla lokaty.
-NPV = NPV ## Zwraca wartość bieżącą netto lokaty na podstawie szeregu okresowych przepływów gotówkowych i stopy dyskontowej.
-ODDFPRICE = ODDFPRICE ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego z nietypowym pierwszym okresem.
-ODDFYIELD = ODDFYIELD ## Zwraca rentowność papieru wartościowego z nietypowym pierwszym okresem.
-ODDLPRICE = ODDLPRICE ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego z nietypowym ostatnim okresem.
-ODDLYIELD = ODDLYIELD ## Zwraca rentowność papieru wartościowego z nietypowym ostatnim okresem.
-PMT = PMT ## Zwraca wartość okresowej płatności raty rocznej.
-PPMT = PPMT ## Zwraca wysokość spłaty kapitału w przypadku lokaty dla danego okresu.
-PRICE = PRICE ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego z oprocentowaniem okresowym.
-PRICEDISC = PRICEDISC ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego zdyskontowanego.
-PRICEMAT = PRICEMAT ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego z oprocentowaniem w terminie wykupu.
-PV = PV ## Zwraca wartość bieżącą lokaty.
-RATE = RATE ## Zwraca wysokość stopy procentowej w okresie raty rocznej.
-RECEIVED = RECEIVED ## Zwraca wartość kapitału otrzymanego przy wykupie papieru wartościowego całkowicie ulokowanego.
-SLN = SLN ## Zwraca amortyzację środka trwałego za jeden okres metodą liniową.
-SYD = SYD ## Zwraca amortyzację środka trwałego za dany okres metodą sumy cyfr lat amortyzacji.
-TBILLEQ = TBILLEQ ## Zwraca rentowność ekwiwalentu obligacji dla bonu skarbowego.
-TBILLPRICE = TBILLPRICE ## Zwraca cenę za 100 zł wartości nominalnej bonu skarbowego.
-TBILLYIELD = TBILLYIELD ## Zwraca rentowność bonu skarbowego.
-VDB = VDB ## Oblicza amortyzację środka trwałego w danym okresie lub jego części metodą degresywną.
-XIRR = XIRR ## Zwraca wartość wewnętrznej stopy zwrotu dla serii rozłożonych w czasie przepływów gotówkowych, niekoniecznie okresowych.
-XNPV = XNPV ## Zwraca wartość bieżącą netto dla serii rozłożonych w czasie przepływów gotówkowych, niekoniecznie okresowych.
-YIELD = YIELD ## Zwraca rentowność papieru wartościowego z oprocentowaniem okresowym.
-YIELDDISC = YIELDDISC ## Zwraca roczną rentowność zdyskontowanego papieru wartościowego, na przykład bonu skarbowego.
-YIELDMAT = YIELDMAT ## Zwraca roczną rentowność papieru wartościowego oprocentowanego przy wykupie.
-
-
-##
-## Information functions Funkcje informacyjne
-##
-CELL = KOMÓRKA ## Zwraca informacje o formacie, położeniu lub zawartości komórki.
-ERROR.TYPE = NR.BŁĘDU ## Zwraca liczbę odpowiadającą typowi błędu.
-INFO = INFO ## Zwraca informację o aktualnym środowisku pracy.
-ISBLANK = CZY.PUSTA ## Zwraca wartość PRAWDA, jeśli wartość jest pusta.
-ISERR = CZY.BŁ ## Zwraca wartość PRAWDA, jeśli wartość jest dowolną wartością błędu, z wyjątkiem #N/D!.
-ISERROR = CZY.BŁĄD ## Zwraca wartość PRAWDA, jeśli wartość jest dowolną wartością błędu.
-ISEVEN = ISEVEN ## Zwraca wartość PRAWDA, jeśli liczba jest parzysta.
-ISLOGICAL = CZY.LOGICZNA ## Zwraca wartość PRAWDA, jeśli wartość jest wartością logiczną.
-ISNA = CZY.BRAK ## Zwraca wartość PRAWDA, jeśli wartość jest wartością błędu #N/D!.
-ISNONTEXT = CZY.NIE.TEKST ## Zwraca wartość PRAWDA, jeśli wartość nie jest tekstem.
-ISNUMBER = CZY.LICZBA ## Zwraca wartość PRAWDA, jeśli wartość jest liczbą.
-ISODD = ISODD ## Zwraca wartość PRAWDA, jeśli liczba jest nieparzysta.
-ISREF = CZY.ADR ## Zwraca wartość PRAWDA, jeśli wartość jest odwołaniem.
-ISTEXT = CZY.TEKST ## Zwraca wartość PRAWDA, jeśli wartość jest tekstem.
-N = L ## Zwraca wartość przekonwertowaną na postać liczbową.
-NA = BRAK ## Zwraca wartość błędu #N/D!.
-TYPE = TYP ## Zwraca liczbę wskazującą typ danych wartości.
-
-
-##
-## Logical functions Funkcje logiczne
-##
-AND = ORAZ ## Zwraca wartość PRAWDA, jeśli wszystkie argumenty mają wartość PRAWDA.
-FALSE = FAŁSZ ## Zwraca wartość logiczną FAŁSZ.
-IF = JEŻELI ## Określa warunek logiczny do sprawdzenia.
-IFERROR = JEŻELI.BŁĄD ## Zwraca określoną wartość, jeśli wynikiem obliczenia formuły jest błąd; w przeciwnym przypadku zwraca wynik formuły.
-NOT = NIE ## Odwraca wartość logiczną argumentu.
-OR = LUB ## Zwraca wartość PRAWDA, jeśli co najmniej jeden z argumentów ma wartość PRAWDA.
-TRUE = PRAWDA ## Zwraca wartość logiczną PRAWDA.
-
-
-##
-## Lookup and reference functions Funkcje wyszukiwania i odwołań
-##
-ADDRESS = ADRES ## Zwraca odwołanie do jednej komórki w arkuszu jako wartość tekstową.
-AREAS = OBSZARY ## Zwraca liczbę obszarów występujących w odwołaniu.
-CHOOSE = WYBIERZ ## Wybiera wartość z listy wartości.
-COLUMN = NR.KOLUMNY ## Zwraca numer kolumny z odwołania.
-COLUMNS = LICZBA.KOLUMN ## Zwraca liczbę kolumn dla danego odwołania.
-HLOOKUP = WYSZUKAJ.POZIOMO ## Przegląda górny wiersz tablicy i zwraca wartość wskazanej komórki.
-HYPERLINK = HIPERŁĄCZE ## Tworzy skrót lub skok, który pozwala otwierać dokument przechowywany na serwerze sieciowym, w sieci intranet lub w Internecie.
-INDEX = INDEKS ## Używa indeksu do wybierania wartości z odwołania lub tablicy.
-INDIRECT = ADR.POŚR ## Zwraca odwołanie określone przez wartość tekstową.
-LOOKUP = WYSZUKAJ ## Wyszukuje wartości w wektorze lub tablicy.
-MATCH = PODAJ.POZYCJĘ ## Wyszukuje wartości w odwołaniu lub w tablicy.
-OFFSET = PRZESUNIĘCIE ## Zwraca adres przesunięty od danego odwołania.
-ROW = WIERSZ ## Zwraca numer wiersza odwołania.
-ROWS = ILE.WIERSZY ## Zwraca liczbę wierszy dla danego odwołania.
-RTD = RTD ## Pobiera dane w czasie rzeczywistym z programu obsługującego automatyzację COM (Automatyzacja: Sposób pracy z obiektami aplikacji pochodzącymi z innej aplikacji lub narzędzia projektowania. Nazywana wcześniej Automatyzacją OLE, Automatyzacja jest standardem przemysłowym i funkcją obiektowego modelu składników (COM, Component Object Model).).
-TRANSPOSE = TRANSPONUJ ## Zwraca transponowaną tablicę.
-VLOOKUP = WYSZUKAJ.PIONOWO ## Przeszukuje pierwszą kolumnę tablicy i przechodzi wzdłuż wiersza, aby zwrócić wartość komórki.
-
-
-##
-## Math and trigonometry functions Funkcje matematyczne i trygonometryczne
-##
-ABS = MODUŁ.LICZBY ## Zwraca wartość absolutną liczby.
-ACOS = ACOS ## Zwraca arcus cosinus liczby.
-ACOSH = ACOSH ## Zwraca arcus cosinus hiperboliczny liczby.
-ASIN = ASIN ## Zwraca arcus sinus liczby.
-ASINH = ASINH ## Zwraca arcus sinus hiperboliczny liczby.
-ATAN = ATAN ## Zwraca arcus tangens liczby.
-ATAN2 = ATAN2 ## Zwraca arcus tangens liczby na podstawie współrzędnych x i y.
-ATANH = ATANH ## Zwraca arcus tangens hiperboliczny liczby.
-CEILING = ZAOKR.W.GÓRĘ ## Zaokrągla liczbę do najbliższej liczby całkowitej lub do najbliższej wielokrotności dokładności.
-COMBIN = KOMBINACJE ## Zwraca liczbę kombinacji dla danej liczby obiektów.
-COS = COS ## Zwraca cosinus liczby.
-COSH = COSH ## Zwraca cosinus hiperboliczny liczby.
-DEGREES = STOPNIE ## Konwertuje radiany na stopnie.
-EVEN = ZAOKR.DO.PARZ ## Zaokrągla liczbę w górę do najbliższej liczby parzystej.
-EXP = EXP ## Zwraca wartość liczby e podniesionej do potęgi określonej przez podaną liczbę.
-FACT = SILNIA ## Zwraca silnię liczby.
-FACTDOUBLE = FACTDOUBLE ## Zwraca podwójną silnię liczby.
-FLOOR = ZAOKR.W.DÓŁ ## Zaokrągla liczbę w dół, w kierunku zera.
-GCD = GCD ## Zwraca największy wspólny dzielnik.
-INT = ZAOKR.DO.CAŁK ## Zaokrągla liczbę w dół do najbliższej liczby całkowitej.
-LCM = LCM ## Zwraca najmniejszą wspólną wielokrotność.
-LN = LN ## Zwraca logarytm naturalny podanej liczby.
-LOG = LOG ## Zwraca logarytm danej liczby przy zadanej podstawie.
-LOG10 = LOG10 ## Zwraca logarytm dziesiętny liczby.
-MDETERM = WYZNACZNIK.MACIERZY ## Zwraca wyznacznik macierzy tablicy.
-MINVERSE = MACIERZ.ODW ## Zwraca odwrotność macierzy tablicy.
-MMULT = MACIERZ.ILOCZYN ## Zwraca iloczyn macierzy dwóch tablic.
-MOD = MOD ## Zwraca resztę z dzielenia.
-MROUND = MROUND ## Zwraca liczbę zaokrągloną do żądanej wielokrotności.
-MULTINOMIAL = MULTINOMIAL ## Zwraca wielomian dla zbioru liczb.
-ODD = ZAOKR.DO.NPARZ ## Zaokrągla liczbę w górę do najbliższej liczby nieparzystej.
-PI = PI ## Zwraca wartość liczby Pi.
-POWER = POTĘGA ## Zwraca liczbę podniesioną do potęgi.
-PRODUCT = ILOCZYN ## Mnoży argumenty.
-QUOTIENT = QUOTIENT ## Zwraca iloraz (całkowity).
-RADIANS = RADIANY ## Konwertuje stopnie na radiany.
-RAND = LOS ## Zwraca liczbę pseudolosową z zakresu od 0 do 1.
-RANDBETWEEN = RANDBETWEEN ## Zwraca liczbę pseudolosową z zakresu określonego przez podane argumenty.
-ROMAN = RZYMSKIE ## Konwertuje liczbę arabską na rzymską jako tekst.
-ROUND = ZAOKR ## Zaokrągla liczbę do określonej liczby cyfr.
-ROUNDDOWN = ZAOKR.DÓŁ ## Zaokrągla liczbę w dół, w kierunku zera.
-ROUNDUP = ZAOKR.GÓRA ## Zaokrągla liczbę w górę, w kierunku od zera.
-SERIESSUM = SERIESSUM ## Zwraca sumę szeregu potęgowego na podstawie wzoru.
-SIGN = ZNAK.LICZBY ## Zwraca znak liczby.
-SIN = SIN ## Zwraca sinus danego kąta.
-SINH = SINH ## Zwraca sinus hiperboliczny liczby.
-SQRT = PIERWIASTEK ## Zwraca dodatni pierwiastek kwadratowy.
-SQRTPI = SQRTPI ## Zwraca pierwiastek kwadratowy iloczynu (liczba * Pi).
-SUBTOTAL = SUMY.POŚREDNIE ## Zwraca sumę częściową listy lub bazy danych.
-SUM = SUMA ## Dodaje argumenty.
-SUMIF = SUMA.JEŻELI ## Dodaje komórki określone przez podane kryterium.
-SUMIFS = SUMA.WARUNKÓW ## Dodaje komórki w zakresie, które spełniają wiele kryteriów.
-SUMPRODUCT = SUMA.ILOCZYNÓW ## Zwraca sumę iloczynów odpowiednich elementów tablicy.
-SUMSQ = SUMA.KWADRATÓW ## Zwraca sumę kwadratów argumentów.
-SUMX2MY2 = SUMA.X2.M.Y2 ## Zwraca sumę różnic kwadratów odpowiednich wartości w dwóch tablicach.
-SUMX2PY2 = SUMA.X2.P.Y2 ## Zwraca sumę sum kwadratów odpowiednich wartości w dwóch tablicach.
-SUMXMY2 = SUMA.XMY.2 ## Zwraca sumę kwadratów różnic odpowiednich wartości w dwóch tablicach.
-TAN = TAN ## Zwraca tangens liczby.
-TANH = TANH ## Zwraca tangens hiperboliczny liczby.
-TRUNC = LICZBA.CAŁK ## Przycina liczbę do wartości całkowitej.
-
-
-##
-## Statistical functions Funkcje statystyczne
-##
-AVEDEV = ODCH.ŚREDNIE ## Zwraca średnią wartość odchyleń absolutnych punktów danych od ich wartości średniej.
-AVERAGE = ŚREDNIA ## Zwraca wartość średnią argumentów.
-AVERAGEA = ŚREDNIA.A ## Zwraca wartość średnią argumentów, z uwzględnieniem liczb, tekstów i wartości logicznych.
-AVERAGEIF = ŚREDNIA.JEŻELI ## Zwraca średnią (średnią arytmetyczną) wszystkich komórek w zakresie, które spełniają podane kryteria.
-AVERAGEIFS = ŚREDNIA.WARUNKÓW ## Zwraca średnią (średnią arytmetyczną) wszystkich komórek, które spełniają jedno lub więcej kryteriów.
-BETADIST = ROZKŁAD.BETA ## Zwraca skumulowaną funkcję gęstości prawdopodobieństwa beta.
-BETAINV = ROZKŁAD.BETA.ODW ## Zwraca odwrotność skumulowanej funkcji gęstości prawdopodobieństwa beta.
-BINOMDIST = ROZKŁAD.DWUM ## Zwraca pojedynczy składnik dwumianowego rozkładu prawdopodobieństwa.
-CHIDIST = ROZKŁAD.CHI ## Zwraca wartość jednostronnego prawdopodobieństwa rozkładu chi-kwadrat.
-CHIINV = ROZKŁAD.CHI.ODW ## Zwraca odwrotność wartości jednostronnego prawdopodobieństwa rozkładu chi-kwadrat.
-CHITEST = TEST.CHI ## Zwraca test niezależności.
-CONFIDENCE = UFNOŚĆ ## Zwraca interwał ufności dla średniej populacji.
-CORREL = WSP.KORELACJI ## Zwraca współczynnik korelacji dwóch zbiorów danych.
-COUNT = ILE.LICZB ## Zlicza liczby znajdujące się na liście argumentów.
-COUNTA = ILE.NIEPUSTYCH ## Zlicza wartości znajdujące się na liście argumentów.
-COUNTBLANK = LICZ.PUSTE ## Zwraca liczbę pustych komórek w pewnym zakresie.
-COUNTIF = LICZ.JEŻELI ## Zlicza komórki wewnątrz zakresu, które spełniają podane kryteria.
-COUNTIFS = LICZ.WARUNKI ## Zlicza komórki wewnątrz zakresu, które spełniają wiele kryteriów.
-COVAR = KOWARIANCJA ## Zwraca kowariancję, czyli średnią wartość iloczynów odpowiednich odchyleń.
-CRITBINOM = PRÓG.ROZKŁAD.DWUM ## Zwraca najmniejszą wartość, dla której skumulowany rozkład dwumianowy jest mniejszy niż wartość kryterium lub równy jej.
-DEVSQ = ODCH.KWADRATOWE ## Zwraca sumę kwadratów odchyleń.
-EXPONDIST = ROZKŁAD.EXP ## Zwraca rozkład wykładniczy.
-FDIST = ROZKŁAD.F ## Zwraca rozkład prawdopodobieństwa F.
-FINV = ROZKŁAD.F.ODW ## Zwraca odwrotność rozkładu prawdopodobieństwa F.
-FISHER = ROZKŁAD.FISHER ## Zwraca transformację Fishera.
-FISHERINV = ROZKŁAD.FISHER.ODW ## Zwraca odwrotność transformacji Fishera.
-FORECAST = REGLINX ## Zwraca wartość trendu liniowego.
-FREQUENCY = CZĘSTOŚĆ ## Zwraca rozkład częstotliwości jako tablicę pionową.
-FTEST = TEST.F ## Zwraca wynik testu F.
-GAMMADIST = ROZKŁAD.GAMMA ## Zwraca rozkład gamma.
-GAMMAINV = ROZKŁAD.GAMMA.ODW ## Zwraca odwrotność skumulowanego rozkładu gamma.
-GAMMALN = ROZKŁAD.LIN.GAMMA ## Zwraca logarytm naturalny funkcji gamma, Γ(x).
-GEOMEAN = ŚREDNIA.GEOMETRYCZNA ## Zwraca średnią geometryczną.
-GROWTH = REGEXPW ## Zwraca wartości trendu wykładniczego.
-HARMEAN = ŚREDNIA.HARMONICZNA ## Zwraca średnią harmoniczną.
-HYPGEOMDIST = ROZKŁAD.HIPERGEOM ## Zwraca rozkład hipergeometryczny.
-INTERCEPT = ODCIĘTA ## Zwraca punkt przecięcia osi pionowej z linią regresji liniowej.
-KURT = KURTOZA ## Zwraca kurtozę zbioru danych.
-LARGE = MAX.K ## Zwraca k-tą największą wartość ze zbioru danych.
-LINEST = REGLINP ## Zwraca parametry trendu liniowego.
-LOGEST = REGEXPP ## Zwraca parametry trendu wykładniczego.
-LOGINV = ROZKŁAD.LOG.ODW ## Zwraca odwrotność rozkładu logarytmu naturalnego.
-LOGNORMDIST = ROZKŁAD.LOG ## Zwraca skumulowany rozkład logarytmu naturalnego.
-MAX = MAX ## Zwraca maksymalną wartość listy argumentów.
-MAXA = MAX.A ## Zwraca maksymalną wartość listy argumentów, z uwzględnieniem liczb, tekstów i wartości logicznych.
-MEDIAN = MEDIANA ## Zwraca medianę podanych liczb.
-MIN = MIN ## Zwraca minimalną wartość listy argumentów.
-MINA = MIN.A ## Zwraca najmniejszą wartość listy argumentów, z uwzględnieniem liczb, tekstów i wartości logicznych.
-MODE = WYST.NAJCZĘŚCIEJ ## Zwraca wartość najczęściej występującą w zbiorze danych.
-NEGBINOMDIST = ROZKŁAD.DWUM.PRZEC ## Zwraca ujemny rozkład dwumianowy.
-NORMDIST = ROZKŁAD.NORMALNY ## Zwraca rozkład normalny skumulowany.
-NORMINV = ROZKŁAD.NORMALNY.ODW ## Zwraca odwrotność rozkładu normalnego skumulowanego.
-NORMSDIST = ROZKŁAD.NORMALNY.S ## Zwraca standardowy rozkład normalny skumulowany.
-NORMSINV = ROZKŁAD.NORMALNY.S.ODW ## Zwraca odwrotność standardowego rozkładu normalnego skumulowanego.
-PEARSON = PEARSON ## Zwraca współczynnik korelacji momentu iloczynu Pearsona.
-PERCENTILE = PERCENTYL ## Wyznacza k-ty percentyl wartości w zakresie.
-PERCENTRANK = PROCENT.POZYCJA ## Zwraca procentową pozycję wartości w zbiorze danych.
-PERMUT = PERMUTACJE ## Zwraca liczbę permutacji dla danej liczby obiektów.
-POISSON = ROZKŁAD.POISSON ## Zwraca rozkład Poissona.
-PROB = PRAWDPD ## Zwraca prawdopodobieństwo, że wartości w zakresie leżą pomiędzy dwiema granicami.
-QUARTILE = KWARTYL ## Wyznacza kwartyl zbioru danych.
-RANK = POZYCJA ## Zwraca pozycję liczby na liście liczb.
-RSQ = R.KWADRAT ## Zwraca kwadrat współczynnika korelacji momentu iloczynu Pearsona.
-SKEW = SKOŚNOŚĆ ## Zwraca skośność rozkładu.
-SLOPE = NACHYLENIE ## Zwraca nachylenie linii regresji liniowej.
-SMALL = MIN.K ## Zwraca k-tą najmniejszą wartość ze zbioru danych.
-STANDARDIZE = NORMALIZUJ ## Zwraca wartość znormalizowaną.
-STDEV = ODCH.STANDARDOWE ## Szacuje odchylenie standardowe na podstawie próbki.
-STDEVA = ODCH.STANDARDOWE.A ## Szacuje odchylenie standardowe na podstawie próbki, z uwzględnieniem liczb, tekstów i wartości logicznych.
-STDEVP = ODCH.STANDARD.POPUL ## Oblicza odchylenie standardowe na podstawie całej populacji.
-STDEVPA = ODCH.STANDARD.POPUL.A ## Oblicza odchylenie standardowe na podstawie całej populacji, z uwzględnieniem liczb, teksów i wartości logicznych.
-STEYX = REGBŁSTD ## Zwraca błąd standardowy przewidzianej wartości y dla każdej wartości x w regresji.
-TDIST = ROZKŁAD.T ## Zwraca rozkład t-Studenta.
-TINV = ROZKŁAD.T.ODW ## Zwraca odwrotność rozkładu t-Studenta.
-TREND = REGLINW ## Zwraca wartości trendu liniowego.
-TRIMMEAN = ŚREDNIA.WEWN ## Zwraca średnią wartość dla wnętrza zbioru danych.
-TTEST = TEST.T ## Zwraca prawdopodobieństwo związane z testem t-Studenta.
-VAR = WARIANCJA ## Szacuje wariancję na podstawie próbki.
-VARA = WARIANCJA.A ## Szacuje wariancję na podstawie próbki, z uwzględnieniem liczb, tekstów i wartości logicznych.
-VARP = WARIANCJA.POPUL ## Oblicza wariancję na podstawie całej populacji.
-VARPA = WARIANCJA.POPUL.A ## Oblicza wariancję na podstawie całej populacji, z uwzględnieniem liczb, tekstów i wartości logicznych.
-WEIBULL = ROZKŁAD.WEIBULL ## Zwraca rozkład Weibulla.
-ZTEST = TEST.Z ## Zwraca wartość jednostronnego prawdopodobieństwa testu z.
-
-
-##
-## Text functions Funkcje tekstowe
-##
-ASC = ASC ## Zamienia litery angielskie lub katakana o pełnej szerokości (dwubajtowe) w ciągu znaków na znaki o szerokości połówkowej (jednobajtowe).
-BAHTTEXT = BAHTTEXT ## Konwertuje liczbę na tekst, stosując format walutowy ß (baht).
-CHAR = ZNAK ## Zwraca znak o podanym numerze kodu.
-CLEAN = OCZYŚĆ ## Usuwa z tekstu wszystkie znaki, które nie mogą być drukowane.
-CODE = KOD ## Zwraca kod numeryczny pierwszego znaku w ciągu tekstowym.
-CONCATENATE = ZŁĄCZ.TEKSTY ## Łączy kilka oddzielnych tekstów w jeden tekst.
-DOLLAR = KWOTA ## Konwertuje liczbę na tekst, stosując format walutowy $ (dolar).
-EXACT = PORÓWNAJ ## Sprawdza identyczność dwóch wartości tekstowych.
-FIND = ZNAJDŹ ## Znajduje jedną wartość tekstową wewnątrz innej (z uwzględnieniem wielkich i małych liter).
-FINDB = ZNAJDŹB ## Znajduje jedną wartość tekstową wewnątrz innej (z uwzględnieniem wielkich i małych liter).
-FIXED = ZAOKR.DO.TEKST ## Formatuje liczbę jako tekst przy stałej liczbie miejsc dziesiętnych.
-JIS = JIS ## Zmienia litery angielskie lub katakana o szerokości połówkowej (jednobajtowe) w ciągu znaków na znaki o pełnej szerokości (dwubajtowe).
-LEFT = LEWY ## Zwraca skrajne lewe znaki z wartości tekstowej.
-LEFTB = LEWYB ## Zwraca skrajne lewe znaki z wartości tekstowej.
-LEN = DŁ ## Zwraca liczbę znaków ciągu tekstowego.
-LENB = DŁ.B ## Zwraca liczbę znaków ciągu tekstowego.
-LOWER = LITERY.MAŁE ## Konwertuje wielkie litery tekstu na małe litery.
-MID = FRAGMENT.TEKSTU ## Zwraca określoną liczbę znaków z ciągu tekstowego, zaczynając od zadanej pozycji.
-MIDB = FRAGMENT.TEKSTU.B ## Zwraca określoną liczbę znaków z ciągu tekstowego, zaczynając od zadanej pozycji.
-PHONETIC = PHONETIC ## Wybiera znaki fonetyczne (furigana) z ciągu tekstowego.
-PROPER = Z.WIELKIEJ.LITERY ## Zastępuje pierwszą literę każdego wyrazu tekstu wielką literą.
-REPLACE = ZASTĄP ## Zastępuje znaki w tekście.
-REPLACEB = ZASTĄP.B ## Zastępuje znaki w tekście.
-REPT = POWT ## Powiela tekst daną liczbę razy.
-RIGHT = PRAWY ## Zwraca skrajne prawe znaki z wartości tekstowej.
-RIGHTB = PRAWYB ## Zwraca skrajne prawe znaki z wartości tekstowej.
-SEARCH = SZUKAJ.TEKST ## Wyszukuje jedną wartość tekstową wewnątrz innej (bez uwzględniania wielkości liter).
-SEARCHB = SZUKAJ.TEKST.B ## Wyszukuje jedną wartość tekstową wewnątrz innej (bez uwzględniania wielkości liter).
-SUBSTITUTE = PODSTAW ## Podstawia nowy tekst w miejsce poprzedniego tekstu w ciągu tekstowym.
-T = T ## Konwertuje argumenty na tekst.
-TEXT = TEKST ## Formatuje liczbę i konwertuje ją na tekst.
-TRIM = USUŃ.ZBĘDNE.ODSTĘPY ## Usuwa spacje z tekstu.
-UPPER = LITERY.WIELKIE ## Konwertuje znaki tekstu na wielkie litery.
-VALUE = WARTOŚĆ ## Konwertuje argument tekstowy na liczbę.
+##
+## PhpSpreadsheet
+##
+## Data in this file derived from https://www.excel-function-translation.com/
+##
+##
+
+
+##
+## Add-in and Automation functions Funkcje dodatków i automatyzacji
+##
+GETPIVOTDATA = WEŹDANETABELI ## Zwraca dane przechowywane w raporcie tabeli przestawnej.
+
+
+##
+## Cube functions Funkcje modułów
+##
+CUBEKPIMEMBER = ELEMENT.KPI.MODUŁU ## Zwraca nazwę, właściwość i miarę kluczowego wskaźnika wydajności (KPI) oraz wyświetla nazwę i właściwość w komórce. Wskaźnik KPI jest miarą ilościową, taką jak miesięczny zysk brutto lub kwartalna fluktuacja pracowników, używaną do monitorowania wydajności organizacji.
+CUBEMEMBER = ELEMENT.MODUŁU ## Zwraca element lub krotkę z hierarchii modułu. Służy do sprawdzania, czy element lub krotka istnieje w module.
+CUBEMEMBERPROPERTY = WŁAŚCIWOŚĆ.ELEMENTU.MODUŁU ## Zwraca wartość właściwości elementu w module. Służy do sprawdzania, czy nazwa elementu istnieje w module, i zwracania określonej właściwości dla tego elementu.
+CUBERANKEDMEMBER = USZEREGOWANY.ELEMENT.MODUŁU ## Zwraca n-ty (albo uszeregowany) element zestawu. Służy do zwracania elementu lub elementów zestawu, na przykład najlepszego sprzedawcy lub 10 najlepszych studentów.
+CUBESET = ZESTAW.MODUŁÓW ## Definiuje obliczony zestaw elementów lub krotek, wysyłając wyrażenie zestawu do serwera modułu, który tworzy zestaw i zwraca go do programu Microsoft Office Excel.
+CUBESETCOUNT = LICZNIK.MODUŁÓW.ZESTAWU ## Zwraca liczbę elementów zestawu.
+CUBEVALUE = WARTOŚĆ.MODUŁU ## Zwraca zagregowaną wartość z modułu.
+
+
+##
+## Database functions Funkcje baz danych
+##
+DAVERAGE = BD.ŚREDNIA ## Zwraca wartość średniej wybranych wpisów bazy danych.
+DCOUNT = BD.ILE.REKORDÓW ## Zlicza komórki zawierające liczby w bazie danych.
+DCOUNTA = BD.ILE.REKORDÓW.A ## Zlicza niepuste komórki w bazie danych.
+DGET = BD.POLE ## Wyodrębnia z bazy danych jeden rekord spełniający określone kryteria.
+DMAX = BD.MAX ## Zwraca wartość maksymalną z wybranych wpisów bazy danych.
+DMIN = BD.MIN ## Zwraca wartość minimalną z wybranych wpisów bazy danych.
+DPRODUCT = BD.ILOCZYN ## Mnoży wartości w konkretnym, spełniającym kryteria polu rekordów bazy danych.
+DSTDEV = BD.ODCH.STANDARD ## Szacuje odchylenie standardowe na podstawie próbki z wybranych wpisów bazy danych.
+DSTDEVP = BD.ODCH.STANDARD.POPUL ## Oblicza odchylenie standardowe na podstawie całej populacji wybranych wpisów bazy danych.
+DSUM = BD.SUMA ## Dodaje liczby w kolumnie pól rekordów bazy danych, które spełniają kryteria.
+DVAR = BD.WARIANCJA ## Szacuje wariancję na podstawie próbki z wybranych wpisów bazy danych.
+DVARP = BD.WARIANCJA.POPUL ## Oblicza wariancję na podstawie całej populacji wybranych wpisów bazy danych.
+
+
+##
+## Date and time functions Funkcje dat, godzin i czasu
+##
+DATE = DATA ## Zwraca liczbę seryjną dla wybranej daty.
+DATEVALUE = DATA.WARTOŚĆ ## Konwertuje datę w formie tekstu na liczbę seryjną.
+DAY = DZIEŃ ## Konwertuje liczbę seryjną na dzień miesiąca.
+DAYS360 = DNI.360 ## Oblicza liczbę dni między dwiema datami na podstawie roku 360-dniowego.
+EDATE = UPŁDNI ## Zwraca liczbę seryjną daty jako wskazaną liczbę miesięcy przed określoną datą początkową lub po niej.
+EOMONTH = EOMONTH ## Zwraca liczbę seryjną ostatniego dnia miesiąca przed określoną liczbą miesięcy lub po niej.
+HOUR = GODZINA ## Konwertuje liczbę seryjną na godzinę.
+MINUTE = MINUTA ## Konwertuje liczbę seryjną na minutę.
+MONTH = MIESIĄC ## Konwertuje liczbę seryjną na miesiąc.
+NETWORKDAYS = NETWORKDAYS ## Zwraca liczbę pełnych dni roboczych między dwiema datami.
+NOW = TERAZ ## Zwraca liczbę seryjną bieżącej daty i godziny.
+SECOND = SEKUNDA ## Konwertuje liczbę seryjną na sekundę.
+TIME = CZAS ## Zwraca liczbę seryjną określonego czasu.
+TIMEVALUE = CZAS.WARTOŚĆ ## Konwertuje czas w formie tekstu na liczbę seryjną.
+TODAY = DZIŚ ## Zwraca liczbę seryjną dla daty bieżącej.
+WEEKDAY = DZIEŃ.TYG ## Konwertuje liczbę seryjną na dzień tygodnia.
+WEEKNUM = WEEKNUM ## Konwertuje liczbę seryjną na liczbę reprezentującą numer tygodnia w roku.
+WORKDAY = WORKDAY ## Zwraca liczbę seryjną dla daty przed określoną liczbą dni roboczych lub po niej.
+YEAR = ROK ## Konwertuje liczbę seryjną na rok.
+YEARFRAC = YEARFRAC ## Zwraca część roku reprezentowaną przez pełną liczbę dni między datą początkową a datą końcową.
+
+
+##
+## Engineering functions Funkcje inżynierskie
+##
+BESSELI = BESSELI ## Zwraca wartość zmodyfikowanej funkcji Bessela In(x).
+BESSELJ = BESSELJ ## Zwraca wartość funkcji Bessela Jn(x).
+BESSELK = BESSELK ## Zwraca wartość zmodyfikowanej funkcji Bessela Kn(x).
+BESSELY = BESSELY ## Zwraca wartość funkcji Bessela Yn(x).
+BIN2DEC = BIN2DEC ## Konwertuje liczbę w postaci dwójkowej na liczbę w postaci dziesiętnej.
+BIN2HEX = BIN2HEX ## Konwertuje liczbę w postaci dwójkowej na liczbę w postaci szesnastkowej.
+BIN2OCT = BIN2OCT ## Konwertuje liczbę w postaci dwójkowej na liczbę w postaci ósemkowej.
+COMPLEX = COMPLEX ## Konwertuje część rzeczywistą i urojoną na liczbę zespoloną.
+CONVERT = CONVERT ## Konwertuje liczbę z jednego systemu miar na inny.
+DEC2BIN = DEC2BIN ## Konwertuje liczbę w postaci dziesiętnej na postać dwójkową.
+DEC2HEX = DEC2HEX ## Konwertuje liczbę w postaci dziesiętnej na liczbę w postaci szesnastkowej.
+DEC2OCT = DEC2OCT ## Konwertuje liczbę w postaci dziesiętnej na liczbę w postaci ósemkowej.
+DELTA = DELTA ## Sprawdza, czy dwie wartości są równe.
+ERF = ERF ## Zwraca wartość funkcji błędu.
+ERFC = ERFC ## Zwraca wartość komplementarnej funkcji błędu.
+GESTEP = GESTEP ## Sprawdza, czy liczba jest większa niż wartość progowa.
+HEX2BIN = HEX2BIN ## Konwertuje liczbę w postaci szesnastkowej na liczbę w postaci dwójkowej.
+HEX2DEC = HEX2DEC ## Konwertuje liczbę w postaci szesnastkowej na liczbę w postaci dziesiętnej.
+HEX2OCT = HEX2OCT ## Konwertuje liczbę w postaci szesnastkowej na liczbę w postaci ósemkowej.
+IMABS = IMABS ## Zwraca wartość bezwzględną (moduł) liczby zespolonej.
+IMAGINARY = IMAGINARY ## Zwraca wartość części urojonej liczby zespolonej.
+IMARGUMENT = IMARGUMENT ## Zwraca wartość argumentu liczby zespolonej, przy czym kąt wyrażony jest w radianach.
+IMCONJUGATE = IMCONJUGATE ## Zwraca wartość liczby sprzężonej danej liczby zespolonej.
+IMCOS = IMCOS ## Zwraca wartość cosinusa liczby zespolonej.
+IMDIV = IMDIV ## Zwraca wartość ilorazu dwóch liczb zespolonych.
+IMEXP = IMEXP ## Zwraca postać wykładniczą liczby zespolonej.
+IMLN = IMLN ## Zwraca wartość logarytmu naturalnego liczby zespolonej.
+IMLOG10 = IMLOG10 ## Zwraca wartość logarytmu dziesiętnego liczby zespolonej.
+IMLOG2 = IMLOG2 ## Zwraca wartość logarytmu liczby zespolonej przy podstawie 2.
+IMPOWER = IMPOWER ## Zwraca wartość liczby zespolonej podniesionej do potęgi całkowitej.
+IMPRODUCT = IMPRODUCT ## Zwraca wartość iloczynu liczb zespolonych.
+IMREAL = IMREAL ## Zwraca wartość części rzeczywistej liczby zespolonej.
+IMSIN = IMSIN ## Zwraca wartość sinusa liczby zespolonej.
+IMSQRT = IMSQRT ## Zwraca wartość pierwiastka kwadratowego z liczby zespolonej.
+IMSUB = IMSUB ## Zwraca wartość różnicy dwóch liczb zespolonych.
+IMSUM = IMSUM ## Zwraca wartość sumy liczb zespolonych.
+OCT2BIN = OCT2BIN ## Konwertuje liczbę w postaci ósemkowej na liczbę w postaci dwójkowej.
+OCT2DEC = OCT2DEC ## Konwertuje liczbę w postaci ósemkowej na liczbę w postaci dziesiętnej.
+OCT2HEX = OCT2HEX ## Konwertuje liczbę w postaci ósemkowej na liczbę w postaci szesnastkowej.
+
+
+##
+## Financial functions Funkcje finansowe
+##
+ACCRINT = ACCRINT ## Zwraca narosłe odsetki dla papieru wartościowego z oprocentowaniem okresowym.
+ACCRINTM = ACCRINTM ## Zwraca narosłe odsetki dla papieru wartościowego z oprocentowaniem w terminie wykupu.
+AMORDEGRC = AMORDEGRC ## Zwraca amortyzację dla każdego okresu rozliczeniowego z wykorzystaniem współczynnika amortyzacji.
+AMORLINC = AMORLINC ## Zwraca amortyzację dla każdego okresu rozliczeniowego.
+COUPDAYBS = COUPDAYBS ## Zwraca liczbę dni od początku okresu dywidendy do dnia rozliczeniowego.
+COUPDAYS = COUPDAYS ## Zwraca liczbę dni w okresie dywidendy, z uwzględnieniem dnia rozliczeniowego.
+COUPDAYSNC = COUPDAYSNC ## Zwraca liczbę dni od dnia rozliczeniowego do daty następnego dnia dywidendy.
+COUPNCD = COUPNCD ## Zwraca dzień następnej dywidendy po dniu rozliczeniowym.
+COUPNUM = COUPNUM ## Zwraca liczbę dywidend płatnych między dniem rozliczeniowym a dniem wykupu.
+COUPPCD = COUPPCD ## Zwraca dzień poprzedniej dywidendy przed dniem rozliczeniowym.
+CUMIPMT = CUMIPMT ## Zwraca wartość procentu składanego płatnego między dwoma okresami.
+CUMPRINC = CUMPRINC ## Zwraca wartość kapitału skumulowanego spłaty pożyczki między dwoma okresami.
+DB = DB ## Zwraca amortyzację środka trwałego w danym okresie metodą degresywną z zastosowaniem stałej bazowej.
+DDB = DDB ## Zwraca amortyzację środka trwałego za podany okres metodą degresywną z zastosowaniem podwójnej bazowej lub metodą określoną przez użytkownika.
+DISC = DISC ## Zwraca wartość stopy dyskontowej papieru wartościowego.
+DOLLARDE = DOLLARDE ## Konwertuje cenę w postaci ułamkowej na cenę wyrażoną w postaci dziesiętnej.
+DOLLARFR = DOLLARFR ## Konwertuje cenę wyrażoną w postaci dziesiętnej na cenę wyrażoną w postaci ułamkowej.
+DURATION = DURATION ## Zwraca wartość rocznego przychodu z papieru wartościowego o okresowych wypłatach oprocentowania.
+EFFECT = EFFECT ## Zwraca wartość efektywnej rocznej stopy procentowej.
+FV = FV ## Zwraca przyszłą wartość lokaty.
+FVSCHEDULE = FVSCHEDULE ## Zwraca przyszłą wartość kapitału początkowego wraz z szeregiem procentów składanych.
+INTRATE = INTRATE ## Zwraca wartość stopy procentowej papieru wartościowego całkowicie ulokowanego.
+IPMT = IPMT ## Zwraca wysokość spłaty oprocentowania lokaty za dany okres.
+IRR = IRR ## Zwraca wartość wewnętrznej stopy zwrotu dla serii przepływów gotówkowych.
+ISPMT = ISPMT ## Oblicza wysokość spłaty oprocentowania za dany okres lokaty.
+MDURATION = MDURATION ## Zwraca wartość zmodyfikowanego okresu Macauleya dla papieru wartościowego o założonej wartości nominalnej 100 zł.
+MIRR = MIRR ## Zwraca wartość wewnętrznej stopy zwrotu dla przypadku, gdy dodatnie i ujemne przepływy gotówkowe mają różne stopy.
+NOMINAL = NOMINAL ## Zwraca wysokość nominalnej rocznej stopy procentowej.
+NPER = NPER ## Zwraca liczbę okresów dla lokaty.
+NPV = NPV ## Zwraca wartość bieżącą netto lokaty na podstawie szeregu okresowych przepływów gotówkowych i stopy dyskontowej.
+ODDFPRICE = ODDFPRICE ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego z nietypowym pierwszym okresem.
+ODDFYIELD = ODDFYIELD ## Zwraca rentowność papieru wartościowego z nietypowym pierwszym okresem.
+ODDLPRICE = ODDLPRICE ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego z nietypowym ostatnim okresem.
+ODDLYIELD = ODDLYIELD ## Zwraca rentowność papieru wartościowego z nietypowym ostatnim okresem.
+PMT = PMT ## Zwraca wartość okresowej płatności raty rocznej.
+PPMT = PPMT ## Zwraca wysokość spłaty kapitału w przypadku lokaty dla danego okresu.
+PRICE = PRICE ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego z oprocentowaniem okresowym.
+PRICEDISC = PRICEDISC ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego zdyskontowanego.
+PRICEMAT = PRICEMAT ## Zwraca cenę za 100 zł wartości nominalnej papieru wartościowego z oprocentowaniem w terminie wykupu.
+PV = PV ## Zwraca wartość bieżącą lokaty.
+RATE = RATE ## Zwraca wysokość stopy procentowej w okresie raty rocznej.
+RECEIVED = RECEIVED ## Zwraca wartość kapitału otrzymanego przy wykupie papieru wartościowego całkowicie ulokowanego.
+SLN = SLN ## Zwraca amortyzację środka trwałego za jeden okres metodą liniową.
+SYD = SYD ## Zwraca amortyzację środka trwałego za dany okres metodą sumy cyfr lat amortyzacji.
+TBILLEQ = TBILLEQ ## Zwraca rentowność ekwiwalentu obligacji dla bonu skarbowego.
+TBILLPRICE = TBILLPRICE ## Zwraca cenę za 100 zł wartości nominalnej bonu skarbowego.
+TBILLYIELD = TBILLYIELD ## Zwraca rentowność bonu skarbowego.
+VDB = VDB ## Oblicza amortyzację środka trwałego w danym okresie lub jego części metodą degresywną.
+XIRR = XIRR ## Zwraca wartość wewnętrznej stopy zwrotu dla serii rozłożonych w czasie przepływów gotówkowych, niekoniecznie okresowych.
+XNPV = XNPV ## Zwraca wartość bieżącą netto dla serii rozłożonych w czasie przepływów gotówkowych, niekoniecznie okresowych.
+YIELD = YIELD ## Zwraca rentowność papieru wartościowego z oprocentowaniem okresowym.
+YIELDDISC = YIELDDISC ## Zwraca roczną rentowność zdyskontowanego papieru wartościowego, na przykład bonu skarbowego.
+YIELDMAT = YIELDMAT ## Zwraca roczną rentowność papieru wartościowego oprocentowanego przy wykupie.
+
+
+##
+## Information functions Funkcje informacyjne
+##
+CELL = KOMÓRKA ## Zwraca informacje o formacie, położeniu lub zawartości komórki.
+ERROR.TYPE = NR.BŁĘDU ## Zwraca liczbę odpowiadającą typowi błędu.
+INFO = INFO ## Zwraca informację o aktualnym środowisku pracy.
+ISBLANK = CZY.PUSTA ## Zwraca wartość PRAWDA, jeśli wartość jest pusta.
+ISERR = CZY.BŁ ## Zwraca wartość PRAWDA, jeśli wartość jest dowolną wartością błędu, z wyjątkiem #N/D!.
+ISERROR = CZY.BŁĄD ## Zwraca wartość PRAWDA, jeśli wartość jest dowolną wartością błędu.
+ISEVEN = ISEVEN ## Zwraca wartość PRAWDA, jeśli liczba jest parzysta.
+ISLOGICAL = CZY.LOGICZNA ## Zwraca wartość PRAWDA, jeśli wartość jest wartością logiczną.
+ISNA = CZY.BRAK ## Zwraca wartość PRAWDA, jeśli wartość jest wartością błędu #N/D!.
+ISNONTEXT = CZY.NIE.TEKST ## Zwraca wartość PRAWDA, jeśli wartość nie jest tekstem.
+ISNUMBER = CZY.LICZBA ## Zwraca wartość PRAWDA, jeśli wartość jest liczbą.
+ISODD = ISODD ## Zwraca wartość PRAWDA, jeśli liczba jest nieparzysta.
+ISREF = CZY.ADR ## Zwraca wartość PRAWDA, jeśli wartość jest odwołaniem.
+ISTEXT = CZY.TEKST ## Zwraca wartość PRAWDA, jeśli wartość jest tekstem.
+N = L ## Zwraca wartość przekonwertowaną na postać liczbową.
+NA = BRAK ## Zwraca wartość błędu #N/D!.
+TYPE = TYP ## Zwraca liczbę wskazującą typ danych wartości.
+
+
+##
+## Logical functions Funkcje logiczne
+##
+AND = ORAZ ## Zwraca wartość PRAWDA, jeśli wszystkie argumenty mają wartość PRAWDA.
+FALSE = FAŁSZ ## Zwraca wartość logiczną FAŁSZ.
+IF = JEŻELI ## Określa warunek logiczny do sprawdzenia.
+IFERROR = JEŻELI.BŁĄD ## Zwraca określoną wartość, jeśli wynikiem obliczenia formuły jest błąd; w przeciwnym przypadku zwraca wynik formuły.
+NOT = NIE ## Odwraca wartość logiczną argumentu.
+OR = LUB ## Zwraca wartość PRAWDA, jeśli co najmniej jeden z argumentów ma wartość PRAWDA.
+TRUE = PRAWDA ## Zwraca wartość logiczną PRAWDA.
+
+
+##
+## Lookup and reference functions Funkcje wyszukiwania i odwołań
+##
+ADDRESS = ADRES ## Zwraca odwołanie do jednej komórki w arkuszu jako wartość tekstową.
+AREAS = OBSZARY ## Zwraca liczbę obszarów występujących w odwołaniu.
+CHOOSE = WYBIERZ ## Wybiera wartość z listy wartości.
+COLUMN = NR.KOLUMNY ## Zwraca numer kolumny z odwołania.
+COLUMNS = LICZBA.KOLUMN ## Zwraca liczbę kolumn dla danego odwołania.
+HLOOKUP = WYSZUKAJ.POZIOMO ## Przegląda górny wiersz tablicy i zwraca wartość wskazanej komórki.
+HYPERLINK = HIPERŁĄCZE ## Tworzy skrót lub skok, który pozwala otwierać dokument przechowywany na serwerze sieciowym, w sieci intranet lub w Internecie.
+INDEX = INDEKS ## Używa indeksu do wybierania wartości z odwołania lub tablicy.
+INDIRECT = ADR.POŚR ## Zwraca odwołanie określone przez wartość tekstową.
+LOOKUP = WYSZUKAJ ## Wyszukuje wartości w wektorze lub tablicy.
+MATCH = PODAJ.POZYCJĘ ## Wyszukuje wartości w odwołaniu lub w tablicy.
+OFFSET = PRZESUNIĘCIE ## Zwraca adres przesunięty od danego odwołania.
+ROW = WIERSZ ## Zwraca numer wiersza odwołania.
+ROWS = ILE.WIERSZY ## Zwraca liczbę wierszy dla danego odwołania.
+RTD = RTD ## Pobiera dane w czasie rzeczywistym z programu obsługującego automatyzację COM (Automatyzacja: Sposób pracy z obiektami aplikacji pochodzącymi z innej aplikacji lub narzędzia projektowania. Nazywana wcześniej Automatyzacją OLE, Automatyzacja jest standardem przemysłowym i funkcją obiektowego modelu składników (COM, Component Object Model).).
+TRANSPOSE = TRANSPONUJ ## Zwraca transponowaną tablicę.
+VLOOKUP = WYSZUKAJ.PIONOWO ## Przeszukuje pierwszą kolumnę tablicy i przechodzi wzdłuż wiersza, aby zwrócić wartość komórki.
+
+
+##
+## Math and trigonometry functions Funkcje matematyczne i trygonometryczne
+##
+ABS = MODUŁ.LICZBY ## Zwraca wartość absolutną liczby.
+ACOS = ACOS ## Zwraca arcus cosinus liczby.
+ACOSH = ACOSH ## Zwraca arcus cosinus hiperboliczny liczby.
+ASIN = ASIN ## Zwraca arcus sinus liczby.
+ASINH = ASINH ## Zwraca arcus sinus hiperboliczny liczby.
+ATAN = ATAN ## Zwraca arcus tangens liczby.
+ATAN2 = ATAN2 ## Zwraca arcus tangens liczby na podstawie współrzędnych x i y.
+ATANH = ATANH ## Zwraca arcus tangens hiperboliczny liczby.
+CEILING = ZAOKR.W.GÓRĘ ## Zaokrągla liczbę do najbliższej liczby całkowitej lub do najbliższej wielokrotności dokładności.
+COMBIN = KOMBINACJE ## Zwraca liczbę kombinacji dla danej liczby obiektów.
+COS = COS ## Zwraca cosinus liczby.
+COSH = COSH ## Zwraca cosinus hiperboliczny liczby.
+DEGREES = STOPNIE ## Konwertuje radiany na stopnie.
+EVEN = ZAOKR.DO.PARZ ## Zaokrągla liczbę w górę do najbliższej liczby parzystej.
+EXP = EXP ## Zwraca wartość liczby e podniesionej do potęgi określonej przez podaną liczbę.
+FACT = SILNIA ## Zwraca silnię liczby.
+FACTDOUBLE = FACTDOUBLE ## Zwraca podwójną silnię liczby.
+FLOOR = ZAOKR.W.DÓŁ ## Zaokrągla liczbę w dół, w kierunku zera.
+GCD = GCD ## Zwraca największy wspólny dzielnik.
+INT = ZAOKR.DO.CAŁK ## Zaokrągla liczbę w dół do najbliższej liczby całkowitej.
+LCM = LCM ## Zwraca najmniejszą wspólną wielokrotność.
+LN = LN ## Zwraca logarytm naturalny podanej liczby.
+LOG = LOG ## Zwraca logarytm danej liczby przy zadanej podstawie.
+LOG10 = LOG10 ## Zwraca logarytm dziesiętny liczby.
+MDETERM = WYZNACZNIK.MACIERZY ## Zwraca wyznacznik macierzy tablicy.
+MINVERSE = MACIERZ.ODW ## Zwraca odwrotność macierzy tablicy.
+MMULT = MACIERZ.ILOCZYN ## Zwraca iloczyn macierzy dwóch tablic.
+MOD = MOD ## Zwraca resztę z dzielenia.
+MROUND = MROUND ## Zwraca liczbę zaokrągloną do żądanej wielokrotności.
+MULTINOMIAL = MULTINOMIAL ## Zwraca wielomian dla zbioru liczb.
+ODD = ZAOKR.DO.NPARZ ## Zaokrągla liczbę w górę do najbliższej liczby nieparzystej.
+PI = PI ## Zwraca wartość liczby Pi.
+POWER = POTĘGA ## Zwraca liczbę podniesioną do potęgi.
+PRODUCT = ILOCZYN ## Mnoży argumenty.
+QUOTIENT = QUOTIENT ## Zwraca iloraz (całkowity).
+RADIANS = RADIANY ## Konwertuje stopnie na radiany.
+RAND = LOS ## Zwraca liczbę pseudolosową z zakresu od 0 do 1.
+RANDBETWEEN = RANDBETWEEN ## Zwraca liczbę pseudolosową z zakresu określonego przez podane argumenty.
+ROMAN = RZYMSKIE ## Konwertuje liczbę arabską na rzymską jako tekst.
+ROUND = ZAOKR ## Zaokrągla liczbę do określonej liczby cyfr.
+ROUNDDOWN = ZAOKR.DÓŁ ## Zaokrągla liczbę w dół, w kierunku zera.
+ROUNDUP = ZAOKR.GÓRA ## Zaokrągla liczbę w górę, w kierunku od zera.
+SERIESSUM = SERIESSUM ## Zwraca sumę szeregu potęgowego na podstawie wzoru.
+SIGN = ZNAK.LICZBY ## Zwraca znak liczby.
+SIN = SIN ## Zwraca sinus danego kąta.
+SINH = SINH ## Zwraca sinus hiperboliczny liczby.
+SQRT = PIERWIASTEK ## Zwraca dodatni pierwiastek kwadratowy.
+SQRTPI = SQRTPI ## Zwraca pierwiastek kwadratowy iloczynu (liczba * Pi).
+SUBTOTAL = SUMY.POŚREDNIE ## Zwraca sumę częściową listy lub bazy danych.
+SUM = SUMA ## Dodaje argumenty.
+SUMIF = SUMA.JEŻELI ## Dodaje komórki określone przez podane kryterium.
+SUMIFS = SUMA.WARUNKÓW ## Dodaje komórki w zakresie, które spełniają wiele kryteriów.
+SUMPRODUCT = SUMA.ILOCZYNÓW ## Zwraca sumę iloczynów odpowiednich elementów tablicy.
+SUMSQ = SUMA.KWADRATÓW ## Zwraca sumę kwadratów argumentów.
+SUMX2MY2 = SUMA.X2.M.Y2 ## Zwraca sumę różnic kwadratów odpowiednich wartości w dwóch tablicach.
+SUMX2PY2 = SUMA.X2.P.Y2 ## Zwraca sumę sum kwadratów odpowiednich wartości w dwóch tablicach.
+SUMXMY2 = SUMA.XMY.2 ## Zwraca sumę kwadratów różnic odpowiednich wartości w dwóch tablicach.
+TAN = TAN ## Zwraca tangens liczby.
+TANH = TANH ## Zwraca tangens hiperboliczny liczby.
+TRUNC = LICZBA.CAŁK ## Przycina liczbę do wartości całkowitej.
+
+
+##
+## Statistical functions Funkcje statystyczne
+##
+AVEDEV = ODCH.ŚREDNIE ## Zwraca średnią wartość odchyleń absolutnych punktów danych od ich wartości średniej.
+AVERAGE = ŚREDNIA ## Zwraca wartość średnią argumentów.
+AVERAGEA = ŚREDNIA.A ## Zwraca wartość średnią argumentów, z uwzględnieniem liczb, tekstów i wartości logicznych.
+AVERAGEIF = ŚREDNIA.JEŻELI ## Zwraca średnią (średnią arytmetyczną) wszystkich komórek w zakresie, które spełniają podane kryteria.
+AVERAGEIFS = ŚREDNIA.WARUNKÓW ## Zwraca średnią (średnią arytmetyczną) wszystkich komórek, które spełniają jedno lub więcej kryteriów.
+BETADIST = ROZKŁAD.BETA ## Zwraca skumulowaną funkcję gęstości prawdopodobieństwa beta.
+BETAINV = ROZKŁAD.BETA.ODW ## Zwraca odwrotność skumulowanej funkcji gęstości prawdopodobieństwa beta.
+BINOMDIST = ROZKŁAD.DWUM ## Zwraca pojedynczy składnik dwumianowego rozkładu prawdopodobieństwa.
+CHIDIST = ROZKŁAD.CHI ## Zwraca wartość jednostronnego prawdopodobieństwa rozkładu chi-kwadrat.
+CHIINV = ROZKŁAD.CHI.ODW ## Zwraca odwrotność wartości jednostronnego prawdopodobieństwa rozkładu chi-kwadrat.
+CHITEST = TEST.CHI ## Zwraca test niezależności.
+CONFIDENCE = UFNOŚĆ ## Zwraca interwał ufności dla średniej populacji.
+CORREL = WSP.KORELACJI ## Zwraca współczynnik korelacji dwóch zbiorów danych.
+COUNT = ILE.LICZB ## Zlicza liczby znajdujące się na liście argumentów.
+COUNTA = ILE.NIEPUSTYCH ## Zlicza wartości znajdujące się na liście argumentów.
+COUNTBLANK = LICZ.PUSTE ## Zwraca liczbę pustych komórek w pewnym zakresie.
+COUNTIF = LICZ.JEŻELI ## Zlicza komórki wewnątrz zakresu, które spełniają podane kryteria.
+COUNTIFS = LICZ.WARUNKI ## Zlicza komórki wewnątrz zakresu, które spełniają wiele kryteriów.
+COVAR = KOWARIANCJA ## Zwraca kowariancję, czyli średnią wartość iloczynów odpowiednich odchyleń.
+CRITBINOM = PRÓG.ROZKŁAD.DWUM ## Zwraca najmniejszą wartość, dla której skumulowany rozkład dwumianowy jest mniejszy niż wartość kryterium lub równy jej.
+DEVSQ = ODCH.KWADRATOWE ## Zwraca sumę kwadratów odchyleń.
+EXPONDIST = ROZKŁAD.EXP ## Zwraca rozkład wykładniczy.
+FDIST = ROZKŁAD.F ## Zwraca rozkład prawdopodobieństwa F.
+FINV = ROZKŁAD.F.ODW ## Zwraca odwrotność rozkładu prawdopodobieństwa F.
+FISHER = ROZKŁAD.FISHER ## Zwraca transformację Fishera.
+FISHERINV = ROZKŁAD.FISHER.ODW ## Zwraca odwrotność transformacji Fishera.
+FORECAST = REGLINX ## Zwraca wartość trendu liniowego.
+FREQUENCY = CZĘSTOŚĆ ## Zwraca rozkład częstotliwości jako tablicę pionową.
+FTEST = TEST.F ## Zwraca wynik testu F.
+GAMMADIST = ROZKŁAD.GAMMA ## Zwraca rozkład gamma.
+GAMMAINV = ROZKŁAD.GAMMA.ODW ## Zwraca odwrotność skumulowanego rozkładu gamma.
+GAMMALN = ROZKŁAD.LIN.GAMMA ## Zwraca logarytm naturalny funkcji gamma, Γ(x).
+GEOMEAN = ŚREDNIA.GEOMETRYCZNA ## Zwraca średnią geometryczną.
+GROWTH = REGEXPW ## Zwraca wartości trendu wykładniczego.
+HARMEAN = ŚREDNIA.HARMONICZNA ## Zwraca średnią harmoniczną.
+HYPGEOMDIST = ROZKŁAD.HIPERGEOM ## Zwraca rozkład hipergeometryczny.
+INTERCEPT = ODCIĘTA ## Zwraca punkt przecięcia osi pionowej z linią regresji liniowej.
+KURT = KURTOZA ## Zwraca kurtozę zbioru danych.
+LARGE = MAX.K ## Zwraca k-tą największą wartość ze zbioru danych.
+LINEST = REGLINP ## Zwraca parametry trendu liniowego.
+LOGEST = REGEXPP ## Zwraca parametry trendu wykładniczego.
+LOGINV = ROZKŁAD.LOG.ODW ## Zwraca odwrotność rozkładu logarytmu naturalnego.
+LOGNORMDIST = ROZKŁAD.LOG ## Zwraca skumulowany rozkład logarytmu naturalnego.
+MAX = MAX ## Zwraca maksymalną wartość listy argumentów.
+MAXA = MAX.A ## Zwraca maksymalną wartość listy argumentów, z uwzględnieniem liczb, tekstów i wartości logicznych.
+MEDIAN = MEDIANA ## Zwraca medianę podanych liczb.
+MIN = MIN ## Zwraca minimalną wartość listy argumentów.
+MINA = MIN.A ## Zwraca najmniejszą wartość listy argumentów, z uwzględnieniem liczb, tekstów i wartości logicznych.
+MODE = WYST.NAJCZĘŚCIEJ ## Zwraca wartość najczęściej występującą w zbiorze danych.
+NEGBINOMDIST = ROZKŁAD.DWUM.PRZEC ## Zwraca ujemny rozkład dwumianowy.
+NORMDIST = ROZKŁAD.NORMALNY ## Zwraca rozkład normalny skumulowany.
+NORMINV = ROZKŁAD.NORMALNY.ODW ## Zwraca odwrotność rozkładu normalnego skumulowanego.
+NORMSDIST = ROZKŁAD.NORMALNY.S ## Zwraca standardowy rozkład normalny skumulowany.
+NORMSINV = ROZKŁAD.NORMALNY.S.ODW ## Zwraca odwrotność standardowego rozkładu normalnego skumulowanego.
+PEARSON = PEARSON ## Zwraca współczynnik korelacji momentu iloczynu Pearsona.
+PERCENTILE = PERCENTYL ## Wyznacza k-ty percentyl wartości w zakresie.
+PERCENTRANK = PROCENT.POZYCJA ## Zwraca procentową pozycję wartości w zbiorze danych.
+PERMUT = PERMUTACJE ## Zwraca liczbę permutacji dla danej liczby obiektów.
+POISSON = ROZKŁAD.POISSON ## Zwraca rozkład Poissona.
+PROB = PRAWDPD ## Zwraca prawdopodobieństwo, że wartości w zakresie leżą pomiędzy dwiema granicami.
+QUARTILE = KWARTYL ## Wyznacza kwartyl zbioru danych.
+RANK = POZYCJA ## Zwraca pozycję liczby na liście liczb.
+RSQ = R.KWADRAT ## Zwraca kwadrat współczynnika korelacji momentu iloczynu Pearsona.
+SKEW = SKOŚNOŚĆ ## Zwraca skośność rozkładu.
+SLOPE = NACHYLENIE ## Zwraca nachylenie linii regresji liniowej.
+SMALL = MIN.K ## Zwraca k-tą najmniejszą wartość ze zbioru danych.
+STANDARDIZE = NORMALIZUJ ## Zwraca wartość znormalizowaną.
+STDEV = ODCH.STANDARDOWE ## Szacuje odchylenie standardowe na podstawie próbki.
+STDEVA = ODCH.STANDARDOWE.A ## Szacuje odchylenie standardowe na podstawie próbki, z uwzględnieniem liczb, tekstów i wartości logicznych.
+STDEVP = ODCH.STANDARD.POPUL ## Oblicza odchylenie standardowe na podstawie całej populacji.
+STDEVPA = ODCH.STANDARD.POPUL.A ## Oblicza odchylenie standardowe na podstawie całej populacji, z uwzględnieniem liczb, teksów i wartości logicznych.
+STEYX = REGBŁSTD ## Zwraca błąd standardowy przewidzianej wartości y dla każdej wartości x w regresji.
+TDIST = ROZKŁAD.T ## Zwraca rozkład t-Studenta.
+TINV = ROZKŁAD.T.ODW ## Zwraca odwrotność rozkładu t-Studenta.
+TREND = REGLINW ## Zwraca wartości trendu liniowego.
+TRIMMEAN = ŚREDNIA.WEWN ## Zwraca średnią wartość dla wnętrza zbioru danych.
+TTEST = TEST.T ## Zwraca prawdopodobieństwo związane z testem t-Studenta.
+VAR = WARIANCJA ## Szacuje wariancję na podstawie próbki.
+VARA = WARIANCJA.A ## Szacuje wariancję na podstawie próbki, z uwzględnieniem liczb, tekstów i wartości logicznych.
+VARP = WARIANCJA.POPUL ## Oblicza wariancję na podstawie całej populacji.
+VARPA = WARIANCJA.POPUL.A ## Oblicza wariancję na podstawie całej populacji, z uwzględnieniem liczb, tekstów i wartości logicznych.
+WEIBULL = ROZKŁAD.WEIBULL ## Zwraca rozkład Weibulla.
+ZTEST = TEST.Z ## Zwraca wartość jednostronnego prawdopodobieństwa testu z.
+
+
+##
+## Text functions Funkcje tekstowe
+##
+ASC = ASC ## Zamienia litery angielskie lub katakana o pełnej szerokości (dwubajtowe) w ciągu znaków na znaki o szerokości połówkowej (jednobajtowe).
+BAHTTEXT = BAHTTEXT ## Konwertuje liczbę na tekst, stosując format walutowy ß (baht).
+CHAR = ZNAK ## Zwraca znak o podanym numerze kodu.
+CLEAN = OCZYŚĆ ## Usuwa z tekstu wszystkie znaki, które nie mogą być drukowane.
+CODE = KOD ## Zwraca kod numeryczny pierwszego znaku w ciągu tekstowym.
+CONCATENATE = ZŁĄCZ.TEKSTY ## Łączy kilka oddzielnych tekstów w jeden tekst.
+DOLLAR = KWOTA ## Konwertuje liczbę na tekst, stosując format walutowy $ (dolar).
+EXACT = PORÓWNAJ ## Sprawdza identyczność dwóch wartości tekstowych.
+FIND = ZNAJDŹ ## Znajduje jedną wartość tekstową wewnątrz innej (z uwzględnieniem wielkich i małych liter).
+FINDB = ZNAJDŹB ## Znajduje jedną wartość tekstową wewnątrz innej (z uwzględnieniem wielkich i małych liter).
+FIXED = ZAOKR.DO.TEKST ## Formatuje liczbę jako tekst przy stałej liczbie miejsc dziesiętnych.
+JIS = JIS ## Zmienia litery angielskie lub katakana o szerokości połówkowej (jednobajtowe) w ciągu znaków na znaki o pełnej szerokości (dwubajtowe).
+LEFT = LEWY ## Zwraca skrajne lewe znaki z wartości tekstowej.
+LEFTB = LEWYB ## Zwraca skrajne lewe znaki z wartości tekstowej.
+LEN = DŁ ## Zwraca liczbę znaków ciągu tekstowego.
+LENB = DŁ.B ## Zwraca liczbę znaków ciągu tekstowego.
+LOWER = LITERY.MAŁE ## Konwertuje wielkie litery tekstu na małe litery.
+MID = FRAGMENT.TEKSTU ## Zwraca określoną liczbę znaków z ciągu tekstowego, zaczynając od zadanej pozycji.
+MIDB = FRAGMENT.TEKSTU.B ## Zwraca określoną liczbę znaków z ciągu tekstowego, zaczynając od zadanej pozycji.
+PHONETIC = PHONETIC ## Wybiera znaki fonetyczne (furigana) z ciągu tekstowego.
+PROPER = Z.WIELKIEJ.LITERY ## Zastępuje pierwszą literę każdego wyrazu tekstu wielką literą.
+REPLACE = ZASTĄP ## Zastępuje znaki w tekście.
+REPLACEB = ZASTĄP.B ## Zastępuje znaki w tekście.
+REPT = POWT ## Powiela tekst daną liczbę razy.
+RIGHT = PRAWY ## Zwraca skrajne prawe znaki z wartości tekstowej.
+RIGHTB = PRAWYB ## Zwraca skrajne prawe znaki z wartości tekstowej.
+SEARCH = SZUKAJ.TEKST ## Wyszukuje jedną wartość tekstową wewnątrz innej (bez uwzględniania wielkości liter).
+SEARCHB = SZUKAJ.TEKST.B ## Wyszukuje jedną wartość tekstową wewnątrz innej (bez uwzględniania wielkości liter).
+SUBSTITUTE = PODSTAW ## Podstawia nowy tekst w miejsce poprzedniego tekstu w ciągu tekstowym.
+T = T ## Konwertuje argumenty na tekst.
+TEXT = TEKST ## Formatuje liczbę i konwertuje ją na tekst.
+TRIM = USUŃ.ZBĘDNE.ODSTĘPY ## Usuwa spacje z tekstu.
+UPPER = LITERY.WIELKIE ## Konwertuje znaki tekstu na wielkie litery.
+VALUE = WARTOŚĆ ## Konwertuje argument tekstowy na liczbę.
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/br/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/br/config
new file mode 100644
index 00000000000..904f99f1a07
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/br/config
@@ -0,0 +1,24 @@
+##
+## PhpSpreadsheet
+##
+
+ArgumentSeparator = ;
+
+
+##
+## (For future use)
+##
+currencySymbol = R$
+
+
+##
+## Excel Error Codes (For future use)
+
+##
+NULL = #NULO!
+DIV0 = #DIV/0!
+VALUE = #VALOR!
+REF = #REF!
+NAME = #NOME?
+NUM = #NÚM!
+NA = #N/D
diff --git a/lib/phpexcel/PHPExcel/locale/pt/br/functions b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/br/functions
similarity index 98%
rename from lib/phpexcel/PHPExcel/locale/pt/br/functions
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/br/functions
index f3ba3a3523f..a062a7fad51 100644
--- a/lib/phpexcel/PHPExcel/locale/pt/br/functions
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/br/functions
@@ -1,408 +1,408 @@
-##
-## Add-in and Automation functions Funções Suplemento e Automação
-##
-GETPIVOTDATA = INFODADOSTABELADINÂMICA ## Retorna os dados armazenados em um relatório de tabela dinâmica
-
-
-##
-## Cube functions Funções de Cubo
-##
-CUBEKPIMEMBER = MEMBROKPICUBO ## Retorna o nome de um KPI (indicador de desempenho-chave), uma propriedade e uma medida e exibe o nome e a propriedade na célula. Um KPI é uma medida quantificável, como o lucro bruto mensal ou a rotatividade trimestral dos funcionários, usada para monitorar o desempenho de uma organização.
-CUBEMEMBER = MEMBROCUBO ## Retorna um membro ou tupla em uma hierarquia de cubo. Use para validar se o membro ou tupla existe no cubo.
-CUBEMEMBERPROPERTY = PROPRIEDADEMEMBROCUBO ## Retorna o valor da propriedade de um membro no cubo. Usada para validar a existência do nome do membro no cubo e para retornar a propriedade especificada para esse membro.
-CUBERANKEDMEMBER = MEMBROCLASSIFICADOCUBO ## Retorna o enésimo membro, ou o membro ordenado, em um conjunto. Use para retornar um ou mais elementos em um conjunto, assim como o melhor vendedor ou os dez melhores alunos.
-CUBESET = CONJUNTOCUBO ## Define um conjunto calculado de membros ou tuplas enviando uma expressão do conjunto para o cubo no servidor, que cria o conjunto e o retorna para o Microsoft Office Excel.
-CUBESETCOUNT = CONTAGEMCONJUNTOCUBO ## Retorna o número de itens em um conjunto.
-CUBEVALUE = VALORCUBO ## Retorna um valor agregado de um cubo.
-
-
-##
-## Database functions Funções de banco de dados
-##
-DAVERAGE = BDMÉDIA ## Retorna a média das entradas selecionadas de um banco de dados
-DCOUNT = BDCONTAR ## Conta as células que contêm números em um banco de dados
-DCOUNTA = BDCONTARA ## Conta células não vazias em um banco de dados
-DGET = BDEXTRAIR ## Extrai de um banco de dados um único registro que corresponde a um critério específico
-DMAX = BDMÁX ## Retorna o valor máximo de entradas selecionadas de um banco de dados
-DMIN = BDMÍN ## Retorna o valor mínimo de entradas selecionadas de um banco de dados
-DPRODUCT = BDMULTIPL ## Multiplica os valores em um campo específico de registros que correspondem ao critério em um banco de dados
-DSTDEV = BDEST ## Estima o desvio padrão com base em uma amostra de entradas selecionadas de um banco de dados
-DSTDEVP = BDDESVPA ## Calcula o desvio padrão com base na população inteira de entradas selecionadas de um banco de dados
-DSUM = BDSOMA ## Adiciona os números à coluna de campos de registros do banco de dados que correspondem ao critério
-DVAR = BDVAREST ## Estima a variância com base em uma amostra de entradas selecionadas de um banco de dados
-DVARP = BDVARP ## Calcula a variância com base na população inteira de entradas selecionadas de um banco de dados
-
-
-##
-## Date and time functions Funções de data e hora
-##
-DATE = DATA ## Retorna o número de série de uma data específica
-DATEVALUE = DATA.VALOR ## Converte uma data na forma de texto para um número de série
-DAY = DIA ## Converte um número de série em um dia do mês
-DAYS360 = DIAS360 ## Calcula o número de dias entre duas datas com base em um ano de 360 dias
-EDATE = DATAM ## Retorna o número de série da data que é o número indicado de meses antes ou depois da data inicial
-EOMONTH = FIMMÊS ## Retorna o número de série do último dia do mês antes ou depois de um número especificado de meses
-HOUR = HORA ## Converte um número de série em uma hora
-MINUTE = MINUTO ## Converte um número de série em um minuto
-MONTH = MÊS ## Converte um número de série em um mês
-NETWORKDAYS = DIATRABALHOTOTAL ## Retorna o número de dias úteis inteiros entre duas datas
-NOW = AGORA ## Retorna o número de série seqüencial da data e hora atuais
-SECOND = SEGUNDO ## Converte um número de série em um segundo
-TIME = HORA ## Retorna o número de série de uma hora específica
-TIMEVALUE = VALOR.TEMPO ## Converte um horário na forma de texto para um número de série
-TODAY = HOJE ## Retorna o número de série da data de hoje
-WEEKDAY = DIA.DA.SEMANA ## Converte um número de série em um dia da semana
-WEEKNUM = NÚMSEMANA ## Converte um número de série em um número que representa onde a semana cai numericamente em um ano
-WORKDAY = DIATRABALHO ## Retorna o número de série da data antes ou depois de um número específico de dias úteis
-YEAR = ANO ## Converte um número de série em um ano
-YEARFRAC = FRAÇÃOANO ## Retorna a fração do ano que representa o número de dias entre data_inicial e data_final
-
-
-##
-## Engineering functions Funções de engenharia
-##
-BESSELI = BESSELI ## Retorna a função de Bessel In(x) modificada
-BESSELJ = BESSELJ ## Retorna a função de Bessel Jn(x)
-BESSELK = BESSELK ## Retorna a função de Bessel Kn(x) modificada
-BESSELY = BESSELY ## Retorna a função de Bessel Yn(x)
-BIN2DEC = BIN2DEC ## Converte um número binário em decimal
-BIN2HEX = BIN2HEX ## Converte um número binário em hexadecimal
-BIN2OCT = BIN2OCT ## Converte um número binário em octal
-COMPLEX = COMPLEX ## Converte coeficientes reais e imaginários e um número complexo
-CONVERT = CONVERTER ## Converte um número de um sistema de medida para outro
-DEC2BIN = DECABIN ## Converte um número decimal em binário
-DEC2HEX = DECAHEX ## Converte um número decimal em hexadecimal
-DEC2OCT = DECAOCT ## Converte um número decimal em octal
-DELTA = DELTA ## Testa se dois valores são iguais
-ERF = FUNERRO ## Retorna a função de erro
-ERFC = FUNERROCOMPL ## Retorna a função de erro complementar
-GESTEP = DEGRAU ## Testa se um número é maior do que um valor limite
-HEX2BIN = HEXABIN ## Converte um número hexadecimal em binário
-HEX2DEC = HEXADEC ## Converte um número hexadecimal em decimal
-HEX2OCT = HEXAOCT ## Converte um número hexadecimal em octal
-IMABS = IMABS ## Retorna o valor absoluto (módulo) de um número complexo
-IMAGINARY = IMAGINÁRIO ## Retorna o coeficiente imaginário de um número complexo
-IMARGUMENT = IMARG ## Retorna o argumento teta, um ângulo expresso em radianos
-IMCONJUGATE = IMCONJ ## Retorna o conjugado complexo de um número complexo
-IMCOS = IMCOS ## Retorna o cosseno de um número complexo
-IMDIV = IMDIV ## Retorna o quociente de dois números complexos
-IMEXP = IMEXP ## Retorna o exponencial de um número complexo
-IMLN = IMLN ## Retorna o logaritmo natural de um número complexo
-IMLOG10 = IMLOG10 ## Retorna o logaritmo de base 10 de um número complexo
-IMLOG2 = IMLOG2 ## Retorna o logaritmo de base 2 de um número complexo
-IMPOWER = IMPOT ## Retorna um número complexo elevado a uma potência inteira
-IMPRODUCT = IMPROD ## Retorna o produto de números complexos
-IMREAL = IMREAL ## Retorna o coeficiente real de um número complexo
-IMSIN = IMSENO ## Retorna o seno de um número complexo
-IMSQRT = IMRAIZ ## Retorna a raiz quadrada de um número complexo
-IMSUB = IMSUBTR ## Retorna a diferença entre dois números complexos
-IMSUM = IMSOMA ## Retorna a soma de números complexos
-OCT2BIN = OCTABIN ## Converte um número octal em binário
-OCT2DEC = OCTADEC ## Converte um número octal em decimal
-OCT2HEX = OCTAHEX ## Converte um número octal em hexadecimal
-
-
-##
-## Financial functions Funções financeiras
-##
-ACCRINT = JUROSACUM ## Retorna a taxa de juros acumulados de um título que paga uma taxa periódica de juros
-ACCRINTM = JUROSACUMV ## Retorna os juros acumulados de um título que paga juros no vencimento
-AMORDEGRC = AMORDEGRC ## Retorna a depreciação para cada período contábil usando o coeficiente de depreciação
-AMORLINC = AMORLINC ## Retorna a depreciação para cada período contábil
-COUPDAYBS = CUPDIASINLIQ ## Retorna o número de dias do início do período de cupom até a data de liquidação
-COUPDAYS = CUPDIAS ## Retorna o número de dias no período de cupom que contém a data de quitação
-COUPDAYSNC = CUPDIASPRÓX ## Retorna o número de dias da data de liquidação até a data do próximo cupom
-COUPNCD = CUPDATAPRÓX ## Retorna a próxima data de cupom após a data de quitação
-COUPNUM = CUPNÚM ## Retorna o número de cupons pagáveis entre as datas de quitação e vencimento
-COUPPCD = CUPDATAANT ## Retorna a data de cupom anterior à data de quitação
-CUMIPMT = PGTOJURACUM ## Retorna os juros acumulados pagos entre dois períodos
-CUMPRINC = PGTOCAPACUM ## Retorna o capital acumulado pago sobre um empréstimo entre dois períodos
-DB = BD ## Retorna a depreciação de um ativo para um período especificado, usando o método de balanço de declínio fixo
-DDB = BDD ## Retorna a depreciação de um ativo com relação a um período especificado usando o método de saldos decrescentes duplos ou qualquer outro método especificado por você
-DISC = DESC ## Retorna a taxa de desconto de um título
-DOLLARDE = MOEDADEC ## Converte um preço em formato de moeda, na forma fracionária, em um preço na forma decimal
-DOLLARFR = MOEDAFRA ## Converte um preço, apresentado na forma decimal, em um preço apresentado na forma fracionária
-DURATION = DURAÇÃO ## Retorna a duração anual de um título com pagamentos de juros periódicos
-EFFECT = EFETIVA ## Retorna a taxa de juros anual efetiva
-FV = VF ## Retorna o valor futuro de um investimento
-FVSCHEDULE = VFPLANO ## Retorna o valor futuro de um capital inicial após a aplicação de uma série de taxas de juros compostas
-INTRATE = TAXAJUROS ## Retorna a taxa de juros de um título totalmente investido
-IPMT = IPGTO ## Retorna o pagamento de juros para um investimento em um determinado período
-IRR = TIR ## Retorna a taxa interna de retorno de uma série de fluxos de caixa
-ISPMT = ÉPGTO ## Calcula os juros pagos durante um período específico de um investimento
-MDURATION = MDURAÇÃO ## Retorna a duração de Macauley modificada para um título com um valor de paridade equivalente a R$ 100
-MIRR = MTIR ## Calcula a taxa interna de retorno em que fluxos de caixa positivos e negativos são financiados com diferentes taxas
-NOMINAL = NOMINAL ## Retorna a taxa de juros nominal anual
-NPER = NPER ## Retorna o número de períodos de um investimento
-NPV = VPL ## Retorna o valor líquido atual de um investimento com base em uma série de fluxos de caixa periódicos e em uma taxa de desconto
-ODDFPRICE = PREÇOPRIMINC ## Retorna o preço por R$ 100 de valor nominal de um título com um primeiro período indefinido
-ODDFYIELD = LUCROPRIMINC ## Retorna o rendimento de um título com um primeiro período indefinido
-ODDLPRICE = PREÇOÚLTINC ## Retorna o preço por R$ 100 de valor nominal de um título com um último período de cupom indefinido
-ODDLYIELD = LUCROÚLTINC ## Retorna o rendimento de um título com um último período indefinido
-PMT = PGTO ## Retorna o pagamento periódico de uma anuidade
-PPMT = PPGTO ## Retorna o pagamento de capital para determinado período de investimento
-PRICE = PREÇO ## Retorna a preço por R$ 100,00 de valor nominal de um título que paga juros periódicos
-PRICEDISC = PREÇODESC ## Retorna o preço por R$ 100,00 de valor nominal de um título descontado
-PRICEMAT = PREÇOVENC ## Retorna o preço por R$ 100,00 de valor nominal de um título que paga juros no vencimento
-PV = VP ## Retorna o valor presente de um investimento
-RATE = TAXA ## Retorna a taxa de juros por período de uma anuidade
-RECEIVED = RECEBER ## Retorna a quantia recebida no vencimento de um título totalmente investido
-SLN = DPD ## Retorna a depreciação em linha reta de um ativo durante um período
-SYD = SDA ## Retorna a depreciação dos dígitos da soma dos anos de um ativo para um período especificado
-TBILLEQ = OTN ## Retorna o rendimento de um título equivalente a uma obrigação do Tesouro
-TBILLPRICE = OTNVALOR ## Retorna o preço por R$ 100,00 de valor nominal de uma obrigação do Tesouro
-TBILLYIELD = OTNLUCRO ## Retorna o rendimento de uma obrigação do Tesouro
-VDB = BDV ## Retorna a depreciação de um ativo para um período especificado ou parcial usando um método de balanço declinante
-XIRR = XTIR ## Fornece a taxa interna de retorno para um programa de fluxos de caixa que não é necessariamente periódico
-XNPV = XVPL ## Retorna o valor presente líquido de um programa de fluxos de caixa que não é necessariamente periódico
-YIELD = LUCRO ## Retorna o lucro de um título que paga juros periódicos
-YIELDDISC = LUCRODESC ## Retorna o rendimento anual de um título descontado. Por exemplo, uma obrigação do Tesouro
-YIELDMAT = LUCROVENC ## Retorna o lucro anual de um título que paga juros no vencimento
-
-
-##
-## Information functions Funções de informação
-##
-CELL = CÉL ## Retorna informações sobre formatação, localização ou conteúdo de uma célula
-ERROR.TYPE = TIPO.ERRO ## Retorna um número correspondente a um tipo de erro
-INFO = INFORMAÇÃO ## Retorna informações sobre o ambiente operacional atual
-ISBLANK = ÉCÉL.VAZIA ## Retorna VERDADEIRO se o valor for vazio
-ISERR = ÉERRO ## Retorna VERDADEIRO se o valor for um valor de erro diferente de #N/D
-ISERROR = ÉERROS ## Retorna VERDADEIRO se o valor for um valor de erro
-ISEVEN = ÉPAR ## Retorna VERDADEIRO se o número for par
-ISLOGICAL = ÉLÓGICO ## Retorna VERDADEIRO se o valor for um valor lógico
-ISNA = É.NÃO.DISP ## Retorna VERDADEIRO se o valor for o valor de erro #N/D
-ISNONTEXT = É.NÃO.TEXTO ## Retorna VERDADEIRO se o valor for diferente de texto
-ISNUMBER = ÉNÚM ## Retorna VERDADEIRO se o valor for um número
-ISODD = ÉIMPAR ## Retorna VERDADEIRO se o número for ímpar
-ISREF = ÉREF ## Retorna VERDADEIRO se o valor for uma referência
-ISTEXT = ÉTEXTO ## Retorna VERDADEIRO se o valor for texto
-N = N ## Retorna um valor convertido em um número
-NA = NÃO.DISP ## Retorna o valor de erro #N/D
-TYPE = TIPO ## Retorna um número indicando o tipo de dados de um valor
-
-
-##
-## Logical functions Funções lógicas
-##
-AND = E ## Retorna VERDADEIRO se todos os seus argumentos forem VERDADEIROS
-FALSE = FALSO ## Retorna o valor lógico FALSO
-IF = SE ## Especifica um teste lógico a ser executado
-IFERROR = SEERRO ## Retornará um valor que você especifica se uma fórmula for avaliada para um erro; do contrário, retornará o resultado da fórmula
-NOT = NÃO ## Inverte o valor lógico do argumento
-OR = OU ## Retorna VERDADEIRO se um dos argumentos for VERDADEIRO
-TRUE = VERDADEIRO ## Retorna o valor lógico VERDADEIRO
-
-
-##
-## Lookup and reference functions Funções de pesquisa e referência
-##
-ADDRESS = ENDEREÇO ## Retorna uma referência como texto para uma única célula em uma planilha
-AREAS = ÁREAS ## Retorna o número de áreas em uma referência
-CHOOSE = ESCOLHER ## Escolhe um valor a partir de uma lista de valores
-COLUMN = COL ## Retorna o número da coluna de uma referência
-COLUMNS = COLS ## Retorna o número de colunas em uma referência
-HLOOKUP = PROCH ## Procura na linha superior de uma matriz e retorna o valor da célula especificada
-HYPERLINK = HYPERLINK ## Cria um atalho ou salto que abre um documento armazenado em um servidor de rede, uma intranet ou na Internet
-INDEX = ÍNDICE ## Usa um índice para escolher um valor de uma referência ou matriz
-INDIRECT = INDIRETO ## Retorna uma referência indicada por um valor de texto
-LOOKUP = PROC ## Procura valores em um vetor ou em uma matriz
-MATCH = CORRESP ## Procura valores em uma referência ou em uma matriz
-OFFSET = DESLOC ## Retorna um deslocamento de referência com base em uma determinada referência
-ROW = LIN ## Retorna o número da linha de uma referência
-ROWS = LINS ## Retorna o número de linhas em uma referência
-RTD = RTD ## Recupera dados em tempo real de um programa que ofereça suporte a automação COM (automação: uma forma de trabalhar com objetos de um aplicativo a partir de outro aplicativo ou ferramenta de desenvolvimento. Chamada inicialmente de automação OLE, a automação é um padrão industrial e um recurso do modelo de objeto componente (COM).)
-TRANSPOSE = TRANSPOR ## Retorna a transposição de uma matriz
-VLOOKUP = PROCV ## Procura na primeira coluna de uma matriz e move ao longo da linha para retornar o valor de uma célula
-
-
-##
-## Math and trigonometry functions Funções matemáticas e trigonométricas
-##
-ABS = ABS ## Retorna o valor absoluto de um número
-ACOS = ACOS ## Retorna o arco cosseno de um número
-ACOSH = ACOSH ## Retorna o cosseno hiperbólico inverso de um número
-ASIN = ASEN ## Retorna o arco seno de um número
-ASINH = ASENH ## Retorna o seno hiperbólico inverso de um número
-ATAN = ATAN ## Retorna o arco tangente de um número
-ATAN2 = ATAN2 ## Retorna o arco tangente das coordenadas x e y especificadas
-ATANH = ATANH ## Retorna a tangente hiperbólica inversa de um número
-CEILING = TETO ## Arredonda um número para o inteiro mais próximo ou para o múltiplo mais próximo de significância
-COMBIN = COMBIN ## Retorna o número de combinações de um determinado número de objetos
-COS = COS ## Retorna o cosseno de um número
-COSH = COSH ## Retorna o cosseno hiperbólico de um número
-DEGREES = GRAUS ## Converte radianos em graus
-EVEN = PAR ## Arredonda um número para cima até o inteiro par mais próximo
-EXP = EXP ## Retorna e elevado à potência de um número especificado
-FACT = FATORIAL ## Retorna o fatorial de um número
-FACTDOUBLE = FATDUPLO ## Retorna o fatorial duplo de um número
-FLOOR = ARREDMULTB ## Arredonda um número para baixo até zero
-GCD = MDC ## Retorna o máximo divisor comum
-INT = INT ## Arredonda um número para baixo até o número inteiro mais próximo
-LCM = MMC ## Retorna o mínimo múltiplo comum
-LN = LN ## Retorna o logaritmo natural de um número
-LOG = LOG ## Retorna o logaritmo de um número de uma base especificada
-LOG10 = LOG10 ## Retorna o logaritmo de base 10 de um número
-MDETERM = MATRIZ.DETERM ## Retorna o determinante de uma matriz de uma variável do tipo matriz
-MINVERSE = MATRIZ.INVERSO ## Retorna a matriz inversa de uma matriz
-MMULT = MATRIZ.MULT ## Retorna o produto de duas matrizes
-MOD = RESTO ## Retorna o resto da divisão
-MROUND = MARRED ## Retorna um número arredondado ao múltiplo desejado
-MULTINOMIAL = MULTINOMIAL ## Retorna o multinomial de um conjunto de números
-ODD = ÍMPAR ## Arredonda um número para cima até o inteiro ímpar mais próximo
-PI = PI ## Retorna o valor de Pi
-POWER = POTÊNCIA ## Fornece o resultado de um número elevado a uma potência
-PRODUCT = MULT ## Multiplica seus argumentos
-QUOTIENT = QUOCIENTE ## Retorna a parte inteira de uma divisão
-RADIANS = RADIANOS ## Converte graus em radianos
-RAND = ALEATÓRIO ## Retorna um número aleatório entre 0 e 1
-RANDBETWEEN = ALEATÓRIOENTRE ## Retorna um número aleatório entre os números especificados
-ROMAN = ROMANO ## Converte um algarismo arábico em romano, como texto
-ROUND = ARRED ## Arredonda um número até uma quantidade especificada de dígitos
-ROUNDDOWN = ARREDONDAR.PARA.BAIXO ## Arredonda um número para baixo até zero
-ROUNDUP = ARREDONDAR.PARA.CIMA ## Arredonda um número para cima, afastando-o de zero
-SERIESSUM = SOMASEQÜÊNCIA ## Retorna a soma de uma série polinomial baseada na fórmula
-SIGN = SINAL ## Retorna o sinal de um número
-SIN = SEN ## Retorna o seno de um ângulo dado
-SINH = SENH ## Retorna o seno hiperbólico de um número
-SQRT = RAIZ ## Retorna uma raiz quadrada positiva
-SQRTPI = RAIZPI ## Retorna a raiz quadrada de (núm* pi)
-SUBTOTAL = SUBTOTAL ## Retorna um subtotal em uma lista ou em um banco de dados
-SUM = SOMA ## Soma seus argumentos
-SUMIF = SOMASE ## Adiciona as células especificadas por um determinado critério
-SUMIFS = SOMASE ## Adiciona as células em um intervalo que atende a vários critérios
-SUMPRODUCT = SOMARPRODUTO ## Retorna a soma dos produtos de componentes correspondentes de matrizes
-SUMSQ = SOMAQUAD ## Retorna a soma dos quadrados dos argumentos
-SUMX2MY2 = SOMAX2DY2 ## Retorna a soma da diferença dos quadrados dos valores correspondentes em duas matrizes
-SUMX2PY2 = SOMAX2SY2 ## Retorna a soma da soma dos quadrados dos valores correspondentes em duas matrizes
-SUMXMY2 = SOMAXMY2 ## Retorna a soma dos quadrados das diferenças dos valores correspondentes em duas matrizes
-TAN = TAN ## Retorna a tangente de um número
-TANH = TANH ## Retorna a tangente hiperbólica de um número
-TRUNC = TRUNCAR ## Trunca um número para um inteiro
-
-
-##
-## Statistical functions Funções estatísticas
-##
-AVEDEV = DESV.MÉDIO ## Retorna a média aritmética dos desvios médios dos pontos de dados a partir de sua média
-AVERAGE = MÉDIA ## Retorna a média dos argumentos
-AVERAGEA = MÉDIAA ## Retorna a média dos argumentos, inclusive números, texto e valores lógicos
-AVERAGEIF = MÉDIASE ## Retorna a média (média aritmética) de todas as células em um intervalo que atendem a um determinado critério
-AVERAGEIFS = MÉDIASES ## Retorna a média (média aritmética) de todas as células que atendem a múltiplos critérios.
-BETADIST = DISTBETA ## Retorna a função de distribuição cumulativa beta
-BETAINV = BETA.ACUM.INV ## Retorna o inverso da função de distribuição cumulativa para uma distribuição beta especificada
-BINOMDIST = DISTRBINOM ## Retorna a probabilidade de distribuição binomial do termo individual
-CHIDIST = DIST.QUI ## Retorna a probabilidade unicaudal da distribuição qui-quadrada
-CHIINV = INV.QUI ## Retorna o inverso da probabilidade uni-caudal da distribuição qui-quadrada
-CHITEST = TESTE.QUI ## Retorna o teste para independência
-CONFIDENCE = INT.CONFIANÇA ## Retorna o intervalo de confiança para uma média da população
-CORREL = CORREL ## Retorna o coeficiente de correlação entre dois conjuntos de dados
-COUNT = CONT.NÚM ## Calcula quantos números há na lista de argumentos
-COUNTA = CONT.VALORES ## Calcula quantos valores há na lista de argumentos
-COUNTBLANK = CONTAR.VAZIO ## Conta o número de células vazias no intervalo especificado
-COUNTIF = CONT.SE ## Calcula o número de células não vazias em um intervalo que corresponde a determinados critérios
-COUNTIFS = CONT.SES ## Conta o número de células dentro de um intervalo que atende a múltiplos critérios
-COVAR = COVAR ## Retorna a covariância, a média dos produtos dos desvios pares
-CRITBINOM = CRIT.BINOM ## Retorna o menor valor para o qual a distribuição binomial cumulativa é menor ou igual ao valor padrão
-DEVSQ = DESVQ ## Retorna a soma dos quadrados dos desvios
-EXPONDIST = DISTEXPON ## Retorna a distribuição exponencial
-FDIST = DISTF ## Retorna a distribuição de probabilidade F
-FINV = INVF ## Retorna o inverso da distribuição de probabilidades F
-FISHER = FISHER ## Retorna a transformação Fisher
-FISHERINV = FISHERINV ## Retorna o inverso da transformação Fisher
-FORECAST = PREVISÃO ## Retorna um valor ao longo de uma linha reta
-FREQUENCY = FREQÜÊNCIA ## Retorna uma distribuição de freqüência como uma matriz vertical
-FTEST = TESTEF ## Retorna o resultado de um teste F
-GAMMADIST = DISTGAMA ## Retorna a distribuição gama
-GAMMAINV = INVGAMA ## Retorna o inverso da distribuição cumulativa gama
-GAMMALN = LNGAMA ## Retorna o logaritmo natural da função gama, G(x)
-GEOMEAN = MÉDIA.GEOMÉTRICA ## Retorna a média geométrica
-GROWTH = CRESCIMENTO ## Retorna valores ao longo de uma tendência exponencial
-HARMEAN = MÉDIA.HARMÔNICA ## Retorna a média harmônica
-HYPGEOMDIST = DIST.HIPERGEOM ## Retorna a distribuição hipergeométrica
-INTERCEPT = INTERCEPÇÃO ## Retorna a intercepção da linha de regressão linear
-KURT = CURT ## Retorna a curtose de um conjunto de dados
-LARGE = MAIOR ## Retorna o maior valor k-ésimo de um conjunto de dados
-LINEST = PROJ.LIN ## Retorna os parâmetros de uma tendência linear
-LOGEST = PROJ.LOG ## Retorna os parâmetros de uma tendência exponencial
-LOGINV = INVLOG ## Retorna o inverso da distribuição lognormal
-LOGNORMDIST = DIST.LOGNORMAL ## Retorna a distribuição lognormal cumulativa
-MAX = MÁXIMO ## Retorna o valor máximo em uma lista de argumentos
-MAXA = MÁXIMOA ## Retorna o maior valor em uma lista de argumentos, inclusive números, texto e valores lógicos
-MEDIAN = MED ## Retorna a mediana dos números indicados
-MIN = MÍNIMO ## Retorna o valor mínimo em uma lista de argumentos
-MINA = MÍNIMOA ## Retorna o menor valor em uma lista de argumentos, inclusive números, texto e valores lógicos
-MODE = MODO ## Retorna o valor mais comum em um conjunto de dados
-NEGBINOMDIST = DIST.BIN.NEG ## Retorna a distribuição binomial negativa
-NORMDIST = DIST.NORM ## Retorna a distribuição cumulativa normal
-NORMINV = INV.NORM ## Retorna o inverso da distribuição cumulativa normal
-NORMSDIST = DIST.NORMP ## Retorna a distribuição cumulativa normal padrão
-NORMSINV = INV.NORMP ## Retorna o inverso da distribuição cumulativa normal padrão
-PEARSON = PEARSON ## Retorna o coeficiente de correlação do momento do produto Pearson
-PERCENTILE = PERCENTIL ## Retorna o k-ésimo percentil de valores em um intervalo
-PERCENTRANK = ORDEM.PORCENTUAL ## Retorna a ordem percentual de um valor em um conjunto de dados
-PERMUT = PERMUT ## Retorna o número de permutações de um determinado número de objetos
-POISSON = POISSON ## Retorna a distribuição Poisson
-PROB = PROB ## Retorna a probabilidade de valores em um intervalo estarem entre dois limites
-QUARTILE = QUARTIL ## Retorna o quartil do conjunto de dados
-RANK = ORDEM ## Retorna a posição de um número em uma lista de números
-RSQ = RQUAD ## Retorna o quadrado do coeficiente de correlação do momento do produto de Pearson
-SKEW = DISTORÇÃO ## Retorna a distorção de uma distribuição
-SLOPE = INCLINAÇÃO ## Retorna a inclinação da linha de regressão linear
-SMALL = MENOR ## Retorna o menor valor k-ésimo do conjunto de dados
-STANDARDIZE = PADRONIZAR ## Retorna um valor normalizado
-STDEV = DESVPAD ## Estima o desvio padrão com base em uma amostra
-STDEVA = DESVPADA ## Estima o desvio padrão com base em uma amostra, inclusive números, texto e valores lógicos
-STDEVP = DESVPADP ## Calcula o desvio padrão com base na população total
-STDEVPA = DESVPADPA ## Calcula o desvio padrão com base na população total, inclusive números, texto e valores lógicos
-STEYX = EPADYX ## Retorna o erro padrão do valor-y previsto para cada x da regressão
-TDIST = DISTT ## Retorna a distribuição t de Student
-TINV = INVT ## Retorna o inverso da distribuição t de Student
-TREND = TENDÊNCIA ## Retorna valores ao longo de uma tendência linear
-TRIMMEAN = MÉDIA.INTERNA ## Retorna a média do interior de um conjunto de dados
-TTEST = TESTET ## Retorna a probabilidade associada ao teste t de Student
-VAR = VAR ## Estima a variância com base em uma amostra
-VARA = VARA ## Estima a variância com base em uma amostra, inclusive números, texto e valores lógicos
-VARP = VARP ## Calcula a variância com base na população inteira
-VARPA = VARPA ## Calcula a variância com base na população total, inclusive números, texto e valores lógicos
-WEIBULL = WEIBULL ## Retorna a distribuição Weibull
-ZTEST = TESTEZ ## Retorna o valor de probabilidade uni-caudal de um teste-z
-
-
-##
-## Text functions Funções de texto
-##
-ASC = ASC ## Altera letras do inglês ou katakana de largura total (bytes duplos) dentro de uma seqüência de caracteres para caracteres de meia largura (byte único)
-BAHTTEXT = BAHTTEXT ## Converte um número em um texto, usando o formato de moeda ß (baht)
-CHAR = CARACT ## Retorna o caractere especificado pelo número de código
-CLEAN = TIRAR ## Remove todos os caracteres do texto que não podem ser impressos
-CODE = CÓDIGO ## Retorna um código numérico para o primeiro caractere de uma seqüência de caracteres de texto
-CONCATENATE = CONCATENAR ## Agrupa vários itens de texto em um único item de texto
-DOLLAR = MOEDA ## Converte um número em texto, usando o formato de moeda $ (dólar)
-EXACT = EXATO ## Verifica se dois valores de texto são idênticos
-FIND = PROCURAR ## Procura um valor de texto dentro de outro (diferencia maiúsculas de minúsculas)
-FINDB = PROCURARB ## Procura um valor de texto dentro de outro (diferencia maiúsculas de minúsculas)
-FIXED = DEF.NÚM.DEC ## Formata um número como texto com um número fixo de decimais
-JIS = JIS ## Altera letras do inglês ou katakana de meia largura (byte único) dentro de uma seqüência de caracteres para caracteres de largura total (bytes duplos)
-LEFT = ESQUERDA ## Retorna os caracteres mais à esquerda de um valor de texto
-LEFTB = ESQUERDAB ## Retorna os caracteres mais à esquerda de um valor de texto
-LEN = NÚM.CARACT ## Retorna o número de caracteres em uma seqüência de texto
-LENB = NÚM.CARACTB ## Retorna o número de caracteres em uma seqüência de texto
-LOWER = MINÚSCULA ## Converte texto para minúsculas
-MID = EXT.TEXTO ## Retorna um número específico de caracteres de uma seqüência de texto começando na posição especificada
-MIDB = EXT.TEXTOB ## Retorna um número específico de caracteres de uma seqüência de texto começando na posição especificada
-PHONETIC = FONÉTICA ## Extrai os caracteres fonéticos (furigana) de uma seqüência de caracteres de texto
-PROPER = PRI.MAIÚSCULA ## Coloca a primeira letra de cada palavra em maiúscula em um valor de texto
-REPLACE = MUDAR ## Muda os caracteres dentro do texto
-REPLACEB = MUDARB ## Muda os caracteres dentro do texto
-REPT = REPT ## Repete o texto um determinado número de vezes
-RIGHT = DIREITA ## Retorna os caracteres mais à direita de um valor de texto
-RIGHTB = DIREITAB ## Retorna os caracteres mais à direita de um valor de texto
-SEARCH = LOCALIZAR ## Localiza um valor de texto dentro de outro (não diferencia maiúsculas de minúsculas)
-SEARCHB = LOCALIZARB ## Localiza um valor de texto dentro de outro (não diferencia maiúsculas de minúsculas)
-SUBSTITUTE = SUBSTITUIR ## Substitui um novo texto por um texto antigo em uma seqüência de texto
-T = T ## Converte os argumentos em texto
-TEXT = TEXTO ## Formata um número e o converte em texto
-TRIM = ARRUMAR ## Remove espaços do texto
-UPPER = MAIÚSCULA ## Converte o texto em maiúsculas
-VALUE = VALOR ## Converte um argumento de texto em um número
+##
+## Add-in and Automation functions Funções Suplemento e Automação
+##
+GETPIVOTDATA = INFODADOSTABELADINÂMICA ## Retorna os dados armazenados em um relatório de tabela dinâmica
+
+
+##
+## Cube functions Funções de Cubo
+##
+CUBEKPIMEMBER = MEMBROKPICUBO ## Retorna o nome de um KPI (indicador de desempenho-chave), uma propriedade e uma medida e exibe o nome e a propriedade na célula. Um KPI é uma medida quantificável, como o lucro bruto mensal ou a rotatividade trimestral dos funcionários, usada para monitorar o desempenho de uma organização.
+CUBEMEMBER = MEMBROCUBO ## Retorna um membro ou tupla em uma hierarquia de cubo. Use para validar se o membro ou tupla existe no cubo.
+CUBEMEMBERPROPERTY = PROPRIEDADEMEMBROCUBO ## Retorna o valor da propriedade de um membro no cubo. Usada para validar a existência do nome do membro no cubo e para retornar a propriedade especificada para esse membro.
+CUBERANKEDMEMBER = MEMBROCLASSIFICADOCUBO ## Retorna o enésimo membro, ou o membro ordenado, em um conjunto. Use para retornar um ou mais elementos em um conjunto, assim como o melhor vendedor ou os dez melhores alunos.
+CUBESET = CONJUNTOCUBO ## Define um conjunto calculado de membros ou tuplas enviando uma expressão do conjunto para o cubo no servidor, que cria o conjunto e o retorna para o Microsoft Office Excel.
+CUBESETCOUNT = CONTAGEMCONJUNTOCUBO ## Retorna o número de itens em um conjunto.
+CUBEVALUE = VALORCUBO ## Retorna um valor agregado de um cubo.
+
+
+##
+## Database functions Funções de banco de dados
+##
+DAVERAGE = BDMÉDIA ## Retorna a média das entradas selecionadas de um banco de dados
+DCOUNT = BDCONTAR ## Conta as células que contêm números em um banco de dados
+DCOUNTA = BDCONTARA ## Conta células não vazias em um banco de dados
+DGET = BDEXTRAIR ## Extrai de um banco de dados um único registro que corresponde a um critério específico
+DMAX = BDMÁX ## Retorna o valor máximo de entradas selecionadas de um banco de dados
+DMIN = BDMÍN ## Retorna o valor mínimo de entradas selecionadas de um banco de dados
+DPRODUCT = BDMULTIPL ## Multiplica os valores em um campo específico de registros que correspondem ao critério em um banco de dados
+DSTDEV = BDEST ## Estima o desvio padrão com base em uma amostra de entradas selecionadas de um banco de dados
+DSTDEVP = BDDESVPA ## Calcula o desvio padrão com base na população inteira de entradas selecionadas de um banco de dados
+DSUM = BDSOMA ## Adiciona os números à coluna de campos de registros do banco de dados que correspondem ao critério
+DVAR = BDVAREST ## Estima a variância com base em uma amostra de entradas selecionadas de um banco de dados
+DVARP = BDVARP ## Calcula a variância com base na população inteira de entradas selecionadas de um banco de dados
+
+
+##
+## Date and time functions Funções de data e hora
+##
+DATE = DATA ## Retorna o número de série de uma data específica
+DATEVALUE = DATA.VALOR ## Converte uma data na forma de texto para um número de série
+DAY = DIA ## Converte um número de série em um dia do mês
+DAYS360 = DIAS360 ## Calcula o número de dias entre duas datas com base em um ano de 360 dias
+EDATE = DATAM ## Retorna o número de série da data que é o número indicado de meses antes ou depois da data inicial
+EOMONTH = FIMMÊS ## Retorna o número de série do último dia do mês antes ou depois de um número especificado de meses
+HOUR = HORA ## Converte um número de série em uma hora
+MINUTE = MINUTO ## Converte um número de série em um minuto
+MONTH = MÊS ## Converte um número de série em um mês
+NETWORKDAYS = DIATRABALHOTOTAL ## Retorna o número de dias úteis inteiros entre duas datas
+NOW = AGORA ## Retorna o número de série seqüencial da data e hora atuais
+SECOND = SEGUNDO ## Converte um número de série em um segundo
+TIME = HORA ## Retorna o número de série de uma hora específica
+TIMEVALUE = VALOR.TEMPO ## Converte um horário na forma de texto para um número de série
+TODAY = HOJE ## Retorna o número de série da data de hoje
+WEEKDAY = DIA.DA.SEMANA ## Converte um número de série em um dia da semana
+WEEKNUM = NÚMSEMANA ## Converte um número de série em um número que representa onde a semana cai numericamente em um ano
+WORKDAY = DIATRABALHO ## Retorna o número de série da data antes ou depois de um número específico de dias úteis
+YEAR = ANO ## Converte um número de série em um ano
+YEARFRAC = FRAÇÃOANO ## Retorna a fração do ano que representa o número de dias entre data_inicial e data_final
+
+
+##
+## Engineering functions Funções de engenharia
+##
+BESSELI = BESSELI ## Retorna a função de Bessel In(x) modificada
+BESSELJ = BESSELJ ## Retorna a função de Bessel Jn(x)
+BESSELK = BESSELK ## Retorna a função de Bessel Kn(x) modificada
+BESSELY = BESSELY ## Retorna a função de Bessel Yn(x)
+BIN2DEC = BIN2DEC ## Converte um número binário em decimal
+BIN2HEX = BIN2HEX ## Converte um número binário em hexadecimal
+BIN2OCT = BIN2OCT ## Converte um número binário em octal
+COMPLEX = COMPLEX ## Converte coeficientes reais e imaginários e um número complexo
+CONVERT = CONVERTER ## Converte um número de um sistema de medida para outro
+DEC2BIN = DECABIN ## Converte um número decimal em binário
+DEC2HEX = DECAHEX ## Converte um número decimal em hexadecimal
+DEC2OCT = DECAOCT ## Converte um número decimal em octal
+DELTA = DELTA ## Testa se dois valores são iguais
+ERF = FUNERRO ## Retorna a função de erro
+ERFC = FUNERROCOMPL ## Retorna a função de erro complementar
+GESTEP = DEGRAU ## Testa se um número é maior do que um valor limite
+HEX2BIN = HEXABIN ## Converte um número hexadecimal em binário
+HEX2DEC = HEXADEC ## Converte um número hexadecimal em decimal
+HEX2OCT = HEXAOCT ## Converte um número hexadecimal em octal
+IMABS = IMABS ## Retorna o valor absoluto (módulo) de um número complexo
+IMAGINARY = IMAGINÁRIO ## Retorna o coeficiente imaginário de um número complexo
+IMARGUMENT = IMARG ## Retorna o argumento teta, um ângulo expresso em radianos
+IMCONJUGATE = IMCONJ ## Retorna o conjugado complexo de um número complexo
+IMCOS = IMCOS ## Retorna o cosseno de um número complexo
+IMDIV = IMDIV ## Retorna o quociente de dois números complexos
+IMEXP = IMEXP ## Retorna o exponencial de um número complexo
+IMLN = IMLN ## Retorna o logaritmo natural de um número complexo
+IMLOG10 = IMLOG10 ## Retorna o logaritmo de base 10 de um número complexo
+IMLOG2 = IMLOG2 ## Retorna o logaritmo de base 2 de um número complexo
+IMPOWER = IMPOT ## Retorna um número complexo elevado a uma potência inteira
+IMPRODUCT = IMPROD ## Retorna o produto de números complexos
+IMREAL = IMREAL ## Retorna o coeficiente real de um número complexo
+IMSIN = IMSENO ## Retorna o seno de um número complexo
+IMSQRT = IMRAIZ ## Retorna a raiz quadrada de um número complexo
+IMSUB = IMSUBTR ## Retorna a diferença entre dois números complexos
+IMSUM = IMSOMA ## Retorna a soma de números complexos
+OCT2BIN = OCTABIN ## Converte um número octal em binário
+OCT2DEC = OCTADEC ## Converte um número octal em decimal
+OCT2HEX = OCTAHEX ## Converte um número octal em hexadecimal
+
+
+##
+## Financial functions Funções financeiras
+##
+ACCRINT = JUROSACUM ## Retorna a taxa de juros acumulados de um título que paga uma taxa periódica de juros
+ACCRINTM = JUROSACUMV ## Retorna os juros acumulados de um título que paga juros no vencimento
+AMORDEGRC = AMORDEGRC ## Retorna a depreciação para cada período contábil usando o coeficiente de depreciação
+AMORLINC = AMORLINC ## Retorna a depreciação para cada período contábil
+COUPDAYBS = CUPDIASINLIQ ## Retorna o número de dias do início do período de cupom até a data de liquidação
+COUPDAYS = CUPDIAS ## Retorna o número de dias no período de cupom que contém a data de quitação
+COUPDAYSNC = CUPDIASPRÓX ## Retorna o número de dias da data de liquidação até a data do próximo cupom
+COUPNCD = CUPDATAPRÓX ## Retorna a próxima data de cupom após a data de quitação
+COUPNUM = CUPNÚM ## Retorna o número de cupons pagáveis entre as datas de quitação e vencimento
+COUPPCD = CUPDATAANT ## Retorna a data de cupom anterior à data de quitação
+CUMIPMT = PGTOJURACUM ## Retorna os juros acumulados pagos entre dois períodos
+CUMPRINC = PGTOCAPACUM ## Retorna o capital acumulado pago sobre um empréstimo entre dois períodos
+DB = BD ## Retorna a depreciação de um ativo para um período especificado, usando o método de balanço de declínio fixo
+DDB = BDD ## Retorna a depreciação de um ativo com relação a um período especificado usando o método de saldos decrescentes duplos ou qualquer outro método especificado por você
+DISC = DESC ## Retorna a taxa de desconto de um título
+DOLLARDE = MOEDADEC ## Converte um preço em formato de moeda, na forma fracionária, em um preço na forma decimal
+DOLLARFR = MOEDAFRA ## Converte um preço, apresentado na forma decimal, em um preço apresentado na forma fracionária
+DURATION = DURAÇÃO ## Retorna a duração anual de um título com pagamentos de juros periódicos
+EFFECT = EFETIVA ## Retorna a taxa de juros anual efetiva
+FV = VF ## Retorna o valor futuro de um investimento
+FVSCHEDULE = VFPLANO ## Retorna o valor futuro de um capital inicial após a aplicação de uma série de taxas de juros compostas
+INTRATE = TAXAJUROS ## Retorna a taxa de juros de um título totalmente investido
+IPMT = IPGTO ## Retorna o pagamento de juros para um investimento em um determinado período
+IRR = TIR ## Retorna a taxa interna de retorno de uma série de fluxos de caixa
+ISPMT = ÉPGTO ## Calcula os juros pagos durante um período específico de um investimento
+MDURATION = MDURAÇÃO ## Retorna a duração de Macauley modificada para um título com um valor de paridade equivalente a R$ 100
+MIRR = MTIR ## Calcula a taxa interna de retorno em que fluxos de caixa positivos e negativos são financiados com diferentes taxas
+NOMINAL = NOMINAL ## Retorna a taxa de juros nominal anual
+NPER = NPER ## Retorna o número de períodos de um investimento
+NPV = VPL ## Retorna o valor líquido atual de um investimento com base em uma série de fluxos de caixa periódicos e em uma taxa de desconto
+ODDFPRICE = PREÇOPRIMINC ## Retorna o preço por R$ 100 de valor nominal de um título com um primeiro período indefinido
+ODDFYIELD = LUCROPRIMINC ## Retorna o rendimento de um título com um primeiro período indefinido
+ODDLPRICE = PREÇOÚLTINC ## Retorna o preço por R$ 100 de valor nominal de um título com um último período de cupom indefinido
+ODDLYIELD = LUCROÚLTINC ## Retorna o rendimento de um título com um último período indefinido
+PMT = PGTO ## Retorna o pagamento periódico de uma anuidade
+PPMT = PPGTO ## Retorna o pagamento de capital para determinado período de investimento
+PRICE = PREÇO ## Retorna a preço por R$ 100,00 de valor nominal de um título que paga juros periódicos
+PRICEDISC = PREÇODESC ## Retorna o preço por R$ 100,00 de valor nominal de um título descontado
+PRICEMAT = PREÇOVENC ## Retorna o preço por R$ 100,00 de valor nominal de um título que paga juros no vencimento
+PV = VP ## Retorna o valor presente de um investimento
+RATE = TAXA ## Retorna a taxa de juros por período de uma anuidade
+RECEIVED = RECEBER ## Retorna a quantia recebida no vencimento de um título totalmente investido
+SLN = DPD ## Retorna a depreciação em linha reta de um ativo durante um período
+SYD = SDA ## Retorna a depreciação dos dígitos da soma dos anos de um ativo para um período especificado
+TBILLEQ = OTN ## Retorna o rendimento de um título equivalente a uma obrigação do Tesouro
+TBILLPRICE = OTNVALOR ## Retorna o preço por R$ 100,00 de valor nominal de uma obrigação do Tesouro
+TBILLYIELD = OTNLUCRO ## Retorna o rendimento de uma obrigação do Tesouro
+VDB = BDV ## Retorna a depreciação de um ativo para um período especificado ou parcial usando um método de balanço declinante
+XIRR = XTIR ## Fornece a taxa interna de retorno para um programa de fluxos de caixa que não é necessariamente periódico
+XNPV = XVPL ## Retorna o valor presente líquido de um programa de fluxos de caixa que não é necessariamente periódico
+YIELD = LUCRO ## Retorna o lucro de um título que paga juros periódicos
+YIELDDISC = LUCRODESC ## Retorna o rendimento anual de um título descontado. Por exemplo, uma obrigação do Tesouro
+YIELDMAT = LUCROVENC ## Retorna o lucro anual de um título que paga juros no vencimento
+
+
+##
+## Information functions Funções de informação
+##
+CELL = CÉL ## Retorna informações sobre formatação, localização ou conteúdo de uma célula
+ERROR.TYPE = TIPO.ERRO ## Retorna um número correspondente a um tipo de erro
+INFO = INFORMAÇÃO ## Retorna informações sobre o ambiente operacional atual
+ISBLANK = ÉCÉL.VAZIA ## Retorna VERDADEIRO se o valor for vazio
+ISERR = ÉERRO ## Retorna VERDADEIRO se o valor for um valor de erro diferente de #N/D
+ISERROR = ÉERROS ## Retorna VERDADEIRO se o valor for um valor de erro
+ISEVEN = ÉPAR ## Retorna VERDADEIRO se o número for par
+ISLOGICAL = ÉLÓGICO ## Retorna VERDADEIRO se o valor for um valor lógico
+ISNA = É.NÃO.DISP ## Retorna VERDADEIRO se o valor for o valor de erro #N/D
+ISNONTEXT = É.NÃO.TEXTO ## Retorna VERDADEIRO se o valor for diferente de texto
+ISNUMBER = ÉNÚM ## Retorna VERDADEIRO se o valor for um número
+ISODD = ÉIMPAR ## Retorna VERDADEIRO se o número for ímpar
+ISREF = ÉREF ## Retorna VERDADEIRO se o valor for uma referência
+ISTEXT = ÉTEXTO ## Retorna VERDADEIRO se o valor for texto
+N = N ## Retorna um valor convertido em um número
+NA = NÃO.DISP ## Retorna o valor de erro #N/D
+TYPE = TIPO ## Retorna um número indicando o tipo de dados de um valor
+
+
+##
+## Logical functions Funções lógicas
+##
+AND = E ## Retorna VERDADEIRO se todos os seus argumentos forem VERDADEIROS
+FALSE = FALSO ## Retorna o valor lógico FALSO
+IF = SE ## Especifica um teste lógico a ser executado
+IFERROR = SEERRO ## Retornará um valor que você especifica se uma fórmula for avaliada para um erro; do contrário, retornará o resultado da fórmula
+NOT = NÃO ## Inverte o valor lógico do argumento
+OR = OU ## Retorna VERDADEIRO se um dos argumentos for VERDADEIRO
+TRUE = VERDADEIRO ## Retorna o valor lógico VERDADEIRO
+
+
+##
+## Lookup and reference functions Funções de pesquisa e referência
+##
+ADDRESS = ENDEREÇO ## Retorna uma referência como texto para uma única célula em uma planilha
+AREAS = ÁREAS ## Retorna o número de áreas em uma referência
+CHOOSE = ESCOLHER ## Escolhe um valor a partir de uma lista de valores
+COLUMN = COL ## Retorna o número da coluna de uma referência
+COLUMNS = COLS ## Retorna o número de colunas em uma referência
+HLOOKUP = PROCH ## Procura na linha superior de uma matriz e retorna o valor da célula especificada
+HYPERLINK = HYPERLINK ## Cria um atalho ou salto que abre um documento armazenado em um servidor de rede, uma intranet ou na Internet
+INDEX = ÍNDICE ## Usa um índice para escolher um valor de uma referência ou matriz
+INDIRECT = INDIRETO ## Retorna uma referência indicada por um valor de texto
+LOOKUP = PROC ## Procura valores em um vetor ou em uma matriz
+MATCH = CORRESP ## Procura valores em uma referência ou em uma matriz
+OFFSET = DESLOC ## Retorna um deslocamento de referência com base em uma determinada referência
+ROW = LIN ## Retorna o número da linha de uma referência
+ROWS = LINS ## Retorna o número de linhas em uma referência
+RTD = RTD ## Recupera dados em tempo real de um programa que ofereça suporte a automação COM (automação: uma forma de trabalhar com objetos de um aplicativo a partir de outro aplicativo ou ferramenta de desenvolvimento. Chamada inicialmente de automação OLE, a automação é um padrão industrial e um recurso do modelo de objeto componente (COM).)
+TRANSPOSE = TRANSPOR ## Retorna a transposição de uma matriz
+VLOOKUP = PROCV ## Procura na primeira coluna de uma matriz e move ao longo da linha para retornar o valor de uma célula
+
+
+##
+## Math and trigonometry functions Funções matemáticas e trigonométricas
+##
+ABS = ABS ## Retorna o valor absoluto de um número
+ACOS = ACOS ## Retorna o arco cosseno de um número
+ACOSH = ACOSH ## Retorna o cosseno hiperbólico inverso de um número
+ASIN = ASEN ## Retorna o arco seno de um número
+ASINH = ASENH ## Retorna o seno hiperbólico inverso de um número
+ATAN = ATAN ## Retorna o arco tangente de um número
+ATAN2 = ATAN2 ## Retorna o arco tangente das coordenadas x e y especificadas
+ATANH = ATANH ## Retorna a tangente hiperbólica inversa de um número
+CEILING = TETO ## Arredonda um número para o inteiro mais próximo ou para o múltiplo mais próximo de significância
+COMBIN = COMBIN ## Retorna o número de combinações de um determinado número de objetos
+COS = COS ## Retorna o cosseno de um número
+COSH = COSH ## Retorna o cosseno hiperbólico de um número
+DEGREES = GRAUS ## Converte radianos em graus
+EVEN = PAR ## Arredonda um número para cima até o inteiro par mais próximo
+EXP = EXP ## Retorna e elevado à potência de um número especificado
+FACT = FATORIAL ## Retorna o fatorial de um número
+FACTDOUBLE = FATDUPLO ## Retorna o fatorial duplo de um número
+FLOOR = ARREDMULTB ## Arredonda um número para baixo até zero
+GCD = MDC ## Retorna o máximo divisor comum
+INT = INT ## Arredonda um número para baixo até o número inteiro mais próximo
+LCM = MMC ## Retorna o mínimo múltiplo comum
+LN = LN ## Retorna o logaritmo natural de um número
+LOG = LOG ## Retorna o logaritmo de um número de uma base especificada
+LOG10 = LOG10 ## Retorna o logaritmo de base 10 de um número
+MDETERM = MATRIZ.DETERM ## Retorna o determinante de uma matriz de uma variável do tipo matriz
+MINVERSE = MATRIZ.INVERSO ## Retorna a matriz inversa de uma matriz
+MMULT = MATRIZ.MULT ## Retorna o produto de duas matrizes
+MOD = RESTO ## Retorna o resto da divisão
+MROUND = MARRED ## Retorna um número arredondado ao múltiplo desejado
+MULTINOMIAL = MULTINOMIAL ## Retorna o multinomial de um conjunto de números
+ODD = ÍMPAR ## Arredonda um número para cima até o inteiro ímpar mais próximo
+PI = PI ## Retorna o valor de Pi
+POWER = POTÊNCIA ## Fornece o resultado de um número elevado a uma potência
+PRODUCT = MULT ## Multiplica seus argumentos
+QUOTIENT = QUOCIENTE ## Retorna a parte inteira de uma divisão
+RADIANS = RADIANOS ## Converte graus em radianos
+RAND = ALEATÓRIO ## Retorna um número aleatório entre 0 e 1
+RANDBETWEEN = ALEATÓRIOENTRE ## Retorna um número aleatório entre os números especificados
+ROMAN = ROMANO ## Converte um algarismo arábico em romano, como texto
+ROUND = ARRED ## Arredonda um número até uma quantidade especificada de dígitos
+ROUNDDOWN = ARREDONDAR.PARA.BAIXO ## Arredonda um número para baixo até zero
+ROUNDUP = ARREDONDAR.PARA.CIMA ## Arredonda um número para cima, afastando-o de zero
+SERIESSUM = SOMASEQÜÊNCIA ## Retorna a soma de uma série polinomial baseada na fórmula
+SIGN = SINAL ## Retorna o sinal de um número
+SIN = SEN ## Retorna o seno de um ângulo dado
+SINH = SENH ## Retorna o seno hiperbólico de um número
+SQRT = RAIZ ## Retorna uma raiz quadrada positiva
+SQRTPI = RAIZPI ## Retorna a raiz quadrada de (núm* pi)
+SUBTOTAL = SUBTOTAL ## Retorna um subtotal em uma lista ou em um banco de dados
+SUM = SOMA ## Soma seus argumentos
+SUMIF = SOMASE ## Adiciona as células especificadas por um determinado critério
+SUMIFS = SOMASE ## Adiciona as células em um intervalo que atende a vários critérios
+SUMPRODUCT = SOMARPRODUTO ## Retorna a soma dos produtos de componentes correspondentes de matrizes
+SUMSQ = SOMAQUAD ## Retorna a soma dos quadrados dos argumentos
+SUMX2MY2 = SOMAX2DY2 ## Retorna a soma da diferença dos quadrados dos valores correspondentes em duas matrizes
+SUMX2PY2 = SOMAX2SY2 ## Retorna a soma da soma dos quadrados dos valores correspondentes em duas matrizes
+SUMXMY2 = SOMAXMY2 ## Retorna a soma dos quadrados das diferenças dos valores correspondentes em duas matrizes
+TAN = TAN ## Retorna a tangente de um número
+TANH = TANH ## Retorna a tangente hiperbólica de um número
+TRUNC = TRUNCAR ## Trunca um número para um inteiro
+
+
+##
+## Statistical functions Funções estatísticas
+##
+AVEDEV = DESV.MÉDIO ## Retorna a média aritmética dos desvios médios dos pontos de dados a partir de sua média
+AVERAGE = MÉDIA ## Retorna a média dos argumentos
+AVERAGEA = MÉDIAA ## Retorna a média dos argumentos, inclusive números, texto e valores lógicos
+AVERAGEIF = MÉDIASE ## Retorna a média (média aritmética) de todas as células em um intervalo que atendem a um determinado critério
+AVERAGEIFS = MÉDIASES ## Retorna a média (média aritmética) de todas as células que atendem a múltiplos critérios.
+BETADIST = DISTBETA ## Retorna a função de distribuição cumulativa beta
+BETAINV = BETA.ACUM.INV ## Retorna o inverso da função de distribuição cumulativa para uma distribuição beta especificada
+BINOMDIST = DISTRBINOM ## Retorna a probabilidade de distribuição binomial do termo individual
+CHIDIST = DIST.QUI ## Retorna a probabilidade unicaudal da distribuição qui-quadrada
+CHIINV = INV.QUI ## Retorna o inverso da probabilidade uni-caudal da distribuição qui-quadrada
+CHITEST = TESTE.QUI ## Retorna o teste para independência
+CONFIDENCE = INT.CONFIANÇA ## Retorna o intervalo de confiança para uma média da população
+CORREL = CORREL ## Retorna o coeficiente de correlação entre dois conjuntos de dados
+COUNT = CONT.NÚM ## Calcula quantos números há na lista de argumentos
+COUNTA = CONT.VALORES ## Calcula quantos valores há na lista de argumentos
+COUNTBLANK = CONTAR.VAZIO ## Conta o número de células vazias no intervalo especificado
+COUNTIF = CONT.SE ## Calcula o número de células não vazias em um intervalo que corresponde a determinados critérios
+COUNTIFS = CONT.SES ## Conta o número de células dentro de um intervalo que atende a múltiplos critérios
+COVAR = COVAR ## Retorna a covariância, a média dos produtos dos desvios pares
+CRITBINOM = CRIT.BINOM ## Retorna o menor valor para o qual a distribuição binomial cumulativa é menor ou igual ao valor padrão
+DEVSQ = DESVQ ## Retorna a soma dos quadrados dos desvios
+EXPONDIST = DISTEXPON ## Retorna a distribuição exponencial
+FDIST = DISTF ## Retorna a distribuição de probabilidade F
+FINV = INVF ## Retorna o inverso da distribuição de probabilidades F
+FISHER = FISHER ## Retorna a transformação Fisher
+FISHERINV = FISHERINV ## Retorna o inverso da transformação Fisher
+FORECAST = PREVISÃO ## Retorna um valor ao longo de uma linha reta
+FREQUENCY = FREQÜÊNCIA ## Retorna uma distribuição de freqüência como uma matriz vertical
+FTEST = TESTEF ## Retorna o resultado de um teste F
+GAMMADIST = DISTGAMA ## Retorna a distribuição gama
+GAMMAINV = INVGAMA ## Retorna o inverso da distribuição cumulativa gama
+GAMMALN = LNGAMA ## Retorna o logaritmo natural da função gama, G(x)
+GEOMEAN = MÉDIA.GEOMÉTRICA ## Retorna a média geométrica
+GROWTH = CRESCIMENTO ## Retorna valores ao longo de uma tendência exponencial
+HARMEAN = MÉDIA.HARMÔNICA ## Retorna a média harmônica
+HYPGEOMDIST = DIST.HIPERGEOM ## Retorna a distribuição hipergeométrica
+INTERCEPT = INTERCEPÇÃO ## Retorna a intercepção da linha de regressão linear
+KURT = CURT ## Retorna a curtose de um conjunto de dados
+LARGE = MAIOR ## Retorna o maior valor k-ésimo de um conjunto de dados
+LINEST = PROJ.LIN ## Retorna os parâmetros de uma tendência linear
+LOGEST = PROJ.LOG ## Retorna os parâmetros de uma tendência exponencial
+LOGINV = INVLOG ## Retorna o inverso da distribuição lognormal
+LOGNORMDIST = DIST.LOGNORMAL ## Retorna a distribuição lognormal cumulativa
+MAX = MÁXIMO ## Retorna o valor máximo em uma lista de argumentos
+MAXA = MÁXIMOA ## Retorna o maior valor em uma lista de argumentos, inclusive números, texto e valores lógicos
+MEDIAN = MED ## Retorna a mediana dos números indicados
+MIN = MÍNIMO ## Retorna o valor mínimo em uma lista de argumentos
+MINA = MÍNIMOA ## Retorna o menor valor em uma lista de argumentos, inclusive números, texto e valores lógicos
+MODE = MODO ## Retorna o valor mais comum em um conjunto de dados
+NEGBINOMDIST = DIST.BIN.NEG ## Retorna a distribuição binomial negativa
+NORMDIST = DIST.NORM ## Retorna a distribuição cumulativa normal
+NORMINV = INV.NORM ## Retorna o inverso da distribuição cumulativa normal
+NORMSDIST = DIST.NORMP ## Retorna a distribuição cumulativa normal padrão
+NORMSINV = INV.NORMP ## Retorna o inverso da distribuição cumulativa normal padrão
+PEARSON = PEARSON ## Retorna o coeficiente de correlação do momento do produto Pearson
+PERCENTILE = PERCENTIL ## Retorna o k-ésimo percentil de valores em um intervalo
+PERCENTRANK = ORDEM.PORCENTUAL ## Retorna a ordem percentual de um valor em um conjunto de dados
+PERMUT = PERMUT ## Retorna o número de permutações de um determinado número de objetos
+POISSON = POISSON ## Retorna a distribuição Poisson
+PROB = PROB ## Retorna a probabilidade de valores em um intervalo estarem entre dois limites
+QUARTILE = QUARTIL ## Retorna o quartil do conjunto de dados
+RANK = ORDEM ## Retorna a posição de um número em uma lista de números
+RSQ = RQUAD ## Retorna o quadrado do coeficiente de correlação do momento do produto de Pearson
+SKEW = DISTORÇÃO ## Retorna a distorção de uma distribuição
+SLOPE = INCLINAÇÃO ## Retorna a inclinação da linha de regressão linear
+SMALL = MENOR ## Retorna o menor valor k-ésimo do conjunto de dados
+STANDARDIZE = PADRONIZAR ## Retorna um valor normalizado
+STDEV = DESVPAD ## Estima o desvio padrão com base em uma amostra
+STDEVA = DESVPADA ## Estima o desvio padrão com base em uma amostra, inclusive números, texto e valores lógicos
+STDEVP = DESVPADP ## Calcula o desvio padrão com base na população total
+STDEVPA = DESVPADPA ## Calcula o desvio padrão com base na população total, inclusive números, texto e valores lógicos
+STEYX = EPADYX ## Retorna o erro padrão do valor-y previsto para cada x da regressão
+TDIST = DISTT ## Retorna a distribuição t de Student
+TINV = INVT ## Retorna o inverso da distribuição t de Student
+TREND = TENDÊNCIA ## Retorna valores ao longo de uma tendência linear
+TRIMMEAN = MÉDIA.INTERNA ## Retorna a média do interior de um conjunto de dados
+TTEST = TESTET ## Retorna a probabilidade associada ao teste t de Student
+VAR = VAR ## Estima a variância com base em uma amostra
+VARA = VARA ## Estima a variância com base em uma amostra, inclusive números, texto e valores lógicos
+VARP = VARP ## Calcula a variância com base na população inteira
+VARPA = VARPA ## Calcula a variância com base na população total, inclusive números, texto e valores lógicos
+WEIBULL = WEIBULL ## Retorna a distribuição Weibull
+ZTEST = TESTEZ ## Retorna o valor de probabilidade uni-caudal de um teste-z
+
+
+##
+## Text functions Funções de texto
+##
+ASC = ASC ## Altera letras do inglês ou katakana de largura total (bytes duplos) dentro de uma seqüência de caracteres para caracteres de meia largura (byte único)
+BAHTTEXT = BAHTTEXT ## Converte um número em um texto, usando o formato de moeda ß (baht)
+CHAR = CARACT ## Retorna o caractere especificado pelo número de código
+CLEAN = TIRAR ## Remove todos os caracteres do texto que não podem ser impressos
+CODE = CÓDIGO ## Retorna um código numérico para o primeiro caractere de uma seqüência de caracteres de texto
+CONCATENATE = CONCATENAR ## Agrupa vários itens de texto em um único item de texto
+DOLLAR = MOEDA ## Converte um número em texto, usando o formato de moeda $ (dólar)
+EXACT = EXATO ## Verifica se dois valores de texto são idênticos
+FIND = PROCURAR ## Procura um valor de texto dentro de outro (diferencia maiúsculas de minúsculas)
+FINDB = PROCURARB ## Procura um valor de texto dentro de outro (diferencia maiúsculas de minúsculas)
+FIXED = DEF.NÚM.DEC ## Formata um número como texto com um número fixo de decimais
+JIS = JIS ## Altera letras do inglês ou katakana de meia largura (byte único) dentro de uma seqüência de caracteres para caracteres de largura total (bytes duplos)
+LEFT = ESQUERDA ## Retorna os caracteres mais à esquerda de um valor de texto
+LEFTB = ESQUERDAB ## Retorna os caracteres mais à esquerda de um valor de texto
+LEN = NÚM.CARACT ## Retorna o número de caracteres em uma seqüência de texto
+LENB = NÚM.CARACTB ## Retorna o número de caracteres em uma seqüência de texto
+LOWER = MINÚSCULA ## Converte texto para minúsculas
+MID = EXT.TEXTO ## Retorna um número específico de caracteres de uma seqüência de texto começando na posição especificada
+MIDB = EXT.TEXTOB ## Retorna um número específico de caracteres de uma seqüência de texto começando na posição especificada
+PHONETIC = FONÉTICA ## Extrai os caracteres fonéticos (furigana) de uma seqüência de caracteres de texto
+PROPER = PRI.MAIÚSCULA ## Coloca a primeira letra de cada palavra em maiúscula em um valor de texto
+REPLACE = MUDAR ## Muda os caracteres dentro do texto
+REPLACEB = MUDARB ## Muda os caracteres dentro do texto
+REPT = REPT ## Repete o texto um determinado número de vezes
+RIGHT = DIREITA ## Retorna os caracteres mais à direita de um valor de texto
+RIGHTB = DIREITAB ## Retorna os caracteres mais à direita de um valor de texto
+SEARCH = LOCALIZAR ## Localiza um valor de texto dentro de outro (não diferencia maiúsculas de minúsculas)
+SEARCHB = LOCALIZARB ## Localiza um valor de texto dentro de outro (não diferencia maiúsculas de minúsculas)
+SUBSTITUTE = SUBSTITUIR ## Substitui um novo texto por um texto antigo em uma seqüência de texto
+T = T ## Converte os argumentos em texto
+TEXT = TEXTO ## Formata um número e o converte em texto
+TRIM = ARRUMAR ## Remove espaços do texto
+UPPER = MAIÚSCULA ## Converte o texto em maiúsculas
+VALUE = VALOR ## Converte um argumento de texto em um número
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/config
new file mode 100644
index 00000000000..cd85c17aae5
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/config
@@ -0,0 +1,24 @@
+##
+## PhpSpreadsheet
+##
+
+ArgumentSeparator = ;
+
+
+##
+## (For future use)
+##
+currencySymbol = €
+
+
+##
+## Excel Error Codes (For future use)
+
+##
+NULL = #NULO!
+DIV0 = #DIV/0!
+VALUE = #VALOR!
+REF = #REF!
+NAME = #NOME?
+NUM = #NÚM!
+NA = #N/D
diff --git a/lib/phpexcel/PHPExcel/locale/pt/functions b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/functions
similarity index 98%
rename from lib/phpexcel/PHPExcel/locale/pt/functions
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/functions
index 7fe9e3b5800..ba4eb471bad 100644
--- a/lib/phpexcel/PHPExcel/locale/pt/functions
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/pt/functions
@@ -1,408 +1,408 @@
-##
-## Add-in and Automation functions Funções de Suplemento e Automatização
-##
-GETPIVOTDATA = OBTERDADOSDIN ## Devolve dados armazenados num relatório de Tabela Dinâmica
-
-
-##
-## Cube functions Funções de cubo
-##
-CUBEKPIMEMBER = MEMBROKPICUBO ## Devolve o nome, propriedade e medição de um KPI (key performance indicator) e apresenta o nome e a propriedade na célula. Um KPI é uma medida quantificável, como, por exemplo, o lucro mensal bruto ou a rotatividade trimestral de pessoal, utilizada para monitorizar o desempenho de uma organização.
-CUBEMEMBER = MEMBROCUBO ## Devolve um membro ou cadeia de identificação numa hierarquia de cubo. Utilizada para validar a existência do membro ou cadeia de identificação no cubo.
-CUBEMEMBERPROPERTY = PROPRIEDADEMEMBROCUBO ## Devolve o valor de uma propriedade de membro no cubo. Utilizada para validar a existência de um nome de membro no cubo e para devolver a propriedade especificada para esse membro.
-CUBERANKEDMEMBER = MEMBROCLASSIFICADOCUBO ## Devolve o enésimo ou a classificação mais alta num conjunto. Utilizada para devolver um ou mais elementos num conjunto, tal como o melhor vendedor ou os 10 melhores alunos.
-CUBESET = CONJUNTOCUBO ## Define um conjunto calculado de membros ou cadeias de identificação enviando uma expressão de conjunto para o cubo no servidor, que cria o conjunto e, em seguida, devolve o conjunto ao Microsoft Office Excel.
-CUBESETCOUNT = CONTARCONJUNTOCUBO ## Devolve o número de itens num conjunto.
-CUBEVALUE = VALORCUBO ## Devolve um valor agregado do cubo.
-
-
-##
-## Database functions Funções de base de dados
-##
-DAVERAGE = BDMÉDIA ## Devolve a média das entradas da base de dados seleccionadas
-DCOUNT = BDCONTAR ## Conta as células que contêm números numa base de dados
-DCOUNTA = BDCONTAR.VAL ## Conta as células que não estejam em branco numa base de dados
-DGET = BDOBTER ## Extrai de uma base de dados um único registo que corresponde aos critérios especificados
-DMAX = BDMÁX ## Devolve o valor máximo das entradas da base de dados seleccionadas
-DMIN = BDMÍN ## Devolve o valor mínimo das entradas da base de dados seleccionadas
-DPRODUCT = BDMULTIPL ## Multiplica os valores de um determinado campo de registos que correspondem aos critérios numa base de dados
-DSTDEV = BDDESVPAD ## Calcula o desvio-padrão com base numa amostra de entradas da base de dados seleccionadas
-DSTDEVP = BDDESVPADP ## Calcula o desvio-padrão com base na população total das entradas da base de dados seleccionadas
-DSUM = BDSOMA ## Adiciona os números na coluna de campo dos registos de base de dados que correspondem aos critérios
-DVAR = BDVAR ## Calcula a variância com base numa amostra das entradas de base de dados seleccionadas
-DVARP = BDVARP ## Calcula a variância com base na população total das entradas de base de dados seleccionadas
-
-
-##
-## Date and time functions Funções de data e hora
-##
-DATE = DATA ## Devolve o número de série de uma determinada data
-DATEVALUE = DATA.VALOR ## Converte uma data em forma de texto num número de série
-DAY = DIA ## Converte um número de série num dia do mês
-DAYS360 = DIAS360 ## Calcula o número de dias entre duas datas com base num ano com 360 dias
-EDATE = DATAM ## Devolve um número de série de data que corresponde ao número de meses indicado antes ou depois da data de início
-EOMONTH = FIMMÊS ## Devolve o número de série do último dia do mês antes ou depois de um número de meses especificado
-HOUR = HORA ## Converte um número de série numa hora
-MINUTE = MINUTO ## Converte um número de série num minuto
-MONTH = MÊS ## Converte um número de série num mês
-NETWORKDAYS = DIATRABALHOTOTAL ## Devolve o número total de dias úteis entre duas datas
-NOW = AGORA ## Devolve o número de série da data e hora actuais
-SECOND = SEGUNDO ## Converte um número de série num segundo
-TIME = TEMPO ## Devolve o número de série de um determinado tempo
-TIMEVALUE = VALOR.TEMPO ## Converte um tempo em forma de texto num número de série
-TODAY = HOJE ## Devolve o número de série da data actual
-WEEKDAY = DIA.SEMANA ## Converte um número de série num dia da semana
-WEEKNUM = NÚMSEMANA ## Converte um número de série num número que representa o número da semana num determinado ano
-WORKDAY = DIA.TRABALHO ## Devolve o número de série da data antes ou depois de um número de dias úteis especificado
-YEAR = ANO ## Converte um número de série num ano
-YEARFRAC = FRACÇÃOANO ## Devolve a fracção de ano que representa o número de dias inteiros entre a data_de_início e a data_de_fim
-
-
-##
-## Engineering functions Funções de engenharia
-##
-BESSELI = BESSELI ## Devolve a função de Bessel modificada In(x)
-BESSELJ = BESSELJ ## Devolve a função de Bessel Jn(x)
-BESSELK = BESSELK ## Devolve a função de Bessel modificada Kn(x)
-BESSELY = BESSELY ## Devolve a função de Bessel Yn(x)
-BIN2DEC = BINADEC ## Converte um número binário em decimal
-BIN2HEX = BINAHEX ## Converte um número binário em hexadecimal
-BIN2OCT = BINAOCT ## Converte um número binário em octal
-COMPLEX = COMPLEXO ## Converte coeficientes reais e imaginários num número complexo
-CONVERT = CONVERTER ## Converte um número de um sistema de medida noutro
-DEC2BIN = DECABIN ## Converte um número decimal em binário
-DEC2HEX = DECAHEX ## Converte um número decimal em hexadecimal
-DEC2OCT = DECAOCT ## Converte um número decimal em octal
-DELTA = DELTA ## Testa se dois valores são iguais
-ERF = FUNCERRO ## Devolve a função de erro
-ERFC = FUNCERROCOMPL ## Devolve a função de erro complementar
-GESTEP = DEGRAU ## Testa se um número é maior do que um valor limite
-HEX2BIN = HEXABIN ## Converte um número hexadecimal em binário
-HEX2DEC = HEXADEC ## Converte um número hexadecimal em decimal
-HEX2OCT = HEXAOCT ## Converte um número hexadecimal em octal
-IMABS = IMABS ## Devolve o valor absoluto (módulo) de um número complexo
-IMAGINARY = IMAGINÁRIO ## Devolve o coeficiente imaginário de um número complexo
-IMARGUMENT = IMARG ## Devolve o argumento Teta, um ângulo expresso em radianos
-IMCONJUGATE = IMCONJ ## Devolve o conjugado complexo de um número complexo
-IMCOS = IMCOS ## Devolve o co-seno de um número complexo
-IMDIV = IMDIV ## Devolve o quociente de dois números complexos
-IMEXP = IMEXP ## Devolve o exponencial de um número complexo
-IMLN = IMLN ## Devolve o logaritmo natural de um número complexo
-IMLOG10 = IMLOG10 ## Devolve o logaritmo de base 10 de um número complexo
-IMLOG2 = IMLOG2 ## Devolve o logaritmo de base 2 de um número complexo
-IMPOWER = IMPOT ## Devolve um número complexo elevado a uma potência inteira
-IMPRODUCT = IMPROD ## Devolve o produto de números complexos
-IMREAL = IMREAL ## Devolve o coeficiente real de um número complexo
-IMSIN = IMSENO ## Devolve o seno de um número complexo
-IMSQRT = IMRAIZ ## Devolve a raiz quadrada de um número complexo
-IMSUB = IMSUBTR ## Devolve a diferença entre dois números complexos
-IMSUM = IMSOMA ## Devolve a soma de números complexos
-OCT2BIN = OCTABIN ## Converte um número octal em binário
-OCT2DEC = OCTADEC ## Converte um número octal em decimal
-OCT2HEX = OCTAHEX ## Converte um número octal em hexadecimal
-
-
-##
-## Financial functions Funções financeiras
-##
-ACCRINT = JUROSACUM ## Devolve os juros acumulados de um título que paga juros periódicos
-ACCRINTM = JUROSACUMV ## Devolve os juros acumulados de um título que paga juros no vencimento
-AMORDEGRC = AMORDEGRC ## Devolve a depreciação correspondente a cada período contabilístico utilizando um coeficiente de depreciação
-AMORLINC = AMORLINC ## Devolve a depreciação correspondente a cada período contabilístico
-COUPDAYBS = CUPDIASINLIQ ## Devolve o número de dias entre o início do período do cupão e a data de regularização
-COUPDAYS = CUPDIAS ## Devolve o número de dias no período do cupão que contém a data de regularização
-COUPDAYSNC = CUPDIASPRÓX ## Devolve o número de dias entre a data de regularização e a data do cupão seguinte
-COUPNCD = CUPDATAPRÓX ## Devolve a data do cupão seguinte após a data de regularização
-COUPNUM = CUPNÚM ## Devolve o número de cupões a serem pagos entre a data de regularização e a data de vencimento
-COUPPCD = CUPDATAANT ## Devolve a data do cupão anterior antes da data de regularização
-CUMIPMT = PGTOJURACUM ## Devolve os juros cumulativos pagos entre dois períodos
-CUMPRINC = PGTOCAPACUM ## Devolve o capital cumulativo pago a título de empréstimo entre dois períodos
-DB = BD ## Devolve a depreciação de um activo relativo a um período especificado utilizando o método das quotas degressivas fixas
-DDB = BDD ## Devolve a depreciação de um activo relativo a um período especificado utilizando o método das quotas degressivas duplas ou qualquer outro método especificado
-DISC = DESC ## Devolve a taxa de desconto de um título
-DOLLARDE = MOEDADEC ## Converte um preço em unidade monetária, expresso como uma fracção, num preço em unidade monetária, expresso como um número decimal
-DOLLARFR = MOEDAFRA ## Converte um preço em unidade monetária, expresso como um número decimal, num preço em unidade monetária, expresso como uma fracção
-DURATION = DURAÇÃO ## Devolve a duração anual de um título com pagamentos de juros periódicos
-EFFECT = EFECTIVA ## Devolve a taxa de juros anual efectiva
-FV = VF ## Devolve o valor futuro de um investimento
-FVSCHEDULE = VFPLANO ## Devolve o valor futuro de um capital inicial após a aplicação de uma série de taxas de juro compostas
-INTRATE = TAXAJUROS ## Devolve a taxa de juros de um título investido na totalidade
-IPMT = IPGTO ## Devolve o pagamento dos juros de um investimento durante um determinado período
-IRR = TIR ## Devolve a taxa de rentabilidade interna para uma série de fluxos monetários
-ISPMT = É.PGTO ## Calcula os juros pagos durante um período específico de um investimento
-MDURATION = MDURAÇÃO ## Devolve a duração modificada de Macauley de um título com um valor de paridade equivalente a € 100
-MIRR = MTIR ## Devolve a taxa interna de rentabilidade em que os fluxos monetários positivos e negativos são financiados com taxas diferentes
-NOMINAL = NOMINAL ## Devolve a taxa de juros nominal anual
-NPER = NPER ## Devolve o número de períodos de um investimento
-NPV = VAL ## Devolve o valor actual líquido de um investimento com base numa série de fluxos monetários periódicos e numa taxa de desconto
-ODDFPRICE = PREÇOPRIMINC ## Devolve o preço por € 100 do valor nominal de um título com um período inicial incompleto
-ODDFYIELD = LUCROPRIMINC ## Devolve o lucro de um título com um período inicial incompleto
-ODDLPRICE = PREÇOÚLTINC ## Devolve o preço por € 100 do valor nominal de um título com um período final incompleto
-ODDLYIELD = LUCROÚLTINC ## Devolve o lucro de um título com um período final incompleto
-PMT = PGTO ## Devolve o pagamento periódico de uma anuidade
-PPMT = PPGTO ## Devolve o pagamento sobre o capital de um investimento num determinado período
-PRICE = PREÇO ## Devolve o preço por € 100 do valor nominal de um título que paga juros periódicos
-PRICEDISC = PREÇODESC ## Devolve o preço por € 100 do valor nominal de um título descontado
-PRICEMAT = PREÇOVENC ## Devolve o preço por € 100 do valor nominal de um título que paga juros no vencimento
-PV = VA ## Devolve o valor actual de um investimento
-RATE = TAXA ## Devolve a taxa de juros por período de uma anuidade
-RECEIVED = RECEBER ## Devolve o montante recebido no vencimento de um título investido na totalidade
-SLN = AMORT ## Devolve uma depreciação linear de um activo durante um período
-SYD = AMORTD ## Devolve a depreciação por algarismos da soma dos anos de um activo durante um período especificado
-TBILLEQ = OTN ## Devolve o lucro de um título equivalente a uma Obrigação do Tesouro
-TBILLPRICE = OTNVALOR ## Devolve o preço por € 100 de valor nominal de uma Obrigação do Tesouro
-TBILLYIELD = OTNLUCRO ## Devolve o lucro de uma Obrigação do Tesouro
-VDB = BDV ## Devolve a depreciação de um activo relativo a um período específico ou parcial utilizando um método de quotas degressivas
-XIRR = XTIR ## Devolve a taxa interna de rentabilidade de um plano de fluxos monetários que não seja necessariamente periódica
-XNPV = XVAL ## Devolve o valor actual líquido de um plano de fluxos monetários que não seja necessariamente periódico
-YIELD = LUCRO ## Devolve o lucro de um título que paga juros periódicos
-YIELDDISC = LUCRODESC ## Devolve o lucro anual de um título emitido abaixo do valor nominal, por exemplo, uma Obrigação do Tesouro
-YIELDMAT = LUCROVENC ## Devolve o lucro anual de um título que paga juros na data de vencimento
-
-
-##
-## Information functions Funções de informação
-##
-CELL = CÉL ## Devolve informações sobre a formatação, localização ou conteúdo de uma célula
-ERROR.TYPE = TIPO.ERRO ## Devolve um número correspondente a um tipo de erro
-INFO = INFORMAÇÃO ## Devolve informações sobre o ambiente de funcionamento actual
-ISBLANK = É.CÉL.VAZIA ## Devolve VERDADEIRO se o valor estiver em branco
-ISERR = É.ERROS ## Devolve VERDADEIRO se o valor for um valor de erro diferente de #N/D
-ISERROR = É.ERRO ## Devolve VERDADEIRO se o valor for um valor de erro
-ISEVEN = ÉPAR ## Devolve VERDADEIRO se o número for par
-ISLOGICAL = É.LÓGICO ## Devolve VERDADEIRO se o valor for lógico
-ISNA = É.NÃO.DISP ## Devolve VERDADEIRO se o valor for o valor de erro #N/D
-ISNONTEXT = É.NÃO.TEXTO ## Devolve VERDADEIRO se o valor não for texto
-ISNUMBER = É.NÚM ## Devolve VERDADEIRO se o valor for um número
-ISODD = ÉÍMPAR ## Devolve VERDADEIRO se o número for ímpar
-ISREF = É.REF ## Devolve VERDADEIRO se o valor for uma referência
-ISTEXT = É.TEXTO ## Devolve VERDADEIRO se o valor for texto
-N = N ## Devolve um valor convertido num número
-NA = NÃO.DISP ## Devolve o valor de erro #N/D
-TYPE = TIPO ## Devolve um número que indica o tipo de dados de um valor
-
-
-##
-## Logical functions Funções lógicas
-##
-AND = E ## Devolve VERDADEIRO se todos os respectivos argumentos corresponderem a VERDADEIRO
-FALSE = FALSO ## Devolve o valor lógico FALSO
-IF = SE ## Especifica um teste lógico a ser executado
-IFERROR = SE.ERRO ## Devolve um valor definido pelo utilizador se ocorrer um erro na fórmula, e devolve o resultado da fórmula se não ocorrer nenhum erro
-NOT = NÃO ## Inverte a lógica do respectivo argumento
-OR = OU ## Devolve VERDADEIRO se qualquer argumento for VERDADEIRO
-TRUE = VERDADEIRO ## Devolve o valor lógico VERDADEIRO
-
-
-##
-## Lookup and reference functions Funções de pesquisa e referência
-##
-ADDRESS = ENDEREÇO ## Devolve uma referência a uma única célula numa folha de cálculo como texto
-AREAS = ÁREAS ## Devolve o número de áreas numa referência
-CHOOSE = SELECCIONAR ## Selecciona um valor a partir de uma lista de valores
-COLUMN = COL ## Devolve o número da coluna de uma referência
-COLUMNS = COLS ## Devolve o número de colunas numa referência
-HLOOKUP = PROCH ## Procura na linha superior de uma matriz e devolve o valor da célula indicada
-HYPERLINK = HIPERLIGAÇÃO ## Cria um atalho ou hiperligação que abre um documento armazenado num servidor de rede, numa intranet ou na Internet
-INDEX = ÍNDICE ## Utiliza um índice para escolher um valor de uma referência ou de uma matriz
-INDIRECT = INDIRECTO ## Devolve uma referência indicada por um valor de texto
-LOOKUP = PROC ## Procura valores num vector ou numa matriz
-MATCH = CORRESP ## Procura valores numa referência ou numa matriz
-OFFSET = DESLOCAMENTO ## Devolve o deslocamento de referência de uma determinada referência
-ROW = LIN ## Devolve o número da linha de uma referência
-ROWS = LINS ## Devolve o número de linhas numa referência
-RTD = RTD ## Obtém dados em tempo real a partir de um programa que suporte automatização COM (automatização: modo de trabalhar com objectos de uma aplicação a partir de outra aplicação ou ferramenta de desenvolvimento. Anteriormente conhecida como automatização OLE, a automatização é uma norma da indústria de software e uma funcionalidade COM (Component Object Model).)
-TRANSPOSE = TRANSPOR ## Devolve a transposição de uma matriz
-VLOOKUP = PROCV ## Procura na primeira coluna de uma matriz e percorre a linha para devolver o valor de uma célula
-
-
-##
-## Math and trigonometry functions Funções matemáticas e trigonométricas
-##
-ABS = ABS ## Devolve o valor absoluto de um número
-ACOS = ACOS ## Devolve o arco de co-seno de um número
-ACOSH = ACOSH ## Devolve o co-seno hiperbólico inverso de um número
-ASIN = ASEN ## Devolve o arco de seno de um número
-ASINH = ASENH ## Devolve o seno hiperbólico inverso de um número
-ATAN = ATAN ## Devolve o arco de tangente de um número
-ATAN2 = ATAN2 ## Devolve o arco de tangente das coordenadas x e y
-ATANH = ATANH ## Devolve a tangente hiperbólica inversa de um número
-CEILING = ARRED.EXCESSO ## Arredonda um número para o número inteiro mais próximo ou para o múltiplo de significância mais próximo
-COMBIN = COMBIN ## Devolve o número de combinações de um determinado número de objectos
-COS = COS ## Devolve o co-seno de um número
-COSH = COSH ## Devolve o co-seno hiperbólico de um número
-DEGREES = GRAUS ## Converte radianos em graus
-EVEN = PAR ## Arredonda um número por excesso para o número inteiro mais próximo
-EXP = EXP ## Devolve e elevado à potência de um determinado número
-FACT = FACTORIAL ## Devolve o factorial de um número
-FACTDOUBLE = FACTDUPLO ## Devolve o factorial duplo de um número
-FLOOR = ARRED.DEFEITO ## Arredonda um número por defeito até zero
-GCD = MDC ## Devolve o maior divisor comum
-INT = INT ## Arredonda um número por defeito para o número inteiro mais próximo
-LCM = MMC ## Devolve o mínimo múltiplo comum
-LN = LN ## Devolve o logaritmo natural de um número
-LOG = LOG ## Devolve o logaritmo de um número com uma base especificada
-LOG10 = LOG10 ## Devolve o logaritmo de base 10 de um número
-MDETERM = MATRIZ.DETERM ## Devolve o determinante matricial de uma matriz
-MINVERSE = MATRIZ.INVERSA ## Devolve o inverso matricial de uma matriz
-MMULT = MATRIZ.MULT ## Devolve o produto matricial de duas matrizes
-MOD = RESTO ## Devolve o resto da divisão
-MROUND = MARRED ## Devolve um número arredondado para o múltiplo pretendido
-MULTINOMIAL = POLINOMIAL ## Devolve o polinomial de um conjunto de números
-ODD = ÍMPAR ## Arredonda por excesso um número para o número inteiro ímpar mais próximo
-PI = PI ## Devolve o valor de pi
-POWER = POTÊNCIA ## Devolve o resultado de um número elevado a uma potência
-PRODUCT = PRODUTO ## Multiplica os respectivos argumentos
-QUOTIENT = QUOCIENTE ## Devolve a parte inteira de uma divisão
-RADIANS = RADIANOS ## Converte graus em radianos
-RAND = ALEATÓRIO ## Devolve um número aleatório entre 0 e 1
-RANDBETWEEN = ALEATÓRIOENTRE ## Devolve um número aleatório entre os números especificados
-ROMAN = ROMANO ## Converte um número árabe em romano, como texto
-ROUND = ARRED ## Arredonda um número para um número de dígitos especificado
-ROUNDDOWN = ARRED.PARA.BAIXO ## Arredonda um número por defeito até zero
-ROUNDUP = ARRED.PARA.CIMA ## Arredonda um número por excesso, afastando-o de zero
-SERIESSUM = SOMASÉRIE ## Devolve a soma de uma série de potências baseada na fórmula
-SIGN = SINAL ## Devolve o sinal de um número
-SIN = SEN ## Devolve o seno de um determinado ângulo
-SINH = SENH ## Devolve o seno hiperbólico de um número
-SQRT = RAIZQ ## Devolve uma raiz quadrada positiva
-SQRTPI = RAIZPI ## Devolve a raiz quadrada de (núm * pi)
-SUBTOTAL = SUBTOTAL ## Devolve um subtotal numa lista ou base de dados
-SUM = SOMA ## Adiciona os respectivos argumentos
-SUMIF = SOMA.SE ## Adiciona as células especificadas por um determinado critério
-SUMIFS = SOMA.SE.S ## Adiciona as células num intervalo que cumpre vários critérios
-SUMPRODUCT = SOMARPRODUTO ## Devolve a soma dos produtos de componentes de matrizes correspondentes
-SUMSQ = SOMARQUAD ## Devolve a soma dos quadrados dos argumentos
-SUMX2MY2 = SOMAX2DY2 ## Devolve a soma da diferença dos quadrados dos valores correspondentes em duas matrizes
-SUMX2PY2 = SOMAX2SY2 ## Devolve a soma da soma dos quadrados dos valores correspondentes em duas matrizes
-SUMXMY2 = SOMAXMY2 ## Devolve a soma dos quadrados da diferença dos valores correspondentes em duas matrizes
-TAN = TAN ## Devolve a tangente de um número
-TANH = TANH ## Devolve a tangente hiperbólica de um número
-TRUNC = TRUNCAR ## Trunca um número para um número inteiro
-
-
-##
-## Statistical functions Funções estatísticas
-##
-AVEDEV = DESV.MÉDIO ## Devolve a média aritmética dos desvios absolutos à média dos pontos de dados
-AVERAGE = MÉDIA ## Devolve a média dos respectivos argumentos
-AVERAGEA = MÉDIAA ## Devolve uma média dos respectivos argumentos, incluindo números, texto e valores lógicos
-AVERAGEIF = MÉDIA.SE ## Devolve a média aritmética de todas as células num intervalo que cumprem determinado critério
-AVERAGEIFS = MÉDIA.SE.S ## Devolve a média aritmética de todas as células que cumprem múltiplos critérios
-BETADIST = DISTBETA ## Devolve a função de distribuição cumulativa beta
-BETAINV = BETA.ACUM.INV ## Devolve o inverso da função de distribuição cumulativa relativamente a uma distribuição beta específica
-BINOMDIST = DISTRBINOM ## Devolve a probabilidade de distribuição binomial de termo individual
-CHIDIST = DIST.CHI ## Devolve a probabilidade unicaudal da distribuição qui-quadrada
-CHIINV = INV.CHI ## Devolve o inverso da probabilidade unicaudal da distribuição qui-quadrada
-CHITEST = TESTE.CHI ## Devolve o teste para independência
-CONFIDENCE = INT.CONFIANÇA ## Devolve o intervalo de confiança correspondente a uma média de população
-CORREL = CORREL ## Devolve o coeficiente de correlação entre dois conjuntos de dados
-COUNT = CONTAR ## Conta os números que existem na lista de argumentos
-COUNTA = CONTAR.VAL ## Conta os valores que existem na lista de argumentos
-COUNTBLANK = CONTAR.VAZIO ## Conta o número de células em branco num intervalo
-COUNTIF = CONTAR.SE ## Calcula o número de células num intervalo que corresponde aos critérios determinados
-COUNTIFS = CONTAR.SE.S ## Conta o número de células num intervalo que cumprem múltiplos critérios
-COVAR = COVAR ## Devolve a covariância, que é a média dos produtos de desvios de pares
-CRITBINOM = CRIT.BINOM ## Devolve o menor valor em que a distribuição binomial cumulativa é inferior ou igual a um valor de critério
-DEVSQ = DESVQ ## Devolve a soma dos quadrados dos desvios
-EXPONDIST = DISTEXPON ## Devolve a distribuição exponencial
-FDIST = DISTF ## Devolve a distribuição da probabilidade F
-FINV = INVF ## Devolve o inverso da distribuição da probabilidade F
-FISHER = FISHER ## Devolve a transformação Fisher
-FISHERINV = FISHERINV ## Devolve o inverso da transformação Fisher
-FORECAST = PREVISÃO ## Devolve um valor ao longo de uma tendência linear
-FREQUENCY = FREQUÊNCIA ## Devolve uma distribuição de frequência como uma matriz vertical
-FTEST = TESTEF ## Devolve o resultado de um teste F
-GAMMADIST = DISTGAMA ## Devolve a distribuição gama
-GAMMAINV = INVGAMA ## Devolve o inverso da distribuição gama cumulativa
-GAMMALN = LNGAMA ## Devolve o logaritmo natural da função gama, Γ(x)
-GEOMEAN = MÉDIA.GEOMÉTRICA ## Devolve a média geométrica
-GROWTH = CRESCIMENTO ## Devolve valores ao longo de uma tendência exponencial
-HARMEAN = MÉDIA.HARMÓNICA ## Devolve a média harmónica
-HYPGEOMDIST = DIST.HIPERGEOM ## Devolve a distribuição hipergeométrica
-INTERCEPT = INTERCEPTAR ## Devolve a intercepção da linha de regressão linear
-KURT = CURT ## Devolve a curtose de um conjunto de dados
-LARGE = MAIOR ## Devolve o maior valor k-ésimo de um conjunto de dados
-LINEST = PROJ.LIN ## Devolve os parâmetros de uma tendência linear
-LOGEST = PROJ.LOG ## Devolve os parâmetros de uma tendência exponencial
-LOGINV = INVLOG ## Devolve o inverso da distribuição normal logarítmica
-LOGNORMDIST = DIST.NORMALLOG ## Devolve a distribuição normal logarítmica cumulativa
-MAX = MÁXIMO ## Devolve o valor máximo numa lista de argumentos
-MAXA = MÁXIMOA ## Devolve o valor máximo numa lista de argumentos, incluindo números, texto e valores lógicos
-MEDIAN = MED ## Devolve a mediana dos números indicados
-MIN = MÍNIMO ## Devolve o valor mínimo numa lista de argumentos
-MINA = MÍNIMOA ## Devolve o valor mínimo numa lista de argumentos, incluindo números, texto e valores lógicos
-MODE = MODA ## Devolve o valor mais comum num conjunto de dados
-NEGBINOMDIST = DIST.BIN.NEG ## Devolve a distribuição binominal negativa
-NORMDIST = DIST.NORM ## Devolve a distribuição cumulativa normal
-NORMINV = INV.NORM ## Devolve o inverso da distribuição cumulativa normal
-NORMSDIST = DIST.NORMP ## Devolve a distribuição cumulativa normal padrão
-NORMSINV = INV.NORMP ## Devolve o inverso da distribuição cumulativa normal padrão
-PEARSON = PEARSON ## Devolve o coeficiente de correlação momento/produto de Pearson
-PERCENTILE = PERCENTIL ## Devolve o k-ésimo percentil de valores num intervalo
-PERCENTRANK = ORDEM.PERCENTUAL ## Devolve a ordem percentual de um valor num conjunto de dados
-PERMUT = PERMUTAR ## Devolve o número de permutações de um determinado número de objectos
-POISSON = POISSON ## Devolve a distribuição de Poisson
-PROB = PROB ## Devolve a probabilidade dos valores num intervalo se encontrarem entre dois limites
-QUARTILE = QUARTIL ## Devolve o quartil de um conjunto de dados
-RANK = ORDEM ## Devolve a ordem de um número numa lista numérica
-RSQ = RQUAD ## Devolve o quadrado do coeficiente de correlação momento/produto de Pearson
-SKEW = DISTORÇÃO ## Devolve a distorção de uma distribuição
-SLOPE = DECLIVE ## Devolve o declive da linha de regressão linear
-SMALL = MENOR ## Devolve o menor valor de k-ésimo de um conjunto de dados
-STANDARDIZE = NORMALIZAR ## Devolve um valor normalizado
-STDEV = DESVPAD ## Calcula o desvio-padrão com base numa amostra
-STDEVA = DESVPADA ## Calcula o desvio-padrão com base numa amostra, incluindo números, texto e valores lógicos
-STDEVP = DESVPADP ## Calcula o desvio-padrão com base na população total
-STDEVPA = DESVPADPA ## Calcula o desvio-padrão com base na população total, incluindo números, texto e valores lógicos
-STEYX = EPADYX ## Devolve o erro-padrão do valor de y previsto para cada x na regressão
-TDIST = DISTT ## Devolve a distribuição t de Student
-TINV = INVT ## Devolve o inverso da distribuição t de Student
-TREND = TENDÊNCIA ## Devolve valores ao longo de uma tendência linear
-TRIMMEAN = MÉDIA.INTERNA ## Devolve a média do interior de um conjunto de dados
-TTEST = TESTET ## Devolve a probabilidade associada ao teste t de Student
-VAR = VAR ## Calcula a variância com base numa amostra
-VARA = VARA ## Calcula a variância com base numa amostra, incluindo números, texto e valores lógicos
-VARP = VARP ## Calcula a variância com base na população total
-VARPA = VARPA ## Calcula a variância com base na população total, incluindo números, texto e valores lógicos
-WEIBULL = WEIBULL ## Devolve a distribuição Weibull
-ZTEST = TESTEZ ## Devolve o valor de probabilidade unicaudal de um teste-z
-
-
-##
-## Text functions Funções de texto
-##
-ASC = ASC ## Altera letras ou katakana de largura total (byte duplo) numa cadeia de caracteres para caracteres de largura média (byte único)
-BAHTTEXT = TEXTO.BAHT ## Converte um número em texto, utilizando o formato monetário ß (baht)
-CHAR = CARÁCT ## Devolve o carácter especificado pelo número de código
-CLEAN = LIMPAR ## Remove do texto todos os caracteres não imprimíveis
-CODE = CÓDIGO ## Devolve um código numérico correspondente ao primeiro carácter numa cadeia de texto
-CONCATENATE = CONCATENAR ## Agrupa vários itens de texto num único item de texto
-DOLLAR = MOEDA ## Converte um número em texto, utilizando o formato monetário € (Euro)
-EXACT = EXACTO ## Verifica se dois valores de texto são idênticos
-FIND = LOCALIZAR ## Localiza um valor de texto dentro de outro (sensível às maiúsculas e minúsculas)
-FINDB = LOCALIZARB ## Localiza um valor de texto dentro de outro (sensível às maiúsculas e minúsculas)
-FIXED = FIXA ## Formata um número como texto com um número fixo de decimais
-JIS = JIS ## Altera letras ou katakana de largura média (byte único) numa cadeia de caracteres para caracteres de largura total (byte duplo)
-LEFT = ESQUERDA ## Devolve os caracteres mais à esquerda de um valor de texto
-LEFTB = ESQUERDAB ## Devolve os caracteres mais à esquerda de um valor de texto
-LEN = NÚM.CARACT ## Devolve o número de caracteres de uma cadeia de texto
-LENB = NÚM.CARACTB ## Devolve o número de caracteres de uma cadeia de texto
-LOWER = MINÚSCULAS ## Converte o texto em minúsculas
-MID = SEG.TEXTO ## Devolve um número específico de caracteres de uma cadeia de texto, a partir da posição especificada
-MIDB = SEG.TEXTOB ## Devolve um número específico de caracteres de uma cadeia de texto, a partir da posição especificada
-PHONETIC = FONÉTICA ## Retira os caracteres fonéticos (furigana) de uma cadeia de texto
-PROPER = INICIAL.MAIÚSCULA ## Coloca em maiúsculas a primeira letra de cada palavra de um valor de texto
-REPLACE = SUBSTITUIR ## Substitui caracteres no texto
-REPLACEB = SUBSTITUIRB ## Substitui caracteres no texto
-REPT = REPETIR ## Repete texto um determinado número de vezes
-RIGHT = DIREITA ## Devolve os caracteres mais à direita de um valor de texto
-RIGHTB = DIREITAB ## Devolve os caracteres mais à direita de um valor de texto
-SEARCH = PROCURAR ## Localiza um valor de texto dentro de outro (não sensível a maiúsculas e minúsculas)
-SEARCHB = PROCURARB ## Localiza um valor de texto dentro de outro (não sensível a maiúsculas e minúsculas)
-SUBSTITUTE = SUBST ## Substitui texto novo por texto antigo numa cadeia de texto
-T = T ## Converte os respectivos argumentos em texto
-TEXT = TEXTO ## Formata um número e converte-o em texto
-TRIM = COMPACTAR ## Remove espaços do texto
-UPPER = MAIÚSCULAS ## Converte texto em maiúsculas
-VALUE = VALOR ## Converte um argumento de texto num número
+##
+## Add-in and Automation functions Funções de Suplemento e Automatização
+##
+GETPIVOTDATA = OBTERDADOSDIN ## Devolve dados armazenados num relatório de Tabela Dinâmica
+
+
+##
+## Cube functions Funções de cubo
+##
+CUBEKPIMEMBER = MEMBROKPICUBO ## Devolve o nome, propriedade e medição de um KPI (key performance indicator) e apresenta o nome e a propriedade na célula. Um KPI é uma medida quantificável, como, por exemplo, o lucro mensal bruto ou a rotatividade trimestral de pessoal, utilizada para monitorizar o desempenho de uma organização.
+CUBEMEMBER = MEMBROCUBO ## Devolve um membro ou cadeia de identificação numa hierarquia de cubo. Utilizada para validar a existência do membro ou cadeia de identificação no cubo.
+CUBEMEMBERPROPERTY = PROPRIEDADEMEMBROCUBO ## Devolve o valor de uma propriedade de membro no cubo. Utilizada para validar a existência de um nome de membro no cubo e para devolver a propriedade especificada para esse membro.
+CUBERANKEDMEMBER = MEMBROCLASSIFICADOCUBO ## Devolve o enésimo ou a classificação mais alta num conjunto. Utilizada para devolver um ou mais elementos num conjunto, tal como o melhor vendedor ou os 10 melhores alunos.
+CUBESET = CONJUNTOCUBO ## Define um conjunto calculado de membros ou cadeias de identificação enviando uma expressão de conjunto para o cubo no servidor, que cria o conjunto e, em seguida, devolve o conjunto ao Microsoft Office Excel.
+CUBESETCOUNT = CONTARCONJUNTOCUBO ## Devolve o número de itens num conjunto.
+CUBEVALUE = VALORCUBO ## Devolve um valor agregado do cubo.
+
+
+##
+## Database functions Funções de base de dados
+##
+DAVERAGE = BDMÉDIA ## Devolve a média das entradas da base de dados seleccionadas
+DCOUNT = BDCONTAR ## Conta as células que contêm números numa base de dados
+DCOUNTA = BDCONTAR.VAL ## Conta as células que não estejam em branco numa base de dados
+DGET = BDOBTER ## Extrai de uma base de dados um único registo que corresponde aos critérios especificados
+DMAX = BDMÁX ## Devolve o valor máximo das entradas da base de dados seleccionadas
+DMIN = BDMÍN ## Devolve o valor mínimo das entradas da base de dados seleccionadas
+DPRODUCT = BDMULTIPL ## Multiplica os valores de um determinado campo de registos que correspondem aos critérios numa base de dados
+DSTDEV = BDDESVPAD ## Calcula o desvio-padrão com base numa amostra de entradas da base de dados seleccionadas
+DSTDEVP = BDDESVPADP ## Calcula o desvio-padrão com base na população total das entradas da base de dados seleccionadas
+DSUM = BDSOMA ## Adiciona os números na coluna de campo dos registos de base de dados que correspondem aos critérios
+DVAR = BDVAR ## Calcula a variância com base numa amostra das entradas de base de dados seleccionadas
+DVARP = BDVARP ## Calcula a variância com base na população total das entradas de base de dados seleccionadas
+
+
+##
+## Date and time functions Funções de data e hora
+##
+DATE = DATA ## Devolve o número de série de uma determinada data
+DATEVALUE = DATA.VALOR ## Converte uma data em forma de texto num número de série
+DAY = DIA ## Converte um número de série num dia do mês
+DAYS360 = DIAS360 ## Calcula o número de dias entre duas datas com base num ano com 360 dias
+EDATE = DATAM ## Devolve um número de série de data que corresponde ao número de meses indicado antes ou depois da data de início
+EOMONTH = FIMMÊS ## Devolve o número de série do último dia do mês antes ou depois de um número de meses especificado
+HOUR = HORA ## Converte um número de série numa hora
+MINUTE = MINUTO ## Converte um número de série num minuto
+MONTH = MÊS ## Converte um número de série num mês
+NETWORKDAYS = DIATRABALHOTOTAL ## Devolve o número total de dias úteis entre duas datas
+NOW = AGORA ## Devolve o número de série da data e hora actuais
+SECOND = SEGUNDO ## Converte um número de série num segundo
+TIME = TEMPO ## Devolve o número de série de um determinado tempo
+TIMEVALUE = VALOR.TEMPO ## Converte um tempo em forma de texto num número de série
+TODAY = HOJE ## Devolve o número de série da data actual
+WEEKDAY = DIA.SEMANA ## Converte um número de série num dia da semana
+WEEKNUM = NÚMSEMANA ## Converte um número de série num número que representa o número da semana num determinado ano
+WORKDAY = DIA.TRABALHO ## Devolve o número de série da data antes ou depois de um número de dias úteis especificado
+YEAR = ANO ## Converte um número de série num ano
+YEARFRAC = FRACÇÃOANO ## Devolve a fracção de ano que representa o número de dias inteiros entre a data_de_início e a data_de_fim
+
+
+##
+## Engineering functions Funções de engenharia
+##
+BESSELI = BESSELI ## Devolve a função de Bessel modificada In(x)
+BESSELJ = BESSELJ ## Devolve a função de Bessel Jn(x)
+BESSELK = BESSELK ## Devolve a função de Bessel modificada Kn(x)
+BESSELY = BESSELY ## Devolve a função de Bessel Yn(x)
+BIN2DEC = BINADEC ## Converte um número binário em decimal
+BIN2HEX = BINAHEX ## Converte um número binário em hexadecimal
+BIN2OCT = BINAOCT ## Converte um número binário em octal
+COMPLEX = COMPLEXO ## Converte coeficientes reais e imaginários num número complexo
+CONVERT = CONVERTER ## Converte um número de um sistema de medida noutro
+DEC2BIN = DECABIN ## Converte um número decimal em binário
+DEC2HEX = DECAHEX ## Converte um número decimal em hexadecimal
+DEC2OCT = DECAOCT ## Converte um número decimal em octal
+DELTA = DELTA ## Testa se dois valores são iguais
+ERF = FUNCERRO ## Devolve a função de erro
+ERFC = FUNCERROCOMPL ## Devolve a função de erro complementar
+GESTEP = DEGRAU ## Testa se um número é maior do que um valor limite
+HEX2BIN = HEXABIN ## Converte um número hexadecimal em binário
+HEX2DEC = HEXADEC ## Converte um número hexadecimal em decimal
+HEX2OCT = HEXAOCT ## Converte um número hexadecimal em octal
+IMABS = IMABS ## Devolve o valor absoluto (módulo) de um número complexo
+IMAGINARY = IMAGINÁRIO ## Devolve o coeficiente imaginário de um número complexo
+IMARGUMENT = IMARG ## Devolve o argumento Teta, um ângulo expresso em radianos
+IMCONJUGATE = IMCONJ ## Devolve o conjugado complexo de um número complexo
+IMCOS = IMCOS ## Devolve o co-seno de um número complexo
+IMDIV = IMDIV ## Devolve o quociente de dois números complexos
+IMEXP = IMEXP ## Devolve o exponencial de um número complexo
+IMLN = IMLN ## Devolve o logaritmo natural de um número complexo
+IMLOG10 = IMLOG10 ## Devolve o logaritmo de base 10 de um número complexo
+IMLOG2 = IMLOG2 ## Devolve o logaritmo de base 2 de um número complexo
+IMPOWER = IMPOT ## Devolve um número complexo elevado a uma potência inteira
+IMPRODUCT = IMPROD ## Devolve o produto de números complexos
+IMREAL = IMREAL ## Devolve o coeficiente real de um número complexo
+IMSIN = IMSENO ## Devolve o seno de um número complexo
+IMSQRT = IMRAIZ ## Devolve a raiz quadrada de um número complexo
+IMSUB = IMSUBTR ## Devolve a diferença entre dois números complexos
+IMSUM = IMSOMA ## Devolve a soma de números complexos
+OCT2BIN = OCTABIN ## Converte um número octal em binário
+OCT2DEC = OCTADEC ## Converte um número octal em decimal
+OCT2HEX = OCTAHEX ## Converte um número octal em hexadecimal
+
+
+##
+## Financial functions Funções financeiras
+##
+ACCRINT = JUROSACUM ## Devolve os juros acumulados de um título que paga juros periódicos
+ACCRINTM = JUROSACUMV ## Devolve os juros acumulados de um título que paga juros no vencimento
+AMORDEGRC = AMORDEGRC ## Devolve a depreciação correspondente a cada período contabilístico utilizando um coeficiente de depreciação
+AMORLINC = AMORLINC ## Devolve a depreciação correspondente a cada período contabilístico
+COUPDAYBS = CUPDIASINLIQ ## Devolve o número de dias entre o início do período do cupão e a data de regularização
+COUPDAYS = CUPDIAS ## Devolve o número de dias no período do cupão que contém a data de regularização
+COUPDAYSNC = CUPDIASPRÓX ## Devolve o número de dias entre a data de regularização e a data do cupão seguinte
+COUPNCD = CUPDATAPRÓX ## Devolve a data do cupão seguinte após a data de regularização
+COUPNUM = CUPNÚM ## Devolve o número de cupões a serem pagos entre a data de regularização e a data de vencimento
+COUPPCD = CUPDATAANT ## Devolve a data do cupão anterior antes da data de regularização
+CUMIPMT = PGTOJURACUM ## Devolve os juros cumulativos pagos entre dois períodos
+CUMPRINC = PGTOCAPACUM ## Devolve o capital cumulativo pago a título de empréstimo entre dois períodos
+DB = BD ## Devolve a depreciação de um activo relativo a um período especificado utilizando o método das quotas degressivas fixas
+DDB = BDD ## Devolve a depreciação de um activo relativo a um período especificado utilizando o método das quotas degressivas duplas ou qualquer outro método especificado
+DISC = DESC ## Devolve a taxa de desconto de um título
+DOLLARDE = MOEDADEC ## Converte um preço em unidade monetária, expresso como uma fracção, num preço em unidade monetária, expresso como um número decimal
+DOLLARFR = MOEDAFRA ## Converte um preço em unidade monetária, expresso como um número decimal, num preço em unidade monetária, expresso como uma fracção
+DURATION = DURAÇÃO ## Devolve a duração anual de um título com pagamentos de juros periódicos
+EFFECT = EFECTIVA ## Devolve a taxa de juros anual efectiva
+FV = VF ## Devolve o valor futuro de um investimento
+FVSCHEDULE = VFPLANO ## Devolve o valor futuro de um capital inicial após a aplicação de uma série de taxas de juro compostas
+INTRATE = TAXAJUROS ## Devolve a taxa de juros de um título investido na totalidade
+IPMT = IPGTO ## Devolve o pagamento dos juros de um investimento durante um determinado período
+IRR = TIR ## Devolve a taxa de rentabilidade interna para uma série de fluxos monetários
+ISPMT = É.PGTO ## Calcula os juros pagos durante um período específico de um investimento
+MDURATION = MDURAÇÃO ## Devolve a duração modificada de Macauley de um título com um valor de paridade equivalente a € 100
+MIRR = MTIR ## Devolve a taxa interna de rentabilidade em que os fluxos monetários positivos e negativos são financiados com taxas diferentes
+NOMINAL = NOMINAL ## Devolve a taxa de juros nominal anual
+NPER = NPER ## Devolve o número de períodos de um investimento
+NPV = VAL ## Devolve o valor actual líquido de um investimento com base numa série de fluxos monetários periódicos e numa taxa de desconto
+ODDFPRICE = PREÇOPRIMINC ## Devolve o preço por € 100 do valor nominal de um título com um período inicial incompleto
+ODDFYIELD = LUCROPRIMINC ## Devolve o lucro de um título com um período inicial incompleto
+ODDLPRICE = PREÇOÚLTINC ## Devolve o preço por € 100 do valor nominal de um título com um período final incompleto
+ODDLYIELD = LUCROÚLTINC ## Devolve o lucro de um título com um período final incompleto
+PMT = PGTO ## Devolve o pagamento periódico de uma anuidade
+PPMT = PPGTO ## Devolve o pagamento sobre o capital de um investimento num determinado período
+PRICE = PREÇO ## Devolve o preço por € 100 do valor nominal de um título que paga juros periódicos
+PRICEDISC = PREÇODESC ## Devolve o preço por € 100 do valor nominal de um título descontado
+PRICEMAT = PREÇOVENC ## Devolve o preço por € 100 do valor nominal de um título que paga juros no vencimento
+PV = VA ## Devolve o valor actual de um investimento
+RATE = TAXA ## Devolve a taxa de juros por período de uma anuidade
+RECEIVED = RECEBER ## Devolve o montante recebido no vencimento de um título investido na totalidade
+SLN = AMORT ## Devolve uma depreciação linear de um activo durante um período
+SYD = AMORTD ## Devolve a depreciação por algarismos da soma dos anos de um activo durante um período especificado
+TBILLEQ = OTN ## Devolve o lucro de um título equivalente a uma Obrigação do Tesouro
+TBILLPRICE = OTNVALOR ## Devolve o preço por € 100 de valor nominal de uma Obrigação do Tesouro
+TBILLYIELD = OTNLUCRO ## Devolve o lucro de uma Obrigação do Tesouro
+VDB = BDV ## Devolve a depreciação de um activo relativo a um período específico ou parcial utilizando um método de quotas degressivas
+XIRR = XTIR ## Devolve a taxa interna de rentabilidade de um plano de fluxos monetários que não seja necessariamente periódica
+XNPV = XVAL ## Devolve o valor actual líquido de um plano de fluxos monetários que não seja necessariamente periódico
+YIELD = LUCRO ## Devolve o lucro de um título que paga juros periódicos
+YIELDDISC = LUCRODESC ## Devolve o lucro anual de um título emitido abaixo do valor nominal, por exemplo, uma Obrigação do Tesouro
+YIELDMAT = LUCROVENC ## Devolve o lucro anual de um título que paga juros na data de vencimento
+
+
+##
+## Information functions Funções de informação
+##
+CELL = CÉL ## Devolve informações sobre a formatação, localização ou conteúdo de uma célula
+ERROR.TYPE = TIPO.ERRO ## Devolve um número correspondente a um tipo de erro
+INFO = INFORMAÇÃO ## Devolve informações sobre o ambiente de funcionamento actual
+ISBLANK = É.CÉL.VAZIA ## Devolve VERDADEIRO se o valor estiver em branco
+ISERR = É.ERROS ## Devolve VERDADEIRO se o valor for um valor de erro diferente de #N/D
+ISERROR = É.ERRO ## Devolve VERDADEIRO se o valor for um valor de erro
+ISEVEN = ÉPAR ## Devolve VERDADEIRO se o número for par
+ISLOGICAL = É.LÓGICO ## Devolve VERDADEIRO se o valor for lógico
+ISNA = É.NÃO.DISP ## Devolve VERDADEIRO se o valor for o valor de erro #N/D
+ISNONTEXT = É.NÃO.TEXTO ## Devolve VERDADEIRO se o valor não for texto
+ISNUMBER = É.NÚM ## Devolve VERDADEIRO se o valor for um número
+ISODD = ÉÍMPAR ## Devolve VERDADEIRO se o número for ímpar
+ISREF = É.REF ## Devolve VERDADEIRO se o valor for uma referência
+ISTEXT = É.TEXTO ## Devolve VERDADEIRO se o valor for texto
+N = N ## Devolve um valor convertido num número
+NA = NÃO.DISP ## Devolve o valor de erro #N/D
+TYPE = TIPO ## Devolve um número que indica o tipo de dados de um valor
+
+
+##
+## Logical functions Funções lógicas
+##
+AND = E ## Devolve VERDADEIRO se todos os respectivos argumentos corresponderem a VERDADEIRO
+FALSE = FALSO ## Devolve o valor lógico FALSO
+IF = SE ## Especifica um teste lógico a ser executado
+IFERROR = SE.ERRO ## Devolve um valor definido pelo utilizador se ocorrer um erro na fórmula, e devolve o resultado da fórmula se não ocorrer nenhum erro
+NOT = NÃO ## Inverte a lógica do respectivo argumento
+OR = OU ## Devolve VERDADEIRO se qualquer argumento for VERDADEIRO
+TRUE = VERDADEIRO ## Devolve o valor lógico VERDADEIRO
+
+
+##
+## Lookup and reference functions Funções de pesquisa e referência
+##
+ADDRESS = ENDEREÇO ## Devolve uma referência a uma única célula numa folha de cálculo como texto
+AREAS = ÁREAS ## Devolve o número de áreas numa referência
+CHOOSE = SELECCIONAR ## Selecciona um valor a partir de uma lista de valores
+COLUMN = COL ## Devolve o número da coluna de uma referência
+COLUMNS = COLS ## Devolve o número de colunas numa referência
+HLOOKUP = PROCH ## Procura na linha superior de uma matriz e devolve o valor da célula indicada
+HYPERLINK = HIPERLIGAÇÃO ## Cria um atalho ou hiperligação que abre um documento armazenado num servidor de rede, numa intranet ou na Internet
+INDEX = ÍNDICE ## Utiliza um índice para escolher um valor de uma referência ou de uma matriz
+INDIRECT = INDIRECTO ## Devolve uma referência indicada por um valor de texto
+LOOKUP = PROC ## Procura valores num vector ou numa matriz
+MATCH = CORRESP ## Procura valores numa referência ou numa matriz
+OFFSET = DESLOCAMENTO ## Devolve o deslocamento de referência de uma determinada referência
+ROW = LIN ## Devolve o número da linha de uma referência
+ROWS = LINS ## Devolve o número de linhas numa referência
+RTD = RTD ## Obtém dados em tempo real a partir de um programa que suporte automatização COM (automatização: modo de trabalhar com objectos de uma aplicação a partir de outra aplicação ou ferramenta de desenvolvimento. Anteriormente conhecida como automatização OLE, a automatização é uma norma da indústria de software e uma funcionalidade COM (Component Object Model).)
+TRANSPOSE = TRANSPOR ## Devolve a transposição de uma matriz
+VLOOKUP = PROCV ## Procura na primeira coluna de uma matriz e percorre a linha para devolver o valor de uma célula
+
+
+##
+## Math and trigonometry functions Funções matemáticas e trigonométricas
+##
+ABS = ABS ## Devolve o valor absoluto de um número
+ACOS = ACOS ## Devolve o arco de co-seno de um número
+ACOSH = ACOSH ## Devolve o co-seno hiperbólico inverso de um número
+ASIN = ASEN ## Devolve o arco de seno de um número
+ASINH = ASENH ## Devolve o seno hiperbólico inverso de um número
+ATAN = ATAN ## Devolve o arco de tangente de um número
+ATAN2 = ATAN2 ## Devolve o arco de tangente das coordenadas x e y
+ATANH = ATANH ## Devolve a tangente hiperbólica inversa de um número
+CEILING = ARRED.EXCESSO ## Arredonda um número para o número inteiro mais próximo ou para o múltiplo de significância mais próximo
+COMBIN = COMBIN ## Devolve o número de combinações de um determinado número de objectos
+COS = COS ## Devolve o co-seno de um número
+COSH = COSH ## Devolve o co-seno hiperbólico de um número
+DEGREES = GRAUS ## Converte radianos em graus
+EVEN = PAR ## Arredonda um número por excesso para o número inteiro mais próximo
+EXP = EXP ## Devolve e elevado à potência de um determinado número
+FACT = FACTORIAL ## Devolve o factorial de um número
+FACTDOUBLE = FACTDUPLO ## Devolve o factorial duplo de um número
+FLOOR = ARRED.DEFEITO ## Arredonda um número por defeito até zero
+GCD = MDC ## Devolve o maior divisor comum
+INT = INT ## Arredonda um número por defeito para o número inteiro mais próximo
+LCM = MMC ## Devolve o mínimo múltiplo comum
+LN = LN ## Devolve o logaritmo natural de um número
+LOG = LOG ## Devolve o logaritmo de um número com uma base especificada
+LOG10 = LOG10 ## Devolve o logaritmo de base 10 de um número
+MDETERM = MATRIZ.DETERM ## Devolve o determinante matricial de uma matriz
+MINVERSE = MATRIZ.INVERSA ## Devolve o inverso matricial de uma matriz
+MMULT = MATRIZ.MULT ## Devolve o produto matricial de duas matrizes
+MOD = RESTO ## Devolve o resto da divisão
+MROUND = MARRED ## Devolve um número arredondado para o múltiplo pretendido
+MULTINOMIAL = POLINOMIAL ## Devolve o polinomial de um conjunto de números
+ODD = ÍMPAR ## Arredonda por excesso um número para o número inteiro ímpar mais próximo
+PI = PI ## Devolve o valor de pi
+POWER = POTÊNCIA ## Devolve o resultado de um número elevado a uma potência
+PRODUCT = PRODUTO ## Multiplica os respectivos argumentos
+QUOTIENT = QUOCIENTE ## Devolve a parte inteira de uma divisão
+RADIANS = RADIANOS ## Converte graus em radianos
+RAND = ALEATÓRIO ## Devolve um número aleatório entre 0 e 1
+RANDBETWEEN = ALEATÓRIOENTRE ## Devolve um número aleatório entre os números especificados
+ROMAN = ROMANO ## Converte um número árabe em romano, como texto
+ROUND = ARRED ## Arredonda um número para um número de dígitos especificado
+ROUNDDOWN = ARRED.PARA.BAIXO ## Arredonda um número por defeito até zero
+ROUNDUP = ARRED.PARA.CIMA ## Arredonda um número por excesso, afastando-o de zero
+SERIESSUM = SOMASÉRIE ## Devolve a soma de uma série de potências baseada na fórmula
+SIGN = SINAL ## Devolve o sinal de um número
+SIN = SEN ## Devolve o seno de um determinado ângulo
+SINH = SENH ## Devolve o seno hiperbólico de um número
+SQRT = RAIZQ ## Devolve uma raiz quadrada positiva
+SQRTPI = RAIZPI ## Devolve a raiz quadrada de (núm * pi)
+SUBTOTAL = SUBTOTAL ## Devolve um subtotal numa lista ou base de dados
+SUM = SOMA ## Adiciona os respectivos argumentos
+SUMIF = SOMA.SE ## Adiciona as células especificadas por um determinado critério
+SUMIFS = SOMA.SE.S ## Adiciona as células num intervalo que cumpre vários critérios
+SUMPRODUCT = SOMARPRODUTO ## Devolve a soma dos produtos de componentes de matrizes correspondentes
+SUMSQ = SOMARQUAD ## Devolve a soma dos quadrados dos argumentos
+SUMX2MY2 = SOMAX2DY2 ## Devolve a soma da diferença dos quadrados dos valores correspondentes em duas matrizes
+SUMX2PY2 = SOMAX2SY2 ## Devolve a soma da soma dos quadrados dos valores correspondentes em duas matrizes
+SUMXMY2 = SOMAXMY2 ## Devolve a soma dos quadrados da diferença dos valores correspondentes em duas matrizes
+TAN = TAN ## Devolve a tangente de um número
+TANH = TANH ## Devolve a tangente hiperbólica de um número
+TRUNC = TRUNCAR ## Trunca um número para um número inteiro
+
+
+##
+## Statistical functions Funções estatísticas
+##
+AVEDEV = DESV.MÉDIO ## Devolve a média aritmética dos desvios absolutos à média dos pontos de dados
+AVERAGE = MÉDIA ## Devolve a média dos respectivos argumentos
+AVERAGEA = MÉDIAA ## Devolve uma média dos respectivos argumentos, incluindo números, texto e valores lógicos
+AVERAGEIF = MÉDIA.SE ## Devolve a média aritmética de todas as células num intervalo que cumprem determinado critério
+AVERAGEIFS = MÉDIA.SE.S ## Devolve a média aritmética de todas as células que cumprem múltiplos critérios
+BETADIST = DISTBETA ## Devolve a função de distribuição cumulativa beta
+BETAINV = BETA.ACUM.INV ## Devolve o inverso da função de distribuição cumulativa relativamente a uma distribuição beta específica
+BINOMDIST = DISTRBINOM ## Devolve a probabilidade de distribuição binomial de termo individual
+CHIDIST = DIST.CHI ## Devolve a probabilidade unicaudal da distribuição qui-quadrada
+CHIINV = INV.CHI ## Devolve o inverso da probabilidade unicaudal da distribuição qui-quadrada
+CHITEST = TESTE.CHI ## Devolve o teste para independência
+CONFIDENCE = INT.CONFIANÇA ## Devolve o intervalo de confiança correspondente a uma média de população
+CORREL = CORREL ## Devolve o coeficiente de correlação entre dois conjuntos de dados
+COUNT = CONTAR ## Conta os números que existem na lista de argumentos
+COUNTA = CONTAR.VAL ## Conta os valores que existem na lista de argumentos
+COUNTBLANK = CONTAR.VAZIO ## Conta o número de células em branco num intervalo
+COUNTIF = CONTAR.SE ## Calcula o número de células num intervalo que corresponde aos critérios determinados
+COUNTIFS = CONTAR.SE.S ## Conta o número de células num intervalo que cumprem múltiplos critérios
+COVAR = COVAR ## Devolve a covariância, que é a média dos produtos de desvios de pares
+CRITBINOM = CRIT.BINOM ## Devolve o menor valor em que a distribuição binomial cumulativa é inferior ou igual a um valor de critério
+DEVSQ = DESVQ ## Devolve a soma dos quadrados dos desvios
+EXPONDIST = DISTEXPON ## Devolve a distribuição exponencial
+FDIST = DISTF ## Devolve a distribuição da probabilidade F
+FINV = INVF ## Devolve o inverso da distribuição da probabilidade F
+FISHER = FISHER ## Devolve a transformação Fisher
+FISHERINV = FISHERINV ## Devolve o inverso da transformação Fisher
+FORECAST = PREVISÃO ## Devolve um valor ao longo de uma tendência linear
+FREQUENCY = FREQUÊNCIA ## Devolve uma distribuição de frequência como uma matriz vertical
+FTEST = TESTEF ## Devolve o resultado de um teste F
+GAMMADIST = DISTGAMA ## Devolve a distribuição gama
+GAMMAINV = INVGAMA ## Devolve o inverso da distribuição gama cumulativa
+GAMMALN = LNGAMA ## Devolve o logaritmo natural da função gama, Γ(x)
+GEOMEAN = MÉDIA.GEOMÉTRICA ## Devolve a média geométrica
+GROWTH = CRESCIMENTO ## Devolve valores ao longo de uma tendência exponencial
+HARMEAN = MÉDIA.HARMÓNICA ## Devolve a média harmónica
+HYPGEOMDIST = DIST.HIPERGEOM ## Devolve a distribuição hipergeométrica
+INTERCEPT = INTERCEPTAR ## Devolve a intercepção da linha de regressão linear
+KURT = CURT ## Devolve a curtose de um conjunto de dados
+LARGE = MAIOR ## Devolve o maior valor k-ésimo de um conjunto de dados
+LINEST = PROJ.LIN ## Devolve os parâmetros de uma tendência linear
+LOGEST = PROJ.LOG ## Devolve os parâmetros de uma tendência exponencial
+LOGINV = INVLOG ## Devolve o inverso da distribuição normal logarítmica
+LOGNORMDIST = DIST.NORMALLOG ## Devolve a distribuição normal logarítmica cumulativa
+MAX = MÁXIMO ## Devolve o valor máximo numa lista de argumentos
+MAXA = MÁXIMOA ## Devolve o valor máximo numa lista de argumentos, incluindo números, texto e valores lógicos
+MEDIAN = MED ## Devolve a mediana dos números indicados
+MIN = MÍNIMO ## Devolve o valor mínimo numa lista de argumentos
+MINA = MÍNIMOA ## Devolve o valor mínimo numa lista de argumentos, incluindo números, texto e valores lógicos
+MODE = MODA ## Devolve o valor mais comum num conjunto de dados
+NEGBINOMDIST = DIST.BIN.NEG ## Devolve a distribuição binominal negativa
+NORMDIST = DIST.NORM ## Devolve a distribuição cumulativa normal
+NORMINV = INV.NORM ## Devolve o inverso da distribuição cumulativa normal
+NORMSDIST = DIST.NORMP ## Devolve a distribuição cumulativa normal padrão
+NORMSINV = INV.NORMP ## Devolve o inverso da distribuição cumulativa normal padrão
+PEARSON = PEARSON ## Devolve o coeficiente de correlação momento/produto de Pearson
+PERCENTILE = PERCENTIL ## Devolve o k-ésimo percentil de valores num intervalo
+PERCENTRANK = ORDEM.PERCENTUAL ## Devolve a ordem percentual de um valor num conjunto de dados
+PERMUT = PERMUTAR ## Devolve o número de permutações de um determinado número de objectos
+POISSON = POISSON ## Devolve a distribuição de Poisson
+PROB = PROB ## Devolve a probabilidade dos valores num intervalo se encontrarem entre dois limites
+QUARTILE = QUARTIL ## Devolve o quartil de um conjunto de dados
+RANK = ORDEM ## Devolve a ordem de um número numa lista numérica
+RSQ = RQUAD ## Devolve o quadrado do coeficiente de correlação momento/produto de Pearson
+SKEW = DISTORÇÃO ## Devolve a distorção de uma distribuição
+SLOPE = DECLIVE ## Devolve o declive da linha de regressão linear
+SMALL = MENOR ## Devolve o menor valor de k-ésimo de um conjunto de dados
+STANDARDIZE = NORMALIZAR ## Devolve um valor normalizado
+STDEV = DESVPAD ## Calcula o desvio-padrão com base numa amostra
+STDEVA = DESVPADA ## Calcula o desvio-padrão com base numa amostra, incluindo números, texto e valores lógicos
+STDEVP = DESVPADP ## Calcula o desvio-padrão com base na população total
+STDEVPA = DESVPADPA ## Calcula o desvio-padrão com base na população total, incluindo números, texto e valores lógicos
+STEYX = EPADYX ## Devolve o erro-padrão do valor de y previsto para cada x na regressão
+TDIST = DISTT ## Devolve a distribuição t de Student
+TINV = INVT ## Devolve o inverso da distribuição t de Student
+TREND = TENDÊNCIA ## Devolve valores ao longo de uma tendência linear
+TRIMMEAN = MÉDIA.INTERNA ## Devolve a média do interior de um conjunto de dados
+TTEST = TESTET ## Devolve a probabilidade associada ao teste t de Student
+VAR = VAR ## Calcula a variância com base numa amostra
+VARA = VARA ## Calcula a variância com base numa amostra, incluindo números, texto e valores lógicos
+VARP = VARP ## Calcula a variância com base na população total
+VARPA = VARPA ## Calcula a variância com base na população total, incluindo números, texto e valores lógicos
+WEIBULL = WEIBULL ## Devolve a distribuição Weibull
+ZTEST = TESTEZ ## Devolve o valor de probabilidade unicaudal de um teste-z
+
+
+##
+## Text functions Funções de texto
+##
+ASC = ASC ## Altera letras ou katakana de largura total (byte duplo) numa cadeia de caracteres para caracteres de largura média (byte único)
+BAHTTEXT = TEXTO.BAHT ## Converte um número em texto, utilizando o formato monetário ß (baht)
+CHAR = CARÁCT ## Devolve o carácter especificado pelo número de código
+CLEAN = LIMPAR ## Remove do texto todos os caracteres não imprimíveis
+CODE = CÓDIGO ## Devolve um código numérico correspondente ao primeiro carácter numa cadeia de texto
+CONCATENATE = CONCATENAR ## Agrupa vários itens de texto num único item de texto
+DOLLAR = MOEDA ## Converte um número em texto, utilizando o formato monetário € (Euro)
+EXACT = EXACTO ## Verifica se dois valores de texto são idênticos
+FIND = LOCALIZAR ## Localiza um valor de texto dentro de outro (sensível às maiúsculas e minúsculas)
+FINDB = LOCALIZARB ## Localiza um valor de texto dentro de outro (sensível às maiúsculas e minúsculas)
+FIXED = FIXA ## Formata um número como texto com um número fixo de decimais
+JIS = JIS ## Altera letras ou katakana de largura média (byte único) numa cadeia de caracteres para caracteres de largura total (byte duplo)
+LEFT = ESQUERDA ## Devolve os caracteres mais à esquerda de um valor de texto
+LEFTB = ESQUERDAB ## Devolve os caracteres mais à esquerda de um valor de texto
+LEN = NÚM.CARACT ## Devolve o número de caracteres de uma cadeia de texto
+LENB = NÚM.CARACTB ## Devolve o número de caracteres de uma cadeia de texto
+LOWER = MINÚSCULAS ## Converte o texto em minúsculas
+MID = SEG.TEXTO ## Devolve um número específico de caracteres de uma cadeia de texto, a partir da posição especificada
+MIDB = SEG.TEXTOB ## Devolve um número específico de caracteres de uma cadeia de texto, a partir da posição especificada
+PHONETIC = FONÉTICA ## Retira os caracteres fonéticos (furigana) de uma cadeia de texto
+PROPER = INICIAL.MAIÚSCULA ## Coloca em maiúsculas a primeira letra de cada palavra de um valor de texto
+REPLACE = SUBSTITUIR ## Substitui caracteres no texto
+REPLACEB = SUBSTITUIRB ## Substitui caracteres no texto
+REPT = REPETIR ## Repete texto um determinado número de vezes
+RIGHT = DIREITA ## Devolve os caracteres mais à direita de um valor de texto
+RIGHTB = DIREITAB ## Devolve os caracteres mais à direita de um valor de texto
+SEARCH = PROCURAR ## Localiza um valor de texto dentro de outro (não sensível a maiúsculas e minúsculas)
+SEARCHB = PROCURARB ## Localiza um valor de texto dentro de outro (não sensível a maiúsculas e minúsculas)
+SUBSTITUTE = SUBST ## Substitui texto novo por texto antigo numa cadeia de texto
+T = T ## Converte os respectivos argumentos em texto
+TEXT = TEXTO ## Formata um número e converte-o em texto
+TRIM = COMPACTAR ## Remove espaços do texto
+UPPER = MAIÚSCULAS ## Converte texto em maiúsculas
+VALUE = VALOR ## Converte um argumento de texto num número
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/config
new file mode 100644
index 00000000000..9ee9e6ccafc
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/config
@@ -0,0 +1,24 @@
+##
+## PhpSpreadsheet
+##
+
+ArgumentSeparator = ;
+
+
+##
+## (For future use)
+##
+currencySymbol = р
+
+
+##
+## Excel Error Codes (For future use)
+
+##
+NULL = #ПУСТО!
+DIV0 = #ДЕЛ/0!
+VALUE = #ЗНАЧ!
+REF = #ССЫЛ!
+NAME = #ИМЯ?
+NUM = #ЧИСЛО!
+NA = #Н/Д
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/functions b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/functions
new file mode 100644
index 00000000000..3597dbf89df
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/ru/functions
@@ -0,0 +1,416 @@
+##
+## PhpSpreadsheet
+##
+## Data in this file derived from information provided by web-junior (http://www.web-junior.net/)
+##
+##
+
+
+##
+## Add-in and Automation functions Функции надстроек и автоматизации
+##
+GETPIVOTDATA = ПОЛУЧИТЬ.ДАННЫЕ.СВОДНОЙ.ТАБЛИЦЫ ## Возвращает данные, хранящиеся в отчете сводной таблицы.
+
+
+##
+## Cube functions Функции Куб
+##
+CUBEKPIMEMBER = КУБЭЛЕМЕНТКИП ## Возвращает свойство ключевого индикатора производительности «(КИП)» и отображает имя «КИП» в ячейке. «КИП» представляет собой количественную величину, такую как ежемесячная валовая прибыль или ежеквартальная текучесть кадров, используемой для контроля эффективности работы организации.
+CUBEMEMBER = КУБЭЛЕМЕНТ ## Возвращает элемент или кортеж из куба. Используется для проверки существования элемента или кортежа в кубе.
+CUBEMEMBERPROPERTY = КУБСВОЙСТВОЭЛЕМЕНТА ## Возвращает значение свойства элемента из куба. Используется для проверки существования имени элемента в кубе и возвращает указанное свойство для этого элемента.
+CUBERANKEDMEMBER = КУБПОРЭЛЕМЕНТ ## Возвращает n-ый или ранжированный элемент в множество. Используется для возвращения одного или нескольких элементов в множество, например, лучшего продавца или 10 лучших студентов.
+CUBESET = КУБМНОЖ ## Определяет вычислительное множество элементов или кортежей, отправляя на сервер выражение, которое создает множество, а затем возвращает его в Microsoft Office Excel.
+CUBESETCOUNT = КУБЧИСЛОЭЛМНОЖ ## Возвращает число элементов множества.
+CUBEVALUE = КУБЗНАЧЕНИЕ ## Возвращает обобщенное значение из куба.
+
+
+##
+## Database functions Функции для работы с базами данных
+##
+DAVERAGE = ДСРЗНАЧ ## Возвращает среднее значение выбранных записей базы данных.
+DCOUNT = БСЧЁТ ## Подсчитывает количество числовых ячеек в базе данных.
+DCOUNTA = БСЧЁТА ## Подсчитывает количество непустых ячеек в базе данных.
+DGET = БИЗВЛЕЧЬ ## Извлекает из базы данных одну запись, удовлетворяющую заданному условию.
+DMAX = ДМАКС ## Возвращает максимальное значение среди выделенных записей базы данных.
+DMIN = ДМИН ## Возвращает минимальное значение среди выделенных записей базы данных.
+DPRODUCT = БДПРОИЗВЕД ## Перемножает значения определенного поля в записях базы данных, удовлетворяющих условию.
+DSTDEV = ДСТАНДОТКЛ ## Оценивает стандартное отклонение по выборке для выделенных записей базы данных.
+DSTDEVP = ДСТАНДОТКЛП ## Вычисляет стандартное отклонение по генеральной совокупности для выделенных записей базы данных
+DSUM = БДСУММ ## Суммирует числа в поле для записей базы данных, удовлетворяющих условию.
+DVAR = БДДИСП ## Оценивает дисперсию по выборке из выделенных записей базы данных
+DVARP = БДДИСПП ## Вычисляет дисперсию по генеральной совокупности для выделенных записей базы данных
+
+
+##
+## Date and time functions Функции даты и времени
+##
+DATE = ДАТА ## Возвращает заданную дату в числовом формате.
+DATEVALUE = ДАТАЗНАЧ ## Преобразует дату из текстового формата в числовой формат.
+DAY = ДЕНЬ ## Преобразует дату в числовом формате в день месяца.
+DAYS360 = ДНЕЙ360 ## Вычисляет количество дней между двумя датами на основе 360-дневного года.
+EDATE = ДАТАМЕС ## Возвращает дату в числовом формате, отстоящую на заданное число месяцев вперед или назад от начальной даты.
+EOMONTH = КОНМЕСЯЦА ## Возвращает дату в числовом формате для последнего дня месяца, отстоящего вперед или назад на заданное число месяцев.
+HOUR = ЧАС ## Преобразует дату в числовом формате в часы.
+MINUTE = МИНУТЫ ## Преобразует дату в числовом формате в минуты.
+MONTH = МЕСЯЦ ## Преобразует дату в числовом формате в месяцы.
+NETWORKDAYS = ЧИСТРАБДНИ ## Возвращает количество рабочих дней между двумя датами.
+NOW = ТДАТА ## Возвращает текущую дату и время в числовом формате.
+SECOND = СЕКУНДЫ ## Преобразует дату в числовом формате в секунды.
+TIME = ВРЕМЯ ## Возвращает заданное время в числовом формате.
+TIMEVALUE = ВРЕМЗНАЧ ## Преобразует время из текстового формата в числовой формат.
+TODAY = СЕГОДНЯ ## Возвращает текущую дату в числовом формате.
+WEEKDAY = ДЕНЬНЕД ## Преобразует дату в числовом формате в день недели.
+WEEKNUM = НОМНЕДЕЛИ ## Преобразует числовое представление в число, которое указывает, на какую неделю года приходится указанная дата.
+WORKDAY = РАБДЕНЬ ## Возвращает дату в числовом формате, отстоящую вперед или назад на заданное количество рабочих дней.
+YEAR = ГОД ## Преобразует дату в числовом формате в год.
+YEARFRAC = ДОЛЯГОДА ## Возвращает долю года, которую составляет количество дней между начальной и конечной датами.
+
+
+##
+## Engineering functions Инженерные функции
+##
+BESSELI = БЕССЕЛЬ.I ## Возвращает модифицированную функцию Бесселя In(x).
+BESSELJ = БЕССЕЛЬ.J ## Возвращает функцию Бесселя Jn(x).
+BESSELK = БЕССЕЛЬ.K ## Возвращает модифицированную функцию Бесселя Kn(x).
+BESSELY = БЕССЕЛЬ.Y ## Возвращает функцию Бесселя Yn(x).
+BIN2DEC = ДВ.В.ДЕС ## Преобразует двоичное число в десятичное.
+BIN2HEX = ДВ.В.ШЕСТН ## Преобразует двоичное число в шестнадцатеричное.
+BIN2OCT = ДВ.В.ВОСЬМ ## Преобразует двоичное число в восьмеричное.
+COMPLEX = КОМПЛЕКСН ## Преобразует коэффициенты при вещественной и мнимой частях комплексного числа в комплексное число.
+CONVERT = ПРЕОБР ## Преобразует число из одной системы единиц измерения в другую.
+DEC2BIN = ДЕС.В.ДВ ## Преобразует десятичное число в двоичное.
+DEC2HEX = ДЕС.В.ШЕСТН ## Преобразует десятичное число в шестнадцатеричное.
+DEC2OCT = ДЕС.В.ВОСЬМ ## Преобразует десятичное число в восьмеричное.
+DELTA = ДЕЛЬТА ## Проверяет равенство двух значений.
+ERF = ФОШ ## Возвращает функцию ошибки.
+ERFC = ДФОШ ## Возвращает дополнительную функцию ошибки.
+GESTEP = ПОРОГ ## Проверяет, не превышает ли данное число порогового значения.
+HEX2BIN = ШЕСТН.В.ДВ ## Преобразует шестнадцатеричное число в двоичное.
+HEX2DEC = ШЕСТН.В.ДЕС ## Преобразует шестнадцатеричное число в десятичное.
+HEX2OCT = ШЕСТН.В.ВОСЬМ ## Преобразует шестнадцатеричное число в восьмеричное.
+IMABS = МНИМ.ABS ## Возвращает абсолютную величину (модуль) комплексного числа.
+IMAGINARY = МНИМ.ЧАСТЬ ## Возвращает коэффициент при мнимой части комплексного числа.
+IMARGUMENT = МНИМ.АРГУМЕНТ ## Возвращает значение аргумента комплексного числа (тета) — угол, выраженный в радианах.
+IMCONJUGATE = МНИМ.СОПРЯЖ ## Возвращает комплексно-сопряженное комплексное число.
+IMCOS = МНИМ.COS ## Возвращает косинус комплексного числа.
+IMDIV = МНИМ.ДЕЛ ## Возвращает частное от деления двух комплексных чисел.
+IMEXP = МНИМ.EXP ## Возвращает экспоненту комплексного числа.
+IMLN = МНИМ.LN ## Возвращает натуральный логарифм комплексного числа.
+IMLOG10 = МНИМ.LOG10 ## Возвращает обычный (десятичный) логарифм комплексного числа.
+IMLOG2 = МНИМ.LOG2 ## Возвращает двоичный логарифм комплексного числа.
+IMPOWER = МНИМ.СТЕПЕНЬ ## Возвращает комплексное число, возведенное в целую степень.
+IMPRODUCT = МНИМ.ПРОИЗВЕД ## Возвращает произведение от 2 до 29 комплексных чисел.
+IMREAL = МНИМ.ВЕЩ ## Возвращает коэффициент при вещественной части комплексного числа.
+IMSIN = МНИМ.SIN ## Возвращает синус комплексного числа.
+IMSQRT = МНИМ.КОРЕНЬ ## Возвращает значение квадратного корня из комплексного числа.
+IMSUB = МНИМ.РАЗН ## Возвращает разность двух комплексных чисел.
+IMSUM = МНИМ.СУММ ## Возвращает сумму комплексных чисел.
+OCT2BIN = ВОСЬМ.В.ДВ ## Преобразует восьмеричное число в двоичное.
+OCT2DEC = ВОСЬМ.В.ДЕС ## Преобразует восьмеричное число в десятичное.
+OCT2HEX = ВОСЬМ.В.ШЕСТН ## Преобразует восьмеричное число в шестнадцатеричное.
+
+
+##
+## Financial functions Финансовые функции
+##
+ACCRINT = НАКОПДОХОД ## Возвращает накопленный процент по ценным бумагам с периодической выплатой процентов.
+ACCRINTM = НАКОПДОХОДПОГАШ ## Возвращает накопленный процент по ценным бумагам, проценты по которым выплачиваются в срок погашения.
+AMORDEGRC = АМОРУМ ## Возвращает величину амортизации для каждого периода, используя коэффициент амортизации.
+AMORLINC = АМОРУВ ## Возвращает величину амортизации для каждого периода.
+COUPDAYBS = ДНЕЙКУПОНДО ## Возвращает количество дней от начала действия купона до даты соглашения.
+COUPDAYS = ДНЕЙКУПОН ## Возвращает число дней в периоде купона, содержащем дату соглашения.
+COUPDAYSNC = ДНЕЙКУПОНПОСЛЕ ## Возвращает число дней от даты соглашения до срока следующего купона.
+COUPNCD = ДАТАКУПОНПОСЛЕ ## Возвращает следующую дату купона после даты соглашения.
+COUPNUM = ЧИСЛКУПОН ## Возвращает количество купонов, которые могут быть оплачены между датой соглашения и сроком вступления в силу.
+COUPPCD = ДАТАКУПОНДО ## Возвращает предыдущую дату купона перед датой соглашения.
+CUMIPMT = ОБЩПЛАТ ## Возвращает общую выплату, произведенную между двумя периодическими выплатами.
+CUMPRINC = ОБЩДОХОД ## Возвращает общую выплату по займу между двумя периодами.
+DB = ФУО ## Возвращает величину амортизации актива для заданного периода, рассчитанную методом фиксированного уменьшения остатка.
+DDB = ДДОБ ## Возвращает величину амортизации актива за данный период, используя метод двойного уменьшения остатка или иной явно указанный метод.
+DISC = СКИДКА ## Возвращает норму скидки для ценных бумаг.
+DOLLARDE = РУБЛЬ.ДЕС ## Преобразует цену в рублях, выраженную в виде дроби, в цену в рублях, выраженную десятичным числом.
+DOLLARFR = РУБЛЬ.ДРОБЬ ## Преобразует цену в рублях, выраженную десятичным числом, в цену в рублях, выраженную в виде дроби.
+DURATION = ДЛИТ ## Возвращает ежегодную продолжительность действия ценных бумаг с периодическими выплатами по процентам.
+EFFECT = ЭФФЕКТ ## Возвращает действующие ежегодные процентные ставки.
+FV = БС ## Возвращает будущую стоимость инвестиции.
+FVSCHEDULE = БЗРАСПИС ## Возвращает будущую стоимость первоначальной основной суммы после начисления ряда сложных процентов.
+INTRATE = ИНОРМА ## Возвращает процентную ставку для полностью инвестированных ценных бумаг.
+IPMT = ПРПЛТ ## Возвращает величину выплаты прибыли на вложения за данный период.
+IRR = ВСД ## Возвращает внутреннюю ставку доходности для ряда потоков денежных средств.
+ISPMT = ПРОЦПЛАТ ## Вычисляет выплаты за указанный период инвестиции.
+MDURATION = МДЛИТ ## Возвращает модифицированную длительность Маколея для ценных бумаг с предполагаемой номинальной стоимостью 100 рублей.
+MIRR = МВСД ## Возвращает внутреннюю ставку доходности, при которой положительные и отрицательные денежные потоки имеют разные значения ставки.
+NOMINAL = НОМИНАЛ ## Возвращает номинальную годовую процентную ставку.
+NPER = КПЕР ## Возвращает общее количество периодов выплаты для данного вклада.
+NPV = ЧПС ## Возвращает чистую приведенную стоимость инвестиции, основанной на серии периодических денежных потоков и ставке дисконтирования.
+ODDFPRICE = ЦЕНАПЕРВНЕРЕГ ## Возвращает цену за 100 рублей нарицательной стоимости ценных бумаг с нерегулярным первым периодом.
+ODDFYIELD = ДОХОДПЕРВНЕРЕГ ## Возвращает доход по ценным бумагам с нерегулярным первым периодом.
+ODDLPRICE = ЦЕНАПОСЛНЕРЕГ ## Возвращает цену за 100 рублей нарицательной стоимости ценных бумаг с нерегулярным последним периодом.
+ODDLYIELD = ДОХОДПОСЛНЕРЕГ ## Возвращает доход по ценным бумагам с нерегулярным последним периодом.
+PMT = ПЛТ ## Возвращает величину выплаты за один период аннуитета.
+PPMT = ОСПЛТ ## Возвращает величину выплат в погашение основной суммы по инвестиции за заданный период.
+PRICE = ЦЕНА ## Возвращает цену за 100 рублей нарицательной стоимости ценных бумаг, по которым производится периодическая выплата процентов.
+PRICEDISC = ЦЕНАСКИДКА ## Возвращает цену за 100 рублей номинальной стоимости ценных бумаг, на которые сделана скидка.
+PRICEMAT = ЦЕНАПОГАШ ## Возвращает цену за 100 рублей номинальной стоимости ценных бумаг, проценты по которым выплачиваются в срок погашения.
+PV = ПС ## Возвращает приведенную (к текущему моменту) стоимость инвестиции.
+RATE = СТАВКА ## Возвращает процентную ставку по аннуитету за один период.
+RECEIVED = ПОЛУЧЕНО ## Возвращает сумму, полученную к сроку погашения полностью обеспеченных ценных бумаг.
+SLN = АПЛ ## Возвращает величину линейной амортизации актива за один период.
+SYD = АСЧ ## Возвращает величину амортизации актива за данный период, рассчитанную методом суммы годовых чисел.
+TBILLEQ = РАВНОКЧЕК ## Возвращает эквивалентный облигации доход по казначейскому чеку.
+TBILLPRICE = ЦЕНАКЧЕК ## Возвращает цену за 100 рублей нарицательной стоимости для казначейского чека.
+TBILLYIELD = ДОХОДКЧЕК ## Возвращает доход по казначейскому чеку.
+VDB = ПУО ## Возвращает величину амортизации актива для указанного или частичного периода при использовании метода сокращающегося баланса.
+XIRR = ЧИСТВНДОХ ## Возвращает внутреннюю ставку доходности для графика денежных потоков, которые не обязательно носят периодический характер.
+XNPV = ЧИСТНЗ ## Возвращает чистую приведенную стоимость для денежных потоков, которые не обязательно являются периодическими.
+YIELD = ДОХОД ## Возвращает доход от ценных бумаг, по которым производятся периодические выплаты процентов.
+YIELDDISC = ДОХОДСКИДКА ## Возвращает годовой доход по ценным бумагам, на которые сделана скидка (пример — казначейские чеки).
+YIELDMAT = ДОХОДПОГАШ ## Возвращает годовой доход от ценных бумаг, проценты по которым выплачиваются в срок погашения.
+
+
+##
+## Information functions Информационные функции
+##
+CELL = ЯЧЕЙКА ## Возвращает информацию о формате, расположении или содержимом ячейки.
+ERROR.TYPE = ТИП.ОШИБКИ ## Возвращает числовой код, соответствующий типу ошибки.
+INFO = ИНФОРМ ## Возвращает информацию о текущей операционной среде.
+ISBLANK = ЕПУСТО ## Возвращает значение ИСТИНА, если аргумент является ссылкой на пустую ячейку.
+ISERR = ЕОШ ## Возвращает значение ИСТИНА, если аргумент ссылается на любое значение ошибки, кроме #Н/Д.
+ISERROR = ЕОШИБКА ## Возвращает значение ИСТИНА, если аргумент ссылается на любое значение ошибки.
+ISEVEN = ЕЧЁТН ## Возвращает значение ИСТИНА, если значение аргумента является четным числом.
+ISLOGICAL = ЕЛОГИЧ ## Возвращает значение ИСТИНА, если аргумент ссылается на логическое значение.
+ISNA = ЕНД ## Возвращает значение ИСТИНА, если аргумент ссылается на значение ошибки #Н/Д.
+ISNONTEXT = ЕНЕТЕКСТ ## Возвращает значение ИСТИНА, если значение аргумента не является текстом.
+ISNUMBER = ЕЧИСЛО ## Возвращает значение ИСТИНА, если аргумент ссылается на число.
+ISODD = ЕНЕЧЁТ ## Возвращает значение ИСТИНА, если значение аргумента является нечетным числом.
+ISREF = ЕССЫЛКА ## Возвращает значение ИСТИНА, если значение аргумента является ссылкой.
+ISTEXT = ЕТЕКСТ ## Возвращает значение ИСТИНА, если значение аргумента является текстом.
+N = Ч ## Возвращает значение, преобразованное в число.
+NA = НД ## Возвращает значение ошибки #Н/Д.
+TYPE = ТИП ## Возвращает число, обозначающее тип данных значения.
+
+
+##
+## Logical functions Логические функции
+##
+AND = И ## Renvoie VRAI si tous ses arguments sont VRAI.
+FALSE = ЛОЖЬ ## Возвращает логическое значение ЛОЖЬ.
+IF = ЕСЛИ ## Выполняет проверку условия.
+IFERROR = ЕСЛИОШИБКА ## Возвращает введённое значение, если вычисление по формуле вызывает ошибку; в противном случае функция возвращает результат вычисления.
+NOT = НЕ ## Меняет логическое значение своего аргумента на противоположное.
+OR = ИЛИ ## Возвращает значение ИСТИНА, если хотя бы один аргумент имеет значение ИСТИНА.
+TRUE = ИСТИНА ## Возвращает логическое значение ИСТИНА.
+
+
+##
+## Lookup and reference functions Функции ссылки и поиска
+##
+ADDRESS = АДРЕС ## Возвращает ссылку на отдельную ячейку листа в виде текста.
+AREAS = ОБЛАСТИ ## Возвращает количество областей в ссылке.
+CHOOSE = ВЫБОР ## Выбирает значение из списка значений по индексу.
+COLUMN = СТОЛБЕЦ ## Возвращает номер столбца, на который указывает ссылка.
+COLUMNS = ЧИСЛСТОЛБ ## Возвращает количество столбцов в ссылке.
+HLOOKUP = ГПР ## Ищет в первой строке массива и возвращает значение отмеченной ячейки
+HYPERLINK = ГИПЕРССЫЛКА ## Создает ссылку, открывающую документ, который находится на сервере сети, в интрасети или в Интернете.
+INDEX = ИНДЕКС ## Использует индекс для выбора значения из ссылки или массива.
+INDIRECT = ДВССЫЛ ## Возвращает ссылку, заданную текстовым значением.
+LOOKUP = ПРОСМОТР ## Ищет значения в векторе или массиве.
+MATCH = ПОИСКПОЗ ## Ищет значения в ссылке или массиве.
+OFFSET = СМЕЩ ## Возвращает смещение ссылки относительно заданной ссылки.
+ROW = СТРОКА ## Возвращает номер строки, определяемой ссылкой.
+ROWS = ЧСТРОК ## Возвращает количество строк в ссылке.
+RTD = ДРВ ## Извлекает данные реального времени из программ, поддерживающих автоматизацию COM (Программирование объектов. Стандартное средство для работы с объектами некоторого приложения из другого приложения или средства разработки. Программирование объектов (ранее называемое программированием OLE) является функцией модели COM (Component Object Model, модель компонентных объектов).).
+TRANSPOSE = ТРАНСП ## Возвращает транспонированный массив.
+VLOOKUP = ВПР ## Ищет значение в первом столбце массива и возвращает значение из ячейки в найденной строке и указанном столбце.
+
+
+##
+## Math and trigonometry functions Математические и тригонометрические функции
+##
+ABS = ABS ## Возвращает модуль (абсолютную величину) числа.
+ACOS = ACOS ## Возвращает арккосинус числа.
+ACOSH = ACOSH ## Возвращает гиперболический арккосинус числа.
+ASIN = ASIN ## Возвращает арксинус числа.
+ASINH = ASINH ## Возвращает гиперболический арксинус числа.
+ATAN = ATAN ## Возвращает арктангенс числа.
+ATAN2 = ATAN2 ## Возвращает арктангенс для заданных координат x и y.
+ATANH = ATANH ## Возвращает гиперболический арктангенс числа.
+CEILING = ОКРВВЕРХ ## Округляет число до ближайшего целого или до ближайшего кратного указанному значению.
+COMBIN = ЧИСЛКОМБ ## Возвращает количество комбинаций для заданного числа объектов.
+COS = COS ## Возвращает косинус числа.
+COSH = COSH ## Возвращает гиперболический косинус числа.
+DEGREES = ГРАДУСЫ ## Преобразует радианы в градусы.
+EVEN = ЧЁТН ## Округляет число до ближайшего четного целого.
+EXP = EXP ## Возвращает число e, возведенное в указанную степень.
+FACT = ФАКТР ## Возвращает факториал числа.
+FACTDOUBLE = ДВФАКТР ## Возвращает двойной факториал числа.
+FLOOR = ОКРВНИЗ ## Округляет число до ближайшего меньшего по модулю значения.
+GCD = НОД ## Возвращает наибольший общий делитель.
+INT = ЦЕЛОЕ ## Округляет число до ближайшего меньшего целого.
+LCM = НОК ## Возвращает наименьшее общее кратное.
+LN = LN ## Возвращает натуральный логарифм числа.
+LOG = LOG ## Возвращает логарифм числа по заданному основанию.
+LOG10 = LOG10 ## Возвращает десятичный логарифм числа.
+MDETERM = МОПРЕД ## Возвращает определитель матрицы массива.
+MINVERSE = МОБР ## Возвращает обратную матрицу массива.
+MMULT = МУМНОЖ ## Возвращает произведение матриц двух массивов.
+MOD = ОСТАТ ## Возвращает остаток от деления.
+MROUND = ОКРУГЛТ ## Возвращает число, округленное с требуемой точностью.
+MULTINOMIAL = МУЛЬТИНОМ ## Возвращает мультиномиальный коэффициент множества чисел.
+ODD = НЕЧЁТ ## Округляет число до ближайшего нечетного целого.
+PI = ПИ ## Возвращает число пи.
+POWER = СТЕПЕНЬ ## Возвращает результат возведения числа в степень.
+PRODUCT = ПРОИЗВЕД ## Возвращает произведение аргументов.
+QUOTIENT = ЧАСТНОЕ ## Возвращает целую часть частного при делении.
+RADIANS = РАДИАНЫ ## Преобразует градусы в радианы.
+RAND = СЛЧИС ## Возвращает случайное число в интервале от 0 до 1.
+RANDBETWEEN = СЛУЧМЕЖДУ ## Возвращает случайное число в интервале между двумя заданными числами.
+ROMAN = РИМСКОЕ ## Преобразует арабские цифры в римские в виде текста.
+ROUND = ОКРУГЛ ## Округляет число до указанного количества десятичных разрядов.
+ROUNDDOWN = ОКРУГЛВНИЗ ## Округляет число до ближайшего меньшего по модулю значения.
+ROUNDUP = ОКРУГЛВВЕРХ ## Округляет число до ближайшего большего по модулю значения.
+SERIESSUM = РЯД.СУММ ## Возвращает сумму степенного ряда, вычисленную по формуле.
+SIGN = ЗНАК ## Возвращает знак числа.
+SIN = SIN ## Возвращает синус заданного угла.
+SINH = SINH ## Возвращает гиперболический синус числа.
+SQRT = КОРЕНЬ ## Возвращает положительное значение квадратного корня.
+SQRTPI = КОРЕНЬПИ ## Возвращает квадратный корень из значения выражения (число * ПИ).
+SUBTOTAL = ПРОМЕЖУТОЧНЫЕ.ИТОГИ ## Возвращает промежуточный итог в списке или базе данных.
+SUM = СУММ ## Суммирует аргументы.
+SUMIF = СУММЕСЛИ ## Суммирует ячейки, удовлетворяющие заданному условию.
+SUMIFS = СУММЕСЛИМН ## Суммирует диапазон ячеек, удовлетворяющих нескольким условиям.
+SUMPRODUCT = СУММПРОИЗВ ## Возвращает сумму произведений соответствующих элементов массивов.
+SUMSQ = СУММКВ ## Возвращает сумму квадратов аргументов.
+SUMX2MY2 = СУММРАЗНКВ ## Возвращает сумму разностей квадратов соответствующих значений в двух массивах.
+SUMX2PY2 = СУММСУММКВ ## Возвращает сумму сумм квадратов соответствующих элементов двух массивов.
+SUMXMY2 = СУММКВРАЗН ## Возвращает сумму квадратов разностей соответствующих значений в двух массивах.
+TAN = TAN ## Возвращает тангенс числа.
+TANH = TANH ## Возвращает гиперболический тангенс числа.
+TRUNC = ОТБР ## Отбрасывает дробную часть числа.
+
+
+##
+## Statistical functions Статистические функции
+##
+AVEDEV = СРОТКЛ ## Возвращает среднее арифметическое абсолютных значений отклонений точек данных от среднего.
+AVERAGE = СРЗНАЧ ## Возвращает среднее арифметическое аргументов.
+AVERAGEA = СРЗНАЧА ## Возвращает среднее арифметическое аргументов, включая числа, текст и логические значения.
+AVERAGEIF = СРЗНАЧЕСЛИ ## Возвращает среднее значение (среднее арифметическое) всех ячеек в диапазоне, которые удовлетворяют данному условию.
+AVERAGEIFS = СРЗНАЧЕСЛИМН ## Возвращает среднее значение (среднее арифметическое) всех ячеек, которые удовлетворяют нескольким условиям.
+BETADIST = БЕТАРАСП ## Возвращает интегральную функцию бета-распределения.
+BETAINV = БЕТАОБР ## Возвращает обратную интегральную функцию указанного бета-распределения.
+BINOMDIST = БИНОМРАСП ## Возвращает отдельное значение биномиального распределения.
+CHIDIST = ХИ2РАСП ## Возвращает одностороннюю вероятность распределения хи-квадрат.
+CHIINV = ХИ2ОБР ## Возвращает обратное значение односторонней вероятности распределения хи-квадрат.
+CHITEST = ХИ2ТЕСТ ## Возвращает тест на независимость.
+CONFIDENCE = ДОВЕРИТ ## Возвращает доверительный интервал для среднего значения по генеральной совокупности.
+CORREL = КОРРЕЛ ## Возвращает коэффициент корреляции между двумя множествами данных.
+COUNT = СЧЁТ ## Подсчитывает количество чисел в списке аргументов.
+COUNTA = СЧЁТЗ ## Подсчитывает количество значений в списке аргументов.
+COUNTBLANK = СЧИТАТЬПУСТОТЫ ## Подсчитывает количество пустых ячеек в диапазоне
+COUNTIF = СЧЁТЕСЛИ ## Подсчитывает количество ячеек в диапазоне, удовлетворяющих заданному условию
+COUNTIFS = СЧЁТЕСЛИМН ## Подсчитывает количество ячеек внутри диапазона, удовлетворяющих нескольким условиям.
+COVAR = КОВАР ## Возвращает ковариацию, среднее произведений парных отклонений
+CRITBINOM = КРИТБИНОМ ## Возвращает наименьшее значение, для которого интегральное биномиальное распределение меньше или равно заданному критерию.
+DEVSQ = КВАДРОТКЛ ## Возвращает сумму квадратов отклонений.
+EXPONDIST = ЭКСПРАСП ## Возвращает экспоненциальное распределение.
+FDIST = FРАСП ## Возвращает F-распределение вероятности.
+FINV = FРАСПОБР ## Возвращает обратное значение для F-распределения вероятности.
+FISHER = ФИШЕР ## Возвращает преобразование Фишера.
+FISHERINV = ФИШЕРОБР ## Возвращает обратное преобразование Фишера.
+FORECAST = ПРЕДСКАЗ ## Возвращает значение линейного тренда.
+FREQUENCY = ЧАСТОТА ## Возвращает распределение частот в виде вертикального массива.
+FTEST = ФТЕСТ ## Возвращает результат F-теста.
+GAMMADIST = ГАММАРАСП ## Возвращает гамма-распределение.
+GAMMAINV = ГАММАОБР ## Возвращает обратное гамма-распределение.
+GAMMALN = ГАММАНЛОГ ## Возвращает натуральный логарифм гамма функции, Γ(x).
+GEOMEAN = СРГЕОМ ## Возвращает среднее геометрическое.
+GROWTH = РОСТ ## Возвращает значения в соответствии с экспоненциальным трендом.
+HARMEAN = СРГАРМ ## Возвращает среднее гармоническое.
+HYPGEOMDIST = ГИПЕРГЕОМЕТ ## Возвращает гипергеометрическое распределение.
+INTERCEPT = ОТРЕЗОК ## Возвращает отрезок, отсекаемый на оси линией линейной регрессии.
+KURT = ЭКСЦЕСС ## Возвращает эксцесс множества данных.
+LARGE = НАИБОЛЬШИЙ ## Возвращает k-ое наибольшее значение в множестве данных.
+LINEST = ЛИНЕЙН ## Возвращает параметры линейного тренда.
+LOGEST = ЛГРФПРИБЛ ## Возвращает параметры экспоненциального тренда.
+LOGINV = ЛОГНОРМОБР ## Возвращает обратное логарифмическое нормальное распределение.
+LOGNORMDIST = ЛОГНОРМРАСП ## Возвращает интегральное логарифмическое нормальное распределение.
+MAX = МАКС ## Возвращает наибольшее значение в списке аргументов.
+MAXA = МАКСА ## Возвращает наибольшее значение в списке аргументов, включая числа, текст и логические значения.
+MEDIAN = МЕДИАНА ## Возвращает медиану заданных чисел.
+MIN = МИН ## Возвращает наименьшее значение в списке аргументов.
+MINA = МИНА ## Возвращает наименьшее значение в списке аргументов, включая числа, текст и логические значения.
+MODE = МОДА ## Возвращает значение моды множества данных.
+NEGBINOMDIST = ОТРБИНОМРАСП ## Возвращает отрицательное биномиальное распределение.
+NORMDIST = НОРМРАСП ## Возвращает нормальную функцию распределения.
+NORMINV = НОРМОБР ## Возвращает обратное нормальное распределение.
+NORMSDIST = НОРМСТРАСП ## Возвращает стандартное нормальное интегральное распределение.
+NORMSINV = НОРМСТОБР ## Возвращает обратное значение стандартного нормального распределения.
+PEARSON = ПИРСОН ## Возвращает коэффициент корреляции Пирсона.
+PERCENTILE = ПЕРСЕНТИЛЬ ## Возвращает k-ую персентиль для значений диапазона.
+PERCENTRANK = ПРОЦЕНТРАНГ ## Возвращает процентную норму значения в множестве данных.
+PERMUT = ПЕРЕСТ ## Возвращает количество перестановок для заданного числа объектов.
+POISSON = ПУАССОН ## Возвращает распределение Пуассона.
+PROB = ВЕРОЯТНОСТЬ ## Возвращает вероятность того, что значение из диапазона находится внутри заданных пределов.
+QUARTILE = КВАРТИЛЬ ## Возвращает квартиль множества данных.
+RANK = РАНГ ## Возвращает ранг числа в списке чисел.
+RSQ = КВПИРСОН ## Возвращает квадрат коэффициента корреляции Пирсона.
+SKEW = СКОС ## Возвращает асимметрию распределения.
+SLOPE = НАКЛОН ## Возвращает наклон линии линейной регрессии.
+SMALL = НАИМЕНЬШИЙ ## Возвращает k-ое наименьшее значение в множестве данных.
+STANDARDIZE = НОРМАЛИЗАЦИЯ ## Возвращает нормализованное значение.
+STDEV = СТАНДОТКЛОН ## Оценивает стандартное отклонение по выборке.
+STDEVA = СТАНДОТКЛОНА ## Оценивает стандартное отклонение по выборке, включая числа, текст и логические значения.
+STDEVP = СТАНДОТКЛОНП ## Вычисляет стандартное отклонение по генеральной совокупности.
+STDEVPA = СТАНДОТКЛОНПА ## Вычисляет стандартное отклонение по генеральной совокупности, включая числа, текст и логические значения.
+STEYX = СТОШYX ## Возвращает стандартную ошибку предсказанных значений y для каждого значения x в регрессии.
+TDIST = СТЬЮДРАСП ## Возвращает t-распределение Стьюдента.
+TINV = СТЬЮДРАСПОБР ## Возвращает обратное t-распределение Стьюдента.
+TREND = ТЕНДЕНЦИЯ ## Возвращает значения в соответствии с линейным трендом.
+TRIMMEAN = УРЕЗСРЕДНЕЕ ## Возвращает среднее внутренности множества данных.
+TTEST = ТТЕСТ ## Возвращает вероятность, соответствующую критерию Стьюдента.
+VAR = ДИСП ## Оценивает дисперсию по выборке.
+VARA = ДИСПА ## Оценивает дисперсию по выборке, включая числа, текст и логические значения.
+VARP = ДИСПР ## Вычисляет дисперсию для генеральной совокупности.
+VARPA = ДИСПРА ## Вычисляет дисперсию для генеральной совокупности, включая числа, текст и логические значения.
+WEIBULL = ВЕЙБУЛЛ ## Возвращает распределение Вейбулла.
+ZTEST = ZТЕСТ ## Возвращает двустороннее P-значение z-теста.
+
+
+##
+## Text functions Текстовые функции
+##
+ASC = ASC ## Для языков с двухбайтовыми наборами знаков (например, катакана) преобразует полноширинные (двухбайтовые) знаки в полуширинные (однобайтовые).
+BAHTTEXT = БАТТЕКСТ ## Преобразует число в текст, используя денежный формат ß (БАТ).
+CHAR = СИМВОЛ ## Возвращает знак с заданным кодом.
+CLEAN = ПЕЧСИМВ ## Удаляет все непечатаемые знаки из текста.
+CODE = КОДСИМВ ## Возвращает числовой код первого знака в текстовой строке.
+CONCATENATE = СЦЕПИТЬ ## Объединяет несколько текстовых элементов в один.
+DOLLAR = РУБЛЬ ## Преобразует число в текст, используя денежный формат.
+EXACT = СОВПАД ## Проверяет идентичность двух текстовых значений.
+FIND = НАЙТИ ## Ищет вхождения одного текстового значения в другом (с учетом регистра).
+FINDB = НАЙТИБ ## Ищет вхождения одного текстового значения в другом (с учетом регистра).
+FIXED = ФИКСИРОВАННЫЙ ## Форматирует число и преобразует его в текст с заданным числом десятичных знаков.
+JIS = JIS ## Для языков с двухбайтовыми наборами знаков (например, катакана) преобразует полуширинные (однобайтовые) знаки в текстовой строке в полноширинные (двухбайтовые).
+LEFT = ЛЕВСИМВ ## Возвращает крайние слева знаки текстового значения.
+LEFTB = ЛЕВБ ## Возвращает крайние слева знаки текстового значения.
+LEN = ДЛСТР ## Возвращает количество знаков в текстовой строке.
+LENB = ДЛИНБ ## Возвращает количество знаков в текстовой строке.
+LOWER = СТРОЧН ## Преобразует все буквы текста в строчные.
+MID = ПСТР ## Возвращает заданное число знаков из строки текста, начиная с указанной позиции.
+MIDB = ПСТРБ ## Возвращает заданное число знаков из строки текста, начиная с указанной позиции.
+PHONETIC = PHONETIC ## Извлекает фонетические (фуригана) знаки из текстовой строки.
+PROPER = ПРОПНАЧ ## Преобразует первую букву в каждом слове текста в прописную.
+REPLACE = ЗАМЕНИТЬ ## Заменяет знаки в тексте.
+REPLACEB = ЗАМЕНИТЬБ ## Заменяет знаки в тексте.
+REPT = ПОВТОР ## Повторяет текст заданное число раз.
+RIGHT = ПРАВСИМВ ## Возвращает крайние справа знаки текстовой строки.
+RIGHTB = ПРАВБ ## Возвращает крайние справа знаки текстовой строки.
+SEARCH = ПОИСК ## Ищет вхождения одного текстового значения в другом (без учета регистра).
+SEARCHB = ПОИСКБ ## Ищет вхождения одного текстового значения в другом (без учета регистра).
+SUBSTITUTE = ПОДСТАВИТЬ ## Заменяет в текстовой строке старый текст новым.
+T = Т ## Преобразует аргументы в текст.
+TEXT = ТЕКСТ ## Форматирует число и преобразует его в текст.
+TRIM = СЖПРОБЕЛЫ ## Удаляет из текста пробелы.
+UPPER = ПРОПИСН ## Преобразует все буквы текста в прописные.
+VALUE = ЗНАЧЕН ## Преобразует текстовый аргумент в число.
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/sv/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/sv/config
new file mode 100644
index 00000000000..bf72cc4f125
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/sv/config
@@ -0,0 +1,24 @@
+##
+## PhpSpreadsheet
+##
+
+ArgumentSeparator = ;
+
+
+##
+## (For future use)
+##
+currencySymbol = kr
+
+
+##
+## Excel Error Codes (For future use)
+
+##
+NULL = #Skärning!
+DIV0 = #Division/0!
+VALUE = #Värdefel!
+REF = #Referens!
+NAME = #Namn?
+NUM = #Ogiltigt!
+NA = #Saknas!
diff --git a/lib/phpexcel/PHPExcel/locale/sv/functions b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/sv/functions
similarity index 98%
rename from lib/phpexcel/PHPExcel/locale/sv/functions
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/sv/functions
index 9af37d8e401..73b2deb5eb2 100644
--- a/lib/phpexcel/PHPExcel/locale/sv/functions
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/sv/functions
@@ -1,408 +1,408 @@
-##
-## Add-in and Automation functions Tilläggs- och automatiseringsfunktioner
-##
-GETPIVOTDATA = HÄMTA.PIVOTDATA ## Returnerar data som lagrats i en pivottabellrapport
-
-
-##
-## Cube functions Kubfunktioner
-##
-CUBEKPIMEMBER = KUBKPIMEDLEM ## Returnerar namn, egenskap och mått för en KPI och visar namnet och egenskapen i cellen. En KPI, eller prestandaindikator, är ett kvantifierbart mått, t.ex. månatlig bruttovinst eller personalomsättning per kvartal, som används för att analysera ett företags resultat.
-CUBEMEMBER = KUBMEDLEM ## Returnerar en medlem eller ett par i en kubhierarki. Används för att verifiera att medlemmen eller paret finns i kuben.
-CUBEMEMBERPROPERTY = KUBMEDLEMSEGENSKAP ## Returnerar värdet för en medlemsegenskap i kuben. Används för att verifiera att ett medlemsnamn finns i kuben, samt för att returnera den angivna egenskapen för medlemmen.
-CUBERANKEDMEMBER = KUBRANGORDNADMEDLEM ## Returnerar den n:te, eller rangordnade, medlemmen i en uppsättning. Används för att returnera ett eller flera element i en uppsättning, till exempelvis den bästa försäljaren eller de tio bästa eleverna.
-CUBESET = KUBINSTÄLLNING ## Definierar en beräknad uppsättning medlemmar eller par genom att skicka ett bestämt uttryck till kuben på servern, som skapar uppsättningen och sedan returnerar den till Microsoft Office Excel.
-CUBESETCOUNT = KUBINSTÄLLNINGANTAL ## Returnerar antalet objekt i en uppsättning.
-CUBEVALUE = KUBVÄRDE ## Returnerar ett mängdvärde från en kub.
-
-
-##
-## Database functions Databasfunktioner
-##
-DAVERAGE = DMEDEL ## Returnerar medelvärdet av databasposterna
-DCOUNT = DANTAL ## Räknar antalet celler som innehåller tal i en databas
-DCOUNTA = DANTALV ## Räknar ifyllda celler i en databas
-DGET = DHÄMTA ## Hämtar en enstaka post från en databas som uppfyller de angivna villkoren
-DMAX = DMAX ## Returnerar det största värdet från databasposterna
-DMIN = DMIN ## Returnerar det minsta värdet från databasposterna
-DPRODUCT = DPRODUKT ## Multiplicerar värdena i ett visst fält i poster som uppfyller villkoret
-DSTDEV = DSTDAV ## Uppskattar standardavvikelsen baserat på ett urval av databasposterna
-DSTDEVP = DSTDAVP ## Beräknar standardavvikelsen utifrån hela populationen av valda databasposter
-DSUM = DSUMMA ## Summerar talen i kolumnfält i databasposter som uppfyller villkoret
-DVAR = DVARIANS ## Uppskattar variansen baserat på ett urval av databasposterna
-DVARP = DVARIANSP ## Beräknar variansen utifrån hela populationen av valda databasposter
-
-
-##
-## Date and time functions Tid- och datumfunktioner
-##
-DATE = DATUM ## Returnerar ett serienummer för ett visst datum
-DATEVALUE = DATUMVÄRDE ## Konverterar ett datum i textformat till ett serienummer
-DAY = DAG ## Konverterar ett serienummer till dag i månaden
-DAYS360 = DAGAR360 ## Beräknar antalet dagar mellan två datum baserat på ett 360-dagarsår
-EDATE = EDATUM ## Returnerar serienumret för ett datum som infaller ett visst antal månader före eller efter startdatumet
-EOMONTH = SLUTMÅNAD ## Returnerar serienumret för sista dagen i månaden ett visst antal månader tidigare eller senare
-HOUR = TIMME ## Konverterar ett serienummer till en timme
-MINUTE = MINUT ## Konverterar ett serienummer till en minut
-MONTH = MÅNAD ## Konverterar ett serienummer till en månad
-NETWORKDAYS = NETTOARBETSDAGAR ## Returnerar antalet hela arbetsdagar mellan två datum
-NOW = NU ## Returnerar serienumret för dagens datum och aktuell tid
-SECOND = SEKUND ## Konverterar ett serienummer till en sekund
-TIME = KLOCKSLAG ## Returnerar serienumret för en viss tid
-TIMEVALUE = TIDVÄRDE ## Konverterar en tid i textformat till ett serienummer
-TODAY = IDAG ## Returnerar serienumret för dagens datum
-WEEKDAY = VECKODAG ## Konverterar ett serienummer till en dag i veckan
-WEEKNUM = VECKONR ## Konverterar ett serienummer till ett veckonummer
-WORKDAY = ARBETSDAGAR ## Returnerar serienumret för ett datum ett visst antal arbetsdagar tidigare eller senare
-YEAR = ÅR ## Konverterar ett serienummer till ett år
-YEARFRAC = ÅRDEL ## Returnerar en del av ett år som representerar antalet hela dagar mellan start- och slutdatum
-
-
-##
-## Engineering functions Tekniska funktioner
-##
-BESSELI = BESSELI ## Returnerar den modifierade Bessel-funktionen In(x)
-BESSELJ = BESSELJ ## Returnerar Bessel-funktionen Jn(x)
-BESSELK = BESSELK ## Returnerar den modifierade Bessel-funktionen Kn(x)
-BESSELY = BESSELY ## Returnerar Bessel-funktionen Yn(x)
-BIN2DEC = BIN.TILL.DEC ## Omvandlar ett binärt tal till decimalt
-BIN2HEX = BIN.TILL.HEX ## Omvandlar ett binärt tal till hexadecimalt
-BIN2OCT = BIN.TILL.OKT ## Omvandlar ett binärt tal till oktalt
-COMPLEX = KOMPLEX ## Omvandlar reella och imaginära koefficienter till ett komplext tal
-CONVERT = KONVERTERA ## Omvandlar ett tal från ett måttsystem till ett annat
-DEC2BIN = DEC.TILL.BIN ## Omvandlar ett decimalt tal till binärt
-DEC2HEX = DEC.TILL.HEX ## Omvandlar ett decimalt tal till hexadecimalt
-DEC2OCT = DEC.TILL.OKT ## Omvandlar ett decimalt tal till oktalt
-DELTA = DELTA ## Testar om två värden är lika
-ERF = FELF ## Returnerar felfunktionen
-ERFC = FELFK ## Returnerar den komplementära felfunktionen
-GESTEP = SLSTEG ## Testar om ett tal är större än ett tröskelvärde
-HEX2BIN = HEX.TILL.BIN ## Omvandlar ett hexadecimalt tal till binärt
-HEX2DEC = HEX.TILL.DEC ## Omvandlar ett hexadecimalt tal till decimalt
-HEX2OCT = HEX.TILL.OKT ## Omvandlar ett hexadecimalt tal till oktalt
-IMABS = IMABS ## Returnerar absolutvärdet (modulus) för ett komplext tal
-IMAGINARY = IMAGINÄR ## Returnerar den imaginära koefficienten för ett komplext tal
-IMARGUMENT = IMARGUMENT ## Returnerar det komplexa talets argument, en vinkel uttryckt i radianer
-IMCONJUGATE = IMKONJUGAT ## Returnerar det komplexa talets konjugat
-IMCOS = IMCOS ## Returnerar cosinus för ett komplext tal
-IMDIV = IMDIV ## Returnerar kvoten för två komplexa tal
-IMEXP = IMEUPPHÖJT ## Returnerar exponenten för ett komplext tal
-IMLN = IMLN ## Returnerar den naturliga logaritmen för ett komplext tal
-IMLOG10 = IMLOG10 ## Returnerar 10-logaritmen för ett komplext tal
-IMLOG2 = IMLOG2 ## Returnerar 2-logaritmen för ett komplext tal
-IMPOWER = IMUPPHÖJT ## Returnerar ett komplext tal upphöjt till en exponent
-IMPRODUCT = IMPRODUKT ## Returnerar produkten av komplexa tal
-IMREAL = IMREAL ## Returnerar den reella koefficienten för ett komplext tal
-IMSIN = IMSIN ## Returnerar sinus för ett komplext tal
-IMSQRT = IMROT ## Returnerar kvadratroten av ett komplext tal
-IMSUB = IMDIFF ## Returnerar differensen mellan två komplexa tal
-IMSUM = IMSUM ## Returnerar summan av komplexa tal
-OCT2BIN = OKT.TILL.BIN ## Omvandlar ett oktalt tal till binärt
-OCT2DEC = OKT.TILL.DEC ## Omvandlar ett oktalt tal till decimalt
-OCT2HEX = OKT.TILL.HEX ## Omvandlar ett oktalt tal till hexadecimalt
-
-
-##
-## Financial functions Finansiella funktioner
-##
-ACCRINT = UPPLRÄNTA ## Returnerar den upplupna räntan för värdepapper med periodisk ränta
-ACCRINTM = UPPLOBLRÄNTA ## Returnerar den upplupna räntan för ett värdepapper som ger avkastning på förfallodagen
-AMORDEGRC = AMORDEGRC ## Returnerar avskrivningen för varje redovisningsperiod med hjälp av en avskrivningskoefficient
-AMORLINC = AMORLINC ## Returnerar avskrivningen för varje redovisningsperiod
-COUPDAYBS = KUPDAGBB ## Returnerar antal dagar från början av kupongperioden till likviddagen
-COUPDAYS = KUPDAGARS ## Returnerar antalet dagar i kupongperioden som innehåller betalningsdatumet
-COUPDAYSNC = KUPDAGNK ## Returnerar antalet dagar från betalningsdatumet till nästa kupongdatum
-COUPNCD = KUPNKD ## Returnerar nästa kupongdatum efter likviddagen
-COUPNUM = KUPANT ## Returnerar kuponger som förfaller till betalning mellan likviddagen och förfallodagen
-COUPPCD = KUPFKD ## Returnerar föregående kupongdatum före likviddagen
-CUMIPMT = KUMRÄNTA ## Returnerar den ackumulerade räntan som betalats mellan två perioder
-CUMPRINC = KUMPRIS ## Returnerar det ackumulerade kapitalbeloppet som betalats på ett lån mellan två perioder
-DB = DB ## Returnerar avskrivningen för en tillgång under en angiven tid enligt metoden för fast degressiv avskrivning
-DDB = DEGAVSKR ## Returnerar en tillgångs värdeminskning under en viss period med hjälp av dubbel degressiv avskrivning eller någon annan metod som du anger
-DISC = DISK ## Returnerar diskonteringsräntan för ett värdepapper
-DOLLARDE = DECTAL ## Omvandlar ett pris uttryckt som ett bråk till ett decimaltal
-DOLLARFR = BRÅK ## Omvandlar ett pris i kronor uttryckt som ett decimaltal till ett bråk
-DURATION = LÖPTID ## Returnerar den årliga löptiden för en säkerhet med periodiska räntebetalningar
-EFFECT = EFFRÄNTA ## Returnerar den årliga effektiva räntesatsen
-FV = SLUTVÄRDE ## Returnerar det framtida värdet på en investering
-FVSCHEDULE = FÖRRÄNTNING ## Returnerar det framtida värdet av ett begynnelsekapital beräknat på olika räntenivåer
-INTRATE = ÅRSRÄNTA ## Returnerar räntesatsen för ett betalt värdepapper
-IPMT = RBETALNING ## Returnerar räntedelen av en betalning för en given period
-IRR = IR ## Returnerar internräntan för en serie betalningar
-ISPMT = RALÅN ## Beräknar räntan som har betalats under en specifik betalningsperiod
-MDURATION = MLÖPTID ## Returnerar den modifierade Macauley-löptiden för ett värdepapper med det antagna nominella värdet 100 kr
-MIRR = MODIR ## Returnerar internräntan där positiva och negativa betalningar finansieras med olika räntor
-NOMINAL = NOMRÄNTA ## Returnerar den årliga nominella räntesatsen
-NPER = PERIODER ## Returnerar antalet perioder för en investering
-NPV = NETNUVÄRDE ## Returnerar nuvärdet av en serie periodiska betalningar vid en given diskonteringsränta
-ODDFPRICE = UDDAFPRIS ## Returnerar priset per 100 kr nominellt värde för ett värdepapper med en udda första period
-ODDFYIELD = UDDAFAVKASTNING ## Returnerar avkastningen för en säkerhet med en udda första period
-ODDLPRICE = UDDASPRIS ## Returnerar priset per 100 kr nominellt värde för ett värdepapper med en udda sista period
-ODDLYIELD = UDDASAVKASTNING ## Returnerar avkastningen för en säkerhet med en udda sista period
-PMT = BETALNING ## Returnerar den periodiska betalningen för en annuitet
-PPMT = AMORT ## Returnerar amorteringsdelen av en annuitetsbetalning för en given period
-PRICE = PRIS ## Returnerar priset per 100 kr nominellt värde för ett värdepapper som ger periodisk ränta
-PRICEDISC = PRISDISK ## Returnerar priset per 100 kr nominellt värde för ett diskonterat värdepapper
-PRICEMAT = PRISFÖRF ## Returnerar priset per 100 kr nominellt värde för ett värdepapper som ger ränta på förfallodagen
-PV = PV ## Returnerar nuvärdet av en serie lika stora periodiska betalningar
-RATE = RÄNTA ## Returnerar räntesatsen per period i en annuitet
-RECEIVED = BELOPP ## Returnerar beloppet som utdelas på förfallodagen för ett betalat värdepapper
-SLN = LINAVSKR ## Returnerar den linjära avskrivningen för en tillgång under en period
-SYD = ÅRSAVSKR ## Returnerar den årliga avskrivningssumman för en tillgång under en angiven period
-TBILLEQ = SSVXEKV ## Returnerar avkastningen motsvarande en obligation för en statsskuldväxel
-TBILLPRICE = SSVXPRIS ## Returnerar priset per 100 kr nominellt värde för en statsskuldväxel
-TBILLYIELD = SSVXRÄNTA ## Returnerar avkastningen för en statsskuldväxel
-VDB = VDEGRAVSKR ## Returnerar avskrivningen för en tillgång under en angiven period (med degressiv avskrivning)
-XIRR = XIRR ## Returnerar internräntan för en serie betalningar som inte nödvändigtvis är periodiska
-XNPV = XNUVÄRDE ## Returnerar det nuvarande nettovärdet för en serie betalningar som inte nödvändigtvis är periodiska
-YIELD = NOMAVK ## Returnerar avkastningen för ett värdepapper som ger periodisk ränta
-YIELDDISC = NOMAVKDISK ## Returnerar den årliga avkastningen för diskonterade värdepapper, exempelvis en statsskuldväxel
-YIELDMAT = NOMAVKFÖRF ## Returnerar den årliga avkastningen för ett värdepapper som ger ränta på förfallodagen
-
-
-##
-## Information functions Informationsfunktioner
-##
-CELL = CELL ## Returnerar information om formatering, plats och innehåll i en cell
-ERROR.TYPE = FEL.TYP ## Returnerar ett tal som motsvarar ett felvärde
-INFO = INFO ## Returnerar information om operativsystemet
-ISBLANK = ÄRREF ## Returnerar SANT om värdet är tomt
-ISERR = Ä ## Returnerar SANT om värdet är ett felvärde annat än #SAKNAS!
-ISERROR = ÄRFEL ## Returnerar SANT om värdet är ett felvärde
-ISEVEN = ÄRJÄMN ## Returnerar SANT om talet är jämnt
-ISLOGICAL = ÄREJTEXT ## Returnerar SANT om värdet är ett logiskt värde
-ISNA = ÄRLOGISK ## Returnerar SANT om värdet är felvärdet #SAKNAS!
-ISNONTEXT = ÄRSAKNAD ## Returnerar SANT om värdet inte är text
-ISNUMBER = ÄRTAL ## Returnerar SANT om värdet är ett tal
-ISODD = ÄRUDDA ## Returnerar SANT om talet är udda
-ISREF = ÄRTOM ## Returnerar SANT om värdet är en referens
-ISTEXT = ÄRTEXT ## Returnerar SANT om värdet är text
-N = N ## Returnerar ett värde omvandlat till ett tal
-NA = SAKNAS ## Returnerar felvärdet #SAKNAS!
-TYPE = VÄRDETYP ## Returnerar ett tal som anger värdets datatyp
-
-
-##
-## Logical functions Logiska funktioner
-##
-AND = OCH ## Returnerar SANT om alla argument är sanna
-FALSE = FALSKT ## Returnerar det logiska värdet FALSKT
-IF = OM ## Anger vilket logiskt test som ska utföras
-IFERROR = OMFEL ## Returnerar ett värde som du anger om en formel utvärderar till ett fel; annars returneras resultatet av formeln
-NOT = ICKE ## Inverterar logiken för argumenten
-OR = ELLER ## Returnerar SANT om något argument är SANT
-TRUE = SANT ## Returnerar det logiska värdet SANT
-
-
-##
-## Lookup and reference functions Sök- och referensfunktioner
-##
-ADDRESS = ADRESS ## Returnerar en referens som text till en enstaka cell i ett kalkylblad
-AREAS = OMRÅDEN ## Returnerar antalet områden i en referens
-CHOOSE = VÄLJ ## Väljer ett värde i en lista över värden
-COLUMN = KOLUMN ## Returnerar kolumnnumret för en referens
-COLUMNS = KOLUMNER ## Returnerar antalet kolumner i en referens
-HLOOKUP = LETAKOLUMN ## Söker i den översta raden i en matris och returnerar värdet för angiven cell
-HYPERLINK = HYPERLÄNK ## Skapar en genväg eller ett hopp till ett dokument i nätverket, i ett intranät eller på Internet
-INDEX = INDEX ## Använder ett index för ett välja ett värde i en referens eller matris
-INDIRECT = INDIREKT ## Returnerar en referens som anges av ett textvärde
-LOOKUP = LETAUPP ## Letar upp värden i en vektor eller matris
-MATCH = PASSA ## Letar upp värden i en referens eller matris
-OFFSET = FÖRSKJUTNING ## Returnerar en referens förskjuten i förhållande till en given referens
-ROW = RAD ## Returnerar radnumret för en referens
-ROWS = RADER ## Returnerar antalet rader i en referens
-RTD = RTD ## Hämtar realtidsdata från ett program som stöder COM-automation (Automation: Ett sätt att arbeta med ett programs objekt från ett annat program eller utvecklingsverktyg. Detta kallades tidigare för OLE Automation, och är en branschstandard och ingår i Component Object Model (COM).)
-TRANSPOSE = TRANSPONERA ## Transponerar en matris
-VLOOKUP = LETARAD ## Letar i den första kolumnen i en matris och flyttar över raden för att returnera värdet för en cell
-
-
-##
-## Math and trigonometry functions Matematiska och trigonometriska funktioner
-##
-ABS = ABS ## Returnerar absolutvärdet av ett tal
-ACOS = ARCCOS ## Returnerar arcus cosinus för ett tal
-ACOSH = ARCCOSH ## Returnerar inverterad hyperbolisk cosinus för ett tal
-ASIN = ARCSIN ## Returnerar arcus cosinus för ett tal
-ASINH = ARCSINH ## Returnerar hyperbolisk arcus sinus för ett tal
-ATAN = ARCTAN ## Returnerar arcus tangens för ett tal
-ATAN2 = ARCTAN2 ## Returnerar arcus tangens för en x- och en y- koordinat
-ATANH = ARCTANH ## Returnerar hyperbolisk arcus tangens för ett tal
-CEILING = RUNDA.UPP ## Avrundar ett tal till närmaste heltal eller närmaste signifikanta multipel
-COMBIN = KOMBIN ## Returnerar antalet kombinationer för ett givet antal objekt
-COS = COS ## Returnerar cosinus för ett tal
-COSH = COSH ## Returnerar hyperboliskt cosinus för ett tal
-DEGREES = GRADER ## Omvandlar radianer till grader
-EVEN = JÄMN ## Avrundar ett tal uppåt till närmaste heltal
-EXP = EXP ## Returnerar e upphöjt till ett givet tal
-FACT = FAKULTET ## Returnerar fakulteten för ett tal
-FACTDOUBLE = DUBBELFAKULTET ## Returnerar dubbelfakulteten för ett tal
-FLOOR = RUNDA.NED ## Avrundar ett tal nedåt mot noll
-GCD = SGD ## Returnerar den största gemensamma nämnaren
-INT = HELTAL ## Avrundar ett tal nedåt till närmaste heltal
-LCM = MGM ## Returnerar den minsta gemensamma multipeln
-LN = LN ## Returnerar den naturliga logaritmen för ett tal
-LOG = LOG ## Returnerar logaritmen för ett tal för en given bas
-LOG10 = LOG10 ## Returnerar 10-logaritmen för ett tal
-MDETERM = MDETERM ## Returnerar matrisen som är avgörandet av en matris
-MINVERSE = MINVERT ## Returnerar matrisinversen av en matris
-MMULT = MMULT ## Returnerar matrisprodukten av två matriser
-MOD = REST ## Returnerar resten vid en division
-MROUND = MAVRUNDA ## Returnerar ett tal avrundat till en given multipel
-MULTINOMIAL = MULTINOMIAL ## Returnerar multinomialen för en uppsättning tal
-ODD = UDDA ## Avrundar ett tal uppåt till närmaste udda heltal
-PI = PI ## Returnerar värdet pi
-POWER = UPPHÖJT.TILL ## Returnerar resultatet av ett tal upphöjt till en exponent
-PRODUCT = PRODUKT ## Multiplicerar argumenten
-QUOTIENT = KVOT ## Returnerar heltalsdelen av en division
-RADIANS = RADIANER ## Omvandlar grader till radianer
-RAND = SLUMP ## Returnerar ett slumptal mellan 0 och 1
-RANDBETWEEN = SLUMP.MELLAN ## Returnerar ett slumptal mellan de tal som du anger
-ROMAN = ROMERSK ## Omvandlar vanliga (arabiska) siffror till romerska som text
-ROUND = AVRUNDA ## Avrundar ett tal till ett angivet antal siffror
-ROUNDDOWN = AVRUNDA.NEDÅT ## Avrundar ett tal nedåt mot noll
-ROUNDUP = AVRUNDA.UPPÅT ## Avrundar ett tal uppåt, från noll
-SERIESSUM = SERIESUMMA ## Returnerar summan av en potensserie baserat på formeln
-SIGN = TECKEN ## Returnerar tecknet för ett tal
-SIN = SIN ## Returnerar sinus för en given vinkel
-SINH = SINH ## Returnerar hyperbolisk sinus för ett tal
-SQRT = ROT ## Returnerar den positiva kvadratroten
-SQRTPI = ROTPI ## Returnerar kvadratroten för (tal * pi)
-SUBTOTAL = DELSUMMA ## Returnerar en delsumma i en lista eller databas
-SUM = SUMMA ## Summerar argumenten
-SUMIF = SUMMA.OM ## Summerar celler enligt ett angivet villkor
-SUMIFS = SUMMA.OMF ## Lägger till cellerna i ett område som uppfyller flera kriterier
-SUMPRODUCT = PRODUKTSUMMA ## Returnerar summan av produkterna i motsvarande matriskomponenter
-SUMSQ = KVADRATSUMMA ## Returnerar summan av argumentens kvadrater
-SUMX2MY2 = SUMMAX2MY2 ## Returnerar summan av differensen mellan kvadraterna för motsvarande värden i två matriser
-SUMX2PY2 = SUMMAX2PY2 ## Returnerar summan av summan av kvadraterna av motsvarande värden i två matriser
-SUMXMY2 = SUMMAXMY2 ## Returnerar summan av kvadraten av skillnaden mellan motsvarande värden i två matriser
-TAN = TAN ## Returnerar tangens för ett tal
-TANH = TANH ## Returnerar hyperbolisk tangens för ett tal
-TRUNC = AVKORTA ## Avkortar ett tal till ett heltal
-
-
-##
-## Statistical functions Statistiska funktioner
-##
-AVEDEV = MEDELAVV ## Returnerar medelvärdet för datapunkters absoluta avvikelse från deras medelvärde
-AVERAGE = MEDEL ## Returnerar medelvärdet av argumenten
-AVERAGEA = AVERAGEA ## Returnerar medelvärdet av argumenten, inklusive tal, text och logiska värden
-AVERAGEIF = MEDELOM ## Returnerar medelvärdet (aritmetiskt medelvärde) för alla celler i ett område som uppfyller ett givet kriterium
-AVERAGEIFS = MEDELOMF ## Returnerar medelvärdet (det aritmetiska medelvärdet) för alla celler som uppfyller flera villkor.
-BETADIST = BETAFÖRD ## Returnerar den kumulativa betafördelningsfunktionen
-BETAINV = BETAINV ## Returnerar inversen till den kumulativa fördelningsfunktionen för en viss betafördelning
-BINOMDIST = BINOMFÖRD ## Returnerar den individuella binomialfördelningen
-CHIDIST = CHI2FÖRD ## Returnerar den ensidiga sannolikheten av c2-fördelningen
-CHIINV = CHI2INV ## Returnerar inversen av chi2-fördelningen
-CHITEST = CHI2TEST ## Returnerar oberoendetesten
-CONFIDENCE = KONFIDENS ## Returnerar konfidensintervallet för en populations medelvärde
-CORREL = KORREL ## Returnerar korrelationskoefficienten mellan två datamängder
-COUNT = ANTAL ## Räknar hur många tal som finns bland argumenten
-COUNTA = ANTALV ## Räknar hur många värden som finns bland argumenten
-COUNTBLANK = ANTAL.TOMMA ## Räknar antalet tomma celler i ett område
-COUNTIF = ANTAL.OM ## Räknar antalet celler i ett område som uppfyller angivna villkor.
-COUNTIFS = ANTAL.OMF ## Räknar antalet celler i ett område som uppfyller flera villkor.
-COVAR = KOVAR ## Returnerar kovariansen, d.v.s. medelvärdet av produkterna för parade avvikelser
-CRITBINOM = KRITBINOM ## Returnerar det minsta värdet för vilket den kumulativa binomialfördelningen är mindre än eller lika med ett villkorsvärde
-DEVSQ = KVADAVV ## Returnerar summan av kvadrater på avvikelser
-EXPONDIST = EXPONFÖRD ## Returnerar exponentialfördelningen
-FDIST = FFÖRD ## Returnerar F-sannolikhetsfördelningen
-FINV = FINV ## Returnerar inversen till F-sannolikhetsfördelningen
-FISHER = FISHER ## Returnerar Fisher-transformationen
-FISHERINV = FISHERINV ## Returnerar inversen till Fisher-transformationen
-FORECAST = PREDIKTION ## Returnerar ett värde längs en linjär trendlinje
-FREQUENCY = FREKVENS ## Returnerar en frekvensfördelning som en lodrät matris
-FTEST = FTEST ## Returnerar resultatet av en F-test
-GAMMADIST = GAMMAFÖRD ## Returnerar gammafördelningen
-GAMMAINV = GAMMAINV ## Returnerar inversen till den kumulativa gammafördelningen
-GAMMALN = GAMMALN ## Returnerar den naturliga logaritmen för gammafunktionen, G(x)
-GEOMEAN = GEOMEDEL ## Returnerar det geometriska medelvärdet
-GROWTH = EXPTREND ## Returnerar värden längs en exponentiell trend
-HARMEAN = HARMMEDEL ## Returnerar det harmoniska medelvärdet
-HYPGEOMDIST = HYPGEOMFÖRD ## Returnerar den hypergeometriska fördelningen
-INTERCEPT = SKÄRNINGSPUNKT ## Returnerar skärningspunkten för en linjär regressionslinje
-KURT = TOPPIGHET ## Returnerar toppigheten av en mängd data
-LARGE = STÖRSTA ## Returnerar det n:te största värdet i en mängd data
-LINEST = REGR ## Returnerar parametrar till en linjär trendlinje
-LOGEST = EXPREGR ## Returnerar parametrarna i en exponentiell trend
-LOGINV = LOGINV ## Returnerar inversen till den lognormala fördelningen
-LOGNORMDIST = LOGNORMFÖRD ## Returnerar den kumulativa lognormala fördelningen
-MAX = MAX ## Returnerar det största värdet i en lista av argument
-MAXA = MAXA ## Returnerar det största värdet i en lista av argument, inklusive tal, text och logiska värden
-MEDIAN = MEDIAN ## Returnerar medianen för angivna tal
-MIN = MIN ## Returnerar det minsta värdet i en lista med argument
-MINA = MINA ## Returnerar det minsta värdet i en lista över argument, inklusive tal, text och logiska värden
-MODE = TYPVÄRDE ## Returnerar det vanligaste värdet i en datamängd
-NEGBINOMDIST = NEGBINOMFÖRD ## Returnerar den negativa binomialfördelningen
-NORMDIST = NORMFÖRD ## Returnerar den kumulativa normalfördelningen
-NORMINV = NORMINV ## Returnerar inversen till den kumulativa normalfördelningen
-NORMSDIST = NORMSFÖRD ## Returnerar den kumulativa standardnormalfördelningen
-NORMSINV = NORMSINV ## Returnerar inversen till den kumulativa standardnormalfördelningen
-PEARSON = PEARSON ## Returnerar korrelationskoefficienten till Pearsons momentprodukt
-PERCENTILE = PERCENTIL ## Returnerar den n:te percentilen av värden i ett område
-PERCENTRANK = PROCENTRANG ## Returnerar procentrangen för ett värde i en datamängd
-PERMUT = PERMUT ## Returnerar antal permutationer för ett givet antal objekt
-POISSON = POISSON ## Returnerar Poisson-fördelningen
-PROB = SANNOLIKHET ## Returnerar sannolikheten att värden i ett område ligger mellan två gränser
-QUARTILE = KVARTIL ## Returnerar kvartilen av en mängd data
-RANK = RANG ## Returnerar rangordningen för ett tal i en lista med tal
-RSQ = RKV ## Returnerar kvadraten av Pearsons produktmomentkorrelationskoefficient
-SKEW = SNEDHET ## Returnerar snedheten för en fördelning
-SLOPE = LUTNING ## Returnerar lutningen på en linjär regressionslinje
-SMALL = MINSTA ## Returnerar det n:te minsta värdet i en mängd data
-STANDARDIZE = STANDARDISERA ## Returnerar ett normaliserat värde
-STDEV = STDAV ## Uppskattar standardavvikelsen baserat på ett urval
-STDEVA = STDEVA ## Uppskattar standardavvikelsen baserat på ett urval, inklusive tal, text och logiska värden
-STDEVP = STDAVP ## Beräknar standardavvikelsen baserat på hela populationen
-STDEVPA = STDEVPA ## Beräknar standardavvikelsen baserat på hela populationen, inklusive tal, text och logiska värden
-STEYX = STDFELYX ## Returnerar standardfelet för ett förutspått y-värde för varje x-värde i regressionen
-TDIST = TFÖRD ## Returnerar Students t-fördelning
-TINV = TINV ## Returnerar inversen till Students t-fördelning
-TREND = TREND ## Returnerar värden längs en linjär trend
-TRIMMEAN = TRIMMEDEL ## Returnerar medelvärdet av mittpunkterna i en datamängd
-TTEST = TTEST ## Returnerar sannolikheten beräknad ur Students t-test
-VAR = VARIANS ## Uppskattar variansen baserat på ett urval
-VARA = VARA ## Uppskattar variansen baserat på ett urval, inklusive tal, text och logiska värden
-VARP = VARIANSP ## Beräknar variansen baserat på hela populationen
-VARPA = VARPA ## Beräknar variansen baserat på hela populationen, inklusive tal, text och logiska värden
-WEIBULL = WEIBULL ## Returnerar Weibull-fördelningen
-ZTEST = ZTEST ## Returnerar det ensidiga sannolikhetsvärdet av ett z-test
-
-
-##
-## Text functions Textfunktioner
-##
-ASC = ASC ## Ändrar helbredds (dubbel byte) engelska bokstäver eller katakana inom en teckensträng till tecken med halvt breddsteg (enkel byte)
-BAHTTEXT = BAHTTEXT ## Omvandlar ett tal till text med valutaformatet ß (baht)
-CHAR = TECKENKOD ## Returnerar tecknet som anges av kod
-CLEAN = STÄDA ## Tar bort alla icke utskrivbara tecken i en text
-CODE = KOD ## Returnerar en numerisk kod för det första tecknet i en textsträng
-CONCATENATE = SAMMANFOGA ## Sammanfogar flera textdelar till en textsträng
-DOLLAR = VALUTA ## Omvandlar ett tal till text med valutaformat
-EXACT = EXAKT ## Kontrollerar om två textvärden är identiska
-FIND = HITTA ## Hittar en text i en annan (skiljer på gemener och versaler)
-FINDB = HITTAB ## Hittar en text i en annan (skiljer på gemener och versaler)
-FIXED = FASTTAL ## Formaterar ett tal som text med ett fast antal decimaler
-JIS = JIS ## Ändrar halvbredds (enkel byte) engelska bokstäver eller katakana inom en teckensträng till tecken med helt breddsteg (dubbel byte)
-LEFT = VÄNSTER ## Returnerar tecken längst till vänster i en sträng
-LEFTB = VÄNSTERB ## Returnerar tecken längst till vänster i en sträng
-LEN = LÄNGD ## Returnerar antalet tecken i en textsträng
-LENB = LÄNGDB ## Returnerar antalet tecken i en textsträng
-LOWER = GEMENER ## Omvandlar text till gemener
-MID = EXTEXT ## Returnerar angivet antal tecken från en text med början vid den position som du anger
-MIDB = EXTEXTB ## Returnerar angivet antal tecken från en text med början vid den position som du anger
-PHONETIC = PHONETIC ## Returnerar de fonetiska (furigana) tecknen i en textsträng
-PROPER = INITIAL ## Ändrar första bokstaven i varje ord i ett textvärde till versal
-REPLACE = ERSÄTT ## Ersätter tecken i text
-REPLACEB = ERSÄTTB ## Ersätter tecken i text
-REPT = REP ## Upprepar en text ett bestämt antal gånger
-RIGHT = HÖGER ## Returnerar tecken längst till höger i en sträng
-RIGHTB = HÖGERB ## Returnerar tecken längst till höger i en sträng
-SEARCH = SÖK ## Hittar ett textvärde i ett annat (skiljer inte på gemener och versaler)
-SEARCHB = SÖKB ## Hittar ett textvärde i ett annat (skiljer inte på gemener och versaler)
-SUBSTITUTE = BYT.UT ## Ersätter gammal text med ny text i en textsträng
-T = T ## Omvandlar argumenten till text
-TEXT = TEXT ## Formaterar ett tal och omvandlar det till text
-TRIM = RENSA ## Tar bort blanksteg från text
-UPPER = VERSALER ## Omvandlar text till versaler
-VALUE = TEXTNUM ## Omvandlar ett textargument till ett tal
+##
+## Add-in and Automation functions Tilläggs- och automatiseringsfunktioner
+##
+GETPIVOTDATA = HÄMTA.PIVOTDATA ## Returnerar data som lagrats i en pivottabellrapport
+
+
+##
+## Cube functions Kubfunktioner
+##
+CUBEKPIMEMBER = KUBKPIMEDLEM ## Returnerar namn, egenskap och mått för en KPI och visar namnet och egenskapen i cellen. En KPI, eller prestandaindikator, är ett kvantifierbart mått, t.ex. månatlig bruttovinst eller personalomsättning per kvartal, som används för att analysera ett företags resultat.
+CUBEMEMBER = KUBMEDLEM ## Returnerar en medlem eller ett par i en kubhierarki. Används för att verifiera att medlemmen eller paret finns i kuben.
+CUBEMEMBERPROPERTY = KUBMEDLEMSEGENSKAP ## Returnerar värdet för en medlemsegenskap i kuben. Används för att verifiera att ett medlemsnamn finns i kuben, samt för att returnera den angivna egenskapen för medlemmen.
+CUBERANKEDMEMBER = KUBRANGORDNADMEDLEM ## Returnerar den n:te, eller rangordnade, medlemmen i en uppsättning. Används för att returnera ett eller flera element i en uppsättning, till exempelvis den bästa försäljaren eller de tio bästa eleverna.
+CUBESET = KUBINSTÄLLNING ## Definierar en beräknad uppsättning medlemmar eller par genom att skicka ett bestämt uttryck till kuben på servern, som skapar uppsättningen och sedan returnerar den till Microsoft Office Excel.
+CUBESETCOUNT = KUBINSTÄLLNINGANTAL ## Returnerar antalet objekt i en uppsättning.
+CUBEVALUE = KUBVÄRDE ## Returnerar ett mängdvärde från en kub.
+
+
+##
+## Database functions Databasfunktioner
+##
+DAVERAGE = DMEDEL ## Returnerar medelvärdet av databasposterna
+DCOUNT = DANTAL ## Räknar antalet celler som innehåller tal i en databas
+DCOUNTA = DANTALV ## Räknar ifyllda celler i en databas
+DGET = DHÄMTA ## Hämtar en enstaka post från en databas som uppfyller de angivna villkoren
+DMAX = DMAX ## Returnerar det största värdet från databasposterna
+DMIN = DMIN ## Returnerar det minsta värdet från databasposterna
+DPRODUCT = DPRODUKT ## Multiplicerar värdena i ett visst fält i poster som uppfyller villkoret
+DSTDEV = DSTDAV ## Uppskattar standardavvikelsen baserat på ett urval av databasposterna
+DSTDEVP = DSTDAVP ## Beräknar standardavvikelsen utifrån hela populationen av valda databasposter
+DSUM = DSUMMA ## Summerar talen i kolumnfält i databasposter som uppfyller villkoret
+DVAR = DVARIANS ## Uppskattar variansen baserat på ett urval av databasposterna
+DVARP = DVARIANSP ## Beräknar variansen utifrån hela populationen av valda databasposter
+
+
+##
+## Date and time functions Tid- och datumfunktioner
+##
+DATE = DATUM ## Returnerar ett serienummer för ett visst datum
+DATEVALUE = DATUMVÄRDE ## Konverterar ett datum i textformat till ett serienummer
+DAY = DAG ## Konverterar ett serienummer till dag i månaden
+DAYS360 = DAGAR360 ## Beräknar antalet dagar mellan två datum baserat på ett 360-dagarsår
+EDATE = EDATUM ## Returnerar serienumret för ett datum som infaller ett visst antal månader före eller efter startdatumet
+EOMONTH = SLUTMÅNAD ## Returnerar serienumret för sista dagen i månaden ett visst antal månader tidigare eller senare
+HOUR = TIMME ## Konverterar ett serienummer till en timme
+MINUTE = MINUT ## Konverterar ett serienummer till en minut
+MONTH = MÅNAD ## Konverterar ett serienummer till en månad
+NETWORKDAYS = NETTOARBETSDAGAR ## Returnerar antalet hela arbetsdagar mellan två datum
+NOW = NU ## Returnerar serienumret för dagens datum och aktuell tid
+SECOND = SEKUND ## Konverterar ett serienummer till en sekund
+TIME = KLOCKSLAG ## Returnerar serienumret för en viss tid
+TIMEVALUE = TIDVÄRDE ## Konverterar en tid i textformat till ett serienummer
+TODAY = IDAG ## Returnerar serienumret för dagens datum
+WEEKDAY = VECKODAG ## Konverterar ett serienummer till en dag i veckan
+WEEKNUM = VECKONR ## Konverterar ett serienummer till ett veckonummer
+WORKDAY = ARBETSDAGAR ## Returnerar serienumret för ett datum ett visst antal arbetsdagar tidigare eller senare
+YEAR = ÅR ## Konverterar ett serienummer till ett år
+YEARFRAC = ÅRDEL ## Returnerar en del av ett år som representerar antalet hela dagar mellan start- och slutdatum
+
+
+##
+## Engineering functions Tekniska funktioner
+##
+BESSELI = BESSELI ## Returnerar den modifierade Bessel-funktionen In(x)
+BESSELJ = BESSELJ ## Returnerar Bessel-funktionen Jn(x)
+BESSELK = BESSELK ## Returnerar den modifierade Bessel-funktionen Kn(x)
+BESSELY = BESSELY ## Returnerar Bessel-funktionen Yn(x)
+BIN2DEC = BIN.TILL.DEC ## Omvandlar ett binärt tal till decimalt
+BIN2HEX = BIN.TILL.HEX ## Omvandlar ett binärt tal till hexadecimalt
+BIN2OCT = BIN.TILL.OKT ## Omvandlar ett binärt tal till oktalt
+COMPLEX = KOMPLEX ## Omvandlar reella och imaginära koefficienter till ett komplext tal
+CONVERT = KONVERTERA ## Omvandlar ett tal från ett måttsystem till ett annat
+DEC2BIN = DEC.TILL.BIN ## Omvandlar ett decimalt tal till binärt
+DEC2HEX = DEC.TILL.HEX ## Omvandlar ett decimalt tal till hexadecimalt
+DEC2OCT = DEC.TILL.OKT ## Omvandlar ett decimalt tal till oktalt
+DELTA = DELTA ## Testar om två värden är lika
+ERF = FELF ## Returnerar felfunktionen
+ERFC = FELFK ## Returnerar den komplementära felfunktionen
+GESTEP = SLSTEG ## Testar om ett tal är större än ett tröskelvärde
+HEX2BIN = HEX.TILL.BIN ## Omvandlar ett hexadecimalt tal till binärt
+HEX2DEC = HEX.TILL.DEC ## Omvandlar ett hexadecimalt tal till decimalt
+HEX2OCT = HEX.TILL.OKT ## Omvandlar ett hexadecimalt tal till oktalt
+IMABS = IMABS ## Returnerar absolutvärdet (modulus) för ett komplext tal
+IMAGINARY = IMAGINÄR ## Returnerar den imaginära koefficienten för ett komplext tal
+IMARGUMENT = IMARGUMENT ## Returnerar det komplexa talets argument, en vinkel uttryckt i radianer
+IMCONJUGATE = IMKONJUGAT ## Returnerar det komplexa talets konjugat
+IMCOS = IMCOS ## Returnerar cosinus för ett komplext tal
+IMDIV = IMDIV ## Returnerar kvoten för två komplexa tal
+IMEXP = IMEUPPHÖJT ## Returnerar exponenten för ett komplext tal
+IMLN = IMLN ## Returnerar den naturliga logaritmen för ett komplext tal
+IMLOG10 = IMLOG10 ## Returnerar 10-logaritmen för ett komplext tal
+IMLOG2 = IMLOG2 ## Returnerar 2-logaritmen för ett komplext tal
+IMPOWER = IMUPPHÖJT ## Returnerar ett komplext tal upphöjt till en exponent
+IMPRODUCT = IMPRODUKT ## Returnerar produkten av komplexa tal
+IMREAL = IMREAL ## Returnerar den reella koefficienten för ett komplext tal
+IMSIN = IMSIN ## Returnerar sinus för ett komplext tal
+IMSQRT = IMROT ## Returnerar kvadratroten av ett komplext tal
+IMSUB = IMDIFF ## Returnerar differensen mellan två komplexa tal
+IMSUM = IMSUM ## Returnerar summan av komplexa tal
+OCT2BIN = OKT.TILL.BIN ## Omvandlar ett oktalt tal till binärt
+OCT2DEC = OKT.TILL.DEC ## Omvandlar ett oktalt tal till decimalt
+OCT2HEX = OKT.TILL.HEX ## Omvandlar ett oktalt tal till hexadecimalt
+
+
+##
+## Financial functions Finansiella funktioner
+##
+ACCRINT = UPPLRÄNTA ## Returnerar den upplupna räntan för värdepapper med periodisk ränta
+ACCRINTM = UPPLOBLRÄNTA ## Returnerar den upplupna räntan för ett värdepapper som ger avkastning på förfallodagen
+AMORDEGRC = AMORDEGRC ## Returnerar avskrivningen för varje redovisningsperiod med hjälp av en avskrivningskoefficient
+AMORLINC = AMORLINC ## Returnerar avskrivningen för varje redovisningsperiod
+COUPDAYBS = KUPDAGBB ## Returnerar antal dagar från början av kupongperioden till likviddagen
+COUPDAYS = KUPDAGARS ## Returnerar antalet dagar i kupongperioden som innehåller betalningsdatumet
+COUPDAYSNC = KUPDAGNK ## Returnerar antalet dagar från betalningsdatumet till nästa kupongdatum
+COUPNCD = KUPNKD ## Returnerar nästa kupongdatum efter likviddagen
+COUPNUM = KUPANT ## Returnerar kuponger som förfaller till betalning mellan likviddagen och förfallodagen
+COUPPCD = KUPFKD ## Returnerar föregående kupongdatum före likviddagen
+CUMIPMT = KUMRÄNTA ## Returnerar den ackumulerade räntan som betalats mellan två perioder
+CUMPRINC = KUMPRIS ## Returnerar det ackumulerade kapitalbeloppet som betalats på ett lån mellan två perioder
+DB = DB ## Returnerar avskrivningen för en tillgång under en angiven tid enligt metoden för fast degressiv avskrivning
+DDB = DEGAVSKR ## Returnerar en tillgångs värdeminskning under en viss period med hjälp av dubbel degressiv avskrivning eller någon annan metod som du anger
+DISC = DISK ## Returnerar diskonteringsräntan för ett värdepapper
+DOLLARDE = DECTAL ## Omvandlar ett pris uttryckt som ett bråk till ett decimaltal
+DOLLARFR = BRÅK ## Omvandlar ett pris i kronor uttryckt som ett decimaltal till ett bråk
+DURATION = LÖPTID ## Returnerar den årliga löptiden för en säkerhet med periodiska räntebetalningar
+EFFECT = EFFRÄNTA ## Returnerar den årliga effektiva räntesatsen
+FV = SLUTVÄRDE ## Returnerar det framtida värdet på en investering
+FVSCHEDULE = FÖRRÄNTNING ## Returnerar det framtida värdet av ett begynnelsekapital beräknat på olika räntenivåer
+INTRATE = ÅRSRÄNTA ## Returnerar räntesatsen för ett betalt värdepapper
+IPMT = RBETALNING ## Returnerar räntedelen av en betalning för en given period
+IRR = IR ## Returnerar internräntan för en serie betalningar
+ISPMT = RALÅN ## Beräknar räntan som har betalats under en specifik betalningsperiod
+MDURATION = MLÖPTID ## Returnerar den modifierade Macauley-löptiden för ett värdepapper med det antagna nominella värdet 100 kr
+MIRR = MODIR ## Returnerar internräntan där positiva och negativa betalningar finansieras med olika räntor
+NOMINAL = NOMRÄNTA ## Returnerar den årliga nominella räntesatsen
+NPER = PERIODER ## Returnerar antalet perioder för en investering
+NPV = NETNUVÄRDE ## Returnerar nuvärdet av en serie periodiska betalningar vid en given diskonteringsränta
+ODDFPRICE = UDDAFPRIS ## Returnerar priset per 100 kr nominellt värde för ett värdepapper med en udda första period
+ODDFYIELD = UDDAFAVKASTNING ## Returnerar avkastningen för en säkerhet med en udda första period
+ODDLPRICE = UDDASPRIS ## Returnerar priset per 100 kr nominellt värde för ett värdepapper med en udda sista period
+ODDLYIELD = UDDASAVKASTNING ## Returnerar avkastningen för en säkerhet med en udda sista period
+PMT = BETALNING ## Returnerar den periodiska betalningen för en annuitet
+PPMT = AMORT ## Returnerar amorteringsdelen av en annuitetsbetalning för en given period
+PRICE = PRIS ## Returnerar priset per 100 kr nominellt värde för ett värdepapper som ger periodisk ränta
+PRICEDISC = PRISDISK ## Returnerar priset per 100 kr nominellt värde för ett diskonterat värdepapper
+PRICEMAT = PRISFÖRF ## Returnerar priset per 100 kr nominellt värde för ett värdepapper som ger ränta på förfallodagen
+PV = PV ## Returnerar nuvärdet av en serie lika stora periodiska betalningar
+RATE = RÄNTA ## Returnerar räntesatsen per period i en annuitet
+RECEIVED = BELOPP ## Returnerar beloppet som utdelas på förfallodagen för ett betalat värdepapper
+SLN = LINAVSKR ## Returnerar den linjära avskrivningen för en tillgång under en period
+SYD = ÅRSAVSKR ## Returnerar den årliga avskrivningssumman för en tillgång under en angiven period
+TBILLEQ = SSVXEKV ## Returnerar avkastningen motsvarande en obligation för en statsskuldväxel
+TBILLPRICE = SSVXPRIS ## Returnerar priset per 100 kr nominellt värde för en statsskuldväxel
+TBILLYIELD = SSVXRÄNTA ## Returnerar avkastningen för en statsskuldväxel
+VDB = VDEGRAVSKR ## Returnerar avskrivningen för en tillgång under en angiven period (med degressiv avskrivning)
+XIRR = XIRR ## Returnerar internräntan för en serie betalningar som inte nödvändigtvis är periodiska
+XNPV = XNUVÄRDE ## Returnerar det nuvarande nettovärdet för en serie betalningar som inte nödvändigtvis är periodiska
+YIELD = NOMAVK ## Returnerar avkastningen för ett värdepapper som ger periodisk ränta
+YIELDDISC = NOMAVKDISK ## Returnerar den årliga avkastningen för diskonterade värdepapper, exempelvis en statsskuldväxel
+YIELDMAT = NOMAVKFÖRF ## Returnerar den årliga avkastningen för ett värdepapper som ger ränta på förfallodagen
+
+
+##
+## Information functions Informationsfunktioner
+##
+CELL = CELL ## Returnerar information om formatering, plats och innehåll i en cell
+ERROR.TYPE = FEL.TYP ## Returnerar ett tal som motsvarar ett felvärde
+INFO = INFO ## Returnerar information om operativsystemet
+ISBLANK = ÄRREF ## Returnerar SANT om värdet är tomt
+ISERR = Ä ## Returnerar SANT om värdet är ett felvärde annat än #SAKNAS!
+ISERROR = ÄRFEL ## Returnerar SANT om värdet är ett felvärde
+ISEVEN = ÄRJÄMN ## Returnerar SANT om talet är jämnt
+ISLOGICAL = ÄREJTEXT ## Returnerar SANT om värdet är ett logiskt värde
+ISNA = ÄRLOGISK ## Returnerar SANT om värdet är felvärdet #SAKNAS!
+ISNONTEXT = ÄRSAKNAD ## Returnerar SANT om värdet inte är text
+ISNUMBER = ÄRTAL ## Returnerar SANT om värdet är ett tal
+ISODD = ÄRUDDA ## Returnerar SANT om talet är udda
+ISREF = ÄRTOM ## Returnerar SANT om värdet är en referens
+ISTEXT = ÄRTEXT ## Returnerar SANT om värdet är text
+N = N ## Returnerar ett värde omvandlat till ett tal
+NA = SAKNAS ## Returnerar felvärdet #SAKNAS!
+TYPE = VÄRDETYP ## Returnerar ett tal som anger värdets datatyp
+
+
+##
+## Logical functions Logiska funktioner
+##
+AND = OCH ## Returnerar SANT om alla argument är sanna
+FALSE = FALSKT ## Returnerar det logiska värdet FALSKT
+IF = OM ## Anger vilket logiskt test som ska utföras
+IFERROR = OMFEL ## Returnerar ett värde som du anger om en formel utvärderar till ett fel; annars returneras resultatet av formeln
+NOT = ICKE ## Inverterar logiken för argumenten
+OR = ELLER ## Returnerar SANT om något argument är SANT
+TRUE = SANT ## Returnerar det logiska värdet SANT
+
+
+##
+## Lookup and reference functions Sök- och referensfunktioner
+##
+ADDRESS = ADRESS ## Returnerar en referens som text till en enstaka cell i ett kalkylblad
+AREAS = OMRÅDEN ## Returnerar antalet områden i en referens
+CHOOSE = VÄLJ ## Väljer ett värde i en lista över värden
+COLUMN = KOLUMN ## Returnerar kolumnnumret för en referens
+COLUMNS = KOLUMNER ## Returnerar antalet kolumner i en referens
+HLOOKUP = LETAKOLUMN ## Söker i den översta raden i en matris och returnerar värdet för angiven cell
+HYPERLINK = HYPERLÄNK ## Skapar en genväg eller ett hopp till ett dokument i nätverket, i ett intranät eller på Internet
+INDEX = INDEX ## Använder ett index för ett välja ett värde i en referens eller matris
+INDIRECT = INDIREKT ## Returnerar en referens som anges av ett textvärde
+LOOKUP = LETAUPP ## Letar upp värden i en vektor eller matris
+MATCH = PASSA ## Letar upp värden i en referens eller matris
+OFFSET = FÖRSKJUTNING ## Returnerar en referens förskjuten i förhållande till en given referens
+ROW = RAD ## Returnerar radnumret för en referens
+ROWS = RADER ## Returnerar antalet rader i en referens
+RTD = RTD ## Hämtar realtidsdata från ett program som stöder COM-automation (Automation: Ett sätt att arbeta med ett programs objekt från ett annat program eller utvecklingsverktyg. Detta kallades tidigare för OLE Automation, och är en branschstandard och ingår i Component Object Model (COM).)
+TRANSPOSE = TRANSPONERA ## Transponerar en matris
+VLOOKUP = LETARAD ## Letar i den första kolumnen i en matris och flyttar över raden för att returnera värdet för en cell
+
+
+##
+## Math and trigonometry functions Matematiska och trigonometriska funktioner
+##
+ABS = ABS ## Returnerar absolutvärdet av ett tal
+ACOS = ARCCOS ## Returnerar arcus cosinus för ett tal
+ACOSH = ARCCOSH ## Returnerar inverterad hyperbolisk cosinus för ett tal
+ASIN = ARCSIN ## Returnerar arcus cosinus för ett tal
+ASINH = ARCSINH ## Returnerar hyperbolisk arcus sinus för ett tal
+ATAN = ARCTAN ## Returnerar arcus tangens för ett tal
+ATAN2 = ARCTAN2 ## Returnerar arcus tangens för en x- och en y- koordinat
+ATANH = ARCTANH ## Returnerar hyperbolisk arcus tangens för ett tal
+CEILING = RUNDA.UPP ## Avrundar ett tal till närmaste heltal eller närmaste signifikanta multipel
+COMBIN = KOMBIN ## Returnerar antalet kombinationer för ett givet antal objekt
+COS = COS ## Returnerar cosinus för ett tal
+COSH = COSH ## Returnerar hyperboliskt cosinus för ett tal
+DEGREES = GRADER ## Omvandlar radianer till grader
+EVEN = JÄMN ## Avrundar ett tal uppåt till närmaste heltal
+EXP = EXP ## Returnerar e upphöjt till ett givet tal
+FACT = FAKULTET ## Returnerar fakulteten för ett tal
+FACTDOUBLE = DUBBELFAKULTET ## Returnerar dubbelfakulteten för ett tal
+FLOOR = RUNDA.NED ## Avrundar ett tal nedåt mot noll
+GCD = SGD ## Returnerar den största gemensamma nämnaren
+INT = HELTAL ## Avrundar ett tal nedåt till närmaste heltal
+LCM = MGM ## Returnerar den minsta gemensamma multipeln
+LN = LN ## Returnerar den naturliga logaritmen för ett tal
+LOG = LOG ## Returnerar logaritmen för ett tal för en given bas
+LOG10 = LOG10 ## Returnerar 10-logaritmen för ett tal
+MDETERM = MDETERM ## Returnerar matrisen som är avgörandet av en matris
+MINVERSE = MINVERT ## Returnerar matrisinversen av en matris
+MMULT = MMULT ## Returnerar matrisprodukten av två matriser
+MOD = REST ## Returnerar resten vid en division
+MROUND = MAVRUNDA ## Returnerar ett tal avrundat till en given multipel
+MULTINOMIAL = MULTINOMIAL ## Returnerar multinomialen för en uppsättning tal
+ODD = UDDA ## Avrundar ett tal uppåt till närmaste udda heltal
+PI = PI ## Returnerar värdet pi
+POWER = UPPHÖJT.TILL ## Returnerar resultatet av ett tal upphöjt till en exponent
+PRODUCT = PRODUKT ## Multiplicerar argumenten
+QUOTIENT = KVOT ## Returnerar heltalsdelen av en division
+RADIANS = RADIANER ## Omvandlar grader till radianer
+RAND = SLUMP ## Returnerar ett slumptal mellan 0 och 1
+RANDBETWEEN = SLUMP.MELLAN ## Returnerar ett slumptal mellan de tal som du anger
+ROMAN = ROMERSK ## Omvandlar vanliga (arabiska) siffror till romerska som text
+ROUND = AVRUNDA ## Avrundar ett tal till ett angivet antal siffror
+ROUNDDOWN = AVRUNDA.NEDÅT ## Avrundar ett tal nedåt mot noll
+ROUNDUP = AVRUNDA.UPPÅT ## Avrundar ett tal uppåt, från noll
+SERIESSUM = SERIESUMMA ## Returnerar summan av en potensserie baserat på formeln
+SIGN = TECKEN ## Returnerar tecknet för ett tal
+SIN = SIN ## Returnerar sinus för en given vinkel
+SINH = SINH ## Returnerar hyperbolisk sinus för ett tal
+SQRT = ROT ## Returnerar den positiva kvadratroten
+SQRTPI = ROTPI ## Returnerar kvadratroten för (tal * pi)
+SUBTOTAL = DELSUMMA ## Returnerar en delsumma i en lista eller databas
+SUM = SUMMA ## Summerar argumenten
+SUMIF = SUMMA.OM ## Summerar celler enligt ett angivet villkor
+SUMIFS = SUMMA.OMF ## Lägger till cellerna i ett område som uppfyller flera kriterier
+SUMPRODUCT = PRODUKTSUMMA ## Returnerar summan av produkterna i motsvarande matriskomponenter
+SUMSQ = KVADRATSUMMA ## Returnerar summan av argumentens kvadrater
+SUMX2MY2 = SUMMAX2MY2 ## Returnerar summan av differensen mellan kvadraterna för motsvarande värden i två matriser
+SUMX2PY2 = SUMMAX2PY2 ## Returnerar summan av summan av kvadraterna av motsvarande värden i två matriser
+SUMXMY2 = SUMMAXMY2 ## Returnerar summan av kvadraten av skillnaden mellan motsvarande värden i två matriser
+TAN = TAN ## Returnerar tangens för ett tal
+TANH = TANH ## Returnerar hyperbolisk tangens för ett tal
+TRUNC = AVKORTA ## Avkortar ett tal till ett heltal
+
+
+##
+## Statistical functions Statistiska funktioner
+##
+AVEDEV = MEDELAVV ## Returnerar medelvärdet för datapunkters absoluta avvikelse från deras medelvärde
+AVERAGE = MEDEL ## Returnerar medelvärdet av argumenten
+AVERAGEA = AVERAGEA ## Returnerar medelvärdet av argumenten, inklusive tal, text och logiska värden
+AVERAGEIF = MEDELOM ## Returnerar medelvärdet (aritmetiskt medelvärde) för alla celler i ett område som uppfyller ett givet kriterium
+AVERAGEIFS = MEDELOMF ## Returnerar medelvärdet (det aritmetiska medelvärdet) för alla celler som uppfyller flera villkor.
+BETADIST = BETAFÖRD ## Returnerar den kumulativa betafördelningsfunktionen
+BETAINV = BETAINV ## Returnerar inversen till den kumulativa fördelningsfunktionen för en viss betafördelning
+BINOMDIST = BINOMFÖRD ## Returnerar den individuella binomialfördelningen
+CHIDIST = CHI2FÖRD ## Returnerar den ensidiga sannolikheten av c2-fördelningen
+CHIINV = CHI2INV ## Returnerar inversen av chi2-fördelningen
+CHITEST = CHI2TEST ## Returnerar oberoendetesten
+CONFIDENCE = KONFIDENS ## Returnerar konfidensintervallet för en populations medelvärde
+CORREL = KORREL ## Returnerar korrelationskoefficienten mellan två datamängder
+COUNT = ANTAL ## Räknar hur många tal som finns bland argumenten
+COUNTA = ANTALV ## Räknar hur många värden som finns bland argumenten
+COUNTBLANK = ANTAL.TOMMA ## Räknar antalet tomma celler i ett område
+COUNTIF = ANTAL.OM ## Räknar antalet celler i ett område som uppfyller angivna villkor.
+COUNTIFS = ANTAL.OMF ## Räknar antalet celler i ett område som uppfyller flera villkor.
+COVAR = KOVAR ## Returnerar kovariansen, d.v.s. medelvärdet av produkterna för parade avvikelser
+CRITBINOM = KRITBINOM ## Returnerar det minsta värdet för vilket den kumulativa binomialfördelningen är mindre än eller lika med ett villkorsvärde
+DEVSQ = KVADAVV ## Returnerar summan av kvadrater på avvikelser
+EXPONDIST = EXPONFÖRD ## Returnerar exponentialfördelningen
+FDIST = FFÖRD ## Returnerar F-sannolikhetsfördelningen
+FINV = FINV ## Returnerar inversen till F-sannolikhetsfördelningen
+FISHER = FISHER ## Returnerar Fisher-transformationen
+FISHERINV = FISHERINV ## Returnerar inversen till Fisher-transformationen
+FORECAST = PREDIKTION ## Returnerar ett värde längs en linjär trendlinje
+FREQUENCY = FREKVENS ## Returnerar en frekvensfördelning som en lodrät matris
+FTEST = FTEST ## Returnerar resultatet av en F-test
+GAMMADIST = GAMMAFÖRD ## Returnerar gammafördelningen
+GAMMAINV = GAMMAINV ## Returnerar inversen till den kumulativa gammafördelningen
+GAMMALN = GAMMALN ## Returnerar den naturliga logaritmen för gammafunktionen, G(x)
+GEOMEAN = GEOMEDEL ## Returnerar det geometriska medelvärdet
+GROWTH = EXPTREND ## Returnerar värden längs en exponentiell trend
+HARMEAN = HARMMEDEL ## Returnerar det harmoniska medelvärdet
+HYPGEOMDIST = HYPGEOMFÖRD ## Returnerar den hypergeometriska fördelningen
+INTERCEPT = SKÄRNINGSPUNKT ## Returnerar skärningspunkten för en linjär regressionslinje
+KURT = TOPPIGHET ## Returnerar toppigheten av en mängd data
+LARGE = STÖRSTA ## Returnerar det n:te största värdet i en mängd data
+LINEST = REGR ## Returnerar parametrar till en linjär trendlinje
+LOGEST = EXPREGR ## Returnerar parametrarna i en exponentiell trend
+LOGINV = LOGINV ## Returnerar inversen till den lognormala fördelningen
+LOGNORMDIST = LOGNORMFÖRD ## Returnerar den kumulativa lognormala fördelningen
+MAX = MAX ## Returnerar det största värdet i en lista av argument
+MAXA = MAXA ## Returnerar det största värdet i en lista av argument, inklusive tal, text och logiska värden
+MEDIAN = MEDIAN ## Returnerar medianen för angivna tal
+MIN = MIN ## Returnerar det minsta värdet i en lista med argument
+MINA = MINA ## Returnerar det minsta värdet i en lista över argument, inklusive tal, text och logiska värden
+MODE = TYPVÄRDE ## Returnerar det vanligaste värdet i en datamängd
+NEGBINOMDIST = NEGBINOMFÖRD ## Returnerar den negativa binomialfördelningen
+NORMDIST = NORMFÖRD ## Returnerar den kumulativa normalfördelningen
+NORMINV = NORMINV ## Returnerar inversen till den kumulativa normalfördelningen
+NORMSDIST = NORMSFÖRD ## Returnerar den kumulativa standardnormalfördelningen
+NORMSINV = NORMSINV ## Returnerar inversen till den kumulativa standardnormalfördelningen
+PEARSON = PEARSON ## Returnerar korrelationskoefficienten till Pearsons momentprodukt
+PERCENTILE = PERCENTIL ## Returnerar den n:te percentilen av värden i ett område
+PERCENTRANK = PROCENTRANG ## Returnerar procentrangen för ett värde i en datamängd
+PERMUT = PERMUT ## Returnerar antal permutationer för ett givet antal objekt
+POISSON = POISSON ## Returnerar Poisson-fördelningen
+PROB = SANNOLIKHET ## Returnerar sannolikheten att värden i ett område ligger mellan två gränser
+QUARTILE = KVARTIL ## Returnerar kvartilen av en mängd data
+RANK = RANG ## Returnerar rangordningen för ett tal i en lista med tal
+RSQ = RKV ## Returnerar kvadraten av Pearsons produktmomentkorrelationskoefficient
+SKEW = SNEDHET ## Returnerar snedheten för en fördelning
+SLOPE = LUTNING ## Returnerar lutningen på en linjär regressionslinje
+SMALL = MINSTA ## Returnerar det n:te minsta värdet i en mängd data
+STANDARDIZE = STANDARDISERA ## Returnerar ett normaliserat värde
+STDEV = STDAV ## Uppskattar standardavvikelsen baserat på ett urval
+STDEVA = STDEVA ## Uppskattar standardavvikelsen baserat på ett urval, inklusive tal, text och logiska värden
+STDEVP = STDAVP ## Beräknar standardavvikelsen baserat på hela populationen
+STDEVPA = STDEVPA ## Beräknar standardavvikelsen baserat på hela populationen, inklusive tal, text och logiska värden
+STEYX = STDFELYX ## Returnerar standardfelet för ett förutspått y-värde för varje x-värde i regressionen
+TDIST = TFÖRD ## Returnerar Students t-fördelning
+TINV = TINV ## Returnerar inversen till Students t-fördelning
+TREND = TREND ## Returnerar värden längs en linjär trend
+TRIMMEAN = TRIMMEDEL ## Returnerar medelvärdet av mittpunkterna i en datamängd
+TTEST = TTEST ## Returnerar sannolikheten beräknad ur Students t-test
+VAR = VARIANS ## Uppskattar variansen baserat på ett urval
+VARA = VARA ## Uppskattar variansen baserat på ett urval, inklusive tal, text och logiska värden
+VARP = VARIANSP ## Beräknar variansen baserat på hela populationen
+VARPA = VARPA ## Beräknar variansen baserat på hela populationen, inklusive tal, text och logiska värden
+WEIBULL = WEIBULL ## Returnerar Weibull-fördelningen
+ZTEST = ZTEST ## Returnerar det ensidiga sannolikhetsvärdet av ett z-test
+
+
+##
+## Text functions Textfunktioner
+##
+ASC = ASC ## Ändrar helbredds (dubbel byte) engelska bokstäver eller katakana inom en teckensträng till tecken med halvt breddsteg (enkel byte)
+BAHTTEXT = BAHTTEXT ## Omvandlar ett tal till text med valutaformatet ß (baht)
+CHAR = TECKENKOD ## Returnerar tecknet som anges av kod
+CLEAN = STÄDA ## Tar bort alla icke utskrivbara tecken i en text
+CODE = KOD ## Returnerar en numerisk kod för det första tecknet i en textsträng
+CONCATENATE = SAMMANFOGA ## Sammanfogar flera textdelar till en textsträng
+DOLLAR = VALUTA ## Omvandlar ett tal till text med valutaformat
+EXACT = EXAKT ## Kontrollerar om två textvärden är identiska
+FIND = HITTA ## Hittar en text i en annan (skiljer på gemener och versaler)
+FINDB = HITTAB ## Hittar en text i en annan (skiljer på gemener och versaler)
+FIXED = FASTTAL ## Formaterar ett tal som text med ett fast antal decimaler
+JIS = JIS ## Ändrar halvbredds (enkel byte) engelska bokstäver eller katakana inom en teckensträng till tecken med helt breddsteg (dubbel byte)
+LEFT = VÄNSTER ## Returnerar tecken längst till vänster i en sträng
+LEFTB = VÄNSTERB ## Returnerar tecken längst till vänster i en sträng
+LEN = LÄNGD ## Returnerar antalet tecken i en textsträng
+LENB = LÄNGDB ## Returnerar antalet tecken i en textsträng
+LOWER = GEMENER ## Omvandlar text till gemener
+MID = EXTEXT ## Returnerar angivet antal tecken från en text med början vid den position som du anger
+MIDB = EXTEXTB ## Returnerar angivet antal tecken från en text med början vid den position som du anger
+PHONETIC = PHONETIC ## Returnerar de fonetiska (furigana) tecknen i en textsträng
+PROPER = INITIAL ## Ändrar första bokstaven i varje ord i ett textvärde till versal
+REPLACE = ERSÄTT ## Ersätter tecken i text
+REPLACEB = ERSÄTTB ## Ersätter tecken i text
+REPT = REP ## Upprepar en text ett bestämt antal gånger
+RIGHT = HÖGER ## Returnerar tecken längst till höger i en sträng
+RIGHTB = HÖGERB ## Returnerar tecken längst till höger i en sträng
+SEARCH = SÖK ## Hittar ett textvärde i ett annat (skiljer inte på gemener och versaler)
+SEARCHB = SÖKB ## Hittar ett textvärde i ett annat (skiljer inte på gemener och versaler)
+SUBSTITUTE = BYT.UT ## Ersätter gammal text med ny text i en textsträng
+T = T ## Omvandlar argumenten till text
+TEXT = TEXT ## Formaterar ett tal och omvandlar det till text
+TRIM = RENSA ## Tar bort blanksteg från text
+UPPER = VERSALER ## Omvandlar text till versaler
+VALUE = TEXTNUM ## Omvandlar ett textargument till ett tal
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/tr/config b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/tr/config
new file mode 100644
index 00000000000..266e000f6ac
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/tr/config
@@ -0,0 +1,24 @@
+##
+## PhpSpreadsheet
+##
+
+ArgumentSeparator = ;
+
+
+##
+## (For future use)
+##
+currencySymbol = YTL
+
+
+##
+## Excel Error Codes (For future use)
+
+##
+NULL = #BOŞ!
+DIV0 = #SAYI/0!
+VALUE = #DEĞER!
+REF = #BAŞV!
+NAME = #AD?
+NUM = #SAYI!
+NA = #YOK
diff --git a/lib/phpexcel/PHPExcel/locale/tr/functions b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/tr/functions
similarity index 95%
rename from lib/phpexcel/PHPExcel/locale/tr/functions
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/tr/functions
index 45d7df1fecc..f03563a797a 100644
--- a/lib/phpexcel/PHPExcel/locale/tr/functions
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Calculation/locale/tr/functions
@@ -1,438 +1,416 @@
-##
-## PHPExcel
-##
-## Copyright (c) 2006 - 2013 PHPExcel
-##
-## This library is free software; you can redistribute it and/or
-## modify it under the terms of the GNU Lesser General Public
-## License as published by the Free Software Foundation; either
-## version 2.1 of the License, or (at your option) any later version.
-##
-## This library is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-## Lesser General Public License for more details.
-##
-## You should have received a copy of the GNU Lesser General Public
-## License along with this library; if not, write to the Free Software
-## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-##
-## @category PHPExcel
-## @package PHPExcel_Calculation
-## @copyright Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)
-## @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
-## @version ##VERSION##, ##DATE##
-##
-## Data in this file derived from http://www.piuha.fi/excel-function-name-translation/
-##
-##
-
-
-##
-## Add-in and Automation functions Eklenti ve Otomasyon fonksiyonları
-##
-GETPIVOTDATA = ÖZETVERİAL ## Bir Özet Tablo raporunda saklanan verileri verir.
-
-
-##
-## Cube functions Küp işlevleri
-##
-CUBEKPIMEMBER = KÜPKPIÜYE ## Kilit performans göstergesi (KPI-Key Performance Indicator) adını, özelliğini ve ölçüsünü verir ve hücredeki ad ve özelliği gösterir. KPI, bir kurumun performansını izlemek için kullanılan aylık brüt kâr ya da üç aylık çalışan giriş çıkışları gibi ölçülebilen bir birimdir.
-CUBEMEMBER = KÜPÜYE ## Bir küp hiyerarşisinde bir üyeyi veya kaydı verir. Üye veya kaydın küpte varolduğunu doğrulamak için kullanılır.
-CUBEMEMBERPROPERTY = KÜPÜYEÖZELLİĞİ ## Bir küpte bir üyenin özelliğinin değerini verir. Küp içinde üye adının varlığını doğrulamak ve bu üyenin belli özelliklerini getirmek için kullanılır.
-CUBERANKEDMEMBER = KÜPÜYESIRASI ## Bir küme içindeki üyenin derecesini veya kaçıncı olduğunu verir. En iyi satış elemanı, veya en iyi on öğrenci gibi bir kümedeki bir veya daha fazla öğeyi getirmek için kullanılır.
-CUBESET = KÜPKÜME ## Kümeyi oluşturan ve ardından bu kümeyi Microsoft Office Excel'e getiren sunucudaki küpe küme ifadelerini göndererek hesaplanan üye veya kayıt kümesini tanımlar.
-CUBESETCOUNT = KÜPKÜMESAY ## Bir kümedeki öğelerin sayısını getirir.
-CUBEVALUE = KÜPDEĞER ## Bir küpten toplam değeri getirir.
-
-
-##
-## Database functions Veritabanı işlevleri
-##
-DAVERAGE = VSEÇORT ## Seçili veritabanı girdilerinin ortalamasını verir.
-DCOUNT = VSEÇSAY ## Veritabanında sayı içeren hücre sayısını hesaplar.
-DCOUNTA = VSEÇSAYDOLU ## Veritabanındaki boş olmayan hücreleri sayar.
-DGET = VAL ## Veritabanından, belirtilen ölçütlerle eşleşen tek bir rapor çıkarır.
-DMAX = VSEÇMAK ## Seçili veritabanı girişlerinin en yüksek değerini verir.
-DMIN = VSEÇMİN ## Seçili veritabanı girişlerinin en düşük değerini verir.
-DPRODUCT = VSEÇÇARP ## Kayıtların belli bir alanında bulunan, bir veritabanındaki ölçütlerle eşleşen değerleri çarpar.
-DSTDEV = VSEÇSTDSAPMA ## Seçili veritabanı girişlerinden oluşan bir örneğe dayanarak, standart sapmayı tahmin eder.
-DSTDEVP = VSEÇSTDSAPMAS ## Standart sapmayı, seçili veritabanı girişlerinin tüm popülasyonunu esas alarak hesaplar.
-DSUM = VSEÇTOPLA ## Kayıtların alan sütununda bulunan, ölçütle eşleşen sayıları toplar.
-DVAR = VSEÇVAR ## Seçili veritabanı girişlerinden oluşan bir örneği esas alarak farkı tahmin eder.
-DVARP = VSEÇVARS ## Seçili veritabanı girişlerinin tüm popülasyonunu esas alarak farkı hesaplar.
-
-
-##
-## Date and time functions Tarih ve saat işlevleri
-##
-DATE = TARİH ## Belirli bir tarihin seri numarasını verir.
-DATEVALUE = TARİHSAYISI ## Metin biçimindeki bir tarihi seri numarasına dönüştürür.
-DAY = GÜN ## Seri numarasını, ayın bir gününe dönüştürür.
-DAYS360 = GÜN360 ## İki tarih arasındaki gün sayısını, 360 günlük yılı esas alarak hesaplar.
-EDATE = SERİTARİH ## Başlangıç tarihinden itibaren, belirtilen ay sayısından önce veya sonraki tarihin seri numarasını verir.
-EOMONTH = SERİAY ## Belirtilen sayıda ay önce veya sonraki ayın son gününün seri numarasını verir.
-HOUR = SAAT ## Bir seri numarasını saate dönüştürür.
-MINUTE = DAKİKA ## Bir seri numarasını dakikaya dönüştürür.
-MONTH = AY ## Bir seri numarasını aya dönüştürür.
-NETWORKDAYS = TAMİŞGÜNÜ ## İki tarih arasındaki tam çalışma günlerinin sayısını verir.
-NOW = ŞİMDİ ## Geçerli tarihin ve saatin seri numarasını verir.
-SECOND = SANİYE ## Bir seri numarasını saniyeye dönüştürür.
-TIME = ZAMAN ## Belirli bir zamanın seri numarasını verir.
-TIMEVALUE = ZAMANSAYISI ## Metin biçimindeki zamanı seri numarasına dönüştürür.
-TODAY = BUGÜN ## Bugünün tarihini seri numarasına dönüştürür.
-WEEKDAY = HAFTANINGÜNÜ ## Bir seri numarasını, haftanın gününe dönüştürür.
-WEEKNUM = HAFTASAY ## Dizisel değerini, haftanın yıl içinde bulunduğu konumu sayısal olarak gösteren sayıya dönüştürür.
-WORKDAY = İŞGÜNÜ ## Belirtilen sayıda çalışma günü öncesinin ya da sonrasının tarihinin seri numarasını verir.
-YEAR = YIL ## Bir seri numarasını yıla dönüştürür.
-YEARFRAC = YILORAN ## Başlangıç_tarihi ve bitiş_tarihi arasındaki tam günleri gösteren yıl kesrini verir.
-
-
-##
-## Engineering functions Mühendislik işlevleri
-##
-BESSELI = BESSELI ## Değiştirilmiş Bessel fonksiyonu In(x)'i verir.
-BESSELJ = BESSELJ ## Bessel fonksiyonu Jn(x)'i verir.
-BESSELK = BESSELK ## Değiştirilmiş Bessel fonksiyonu Kn(x)'i verir.
-BESSELY = BESSELY ## Bessel fonksiyonu Yn(x)'i verir.
-BIN2DEC = BIN2DEC ## İkili bir sayıyı, ondalık sayıya dönüştürür.
-BIN2HEX = BIN2HEX ## İkili bir sayıyı, onaltılıya dönüştürür.
-BIN2OCT = BIN2OCT ## İkili bir sayıyı, sekizliye dönüştürür.
-COMPLEX = KARMAŞIK ## Gerçek ve sanal katsayıları, karmaşık sayıya dönüştürür.
-CONVERT = ÇEVİR ## Bir sayıyı, bir ölçüm sisteminden bir başka ölçüm sistemine dönüştürür.
-DEC2BIN = DEC2BIN ## Ondalık bir sayıyı, ikiliye dönüştürür.
-DEC2HEX = DEC2HEX ## Ondalık bir sayıyı, onaltılıya dönüştürür.
-DEC2OCT = DEC2OCT ## Ondalık bir sayıyı sekizliğe dönüştürür.
-DELTA = DELTA ## İki değerin eşit olup olmadığını sınar.
-ERF = HATAİŞLEV ## Hata işlevini verir.
-ERFC = TÜMHATAİŞLEV ## Tümleyici hata işlevini verir.
-GESTEP = BESINIR ## Bir sayının eşik değerinden büyük olup olmadığını sınar.
-HEX2BIN = HEX2BIN ## Onaltılı bir sayıyı ikiliye dönüştürür.
-HEX2DEC = HEX2DEC ## Onaltılı bir sayıyı ondalığa dönüştürür.
-HEX2OCT = HEX2OCT ## Onaltılı bir sayıyı sekizliğe dönüştürür.
-IMABS = SANMUTLAK ## Karmaşık bir sayının mutlak değerini (modül) verir.
-IMAGINARY = SANAL ## Karmaşık bir sayının sanal katsayısını verir.
-IMARGUMENT = SANBAĞ_DEĞİŞKEN ## Radyanlarla belirtilen bir açı olan teta bağımsız değişkenini verir.
-IMCONJUGATE = SANEŞLENEK ## Karmaşık bir sayının karmaşık eşleniğini verir.
-IMCOS = SANCOS ## Karmaşık bir sayının kosinüsünü verir.
-IMDIV = SANBÖL ## İki karmaşık sayının bölümünü verir.
-IMEXP = SANÜS ## Karmaşık bir sayının üssünü verir.
-IMLN = SANLN ## Karmaşık bir sayının doğal logaritmasını verir.
-IMLOG10 = SANLOG10 ## Karmaşık bir sayının, 10 tabanında logaritmasını verir.
-IMLOG2 = SANLOG2 ## Karmaşık bir sayının 2 tabanında logaritmasını verir.
-IMPOWER = SANÜSSÜ ## Karmaşık bir sayıyı, bir tamsayı üssüne yükseltilmiş olarak verir.
-IMPRODUCT = SANÇARP ## Karmaşık sayıların çarpımını verir.
-IMREAL = SANGERÇEK ## Karmaşık bir sayının, gerçek katsayısını verir.
-IMSIN = SANSIN ## Karmaşık bir sayının sinüsünü verir.
-IMSQRT = SANKAREKÖK ## Karmaşık bir sayının karekökünü verir.
-IMSUB = SANÇIKAR ## İki karmaşık sayının farkını verir.
-IMSUM = SANTOPLA ## Karmaşık sayıların toplamını verir.
-OCT2BIN = OCT2BIN ## Sekizli bir sayıyı ikiliye dönüştürür.
-OCT2DEC = OCT2DEC ## Sekizli bir sayıyı ondalığa dönüştürür.
-OCT2HEX = OCT2HEX ## Sekizli bir sayıyı onaltılıya dönüştürür.
-
-
-##
-## Financial functions Finansal fonksiyonlar
-##
-ACCRINT = GERÇEKFAİZ ## Dönemsel faiz ödeyen hisse senedine ilişkin tahakkuk eden faizi getirir.
-ACCRINTM = GERÇEKFAİZV ## Vadesinde ödeme yapan bir tahvilin tahakkuk etmiş faizini verir.
-AMORDEGRC = AMORDEGRC ## Yıpranma katsayısı kullanarak her hesap döneminin değer kaybını verir.
-AMORLINC = AMORLINC ## Her hesap dönemi içindeki yıpranmayı verir.
-COUPDAYBS = KUPONGÜNBD ## Kupon süresinin başlangıcından alış tarihine kadar olan süredeki gün sayısını verir.
-COUPDAYS = KUPONGÜN ## Kupon süresindeki, gün sayısını, alış tarihini de içermek üzere, verir.
-COUPDAYSNC = KUPONGÜNDSK ## Alış tarihinden bir sonraki kupon tarihine kadar olan gün sayısını verir.
-COUPNCD = KUPONGÜNSKT ## Alış tarihinden bir sonraki kupon tarihini verir.
-COUPNUM = KUPONSAYI ## Alış tarihiyle vade tarihi arasında ödenecek kuponların sayısını verir.
-COUPPCD = KUPONGÜNÖKT ## Alış tarihinden bir önceki kupon tarihini verir.
-CUMIPMT = AİÇVERİMORANI ## İki dönem arasında ödenen kümülatif faizi verir.
-CUMPRINC = ANA_PARA_ÖDEMESİ ## İki dönem arasında bir borç üzerine ödenen birikimli temeli verir.
-DB = AZALANBAKİYE ## Bir malın belirtilen bir süre içindeki yıpranmasını, sabit azalan bakiye yöntemini kullanarak verir.
-DDB = ÇİFTAZALANBAKİYE ## Bir malın belirtilen bir süre içindeki yıpranmasını, çift azalan bakiye yöntemi ya da sizin belirttiğiniz başka bir yöntemi kullanarak verir.
-DISC = İNDİRİM ## Bir tahvilin indirim oranını verir.
-DOLLARDE = LİRAON ## Kesir olarak tanımlanmış lira fiyatını, ondalık sayı olarak tanımlanmış lira fiyatına dönüştürür.
-DOLLARFR = LİRAKES ## Ondalık sayı olarak tanımlanmış lira fiyatını, kesir olarak tanımlanmış lira fiyatına dönüştürür.
-DURATION = SÜRE ## Belli aralıklarla faiz ödemesi yapan bir tahvilin yıllık süresini verir.
-EFFECT = ETKİN ## Efektif yıllık faiz oranını verir.
-FV = ANBD ## Bir yatırımın gelecekteki değerini verir.
-FVSCHEDULE = GDPROGRAM ## Bir seri birleşik faiz oranı uyguladıktan sonra, bir başlangıçtaki anaparanın gelecekteki değerini verir.
-INTRATE = FAİZORANI ## Tam olarak yatırım yapılmış bir tahvilin faiz oranını verir.
-IPMT = FAİZTUTARI ## Bir yatırımın verilen bir süre için faiz ödemesini verir.
-IRR = İÇ_VERİM_ORANI ## Bir para akışı serisi için, iç verim oranını verir.
-ISPMT = ISPMT ## Yatırımın belirli bir dönemi boyunca ödenen faizi hesaplar.
-MDURATION = MSÜRE ## Varsayılan par değeri 10.000.000 lira olan bir tahvil için Macauley değiştirilmiş süreyi verir.
-MIRR = D_İÇ_VERİM_ORANI ## Pozitif ve negatif para akışlarının farklı oranlarda finanse edildiği durumlarda, iç verim oranını verir.
-NOMINAL = NOMİNAL ## Yıllık nominal faiz oranını verir.
-NPER = DÖNEM_SAYISI ## Bir yatırımın dönem sayısını verir.
-NPV = NBD ## Bir yatırımın bugünkü net değerini, bir dönemsel para akışları serisine ve bir indirim oranına bağlı olarak verir.
-ODDFPRICE = TEKYDEĞER ## Tek bir ilk dönemi olan bir tahvilin değerini, her 100.000.000 lirada bir verir.
-ODDFYIELD = TEKYÖDEME ## Tek bir ilk dönemi olan bir tahvilin ödemesini verir.
-ODDLPRICE = TEKSDEĞER ## Tek bir son dönemi olan bir tahvilin fiyatını her 10.000.000 lirada bir verir.
-ODDLYIELD = TEKSÖDEME ## Tek bir son dönemi olan bir tahvilin ödemesini verir.
-PMT = DEVRESEL_ÖDEME ## Bir yıllık dönemsel ödemeyi verir.
-PPMT = ANA_PARA_ÖDEMESİ ## Verilen bir süre için, bir yatırımın anaparasına dayanan ödemeyi verir.
-PRICE = DEĞER ## Dönemsel faiz ödeyen bir tahvilin fiyatını 10.000.00 liralık değer başına verir.
-PRICEDISC = DEĞERİND ## İndirimli bir tahvilin fiyatını 10.000.000 liralık nominal değer başına verir.
-PRICEMAT = DEĞERVADE ## Faizini vade sonunda ödeyen bir tahvilin fiyatını 10.000.000 nominal değer başına verir.
-PV = BD ## Bir yatırımın bugünkü değerini verir.
-RATE = FAİZ_ORANI ## Bir yıllık dönem başına düşen faiz oranını verir.
-RECEIVED = GETİRİ ## Tam olarak yatırılmış bir tahvilin vadesinin bitiminde alınan miktarı verir.
-SLN = DA ## Bir malın bir dönem içindeki doğrusal yıpranmasını verir.
-SYD = YAT ## Bir malın belirli bir dönem için olan amortismanını verir.
-TBILLEQ = HTAHEŞ ## Bir Hazine bonosunun bono eşdeğeri ödemesini verir.
-TBILLPRICE = HTAHDEĞER ## Bir Hazine bonosunun değerini, 10.000.000 liralık nominal değer başına verir.
-TBILLYIELD = HTAHÖDEME ## Bir Hazine bonosunun ödemesini verir.
-VDB = DAB ## Bir malın amortismanını, belirlenmiş ya da kısmi bir dönem için, bir azalan bakiye yöntemi kullanarak verir.
-XIRR = AİÇVERİMORANI ## Dönemsel olması gerekmeyen bir para akışları programı için, iç verim oranını verir.
-XNPV = ANBD ## Dönemsel olması gerekmeyen bir para akışları programı için, bugünkü net değeri verir.
-YIELD = ÖDEME ## Belirli aralıklarla faiz ödeyen bir tahvilin ödemesini verir.
-YIELDDISC = ÖDEMEİND ## İndirimli bir tahvilin yıllık ödemesini verir; örneğin, bir Hazine bonosunun.
-YIELDMAT = ÖDEMEVADE ## Vadesinin bitiminde faiz ödeyen bir tahvilin yıllık ödemesini verir.
-
-
-##
-## Information functions Bilgi fonksiyonları
-##
-CELL = HÜCRE ## Bir hücrenin biçimlendirmesi, konumu ya da içeriği hakkında bilgi verir.
-ERROR.TYPE = HATA.TİPİ ## Bir hata türüne ilişkin sayıları verir.
-INFO = BİLGİ ## Geçerli işletim ortamı hakkında bilgi verir.
-ISBLANK = EBOŞSA ## Değer boşsa, DOĞRU verir.
-ISERR = EHATA ## Değer, #YOK dışındaki bir hata değeriyse, DOĞRU verir.
-ISERROR = EHATALIYSA ## Değer, herhangi bir hata değeriyse, DOĞRU verir.
-ISEVEN = ÇİFTTİR ## Sayı çiftse, DOĞRU verir.
-ISLOGICAL = EMANTIKSALSA ## Değer, mantıksal bir değerse, DOĞRU verir.
-ISNA = EYOKSA ## Değer, #YOK hata değeriyse, DOĞRU verir.
-ISNONTEXT = EMETİNDEĞİLSE ## Değer, metin değilse, DOĞRU verir.
-ISNUMBER = ESAYIYSA ## Değer, bir sayıysa, DOĞRU verir.
-ISODD = TEKTİR ## Sayı tekse, DOĞRU verir.
-ISREF = EREFSE ## Değer bir başvuruysa, DOĞRU verir.
-ISTEXT = EMETİNSE ## Değer bir metinse DOĞRU verir.
-N = N ## Sayıya dönüştürülmüş bir değer verir.
-NA = YOKSAY ## #YOK hata değerini verir.
-TYPE = TİP ## Bir değerin veri türünü belirten bir sayı verir.
-
-
-##
-## Logical functions Mantıksal fonksiyonlar
-##
-AND = VE ## Bütün bağımsız değişkenleri DOĞRU ise, DOĞRU verir.
-FALSE = YANLIŞ ## YANLIŞ mantıksal değerini verir.
-IF = EĞER ## Gerçekleştirilecek bir mantıksal sınama belirtir.
-IFERROR = EĞERHATA ## Formül hatalıysa belirttiğiniz değeri verir; bunun dışındaki durumlarda formülün sonucunu verir.
-NOT = DEĞİL ## Bağımsız değişkeninin mantığını tersine çevirir.
-OR = YADA ## Bağımsız değişkenlerden herhangi birisi DOĞRU ise, DOĞRU verir.
-TRUE = DOĞRU ## DOĞRU mantıksal değerini verir.
-
-
-##
-## Lookup and reference functions Arama ve Başvuru fonksiyonları
-##
-ADDRESS = ADRES ## Bir başvuruyu, çalışma sayfasındaki tek bir hücreye metin olarak verir.
-AREAS = ALANSAY ## Renvoie le nombre de zones dans une référence.
-CHOOSE = ELEMAN ## Değerler listesinden bir değer seçer.
-COLUMN = SÜTUN ## Bir başvurunun sütun sayısını verir.
-COLUMNS = SÜTUNSAY ## Bir başvurudaki sütunların sayısını verir.
-HLOOKUP = YATAYARA ## Bir dizinin en üst satırına bakar ve belirtilen hücrenin değerini verir.
-HYPERLINK = KÖPRÜ ## Bir ağ sunucusunda, bir intranette ya da Internet'te depolanan bir belgeyi açan bir kısayol ya da atlama oluşturur.
-INDEX = İNDİS ## Başvurudan veya diziden bir değer seçmek için, bir dizin kullanır.
-INDIRECT = DOLAYLI ## Metin değeriyle belirtilen bir başvuru verir.
-LOOKUP = ARA ## Bir vektördeki veya dizideki değerleri arar.
-MATCH = KAÇINCI ## Bir başvurudaki veya dizideki değerleri arar.
-OFFSET = KAYDIR ## Verilen bir başvurudan, bir başvuru kaydırmayı verir.
-ROW = SATIR ## Bir başvurunun satır sayısını verir.
-ROWS = SATIRSAY ## Bir başvurudaki satırların sayısını verir.
-RTD = RTD ## COM otomasyonunu destekleyen programdan gerçek zaman verileri alır.
-TRANSPOSE = DEVRİK_DÖNÜŞÜM ## Bir dizinin devrik dönüşümünü verir.
-VLOOKUP = DÜŞEYARA ## Bir dizinin ilk sütununa bakar ve bir hücrenin değerini vermek için satır boyunca hareket eder.
-
-
-##
-## Math and trigonometry functions Matematik ve trigonometri fonksiyonları
-##
-ABS = MUTLAK ## Bir sayının mutlak değerini verir.
-ACOS = ACOS ## Bir sayının ark kosinüsünü verir.
-ACOSH = ACOSH ## Bir sayının ters hiperbolik kosinüsünü verir.
-ASIN = ASİN ## Bir sayının ark sinüsünü verir.
-ASINH = ASİNH ## Bir sayının ters hiperbolik sinüsünü verir.
-ATAN = ATAN ## Bir sayının ark tanjantını verir.
-ATAN2 = ATAN2 ## Ark tanjantı, x- ve y- koordinatlarından verir.
-ATANH = ATANH ## Bir sayının ters hiperbolik tanjantını verir.
-CEILING = TAVANAYUVARLA ## Bir sayıyı, en yakın tamsayıya ya da en yakın katına yuvarlar.
-COMBIN = KOMBİNASYON ## Verilen sayıda öğenin kombinasyon sayısını verir.
-COS = COS ## Bir sayının kosinüsünü verir.
-COSH = COSH ## Bir sayının hiperbolik kosinüsünü verir.
-DEGREES = DERECE ## Radyanları dereceye dönüştürür.
-EVEN = ÇİFT ## Bir sayıyı, en yakın daha büyük çift tamsayıya yuvarlar.
-EXP = ÜS ## e'yi, verilen bir sayının üssüne yükseltilmiş olarak verir.
-FACT = ÇARPINIM ## Bir sayının faktörünü verir.
-FACTDOUBLE = ÇİFTFAKTÖR ## Bir sayının çift çarpınımını verir.
-FLOOR = TABANAYUVARLA ## Bir sayıyı, daha küçük sayıya, sıfıra yakınsayarak yuvarlar.
-GCD = OBEB ## En büyük ortak böleni verir.
-INT = TAMSAYI ## Bir sayıyı aşağıya doğru en yakın tamsayıya yuvarlar.
-LCM = OKEK ## En küçük ortak katı verir.
-LN = LN ## Bir sayının doğal logaritmasını verir.
-LOG = LOG ## Bir sayının, belirtilen bir tabandaki logaritmasını verir.
-LOG10 = LOG10 ## Bir sayının 10 tabanında logaritmasını verir.
-MDETERM = DETERMİNANT ## Bir dizinin dizey determinantını verir.
-MINVERSE = DİZEY_TERS ## Bir dizinin dizey tersini verir.
-MMULT = DÇARP ## İki dizinin dizey çarpımını verir.
-MOD = MODÜLO ## Bölmeden kalanı verir.
-MROUND = KYUVARLA ## İstenen kata yuvarlanmış bir sayı verir.
-MULTINOMIAL = ÇOKTERİMLİ ## Bir sayılar kümesinin çok terimlisini verir.
-ODD = TEK ## Bir sayıyı en yakın daha büyük tek sayıya yuvarlar.
-PI = Pİ ## Pi değerini verir.
-POWER = KUVVET ## Bir üsse yükseltilmiş sayının sonucunu verir.
-PRODUCT = ÇARPIM ## Bağımsız değişkenlerini çarpar.
-QUOTIENT = BÖLÜM ## Bir bölme işleminin tamsayı kısmını verir.
-RADIANS = RADYAN ## Dereceleri radyanlara dönüştürür.
-RAND = S_SAYI_ÜRET ## 0 ile 1 arasında rastgele bir sayı verir.
-RANDBETWEEN = RASTGELEARALIK ## Belirttiğiniz sayılar arasında rastgele bir sayı verir.
-ROMAN = ROMEN ## Bir normal rakamı, metin olarak, romen rakamına çevirir.
-ROUND = YUVARLA ## Bir sayıyı, belirtilen basamak sayısına yuvarlar.
-ROUNDDOWN = AŞAĞIYUVARLA ## Bir sayıyı, daha küçük sayıya, sıfıra yakınsayarak yuvarlar.
-ROUNDUP = YUKARIYUVARLA ## Bir sayıyı daha büyük sayıya, sıfırdan ıraksayarak yuvarlar.
-SERIESSUM = SERİTOPLA ## Bir üs serisinin toplamını, formüle bağlı olarak verir.
-SIGN = İŞARET ## Bir sayının işaretini verir.
-SIN = SİN ## Verilen bir açının sinüsünü verir.
-SINH = SİNH ## Bir sayının hiperbolik sinüsünü verir.
-SQRT = KAREKÖK ## Pozitif bir karekök verir.
-SQRTPI = KAREKÖKPİ ## (* Pi sayısının) kare kökünü verir.
-SUBTOTAL = ALTTOPLAM ## Bir listedeki ya da veritabanındaki bir alt toplamı verir.
-SUM = TOPLA ## Bağımsız değişkenlerini toplar.
-SUMIF = ETOPLA ## Verilen ölçütle belirlenen hücreleri toplar.
-SUMIFS = SUMIFS ## Bir aralıktaki, birden fazla ölçüte uyan hücreleri ekler.
-SUMPRODUCT = TOPLA.ÇARPIM ## İlişkili dizi bileşenlerinin çarpımlarının toplamını verir.
-SUMSQ = TOPKARE ## Bağımsız değişkenlerin karelerinin toplamını verir.
-SUMX2MY2 = TOPX2EY2 ## İki dizideki ilişkili değerlerin farkının toplamını verir.
-SUMX2PY2 = TOPX2AY2 ## İki dizideki ilişkili değerlerin karelerinin toplamının toplamını verir.
-SUMXMY2 = TOPXEY2 ## İki dizideki ilişkili değerlerin farklarının karelerinin toplamını verir.
-TAN = TAN ## Bir sayının tanjantını verir.
-TANH = TANH ## Bir sayının hiperbolik tanjantını verir.
-TRUNC = NSAT ## Bir sayının, tamsayı durumuna gelecek şekilde, fazlalıklarını atar.
-
-
-##
-## Statistical functions İstatistiksel fonksiyonlar
-##
-AVEDEV = ORTSAP ## Veri noktalarının ortalamalarından mutlak sapmalarının ortalamasını verir.
-AVERAGE = ORTALAMA ## Bağımsız değişkenlerinin ortalamasını verir.
-AVERAGEA = ORTALAMAA ## Bağımsız değişkenlerinin, sayılar, metin ve mantıksal değerleri içermek üzere ortalamasını verir.
-AVERAGEIF = EĞERORTALAMA ## Verili ölçütü karşılayan bir aralıktaki bütün hücrelerin ortalamasını (aritmetik ortalama) hesaplar.
-AVERAGEIFS = EĞERLERORTALAMA ## Birden çok ölçüte uyan tüm hücrelerin ortalamasını (aritmetik ortalama) hesaplar.
-BETADIST = BETADAĞ ## Beta birikimli dağılım fonksiyonunu verir.
-BETAINV = BETATERS ## Belirli bir beta dağılımı için birikimli dağılım fonksiyonunun tersini verir.
-BINOMDIST = BİNOMDAĞ ## Tek terimli binom dağılımı olasılığını verir.
-CHIDIST = KİKAREDAĞ ## Kikare dağılımın tek kuyruklu olasılığını verir.
-CHIINV = KİKARETERS ## Kikare dağılımın kuyruklu olasılığının tersini verir.
-CHITEST = KİKARETEST ## Bağımsızlık sınamalarını verir.
-CONFIDENCE = GÜVENİRLİK ## Bir popülasyon ortalaması için güvenirlik aralığını verir.
-CORREL = KORELASYON ## İki veri kümesi arasındaki bağlantı katsayısını verir.
-COUNT = BAĞ_DEĞ_SAY ## Bağımsız değişkenler listesinde kaç tane sayı bulunduğunu sayar.
-COUNTA = BAĞ_DEĞ_DOLU_SAY ## Bağımsız değişkenler listesinde kaç tane değer bulunduğunu sayar.
-COUNTBLANK = BOŞLUKSAY ## Aralıktaki boş hücre sayısını hesaplar.
-COUNTIF = EĞERSAY ## Verilen ölçütlere uyan bir aralık içindeki hücreleri sayar.
-COUNTIFS = ÇOKEĞERSAY ## Birden çok ölçüte uyan bir aralık içindeki hücreleri sayar.
-COVAR = KOVARYANS ## Eşleştirilmiş sapmaların ortalaması olan kovaryansı verir.
-CRITBINOM = KRİTİKBİNOM ## Birikimli binom dağılımının bir ölçüt değerinden küçük veya ölçüt değerine eşit olduğu en küçük değeri verir.
-DEVSQ = SAPKARE ## Sapmaların karelerinin toplamını verir.
-EXPONDIST = ÜSTELDAĞ ## Üstel dağılımı verir.
-FDIST = FDAĞ ## F olasılık dağılımını verir.
-FINV = FTERS ## F olasılık dağılımının tersini verir.
-FISHER = FISHER ## Fisher dönüşümünü verir.
-FISHERINV = FISHERTERS ## Fisher dönüşümünün tersini verir.
-FORECAST = TAHMİN ## Bir doğrusal eğilim boyunca bir değer verir.
-FREQUENCY = SIKLIK ## Bir sıklık dağılımını, dikey bir dizi olarak verir.
-FTEST = FTEST ## Bir F-test'in sonucunu verir.
-GAMMADIST = GAMADAĞ ## Gama dağılımını verir.
-GAMMAINV = GAMATERS ## Gama kümülatif dağılımının tersini verir.
-GAMMALN = GAMALN ## Gama fonksiyonunun (?(x)) doğal logaritmasını verir.
-GEOMEAN = GEOORT ## Geometrik ortayı verir.
-GROWTH = BÜYÜME ## Üstel bir eğilim boyunca değerler verir.
-HARMEAN = HARORT ## Harmonik ortayı verir.
-HYPGEOMDIST = HİPERGEOMDAĞ ## Hipergeometrik dağılımı verir.
-INTERCEPT = KESMENOKTASI ## Doğrusal çakıştırma çizgisinin kesişme noktasını verir.
-KURT = BASIKLIK ## Bir veri kümesinin basıklığını verir.
-LARGE = BÜYÜK ## Bir veri kümesinde k. en büyük değeri verir.
-LINEST = DOT ## Doğrusal bir eğilimin parametrelerini verir.
-LOGEST = LOT ## Üstel bir eğilimin parametrelerini verir.
-LOGINV = LOGTERS ## Bir lognormal dağılımının tersini verir.
-LOGNORMDIST = LOGNORMDAĞ ## Birikimli lognormal dağılımını verir.
-MAX = MAK ## Bir bağımsız değişkenler listesindeki en büyük değeri verir.
-MAXA = MAKA ## Bir bağımsız değişkenler listesindeki, sayılar, metin ve mantıksal değerleri içermek üzere, en büyük değeri verir.
-MEDIAN = ORTANCA ## Belirtilen sayıların orta değerini verir.
-MIN = MİN ## Bir bağımsız değişkenler listesindeki en küçük değeri verir.
-MINA = MİNA ## Bir bağımsız değişkenler listesindeki, sayılar, metin ve mantıksal değerleri de içermek üzere, en küçük değeri verir.
-MODE = ENÇOK_OLAN ## Bir veri kümesindeki en sık rastlanan değeri verir.
-NEGBINOMDIST = NEGBİNOMDAĞ ## Negatif binom dağılımını verir.
-NORMDIST = NORMDAĞ ## Normal birikimli dağılımı verir.
-NORMINV = NORMTERS ## Normal kümülatif dağılımın tersini verir.
-NORMSDIST = NORMSDAĞ ## Standart normal birikimli dağılımı verir.
-NORMSINV = NORMSTERS ## Standart normal birikimli dağılımın tersini verir.
-PEARSON = PEARSON ## Pearson çarpım moment korelasyon katsayısını verir.
-PERCENTILE = YÜZDEBİRLİK ## Bir aralık içerisinde bulunan değerlerin k. frekans toplamını verir.
-PERCENTRANK = YÜZDERANK ## Bir veri kümesindeki bir değerin yüzde mertebesini verir.
-PERMUT = PERMÜTASYON ## Verilen sayıda nesne için permütasyon sayısını verir.
-POISSON = POISSON ## Poisson dağılımını verir.
-PROB = OLASILIK ## Bir aralıktaki değerlerin iki sınır arasında olması olasılığını verir.
-QUARTILE = DÖRTTEBİRLİK ## Bir veri kümesinin dörtte birliğini verir.
-RANK = RANK ## Bir sayılar listesinde bir sayının mertebesini verir.
-RSQ = RKARE ## Pearson çarpım moment korelasyon katsayısının karesini verir.
-SKEW = ÇARPIKLIK ## Bir dağılımın çarpıklığını verir.
-SLOPE = EĞİM ## Doğrusal çakışma çizgisinin eğimini verir.
-SMALL = KÜÇÜK ## Bir veri kümesinde k. en küçük değeri verir.
-STANDARDIZE = STANDARTLAŞTIRMA ## Normalleştirilmiş bir değer verir.
-STDEV = STDSAPMA ## Bir örneğe dayanarak standart sapmayı tahmin eder.
-STDEVA = STDSAPMAA ## Standart sapmayı, sayılar, metin ve mantıksal değerleri içermek üzere, bir örneğe bağlı olarak tahmin eder.
-STDEVP = STDSAPMAS ## Standart sapmayı, tüm popülasyona bağlı olarak hesaplar.
-STDEVPA = STDSAPMASA ## Standart sapmayı, sayılar, metin ve mantıksal değerleri içermek üzere, tüm popülasyona bağlı olarak hesaplar.
-STEYX = STHYX ## Regresyondaki her x için tahmini y değerinin standart hatasını verir.
-TDIST = TDAĞ ## T-dağılımını verir.
-TINV = TTERS ## T-dağılımının tersini verir.
-TREND = EĞİLİM ## Doğrusal bir eğilim boyunca değerler verir.
-TRIMMEAN = KIRPORTALAMA ## Bir veri kümesinin içinin ortalamasını verir.
-TTEST = TTEST ## T-test'le ilişkilendirilmiş olasılığı verir.
-VAR = VAR ## Varyansı, bir örneğe bağlı olarak tahmin eder.
-VARA = VARA ## Varyansı, sayılar, metin ve mantıksal değerleri içermek üzere, bir örneğe bağlı olarak tahmin eder.
-VARP = VARS ## Varyansı, tüm popülasyona dayanarak hesaplar.
-VARPA = VARSA ## Varyansı, sayılar, metin ve mantıksal değerleri içermek üzere, tüm popülasyona bağlı olarak hesaplar.
-WEIBULL = WEIBULL ## Weibull dağılımını hesaplar.
-ZTEST = ZTEST ## Z-testinin tek kuyruklu olasılık değerini hesaplar.
-
-
-##
-## Text functions Metin fonksiyonları
-##
-ASC = ASC ## Bir karakter dizesindeki çift enli (iki bayt) İngilizce harfleri veya katakanayı yarım enli (tek bayt) karakterlerle değiştirir.
-BAHTTEXT = BAHTTEXT ## Sayıyı, ß (baht) para birimi biçimini kullanarak metne dönüştürür.
-CHAR = DAMGA ## Kod sayısıyla belirtilen karakteri verir.
-CLEAN = TEMİZ ## Metindeki bütün yazdırılamaz karakterleri kaldırır.
-CODE = KOD ## Bir metin dizesindeki ilk karakter için sayısal bir kod verir.
-CONCATENATE = BİRLEŞTİR ## Pek çok metin öğesini bir metin öğesi olarak birleştirir.
-DOLLAR = LİRA ## Bir sayıyı YTL (yeni Türk lirası) para birimi biçimini kullanarak metne dönüştürür.
-EXACT = ÖZDEŞ ## İki metin değerinin özdeş olup olmadığını anlamak için, değerleri denetler.
-FIND = BUL ## Bir metin değerini, bir başkasının içinde bulur (büyük küçük harf duyarlıdır).
-FINDB = BULB ## Bir metin değerini, bir başkasının içinde bulur (büyük küçük harf duyarlıdır).
-FIXED = SAYIDÜZENLE ## Bir sayıyı, sabit sayıda ondalıkla, metin olarak biçimlendirir.
-JIS = JIS ## Bir karakter dizesindeki tek enli (tek bayt) İngilizce harfleri veya katakanayı çift enli (iki bayt) karakterlerle değiştirir.
-LEFT = SOL ## Bir metin değerinden en soldaki karakterleri verir.
-LEFTB = SOLB ## Bir metin değerinden en soldaki karakterleri verir.
-LEN = UZUNLUK ## Bir metin dizesindeki karakter sayısını verir.
-LENB = UZUNLUKB ## Bir metin dizesindeki karakter sayısını verir.
-LOWER = KÜÇÜKHARF ## Metni küçük harfe çevirir.
-MID = ORTA ## Bir metin dizesinden belirli sayıda karakteri, belirttiğiniz konumdan başlamak üzere verir.
-MIDB = ORTAB ## Bir metin dizesinden belirli sayıda karakteri, belirttiğiniz konumdan başlamak üzere verir.
-PHONETIC = SES ## Metin dizesinden ses (furigana) karakterlerini ayıklar.
-PROPER = YAZIM.DÜZENİ ## Bir metin değerinin her bir sözcüğünün ilk harfini büyük harfe çevirir.
-REPLACE = DEĞİŞTİR ## Metnin içindeki karakterleri değiştirir.
-REPLACEB = DEĞİŞTİRB ## Metnin içindeki karakterleri değiştirir.
-REPT = YİNELE ## Metni belirtilen sayıda yineler.
-RIGHT = SAĞ ## Bir metin değerinden en sağdaki karakterleri verir.
-RIGHTB = SAĞB ## Bir metin değerinden en sağdaki karakterleri verir.
-SEARCH = BUL ## Bir metin değerini, bir başkasının içinde bulur (büyük küçük harf duyarlı değildir).
-SEARCHB = BULB ## Bir metin değerini, bir başkasının içinde bulur (büyük küçük harf duyarlı değildir).
-SUBSTITUTE = YERİNEKOY ## Bir metin dizesinde, eski metnin yerine yeni metin koyar.
-T = M ## Bağımsız değerlerini metne dönüştürür.
-TEXT = METNEÇEVİR ## Bir sayıyı biçimlendirir ve metne dönüştürür.
-TRIM = KIRP ## Metindeki boşlukları kaldırır.
-UPPER = BÜYÜKHARF ## Metni büyük harfe çevirir.
-VALUE = SAYIYAÇEVİR ## Bir metin bağımsız değişkenini sayıya dönüştürür.
+##
+## PhpSpreadsheet
+##
+## Data in this file derived from https://www.excel-function-translation.com/
+##
+##
+
+
+##
+## Add-in and Automation functions Eklenti ve Otomasyon fonksiyonları
+##
+GETPIVOTDATA = ÖZETVERİAL ## Bir Özet Tablo raporunda saklanan verileri verir.
+
+
+##
+## Cube functions Küp işlevleri
+##
+CUBEKPIMEMBER = KÜPKPIÜYE ## Kilit performans göstergesi (KPI-Key Performance Indicator) adını, özelliğini ve ölçüsünü verir ve hücredeki ad ve özelliği gösterir. KPI, bir kurumun performansını izlemek için kullanılan aylık brüt kâr ya da üç aylık çalışan giriş çıkışları gibi ölçülebilen bir birimdir.
+CUBEMEMBER = KÜPÜYE ## Bir küp hiyerarşisinde bir üyeyi veya kaydı verir. Üye veya kaydın küpte varolduğunu doğrulamak için kullanılır.
+CUBEMEMBERPROPERTY = KÜPÜYEÖZELLİĞİ ## Bir küpte bir üyenin özelliğinin değerini verir. Küp içinde üye adının varlığını doğrulamak ve bu üyenin belli özelliklerini getirmek için kullanılır.
+CUBERANKEDMEMBER = KÜPÜYESIRASI ## Bir küme içindeki üyenin derecesini veya kaçıncı olduğunu verir. En iyi satış elemanı, veya en iyi on öğrenci gibi bir kümedeki bir veya daha fazla öğeyi getirmek için kullanılır.
+CUBESET = KÜPKÜME ## Kümeyi oluşturan ve ardından bu kümeyi Microsoft Office Excel'e getiren sunucudaki küpe küme ifadelerini göndererek hesaplanan üye veya kayıt kümesini tanımlar.
+CUBESETCOUNT = KÜPKÜMESAY ## Bir kümedeki öğelerin sayısını getirir.
+CUBEVALUE = KÜPDEĞER ## Bir küpten toplam değeri getirir.
+
+
+##
+## Database functions Veritabanı işlevleri
+##
+DAVERAGE = VSEÇORT ## Seçili veritabanı girdilerinin ortalamasını verir.
+DCOUNT = VSEÇSAY ## Veritabanında sayı içeren hücre sayısını hesaplar.
+DCOUNTA = VSEÇSAYDOLU ## Veritabanındaki boş olmayan hücreleri sayar.
+DGET = VAL ## Veritabanından, belirtilen ölçütlerle eşleşen tek bir rapor çıkarır.
+DMAX = VSEÇMAK ## Seçili veritabanı girişlerinin en yüksek değerini verir.
+DMIN = VSEÇMİN ## Seçili veritabanı girişlerinin en düşük değerini verir.
+DPRODUCT = VSEÇÇARP ## Kayıtların belli bir alanında bulunan, bir veritabanındaki ölçütlerle eşleşen değerleri çarpar.
+DSTDEV = VSEÇSTDSAPMA ## Seçili veritabanı girişlerinden oluşan bir örneğe dayanarak, standart sapmayı tahmin eder.
+DSTDEVP = VSEÇSTDSAPMAS ## Standart sapmayı, seçili veritabanı girişlerinin tüm popülasyonunu esas alarak hesaplar.
+DSUM = VSEÇTOPLA ## Kayıtların alan sütununda bulunan, ölçütle eşleşen sayıları toplar.
+DVAR = VSEÇVAR ## Seçili veritabanı girişlerinden oluşan bir örneği esas alarak farkı tahmin eder.
+DVARP = VSEÇVARS ## Seçili veritabanı girişlerinin tüm popülasyonunu esas alarak farkı hesaplar.
+
+
+##
+## Date and time functions Tarih ve saat işlevleri
+##
+DATE = TARİH ## Belirli bir tarihin seri numarasını verir.
+DATEVALUE = TARİHSAYISI ## Metin biçimindeki bir tarihi seri numarasına dönüştürür.
+DAY = GÜN ## Seri numarasını, ayın bir gününe dönüştürür.
+DAYS360 = GÜN360 ## İki tarih arasındaki gün sayısını, 360 günlük yılı esas alarak hesaplar.
+EDATE = SERİTARİH ## Başlangıç tarihinden itibaren, belirtilen ay sayısından önce veya sonraki tarihin seri numarasını verir.
+EOMONTH = SERİAY ## Belirtilen sayıda ay önce veya sonraki ayın son gününün seri numarasını verir.
+HOUR = SAAT ## Bir seri numarasını saate dönüştürür.
+MINUTE = DAKİKA ## Bir seri numarasını dakikaya dönüştürür.
+MONTH = AY ## Bir seri numarasını aya dönüştürür.
+NETWORKDAYS = TAMİŞGÜNÜ ## İki tarih arasındaki tam çalışma günlerinin sayısını verir.
+NOW = ŞİMDİ ## Geçerli tarihin ve saatin seri numarasını verir.
+SECOND = SANİYE ## Bir seri numarasını saniyeye dönüştürür.
+TIME = ZAMAN ## Belirli bir zamanın seri numarasını verir.
+TIMEVALUE = ZAMANSAYISI ## Metin biçimindeki zamanı seri numarasına dönüştürür.
+TODAY = BUGÜN ## Bugünün tarihini seri numarasına dönüştürür.
+WEEKDAY = HAFTANINGÜNÜ ## Bir seri numarasını, haftanın gününe dönüştürür.
+WEEKNUM = HAFTASAY ## Dizisel değerini, haftanın yıl içinde bulunduğu konumu sayısal olarak gösteren sayıya dönüştürür.
+WORKDAY = İŞGÜNÜ ## Belirtilen sayıda çalışma günü öncesinin ya da sonrasının tarihinin seri numarasını verir.
+YEAR = YIL ## Bir seri numarasını yıla dönüştürür.
+YEARFRAC = YILORAN ## Başlangıç_tarihi ve bitiş_tarihi arasındaki tam günleri gösteren yıl kesrini verir.
+
+
+##
+## Engineering functions Mühendislik işlevleri
+##
+BESSELI = BESSELI ## Değiştirilmiş Bessel fonksiyonu In(x)'i verir.
+BESSELJ = BESSELJ ## Bessel fonksiyonu Jn(x)'i verir.
+BESSELK = BESSELK ## Değiştirilmiş Bessel fonksiyonu Kn(x)'i verir.
+BESSELY = BESSELY ## Bessel fonksiyonu Yn(x)'i verir.
+BIN2DEC = BIN2DEC ## İkili bir sayıyı, ondalık sayıya dönüştürür.
+BIN2HEX = BIN2HEX ## İkili bir sayıyı, onaltılıya dönüştürür.
+BIN2OCT = BIN2OCT ## İkili bir sayıyı, sekizliye dönüştürür.
+COMPLEX = KARMAŞIK ## Gerçek ve sanal katsayıları, karmaşık sayıya dönüştürür.
+CONVERT = ÇEVİR ## Bir sayıyı, bir ölçüm sisteminden bir başka ölçüm sistemine dönüştürür.
+DEC2BIN = DEC2BIN ## Ondalık bir sayıyı, ikiliye dönüştürür.
+DEC2HEX = DEC2HEX ## Ondalık bir sayıyı, onaltılıya dönüştürür.
+DEC2OCT = DEC2OCT ## Ondalık bir sayıyı sekizliğe dönüştürür.
+DELTA = DELTA ## İki değerin eşit olup olmadığını sınar.
+ERF = HATAİŞLEV ## Hata işlevini verir.
+ERFC = TÜMHATAİŞLEV ## Tümleyici hata işlevini verir.
+GESTEP = BESINIR ## Bir sayının eşik değerinden büyük olup olmadığını sınar.
+HEX2BIN = HEX2BIN ## Onaltılı bir sayıyı ikiliye dönüştürür.
+HEX2DEC = HEX2DEC ## Onaltılı bir sayıyı ondalığa dönüştürür.
+HEX2OCT = HEX2OCT ## Onaltılı bir sayıyı sekizliğe dönüştürür.
+IMABS = SANMUTLAK ## Karmaşık bir sayının mutlak değerini (modül) verir.
+IMAGINARY = SANAL ## Karmaşık bir sayının sanal katsayısını verir.
+IMARGUMENT = SANBAĞ_DEĞİŞKEN ## Radyanlarla belirtilen bir açı olan teta bağımsız değişkenini verir.
+IMCONJUGATE = SANEŞLENEK ## Karmaşık bir sayının karmaşık eşleniğini verir.
+IMCOS = SANCOS ## Karmaşık bir sayının kosinüsünü verir.
+IMDIV = SANBÖL ## İki karmaşık sayının bölümünü verir.
+IMEXP = SANÜS ## Karmaşık bir sayının üssünü verir.
+IMLN = SANLN ## Karmaşık bir sayının doğal logaritmasını verir.
+IMLOG10 = SANLOG10 ## Karmaşık bir sayının, 10 tabanında logaritmasını verir.
+IMLOG2 = SANLOG2 ## Karmaşık bir sayının 2 tabanında logaritmasını verir.
+IMPOWER = SANÜSSÜ ## Karmaşık bir sayıyı, bir tamsayı üssüne yükseltilmiş olarak verir.
+IMPRODUCT = SANÇARP ## Karmaşık sayıların çarpımını verir.
+IMREAL = SANGERÇEK ## Karmaşık bir sayının, gerçek katsayısını verir.
+IMSIN = SANSIN ## Karmaşık bir sayının sinüsünü verir.
+IMSQRT = SANKAREKÖK ## Karmaşık bir sayının karekökünü verir.
+IMSUB = SANÇIKAR ## İki karmaşık sayının farkını verir.
+IMSUM = SANTOPLA ## Karmaşık sayıların toplamını verir.
+OCT2BIN = OCT2BIN ## Sekizli bir sayıyı ikiliye dönüştürür.
+OCT2DEC = OCT2DEC ## Sekizli bir sayıyı ondalığa dönüştürür.
+OCT2HEX = OCT2HEX ## Sekizli bir sayıyı onaltılıya dönüştürür.
+
+
+##
+## Financial functions Finansal fonksiyonlar
+##
+ACCRINT = GERÇEKFAİZ ## Dönemsel faiz ödeyen hisse senedine ilişkin tahakkuk eden faizi getirir.
+ACCRINTM = GERÇEKFAİZV ## Vadesinde ödeme yapan bir tahvilin tahakkuk etmiş faizini verir.
+AMORDEGRC = AMORDEGRC ## Yıpranma katsayısı kullanarak her hesap döneminin değer kaybını verir.
+AMORLINC = AMORLINC ## Her hesap dönemi içindeki yıpranmayı verir.
+COUPDAYBS = KUPONGÜNBD ## Kupon süresinin başlangıcından alış tarihine kadar olan süredeki gün sayısını verir.
+COUPDAYS = KUPONGÜN ## Kupon süresindeki, gün sayısını, alış tarihini de içermek üzere, verir.
+COUPDAYSNC = KUPONGÜNDSK ## Alış tarihinden bir sonraki kupon tarihine kadar olan gün sayısını verir.
+COUPNCD = KUPONGÜNSKT ## Alış tarihinden bir sonraki kupon tarihini verir.
+COUPNUM = KUPONSAYI ## Alış tarihiyle vade tarihi arasında ödenecek kuponların sayısını verir.
+COUPPCD = KUPONGÜNÖKT ## Alış tarihinden bir önceki kupon tarihini verir.
+CUMIPMT = AİÇVERİMORANI ## İki dönem arasında ödenen kümülatif faizi verir.
+CUMPRINC = ANA_PARA_ÖDEMESİ ## İki dönem arasında bir borç üzerine ödenen birikimli temeli verir.
+DB = AZALANBAKİYE ## Bir malın belirtilen bir süre içindeki yıpranmasını, sabit azalan bakiye yöntemini kullanarak verir.
+DDB = ÇİFTAZALANBAKİYE ## Bir malın belirtilen bir süre içindeki yıpranmasını, çift azalan bakiye yöntemi ya da sizin belirttiğiniz başka bir yöntemi kullanarak verir.
+DISC = İNDİRİM ## Bir tahvilin indirim oranını verir.
+DOLLARDE = LİRAON ## Kesir olarak tanımlanmış lira fiyatını, ondalık sayı olarak tanımlanmış lira fiyatına dönüştürür.
+DOLLARFR = LİRAKES ## Ondalık sayı olarak tanımlanmış lira fiyatını, kesir olarak tanımlanmış lira fiyatına dönüştürür.
+DURATION = SÜRE ## Belli aralıklarla faiz ödemesi yapan bir tahvilin yıllık süresini verir.
+EFFECT = ETKİN ## Efektif yıllık faiz oranını verir.
+FV = ANBD ## Bir yatırımın gelecekteki değerini verir.
+FVSCHEDULE = GDPROGRAM ## Bir seri birleşik faiz oranı uyguladıktan sonra, bir başlangıçtaki anaparanın gelecekteki değerini verir.
+INTRATE = FAİZORANI ## Tam olarak yatırım yapılmış bir tahvilin faiz oranını verir.
+IPMT = FAİZTUTARI ## Bir yatırımın verilen bir süre için faiz ödemesini verir.
+IRR = İÇ_VERİM_ORANI ## Bir para akışı serisi için, iç verim oranını verir.
+ISPMT = ISPMT ## Yatırımın belirli bir dönemi boyunca ödenen faizi hesaplar.
+MDURATION = MSÜRE ## Varsayılan par değeri 10.000.000 lira olan bir tahvil için Macauley değiştirilmiş süreyi verir.
+MIRR = D_İÇ_VERİM_ORANI ## Pozitif ve negatif para akışlarının farklı oranlarda finanse edildiği durumlarda, iç verim oranını verir.
+NOMINAL = NOMİNAL ## Yıllık nominal faiz oranını verir.
+NPER = DÖNEM_SAYISI ## Bir yatırımın dönem sayısını verir.
+NPV = NBD ## Bir yatırımın bugünkü net değerini, bir dönemsel para akışları serisine ve bir indirim oranına bağlı olarak verir.
+ODDFPRICE = TEKYDEĞER ## Tek bir ilk dönemi olan bir tahvilin değerini, her 100.000.000 lirada bir verir.
+ODDFYIELD = TEKYÖDEME ## Tek bir ilk dönemi olan bir tahvilin ödemesini verir.
+ODDLPRICE = TEKSDEĞER ## Tek bir son dönemi olan bir tahvilin fiyatını her 10.000.000 lirada bir verir.
+ODDLYIELD = TEKSÖDEME ## Tek bir son dönemi olan bir tahvilin ödemesini verir.
+PMT = DEVRESEL_ÖDEME ## Bir yıllık dönemsel ödemeyi verir.
+PPMT = ANA_PARA_ÖDEMESİ ## Verilen bir süre için, bir yatırımın anaparasına dayanan ödemeyi verir.
+PRICE = DEĞER ## Dönemsel faiz ödeyen bir tahvilin fiyatını 10.000.00 liralık değer başına verir.
+PRICEDISC = DEĞERİND ## İndirimli bir tahvilin fiyatını 10.000.000 liralık nominal değer başına verir.
+PRICEMAT = DEĞERVADE ## Faizini vade sonunda ödeyen bir tahvilin fiyatını 10.000.000 nominal değer başına verir.
+PV = BD ## Bir yatırımın bugünkü değerini verir.
+RATE = FAİZ_ORANI ## Bir yıllık dönem başına düşen faiz oranını verir.
+RECEIVED = GETİRİ ## Tam olarak yatırılmış bir tahvilin vadesinin bitiminde alınan miktarı verir.
+SLN = DA ## Bir malın bir dönem içindeki doğrusal yıpranmasını verir.
+SYD = YAT ## Bir malın belirli bir dönem için olan amortismanını verir.
+TBILLEQ = HTAHEŞ ## Bir Hazine bonosunun bono eşdeğeri ödemesini verir.
+TBILLPRICE = HTAHDEĞER ## Bir Hazine bonosunun değerini, 10.000.000 liralık nominal değer başına verir.
+TBILLYIELD = HTAHÖDEME ## Bir Hazine bonosunun ödemesini verir.
+VDB = DAB ## Bir malın amortismanını, belirlenmiş ya da kısmi bir dönem için, bir azalan bakiye yöntemi kullanarak verir.
+XIRR = AİÇVERİMORANI ## Dönemsel olması gerekmeyen bir para akışları programı için, iç verim oranını verir.
+XNPV = ANBD ## Dönemsel olması gerekmeyen bir para akışları programı için, bugünkü net değeri verir.
+YIELD = ÖDEME ## Belirli aralıklarla faiz ödeyen bir tahvilin ödemesini verir.
+YIELDDISC = ÖDEMEİND ## İndirimli bir tahvilin yıllık ödemesini verir; örneğin, bir Hazine bonosunun.
+YIELDMAT = ÖDEMEVADE ## Vadesinin bitiminde faiz ödeyen bir tahvilin yıllık ödemesini verir.
+
+
+##
+## Information functions Bilgi fonksiyonları
+##
+CELL = HÜCRE ## Bir hücrenin biçimlendirmesi, konumu ya da içeriği hakkında bilgi verir.
+ERROR.TYPE = HATA.TİPİ ## Bir hata türüne ilişkin sayıları verir.
+INFO = BİLGİ ## Geçerli işletim ortamı hakkında bilgi verir.
+ISBLANK = EBOŞSA ## Değer boşsa, DOĞRU verir.
+ISERR = EHATA ## Değer, #YOK dışındaki bir hata değeriyse, DOĞRU verir.
+ISERROR = EHATALIYSA ## Değer, herhangi bir hata değeriyse, DOĞRU verir.
+ISEVEN = ÇİFTTİR ## Sayı çiftse, DOĞRU verir.
+ISLOGICAL = EMANTIKSALSA ## Değer, mantıksal bir değerse, DOĞRU verir.
+ISNA = EYOKSA ## Değer, #YOK hata değeriyse, DOĞRU verir.
+ISNONTEXT = EMETİNDEĞİLSE ## Değer, metin değilse, DOĞRU verir.
+ISNUMBER = ESAYIYSA ## Değer, bir sayıysa, DOĞRU verir.
+ISODD = TEKTİR ## Sayı tekse, DOĞRU verir.
+ISREF = EREFSE ## Değer bir başvuruysa, DOĞRU verir.
+ISTEXT = EMETİNSE ## Değer bir metinse DOĞRU verir.
+N = N ## Sayıya dönüştürülmüş bir değer verir.
+NA = YOKSAY ## #YOK hata değerini verir.
+TYPE = TİP ## Bir değerin veri türünü belirten bir sayı verir.
+
+
+##
+## Logical functions Mantıksal fonksiyonlar
+##
+AND = VE ## Bütün bağımsız değişkenleri DOĞRU ise, DOĞRU verir.
+FALSE = YANLIŞ ## YANLIŞ mantıksal değerini verir.
+IF = EĞER ## Gerçekleştirilecek bir mantıksal sınama belirtir.
+IFERROR = EĞERHATA ## Formül hatalıysa belirttiğiniz değeri verir; bunun dışındaki durumlarda formülün sonucunu verir.
+NOT = DEĞİL ## Bağımsız değişkeninin mantığını tersine çevirir.
+OR = YADA ## Bağımsız değişkenlerden herhangi birisi DOĞRU ise, DOĞRU verir.
+TRUE = DOĞRU ## DOĞRU mantıksal değerini verir.
+
+
+##
+## Lookup and reference functions Arama ve Başvuru fonksiyonları
+##
+ADDRESS = ADRES ## Bir başvuruyu, çalışma sayfasındaki tek bir hücreye metin olarak verir.
+AREAS = ALANSAY ## Renvoie le nombre de zones dans une référence.
+CHOOSE = ELEMAN ## Değerler listesinden bir değer seçer.
+COLUMN = SÜTUN ## Bir başvurunun sütun sayısını verir.
+COLUMNS = SÜTUNSAY ## Bir başvurudaki sütunların sayısını verir.
+HLOOKUP = YATAYARA ## Bir dizinin en üst satırına bakar ve belirtilen hücrenin değerini verir.
+HYPERLINK = KÖPRÜ ## Bir ağ sunucusunda, bir intranette ya da Internet'te depolanan bir belgeyi açan bir kısayol ya da atlama oluşturur.
+INDEX = İNDİS ## Başvurudan veya diziden bir değer seçmek için, bir dizin kullanır.
+INDIRECT = DOLAYLI ## Metin değeriyle belirtilen bir başvuru verir.
+LOOKUP = ARA ## Bir vektördeki veya dizideki değerleri arar.
+MATCH = KAÇINCI ## Bir başvurudaki veya dizideki değerleri arar.
+OFFSET = KAYDIR ## Verilen bir başvurudan, bir başvuru kaydırmayı verir.
+ROW = SATIR ## Bir başvurunun satır sayısını verir.
+ROWS = SATIRSAY ## Bir başvurudaki satırların sayısını verir.
+RTD = RTD ## COM otomasyonunu destekleyen programdan gerçek zaman verileri alır.
+TRANSPOSE = DEVRİK_DÖNÜŞÜM ## Bir dizinin devrik dönüşümünü verir.
+VLOOKUP = DÜŞEYARA ## Bir dizinin ilk sütununa bakar ve bir hücrenin değerini vermek için satır boyunca hareket eder.
+
+
+##
+## Math and trigonometry functions Matematik ve trigonometri fonksiyonları
+##
+ABS = MUTLAK ## Bir sayının mutlak değerini verir.
+ACOS = ACOS ## Bir sayının ark kosinüsünü verir.
+ACOSH = ACOSH ## Bir sayının ters hiperbolik kosinüsünü verir.
+ASIN = ASİN ## Bir sayının ark sinüsünü verir.
+ASINH = ASİNH ## Bir sayının ters hiperbolik sinüsünü verir.
+ATAN = ATAN ## Bir sayının ark tanjantını verir.
+ATAN2 = ATAN2 ## Ark tanjantı, x- ve y- koordinatlarından verir.
+ATANH = ATANH ## Bir sayının ters hiperbolik tanjantını verir.
+CEILING = TAVANAYUVARLA ## Bir sayıyı, en yakın tamsayıya ya da en yakın katına yuvarlar.
+COMBIN = KOMBİNASYON ## Verilen sayıda öğenin kombinasyon sayısını verir.
+COS = COS ## Bir sayının kosinüsünü verir.
+COSH = COSH ## Bir sayının hiperbolik kosinüsünü verir.
+DEGREES = DERECE ## Radyanları dereceye dönüştürür.
+EVEN = ÇİFT ## Bir sayıyı, en yakın daha büyük çift tamsayıya yuvarlar.
+EXP = ÜS ## e'yi, verilen bir sayının üssüne yükseltilmiş olarak verir.
+FACT = ÇARPINIM ## Bir sayının faktörünü verir.
+FACTDOUBLE = ÇİFTFAKTÖR ## Bir sayının çift çarpınımını verir.
+FLOOR = TABANAYUVARLA ## Bir sayıyı, daha küçük sayıya, sıfıra yakınsayarak yuvarlar.
+GCD = OBEB ## En büyük ortak böleni verir.
+INT = TAMSAYI ## Bir sayıyı aşağıya doğru en yakın tamsayıya yuvarlar.
+LCM = OKEK ## En küçük ortak katı verir.
+LN = LN ## Bir sayının doğal logaritmasını verir.
+LOG = LOG ## Bir sayının, belirtilen bir tabandaki logaritmasını verir.
+LOG10 = LOG10 ## Bir sayının 10 tabanında logaritmasını verir.
+MDETERM = DETERMİNANT ## Bir dizinin dizey determinantını verir.
+MINVERSE = DİZEY_TERS ## Bir dizinin dizey tersini verir.
+MMULT = DÇARP ## İki dizinin dizey çarpımını verir.
+MOD = MODÜLO ## Bölmeden kalanı verir.
+MROUND = KYUVARLA ## İstenen kata yuvarlanmış bir sayı verir.
+MULTINOMIAL = ÇOKTERİMLİ ## Bir sayılar kümesinin çok terimlisini verir.
+ODD = TEK ## Bir sayıyı en yakın daha büyük tek sayıya yuvarlar.
+PI = Pİ ## Pi değerini verir.
+POWER = KUVVET ## Bir üsse yükseltilmiş sayının sonucunu verir.
+PRODUCT = ÇARPIM ## Bağımsız değişkenlerini çarpar.
+QUOTIENT = BÖLÜM ## Bir bölme işleminin tamsayı kısmını verir.
+RADIANS = RADYAN ## Dereceleri radyanlara dönüştürür.
+RAND = S_SAYI_ÜRET ## 0 ile 1 arasında rastgele bir sayı verir.
+RANDBETWEEN = RASTGELEARALIK ## Belirttiğiniz sayılar arasında rastgele bir sayı verir.
+ROMAN = ROMEN ## Bir normal rakamı, metin olarak, romen rakamına çevirir.
+ROUND = YUVARLA ## Bir sayıyı, belirtilen basamak sayısına yuvarlar.
+ROUNDDOWN = AŞAĞIYUVARLA ## Bir sayıyı, daha küçük sayıya, sıfıra yakınsayarak yuvarlar.
+ROUNDUP = YUKARIYUVARLA ## Bir sayıyı daha büyük sayıya, sıfırdan ıraksayarak yuvarlar.
+SERIESSUM = SERİTOPLA ## Bir üs serisinin toplamını, formüle bağlı olarak verir.
+SIGN = İŞARET ## Bir sayının işaretini verir.
+SIN = SİN ## Verilen bir açının sinüsünü verir.
+SINH = SİNH ## Bir sayının hiperbolik sinüsünü verir.
+SQRT = KAREKÖK ## Pozitif bir karekök verir.
+SQRTPI = KAREKÖKPİ ## (* Pi sayısının) kare kökünü verir.
+SUBTOTAL = ALTTOPLAM ## Bir listedeki ya da veritabanındaki bir alt toplamı verir.
+SUM = TOPLA ## Bağımsız değişkenlerini toplar.
+SUMIF = ETOPLA ## Verilen ölçütle belirlenen hücreleri toplar.
+SUMIFS = SUMIFS ## Bir aralıktaki, birden fazla ölçüte uyan hücreleri ekler.
+SUMPRODUCT = TOPLA.ÇARPIM ## İlişkili dizi bileşenlerinin çarpımlarının toplamını verir.
+SUMSQ = TOPKARE ## Bağımsız değişkenlerin karelerinin toplamını verir.
+SUMX2MY2 = TOPX2EY2 ## İki dizideki ilişkili değerlerin farkının toplamını verir.
+SUMX2PY2 = TOPX2AY2 ## İki dizideki ilişkili değerlerin karelerinin toplamının toplamını verir.
+SUMXMY2 = TOPXEY2 ## İki dizideki ilişkili değerlerin farklarının karelerinin toplamını verir.
+TAN = TAN ## Bir sayının tanjantını verir.
+TANH = TANH ## Bir sayının hiperbolik tanjantını verir.
+TRUNC = NSAT ## Bir sayının, tamsayı durumuna gelecek şekilde, fazlalıklarını atar.
+
+
+##
+## Statistical functions İstatistiksel fonksiyonlar
+##
+AVEDEV = ORTSAP ## Veri noktalarının ortalamalarından mutlak sapmalarının ortalamasını verir.
+AVERAGE = ORTALAMA ## Bağımsız değişkenlerinin ortalamasını verir.
+AVERAGEA = ORTALAMAA ## Bağımsız değişkenlerinin, sayılar, metin ve mantıksal değerleri içermek üzere ortalamasını verir.
+AVERAGEIF = EĞERORTALAMA ## Verili ölçütü karşılayan bir aralıktaki bütün hücrelerin ortalamasını (aritmetik ortalama) hesaplar.
+AVERAGEIFS = EĞERLERORTALAMA ## Birden çok ölçüte uyan tüm hücrelerin ortalamasını (aritmetik ortalama) hesaplar.
+BETADIST = BETADAĞ ## Beta birikimli dağılım fonksiyonunu verir.
+BETAINV = BETATERS ## Belirli bir beta dağılımı için birikimli dağılım fonksiyonunun tersini verir.
+BINOMDIST = BİNOMDAĞ ## Tek terimli binom dağılımı olasılığını verir.
+CHIDIST = KİKAREDAĞ ## Kikare dağılımın tek kuyruklu olasılığını verir.
+CHIINV = KİKARETERS ## Kikare dağılımın kuyruklu olasılığının tersini verir.
+CHITEST = KİKARETEST ## Bağımsızlık sınamalarını verir.
+CONFIDENCE = GÜVENİRLİK ## Bir popülasyon ortalaması için güvenirlik aralığını verir.
+CORREL = KORELASYON ## İki veri kümesi arasındaki bağlantı katsayısını verir.
+COUNT = BAĞ_DEĞ_SAY ## Bağımsız değişkenler listesinde kaç tane sayı bulunduğunu sayar.
+COUNTA = BAĞ_DEĞ_DOLU_SAY ## Bağımsız değişkenler listesinde kaç tane değer bulunduğunu sayar.
+COUNTBLANK = BOŞLUKSAY ## Aralıktaki boş hücre sayısını hesaplar.
+COUNTIF = EĞERSAY ## Verilen ölçütlere uyan bir aralık içindeki hücreleri sayar.
+COUNTIFS = ÇOKEĞERSAY ## Birden çok ölçüte uyan bir aralık içindeki hücreleri sayar.
+COVAR = KOVARYANS ## Eşleştirilmiş sapmaların ortalaması olan kovaryansı verir.
+CRITBINOM = KRİTİKBİNOM ## Birikimli binom dağılımının bir ölçüt değerinden küçük veya ölçüt değerine eşit olduğu en küçük değeri verir.
+DEVSQ = SAPKARE ## Sapmaların karelerinin toplamını verir.
+EXPONDIST = ÜSTELDAĞ ## Üstel dağılımı verir.
+FDIST = FDAĞ ## F olasılık dağılımını verir.
+FINV = FTERS ## F olasılık dağılımının tersini verir.
+FISHER = FISHER ## Fisher dönüşümünü verir.
+FISHERINV = FISHERTERS ## Fisher dönüşümünün tersini verir.
+FORECAST = TAHMİN ## Bir doğrusal eğilim boyunca bir değer verir.
+FREQUENCY = SIKLIK ## Bir sıklık dağılımını, dikey bir dizi olarak verir.
+FTEST = FTEST ## Bir F-test'in sonucunu verir.
+GAMMADIST = GAMADAĞ ## Gama dağılımını verir.
+GAMMAINV = GAMATERS ## Gama kümülatif dağılımının tersini verir.
+GAMMALN = GAMALN ## Gama fonksiyonunun (?(x)) doğal logaritmasını verir.
+GEOMEAN = GEOORT ## Geometrik ortayı verir.
+GROWTH = BÜYÜME ## Üstel bir eğilim boyunca değerler verir.
+HARMEAN = HARORT ## Harmonik ortayı verir.
+HYPGEOMDIST = HİPERGEOMDAĞ ## Hipergeometrik dağılımı verir.
+INTERCEPT = KESMENOKTASI ## Doğrusal çakıştırma çizgisinin kesişme noktasını verir.
+KURT = BASIKLIK ## Bir veri kümesinin basıklığını verir.
+LARGE = BÜYÜK ## Bir veri kümesinde k. en büyük değeri verir.
+LINEST = DOT ## Doğrusal bir eğilimin parametrelerini verir.
+LOGEST = LOT ## Üstel bir eğilimin parametrelerini verir.
+LOGINV = LOGTERS ## Bir lognormal dağılımının tersini verir.
+LOGNORMDIST = LOGNORMDAĞ ## Birikimli lognormal dağılımını verir.
+MAX = MAK ## Bir bağımsız değişkenler listesindeki en büyük değeri verir.
+MAXA = MAKA ## Bir bağımsız değişkenler listesindeki, sayılar, metin ve mantıksal değerleri içermek üzere, en büyük değeri verir.
+MEDIAN = ORTANCA ## Belirtilen sayıların orta değerini verir.
+MIN = MİN ## Bir bağımsız değişkenler listesindeki en küçük değeri verir.
+MINA = MİNA ## Bir bağımsız değişkenler listesindeki, sayılar, metin ve mantıksal değerleri de içermek üzere, en küçük değeri verir.
+MODE = ENÇOK_OLAN ## Bir veri kümesindeki en sık rastlanan değeri verir.
+NEGBINOMDIST = NEGBİNOMDAĞ ## Negatif binom dağılımını verir.
+NORMDIST = NORMDAĞ ## Normal birikimli dağılımı verir.
+NORMINV = NORMTERS ## Normal kümülatif dağılımın tersini verir.
+NORMSDIST = NORMSDAĞ ## Standart normal birikimli dağılımı verir.
+NORMSINV = NORMSTERS ## Standart normal birikimli dağılımın tersini verir.
+PEARSON = PEARSON ## Pearson çarpım moment korelasyon katsayısını verir.
+PERCENTILE = YÜZDEBİRLİK ## Bir aralık içerisinde bulunan değerlerin k. frekans toplamını verir.
+PERCENTRANK = YÜZDERANK ## Bir veri kümesindeki bir değerin yüzde mertebesini verir.
+PERMUT = PERMÜTASYON ## Verilen sayıda nesne için permütasyon sayısını verir.
+POISSON = POISSON ## Poisson dağılımını verir.
+PROB = OLASILIK ## Bir aralıktaki değerlerin iki sınır arasında olması olasılığını verir.
+QUARTILE = DÖRTTEBİRLİK ## Bir veri kümesinin dörtte birliğini verir.
+RANK = RANK ## Bir sayılar listesinde bir sayının mertebesini verir.
+RSQ = RKARE ## Pearson çarpım moment korelasyon katsayısının karesini verir.
+SKEW = ÇARPIKLIK ## Bir dağılımın çarpıklığını verir.
+SLOPE = EĞİM ## Doğrusal çakışma çizgisinin eğimini verir.
+SMALL = KÜÇÜK ## Bir veri kümesinde k. en küçük değeri verir.
+STANDARDIZE = STANDARTLAŞTIRMA ## Normalleştirilmiş bir değer verir.
+STDEV = STDSAPMA ## Bir örneğe dayanarak standart sapmayı tahmin eder.
+STDEVA = STDSAPMAA ## Standart sapmayı, sayılar, metin ve mantıksal değerleri içermek üzere, bir örneğe bağlı olarak tahmin eder.
+STDEVP = STDSAPMAS ## Standart sapmayı, tüm popülasyona bağlı olarak hesaplar.
+STDEVPA = STDSAPMASA ## Standart sapmayı, sayılar, metin ve mantıksal değerleri içermek üzere, tüm popülasyona bağlı olarak hesaplar.
+STEYX = STHYX ## Regresyondaki her x için tahmini y değerinin standart hatasını verir.
+TDIST = TDAĞ ## T-dağılımını verir.
+TINV = TTERS ## T-dağılımının tersini verir.
+TREND = EĞİLİM ## Doğrusal bir eğilim boyunca değerler verir.
+TRIMMEAN = KIRPORTALAMA ## Bir veri kümesinin içinin ortalamasını verir.
+TTEST = TTEST ## T-test'le ilişkilendirilmiş olasılığı verir.
+VAR = VAR ## Varyansı, bir örneğe bağlı olarak tahmin eder.
+VARA = VARA ## Varyansı, sayılar, metin ve mantıksal değerleri içermek üzere, bir örneğe bağlı olarak tahmin eder.
+VARP = VARS ## Varyansı, tüm popülasyona dayanarak hesaplar.
+VARPA = VARSA ## Varyansı, sayılar, metin ve mantıksal değerleri içermek üzere, tüm popülasyona bağlı olarak hesaplar.
+WEIBULL = WEIBULL ## Weibull dağılımını hesaplar.
+ZTEST = ZTEST ## Z-testinin tek kuyruklu olasılık değerini hesaplar.
+
+
+##
+## Text functions Metin fonksiyonları
+##
+ASC = ASC ## Bir karakter dizesindeki çift enli (iki bayt) İngilizce harfleri veya katakanayı yarım enli (tek bayt) karakterlerle değiştirir.
+BAHTTEXT = BAHTTEXT ## Sayıyı, ß (baht) para birimi biçimini kullanarak metne dönüştürür.
+CHAR = DAMGA ## Kod sayısıyla belirtilen karakteri verir.
+CLEAN = TEMİZ ## Metindeki bütün yazdırılamaz karakterleri kaldırır.
+CODE = KOD ## Bir metin dizesindeki ilk karakter için sayısal bir kod verir.
+CONCATENATE = BİRLEŞTİR ## Pek çok metin öğesini bir metin öğesi olarak birleştirir.
+DOLLAR = LİRA ## Bir sayıyı YTL (yeni Türk lirası) para birimi biçimini kullanarak metne dönüştürür.
+EXACT = ÖZDEŞ ## İki metin değerinin özdeş olup olmadığını anlamak için, değerleri denetler.
+FIND = BUL ## Bir metin değerini, bir başkasının içinde bulur (büyük küçük harf duyarlıdır).
+FINDB = BULB ## Bir metin değerini, bir başkasının içinde bulur (büyük küçük harf duyarlıdır).
+FIXED = SAYIDÜZENLE ## Bir sayıyı, sabit sayıda ondalıkla, metin olarak biçimlendirir.
+JIS = JIS ## Bir karakter dizesindeki tek enli (tek bayt) İngilizce harfleri veya katakanayı çift enli (iki bayt) karakterlerle değiştirir.
+LEFT = SOL ## Bir metin değerinden en soldaki karakterleri verir.
+LEFTB = SOLB ## Bir metin değerinden en soldaki karakterleri verir.
+LEN = UZUNLUK ## Bir metin dizesindeki karakter sayısını verir.
+LENB = UZUNLUKB ## Bir metin dizesindeki karakter sayısını verir.
+LOWER = KÜÇÜKHARF ## Metni küçük harfe çevirir.
+MID = ORTA ## Bir metin dizesinden belirli sayıda karakteri, belirttiğiniz konumdan başlamak üzere verir.
+MIDB = ORTAB ## Bir metin dizesinden belirli sayıda karakteri, belirttiğiniz konumdan başlamak üzere verir.
+PHONETIC = SES ## Metin dizesinden ses (furigana) karakterlerini ayıklar.
+PROPER = YAZIM.DÜZENİ ## Bir metin değerinin her bir sözcüğünün ilk harfini büyük harfe çevirir.
+REPLACE = DEĞİŞTİR ## Metnin içindeki karakterleri değiştirir.
+REPLACEB = DEĞİŞTİRB ## Metnin içindeki karakterleri değiştirir.
+REPT = YİNELE ## Metni belirtilen sayıda yineler.
+RIGHT = SAĞ ## Bir metin değerinden en sağdaki karakterleri verir.
+RIGHTB = SAĞB ## Bir metin değerinden en sağdaki karakterleri verir.
+SEARCH = BUL ## Bir metin değerini, bir başkasının içinde bulur (büyük küçük harf duyarlı değildir).
+SEARCHB = BULB ## Bir metin değerini, bir başkasının içinde bulur (büyük küçük harf duyarlı değildir).
+SUBSTITUTE = YERİNEKOY ## Bir metin dizesinde, eski metnin yerine yeni metin koyar.
+T = M ## Bağımsız değerlerini metne dönüştürür.
+TEXT = METNEÇEVİR ## Bir sayıyı biçimlendirir ve metne dönüştürür.
+TRIM = KIRP ## Metindeki boşlukları kaldırır.
+UPPER = BÜYÜKHARF ## Metni büyük harfe çevirir.
+VALUE = SAYIYAÇEVİR ## Bir metin bağımsız değişkenini sayıya dönüştürür.
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php
new file mode 100644
index 00000000000..4052c23cb97
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/AdvancedValueBinder.php
@@ -0,0 +1,176 @@
+setValueExplicit(true, DataType::TYPE_BOOL);
+
+ return true;
+ } elseif ($value == Calculation::getFALSE()) {
+ $cell->setValueExplicit(false, DataType::TYPE_BOOL);
+
+ return true;
+ }
+
+ // Check for number in scientific format
+ if (preg_match('/^' . Calculation::CALCULATION_REGEXP_NUMBER . '$/', $value)) {
+ $cell->setValueExplicit((float) $value, DataType::TYPE_NUMERIC);
+
+ return true;
+ }
+
+ // Check for fraction
+ if (preg_match('/^([+-]?)\s*(\d+)\s?\/\s*(\d+)$/', $value, $matches)) {
+ // Convert value to number
+ $value = $matches[2] / $matches[3];
+ if ($matches[1] == '-') {
+ $value = 0 - $value;
+ }
+ $cell->setValueExplicit((float) $value, DataType::TYPE_NUMERIC);
+ // Set style
+ $cell->getWorksheet()->getStyle($cell->getCoordinate())
+ ->getNumberFormat()->setFormatCode('??/??');
+
+ return true;
+ } elseif (preg_match('/^([+-]?)(\d*) +(\d*)\s?\/\s*(\d*)$/', $value, $matches)) {
+ // Convert value to number
+ $value = $matches[2] + ($matches[3] / $matches[4]);
+ if ($matches[1] == '-') {
+ $value = 0 - $value;
+ }
+ $cell->setValueExplicit((float) $value, DataType::TYPE_NUMERIC);
+ // Set style
+ $cell->getWorksheet()->getStyle($cell->getCoordinate())
+ ->getNumberFormat()->setFormatCode('# ??/??');
+
+ return true;
+ }
+
+ // Check for percentage
+ if (preg_match('/^\-?\d*\.?\d*\s?\%$/', $value)) {
+ // Convert value to number
+ $value = (float) str_replace('%', '', $value) / 100;
+ $cell->setValueExplicit($value, DataType::TYPE_NUMERIC);
+ // Set style
+ $cell->getWorksheet()->getStyle($cell->getCoordinate())
+ ->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_PERCENTAGE_00);
+
+ return true;
+ }
+
+ // Check for currency
+ $currencyCode = StringHelper::getCurrencyCode();
+ $decimalSeparator = StringHelper::getDecimalSeparator();
+ $thousandsSeparator = StringHelper::getThousandsSeparator();
+ if (preg_match('/^' . preg_quote($currencyCode, '/') . ' *(\d{1,3}(' . preg_quote($thousandsSeparator, '/') . '\d{3})*|(\d+))(' . preg_quote($decimalSeparator, '/') . '\d{2})?$/', $value)) {
+ // Convert value to number
+ $value = (float) trim(str_replace([$currencyCode, $thousandsSeparator, $decimalSeparator], ['', '', '.'], $value));
+ $cell->setValueExplicit($value, DataType::TYPE_NUMERIC);
+ // Set style
+ $cell->getWorksheet()->getStyle($cell->getCoordinate())
+ ->getNumberFormat()->setFormatCode(
+ str_replace('$', $currencyCode, NumberFormat::FORMAT_CURRENCY_USD_SIMPLE)
+ );
+
+ return true;
+ } elseif (preg_match('/^\$ *(\d{1,3}(\,\d{3})*|(\d+))(\.\d{2})?$/', $value)) {
+ // Convert value to number
+ $value = (float) trim(str_replace(['$', ','], '', $value));
+ $cell->setValueExplicit($value, DataType::TYPE_NUMERIC);
+ // Set style
+ $cell->getWorksheet()->getStyle($cell->getCoordinate())
+ ->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_CURRENCY_USD_SIMPLE);
+
+ return true;
+ }
+
+ // Check for time without seconds e.g. '9:45', '09:45'
+ if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d$/', $value)) {
+ // Convert value to number
+ list($h, $m) = explode(':', $value);
+ $days = $h / 24 + $m / 1440;
+ $cell->setValueExplicit($days, DataType::TYPE_NUMERIC);
+ // Set style
+ $cell->getWorksheet()->getStyle($cell->getCoordinate())
+ ->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_TIME3);
+
+ return true;
+ }
+
+ // Check for time with seconds '9:45:59', '09:45:59'
+ if (preg_match('/^(\d|[0-1]\d|2[0-3]):[0-5]\d:[0-5]\d$/', $value)) {
+ // Convert value to number
+ list($h, $m, $s) = explode(':', $value);
+ $days = $h / 24 + $m / 1440 + $s / 86400;
+ // Convert value to number
+ $cell->setValueExplicit($days, DataType::TYPE_NUMERIC);
+ // Set style
+ $cell->getWorksheet()->getStyle($cell->getCoordinate())
+ ->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_TIME4);
+
+ return true;
+ }
+
+ // Check for datetime, e.g. '2008-12-31', '2008-12-31 15:59', '2008-12-31 15:59:10'
+ if (($d = Date::stringToExcel($value)) !== false) {
+ // Convert value to number
+ $cell->setValueExplicit($d, DataType::TYPE_NUMERIC);
+ // Determine style. Either there is a time part or not. Look for ':'
+ if (strpos($value, ':') !== false) {
+ $formatCode = 'yyyy-mm-dd h:mm';
+ } else {
+ $formatCode = 'yyyy-mm-dd';
+ }
+ $cell->getWorksheet()->getStyle($cell->getCoordinate())
+ ->getNumberFormat()->setFormatCode($formatCode);
+
+ return true;
+ }
+
+ // Check for newline character "\n"
+ if (strpos($value, "\n") !== false) {
+ $value = StringHelper::sanitizeUTF8($value);
+ $cell->setValueExplicit($value, DataType::TYPE_STRING);
+ // Set style
+ $cell->getWorksheet()->getStyle($cell->getCoordinate())
+ ->getAlignment()->setWrapText(true);
+
+ return true;
+ }
+ }
+
+ // Not bound yet? Use parent...
+ return parent::bindValue($cell, $value);
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php
new file mode 100644
index 00000000000..416b4a9909b
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Cell.php
@@ -0,0 +1,698 @@
+parent->update($this);
+
+ return $this;
+ }
+
+ public function detach()
+ {
+ $this->parent = null;
+ }
+
+ public function attach(Cells $parent)
+ {
+ $this->parent = $parent;
+ }
+
+ /**
+ * Create a new Cell.
+ *
+ * @param mixed $pValue
+ * @param string $pDataType
+ * @param Worksheet $pSheet
+ *
+ * @throws Exception
+ */
+ public function __construct($pValue, $pDataType, Worksheet $pSheet)
+ {
+ // Initialise cell value
+ $this->value = $pValue;
+
+ // Set worksheet cache
+ $this->parent = $pSheet->getCellCollection();
+
+ // Set datatype?
+ if ($pDataType !== null) {
+ if ($pDataType == DataType::TYPE_STRING2) {
+ $pDataType = DataType::TYPE_STRING;
+ }
+ $this->dataType = $pDataType;
+ } elseif (!self::getValueBinder()->bindValue($this, $pValue)) {
+ throw new Exception('Value could not be bound to cell.');
+ }
+ }
+
+ /**
+ * Get cell coordinate column.
+ *
+ * @return string
+ */
+ public function getColumn()
+ {
+ return $this->parent->getCurrentColumn();
+ }
+
+ /**
+ * Get cell coordinate row.
+ *
+ * @return int
+ */
+ public function getRow()
+ {
+ return $this->parent->getCurrentRow();
+ }
+
+ /**
+ * Get cell coordinate.
+ *
+ * @return string
+ */
+ public function getCoordinate()
+ {
+ return $this->parent->getCurrentCoordinate();
+ }
+
+ /**
+ * Get cell value.
+ *
+ * @return mixed
+ */
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ /**
+ * Get cell value with formatting.
+ *
+ * @return string
+ */
+ public function getFormattedValue()
+ {
+ return (string) NumberFormat::toFormattedString(
+ $this->getCalculatedValue(),
+ $this->getStyle()
+ ->getNumberFormat()->getFormatCode()
+ );
+ }
+
+ /**
+ * Set cell value.
+ *
+ * Sets the value for a cell, automatically determining the datatype using the value binder
+ *
+ * @param mixed $pValue Value
+ *
+ * @throws Exception
+ *
+ * @return Cell
+ */
+ public function setValue($pValue)
+ {
+ if (!self::getValueBinder()->bindValue($this, $pValue)) {
+ throw new Exception('Value could not be bound to cell.');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set the value for a cell, with the explicit data type passed to the method (bypassing any use of the value binder).
+ *
+ * @param mixed $pValue Value
+ * @param string $pDataType Explicit data type, see DataType::TYPE_*
+ *
+ * @throws Exception
+ *
+ * @return Cell
+ */
+ public function setValueExplicit($pValue, $pDataType)
+ {
+ // set the value according to data type
+ switch ($pDataType) {
+ case DataType::TYPE_NULL:
+ $this->value = $pValue;
+
+ break;
+ case DataType::TYPE_STRING2:
+ $pDataType = DataType::TYPE_STRING;
+ // no break
+ case DataType::TYPE_STRING:
+ // Synonym for string
+ case DataType::TYPE_INLINE:
+ // Rich text
+ $this->value = DataType::checkString($pValue);
+
+ break;
+ case DataType::TYPE_NUMERIC:
+ $this->value = (float) $pValue;
+
+ break;
+ case DataType::TYPE_FORMULA:
+ $this->value = (string) $pValue;
+
+ break;
+ case DataType::TYPE_BOOL:
+ $this->value = (bool) $pValue;
+
+ break;
+ case DataType::TYPE_ERROR:
+ $this->value = DataType::checkErrorCode($pValue);
+
+ break;
+ default:
+ throw new Exception('Invalid datatype: ' . $pDataType);
+
+ break;
+ }
+
+ // set the datatype
+ $this->dataType = $pDataType;
+
+ return $this->updateInCollection();
+ }
+
+ /**
+ * Get calculated cell value.
+ *
+ * @param bool $resetLog Whether the calculation engine logger should be reset or not
+ *
+ * @throws Exception
+ *
+ * @return mixed
+ */
+ public function getCalculatedValue($resetLog = true)
+ {
+ if ($this->dataType == DataType::TYPE_FORMULA) {
+ try {
+ $result = Calculation::getInstance(
+ $this->getWorksheet()->getParent()
+ )->calculateCellValue($this, $resetLog);
+ // We don't yet handle array returns
+ if (is_array($result)) {
+ while (is_array($result)) {
+ $result = array_pop($result);
+ }
+ }
+ } catch (Exception $ex) {
+ if (($ex->getMessage() === 'Unable to access External Workbook') && ($this->calculatedValue !== null)) {
+ return $this->calculatedValue; // Fallback for calculations referencing external files.
+ }
+
+ throw new \PhpOffice\PhpSpreadsheet\Calculation\Exception(
+ $this->getWorksheet()->getTitle() . '!' . $this->getCoordinate() . ' -> ' . $ex->getMessage()
+ );
+ }
+
+ if ($result === '#Not Yet Implemented') {
+ return $this->calculatedValue; // Fallback if calculation engine does not support the formula.
+ }
+
+ return $result;
+ } elseif ($this->value instanceof RichText) {
+ return $this->value->getPlainText();
+ }
+
+ return $this->value;
+ }
+
+ /**
+ * Set old calculated value (cached).
+ *
+ * @param mixed $pValue Value
+ *
+ * @return Cell
+ */
+ public function setCalculatedValue($pValue)
+ {
+ if ($pValue !== null) {
+ $this->calculatedValue = (is_numeric($pValue)) ? (float) $pValue : $pValue;
+ }
+
+ return $this->updateInCollection();
+ }
+
+ /**
+ * Get old calculated value (cached)
+ * This returns the value last calculated by MS Excel or whichever spreadsheet program was used to
+ * create the original spreadsheet file.
+ * Note that this value is not guaranteed to reflect the actual calculated value because it is
+ * possible that auto-calculation was disabled in the original spreadsheet, and underlying data
+ * values used by the formula have changed since it was last calculated.
+ *
+ * @return mixed
+ */
+ public function getOldCalculatedValue()
+ {
+ return $this->calculatedValue;
+ }
+
+ /**
+ * Get cell data type.
+ *
+ * @return string
+ */
+ public function getDataType()
+ {
+ return $this->dataType;
+ }
+
+ /**
+ * Set cell data type.
+ *
+ * @param string $pDataType see DataType::TYPE_*
+ *
+ * @return Cell
+ */
+ public function setDataType($pDataType)
+ {
+ if ($pDataType == DataType::TYPE_STRING2) {
+ $pDataType = DataType::TYPE_STRING;
+ }
+ $this->dataType = $pDataType;
+
+ return $this->updateInCollection();
+ }
+
+ /**
+ * Identify if the cell contains a formula.
+ *
+ * @return bool
+ */
+ public function isFormula()
+ {
+ return $this->dataType == DataType::TYPE_FORMULA;
+ }
+
+ /**
+ * Does this cell contain Data validation rules?
+ *
+ * @throws Exception
+ *
+ * @return bool
+ */
+ public function hasDataValidation()
+ {
+ if (!isset($this->parent)) {
+ throw new Exception('Cannot check for data validation when cell is not bound to a worksheet');
+ }
+
+ return $this->getWorksheet()->dataValidationExists($this->getCoordinate());
+ }
+
+ /**
+ * Get Data validation rules.
+ *
+ * @throws Exception
+ *
+ * @return DataValidation
+ */
+ public function getDataValidation()
+ {
+ if (!isset($this->parent)) {
+ throw new Exception('Cannot get data validation for cell that is not bound to a worksheet');
+ }
+
+ return $this->getWorksheet()->getDataValidation($this->getCoordinate());
+ }
+
+ /**
+ * Set Data validation rules.
+ *
+ * @param DataValidation $pDataValidation
+ *
+ * @throws Exception
+ *
+ * @return Cell
+ */
+ public function setDataValidation(DataValidation $pDataValidation = null)
+ {
+ if (!isset($this->parent)) {
+ throw new Exception('Cannot set data validation for cell that is not bound to a worksheet');
+ }
+
+ $this->getWorksheet()->setDataValidation($this->getCoordinate(), $pDataValidation);
+
+ return $this->updateInCollection();
+ }
+
+ /**
+ * Does this cell contain valid value?
+ *
+ * @return bool
+ */
+ public function hasValidValue()
+ {
+ $validator = new DataValidator();
+
+ return $validator->isValid($this);
+ }
+
+ /**
+ * Does this cell contain a Hyperlink?
+ *
+ * @throws Exception
+ *
+ * @return bool
+ */
+ public function hasHyperlink()
+ {
+ if (!isset($this->parent)) {
+ throw new Exception('Cannot check for hyperlink when cell is not bound to a worksheet');
+ }
+
+ return $this->getWorksheet()->hyperlinkExists($this->getCoordinate());
+ }
+
+ /**
+ * Get Hyperlink.
+ *
+ * @throws Exception
+ *
+ * @return Hyperlink
+ */
+ public function getHyperlink()
+ {
+ if (!isset($this->parent)) {
+ throw new Exception('Cannot get hyperlink for cell that is not bound to a worksheet');
+ }
+
+ return $this->getWorksheet()->getHyperlink($this->getCoordinate());
+ }
+
+ /**
+ * Set Hyperlink.
+ *
+ * @param Hyperlink $pHyperlink
+ *
+ * @throws Exception
+ *
+ * @return Cell
+ */
+ public function setHyperlink(Hyperlink $pHyperlink = null)
+ {
+ if (!isset($this->parent)) {
+ throw new Exception('Cannot set hyperlink for cell that is not bound to a worksheet');
+ }
+
+ $this->getWorksheet()->setHyperlink($this->getCoordinate(), $pHyperlink);
+
+ return $this->updateInCollection();
+ }
+
+ /**
+ * Get cell collection.
+ *
+ * @return Cells
+ */
+ public function getParent()
+ {
+ return $this->parent;
+ }
+
+ /**
+ * Get parent worksheet.
+ *
+ * @return Worksheet
+ */
+ public function getWorksheet()
+ {
+ return $this->parent->getParent();
+ }
+
+ /**
+ * Is this cell in a merge range.
+ *
+ * @return bool
+ */
+ public function isInMergeRange()
+ {
+ return (bool) $this->getMergeRange();
+ }
+
+ /**
+ * Is this cell the master (top left cell) in a merge range (that holds the actual data value).
+ *
+ * @return bool
+ */
+ public function isMergeRangeValueCell()
+ {
+ if ($mergeRange = $this->getMergeRange()) {
+ $mergeRange = Coordinate::splitRange($mergeRange);
+ list($startCell) = $mergeRange[0];
+ if ($this->getCoordinate() === $startCell) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * If this cell is in a merge range, then return the range.
+ *
+ * @return string
+ */
+ public function getMergeRange()
+ {
+ foreach ($this->getWorksheet()->getMergeCells() as $mergeRange) {
+ if ($this->isInRange($mergeRange)) {
+ return $mergeRange;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Get cell style.
+ *
+ * @return Style
+ */
+ public function getStyle()
+ {
+ return $this->getWorksheet()->getStyle($this->getCoordinate());
+ }
+
+ /**
+ * Re-bind parent.
+ *
+ * @param Worksheet $parent
+ *
+ * @return Cell
+ */
+ public function rebindParent(Worksheet $parent)
+ {
+ $this->parent = $parent->getCellCollection();
+
+ return $this->updateInCollection();
+ }
+
+ /**
+ * Is cell in a specific range?
+ *
+ * @param string $pRange Cell range (e.g. A1:A1)
+ *
+ * @return bool
+ */
+ public function isInRange($pRange)
+ {
+ list($rangeStart, $rangeEnd) = Coordinate::rangeBoundaries($pRange);
+
+ // Translate properties
+ $myColumn = Coordinate::columnIndexFromString($this->getColumn());
+ $myRow = $this->getRow();
+
+ // Verify if cell is in range
+ return ($rangeStart[0] <= $myColumn) && ($rangeEnd[0] >= $myColumn) &&
+ ($rangeStart[1] <= $myRow) && ($rangeEnd[1] >= $myRow);
+ }
+
+ /**
+ * Compare 2 cells.
+ *
+ * @param Cell $a Cell a
+ * @param Cell $b Cell b
+ *
+ * @return int Result of comparison (always -1 or 1, never zero!)
+ */
+ public static function compareCells(self $a, self $b)
+ {
+ if ($a->getRow() < $b->getRow()) {
+ return -1;
+ } elseif ($a->getRow() > $b->getRow()) {
+ return 1;
+ } elseif (Coordinate::columnIndexFromString($a->getColumn()) < Coordinate::columnIndexFromString($b->getColumn())) {
+ return -1;
+ }
+
+ return 1;
+ }
+
+ /**
+ * Get value binder to use.
+ *
+ * @return IValueBinder
+ */
+ public static function getValueBinder()
+ {
+ if (self::$valueBinder === null) {
+ self::$valueBinder = new DefaultValueBinder();
+ }
+
+ return self::$valueBinder;
+ }
+
+ /**
+ * Set value binder to use.
+ *
+ * @param IValueBinder $binder
+ */
+ public static function setValueBinder(IValueBinder $binder)
+ {
+ self::$valueBinder = $binder;
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if ((is_object($value)) && ($key != 'parent')) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+
+ /**
+ * Get index to cellXf.
+ *
+ * @return int
+ */
+ public function getXfIndex()
+ {
+ return $this->xfIndex;
+ }
+
+ /**
+ * Set index to cellXf.
+ *
+ * @param int $pValue
+ *
+ * @return Cell
+ */
+ public function setXfIndex($pValue)
+ {
+ $this->xfIndex = $pValue;
+
+ return $this->updateInCollection();
+ }
+
+ /**
+ * Set the formula attributes.
+ *
+ * @param mixed $pAttributes
+ *
+ * @return Cell
+ */
+ public function setFormulaAttributes($pAttributes)
+ {
+ $this->formulaAttributes = $pAttributes;
+
+ return $this;
+ }
+
+ /**
+ * Get the formula attributes.
+ */
+ public function getFormulaAttributes()
+ {
+ return $this->formulaAttributes;
+ }
+
+ /**
+ * Convert to string.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return (string) $this->getValue();
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php
new file mode 100644
index 00000000000..12e3b689727
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Coordinate.php
@@ -0,0 +1,522 @@
+ '') {
+ $worksheet .= '!';
+ }
+
+ // Create absolute coordinate
+ if (ctype_digit($pCoordinateString)) {
+ return $worksheet . '$' . $pCoordinateString;
+ } elseif (ctype_alpha($pCoordinateString)) {
+ return $worksheet . '$' . strtoupper($pCoordinateString);
+ }
+
+ return $worksheet . self::absoluteCoordinate($pCoordinateString);
+ }
+
+ /**
+ * Make string coordinate absolute.
+ *
+ * @param string $pCoordinateString e.g. 'A1'
+ *
+ * @throws Exception
+ *
+ * @return string Absolute coordinate e.g. '$A$1'
+ */
+ public static function absoluteCoordinate($pCoordinateString)
+ {
+ if (self::coordinateIsRange($pCoordinateString)) {
+ throw new Exception('Cell coordinate string can not be a range of cells');
+ }
+
+ // Split out any worksheet name from the coordinate
+ list($worksheet, $pCoordinateString) = Worksheet::extractSheetTitle($pCoordinateString, true);
+ if ($worksheet > '') {
+ $worksheet .= '!';
+ }
+
+ // Create absolute coordinate
+ list($column, $row) = self::coordinateFromString($pCoordinateString);
+ $column = ltrim($column, '$');
+ $row = ltrim($row, '$');
+
+ return $worksheet . '$' . $column . '$' . $row;
+ }
+
+ /**
+ * Split range into coordinate strings.
+ *
+ * @param string $pRange e.g. 'B4:D9' or 'B4:D9,H2:O11' or 'B4'
+ *
+ * @return array Array containing one or more arrays containing one or two coordinate strings
+ * e.g. ['B4','D9'] or [['B4','D9'], ['H2','O11']]
+ * or ['B4']
+ */
+ public static function splitRange($pRange)
+ {
+ // Ensure $pRange is a valid range
+ if (empty($pRange)) {
+ $pRange = self::DEFAULT_RANGE;
+ }
+
+ $exploded = explode(',', $pRange);
+ $counter = count($exploded);
+ for ($i = 0; $i < $counter; ++$i) {
+ $exploded[$i] = explode(':', $exploded[$i]);
+ }
+
+ return $exploded;
+ }
+
+ /**
+ * Build range from coordinate strings.
+ *
+ * @param array $pRange Array containg one or more arrays containing one or two coordinate strings
+ *
+ * @throws Exception
+ *
+ * @return string String representation of $pRange
+ */
+ public static function buildRange(array $pRange)
+ {
+ // Verify range
+ if (empty($pRange) || !is_array($pRange[0])) {
+ throw new Exception('Range does not contain any information');
+ }
+
+ // Build range
+ $imploded = [];
+ $counter = count($pRange);
+ for ($i = 0; $i < $counter; ++$i) {
+ $pRange[$i] = implode(':', $pRange[$i]);
+ }
+ $imploded = implode(',', $pRange);
+
+ return $imploded;
+ }
+
+ /**
+ * Calculate range boundaries.
+ *
+ * @param string $pRange Cell range (e.g. A1:A1)
+ *
+ * @return array Range coordinates [Start Cell, End Cell]
+ * where Start Cell and End Cell are arrays (Column Number, Row Number)
+ */
+ public static function rangeBoundaries($pRange)
+ {
+ // Ensure $pRange is a valid range
+ if (empty($pRange)) {
+ $pRange = self::DEFAULT_RANGE;
+ }
+
+ // Uppercase coordinate
+ $pRange = strtoupper($pRange);
+
+ // Extract range
+ if (strpos($pRange, ':') === false) {
+ $rangeA = $rangeB = $pRange;
+ } else {
+ list($rangeA, $rangeB) = explode(':', $pRange);
+ }
+
+ // Calculate range outer borders
+ $rangeStart = self::coordinateFromString($rangeA);
+ $rangeEnd = self::coordinateFromString($rangeB);
+
+ // Translate column into index
+ $rangeStart[0] = self::columnIndexFromString($rangeStart[0]);
+ $rangeEnd[0] = self::columnIndexFromString($rangeEnd[0]);
+
+ return [$rangeStart, $rangeEnd];
+ }
+
+ /**
+ * Calculate range dimension.
+ *
+ * @param string $pRange Cell range (e.g. A1:A1)
+ *
+ * @return array Range dimension (width, height)
+ */
+ public static function rangeDimension($pRange)
+ {
+ // Calculate range outer borders
+ list($rangeStart, $rangeEnd) = self::rangeBoundaries($pRange);
+
+ return [($rangeEnd[0] - $rangeStart[0] + 1), ($rangeEnd[1] - $rangeStart[1] + 1)];
+ }
+
+ /**
+ * Calculate range boundaries.
+ *
+ * @param string $pRange Cell range (e.g. A1:A1)
+ *
+ * @return array Range coordinates [Start Cell, End Cell]
+ * where Start Cell and End Cell are arrays [Column ID, Row Number]
+ */
+ public static function getRangeBoundaries($pRange)
+ {
+ // Ensure $pRange is a valid range
+ if (empty($pRange)) {
+ $pRange = self::DEFAULT_RANGE;
+ }
+
+ // Uppercase coordinate
+ $pRange = strtoupper($pRange);
+
+ // Extract range
+ if (strpos($pRange, ':') === false) {
+ $rangeA = $rangeB = $pRange;
+ } else {
+ list($rangeA, $rangeB) = explode(':', $pRange);
+ }
+
+ return [self::coordinateFromString($rangeA), self::coordinateFromString($rangeB)];
+ }
+
+ /**
+ * Column index from string.
+ *
+ * @param string $pString eg 'A'
+ *
+ * @return int Column index (A = 1)
+ */
+ public static function columnIndexFromString($pString)
+ {
+ // Using a lookup cache adds a slight memory overhead, but boosts speed
+ // caching using a static within the method is faster than a class static,
+ // though it's additional memory overhead
+ static $indexCache = [];
+
+ if (isset($indexCache[$pString])) {
+ return $indexCache[$pString];
+ }
+ // It's surprising how costly the strtoupper() and ord() calls actually are, so we use a lookup array rather than use ord()
+ // and make it case insensitive to get rid of the strtoupper() as well. Because it's a static, there's no significant
+ // memory overhead either
+ static $columnLookup = [
+ 'A' => 1, 'B' => 2, 'C' => 3, 'D' => 4, 'E' => 5, 'F' => 6, 'G' => 7, 'H' => 8, 'I' => 9, 'J' => 10, 'K' => 11, 'L' => 12, 'M' => 13,
+ 'N' => 14, 'O' => 15, 'P' => 16, 'Q' => 17, 'R' => 18, 'S' => 19, 'T' => 20, 'U' => 21, 'V' => 22, 'W' => 23, 'X' => 24, 'Y' => 25, 'Z' => 26,
+ 'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5, 'f' => 6, 'g' => 7, 'h' => 8, 'i' => 9, 'j' => 10, 'k' => 11, 'l' => 12, 'm' => 13,
+ 'n' => 14, 'o' => 15, 'p' => 16, 'q' => 17, 'r' => 18, 's' => 19, 't' => 20, 'u' => 21, 'v' => 22, 'w' => 23, 'x' => 24, 'y' => 25, 'z' => 26,
+ ];
+
+ // We also use the language construct isset() rather than the more costly strlen() function to match the length of $pString
+ // for improved performance
+ if (isset($pString[0])) {
+ if (!isset($pString[1])) {
+ $indexCache[$pString] = $columnLookup[$pString];
+
+ return $indexCache[$pString];
+ } elseif (!isset($pString[2])) {
+ $indexCache[$pString] = $columnLookup[$pString[0]] * 26 + $columnLookup[$pString[1]];
+
+ return $indexCache[$pString];
+ } elseif (!isset($pString[3])) {
+ $indexCache[$pString] = $columnLookup[$pString[0]] * 676 + $columnLookup[$pString[1]] * 26 + $columnLookup[$pString[2]];
+
+ return $indexCache[$pString];
+ }
+ }
+
+ throw new Exception('Column string index can not be ' . ((isset($pString[0])) ? 'longer than 3 characters' : 'empty'));
+ }
+
+ /**
+ * String from column index.
+ *
+ * @param int $columnIndex Column index (A = 1)
+ *
+ * @return string
+ */
+ public static function stringFromColumnIndex($columnIndex)
+ {
+ static $indexCache = [];
+
+ if (!isset($indexCache[$columnIndex])) {
+ $indexValue = $columnIndex;
+ $base26 = null;
+ do {
+ $characterValue = ($indexValue % 26) ?: 26;
+ $indexValue = ($indexValue - $characterValue) / 26;
+ $base26 = chr($characterValue + 64) . ($base26 ?: '');
+ } while ($indexValue > 0);
+ $indexCache[$columnIndex] = $base26;
+ }
+
+ return $indexCache[$columnIndex];
+ }
+
+ /**
+ * Extract all cell references in range, which may be comprised of multiple cell ranges.
+ *
+ * @param string $pRange Range (e.g. A1 or A1:C10 or A1:E10 A20:E25)
+ *
+ * @return array Array containing single cell references
+ */
+ public static function extractAllCellReferencesInRange($pRange)
+ {
+ $returnValue = [];
+
+ // Explode spaces
+ $cellBlocks = self::getCellBlocksFromRangeString($pRange);
+ foreach ($cellBlocks as $cellBlock) {
+ $returnValue = array_merge($returnValue, self::getReferencesForCellBlock($cellBlock));
+ }
+
+ // Sort the result by column and row
+ $sortKeys = [];
+ foreach (array_unique($returnValue) as $coord) {
+ $column = '';
+ $row = 0;
+
+ sscanf($coord, '%[A-Z]%d', $column, $row);
+ $sortKeys[sprintf('%3s%09d', $column, $row)] = $coord;
+ }
+ ksort($sortKeys);
+
+ // Return value
+ return array_values($sortKeys);
+ }
+
+ /**
+ * Get all cell references for an individual cell block.
+ *
+ * @param string $cellBlock A cell range e.g. A4:B5
+ *
+ * @return array All individual cells in that range
+ */
+ private static function getReferencesForCellBlock($cellBlock)
+ {
+ $returnValue = [];
+
+ // Single cell?
+ if (!self::coordinateIsRange($cellBlock)) {
+ return (array) $cellBlock;
+ }
+
+ // Range...
+ $ranges = self::splitRange($cellBlock);
+ foreach ($ranges as $range) {
+ // Single cell?
+ if (!isset($range[1])) {
+ $returnValue[] = $range[0];
+
+ continue;
+ }
+
+ // Range...
+ list($rangeStart, $rangeEnd) = $range;
+ list($startColumn, $startRow) = self::coordinateFromString($rangeStart);
+ list($endColumn, $endRow) = self::coordinateFromString($rangeEnd);
+ $startColumnIndex = self::columnIndexFromString($startColumn);
+ $endColumnIndex = self::columnIndexFromString($endColumn);
+ ++$endColumnIndex;
+
+ // Current data
+ $currentColumnIndex = $startColumnIndex;
+ $currentRow = $startRow;
+
+ self::validateRange($cellBlock, $startColumnIndex, $endColumnIndex, $currentRow, $endRow);
+
+ // Loop cells
+ while ($currentColumnIndex < $endColumnIndex) {
+ while ($currentRow <= $endRow) {
+ $returnValue[] = self::stringFromColumnIndex($currentColumnIndex) . $currentRow;
+ ++$currentRow;
+ }
+ ++$currentColumnIndex;
+ $currentRow = $startRow;
+ }
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * Convert an associative array of single cell coordinates to values to an associative array
+ * of cell ranges to values. Only adjacent cell coordinates with the same
+ * value will be merged. If the value is an object, it must implement the method getHashCode().
+ *
+ * For example, this function converts:
+ *
+ * [ 'A1' => 'x', 'A2' => 'x', 'A3' => 'x', 'A4' => 'y' ]
+ *
+ * to:
+ *
+ * [ 'A1:A3' => 'x', 'A4' => 'y' ]
+ *
+ * @param array $pCoordCollection associative array mapping coordinates to values
+ *
+ * @return array associative array mapping coordinate ranges to valuea
+ */
+ public static function mergeRangesInCollection(array $pCoordCollection)
+ {
+ $hashedValues = [];
+ $mergedCoordCollection = [];
+
+ foreach ($pCoordCollection as $coord => $value) {
+ if (self::coordinateIsRange($coord)) {
+ $mergedCoordCollection[$coord] = $value;
+
+ continue;
+ }
+
+ list($column, $row) = self::coordinateFromString($coord);
+ $row = (int) (ltrim($row, '$'));
+ $hashCode = $column . '-' . (is_object($value) ? $value->getHashCode() : $value);
+
+ if (!isset($hashedValues[$hashCode])) {
+ $hashedValues[$hashCode] = (object) [
+ 'value' => $value,
+ 'col' => $column,
+ 'rows' => [$row],
+ ];
+ } else {
+ $hashedValues[$hashCode]->rows[] = $row;
+ }
+ }
+
+ ksort($hashedValues);
+
+ foreach ($hashedValues as $hashedValue) {
+ sort($hashedValue->rows);
+ $rowStart = null;
+ $rowEnd = null;
+ $ranges = [];
+
+ foreach ($hashedValue->rows as $row) {
+ if ($rowStart === null) {
+ $rowStart = $row;
+ $rowEnd = $row;
+ } elseif ($rowEnd === $row - 1) {
+ $rowEnd = $row;
+ } else {
+ if ($rowStart == $rowEnd) {
+ $ranges[] = $hashedValue->col . $rowStart;
+ } else {
+ $ranges[] = $hashedValue->col . $rowStart . ':' . $hashedValue->col . $rowEnd;
+ }
+
+ $rowStart = $row;
+ $rowEnd = $row;
+ }
+ }
+
+ if ($rowStart !== null) {
+ if ($rowStart == $rowEnd) {
+ $ranges[] = $hashedValue->col . $rowStart;
+ } else {
+ $ranges[] = $hashedValue->col . $rowStart . ':' . $hashedValue->col . $rowEnd;
+ }
+ }
+
+ foreach ($ranges as $range) {
+ $mergedCoordCollection[$range] = $hashedValue->value;
+ }
+ }
+
+ return $mergedCoordCollection;
+ }
+
+ /**
+ * Get the individual cell blocks from a range string, splitting by space and removing any $ characters.
+ *
+ * @param string $pRange
+ *
+ * @return string[]
+ */
+ private static function getCellBlocksFromRangeString($pRange)
+ {
+ return explode(' ', str_replace('$', '', strtoupper($pRange)));
+ }
+
+ /**
+ * Check that the given range is valid, i.e. that the start column and row are not greater than the end column and
+ * row.
+ *
+ * @param string $cellBlock The original range, for displaying a meaningful error message
+ * @param int $startColumnIndex
+ * @param int $endColumnIndex
+ * @param int $currentRow
+ * @param int $endRow
+ */
+ private static function validateRange($cellBlock, $startColumnIndex, $endColumnIndex, $currentRow, $endRow)
+ {
+ if ($startColumnIndex >= $endColumnIndex || $currentRow > $endRow) {
+ throw new Exception('Invalid range: "' . $cellBlock . '"');
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataType.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataType.php
new file mode 100644
index 00000000000..ba035791787
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataType.php
@@ -0,0 +1,85 @@
+ 0,
+ '#DIV/0!' => 1,
+ '#VALUE!' => 2,
+ '#REF!' => 3,
+ '#NAME?' => 4,
+ '#NUM!' => 5,
+ '#N/A' => 6,
+ ];
+
+ /**
+ * Get list of error codes.
+ *
+ * @return array
+ */
+ public static function getErrorCodes()
+ {
+ return self::$errorCodes;
+ }
+
+ /**
+ * Check a string that it satisfies Excel requirements.
+ *
+ * @param null|RichText|string $pValue Value to sanitize to an Excel string
+ *
+ * @return null|RichText|string Sanitized value
+ */
+ public static function checkString($pValue)
+ {
+ if ($pValue instanceof RichText) {
+ // TODO: Sanitize Rich-Text string (max. character count is 32,767)
+ return $pValue;
+ }
+
+ // string must never be longer than 32,767 characters, truncate if necessary
+ $pValue = StringHelper::substring($pValue, 0, 32767);
+
+ // we require that newline is represented as "\n" in core, not as "\r\n" or "\r"
+ $pValue = str_replace(["\r\n", "\r"], "\n", $pValue);
+
+ return $pValue;
+ }
+
+ /**
+ * Check a value that it is a valid error code.
+ *
+ * @param mixed $pValue Value to sanitize to an Excel error code
+ *
+ * @return string Sanitized value
+ */
+ public static function checkErrorCode($pValue)
+ {
+ $pValue = (string) $pValue;
+
+ if (!isset(self::$errorCodes[$pValue])) {
+ $pValue = '#NULL!';
+ }
+
+ return $pValue;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidation.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidation.php
new file mode 100644
index 00000000000..a041ea0e0ab
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidation.php
@@ -0,0 +1,481 @@
+formula1;
+ }
+
+ /**
+ * Set Formula 1.
+ *
+ * @param string $value
+ *
+ * @return DataValidation
+ */
+ public function setFormula1($value)
+ {
+ $this->formula1 = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get Formula 2.
+ *
+ * @return string
+ */
+ public function getFormula2()
+ {
+ return $this->formula2;
+ }
+
+ /**
+ * Set Formula 2.
+ *
+ * @param string $value
+ *
+ * @return DataValidation
+ */
+ public function setFormula2($value)
+ {
+ $this->formula2 = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get Type.
+ *
+ * @return string
+ */
+ public function getType()
+ {
+ return $this->type;
+ }
+
+ /**
+ * Set Type.
+ *
+ * @param string $value
+ *
+ * @return DataValidation
+ */
+ public function setType($value)
+ {
+ $this->type = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get Error style.
+ *
+ * @return string
+ */
+ public function getErrorStyle()
+ {
+ return $this->errorStyle;
+ }
+
+ /**
+ * Set Error style.
+ *
+ * @param string $value see self::STYLE_*
+ *
+ * @return DataValidation
+ */
+ public function setErrorStyle($value)
+ {
+ $this->errorStyle = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get Operator.
+ *
+ * @return string
+ */
+ public function getOperator()
+ {
+ return $this->operator;
+ }
+
+ /**
+ * Set Operator.
+ *
+ * @param string $value
+ *
+ * @return DataValidation
+ */
+ public function setOperator($value)
+ {
+ $this->operator = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get Allow Blank.
+ *
+ * @return bool
+ */
+ public function getAllowBlank()
+ {
+ return $this->allowBlank;
+ }
+
+ /**
+ * Set Allow Blank.
+ *
+ * @param bool $value
+ *
+ * @return DataValidation
+ */
+ public function setAllowBlank($value)
+ {
+ $this->allowBlank = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get Show DropDown.
+ *
+ * @return bool
+ */
+ public function getShowDropDown()
+ {
+ return $this->showDropDown;
+ }
+
+ /**
+ * Set Show DropDown.
+ *
+ * @param bool $value
+ *
+ * @return DataValidation
+ */
+ public function setShowDropDown($value)
+ {
+ $this->showDropDown = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get Show InputMessage.
+ *
+ * @return bool
+ */
+ public function getShowInputMessage()
+ {
+ return $this->showInputMessage;
+ }
+
+ /**
+ * Set Show InputMessage.
+ *
+ * @param bool $value
+ *
+ * @return DataValidation
+ */
+ public function setShowInputMessage($value)
+ {
+ $this->showInputMessage = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get Show ErrorMessage.
+ *
+ * @return bool
+ */
+ public function getShowErrorMessage()
+ {
+ return $this->showErrorMessage;
+ }
+
+ /**
+ * Set Show ErrorMessage.
+ *
+ * @param bool $value
+ *
+ * @return DataValidation
+ */
+ public function setShowErrorMessage($value)
+ {
+ $this->showErrorMessage = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get Error title.
+ *
+ * @return string
+ */
+ public function getErrorTitle()
+ {
+ return $this->errorTitle;
+ }
+
+ /**
+ * Set Error title.
+ *
+ * @param string $value
+ *
+ * @return DataValidation
+ */
+ public function setErrorTitle($value)
+ {
+ $this->errorTitle = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get Error.
+ *
+ * @return string
+ */
+ public function getError()
+ {
+ return $this->error;
+ }
+
+ /**
+ * Set Error.
+ *
+ * @param string $value
+ *
+ * @return DataValidation
+ */
+ public function setError($value)
+ {
+ $this->error = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get Prompt title.
+ *
+ * @return string
+ */
+ public function getPromptTitle()
+ {
+ return $this->promptTitle;
+ }
+
+ /**
+ * Set Prompt title.
+ *
+ * @param string $value
+ *
+ * @return DataValidation
+ */
+ public function setPromptTitle($value)
+ {
+ $this->promptTitle = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get Prompt.
+ *
+ * @return string
+ */
+ public function getPrompt()
+ {
+ return $this->prompt;
+ }
+
+ /**
+ * Set Prompt.
+ *
+ * @param string $value
+ *
+ * @return DataValidation
+ */
+ public function setPrompt($value)
+ {
+ $this->prompt = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ return md5(
+ $this->formula1 .
+ $this->formula2 .
+ $this->type .
+ $this->errorStyle .
+ $this->operator .
+ ($this->allowBlank ? 't' : 'f') .
+ ($this->showDropDown ? 't' : 'f') .
+ ($this->showInputMessage ? 't' : 'f') .
+ ($this->showErrorMessage ? 't' : 'f') .
+ $this->errorTitle .
+ $this->error .
+ $this->promptTitle .
+ $this->prompt .
+ __CLASS__
+ );
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidator.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidator.php
new file mode 100644
index 00000000000..430d81b96e4
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DataValidator.php
@@ -0,0 +1,77 @@
+hasDataValidation()) {
+ return true;
+ }
+
+ $cellValue = $cell->getValue();
+ $dataValidation = $cell->getDataValidation();
+
+ if (!$dataValidation->getAllowBlank() && ($cellValue === null || $cellValue === '')) {
+ return false;
+ }
+
+ // TODO: write check on all cases
+ switch ($dataValidation->getType()) {
+ case DataValidation::TYPE_LIST:
+ return $this->isValueInList($cell);
+ }
+
+ return false;
+ }
+
+ /**
+ * Does this cell contain valid value, based on list?
+ *
+ * @param Cell $cell Cell to check the value
+ *
+ * @return bool
+ */
+ private function isValueInList(Cell $cell)
+ {
+ $cellValue = $cell->getValue();
+ $dataValidation = $cell->getDataValidation();
+
+ $formula1 = $dataValidation->getFormula1();
+ if (!empty($formula1)) {
+ // inline values list
+ if ($formula1[0] === '"') {
+ return in_array(strtolower($cellValue), explode(',', strtolower(trim($formula1, '"'))), true);
+ } elseif (strpos($formula1, ':') > 0) {
+ // values list cells
+ $matchFormula = '=MATCH(' . $cell->getCoordinate() . ', ' . $formula1 . ', 0)';
+ $calculation = Calculation::getInstance($cell->getWorksheet()->getParent());
+
+ try {
+ $result = $calculation->calculateFormula($matchFormula, $cell->getCoordinate(), $cell);
+
+ return $result !== Functions::NA();
+ } catch (Exception $ex) {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DefaultValueBinder.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DefaultValueBinder.php
new file mode 100644
index 00000000000..0e6433a4ec8
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/DefaultValueBinder.php
@@ -0,0 +1,82 @@
+format('Y-m-d H:i:s');
+ } elseif (!($value instanceof RichText)) {
+ $value = (string) $value;
+ }
+ }
+
+ // Set value explicit
+ $cell->setValueExplicit($value, static::dataTypeForValue($value));
+
+ // Done!
+ return true;
+ }
+
+ /**
+ * DataType for value.
+ *
+ * @param mixed $pValue
+ *
+ * @return string
+ */
+ public static function dataTypeForValue($pValue)
+ {
+ // Match the value against a few data types
+ if ($pValue === null) {
+ return DataType::TYPE_NULL;
+ } elseif ($pValue === '') {
+ return DataType::TYPE_STRING;
+ } elseif ($pValue instanceof RichText) {
+ return DataType::TYPE_INLINE;
+ } elseif ($pValue[0] === '=' && strlen($pValue) > 1) {
+ return DataType::TYPE_FORMULA;
+ } elseif (is_bool($pValue)) {
+ return DataType::TYPE_BOOL;
+ } elseif (is_float($pValue) || is_int($pValue)) {
+ return DataType::TYPE_NUMERIC;
+ } elseif (preg_match('/^[\+\-]?(\d+\\.?\d*|\d*\\.?\d+)([Ee][\-\+]?[0-2]?\d{1,3})?$/', $pValue)) {
+ $tValue = ltrim($pValue, '+-');
+ if (is_string($pValue) && $tValue[0] === '0' && strlen($tValue) > 1 && $tValue[1] !== '.') {
+ return DataType::TYPE_STRING;
+ } elseif ((strpos($pValue, '.') === false) && ($pValue > PHP_INT_MAX)) {
+ return DataType::TYPE_STRING;
+ }
+
+ return DataType::TYPE_NUMERIC;
+ } elseif (is_string($pValue)) {
+ $errorCodes = DataType::getErrorCodes();
+ if (isset($errorCodes[$pValue])) {
+ return DataType::TYPE_ERROR;
+ }
+ }
+
+ return DataType::TYPE_STRING;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Hyperlink.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Hyperlink.php
new file mode 100644
index 00000000000..e17c20d9be0
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/Hyperlink.php
@@ -0,0 +1,113 @@
+url = $pUrl;
+ $this->tooltip = $pTooltip;
+ }
+
+ /**
+ * Get URL.
+ *
+ * @return string
+ */
+ public function getUrl()
+ {
+ return $this->url;
+ }
+
+ /**
+ * Set URL.
+ *
+ * @param string $value
+ *
+ * @return Hyperlink
+ */
+ public function setUrl($value)
+ {
+ $this->url = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get tooltip.
+ *
+ * @return string
+ */
+ public function getTooltip()
+ {
+ return $this->tooltip;
+ }
+
+ /**
+ * Set tooltip.
+ *
+ * @param string $value
+ *
+ * @return Hyperlink
+ */
+ public function setTooltip($value)
+ {
+ $this->tooltip = $value;
+
+ return $this;
+ }
+
+ /**
+ * Is this hyperlink internal? (to another worksheet).
+ *
+ * @return bool
+ */
+ public function isInternal()
+ {
+ return strpos($this->url, 'sheet://') !== false;
+ }
+
+ /**
+ * @return string
+ */
+ public function getTypeHyperlink()
+ {
+ return $this->isInternal() ? '' : 'External';
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ return md5(
+ $this->url .
+ $this->tooltip .
+ __CLASS__
+ );
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/IValueBinder.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/IValueBinder.php
new file mode 100644
index 00000000000..5af9f5f60e5
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Cell/IValueBinder.php
@@ -0,0 +1,16 @@
+setValueExplicit((string) $value, DataType::TYPE_STRING);
+
+ // Done!
+ return true;
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Chart/Axis.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Axis.php
similarity index 71%
rename from lib/phpexcel/PHPExcel/Chart/Axis.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Axis.php
index 9aeafc6a47c..52f70431453 100644
--- a/lib/phpexcel/PHPExcel/Chart/Axis.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Axis.php
@@ -1,30 +1,31 @@
self::FORMAT_CODE_GENERAL,
- 'source_linked' => 1
- );
+ 'source_linked' => 1,
+ ];
/**
- * Axis Options
+ * Axis Options.
*
- * @var array of mixed
+ * @var array of mixed
*/
- private $axisOptions = array(
+ private $axisOptions = [
'minimum' => null,
'maximum' => null,
'major_unit' => null,
@@ -34,106 +35,108 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
'major_tick_mark' => self::TICK_MARK_NONE,
'axis_labels' => self::AXIS_LABELS_NEXT_TO,
'horizontal_crosses' => self::HORIZONTAL_CROSSES_AUTOZERO,
- 'horizontal_crosses_value' => null
- );
+ 'horizontal_crosses_value' => null,
+ ];
/**
- * Fill Properties
+ * Fill Properties.
*
- * @var array of mixed
+ * @var array of mixed
*/
- private $fillProperties = array(
+ private $fillProperties = [
'type' => self::EXCEL_COLOR_TYPE_ARGB,
'value' => null,
- 'alpha' => 0
- );
+ 'alpha' => 0,
+ ];
/**
- * Line Properties
+ * Line Properties.
*
- * @var array of mixed
+ * @var array of mixed
*/
- private $lineProperties = array(
+ private $lineProperties = [
'type' => self::EXCEL_COLOR_TYPE_ARGB,
'value' => null,
- 'alpha' => 0
- );
+ 'alpha' => 0,
+ ];
/**
- * Line Style Properties
+ * Line Style Properties.
*
- * @var array of mixed
+ * @var array of mixed
*/
- private $lineStyleProperties = array(
+ private $lineStyleProperties = [
'width' => '9525',
'compound' => self::LINE_STYLE_COMPOUND_SIMPLE,
'dash' => self::LINE_STYLE_DASH_SOLID,
'cap' => self::LINE_STYLE_CAP_FLAT,
'join' => self::LINE_STYLE_JOIN_BEVEL,
- 'arrow' => array(
- 'head' => array(
+ 'arrow' => [
+ 'head' => [
'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
- 'size' => self::LINE_STYLE_ARROW_SIZE_5
- ),
- 'end' => array(
+ 'size' => self::LINE_STYLE_ARROW_SIZE_5,
+ ],
+ 'end' => [
'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
- 'size' => self::LINE_STYLE_ARROW_SIZE_8
- ),
- )
- );
+ 'size' => self::LINE_STYLE_ARROW_SIZE_8,
+ ],
+ ],
+ ];
/**
- * Shadow Properties
+ * Shadow Properties.
*
- * @var array of mixed
+ * @var array of mixed
*/
- private $shadowProperties = array(
+ private $shadowProperties = [
'presets' => self::SHADOW_PRESETS_NOSHADOW,
'effect' => null,
- 'color' => array(
+ 'color' => [
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
'value' => 'black',
'alpha' => 40,
- ),
- 'size' => array(
+ ],
+ 'size' => [
'sx' => null,
'sy' => null,
- 'kx' => null
- ),
+ 'kx' => null,
+ ],
'blur' => null,
'direction' => null,
'distance' => null,
'algn' => null,
- 'rotWithShape' => null
- );
+ 'rotWithShape' => null,
+ ];
/**
- * Glow Properties
+ * Glow Properties.
*
- * @var array of mixed
+ * @var array of mixed
*/
- private $glowProperties = array(
+ private $glowProperties = [
'size' => null,
- 'color' => array(
+ 'color' => [
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
'value' => 'black',
- 'alpha' => 40
- )
- );
+ 'alpha' => 40,
+ ],
+ ];
/**
- * Soft Edge Properties
+ * Soft Edge Properties.
*
- * @var array of mixed
+ * @var array of mixed
*/
- private $softEdges = array(
- 'size' => null
- );
+ private $softEdges = [
+ 'size' => null,
+ ];
/**
- * Get Series Data Type
+ * Get Series Data Type.
*
- * @return string
+ * @param mixed $format_code
+ *
+ * @return string
*/
public function setAxisNumberProperties($format_code)
{
@@ -142,9 +145,9 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Get Axis Number Format Data Type
+ * Get Axis Number Format Data Type.
*
- * @return string
+ * @return string
*/
public function getAxisNumberFormat()
{
@@ -152,9 +155,9 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Get Axis Number Source Linked
+ * Get Axis Number Source Linked.
*
- * @return string
+ * @return string
*/
public function getAxisNumberSourceLinked()
{
@@ -162,7 +165,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Set Axis Options Properties
+ * Set Axis Options Properties.
*
* @param string $axis_labels
* @param string $horizontal_crosses_value
@@ -174,7 +177,6 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* @param string $maximum
* @param string $major_unit
* @param string $minor_unit
- *
*/
public function setAxisOptionsProperties($axis_labels, $horizontal_crosses_value = null, $horizontal_crosses = null, $axis_orientation = null, $major_tmt = null, $minor_tmt = null, $minimum = null, $maximum = null, $major_unit = null, $minor_unit = null)
{
@@ -192,7 +194,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Get Axis Options Property
+ * Get Axis Options Property.
*
* @param string $property
*
@@ -204,23 +206,21 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Set Axis Orientation Property
+ * Set Axis Orientation Property.
*
* @param string $orientation
- *
*/
public function setAxisOrientation($orientation)
{
- $this->orientation = (string) $orientation;
+ $this->axisOptions['orientation'] = (string) $orientation;
}
/**
- * Set Fill Property
+ * Set Fill Property.
*
* @param string $color
* @param int $alpha
* @param string $type
- *
*/
public function setFillParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB)
{
@@ -228,12 +228,11 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Set Line Property
+ * Set Line Property.
*
* @param string $color
* @param int $alpha
* @param string $type
- *
*/
public function setLineParameters($color, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_ARGB)
{
@@ -241,7 +240,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Get Fill Property
+ * Get Fill Property.
*
* @param string $property
*
@@ -253,7 +252,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Get Line Property
+ * Get Line Property.
*
* @param string $property
*
@@ -265,7 +264,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Set Line Style Properties
+ * Set Line Style Properties.
*
* @param float $line_width
* @param string $compound_type
@@ -276,23 +275,22 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
* @param string $head_arrow_size
* @param string $end_arrow_type
* @param string $end_arrow_size
- *
*/
public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null)
{
- (!is_null($line_width)) ? $this->lineStyleProperties['width'] = $this->getExcelPointsWidth((float) $line_width) : null;
- (!is_null($compound_type)) ? $this->lineStyleProperties['compound'] = (string) $compound_type : null;
- (!is_null($dash_type)) ? $this->lineStyleProperties['dash'] = (string) $dash_type : null;
- (!is_null($cap_type)) ? $this->lineStyleProperties['cap'] = (string) $cap_type : null;
- (!is_null($join_type)) ? $this->lineStyleProperties['join'] = (string) $join_type : null;
- (!is_null($head_arrow_type)) ? $this->lineStyleProperties['arrow']['head']['type'] = (string) $head_arrow_type : null;
- (!is_null($head_arrow_size)) ? $this->lineStyleProperties['arrow']['head']['size'] = (string) $head_arrow_size : null;
- (!is_null($end_arrow_type)) ? $this->lineStyleProperties['arrow']['end']['type'] = (string) $end_arrow_type : null;
- (!is_null($end_arrow_size)) ? $this->lineStyleProperties['arrow']['end']['size'] = (string) $end_arrow_size : null;
+ ($line_width !== null) ? $this->lineStyleProperties['width'] = $this->getExcelPointsWidth((float) $line_width) : null;
+ ($compound_type !== null) ? $this->lineStyleProperties['compound'] = (string) $compound_type : null;
+ ($dash_type !== null) ? $this->lineStyleProperties['dash'] = (string) $dash_type : null;
+ ($cap_type !== null) ? $this->lineStyleProperties['cap'] = (string) $cap_type : null;
+ ($join_type !== null) ? $this->lineStyleProperties['join'] = (string) $join_type : null;
+ ($head_arrow_type !== null) ? $this->lineStyleProperties['arrow']['head']['type'] = (string) $head_arrow_type : null;
+ ($head_arrow_size !== null) ? $this->lineStyleProperties['arrow']['head']['size'] = (string) $head_arrow_size : null;
+ ($end_arrow_type !== null) ? $this->lineStyleProperties['arrow']['end']['type'] = (string) $end_arrow_type : null;
+ ($end_arrow_size !== null) ? $this->lineStyleProperties['arrow']['end']['size'] = (string) $end_arrow_size : null;
}
/**
- * Get Line Style Property
+ * Get Line Style Property.
*
* @param array|string $elements
*
@@ -304,7 +302,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Get Line Style Arrow Excel Width
+ * Get Line Style Arrow Excel Width.
*
* @param string $arrow
*
@@ -316,7 +314,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Get Line Style Arrow Excel Length
+ * Get Line Style Arrow Excel Length.
*
* @param string $arrow
*
@@ -328,24 +326,23 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Set Shadow Properties
+ * Set Shadow Properties.
*
- * @param int $shadow_presets
+ * @param int $sh_presets
* @param string $sh_color_value
* @param string $sh_color_type
* @param string $sh_color_alpha
* @param float $sh_blur
* @param int $sh_angle
* @param float $sh_distance
- *
*/
public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null)
{
$this->setShadowPresetsProperties((int) $sh_presets)
->setShadowColor(
- is_null($sh_color_value) ? $this->shadowProperties['color']['value'] : $sh_color_value,
- is_null($sh_color_alpha) ? (int) $this->shadowProperties['color']['alpha'] : $sh_color_alpha,
- is_null($sh_color_type) ? $this->shadowProperties['color']['type'] : $sh_color_type
+ $sh_color_value === null ? $this->shadowProperties['color']['value'] : $sh_color_value,
+ $sh_color_alpha === null ? (int) $this->shadowProperties['color']['alpha'] : $sh_color_alpha,
+ $sh_color_type === null ? $this->shadowProperties['color']['type'] : $sh_color_type
)
->setShadowBlur($sh_blur)
->setShadowAngle($sh_angle)
@@ -353,11 +350,11 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Set Shadow Color
+ * Set Shadow Color.
*
* @param int $shadow_presets
*
- * @return PHPExcel_Chart_Axis
+ * @return Axis
*/
private function setShadowPresetsProperties($shadow_presets)
{
@@ -368,12 +365,12 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Set Shadow Properties from Maped Values
+ * Set Shadow Properties from Maped Values.
*
* @param array $properties_map
* @param * $reference
*
- * @return PHPExcel_Chart_Axis
+ * @return Axis
*/
private function setShadowProperiesMapValues(array $properties_map, &$reference = null)
{
@@ -381,9 +378,9 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
foreach ($properties_map as $property_key => $property_val) {
if (is_array($property_val)) {
if ($reference === null) {
- $reference = & $this->shadowProperties[$property_key];
+ $reference = &$this->shadowProperties[$property_key];
} else {
- $reference = & $reference[$property_key];
+ $reference = &$reference[$property_key];
}
$this->setShadowProperiesMapValues($property_val, $reference);
} else {
@@ -399,13 +396,13 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Set Shadow Color
+ * Set Shadow Color.
*
* @param string $color
* @param int $alpha
* @param string $type
*
- * @return PHPExcel_Chart_Axis
+ * @return Axis
*/
private function setShadowColor($color, $alpha, $type)
{
@@ -415,11 +412,11 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Set Shadow Blur
+ * Set Shadow Blur.
*
* @param float $blur
*
- * @return PHPExcel_Chart_Axis
+ * @return Axis
*/
private function setShadowBlur($blur)
{
@@ -431,11 +428,11 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Set Shadow Angle
+ * Set Shadow Angle.
*
* @param int $angle
*
- * @return PHPExcel_Chart_Axis
+ * @return Axis
*/
private function setShadowAngle($angle)
{
@@ -447,11 +444,11 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Set Shadow Distance
+ * Set Shadow Distance.
*
* @param float $distance
*
- * @return PHPExcel_Chart_Axis
+ * @return Axis
*/
private function setShadowDistance($distance)
{
@@ -463,12 +460,11 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Get Glow Property
+ * Get Shadow Property.
*
- * @param float $size
- * @param string $color_value
- * @param int $color_alpha
- * @param string $color_type
+ * @param string|string[] $elements
+ *
+ * @return null|array|int|string
*/
public function getShadowProperty($elements)
{
@@ -476,7 +472,7 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Set Glow Properties
+ * Set Glow Properties.
*
* @param float $size
* @param string $color_value
@@ -487,14 +483,14 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
{
$this->setGlowSize($size)
->setGlowColor(
- is_null($color_value) ? $this->glowProperties['color']['value'] : $color_value,
- is_null($color_alpha) ? (int) $this->glowProperties['color']['alpha'] : $color_alpha,
- is_null($color_type) ? $this->glowProperties['color']['type'] : $color_type
+ $color_value === null ? $this->glowProperties['color']['value'] : $color_value,
+ $color_alpha === null ? (int) $this->glowProperties['color']['alpha'] : $color_alpha,
+ $color_type === null ? $this->glowProperties['color']['type'] : $color_type
);
}
/**
- * Get Glow Property
+ * Get Glow Property.
*
* @param array|string $property
*
@@ -506,15 +502,15 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Set Glow Color
+ * Set Glow Color.
*
* @param float $size
*
- * @return PHPExcel_Chart_Axis
+ * @return Axis
*/
private function setGlowSize($size)
{
- if (!is_null($size)) {
+ if ($size !== null) {
$this->glowProperties['size'] = $this->getExcelPointsWidth($size);
}
@@ -522,13 +518,13 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Set Glow Color
+ * Set Glow Color.
*
* @param string $color
* @param int $alpha
* @param string $type
*
- * @return PHPExcel_Chart_Axis
+ * @return Axis
*/
private function setGlowColor($color, $alpha, $type)
{
@@ -538,19 +534,19 @@ class PHPExcel_Chart_Axis extends PHPExcel_Chart_Properties
}
/**
- * Set Soft Edges Size
+ * Set Soft Edges Size.
*
* @param float $size
*/
public function setSoftEdges($size)
{
- if (!is_null($size)) {
+ if ($size !== null) {
$softEdges['size'] = (string) $this->getExcelPointsWidth($size);
}
}
/**
- * Get Soft Edges Size
+ * Get Soft Edges Size.
*
* @return string
*/
diff --git a/lib/phpexcel/PHPExcel/Chart.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Chart.php
similarity index 51%
rename from lib/phpexcel/PHPExcel/Chart.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Chart.php
index d7799935b4f..3d09a041d57 100644
--- a/lib/phpexcel/PHPExcel/Chart.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Chart.php
@@ -1,175 +1,162 @@
name = $name;
$this->title = $title;
@@ -186,7 +173,7 @@ class PHPExcel_Chart
}
/**
- * Get Name
+ * Get Name.
*
* @return string
*/
@@ -196,9 +183,9 @@ class PHPExcel_Chart
}
/**
- * Get Worksheet
+ * Get Worksheet.
*
- * @return PHPExcel_Worksheet
+ * @return Worksheet
*/
public function getWorksheet()
{
@@ -206,13 +193,13 @@ class PHPExcel_Chart
}
/**
- * Set Worksheet
+ * Set Worksheet.
*
- * @param PHPExcel_Worksheet $pValue
- * @throws PHPExcel_Chart_Exception
- * @return PHPExcel_Chart
+ * @param Worksheet $pValue
+ *
+ * @return Chart
*/
- public function setWorksheet(PHPExcel_Worksheet $pValue = null)
+ public function setWorksheet(Worksheet $pValue = null)
{
$this->worksheet = $pValue;
@@ -220,9 +207,9 @@ class PHPExcel_Chart
}
/**
- * Get Title
+ * Get Title.
*
- * @return PHPExcel_Chart_Title
+ * @return Title
*/
public function getTitle()
{
@@ -230,12 +217,13 @@ class PHPExcel_Chart
}
/**
- * Set Title
+ * Set Title.
*
- * @param PHPExcel_Chart_Title $title
- * @return PHPExcel_Chart
+ * @param Title $title
+ *
+ * @return Chart
*/
- public function setTitle(PHPExcel_Chart_Title $title)
+ public function setTitle(Title $title)
{
$this->title = $title;
@@ -243,9 +231,9 @@ class PHPExcel_Chart
}
/**
- * Get Legend
+ * Get Legend.
*
- * @return PHPExcel_Chart_Legend
+ * @return Legend
*/
public function getLegend()
{
@@ -253,12 +241,13 @@ class PHPExcel_Chart
}
/**
- * Set Legend
+ * Set Legend.
*
- * @param PHPExcel_Chart_Legend $legend
- * @return PHPExcel_Chart
+ * @param Legend $legend
+ *
+ * @return Chart
*/
- public function setLegend(PHPExcel_Chart_Legend $legend)
+ public function setLegend(Legend $legend)
{
$this->legend = $legend;
@@ -266,9 +255,9 @@ class PHPExcel_Chart
}
/**
- * Get X-Axis Label
+ * Get X-Axis Label.
*
- * @return PHPExcel_Chart_Title
+ * @return Title
*/
public function getXAxisLabel()
{
@@ -276,12 +265,13 @@ class PHPExcel_Chart
}
/**
- * Set X-Axis Label
+ * Set X-Axis Label.
*
- * @param PHPExcel_Chart_Title $label
- * @return PHPExcel_Chart
+ * @param Title $label
+ *
+ * @return Chart
*/
- public function setXAxisLabel(PHPExcel_Chart_Title $label)
+ public function setXAxisLabel(Title $label)
{
$this->xAxisLabel = $label;
@@ -289,9 +279,9 @@ class PHPExcel_Chart
}
/**
- * Get Y-Axis Label
+ * Get Y-Axis Label.
*
- * @return PHPExcel_Chart_Title
+ * @return Title
*/
public function getYAxisLabel()
{
@@ -299,12 +289,13 @@ class PHPExcel_Chart
}
/**
- * Set Y-Axis Label
+ * Set Y-Axis Label.
*
- * @param PHPExcel_Chart_Title $label
- * @return PHPExcel_Chart
+ * @param Title $label
+ *
+ * @return Chart
*/
- public function setYAxisLabel(PHPExcel_Chart_Title $label)
+ public function setYAxisLabel(Title $label)
{
$this->yAxisLabel = $label;
@@ -312,9 +303,9 @@ class PHPExcel_Chart
}
/**
- * Get Plot Area
+ * Get Plot Area.
*
- * @return PHPExcel_Chart_PlotArea
+ * @return PlotArea
*/
public function getPlotArea()
{
@@ -322,9 +313,9 @@ class PHPExcel_Chart
}
/**
- * Get Plot Visible Only
+ * Get Plot Visible Only.
*
- * @return boolean
+ * @return bool
*/
public function getPlotVisibleOnly()
{
@@ -332,12 +323,13 @@ class PHPExcel_Chart
}
/**
- * Set Plot Visible Only
+ * Set Plot Visible Only.
*
- * @param boolean $plotVisibleOnly
- * @return PHPExcel_Chart
+ * @param bool $plotVisibleOnly
+ *
+ * @return Chart
*/
- public function setPlotVisibleOnly($plotVisibleOnly = true)
+ public function setPlotVisibleOnly($plotVisibleOnly)
{
$this->plotVisibleOnly = $plotVisibleOnly;
@@ -345,7 +337,7 @@ class PHPExcel_Chart
}
/**
- * Get Display Blanks as
+ * Get Display Blanks as.
*
* @return string
*/
@@ -355,21 +347,23 @@ class PHPExcel_Chart
}
/**
- * Set Display Blanks as
+ * Set Display Blanks as.
*
* @param string $displayBlanksAs
- * @return PHPExcel_Chart
+ *
+ * @return Chart
*/
- public function setDisplayBlanksAs($displayBlanksAs = '0')
+ public function setDisplayBlanksAs($displayBlanksAs)
{
$this->displayBlanksAs = $displayBlanksAs;
+
+ return $this;
}
-
/**
- * Get yAxis
+ * Get yAxis.
*
- * @return PHPExcel_Chart_Axis
+ * @return Axis
*/
public function getChartAxisY()
{
@@ -377,13 +371,13 @@ class PHPExcel_Chart
return $this->yAxis;
}
- return new PHPExcel_Chart_Axis();
+ return new Axis();
}
/**
- * Get xAxis
+ * Get xAxis.
*
- * @return PHPExcel_Chart_Axis
+ * @return Axis
*/
public function getChartAxisX()
{
@@ -391,13 +385,13 @@ class PHPExcel_Chart
return $this->xAxis;
}
- return new PHPExcel_Chart_Axis();
+ return new Axis();
}
/**
- * Get Major Gridlines
+ * Get Major Gridlines.
*
- * @return PHPExcel_Chart_GridLines
+ * @return GridLines
*/
public function getMajorGridlines()
{
@@ -405,13 +399,13 @@ class PHPExcel_Chart
return $this->majorGridlines;
}
- return new PHPExcel_Chart_GridLines();
+ return new GridLines();
}
/**
- * Get Minor Gridlines
+ * Get Minor Gridlines.
*
- * @return PHPExcel_Chart_GridLines
+ * @return GridLines
*/
public function getMinorGridlines()
{
@@ -419,25 +413,25 @@ class PHPExcel_Chart
return $this->minorGridlines;
}
- return new PHPExcel_Chart_GridLines();
+ return new GridLines();
}
-
/**
- * Set the Top Left position for the chart
+ * Set the Top Left position for the chart.
*
- * @param string $cell
- * @param integer $xOffset
- * @param integer $yOffset
- * @return PHPExcel_Chart
+ * @param string $cell
+ * @param int $xOffset
+ * @param int $yOffset
+ *
+ * @return Chart
*/
public function setTopLeftPosition($cell, $xOffset = null, $yOffset = null)
{
$this->topLeftCellRef = $cell;
- if (!is_null($xOffset)) {
+ if ($xOffset !== null) {
$this->setTopLeftXOffset($xOffset);
}
- if (!is_null($yOffset)) {
+ if ($yOffset !== null) {
$this->setTopLeftYOffset($yOffset);
}
@@ -445,21 +439,21 @@ class PHPExcel_Chart
}
/**
- * Get the top left position of the chart
+ * Get the top left position of the chart.
*
- * @return array an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell
+ * @return array an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell
*/
public function getTopLeftPosition()
{
- return array(
- 'cell' => $this->topLeftCellRef,
+ return [
+ 'cell' => $this->topLeftCellRef,
'xOffset' => $this->topLeftXOffset,
- 'yOffset' => $this->topLeftYOffset
- );
+ 'yOffset' => $this->topLeftYOffset,
+ ];
}
/**
- * Get the cell address where the top left of the chart is fixed
+ * Get the cell address where the top left of the chart is fixed.
*
* @return string
*/
@@ -469,10 +463,11 @@ class PHPExcel_Chart
}
/**
- * Set the Top Left cell position for the chart
+ * Set the Top Left cell position for the chart.
*
- * @param string $cell
- * @return PHPExcel_Chart
+ * @param string $cell
+ *
+ * @return Chart
*/
public function setTopLeftCell($cell)
{
@@ -482,18 +477,20 @@ class PHPExcel_Chart
}
/**
- * Set the offset position within the Top Left cell for the chart
+ * Set the offset position within the Top Left cell for the chart.
*
- * @param integer $xOffset
- * @param integer $yOffset
- * @return PHPExcel_Chart
+ * @param int $xOffset
+ * @param int $yOffset
+ *
+ * @return Chart
*/
- public function setTopLeftOffset($xOffset = null, $yOffset = null)
+ public function setTopLeftOffset($xOffset, $yOffset)
{
- if (!is_null($xOffset)) {
+ if ($xOffset !== null) {
$this->setTopLeftXOffset($xOffset);
}
- if (!is_null($yOffset)) {
+
+ if ($yOffset !== null) {
$this->setTopLeftYOffset($yOffset);
}
@@ -501,16 +498,16 @@ class PHPExcel_Chart
}
/**
- * Get the offset position within the Top Left cell for the chart
+ * Get the offset position within the Top Left cell for the chart.
*
- * @return integer[]
+ * @return int[]
*/
public function getTopLeftOffset()
{
- return array(
+ return [
'X' => $this->topLeftXOffset,
- 'Y' => $this->topLeftYOffset
- );
+ 'Y' => $this->topLeftYOffset,
+ ];
}
public function setTopLeftXOffset($xOffset)
@@ -538,20 +535,21 @@ class PHPExcel_Chart
}
/**
- * Set the Bottom Right position of the chart
+ * Set the Bottom Right position of the chart.
*
- * @param string $cell
- * @param integer $xOffset
- * @param integer $yOffset
- * @return PHPExcel_Chart
+ * @param string $cell
+ * @param int $xOffset
+ * @param int $yOffset
+ *
+ * @return Chart
*/
public function setBottomRightPosition($cell, $xOffset = null, $yOffset = null)
{
$this->bottomRightCellRef = $cell;
- if (!is_null($xOffset)) {
+ if ($xOffset !== null) {
$this->setBottomRightXOffset($xOffset);
}
- if (!is_null($yOffset)) {
+ if ($yOffset !== null) {
$this->setBottomRightYOffset($yOffset);
}
@@ -559,17 +557,17 @@ class PHPExcel_Chart
}
/**
- * Get the bottom right position of the chart
+ * Get the bottom right position of the chart.
*
- * @return array an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell
+ * @return array an associative array containing the cell address, X-Offset and Y-Offset from the top left of that cell
*/
public function getBottomRightPosition()
{
- return array(
- 'cell' => $this->bottomRightCellRef,
+ return [
+ 'cell' => $this->bottomRightCellRef,
'xOffset' => $this->bottomRightXOffset,
- 'yOffset' => $this->bottomRightYOffset
- );
+ 'yOffset' => $this->bottomRightYOffset,
+ ];
}
public function setBottomRightCell($cell)
@@ -580,7 +578,7 @@ class PHPExcel_Chart
}
/**
- * Get the cell address where the bottom right of the chart is fixed
+ * Get the cell address where the bottom right of the chart is fixed.
*
* @return string
*/
@@ -590,18 +588,20 @@ class PHPExcel_Chart
}
/**
- * Set the offset position within the Bottom Right cell for the chart
+ * Set the offset position within the Bottom Right cell for the chart.
*
- * @param integer $xOffset
- * @param integer $yOffset
- * @return PHPExcel_Chart
+ * @param int $xOffset
+ * @param int $yOffset
+ *
+ * @return Chart
*/
- public function setBottomRightOffset($xOffset = null, $yOffset = null)
+ public function setBottomRightOffset($xOffset, $yOffset)
{
- if (!is_null($xOffset)) {
+ if ($xOffset !== null) {
$this->setBottomRightXOffset($xOffset);
}
- if (!is_null($yOffset)) {
+
+ if ($yOffset !== null) {
$this->setBottomRightYOffset($yOffset);
}
@@ -609,16 +609,16 @@ class PHPExcel_Chart
}
/**
- * Get the offset position within the Bottom Right cell for the chart
+ * Get the offset position within the Bottom Right cell for the chart.
*
- * @return integer[]
+ * @return int[]
*/
public function getBottomRightOffset()
{
- return array(
+ return [
'X' => $this->bottomRightXOffset,
- 'Y' => $this->bottomRightYOffset
- );
+ 'Y' => $this->bottomRightYOffset,
+ ];
}
public function setBottomRightXOffset($xOffset)
@@ -645,7 +645,6 @@ class PHPExcel_Chart
return $this->bottomRightYOffset;
}
-
public function refresh()
{
if ($this->worksheet !== null) {
@@ -653,28 +652,29 @@ class PHPExcel_Chart
}
}
+ /**
+ * Render the chart to given file (or stream).
+ *
+ * @param string $outputDestination Name of the file render to
+ *
+ * @return bool true on success
+ */
public function render($outputDestination = null)
{
- $libraryName = PHPExcel_Settings::getChartRendererName();
- if (is_null($libraryName)) {
- return false;
- }
- // Ensure that data series values are up-to-date before we render
- $this->refresh();
-
- $libraryPath = PHPExcel_Settings::getChartRendererPath();
- $includePath = str_replace('\\', '/', get_include_path());
- $rendererPath = str_replace('\\', '/', $libraryPath);
- if (strpos($rendererPath, $includePath) === false) {
- set_include_path(get_include_path() . PATH_SEPARATOR . $libraryPath);
- }
-
- $rendererName = 'PHPExcel_Chart_Renderer_'.$libraryName;
- $renderer = new $rendererName($this);
-
if ($outputDestination == 'php://output') {
$outputDestination = null;
}
+
+ $libraryName = Settings::getChartRenderer();
+ if ($libraryName === null) {
+ return false;
+ }
+
+ // Ensure that data series values are up-to-date before we render
+ $this->refresh();
+
+ $renderer = new $libraryName($this);
+
return $renderer->render($outputDestination);
}
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeries.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeries.php
new file mode 100644
index 00000000000..8056bbeea27
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeries.php
@@ -0,0 +1,390 @@
+plotType = $plotType;
+ $this->plotGrouping = $plotGrouping;
+ $this->plotOrder = $plotOrder;
+ $keys = array_keys($plotValues);
+ $this->plotValues = $plotValues;
+ if ((count($plotLabel) == 0) || ($plotLabel[$keys[0]] === null)) {
+ $plotLabel[$keys[0]] = new DataSeriesValues();
+ }
+ $this->plotLabel = $plotLabel;
+
+ if ((count($plotCategory) == 0) || ($plotCategory[$keys[0]] === null)) {
+ $plotCategory[$keys[0]] = new DataSeriesValues();
+ }
+ $this->plotCategory = $plotCategory;
+
+ $this->smoothLine = $smoothLine;
+ $this->plotStyle = $plotStyle;
+
+ if ($plotDirection === null) {
+ $plotDirection = self::DIRECTION_COL;
+ }
+ $this->plotDirection = $plotDirection;
+ }
+
+ /**
+ * Get Plot Type.
+ *
+ * @return string
+ */
+ public function getPlotType()
+ {
+ return $this->plotType;
+ }
+
+ /**
+ * Set Plot Type.
+ *
+ * @param string $plotType
+ *
+ * @return DataSeries
+ */
+ public function setPlotType($plotType)
+ {
+ $this->plotType = $plotType;
+
+ return $this;
+ }
+
+ /**
+ * Get Plot Grouping Type.
+ *
+ * @return string
+ */
+ public function getPlotGrouping()
+ {
+ return $this->plotGrouping;
+ }
+
+ /**
+ * Set Plot Grouping Type.
+ *
+ * @param string $groupingType
+ *
+ * @return DataSeries
+ */
+ public function setPlotGrouping($groupingType)
+ {
+ $this->plotGrouping = $groupingType;
+
+ return $this;
+ }
+
+ /**
+ * Get Plot Direction.
+ *
+ * @return string
+ */
+ public function getPlotDirection()
+ {
+ return $this->plotDirection;
+ }
+
+ /**
+ * Set Plot Direction.
+ *
+ * @param string $plotDirection
+ *
+ * @return DataSeries
+ */
+ public function setPlotDirection($plotDirection)
+ {
+ $this->plotDirection = $plotDirection;
+
+ return $this;
+ }
+
+ /**
+ * Get Plot Order.
+ *
+ * @return int[]
+ */
+ public function getPlotOrder()
+ {
+ return $this->plotOrder;
+ }
+
+ /**
+ * Get Plot Labels.
+ *
+ * @return array of DataSeriesValues
+ */
+ public function getPlotLabels()
+ {
+ return $this->plotLabel;
+ }
+
+ /**
+ * Get Plot Label by Index.
+ *
+ * @param mixed $index
+ *
+ * @return DataSeriesValues
+ */
+ public function getPlotLabelByIndex($index)
+ {
+ $keys = array_keys($this->plotLabel);
+ if (in_array($index, $keys)) {
+ return $this->plotLabel[$index];
+ } elseif (isset($keys[$index])) {
+ return $this->plotLabel[$keys[$index]];
+ }
+
+ return false;
+ }
+
+ /**
+ * Get Plot Categories.
+ *
+ * @return array of DataSeriesValues
+ */
+ public function getPlotCategories()
+ {
+ return $this->plotCategory;
+ }
+
+ /**
+ * Get Plot Category by Index.
+ *
+ * @param mixed $index
+ *
+ * @return DataSeriesValues
+ */
+ public function getPlotCategoryByIndex($index)
+ {
+ $keys = array_keys($this->plotCategory);
+ if (in_array($index, $keys)) {
+ return $this->plotCategory[$index];
+ } elseif (isset($keys[$index])) {
+ return $this->plotCategory[$keys[$index]];
+ }
+
+ return false;
+ }
+
+ /**
+ * Get Plot Style.
+ *
+ * @return null|string
+ */
+ public function getPlotStyle()
+ {
+ return $this->plotStyle;
+ }
+
+ /**
+ * Set Plot Style.
+ *
+ * @param null|string $plotStyle
+ *
+ * @return DataSeries
+ */
+ public function setPlotStyle($plotStyle)
+ {
+ $this->plotStyle = $plotStyle;
+
+ return $this;
+ }
+
+ /**
+ * Get Plot Values.
+ *
+ * @return array of DataSeriesValues
+ */
+ public function getPlotValues()
+ {
+ return $this->plotValues;
+ }
+
+ /**
+ * Get Plot Values by Index.
+ *
+ * @param mixed $index
+ *
+ * @return DataSeriesValues
+ */
+ public function getPlotValuesByIndex($index)
+ {
+ $keys = array_keys($this->plotValues);
+ if (in_array($index, $keys)) {
+ return $this->plotValues[$index];
+ } elseif (isset($keys[$index])) {
+ return $this->plotValues[$keys[$index]];
+ }
+
+ return false;
+ }
+
+ /**
+ * Get Number of Plot Series.
+ *
+ * @return int
+ */
+ public function getPlotSeriesCount()
+ {
+ return count($this->plotValues);
+ }
+
+ /**
+ * Get Smooth Line.
+ *
+ * @return bool
+ */
+ public function getSmoothLine()
+ {
+ return $this->smoothLine;
+ }
+
+ /**
+ * Set Smooth Line.
+ *
+ * @param bool $smoothLine
+ *
+ * @return DataSeries
+ */
+ public function setSmoothLine($smoothLine)
+ {
+ $this->smoothLine = $smoothLine;
+
+ return $this;
+ }
+
+ public function refresh(Worksheet $worksheet)
+ {
+ foreach ($this->plotValues as $plotValues) {
+ if ($plotValues !== null) {
+ $plotValues->refresh($worksheet, true);
+ }
+ }
+ foreach ($this->plotLabel as $plotValues) {
+ if ($plotValues !== null) {
+ $plotValues->refresh($worksheet, true);
+ }
+ }
+ foreach ($this->plotCategory as $plotValues) {
+ if ($plotValues !== null) {
+ $plotValues->refresh($worksheet, false);
+ }
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeriesValues.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeriesValues.php
new file mode 100644
index 00000000000..e82b7efecfb
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/DataSeriesValues.php
@@ -0,0 +1,401 @@
+setDataType($dataType);
+ $this->dataSource = $dataSource;
+ $this->formatCode = $formatCode;
+ $this->pointCount = $pointCount;
+ $this->dataValues = $dataValues;
+ $this->pointMarker = $marker;
+ $this->fillColor = $fillColor;
+ }
+
+ /**
+ * Get Series Data Type.
+ *
+ * @return string
+ */
+ public function getDataType()
+ {
+ return $this->dataType;
+ }
+
+ /**
+ * Set Series Data Type.
+ *
+ * @param string $dataType Datatype of this data series
+ * Typical values are:
+ * DataSeriesValues::DATASERIES_TYPE_STRING
+ * Normally used for axis point values
+ * DataSeriesValues::DATASERIES_TYPE_NUMBER
+ * Normally used for chart data values
+ *
+ * @throws Exception
+ *
+ * @return DataSeriesValues
+ */
+ public function setDataType($dataType)
+ {
+ if (!in_array($dataType, self::$dataTypeValues)) {
+ throw new Exception('Invalid datatype for chart data series values');
+ }
+ $this->dataType = $dataType;
+
+ return $this;
+ }
+
+ /**
+ * Get Series Data Source (formula).
+ *
+ * @return string
+ */
+ public function getDataSource()
+ {
+ return $this->dataSource;
+ }
+
+ /**
+ * Set Series Data Source (formula).
+ *
+ * @param string $dataSource
+ *
+ * @return DataSeriesValues
+ */
+ public function setDataSource($dataSource)
+ {
+ $this->dataSource = $dataSource;
+
+ return $this;
+ }
+
+ /**
+ * Get Point Marker.
+ *
+ * @return string
+ */
+ public function getPointMarker()
+ {
+ return $this->pointMarker;
+ }
+
+ /**
+ * Set Point Marker.
+ *
+ * @param string $marker
+ *
+ * @return DataSeriesValues
+ */
+ public function setPointMarker($marker)
+ {
+ $this->pointMarker = $marker;
+
+ return $this;
+ }
+
+ /**
+ * Get Series Format Code.
+ *
+ * @return string
+ */
+ public function getFormatCode()
+ {
+ return $this->formatCode;
+ }
+
+ /**
+ * Set Series Format Code.
+ *
+ * @param string $formatCode
+ *
+ * @return DataSeriesValues
+ */
+ public function setFormatCode($formatCode)
+ {
+ $this->formatCode = $formatCode;
+
+ return $this;
+ }
+
+ /**
+ * Get Series Point Count.
+ *
+ * @return int
+ */
+ public function getPointCount()
+ {
+ return $this->pointCount;
+ }
+
+ /**
+ * Get fill color.
+ *
+ * @return string|string[] HEX color or array with HEX colors
+ */
+ public function getFillColor()
+ {
+ return $this->fillColor;
+ }
+
+ /**
+ * Set fill color for series.
+ *
+ * @param string|string[] $color HEX color or array with HEX colors
+ *
+ * @return DataSeriesValues
+ */
+ public function setFillColor($color)
+ {
+ if (is_array($color)) {
+ foreach ($color as $colorValue) {
+ $this->validateColor($colorValue);
+ }
+ } else {
+ $this->validateColor($color);
+ }
+ $this->fillColor = $color;
+
+ return $this;
+ }
+
+ /**
+ * Method for validating hex color.
+ *
+ * @param string $color value for color
+ *
+ * @throws \Exception thrown if color is invalid
+ *
+ * @return bool true if validation was successful
+ */
+ private function validateColor($color)
+ {
+ if (!preg_match('/^[a-f0-9]{6}$/i', $color)) {
+ throw new Exception(sprintf('Invalid hex color for chart series (color: "%s")', $color));
+ }
+
+ return true;
+ }
+
+ /**
+ * Get line width for series.
+ *
+ * @return int
+ */
+ public function getLineWidth()
+ {
+ return $this->lineWidth;
+ }
+
+ /**
+ * Set line width for the series.
+ *
+ * @param int $width
+ *
+ * @return DataSeriesValues
+ */
+ public function setLineWidth($width)
+ {
+ $minWidth = 12700;
+ $this->lineWidth = max($minWidth, $width);
+
+ return $this;
+ }
+
+ /**
+ * Identify if the Data Series is a multi-level or a simple series.
+ *
+ * @return null|bool
+ */
+ public function isMultiLevelSeries()
+ {
+ if (count($this->dataValues) > 0) {
+ return is_array(array_values($this->dataValues)[0]);
+ }
+
+ return null;
+ }
+
+ /**
+ * Return the level count of a multi-level Data Series.
+ *
+ * @return int
+ */
+ public function multiLevelCount()
+ {
+ $levelCount = 0;
+ foreach ($this->dataValues as $dataValueSet) {
+ $levelCount = max($levelCount, count($dataValueSet));
+ }
+
+ return $levelCount;
+ }
+
+ /**
+ * Get Series Data Values.
+ *
+ * @return array of mixed
+ */
+ public function getDataValues()
+ {
+ return $this->dataValues;
+ }
+
+ /**
+ * Get the first Series Data value.
+ *
+ * @return mixed
+ */
+ public function getDataValue()
+ {
+ $count = count($this->dataValues);
+ if ($count == 0) {
+ return null;
+ } elseif ($count == 1) {
+ return $this->dataValues[0];
+ }
+
+ return $this->dataValues;
+ }
+
+ /**
+ * Set Series Data Values.
+ *
+ * @param array $dataValues
+ *
+ * @return DataSeriesValues
+ */
+ public function setDataValues($dataValues)
+ {
+ $this->dataValues = Functions::flattenArray($dataValues);
+ $this->pointCount = count($dataValues);
+
+ return $this;
+ }
+
+ public function refresh(Worksheet $worksheet, $flatten = true)
+ {
+ if ($this->dataSource !== null) {
+ $calcEngine = Calculation::getInstance($worksheet->getParent());
+ $newDataValues = Calculation::unwrapResult(
+ $calcEngine->_calculateFormulaValue(
+ '=' . $this->dataSource,
+ null,
+ $worksheet->getCell('A1')
+ )
+ );
+ if ($flatten) {
+ $this->dataValues = Functions::flattenArray($newDataValues);
+ foreach ($this->dataValues as &$dataValue) {
+ if ((!empty($dataValue)) && ($dataValue[0] == '#')) {
+ $dataValue = 0.0;
+ }
+ }
+ unset($dataValue);
+ } else {
+ list($worksheet, $cellRange) = Worksheet::extractSheetTitle($this->dataSource, true);
+ $dimensions = Coordinate::rangeDimension(str_replace('$', '', $cellRange));
+ if (($dimensions[0] == 1) || ($dimensions[1] == 1)) {
+ $this->dataValues = Functions::flattenArray($newDataValues);
+ } else {
+ $newArray = array_values(array_shift($newDataValues));
+ foreach ($newArray as $i => $newDataSet) {
+ $newArray[$i] = [$newDataSet];
+ }
+
+ foreach ($newDataValues as $newDataSet) {
+ $i = 0;
+ foreach ($newDataSet as $newDataVal) {
+ array_unshift($newArray[$i++], $newDataVal);
+ }
+ }
+ $this->dataValues = $newArray;
+ }
+ }
+ $this->pointCount = count($this->dataValues);
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Exception.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Exception.php
new file mode 100644
index 00000000000..3f95b599127
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Exception.php
@@ -0,0 +1,9 @@
+ array(
+ private $lineProperties = [
+ 'color' => [
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
'value' => null,
- 'alpha' => 0
- ),
- 'style' => array(
+ 'alpha' => 0,
+ ],
+ 'style' => [
'width' => '9525',
'compound' => self::LINE_STYLE_COMPOUND_SIMPLE,
'dash' => self::LINE_STYLE_DASH_SOLID,
'cap' => self::LINE_STYLE_CAP_FLAT,
'join' => self::LINE_STYLE_JOIN_BEVEL,
- 'arrow' => array(
- 'head' => array(
+ 'arrow' => [
+ 'head' => [
'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
- 'size' => self::LINE_STYLE_ARROW_SIZE_5
- ),
- 'end' => array(
+ 'size' => self::LINE_STYLE_ARROW_SIZE_5,
+ ],
+ 'end' => [
'type' => self::LINE_STYLE_ARROW_TYPE_NOARROW,
- 'size' => self::LINE_STYLE_ARROW_SIZE_8
- ),
- )
- )
- );
+ 'size' => self::LINE_STYLE_ARROW_SIZE_8,
+ ],
+ ],
+ ],
+ ];
- private $shadowProperties = array(
+ private $shadowProperties = [
'presets' => self::SHADOW_PRESETS_NOSHADOW,
'effect' => null,
- 'color' => array(
+ 'color' => [
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
'value' => 'black',
'alpha' => 85,
- ),
- 'size' => array(
+ ],
+ 'size' => [
'sx' => null,
'sy' => null,
- 'kx' => null
- ),
+ 'kx' => null,
+ ],
'blur' => null,
'direction' => null,
'distance' => null,
'algn' => null,
- 'rotWithShape' => null
- );
+ 'rotWithShape' => null,
+ ];
- private $glowProperties = array(
+ private $glowProperties = [
'size' => null,
- 'color' => array(
+ 'color' => [
'type' => self::EXCEL_COLOR_TYPE_STANDARD,
'value' => 'black',
- 'alpha' => 40
- )
- );
+ 'alpha' => 40,
+ ],
+ ];
- private $softEdges = array(
- 'size' => null
- );
+ private $softEdges = [
+ 'size' => null,
+ ];
/**
- * Get Object State
+ * Get Object State.
*
* @return bool
*/
-
public function getObjectState()
{
return $this->objectState;
}
/**
- * Change Object State to True
+ * Change Object State to True.
*
- * @return PHPExcel_Chart_GridLines
+ * @return GridLines
*/
-
private function activateObject()
{
$this->objectState = true;
@@ -105,13 +101,12 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
}
/**
- * Set Line Color Properties
+ * Set Line Color Properties.
*
* @param string $value
* @param int $alpha
* @param string $type
*/
-
public function setLineColorProperties($value, $alpha = 0, $type = self::EXCEL_COLOR_TYPE_STANDARD)
{
$this->activateObject()
@@ -123,7 +118,7 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
}
/**
- * Set Line Color Properties
+ * Set Line Color Properties.
*
* @param float $line_width
* @param string $compound_type
@@ -135,115 +130,107 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
* @param string $end_arrow_type
* @param string $end_arrow_size
*/
-
public function setLineStyleProperties($line_width = null, $compound_type = null, $dash_type = null, $cap_type = null, $join_type = null, $head_arrow_type = null, $head_arrow_size = null, $end_arrow_type = null, $end_arrow_size = null)
{
$this->activateObject();
- (!is_null($line_width))
+ ($line_width !== null)
? $this->lineProperties['style']['width'] = $this->getExcelPointsWidth((float) $line_width)
: null;
- (!is_null($compound_type))
+ ($compound_type !== null)
? $this->lineProperties['style']['compound'] = (string) $compound_type
: null;
- (!is_null($dash_type))
+ ($dash_type !== null)
? $this->lineProperties['style']['dash'] = (string) $dash_type
: null;
- (!is_null($cap_type))
+ ($cap_type !== null)
? $this->lineProperties['style']['cap'] = (string) $cap_type
: null;
- (!is_null($join_type))
+ ($join_type !== null)
? $this->lineProperties['style']['join'] = (string) $join_type
: null;
- (!is_null($head_arrow_type))
+ ($head_arrow_type !== null)
? $this->lineProperties['style']['arrow']['head']['type'] = (string) $head_arrow_type
: null;
- (!is_null($head_arrow_size))
+ ($head_arrow_size !== null)
? $this->lineProperties['style']['arrow']['head']['size'] = (string) $head_arrow_size
: null;
- (!is_null($end_arrow_type))
+ ($end_arrow_type !== null)
? $this->lineProperties['style']['arrow']['end']['type'] = (string) $end_arrow_type
: null;
- (!is_null($end_arrow_size))
+ ($end_arrow_size !== null)
? $this->lineProperties['style']['arrow']['end']['size'] = (string) $end_arrow_size
: null;
}
/**
- * Get Line Color Property
+ * Get Line Color Property.
*
* @param string $parameter
*
* @return string
*/
-
public function getLineColorProperty($parameter)
{
return $this->lineProperties['color'][$parameter];
}
/**
- * Get Line Style Property
+ * Get Line Style Property.
*
- * @param array|string $elements
+ * @param array|string $elements
*
* @return string
*/
-
public function getLineStyleProperty($elements)
{
return $this->getArrayElementsValue($this->lineProperties['style'], $elements);
}
/**
- * Set Glow Properties
- *
- * @param float $size
- * @param string $color_value
- * @param int $color_alpha
- * @param string $color_type
+ * Set Glow Properties.
*
+ * @param float $size
+ * @param string $color_value
+ * @param int $color_alpha
+ * @param string $color_type
*/
-
public function setGlowProperties($size, $color_value = null, $color_alpha = null, $color_type = null)
{
$this
- ->activateObject()
- ->setGlowSize($size)
- ->setGlowColor($color_value, $color_alpha, $color_type);
+ ->activateObject()
+ ->setGlowSize($size)
+ ->setGlowColor($color_value, $color_alpha, $color_type);
}
/**
- * Get Glow Color Property
+ * Get Glow Color Property.
*
* @param string $property
*
* @return string
*/
-
public function getGlowColor($property)
{
return $this->glowProperties['color'][$property];
}
/**
- * Get Glow Size
+ * Get Glow Size.
*
* @return string
*/
-
public function getGlowSize()
{
return $this->glowProperties['size'];
}
/**
- * Set Glow Size
+ * Set Glow Size.
*
* @param float $size
*
- * @return PHPExcel_Chart_GridLines
+ * @return GridLines
*/
-
private function setGlowSize($size)
{
$this->glowProperties['size'] = $this->getExcelPointsWidth((float) $size);
@@ -252,24 +239,23 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
}
/**
- * Set Glow Color
+ * Set Glow Color.
*
* @param string $color
* @param int $alpha
* @param string $type
*
- * @return PHPExcel_Chart_GridLines
+ * @return GridLines
*/
-
private function setGlowColor($color, $alpha, $type)
{
- if (!is_null($color)) {
+ if ($color !== null) {
$this->glowProperties['color']['value'] = (string) $color;
}
- if (!is_null($alpha)) {
+ if ($alpha !== null) {
$this->glowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha);
}
- if (!is_null($type)) {
+ if ($type !== null) {
$this->glowProperties['color']['type'] = (string) $type;
}
@@ -277,21 +263,20 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
}
/**
- * Get Line Style Arrow Parameters
+ * Get Line Style Arrow Parameters.
*
* @param string $arrow_selector
* @param string $property_selector
*
* @return string
*/
-
public function getLineStyleArrowParameters($arrow_selector, $property_selector)
{
return $this->getLineStyleArrowSize($this->lineProperties['style']['arrow'][$arrow_selector]['size'], $property_selector);
}
/**
- * Set Shadow Properties
+ * Set Shadow Properties.
*
* @param int $sh_presets
* @param string $sh_color_value
@@ -300,17 +285,15 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
* @param string $sh_blur
* @param int $sh_angle
* @param float $sh_distance
- *
*/
-
public function setShadowProperties($sh_presets, $sh_color_value = null, $sh_color_type = null, $sh_color_alpha = null, $sh_blur = null, $sh_angle = null, $sh_distance = null)
{
$this->activateObject()
->setShadowPresetsProperties((int) $sh_presets)
->setShadowColor(
- is_null($sh_color_value) ? $this->shadowProperties['color']['value'] : $sh_color_value,
- is_null($sh_color_alpha) ? (int) $this->shadowProperties['color']['alpha'] : $this->getTrueAlpha($sh_color_alpha),
- is_null($sh_color_type) ? $this->shadowProperties['color']['type'] : $sh_color_type
+ $sh_color_value === null ? $this->shadowProperties['color']['value'] : $sh_color_value,
+ $sh_color_alpha === null ? (int) $this->shadowProperties['color']['alpha'] : $this->getTrueAlpha($sh_color_alpha),
+ $sh_color_type === null ? $this->shadowProperties['color']['type'] : $sh_color_type
)
->setShadowBlur($sh_blur)
->setShadowAngle($sh_angle)
@@ -318,13 +301,12 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
}
/**
- * Set Shadow Presets Properties
+ * Set Shadow Presets Properties.
*
* @param int $shadow_presets
*
- * @return PHPExcel_Chart_GridLines
+ * @return GridLines
*/
-
private function setShadowPresetsProperties($shadow_presets)
{
$this->shadowProperties['presets'] = $shadow_presets;
@@ -334,23 +316,22 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
}
/**
- * Set Shadow Properties Values
+ * Set Shadow Properties Values.
*
* @param array $properties_map
* @param * $reference
*
- * @return PHPExcel_Chart_GridLines
+ * @return GridLines
*/
-
private function setShadowProperiesMapValues(array $properties_map, &$reference = null)
{
$base_reference = $reference;
foreach ($properties_map as $property_key => $property_val) {
if (is_array($property_val)) {
if ($reference === null) {
- $reference = & $this->shadowProperties[$property_key];
+ $reference = &$this->shadowProperties[$property_key];
} else {
- $reference = & $reference[$property_key];
+ $reference = &$reference[$property_key];
}
$this->setShadowProperiesMapValues($property_val, $reference);
} else {
@@ -366,22 +347,23 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
}
/**
- * Set Shadow Color
+ * Set Shadow Color.
*
* @param string $color
* @param int $alpha
* @param string $type
- * @return PHPExcel_Chart_GridLines
+ *
+ * @return GridLines
*/
private function setShadowColor($color, $alpha, $type)
{
- if (!is_null($color)) {
+ if ($color !== null) {
$this->shadowProperties['color']['value'] = (string) $color;
}
- if (!is_null($alpha)) {
+ if ($alpha !== null) {
$this->shadowProperties['color']['alpha'] = $this->getTrueAlpha((int) $alpha);
}
- if (!is_null($type)) {
+ if ($type !== null) {
$this->shadowProperties['color']['type'] = (string) $type;
}
@@ -389,11 +371,11 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
}
/**
- * Set Shadow Blur
+ * Set Shadow Blur.
*
* @param float $blur
*
- * @return PHPExcel_Chart_GridLines
+ * @return GridLines
*/
private function setShadowBlur($blur)
{
@@ -405,12 +387,12 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
}
/**
- * Set Shadow Angle
+ * Set Shadow Angle.
*
* @param int $angle
- * @return PHPExcel_Chart_GridLines
+ *
+ * @return GridLines
*/
-
private function setShadowAngle($angle)
{
if ($angle !== null) {
@@ -421,10 +403,11 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
}
/**
- * Set Shadow Distance
+ * Set Shadow Distance.
*
* @param float $distance
- * @return PHPExcel_Chart_GridLines
+ *
+ * @return GridLines
*/
private function setShadowDistance($distance)
{
@@ -436,10 +419,10 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
}
/**
- * Get Shadow Property
+ * Get Shadow Property.
+ *
+ * @param string|string[] $elements
*
- * @param string $elements
- * @param array $elements
* @return string
*/
public function getShadowProperty($elements)
@@ -448,20 +431,20 @@ class PHPExcel_Chart_GridLines extends PHPExcel_Chart_Properties
}
/**
- * Set Soft Edges Size
+ * Set Soft Edges Size.
*
* @param float $size
*/
public function setSoftEdgesSize($size)
{
- if (!is_null($size)) {
+ if ($size !== null) {
$this->activateObject();
$softEdges['size'] = (string) $this->getExcelPointsWidth($size);
}
}
/**
- * Get Soft Edges Size
+ * Get Soft Edges Size.
*
* @return string
*/
diff --git a/lib/phpexcel/PHPExcel/Chart/Layout.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Layout.php
similarity index 66%
rename from lib/phpexcel/PHPExcel/Chart/Layout.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Layout.php
index 7fef074107d..fb5a53a063e 100644
--- a/lib/phpexcel/PHPExcel/Chart/Layout.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Layout.php
@@ -1,84 +1,53 @@
layoutTarget = $layout['layoutTarget'];
@@ -169,7 +139,7 @@ class PHPExcel_Chart_Layout
}
/**
- * Get Layout Target
+ * Get Layout Target.
*
* @return string
*/
@@ -179,19 +149,21 @@ class PHPExcel_Chart_Layout
}
/**
- * Set Layout Target
+ * Set Layout Target.
*
- * @param Layout Target $value
- * @return PHPExcel_Chart_Layout
+ * @param string $value
+ *
+ * @return Layout
*/
public function setLayoutTarget($value)
{
$this->layoutTarget = $value;
+
return $this;
}
/**
- * Get X-Mode
+ * Get X-Mode.
*
* @return string
*/
@@ -201,19 +173,21 @@ class PHPExcel_Chart_Layout
}
/**
- * Set X-Mode
+ * Set X-Mode.
*
* @param X-Mode $value
- * @return PHPExcel_Chart_Layout
+ *
+ * @return Layout
*/
public function setXMode($value)
{
$this->xMode = $value;
+
return $this;
}
/**
- * Get Y-Mode
+ * Get Y-Mode.
*
* @return string
*/
@@ -223,19 +197,21 @@ class PHPExcel_Chart_Layout
}
/**
- * Set Y-Mode
+ * Set Y-Mode.
*
* @param Y-Mode $value
- * @return PHPExcel_Chart_Layout
+ *
+ * @return Layout
*/
public function setYMode($value)
{
$this->yMode = $value;
+
return $this;
}
/**
- * Get X-Position
+ * Get X-Position.
*
* @return number
*/
@@ -245,19 +221,21 @@ class PHPExcel_Chart_Layout
}
/**
- * Set X-Position
+ * Set X-Position.
*
* @param X-Position $value
- * @return PHPExcel_Chart_Layout
+ *
+ * @return Layout
*/
public function setXPosition($value)
{
$this->xPos = $value;
+
return $this;
}
/**
- * Get Y-Position
+ * Get Y-Position.
*
* @return number
*/
@@ -267,19 +245,21 @@ class PHPExcel_Chart_Layout
}
/**
- * Set Y-Position
+ * Set Y-Position.
*
* @param Y-Position $value
- * @return PHPExcel_Chart_Layout
+ *
+ * @return Layout
*/
public function setYPosition($value)
{
$this->yPos = $value;
+
return $this;
}
/**
- * Get Width
+ * Get Width.
*
* @return number
*/
@@ -289,19 +269,21 @@ class PHPExcel_Chart_Layout
}
/**
- * Set Width
+ * Set Width.
*
- * @param Width $value
- * @return PHPExcel_Chart_Layout
+ * @param float $value
+ *
+ * @return Layout
*/
public function setWidth($value)
{
$this->width = $value;
+
return $this;
}
/**
- * Get Height
+ * Get Height.
*
* @return number
*/
@@ -311,22 +293,23 @@ class PHPExcel_Chart_Layout
}
/**
- * Set Height
+ * Set Height.
*
- * @param Height $value
- * @return PHPExcel_Chart_Layout
+ * @param float $value
+ *
+ * @return Layout
*/
public function setHeight($value)
{
$this->height = $value;
+
return $this;
}
-
/**
- * Get show legend key
+ * Get show legend key.
*
- * @return boolean
+ * @return bool
*/
public function getShowLegendKey()
{
@@ -337,19 +320,21 @@ class PHPExcel_Chart_Layout
* Set show legend key
* Specifies that legend keys should be shown in data labels.
*
- * @param boolean $value Show legend key
- * @return PHPExcel_Chart_Layout
+ * @param bool $value Show legend key
+ *
+ * @return Layout
*/
public function setShowLegendKey($value)
{
$this->showLegendKey = $value;
+
return $this;
}
/**
- * Get show value
+ * Get show value.
*
- * @return boolean
+ * @return bool
*/
public function getShowVal()
{
@@ -360,19 +345,21 @@ class PHPExcel_Chart_Layout
* Set show val
* Specifies that the value should be shown in data labels.
*
- * @param boolean $value Show val
- * @return PHPExcel_Chart_Layout
+ * @param bool $value Show val
+ *
+ * @return Layout
*/
public function setShowVal($value)
{
$this->showVal = $value;
+
return $this;
}
/**
- * Get show category name
+ * Get show category name.
*
- * @return boolean
+ * @return bool
*/
public function getShowCatName()
{
@@ -383,19 +370,21 @@ class PHPExcel_Chart_Layout
* Set show cat name
* Specifies that the category name should be shown in data labels.
*
- * @param boolean $value Show cat name
- * @return PHPExcel_Chart_Layout
+ * @param bool $value Show cat name
+ *
+ * @return Layout
*/
public function setShowCatName($value)
{
$this->showCatName = $value;
+
return $this;
}
/**
- * Get show data series name
+ * Get show data series name.
*
- * @return boolean
+ * @return bool
*/
public function getShowSerName()
{
@@ -406,19 +395,21 @@ class PHPExcel_Chart_Layout
* Set show ser name
* Specifies that the series name should be shown in data labels.
*
- * @param boolean $value Show series name
- * @return PHPExcel_Chart_Layout
+ * @param bool $value Show series name
+ *
+ * @return Layout
*/
public function setShowSerName($value)
{
$this->showSerName = $value;
+
return $this;
}
/**
- * Get show percentage
+ * Get show percentage.
*
- * @return boolean
+ * @return bool
*/
public function getShowPercent()
{
@@ -429,19 +420,21 @@ class PHPExcel_Chart_Layout
* Set show percentage
* Specifies that the percentage should be shown in data labels.
*
- * @param boolean $value Show percentage
- * @return PHPExcel_Chart_Layout
+ * @param bool $value Show percentage
+ *
+ * @return Layout
*/
public function setShowPercent($value)
{
$this->showPercent = $value;
+
return $this;
}
/**
- * Get show bubble size
+ * Get show bubble size.
*
- * @return boolean
+ * @return bool
*/
public function getShowBubbleSize()
{
@@ -452,19 +445,21 @@ class PHPExcel_Chart_Layout
* Set show bubble size
* Specifies that the bubble size should be shown in data labels.
*
- * @param boolean $value Show bubble size
- * @return PHPExcel_Chart_Layout
+ * @param bool $value Show bubble size
+ *
+ * @return Layout
*/
public function setShowBubbleSize($value)
{
$this->showBubbleSize = $value;
+
return $this;
}
/**
- * Get show leader lines
+ * Get show leader lines.
*
- * @return boolean
+ * @return bool
*/
public function getShowLeaderLines()
{
@@ -475,12 +470,14 @@ class PHPExcel_Chart_Layout
* Set show leader lines
* Specifies that leader lines should be shown in data labels.
*
- * @param boolean $value Show leader lines
- * @return PHPExcel_Chart_Layout
+ * @param bool $value Show leader lines
+ *
+ * @return Layout
*/
public function setShowLeaderLines($value)
{
$this->showLeaderLines = $value;
+
return $this;
}
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Legend.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Legend.php
new file mode 100644
index 00000000000..d0776265105
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Legend.php
@@ -0,0 +1,158 @@
+ self::POSITION_BOTTOM,
+ self::XL_LEGEND_POSITION_CORNER => self::POSITION_TOPRIGHT,
+ self::XL_LEGEND_POSITION_CUSTOM => '??',
+ self::XL_LEGEND_POSITION_LEFT => self::POSITION_LEFT,
+ self::XL_LEGEND_POSITION_RIGHT => self::POSITION_RIGHT,
+ self::XL_LEGEND_POSITION_TOP => self::POSITION_TOP,
+ ];
+
+ /**
+ * Legend position.
+ *
+ * @var string
+ */
+ private $position = self::POSITION_RIGHT;
+
+ /**
+ * Allow overlay of other elements?
+ *
+ * @var bool
+ */
+ private $overlay = true;
+
+ /**
+ * Legend Layout.
+ *
+ * @var Layout
+ */
+ private $layout;
+
+ /**
+ * Create a new Legend.
+ *
+ * @param string $position
+ * @param null|Layout $layout
+ * @param bool $overlay
+ */
+ public function __construct($position = self::POSITION_RIGHT, Layout $layout = null, $overlay = false)
+ {
+ $this->setPosition($position);
+ $this->layout = $layout;
+ $this->setOverlay($overlay);
+ }
+
+ /**
+ * Get legend position as an excel string value.
+ *
+ * @return string
+ */
+ public function getPosition()
+ {
+ return $this->position;
+ }
+
+ /**
+ * Get legend position using an excel string value.
+ *
+ * @param string $position see self::POSITION_*
+ *
+ * @return bool
+ */
+ public function setPosition($position)
+ {
+ if (!in_array($position, self::$positionXLref)) {
+ return false;
+ }
+
+ $this->position = $position;
+
+ return true;
+ }
+
+ /**
+ * Get legend position as an Excel internal numeric value.
+ *
+ * @return int
+ */
+ public function getPositionXL()
+ {
+ return array_search($this->position, self::$positionXLref);
+ }
+
+ /**
+ * Set legend position using an Excel internal numeric value.
+ *
+ * @param int $positionXL see self::XL_LEGEND_POSITION_*
+ *
+ * @return bool
+ */
+ public function setPositionXL($positionXL)
+ {
+ if (!isset(self::$positionXLref[$positionXL])) {
+ return false;
+ }
+
+ $this->position = self::$positionXLref[$positionXL];
+
+ return true;
+ }
+
+ /**
+ * Get allow overlay of other elements?
+ *
+ * @return bool
+ */
+ public function getOverlay()
+ {
+ return $this->overlay;
+ }
+
+ /**
+ * Set allow overlay of other elements?
+ *
+ * @param bool $overlay
+ *
+ * @return bool
+ */
+ public function setOverlay($overlay)
+ {
+ if (!is_bool($overlay)) {
+ return false;
+ }
+
+ $this->overlay = $overlay;
+
+ return true;
+ }
+
+ /**
+ * Get Layout.
+ *
+ * @return Layout
+ */
+ public function getLayout()
+ {
+ return $this->layout;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/PlotArea.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/PlotArea.php
new file mode 100644
index 00000000000..b98c638df76
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/PlotArea.php
@@ -0,0 +1,112 @@
+layout = $layout;
+ $this->plotSeries = $plotSeries;
+ }
+
+ /**
+ * Get Layout.
+ *
+ * @return Layout
+ */
+ public function getLayout()
+ {
+ return $this->layout;
+ }
+
+ /**
+ * Get Number of Plot Groups.
+ *
+ * @return array of DataSeries
+ */
+ public function getPlotGroupCount()
+ {
+ return count($this->plotSeries);
+ }
+
+ /**
+ * Get Number of Plot Series.
+ *
+ * @return int
+ */
+ public function getPlotSeriesCount()
+ {
+ $seriesCount = 0;
+ foreach ($this->plotSeries as $plot) {
+ $seriesCount += $plot->getPlotSeriesCount();
+ }
+
+ return $seriesCount;
+ }
+
+ /**
+ * Get Plot Series.
+ *
+ * @return array of DataSeries
+ */
+ public function getPlotGroup()
+ {
+ return $this->plotSeries;
+ }
+
+ /**
+ * Get Plot Series by Index.
+ *
+ * @param mixed $index
+ *
+ * @return DataSeries
+ */
+ public function getPlotGroupByIndex($index)
+ {
+ return $this->plotSeries[$index];
+ }
+
+ /**
+ * Set Plot Series.
+ *
+ * @param DataSeries[] $plotSeries
+ *
+ * @return PlotArea
+ */
+ public function setPlotSeries(array $plotSeries)
+ {
+ $this->plotSeries = $plotSeries;
+
+ return $this;
+ }
+
+ public function refresh(Worksheet $worksheet)
+ {
+ foreach ($this->plotSeries as $plotSeries) {
+ $plotSeries->refresh($worksheet);
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Properties.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Properties.php
new file mode 100644
index 00000000000..98095f0d13a
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Properties.php
@@ -0,0 +1,369 @@
+ (string) $type,
+ 'value' => (string) $color,
+ 'alpha' => (string) $this->getTrueAlpha($alpha),
+ ];
+ }
+
+ protected function getLineStyleArrowSize($array_selector, $array_kay_selector)
+ {
+ $sizes = [
+ 1 => ['w' => 'sm', 'len' => 'sm'],
+ 2 => ['w' => 'sm', 'len' => 'med'],
+ 3 => ['w' => 'sm', 'len' => 'lg'],
+ 4 => ['w' => 'med', 'len' => 'sm'],
+ 5 => ['w' => 'med', 'len' => 'med'],
+ 6 => ['w' => 'med', 'len' => 'lg'],
+ 7 => ['w' => 'lg', 'len' => 'sm'],
+ 8 => ['w' => 'lg', 'len' => 'med'],
+ 9 => ['w' => 'lg', 'len' => 'lg'],
+ ];
+
+ return $sizes[$array_selector][$array_kay_selector];
+ }
+
+ protected function getShadowPresetsMap($shadow_presets_option)
+ {
+ $presets_options = [
+ //OUTER
+ 1 => [
+ 'effect' => 'outerShdw',
+ 'blur' => '50800',
+ 'distance' => '38100',
+ 'direction' => '2700000',
+ 'algn' => 'tl',
+ 'rotWithShape' => '0',
+ ],
+ 2 => [
+ 'effect' => 'outerShdw',
+ 'blur' => '50800',
+ 'distance' => '38100',
+ 'direction' => '5400000',
+ 'algn' => 't',
+ 'rotWithShape' => '0',
+ ],
+ 3 => [
+ 'effect' => 'outerShdw',
+ 'blur' => '50800',
+ 'distance' => '38100',
+ 'direction' => '8100000',
+ 'algn' => 'tr',
+ 'rotWithShape' => '0',
+ ],
+ 4 => [
+ 'effect' => 'outerShdw',
+ 'blur' => '50800',
+ 'distance' => '38100',
+ 'algn' => 'l',
+ 'rotWithShape' => '0',
+ ],
+ 5 => [
+ 'effect' => 'outerShdw',
+ 'size' => [
+ 'sx' => '102000',
+ 'sy' => '102000',
+ ],
+ 'blur' => '63500',
+ 'distance' => '38100',
+ 'algn' => 'ctr',
+ 'rotWithShape' => '0',
+ ],
+ 6 => [
+ 'effect' => 'outerShdw',
+ 'blur' => '50800',
+ 'distance' => '38100',
+ 'direction' => '10800000',
+ 'algn' => 'r',
+ 'rotWithShape' => '0',
+ ],
+ 7 => [
+ 'effect' => 'outerShdw',
+ 'blur' => '50800',
+ 'distance' => '38100',
+ 'direction' => '18900000',
+ 'algn' => 'bl',
+ 'rotWithShape' => '0',
+ ],
+ 8 => [
+ 'effect' => 'outerShdw',
+ 'blur' => '50800',
+ 'distance' => '38100',
+ 'direction' => '16200000',
+ 'rotWithShape' => '0',
+ ],
+ 9 => [
+ 'effect' => 'outerShdw',
+ 'blur' => '50800',
+ 'distance' => '38100',
+ 'direction' => '13500000',
+ 'algn' => 'br',
+ 'rotWithShape' => '0',
+ ],
+ //INNER
+ 10 => [
+ 'effect' => 'innerShdw',
+ 'blur' => '63500',
+ 'distance' => '50800',
+ 'direction' => '2700000',
+ ],
+ 11 => [
+ 'effect' => 'innerShdw',
+ 'blur' => '63500',
+ 'distance' => '50800',
+ 'direction' => '5400000',
+ ],
+ 12 => [
+ 'effect' => 'innerShdw',
+ 'blur' => '63500',
+ 'distance' => '50800',
+ 'direction' => '8100000',
+ ],
+ 13 => [
+ 'effect' => 'innerShdw',
+ 'blur' => '63500',
+ 'distance' => '50800',
+ ],
+ 14 => [
+ 'effect' => 'innerShdw',
+ 'blur' => '114300',
+ ],
+ 15 => [
+ 'effect' => 'innerShdw',
+ 'blur' => '63500',
+ 'distance' => '50800',
+ 'direction' => '10800000',
+ ],
+ 16 => [
+ 'effect' => 'innerShdw',
+ 'blur' => '63500',
+ 'distance' => '50800',
+ 'direction' => '18900000',
+ ],
+ 17 => [
+ 'effect' => 'innerShdw',
+ 'blur' => '63500',
+ 'distance' => '50800',
+ 'direction' => '16200000',
+ ],
+ 18 => [
+ 'effect' => 'innerShdw',
+ 'blur' => '63500',
+ 'distance' => '50800',
+ 'direction' => '13500000',
+ ],
+ //perspective
+ 19 => [
+ 'effect' => 'outerShdw',
+ 'blur' => '152400',
+ 'distance' => '317500',
+ 'size' => [
+ 'sx' => '90000',
+ 'sy' => '-19000',
+ ],
+ 'direction' => '5400000',
+ 'rotWithShape' => '0',
+ ],
+ 20 => [
+ 'effect' => 'outerShdw',
+ 'blur' => '76200',
+ 'direction' => '18900000',
+ 'size' => [
+ 'sy' => '23000',
+ 'kx' => '-1200000',
+ ],
+ 'algn' => 'bl',
+ 'rotWithShape' => '0',
+ ],
+ 21 => [
+ 'effect' => 'outerShdw',
+ 'blur' => '76200',
+ 'direction' => '13500000',
+ 'size' => [
+ 'sy' => '23000',
+ 'kx' => '1200000',
+ ],
+ 'algn' => 'br',
+ 'rotWithShape' => '0',
+ ],
+ 22 => [
+ 'effect' => 'outerShdw',
+ 'blur' => '76200',
+ 'distance' => '12700',
+ 'direction' => '2700000',
+ 'size' => [
+ 'sy' => '-23000',
+ 'kx' => '-800400',
+ ],
+ 'algn' => 'bl',
+ 'rotWithShape' => '0',
+ ],
+ 23 => [
+ 'effect' => 'outerShdw',
+ 'blur' => '76200',
+ 'distance' => '12700',
+ 'direction' => '8100000',
+ 'size' => [
+ 'sy' => '-23000',
+ 'kx' => '800400',
+ ],
+ 'algn' => 'br',
+ 'rotWithShape' => '0',
+ ],
+ ];
+
+ return $presets_options[$shadow_presets_option];
+ }
+
+ protected function getArrayElementsValue($properties, $elements)
+ {
+ $reference = &$properties;
+ if (!is_array($elements)) {
+ return $reference[$elements];
+ }
+
+ foreach ($elements as $keys) {
+ $reference = &$reference[$keys];
+ }
+
+ return $reference;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/IRenderer.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/IRenderer.php
new file mode 100644
index 00000000000..c6fcfbfc938
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/IRenderer.php
@@ -0,0 +1,24 @@
+ MARK_DIAMOND,
- 'square' => MARK_SQUARE,
- 'triangle' => MARK_UTRIANGLE,
- 'x' => MARK_X,
- 'star' => MARK_STAR,
- 'dot' => MARK_FILLEDCIRCLE,
- 'dash' => MARK_DTRIANGLE,
- 'circle' => MARK_CIRCLE,
- 'plus' => MARK_CROSS
- );
+ private static $colourSet = [
+ 'mediumpurple1', 'palegreen3', 'gold1', 'cadetblue1',
+ 'darkmagenta', 'coral', 'dodgerblue3', 'eggplant',
+ 'mediumblue', 'magenta', 'sandybrown', 'cyan',
+ 'firebrick1', 'forestgreen', 'deeppink4', 'darkolivegreen',
+ 'goldenrod2',
+ ];
+ private static $markSet;
private $chart;
@@ -62,11 +31,55 @@ class PHPExcel_Chart_Renderer_jpgraph
private static $plotMark = 0;
+ /**
+ * Create a new jpgraph.
+ *
+ * @param Chart $chart
+ */
+ public function __construct(Chart $chart)
+ {
+ self::init();
+ $this->graph = null;
+ $this->chart = $chart;
+ }
+
+ private static function init()
+ {
+ static $loaded = false;
+ if ($loaded) {
+ return;
+ }
+
+ \JpGraph\JpGraph::load();
+ \JpGraph\JpGraph::module('bar');
+ \JpGraph\JpGraph::module('contour');
+ \JpGraph\JpGraph::module('line');
+ \JpGraph\JpGraph::module('pie');
+ \JpGraph\JpGraph::module('pie3d');
+ \JpGraph\JpGraph::module('radar');
+ \JpGraph\JpGraph::module('regstat');
+ \JpGraph\JpGraph::module('scatter');
+ \JpGraph\JpGraph::module('stock');
+
+ self::$markSet = [
+ 'diamond' => MARK_DIAMOND,
+ 'square' => MARK_SQUARE,
+ 'triangle' => MARK_UTRIANGLE,
+ 'x' => MARK_X,
+ 'star' => MARK_STAR,
+ 'dot' => MARK_FILLEDCIRCLE,
+ 'dash' => MARK_DTRIANGLE,
+ 'circle' => MARK_CIRCLE,
+ 'plus' => MARK_CROSS,
+ ];
+
+ $loaded = true;
+ }
private function formatPointMarker($seriesPlot, $markerID)
{
$plotMarkKeys = array_keys(self::$markSet);
- if (is_null($markerID)) {
+ if ($markerID === null) {
// Use default plot marker (next marker in the series)
self::$plotMark %= count(self::$markSet);
$seriesPlot->mark->SetType(self::$markSet[$plotMarkKeys[self::$plotMark++]]);
@@ -90,11 +103,10 @@ class PHPExcel_Chart_Renderer_jpgraph
return $seriesPlot;
}
-
private function formatDataSetLabels($groupID, $datasetLabels, $labelCount, $rotation = '')
{
$datasetLabelFormatCode = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getFormatCode();
- if (!is_null($datasetLabelFormatCode)) {
+ if ($datasetLabelFormatCode !== null) {
// Retrieve any label formatting code
$datasetLabelFormatCode = stripslashes($datasetLabelFormatCode);
}
@@ -103,15 +115,15 @@ class PHPExcel_Chart_Renderer_jpgraph
foreach ($datasetLabels as $i => $datasetLabel) {
if (is_array($datasetLabel)) {
if ($rotation == 'bar') {
- $datasetLabels[$i] = implode(" ", $datasetLabel);
+ $datasetLabels[$i] = implode(' ', $datasetLabel);
} else {
$datasetLabel = array_reverse($datasetLabel);
$datasetLabels[$i] = implode("\n", $datasetLabel);
}
} else {
// Format labels according to any formatting code
- if (!is_null($datasetLabelFormatCode)) {
- $datasetLabels[$i] = PHPExcel_Style_NumberFormat::toFormattedString($datasetLabel, $datasetLabelFormatCode);
+ if ($datasetLabelFormatCode !== null) {
+ $datasetLabels[$i] = NumberFormat::toFormattedString($datasetLabel, $datasetLabelFormatCode);
}
}
++$testCurrentIndex;
@@ -120,9 +132,9 @@ class PHPExcel_Chart_Renderer_jpgraph
return $datasetLabels;
}
-
private function percentageSumCalculation($groupID, $seriesCount)
{
+ $sumValues = [];
// Adjust our values to a percentage value across all series in the group
for ($i = 0; $i < $seriesCount; ++$i) {
if ($i == 0) {
@@ -142,7 +154,6 @@ class PHPExcel_Chart_Renderer_jpgraph
return $sumValues;
}
-
private function percentageAdjustValues($dataValues, $sumValues)
{
foreach ($dataValues as $k => $dataValue) {
@@ -152,56 +163,56 @@ class PHPExcel_Chart_Renderer_jpgraph
return $dataValues;
}
-
private function getCaption($captionElement)
{
// Read any caption
- $caption = (!is_null($captionElement)) ? $captionElement->getCaption() : null;
+ $caption = ($captionElement !== null) ? $captionElement->getCaption() : null;
// Test if we have a title caption to display
- if (!is_null($caption)) {
+ if ($caption !== null) {
// If we do, it could be a plain string or an array
if (is_array($caption)) {
// Implode an array to a plain string
$caption = implode('', $caption);
}
}
+
return $caption;
}
-
private function renderTitle()
{
$title = $this->getCaption($this->chart->getTitle());
- if (!is_null($title)) {
+ if ($title !== null) {
$this->graph->title->Set($title);
}
}
-
private function renderLegend()
{
$legend = $this->chart->getLegend();
- if (!is_null($legend)) {
+ if ($legend !== null) {
$legendPosition = $legend->getPosition();
- $legendOverlay = $legend->getOverlay();
switch ($legendPosition) {
case 'r':
- $this->graph->legend->SetPos(0.01, 0.5, 'right', 'center'); // right
+ $this->graph->legend->SetPos(0.01, 0.5, 'right', 'center'); // right
$this->graph->legend->SetColumns(1);
+
break;
case 'l':
- $this->graph->legend->SetPos(0.01, 0.5, 'left', 'center'); // left
+ $this->graph->legend->SetPos(0.01, 0.5, 'left', 'center'); // left
$this->graph->legend->SetColumns(1);
+
break;
case 't':
- $this->graph->legend->SetPos(0.5, 0.01, 'center', 'top'); // top
+ $this->graph->legend->SetPos(0.5, 0.01, 'center', 'top'); // top
break;
case 'b':
- $this->graph->legend->SetPos(0.5, 0.99, 'center', 'bottom'); // bottom
+ $this->graph->legend->SetPos(0.5, 0.99, 'center', 'bottom'); // bottom
break;
default:
- $this->graph->legend->SetPos(0.01, 0.01, 'right', 'top'); // top-right
+ $this->graph->legend->SetPos(0.01, 0.01, 'right', 'top'); // top-right
$this->graph->legend->SetColumns(1);
+
break;
}
} else {
@@ -209,22 +220,21 @@ class PHPExcel_Chart_Renderer_jpgraph
}
}
-
private function renderCartesianPlotArea($type = 'textlin')
{
- $this->graph = new Graph(self::$width, self::$height);
+ $this->graph = new \Graph(self::$width, self::$height);
$this->graph->SetScale($type);
$this->renderTitle();
// Rotate for bar rather than column chart
$rotation = $this->chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotDirection();
- $reverse = ($rotation == 'bar') ? true : false;
+ $reverse = $rotation == 'bar';
$xAxisLabel = $this->chart->getXAxisLabel();
- if (!is_null($xAxisLabel)) {
+ if ($xAxisLabel !== null) {
$title = $this->getCaption($xAxisLabel);
- if (!is_null($title)) {
+ if ($title !== null) {
$this->graph->xaxis->SetTitle($title, 'center');
$this->graph->xaxis->title->SetMargin(35);
if ($reverse) {
@@ -235,9 +245,9 @@ class PHPExcel_Chart_Renderer_jpgraph
}
$yAxisLabel = $this->chart->getYAxisLabel();
- if (!is_null($yAxisLabel)) {
+ if ($yAxisLabel !== null) {
$title = $this->getCaption($yAxisLabel);
- if (!is_null($title)) {
+ if ($title !== null) {
$this->graph->yaxis->SetTitle($title, 'center');
if ($reverse) {
$this->graph->yaxis->title->SetAngle(0);
@@ -247,29 +257,26 @@ class PHPExcel_Chart_Renderer_jpgraph
}
}
-
- private function renderPiePlotArea($doughnut = false)
+ private function renderPiePlotArea()
{
- $this->graph = new PieGraph(self::$width, self::$height);
+ $this->graph = new \PieGraph(self::$width, self::$height);
$this->renderTitle();
}
-
private function renderRadarPlotArea()
{
- $this->graph = new RadarGraph(self::$width, self::$height);
+ $this->graph = new \RadarGraph(self::$width, self::$height);
$this->graph->SetScale('lin');
$this->renderTitle();
}
-
private function renderPlotLine($groupID, $filled = false, $combination = false, $dimensions = '2d')
{
$grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
- $labelCount = count($this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount());
+ $labelCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount();
if ($labelCount > 0) {
$datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
$datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount);
@@ -277,7 +284,7 @@ class PHPExcel_Chart_Renderer_jpgraph
}
$seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
- $seriesPlots = array();
+ $seriesPlots = [];
if ($grouping == 'percentStacked') {
$sumValues = $this->percentageSumCalculation($groupID, $seriesCount);
}
@@ -301,7 +308,7 @@ class PHPExcel_Chart_Renderer_jpgraph
++$testCurrentIndex;
}
- $seriesPlot = new LinePlot($dataValues);
+ $seriesPlot = new \LinePlot($dataValues);
if ($combination) {
$seriesPlot->SetBarCenter();
}
@@ -323,12 +330,11 @@ class PHPExcel_Chart_Renderer_jpgraph
if ($grouping == 'standard') {
$groupPlot = $seriesPlots;
} else {
- $groupPlot = new AccLinePlot($seriesPlots);
+ $groupPlot = new \AccLinePlot($seriesPlots);
}
$this->graph->Add($groupPlot);
}
-
private function renderPlotBar($groupID, $dimensions = '2d')
{
$rotation = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotDirection();
@@ -338,7 +344,7 @@ class PHPExcel_Chart_Renderer_jpgraph
}
$grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
- $labelCount = count($this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount());
+ $labelCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount();
if ($labelCount > 0) {
$datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
$datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount, $rotation);
@@ -352,9 +358,8 @@ class PHPExcel_Chart_Renderer_jpgraph
$this->graph->xaxis->SetTickLabels($datasetLabels);
}
-
$seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
- $seriesPlots = array();
+ $seriesPlots = [];
if ($grouping == 'percentStacked') {
$sumValues = $this->percentageSumCalculation($groupID, $seriesCount);
}
@@ -380,7 +385,7 @@ class PHPExcel_Chart_Renderer_jpgraph
if ($rotation == 'bar') {
$dataValues = array_reverse($dataValues);
}
- $seriesPlot = new BarPlot($dataValues);
+ $seriesPlot = new \BarPlot($dataValues);
$seriesPlot->SetColor('black');
$seriesPlot->SetFillColor(self::$colourSet[self::$plotColour++]);
if ($dimensions == '3d') {
@@ -396,16 +401,16 @@ class PHPExcel_Chart_Renderer_jpgraph
$seriesPlots[] = $seriesPlot;
}
// Reverse the plot order for bar rather than column chart
- if (($rotation == 'bar') && (!($grouping == 'percentStacked'))) {
+ if (($rotation == 'bar') && ($grouping != 'percentStacked')) {
$seriesPlots = array_reverse($seriesPlots);
}
if ($grouping == 'clustered') {
- $groupPlot = new GroupBarPlot($seriesPlots);
+ $groupPlot = new \GroupBarPlot($seriesPlots);
} elseif ($grouping == 'standard') {
- $groupPlot = new GroupBarPlot($seriesPlots);
+ $groupPlot = new \GroupBarPlot($seriesPlots);
} else {
- $groupPlot = new AccBarPlot($seriesPlots);
+ $groupPlot = new \AccBarPlot($seriesPlots);
if ($dimensions == '3d') {
$groupPlot->SetShadow();
}
@@ -414,14 +419,13 @@ class PHPExcel_Chart_Renderer_jpgraph
$this->graph->Add($groupPlot);
}
-
private function renderPlotScatter($groupID, $bubble)
{
$grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
$scatterStyle = $bubbleSize = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
$seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
- $seriesPlots = array();
+ $seriesPlots = [];
// Loop through each data series in turn
for ($i = 0; $i < $seriesCount; ++$i) {
@@ -432,14 +436,14 @@ class PHPExcel_Chart_Renderer_jpgraph
$dataValuesY[$k] = $k;
}
- $seriesPlot = new ScatterPlot($dataValuesX, $dataValuesY);
+ $seriesPlot = new \ScatterPlot($dataValuesX, $dataValuesY);
if ($scatterStyle == 'lineMarker') {
$seriesPlot->SetLinkPoints();
$seriesPlot->link->SetColor(self::$colourSet[self::$plotColour]);
} elseif ($scatterStyle == 'smoothMarker') {
- $spline = new Spline($dataValuesY, $dataValuesX);
+ $spline = new \Spline($dataValuesY, $dataValuesX);
list($splineDataY, $splineDataX) = $spline->Get(count($dataValuesX) * self::$width / 20);
- $lplot = new LinePlot($splineDataX, $splineDataY);
+ $lplot = new \LinePlot($splineDataX, $splineDataY);
$lplot->SetColor(self::$colourSet[self::$plotColour]);
$this->graph->Add($lplot);
@@ -460,13 +464,12 @@ class PHPExcel_Chart_Renderer_jpgraph
}
}
-
private function renderPlotRadar($groupID)
{
$radarStyle = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
$seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
- $seriesPlots = array();
+ $seriesPlots = [];
// Loop through each data series in turn
for ($i = 0; $i < $seriesCount; ++$i) {
@@ -474,7 +477,7 @@ class PHPExcel_Chart_Renderer_jpgraph
$dataValuesX = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getDataValues();
$marker = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($i)->getPointMarker();
- $dataValues = array();
+ $dataValues = [];
foreach ($dataValuesY as $k => $dataValueY) {
$dataValues[$k] = implode(' ', array_reverse($dataValueY));
}
@@ -485,7 +488,7 @@ class PHPExcel_Chart_Renderer_jpgraph
$this->graph->SetTitles(array_reverse($dataValues));
- $seriesPlot = new RadarPlot(array_reverse($dataValuesX));
+ $seriesPlot = new \RadarPlot(array_reverse($dataValuesX));
$dataLabel = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotLabelByIndex($i)->getDataValue();
$seriesPlot->SetColor(self::$colourSet[self::$plotColour++]);
@@ -499,15 +502,14 @@ class PHPExcel_Chart_Renderer_jpgraph
}
}
-
private function renderPlotContour($groupID)
{
$contourStyle = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
$seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
- $seriesPlots = array();
+ $seriesPlots = [];
- $dataValues = array();
+ $dataValues = [];
// Loop through each data series in turn
for ($i = 0; $i < $seriesCount; ++$i) {
$dataValuesY = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex($i)->getDataValues();
@@ -515,18 +517,17 @@ class PHPExcel_Chart_Renderer_jpgraph
$dataValues[$i] = $dataValuesX;
}
- $seriesPlot = new ContourPlot($dataValues);
+ $seriesPlot = new \ContourPlot($dataValues);
$this->graph->Add($seriesPlot);
}
-
private function renderPlotStock($groupID)
{
$seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
$plotOrder = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotOrder();
- $dataValues = array();
+ $dataValues = [];
// Loop through each data series in turn and build the plot arrays
foreach ($plotOrder as $i => $v) {
$dataValuesX = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex($v)->getDataValues();
@@ -538,33 +539,31 @@ class PHPExcel_Chart_Renderer_jpgraph
return;
}
- $dataValuesPlot = array();
+ $dataValuesPlot = [];
// Flatten the plot arrays to a single dimensional array to work with jpgraph
- for ($j = 0; $j < count($dataValues[0]); ++$j) {
+ $jMax = count($dataValues[0]);
+ for ($j = 0; $j < $jMax; ++$j) {
for ($i = 0; $i < $seriesCount; ++$i) {
$dataValuesPlot[] = $dataValues[$i][$j];
}
}
// Set the x-axis labels
- $labelCount = count($this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount());
+ $labelCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount();
if ($labelCount > 0) {
$datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
$datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount);
$this->graph->xaxis->SetTickLabels($datasetLabels);
}
- $seriesPlot = new StockPlot($dataValuesPlot);
+ $seriesPlot = new \StockPlot($dataValuesPlot);
$seriesPlot->SetWidth(20);
$this->graph->Add($seriesPlot);
}
-
private function renderAreaChart($groupCount, $dimensions = '2d')
{
- require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php');
-
$this->renderCartesianPlotArea();
for ($i = 0; $i < $groupCount; ++$i) {
@@ -572,11 +571,8 @@ class PHPExcel_Chart_Renderer_jpgraph
}
}
-
private function renderLineChart($groupCount, $dimensions = '2d')
{
- require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php');
-
$this->renderCartesianPlotArea();
for ($i = 0; $i < $groupCount; ++$i) {
@@ -584,11 +580,8 @@ class PHPExcel_Chart_Renderer_jpgraph
}
}
-
private function renderBarChart($groupCount, $dimensions = '2d')
{
- require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_bar.php');
-
$this->renderCartesianPlotArea();
for ($i = 0; $i < $groupCount; ++$i) {
@@ -596,13 +589,8 @@ class PHPExcel_Chart_Renderer_jpgraph
}
}
-
private function renderScatterChart($groupCount)
{
- require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_scatter.php');
- require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_regstat.php');
- require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php');
-
$this->renderCartesianPlotArea('linlin');
for ($i = 0; $i < $groupCount; ++$i) {
@@ -610,11 +598,8 @@ class PHPExcel_Chart_Renderer_jpgraph
}
}
-
private function renderBubbleChart($groupCount)
{
- require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_scatter.php');
-
$this->renderCartesianPlotArea('linlin');
for ($i = 0; $i < $groupCount; ++$i) {
@@ -622,22 +607,17 @@ class PHPExcel_Chart_Renderer_jpgraph
}
}
-
private function renderPieChart($groupCount, $dimensions = '2d', $doughnut = false, $multiplePlots = false)
{
- require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_pie.php');
- if ($dimensions == '3d') {
- require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_pie3d.php');
- }
-
- $this->renderPiePlotArea($doughnut);
+ $this->renderPiePlotArea();
$iLimit = ($multiplePlots) ? $groupCount : 1;
for ($groupID = 0; $groupID < $iLimit; ++$groupID) {
$grouping = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotGrouping();
$exploded = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotStyle();
+ $datasetLabels = [];
if ($groupID == 0) {
- $labelCount = count($this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount());
+ $labelCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotValuesByIndex(0)->getPointCount();
if ($labelCount > 0) {
$datasetLabels = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotCategoryByIndex(0)->getDataValues();
$datasetLabels = $this->formatDataSetLabels($groupID, $datasetLabels, $labelCount);
@@ -645,7 +625,7 @@ class PHPExcel_Chart_Renderer_jpgraph
}
$seriesCount = $this->chart->getPlotArea()->getPlotGroupByIndex($groupID)->getPlotSeriesCount();
- $seriesPlots = array();
+ $seriesPlots = [];
// For pie charts, we only display the first series: doughnut charts generally display all series
$jLimit = ($multiplePlots) ? $seriesCount : 1;
// Loop through each data series in turn
@@ -663,17 +643,17 @@ class PHPExcel_Chart_Renderer_jpgraph
}
if ($dimensions == '3d') {
- $seriesPlot = new PiePlot3D($dataValues);
+ $seriesPlot = new \PiePlot3D($dataValues);
} else {
if ($doughnut) {
- $seriesPlot = new PiePlotC($dataValues);
+ $seriesPlot = new \PiePlotC($dataValues);
} else {
- $seriesPlot = new PiePlot($dataValues);
+ $seriesPlot = new \PiePlot($dataValues);
}
}
if ($multiplePlots) {
- $seriesPlot->SetSize(($jLimit-$j) / ($jLimit * 4));
+ $seriesPlot->SetSize(($jLimit - $j) / ($jLimit * 4));
}
if ($doughnut) {
@@ -699,11 +679,8 @@ class PHPExcel_Chart_Renderer_jpgraph
}
}
-
private function renderRadarChart($groupCount)
{
- require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_radar.php');
-
$this->renderRadarPlotArea();
for ($groupID = 0; $groupID < $groupCount; ++$groupID) {
@@ -711,11 +688,8 @@ class PHPExcel_Chart_Renderer_jpgraph
}
}
-
private function renderStockChart($groupCount)
{
- require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_stock.php');
-
$this->renderCartesianPlotArea('intint');
for ($groupID = 0; $groupID < $groupCount; ++$groupID) {
@@ -723,11 +697,8 @@ class PHPExcel_Chart_Renderer_jpgraph
}
}
-
private function renderContourChart($groupCount, $dimensions)
{
- require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_contour.php');
-
$this->renderCartesianPlotArea('intint');
for ($i = 0; $i < $groupCount; ++$i) {
@@ -735,15 +706,8 @@ class PHPExcel_Chart_Renderer_jpgraph
}
}
-
private function renderCombinationChart($groupCount, $dimensions, $outputDestination)
{
- require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php');
- require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_bar.php');
- require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_scatter.php');
- require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_regstat.php');
- require_once(PHPExcel_Settings::getChartRendererPath().'jpgraph_line.php');
-
$this->renderCartesianPlotArea();
for ($i = 0; $i < $groupCount; ++$i) {
@@ -752,30 +716,36 @@ class PHPExcel_Chart_Renderer_jpgraph
switch ($chartType) {
case 'area3DChart':
$dimensions = '3d';
- // no break
+ // no break
case 'areaChart':
$this->renderPlotLine($i, true, true, $dimensions);
+
break;
case 'bar3DChart':
$dimensions = '3d';
- // no break
+ // no break
case 'barChart':
$this->renderPlotBar($i, $dimensions);
+
break;
case 'line3DChart':
$dimensions = '3d';
- // no break
+ // no break
case 'lineChart':
$this->renderPlotLine($i, false, true, $dimensions);
+
break;
case 'scatterChart':
$this->renderPlotScatter($i, false);
+
break;
case 'bubbleChart':
$this->renderPlotScatter($i, true);
+
break;
default:
$this->graph = null;
+
return false;
}
}
@@ -783,10 +753,10 @@ class PHPExcel_Chart_Renderer_jpgraph
$this->renderLegend();
$this->graph->Stroke($outputDestination);
+
return true;
}
-
public function render($outputDestination)
{
self::$plotColour = 0;
@@ -797,7 +767,7 @@ class PHPExcel_Chart_Renderer_jpgraph
if ($groupCount == 1) {
$chartType = $this->chart->getPlotArea()->getPlotGroupByIndex(0)->getPlotType();
} else {
- $chartTypes = array();
+ $chartTypes = [];
for ($i = 0; $i < $groupCount; ++$i) {
$chartTypes[] = $this->chart->getPlotArea()->getPlotGroupByIndex($i)->getPlotType();
}
@@ -806,6 +776,7 @@ class PHPExcel_Chart_Renderer_jpgraph
$chartType = array_pop($chartTypes);
} elseif (count($chartTypes) == 0) {
echo 'Chart is not yet implemented
';
+
return false;
} else {
return $this->renderCombinationChart($groupCount, $dimensions, $outputDestination);
@@ -815,69 +786,71 @@ class PHPExcel_Chart_Renderer_jpgraph
switch ($chartType) {
case 'area3DChart':
$dimensions = '3d';
- // no break
+ // no break
case 'areaChart':
$this->renderAreaChart($groupCount, $dimensions);
+
break;
case 'bar3DChart':
$dimensions = '3d';
- // no break
+ // no break
case 'barChart':
$this->renderBarChart($groupCount, $dimensions);
+
break;
case 'line3DChart':
$dimensions = '3d';
- // no break
+ // no break
case 'lineChart':
$this->renderLineChart($groupCount, $dimensions);
+
break;
case 'pie3DChart':
$dimensions = '3d';
- // no break
+ // no break
case 'pieChart':
$this->renderPieChart($groupCount, $dimensions, false, false);
+
break;
case 'doughnut3DChart':
$dimensions = '3d';
- // no break
+ // no break
case 'doughnutChart':
$this->renderPieChart($groupCount, $dimensions, true, true);
+
break;
case 'scatterChart':
$this->renderScatterChart($groupCount);
+
break;
case 'bubbleChart':
$this->renderBubbleChart($groupCount);
+
break;
case 'radarChart':
$this->renderRadarChart($groupCount);
+
break;
case 'surface3DChart':
$dimensions = '3d';
- // no break
+ // no break
case 'surfaceChart':
$this->renderContourChart($groupCount, $dimensions);
+
break;
case 'stockChart':
- $this->renderStockChart($groupCount, $dimensions);
+ $this->renderStockChart($groupCount);
+
break;
default:
- echo $chartType.' is not yet implemented
';
+ echo $chartType . ' is not yet implemented
';
+
return false;
}
$this->renderLegend();
$this->graph->Stroke($outputDestination);
+
return true;
}
-
-
- /**
- * Create a new PHPExcel_Chart_Renderer_jpgraph
- */
- public function __construct(PHPExcel_Chart $chart)
- {
- $this->graph = null;
- $this->chart = $chart;
- }
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/PHP Charting Libraries.txt b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/PHP Charting Libraries.txt
new file mode 100644
index 00000000000..4abab7a257d
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/PHP Charting Libraries.txt
@@ -0,0 +1,20 @@
+ChartDirector
+ https://www.advsofteng.com/cdphp.html
+
+GraPHPite
+ http://graphpite.sourceforge.net/
+
+JpGraph
+ http://www.aditus.nu/jpgraph/
+
+LibChart
+ https://naku.dohcrew.com/libchart/pages/introduction/
+
+pChart
+ http://pchart.sourceforge.net/
+
+TeeChart
+ https://www.steema.com/
+
+PHPGraphLib
+ http://www.ebrueggeman.com/phpgraphlib
\ No newline at end of file
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/Polyfill.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/Polyfill.php
new file mode 100644
index 00000000000..7fa383944c9
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Chart/Renderer/Polyfill.php
@@ -0,0 +1,9 @@
+caption = $caption;
+ $this->layout = $layout;
+ }
+
+ /**
+ * Get caption.
+ *
+ * @return string
+ */
+ public function getCaption()
+ {
+ return $this->caption;
+ }
+
+ /**
+ * Set caption.
+ *
+ * @param string $caption
+ *
+ * @return Title
+ */
+ public function setCaption($caption)
+ {
+ $this->caption = $caption;
+
+ return $this;
+ }
+
+ /**
+ * Get Layout.
+ *
+ * @return Layout
+ */
+ public function getLayout()
+ {
+ return $this->layout;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Cells.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Cells.php
new file mode 100644
index 00000000000..465a0698c6c
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/Cells.php
@@ -0,0 +1,506 @@
+parent = $parent;
+ $this->cache = $cache;
+ $this->cachePrefix = $this->getUniqueID();
+ }
+
+ /**
+ * Return the parent worksheet for this cell collection.
+ *
+ * @return Worksheet
+ */
+ public function getParent()
+ {
+ return $this->parent;
+ }
+
+ /**
+ * Whether the collection holds a cell for the given coordinate.
+ *
+ * @param string $pCoord Coordinate of the cell to check
+ *
+ * @return bool
+ */
+ public function has($pCoord)
+ {
+ if ($pCoord === $this->currentCoordinate) {
+ return true;
+ }
+
+ // Check if the requested entry exists in the index
+ return isset($this->index[$pCoord]);
+ }
+
+ /**
+ * Add or update a cell in the collection.
+ *
+ * @param Cell $cell Cell to update
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Cell
+ */
+ public function update(Cell $cell)
+ {
+ return $this->add($cell->getCoordinate(), $cell);
+ }
+
+ /**
+ * Delete a cell in cache identified by coordinate.
+ *
+ * @param string $pCoord Coordinate of the cell to delete
+ */
+ public function delete($pCoord)
+ {
+ if ($pCoord === $this->currentCoordinate && $this->currentCell !== null) {
+ $this->currentCell->detach();
+ $this->currentCoordinate = null;
+ $this->currentCell = null;
+ $this->currentCellIsDirty = false;
+ }
+
+ unset($this->index[$pCoord]);
+
+ // Delete the entry from cache
+ $this->cache->delete($this->cachePrefix . $pCoord);
+ }
+
+ /**
+ * Get a list of all cell coordinates currently held in the collection.
+ *
+ * @return string[]
+ */
+ public function getCoordinates()
+ {
+ return array_keys($this->index);
+ }
+
+ /**
+ * Get a sorted list of all cell coordinates currently held in the collection by row and column.
+ *
+ * @return string[]
+ */
+ public function getSortedCoordinates()
+ {
+ $sortKeys = [];
+ foreach ($this->getCoordinates() as $coord) {
+ $column = '';
+ $row = 0;
+ sscanf($coord, '%[A-Z]%d', $column, $row);
+ $sortKeys[sprintf('%09d%3s', $row, $column)] = $coord;
+ }
+ ksort($sortKeys);
+
+ return array_values($sortKeys);
+ }
+
+ /**
+ * Get highest worksheet column and highest row that have cell records.
+ *
+ * @return array Highest column name and highest row number
+ */
+ public function getHighestRowAndColumn()
+ {
+ // Lookup highest column and highest row
+ $col = ['A' => '1A'];
+ $row = [1];
+ foreach ($this->getCoordinates() as $coord) {
+ $c = '';
+ $r = 0;
+ sscanf($coord, '%[A-Z]%d', $c, $r);
+ $row[$r] = $r;
+ $col[$c] = strlen($c) . $c;
+ }
+
+ // Determine highest column and row
+ $highestRow = max($row);
+ $highestColumn = substr(max($col), 1);
+
+ return [
+ 'row' => $highestRow,
+ 'column' => $highestColumn,
+ ];
+ }
+
+ /**
+ * Return the cell coordinate of the currently active cell object.
+ *
+ * @return string
+ */
+ public function getCurrentCoordinate()
+ {
+ return $this->currentCoordinate;
+ }
+
+ /**
+ * Return the column coordinate of the currently active cell object.
+ *
+ * @return string
+ */
+ public function getCurrentColumn()
+ {
+ $column = '';
+ $row = 0;
+
+ sscanf($this->currentCoordinate, '%[A-Z]%d', $column, $row);
+
+ return $column;
+ }
+
+ /**
+ * Return the row coordinate of the currently active cell object.
+ *
+ * @return int
+ */
+ public function getCurrentRow()
+ {
+ $column = '';
+ $row = 0;
+
+ sscanf($this->currentCoordinate, '%[A-Z]%d', $column, $row);
+
+ return (int) $row;
+ }
+
+ /**
+ * Get highest worksheet column.
+ *
+ * @param string $row Return the highest column for the specified row,
+ * or the highest column of any row if no row number is passed
+ *
+ * @return string Highest column name
+ */
+ public function getHighestColumn($row = null)
+ {
+ if ($row == null) {
+ $colRow = $this->getHighestRowAndColumn();
+
+ return $colRow['column'];
+ }
+
+ $columnList = [1];
+ foreach ($this->getCoordinates() as $coord) {
+ $c = '';
+ $r = 0;
+
+ sscanf($coord, '%[A-Z]%d', $c, $r);
+ if ($r != $row) {
+ continue;
+ }
+ $columnList[] = Coordinate::columnIndexFromString($c);
+ }
+
+ return Coordinate::stringFromColumnIndex(max($columnList));
+ }
+
+ /**
+ * Get highest worksheet row.
+ *
+ * @param string $column Return the highest row for the specified column,
+ * or the highest row of any column if no column letter is passed
+ *
+ * @return int Highest row number
+ */
+ public function getHighestRow($column = null)
+ {
+ if ($column == null) {
+ $colRow = $this->getHighestRowAndColumn();
+
+ return $colRow['row'];
+ }
+
+ $rowList = [0];
+ foreach ($this->getCoordinates() as $coord) {
+ $c = '';
+ $r = 0;
+
+ sscanf($coord, '%[A-Z]%d', $c, $r);
+ if ($c != $column) {
+ continue;
+ }
+ $rowList[] = $r;
+ }
+
+ return max($rowList);
+ }
+
+ /**
+ * Generate a unique ID for cache referencing.
+ *
+ * @return string Unique Reference
+ */
+ private function getUniqueID()
+ {
+ return uniqid('phpspreadsheet.', true) . '.';
+ }
+
+ /**
+ * Clone the cell collection.
+ *
+ * @param Worksheet $parent The new worksheet that we're copying to
+ *
+ * @return self
+ */
+ public function cloneCellCollection(Worksheet $parent)
+ {
+ $this->storeCurrentCell();
+ $newCollection = clone $this;
+
+ $newCollection->parent = $parent;
+ if (($newCollection->currentCell !== null) && (is_object($newCollection->currentCell))) {
+ $newCollection->currentCell->attach($this);
+ }
+
+ // Get old values
+ $oldKeys = $newCollection->getAllCacheKeys();
+ $oldValues = $newCollection->cache->getMultiple($oldKeys);
+ $newValues = [];
+ $oldCachePrefix = $newCollection->cachePrefix;
+
+ // Change prefix
+ $newCollection->cachePrefix = $newCollection->getUniqueID();
+ foreach ($oldValues as $oldKey => $value) {
+ $newValues[str_replace($oldCachePrefix, $newCollection->cachePrefix, $oldKey)] = clone $value;
+ }
+
+ // Store new values
+ $stored = $newCollection->cache->setMultiple($newValues);
+ if (!$stored) {
+ $newCollection->__destruct();
+
+ throw new PhpSpreadsheetException('Failed to copy cells in cache');
+ }
+
+ return $newCollection;
+ }
+
+ /**
+ * Remove a row, deleting all cells in that row.
+ *
+ * @param string $row Row number to remove
+ */
+ public function removeRow($row)
+ {
+ foreach ($this->getCoordinates() as $coord) {
+ $c = '';
+ $r = 0;
+
+ sscanf($coord, '%[A-Z]%d', $c, $r);
+ if ($r == $row) {
+ $this->delete($coord);
+ }
+ }
+ }
+
+ /**
+ * Remove a column, deleting all cells in that column.
+ *
+ * @param string $column Column ID to remove
+ */
+ public function removeColumn($column)
+ {
+ foreach ($this->getCoordinates() as $coord) {
+ $c = '';
+ $r = 0;
+
+ sscanf($coord, '%[A-Z]%d', $c, $r);
+ if ($c == $column) {
+ $this->delete($coord);
+ }
+ }
+ }
+
+ /**
+ * Store cell data in cache for the current cell object if it's "dirty",
+ * and the 'nullify' the current cell object.
+ *
+ * @throws PhpSpreadsheetException
+ */
+ private function storeCurrentCell()
+ {
+ if ($this->currentCellIsDirty && !empty($this->currentCoordinate)) {
+ $this->currentCell->detach();
+
+ $stored = $this->cache->set($this->cachePrefix . $this->currentCoordinate, $this->currentCell);
+ if (!$stored) {
+ $this->__destruct();
+
+ throw new PhpSpreadsheetException("Failed to store cell {$this->currentCoordinate} in cache");
+ }
+ $this->currentCellIsDirty = false;
+ }
+
+ $this->currentCoordinate = null;
+ $this->currentCell = null;
+ }
+
+ /**
+ * Add or update a cell identified by its coordinate into the collection.
+ *
+ * @param string $pCoord Coordinate of the cell to update
+ * @param Cell $cell Cell to update
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return \PhpOffice\PhpSpreadsheet\Cell\Cell
+ */
+ public function add($pCoord, Cell $cell)
+ {
+ if ($pCoord !== $this->currentCoordinate) {
+ $this->storeCurrentCell();
+ }
+ $this->index[$pCoord] = true;
+
+ $this->currentCoordinate = $pCoord;
+ $this->currentCell = $cell;
+ $this->currentCellIsDirty = true;
+
+ return $cell;
+ }
+
+ /**
+ * Get cell at a specific coordinate.
+ *
+ * @param string $pCoord Coordinate of the cell
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return \PhpOffice\PhpSpreadsheet\Cell\Cell Cell that was found, or null if not found
+ */
+ public function get($pCoord)
+ {
+ if ($pCoord === $this->currentCoordinate) {
+ return $this->currentCell;
+ }
+ $this->storeCurrentCell();
+
+ // Return null if requested entry doesn't exist in collection
+ if (!$this->has($pCoord)) {
+ return null;
+ }
+
+ // Check if the entry that has been requested actually exists
+ $cell = $this->cache->get($this->cachePrefix . $pCoord);
+ if ($cell === null) {
+ throw new PhpSpreadsheetException("Cell entry {$pCoord} no longer exists in cache. This probably means that the cache was cleared by someone else.");
+ }
+
+ // Set current entry to the requested entry
+ $this->currentCoordinate = $pCoord;
+ $this->currentCell = $cell;
+ // Re-attach this as the cell's parent
+ $this->currentCell->attach($this);
+
+ // Return requested entry
+ return $this->currentCell;
+ }
+
+ /**
+ * Clear the cell collection and disconnect from our parent.
+ */
+ public function unsetWorksheetCells()
+ {
+ if ($this->currentCell !== null) {
+ $this->currentCell->detach();
+ $this->currentCell = null;
+ $this->currentCoordinate = null;
+ }
+
+ // Flush the cache
+ $this->__destruct();
+
+ $this->index = [];
+
+ // detach ourself from the worksheet, so that it can then delete this object successfully
+ $this->parent = null;
+ }
+
+ /**
+ * Destroy this cell collection.
+ */
+ public function __destruct()
+ {
+ $this->cache->deleteMultiple($this->getAllCacheKeys());
+ }
+
+ /**
+ * Returns all known cache keys.
+ *
+ * @return \Generator|string[]
+ */
+ private function getAllCacheKeys()
+ {
+ foreach ($this->getCoordinates() as $coordinate) {
+ yield $this->cachePrefix . $coordinate;
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/CellsFactory.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/CellsFactory.php
new file mode 100644
index 00000000000..46d3cf7e14e
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Collection/CellsFactory.php
@@ -0,0 +1,23 @@
+cache = [];
+
+ return true;
+ }
+
+ public function delete($key)
+ {
+ unset($this->cache[$key]);
+
+ return true;
+ }
+
+ public function deleteMultiple($keys)
+ {
+ foreach ($keys as $key) {
+ $this->delete($key);
+ }
+
+ return true;
+ }
+
+ public function get($key, $default = null)
+ {
+ if ($this->has($key)) {
+ return $this->cache[$key];
+ }
+
+ return $default;
+ }
+
+ public function getMultiple($keys, $default = null)
+ {
+ $results = [];
+ foreach ($keys as $key) {
+ $results[$key] = $this->get($key, $default);
+ }
+
+ return $results;
+ }
+
+ public function has($key)
+ {
+ return array_key_exists($key, $this->cache);
+ }
+
+ public function set($key, $value, $ttl = null)
+ {
+ $this->cache[$key] = $value;
+
+ return true;
+ }
+
+ public function setMultiple($values, $ttl = null)
+ {
+ foreach ($values as $key => $value) {
+ $this->set($key, $value);
+ }
+
+ return true;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Comment.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Comment.php
new file mode 100644
index 00000000000..1b5ab1fd2c1
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Comment.php
@@ -0,0 +1,331 @@
+author = 'Author';
+ $this->text = new RichText();
+ $this->fillColor = new Style\Color('FFFFFFE1');
+ $this->alignment = Style\Alignment::HORIZONTAL_GENERAL;
+ }
+
+ /**
+ * Get Author.
+ *
+ * @return string
+ */
+ public function getAuthor()
+ {
+ return $this->author;
+ }
+
+ /**
+ * Set Author.
+ *
+ * @param string $author
+ *
+ * @return Comment
+ */
+ public function setAuthor($author)
+ {
+ $this->author = $author;
+
+ return $this;
+ }
+
+ /**
+ * Get Rich text comment.
+ *
+ * @return RichText
+ */
+ public function getText()
+ {
+ return $this->text;
+ }
+
+ /**
+ * Set Rich text comment.
+ *
+ * @param RichText $pValue
+ *
+ * @return Comment
+ */
+ public function setText(RichText $pValue)
+ {
+ $this->text = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get comment width (CSS style, i.e. XXpx or YYpt).
+ *
+ * @return string
+ */
+ public function getWidth()
+ {
+ return $this->width;
+ }
+
+ /**
+ * Set comment width (CSS style, i.e. XXpx or YYpt).
+ *
+ * @param string $width
+ *
+ * @return Comment
+ */
+ public function setWidth($width)
+ {
+ $this->width = $width;
+
+ return $this;
+ }
+
+ /**
+ * Get comment height (CSS style, i.e. XXpx or YYpt).
+ *
+ * @return string
+ */
+ public function getHeight()
+ {
+ return $this->height;
+ }
+
+ /**
+ * Set comment height (CSS style, i.e. XXpx or YYpt).
+ *
+ * @param string $value
+ *
+ * @return Comment
+ */
+ public function setHeight($value)
+ {
+ $this->height = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get left margin (CSS style, i.e. XXpx or YYpt).
+ *
+ * @return string
+ */
+ public function getMarginLeft()
+ {
+ return $this->marginLeft;
+ }
+
+ /**
+ * Set left margin (CSS style, i.e. XXpx or YYpt).
+ *
+ * @param string $value
+ *
+ * @return Comment
+ */
+ public function setMarginLeft($value)
+ {
+ $this->marginLeft = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get top margin (CSS style, i.e. XXpx or YYpt).
+ *
+ * @return string
+ */
+ public function getMarginTop()
+ {
+ return $this->marginTop;
+ }
+
+ /**
+ * Set top margin (CSS style, i.e. XXpx or YYpt).
+ *
+ * @param string $value
+ *
+ * @return Comment
+ */
+ public function setMarginTop($value)
+ {
+ $this->marginTop = $value;
+
+ return $this;
+ }
+
+ /**
+ * Is the comment visible by default?
+ *
+ * @return bool
+ */
+ public function getVisible()
+ {
+ return $this->visible;
+ }
+
+ /**
+ * Set comment default visibility.
+ *
+ * @param bool $value
+ *
+ * @return Comment
+ */
+ public function setVisible($value)
+ {
+ $this->visible = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get fill color.
+ *
+ * @return Style\Color
+ */
+ public function getFillColor()
+ {
+ return $this->fillColor;
+ }
+
+ /**
+ * Set Alignment.
+ *
+ * @param string $alignment see Style\Alignment::HORIZONTAL_*
+ *
+ * @return Comment
+ */
+ public function setAlignment($alignment)
+ {
+ $this->alignment = $alignment;
+
+ return $this;
+ }
+
+ /**
+ * Get Alignment.
+ *
+ * @return string
+ */
+ public function getAlignment()
+ {
+ return $this->alignment;
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ return md5(
+ $this->author .
+ $this->text->getHashCode() .
+ $this->width .
+ $this->height .
+ $this->marginLeft .
+ $this->marginTop .
+ ($this->visible ? 1 : 0) .
+ $this->fillColor->getHashCode() .
+ $this->alignment .
+ __CLASS__
+ );
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+
+ /**
+ * Convert to string.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->text->getPlainText();
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/DocumentProperties.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Properties.php
similarity index 69%
rename from lib/phpexcel/PHPExcel/DocumentProperties.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Properties.php
index 2395ba987d6..bbac96d92a8 100644
--- a/lib/phpexcel/PHPExcel/DocumentProperties.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Properties.php
@@ -1,138 +1,114 @@
lastModifiedBy = $this->creator;
- $this->created = time();
+ $this->created = time();
$this->modified = time();
}
/**
- * Get Creator
+ * Get Creator.
*
* @return string
*/
@@ -142,19 +118,21 @@ class PHPExcel_DocumentProperties
}
/**
- * Set Creator
+ * Set Creator.
*
- * @param string $pValue
- * @return PHPExcel_DocumentProperties
+ * @param string $creator
+ *
+ * @return Properties
*/
- public function setCreator($pValue = '')
+ public function setCreator($creator)
{
- $this->creator = $pValue;
+ $this->creator = $creator;
+
return $this;
}
/**
- * Get Last Modified By
+ * Get Last Modified By.
*
* @return string
*/
@@ -164,21 +142,23 @@ class PHPExcel_DocumentProperties
}
/**
- * Set Last Modified By
+ * Set Last Modified By.
*
* @param string $pValue
- * @return PHPExcel_DocumentProperties
+ *
+ * @return Properties
*/
- public function setLastModifiedBy($pValue = '')
+ public function setLastModifiedBy($pValue)
{
$this->lastModifiedBy = $pValue;
+
return $this;
}
/**
- * Get Created
+ * Get Created.
*
- * @return datetime
+ * @return int
*/
public function getCreated()
{
@@ -186,31 +166,33 @@ class PHPExcel_DocumentProperties
}
/**
- * Set Created
+ * Set Created.
*
- * @param datetime $pValue
- * @return PHPExcel_DocumentProperties
+ * @param int|string $time
+ *
+ * @return Properties
*/
- public function setCreated($pValue = null)
+ public function setCreated($time)
{
- if ($pValue === null) {
- $pValue = time();
- } elseif (is_string($pValue)) {
- if (is_numeric($pValue)) {
- $pValue = intval($pValue);
+ if ($time === null) {
+ $time = time();
+ } elseif (is_string($time)) {
+ if (is_numeric($time)) {
+ $time = (int) $time;
} else {
- $pValue = strtotime($pValue);
+ $time = strtotime($time);
}
}
- $this->created = $pValue;
+ $this->created = $time;
+
return $this;
}
/**
- * Get Modified
+ * Get Modified.
*
- * @return datetime
+ * @return int
*/
public function getModified()
{
@@ -218,29 +200,31 @@ class PHPExcel_DocumentProperties
}
/**
- * Set Modified
+ * Set Modified.
*
- * @param datetime $pValue
- * @return PHPExcel_DocumentProperties
+ * @param int|string $time
+ *
+ * @return Properties
*/
- public function setModified($pValue = null)
+ public function setModified($time)
{
- if ($pValue === null) {
- $pValue = time();
- } elseif (is_string($pValue)) {
- if (is_numeric($pValue)) {
- $pValue = intval($pValue);
+ if ($time === null) {
+ $time = time();
+ } elseif (is_string($time)) {
+ if (is_numeric($time)) {
+ $time = (int) $time;
} else {
- $pValue = strtotime($pValue);
+ $time = strtotime($time);
}
}
- $this->modified = $pValue;
+ $this->modified = $time;
+
return $this;
}
/**
- * Get Title
+ * Get Title.
*
* @return string
*/
@@ -250,19 +234,21 @@ class PHPExcel_DocumentProperties
}
/**
- * Set Title
+ * Set Title.
*
- * @param string $pValue
- * @return PHPExcel_DocumentProperties
+ * @param string $title
+ *
+ * @return Properties
*/
- public function setTitle($pValue = '')
+ public function setTitle($title)
{
- $this->title = $pValue;
+ $this->title = $title;
+
return $this;
}
/**
- * Get Description
+ * Get Description.
*
* @return string
*/
@@ -272,19 +258,21 @@ class PHPExcel_DocumentProperties
}
/**
- * Set Description
+ * Set Description.
*
- * @param string $pValue
- * @return PHPExcel_DocumentProperties
+ * @param string $description
+ *
+ * @return Properties
*/
- public function setDescription($pValue = '')
+ public function setDescription($description)
{
- $this->description = $pValue;
+ $this->description = $description;
+
return $this;
}
/**
- * Get Subject
+ * Get Subject.
*
* @return string
*/
@@ -294,19 +282,21 @@ class PHPExcel_DocumentProperties
}
/**
- * Set Subject
+ * Set Subject.
*
- * @param string $pValue
- * @return PHPExcel_DocumentProperties
+ * @param string $subject
+ *
+ * @return Properties
*/
- public function setSubject($pValue = '')
+ public function setSubject($subject)
{
- $this->subject = $pValue;
+ $this->subject = $subject;
+
return $this;
}
/**
- * Get Keywords
+ * Get Keywords.
*
* @return string
*/
@@ -316,19 +306,21 @@ class PHPExcel_DocumentProperties
}
/**
- * Set Keywords
+ * Set Keywords.
*
- * @param string $pValue
- * @return PHPExcel_DocumentProperties
+ * @param string $keywords
+ *
+ * @return Properties
*/
- public function setKeywords($pValue = '')
+ public function setKeywords($keywords)
{
- $this->keywords = $pValue;
+ $this->keywords = $keywords;
+
return $this;
}
/**
- * Get Category
+ * Get Category.
*
* @return string
*/
@@ -338,19 +330,21 @@ class PHPExcel_DocumentProperties
}
/**
- * Set Category
+ * Set Category.
*
- * @param string $pValue
- * @return PHPExcel_DocumentProperties
+ * @param string $category
+ *
+ * @return Properties
*/
- public function setCategory($pValue = '')
+ public function setCategory($category)
{
- $this->category = $pValue;
+ $this->category = $category;
+
return $this;
}
/**
- * Get Company
+ * Get Company.
*
* @return string
*/
@@ -360,19 +354,21 @@ class PHPExcel_DocumentProperties
}
/**
- * Set Company
+ * Set Company.
*
- * @param string $pValue
- * @return PHPExcel_DocumentProperties
+ * @param string $company
+ *
+ * @return Properties
*/
- public function setCompany($pValue = '')
+ public function setCompany($company)
{
- $this->company = $pValue;
+ $this->company = $company;
+
return $this;
}
/**
- * Get Manager
+ * Get Manager.
*
* @return string
*/
@@ -382,19 +378,21 @@ class PHPExcel_DocumentProperties
}
/**
- * Set Manager
+ * Set Manager.
*
- * @param string $pValue
- * @return PHPExcel_DocumentProperties
+ * @param string $manager
+ *
+ * @return Properties
*/
- public function setManager($pValue = '')
+ public function setManager($manager)
{
- $this->manager = $pValue;
+ $this->manager = $manager;
+
return $this;
}
/**
- * Get a List of Custom Property Names
+ * Get a List of Custom Property Names.
*
* @return array of string
*/
@@ -404,10 +402,11 @@ class PHPExcel_DocumentProperties
}
/**
- * Check if a Custom Property is defined
+ * Check if a Custom Property is defined.
*
* @param string $propertyName
- * @return boolean
+ *
+ * @return bool
*/
public function isCustomPropertySet($propertyName)
{
@@ -415,9 +414,10 @@ class PHPExcel_DocumentProperties
}
/**
- * Get a Custom Property Value
+ * Get a Custom Property Value.
*
* @param string $propertyName
+ *
* @return string
*/
public function getCustomPropertyValue($propertyName)
@@ -425,13 +425,13 @@ class PHPExcel_DocumentProperties
if (isset($this->customProperties[$propertyName])) {
return $this->customProperties[$propertyName]['value'];
}
-
}
/**
- * Get a Custom Property Type
+ * Get a Custom Property Type.
*
* @param string $propertyName
+ *
* @return string
*/
public function getCustomPropertyType($propertyName)
@@ -439,11 +439,10 @@ class PHPExcel_DocumentProperties
if (isset($this->customProperties[$propertyName])) {
return $this->customProperties[$propertyName]['type'];
}
-
}
/**
- * Set a Custom Property
+ * Set a Custom Property.
*
* @param string $propertyName
* @param mixed $propertyValue
@@ -453,15 +452,16 @@ class PHPExcel_DocumentProperties
* 's' : String
* 'd' : Date/Time
* 'b' : Boolean
- * @return PHPExcel_DocumentProperties
+ *
+ * @return Properties
*/
public function setCustomProperty($propertyName, $propertyValue = '', $propertyType = null)
{
- if (($propertyType === null) || (!in_array($propertyType, array(self::PROPERTY_TYPE_INTEGER,
+ if (($propertyType === null) || (!in_array($propertyType, [self::PROPERTY_TYPE_INTEGER,
self::PROPERTY_TYPE_FLOAT,
self::PROPERTY_TYPE_STRING,
self::PROPERTY_TYPE_DATE,
- self::PROPERTY_TYPE_BOOLEAN)))) {
+ self::PROPERTY_TYPE_BOOLEAN, ]))) {
if ($propertyValue === null) {
$propertyType = self::PROPERTY_TYPE_STRING;
} elseif (is_float($propertyValue)) {
@@ -475,10 +475,11 @@ class PHPExcel_DocumentProperties
}
}
- $this->customProperties[$propertyName] = array(
+ $this->customProperties[$propertyName] = [
'value' => $propertyValue,
- 'type' => $propertyType
- );
+ 'type' => $propertyType,
+ ];
+
return $this;
}
@@ -502,9 +503,11 @@ class PHPExcel_DocumentProperties
switch ($propertyType) {
case 'empty': // Empty
return '';
+
break;
case 'null': // Null
return null;
+
break;
case 'i1': // 1-Byte Signed Integer
case 'i2': // 2-Byte Signed Integer
@@ -512,6 +515,7 @@ class PHPExcel_DocumentProperties
case 'i8': // 8-Byte Signed Integer
case 'int': // Integer
return (int) $propertyValue;
+
break;
case 'ui1': // 1-Byte Unsigned Integer
case 'ui2': // 2-Byte Unsigned Integer
@@ -519,23 +523,28 @@ class PHPExcel_DocumentProperties
case 'ui8': // 8-Byte Unsigned Integer
case 'uint': // Unsigned Integer
return abs((int) $propertyValue);
+
break;
case 'r4': // 4-Byte Real Number
case 'r8': // 8-Byte Real Number
case 'decimal': // Decimal
return (float) $propertyValue;
+
break;
case 'lpstr': // LPSTR
case 'lpwstr': // LPWSTR
case 'bstr': // Basic String
return $propertyValue;
+
break;
case 'date': // Date and Time
case 'filetime': // File Time
return strtotime($propertyValue);
+
break;
case 'bool': // Boolean
- return ($propertyValue == 'true') ? true : false;
+ return $propertyValue == 'true';
+
break;
case 'cy': // Currency
case 'error': // Error Status Code
@@ -551,8 +560,10 @@ class PHPExcel_DocumentProperties
case 'clsid': // Class ID
case 'cf': // Clipboard Data
return $propertyValue;
+
break;
}
+
return $propertyValue;
}
@@ -570,11 +581,13 @@ class PHPExcel_DocumentProperties
case 'ui8': // 8-Byte Unsigned Integer
case 'uint': // Unsigned Integer
return self::PROPERTY_TYPE_INTEGER;
+
break;
case 'r4': // 4-Byte Real Number
case 'r8': // 8-Byte Real Number
case 'decimal': // Decimal
return self::PROPERTY_TYPE_FLOAT;
+
break;
case 'empty': // Empty
case 'null': // Null
@@ -582,13 +595,16 @@ class PHPExcel_DocumentProperties
case 'lpwstr': // LPWSTR
case 'bstr': // Basic String
return self::PROPERTY_TYPE_STRING;
+
break;
case 'date': // Date and Time
case 'filetime': // File Time
return self::PROPERTY_TYPE_DATE;
+
break;
case 'bool': // Boolean
return self::PROPERTY_TYPE_BOOLEAN;
+
break;
case 'cy': // Currency
case 'error': // Error Status Code
@@ -604,8 +620,10 @@ class PHPExcel_DocumentProperties
case 'clsid': // Class ID
case 'cf': // Clipboard Data
return self::PROPERTY_TYPE_UNKNOWN;
+
break;
}
+
return self::PROPERTY_TYPE_UNKNOWN;
}
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Security.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Security.php
new file mode 100644
index 00000000000..1682678c2e7
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Document/Security.php
@@ -0,0 +1,205 @@
+lockRevision ||
+ $this->lockStructure ||
+ $this->lockWindows;
+ }
+
+ /**
+ * Get LockRevision.
+ *
+ * @return bool
+ */
+ public function getLockRevision()
+ {
+ return $this->lockRevision;
+ }
+
+ /**
+ * Set LockRevision.
+ *
+ * @param bool $pValue
+ *
+ * @return Security
+ */
+ public function setLockRevision($pValue)
+ {
+ $this->lockRevision = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get LockStructure.
+ *
+ * @return bool
+ */
+ public function getLockStructure()
+ {
+ return $this->lockStructure;
+ }
+
+ /**
+ * Set LockStructure.
+ *
+ * @param bool $pValue
+ *
+ * @return Security
+ */
+ public function setLockStructure($pValue)
+ {
+ $this->lockStructure = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get LockWindows.
+ *
+ * @return bool
+ */
+ public function getLockWindows()
+ {
+ return $this->lockWindows;
+ }
+
+ /**
+ * Set LockWindows.
+ *
+ * @param bool $pValue
+ *
+ * @return Security
+ */
+ public function setLockWindows($pValue)
+ {
+ $this->lockWindows = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get RevisionsPassword (hashed).
+ *
+ * @return string
+ */
+ public function getRevisionsPassword()
+ {
+ return $this->revisionsPassword;
+ }
+
+ /**
+ * Set RevisionsPassword.
+ *
+ * @param string $pValue
+ * @param bool $pAlreadyHashed If the password has already been hashed, set this to true
+ *
+ * @return Security
+ */
+ public function setRevisionsPassword($pValue, $pAlreadyHashed = false)
+ {
+ if (!$pAlreadyHashed) {
+ $pValue = PasswordHasher::hashPassword($pValue);
+ }
+ $this->revisionsPassword = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get WorkbookPassword (hashed).
+ *
+ * @return string
+ */
+ public function getWorkbookPassword()
+ {
+ return $this->workbookPassword;
+ }
+
+ /**
+ * Set WorkbookPassword.
+ *
+ * @param string $pValue
+ * @param bool $pAlreadyHashed If the password has already been hashed, set this to true
+ *
+ * @return Security
+ */
+ public function setWorkbookPassword($pValue, $pAlreadyHashed = false)
+ {
+ if (!$pAlreadyHashed) {
+ $pValue = PasswordHasher::hashPassword($pValue);
+ }
+ $this->workbookPassword = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Exception.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Exception.php
new file mode 100644
index 00000000000..9c5ab30ee05
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Exception.php
@@ -0,0 +1,7 @@
+addFromSource($pSource);
+ }
+ }
+
+ /**
+ * Add HashTable items from source.
+ *
+ * @param IComparable[] $pSource Source array to create HashTable from
+ *
+ * @throws Exception
+ */
+ public function addFromSource(array $pSource = null)
+ {
+ // Check if an array was passed
+ if ($pSource == null) {
+ return;
+ }
+
+ foreach ($pSource as $item) {
+ $this->add($item);
+ }
+ }
+
+ /**
+ * Add HashTable item.
+ *
+ * @param IComparable $pSource Item to add
+ */
+ public function add(IComparable $pSource)
+ {
+ $hash = $pSource->getHashCode();
+ if (!isset($this->items[$hash])) {
+ $this->items[$hash] = $pSource;
+ $this->keyMap[count($this->items) - 1] = $hash;
+ }
+ }
+
+ /**
+ * Remove HashTable item.
+ *
+ * @param IComparable $pSource Item to remove
+ */
+ public function remove(IComparable $pSource)
+ {
+ $hash = $pSource->getHashCode();
+ if (isset($this->items[$hash])) {
+ unset($this->items[$hash]);
+
+ $deleteKey = -1;
+ foreach ($this->keyMap as $key => $value) {
+ if ($deleteKey >= 0) {
+ $this->keyMap[$key - 1] = $value;
+ }
+
+ if ($value == $hash) {
+ $deleteKey = $key;
+ }
+ }
+ unset($this->keyMap[count($this->keyMap) - 1]);
+ }
+ }
+
+ /**
+ * Clear HashTable.
+ */
+ public function clear()
+ {
+ $this->items = [];
+ $this->keyMap = [];
+ }
+
+ /**
+ * Count.
+ *
+ * @return int
+ */
+ public function count()
+ {
+ return count($this->items);
+ }
+
+ /**
+ * Get index for hash code.
+ *
+ * @param string $pHashCode
+ *
+ * @return int Index
+ */
+ public function getIndexForHashCode($pHashCode)
+ {
+ return array_search($pHashCode, $this->keyMap);
+ }
+
+ /**
+ * Get by index.
+ *
+ * @param int $pIndex
+ *
+ * @return IComparable
+ */
+ public function getByIndex($pIndex)
+ {
+ if (isset($this->keyMap[$pIndex])) {
+ return $this->getByHashCode($this->keyMap[$pIndex]);
+ }
+
+ return null;
+ }
+
+ /**
+ * Get by hashcode.
+ *
+ * @param string $pHashCode
+ *
+ * @return IComparable
+ */
+ public function getByHashCode($pHashCode)
+ {
+ if (isset($this->items[$pHashCode])) {
+ return $this->items[$pHashCode];
+ }
+
+ return null;
+ }
+
+ /**
+ * HashTable to array.
+ *
+ * @return IComparable[]
+ */
+ public function toArray()
+ {
+ return $this->items;
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ $this->$key = clone $value;
+ }
+ }
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Helper/HTML.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Html.php
similarity index 94%
rename from lib/phpexcel/PHPExcel/Helper/HTML.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Html.php
index 1e41e065e2b..eaf73028fa7 100644
--- a/lib/phpexcel/PHPExcel/Helper/HTML.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Html.php
@@ -1,8 +1,18 @@
'f0f8ff',
'antiquewhite' => 'faebd7',
'antiquewhite1' => 'ffefdb',
@@ -520,20 +530,27 @@ class PHPExcel_Helper_HTML
'yellow3' => 'cdcd00',
'yellow4' => '8b8b00',
'yellowgreen' => '9acd32',
- );
+ ];
protected $face;
+
protected $size;
+
protected $color;
protected $bold = false;
+
protected $italic = false;
+
protected $underline = false;
+
protected $superscript = false;
+
protected $subscript = false;
+
protected $strikethrough = false;
- protected $startTagCallbacks = array(
+ protected $startTagCallbacks = [
'font' => 'startFontTag',
'b' => 'startBoldTag',
'strong' => 'startBoldTag',
@@ -544,9 +561,9 @@ class PHPExcel_Helper_HTML
'del' => 'startStrikethruTag',
'sup' => 'startSuperscriptTag',
'sub' => 'startSubscriptTag',
- );
+ ];
- protected $endTagCallbacks = array(
+ protected $endTagCallbacks = [
'font' => 'endFontTag',
'b' => 'endBoldTag',
'strong' => 'endBoldTag',
@@ -565,12 +582,15 @@ class PHPExcel_Helper_HTML
'h4' => 'breakTag',
'h5' => 'breakTag',
'h6' => 'breakTag',
- );
+ ];
- protected $stack = array();
+ protected $stack = [];
protected $stringData = '';
+ /**
+ * @var RichText
+ */
protected $richTextObject;
protected function initialise()
@@ -578,25 +598,32 @@ class PHPExcel_Helper_HTML
$this->face = $this->size = $this->color = null;
$this->bold = $this->italic = $this->underline = $this->superscript = $this->subscript = $this->strikethrough = false;
- $this->stack = array();
+ $this->stack = [];
$this->stringData = '';
}
+ /**
+ * Parse HTML formatting and return the resulting RichText.
+ *
+ * @param string $html
+ *
+ * @return RichText
+ */
public function toRichTextObject($html)
{
$this->initialise();
- // Create a new DOM object
- $dom = new \DOMDocument;
- // Load the HTML file into the DOM object
+ // Create a new DOM object
+ $dom = new DOMDocument();
+ // Load the HTML file into the DOM object
// Note the use of error suppression, because typically this will be an html fragment, so not fully valid markup
- $loaded = @$dom->loadHTML($html);
-
- // Discard excess white space
+ $prefix = '';
+ @$dom->loadHTML($prefix . $html, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
+ // Discard excess white space
$dom->preserveWhiteSpace = false;
- $this->richTextObject = new PHPExcel_RichText();;
+ $this->richTextObject = new RichText();
$this->parseElements($dom);
// Clean any further spurious whitespace
@@ -634,7 +661,7 @@ class PHPExcel_Helper_HTML
$richtextRun->getFont()->setSize($this->size);
}
if ($this->color) {
- $richtextRun->getFont()->setColor(new PHPExcel_Style_Color('ff' . $this->color));
+ $richtextRun->getFont()->setColor(new Color('ff' . $this->color));
}
if ($this->bold) {
$richtextRun->getFont()->setBold(true);
@@ -643,13 +670,13 @@ class PHPExcel_Helper_HTML
$richtextRun->getFont()->setItalic(true);
}
if ($this->underline) {
- $richtextRun->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
+ $richtextRun->getFont()->setUnderline(Font::UNDERLINE_SINGLE);
}
if ($this->superscript) {
- $richtextRun->getFont()->setSuperScript(true);
+ $richtextRun->getFont()->setSuperscript(true);
}
if ($this->subscript) {
- $richtextRun->getFont()->setSubScript(true);
+ $richtextRun->getFont()->setSubscript(true);
}
if ($this->strikethrough) {
$richtextRun->getFont()->setStrikethrough(true);
@@ -663,6 +690,7 @@ class PHPExcel_Helper_HTML
foreach ($values[0] as &$value) {
$value = str_pad(dechex($value), 2, '0', STR_PAD_LEFT);
}
+
return implode($values[0]);
}
@@ -772,12 +800,17 @@ class PHPExcel_Helper_HTML
$this->buildTextRun();
}
- protected function handleCallback($element, $callbackTag, $callbacks)
+ /**
+ * @param DOMElement $element
+ * @param string $callbackTag
+ * @param array $callbacks
+ */
+ protected function handleCallback(DOMElement $element, $callbackTag, array $callbacks)
{
if (isset($callbacks[$callbackTag])) {
$elementHandler = $callbacks[$callbackTag];
if (method_exists($this, $elementHandler)) {
- call_user_func(array($this, $elementHandler), $element);
+ call_user_func([$this, $elementHandler], $element);
}
}
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Migrator.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Migrator.php
new file mode 100644
index 00000000000..26d5fcead87
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Migrator.php
@@ -0,0 +1,333 @@
+from = array_keys($this->getMapping());
+ $this->to = array_values($this->getMapping());
+ }
+
+ /**
+ * Return the ordered mapping from old PHPExcel class names to new PhpSpreadsheet one.
+ *
+ * @return string[]
+ */
+ public function getMapping()
+ {
+ // Order matters here, we should have the deepest namespaces first (the most "unique" strings)
+ $classes = [
+ 'PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE_Blip' => \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE\Blip::class,
+ 'PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer' => \PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer\SpContainer::class,
+ 'PHPExcel_Shared_Escher_DggContainer_BstoreContainer_BSE' => \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE::class,
+ 'PHPExcel_Shared_Escher_DgContainer_SpgrContainer' => \PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer::class,
+ 'PHPExcel_Shared_Escher_DggContainer_BstoreContainer' => \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer::class,
+ 'PHPExcel_Shared_OLE_PPS_File' => \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\File::class,
+ 'PHPExcel_Shared_OLE_PPS_Root' => \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS\Root::class,
+ 'PHPExcel_Worksheet_AutoFilter_Column_Rule' => \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::class,
+ 'PHPExcel_Writer_OpenDocument_Cell_Comment' => \PhpOffice\PhpSpreadsheet\Writer\Ods\Cell\Comment::class,
+ 'PHPExcel_Calculation_Token_Stack' => \PhpOffice\PhpSpreadsheet\Calculation\Token\Stack::class,
+ 'PHPExcel_Chart_Renderer_jpgraph' => \PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph::class,
+ 'PHPExcel_Reader_Excel5_Escher' => \PhpOffice\PhpSpreadsheet\Reader\Xls\Escher::class,
+ 'PHPExcel_Reader_Excel5_MD5' => \PhpOffice\PhpSpreadsheet\Reader\Xls\MD5::class,
+ 'PHPExcel_Reader_Excel5_RC4' => \PhpOffice\PhpSpreadsheet\Reader\Xls\RC4::class,
+ 'PHPExcel_Reader_Excel2007_Chart' => \PhpOffice\PhpSpreadsheet\Reader\Xlsx\Chart::class,
+ 'PHPExcel_Reader_Excel2007_Theme' => \PhpOffice\PhpSpreadsheet\Reader\Xlsx\Theme::class,
+ 'PHPExcel_Shared_Escher_DgContainer' => \PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer::class,
+ 'PHPExcel_Shared_Escher_DggContainer' => \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer::class,
+ 'CholeskyDecomposition' => \PhpOffice\PhpSpreadsheet\Shared\JAMA\CholeskyDecomposition::class,
+ 'EigenvalueDecomposition' => \PhpOffice\PhpSpreadsheet\Shared\JAMA\EigenvalueDecomposition::class,
+ 'PHPExcel_Shared_JAMA_LUDecomposition' => \PhpOffice\PhpSpreadsheet\Shared\JAMA\LUDecomposition::class,
+ 'PHPExcel_Shared_JAMA_Matrix' => \PhpOffice\PhpSpreadsheet\Shared\JAMA\Matrix::class,
+ 'QRDecomposition' => \PhpOffice\PhpSpreadsheet\Shared\JAMA\QRDecomposition::class,
+ 'PHPExcel_Shared_JAMA_QRDecomposition' => \PhpOffice\PhpSpreadsheet\Shared\JAMA\QRDecomposition::class,
+ 'SingularValueDecomposition' => \PhpOffice\PhpSpreadsheet\Shared\JAMA\SingularValueDecomposition::class,
+ 'PHPExcel_Shared_OLE_ChainedBlockStream' => \PhpOffice\PhpSpreadsheet\Shared\OLE\ChainedBlockStream::class,
+ 'PHPExcel_Shared_OLE_PPS' => \PhpOffice\PhpSpreadsheet\Shared\OLE\PPS::class,
+ 'PHPExcel_Best_Fit' => \PhpOffice\PhpSpreadsheet\Shared\Trend\BestFit::class,
+ 'PHPExcel_Exponential_Best_Fit' => \PhpOffice\PhpSpreadsheet\Shared\Trend\ExponentialBestFit::class,
+ 'PHPExcel_Linear_Best_Fit' => \PhpOffice\PhpSpreadsheet\Shared\Trend\LinearBestFit::class,
+ 'PHPExcel_Logarithmic_Best_Fit' => \PhpOffice\PhpSpreadsheet\Shared\Trend\LogarithmicBestFit::class,
+ 'polynomialBestFit' => \PhpOffice\PhpSpreadsheet\Shared\Trend\PolynomialBestFit::class,
+ 'PHPExcel_Polynomial_Best_Fit' => \PhpOffice\PhpSpreadsheet\Shared\Trend\PolynomialBestFit::class,
+ 'powerBestFit' => \PhpOffice\PhpSpreadsheet\Shared\Trend\PowerBestFit::class,
+ 'PHPExcel_Power_Best_Fit' => \PhpOffice\PhpSpreadsheet\Shared\Trend\PowerBestFit::class,
+ 'trendClass' => \PhpOffice\PhpSpreadsheet\Shared\Trend\Trend::class,
+ 'PHPExcel_Worksheet_AutoFilter_Column' => \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::class,
+ 'PHPExcel_Worksheet_Drawing_Shadow' => \PhpOffice\PhpSpreadsheet\Worksheet\Drawing\Shadow::class,
+ 'PHPExcel_Writer_OpenDocument_Content' => \PhpOffice\PhpSpreadsheet\Writer\Ods\Content::class,
+ 'PHPExcel_Writer_OpenDocument_Meta' => \PhpOffice\PhpSpreadsheet\Writer\Ods\Meta::class,
+ 'PHPExcel_Writer_OpenDocument_MetaInf' => \PhpOffice\PhpSpreadsheet\Writer\Ods\MetaInf::class,
+ 'PHPExcel_Writer_OpenDocument_Mimetype' => \PhpOffice\PhpSpreadsheet\Writer\Ods\Mimetype::class,
+ 'PHPExcel_Writer_OpenDocument_Settings' => \PhpOffice\PhpSpreadsheet\Writer\Ods\Settings::class,
+ 'PHPExcel_Writer_OpenDocument_Styles' => \PhpOffice\PhpSpreadsheet\Writer\Ods\Styles::class,
+ 'PHPExcel_Writer_OpenDocument_Thumbnails' => \PhpOffice\PhpSpreadsheet\Writer\Ods\Thumbnails::class,
+ 'PHPExcel_Writer_OpenDocument_WriterPart' => \PhpOffice\PhpSpreadsheet\Writer\Ods\WriterPart::class,
+ 'PHPExcel_Writer_PDF_Core' => \PhpOffice\PhpSpreadsheet\Writer\Pdf::class,
+ 'PHPExcel_Writer_PDF_DomPDF' => \PhpOffice\PhpSpreadsheet\Writer\Pdf\Dompdf::class,
+ 'PHPExcel_Writer_PDF_mPDF' => \PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf::class,
+ 'PHPExcel_Writer_PDF_tcPDF' => \PhpOffice\PhpSpreadsheet\Writer\Pdf\Tcpdf::class,
+ 'PHPExcel_Writer_Excel5_BIFFwriter' => \PhpOffice\PhpSpreadsheet\Writer\Xls\BIFFwriter::class,
+ 'PHPExcel_Writer_Excel5_Escher' => \PhpOffice\PhpSpreadsheet\Writer\Xls\Escher::class,
+ 'PHPExcel_Writer_Excel5_Font' => \PhpOffice\PhpSpreadsheet\Writer\Xls\Font::class,
+ 'PHPExcel_Writer_Excel5_Parser' => \PhpOffice\PhpSpreadsheet\Writer\Xls\Parser::class,
+ 'PHPExcel_Writer_Excel5_Workbook' => \PhpOffice\PhpSpreadsheet\Writer\Xls\Workbook::class,
+ 'PHPExcel_Writer_Excel5_Worksheet' => \PhpOffice\PhpSpreadsheet\Writer\Xls\Worksheet::class,
+ 'PHPExcel_Writer_Excel5_Xf' => \PhpOffice\PhpSpreadsheet\Writer\Xls\Xf::class,
+ 'PHPExcel_Writer_Excel2007_Chart' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Chart::class,
+ 'PHPExcel_Writer_Excel2007_Comments' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Comments::class,
+ 'PHPExcel_Writer_Excel2007_ContentTypes' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\ContentTypes::class,
+ 'PHPExcel_Writer_Excel2007_DocProps' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\DocProps::class,
+ 'PHPExcel_Writer_Excel2007_Drawing' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Drawing::class,
+ 'PHPExcel_Writer_Excel2007_Rels' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Rels::class,
+ 'PHPExcel_Writer_Excel2007_RelsRibbon' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\RelsRibbon::class,
+ 'PHPExcel_Writer_Excel2007_RelsVBA' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\RelsVBA::class,
+ 'PHPExcel_Writer_Excel2007_StringTable' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\StringTable::class,
+ 'PHPExcel_Writer_Excel2007_Style' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Style::class,
+ 'PHPExcel_Writer_Excel2007_Theme' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Theme::class,
+ 'PHPExcel_Writer_Excel2007_Workbook' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Workbook::class,
+ 'PHPExcel_Writer_Excel2007_Worksheet' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\Worksheet::class,
+ 'PHPExcel_Writer_Excel2007_WriterPart' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx\WriterPart::class,
+ 'PHPExcel_CachedObjectStorage_CacheBase' => \PhpOffice\PhpSpreadsheet\Collection\Cells::class,
+ 'PHPExcel_CalcEngine_CyclicReferenceStack' => \PhpOffice\PhpSpreadsheet\Calculation\Engine\CyclicReferenceStack::class,
+ 'PHPExcel_CalcEngine_Logger' => \PhpOffice\PhpSpreadsheet\Calculation\Engine\Logger::class,
+ 'PHPExcel_Calculation_Functions' => \PhpOffice\PhpSpreadsheet\Calculation\Functions::class,
+ 'PHPExcel_Calculation_Function' => \PhpOffice\PhpSpreadsheet\Calculation\Category::class,
+ 'PHPExcel_Calculation_Database' => \PhpOffice\PhpSpreadsheet\Calculation\Database::class,
+ 'PHPExcel_Calculation_DateTime' => \PhpOffice\PhpSpreadsheet\Calculation\DateTime::class,
+ 'PHPExcel_Calculation_Engineering' => \PhpOffice\PhpSpreadsheet\Calculation\Engineering::class,
+ 'PHPExcel_Calculation_Exception' => \PhpOffice\PhpSpreadsheet\Calculation\Exception::class,
+ 'PHPExcel_Calculation_ExceptionHandler' => \PhpOffice\PhpSpreadsheet\Calculation\ExceptionHandler::class,
+ 'PHPExcel_Calculation_Financial' => \PhpOffice\PhpSpreadsheet\Calculation\Financial::class,
+ 'PHPExcel_Calculation_FormulaParser' => \PhpOffice\PhpSpreadsheet\Calculation\FormulaParser::class,
+ 'PHPExcel_Calculation_FormulaToken' => \PhpOffice\PhpSpreadsheet\Calculation\FormulaToken::class,
+ 'PHPExcel_Calculation_Logical' => \PhpOffice\PhpSpreadsheet\Calculation\Logical::class,
+ 'PHPExcel_Calculation_LookupRef' => \PhpOffice\PhpSpreadsheet\Calculation\LookupRef::class,
+ 'PHPExcel_Calculation_MathTrig' => \PhpOffice\PhpSpreadsheet\Calculation\MathTrig::class,
+ 'PHPExcel_Calculation_Statistical' => \PhpOffice\PhpSpreadsheet\Calculation\Statistical::class,
+ 'PHPExcel_Calculation_TextData' => \PhpOffice\PhpSpreadsheet\Calculation\TextData::class,
+ 'PHPExcel_Cell_AdvancedValueBinder' => \PhpOffice\PhpSpreadsheet\Cell\AdvancedValueBinder::class,
+ 'PHPExcel_Cell_DataType' => \PhpOffice\PhpSpreadsheet\Cell\DataType::class,
+ 'PHPExcel_Cell_DataValidation' => \PhpOffice\PhpSpreadsheet\Cell\DataValidation::class,
+ 'PHPExcel_Cell_DefaultValueBinder' => \PhpOffice\PhpSpreadsheet\Cell\DefaultValueBinder::class,
+ 'PHPExcel_Cell_Hyperlink' => \PhpOffice\PhpSpreadsheet\Cell\Hyperlink::class,
+ 'PHPExcel_Cell_IValueBinder' => \PhpOffice\PhpSpreadsheet\Cell\IValueBinder::class,
+ 'PHPExcel_Chart_Axis' => \PhpOffice\PhpSpreadsheet\Chart\Axis::class,
+ 'PHPExcel_Chart_DataSeries' => \PhpOffice\PhpSpreadsheet\Chart\DataSeries::class,
+ 'PHPExcel_Chart_DataSeriesValues' => \PhpOffice\PhpSpreadsheet\Chart\DataSeriesValues::class,
+ 'PHPExcel_Chart_Exception' => \PhpOffice\PhpSpreadsheet\Chart\Exception::class,
+ 'PHPExcel_Chart_GridLines' => \PhpOffice\PhpSpreadsheet\Chart\GridLines::class,
+ 'PHPExcel_Chart_Layout' => \PhpOffice\PhpSpreadsheet\Chart\Layout::class,
+ 'PHPExcel_Chart_Legend' => \PhpOffice\PhpSpreadsheet\Chart\Legend::class,
+ 'PHPExcel_Chart_PlotArea' => \PhpOffice\PhpSpreadsheet\Chart\PlotArea::class,
+ 'PHPExcel_Properties' => \PhpOffice\PhpSpreadsheet\Chart\Properties::class,
+ 'PHPExcel_Chart_Title' => \PhpOffice\PhpSpreadsheet\Chart\Title::class,
+ 'PHPExcel_DocumentProperties' => \PhpOffice\PhpSpreadsheet\Document\Properties::class,
+ 'PHPExcel_DocumentSecurity' => \PhpOffice\PhpSpreadsheet\Document\Security::class,
+ 'PHPExcel_Helper_HTML' => \PhpOffice\PhpSpreadsheet\Helper\Html::class,
+ 'PHPExcel_Reader_Abstract' => \PhpOffice\PhpSpreadsheet\Reader\BaseReader::class,
+ 'PHPExcel_Reader_CSV' => \PhpOffice\PhpSpreadsheet\Reader\Csv::class,
+ 'PHPExcel_Reader_DefaultReadFilter' => \PhpOffice\PhpSpreadsheet\Reader\DefaultReadFilter::class,
+ 'PHPExcel_Reader_Excel2003XML' => \PhpOffice\PhpSpreadsheet\Reader\Xml::class,
+ 'PHPExcel_Reader_Exception' => \PhpOffice\PhpSpreadsheet\Reader\Exception::class,
+ 'PHPExcel_Reader_Gnumeric' => \PhpOffice\PhpSpreadsheet\Reader\Gnumeric::class,
+ 'PHPExcel_Reader_HTML' => \PhpOffice\PhpSpreadsheet\Reader\Html::class,
+ 'PHPExcel_Reader_IReadFilter' => \PhpOffice\PhpSpreadsheet\Reader\IReadFilter::class,
+ 'PHPExcel_Reader_IReader' => \PhpOffice\PhpSpreadsheet\Reader\IReader::class,
+ 'PHPExcel_Reader_OOCalc' => \PhpOffice\PhpSpreadsheet\Reader\Ods::class,
+ 'PHPExcel_Reader_SYLK' => \PhpOffice\PhpSpreadsheet\Reader\Slk::class,
+ 'PHPExcel_Reader_Excel5' => \PhpOffice\PhpSpreadsheet\Reader\Xls::class,
+ 'PHPExcel_Reader_Excel2007' => \PhpOffice\PhpSpreadsheet\Reader\Xlsx::class,
+ 'PHPExcel_RichText_ITextElement' => \PhpOffice\PhpSpreadsheet\RichText\ITextElement::class,
+ 'PHPExcel_RichText_Run' => \PhpOffice\PhpSpreadsheet\RichText\Run::class,
+ 'PHPExcel_RichText_TextElement' => \PhpOffice\PhpSpreadsheet\RichText\TextElement::class,
+ 'PHPExcel_Shared_CodePage' => \PhpOffice\PhpSpreadsheet\Shared\CodePage::class,
+ 'PHPExcel_Shared_Date' => \PhpOffice\PhpSpreadsheet\Shared\Date::class,
+ 'PHPExcel_Shared_Drawing' => \PhpOffice\PhpSpreadsheet\Shared\Drawing::class,
+ 'PHPExcel_Shared_Escher' => \PhpOffice\PhpSpreadsheet\Shared\Escher::class,
+ 'PHPExcel_Shared_File' => \PhpOffice\PhpSpreadsheet\Shared\File::class,
+ 'PHPExcel_Shared_Font' => \PhpOffice\PhpSpreadsheet\Shared\Font::class,
+ 'PHPExcel_Shared_OLE' => \PhpOffice\PhpSpreadsheet\Shared\OLE::class,
+ 'PHPExcel_Shared_OLERead' => \PhpOffice\PhpSpreadsheet\Shared\OLERead::class,
+ 'PHPExcel_Shared_PasswordHasher' => \PhpOffice\PhpSpreadsheet\Shared\PasswordHasher::class,
+ 'PHPExcel_Shared_String' => \PhpOffice\PhpSpreadsheet\Shared\StringHelper::class,
+ 'PHPExcel_Shared_TimeZone' => \PhpOffice\PhpSpreadsheet\Shared\TimeZone::class,
+ 'PHPExcel_Shared_XMLWriter' => \PhpOffice\PhpSpreadsheet\Shared\XMLWriter::class,
+ 'PHPExcel_Shared_Excel5' => \PhpOffice\PhpSpreadsheet\Shared\Xls::class,
+ 'PHPExcel_Style_Alignment' => \PhpOffice\PhpSpreadsheet\Style\Alignment::class,
+ 'PHPExcel_Style_Border' => \PhpOffice\PhpSpreadsheet\Style\Border::class,
+ 'PHPExcel_Style_Borders' => \PhpOffice\PhpSpreadsheet\Style\Borders::class,
+ 'PHPExcel_Style_Color' => \PhpOffice\PhpSpreadsheet\Style\Color::class,
+ 'PHPExcel_Style_Conditional' => \PhpOffice\PhpSpreadsheet\Style\Conditional::class,
+ 'PHPExcel_Style_Fill' => \PhpOffice\PhpSpreadsheet\Style\Fill::class,
+ 'PHPExcel_Style_Font' => \PhpOffice\PhpSpreadsheet\Style\Font::class,
+ 'PHPExcel_Style_NumberFormat' => \PhpOffice\PhpSpreadsheet\Style\NumberFormat::class,
+ 'PHPExcel_Style_Protection' => \PhpOffice\PhpSpreadsheet\Style\Protection::class,
+ 'PHPExcel_Style_Supervisor' => \PhpOffice\PhpSpreadsheet\Style\Supervisor::class,
+ 'PHPExcel_Worksheet_AutoFilter' => \PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter::class,
+ 'PHPExcel_Worksheet_BaseDrawing' => \PhpOffice\PhpSpreadsheet\Worksheet\BaseDrawing::class,
+ 'PHPExcel_Worksheet_CellIterator' => \PhpOffice\PhpSpreadsheet\Worksheet\CellIterator::class,
+ 'PHPExcel_Worksheet_Column' => \PhpOffice\PhpSpreadsheet\Worksheet\Column::class,
+ 'PHPExcel_Worksheet_ColumnCellIterator' => \PhpOffice\PhpSpreadsheet\Worksheet\ColumnCellIterator::class,
+ 'PHPExcel_Worksheet_ColumnDimension' => \PhpOffice\PhpSpreadsheet\Worksheet\ColumnDimension::class,
+ 'PHPExcel_Worksheet_ColumnIterator' => \PhpOffice\PhpSpreadsheet\Worksheet\ColumnIterator::class,
+ 'PHPExcel_Worksheet_Drawing' => \PhpOffice\PhpSpreadsheet\Worksheet\Drawing::class,
+ 'PHPExcel_Worksheet_HeaderFooter' => \PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooter::class,
+ 'PHPExcel_Worksheet_HeaderFooterDrawing' => \PhpOffice\PhpSpreadsheet\Worksheet\HeaderFooterDrawing::class,
+ 'PHPExcel_WorksheetIterator' => \PhpOffice\PhpSpreadsheet\Worksheet\Iterator::class,
+ 'PHPExcel_Worksheet_MemoryDrawing' => \PhpOffice\PhpSpreadsheet\Worksheet\MemoryDrawing::class,
+ 'PHPExcel_Worksheet_PageMargins' => \PhpOffice\PhpSpreadsheet\Worksheet\PageMargins::class,
+ 'PHPExcel_Worksheet_PageSetup' => \PhpOffice\PhpSpreadsheet\Worksheet\PageSetup::class,
+ 'PHPExcel_Worksheet_Protection' => \PhpOffice\PhpSpreadsheet\Worksheet\Protection::class,
+ 'PHPExcel_Worksheet_Row' => \PhpOffice\PhpSpreadsheet\Worksheet\Row::class,
+ 'PHPExcel_Worksheet_RowCellIterator' => \PhpOffice\PhpSpreadsheet\Worksheet\RowCellIterator::class,
+ 'PHPExcel_Worksheet_RowDimension' => \PhpOffice\PhpSpreadsheet\Worksheet\RowDimension::class,
+ 'PHPExcel_Worksheet_RowIterator' => \PhpOffice\PhpSpreadsheet\Worksheet\RowIterator::class,
+ 'PHPExcel_Worksheet_SheetView' => \PhpOffice\PhpSpreadsheet\Worksheet\SheetView::class,
+ 'PHPExcel_Writer_Abstract' => \PhpOffice\PhpSpreadsheet\Writer\BaseWriter::class,
+ 'PHPExcel_Writer_CSV' => \PhpOffice\PhpSpreadsheet\Writer\Csv::class,
+ 'PHPExcel_Writer_Exception' => \PhpOffice\PhpSpreadsheet\Writer\Exception::class,
+ 'PHPExcel_Writer_HTML' => \PhpOffice\PhpSpreadsheet\Writer\Html::class,
+ 'PHPExcel_Writer_IWriter' => \PhpOffice\PhpSpreadsheet\Writer\IWriter::class,
+ 'PHPExcel_Writer_OpenDocument' => \PhpOffice\PhpSpreadsheet\Writer\Ods::class,
+ 'PHPExcel_Writer_PDF' => \PhpOffice\PhpSpreadsheet\Writer\Pdf::class,
+ 'PHPExcel_Writer_Excel5' => \PhpOffice\PhpSpreadsheet\Writer\Xls::class,
+ 'PHPExcel_Writer_Excel2007' => \PhpOffice\PhpSpreadsheet\Writer\Xlsx::class,
+ 'PHPExcel_CachedObjectStorageFactory' => \PhpOffice\PhpSpreadsheet\Collection\CellsFactory::class,
+ 'PHPExcel_Calculation' => \PhpOffice\PhpSpreadsheet\Calculation\Calculation::class,
+ 'PHPExcel_Cell' => \PhpOffice\PhpSpreadsheet\Cell\Cell::class,
+ 'PHPExcel_Chart' => \PhpOffice\PhpSpreadsheet\Chart\Chart::class,
+ 'PHPExcel_Comment' => \PhpOffice\PhpSpreadsheet\Comment::class,
+ 'PHPExcel_Exception' => \PhpOffice\PhpSpreadsheet\Exception::class,
+ 'PHPExcel_HashTable' => \PhpOffice\PhpSpreadsheet\HashTable::class,
+ 'PHPExcel_IComparable' => \PhpOffice\PhpSpreadsheet\IComparable::class,
+ 'PHPExcel_IOFactory' => \PhpOffice\PhpSpreadsheet\IOFactory::class,
+ 'PHPExcel_NamedRange' => \PhpOffice\PhpSpreadsheet\NamedRange::class,
+ 'PHPExcel_ReferenceHelper' => \PhpOffice\PhpSpreadsheet\ReferenceHelper::class,
+ 'PHPExcel_RichText' => \PhpOffice\PhpSpreadsheet\RichText\RichText::class,
+ 'PHPExcel_Settings' => \PhpOffice\PhpSpreadsheet\Settings::class,
+ 'PHPExcel_Style' => \PhpOffice\PhpSpreadsheet\Style\Style::class,
+ 'PHPExcel_Worksheet' => \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet::class,
+ ];
+
+ $methods = [
+ 'MINUTEOFHOUR' => 'MINUTE',
+ 'SECONDOFMINUTE' => 'SECOND',
+ 'DAYOFWEEK' => 'WEEKDAY',
+ 'WEEKOFYEAR' => 'WEEKNUM',
+ 'ExcelToPHPObject' => 'excelToDateTimeObject',
+ 'ExcelToPHP' => 'excelToTimestamp',
+ 'FormattedPHPToExcel' => 'formattedPHPToExcel',
+ 'Cell::absoluteCoordinate' => 'Coordinate::absoluteCoordinate',
+ 'Cell::absoluteReference' => 'Coordinate::absoluteReference',
+ 'Cell::buildRange' => 'Coordinate::buildRange',
+ 'Cell::columnIndexFromString' => 'Coordinate::columnIndexFromString',
+ 'Cell::coordinateFromString' => 'Coordinate::coordinateFromString',
+ 'Cell::extractAllCellReferencesInRange' => 'Coordinate::extractAllCellReferencesInRange',
+ 'Cell::getRangeBoundaries' => 'Coordinate::getRangeBoundaries',
+ 'Cell::mergeRangesInCollection' => 'Coordinate::mergeRangesInCollection',
+ 'Cell::rangeBoundaries' => 'Coordinate::rangeBoundaries',
+ 'Cell::rangeDimension' => 'Coordinate::rangeDimension',
+ 'Cell::splitRange' => 'Coordinate::splitRange',
+ 'Cell::stringFromColumnIndex' => 'Coordinate::stringFromColumnIndex',
+ ];
+
+ // Keep '\' prefix for class names
+ $prefixedClasses = [];
+ foreach ($classes as $key => &$value) {
+ $value = str_replace('PhpOffice\\', '\\PhpOffice\\', $value);
+ $prefixedClasses['\\' . $key] = $value;
+ }
+ $mapping = $prefixedClasses + $classes + $methods;
+
+ return $mapping;
+ }
+
+ /**
+ * Search in all files in given directory.
+ *
+ * @param string $path
+ */
+ private function recursiveReplace($path)
+ {
+ $patterns = [
+ '/*.md',
+ '/*.txt',
+ '/*.TXT',
+ '/*.php',
+ '/*.phpt',
+ '/*.php3',
+ '/*.php4',
+ '/*.php5',
+ '/*.phtml',
+ ];
+
+ foreach ($patterns as $pattern) {
+ foreach (glob($path . $pattern) as $file) {
+ if (strpos($path, '/vendor/') !== false) {
+ echo $file . " skipped\n";
+
+ continue;
+ }
+ $original = file_get_contents($file);
+ $converted = $this->replace($original);
+
+ if ($original !== $converted) {
+ echo $file . " converted\n";
+ file_put_contents($file, $converted);
+ }
+ }
+ }
+
+ // Do the recursion in subdirectory
+ foreach (glob($path . '/*', GLOB_ONLYDIR) as $subpath) {
+ if (strpos($subpath, $path . '/') === 0) {
+ $this->recursiveReplace($subpath);
+ }
+ }
+ }
+
+ public function migrate()
+ {
+ $path = realpath(getcwd());
+ echo 'This will search and replace recursively in ' . $path . PHP_EOL;
+ echo 'You MUST backup your files first, or you risk losing data.' . PHP_EOL;
+ echo 'Are you sure ? (y/n)';
+
+ $confirm = fread(STDIN, 1);
+ if ($confirm === 'y') {
+ $this->recursiveReplace($path);
+ }
+ }
+
+ /**
+ * Migrate the given code from PHPExcel to PhpSpreadsheet.
+ *
+ * @param string $original
+ *
+ * @return string
+ */
+ public function replace($original)
+ {
+ $converted = str_replace($this->from, $this->to, $original);
+
+ // The string "PHPExcel" gets special treatment because of how common it might be.
+ // This regex requires a word boundary around the string, and it can't be
+ // preceded by $ or -> (goal is to filter out cases where a variable is named $PHPExcel or similar)
+ $converted = preg_replace('~(?)(\b|\\\\)PHPExcel\b~', '\\' . \PhpOffice\PhpSpreadsheet\Spreadsheet::class, $converted);
+
+ return $converted;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Sample.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Sample.php
new file mode 100644
index 00000000000..e199c807c0d
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Sample.php
@@ -0,0 +1,230 @@
+getScriptFilename() === 'index';
+ }
+
+ /**
+ * Return the page title.
+ *
+ * @return string
+ */
+ public function getPageTitle()
+ {
+ return $this->isIndex() ? 'PHPSpreadsheet' : $this->getScriptFilename();
+ }
+
+ /**
+ * Return the page heading.
+ *
+ * @return string
+ */
+ public function getPageHeading()
+ {
+ return $this->isIndex() ? '' : '' . str_replace('_', ' ', $this->getScriptFilename()) . '
';
+ }
+
+ /**
+ * Returns an array of all known samples.
+ *
+ * @return string[] [$name => $path]
+ */
+ public function getSamples()
+ {
+ // Populate samples
+ $baseDir = realpath(__DIR__ . '/../../../samples');
+ $directory = new RecursiveDirectoryIterator($baseDir);
+ $iterator = new RecursiveIteratorIterator($directory);
+ $regex = new RegexIterator($iterator, '/^.+\.php$/', RecursiveRegexIterator::GET_MATCH);
+
+ $files = [];
+ foreach ($regex as $file) {
+ $file = str_replace(str_replace('\\', '/', $baseDir) . '/', '', str_replace('\\', '/', $file[0]));
+ $info = pathinfo($file);
+ $category = str_replace('_', ' ', $info['dirname']);
+ $name = str_replace('_', ' ', preg_replace('/(|\.php)/', '', $info['filename']));
+ if (!in_array($category, ['.', 'boostrap', 'templates'])) {
+ if (!isset($files[$category])) {
+ $files[$category] = [];
+ }
+ $files[$category][$name] = $file;
+ }
+ }
+
+ // Sort everything
+ ksort($files);
+ foreach ($files as &$f) {
+ asort($f);
+ }
+
+ return $files;
+ }
+
+ /**
+ * Write documents.
+ *
+ * @param Spreadsheet $spreadsheet
+ * @param string $filename
+ * @param string[] $writers
+ */
+ public function write(Spreadsheet $spreadsheet, $filename, array $writers = ['Xlsx', 'Xls'])
+ {
+ // Set active sheet index to the first sheet, so Excel opens this as the first sheet
+ $spreadsheet->setActiveSheetIndex(0);
+
+ // Write documents
+ foreach ($writers as $writerType) {
+ $path = $this->getFilename($filename, mb_strtolower($writerType));
+ $writer = IOFactory::createWriter($spreadsheet, $writerType);
+ if ($writer instanceof Pdf) {
+ // PDF writer needs temporary directory
+ $tempDir = $this->getTemporaryFolder();
+ $writer->setTempDir($tempDir);
+ }
+ $callStartTime = microtime(true);
+ $writer->save($path);
+ $this->logWrite($writer, $path, $callStartTime);
+ }
+
+ $this->logEndingNotes();
+ }
+
+ /**
+ * Returns the temporary directory and make sure it exists.
+ *
+ * @return string
+ */
+ private function getTemporaryFolder()
+ {
+ $tempFolder = sys_get_temp_dir() . '/phpspreadsheet';
+ if (!is_dir($tempFolder)) {
+ if (!mkdir($tempFolder) && !is_dir($tempFolder)) {
+ throw new \RuntimeException(sprintf('Directory "%s" was not created', $tempFolder));
+ }
+ }
+
+ return $tempFolder;
+ }
+
+ /**
+ * Returns the filename that should be used for sample output.
+ *
+ * @param string $filename
+ * @param string $extension
+ *
+ * @return string
+ */
+ public function getFilename($filename, $extension = 'xlsx')
+ {
+ $originalExtension = pathinfo($filename, PATHINFO_EXTENSION);
+
+ return $this->getTemporaryFolder() . '/' . str_replace('.' . $originalExtension, '.' . $extension, basename($filename));
+ }
+
+ /**
+ * Return a random temporary file name.
+ *
+ * @param string $extension
+ *
+ * @return string
+ */
+ public function getTemporaryFilename($extension = 'xlsx')
+ {
+ $temporaryFilename = tempnam($this->getTemporaryFolder(), 'phpspreadsheet-');
+ unlink($temporaryFilename);
+
+ return $temporaryFilename . '.' . $extension;
+ }
+
+ public function log($message)
+ {
+ $eol = $this->isCli() ? PHP_EOL : '
';
+ echo date('H:i:s ') . $message . $eol;
+ }
+
+ /**
+ * Log ending notes.
+ */
+ public function logEndingNotes()
+ {
+ // Do not show execution time for index
+ $this->log('Peak memory usage: ' . (memory_get_peak_usage(true) / 1024 / 1024) . 'MB');
+ }
+
+ /**
+ * Log a line about the write operation.
+ *
+ * @param IWriter $writer
+ * @param string $path
+ * @param float $callStartTime
+ */
+ public function logWrite(IWriter $writer, $path, $callStartTime)
+ {
+ $callEndTime = microtime(true);
+ $callTime = $callEndTime - $callStartTime;
+ $reflection = new ReflectionClass($writer);
+ $format = $reflection->getShortName();
+ $message = "Write {$format} format to {$path} in " . sprintf('%.4f', $callTime) . ' seconds';
+
+ $this->log($message);
+ }
+
+ /**
+ * Log a line about the read operation.
+ *
+ * @param string $format
+ * @param string $path
+ * @param float $callStartTime
+ */
+ public function logRead($format, $path, $callStartTime)
+ {
+ $callEndTime = microtime(true);
+ $callTime = $callEndTime - $callStartTime;
+ $message = "Read {$format} format from {$path} in " . sprintf('%.4f', $callTime) . ' seconds';
+
+ $this->log($message);
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IComparable.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IComparable.php
new file mode 100644
index 00000000000..c215847b316
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/IComparable.php
@@ -0,0 +1,13 @@
+ Reader\Xlsx::class,
+ 'Xls' => Reader\Xls::class,
+ 'Xml' => Reader\Xml::class,
+ 'Ods' => Reader\Ods::class,
+ 'Slk' => Reader\Slk::class,
+ 'Gnumeric' => Reader\Gnumeric::class,
+ 'Html' => Reader\Html::class,
+ 'Csv' => Reader\Csv::class,
+ ];
+
+ private static $writers = [
+ 'Xls' => Writer\Xls::class,
+ 'Xlsx' => Writer\Xlsx::class,
+ 'Ods' => Writer\Ods::class,
+ 'Csv' => Writer\Csv::class,
+ 'Html' => Writer\Html::class,
+ 'Tcpdf' => Writer\Pdf\Tcpdf::class,
+ 'Dompdf' => Writer\Pdf\Dompdf::class,
+ 'Mpdf' => Writer\Pdf\Mpdf::class,
+ ];
+
+ /**
+ * Create Writer\IWriter.
+ *
+ * @param Spreadsheet $spreadsheet
+ * @param string $writerType Example: Xlsx
+ *
+ * @throws Writer\Exception
+ *
+ * @return Writer\IWriter
+ */
+ public static function createWriter(Spreadsheet $spreadsheet, $writerType)
+ {
+ if (!isset(self::$writers[$writerType])) {
+ throw new Writer\Exception("No writer found for type $writerType");
+ }
+
+ // Instantiate writer
+ $className = self::$writers[$writerType];
+ $writer = new $className($spreadsheet);
+
+ return $writer;
+ }
+
+ /**
+ * Create Reader\IReader.
+ *
+ * @param string $readerType Example: Xlsx
+ *
+ * @throws Reader\Exception
+ *
+ * @return Reader\IReader
+ */
+ public static function createReader($readerType)
+ {
+ if (!isset(self::$readers[$readerType])) {
+ throw new Reader\Exception("No reader found for type $readerType");
+ }
+
+ // Instantiate reader
+ $className = self::$readers[$readerType];
+ $reader = new $className();
+
+ return $reader;
+ }
+
+ /**
+ * Loads Spreadsheet from file using automatic Reader\IReader resolution.
+ *
+ * @param string $pFilename The name of the spreadsheet file
+ *
+ * @throws Reader\Exception
+ *
+ * @return Spreadsheet
+ */
+ public static function load($pFilename)
+ {
+ $reader = self::createReaderForFile($pFilename);
+
+ return $reader->load($pFilename);
+ }
+
+ /**
+ * Identify file type using automatic Reader\IReader resolution.
+ *
+ * @param string $pFilename The name of the spreadsheet file to identify
+ *
+ * @throws Reader\Exception
+ *
+ * @return string
+ */
+ public static function identify($pFilename)
+ {
+ $reader = self::createReaderForFile($pFilename);
+ $className = get_class($reader);
+ $classType = explode('\\', $className);
+ unset($reader);
+
+ return array_pop($classType);
+ }
+
+ /**
+ * Create Reader\IReader for file using automatic Reader\IReader resolution.
+ *
+ * @param string $filename The name of the spreadsheet file
+ *
+ * @throws Reader\Exception
+ *
+ * @return Reader\IReader
+ */
+ public static function createReaderForFile($filename)
+ {
+ File::assertFile($filename);
+
+ // First, lucky guess by inspecting file extension
+ $guessedReader = self::getReaderTypeFromExtension($filename);
+ if ($guessedReader !== null) {
+ $reader = self::createReader($guessedReader);
+
+ // Let's see if we are lucky
+ if (isset($reader) && $reader->canRead($filename)) {
+ return $reader;
+ }
+ }
+
+ // If we reach here then "lucky guess" didn't give any result
+ // Try walking through all the options in self::$autoResolveClasses
+ foreach (self::$readers as $type => $class) {
+ // Ignore our original guess, we know that won't work
+ if ($type !== $guessedReader) {
+ $reader = self::createReader($type);
+ if ($reader->canRead($filename)) {
+ return $reader;
+ }
+ }
+ }
+
+ throw new Reader\Exception('Unable to identify a reader for this file');
+ }
+
+ /**
+ * Guess a reader type from the file extension, if any.
+ *
+ * @param string $filename
+ *
+ * @return null|string
+ */
+ private static function getReaderTypeFromExtension($filename)
+ {
+ $pathinfo = pathinfo($filename);
+ if (!isset($pathinfo['extension'])) {
+ return null;
+ }
+
+ switch (strtolower($pathinfo['extension'])) {
+ case 'xlsx': // Excel (OfficeOpenXML) Spreadsheet
+ case 'xlsm': // Excel (OfficeOpenXML) Macro Spreadsheet (macros will be discarded)
+ case 'xltx': // Excel (OfficeOpenXML) Template
+ case 'xltm': // Excel (OfficeOpenXML) Macro Template (macros will be discarded)
+ return 'Xlsx';
+ case 'xls': // Excel (BIFF) Spreadsheet
+ case 'xlt': // Excel (BIFF) Template
+ return 'Xls';
+ case 'ods': // Open/Libre Offic Calc
+ case 'ots': // Open/Libre Offic Calc Template
+ return 'Ods';
+ case 'slk':
+ return 'Slk';
+ case 'xml': // Excel 2003 SpreadSheetML
+ return 'Xml';
+ case 'gnumeric':
+ return 'Gnumeric';
+ case 'htm':
+ case 'html':
+ return 'Html';
+ case 'csv':
+ // Do nothing
+ // We must not try to use CSV reader since it loads
+ // all files including Excel files etc.
+ return null;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Register a writer with its type and class name.
+ *
+ * @param string $writerType
+ * @param string $writerClass
+ */
+ public static function registerWriter($writerType, $writerClass)
+ {
+ if (!is_a($writerClass, Writer\IWriter::class, true)) {
+ throw new Writer\Exception('Registered writers must implement ' . Writer\IWriter::class);
+ }
+
+ self::$writers[$writerType] = $writerClass;
+ }
+
+ /**
+ * Register a reader with its type and class name.
+ *
+ * @param string $readerType
+ * @param string $readerClass
+ */
+ public static function registerReader($readerType, $readerClass)
+ {
+ if (!is_a($readerClass, Reader\IReader::class, true)) {
+ throw new Reader\Exception('Registered readers must implement ' . Reader\IReader::class);
+ }
+
+ self::$readers[$readerType] = $readerClass;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/NamedRange.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/NamedRange.php
new file mode 100644
index 00000000000..1f94d5a4ed2
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/NamedRange.php
@@ -0,0 +1,240 @@
+worksheet).
+ *
+ * @var bool
+ */
+ private $localOnly;
+
+ /**
+ * Scope.
+ *
+ * @var Worksheet
+ */
+ private $scope;
+
+ /**
+ * Create a new NamedRange.
+ *
+ * @param string $pName
+ * @param Worksheet $pWorksheet
+ * @param string $pRange
+ * @param bool $pLocalOnly
+ * @param null|Worksheet $pScope Scope. Only applies when $pLocalOnly = true. Null for global scope.
+ *
+ * @throws Exception
+ */
+ public function __construct($pName, Worksheet $pWorksheet, $pRange = 'A1', $pLocalOnly = false, $pScope = null)
+ {
+ // Validate data
+ if (($pName === null) || ($pWorksheet === null) || ($pRange === null)) {
+ throw new Exception('Parameters can not be null.');
+ }
+
+ // Set local members
+ $this->name = $pName;
+ $this->worksheet = $pWorksheet;
+ $this->range = $pRange;
+ $this->localOnly = $pLocalOnly;
+ $this->scope = ($pLocalOnly == true) ? (($pScope == null) ? $pWorksheet : $pScope) : null;
+ }
+
+ /**
+ * Get name.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ return $this->name;
+ }
+
+ /**
+ * Set name.
+ *
+ * @param string $value
+ *
+ * @return NamedRange
+ */
+ public function setName($value)
+ {
+ if ($value !== null) {
+ // Old title
+ $oldTitle = $this->name;
+
+ // Re-attach
+ if ($this->worksheet !== null) {
+ $this->worksheet->getParent()->removeNamedRange($this->name, $this->worksheet);
+ }
+ $this->name = $value;
+
+ if ($this->worksheet !== null) {
+ $this->worksheet->getParent()->addNamedRange($this);
+ }
+
+ // New title
+ $newTitle = $this->name;
+ ReferenceHelper::getInstance()->updateNamedFormulas($this->worksheet->getParent(), $oldTitle, $newTitle);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get worksheet.
+ *
+ * @return Worksheet
+ */
+ public function getWorksheet()
+ {
+ return $this->worksheet;
+ }
+
+ /**
+ * Set worksheet.
+ *
+ * @param Worksheet $value
+ *
+ * @return NamedRange
+ */
+ public function setWorksheet(Worksheet $value = null)
+ {
+ if ($value !== null) {
+ $this->worksheet = $value;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get range.
+ *
+ * @return string
+ */
+ public function getRange()
+ {
+ return $this->range;
+ }
+
+ /**
+ * Set range.
+ *
+ * @param string $value
+ *
+ * @return NamedRange
+ */
+ public function setRange($value)
+ {
+ if ($value !== null) {
+ $this->range = $value;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get localOnly.
+ *
+ * @return bool
+ */
+ public function getLocalOnly()
+ {
+ return $this->localOnly;
+ }
+
+ /**
+ * Set localOnly.
+ *
+ * @param bool $value
+ *
+ * @return NamedRange
+ */
+ public function setLocalOnly($value)
+ {
+ $this->localOnly = $value;
+ $this->scope = $value ? $this->worksheet : null;
+
+ return $this;
+ }
+
+ /**
+ * Get scope.
+ *
+ * @return null|Worksheet
+ */
+ public function getScope()
+ {
+ return $this->scope;
+ }
+
+ /**
+ * Set scope.
+ *
+ * @param null|Worksheet $value
+ *
+ * @return NamedRange
+ */
+ public function setScope(Worksheet $value = null)
+ {
+ $this->scope = $value;
+ $this->localOnly = $value != null;
+
+ return $this;
+ }
+
+ /**
+ * Resolve a named range to a regular cell range.
+ *
+ * @param string $pNamedRange Named range
+ * @param null|Worksheet $pSheet Scope. Use null for global scope
+ *
+ * @return NamedRange
+ */
+ public static function resolveRange($pNamedRange, Worksheet $pSheet)
+ {
+ return $pSheet->getParent()->getNamedRange($pNamedRange, $pSheet);
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php
new file mode 100644
index 00000000000..c191c3f8d8e
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/BaseReader.php
@@ -0,0 +1,239 @@
+readDataOnly;
+ }
+
+ /**
+ * Set read data only
+ * Set to true, to advise the Reader only to read data values for cells, and to ignore any formatting information.
+ * Set to false (the default) to advise the Reader to read both data and formatting for cells.
+ *
+ * @param bool $pValue
+ *
+ * @return IReader
+ */
+ public function setReadDataOnly($pValue)
+ {
+ $this->readDataOnly = (bool) $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Read empty cells?
+ * If this is true (the default), then the Reader will read data values for all cells, irrespective of value.
+ * If false it will not read data for cells containing a null value or an empty string.
+ *
+ * @return bool
+ */
+ public function getReadEmptyCells()
+ {
+ return $this->readEmptyCells;
+ }
+
+ /**
+ * Set read empty cells
+ * Set to true (the default) to advise the Reader read data values for all cells, irrespective of value.
+ * Set to false to advise the Reader to ignore cells containing a null value or an empty string.
+ *
+ * @param bool $pValue
+ *
+ * @return IReader
+ */
+ public function setReadEmptyCells($pValue)
+ {
+ $this->readEmptyCells = (bool) $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Read charts in workbook?
+ * If this is true, then the Reader will include any charts that exist in the workbook.
+ * Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value.
+ * If false (the default) it will ignore any charts defined in the workbook file.
+ *
+ * @return bool
+ */
+ public function getIncludeCharts()
+ {
+ return $this->includeCharts;
+ }
+
+ /**
+ * Set read charts in workbook
+ * Set to true, to advise the Reader to include any charts that exist in the workbook.
+ * Note that a ReadDataOnly value of false overrides, and charts won't be read regardless of the IncludeCharts value.
+ * Set to false (the default) to discard charts.
+ *
+ * @param bool $pValue
+ *
+ * @return IReader
+ */
+ public function setIncludeCharts($pValue)
+ {
+ $this->includeCharts = (bool) $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get which sheets to load
+ * Returns either an array of worksheet names (the list of worksheets that should be loaded), or a null
+ * indicating that all worksheets in the workbook should be loaded.
+ *
+ * @return mixed
+ */
+ public function getLoadSheetsOnly()
+ {
+ return $this->loadSheetsOnly;
+ }
+
+ /**
+ * Set which sheets to load.
+ *
+ * @param mixed $value
+ * This should be either an array of worksheet names to be loaded, or a string containing a single worksheet name.
+ * If NULL, then it tells the Reader to read all worksheets in the workbook
+ *
+ * @return IReader
+ */
+ public function setLoadSheetsOnly($value)
+ {
+ if ($value === null) {
+ return $this->setLoadAllSheets();
+ }
+
+ $this->loadSheetsOnly = is_array($value) ? $value : [$value];
+
+ return $this;
+ }
+
+ /**
+ * Set all sheets to load
+ * Tells the Reader to load all worksheets from the workbook.
+ *
+ * @return IReader
+ */
+ public function setLoadAllSheets()
+ {
+ $this->loadSheetsOnly = null;
+
+ return $this;
+ }
+
+ /**
+ * Read filter.
+ *
+ * @return IReadFilter
+ */
+ public function getReadFilter()
+ {
+ return $this->readFilter;
+ }
+
+ /**
+ * Set read filter.
+ *
+ * @param IReadFilter $pValue
+ *
+ * @return IReader
+ */
+ public function setReadFilter(IReadFilter $pValue)
+ {
+ $this->readFilter = $pValue;
+
+ return $this;
+ }
+
+ public function getSecuritySCanner()
+ {
+ if (property_exists($this, 'securityScanner')) {
+ return $this->securityScanner;
+ }
+
+ return null;
+ }
+
+ /**
+ * Open file for reading.
+ *
+ * @param string $pFilename
+ *
+ * @throws Exception
+ */
+ protected function openFile($pFilename)
+ {
+ File::assertFile($pFilename);
+
+ // Open file
+ $this->fileHandle = fopen($pFilename, 'r');
+ if ($this->fileHandle === false) {
+ throw new Exception('Could not open file ' . $pFilename . ' for reading.');
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php
new file mode 100644
index 00000000000..9e6bccf74c1
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Csv.php
@@ -0,0 +1,562 @@
+readFilter = new DefaultReadFilter();
+ }
+
+ /**
+ * Set input encoding.
+ *
+ * @param string $pValue Input encoding, eg: 'UTF-8'
+ *
+ * @return Csv
+ */
+ public function setInputEncoding($pValue)
+ {
+ $this->inputEncoding = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get input encoding.
+ *
+ * @return string
+ */
+ public function getInputEncoding()
+ {
+ return $this->inputEncoding;
+ }
+
+ /**
+ * Move filepointer past any BOM marker.
+ */
+ protected function skipBOM()
+ {
+ rewind($this->fileHandle);
+
+ switch ($this->inputEncoding) {
+ case 'UTF-8':
+ fgets($this->fileHandle, 4) == "\xEF\xBB\xBF" ?
+ fseek($this->fileHandle, 3) : fseek($this->fileHandle, 0);
+
+ break;
+ case 'UTF-16LE':
+ fgets($this->fileHandle, 3) == "\xFF\xFE" ?
+ fseek($this->fileHandle, 2) : fseek($this->fileHandle, 0);
+
+ break;
+ case 'UTF-16BE':
+ fgets($this->fileHandle, 3) == "\xFE\xFF" ?
+ fseek($this->fileHandle, 2) : fseek($this->fileHandle, 0);
+
+ break;
+ case 'UTF-32LE':
+ fgets($this->fileHandle, 5) == "\xFF\xFE\x00\x00" ?
+ fseek($this->fileHandle, 4) : fseek($this->fileHandle, 0);
+
+ break;
+ case 'UTF-32BE':
+ fgets($this->fileHandle, 5) == "\x00\x00\xFE\xFF" ?
+ fseek($this->fileHandle, 4) : fseek($this->fileHandle, 0);
+
+ break;
+ default:
+ break;
+ }
+ }
+
+ /**
+ * Identify any separator that is explicitly set in the file.
+ */
+ protected function checkSeparator()
+ {
+ $line = fgets($this->fileHandle);
+ if ($line === false) {
+ return;
+ }
+
+ if ((strlen(trim($line, "\r\n")) == 5) && (stripos($line, 'sep=') === 0)) {
+ $this->delimiter = substr($line, 4, 1);
+
+ return;
+ }
+
+ return $this->skipBOM();
+ }
+
+ /**
+ * Infer the separator if it isn't explicitly set in the file or specified by the user.
+ */
+ protected function inferSeparator()
+ {
+ if ($this->delimiter !== null) {
+ return;
+ }
+
+ $potentialDelimiters = [',', ';', "\t", '|', ':', ' ', '~'];
+ $counts = [];
+ foreach ($potentialDelimiters as $delimiter) {
+ $counts[$delimiter] = [];
+ }
+
+ // Count how many times each of the potential delimiters appears in each line
+ $numberLines = 0;
+ while (($line = $this->getNextLine()) !== false && (++$numberLines < 1000)) {
+ $countLine = [];
+ for ($i = strlen($line) - 1; $i >= 0; --$i) {
+ $char = $line[$i];
+ if (isset($counts[$char])) {
+ if (!isset($countLine[$char])) {
+ $countLine[$char] = 0;
+ }
+ ++$countLine[$char];
+ }
+ }
+ foreach ($potentialDelimiters as $delimiter) {
+ $counts[$delimiter][] = isset($countLine[$delimiter])
+ ? $countLine[$delimiter]
+ : 0;
+ }
+ }
+
+ // If number of lines is 0, nothing to infer : fall back to the default
+ if ($numberLines === 0) {
+ $this->delimiter = reset($potentialDelimiters);
+
+ return $this->skipBOM();
+ }
+
+ // Calculate the mean square deviations for each delimiter (ignoring delimiters that haven't been found consistently)
+ $meanSquareDeviations = [];
+ $middleIdx = floor(($numberLines - 1) / 2);
+
+ foreach ($potentialDelimiters as $delimiter) {
+ $series = $counts[$delimiter];
+ sort($series);
+
+ $median = ($numberLines % 2)
+ ? $series[$middleIdx]
+ : ($series[$middleIdx] + $series[$middleIdx + 1]) / 2;
+
+ if ($median === 0) {
+ continue;
+ }
+
+ $meanSquareDeviations[$delimiter] = array_reduce(
+ $series,
+ function ($sum, $value) use ($median) {
+ return $sum + pow($value - $median, 2);
+ }
+ ) / count($series);
+ }
+
+ // ... and pick the delimiter with the smallest mean square deviation (in case of ties, the order in potentialDelimiters is respected)
+ $min = INF;
+ foreach ($potentialDelimiters as $delimiter) {
+ if (!isset($meanSquareDeviations[$delimiter])) {
+ continue;
+ }
+
+ if ($meanSquareDeviations[$delimiter] < $min) {
+ $min = $meanSquareDeviations[$delimiter];
+ $this->delimiter = $delimiter;
+ }
+ }
+
+ // If no delimiter could be detected, fall back to the default
+ if ($this->delimiter === null) {
+ $this->delimiter = reset($potentialDelimiters);
+ }
+
+ return $this->skipBOM();
+ }
+
+ /**
+ * Get the next full line from the file.
+ *
+ * @param string $line
+ *
+ * @return bool|string
+ */
+ private function getNextLine($line = '')
+ {
+ // Get the next line in the file
+ $newLine = fgets($this->fileHandle);
+
+ // Return false if there is no next line
+ if ($newLine === false) {
+ return false;
+ }
+
+ // Add the new line to the line passed in
+ $line = $line . $newLine;
+
+ // Drop everything that is enclosed to avoid counting false positives in enclosures
+ $enclosure = '(?escapeCharacter, '/') . ')'
+ . preg_quote($this->enclosure, '/');
+ $line = preg_replace('/(' . $enclosure . '.*' . $enclosure . ')/Us', '', $line);
+
+ // See if we have any enclosures left in the line
+ // if we still have an enclosure then we need to read the next line as well
+ if (preg_match('/(' . $enclosure . ')/', $line) > 0) {
+ $line = $this->getNextLine($line);
+ }
+
+ return $line;
+ }
+
+ /**
+ * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
+ *
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return array
+ */
+ public function listWorksheetInfo($pFilename)
+ {
+ // Open file
+ if (!$this->canRead($pFilename)) {
+ throw new Exception($pFilename . ' is an Invalid Spreadsheet file.');
+ }
+ $this->openFile($pFilename);
+ $fileHandle = $this->fileHandle;
+
+ // Skip BOM, if any
+ $this->skipBOM();
+ $this->checkSeparator();
+ $this->inferSeparator();
+
+ $worksheetInfo = [];
+ $worksheetInfo[0]['worksheetName'] = 'Worksheet';
+ $worksheetInfo[0]['lastColumnLetter'] = 'A';
+ $worksheetInfo[0]['lastColumnIndex'] = 0;
+ $worksheetInfo[0]['totalRows'] = 0;
+ $worksheetInfo[0]['totalColumns'] = 0;
+
+ // Loop through each line of the file in turn
+ while (($rowData = fgetcsv($fileHandle, 0, $this->delimiter, $this->enclosure, $this->escapeCharacter)) !== false) {
+ ++$worksheetInfo[0]['totalRows'];
+ $worksheetInfo[0]['lastColumnIndex'] = max($worksheetInfo[0]['lastColumnIndex'], count($rowData) - 1);
+ }
+
+ $worksheetInfo[0]['lastColumnLetter'] = Coordinate::stringFromColumnIndex($worksheetInfo[0]['lastColumnIndex'] + 1);
+ $worksheetInfo[0]['totalColumns'] = $worksheetInfo[0]['lastColumnIndex'] + 1;
+
+ // Close file
+ fclose($fileHandle);
+
+ return $worksheetInfo;
+ }
+
+ /**
+ * Loads Spreadsheet from file.
+ *
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return Spreadsheet
+ */
+ public function load($pFilename)
+ {
+ // Create new Spreadsheet
+ $spreadsheet = new Spreadsheet();
+
+ // Load into this instance
+ return $this->loadIntoExisting($pFilename, $spreadsheet);
+ }
+
+ /**
+ * Loads PhpSpreadsheet from file into PhpSpreadsheet instance.
+ *
+ * @param string $pFilename
+ * @param Spreadsheet $spreadsheet
+ *
+ * @throws Exception
+ *
+ * @return Spreadsheet
+ */
+ public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet)
+ {
+ $lineEnding = ini_get('auto_detect_line_endings');
+ ini_set('auto_detect_line_endings', true);
+
+ // Open file
+ if (!$this->canRead($pFilename)) {
+ throw new Exception($pFilename . ' is an Invalid Spreadsheet file.');
+ }
+ $this->openFile($pFilename);
+ $fileHandle = $this->fileHandle;
+
+ // Skip BOM, if any
+ $this->skipBOM();
+ $this->checkSeparator();
+ $this->inferSeparator();
+
+ // Create new PhpSpreadsheet object
+ while ($spreadsheet->getSheetCount() <= $this->sheetIndex) {
+ $spreadsheet->createSheet();
+ }
+ $sheet = $spreadsheet->setActiveSheetIndex($this->sheetIndex);
+
+ // Set our starting row based on whether we're in contiguous mode or not
+ $currentRow = 1;
+ if ($this->contiguous) {
+ $currentRow = ($this->contiguousRow == -1) ? $sheet->getHighestRow() : $this->contiguousRow;
+ }
+
+ // Loop through each line of the file in turn
+ while (($rowData = fgetcsv($fileHandle, 0, $this->delimiter, $this->enclosure, $this->escapeCharacter)) !== false) {
+ $columnLetter = 'A';
+ foreach ($rowData as $rowDatum) {
+ if ($rowDatum != '' && $this->readFilter->readCell($columnLetter, $currentRow)) {
+ // Convert encoding if necessary
+ if ($this->inputEncoding !== 'UTF-8') {
+ $rowDatum = StringHelper::convertEncoding($rowDatum, 'UTF-8', $this->inputEncoding);
+ }
+
+ // Set cell value
+ $sheet->getCell($columnLetter . $currentRow)->setValue($rowDatum);
+ }
+ ++$columnLetter;
+ }
+ ++$currentRow;
+ }
+
+ // Close file
+ fclose($fileHandle);
+
+ if ($this->contiguous) {
+ $this->contiguousRow = $currentRow;
+ }
+
+ ini_set('auto_detect_line_endings', $lineEnding);
+
+ // Return
+ return $spreadsheet;
+ }
+
+ /**
+ * Get delimiter.
+ *
+ * @return string
+ */
+ public function getDelimiter()
+ {
+ return $this->delimiter;
+ }
+
+ /**
+ * Set delimiter.
+ *
+ * @param string $delimiter Delimiter, eg: ','
+ *
+ * @return CSV
+ */
+ public function setDelimiter($delimiter)
+ {
+ $this->delimiter = $delimiter;
+
+ return $this;
+ }
+
+ /**
+ * Get enclosure.
+ *
+ * @return string
+ */
+ public function getEnclosure()
+ {
+ return $this->enclosure;
+ }
+
+ /**
+ * Set enclosure.
+ *
+ * @param string $enclosure Enclosure, defaults to "
+ *
+ * @return CSV
+ */
+ public function setEnclosure($enclosure)
+ {
+ if ($enclosure == '') {
+ $enclosure = '"';
+ }
+ $this->enclosure = $enclosure;
+
+ return $this;
+ }
+
+ /**
+ * Get sheet index.
+ *
+ * @return int
+ */
+ public function getSheetIndex()
+ {
+ return $this->sheetIndex;
+ }
+
+ /**
+ * Set sheet index.
+ *
+ * @param int $pValue Sheet index
+ *
+ * @return CSV
+ */
+ public function setSheetIndex($pValue)
+ {
+ $this->sheetIndex = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Set Contiguous.
+ *
+ * @param bool $contiguous
+ *
+ * @return Csv
+ */
+ public function setContiguous($contiguous)
+ {
+ $this->contiguous = (bool) $contiguous;
+ if (!$contiguous) {
+ $this->contiguousRow = -1;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Contiguous.
+ *
+ * @return bool
+ */
+ public function getContiguous()
+ {
+ return $this->contiguous;
+ }
+
+ /**
+ * Set escape backslashes.
+ *
+ * @param string $escapeCharacter
+ *
+ * @return $this
+ */
+ public function setEscapeCharacter($escapeCharacter)
+ {
+ $this->escapeCharacter = $escapeCharacter;
+
+ return $this;
+ }
+
+ /**
+ * Get escape backslashes.
+ *
+ * @return string
+ */
+ public function getEscapeCharacter()
+ {
+ return $this->escapeCharacter;
+ }
+
+ /**
+ * Can the current IReader read the file?
+ *
+ * @param string $pFilename
+ *
+ * @return bool
+ */
+ public function canRead($pFilename)
+ {
+ // Check if file exists
+ try {
+ $this->openFile($pFilename);
+ } catch (Exception $e) {
+ return false;
+ }
+
+ fclose($this->fileHandle);
+
+ // Trust file extension if any
+ if (strtolower(pathinfo($pFilename, PATHINFO_EXTENSION)) === 'csv') {
+ return true;
+ }
+
+ // Attempt to guess mimetype
+ $type = mime_content_type($pFilename);
+ $supportedTypes = [
+ 'text/csv',
+ 'text/plain',
+ 'inode/x-empty',
+ ];
+
+ return in_array($type, $supportedTypes, true);
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/DefaultReadFilter.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/DefaultReadFilter.php
new file mode 100644
index 00000000000..e104186abbb
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/DefaultReadFilter.php
@@ -0,0 +1,20 @@
+readFilter = new PHPExcel_Reader_DefaultReadFilter();
- $this->referenceHelper = PHPExcel_ReferenceHelper::getInstance();
+ $this->readFilter = new DefaultReadFilter();
+ $this->referenceHelper = ReferenceHelper::getInstance();
+ $this->securityScanner = XmlScanner::getInstance($this);
}
/**
- * Can the current PHPExcel_Reader_IReader read the file?
+ * Can the current IReader read the file?
*
- * @param string $pFilename
- * @return boolean
- * @throws PHPExcel_Reader_Exception
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return bool
*/
public function canRead($pFilename)
{
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
+ File::assertFile($pFilename);
// Check if gzlib functions are available
if (!function_exists('gzread')) {
- throw new PHPExcel_Reader_Exception("gzlib library is not enabled");
+ throw new Exception('gzlib library is not enabled');
}
// Read signature data (first 3 bytes)
@@ -85,34 +64,28 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$data = fread($fh, 2);
fclose($fh);
- if ($data != chr(0x1F).chr(0x8B)) {
- return false;
- }
-
- return true;
+ return $data == chr(0x1F) . chr(0x8B);
}
/**
- * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object
+ * Reads names of the worksheets from a file, without parsing the whole file to a Spreadsheet object.
*
- * @param string $pFilename
- * @throws PHPExcel_Reader_Exception
+ * @param string $pFilename
+ *
+ * @return array
*/
public function listWorksheetNames($pFilename)
{
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
+ File::assertFile($pFilename);
$xml = new XMLReader();
- $xml->xml($this->securityScanFile('compress.zlib://'.realpath($pFilename)), null, PHPExcel_Settings::getLibXmlLoaderOptions());
+ $xml->xml($this->securityScanner->scanFile('compress.zlib://' . realpath($pFilename)), null, Settings::getLibXmlLoaderOptions());
$xml->setParserProperty(2, true);
- $worksheetNames = array();
+ $worksheetNames = [];
while ($xml->read()) {
if ($xml->name == 'gnm:SheetName' && $xml->nodeType == XMLReader::ELEMENT) {
- $xml->read(); // Move onto the value node
+ $xml->read(); // Move onto the value node
$worksheetNames[] = (string) $xml->value;
} elseif ($xml->name == 'gnm:Sheets') {
// break out of the loop once we've got our sheet names rather than parse the entire file
@@ -124,48 +97,47 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
}
/**
- * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)
+ * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
*
- * @param string $pFilename
- * @throws PHPExcel_Reader_Exception
+ * @param string $pFilename
+ *
+ * @return array
*/
public function listWorksheetInfo($pFilename)
{
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
+ File::assertFile($pFilename);
$xml = new XMLReader();
- $xml->xml($this->securityScanFile('compress.zlib://'.realpath($pFilename)), null, PHPExcel_Settings::getLibXmlLoaderOptions());
+ $xml->xml($this->securityScanner->scanFile('compress.zlib://' . realpath($pFilename)), null, Settings::getLibXmlLoaderOptions());
$xml->setParserProperty(2, true);
- $worksheetInfo = array();
+ $worksheetInfo = [];
while ($xml->read()) {
if ($xml->name == 'gnm:Sheet' && $xml->nodeType == XMLReader::ELEMENT) {
- $tmpInfo = array(
+ $tmpInfo = [
'worksheetName' => '',
'lastColumnLetter' => 'A',
'lastColumnIndex' => 0,
'totalRows' => 0,
'totalColumns' => 0,
- );
+ ];
while ($xml->read()) {
if ($xml->name == 'gnm:Name' && $xml->nodeType == XMLReader::ELEMENT) {
- $xml->read(); // Move onto the value node
+ $xml->read(); // Move onto the value node
$tmpInfo['worksheetName'] = (string) $xml->value;
} elseif ($xml->name == 'gnm:MaxCol' && $xml->nodeType == XMLReader::ELEMENT) {
- $xml->read(); // Move onto the value node
+ $xml->read(); // Move onto the value node
$tmpInfo['lastColumnIndex'] = (int) $xml->value;
$tmpInfo['totalColumns'] = (int) $xml->value + 1;
} elseif ($xml->name == 'gnm:MaxRow' && $xml->nodeType == XMLReader::ELEMENT) {
- $xml->read(); // Move onto the value node
+ $xml->read(); // Move onto the value node
$tmpInfo['totalRows'] = (int) $xml->value + 1;
+
break;
}
}
- $tmpInfo['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
+ $tmpInfo['lastColumnLetter'] = Coordinate::stringFromColumnIndex($tmpInfo['lastColumnIndex'] + 1);
$worksheetInfo[] = $tmpInfo;
}
}
@@ -173,67 +145,65 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
return $worksheetInfo;
}
+ /**
+ * @param string $filename
+ *
+ * @return string
+ */
private function gzfileGetContents($filename)
{
$file = @gzopen($filename, 'rb');
+ $data = '';
if ($file !== false) {
- $data = '';
while (!gzeof($file)) {
$data .= gzread($file, 1024);
}
gzclose($file);
}
+
return $data;
}
/**
- * Loads PHPExcel from file
+ * Loads Spreadsheet from file.
*
- * @param string $pFilename
- * @return PHPExcel
- * @throws PHPExcel_Reader_Exception
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return Spreadsheet
*/
public function load($pFilename)
{
- // Create new PHPExcel
- $objPHPExcel = new PHPExcel();
+ // Create new Spreadsheet
+ $spreadsheet = new Spreadsheet();
// Load into this instance
- return $this->loadIntoExisting($pFilename, $objPHPExcel);
+ return $this->loadIntoExisting($pFilename, $spreadsheet);
}
/**
- * Loads PHPExcel from file into PHPExcel instance
+ * Loads from file into Spreadsheet instance.
*
- * @param string $pFilename
- * @param PHPExcel $objPHPExcel
- * @return PHPExcel
- * @throws PHPExcel_Reader_Exception
+ * @param string $pFilename
+ * @param Spreadsheet $spreadsheet
+ *
+ * @throws Exception
+ *
+ * @return Spreadsheet
*/
- public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
+ public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet)
{
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
-
- $timezoneObj = new DateTimeZone('Europe/London');
- $GMT = new DateTimeZone('UTC');
+ File::assertFile($pFilename);
$gFileData = $this->gzfileGetContents($pFilename);
-// echo '';
-// echo htmlentities($gFileData,ENT_QUOTES,'UTF-8');
-// echo '
';
-//
- $xml = simplexml_load_string($this->securityScan($gFileData), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
+ $xml = simplexml_load_string($this->securityScanner->scan($gFileData), 'SimpleXMLElement', Settings::getLibXmlLoaderOptions());
$namespacesMeta = $xml->getNamespaces(true);
-// var_dump($namespacesMeta);
-//
$gnmXML = $xml->children($namespacesMeta['gnm']);
- $docProps = $objPHPExcel->getProperties();
+ $docProps = $spreadsheet->getProperties();
// Document Properties are held differently, depending on the version of Gnumeric
if (isset($namespacesMeta['office'])) {
$officeXML = $xml->children($namespacesMeta['office']);
@@ -241,7 +211,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$officeDocMetaXML = $officeDocXML->meta;
foreach ($officeDocMetaXML as $officePropertyData) {
- $officePropertyDC = array();
+ $officePropertyDC = [];
if (isset($namespacesMeta['dc'])) {
$officePropertyDC = $officePropertyData->children($namespacesMeta['dc']);
}
@@ -250,25 +220,30 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
switch ($propertyName) {
case 'title':
$docProps->setTitle(trim($propertyValue));
+
break;
case 'subject':
$docProps->setSubject(trim($propertyValue));
+
break;
case 'creator':
$docProps->setCreator(trim($propertyValue));
$docProps->setLastModifiedBy(trim($propertyValue));
+
break;
case 'date':
$creationDate = strtotime(trim($propertyValue));
$docProps->setCreated($creationDate);
$docProps->setModified($creationDate);
+
break;
case 'description':
$docProps->setDescription(trim($propertyValue));
+
break;
}
}
- $officePropertyMeta = array();
+ $officePropertyMeta = [];
if (isset($namespacesMeta['meta'])) {
$officePropertyMeta = $officePropertyData->children($namespacesMeta['meta']);
}
@@ -278,29 +253,36 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
switch ($propertyName) {
case 'keyword':
$docProps->setKeywords(trim($propertyValue));
+
break;
case 'initial-creator':
$docProps->setCreator(trim($propertyValue));
$docProps->setLastModifiedBy(trim($propertyValue));
+
break;
case 'creation-date':
$creationDate = strtotime(trim($propertyValue));
$docProps->setCreated($creationDate);
$docProps->setModified($creationDate);
+
break;
case 'user-defined':
list(, $attrName) = explode(':', $attributes['name']);
switch ($attrName) {
case 'publisher':
$docProps->setCompany(trim($propertyValue));
+
break;
case 'category':
$docProps->setCategory(trim($propertyValue));
+
break;
case 'manager':
$docProps->setManager(trim($propertyValue));
+
break;
}
+
break;
}
}
@@ -312,25 +294,32 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
switch ($propertyName) {
case 'title':
$docProps->setTitle(trim($propertyValue));
+
break;
case 'comments':
$docProps->setDescription(trim($propertyValue));
+
break;
case 'keywords':
$docProps->setKeywords(trim($propertyValue));
+
break;
case 'category':
$docProps->setCategory(trim($propertyValue));
+
break;
case 'manager':
$docProps->setManager(trim($propertyValue));
+
break;
case 'author':
$docProps->setCreator(trim($propertyValue));
$docProps->setLastModifiedBy(trim($propertyValue));
+
break;
case 'company':
$docProps->setCompany(trim($propertyValue));
+
break;
}
}
@@ -339,7 +328,6 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$worksheetID = 0;
foreach ($gnmXML->Sheets->Sheet as $sheet) {
$worksheetName = (string) $sheet->Name;
-// echo 'Worksheet: ', $worksheetName,'
';
if ((isset($this->loadSheetsOnly)) && (!in_array($worksheetName, $this->loadSheetsOnly))) {
continue;
}
@@ -347,41 +335,48 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$maxRow = $maxCol = 0;
// Create new Worksheet
- $objPHPExcel->createSheet();
- $objPHPExcel->setActiveSheetIndex($worksheetID);
+ $spreadsheet->createSheet();
+ $spreadsheet->setActiveSheetIndex($worksheetID);
// Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in formula
// cells... during the load, all formulae should be correct, and we're simply bringing the worksheet
// name in line with the formula, not the reverse
- $objPHPExcel->getActiveSheet()->setTitle($worksheetName, false);
+ $spreadsheet->getActiveSheet()->setTitle($worksheetName, false, false);
if ((!$this->readDataOnly) && (isset($sheet->PrintInformation))) {
if (isset($sheet->PrintInformation->Margins)) {
foreach ($sheet->PrintInformation->Margins->children('gnm', true) as $key => $margin) {
$marginAttributes = $margin->attributes();
- $marginSize = 72 / 100; // Default
+ $marginSize = 72 / 100; // Default
switch ($marginAttributes['PrefUnit']) {
case 'mm':
- $marginSize = intval($marginAttributes['Points']) / 100;
+ $marginSize = (int) ($marginAttributes['Points']) / 100;
+
break;
}
switch ($key) {
case 'top':
- $objPHPExcel->getActiveSheet()->getPageMargins()->setTop($marginSize);
+ $spreadsheet->getActiveSheet()->getPageMargins()->setTop($marginSize);
+
break;
case 'bottom':
- $objPHPExcel->getActiveSheet()->getPageMargins()->setBottom($marginSize);
+ $spreadsheet->getActiveSheet()->getPageMargins()->setBottom($marginSize);
+
break;
case 'left':
- $objPHPExcel->getActiveSheet()->getPageMargins()->setLeft($marginSize);
+ $spreadsheet->getActiveSheet()->getPageMargins()->setLeft($marginSize);
+
break;
case 'right':
- $objPHPExcel->getActiveSheet()->getPageMargins()->setRight($marginSize);
+ $spreadsheet->getActiveSheet()->getPageMargins()->setRight($marginSize);
+
break;
case 'header':
- $objPHPExcel->getActiveSheet()->getPageMargins()->setHeader($marginSize);
+ $spreadsheet->getActiveSheet()->getPageMargins()->setHeader($marginSize);
+
break;
case 'footer':
- $objPHPExcel->getActiveSheet()->getPageMargins()->setFooter($marginSize);
+ $spreadsheet->getActiveSheet()->getPageMargins()->setFooter($marginSize);
+
break;
}
}
@@ -400,7 +395,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$maxCol = $column;
}
- $column = PHPExcel_Cell::stringFromColumnIndex($column);
+ $column = Coordinate::stringFromColumnIndex($column + 1);
// Read cell?
if ($this->getReadFilter() !== null) {
@@ -411,18 +406,14 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$ValueType = $cellAttributes->ValueType;
$ExprID = (string) $cellAttributes->ExprID;
-// echo 'Cell ', $column, $row,'
';
-// echo 'Type is ', $ValueType,'
';
-// echo 'Value is ', $cell,'
';
- $type = PHPExcel_Cell_DataType::TYPE_FORMULA;
+ $type = DataType::TYPE_FORMULA;
if ($ExprID > '') {
if (((string) $cell) > '') {
- $this->expressions[$ExprID] = array(
- 'column' => $cellAttributes->Col,
- 'row' => $cellAttributes->Row,
- 'formula' => (string) $cell
- );
-// echo 'NEW EXPRESSION ', $ExprID,'
';
+ $this->expressions[$ExprID] = [
+ 'column' => $cellAttributes->Col,
+ 'row' => $cellAttributes->Row,
+ 'formula' => (string) $cell,
+ ];
} else {
$expression = $this->expressions[$ExprID];
@@ -433,36 +424,40 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$cellAttributes->Row - $expression['row'],
$worksheetName
);
-// echo 'SHARED EXPRESSION ', $ExprID,'
';
-// echo 'New Value is ', $cell,'
';
}
- $type = PHPExcel_Cell_DataType::TYPE_FORMULA;
+ $type = DataType::TYPE_FORMULA;
} else {
switch ($ValueType) {
case '10': // NULL
- $type = PHPExcel_Cell_DataType::TYPE_NULL;
+ $type = DataType::TYPE_NULL;
+
break;
case '20': // Boolean
- $type = PHPExcel_Cell_DataType::TYPE_BOOL;
- $cell = ($cell == 'TRUE') ? true: false;
+ $type = DataType::TYPE_BOOL;
+ $cell = $cell == 'TRUE';
+
break;
case '30': // Integer
- $cell = intval($cell);
+ $cell = (int) $cell;
// Excel 2007+ doesn't differentiate between integer and float, so set the value and dropthru to the next (numeric) case
+ // no break
case '40': // Float
- $type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
+ $type = DataType::TYPE_NUMERIC;
+
break;
case '50': // Error
- $type = PHPExcel_Cell_DataType::TYPE_ERROR;
+ $type = DataType::TYPE_ERROR;
+
break;
case '60': // String
- $type = PHPExcel_Cell_DataType::TYPE_STRING;
+ $type = DataType::TYPE_STRING;
+
break;
case '70': // Cell Range
case '80': // Array
}
}
- $objPHPExcel->getActiveSheet()->getCell($column.$row)->setValueExplicit($cell, $type);
+ $spreadsheet->getActiveSheet()->getCell($column . $row)->setValueExplicit($cell, $type);
}
if ((!$this->readDataOnly) && (isset($sheet->Objects))) {
@@ -470,181 +465,211 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$commentAttributes = $comment->attributes();
// Only comment objects are handled at the moment
if ($commentAttributes->Text) {
- $objPHPExcel->getActiveSheet()->getComment((string)$commentAttributes->ObjectBound)->setAuthor((string)$commentAttributes->Author)->setText($this->parseRichText((string)$commentAttributes->Text));
+ $spreadsheet->getActiveSheet()->getComment((string) $commentAttributes->ObjectBound)->setAuthor((string) $commentAttributes->Author)->setText($this->parseRichText((string) $commentAttributes->Text));
}
}
}
-// echo '$maxCol=', $maxCol,'; $maxRow=', $maxRow,'
';
-//
foreach ($sheet->Styles->StyleRegion as $styleRegion) {
$styleAttributes = $styleRegion->attributes();
if (($styleAttributes['startRow'] <= $maxRow) &&
($styleAttributes['startCol'] <= $maxCol)) {
- $startColumn = PHPExcel_Cell::stringFromColumnIndex((int) $styleAttributes['startCol']);
+ $startColumn = Coordinate::stringFromColumnIndex((int) $styleAttributes['startCol'] + 1);
$startRow = $styleAttributes['startRow'] + 1;
$endColumn = ($styleAttributes['endCol'] > $maxCol) ? $maxCol : (int) $styleAttributes['endCol'];
- $endColumn = PHPExcel_Cell::stringFromColumnIndex($endColumn);
+ $endColumn = Coordinate::stringFromColumnIndex($endColumn + 1);
$endRow = ($styleAttributes['endRow'] > $maxRow) ? $maxRow : $styleAttributes['endRow'];
$endRow += 1;
- $cellRange = $startColumn.$startRow.':'.$endColumn.$endRow;
-// echo $cellRange,'
';
+ $cellRange = $startColumn . $startRow . ':' . $endColumn . $endRow;
$styleAttributes = $styleRegion->Style->attributes();
-// var_dump($styleAttributes);
-// echo '
';
// We still set the number format mask for date/time values, even if readDataOnly is true
if ((!$this->readDataOnly) ||
- (PHPExcel_Shared_Date::isDateTimeFormatCode((string) $styleAttributes['Format']))) {
- $styleArray = array();
- $styleArray['numberformat']['code'] = (string) $styleAttributes['Format'];
+ (Date::isDateTimeFormatCode((string) $styleAttributes['Format']))) {
+ $styleArray = [];
+ $styleArray['numberFormat']['formatCode'] = (string) $styleAttributes['Format'];
// If readDataOnly is false, we set all formatting information
if (!$this->readDataOnly) {
switch ($styleAttributes['HAlign']) {
case '1':
- $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_GENERAL;
+ $styleArray['alignment']['horizontal'] = Alignment::HORIZONTAL_GENERAL;
+
break;
case '2':
- $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_LEFT;
+ $styleArray['alignment']['horizontal'] = Alignment::HORIZONTAL_LEFT;
+
break;
case '4':
- $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_RIGHT;
+ $styleArray['alignment']['horizontal'] = Alignment::HORIZONTAL_RIGHT;
+
break;
case '8':
- $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_CENTER;
+ $styleArray['alignment']['horizontal'] = Alignment::HORIZONTAL_CENTER;
+
break;
case '16':
case '64':
- $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS;
+ $styleArray['alignment']['horizontal'] = Alignment::HORIZONTAL_CENTER_CONTINUOUS;
+
break;
case '32':
- $styleArray['alignment']['horizontal'] = PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY;
+ $styleArray['alignment']['horizontal'] = Alignment::HORIZONTAL_JUSTIFY;
+
break;
}
switch ($styleAttributes['VAlign']) {
case '1':
- $styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_TOP;
+ $styleArray['alignment']['vertical'] = Alignment::VERTICAL_TOP;
+
break;
case '2':
- $styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_BOTTOM;
+ $styleArray['alignment']['vertical'] = Alignment::VERTICAL_BOTTOM;
+
break;
case '4':
- $styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_CENTER;
+ $styleArray['alignment']['vertical'] = Alignment::VERTICAL_CENTER;
+
break;
case '8':
- $styleArray['alignment']['vertical'] = PHPExcel_Style_Alignment::VERTICAL_JUSTIFY;
+ $styleArray['alignment']['vertical'] = Alignment::VERTICAL_JUSTIFY;
+
break;
}
- $styleArray['alignment']['wrap'] = ($styleAttributes['WrapText'] == '1') ? true : false;
- $styleArray['alignment']['shrinkToFit'] = ($styleAttributes['ShrinkToFit'] == '1') ? true : false;
- $styleArray['alignment']['indent'] = (intval($styleAttributes["Indent"]) > 0) ? $styleAttributes["indent"] : 0;
+ $styleArray['alignment']['wrapText'] = $styleAttributes['WrapText'] == '1';
+ $styleArray['alignment']['shrinkToFit'] = $styleAttributes['ShrinkToFit'] == '1';
+ $styleArray['alignment']['indent'] = ((int) ($styleAttributes['Indent']) > 0) ? $styleAttributes['indent'] : 0;
- $RGB = self::parseGnumericColour($styleAttributes["Fore"]);
+ $RGB = self::parseGnumericColour($styleAttributes['Fore']);
$styleArray['font']['color']['rgb'] = $RGB;
- $RGB = self::parseGnumericColour($styleAttributes["Back"]);
- $shade = $styleAttributes["Shade"];
+ $RGB = self::parseGnumericColour($styleAttributes['Back']);
+ $shade = $styleAttributes['Shade'];
if (($RGB != '000000') || ($shade != '0')) {
- $styleArray['fill']['color']['rgb'] = $styleArray['fill']['startcolor']['rgb'] = $RGB;
- $RGB2 = self::parseGnumericColour($styleAttributes["PatternColor"]);
- $styleArray['fill']['endcolor']['rgb'] = $RGB2;
+ $styleArray['fill']['color']['rgb'] = $styleArray['fill']['startColor']['rgb'] = $RGB;
+ $RGB2 = self::parseGnumericColour($styleAttributes['PatternColor']);
+ $styleArray['fill']['endColor']['rgb'] = $RGB2;
switch ($shade) {
case '1':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_SOLID;
+ $styleArray['fill']['fillType'] = Fill::FILL_SOLID;
+
break;
case '2':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR;
+ $styleArray['fill']['fillType'] = Fill::FILL_GRADIENT_LINEAR;
+
break;
case '3':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_GRADIENT_PATH;
+ $styleArray['fill']['fillType'] = Fill::FILL_GRADIENT_PATH;
+
break;
case '4':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKDOWN;
+ $styleArray['fill']['fillType'] = Fill::FILL_PATTERN_DARKDOWN;
+
break;
case '5':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKGRAY;
+ $styleArray['fill']['fillType'] = Fill::FILL_PATTERN_DARKGRAY;
+
break;
case '6':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKGRID;
+ $styleArray['fill']['fillType'] = Fill::FILL_PATTERN_DARKGRID;
+
break;
case '7':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKHORIZONTAL;
+ $styleArray['fill']['fillType'] = Fill::FILL_PATTERN_DARKHORIZONTAL;
+
break;
case '8':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKTRELLIS;
+ $styleArray['fill']['fillType'] = Fill::FILL_PATTERN_DARKTRELLIS;
+
break;
case '9':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKUP;
+ $styleArray['fill']['fillType'] = Fill::FILL_PATTERN_DARKUP;
+
break;
case '10':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_DARKVERTICAL;
+ $styleArray['fill']['fillType'] = Fill::FILL_PATTERN_DARKVERTICAL;
+
break;
case '11':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_GRAY0625;
+ $styleArray['fill']['fillType'] = Fill::FILL_PATTERN_GRAY0625;
+
break;
case '12':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_GRAY125;
+ $styleArray['fill']['fillType'] = Fill::FILL_PATTERN_GRAY125;
+
break;
case '13':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTDOWN;
+ $styleArray['fill']['fillType'] = Fill::FILL_PATTERN_LIGHTDOWN;
+
break;
case '14':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRAY;
+ $styleArray['fill']['fillType'] = Fill::FILL_PATTERN_LIGHTGRAY;
+
break;
case '15':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTGRID;
+ $styleArray['fill']['fillType'] = Fill::FILL_PATTERN_LIGHTGRID;
+
break;
case '16':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTHORIZONTAL;
+ $styleArray['fill']['fillType'] = Fill::FILL_PATTERN_LIGHTHORIZONTAL;
+
break;
case '17':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTTRELLIS;
+ $styleArray['fill']['fillType'] = Fill::FILL_PATTERN_LIGHTTRELLIS;
+
break;
case '18':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTUP;
+ $styleArray['fill']['fillType'] = Fill::FILL_PATTERN_LIGHTUP;
+
break;
case '19':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_LIGHTVERTICAL;
+ $styleArray['fill']['fillType'] = Fill::FILL_PATTERN_LIGHTVERTICAL;
+
break;
case '20':
- $styleArray['fill']['type'] = PHPExcel_Style_Fill::FILL_PATTERN_MEDIUMGRAY;
+ $styleArray['fill']['fillType'] = Fill::FILL_PATTERN_MEDIUMGRAY;
+
break;
}
}
$fontAttributes = $styleRegion->Style->Font->attributes();
-// var_dump($fontAttributes);
-// echo '
';
$styleArray['font']['name'] = (string) $styleRegion->Style->Font;
- $styleArray['font']['size'] = intval($fontAttributes['Unit']);
- $styleArray['font']['bold'] = ($fontAttributes['Bold'] == '1') ? true : false;
- $styleArray['font']['italic'] = ($fontAttributes['Italic'] == '1') ? true : false;
- $styleArray['font']['strike'] = ($fontAttributes['StrikeThrough'] == '1') ? true : false;
+ $styleArray['font']['size'] = (int) ($fontAttributes['Unit']);
+ $styleArray['font']['bold'] = $fontAttributes['Bold'] == '1';
+ $styleArray['font']['italic'] = $fontAttributes['Italic'] == '1';
+ $styleArray['font']['strikethrough'] = $fontAttributes['StrikeThrough'] == '1';
switch ($fontAttributes['Underline']) {
case '1':
- $styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_SINGLE;
+ $styleArray['font']['underline'] = Font::UNDERLINE_SINGLE;
+
break;
case '2':
- $styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_DOUBLE;
+ $styleArray['font']['underline'] = Font::UNDERLINE_DOUBLE;
+
break;
case '3':
- $styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_SINGLEACCOUNTING;
+ $styleArray['font']['underline'] = Font::UNDERLINE_SINGLEACCOUNTING;
+
break;
case '4':
- $styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_DOUBLEACCOUNTING;
+ $styleArray['font']['underline'] = Font::UNDERLINE_DOUBLEACCOUNTING;
+
break;
default:
- $styleArray['font']['underline'] = PHPExcel_Style_Font::UNDERLINE_NONE;
+ $styleArray['font']['underline'] = Font::UNDERLINE_NONE;
+
break;
}
switch ($fontAttributes['Script']) {
case '1':
- $styleArray['font']['superScript'] = true;
+ $styleArray['font']['superscript'] = true;
+
break;
case '-1':
- $styleArray['font']['subScript'] = true;
+ $styleArray['font']['subscript'] = true;
+
break;
}
@@ -663,13 +688,13 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
}
if ((isset($styleRegion->Style->StyleBorder->Diagonal)) && (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}))) {
$styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes());
- $styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_BOTH;
+ $styleArray['borders']['diagonalDirection'] = Borders::DIAGONAL_BOTH;
} elseif (isset($styleRegion->Style->StyleBorder->Diagonal)) {
$styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes());
- $styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_UP;
+ $styleArray['borders']['diagonalDirection'] = Borders::DIAGONAL_UP;
} elseif (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'})) {
$styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}->attributes());
- $styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_DOWN;
+ $styleArray['borders']['diagonalDirection'] = Borders::DIAGONAL_DOWN;
}
}
if (isset($styleRegion->Style->HyperLink)) {
@@ -677,9 +702,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$hyperlink = $styleRegion->Style->HyperLink->attributes();
}
}
-// var_dump($styleArray);
-// echo '
';
- $objPHPExcel->getActiveSheet()->getStyle($cellRange)->applyFromArray($styleArray);
+ $spreadsheet->getActiveSheet()->getStyle($cellRange)->applyFromArray($styleArray);
}
}
}
@@ -687,28 +710,28 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
if ((!$this->readDataOnly) && (isset($sheet->Cols))) {
// Column Widths
$columnAttributes = $sheet->Cols->attributes();
- $defaultWidth = $columnAttributes['DefaultSizePts'] / 5.4;
+ $defaultWidth = $columnAttributes['DefaultSizePts'] / 5.4;
$c = 0;
foreach ($sheet->Cols->ColInfo as $columnOverride) {
$columnAttributes = $columnOverride->attributes();
$column = $columnAttributes['No'];
- $columnWidth = $columnAttributes['Unit'] / 5.4;
- $hidden = ((isset($columnAttributes['Hidden'])) && ($columnAttributes['Hidden'] == '1')) ? true : false;
+ $columnWidth = $columnAttributes['Unit'] / 5.4;
+ $hidden = (isset($columnAttributes['Hidden'])) && ($columnAttributes['Hidden'] == '1');
$columnCount = (isset($columnAttributes['Count'])) ? $columnAttributes['Count'] : 1;
while ($c < $column) {
- $objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setWidth($defaultWidth);
+ $spreadsheet->getActiveSheet()->getColumnDimension(Coordinate::stringFromColumnIndex($c + 1))->setWidth($defaultWidth);
++$c;
}
- while (($c < ($column+$columnCount)) && ($c <= $maxCol)) {
- $objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setWidth($columnWidth);
+ while (($c < ($column + $columnCount)) && ($c <= $maxCol)) {
+ $spreadsheet->getActiveSheet()->getColumnDimension(Coordinate::stringFromColumnIndex($c + 1))->setWidth($columnWidth);
if ($hidden) {
- $objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setVisible(false);
+ $spreadsheet->getActiveSheet()->getColumnDimension(Coordinate::stringFromColumnIndex($c + 1))->setVisible(false);
}
++$c;
}
}
while ($c <= $maxCol) {
- $objPHPExcel->getActiveSheet()->getColumnDimension(PHPExcel_Cell::stringFromColumnIndex($c))->setWidth($defaultWidth);
+ $spreadsheet->getActiveSheet()->getColumnDimension(Coordinate::stringFromColumnIndex($c + 1))->setWidth($defaultWidth);
++$c;
}
}
@@ -723,23 +746,23 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$rowAttributes = $rowOverride->attributes();
$row = $rowAttributes['No'];
$rowHeight = $rowAttributes['Unit'];
- $hidden = ((isset($rowAttributes['Hidden'])) && ($rowAttributes['Hidden'] == '1')) ? true : false;
+ $hidden = (isset($rowAttributes['Hidden'])) && ($rowAttributes['Hidden'] == '1');
$rowCount = (isset($rowAttributes['Count'])) ? $rowAttributes['Count'] : 1;
while ($r < $row) {
++$r;
- $objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight);
+ $spreadsheet->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight);
}
- while (($r < ($row+$rowCount)) && ($r < $maxRow)) {
+ while (($r < ($row + $rowCount)) && ($r < $maxRow)) {
++$r;
- $objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($rowHeight);
+ $spreadsheet->getActiveSheet()->getRowDimension($r)->setRowHeight($rowHeight);
if ($hidden) {
- $objPHPExcel->getActiveSheet()->getRowDimension($r)->setVisible(false);
+ $spreadsheet->getActiveSheet()->getRowDimension($r)->setVisible(false);
}
}
}
while ($r < $maxRow) {
++$r;
- $objPHPExcel->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight);
+ $spreadsheet->getActiveSheet()->getRowDimension($r)->setRowHeight($defaultHeight);
}
}
@@ -747,12 +770,12 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
if (isset($sheet->MergedRegions)) {
foreach ($sheet->MergedRegions->Merge as $mergeCells) {
if (strpos($mergeCells, ':') !== false) {
- $objPHPExcel->getActiveSheet()->mergeCells($mergeCells);
+ $spreadsheet->getActiveSheet()->mergeCells($mergeCells);
}
}
}
- $worksheetID++;
+ ++$worksheetID;
}
// Loop through definedNames (global named ranges)
@@ -764,76 +787,91 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
continue;
}
- $range = explode('!', $range);
+ $range = Worksheet::extractSheetTitle($range, true);
$range[0] = trim($range[0], "'");
- if ($worksheet = $objPHPExcel->getSheetByName($range[0])) {
+ if ($worksheet = $spreadsheet->getSheetByName($range[0])) {
$extractedRange = str_replace('$', '', $range[1]);
- $objPHPExcel->addNamedRange(new PHPExcel_NamedRange($name, $worksheet, $extractedRange));
+ $spreadsheet->addNamedRange(new NamedRange($name, $worksheet, $extractedRange));
}
}
}
// Return
- return $objPHPExcel;
+ return $spreadsheet;
}
private static function parseBorderAttributes($borderAttributes)
{
- $styleArray = array();
- if (isset($borderAttributes["Color"])) {
- $styleArray['color']['rgb'] = self::parseGnumericColour($borderAttributes["Color"]);
+ $styleArray = [];
+ if (isset($borderAttributes['Color'])) {
+ $styleArray['color']['rgb'] = self::parseGnumericColour($borderAttributes['Color']);
}
- switch ($borderAttributes["Style"]) {
+ switch ($borderAttributes['Style']) {
case '0':
- $styleArray['style'] = PHPExcel_Style_Border::BORDER_NONE;
+ $styleArray['borderStyle'] = Border::BORDER_NONE;
+
break;
case '1':
- $styleArray['style'] = PHPExcel_Style_Border::BORDER_THIN;
+ $styleArray['borderStyle'] = Border::BORDER_THIN;
+
break;
case '2':
- $styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUM;
+ $styleArray['borderStyle'] = Border::BORDER_MEDIUM;
+
break;
case '3':
- $styleArray['style'] = PHPExcel_Style_Border::BORDER_SLANTDASHDOT;
+ $styleArray['borderStyle'] = Border::BORDER_SLANTDASHDOT;
+
break;
case '4':
- $styleArray['style'] = PHPExcel_Style_Border::BORDER_DASHED;
+ $styleArray['borderStyle'] = Border::BORDER_DASHED;
+
break;
case '5':
- $styleArray['style'] = PHPExcel_Style_Border::BORDER_THICK;
+ $styleArray['borderStyle'] = Border::BORDER_THICK;
+
break;
case '6':
- $styleArray['style'] = PHPExcel_Style_Border::BORDER_DOUBLE;
+ $styleArray['borderStyle'] = Border::BORDER_DOUBLE;
+
break;
case '7':
- $styleArray['style'] = PHPExcel_Style_Border::BORDER_DOTTED;
+ $styleArray['borderStyle'] = Border::BORDER_DOTTED;
+
break;
case '8':
- $styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHED;
+ $styleArray['borderStyle'] = Border::BORDER_MEDIUMDASHED;
+
break;
case '9':
- $styleArray['style'] = PHPExcel_Style_Border::BORDER_DASHDOT;
+ $styleArray['borderStyle'] = Border::BORDER_DASHDOT;
+
break;
case '10':
- $styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT;
+ $styleArray['borderStyle'] = Border::BORDER_MEDIUMDASHDOT;
+
break;
case '11':
- $styleArray['style'] = PHPExcel_Style_Border::BORDER_DASHDOTDOT;
+ $styleArray['borderStyle'] = Border::BORDER_DASHDOTDOT;
+
break;
case '12':
- $styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT;
+ $styleArray['borderStyle'] = Border::BORDER_MEDIUMDASHDOTDOT;
+
break;
case '13':
- $styleArray['style'] = PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT;
+ $styleArray['borderStyle'] = Border::BORDER_MEDIUMDASHDOTDOT;
+
break;
}
+
return $styleArray;
}
- private function parseRichText($is = '')
+ private function parseRichText($is)
{
- $value = new PHPExcel_RichText();
+ $value = new RichText();
$value->createText($is);
return $value;
@@ -845,6 +883,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$gnmR = substr(str_pad($gnmR, 4, '0', STR_PAD_RIGHT), 0, 2);
$gnmG = substr(str_pad($gnmG, 4, '0', STR_PAD_RIGHT), 0, 2);
$gnmB = substr(str_pad($gnmB, 4, '0', STR_PAD_RIGHT), 0, 2);
+
return $gnmR . $gnmG . $gnmB;
}
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php
new file mode 100644
index 00000000000..6a6ca73e267
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Html.php
@@ -0,0 +1,933 @@
+ [
+ 'font' => [
+ 'bold' => true,
+ 'size' => 24,
+ ],
+ ], // Bold, 24pt
+ 'h2' => [
+ 'font' => [
+ 'bold' => true,
+ 'size' => 18,
+ ],
+ ], // Bold, 18pt
+ 'h3' => [
+ 'font' => [
+ 'bold' => true,
+ 'size' => 13.5,
+ ],
+ ], // Bold, 13.5pt
+ 'h4' => [
+ 'font' => [
+ 'bold' => true,
+ 'size' => 12,
+ ],
+ ], // Bold, 12pt
+ 'h5' => [
+ 'font' => [
+ 'bold' => true,
+ 'size' => 10,
+ ],
+ ], // Bold, 10pt
+ 'h6' => [
+ 'font' => [
+ 'bold' => true,
+ 'size' => 7.5,
+ ],
+ ], // Bold, 7.5pt
+ 'a' => [
+ 'font' => [
+ 'underline' => true,
+ 'color' => [
+ 'argb' => Color::COLOR_BLUE,
+ ],
+ ],
+ ], // Blue underlined
+ 'hr' => [
+ 'borders' => [
+ 'bottom' => [
+ 'borderStyle' => Border::BORDER_THIN,
+ 'color' => [
+ Color::COLOR_BLACK,
+ ],
+ ],
+ ],
+ ], // Bottom border
+ 'strong' => [
+ 'font' => [
+ 'bold' => true,
+ ],
+ ], // Bold
+ 'b' => [
+ 'font' => [
+ 'bold' => true,
+ ],
+ ], // Bold
+ 'i' => [
+ 'font' => [
+ 'italic' => true,
+ ],
+ ], // Italic
+ 'em' => [
+ 'font' => [
+ 'italic' => true,
+ ],
+ ], // Italic
+ ];
+
+ protected $rowspan = [];
+
+ /**
+ * Create a new HTML Reader instance.
+ */
+ public function __construct()
+ {
+ $this->readFilter = new DefaultReadFilter();
+ $this->securityScanner = XmlScanner::getInstance($this);
+ }
+
+ /**
+ * Validate that the current file is an HTML file.
+ *
+ * @param string $pFilename
+ *
+ * @return bool
+ */
+ public function canRead($pFilename)
+ {
+ // Check if file exists
+ try {
+ $this->openFile($pFilename);
+ } catch (Exception $e) {
+ return false;
+ }
+
+ $beginning = $this->readBeginning();
+ $startWithTag = self::startsWithTag($beginning);
+ $containsTags = self::containsTags($beginning);
+ $endsWithTag = self::endsWithTag($this->readEnding());
+
+ fclose($this->fileHandle);
+
+ return $startWithTag && $containsTags && $endsWithTag;
+ }
+
+ private function readBeginning()
+ {
+ fseek($this->fileHandle, 0);
+
+ return fread($this->fileHandle, self::TEST_SAMPLE_SIZE);
+ }
+
+ private function readEnding()
+ {
+ $meta = stream_get_meta_data($this->fileHandle);
+ $filename = $meta['uri'];
+
+ $size = filesize($filename);
+ if ($size === 0) {
+ return '';
+ }
+
+ $blockSize = self::TEST_SAMPLE_SIZE;
+ if ($size < $blockSize) {
+ $blockSize = $size;
+ }
+
+ fseek($this->fileHandle, $size - $blockSize);
+
+ return fread($this->fileHandle, $blockSize);
+ }
+
+ private static function startsWithTag($data)
+ {
+ return '<' === substr(trim($data), 0, 1);
+ }
+
+ private static function endsWithTag($data)
+ {
+ return '>' === substr(trim($data), -1, 1);
+ }
+
+ private static function containsTags($data)
+ {
+ return strlen($data) !== strlen(strip_tags($data));
+ }
+
+ /**
+ * Loads Spreadsheet from file.
+ *
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return Spreadsheet
+ */
+ public function load($pFilename)
+ {
+ // Create new Spreadsheet
+ $spreadsheet = new Spreadsheet();
+
+ // Load into this instance
+ return $this->loadIntoExisting($pFilename, $spreadsheet);
+ }
+
+ /**
+ * Set input encoding.
+ *
+ * @param string $pValue Input encoding, eg: 'ANSI'
+ *
+ * @return Html
+ */
+ public function setInputEncoding($pValue)
+ {
+ $this->inputEncoding = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get input encoding.
+ *
+ * @return string
+ */
+ public function getInputEncoding()
+ {
+ return $this->inputEncoding;
+ }
+
+ // Data Array used for testing only, should write to Spreadsheet object on completion of tests
+ protected $dataArray = [];
+
+ protected $tableLevel = 0;
+
+ protected $nestedColumn = ['A'];
+
+ protected function setTableStartColumn($column)
+ {
+ if ($this->tableLevel == 0) {
+ $column = 'A';
+ }
+ ++$this->tableLevel;
+ $this->nestedColumn[$this->tableLevel] = $column;
+
+ return $this->nestedColumn[$this->tableLevel];
+ }
+
+ protected function getTableStartColumn()
+ {
+ return $this->nestedColumn[$this->tableLevel];
+ }
+
+ protected function releaseTableStartColumn()
+ {
+ --$this->tableLevel;
+
+ return array_pop($this->nestedColumn);
+ }
+
+ protected function flushCell(Worksheet $sheet, $column, $row, &$cellContent)
+ {
+ if (is_string($cellContent)) {
+ // Simple String content
+ if (trim($cellContent) > '') {
+ // Only actually write it if there's content in the string
+ // Write to worksheet to be done here...
+ // ... we return the cell so we can mess about with styles more easily
+ $sheet->setCellValue($column . $row, $cellContent);
+ $this->dataArray[$row][$column] = $cellContent;
+ }
+ } else {
+ // We have a Rich Text run
+ // TODO
+ $this->dataArray[$row][$column] = 'RICH TEXT: ' . $cellContent;
+ }
+ $cellContent = (string) '';
+ }
+
+ /**
+ * @param DOMNode $element
+ * @param Worksheet $sheet
+ * @param int $row
+ * @param string $column
+ * @param string $cellContent
+ */
+ protected function processDomElement(DOMNode $element, Worksheet $sheet, &$row, &$column, &$cellContent)
+ {
+ foreach ($element->childNodes as $child) {
+ if ($child instanceof DOMText) {
+ $domText = preg_replace('/\s+/u', ' ', trim($child->nodeValue));
+ if (is_string($cellContent)) {
+ // simply append the text if the cell content is a plain text string
+ $cellContent .= $domText;
+ }
+ // but if we have a rich text run instead, we need to append it correctly
+ // TODO
+ } elseif ($child instanceof DOMElement) {
+ $attributeArray = [];
+ foreach ($child->attributes as $attribute) {
+ $attributeArray[$attribute->name] = $attribute->value;
+ }
+
+ switch ($child->nodeName) {
+ case 'meta':
+ foreach ($attributeArray as $attributeName => $attributeValue) {
+ // Extract character set, so we can convert to UTF-8 if required
+ if ($attributeName === 'charset') {
+ $this->setInputEncoding($attributeValue);
+ }
+ }
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
+
+ break;
+ case 'title':
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
+ $sheet->setTitle($cellContent, true, false);
+ $cellContent = '';
+
+ break;
+ case 'span':
+ case 'div':
+ case 'font':
+ case 'i':
+ case 'em':
+ case 'strong':
+ case 'b':
+ if (isset($attributeArray['class']) && $attributeArray['class'] === 'comment') {
+ $sheet->getComment($column . $row)
+ ->getText()
+ ->createTextRun($child->textContent);
+
+ break;
+ }
+
+ if ($cellContent > '') {
+ $cellContent .= ' ';
+ }
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
+ if ($cellContent > '') {
+ $cellContent .= ' ';
+ }
+
+ if (isset($this->formats[$child->nodeName])) {
+ $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
+ }
+
+ break;
+ case 'hr':
+ $this->flushCell($sheet, $column, $row, $cellContent);
+ ++$row;
+ if (isset($this->formats[$child->nodeName])) {
+ $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
+ } else {
+ $cellContent = '----------';
+ $this->flushCell($sheet, $column, $row, $cellContent);
+ }
+ ++$row;
+ // Add a break after a horizontal rule, simply by allowing the code to dropthru
+ // no break
+ case 'br':
+ if ($this->tableLevel > 0) {
+ // If we're inside a table, replace with a \n
+ $cellContent .= "\n";
+ } else {
+ // Otherwise flush our existing content and move the row cursor on
+ $this->flushCell($sheet, $column, $row, $cellContent);
+ ++$row;
+ }
+
+ break;
+ case 'a':
+ foreach ($attributeArray as $attributeName => $attributeValue) {
+ switch ($attributeName) {
+ case 'href':
+ $sheet->getCell($column . $row)->getHyperlink()->setUrl($attributeValue);
+ if (isset($this->formats[$child->nodeName])) {
+ $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
+ }
+
+ break;
+ case 'class':
+ if ($attributeValue === 'comment-indicator') {
+ break; // Ignore - it's just a red square.
+ }
+ }
+ }
+ $cellContent .= ' ';
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
+
+ break;
+ case 'h1':
+ case 'h2':
+ case 'h3':
+ case 'h4':
+ case 'h5':
+ case 'h6':
+ case 'ol':
+ case 'ul':
+ case 'p':
+ if ($this->tableLevel > 0) {
+ // If we're inside a table, replace with a \n
+ $cellContent .= "\n";
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
+ } else {
+ if ($cellContent > '') {
+ $this->flushCell($sheet, $column, $row, $cellContent);
+ ++$row;
+ }
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
+ $this->flushCell($sheet, $column, $row, $cellContent);
+
+ if (isset($this->formats[$child->nodeName])) {
+ $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
+ }
+
+ ++$row;
+ $column = 'A';
+ }
+
+ break;
+ case 'li':
+ if ($this->tableLevel > 0) {
+ // If we're inside a table, replace with a \n
+ $cellContent .= "\n";
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
+ } else {
+ if ($cellContent > '') {
+ $this->flushCell($sheet, $column, $row, $cellContent);
+ }
+ ++$row;
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
+ $this->flushCell($sheet, $column, $row, $cellContent);
+ $column = 'A';
+ }
+
+ break;
+ case 'img':
+ $this->insertImage($sheet, $column, $row, $attributeArray);
+
+ break;
+ case 'table':
+ $this->flushCell($sheet, $column, $row, $cellContent);
+ $column = $this->setTableStartColumn($column);
+ if ($this->tableLevel > 1) {
+ --$row;
+ }
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
+ $column = $this->releaseTableStartColumn();
+ if ($this->tableLevel > 1) {
+ ++$column;
+ } else {
+ ++$row;
+ }
+
+ break;
+ case 'thead':
+ case 'tbody':
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
+
+ break;
+ case 'tr':
+ $column = $this->getTableStartColumn();
+ $cellContent = '';
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
+
+ if (isset($attributeArray['height'])) {
+ $sheet->getRowDimension($row)->setRowHeight($attributeArray['height']);
+ }
+
+ ++$row;
+
+ break;
+ case 'th':
+ case 'td':
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
+
+ // apply inline style
+ $this->applyInlineStyle($sheet, $row, $column, $attributeArray);
+
+ while (isset($this->rowspan[$column . $row])) {
+ ++$column;
+ }
+
+ $this->flushCell($sheet, $column, $row, $cellContent);
+
+ if (isset($attributeArray['rowspan'], $attributeArray['colspan'])) {
+ //create merging rowspan and colspan
+ $columnTo = $column;
+ for ($i = 0; $i < $attributeArray['colspan'] - 1; ++$i) {
+ ++$columnTo;
+ }
+ $range = $column . $row . ':' . $columnTo . ($row + $attributeArray['rowspan'] - 1);
+ foreach (Coordinate::extractAllCellReferencesInRange($range) as $value) {
+ $this->rowspan[$value] = true;
+ }
+ $sheet->mergeCells($range);
+ $column = $columnTo;
+ } elseif (isset($attributeArray['rowspan'])) {
+ //create merging rowspan
+ $range = $column . $row . ':' . $column . ($row + $attributeArray['rowspan'] - 1);
+ foreach (Coordinate::extractAllCellReferencesInRange($range) as $value) {
+ $this->rowspan[$value] = true;
+ }
+ $sheet->mergeCells($range);
+ } elseif (isset($attributeArray['colspan'])) {
+ //create merging colspan
+ $columnTo = $column;
+ for ($i = 0; $i < $attributeArray['colspan'] - 1; ++$i) {
+ ++$columnTo;
+ }
+ $sheet->mergeCells($column . $row . ':' . $columnTo . $row);
+ $column = $columnTo;
+ } elseif (isset($attributeArray['bgcolor'])) {
+ $sheet->getStyle($column . $row)->applyFromArray(
+ [
+ 'fill' => [
+ 'fillType' => Fill::FILL_SOLID,
+ 'color' => ['rgb' => $attributeArray['bgcolor']],
+ ],
+ ]
+ );
+ }
+
+ if (isset($attributeArray['width'])) {
+ $sheet->getColumnDimension($column)->setWidth($attributeArray['width']);
+ }
+
+ if (isset($attributeArray['height'])) {
+ $sheet->getRowDimension($row)->setRowHeight($attributeArray['height']);
+ }
+
+ if (isset($attributeArray['align'])) {
+ $sheet->getStyle($column . $row)->getAlignment()->setHorizontal($attributeArray['align']);
+ }
+
+ if (isset($attributeArray['valign'])) {
+ $sheet->getStyle($column . $row)->getAlignment()->setVertical($attributeArray['valign']);
+ }
+
+ if (isset($attributeArray['data-format'])) {
+ $sheet->getStyle($column . $row)->getNumberFormat()->setFormatCode($attributeArray['data-format']);
+ }
+
+ ++$column;
+
+ break;
+ case 'body':
+ $row = 1;
+ $column = 'A';
+ $cellContent = '';
+ $this->tableLevel = 0;
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
+
+ break;
+ default:
+ $this->processDomElement($child, $sheet, $row, $column, $cellContent);
+ }
+ }
+ }
+ }
+
+ /**
+ * Loads PhpSpreadsheet from file into PhpSpreadsheet instance.
+ *
+ * @param string $pFilename
+ * @param Spreadsheet $spreadsheet
+ *
+ * @throws Exception
+ *
+ * @return Spreadsheet
+ */
+ public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet)
+ {
+ // Validate
+ if (!$this->canRead($pFilename)) {
+ throw new Exception($pFilename . ' is an Invalid HTML file.');
+ }
+
+ // Create new sheet
+ while ($spreadsheet->getSheetCount() <= $this->sheetIndex) {
+ $spreadsheet->createSheet();
+ }
+ $spreadsheet->setActiveSheetIndex($this->sheetIndex);
+
+ // Create a new DOM object
+ $dom = new DOMDocument();
+ // Reload the HTML file into the DOM object
+ $loaded = $dom->loadHTML(mb_convert_encoding($this->securityScanner->scanFile($pFilename), 'HTML-ENTITIES', 'UTF-8'));
+ if ($loaded === false) {
+ throw new Exception('Failed to load ' . $pFilename . ' as a DOM Document');
+ }
+
+ // Discard white space
+ $dom->preserveWhiteSpace = false;
+
+ $row = 0;
+ $column = 'A';
+ $content = '';
+ $this->rowspan = [];
+ $this->processDomElement($dom, $spreadsheet->getActiveSheet(), $row, $column, $content);
+
+ // Return
+ return $spreadsheet;
+ }
+
+ /**
+ * Get sheet index.
+ *
+ * @return int
+ */
+ public function getSheetIndex()
+ {
+ return $this->sheetIndex;
+ }
+
+ /**
+ * Set sheet index.
+ *
+ * @param int $pValue Sheet index
+ *
+ * @return HTML
+ */
+ public function setSheetIndex($pValue)
+ {
+ $this->sheetIndex = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Apply inline css inline style.
+ *
+ * NOTES :
+ * Currently only intended for td & th element,
+ * and only takes 'background-color' and 'color'; property with HEX color
+ *
+ * TODO :
+ * - Implement to other propertie, such as border
+ *
+ * @param Worksheet $sheet
+ * @param int $row
+ * @param string $column
+ * @param array $attributeArray
+ */
+ private function applyInlineStyle(&$sheet, $row, $column, $attributeArray)
+ {
+ if (!isset($attributeArray['style'])) {
+ return;
+ }
+
+ $cellStyle = $sheet->getStyle($column . $row);
+
+ // add color styles (background & text) from dom element,currently support : td & th, using ONLY inline css style with RGB color
+ $styles = explode(';', $attributeArray['style']);
+ foreach ($styles as $st) {
+ $value = explode(':', $st);
+ $styleName = isset($value[0]) ? trim($value[0]) : null;
+ $styleValue = isset($value[1]) ? trim($value[1]) : null;
+
+ if (!$styleName) {
+ continue;
+ }
+
+ switch ($styleName) {
+ case 'background':
+ case 'background-color':
+ $styleColor = $this->getStyleColor($styleValue);
+
+ if (!$styleColor) {
+ continue 2;
+ }
+
+ $cellStyle->applyFromArray(['fill' => ['fillType' => Fill::FILL_SOLID, 'color' => ['rgb' => $styleColor]]]);
+
+ break;
+ case 'color':
+ $styleColor = $this->getStyleColor($styleValue);
+
+ if (!$styleColor) {
+ continue 2;
+ }
+
+ $cellStyle->applyFromArray(['font' => ['color' => ['rgb' => $styleColor]]]);
+
+ break;
+
+ case 'border':
+ $this->setBorderStyle($cellStyle, $styleValue, 'allBorders');
+
+ break;
+
+ case 'border-top':
+ $this->setBorderStyle($cellStyle, $styleValue, 'top');
+
+ break;
+
+ case 'border-bottom':
+ $this->setBorderStyle($cellStyle, $styleValue, 'bottom');
+
+ break;
+
+ case 'border-left':
+ $this->setBorderStyle($cellStyle, $styleValue, 'left');
+
+ break;
+
+ case 'border-right':
+ $this->setBorderStyle($cellStyle, $styleValue, 'right');
+
+ break;
+
+ case 'font-size':
+ $cellStyle->getFont()->setSize(
+ (float) $styleValue
+ );
+
+ break;
+
+ case 'font-weight':
+ if ($styleValue === 'bold' || $styleValue >= 500) {
+ $cellStyle->getFont()->setBold(true);
+ }
+
+ break;
+
+ case 'font-style':
+ if ($styleValue === 'italic') {
+ $cellStyle->getFont()->setItalic(true);
+ }
+
+ break;
+
+ case 'font-family':
+ $cellStyle->getFont()->setName(str_replace('\'', '', $styleValue));
+
+ break;
+
+ case 'text-decoration':
+ switch ($styleValue) {
+ case 'underline':
+ $cellStyle->getFont()->setUnderline(Font::UNDERLINE_SINGLE);
+
+ break;
+ case 'line-through':
+ $cellStyle->getFont()->setStrikethrough(true);
+
+ break;
+ }
+
+ break;
+
+ case 'text-align':
+ $cellStyle->getAlignment()->setHorizontal($styleValue);
+
+ break;
+
+ case 'vertical-align':
+ $cellStyle->getAlignment()->setVertical($styleValue);
+
+ break;
+
+ case 'width':
+ $sheet->getColumnDimension($column)->setWidth(
+ str_replace('px', '', $styleValue)
+ );
+
+ break;
+
+ case 'height':
+ $sheet->getRowDimension($row)->setRowHeight(
+ str_replace('px', '', $styleValue)
+ );
+
+ break;
+
+ case 'word-wrap':
+ $cellStyle->getAlignment()->setWrapText(
+ $styleValue === 'break-word'
+ );
+
+ break;
+
+ case 'text-indent':
+ $cellStyle->getAlignment()->setIndent(
+ (int) str_replace(['px'], '', $styleValue)
+ );
+
+ break;
+ }
+ }
+ }
+
+ /**
+ * Check if has #, so we can get clean hex.
+ *
+ * @param $value
+ *
+ * @return null|string
+ */
+ public function getStyleColor($value)
+ {
+ if (strpos($value, '#') === 0) {
+ return substr($value, 1);
+ }
+
+ return null;
+ }
+
+ /**
+ * @param Worksheet $sheet
+ * @param string $column
+ * @param int $row
+ * @param array $attributes
+ *
+ * @throws \PhpOffice\PhpSpreadsheet\Exception
+ */
+ private function insertImage(Worksheet $sheet, $column, $row, array $attributes)
+ {
+ if (!isset($attributes['src'])) {
+ return;
+ }
+
+ $src = urldecode($attributes['src']);
+ $width = isset($attributes['width']) ? (float) $attributes['width'] : null;
+ $height = isset($attributes['height']) ? (float) $attributes['height'] : null;
+ $name = isset($attributes['alt']) ? (float) $attributes['alt'] : null;
+
+ $drawing = new Drawing();
+ $drawing->setPath($src);
+ $drawing->setWorksheet($sheet);
+ $drawing->setCoordinates($column . $row);
+ $drawing->setOffsetX(0);
+ $drawing->setOffsetY(10);
+ $drawing->setResizeProportional(true);
+
+ if ($name) {
+ $drawing->setName($name);
+ }
+
+ if ($width) {
+ $drawing->setWidth((int) $width);
+ }
+
+ if ($height) {
+ $drawing->setHeight((int) $height);
+ }
+
+ $sheet->getColumnDimension($column)->setWidth(
+ $drawing->getWidth() / 6
+ );
+
+ $sheet->getRowDimension($row)->setRowHeight(
+ $drawing->getHeight() * 0.9
+ );
+ }
+
+ /**
+ * Map html border style to PhpSpreadsheet border style.
+ *
+ * @param string $style
+ *
+ * @return null|string
+ */
+ public function getBorderStyle($style)
+ {
+ switch ($style) {
+ case 'solid':
+ return Border::BORDER_THIN;
+ case 'dashed':
+ return Border::BORDER_DASHED;
+ case 'dotted':
+ return Border::BORDER_DOTTED;
+ case 'medium':
+ return Border::BORDER_MEDIUM;
+ case 'thick':
+ return Border::BORDER_THICK;
+ case 'none':
+ return Border::BORDER_NONE;
+ case 'dash-dot':
+ return Border::BORDER_DASHDOT;
+ case 'dash-dot-dot':
+ return Border::BORDER_DASHDOTDOT;
+ case 'double':
+ return Border::BORDER_DOUBLE;
+ case 'hair':
+ return Border::BORDER_HAIR;
+ case 'medium-dash-dot':
+ return Border::BORDER_MEDIUMDASHDOT;
+ case 'medium-dash-dot-dot':
+ return Border::BORDER_MEDIUMDASHDOTDOT;
+ case 'medium-dashed':
+ return Border::BORDER_MEDIUMDASHED;
+ case 'slant-dash-dot':
+ return Border::BORDER_SLANTDASHDOT;
+ }
+
+ return null;
+ }
+
+ /**
+ * @param Style $cellStyle
+ * @param string $styleValue
+ * @param string $type
+ */
+ private function setBorderStyle(Style $cellStyle, $styleValue, $type)
+ {
+ list(, $borderStyle, $color) = explode(' ', $styleValue);
+
+ $cellStyle->applyFromArray([
+ 'borders' => [
+ $type => [
+ 'borderStyle' => $this->getBorderStyle($borderStyle),
+ 'color' => ['rgb' => $this->getStyleColor($color)],
+ ],
+ ],
+ ]);
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReadFilter.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReadFilter.php
new file mode 100644
index 00000000000..ccfe05ada6c
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/IReadFilter.php
@@ -0,0 +1,17 @@
+readFilter = new DefaultReadFilter();
+ $this->securityScanner = XmlScanner::getInstance($this);
+ }
+
+ /**
+ * Can the current IReader read the file?
+ *
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return bool
+ */
+ public function canRead($pFilename)
+ {
+ File::assertFile($pFilename);
+
+ $mimeType = 'UNKNOWN';
+
+ // Load file
+
+ $zip = new ZipArchive();
+ if ($zip->open($pFilename) === true) {
+ // check if it is an OOXML archive
+ $stat = $zip->statName('mimetype');
+ if ($stat && ($stat['size'] <= 255)) {
+ $mimeType = $zip->getFromName($stat['name']);
+ } elseif ($stat = $zip->statName('META-INF/manifest.xml')) {
+ $xml = simplexml_load_string(
+ $this->securityScanner->scan($zip->getFromName('META-INF/manifest.xml')),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ $namespacesContent = $xml->getNamespaces(true);
+ if (isset($namespacesContent['manifest'])) {
+ $manifest = $xml->children($namespacesContent['manifest']);
+ foreach ($manifest as $manifestDataSet) {
+ $manifestAttributes = $manifestDataSet->attributes($namespacesContent['manifest']);
+ if ($manifestAttributes->{'full-path'} == '/') {
+ $mimeType = (string) $manifestAttributes->{'media-type'};
+
+ break;
+ }
+ }
+ }
+ }
+
+ $zip->close();
+
+ return $mimeType === 'application/vnd.oasis.opendocument.spreadsheet';
+ }
+
+ return false;
+ }
+
+ /**
+ * Reads names of the worksheets from a file, without parsing the whole file to a PhpSpreadsheet object.
+ *
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return string[]
+ */
+ public function listWorksheetNames($pFilename)
+ {
+ File::assertFile($pFilename);
+
+ $zip = new ZipArchive();
+ if (!$zip->open($pFilename)) {
+ throw new Exception('Could not open ' . $pFilename . ' for reading! Error opening file.');
+ }
+
+ $worksheetNames = [];
+
+ $xml = new XMLReader();
+ $xml->xml(
+ $this->securityScanner->scanFile('zip://' . realpath($pFilename) . '#content.xml'),
+ null,
+ Settings::getLibXmlLoaderOptions()
+ );
+ $xml->setParserProperty(2, true);
+
+ // Step into the first level of content of the XML
+ $xml->read();
+ while ($xml->read()) {
+ // Quickly jump through to the office:body node
+ while ($xml->name !== 'office:body') {
+ if ($xml->isEmptyElement) {
+ $xml->read();
+ } else {
+ $xml->next();
+ }
+ }
+ // Now read each node until we find our first table:table node
+ while ($xml->read()) {
+ if ($xml->name == 'table:table' && $xml->nodeType == XMLReader::ELEMENT) {
+ // Loop through each table:table node reading the table:name attribute for each worksheet name
+ do {
+ $worksheetNames[] = $xml->getAttribute('table:name');
+ $xml->next();
+ } while ($xml->name == 'table:table' && $xml->nodeType == XMLReader::ELEMENT);
+ }
+ }
+ }
+
+ return $worksheetNames;
+ }
+
+ /**
+ * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
+ *
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return array
+ */
+ public function listWorksheetInfo($pFilename)
+ {
+ File::assertFile($pFilename);
+
+ $worksheetInfo = [];
+
+ $zip = new ZipArchive();
+ if (!$zip->open($pFilename)) {
+ throw new Exception('Could not open ' . $pFilename . ' for reading! Error opening file.');
+ }
+
+ $xml = new XMLReader();
+ $xml->xml(
+ $this->securityScanner->scanFile('zip://' . realpath($pFilename) . '#content.xml'),
+ null,
+ Settings::getLibXmlLoaderOptions()
+ );
+ $xml->setParserProperty(2, true);
+
+ // Step into the first level of content of the XML
+ $xml->read();
+ while ($xml->read()) {
+ // Quickly jump through to the office:body node
+ while ($xml->name !== 'office:body') {
+ if ($xml->isEmptyElement) {
+ $xml->read();
+ } else {
+ $xml->next();
+ }
+ }
+ // Now read each node until we find our first table:table node
+ while ($xml->read()) {
+ if ($xml->name == 'table:table' && $xml->nodeType == XMLReader::ELEMENT) {
+ $worksheetNames[] = $xml->getAttribute('table:name');
+
+ $tmpInfo = [
+ 'worksheetName' => $xml->getAttribute('table:name'),
+ 'lastColumnLetter' => 'A',
+ 'lastColumnIndex' => 0,
+ 'totalRows' => 0,
+ 'totalColumns' => 0,
+ ];
+
+ // Loop through each child node of the table:table element reading
+ $currCells = 0;
+ do {
+ $xml->read();
+ if ($xml->name == 'table:table-row' && $xml->nodeType == XMLReader::ELEMENT) {
+ $rowspan = $xml->getAttribute('table:number-rows-repeated');
+ $rowspan = empty($rowspan) ? 1 : $rowspan;
+ $tmpInfo['totalRows'] += $rowspan;
+ $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells);
+ $currCells = 0;
+ // Step into the row
+ $xml->read();
+ do {
+ if ($xml->name == 'table:table-cell' && $xml->nodeType == XMLReader::ELEMENT) {
+ if (!$xml->isEmptyElement) {
+ ++$currCells;
+ $xml->next();
+ } else {
+ $xml->read();
+ }
+ } elseif ($xml->name == 'table:covered-table-cell' && $xml->nodeType == XMLReader::ELEMENT) {
+ $mergeSize = $xml->getAttribute('table:number-columns-repeated');
+ $currCells += (int) $mergeSize;
+ $xml->read();
+ } else {
+ $xml->read();
+ }
+ } while ($xml->name != 'table:table-row');
+ }
+ } while ($xml->name != 'table:table');
+
+ $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells);
+ $tmpInfo['lastColumnIndex'] = $tmpInfo['totalColumns'] - 1;
+ $tmpInfo['lastColumnLetter'] = Coordinate::stringFromColumnIndex($tmpInfo['lastColumnIndex'] + 1);
+ $worksheetInfo[] = $tmpInfo;
+ }
+ }
+ }
+
+ return $worksheetInfo;
+ }
+
+ /**
+ * Loads PhpSpreadsheet from file.
+ *
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return Spreadsheet
+ */
+ public function load($pFilename)
+ {
+ // Create new Spreadsheet
+ $spreadsheet = new Spreadsheet();
+
+ // Load into this instance
+ return $this->loadIntoExisting($pFilename, $spreadsheet);
+ }
+
+ /**
+ * Loads PhpSpreadsheet from file into PhpSpreadsheet instance.
+ *
+ * @param string $pFilename
+ * @param Spreadsheet $spreadsheet
+ *
+ * @throws Exception
+ *
+ * @return Spreadsheet
+ */
+ public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet)
+ {
+ File::assertFile($pFilename);
+
+ $timezoneObj = new DateTimeZone('Europe/London');
+ $GMT = new \DateTimeZone('UTC');
+
+ $zip = new ZipArchive();
+ if (!$zip->open($pFilename)) {
+ throw new Exception('Could not open ' . $pFilename . ' for reading! Error opening file.');
+ }
+
+ // Meta
+
+ $xml = simplexml_load_string(
+ $this->securityScanner->scan($zip->getFromName('meta.xml')),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ $namespacesMeta = $xml->getNamespaces(true);
+
+ $docProps = $spreadsheet->getProperties();
+ $officeProperty = $xml->children($namespacesMeta['office']);
+ foreach ($officeProperty as $officePropertyData) {
+ $officePropertyDC = [];
+ if (isset($namespacesMeta['dc'])) {
+ $officePropertyDC = $officePropertyData->children($namespacesMeta['dc']);
+ }
+ foreach ($officePropertyDC as $propertyName => $propertyValue) {
+ $propertyValue = (string) $propertyValue;
+ switch ($propertyName) {
+ case 'title':
+ $docProps->setTitle($propertyValue);
+
+ break;
+ case 'subject':
+ $docProps->setSubject($propertyValue);
+
+ break;
+ case 'creator':
+ $docProps->setCreator($propertyValue);
+ $docProps->setLastModifiedBy($propertyValue);
+
+ break;
+ case 'date':
+ $creationDate = strtotime($propertyValue);
+ $docProps->setCreated($creationDate);
+ $docProps->setModified($creationDate);
+
+ break;
+ case 'description':
+ $docProps->setDescription($propertyValue);
+
+ break;
+ }
+ }
+ $officePropertyMeta = [];
+ if (isset($namespacesMeta['dc'])) {
+ $officePropertyMeta = $officePropertyData->children($namespacesMeta['meta']);
+ }
+ foreach ($officePropertyMeta as $propertyName => $propertyValue) {
+ $propertyValueAttributes = $propertyValue->attributes($namespacesMeta['meta']);
+ $propertyValue = (string) $propertyValue;
+ switch ($propertyName) {
+ case 'initial-creator':
+ $docProps->setCreator($propertyValue);
+
+ break;
+ case 'keyword':
+ $docProps->setKeywords($propertyValue);
+
+ break;
+ case 'creation-date':
+ $creationDate = strtotime($propertyValue);
+ $docProps->setCreated($creationDate);
+
+ break;
+ case 'user-defined':
+ $propertyValueType = Properties::PROPERTY_TYPE_STRING;
+ foreach ($propertyValueAttributes as $key => $value) {
+ if ($key == 'name') {
+ $propertyValueName = (string) $value;
+ } elseif ($key == 'value-type') {
+ switch ($value) {
+ case 'date':
+ $propertyValue = Properties::convertProperty($propertyValue, 'date');
+ $propertyValueType = Properties::PROPERTY_TYPE_DATE;
+
+ break;
+ case 'boolean':
+ $propertyValue = Properties::convertProperty($propertyValue, 'bool');
+ $propertyValueType = Properties::PROPERTY_TYPE_BOOLEAN;
+
+ break;
+ case 'float':
+ $propertyValue = Properties::convertProperty($propertyValue, 'r4');
+ $propertyValueType = Properties::PROPERTY_TYPE_FLOAT;
+
+ break;
+ default:
+ $propertyValueType = Properties::PROPERTY_TYPE_STRING;
+ }
+ }
+ }
+ $docProps->setCustomProperty($propertyValueName, $propertyValue, $propertyValueType);
+
+ break;
+ }
+ }
+ }
+
+ // Content
+
+ $dom = new \DOMDocument('1.01', 'UTF-8');
+ $dom->loadXML(
+ $this->securityScanner->scan($zip->getFromName('content.xml')),
+ Settings::getLibXmlLoaderOptions()
+ );
+
+ $officeNs = $dom->lookupNamespaceUri('office');
+ $tableNs = $dom->lookupNamespaceUri('table');
+ $textNs = $dom->lookupNamespaceUri('text');
+ $xlinkNs = $dom->lookupNamespaceUri('xlink');
+
+ $spreadsheets = $dom->getElementsByTagNameNS($officeNs, 'body')
+ ->item(0)
+ ->getElementsByTagNameNS($officeNs, 'spreadsheet');
+
+ foreach ($spreadsheets as $workbookData) {
+ /** @var \DOMElement $workbookData */
+ $tables = $workbookData->getElementsByTagNameNS($tableNs, 'table');
+
+ $worksheetID = 0;
+ foreach ($tables as $worksheetDataSet) {
+ /** @var \DOMElement $worksheetDataSet */
+ $worksheetName = $worksheetDataSet->getAttributeNS($tableNs, 'name');
+
+ // Check loadSheetsOnly
+ if (isset($this->loadSheetsOnly)
+ && $worksheetName
+ && !in_array($worksheetName, $this->loadSheetsOnly)) {
+ continue;
+ }
+
+ // Create sheet
+ if ($worksheetID > 0) {
+ $spreadsheet->createSheet(); // First sheet is added by default
+ }
+ $spreadsheet->setActiveSheetIndex($worksheetID);
+
+ if ($worksheetName) {
+ // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in
+ // formula cells... during the load, all formulae should be correct, and we're simply
+ // bringing the worksheet name in line with the formula, not the reverse
+ $spreadsheet->getActiveSheet()->setTitle($worksheetName, false, false);
+ }
+
+ // Go through every child of table element
+ $rowID = 1;
+ foreach ($worksheetDataSet->childNodes as $childNode) {
+ /** @var \DOMElement $childNode */
+
+ // Filter elements which are not under the "table" ns
+ if ($childNode->namespaceURI != $tableNs) {
+ continue;
+ }
+
+ $key = $childNode->nodeName;
+
+ // Remove ns from node name
+ if (strpos($key, ':') !== false) {
+ $keyChunks = explode(':', $key);
+ $key = array_pop($keyChunks);
+ }
+
+ switch ($key) {
+ case 'table-header-rows':
+ /// TODO :: Figure this out. This is only a partial implementation I guess.
+ // ($rowData it's not used at all and I'm not sure that PHPExcel
+ // has an API for this)
+
+// foreach ($rowData as $keyRowData => $cellData) {
+// $rowData = $cellData;
+// break;
+// }
+ break;
+ case 'table-row':
+ if ($childNode->hasAttributeNS($tableNs, 'number-rows-repeated')) {
+ $rowRepeats = $childNode->getAttributeNS($tableNs, 'number-rows-repeated');
+ } else {
+ $rowRepeats = 1;
+ }
+
+ $columnID = 'A';
+ foreach ($childNode->childNodes as $key => $cellData) {
+ // @var \DOMElement $cellData
+
+ if ($this->getReadFilter() !== null) {
+ if (!$this->getReadFilter()->readCell($columnID, $rowID, $worksheetName)) {
+ ++$columnID;
+
+ continue;
+ }
+ }
+
+ // Initialize variables
+ $formatting = $hyperlink = null;
+ $hasCalculatedValue = false;
+ $cellDataFormula = '';
+
+ if ($cellData->hasAttributeNS($tableNs, 'formula')) {
+ $cellDataFormula = $cellData->getAttributeNS($tableNs, 'formula');
+ $hasCalculatedValue = true;
+ }
+
+ // Annotations
+ $annotation = $cellData->getElementsByTagNameNS($officeNs, 'annotation');
+
+ if ($annotation->length > 0) {
+ $textNode = $annotation->item(0)->getElementsByTagNameNS($textNs, 'p');
+
+ if ($textNode->length > 0) {
+ $text = $this->scanElementForText($textNode->item(0));
+
+ $spreadsheet->getActiveSheet()
+ ->getComment($columnID . $rowID)
+ ->setText($this->parseRichText($text));
+// ->setAuthor( $author )
+ }
+ }
+
+ // Content
+
+ /** @var \DOMElement[] $paragraphs */
+ $paragraphs = [];
+
+ foreach ($cellData->childNodes as $item) {
+ /** @var \DOMElement $item */
+
+ // Filter text:p elements
+ if ($item->nodeName == 'text:p') {
+ $paragraphs[] = $item;
+ }
+ }
+
+ if (count($paragraphs) > 0) {
+ // Consolidate if there are multiple p records (maybe with spans as well)
+ $dataArray = [];
+
+ // Text can have multiple text:p and within those, multiple text:span.
+ // text:p newlines, but text:span does not.
+ // Also, here we assume there is no text data is span fields are specified, since
+ // we have no way of knowing proper positioning anyway.
+
+ foreach ($paragraphs as $pData) {
+ $dataArray[] = $this->scanElementForText($pData);
+ }
+ $allCellDataText = implode($dataArray, "\n");
+
+ $type = $cellData->getAttributeNS($officeNs, 'value-type');
+
+ switch ($type) {
+ case 'string':
+ $type = DataType::TYPE_STRING;
+ $dataValue = $allCellDataText;
+
+ foreach ($paragraphs as $paragraph) {
+ $link = $paragraph->getElementsByTagNameNS($textNs, 'a');
+ if ($link->length > 0) {
+ $hyperlink = $link->item(0)->getAttributeNS($xlinkNs, 'href');
+ }
+ }
+
+ break;
+ case 'boolean':
+ $type = DataType::TYPE_BOOL;
+ $dataValue = ($allCellDataText == 'TRUE') ? true : false;
+
+ break;
+ case 'percentage':
+ $type = DataType::TYPE_NUMERIC;
+ $dataValue = (float) $cellData->getAttributeNS($officeNs, 'value');
+
+ if (floor($dataValue) == $dataValue) {
+ $dataValue = (int) $dataValue;
+ }
+ $formatting = NumberFormat::FORMAT_PERCENTAGE_00;
+
+ break;
+ case 'currency':
+ $type = DataType::TYPE_NUMERIC;
+ $dataValue = (float) $cellData->getAttributeNS($officeNs, 'value');
+
+ if (floor($dataValue) == $dataValue) {
+ $dataValue = (int) $dataValue;
+ }
+ $formatting = NumberFormat::FORMAT_CURRENCY_USD_SIMPLE;
+
+ break;
+ case 'float':
+ $type = DataType::TYPE_NUMERIC;
+ $dataValue = (float) $cellData->getAttributeNS($officeNs, 'value');
+
+ if (floor($dataValue) == $dataValue) {
+ if ($dataValue == (int) $dataValue) {
+ $dataValue = (int) $dataValue;
+ } else {
+ $dataValue = (float) $dataValue;
+ }
+ }
+
+ break;
+ case 'date':
+ $type = DataType::TYPE_NUMERIC;
+ $value = $cellData->getAttributeNS($officeNs, 'date-value');
+
+ $dateObj = new DateTime($value, $GMT);
+ $dateObj->setTimeZone($timezoneObj);
+ list($year, $month, $day, $hour, $minute, $second) = explode(
+ ' ',
+ $dateObj->format('Y m d H i s')
+ );
+
+ $dataValue = Date::formattedPHPToExcel(
+ $year,
+ $month,
+ $day,
+ $hour,
+ $minute,
+ $second
+ );
+
+ if ($dataValue != floor($dataValue)) {
+ $formatting = NumberFormat::FORMAT_DATE_XLSX15
+ . ' '
+ . NumberFormat::FORMAT_DATE_TIME4;
+ } else {
+ $formatting = NumberFormat::FORMAT_DATE_XLSX15;
+ }
+
+ break;
+ case 'time':
+ $type = DataType::TYPE_NUMERIC;
+
+ $timeValue = $cellData->getAttributeNS($officeNs, 'time-value');
+
+ $dataValue = Date::PHPToExcel(
+ strtotime(
+ '01-01-1970 ' . implode(':', sscanf($timeValue, 'PT%dH%dM%dS'))
+ )
+ );
+ $formatting = NumberFormat::FORMAT_DATE_TIME4;
+
+ break;
+ default:
+ $dataValue = null;
+ }
+ } else {
+ $type = DataType::TYPE_NULL;
+ $dataValue = null;
+ }
+
+ if ($hasCalculatedValue) {
+ $type = DataType::TYPE_FORMULA;
+ $cellDataFormula = substr($cellDataFormula, strpos($cellDataFormula, ':=') + 1);
+ $temp = explode('"', $cellDataFormula);
+ $tKey = false;
+ foreach ($temp as &$value) {
+ // Only replace in alternate array entries (i.e. non-quoted blocks)
+ if ($tKey = !$tKey) {
+ // Cell range reference in another sheet
+ $value = preg_replace('/\[([^\.]+)\.([^\.]+):\.([^\.]+)\]/U', '$1!$2:$3', $value);
+
+ // Cell reference in another sheet
+ $value = preg_replace('/\[([^\.]+)\.([^\.]+)\]/U', '$1!$2', $value);
+
+ // Cell range reference
+ $value = preg_replace('/\[\.([^\.]+):\.([^\.]+)\]/U', '$1:$2', $value);
+
+ // Simple cell reference
+ $value = preg_replace('/\[\.([^\.]+)\]/U', '$1', $value);
+
+ $value = Calculation::translateSeparator(';', ',', $value, $inBraces);
+ }
+ }
+ unset($value);
+
+ // Then rebuild the formula string
+ $cellDataFormula = implode('"', $temp);
+ }
+
+ if ($cellData->hasAttributeNS($tableNs, 'number-columns-repeated')) {
+ $colRepeats = (int) $cellData->getAttributeNS($tableNs, 'number-columns-repeated');
+ } else {
+ $colRepeats = 1;
+ }
+
+ if ($type !== null) {
+ for ($i = 0; $i < $colRepeats; ++$i) {
+ if ($i > 0) {
+ ++$columnID;
+ }
+
+ if ($type !== DataType::TYPE_NULL) {
+ for ($rowAdjust = 0; $rowAdjust < $rowRepeats; ++$rowAdjust) {
+ $rID = $rowID + $rowAdjust;
+
+ $cell = $spreadsheet->getActiveSheet()
+ ->getCell($columnID . $rID);
+
+ // Set value
+ if ($hasCalculatedValue) {
+ $cell->setValueExplicit($cellDataFormula, $type);
+ } else {
+ $cell->setValueExplicit($dataValue, $type);
+ }
+
+ if ($hasCalculatedValue) {
+ $cell->setCalculatedValue($dataValue);
+ }
+
+ // Set other properties
+ if ($formatting !== null) {
+ $spreadsheet->getActiveSheet()
+ ->getStyle($columnID . $rID)
+ ->getNumberFormat()
+ ->setFormatCode($formatting);
+ } else {
+ $spreadsheet->getActiveSheet()
+ ->getStyle($columnID . $rID)
+ ->getNumberFormat()
+ ->setFormatCode(NumberFormat::FORMAT_GENERAL);
+ }
+
+ if ($hyperlink !== null) {
+ $cell->getHyperlink()
+ ->setUrl($hyperlink);
+ }
+ }
+ }
+ }
+ }
+
+ // Merged cells
+ if ($cellData->hasAttributeNS($tableNs, 'number-columns-spanned')
+ || $cellData->hasAttributeNS($tableNs, 'number-rows-spanned')
+ ) {
+ if (($type !== DataType::TYPE_NULL) || (!$this->readDataOnly)) {
+ $columnTo = $columnID;
+
+ if ($cellData->hasAttributeNS($tableNs, 'number-columns-spanned')) {
+ $columnIndex = Coordinate::columnIndexFromString($columnID);
+ $columnIndex += (int) $cellData->getAttributeNS($tableNs, 'number-columns-spanned');
+ $columnIndex -= 2;
+
+ $columnTo = Coordinate::stringFromColumnIndex($columnIndex + 1);
+ }
+
+ $rowTo = $rowID;
+
+ if ($cellData->hasAttributeNS($tableNs, 'number-rows-spanned')) {
+ $rowTo = $rowTo + (int) $cellData->getAttributeNS($tableNs, 'number-rows-spanned') - 1;
+ }
+
+ $cellRange = $columnID . $rowID . ':' . $columnTo . $rowTo;
+ $spreadsheet->getActiveSheet()->mergeCells($cellRange);
+ }
+ }
+
+ ++$columnID;
+ }
+ $rowID += $rowRepeats;
+
+ break;
+ }
+ }
+ ++$worksheetID;
+ }
+ }
+
+ // Return
+ return $spreadsheet;
+ }
+
+ /**
+ * Recursively scan element.
+ *
+ * @param \DOMNode $element
+ *
+ * @return string
+ */
+ protected function scanElementForText(\DOMNode $element)
+ {
+ $str = '';
+ foreach ($element->childNodes as $child) {
+ /** @var \DOMNode $child */
+ if ($child->nodeType == XML_TEXT_NODE) {
+ $str .= $child->nodeValue;
+ } elseif ($child->nodeType == XML_ELEMENT_NODE && $child->nodeName == 'text:s') {
+ // It's a space
+
+ // Multiple spaces?
+ /** @var \DOMAttr $cAttr */
+ $cAttr = $child->attributes->getNamedItem('c');
+ if ($cAttr) {
+ $multiplier = (int) $cAttr->nodeValue;
+ } else {
+ $multiplier = 1;
+ }
+
+ $str .= str_repeat(' ', $multiplier);
+ }
+
+ if ($child->hasChildNodes()) {
+ $str .= $this->scanElementForText($child);
+ }
+ }
+
+ return $str;
+ }
+
+ /**
+ * @param string $is
+ *
+ * @return RichText
+ */
+ private function parseRichText($is)
+ {
+ $value = new RichText();
+ $value->createText($is);
+
+ return $value;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Security/XmlScanner.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Security/XmlScanner.php
new file mode 100644
index 00000000000..b5f7ac60fdc
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Security/XmlScanner.php
@@ -0,0 +1,125 @@
+pattern = $pattern;
+ $this->libxmlDisableEntityLoader = $this->identifyLibxmlDisableEntityLoaderAvailability();
+ }
+
+ public static function getInstance(Reader\IReader $reader)
+ {
+ switch (true) {
+ case $reader instanceof Reader\Html:
+ return new self('= 1;
+ case 1:
+ return PHP_RELEASE_VERSION >= 13;
+ case 0:
+ return PHP_RELEASE_VERSION >= 27;
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ public function setAdditionalCallback(callable $callback)
+ {
+ $this->callback = $callback;
+ }
+
+ /**
+ * Scan the XML for use of libxmlDisableEntityLoader) {
+ $previousLibxmlDisableEntityLoaderValue = libxml_disable_entity_loader(true);
+ }
+
+ $pattern = '/encoding="(.*?)"/';
+ $result = preg_match($pattern, $xml, $matches);
+ $charset = $result ? $matches[1] : 'UTF-8';
+
+ if ($charset !== 'UTF-8') {
+ $xml = mb_convert_encoding($xml, 'UTF-8', $charset);
+ }
+
+ // Don't rely purely on libxml_disable_entity_loader()
+ $pattern = '/\\0?' . implode('\\0?', str_split($this->pattern)) . '\\0?/';
+
+ try {
+ if (preg_match($pattern, $xml)) {
+ throw new Reader\Exception('Detected use of ENTITY in XML, spreadsheet file load() aborted to prevent XXE/XEE attacks');
+ }
+
+ if ($this->callback !== null && is_callable($this->callback)) {
+ $xml = call_user_func($this->callback, $xml);
+ }
+ } finally {
+ if (isset($previousLibxmlDisableEntityLoaderValue)) {
+ libxml_disable_entity_loader($previousLibxmlDisableEntityLoaderValue);
+ }
+ }
+
+ return $xml;
+ }
+
+ /**
+ * Scan theXML for use of scan(file_get_contents($filestream));
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Reader/SYLK.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Slk.php
similarity index 64%
rename from lib/phpexcel/PHPExcel/Reader/SYLK.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Slk.php
index eb7ef1afba4..61e52334b5c 100644
--- a/lib/phpexcel/PHPExcel/Reader/SYLK.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Slk.php
@@ -1,115 +1,99 @@
readFilter = new PHPExcel_Reader_DefaultReadFilter();
+ $this->readFilter = new DefaultReadFilter();
}
/**
- * Validate that the current file is a SYLK file
+ * Validate that the current file is a SYLK file.
*
- * @return boolean
+ * @param string $pFilename
+ *
+ * @return bool
*/
- protected function isValidFormat()
+ public function canRead($pFilename)
{
+ // Check if file exists
+ try {
+ $this->openFile($pFilename);
+ } catch (Exception $e) {
+ return false;
+ }
+
// Read sample data (first 2 KB will do)
$data = fread($this->fileHandle, 2048);
// Count delimiters in file
$delimiterCount = substr_count($data, ';');
- if ($delimiterCount < 1) {
- return false;
- }
+ $hasDelimiter = $delimiterCount > 0;
// Analyze first line looking for ID; signature
$lines = explode("\n", $data);
- if (substr($lines[0], 0, 4) != 'ID;P') {
- return false;
- }
+ $hasId = substr($lines[0], 0, 4) === 'ID;P';
- return true;
+ fclose($this->fileHandle);
+
+ return $hasDelimiter && $hasId;
}
/**
- * Set input encoding
+ * Set input encoding.
*
- * @param string $pValue Input encoding
+ * @param string $pValue Input encoding, eg: 'ANSI'
+ *
+ * @return Slk
*/
- public function setInputEncoding($pValue = 'ANSI')
+ public function setInputEncoding($pValue)
{
$this->inputEncoding = $pValue;
+
return $this;
}
/**
- * Get input encoding
+ * Get input encoding.
*
* @return string
*/
@@ -119,39 +103,38 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
}
/**
- * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)
+ * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
*
- * @param string $pFilename
- * @throws PHPExcel_Reader_Exception
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return array
*/
public function listWorksheetInfo($pFilename)
{
// Open file
- $this->openFile($pFilename);
- if (!$this->isValidFormat()) {
- fclose($this->fileHandle);
- throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file.");
+ if (!$this->canRead($pFilename)) {
+ throw new Exception($pFilename . ' is an Invalid Spreadsheet file.');
}
+ $this->openFile($pFilename);
$fileHandle = $this->fileHandle;
rewind($fileHandle);
- $worksheetInfo = array();
+ $worksheetInfo = [];
$worksheetInfo[0]['worksheetName'] = 'Worksheet';
$worksheetInfo[0]['lastColumnLetter'] = 'A';
$worksheetInfo[0]['lastColumnIndex'] = 0;
$worksheetInfo[0]['totalRows'] = 0;
$worksheetInfo[0]['totalColumns'] = 0;
- // Loop through file
- $rowData = array();
-
// loop through one row (line) at a time in the file
$rowIndex = 0;
while (($rowData = fgets($fileHandle)) !== false) {
$columnIndex = 0;
// convert SYLK encoded $rowData to UTF-8
- $rowData = PHPExcel_Shared_String::SYLKtoUTF8($rowData);
+ $rowData = StringHelper::SYLKtoUTF8($rowData);
// explode each row at semicolons while taking into account that literal semicolon (;)
// is escaped like this (;;)
@@ -161,14 +144,16 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
if ($dataType == 'C') {
// Read cell value data
foreach ($rowData as $rowDatum) {
- switch ($rowDatum{0}) {
+ switch ($rowDatum[0]) {
case 'C':
case 'X':
$columnIndex = substr($rowDatum, 1) - 1;
+
break;
case 'R':
case 'Y':
$rowIndex = substr($rowDatum, 1);
+
break;
}
@@ -178,7 +163,7 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
}
}
- $worksheetInfo[0]['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($worksheetInfo[0]['lastColumnIndex']);
+ $worksheetInfo[0]['lastColumnLetter'] = Coordinate::stringFromColumnIndex($worksheetInfo[0]['lastColumnIndex'] + 1);
$worksheetInfo[0]['totalColumns'] = $worksheetInfo[0]['lastColumnIndex'] + 1;
// Close file
@@ -188,57 +173,59 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
}
/**
- * Loads PHPExcel from file
+ * Loads PhpSpreadsheet from file.
*
- * @param string $pFilename
- * @return PHPExcel
- * @throws PHPExcel_Reader_Exception
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return Spreadsheet
*/
public function load($pFilename)
{
- // Create new PHPExcel
- $objPHPExcel = new PHPExcel();
+ // Create new Spreadsheet
+ $spreadsheet = new Spreadsheet();
// Load into this instance
- return $this->loadIntoExisting($pFilename, $objPHPExcel);
+ return $this->loadIntoExisting($pFilename, $spreadsheet);
}
/**
- * Loads PHPExcel from file into PHPExcel instance
+ * Loads PhpSpreadsheet from file into PhpSpreadsheet instance.
*
- * @param string $pFilename
- * @param PHPExcel $objPHPExcel
- * @return PHPExcel
- * @throws PHPExcel_Reader_Exception
+ * @param string $pFilename
+ * @param Spreadsheet $spreadsheet
+ *
+ * @throws Exception
+ *
+ * @return Spreadsheet
*/
- public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
+ public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet)
{
// Open file
- $this->openFile($pFilename);
- if (!$this->isValidFormat()) {
- fclose($this->fileHandle);
- throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file.");
+ if (!$this->canRead($pFilename)) {
+ throw new Exception($pFilename . ' is an Invalid Spreadsheet file.');
}
+ $this->openFile($pFilename);
$fileHandle = $this->fileHandle;
rewind($fileHandle);
- // Create new PHPExcel
- while ($objPHPExcel->getSheetCount() <= $this->sheetIndex) {
- $objPHPExcel->createSheet();
+ // Create new Worksheets
+ while ($spreadsheet->getSheetCount() <= $this->sheetIndex) {
+ $spreadsheet->createSheet();
}
- $objPHPExcel->setActiveSheetIndex($this->sheetIndex);
+ $spreadsheet->setActiveSheetIndex($this->sheetIndex);
- $fromFormats = array('\-', '\ ');
- $toFormats = array('-', ' ');
+ $fromFormats = ['\-', '\ '];
+ $toFormats = ['-', ' '];
// Loop through file
- $rowData = array();
$column = $row = '';
// loop through one row (line) at a time in the file
while (($rowData = fgets($fileHandle)) !== false) {
// convert SYLK encoded $rowData to UTF-8
- $rowData = PHPExcel_Shared_String::SYLKtoUTF8($rowData);
+ $rowData = StringHelper::SYLKtoUTF8($rowData);
// explode each row at semicolons while taking into account that literal semicolon (;)
// is escaped like this (;;)
@@ -247,73 +234,87 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
$dataType = array_shift($rowData);
// Read shared styles
if ($dataType == 'P') {
- $formatArray = array();
+ $formatArray = [];
foreach ($rowData as $rowDatum) {
- switch ($rowDatum{0}) {
+ switch ($rowDatum[0]) {
case 'P':
- $formatArray['numberformat']['code'] = str_replace($fromFormats, $toFormats, substr($rowDatum, 1));
+ $formatArray['numberFormat']['formatCode'] = str_replace($fromFormats, $toFormats, substr($rowDatum, 1));
+
break;
case 'E':
case 'F':
$formatArray['font']['name'] = substr($rowDatum, 1);
+
break;
case 'L':
$formatArray['font']['size'] = substr($rowDatum, 1);
+
break;
case 'S':
$styleSettings = substr($rowDatum, 1);
- for ($i=0; $iformats['P'.$this->format++] = $formatArray;
+ $this->formats['P' . $this->format++] = $formatArray;
// Read cell value data
} elseif ($dataType == 'C') {
$hasCalculatedValue = false;
$cellData = $cellDataFormula = '';
foreach ($rowData as $rowDatum) {
- switch ($rowDatum{0}) {
+ switch ($rowDatum[0]) {
case 'C':
case 'X':
$column = substr($rowDatum, 1);
+
break;
case 'R':
case 'Y':
$row = substr($rowDatum, 1);
+
break;
case 'K':
$cellData = substr($rowDatum, 1);
+
break;
case 'E':
- $cellDataFormula = '='.substr($rowDatum, 1);
+ $cellDataFormula = '=' . substr($rowDatum, 1);
// Convert R1C1 style references to A1 style references (but only when not quoted)
$temp = explode('"', $cellDataFormula);
$key = false;
foreach ($temp as &$value) {
// Only count/replace in alternate array entries
if ($key = !$key) {
- preg_match_all('/(R(\[?-?\d*\]?))(C(\[?-?\d*\]?))/', $value, $cellReferences, PREG_SET_ORDER+PREG_OFFSET_CAPTURE);
+ preg_match_all('/(R(\[?-?\d*\]?))(C(\[?-?\d*\]?))/', $value, $cellReferences, PREG_SET_ORDER + PREG_OFFSET_CAPTURE);
// Reverse the matches array, otherwise all our offsets will become incorrect if we modify our way
// through the formula from left to right. Reversing means that we work right to left.through
// the formula
@@ -327,7 +328,7 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
$rowReference = $row;
}
// Bracketed R references are relative to the current row
- if ($rowReference{0} == '[') {
+ if ($rowReference[0] == '[') {
$rowReference = $row + trim($rowReference, '[]');
}
$columnReference = $cellReference[4][0];
@@ -336,10 +337,10 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
$columnReference = $column;
}
// Bracketed C references are relative to the current column
- if ($columnReference{0} == '[') {
+ if ($columnReference[0] == '[') {
$columnReference = $column + trim($columnReference, '[]');
}
- $A1CellReference = PHPExcel_Cell::stringFromColumnIndex($columnReference-1).$rowReference;
+ $A1CellReference = Coordinate::stringFromColumnIndex($columnReference) . $rowReference;
$value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0]));
}
@@ -349,98 +350,113 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
// Then rebuild the formula string
$cellDataFormula = implode('"', $temp);
$hasCalculatedValue = true;
+
break;
}
}
- $columnLetter = PHPExcel_Cell::stringFromColumnIndex($column-1);
- $cellData = PHPExcel_Calculation::unwrapResult($cellData);
+ $columnLetter = Coordinate::stringFromColumnIndex($column);
+ $cellData = Calculation::unwrapResult($cellData);
// Set cell value
- $objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData);
+ $spreadsheet->getActiveSheet()->getCell($columnLetter . $row)->setValue(($hasCalculatedValue) ? $cellDataFormula : $cellData);
if ($hasCalculatedValue) {
- $cellData = PHPExcel_Calculation::unwrapResult($cellData);
- $objPHPExcel->getActiveSheet()->getCell($columnLetter.$row)->setCalculatedValue($cellData);
+ $cellData = Calculation::unwrapResult($cellData);
+ $spreadsheet->getActiveSheet()->getCell($columnLetter . $row)->setCalculatedValue($cellData);
}
- // Read cell formatting
+ // Read cell formatting
} elseif ($dataType == 'F') {
$formatStyle = $columnWidth = $styleSettings = '';
- $styleData = array();
+ $styleData = [];
foreach ($rowData as $rowDatum) {
- switch ($rowDatum{0}) {
+ switch ($rowDatum[0]) {
case 'C':
case 'X':
$column = substr($rowDatum, 1);
+
break;
case 'R':
case 'Y':
$row = substr($rowDatum, 1);
+
break;
case 'P':
$formatStyle = $rowDatum;
+
break;
case 'W':
list($startCol, $endCol, $columnWidth) = explode(' ', substr($rowDatum, 1));
+
break;
case 'S':
$styleSettings = substr($rowDatum, 1);
- for ($i=0; $i '') && ($column > '') && ($row > '')) {
- $columnLetter = PHPExcel_Cell::stringFromColumnIndex($column-1);
+ $columnLetter = Coordinate::stringFromColumnIndex($column);
if (isset($this->formats[$formatStyle])) {
- $objPHPExcel->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($this->formats[$formatStyle]);
+ $spreadsheet->getActiveSheet()->getStyle($columnLetter . $row)->applyFromArray($this->formats[$formatStyle]);
}
}
if ((!empty($styleData)) && ($column > '') && ($row > '')) {
- $columnLetter = PHPExcel_Cell::stringFromColumnIndex($column-1);
- $objPHPExcel->getActiveSheet()->getStyle($columnLetter.$row)->applyFromArray($styleData);
+ $columnLetter = Coordinate::stringFromColumnIndex($column);
+ $spreadsheet->getActiveSheet()->getStyle($columnLetter . $row)->applyFromArray($styleData);
}
if ($columnWidth > '') {
if ($startCol == $endCol) {
- $startCol = PHPExcel_Cell::stringFromColumnIndex($startCol-1);
- $objPHPExcel->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth);
+ $startCol = Coordinate::stringFromColumnIndex($startCol);
+ $spreadsheet->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth);
} else {
- $startCol = PHPExcel_Cell::stringFromColumnIndex($startCol-1);
- $endCol = PHPExcel_Cell::stringFromColumnIndex($endCol-1);
- $objPHPExcel->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth);
+ $startCol = Coordinate::stringFromColumnIndex($startCol);
+ $endCol = Coordinate::stringFromColumnIndex($endCol);
+ $spreadsheet->getActiveSheet()->getColumnDimension($startCol)->setWidth($columnWidth);
do {
- $objPHPExcel->getActiveSheet()->getColumnDimension(++$startCol)->setWidth($columnWidth);
+ $spreadsheet->getActiveSheet()->getColumnDimension(++$startCol)->setWidth($columnWidth);
} while ($startCol != $endCol);
}
}
} else {
foreach ($rowData as $rowDatum) {
- switch ($rowDatum{0}) {
+ switch ($rowDatum[0]) {
case 'C':
case 'X':
$column = substr($rowDatum, 1);
+
break;
case 'R':
case 'Y':
$row = substr($rowDatum, 1);
+
break;
}
}
@@ -451,11 +467,11 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
fclose($fileHandle);
// Return
- return $objPHPExcel;
+ return $spreadsheet;
}
/**
- * Get sheet index
+ * Get sheet index.
*
* @return int
*/
@@ -465,14 +481,16 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
}
/**
- * Set sheet index
+ * Set sheet index.
*
- * @param int $pValue Sheet index
- * @return PHPExcel_Reader_SYLK
+ * @param int $pValue Sheet index
+ *
+ * @return Slk
*/
- public function setSheetIndex($pValue = 0)
+ public function setSheetIndex($pValue)
{
$this->sheetIndex = $pValue;
+
return $this;
}
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php
new file mode 100644
index 00000000000..cbf3fedca9f
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx.php
@@ -0,0 +1,2609 @@
+readFilter = new DefaultReadFilter();
+ $this->referenceHelper = ReferenceHelper::getInstance();
+ $this->securityScanner = XmlScanner::getInstance($this);
+ }
+
+ /**
+ * Can the current IReader read the file?
+ *
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return bool
+ */
+ public function canRead($pFilename)
+ {
+ File::assertFile($pFilename);
+
+ $xl = false;
+ // Load file
+ $zip = new ZipArchive();
+ if ($zip->open($pFilename) === true) {
+ // check if it is an OOXML archive
+ $rels = simplexml_load_string(
+ $this->securityScanner->scan(
+ $this->getFromZipArchive($zip, '_rels/.rels')
+ ),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ if ($rels !== false) {
+ foreach ($rels->Relationship as $rel) {
+ switch ($rel['Type']) {
+ case 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument':
+ if (basename($rel['Target']) == 'workbook.xml') {
+ $xl = true;
+ }
+
+ break;
+ }
+ }
+ }
+ $zip->close();
+ }
+
+ return $xl;
+ }
+
+ /**
+ * Reads names of the worksheets from a file, without parsing the whole file to a Spreadsheet object.
+ *
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return array
+ */
+ public function listWorksheetNames($pFilename)
+ {
+ File::assertFile($pFilename);
+
+ $worksheetNames = [];
+
+ $zip = new ZipArchive();
+ $zip->open($pFilename);
+
+ // The files we're looking at here are small enough that simpleXML is more efficient than XMLReader
+ //~ http://schemas.openxmlformats.org/package/2006/relationships");
+ $rels = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, '_rels/.rels'))
+ );
+ foreach ($rels->Relationship as $rel) {
+ switch ($rel['Type']) {
+ case 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument':
+ //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"
+ $xmlWorkbook = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, "{$rel['Target']}"))
+ );
+
+ if ($xmlWorkbook->sheets) {
+ foreach ($xmlWorkbook->sheets->sheet as $eleSheet) {
+ // Check if sheet should be skipped
+ $worksheetNames[] = (string) $eleSheet['name'];
+ }
+ }
+ }
+ }
+
+ $zip->close();
+
+ return $worksheetNames;
+ }
+
+ /**
+ * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
+ *
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return array
+ */
+ public function listWorksheetInfo($pFilename)
+ {
+ File::assertFile($pFilename);
+
+ $worksheetInfo = [];
+
+ $zip = new ZipArchive();
+ $zip->open($pFilename);
+
+ //~ http://schemas.openxmlformats.org/package/2006/relationships"
+ $rels = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, '_rels/.rels')),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ foreach ($rels->Relationship as $rel) {
+ if ($rel['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument') {
+ $dir = dirname($rel['Target']);
+
+ //~ http://schemas.openxmlformats.org/package/2006/relationships"
+ $relsWorkbook = simplexml_load_string(
+ $this->securityScanner->scan(
+ $this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel['Target']) . '.rels')
+ ),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ $relsWorkbook->registerXPathNamespace('rel', 'http://schemas.openxmlformats.org/package/2006/relationships');
+
+ $worksheets = [];
+ foreach ($relsWorkbook->Relationship as $ele) {
+ if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet') {
+ $worksheets[(string) $ele['Id']] = $ele['Target'];
+ }
+ }
+
+ //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"
+ $xmlWorkbook = simplexml_load_string(
+ $this->securityScanner->scan(
+ $this->getFromZipArchive($zip, "{$rel['Target']}")
+ ),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ if ($xmlWorkbook->sheets) {
+ $dir = dirname($rel['Target']);
+ /** @var SimpleXMLElement $eleSheet */
+ foreach ($xmlWorkbook->sheets->sheet as $eleSheet) {
+ $tmpInfo = [
+ 'worksheetName' => (string) $eleSheet['name'],
+ 'lastColumnLetter' => 'A',
+ 'lastColumnIndex' => 0,
+ 'totalRows' => 0,
+ 'totalColumns' => 0,
+ ];
+
+ $fileWorksheet = $worksheets[(string) self::getArrayItem($eleSheet->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'), 'id')];
+
+ $xml = new XMLReader();
+ $xml->xml(
+ $this->securityScanner->scanFile(
+ 'zip://' . File::realpath($pFilename) . '#' . "$dir/$fileWorksheet"
+ ),
+ null,
+ Settings::getLibXmlLoaderOptions()
+ );
+ $xml->setParserProperty(2, true);
+
+ $currCells = 0;
+ while ($xml->read()) {
+ if ($xml->name == 'row' && $xml->nodeType == XMLReader::ELEMENT) {
+ $row = $xml->getAttribute('r');
+ $tmpInfo['totalRows'] = $row;
+ $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells);
+ $currCells = 0;
+ } elseif ($xml->name == 'c' && $xml->nodeType == XMLReader::ELEMENT) {
+ ++$currCells;
+ }
+ }
+ $tmpInfo['totalColumns'] = max($tmpInfo['totalColumns'], $currCells);
+ $xml->close();
+
+ $tmpInfo['lastColumnIndex'] = $tmpInfo['totalColumns'] - 1;
+ $tmpInfo['lastColumnLetter'] = Coordinate::stringFromColumnIndex($tmpInfo['lastColumnIndex'] + 1);
+
+ $worksheetInfo[] = $tmpInfo;
+ }
+ }
+ }
+ }
+
+ $zip->close();
+
+ return $worksheetInfo;
+ }
+
+ private static function castToBoolean($c)
+ {
+ $value = isset($c->v) ? (string) $c->v : null;
+ if ($value == '0') {
+ return false;
+ } elseif ($value == '1') {
+ return true;
+ }
+
+ return (bool) $c->v;
+ }
+
+ private static function castToError($c)
+ {
+ return isset($c->v) ? (string) $c->v : null;
+ }
+
+ private static function castToString($c)
+ {
+ return isset($c->v) ? (string) $c->v : null;
+ }
+
+ private function castToFormula($c, $r, &$cellDataType, &$value, &$calculatedValue, &$sharedFormulas, $castBaseType)
+ {
+ $cellDataType = 'f';
+ $value = "={$c->f}";
+ $calculatedValue = self::$castBaseType($c);
+
+ // Shared formula?
+ if (isset($c->f['t']) && strtolower((string) $c->f['t']) == 'shared') {
+ $instance = (string) $c->f['si'];
+
+ if (!isset($sharedFormulas[(string) $c->f['si']])) {
+ $sharedFormulas[$instance] = ['master' => $r, 'formula' => $value];
+ } else {
+ $master = Coordinate::coordinateFromString($sharedFormulas[$instance]['master']);
+ $current = Coordinate::coordinateFromString($r);
+
+ $difference = [0, 0];
+ $difference[0] = Coordinate::columnIndexFromString($current[0]) - Coordinate::columnIndexFromString($master[0]);
+ $difference[1] = $current[1] - $master[1];
+
+ $value = $this->referenceHelper->updateFormulaReferences($sharedFormulas[$instance]['formula'], 'A1', $difference[0], $difference[1]);
+ }
+ }
+ }
+
+ /**
+ * @param ZipArchive $archive
+ * @param string $fileName
+ *
+ * @return string
+ */
+ private function getFromZipArchive(ZipArchive $archive, $fileName = '')
+ {
+ // Root-relative paths
+ if (strpos($fileName, '//') !== false) {
+ $fileName = substr($fileName, strpos($fileName, '//') + 1);
+ }
+ $fileName = File::realpath($fileName);
+
+ // Sadly, some 3rd party xlsx generators don't use consistent case for filenaming
+ // so we need to load case-insensitively from the zip file
+
+ // Apache POI fixes
+ $contents = $archive->getFromName($fileName, 0, ZipArchive::FL_NOCASE);
+ if ($contents === false) {
+ $contents = $archive->getFromName(substr($fileName, 1), 0, ZipArchive::FL_NOCASE);
+ }
+
+ return $contents;
+ }
+
+ /**
+ * Set Worksheet column attributes by attributes array passed.
+ *
+ * @param Worksheet $docSheet
+ * @param string $column A, B, ... DX, ...
+ * @param array $columnAttributes array of attributes (indexes are attribute name, values are value)
+ * 'xfIndex', 'visible', 'collapsed', 'outlineLevel', 'width', ... ?
+ */
+ private function setColumnAttributes(Worksheet $docSheet, $column, array $columnAttributes)
+ {
+ if (isset($columnAttributes['xfIndex'])) {
+ $docSheet->getColumnDimension($column)->setXfIndex($columnAttributes['xfIndex']);
+ }
+ if (isset($columnAttributes['visible'])) {
+ $docSheet->getColumnDimension($column)->setVisible($columnAttributes['visible']);
+ }
+ if (isset($columnAttributes['collapsed'])) {
+ $docSheet->getColumnDimension($column)->setCollapsed($columnAttributes['collapsed']);
+ }
+ if (isset($columnAttributes['outlineLevel'])) {
+ $docSheet->getColumnDimension($column)->setOutlineLevel($columnAttributes['outlineLevel']);
+ }
+ if (isset($columnAttributes['width'])) {
+ $docSheet->getColumnDimension($column)->setWidth($columnAttributes['width']);
+ }
+ }
+
+ /**
+ * Set Worksheet row attributes by attributes array passed.
+ *
+ * @param Worksheet $docSheet
+ * @param int $row 1, 2, 3, ... 99, ...
+ * @param array $rowAttributes array of attributes (indexes are attribute name, values are value)
+ * 'xfIndex', 'visible', 'collapsed', 'outlineLevel', 'rowHeight', ... ?
+ */
+ private function setRowAttributes(Worksheet $docSheet, $row, array $rowAttributes)
+ {
+ if (isset($rowAttributes['xfIndex'])) {
+ $docSheet->getRowDimension($row)->setXfIndex($rowAttributes['xfIndex']);
+ }
+ if (isset($rowAttributes['visible'])) {
+ $docSheet->getRowDimension($row)->setVisible($rowAttributes['visible']);
+ }
+ if (isset($rowAttributes['collapsed'])) {
+ $docSheet->getRowDimension($row)->setCollapsed($rowAttributes['collapsed']);
+ }
+ if (isset($rowAttributes['outlineLevel'])) {
+ $docSheet->getRowDimension($row)->setOutlineLevel($rowAttributes['outlineLevel']);
+ }
+ if (isset($rowAttributes['rowHeight'])) {
+ $docSheet->getRowDimension($row)->setRowHeight($rowAttributes['rowHeight']);
+ }
+ }
+
+ /**
+ * Loads Spreadsheet from file.
+ *
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return Spreadsheet
+ */
+ public function load($pFilename)
+ {
+ File::assertFile($pFilename);
+
+ // Initialisations
+ $excel = new Spreadsheet();
+ $excel->removeSheetByIndex(0);
+ if (!$this->readDataOnly) {
+ $excel->removeCellStyleXfByIndex(0); // remove the default style
+ $excel->removeCellXfByIndex(0); // remove the default style
+ }
+ $unparsedLoadedData = [];
+
+ $zip = new ZipArchive();
+ $zip->open($pFilename);
+
+ // Read the theme first, because we need the colour scheme when reading the styles
+ //~ http://schemas.openxmlformats.org/package/2006/relationships"
+ $wbRels = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, 'xl/_rels/workbook.xml.rels')),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ foreach ($wbRels->Relationship as $rel) {
+ switch ($rel['Type']) {
+ case 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme':
+ $themeOrderArray = ['lt1', 'dk1', 'lt2', 'dk2'];
+ $themeOrderAdditional = count($themeOrderArray);
+
+ $xmlTheme = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, "xl/{$rel['Target']}")),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ if (is_object($xmlTheme)) {
+ $xmlThemeName = $xmlTheme->attributes();
+ $xmlTheme = $xmlTheme->children('http://schemas.openxmlformats.org/drawingml/2006/main');
+ $themeName = (string) $xmlThemeName['name'];
+
+ $colourScheme = $xmlTheme->themeElements->clrScheme->attributes();
+ $colourSchemeName = (string) $colourScheme['name'];
+ $colourScheme = $xmlTheme->themeElements->clrScheme->children('http://schemas.openxmlformats.org/drawingml/2006/main');
+
+ $themeColours = [];
+ foreach ($colourScheme as $k => $xmlColour) {
+ $themePos = array_search($k, $themeOrderArray);
+ if ($themePos === false) {
+ $themePos = $themeOrderAdditional++;
+ }
+ if (isset($xmlColour->sysClr)) {
+ $xmlColourData = $xmlColour->sysClr->attributes();
+ $themeColours[$themePos] = $xmlColourData['lastClr'];
+ } elseif (isset($xmlColour->srgbClr)) {
+ $xmlColourData = $xmlColour->srgbClr->attributes();
+ $themeColours[$themePos] = $xmlColourData['val'];
+ }
+ }
+ self::$theme = new Xlsx\Theme($themeName, $colourSchemeName, $themeColours);
+ }
+
+ break;
+ }
+ }
+
+ //~ http://schemas.openxmlformats.org/package/2006/relationships"
+ $rels = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, '_rels/.rels')),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ foreach ($rels->Relationship as $rel) {
+ switch ($rel['Type']) {
+ case 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties':
+ $xmlCore = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, "{$rel['Target']}")),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ if (is_object($xmlCore)) {
+ $xmlCore->registerXPathNamespace('dc', 'http://purl.org/dc/elements/1.1/');
+ $xmlCore->registerXPathNamespace('dcterms', 'http://purl.org/dc/terms/');
+ $xmlCore->registerXPathNamespace('cp', 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties');
+ $docProps = $excel->getProperties();
+ $docProps->setCreator((string) self::getArrayItem($xmlCore->xpath('dc:creator')));
+ $docProps->setLastModifiedBy((string) self::getArrayItem($xmlCore->xpath('cp:lastModifiedBy')));
+ $docProps->setCreated(strtotime(self::getArrayItem($xmlCore->xpath('dcterms:created')))); //! respect xsi:type
+ $docProps->setModified(strtotime(self::getArrayItem($xmlCore->xpath('dcterms:modified')))); //! respect xsi:type
+ $docProps->setTitle((string) self::getArrayItem($xmlCore->xpath('dc:title')));
+ $docProps->setDescription((string) self::getArrayItem($xmlCore->xpath('dc:description')));
+ $docProps->setSubject((string) self::getArrayItem($xmlCore->xpath('dc:subject')));
+ $docProps->setKeywords((string) self::getArrayItem($xmlCore->xpath('cp:keywords')));
+ $docProps->setCategory((string) self::getArrayItem($xmlCore->xpath('cp:category')));
+ }
+
+ break;
+ case 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties':
+ $xmlCore = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, "{$rel['Target']}")),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ if (is_object($xmlCore)) {
+ $docProps = $excel->getProperties();
+ if (isset($xmlCore->Company)) {
+ $docProps->setCompany((string) $xmlCore->Company);
+ }
+ if (isset($xmlCore->Manager)) {
+ $docProps->setManager((string) $xmlCore->Manager);
+ }
+ }
+
+ break;
+ case 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties':
+ $xmlCore = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, "{$rel['Target']}")),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ if (is_object($xmlCore)) {
+ $docProps = $excel->getProperties();
+ /** @var SimpleXMLElement $xmlProperty */
+ foreach ($xmlCore as $xmlProperty) {
+ $cellDataOfficeAttributes = $xmlProperty->attributes();
+ if (isset($cellDataOfficeAttributes['name'])) {
+ $propertyName = (string) $cellDataOfficeAttributes['name'];
+ $cellDataOfficeChildren = $xmlProperty->children('http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes');
+ $attributeType = $cellDataOfficeChildren->getName();
+ $attributeValue = (string) $cellDataOfficeChildren->{$attributeType};
+ $attributeValue = Properties::convertProperty($attributeValue, $attributeType);
+ $attributeType = Properties::convertPropertyType($attributeType);
+ $docProps->setCustomProperty($propertyName, $attributeValue, $attributeType);
+ }
+ }
+ }
+
+ break;
+ //Ribbon
+ case 'http://schemas.microsoft.com/office/2006/relationships/ui/extensibility':
+ $customUI = $rel['Target'];
+ if ($customUI !== null) {
+ $this->readRibbon($excel, $customUI, $zip);
+ }
+
+ break;
+ case 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument':
+ $dir = dirname($rel['Target']);
+ //~ http://schemas.openxmlformats.org/package/2006/relationships"
+ $relsWorkbook = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, "$dir/_rels/" . basename($rel['Target']) . '.rels')),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ $relsWorkbook->registerXPathNamespace('rel', 'http://schemas.openxmlformats.org/package/2006/relationships');
+
+ $sharedStrings = [];
+ $xpath = self::getArrayItem($relsWorkbook->xpath("rel:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings']"));
+ //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"
+ $xmlStrings = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ if (isset($xmlStrings, $xmlStrings->si)) {
+ foreach ($xmlStrings->si as $val) {
+ if (isset($val->t)) {
+ $sharedStrings[] = StringHelper::controlCharacterOOXML2PHP((string) $val->t);
+ } elseif (isset($val->r)) {
+ $sharedStrings[] = $this->parseRichText($val);
+ }
+ }
+ }
+
+ $worksheets = [];
+ $macros = $customUI = null;
+ foreach ($relsWorkbook->Relationship as $ele) {
+ switch ($ele['Type']) {
+ case 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet':
+ $worksheets[(string) $ele['Id']] = $ele['Target'];
+
+ break;
+ // a vbaProject ? (: some macros)
+ case 'http://schemas.microsoft.com/office/2006/relationships/vbaProject':
+ $macros = $ele['Target'];
+
+ break;
+ }
+ }
+
+ if ($macros !== null) {
+ $macrosCode = $this->getFromZipArchive($zip, 'xl/vbaProject.bin'); //vbaProject.bin always in 'xl' dir and always named vbaProject.bin
+ if ($macrosCode !== false) {
+ $excel->setMacrosCode($macrosCode);
+ $excel->setHasMacros(true);
+ //short-circuit : not reading vbaProject.bin.rel to get Signature =>allways vbaProjectSignature.bin in 'xl' dir
+ $Certificate = $this->getFromZipArchive($zip, 'xl/vbaProjectSignature.bin');
+ if ($Certificate !== false) {
+ $excel->setMacrosCertificate($Certificate);
+ }
+ }
+ }
+ $styles = [];
+ $cellStyles = [];
+ $xpath = self::getArrayItem($relsWorkbook->xpath("rel:Relationship[@Type='http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles']"));
+ //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"
+ $xmlStyles = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, "$dir/$xpath[Target]")),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ $numFmts = null;
+ if ($xmlStyles && $xmlStyles->numFmts[0]) {
+ $numFmts = $xmlStyles->numFmts[0];
+ }
+ if (isset($numFmts) && ($numFmts !== null)) {
+ $numFmts->registerXPathNamespace('sml', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main');
+ }
+ if (!$this->readDataOnly && $xmlStyles) {
+ foreach ($xmlStyles->cellXfs->xf as $xf) {
+ $numFmt = NumberFormat::FORMAT_GENERAL;
+
+ if ($xf['numFmtId']) {
+ if (isset($numFmts)) {
+ $tmpNumFmt = self::getArrayItem($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]"));
+
+ if (isset($tmpNumFmt['formatCode'])) {
+ $numFmt = (string) $tmpNumFmt['formatCode'];
+ }
+ }
+
+ // We shouldn't override any of the built-in MS Excel values (values below id 164)
+ // But there's a lot of naughty homebrew xlsx writers that do use "reserved" id values that aren't actually used
+ // So we make allowance for them rather than lose formatting masks
+ if ((int) $xf['numFmtId'] < 164 &&
+ NumberFormat::builtInFormatCode((int) $xf['numFmtId']) !== '') {
+ $numFmt = NumberFormat::builtInFormatCode((int) $xf['numFmtId']);
+ }
+ }
+ $quotePrefix = false;
+ if (isset($xf['quotePrefix'])) {
+ $quotePrefix = (bool) $xf['quotePrefix'];
+ }
+
+ $style = (object) [
+ 'numFmt' => $numFmt,
+ 'font' => $xmlStyles->fonts->font[(int) ($xf['fontId'])],
+ 'fill' => $xmlStyles->fills->fill[(int) ($xf['fillId'])],
+ 'border' => $xmlStyles->borders->border[(int) ($xf['borderId'])],
+ 'alignment' => $xf->alignment,
+ 'protection' => $xf->protection,
+ 'quotePrefix' => $quotePrefix,
+ ];
+ $styles[] = $style;
+
+ // add style to cellXf collection
+ $objStyle = new Style();
+ self::readStyle($objStyle, $style);
+ $excel->addCellXf($objStyle);
+ }
+
+ foreach (isset($xmlStyles->cellStyleXfs->xf) ? $xmlStyles->cellStyleXfs->xf : [] as $xf) {
+ $numFmt = NumberFormat::FORMAT_GENERAL;
+ if ($numFmts && $xf['numFmtId']) {
+ $tmpNumFmt = self::getArrayItem($numFmts->xpath("sml:numFmt[@numFmtId=$xf[numFmtId]]"));
+ if (isset($tmpNumFmt['formatCode'])) {
+ $numFmt = (string) $tmpNumFmt['formatCode'];
+ } elseif ((int) $xf['numFmtId'] < 165) {
+ $numFmt = NumberFormat::builtInFormatCode((int) $xf['numFmtId']);
+ }
+ }
+
+ $cellStyle = (object) [
+ 'numFmt' => $numFmt,
+ 'font' => $xmlStyles->fonts->font[(int) ($xf['fontId'])],
+ 'fill' => $xmlStyles->fills->fill[(int) ($xf['fillId'])],
+ 'border' => $xmlStyles->borders->border[(int) ($xf['borderId'])],
+ 'alignment' => $xf->alignment,
+ 'protection' => $xf->protection,
+ 'quotePrefix' => $quotePrefix,
+ ];
+ $cellStyles[] = $cellStyle;
+
+ // add style to cellStyleXf collection
+ $objStyle = new Style();
+ self::readStyle($objStyle, $cellStyle);
+ $excel->addCellStyleXf($objStyle);
+ }
+ }
+
+ $dxfs = [];
+ if (!$this->readDataOnly && $xmlStyles) {
+ // Conditional Styles
+ if ($xmlStyles->dxfs) {
+ foreach ($xmlStyles->dxfs->dxf as $dxf) {
+ $style = new Style(false, true);
+ self::readStyle($style, $dxf);
+ $dxfs[] = $style;
+ }
+ }
+ // Cell Styles
+ if ($xmlStyles->cellStyles) {
+ foreach ($xmlStyles->cellStyles->cellStyle as $cellStyle) {
+ if ((int) ($cellStyle['builtinId']) == 0) {
+ if (isset($cellStyles[(int) ($cellStyle['xfId'])])) {
+ // Set default style
+ $style = new Style();
+ self::readStyle($style, $cellStyles[(int) ($cellStyle['xfId'])]);
+
+ // normal style, currently not using it for anything
+ }
+ }
+ }
+ }
+ }
+
+ //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"
+ $xmlWorkbook = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, "{$rel['Target']}")),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+
+ // Set base date
+ if ($xmlWorkbook->workbookPr) {
+ Date::setExcelCalendar(Date::CALENDAR_WINDOWS_1900);
+ if (isset($xmlWorkbook->workbookPr['date1904'])) {
+ if (self::boolean((string) $xmlWorkbook->workbookPr['date1904'])) {
+ Date::setExcelCalendar(Date::CALENDAR_MAC_1904);
+ }
+ }
+ }
+
+ // Set protection
+ $this->readProtection($excel, $xmlWorkbook);
+
+ $sheetId = 0; // keep track of new sheet id in final workbook
+ $oldSheetId = -1; // keep track of old sheet id in final workbook
+ $countSkippedSheets = 0; // keep track of number of skipped sheets
+ $mapSheetId = []; // mapping of sheet ids from old to new
+
+ $charts = $chartDetails = [];
+
+ if ($xmlWorkbook->sheets) {
+ /** @var SimpleXMLElement $eleSheet */
+ foreach ($xmlWorkbook->sheets->sheet as $eleSheet) {
+ ++$oldSheetId;
+
+ // Check if sheet should be skipped
+ if (isset($this->loadSheetsOnly) && !in_array((string) $eleSheet['name'], $this->loadSheetsOnly)) {
+ ++$countSkippedSheets;
+ $mapSheetId[$oldSheetId] = null;
+
+ continue;
+ }
+
+ // Map old sheet id in original workbook to new sheet id.
+ // They will differ if loadSheetsOnly() is being used
+ $mapSheetId[$oldSheetId] = $oldSheetId - $countSkippedSheets;
+
+ // Load sheet
+ $docSheet = $excel->createSheet();
+ // Use false for $updateFormulaCellReferences to prevent adjustment of worksheet
+ // references in formula cells... during the load, all formulae should be correct,
+ // and we're simply bringing the worksheet name in line with the formula, not the
+ // reverse
+ $docSheet->setTitle((string) $eleSheet['name'], false, false);
+ $fileWorksheet = $worksheets[(string) self::getArrayItem($eleSheet->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'), 'id')];
+ //~ http://schemas.openxmlformats.org/spreadsheetml/2006/main"
+ $xmlSheet = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, "$dir/$fileWorksheet")),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+
+ $sharedFormulas = [];
+
+ if (isset($eleSheet['state']) && (string) $eleSheet['state'] != '') {
+ $docSheet->setSheetState((string) $eleSheet['state']);
+ }
+
+ if (isset($xmlSheet->sheetViews, $xmlSheet->sheetViews->sheetView)) {
+ if (isset($xmlSheet->sheetViews->sheetView['zoomScale'])) {
+ $zoomScale = (int) ($xmlSheet->sheetViews->sheetView['zoomScale']);
+ if ($zoomScale <= 0) {
+ // setZoomScale will throw an Exception if the scale is less than or equals 0
+ // that is OK when manually creating documents, but we should be able to read all documents
+ $zoomScale = 100;
+ }
+
+ $docSheet->getSheetView()->setZoomScale($zoomScale);
+ }
+ if (isset($xmlSheet->sheetViews->sheetView['zoomScaleNormal'])) {
+ $zoomScaleNormal = (int) ($xmlSheet->sheetViews->sheetView['zoomScaleNormal']);
+ if ($zoomScaleNormal <= 0) {
+ // setZoomScaleNormal will throw an Exception if the scale is less than or equals 0
+ // that is OK when manually creating documents, but we should be able to read all documents
+ $zoomScaleNormal = 100;
+ }
+
+ $docSheet->getSheetView()->setZoomScaleNormal($zoomScaleNormal);
+ }
+ if (isset($xmlSheet->sheetViews->sheetView['view'])) {
+ $docSheet->getSheetView()->setView((string) $xmlSheet->sheetViews->sheetView['view']);
+ }
+ if (isset($xmlSheet->sheetViews->sheetView['showGridLines'])) {
+ $docSheet->setShowGridLines(self::boolean((string) $xmlSheet->sheetViews->sheetView['showGridLines']));
+ }
+ if (isset($xmlSheet->sheetViews->sheetView['showRowColHeaders'])) {
+ $docSheet->setShowRowColHeaders(self::boolean((string) $xmlSheet->sheetViews->sheetView['showRowColHeaders']));
+ }
+ if (isset($xmlSheet->sheetViews->sheetView['rightToLeft'])) {
+ $docSheet->setRightToLeft(self::boolean((string) $xmlSheet->sheetViews->sheetView['rightToLeft']));
+ }
+ if (isset($xmlSheet->sheetViews->sheetView->pane)) {
+ $xSplit = 0;
+ $ySplit = 0;
+ $topLeftCell = null;
+
+ if (isset($xmlSheet->sheetViews->sheetView->pane['xSplit'])) {
+ $xSplit = (int) ($xmlSheet->sheetViews->sheetView->pane['xSplit']);
+ }
+
+ if (isset($xmlSheet->sheetViews->sheetView->pane['ySplit'])) {
+ $ySplit = (int) ($xmlSheet->sheetViews->sheetView->pane['ySplit']);
+ }
+
+ if (isset($xmlSheet->sheetViews->sheetView->pane['topLeftCell'])) {
+ $topLeftCell = (string) $xmlSheet->sheetViews->sheetView->pane['topLeftCell'];
+ }
+
+ $docSheet->freezePane(Coordinate::stringFromColumnIndex($xSplit + 1) . ($ySplit + 1), $topLeftCell);
+ }
+
+ if (isset($xmlSheet->sheetViews->sheetView->selection)) {
+ if (isset($xmlSheet->sheetViews->sheetView->selection['sqref'])) {
+ $sqref = (string) $xmlSheet->sheetViews->sheetView->selection['sqref'];
+ $sqref = explode(' ', $sqref);
+ $sqref = $sqref[0];
+ $docSheet->setSelectedCells($sqref);
+ }
+ }
+ }
+
+ if (isset($xmlSheet->sheetPr, $xmlSheet->sheetPr->tabColor)) {
+ if (isset($xmlSheet->sheetPr->tabColor['rgb'])) {
+ $docSheet->getTabColor()->setARGB((string) $xmlSheet->sheetPr->tabColor['rgb']);
+ }
+ }
+ if (isset($xmlSheet->sheetPr, $xmlSheet->sheetPr['codeName'])) {
+ $docSheet->setCodeName((string) $xmlSheet->sheetPr['codeName'], false);
+ }
+ if (isset($xmlSheet->sheetPr, $xmlSheet->sheetPr->outlinePr)) {
+ if (isset($xmlSheet->sheetPr->outlinePr['summaryRight']) &&
+ !self::boolean((string) $xmlSheet->sheetPr->outlinePr['summaryRight'])) {
+ $docSheet->setShowSummaryRight(false);
+ } else {
+ $docSheet->setShowSummaryRight(true);
+ }
+
+ if (isset($xmlSheet->sheetPr->outlinePr['summaryBelow']) &&
+ !self::boolean((string) $xmlSheet->sheetPr->outlinePr['summaryBelow'])) {
+ $docSheet->setShowSummaryBelow(false);
+ } else {
+ $docSheet->setShowSummaryBelow(true);
+ }
+ }
+
+ if (isset($xmlSheet->sheetPr, $xmlSheet->sheetPr->pageSetUpPr)) {
+ if (isset($xmlSheet->sheetPr->pageSetUpPr['fitToPage']) &&
+ !self::boolean((string) $xmlSheet->sheetPr->pageSetUpPr['fitToPage'])) {
+ $docSheet->getPageSetup()->setFitToPage(false);
+ } else {
+ $docSheet->getPageSetup()->setFitToPage(true);
+ }
+ }
+
+ if (isset($xmlSheet->sheetFormatPr)) {
+ if (isset($xmlSheet->sheetFormatPr['customHeight']) &&
+ self::boolean((string) $xmlSheet->sheetFormatPr['customHeight']) &&
+ isset($xmlSheet->sheetFormatPr['defaultRowHeight'])) {
+ $docSheet->getDefaultRowDimension()->setRowHeight((float) $xmlSheet->sheetFormatPr['defaultRowHeight']);
+ }
+ if (isset($xmlSheet->sheetFormatPr['defaultColWidth'])) {
+ $docSheet->getDefaultColumnDimension()->setWidth((float) $xmlSheet->sheetFormatPr['defaultColWidth']);
+ }
+ if (isset($xmlSheet->sheetFormatPr['zeroHeight']) &&
+ ((string) $xmlSheet->sheetFormatPr['zeroHeight'] == '1')) {
+ $docSheet->getDefaultRowDimension()->setZeroHeight(true);
+ }
+ }
+
+ if (isset($xmlSheet->printOptions) && !$this->readDataOnly) {
+ if (self::boolean((string) $xmlSheet->printOptions['gridLinesSet'])) {
+ $docSheet->setShowGridlines(true);
+ }
+ if (self::boolean((string) $xmlSheet->printOptions['gridLines'])) {
+ $docSheet->setPrintGridlines(true);
+ }
+ if (self::boolean((string) $xmlSheet->printOptions['horizontalCentered'])) {
+ $docSheet->getPageSetup()->setHorizontalCentered(true);
+ }
+ if (self::boolean((string) $xmlSheet->printOptions['verticalCentered'])) {
+ $docSheet->getPageSetup()->setVerticalCentered(true);
+ }
+ }
+
+ $this->readColumnsAndRowsAttributes($xmlSheet, $docSheet);
+
+ if ($xmlSheet && $xmlSheet->sheetData && $xmlSheet->sheetData->row) {
+ $cIndex = 1; // Cell Start from 1
+ foreach ($xmlSheet->sheetData->row as $row) {
+ $rowIndex = 1;
+ foreach ($row->c as $c) {
+ $r = (string) $c['r'];
+ if ($r == '') {
+ $r = Coordinate::stringFromColumnIndex($rowIndex) . $cIndex;
+ }
+ $cellDataType = (string) $c['t'];
+ $value = null;
+ $calculatedValue = null;
+
+ // Read cell?
+ if ($this->getReadFilter() !== null) {
+ $coordinates = Coordinate::coordinateFromString($r);
+
+ if (!$this->getReadFilter()->readCell($coordinates[0], (int) $coordinates[1], $docSheet->getTitle())) {
+ $rowIndex += 1;
+
+ continue;
+ }
+ }
+
+ // Read cell!
+ switch ($cellDataType) {
+ case 's':
+ if ((string) $c->v != '') {
+ $value = $sharedStrings[(int) ($c->v)];
+
+ if ($value instanceof RichText) {
+ $value = clone $value;
+ }
+ } else {
+ $value = '';
+ }
+
+ break;
+ case 'b':
+ if (!isset($c->f)) {
+ $value = self::castToBoolean($c);
+ } else {
+ // Formula
+ $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToBoolean');
+ if (isset($c->f['t'])) {
+ $att = $c->f;
+ $docSheet->getCell($r)->setFormulaAttributes($att);
+ }
+ }
+
+ break;
+ case 'inlineStr':
+ if (isset($c->f)) {
+ $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToError');
+ } else {
+ $value = $this->parseRichText($c->is);
+ }
+
+ break;
+ case 'e':
+ if (!isset($c->f)) {
+ $value = self::castToError($c);
+ } else {
+ // Formula
+ $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToError');
+ }
+
+ break;
+ default:
+ if (!isset($c->f)) {
+ $value = self::castToString($c);
+ } else {
+ // Formula
+ $this->castToFormula($c, $r, $cellDataType, $value, $calculatedValue, $sharedFormulas, 'castToString');
+ }
+
+ break;
+ }
+
+ // read empty cells or the cells are not empty
+ if ($this->readEmptyCells || ($value !== null && $value !== '')) {
+ // Check for numeric values
+ if (is_numeric($value) && $cellDataType != 's') {
+ if ($value == (int) $value) {
+ $value = (int) $value;
+ } elseif ($value == (float) $value) {
+ $value = (float) $value;
+ } elseif ($value == (float) $value) {
+ $value = (float) $value;
+ }
+ }
+
+ // Rich text?
+ if ($value instanceof RichText && $this->readDataOnly) {
+ $value = $value->getPlainText();
+ }
+
+ $cell = $docSheet->getCell($r);
+ // Assign value
+ if ($cellDataType != '') {
+ $cell->setValueExplicit($value, $cellDataType);
+ } else {
+ $cell->setValue($value);
+ }
+ if ($calculatedValue !== null) {
+ $cell->setCalculatedValue($calculatedValue);
+ }
+
+ // Style information?
+ if ($c['s'] && !$this->readDataOnly) {
+ // no style index means 0, it seems
+ $cell->setXfIndex(isset($styles[(int) ($c['s'])]) ?
+ (int) ($c['s']) : 0);
+ }
+ }
+ $rowIndex += 1;
+ }
+ $cIndex += 1;
+ }
+ }
+
+ $conditionals = [];
+ if (!$this->readDataOnly && $xmlSheet && $xmlSheet->conditionalFormatting) {
+ foreach ($xmlSheet->conditionalFormatting as $conditional) {
+ foreach ($conditional->cfRule as $cfRule) {
+ if (((string) $cfRule['type'] == Conditional::CONDITION_NONE || (string) $cfRule['type'] == Conditional::CONDITION_CELLIS || (string) $cfRule['type'] == Conditional::CONDITION_CONTAINSTEXT || (string) $cfRule['type'] == Conditional::CONDITION_EXPRESSION) && isset($dxfs[(int) ($cfRule['dxfId'])])) {
+ $conditionals[(string) $conditional['sqref']][(int) ($cfRule['priority'])] = $cfRule;
+ }
+ }
+ }
+
+ foreach ($conditionals as $ref => $cfRules) {
+ ksort($cfRules);
+ $conditionalStyles = [];
+ foreach ($cfRules as $cfRule) {
+ $objConditional = new Conditional();
+ $objConditional->setConditionType((string) $cfRule['type']);
+ $objConditional->setOperatorType((string) $cfRule['operator']);
+
+ if ((string) $cfRule['text'] != '') {
+ $objConditional->setText((string) $cfRule['text']);
+ }
+
+ if (isset($cfRule['stopIfTrue']) && (int) $cfRule['stopIfTrue'] === 1) {
+ $objConditional->setStopIfTrue(true);
+ }
+
+ if (count($cfRule->formula) > 1) {
+ foreach ($cfRule->formula as $formula) {
+ $objConditional->addCondition((string) $formula);
+ }
+ } else {
+ $objConditional->addCondition((string) $cfRule->formula);
+ }
+ $objConditional->setStyle(clone $dxfs[(int) ($cfRule['dxfId'])]);
+ $conditionalStyles[] = $objConditional;
+ }
+
+ // Extract all cell references in $ref
+ $cellBlocks = explode(' ', str_replace('$', '', strtoupper($ref)));
+ foreach ($cellBlocks as $cellBlock) {
+ $docSheet->getStyle($cellBlock)->setConditionalStyles($conditionalStyles);
+ }
+ }
+ }
+
+ $aKeys = ['sheet', 'objects', 'scenarios', 'formatCells', 'formatColumns', 'formatRows', 'insertColumns', 'insertRows', 'insertHyperlinks', 'deleteColumns', 'deleteRows', 'selectLockedCells', 'sort', 'autoFilter', 'pivotTables', 'selectUnlockedCells'];
+ if (!$this->readDataOnly && $xmlSheet && $xmlSheet->sheetProtection) {
+ foreach ($aKeys as $key) {
+ $method = 'set' . ucfirst($key);
+ $docSheet->getProtection()->$method(self::boolean((string) $xmlSheet->sheetProtection[$key]));
+ }
+ }
+
+ if (!$this->readDataOnly && $xmlSheet && $xmlSheet->sheetProtection) {
+ $docSheet->getProtection()->setPassword((string) $xmlSheet->sheetProtection['password'], true);
+ if ($xmlSheet->protectedRanges->protectedRange) {
+ foreach ($xmlSheet->protectedRanges->protectedRange as $protectedRange) {
+ $docSheet->protectCells((string) $protectedRange['sqref'], (string) $protectedRange['password'], true);
+ }
+ }
+ }
+
+ if ($xmlSheet && $xmlSheet->autoFilter && !$this->readDataOnly) {
+ $autoFilterRange = (string) $xmlSheet->autoFilter['ref'];
+ if (strpos($autoFilterRange, ':') !== false) {
+ $autoFilter = $docSheet->getAutoFilter();
+ $autoFilter->setRange($autoFilterRange);
+
+ foreach ($xmlSheet->autoFilter->filterColumn as $filterColumn) {
+ $column = $autoFilter->getColumnByOffset((int) $filterColumn['colId']);
+ // Check for standard filters
+ if ($filterColumn->filters) {
+ $column->setFilterType(Column::AUTOFILTER_FILTERTYPE_FILTER);
+ $filters = $filterColumn->filters;
+ if ((isset($filters['blank'])) && ($filters['blank'] == 1)) {
+ // Operator is undefined, but always treated as EQUAL
+ $column->createRule()->setRule(null, '')->setRuleType(Column\Rule::AUTOFILTER_RULETYPE_FILTER);
+ }
+ // Standard filters are always an OR join, so no join rule needs to be set
+ // Entries can be either filter elements
+ foreach ($filters->filter as $filterRule) {
+ // Operator is undefined, but always treated as EQUAL
+ $column->createRule()->setRule(null, (string) $filterRule['val'])->setRuleType(Column\Rule::AUTOFILTER_RULETYPE_FILTER);
+ }
+ // Or Date Group elements
+ foreach ($filters->dateGroupItem as $dateGroupItem) {
+ // Operator is undefined, but always treated as EQUAL
+ $column->createRule()->setRule(
+ null,
+ [
+ 'year' => (string) $dateGroupItem['year'],
+ 'month' => (string) $dateGroupItem['month'],
+ 'day' => (string) $dateGroupItem['day'],
+ 'hour' => (string) $dateGroupItem['hour'],
+ 'minute' => (string) $dateGroupItem['minute'],
+ 'second' => (string) $dateGroupItem['second'],
+ ],
+ (string) $dateGroupItem['dateTimeGrouping']
+ )
+ ->setRuleType(Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP);
+ }
+ }
+ // Check for custom filters
+ if ($filterColumn->customFilters) {
+ $column->setFilterType(Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER);
+ $customFilters = $filterColumn->customFilters;
+ // Custom filters can an AND or an OR join;
+ // and there should only ever be one or two entries
+ if ((isset($customFilters['and'])) && ($customFilters['and'] == 1)) {
+ $column->setJoin(Column::AUTOFILTER_COLUMN_JOIN_AND);
+ }
+ foreach ($customFilters->customFilter as $filterRule) {
+ $column->createRule()->setRule(
+ (string) $filterRule['operator'],
+ (string) $filterRule['val']
+ )
+ ->setRuleType(Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER);
+ }
+ }
+ // Check for dynamic filters
+ if ($filterColumn->dynamicFilter) {
+ $column->setFilterType(Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER);
+ // We should only ever have one dynamic filter
+ foreach ($filterColumn->dynamicFilter as $filterRule) {
+ // Operator is undefined, but always treated as EQUAL
+ $column->createRule()->setRule(
+ null,
+ (string) $filterRule['val'],
+ (string) $filterRule['type']
+ )
+ ->setRuleType(Column\Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER);
+ if (isset($filterRule['val'])) {
+ $column->setAttribute('val', (string) $filterRule['val']);
+ }
+ if (isset($filterRule['maxVal'])) {
+ $column->setAttribute('maxVal', (string) $filterRule['maxVal']);
+ }
+ }
+ }
+ // Check for dynamic filters
+ if ($filterColumn->top10) {
+ $column->setFilterType(Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER);
+ // We should only ever have one top10 filter
+ foreach ($filterColumn->top10 as $filterRule) {
+ $column->createRule()->setRule(
+ (((isset($filterRule['percent'])) && ($filterRule['percent'] == 1))
+ ? Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT
+ : Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE
+ ),
+ (string) $filterRule['val'],
+ (((isset($filterRule['top'])) && ($filterRule['top'] == 1))
+ ? Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP
+ : Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM
+ )
+ )
+ ->setRuleType(Column\Rule::AUTOFILTER_RULETYPE_TOPTENFILTER);
+ }
+ }
+ }
+ }
+ }
+
+ if ($xmlSheet && $xmlSheet->mergeCells && $xmlSheet->mergeCells->mergeCell && !$this->readDataOnly) {
+ foreach ($xmlSheet->mergeCells->mergeCell as $mergeCell) {
+ $mergeRef = (string) $mergeCell['ref'];
+ if (strpos($mergeRef, ':') !== false) {
+ $docSheet->mergeCells((string) $mergeCell['ref']);
+ }
+ }
+ }
+
+ if ($xmlSheet && $xmlSheet->pageMargins && !$this->readDataOnly) {
+ $docPageMargins = $docSheet->getPageMargins();
+ $docPageMargins->setLeft((float) ($xmlSheet->pageMargins['left']));
+ $docPageMargins->setRight((float) ($xmlSheet->pageMargins['right']));
+ $docPageMargins->setTop((float) ($xmlSheet->pageMargins['top']));
+ $docPageMargins->setBottom((float) ($xmlSheet->pageMargins['bottom']));
+ $docPageMargins->setHeader((float) ($xmlSheet->pageMargins['header']));
+ $docPageMargins->setFooter((float) ($xmlSheet->pageMargins['footer']));
+ }
+
+ if ($xmlSheet && $xmlSheet->pageSetup && !$this->readDataOnly) {
+ $docPageSetup = $docSheet->getPageSetup();
+
+ if (isset($xmlSheet->pageSetup['orientation'])) {
+ $docPageSetup->setOrientation((string) $xmlSheet->pageSetup['orientation']);
+ }
+ if (isset($xmlSheet->pageSetup['paperSize'])) {
+ $docPageSetup->setPaperSize((int) ($xmlSheet->pageSetup['paperSize']));
+ }
+ if (isset($xmlSheet->pageSetup['scale'])) {
+ $docPageSetup->setScale((int) ($xmlSheet->pageSetup['scale']), false);
+ }
+ if (isset($xmlSheet->pageSetup['fitToHeight']) && (int) ($xmlSheet->pageSetup['fitToHeight']) >= 0) {
+ $docPageSetup->setFitToHeight((int) ($xmlSheet->pageSetup['fitToHeight']), false);
+ }
+ if (isset($xmlSheet->pageSetup['fitToWidth']) && (int) ($xmlSheet->pageSetup['fitToWidth']) >= 0) {
+ $docPageSetup->setFitToWidth((int) ($xmlSheet->pageSetup['fitToWidth']), false);
+ }
+ if (isset($xmlSheet->pageSetup['firstPageNumber'], $xmlSheet->pageSetup['useFirstPageNumber']) &&
+ self::boolean((string) $xmlSheet->pageSetup['useFirstPageNumber'])) {
+ $docPageSetup->setFirstPageNumber((int) ($xmlSheet->pageSetup['firstPageNumber']));
+ }
+
+ $relAttributes = $xmlSheet->pageSetup->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships');
+ if (isset($relAttributes['id'])) {
+ $unparsedLoadedData['sheets'][$docSheet->getCodeName()]['pageSetupRelId'] = (string) $relAttributes['id'];
+ }
+ }
+
+ if ($xmlSheet && $xmlSheet->headerFooter && !$this->readDataOnly) {
+ $docHeaderFooter = $docSheet->getHeaderFooter();
+
+ if (isset($xmlSheet->headerFooter['differentOddEven']) &&
+ self::boolean((string) $xmlSheet->headerFooter['differentOddEven'])) {
+ $docHeaderFooter->setDifferentOddEven(true);
+ } else {
+ $docHeaderFooter->setDifferentOddEven(false);
+ }
+ if (isset($xmlSheet->headerFooter['differentFirst']) &&
+ self::boolean((string) $xmlSheet->headerFooter['differentFirst'])) {
+ $docHeaderFooter->setDifferentFirst(true);
+ } else {
+ $docHeaderFooter->setDifferentFirst(false);
+ }
+ if (isset($xmlSheet->headerFooter['scaleWithDoc']) &&
+ !self::boolean((string) $xmlSheet->headerFooter['scaleWithDoc'])) {
+ $docHeaderFooter->setScaleWithDocument(false);
+ } else {
+ $docHeaderFooter->setScaleWithDocument(true);
+ }
+ if (isset($xmlSheet->headerFooter['alignWithMargins']) &&
+ !self::boolean((string) $xmlSheet->headerFooter['alignWithMargins'])) {
+ $docHeaderFooter->setAlignWithMargins(false);
+ } else {
+ $docHeaderFooter->setAlignWithMargins(true);
+ }
+
+ $docHeaderFooter->setOddHeader((string) $xmlSheet->headerFooter->oddHeader);
+ $docHeaderFooter->setOddFooter((string) $xmlSheet->headerFooter->oddFooter);
+ $docHeaderFooter->setEvenHeader((string) $xmlSheet->headerFooter->evenHeader);
+ $docHeaderFooter->setEvenFooter((string) $xmlSheet->headerFooter->evenFooter);
+ $docHeaderFooter->setFirstHeader((string) $xmlSheet->headerFooter->firstHeader);
+ $docHeaderFooter->setFirstFooter((string) $xmlSheet->headerFooter->firstFooter);
+ }
+
+ if ($xmlSheet && $xmlSheet->rowBreaks && $xmlSheet->rowBreaks->brk && !$this->readDataOnly) {
+ foreach ($xmlSheet->rowBreaks->brk as $brk) {
+ if ($brk['man']) {
+ $docSheet->setBreak("A$brk[id]", Worksheet::BREAK_ROW);
+ }
+ }
+ }
+ if ($xmlSheet && $xmlSheet->colBreaks && $xmlSheet->colBreaks->brk && !$this->readDataOnly) {
+ foreach ($xmlSheet->colBreaks->brk as $brk) {
+ if ($brk['man']) {
+ $docSheet->setBreak(Coordinate::stringFromColumnIndex((string) $brk['id'] + 1) . '1', Worksheet::BREAK_COLUMN);
+ }
+ }
+ }
+
+ if ($xmlSheet && $xmlSheet->dataValidations && !$this->readDataOnly) {
+ foreach ($xmlSheet->dataValidations->dataValidation as $dataValidation) {
+ // Uppercase coordinate
+ $range = strtoupper($dataValidation['sqref']);
+ $rangeSet = explode(' ', $range);
+ foreach ($rangeSet as $range) {
+ $stRange = $docSheet->shrinkRangeToFit($range);
+
+ // Extract all cell references in $range
+ foreach (Coordinate::extractAllCellReferencesInRange($stRange) as $reference) {
+ // Create validation
+ $docValidation = $docSheet->getCell($reference)->getDataValidation();
+ $docValidation->setType((string) $dataValidation['type']);
+ $docValidation->setErrorStyle((string) $dataValidation['errorStyle']);
+ $docValidation->setOperator((string) $dataValidation['operator']);
+ $docValidation->setAllowBlank($dataValidation['allowBlank'] != 0);
+ $docValidation->setShowDropDown($dataValidation['showDropDown'] == 0);
+ $docValidation->setShowInputMessage($dataValidation['showInputMessage'] != 0);
+ $docValidation->setShowErrorMessage($dataValidation['showErrorMessage'] != 0);
+ $docValidation->setErrorTitle((string) $dataValidation['errorTitle']);
+ $docValidation->setError((string) $dataValidation['error']);
+ $docValidation->setPromptTitle((string) $dataValidation['promptTitle']);
+ $docValidation->setPrompt((string) $dataValidation['prompt']);
+ $docValidation->setFormula1((string) $dataValidation->formula1);
+ $docValidation->setFormula2((string) $dataValidation->formula2);
+ }
+ }
+ }
+ }
+
+ // unparsed sheet AlternateContent
+ if ($xmlSheet && !$this->readDataOnly) {
+ $mc = $xmlSheet->children('http://schemas.openxmlformats.org/markup-compatibility/2006');
+ if ($mc->AlternateContent) {
+ foreach ($mc->AlternateContent as $alternateContent) {
+ $unparsedLoadedData['sheets'][$docSheet->getCodeName()]['AlternateContents'][] = $alternateContent->asXML();
+ }
+ }
+ }
+
+ // Add hyperlinks
+ $hyperlinks = [];
+ if (!$this->readDataOnly) {
+ // Locate hyperlink relations
+ if ($zip->locateName(dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')) {
+ //~ http://schemas.openxmlformats.org/package/2006/relationships"
+ $relsWorksheet = simplexml_load_string(
+ $this->securityScanner->scan(
+ $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')
+ ),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ foreach ($relsWorksheet->Relationship as $ele) {
+ if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink') {
+ $hyperlinks[(string) $ele['Id']] = (string) $ele['Target'];
+ }
+ }
+ }
+
+ // Loop through hyperlinks
+ if ($xmlSheet && $xmlSheet->hyperlinks) {
+ /** @var SimpleXMLElement $hyperlink */
+ foreach ($xmlSheet->hyperlinks->hyperlink as $hyperlink) {
+ // Link url
+ $linkRel = $hyperlink->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships');
+
+ foreach (Coordinate::extractAllCellReferencesInRange($hyperlink['ref']) as $cellReference) {
+ $cell = $docSheet->getCell($cellReference);
+ if (isset($linkRel['id'])) {
+ $hyperlinkUrl = $hyperlinks[(string) $linkRel['id']];
+ if (isset($hyperlink['location'])) {
+ $hyperlinkUrl .= '#' . (string) $hyperlink['location'];
+ }
+ $cell->getHyperlink()->setUrl($hyperlinkUrl);
+ } elseif (isset($hyperlink['location'])) {
+ $cell->getHyperlink()->setUrl('sheet://' . (string) $hyperlink['location']);
+ }
+
+ // Tooltip
+ if (isset($hyperlink['tooltip'])) {
+ $cell->getHyperlink()->setTooltip((string) $hyperlink['tooltip']);
+ }
+ }
+ }
+ }
+ }
+
+ // Add comments
+ $comments = [];
+ $vmlComments = [];
+ if (!$this->readDataOnly) {
+ // Locate comment relations
+ if ($zip->locateName(dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')) {
+ //~ http://schemas.openxmlformats.org/package/2006/relationships"
+ $relsWorksheet = simplexml_load_string(
+ $this->securityScanner->scan(
+ $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')
+ ),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ foreach ($relsWorksheet->Relationship as $ele) {
+ if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments') {
+ $comments[(string) $ele['Id']] = (string) $ele['Target'];
+ }
+ if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing') {
+ $vmlComments[(string) $ele['Id']] = (string) $ele['Target'];
+ }
+ }
+ }
+
+ // Loop through comments
+ foreach ($comments as $relName => $relPath) {
+ // Load comments file
+ $relPath = File::realpath(dirname("$dir/$fileWorksheet") . '/' . $relPath);
+ $commentsFile = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, $relPath)),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+
+ // Utility variables
+ $authors = [];
+
+ // Loop through authors
+ foreach ($commentsFile->authors->author as $author) {
+ $authors[] = (string) $author;
+ }
+
+ // Loop through contents
+ foreach ($commentsFile->commentList->comment as $comment) {
+ if (!empty($comment['authorId'])) {
+ $docSheet->getComment((string) $comment['ref'])->setAuthor($authors[(string) $comment['authorId']]);
+ }
+ $docSheet->getComment((string) $comment['ref'])->setText($this->parseRichText($comment->text));
+ }
+ }
+
+ // later we will remove from it real vmlComments
+ $unparsedVmlDrawings = $vmlComments;
+
+ // Loop through VML comments
+ foreach ($vmlComments as $relName => $relPath) {
+ // Load VML comments file
+ $relPath = File::realpath(dirname("$dir/$fileWorksheet") . '/' . $relPath);
+ $vmlCommentsFile = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, $relPath)),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ $vmlCommentsFile->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');
+
+ $shapes = $vmlCommentsFile->xpath('//v:shape');
+ foreach ($shapes as $shape) {
+ $shape->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');
+
+ if (isset($shape['style'])) {
+ $style = (string) $shape['style'];
+ $fillColor = strtoupper(substr((string) $shape['fillcolor'], 1));
+ $column = null;
+ $row = null;
+
+ $clientData = $shape->xpath('.//x:ClientData');
+ if (is_array($clientData) && !empty($clientData)) {
+ $clientData = $clientData[0];
+
+ if (isset($clientData['ObjectType']) && (string) $clientData['ObjectType'] == 'Note') {
+ $temp = $clientData->xpath('.//x:Row');
+ if (is_array($temp)) {
+ $row = $temp[0];
+ }
+
+ $temp = $clientData->xpath('.//x:Column');
+ if (is_array($temp)) {
+ $column = $temp[0];
+ }
+ }
+ }
+
+ if (($column !== null) && ($row !== null)) {
+ // Set comment properties
+ $comment = $docSheet->getCommentByColumnAndRow($column + 1, $row + 1);
+ $comment->getFillColor()->setRGB($fillColor);
+
+ // Parse style
+ $styleArray = explode(';', str_replace(' ', '', $style));
+ foreach ($styleArray as $stylePair) {
+ $stylePair = explode(':', $stylePair);
+
+ if ($stylePair[0] == 'margin-left') {
+ $comment->setMarginLeft($stylePair[1]);
+ }
+ if ($stylePair[0] == 'margin-top') {
+ $comment->setMarginTop($stylePair[1]);
+ }
+ if ($stylePair[0] == 'width') {
+ $comment->setWidth($stylePair[1]);
+ }
+ if ($stylePair[0] == 'height') {
+ $comment->setHeight($stylePair[1]);
+ }
+ if ($stylePair[0] == 'visibility') {
+ $comment->setVisible($stylePair[1] == 'visible');
+ }
+ }
+
+ unset($unparsedVmlDrawings[$relName]);
+ }
+ }
+ }
+ }
+
+ // unparsed vmlDrawing
+ if ($unparsedVmlDrawings) {
+ foreach ($unparsedVmlDrawings as $rId => $relPath) {
+ $rId = substr($rId, 3); // rIdXXX
+ $unparsedVmlDrawing = &$unparsedLoadedData['sheets'][$docSheet->getCodeName()]['vmlDrawings'];
+ $unparsedVmlDrawing[$rId] = [];
+ $unparsedVmlDrawing[$rId]['filePath'] = self::dirAdd("$dir/$fileWorksheet", $relPath);
+ $unparsedVmlDrawing[$rId]['relFilePath'] = $relPath;
+ $unparsedVmlDrawing[$rId]['content'] = $this->securityScanner->scan($this->getFromZipArchive($zip, $unparsedVmlDrawing[$rId]['filePath']));
+ unset($unparsedVmlDrawing);
+ }
+ }
+
+ // Header/footer images
+ if ($xmlSheet && $xmlSheet->legacyDrawingHF && !$this->readDataOnly) {
+ if ($zip->locateName(dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')) {
+ //~ http://schemas.openxmlformats.org/package/2006/relationships"
+ $relsWorksheet = simplexml_load_string(
+ $this->securityScanner->scan(
+ $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')
+ ),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ $vmlRelationship = '';
+
+ foreach ($relsWorksheet->Relationship as $ele) {
+ if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing') {
+ $vmlRelationship = self::dirAdd("$dir/$fileWorksheet", $ele['Target']);
+ }
+ }
+
+ if ($vmlRelationship != '') {
+ // Fetch linked images
+ //~ http://schemas.openxmlformats.org/package/2006/relationships"
+ $relsVML = simplexml_load_string(
+ $this->securityScanner->scan(
+ $this->getFromZipArchive($zip, dirname($vmlRelationship) . '/_rels/' . basename($vmlRelationship) . '.rels')
+ ),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ $drawings = [];
+ foreach ($relsVML->Relationship as $ele) {
+ if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image') {
+ $drawings[(string) $ele['Id']] = self::dirAdd($vmlRelationship, $ele['Target']);
+ }
+ }
+
+ // Fetch VML document
+ $vmlDrawing = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, $vmlRelationship)),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ $vmlDrawing->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');
+
+ $hfImages = [];
+
+ $shapes = $vmlDrawing->xpath('//v:shape');
+ foreach ($shapes as $idx => $shape) {
+ $shape->registerXPathNamespace('v', 'urn:schemas-microsoft-com:vml');
+ $imageData = $shape->xpath('//v:imagedata');
+
+ if (!$imageData) {
+ continue;
+ }
+
+ $imageData = $imageData[$idx];
+
+ $imageData = $imageData->attributes('urn:schemas-microsoft-com:office:office');
+ $style = self::toCSSArray((string) $shape['style']);
+
+ $hfImages[(string) $shape['id']] = new HeaderFooterDrawing();
+ if (isset($imageData['title'])) {
+ $hfImages[(string) $shape['id']]->setName((string) $imageData['title']);
+ }
+
+ $hfImages[(string) $shape['id']]->setPath('zip://' . File::realpath($pFilename) . '#' . $drawings[(string) $imageData['relid']], false);
+ $hfImages[(string) $shape['id']]->setResizeProportional(false);
+ $hfImages[(string) $shape['id']]->setWidth($style['width']);
+ $hfImages[(string) $shape['id']]->setHeight($style['height']);
+ if (isset($style['margin-left'])) {
+ $hfImages[(string) $shape['id']]->setOffsetX($style['margin-left']);
+ }
+ $hfImages[(string) $shape['id']]->setOffsetY($style['margin-top']);
+ $hfImages[(string) $shape['id']]->setResizeProportional(true);
+ }
+
+ $docSheet->getHeaderFooter()->setImages($hfImages);
+ }
+ }
+ }
+ }
+
+ // TODO: Autoshapes from twoCellAnchors!
+ if ($zip->locateName(dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')) {
+ //~ http://schemas.openxmlformats.org/package/2006/relationships"
+ $relsWorksheet = simplexml_load_string(
+ $this->securityScanner->scan(
+ $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')
+ ),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ $drawings = [];
+ foreach ($relsWorksheet->Relationship as $ele) {
+ if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing') {
+ $drawings[(string) $ele['Id']] = self::dirAdd("$dir/$fileWorksheet", $ele['Target']);
+ }
+ }
+ if ($xmlSheet->drawing && !$this->readDataOnly) {
+ foreach ($xmlSheet->drawing as $drawing) {
+ $fileDrawing = $drawings[(string) self::getArrayItem($drawing->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'), 'id')];
+ //~ http://schemas.openxmlformats.org/package/2006/relationships"
+ $relsDrawing = simplexml_load_string(
+ $this->securityScanner->scan(
+ $this->getFromZipArchive($zip, dirname($fileDrawing) . '/_rels/' . basename($fileDrawing) . '.rels')
+ ),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ $images = [];
+ $hyperlinks = [];
+ if ($relsDrawing && $relsDrawing->Relationship) {
+ foreach ($relsDrawing->Relationship as $ele) {
+ if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink') {
+ $hyperlinks[(string) $ele['Id']] = (string) $ele['Target'];
+ }
+ if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image') {
+ $images[(string) $ele['Id']] = self::dirAdd($fileDrawing, $ele['Target']);
+ } elseif ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart') {
+ if ($this->includeCharts) {
+ $charts[self::dirAdd($fileDrawing, $ele['Target'])] = [
+ 'id' => (string) $ele['Id'],
+ 'sheet' => $docSheet->getTitle(),
+ ];
+ }
+ }
+ }
+ }
+ $xmlDrawing = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, $fileDrawing)),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ )->children('http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing');
+
+ if ($xmlDrawing->oneCellAnchor) {
+ foreach ($xmlDrawing->oneCellAnchor as $oneCellAnchor) {
+ if ($oneCellAnchor->pic->blipFill) {
+ /** @var SimpleXMLElement $blip */
+ $blip = $oneCellAnchor->pic->blipFill->children('http://schemas.openxmlformats.org/drawingml/2006/main')->blip;
+ /** @var SimpleXMLElement $xfrm */
+ $xfrm = $oneCellAnchor->pic->spPr->children('http://schemas.openxmlformats.org/drawingml/2006/main')->xfrm;
+ /** @var SimpleXMLElement $outerShdw */
+ $outerShdw = $oneCellAnchor->pic->spPr->children('http://schemas.openxmlformats.org/drawingml/2006/main')->effectLst->outerShdw;
+ /** @var \SimpleXMLElement $hlinkClick */
+ $hlinkClick = $oneCellAnchor->pic->nvPicPr->cNvPr->children('http://schemas.openxmlformats.org/drawingml/2006/main')->hlinkClick;
+
+ $objDrawing = new \PhpOffice\PhpSpreadsheet\Worksheet\Drawing();
+ $objDrawing->setName((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), 'name'));
+ $objDrawing->setDescription((string) self::getArrayItem($oneCellAnchor->pic->nvPicPr->cNvPr->attributes(), 'descr'));
+ $objDrawing->setPath(
+ 'zip://' . File::realpath($pFilename) . '#' .
+ $images[(string) self::getArrayItem(
+ $blip->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'),
+ 'embed'
+ )],
+ false
+ );
+ $objDrawing->setCoordinates(Coordinate::stringFromColumnIndex(((string) $oneCellAnchor->from->col) + 1) . ($oneCellAnchor->from->row + 1));
+ $objDrawing->setOffsetX(Drawing::EMUToPixels($oneCellAnchor->from->colOff));
+ $objDrawing->setOffsetY(Drawing::EMUToPixels($oneCellAnchor->from->rowOff));
+ $objDrawing->setResizeProportional(false);
+ $objDrawing->setWidth(Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), 'cx')));
+ $objDrawing->setHeight(Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), 'cy')));
+ if ($xfrm) {
+ $objDrawing->setRotation(Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), 'rot')));
+ }
+ if ($outerShdw) {
+ $shadow = $objDrawing->getShadow();
+ $shadow->setVisible(true);
+ $shadow->setBlurRadius(Drawing::EMUToPixels(self::getArrayItem($outerShdw->attributes(), 'blurRad')));
+ $shadow->setDistance(Drawing::EMUToPixels(self::getArrayItem($outerShdw->attributes(), 'dist')));
+ $shadow->setDirection(Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), 'dir')));
+ $shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), 'algn'));
+ $clr = isset($outerShdw->srgbClr) ? $outerShdw->srgbClr : $outerShdw->prstClr;
+ $shadow->getColor()->setRGB(self::getArrayItem($clr->attributes(), 'val'));
+ $shadow->setAlpha(self::getArrayItem($clr->alpha->attributes(), 'val') / 1000);
+ }
+
+ $this->readHyperLinkDrawing($objDrawing, $oneCellAnchor, $hyperlinks);
+
+ $objDrawing->setWorksheet($docSheet);
+ } else {
+ // ? Can charts be positioned with a oneCellAnchor ?
+ $coordinates = Coordinate::stringFromColumnIndex(((string) $oneCellAnchor->from->col) + 1) . ($oneCellAnchor->from->row + 1);
+ $offsetX = Drawing::EMUToPixels($oneCellAnchor->from->colOff);
+ $offsetY = Drawing::EMUToPixels($oneCellAnchor->from->rowOff);
+ $width = Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), 'cx'));
+ $height = Drawing::EMUToPixels(self::getArrayItem($oneCellAnchor->ext->attributes(), 'cy'));
+ }
+ }
+ }
+ if ($xmlDrawing->twoCellAnchor) {
+ foreach ($xmlDrawing->twoCellAnchor as $twoCellAnchor) {
+ if ($twoCellAnchor->pic->blipFill) {
+ $blip = $twoCellAnchor->pic->blipFill->children('http://schemas.openxmlformats.org/drawingml/2006/main')->blip;
+ $xfrm = $twoCellAnchor->pic->spPr->children('http://schemas.openxmlformats.org/drawingml/2006/main')->xfrm;
+ $outerShdw = $twoCellAnchor->pic->spPr->children('http://schemas.openxmlformats.org/drawingml/2006/main')->effectLst->outerShdw;
+ $hlinkClick = $twoCellAnchor->pic->nvPicPr->cNvPr->children('http://schemas.openxmlformats.org/drawingml/2006/main')->hlinkClick;
+ $objDrawing = new \PhpOffice\PhpSpreadsheet\Worksheet\Drawing();
+ $objDrawing->setName((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), 'name'));
+ $objDrawing->setDescription((string) self::getArrayItem($twoCellAnchor->pic->nvPicPr->cNvPr->attributes(), 'descr'));
+ $objDrawing->setPath(
+ 'zip://' . File::realpath($pFilename) . '#' .
+ $images[(string) self::getArrayItem(
+ $blip->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships'),
+ 'embed'
+ )],
+ false
+ );
+ $objDrawing->setCoordinates(Coordinate::stringFromColumnIndex(((string) $twoCellAnchor->from->col) + 1) . ($twoCellAnchor->from->row + 1));
+ $objDrawing->setOffsetX(Drawing::EMUToPixels($twoCellAnchor->from->colOff));
+ $objDrawing->setOffsetY(Drawing::EMUToPixels($twoCellAnchor->from->rowOff));
+ $objDrawing->setResizeProportional(false);
+
+ if ($xfrm) {
+ $objDrawing->setWidth(Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), 'cx')));
+ $objDrawing->setHeight(Drawing::EMUToPixels(self::getArrayItem($xfrm->ext->attributes(), 'cy')));
+ $objDrawing->setRotation(Drawing::angleToDegrees(self::getArrayItem($xfrm->attributes(), 'rot')));
+ }
+ if ($outerShdw) {
+ $shadow = $objDrawing->getShadow();
+ $shadow->setVisible(true);
+ $shadow->setBlurRadius(Drawing::EMUToPixels(self::getArrayItem($outerShdw->attributes(), 'blurRad')));
+ $shadow->setDistance(Drawing::EMUToPixels(self::getArrayItem($outerShdw->attributes(), 'dist')));
+ $shadow->setDirection(Drawing::angleToDegrees(self::getArrayItem($outerShdw->attributes(), 'dir')));
+ $shadow->setAlignment((string) self::getArrayItem($outerShdw->attributes(), 'algn'));
+ $clr = isset($outerShdw->srgbClr) ? $outerShdw->srgbClr : $outerShdw->prstClr;
+ $shadow->getColor()->setRGB(self::getArrayItem($clr->attributes(), 'val'));
+ $shadow->setAlpha(self::getArrayItem($clr->alpha->attributes(), 'val') / 1000);
+ }
+
+ $this->readHyperLinkDrawing($objDrawing, $twoCellAnchor, $hyperlinks);
+
+ $objDrawing->setWorksheet($docSheet);
+ } elseif (($this->includeCharts) && ($twoCellAnchor->graphicFrame)) {
+ $fromCoordinate = Coordinate::stringFromColumnIndex(((string) $twoCellAnchor->from->col) + 1) . ($twoCellAnchor->from->row + 1);
+ $fromOffsetX = Drawing::EMUToPixels($twoCellAnchor->from->colOff);
+ $fromOffsetY = Drawing::EMUToPixels($twoCellAnchor->from->rowOff);
+ $toCoordinate = Coordinate::stringFromColumnIndex(((string) $twoCellAnchor->to->col) + 1) . ($twoCellAnchor->to->row + 1);
+ $toOffsetX = Drawing::EMUToPixels($twoCellAnchor->to->colOff);
+ $toOffsetY = Drawing::EMUToPixels($twoCellAnchor->to->rowOff);
+ $graphic = $twoCellAnchor->graphicFrame->children('http://schemas.openxmlformats.org/drawingml/2006/main')->graphic;
+ /** @var SimpleXMLElement $chartRef */
+ $chartRef = $graphic->graphicData->children('http://schemas.openxmlformats.org/drawingml/2006/chart')->chart;
+ $thisChart = (string) $chartRef->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships');
+
+ $chartDetails[$docSheet->getTitle() . '!' . $thisChart] = [
+ 'fromCoordinate' => $fromCoordinate,
+ 'fromOffsetX' => $fromOffsetX,
+ 'fromOffsetY' => $fromOffsetY,
+ 'toCoordinate' => $toCoordinate,
+ 'toOffsetX' => $toOffsetX,
+ 'toOffsetY' => $toOffsetY,
+ 'worksheetTitle' => $docSheet->getTitle(),
+ ];
+ }
+ }
+ }
+ }
+
+ // store original rId of drawing files
+ $unparsedLoadedData['sheets'][$docSheet->getCodeName()]['drawingOriginalIds'] = [];
+ foreach ($relsWorksheet->Relationship as $ele) {
+ if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing') {
+ $unparsedLoadedData['sheets'][$docSheet->getCodeName()]['drawingOriginalIds'][(string) $ele['Target']] = (string) $ele['Id'];
+ }
+ }
+
+ // unparsed drawing AlternateContent
+ $xmlAltDrawing = simplexml_load_string(
+ $this->securityScanner->scan($this->getFromZipArchive($zip, $fileDrawing)),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ )->children('http://schemas.openxmlformats.org/markup-compatibility/2006');
+
+ if ($xmlAltDrawing->AlternateContent) {
+ foreach ($xmlAltDrawing->AlternateContent as $alternateContent) {
+ $unparsedLoadedData['sheets'][$docSheet->getCodeName()]['drawingAlternateContents'][] = $alternateContent->asXML();
+ }
+ }
+ }
+ }
+
+ $this->readFormControlProperties($excel, $zip, $dir, $fileWorksheet, $docSheet, $unparsedLoadedData);
+ $this->readPrinterSettings($excel, $zip, $dir, $fileWorksheet, $docSheet, $unparsedLoadedData);
+
+ // Loop through definedNames
+ if ($xmlWorkbook->definedNames) {
+ foreach ($xmlWorkbook->definedNames->definedName as $definedName) {
+ // Extract range
+ $extractedRange = (string) $definedName;
+ if (($spos = strpos($extractedRange, '!')) !== false) {
+ $extractedRange = substr($extractedRange, 0, $spos) . str_replace('$', '', substr($extractedRange, $spos));
+ } else {
+ $extractedRange = str_replace('$', '', $extractedRange);
+ }
+
+ // Valid range?
+ if (stripos((string) $definedName, '#REF!') !== false || $extractedRange == '') {
+ continue;
+ }
+
+ // Some definedNames are only applicable if we are on the same sheet...
+ if ((string) $definedName['localSheetId'] != '' && (string) $definedName['localSheetId'] == $oldSheetId) {
+ // Switch on type
+ switch ((string) $definedName['name']) {
+ case '_xlnm._FilterDatabase':
+ if ((string) $definedName['hidden'] !== '1') {
+ $extractedRange = explode(',', $extractedRange);
+ foreach ($extractedRange as $range) {
+ $autoFilterRange = $range;
+ if (strpos($autoFilterRange, ':') !== false) {
+ $docSheet->getAutoFilter()->setRange($autoFilterRange);
+ }
+ }
+ }
+
+ break;
+ case '_xlnm.Print_Titles':
+ // Split $extractedRange
+ $extractedRange = explode(',', $extractedRange);
+
+ // Set print titles
+ foreach ($extractedRange as $range) {
+ $matches = [];
+ $range = str_replace('$', '', $range);
+
+ // check for repeating columns, e g. 'A:A' or 'A:D'
+ if (preg_match('/!?([A-Z]+)\:([A-Z]+)$/', $range, $matches)) {
+ $docSheet->getPageSetup()->setColumnsToRepeatAtLeft([$matches[1], $matches[2]]);
+ } elseif (preg_match('/!?(\d+)\:(\d+)$/', $range, $matches)) {
+ // check for repeating rows, e.g. '1:1' or '1:5'
+ $docSheet->getPageSetup()->setRowsToRepeatAtTop([$matches[1], $matches[2]]);
+ }
+ }
+
+ break;
+ case '_xlnm.Print_Area':
+ $rangeSets = preg_split("/('?(?:.*?)'?(?:![A-Z0-9]+:[A-Z0-9]+)),?/", $extractedRange, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
+ $newRangeSets = [];
+ foreach ($rangeSets as $rangeSet) {
+ list($sheetName, $rangeSet) = Worksheet::extractSheetTitle($rangeSet, true);
+ if (strpos($rangeSet, ':') === false) {
+ $rangeSet = $rangeSet . ':' . $rangeSet;
+ }
+ $newRangeSets[] = str_replace('$', '', $rangeSet);
+ }
+ $docSheet->getPageSetup()->setPrintArea(implode(',', $newRangeSets));
+
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ }
+
+ // Next sheet id
+ ++$sheetId;
+ }
+
+ // Loop through definedNames
+ if ($xmlWorkbook->definedNames) {
+ foreach ($xmlWorkbook->definedNames->definedName as $definedName) {
+ // Extract range
+ $extractedRange = (string) $definedName;
+ if (($spos = strpos($extractedRange, '!')) !== false) {
+ $extractedRange = substr($extractedRange, 0, $spos) . str_replace('$', '', substr($extractedRange, $spos));
+ } else {
+ $extractedRange = str_replace('$', '', $extractedRange);
+ }
+
+ // Valid range?
+ if (stripos((string) $definedName, '#REF!') !== false || $extractedRange == '') {
+ continue;
+ }
+
+ // Some definedNames are only applicable if we are on the same sheet...
+ if ((string) $definedName['localSheetId'] != '') {
+ // Local defined name
+ // Switch on type
+ switch ((string) $definedName['name']) {
+ case '_xlnm._FilterDatabase':
+ case '_xlnm.Print_Titles':
+ case '_xlnm.Print_Area':
+ break;
+ default:
+ if ($mapSheetId[(int) $definedName['localSheetId']] !== null) {
+ if (strpos((string) $definedName, '!') !== false) {
+ $range = Worksheet::extractSheetTitle((string) $definedName, true);
+ $range[0] = str_replace("''", "'", $range[0]);
+ $range[0] = str_replace("'", '', $range[0]);
+ if ($worksheet = $docSheet->getParent()->getSheetByName($range[0])) {
+ $extractedRange = str_replace('$', '', $range[1]);
+ $scope = $docSheet->getParent()->getSheet($mapSheetId[(int) $definedName['localSheetId']]);
+ $excel->addNamedRange(new NamedRange((string) $definedName['name'], $worksheet, $extractedRange, true, $scope));
+ }
+ }
+ }
+
+ break;
+ }
+ } elseif (!isset($definedName['localSheetId'])) {
+ // "Global" definedNames
+ $locatedSheet = null;
+ $extractedSheetName = '';
+ if (strpos((string) $definedName, '!') !== false) {
+ // Extract sheet name
+ $extractedSheetName = Worksheet::extractSheetTitle((string) $definedName, true);
+ $extractedSheetName = $extractedSheetName[0];
+
+ // Locate sheet
+ $locatedSheet = $excel->getSheetByName($extractedSheetName);
+
+ // Modify range
+ list($worksheetName, $extractedRange) = Worksheet::extractSheetTitle($extractedRange, true);
+ }
+
+ if ($locatedSheet !== null) {
+ $excel->addNamedRange(new NamedRange((string) $definedName['name'], $locatedSheet, $extractedRange, false));
+ }
+ }
+ }
+ }
+ }
+
+ if ((!$this->readDataOnly) || (!empty($this->loadSheetsOnly))) {
+ $workbookView = $xmlWorkbook->bookViews->workbookView;
+
+ // active sheet index
+ $activeTab = (int) ($workbookView['activeTab']); // refers to old sheet index
+
+ // keep active sheet index if sheet is still loaded, else first sheet is set as the active
+ if (isset($mapSheetId[$activeTab]) && $mapSheetId[$activeTab] !== null) {
+ $excel->setActiveSheetIndex($mapSheetId[$activeTab]);
+ } else {
+ if ($excel->getSheetCount() == 0) {
+ $excel->createSheet();
+ }
+ $excel->setActiveSheetIndex(0);
+ }
+
+ if (isset($workbookView['showHorizontalScroll'])) {
+ $showHorizontalScroll = (string) $workbookView['showHorizontalScroll'];
+ $excel->setShowHorizontalScroll($this->castXsdBooleanToBool($showHorizontalScroll));
+ }
+
+ if (isset($workbookView['showVerticalScroll'])) {
+ $showVerticalScroll = (string) $workbookView['showVerticalScroll'];
+ $excel->setShowVerticalScroll($this->castXsdBooleanToBool($showVerticalScroll));
+ }
+
+ if (isset($workbookView['showSheetTabs'])) {
+ $showSheetTabs = (string) $workbookView['showSheetTabs'];
+ $excel->setShowSheetTabs($this->castXsdBooleanToBool($showSheetTabs));
+ }
+
+ if (isset($workbookView['minimized'])) {
+ $minimized = (string) $workbookView['minimized'];
+ $excel->setMinimized($this->castXsdBooleanToBool($minimized));
+ }
+
+ if (isset($workbookView['autoFilterDateGrouping'])) {
+ $autoFilterDateGrouping = (string) $workbookView['autoFilterDateGrouping'];
+ $excel->setAutoFilterDateGrouping($this->castXsdBooleanToBool($autoFilterDateGrouping));
+ }
+
+ if (isset($workbookView['firstSheet'])) {
+ $firstSheet = (string) $workbookView['firstSheet'];
+ $excel->setFirstSheetIndex((int) $firstSheet);
+ }
+
+ if (isset($workbookView['visibility'])) {
+ $visibility = (string) $workbookView['visibility'];
+ $excel->setVisibility($visibility);
+ }
+
+ if (isset($workbookView['tabRatio'])) {
+ $tabRatio = (string) $workbookView['tabRatio'];
+ $excel->setTabRatio((int) $tabRatio);
+ }
+ }
+
+ break;
+ }
+ }
+
+ if (!$this->readDataOnly) {
+ $contentTypes = simplexml_load_string(
+ $this->securityScanner->scan(
+ $this->getFromZipArchive($zip, '[Content_Types].xml')
+ ),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+
+ // Default content types
+ foreach ($contentTypes->Default as $contentType) {
+ switch ($contentType['ContentType']) {
+ case 'application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings':
+ $unparsedLoadedData['default_content_types'][(string) $contentType['Extension']] = (string) $contentType['ContentType'];
+
+ break;
+ }
+ }
+
+ // Override content types
+ foreach ($contentTypes->Override as $contentType) {
+ switch ($contentType['ContentType']) {
+ case 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml':
+ if ($this->includeCharts) {
+ $chartEntryRef = ltrim($contentType['PartName'], '/');
+ $chartElements = simplexml_load_string(
+ $this->securityScanner->scan(
+ $this->getFromZipArchive($zip, $chartEntryRef)
+ ),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ $objChart = Chart::readChart($chartElements, basename($chartEntryRef, '.xml'));
+
+ if (isset($charts[$chartEntryRef])) {
+ $chartPositionRef = $charts[$chartEntryRef]['sheet'] . '!' . $charts[$chartEntryRef]['id'];
+ if (isset($chartDetails[$chartPositionRef])) {
+ $excel->getSheetByName($charts[$chartEntryRef]['sheet'])->addChart($objChart);
+ $objChart->setWorksheet($excel->getSheetByName($charts[$chartEntryRef]['sheet']));
+ $objChart->setTopLeftPosition($chartDetails[$chartPositionRef]['fromCoordinate'], $chartDetails[$chartPositionRef]['fromOffsetX'], $chartDetails[$chartPositionRef]['fromOffsetY']);
+ $objChart->setBottomRightPosition($chartDetails[$chartPositionRef]['toCoordinate'], $chartDetails[$chartPositionRef]['toOffsetX'], $chartDetails[$chartPositionRef]['toOffsetY']);
+ }
+ }
+ }
+
+ break;
+
+ // unparsed
+ case 'application/vnd.ms-excel.controlproperties+xml':
+ $unparsedLoadedData['override_content_types'][(string) $contentType['PartName']] = (string) $contentType['ContentType'];
+
+ break;
+ }
+ }
+ }
+
+ $excel->setUnparsedLoadedData($unparsedLoadedData);
+
+ $zip->close();
+
+ return $excel;
+ }
+
+ private static function readColor($color, $background = false)
+ {
+ if (isset($color['rgb'])) {
+ return (string) $color['rgb'];
+ } elseif (isset($color['indexed'])) {
+ return Color::indexedColor($color['indexed'] - 7, $background)->getARGB();
+ } elseif (isset($color['theme'])) {
+ if (self::$theme !== null) {
+ $returnColour = self::$theme->getColourByIndex((int) $color['theme']);
+ if (isset($color['tint'])) {
+ $tintAdjust = (float) $color['tint'];
+ $returnColour = Color::changeBrightness($returnColour, $tintAdjust);
+ }
+
+ return 'FF' . $returnColour;
+ }
+ }
+
+ if ($background) {
+ return 'FFFFFFFF';
+ }
+
+ return 'FF000000';
+ }
+
+ /**
+ * @param Style $docStyle
+ * @param SimpleXMLElement|\stdClass $style
+ */
+ private static function readStyle(Style $docStyle, $style)
+ {
+ $docStyle->getNumberFormat()->setFormatCode($style->numFmt);
+
+ // font
+ if (isset($style->font)) {
+ $docStyle->getFont()->setName((string) $style->font->name['val']);
+ $docStyle->getFont()->setSize((string) $style->font->sz['val']);
+ if (isset($style->font->b)) {
+ $docStyle->getFont()->setBold(!isset($style->font->b['val']) || self::boolean((string) $style->font->b['val']));
+ }
+ if (isset($style->font->i)) {
+ $docStyle->getFont()->setItalic(!isset($style->font->i['val']) || self::boolean((string) $style->font->i['val']));
+ }
+ if (isset($style->font->strike)) {
+ $docStyle->getFont()->setStrikethrough(!isset($style->font->strike['val']) || self::boolean((string) $style->font->strike['val']));
+ }
+ $docStyle->getFont()->getColor()->setARGB(self::readColor($style->font->color));
+
+ if (isset($style->font->u) && !isset($style->font->u['val'])) {
+ $docStyle->getFont()->setUnderline(\PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE);
+ } elseif (isset($style->font->u, $style->font->u['val'])) {
+ $docStyle->getFont()->setUnderline((string) $style->font->u['val']);
+ }
+
+ if (isset($style->font->vertAlign, $style->font->vertAlign['val'])) {
+ $vertAlign = strtolower((string) $style->font->vertAlign['val']);
+ if ($vertAlign == 'superscript') {
+ $docStyle->getFont()->setSuperscript(true);
+ }
+ if ($vertAlign == 'subscript') {
+ $docStyle->getFont()->setSubscript(true);
+ }
+ }
+ }
+
+ // fill
+ if (isset($style->fill)) {
+ if ($style->fill->gradientFill) {
+ /** @var SimpleXMLElement $gradientFill */
+ $gradientFill = $style->fill->gradientFill[0];
+ if (!empty($gradientFill['type'])) {
+ $docStyle->getFill()->setFillType((string) $gradientFill['type']);
+ }
+ $docStyle->getFill()->setRotation((float) ($gradientFill['degree']));
+ $gradientFill->registerXPathNamespace('sml', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main');
+ $docStyle->getFill()->getStartColor()->setARGB(self::readColor(self::getArrayItem($gradientFill->xpath('sml:stop[@position=0]'))->color));
+ $docStyle->getFill()->getEndColor()->setARGB(self::readColor(self::getArrayItem($gradientFill->xpath('sml:stop[@position=1]'))->color));
+ } elseif ($style->fill->patternFill) {
+ $patternType = (string) $style->fill->patternFill['patternType'] != '' ? (string) $style->fill->patternFill['patternType'] : 'solid';
+ $docStyle->getFill()->setFillType($patternType);
+ if ($style->fill->patternFill->fgColor) {
+ $docStyle->getFill()->getStartColor()->setARGB(self::readColor($style->fill->patternFill->fgColor, true));
+ } else {
+ $docStyle->getFill()->getStartColor()->setARGB('FF000000');
+ }
+ if ($style->fill->patternFill->bgColor) {
+ $docStyle->getFill()->getEndColor()->setARGB(self::readColor($style->fill->patternFill->bgColor, true));
+ }
+ }
+ }
+
+ // border
+ if (isset($style->border)) {
+ $diagonalUp = self::boolean((string) $style->border['diagonalUp']);
+ $diagonalDown = self::boolean((string) $style->border['diagonalDown']);
+ if (!$diagonalUp && !$diagonalDown) {
+ $docStyle->getBorders()->setDiagonalDirection(Borders::DIAGONAL_NONE);
+ } elseif ($diagonalUp && !$diagonalDown) {
+ $docStyle->getBorders()->setDiagonalDirection(Borders::DIAGONAL_UP);
+ } elseif (!$diagonalUp && $diagonalDown) {
+ $docStyle->getBorders()->setDiagonalDirection(Borders::DIAGONAL_DOWN);
+ } else {
+ $docStyle->getBorders()->setDiagonalDirection(Borders::DIAGONAL_BOTH);
+ }
+ self::readBorder($docStyle->getBorders()->getLeft(), $style->border->left);
+ self::readBorder($docStyle->getBorders()->getRight(), $style->border->right);
+ self::readBorder($docStyle->getBorders()->getTop(), $style->border->top);
+ self::readBorder($docStyle->getBorders()->getBottom(), $style->border->bottom);
+ self::readBorder($docStyle->getBorders()->getDiagonal(), $style->border->diagonal);
+ }
+
+ // alignment
+ if (isset($style->alignment)) {
+ $docStyle->getAlignment()->setHorizontal((string) $style->alignment['horizontal']);
+ $docStyle->getAlignment()->setVertical((string) $style->alignment['vertical']);
+
+ $textRotation = 0;
+ if ((int) $style->alignment['textRotation'] <= 90) {
+ $textRotation = (int) $style->alignment['textRotation'];
+ } elseif ((int) $style->alignment['textRotation'] > 90) {
+ $textRotation = 90 - (int) $style->alignment['textRotation'];
+ }
+
+ $docStyle->getAlignment()->setTextRotation((int) $textRotation);
+ $docStyle->getAlignment()->setWrapText(self::boolean((string) $style->alignment['wrapText']));
+ $docStyle->getAlignment()->setShrinkToFit(self::boolean((string) $style->alignment['shrinkToFit']));
+ $docStyle->getAlignment()->setIndent((int) ((string) $style->alignment['indent']) > 0 ? (int) ((string) $style->alignment['indent']) : 0);
+ $docStyle->getAlignment()->setReadOrder((int) ((string) $style->alignment['readingOrder']) > 0 ? (int) ((string) $style->alignment['readingOrder']) : 0);
+ }
+
+ // protection
+ if (isset($style->protection)) {
+ if (isset($style->protection['locked'])) {
+ if (self::boolean((string) $style->protection['locked'])) {
+ $docStyle->getProtection()->setLocked(Protection::PROTECTION_PROTECTED);
+ } else {
+ $docStyle->getProtection()->setLocked(Protection::PROTECTION_UNPROTECTED);
+ }
+ }
+
+ if (isset($style->protection['hidden'])) {
+ if (self::boolean((string) $style->protection['hidden'])) {
+ $docStyle->getProtection()->setHidden(Protection::PROTECTION_PROTECTED);
+ } else {
+ $docStyle->getProtection()->setHidden(Protection::PROTECTION_UNPROTECTED);
+ }
+ }
+ }
+
+ // top-level style settings
+ if (isset($style->quotePrefix)) {
+ $docStyle->setQuotePrefix($style->quotePrefix);
+ }
+ }
+
+ /**
+ * @param Border $docBorder
+ * @param SimpleXMLElement $eleBorder
+ */
+ private static function readBorder(Border $docBorder, $eleBorder)
+ {
+ if (isset($eleBorder['style'])) {
+ $docBorder->setBorderStyle((string) $eleBorder['style']);
+ }
+ if (isset($eleBorder->color)) {
+ $docBorder->getColor()->setARGB(self::readColor($eleBorder->color));
+ }
+ }
+
+ /**
+ * @param SimpleXMLElement | null $is
+ *
+ * @return RichText
+ */
+ private function parseRichText($is)
+ {
+ $value = new RichText();
+
+ if (isset($is->t)) {
+ $value->createText(StringHelper::controlCharacterOOXML2PHP((string) $is->t));
+ } else {
+ if (is_object($is->r)) {
+ foreach ($is->r as $run) {
+ if (!isset($run->rPr)) {
+ $value->createText(StringHelper::controlCharacterOOXML2PHP((string) $run->t));
+ } else {
+ $objText = $value->createTextRun(StringHelper::controlCharacterOOXML2PHP((string) $run->t));
+
+ if (isset($run->rPr->rFont['val'])) {
+ $objText->getFont()->setName((string) $run->rPr->rFont['val']);
+ }
+ if (isset($run->rPr->sz['val'])) {
+ $objText->getFont()->setSize((float) $run->rPr->sz['val']);
+ }
+ if (isset($run->rPr->color)) {
+ $objText->getFont()->setColor(new Color(self::readColor($run->rPr->color)));
+ }
+ if ((isset($run->rPr->b['val']) && self::boolean((string) $run->rPr->b['val'])) ||
+ (isset($run->rPr->b) && !isset($run->rPr->b['val']))) {
+ $objText->getFont()->setBold(true);
+ }
+ if ((isset($run->rPr->i['val']) && self::boolean((string) $run->rPr->i['val'])) ||
+ (isset($run->rPr->i) && !isset($run->rPr->i['val']))) {
+ $objText->getFont()->setItalic(true);
+ }
+ if (isset($run->rPr->vertAlign, $run->rPr->vertAlign['val'])) {
+ $vertAlign = strtolower((string) $run->rPr->vertAlign['val']);
+ if ($vertAlign == 'superscript') {
+ $objText->getFont()->setSuperscript(true);
+ }
+ if ($vertAlign == 'subscript') {
+ $objText->getFont()->setSubscript(true);
+ }
+ }
+ if (isset($run->rPr->u) && !isset($run->rPr->u['val'])) {
+ $objText->getFont()->setUnderline(\PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_SINGLE);
+ } elseif (isset($run->rPr->u, $run->rPr->u['val'])) {
+ $objText->getFont()->setUnderline((string) $run->rPr->u['val']);
+ }
+ if ((isset($run->rPr->strike['val']) && self::boolean((string) $run->rPr->strike['val'])) ||
+ (isset($run->rPr->strike) && !isset($run->rPr->strike['val']))) {
+ $objText->getFont()->setStrikethrough(true);
+ }
+ }
+ }
+ }
+ }
+
+ return $value;
+ }
+
+ /**
+ * @param Spreadsheet $excel
+ * @param mixed $customUITarget
+ * @param mixed $zip
+ */
+ private function readRibbon(Spreadsheet $excel, $customUITarget, $zip)
+ {
+ $baseDir = dirname($customUITarget);
+ $nameCustomUI = basename($customUITarget);
+ // get the xml file (ribbon)
+ $localRibbon = $this->getFromZipArchive($zip, $customUITarget);
+ $customUIImagesNames = [];
+ $customUIImagesBinaries = [];
+ // something like customUI/_rels/customUI.xml.rels
+ $pathRels = $baseDir . '/_rels/' . $nameCustomUI . '.rels';
+ $dataRels = $this->getFromZipArchive($zip, $pathRels);
+ if ($dataRels) {
+ // exists and not empty if the ribbon have some pictures (other than internal MSO)
+ $UIRels = simplexml_load_string(
+ $this->securityScanner->scan($dataRels),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ if (false !== $UIRels) {
+ // we need to save id and target to avoid parsing customUI.xml and "guess" if it's a pseudo callback who load the image
+ foreach ($UIRels->Relationship as $ele) {
+ if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image') {
+ // an image ?
+ $customUIImagesNames[(string) $ele['Id']] = (string) $ele['Target'];
+ $customUIImagesBinaries[(string) $ele['Target']] = $this->getFromZipArchive($zip, $baseDir . '/' . (string) $ele['Target']);
+ }
+ }
+ }
+ }
+ if ($localRibbon) {
+ $excel->setRibbonXMLData($customUITarget, $localRibbon);
+ if (count($customUIImagesNames) > 0 && count($customUIImagesBinaries) > 0) {
+ $excel->setRibbonBinObjects($customUIImagesNames, $customUIImagesBinaries);
+ } else {
+ $excel->setRibbonBinObjects(null, null);
+ }
+ } else {
+ $excel->setRibbonXMLData(null, null);
+ $excel->setRibbonBinObjects(null, null);
+ }
+ }
+
+ private static function getArrayItem($array, $key = 0)
+ {
+ return isset($array[$key]) ? $array[$key] : null;
+ }
+
+ private static function dirAdd($base, $add)
+ {
+ return preg_replace('~[^/]+/\.\./~', '', dirname($base) . "/$add");
+ }
+
+ private static function toCSSArray($style)
+ {
+ $style = trim(str_replace(["\r", "\n"], '', $style), ';');
+
+ $temp = explode(';', $style);
+ $style = [];
+ foreach ($temp as $item) {
+ $item = explode(':', $item);
+
+ if (strpos($item[1], 'px') !== false) {
+ $item[1] = str_replace('px', '', $item[1]);
+ }
+ if (strpos($item[1], 'pt') !== false) {
+ $item[1] = str_replace('pt', '', $item[1]);
+ $item[1] = Font::fontSizeToPixels($item[1]);
+ }
+ if (strpos($item[1], 'in') !== false) {
+ $item[1] = str_replace('in', '', $item[1]);
+ $item[1] = Font::inchSizeToPixels($item[1]);
+ }
+ if (strpos($item[1], 'cm') !== false) {
+ $item[1] = str_replace('cm', '', $item[1]);
+ $item[1] = Font::centimeterSizeToPixels($item[1]);
+ }
+
+ $style[$item[0]] = $item[1];
+ }
+
+ return $style;
+ }
+
+ private static function boolean($value)
+ {
+ if (is_object($value)) {
+ $value = (string) $value;
+ }
+ if (is_numeric($value)) {
+ return (bool) $value;
+ }
+
+ return $value === 'true' || $value === 'TRUE';
+ }
+
+ /**
+ * @param \PhpOffice\PhpSpreadsheet\Worksheet\Drawing $objDrawing
+ * @param \SimpleXMLElement $cellAnchor
+ * @param array $hyperlinks
+ */
+ private function readHyperLinkDrawing($objDrawing, $cellAnchor, $hyperlinks)
+ {
+ $hlinkClick = $cellAnchor->pic->nvPicPr->cNvPr->children('http://schemas.openxmlformats.org/drawingml/2006/main')->hlinkClick;
+
+ if ($hlinkClick->count() === 0) {
+ return;
+ }
+
+ $hlinkId = (string) $hlinkClick->attributes('http://schemas.openxmlformats.org/officeDocument/2006/relationships')['id'];
+ $hyperlink = new Hyperlink(
+ $hyperlinks[$hlinkId],
+ (string) self::getArrayItem($cellAnchor->pic->nvPicPr->cNvPr->attributes(), 'name')
+ );
+ $objDrawing->setHyperlink($hyperlink);
+ }
+
+ private function readProtection(Spreadsheet $excel, SimpleXMLElement $xmlWorkbook)
+ {
+ if (!$xmlWorkbook->workbookProtection) {
+ return;
+ }
+
+ if ($xmlWorkbook->workbookProtection['lockRevision']) {
+ $excel->getSecurity()->setLockRevision((bool) $xmlWorkbook->workbookProtection['lockRevision']);
+ }
+
+ if ($xmlWorkbook->workbookProtection['lockStructure']) {
+ $excel->getSecurity()->setLockStructure((bool) $xmlWorkbook->workbookProtection['lockStructure']);
+ }
+
+ if ($xmlWorkbook->workbookProtection['lockWindows']) {
+ $excel->getSecurity()->setLockWindows((bool) $xmlWorkbook->workbookProtection['lockWindows']);
+ }
+
+ if ($xmlWorkbook->workbookProtection['revisionsPassword']) {
+ $excel->getSecurity()->setRevisionsPassword((string) $xmlWorkbook->workbookProtection['revisionsPassword'], true);
+ }
+
+ if ($xmlWorkbook->workbookProtection['workbookPassword']) {
+ $excel->getSecurity()->setWorkbookPassword((string) $xmlWorkbook->workbookProtection['workbookPassword'], true);
+ }
+ }
+
+ private function readFormControlProperties(Spreadsheet $excel, ZipArchive $zip, $dir, $fileWorksheet, $docSheet, array &$unparsedLoadedData)
+ {
+ if (!$zip->locateName(dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')) {
+ return;
+ }
+
+ //~ http://schemas.openxmlformats.org/package/2006/relationships"
+ $relsWorksheet = simplexml_load_string(
+ $this->securityScanner->scan(
+ $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')
+ ),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ $ctrlProps = [];
+ foreach ($relsWorksheet->Relationship as $ele) {
+ if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp') {
+ $ctrlProps[(string) $ele['Id']] = $ele;
+ }
+ }
+
+ $unparsedCtrlProps = &$unparsedLoadedData['sheets'][$docSheet->getCodeName()]['ctrlProps'];
+ foreach ($ctrlProps as $rId => $ctrlProp) {
+ $rId = substr($rId, 3); // rIdXXX
+ $unparsedCtrlProps[$rId] = [];
+ $unparsedCtrlProps[$rId]['filePath'] = self::dirAdd("$dir/$fileWorksheet", $ctrlProp['Target']);
+ $unparsedCtrlProps[$rId]['relFilePath'] = (string) $ctrlProp['Target'];
+ $unparsedCtrlProps[$rId]['content'] = $this->securityScanner->scan($this->getFromZipArchive($zip, $unparsedCtrlProps[$rId]['filePath']));
+ }
+ unset($unparsedCtrlProps);
+ }
+
+ private function readPrinterSettings(Spreadsheet $excel, ZipArchive $zip, $dir, $fileWorksheet, $docSheet, array &$unparsedLoadedData)
+ {
+ if (!$zip->locateName(dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')) {
+ return;
+ }
+
+ //~ http://schemas.openxmlformats.org/package/2006/relationships"
+ $relsWorksheet = simplexml_load_string(
+ $this->securityScanner->scan(
+ $this->getFromZipArchive($zip, dirname("$dir/$fileWorksheet") . '/_rels/' . basename($fileWorksheet) . '.rels')
+ ),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ $sheetPrinterSettings = [];
+ foreach ($relsWorksheet->Relationship as $ele) {
+ if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/printerSettings') {
+ $sheetPrinterSettings[(string) $ele['Id']] = $ele;
+ }
+ }
+
+ $unparsedPrinterSettings = &$unparsedLoadedData['sheets'][$docSheet->getCodeName()]['printerSettings'];
+ foreach ($sheetPrinterSettings as $rId => $printerSettings) {
+ $rId = substr($rId, 3); // rIdXXX
+ $unparsedPrinterSettings[$rId] = [];
+ $unparsedPrinterSettings[$rId]['filePath'] = self::dirAdd("$dir/$fileWorksheet", $printerSettings['Target']);
+ $unparsedPrinterSettings[$rId]['relFilePath'] = (string) $printerSettings['Target'];
+ $unparsedPrinterSettings[$rId]['content'] = $this->securityScanner->scan($this->getFromZipArchive($zip, $unparsedPrinterSettings[$rId]['filePath']));
+ }
+ unset($unparsedPrinterSettings);
+ }
+
+ /**
+ * Convert an 'xsd:boolean' XML value to a PHP boolean value.
+ * A valid 'xsd:boolean' XML value can be one of the following
+ * four values: 'true', 'false', '1', '0'. It is case sensitive.
+ *
+ * Note that just doing '(bool) $xsdBoolean' is not safe,
+ * since '(bool) "false"' returns true.
+ *
+ * @see https://www.w3.org/TR/xmlschema11-2/#boolean
+ *
+ * @param string $xsdBoolean An XML string value of type 'xsd:boolean'
+ *
+ * @return bool Boolean value
+ */
+ private function castXsdBooleanToBool($xsdBoolean)
+ {
+ if ($xsdBoolean === 'false') {
+ return false;
+ }
+
+ return (bool) $xsdBoolean;
+ }
+
+ /**
+ * Read columns and rows attributes from XML and set them on the worksheet.
+ *
+ * @param SimpleXMLElement $xmlSheet
+ * @param Worksheet $docSheet
+ */
+ private function readColumnsAndRowsAttributes(SimpleXMLElement $xmlSheet, Worksheet $docSheet)
+ {
+ $columnsAttributes = [];
+ $rowsAttributes = [];
+ if (isset($xmlSheet->cols) && !$this->readDataOnly) {
+ foreach ($xmlSheet->cols->col as $col) {
+ for ($i = (int) ($col['min']); $i <= (int) ($col['max']); ++$i) {
+ if ($col['style'] && !$this->readDataOnly) {
+ $columnsAttributes[Coordinate::stringFromColumnIndex($i)]['xfIndex'] = (int) $col['style'];
+ }
+ if (self::boolean($col['hidden'])) {
+ $columnsAttributes[Coordinate::stringFromColumnIndex($i)]['visible'] = false;
+ }
+ if (self::boolean($col['collapsed'])) {
+ $columnsAttributes[Coordinate::stringFromColumnIndex($i)]['collapsed'] = true;
+ }
+ if ($col['outlineLevel'] > 0) {
+ $columnsAttributes[Coordinate::stringFromColumnIndex($i)]['outlineLevel'] = (int) $col['outlineLevel'];
+ }
+ $columnsAttributes[Coordinate::stringFromColumnIndex($i)]['width'] = (float) $col['width'];
+
+ if ((int) ($col['max']) == 16384) {
+ break;
+ }
+ }
+ }
+ }
+
+ if ($xmlSheet && $xmlSheet->sheetData && $xmlSheet->sheetData->row) {
+ foreach ($xmlSheet->sheetData->row as $row) {
+ if ($row['ht'] && !$this->readDataOnly) {
+ $rowsAttributes[(int) $row['r']]['rowHeight'] = (float) $row['ht'];
+ }
+ if (self::boolean($row['hidden']) && !$this->readDataOnly) {
+ $rowsAttributes[(int) $row['r']]['visible'] = false;
+ }
+ if (self::boolean($row['collapsed'])) {
+ $rowsAttributes[(int) $row['r']]['collapsed'] = true;
+ }
+ if ($row['outlineLevel'] > 0) {
+ $rowsAttributes[(int) $row['r']]['outlineLevel'] = (int) $row['outlineLevel'];
+ }
+ if ($row['s'] && !$this->readDataOnly) {
+ $rowsAttributes[(int) $row['r']]['xfIndex'] = (int) $row['s'];
+ }
+ }
+ }
+
+ $readFilter = (\get_class($this->getReadFilter()) !== DefaultReadFilter::class ? $this->getReadFilter() : null);
+
+ // set columns/rows attributes
+ $columnsAttributesSet = [];
+ $rowsAttributesSet = [];
+ foreach ($columnsAttributes as $coordColumn => $columnAttributes) {
+ if ($readFilter !== null) {
+ foreach ($rowsAttributes as $coordRow => $rowAttributes) {
+ if (!$readFilter->readCell($coordColumn, $coordRow, $docSheet->getTitle())) {
+ continue 2;
+ }
+ }
+ }
+
+ if (!isset($columnsAttributesSet[$coordColumn])) {
+ $this->setColumnAttributes($docSheet, $coordColumn, $columnAttributes);
+ $columnsAttributesSet[$coordColumn] = true;
+ }
+ }
+
+ foreach ($rowsAttributes as $coordRow => $rowAttributes) {
+ if ($readFilter !== null) {
+ foreach ($columnsAttributes as $coordColumn => $columnAttributes) {
+ if (!$readFilter->readCell($coordColumn, $coordRow, $docSheet->getTitle())) {
+ continue 2;
+ }
+ }
+ }
+
+ if (!isset($rowsAttributesSet[$coordRow])) {
+ $this->setRowAttributes($docSheet, $coordRow, $rowAttributes);
+ $rowsAttributesSet[$coordRow] = true;
+ }
+ }
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Reader/Excel2007/Chart.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Chart.php
similarity index 71%
rename from lib/phpexcel/PHPExcel/Reader/Excel2007/Chart.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Chart.php
index 88f336b380d..2b920d705c3 100644
--- a/lib/phpexcel/PHPExcel/Reader/Excel2007/Chart.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Chart.php
@@ -1,67 +1,62 @@
attributes();
if (isset($attributes[$name])) {
if ($format == 'string') {
return (string) $attributes[$name];
} elseif ($format == 'integer') {
- return (integer) $attributes[$name];
+ return (int) $attributes[$name];
} elseif ($format == 'boolean') {
- return (boolean) ($attributes[$name] === '0' || $attributes[$name] !== 'true') ? false : true;
- } else {
- return (float) $attributes[$name];
+ return (bool) ($attributes[$name] === '0' || $attributes[$name] !== 'true') ? false : true;
}
+
+ return (float) $attributes[$name];
}
+
return null;
}
-
private static function readColor($color, $background = false)
{
- if (isset($color["rgb"])) {
- return (string)$color["rgb"];
- } elseif (isset($color["indexed"])) {
- return PHPExcel_Style_Color::indexedColor($color["indexed"]-7, $background)->getARGB();
+ if (isset($color['rgb'])) {
+ return (string) $color['rgb'];
+ } elseif (isset($color['indexed'])) {
+ return Color::indexedColor($color['indexed'] - 7, $background)->getARGB();
}
}
- public static function readChart($chartElements, $chartName)
+ /**
+ * @param SimpleXMLElement $chartElements
+ * @param string $chartName
+ *
+ * @return \PhpOffice\PhpSpreadsheet\Chart\Chart
+ */
+ public static function readChart(SimpleXMLElement $chartElements, $chartName)
{
$namespacesChartMeta = $chartElements->getNamespaces(true);
$chartElementsC = $chartElements->children($namespacesChartMeta['c']);
@@ -71,161 +66,184 @@ class PHPExcel_Reader_Excel2007_Chart
foreach ($chartElementsC as $chartElementKey => $chartElement) {
switch ($chartElementKey) {
- case "chart":
+ case 'chart':
foreach ($chartElement as $chartDetailsKey => $chartDetails) {
$chartDetailsC = $chartDetails->children($namespacesChartMeta['c']);
switch ($chartDetailsKey) {
- case "plotArea":
+ case 'plotArea':
$plotAreaLayout = $XaxisLable = $YaxisLable = null;
- $plotSeries = $plotAttributes = array();
+ $plotSeries = $plotAttributes = [];
foreach ($chartDetails as $chartDetailKey => $chartDetail) {
switch ($chartDetailKey) {
- case "layout":
- $plotAreaLayout = self::chartLayoutDetails($chartDetail, $namespacesChartMeta, 'plotArea');
+ case 'layout':
+ $plotAreaLayout = self::chartLayoutDetails($chartDetail, $namespacesChartMeta);
+
break;
- case "catAx":
+ case 'catAx':
if (isset($chartDetail->title)) {
- $XaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta, 'cat');
+ $XaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta);
}
+
break;
- case "dateAx":
+ case 'dateAx':
if (isset($chartDetail->title)) {
- $XaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta, 'cat');
+ $XaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta);
}
+
break;
- case "valAx":
+ case 'valAx':
if (isset($chartDetail->title)) {
- $YaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta, 'cat');
+ $YaxisLabel = self::chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta);
}
+
break;
- case "barChart":
- case "bar3DChart":
+ case 'barChart':
+ case 'bar3DChart':
$barDirection = self::getAttribute($chartDetail->barDir, 'val', 'string');
$plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotSer->setPlotDirection($barDirection);
$plotSeries[] = $plotSer;
$plotAttributes = self::readChartAttributes($chartDetail);
+
break;
- case "lineChart":
- case "line3DChart":
+ case 'lineChart':
+ case 'line3DChart':
$plotSeries[] = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotAttributes = self::readChartAttributes($chartDetail);
+
break;
- case "areaChart":
- case "area3DChart":
+ case 'areaChart':
+ case 'area3DChart':
$plotSeries[] = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotAttributes = self::readChartAttributes($chartDetail);
+
break;
- case "doughnutChart":
- case "pieChart":
- case "pie3DChart":
+ case 'doughnutChart':
+ case 'pieChart':
+ case 'pie3DChart':
$explosion = isset($chartDetail->ser->explosion);
$plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotSer->setPlotStyle($explosion);
$plotSeries[] = $plotSer;
$plotAttributes = self::readChartAttributes($chartDetail);
+
break;
- case "scatterChart":
+ case 'scatterChart':
$scatterStyle = self::getAttribute($chartDetail->scatterStyle, 'val', 'string');
$plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotSer->setPlotStyle($scatterStyle);
$plotSeries[] = $plotSer;
$plotAttributes = self::readChartAttributes($chartDetail);
+
break;
- case "bubbleChart":
+ case 'bubbleChart':
$bubbleScale = self::getAttribute($chartDetail->bubbleScale, 'val', 'integer');
$plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotSer->setPlotStyle($bubbleScale);
$plotSeries[] = $plotSer;
$plotAttributes = self::readChartAttributes($chartDetail);
+
break;
- case "radarChart":
+ case 'radarChart':
$radarStyle = self::getAttribute($chartDetail->radarStyle, 'val', 'string');
$plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotSer->setPlotStyle($radarStyle);
$plotSeries[] = $plotSer;
$plotAttributes = self::readChartAttributes($chartDetail);
+
break;
- case "surfaceChart":
- case "surface3DChart":
+ case 'surfaceChart':
+ case 'surface3DChart':
$wireFrame = self::getAttribute($chartDetail->wireframe, 'val', 'boolean');
$plotSer = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotSer->setPlotStyle($wireFrame);
$plotSeries[] = $plotSer;
$plotAttributes = self::readChartAttributes($chartDetail);
+
break;
- case "stockChart":
+ case 'stockChart':
$plotSeries[] = self::chartDataSeries($chartDetail, $namespacesChartMeta, $chartDetailKey);
$plotAttributes = self::readChartAttributes($plotAreaLayout);
+
break;
}
}
if ($plotAreaLayout == null) {
- $plotAreaLayout = new PHPExcel_Chart_Layout();
+ $plotAreaLayout = new Layout();
}
- $plotArea = new PHPExcel_Chart_PlotArea($plotAreaLayout, $plotSeries);
+ $plotArea = new PlotArea($plotAreaLayout, $plotSeries);
self::setChartAttributes($plotAreaLayout, $plotAttributes);
+
break;
- case "plotVisOnly":
+ case 'plotVisOnly':
$plotVisOnly = self::getAttribute($chartDetails, 'val', 'string');
+
break;
- case "dispBlanksAs":
+ case 'dispBlanksAs':
$dispBlanksAs = self::getAttribute($chartDetails, 'val', 'string');
+
break;
- case "title":
- $title = self::chartTitle($chartDetails, $namespacesChartMeta, 'title');
+ case 'title':
+ $title = self::chartTitle($chartDetails, $namespacesChartMeta);
+
break;
- case "legend":
+ case 'legend':
$legendPos = 'r';
$legendLayout = null;
$legendOverlay = false;
foreach ($chartDetails as $chartDetailKey => $chartDetail) {
switch ($chartDetailKey) {
- case "legendPos":
+ case 'legendPos':
$legendPos = self::getAttribute($chartDetail, 'val', 'string');
+
break;
- case "overlay":
+ case 'overlay':
$legendOverlay = self::getAttribute($chartDetail, 'val', 'boolean');
+
break;
- case "layout":
- $legendLayout = self::chartLayoutDetails($chartDetail, $namespacesChartMeta, 'legend');
+ case 'layout':
+ $legendLayout = self::chartLayoutDetails($chartDetail, $namespacesChartMeta);
+
break;
}
}
- $legend = new PHPExcel_Chart_Legend($legendPos, $legendLayout, $legendOverlay);
+ $legend = new Legend($legendPos, $legendLayout, $legendOverlay);
+
break;
}
}
}
}
- $chart = new PHPExcel_Chart($chartName, $title, $legend, $plotArea, $plotVisOnly, $dispBlanksAs, $XaxisLabel, $YaxisLabel);
+ $chart = new \PhpOffice\PhpSpreadsheet\Chart\Chart($chartName, $title, $legend, $plotArea, $plotVisOnly, $dispBlanksAs, $XaxisLabel, $YaxisLabel);
return $chart;
}
- private static function chartTitle($titleDetails, $namespacesChartMeta, $type)
+ private static function chartTitle(SimpleXMLElement $titleDetails, array $namespacesChartMeta)
{
- $caption = array();
+ $caption = [];
$titleLayout = null;
foreach ($titleDetails as $titleDetailKey => $chartDetail) {
switch ($titleDetailKey) {
- case "tx":
+ case 'tx':
$titleDetails = $chartDetail->rich->children($namespacesChartMeta['a']);
foreach ($titleDetails as $titleKey => $titleDetail) {
switch ($titleKey) {
- case "p":
+ case 'p':
$titleDetailPart = $titleDetail->children($namespacesChartMeta['a']);
$caption[] = self::parseRichText($titleDetailPart);
}
}
+
break;
- case "layout":
+ case 'layout':
$titleLayout = self::chartLayoutDetails($chartDetail, $namespacesChartMeta);
+
break;
}
}
- return new PHPExcel_Chart_Title($caption, $titleLayout);
+ return new Title($caption, $titleLayout);
}
private static function chartLayoutDetails($chartDetail, $namespacesChartMeta)
@@ -234,101 +252,112 @@ class PHPExcel_Reader_Excel2007_Chart
return null;
}
$details = $chartDetail->manualLayout->children($namespacesChartMeta['c']);
- if (is_null($details)) {
+ if ($details === null) {
return null;
}
- $layout = array();
+ $layout = [];
foreach ($details as $detailKey => $detail) {
-// echo $detailKey, ' => ',self::getAttribute($detail, 'val', 'string'),PHP_EOL;
$layout[$detailKey] = self::getAttribute($detail, 'val', 'string');
}
- return new PHPExcel_Chart_Layout($layout);
+
+ return new Layout($layout);
}
private static function chartDataSeries($chartDetail, $namespacesChartMeta, $plotType)
{
$multiSeriesType = null;
$smoothLine = false;
- $seriesLabel = $seriesCategory = $seriesValues = $plotOrder = array();
+ $seriesLabel = $seriesCategory = $seriesValues = $plotOrder = [];
$seriesDetailSet = $chartDetail->children($namespacesChartMeta['c']);
foreach ($seriesDetailSet as $seriesDetailKey => $seriesDetails) {
switch ($seriesDetailKey) {
- case "grouping":
+ case 'grouping':
$multiSeriesType = self::getAttribute($chartDetail->grouping, 'val', 'string');
+
break;
- case "ser":
+ case 'ser':
$marker = null;
+ $seriesIndex = '';
foreach ($seriesDetails as $seriesKey => $seriesDetail) {
switch ($seriesKey) {
- case "idx":
+ case 'idx':
$seriesIndex = self::getAttribute($seriesDetail, 'val', 'integer');
+
break;
- case "order":
+ case 'order':
$seriesOrder = self::getAttribute($seriesDetail, 'val', 'integer');
$plotOrder[$seriesIndex] = $seriesOrder;
+
break;
- case "tx":
+ case 'tx':
$seriesLabel[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta);
+
break;
- case "marker":
+ case 'marker':
$marker = self::getAttribute($seriesDetail->symbol, 'val', 'string');
+
break;
- case "smooth":
+ case 'smooth':
$smoothLine = self::getAttribute($seriesDetail, 'val', 'boolean');
+
break;
- case "cat":
+ case 'cat':
$seriesCategory[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta);
+
break;
- case "val":
+ case 'val':
$seriesValues[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker);
+
break;
- case "xVal":
+ case 'xVal':
$seriesCategory[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker);
+
break;
- case "yVal":
+ case 'yVal':
$seriesValues[$seriesIndex] = self::chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker);
+
break;
}
}
}
}
- return new PHPExcel_Chart_DataSeries($plotType, $multiSeriesType, $plotOrder, $seriesLabel, $seriesCategory, $seriesValues, $smoothLine);
+
+ return new DataSeries($plotType, $multiSeriesType, $plotOrder, $seriesLabel, $seriesCategory, $seriesValues, $smoothLine);
}
-
- private static function chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker = null, $smoothLine = false)
+ private static function chartDataSeriesValueSet($seriesDetail, $namespacesChartMeta, $marker = null)
{
if (isset($seriesDetail->strRef)) {
$seriesSource = (string) $seriesDetail->strRef->f;
$seriesData = self::chartDataSeriesValues($seriesDetail->strRef->strCache->children($namespacesChartMeta['c']), 's');
- return new PHPExcel_Chart_DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
+ return new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker);
} elseif (isset($seriesDetail->numRef)) {
$seriesSource = (string) $seriesDetail->numRef->f;
$seriesData = self::chartDataSeriesValues($seriesDetail->numRef->numCache->children($namespacesChartMeta['c']));
- return new PHPExcel_Chart_DataSeriesValues('Number', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
+ return new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_NUMBER, $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker);
} elseif (isset($seriesDetail->multiLvlStrRef)) {
$seriesSource = (string) $seriesDetail->multiLvlStrRef->f;
$seriesData = self::chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlStrRef->multiLvlStrCache->children($namespacesChartMeta['c']), 's');
$seriesData['pointCount'] = count($seriesData['dataValues']);
- return new PHPExcel_Chart_DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
+ return new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker);
} elseif (isset($seriesDetail->multiLvlNumRef)) {
$seriesSource = (string) $seriesDetail->multiLvlNumRef->f;
$seriesData = self::chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlNumRef->multiLvlNumCache->children($namespacesChartMeta['c']), 's');
$seriesData['pointCount'] = count($seriesData['dataValues']);
- return new PHPExcel_Chart_DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
+ return new DataSeriesValues(DataSeriesValues::DATASERIES_TYPE_STRING, $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker);
}
+
return null;
}
-
private static function chartDataSeriesValues($seriesValueSet, $dataType = 'n')
{
- $seriesVal = array();
+ $seriesVal = [];
$formatCode = '';
$pointCount = 0;
@@ -336,35 +365,36 @@ class PHPExcel_Reader_Excel2007_Chart
switch ($seriesValueIdx) {
case 'ptCount':
$pointCount = self::getAttribute($seriesValue, 'val', 'integer');
+
break;
case 'formatCode':
$formatCode = (string) $seriesValue;
+
break;
case 'pt':
$pointVal = self::getAttribute($seriesValue, 'idx', 'integer');
if ($dataType == 's') {
$seriesVal[$pointVal] = (string) $seriesValue->v;
+ } elseif ($seriesValue->v === Functions::NA()) {
+ $seriesVal[$pointVal] = null;
} else {
$seriesVal[$pointVal] = (float) $seriesValue->v;
}
+
break;
}
}
- if (empty($seriesVal)) {
- $seriesVal = null;
- }
-
- return array(
- 'formatCode' => $formatCode,
- 'pointCount' => $pointCount,
- 'dataValues' => $seriesVal
- );
+ return [
+ 'formatCode' => $formatCode,
+ 'pointCount' => $pointCount,
+ 'dataValues' => $seriesVal,
+ ];
}
private static function chartDataSeriesValuesMultiLevel($seriesValueSet, $dataType = 'n')
{
- $seriesVal = array();
+ $seriesVal = [];
$formatCode = '';
$pointCount = 0;
@@ -373,84 +403,89 @@ class PHPExcel_Reader_Excel2007_Chart
switch ($seriesValueIdx) {
case 'ptCount':
$pointCount = self::getAttribute($seriesValue, 'val', 'integer');
+
break;
case 'formatCode':
$formatCode = (string) $seriesValue;
+
break;
case 'pt':
$pointVal = self::getAttribute($seriesValue, 'idx', 'integer');
if ($dataType == 's') {
$seriesVal[$pointVal][] = (string) $seriesValue->v;
+ } elseif ($seriesValue->v === Functions::NA()) {
+ $seriesVal[$pointVal] = null;
} else {
$seriesVal[$pointVal][] = (float) $seriesValue->v;
}
+
break;
}
}
}
- return array(
- 'formatCode' => $formatCode,
- 'pointCount' => $pointCount,
- 'dataValues' => $seriesVal
- );
+ return [
+ 'formatCode' => $formatCode,
+ 'pointCount' => $pointCount,
+ 'dataValues' => $seriesVal,
+ ];
}
- private static function parseRichText($titleDetailPart = null)
+ private static function parseRichText(SimpleXMLElement $titleDetailPart)
{
- $value = new PHPExcel_RichText();
-
+ $value = new RichText();
+ $objText = null;
foreach ($titleDetailPart as $titleDetailElementKey => $titleDetailElement) {
if (isset($titleDetailElement->t)) {
$objText = $value->createTextRun((string) $titleDetailElement->t);
}
if (isset($titleDetailElement->rPr)) {
- if (isset($titleDetailElement->rPr->rFont["val"])) {
- $objText->getFont()->setName((string) $titleDetailElement->rPr->rFont["val"]);
+ if (isset($titleDetailElement->rPr->rFont['val'])) {
+ $objText->getFont()->setName((string) $titleDetailElement->rPr->rFont['val']);
}
$fontSize = (self::getAttribute($titleDetailElement->rPr, 'sz', 'integer'));
- if (!is_null($fontSize)) {
+ if ($fontSize !== null) {
$objText->getFont()->setSize(floor($fontSize / 100));
}
$fontColor = (self::getAttribute($titleDetailElement->rPr, 'color', 'string'));
- if (!is_null($fontColor)) {
- $objText->getFont()->setColor(new PHPExcel_Style_Color(self::readColor($fontColor)));
+ if ($fontColor !== null) {
+ $objText->getFont()->setColor(new Color(self::readColor($fontColor)));
}
$bold = self::getAttribute($titleDetailElement->rPr, 'b', 'boolean');
- if (!is_null($bold)) {
+ if ($bold !== null) {
$objText->getFont()->setBold($bold);
}
$italic = self::getAttribute($titleDetailElement->rPr, 'i', 'boolean');
- if (!is_null($italic)) {
+ if ($italic !== null) {
$objText->getFont()->setItalic($italic);
}
$baseline = self::getAttribute($titleDetailElement->rPr, 'baseline', 'integer');
- if (!is_null($baseline)) {
+ if ($baseline !== null) {
if ($baseline > 0) {
- $objText->getFont()->setSuperScript(true);
+ $objText->getFont()->setSuperscript(true);
} elseif ($baseline < 0) {
- $objText->getFont()->setSubScript(true);
+ $objText->getFont()->setSubscript(true);
}
}
$underscore = (self::getAttribute($titleDetailElement->rPr, 'u', 'string'));
- if (!is_null($underscore)) {
+ if ($underscore !== null) {
if ($underscore == 'sng') {
- $objText->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_SINGLE);
+ $objText->getFont()->setUnderline(Font::UNDERLINE_SINGLE);
} elseif ($underscore == 'dbl') {
- $objText->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_DOUBLE);
+ $objText->getFont()->setUnderline(Font::UNDERLINE_DOUBLE);
} else {
- $objText->getFont()->setUnderline(PHPExcel_Style_Font::UNDERLINE_NONE);
+ $objText->getFont()->setUnderline(Font::UNDERLINE_NONE);
}
}
$strikethrough = (self::getAttribute($titleDetailElement->rPr, 's', 'string'));
- if (!is_null($strikethrough)) {
+ if ($strikethrough !== null) {
if ($strikethrough == 'noStrike') {
$objText->getFont()->setStrikethrough(false);
} else {
@@ -465,7 +500,7 @@ class PHPExcel_Reader_Excel2007_Chart
private static function readChartAttributes($chartDetail)
{
- $plotAttributes = array();
+ $plotAttributes = [];
if (isset($chartDetail->dLbls)) {
if (isset($chartDetail->dLbls->howLegendKey)) {
$plotAttributes['showLegendKey'] = self::getAttribute($chartDetail->dLbls->showLegendKey, 'val', 'string');
@@ -493,30 +528,41 @@ class PHPExcel_Reader_Excel2007_Chart
return $plotAttributes;
}
- private static function setChartAttributes($plotArea, $plotAttributes)
+ /**
+ * @param Layout $plotArea
+ * @param mixed $plotAttributes
+ */
+ private static function setChartAttributes(Layout $plotArea, $plotAttributes)
{
foreach ($plotAttributes as $plotAttributeKey => $plotAttributeValue) {
switch ($plotAttributeKey) {
case 'showLegendKey':
$plotArea->setShowLegendKey($plotAttributeValue);
+
break;
case 'showVal':
$plotArea->setShowVal($plotAttributeValue);
+
break;
case 'showCatName':
$plotArea->setShowCatName($plotAttributeValue);
+
break;
case 'showSerName':
$plotArea->setShowSerName($plotAttributeValue);
+
break;
case 'showPercent':
$plotArea->setShowPercent($plotAttributeValue);
+
break;
case 'showBubbleSize':
$plotArea->setShowBubbleSize($plotAttributeValue);
+
break;
case 'showLeaderLines':
$plotArea->setShowLeaderLines($plotAttributeValue);
+
break;
}
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Theme.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Theme.php
new file mode 100644
index 00000000000..c105f3c1a66
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Theme.php
@@ -0,0 +1,93 @@
+themeName = $themeName;
+ $this->colourSchemeName = $colourSchemeName;
+ $this->colourMap = $colourMap;
+ }
+
+ /**
+ * Get Theme Name.
+ *
+ * @return string
+ */
+ public function getThemeName()
+ {
+ return $this->themeName;
+ }
+
+ /**
+ * Get colour Scheme Name.
+ *
+ * @return string
+ */
+ public function getColourSchemeName()
+ {
+ return $this->colourSchemeName;
+ }
+
+ /**
+ * Get colour Map Value by Position.
+ *
+ * @param mixed $index
+ *
+ * @return string
+ */
+ public function getColourByIndex($index)
+ {
+ if (isset($this->colourMap[$index])) {
+ return $this->colourMap[$index];
+ }
+
+ return null;
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if ((is_object($value)) && ($key != '_parent')) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Reader/Excel2003XML.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml.php
similarity index 52%
rename from lib/phpexcel/PHPExcel/Reader/Excel2003XML.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml.php
index fb1ebc01b9d..2b7959f47c1 100644
--- a/lib/phpexcel/PHPExcel/Reader/Excel2003XML.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xml.php
@@ -1,74 +1,61 @@
readFilter = new PHPExcel_Reader_DefaultReadFilter();
+ $this->readFilter = new DefaultReadFilter();
+ $this->securityScanner = XmlScanner::getInstance($this);
}
-
/**
- * Can the current PHPExcel_Reader_IReader read the file?
+ * Can the current IReader read the file?
*
- * @param string $pFilename
- * @return boolean
- * @throws PHPExcel_Reader_Exception
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return bool
*/
public function canRead($pFilename)
{
-
// Office xmlns:o="urn:schemas-microsoft-com:office:office"
// Excel xmlns:x="urn:schemas-microsoft-com:office:excel"
// XML Spreadsheet xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
@@ -79,24 +66,26 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
// Rowset xmlns:z="#RowsetSchema"
//
- $signature = array(
- ''
- );
+ $signature = [
+ '',
+ ];
// Open file
$this->openFile($pFilename);
$fileHandle = $this->fileHandle;
-
+
// Read sample data (first 2 KB will do)
$data = fread($fileHandle, 2048);
fclose($fileHandle);
+ $data = str_replace("'", '"', $data); // fix headers with single quote
$valid = true;
foreach ($signature as $match) {
// every part of the signature must be present
if (strpos($data, $match) === false) {
$valid = false;
+
break;
}
}
@@ -105,31 +94,54 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
if (preg_match('//um', $data, $matches)) {
$this->charSet = strtoupper($matches[1]);
}
-// echo 'Character Set is ', $this->charSet,'
';
return $valid;
}
+ /**
+ * Check if the file is a valid SimpleXML.
+ *
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return false|\SimpleXMLElement
+ */
+ public function trySimpleXMLLoadString($pFilename)
+ {
+ try {
+ $xml = simplexml_load_string(
+ $this->securityScanner->scan(file_get_contents($pFilename)),
+ 'SimpleXMLElement',
+ Settings::getLibXmlLoaderOptions()
+ );
+ } catch (\Exception $e) {
+ throw new Exception('Cannot load invalid XML file: ' . $pFilename, 0, $e);
+ }
+
+ return $xml;
+ }
/**
- * Reads names of the worksheets from a file, without parsing the whole file to a PHPExcel object
+ * Reads names of the worksheets from a file, without parsing the whole file to a Spreadsheet object.
*
- * @param string $pFilename
- * @throws PHPExcel_Reader_Exception
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return array
*/
public function listWorksheetNames($pFilename)
{
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
+ File::assertFile($pFilename);
if (!$this->canRead($pFilename)) {
- throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file.");
+ throw new Exception($pFilename . ' is an Invalid Spreadsheet file.');
}
- $worksheetNames = array();
+ $worksheetNames = [];
+
+ $xml = $this->trySimpleXMLLoadString($pFilename);
- $xml = simplexml_load_string($this->securityScan(file_get_contents($pFilename)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
$namespaces = $xml->getNamespaces(true);
$xml_ss = $xml->children($namespaces['ss']);
@@ -141,23 +153,23 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
return $worksheetNames;
}
-
/**
- * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns)
+ * Return worksheet info (Name, Last Column Letter, Last Column Index, Total Rows, Total Columns).
*
- * @param string $pFilename
- * @throws PHPExcel_Reader_Exception
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return array
*/
public function listWorksheetInfo($pFilename)
{
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
+ File::assertFile($pFilename);
- $worksheetInfo = array();
+ $worksheetInfo = [];
+
+ $xml = $this->trySimpleXMLLoadString($pFilename);
- $xml = simplexml_load_string($this->securityScan(file_get_contents($pFilename)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
$namespaces = $xml->getNamespaces(true);
$worksheetID = 1;
@@ -165,7 +177,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
foreach ($xml_ss->Worksheet as $worksheet) {
$worksheet_ss = $worksheet->attributes($namespaces['ss']);
- $tmpInfo = array();
+ $tmpInfo = [];
$tmpInfo['worksheetName'] = '';
$tmpInfo['lastColumnLetter'] = 'A';
$tmpInfo['lastColumnIndex'] = 0;
@@ -202,7 +214,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
}
}
- $tmpInfo['lastColumnLetter'] = PHPExcel_Cell::stringFromColumnIndex($tmpInfo['lastColumnIndex']);
+ $tmpInfo['lastColumnLetter'] = Coordinate::stringFromColumnIndex($tmpInfo['lastColumnIndex'] + 1);
$tmpInfo['totalColumns'] = $tmpInfo['lastColumnIndex'] + 1;
$worksheetInfo[] = $tmpInfo;
@@ -212,60 +224,69 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
return $worksheetInfo;
}
-
/**
- * Loads PHPExcel from file
+ * Loads Spreadsheet from file.
*
- * @param string $pFilename
- * @return PHPExcel
- * @throws PHPExcel_Reader_Exception
+ * @param string $pFilename
+ *
+ * @throws Exception
+ *
+ * @return Spreadsheet
*/
public function load($pFilename)
{
- // Create new PHPExcel
- $objPHPExcel = new PHPExcel();
- $objPHPExcel->removeSheetByIndex(0);
+ // Create new Spreadsheet
+ $spreadsheet = new Spreadsheet();
+ $spreadsheet->removeSheetByIndex(0);
// Load into this instance
- return $this->loadIntoExisting($pFilename, $objPHPExcel);
+ return $this->loadIntoExisting($pFilename, $spreadsheet);
}
- protected static function identifyFixedStyleValue($styleList, &$styleAttributeValue)
+ private static function identifyFixedStyleValue($styleList, &$styleAttributeValue)
{
$styleAttributeValue = strtolower($styleAttributeValue);
foreach ($styleList as $style) {
if ($styleAttributeValue == strtolower($style)) {
$styleAttributeValue = $style;
+
return true;
}
}
+
return false;
}
/**
- * pixel units to excel width units(units of 1/256th of a character width)
- * @param pxs
- * @return
+ * pixel units to excel width units(units of 1/256th of a character width).
+ *
+ * @param float $pxs
+ *
+ * @return float
*/
protected static function pixel2WidthUnits($pxs)
{
- $UNIT_OFFSET_MAP = array(0, 36, 73, 109, 146, 182, 219);
+ $UNIT_OFFSET_MAP = [0, 36, 73, 109, 146, 182, 219];
$widthUnits = 256 * ($pxs / 7);
$widthUnits += $UNIT_OFFSET_MAP[($pxs % 7)];
+
return $widthUnits;
}
/**
- * excel width units(units of 1/256th of a character width) to pixel units
- * @param widthUnits
- * @return
+ * excel width units(units of 1/256th of a character width) to pixel units.
+ *
+ * @param float $widthUnits
+ *
+ * @return float
*/
protected static function widthUnits2Pixel($widthUnits)
{
$pixels = ($widthUnits / 256) * 7;
$offsetWidthUnits = $widthUnits % 256;
$pixels += round($offsetWidthUnits / (256 / 7));
+
return $pixels;
}
@@ -275,93 +296,75 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
}
/**
- * Loads PHPExcel from file into PHPExcel instance
+ * Loads from file into Spreadsheet instance.
*
- * @param string $pFilename
- * @param PHPExcel $objPHPExcel
- * @return PHPExcel
- * @throws PHPExcel_Reader_Exception
+ * @param string $pFilename
+ * @param Spreadsheet $spreadsheet
+ *
+ * @throws Exception
+ *
+ * @return Spreadsheet
*/
- public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
+ public function loadIntoExisting($pFilename, Spreadsheet $spreadsheet)
{
- $fromFormats = array('\-', '\ ');
- $toFormats = array('-', ' ');
-
- $underlineStyles = array (
- PHPExcel_Style_Font::UNDERLINE_NONE,
- PHPExcel_Style_Font::UNDERLINE_DOUBLE,
- PHPExcel_Style_Font::UNDERLINE_DOUBLEACCOUNTING,
- PHPExcel_Style_Font::UNDERLINE_SINGLE,
- PHPExcel_Style_Font::UNDERLINE_SINGLEACCOUNTING
- );
- $verticalAlignmentStyles = array (
- PHPExcel_Style_Alignment::VERTICAL_BOTTOM,
- PHPExcel_Style_Alignment::VERTICAL_TOP,
- PHPExcel_Style_Alignment::VERTICAL_CENTER,
- PHPExcel_Style_Alignment::VERTICAL_JUSTIFY
- );
- $horizontalAlignmentStyles = array (
- PHPExcel_Style_Alignment::HORIZONTAL_GENERAL,
- PHPExcel_Style_Alignment::HORIZONTAL_LEFT,
- PHPExcel_Style_Alignment::HORIZONTAL_RIGHT,
- PHPExcel_Style_Alignment::HORIZONTAL_CENTER,
- PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS,
- PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY
- );
-
- $timezoneObj = new DateTimeZone('Europe/London');
- $GMT = new DateTimeZone('UTC');
-
- // Check if file exists
- if (!file_exists($pFilename)) {
- throw new PHPExcel_Reader_Exception("Could not open " . $pFilename . " for reading! File does not exist.");
- }
-
+ File::assertFile($pFilename);
if (!$this->canRead($pFilename)) {
- throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid Spreadsheet file.");
+ throw new Exception($pFilename . ' is an Invalid Spreadsheet file.');
}
- $xml = simplexml_load_string($this->securityScan(file_get_contents($pFilename)), 'SimpleXMLElement', PHPExcel_Settings::getLibXmlLoaderOptions());
+ $xml = $this->trySimpleXMLLoadString($pFilename);
+
$namespaces = $xml->getNamespaces(true);
- $docProps = $objPHPExcel->getProperties();
+ $docProps = $spreadsheet->getProperties();
if (isset($xml->DocumentProperties[0])) {
foreach ($xml->DocumentProperties[0] as $propertyName => $propertyValue) {
switch ($propertyName) {
case 'Title':
$docProps->setTitle(self::convertStringEncoding($propertyValue, $this->charSet));
+
break;
case 'Subject':
$docProps->setSubject(self::convertStringEncoding($propertyValue, $this->charSet));
+
break;
case 'Author':
$docProps->setCreator(self::convertStringEncoding($propertyValue, $this->charSet));
+
break;
case 'Created':
$creationDate = strtotime($propertyValue);
$docProps->setCreated($creationDate);
+
break;
case 'LastAuthor':
$docProps->setLastModifiedBy(self::convertStringEncoding($propertyValue, $this->charSet));
+
break;
case 'LastSaved':
$lastSaveDate = strtotime($propertyValue);
$docProps->setModified($lastSaveDate);
+
break;
case 'Company':
$docProps->setCompany(self::convertStringEncoding($propertyValue, $this->charSet));
+
break;
case 'Category':
$docProps->setCategory(self::convertStringEncoding($propertyValue, $this->charSet));
+
break;
case 'Manager':
$docProps->setManager(self::convertStringEncoding($propertyValue, $this->charSet));
+
break;
case 'Keywords':
$docProps->setKeywords(self::convertStringEncoding($propertyValue, $this->charSet));
+
break;
case 'Description':
$docProps->setDescription(self::convertStringEncoding($propertyValue, $this->charSet));
+
break;
}
}
@@ -369,161 +372,40 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
if (isset($xml->CustomDocumentProperties)) {
foreach ($xml->CustomDocumentProperties[0] as $propertyName => $propertyValue) {
$propertyAttributes = $propertyValue->attributes($namespaces['dt']);
- $propertyName = preg_replace_callback('/_x([0-9a-z]{4})_/', 'PHPExcel_Reader_Excel2003XML::hex2str', $propertyName);
- $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_UNKNOWN;
+ $propertyName = preg_replace_callback('/_x([0-9a-z]{4})_/', ['self', 'hex2str'], $propertyName);
+ $propertyType = Properties::PROPERTY_TYPE_UNKNOWN;
switch ((string) $propertyAttributes) {
case 'string':
- $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_STRING;
+ $propertyType = Properties::PROPERTY_TYPE_STRING;
$propertyValue = trim($propertyValue);
+
break;
case 'boolean':
- $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_BOOLEAN;
+ $propertyType = Properties::PROPERTY_TYPE_BOOLEAN;
$propertyValue = (bool) $propertyValue;
+
break;
case 'integer':
- $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_INTEGER;
- $propertyValue = intval($propertyValue);
+ $propertyType = Properties::PROPERTY_TYPE_INTEGER;
+ $propertyValue = (int) $propertyValue;
+
break;
case 'float':
- $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_FLOAT;
- $propertyValue = floatval($propertyValue);
+ $propertyType = Properties::PROPERTY_TYPE_FLOAT;
+ $propertyValue = (float) $propertyValue;
+
break;
case 'dateTime.tz':
- $propertyType = PHPExcel_DocumentProperties::PROPERTY_TYPE_DATE;
+ $propertyType = Properties::PROPERTY_TYPE_DATE;
$propertyValue = strtotime(trim($propertyValue));
+
break;
}
$docProps->setCustomProperty($propertyName, $propertyValue, $propertyType);
}
}
- foreach ($xml->Styles[0] as $style) {
- $style_ss = $style->attributes($namespaces['ss']);
- $styleID = (string) $style_ss['ID'];
-// echo 'Style ID = '.$styleID.'
';
- if ($styleID == 'Default') {
- $this->styles['Default'] = array();
- } else {
- $this->styles[$styleID] = $this->styles['Default'];
- }
- foreach ($style as $styleType => $styleData) {
- $styleAttributes = $styleData->attributes($namespaces['ss']);
-// echo $styleType.'
';
- switch ($styleType) {
- case 'Alignment':
- foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) {
-// echo $styleAttributeKey.' = '.$styleAttributeValue.'
';
- $styleAttributeValue = (string) $styleAttributeValue;
- switch ($styleAttributeKey) {
- case 'Vertical':
- if (self::identifyFixedStyleValue($verticalAlignmentStyles, $styleAttributeValue)) {
- $this->styles[$styleID]['alignment']['vertical'] = $styleAttributeValue;
- }
- break;
- case 'Horizontal':
- if (self::identifyFixedStyleValue($horizontalAlignmentStyles, $styleAttributeValue)) {
- $this->styles[$styleID]['alignment']['horizontal'] = $styleAttributeValue;
- }
- break;
- case 'WrapText':
- $this->styles[$styleID]['alignment']['wrap'] = true;
- break;
- }
- }
- break;
- case 'Borders':
- foreach ($styleData->Border as $borderStyle) {
- $borderAttributes = $borderStyle->attributes($namespaces['ss']);
- $thisBorder = array();
- foreach ($borderAttributes as $borderStyleKey => $borderStyleValue) {
-// echo $borderStyleKey.' = '.$borderStyleValue.'
';
- switch ($borderStyleKey) {
- case 'LineStyle':
- $thisBorder['style'] = PHPExcel_Style_Border::BORDER_MEDIUM;
-// $thisBorder['style'] = $borderStyleValue;
- break;
- case 'Weight':
-// $thisBorder['style'] = $borderStyleValue;
- break;
- case 'Position':
- $borderPosition = strtolower($borderStyleValue);
- break;
- case 'Color':
- $borderColour = substr($borderStyleValue, 1);
- $thisBorder['color']['rgb'] = $borderColour;
- break;
- }
- }
- if (!empty($thisBorder)) {
- if (($borderPosition == 'left') || ($borderPosition == 'right') || ($borderPosition == 'top') || ($borderPosition == 'bottom')) {
- $this->styles[$styleID]['borders'][$borderPosition] = $thisBorder;
- }
- }
- }
- break;
- case 'Font':
- foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) {
-// echo $styleAttributeKey.' = '.$styleAttributeValue.'
';
- $styleAttributeValue = (string) $styleAttributeValue;
- switch ($styleAttributeKey) {
- case 'FontName':
- $this->styles[$styleID]['font']['name'] = $styleAttributeValue;
- break;
- case 'Size':
- $this->styles[$styleID]['font']['size'] = $styleAttributeValue;
- break;
- case 'Color':
- $this->styles[$styleID]['font']['color']['rgb'] = substr($styleAttributeValue, 1);
- break;
- case 'Bold':
- $this->styles[$styleID]['font']['bold'] = true;
- break;
- case 'Italic':
- $this->styles[$styleID]['font']['italic'] = true;
- break;
- case 'Underline':
- if (self::identifyFixedStyleValue($underlineStyles, $styleAttributeValue)) {
- $this->styles[$styleID]['font']['underline'] = $styleAttributeValue;
- }
- break;
- }
- }
- break;
- case 'Interior':
- foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) {
-// echo $styleAttributeKey.' = '.$styleAttributeValue.'
';
- switch ($styleAttributeKey) {
- case 'Color':
- $this->styles[$styleID]['fill']['color']['rgb'] = substr($styleAttributeValue, 1);
- break;
- }
- }
- break;
- case 'NumberFormat':
- foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) {
-// echo $styleAttributeKey.' = '.$styleAttributeValue.'
';
- $styleAttributeValue = str_replace($fromFormats, $toFormats, $styleAttributeValue);
- switch ($styleAttributeValue) {
- case 'Short Date':
- $styleAttributeValue = 'dd/mm/yyyy';
- break;
- }
- if ($styleAttributeValue > '') {
- $this->styles[$styleID]['numberformat']['code'] = $styleAttributeValue;
- }
- }
- break;
- case 'Protection':
- foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) {
-// echo $styleAttributeKey.' = '.$styleAttributeValue.'
';
- }
- break;
- }
- }
-// print_r($this->styles[$styleID]);
-// echo '
';
- }
-// echo '
';
+ $this->parseStyles($xml, $namespaces);
$worksheetID = 0;
$xml_ss = $xml->children($namespaces['ss']);
@@ -536,17 +418,15 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
continue;
}
-// echo 'Worksheet: ', $worksheet_ss['Name'],'';
-//
// Create new Worksheet
- $objPHPExcel->createSheet();
- $objPHPExcel->setActiveSheetIndex($worksheetID);
+ $spreadsheet->createSheet();
+ $spreadsheet->setActiveSheetIndex($worksheetID);
if (isset($worksheet_ss['Name'])) {
$worksheetName = self::convertStringEncoding((string) $worksheet_ss['Name'], $this->charSet);
// Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in
// formula cells... during the load, all formulae should be correct, and we're simply bringing
// the worksheet name in line with the formula, not the reverse
- $objPHPExcel->getActiveSheet()->setTitle($worksheetName, false);
+ $spreadsheet->getActiveSheet()->setTitle($worksheetName, false, false);
}
$columnID = 'A';
@@ -554,12 +434,11 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
foreach ($worksheet->Table->Column as $columnData) {
$columnData_ss = $columnData->attributes($namespaces['ss']);
if (isset($columnData_ss['Index'])) {
- $columnID = PHPExcel_Cell::stringFromColumnIndex($columnData_ss['Index']-1);
+ $columnID = Coordinate::stringFromColumnIndex((int) $columnData_ss['Index']);
}
if (isset($columnData_ss['Width'])) {
$columnWidth = $columnData_ss['Width'];
-// echo 'Setting column width for '.$columnID.' to '.$columnWidth.'
';
- $objPHPExcel->getActiveSheet()->getColumnDimension($columnID)->setWidth($columnWidth / 5.4);
+ $spreadsheet->getActiveSheet()->getColumnDimension($columnID)->setWidth($columnWidth / 5.4);
}
++$columnID;
}
@@ -572,52 +451,52 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
$rowHasData = false;
$row_ss = $rowData->attributes($namespaces['ss']);
if (isset($row_ss['Index'])) {
- $rowID = (integer) $row_ss['Index'];
+ $rowID = (int) $row_ss['Index'];
}
-// echo 'Row '.$rowID.'
';
$columnID = 'A';
foreach ($rowData->Cell as $cell) {
$cell_ss = $cell->attributes($namespaces['ss']);
if (isset($cell_ss['Index'])) {
- $columnID = PHPExcel_Cell::stringFromColumnIndex($cell_ss['Index']-1);
+ $columnID = Coordinate::stringFromColumnIndex((int) $cell_ss['Index']);
}
- $cellRange = $columnID.$rowID;
+ $cellRange = $columnID . $rowID;
if ($this->getReadFilter() !== null) {
if (!$this->getReadFilter()->readCell($columnID, $rowID, $worksheetName)) {
+ ++$columnID;
+
continue;
}
}
+ if (isset($cell_ss['HRef'])) {
+ $spreadsheet->getActiveSheet()->getCell($cellRange)->getHyperlink()->setUrl($cell_ss['HRef']);
+ }
+
if ((isset($cell_ss['MergeAcross'])) || (isset($cell_ss['MergeDown']))) {
$columnTo = $columnID;
if (isset($cell_ss['MergeAcross'])) {
- $additionalMergedCells += (int)$cell_ss['MergeAcross'];
- $columnTo = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($columnID) + $cell_ss['MergeAcross'] -1);
+ $additionalMergedCells += (int) $cell_ss['MergeAcross'];
+ $columnTo = Coordinate::stringFromColumnIndex(Coordinate::columnIndexFromString($columnID) + $cell_ss['MergeAcross']);
}
$rowTo = $rowID;
if (isset($cell_ss['MergeDown'])) {
$rowTo = $rowTo + $cell_ss['MergeDown'];
}
- $cellRange .= ':'.$columnTo.$rowTo;
- $objPHPExcel->getActiveSheet()->mergeCells($cellRange);
+ $cellRange .= ':' . $columnTo . $rowTo;
+ $spreadsheet->getActiveSheet()->mergeCells($cellRange);
}
$cellIsSet = $hasCalculatedValue = false;
$cellDataFormula = '';
if (isset($cell_ss['Formula'])) {
$cellDataFormula = $cell_ss['Formula'];
- // added this as a check for array formulas
- if (isset($cell_ss['ArrayRange'])) {
- $cellDataCSEFormula = $cell_ss['ArrayRange'];
-// echo "found an array formula at ".$columnID.$rowID."
";
- }
$hasCalculatedValue = true;
}
if (isset($cell->Data)) {
$cellValue = $cellData = $cell->Data;
- $type = PHPExcel_Cell_DataType::TYPE_NULL;
+ $type = DataType::TYPE_NULL;
$cellData_ss = $cellData->attributes($namespaces['ss']);
if (isset($cellData_ss['Type'])) {
$cellDataType = $cellData_ss['Type'];
@@ -633,47 +512,49 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
*/
case 'String':
$cellValue = self::convertStringEncoding($cellValue, $this->charSet);
- $type = PHPExcel_Cell_DataType::TYPE_STRING;
+ $type = DataType::TYPE_STRING;
+
break;
case 'Number':
- $type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
+ $type = DataType::TYPE_NUMERIC;
$cellValue = (float) $cellValue;
if (floor($cellValue) == $cellValue) {
- $cellValue = (integer) $cellValue;
+ $cellValue = (int) $cellValue;
}
+
break;
case 'Boolean':
- $type = PHPExcel_Cell_DataType::TYPE_BOOL;
+ $type = DataType::TYPE_BOOL;
$cellValue = ($cellValue != 0);
+
break;
case 'DateTime':
- $type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
- $cellValue = PHPExcel_Shared_Date::PHPToExcel(strtotime($cellValue));
+ $type = DataType::TYPE_NUMERIC;
+ $cellValue = Date::PHPToExcel(strtotime($cellValue));
+
break;
case 'Error':
- $type = PHPExcel_Cell_DataType::TYPE_ERROR;
+ $type = DataType::TYPE_ERROR;
+
break;
}
}
if ($hasCalculatedValue) {
-// echo 'FORMULA
';
- $type = PHPExcel_Cell_DataType::TYPE_FORMULA;
- $columnNumber = PHPExcel_Cell::columnIndexFromString($columnID);
+ $type = DataType::TYPE_FORMULA;
+ $columnNumber = Coordinate::columnIndexFromString($columnID);
if (substr($cellDataFormula, 0, 3) == 'of:') {
$cellDataFormula = substr($cellDataFormula, 3);
-// echo 'Before: ', $cellDataFormula,'
';
$temp = explode('"', $cellDataFormula);
$key = false;
foreach ($temp as &$value) {
// Only replace in alternate array entries (i.e. non-quoted blocks)
if ($key = !$key) {
- $value = str_replace(array('[.', '.', ']'), '', $value);
+ $value = str_replace(['[.', '.', ']'], '', $value);
}
}
} else {
// Convert R1C1 style references to A1 style references (but only when not quoted)
-// echo 'Before: ', $cellDataFormula,'
';
$temp = explode('"', $cellDataFormula);
$key = false;
foreach ($temp as &$value) {
@@ -693,7 +574,7 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
$rowReference = $rowID;
}
// Bracketed R references are relative to the current row
- if ($rowReference{0} == '[') {
+ if ($rowReference[0] == '[') {
$rowReference = $rowID + trim($rowReference, '[]');
}
$columnReference = $cellReference[4][0];
@@ -702,10 +583,10 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
$columnReference = $columnNumber;
}
// Bracketed C references are relative to the current column
- if ($columnReference{0} == '[') {
+ if ($columnReference[0] == '[') {
$columnReference = $columnNumber + trim($columnReference, '[]');
}
- $A1CellReference = PHPExcel_Cell::stringFromColumnIndex($columnReference-1).$rowReference;
+ $A1CellReference = Coordinate::stringFromColumnIndex($columnReference) . $rowReference;
$value = substr_replace($value, $A1CellReference, $cellReference[0][1], strlen($cellReference[0][0]));
}
}
@@ -714,63 +595,46 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
unset($value);
// Then rebuild the formula string
$cellDataFormula = implode('"', $temp);
-// echo 'After: ', $cellDataFormula,'
';
}
-// echo 'Cell '.$columnID.$rowID.' is a '.$type.' with a value of '.(($hasCalculatedValue) ? $cellDataFormula : $cellValue).'
';
-//
- $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue), $type);
+ $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setValueExplicit((($hasCalculatedValue) ? $cellDataFormula : $cellValue), $type);
if ($hasCalculatedValue) {
-// echo 'Formula result is '.$cellValue.'
';
- $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setCalculatedValue($cellValue);
+ $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setCalculatedValue($cellValue);
}
$cellIsSet = $rowHasData = true;
}
if (isset($cell->Comment)) {
-// echo 'comment found
';
$commentAttributes = $cell->Comment->attributes($namespaces['ss']);
$author = 'unknown';
if (isset($commentAttributes->Author)) {
- $author = (string)$commentAttributes->Author;
-// echo 'Author: ', $author,'
';
+ $author = (string) $commentAttributes->Author;
}
$node = $cell->Comment->Data->asXML();
-// $annotation = str_replace('html:','',substr($node,49,-10));
-// echo $annotation,'
';
$annotation = strip_tags($node);
-// echo 'Annotation: ', $annotation,'
';
- $objPHPExcel->getActiveSheet()->getComment($columnID.$rowID)->setAuthor(self::convertStringEncoding($author, $this->charSet))->setText($this->parseRichText($annotation));
+ $spreadsheet->getActiveSheet()->getComment($columnID . $rowID)->setAuthor(self::convertStringEncoding($author, $this->charSet))->setText($this->parseRichText($annotation));
}
if (($cellIsSet) && (isset($cell_ss['StyleID']))) {
$style = (string) $cell_ss['StyleID'];
-// echo 'Cell style for '.$columnID.$rowID.' is '.$style.'
';
if ((isset($this->styles[$style])) && (!empty($this->styles[$style]))) {
-// echo 'Cell '.$columnID.$rowID.'
';
-// print_r($this->styles[$style]);
-// echo '
';
- if (!$objPHPExcel->getActiveSheet()->cellExists($columnID.$rowID)) {
- $objPHPExcel->getActiveSheet()->getCell($columnID.$rowID)->setValue(null);
+ if (!$spreadsheet->getActiveSheet()->cellExists($columnID . $rowID)) {
+ $spreadsheet->getActiveSheet()->getCell($columnID . $rowID)->setValue(null);
}
- $objPHPExcel->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->styles[$style]);
+ $spreadsheet->getActiveSheet()->getStyle($cellRange)->applyFromArray($this->styles[$style]);
}
}
++$columnID;
while ($additionalMergedCells > 0) {
++$columnID;
- $additionalMergedCells--;
+ --$additionalMergedCells;
}
}
if ($rowHasData) {
- if (isset($row_ss['StyleID'])) {
- $rowStyle = $row_ss['StyleID'];
- }
if (isset($row_ss['Height'])) {
$rowHeight = $row_ss['Height'];
-// echo 'Setting row height to '.$rowHeight.'
';
- $objPHPExcel->getActiveSheet()->getRowDimension($rowID)->setRowHeight($rowHeight);
+ $spreadsheet->getActiveSheet()->getRowDimension($rowID)->setRowHeight($rowHeight);
}
}
@@ -781,25 +645,238 @@ class PHPExcel_Reader_Excel2003XML extends PHPExcel_Reader_Abstract implements P
}
// Return
- return $objPHPExcel;
+ return $spreadsheet;
}
-
protected static function convertStringEncoding($string, $charset)
{
if ($charset != 'UTF-8') {
- return PHPExcel_Shared_String::ConvertEncoding($string, 'UTF-8', $charset);
+ return StringHelper::convertEncoding($string, 'UTF-8', $charset);
}
+
return $string;
}
-
- protected function parseRichText($is = '')
+ protected function parseRichText($is)
{
- $value = new PHPExcel_RichText();
+ $value = new RichText();
$value->createText(self::convertStringEncoding($is, $this->charSet));
return $value;
}
+
+ /**
+ * @param SimpleXMLElement $xml
+ * @param array $namespaces
+ */
+ private function parseStyles(SimpleXMLElement $xml, array $namespaces)
+ {
+ if (!isset($xml->Styles)) {
+ return;
+ }
+
+ foreach ($xml->Styles[0] as $style) {
+ $style_ss = $style->attributes($namespaces['ss']);
+ $styleID = (string) $style_ss['ID'];
+ $this->styles[$styleID] = (isset($this->styles['Default'])) ? $this->styles['Default'] : [];
+ foreach ($style as $styleType => $styleData) {
+ $styleAttributes = $styleData->attributes($namespaces['ss']);
+ switch ($styleType) {
+ case 'Alignment':
+ $this->parseStyleAlignment($styleID, $styleAttributes);
+
+ break;
+ case 'Borders':
+ $this->parseStyleBorders($styleID, $styleData, $namespaces);
+
+ break;
+ case 'Font':
+ $this->parseStyleFont($styleID, $styleAttributes);
+
+ break;
+ case 'Interior':
+ $this->parseStyleInterior($styleID, $styleAttributes);
+
+ break;
+ case 'NumberFormat':
+ $this->parseStyleNumberFormat($styleID, $styleAttributes);
+
+ break;
+ }
+ }
+ }
+ }
+
+ /**
+ * @param string $styleID
+ * @param SimpleXMLElement $styleAttributes
+ */
+ private function parseStyleAlignment($styleID, SimpleXMLElement $styleAttributes)
+ {
+ $verticalAlignmentStyles = [
+ Alignment::VERTICAL_BOTTOM,
+ Alignment::VERTICAL_TOP,
+ Alignment::VERTICAL_CENTER,
+ Alignment::VERTICAL_JUSTIFY,
+ ];
+ $horizontalAlignmentStyles = [
+ Alignment::HORIZONTAL_GENERAL,
+ Alignment::HORIZONTAL_LEFT,
+ Alignment::HORIZONTAL_RIGHT,
+ Alignment::HORIZONTAL_CENTER,
+ Alignment::HORIZONTAL_CENTER_CONTINUOUS,
+ Alignment::HORIZONTAL_JUSTIFY,
+ ];
+
+ foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) {
+ $styleAttributeValue = (string) $styleAttributeValue;
+ switch ($styleAttributeKey) {
+ case 'Vertical':
+ if (self::identifyFixedStyleValue($verticalAlignmentStyles, $styleAttributeValue)) {
+ $this->styles[$styleID]['alignment']['vertical'] = $styleAttributeValue;
+ }
+
+ break;
+ case 'Horizontal':
+ if (self::identifyFixedStyleValue($horizontalAlignmentStyles, $styleAttributeValue)) {
+ $this->styles[$styleID]['alignment']['horizontal'] = $styleAttributeValue;
+ }
+
+ break;
+ case 'WrapText':
+ $this->styles[$styleID]['alignment']['wrapText'] = true;
+
+ break;
+ }
+ }
+ }
+
+ /**
+ * @param $styleID
+ * @param SimpleXMLElement $styleData
+ * @param array $namespaces
+ */
+ private function parseStyleBorders($styleID, SimpleXMLElement $styleData, array $namespaces)
+ {
+ foreach ($styleData->Border as $borderStyle) {
+ $borderAttributes = $borderStyle->attributes($namespaces['ss']);
+ $thisBorder = [];
+ foreach ($borderAttributes as $borderStyleKey => $borderStyleValue) {
+ switch ($borderStyleKey) {
+ case 'LineStyle':
+ $thisBorder['borderStyle'] = Border::BORDER_MEDIUM;
+
+ break;
+ case 'Weight':
+ break;
+ case 'Position':
+ $borderPosition = strtolower($borderStyleValue);
+
+ break;
+ case 'Color':
+ $borderColour = substr($borderStyleValue, 1);
+ $thisBorder['color']['rgb'] = $borderColour;
+
+ break;
+ }
+ }
+ if (!empty($thisBorder)) {
+ if (($borderPosition == 'left') || ($borderPosition == 'right') || ($borderPosition == 'top') || ($borderPosition == 'bottom')) {
+ $this->styles[$styleID]['borders'][$borderPosition] = $thisBorder;
+ }
+ }
+ }
+ }
+
+ /**
+ * @param $styleID
+ * @param SimpleXMLElement $styleAttributes
+ */
+ private function parseStyleFont($styleID, SimpleXMLElement $styleAttributes)
+ {
+ $underlineStyles = [
+ Font::UNDERLINE_NONE,
+ Font::UNDERLINE_DOUBLE,
+ Font::UNDERLINE_DOUBLEACCOUNTING,
+ Font::UNDERLINE_SINGLE,
+ Font::UNDERLINE_SINGLEACCOUNTING,
+ ];
+
+ foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) {
+ $styleAttributeValue = (string) $styleAttributeValue;
+ switch ($styleAttributeKey) {
+ case 'FontName':
+ $this->styles[$styleID]['font']['name'] = $styleAttributeValue;
+
+ break;
+ case 'Size':
+ $this->styles[$styleID]['font']['size'] = $styleAttributeValue;
+
+ break;
+ case 'Color':
+ $this->styles[$styleID]['font']['color']['rgb'] = substr($styleAttributeValue, 1);
+
+ break;
+ case 'Bold':
+ $this->styles[$styleID]['font']['bold'] = true;
+
+ break;
+ case 'Italic':
+ $this->styles[$styleID]['font']['italic'] = true;
+
+ break;
+ case 'Underline':
+ if (self::identifyFixedStyleValue($underlineStyles, $styleAttributeValue)) {
+ $this->styles[$styleID]['font']['underline'] = $styleAttributeValue;
+ }
+
+ break;
+ }
+ }
+ }
+
+ /**
+ * @param $styleID
+ * @param SimpleXMLElement $styleAttributes
+ */
+ private function parseStyleInterior($styleID, SimpleXMLElement $styleAttributes)
+ {
+ foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) {
+ switch ($styleAttributeKey) {
+ case 'Color':
+ $this->styles[$styleID]['fill']['color']['rgb'] = substr($styleAttributeValue, 1);
+
+ break;
+ case 'Pattern':
+ $this->styles[$styleID]['fill']['fillType'] = strtolower($styleAttributeValue);
+
+ break;
+ }
+ }
+ }
+
+ /**
+ * @param $styleID
+ * @param SimpleXMLElement $styleAttributes
+ */
+ private function parseStyleNumberFormat($styleID, SimpleXMLElement $styleAttributes)
+ {
+ $fromFormats = ['\-', '\ '];
+ $toFormats = ['-', ' '];
+
+ foreach ($styleAttributes as $styleAttributeKey => $styleAttributeValue) {
+ $styleAttributeValue = str_replace($fromFormats, $toFormats, $styleAttributeValue);
+ switch ($styleAttributeValue) {
+ case 'Short Date':
+ $styleAttributeValue = 'dd/mm/yyyy';
+
+ break;
+ }
+
+ if ($styleAttributeValue > '') {
+ $this->styles[$styleID]['numberFormat']['formatCode'] = $styleAttributeValue;
+ }
+ }
+ }
}
diff --git a/lib/phpexcel/PHPExcel/ReferenceHelper.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php
similarity index 51%
rename from lib/phpexcel/PHPExcel/ReferenceHelper.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php
index 7d7de93be79..54bc182a8eb 100644
--- a/lib/phpexcel/PHPExcel/ReferenceHelper.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/ReferenceHelper.php
@@ -1,62 +1,43 @@
= ($beforeRow + $pNumRows)) &&
@@ -150,57 +144,57 @@ class PHPExcel_ReferenceHelper
($cellColumnIndex < $beforeColumnIndex)) {
return true;
}
+
return false;
}
/**
- * Update page breaks when inserting/deleting rows/columns
+ * Update page breaks when inserting/deleting rows/columns.
*
- * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
- * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
- * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before
- * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
- * @param integer $beforeRow Number of the row we're inserting/deleting before
- * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
+ * @param Worksheet $pSheet The worksheet that we're editing
+ * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
+ * @param int $beforeColumnIndex Index number of the column we're inserting/deleting before
+ * @param int $pNumCols Number of columns to insert/delete (negative values indicate deletion)
+ * @param int $beforeRow Number of the row we're inserting/deleting before
+ * @param int $pNumRows Number of rows to insert/delete (negative values indicate deletion)
*/
- protected function adjustPageBreaks(PHPExcel_Worksheet $pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
+ protected function adjustPageBreaks(Worksheet $pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
{
$aBreaks = $pSheet->getBreaks();
($pNumCols > 0 || $pNumRows > 0) ?
- uksort($aBreaks, array('PHPExcel_ReferenceHelper','cellReverseSort')) :
- uksort($aBreaks, array('PHPExcel_ReferenceHelper','cellSort'));
+ uksort($aBreaks, ['self', 'cellReverseSort']) : uksort($aBreaks, ['self', 'cellSort']);
foreach ($aBreaks as $key => $value) {
if (self::cellAddressInDeleteRange($key, $beforeRow, $pNumRows, $beforeColumnIndex, $pNumCols)) {
// If we're deleting, then clear any defined breaks that are within the range
// of rows/columns that we're deleting
- $pSheet->setBreak($key, PHPExcel_Worksheet::BREAK_NONE);
+ $pSheet->setBreak($key, Worksheet::BREAK_NONE);
} else {
// Otherwise update any affected breaks by inserting a new break at the appropriate point
// and removing the old affected break
$newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows);
if ($key != $newReference) {
$pSheet->setBreak($newReference, $value)
- ->setBreak($key, PHPExcel_Worksheet::BREAK_NONE);
+ ->setBreak($key, Worksheet::BREAK_NONE);
}
}
}
}
/**
- * Update cell comments when inserting/deleting rows/columns
+ * Update cell comments when inserting/deleting rows/columns.
*
- * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
- * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
- * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before
- * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
- * @param integer $beforeRow Number of the row we're inserting/deleting before
- * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
+ * @param Worksheet $pSheet The worksheet that we're editing
+ * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
+ * @param int $beforeColumnIndex Index number of the column we're inserting/deleting before
+ * @param int $pNumCols Number of columns to insert/delete (negative values indicate deletion)
+ * @param int $beforeRow Number of the row we're inserting/deleting before
+ * @param int $pNumRows Number of rows to insert/delete (negative values indicate deletion)
*/
protected function adjustComments($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
{
$aComments = $pSheet->getComments();
- $aNewComments = array(); // the new array of all comments
+ $aNewComments = []; // the new array of all comments
foreach ($aComments as $key => &$value) {
// Any comments inside a deleted range will be ignored
@@ -215,19 +209,20 @@ class PHPExcel_ReferenceHelper
}
/**
- * Update hyperlinks when inserting/deleting rows/columns
+ * Update hyperlinks when inserting/deleting rows/columns.
*
- * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
- * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
- * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before
- * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
- * @param integer $beforeRow Number of the row we're inserting/deleting before
- * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
+ * @param Worksheet $pSheet The worksheet that we're editing
+ * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
+ * @param int $beforeColumnIndex Index number of the column we're inserting/deleting before
+ * @param int $pNumCols Number of columns to insert/delete (negative values indicate deletion)
+ * @param int $beforeRow Number of the row we're inserting/deleting before
+ * @param int $pNumRows Number of rows to insert/delete (negative values indicate deletion)
*/
protected function adjustHyperlinks($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
{
$aHyperlinkCollection = $pSheet->getHyperlinkCollection();
- ($pNumCols > 0 || $pNumRows > 0) ? uksort($aHyperlinkCollection, array('PHPExcel_ReferenceHelper','cellReverseSort')) : uksort($aHyperlinkCollection, array('PHPExcel_ReferenceHelper','cellSort'));
+ ($pNumCols > 0 || $pNumRows > 0) ?
+ uksort($aHyperlinkCollection, ['self', 'cellReverseSort']) : uksort($aHyperlinkCollection, ['self', 'cellSort']);
foreach ($aHyperlinkCollection as $key => $value) {
$newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows);
@@ -239,20 +234,21 @@ class PHPExcel_ReferenceHelper
}
/**
- * Update data validations when inserting/deleting rows/columns
+ * Update data validations when inserting/deleting rows/columns.
*
- * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
- * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
- * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before
- * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
- * @param integer $beforeRow Number of the row we're inserting/deleting before
- * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
+ * @param Worksheet $pSheet The worksheet that we're editing
+ * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
+ * @param int $beforeColumnIndex Index number of the column we're inserting/deleting before
+ * @param int $pNumCols Number of columns to insert/delete (negative values indicate deletion)
+ * @param int $beforeRow Number of the row we're inserting/deleting before
+ * @param int $pNumRows Number of rows to insert/delete (negative values indicate deletion)
*/
protected function adjustDataValidations($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
{
$aDataValidationCollection = $pSheet->getDataValidationCollection();
- ($pNumCols > 0 || $pNumRows > 0) ? uksort($aDataValidationCollection, array('PHPExcel_ReferenceHelper','cellReverseSort')) : uksort($aDataValidationCollection, array('PHPExcel_ReferenceHelper','cellSort'));
-
+ ($pNumCols > 0 || $pNumRows > 0) ?
+ uksort($aDataValidationCollection, ['self', 'cellReverseSort']) : uksort($aDataValidationCollection, ['self', 'cellSort']);
+
foreach ($aDataValidationCollection as $key => $value) {
$newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows);
if ($key != $newReference) {
@@ -263,19 +259,19 @@ class PHPExcel_ReferenceHelper
}
/**
- * Update merged cells when inserting/deleting rows/columns
+ * Update merged cells when inserting/deleting rows/columns.
*
- * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
- * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
- * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before
- * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
- * @param integer $beforeRow Number of the row we're inserting/deleting before
- * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
+ * @param Worksheet $pSheet The worksheet that we're editing
+ * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
+ * @param int $beforeColumnIndex Index number of the column we're inserting/deleting before
+ * @param int $pNumCols Number of columns to insert/delete (negative values indicate deletion)
+ * @param int $beforeRow Number of the row we're inserting/deleting before
+ * @param int $pNumRows Number of rows to insert/delete (negative values indicate deletion)
*/
protected function adjustMergeCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
{
$aMergeCells = $pSheet->getMergeCells();
- $aNewMergeCells = array(); // the new array of all merge cells
+ $aNewMergeCells = []; // the new array of all merge cells
foreach ($aMergeCells as $key => &$value) {
$newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows);
$aNewMergeCells[$newReference] = $newReference;
@@ -284,21 +280,20 @@ class PHPExcel_ReferenceHelper
}
/**
- * Update protected cells when inserting/deleting rows/columns
+ * Update protected cells when inserting/deleting rows/columns.
*
- * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
- * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
- * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before
- * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
- * @param integer $beforeRow Number of the row we're inserting/deleting before
- * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
+ * @param Worksheet $pSheet The worksheet that we're editing
+ * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
+ * @param int $beforeColumnIndex Index number of the column we're inserting/deleting before
+ * @param int $pNumCols Number of columns to insert/delete (negative values indicate deletion)
+ * @param int $beforeRow Number of the row we're inserting/deleting before
+ * @param int $pNumRows Number of rows to insert/delete (negative values indicate deletion)
*/
protected function adjustProtectedCells($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
{
$aProtectedCells = $pSheet->getProtectedCells();
($pNumCols > 0 || $pNumRows > 0) ?
- uksort($aProtectedCells, array('PHPExcel_ReferenceHelper','cellReverseSort')) :
- uksort($aProtectedCells, array('PHPExcel_ReferenceHelper','cellSort'));
+ uksort($aProtectedCells, ['self', 'cellReverseSort']) : uksort($aProtectedCells, ['self', 'cellSort']);
foreach ($aProtectedCells as $key => $value) {
$newReference = $this->updateCellReference($key, $pBefore, $pNumCols, $pNumRows);
if ($key != $newReference) {
@@ -309,14 +304,14 @@ class PHPExcel_ReferenceHelper
}
/**
- * Update column dimensions when inserting/deleting rows/columns
+ * Update column dimensions when inserting/deleting rows/columns.
*
- * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
- * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
- * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before
- * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
- * @param integer $beforeRow Number of the row we're inserting/deleting before
- * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
+ * @param Worksheet $pSheet The worksheet that we're editing
+ * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
+ * @param int $beforeColumnIndex Index number of the column we're inserting/deleting before
+ * @param int $pNumCols Number of columns to insert/delete (negative values indicate deletion)
+ * @param int $beforeRow Number of the row we're inserting/deleting before
+ * @param int $pNumRows Number of rows to insert/delete (negative values indicate deletion)
*/
protected function adjustColumnDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
{
@@ -324,7 +319,7 @@ class PHPExcel_ReferenceHelper
if (!empty($aColumnDimensions)) {
foreach ($aColumnDimensions as $objColumnDimension) {
$newReference = $this->updateCellReference($objColumnDimension->getColumnIndex() . '1', $pBefore, $pNumCols, $pNumRows);
- list($newReference) = PHPExcel_Cell::coordinateFromString($newReference);
+ list($newReference) = Coordinate::coordinateFromString($newReference);
if ($objColumnDimension->getColumnIndex() != $newReference) {
$objColumnDimension->setColumnIndex($newReference);
}
@@ -334,14 +329,14 @@ class PHPExcel_ReferenceHelper
}
/**
- * Update row dimensions when inserting/deleting rows/columns
+ * Update row dimensions when inserting/deleting rows/columns.
*
- * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
- * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
- * @param integer $beforeColumnIndex Index number of the column we're inserting/deleting before
- * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
- * @param integer $beforeRow Number of the row we're inserting/deleting before
- * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
+ * @param Worksheet $pSheet The worksheet that we're editing
+ * @param string $pBefore Insert/Delete before this cell address (e.g. 'A1')
+ * @param int $beforeColumnIndex Index number of the column we're inserting/deleting before
+ * @param int $pNumCols Number of columns to insert/delete (negative values indicate deletion)
+ * @param int $beforeRow Number of the row we're inserting/deleting before
+ * @param int $pNumRows Number of rows to insert/delete (negative values indicate deletion)
*/
protected function adjustRowDimensions($pSheet, $pBefore, $beforeColumnIndex, $pNumCols, $beforeRow, $pNumRows)
{
@@ -349,7 +344,7 @@ class PHPExcel_ReferenceHelper
if (!empty($aRowDimensions)) {
foreach ($aRowDimensions as $objRowDimension) {
$newReference = $this->updateCellReference('A' . $objRowDimension->getRowIndex(), $pBefore, $pNumCols, $pNumRows);
- list(, $newReference) = PHPExcel_Cell::coordinateFromString($newReference);
+ list(, $newReference) = Coordinate::coordinateFromString($newReference);
if ($objRowDimension->getRowIndex() != $newReference) {
$objRowDimension->setRowIndex($newReference);
}
@@ -368,37 +363,36 @@ class PHPExcel_ReferenceHelper
}
/**
- * Insert a new column or row, updating all possible related data
+ * Insert a new column or row, updating all possible related data.
*
- * @param string $pBefore Insert before this cell address (e.g. 'A1')
- * @param integer $pNumCols Number of columns to insert/delete (negative values indicate deletion)
- * @param integer $pNumRows Number of rows to insert/delete (negative values indicate deletion)
- * @param PHPExcel_Worksheet $pSheet The worksheet that we're editing
- * @throws PHPExcel_Exception
+ * @param string $pBefore Insert before this cell address (e.g. 'A1')
+ * @param int $pNumCols Number of columns to insert/delete (negative values indicate deletion)
+ * @param int $pNumRows Number of rows to insert/delete (negative values indicate deletion)
+ * @param Worksheet $pSheet The worksheet that we're editing
+ *
+ * @throws Exception
*/
- public function insertNewBefore($pBefore = 'A1', $pNumCols = 0, $pNumRows = 0, PHPExcel_Worksheet $pSheet = null)
+ public function insertNewBefore($pBefore, $pNumCols, $pNumRows, Worksheet $pSheet)
{
$remove = ($pNumCols < 0 || $pNumRows < 0);
- $aCellCollection = $pSheet->getCellCollection();
+ $allCoordinates = $pSheet->getCoordinates();
- // Get coordinates of $pBefore
- $beforeColumn = 'A';
- $beforeRow = 1;
- list($beforeColumn, $beforeRow) = PHPExcel_Cell::coordinateFromString($pBefore);
- $beforeColumnIndex = PHPExcel_Cell::columnIndexFromString($beforeColumn);
+ // Get coordinate of $pBefore
+ list($beforeColumn, $beforeRow) = Coordinate::coordinateFromString($pBefore);
+ $beforeColumnIndex = Coordinate::columnIndexFromString($beforeColumn);
// Clear cells if we are removing columns or rows
- $highestColumn = $pSheet->getHighestColumn();
- $highestRow = $pSheet->getHighestRow();
+ $highestColumn = $pSheet->getHighestColumn();
+ $highestRow = $pSheet->getHighestRow();
// 1. Clear column strips if we are removing columns
if ($pNumCols < 0 && $beforeColumnIndex - 2 + $pNumCols > 0) {
for ($i = 1; $i <= $highestRow - 1; ++$i) {
for ($j = $beforeColumnIndex - 1 + $pNumCols; $j <= $beforeColumnIndex - 2; ++$j) {
- $coordinate = PHPExcel_Cell::stringFromColumnIndex($j) . $i;
+ $coordinate = Coordinate::stringFromColumnIndex($j + 1) . $i;
$pSheet->removeConditionalStyles($coordinate);
if ($pSheet->cellExists($coordinate)) {
- $pSheet->getCell($coordinate)->setValueExplicit('', PHPExcel_Cell_DataType::TYPE_NULL);
+ $pSheet->getCell($coordinate)->setValueExplicit('', DataType::TYPE_NULL);
$pSheet->getCell($coordinate)->setXfIndex(0);
}
}
@@ -407,105 +401,103 @@ class PHPExcel_ReferenceHelper
// 2. Clear row strips if we are removing rows
if ($pNumRows < 0 && $beforeRow - 1 + $pNumRows > 0) {
- for ($i = $beforeColumnIndex - 1; $i <= PHPExcel_Cell::columnIndexFromString($highestColumn) - 1; ++$i) {
+ for ($i = $beforeColumnIndex - 1; $i <= Coordinate::columnIndexFromString($highestColumn) - 1; ++$i) {
for ($j = $beforeRow + $pNumRows; $j <= $beforeRow - 1; ++$j) {
- $coordinate = PHPExcel_Cell::stringFromColumnIndex($i) . $j;
+ $coordinate = Coordinate::stringFromColumnIndex($i + 1) . $j;
$pSheet->removeConditionalStyles($coordinate);
if ($pSheet->cellExists($coordinate)) {
- $pSheet->getCell($coordinate)->setValueExplicit('', PHPExcel_Cell_DataType::TYPE_NULL);
+ $pSheet->getCell($coordinate)->setValueExplicit('', DataType::TYPE_NULL);
$pSheet->getCell($coordinate)->setXfIndex(0);
}
}
}
}
- // Loop through cells, bottom-up, and change cell coordinates
+ // Loop through cells, bottom-up, and change cell coordinate
if ($remove) {
// It's faster to reverse and pop than to use unshift, especially with large cell collections
- $aCellCollection = array_reverse($aCellCollection);
+ $allCoordinates = array_reverse($allCoordinates);
}
- while ($cellID = array_pop($aCellCollection)) {
- $cell = $pSheet->getCell($cellID);
- $cellIndex = PHPExcel_Cell::columnIndexFromString($cell->getColumn());
+ while ($coordinate = array_pop($allCoordinates)) {
+ $cell = $pSheet->getCell($coordinate);
+ $cellIndex = Coordinate::columnIndexFromString($cell->getColumn());
- if ($cellIndex-1 + $pNumCols < 0) {
+ if ($cellIndex - 1 + $pNumCols < 0) {
continue;
}
- // New coordinates
- $newCoordinates = PHPExcel_Cell::stringFromColumnIndex($cellIndex-1 + $pNumCols) . ($cell->getRow() + $pNumRows);
+ // New coordinate
+ $newCoordinate = Coordinate::stringFromColumnIndex($cellIndex + $pNumCols) . ($cell->getRow() + $pNumRows);
// Should the cell be updated? Move value and cellXf index from one cell to another.
if (($cellIndex >= $beforeColumnIndex) && ($cell->getRow() >= $beforeRow)) {
// Update cell styles
- $pSheet->getCell($newCoordinates)->setXfIndex($cell->getXfIndex());
+ $pSheet->getCell($newCoordinate)->setXfIndex($cell->getXfIndex());
// Insert this cell at its new location
- if ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_FORMULA) {
+ if ($cell->getDataType() == DataType::TYPE_FORMULA) {
// Formula should be adjusted
- $pSheet->getCell($newCoordinates)
- ->setValue($this->updateFormulaReferences($cell->getValue(), $pBefore, $pNumCols, $pNumRows, $pSheet->getTitle()));
+ $pSheet->getCell($newCoordinate)
+ ->setValue($this->updateFormulaReferences($cell->getValue(), $pBefore, $pNumCols, $pNumRows, $pSheet->getTitle()));
} else {
// Formula should not be adjusted
- $pSheet->getCell($newCoordinates)->setValue($cell->getValue());
+ $pSheet->getCell($newCoordinate)->setValue($cell->getValue());
}
// Clear the original cell
- $pSheet->getCellCacheController()->deleteCacheData($cellID);
+ $pSheet->getCellCollection()->delete($coordinate);
} else {
/* We don't need to update styles for rows/columns before our insertion position,
but we do still need to adjust any formulae in those cells */
- if ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_FORMULA) {
+ if ($cell->getDataType() == DataType::TYPE_FORMULA) {
// Formula should be adjusted
$cell->setValue($this->updateFormulaReferences($cell->getValue(), $pBefore, $pNumCols, $pNumRows, $pSheet->getTitle()));
}
-
}
}
// Duplicate styles for the newly inserted cells
- $highestColumn = $pSheet->getHighestColumn();
- $highestRow = $pSheet->getHighestRow();
+ $highestColumn = $pSheet->getHighestColumn();
+ $highestRow = $pSheet->getHighestRow();
if ($pNumCols > 0 && $beforeColumnIndex - 2 > 0) {
for ($i = $beforeRow; $i <= $highestRow - 1; ++$i) {
// Style
- $coordinate = PHPExcel_Cell::stringFromColumnIndex($beforeColumnIndex - 2) . $i;
+ $coordinate = Coordinate::stringFromColumnIndex($beforeColumnIndex - 1) . $i;
if ($pSheet->cellExists($coordinate)) {
$xfIndex = $pSheet->getCell($coordinate)->getXfIndex();
$conditionalStyles = $pSheet->conditionalStylesExists($coordinate) ?
$pSheet->getConditionalStyles($coordinate) : false;
- for ($j = $beforeColumnIndex - 1; $j <= $beforeColumnIndex - 2 + $pNumCols; ++$j) {
+ for ($j = $beforeColumnIndex; $j <= $beforeColumnIndex - 1 + $pNumCols; ++$j) {
$pSheet->getCellByColumnAndRow($j, $i)->setXfIndex($xfIndex);
if ($conditionalStyles) {
- $cloned = array();
+ $cloned = [];
foreach ($conditionalStyles as $conditionalStyle) {
$cloned[] = clone $conditionalStyle;
}
- $pSheet->setConditionalStyles(PHPExcel_Cell::stringFromColumnIndex($j) . $i, $cloned);
+ $pSheet->setConditionalStyles(Coordinate::stringFromColumnIndex($j) . $i, $cloned);
}
}
}
-
}
}
if ($pNumRows > 0 && $beforeRow - 1 > 0) {
- for ($i = $beforeColumnIndex - 1; $i <= PHPExcel_Cell::columnIndexFromString($highestColumn) - 1; ++$i) {
+ for ($i = $beforeColumnIndex; $i <= Coordinate::columnIndexFromString($highestColumn); ++$i) {
// Style
- $coordinate = PHPExcel_Cell::stringFromColumnIndex($i) . ($beforeRow - 1);
+ $coordinate = Coordinate::stringFromColumnIndex($i) . ($beforeRow - 1);
if ($pSheet->cellExists($coordinate)) {
$xfIndex = $pSheet->getCell($coordinate)->getXfIndex();
$conditionalStyles = $pSheet->conditionalStylesExists($coordinate) ?
$pSheet->getConditionalStyles($coordinate) : false;
for ($j = $beforeRow; $j <= $beforeRow - 1 + $pNumRows; ++$j) {
- $pSheet->getCell(PHPExcel_Cell::stringFromColumnIndex($i) . $j)->setXfIndex($xfIndex);
+ $pSheet->getCell(Coordinate::stringFromColumnIndex($i) . $j)->setXfIndex($xfIndex);
if ($conditionalStyles) {
- $cloned = array();
+ $cloned = [];
foreach ($conditionalStyles as $conditionalStyle) {
$cloned[] = clone $conditionalStyle;
}
- $pSheet->setConditionalStyles(PHPExcel_Cell::stringFromColumnIndex($i) . $j, $cloned);
+ $pSheet->setConditionalStyles(Coordinate::stringFromColumnIndex($i) . $j, $cloned);
}
}
}
@@ -541,11 +533,13 @@ class PHPExcel_ReferenceHelper
$autoFilterRange = $autoFilter->getRange();
if (!empty($autoFilterRange)) {
if ($pNumCols != 0) {
- $autoFilterColumns = array_keys($autoFilter->getColumns());
+ $autoFilterColumns = $autoFilter->getColumns();
if (count($autoFilterColumns) > 0) {
+ $column = '';
+ $row = 0;
sscanf($pBefore, '%[A-Z]%d', $column, $row);
- $columnIndex = PHPExcel_Cell::columnIndexFromString($column);
- list($rangeStart, $rangeEnd) = PHPExcel_Cell::rangeBoundaries($autoFilterRange);
+ $columnIndex = Coordinate::columnIndexFromString($column);
+ list($rangeStart, $rangeEnd) = Coordinate::rangeBoundaries($autoFilterRange);
if ($columnIndex <= $rangeEnd[0]) {
if ($pNumCols < 0) {
// If we're actually deleting any columns that fall within the autofilter range,
@@ -553,8 +547,8 @@ class PHPExcel_ReferenceHelper
$deleteColumn = $columnIndex + $pNumCols - 1;
$deleteCount = abs($pNumCols);
for ($i = 1; $i <= $deleteCount; ++$i) {
- if (in_array(PHPExcel_Cell::stringFromColumnIndex($deleteColumn), $autoFilterColumns)) {
- $autoFilter->clearColumn(PHPExcel_Cell::stringFromColumnIndex($deleteColumn));
+ if (isset($autoFilterColumns[Coordinate::stringFromColumnIndex($deleteColumn + 1)])) {
+ $autoFilter->clearColumn(Coordinate::stringFromColumnIndex($deleteColumn + 1));
}
++$deleteColumn;
}
@@ -563,25 +557,20 @@ class PHPExcel_ReferenceHelper
// Shuffle columns in autofilter range
if ($pNumCols > 0) {
- // For insert, we shuffle from end to beginning to avoid overwriting
- $startColID = PHPExcel_Cell::stringFromColumnIndex($startCol-1);
- $toColID = PHPExcel_Cell::stringFromColumnIndex($startCol+$pNumCols-1);
- $endColID = PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0]);
-
$startColRef = $startCol;
$endColRef = $rangeEnd[0];
- $toColRef = $rangeEnd[0]+$pNumCols;
+ $toColRef = $rangeEnd[0] + $pNumCols;
do {
- $autoFilter->shiftColumn(PHPExcel_Cell::stringFromColumnIndex($endColRef-1), PHPExcel_Cell::stringFromColumnIndex($toColRef-1));
+ $autoFilter->shiftColumn(Coordinate::stringFromColumnIndex($endColRef), Coordinate::stringFromColumnIndex($toColRef));
--$endColRef;
--$toColRef;
} while ($startColRef <= $endColRef);
} else {
// For delete, we shuffle from beginning to end to avoid overwriting
- $startColID = PHPExcel_Cell::stringFromColumnIndex($startCol-1);
- $toColID = PHPExcel_Cell::stringFromColumnIndex($startCol+$pNumCols-1);
- $endColID = PHPExcel_Cell::stringFromColumnIndex($rangeEnd[0]);
+ $startColID = Coordinate::stringFromColumnIndex($startCol);
+ $toColID = Coordinate::stringFromColumnIndex($startCol + $pNumCols);
+ $endColID = Coordinate::stringFromColumnIndex($rangeEnd[0] + 1);
do {
$autoFilter->shiftColumn($startColID, $toColID);
++$startColID;
@@ -595,8 +584,14 @@ class PHPExcel_ReferenceHelper
}
// Update worksheet: freeze pane
- if ($pSheet->getFreezePane() != '') {
- $pSheet->freezePane($this->updateCellReference($pSheet->getFreezePane(), $pBefore, $pNumCols, $pNumRows));
+ if ($pSheet->getFreezePane()) {
+ $splitCell = $pSheet->getFreezePane();
+ $topLeftCell = $pSheet->getTopLeftCell();
+
+ $splitCell = $this->updateCellReference($splitCell, $pBefore, $pNumCols, $pNumRows);
+ $topLeftCell = $this->updateCellReference($topLeftCell, $pBefore, $pNumCols, $pNumRows);
+
+ $pSheet->freezePane($splitCell, $topLeftCell);
}
// Page setup
@@ -627,15 +622,17 @@ class PHPExcel_ReferenceHelper
}
/**
- * Update references within formulas
+ * Update references within formulas.
*
- * @param string $pFormula Formula to update
- * @param int $pBefore Insert before this one
- * @param int $pNumCols Number of columns to insert
- * @param int $pNumRows Number of rows to insert
- * @param string $sheetName Worksheet name/title
- * @return string Updated formula
- * @throws PHPExcel_Exception
+ * @param string $pFormula Formula to update
+ * @param int $pBefore Insert before this one
+ * @param int $pNumCols Number of columns to insert
+ * @param int $pNumRows Number of rows to insert
+ * @param string $sheetName Worksheet name/title
+ *
+ * @throws Exception
+ *
+ * @return string Updated formula
*/
public function updateFormulaReferences($pFormula = '', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0, $sheetName = '')
{
@@ -646,104 +643,104 @@ class PHPExcel_ReferenceHelper
// Ignore blocks that were enclosed in quotes (alternating entries in the $formulaBlocks array after the explode)
if ($i = !$i) {
$adjustCount = 0;
- $newCellTokens = $cellTokens = array();
+ $newCellTokens = $cellTokens = [];
// Search for row ranges (e.g. 'Sheet1'!3:5 or 3:5) with or without $ absolutes (e.g. $3:5)
- $matchCount = preg_match_all('/'.self::REFHELPER_REGEXP_ROWRANGE.'/i', ' '.$formulaBlock.' ', $matches, PREG_SET_ORDER);
+ $matchCount = preg_match_all('/' . self::REFHELPER_REGEXP_ROWRANGE . '/i', ' ' . $formulaBlock . ' ', $matches, PREG_SET_ORDER);
if ($matchCount > 0) {
foreach ($matches as $match) {
- $fromString = ($match[2] > '') ? $match[2].'!' : '';
- $fromString .= $match[3].':'.$match[4];
- $modified3 = substr($this->updateCellReference('$A'.$match[3], $pBefore, $pNumCols, $pNumRows), 2);
- $modified4 = substr($this->updateCellReference('$A'.$match[4], $pBefore, $pNumCols, $pNumRows), 2);
+ $fromString = ($match[2] > '') ? $match[2] . '!' : '';
+ $fromString .= $match[3] . ':' . $match[4];
+ $modified3 = substr($this->updateCellReference('$A' . $match[3], $pBefore, $pNumCols, $pNumRows), 2);
+ $modified4 = substr($this->updateCellReference('$A' . $match[4], $pBefore, $pNumCols, $pNumRows), 2);
- if ($match[3].':'.$match[4] !== $modified3.':'.$modified4) {
+ if ($match[3] . ':' . $match[4] !== $modified3 . ':' . $modified4) {
if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) {
- $toString = ($match[2] > '') ? $match[2].'!' : '';
- $toString .= $modified3.':'.$modified4;
+ $toString = ($match[2] > '') ? $match[2] . '!' : '';
+ $toString .= $modified3 . ':' . $modified4;
// Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more
$column = 100000;
$row = 10000000 + trim($match[3], '$');
- $cellIndex = $column.$row;
+ $cellIndex = $column . $row;
- $newCellTokens[$cellIndex] = preg_quote($toString);
- $cellTokens[$cellIndex] = '/(? 0) {
foreach ($matches as $match) {
- $fromString = ($match[2] > '') ? $match[2].'!' : '';
- $fromString .= $match[3].':'.$match[4];
- $modified3 = substr($this->updateCellReference($match[3].'$1', $pBefore, $pNumCols, $pNumRows), 0, -2);
- $modified4 = substr($this->updateCellReference($match[4].'$1', $pBefore, $pNumCols, $pNumRows), 0, -2);
+ $fromString = ($match[2] > '') ? $match[2] . '!' : '';
+ $fromString .= $match[3] . ':' . $match[4];
+ $modified3 = substr($this->updateCellReference($match[3] . '$1', $pBefore, $pNumCols, $pNumRows), 0, -2);
+ $modified4 = substr($this->updateCellReference($match[4] . '$1', $pBefore, $pNumCols, $pNumRows), 0, -2);
- if ($match[3].':'.$match[4] !== $modified3.':'.$modified4) {
+ if ($match[3] . ':' . $match[4] !== $modified3 . ':' . $modified4) {
if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) {
- $toString = ($match[2] > '') ? $match[2].'!' : '';
- $toString .= $modified3.':'.$modified4;
+ $toString = ($match[2] > '') ? $match[2] . '!' : '';
+ $toString .= $modified3 . ':' . $modified4;
// Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more
- $column = PHPExcel_Cell::columnIndexFromString(trim($match[3], '$')) + 100000;
+ $column = Coordinate::columnIndexFromString(trim($match[3], '$')) + 100000;
$row = 10000000;
- $cellIndex = $column.$row;
+ $cellIndex = $column . $row;
- $newCellTokens[$cellIndex] = preg_quote($toString);
- $cellTokens[$cellIndex] = '/(? 0) {
foreach ($matches as $match) {
- $fromString = ($match[2] > '') ? $match[2].'!' : '';
- $fromString .= $match[3].':'.$match[4];
+ $fromString = ($match[2] > '') ? $match[2] . '!' : '';
+ $fromString .= $match[3] . ':' . $match[4];
$modified3 = $this->updateCellReference($match[3], $pBefore, $pNumCols, $pNumRows);
$modified4 = $this->updateCellReference($match[4], $pBefore, $pNumCols, $pNumRows);
- if ($match[3].$match[4] !== $modified3.$modified4) {
+ if ($match[3] . $match[4] !== $modified3 . $modified4) {
if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) {
- $toString = ($match[2] > '') ? $match[2].'!' : '';
- $toString .= $modified3.':'.$modified4;
- list($column, $row) = PHPExcel_Cell::coordinateFromString($match[3]);
+ $toString = ($match[2] > '') ? $match[2] . '!' : '';
+ $toString .= $modified3 . ':' . $modified4;
+ list($column, $row) = Coordinate::coordinateFromString($match[3]);
// Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more
- $column = PHPExcel_Cell::columnIndexFromString(trim($column, '$')) + 100000;
+ $column = Coordinate::columnIndexFromString(trim($column, '$')) + 100000;
$row = trim($row, '$') + 10000000;
- $cellIndex = $column.$row;
+ $cellIndex = $column . $row;
- $newCellTokens[$cellIndex] = preg_quote($toString);
- $cellTokens[$cellIndex] = '/(? 0) {
foreach ($matches as $match) {
- $fromString = ($match[2] > '') ? $match[2].'!' : '';
+ $fromString = ($match[2] > '') ? $match[2] . '!' : '';
$fromString .= $match[3];
$modified3 = $this->updateCellReference($match[3], $pBefore, $pNumCols, $pNumRows);
if ($match[3] !== $modified3) {
if (($match[2] == '') || (trim($match[2], "'") == $sheetName)) {
- $toString = ($match[2] > '') ? $match[2].'!' : '';
+ $toString = ($match[2] > '') ? $match[2] . '!' : '';
$toString .= $modified3;
- list($column, $row) = PHPExcel_Cell::coordinateFromString($match[3]);
+ list($column, $row) = Coordinate::coordinateFromString($match[3]);
// Max worksheet size is 1,048,576 rows by 16,384 columns in Excel 2007, so our adjustments need to be at least one digit more
- $column = PHPExcel_Cell::columnIndexFromString(trim($column, '$')) + 100000;
+ $column = Coordinate::columnIndexFromString(trim($column, '$')) + 100000;
$row = trim($row, '$') + 10000000;
$cellIndex = $row . $column;
- $newCellTokens[$cellIndex] = preg_quote($toString);
- $cellTokens[$cellIndex] = '/(?updateSingleCellReference($pCellRange, $pBefore, $pNumCols, $pNumRows);
- } elseif (strpos($pCellRange, ':') !== false || strpos($pCellRange, ',') !== false) {
+ } elseif (Coordinate::coordinateIsRange($pCellRange)) {
// Range
return $this->updateCellRange($pCellRange, $pBefore, $pNumCols, $pNumRows);
- } else {
- // Return original
- return $pCellRange;
}
+
+ // Return original
+ return $pCellRange;
}
/**
- * Update named formulas (i.e. containing worksheet references / named ranges)
+ * Update named formulas (i.e. containing worksheet references / named ranges).
*
- * @param PHPExcel $pPhpExcel Object to update
- * @param string $oldName Old name (name to replace)
- * @param string $newName New name
+ * @param Spreadsheet $spreadsheet Object to update
+ * @param string $oldName Old name (name to replace)
+ * @param string $newName New name
*/
- public function updateNamedFormulas(PHPExcel $pPhpExcel, $oldName = '', $newName = '')
+ public function updateNamedFormulas(Spreadsheet $spreadsheet, $oldName = '', $newName = '')
{
if ($oldName == '') {
return;
}
- foreach ($pPhpExcel->getWorksheetIterator() as $sheet) {
- foreach ($sheet->getCellCollection(false) as $cellID) {
- $cell = $sheet->getCell($cellID);
- if (($cell !== null) && ($cell->getDataType() == PHPExcel_Cell_DataType::TYPE_FORMULA)) {
+ foreach ($spreadsheet->getWorksheetIterator() as $sheet) {
+ foreach ($sheet->getCoordinates(false) as $coordinate) {
+ $cell = $sheet->getCell($coordinate);
+ if (($cell !== null) && ($cell->getDataType() == DataType::TYPE_FORMULA)) {
$formula = $cell->getValue();
if (strpos($formula, $oldName) !== false) {
$formula = str_replace("'" . $oldName . "'!", "'" . $newName . "'!", $formula);
- $formula = str_replace($oldName . "!", $newName . "!", $formula);
- $cell->setValueExplicit($formula, PHPExcel_Cell_DataType::TYPE_FORMULA);
+ $formula = str_replace($oldName . '!', $newName . '!', $formula);
+ $cell->setValueExplicit($formula, DataType::TYPE_FORMULA);
}
}
}
@@ -824,90 +823,94 @@ class PHPExcel_ReferenceHelper
}
/**
- * Update cell range
+ * Update cell range.
*
- * @param string $pCellRange Cell range (e.g. 'B2:D4', 'B:C' or '2:3')
- * @param int $pBefore Insert before this one
- * @param int $pNumCols Number of columns to increment
- * @param int $pNumRows Number of rows to increment
- * @return string Updated cell range
- * @throws PHPExcel_Exception
+ * @param string $pCellRange Cell range (e.g. 'B2:D4', 'B:C' or '2:3')
+ * @param string $pBefore Insert before this one
+ * @param int $pNumCols Number of columns to increment
+ * @param int $pNumRows Number of rows to increment
+ *
+ * @throws Exception
+ *
+ * @return string Updated cell range
*/
private function updateCellRange($pCellRange = 'A1:A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0)
{
- if (strpos($pCellRange, ':') !== false || strpos($pCellRange, ',') !== false) {
- // Update range
- $range = PHPExcel_Cell::splitRange($pCellRange);
- $ic = count($range);
- for ($i = 0; $i < $ic; ++$i) {
- $jc = count($range[$i]);
- for ($j = 0; $j < $jc; ++$j) {
- if (ctype_alpha($range[$i][$j])) {
- $r = PHPExcel_Cell::coordinateFromString($this->updateSingleCellReference($range[$i][$j].'1', $pBefore, $pNumCols, $pNumRows));
- $range[$i][$j] = $r[0];
- } elseif (ctype_digit($range[$i][$j])) {
- $r = PHPExcel_Cell::coordinateFromString($this->updateSingleCellReference('A'.$range[$i][$j], $pBefore, $pNumCols, $pNumRows));
- $range[$i][$j] = $r[1];
- } else {
- $range[$i][$j] = $this->updateSingleCellReference($range[$i][$j], $pBefore, $pNumCols, $pNumRows);
- }
+ if (!Coordinate::coordinateIsRange($pCellRange)) {
+ throw new Exception('Only cell ranges may be passed to this method.');
+ }
+
+ // Update range
+ $range = Coordinate::splitRange($pCellRange);
+ $ic = count($range);
+ for ($i = 0; $i < $ic; ++$i) {
+ $jc = count($range[$i]);
+ for ($j = 0; $j < $jc; ++$j) {
+ if (ctype_alpha($range[$i][$j])) {
+ $r = Coordinate::coordinateFromString($this->updateSingleCellReference($range[$i][$j] . '1', $pBefore, $pNumCols, $pNumRows));
+ $range[$i][$j] = $r[0];
+ } elseif (ctype_digit($range[$i][$j])) {
+ $r = Coordinate::coordinateFromString($this->updateSingleCellReference('A' . $range[$i][$j], $pBefore, $pNumCols, $pNumRows));
+ $range[$i][$j] = $r[1];
+ } else {
+ $range[$i][$j] = $this->updateSingleCellReference($range[$i][$j], $pBefore, $pNumCols, $pNumRows);
}
}
-
- // Recreate range string
- return PHPExcel_Cell::buildRange($range);
- } else {
- throw new PHPExcel_Exception("Only cell ranges may be passed to this method.");
}
+
+ // Recreate range string
+ return Coordinate::buildRange($range);
}
/**
- * Update single cell reference
+ * Update single cell reference.
*
- * @param string $pCellReference Single cell reference
- * @param int $pBefore Insert before this one
- * @param int $pNumCols Number of columns to increment
- * @param int $pNumRows Number of rows to increment
- * @return string Updated cell reference
- * @throws PHPExcel_Exception
+ * @param string $pCellReference Single cell reference
+ * @param string $pBefore Insert before this one
+ * @param int $pNumCols Number of columns to increment
+ * @param int $pNumRows Number of rows to increment
+ *
+ * @throws Exception
+ *
+ * @return string Updated cell reference
*/
private function updateSingleCellReference($pCellReference = 'A1', $pBefore = 'A1', $pNumCols = 0, $pNumRows = 0)
{
- if (strpos($pCellReference, ':') === false && strpos($pCellReference, ',') === false) {
- // Get coordinates of $pBefore
- list($beforeColumn, $beforeRow) = PHPExcel_Cell::coordinateFromString($pBefore);
-
- // Get coordinates of $pCellReference
- list($newColumn, $newRow) = PHPExcel_Cell::coordinateFromString($pCellReference);
-
- // Verify which parts should be updated
- $updateColumn = (($newColumn{0} != '$') && ($beforeColumn{0} != '$') && (PHPExcel_Cell::columnIndexFromString($newColumn) >= PHPExcel_Cell::columnIndexFromString($beforeColumn)));
- $updateRow = (($newRow{0} != '$') && ($beforeRow{0} != '$') && $newRow >= $beforeRow);
-
- // Create new column reference
- if ($updateColumn) {
- $newColumn = PHPExcel_Cell::stringFromColumnIndex(PHPExcel_Cell::columnIndexFromString($newColumn) - 1 + $pNumCols);
- }
-
- // Create new row reference
- if ($updateRow) {
- $newRow = $newRow + $pNumRows;
- }
-
- // Return new reference
- return $newColumn . $newRow;
- } else {
- throw new PHPExcel_Exception("Only single cell references may be passed to this method.");
+ if (Coordinate::coordinateIsRange($pCellReference)) {
+ throw new Exception('Only single cell references may be passed to this method.');
}
+
+ // Get coordinate of $pBefore
+ list($beforeColumn, $beforeRow) = Coordinate::coordinateFromString($pBefore);
+
+ // Get coordinate of $pCellReference
+ list($newColumn, $newRow) = Coordinate::coordinateFromString($pCellReference);
+
+ // Verify which parts should be updated
+ $updateColumn = (($newColumn[0] != '$') && ($beforeColumn[0] != '$') && (Coordinate::columnIndexFromString($newColumn) >= Coordinate::columnIndexFromString($beforeColumn)));
+ $updateRow = (($newRow[0] != '$') && ($beforeRow[0] != '$') && $newRow >= $beforeRow);
+
+ // Create new column reference
+ if ($updateColumn) {
+ $newColumn = Coordinate::stringFromColumnIndex(Coordinate::columnIndexFromString($newColumn) + $pNumCols);
+ }
+
+ // Create new row reference
+ if ($updateRow) {
+ $newRow = $newRow + $pNumRows;
+ }
+
+ // Return new reference
+ return $newColumn . $newRow;
}
/**
* __clone implementation. Cloning should not be allowed in a Singleton!
*
- * @throws PHPExcel_Exception
+ * @throws Exception
*/
final public function __clone()
{
- throw new PHPExcel_Exception("Cloning a Singleton is not allowed!");
+ throw new Exception('Cloning a Singleton is not allowed!');
}
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/ITextElement.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/ITextElement.php
new file mode 100644
index 00000000000..69954676028
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/ITextElement.php
@@ -0,0 +1,36 @@
+richTextElements = [];
+
+ // Rich-Text string attached to cell?
+ if ($pCell !== null) {
+ // Add cell text and style
+ if ($pCell->getValue() != '') {
+ $objRun = new Run($pCell->getValue());
+ $objRun->setFont(clone $pCell->getWorksheet()->getStyle($pCell->getCoordinate())->getFont());
+ $this->addText($objRun);
+ }
+
+ // Set parent value
+ $pCell->setValueExplicit($this, DataType::TYPE_STRING);
+ }
+ }
+
+ /**
+ * Add text.
+ *
+ * @param ITextElement $pText Rich text element
+ *
+ * @return RichText
+ */
+ public function addText(ITextElement $pText)
+ {
+ $this->richTextElements[] = $pText;
+
+ return $this;
+ }
+
+ /**
+ * Create text.
+ *
+ * @param string $pText Text
+ *
+ * @throws Exception
+ *
+ * @return TextElement
+ */
+ public function createText($pText)
+ {
+ $objText = new TextElement($pText);
+ $this->addText($objText);
+
+ return $objText;
+ }
+
+ /**
+ * Create text run.
+ *
+ * @param string $pText Text
+ *
+ * @throws Exception
+ *
+ * @return Run
+ */
+ public function createTextRun($pText)
+ {
+ $objText = new Run($pText);
+ $this->addText($objText);
+
+ return $objText;
+ }
+
+ /**
+ * Get plain text.
+ *
+ * @return string
+ */
+ public function getPlainText()
+ {
+ // Return value
+ $returnValue = '';
+
+ // Loop through all ITextElements
+ foreach ($this->richTextElements as $text) {
+ $returnValue .= $text->getText();
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * Convert to string.
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->getPlainText();
+ }
+
+ /**
+ * Get Rich Text elements.
+ *
+ * @return ITextElement[]
+ */
+ public function getRichTextElements()
+ {
+ return $this->richTextElements;
+ }
+
+ /**
+ * Set Rich Text elements.
+ *
+ * @param ITextElement[] $textElements Array of elements
+ *
+ * @return RichText
+ */
+ public function setRichTextElements(array $textElements)
+ {
+ $this->richTextElements = $textElements;
+
+ return $this;
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ $hashElements = '';
+ foreach ($this->richTextElements as $element) {
+ $hashElements .= $element->getHashCode();
+ }
+
+ return md5(
+ $hashElements .
+ __CLASS__
+ );
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/Run.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/Run.php
new file mode 100644
index 00000000000..b4996235f33
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/Run.php
@@ -0,0 +1,65 @@
+font = new Font();
+ }
+
+ /**
+ * Get font.
+ *
+ * @return null|\PhpOffice\PhpSpreadsheet\Style\Font
+ */
+ public function getFont()
+ {
+ return $this->font;
+ }
+
+ /**
+ * Set font.
+ *
+ * @param Font $pFont Font
+ *
+ * @return ITextElement
+ */
+ public function setFont(Font $pFont = null)
+ {
+ $this->font = $pFont;
+
+ return $this;
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ return md5(
+ $this->getText() .
+ $this->font->getHashCode() .
+ __CLASS__
+ );
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/TextElement.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/TextElement.php
new file mode 100644
index 00000000000..d9ad0d7f5ed
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/RichText/TextElement.php
@@ -0,0 +1,86 @@
+text = $pText;
+ }
+
+ /**
+ * Get text.
+ *
+ * @return string Text
+ */
+ public function getText()
+ {
+ return $this->text;
+ }
+
+ /**
+ * Set text.
+ *
+ * @param $text string Text
+ *
+ * @return ITextElement
+ */
+ public function setText($text)
+ {
+ $this->text = $text;
+
+ return $this;
+ }
+
+ /**
+ * Get font.
+ *
+ * @return null|\PhpOffice\PhpSpreadsheet\Style\Font
+ */
+ public function getFont()
+ {
+ return null;
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ return md5(
+ $this->text .
+ __CLASS__
+ );
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Settings.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Settings.php
new file mode 100644
index 00000000000..22196b7e0e2
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Settings.php
@@ -0,0 +1,127 @@
+setLocale($locale);
+ }
+
+ /**
+ * Identify to PhpSpreadsheet the external library to use for rendering charts.
+ *
+ * @param string $rendererClass Class name of the chart renderer
+ * eg: PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph
+ *
+ * @throws Exception
+ */
+ public static function setChartRenderer($rendererClass)
+ {
+ if (!is_a($rendererClass, IRenderer::class, true)) {
+ throw new Exception('Chart renderer must implement ' . IRenderer::class);
+ }
+
+ self::$chartRenderer = $rendererClass;
+ }
+
+ /**
+ * Return the Chart Rendering Library that PhpSpreadsheet is currently configured to use.
+ *
+ * @return null|string Class name of the chart renderer
+ * eg: PhpOffice\PhpSpreadsheet\Chart\Renderer\JpGraph
+ */
+ public static function getChartRenderer()
+ {
+ return self::$chartRenderer;
+ }
+
+ /**
+ * Set default options for libxml loader.
+ *
+ * @param int $options Default options for libxml loader
+ */
+ public static function setLibXmlLoaderOptions($options)
+ {
+ if ($options === null && defined('LIBXML_DTDLOAD')) {
+ $options = LIBXML_DTDLOAD | LIBXML_DTDATTR;
+ }
+ self::$libXmlLoaderOptions = $options;
+ }
+
+ /**
+ * Get default options for libxml loader.
+ * Defaults to LIBXML_DTDLOAD | LIBXML_DTDATTR when not set explicitly.
+ *
+ * @return int Default options for libxml loader
+ */
+ public static function getLibXmlLoaderOptions()
+ {
+ if (self::$libXmlLoaderOptions === null && defined('LIBXML_DTDLOAD')) {
+ self::setLibXmlLoaderOptions(LIBXML_DTDLOAD | LIBXML_DTDATTR);
+ } elseif (self::$libXmlLoaderOptions === null) {
+ self::$libXmlLoaderOptions = true;
+ }
+
+ return self::$libXmlLoaderOptions;
+ }
+
+ /**
+ * Sets the implementation of cache that should be used for cell collection.
+ *
+ * @param CacheInterface $cache
+ */
+ public static function setCache(CacheInterface $cache)
+ {
+ self::$cache = $cache;
+ }
+
+ /**
+ * Gets the implementation of cache that should be used for cell collection.
+ *
+ * @return CacheInterface
+ */
+ public static function getCache()
+ {
+ if (!self::$cache) {
+ self::$cache = new Memory();
+ }
+
+ return self::$cache;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/CodePage.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/CodePage.php
new file mode 100644
index 00000000000..4b57824203e
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/CodePage.php
@@ -0,0 +1,138 @@
+ 'January',
+ 'Feb' => 'February',
+ 'Mar' => 'March',
+ 'Apr' => 'April',
+ 'May' => 'May',
+ 'Jun' => 'June',
+ 'Jul' => 'July',
+ 'Aug' => 'August',
+ 'Sep' => 'September',
+ 'Oct' => 'October',
+ 'Nov' => 'November',
+ 'Dec' => 'December',
+ ];
+
+ /**
+ * @var string[]
+ */
+ public static $numberSuffixes = [
+ 'st',
+ 'nd',
+ 'rd',
+ 'th',
+ ];
+
+ /**
+ * Base calendar year to use for calculations
+ * Value is either CALENDAR_WINDOWS_1900 (1900) or CALENDAR_MAC_1904 (1904).
+ *
+ * @var int
+ */
+ protected static $excelCalendar = self::CALENDAR_WINDOWS_1900;
+
+ /**
+ * Default timezone to use for DateTime objects.
+ *
+ * @var null|\DateTimeZone
+ */
+ protected static $defaultTimeZone;
+
+ /**
+ * Set the Excel calendar (Windows 1900 or Mac 1904).
+ *
+ * @param int $baseDate Excel base date (1900 or 1904)
+ *
+ * @return bool Success or failure
+ */
+ public static function setExcelCalendar($baseDate)
+ {
+ if (($baseDate == self::CALENDAR_WINDOWS_1900) ||
+ ($baseDate == self::CALENDAR_MAC_1904)) {
+ self::$excelCalendar = $baseDate;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Return the Excel calendar (Windows 1900 or Mac 1904).
+ *
+ * @return int Excel base date (1900 or 1904)
+ */
+ public static function getExcelCalendar()
+ {
+ return self::$excelCalendar;
+ }
+
+ /**
+ * Set the Default timezone to use for dates.
+ *
+ * @param DateTimeZone|string $timeZone The timezone to set for all Excel datetimestamp to PHP DateTime Object conversions
+ *
+ * @throws \Exception
+ *
+ * @return bool Success or failure
+ * @return bool Success or failure
+ */
+ public static function setDefaultTimezone($timeZone)
+ {
+ if ($timeZone = self::validateTimeZone($timeZone)) {
+ self::$defaultTimeZone = $timeZone;
+
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Return the Default timezone being used for dates.
+ *
+ * @return DateTimeZone The timezone being used as default for Excel timestamp to PHP DateTime object
+ */
+ public static function getDefaultTimezone()
+ {
+ if (self::$defaultTimeZone === null) {
+ self::$defaultTimeZone = new DateTimeZone('UTC');
+ }
+
+ return self::$defaultTimeZone;
+ }
+
+ /**
+ * Validate a timezone.
+ *
+ * @param DateTimeZone|string $timeZone The timezone to validate, either as a timezone string or object
+ *
+ * @throws \Exception
+ *
+ * @return DateTimeZone The timezone as a timezone object
+ * @return DateTimeZone The timezone as a timezone object
+ */
+ protected static function validateTimeZone($timeZone)
+ {
+ if (is_object($timeZone) && $timeZone instanceof DateTimeZone) {
+ return $timeZone;
+ } elseif (is_string($timeZone)) {
+ return new DateTimeZone($timeZone);
+ }
+
+ throw new \Exception('Invalid timezone');
+ }
+
+ /**
+ * Convert a MS serialized datetime value from Excel to a PHP Date/Time object.
+ *
+ * @param float|int $excelTimestamp MS Excel serialized date/time value
+ * @param null|DateTimeZone|string $timeZone The timezone to assume for the Excel timestamp,
+ * if you don't want to treat it as a UTC value
+ * Use the default (UST) unless you absolutely need a conversion
+ *
+ * @throws \Exception
+ *
+ * @return \DateTime PHP date/time object
+ */
+ public static function excelToDateTimeObject($excelTimestamp, $timeZone = null)
+ {
+ $timeZone = ($timeZone === null) ? self::getDefaultTimezone() : self::validateTimeZone($timeZone);
+ if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_EXCEL) {
+ if ($excelTimestamp < 1.0) {
+ // Unix timestamp base date
+ $baseDate = new \DateTime('1970-01-01', $timeZone);
+ } else {
+ // MS Excel calendar base dates
+ if (self::$excelCalendar == self::CALENDAR_WINDOWS_1900) {
+ // Allow adjustment for 1900 Leap Year in MS Excel
+ $baseDate = ($excelTimestamp < 60) ? new \DateTime('1899-12-31', $timeZone) : new \DateTime('1899-12-30', $timeZone);
+ } else {
+ $baseDate = new \DateTime('1904-01-01', $timeZone);
+ }
+ }
+ } else {
+ $baseDate = new \DateTime('1899-12-30', $timeZone);
+ }
+
+ $days = floor($excelTimestamp);
+ $partDay = $excelTimestamp - $days;
+ $hours = floor($partDay * 24);
+ $partDay = $partDay * 24 - $hours;
+ $minutes = floor($partDay * 60);
+ $partDay = $partDay * 60 - $minutes;
+ $seconds = round($partDay * 60);
+
+ if ($days >= 0) {
+ $days = '+' . $days;
+ }
+ $interval = $days . ' days';
+
+ return $baseDate->modify($interval)
+ ->setTime($hours, $minutes, $seconds);
+ }
+
+ /**
+ * Convert a MS serialized datetime value from Excel to a unix timestamp.
+ *
+ * @param float|int $excelTimestamp MS Excel serialized date/time value
+ * @param null|DateTimeZone|string $timeZone The timezone to assume for the Excel timestamp,
+ * if you don't want to treat it as a UTC value
+ * Use the default (UST) unless you absolutely need a conversion
+ *
+ * @throws \Exception
+ *
+ * @return int Unix timetamp for this date/time
+ */
+ public static function excelToTimestamp($excelTimestamp, $timeZone = null)
+ {
+ return (int) self::excelToDateTimeObject($excelTimestamp, $timeZone)
+ ->format('U');
+ }
+
+ /**
+ * Convert a date from PHP to an MS Excel serialized date/time value.
+ *
+ * @param mixed $dateValue Unix Timestamp or PHP DateTime object or a string
+ *
+ * @return bool|float Excel date/time value
+ * or boolean FALSE on failure
+ */
+ public static function PHPToExcel($dateValue)
+ {
+ if ((is_object($dateValue)) && ($dateValue instanceof DateTimeInterface)) {
+ return self::dateTimeToExcel($dateValue);
+ } elseif (is_numeric($dateValue)) {
+ return self::timestampToExcel($dateValue);
+ } elseif (is_string($dateValue)) {
+ return self::stringToExcel($dateValue);
+ }
+
+ return false;
+ }
+
+ /**
+ * Convert a PHP DateTime object to an MS Excel serialized date/time value.
+ *
+ * @param DateTimeInterface $dateValue PHP DateTime object
+ *
+ * @return float MS Excel serialized date/time value
+ */
+ public static function dateTimeToExcel(DateTimeInterface $dateValue)
+ {
+ return self::formattedPHPToExcel(
+ $dateValue->format('Y'),
+ $dateValue->format('m'),
+ $dateValue->format('d'),
+ $dateValue->format('H'),
+ $dateValue->format('i'),
+ $dateValue->format('s')
+ );
+ }
+
+ /**
+ * Convert a Unix timestamp to an MS Excel serialized date/time value.
+ *
+ * @param int $dateValue Unix Timestamp
+ *
+ * @return float MS Excel serialized date/time value
+ */
+ public static function timestampToExcel($dateValue)
+ {
+ if (!is_numeric($dateValue)) {
+ return false;
+ }
+
+ return self::dateTimeToExcel(new \DateTime('@' . $dateValue));
+ }
+
+ /**
+ * formattedPHPToExcel.
+ *
+ * @param int $year
+ * @param int $month
+ * @param int $day
+ * @param int $hours
+ * @param int $minutes
+ * @param int $seconds
+ *
+ * @return float Excel date/time value
+ */
+ public static function formattedPHPToExcel($year, $month, $day, $hours = 0, $minutes = 0, $seconds = 0)
+ {
+ if (self::$excelCalendar == self::CALENDAR_WINDOWS_1900) {
+ //
+ // Fudge factor for the erroneous fact that the year 1900 is treated as a Leap Year in MS Excel
+ // This affects every date following 28th February 1900
+ //
+ $excel1900isLeapYear = true;
+ if (($year == 1900) && ($month <= 2)) {
+ $excel1900isLeapYear = false;
+ }
+ $myexcelBaseDate = 2415020;
+ } else {
+ $myexcelBaseDate = 2416481;
+ $excel1900isLeapYear = false;
+ }
+
+ // Julian base date Adjustment
+ if ($month > 2) {
+ $month -= 3;
+ } else {
+ $month += 9;
+ --$year;
+ }
+
+ // Calculate the Julian Date, then subtract the Excel base date (JD 2415020 = 31-Dec-1899 Giving Excel Date of 0)
+ $century = substr($year, 0, 2);
+ $decade = substr($year, 2, 2);
+ $excelDate = floor((146097 * $century) / 4) + floor((1461 * $decade) / 4) + floor((153 * $month + 2) / 5) + $day + 1721119 - $myexcelBaseDate + $excel1900isLeapYear;
+
+ $excelTime = (($hours * 3600) + ($minutes * 60) + $seconds) / 86400;
+
+ return (float) $excelDate + $excelTime;
+ }
+
+ /**
+ * Is a given cell a date/time?
+ *
+ * @param Cell $pCell
+ *
+ * @return bool
+ */
+ public static function isDateTime(Cell $pCell)
+ {
+ return is_numeric($pCell->getValue()) &&
+ self::isDateTimeFormat(
+ $pCell->getWorksheet()->getStyle(
+ $pCell->getCoordinate()
+ )->getNumberFormat()
+ );
+ }
+
+ /**
+ * Is a given number format a date/time?
+ *
+ * @param NumberFormat $pFormat
+ *
+ * @return bool
+ */
+ public static function isDateTimeFormat(NumberFormat $pFormat)
+ {
+ return self::isDateTimeFormatCode($pFormat->getFormatCode());
+ }
+
+ private static $possibleDateFormatCharacters = 'eymdHs';
+
+ /**
+ * Is a given number format code a date/time?
+ *
+ * @param string $pFormatCode
+ *
+ * @return bool
+ */
+ public static function isDateTimeFormatCode($pFormatCode)
+ {
+ if (strtolower($pFormatCode) === strtolower(NumberFormat::FORMAT_GENERAL)) {
+ // "General" contains an epoch letter 'e', so we trap for it explicitly here (case-insensitive check)
+ return false;
+ }
+ if (preg_match('/[0#]E[+-]0/i', $pFormatCode)) {
+ // Scientific format
+ return false;
+ }
+
+ // Switch on formatcode
+ switch ($pFormatCode) {
+ // Explicitly defined date formats
+ case NumberFormat::FORMAT_DATE_YYYYMMDD:
+ case NumberFormat::FORMAT_DATE_YYYYMMDD2:
+ case NumberFormat::FORMAT_DATE_DDMMYYYY:
+ case NumberFormat::FORMAT_DATE_DMYSLASH:
+ case NumberFormat::FORMAT_DATE_DMYMINUS:
+ case NumberFormat::FORMAT_DATE_DMMINUS:
+ case NumberFormat::FORMAT_DATE_MYMINUS:
+ case NumberFormat::FORMAT_DATE_DATETIME:
+ case NumberFormat::FORMAT_DATE_TIME1:
+ case NumberFormat::FORMAT_DATE_TIME2:
+ case NumberFormat::FORMAT_DATE_TIME3:
+ case NumberFormat::FORMAT_DATE_TIME4:
+ case NumberFormat::FORMAT_DATE_TIME5:
+ case NumberFormat::FORMAT_DATE_TIME6:
+ case NumberFormat::FORMAT_DATE_TIME7:
+ case NumberFormat::FORMAT_DATE_TIME8:
+ case NumberFormat::FORMAT_DATE_YYYYMMDDSLASH:
+ case NumberFormat::FORMAT_DATE_XLSX14:
+ case NumberFormat::FORMAT_DATE_XLSX15:
+ case NumberFormat::FORMAT_DATE_XLSX16:
+ case NumberFormat::FORMAT_DATE_XLSX17:
+ case NumberFormat::FORMAT_DATE_XLSX22:
+ return true;
+ }
+
+ // Typically number, currency or accounting (or occasionally fraction) formats
+ if ((substr($pFormatCode, 0, 1) == '_') || (substr($pFormatCode, 0, 2) == '0 ')) {
+ return false;
+ }
+ // Try checking for any of the date formatting characters that don't appear within square braces
+ if (preg_match('/(^|\])[^\[]*[' . self::$possibleDateFormatCharacters . ']/i', $pFormatCode)) {
+ // We might also have a format mask containing quoted strings...
+ // we don't want to test for any of our characters within the quoted blocks
+ if (strpos($pFormatCode, '"') !== false) {
+ $segMatcher = false;
+ foreach (explode('"', $pFormatCode) as $subVal) {
+ // Only test in alternate array entries (the non-quoted blocks)
+ if (($segMatcher = !$segMatcher) &&
+ (preg_match('/(^|\])[^\[]*[' . self::$possibleDateFormatCharacters . ']/i', $subVal))) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ return true;
+ }
+
+ // No date...
+ return false;
+ }
+
+ /**
+ * Convert a date/time string to Excel time.
+ *
+ * @param string $dateValue Examples: '2009-12-31', '2009-12-31 15:59', '2009-12-31 15:59:10'
+ *
+ * @return false|float Excel date/time serial value
+ */
+ public static function stringToExcel($dateValue)
+ {
+ if (strlen($dateValue) < 2) {
+ return false;
+ }
+ if (!preg_match('/^(\d{1,4}[ \.\/\-][A-Z]{3,9}([ \.\/\-]\d{1,4})?|[A-Z]{3,9}[ \.\/\-]\d{1,4}([ \.\/\-]\d{1,4})?|\d{1,4}[ \.\/\-]\d{1,4}([ \.\/\-]\d{1,4})?)( \d{1,2}:\d{1,2}(:\d{1,2})?)?$/iu', $dateValue)) {
+ return false;
+ }
+
+ $dateValueNew = DateTime::DATEVALUE($dateValue);
+
+ if ($dateValueNew === Functions::VALUE()) {
+ return false;
+ }
+
+ if (strpos($dateValue, ':') !== false) {
+ $timeValue = DateTime::TIMEVALUE($dateValue);
+ if ($timeValue === Functions::VALUE()) {
+ return false;
+ }
+ $dateValueNew += $timeValue;
+ }
+
+ return $dateValueNew;
+ }
+
+ /**
+ * Converts a month name (either a long or a short name) to a month number.
+ *
+ * @param string $month Month name or abbreviation
+ *
+ * @return int|string Month number (1 - 12), or the original string argument if it isn't a valid month name
+ */
+ public static function monthStringToNumber($month)
+ {
+ $monthIndex = 1;
+ foreach (self::$monthNames as $shortMonthName => $longMonthName) {
+ if (($month === $longMonthName) || ($month === $shortMonthName)) {
+ return $monthIndex;
+ }
+ ++$monthIndex;
+ }
+
+ return $month;
+ }
+
+ /**
+ * Strips an ordinal from a numeric value.
+ *
+ * @param string $day Day number with an ordinal
+ *
+ * @return int|string The integer value with any ordinal stripped, or the original string argument if it isn't a valid numeric
+ */
+ public static function dayStringToNumber($day)
+ {
+ $strippedDayValue = (str_replace(self::$numberSuffixes, '', $day));
+ if (is_numeric($strippedDayValue)) {
+ return (int) $strippedDayValue;
+ }
+
+ return $day;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Drawing.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Drawing.php
new file mode 100644
index 00000000000..25d6910d34e
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Drawing.php
@@ -0,0 +1,249 @@
+getName();
+ $size = $pDefaultFont->getSize();
+
+ if (isset(Font::$defaultColumnWidths[$name][$size])) {
+ // Exact width can be determined
+ $colWidth = $pValue * Font::$defaultColumnWidths[$name][$size]['width'] / Font::$defaultColumnWidths[$name][$size]['px'];
+ } else {
+ // We don't have data for this particular font and size, use approximation by
+ // extrapolating from Calibri 11
+ $colWidth = $pValue * 11 * Font::$defaultColumnWidths['Calibri'][11]['width'] / Font::$defaultColumnWidths['Calibri'][11]['px'] / $size;
+ }
+
+ return $colWidth;
+ }
+
+ /**
+ * Convert column width from (intrinsic) Excel units to pixels.
+ *
+ * @param float $pValue Value in cell dimension
+ * @param \PhpOffice\PhpSpreadsheet\Style\Font $pDefaultFont Default font of the workbook
+ *
+ * @return int Value in pixels
+ */
+ public static function cellDimensionToPixels($pValue, \PhpOffice\PhpSpreadsheet\Style\Font $pDefaultFont)
+ {
+ // Font name and size
+ $name = $pDefaultFont->getName();
+ $size = $pDefaultFont->getSize();
+
+ if (isset(Font::$defaultColumnWidths[$name][$size])) {
+ // Exact width can be determined
+ $colWidth = $pValue * Font::$defaultColumnWidths[$name][$size]['px'] / Font::$defaultColumnWidths[$name][$size]['width'];
+ } else {
+ // We don't have data for this particular font and size, use approximation by
+ // extrapolating from Calibri 11
+ $colWidth = $pValue * $size * Font::$defaultColumnWidths['Calibri'][11]['px'] / Font::$defaultColumnWidths['Calibri'][11]['width'] / 11;
+ }
+
+ // Round pixels to closest integer
+ $colWidth = (int) round($colWidth);
+
+ return $colWidth;
+ }
+
+ /**
+ * Convert pixels to points.
+ *
+ * @param int $pValue Value in pixels
+ *
+ * @return float Value in points
+ */
+ public static function pixelsToPoints($pValue)
+ {
+ return $pValue * 0.67777777;
+ }
+
+ /**
+ * Convert points to pixels.
+ *
+ * @param int $pValue Value in points
+ *
+ * @return int Value in pixels
+ */
+ public static function pointsToPixels($pValue)
+ {
+ if ($pValue != 0) {
+ return (int) ceil($pValue * 1.333333333);
+ }
+
+ return 0;
+ }
+
+ /**
+ * Convert degrees to angle.
+ *
+ * @param int $pValue Degrees
+ *
+ * @return int Angle
+ */
+ public static function degreesToAngle($pValue)
+ {
+ return (int) round($pValue * 60000);
+ }
+
+ /**
+ * Convert angle to degrees.
+ *
+ * @param int $pValue Angle
+ *
+ * @return int Degrees
+ */
+ public static function angleToDegrees($pValue)
+ {
+ if ($pValue != 0) {
+ return round($pValue / 60000);
+ }
+
+ return 0;
+ }
+
+ /**
+ * Create a new image from file. By alexander at alexauto dot nl.
+ *
+ * @see http://www.php.net/manual/en/function.imagecreatefromwbmp.php#86214
+ *
+ * @param string $p_sFile Path to Windows DIB (BMP) image
+ *
+ * @return resource
+ */
+ public static function imagecreatefrombmp($p_sFile)
+ {
+ // Load the image into a string
+ $file = fopen($p_sFile, 'rb');
+ $read = fread($file, 10);
+ while (!feof($file) && ($read != '')) {
+ $read .= fread($file, 1024);
+ }
+
+ $temp = unpack('H*', $read);
+ $hex = $temp[1];
+ $header = substr($hex, 0, 108);
+
+ // Process the header
+ // Structure: http://www.fastgraph.com/help/bmp_header_format.html
+ if (substr($header, 0, 4) == '424d') {
+ // Cut it in parts of 2 bytes
+ $header_parts = str_split($header, 2);
+
+ // Get the width 4 bytes
+ $width = hexdec($header_parts[19] . $header_parts[18]);
+
+ // Get the height 4 bytes
+ $height = hexdec($header_parts[23] . $header_parts[22]);
+
+ // Unset the header params
+ unset($header_parts);
+ }
+
+ // Define starting X and Y
+ $x = 0;
+ $y = 1;
+
+ // Create newimage
+ $image = imagecreatetruecolor($width, $height);
+
+ // Grab the body from the image
+ $body = substr($hex, 108);
+
+ // Calculate if padding at the end-line is needed
+ // Divided by two to keep overview.
+ // 1 byte = 2 HEX-chars
+ $body_size = (strlen($body) / 2);
+ $header_size = ($width * $height);
+
+ // Use end-line padding? Only when needed
+ $usePadding = ($body_size > ($header_size * 3) + 4);
+
+ // Using a for-loop with index-calculation instaid of str_split to avoid large memory consumption
+ // Calculate the next DWORD-position in the body
+ for ($i = 0; $i < $body_size; $i += 3) {
+ // Calculate line-ending and padding
+ if ($x >= $width) {
+ // If padding needed, ignore image-padding
+ // Shift i to the ending of the current 32-bit-block
+ if ($usePadding) {
+ $i += $width % 4;
+ }
+
+ // Reset horizontal position
+ $x = 0;
+
+ // Raise the height-position (bottom-up)
+ ++$y;
+
+ // Reached the image-height? Break the for-loop
+ if ($y > $height) {
+ break;
+ }
+ }
+
+ // Calculation of the RGB-pixel (defined as BGR in image-data)
+ // Define $i_pos as absolute position in the body
+ $i_pos = $i * 2;
+ $r = hexdec($body[$i_pos + 4] . $body[$i_pos + 5]);
+ $g = hexdec($body[$i_pos + 2] . $body[$i_pos + 3]);
+ $b = hexdec($body[$i_pos] . $body[$i_pos + 1]);
+
+ // Calculate and draw the pixel
+ $color = imagecolorallocate($image, $r, $g, $b);
+ imagesetpixel($image, $x, $height - $y, $color);
+
+ // Raise the horizontal position
+ ++$x;
+ }
+
+ // Unset the body / free the memory
+ unset($body);
+
+ // Return image-object
+ return $image;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher.php
new file mode 100644
index 00000000000..c6d0a6f8118
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher.php
@@ -0,0 +1,64 @@
+dggContainer;
+ }
+
+ /**
+ * Set Drawing Group Container.
+ *
+ * @param Escher\DggContainer $dggContainer
+ *
+ * @return Escher\DggContainer
+ */
+ public function setDggContainer($dggContainer)
+ {
+ return $this->dggContainer = $dggContainer;
+ }
+
+ /**
+ * Get Drawing Container.
+ *
+ * @return Escher\DgContainer
+ */
+ public function getDgContainer()
+ {
+ return $this->dgContainer;
+ }
+
+ /**
+ * Set Drawing Container.
+ *
+ * @param Escher\DgContainer $dgContainer
+ *
+ * @return Escher\DgContainer
+ */
+ public function setDgContainer($dgContainer)
+ {
+ return $this->dgContainer = $dgContainer;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer.php
new file mode 100644
index 00000000000..e9d387daa4b
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer.php
@@ -0,0 +1,52 @@
+dgId;
+ }
+
+ public function setDgId($value)
+ {
+ $this->dgId = $value;
+ }
+
+ public function getLastSpId()
+ {
+ return $this->lastSpId;
+ }
+
+ public function setLastSpId($value)
+ {
+ $this->lastSpId = $value;
+ }
+
+ public function getSpgrContainer()
+ {
+ return $this->spgrContainer;
+ }
+
+ public function setSpgrContainer($spgrContainer)
+ {
+ return $this->spgrContainer = $spgrContainer;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php
new file mode 100644
index 00000000000..7e2c34608a2
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer.php
@@ -0,0 +1,79 @@
+parent = $parent;
+ }
+
+ /**
+ * Get the parent Shape Group Container if any.
+ *
+ * @return null|\PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer\SpgrContainer
+ */
+ public function getParent()
+ {
+ return $this->parent;
+ }
+
+ /**
+ * Add a child. This will be either spgrContainer or spContainer.
+ *
+ * @param mixed $child
+ */
+ public function addChild($child)
+ {
+ $this->children[] = $child;
+ $child->setParent($this);
+ }
+
+ /**
+ * Get collection of Shape Containers.
+ */
+ public function getChildren()
+ {
+ return $this->children;
+ }
+
+ /**
+ * Recursively get all spContainers within this spgrContainer.
+ *
+ * @return SpgrContainer\SpContainer[]
+ */
+ public function getAllSpContainers()
+ {
+ $allSpContainers = [];
+
+ foreach ($this->children as $child) {
+ if ($child instanceof self) {
+ $allSpContainers = array_merge($allSpContainers, $child->getAllSpContainers());
+ } else {
+ $allSpContainers[] = $child;
+ }
+ }
+
+ return $allSpContainers;
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php
similarity index 62%
rename from lib/phpexcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php
index a1f1a46097c..bbf51df186e 100644
--- a/lib/phpexcel/PHPExcel/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DgContainer/SpgrContainer/SpContainer.php
@@ -1,120 +1,99 @@
spgr = $value;
}
/**
- * Get whether this is a group shape
+ * Get whether this is a group shape.
*
- * @return boolean
+ * @return bool
*/
public function getSpgr()
{
@@ -152,7 +131,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
}
/**
- * Set the shape type
+ * Set the shape type.
*
* @param int $value
*/
@@ -162,7 +141,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
}
/**
- * Get the shape type
+ * Get the shape type.
*
* @return int
*/
@@ -172,7 +151,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
}
/**
- * Set the shape flag
+ * Set the shape flag.
*
* @param int $value
*/
@@ -182,7 +161,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
}
/**
- * Get the shape flag
+ * Get the shape flag.
*
* @return int
*/
@@ -192,7 +171,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
}
/**
- * Set the shape index
+ * Set the shape index.
*
* @param int $value
*/
@@ -202,7 +181,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
}
/**
- * Get the shape index
+ * Get the shape index.
*
* @return int
*/
@@ -212,7 +191,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
}
/**
- * Set an option for the Shape Group Container
+ * Set an option for the Shape Group Container.
*
* @param int $property The number specifies the option
* @param mixed $value
@@ -223,9 +202,10 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
}
/**
- * Get an option for the Shape Group Container
+ * Get an option for the Shape Group Container.
*
* @param int $property The number specifies the option
+ *
* @return mixed
*/
public function getOPT($property)
@@ -233,11 +213,12 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
if (isset($this->OPT[$property])) {
return $this->OPT[$property];
}
+
return null;
}
/**
- * Get the collection of options
+ * Get the collection of options.
*
* @return array
*/
@@ -247,17 +228,17 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
}
/**
- * Set cell coordinates of upper-left corner of shape
+ * Set cell coordinates of upper-left corner of shape.
*
- * @param string $value
+ * @param string $value eg: 'A1'
*/
- public function setStartCoordinates($value = 'A1')
+ public function setStartCoordinates($value)
{
$this->startCoordinates = $value;
}
/**
- * Get cell coordinates of upper-left corner of shape
+ * Get cell coordinates of upper-left corner of shape.
*
* @return string
*/
@@ -267,17 +248,17 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
}
/**
- * Set offset in x-direction of upper-left corner of shape measured in 1/1024 of column width
+ * Set offset in x-direction of upper-left corner of shape measured in 1/1024 of column width.
*
* @param int $startOffsetX
*/
- public function setStartOffsetX($startOffsetX = 0)
+ public function setStartOffsetX($startOffsetX)
{
$this->startOffsetX = $startOffsetX;
}
/**
- * Get offset in x-direction of upper-left corner of shape measured in 1/1024 of column width
+ * Get offset in x-direction of upper-left corner of shape measured in 1/1024 of column width.
*
* @return int
*/
@@ -287,17 +268,17 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
}
/**
- * Set offset in y-direction of upper-left corner of shape measured in 1/256 of row height
+ * Set offset in y-direction of upper-left corner of shape measured in 1/256 of row height.
*
* @param int $startOffsetY
*/
- public function setStartOffsetY($startOffsetY = 0)
+ public function setStartOffsetY($startOffsetY)
{
$this->startOffsetY = $startOffsetY;
}
/**
- * Get offset in y-direction of upper-left corner of shape measured in 1/256 of row height
+ * Get offset in y-direction of upper-left corner of shape measured in 1/256 of row height.
*
* @return int
*/
@@ -307,17 +288,17 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
}
/**
- * Set cell coordinates of bottom-right corner of shape
+ * Set cell coordinates of bottom-right corner of shape.
*
- * @param string $value
+ * @param string $value eg: 'A1'
*/
- public function setEndCoordinates($value = 'A1')
+ public function setEndCoordinates($value)
{
$this->endCoordinates = $value;
}
/**
- * Get cell coordinates of bottom-right corner of shape
+ * Get cell coordinates of bottom-right corner of shape.
*
* @return string
*/
@@ -327,17 +308,17 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
}
/**
- * Set offset in x-direction of bottom-right corner of shape measured in 1/1024 of column width
+ * Set offset in x-direction of bottom-right corner of shape measured in 1/1024 of column width.
*
- * @param int $startOffsetX
+ * @param int $endOffsetX
*/
- public function setEndOffsetX($endOffsetX = 0)
+ public function setEndOffsetX($endOffsetX)
{
$this->endOffsetX = $endOffsetX;
}
/**
- * Get offset in x-direction of bottom-right corner of shape measured in 1/1024 of column width
+ * Get offset in x-direction of bottom-right corner of shape measured in 1/1024 of column width.
*
* @return int
*/
@@ -347,17 +328,17 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
}
/**
- * Set offset in y-direction of bottom-right corner of shape measured in 1/256 of row height
+ * Set offset in y-direction of bottom-right corner of shape measured in 1/256 of row height.
*
* @param int $endOffsetY
*/
- public function setEndOffsetY($endOffsetY = 0)
+ public function setEndOffsetY($endOffsetY)
{
$this->endOffsetY = $endOffsetY;
}
/**
- * Get offset in y-direction of bottom-right corner of shape measured in 1/256 of row height
+ * Get offset in y-direction of bottom-right corner of shape measured in 1/256 of row height.
*
* @return int
*/
@@ -369,7 +350,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
/**
* Get the nesting level of this spContainer. This is the number of spgrContainers between this spContainer and
* the dgContainer. A value of 1 = immediately within first spgrContainer
- * Higher nesting level occurs if and only if spContainer is part of a shape group
+ * Higher nesting level occurs if and only if spContainer is part of a shape group.
*
* @return int Nesting level
*/
@@ -378,7 +359,7 @@ class PHPExcel_Shared_Escher_DgContainer_SpgrContainer_SpContainer
$nestingLevel = 0;
$parent = $this->getParent();
- while ($parent instanceof PHPExcel_Shared_Escher_DgContainer_SpgrContainer) {
+ while ($parent instanceof SpgrContainer) {
++$nestingLevel;
$parent = $parent->getParent();
}
diff --git a/lib/phpexcel/PHPExcel/Shared/Escher/DggContainer.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer.php
similarity index 54%
rename from lib/phpexcel/PHPExcel/Shared/Escher/DggContainer.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer.php
index b116b1bd456..96da32131e3 100644
--- a/lib/phpexcel/PHPExcel/Shared/Escher/DggContainer.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer.php
@@ -1,76 +1,53 @@
OPT[$property])) {
return $this->OPT[$property];
}
+
return null;
}
/**
- * Get identifier clusters
+ * Get identifier clusters.
*
* @return array
*/
@@ -185,7 +164,7 @@ class PHPExcel_Shared_Escher_DggContainer
}
/**
- * Set identifier clusters. array( => , ...)
+ * Set identifier clusters. [ => , ...].
*
* @param array $pValue
*/
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer.php
new file mode 100644
index 00000000000..9d1e68ec771
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer.php
@@ -0,0 +1,34 @@
+BSECollection[] = $BSE;
+ $BSE->setParent($this);
+ }
+
+ /**
+ * Get the collection of BLIP Store Entries.
+ *
+ * @return BstoreContainer\BSE[]
+ */
+ public function getBSECollection()
+ {
+ return $this->BSECollection;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php
new file mode 100644
index 00000000000..f83bdc7ee3f
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE.php
@@ -0,0 +1,89 @@
+parent = $parent;
+ }
+
+ /**
+ * Get the BLIP.
+ *
+ * @return BSE\Blip
+ */
+ public function getBlip()
+ {
+ return $this->blip;
+ }
+
+ /**
+ * Set the BLIP.
+ *
+ * @param BSE\Blip $blip
+ */
+ public function setBlip($blip)
+ {
+ $this->blip = $blip;
+ $blip->setParent($this);
+ }
+
+ /**
+ * Get the BLIP type.
+ *
+ * @return int
+ */
+ public function getBlipType()
+ {
+ return $this->blipType;
+ }
+
+ /**
+ * Set the BLIP type.
+ *
+ * @param int $blipType
+ */
+ public function setBlipType($blipType)
+ {
+ $this->blipType = $blipType;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php
new file mode 100644
index 00000000000..88bc117a166
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Escher/DggContainer/BstoreContainer/BSE/Blip.php
@@ -0,0 +1,60 @@
+data;
+ }
+
+ /**
+ * Set the raw image data.
+ *
+ * @param string $data
+ */
+ public function setData($data)
+ {
+ $this->data = $data;
+ }
+
+ /**
+ * Set parent BSE.
+ *
+ * @param \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE $parent
+ */
+ public function setParent($parent)
+ {
+ $this->parent = $parent;
+ }
+
+ /**
+ * Get parent BSE.
+ *
+ * @return \PhpOffice\PhpSpreadsheet\Shared\Escher\DggContainer\BstoreContainer\BSE $parent
+ */
+ public function getParent()
+ {
+ return $this->parent;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/File.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/File.php
new file mode 100644
index 00000000000..3532908bd55
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/File.php
@@ -0,0 +1,150 @@
+open($zipFile) === true) {
+ $returnValue = ($zip->getFromName($archiveFile) !== false);
+ $zip->close();
+
+ return $returnValue;
+ }
+
+ return false;
+ }
+
+ return file_exists($pFilename);
+ }
+
+ /**
+ * Returns canonicalized absolute pathname, also for ZIP archives.
+ *
+ * @param string $pFilename
+ *
+ * @return string
+ */
+ public static function realpath($pFilename)
+ {
+ // Returnvalue
+ $returnValue = '';
+
+ // Try using realpath()
+ if (file_exists($pFilename)) {
+ $returnValue = realpath($pFilename);
+ }
+
+ // Found something?
+ if ($returnValue == '' || ($returnValue === null)) {
+ $pathArray = explode('/', $pFilename);
+ while (in_array('..', $pathArray) && $pathArray[0] != '..') {
+ $iMax = count($pathArray);
+ for ($i = 0; $i < $iMax; ++$i) {
+ if ($pathArray[$i] == '..' && $i > 0) {
+ unset($pathArray[$i], $pathArray[$i - 1]);
+
+ break;
+ }
+ }
+ }
+ $returnValue = implode('/', $pathArray);
+ }
+
+ // Return
+ return $returnValue;
+ }
+
+ /**
+ * Get the systems temporary directory.
+ *
+ * @return string
+ */
+ public static function sysGetTempDir()
+ {
+ // Moodle hack!
+ if (function_exists('make_temp_directory')) {
+ $temp = make_temp_directory('phpspreadsheet');
+ return realpath(dirname($temp));
+ }
+
+ if (self::$useUploadTempDirectory) {
+ // use upload-directory when defined to allow running on environments having very restricted
+ // open_basedir configs
+ if (ini_get('upload_tmp_dir') !== false) {
+ if ($temp = ini_get('upload_tmp_dir')) {
+ if (file_exists($temp)) {
+ return realpath($temp);
+ }
+ }
+ }
+ }
+
+ return realpath(sys_get_temp_dir());
+ }
+
+ /**
+ * Assert that given path is an existing file and is readable, otherwise throw exception.
+ *
+ * @param string $filename
+ *
+ * @throws InvalidArgumentException
+ */
+ public static function assertFile($filename)
+ {
+ if (!is_file($filename)) {
+ throw new InvalidArgumentException('File "' . $filename . '" does not exist.');
+ }
+
+ if (!is_readable($filename)) {
+ throw new InvalidArgumentException('Could not open "' . $filename . '" for reading.');
+ }
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Shared/Font.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Font.php
similarity index 61%
rename from lib/phpexcel/PHPExcel/Shared/Font.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Font.php
index 7efb3c96ba8..8abcef2e192 100644
--- a/lib/phpexcel/PHPExcel/Shared/Font.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Font.php
@@ -1,141 +1,113 @@
array(
- 1 => array('px' => 24, 'width' => 12.00000000),
- 2 => array('px' => 24, 'width' => 12.00000000),
- 3 => array('px' => 32, 'width' => 10.66406250),
- 4 => array('px' => 32, 'width' => 10.66406250),
- 5 => array('px' => 40, 'width' => 10.00000000),
- 6 => array('px' => 48, 'width' => 9.59765625),
- 7 => array('px' => 48, 'width' => 9.59765625),
- 8 => array('px' => 56, 'width' => 9.33203125),
- 9 => array('px' => 64, 'width' => 9.14062500),
- 10 => array('px' => 64, 'width' => 9.14062500),
- ),
- 'Calibri' => array(
- 1 => array('px' => 24, 'width' => 12.00000000),
- 2 => array('px' => 24, 'width' => 12.00000000),
- 3 => array('px' => 32, 'width' => 10.66406250),
- 4 => array('px' => 32, 'width' => 10.66406250),
- 5 => array('px' => 40, 'width' => 10.00000000),
- 6 => array('px' => 48, 'width' => 9.59765625),
- 7 => array('px' => 48, 'width' => 9.59765625),
- 8 => array('px' => 56, 'width' => 9.33203125),
- 9 => array('px' => 56, 'width' => 9.33203125),
- 10 => array('px' => 64, 'width' => 9.14062500),
- 11 => array('px' => 64, 'width' => 9.14062500),
- ),
- 'Verdana' => array(
- 1 => array('px' => 24, 'width' => 12.00000000),
- 2 => array('px' => 24, 'width' => 12.00000000),
- 3 => array('px' => 32, 'width' => 10.66406250),
- 4 => array('px' => 32, 'width' => 10.66406250),
- 5 => array('px' => 40, 'width' => 10.00000000),
- 6 => array('px' => 48, 'width' => 9.59765625),
- 7 => array('px' => 48, 'width' => 9.59765625),
- 8 => array('px' => 64, 'width' => 9.14062500),
- 9 => array('px' => 72, 'width' => 9.00000000),
- 10 => array('px' => 72, 'width' => 9.00000000),
- ),
- );
+ public static $defaultColumnWidths = [
+ 'Arial' => [
+ 1 => ['px' => 24, 'width' => 12.00000000],
+ 2 => ['px' => 24, 'width' => 12.00000000],
+ 3 => ['px' => 32, 'width' => 10.66406250],
+ 4 => ['px' => 32, 'width' => 10.66406250],
+ 5 => ['px' => 40, 'width' => 10.00000000],
+ 6 => ['px' => 48, 'width' => 9.59765625],
+ 7 => ['px' => 48, 'width' => 9.59765625],
+ 8 => ['px' => 56, 'width' => 9.33203125],
+ 9 => ['px' => 64, 'width' => 9.14062500],
+ 10 => ['px' => 64, 'width' => 9.14062500],
+ ],
+ 'Calibri' => [
+ 1 => ['px' => 24, 'width' => 12.00000000],
+ 2 => ['px' => 24, 'width' => 12.00000000],
+ 3 => ['px' => 32, 'width' => 10.66406250],
+ 4 => ['px' => 32, 'width' => 10.66406250],
+ 5 => ['px' => 40, 'width' => 10.00000000],
+ 6 => ['px' => 48, 'width' => 9.59765625],
+ 7 => ['px' => 48, 'width' => 9.59765625],
+ 8 => ['px' => 56, 'width' => 9.33203125],
+ 9 => ['px' => 56, 'width' => 9.33203125],
+ 10 => ['px' => 64, 'width' => 9.14062500],
+ 11 => ['px' => 64, 'width' => 9.14062500],
+ ],
+ 'Verdana' => [
+ 1 => ['px' => 24, 'width' => 12.00000000],
+ 2 => ['px' => 24, 'width' => 12.00000000],
+ 3 => ['px' => 32, 'width' => 10.66406250],
+ 4 => ['px' => 32, 'width' => 10.66406250],
+ 5 => ['px' => 40, 'width' => 10.00000000],
+ 6 => ['px' => 48, 'width' => 9.59765625],
+ 7 => ['px' => 48, 'width' => 9.59765625],
+ 8 => ['px' => 64, 'width' => 9.14062500],
+ 9 => ['px' => 72, 'width' => 9.00000000],
+ 10 => ['px' => 72, 'width' => 9.00000000],
+ ],
+ ];
/**
- * Set autoSize method
+ * Set autoSize method.
*
- * @param string $pValue
- * @return boolean Success or failure
+ * @param string $pValue see self::AUTOSIZE_METHOD_*
+ *
+ * @return bool Success or failure
*/
- public static function setAutoSizeMethod($pValue = self::AUTOSIZE_METHOD_APPROX)
+ public static function setAutoSizeMethod($pValue)
{
if (!in_array($pValue, self::$autoSizeMethods)) {
return false;
@@ -205,7 +178,7 @@ class PHPExcel_Shared_Font
}
/**
- * Get autoSize method
+ * Get autoSize method.
*
* @return string
*/
@@ -221,11 +194,11 @@ class PHPExcel_Shared_Font
* C:/Windows/Fonts/
* /usr/share/fonts/truetype/
* ~/.fonts/
- *
+ * .
*
* @param string $pValue
*/
- public static function setTrueTypeFontPath($pValue = '')
+ public static function setTrueTypeFontPath($pValue)
{
self::$trueTypeFontPath = $pValue;
}
@@ -241,28 +214,30 @@ class PHPExcel_Shared_Font
}
/**
- * Calculate an (approximate) OpenXML column width, based on font size and text contained
+ * Calculate an (approximate) OpenXML column width, based on font size and text contained.
*
- * @param PHPExcel_Style_Font $font Font object
- * @param PHPExcel_RichText|string $cellText Text to calculate width
- * @param integer $rotation Rotation angle
- * @param PHPExcel_Style_Font|NULL $defaultFont Font object
- * @return integer Column width
+ * @param \PhpOffice\PhpSpreadsheet\Style\Font $font Font object
+ * @param RichText|string $cellText Text to calculate width
+ * @param int $rotation Rotation angle
+ * @param null|\PhpOffice\PhpSpreadsheet\Style\Font $defaultFont Font object
+ *
+ * @return int Column width
*/
- public static function calculateColumnWidth(PHPExcel_Style_Font $font, $cellText = '', $rotation = 0, PHPExcel_Style_Font $defaultFont = null)
+ public static function calculateColumnWidth(\PhpOffice\PhpSpreadsheet\Style\Font $font, $cellText = '', $rotation = 0, \PhpOffice\PhpSpreadsheet\Style\Font $defaultFont = null)
{
// If it is rich text, use plain text
- if ($cellText instanceof PHPExcel_RichText) {
+ if ($cellText instanceof RichText) {
$cellText = $cellText->getPlainText();
}
// Special case if there are one or more newline characters ("\n")
if (strpos($cellText, "\n") !== false) {
$lineTexts = explode("\n", $cellText);
- $lineWidths = array();
+ $lineWidths = [];
foreach ($lineTexts as $lineText) {
$lineWidths[] = self::calculateColumnWidth($font, $lineText, $rotation = 0, $defaultFont);
}
+
return max($lineWidths); // width of longest line in cell
}
@@ -270,11 +245,12 @@ class PHPExcel_Shared_Font
$approximate = self::$autoSizeMethod == self::AUTOSIZE_METHOD_APPROX;
if (!$approximate) {
$columnWidthAdjust = ceil(self::getTextWidthPixelsExact('n', $font, 0) * 1.07);
+
try {
// Width of text in pixels excl. padding
// and addition because Excel adds some padding, just use approx width of 'n' glyph
$columnWidth = self::getTextWidthPixelsExact($cellText, $font, $rotation) + $columnWidthAdjust;
- } catch (PHPExcel_Exception $e) {
+ } catch (PhpSpreadsheetException $e) {
$approximate = true;
}
}
@@ -287,25 +263,27 @@ class PHPExcel_Shared_Font
}
// Convert from pixel width to column width
- $columnWidth = PHPExcel_Shared_Drawing::pixelsToCellDimension($columnWidth, $defaultFont);
+ $columnWidth = Drawing::pixelsToCellDimension($columnWidth, $defaultFont);
// Return
return round($columnWidth, 6);
}
/**
- * Get GD text width in pixels for a string of text in a certain font at a certain rotation angle
+ * Get GD text width in pixels for a string of text in a certain font at a certain rotation angle.
*
* @param string $text
- * @param PHPExcel_Style_Font
+ * @param \PhpOffice\PhpSpreadsheet\Style\Font
* @param int $rotation
+ *
+ * @throws PhpSpreadsheetException
+ *
* @return int
- * @throws PHPExcel_Exception
*/
- public static function getTextWidthPixelsExact($text, PHPExcel_Style_Font $font, $rotation = 0)
+ public static function getTextWidthPixelsExact($text, \PhpOffice\PhpSpreadsheet\Style\Font $font, $rotation = 0)
{
if (!function_exists('imagettfbbox')) {
- throw new PHPExcel_Exception('GD library needs to be enabled');
+ throw new PhpSpreadsheetException('GD library needs to be enabled');
}
// font size should really be supplied in pixels in GD2,
@@ -314,14 +292,10 @@ class PHPExcel_Shared_Font
$textBox = imagettfbbox($font->getSize(), $rotation, $fontFile, $text);
// Get corners positions
- $lowerLeftCornerX = $textBox[0];
-// $lowerLeftCornerY = $textBox[1];
+ $lowerLeftCornerX = $textBox[0];
$lowerRightCornerX = $textBox[2];
-// $lowerRightCornerY = $textBox[3];
$upperRightCornerX = $textBox[4];
-// $upperRightCornerY = $textBox[5];
- $upperLeftCornerX = $textBox[6];
-// $upperLeftCornerY = $textBox[7];
+ $upperLeftCornerX = $textBox[6];
// Consider the rotation when calculating the width
$textWidth = max($lowerRightCornerX - $upperLeftCornerX, $upperRightCornerX - $lowerLeftCornerX);
@@ -330,14 +304,15 @@ class PHPExcel_Shared_Font
}
/**
- * Get approximate width in pixels for a string of text in a certain font at a certain rotation angle
+ * Get approximate width in pixels for a string of text in a certain font at a certain rotation angle.
*
* @param string $columnText
- * @param PHPExcel_Style_Font $font
+ * @param \PhpOffice\PhpSpreadsheet\Style\Font $font
* @param int $rotation
+ *
* @return int Text width in pixels (no padding added)
*/
- public static function getTextWidthPixelsApprox($columnText, PHPExcel_Style_Font $font = null, $rotation = 0)
+ public static function getTextWidthPixelsApprox($columnText, \PhpOffice\PhpSpreadsheet\Style\Font $font, $rotation = 0)
{
$fontName = $font->getName();
$fontSize = $font->getSize();
@@ -346,27 +321,22 @@ class PHPExcel_Shared_Font
switch ($fontName) {
case 'Calibri':
// value 8.26 was found via interpolation by inspecting real Excel files with Calibri 11 font.
- $columnWidth = (int) (8.26 * PHPExcel_Shared_String::CountCharacters($columnText));
+ $columnWidth = (int) (8.26 * StringHelper::countCharacters($columnText));
$columnWidth = $columnWidth * $fontSize / 11; // extrapolate from font size
break;
-
case 'Arial':
- // value 7 was found via interpolation by inspecting real Excel files with Arial 10 font.
-// $columnWidth = (int) (7 * PHPExcel_Shared_String::CountCharacters($columnText));
// value 8 was set because of experience in different exports at Arial 10 font.
- $columnWidth = (int) (8 * PHPExcel_Shared_String::CountCharacters($columnText));
+ $columnWidth = (int) (8 * StringHelper::countCharacters($columnText));
$columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size
break;
-
case 'Verdana':
// value 8 was found via interpolation by inspecting real Excel files with Verdana 10 font.
- $columnWidth = (int) (8 * PHPExcel_Shared_String::CountCharacters($columnText));
+ $columnWidth = (int) (8 * StringHelper::countCharacters($columnText));
$columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size
break;
-
default:
// just assume Calibri
- $columnWidth = (int) (8.26 * PHPExcel_Shared_String::CountCharacters($columnText));
+ $columnWidth = (int) (8.26 * StringHelper::countCharacters($columnText));
$columnWidth = $columnWidth * $fontSize / 11; // extrapolate from font size
break;
}
@@ -388,53 +358,57 @@ class PHPExcel_Shared_Font
}
/**
- * Calculate an (approximate) pixel size, based on a font points size
+ * Calculate an (approximate) pixel size, based on a font points size.
*
- * @param int $fontSizeInPoints Font size (in points)
- * @return int Font size (in pixels)
+ * @param int $fontSizeInPoints Font size (in points)
+ *
+ * @return int Font size (in pixels)
*/
- public static function fontSizeToPixels($fontSizeInPoints = 11)
+ public static function fontSizeToPixels($fontSizeInPoints)
{
return (int) ((4 / 3) * $fontSizeInPoints);
}
/**
- * Calculate an (approximate) pixel size, based on inch size
+ * Calculate an (approximate) pixel size, based on inch size.
*
- * @param int $sizeInInch Font size (in inch)
- * @return int Size (in pixels)
+ * @param int $sizeInInch Font size (in inch)
+ *
+ * @return int Size (in pixels)
*/
- public static function inchSizeToPixels($sizeInInch = 1)
+ public static function inchSizeToPixels($sizeInInch)
{
- return ($sizeInInch * 96);
+ return $sizeInInch * 96;
}
/**
- * Calculate an (approximate) pixel size, based on centimeter size
+ * Calculate an (approximate) pixel size, based on centimeter size.
*
- * @param int $sizeInCm Font size (in centimeters)
- * @return int Size (in pixels)
+ * @param int $sizeInCm Font size (in centimeters)
+ *
+ * @return float Size (in pixels)
*/
- public static function centimeterSizeToPixels($sizeInCm = 1)
+ public static function centimeterSizeToPixels($sizeInCm)
{
- return ($sizeInCm * 37.795275591);
+ return $sizeInCm * 37.795275591;
}
/**
- * Returns the font path given the font
+ * Returns the font path given the font.
+ *
+ * @param \PhpOffice\PhpSpreadsheet\Style\Font $font
*
- * @param PHPExcel_Style_Font
* @return string Path to TrueType font file
*/
public static function getTrueTypeFontFileFromFont($font)
{
if (!file_exists(self::$trueTypeFontPath) || !is_dir(self::$trueTypeFontPath)) {
- throw new PHPExcel_Exception('Valid directory to TrueType Font files not specified');
+ throw new PhpSpreadsheetException('Valid directory to TrueType Font files not specified');
}
- $name = $font->getName();
- $bold = $font->getBold();
- $italic = $font->getItalic();
+ $name = $font->getName();
+ $bold = $font->getBold();
+ $italic = $font->getItalic();
// Check if we can map font to true type font file
switch ($name) {
@@ -443,82 +417,99 @@ class PHPExcel_Shared_Font
$bold ? ($italic ? self::ARIAL_BOLD_ITALIC : self::ARIAL_BOLD)
: ($italic ? self::ARIAL_ITALIC : self::ARIAL)
);
+
break;
case 'Calibri':
$fontFile = (
$bold ? ($italic ? self::CALIBRI_BOLD_ITALIC : self::CALIBRI_BOLD)
: ($italic ? self::CALIBRI_ITALIC : self::CALIBRI)
);
+
break;
case 'Courier New':
$fontFile = (
$bold ? ($italic ? self::COURIER_NEW_BOLD_ITALIC : self::COURIER_NEW_BOLD)
: ($italic ? self::COURIER_NEW_ITALIC : self::COURIER_NEW)
);
+
break;
case 'Comic Sans MS':
$fontFile = (
$bold ? self::COMIC_SANS_MS_BOLD : self::COMIC_SANS_MS
);
+
break;
case 'Georgia':
$fontFile = (
$bold ? ($italic ? self::GEORGIA_BOLD_ITALIC : self::GEORGIA_BOLD)
: ($italic ? self::GEORGIA_ITALIC : self::GEORGIA)
);
+
break;
case 'Impact':
$fontFile = self::IMPACT;
+
break;
case 'Liberation Sans':
$fontFile = (
$bold ? ($italic ? self::LIBERATION_SANS_BOLD_ITALIC : self::LIBERATION_SANS_BOLD)
: ($italic ? self::LIBERATION_SANS_ITALIC : self::LIBERATION_SANS)
);
+
break;
case 'Lucida Console':
$fontFile = self::LUCIDA_CONSOLE;
+
break;
case 'Lucida Sans Unicode':
$fontFile = self::LUCIDA_SANS_UNICODE;
+
break;
case 'Microsoft Sans Serif':
$fontFile = self::MICROSOFT_SANS_SERIF;
+
break;
case 'Palatino Linotype':
$fontFile = (
$bold ? ($italic ? self::PALATINO_LINOTYPE_BOLD_ITALIC : self::PALATINO_LINOTYPE_BOLD)
: ($italic ? self::PALATINO_LINOTYPE_ITALIC : self::PALATINO_LINOTYPE)
);
+
break;
case 'Symbol':
$fontFile = self::SYMBOL;
+
break;
case 'Tahoma':
$fontFile = (
$bold ? self::TAHOMA_BOLD : self::TAHOMA
);
+
break;
case 'Times New Roman':
$fontFile = (
$bold ? ($italic ? self::TIMES_NEW_ROMAN_BOLD_ITALIC : self::TIMES_NEW_ROMAN_BOLD)
: ($italic ? self::TIMES_NEW_ROMAN_ITALIC : self::TIMES_NEW_ROMAN)
);
+
break;
case 'Trebuchet MS':
$fontFile = (
$bold ? ($italic ? self::TREBUCHET_MS_BOLD_ITALIC : self::TREBUCHET_MS_BOLD)
: ($italic ? self::TREBUCHET_MS_ITALIC : self::TREBUCHET_MS)
);
+
break;
case 'Verdana':
$fontFile = (
$bold ? ($italic ? self::VERDANA_BOLD_ITALIC : self::VERDANA_BOLD)
: ($italic ? self::VERDANA_ITALIC : self::VERDANA)
);
+
break;
default:
- throw new PHPExcel_Exception('Unknown font name "'. $name .'". Cannot map to TrueType font file');
+ throw new PhpSpreadsheetException('Unknown font name "' . $name . '". Cannot map to TrueType font file');
+
break;
}
@@ -526,7 +517,7 @@ class PHPExcel_Shared_Font
// Check if file actually exists
if (!file_exists($fontFile)) {
- throw new PHPExcel_Exception('TrueType Font file not found');
+ throw new PhpSpreadsheetException('TrueType Font file not found');
}
return $fontFile;
@@ -536,6 +527,7 @@ class PHPExcel_Shared_Font
* Returns the associated charset for the font name.
*
* @param string $name Font name
+ *
* @return int Character set code
*/
public static function getCharsetFromFontName($name)
@@ -557,20 +549,20 @@ class PHPExcel_Shared_Font
/**
* Get the effective column width for columns without a column dimension or column with width -1
- * For example, for Calibri 11 this is 9.140625 (64 px)
+ * For example, for Calibri 11 this is 9.140625 (64 px).
+ *
+ * @param \PhpOffice\PhpSpreadsheet\Style\Font $font The workbooks default font
+ * @param bool $pPixels true = return column width in pixels, false = return in OOXML units
*
- * @param PHPExcel_Style_Font $font The workbooks default font
- * @param boolean $pPixels true = return column width in pixels, false = return in OOXML units
* @return mixed Column width
*/
- public static function getDefaultColumnWidthByFont(PHPExcel_Style_Font $font, $pPixels = false)
+ public static function getDefaultColumnWidthByFont(\PhpOffice\PhpSpreadsheet\Style\Font $font, $pPixels = false)
{
if (isset(self::$defaultColumnWidths[$font->getName()][$font->getSize()])) {
// Exact width can be determined
$columnWidth = $pPixels ?
self::$defaultColumnWidths[$font->getName()][$font->getSize()]['px']
: self::$defaultColumnWidths[$font->getName()][$font->getSize()]['width'];
-
} else {
// We don't have data for this particular font and size, use approximation by
// extrapolating from Calibri 11
@@ -590,12 +582,13 @@ class PHPExcel_Shared_Font
/**
* Get the effective row height for rows without a row dimension or rows with height -1
- * For example, for Calibri 11 this is 15 points
+ * For example, for Calibri 11 this is 15 points.
+ *
+ * @param \PhpOffice\PhpSpreadsheet\Style\Font $font The workbooks default font
*
- * @param PHPExcel_Style_Font $font The workbooks default font
* @return float Row height in points
*/
- public static function getDefaultRowHeightByFont(PHPExcel_Style_Font $font)
+ public static function getDefaultRowHeightByFont(\PhpOffice\PhpSpreadsheet\Style\Font $font)
{
switch ($font->getName()) {
case 'Arial':
@@ -603,136 +596,166 @@ class PHPExcel_Shared_Font
case 10:
// inspection of Arial 10 workbook says 12.75pt ~17px
$rowHeight = 12.75;
+
break;
case 9:
// inspection of Arial 9 workbook says 12.00pt ~16px
$rowHeight = 12;
+
break;
case 8:
// inspection of Arial 8 workbook says 11.25pt ~15px
$rowHeight = 11.25;
+
break;
case 7:
// inspection of Arial 7 workbook says 9.00pt ~12px
$rowHeight = 9;
+
break;
case 6:
case 5:
// inspection of Arial 5,6 workbook says 8.25pt ~11px
$rowHeight = 8.25;
+
break;
case 4:
// inspection of Arial 4 workbook says 6.75pt ~9px
$rowHeight = 6.75;
+
break;
case 3:
// inspection of Arial 3 workbook says 6.00pt ~8px
$rowHeight = 6;
+
break;
case 2:
case 1:
// inspection of Arial 1,2 workbook says 5.25pt ~7px
$rowHeight = 5.25;
+
break;
default:
// use Arial 10 workbook as an approximation, extrapolation
$rowHeight = 12.75 * $font->getSize() / 10;
+
break;
}
- break;
+ break;
case 'Calibri':
switch ($font->getSize()) {
case 11:
// inspection of Calibri 11 workbook says 15.00pt ~20px
$rowHeight = 15;
+
break;
case 10:
// inspection of Calibri 10 workbook says 12.75pt ~17px
$rowHeight = 12.75;
+
break;
case 9:
// inspection of Calibri 9 workbook says 12.00pt ~16px
$rowHeight = 12;
+
break;
case 8:
// inspection of Calibri 8 workbook says 11.25pt ~15px
$rowHeight = 11.25;
+
break;
case 7:
// inspection of Calibri 7 workbook says 9.00pt ~12px
$rowHeight = 9;
+
break;
case 6:
case 5:
// inspection of Calibri 5,6 workbook says 8.25pt ~11px
$rowHeight = 8.25;
+
break;
case 4:
// inspection of Calibri 4 workbook says 6.75pt ~9px
$rowHeight = 6.75;
+
break;
case 3:
// inspection of Calibri 3 workbook says 6.00pt ~8px
$rowHeight = 6.00;
+
break;
case 2:
case 1:
// inspection of Calibri 1,2 workbook says 5.25pt ~7px
$rowHeight = 5.25;
+
break;
default:
// use Calibri 11 workbook as an approximation, extrapolation
$rowHeight = 15 * $font->getSize() / 11;
+
break;
}
- break;
+ break;
case 'Verdana':
switch ($font->getSize()) {
case 10:
// inspection of Verdana 10 workbook says 12.75pt ~17px
$rowHeight = 12.75;
+
break;
case 9:
// inspection of Verdana 9 workbook says 11.25pt ~15px
$rowHeight = 11.25;
+
break;
case 8:
// inspection of Verdana 8 workbook says 10.50pt ~14px
$rowHeight = 10.50;
+
break;
case 7:
// inspection of Verdana 7 workbook says 9.00pt ~12px
$rowHeight = 9.00;
+
break;
case 6:
case 5:
// inspection of Verdana 5,6 workbook says 8.25pt ~11px
$rowHeight = 8.25;
+
break;
case 4:
// inspection of Verdana 4 workbook says 6.75pt ~9px
$rowHeight = 6.75;
+
break;
case 3:
// inspection of Verdana 3 workbook says 6.00pt ~8px
$rowHeight = 6;
+
break;
case 2:
case 1:
// inspection of Verdana 1,2 workbook says 5.25pt ~7px
$rowHeight = 5.25;
+
break;
default:
// use Verdana 10 workbook as an approximation, extrapolation
$rowHeight = 12.75 * $font->getSize() / 10;
+
break;
}
+
break;
default:
// just use Calibri as an approximation
$rowHeight = 15 * $font->getSize() / 11;
+
break;
}
diff --git a/lib/phpexcel/PHPExcel/Shared/JAMA/CHANGELOG.TXT b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/CHANGELOG.TXT
similarity index 100%
rename from lib/phpexcel/PHPExcel/Shared/JAMA/CHANGELOG.TXT
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/CHANGELOG.TXT
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php
new file mode 100644
index 00000000000..2b241d555bb
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/CholeskyDecomposition.php
@@ -0,0 +1,147 @@
+L = $A->getArray();
+ $this->m = $A->getRowDimension();
+
+ for ($i = 0; $i < $this->m; ++$i) {
+ for ($j = $i; $j < $this->m; ++$j) {
+ for ($sum = $this->L[$i][$j], $k = $i - 1; $k >= 0; --$k) {
+ $sum -= $this->L[$i][$k] * $this->L[$j][$k];
+ }
+ if ($i == $j) {
+ if ($sum >= 0) {
+ $this->L[$i][$i] = sqrt($sum);
+ } else {
+ $this->isspd = false;
+ }
+ } else {
+ if ($this->L[$i][$i] != 0) {
+ $this->L[$j][$i] = $sum / $this->L[$i][$i];
+ }
+ }
+ }
+
+ for ($k = $i + 1; $k < $this->m; ++$k) {
+ $this->L[$i][$k] = 0.0;
+ }
+ }
+ }
+
+ /**
+ * Is the matrix symmetric and positive definite?
+ *
+ * @return bool
+ */
+ public function isSPD()
+ {
+ return $this->isspd;
+ }
+
+ /**
+ * getL.
+ *
+ * Return triangular factor.
+ *
+ * @return Matrix Lower triangular matrix
+ */
+ public function getL()
+ {
+ return new Matrix($this->L);
+ }
+
+ /**
+ * Solve A*X = B.
+ *
+ * @param $B Row-equal matrix
+ *
+ * @return Matrix L * L' * X = B
+ */
+ public function solve(Matrix $B)
+ {
+ if ($B->getRowDimension() == $this->m) {
+ if ($this->isspd) {
+ $X = $B->getArrayCopy();
+ $nx = $B->getColumnDimension();
+
+ for ($k = 0; $k < $this->m; ++$k) {
+ for ($i = $k + 1; $i < $this->m; ++$i) {
+ for ($j = 0; $j < $nx; ++$j) {
+ $X[$i][$j] -= $X[$k][$j] * $this->L[$i][$k];
+ }
+ }
+ for ($j = 0; $j < $nx; ++$j) {
+ $X[$k][$j] /= $this->L[$k][$k];
+ }
+ }
+
+ for ($k = $this->m - 1; $k >= 0; --$k) {
+ for ($j = 0; $j < $nx; ++$j) {
+ $X[$k][$j] /= $this->L[$k][$k];
+ }
+ for ($i = 0; $i < $k; ++$i) {
+ for ($j = 0; $j < $nx; ++$j) {
+ $X[$i][$j] -= $X[$k][$j] * $this->L[$k][$i];
+ }
+ }
+ }
+
+ return new Matrix($X, $this->m, $nx);
+ }
+
+ throw new CalculationException(Matrix::MATRIX_SPD_EXCEPTION);
+ }
+
+ throw new CalculationException(Matrix::MATRIX_DIMENSION_EXCEPTION);
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Shared/JAMA/EigenvalueDecomposition.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php
similarity index 71%
rename from lib/phpexcel/PHPExcel/Shared/JAMA/EigenvalueDecomposition.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php
index d4ae3979f3a..ba59e0e5ade 100644
--- a/lib/phpexcel/PHPExcel/Shared/JAMA/EigenvalueDecomposition.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/EigenvalueDecomposition.php
@@ -1,7 +1,8 @@
d = $this->V[$this->n-1];
+ $this->d = $this->V[$this->n - 1];
// Householder reduction to tridiagonal form.
- for ($i = $this->n-1; $i > 0; --$i) {
- $i_ = $i -1;
+ for ($i = $this->n - 1; $i > 0; --$i) {
+ $i_ = $i - 1;
// Scale to avoid under/overflow.
$h = $scale = 0.0;
- $scale += array_sum(array_map(abs, $this->d));
+ $scale += array_sum(array_map('abs', $this->d));
if ($scale == 0.0) {
$this->e[$i] = $this->d[$i_];
$this->d = array_slice($this->V[$i_], 0, $i_);
@@ -113,7 +114,7 @@ class EigenvalueDecomposition
$f = $this->d[$j];
$this->V[$j][$i] = $f;
$g = $this->e[$j] + $this->V[$j][$j] * $f;
- for ($k = $j+1; $k <= $i_; ++$k) {
+ for ($k = $j + 1; $k <= $i_; ++$k) {
$g += $this->V[$k][$j] * $this->d[$k];
$this->e[$k] += $this->V[$k][$j] * $f;
}
@@ -125,7 +126,7 @@ class EigenvalueDecomposition
$f += $this->e[$j] * $this->d[$j];
}
$hh = $f / (2 * $h);
- for ($j=0; $j < $i; ++$j) {
+ for ($j = 0; $j < $i; ++$j) {
$this->e[$j] -= $hh * $this->d[$j];
}
for ($j = 0; $j < $i; ++$j) {
@@ -134,7 +135,7 @@ class EigenvalueDecomposition
for ($k = $j; $k <= $i_; ++$k) {
$this->V[$k][$j] -= ($f * $this->e[$k] + $g * $this->d[$k]);
}
- $this->d[$j] = $this->V[$i-1][$j];
+ $this->d[$j] = $this->V[$i - 1][$j];
$this->V[$i][$j] = 0.0;
}
}
@@ -142,18 +143,18 @@ class EigenvalueDecomposition
}
// Accumulate transformations.
- for ($i = 0; $i < $this->n-1; ++$i) {
- $this->V[$this->n-1][$i] = $this->V[$i][$i];
+ for ($i = 0; $i < $this->n - 1; ++$i) {
+ $this->V[$this->n - 1][$i] = $this->V[$i][$i];
$this->V[$i][$i] = 1.0;
- $h = $this->d[$i+1];
+ $h = $this->d[$i + 1];
if ($h != 0.0) {
for ($k = 0; $k <= $i; ++$k) {
- $this->d[$k] = $this->V[$k][$i+1] / $h;
+ $this->d[$k] = $this->V[$k][$i + 1] / $h;
}
for ($j = 0; $j <= $i; ++$j) {
$g = 0.0;
for ($k = 0; $k <= $i; ++$k) {
- $g += $this->V[$k][$i+1] * $this->V[$k][$j];
+ $g += $this->V[$k][$i + 1] * $this->V[$k][$j];
}
for ($k = 0; $k <= $i; ++$k) {
$this->V[$k][$j] -= $g * $this->d[$k];
@@ -161,35 +162,33 @@ class EigenvalueDecomposition
}
}
for ($k = 0; $k <= $i; ++$k) {
- $this->V[$k][$i+1] = 0.0;
+ $this->V[$k][$i + 1] = 0.0;
}
}
- $this->d = $this->V[$this->n-1];
- $this->V[$this->n-1] = array_fill(0, $j, 0.0);
- $this->V[$this->n-1][$this->n-1] = 1.0;
+ $this->d = $this->V[$this->n - 1];
+ $this->V[$this->n - 1] = array_fill(0, $j, 0.0);
+ $this->V[$this->n - 1][$this->n - 1] = 1.0;
$this->e[0] = 0.0;
}
/**
- * Symmetric tridiagonal QL algorithm.
+ * Symmetric tridiagonal QL algorithm.
*
* This is derived from the Algol procedures tql2, by
* Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
* Auto. Comp., Vol.ii-Linear Algebra, and the corresponding
- * Fortran subroutine in EISPACK.
- *
- * @access private
+ * Fortran subroutine in EISPACK.
*/
private function tql2()
{
for ($i = 1; $i < $this->n; ++$i) {
- $this->e[$i-1] = $this->e[$i];
+ $this->e[$i - 1] = $this->e[$i];
}
- $this->e[$this->n-1] = 0.0;
+ $this->e[$this->n - 1] = 0.0;
$f = 0.0;
$tst1 = 0.0;
- $eps = pow(2.0, -52.0);
+ $eps = pow(2.0, -52.0);
for ($l = 0; $l < $this->n; ++$l) {
// Find small subdiagonal element
@@ -210,14 +209,14 @@ class EigenvalueDecomposition
$iter += 1;
// Compute implicit shift
$g = $this->d[$l];
- $p = ($this->d[$l+1] - $g) / (2.0 * $this->e[$l]);
+ $p = ($this->d[$l + 1] - $g) / (2.0 * $this->e[$l]);
$r = hypo($p, 1.0);
if ($p < 0) {
$r *= -1;
}
$this->d[$l] = $this->e[$l] / ($p + $r);
- $this->d[$l+1] = $this->e[$l] * ($p + $r);
- $dl1 = $this->d[$l+1];
+ $this->d[$l + 1] = $this->e[$l] * ($p + $r);
+ $dl1 = $this->d[$l + 1];
$h = $g - $this->d[$l];
for ($i = $l + 2; $i < $this->n; ++$i) {
$this->d[$i] -= $h;
@@ -229,29 +228,29 @@ class EigenvalueDecomposition
$c2 = $c3 = $c;
$el1 = $this->e[$l + 1];
$s = $s2 = 0.0;
- for ($i = $m-1; $i >= $l; --$i) {
+ for ($i = $m - 1; $i >= $l; --$i) {
$c3 = $c2;
$c2 = $c;
$s2 = $s;
- $g = $c * $this->e[$i];
- $h = $c * $p;
- $r = hypo($p, $this->e[$i]);
- $this->e[$i+1] = $s * $r;
+ $g = $c * $this->e[$i];
+ $h = $c * $p;
+ $r = hypo($p, $this->e[$i]);
+ $this->e[$i + 1] = $s * $r;
$s = $this->e[$i] / $r;
$c = $p / $r;
$p = $c * $this->d[$i] - $s * $g;
- $this->d[$i+1] = $h + $s * ($c * $g + $s * $this->d[$i]);
+ $this->d[$i + 1] = $h + $s * ($c * $g + $s * $this->d[$i]);
// Accumulate transformation.
for ($k = 0; $k < $this->n; ++$k) {
- $h = $this->V[$k][$i+1];
- $this->V[$k][$i+1] = $s * $this->V[$k][$i] + $c * $h;
+ $h = $this->V[$k][$i + 1];
+ $this->V[$k][$i + 1] = $s * $this->V[$k][$i] + $c * $h;
$this->V[$k][$i] = $c * $this->V[$k][$i] - $s * $h;
}
}
$p = -$s * $s2 * $c3 * $el1 * $this->e[$l] / $dl1;
$this->e[$l] = $s * $p;
$this->d[$l] = $c * $p;
- // Check for convergence.
+ // Check for convergence.
} while (abs($this->e[$l]) > $eps * $tst1);
}
$this->d[$l] = $this->d[$l] + $f;
@@ -262,7 +261,7 @@ class EigenvalueDecomposition
for ($i = 0; $i < $this->n - 1; ++$i) {
$k = $i;
$p = $this->d[$i];
- for ($j = $i+1; $j < $this->n; ++$j) {
+ for ($j = $i + 1; $j < $this->n; ++$j) {
if ($this->d[$j] < $p) {
$k = $j;
$p = $this->d[$j];
@@ -281,31 +280,29 @@ class EigenvalueDecomposition
}
/**
- * Nonsymmetric reduction to Hessenberg form.
+ * Nonsymmetric reduction to Hessenberg form.
*
* This is derived from the Algol procedures orthes and ortran,
* by Martin and Wilkinson, Handbook for Auto. Comp.,
* Vol.ii-Linear Algebra, and the corresponding
- * Fortran subroutines in EISPACK.
- *
- * @access private
+ * Fortran subroutines in EISPACK.
*/
private function orthes()
{
- $low = 0;
- $high = $this->n-1;
+ $low = 0;
+ $high = $this->n - 1;
- for ($m = $low+1; $m <= $high-1; ++$m) {
+ for ($m = $low + 1; $m <= $high - 1; ++$m) {
// Scale column.
$scale = 0.0;
for ($i = $m; $i <= $high; ++$i) {
- $scale = $scale + abs($this->H[$i][$m-1]);
+ $scale = $scale + abs($this->H[$i][$m - 1]);
}
if ($scale != 0.0) {
// Compute Householder transformation.
$h = 0.0;
for ($i = $high; $i >= $m; --$i) {
- $this->ort[$i] = $this->H[$i][$m-1] / $scale;
+ $this->ort[$i] = $this->H[$i][$m - 1] / $scale;
$h += $this->ort[$i] * $this->ort[$i];
}
$g = sqrt($h);
@@ -337,7 +334,7 @@ class EigenvalueDecomposition
}
}
$this->ort[$m] = $scale * $this->ort[$m];
- $this->H[$m][$m-1] = $scale * $g;
+ $this->H[$m][$m - 1] = $scale * $g;
}
}
@@ -347,10 +344,10 @@ class EigenvalueDecomposition
$this->V[$i][$j] = ($i == $j ? 1.0 : 0.0);
}
}
- for ($m = $high-1; $m >= $low+1; --$m) {
- if ($this->H[$m][$m-1] != 0.0) {
- for ($i = $m+1; $i <= $high; ++$i) {
- $this->ort[$i] = $this->H[$i][$m-1];
+ for ($m = $high - 1; $m >= $low + 1; --$m) {
+ if ($this->H[$m][$m - 1] != 0.0) {
+ for ($i = $m + 1; $i <= $high; ++$i) {
+ $this->ort[$i] = $this->H[$i][$m - 1];
}
for ($j = $m; $j <= $high; ++$j) {
$g = 0.0;
@@ -358,7 +355,7 @@ class EigenvalueDecomposition
$g += $this->ort[$i] * $this->V[$i][$j];
}
// Double division avoids possible underflow
- $g = ($g / $this->ort[$m]) / $this->H[$m][$m-1];
+ $g = ($g / $this->ort[$m]) / $this->H[$m][$m - 1];
for ($i = $m; $i <= $high; ++$i) {
$this->V[$i][$j] += $g * $this->ort[$i];
}
@@ -368,9 +365,12 @@ class EigenvalueDecomposition
}
/**
- * Performs complex division.
+ * Performs complex division.
*
- * @access private
+ * @param mixed $xr
+ * @param mixed $xi
+ * @param mixed $yr
+ * @param mixed $yi
*/
private function cdiv($xr, $xi, $yr, $yi)
{
@@ -388,20 +388,18 @@ class EigenvalueDecomposition
}
/**
- * Nonsymmetric reduction from Hessenberg to real Schur form.
+ * Nonsymmetric reduction from Hessenberg to real Schur form.
*
* Code is derived from the Algol procedure hqr2,
* by Martin and Wilkinson, Handbook for Auto. Comp.,
* Vol.ii-Linear Algebra, and the corresponding
- * Fortran subroutine in EISPACK.
- *
- * @access private
+ * Fortran subroutine in EISPACK.
*/
private function hqr2()
{
// Initialize
$nn = $this->n;
- $n = $nn - 1;
+ $n = $nn - 1;
$low = 0;
$high = $nn - 1;
$eps = pow(2.0, -52.0);
@@ -415,7 +413,7 @@ class EigenvalueDecomposition
$this->d[$i] = $this->H[$i][$i];
$this->e[$i] = 0.0;
}
- for ($j = max($i-1, 0); $j < $nn; ++$j) {
+ for ($j = max($i - 1, 0); $j < $nn; ++$j) {
$norm = $norm + abs($this->H[$i][$j]);
}
}
@@ -426,11 +424,11 @@ class EigenvalueDecomposition
// Look for single small sub-diagonal element
$l = $n;
while ($l > $low) {
- $s = abs($this->H[$l-1][$l-1]) + abs($this->H[$l][$l]);
+ $s = abs($this->H[$l - 1][$l - 1]) + abs($this->H[$l][$l]);
if ($s == 0.0) {
$s = $norm;
}
- if (abs($this->H[$l][$l-1]) < $eps * $s) {
+ if (abs($this->H[$l][$l - 1]) < $eps * $s) {
break;
}
--$l;
@@ -444,13 +442,13 @@ class EigenvalueDecomposition
--$n;
$iter = 0;
// Two roots found
- } elseif ($l == $n-1) {
- $w = $this->H[$n][$n-1] * $this->H[$n-1][$n];
- $p = ($this->H[$n-1][$n-1] - $this->H[$n][$n]) / 2.0;
+ } elseif ($l == $n - 1) {
+ $w = $this->H[$n][$n - 1] * $this->H[$n - 1][$n];
+ $p = ($this->H[$n - 1][$n - 1] - $this->H[$n][$n]) / 2.0;
$q = $p * $p + $w;
$z = sqrt(abs($q));
$this->H[$n][$n] = $this->H[$n][$n] + $exshift;
- $this->H[$n-1][$n-1] = $this->H[$n-1][$n-1] + $exshift;
+ $this->H[$n - 1][$n - 1] = $this->H[$n - 1][$n - 1] + $exshift;
$x = $this->H[$n][$n];
// Real pair
if ($q >= 0) {
@@ -459,14 +457,14 @@ class EigenvalueDecomposition
} else {
$z = $p - $z;
}
- $this->d[$n-1] = $x + $z;
- $this->d[$n] = $this->d[$n-1];
+ $this->d[$n - 1] = $x + $z;
+ $this->d[$n] = $this->d[$n - 1];
if ($z != 0.0) {
$this->d[$n] = $x - $w / $z;
}
- $this->e[$n-1] = 0.0;
+ $this->e[$n - 1] = 0.0;
$this->e[$n] = 0.0;
- $x = $this->H[$n][$n-1];
+ $x = $this->H[$n][$n - 1];
$s = abs($x) + abs($z);
$p = $x / $s;
$q = $z / $s;
@@ -474,28 +472,28 @@ class EigenvalueDecomposition
$p = $p / $r;
$q = $q / $r;
// Row modification
- for ($j = $n-1; $j < $nn; ++$j) {
- $z = $this->H[$n-1][$j];
- $this->H[$n-1][$j] = $q * $z + $p * $this->H[$n][$j];
+ for ($j = $n - 1; $j < $nn; ++$j) {
+ $z = $this->H[$n - 1][$j];
+ $this->H[$n - 1][$j] = $q * $z + $p * $this->H[$n][$j];
$this->H[$n][$j] = $q * $this->H[$n][$j] - $p * $z;
}
// Column modification
for ($i = 0; $i <= $n; ++$i) {
- $z = $this->H[$i][$n-1];
- $this->H[$i][$n-1] = $q * $z + $p * $this->H[$i][$n];
+ $z = $this->H[$i][$n - 1];
+ $this->H[$i][$n - 1] = $q * $z + $p * $this->H[$i][$n];
$this->H[$i][$n] = $q * $this->H[$i][$n] - $p * $z;
}
// Accumulate transformations
for ($i = $low; $i <= $high; ++$i) {
- $z = $this->V[$i][$n-1];
- $this->V[$i][$n-1] = $q * $z + $p * $this->V[$i][$n];
+ $z = $this->V[$i][$n - 1];
+ $this->V[$i][$n - 1] = $q * $z + $p * $this->V[$i][$n];
$this->V[$i][$n] = $q * $this->V[$i][$n] - $p * $z;
}
- // Complex pair
+ // Complex pair
} else {
- $this->d[$n-1] = $x + $p;
+ $this->d[$n - 1] = $x + $p;
$this->d[$n] = $x + $p;
- $this->e[$n-1] = $z;
+ $this->e[$n - 1] = $z;
$this->e[$n] = -$z;
}
$n = $n - 2;
@@ -507,8 +505,8 @@ class EigenvalueDecomposition
$y = 0.0;
$w = 0.0;
if ($l < $n) {
- $y = $this->H[$n-1][$n-1];
- $w = $this->H[$n][$n-1] * $this->H[$n-1][$n];
+ $y = $this->H[$n - 1][$n - 1];
+ $w = $this->H[$n][$n - 1] * $this->H[$n - 1][$n];
}
// Wilkinson's original ad hoc shift
if ($iter == 10) {
@@ -516,7 +514,7 @@ class EigenvalueDecomposition
for ($i = $low; $i <= $n; ++$i) {
$this->H[$i][$i] -= $x;
}
- $s = abs($this->H[$n][$n-1]) + abs($this->H[$n-1][$n-2]);
+ $s = abs($this->H[$n][$n - 1]) + abs($this->H[$n - 1][$n - 2]);
$x = $y = 0.75 * $s;
$w = -0.4375 * $s * $s;
}
@@ -545,9 +543,9 @@ class EigenvalueDecomposition
$z = $this->H[$m][$m];
$r = $x - $z;
$s = $y - $z;
- $p = ($r * $s - $w) / $this->H[$m+1][$m] + $this->H[$m][$m+1];
- $q = $this->H[$m+1][$m+1] - $z - $r - $s;
- $r = $this->H[$m+2][$m+1];
+ $p = ($r * $s - $w) / $this->H[$m + 1][$m] + $this->H[$m][$m + 1];
+ $q = $this->H[$m + 1][$m + 1] - $z - $r - $s;
+ $r = $this->H[$m + 2][$m + 1];
$s = abs($p) + abs($q) + abs($r);
$p = $p / $s;
$q = $q / $s;
@@ -555,25 +553,25 @@ class EigenvalueDecomposition
if ($m == $l) {
break;
}
- if (abs($this->H[$m][$m-1]) * (abs($q) + abs($r)) <
- $eps * (abs($p) * (abs($this->H[$m-1][$m-1]) + abs($z) + abs($this->H[$m+1][$m+1])))) {
+ if (abs($this->H[$m][$m - 1]) * (abs($q) + abs($r)) <
+ $eps * (abs($p) * (abs($this->H[$m - 1][$m - 1]) + abs($z) + abs($this->H[$m + 1][$m + 1])))) {
break;
}
--$m;
}
for ($i = $m + 2; $i <= $n; ++$i) {
- $this->H[$i][$i-2] = 0.0;
- if ($i > $m+2) {
- $this->H[$i][$i-3] = 0.0;
+ $this->H[$i][$i - 2] = 0.0;
+ if ($i > $m + 2) {
+ $this->H[$i][$i - 3] = 0.0;
}
}
// Double QR step involving rows l:n and columns m:n
- for ($k = $m; $k <= $n-1; ++$k) {
- $notlast = ($k != $n-1);
+ for ($k = $m; $k <= $n - 1; ++$k) {
+ $notlast = ($k != $n - 1);
if ($k != $m) {
- $p = $this->H[$k][$k-1];
- $q = $this->H[$k+1][$k-1];
- $r = ($notlast ? $this->H[$k+2][$k-1] : 0.0);
+ $p = $this->H[$k][$k - 1];
+ $q = $this->H[$k + 1][$k - 1];
+ $r = ($notlast ? $this->H[$k + 2][$k - 1] : 0.0);
$x = abs($p) + abs($q) + abs($r);
if ($x != 0.0) {
$p = $p / $x;
@@ -590,9 +588,9 @@ class EigenvalueDecomposition
}
if ($s != 0) {
if ($k != $m) {
- $this->H[$k][$k-1] = -$s * $x;
+ $this->H[$k][$k - 1] = -$s * $x;
} elseif ($l != $m) {
- $this->H[$k][$k-1] = -$this->H[$k][$k-1];
+ $this->H[$k][$k - 1] = -$this->H[$k][$k - 1];
}
$p = $p + $s;
$x = $p / $s;
@@ -602,33 +600,34 @@ class EigenvalueDecomposition
$r = $r / $p;
// Row modification
for ($j = $k; $j < $nn; ++$j) {
- $p = $this->H[$k][$j] + $q * $this->H[$k+1][$j];
+ $p = $this->H[$k][$j] + $q * $this->H[$k + 1][$j];
if ($notlast) {
- $p = $p + $r * $this->H[$k+2][$j];
- $this->H[$k+2][$j] = $this->H[$k+2][$j] - $p * $z;
+ $p = $p + $r * $this->H[$k + 2][$j];
+ $this->H[$k + 2][$j] = $this->H[$k + 2][$j] - $p * $z;
}
$this->H[$k][$j] = $this->H[$k][$j] - $p * $x;
- $this->H[$k+1][$j] = $this->H[$k+1][$j] - $p * $y;
+ $this->H[$k + 1][$j] = $this->H[$k + 1][$j] - $p * $y;
}
// Column modification
- for ($i = 0; $i <= min($n, $k+3); ++$i) {
- $p = $x * $this->H[$i][$k] + $y * $this->H[$i][$k+1];
+ $iMax = min($n, $k + 3);
+ for ($i = 0; $i <= $iMax; ++$i) {
+ $p = $x * $this->H[$i][$k] + $y * $this->H[$i][$k + 1];
if ($notlast) {
- $p = $p + $z * $this->H[$i][$k+2];
- $this->H[$i][$k+2] = $this->H[$i][$k+2] - $p * $r;
+ $p = $p + $z * $this->H[$i][$k + 2];
+ $this->H[$i][$k + 2] = $this->H[$i][$k + 2] - $p * $r;
}
$this->H[$i][$k] = $this->H[$i][$k] - $p;
- $this->H[$i][$k+1] = $this->H[$i][$k+1] - $p * $q;
+ $this->H[$i][$k + 1] = $this->H[$i][$k + 1] - $p * $q;
}
// Accumulate transformations
for ($i = $low; $i <= $high; ++$i) {
- $p = $x * $this->V[$i][$k] + $y * $this->V[$i][$k+1];
+ $p = $x * $this->V[$i][$k] + $y * $this->V[$i][$k + 1];
if ($notlast) {
- $p = $p + $z * $this->V[$i][$k+2];
- $this->V[$i][$k+2] = $this->V[$i][$k+2] - $p * $r;
+ $p = $p + $z * $this->V[$i][$k + 2];
+ $this->V[$i][$k + 2] = $this->V[$i][$k + 2] - $p * $r;
}
$this->V[$i][$k] = $this->V[$i][$k] - $p;
- $this->V[$i][$k+1] = $this->V[$i][$k+1] - $p * $q;
+ $this->V[$i][$k + 1] = $this->V[$i][$k + 1] - $p * $q;
}
} // ($s != 0)
} // k loop
@@ -640,14 +639,14 @@ class EigenvalueDecomposition
return;
}
- for ($n = $nn-1; $n >= 0; --$n) {
+ for ($n = $nn - 1; $n >= 0; --$n) {
$p = $this->d[$n];
$q = $this->e[$n];
// Real vector
if ($q == 0) {
$l = $n;
$this->H[$n][$n] = 1.0;
- for ($i = $n-1; $i >= 0; --$i) {
+ for ($i = $n - 1; $i >= 0; --$i) {
$w = $this->H[$i][$i] - $p;
$r = 0.0;
for ($j = $l; $j <= $n; ++$j) {
@@ -664,17 +663,17 @@ class EigenvalueDecomposition
} else {
$this->H[$i][$n] = -$r / ($eps * $norm);
}
- // Solve real equations
+ // Solve real equations
} else {
- $x = $this->H[$i][$i+1];
- $y = $this->H[$i+1][$i];
+ $x = $this->H[$i][$i + 1];
+ $y = $this->H[$i + 1][$i];
$q = ($this->d[$i] - $p) * ($this->d[$i] - $p) + $this->e[$i] * $this->e[$i];
$t = ($x * $s - $z * $r) / $q;
$this->H[$i][$n] = $t;
if (abs($x) > abs($z)) {
- $this->H[$i+1][$n] = (-$r - $w * $t) / $x;
+ $this->H[$i + 1][$n] = (-$r - $w * $t) / $x;
} else {
- $this->H[$i+1][$n] = (-$s - $y * $t) / $z;
+ $this->H[$i + 1][$n] = (-$s - $y * $t) / $z;
}
}
// Overflow control
@@ -686,26 +685,26 @@ class EigenvalueDecomposition
}
}
}
- // Complex vector
+ // Complex vector
} elseif ($q < 0) {
- $l = $n-1;
+ $l = $n - 1;
// Last vector component imaginary so matrix is triangular
- if (abs($this->H[$n][$n-1]) > abs($this->H[$n-1][$n])) {
- $this->H[$n-1][$n-1] = $q / $this->H[$n][$n-1];
- $this->H[$n-1][$n] = -($this->H[$n][$n] - $p) / $this->H[$n][$n-1];
+ if (abs($this->H[$n][$n - 1]) > abs($this->H[$n - 1][$n])) {
+ $this->H[$n - 1][$n - 1] = $q / $this->H[$n][$n - 1];
+ $this->H[$n - 1][$n] = -($this->H[$n][$n] - $p) / $this->H[$n][$n - 1];
} else {
- $this->cdiv(0.0, -$this->H[$n-1][$n], $this->H[$n-1][$n-1] - $p, $q);
- $this->H[$n-1][$n-1] = $this->cdivr;
- $this->H[$n-1][$n] = $this->cdivi;
+ $this->cdiv(0.0, -$this->H[$n - 1][$n], $this->H[$n - 1][$n - 1] - $p, $q);
+ $this->H[$n - 1][$n - 1] = $this->cdivr;
+ $this->H[$n - 1][$n] = $this->cdivi;
}
- $this->H[$n][$n-1] = 0.0;
+ $this->H[$n][$n - 1] = 0.0;
$this->H[$n][$n] = 1.0;
- for ($i = $n-2; $i >= 0; --$i) {
+ for ($i = $n - 2; $i >= 0; --$i) {
// double ra,sa,vr,vi;
$ra = 0.0;
$sa = 0.0;
for ($j = $l; $j <= $n; ++$j) {
- $ra = $ra + $this->H[$i][$j] * $this->H[$j][$n-1];
+ $ra = $ra + $this->H[$i][$j] * $this->H[$j][$n - 1];
$sa = $sa + $this->H[$i][$j] * $this->H[$j][$n];
}
$w = $this->H[$i][$i] - $p;
@@ -717,35 +716,35 @@ class EigenvalueDecomposition
$l = $i;
if ($this->e[$i] == 0) {
$this->cdiv(-$ra, -$sa, $w, $q);
- $this->H[$i][$n-1] = $this->cdivr;
- $this->H[$i][$n] = $this->cdivi;
+ $this->H[$i][$n - 1] = $this->cdivr;
+ $this->H[$i][$n] = $this->cdivi;
} else {
// Solve complex equations
- $x = $this->H[$i][$i+1];
- $y = $this->H[$i+1][$i];
+ $x = $this->H[$i][$i + 1];
+ $y = $this->H[$i + 1][$i];
$vr = ($this->d[$i] - $p) * ($this->d[$i] - $p) + $this->e[$i] * $this->e[$i] - $q * $q;
$vi = ($this->d[$i] - $p) * 2.0 * $q;
if ($vr == 0.0 & $vi == 0.0) {
$vr = $eps * $norm * (abs($w) + abs($q) + abs($x) + abs($y) + abs($z));
}
$this->cdiv($x * $r - $z * $ra + $q * $sa, $x * $s - $z * $sa - $q * $ra, $vr, $vi);
- $this->H[$i][$n-1] = $this->cdivr;
- $this->H[$i][$n] = $this->cdivi;
+ $this->H[$i][$n - 1] = $this->cdivr;
+ $this->H[$i][$n] = $this->cdivi;
if (abs($x) > (abs($z) + abs($q))) {
- $this->H[$i+1][$n-1] = (-$ra - $w * $this->H[$i][$n-1] + $q * $this->H[$i][$n]) / $x;
- $this->H[$i+1][$n] = (-$sa - $w * $this->H[$i][$n] - $q * $this->H[$i][$n-1]) / $x;
+ $this->H[$i + 1][$n - 1] = (-$ra - $w * $this->H[$i][$n - 1] + $q * $this->H[$i][$n]) / $x;
+ $this->H[$i + 1][$n] = (-$sa - $w * $this->H[$i][$n] - $q * $this->H[$i][$n - 1]) / $x;
} else {
- $this->cdiv(-$r - $y * $this->H[$i][$n-1], -$s - $y * $this->H[$i][$n], $z, $q);
- $this->H[$i+1][$n-1] = $this->cdivr;
- $this->H[$i+1][$n] = $this->cdivi;
+ $this->cdiv(-$r - $y * $this->H[$i][$n - 1], -$s - $y * $this->H[$i][$n], $z, $q);
+ $this->H[$i + 1][$n - 1] = $this->cdivr;
+ $this->H[$i + 1][$n] = $this->cdivi;
}
}
// Overflow control
- $t = max(abs($this->H[$i][$n-1]), abs($this->H[$i][$n]));
+ $t = max(abs($this->H[$i][$n - 1]), abs($this->H[$i][$n]));
if (($eps * $t) * $t > 1) {
for ($j = $i; $j <= $n; ++$j) {
- $this->H[$j][$n-1] = $this->H[$j][$n-1] / $t;
- $this->H[$j][$n] = $this->H[$j][$n] / $t;
+ $this->H[$j][$n - 1] = $this->H[$j][$n - 1] / $t;
+ $this->H[$j][$n] = $this->H[$j][$n] / $t;
}
}
} // end else
@@ -763,23 +762,24 @@ class EigenvalueDecomposition
}
// Back transformation to get eigenvectors of original matrix
- for ($j = $nn-1; $j >= $low; --$j) {
+ for ($j = $nn - 1; $j >= $low; --$j) {
for ($i = $low; $i <= $high; ++$i) {
$z = 0.0;
- for ($k = $low; $k <= min($j, $high); ++$k) {
+ $kMax = min($j, $high);
+ for ($k = $low; $k <= $kMax; ++$k) {
$z = $z + $this->V[$i][$k] * $this->H[$k][$j];
}
$this->V[$i][$j] = $z;
}
}
- } // end hqr2
+ }
+
+ // end hqr2
/**
- * Constructor: Check for symmetry, then construct the eigenvalue decomposition
+ * Constructor: Check for symmetry, then construct the eigenvalue decomposition.
*
- * @access public
- * @param A Square matrix
- * @return Structure to access D and V.
+ * @param mixed $Arg A Square matrix
*/
public function __construct($Arg)
{
@@ -801,7 +801,7 @@ class EigenvalueDecomposition
$this->tql2();
} else {
$this->H = $this->A;
- $this->ort = array();
+ $this->ort = [];
// Reduce to Hessenberg form.
$this->orthes();
// Reduce Hessenberg to real Schur form.
@@ -810,10 +810,9 @@ class EigenvalueDecomposition
}
/**
- * Return the eigenvector matrix
+ * Return the eigenvector matrix.
*
- * @access public
- * @return V
+ * @return Matrix V
*/
public function getV()
{
@@ -821,10 +820,9 @@ class EigenvalueDecomposition
}
/**
- * Return the real parts of the eigenvalues
+ * Return the real parts of the eigenvalues.
*
- * @access public
- * @return real(diag(D))
+ * @return array real(diag(D))
*/
public function getRealEigenvalues()
{
@@ -832,10 +830,9 @@ class EigenvalueDecomposition
}
/**
- * Return the imaginary parts of the eigenvalues
+ * Return the imaginary parts of the eigenvalues.
*
- * @access public
- * @return imag(diag(D))
+ * @return array imag(diag(D))
*/
public function getImagEigenvalues()
{
@@ -843,10 +840,9 @@ class EigenvalueDecomposition
}
/**
- * Return the block diagonal eigenvalue matrix
+ * Return the block diagonal eigenvalue matrix.
*
- * @access public
- * @return D
+ * @return Matrix D
*/
public function getD()
{
@@ -859,6 +855,7 @@ class EigenvalueDecomposition
$o = ($this->e[$i] > 0) ? $i + 1 : $i - 1;
$D[$i][$o] = $this->e[$i];
}
+
return new Matrix($D);
}
}
diff --git a/lib/phpexcel/PHPExcel/Shared/JAMA/LUDecomposition.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/LUDecomposition.php
similarity index 66%
rename from lib/phpexcel/PHPExcel/Shared/JAMA/LUDecomposition.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/LUDecomposition.php
index 2505d922690..bb2b4b040a9 100644
--- a/lib/phpexcel/PHPExcel/Shared/JAMA/LUDecomposition.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/LUDecomposition.php
@@ -1,7 +1,10 @@
= n, the LU decomposition is an m-by-n
* unit lower triangular matrix L, an n-by-n upper triangular matrix U,
* and a permutation vector piv of length m so that A(piv,:) = L*U.
@@ -15,62 +18,66 @@
* @author Paul Meagher
* @author Bartosz Matosiuk
* @author Michael Bommarito
+ *
* @version 1.1
- * @license PHP v3.0
*/
-class PHPExcel_Shared_JAMA_LUDecomposition
+class LUDecomposition
{
- const MATRIX_SINGULAR_EXCEPTION = "Can only perform operation on singular matrix.";
- const MATRIX_SQUARE_EXCEPTION = "Mismatched Row dimension";
+ const MATRIX_SINGULAR_EXCEPTION = 'Can only perform operation on singular matrix.';
+ const MATRIX_SQUARE_EXCEPTION = 'Mismatched Row dimension';
/**
- * Decomposition storage
- * @var array
+ * Decomposition storage.
+ *
+ * @var array
*/
- private $LU = array();
+ private $LU = [];
/**
- * Row dimension.
- * @var int
+ * Row dimension.
+ *
+ * @var int
*/
private $m;
/**
- * Column dimension.
- * @var int
+ * Column dimension.
+ *
+ * @var int
*/
private $n;
/**
- * Pivot sign.
- * @var int
+ * Pivot sign.
+ *
+ * @var int
*/
private $pivsign;
/**
- * Internal storage of pivot vector.
- * @var array
+ * Internal storage of pivot vector.
+ *
+ * @var array
*/
- private $piv = array();
+ private $piv = [];
/**
- * LU Decomposition constructor.
+ * LU Decomposition constructor.
*
- * @param $A Rectangular matrix
- * @return Structure to access L, U and piv.
+ * @param Matrix $A Rectangular matrix
*/
public function __construct($A)
{
- if ($A instanceof PHPExcel_Shared_JAMA_Matrix) {
+ if ($A instanceof Matrix) {
// Use a "left-looking", dot-product, Crout/Doolittle algorithm.
$this->LU = $A->getArray();
- $this->m = $A->getRowDimension();
- $this->n = $A->getColumnDimension();
+ $this->m = $A->getRowDimension();
+ $this->n = $A->getColumnDimension();
for ($i = 0; $i < $this->m; ++$i) {
$this->piv[$i] = $i;
}
$this->pivsign = 1;
- $LUrowi = $LUcolj = array();
+ $LUrowi = $LUcolj = [];
// Outer loop.
for ($j = 0; $j < $this->n; ++$j) {
@@ -91,7 +98,7 @@ class PHPExcel_Shared_JAMA_LUDecomposition
}
// Find pivot and exchange if necessary.
$p = $j;
- for ($i = $j+1; $i < $this->m; ++$i) {
+ for ($i = $j + 1; $i < $this->m; ++$i) {
if (abs($LUcolj[$i]) > abs($LUcolj[$p])) {
$p = $i;
}
@@ -109,20 +116,22 @@ class PHPExcel_Shared_JAMA_LUDecomposition
}
// Compute multipliers.
if (($j < $this->m) && ($this->LU[$j][$j] != 0.0)) {
- for ($i = $j+1; $i < $this->m; ++$i) {
+ for ($i = $j + 1; $i < $this->m; ++$i) {
$this->LU[$i][$j] /= $this->LU[$j][$j];
}
}
}
} else {
- throw new PHPExcel_Calculation_Exception(PHPExcel_Shared_JAMA_Matrix::ARGUMENT_TYPE_EXCEPTION);
+ throw new CalculationException(Matrix::ARGUMENT_TYPE_EXCEPTION);
}
- } // function __construct()
+ }
+
+ // function __construct()
/**
- * Get lower triangular factor.
+ * Get lower triangular factor.
*
- * @return array Lower triangular factor
+ * @return Matrix Lower triangular factor
*/
public function getL()
{
@@ -137,13 +146,16 @@ class PHPExcel_Shared_JAMA_LUDecomposition
}
}
}
- return new PHPExcel_Shared_JAMA_Matrix($L);
- } // function getL()
+
+ return new Matrix($L);
+ }
+
+ // function getL()
/**
- * Get upper triangular factor.
+ * Get upper triangular factor.
*
- * @return array Upper triangular factor
+ * @return Matrix Upper triangular factor
*/
public function getU()
{
@@ -156,33 +168,40 @@ class PHPExcel_Shared_JAMA_LUDecomposition
}
}
}
- return new PHPExcel_Shared_JAMA_Matrix($U);
- } // function getU()
+
+ return new Matrix($U);
+ }
+
+ // function getU()
/**
- * Return pivot permutation vector.
+ * Return pivot permutation vector.
*
- * @return array Pivot vector
+ * @return array Pivot vector
*/
public function getPivot()
{
return $this->piv;
- } // function getPivot()
+ }
+
+ // function getPivot()
/**
- * Alias for getPivot
+ * Alias for getPivot.
*
* @see getPivot
*/
public function getDoublePivot()
{
return $this->getPivot();
- } // function getDoublePivot()
+ }
+
+ // function getDoublePivot()
/**
* Is the matrix nonsingular?
*
- * @return true if U, and hence A, is nonsingular.
+ * @return bool true if U, and hence A, is nonsingular
*/
public function isNonsingular()
{
@@ -191,13 +210,16 @@ class PHPExcel_Shared_JAMA_LUDecomposition
return false;
}
}
+
return true;
- } // function isNonsingular()
+ }
+
+ // function isNonsingular()
/**
- * Count determinants
+ * Count determinants.
*
- * @return array d matrix deterninat
+ * @return array d matrix deterninat
*/
public function det()
{
@@ -206,19 +228,24 @@ class PHPExcel_Shared_JAMA_LUDecomposition
for ($j = 0; $j < $this->n; ++$j) {
$d *= $this->LU[$j][$j];
}
+
return $d;
- } else {
- throw new PHPExcel_Calculation_Exception(PHPExcel_Shared_JAMA_Matrix::MATRIX_DIMENSION_EXCEPTION);
}
- } // function det()
+
+ throw new CalculationException(Matrix::MATRIX_DIMENSION_EXCEPTION);
+ }
+
+ // function det()
/**
- * Solve A*X = B
+ * Solve A*X = B.
*
- * @param $B A Matrix with as many rows as A and any number of columns.
- * @return X so that L*U*X = B(piv,:)
- * @PHPExcel_Calculation_Exception IllegalArgumentException Matrix row dimensions must agree.
- * @PHPExcel_Calculation_Exception RuntimeException Matrix is singular.
+ * @param mixed $B a Matrix with as many rows as A and any number of columns
+ *
+ * @throws CalculationException illegalArgumentException Matrix row dimensions must agree
+ * @throws CalculationException runtimeException Matrix is singular
+ *
+ * @return Matrix X so that L*U*X = B(piv,:)
*/
public function solve($B)
{
@@ -226,17 +253,17 @@ class PHPExcel_Shared_JAMA_LUDecomposition
if ($this->isNonsingular()) {
// Copy right hand side with pivoting
$nx = $B->getColumnDimension();
- $X = $B->getMatrix($this->piv, 0, $nx-1);
+ $X = $B->getMatrix($this->piv, 0, $nx - 1);
// Solve L*Y = B(piv,:)
for ($k = 0; $k < $this->n; ++$k) {
- for ($i = $k+1; $i < $this->n; ++$i) {
+ for ($i = $k + 1; $i < $this->n; ++$i) {
for ($j = 0; $j < $nx; ++$j) {
$X->A[$i][$j] -= $X->A[$k][$j] * $this->LU[$i][$k];
}
}
}
// Solve U*X = Y;
- for ($k = $this->n-1; $k >= 0; --$k) {
+ for ($k = $this->n - 1; $k >= 0; --$k) {
for ($j = 0; $j < $nx; ++$j) {
$X->A[$k][$j] /= $this->LU[$k][$k];
}
@@ -246,12 +273,13 @@ class PHPExcel_Shared_JAMA_LUDecomposition
}
}
}
+
return $X;
- } else {
- throw new PHPExcel_Calculation_Exception(self::MATRIX_SINGULAR_EXCEPTION);
}
- } else {
- throw new PHPExcel_Calculation_Exception(self::MATRIX_SQUARE_EXCEPTION);
+
+ throw new CalculationException(self::MATRIX_SINGULAR_EXCEPTION);
}
+
+ throw new CalculationException(self::MATRIX_SQUARE_EXCEPTION);
}
}
diff --git a/lib/phpexcel/PHPExcel/Shared/JAMA/Matrix.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/Matrix.php
similarity index 52%
rename from lib/phpexcel/PHPExcel/Shared/JAMA/Matrix.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/Matrix.php
index 82fb0fb202f..b3d82d466cc 100644
--- a/lib/phpexcel/PHPExcel/Shared/JAMA/Matrix.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/Matrix.php
@@ -1,71 +1,62 @@
0) {
- $args = func_get_args();
- $match = implode(",", array_map('gettype', $args));
+ if (count($args) > 0) {
+ $match = implode(',', array_map('gettype', $args));
switch ($match) {
//Rectangular matrix - m x n initialized from 2D array
@@ -73,18 +64,21 @@ class PHPExcel_Shared_JAMA_Matrix
$this->m = count($args[0]);
$this->n = count($args[0][0]);
$this->A = $args[0];
+
break;
//Square matrix - n x n
case 'integer':
$this->m = $args[0];
$this->n = $args[0];
$this->A = array_fill(0, $this->m, array_fill(0, $this->n, 0));
+
break;
//Rectangular matrix - m x n
case 'integer,integer':
$this->m = $args[0];
$this->n = $args[1];
$this->A = array_fill(0, $this->m, array_fill(0, $this->n, 0));
+
break;
//Rectangular matrix - m x n initialized from packed array
case 'array,integer':
@@ -101,22 +95,24 @@ class PHPExcel_Shared_JAMA_Matrix
}
}
} else {
- throw new PHPExcel_Calculation_Exception(self::ARRAY_LENGTH_EXCEPTION);
+ throw new CalculationException(self::ARRAY_LENGTH_EXCEPTION);
}
+
break;
default:
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+
break;
}
} else {
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
}
/**
- * getArray
+ * getArray.
*
- * @return array Matrix array
+ * @return array Matrix array
*/
public function getArray()
{
@@ -124,9 +120,9 @@ class PHPExcel_Shared_JAMA_Matrix
}
/**
- * getRowDimension
+ * getRowDimension.
*
- * @return int Row dimension
+ * @return int Row dimension
*/
public function getRowDimension()
{
@@ -134,9 +130,9 @@ class PHPExcel_Shared_JAMA_Matrix
}
/**
- * getColumnDimension
+ * getColumnDimension.
*
- * @return int Column dimension
+ * @return int Column dimension
*/
public function getColumnDimension()
{
@@ -144,12 +140,14 @@ class PHPExcel_Shared_JAMA_Matrix
}
/**
- * get
+ * get.
*
- * Get the i,j-th element of the matrix.
- * @param int $i Row position
- * @param int $j Column position
- * @return mixed Element (int/float/double)
+ * Get the i,j-th element of the matrix.
+ *
+ * @param int $i Row position
+ * @param int $j Column position
+ *
+ * @return mixed Element (int/float/double)
*/
public function get($i = null, $j = null)
{
@@ -157,20 +155,21 @@ class PHPExcel_Shared_JAMA_Matrix
}
/**
- * getMatrix
+ * getMatrix.
*
* Get a submatrix
- * @param int $i0 Initial row index
- * @param int $iF Final row index
- * @param int $j0 Initial column index
- * @param int $jF Final column index
- * @return Matrix Submatrix
+ *
+ * @param int $i0 Initial row index
+ * @param int $iF Final row index
+ * @param int $j0 Initial column index
+ * @param int $jF Final column index
+ *
+ * @return Matrix Submatrix
*/
- public function getMatrix()
+ public function getMatrix(...$args)
{
- if (func_num_args() > 0) {
- $args = func_get_args();
- $match = implode(",", array_map('gettype', $args));
+ if (count($args) > 0) {
+ $match = implode(',', array_map('gettype', $args));
switch ($match) {
//A($i0...; $j0...)
@@ -179,20 +178,22 @@ class PHPExcel_Shared_JAMA_Matrix
if ($i0 >= 0) {
$m = $this->m - $i0;
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_BOUNDS_EXCEPTION);
}
if ($j0 >= 0) {
$n = $this->n - $j0;
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_BOUNDS_EXCEPTION);
}
- $R = new PHPExcel_Shared_JAMA_Matrix($m, $n);
+ $R = new self($m, $n);
for ($i = $i0; $i < $this->m; ++$i) {
for ($j = $j0; $j < $this->n; ++$j) {
$R->set($i, $j, $this->A[$i][$j]);
}
}
+
return $R;
+
break;
//A($i0...$iF; $j0...$jF)
case 'integer,integer,integer,integer':
@@ -200,20 +201,22 @@ class PHPExcel_Shared_JAMA_Matrix
if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) {
$m = $iF - $i0;
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_BOUNDS_EXCEPTION);
}
if (($jF > $j0) && ($this->n >= $jF) && ($j0 >= 0)) {
$n = $jF - $j0;
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_BOUNDS_EXCEPTION);
}
- $R = new PHPExcel_Shared_JAMA_Matrix($m+1, $n+1);
+ $R = new self($m + 1, $n + 1);
for ($i = $i0; $i <= $iF; ++$i) {
for ($j = $j0; $j <= $jF; ++$j) {
$R->set($i - $i0, $j - $j0, $this->A[$i][$j]);
}
}
+
return $R;
+
break;
//$R = array of row indices; $C = array of column indices
case 'array,array':
@@ -221,41 +224,22 @@ class PHPExcel_Shared_JAMA_Matrix
if (count($RL) > 0) {
$m = count($RL);
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_BOUNDS_EXCEPTION);
}
if (count($CL) > 0) {
$n = count($CL);
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_BOUNDS_EXCEPTION);
}
- $R = new PHPExcel_Shared_JAMA_Matrix($m, $n);
- for ($i = 0; $i < $m; ++$i) {
- for ($j = 0; $j < $n; ++$j) {
- $R->set($i - $i0, $j - $j0, $this->A[$RL[$i]][$CL[$j]]);
- }
- }
- return $R;
- break;
- //$RL = array of row indices; $CL = array of column indices
- case 'array,array':
- list($RL, $CL) = $args;
- if (count($RL) > 0) {
- $m = count($RL);
- } else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
- }
- if (count($CL) > 0) {
- $n = count($CL);
- } else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
- }
- $R = new PHPExcel_Shared_JAMA_Matrix($m, $n);
+ $R = new self($m, $n);
for ($i = 0; $i < $m; ++$i) {
for ($j = 0; $j < $n; ++$j) {
$R->set($i, $j, $this->A[$RL[$i]][$CL[$j]]);
}
}
+
return $R;
+
break;
//A($i0...$iF); $CL = array of column indices
case 'integer,integer,array':
@@ -263,20 +247,22 @@ class PHPExcel_Shared_JAMA_Matrix
if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) {
$m = $iF - $i0;
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_BOUNDS_EXCEPTION);
}
if (count($CL) > 0) {
$n = count($CL);
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_BOUNDS_EXCEPTION);
}
- $R = new PHPExcel_Shared_JAMA_Matrix($m, $n);
+ $R = new self($m, $n);
for ($i = $i0; $i < $iF; ++$i) {
for ($j = 0; $j < $n; ++$j) {
- $R->set($i - $i0, $j, $this->A[$RL[$i]][$j]);
+ $R->set($i - $i0, $j, $this->A[$i][$CL[$j]]);
}
}
+
return $R;
+
break;
//$RL = array of row indices
case 'array,integer,integer':
@@ -284,72 +270,85 @@ class PHPExcel_Shared_JAMA_Matrix
if (count($RL) > 0) {
$m = count($RL);
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_BOUNDS_EXCEPTION);
}
if (($jF >= $j0) && ($this->n >= $jF) && ($j0 >= 0)) {
$n = $jF - $j0;
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_BOUNDS_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_BOUNDS_EXCEPTION);
}
- $R = new PHPExcel_Shared_JAMA_Matrix($m, $n+1);
+ $R = new self($m, $n + 1);
for ($i = 0; $i < $m; ++$i) {
for ($j = $j0; $j <= $jF; ++$j) {
$R->set($i, $j - $j0, $this->A[$RL[$i]][$j]);
}
}
+
return $R;
+
break;
default:
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+
break;
}
} else {
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
}
/**
- * checkMatrixDimensions
+ * checkMatrixDimensions.
*
* Is matrix B the same size?
- * @param Matrix $B Matrix B
- * @return boolean
+ *
+ * @param Matrix $B Matrix B
+ *
+ * @return bool
*/
public function checkMatrixDimensions($B = null)
{
- if ($B instanceof PHPExcel_Shared_JAMA_Matrix) {
+ if ($B instanceof self) {
if (($this->m == $B->getRowDimension()) && ($this->n == $B->getColumnDimension())) {
return true;
- } else {
- throw new PHPExcel_Calculation_Exception(self::MATRIX_DIMENSION_EXCEPTION);
}
- } else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION);
+
+ throw new CalculationException(self::MATRIX_DIMENSION_EXCEPTION);
}
- } // function checkMatrixDimensions()
+
+ throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
+ }
+
+ // function checkMatrixDimensions()
/**
- * set
+ * set.
*
- * Set the i,j-th element of the matrix.
- * @param int $i Row position
- * @param int $j Column position
- * @param mixed $c Int/float/double value
- * @return mixed Element (int/float/double)
+ * Set the i,j-th element of the matrix.
+ *
+ * @param int $i Row position
+ * @param int $j Column position
+ * @param mixed $c Int/float/double value
+ *
+ * @return mixed Element (int/float/double)
*/
public function set($i = null, $j = null, $c = null)
{
// Optimized set version just has this
$this->A[$i][$j] = $c;
- } // function set()
+ }
+
+ // function set()
/**
- * identity
+ * identity.
*
- * Generate an identity matrix.
- * @param int $m Row dimension
- * @param int $n Column dimension
- * @return Matrix Identity matrix
+ * Generate an identity matrix.
+ *
+ * @param int $m Row dimension
+ * @param int $n Column dimension
+ *
+ * @return Matrix Identity matrix
*/
public function identity($m = null, $n = null)
{
@@ -357,87 +356,99 @@ class PHPExcel_Shared_JAMA_Matrix
}
/**
- * diagonal
+ * diagonal.
*
* Generate a diagonal matrix
- * @param int $m Row dimension
- * @param int $n Column dimension
- * @param mixed $c Diagonal value
- * @return Matrix Diagonal matrix
+ *
+ * @param int $m Row dimension
+ * @param int $n Column dimension
+ * @param mixed $c Diagonal value
+ *
+ * @return Matrix Diagonal matrix
*/
public function diagonal($m = null, $n = null, $c = 1)
{
- $R = new PHPExcel_Shared_JAMA_Matrix($m, $n);
+ $R = new self($m, $n);
for ($i = 0; $i < $m; ++$i) {
$R->set($i, $i, $c);
}
+
return $R;
}
/**
- * getMatrixByRow
+ * getMatrixByRow.
*
* Get a submatrix by row index/range
- * @param int $i0 Initial row index
- * @param int $iF Final row index
- * @return Matrix Submatrix
+ *
+ * @param int $i0 Initial row index
+ * @param int $iF Final row index
+ *
+ * @return Matrix Submatrix
*/
public function getMatrixByRow($i0 = null, $iF = null)
{
if (is_int($i0)) {
if (is_int($iF)) {
return $this->getMatrix($i0, 0, $iF + 1, $this->n);
- } else {
- return $this->getMatrix($i0, 0, $i0 + 1, $this->n);
}
- } else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION);
+
+ return $this->getMatrix($i0, 0, $i0 + 1, $this->n);
}
+
+ throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
}
/**
- * getMatrixByCol
+ * getMatrixByCol.
*
* Get a submatrix by column index/range
- * @param int $i0 Initial column index
- * @param int $iF Final column index
- * @return Matrix Submatrix
+ *
+ * @param int $j0 Initial column index
+ * @param int $jF Final column index
+ *
+ * @return Matrix Submatrix
*/
public function getMatrixByCol($j0 = null, $jF = null)
{
if (is_int($j0)) {
if (is_int($jF)) {
return $this->getMatrix(0, $j0, $this->m, $jF + 1);
- } else {
- return $this->getMatrix(0, $j0, $this->m, $j0 + 1);
}
- } else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION);
+
+ return $this->getMatrix(0, $j0, $this->m, $j0 + 1);
}
+
+ throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
}
/**
- * transpose
+ * transpose.
*
* Tranpose matrix
- * @return Matrix Transposed matrix
+ *
+ * @return Matrix Transposed matrix
*/
public function transpose()
{
- $R = new PHPExcel_Shared_JAMA_Matrix($this->n, $this->m);
+ $R = new self($this->n, $this->m);
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
$R->set($j, $i, $this->A[$i][$j]);
}
}
+
return $R;
- } // function transpose()
+ }
+
+ // function transpose()
/**
- * trace
+ * trace.
*
* Sum of diagonal elements
- * @return float Sum of diagonal elements
+ *
+ * @return float Sum of diagonal elements
*/
public function trace()
{
@@ -446,45 +457,51 @@ class PHPExcel_Shared_JAMA_Matrix
for ($i = 0; $i < $n; ++$i) {
$s += $this->A[$i][$i];
}
+
return $s;
}
/**
- * uminus
+ * uminus.
*
* Unary minus matrix -A
- * @return Matrix Unary minus matrix
+ *
+ * @return Matrix Unary minus matrix
*/
public function uminus()
{
}
/**
- * plus
+ * plus.
*
* A + B
- * @param mixed $B Matrix/Array
- * @return Matrix Sum
+ *
+ * @param mixed $B Matrix/Array
+ *
+ * @return Matrix Sum
*/
- public function plus()
+ public function plus(...$args)
{
- if (func_num_args() > 0) {
- $args = func_get_args();
- $match = implode(",", array_map('gettype', $args));
+ if (count($args) > 0) {
+ $match = implode(',', array_map('gettype', $args));
switch ($match) {
case 'object':
- if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
+ if ($args[0] instanceof self) {
$M = $args[0];
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
}
+
break;
case 'array':
- $M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
+ $M = new self($args[0]);
+
break;
default:
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+
break;
}
$this->checkMatrixDimensions($M);
@@ -493,38 +510,43 @@ class PHPExcel_Shared_JAMA_Matrix
$M->set($i, $j, $M->get($i, $j) + $this->A[$i][$j]);
}
}
+
return $M;
- } else {
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
+
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
/**
- * plusEquals
+ * plusEquals.
*
* A = A + B
- * @param mixed $B Matrix/Array
- * @return Matrix Sum
+ *
+ * @param mixed $B Matrix/Array
+ *
+ * @return Matrix Sum
*/
- public function plusEquals()
+ public function plusEquals(...$args)
{
- if (func_num_args() > 0) {
- $args = func_get_args();
- $match = implode(",", array_map('gettype', $args));
+ if (count($args) > 0) {
+ $match = implode(',', array_map('gettype', $args));
switch ($match) {
case 'object':
- if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
+ if ($args[0] instanceof self) {
$M = $args[0];
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
}
+
break;
case 'array':
- $M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
+ $M = new self($args[0]);
+
break;
default:
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+
break;
}
$this->checkMatrixDimensions($M);
@@ -534,51 +556,56 @@ class PHPExcel_Shared_JAMA_Matrix
$value = $M->get($i, $j);
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
$this->A[$i][$j] = trim($this->A[$i][$j], '"');
- $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]);
+ $validValues &= StringHelper::convertToNumberIfFraction($this->A[$i][$j]);
}
if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
$value = trim($value, '"');
- $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value);
+ $validValues &= StringHelper::convertToNumberIfFraction($value);
}
if ($validValues) {
$this->A[$i][$j] += $value;
} else {
- $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN();
+ $this->A[$i][$j] = Functions::NAN();
}
}
}
+
return $this;
- } else {
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
+
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
/**
- * minus
+ * minus.
*
* A - B
- * @param mixed $B Matrix/Array
- * @return Matrix Sum
+ *
+ * @param mixed $B Matrix/Array
+ *
+ * @return Matrix Sum
*/
- public function minus()
+ public function minus(...$args)
{
- if (func_num_args() > 0) {
- $args = func_get_args();
- $match = implode(",", array_map('gettype', $args));
+ if (count($args) > 0) {
+ $match = implode(',', array_map('gettype', $args));
switch ($match) {
case 'object':
- if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
+ if ($args[0] instanceof self) {
$M = $args[0];
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
}
+
break;
case 'array':
- $M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
+ $M = new self($args[0]);
+
break;
default:
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+
break;
}
$this->checkMatrixDimensions($M);
@@ -587,38 +614,43 @@ class PHPExcel_Shared_JAMA_Matrix
$M->set($i, $j, $M->get($i, $j) - $this->A[$i][$j]);
}
}
+
return $M;
- } else {
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
+
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
/**
- * minusEquals
+ * minusEquals.
*
* A = A - B
- * @param mixed $B Matrix/Array
- * @return Matrix Sum
+ *
+ * @param mixed $B Matrix/Array
+ *
+ * @return Matrix Sum
*/
- public function minusEquals()
+ public function minusEquals(...$args)
{
- if (func_num_args() > 0) {
- $args = func_get_args();
- $match = implode(",", array_map('gettype', $args));
+ if (count($args) > 0) {
+ $match = implode(',', array_map('gettype', $args));
switch ($match) {
case 'object':
- if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
+ if ($args[0] instanceof self) {
$M = $args[0];
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
}
+
break;
case 'array':
- $M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
+ $M = new self($args[0]);
+
break;
default:
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+
break;
}
$this->checkMatrixDimensions($M);
@@ -628,52 +660,57 @@ class PHPExcel_Shared_JAMA_Matrix
$value = $M->get($i, $j);
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
$this->A[$i][$j] = trim($this->A[$i][$j], '"');
- $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]);
+ $validValues &= StringHelper::convertToNumberIfFraction($this->A[$i][$j]);
}
if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
$value = trim($value, '"');
- $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value);
+ $validValues &= StringHelper::convertToNumberIfFraction($value);
}
if ($validValues) {
$this->A[$i][$j] -= $value;
} else {
- $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN();
+ $this->A[$i][$j] = Functions::NAN();
}
}
}
+
return $this;
- } else {
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
+
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
/**
- * arrayTimes
+ * arrayTimes.
*
* Element-by-element multiplication
* Cij = Aij * Bij
- * @param mixed $B Matrix/Array
- * @return Matrix Matrix Cij
+ *
+ * @param mixed $B Matrix/Array
+ *
+ * @return Matrix Matrix Cij
*/
- public function arrayTimes()
+ public function arrayTimes(...$args)
{
- if (func_num_args() > 0) {
- $args = func_get_args();
- $match = implode(",", array_map('gettype', $args));
+ if (count($args) > 0) {
+ $match = implode(',', array_map('gettype', $args));
switch ($match) {
case 'object':
- if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
+ if ($args[0] instanceof self) {
$M = $args[0];
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
}
+
break;
case 'array':
- $M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
+ $M = new self($args[0]);
+
break;
default:
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+
break;
}
$this->checkMatrixDimensions($M);
@@ -682,39 +719,44 @@ class PHPExcel_Shared_JAMA_Matrix
$M->set($i, $j, $M->get($i, $j) * $this->A[$i][$j]);
}
}
+
return $M;
- } else {
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
+
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
/**
- * arrayTimesEquals
+ * arrayTimesEquals.
*
* Element-by-element multiplication
* Aij = Aij * Bij
- * @param mixed $B Matrix/Array
- * @return Matrix Matrix Aij
+ *
+ * @param mixed $B Matrix/Array
+ *
+ * @return Matrix Matrix Aij
*/
- public function arrayTimesEquals()
+ public function arrayTimesEquals(...$args)
{
- if (func_num_args() > 0) {
- $args = func_get_args();
- $match = implode(",", array_map('gettype', $args));
+ if (count($args) > 0) {
+ $match = implode(',', array_map('gettype', $args));
switch ($match) {
case 'object':
- if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
+ if ($args[0] instanceof self) {
$M = $args[0];
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
}
+
break;
case 'array':
- $M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
+ $M = new self($args[0]);
+
break;
default:
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+
break;
}
$this->checkMatrixDimensions($M);
@@ -724,52 +766,57 @@ class PHPExcel_Shared_JAMA_Matrix
$value = $M->get($i, $j);
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
$this->A[$i][$j] = trim($this->A[$i][$j], '"');
- $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]);
+ $validValues &= StringHelper::convertToNumberIfFraction($this->A[$i][$j]);
}
if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
$value = trim($value, '"');
- $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value);
+ $validValues &= StringHelper::convertToNumberIfFraction($value);
}
if ($validValues) {
$this->A[$i][$j] *= $value;
} else {
- $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN();
+ $this->A[$i][$j] = Functions::NAN();
}
}
}
+
return $this;
- } else {
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
+
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
/**
- * arrayRightDivide
+ * arrayRightDivide.
*
* Element-by-element right division
* A / B
- * @param Matrix $B Matrix B
- * @return Matrix Division result
+ *
+ * @param Matrix $B Matrix B
+ *
+ * @return Matrix Division result
*/
- public function arrayRightDivide()
+ public function arrayRightDivide(...$args)
{
- if (func_num_args() > 0) {
- $args = func_get_args();
- $match = implode(",", array_map('gettype', $args));
+ if (count($args) > 0) {
+ $match = implode(',', array_map('gettype', $args));
switch ($match) {
case 'object':
- if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
+ if ($args[0] instanceof self) {
$M = $args[0];
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
}
+
break;
case 'array':
- $M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
+ $M = new self($args[0]);
+
break;
default:
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+
break;
}
$this->checkMatrixDimensions($M);
@@ -779,11 +826,11 @@ class PHPExcel_Shared_JAMA_Matrix
$value = $M->get($i, $j);
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
$this->A[$i][$j] = trim($this->A[$i][$j], '"');
- $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]);
+ $validValues &= StringHelper::convertToNumberIfFraction($this->A[$i][$j]);
}
if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
$value = trim($value, '"');
- $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value);
+ $validValues &= StringHelper::convertToNumberIfFraction($value);
}
if ($validValues) {
if ($value == 0) {
@@ -793,44 +840,48 @@ class PHPExcel_Shared_JAMA_Matrix
$M->set($i, $j, $this->A[$i][$j] / $value);
}
} else {
- $M->set($i, $j, PHPExcel_Calculation_Functions::NaN());
+ $M->set($i, $j, Functions::NAN());
}
}
}
+
return $M;
- } else {
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
+
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
-
/**
- * arrayRightDivideEquals
+ * arrayRightDivideEquals.
*
* Element-by-element right division
* Aij = Aij / Bij
- * @param mixed $B Matrix/Array
- * @return Matrix Matrix Aij
+ *
+ * @param mixed $B Matrix/Array
+ *
+ * @return Matrix Matrix Aij
*/
- public function arrayRightDivideEquals()
+ public function arrayRightDivideEquals(...$args)
{
- if (func_num_args() > 0) {
- $args = func_get_args();
- $match = implode(",", array_map('gettype', $args));
+ if (count($args) > 0) {
+ $match = implode(',', array_map('gettype', $args));
switch ($match) {
case 'object':
- if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
+ if ($args[0] instanceof self) {
$M = $args[0];
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
}
+
break;
case 'array':
- $M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
+ $M = new self($args[0]);
+
break;
default:
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+
break;
}
$this->checkMatrixDimensions($M);
@@ -839,40 +890,44 @@ class PHPExcel_Shared_JAMA_Matrix
$this->A[$i][$j] = $this->A[$i][$j] / $M->get($i, $j);
}
}
+
return $M;
- } else {
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
+
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
-
/**
- * arrayLeftDivide
+ * arrayLeftDivide.
*
* Element-by-element Left division
* A / B
- * @param Matrix $B Matrix B
- * @return Matrix Division result
+ *
+ * @param Matrix $B Matrix B
+ *
+ * @return Matrix Division result
*/
- public function arrayLeftDivide()
+ public function arrayLeftDivide(...$args)
{
- if (func_num_args() > 0) {
- $args = func_get_args();
- $match = implode(",", array_map('gettype', $args));
+ if (count($args) > 0) {
+ $match = implode(',', array_map('gettype', $args));
switch ($match) {
case 'object':
- if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
+ if ($args[0] instanceof self) {
$M = $args[0];
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
}
+
break;
case 'array':
- $M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
+ $M = new self($args[0]);
+
break;
default:
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+
break;
}
$this->checkMatrixDimensions($M);
@@ -881,40 +936,44 @@ class PHPExcel_Shared_JAMA_Matrix
$M->set($i, $j, $M->get($i, $j) / $this->A[$i][$j]);
}
}
+
return $M;
- } else {
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
+
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
-
/**
- * arrayLeftDivideEquals
+ * arrayLeftDivideEquals.
*
* Element-by-element Left division
* Aij = Aij / Bij
- * @param mixed $B Matrix/Array
- * @return Matrix Matrix Aij
+ *
+ * @param mixed $B Matrix/Array
+ *
+ * @return Matrix Matrix Aij
*/
- public function arrayLeftDivideEquals()
+ public function arrayLeftDivideEquals(...$args)
{
- if (func_num_args() > 0) {
- $args = func_get_args();
- $match = implode(",", array_map('gettype', $args));
+ if (count($args) > 0) {
+ $match = implode(',', array_map('gettype', $args));
switch ($match) {
case 'object':
- if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
+ if ($args[0] instanceof self) {
$M = $args[0];
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
}
+
break;
case 'array':
- $M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
+ $M = new self($args[0]);
+
break;
default:
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+
break;
}
$this->checkMatrixDimensions($M);
@@ -923,36 +982,38 @@ class PHPExcel_Shared_JAMA_Matrix
$this->A[$i][$j] = $M->get($i, $j) / $this->A[$i][$j];
}
}
+
return $M;
- } else {
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
+
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
-
/**
- * times
+ * times.
*
* Matrix multiplication
- * @param mixed $n Matrix/Array/Scalar
- * @return Matrix Product
+ *
+ * @param mixed $n Matrix/Array/Scalar
+ *
+ * @return Matrix Product
*/
- public function times()
+ public function times(...$args)
{
- if (func_num_args() > 0) {
- $args = func_get_args();
- $match = implode(",", array_map('gettype', $args));
+ if (count($args) > 0) {
+ $match = implode(',', array_map('gettype', $args));
switch ($match) {
case 'object':
- if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
+ if ($args[0] instanceof self) {
$B = $args[0];
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
}
if ($this->n == $B->m) {
- $C = new PHPExcel_Shared_JAMA_Matrix($this->m, $B->n);
+ $C = new self($this->m, $B->n);
for ($j = 0; $j < $B->n; ++$j) {
+ $Bcolj = [];
for ($k = 0; $k < $this->n; ++$k) {
$Bcolj[$k] = $B->A[$k][$j];
}
@@ -965,92 +1026,94 @@ class PHPExcel_Shared_JAMA_Matrix
$C->A[$i][$j] = $s;
}
}
+
return $C;
- } else {
- throw new PHPExcel_Calculation_Exception(JAMAError(MatrixDimensionMismatch));
}
- break;
+
+ throw new CalculationException(self::MATRIX_DIMENSION_EXCEPTION);
case 'array':
- $B = new PHPExcel_Shared_JAMA_Matrix($args[0]);
+ $B = new self($args[0]);
if ($this->n == $B->m) {
- $C = new PHPExcel_Shared_JAMA_Matrix($this->m, $B->n);
+ $C = new self($this->m, $B->n);
for ($i = 0; $i < $C->m; ++$i) {
for ($j = 0; $j < $C->n; ++$j) {
- $s = "0";
+ $s = '0';
for ($k = 0; $k < $C->n; ++$k) {
$s += $this->A[$i][$k] * $B->A[$k][$j];
}
$C->A[$i][$j] = $s;
}
}
+
return $C;
- } else {
- throw new PHPExcel_Calculation_Exception(JAMAError(MatrixDimensionMismatch));
}
- return $M;
- break;
+
+ throw new CalculationException(self::MATRIX_DIMENSION_EXCEPTION);
case 'integer':
- $C = new PHPExcel_Shared_JAMA_Matrix($this->A);
+ $C = new self($this->A);
for ($i = 0; $i < $C->m; ++$i) {
for ($j = 0; $j < $C->n; ++$j) {
$C->A[$i][$j] *= $args[0];
}
}
+
return $C;
- break;
case 'double':
- $C = new PHPExcel_Shared_JAMA_Matrix($this->m, $this->n);
+ $C = new self($this->m, $this->n);
for ($i = 0; $i < $C->m; ++$i) {
for ($j = 0; $j < $C->n; ++$j) {
$C->A[$i][$j] = $args[0] * $this->A[$i][$j];
}
}
+
return $C;
- break;
case 'float':
- $C = new PHPExcel_Shared_JAMA_Matrix($this->A);
+ $C = new self($this->A);
for ($i = 0; $i < $C->m; ++$i) {
for ($j = 0; $j < $C->n; ++$j) {
$C->A[$i][$j] *= $args[0];
}
}
+
return $C;
- break;
default:
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
- break;
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
} else {
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
}
/**
- * power
+ * power.
*
* A = A ^ B
- * @param mixed $B Matrix/Array
- * @return Matrix Sum
+ *
+ * @param mixed $B Matrix/Array
+ *
+ * @return Matrix Sum
*/
- public function power()
+ public function power(...$args)
{
- if (func_num_args() > 0) {
- $args = func_get_args();
- $match = implode(",", array_map('gettype', $args));
+ if (count($args) > 0) {
+ $match = implode(',', array_map('gettype', $args));
switch ($match) {
case 'object':
- if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
+ if ($args[0] instanceof self) {
$M = $args[0];
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
}
+
break;
case 'array':
- $M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
+ $M = new self($args[0]);
+
break;
default:
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+
break;
}
$this->checkMatrixDimensions($M);
@@ -1060,85 +1123,94 @@ class PHPExcel_Shared_JAMA_Matrix
$value = $M->get($i, $j);
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
$this->A[$i][$j] = trim($this->A[$i][$j], '"');
- $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]);
+ $validValues &= StringHelper::convertToNumberIfFraction($this->A[$i][$j]);
}
if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
$value = trim($value, '"');
- $validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value);
+ $validValues &= StringHelper::convertToNumberIfFraction($value);
}
if ($validValues) {
$this->A[$i][$j] = pow($this->A[$i][$j], $value);
} else {
- $this->A[$i][$j] = PHPExcel_Calculation_Functions::NaN();
+ $this->A[$i][$j] = Functions::NAN();
}
}
}
+
return $this;
- } else {
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
+
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
/**
- * concat
+ * concat.
*
* A = A & B
- * @param mixed $B Matrix/Array
- * @return Matrix Sum
+ *
+ * @param mixed $B Matrix/Array
+ *
+ * @return Matrix Sum
*/
- public function concat()
+ public function concat(...$args)
{
- if (func_num_args() > 0) {
- $args = func_get_args();
- $match = implode(",", array_map('gettype', $args));
+ if (count($args) > 0) {
+ $match = implode(',', array_map('gettype', $args));
switch ($match) {
case 'object':
- if ($args[0] instanceof PHPExcel_Shared_JAMA_Matrix) {
+ if ($args[0] instanceof self) {
$M = $args[0];
} else {
- throw new PHPExcel_Calculation_Exception(self::ARGUMENT_TYPE_EXCEPTION);
+ throw new CalculationException(self::ARGUMENT_TYPE_EXCEPTION);
}
+
+ break;
case 'array':
- $M = new PHPExcel_Shared_JAMA_Matrix($args[0]);
+ $M = new self($args[0]);
+
break;
default:
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
+
break;
}
$this->checkMatrixDimensions($M);
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
- $this->A[$i][$j] = trim($this->A[$i][$j], '"').trim($M->get($i, $j), '"');
+ $this->A[$i][$j] = trim($this->A[$i][$j], '"') . trim($M->get($i, $j), '"');
}
}
+
return $this;
- } else {
- throw new PHPExcel_Calculation_Exception(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
+
+ throw new CalculationException(self::POLYMORPHIC_ARGUMENT_EXCEPTION);
}
/**
- * Solve A*X = B.
+ * Solve A*X = B.
*
- * @param Matrix $B Right hand side
- * @return Matrix ... Solution if A is square, least squares solution otherwise
+ * @param Matrix $B Right hand side
+ *
+ * @return Matrix ... Solution if A is square, least squares solution otherwise
*/
public function solve($B)
{
if ($this->m == $this->n) {
- $LU = new PHPExcel_Shared_JAMA_LUDecomposition($this);
+ $LU = new LUDecomposition($this);
+
return $LU->solve($B);
- } else {
- $QR = new PHPExcel_Shared_JAMA_QRDecomposition($this);
- return $QR->solve($B);
}
+ $QR = new QRDecomposition($this);
+
+ return $QR->solve($B);
}
/**
- * Matrix inverse or pseudoinverse.
+ * Matrix inverse or pseudoinverse.
*
- * @return Matrix ... Inverse(A) if A is square, pseudoinverse otherwise.
+ * @return Matrix ... Inverse(A) if A is square, pseudoinverse otherwise.
*/
public function inverse()
{
@@ -1146,14 +1218,16 @@ class PHPExcel_Shared_JAMA_Matrix
}
/**
- * det
+ * det.
*
* Calculate determinant
- * @return float Determinant
+ *
+ * @return float Determinant
*/
public function det()
{
- $L = new PHPExcel_Shared_JAMA_LUDecomposition($this);
+ $L = new LUDecomposition($this);
+
return $L->det();
}
}
diff --git a/lib/phpexcel/PHPExcel/Shared/JAMA/QRDecomposition.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php
similarity index 62%
rename from lib/phpexcel/PHPExcel/Shared/JAMA/QRDecomposition.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php
index 1e43c7c43db..e666d74b6a3 100644
--- a/lib/phpexcel/PHPExcel/Shared/JAMA/QRDecomposition.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/QRDecomposition.php
@@ -1,7 +1,10 @@
= n, the QR decomposition is an m-by-n
* orthogonal matrix Q and an n-by-n upper triangular matrix R so that
* A = Q*R.
@@ -13,51 +16,53 @@
* returns false.
*
* @author Paul Meagher
- * @license PHP v3.0
+ *
* @version 1.1
*/
-class PHPExcel_Shared_JAMA_QRDecomposition
+class QRDecomposition
{
- const MATRIX_RANK_EXCEPTION = "Can only perform operation on full-rank matrix.";
+ const MATRIX_RANK_EXCEPTION = 'Can only perform operation on full-rank matrix.';
/**
- * Array for internal storage of decomposition.
- * @var array
+ * Array for internal storage of decomposition.
+ *
+ * @var array
*/
- private $QR = array();
+ private $QR = [];
/**
- * Row dimension.
- * @var integer
+ * Row dimension.
+ *
+ * @var int
*/
private $m;
/**
- * Column dimension.
- * @var integer
- */
+ * Column dimension.
+ *
+ * @var int
+ */
private $n;
/**
- * Array for internal storage of diagonal of R.
- * @var array
+ * Array for internal storage of diagonal of R.
+ *
+ * @var array
*/
- private $Rdiag = array();
-
+ private $Rdiag = [];
/**
- * QR Decomposition computed by Householder reflections.
+ * QR Decomposition computed by Householder reflections.
*
- * @param matrix $A Rectangular matrix
- * @return Structure to access R and the Householder vectors and compute Q.
+ * @param matrix $A Rectangular matrix
*/
public function __construct($A)
{
- if ($A instanceof PHPExcel_Shared_JAMA_Matrix) {
+ if ($A instanceof Matrix) {
// Initialize.
$this->QR = $A->getArrayCopy();
- $this->m = $A->getRowDimension();
- $this->n = $A->getColumnDimension();
+ $this->m = $A->getRowDimension();
+ $this->n = $A->getColumnDimension();
// Main loop.
for ($k = 0; $k < $this->n; ++$k) {
// Compute 2-norm of k-th column without under/overflow.
@@ -75,12 +80,12 @@ class PHPExcel_Shared_JAMA_QRDecomposition
}
$this->QR[$k][$k] += 1.0;
// Apply transformation to remaining columns.
- for ($j = $k+1; $j < $this->n; ++$j) {
+ for ($j = $k + 1; $j < $this->n; ++$j) {
$s = 0.0;
for ($i = $k; $i < $this->m; ++$i) {
$s += $this->QR[$i][$k] * $this->QR[$i][$j];
}
- $s = -$s/$this->QR[$k][$k];
+ $s = -$s / $this->QR[$k][$k];
for ($i = $k; $i < $this->m; ++$i) {
$this->QR[$i][$j] += $s * $this->QR[$i][$k];
}
@@ -89,15 +94,16 @@ class PHPExcel_Shared_JAMA_QRDecomposition
$this->Rdiag[$k] = -$nrm;
}
} else {
- throw new PHPExcel_Calculation_Exception(PHPExcel_Shared_JAMA_Matrix::ARGUMENT_TYPE_EXCEPTION);
+ throw new CalculationException(Matrix::ARGUMENT_TYPE_EXCEPTION);
}
- } // function __construct()
+ }
+ // function __construct()
/**
* Is the matrix full rank?
*
- * @return boolean true if R, and hence A, has full rank, else false.
+ * @return bool true if R, and hence A, has full rank, else false
*/
public function isFullRank()
{
@@ -106,16 +112,20 @@ class PHPExcel_Shared_JAMA_QRDecomposition
return false;
}
}
+
return true;
- } // function isFullRank()
+ }
+
+ // function isFullRank()
/**
- * Return the Householder vectors
+ * Return the Householder vectors.
*
- * @return Matrix Lower trapezoidal matrix whose columns define the reflections
+ * @return Matrix Lower trapezoidal matrix whose columns define the reflections
*/
public function getH()
{
+ $H = [];
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
if ($i >= $j) {
@@ -125,16 +135,20 @@ class PHPExcel_Shared_JAMA_QRDecomposition
}
}
}
- return new PHPExcel_Shared_JAMA_Matrix($H);
- } // function getH()
+
+ return new Matrix($H);
+ }
+
+ // function getH()
/**
- * Return the upper triangular factor
+ * Return the upper triangular factor.
*
- * @return Matrix upper triangular factor
+ * @return Matrix upper triangular factor
*/
public function getR()
{
+ $R = [];
for ($i = 0; $i < $this->n; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
if ($i < $j) {
@@ -146,17 +160,21 @@ class PHPExcel_Shared_JAMA_QRDecomposition
}
}
}
- return new PHPExcel_Shared_JAMA_Matrix($R);
- } // function getR()
+
+ return new Matrix($R);
+ }
+
+ // function getR()
/**
- * Generate and return the (economy-sized) orthogonal factor
+ * Generate and return the (economy-sized) orthogonal factor.
*
- * @return Matrix orthogonal factor
+ * @return Matrix orthogonal factor
*/
public function getQ()
{
- for ($k = $this->n-1; $k >= 0; --$k) {
+ $Q = [];
+ for ($k = $this->n - 1; $k >= 0; --$k) {
for ($i = 0; $i < $this->m; ++$i) {
$Q[$i][$k] = 0.0;
}
@@ -167,30 +185,25 @@ class PHPExcel_Shared_JAMA_QRDecomposition
for ($i = $k; $i < $this->m; ++$i) {
$s += $this->QR[$i][$k] * $Q[$i][$j];
}
- $s = -$s/$this->QR[$k][$k];
+ $s = -$s / $this->QR[$k][$k];
for ($i = $k; $i < $this->m; ++$i) {
$Q[$i][$j] += $s * $this->QR[$i][$k];
}
}
}
}
- /*
- for($i = 0; $i < count($Q); ++$i) {
- for($j = 0; $j < count($Q); ++$j) {
- if (! isset($Q[$i][$j]) ) {
- $Q[$i][$j] = 0;
- }
- }
- }
- */
- return new PHPExcel_Shared_JAMA_Matrix($Q);
- } // function getQ()
+
+ return new Matrix($Q);
+ }
+
+ // function getQ()
/**
- * Least squares solution of A*X = B
+ * Least squares solution of A*X = B.
*
- * @param Matrix $B A Matrix with as many rows as A and any number of columns.
- * @return Matrix Matrix that minimizes the two norm of Q*R*X-B.
+ * @param Matrix $B a Matrix with as many rows as A and any number of columns
+ *
+ * @return Matrix matrix that minimizes the two norm of Q*R*X-B
*/
public function solve($B)
{
@@ -198,7 +211,7 @@ class PHPExcel_Shared_JAMA_QRDecomposition
if ($this->isFullRank()) {
// Copy right hand side
$nx = $B->getColumnDimension();
- $X = $B->getArrayCopy();
+ $X = $B->getArrayCopy();
// Compute Y = transpose(Q)*B
for ($k = 0; $k < $this->n; ++$k) {
for ($j = 0; $j < $nx; ++$j) {
@@ -206,30 +219,31 @@ class PHPExcel_Shared_JAMA_QRDecomposition
for ($i = $k; $i < $this->m; ++$i) {
$s += $this->QR[$i][$k] * $X[$i][$j];
}
- $s = -$s/$this->QR[$k][$k];
+ $s = -$s / $this->QR[$k][$k];
for ($i = $k; $i < $this->m; ++$i) {
$X[$i][$j] += $s * $this->QR[$i][$k];
}
}
}
// Solve R*X = Y;
- for ($k = $this->n-1; $k >= 0; --$k) {
+ for ($k = $this->n - 1; $k >= 0; --$k) {
for ($j = 0; $j < $nx; ++$j) {
$X[$k][$j] /= $this->Rdiag[$k];
}
for ($i = 0; $i < $k; ++$i) {
for ($j = 0; $j < $nx; ++$j) {
- $X[$i][$j] -= $X[$k][$j]* $this->QR[$i][$k];
+ $X[$i][$j] -= $X[$k][$j] * $this->QR[$i][$k];
}
}
}
- $X = new PHPExcel_Shared_JAMA_Matrix($X);
- return ($X->getMatrix(0, $this->n-1, 0, $nx));
- } else {
- throw new PHPExcel_Calculation_Exception(self::MATRIX_RANK_EXCEPTION);
+ $X = new Matrix($X);
+
+ return $X->getMatrix(0, $this->n - 1, 0, $nx);
}
- } else {
- throw new PHPExcel_Calculation_Exception(PHPExcel_Shared_JAMA_Matrix::MATRIX_DIMENSION_EXCEPTION);
+
+ throw new CalculationException(self::MATRIX_RANK_EXCEPTION);
}
+
+ throw new CalculationException(Matrix::MATRIX_DIMENSION_EXCEPTION);
}
}
diff --git a/lib/phpexcel/PHPExcel/Shared/JAMA/SingularValueDecomposition.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php
similarity index 74%
rename from lib/phpexcel/PHPExcel/Shared/JAMA/SingularValueDecomposition.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php
index f57d122cef4..3ca95619c86 100644
--- a/lib/phpexcel/PHPExcel/Shared/JAMA/SingularValueDecomposition.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/SingularValueDecomposition.php
@@ -1,7 +1,8 @@
= n, the singular value decomposition is
* an m-by-n orthogonal matrix U, an n-by-n diagonal matrix S, and
* an n-by-n orthogonal matrix V so that A = U*S*V'.
@@ -14,48 +15,52 @@
* rank can be computed from this decomposition.
*
* @author Paul Meagher
- * @license PHP v3.0
+ *
* @version 1.1
*/
class SingularValueDecomposition
{
/**
- * Internal storage of U.
- * @var array
+ * Internal storage of U.
+ *
+ * @var array
*/
- private $U = array();
+ private $U = [];
/**
- * Internal storage of V.
- * @var array
+ * Internal storage of V.
+ *
+ * @var array
*/
- private $V = array();
+ private $V = [];
/**
- * Internal storage of singular values.
- * @var array
+ * Internal storage of singular values.
+ *
+ * @var array
*/
- private $s = array();
+ private $s = [];
/**
- * Row dimension.
- * @var int
+ * Row dimension.
+ *
+ * @var int
*/
private $m;
/**
- * Column dimension.
- * @var int
+ * Column dimension.
+ *
+ * @var int
*/
private $n;
/**
- * Construct the singular value decomposition
+ * Construct the singular value decomposition.
*
- * Derived from LINPACK code.
+ * Derived from LINPACK code.
*
- * @param $A Rectangular matrix
- * @return Structure to access U, S and V.
+ * @param mixed $Arg Rectangular matrix
*/
public function __construct($Arg)
{
@@ -63,17 +68,18 @@ class SingularValueDecomposition
$A = $Arg->getArrayCopy();
$this->m = $Arg->getRowDimension();
$this->n = $Arg->getColumnDimension();
- $nu = min($this->m, $this->n);
- $e = array();
- $work = array();
- $wantu = true;
- $wantv = true;
+ $nu = min($this->m, $this->n);
+ $e = [];
+ $work = [];
+ $wantu = true;
+ $wantv = true;
$nct = min($this->m - 1, $this->n);
$nrt = max(0, min($this->n - 2, $this->m));
// Reduce A to bidiagonal form, storing the diagonal elements
// in s and the super-diagonal elements in e.
- for ($k = 0; $k < max($nct, $nrt); ++$k) {
+ $kMax = max($nct, $nrt);
+ for ($k = 0; $k < $kMax; ++$k) {
if ($k < $nct) {
// Compute the transformation for the k-th column and
// place the k-th diagonal in s[$k].
@@ -128,27 +134,27 @@ class SingularValueDecomposition
$e[$k] = hypo($e[$k], $e[$i]);
}
if ($e[$k] != 0.0) {
- if ($e[$k+1] < 0.0) {
+ if ($e[$k + 1] < 0.0) {
$e[$k] = -$e[$k];
}
for ($i = $k + 1; $i < $this->n; ++$i) {
$e[$i] /= $e[$k];
}
- $e[$k+1] += 1.0;
+ $e[$k + 1] += 1.0;
}
$e[$k] = -$e[$k];
- if (($k+1 < $this->m) and ($e[$k] != 0.0)) {
+ if (($k + 1 < $this->m) and ($e[$k] != 0.0)) {
// Apply the transformation.
- for ($i = $k+1; $i < $this->m; ++$i) {
+ for ($i = $k + 1; $i < $this->m; ++$i) {
$work[$i] = 0.0;
}
- for ($j = $k+1; $j < $this->n; ++$j) {
- for ($i = $k+1; $i < $this->m; ++$i) {
+ for ($j = $k + 1; $j < $this->n; ++$j) {
+ for ($i = $k + 1; $i < $this->m; ++$i) {
$work[$i] += $e[$j] * $A[$i][$j];
}
}
for ($j = $k + 1; $j < $this->n; ++$j) {
- $t = -$e[$j] / $e[$k+1];
+ $t = -$e[$j] / $e[$k + 1];
for ($i = $k + 1; $i < $this->m; ++$i) {
$A[$i][$j] += $t * $work[$i];
}
@@ -170,12 +176,12 @@ class SingularValueDecomposition
$this->s[$nct] = $A[$nct][$nct];
}
if ($this->m < $p) {
- $this->s[$p-1] = 0.0;
+ $this->s[$p - 1] = 0.0;
}
if ($nrt + 1 < $p) {
- $e[$nrt] = $A[$nrt][$p-1];
+ $e[$nrt] = $A[$nrt][$p - 1];
}
- $e[$p-1] = 0.0;
+ $e[$p - 1] = 0.0;
// If required, generate U.
if ($wantu) {
for ($j = $nct; $j < $nu; ++$j) {
@@ -219,9 +225,9 @@ class SingularValueDecomposition
for ($j = $k + 1; $j < $nu; ++$j) {
$t = 0;
for ($i = $k + 1; $i < $this->n; ++$i) {
- $t += $this->V[$i][$k]* $this->V[$i][$j];
+ $t += $this->V[$i][$k] * $this->V[$i][$j];
}
- $t = -$t / $this->V[$k+1][$k];
+ $t = -$t / $this->V[$k + 1][$k];
for ($i = $k + 1; $i < $this->n; ++$i) {
$this->V[$i][$j] += $t * $this->V[$i][$k];
}
@@ -235,9 +241,9 @@ class SingularValueDecomposition
}
// Main iteration loop for the singular values.
- $pp = $p - 1;
+ $pp = $p - 1;
$iter = 0;
- $eps = pow(2.0, -52.0);
+ $eps = pow(2.0, -52.0);
while ($p > 0) {
// Here is where a test for too many iterations would go.
@@ -253,8 +259,9 @@ class SingularValueDecomposition
if ($k == -1) {
break;
}
- if (abs($e[$k]) <= $eps * (abs($this->s[$k]) + abs($this->s[$k+1]))) {
+ if (abs($e[$k]) <= $eps * (abs($this->s[$k]) + abs($this->s[$k + 1]))) {
$e[$k] = 0.0;
+
break;
}
}
@@ -265,15 +272,16 @@ class SingularValueDecomposition
if ($ks == $k) {
break;
}
- $t = ($ks != $p ? abs($e[$ks]) : 0.) + ($ks != $k + 1 ? abs($e[$ks-1]) : 0.);
+ $t = ($ks != $p ? abs($e[$ks]) : 0.) + ($ks != $k + 1 ? abs($e[$ks - 1]) : 0.);
if (abs($this->s[$ks]) <= $eps * $t) {
$this->s[$ks] = 0.0;
+
break;
}
}
if ($ks == $k) {
$kase = 3;
- } elseif ($ks == $p-1) {
+ } elseif ($ks == $p - 1) {
$kase = 1;
} else {
$kase = 2;
@@ -286,30 +294,31 @@ class SingularValueDecomposition
switch ($kase) {
// Deflate negligible s(p).
case 1:
- $f = $e[$p-2];
- $e[$p-2] = 0.0;
+ $f = $e[$p - 2];
+ $e[$p - 2] = 0.0;
for ($j = $p - 2; $j >= $k; --$j) {
- $t = hypo($this->s[$j], $f);
+ $t = hypo($this->s[$j], $f);
$cs = $this->s[$j] / $t;
$sn = $f / $t;
$this->s[$j] = $t;
if ($j != $k) {
- $f = -$sn * $e[$j-1];
- $e[$j-1] = $cs * $e[$j-1];
+ $f = -$sn * $e[$j - 1];
+ $e[$j - 1] = $cs * $e[$j - 1];
}
if ($wantv) {
for ($i = 0; $i < $this->n; ++$i) {
- $t = $cs * $this->V[$i][$j] + $sn * $this->V[$i][$p-1];
- $this->V[$i][$p-1] = -$sn * $this->V[$i][$j] + $cs * $this->V[$i][$p-1];
+ $t = $cs * $this->V[$i][$j] + $sn * $this->V[$i][$p - 1];
+ $this->V[$i][$p - 1] = -$sn * $this->V[$i][$j] + $cs * $this->V[$i][$p - 1];
$this->V[$i][$j] = $t;
}
}
}
+
break;
// Split at negligible s(k).
case 2:
- $f = $e[$k-1];
- $e[$k-1] = 0.0;
+ $f = $e[$k - 1];
+ $e[$k - 1] = 0.0;
for ($j = $k; $j < $p; ++$j) {
$t = hypo($this->s[$j], $f);
$cs = $this->s[$j] / $t;
@@ -319,24 +328,25 @@ class SingularValueDecomposition
$e[$j] = $cs * $e[$j];
if ($wantu) {
for ($i = 0; $i < $this->m; ++$i) {
- $t = $cs * $this->U[$i][$j] + $sn * $this->U[$i][$k-1];
- $this->U[$i][$k-1] = -$sn * $this->U[$i][$j] + $cs * $this->U[$i][$k-1];
+ $t = $cs * $this->U[$i][$j] + $sn * $this->U[$i][$k - 1];
+ $this->U[$i][$k - 1] = -$sn * $this->U[$i][$j] + $cs * $this->U[$i][$k - 1];
$this->U[$i][$j] = $t;
}
}
}
+
break;
// Perform one qr step.
case 3:
// Calculate the shift.
- $scale = max(max(max(max(abs($this->s[$p-1]), abs($this->s[$p-2])), abs($e[$p-2])), abs($this->s[$k])), abs($e[$k]));
- $sp = $this->s[$p-1] / $scale;
- $spm1 = $this->s[$p-2] / $scale;
- $epm1 = $e[$p-2] / $scale;
- $sk = $this->s[$k] / $scale;
- $ek = $e[$k] / $scale;
- $b = (($spm1 + $sp) * ($spm1 - $sp) + $epm1 * $epm1) / 2.0;
- $c = ($sp * $epm1) * ($sp * $epm1);
+ $scale = max(max(max(max(abs($this->s[$p - 1]), abs($this->s[$p - 2])), abs($e[$p - 2])), abs($this->s[$k])), abs($e[$k]));
+ $sp = $this->s[$p - 1] / $scale;
+ $spm1 = $this->s[$p - 2] / $scale;
+ $epm1 = $e[$p - 2] / $scale;
+ $sk = $this->s[$k] / $scale;
+ $ek = $e[$k] / $scale;
+ $b = (($spm1 + $sp) * ($spm1 - $sp) + $epm1 * $epm1) / 2.0;
+ $c = ($sp * $epm1) * ($sp * $epm1);
$shift = 0.0;
if (($b != 0.0) || ($c != 0.0)) {
$shift = sqrt($b * $b + $c);
@@ -348,42 +358,43 @@ class SingularValueDecomposition
$f = ($sk + $sp) * ($sk - $sp) + $shift;
$g = $sk * $ek;
// Chase zeros.
- for ($j = $k; $j < $p-1; ++$j) {
- $t = hypo($f, $g);
- $cs = $f/$t;
- $sn = $g/$t;
+ for ($j = $k; $j < $p - 1; ++$j) {
+ $t = hypo($f, $g);
+ $cs = $f / $t;
+ $sn = $g / $t;
if ($j != $k) {
- $e[$j-1] = $t;
+ $e[$j - 1] = $t;
}
$f = $cs * $this->s[$j] + $sn * $e[$j];
$e[$j] = $cs * $e[$j] - $sn * $this->s[$j];
- $g = $sn * $this->s[$j+1];
- $this->s[$j+1] = $cs * $this->s[$j+1];
+ $g = $sn * $this->s[$j + 1];
+ $this->s[$j + 1] = $cs * $this->s[$j + 1];
if ($wantv) {
for ($i = 0; $i < $this->n; ++$i) {
- $t = $cs * $this->V[$i][$j] + $sn * $this->V[$i][$j+1];
- $this->V[$i][$j+1] = -$sn * $this->V[$i][$j] + $cs * $this->V[$i][$j+1];
+ $t = $cs * $this->V[$i][$j] + $sn * $this->V[$i][$j + 1];
+ $this->V[$i][$j + 1] = -$sn * $this->V[$i][$j] + $cs * $this->V[$i][$j + 1];
$this->V[$i][$j] = $t;
}
}
$t = hypo($f, $g);
- $cs = $f/$t;
- $sn = $g/$t;
+ $cs = $f / $t;
+ $sn = $g / $t;
$this->s[$j] = $t;
- $f = $cs * $e[$j] + $sn * $this->s[$j+1];
- $this->s[$j+1] = -$sn * $e[$j] + $cs * $this->s[$j+1];
- $g = $sn * $e[$j+1];
- $e[$j+1] = $cs * $e[$j+1];
+ $f = $cs * $e[$j] + $sn * $this->s[$j + 1];
+ $this->s[$j + 1] = -$sn * $e[$j] + $cs * $this->s[$j + 1];
+ $g = $sn * $e[$j + 1];
+ $e[$j + 1] = $cs * $e[$j + 1];
if ($wantu && ($j < $this->m - 1)) {
for ($i = 0; $i < $this->m; ++$i) {
- $t = $cs * $this->U[$i][$j] + $sn * $this->U[$i][$j+1];
- $this->U[$i][$j+1] = -$sn * $this->U[$i][$j] + $cs * $this->U[$i][$j+1];
+ $t = $cs * $this->U[$i][$j] + $sn * $this->U[$i][$j + 1];
+ $this->U[$i][$j + 1] = -$sn * $this->U[$i][$j] + $cs * $this->U[$i][$j + 1];
$this->U[$i][$j] = $t;
}
}
}
- $e[$p-2] = $f;
+ $e[$p - 2] = $f;
$iter = $iter + 1;
+
break;
// Convergence.
case 4:
@@ -398,23 +409,23 @@ class SingularValueDecomposition
}
// Order the singular values.
while ($k < $pp) {
- if ($this->s[$k] >= $this->s[$k+1]) {
+ if ($this->s[$k] >= $this->s[$k + 1]) {
break;
}
$t = $this->s[$k];
- $this->s[$k] = $this->s[$k+1];
- $this->s[$k+1] = $t;
+ $this->s[$k] = $this->s[$k + 1];
+ $this->s[$k + 1] = $t;
if ($wantv and ($k < $this->n - 1)) {
for ($i = 0; $i < $this->n; ++$i) {
- $t = $this->V[$i][$k+1];
- $this->V[$i][$k+1] = $this->V[$i][$k];
+ $t = $this->V[$i][$k + 1];
+ $this->V[$i][$k + 1] = $this->V[$i][$k];
$this->V[$i][$k] = $t;
}
}
- if ($wantu and ($k < $this->m-1)) {
+ if ($wantu and ($k < $this->m - 1)) {
for ($i = 0; $i < $this->m; ++$i) {
- $t = $this->U[$i][$k+1];
- $this->U[$i][$k+1] = $this->U[$i][$k];
+ $t = $this->U[$i][$k + 1];
+ $this->U[$i][$k + 1] = $this->U[$i][$k];
$this->U[$i][$k] = $t;
}
}
@@ -422,54 +433,46 @@ class SingularValueDecomposition
}
$iter = 0;
--$p;
+
break;
} // end switch
} // end while
-
- } // end constructor
-
+ }
/**
- * Return the left singular vectors
+ * Return the left singular vectors.
*
- * @access public
- * @return U
+ * @return Matrix U
*/
public function getU()
{
return new Matrix($this->U, $this->m, min($this->m + 1, $this->n));
}
-
/**
- * Return the right singular vectors
+ * Return the right singular vectors.
*
- * @access public
- * @return V
+ * @return Matrix V
*/
public function getV()
{
return new Matrix($this->V);
}
-
/**
- * Return the one-dimensional array of singular values
+ * Return the one-dimensional array of singular values.
*
- * @access public
- * @return diagonal of S.
+ * @return array diagonal of S
*/
public function getSingularValues()
{
return $this->s;
}
-
/**
- * Return the diagonal matrix of singular values
+ * Return the diagonal matrix of singular values.
*
- * @access public
- * @return S
+ * @return Matrix S
*/
public function getS()
{
@@ -479,50 +482,47 @@ class SingularValueDecomposition
}
$S[$i][$i] = $this->s[$i];
}
+
return new Matrix($S);
}
-
/**
- * Two norm
+ * Two norm.
*
- * @access public
- * @return max(S)
+ * @return float max(S)
*/
public function norm2()
{
return $this->s[0];
}
-
/**
- * Two norm condition number
+ * Two norm condition number.
*
- * @access public
- * @return max(S)/min(S)
+ * @return float max(S)/min(S)
*/
public function cond()
{
return $this->s[0] / $this->s[min($this->m, $this->n) - 1];
}
-
/**
- * Effective numerical matrix rank
+ * Effective numerical matrix rank.
*
- * @access public
- * @return Number of nonnegligible singular values.
+ * @return int Number of nonnegligible singular values
*/
public function rank()
{
$eps = pow(2.0, -52.0);
$tol = max($this->m, $this->n) * $this->s[0] * $eps;
$r = 0;
- for ($i = 0; $i < count($this->s); ++$i) {
+ $iMax = count($this->s);
+ for ($i = 0; $i < $iMax; ++$i) {
if ($this->s[$i] > $tol) {
++$r;
}
}
+
return $r;
}
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/utils/Maths.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/utils/Maths.php
new file mode 100644
index 00000000000..68c3864932c
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/JAMA/utils/Maths.php
@@ -0,0 +1,30 @@
+ abs($b)) {
+ $r = $b / $a;
+ $r = abs($a) * sqrt(1 + $r * $r);
+ } elseif ($b != 0) {
+ $r = $a / $b;
+ $r = abs($b) * sqrt(1 + $r * $r);
+ } else {
+ $r = 0.0;
+ }
+
+ return $r;
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/PasswordHasher.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/PasswordHasher.php
new file mode 100644
index 00000000000..9b0080b9dbf
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/PasswordHasher.php
@@ -0,0 +1,37 @@
+.
+ *
+ * @param string $pPassword Password to hash
+ *
+ * @return string Hashed password
+ */
+ public static function hashPassword($pPassword)
+ {
+ $password = 0x0000;
+ $charPos = 1; // char position
+
+ // split the plain text password in its component characters
+ $chars = preg_split('//', $pPassword, -1, PREG_SPLIT_NO_EMPTY);
+ foreach ($chars as $char) {
+ $value = ord($char) << $charPos++; // shifted ASCII value
+ $rotated_bits = $value >> 15; // rotated bits beyond bit 15
+ $value &= 0x7fff; // first 15 bits
+ $password ^= ($value | $rotated_bits);
+ }
+
+ $password ^= strlen($pPassword);
+ $password ^= 0xCE4B;
+
+ return strtoupper(dechex($password));
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/StringHelper.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/StringHelper.php
new file mode 100644
index 00000000000..a5702775074
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/StringHelper.php
@@ -0,0 +1,724 @@
+ chr(0),
+ "\x1B 1" => chr(1),
+ "\x1B 2" => chr(2),
+ "\x1B 3" => chr(3),
+ "\x1B 4" => chr(4),
+ "\x1B 5" => chr(5),
+ "\x1B 6" => chr(6),
+ "\x1B 7" => chr(7),
+ "\x1B 8" => chr(8),
+ "\x1B 9" => chr(9),
+ "\x1B :" => chr(10),
+ "\x1B ;" => chr(11),
+ "\x1B <" => chr(12),
+ "\x1B =" => chr(13),
+ "\x1B >" => chr(14),
+ "\x1B ?" => chr(15),
+ "\x1B!0" => chr(16),
+ "\x1B!1" => chr(17),
+ "\x1B!2" => chr(18),
+ "\x1B!3" => chr(19),
+ "\x1B!4" => chr(20),
+ "\x1B!5" => chr(21),
+ "\x1B!6" => chr(22),
+ "\x1B!7" => chr(23),
+ "\x1B!8" => chr(24),
+ "\x1B!9" => chr(25),
+ "\x1B!:" => chr(26),
+ "\x1B!;" => chr(27),
+ "\x1B!<" => chr(28),
+ "\x1B!=" => chr(29),
+ "\x1B!>" => chr(30),
+ "\x1B!?" => chr(31),
+ "\x1B'?" => chr(127),
+ "\x1B(0" => '€', // 128 in CP1252
+ "\x1B(2" => '‚', // 130 in CP1252
+ "\x1B(3" => 'ƒ', // 131 in CP1252
+ "\x1B(4" => '„', // 132 in CP1252
+ "\x1B(5" => '…', // 133 in CP1252
+ "\x1B(6" => '†', // 134 in CP1252
+ "\x1B(7" => '‡', // 135 in CP1252
+ "\x1B(8" => 'ˆ', // 136 in CP1252
+ "\x1B(9" => '‰', // 137 in CP1252
+ "\x1B(:" => 'Š', // 138 in CP1252
+ "\x1B(;" => '‹', // 139 in CP1252
+ "\x1BNj" => 'Œ', // 140 in CP1252
+ "\x1B(>" => 'Ž', // 142 in CP1252
+ "\x1B)1" => '‘', // 145 in CP1252
+ "\x1B)2" => '’', // 146 in CP1252
+ "\x1B)3" => '“', // 147 in CP1252
+ "\x1B)4" => '”', // 148 in CP1252
+ "\x1B)5" => '•', // 149 in CP1252
+ "\x1B)6" => '–', // 150 in CP1252
+ "\x1B)7" => '—', // 151 in CP1252
+ "\x1B)8" => '˜', // 152 in CP1252
+ "\x1B)9" => '™', // 153 in CP1252
+ "\x1B):" => 'š', // 154 in CP1252
+ "\x1B);" => '›', // 155 in CP1252
+ "\x1BNz" => 'œ', // 156 in CP1252
+ "\x1B)>" => 'ž', // 158 in CP1252
+ "\x1B)?" => 'Ÿ', // 159 in CP1252
+ "\x1B*0" => ' ', // 160 in CP1252
+ "\x1BN!" => '¡', // 161 in CP1252
+ "\x1BN\"" => '¢', // 162 in CP1252
+ "\x1BN#" => '£', // 163 in CP1252
+ "\x1BN(" => '¤', // 164 in CP1252
+ "\x1BN%" => '¥', // 165 in CP1252
+ "\x1B*6" => '¦', // 166 in CP1252
+ "\x1BN'" => '§', // 167 in CP1252
+ "\x1BNH " => '¨', // 168 in CP1252
+ "\x1BNS" => '©', // 169 in CP1252
+ "\x1BNc" => 'ª', // 170 in CP1252
+ "\x1BN+" => '«', // 171 in CP1252
+ "\x1B*<" => '¬', // 172 in CP1252
+ "\x1B*=" => '', // 173 in CP1252
+ "\x1BNR" => '®', // 174 in CP1252
+ "\x1B*?" => '¯', // 175 in CP1252
+ "\x1BN0" => '°', // 176 in CP1252
+ "\x1BN1" => '±', // 177 in CP1252
+ "\x1BN2" => '²', // 178 in CP1252
+ "\x1BN3" => '³', // 179 in CP1252
+ "\x1BNB " => '´', // 180 in CP1252
+ "\x1BN5" => 'µ', // 181 in CP1252
+ "\x1BN6" => '¶', // 182 in CP1252
+ "\x1BN7" => '·', // 183 in CP1252
+ "\x1B+8" => '¸', // 184 in CP1252
+ "\x1BNQ" => '¹', // 185 in CP1252
+ "\x1BNk" => 'º', // 186 in CP1252
+ "\x1BN;" => '»', // 187 in CP1252
+ "\x1BN<" => '¼', // 188 in CP1252
+ "\x1BN=" => '½', // 189 in CP1252
+ "\x1BN>" => '¾', // 190 in CP1252
+ "\x1BN?" => '¿', // 191 in CP1252
+ "\x1BNAA" => 'À', // 192 in CP1252
+ "\x1BNBA" => 'Á', // 193 in CP1252
+ "\x1BNCA" => 'Â', // 194 in CP1252
+ "\x1BNDA" => 'Ã', // 195 in CP1252
+ "\x1BNHA" => 'Ä', // 196 in CP1252
+ "\x1BNJA" => 'Å', // 197 in CP1252
+ "\x1BNa" => 'Æ', // 198 in CP1252
+ "\x1BNKC" => 'Ç', // 199 in CP1252
+ "\x1BNAE" => 'È', // 200 in CP1252
+ "\x1BNBE" => 'É', // 201 in CP1252
+ "\x1BNCE" => 'Ê', // 202 in CP1252
+ "\x1BNHE" => 'Ë', // 203 in CP1252
+ "\x1BNAI" => 'Ì', // 204 in CP1252
+ "\x1BNBI" => 'Í', // 205 in CP1252
+ "\x1BNCI" => 'Î', // 206 in CP1252
+ "\x1BNHI" => 'Ï', // 207 in CP1252
+ "\x1BNb" => 'Ð', // 208 in CP1252
+ "\x1BNDN" => 'Ñ', // 209 in CP1252
+ "\x1BNAO" => 'Ò', // 210 in CP1252
+ "\x1BNBO" => 'Ó', // 211 in CP1252
+ "\x1BNCO" => 'Ô', // 212 in CP1252
+ "\x1BNDO" => 'Õ', // 213 in CP1252
+ "\x1BNHO" => 'Ö', // 214 in CP1252
+ "\x1B-7" => '×', // 215 in CP1252
+ "\x1BNi" => 'Ø', // 216 in CP1252
+ "\x1BNAU" => 'Ù', // 217 in CP1252
+ "\x1BNBU" => 'Ú', // 218 in CP1252
+ "\x1BNCU" => 'Û', // 219 in CP1252
+ "\x1BNHU" => 'Ü', // 220 in CP1252
+ "\x1B-=" => 'Ý', // 221 in CP1252
+ "\x1BNl" => 'Þ', // 222 in CP1252
+ "\x1BN{" => 'ß', // 223 in CP1252
+ "\x1BNAa" => 'à', // 224 in CP1252
+ "\x1BNBa" => 'á', // 225 in CP1252
+ "\x1BNCa" => 'â', // 226 in CP1252
+ "\x1BNDa" => 'ã', // 227 in CP1252
+ "\x1BNHa" => 'ä', // 228 in CP1252
+ "\x1BNJa" => 'å', // 229 in CP1252
+ "\x1BNq" => 'æ', // 230 in CP1252
+ "\x1BNKc" => 'ç', // 231 in CP1252
+ "\x1BNAe" => 'è', // 232 in CP1252
+ "\x1BNBe" => 'é', // 233 in CP1252
+ "\x1BNCe" => 'ê', // 234 in CP1252
+ "\x1BNHe" => 'ë', // 235 in CP1252
+ "\x1BNAi" => 'ì', // 236 in CP1252
+ "\x1BNBi" => 'í', // 237 in CP1252
+ "\x1BNCi" => 'î', // 238 in CP1252
+ "\x1BNHi" => 'ï', // 239 in CP1252
+ "\x1BNs" => 'ð', // 240 in CP1252
+ "\x1BNDn" => 'ñ', // 241 in CP1252
+ "\x1BNAo" => 'ò', // 242 in CP1252
+ "\x1BNBo" => 'ó', // 243 in CP1252
+ "\x1BNCo" => 'ô', // 244 in CP1252
+ "\x1BNDo" => 'õ', // 245 in CP1252
+ "\x1BNHo" => 'ö', // 246 in CP1252
+ "\x1B/7" => '÷', // 247 in CP1252
+ "\x1BNy" => 'ø', // 248 in CP1252
+ "\x1BNAu" => 'ù', // 249 in CP1252
+ "\x1BNBu" => 'ú', // 250 in CP1252
+ "\x1BNCu" => 'û', // 251 in CP1252
+ "\x1BNHu" => 'ü', // 252 in CP1252
+ "\x1B/=" => 'ý', // 253 in CP1252
+ "\x1BN|" => 'þ', // 254 in CP1252
+ "\x1BNHy" => 'ÿ', // 255 in CP1252
+ ];
+ }
+
+ /**
+ * Get whether iconv extension is available.
+ *
+ * @return bool
+ */
+ public static function getIsIconvEnabled()
+ {
+ if (isset(self::$isIconvEnabled)) {
+ return self::$isIconvEnabled;
+ }
+
+ // Assume no problems with iconv
+ self::$isIconvEnabled = true;
+
+ // Fail if iconv doesn't exist
+ if (!function_exists('iconv')) {
+ self::$isIconvEnabled = false;
+ } elseif (!@iconv('UTF-8', 'UTF-16LE', 'x')) {
+ // Sometimes iconv is not working, and e.g. iconv('UTF-8', 'UTF-16LE', 'x') just returns false,
+ self::$isIconvEnabled = false;
+ } elseif (defined('PHP_OS') && @stristr(PHP_OS, 'AIX') && defined('ICONV_IMPL') && (@strcasecmp(ICONV_IMPL, 'unknown') == 0) && defined('ICONV_VERSION') && (@strcasecmp(ICONV_VERSION, 'unknown') == 0)) {
+ // CUSTOM: IBM AIX iconv() does not work
+ self::$isIconvEnabled = false;
+ }
+
+ // Deactivate iconv default options if they fail (as seen on IMB i)
+ if (self::$isIconvEnabled && !@iconv('UTF-8', 'UTF-16LE' . self::$iconvOptions, 'x')) {
+ self::$iconvOptions = '';
+ }
+
+ return self::$isIconvEnabled;
+ }
+
+ private static function buildCharacterSets()
+ {
+ if (empty(self::$controlCharacters)) {
+ self::buildControlCharacters();
+ }
+
+ if (empty(self::$SYLKCharacters)) {
+ self::buildSYLKCharacters();
+ }
+ }
+
+ /**
+ * Convert from OpenXML escaped control character to PHP control character.
+ *
+ * Excel 2007 team:
+ * ----------------
+ * That's correct, control characters are stored directly in the shared-strings table.
+ * We do encode characters that cannot be represented in XML using the following escape sequence:
+ * _xHHHH_ where H represents a hexadecimal character in the character's value...
+ * So you could end up with something like _x0008_ in a string (either in a cell value ()
+ * element or in the shared string element.
+ *
+ * @param string $value Value to unescape
+ *
+ * @return string
+ */
+ public static function controlCharacterOOXML2PHP($value)
+ {
+ self::buildCharacterSets();
+
+ return str_replace(array_keys(self::$controlCharacters), array_values(self::$controlCharacters), $value);
+ }
+
+ /**
+ * Convert from PHP control character to OpenXML escaped control character.
+ *
+ * Excel 2007 team:
+ * ----------------
+ * That's correct, control characters are stored directly in the shared-strings table.
+ * We do encode characters that cannot be represented in XML using the following escape sequence:
+ * _xHHHH_ where H represents a hexadecimal character in the character's value...
+ * So you could end up with something like _x0008_ in a string (either in a cell value ()
+ * element or in the shared string element.
+ *
+ * @param string $value Value to escape
+ *
+ * @return string
+ */
+ public static function controlCharacterPHP2OOXML($value)
+ {
+ self::buildCharacterSets();
+
+ return str_replace(array_values(self::$controlCharacters), array_keys(self::$controlCharacters), $value);
+ }
+
+ /**
+ * Try to sanitize UTF8, stripping invalid byte sequences. Not perfect. Does not surrogate characters.
+ *
+ * @param string $value
+ *
+ * @return string
+ */
+ public static function sanitizeUTF8($value)
+ {
+ if (self::getIsIconvEnabled()) {
+ $value = @iconv('UTF-8', 'UTF-8', $value);
+
+ return $value;
+ }
+
+ $value = mb_convert_encoding($value, 'UTF-8', 'UTF-8');
+
+ return $value;
+ }
+
+ /**
+ * Check if a string contains UTF8 data.
+ *
+ * @param string $value
+ *
+ * @return bool
+ */
+ public static function isUTF8($value)
+ {
+ return $value === '' || preg_match('/^./su', $value) === 1;
+ }
+
+ /**
+ * Formats a numeric value as a string for output in various output writers forcing
+ * point as decimal separator in case locale is other than English.
+ *
+ * @param mixed $value
+ *
+ * @return string
+ */
+ public static function formatNumber($value)
+ {
+ if (is_float($value)) {
+ return str_replace(',', '.', $value);
+ }
+
+ return (string) $value;
+ }
+
+ /**
+ * Converts a UTF-8 string into BIFF8 Unicode string data (8-bit string length)
+ * Writes the string using uncompressed notation, no rich text, no Asian phonetics
+ * If mbstring extension is not available, ASCII is assumed, and compressed notation is used
+ * although this will give wrong results for non-ASCII strings
+ * see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect. 2.5.3.
+ *
+ * @param string $value UTF-8 encoded string
+ * @param mixed[] $arrcRuns Details of rich text runs in $value
+ *
+ * @return string
+ */
+ public static function UTF8toBIFF8UnicodeShort($value, $arrcRuns = [])
+ {
+ // character count
+ $ln = self::countCharacters($value, 'UTF-8');
+ // option flags
+ if (empty($arrcRuns)) {
+ $data = pack('CC', $ln, 0x0001);
+ // characters
+ $data .= self::convertEncoding($value, 'UTF-16LE', 'UTF-8');
+ } else {
+ $data = pack('vC', $ln, 0x09);
+ $data .= pack('v', count($arrcRuns));
+ // characters
+ $data .= self::convertEncoding($value, 'UTF-16LE', 'UTF-8');
+ foreach ($arrcRuns as $cRun) {
+ $data .= pack('v', $cRun['strlen']);
+ $data .= pack('v', $cRun['fontidx']);
+ }
+ }
+
+ return $data;
+ }
+
+ /**
+ * Converts a UTF-8 string into BIFF8 Unicode string data (16-bit string length)
+ * Writes the string using uncompressed notation, no rich text, no Asian phonetics
+ * If mbstring extension is not available, ASCII is assumed, and compressed notation is used
+ * although this will give wrong results for non-ASCII strings
+ * see OpenOffice.org's Documentation of the Microsoft Excel File Format, sect. 2.5.3.
+ *
+ * @param string $value UTF-8 encoded string
+ *
+ * @return string
+ */
+ public static function UTF8toBIFF8UnicodeLong($value)
+ {
+ // character count
+ $ln = self::countCharacters($value, 'UTF-8');
+
+ // characters
+ $chars = self::convertEncoding($value, 'UTF-16LE', 'UTF-8');
+
+ $data = pack('vC', $ln, 0x0001) . $chars;
+
+ return $data;
+ }
+
+ /**
+ * Convert string from one encoding to another.
+ *
+ * @param string $value
+ * @param string $to Encoding to convert to, e.g. 'UTF-8'
+ * @param string $from Encoding to convert from, e.g. 'UTF-16LE'
+ *
+ * @return string
+ */
+ public static function convertEncoding($value, $to, $from)
+ {
+ if (self::getIsIconvEnabled()) {
+ $result = iconv($from, $to . self::$iconvOptions, $value);
+ if (false !== $result) {
+ return $result;
+ }
+ }
+
+ return mb_convert_encoding($value, $to, $from);
+ }
+
+ /**
+ * Get character count.
+ *
+ * @param string $value
+ * @param string $enc Encoding
+ *
+ * @return int Character count
+ */
+ public static function countCharacters($value, $enc = 'UTF-8')
+ {
+ return mb_strlen($value, $enc);
+ }
+
+ /**
+ * Get a substring of a UTF-8 encoded string.
+ *
+ * @param string $pValue UTF-8 encoded string
+ * @param int $pStart Start offset
+ * @param int $pLength Maximum number of characters in substring
+ *
+ * @return string
+ */
+ public static function substring($pValue, $pStart, $pLength = 0)
+ {
+ return mb_substr($pValue, $pStart, $pLength, 'UTF-8');
+ }
+
+ /**
+ * Convert a UTF-8 encoded string to upper case.
+ *
+ * @param string $pValue UTF-8 encoded string
+ *
+ * @return string
+ */
+ public static function strToUpper($pValue)
+ {
+ return mb_convert_case($pValue, MB_CASE_UPPER, 'UTF-8');
+ }
+
+ /**
+ * Convert a UTF-8 encoded string to lower case.
+ *
+ * @param string $pValue UTF-8 encoded string
+ *
+ * @return string
+ */
+ public static function strToLower($pValue)
+ {
+ return mb_convert_case($pValue, MB_CASE_LOWER, 'UTF-8');
+ }
+
+ /**
+ * Convert a UTF-8 encoded string to title/proper case
+ * (uppercase every first character in each word, lower case all other characters).
+ *
+ * @param string $pValue UTF-8 encoded string
+ *
+ * @return string
+ */
+ public static function strToTitle($pValue)
+ {
+ return mb_convert_case($pValue, MB_CASE_TITLE, 'UTF-8');
+ }
+
+ public static function mbIsUpper($char)
+ {
+ return mb_strtolower($char, 'UTF-8') != $char;
+ }
+
+ public static function mbStrSplit($string)
+ {
+ // Split at all position not after the start: ^
+ // and not before the end: $
+ return preg_split('/(?_calculateFormulaValue($fractionFormula);
+
+ return true;
+ }
+
+ return false;
+ }
+
+ // function convertToNumberIfFraction()
+
+ /**
+ * Get the decimal separator. If it has not yet been set explicitly, try to obtain number
+ * formatting information from locale.
+ *
+ * @return string
+ */
+ public static function getDecimalSeparator()
+ {
+ if (!isset(self::$decimalSeparator)) {
+ $localeconv = localeconv();
+ self::$decimalSeparator = ($localeconv['decimal_point'] != '')
+ ? $localeconv['decimal_point'] : $localeconv['mon_decimal_point'];
+
+ if (self::$decimalSeparator == '') {
+ // Default to .
+ self::$decimalSeparator = '.';
+ }
+ }
+
+ return self::$decimalSeparator;
+ }
+
+ /**
+ * Set the decimal separator. Only used by NumberFormat::toFormattedString()
+ * to format output by \PhpOffice\PhpSpreadsheet\Writer\Html and \PhpOffice\PhpSpreadsheet\Writer\Pdf.
+ *
+ * @param string $pValue Character for decimal separator
+ */
+ public static function setDecimalSeparator($pValue)
+ {
+ self::$decimalSeparator = $pValue;
+ }
+
+ /**
+ * Get the thousands separator. If it has not yet been set explicitly, try to obtain number
+ * formatting information from locale.
+ *
+ * @return string
+ */
+ public static function getThousandsSeparator()
+ {
+ if (!isset(self::$thousandsSeparator)) {
+ $localeconv = localeconv();
+ self::$thousandsSeparator = ($localeconv['thousands_sep'] != '')
+ ? $localeconv['thousands_sep'] : $localeconv['mon_thousands_sep'];
+
+ if (self::$thousandsSeparator == '') {
+ // Default to .
+ self::$thousandsSeparator = ',';
+ }
+ }
+
+ return self::$thousandsSeparator;
+ }
+
+ /**
+ * Set the thousands separator. Only used by NumberFormat::toFormattedString()
+ * to format output by \PhpOffice\PhpSpreadsheet\Writer\Html and \PhpOffice\PhpSpreadsheet\Writer\Pdf.
+ *
+ * @param string $pValue Character for thousands separator
+ */
+ public static function setThousandsSeparator($pValue)
+ {
+ self::$thousandsSeparator = $pValue;
+ }
+
+ /**
+ * Get the currency code. If it has not yet been set explicitly, try to obtain the
+ * symbol information from locale.
+ *
+ * @return string
+ */
+ public static function getCurrencyCode()
+ {
+ if (!empty(self::$currencyCode)) {
+ return self::$currencyCode;
+ }
+ self::$currencyCode = '$';
+ $localeconv = localeconv();
+ if (!empty($localeconv['currency_symbol'])) {
+ self::$currencyCode = $localeconv['currency_symbol'];
+
+ return self::$currencyCode;
+ }
+ if (!empty($localeconv['int_curr_symbol'])) {
+ self::$currencyCode = $localeconv['int_curr_symbol'];
+
+ return self::$currencyCode;
+ }
+
+ return self::$currencyCode;
+ }
+
+ /**
+ * Set the currency code. Only used by NumberFormat::toFormattedString()
+ * to format output by \PhpOffice\PhpSpreadsheet\Writer\Html and \PhpOffice\PhpSpreadsheet\Writer\Pdf.
+ *
+ * @param string $pValue Character for currency code
+ */
+ public static function setCurrencyCode($pValue)
+ {
+ self::$currencyCode = $pValue;
+ }
+
+ /**
+ * Convert SYLK encoded string to UTF-8.
+ *
+ * @param string $pValue
+ *
+ * @return string UTF-8 encoded string
+ */
+ public static function SYLKtoUTF8($pValue)
+ {
+ self::buildCharacterSets();
+
+ // If there is no escape character in the string there is nothing to do
+ if (strpos($pValue, '') === false) {
+ return $pValue;
+ }
+
+ foreach (self::$SYLKCharacters as $k => $v) {
+ $pValue = str_replace($k, $v, $pValue);
+ }
+
+ return $pValue;
+ }
+
+ /**
+ * Retrieve any leading numeric part of a string, or return the full string if no leading numeric
+ * (handles basic integer or float, but not exponent or non decimal).
+ *
+ * @param string $value
+ *
+ * @return mixed string or only the leading numeric part of the string
+ */
+ public static function testStringAsNumeric($value)
+ {
+ if (is_numeric($value)) {
+ return $value;
+ }
+ $v = (float) $value;
+
+ return (is_numeric(substr($value, 0, strlen($v)))) ? $v : $value;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/TimeZone.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/TimeZone.php
new file mode 100644
index 00000000000..e5a99b9b6b8
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/TimeZone.php
@@ -0,0 +1,87 @@
+getTransitions($timestamp, $timestamp);
+
+ return (count($transitions) > 0) ? $transitions[0]['offset'] : 0;
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Shared/trend/bestFitClass.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/BestFit.php
similarity index 66%
rename from lib/phpexcel/PHPExcel/Shared/trend/bestFitClass.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/BestFit.php
index 2de029f9657..d8e63d5e289 100644
--- a/lib/phpexcel/PHPExcel/Shared/trend/bestFitClass.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/BestFit.php
@@ -1,80 +1,57 @@
error;
}
-
public function getBestFitType()
{
return $this->bestFitType;
}
/**
- * Return the Y-Value for a specified value of X
+ * Return the Y-Value for a specified value of X.
*
- * @param float $xValue X-Value
- * @return float Y-Value
+ * @param float $xValue X-Value
+ *
+ * @return bool Y-Value
*/
public function getValueOfYForX($xValue)
{
@@ -128,10 +104,11 @@ class PHPExcel_Best_Fit
}
/**
- * Return the X-Value for a specified value of Y
+ * Return the X-Value for a specified value of Y.
*
- * @param float $yValue Y-Value
- * @return float X-Value
+ * @param float $yValue Y-Value
+ *
+ * @return bool X-Value
*/
public function getValueOfXForY($yValue)
{
@@ -139,9 +116,9 @@ class PHPExcel_Best_Fit
}
/**
- * Return the original set of X-Values
+ * Return the original set of X-Values.
*
- * @return float[] X-Values
+ * @return float[] X-Values
*/
public function getXValues()
{
@@ -149,10 +126,11 @@ class PHPExcel_Best_Fit
}
/**
- * Return the Equation of the best-fit line
+ * Return the Equation of the best-fit line.
*
- * @param int $dp Number of places of decimal precision to display
- * @return string
+ * @param int $dp Number of places of decimal precision to display
+ *
+ * @return bool
*/
public function getEquation($dp = 0)
{
@@ -160,145 +138,204 @@ class PHPExcel_Best_Fit
}
/**
- * Return the Slope of the line
+ * Return the Slope of the line.
*
- * @param int $dp Number of places of decimal precision to display
- * @return string
+ * @param int $dp Number of places of decimal precision to display
+ *
+ * @return float
*/
public function getSlope($dp = 0)
{
if ($dp != 0) {
return round($this->slope, $dp);
}
+
return $this->slope;
}
/**
- * Return the standard error of the Slope
+ * Return the standard error of the Slope.
*
- * @param int $dp Number of places of decimal precision to display
- * @return string
+ * @param int $dp Number of places of decimal precision to display
+ *
+ * @return float
*/
public function getSlopeSE($dp = 0)
{
if ($dp != 0) {
return round($this->slopeSE, $dp);
}
+
return $this->slopeSE;
}
/**
- * Return the Value of X where it intersects Y = 0
+ * Return the Value of X where it intersects Y = 0.
*
- * @param int $dp Number of places of decimal precision to display
- * @return string
+ * @param int $dp Number of places of decimal precision to display
+ *
+ * @return float
*/
public function getIntersect($dp = 0)
{
if ($dp != 0) {
return round($this->intersect, $dp);
}
+
return $this->intersect;
}
/**
- * Return the standard error of the Intersect
+ * Return the standard error of the Intersect.
*
- * @param int $dp Number of places of decimal precision to display
- * @return string
+ * @param int $dp Number of places of decimal precision to display
+ *
+ * @return float
*/
public function getIntersectSE($dp = 0)
{
if ($dp != 0) {
return round($this->intersectSE, $dp);
}
+
return $this->intersectSE;
}
/**
- * Return the goodness of fit for this regression
+ * Return the goodness of fit for this regression.
*
- * @param int $dp Number of places of decimal precision to return
- * @return float
+ * @param int $dp Number of places of decimal precision to return
+ *
+ * @return float
*/
public function getGoodnessOfFit($dp = 0)
{
if ($dp != 0) {
return round($this->goodnessOfFit, $dp);
}
+
return $this->goodnessOfFit;
}
+ /**
+ * Return the goodness of fit for this regression.
+ *
+ * @param int $dp Number of places of decimal precision to return
+ *
+ * @return float
+ */
public function getGoodnessOfFitPercent($dp = 0)
{
if ($dp != 0) {
return round($this->goodnessOfFit * 100, $dp);
}
+
return $this->goodnessOfFit * 100;
}
/**
- * Return the standard deviation of the residuals for this regression
+ * Return the standard deviation of the residuals for this regression.
*
- * @param int $dp Number of places of decimal precision to return
- * @return float
+ * @param int $dp Number of places of decimal precision to return
+ *
+ * @return float
*/
public function getStdevOfResiduals($dp = 0)
{
if ($dp != 0) {
return round($this->stdevOfResiduals, $dp);
}
+
return $this->stdevOfResiduals;
}
+ /**
+ * @param int $dp Number of places of decimal precision to return
+ *
+ * @return float
+ */
public function getSSRegression($dp = 0)
{
if ($dp != 0) {
return round($this->SSRegression, $dp);
}
+
return $this->SSRegression;
}
+ /**
+ * @param int $dp Number of places of decimal precision to return
+ *
+ * @return float
+ */
public function getSSResiduals($dp = 0)
{
if ($dp != 0) {
return round($this->SSResiduals, $dp);
}
+
return $this->SSResiduals;
}
+ /**
+ * @param int $dp Number of places of decimal precision to return
+ *
+ * @return float
+ */
public function getDFResiduals($dp = 0)
{
if ($dp != 0) {
return round($this->DFResiduals, $dp);
}
+
return $this->DFResiduals;
}
+ /**
+ * @param int $dp Number of places of decimal precision to return
+ *
+ * @return float
+ */
public function getF($dp = 0)
{
if ($dp != 0) {
return round($this->f, $dp);
}
+
return $this->f;
}
+ /**
+ * @param int $dp Number of places of decimal precision to return
+ *
+ * @return float
+ */
public function getCovariance($dp = 0)
{
if ($dp != 0) {
return round($this->covariance, $dp);
}
+
return $this->covariance;
}
+ /**
+ * @param int $dp Number of places of decimal precision to return
+ *
+ * @return float
+ */
public function getCorrelation($dp = 0)
{
if ($dp != 0) {
return round($this->correlation, $dp);
}
+
return $this->correlation;
}
+ /**
+ * @return float[]
+ */
public function getYBestFitValues()
{
return $this->yBestFitValues;
@@ -358,7 +395,12 @@ class PHPExcel_Best_Fit
}
}
- protected function leastSquareFit($yValues, $xValues, $const)
+ /**
+ * @param float[] $yValues
+ * @param float[] $xValues
+ * @param bool $const
+ */
+ protected function leastSquareFit(array $yValues, array $xValues, $const)
{
// calculate sums
$x_sum = array_sum($xValues);
@@ -381,11 +423,9 @@ class PHPExcel_Best_Fit
}
// calculate slope
-// $this->slope = (($this->valueCount * $xy_sum) - ($x_sum * $y_sum)) / (($this->valueCount * $xx_sum) - ($x_sum * $x_sum));
$this->slope = $mBase / $mDivisor;
// calculate intersect
-// $this->intersect = ($y_sum - ($this->slope * $x_sum)) / $this->valueCount;
if ($const) {
$this->intersect = $meanY - ($this->slope * $meanX);
} else {
@@ -396,13 +436,13 @@ class PHPExcel_Best_Fit
}
/**
- * Define the regression
+ * Define the regression.
*
- * @param float[] $yValues The set of Y-values for this regression
- * @param float[] $xValues The set of X-values for this regression
- * @param boolean $const
+ * @param float[] $yValues The set of Y-values for this regression
+ * @param float[] $xValues The set of X-values for this regression
+ * @param bool $const
*/
- public function __construct($yValues, $xValues = array(), $const = true)
+ public function __construct($yValues, $xValues = [], $const = true)
{
// Calculate number of points
$nY = count($yValues);
@@ -411,11 +451,9 @@ class PHPExcel_Best_Fit
// Define X Values if necessary
if ($nX == 0) {
$xValues = range(1, $nY);
- $nX = $nY;
} elseif ($nY != $nX) {
// Ensure both arrays of points are the same size
$this->error = true;
- return false;
}
$this->valueCount = $nY;
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php
new file mode 100644
index 00000000000..03723d84d4e
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/ExponentialBestFit.php
@@ -0,0 +1,120 @@
+getIntersect() * pow($this->getSlope(), ($xValue - $this->xOffset));
+ }
+
+ /**
+ * Return the X-Value for a specified value of Y.
+ *
+ * @param float $yValue Y-Value
+ *
+ * @return float X-Value
+ */
+ public function getValueOfXForY($yValue)
+ {
+ return log(($yValue + $this->yOffset) / $this->getIntersect()) / log($this->getSlope());
+ }
+
+ /**
+ * Return the Equation of the best-fit line.
+ *
+ * @param int $dp Number of places of decimal precision to display
+ *
+ * @return string
+ */
+ public function getEquation($dp = 0)
+ {
+ $slope = $this->getSlope($dp);
+ $intersect = $this->getIntersect($dp);
+
+ return 'Y = ' . $intersect . ' * ' . $slope . '^X';
+ }
+
+ /**
+ * Return the Slope of the line.
+ *
+ * @param int $dp Number of places of decimal precision to display
+ *
+ * @return float
+ */
+ public function getSlope($dp = 0)
+ {
+ if ($dp != 0) {
+ return round(exp($this->slope), $dp);
+ }
+
+ return exp($this->slope);
+ }
+
+ /**
+ * Return the Value of X where it intersects Y = 0.
+ *
+ * @param int $dp Number of places of decimal precision to display
+ *
+ * @return float
+ */
+ public function getIntersect($dp = 0)
+ {
+ if ($dp != 0) {
+ return round(exp($this->intersect), $dp);
+ }
+
+ return exp($this->intersect);
+ }
+
+ /**
+ * Execute the regression and calculate the goodness of fit for a set of X and Y data values.
+ *
+ * @param float[] $yValues The set of Y-values for this regression
+ * @param float[] $xValues The set of X-values for this regression
+ * @param bool $const
+ */
+ private function exponentialRegression($yValues, $xValues, $const)
+ {
+ foreach ($yValues as &$value) {
+ if ($value < 0.0) {
+ $value = 0 - log(abs($value));
+ } elseif ($value > 0.0) {
+ $value = log($value);
+ }
+ }
+ unset($value);
+
+ $this->leastSquareFit($yValues, $xValues, $const);
+ }
+
+ /**
+ * Define the regression and calculate the goodness of fit for a set of X and Y data values.
+ *
+ * @param float[] $yValues The set of Y-values for this regression
+ * @param float[] $xValues The set of X-values for this regression
+ * @param bool $const
+ */
+ public function __construct($yValues, $xValues = [], $const = true)
+ {
+ if (parent::__construct($yValues, $xValues) !== false) {
+ $this->exponentialRegression($yValues, $xValues, $const);
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LinearBestFit.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LinearBestFit.php
new file mode 100644
index 00000000000..367e9d6ec56
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LinearBestFit.php
@@ -0,0 +1,79 @@
+getIntersect() + $this->getSlope() * $xValue;
+ }
+
+ /**
+ * Return the X-Value for a specified value of Y.
+ *
+ * @param float $yValue Y-Value
+ *
+ * @return float X-Value
+ */
+ public function getValueOfXForY($yValue)
+ {
+ return ($yValue - $this->getIntersect()) / $this->getSlope();
+ }
+
+ /**
+ * Return the Equation of the best-fit line.
+ *
+ * @param int $dp Number of places of decimal precision to display
+ *
+ * @return string
+ */
+ public function getEquation($dp = 0)
+ {
+ $slope = $this->getSlope($dp);
+ $intersect = $this->getIntersect($dp);
+
+ return 'Y = ' . $intersect . ' + ' . $slope . ' * X';
+ }
+
+ /**
+ * Execute the regression and calculate the goodness of fit for a set of X and Y data values.
+ *
+ * @param float[] $yValues The set of Y-values for this regression
+ * @param float[] $xValues The set of X-values for this regression
+ * @param bool $const
+ */
+ private function linearRegression($yValues, $xValues, $const)
+ {
+ $this->leastSquareFit($yValues, $xValues, $const);
+ }
+
+ /**
+ * Define the regression and calculate the goodness of fit for a set of X and Y data values.
+ *
+ * @param float[] $yValues The set of Y-values for this regression
+ * @param float[] $xValues The set of X-values for this regression
+ * @param bool $const
+ */
+ public function __construct($yValues, $xValues = [], $const = true)
+ {
+ if (parent::__construct($yValues, $xValues) !== false) {
+ $this->linearRegression($yValues, $xValues, $const);
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php
new file mode 100644
index 00000000000..9092cef8215
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/LogarithmicBestFit.php
@@ -0,0 +1,88 @@
+getIntersect() + $this->getSlope() * log($xValue - $this->xOffset);
+ }
+
+ /**
+ * Return the X-Value for a specified value of Y.
+ *
+ * @param float $yValue Y-Value
+ *
+ * @return float X-Value
+ */
+ public function getValueOfXForY($yValue)
+ {
+ return exp(($yValue - $this->getIntersect()) / $this->getSlope());
+ }
+
+ /**
+ * Return the Equation of the best-fit line.
+ *
+ * @param int $dp Number of places of decimal precision to display
+ *
+ * @return string
+ */
+ public function getEquation($dp = 0)
+ {
+ $slope = $this->getSlope($dp);
+ $intersect = $this->getIntersect($dp);
+
+ return 'Y = ' . $intersect . ' + ' . $slope . ' * log(X)';
+ }
+
+ /**
+ * Execute the regression and calculate the goodness of fit for a set of X and Y data values.
+ *
+ * @param float[] $yValues The set of Y-values for this regression
+ * @param float[] $xValues The set of X-values for this regression
+ * @param bool $const
+ */
+ private function logarithmicRegression($yValues, $xValues, $const)
+ {
+ foreach ($xValues as &$value) {
+ if ($value < 0.0) {
+ $value = 0 - log(abs($value));
+ } elseif ($value > 0.0) {
+ $value = log($value);
+ }
+ }
+ unset($value);
+
+ $this->leastSquareFit($yValues, $xValues, $const);
+ }
+
+ /**
+ * Define the regression and calculate the goodness of fit for a set of X and Y data values.
+ *
+ * @param float[] $yValues The set of Y-values for this regression
+ * @param float[] $xValues The set of X-values for this regression
+ * @param bool $const
+ */
+ public function __construct($yValues, $xValues = [], $const = true)
+ {
+ if (parent::__construct($yValues, $xValues) !== false) {
+ $this->logarithmicRegression($yValues, $xValues, $const);
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php
new file mode 100644
index 00000000000..afcf5f477e4
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PolynomialBestFit.php
@@ -0,0 +1,198 @@
+order;
+ }
+
+ /**
+ * Return the Y-Value for a specified value of X.
+ *
+ * @param float $xValue X-Value
+ *
+ * @return float Y-Value
+ */
+ public function getValueOfYForX($xValue)
+ {
+ $retVal = $this->getIntersect();
+ $slope = $this->getSlope();
+ foreach ($slope as $key => $value) {
+ if ($value != 0.0) {
+ $retVal += $value * pow($xValue, $key + 1);
+ }
+ }
+
+ return $retVal;
+ }
+
+ /**
+ * Return the X-Value for a specified value of Y.
+ *
+ * @param float $yValue Y-Value
+ *
+ * @return float X-Value
+ */
+ public function getValueOfXForY($yValue)
+ {
+ return ($yValue - $this->getIntersect()) / $this->getSlope();
+ }
+
+ /**
+ * Return the Equation of the best-fit line.
+ *
+ * @param int $dp Number of places of decimal precision to display
+ *
+ * @return string
+ */
+ public function getEquation($dp = 0)
+ {
+ $slope = $this->getSlope($dp);
+ $intersect = $this->getIntersect($dp);
+
+ $equation = 'Y = ' . $intersect;
+ foreach ($slope as $key => $value) {
+ if ($value != 0.0) {
+ $equation .= ' + ' . $value . ' * X';
+ if ($key > 0) {
+ $equation .= '^' . ($key + 1);
+ }
+ }
+ }
+
+ return $equation;
+ }
+
+ /**
+ * Return the Slope of the line.
+ *
+ * @param int $dp Number of places of decimal precision to display
+ *
+ * @return string
+ */
+ public function getSlope($dp = 0)
+ {
+ if ($dp != 0) {
+ $coefficients = [];
+ foreach ($this->slope as $coefficient) {
+ $coefficients[] = round($coefficient, $dp);
+ }
+
+ return $coefficients;
+ }
+
+ return $this->slope;
+ }
+
+ public function getCoefficients($dp = 0)
+ {
+ return array_merge([$this->getIntersect($dp)], $this->getSlope($dp));
+ }
+
+ /**
+ * Execute the regression and calculate the goodness of fit for a set of X and Y data values.
+ *
+ * @param int $order Order of Polynomial for this regression
+ * @param float[] $yValues The set of Y-values for this regression
+ * @param float[] $xValues The set of X-values for this regression
+ */
+ private function polynomialRegression($order, $yValues, $xValues)
+ {
+ // calculate sums
+ $x_sum = array_sum($xValues);
+ $y_sum = array_sum($yValues);
+ $xx_sum = $xy_sum = $yy_sum = 0;
+ for ($i = 0; $i < $this->valueCount; ++$i) {
+ $xy_sum += $xValues[$i] * $yValues[$i];
+ $xx_sum += $xValues[$i] * $xValues[$i];
+ $yy_sum += $yValues[$i] * $yValues[$i];
+ }
+ /*
+ * This routine uses logic from the PHP port of polyfit version 0.1
+ * written by Michael Bommarito and Paul Meagher
+ *
+ * The function fits a polynomial function of order $order through
+ * a series of x-y data points using least squares.
+ *
+ */
+ $A = [];
+ $B = [];
+ for ($i = 0; $i < $this->valueCount; ++$i) {
+ for ($j = 0; $j <= $order; ++$j) {
+ $A[$i][$j] = pow($xValues[$i], $j);
+ }
+ }
+ for ($i = 0; $i < $this->valueCount; ++$i) {
+ $B[$i] = [$yValues[$i]];
+ }
+ $matrixA = new Matrix($A);
+ $matrixB = new Matrix($B);
+ $C = $matrixA->solve($matrixB);
+
+ $coefficients = [];
+ for ($i = 0; $i < $C->getRowDimension(); ++$i) {
+ $r = $C->get($i, 0);
+ if (abs($r) <= pow(10, -9)) {
+ $r = 0;
+ }
+ $coefficients[] = $r;
+ }
+
+ $this->intersect = array_shift($coefficients);
+ $this->slope = $coefficients;
+
+ $this->calculateGoodnessOfFit($x_sum, $y_sum, $xx_sum, $yy_sum, $xy_sum, 0, 0, 0);
+ foreach ($this->xValues as $xKey => $xValue) {
+ $this->yBestFitValues[$xKey] = $this->getValueOfYForX($xValue);
+ }
+ }
+
+ /**
+ * Define the regression and calculate the goodness of fit for a set of X and Y data values.
+ *
+ * @param int $order Order of Polynomial for this regression
+ * @param float[] $yValues The set of Y-values for this regression
+ * @param float[] $xValues The set of X-values for this regression
+ * @param bool $const
+ */
+ public function __construct($order, $yValues, $xValues = [], $const = true)
+ {
+ if (parent::__construct($yValues, $xValues) !== false) {
+ if ($order < $this->valueCount) {
+ $this->bestFitType .= '_' . $order;
+ $this->order = $order;
+ $this->polynomialRegression($order, $yValues, $xValues);
+ if (($this->getGoodnessOfFit() < 0.0) || ($this->getGoodnessOfFit() > 1.0)) {
+ $this->error = true;
+ }
+ } else {
+ $this->error = true;
+ }
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PowerBestFit.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PowerBestFit.php
new file mode 100644
index 00000000000..e1b3b8297cb
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/PowerBestFit.php
@@ -0,0 +1,112 @@
+getIntersect() * pow(($xValue - $this->xOffset), $this->getSlope());
+ }
+
+ /**
+ * Return the X-Value for a specified value of Y.
+ *
+ * @param float $yValue Y-Value
+ *
+ * @return float X-Value
+ */
+ public function getValueOfXForY($yValue)
+ {
+ return pow((($yValue + $this->yOffset) / $this->getIntersect()), (1 / $this->getSlope()));
+ }
+
+ /**
+ * Return the Equation of the best-fit line.
+ *
+ * @param int $dp Number of places of decimal precision to display
+ *
+ * @return string
+ */
+ public function getEquation($dp = 0)
+ {
+ $slope = $this->getSlope($dp);
+ $intersect = $this->getIntersect($dp);
+
+ return 'Y = ' . $intersect . ' * X^' . $slope;
+ }
+
+ /**
+ * Return the Value of X where it intersects Y = 0.
+ *
+ * @param int $dp Number of places of decimal precision to display
+ *
+ * @return float
+ */
+ public function getIntersect($dp = 0)
+ {
+ if ($dp != 0) {
+ return round(exp($this->intersect), $dp);
+ }
+
+ return exp($this->intersect);
+ }
+
+ /**
+ * Execute the regression and calculate the goodness of fit for a set of X and Y data values.
+ *
+ * @param float[] $yValues The set of Y-values for this regression
+ * @param float[] $xValues The set of X-values for this regression
+ * @param bool $const
+ */
+ private function powerRegression($yValues, $xValues, $const)
+ {
+ foreach ($xValues as &$value) {
+ if ($value < 0.0) {
+ $value = 0 - log(abs($value));
+ } elseif ($value > 0.0) {
+ $value = log($value);
+ }
+ }
+ unset($value);
+ foreach ($yValues as &$value) {
+ if ($value < 0.0) {
+ $value = 0 - log(abs($value));
+ } elseif ($value > 0.0) {
+ $value = log($value);
+ }
+ }
+ unset($value);
+
+ $this->leastSquareFit($yValues, $xValues, $const);
+ }
+
+ /**
+ * Define the regression and calculate the goodness of fit for a set of X and Y data values.
+ *
+ * @param float[] $yValues The set of Y-values for this regression
+ * @param float[] $xValues The set of X-values for this regression
+ * @param bool $const
+ */
+ public function __construct($yValues, $xValues = [], $const = true)
+ {
+ if (parent::__construct($yValues, $xValues) !== false) {
+ $this->powerRegression($yValues, $xValues, $const);
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php
new file mode 100644
index 00000000000..1b7b3901078
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/Trend/Trend.php
@@ -0,0 +1,120 @@
+getGoodnessOfFit();
+ }
+ if ($trendType != self::TREND_BEST_FIT_NO_POLY) {
+ foreach (self::$trendTypePolynomialOrders as $trendMethod) {
+ $order = substr($trendMethod, -1);
+ $bestFit[$trendMethod] = new PolynomialBestFit($order, $yValues, $xValues, $const);
+ if ($bestFit[$trendMethod]->getError()) {
+ unset($bestFit[$trendMethod]);
+ } else {
+ $bestFitValue[$trendMethod] = $bestFit[$trendMethod]->getGoodnessOfFit();
+ }
+ }
+ }
+ // Determine which of our Trend lines is the best fit, and then we return the instance of that Trend class
+ arsort($bestFitValue);
+ $bestFitType = key($bestFitValue);
+
+ return $bestFit[$bestFitType];
+ default:
+ return false;
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php
new file mode 100644
index 00000000000..4f7a6a06afc
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/XMLWriter.php
@@ -0,0 +1,92 @@
+openMemory();
+ } else {
+ // Create temporary filename
+ if ($pTemporaryStorageFolder === null) {
+ $pTemporaryStorageFolder = File::sysGetTempDir();
+ }
+ $this->tempFileName = @tempnam($pTemporaryStorageFolder, 'xml');
+
+ // Open storage
+ if ($this->openUri($this->tempFileName) === false) {
+ // Fallback to memory...
+ $this->openMemory();
+ }
+ }
+
+ // Set default values
+ if (self::$debugEnabled) {
+ $this->setIndent(true);
+ }
+ }
+
+ /**
+ * Destructor.
+ */
+ public function __destruct()
+ {
+ // Unlink temporary files
+ if ($this->tempFileName != '') {
+ @unlink($this->tempFileName);
+ }
+ }
+
+ /**
+ * Get written data.
+ *
+ * @return string
+ */
+ public function getData()
+ {
+ if ($this->tempFileName == '') {
+ return $this->outputMemory(true);
+ }
+ $this->flush();
+
+ return file_get_contents($this->tempFileName);
+ }
+
+ /**
+ * Wrapper method for writeRaw.
+ *
+ * @param string|string[] $text
+ *
+ * @return bool
+ */
+ public function writeRawData($text)
+ {
+ if (is_array($text)) {
+ $text = implode("\n", $text);
+ }
+
+ return $this->writeRaw(htmlspecialchars($text));
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php
new file mode 100644
index 00000000000..8eadcbe8b1a
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Spreadsheet.php
@@ -0,0 +1,1490 @@
+hasMacros;
+ }
+
+ /**
+ * Define if a workbook has macros.
+ *
+ * @param bool $hasMacros true|false
+ */
+ public function setHasMacros($hasMacros)
+ {
+ $this->hasMacros = (bool) $hasMacros;
+ }
+
+ /**
+ * Set the macros code.
+ *
+ * @param string $macroCode string|null
+ */
+ public function setMacrosCode($macroCode)
+ {
+ $this->macrosCode = $macroCode;
+ $this->setHasMacros($macroCode !== null);
+ }
+
+ /**
+ * Return the macros code.
+ *
+ * @return null|string
+ */
+ public function getMacrosCode()
+ {
+ return $this->macrosCode;
+ }
+
+ /**
+ * Set the macros certificate.
+ *
+ * @param null|string $certificate
+ */
+ public function setMacrosCertificate($certificate)
+ {
+ $this->macrosCertificate = $certificate;
+ }
+
+ /**
+ * Is the project signed ?
+ *
+ * @return bool true|false
+ */
+ public function hasMacrosCertificate()
+ {
+ return $this->macrosCertificate !== null;
+ }
+
+ /**
+ * Return the macros certificate.
+ *
+ * @return null|string
+ */
+ public function getMacrosCertificate()
+ {
+ return $this->macrosCertificate;
+ }
+
+ /**
+ * Remove all macros, certificate from spreadsheet.
+ */
+ public function discardMacros()
+ {
+ $this->hasMacros = false;
+ $this->macrosCode = null;
+ $this->macrosCertificate = null;
+ }
+
+ /**
+ * set ribbon XML data.
+ *
+ * @param null|mixed $target
+ * @param null|mixed $xmlData
+ */
+ public function setRibbonXMLData($target, $xmlData)
+ {
+ if ($target !== null && $xmlData !== null) {
+ $this->ribbonXMLData = ['target' => $target, 'data' => $xmlData];
+ } else {
+ $this->ribbonXMLData = null;
+ }
+ }
+
+ /**
+ * retrieve ribbon XML Data.
+ *
+ * return string|null|array
+ *
+ * @param string $what
+ *
+ * @return string
+ */
+ public function getRibbonXMLData($what = 'all') //we need some constants here...
+ {
+ $returnData = null;
+ $what = strtolower($what);
+ switch ($what) {
+ case 'all':
+ $returnData = $this->ribbonXMLData;
+
+ break;
+ case 'target':
+ case 'data':
+ if (is_array($this->ribbonXMLData) && isset($this->ribbonXMLData[$what])) {
+ $returnData = $this->ribbonXMLData[$what];
+ }
+
+ break;
+ }
+
+ return $returnData;
+ }
+
+ /**
+ * store binaries ribbon objects (pictures).
+ *
+ * @param null|mixed $BinObjectsNames
+ * @param null|mixed $BinObjectsData
+ */
+ public function setRibbonBinObjects($BinObjectsNames, $BinObjectsData)
+ {
+ if ($BinObjectsNames !== null && $BinObjectsData !== null) {
+ $this->ribbonBinObjects = ['names' => $BinObjectsNames, 'data' => $BinObjectsData];
+ } else {
+ $this->ribbonBinObjects = null;
+ }
+ }
+
+ /**
+ * List of unparsed loaded data for export to same format with better compatibility.
+ * It has to be minimized when the library start to support currently unparsed data.
+ *
+ * @internal
+ *
+ * @return array
+ */
+ public function getUnparsedLoadedData()
+ {
+ return $this->unparsedLoadedData;
+ }
+
+ /**
+ * List of unparsed loaded data for export to same format with better compatibility.
+ * It has to be minimized when the library start to support currently unparsed data.
+ *
+ * @internal
+ *
+ * @param array $unparsedLoadedData
+ */
+ public function setUnparsedLoadedData(array $unparsedLoadedData)
+ {
+ $this->unparsedLoadedData = $unparsedLoadedData;
+ }
+
+ /**
+ * return the extension of a filename. Internal use for a array_map callback (php<5.3 don't like lambda function).
+ *
+ * @param mixed $path
+ *
+ * @return string
+ */
+ private function getExtensionOnly($path)
+ {
+ return pathinfo($path, PATHINFO_EXTENSION);
+ }
+
+ /**
+ * retrieve Binaries Ribbon Objects.
+ *
+ * @param string $what
+ *
+ * @return null|array
+ */
+ public function getRibbonBinObjects($what = 'all')
+ {
+ $ReturnData = null;
+ $what = strtolower($what);
+ switch ($what) {
+ case 'all':
+ return $this->ribbonBinObjects;
+
+ break;
+ case 'names':
+ case 'data':
+ if (is_array($this->ribbonBinObjects) && isset($this->ribbonBinObjects[$what])) {
+ $ReturnData = $this->ribbonBinObjects[$what];
+ }
+
+ break;
+ case 'types':
+ if (is_array($this->ribbonBinObjects) &&
+ isset($this->ribbonBinObjects['data']) && is_array($this->ribbonBinObjects['data'])) {
+ $tmpTypes = array_keys($this->ribbonBinObjects['data']);
+ $ReturnData = array_unique(array_map([$this, 'getExtensionOnly'], $tmpTypes));
+ } else {
+ $ReturnData = []; // the caller want an array... not null if empty
+ }
+
+ break;
+ }
+
+ return $ReturnData;
+ }
+
+ /**
+ * This workbook have a custom UI ?
+ *
+ * @return bool
+ */
+ public function hasRibbon()
+ {
+ return $this->ribbonXMLData !== null;
+ }
+
+ /**
+ * This workbook have additionnal object for the ribbon ?
+ *
+ * @return bool
+ */
+ public function hasRibbonBinObjects()
+ {
+ return $this->ribbonBinObjects !== null;
+ }
+
+ /**
+ * Check if a sheet with a specified code name already exists.
+ *
+ * @param string $pSheetCodeName Name of the worksheet to check
+ *
+ * @return bool
+ */
+ public function sheetCodeNameExists($pSheetCodeName)
+ {
+ return $this->getSheetByCodeName($pSheetCodeName) !== null;
+ }
+
+ /**
+ * Get sheet by code name. Warning : sheet don't have always a code name !
+ *
+ * @param string $pName Sheet name
+ *
+ * @return Worksheet
+ */
+ public function getSheetByCodeName($pName)
+ {
+ $worksheetCount = count($this->workSheetCollection);
+ for ($i = 0; $i < $worksheetCount; ++$i) {
+ if ($this->workSheetCollection[$i]->getCodeName() == $pName) {
+ return $this->workSheetCollection[$i];
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Create a new PhpSpreadsheet with one Worksheet.
+ */
+ public function __construct()
+ {
+ $this->uniqueID = uniqid('', true);
+ $this->calculationEngine = new Calculation($this);
+
+ // Initialise worksheet collection and add one worksheet
+ $this->workSheetCollection = [];
+ $this->workSheetCollection[] = new Worksheet($this);
+ $this->activeSheetIndex = 0;
+
+ // Create document properties
+ $this->properties = new Document\Properties();
+
+ // Create document security
+ $this->security = new Document\Security();
+
+ // Set named ranges
+ $this->namedRanges = [];
+
+ // Create the cellXf supervisor
+ $this->cellXfSupervisor = new Style(true);
+ $this->cellXfSupervisor->bindParent($this);
+
+ // Create the default style
+ $this->addCellXf(new Style());
+ $this->addCellStyleXf(new Style());
+ }
+
+ /**
+ * Code to execute when this worksheet is unset().
+ */
+ public function __destruct()
+ {
+ $this->calculationEngine = null;
+ $this->disconnectWorksheets();
+ }
+
+ /**
+ * Disconnect all worksheets from this PhpSpreadsheet workbook object,
+ * typically so that the PhpSpreadsheet object can be unset.
+ */
+ public function disconnectWorksheets()
+ {
+ $worksheet = null;
+ foreach ($this->workSheetCollection as $k => &$worksheet) {
+ $worksheet->disconnectCells();
+ $this->workSheetCollection[$k] = null;
+ }
+ unset($worksheet);
+ $this->workSheetCollection = [];
+ }
+
+ /**
+ * Return the calculation engine for this worksheet.
+ *
+ * @return Calculation
+ */
+ public function getCalculationEngine()
+ {
+ return $this->calculationEngine;
+ }
+
+ /**
+ * Get properties.
+ *
+ * @return Document\Properties
+ */
+ public function getProperties()
+ {
+ return $this->properties;
+ }
+
+ /**
+ * Set properties.
+ *
+ * @param Document\Properties $pValue
+ */
+ public function setProperties(Document\Properties $pValue)
+ {
+ $this->properties = $pValue;
+ }
+
+ /**
+ * Get security.
+ *
+ * @return Document\Security
+ */
+ public function getSecurity()
+ {
+ return $this->security;
+ }
+
+ /**
+ * Set security.
+ *
+ * @param Document\Security $pValue
+ */
+ public function setSecurity(Document\Security $pValue)
+ {
+ $this->security = $pValue;
+ }
+
+ /**
+ * Get active sheet.
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function getActiveSheet()
+ {
+ return $this->getSheet($this->activeSheetIndex);
+ }
+
+ /**
+ * Create sheet and add it to this workbook.
+ *
+ * @param null|int $sheetIndex Index where sheet should go (0,1,..., or null for last)
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function createSheet($sheetIndex = null)
+ {
+ $newSheet = new Worksheet($this);
+ $this->addSheet($newSheet, $sheetIndex);
+
+ return $newSheet;
+ }
+
+ /**
+ * Check if a sheet with a specified name already exists.
+ *
+ * @param string $pSheetName Name of the worksheet to check
+ *
+ * @return bool
+ */
+ public function sheetNameExists($pSheetName)
+ {
+ return $this->getSheetByName($pSheetName) !== null;
+ }
+
+ /**
+ * Add sheet.
+ *
+ * @param Worksheet $pSheet
+ * @param null|int $iSheetIndex Index where sheet should go (0,1,..., or null for last)
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function addSheet(Worksheet $pSheet, $iSheetIndex = null)
+ {
+ if ($this->sheetNameExists($pSheet->getTitle())) {
+ throw new Exception(
+ "Workbook already contains a worksheet named '{$pSheet->getTitle()}'. Rename this worksheet first."
+ );
+ }
+
+ if ($iSheetIndex === null) {
+ if ($this->activeSheetIndex < 0) {
+ $this->activeSheetIndex = 0;
+ }
+ $this->workSheetCollection[] = $pSheet;
+ } else {
+ // Insert the sheet at the requested index
+ array_splice(
+ $this->workSheetCollection,
+ $iSheetIndex,
+ 0,
+ [$pSheet]
+ );
+
+ // Adjust active sheet index if necessary
+ if ($this->activeSheetIndex >= $iSheetIndex) {
+ ++$this->activeSheetIndex;
+ }
+ }
+
+ if ($pSheet->getParent() === null) {
+ $pSheet->rebindParent($this);
+ }
+
+ return $pSheet;
+ }
+
+ /**
+ * Remove sheet by index.
+ *
+ * @param int $pIndex Active sheet index
+ *
+ * @throws Exception
+ */
+ public function removeSheetByIndex($pIndex)
+ {
+ $numSheets = count($this->workSheetCollection);
+ if ($pIndex > $numSheets - 1) {
+ throw new Exception(
+ "You tried to remove a sheet by the out of bounds index: {$pIndex}. The actual number of sheets is {$numSheets}."
+ );
+ }
+ array_splice($this->workSheetCollection, $pIndex, 1);
+
+ // Adjust active sheet index if necessary
+ if (($this->activeSheetIndex >= $pIndex) &&
+ ($pIndex > count($this->workSheetCollection) - 1)) {
+ --$this->activeSheetIndex;
+ }
+ }
+
+ /**
+ * Get sheet by index.
+ *
+ * @param int $pIndex Sheet index
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function getSheet($pIndex)
+ {
+ if (!isset($this->workSheetCollection[$pIndex])) {
+ $numSheets = $this->getSheetCount();
+
+ throw new Exception(
+ "Your requested sheet index: {$pIndex} is out of bounds. The actual number of sheets is {$numSheets}."
+ );
+ }
+
+ return $this->workSheetCollection[$pIndex];
+ }
+
+ /**
+ * Get all sheets.
+ *
+ * @return Worksheet[]
+ */
+ public function getAllSheets()
+ {
+ return $this->workSheetCollection;
+ }
+
+ /**
+ * Get sheet by name.
+ *
+ * @param string $pName Sheet name
+ *
+ * @return null|Worksheet
+ */
+ public function getSheetByName($pName)
+ {
+ $worksheetCount = count($this->workSheetCollection);
+ for ($i = 0; $i < $worksheetCount; ++$i) {
+ if ($this->workSheetCollection[$i]->getTitle() === $pName) {
+ return $this->workSheetCollection[$i];
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * Get index for sheet.
+ *
+ * @param Worksheet $pSheet
+ *
+ * @throws Exception
+ *
+ * @return int index
+ */
+ public function getIndex(Worksheet $pSheet)
+ {
+ foreach ($this->workSheetCollection as $key => $value) {
+ if ($value->getHashCode() == $pSheet->getHashCode()) {
+ return $key;
+ }
+ }
+
+ throw new Exception('Sheet does not exist.');
+ }
+
+ /**
+ * Set index for sheet by sheet name.
+ *
+ * @param string $sheetName Sheet name to modify index for
+ * @param int $newIndex New index for the sheet
+ *
+ * @throws Exception
+ *
+ * @return int New sheet index
+ */
+ public function setIndexByName($sheetName, $newIndex)
+ {
+ $oldIndex = $this->getIndex($this->getSheetByName($sheetName));
+ $pSheet = array_splice(
+ $this->workSheetCollection,
+ $oldIndex,
+ 1
+ );
+ array_splice(
+ $this->workSheetCollection,
+ $newIndex,
+ 0,
+ $pSheet
+ );
+
+ return $newIndex;
+ }
+
+ /**
+ * Get sheet count.
+ *
+ * @return int
+ */
+ public function getSheetCount()
+ {
+ return count($this->workSheetCollection);
+ }
+
+ /**
+ * Get active sheet index.
+ *
+ * @return int Active sheet index
+ */
+ public function getActiveSheetIndex()
+ {
+ return $this->activeSheetIndex;
+ }
+
+ /**
+ * Set active sheet index.
+ *
+ * @param int $pIndex Active sheet index
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function setActiveSheetIndex($pIndex)
+ {
+ $numSheets = count($this->workSheetCollection);
+
+ if ($pIndex > $numSheets - 1) {
+ throw new Exception(
+ "You tried to set a sheet active by the out of bounds index: {$pIndex}. The actual number of sheets is {$numSheets}."
+ );
+ }
+ $this->activeSheetIndex = $pIndex;
+
+ return $this->getActiveSheet();
+ }
+
+ /**
+ * Set active sheet index by name.
+ *
+ * @param string $pValue Sheet title
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function setActiveSheetIndexByName($pValue)
+ {
+ if (($worksheet = $this->getSheetByName($pValue)) instanceof Worksheet) {
+ $this->setActiveSheetIndex($this->getIndex($worksheet));
+
+ return $worksheet;
+ }
+
+ throw new Exception('Workbook does not contain sheet:' . $pValue);
+ }
+
+ /**
+ * Get sheet names.
+ *
+ * @return string[]
+ */
+ public function getSheetNames()
+ {
+ $returnValue = [];
+ $worksheetCount = $this->getSheetCount();
+ for ($i = 0; $i < $worksheetCount; ++$i) {
+ $returnValue[] = $this->getSheet($i)->getTitle();
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * Add external sheet.
+ *
+ * @param Worksheet $pSheet External sheet to add
+ * @param null|int $iSheetIndex Index where sheet should go (0,1,..., or null for last)
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function addExternalSheet(Worksheet $pSheet, $iSheetIndex = null)
+ {
+ if ($this->sheetNameExists($pSheet->getTitle())) {
+ throw new Exception("Workbook already contains a worksheet named '{$pSheet->getTitle()}'. Rename the external sheet first.");
+ }
+
+ // count how many cellXfs there are in this workbook currently, we will need this below
+ $countCellXfs = count($this->cellXfCollection);
+
+ // copy all the shared cellXfs from the external workbook and append them to the current
+ foreach ($pSheet->getParent()->getCellXfCollection() as $cellXf) {
+ $this->addCellXf(clone $cellXf);
+ }
+
+ // move sheet to this workbook
+ $pSheet->rebindParent($this);
+
+ // update the cellXfs
+ foreach ($pSheet->getCoordinates(false) as $coordinate) {
+ $cell = $pSheet->getCell($coordinate);
+ $cell->setXfIndex($cell->getXfIndex() + $countCellXfs);
+ }
+
+ return $this->addSheet($pSheet, $iSheetIndex);
+ }
+
+ /**
+ * Get named ranges.
+ *
+ * @return NamedRange[]
+ */
+ public function getNamedRanges()
+ {
+ return $this->namedRanges;
+ }
+
+ /**
+ * Add named range.
+ *
+ * @param NamedRange $namedRange
+ *
+ * @return bool
+ */
+ public function addNamedRange(NamedRange $namedRange)
+ {
+ if ($namedRange->getScope() == null) {
+ // global scope
+ $this->namedRanges[$namedRange->getName()] = $namedRange;
+ } else {
+ // local scope
+ $this->namedRanges[$namedRange->getScope()->getTitle() . '!' . $namedRange->getName()] = $namedRange;
+ }
+
+ return true;
+ }
+
+ /**
+ * Get named range.
+ *
+ * @param string $namedRange
+ * @param null|Worksheet $pSheet Scope. Use null for global scope
+ *
+ * @return null|NamedRange
+ */
+ public function getNamedRange($namedRange, Worksheet $pSheet = null)
+ {
+ $returnValue = null;
+
+ if ($namedRange != '' && ($namedRange !== null)) {
+ // first look for global defined name
+ if (isset($this->namedRanges[$namedRange])) {
+ $returnValue = $this->namedRanges[$namedRange];
+ }
+
+ // then look for local defined name (has priority over global defined name if both names exist)
+ if (($pSheet !== null) && isset($this->namedRanges[$pSheet->getTitle() . '!' . $namedRange])) {
+ $returnValue = $this->namedRanges[$pSheet->getTitle() . '!' . $namedRange];
+ }
+ }
+
+ return $returnValue;
+ }
+
+ /**
+ * Remove named range.
+ *
+ * @param string $namedRange
+ * @param null|Worksheet $pSheet scope: use null for global scope
+ *
+ * @return Spreadsheet
+ */
+ public function removeNamedRange($namedRange, Worksheet $pSheet = null)
+ {
+ if ($pSheet === null) {
+ if (isset($this->namedRanges[$namedRange])) {
+ unset($this->namedRanges[$namedRange]);
+ }
+ } else {
+ if (isset($this->namedRanges[$pSheet->getTitle() . '!' . $namedRange])) {
+ unset($this->namedRanges[$pSheet->getTitle() . '!' . $namedRange]);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get worksheet iterator.
+ *
+ * @return Iterator
+ */
+ public function getWorksheetIterator()
+ {
+ return new Iterator($this);
+ }
+
+ /**
+ * Copy workbook (!= clone!).
+ *
+ * @return Spreadsheet
+ */
+ public function copy()
+ {
+ $copied = clone $this;
+
+ $worksheetCount = count($this->workSheetCollection);
+ for ($i = 0; $i < $worksheetCount; ++$i) {
+ $this->workSheetCollection[$i] = $this->workSheetCollection[$i]->copy();
+ $this->workSheetCollection[$i]->rebindParent($this);
+ }
+
+ return $copied;
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone()
+ {
+ foreach ($this as $key => $val) {
+ if (is_object($val) || (is_array($val))) {
+ $this->{$key} = unserialize(serialize($val));
+ }
+ }
+ }
+
+ /**
+ * Get the workbook collection of cellXfs.
+ *
+ * @return Style[]
+ */
+ public function getCellXfCollection()
+ {
+ return $this->cellXfCollection;
+ }
+
+ /**
+ * Get cellXf by index.
+ *
+ * @param int $pIndex
+ *
+ * @return Style
+ */
+ public function getCellXfByIndex($pIndex)
+ {
+ return $this->cellXfCollection[$pIndex];
+ }
+
+ /**
+ * Get cellXf by hash code.
+ *
+ * @param string $pValue
+ *
+ * @return false|Style
+ */
+ public function getCellXfByHashCode($pValue)
+ {
+ foreach ($this->cellXfCollection as $cellXf) {
+ if ($cellXf->getHashCode() == $pValue) {
+ return $cellXf;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Check if style exists in style collection.
+ *
+ * @param Style $pCellStyle
+ *
+ * @return bool
+ */
+ public function cellXfExists($pCellStyle)
+ {
+ return in_array($pCellStyle, $this->cellXfCollection, true);
+ }
+
+ /**
+ * Get default style.
+ *
+ * @throws Exception
+ *
+ * @return Style
+ */
+ public function getDefaultStyle()
+ {
+ if (isset($this->cellXfCollection[0])) {
+ return $this->cellXfCollection[0];
+ }
+
+ throw new Exception('No default style found for this workbook');
+ }
+
+ /**
+ * Add a cellXf to the workbook.
+ *
+ * @param Style $style
+ */
+ public function addCellXf(Style $style)
+ {
+ $this->cellXfCollection[] = $style;
+ $style->setIndex(count($this->cellXfCollection) - 1);
+ }
+
+ /**
+ * Remove cellXf by index. It is ensured that all cells get their xf index updated.
+ *
+ * @param int $pIndex Index to cellXf
+ *
+ * @throws Exception
+ */
+ public function removeCellXfByIndex($pIndex)
+ {
+ if ($pIndex > count($this->cellXfCollection) - 1) {
+ throw new Exception('CellXf index is out of bounds.');
+ }
+
+ // first remove the cellXf
+ array_splice($this->cellXfCollection, $pIndex, 1);
+
+ // then update cellXf indexes for cells
+ foreach ($this->workSheetCollection as $worksheet) {
+ foreach ($worksheet->getCoordinates(false) as $coordinate) {
+ $cell = $worksheet->getCell($coordinate);
+ $xfIndex = $cell->getXfIndex();
+ if ($xfIndex > $pIndex) {
+ // decrease xf index by 1
+ $cell->setXfIndex($xfIndex - 1);
+ } elseif ($xfIndex == $pIndex) {
+ // set to default xf index 0
+ $cell->setXfIndex(0);
+ }
+ }
+ }
+ }
+
+ /**
+ * Get the cellXf supervisor.
+ *
+ * @return Style
+ */
+ public function getCellXfSupervisor()
+ {
+ return $this->cellXfSupervisor;
+ }
+
+ /**
+ * Get the workbook collection of cellStyleXfs.
+ *
+ * @return Style[]
+ */
+ public function getCellStyleXfCollection()
+ {
+ return $this->cellStyleXfCollection;
+ }
+
+ /**
+ * Get cellStyleXf by index.
+ *
+ * @param int $pIndex Index to cellXf
+ *
+ * @return Style
+ */
+ public function getCellStyleXfByIndex($pIndex)
+ {
+ return $this->cellStyleXfCollection[$pIndex];
+ }
+
+ /**
+ * Get cellStyleXf by hash code.
+ *
+ * @param string $pValue
+ *
+ * @return false|Style
+ */
+ public function getCellStyleXfByHashCode($pValue)
+ {
+ foreach ($this->cellStyleXfCollection as $cellStyleXf) {
+ if ($cellStyleXf->getHashCode() == $pValue) {
+ return $cellStyleXf;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Add a cellStyleXf to the workbook.
+ *
+ * @param Style $pStyle
+ */
+ public function addCellStyleXf(Style $pStyle)
+ {
+ $this->cellStyleXfCollection[] = $pStyle;
+ $pStyle->setIndex(count($this->cellStyleXfCollection) - 1);
+ }
+
+ /**
+ * Remove cellStyleXf by index.
+ *
+ * @param int $pIndex Index to cellXf
+ *
+ * @throws Exception
+ */
+ public function removeCellStyleXfByIndex($pIndex)
+ {
+ if ($pIndex > count($this->cellStyleXfCollection) - 1) {
+ throw new Exception('CellStyleXf index is out of bounds.');
+ }
+ array_splice($this->cellStyleXfCollection, $pIndex, 1);
+ }
+
+ /**
+ * Eliminate all unneeded cellXf and afterwards update the xfIndex for all cells
+ * and columns in the workbook.
+ */
+ public function garbageCollect()
+ {
+ // how many references are there to each cellXf ?
+ $countReferencesCellXf = [];
+ foreach ($this->cellXfCollection as $index => $cellXf) {
+ $countReferencesCellXf[$index] = 0;
+ }
+
+ foreach ($this->getWorksheetIterator() as $sheet) {
+ // from cells
+ foreach ($sheet->getCoordinates(false) as $coordinate) {
+ $cell = $sheet->getCell($coordinate);
+ ++$countReferencesCellXf[$cell->getXfIndex()];
+ }
+
+ // from row dimensions
+ foreach ($sheet->getRowDimensions() as $rowDimension) {
+ if ($rowDimension->getXfIndex() !== null) {
+ ++$countReferencesCellXf[$rowDimension->getXfIndex()];
+ }
+ }
+
+ // from column dimensions
+ foreach ($sheet->getColumnDimensions() as $columnDimension) {
+ ++$countReferencesCellXf[$columnDimension->getXfIndex()];
+ }
+ }
+
+ // remove cellXfs without references and create mapping so we can update xfIndex
+ // for all cells and columns
+ $countNeededCellXfs = 0;
+ foreach ($this->cellXfCollection as $index => $cellXf) {
+ if ($countReferencesCellXf[$index] > 0 || $index == 0) { // we must never remove the first cellXf
+ ++$countNeededCellXfs;
+ } else {
+ unset($this->cellXfCollection[$index]);
+ }
+ $map[$index] = $countNeededCellXfs - 1;
+ }
+ $this->cellXfCollection = array_values($this->cellXfCollection);
+
+ // update the index for all cellXfs
+ foreach ($this->cellXfCollection as $i => $cellXf) {
+ $cellXf->setIndex($i);
+ }
+
+ // make sure there is always at least one cellXf (there should be)
+ if (empty($this->cellXfCollection)) {
+ $this->cellXfCollection[] = new Style();
+ }
+
+ // update the xfIndex for all cells, row dimensions, column dimensions
+ foreach ($this->getWorksheetIterator() as $sheet) {
+ // for all cells
+ foreach ($sheet->getCoordinates(false) as $coordinate) {
+ $cell = $sheet->getCell($coordinate);
+ $cell->setXfIndex($map[$cell->getXfIndex()]);
+ }
+
+ // for all row dimensions
+ foreach ($sheet->getRowDimensions() as $rowDimension) {
+ if ($rowDimension->getXfIndex() !== null) {
+ $rowDimension->setXfIndex($map[$rowDimension->getXfIndex()]);
+ }
+ }
+
+ // for all column dimensions
+ foreach ($sheet->getColumnDimensions() as $columnDimension) {
+ $columnDimension->setXfIndex($map[$columnDimension->getXfIndex()]);
+ }
+
+ // also do garbage collection for all the sheets
+ $sheet->garbageCollect();
+ }
+ }
+
+ /**
+ * Return the unique ID value assigned to this spreadsheet workbook.
+ *
+ * @return string
+ */
+ public function getID()
+ {
+ return $this->uniqueID;
+ }
+
+ /**
+ * Get the visibility of the horizonal scroll bar in the application.
+ *
+ * @return bool True if horizonal scroll bar is visible
+ */
+ public function getShowHorizontalScroll()
+ {
+ return $this->showHorizontalScroll;
+ }
+
+ /**
+ * Set the visibility of the horizonal scroll bar in the application.
+ *
+ * @param bool $showHorizontalScroll True if horizonal scroll bar is visible
+ */
+ public function setShowHorizontalScroll($showHorizontalScroll)
+ {
+ $this->showHorizontalScroll = (bool) $showHorizontalScroll;
+ }
+
+ /**
+ * Get the visibility of the vertical scroll bar in the application.
+ *
+ * @return bool True if vertical scroll bar is visible
+ */
+ public function getShowVerticalScroll()
+ {
+ return $this->showVerticalScroll;
+ }
+
+ /**
+ * Set the visibility of the vertical scroll bar in the application.
+ *
+ * @param bool $showVerticalScroll True if vertical scroll bar is visible
+ */
+ public function setShowVerticalScroll($showVerticalScroll)
+ {
+ $this->showVerticalScroll = (bool) $showVerticalScroll;
+ }
+
+ /**
+ * Get the visibility of the sheet tabs in the application.
+ *
+ * @return bool True if the sheet tabs are visible
+ */
+ public function getShowSheetTabs()
+ {
+ return $this->showSheetTabs;
+ }
+
+ /**
+ * Set the visibility of the sheet tabs in the application.
+ *
+ * @param bool $showSheetTabs True if sheet tabs are visible
+ */
+ public function setShowSheetTabs($showSheetTabs)
+ {
+ $this->showSheetTabs = (bool) $showSheetTabs;
+ }
+
+ /**
+ * Return whether the workbook window is minimized.
+ *
+ * @return bool true if workbook window is minimized
+ */
+ public function getMinimized()
+ {
+ return $this->minimized;
+ }
+
+ /**
+ * Set whether the workbook window is minimized.
+ *
+ * @param bool $minimized true if workbook window is minimized
+ */
+ public function setMinimized($minimized)
+ {
+ $this->minimized = (bool) $minimized;
+ }
+
+ /**
+ * Return whether to group dates when presenting the user with
+ * filtering optiomd in the user interface.
+ *
+ * @return bool true if workbook window is minimized
+ */
+ public function getAutoFilterDateGrouping()
+ {
+ return $this->autoFilterDateGrouping;
+ }
+
+ /**
+ * Set whether to group dates when presenting the user with
+ * filtering optiomd in the user interface.
+ *
+ * @param bool $autoFilterDateGrouping true if workbook window is minimized
+ */
+ public function setAutoFilterDateGrouping($autoFilterDateGrouping)
+ {
+ $this->autoFilterDateGrouping = (bool) $autoFilterDateGrouping;
+ }
+
+ /**
+ * Return the first sheet in the book view.
+ *
+ * @return int First sheet in book view
+ */
+ public function getFirstSheetIndex()
+ {
+ return $this->firstSheetIndex;
+ }
+
+ /**
+ * Set the first sheet in the book view.
+ *
+ * @param int $firstSheetIndex First sheet in book view
+ *
+ * @throws Exception if the given value is invalid
+ */
+ public function setFirstSheetIndex($firstSheetIndex)
+ {
+ if ($firstSheetIndex >= 0) {
+ $this->firstSheetIndex = (int) $firstSheetIndex;
+ } else {
+ throw new Exception('First sheet index must be a positive integer.');
+ }
+ }
+
+ /**
+ * Return the visibility status of the workbook.
+ *
+ * This may be one of the following three values:
+ * - visibile
+ *
+ * @return string Visible status
+ */
+ public function getVisibility()
+ {
+ return $this->visibility;
+ }
+
+ /**
+ * Set the visibility status of the workbook.
+ *
+ * Valid values are:
+ * - 'visible' (self::VISIBILITY_VISIBLE):
+ * Workbook window is visible
+ * - 'hidden' (self::VISIBILITY_HIDDEN):
+ * Workbook window is hidden, but can be shown by the user
+ * via the user interface
+ * - 'veryHidden' (self::VISIBILITY_VERY_HIDDEN):
+ * Workbook window is hidden and cannot be shown in the
+ * user interface.
+ *
+ * @param string $visibility visibility status of the workbook
+ *
+ * @throws Exception if the given value is invalid
+ */
+ public function setVisibility($visibility)
+ {
+ if ($visibility === null) {
+ $visibility = self::VISIBILITY_VISIBLE;
+ }
+
+ if (in_array($visibility, self::$workbookViewVisibilityValues)) {
+ $this->visibility = $visibility;
+ } else {
+ throw new Exception('Invalid visibility value.');
+ }
+ }
+
+ /**
+ * Get the ratio between the workbook tabs bar and the horizontal scroll bar.
+ * TabRatio is assumed to be out of 1000 of the horizontal window width.
+ *
+ * @return int Ratio between the workbook tabs bar and the horizontal scroll bar
+ */
+ public function getTabRatio()
+ {
+ return $this->tabRatio;
+ }
+
+ /**
+ * Set the ratio between the workbook tabs bar and the horizontal scroll bar
+ * TabRatio is assumed to be out of 1000 of the horizontal window width.
+ *
+ * @param int $tabRatio Ratio between the tabs bar and the horizontal scroll bar
+ *
+ * @throws Exception if the given value is invalid
+ */
+ public function setTabRatio($tabRatio)
+ {
+ if ($tabRatio >= 0 || $tabRatio <= 1000) {
+ $this->tabRatio = (int) $tabRatio;
+ } else {
+ throw new Exception('Tab ratio must be between 0 and 1000.');
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Alignment.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Alignment.php
new file mode 100644
index 00000000000..b4df792b167
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Alignment.php
@@ -0,0 +1,466 @@
+horizontal = null;
+ $this->vertical = null;
+ $this->textRotation = null;
+ }
+ }
+
+ /**
+ * Get the shared style component for the currently active cell in currently active sheet.
+ * Only used for style supervisor.
+ *
+ * @return Alignment
+ */
+ public function getSharedComponent()
+ {
+ return $this->parent->getSharedComponent()->getAlignment();
+ }
+
+ /**
+ * Build style array from subcomponents.
+ *
+ * @param array $array
+ *
+ * @return array
+ */
+ public function getStyleArray($array)
+ {
+ return ['alignment' => $array];
+ }
+
+ /**
+ * Apply styles from array.
+ *
+ *
+ * $spreadsheet->getActiveSheet()->getStyle('B2')->getAlignment()->applyFromArray(
+ * [
+ * 'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
+ * 'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
+ * 'textRotation' => 0,
+ * 'wrapText' => TRUE
+ * ]
+ * );
+ *
+ *
+ * @param array $pStyles Array containing style information
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Alignment
+ */
+ public function applyFromArray(array $pStyles)
+ {
+ if ($this->isSupervisor) {
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())
+ ->applyFromArray($this->getStyleArray($pStyles));
+ } else {
+ if (isset($pStyles['horizontal'])) {
+ $this->setHorizontal($pStyles['horizontal']);
+ }
+ if (isset($pStyles['vertical'])) {
+ $this->setVertical($pStyles['vertical']);
+ }
+ if (isset($pStyles['textRotation'])) {
+ $this->setTextRotation($pStyles['textRotation']);
+ }
+ if (isset($pStyles['wrapText'])) {
+ $this->setWrapText($pStyles['wrapText']);
+ }
+ if (isset($pStyles['shrinkToFit'])) {
+ $this->setShrinkToFit($pStyles['shrinkToFit']);
+ }
+ if (isset($pStyles['indent'])) {
+ $this->setIndent($pStyles['indent']);
+ }
+ if (isset($pStyles['readOrder'])) {
+ $this->setReadOrder($pStyles['readOrder']);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Horizontal.
+ *
+ * @return string
+ */
+ public function getHorizontal()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getHorizontal();
+ }
+
+ return $this->horizontal;
+ }
+
+ /**
+ * Set Horizontal.
+ *
+ * @param string $pValue see self::HORIZONTAL_*
+ *
+ * @return Alignment
+ */
+ public function setHorizontal($pValue)
+ {
+ if ($pValue == '') {
+ $pValue = self::HORIZONTAL_GENERAL;
+ }
+
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['horizontal' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->horizontal = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Vertical.
+ *
+ * @return string
+ */
+ public function getVertical()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getVertical();
+ }
+
+ return $this->vertical;
+ }
+
+ /**
+ * Set Vertical.
+ *
+ * @param string $pValue see self::VERTICAL_*
+ *
+ * @return Alignment
+ */
+ public function setVertical($pValue)
+ {
+ if ($pValue == '') {
+ $pValue = self::VERTICAL_BOTTOM;
+ }
+
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['vertical' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->vertical = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get TextRotation.
+ *
+ * @return int
+ */
+ public function getTextRotation()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getTextRotation();
+ }
+
+ return $this->textRotation;
+ }
+
+ /**
+ * Set TextRotation.
+ *
+ * @param int $pValue
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Alignment
+ */
+ public function setTextRotation($pValue)
+ {
+ // Excel2007 value 255 => PhpSpreadsheet value -165
+ if ($pValue == 255) {
+ $pValue = -165;
+ }
+
+ // Set rotation
+ if (($pValue >= -90 && $pValue <= 90) || $pValue == -165) {
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['textRotation' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->textRotation = $pValue;
+ }
+ } else {
+ throw new PhpSpreadsheetException('Text rotation should be a value between -90 and 90.');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Wrap Text.
+ *
+ * @return bool
+ */
+ public function getWrapText()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getWrapText();
+ }
+
+ return $this->wrapText;
+ }
+
+ /**
+ * Set Wrap Text.
+ *
+ * @param bool $pValue
+ *
+ * @return Alignment
+ */
+ public function setWrapText($pValue)
+ {
+ if ($pValue == '') {
+ $pValue = false;
+ }
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['wrapText' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->wrapText = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Shrink to fit.
+ *
+ * @return bool
+ */
+ public function getShrinkToFit()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getShrinkToFit();
+ }
+
+ return $this->shrinkToFit;
+ }
+
+ /**
+ * Set Shrink to fit.
+ *
+ * @param bool $pValue
+ *
+ * @return Alignment
+ */
+ public function setShrinkToFit($pValue)
+ {
+ if ($pValue == '') {
+ $pValue = false;
+ }
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['shrinkToFit' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->shrinkToFit = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get indent.
+ *
+ * @return int
+ */
+ public function getIndent()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getIndent();
+ }
+
+ return $this->indent;
+ }
+
+ /**
+ * Set indent.
+ *
+ * @param int $pValue
+ *
+ * @return Alignment
+ */
+ public function setIndent($pValue)
+ {
+ if ($pValue > 0) {
+ if ($this->getHorizontal() != self::HORIZONTAL_GENERAL &&
+ $this->getHorizontal() != self::HORIZONTAL_LEFT &&
+ $this->getHorizontal() != self::HORIZONTAL_RIGHT) {
+ $pValue = 0; // indent not supported
+ }
+ }
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['indent' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->indent = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get read order.
+ *
+ * @return int
+ */
+ public function getReadOrder()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getReadOrder();
+ }
+
+ return $this->readOrder;
+ }
+
+ /**
+ * Set read order.
+ *
+ * @param int $pValue
+ *
+ * @return Alignment
+ */
+ public function setReadOrder($pValue)
+ {
+ if ($pValue < 0 || $pValue > 2) {
+ $pValue = 0;
+ }
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['readOrder' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->readOrder = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getHashCode();
+ }
+
+ return md5(
+ $this->horizontal .
+ $this->vertical .
+ $this->textRotation .
+ ($this->wrapText ? 't' : 'f') .
+ ($this->shrinkToFit ? 't' : 'f') .
+ $this->indent .
+ $this->readOrder .
+ __CLASS__
+ );
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Border.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Border.php
new file mode 100644
index 00000000000..c957cf595a9
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Border.php
@@ -0,0 +1,239 @@
+color = new Color(Color::COLOR_BLACK, $isSupervisor);
+
+ // bind parent if we are a supervisor
+ if ($isSupervisor) {
+ $this->color->bindParent($this, 'color');
+ }
+ }
+
+ /**
+ * Get the shared style component for the currently active cell in currently active sheet.
+ * Only used for style supervisor.
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Border
+ */
+ public function getSharedComponent()
+ {
+ switch ($this->parentPropertyName) {
+ case 'allBorders':
+ case 'horizontal':
+ case 'inside':
+ case 'outline':
+ case 'vertical':
+ throw new PhpSpreadsheetException('Cannot get shared component for a pseudo-border.');
+
+ break;
+ case 'bottom':
+ return $this->parent->getSharedComponent()->getBottom();
+ case 'diagonal':
+ return $this->parent->getSharedComponent()->getDiagonal();
+ case 'left':
+ return $this->parent->getSharedComponent()->getLeft();
+ case 'right':
+ return $this->parent->getSharedComponent()->getRight();
+ case 'top':
+ return $this->parent->getSharedComponent()->getTop();
+ }
+ }
+
+ /**
+ * Build style array from subcomponents.
+ *
+ * @param array $array
+ *
+ * @return array
+ */
+ public function getStyleArray($array)
+ {
+ return $this->parent->getStyleArray([$this->parentPropertyName => $array]);
+ }
+
+ /**
+ * Apply styles from array.
+ *
+ *
+ * $spreadsheet->getActiveSheet()->getStyle('B2')->getBorders()->getTop()->applyFromArray(
+ * [
+ * 'borderStyle' => Border::BORDER_DASHDOT,
+ * 'color' => [
+ * 'rgb' => '808080'
+ * ]
+ * ]
+ * );
+ *
+ *
+ * @param array $pStyles Array containing style information
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Border
+ */
+ public function applyFromArray(array $pStyles)
+ {
+ if ($this->isSupervisor) {
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
+ } else {
+ if (isset($pStyles['borderStyle'])) {
+ $this->setBorderStyle($pStyles['borderStyle']);
+ }
+ if (isset($pStyles['color'])) {
+ $this->getColor()->applyFromArray($pStyles['color']);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Border style.
+ *
+ * @return string
+ */
+ public function getBorderStyle()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getBorderStyle();
+ }
+
+ return $this->borderStyle;
+ }
+
+ /**
+ * Set Border style.
+ *
+ * @param bool|string $pValue
+ * When passing a boolean, FALSE equates Border::BORDER_NONE
+ * and TRUE to Border::BORDER_MEDIUM
+ *
+ * @return Border
+ */
+ public function setBorderStyle($pValue)
+ {
+ if (empty($pValue)) {
+ $pValue = self::BORDER_NONE;
+ } elseif (is_bool($pValue) && $pValue) {
+ $pValue = self::BORDER_MEDIUM;
+ }
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['borderStyle' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->borderStyle = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Border Color.
+ *
+ * @return Color
+ */
+ public function getColor()
+ {
+ return $this->color;
+ }
+
+ /**
+ * Set Border Color.
+ *
+ * @param Color $pValue
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Border
+ */
+ public function setColor(Color $pValue)
+ {
+ // make sure parameter is a real color and not a supervisor
+ $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;
+
+ if ($this->isSupervisor) {
+ $styleArray = $this->getColor()->getStyleArray(['argb' => $color->getARGB()]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->color = $color;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getHashCode();
+ }
+
+ return md5(
+ $this->borderStyle .
+ $this->color->getHashCode() .
+ __CLASS__
+ );
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Borders.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Borders.php
new file mode 100644
index 00000000000..a1d6759b936
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Borders.php
@@ -0,0 +1,423 @@
+left = new Border($isSupervisor, $isConditional);
+ $this->right = new Border($isSupervisor, $isConditional);
+ $this->top = new Border($isSupervisor, $isConditional);
+ $this->bottom = new Border($isSupervisor, $isConditional);
+ $this->diagonal = new Border($isSupervisor, $isConditional);
+ $this->diagonalDirection = self::DIAGONAL_NONE;
+
+ // Specially for supervisor
+ if ($isSupervisor) {
+ // Initialize pseudo-borders
+ $this->allBorders = new Border(true);
+ $this->outline = new Border(true);
+ $this->inside = new Border(true);
+ $this->vertical = new Border(true);
+ $this->horizontal = new Border(true);
+
+ // bind parent if we are a supervisor
+ $this->left->bindParent($this, 'left');
+ $this->right->bindParent($this, 'right');
+ $this->top->bindParent($this, 'top');
+ $this->bottom->bindParent($this, 'bottom');
+ $this->diagonal->bindParent($this, 'diagonal');
+ $this->allBorders->bindParent($this, 'allBorders');
+ $this->outline->bindParent($this, 'outline');
+ $this->inside->bindParent($this, 'inside');
+ $this->vertical->bindParent($this, 'vertical');
+ $this->horizontal->bindParent($this, 'horizontal');
+ }
+ }
+
+ /**
+ * Get the shared style component for the currently active cell in currently active sheet.
+ * Only used for style supervisor.
+ *
+ * @return Borders
+ */
+ public function getSharedComponent()
+ {
+ return $this->parent->getSharedComponent()->getBorders();
+ }
+
+ /**
+ * Build style array from subcomponents.
+ *
+ * @param array $array
+ *
+ * @return array
+ */
+ public function getStyleArray($array)
+ {
+ return ['borders' => $array];
+ }
+
+ /**
+ * Apply styles from array.
+ *
+ *
+ * $spreadsheet->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray(
+ * [
+ * 'bottom' => [
+ * 'borderStyle' => Border::BORDER_DASHDOT,
+ * 'color' => [
+ * 'rgb' => '808080'
+ * ]
+ * ],
+ * 'top' => [
+ * 'borderStyle' => Border::BORDER_DASHDOT,
+ * 'color' => [
+ * 'rgb' => '808080'
+ * ]
+ * ]
+ * ]
+ * );
+ *
+ *
+ *
+ * $spreadsheet->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray(
+ * [
+ * 'allBorders' => [
+ * 'borderStyle' => Border::BORDER_DASHDOT,
+ * 'color' => [
+ * 'rgb' => '808080'
+ * ]
+ * ]
+ * ]
+ * );
+ *
+ *
+ * @param array $pStyles Array containing style information
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Borders
+ */
+ public function applyFromArray(array $pStyles)
+ {
+ if ($this->isSupervisor) {
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
+ } else {
+ if (isset($pStyles['left'])) {
+ $this->getLeft()->applyFromArray($pStyles['left']);
+ }
+ if (isset($pStyles['right'])) {
+ $this->getRight()->applyFromArray($pStyles['right']);
+ }
+ if (isset($pStyles['top'])) {
+ $this->getTop()->applyFromArray($pStyles['top']);
+ }
+ if (isset($pStyles['bottom'])) {
+ $this->getBottom()->applyFromArray($pStyles['bottom']);
+ }
+ if (isset($pStyles['diagonal'])) {
+ $this->getDiagonal()->applyFromArray($pStyles['diagonal']);
+ }
+ if (isset($pStyles['diagonalDirection'])) {
+ $this->setDiagonalDirection($pStyles['diagonalDirection']);
+ }
+ if (isset($pStyles['allBorders'])) {
+ $this->getLeft()->applyFromArray($pStyles['allBorders']);
+ $this->getRight()->applyFromArray($pStyles['allBorders']);
+ $this->getTop()->applyFromArray($pStyles['allBorders']);
+ $this->getBottom()->applyFromArray($pStyles['allBorders']);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Left.
+ *
+ * @return Border
+ */
+ public function getLeft()
+ {
+ return $this->left;
+ }
+
+ /**
+ * Get Right.
+ *
+ * @return Border
+ */
+ public function getRight()
+ {
+ return $this->right;
+ }
+
+ /**
+ * Get Top.
+ *
+ * @return Border
+ */
+ public function getTop()
+ {
+ return $this->top;
+ }
+
+ /**
+ * Get Bottom.
+ *
+ * @return Border
+ */
+ public function getBottom()
+ {
+ return $this->bottom;
+ }
+
+ /**
+ * Get Diagonal.
+ *
+ * @return Border
+ */
+ public function getDiagonal()
+ {
+ return $this->diagonal;
+ }
+
+ /**
+ * Get AllBorders (pseudo-border). Only applies to supervisor.
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Border
+ */
+ public function getAllBorders()
+ {
+ if (!$this->isSupervisor) {
+ throw new PhpSpreadsheetException('Can only get pseudo-border for supervisor.');
+ }
+
+ return $this->allBorders;
+ }
+
+ /**
+ * Get Outline (pseudo-border). Only applies to supervisor.
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Border
+ */
+ public function getOutline()
+ {
+ if (!$this->isSupervisor) {
+ throw new PhpSpreadsheetException('Can only get pseudo-border for supervisor.');
+ }
+
+ return $this->outline;
+ }
+
+ /**
+ * Get Inside (pseudo-border). Only applies to supervisor.
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Border
+ */
+ public function getInside()
+ {
+ if (!$this->isSupervisor) {
+ throw new PhpSpreadsheetException('Can only get pseudo-border for supervisor.');
+ }
+
+ return $this->inside;
+ }
+
+ /**
+ * Get Vertical (pseudo-border). Only applies to supervisor.
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Border
+ */
+ public function getVertical()
+ {
+ if (!$this->isSupervisor) {
+ throw new PhpSpreadsheetException('Can only get pseudo-border for supervisor.');
+ }
+
+ return $this->vertical;
+ }
+
+ /**
+ * Get Horizontal (pseudo-border). Only applies to supervisor.
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Border
+ */
+ public function getHorizontal()
+ {
+ if (!$this->isSupervisor) {
+ throw new PhpSpreadsheetException('Can only get pseudo-border for supervisor.');
+ }
+
+ return $this->horizontal;
+ }
+
+ /**
+ * Get DiagonalDirection.
+ *
+ * @return int
+ */
+ public function getDiagonalDirection()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getDiagonalDirection();
+ }
+
+ return $this->diagonalDirection;
+ }
+
+ /**
+ * Set DiagonalDirection.
+ *
+ * @param int $pValue see self::DIAGONAL_*
+ *
+ * @return Borders
+ */
+ public function setDiagonalDirection($pValue)
+ {
+ if ($pValue == '') {
+ $pValue = self::DIAGONAL_NONE;
+ }
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['diagonalDirection' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->diagonalDirection = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getHashcode();
+ }
+
+ return md5(
+ $this->getLeft()->getHashCode() .
+ $this->getRight()->getHashCode() .
+ $this->getTop()->getHashCode() .
+ $this->getBottom()->getHashCode() .
+ $this->getDiagonal()->getHashCode() .
+ $this->getDiagonalDirection() .
+ __CLASS__
+ );
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Color.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Color.php
new file mode 100644
index 00000000000..8a1812d20b7
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Color.php
@@ -0,0 +1,403 @@
+argb = $pARGB;
+ }
+ }
+
+ /**
+ * Get the shared style component for the currently active cell in currently active sheet.
+ * Only used for style supervisor.
+ *
+ * @return Color
+ */
+ public function getSharedComponent()
+ {
+ switch ($this->parentPropertyName) {
+ case 'endColor':
+ return $this->parent->getSharedComponent()->getEndColor();
+ case 'color':
+ return $this->parent->getSharedComponent()->getColor();
+ case 'startColor':
+ return $this->parent->getSharedComponent()->getStartColor();
+ }
+ }
+
+ /**
+ * Build style array from subcomponents.
+ *
+ * @param array $array
+ *
+ * @return array
+ */
+ public function getStyleArray($array)
+ {
+ return $this->parent->getStyleArray([$this->parentPropertyName => $array]);
+ }
+
+ /**
+ * Apply styles from array.
+ *
+ *
+ * $spreadsheet->getActiveSheet()->getStyle('B2')->getFont()->getColor()->applyFromArray(['rgb' => '808080']);
+ *
+ *
+ * @param array $pStyles Array containing style information
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Color
+ */
+ public function applyFromArray(array $pStyles)
+ {
+ if ($this->isSupervisor) {
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
+ } else {
+ if (isset($pStyles['rgb'])) {
+ $this->setRGB($pStyles['rgb']);
+ }
+ if (isset($pStyles['argb'])) {
+ $this->setARGB($pStyles['argb']);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get ARGB.
+ *
+ * @return string
+ */
+ public function getARGB()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getARGB();
+ }
+
+ return $this->argb;
+ }
+
+ /**
+ * Set ARGB.
+ *
+ * @param string $pValue see self::COLOR_*
+ *
+ * @return Color
+ */
+ public function setARGB($pValue)
+ {
+ if ($pValue == '') {
+ $pValue = self::COLOR_BLACK;
+ }
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['argb' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->argb = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get RGB.
+ *
+ * @return string
+ */
+ public function getRGB()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getRGB();
+ }
+
+ return substr($this->argb, 2);
+ }
+
+ /**
+ * Set RGB.
+ *
+ * @param string $pValue RGB value
+ *
+ * @return Color
+ */
+ public function setRGB($pValue)
+ {
+ if ($pValue == '') {
+ $pValue = '000000';
+ }
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['argb' => 'FF' . $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->argb = 'FF' . $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get a specified colour component of an RGB value.
+ *
+ * @param string $RGB The colour as an RGB value (e.g. FF00CCCC or CCDDEE
+ * @param int $offset Position within the RGB value to extract
+ * @param bool $hex Flag indicating whether the component should be returned as a hex or a
+ * decimal value
+ *
+ * @return string The extracted colour component
+ */
+ private static function getColourComponent($RGB, $offset, $hex = true)
+ {
+ $colour = substr($RGB, $offset, 2);
+ if (!$hex) {
+ $colour = hexdec($colour);
+ }
+
+ return $colour;
+ }
+
+ /**
+ * Get the red colour component of an RGB value.
+ *
+ * @param string $RGB The colour as an RGB value (e.g. FF00CCCC or CCDDEE
+ * @param bool $hex Flag indicating whether the component should be returned as a hex or a
+ * decimal value
+ *
+ * @return string The red colour component
+ */
+ public static function getRed($RGB, $hex = true)
+ {
+ return self::getColourComponent($RGB, strlen($RGB) - 6, $hex);
+ }
+
+ /**
+ * Get the green colour component of an RGB value.
+ *
+ * @param string $RGB The colour as an RGB value (e.g. FF00CCCC or CCDDEE
+ * @param bool $hex Flag indicating whether the component should be returned as a hex or a
+ * decimal value
+ *
+ * @return string The green colour component
+ */
+ public static function getGreen($RGB, $hex = true)
+ {
+ return self::getColourComponent($RGB, strlen($RGB) - 4, $hex);
+ }
+
+ /**
+ * Get the blue colour component of an RGB value.
+ *
+ * @param string $RGB The colour as an RGB value (e.g. FF00CCCC or CCDDEE
+ * @param bool $hex Flag indicating whether the component should be returned as a hex or a
+ * decimal value
+ *
+ * @return string The blue colour component
+ */
+ public static function getBlue($RGB, $hex = true)
+ {
+ return self::getColourComponent($RGB, strlen($RGB) - 2, $hex);
+ }
+
+ /**
+ * Adjust the brightness of a color.
+ *
+ * @param string $hex The colour as an RGBA or RGB value (e.g. FF00CCCC or CCDDEE)
+ * @param float $adjustPercentage The percentage by which to adjust the colour as a float from -1 to 1
+ *
+ * @return string The adjusted colour as an RGBA or RGB value (e.g. FF00CCCC or CCDDEE)
+ */
+ public static function changeBrightness($hex, $adjustPercentage)
+ {
+ $rgba = (strlen($hex) == 8);
+
+ $red = self::getRed($hex, false);
+ $green = self::getGreen($hex, false);
+ $blue = self::getBlue($hex, false);
+ if ($adjustPercentage > 0) {
+ $red += (255 - $red) * $adjustPercentage;
+ $green += (255 - $green) * $adjustPercentage;
+ $blue += (255 - $blue) * $adjustPercentage;
+ } else {
+ $red += $red * $adjustPercentage;
+ $green += $green * $adjustPercentage;
+ $blue += $blue * $adjustPercentage;
+ }
+
+ if ($red < 0) {
+ $red = 0;
+ } elseif ($red > 255) {
+ $red = 255;
+ }
+ if ($green < 0) {
+ $green = 0;
+ } elseif ($green > 255) {
+ $green = 255;
+ }
+ if ($blue < 0) {
+ $blue = 0;
+ } elseif ($blue > 255) {
+ $blue = 255;
+ }
+
+ $rgb = strtoupper(
+ str_pad(dechex($red), 2, '0', 0) .
+ str_pad(dechex($green), 2, '0', 0) .
+ str_pad(dechex($blue), 2, '0', 0)
+ );
+
+ return (($rgba) ? 'FF' : '') . $rgb;
+ }
+
+ /**
+ * Get indexed color.
+ *
+ * @param int $pIndex Index entry point into the colour array
+ * @param bool $background Flag to indicate whether default background or foreground colour
+ * should be returned if the indexed colour doesn't exist
+ *
+ * @return Color
+ */
+ public static function indexedColor($pIndex, $background = false)
+ {
+ // Clean parameter
+ $pIndex = (int) $pIndex;
+
+ // Indexed colors
+ if (self::$indexedColors === null) {
+ self::$indexedColors = [
+ 1 => 'FF000000', // System Colour #1 - Black
+ 2 => 'FFFFFFFF', // System Colour #2 - White
+ 3 => 'FFFF0000', // System Colour #3 - Red
+ 4 => 'FF00FF00', // System Colour #4 - Green
+ 5 => 'FF0000FF', // System Colour #5 - Blue
+ 6 => 'FFFFFF00', // System Colour #6 - Yellow
+ 7 => 'FFFF00FF', // System Colour #7- Magenta
+ 8 => 'FF00FFFF', // System Colour #8- Cyan
+ 9 => 'FF800000', // Standard Colour #9
+ 10 => 'FF008000', // Standard Colour #10
+ 11 => 'FF000080', // Standard Colour #11
+ 12 => 'FF808000', // Standard Colour #12
+ 13 => 'FF800080', // Standard Colour #13
+ 14 => 'FF008080', // Standard Colour #14
+ 15 => 'FFC0C0C0', // Standard Colour #15
+ 16 => 'FF808080', // Standard Colour #16
+ 17 => 'FF9999FF', // Chart Fill Colour #17
+ 18 => 'FF993366', // Chart Fill Colour #18
+ 19 => 'FFFFFFCC', // Chart Fill Colour #19
+ 20 => 'FFCCFFFF', // Chart Fill Colour #20
+ 21 => 'FF660066', // Chart Fill Colour #21
+ 22 => 'FFFF8080', // Chart Fill Colour #22
+ 23 => 'FF0066CC', // Chart Fill Colour #23
+ 24 => 'FFCCCCFF', // Chart Fill Colour #24
+ 25 => 'FF000080', // Chart Line Colour #25
+ 26 => 'FFFF00FF', // Chart Line Colour #26
+ 27 => 'FFFFFF00', // Chart Line Colour #27
+ 28 => 'FF00FFFF', // Chart Line Colour #28
+ 29 => 'FF800080', // Chart Line Colour #29
+ 30 => 'FF800000', // Chart Line Colour #30
+ 31 => 'FF008080', // Chart Line Colour #31
+ 32 => 'FF0000FF', // Chart Line Colour #32
+ 33 => 'FF00CCFF', // Standard Colour #33
+ 34 => 'FFCCFFFF', // Standard Colour #34
+ 35 => 'FFCCFFCC', // Standard Colour #35
+ 36 => 'FFFFFF99', // Standard Colour #36
+ 37 => 'FF99CCFF', // Standard Colour #37
+ 38 => 'FFFF99CC', // Standard Colour #38
+ 39 => 'FFCC99FF', // Standard Colour #39
+ 40 => 'FFFFCC99', // Standard Colour #40
+ 41 => 'FF3366FF', // Standard Colour #41
+ 42 => 'FF33CCCC', // Standard Colour #42
+ 43 => 'FF99CC00', // Standard Colour #43
+ 44 => 'FFFFCC00', // Standard Colour #44
+ 45 => 'FFFF9900', // Standard Colour #45
+ 46 => 'FFFF6600', // Standard Colour #46
+ 47 => 'FF666699', // Standard Colour #47
+ 48 => 'FF969696', // Standard Colour #48
+ 49 => 'FF003366', // Standard Colour #49
+ 50 => 'FF339966', // Standard Colour #50
+ 51 => 'FF003300', // Standard Colour #51
+ 52 => 'FF333300', // Standard Colour #52
+ 53 => 'FF993300', // Standard Colour #53
+ 54 => 'FF993366', // Standard Colour #54
+ 55 => 'FF333399', // Standard Colour #55
+ 56 => 'FF333333', // Standard Colour #56
+ ];
+ }
+
+ if (isset(self::$indexedColors[$pIndex])) {
+ return new self(self::$indexedColors[$pIndex]);
+ }
+
+ if ($background) {
+ return new self(self::COLOR_WHITE);
+ }
+
+ return new self(self::COLOR_BLACK);
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getHashCode();
+ }
+
+ return md5(
+ $this->argb .
+ __CLASS__
+ );
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Conditional.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Conditional.php
new file mode 100644
index 00000000000..91a000dba4a
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Conditional.php
@@ -0,0 +1,272 @@
+style = new Style(false, true);
+ }
+
+ /**
+ * Get Condition type.
+ *
+ * @return string
+ */
+ public function getConditionType()
+ {
+ return $this->conditionType;
+ }
+
+ /**
+ * Set Condition type.
+ *
+ * @param string $pValue Condition type, see self::CONDITION_*
+ *
+ * @return Conditional
+ */
+ public function setConditionType($pValue)
+ {
+ $this->conditionType = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Operator type.
+ *
+ * @return string
+ */
+ public function getOperatorType()
+ {
+ return $this->operatorType;
+ }
+
+ /**
+ * Set Operator type.
+ *
+ * @param string $pValue Conditional operator type, see self::OPERATOR_*
+ *
+ * @return Conditional
+ */
+ public function setOperatorType($pValue)
+ {
+ $this->operatorType = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get text.
+ *
+ * @return string
+ */
+ public function getText()
+ {
+ return $this->text;
+ }
+
+ /**
+ * Set text.
+ *
+ * @param string $value
+ *
+ * @return Conditional
+ */
+ public function setText($value)
+ {
+ $this->text = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get StopIfTrue.
+ *
+ * @return bool
+ */
+ public function getStopIfTrue()
+ {
+ return $this->stopIfTrue;
+ }
+
+ /**
+ * Set StopIfTrue.
+ *
+ * @param bool $value
+ *
+ * @return Conditional
+ */
+ public function setStopIfTrue($value)
+ {
+ $this->stopIfTrue = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get Conditions.
+ *
+ * @return string[]
+ */
+ public function getConditions()
+ {
+ return $this->condition;
+ }
+
+ /**
+ * Set Conditions.
+ *
+ * @param string[] $pValue Condition
+ *
+ * @return Conditional
+ */
+ public function setConditions($pValue)
+ {
+ if (!is_array($pValue)) {
+ $pValue = [$pValue];
+ }
+ $this->condition = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Add Condition.
+ *
+ * @param string $pValue Condition
+ *
+ * @return Conditional
+ */
+ public function addCondition($pValue)
+ {
+ $this->condition[] = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Style.
+ *
+ * @return Style
+ */
+ public function getStyle()
+ {
+ return $this->style;
+ }
+
+ /**
+ * Set Style.
+ *
+ * @param Style $pValue
+ *
+ * @return Conditional
+ */
+ public function setStyle(Style $pValue = null)
+ {
+ $this->style = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ return md5(
+ $this->conditionType .
+ $this->operatorType .
+ implode(';', $this->condition) .
+ $this->style->getHashCode() .
+ __CLASS__
+ );
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Fill.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Fill.php
new file mode 100644
index 00000000000..c2ad895ee12
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Fill.php
@@ -0,0 +1,325 @@
+fillType = null;
+ }
+ $this->startColor = new Color(Color::COLOR_WHITE, $isSupervisor, $isConditional);
+ $this->endColor = new Color(Color::COLOR_BLACK, $isSupervisor, $isConditional);
+
+ // bind parent if we are a supervisor
+ if ($isSupervisor) {
+ $this->startColor->bindParent($this, 'startColor');
+ $this->endColor->bindParent($this, 'endColor');
+ }
+ }
+
+ /**
+ * Get the shared style component for the currently active cell in currently active sheet.
+ * Only used for style supervisor.
+ *
+ * @return Fill
+ */
+ public function getSharedComponent()
+ {
+ return $this->parent->getSharedComponent()->getFill();
+ }
+
+ /**
+ * Build style array from subcomponents.
+ *
+ * @param array $array
+ *
+ * @return array
+ */
+ public function getStyleArray($array)
+ {
+ return ['fill' => $array];
+ }
+
+ /**
+ * Apply styles from array.
+ *
+ *
+ * $spreadsheet->getActiveSheet()->getStyle('B2')->getFill()->applyFromArray(
+ * [
+ * 'fillType' => Fill::FILL_GRADIENT_LINEAR,
+ * 'rotation' => 0,
+ * 'startColor' => [
+ * 'rgb' => '000000'
+ * ],
+ * 'endColor' => [
+ * 'argb' => 'FFFFFFFF'
+ * ]
+ * ]
+ * );
+ *
+ *
+ * @param array $pStyles Array containing style information
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Fill
+ */
+ public function applyFromArray(array $pStyles)
+ {
+ if ($this->isSupervisor) {
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
+ } else {
+ if (isset($pStyles['fillType'])) {
+ $this->setFillType($pStyles['fillType']);
+ }
+ if (isset($pStyles['rotation'])) {
+ $this->setRotation($pStyles['rotation']);
+ }
+ if (isset($pStyles['startColor'])) {
+ $this->getStartColor()->applyFromArray($pStyles['startColor']);
+ }
+ if (isset($pStyles['endColor'])) {
+ $this->getEndColor()->applyFromArray($pStyles['endColor']);
+ }
+ if (isset($pStyles['color'])) {
+ $this->getStartColor()->applyFromArray($pStyles['color']);
+ $this->getEndColor()->applyFromArray($pStyles['color']);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Fill Type.
+ *
+ * @return string
+ */
+ public function getFillType()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getFillType();
+ }
+
+ return $this->fillType;
+ }
+
+ /**
+ * Set Fill Type.
+ *
+ * @param string $pValue Fill type, see self::FILL_*
+ *
+ * @return Fill
+ */
+ public function setFillType($pValue)
+ {
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['fillType' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->fillType = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Rotation.
+ *
+ * @return float
+ */
+ public function getRotation()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getRotation();
+ }
+
+ return $this->rotation;
+ }
+
+ /**
+ * Set Rotation.
+ *
+ * @param float $pValue
+ *
+ * @return Fill
+ */
+ public function setRotation($pValue)
+ {
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['rotation' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->rotation = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Start Color.
+ *
+ * @return Color
+ */
+ public function getStartColor()
+ {
+ return $this->startColor;
+ }
+
+ /**
+ * Set Start Color.
+ *
+ * @param Color $pValue
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Fill
+ */
+ public function setStartColor(Color $pValue)
+ {
+ // make sure parameter is a real color and not a supervisor
+ $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;
+
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStartColor()->getStyleArray(['argb' => $color->getARGB()]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->startColor = $color;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get End Color.
+ *
+ * @return Color
+ */
+ public function getEndColor()
+ {
+ return $this->endColor;
+ }
+
+ /**
+ * Set End Color.
+ *
+ * @param Color $pValue
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Fill
+ */
+ public function setEndColor(Color $pValue)
+ {
+ // make sure parameter is a real color and not a supervisor
+ $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;
+
+ if ($this->isSupervisor) {
+ $styleArray = $this->getEndColor()->getStyleArray(['argb' => $color->getARGB()]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->endColor = $color;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getHashCode();
+ }
+
+ return md5(
+ $this->getFillType() .
+ $this->getRotation() .
+ $this->getStartColor()->getHashCode() .
+ $this->getEndColor()->getHashCode() .
+ __CLASS__
+ );
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Font.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Font.php
new file mode 100644
index 00000000000..6d8e23b1954
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Font.php
@@ -0,0 +1,556 @@
+name = null;
+ $this->size = null;
+ $this->bold = null;
+ $this->italic = null;
+ $this->superscript = null;
+ $this->subscript = null;
+ $this->underline = null;
+ $this->strikethrough = null;
+ $this->color = new Color(Color::COLOR_BLACK, $isSupervisor, $isConditional);
+ } else {
+ $this->color = new Color(Color::COLOR_BLACK, $isSupervisor);
+ }
+ // bind parent if we are a supervisor
+ if ($isSupervisor) {
+ $this->color->bindParent($this, 'color');
+ }
+ }
+
+ /**
+ * Get the shared style component for the currently active cell in currently active sheet.
+ * Only used for style supervisor.
+ *
+ * @return Font
+ */
+ public function getSharedComponent()
+ {
+ return $this->parent->getSharedComponent()->getFont();
+ }
+
+ /**
+ * Build style array from subcomponents.
+ *
+ * @param array $array
+ *
+ * @return array
+ */
+ public function getStyleArray($array)
+ {
+ return ['font' => $array];
+ }
+
+ /**
+ * Apply styles from array.
+ *
+ *
+ * $spreadsheet->getActiveSheet()->getStyle('B2')->getFont()->applyFromArray(
+ * [
+ * 'name' => 'Arial',
+ * 'bold' => TRUE,
+ * 'italic' => FALSE,
+ * 'underline' => \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE,
+ * 'strikethrough' => FALSE,
+ * 'color' => [
+ * 'rgb' => '808080'
+ * ]
+ * ]
+ * );
+ *
+ *
+ * @param array $pStyles Array containing style information
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Font
+ */
+ public function applyFromArray(array $pStyles)
+ {
+ if ($this->isSupervisor) {
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
+ } else {
+ if (isset($pStyles['name'])) {
+ $this->setName($pStyles['name']);
+ }
+ if (isset($pStyles['bold'])) {
+ $this->setBold($pStyles['bold']);
+ }
+ if (isset($pStyles['italic'])) {
+ $this->setItalic($pStyles['italic']);
+ }
+ if (isset($pStyles['superscript'])) {
+ $this->setSuperscript($pStyles['superscript']);
+ }
+ if (isset($pStyles['subscript'])) {
+ $this->setSubscript($pStyles['subscript']);
+ }
+ if (isset($pStyles['underline'])) {
+ $this->setUnderline($pStyles['underline']);
+ }
+ if (isset($pStyles['strikethrough'])) {
+ $this->setStrikethrough($pStyles['strikethrough']);
+ }
+ if (isset($pStyles['color'])) {
+ $this->getColor()->applyFromArray($pStyles['color']);
+ }
+ if (isset($pStyles['size'])) {
+ $this->setSize($pStyles['size']);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Name.
+ *
+ * @return string
+ */
+ public function getName()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getName();
+ }
+
+ return $this->name;
+ }
+
+ /**
+ * Set Name.
+ *
+ * @param string $pValue
+ *
+ * @return Font
+ */
+ public function setName($pValue)
+ {
+ if ($pValue == '') {
+ $pValue = 'Calibri';
+ }
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['name' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->name = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Size.
+ *
+ * @return float
+ */
+ public function getSize()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getSize();
+ }
+
+ return $this->size;
+ }
+
+ /**
+ * Set Size.
+ *
+ * @param float $pValue
+ *
+ * @return Font
+ */
+ public function setSize($pValue)
+ {
+ if ($pValue == '') {
+ $pValue = 10;
+ }
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['size' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->size = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Bold.
+ *
+ * @return bool
+ */
+ public function getBold()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getBold();
+ }
+
+ return $this->bold;
+ }
+
+ /**
+ * Set Bold.
+ *
+ * @param bool $pValue
+ *
+ * @return Font
+ */
+ public function setBold($pValue)
+ {
+ if ($pValue == '') {
+ $pValue = false;
+ }
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['bold' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->bold = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Italic.
+ *
+ * @return bool
+ */
+ public function getItalic()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getItalic();
+ }
+
+ return $this->italic;
+ }
+
+ /**
+ * Set Italic.
+ *
+ * @param bool $pValue
+ *
+ * @return Font
+ */
+ public function setItalic($pValue)
+ {
+ if ($pValue == '') {
+ $pValue = false;
+ }
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['italic' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->italic = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Superscript.
+ *
+ * @return bool
+ */
+ public function getSuperscript()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getSuperscript();
+ }
+
+ return $this->superscript;
+ }
+
+ /**
+ * Set Superscript.
+ *
+ * @param bool $pValue
+ *
+ * @return Font
+ */
+ public function setSuperscript($pValue)
+ {
+ if ($pValue == '') {
+ $pValue = false;
+ }
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['superscript' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->superscript = $pValue;
+ $this->subscript = !$pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Subscript.
+ *
+ * @return bool
+ */
+ public function getSubscript()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getSubscript();
+ }
+
+ return $this->subscript;
+ }
+
+ /**
+ * Set Subscript.
+ *
+ * @param bool $pValue
+ *
+ * @return Font
+ */
+ public function setSubscript($pValue)
+ {
+ if ($pValue == '') {
+ $pValue = false;
+ }
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['subscript' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->subscript = $pValue;
+ $this->superscript = !$pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Underline.
+ *
+ * @return string
+ */
+ public function getUnderline()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getUnderline();
+ }
+
+ return $this->underline;
+ }
+
+ /**
+ * Set Underline.
+ *
+ * @param bool|string $pValue \PhpOffice\PhpSpreadsheet\Style\Font underline type
+ * If a boolean is passed, then TRUE equates to UNDERLINE_SINGLE,
+ * false equates to UNDERLINE_NONE
+ *
+ * @return Font
+ */
+ public function setUnderline($pValue)
+ {
+ if (is_bool($pValue)) {
+ $pValue = ($pValue) ? self::UNDERLINE_SINGLE : self::UNDERLINE_NONE;
+ } elseif ($pValue == '') {
+ $pValue = self::UNDERLINE_NONE;
+ }
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['underline' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->underline = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Strikethrough.
+ *
+ * @return bool
+ */
+ public function getStrikethrough()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getStrikethrough();
+ }
+
+ return $this->strikethrough;
+ }
+
+ /**
+ * Set Strikethrough.
+ *
+ * @param bool $pValue
+ *
+ * @return Font
+ */
+ public function setStrikethrough($pValue)
+ {
+ if ($pValue == '') {
+ $pValue = false;
+ }
+
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['strikethrough' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->strikethrough = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Color.
+ *
+ * @return Color
+ */
+ public function getColor()
+ {
+ return $this->color;
+ }
+
+ /**
+ * Set Color.
+ *
+ * @param Color $pValue
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Font
+ */
+ public function setColor(Color $pValue)
+ {
+ // make sure parameter is a real color and not a supervisor
+ $color = $pValue->getIsSupervisor() ? $pValue->getSharedComponent() : $pValue;
+
+ if ($this->isSupervisor) {
+ $styleArray = $this->getColor()->getStyleArray(['argb' => $color->getARGB()]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->color = $color;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getHashCode();
+ }
+
+ return md5(
+ $this->name .
+ $this->size .
+ ($this->bold ? 't' : 'f') .
+ ($this->italic ? 't' : 'f') .
+ ($this->superscript ? 't' : 'f') .
+ ($this->subscript ? 't' : 'f') .
+ $this->underline .
+ ($this->strikethrough ? 't' : 'f') .
+ $this->color->getHashCode() .
+ __CLASS__
+ );
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Style/NumberFormat.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat.php
similarity index 55%
rename from lib/phpexcel/PHPExcel/Style/NumberFormat.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat.php
index f517df3b208..607d1ddabd5 100644
--- a/lib/phpexcel/PHPExcel/Style/NumberFormat.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/NumberFormat.php
@@ -1,107 +1,90 @@
$array);
+ return ['numberFormat' => $array];
}
/**
- * Apply styles from array
+ * Apply styles from array.
*
*
- * $objPHPExcel->getActiveSheet()->getStyle('B2')->getNumberFormat()->applyFromArray(
- * array(
- * 'code' => PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE
- * )
+ * $spreadsheet->getActiveSheet()->getStyle('B2')->getNumberFormat()->applyFromArray(
+ * [
+ * 'formatCode' => NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE
+ * ]
* );
*
*
- * @param array $pStyles Array containing style information
- * @throws PHPExcel_Exception
- * @return PHPExcel_Style_NumberFormat
+ * @param array $pStyles Array containing style information
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return NumberFormat
*/
- public function applyFromArray($pStyles = null)
+ public function applyFromArray(array $pStyles)
{
- if (is_array($pStyles)) {
- if ($this->isSupervisor) {
- $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
- } else {
- if (array_key_exists('code', $pStyles)) {
- $this->setFormatCode($pStyles['code']);
- }
- }
+ if ($this->isSupervisor) {
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
} else {
- throw new PHPExcel_Exception("Invalid style array passed.");
+ if (isset($pStyles['formatCode'])) {
+ $this->setFormatCode($pStyles['formatCode']);
+ }
}
+
return $this;
}
/**
- * Get Format Code
+ * Get Format Code.
*
* @return string
*/
@@ -182,32 +165,35 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
if ($this->builtInFormatCode !== false) {
return self::builtInFormatCode($this->builtInFormatCode);
}
+
return $this->formatCode;
}
/**
- * Set Format Code
+ * Set Format Code.
*
- * @param string $pValue
- * @return PHPExcel_Style_NumberFormat
+ * @param string $pValue see self::FORMAT_*
+ *
+ * @return NumberFormat
*/
- public function setFormatCode($pValue = PHPExcel_Style_NumberFormat::FORMAT_GENERAL)
+ public function setFormatCode($pValue)
{
if ($pValue == '') {
- $pValue = PHPExcel_Style_NumberFormat::FORMAT_GENERAL;
+ $pValue = self::FORMAT_GENERAL;
}
if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('code' => $pValue));
+ $styleArray = $this->getStyleArray(['formatCode' => $pValue]);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->formatCode = $pValue;
$this->builtInFormatCode = self::builtInFormatCodeIndex($pValue);
}
+
return $this;
}
/**
- * Get Built-In Format Code
+ * Get Built-In Format Code.
*
* @return int
*/
@@ -216,30 +202,32 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
if ($this->isSupervisor) {
return $this->getSharedComponent()->getBuiltInFormatCode();
}
+
return $this->builtInFormatCode;
}
/**
- * Set Built-In Format Code
+ * Set Built-In Format Code.
*
* @param int $pValue
- * @return PHPExcel_Style_NumberFormat
+ *
+ * @return NumberFormat
*/
- public function setBuiltInFormatCode($pValue = 0)
+ public function setBuiltInFormatCode($pValue)
{
-
if ($this->isSupervisor) {
- $styleArray = $this->getStyleArray(array('code' => self::builtInFormatCode($pValue)));
+ $styleArray = $this->getStyleArray(['formatCode' => self::builtInFormatCode($pValue)]);
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
} else {
$this->builtInFormatCode = $pValue;
$this->formatCode = self::builtInFormatCode($pValue);
}
+
return $this;
}
/**
- * Fill built-in format codes
+ * Fill built-in format codes.
*/
private static function fillBuiltInFormatCodes()
{
@@ -264,13 +252,13 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
// 40: "#,##0.00_);[Red](#,##0.00)"
// 47: "mm:ss.0"
// KOR fmt 55: "yyyy/mm/dd"
-
+
// Built-in format codes
- if (is_null(self::$builtInFormats)) {
- self::$builtInFormats = array();
+ if (self::$builtInFormats === null) {
+ self::$builtInFormats = [];
// General
- self::$builtInFormats[0] = PHPExcel_Style_NumberFormat::FORMAT_GENERAL;
+ self::$builtInFormats[0] = self::FORMAT_GENERAL;
self::$builtInFormats[1] = '0';
self::$builtInFormats[2] = '0.00';
self::$builtInFormats[3] = '#,##0';
@@ -281,7 +269,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
self::$builtInFormats[11] = '0.00E+00';
self::$builtInFormats[12] = '# ?/?';
self::$builtInFormats[13] = '# ??/??';
- self::$builtInFormats[14] = 'm/d/yyyy'; // Despite ECMA 'mm-dd-yy';
+ self::$builtInFormats[14] = 'm/d/yyyy'; // Despite ECMA 'mm-dd-yy';
self::$builtInFormats[15] = 'd-mmm-yy';
self::$builtInFormats[16] = 'd-mmm';
self::$builtInFormats[17] = 'mmm-yy';
@@ -289,17 +277,17 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
self::$builtInFormats[19] = 'h:mm:ss AM/PM';
self::$builtInFormats[20] = 'h:mm';
self::$builtInFormats[21] = 'h:mm:ss';
- self::$builtInFormats[22] = 'm/d/yyyy h:mm'; // Despite ECMA 'm/d/yy h:mm';
+ self::$builtInFormats[22] = 'm/d/yyyy h:mm'; // Despite ECMA 'm/d/yy h:mm';
- self::$builtInFormats[37] = '#,##0_);(#,##0)'; // Despite ECMA '#,##0 ;(#,##0)';
- self::$builtInFormats[38] = '#,##0_);[Red](#,##0)'; // Despite ECMA '#,##0 ;[Red](#,##0)';
- self::$builtInFormats[39] = '#,##0.00_);(#,##0.00)'; // Despite ECMA '#,##0.00;(#,##0.00)';
- self::$builtInFormats[40] = '#,##0.00_);[Red](#,##0.00)'; // Despite ECMA '#,##0.00;[Red](#,##0.00)';
+ self::$builtInFormats[37] = '#,##0_);(#,##0)'; // Despite ECMA '#,##0 ;(#,##0)';
+ self::$builtInFormats[38] = '#,##0_);[Red](#,##0)'; // Despite ECMA '#,##0 ;[Red](#,##0)';
+ self::$builtInFormats[39] = '#,##0.00_);(#,##0.00)'; // Despite ECMA '#,##0.00;(#,##0.00)';
+ self::$builtInFormats[40] = '#,##0.00_);[Red](#,##0.00)'; // Despite ECMA '#,##0.00;[Red](#,##0.00)';
self::$builtInFormats[44] = '_("$"* #,##0.00_);_("$"* \(#,##0.00\);_("$"* "-"??_);_(@_)';
self::$builtInFormats[45] = 'mm:ss';
self::$builtInFormats[46] = '[h]:mm:ss';
- self::$builtInFormats[47] = 'mm:ss.0'; // Despite ECMA 'mmss.0';
+ self::$builtInFormats[47] = 'mm:ss.0'; // Despite ECMA 'mmss.0';
self::$builtInFormats[48] = '##0.0E+0';
self::$builtInFormats[49] = '@';
@@ -320,21 +308,38 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
self::$builtInFormats[69] = 't# ?/?';
self::$builtInFormats[70] = 't# ??/??';
+ // JPN
+ self::$builtInFormats[28] = '[$-411]ggge"年"m"月"d"日"';
+ self::$builtInFormats[29] = '[$-411]ggge"年"m"月"d"日"';
+ self::$builtInFormats[31] = 'yyyy"年"m"月"d"日"';
+ self::$builtInFormats[32] = 'h"時"mm"分"';
+ self::$builtInFormats[33] = 'h"時"mm"分"ss"秒"';
+ self::$builtInFormats[34] = 'yyyy"年"m"月"';
+ self::$builtInFormats[35] = 'm"月"d"日"';
+ self::$builtInFormats[51] = '[$-411]ggge"年"m"月"d"日"';
+ self::$builtInFormats[52] = 'yyyy"年"m"月"';
+ self::$builtInFormats[53] = 'm"月"d"日"';
+ self::$builtInFormats[54] = '[$-411]ggge"年"m"月"d"日"';
+ self::$builtInFormats[55] = 'yyyy"年"m"月"';
+ self::$builtInFormats[56] = 'm"月"d"日"';
+ self::$builtInFormats[58] = '[$-411]ggge"年"m"月"d"日"';
+
// Flip array (for faster lookups)
self::$flippedBuiltInFormats = array_flip(self::$builtInFormats);
}
}
/**
- * Get built-in format code
+ * Get built-in format code.
*
- * @param int $pIndex
- * @return string
+ * @param int $pIndex
+ *
+ * @return string
*/
public static function builtInFormatCode($pIndex)
{
// Clean parameter
- $pIndex = intval($pIndex);
+ $pIndex = (int) $pIndex;
// Ensure built-in format codes are available
self::fillBuiltInFormatCodes();
@@ -348,10 +353,11 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
}
/**
- * Get built-in format code index
+ * Get built-in format code index.
*
- * @param string $formatCode
- * @return int|boolean
+ * @param string $formatCode
+ *
+ * @return bool|int
*/
public static function builtInFormatCodeIndex($formatCode)
{
@@ -367,15 +373,16 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
}
/**
- * Get hash code
+ * Get hash code.
*
- * @return string Hash code
+ * @return string Hash code
*/
public function getHashCode()
{
if ($this->isSupervisor) {
return $this->getSharedComponent()->getHashCode();
}
+
return md5(
$this->formatCode .
$this->builtInFormatCode .
@@ -384,72 +391,76 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
}
/**
- * Search/replace values to convert Excel date/time format masks to PHP format masks
+ * Search/replace values to convert Excel date/time format masks to PHP format masks.
*
* @var array
*/
- private static $dateFormatReplacements = array(
+ private static $dateFormatReplacements = [
// first remove escapes related to non-format characters
- '\\' => '',
+ '\\' => '',
// 12-hour suffix
'am/pm' => 'A',
// 4-digit year
- 'e' => 'Y',
- 'yyyy' => 'Y',
+ 'e' => 'Y',
+ 'yyyy' => 'Y',
// 2-digit year
- 'yy' => 'y',
+ 'yy' => 'y',
// first letter of month - no php equivalent
'mmmmm' => 'M',
// full month name
- 'mmmm' => 'F',
+ 'mmmm' => 'F',
// short month name
- 'mmm' => 'M',
+ 'mmm' => 'M',
// mm is minutes if time, but can also be month w/leading zero
// so we try to identify times be the inclusion of a : separator in the mask
// It isn't perfect, but the best way I know how
- ':mm' => ':i',
- 'mm:' => 'i:',
+ ':mm' => ':i',
+ 'mm:' => 'i:',
// month leading zero
- 'mm' => 'm',
+ 'mm' => 'm',
// month no leading zero
- 'm' => 'n',
+ 'm' => 'n',
// full day of week name
- 'dddd' => 'l',
+ 'dddd' => 'l',
// short day of week name
- 'ddd' => 'D',
+ 'ddd' => 'D',
// days leading zero
- 'dd' => 'd',
+ 'dd' => 'd',
// days no leading zero
- 'd' => 'j',
+ 'd' => 'j',
// seconds
- 'ss' => 's',
+ 'ss' => 's',
// fractional seconds - no php equivalent
- '.s' => ''
- );
- /**
- * Search/replace values to convert Excel date/time format masks hours to PHP format masks (24 hr clock)
- *
- * @var array
- */
- private static $dateFormatReplacements24 = array(
- 'hh' => 'H',
- 'h' => 'G'
- );
- /**
- * Search/replace values to convert Excel date/time format masks hours to PHP format masks (12 hr clock)
- *
- * @var array
- */
- private static $dateFormatReplacements12 = array(
- 'hh' => 'h',
- 'h' => 'g'
- );
+ '.s' => '',
+ ];
- private static function setLowercaseCallback($matches) {
+ /**
+ * Search/replace values to convert Excel date/time format masks hours to PHP format masks (24 hr clock).
+ *
+ * @var array
+ */
+ private static $dateFormatReplacements24 = [
+ 'hh' => 'H',
+ 'h' => 'G',
+ ];
+
+ /**
+ * Search/replace values to convert Excel date/time format masks hours to PHP format masks (12 hr clock).
+ *
+ * @var array
+ */
+ private static $dateFormatReplacements12 = [
+ 'hh' => 'h',
+ 'h' => 'g',
+ ];
+
+ private static function setLowercaseCallback($matches)
+ {
return mb_strtolower($matches[0]);
}
- private static function escapeQuotesCallback($matches) {
+ private static function escapeQuotesCallback($matches)
+ {
return '\\' . implode('\\', str_split($matches[1]));
}
@@ -458,19 +469,27 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
// strip off first part containing e.g. [$-F800] or [$USD-409]
// general syntax: [$-]
// language info is in hexadecimal
- $format = preg_replace('/^(\[\$[A-Z]*-[0-9A-F]*\])/i', '', $format);
+ // strip off chinese part like [DBNum1][$-804]
+ $format = preg_replace('/^(\[[0-9A-Za-z]*\])*(\[\$[A-Z]*-[0-9A-F]*\])/i', '', $format);
// OpenOffice.org uses upper-case number formats, e.g. 'YYYY', convert to lower-case;
// but we don't want to change any quoted strings
- $format = preg_replace_callback('/(?:^|")([^"]*)(?:$|")/', array('self', 'setLowercaseCallback'), $format);
+ $format = preg_replace_callback('/(?:^|")([^"]*)(?:$|")/', ['self', 'setLowercaseCallback'], $format);
// Only process the non-quoted blocks for date format characters
$blocks = explode('"', $format);
- foreach($blocks as $key => &$block) {
+ foreach ($blocks as $key => &$block) {
if ($key % 2 == 0) {
$block = strtr($block, self::$dateFormatReplacements);
if (!strpos($block, 'A')) {
// 24-hour time format
+ // when [h]:mm format, the [h] should replace to the hours of the value * 24
+ if (false !== strpos($block, '[h]')) {
+ $hours = (int) ($value * 24);
+ $block = str_replace('[h]', $hours, $block);
+
+ continue;
+ }
$block = strtr($block, self::$dateFormatReplacements24);
} else {
// 12-hour time format
@@ -481,9 +500,9 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
$format = implode('"', $blocks);
// escape any quoted characters so that DateTime format() will render them correctly
- $format = preg_replace_callback('/"(.*)"/U', array('self', 'escapeQuotesCallback'), $format);
+ $format = preg_replace_callback('/"(.*)"/U', ['self', 'escapeQuotesCallback'], $format);
- $dateObj = PHPExcel_Shared_Date::ExcelToPHPObject($value);
+ $dateObj = Date::excelToDateTimeObject($value);
$value = $dateObj->format($format);
}
@@ -492,7 +511,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
if ($format === self::FORMAT_PERCENTAGE) {
$value = round((100 * $value), 0) . '%';
} else {
- if (preg_match('/\.[#0]+/i', $format, $m)) {
+ if (preg_match('/\.[#0]+/', $format, $m)) {
$s = substr($m[0], 0, 1) . (strlen($m[0]) - 1);
$format = str_replace($m[0], $s, $format);
}
@@ -514,10 +533,10 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
$decimalLength = strlen($decimalPart);
$decimalDivisor = pow(10, $decimalLength);
- $GCD = PHPExcel_Calculation_MathTrig::GCD($decimalPart, $decimalDivisor);
+ $GCD = MathTrig::GCD($decimalPart, $decimalDivisor);
- $adjustedDecimalPart = $decimalPart/$GCD;
- $adjustedDecimalDivisor = $decimalDivisor/$GCD;
+ $adjustedDecimalPart = $decimalPart / $GCD;
+ $adjustedDecimalDivisor = $decimalDivisor / $GCD;
if ((strpos($format, '0') !== false) || (strpos($format, '#') !== false) || (substr($format, 0, 3) == '? ?')) {
if ($integerPart == 0) {
@@ -530,15 +549,16 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
}
}
- private static function complexNumberFormatMask($number, $mask, $level = 0)
+ private static function complexNumberFormatMask($number, $mask)
{
$sign = ($number < 0.0);
$number = abs($number);
if (strpos($mask, '.') !== false) {
$numbers = explode('.', $number . '.0');
$masks = explode('.', $mask . '.0');
- $result1 = self::complexNumberFormatMask($numbers[0], $masks[0], 1);
- $result2 = strrev(self::complexNumberFormatMask(strrev($numbers[1]), strrev($masks[1]), 1));
+ $result1 = self::complexNumberFormatMask($numbers[0], $masks[0]);
+ $result2 = strrev(self::complexNumberFormatMask(strrev($numbers[1]), strrev($masks[1])));
+
return (($sign) ? '-' : '') . $result1 . '.' . $result2;
}
@@ -570,14 +590,15 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
}
/**
- * Convert a value in a pre-defined format to a PHP string
+ * Convert a value in a pre-defined format to a PHP string.
*
- * @param mixed $value Value to format
- * @param string $format Format code
- * @param array $callBack Callback function for additional formatting of string
- * @return string Formatted string
+ * @param mixed $value Value to format
+ * @param string $format Format code, see = self::FORMAT_*
+ * @param array $callBack Callback function for additional formatting of string
+ *
+ * @return string Formatted string
*/
- public static function toFormattedString($value = '0', $format = PHPExcel_Style_NumberFormat::FORMAT_GENERAL, $callBack = null)
+ public static function toFormattedString($value, $format, $callBack = null)
{
// For now we do not treat strings although section 4 of a format code affects strings
if (!is_numeric($value)) {
@@ -586,12 +607,12 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
// For 'General' format code, we just pass the value although this is not entirely the way Excel does it,
// it seems to round numbers to a total of 10 digits.
- if (($format === PHPExcel_Style_NumberFormat::FORMAT_GENERAL) || ($format === PHPExcel_Style_NumberFormat::FORMAT_TEXT)) {
+ if (($format === self::FORMAT_GENERAL) || ($format === self::FORMAT_TEXT)) {
return $value;
}
// Convert any other escaped characters to quoted strings, e.g. (\T to "T")
- $format = preg_replace('/(\\\(.))(?=(?:[^"]|"[^"]*")*$)/u', '"${2}"', $format);
+ $format = preg_replace('/(\\\([^ ]))(?=(?:[^"]|"[^"]*")*$)/u', '"${2}"', $format);
// Get the sections, there can be up to four sections, separated with a semi-colon (but only if not a quoted literal)
$sections = preg_split('/(;)(?=(?:[^"]|"[^"]*")*$)/u', $format);
@@ -606,6 +627,7 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
switch (count($sections)) {
case 1:
$format = $sections[0];
+
break;
case 2:
$format = ($value >= 0) ? $sections[0] : $sections[1];
@@ -613,19 +635,20 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
break;
case 3:
$format = ($value > 0) ?
- $sections[0] : ( ($value < 0) ?
+ $sections[0] : (($value < 0) ?
$sections[1] : $sections[2]);
$value = abs($value); // Use the absolute value
break;
case 4:
$format = ($value > 0) ?
- $sections[0] : ( ($value < 0) ?
+ $sections[0] : (($value < 0) ?
$sections[1] : $sections[2]);
$value = abs($value); // Use the absolute value
break;
default:
// something is wrong, just use first section
$format = $sections[0];
+
break;
}
@@ -636,111 +659,109 @@ class PHPExcel_Style_NumberFormat extends PHPExcel_Style_Supervisor implements P
// Save format with color information for later use below
$formatColor = $format;
- // Strip color information
- $color_regex = '/^\\[[a-zA-Z]+\\]/';
- $format = preg_replace($color_regex, '', $format);
-
// Let's begin inspecting the format and converting the value to a formatted string
// Check for date/time characters (not inside quotes)
if (preg_match('/(\[\$[A-Z]*-[0-9A-F]*\])*[hmsdy](?=(?:[^"]|"[^"]*")*$)/miu', $format, $matches)) {
// datetime format
self::formatAsDate($value, $format);
- } elseif (preg_match('/%$/', $format)) {
- // % number format
- self::formatAsPercentage($value, $format);
} else {
- if ($format === self::FORMAT_CURRENCY_EUR_SIMPLE) {
- $value = 'EUR ' . sprintf('%1.2f', $value);
+ // Strip color information
+ $color_regex = '/^\\[[a-zA-Z]+\\]/';
+ $format = preg_replace($color_regex, '', $format);
+ if (preg_match('/%$/', $format)) {
+ // % number format
+ self::formatAsPercentage($value, $format);
} else {
- // Some non-number strings are quoted, so we'll get rid of the quotes, likewise any positional * symbols
- $format = str_replace(array('"', '*'), '', $format);
+ if ($format === self::FORMAT_CURRENCY_EUR_SIMPLE) {
+ $value = 'EUR ' . sprintf('%1.2f', $value);
+ } else {
+ // Some non-number strings are quoted, so we'll get rid of the quotes, likewise any positional * symbols
+ $format = str_replace(['"', '*'], '', $format);
- // Find out if we need thousands separator
- // This is indicated by a comma enclosed by a digit placeholder:
- // #,# or 0,0
- $useThousands = preg_match('/(#,#|0,0)/', $format);
- if ($useThousands) {
- $format = preg_replace('/0,0/', '00', $format);
- $format = preg_replace('/#,#/', '##', $format);
- }
-
- // Scale thousands, millions,...
- // This is indicated by a number of commas after a digit placeholder:
- // #, or 0.0,,
- $scale = 1; // same as no scale
- $matches = array();
- if (preg_match('/(#|0)(,+)/', $format, $matches)) {
- $scale = pow(1000, strlen($matches[2]));
-
- // strip the commas
- $format = preg_replace('/0,+/', '0', $format);
- $format = preg_replace('/#,+/', '#', $format);
- }
-
- if (preg_match('/#?.*\?\/\?/', $format, $m)) {
- //echo 'Format mask is fractional '.$format.'
';
- if ($value != (int)$value) {
- self::formatAsFraction($value, $format);
+ // Find out if we need thousands separator
+ // This is indicated by a comma enclosed by a digit placeholder:
+ // #,# or 0,0
+ $useThousands = preg_match('/(#,#|0,0)/', $format);
+ if ($useThousands) {
+ $format = preg_replace('/0,0/', '00', $format);
+ $format = preg_replace('/#,#/', '##', $format);
}
- } else {
- // Handle the number itself
+ // Scale thousands, millions,...
+ // This is indicated by a number of commas after a digit placeholder:
+ // #, or 0.0,,
+ $scale = 1; // same as no scale
+ $matches = [];
+ if (preg_match('/(#|0)(,+)/', $format, $matches)) {
+ $scale = pow(1000, strlen($matches[2]));
- // scale number
- $value = $value / $scale;
+ // strip the commas
+ $format = preg_replace('/0,+/', '0', $format);
+ $format = preg_replace('/#,+/', '#', $format);
+ }
- // Strip #
- $format = preg_replace('/\\#/', '0', $format);
+ if (preg_match('/#?.*\?\/\?/', $format, $m)) {
+ if ($value != (int) $value) {
+ self::formatAsFraction($value, $format);
+ }
+ } else {
+ // Handle the number itself
- $n = "/\[[^\]]+\]/";
- $m = preg_replace($n, '', $format);
- $number_regex = "/(0+)(\.?)(0*)/";
- if (preg_match($number_regex, $m, $matches)) {
- $left = $matches[1];
- $dec = $matches[2];
- $right = $matches[3];
+ // scale number
+ $value = $value / $scale;
- // minimun width of formatted number (including dot)
- $minWidth = strlen($left) + strlen($dec) + strlen($right);
- if ($useThousands) {
- $value = number_format(
- $value,
- strlen($right),
- PHPExcel_Shared_String::getDecimalSeparator(),
- PHPExcel_Shared_String::getThousandsSeparator()
- );
- $value = preg_replace($number_regex, $value, $format);
- } else {
- if (preg_match('/[0#]E[+-]0/i', $format)) {
- // Scientific format
- $value = sprintf('%5.2E', $value);
- } elseif (preg_match('/0([^\d\.]+)0/', $format)) {
- $value = self::complexNumberFormatMask($value, $format);
- } else {
- $sprintf_pattern = "%0$minWidth." . strlen($right) . "f";
- $value = sprintf($sprintf_pattern, $value);
+ // Strip #
+ $format = preg_replace('/\\#/', '0', $format);
+
+ // Remove locale code [$-###]
+ $format = preg_replace('/\[\$\-.*\]/', '', $format);
+
+ $n = '/\\[[^\\]]+\\]/';
+ $m = preg_replace($n, '', $format);
+ $number_regex = '/(0+)(\\.?)(0*)/';
+ if (preg_match($number_regex, $m, $matches)) {
+ $left = $matches[1];
+ $dec = $matches[2];
+ $right = $matches[3];
+
+ // minimun width of formatted number (including dot)
+ $minWidth = strlen($left) + strlen($dec) + strlen($right);
+ if ($useThousands) {
+ $value = number_format(
+ $value,
+ strlen($right),
+ StringHelper::getDecimalSeparator(),
+ StringHelper::getThousandsSeparator()
+ );
$value = preg_replace($number_regex, $value, $format);
+ } else {
+ if (preg_match('/[0#]E[+-]0/i', $format)) {
+ // Scientific format
+ $value = sprintf('%5.2E', $value);
+ } elseif (preg_match('/0([^\d\.]+)0/', $format)) {
+ $value = self::complexNumberFormatMask($value, $format);
+ } else {
+ $sprintf_pattern = "%0$minWidth." . strlen($right) . 'f';
+ $value = sprintf($sprintf_pattern, $value);
+ $value = preg_replace($number_regex, $value, $format);
+ }
}
}
}
- }
- if (preg_match('/\[\$(.*)\]/u', $format, $m)) {
- // Currency or Accounting
- $currencyFormat = $m[0];
- $currencyCode = $m[1];
- list($currencyCode) = explode('-', $currencyCode);
- if ($currencyCode == '') {
- $currencyCode = PHPExcel_Shared_String::getCurrencyCode();
+ if (preg_match('/\[\$(.*)\]/u', $format, $m)) {
+ // Currency or Accounting
+ $currencyCode = $m[1];
+ list($currencyCode) = explode('-', $currencyCode);
+ if ($currencyCode == '') {
+ $currencyCode = StringHelper::getCurrencyCode();
+ }
+ $value = preg_replace('/\[\$([^\]]*)\]/u', $currencyCode, $value);
}
- $value = preg_replace('/\[\$([^\]]*)\]/u', $currencyCode, $value);
}
}
}
- // Escape any escaped slashes to a single slash
- $format = preg_replace("/\\\\/u", '\\', $format);
-
// Additional formatting provided by callback function
if ($callBack !== null) {
list($writerInstance, $function) = $callBack;
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Protection.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Protection.php
new file mode 100644
index 00000000000..b5feb53486e
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Protection.php
@@ -0,0 +1,190 @@
+locked = self::PROTECTION_INHERIT;
+ $this->hidden = self::PROTECTION_INHERIT;
+ }
+ }
+
+ /**
+ * Get the shared style component for the currently active cell in currently active sheet.
+ * Only used for style supervisor.
+ *
+ * @return Protection
+ */
+ public function getSharedComponent()
+ {
+ return $this->parent->getSharedComponent()->getProtection();
+ }
+
+ /**
+ * Build style array from subcomponents.
+ *
+ * @param array $array
+ *
+ * @return array
+ */
+ public function getStyleArray($array)
+ {
+ return ['protection' => $array];
+ }
+
+ /**
+ * Apply styles from array.
+ *
+ *
+ * $spreadsheet->getActiveSheet()->getStyle('B2')->getLocked()->applyFromArray(
+ * [
+ * 'locked' => TRUE,
+ * 'hidden' => FALSE
+ * ]
+ * );
+ *
+ *
+ * @param array $pStyles Array containing style information
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Protection
+ */
+ public function applyFromArray(array $pStyles)
+ {
+ if ($this->isSupervisor) {
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
+ } else {
+ if (isset($pStyles['locked'])) {
+ $this->setLocked($pStyles['locked']);
+ }
+ if (isset($pStyles['hidden'])) {
+ $this->setHidden($pStyles['hidden']);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get locked.
+ *
+ * @return string
+ */
+ public function getLocked()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getLocked();
+ }
+
+ return $this->locked;
+ }
+
+ /**
+ * Set locked.
+ *
+ * @param string $pValue see self::PROTECTION_*
+ *
+ * @return Protection
+ */
+ public function setLocked($pValue)
+ {
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['locked' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->locked = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get hidden.
+ *
+ * @return string
+ */
+ public function getHidden()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getHidden();
+ }
+
+ return $this->hidden;
+ }
+
+ /**
+ * Set hidden.
+ *
+ * @param string $pValue see self::PROTECTION_*
+ *
+ * @return Protection
+ */
+ public function setHidden($pValue)
+ {
+ if ($this->isSupervisor) {
+ $styleArray = $this->getStyleArray(['hidden' => $pValue]);
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->hidden = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getHashCode();
+ }
+
+ return md5(
+ $this->locked .
+ $this->hidden .
+ __CLASS__
+ );
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php
new file mode 100644
index 00000000000..fbe07c2cdd2
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Style.php
@@ -0,0 +1,641 @@
+conditionalStyles = [];
+ $this->font = new Font($isSupervisor, $isConditional);
+ $this->fill = new Fill($isSupervisor, $isConditional);
+ $this->borders = new Borders($isSupervisor, $isConditional);
+ $this->alignment = new Alignment($isSupervisor, $isConditional);
+ $this->numberFormat = new NumberFormat($isSupervisor, $isConditional);
+ $this->protection = new Protection($isSupervisor, $isConditional);
+
+ // bind parent if we are a supervisor
+ if ($isSupervisor) {
+ $this->font->bindParent($this);
+ $this->fill->bindParent($this);
+ $this->borders->bindParent($this);
+ $this->alignment->bindParent($this);
+ $this->numberFormat->bindParent($this);
+ $this->protection->bindParent($this);
+ }
+ }
+
+ /**
+ * Get the shared style component for the currently active cell in currently active sheet.
+ * Only used for style supervisor.
+ *
+ * @return Style
+ */
+ public function getSharedComponent()
+ {
+ $activeSheet = $this->getActiveSheet();
+ $selectedCell = $this->getActiveCell(); // e.g. 'A1'
+
+ if ($activeSheet->cellExists($selectedCell)) {
+ $xfIndex = $activeSheet->getCell($selectedCell)->getXfIndex();
+ } else {
+ $xfIndex = 0;
+ }
+
+ return $this->parent->getCellXfByIndex($xfIndex);
+ }
+
+ /**
+ * Get parent. Only used for style supervisor.
+ *
+ * @return Spreadsheet
+ */
+ public function getParent()
+ {
+ return $this->parent;
+ }
+
+ /**
+ * Build style array from subcomponents.
+ *
+ * @param array $array
+ *
+ * @return array
+ */
+ public function getStyleArray($array)
+ {
+ return ['quotePrefix' => $array];
+ }
+
+ /**
+ * Apply styles from array.
+ *
+ *
+ * $spreadsheet->getActiveSheet()->getStyle('B2')->applyFromArray(
+ * [
+ * 'font' => [
+ * 'name' => 'Arial',
+ * 'bold' => true,
+ * 'italic' => false,
+ * 'underline' => Font::UNDERLINE_DOUBLE,
+ * 'strikethrough' => false,
+ * 'color' => [
+ * 'rgb' => '808080'
+ * ]
+ * ],
+ * 'borders' => [
+ * 'bottom' => [
+ * 'borderStyle' => Border::BORDER_DASHDOT,
+ * 'color' => [
+ * 'rgb' => '808080'
+ * ]
+ * ],
+ * 'top' => [
+ * 'borderStyle' => Border::BORDER_DASHDOT,
+ * 'color' => [
+ * 'rgb' => '808080'
+ * ]
+ * ]
+ * ],
+ * 'alignment' => [
+ * 'horizontal' => Alignment::HORIZONTAL_CENTER,
+ * 'vertical' => Alignment::VERTICAL_CENTER,
+ * 'wrapText' => true,
+ * ],
+ * 'quotePrefix' => true
+ * ]
+ * );
+ *
+ *
+ * @param array $pStyles Array containing style information
+ * @param bool $pAdvanced advanced mode for setting borders
+ *
+ * @return Style
+ */
+ public function applyFromArray(array $pStyles, $pAdvanced = true)
+ {
+ if ($this->isSupervisor) {
+ $pRange = $this->getSelectedCells();
+
+ // Uppercase coordinate
+ $pRange = strtoupper($pRange);
+
+ // Is it a cell range or a single cell?
+ if (strpos($pRange, ':') === false) {
+ $rangeA = $pRange;
+ $rangeB = $pRange;
+ } else {
+ list($rangeA, $rangeB) = explode(':', $pRange);
+ }
+
+ // Calculate range outer borders
+ $rangeStart = Coordinate::coordinateFromString($rangeA);
+ $rangeEnd = Coordinate::coordinateFromString($rangeB);
+
+ // Translate column into index
+ $rangeStart[0] = Coordinate::columnIndexFromString($rangeStart[0]);
+ $rangeEnd[0] = Coordinate::columnIndexFromString($rangeEnd[0]);
+
+ // Make sure we can loop upwards on rows and columns
+ if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
+ $tmp = $rangeStart;
+ $rangeStart = $rangeEnd;
+ $rangeEnd = $tmp;
+ }
+
+ // ADVANCED MODE:
+ if ($pAdvanced && isset($pStyles['borders'])) {
+ // 'allBorders' is a shorthand property for 'outline' and 'inside' and
+ // it applies to components that have not been set explicitly
+ if (isset($pStyles['borders']['allBorders'])) {
+ foreach (['outline', 'inside'] as $component) {
+ if (!isset($pStyles['borders'][$component])) {
+ $pStyles['borders'][$component] = $pStyles['borders']['allBorders'];
+ }
+ }
+ unset($pStyles['borders']['allBorders']); // not needed any more
+ }
+ // 'outline' is a shorthand property for 'top', 'right', 'bottom', 'left'
+ // it applies to components that have not been set explicitly
+ if (isset($pStyles['borders']['outline'])) {
+ foreach (['top', 'right', 'bottom', 'left'] as $component) {
+ if (!isset($pStyles['borders'][$component])) {
+ $pStyles['borders'][$component] = $pStyles['borders']['outline'];
+ }
+ }
+ unset($pStyles['borders']['outline']); // not needed any more
+ }
+ // 'inside' is a shorthand property for 'vertical' and 'horizontal'
+ // it applies to components that have not been set explicitly
+ if (isset($pStyles['borders']['inside'])) {
+ foreach (['vertical', 'horizontal'] as $component) {
+ if (!isset($pStyles['borders'][$component])) {
+ $pStyles['borders'][$component] = $pStyles['borders']['inside'];
+ }
+ }
+ unset($pStyles['borders']['inside']); // not needed any more
+ }
+ // width and height characteristics of selection, 1, 2, or 3 (for 3 or more)
+ $xMax = min($rangeEnd[0] - $rangeStart[0] + 1, 3);
+ $yMax = min($rangeEnd[1] - $rangeStart[1] + 1, 3);
+
+ // loop through up to 3 x 3 = 9 regions
+ for ($x = 1; $x <= $xMax; ++$x) {
+ // start column index for region
+ $colStart = ($x == 3) ?
+ Coordinate::stringFromColumnIndex($rangeEnd[0])
+ : Coordinate::stringFromColumnIndex($rangeStart[0] + $x - 1);
+ // end column index for region
+ $colEnd = ($x == 1) ?
+ Coordinate::stringFromColumnIndex($rangeStart[0])
+ : Coordinate::stringFromColumnIndex($rangeEnd[0] - $xMax + $x);
+
+ for ($y = 1; $y <= $yMax; ++$y) {
+ // which edges are touching the region
+ $edges = [];
+ if ($x == 1) {
+ // are we at left edge
+ $edges[] = 'left';
+ }
+ if ($x == $xMax) {
+ // are we at right edge
+ $edges[] = 'right';
+ }
+ if ($y == 1) {
+ // are we at top edge?
+ $edges[] = 'top';
+ }
+ if ($y == $yMax) {
+ // are we at bottom edge?
+ $edges[] = 'bottom';
+ }
+
+ // start row index for region
+ $rowStart = ($y == 3) ?
+ $rangeEnd[1] : $rangeStart[1] + $y - 1;
+
+ // end row index for region
+ $rowEnd = ($y == 1) ?
+ $rangeStart[1] : $rangeEnd[1] - $yMax + $y;
+
+ // build range for region
+ $range = $colStart . $rowStart . ':' . $colEnd . $rowEnd;
+
+ // retrieve relevant style array for region
+ $regionStyles = $pStyles;
+ unset($regionStyles['borders']['inside']);
+
+ // what are the inner edges of the region when looking at the selection
+ $innerEdges = array_diff(['top', 'right', 'bottom', 'left'], $edges);
+
+ // inner edges that are not touching the region should take the 'inside' border properties if they have been set
+ foreach ($innerEdges as $innerEdge) {
+ switch ($innerEdge) {
+ case 'top':
+ case 'bottom':
+ // should pick up 'horizontal' border property if set
+ if (isset($pStyles['borders']['horizontal'])) {
+ $regionStyles['borders'][$innerEdge] = $pStyles['borders']['horizontal'];
+ } else {
+ unset($regionStyles['borders'][$innerEdge]);
+ }
+
+ break;
+ case 'left':
+ case 'right':
+ // should pick up 'vertical' border property if set
+ if (isset($pStyles['borders']['vertical'])) {
+ $regionStyles['borders'][$innerEdge] = $pStyles['borders']['vertical'];
+ } else {
+ unset($regionStyles['borders'][$innerEdge]);
+ }
+
+ break;
+ }
+ }
+
+ // apply region style to region by calling applyFromArray() in simple mode
+ $this->getActiveSheet()->getStyle($range)->applyFromArray($regionStyles, false);
+ }
+ }
+
+ // restore initial cell selection range
+ $this->getActiveSheet()->getStyle($pRange);
+
+ return $this;
+ }
+
+ // SIMPLE MODE:
+ // Selection type, inspect
+ if (preg_match('/^[A-Z]+1:[A-Z]+1048576$/', $pRange)) {
+ $selectionType = 'COLUMN';
+ } elseif (preg_match('/^A\d+:XFD\d+$/', $pRange)) {
+ $selectionType = 'ROW';
+ } else {
+ $selectionType = 'CELL';
+ }
+
+ // First loop through columns, rows, or cells to find out which styles are affected by this operation
+ switch ($selectionType) {
+ case 'COLUMN':
+ $oldXfIndexes = [];
+ for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
+ $oldXfIndexes[$this->getActiveSheet()->getColumnDimensionByColumn($col)->getXfIndex()] = true;
+ }
+
+ break;
+ case 'ROW':
+ $oldXfIndexes = [];
+ for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
+ if ($this->getActiveSheet()->getRowDimension($row)->getXfIndex() == null) {
+ $oldXfIndexes[0] = true; // row without explicit style should be formatted based on default style
+ } else {
+ $oldXfIndexes[$this->getActiveSheet()->getRowDimension($row)->getXfIndex()] = true;
+ }
+ }
+
+ break;
+ case 'CELL':
+ $oldXfIndexes = [];
+ for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
+ for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
+ $oldXfIndexes[$this->getActiveSheet()->getCellByColumnAndRow($col, $row)->getXfIndex()] = true;
+ }
+ }
+
+ break;
+ }
+
+ // clone each of the affected styles, apply the style array, and add the new styles to the workbook
+ $workbook = $this->getActiveSheet()->getParent();
+ foreach ($oldXfIndexes as $oldXfIndex => $dummy) {
+ $style = $workbook->getCellXfByIndex($oldXfIndex);
+ $newStyle = clone $style;
+ $newStyle->applyFromArray($pStyles);
+
+ if ($existingStyle = $workbook->getCellXfByHashCode($newStyle->getHashCode())) {
+ // there is already such cell Xf in our collection
+ $newXfIndexes[$oldXfIndex] = $existingStyle->getIndex();
+ } else {
+ // we don't have such a cell Xf, need to add
+ $workbook->addCellXf($newStyle);
+ $newXfIndexes[$oldXfIndex] = $newStyle->getIndex();
+ }
+ }
+
+ // Loop through columns, rows, or cells again and update the XF index
+ switch ($selectionType) {
+ case 'COLUMN':
+ for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
+ $columnDimension = $this->getActiveSheet()->getColumnDimensionByColumn($col);
+ $oldXfIndex = $columnDimension->getXfIndex();
+ $columnDimension->setXfIndex($newXfIndexes[$oldXfIndex]);
+ }
+
+ break;
+ case 'ROW':
+ for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
+ $rowDimension = $this->getActiveSheet()->getRowDimension($row);
+ $oldXfIndex = $rowDimension->getXfIndex() === null ?
+ 0 : $rowDimension->getXfIndex(); // row without explicit style should be formatted based on default style
+ $rowDimension->setXfIndex($newXfIndexes[$oldXfIndex]);
+ }
+
+ break;
+ case 'CELL':
+ for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
+ for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
+ $cell = $this->getActiveSheet()->getCellByColumnAndRow($col, $row);
+ $oldXfIndex = $cell->getXfIndex();
+ $cell->setXfIndex($newXfIndexes[$oldXfIndex]);
+ }
+ }
+
+ break;
+ }
+ } else {
+ // not a supervisor, just apply the style array directly on style object
+ if (isset($pStyles['fill'])) {
+ $this->getFill()->applyFromArray($pStyles['fill']);
+ }
+ if (isset($pStyles['font'])) {
+ $this->getFont()->applyFromArray($pStyles['font']);
+ }
+ if (isset($pStyles['borders'])) {
+ $this->getBorders()->applyFromArray($pStyles['borders']);
+ }
+ if (isset($pStyles['alignment'])) {
+ $this->getAlignment()->applyFromArray($pStyles['alignment']);
+ }
+ if (isset($pStyles['numberFormat'])) {
+ $this->getNumberFormat()->applyFromArray($pStyles['numberFormat']);
+ }
+ if (isset($pStyles['protection'])) {
+ $this->getProtection()->applyFromArray($pStyles['protection']);
+ }
+ if (isset($pStyles['quotePrefix'])) {
+ $this->quotePrefix = $pStyles['quotePrefix'];
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get Fill.
+ *
+ * @return Fill
+ */
+ public function getFill()
+ {
+ return $this->fill;
+ }
+
+ /**
+ * Get Font.
+ *
+ * @return Font
+ */
+ public function getFont()
+ {
+ return $this->font;
+ }
+
+ /**
+ * Set font.
+ *
+ * @param Font $font
+ *
+ * @return Style
+ */
+ public function setFont(Font $font)
+ {
+ $this->font = $font;
+
+ return $this;
+ }
+
+ /**
+ * Get Borders.
+ *
+ * @return Borders
+ */
+ public function getBorders()
+ {
+ return $this->borders;
+ }
+
+ /**
+ * Get Alignment.
+ *
+ * @return Alignment
+ */
+ public function getAlignment()
+ {
+ return $this->alignment;
+ }
+
+ /**
+ * Get Number Format.
+ *
+ * @return NumberFormat
+ */
+ public function getNumberFormat()
+ {
+ return $this->numberFormat;
+ }
+
+ /**
+ * Get Conditional Styles. Only used on supervisor.
+ *
+ * @return Conditional[]
+ */
+ public function getConditionalStyles()
+ {
+ return $this->getActiveSheet()->getConditionalStyles($this->getActiveCell());
+ }
+
+ /**
+ * Set Conditional Styles. Only used on supervisor.
+ *
+ * @param Conditional[] $pValue Array of conditional styles
+ *
+ * @return Style
+ */
+ public function setConditionalStyles(array $pValue)
+ {
+ $this->getActiveSheet()->setConditionalStyles($this->getSelectedCells(), $pValue);
+
+ return $this;
+ }
+
+ /**
+ * Get Protection.
+ *
+ * @return Protection
+ */
+ public function getProtection()
+ {
+ return $this->protection;
+ }
+
+ /**
+ * Get quote prefix.
+ *
+ * @return bool
+ */
+ public function getQuotePrefix()
+ {
+ if ($this->isSupervisor) {
+ return $this->getSharedComponent()->getQuotePrefix();
+ }
+
+ return $this->quotePrefix;
+ }
+
+ /**
+ * Set quote prefix.
+ *
+ * @param bool $pValue
+ *
+ * @return Style
+ */
+ public function setQuotePrefix($pValue)
+ {
+ if ($pValue == '') {
+ $pValue = false;
+ }
+ if ($this->isSupervisor) {
+ $styleArray = ['quotePrefix' => $pValue];
+ $this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
+ } else {
+ $this->quotePrefix = (bool) $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ $hashConditionals = '';
+ foreach ($this->conditionalStyles as $conditional) {
+ $hashConditionals .= $conditional->getHashCode();
+ }
+
+ return md5(
+ $this->fill->getHashCode() .
+ $this->font->getHashCode() .
+ $this->borders->getHashCode() .
+ $this->alignment->getHashCode() .
+ $this->numberFormat->getHashCode() .
+ $hashConditionals .
+ $this->protection->getHashCode() .
+ ($this->quotePrefix ? 't' : 'f') .
+ __CLASS__
+ );
+ }
+
+ /**
+ * Get own index in style collection.
+ *
+ * @return int
+ */
+ public function getIndex()
+ {
+ return $this->index;
+ }
+
+ /**
+ * Set own index in style collection.
+ *
+ * @param int $pValue
+ */
+ public function setIndex($pValue)
+ {
+ $this->index = $pValue;
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Style/Supervisor.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Supervisor.php
similarity index 52%
rename from lib/phpexcel/PHPExcel/Style/Supervisor.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Supervisor.php
index a90e1c6a96d..2d1a27266b1 100644
--- a/lib/phpexcel/PHPExcel/Style/Supervisor.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Style/Supervisor.php
@@ -1,50 +1,38 @@
parent = $parent;
+ $this->parentPropertyName = $parentPropertyName;
+
return $this;
}
/**
* Is this a supervisor or a cell style component?
*
- * @return boolean
+ * @return bool
*/
public function getIsSupervisor()
{
@@ -77,9 +69,9 @@ abstract class PHPExcel_Style_Supervisor
}
/**
- * Get the currently active sheet. Only used for supervisor
+ * Get the currently active sheet. Only used for supervisor.
*
- * @return PHPExcel_Worksheet
+ * @return Worksheet
*/
public function getActiveSheet()
{
@@ -88,7 +80,7 @@ abstract class PHPExcel_Style_Supervisor
/**
* Get the currently active cell coordinate in currently active sheet.
- * Only used for supervisor
+ * Only used for supervisor.
*
* @return string E.g. 'A1'
*/
@@ -99,7 +91,7 @@ abstract class PHPExcel_Style_Supervisor
/**
* Get the currently active cell coordinate in currently active sheet.
- * Only used for supervisor
+ * Only used for supervisor.
*
* @return string E.g. 'A1'
*/
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter.php
new file mode 100644
index 00000000000..494948a77f2
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter.php
@@ -0,0 +1,873 @@
+range = $pRange;
+ $this->workSheet = $pSheet;
+ }
+
+ /**
+ * Get AutoFilter Parent Worksheet.
+ *
+ * @return Worksheet
+ */
+ public function getParent()
+ {
+ return $this->workSheet;
+ }
+
+ /**
+ * Set AutoFilter Parent Worksheet.
+ *
+ * @param Worksheet $pSheet
+ *
+ * @return AutoFilter
+ */
+ public function setParent(Worksheet $pSheet = null)
+ {
+ $this->workSheet = $pSheet;
+
+ return $this;
+ }
+
+ /**
+ * Get AutoFilter Range.
+ *
+ * @return string
+ */
+ public function getRange()
+ {
+ return $this->range;
+ }
+
+ /**
+ * Set AutoFilter Range.
+ *
+ * @param string $pRange Cell range (i.e. A1:E10)
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return AutoFilter
+ */
+ public function setRange($pRange)
+ {
+ // extract coordinate
+ list($worksheet, $pRange) = Worksheet::extractSheetTitle($pRange, true);
+
+ if (strpos($pRange, ':') !== false) {
+ $this->range = $pRange;
+ } elseif (empty($pRange)) {
+ $this->range = '';
+ } else {
+ throw new PhpSpreadsheetException('Autofilter must be set on a range of cells.');
+ }
+
+ if (empty($pRange)) {
+ // Discard all column rules
+ $this->columns = [];
+ } else {
+ // Discard any column rules that are no longer valid within this range
+ list($rangeStart, $rangeEnd) = Coordinate::rangeBoundaries($this->range);
+ foreach ($this->columns as $key => $value) {
+ $colIndex = Coordinate::columnIndexFromString($key);
+ if (($rangeStart[0] > $colIndex) || ($rangeEnd[0] < $colIndex)) {
+ unset($this->columns[$key]);
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get all AutoFilter Columns.
+ *
+ * @return AutoFilter\Column[]
+ */
+ public function getColumns()
+ {
+ return $this->columns;
+ }
+
+ /**
+ * Validate that the specified column is in the AutoFilter range.
+ *
+ * @param string $column Column name (e.g. A)
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return int The column offset within the autofilter range
+ */
+ public function testColumnInRange($column)
+ {
+ if (empty($this->range)) {
+ throw new PhpSpreadsheetException('No autofilter range is defined.');
+ }
+
+ $columnIndex = Coordinate::columnIndexFromString($column);
+ list($rangeStart, $rangeEnd) = Coordinate::rangeBoundaries($this->range);
+ if (($rangeStart[0] > $columnIndex) || ($rangeEnd[0] < $columnIndex)) {
+ throw new PhpSpreadsheetException('Column is outside of current autofilter range.');
+ }
+
+ return $columnIndex - $rangeStart[0];
+ }
+
+ /**
+ * Get a specified AutoFilter Column Offset within the defined AutoFilter range.
+ *
+ * @param string $pColumn Column name (e.g. A)
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return int The offset of the specified column within the autofilter range
+ */
+ public function getColumnOffset($pColumn)
+ {
+ return $this->testColumnInRange($pColumn);
+ }
+
+ /**
+ * Get a specified AutoFilter Column.
+ *
+ * @param string $pColumn Column name (e.g. A)
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return AutoFilter\Column
+ */
+ public function getColumn($pColumn)
+ {
+ $this->testColumnInRange($pColumn);
+
+ if (!isset($this->columns[$pColumn])) {
+ $this->columns[$pColumn] = new AutoFilter\Column($pColumn, $this);
+ }
+
+ return $this->columns[$pColumn];
+ }
+
+ /**
+ * Get a specified AutoFilter Column by it's offset.
+ *
+ * @param int $pColumnOffset Column offset within range (starting from 0)
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return AutoFilter\Column
+ */
+ public function getColumnByOffset($pColumnOffset)
+ {
+ list($rangeStart, $rangeEnd) = Coordinate::rangeBoundaries($this->range);
+ $pColumn = Coordinate::stringFromColumnIndex($rangeStart[0] + $pColumnOffset);
+
+ return $this->getColumn($pColumn);
+ }
+
+ /**
+ * Set AutoFilter.
+ *
+ * @param AutoFilter\Column|string $pColumn
+ * A simple string containing a Column ID like 'A' is permitted
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return AutoFilter
+ */
+ public function setColumn($pColumn)
+ {
+ if ((is_string($pColumn)) && (!empty($pColumn))) {
+ $column = $pColumn;
+ } elseif (is_object($pColumn) && ($pColumn instanceof AutoFilter\Column)) {
+ $column = $pColumn->getColumnIndex();
+ } else {
+ throw new PhpSpreadsheetException('Column is not within the autofilter range.');
+ }
+ $this->testColumnInRange($column);
+
+ if (is_string($pColumn)) {
+ $this->columns[$pColumn] = new AutoFilter\Column($pColumn, $this);
+ } elseif (is_object($pColumn) && ($pColumn instanceof AutoFilter\Column)) {
+ $pColumn->setParent($this);
+ $this->columns[$column] = $pColumn;
+ }
+ ksort($this->columns);
+
+ return $this;
+ }
+
+ /**
+ * Clear a specified AutoFilter Column.
+ *
+ * @param string $pColumn Column name (e.g. A)
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return AutoFilter
+ */
+ public function clearColumn($pColumn)
+ {
+ $this->testColumnInRange($pColumn);
+
+ if (isset($this->columns[$pColumn])) {
+ unset($this->columns[$pColumn]);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Shift an AutoFilter Column Rule to a different column.
+ *
+ * Note: This method bypasses validation of the destination column to ensure it is within this AutoFilter range.
+ * Nor does it verify whether any column rule already exists at $toColumn, but will simply override any existing value.
+ * Use with caution.
+ *
+ * @param string $fromColumn Column name (e.g. A)
+ * @param string $toColumn Column name (e.g. B)
+ *
+ * @return AutoFilter
+ */
+ public function shiftColumn($fromColumn, $toColumn)
+ {
+ $fromColumn = strtoupper($fromColumn);
+ $toColumn = strtoupper($toColumn);
+
+ if (($fromColumn !== null) && (isset($this->columns[$fromColumn])) && ($toColumn !== null)) {
+ $this->columns[$fromColumn]->setParent();
+ $this->columns[$fromColumn]->setColumnIndex($toColumn);
+ $this->columns[$toColumn] = $this->columns[$fromColumn];
+ $this->columns[$toColumn]->setParent($this);
+ unset($this->columns[$fromColumn]);
+
+ ksort($this->columns);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Test if cell value is in the defined set of values.
+ *
+ * @param mixed $cellValue
+ * @param mixed[] $dataSet
+ *
+ * @return bool
+ */
+ private static function filterTestInSimpleDataSet($cellValue, $dataSet)
+ {
+ $dataSetValues = $dataSet['filterValues'];
+ $blanks = $dataSet['blanks'];
+ if (($cellValue == '') || ($cellValue === null)) {
+ return $blanks;
+ }
+
+ return in_array($cellValue, $dataSetValues);
+ }
+
+ /**
+ * Test if cell value is in the defined set of Excel date values.
+ *
+ * @param mixed $cellValue
+ * @param mixed[] $dataSet
+ *
+ * @return bool
+ */
+ private static function filterTestInDateGroupSet($cellValue, $dataSet)
+ {
+ $dateSet = $dataSet['filterValues'];
+ $blanks = $dataSet['blanks'];
+ if (($cellValue == '') || ($cellValue === null)) {
+ return $blanks;
+ }
+
+ if (is_numeric($cellValue)) {
+ $dateValue = Date::excelToTimestamp($cellValue);
+ if ($cellValue < 1) {
+ // Just the time part
+ $dtVal = date('His', $dateValue);
+ $dateSet = $dateSet['time'];
+ } elseif ($cellValue == floor($cellValue)) {
+ // Just the date part
+ $dtVal = date('Ymd', $dateValue);
+ $dateSet = $dateSet['date'];
+ } else {
+ // date and time parts
+ $dtVal = date('YmdHis', $dateValue);
+ $dateSet = $dateSet['dateTime'];
+ }
+ foreach ($dateSet as $dateValue) {
+ // Use of substr to extract value at the appropriate group level
+ if (substr($dtVal, 0, strlen($dateValue)) == $dateValue) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Test if cell value is within a set of values defined by a ruleset.
+ *
+ * @param mixed $cellValue
+ * @param mixed[] $ruleSet
+ *
+ * @return bool
+ */
+ private static function filterTestInCustomDataSet($cellValue, $ruleSet)
+ {
+ $dataSet = $ruleSet['filterRules'];
+ $join = $ruleSet['join'];
+ $customRuleForBlanks = isset($ruleSet['customRuleForBlanks']) ? $ruleSet['customRuleForBlanks'] : false;
+
+ if (!$customRuleForBlanks) {
+ // Blank cells are always ignored, so return a FALSE
+ if (($cellValue == '') || ($cellValue === null)) {
+ return false;
+ }
+ }
+ $returnVal = ($join == AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND);
+ foreach ($dataSet as $rule) {
+ $retVal = false;
+
+ if (is_numeric($rule['value'])) {
+ // Numeric values are tested using the appropriate operator
+ switch ($rule['operator']) {
+ case AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL:
+ $retVal = ($cellValue == $rule['value']);
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_NOTEQUAL:
+ $retVal = ($cellValue != $rule['value']);
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHAN:
+ $retVal = ($cellValue > $rule['value']);
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL:
+ $retVal = ($cellValue >= $rule['value']);
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN:
+ $retVal = ($cellValue < $rule['value']);
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL:
+ $retVal = ($cellValue <= $rule['value']);
+
+ break;
+ }
+ } elseif ($rule['value'] == '') {
+ switch ($rule['operator']) {
+ case AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_EQUAL:
+ $retVal = (($cellValue == '') || ($cellValue === null));
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_NOTEQUAL:
+ $retVal = (($cellValue != '') && ($cellValue !== null));
+
+ break;
+ default:
+ $retVal = true;
+
+ break;
+ }
+ } else {
+ // String values are always tested for equality, factoring in for wildcards (hence a regexp test)
+ $retVal = preg_match('/^' . $rule['value'] . '$/i', $cellValue);
+ }
+ // If there are multiple conditions, then we need to test both using the appropriate join operator
+ switch ($join) {
+ case AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_OR:
+ $returnVal = $returnVal || $retVal;
+ // Break as soon as we have a TRUE match for OR joins,
+ // to avoid unnecessary additional code execution
+ if ($returnVal) {
+ return $returnVal;
+ }
+
+ break;
+ case AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND:
+ $returnVal = $returnVal && $retVal;
+
+ break;
+ }
+ }
+
+ return $returnVal;
+ }
+
+ /**
+ * Test if cell date value is matches a set of values defined by a set of months.
+ *
+ * @param mixed $cellValue
+ * @param mixed[] $monthSet
+ *
+ * @return bool
+ */
+ private static function filterTestInPeriodDateSet($cellValue, $monthSet)
+ {
+ // Blank cells are always ignored, so return a FALSE
+ if (($cellValue == '') || ($cellValue === null)) {
+ return false;
+ }
+
+ if (is_numeric($cellValue)) {
+ $dateValue = date('m', Date::excelToTimestamp($cellValue));
+ if (in_array($dateValue, $monthSet)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Search/Replace arrays to convert Excel wildcard syntax to a regexp syntax for preg_matching.
+ *
+ * @var array
+ */
+ private static $fromReplace = ['\*', '\?', '~~', '~.*', '~.?'];
+
+ private static $toReplace = ['.*', '.', '~', '\*', '\?'];
+
+ /**
+ * Convert a dynamic rule daterange to a custom filter range expression for ease of calculation.
+ *
+ * @param string $dynamicRuleType
+ * @param AutoFilter\Column $filterColumn
+ *
+ * @return mixed[]
+ */
+ private function dynamicFilterDateRange($dynamicRuleType, &$filterColumn)
+ {
+ $rDateType = Functions::getReturnDateType();
+ Functions::setReturnDateType(Functions::RETURNDATE_PHP_NUMERIC);
+ $val = $maxVal = null;
+
+ $ruleValues = [];
+ $baseDate = DateTime::DATENOW();
+ // Calculate start/end dates for the required date range based on current date
+ switch ($dynamicRuleType) {
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK:
+ $baseDate = strtotime('-7 days', $baseDate);
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK:
+ $baseDate = strtotime('-7 days', $baseDate);
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH:
+ $baseDate = strtotime('-1 month', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH:
+ $baseDate = strtotime('+1 month', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER:
+ $baseDate = strtotime('-3 month', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER:
+ $baseDate = strtotime('+3 month', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR:
+ $baseDate = strtotime('-1 year', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR:
+ $baseDate = strtotime('+1 year', gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
+
+ break;
+ }
+
+ switch ($dynamicRuleType) {
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_TODAY:
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY:
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW:
+ $maxVal = (int) Date::PHPtoExcel(strtotime('+1 day', $baseDate));
+ $val = (int) Date::PHPToExcel($baseDate);
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_YEARTODATE:
+ $maxVal = (int) Date::PHPtoExcel(strtotime('+1 day', $baseDate));
+ $val = (int) Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1, date('Y', $baseDate)));
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISYEAR:
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTYEAR:
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTYEAR:
+ $maxVal = (int) Date::PHPToExcel(gmmktime(0, 0, 0, 31, 12, date('Y', $baseDate)));
+ ++$maxVal;
+ $val = (int) Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1, date('Y', $baseDate)));
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISQUARTER:
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTQUARTER:
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTQUARTER:
+ $thisMonth = date('m', $baseDate);
+ $thisQuarter = floor(--$thisMonth / 3);
+ $maxVal = (int) Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), (1 + $thisQuarter) * 3, date('Y', $baseDate)));
+ ++$maxVal;
+ $val = (int) Date::PHPToExcel(gmmktime(0, 0, 0, 1, 1 + $thisQuarter * 3, date('Y', $baseDate)));
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISMONTH:
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTMONTH:
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTMONTH:
+ $maxVal = (int) Date::PHPtoExcel(gmmktime(0, 0, 0, date('t', $baseDate), date('m', $baseDate), date('Y', $baseDate)));
+ ++$maxVal;
+ $val = (int) Date::PHPToExcel(gmmktime(0, 0, 0, 1, date('m', $baseDate), date('Y', $baseDate)));
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_THISWEEK:
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_LASTWEEK:
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_NEXTWEEK:
+ $dayOfWeek = date('w', $baseDate);
+ $val = (int) Date::PHPToExcel($baseDate) - $dayOfWeek;
+ $maxVal = $val + 7;
+
+ break;
+ }
+
+ switch ($dynamicRuleType) {
+ // Adjust Today dates for Yesterday and Tomorrow
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_YESTERDAY:
+ --$maxVal;
+ --$val;
+
+ break;
+ case AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_TOMORROW:
+ ++$maxVal;
+ ++$val;
+
+ break;
+ }
+
+ // Set the filter column rule attributes ready for writing
+ $filterColumn->setAttributes(['val' => $val, 'maxVal' => $maxVal]);
+
+ // Set the rules for identifying rows for hide/show
+ $ruleValues[] = ['operator' => AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL, 'value' => $val];
+ $ruleValues[] = ['operator' => AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN, 'value' => $maxVal];
+ Functions::setReturnDateType($rDateType);
+
+ return ['method' => 'filterTestInCustomDataSet', 'arguments' => ['filterRules' => $ruleValues, 'join' => AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND]];
+ }
+
+ private function calculateTopTenValue($columnID, $startRow, $endRow, $ruleType, $ruleValue)
+ {
+ $range = $columnID . $startRow . ':' . $columnID . $endRow;
+ $dataValues = Functions::flattenArray($this->workSheet->rangeToArray($range, null, true, false));
+
+ $dataValues = array_filter($dataValues);
+ if ($ruleType == AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) {
+ rsort($dataValues);
+ } else {
+ sort($dataValues);
+ }
+
+ return array_pop(array_slice($dataValues, 0, $ruleValue));
+ }
+
+ /**
+ * Apply the AutoFilter rules to the AutoFilter Range.
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return AutoFilter
+ */
+ public function showHideRows()
+ {
+ list($rangeStart, $rangeEnd) = Coordinate::rangeBoundaries($this->range);
+
+ // The heading row should always be visible
+ $this->workSheet->getRowDimension($rangeStart[1])->setVisible(true);
+
+ $columnFilterTests = [];
+ foreach ($this->columns as $columnID => $filterColumn) {
+ $rules = $filterColumn->getRules();
+ switch ($filterColumn->getFilterType()) {
+ case AutoFilter\Column::AUTOFILTER_FILTERTYPE_FILTER:
+ $ruleType = null;
+ $ruleValues = [];
+ // Build a list of the filter value selections
+ foreach ($rules as $rule) {
+ $ruleType = $rule->getRuleType();
+ $ruleValues[] = $rule->getValue();
+ }
+ // Test if we want to include blanks in our filter criteria
+ $blanks = false;
+ $ruleDataSet = array_filter($ruleValues);
+ if (count($ruleValues) != count($ruleDataSet)) {
+ $blanks = true;
+ }
+ if ($ruleType == AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_FILTER) {
+ // Filter on absolute values
+ $columnFilterTests[$columnID] = [
+ 'method' => 'filterTestInSimpleDataSet',
+ 'arguments' => ['filterValues' => $ruleDataSet, 'blanks' => $blanks],
+ ];
+ } else {
+ // Filter on date group values
+ $arguments = [
+ 'date' => [],
+ 'time' => [],
+ 'dateTime' => [],
+ ];
+ foreach ($ruleDataSet as $ruleValue) {
+ $date = $time = '';
+ if ((isset($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR])) &&
+ ($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR] !== '')) {
+ $date .= sprintf('%04d', $ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_YEAR]);
+ }
+ if ((isset($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH])) &&
+ ($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH] != '')) {
+ $date .= sprintf('%02d', $ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_MONTH]);
+ }
+ if ((isset($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY])) &&
+ ($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY] !== '')) {
+ $date .= sprintf('%02d', $ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_DAY]);
+ }
+ if ((isset($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR])) &&
+ ($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR] !== '')) {
+ $time .= sprintf('%02d', $ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_HOUR]);
+ }
+ if ((isset($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE])) &&
+ ($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE] !== '')) {
+ $time .= sprintf('%02d', $ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_MINUTE]);
+ }
+ if ((isset($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND])) &&
+ ($ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND] !== '')) {
+ $time .= sprintf('%02d', $ruleValue[AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DATEGROUP_SECOND]);
+ }
+ $dateTime = $date . $time;
+ $arguments['date'][] = $date;
+ $arguments['time'][] = $time;
+ $arguments['dateTime'][] = $dateTime;
+ }
+ // Remove empty elements
+ $arguments['date'] = array_filter($arguments['date']);
+ $arguments['time'] = array_filter($arguments['time']);
+ $arguments['dateTime'] = array_filter($arguments['dateTime']);
+ $columnFilterTests[$columnID] = [
+ 'method' => 'filterTestInDateGroupSet',
+ 'arguments' => ['filterValues' => $arguments, 'blanks' => $blanks],
+ ];
+ }
+
+ break;
+ case AutoFilter\Column::AUTOFILTER_FILTERTYPE_CUSTOMFILTER:
+ $customRuleForBlanks = false;
+ $ruleValues = [];
+ // Build a list of the filter value selections
+ foreach ($rules as $rule) {
+ $ruleValue = $rule->getValue();
+ if (!is_numeric($ruleValue)) {
+ // Convert to a regexp allowing for regexp reserved characters, wildcards and escaped wildcards
+ $ruleValue = preg_quote($ruleValue);
+ $ruleValue = str_replace(self::$fromReplace, self::$toReplace, $ruleValue);
+ if (trim($ruleValue) == '') {
+ $customRuleForBlanks = true;
+ $ruleValue = trim($ruleValue);
+ }
+ }
+ $ruleValues[] = ['operator' => $rule->getOperator(), 'value' => $ruleValue];
+ }
+ $join = $filterColumn->getJoin();
+ $columnFilterTests[$columnID] = [
+ 'method' => 'filterTestInCustomDataSet',
+ 'arguments' => ['filterRules' => $ruleValues, 'join' => $join, 'customRuleForBlanks' => $customRuleForBlanks],
+ ];
+
+ break;
+ case AutoFilter\Column::AUTOFILTER_FILTERTYPE_DYNAMICFILTER:
+ $ruleValues = [];
+ foreach ($rules as $rule) {
+ // We should only ever have one Dynamic Filter Rule anyway
+ $dynamicRuleType = $rule->getGrouping();
+ if (($dynamicRuleType == AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE) ||
+ ($dynamicRuleType == AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_BELOWAVERAGE)) {
+ // Number (Average) based
+ // Calculate the average
+ $averageFormula = '=AVERAGE(' . $columnID . ($rangeStart[1] + 1) . ':' . $columnID . $rangeEnd[1] . ')';
+ $average = Calculation::getInstance()->calculateFormula($averageFormula, null, $this->workSheet->getCell('A1'));
+ // Set above/below rule based on greaterThan or LessTan
+ $operator = ($dynamicRuleType === AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_DYNAMIC_ABOVEAVERAGE)
+ ? AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHAN
+ : AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHAN;
+ $ruleValues[] = [
+ 'operator' => $operator,
+ 'value' => $average,
+ ];
+ $columnFilterTests[$columnID] = [
+ 'method' => 'filterTestInCustomDataSet',
+ 'arguments' => ['filterRules' => $ruleValues, 'join' => AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_OR],
+ ];
+ } else {
+ // Date based
+ if ($dynamicRuleType[0] == 'M' || $dynamicRuleType[0] == 'Q') {
+ $periodType = '';
+ $period = 0;
+ // Month or Quarter
+ sscanf($dynamicRuleType, '%[A-Z]%d', $periodType, $period);
+ if ($periodType == 'M') {
+ $ruleValues = [$period];
+ } else {
+ --$period;
+ $periodEnd = (1 + $period) * 3;
+ $periodStart = 1 + $period * 3;
+ $ruleValues = range($periodStart, $periodEnd);
+ }
+ $columnFilterTests[$columnID] = [
+ 'method' => 'filterTestInPeriodDateSet',
+ 'arguments' => $ruleValues,
+ ];
+ $filterColumn->setAttributes([]);
+ } else {
+ // Date Range
+ $columnFilterTests[$columnID] = $this->dynamicFilterDateRange($dynamicRuleType, $filterColumn);
+
+ break;
+ }
+ }
+ }
+
+ break;
+ case AutoFilter\Column::AUTOFILTER_FILTERTYPE_TOPTENFILTER:
+ $ruleValues = [];
+ $dataRowCount = $rangeEnd[1] - $rangeStart[1];
+ foreach ($rules as $rule) {
+ // We should only ever have one Dynamic Filter Rule anyway
+ $toptenRuleType = $rule->getGrouping();
+ $ruleValue = $rule->getValue();
+ $ruleOperator = $rule->getOperator();
+ }
+ if ($ruleOperator === AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT) {
+ $ruleValue = floor($ruleValue * ($dataRowCount / 100));
+ }
+ if ($ruleValue < 1) {
+ $ruleValue = 1;
+ }
+ if ($ruleValue > 500) {
+ $ruleValue = 500;
+ }
+
+ $maxVal = $this->calculateTopTenValue($columnID, $rangeStart[1] + 1, $rangeEnd[1], $toptenRuleType, $ruleValue);
+
+ $operator = ($toptenRuleType == AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP)
+ ? AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL
+ : AutoFilter\Column\Rule::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL;
+ $ruleValues[] = ['operator' => $operator, 'value' => $maxVal];
+ $columnFilterTests[$columnID] = [
+ 'method' => 'filterTestInCustomDataSet',
+ 'arguments' => ['filterRules' => $ruleValues, 'join' => AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_OR],
+ ];
+ $filterColumn->setAttributes(['maxVal' => $maxVal]);
+
+ break;
+ }
+ }
+
+ // Execute the column tests for each row in the autoFilter range to determine show/hide,
+ for ($row = $rangeStart[1] + 1; $row <= $rangeEnd[1]; ++$row) {
+ $result = true;
+ foreach ($columnFilterTests as $columnID => $columnFilterTest) {
+ $cellValue = $this->workSheet->getCell($columnID . $row)->getCalculatedValue();
+ // Execute the filter test
+ $result = $result &&
+ call_user_func_array(
+ [self::class, $columnFilterTest['method']],
+ [$cellValue, $columnFilterTest['arguments']]
+ );
+ // If filter test has resulted in FALSE, exit the loop straightaway rather than running any more tests
+ if (!$result) {
+ break;
+ }
+ }
+ // Set show/hide for the row based on the result of the autoFilter result
+ $this->workSheet->getRowDimension($row)->setVisible($result);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ if ($key === 'workSheet') {
+ // Detach from worksheet
+ $this->{$key} = null;
+ } else {
+ $this->{$key} = clone $value;
+ }
+ } elseif ((is_array($value)) && ($key == 'columns')) {
+ // The columns array of \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet\AutoFilter objects
+ $this->{$key} = [];
+ foreach ($value as $k => $v) {
+ $this->{$key}[$k] = clone $v;
+ // attach the new cloned Column to this new cloned Autofilter object
+ $this->{$key}[$k]->setParent($this);
+ }
+ } else {
+ $this->{$key} = $value;
+ }
+ }
+ }
+
+ /**
+ * toString method replicates previous behavior by returning the range if object is
+ * referenced as a property of its parent.
+ */
+ public function __toString()
+ {
+ return (string) $this->range;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php
new file mode 100644
index 00000000000..b5ab61e9713
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter/Column.php
@@ -0,0 +1,388 @@
+columnIndex = $pColumn;
+ $this->parent = $pParent;
+ }
+
+ /**
+ * Get AutoFilter Column Index.
+ *
+ * @return string
+ */
+ public function getColumnIndex()
+ {
+ return $this->columnIndex;
+ }
+
+ /**
+ * Set AutoFilter Column Index.
+ *
+ * @param string $pColumn Column (e.g. A)
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Column
+ */
+ public function setColumnIndex($pColumn)
+ {
+ // Uppercase coordinate
+ $pColumn = strtoupper($pColumn);
+ if ($this->parent !== null) {
+ $this->parent->testColumnInRange($pColumn);
+ }
+
+ $this->columnIndex = $pColumn;
+
+ return $this;
+ }
+
+ /**
+ * Get this Column's AutoFilter Parent.
+ *
+ * @return AutoFilter
+ */
+ public function getParent()
+ {
+ return $this->parent;
+ }
+
+ /**
+ * Set this Column's AutoFilter Parent.
+ *
+ * @param AutoFilter $pParent
+ *
+ * @return Column
+ */
+ public function setParent(AutoFilter $pParent = null)
+ {
+ $this->parent = $pParent;
+
+ return $this;
+ }
+
+ /**
+ * Get AutoFilter Type.
+ *
+ * @return string
+ */
+ public function getFilterType()
+ {
+ return $this->filterType;
+ }
+
+ /**
+ * Set AutoFilter Type.
+ *
+ * @param string $pFilterType
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Column
+ */
+ public function setFilterType($pFilterType)
+ {
+ if (!in_array($pFilterType, self::$filterTypes)) {
+ throw new PhpSpreadsheetException('Invalid filter type for column AutoFilter.');
+ }
+
+ $this->filterType = $pFilterType;
+
+ return $this;
+ }
+
+ /**
+ * Get AutoFilter Multiple Rules And/Or Join.
+ *
+ * @return string
+ */
+ public function getJoin()
+ {
+ return $this->join;
+ }
+
+ /**
+ * Set AutoFilter Multiple Rules And/Or.
+ *
+ * @param string $pJoin And/Or
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Column
+ */
+ public function setJoin($pJoin)
+ {
+ // Lowercase And/Or
+ $pJoin = strtolower($pJoin);
+ if (!in_array($pJoin, self::$ruleJoins)) {
+ throw new PhpSpreadsheetException('Invalid rule connection for column AutoFilter.');
+ }
+
+ $this->join = $pJoin;
+
+ return $this;
+ }
+
+ /**
+ * Set AutoFilter Attributes.
+ *
+ * @param string[] $attributes
+ *
+ * @return Column
+ */
+ public function setAttributes(array $attributes)
+ {
+ $this->attributes = $attributes;
+
+ return $this;
+ }
+
+ /**
+ * Set An AutoFilter Attribute.
+ *
+ * @param string $pName Attribute Name
+ * @param string $pValue Attribute Value
+ *
+ * @return Column
+ */
+ public function setAttribute($pName, $pValue)
+ {
+ $this->attributes[$pName] = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get AutoFilter Column Attributes.
+ *
+ * @return string[]
+ */
+ public function getAttributes()
+ {
+ return $this->attributes;
+ }
+
+ /**
+ * Get specific AutoFilter Column Attribute.
+ *
+ * @param string $pName Attribute Name
+ *
+ * @return string
+ */
+ public function getAttribute($pName)
+ {
+ if (isset($this->attributes[$pName])) {
+ return $this->attributes[$pName];
+ }
+
+ return null;
+ }
+
+ /**
+ * Get all AutoFilter Column Rules.
+ *
+ * @return Column\Rule[]
+ */
+ public function getRules()
+ {
+ return $this->ruleset;
+ }
+
+ /**
+ * Get a specified AutoFilter Column Rule.
+ *
+ * @param int $pIndex Rule index in the ruleset array
+ *
+ * @return Column\Rule
+ */
+ public function getRule($pIndex)
+ {
+ if (!isset($this->ruleset[$pIndex])) {
+ $this->ruleset[$pIndex] = new Column\Rule($this);
+ }
+
+ return $this->ruleset[$pIndex];
+ }
+
+ /**
+ * Create a new AutoFilter Column Rule in the ruleset.
+ *
+ * @return Column\Rule
+ */
+ public function createRule()
+ {
+ $this->ruleset[] = new Column\Rule($this);
+
+ return end($this->ruleset);
+ }
+
+ /**
+ * Add a new AutoFilter Column Rule to the ruleset.
+ *
+ * @param Column\Rule $pRule
+ *
+ * @return Column
+ */
+ public function addRule(Column\Rule $pRule)
+ {
+ $pRule->setParent($this);
+ $this->ruleset[] = $pRule;
+
+ return $this;
+ }
+
+ /**
+ * Delete a specified AutoFilter Column Rule
+ * If the number of rules is reduced to 1, then we reset And/Or logic to Or.
+ *
+ * @param int $pIndex Rule index in the ruleset array
+ *
+ * @return Column
+ */
+ public function deleteRule($pIndex)
+ {
+ if (isset($this->ruleset[$pIndex])) {
+ unset($this->ruleset[$pIndex]);
+ // If we've just deleted down to a single rule, then reset And/Or joining to Or
+ if (count($this->ruleset) <= 1) {
+ $this->setJoin(self::AUTOFILTER_COLUMN_JOIN_OR);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Delete all AutoFilter Column Rules.
+ *
+ * @return Column
+ */
+ public function clearRules()
+ {
+ $this->ruleset = [];
+ $this->setJoin(self::AUTOFILTER_COLUMN_JOIN_OR);
+
+ return $this;
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if ($key === 'parent') {
+ // Detach from autofilter parent
+ $this->parent = null;
+ } elseif ($key === 'ruleset') {
+ // The columns array of \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet\AutoFilter objects
+ $this->ruleset = [];
+ foreach ($value as $k => $v) {
+ $cloned = clone $v;
+ $cloned->setParent($this); // attach the new cloned Rule to this new cloned Autofilter Cloned object
+ $this->ruleset[$k] = $cloned;
+ }
+ } elseif (is_object($value)) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/AutoFilter/Column/Rule.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php
similarity index 53%
rename from lib/phpexcel/PHPExcel/Worksheet/AutoFilter/Column/Rule.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php
index 39ad18bf32d..450bccdb6ac 100644
--- a/lib/phpexcel/PHPExcel/Worksheet/AutoFilter/Column/Rule.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/AutoFilter/Column/Rule.php
@@ -1,39 +1,19 @@
*
*/
- const AUTOFILTER_COLUMN_RULE_EQUAL = 'equal';
- const AUTOFILTER_COLUMN_RULE_NOTEQUAL = 'notEqual';
- const AUTOFILTER_COLUMN_RULE_GREATERTHAN = 'greaterThan';
+ const AUTOFILTER_COLUMN_RULE_EQUAL = 'equal';
+ const AUTOFILTER_COLUMN_RULE_NOTEQUAL = 'notEqual';
+ const AUTOFILTER_COLUMN_RULE_GREATERTHAN = 'greaterThan';
const AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL = 'greaterThanOrEqual';
- const AUTOFILTER_COLUMN_RULE_LESSTHAN = 'lessThan';
- const AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL = 'lessThanOrEqual';
+ const AUTOFILTER_COLUMN_RULE_LESSTHAN = 'lessThan';
+ const AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL = 'lessThanOrEqual';
- private static $operators = array(
+ private static $operators = [
self::AUTOFILTER_COLUMN_RULE_EQUAL,
self::AUTOFILTER_COLUMN_RULE_NOTEQUAL,
self::AUTOFILTER_COLUMN_RULE_GREATERTHAN,
self::AUTOFILTER_COLUMN_RULE_GREATERTHANOREQUAL,
self::AUTOFILTER_COLUMN_RULE_LESSTHAN,
self::AUTOFILTER_COLUMN_RULE_LESSTHANOREQUAL,
- );
+ ];
const AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE = 'byValue';
- const AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT = 'byPercent';
+ const AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT = 'byPercent';
- private static $topTenValue = array(
+ private static $topTenValue = [
self::AUTOFILTER_COLUMN_RULE_TOPTEN_BY_VALUE,
self::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT,
- );
+ ];
- const AUTOFILTER_COLUMN_RULE_TOPTEN_TOP = 'top';
+ const AUTOFILTER_COLUMN_RULE_TOPTEN_TOP = 'top';
const AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM = 'bottom';
- private static $topTenType = array(
+ private static $topTenType = [
self::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP,
self::AUTOFILTER_COLUMN_RULE_TOPTEN_BOTTOM,
- );
+ ];
-
- /* Rule Operators (Numeric, Boolean etc) */
+ // Rule Operators (Numeric, Boolean etc)
// const AUTOFILTER_COLUMN_RULE_BETWEEN = 'between'; // greaterThanOrEqual 1 && lessThanOrEqual 2
- /* Rule Operators (Numeric Special) which are translated to standard numeric operators with calculated values */
+ // Rule Operators (Numeric Special) which are translated to standard numeric operators with calculated values
// const AUTOFILTER_COLUMN_RULE_TOPTEN = 'topTen'; // greaterThan calculated value
// const AUTOFILTER_COLUMN_RULE_TOPTENPERCENT = 'topTenPercent'; // greaterThan calculated value
// const AUTOFILTER_COLUMN_RULE_ABOVEAVERAGE = 'aboveAverage'; // Value is calculated as the average
// const AUTOFILTER_COLUMN_RULE_BELOWAVERAGE = 'belowAverage'; // Value is calculated as the average
- /* Rule Operators (String) which are set as wild-carded values */
+ // Rule Operators (String) which are set as wild-carded values
// const AUTOFILTER_COLUMN_RULE_BEGINSWITH = 'beginsWith'; // A*
// const AUTOFILTER_COLUMN_RULE_ENDSWITH = 'endsWith'; // *Z
// const AUTOFILTER_COLUMN_RULE_CONTAINS = 'contains'; // *B*
// const AUTOFILTER_COLUMN_RULE_DOESNTCONTAIN = 'notEqual'; // notEqual *B*
- /* Rule Operators (Date Special) which are translated to standard numeric operators with calculated values */
+ // Rule Operators (Date Special) which are translated to standard numeric operators with calculated values
// const AUTOFILTER_COLUMN_RULE_BEFORE = 'lessThan';
// const AUTOFILTER_COLUMN_RULE_AFTER = 'greaterThan';
// const AUTOFILTER_COLUMN_RULE_YESTERDAY = 'yesterday';
@@ -222,55 +201,52 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
// const AUTOFILTER_COLUMN_RULE_ALLDATESINQUARTER = 'allDatesInQuarter'; // for Quarter 2
/**
- * Autofilter Column
+ * Autofilter Column.
*
- * @var PHPExcel_Worksheet_AutoFilter_Column
+ * @var Column
*/
- private $parent = null;
-
+ private $parent;
/**
- * Autofilter Rule Type
+ * Autofilter Rule Type.
*
* @var string
*/
private $ruleType = self::AUTOFILTER_RULETYPE_FILTER;
-
/**
- * Autofilter Rule Value
+ * Autofilter Rule Value.
*
* @var string
*/
private $value = '';
/**
- * Autofilter Rule Operator
+ * Autofilter Rule Operator.
*
* @var string
*/
private $operator = self::AUTOFILTER_COLUMN_RULE_EQUAL;
/**
- * DateTimeGrouping Group Value
+ * DateTimeGrouping Group Value.
*
* @var string
*/
private $grouping = '';
-
/**
- * Create a new PHPExcel_Worksheet_AutoFilter_Column_Rule
+ * Create a new Rule.
*
- * @param PHPExcel_Worksheet_AutoFilter_Column $pParent
+ * @param Column $pParent
*/
- public function __construct(PHPExcel_Worksheet_AutoFilter_Column $pParent = null)
+ public function __construct(Column $pParent = null)
{
$this->parent = $pParent;
}
/**
- * Get AutoFilter Rule Type
+ * Get AutoFilter Rule Type.
*
* @return string
*/
@@ -280,16 +256,18 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
}
/**
- * Set AutoFilter Rule Type
+ * Set AutoFilter Rule Type.
*
- * @param string $pRuleType
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column
+ * @param string $pRuleType see self::AUTOFILTER_RULETYPE_*
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Rule
*/
- public function setRuleType($pRuleType = self::AUTOFILTER_RULETYPE_FILTER)
+ public function setRuleType($pRuleType)
{
if (!in_array($pRuleType, self::$ruleTypes)) {
- throw new PHPExcel_Exception('Invalid rule type for column AutoFilter Rule.');
+ throw new PhpSpreadsheetException('Invalid rule type for column AutoFilter Rule.');
}
$this->ruleType = $pRuleType;
@@ -298,7 +276,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
}
/**
- * Get AutoFilter Rule Value
+ * Get AutoFilter Rule Value.
*
* @return string
*/
@@ -308,13 +286,15 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
}
/**
- * Set AutoFilter Rule Value
+ * Set AutoFilter Rule Value.
*
- * @param string|string[] $pValue
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
+ * @param string|string[] $pValue
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Rule
*/
- public function setValue($pValue = '')
+ public function setValue($pValue)
{
if (is_array($pValue)) {
$grouping = -1;
@@ -329,7 +309,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
}
}
if (count($pValue) == 0) {
- throw new PHPExcel_Exception('Invalid rule value for column AutoFilter Rule.');
+ throw new PhpSpreadsheetException('Invalid rule value for column AutoFilter Rule.');
}
// Set the dateTime grouping that we've anticipated
$this->setGrouping(self::$dateTimeGroups[$grouping]);
@@ -340,7 +320,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
}
/**
- * Get AutoFilter Rule Operator
+ * Get AutoFilter Rule Operator.
*
* @return string
*/
@@ -350,20 +330,22 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
}
/**
- * Set AutoFilter Rule Operator
+ * Set AutoFilter Rule Operator.
*
- * @param string $pOperator
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
+ * @param string $pOperator see self::AUTOFILTER_COLUMN_RULE_*
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Rule
*/
- public function setOperator($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL)
+ public function setOperator($pOperator)
{
if (empty($pOperator)) {
$pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL;
}
if ((!in_array($pOperator, self::$operators)) &&
(!in_array($pOperator, self::$topTenValue))) {
- throw new PHPExcel_Exception('Invalid operator for column AutoFilter Rule.');
+ throw new PhpSpreadsheetException('Invalid operator for column AutoFilter Rule.');
}
$this->operator = $pOperator;
@@ -371,7 +353,7 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
}
/**
- * Get AutoFilter Rule Grouping
+ * Get AutoFilter Rule Grouping.
*
* @return string
*/
@@ -381,19 +363,21 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
}
/**
- * Set AutoFilter Rule Grouping
+ * Set AutoFilter Rule Grouping.
*
- * @param string $pGrouping
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
+ * @param string $pGrouping
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Rule
*/
- public function setGrouping($pGrouping = null)
+ public function setGrouping($pGrouping)
{
if (($pGrouping !== null) &&
(!in_array($pGrouping, self::$dateTimeGroups)) &&
(!in_array($pGrouping, self::$dynamicTypes)) &&
(!in_array($pGrouping, self::$topTenType))) {
- throw new PHPExcel_Exception('Invalid rule type for column AutoFilter Rule.');
+ throw new PhpSpreadsheetException('Invalid rule type for column AutoFilter Rule.');
}
$this->grouping = $pGrouping;
@@ -401,21 +385,23 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
}
/**
- * Set AutoFilter Rule
+ * Set AutoFilter Rule.
*
- * @param string $pOperator
- * @param string|string[] $pValue
- * @param string $pGrouping
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
+ * @param string $pOperator see self::AUTOFILTER_COLUMN_RULE_*
+ * @param string|string[] $pValue
+ * @param string $pGrouping
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Rule
*/
- public function setRule($pOperator = self::AUTOFILTER_COLUMN_RULE_EQUAL, $pValue = '', $pGrouping = null)
+ public function setRule($pOperator, $pValue, $pGrouping = null)
{
$this->setOperator($pOperator);
$this->setValue($pValue);
- // Only set grouping if it's been passed in as a user-supplied argument,
- // otherwise we're calculating it when we setValue() and don't want to overwrite that
- // If the user supplies an argumnet for grouping, then on their own head be it
+ // Only set grouping if it's been passed in as a user-supplied argument,
+ // otherwise we're calculating it when we setValue() and don't want to overwrite that
+ // If the user supplies an argumnet for grouping, then on their own head be it
if ($pGrouping !== null) {
$this->setGrouping($pGrouping);
}
@@ -424,9 +410,9 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
}
/**
- * Get this Rule's AutoFilter Column Parent
+ * Get this Rule's AutoFilter Column Parent.
*
- * @return PHPExcel_Worksheet_AutoFilter_Column
+ * @return Column
*/
public function getParent()
{
@@ -434,12 +420,13 @@ class PHPExcel_Worksheet_AutoFilter_Column_Rule
}
/**
- * Set this Rule's AutoFilter Column Parent
+ * Set this Rule's AutoFilter Column Parent.
*
- * @param PHPExcel_Worksheet_AutoFilter_Column
- * @return PHPExcel_Worksheet_AutoFilter_Column_Rule
+ * @param Column $pParent
+ *
+ * @return Rule
*/
- public function setParent(PHPExcel_Worksheet_AutoFilter_Column $pParent = null)
+ public function setParent(Column $pParent = null)
{
$this->parent = $pParent;
diff --git a/lib/phpexcel/PHPExcel/Worksheet/BaseDrawing.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/BaseDrawing.php
similarity index 55%
rename from lib/phpexcel/PHPExcel/Worksheet/BaseDrawing.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/BaseDrawing.php
index 9ad15c70f3f..98b689729e1 100644
--- a/lib/phpexcel/PHPExcel/Worksheet/BaseDrawing.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/BaseDrawing.php
@@ -1,148 +1,136 @@
name = '';
- $this->description = '';
- $this->worksheet = null;
- $this->coordinates = 'A1';
- $this->offsetX = 0;
- $this->offsetY = 0;
- $this->width = 0;
- $this->height = 0;
+ $this->name = '';
+ $this->description = '';
+ $this->worksheet = null;
+ $this->coordinates = 'A1';
+ $this->offsetX = 0;
+ $this->offsetY = 0;
+ $this->width = 0;
+ $this->height = 0;
$this->resizeProportional = true;
- $this->rotation = 0;
- $this->shadow = new PHPExcel_Worksheet_Drawing_Shadow();
+ $this->rotation = 0;
+ $this->shadow = new Drawing\Shadow();
// Set image index
- self::$imageCounter++;
- $this->imageIndex = self::$imageCounter;
+ ++self::$imageCounter;
+ $this->imageIndex = self::$imageCounter;
}
/**
- * Get image index
+ * Get image index.
*
* @return int
*/
@@ -152,7 +140,7 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
}
/**
- * Get Name
+ * Get Name.
*
* @return string
*/
@@ -162,19 +150,21 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
}
/**
- * Set Name
+ * Set Name.
*
* @param string $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
+ *
+ * @return BaseDrawing
*/
- public function setName($pValue = '')
+ public function setName($pValue)
{
$this->name = $pValue;
+
return $this;
}
/**
- * Get Description
+ * Get Description.
*
* @return string
*/
@@ -184,21 +174,23 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
}
/**
- * Set Description
+ * Set Description.
*
- * @param string $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
+ * @param string $description
+ *
+ * @return BaseDrawing
*/
- public function setDescription($pValue = '')
+ public function setDescription($description)
{
- $this->description = $pValue;
+ $this->description = $description;
+
return $this;
}
/**
- * Get Worksheet
+ * Get Worksheet.
*
- * @return PHPExcel_Worksheet
+ * @return Worksheet
*/
public function getWorksheet()
{
@@ -206,44 +198,48 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
}
/**
- * Set Worksheet
+ * Set Worksheet.
*
- * @param PHPExcel_Worksheet $pValue
- * @param bool $pOverrideOld If a Worksheet has already been assigned, overwrite it and remove image from old Worksheet?
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_BaseDrawing
+ * @param Worksheet $pValue
+ * @param bool $pOverrideOld If a Worksheet has already been assigned, overwrite it and remove image from old Worksheet?
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return BaseDrawing
*/
- public function setWorksheet(PHPExcel_Worksheet $pValue = null, $pOverrideOld = false)
+ public function setWorksheet(Worksheet $pValue = null, $pOverrideOld = false)
{
- if (is_null($this->worksheet)) {
- // Add drawing to PHPExcel_Worksheet
+ if ($this->worksheet === null) {
+ // Add drawing to \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
$this->worksheet = $pValue;
$this->worksheet->getCell($this->coordinates);
$this->worksheet->getDrawingCollection()->append($this);
} else {
if ($pOverrideOld) {
- // Remove drawing from old PHPExcel_Worksheet
+ // Remove drawing from old \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
$iterator = $this->worksheet->getDrawingCollection()->getIterator();
while ($iterator->valid()) {
if ($iterator->current()->getHashCode() == $this->getHashCode()) {
$this->worksheet->getDrawingCollection()->offsetUnset($iterator->key());
$this->worksheet = null;
+
break;
}
}
- // Set new PHPExcel_Worksheet
+ // Set new \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
$this->setWorksheet($pValue);
} else {
- throw new PHPExcel_Exception("A PHPExcel_Worksheet has already been assigned. Drawings can only exist on one PHPExcel_Worksheet.");
+ throw new PhpSpreadsheetException('A Worksheet has already been assigned. Drawings can only exist on one \\PhpOffice\\PhpSpreadsheet\\Worksheet.');
}
}
+
return $this;
}
/**
- * Get Coordinates
+ * Get Coordinates.
*
* @return string
*/
@@ -253,19 +249,21 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
}
/**
- * Set Coordinates
+ * Set Coordinates.
*
- * @param string $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
+ * @param string $pValue eg: 'A1'
+ *
+ * @return BaseDrawing
*/
- public function setCoordinates($pValue = 'A1')
+ public function setCoordinates($pValue)
{
$this->coordinates = $pValue;
+
return $this;
}
/**
- * Get OffsetX
+ * Get OffsetX.
*
* @return int
*/
@@ -275,19 +273,21 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
}
/**
- * Set OffsetX
+ * Set OffsetX.
*
* @param int $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
+ *
+ * @return BaseDrawing
*/
- public function setOffsetX($pValue = 0)
+ public function setOffsetX($pValue)
{
$this->offsetX = $pValue;
+
return $this;
}
/**
- * Get OffsetY
+ * Get OffsetY.
*
* @return int
*/
@@ -297,19 +297,21 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
}
/**
- * Set OffsetY
+ * Set OffsetY.
*
* @param int $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
+ *
+ * @return BaseDrawing
*/
- public function setOffsetY($pValue = 0)
+ public function setOffsetY($pValue)
{
$this->offsetY = $pValue;
+
return $this;
}
/**
- * Get Width
+ * Get Width.
*
* @return int
*/
@@ -319,12 +321,13 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
}
/**
- * Set Width
+ * Set Width.
*
* @param int $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
+ *
+ * @return BaseDrawing
*/
- public function setWidth($pValue = 0)
+ public function setWidth($pValue)
{
// Resize proportional?
if ($this->resizeProportional && $pValue != 0) {
@@ -339,7 +342,7 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
}
/**
- * Get Height
+ * Get Height.
*
* @return int
*/
@@ -349,12 +352,13 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
}
/**
- * Set Height
+ * Set Height.
*
* @param int $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
+ *
+ * @return BaseDrawing
*/
- public function setHeight($pValue = 0)
+ public function setHeight($pValue)
{
// Resize proportional?
if ($this->resizeProportional && $pValue != 0) {
@@ -369,7 +373,8 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
}
/**
- * Set width and height with proportional resize
+ * Set width and height with proportional resize.
+ *
* Example:
*
* $objDrawing->setResizeProportional(true);
@@ -377,21 +382,23 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
*
*
* @author Vincent@luo MSN:kele_100@hotmail.com
+ *
* @param int $width
* @param int $height
- * @return PHPExcel_Worksheet_BaseDrawing
+ *
+ * @return BaseDrawing
*/
- public function setWidthAndHeight($width = 0, $height = 0)
+ public function setWidthAndHeight($width, $height)
{
$xratio = $width / ($this->width != 0 ? $this->width : 1);
$yratio = $height / ($this->height != 0 ? $this->height : 1);
if ($this->resizeProportional && !($width == 0 || $height == 0)) {
if (($xratio * $this->height) < $height) {
$this->height = ceil($xratio * $this->height);
- $this->width = $width;
+ $this->width = $width;
} else {
- $this->width = ceil($yratio * $this->width);
- $this->height = $height;
+ $this->width = ceil($yratio * $this->width);
+ $this->height = $height;
}
} else {
$this->width = $width;
@@ -402,9 +409,9 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
}
/**
- * Get ResizeProportional
+ * Get ResizeProportional.
*
- * @return boolean
+ * @return bool
*/
public function getResizeProportional()
{
@@ -412,19 +419,21 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
}
/**
- * Set ResizeProportional
+ * Set ResizeProportional.
*
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
+ * @param bool $pValue
+ *
+ * @return BaseDrawing
*/
- public function setResizeProportional($pValue = true)
+ public function setResizeProportional($pValue)
{
$this->resizeProportional = $pValue;
+
return $this;
}
/**
- * Get Rotation
+ * Get Rotation.
*
* @return int
*/
@@ -434,21 +443,23 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
}
/**
- * Set Rotation
+ * Set Rotation.
*
* @param int $pValue
- * @return PHPExcel_Worksheet_BaseDrawing
+ *
+ * @return BaseDrawing
*/
- public function setRotation($pValue = 0)
+ public function setRotation($pValue)
{
$this->rotation = $pValue;
+
return $this;
}
/**
- * Get Shadow
+ * Get Shadow.
*
- * @return PHPExcel_Worksheet_Drawing_Shadow
+ * @return Drawing\Shadow
*/
public function getShadow()
{
@@ -456,22 +467,23 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
}
/**
- * Set Shadow
+ * Set Shadow.
*
- * @param PHPExcel_Worksheet_Drawing_Shadow $pValue
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_BaseDrawing
+ * @param Drawing\Shadow $pValue
+ *
+ * @return BaseDrawing
*/
- public function setShadow(PHPExcel_Worksheet_Drawing_Shadow $pValue = null)
+ public function setShadow(Drawing\Shadow $pValue = null)
{
- $this->shadow = $pValue;
- return $this;
+ $this->shadow = $pValue;
+
+ return $this;
}
/**
- * Get hash code
+ * Get hash code.
*
- * @return string Hash code
+ * @return string Hash code
*/
public function getHashCode()
{
@@ -497,11 +509,29 @@ class PHPExcel_Worksheet_BaseDrawing implements PHPExcel_IComparable
{
$vars = get_object_vars($this);
foreach ($vars as $key => $value) {
- if (is_object($value)) {
+ if ($key == 'worksheet') {
+ $this->worksheet = null;
+ } elseif (is_object($value)) {
$this->$key = clone $value;
} else {
$this->$key = $value;
}
}
}
+
+ /**
+ * @param null|Hyperlink $pHyperlink
+ */
+ public function setHyperlink(Hyperlink $pHyperlink = null)
+ {
+ $this->hyperlink = $pHyperlink;
+ }
+
+ /**
+ * @return null|Hyperlink
+ */
+ public function getHyperlink()
+ {
+ return $this->hyperlink;
+ }
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/CellIterator.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/CellIterator.php
new file mode 100644
index 00000000000..d97e33f7d10
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/CellIterator.php
@@ -0,0 +1,61 @@
+worksheet);
+ }
+
+ /**
+ * Get loop only existing cells.
+ *
+ * @return bool
+ */
+ public function getIterateOnlyExistingCells()
+ {
+ return $this->onlyExistingCells;
+ }
+
+ /**
+ * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary.
+ *
+ * @throws PhpSpreadsheetException
+ */
+ abstract protected function adjustForExistingOnlyRange();
+
+ /**
+ * Set the iterator to loop only existing cells.
+ *
+ * @param bool $value
+ *
+ * @throws PhpSpreadsheetException
+ */
+ public function setIterateOnlyExistingCells($value)
+ {
+ $this->onlyExistingCells = (bool) $value;
+
+ $this->adjustForExistingOnlyRange();
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Column.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Column.php
new file mode 100644
index 00000000000..4baaae1f54a
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Column.php
@@ -0,0 +1,64 @@
+parent = $parent;
+ $this->columnIndex = $columnIndex;
+ }
+
+ /**
+ * Destructor.
+ */
+ public function __destruct()
+ {
+ unset($this->parent);
+ }
+
+ /**
+ * Get column index.
+ *
+ * @return string
+ */
+ public function getColumnIndex()
+ {
+ return $this->columnIndex;
+ }
+
+ /**
+ * Get cell iterator.
+ *
+ * @param int $startRow The row number at which to start iterating
+ * @param int $endRow Optionally, the row number at which to stop iterating
+ *
+ * @return ColumnCellIterator
+ */
+ public function getCellIterator($startRow = 1, $endRow = null)
+ {
+ return new ColumnCellIterator($this->parent, $this->columnIndex, $startRow, $endRow);
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php
new file mode 100644
index 00000000000..7e8f040d26a
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnCellIterator.php
@@ -0,0 +1,197 @@
+worksheet = $subject;
+ $this->columnIndex = Coordinate::columnIndexFromString($columnIndex);
+ $this->resetEnd($endRow);
+ $this->resetStart($startRow);
+ }
+
+ /**
+ * (Re)Set the start row and the current row pointer.
+ *
+ * @param int $startRow The row number at which to start iterating
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return ColumnCellIterator
+ */
+ public function resetStart($startRow = 1)
+ {
+ $this->startRow = $startRow;
+ $this->adjustForExistingOnlyRange();
+ $this->seek($startRow);
+
+ return $this;
+ }
+
+ /**
+ * (Re)Set the end row.
+ *
+ * @param int $endRow The row number at which to stop iterating
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return ColumnCellIterator
+ */
+ public function resetEnd($endRow = null)
+ {
+ $this->endRow = ($endRow) ? $endRow : $this->worksheet->getHighestRow();
+ $this->adjustForExistingOnlyRange();
+
+ return $this;
+ }
+
+ /**
+ * Set the row pointer to the selected row.
+ *
+ * @param int $row The row number to set the current pointer at
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return ColumnCellIterator
+ */
+ public function seek($row = 1)
+ {
+ if (($row < $this->startRow) || ($row > $this->endRow)) {
+ throw new PhpSpreadsheetException("Row $row is out of range ({$this->startRow} - {$this->endRow})");
+ } elseif ($this->onlyExistingCells && !($this->worksheet->cellExistsByColumnAndRow($this->columnIndex, $row))) {
+ throw new PhpSpreadsheetException('In "IterateOnlyExistingCells" mode and Cell does not exist');
+ }
+ $this->currentRow = $row;
+
+ return $this;
+ }
+
+ /**
+ * Rewind the iterator to the starting row.
+ */
+ public function rewind()
+ {
+ $this->currentRow = $this->startRow;
+ }
+
+ /**
+ * Return the current cell in this worksheet column.
+ *
+ * @return null|\PhpOffice\PhpSpreadsheet\Cell\Cell
+ */
+ public function current()
+ {
+ return $this->worksheet->getCellByColumnAndRow($this->columnIndex, $this->currentRow);
+ }
+
+ /**
+ * Return the current iterator key.
+ *
+ * @return int
+ */
+ public function key()
+ {
+ return $this->currentRow;
+ }
+
+ /**
+ * Set the iterator to its next value.
+ */
+ public function next()
+ {
+ do {
+ ++$this->currentRow;
+ } while (($this->onlyExistingCells) &&
+ (!$this->worksheet->cellExistsByColumnAndRow($this->columnIndex, $this->currentRow)) &&
+ ($this->currentRow <= $this->endRow));
+ }
+
+ /**
+ * Set the iterator to its previous value.
+ */
+ public function prev()
+ {
+ do {
+ --$this->currentRow;
+ } while (($this->onlyExistingCells) &&
+ (!$this->worksheet->cellExistsByColumnAndRow($this->columnIndex, $this->currentRow)) &&
+ ($this->currentRow >= $this->startRow));
+ }
+
+ /**
+ * Indicate if more rows exist in the worksheet range of rows that we're iterating.
+ *
+ * @return bool
+ */
+ public function valid()
+ {
+ return $this->currentRow <= $this->endRow && $this->currentRow >= $this->startRow;
+ }
+
+ /**
+ * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary.
+ *
+ * @throws PhpSpreadsheetException
+ */
+ protected function adjustForExistingOnlyRange()
+ {
+ if ($this->onlyExistingCells) {
+ while ((!$this->worksheet->cellExistsByColumnAndRow($this->columnIndex, $this->startRow)) &&
+ ($this->startRow <= $this->endRow)) {
+ ++$this->startRow;
+ }
+ if ($this->startRow > $this->endRow) {
+ throw new PhpSpreadsheetException('No cells exist within the specified range');
+ }
+ while ((!$this->worksheet->cellExistsByColumnAndRow($this->columnIndex, $this->endRow)) &&
+ ($this->endRow >= $this->startRow)) {
+ --$this->endRow;
+ }
+ if ($this->endRow < $this->startRow) {
+ throw new PhpSpreadsheetException('No cells exist within the specified range');
+ }
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnDimension.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnDimension.php
new file mode 100644
index 00000000000..e2ea8af15f7
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnDimension.php
@@ -0,0 +1,115 @@
+columnIndex = $pIndex;
+
+ // set dimension as unformatted by default
+ parent::__construct(0);
+ }
+
+ /**
+ * Get ColumnIndex.
+ *
+ * @return string
+ */
+ public function getColumnIndex()
+ {
+ return $this->columnIndex;
+ }
+
+ /**
+ * Set ColumnIndex.
+ *
+ * @param string $pValue
+ *
+ * @return ColumnDimension
+ */
+ public function setColumnIndex($pValue)
+ {
+ $this->columnIndex = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Width.
+ *
+ * @return float
+ */
+ public function getWidth()
+ {
+ return $this->width;
+ }
+
+ /**
+ * Set Width.
+ *
+ * @param float $pValue
+ *
+ * @return ColumnDimension
+ */
+ public function setWidth($pValue)
+ {
+ $this->width = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Auto Size.
+ *
+ * @return bool
+ */
+ public function getAutoSize()
+ {
+ return $this->autoSize;
+ }
+
+ /**
+ * Set Auto Size.
+ *
+ * @param bool $pValue
+ *
+ * @return ColumnDimension
+ */
+ public function setAutoSize($pValue)
+ {
+ $this->autoSize = $pValue;
+
+ return $this;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnIterator.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnIterator.php
new file mode 100644
index 00000000000..d2b57aad2f5
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/ColumnIterator.php
@@ -0,0 +1,175 @@
+worksheet = $worksheet;
+ $this->resetEnd($endColumn);
+ $this->resetStart($startColumn);
+ }
+
+ /**
+ * Destructor.
+ */
+ public function __destruct()
+ {
+ unset($this->worksheet);
+ }
+
+ /**
+ * (Re)Set the start column and the current column pointer.
+ *
+ * @param string $startColumn The column address at which to start iterating
+ *
+ * @throws Exception
+ *
+ * @return ColumnIterator
+ */
+ public function resetStart($startColumn = 'A')
+ {
+ $startColumnIndex = Coordinate::columnIndexFromString($startColumn);
+ if ($startColumnIndex > Coordinate::columnIndexFromString($this->worksheet->getHighestColumn())) {
+ throw new Exception("Start column ({$startColumn}) is beyond highest column ({$this->worksheet->getHighestColumn()})");
+ }
+
+ $this->startColumnIndex = $startColumnIndex;
+ if ($this->endColumnIndex < $this->startColumnIndex) {
+ $this->endColumnIndex = $this->startColumnIndex;
+ }
+ $this->seek($startColumn);
+
+ return $this;
+ }
+
+ /**
+ * (Re)Set the end column.
+ *
+ * @param string $endColumn The column address at which to stop iterating
+ *
+ * @return ColumnIterator
+ */
+ public function resetEnd($endColumn = null)
+ {
+ $endColumn = $endColumn ? $endColumn : $this->worksheet->getHighestColumn();
+ $this->endColumnIndex = Coordinate::columnIndexFromString($endColumn);
+
+ return $this;
+ }
+
+ /**
+ * Set the column pointer to the selected column.
+ *
+ * @param string $column The column address to set the current pointer at
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return ColumnIterator
+ */
+ public function seek($column = 'A')
+ {
+ $column = Coordinate::columnIndexFromString($column);
+ if (($column < $this->startColumnIndex) || ($column > $this->endColumnIndex)) {
+ throw new PhpSpreadsheetException("Column $column is out of range ({$this->startColumnIndex} - {$this->endColumnIndex})");
+ }
+ $this->currentColumnIndex = $column;
+
+ return $this;
+ }
+
+ /**
+ * Rewind the iterator to the starting column.
+ */
+ public function rewind()
+ {
+ $this->currentColumnIndex = $this->startColumnIndex;
+ }
+
+ /**
+ * Return the current column in this worksheet.
+ *
+ * @return Column
+ */
+ public function current()
+ {
+ return new Column($this->worksheet, Coordinate::stringFromColumnIndex($this->currentColumnIndex));
+ }
+
+ /**
+ * Return the current iterator key.
+ *
+ * @return string
+ */
+ public function key()
+ {
+ return Coordinate::stringFromColumnIndex($this->currentColumnIndex);
+ }
+
+ /**
+ * Set the iterator to its next value.
+ */
+ public function next()
+ {
+ ++$this->currentColumnIndex;
+ }
+
+ /**
+ * Set the iterator to its previous value.
+ */
+ public function prev()
+ {
+ --$this->currentColumnIndex;
+ }
+
+ /**
+ * Indicate if more columns exist in the worksheet range of columns that we're iterating.
+ *
+ * @return bool
+ */
+ public function valid()
+ {
+ return $this->currentColumnIndex <= $this->endColumnIndex && $this->currentColumnIndex >= $this->startColumnIndex;
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/Dimension.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Dimension.php
similarity index 50%
rename from lib/phpexcel/PHPExcel/Worksheet/Dimension.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Dimension.php
index 84f692cb51d..44e66323206 100644
--- a/lib/phpexcel/PHPExcel/Worksheet/Dimension.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Dimension.php
@@ -1,31 +1,10 @@
visible = $pValue;
+
return $this;
}
/**
- * Get Outline Level
+ * Get Outline Level.
*
* @return int
*/
@@ -99,26 +80,28 @@ abstract class PHPExcel_Worksheet_Dimension
}
/**
- * Set Outline Level
- *
- * Value must be between 0 and 7
+ * Set Outline Level.
+ * Value must be between 0 and 7.
*
* @param int $pValue
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_Dimension
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Dimension
*/
public function setOutlineLevel($pValue)
{
if ($pValue < 0 || $pValue > 7) {
- throw new PHPExcel_Exception("Outline level must range between 0 and 7.");
+ throw new PhpSpreadsheetException('Outline level must range between 0 and 7.');
}
$this->outlineLevel = $pValue;
+
return $this;
}
/**
- * Get Collapsed
+ * Get Collapsed.
*
* @return bool
*/
@@ -128,19 +111,21 @@ abstract class PHPExcel_Worksheet_Dimension
}
/**
- * Set Collapsed
+ * Set Collapsed.
*
* @param bool $pValue
- * @return PHPExcel_Worksheet_Dimension
+ *
+ * @return Dimension
*/
- public function setCollapsed($pValue = true)
+ public function setCollapsed($pValue)
{
$this->collapsed = $pValue;
+
return $this;
}
/**
- * Get index to cellXf
+ * Get index to cellXf.
*
* @return int
*/
@@ -150,14 +135,16 @@ abstract class PHPExcel_Worksheet_Dimension
}
/**
- * Set index to cellXf
+ * Set index to cellXf.
*
* @param int $pValue
- * @return PHPExcel_Worksheet_Dimension
+ *
+ * @return Dimension
*/
- public function setXfIndex($pValue = 0)
+ public function setXfIndex($pValue)
{
$this->xfIndex = $pValue;
+
return $this;
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing.php
new file mode 100644
index 00000000000..ed26006c048
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing.php
@@ -0,0 +1,116 @@
+path = '';
+
+ // Initialize parent
+ parent::__construct();
+ }
+
+ /**
+ * Get Filename.
+ *
+ * @return string
+ */
+ public function getFilename()
+ {
+ return basename($this->path);
+ }
+
+ /**
+ * Get indexed filename (using image index).
+ *
+ * @return string
+ */
+ public function getIndexedFilename()
+ {
+ $fileName = $this->getFilename();
+ $fileName = str_replace(' ', '_', $fileName);
+
+ return str_replace('.' . $this->getExtension(), '', $fileName) . $this->getImageIndex() . '.' . $this->getExtension();
+ }
+
+ /**
+ * Get Extension.
+ *
+ * @return string
+ */
+ public function getExtension()
+ {
+ $exploded = explode('.', basename($this->path));
+
+ return $exploded[count($exploded) - 1];
+ }
+
+ /**
+ * Get Path.
+ *
+ * @return string
+ */
+ public function getPath()
+ {
+ return $this->path;
+ }
+
+ /**
+ * Set Path.
+ *
+ * @param string $pValue File path
+ * @param bool $pVerifyFile Verify file
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return Drawing
+ */
+ public function setPath($pValue, $pVerifyFile = true)
+ {
+ if ($pVerifyFile) {
+ if (file_exists($pValue)) {
+ $this->path = $pValue;
+
+ if ($this->width == 0 && $this->height == 0) {
+ // Get width/height
+ list($this->width, $this->height) = getimagesize($pValue);
+ }
+ } else {
+ throw new PhpSpreadsheetException("File $pValue not found!");
+ }
+ } else {
+ $this->path = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ return md5(
+ $this->path .
+ parent::getHashCode() .
+ __CLASS__
+ );
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php
new file mode 100644
index 00000000000..a1e05d60001
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Drawing/Shadow.php
@@ -0,0 +1,289 @@
+visible = false;
+ $this->blurRadius = 6;
+ $this->distance = 2;
+ $this->direction = 0;
+ $this->alignment = self::SHADOW_BOTTOM_RIGHT;
+ $this->color = new Color(Color::COLOR_BLACK);
+ $this->alpha = 50;
+ }
+
+ /**
+ * Get Visible.
+ *
+ * @return bool
+ */
+ public function getVisible()
+ {
+ return $this->visible;
+ }
+
+ /**
+ * Set Visible.
+ *
+ * @param bool $pValue
+ *
+ * @return Shadow
+ */
+ public function setVisible($pValue)
+ {
+ $this->visible = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Blur radius.
+ *
+ * @return int
+ */
+ public function getBlurRadius()
+ {
+ return $this->blurRadius;
+ }
+
+ /**
+ * Set Blur radius.
+ *
+ * @param int $pValue
+ *
+ * @return Shadow
+ */
+ public function setBlurRadius($pValue)
+ {
+ $this->blurRadius = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Shadow distance.
+ *
+ * @return int
+ */
+ public function getDistance()
+ {
+ return $this->distance;
+ }
+
+ /**
+ * Set Shadow distance.
+ *
+ * @param int $pValue
+ *
+ * @return Shadow
+ */
+ public function setDistance($pValue)
+ {
+ $this->distance = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Shadow direction (in degrees).
+ *
+ * @return int
+ */
+ public function getDirection()
+ {
+ return $this->direction;
+ }
+
+ /**
+ * Set Shadow direction (in degrees).
+ *
+ * @param int $pValue
+ *
+ * @return Shadow
+ */
+ public function setDirection($pValue)
+ {
+ $this->direction = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Shadow alignment.
+ *
+ * @return int
+ */
+ public function getAlignment()
+ {
+ return $this->alignment;
+ }
+
+ /**
+ * Set Shadow alignment.
+ *
+ * @param int $pValue
+ *
+ * @return Shadow
+ */
+ public function setAlignment($pValue)
+ {
+ $this->alignment = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Color.
+ *
+ * @return Color
+ */
+ public function getColor()
+ {
+ return $this->color;
+ }
+
+ /**
+ * Set Color.
+ *
+ * @param Color $pValue
+ *
+ * @return Shadow
+ */
+ public function setColor(Color $pValue = null)
+ {
+ $this->color = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Alpha.
+ *
+ * @return int
+ */
+ public function getAlpha()
+ {
+ return $this->alpha;
+ }
+
+ /**
+ * Set Alpha.
+ *
+ * @param int $pValue
+ *
+ * @return Shadow
+ */
+ public function setAlpha($pValue)
+ {
+ $this->alpha = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ return md5(
+ ($this->visible ? 't' : 'f') .
+ $this->blurRadius .
+ $this->distance .
+ $this->direction .
+ $this->alignment .
+ $this->color->getHashCode() .
+ $this->alpha .
+ __CLASS__
+ );
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/HeaderFooter.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooter.php
similarity index 62%
rename from lib/phpexcel/PHPExcel/Worksheet/HeaderFooter.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooter.php
index 3a88923fc9a..a78f4fccaeb 100644
--- a/lib/phpexcel/PHPExcel/Worksheet/HeaderFooter.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooter.php
@@ -1,31 +1,10 @@
- * Header/Footer Formatting Syntax taken from Office Open XML Part 4 - Markup Language Reference, page 1970:
+ * Header/Footer Formatting Syntax taken from Office Open XML Part 4 - Markup Language Reference, page 1970:.
*
* There are a number of formatting codes that can be written inline with the actual header / footer text, which
* affect the formatting in the header or footer.
@@ -83,104 +62,103 @@
* &O - code for "outline style"
* &H - code for "shadow style"
*
- *
*/
-class PHPExcel_Worksheet_HeaderFooter
+class HeaderFooter
{
- /* Header/footer image location */
- const IMAGE_HEADER_LEFT = 'LH';
+ // Header/footer image location
+ const IMAGE_HEADER_LEFT = 'LH';
const IMAGE_HEADER_CENTER = 'CH';
- const IMAGE_HEADER_RIGHT = 'RH';
- const IMAGE_FOOTER_LEFT = 'LF';
+ const IMAGE_HEADER_RIGHT = 'RH';
+ const IMAGE_FOOTER_LEFT = 'LF';
const IMAGE_FOOTER_CENTER = 'CF';
- const IMAGE_FOOTER_RIGHT = 'RF';
+ const IMAGE_FOOTER_RIGHT = 'RF';
/**
- * OddHeader
+ * OddHeader.
*
* @var string
*/
private $oddHeader = '';
/**
- * OddFooter
+ * OddFooter.
*
* @var string
*/
private $oddFooter = '';
/**
- * EvenHeader
+ * EvenHeader.
*
* @var string
*/
private $evenHeader = '';
/**
- * EvenFooter
+ * EvenFooter.
*
* @var string
*/
private $evenFooter = '';
/**
- * FirstHeader
+ * FirstHeader.
*
* @var string
*/
private $firstHeader = '';
/**
- * FirstFooter
+ * FirstFooter.
*
* @var string
*/
private $firstFooter = '';
/**
- * Different header for Odd/Even, defaults to false
+ * Different header for Odd/Even, defaults to false.
*
- * @var boolean
+ * @var bool
*/
private $differentOddEven = false;
/**
- * Different header for first page, defaults to false
+ * Different header for first page, defaults to false.
*
- * @var boolean
+ * @var bool
*/
private $differentFirst = false;
/**
- * Scale with document, defaults to true
+ * Scale with document, defaults to true.
*
- * @var boolean
+ * @var bool
*/
private $scaleWithDocument = true;
/**
- * Align with margins, defaults to true
+ * Align with margins, defaults to true.
*
- * @var boolean
+ * @var bool
*/
private $alignWithMargins = true;
/**
- * Header/footer images
+ * Header/footer images.
*
- * @var PHPExcel_Worksheet_HeaderFooterDrawing[]
+ * @var HeaderFooterDrawing[]
*/
- private $headerFooterImages = array();
+ private $headerFooterImages = [];
/**
- * Create a new PHPExcel_Worksheet_HeaderFooter
+ * Create a new HeaderFooter.
*/
public function __construct()
{
}
/**
- * Get OddHeader
+ * Get OddHeader.
*
* @return string
*/
@@ -190,19 +168,21 @@ class PHPExcel_Worksheet_HeaderFooter
}
/**
- * Set OddHeader
+ * Set OddHeader.
*
* @param string $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
+ *
+ * @return HeaderFooter
*/
public function setOddHeader($pValue)
{
$this->oddHeader = $pValue;
+
return $this;
}
/**
- * Get OddFooter
+ * Get OddFooter.
*
* @return string
*/
@@ -212,19 +192,21 @@ class PHPExcel_Worksheet_HeaderFooter
}
/**
- * Set OddFooter
+ * Set OddFooter.
*
* @param string $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
+ *
+ * @return HeaderFooter
*/
public function setOddFooter($pValue)
{
$this->oddFooter = $pValue;
+
return $this;
}
/**
- * Get EvenHeader
+ * Get EvenHeader.
*
* @return string
*/
@@ -234,19 +216,21 @@ class PHPExcel_Worksheet_HeaderFooter
}
/**
- * Set EvenHeader
+ * Set EvenHeader.
*
* @param string $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
+ *
+ * @return HeaderFooter
*/
public function setEvenHeader($pValue)
{
$this->evenHeader = $pValue;
+
return $this;
}
/**
- * Get EvenFooter
+ * Get EvenFooter.
*
* @return string
*/
@@ -256,19 +240,21 @@ class PHPExcel_Worksheet_HeaderFooter
}
/**
- * Set EvenFooter
+ * Set EvenFooter.
*
* @param string $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
+ *
+ * @return HeaderFooter
*/
public function setEvenFooter($pValue)
{
$this->evenFooter = $pValue;
+
return $this;
}
/**
- * Get FirstHeader
+ * Get FirstHeader.
*
* @return string
*/
@@ -278,19 +264,21 @@ class PHPExcel_Worksheet_HeaderFooter
}
/**
- * Set FirstHeader
+ * Set FirstHeader.
*
* @param string $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
+ *
+ * @return HeaderFooter
*/
public function setFirstHeader($pValue)
{
$this->firstHeader = $pValue;
+
return $this;
}
/**
- * Get FirstFooter
+ * Get FirstFooter.
*
* @return string
*/
@@ -300,21 +288,23 @@ class PHPExcel_Worksheet_HeaderFooter
}
/**
- * Set FirstFooter
+ * Set FirstFooter.
*
* @param string $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
+ *
+ * @return HeaderFooter
*/
public function setFirstFooter($pValue)
{
$this->firstFooter = $pValue;
+
return $this;
}
/**
- * Get DifferentOddEven
+ * Get DifferentOddEven.
*
- * @return boolean
+ * @return bool
*/
public function getDifferentOddEven()
{
@@ -322,21 +312,23 @@ class PHPExcel_Worksheet_HeaderFooter
}
/**
- * Set DifferentOddEven
+ * Set DifferentOddEven.
*
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
+ * @param bool $pValue
+ *
+ * @return HeaderFooter
*/
- public function setDifferentOddEven($pValue = false)
+ public function setDifferentOddEven($pValue)
{
$this->differentOddEven = $pValue;
+
return $this;
}
/**
- * Get DifferentFirst
+ * Get DifferentFirst.
*
- * @return boolean
+ * @return bool
*/
public function getDifferentFirst()
{
@@ -344,21 +336,23 @@ class PHPExcel_Worksheet_HeaderFooter
}
/**
- * Set DifferentFirst
+ * Set DifferentFirst.
*
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
+ * @param bool $pValue
+ *
+ * @return HeaderFooter
*/
- public function setDifferentFirst($pValue = false)
+ public function setDifferentFirst($pValue)
{
$this->differentFirst = $pValue;
+
return $this;
}
/**
- * Get ScaleWithDocument
+ * Get ScaleWithDocument.
*
- * @return boolean
+ * @return bool
*/
public function getScaleWithDocument()
{
@@ -366,21 +360,23 @@ class PHPExcel_Worksheet_HeaderFooter
}
/**
- * Set ScaleWithDocument
+ * Set ScaleWithDocument.
*
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
+ * @param bool $pValue
+ *
+ * @return HeaderFooter
*/
- public function setScaleWithDocument($pValue = true)
+ public function setScaleWithDocument($pValue)
{
$this->scaleWithDocument = $pValue;
+
return $this;
}
/**
- * Get AlignWithMargins
+ * Get AlignWithMargins.
*
- * @return boolean
+ * @return bool
*/
public function getAlignWithMargins()
{
@@ -388,89 +384,90 @@ class PHPExcel_Worksheet_HeaderFooter
}
/**
- * Set AlignWithMargins
+ * Set AlignWithMargins.
*
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_HeaderFooter
+ * @param bool $pValue
+ *
+ * @return HeaderFooter
*/
- public function setAlignWithMargins($pValue = true)
+ public function setAlignWithMargins($pValue)
{
$this->alignWithMargins = $pValue;
+
return $this;
}
/**
- * Add header/footer image
+ * Add header/footer image.
*
- * @param PHPExcel_Worksheet_HeaderFooterDrawing $image
+ * @param HeaderFooterDrawing $image
* @param string $location
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_HeaderFooter
+ *
+ * @return HeaderFooter
*/
- public function addImage(PHPExcel_Worksheet_HeaderFooterDrawing $image = null, $location = self::IMAGE_HEADER_LEFT)
+ public function addImage(HeaderFooterDrawing $image, $location = self::IMAGE_HEADER_LEFT)
{
$this->headerFooterImages[$location] = $image;
+
return $this;
}
/**
- * Remove header/footer image
+ * Remove header/footer image.
*
* @param string $location
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_HeaderFooter
+ *
+ * @return HeaderFooter
*/
public function removeImage($location = self::IMAGE_HEADER_LEFT)
{
if (isset($this->headerFooterImages[$location])) {
unset($this->headerFooterImages[$location]);
}
+
return $this;
}
/**
- * Set header/footer images
+ * Set header/footer images.
*
- * @param PHPExcel_Worksheet_HeaderFooterDrawing[] $images
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_HeaderFooter
+ * @param HeaderFooterDrawing[] $images
+ *
+ * @return HeaderFooter
*/
- public function setImages($images)
+ public function setImages(array $images)
{
- if (!is_array($images)) {
- throw new PHPExcel_Exception('Invalid parameter!');
- }
-
$this->headerFooterImages = $images;
+
return $this;
}
/**
- * Get header/footer images
+ * Get header/footer images.
*
- * @return PHPExcel_Worksheet_HeaderFooterDrawing[]
+ * @return HeaderFooterDrawing[]
*/
public function getImages()
{
// Sort array
- $images = array();
+ $images = [];
if (isset($this->headerFooterImages[self::IMAGE_HEADER_LEFT])) {
- $images[self::IMAGE_HEADER_LEFT] = $this->headerFooterImages[self::IMAGE_HEADER_LEFT];
+ $images[self::IMAGE_HEADER_LEFT] = $this->headerFooterImages[self::IMAGE_HEADER_LEFT];
}
if (isset($this->headerFooterImages[self::IMAGE_HEADER_CENTER])) {
- $images[self::IMAGE_HEADER_CENTER] = $this->headerFooterImages[self::IMAGE_HEADER_CENTER];
+ $images[self::IMAGE_HEADER_CENTER] = $this->headerFooterImages[self::IMAGE_HEADER_CENTER];
}
if (isset($this->headerFooterImages[self::IMAGE_HEADER_RIGHT])) {
- $images[self::IMAGE_HEADER_RIGHT] = $this->headerFooterImages[self::IMAGE_HEADER_RIGHT];
+ $images[self::IMAGE_HEADER_RIGHT] = $this->headerFooterImages[self::IMAGE_HEADER_RIGHT];
}
if (isset($this->headerFooterImages[self::IMAGE_FOOTER_LEFT])) {
- $images[self::IMAGE_FOOTER_LEFT] = $this->headerFooterImages[self::IMAGE_FOOTER_LEFT];
+ $images[self::IMAGE_FOOTER_LEFT] = $this->headerFooterImages[self::IMAGE_FOOTER_LEFT];
}
if (isset($this->headerFooterImages[self::IMAGE_FOOTER_CENTER])) {
- $images[self::IMAGE_FOOTER_CENTER] = $this->headerFooterImages[self::IMAGE_FOOTER_CENTER];
+ $images[self::IMAGE_FOOTER_CENTER] = $this->headerFooterImages[self::IMAGE_FOOTER_CENTER];
}
if (isset($this->headerFooterImages[self::IMAGE_FOOTER_RIGHT])) {
- $images[self::IMAGE_FOOTER_RIGHT] = $this->headerFooterImages[self::IMAGE_FOOTER_RIGHT];
+ $images[self::IMAGE_FOOTER_RIGHT] = $this->headerFooterImages[self::IMAGE_FOOTER_RIGHT];
}
$this->headerFooterImages = $images;
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php
new file mode 100644
index 00000000000..b42c7324c18
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/HeaderFooterDrawing.php
@@ -0,0 +1,24 @@
+getPath() .
+ $this->name .
+ $this->offsetX .
+ $this->offsetY .
+ $this->width .
+ $this->height .
+ __CLASS__
+ );
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Iterator.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Iterator.php
new file mode 100644
index 00000000000..d8797a34736
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Iterator.php
@@ -0,0 +1,87 @@
+subject = $subject;
+ }
+
+ /**
+ * Destructor.
+ */
+ public function __destruct()
+ {
+ unset($this->subject);
+ }
+
+ /**
+ * Rewind iterator.
+ */
+ public function rewind()
+ {
+ $this->position = 0;
+ }
+
+ /**
+ * Current Worksheet.
+ *
+ * @return Worksheet
+ */
+ public function current()
+ {
+ return $this->subject->getSheet($this->position);
+ }
+
+ /**
+ * Current key.
+ *
+ * @return int
+ */
+ public function key()
+ {
+ return $this->position;
+ }
+
+ /**
+ * Next value.
+ */
+ public function next()
+ {
+ ++$this->position;
+ }
+
+ /**
+ * Are there more Worksheet instances available?
+ *
+ * @return bool
+ */
+ public function valid()
+ {
+ return $this->position < $this->subject->getSheetCount() && $this->position >= 0;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php
new file mode 100644
index 00000000000..6012e93e6ea
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/MemoryDrawing.php
@@ -0,0 +1,169 @@
+imageResource = null;
+ $this->renderingFunction = self::RENDERING_DEFAULT;
+ $this->mimeType = self::MIMETYPE_DEFAULT;
+ $this->uniqueName = md5(rand(0, 9999) . time() . rand(0, 9999));
+
+ // Initialize parent
+ parent::__construct();
+ }
+
+ /**
+ * Get image resource.
+ *
+ * @return resource
+ */
+ public function getImageResource()
+ {
+ return $this->imageResource;
+ }
+
+ /**
+ * Set image resource.
+ *
+ * @param resource $value
+ *
+ * @return MemoryDrawing
+ */
+ public function setImageResource($value)
+ {
+ $this->imageResource = $value;
+
+ if ($this->imageResource !== null) {
+ // Get width/height
+ $this->width = imagesx($this->imageResource);
+ $this->height = imagesy($this->imageResource);
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get rendering function.
+ *
+ * @return string
+ */
+ public function getRenderingFunction()
+ {
+ return $this->renderingFunction;
+ }
+
+ /**
+ * Set rendering function.
+ *
+ * @param string $value see self::RENDERING_*
+ *
+ * @return MemoryDrawing
+ */
+ public function setRenderingFunction($value)
+ {
+ $this->renderingFunction = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get mime type.
+ *
+ * @return string
+ */
+ public function getMimeType()
+ {
+ return $this->mimeType;
+ }
+
+ /**
+ * Set mime type.
+ *
+ * @param string $value see self::MIMETYPE_*
+ *
+ * @return MemoryDrawing
+ */
+ public function setMimeType($value)
+ {
+ $this->mimeType = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get indexed filename (using image index).
+ *
+ * @return string
+ */
+ public function getIndexedFilename()
+ {
+ $extension = strtolower($this->getMimeType());
+ $extension = explode('/', $extension);
+ $extension = $extension[1];
+
+ return $this->uniqueName . $this->getImageIndex() . '.' . $extension;
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ return md5(
+ $this->renderingFunction .
+ $this->mimeType .
+ $this->uniqueName .
+ parent::getHashCode() .
+ __CLASS__
+ );
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageMargins.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageMargins.php
new file mode 100644
index 00000000000..eb44a1094c5
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageMargins.php
@@ -0,0 +1,214 @@
+left;
+ }
+
+ /**
+ * Set Left.
+ *
+ * @param float $pValue
+ *
+ * @return PageMargins
+ */
+ public function setLeft($pValue)
+ {
+ $this->left = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Right.
+ *
+ * @return float
+ */
+ public function getRight()
+ {
+ return $this->right;
+ }
+
+ /**
+ * Set Right.
+ *
+ * @param float $pValue
+ *
+ * @return PageMargins
+ */
+ public function setRight($pValue)
+ {
+ $this->right = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Top.
+ *
+ * @return float
+ */
+ public function getTop()
+ {
+ return $this->top;
+ }
+
+ /**
+ * Set Top.
+ *
+ * @param float $pValue
+ *
+ * @return PageMargins
+ */
+ public function setTop($pValue)
+ {
+ $this->top = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Bottom.
+ *
+ * @return float
+ */
+ public function getBottom()
+ {
+ return $this->bottom;
+ }
+
+ /**
+ * Set Bottom.
+ *
+ * @param float $pValue
+ *
+ * @return PageMargins
+ */
+ public function setBottom($pValue)
+ {
+ $this->bottom = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Header.
+ *
+ * @return float
+ */
+ public function getHeader()
+ {
+ return $this->header;
+ }
+
+ /**
+ * Set Header.
+ *
+ * @param float $pValue
+ *
+ * @return PageMargins
+ */
+ public function setHeader($pValue)
+ {
+ $this->header = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Footer.
+ *
+ * @return float
+ */
+ public function getFooter()
+ {
+ return $this->footer;
+ }
+
+ /**
+ * Set Footer.
+ *
+ * @param float $pValue
+ *
+ * @return PageMargins
+ */
+ public function setFooter($pValue)
+ {
+ $this->footer = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/PageSetup.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageSetup.php
similarity index 53%
rename from lib/phpexcel/PHPExcel/Worksheet/PageSetup.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageSetup.php
index c67053e6b13..ab007f61d54 100644
--- a/lib/phpexcel/PHPExcel/Worksheet/PageSetup.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/PageSetup.php
@@ -1,36 +1,13 @@
- * Paper size taken from Office Open XML Part 4 - Markup Language Reference, page 1988:
+ * Paper size taken from Office Open XML Part 4 - Markup Language Reference, page 1988:.
*
* 1 = Letter paper (8.5 in. by 11 in.)
* 2 = Letter small paper (8.5 in. by 11 in.)
@@ -100,106 +77,105 @@
* 68 = A3 extra transverse paper (322 mm by 445 mm)
*
*
- * @category PHPExcel
- * @package PHPExcel_Worksheet
- * @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
+ * @category PhpSpreadsheet
+ *
+ * @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet)
*/
-class PHPExcel_Worksheet_PageSetup
+class PageSetup
{
- /* Paper size */
- const PAPERSIZE_LETTER = 1;
- const PAPERSIZE_LETTER_SMALL = 2;
- const PAPERSIZE_TABLOID = 3;
- const PAPERSIZE_LEDGER = 4;
- const PAPERSIZE_LEGAL = 5;
- const PAPERSIZE_STATEMENT = 6;
- const PAPERSIZE_EXECUTIVE = 7;
- const PAPERSIZE_A3 = 8;
- const PAPERSIZE_A4 = 9;
- const PAPERSIZE_A4_SMALL = 10;
- const PAPERSIZE_A5 = 11;
- const PAPERSIZE_B4 = 12;
- const PAPERSIZE_B5 = 13;
- const PAPERSIZE_FOLIO = 14;
- const PAPERSIZE_QUARTO = 15;
- const PAPERSIZE_STANDARD_1 = 16;
- const PAPERSIZE_STANDARD_2 = 17;
- const PAPERSIZE_NOTE = 18;
- const PAPERSIZE_NO9_ENVELOPE = 19;
- const PAPERSIZE_NO10_ENVELOPE = 20;
- const PAPERSIZE_NO11_ENVELOPE = 21;
- const PAPERSIZE_NO12_ENVELOPE = 22;
- const PAPERSIZE_NO14_ENVELOPE = 23;
- const PAPERSIZE_C = 24;
- const PAPERSIZE_D = 25;
- const PAPERSIZE_E = 26;
- const PAPERSIZE_DL_ENVELOPE = 27;
- const PAPERSIZE_C5_ENVELOPE = 28;
- const PAPERSIZE_C3_ENVELOPE = 29;
- const PAPERSIZE_C4_ENVELOPE = 30;
- const PAPERSIZE_C6_ENVELOPE = 31;
- const PAPERSIZE_C65_ENVELOPE = 32;
- const PAPERSIZE_B4_ENVELOPE = 33;
- const PAPERSIZE_B5_ENVELOPE = 34;
- const PAPERSIZE_B6_ENVELOPE = 35;
- const PAPERSIZE_ITALY_ENVELOPE = 36;
- const PAPERSIZE_MONARCH_ENVELOPE = 37;
- const PAPERSIZE_6_3_4_ENVELOPE = 38;
- const PAPERSIZE_US_STANDARD_FANFOLD = 39;
- const PAPERSIZE_GERMAN_STANDARD_FANFOLD = 40;
- const PAPERSIZE_GERMAN_LEGAL_FANFOLD = 41;
- const PAPERSIZE_ISO_B4 = 42;
- const PAPERSIZE_JAPANESE_DOUBLE_POSTCARD = 43;
- const PAPERSIZE_STANDARD_PAPER_1 = 44;
- const PAPERSIZE_STANDARD_PAPER_2 = 45;
- const PAPERSIZE_STANDARD_PAPER_3 = 46;
- const PAPERSIZE_INVITE_ENVELOPE = 47;
- const PAPERSIZE_LETTER_EXTRA_PAPER = 48;
- const PAPERSIZE_LEGAL_EXTRA_PAPER = 49;
- const PAPERSIZE_TABLOID_EXTRA_PAPER = 50;
- const PAPERSIZE_A4_EXTRA_PAPER = 51;
- const PAPERSIZE_LETTER_TRANSVERSE_PAPER = 52;
- const PAPERSIZE_A4_TRANSVERSE_PAPER = 53;
- const PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER = 54;
- const PAPERSIZE_SUPERA_SUPERA_A4_PAPER = 55;
- const PAPERSIZE_SUPERB_SUPERB_A3_PAPER = 56;
- const PAPERSIZE_LETTER_PLUS_PAPER = 57;
- const PAPERSIZE_A4_PLUS_PAPER = 58;
- const PAPERSIZE_A5_TRANSVERSE_PAPER = 59;
- const PAPERSIZE_JIS_B5_TRANSVERSE_PAPER = 60;
- const PAPERSIZE_A3_EXTRA_PAPER = 61;
- const PAPERSIZE_A5_EXTRA_PAPER = 62;
- const PAPERSIZE_ISO_B5_EXTRA_PAPER = 63;
- const PAPERSIZE_A2_PAPER = 64;
- const PAPERSIZE_A3_TRANSVERSE_PAPER = 65;
- const PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER = 66;
+ // Paper size
+ const PAPERSIZE_LETTER = 1;
+ const PAPERSIZE_LETTER_SMALL = 2;
+ const PAPERSIZE_TABLOID = 3;
+ const PAPERSIZE_LEDGER = 4;
+ const PAPERSIZE_LEGAL = 5;
+ const PAPERSIZE_STATEMENT = 6;
+ const PAPERSIZE_EXECUTIVE = 7;
+ const PAPERSIZE_A3 = 8;
+ const PAPERSIZE_A4 = 9;
+ const PAPERSIZE_A4_SMALL = 10;
+ const PAPERSIZE_A5 = 11;
+ const PAPERSIZE_B4 = 12;
+ const PAPERSIZE_B5 = 13;
+ const PAPERSIZE_FOLIO = 14;
+ const PAPERSIZE_QUARTO = 15;
+ const PAPERSIZE_STANDARD_1 = 16;
+ const PAPERSIZE_STANDARD_2 = 17;
+ const PAPERSIZE_NOTE = 18;
+ const PAPERSIZE_NO9_ENVELOPE = 19;
+ const PAPERSIZE_NO10_ENVELOPE = 20;
+ const PAPERSIZE_NO11_ENVELOPE = 21;
+ const PAPERSIZE_NO12_ENVELOPE = 22;
+ const PAPERSIZE_NO14_ENVELOPE = 23;
+ const PAPERSIZE_C = 24;
+ const PAPERSIZE_D = 25;
+ const PAPERSIZE_E = 26;
+ const PAPERSIZE_DL_ENVELOPE = 27;
+ const PAPERSIZE_C5_ENVELOPE = 28;
+ const PAPERSIZE_C3_ENVELOPE = 29;
+ const PAPERSIZE_C4_ENVELOPE = 30;
+ const PAPERSIZE_C6_ENVELOPE = 31;
+ const PAPERSIZE_C65_ENVELOPE = 32;
+ const PAPERSIZE_B4_ENVELOPE = 33;
+ const PAPERSIZE_B5_ENVELOPE = 34;
+ const PAPERSIZE_B6_ENVELOPE = 35;
+ const PAPERSIZE_ITALY_ENVELOPE = 36;
+ const PAPERSIZE_MONARCH_ENVELOPE = 37;
+ const PAPERSIZE_6_3_4_ENVELOPE = 38;
+ const PAPERSIZE_US_STANDARD_FANFOLD = 39;
+ const PAPERSIZE_GERMAN_STANDARD_FANFOLD = 40;
+ const PAPERSIZE_GERMAN_LEGAL_FANFOLD = 41;
+ const PAPERSIZE_ISO_B4 = 42;
+ const PAPERSIZE_JAPANESE_DOUBLE_POSTCARD = 43;
+ const PAPERSIZE_STANDARD_PAPER_1 = 44;
+ const PAPERSIZE_STANDARD_PAPER_2 = 45;
+ const PAPERSIZE_STANDARD_PAPER_3 = 46;
+ const PAPERSIZE_INVITE_ENVELOPE = 47;
+ const PAPERSIZE_LETTER_EXTRA_PAPER = 48;
+ const PAPERSIZE_LEGAL_EXTRA_PAPER = 49;
+ const PAPERSIZE_TABLOID_EXTRA_PAPER = 50;
+ const PAPERSIZE_A4_EXTRA_PAPER = 51;
+ const PAPERSIZE_LETTER_TRANSVERSE_PAPER = 52;
+ const PAPERSIZE_A4_TRANSVERSE_PAPER = 53;
+ const PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER = 54;
+ const PAPERSIZE_SUPERA_SUPERA_A4_PAPER = 55;
+ const PAPERSIZE_SUPERB_SUPERB_A3_PAPER = 56;
+ const PAPERSIZE_LETTER_PLUS_PAPER = 57;
+ const PAPERSIZE_A4_PLUS_PAPER = 58;
+ const PAPERSIZE_A5_TRANSVERSE_PAPER = 59;
+ const PAPERSIZE_JIS_B5_TRANSVERSE_PAPER = 60;
+ const PAPERSIZE_A3_EXTRA_PAPER = 61;
+ const PAPERSIZE_A5_EXTRA_PAPER = 62;
+ const PAPERSIZE_ISO_B5_EXTRA_PAPER = 63;
+ const PAPERSIZE_A2_PAPER = 64;
+ const PAPERSIZE_A3_TRANSVERSE_PAPER = 65;
+ const PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER = 66;
- /* Page orientation */
- const ORIENTATION_DEFAULT = 'default';
- const ORIENTATION_LANDSCAPE = 'landscape';
- const ORIENTATION_PORTRAIT = 'portrait';
-
- /* Print Range Set Method */
- const SETPRINTRANGE_OVERWRITE = 'O';
- const SETPRINTRANGE_INSERT = 'I';
+ // Page orientation
+ const ORIENTATION_DEFAULT = 'default';
+ const ORIENTATION_LANDSCAPE = 'landscape';
+ const ORIENTATION_PORTRAIT = 'portrait';
+ // Print Range Set Method
+ const SETPRINTRANGE_OVERWRITE = 'O';
+ const SETPRINTRANGE_INSERT = 'I';
/**
- * Paper size
+ * Paper size.
*
* @var int
*/
- private $paperSize = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER;
+ private $paperSize = self::PAPERSIZE_LETTER;
/**
- * Orientation
+ * Orientation.
*
* @var string
*/
- private $orientation = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT;
+ private $orientation = self::ORIENTATION_DEFAULT;
/**
- * Scale (Print Scale)
+ * Scale (Print Scale).
*
* Print scaling. Valid values range from 10 to 400
* This setting is overridden when fitToWidth and/or fitToHeight are in use
@@ -209,80 +185,80 @@ class PHPExcel_Worksheet_PageSetup
private $scale = 100;
/**
- * Fit To Page
- * Whether scale or fitToWith / fitToHeight applies
- *
- * @var boolean
- */
+ * Fit To Page
+ * Whether scale or fitToWith / fitToHeight applies.
+ *
+ * @var bool
+ */
private $fitToPage = false;
/**
- * Fit To Height
- * Number of vertical pages to fit on
- *
- * @var int?
- */
- private $fitToHeight = 1;
+ * Fit To Height
+ * Number of vertical pages to fit on.
+ *
+ * @var int?
+ */
+ private $fitToHeight = 1;
/**
- * Fit To Width
- * Number of horizontal pages to fit on
- *
- * @var int?
- */
- private $fitToWidth = 1;
+ * Fit To Width
+ * Number of horizontal pages to fit on.
+ *
+ * @var int?
+ */
+ private $fitToWidth = 1;
/**
- * Columns to repeat at left
+ * Columns to repeat at left.
*
* @var array Containing start column and end column, empty array if option unset
*/
- private $columnsToRepeatAtLeft = array('', '');
+ private $columnsToRepeatAtLeft = ['', ''];
/**
- * Rows to repeat at top
+ * Rows to repeat at top.
*
* @var array Containing start row number and end row number, empty array if option unset
*/
- private $rowsToRepeatAtTop = array(0, 0);
+ private $rowsToRepeatAtTop = [0, 0];
/**
- * Center page horizontally
+ * Center page horizontally.
*
- * @var boolean
+ * @var bool
*/
private $horizontalCentered = false;
/**
- * Center page vertically
+ * Center page vertically.
*
- * @var boolean
+ * @var bool
*/
private $verticalCentered = false;
/**
- * Print area
+ * Print area.
*
* @var string
*/
- private $printArea = null;
+ private $printArea;
/**
- * First page number
+ * First page number.
*
* @var int
*/
- private $firstPageNumber = null;
+ private $firstPageNumber;
/**
- * Create a new PHPExcel_Worksheet_PageSetup
+ * Create a new PageSetup.
*/
public function __construct()
{
}
/**
- * Get Paper Size
+ * Get Paper Size.
*
* @return int
*/
@@ -292,19 +268,21 @@ class PHPExcel_Worksheet_PageSetup
}
/**
- * Set Paper Size
+ * Set Paper Size.
*
- * @param int $pValue
- * @return PHPExcel_Worksheet_PageSetup
+ * @param int $pValue see self::PAPERSIZE_*
+ *
+ * @return PageSetup
*/
- public function setPaperSize($pValue = PHPExcel_Worksheet_PageSetup::PAPERSIZE_LETTER)
+ public function setPaperSize($pValue)
{
$this->paperSize = $pValue;
+
return $this;
}
/**
- * Get Orientation
+ * Get Orientation.
*
* @return string
*/
@@ -314,19 +292,21 @@ class PHPExcel_Worksheet_PageSetup
}
/**
- * Set Orientation
+ * Set Orientation.
*
- * @param string $pValue
- * @return PHPExcel_Worksheet_PageSetup
+ * @param string $pValue see self::ORIENTATION_*
+ *
+ * @return PageSetup
*/
- public function setOrientation($pValue = PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT)
+ public function setOrientation($pValue)
{
$this->orientation = $pValue;
+
return $this;
}
/**
- * Get Scale
+ * Get Scale.
*
* @return int?
*/
@@ -336,35 +316,37 @@ class PHPExcel_Worksheet_PageSetup
}
/**
- * Set Scale
- *
+ * Set Scale.
* Print scaling. Valid values range from 10 to 400
- * This setting is overridden when fitToWidth and/or fitToHeight are in use
+ * This setting is overridden when fitToWidth and/or fitToHeight are in use.
*
- * @param int? $pValue
- * @param boolean $pUpdate Update fitToPage so scaling applies rather than fitToHeight / fitToWidth
- * @return PHPExcel_Worksheet_PageSetup
- * @throws PHPExcel_Exception
+ * @param null|int $pValue
+ * @param bool $pUpdate Update fitToPage so scaling applies rather than fitToHeight / fitToWidth
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return PageSetup
*/
- public function setScale($pValue = 100, $pUpdate = true)
+ public function setScale($pValue, $pUpdate = true)
{
// Microsoft Office Excel 2007 only allows setting a scale between 10 and 400 via the user interface,
// but it is apparently still able to handle any scale >= 0, where 0 results in 100
- if (($pValue >= 0) || is_null($pValue)) {
+ if (($pValue >= 0) || $pValue === null) {
$this->scale = $pValue;
if ($pUpdate) {
$this->fitToPage = false;
}
} else {
- throw new PHPExcel_Exception("Scale must not be negative");
+ throw new PhpSpreadsheetException('Scale must not be negative');
}
+
return $this;
}
/**
- * Get Fit To Page
+ * Get Fit To Page.
*
- * @return boolean
+ * @return bool
*/
public function getFitToPage()
{
@@ -372,19 +354,21 @@ class PHPExcel_Worksheet_PageSetup
}
/**
- * Set Fit To Page
+ * Set Fit To Page.
*
- * @param boolean $pValue
- * @return PHPExcel_Worksheet_PageSetup
+ * @param bool $pValue
+ *
+ * @return PageSetup
*/
- public function setFitToPage($pValue = true)
+ public function setFitToPage($pValue)
{
$this->fitToPage = $pValue;
+
return $this;
}
/**
- * Get Fit To Height
+ * Get Fit To Height.
*
* @return int?
*/
@@ -394,23 +378,25 @@ class PHPExcel_Worksheet_PageSetup
}
/**
- * Set Fit To Height
+ * Set Fit To Height.
*
- * @param int? $pValue
- * @param boolean $pUpdate Update fitToPage so it applies rather than scaling
- * @return PHPExcel_Worksheet_PageSetup
+ * @param null|int $pValue
+ * @param bool $pUpdate Update fitToPage so it applies rather than scaling
+ *
+ * @return PageSetup
*/
- public function setFitToHeight($pValue = 1, $pUpdate = true)
+ public function setFitToHeight($pValue, $pUpdate = true)
{
$this->fitToHeight = $pValue;
if ($pUpdate) {
$this->fitToPage = true;
}
+
return $this;
}
/**
- * Get Fit To Width
+ * Get Fit To Width.
*
* @return int?
*/
@@ -420,25 +406,27 @@ class PHPExcel_Worksheet_PageSetup
}
/**
- * Set Fit To Width
+ * Set Fit To Width.
*
- * @param int? $pValue
- * @param boolean $pUpdate Update fitToPage so it applies rather than scaling
- * @return PHPExcel_Worksheet_PageSetup
+ * @param null|int $pValue
+ * @param bool $pUpdate Update fitToPage so it applies rather than scaling
+ *
+ * @return PageSetup
*/
- public function setFitToWidth($pValue = 1, $pUpdate = true)
+ public function setFitToWidth($pValue, $pUpdate = true)
{
$this->fitToWidth = $pValue;
if ($pUpdate) {
$this->fitToPage = true;
}
+
return $this;
}
/**
* Is Columns to repeat at left set?
*
- * @return boolean
+ * @return bool
*/
public function isColumnsToRepeatAtLeftSet()
{
@@ -452,7 +440,7 @@ class PHPExcel_Worksheet_PageSetup
}
/**
- * Get Columns to repeat at left
+ * Get Columns to repeat at left.
*
* @return array Containing start column and end column, empty array if option unset
*/
@@ -462,36 +450,38 @@ class PHPExcel_Worksheet_PageSetup
}
/**
- * Set Columns to repeat at left
+ * Set Columns to repeat at left.
*
* @param array $pValue Containing start column and end column, empty array if option unset
- * @return PHPExcel_Worksheet_PageSetup
+ *
+ * @return PageSetup
*/
- public function setColumnsToRepeatAtLeft($pValue = null)
+ public function setColumnsToRepeatAtLeft(array $pValue)
{
- if (is_array($pValue)) {
- $this->columnsToRepeatAtLeft = $pValue;
- }
+ $this->columnsToRepeatAtLeft = $pValue;
+
return $this;
}
/**
- * Set Columns to repeat at left by start and end
+ * Set Columns to repeat at left by start and end.
*
- * @param string $pStart
- * @param string $pEnd
- * @return PHPExcel_Worksheet_PageSetup
+ * @param string $pStart eg: 'A'
+ * @param string $pEnd eg: 'B'
+ *
+ * @return PageSetup
*/
- public function setColumnsToRepeatAtLeftByStartAndEnd($pStart = 'A', $pEnd = 'A')
+ public function setColumnsToRepeatAtLeftByStartAndEnd($pStart, $pEnd)
{
- $this->columnsToRepeatAtLeft = array($pStart, $pEnd);
+ $this->columnsToRepeatAtLeft = [$pStart, $pEnd];
+
return $this;
}
/**
* Is Rows to repeat at top set?
*
- * @return boolean
+ * @return bool
*/
public function isRowsToRepeatAtTopSet()
{
@@ -505,7 +495,7 @@ class PHPExcel_Worksheet_PageSetup
}
/**
- * Get Rows to repeat at top
+ * Get Rows to repeat at top.
*
* @return array Containing start column and end column, empty array if option unset
*/
@@ -515,34 +505,36 @@ class PHPExcel_Worksheet_PageSetup
}
/**
- * Set Rows to repeat at top
+ * Set Rows to repeat at top.
*
- * @param array $pValue Containing start column and end column, empty array if option unset
- * @return PHPExcel_Worksheet_PageSetup
+ * @param array $pValue Containing start column and end column, empty array if option unset
+ *
+ * @return PageSetup
*/
- public function setRowsToRepeatAtTop($pValue = null)
+ public function setRowsToRepeatAtTop(array $pValue)
{
- if (is_array($pValue)) {
- $this->rowsToRepeatAtTop = $pValue;
- }
+ $this->rowsToRepeatAtTop = $pValue;
+
return $this;
}
/**
- * Set Rows to repeat at top by start and end
+ * Set Rows to repeat at top by start and end.
*
- * @param int $pStart
- * @param int $pEnd
- * @return PHPExcel_Worksheet_PageSetup
+ * @param int $pStart eg: 1
+ * @param int $pEnd eg: 1
+ *
+ * @return PageSetup
*/
- public function setRowsToRepeatAtTopByStartAndEnd($pStart = 1, $pEnd = 1)
+ public function setRowsToRepeatAtTopByStartAndEnd($pStart, $pEnd)
{
- $this->rowsToRepeatAtTop = array($pStart, $pEnd);
+ $this->rowsToRepeatAtTop = [$pStart, $pEnd];
+
return $this;
}
/**
- * Get center page horizontally
+ * Get center page horizontally.
*
* @return bool
*/
@@ -552,19 +544,21 @@ class PHPExcel_Worksheet_PageSetup
}
/**
- * Set center page horizontally
+ * Set center page horizontally.
*
* @param bool $value
- * @return PHPExcel_Worksheet_PageSetup
+ *
+ * @return PageSetup
*/
- public function setHorizontalCentered($value = false)
+ public function setHorizontalCentered($value)
{
$this->horizontalCentered = $value;
+
return $this;
}
/**
- * Get center page vertically
+ * Get center page vertically.
*
* @return bool
*/
@@ -574,26 +568,30 @@ class PHPExcel_Worksheet_PageSetup
}
/**
- * Set center page vertically
+ * Set center page vertically.
*
* @param bool $value
- * @return PHPExcel_Worksheet_PageSetup
+ *
+ * @return PageSetup
*/
- public function setVerticalCentered($value = false)
+ public function setVerticalCentered($value)
{
$this->verticalCentered = $value;
+
return $this;
}
/**
- * Get print area
+ * Get print area.
*
- * @param int $index Identifier for a specific print area range if several ranges have been set
+ * @param int $index Identifier for a specific print area range if several ranges have been set
* Default behaviour, or a index value of 0, will return all ranges as a comma-separated string
* Otherwise, the specific range identified by the value of $index will be returned
* Print areas are numbered from 1
- * @throws PHPExcel_Exception
- * @return string
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return string
*/
public function getPrintArea($index = 0)
{
@@ -601,38 +599,42 @@ class PHPExcel_Worksheet_PageSetup
return $this->printArea;
}
$printAreas = explode(',', $this->printArea);
- if (isset($printAreas[$index-1])) {
- return $printAreas[$index-1];
+ if (isset($printAreas[$index - 1])) {
+ return $printAreas[$index - 1];
}
- throw new PHPExcel_Exception("Requested Print Area does not exist");
+
+ throw new PhpSpreadsheetException('Requested Print Area does not exist');
}
/**
* Is print area set?
*
- * @param int $index Identifier for a specific print area range if several ranges have been set
+ * @param int $index Identifier for a specific print area range if several ranges have been set
* Default behaviour, or an index value of 0, will identify whether any print range is set
* Otherwise, existence of the range identified by the value of $index will be returned
* Print areas are numbered from 1
- * @return boolean
+ *
+ * @return bool
*/
public function isPrintAreaSet($index = 0)
{
if ($index == 0) {
- return !is_null($this->printArea);
+ return $this->printArea !== null;
}
$printAreas = explode(',', $this->printArea);
- return isset($printAreas[$index-1]);
+
+ return isset($printAreas[$index - 1]);
}
/**
- * Clear a print area
+ * Clear a print area.
*
- * @param int $index Identifier for a specific print area range if several ranges have been set
+ * @param int $index Identifier for a specific print area range if several ranges have been set
* Default behaviour, or an index value of 0, will clear all print ranges that are set
* Otherwise, the range identified by the value of $index will be removed from the series
* Print areas are numbered from 1
- * @return PHPExcel_Worksheet_PageSetup
+ *
+ * @return PageSetup
*/
public function clearPrintArea($index = 0)
{
@@ -640,8 +642,8 @@ class PHPExcel_Worksheet_PageSetup
$this->printArea = null;
} else {
$printAreas = explode(',', $this->printArea);
- if (isset($printAreas[$index-1])) {
- unset($printAreas[$index-1]);
+ if (isset($printAreas[$index - 1])) {
+ unset($printAreas[$index - 1]);
$this->printArea = implode(',', $printAreas);
}
}
@@ -650,10 +652,10 @@ class PHPExcel_Worksheet_PageSetup
}
/**
- * Set print area. e.g. 'A1:D10' or 'A1:D10,G5:M20'
+ * Set print area. e.g. 'A1:D10' or 'A1:D10,G5:M20'.
*
- * @param string $value
- * @param int $index Identifier for a specific print area range allowing several ranges to be set
+ * @param string $value
+ * @param int $index Identifier for a specific print area range allowing several ranges to be set
* When the method is "O"verwrite, then a positive integer index will overwrite that indexed
* entry in the print areas list; a negative index value will identify which entry to
* overwrite working bacward through the print area to the list, with the last entry as -1.
@@ -663,20 +665,22 @@ class PHPExcel_Worksheet_PageSetup
* Specifying an index value of 0, will always append the new print range at the end of the
* list.
* Print areas are numbered from 1
- * @param string $method Determines the method used when setting multiple print areas
+ * @param string $method Determines the method used when setting multiple print areas
* Default behaviour, or the "O" method, overwrites existing print area
* The "I" method, inserts the new print area before any specified index, or at the end of the list
- * @return PHPExcel_Worksheet_PageSetup
- * @throws PHPExcel_Exception
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return PageSetup
*/
public function setPrintArea($value, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE)
{
if (strpos($value, '!') !== false) {
- throw new PHPExcel_Exception('Cell coordinate must not specify a worksheet.');
+ throw new PhpSpreadsheetException('Cell coordinate must not specify a worksheet.');
} elseif (strpos($value, ':') === false) {
- throw new PHPExcel_Exception('Cell coordinate must be a range of cells.');
+ throw new PhpSpreadsheetException('Cell coordinate must be a range of cells.');
} elseif (strpos($value, '$') !== false) {
- throw new PHPExcel_Exception('Cell coordinate must not be absolute.');
+ throw new PhpSpreadsheetException('Cell coordinate must not be absolute.');
}
$value = strtoupper($value);
@@ -689,44 +693,46 @@ class PHPExcel_Worksheet_PageSetup
$index = count($printAreas) - abs($index) + 1;
}
if (($index <= 0) || ($index > count($printAreas))) {
- throw new PHPExcel_Exception('Invalid index for setting print range.');
+ throw new PhpSpreadsheetException('Invalid index for setting print range.');
}
- $printAreas[$index-1] = $value;
+ $printAreas[$index - 1] = $value;
$this->printArea = implode(',', $printAreas);
}
} elseif ($method == self::SETPRINTRANGE_INSERT) {
if ($index == 0) {
- $this->printArea .= ($this->printArea == '') ? $value : ','.$value;
+ $this->printArea .= ($this->printArea == '') ? $value : ',' . $value;
} else {
$printAreas = explode(',', $this->printArea);
if ($index < 0) {
$index = abs($index) - 1;
}
if ($index > count($printAreas)) {
- throw new PHPExcel_Exception('Invalid index for setting print range.');
+ throw new PhpSpreadsheetException('Invalid index for setting print range.');
}
- $printAreas = array_merge(array_slice($printAreas, 0, $index), array($value), array_slice($printAreas, $index));
+ $printAreas = array_merge(array_slice($printAreas, 0, $index), [$value], array_slice($printAreas, $index));
$this->printArea = implode(',', $printAreas);
}
} else {
- throw new PHPExcel_Exception('Invalid method for setting print range.');
+ throw new PhpSpreadsheetException('Invalid method for setting print range.');
}
return $this;
}
/**
- * Add a new print area (e.g. 'A1:D10' or 'A1:D10,G5:M20') to the list of print areas
+ * Add a new print area (e.g. 'A1:D10' or 'A1:D10,G5:M20') to the list of print areas.
*
- * @param string $value
- * @param int $index Identifier for a specific print area range allowing several ranges to be set
+ * @param string $value
+ * @param int $index Identifier for a specific print area range allowing several ranges to be set
* A positive index will insert after that indexed entry in the print areas list, while a
* negative index will insert before the indexed entry.
* Specifying an index value of 0, will always append the new print range at the end of the
* list.
* Print areas are numbered from 1
- * @return PHPExcel_Worksheet_PageSetup
- * @throws PHPExcel_Exception
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return PageSetup
*/
public function addPrintArea($value, $index = -1)
{
@@ -734,64 +740,68 @@ class PHPExcel_Worksheet_PageSetup
}
/**
- * Set print area
+ * Set print area.
*
- * @param int $column1 Column 1
- * @param int $row1 Row 1
- * @param int $column2 Column 2
- * @param int $row2 Row 2
- * @param int $index Identifier for a specific print area range allowing several ranges to be set
+ * @param int $column1 Column 1
+ * @param int $row1 Row 1
+ * @param int $column2 Column 2
+ * @param int $row2 Row 2
+ * @param int $index Identifier for a specific print area range allowing several ranges to be set
* When the method is "O"verwrite, then a positive integer index will overwrite that indexed
* entry in the print areas list; a negative index value will identify which entry to
- * overwrite working bacward through the print area to the list, with the last entry as -1.
+ * overwrite working backward through the print area to the list, with the last entry as -1.
* Specifying an index value of 0, will overwrite all existing print ranges.
* When the method is "I"nsert, then a positive index will insert after that indexed entry in
* the print areas list, while a negative index will insert before the indexed entry.
* Specifying an index value of 0, will always append the new print range at the end of the
* list.
* Print areas are numbered from 1
- * @param string $method Determines the method used when setting multiple print areas
+ * @param string $method Determines the method used when setting multiple print areas
* Default behaviour, or the "O" method, overwrites existing print area
* The "I" method, inserts the new print area before any specified index, or at the end of the list
- * @return PHPExcel_Worksheet_PageSetup
- * @throws PHPExcel_Exception
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return PageSetup
*/
public function setPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = 0, $method = self::SETPRINTRANGE_OVERWRITE)
{
return $this->setPrintArea(
- PHPExcel_Cell::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell::stringFromColumnIndex($column2) . $row2,
+ Coordinate::stringFromColumnIndex($column1) . $row1 . ':' . Coordinate::stringFromColumnIndex($column2) . $row2,
$index,
$method
);
}
/**
- * Add a new print area to the list of print areas
+ * Add a new print area to the list of print areas.
*
- * @param int $column1 Start Column for the print area
- * @param int $row1 Start Row for the print area
- * @param int $column2 End Column for the print area
- * @param int $row2 End Row for the print area
- * @param int $index Identifier for a specific print area range allowing several ranges to be set
+ * @param int $column1 Start Column for the print area
+ * @param int $row1 Start Row for the print area
+ * @param int $column2 End Column for the print area
+ * @param int $row2 End Row for the print area
+ * @param int $index Identifier for a specific print area range allowing several ranges to be set
* A positive index will insert after that indexed entry in the print areas list, while a
* negative index will insert before the indexed entry.
* Specifying an index value of 0, will always append the new print range at the end of the
* list.
* Print areas are numbered from 1
- * @return PHPExcel_Worksheet_PageSetup
- * @throws PHPExcel_Exception
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return PageSetup
*/
public function addPrintAreaByColumnAndRow($column1, $row1, $column2, $row2, $index = -1)
{
return $this->setPrintArea(
- PHPExcel_Cell::stringFromColumnIndex($column1) . $row1 . ':' . PHPExcel_Cell::stringFromColumnIndex($column2) . $row2,
+ Coordinate::stringFromColumnIndex($column1) . $row1 . ':' . Coordinate::stringFromColumnIndex($column2) . $row2,
$index,
self::SETPRINTRANGE_INSERT
);
}
/**
- * Get first page number
+ * Get first page number.
*
* @return int
*/
@@ -801,21 +811,23 @@ class PHPExcel_Worksheet_PageSetup
}
/**
- * Set first page number
+ * Set first page number.
*
* @param int $value
- * @return PHPExcel_Worksheet_HeaderFooter
+ *
+ * @return PageSetup
*/
- public function setFirstPageNumber($value = null)
+ public function setFirstPageNumber($value)
{
$this->firstPageNumber = $value;
+
return $this;
}
/**
- * Reset first page number
+ * Reset first page number.
*
- * @return PHPExcel_Worksheet_HeaderFooter
+ * @return PageSetup
*/
public function resetFirstPageNumber()
{
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Protection.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Protection.php
new file mode 100644
index 00000000000..1815f45bf07
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Protection.php
@@ -0,0 +1,586 @@
+sheet ||
+ $this->objects ||
+ $this->scenarios ||
+ $this->formatCells ||
+ $this->formatColumns ||
+ $this->formatRows ||
+ $this->insertColumns ||
+ $this->insertRows ||
+ $this->insertHyperlinks ||
+ $this->deleteColumns ||
+ $this->deleteRows ||
+ $this->selectLockedCells ||
+ $this->sort ||
+ $this->autoFilter ||
+ $this->pivotTables ||
+ $this->selectUnlockedCells;
+ }
+
+ /**
+ * Get Sheet.
+ *
+ * @return bool
+ */
+ public function getSheet()
+ {
+ return $this->sheet;
+ }
+
+ /**
+ * Set Sheet.
+ *
+ * @param bool $pValue
+ *
+ * @return Protection
+ */
+ public function setSheet($pValue)
+ {
+ $this->sheet = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Objects.
+ *
+ * @return bool
+ */
+ public function getObjects()
+ {
+ return $this->objects;
+ }
+
+ /**
+ * Set Objects.
+ *
+ * @param bool $pValue
+ *
+ * @return Protection
+ */
+ public function setObjects($pValue)
+ {
+ $this->objects = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Scenarios.
+ *
+ * @return bool
+ */
+ public function getScenarios()
+ {
+ return $this->scenarios;
+ }
+
+ /**
+ * Set Scenarios.
+ *
+ * @param bool $pValue
+ *
+ * @return Protection
+ */
+ public function setScenarios($pValue)
+ {
+ $this->scenarios = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get FormatCells.
+ *
+ * @return bool
+ */
+ public function getFormatCells()
+ {
+ return $this->formatCells;
+ }
+
+ /**
+ * Set FormatCells.
+ *
+ * @param bool $pValue
+ *
+ * @return Protection
+ */
+ public function setFormatCells($pValue)
+ {
+ $this->formatCells = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get FormatColumns.
+ *
+ * @return bool
+ */
+ public function getFormatColumns()
+ {
+ return $this->formatColumns;
+ }
+
+ /**
+ * Set FormatColumns.
+ *
+ * @param bool $pValue
+ *
+ * @return Protection
+ */
+ public function setFormatColumns($pValue)
+ {
+ $this->formatColumns = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get FormatRows.
+ *
+ * @return bool
+ */
+ public function getFormatRows()
+ {
+ return $this->formatRows;
+ }
+
+ /**
+ * Set FormatRows.
+ *
+ * @param bool $pValue
+ *
+ * @return Protection
+ */
+ public function setFormatRows($pValue)
+ {
+ $this->formatRows = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get InsertColumns.
+ *
+ * @return bool
+ */
+ public function getInsertColumns()
+ {
+ return $this->insertColumns;
+ }
+
+ /**
+ * Set InsertColumns.
+ *
+ * @param bool $pValue
+ *
+ * @return Protection
+ */
+ public function setInsertColumns($pValue)
+ {
+ $this->insertColumns = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get InsertRows.
+ *
+ * @return bool
+ */
+ public function getInsertRows()
+ {
+ return $this->insertRows;
+ }
+
+ /**
+ * Set InsertRows.
+ *
+ * @param bool $pValue
+ *
+ * @return Protection
+ */
+ public function setInsertRows($pValue)
+ {
+ $this->insertRows = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get InsertHyperlinks.
+ *
+ * @return bool
+ */
+ public function getInsertHyperlinks()
+ {
+ return $this->insertHyperlinks;
+ }
+
+ /**
+ * Set InsertHyperlinks.
+ *
+ * @param bool $pValue
+ *
+ * @return Protection
+ */
+ public function setInsertHyperlinks($pValue)
+ {
+ $this->insertHyperlinks = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get DeleteColumns.
+ *
+ * @return bool
+ */
+ public function getDeleteColumns()
+ {
+ return $this->deleteColumns;
+ }
+
+ /**
+ * Set DeleteColumns.
+ *
+ * @param bool $pValue
+ *
+ * @return Protection
+ */
+ public function setDeleteColumns($pValue)
+ {
+ $this->deleteColumns = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get DeleteRows.
+ *
+ * @return bool
+ */
+ public function getDeleteRows()
+ {
+ return $this->deleteRows;
+ }
+
+ /**
+ * Set DeleteRows.
+ *
+ * @param bool $pValue
+ *
+ * @return Protection
+ */
+ public function setDeleteRows($pValue)
+ {
+ $this->deleteRows = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get SelectLockedCells.
+ *
+ * @return bool
+ */
+ public function getSelectLockedCells()
+ {
+ return $this->selectLockedCells;
+ }
+
+ /**
+ * Set SelectLockedCells.
+ *
+ * @param bool $pValue
+ *
+ * @return Protection
+ */
+ public function setSelectLockedCells($pValue)
+ {
+ $this->selectLockedCells = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Sort.
+ *
+ * @return bool
+ */
+ public function getSort()
+ {
+ return $this->sort;
+ }
+
+ /**
+ * Set Sort.
+ *
+ * @param bool $pValue
+ *
+ * @return Protection
+ */
+ public function setSort($pValue)
+ {
+ $this->sort = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get AutoFilter.
+ *
+ * @return bool
+ */
+ public function getAutoFilter()
+ {
+ return $this->autoFilter;
+ }
+
+ /**
+ * Set AutoFilter.
+ *
+ * @param bool $pValue
+ *
+ * @return Protection
+ */
+ public function setAutoFilter($pValue)
+ {
+ $this->autoFilter = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get PivotTables.
+ *
+ * @return bool
+ */
+ public function getPivotTables()
+ {
+ return $this->pivotTables;
+ }
+
+ /**
+ * Set PivotTables.
+ *
+ * @param bool $pValue
+ *
+ * @return Protection
+ */
+ public function setPivotTables($pValue)
+ {
+ $this->pivotTables = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get SelectUnlockedCells.
+ *
+ * @return bool
+ */
+ public function getSelectUnlockedCells()
+ {
+ return $this->selectUnlockedCells;
+ }
+
+ /**
+ * Set SelectUnlockedCells.
+ *
+ * @param bool $pValue
+ *
+ * @return Protection
+ */
+ public function setSelectUnlockedCells($pValue)
+ {
+ $this->selectUnlockedCells = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Password (hashed).
+ *
+ * @return string
+ */
+ public function getPassword()
+ {
+ return $this->password;
+ }
+
+ /**
+ * Set Password.
+ *
+ * @param string $pValue
+ * @param bool $pAlreadyHashed If the password has already been hashed, set this to true
+ *
+ * @return Protection
+ */
+ public function setPassword($pValue, $pAlreadyHashed = false)
+ {
+ if (!$pAlreadyHashed) {
+ $pValue = PasswordHasher::hashPassword($pValue);
+ }
+ $this->password = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone()
+ {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Row.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Row.php
new file mode 100644
index 00000000000..2a379d2cd34
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Row.php
@@ -0,0 +1,74 @@
+worksheet = $worksheet;
+ $this->rowIndex = $rowIndex;
+ }
+
+ /**
+ * Destructor.
+ */
+ public function __destruct()
+ {
+ unset($this->worksheet);
+ }
+
+ /**
+ * Get row index.
+ *
+ * @return int
+ */
+ public function getRowIndex()
+ {
+ return $this->rowIndex;
+ }
+
+ /**
+ * Get cell iterator.
+ *
+ * @param string $startColumn The column address at which to start iterating
+ * @param string $endColumn Optionally, the column address at which to stop iterating
+ *
+ * @return RowCellIterator
+ */
+ public function getCellIterator($startColumn = 'A', $endColumn = null)
+ {
+ return new RowCellIterator($this->worksheet, $this->rowIndex, $startColumn, $endColumn);
+ }
+
+ /**
+ * Returns bound worksheet.
+ *
+ * @return Worksheet
+ */
+ public function getWorksheet()
+ {
+ return $this->worksheet;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowCellIterator.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowCellIterator.php
new file mode 100644
index 00000000000..59ef329c8b9
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowCellIterator.php
@@ -0,0 +1,195 @@
+worksheet = $worksheet;
+ $this->rowIndex = $rowIndex;
+ $this->resetEnd($endColumn);
+ $this->resetStart($startColumn);
+ }
+
+ /**
+ * (Re)Set the start column and the current column pointer.
+ *
+ * @param string $startColumn The column address at which to start iterating
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return RowCellIterator
+ */
+ public function resetStart($startColumn = 'A')
+ {
+ $this->startColumnIndex = Coordinate::columnIndexFromString($startColumn);
+ $this->adjustForExistingOnlyRange();
+ $this->seek(Coordinate::stringFromColumnIndex($this->startColumnIndex));
+
+ return $this;
+ }
+
+ /**
+ * (Re)Set the end column.
+ *
+ * @param string $endColumn The column address at which to stop iterating
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return RowCellIterator
+ */
+ public function resetEnd($endColumn = null)
+ {
+ $endColumn = $endColumn ? $endColumn : $this->worksheet->getHighestColumn();
+ $this->endColumnIndex = Coordinate::columnIndexFromString($endColumn);
+ $this->adjustForExistingOnlyRange();
+
+ return $this;
+ }
+
+ /**
+ * Set the column pointer to the selected column.
+ *
+ * @param string $column The column address to set the current pointer at
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return RowCellIterator
+ */
+ public function seek($column = 'A')
+ {
+ $column = Coordinate::columnIndexFromString($column);
+ if (($column < $this->startColumnIndex) || ($column > $this->endColumnIndex)) {
+ throw new PhpSpreadsheetException("Column $column is out of range ({$this->startColumnIndex} - {$this->endColumnIndex})");
+ } elseif ($this->onlyExistingCells && !($this->worksheet->cellExistsByColumnAndRow($column, $this->rowIndex))) {
+ throw new PhpSpreadsheetException('In "IterateOnlyExistingCells" mode and Cell does not exist');
+ }
+ $this->currentColumnIndex = $column;
+
+ return $this;
+ }
+
+ /**
+ * Rewind the iterator to the starting column.
+ */
+ public function rewind()
+ {
+ $this->currentColumnIndex = $this->startColumnIndex;
+ }
+
+ /**
+ * Return the current cell in this worksheet row.
+ *
+ * @return \PhpOffice\PhpSpreadsheet\Cell\Cell
+ */
+ public function current()
+ {
+ return $this->worksheet->getCellByColumnAndRow($this->currentColumnIndex, $this->rowIndex);
+ }
+
+ /**
+ * Return the current iterator key.
+ *
+ * @return string
+ */
+ public function key()
+ {
+ return Coordinate::stringFromColumnIndex($this->currentColumnIndex);
+ }
+
+ /**
+ * Set the iterator to its next value.
+ */
+ public function next()
+ {
+ do {
+ ++$this->currentColumnIndex;
+ } while (($this->onlyExistingCells) && (!$this->worksheet->cellExistsByColumnAndRow($this->currentColumnIndex, $this->rowIndex)) && ($this->currentColumnIndex <= $this->endColumnIndex));
+ }
+
+ /**
+ * Set the iterator to its previous value.
+ *
+ * @throws PhpSpreadsheetException
+ */
+ public function prev()
+ {
+ do {
+ --$this->currentColumnIndex;
+ } while (($this->onlyExistingCells) && (!$this->worksheet->cellExistsByColumnAndRow($this->currentColumnIndex, $this->rowIndex)) && ($this->currentColumnIndex >= $this->startColumnIndex));
+ }
+
+ /**
+ * Indicate if more columns exist in the worksheet range of columns that we're iterating.
+ *
+ * @return bool
+ */
+ public function valid()
+ {
+ return $this->currentColumnIndex <= $this->endColumnIndex && $this->currentColumnIndex >= $this->startColumnIndex;
+ }
+
+ /**
+ * Validate start/end values for "IterateOnlyExistingCells" mode, and adjust if necessary.
+ *
+ * @throws PhpSpreadsheetException
+ */
+ protected function adjustForExistingOnlyRange()
+ {
+ if ($this->onlyExistingCells) {
+ while ((!$this->worksheet->cellExistsByColumnAndRow($this->startColumnIndex, $this->rowIndex)) && ($this->startColumnIndex <= $this->endColumnIndex)) {
+ ++$this->startColumnIndex;
+ }
+ if ($this->startColumnIndex > $this->endColumnIndex) {
+ throw new PhpSpreadsheetException('No cells exist within the specified range');
+ }
+ while ((!$this->worksheet->cellExistsByColumnAndRow($this->endColumnIndex, $this->rowIndex)) && ($this->endColumnIndex >= $this->startColumnIndex)) {
+ --$this->endColumnIndex;
+ }
+ if ($this->endColumnIndex < $this->startColumnIndex) {
+ throw new PhpSpreadsheetException('No cells exist within the specified range');
+ }
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowDimension.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowDimension.php
new file mode 100644
index 00000000000..e4346404d23
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowDimension.php
@@ -0,0 +1,115 @@
+rowIndex = $pIndex;
+
+ // set dimension as unformatted by default
+ parent::__construct(null);
+ }
+
+ /**
+ * Get Row Index.
+ *
+ * @return int
+ */
+ public function getRowIndex()
+ {
+ return $this->rowIndex;
+ }
+
+ /**
+ * Set Row Index.
+ *
+ * @param int $pValue
+ *
+ * @return RowDimension
+ */
+ public function setRowIndex($pValue)
+ {
+ $this->rowIndex = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Row Height.
+ *
+ * @return float
+ */
+ public function getRowHeight()
+ {
+ return $this->height;
+ }
+
+ /**
+ * Set Row Height.
+ *
+ * @param float $pValue
+ *
+ * @return RowDimension
+ */
+ public function setRowHeight($pValue)
+ {
+ $this->height = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get ZeroHeight.
+ *
+ * @return bool
+ */
+ public function getZeroHeight()
+ {
+ return $this->zeroHeight;
+ }
+
+ /**
+ * Set ZeroHeight.
+ *
+ * @param bool $pValue
+ *
+ * @return RowDimension
+ */
+ public function setZeroHeight($pValue)
+ {
+ $this->zeroHeight = $pValue;
+
+ return $this;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowIterator.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowIterator.php
new file mode 100644
index 00000000000..433cea6a12a
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/RowIterator.php
@@ -0,0 +1,170 @@
+subject = $subject;
+ $this->resetEnd($endRow);
+ $this->resetStart($startRow);
+ }
+
+ /**
+ * Destructor.
+ */
+ public function __destruct()
+ {
+ unset($this->subject);
+ }
+
+ /**
+ * (Re)Set the start row and the current row pointer.
+ *
+ * @param int $startRow The row number at which to start iterating
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return RowIterator
+ */
+ public function resetStart($startRow = 1)
+ {
+ if ($startRow > $this->subject->getHighestRow()) {
+ throw new PhpSpreadsheetException("Start row ({$startRow}) is beyond highest row ({$this->subject->getHighestRow()})");
+ }
+
+ $this->startRow = $startRow;
+ if ($this->endRow < $this->startRow) {
+ $this->endRow = $this->startRow;
+ }
+ $this->seek($startRow);
+
+ return $this;
+ }
+
+ /**
+ * (Re)Set the end row.
+ *
+ * @param int $endRow The row number at which to stop iterating
+ *
+ * @return RowIterator
+ */
+ public function resetEnd($endRow = null)
+ {
+ $this->endRow = ($endRow) ? $endRow : $this->subject->getHighestRow();
+
+ return $this;
+ }
+
+ /**
+ * Set the row pointer to the selected row.
+ *
+ * @param int $row The row number to set the current pointer at
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return RowIterator
+ */
+ public function seek($row = 1)
+ {
+ if (($row < $this->startRow) || ($row > $this->endRow)) {
+ throw new PhpSpreadsheetException("Row $row is out of range ({$this->startRow} - {$this->endRow})");
+ }
+ $this->position = $row;
+
+ return $this;
+ }
+
+ /**
+ * Rewind the iterator to the starting row.
+ */
+ public function rewind()
+ {
+ $this->position = $this->startRow;
+ }
+
+ /**
+ * Return the current row in this worksheet.
+ *
+ * @return Row
+ */
+ public function current()
+ {
+ return new Row($this->subject, $this->position);
+ }
+
+ /**
+ * Return the current iterator key.
+ *
+ * @return int
+ */
+ public function key()
+ {
+ return $this->position;
+ }
+
+ /**
+ * Set the iterator to its next value.
+ */
+ public function next()
+ {
+ ++$this->position;
+ }
+
+ /**
+ * Set the iterator to its previous value.
+ */
+ public function prev()
+ {
+ --$this->position;
+ }
+
+ /**
+ * Indicate if more rows exist in the worksheet range of rows that we're iterating.
+ *
+ * @return bool
+ */
+ public function valid()
+ {
+ return $this->position <= $this->endRow && $this->position >= $this->startRow;
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Worksheet/SheetView.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/SheetView.php
similarity index 51%
rename from lib/phpexcel/PHPExcel/Worksheet/SheetView.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/SheetView.php
index 5aaef3ba3f4..172823245e0 100644
--- a/lib/phpexcel/PHPExcel/Worksheet/SheetView.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/SheetView.php
@@ -1,46 +1,24 @@
= 1
- if (($pValue >= 1) || is_null($pValue)) {
+ if (($pValue >= 1) || $pValue === null) {
$this->zoomScale = $pValue;
} else {
- throw new PHPExcel_Exception("Scale must be greater than or equal to 1.");
+ throw new PhpSpreadsheetException('Scale must be greater than or equal to 1.');
}
+
return $this;
}
/**
- * Get ZoomScaleNormal
+ * Get ZoomScaleNormal.
*
* @return int
*/
@@ -115,26 +95,28 @@ class PHPExcel_Worksheet_SheetView
}
/**
- * Set ZoomScale
- *
+ * Set ZoomScale.
* Valid values range from 10 to 400.
*
- * @param int $pValue
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_SheetView
+ * @param int $pValue
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return SheetView
*/
- public function setZoomScaleNormal($pValue = 100)
+ public function setZoomScaleNormal($pValue)
{
- if (($pValue >= 1) || is_null($pValue)) {
+ if (($pValue >= 1) || $pValue === null) {
$this->zoomScaleNormal = $pValue;
} else {
- throw new PHPExcel_Exception("Scale must be greater than or equal to 1.");
+ throw new PhpSpreadsheetException('Scale must be greater than or equal to 1.');
}
+
return $this;
}
/**
- * Get View
+ * Get View.
*
* @return string
*/
@@ -144,18 +126,20 @@ class PHPExcel_Worksheet_SheetView
}
/**
- * Set View
+ * Set View.
*
* Valid values are
* 'normal' self::SHEETVIEW_NORMAL
* 'pageLayout' self::SHEETVIEW_PAGE_LAYOUT
* 'pageBreakPreview' self::SHEETVIEW_PAGE_BREAK_PREVIEW
*
- * @param string $pValue
- * @throws PHPExcel_Exception
- * @return PHPExcel_Worksheet_SheetView
+ * @param string $pValue
+ *
+ * @throws PhpSpreadsheetException
+ *
+ * @return SheetView
*/
- public function setView($pValue = null)
+ public function setView($pValue)
{
// MS Excel 2007 allows setting the view to 'normal', 'pageLayout' or 'pageBreakPreview' via the user interface
if ($pValue === null) {
@@ -164,7 +148,7 @@ class PHPExcel_Worksheet_SheetView
if (in_array($pValue, self::$sheetViewTypes)) {
$this->sheetviewType = $pValue;
} else {
- throw new PHPExcel_Exception("Invalid sheetview layout type.");
+ throw new PhpSpreadsheetException('Invalid sheetview layout type.');
}
return $this;
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php
new file mode 100644
index 00000000000..cf257166d1f
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Worksheet/Worksheet.php
@@ -0,0 +1,3066 @@
+parent = $parent;
+ $this->setTitle($pTitle, false);
+ // setTitle can change $pTitle
+ $this->setCodeName($this->getTitle());
+ $this->setSheetState(self::SHEETSTATE_VISIBLE);
+
+ $this->cellCollection = CellsFactory::getInstance($this);
+ // Set page setup
+ $this->pageSetup = new PageSetup();
+ // Set page margins
+ $this->pageMargins = new PageMargins();
+ // Set page header/footer
+ $this->headerFooter = new HeaderFooter();
+ // Set sheet view
+ $this->sheetView = new SheetView();
+ // Drawing collection
+ $this->drawingCollection = new \ArrayObject();
+ // Chart collection
+ $this->chartCollection = new \ArrayObject();
+ // Protection
+ $this->protection = new Protection();
+ // Default row dimension
+ $this->defaultRowDimension = new RowDimension(null);
+ // Default column dimension
+ $this->defaultColumnDimension = new ColumnDimension(null);
+ $this->autoFilter = new AutoFilter(null, $this);
+ }
+
+ /**
+ * Disconnect all cells from this Worksheet object,
+ * typically so that the worksheet object can be unset.
+ */
+ public function disconnectCells()
+ {
+ if ($this->cellCollection !== null) {
+ $this->cellCollection->unsetWorksheetCells();
+ $this->cellCollection = null;
+ }
+ // detach ourself from the workbook, so that it can then delete this worksheet successfully
+ $this->parent = null;
+ }
+
+ /**
+ * Code to execute when this worksheet is unset().
+ */
+ public function __destruct()
+ {
+ Calculation::getInstance($this->parent)->clearCalculationCacheForWorksheet($this->title);
+
+ $this->disconnectCells();
+ }
+
+ /**
+ * Return the cell collection.
+ *
+ * @return Cells
+ */
+ public function getCellCollection()
+ {
+ return $this->cellCollection;
+ }
+
+ /**
+ * Get array of invalid characters for sheet title.
+ *
+ * @return array
+ */
+ public static function getInvalidCharacters()
+ {
+ return self::$invalidCharacters;
+ }
+
+ /**
+ * Check sheet code name for valid Excel syntax.
+ *
+ * @param string $pValue The string to check
+ *
+ * @throws Exception
+ *
+ * @return string The valid string
+ */
+ private static function checkSheetCodeName($pValue)
+ {
+ $CharCount = Shared\StringHelper::countCharacters($pValue);
+ if ($CharCount == 0) {
+ throw new Exception('Sheet code name cannot be empty.');
+ }
+ // Some of the printable ASCII characters are invalid: * : / \ ? [ ] and first and last characters cannot be a "'"
+ if ((str_replace(self::$invalidCharacters, '', $pValue) !== $pValue) ||
+ (Shared\StringHelper::substring($pValue, -1, 1) == '\'') ||
+ (Shared\StringHelper::substring($pValue, 0, 1) == '\'')) {
+ throw new Exception('Invalid character found in sheet code name');
+ }
+
+ // Enforce maximum characters allowed for sheet title
+ if ($CharCount > self::SHEET_TITLE_MAXIMUM_LENGTH) {
+ throw new Exception('Maximum ' . self::SHEET_TITLE_MAXIMUM_LENGTH . ' characters allowed in sheet code name.');
+ }
+
+ return $pValue;
+ }
+
+ /**
+ * Check sheet title for valid Excel syntax.
+ *
+ * @param string $pValue The string to check
+ *
+ * @throws Exception
+ *
+ * @return string The valid string
+ */
+ private static function checkSheetTitle($pValue)
+ {
+ // Some of the printable ASCII characters are invalid: * : / \ ? [ ]
+ if (str_replace(self::$invalidCharacters, '', $pValue) !== $pValue) {
+ throw new Exception('Invalid character found in sheet title');
+ }
+
+ // Enforce maximum characters allowed for sheet title
+ if (Shared\StringHelper::countCharacters($pValue) > self::SHEET_TITLE_MAXIMUM_LENGTH) {
+ throw new Exception('Maximum ' . self::SHEET_TITLE_MAXIMUM_LENGTH . ' characters allowed in sheet title.');
+ }
+
+ return $pValue;
+ }
+
+ /**
+ * Get a sorted list of all cell coordinates currently held in the collection by row and column.
+ *
+ * @param bool $sorted Also sort the cell collection?
+ *
+ * @return string[]
+ */
+ public function getCoordinates($sorted = true)
+ {
+ if ($this->cellCollection == null) {
+ return [];
+ }
+
+ if ($sorted) {
+ return $this->cellCollection->getSortedCoordinates();
+ }
+
+ return $this->cellCollection->getCoordinates();
+ }
+
+ /**
+ * Get collection of row dimensions.
+ *
+ * @return RowDimension[]
+ */
+ public function getRowDimensions()
+ {
+ return $this->rowDimensions;
+ }
+
+ /**
+ * Get default row dimension.
+ *
+ * @return RowDimension
+ */
+ public function getDefaultRowDimension()
+ {
+ return $this->defaultRowDimension;
+ }
+
+ /**
+ * Get collection of column dimensions.
+ *
+ * @return ColumnDimension[]
+ */
+ public function getColumnDimensions()
+ {
+ return $this->columnDimensions;
+ }
+
+ /**
+ * Get default column dimension.
+ *
+ * @return ColumnDimension
+ */
+ public function getDefaultColumnDimension()
+ {
+ return $this->defaultColumnDimension;
+ }
+
+ /**
+ * Get collection of drawings.
+ *
+ * @return BaseDrawing[]
+ */
+ public function getDrawingCollection()
+ {
+ return $this->drawingCollection;
+ }
+
+ /**
+ * Get collection of charts.
+ *
+ * @return Chart[]
+ */
+ public function getChartCollection()
+ {
+ return $this->chartCollection;
+ }
+
+ /**
+ * Add chart.
+ *
+ * @param Chart $pChart
+ * @param null|int $iChartIndex Index where chart should go (0,1,..., or null for last)
+ *
+ * @return Chart
+ */
+ public function addChart(Chart $pChart, $iChartIndex = null)
+ {
+ $pChart->setWorksheet($this);
+ if ($iChartIndex === null) {
+ $this->chartCollection[] = $pChart;
+ } else {
+ // Insert the chart at the requested index
+ array_splice($this->chartCollection, $iChartIndex, 0, [$pChart]);
+ }
+
+ return $pChart;
+ }
+
+ /**
+ * Return the count of charts on this worksheet.
+ *
+ * @return int The number of charts
+ */
+ public function getChartCount()
+ {
+ return count($this->chartCollection);
+ }
+
+ /**
+ * Get a chart by its index position.
+ *
+ * @param string $index Chart index position
+ *
+ * @return Chart|false
+ */
+ public function getChartByIndex($index)
+ {
+ $chartCount = count($this->chartCollection);
+ if ($chartCount == 0) {
+ return false;
+ }
+ if ($index === null) {
+ $index = --$chartCount;
+ }
+ if (!isset($this->chartCollection[$index])) {
+ return false;
+ }
+
+ return $this->chartCollection[$index];
+ }
+
+ /**
+ * Return an array of the names of charts on this worksheet.
+ *
+ * @return string[] The names of charts
+ */
+ public function getChartNames()
+ {
+ $chartNames = [];
+ foreach ($this->chartCollection as $chart) {
+ $chartNames[] = $chart->getName();
+ }
+
+ return $chartNames;
+ }
+
+ /**
+ * Get a chart by name.
+ *
+ * @param string $chartName Chart name
+ *
+ * @return Chart|false
+ */
+ public function getChartByName($chartName)
+ {
+ $chartCount = count($this->chartCollection);
+ if ($chartCount == 0) {
+ return false;
+ }
+ foreach ($this->chartCollection as $index => $chart) {
+ if ($chart->getName() == $chartName) {
+ return $this->chartCollection[$index];
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Refresh column dimensions.
+ *
+ * @return Worksheet
+ */
+ public function refreshColumnDimensions()
+ {
+ $currentColumnDimensions = $this->getColumnDimensions();
+ $newColumnDimensions = [];
+
+ foreach ($currentColumnDimensions as $objColumnDimension) {
+ $newColumnDimensions[$objColumnDimension->getColumnIndex()] = $objColumnDimension;
+ }
+
+ $this->columnDimensions = $newColumnDimensions;
+
+ return $this;
+ }
+
+ /**
+ * Refresh row dimensions.
+ *
+ * @return Worksheet
+ */
+ public function refreshRowDimensions()
+ {
+ $currentRowDimensions = $this->getRowDimensions();
+ $newRowDimensions = [];
+
+ foreach ($currentRowDimensions as $objRowDimension) {
+ $newRowDimensions[$objRowDimension->getRowIndex()] = $objRowDimension;
+ }
+
+ $this->rowDimensions = $newRowDimensions;
+
+ return $this;
+ }
+
+ /**
+ * Calculate worksheet dimension.
+ *
+ * @return string String containing the dimension of this worksheet
+ */
+ public function calculateWorksheetDimension()
+ {
+ // Return
+ return 'A1' . ':' . $this->getHighestColumn() . $this->getHighestRow();
+ }
+
+ /**
+ * Calculate worksheet data dimension.
+ *
+ * @return string String containing the dimension of this worksheet that actually contain data
+ */
+ public function calculateWorksheetDataDimension()
+ {
+ // Return
+ return 'A1' . ':' . $this->getHighestDataColumn() . $this->getHighestDataRow();
+ }
+
+ /**
+ * Calculate widths for auto-size columns.
+ *
+ * @return Worksheet;
+ */
+ public function calculateColumnWidths()
+ {
+ // initialize $autoSizes array
+ $autoSizes = [];
+ foreach ($this->getColumnDimensions() as $colDimension) {
+ if ($colDimension->getAutoSize()) {
+ $autoSizes[$colDimension->getColumnIndex()] = -1;
+ }
+ }
+
+ // There is only something to do if there are some auto-size columns
+ if (!empty($autoSizes)) {
+ // build list of cells references that participate in a merge
+ $isMergeCell = [];
+ foreach ($this->getMergeCells() as $cells) {
+ foreach (Coordinate::extractAllCellReferencesInRange($cells) as $cellReference) {
+ $isMergeCell[$cellReference] = true;
+ }
+ }
+
+ // loop through all cells in the worksheet
+ foreach ($this->getCoordinates(false) as $coordinate) {
+ $cell = $this->getCell($coordinate, false);
+ if ($cell !== null && isset($autoSizes[$this->cellCollection->getCurrentColumn()])) {
+ //Determine if cell is in merge range
+ $isMerged = isset($isMergeCell[$this->cellCollection->getCurrentCoordinate()]);
+
+ //By default merged cells should be ignored
+ $isMergedButProceed = false;
+
+ //The only exception is if it's a merge range value cell of a 'vertical' randge (1 column wide)
+ if ($isMerged && $cell->isMergeRangeValueCell()) {
+ $range = $cell->getMergeRange();
+ $rangeBoundaries = Coordinate::rangeDimension($range);
+ if ($rangeBoundaries[0] == 1) {
+ $isMergedButProceed = true;
+ }
+ }
+
+ // Determine width if cell does not participate in a merge or does and is a value cell of 1-column wide range
+ if (!$isMerged || $isMergedButProceed) {
+ // Calculated value
+ // To formatted string
+ $cellValue = NumberFormat::toFormattedString(
+ $cell->getCalculatedValue(),
+ $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode()
+ );
+
+ $autoSizes[$this->cellCollection->getCurrentColumn()] = max(
+ (float) $autoSizes[$this->cellCollection->getCurrentColumn()],
+ (float) Shared\Font::calculateColumnWidth(
+ $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont(),
+ $cellValue,
+ $this->getParent()->getCellXfByIndex($cell->getXfIndex())->getAlignment()->getTextRotation(),
+ $this->getParent()->getDefaultStyle()->getFont()
+ )
+ );
+ }
+ }
+ }
+
+ // adjust column widths
+ foreach ($autoSizes as $columnIndex => $width) {
+ if ($width == -1) {
+ $width = $this->getDefaultColumnDimension()->getWidth();
+ }
+ $this->getColumnDimension($columnIndex)->setWidth($width);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get parent.
+ *
+ * @return Spreadsheet
+ */
+ public function getParent()
+ {
+ return $this->parent;
+ }
+
+ /**
+ * Re-bind parent.
+ *
+ * @param Spreadsheet $parent
+ *
+ * @return Worksheet
+ */
+ public function rebindParent(Spreadsheet $parent)
+ {
+ if ($this->parent !== null) {
+ $namedRanges = $this->parent->getNamedRanges();
+ foreach ($namedRanges as $namedRange) {
+ $parent->addNamedRange($namedRange);
+ }
+
+ $this->parent->removeSheetByIndex(
+ $this->parent->getIndex($this)
+ );
+ }
+ $this->parent = $parent;
+
+ return $this;
+ }
+
+ /**
+ * Get title.
+ *
+ * @return string
+ */
+ public function getTitle()
+ {
+ return $this->title;
+ }
+
+ /**
+ * Set title.
+ *
+ * @param string $pValue String containing the dimension of this worksheet
+ * @param bool $updateFormulaCellReferences Flag indicating whether cell references in formulae should
+ * be updated to reflect the new sheet name.
+ * This should be left as the default true, unless you are
+ * certain that no formula cells on any worksheet contain
+ * references to this worksheet
+ * @param bool $validate False to skip validation of new title. WARNING: This should only be set
+ * at parse time (by Readers), where titles can be assumed to be valid.
+ *
+ * @return Worksheet
+ */
+ public function setTitle($pValue, $updateFormulaCellReferences = true, $validate = true)
+ {
+ // Is this a 'rename' or not?
+ if ($this->getTitle() == $pValue) {
+ return $this;
+ }
+
+ // Old title
+ $oldTitle = $this->getTitle();
+
+ if ($validate) {
+ // Syntax check
+ self::checkSheetTitle($pValue);
+
+ if ($this->parent) {
+ // Is there already such sheet name?
+ if ($this->parent->sheetNameExists($pValue)) {
+ // Use name, but append with lowest possible integer
+
+ if (Shared\StringHelper::countCharacters($pValue) > 29) {
+ $pValue = Shared\StringHelper::substring($pValue, 0, 29);
+ }
+ $i = 1;
+ while ($this->parent->sheetNameExists($pValue . ' ' . $i)) {
+ ++$i;
+ if ($i == 10) {
+ if (Shared\StringHelper::countCharacters($pValue) > 28) {
+ $pValue = Shared\StringHelper::substring($pValue, 0, 28);
+ }
+ } elseif ($i == 100) {
+ if (Shared\StringHelper::countCharacters($pValue) > 27) {
+ $pValue = Shared\StringHelper::substring($pValue, 0, 27);
+ }
+ }
+ }
+
+ $pValue .= " $i";
+ }
+ }
+ }
+
+ // Set title
+ $this->title = $pValue;
+ $this->dirty = true;
+
+ if ($this->parent && $this->parent->getCalculationEngine()) {
+ // New title
+ $newTitle = $this->getTitle();
+ $this->parent->getCalculationEngine()
+ ->renameCalculationCacheForWorksheet($oldTitle, $newTitle);
+ if ($updateFormulaCellReferences) {
+ ReferenceHelper::getInstance()->updateNamedFormulas($this->parent, $oldTitle, $newTitle);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get sheet state.
+ *
+ * @return string Sheet state (visible, hidden, veryHidden)
+ */
+ public function getSheetState()
+ {
+ return $this->sheetState;
+ }
+
+ /**
+ * Set sheet state.
+ *
+ * @param string $value Sheet state (visible, hidden, veryHidden)
+ *
+ * @return Worksheet
+ */
+ public function setSheetState($value)
+ {
+ $this->sheetState = $value;
+
+ return $this;
+ }
+
+ /**
+ * Get page setup.
+ *
+ * @return PageSetup
+ */
+ public function getPageSetup()
+ {
+ return $this->pageSetup;
+ }
+
+ /**
+ * Set page setup.
+ *
+ * @param PageSetup $pValue
+ *
+ * @return Worksheet
+ */
+ public function setPageSetup(PageSetup $pValue)
+ {
+ $this->pageSetup = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get page margins.
+ *
+ * @return PageMargins
+ */
+ public function getPageMargins()
+ {
+ return $this->pageMargins;
+ }
+
+ /**
+ * Set page margins.
+ *
+ * @param PageMargins $pValue
+ *
+ * @return Worksheet
+ */
+ public function setPageMargins(PageMargins $pValue)
+ {
+ $this->pageMargins = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get page header/footer.
+ *
+ * @return HeaderFooter
+ */
+ public function getHeaderFooter()
+ {
+ return $this->headerFooter;
+ }
+
+ /**
+ * Set page header/footer.
+ *
+ * @param HeaderFooter $pValue
+ *
+ * @return Worksheet
+ */
+ public function setHeaderFooter(HeaderFooter $pValue)
+ {
+ $this->headerFooter = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get sheet view.
+ *
+ * @return SheetView
+ */
+ public function getSheetView()
+ {
+ return $this->sheetView;
+ }
+
+ /**
+ * Set sheet view.
+ *
+ * @param SheetView $pValue
+ *
+ * @return Worksheet
+ */
+ public function setSheetView(SheetView $pValue)
+ {
+ $this->sheetView = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Protection.
+ *
+ * @return Protection
+ */
+ public function getProtection()
+ {
+ return $this->protection;
+ }
+
+ /**
+ * Set Protection.
+ *
+ * @param Protection $pValue
+ *
+ * @return Worksheet
+ */
+ public function setProtection(Protection $pValue)
+ {
+ $this->protection = $pValue;
+ $this->dirty = true;
+
+ return $this;
+ }
+
+ /**
+ * Get highest worksheet column.
+ *
+ * @param string $row Return the data highest column for the specified row,
+ * or the highest column of any row if no row number is passed
+ *
+ * @return string Highest column name
+ */
+ public function getHighestColumn($row = null)
+ {
+ if ($row == null) {
+ return $this->cachedHighestColumn;
+ }
+
+ return $this->getHighestDataColumn($row);
+ }
+
+ /**
+ * Get highest worksheet column that contains data.
+ *
+ * @param string $row Return the highest data column for the specified row,
+ * or the highest data column of any row if no row number is passed
+ *
+ * @return string Highest column name that contains data
+ */
+ public function getHighestDataColumn($row = null)
+ {
+ return $this->cellCollection->getHighestColumn($row);
+ }
+
+ /**
+ * Get highest worksheet row.
+ *
+ * @param string $column Return the highest data row for the specified column,
+ * or the highest row of any column if no column letter is passed
+ *
+ * @return int Highest row number
+ */
+ public function getHighestRow($column = null)
+ {
+ if ($column == null) {
+ return $this->cachedHighestRow;
+ }
+
+ return $this->getHighestDataRow($column);
+ }
+
+ /**
+ * Get highest worksheet row that contains data.
+ *
+ * @param string $column Return the highest data row for the specified column,
+ * or the highest data row of any column if no column letter is passed
+ *
+ * @return int Highest row number that contains data
+ */
+ public function getHighestDataRow($column = null)
+ {
+ return $this->cellCollection->getHighestRow($column);
+ }
+
+ /**
+ * Get highest worksheet column and highest row that have cell records.
+ *
+ * @return array Highest column name and highest row number
+ */
+ public function getHighestRowAndColumn()
+ {
+ return $this->cellCollection->getHighestRowAndColumn();
+ }
+
+ /**
+ * Set a cell value.
+ *
+ * @param string $pCoordinate Coordinate of the cell, eg: 'A1'
+ * @param mixed $pValue Value of the cell
+ *
+ * @return Worksheet
+ */
+ public function setCellValue($pCoordinate, $pValue)
+ {
+ $this->getCell($pCoordinate)->setValue($pValue);
+
+ return $this;
+ }
+
+ /**
+ * Set a cell value by using numeric cell coordinates.
+ *
+ * @param int $columnIndex Numeric column coordinate of the cell
+ * @param int $row Numeric row coordinate of the cell
+ * @param mixed $value Value of the cell
+ *
+ * @return Worksheet
+ */
+ public function setCellValueByColumnAndRow($columnIndex, $row, $value)
+ {
+ $this->getCellByColumnAndRow($columnIndex, $row)->setValue($value);
+
+ return $this;
+ }
+
+ /**
+ * Set a cell value.
+ *
+ * @param string $pCoordinate Coordinate of the cell, eg: 'A1'
+ * @param mixed $pValue Value of the cell
+ * @param string $pDataType Explicit data type, see DataType::TYPE_*
+ *
+ * @return Worksheet
+ */
+ public function setCellValueExplicit($pCoordinate, $pValue, $pDataType)
+ {
+ // Set value
+ $this->getCell($pCoordinate)->setValueExplicit($pValue, $pDataType);
+
+ return $this;
+ }
+
+ /**
+ * Set a cell value by using numeric cell coordinates.
+ *
+ * @param int $columnIndex Numeric column coordinate of the cell
+ * @param int $row Numeric row coordinate of the cell
+ * @param mixed $value Value of the cell
+ * @param string $dataType Explicit data type, see DataType::TYPE_*
+ *
+ * @return Worksheet
+ */
+ public function setCellValueExplicitByColumnAndRow($columnIndex, $row, $value, $dataType)
+ {
+ $this->getCellByColumnAndRow($columnIndex, $row)->setValueExplicit($value, $dataType);
+
+ return $this;
+ }
+
+ /**
+ * Get cell at a specific coordinate.
+ *
+ * @param string $pCoordinate Coordinate of the cell, eg: 'A1'
+ * @param bool $createIfNotExists Flag indicating whether a new cell should be created if it doesn't
+ * already exist, or a null should be returned instead
+ *
+ * @throws Exception
+ *
+ * @return null|Cell Cell that was found/created or null
+ */
+ public function getCell($pCoordinate, $createIfNotExists = true)
+ {
+ // Uppercase coordinate
+ $pCoordinateUpper = strtoupper($pCoordinate);
+
+ // Check cell collection
+ if ($this->cellCollection->has($pCoordinateUpper)) {
+ return $this->cellCollection->get($pCoordinateUpper);
+ }
+
+ // Worksheet reference?
+ if (strpos($pCoordinate, '!') !== false) {
+ $worksheetReference = self::extractSheetTitle($pCoordinate, true);
+
+ return $this->parent->getSheetByName($worksheetReference[0])->getCell(strtoupper($worksheetReference[1]), $createIfNotExists);
+ }
+
+ // Named range?
+ if ((!preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $pCoordinate, $matches)) &&
+ (preg_match('/^' . Calculation::CALCULATION_REGEXP_NAMEDRANGE . '$/i', $pCoordinate, $matches))) {
+ $namedRange = NamedRange::resolveRange($pCoordinate, $this);
+ if ($namedRange !== null) {
+ $pCoordinate = $namedRange->getRange();
+
+ return $namedRange->getWorksheet()->getCell($pCoordinate, $createIfNotExists);
+ }
+ }
+
+ if (Coordinate::coordinateIsRange($pCoordinate)) {
+ throw new Exception('Cell coordinate can not be a range of cells.');
+ } elseif (strpos($pCoordinate, '$') !== false) {
+ throw new Exception('Cell coordinate must not be absolute.');
+ }
+
+ // Create new cell object, if required
+ return $createIfNotExists ? $this->createNewCell($pCoordinateUpper) : null;
+ }
+
+ /**
+ * Get cell at a specific coordinate by using numeric cell coordinates.
+ *
+ * @param int $columnIndex Numeric column coordinate of the cell
+ * @param int $row Numeric row coordinate of the cell
+ * @param bool $createIfNotExists Flag indicating whether a new cell should be created if it doesn't
+ * already exist, or a null should be returned instead
+ *
+ * @return null|Cell Cell that was found/created or null
+ */
+ public function getCellByColumnAndRow($columnIndex, $row, $createIfNotExists = true)
+ {
+ $columnLetter = Coordinate::stringFromColumnIndex($columnIndex);
+ $coordinate = $columnLetter . $row;
+
+ if ($this->cellCollection->has($coordinate)) {
+ return $this->cellCollection->get($coordinate);
+ }
+
+ // Create new cell object, if required
+ return $createIfNotExists ? $this->createNewCell($coordinate) : null;
+ }
+
+ /**
+ * Create a new cell at the specified coordinate.
+ *
+ * @param string $pCoordinate Coordinate of the cell
+ *
+ * @return Cell Cell that was created
+ */
+ private function createNewCell($pCoordinate)
+ {
+ $cell = new Cell(null, DataType::TYPE_NULL, $this);
+ $this->cellCollection->add($pCoordinate, $cell);
+ $this->cellCollectionIsSorted = false;
+
+ // Coordinates
+ $aCoordinates = Coordinate::coordinateFromString($pCoordinate);
+ if (Coordinate::columnIndexFromString($this->cachedHighestColumn) < Coordinate::columnIndexFromString($aCoordinates[0])) {
+ $this->cachedHighestColumn = $aCoordinates[0];
+ }
+ if ($aCoordinates[1] > $this->cachedHighestRow) {
+ $this->cachedHighestRow = $aCoordinates[1];
+ }
+
+ // Cell needs appropriate xfIndex from dimensions records
+ // but don't create dimension records if they don't already exist
+ $rowDimension = $this->getRowDimension($aCoordinates[1], false);
+ $columnDimension = $this->getColumnDimension($aCoordinates[0], false);
+
+ if ($rowDimension !== null && $rowDimension->getXfIndex() > 0) {
+ // then there is a row dimension with explicit style, assign it to the cell
+ $cell->setXfIndex($rowDimension->getXfIndex());
+ } elseif ($columnDimension !== null && $columnDimension->getXfIndex() > 0) {
+ // then there is a column dimension, assign it to the cell
+ $cell->setXfIndex($columnDimension->getXfIndex());
+ }
+
+ return $cell;
+ }
+
+ /**
+ * Does the cell at a specific coordinate exist?
+ *
+ * @param string $pCoordinate Coordinate of the cell eg: 'A1'
+ *
+ * @throws Exception
+ *
+ * @return bool
+ */
+ public function cellExists($pCoordinate)
+ {
+ // Worksheet reference?
+ if (strpos($pCoordinate, '!') !== false) {
+ $worksheetReference = self::extractSheetTitle($pCoordinate, true);
+
+ return $this->parent->getSheetByName($worksheetReference[0])->cellExists(strtoupper($worksheetReference[1]));
+ }
+
+ // Named range?
+ if ((!preg_match('/^' . Calculation::CALCULATION_REGEXP_CELLREF . '$/i', $pCoordinate, $matches)) &&
+ (preg_match('/^' . Calculation::CALCULATION_REGEXP_NAMEDRANGE . '$/i', $pCoordinate, $matches))) {
+ $namedRange = NamedRange::resolveRange($pCoordinate, $this);
+ if ($namedRange !== null) {
+ $pCoordinate = $namedRange->getRange();
+ if ($this->getHashCode() != $namedRange->getWorksheet()->getHashCode()) {
+ if (!$namedRange->getLocalOnly()) {
+ return $namedRange->getWorksheet()->cellExists($pCoordinate);
+ }
+
+ throw new Exception('Named range ' . $namedRange->getName() . ' is not accessible from within sheet ' . $this->getTitle());
+ }
+ } else {
+ return false;
+ }
+ }
+
+ // Uppercase coordinate
+ $pCoordinate = strtoupper($pCoordinate);
+
+ if (Coordinate::coordinateIsRange($pCoordinate)) {
+ throw new Exception('Cell coordinate can not be a range of cells.');
+ } elseif (strpos($pCoordinate, '$') !== false) {
+ throw new Exception('Cell coordinate must not be absolute.');
+ }
+
+ // Cell exists?
+ return $this->cellCollection->has($pCoordinate);
+ }
+
+ /**
+ * Cell at a specific coordinate by using numeric cell coordinates exists?
+ *
+ * @param int $columnIndex Numeric column coordinate of the cell
+ * @param int $row Numeric row coordinate of the cell
+ *
+ * @return bool
+ */
+ public function cellExistsByColumnAndRow($columnIndex, $row)
+ {
+ return $this->cellExists(Coordinate::stringFromColumnIndex($columnIndex) . $row);
+ }
+
+ /**
+ * Get row dimension at a specific row.
+ *
+ * @param int $pRow Numeric index of the row
+ * @param bool $create
+ *
+ * @return RowDimension
+ */
+ public function getRowDimension($pRow, $create = true)
+ {
+ // Found
+ $found = null;
+
+ // Get row dimension
+ if (!isset($this->rowDimensions[$pRow])) {
+ if (!$create) {
+ return null;
+ }
+ $this->rowDimensions[$pRow] = new RowDimension($pRow);
+
+ $this->cachedHighestRow = max($this->cachedHighestRow, $pRow);
+ }
+
+ return $this->rowDimensions[$pRow];
+ }
+
+ /**
+ * Get column dimension at a specific column.
+ *
+ * @param string $pColumn String index of the column eg: 'A'
+ * @param bool $create
+ *
+ * @return ColumnDimension
+ */
+ public function getColumnDimension($pColumn, $create = true)
+ {
+ // Uppercase coordinate
+ $pColumn = strtoupper($pColumn);
+
+ // Fetch dimensions
+ if (!isset($this->columnDimensions[$pColumn])) {
+ if (!$create) {
+ return null;
+ }
+ $this->columnDimensions[$pColumn] = new ColumnDimension($pColumn);
+
+ if (Coordinate::columnIndexFromString($this->cachedHighestColumn) < Coordinate::columnIndexFromString($pColumn)) {
+ $this->cachedHighestColumn = $pColumn;
+ }
+ }
+
+ return $this->columnDimensions[$pColumn];
+ }
+
+ /**
+ * Get column dimension at a specific column by using numeric cell coordinates.
+ *
+ * @param int $columnIndex Numeric column coordinate of the cell
+ *
+ * @return ColumnDimension
+ */
+ public function getColumnDimensionByColumn($columnIndex)
+ {
+ return $this->getColumnDimension(Coordinate::stringFromColumnIndex($columnIndex));
+ }
+
+ /**
+ * Get styles.
+ *
+ * @return Style[]
+ */
+ public function getStyles()
+ {
+ return $this->styles;
+ }
+
+ /**
+ * Get style for cell.
+ *
+ * @param string $pCellCoordinate Cell coordinate (or range) to get style for, eg: 'A1'
+ *
+ * @throws Exception
+ *
+ * @return Style
+ */
+ public function getStyle($pCellCoordinate)
+ {
+ // set this sheet as active
+ $this->parent->setActiveSheetIndex($this->parent->getIndex($this));
+
+ // set cell coordinate as active
+ $this->setSelectedCells(strtoupper($pCellCoordinate));
+
+ return $this->parent->getCellXfSupervisor();
+ }
+
+ /**
+ * Get conditional styles for a cell.
+ *
+ * @param string $pCoordinate eg: 'A1'
+ *
+ * @return Conditional[]
+ */
+ public function getConditionalStyles($pCoordinate)
+ {
+ $pCoordinate = strtoupper($pCoordinate);
+ if (!isset($this->conditionalStylesCollection[$pCoordinate])) {
+ $this->conditionalStylesCollection[$pCoordinate] = [];
+ }
+
+ return $this->conditionalStylesCollection[$pCoordinate];
+ }
+
+ /**
+ * Do conditional styles exist for this cell?
+ *
+ * @param string $pCoordinate eg: 'A1'
+ *
+ * @return bool
+ */
+ public function conditionalStylesExists($pCoordinate)
+ {
+ return isset($this->conditionalStylesCollection[strtoupper($pCoordinate)]);
+ }
+
+ /**
+ * Removes conditional styles for a cell.
+ *
+ * @param string $pCoordinate eg: 'A1'
+ *
+ * @return Worksheet
+ */
+ public function removeConditionalStyles($pCoordinate)
+ {
+ unset($this->conditionalStylesCollection[strtoupper($pCoordinate)]);
+
+ return $this;
+ }
+
+ /**
+ * Get collection of conditional styles.
+ *
+ * @return array
+ */
+ public function getConditionalStylesCollection()
+ {
+ return $this->conditionalStylesCollection;
+ }
+
+ /**
+ * Set conditional styles.
+ *
+ * @param string $pCoordinate eg: 'A1'
+ * @param $pValue Conditional[]
+ *
+ * @return Worksheet
+ */
+ public function setConditionalStyles($pCoordinate, $pValue)
+ {
+ $this->conditionalStylesCollection[strtoupper($pCoordinate)] = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get style for cell by using numeric cell coordinates.
+ *
+ * @param int $columnIndex1 Numeric column coordinate of the cell
+ * @param int $row1 Numeric row coordinate of the cell
+ * @param null|int $columnIndex2 Numeric column coordinate of the range cell
+ * @param null|int $row2 Numeric row coordinate of the range cell
+ *
+ * @return Style
+ */
+ public function getStyleByColumnAndRow($columnIndex1, $row1, $columnIndex2 = null, $row2 = null)
+ {
+ if ($columnIndex2 !== null && $row2 !== null) {
+ $cellRange = Coordinate::stringFromColumnIndex($columnIndex1) . $row1 . ':' . Coordinate::stringFromColumnIndex($columnIndex2) . $row2;
+
+ return $this->getStyle($cellRange);
+ }
+
+ return $this->getStyle(Coordinate::stringFromColumnIndex($columnIndex1) . $row1);
+ }
+
+ /**
+ * Duplicate cell style to a range of cells.
+ *
+ * Please note that this will overwrite existing cell styles for cells in range!
+ *
+ * @param Style $pCellStyle Cell style to duplicate
+ * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function duplicateStyle(Style $pCellStyle, $pRange)
+ {
+ // Add the style to the workbook if necessary
+ $workbook = $this->parent;
+ if ($existingStyle = $this->parent->getCellXfByHashCode($pCellStyle->getHashCode())) {
+ // there is already such cell Xf in our collection
+ $xfIndex = $existingStyle->getIndex();
+ } else {
+ // we don't have such a cell Xf, need to add
+ $workbook->addCellXf($pCellStyle);
+ $xfIndex = $pCellStyle->getIndex();
+ }
+
+ // Calculate range outer borders
+ list($rangeStart, $rangeEnd) = Coordinate::rangeBoundaries($pRange . ':' . $pRange);
+
+ // Make sure we can loop upwards on rows and columns
+ if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
+ $tmp = $rangeStart;
+ $rangeStart = $rangeEnd;
+ $rangeEnd = $tmp;
+ }
+
+ // Loop through cells and apply styles
+ for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
+ for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
+ $this->getCell(Coordinate::stringFromColumnIndex($col) . $row)->setXfIndex($xfIndex);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Duplicate conditional style to a range of cells.
+ *
+ * Please note that this will overwrite existing cell styles for cells in range!
+ *
+ * @param Conditional[] $pCellStyle Cell style to duplicate
+ * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function duplicateConditionalStyle(array $pCellStyle, $pRange = '')
+ {
+ foreach ($pCellStyle as $cellStyle) {
+ if (!($cellStyle instanceof Conditional)) {
+ throw new Exception('Style is not a conditional style');
+ }
+ }
+
+ // Calculate range outer borders
+ list($rangeStart, $rangeEnd) = Coordinate::rangeBoundaries($pRange . ':' . $pRange);
+
+ // Make sure we can loop upwards on rows and columns
+ if ($rangeStart[0] > $rangeEnd[0] && $rangeStart[1] > $rangeEnd[1]) {
+ $tmp = $rangeStart;
+ $rangeStart = $rangeEnd;
+ $rangeEnd = $tmp;
+ }
+
+ // Loop through cells and apply styles
+ for ($col = $rangeStart[0]; $col <= $rangeEnd[0]; ++$col) {
+ for ($row = $rangeStart[1]; $row <= $rangeEnd[1]; ++$row) {
+ $this->setConditionalStyles(Coordinate::stringFromColumnIndex($col) . $row, $pCellStyle);
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set break on a cell.
+ *
+ * @param string $pCoordinate Cell coordinate (e.g. A1)
+ * @param int $pBreak Break type (type of Worksheet::BREAK_*)
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function setBreak($pCoordinate, $pBreak)
+ {
+ // Uppercase coordinate
+ $pCoordinate = strtoupper($pCoordinate);
+
+ if ($pCoordinate != '') {
+ if ($pBreak == self::BREAK_NONE) {
+ if (isset($this->breaks[$pCoordinate])) {
+ unset($this->breaks[$pCoordinate]);
+ }
+ } else {
+ $this->breaks[$pCoordinate] = $pBreak;
+ }
+ } else {
+ throw new Exception('No cell coordinate specified.');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set break on a cell by using numeric cell coordinates.
+ *
+ * @param int $columnIndex Numeric column coordinate of the cell
+ * @param int $row Numeric row coordinate of the cell
+ * @param int $break Break type (type of Worksheet::BREAK_*)
+ *
+ * @return Worksheet
+ */
+ public function setBreakByColumnAndRow($columnIndex, $row, $break)
+ {
+ return $this->setBreak(Coordinate::stringFromColumnIndex($columnIndex) . $row, $break);
+ }
+
+ /**
+ * Get breaks.
+ *
+ * @return array[]
+ */
+ public function getBreaks()
+ {
+ return $this->breaks;
+ }
+
+ /**
+ * Set merge on a cell range.
+ *
+ * @param string $pRange Cell range (e.g. A1:E1)
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function mergeCells($pRange)
+ {
+ // Uppercase coordinate
+ $pRange = strtoupper($pRange);
+
+ if (strpos($pRange, ':') !== false) {
+ $this->mergeCells[$pRange] = $pRange;
+
+ // make sure cells are created
+
+ // get the cells in the range
+ $aReferences = Coordinate::extractAllCellReferencesInRange($pRange);
+
+ // create upper left cell if it does not already exist
+ $upperLeft = $aReferences[0];
+ if (!$this->cellExists($upperLeft)) {
+ $this->getCell($upperLeft)->setValueExplicit(null, DataType::TYPE_NULL);
+ }
+
+ // Blank out the rest of the cells in the range (if they exist)
+ $count = count($aReferences);
+ for ($i = 1; $i < $count; ++$i) {
+ if ($this->cellExists($aReferences[$i])) {
+ $this->getCell($aReferences[$i])->setValueExplicit(null, DataType::TYPE_NULL);
+ }
+ }
+ } else {
+ throw new Exception('Merge must be set on a range of cells.');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set merge on a cell range by using numeric cell coordinates.
+ *
+ * @param int $columnIndex1 Numeric column coordinate of the first cell
+ * @param int $row1 Numeric row coordinate of the first cell
+ * @param int $columnIndex2 Numeric column coordinate of the last cell
+ * @param int $row2 Numeric row coordinate of the last cell
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function mergeCellsByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2)
+ {
+ $cellRange = Coordinate::stringFromColumnIndex($columnIndex1) . $row1 . ':' . Coordinate::stringFromColumnIndex($columnIndex2) . $row2;
+
+ return $this->mergeCells($cellRange);
+ }
+
+ /**
+ * Remove merge on a cell range.
+ *
+ * @param string $pRange Cell range (e.g. A1:E1)
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function unmergeCells($pRange)
+ {
+ // Uppercase coordinate
+ $pRange = strtoupper($pRange);
+
+ if (strpos($pRange, ':') !== false) {
+ if (isset($this->mergeCells[$pRange])) {
+ unset($this->mergeCells[$pRange]);
+ } else {
+ throw new Exception('Cell range ' . $pRange . ' not known as merged.');
+ }
+ } else {
+ throw new Exception('Merge can only be removed from a range of cells.');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Remove merge on a cell range by using numeric cell coordinates.
+ *
+ * @param int $columnIndex1 Numeric column coordinate of the first cell
+ * @param int $row1 Numeric row coordinate of the first cell
+ * @param int $columnIndex2 Numeric column coordinate of the last cell
+ * @param int $row2 Numeric row coordinate of the last cell
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function unmergeCellsByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2)
+ {
+ $cellRange = Coordinate::stringFromColumnIndex($columnIndex1) . $row1 . ':' . Coordinate::stringFromColumnIndex($columnIndex2) . $row2;
+
+ return $this->unmergeCells($cellRange);
+ }
+
+ /**
+ * Get merge cells array.
+ *
+ * @return array[]
+ */
+ public function getMergeCells()
+ {
+ return $this->mergeCells;
+ }
+
+ /**
+ * Set merge cells array for the entire sheet. Use instead mergeCells() to merge
+ * a single cell range.
+ *
+ * @param array $pValue
+ *
+ * @return Worksheet
+ */
+ public function setMergeCells(array $pValue)
+ {
+ $this->mergeCells = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Set protection on a cell range.
+ *
+ * @param string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1)
+ * @param string $pPassword Password to unlock the protection
+ * @param bool $pAlreadyHashed If the password has already been hashed, set this to true
+ *
+ * @return Worksheet
+ */
+ public function protectCells($pRange, $pPassword, $pAlreadyHashed = false)
+ {
+ // Uppercase coordinate
+ $pRange = strtoupper($pRange);
+
+ if (!$pAlreadyHashed) {
+ $pPassword = Shared\PasswordHasher::hashPassword($pPassword);
+ }
+ $this->protectedCells[$pRange] = $pPassword;
+
+ return $this;
+ }
+
+ /**
+ * Set protection on a cell range by using numeric cell coordinates.
+ *
+ * @param int $columnIndex1 Numeric column coordinate of the first cell
+ * @param int $row1 Numeric row coordinate of the first cell
+ * @param int $columnIndex2 Numeric column coordinate of the last cell
+ * @param int $row2 Numeric row coordinate of the last cell
+ * @param string $password Password to unlock the protection
+ * @param bool $alreadyHashed If the password has already been hashed, set this to true
+ *
+ * @return Worksheet
+ */
+ public function protectCellsByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2, $password, $alreadyHashed = false)
+ {
+ $cellRange = Coordinate::stringFromColumnIndex($columnIndex1) . $row1 . ':' . Coordinate::stringFromColumnIndex($columnIndex2) . $row2;
+
+ return $this->protectCells($cellRange, $password, $alreadyHashed);
+ }
+
+ /**
+ * Remove protection on a cell range.
+ *
+ * @param string $pRange Cell (e.g. A1) or cell range (e.g. A1:E1)
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function unprotectCells($pRange)
+ {
+ // Uppercase coordinate
+ $pRange = strtoupper($pRange);
+
+ if (isset($this->protectedCells[$pRange])) {
+ unset($this->protectedCells[$pRange]);
+ } else {
+ throw new Exception('Cell range ' . $pRange . ' not known as protected.');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Remove protection on a cell range by using numeric cell coordinates.
+ *
+ * @param int $columnIndex1 Numeric column coordinate of the first cell
+ * @param int $row1 Numeric row coordinate of the first cell
+ * @param int $columnIndex2 Numeric column coordinate of the last cell
+ * @param int $row2 Numeric row coordinate of the last cell
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function unprotectCellsByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2)
+ {
+ $cellRange = Coordinate::stringFromColumnIndex($columnIndex1) . $row1 . ':' . Coordinate::stringFromColumnIndex($columnIndex2) . $row2;
+
+ return $this->unprotectCells($cellRange);
+ }
+
+ /**
+ * Get protected cells.
+ *
+ * @return array[]
+ */
+ public function getProtectedCells()
+ {
+ return $this->protectedCells;
+ }
+
+ /**
+ * Get Autofilter.
+ *
+ * @return AutoFilter
+ */
+ public function getAutoFilter()
+ {
+ return $this->autoFilter;
+ }
+
+ /**
+ * Set AutoFilter.
+ *
+ * @param AutoFilter|string $pValue
+ * A simple string containing a Cell range like 'A1:E10' is permitted for backward compatibility
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function setAutoFilter($pValue)
+ {
+ if (is_string($pValue)) {
+ $this->autoFilter->setRange($pValue);
+ } elseif (is_object($pValue) && ($pValue instanceof AutoFilter)) {
+ $this->autoFilter = $pValue;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Set Autofilter Range by using numeric cell coordinates.
+ *
+ * @param int $columnIndex1 Numeric column coordinate of the first cell
+ * @param int $row1 Numeric row coordinate of the first cell
+ * @param int $columnIndex2 Numeric column coordinate of the second cell
+ * @param int $row2 Numeric row coordinate of the second cell
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function setAutoFilterByColumnAndRow($columnIndex1, $row1, $columnIndex2, $row2)
+ {
+ return $this->setAutoFilter(
+ Coordinate::stringFromColumnIndex($columnIndex1) . $row1
+ . ':' .
+ Coordinate::stringFromColumnIndex($columnIndex2) . $row2
+ );
+ }
+
+ /**
+ * Remove autofilter.
+ *
+ * @return Worksheet
+ */
+ public function removeAutoFilter()
+ {
+ $this->autoFilter->setRange(null);
+
+ return $this;
+ }
+
+ /**
+ * Get Freeze Pane.
+ *
+ * @return string
+ */
+ public function getFreezePane()
+ {
+ return $this->freezePane;
+ }
+
+ /**
+ * Freeze Pane.
+ *
+ * Examples:
+ *
+ * - A2 will freeze the rows above cell A2 (i.e row 1)
+ * - B1 will freeze the columns to the left of cell B1 (i.e column A)
+ * - B2 will freeze the rows above and to the left of cell B2 (i.e row 1 and column A)
+ *
+ * @param null|string $cell Position of the split
+ * @param null|string $topLeftCell default position of the right bottom pane
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function freezePane($cell, $topLeftCell = null)
+ {
+ if (is_string($cell) && Coordinate::coordinateIsRange($cell)) {
+ throw new Exception('Freeze pane can not be set on a range of cells.');
+ }
+
+ if ($cell !== null && $topLeftCell === null) {
+ $coordinate = Coordinate::coordinateFromString($cell);
+ $topLeftCell = $coordinate[0] . $coordinate[1];
+ }
+
+ $this->freezePane = $cell;
+ $this->topLeftCell = $topLeftCell;
+
+ return $this;
+ }
+
+ /**
+ * Freeze Pane by using numeric cell coordinates.
+ *
+ * @param int $columnIndex Numeric column coordinate of the cell
+ * @param int $row Numeric row coordinate of the cell
+ *
+ * @return Worksheet
+ */
+ public function freezePaneByColumnAndRow($columnIndex, $row)
+ {
+ return $this->freezePane(Coordinate::stringFromColumnIndex($columnIndex) . $row);
+ }
+
+ /**
+ * Unfreeze Pane.
+ *
+ * @return Worksheet
+ */
+ public function unfreezePane()
+ {
+ return $this->freezePane(null);
+ }
+
+ /**
+ * Get the default position of the right bottom pane.
+ *
+ * @return int
+ */
+ public function getTopLeftCell()
+ {
+ return $this->topLeftCell;
+ }
+
+ /**
+ * Insert a new row, updating all possible related data.
+ *
+ * @param int $pBefore Insert before this one
+ * @param int $pNumRows Number of rows to insert
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function insertNewRowBefore($pBefore, $pNumRows = 1)
+ {
+ if ($pBefore >= 1) {
+ $objReferenceHelper = ReferenceHelper::getInstance();
+ $objReferenceHelper->insertNewBefore('A' . $pBefore, 0, $pNumRows, $this);
+ } else {
+ throw new Exception('Rows can only be inserted before at least row 1.');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Insert a new column, updating all possible related data.
+ *
+ * @param int $pBefore Insert before this one, eg: 'A'
+ * @param int $pNumCols Number of columns to insert
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function insertNewColumnBefore($pBefore, $pNumCols = 1)
+ {
+ if (!is_numeric($pBefore)) {
+ $objReferenceHelper = ReferenceHelper::getInstance();
+ $objReferenceHelper->insertNewBefore($pBefore . '1', $pNumCols, 0, $this);
+ } else {
+ throw new Exception('Column references should not be numeric.');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Insert a new column, updating all possible related data.
+ *
+ * @param int $beforeColumnIndex Insert before this one (numeric column coordinate of the cell)
+ * @param int $pNumCols Number of columns to insert
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function insertNewColumnBeforeByIndex($beforeColumnIndex, $pNumCols = 1)
+ {
+ if ($beforeColumnIndex >= 1) {
+ return $this->insertNewColumnBefore(Coordinate::stringFromColumnIndex($beforeColumnIndex), $pNumCols);
+ }
+
+ throw new Exception('Columns can only be inserted before at least column A (1).');
+ }
+
+ /**
+ * Delete a row, updating all possible related data.
+ *
+ * @param int $pRow Remove starting with this one
+ * @param int $pNumRows Number of rows to remove
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function removeRow($pRow, $pNumRows = 1)
+ {
+ if ($pRow >= 1) {
+ $highestRow = $this->getHighestDataRow();
+ $objReferenceHelper = ReferenceHelper::getInstance();
+ $objReferenceHelper->insertNewBefore('A' . ($pRow + $pNumRows), 0, -$pNumRows, $this);
+ for ($r = 0; $r < $pNumRows; ++$r) {
+ $this->getCellCollection()->removeRow($highestRow);
+ --$highestRow;
+ }
+ } else {
+ throw new Exception('Rows to be deleted should at least start from row 1.');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Remove a column, updating all possible related data.
+ *
+ * @param string $pColumn Remove starting with this one, eg: 'A'
+ * @param int $pNumCols Number of columns to remove
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function removeColumn($pColumn, $pNumCols = 1)
+ {
+ if (!is_numeric($pColumn)) {
+ $highestColumn = $this->getHighestDataColumn();
+ $pColumn = Coordinate::stringFromColumnIndex(Coordinate::columnIndexFromString($pColumn) + $pNumCols);
+ $objReferenceHelper = ReferenceHelper::getInstance();
+ $objReferenceHelper->insertNewBefore($pColumn . '1', -$pNumCols, 0, $this);
+ for ($c = 0; $c < $pNumCols; ++$c) {
+ $this->getCellCollection()->removeColumn($highestColumn);
+ $highestColumn = Coordinate::stringFromColumnIndex(Coordinate::columnIndexFromString($highestColumn) - 1);
+ }
+ } else {
+ throw new Exception('Column references should not be numeric.');
+ }
+
+ return $this;
+ }
+
+ /**
+ * Remove a column, updating all possible related data.
+ *
+ * @param int $columnIndex Remove starting with this one (numeric column coordinate of the cell)
+ * @param int $numColumns Number of columns to remove
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function removeColumnByIndex($columnIndex, $numColumns = 1)
+ {
+ if ($columnIndex >= 1) {
+ return $this->removeColumn(Coordinate::stringFromColumnIndex($columnIndex), $numColumns);
+ }
+
+ throw new Exception('Columns to be deleted should at least start from column A (1)');
+ }
+
+ /**
+ * Show gridlines?
+ *
+ * @return bool
+ */
+ public function getShowGridlines()
+ {
+ return $this->showGridlines;
+ }
+
+ /**
+ * Set show gridlines.
+ *
+ * @param bool $pValue Show gridlines (true/false)
+ *
+ * @return Worksheet
+ */
+ public function setShowGridlines($pValue)
+ {
+ $this->showGridlines = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Print gridlines?
+ *
+ * @return bool
+ */
+ public function getPrintGridlines()
+ {
+ return $this->printGridlines;
+ }
+
+ /**
+ * Set print gridlines.
+ *
+ * @param bool $pValue Print gridlines (true/false)
+ *
+ * @return Worksheet
+ */
+ public function setPrintGridlines($pValue)
+ {
+ $this->printGridlines = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Show row and column headers?
+ *
+ * @return bool
+ */
+ public function getShowRowColHeaders()
+ {
+ return $this->showRowColHeaders;
+ }
+
+ /**
+ * Set show row and column headers.
+ *
+ * @param bool $pValue Show row and column headers (true/false)
+ *
+ * @return Worksheet
+ */
+ public function setShowRowColHeaders($pValue)
+ {
+ $this->showRowColHeaders = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Show summary below? (Row/Column outlining).
+ *
+ * @return bool
+ */
+ public function getShowSummaryBelow()
+ {
+ return $this->showSummaryBelow;
+ }
+
+ /**
+ * Set show summary below.
+ *
+ * @param bool $pValue Show summary below (true/false)
+ *
+ * @return Worksheet
+ */
+ public function setShowSummaryBelow($pValue)
+ {
+ $this->showSummaryBelow = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Show summary right? (Row/Column outlining).
+ *
+ * @return bool
+ */
+ public function getShowSummaryRight()
+ {
+ return $this->showSummaryRight;
+ }
+
+ /**
+ * Set show summary right.
+ *
+ * @param bool $pValue Show summary right (true/false)
+ *
+ * @return Worksheet
+ */
+ public function setShowSummaryRight($pValue)
+ {
+ $this->showSummaryRight = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get comments.
+ *
+ * @return Comment[]
+ */
+ public function getComments()
+ {
+ return $this->comments;
+ }
+
+ /**
+ * Set comments array for the entire sheet.
+ *
+ * @param Comment[] $pValue
+ *
+ * @return Worksheet
+ */
+ public function setComments(array $pValue)
+ {
+ $this->comments = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get comment for cell.
+ *
+ * @param string $pCellCoordinate Cell coordinate to get comment for, eg: 'A1'
+ *
+ * @throws Exception
+ *
+ * @return Comment
+ */
+ public function getComment($pCellCoordinate)
+ {
+ // Uppercase coordinate
+ $pCellCoordinate = strtoupper($pCellCoordinate);
+
+ if (Coordinate::coordinateIsRange($pCellCoordinate)) {
+ throw new Exception('Cell coordinate string can not be a range of cells.');
+ } elseif (strpos($pCellCoordinate, '$') !== false) {
+ throw new Exception('Cell coordinate string must not be absolute.');
+ } elseif ($pCellCoordinate == '') {
+ throw new Exception('Cell coordinate can not be zero-length string.');
+ }
+
+ // Check if we already have a comment for this cell.
+ if (isset($this->comments[$pCellCoordinate])) {
+ return $this->comments[$pCellCoordinate];
+ }
+
+ // If not, create a new comment.
+ $newComment = new Comment();
+ $this->comments[$pCellCoordinate] = $newComment;
+
+ return $newComment;
+ }
+
+ /**
+ * Get comment for cell by using numeric cell coordinates.
+ *
+ * @param int $columnIndex Numeric column coordinate of the cell
+ * @param int $row Numeric row coordinate of the cell
+ *
+ * @return Comment
+ */
+ public function getCommentByColumnAndRow($columnIndex, $row)
+ {
+ return $this->getComment(Coordinate::stringFromColumnIndex($columnIndex) . $row);
+ }
+
+ /**
+ * Get active cell.
+ *
+ * @return string Example: 'A1'
+ */
+ public function getActiveCell()
+ {
+ return $this->activeCell;
+ }
+
+ /**
+ * Get selected cells.
+ *
+ * @return string
+ */
+ public function getSelectedCells()
+ {
+ return $this->selectedCells;
+ }
+
+ /**
+ * Selected cell.
+ *
+ * @param string $pCoordinate Cell (i.e. A1)
+ *
+ * @return Worksheet
+ */
+ public function setSelectedCell($pCoordinate)
+ {
+ return $this->setSelectedCells($pCoordinate);
+ }
+
+ /**
+ * Select a range of cells.
+ *
+ * @param string $pCoordinate Cell range, examples: 'A1', 'B2:G5', 'A:C', '3:6'
+ *
+ * @return Worksheet
+ */
+ public function setSelectedCells($pCoordinate)
+ {
+ // Uppercase coordinate
+ $pCoordinate = strtoupper($pCoordinate);
+
+ // Convert 'A' to 'A:A'
+ $pCoordinate = preg_replace('/^([A-Z]+)$/', '${1}:${1}', $pCoordinate);
+
+ // Convert '1' to '1:1'
+ $pCoordinate = preg_replace('/^(\d+)$/', '${1}:${1}', $pCoordinate);
+
+ // Convert 'A:C' to 'A1:C1048576'
+ $pCoordinate = preg_replace('/^([A-Z]+):([A-Z]+)$/', '${1}1:${2}1048576', $pCoordinate);
+
+ // Convert '1:3' to 'A1:XFD3'
+ $pCoordinate = preg_replace('/^(\d+):(\d+)$/', 'A${1}:XFD${2}', $pCoordinate);
+
+ if (Coordinate::coordinateIsRange($pCoordinate)) {
+ list($first) = Coordinate::splitRange($pCoordinate);
+ $this->activeCell = $first[0];
+ } else {
+ $this->activeCell = $pCoordinate;
+ }
+ $this->selectedCells = $pCoordinate;
+
+ return $this;
+ }
+
+ /**
+ * Selected cell by using numeric cell coordinates.
+ *
+ * @param int $columnIndex Numeric column coordinate of the cell
+ * @param int $row Numeric row coordinate of the cell
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function setSelectedCellByColumnAndRow($columnIndex, $row)
+ {
+ return $this->setSelectedCells(Coordinate::stringFromColumnIndex($columnIndex) . $row);
+ }
+
+ /**
+ * Get right-to-left.
+ *
+ * @return bool
+ */
+ public function getRightToLeft()
+ {
+ return $this->rightToLeft;
+ }
+
+ /**
+ * Set right-to-left.
+ *
+ * @param bool $value Right-to-left true/false
+ *
+ * @return Worksheet
+ */
+ public function setRightToLeft($value)
+ {
+ $this->rightToLeft = $value;
+
+ return $this;
+ }
+
+ /**
+ * Fill worksheet from values in array.
+ *
+ * @param array $source Source array
+ * @param mixed $nullValue Value in source array that stands for blank cell
+ * @param string $startCell Insert array starting from this cell address as the top left coordinate
+ * @param bool $strictNullComparison Apply strict comparison when testing for null values in the array
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function fromArray(array $source, $nullValue = null, $startCell = 'A1', $strictNullComparison = false)
+ {
+ // Convert a 1-D array to 2-D (for ease of looping)
+ if (!is_array(end($source))) {
+ $source = [$source];
+ }
+
+ // start coordinate
+ list($startColumn, $startRow) = Coordinate::coordinateFromString($startCell);
+
+ // Loop through $source
+ foreach ($source as $rowData) {
+ $currentColumn = $startColumn;
+ foreach ($rowData as $cellValue) {
+ if ($strictNullComparison) {
+ if ($cellValue !== $nullValue) {
+ // Set cell value
+ $this->getCell($currentColumn . $startRow)->setValue($cellValue);
+ }
+ } else {
+ if ($cellValue != $nullValue) {
+ // Set cell value
+ $this->getCell($currentColumn . $startRow)->setValue($cellValue);
+ }
+ }
+ ++$currentColumn;
+ }
+ ++$startRow;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Create array from a range of cells.
+ *
+ * @param string $pRange Range of cells (i.e. "A1:B10"), or just one cell (i.e. "A1")
+ * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist
+ * @param bool $calculateFormulas Should formulas be calculated?
+ * @param bool $formatData Should formatting be applied to cell values?
+ * @param bool $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero
+ * True - Return rows and columns indexed by their actual row and column IDs
+ *
+ * @return array
+ */
+ public function rangeToArray($pRange, $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false)
+ {
+ // Returnvalue
+ $returnValue = [];
+ // Identify the range that we need to extract from the worksheet
+ list($rangeStart, $rangeEnd) = Coordinate::rangeBoundaries($pRange);
+ $minCol = Coordinate::stringFromColumnIndex($rangeStart[0]);
+ $minRow = $rangeStart[1];
+ $maxCol = Coordinate::stringFromColumnIndex($rangeEnd[0]);
+ $maxRow = $rangeEnd[1];
+
+ ++$maxCol;
+ // Loop through rows
+ $r = -1;
+ for ($row = $minRow; $row <= $maxRow; ++$row) {
+ $rRef = ($returnCellRef) ? $row : ++$r;
+ $c = -1;
+ // Loop through columns in the current row
+ for ($col = $minCol; $col != $maxCol; ++$col) {
+ $cRef = ($returnCellRef) ? $col : ++$c;
+ // Using getCell() will create a new cell if it doesn't already exist. We don't want that to happen
+ // so we test and retrieve directly against cellCollection
+ if ($this->cellCollection->has($col . $row)) {
+ // Cell exists
+ $cell = $this->cellCollection->get($col . $row);
+ if ($cell->getValue() !== null) {
+ if ($cell->getValue() instanceof RichText) {
+ $returnValue[$rRef][$cRef] = $cell->getValue()->getPlainText();
+ } else {
+ if ($calculateFormulas) {
+ $returnValue[$rRef][$cRef] = $cell->getCalculatedValue();
+ } else {
+ $returnValue[$rRef][$cRef] = $cell->getValue();
+ }
+ }
+
+ if ($formatData) {
+ $style = $this->parent->getCellXfByIndex($cell->getXfIndex());
+ $returnValue[$rRef][$cRef] = NumberFormat::toFormattedString(
+ $returnValue[$rRef][$cRef],
+ ($style && $style->getNumberFormat()) ? $style->getNumberFormat()->getFormatCode() : NumberFormat::FORMAT_GENERAL
+ );
+ }
+ } else {
+ // Cell holds a NULL
+ $returnValue[$rRef][$cRef] = $nullValue;
+ }
+ } else {
+ // Cell doesn't exist
+ $returnValue[$rRef][$cRef] = $nullValue;
+ }
+ }
+ }
+
+ // Return
+ return $returnValue;
+ }
+
+ /**
+ * Create array from a range of cells.
+ *
+ * @param string $pNamedRange Name of the Named Range
+ * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist
+ * @param bool $calculateFormulas Should formulas be calculated?
+ * @param bool $formatData Should formatting be applied to cell values?
+ * @param bool $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero
+ * True - Return rows and columns indexed by their actual row and column IDs
+ *
+ * @throws Exception
+ *
+ * @return array
+ */
+ public function namedRangeToArray($pNamedRange, $nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false)
+ {
+ $namedRange = NamedRange::resolveRange($pNamedRange, $this);
+ if ($namedRange !== null) {
+ $pWorkSheet = $namedRange->getWorksheet();
+ $pCellRange = $namedRange->getRange();
+
+ return $pWorkSheet->rangeToArray($pCellRange, $nullValue, $calculateFormulas, $formatData, $returnCellRef);
+ }
+
+ throw new Exception('Named Range ' . $pNamedRange . ' does not exist.');
+ }
+
+ /**
+ * Create array from worksheet.
+ *
+ * @param mixed $nullValue Value returned in the array entry if a cell doesn't exist
+ * @param bool $calculateFormulas Should formulas be calculated?
+ * @param bool $formatData Should formatting be applied to cell values?
+ * @param bool $returnCellRef False - Return a simple array of rows and columns indexed by number counting from zero
+ * True - Return rows and columns indexed by their actual row and column IDs
+ *
+ * @return array
+ */
+ public function toArray($nullValue = null, $calculateFormulas = true, $formatData = true, $returnCellRef = false)
+ {
+ // Garbage collect...
+ $this->garbageCollect();
+
+ // Identify the range that we need to extract from the worksheet
+ $maxCol = $this->getHighestColumn();
+ $maxRow = $this->getHighestRow();
+
+ // Return
+ return $this->rangeToArray('A1:' . $maxCol . $maxRow, $nullValue, $calculateFormulas, $formatData, $returnCellRef);
+ }
+
+ /**
+ * Get row iterator.
+ *
+ * @param int $startRow The row number at which to start iterating
+ * @param int $endRow The row number at which to stop iterating
+ *
+ * @return RowIterator
+ */
+ public function getRowIterator($startRow = 1, $endRow = null)
+ {
+ return new RowIterator($this, $startRow, $endRow);
+ }
+
+ /**
+ * Get column iterator.
+ *
+ * @param string $startColumn The column address at which to start iterating
+ * @param string $endColumn The column address at which to stop iterating
+ *
+ * @return ColumnIterator
+ */
+ public function getColumnIterator($startColumn = 'A', $endColumn = null)
+ {
+ return new ColumnIterator($this, $startColumn, $endColumn);
+ }
+
+ /**
+ * Run PhpSpreadsheet garbage collector.
+ *
+ * @return Worksheet
+ */
+ public function garbageCollect()
+ {
+ // Flush cache
+ $this->cellCollection->get('A1');
+
+ // Lookup highest column and highest row if cells are cleaned
+ $colRow = $this->cellCollection->getHighestRowAndColumn();
+ $highestRow = $colRow['row'];
+ $highestColumn = Coordinate::columnIndexFromString($colRow['column']);
+
+ // Loop through column dimensions
+ foreach ($this->columnDimensions as $dimension) {
+ $highestColumn = max($highestColumn, Coordinate::columnIndexFromString($dimension->getColumnIndex()));
+ }
+
+ // Loop through row dimensions
+ foreach ($this->rowDimensions as $dimension) {
+ $highestRow = max($highestRow, $dimension->getRowIndex());
+ }
+
+ // Cache values
+ if ($highestColumn < 1) {
+ $this->cachedHighestColumn = 'A';
+ } else {
+ $this->cachedHighestColumn = Coordinate::stringFromColumnIndex($highestColumn);
+ }
+ $this->cachedHighestRow = $highestRow;
+
+ // Return
+ return $this;
+ }
+
+ /**
+ * Get hash code.
+ *
+ * @return string Hash code
+ */
+ public function getHashCode()
+ {
+ if ($this->dirty) {
+ $this->hash = md5($this->title . $this->autoFilter . ($this->protection->isProtectionEnabled() ? 't' : 'f') . __CLASS__);
+ $this->dirty = false;
+ }
+
+ return $this->hash;
+ }
+
+ /**
+ * Extract worksheet title from range.
+ *
+ * Example: extractSheetTitle("testSheet!A1") ==> 'A1'
+ * Example: extractSheetTitle("'testSheet 1'!A1", true) ==> ['testSheet 1', 'A1'];
+ *
+ * @param string $pRange Range to extract title from
+ * @param bool $returnRange Return range? (see example)
+ *
+ * @return mixed
+ */
+ public static function extractSheetTitle($pRange, $returnRange = false)
+ {
+ // Sheet title included?
+ if (($sep = strrpos($pRange, '!')) === false) {
+ return $returnRange ? ['', $pRange] : '';
+ }
+
+ if ($returnRange) {
+ return [substr($pRange, 0, $sep), substr($pRange, $sep + 1)];
+ }
+
+ return substr($pRange, $sep + 1);
+ }
+
+ /**
+ * Get hyperlink.
+ *
+ * @param string $pCellCoordinate Cell coordinate to get hyperlink for, eg: 'A1'
+ *
+ * @return Hyperlink
+ */
+ public function getHyperlink($pCellCoordinate)
+ {
+ // return hyperlink if we already have one
+ if (isset($this->hyperlinkCollection[$pCellCoordinate])) {
+ return $this->hyperlinkCollection[$pCellCoordinate];
+ }
+
+ // else create hyperlink
+ $this->hyperlinkCollection[$pCellCoordinate] = new Hyperlink();
+
+ return $this->hyperlinkCollection[$pCellCoordinate];
+ }
+
+ /**
+ * Set hyperlink.
+ *
+ * @param string $pCellCoordinate Cell coordinate to insert hyperlink, eg: 'A1'
+ * @param null|Hyperlink $pHyperlink
+ *
+ * @return Worksheet
+ */
+ public function setHyperlink($pCellCoordinate, Hyperlink $pHyperlink = null)
+ {
+ if ($pHyperlink === null) {
+ unset($this->hyperlinkCollection[$pCellCoordinate]);
+ } else {
+ $this->hyperlinkCollection[$pCellCoordinate] = $pHyperlink;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Hyperlink at a specific coordinate exists?
+ *
+ * @param string $pCoordinate eg: 'A1'
+ *
+ * @return bool
+ */
+ public function hyperlinkExists($pCoordinate)
+ {
+ return isset($this->hyperlinkCollection[$pCoordinate]);
+ }
+
+ /**
+ * Get collection of hyperlinks.
+ *
+ * @return Hyperlink[]
+ */
+ public function getHyperlinkCollection()
+ {
+ return $this->hyperlinkCollection;
+ }
+
+ /**
+ * Get data validation.
+ *
+ * @param string $pCellCoordinate Cell coordinate to get data validation for, eg: 'A1'
+ *
+ * @return DataValidation
+ */
+ public function getDataValidation($pCellCoordinate)
+ {
+ // return data validation if we already have one
+ if (isset($this->dataValidationCollection[$pCellCoordinate])) {
+ return $this->dataValidationCollection[$pCellCoordinate];
+ }
+
+ // else create data validation
+ $this->dataValidationCollection[$pCellCoordinate] = new DataValidation();
+
+ return $this->dataValidationCollection[$pCellCoordinate];
+ }
+
+ /**
+ * Set data validation.
+ *
+ * @param string $pCellCoordinate Cell coordinate to insert data validation, eg: 'A1'
+ * @param null|DataValidation $pDataValidation
+ *
+ * @return Worksheet
+ */
+ public function setDataValidation($pCellCoordinate, DataValidation $pDataValidation = null)
+ {
+ if ($pDataValidation === null) {
+ unset($this->dataValidationCollection[$pCellCoordinate]);
+ } else {
+ $this->dataValidationCollection[$pCellCoordinate] = $pDataValidation;
+ }
+
+ return $this;
+ }
+
+ /**
+ * Data validation at a specific coordinate exists?
+ *
+ * @param string $pCoordinate eg: 'A1'
+ *
+ * @return bool
+ */
+ public function dataValidationExists($pCoordinate)
+ {
+ return isset($this->dataValidationCollection[$pCoordinate]);
+ }
+
+ /**
+ * Get collection of data validations.
+ *
+ * @return DataValidation[]
+ */
+ public function getDataValidationCollection()
+ {
+ return $this->dataValidationCollection;
+ }
+
+ /**
+ * Accepts a range, returning it as a range that falls within the current highest row and column of the worksheet.
+ *
+ * @param string $range
+ *
+ * @return string Adjusted range value
+ */
+ public function shrinkRangeToFit($range)
+ {
+ $maxCol = $this->getHighestColumn();
+ $maxRow = $this->getHighestRow();
+ $maxCol = Coordinate::columnIndexFromString($maxCol);
+
+ $rangeBlocks = explode(' ', $range);
+ foreach ($rangeBlocks as &$rangeSet) {
+ $rangeBoundaries = Coordinate::getRangeBoundaries($rangeSet);
+
+ if (Coordinate::columnIndexFromString($rangeBoundaries[0][0]) > $maxCol) {
+ $rangeBoundaries[0][0] = Coordinate::stringFromColumnIndex($maxCol);
+ }
+ if ($rangeBoundaries[0][1] > $maxRow) {
+ $rangeBoundaries[0][1] = $maxRow;
+ }
+ if (Coordinate::columnIndexFromString($rangeBoundaries[1][0]) > $maxCol) {
+ $rangeBoundaries[1][0] = Coordinate::stringFromColumnIndex($maxCol);
+ }
+ if ($rangeBoundaries[1][1] > $maxRow) {
+ $rangeBoundaries[1][1] = $maxRow;
+ }
+ $rangeSet = $rangeBoundaries[0][0] . $rangeBoundaries[0][1] . ':' . $rangeBoundaries[1][0] . $rangeBoundaries[1][1];
+ }
+ unset($rangeSet);
+ $stRange = implode(' ', $rangeBlocks);
+
+ return $stRange;
+ }
+
+ /**
+ * Get tab color.
+ *
+ * @return Color
+ */
+ public function getTabColor()
+ {
+ if ($this->tabColor === null) {
+ $this->tabColor = new Color();
+ }
+
+ return $this->tabColor;
+ }
+
+ /**
+ * Reset tab color.
+ *
+ * @return Worksheet
+ */
+ public function resetTabColor()
+ {
+ $this->tabColor = null;
+ unset($this->tabColor);
+
+ return $this;
+ }
+
+ /**
+ * Tab color set?
+ *
+ * @return bool
+ */
+ public function isTabColorSet()
+ {
+ return $this->tabColor !== null;
+ }
+
+ /**
+ * Copy worksheet (!= clone!).
+ *
+ * @return Worksheet
+ */
+ public function copy()
+ {
+ $copied = clone $this;
+
+ return $copied;
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone()
+ {
+ foreach ($this as $key => $val) {
+ if ($key == 'parent') {
+ continue;
+ }
+
+ if (is_object($val) || (is_array($val))) {
+ if ($key == 'cellCollection') {
+ $newCollection = $this->cellCollection->cloneCellCollection($this);
+ $this->cellCollection = $newCollection;
+ } elseif ($key == 'drawingCollection') {
+ $currentCollection = $this->drawingCollection;
+ $this->drawingCollection = new ArrayObject();
+ foreach ($currentCollection as $item) {
+ if (is_object($item)) {
+ $newDrawing = clone $item;
+ $newDrawing->setWorksheet($this);
+ }
+ }
+ } elseif (($key == 'autoFilter') && ($this->autoFilter instanceof AutoFilter)) {
+ $newAutoFilter = clone $this->autoFilter;
+ $this->autoFilter = $newAutoFilter;
+ $this->autoFilter->setParent($this);
+ } else {
+ $this->{$key} = unserialize(serialize($val));
+ }
+ }
+ }
+ }
+
+ /**
+ * Define the code name of the sheet.
+ *
+ * @param string $pValue Same rule as Title minus space not allowed (but, like Excel, change
+ * silently space to underscore)
+ * @param bool $validate False to skip validation of new title. WARNING: This should only be set
+ * at parse time (by Readers), where titles can be assumed to be valid.
+ *
+ * @throws Exception
+ *
+ * @return Worksheet
+ */
+ public function setCodeName($pValue, $validate = true)
+ {
+ // Is this a 'rename' or not?
+ if ($this->getCodeName() == $pValue) {
+ return $this;
+ }
+
+ if ($validate) {
+ $pValue = str_replace(' ', '_', $pValue); //Excel does this automatically without flinching, we are doing the same
+
+ // Syntax check
+ // throw an exception if not valid
+ self::checkSheetCodeName($pValue);
+
+ // We use the same code that setTitle to find a valid codeName else not using a space (Excel don't like) but a '_'
+
+ if ($this->getParent()) {
+ // Is there already such sheet name?
+ if ($this->getParent()->sheetCodeNameExists($pValue)) {
+ // Use name, but append with lowest possible integer
+
+ if (Shared\StringHelper::countCharacters($pValue) > 29) {
+ $pValue = Shared\StringHelper::substring($pValue, 0, 29);
+ }
+ $i = 1;
+ while ($this->getParent()->sheetCodeNameExists($pValue . '_' . $i)) {
+ ++$i;
+ if ($i == 10) {
+ if (Shared\StringHelper::countCharacters($pValue) > 28) {
+ $pValue = Shared\StringHelper::substring($pValue, 0, 28);
+ }
+ } elseif ($i == 100) {
+ if (Shared\StringHelper::countCharacters($pValue) > 27) {
+ $pValue = Shared\StringHelper::substring($pValue, 0, 27);
+ }
+ }
+ }
+
+ $pValue = $pValue . '_' . $i; // ok, we have a valid name
+ }
+ }
+ }
+
+ $this->codeName = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Return the code name of the sheet.
+ *
+ * @return null|string
+ */
+ public function getCodeName()
+ {
+ return $this->codeName;
+ }
+
+ /**
+ * Sheet has a code name ?
+ *
+ * @return bool
+ */
+ public function hasCodeName()
+ {
+ return $this->codeName !== null;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php
new file mode 100644
index 00000000000..122783f30c6
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/BaseWriter.php
@@ -0,0 +1,141 @@
+includeCharts;
+ }
+
+ /**
+ * Set write charts in workbook
+ * Set to true, to advise the Writer to include any charts that exist in the PhpSpreadsheet object.
+ * Set to false (the default) to ignore charts.
+ *
+ * @param bool $pValue
+ *
+ * @return IWriter
+ */
+ public function setIncludeCharts($pValue)
+ {
+ $this->includeCharts = (bool) $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Pre-Calculate Formulas flag
+ * If this is true (the default), then the writer will recalculate all formulae in a workbook when saving,
+ * so that the pre-calculated values are immediately available to MS Excel or other office spreadsheet
+ * viewer when opening the file
+ * If false, then formulae are not calculated on save. This is faster for saving in PhpSpreadsheet, but slower
+ * when opening the resulting file in MS Excel, because Excel has to recalculate the formulae itself.
+ *
+ * @return bool
+ */
+ public function getPreCalculateFormulas()
+ {
+ return $this->preCalculateFormulas;
+ }
+
+ /**
+ * Set Pre-Calculate Formulas
+ * Set to true (the default) to advise the Writer to calculate all formulae on save
+ * Set to false to prevent precalculation of formulae on save.
+ *
+ * @param bool $pValue Pre-Calculate Formulas?
+ *
+ * @return IWriter
+ */
+ public function setPreCalculateFormulas($pValue)
+ {
+ $this->preCalculateFormulas = (bool) $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get use disk caching where possible?
+ *
+ * @return bool
+ */
+ public function getUseDiskCaching()
+ {
+ return $this->useDiskCaching;
+ }
+
+ /**
+ * Set use disk caching where possible?
+ *
+ * @param bool $pValue
+ * @param string $pDirectory Disk caching directory
+ *
+ * @throws Exception when directory does not exist
+ *
+ * @return IWriter
+ */
+ public function setUseDiskCaching($pValue, $pDirectory = null)
+ {
+ $this->useDiskCaching = $pValue;
+
+ if ($pDirectory !== null) {
+ if (is_dir($pDirectory)) {
+ $this->diskCachingDirectory = $pDirectory;
+ } else {
+ throw new Exception("Directory does not exist: $pDirectory");
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Get disk caching directory.
+ *
+ * @return string
+ */
+ public function getDiskCachingDirectory()
+ {
+ return $this->diskCachingDirectory;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Csv.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Csv.php
new file mode 100644
index 00000000000..ae38ab73218
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Csv.php
@@ -0,0 +1,342 @@
+spreadsheet = $spreadsheet;
+ }
+
+ /**
+ * Save PhpSpreadsheet to file.
+ *
+ * @param string $pFilename
+ *
+ * @throws Exception
+ */
+ public function save($pFilename)
+ {
+ // Fetch sheet
+ $sheet = $this->spreadsheet->getSheet($this->sheetIndex);
+
+ $saveDebugLog = Calculation::getInstance($this->spreadsheet)->getDebugLog()->getWriteDebugLog();
+ Calculation::getInstance($this->spreadsheet)->getDebugLog()->setWriteDebugLog(false);
+ $saveArrayReturnType = Calculation::getArrayReturnType();
+ Calculation::setArrayReturnType(Calculation::RETURN_ARRAY_AS_VALUE);
+
+ // Open file
+ $fileHandle = fopen($pFilename, 'wb+');
+ if ($fileHandle === false) {
+ throw new Exception("Could not open file $pFilename for writing.");
+ }
+
+ if ($this->excelCompatibility) {
+ $this->setUseBOM(true); // Enforce UTF-8 BOM Header
+ $this->setIncludeSeparatorLine(true); // Set separator line
+ $this->setEnclosure('"'); // Set enclosure to "
+ $this->setDelimiter(';'); // Set delimiter to a semi-colon
+ $this->setLineEnding("\r\n");
+ }
+ if ($this->useBOM) {
+ // Write the UTF-8 BOM code if required
+ fwrite($fileHandle, "\xEF\xBB\xBF");
+ }
+ if ($this->includeSeparatorLine) {
+ // Write the separator line if required
+ fwrite($fileHandle, 'sep=' . $this->getDelimiter() . $this->lineEnding);
+ }
+
+ // Identify the range that we need to extract from the worksheet
+ $maxCol = $sheet->getHighestDataColumn();
+ $maxRow = $sheet->getHighestDataRow();
+
+ // Write rows to file
+ for ($row = 1; $row <= $maxRow; ++$row) {
+ // Convert the row to an array...
+ $cellsArray = $sheet->rangeToArray('A' . $row . ':' . $maxCol . $row, '', $this->preCalculateFormulas);
+ // ... and write to the file
+ $this->writeLine($fileHandle, $cellsArray[0]);
+ }
+
+ // Close file
+ fclose($fileHandle);
+
+ Calculation::setArrayReturnType($saveArrayReturnType);
+ Calculation::getInstance($this->spreadsheet)->getDebugLog()->setWriteDebugLog($saveDebugLog);
+ }
+
+ /**
+ * Get delimiter.
+ *
+ * @return string
+ */
+ public function getDelimiter()
+ {
+ return $this->delimiter;
+ }
+
+ /**
+ * Set delimiter.
+ *
+ * @param string $pValue Delimiter, defaults to ','
+ *
+ * @return CSV
+ */
+ public function setDelimiter($pValue)
+ {
+ $this->delimiter = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get enclosure.
+ *
+ * @return string
+ */
+ public function getEnclosure()
+ {
+ return $this->enclosure;
+ }
+
+ /**
+ * Set enclosure.
+ *
+ * @param string $pValue Enclosure, defaults to "
+ *
+ * @return CSV
+ */
+ public function setEnclosure($pValue)
+ {
+ if ($pValue == '') {
+ $pValue = null;
+ }
+ $this->enclosure = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get line ending.
+ *
+ * @return string
+ */
+ public function getLineEnding()
+ {
+ return $this->lineEnding;
+ }
+
+ /**
+ * Set line ending.
+ *
+ * @param string $pValue Line ending, defaults to OS line ending (PHP_EOL)
+ *
+ * @return CSV
+ */
+ public function setLineEnding($pValue)
+ {
+ $this->lineEnding = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get whether BOM should be used.
+ *
+ * @return bool
+ */
+ public function getUseBOM()
+ {
+ return $this->useBOM;
+ }
+
+ /**
+ * Set whether BOM should be used.
+ *
+ * @param bool $pValue Use UTF-8 byte-order mark? Defaults to false
+ *
+ * @return CSV
+ */
+ public function setUseBOM($pValue)
+ {
+ $this->useBOM = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get whether a separator line should be included.
+ *
+ * @return bool
+ */
+ public function getIncludeSeparatorLine()
+ {
+ return $this->includeSeparatorLine;
+ }
+
+ /**
+ * Set whether a separator line should be included as the first line of the file.
+ *
+ * @param bool $pValue Use separator line? Defaults to false
+ *
+ * @return CSV
+ */
+ public function setIncludeSeparatorLine($pValue)
+ {
+ $this->includeSeparatorLine = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get whether the file should be saved with full Excel Compatibility.
+ *
+ * @return bool
+ */
+ public function getExcelCompatibility()
+ {
+ return $this->excelCompatibility;
+ }
+
+ /**
+ * Set whether the file should be saved with full Excel Compatibility.
+ *
+ * @param bool $pValue Set the file to be written as a fully Excel compatible csv file
+ * Note that this overrides other settings such as useBOM, enclosure and delimiter
+ *
+ * @return CSV
+ */
+ public function setExcelCompatibility($pValue)
+ {
+ $this->excelCompatibility = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get sheet index.
+ *
+ * @return int
+ */
+ public function getSheetIndex()
+ {
+ return $this->sheetIndex;
+ }
+
+ /**
+ * Set sheet index.
+ *
+ * @param int $pValue Sheet index
+ *
+ * @return CSV
+ */
+ public function setSheetIndex($pValue)
+ {
+ $this->sheetIndex = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Write line to CSV file.
+ *
+ * @param resource $pFileHandle PHP filehandle
+ * @param array $pValues Array containing values in a row
+ */
+ private function writeLine($pFileHandle, array $pValues)
+ {
+ // No leading delimiter
+ $writeDelimiter = false;
+
+ // Build the line
+ $line = '';
+
+ foreach ($pValues as $element) {
+ // Escape enclosures
+ $element = str_replace($this->enclosure, $this->enclosure . $this->enclosure, $element);
+
+ // Add delimiter
+ if ($writeDelimiter) {
+ $line .= $this->delimiter;
+ } else {
+ $writeDelimiter = true;
+ }
+
+ // Add enclosed string
+ $line .= $this->enclosure . $element . $this->enclosure;
+ }
+
+ // Add line ending
+ $line .= $this->lineEnding;
+
+ // Write to file
+ fwrite($pFileHandle, $line);
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Exception.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Exception.php
new file mode 100644
index 00000000000..92e6f5f4d4c
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Exception.php
@@ -0,0 +1,9 @@
+phpExcel = $phpExcel;
- $this->defaultFont = $this->phpExcel->getDefaultStyle()->getFont();
+ $this->spreadsheet = $spreadsheet;
+ $this->defaultFont = $this->spreadsheet->getDefaultStyle()->getFont();
}
/**
- * Save PHPExcel to file
+ * Save Spreadsheet to file.
*
- * @param string $pFilename
- * @throws PHPExcel_Writer_Exception
+ * @param string $pFilename
+ *
+ * @throws WriterException
*/
- public function save($pFilename = null)
+ public function save($pFilename)
{
// garbage collect
- $this->phpExcel->garbageCollect();
+ $this->spreadsheet->garbageCollect();
- $saveDebugLog = PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->getWriteDebugLog();
- PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog(false);
- $saveArrayReturnType = PHPExcel_Calculation::getArrayReturnType();
- PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
+ $saveDebugLog = Calculation::getInstance($this->spreadsheet)->getDebugLog()->getWriteDebugLog();
+ Calculation::getInstance($this->spreadsheet)->getDebugLog()->setWriteDebugLog(false);
+ $saveArrayReturnType = Calculation::getArrayReturnType();
+ Calculation::setArrayReturnType(Calculation::RETURN_ARRAY_AS_VALUE);
// Build CSS
$this->buildCSS(!$this->useInlineCss);
@@ -158,7 +159,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
// Open file
$fileHandle = fopen($pFilename, 'wb+');
if ($fileHandle === false) {
- throw new PHPExcel_Writer_Exception("Could not open file $pFilename for writing.");
+ throw new WriterException("Could not open file $pFilename for writing.");
}
// Write headers
@@ -178,25 +179,26 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
// Close file
fclose($fileHandle);
- PHPExcel_Calculation::setArrayReturnType($saveArrayReturnType);
- PHPExcel_Calculation::getInstance($this->phpExcel)->getDebugLog()->setWriteDebugLog($saveDebugLog);
+ Calculation::setArrayReturnType($saveArrayReturnType);
+ Calculation::getInstance($this->spreadsheet)->getDebugLog()->setWriteDebugLog($saveDebugLog);
}
/**
- * Map VAlign
+ * Map VAlign.
+ *
+ * @param string $vAlign Vertical alignment
*
- * @param string $vAlign Vertical alignment
* @return string
*/
private function mapVAlign($vAlign)
{
switch ($vAlign) {
- case PHPExcel_Style_Alignment::VERTICAL_BOTTOM:
+ case Alignment::VERTICAL_BOTTOM:
return 'bottom';
- case PHPExcel_Style_Alignment::VERTICAL_TOP:
+ case Alignment::VERTICAL_TOP:
return 'top';
- case PHPExcel_Style_Alignment::VERTICAL_CENTER:
- case PHPExcel_Style_Alignment::VERTICAL_JUSTIFY:
+ case Alignment::VERTICAL_CENTER:
+ case Alignment::VERTICAL_JUSTIFY:
return 'middle';
default:
return 'baseline';
@@ -204,24 +206,25 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Map HAlign
+ * Map HAlign.
*
- * @param string $hAlign Horizontal alignment
- * @return string|false
+ * @param string $hAlign Horizontal alignment
+ *
+ * @return false|string
*/
private function mapHAlign($hAlign)
{
switch ($hAlign) {
- case PHPExcel_Style_Alignment::HORIZONTAL_GENERAL:
+ case Alignment::HORIZONTAL_GENERAL:
return false;
- case PHPExcel_Style_Alignment::HORIZONTAL_LEFT:
+ case Alignment::HORIZONTAL_LEFT:
return 'left';
- case PHPExcel_Style_Alignment::HORIZONTAL_RIGHT:
+ case Alignment::HORIZONTAL_RIGHT:
return 'right';
- case PHPExcel_Style_Alignment::HORIZONTAL_CENTER:
- case PHPExcel_Style_Alignment::HORIZONTAL_CENTER_CONTINUOUS:
+ case Alignment::HORIZONTAL_CENTER:
+ case Alignment::HORIZONTAL_CENTER_CONTINUOUS:
return 'center';
- case PHPExcel_Style_Alignment::HORIZONTAL_JUSTIFY:
+ case Alignment::HORIZONTAL_JUSTIFY:
return 'justify';
default:
return false;
@@ -229,41 +232,42 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Map border style
+ * Map border style.
*
- * @param int $borderStyle Sheet index
- * @return string
+ * @param int $borderStyle Sheet index
+ *
+ * @return string
*/
private function mapBorderStyle($borderStyle)
{
switch ($borderStyle) {
- case PHPExcel_Style_Border::BORDER_NONE:
+ case Border::BORDER_NONE:
return 'none';
- case PHPExcel_Style_Border::BORDER_DASHDOT:
+ case Border::BORDER_DASHDOT:
return '1px dashed';
- case PHPExcel_Style_Border::BORDER_DASHDOTDOT:
+ case Border::BORDER_DASHDOTDOT:
return '1px dotted';
- case PHPExcel_Style_Border::BORDER_DASHED:
+ case Border::BORDER_DASHED:
return '1px dashed';
- case PHPExcel_Style_Border::BORDER_DOTTED:
+ case Border::BORDER_DOTTED:
return '1px dotted';
- case PHPExcel_Style_Border::BORDER_DOUBLE:
+ case Border::BORDER_DOUBLE:
return '3px double';
- case PHPExcel_Style_Border::BORDER_HAIR:
+ case Border::BORDER_HAIR:
return '1px solid';
- case PHPExcel_Style_Border::BORDER_MEDIUM:
+ case Border::BORDER_MEDIUM:
return '2px solid';
- case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOT:
+ case Border::BORDER_MEDIUMDASHDOT:
return '2px dashed';
- case PHPExcel_Style_Border::BORDER_MEDIUMDASHDOTDOT:
+ case Border::BORDER_MEDIUMDASHDOTDOT:
return '2px dotted';
- case PHPExcel_Style_Border::BORDER_MEDIUMDASHED:
+ case Border::BORDER_MEDIUMDASHED:
return '2px dashed';
- case PHPExcel_Style_Border::BORDER_SLANTDASHDOT:
+ case Border::BORDER_SLANTDASHDOT:
return '2px dashed';
- case PHPExcel_Style_Border::BORDER_THICK:
+ case Border::BORDER_THICK:
return '3px solid';
- case PHPExcel_Style_Border::BORDER_THIN:
+ case Border::BORDER_THIN:
return '1px solid';
default:
// map others to thin
@@ -272,7 +276,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Get sheet index
+ * Get sheet index.
*
* @return int
*/
@@ -282,21 +286,23 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Set sheet index
+ * Set sheet index.
*
- * @param int $pValue Sheet index
- * @return PHPExcel_Writer_HTML
+ * @param int $pValue Sheet index
+ *
+ * @return HTML
*/
- public function setSheetIndex($pValue = 0)
+ public function setSheetIndex($pValue)
{
$this->sheetIndex = $pValue;
+
return $this;
}
/**
- * Get sheet index
+ * Get sheet index.
*
- * @return boolean
+ * @return bool
*/
public function getGenerateSheetNavigationBlock()
{
@@ -304,47 +310,47 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Set sheet index
+ * Set sheet index.
*
- * @param boolean $pValue Flag indicating whether the sheet navigation block should be generated or not
- * @return PHPExcel_Writer_HTML
+ * @param bool $pValue Flag indicating whether the sheet navigation block should be generated or not
+ *
+ * @return HTML
*/
- public function setGenerateSheetNavigationBlock($pValue = true)
+ public function setGenerateSheetNavigationBlock($pValue)
{
$this->generateSheetNavigationBlock = (bool) $pValue;
+
return $this;
}
/**
- * Write all sheets (resets sheetIndex to NULL)
+ * Write all sheets (resets sheetIndex to NULL).
*/
public function writeAllSheets()
{
$this->sheetIndex = null;
+
return $this;
}
/**
- * Generate HTML header
+ * Generate HTML header.
*
- * @param boolean $pIncludeStyles Include styles?
- * @return string
- * @throws PHPExcel_Writer_Exception
+ * @param bool $pIncludeStyles Include styles?
+ *
+ * @throws WriterException
+ *
+ * @return string
*/
public function generateHTMLHeader($pIncludeStyles = false)
{
- // PHPExcel object known?
- if (is_null($this->phpExcel)) {
- throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.');
- }
-
// Construct HTML
- $properties = $this->phpExcel->getProperties();
+ $properties = $this->spreadsheet->getProperties();
$html = '' . PHP_EOL;
- $html .= '' . PHP_EOL;
$html .= '' . PHP_EOL;
$html .= ' ' . PHP_EOL;
$html .= ' ' . PHP_EOL;
+ $html .= ' ' . PHP_EOL;
if ($properties->getTitle() > '') {
$html .= ' ' . htmlspecialchars($properties->getTitle()) . '' . PHP_EOL;
}
@@ -385,29 +391,25 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Generate sheet data
+ * Generate sheet data.
*
- * @return string
- * @throws PHPExcel_Writer_Exception
+ * @throws WriterException
+ *
+ * @return string
*/
public function generateSheetData()
{
- // PHPExcel object known?
- if (is_null($this->phpExcel)) {
- throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.');
- }
-
// Ensure that Spans have been calculated?
- if (!$this->spansAreCalculated) {
+ if ($this->sheetIndex !== null || !$this->spansAreCalculated) {
$this->calculateSpans();
}
// Fetch sheets
- $sheets = array();
- if (is_null($this->sheetIndex)) {
- $sheets = $this->phpExcel->getAllSheets();
+ $sheets = [];
+ if ($this->sheetIndex === null) {
+ $sheets = $this->spreadsheet->getAllSheets();
} else {
- $sheets[] = $this->phpExcel->getSheet($this->sheetIndex);
+ $sheets[] = $this->spreadsheet->getSheet($this->sheetIndex);
}
// Construct HTML
@@ -421,10 +423,10 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
// Get worksheet dimension
$dimension = explode(':', $sheet->calculateWorksheetDimension());
- $dimension[0] = PHPExcel_Cell::coordinateFromString($dimension[0]);
- $dimension[0][0] = PHPExcel_Cell::columnIndexFromString($dimension[0][0]) - 1;
- $dimension[1] = PHPExcel_Cell::coordinateFromString($dimension[1]);
- $dimension[1][0] = PHPExcel_Cell::columnIndexFromString($dimension[1][0]) - 1;
+ $dimension[0] = Coordinate::coordinateFromString($dimension[0]);
+ $dimension[0][0] = Coordinate::columnIndexFromString($dimension[0][0]);
+ $dimension[1] = Coordinate::coordinateFromString($dimension[1]);
+ $dimension[1][0] = Coordinate::columnIndexFromString($dimension[1][0]);
// row min,max
$rowMin = $dimension[0][1];
@@ -432,20 +434,20 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
// calculate start of ,
$tbodyStart = $rowMin;
- $theadStart = $theadEnd = 0; // default: no no
+ $theadStart = $theadEnd = 0; // default: no no
if ($sheet->getPageSetup()->isRowsToRepeatAtTopSet()) {
$rowsToRepeatAtTop = $sheet->getPageSetup()->getRowsToRepeatAtTop();
// we can only support repeating rows that start at top row
if ($rowsToRepeatAtTop[0] == 1) {
$theadStart = $rowsToRepeatAtTop[0];
- $theadEnd = $rowsToRepeatAtTop[1];
+ $theadEnd = $rowsToRepeatAtTop[1];
$tbodyStart = $rowsToRepeatAtTop[1] + 1;
}
}
// Loop through cells
- $row = $rowMin-1;
+ $row = $rowMin - 1;
while ($row++ < $rowMax) {
// ?
if ($row == $theadStart) {
@@ -462,16 +464,17 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
// Write row if there are HTML table cells in it
if (!isset($this->isSpannedRow[$sheet->getParent()->getIndex($sheet)][$row])) {
// Start a new rowData
- $rowData = array();
+ $rowData = [];
// Loop through columns
- $column = $dimension[0][0] - 1;
- while ($column++ < $dimension[1][0]) {
+ $column = $dimension[0][0];
+ while ($column <= $dimension[1][0]) {
// Cell exists?
if ($sheet->cellExistsByColumnAndRow($column, $row)) {
- $rowData[$column] = PHPExcel_Cell::stringFromColumnIndex($column) . $row;
+ $rowData[$column] = Coordinate::stringFromColumnIndex($column) . $row;
} else {
$rowData[$column] = '';
}
+ ++$column;
}
$html .= $this->generateRow($sheet, $rowData, $row - 1, $cellType);
}
@@ -491,7 +494,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
// Writing PDF?
if ($this->isPdf) {
- if (is_null($this->sheetIndex) && $sheetId + 1 < $this->phpExcel->getSheetCount()) {
+ if ($this->sheetIndex === null && $sheetId + 1 < $this->spreadsheet->getSheetCount()) {
$html .= '';
}
}
@@ -504,24 +507,20 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Generate sheet tabs
+ * Generate sheet tabs.
*
- * @return string
- * @throws PHPExcel_Writer_Exception
+ * @throws WriterException
+ *
+ * @return string
*/
public function generateNavigation()
{
- // PHPExcel object known?
- if (is_null($this->phpExcel)) {
- throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.');
- }
-
// Fetch sheets
- $sheets = array();
- if (is_null($this->sheetIndex)) {
- $sheets = $this->phpExcel->getAllSheets();
+ $sheets = [];
+ if ($this->sheetIndex === null) {
+ $sheets = $this->spreadsheet->getAllSheets();
} else {
- $sheets[] = $this->phpExcel->getSheet($this->sheetIndex);
+ $sheets[] = $this->spreadsheet->getSheet($this->sheetIndex);
}
// Construct HTML
@@ -545,19 +544,19 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
return $html;
}
- private function extendRowsForChartsAndImages(PHPExcel_Worksheet $pSheet, $row)
+ private function extendRowsForChartsAndImages(Worksheet $pSheet, $row)
{
$rowMax = $row;
$colMax = 'A';
if ($this->includeCharts) {
foreach ($pSheet->getChartCollection() as $chart) {
- if ($chart instanceof PHPExcel_Chart) {
+ if ($chart instanceof Chart) {
$chartCoordinates = $chart->getTopLeftPosition();
- $chartTL = PHPExcel_Cell::coordinateFromString($chartCoordinates['cell']);
- $chartCol = PHPExcel_Cell::columnIndexFromString($chartTL[0]);
+ $chartTL = Coordinate::coordinateFromString($chartCoordinates['cell']);
+ $chartCol = Coordinate::columnIndexFromString($chartTL[0]);
if ($chartTL[1] > $rowMax) {
$rowMax = $chartTL[1];
- if ($chartCol > PHPExcel_Cell::columnIndexFromString($colMax)) {
+ if ($chartCol > Coordinate::columnIndexFromString($colMax)) {
$colMax = $chartTL[0];
}
}
@@ -566,53 +565,59 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
foreach ($pSheet->getDrawingCollection() as $drawing) {
- if ($drawing instanceof PHPExcel_Worksheet_Drawing) {
- $imageTL = PHPExcel_Cell::coordinateFromString($drawing->getCoordinates());
- $imageCol = PHPExcel_Cell::columnIndexFromString($imageTL[0]);
+ if ($drawing instanceof Drawing) {
+ $imageTL = Coordinate::coordinateFromString($drawing->getCoordinates());
+ $imageCol = Coordinate::columnIndexFromString($imageTL[0]);
if ($imageTL[1] > $rowMax) {
$rowMax = $imageTL[1];
- if ($imageCol > PHPExcel_Cell::columnIndexFromString($colMax)) {
+ if ($imageCol > Coordinate::columnIndexFromString($colMax)) {
$colMax = $imageTL[0];
}
}
}
}
+ // Don't extend rows if not needed
+ if ($row === $rowMax) {
+ return '';
+ }
+
$html = '';
- $colMax++;
+ ++$colMax;
+
while ($row <= $rowMax) {
$html .= '';
for ($col = 'A'; $col != $colMax; ++$col) {
$html .= '| ';
- $html .= $this->writeImageInCell($pSheet, $col.$row);
+ $html .= $this->writeImageInCell($pSheet, $col . $row);
if ($this->includeCharts) {
- $html .= $this->writeChartInCell($pSheet, $col.$row);
+ $html .= $this->writeChartInCell($pSheet, $col . $row);
}
$html .= ' | ';
}
++$row;
$html .= '
';
}
+
return $html;
}
-
/**
- * Generate image tag in cell
+ * Generate image tag in cell.
*
- * @param PHPExcel_Worksheet $pSheet PHPExcel_Worksheet
- * @param string $coordinates Cell coordinates
- * @return string
- * @throws PHPExcel_Writer_Exception
+ * @param Worksheet $pSheet \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
+ * @param string $coordinates Cell coordinates
+ *
+ * @return string
*/
- private function writeImageInCell(PHPExcel_Worksheet $pSheet, $coordinates)
+ private function writeImageInCell(Worksheet $pSheet, $coordinates)
{
// Construct HTML
$html = '';
// Write images
foreach ($pSheet->getDrawingCollection() as $drawing) {
- if ($drawing instanceof PHPExcel_Worksheet_Drawing) {
+ if ($drawing instanceof Drawing) {
if ($drawing->getCoordinates() == $coordinates) {
$filename = $drawing->getPath();
@@ -637,13 +642,13 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
$imageData = $filename;
} else {
$imageDetails = getimagesize($filename);
- if ($fp = fopen($filename, "rb", 0)) {
+ if ($fp = fopen($filename, 'rb', 0)) {
$picture = fread($fp, filesize($filename));
fclose($fp);
// base64 encode the binary data, then break it
// into chunks according to RFC 2045 semantics
$base64 = chunk_split(base64_encode($picture));
- $imageData = 'data:'.$imageDetails['mime'].';base64,' . $base64;
+ $imageData = 'data:' . $imageDetails['mime'] . ';base64,' . $base64;
} else {
$imageData = $filename;
}
@@ -656,6 +661,22 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
$imageData . '" border="0" />';
$html .= '';
}
+ } elseif ($drawing instanceof MemoryDrawing) {
+ if ($drawing->getCoordinates() != $coordinates) {
+ continue;
+ }
+ ob_start(); // Let's start output buffering.
+ imagepng($drawing->getImageResource()); // This will normally output the image, but because of ob_start(), it won't.
+ $contents = ob_get_contents(); // Instead, output above is saved to $contents
+ ob_end_clean(); // End the output buffer.
+
+ $dataUri = 'data:image/jpeg;base64,' . base64_encode($contents);
+
+ // Because of the nature of tables, width is more important than height.
+ // max-width: 100% ensures that image doesnt overflow containing cell
+ // width: X sets width of supplied image.
+ // As a result, images bigger than cell will be contained and images smaller will not get stretched
+ $html .= '
';
}
}
@@ -663,37 +684,37 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Generate chart tag in cell
+ * Generate chart tag in cell.
*
- * @param PHPExcel_Worksheet $pSheet PHPExcel_Worksheet
- * @param string $coordinates Cell coordinates
- * @return string
- * @throws PHPExcel_Writer_Exception
+ * @param Worksheet $pSheet \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
+ * @param string $coordinates Cell coordinates
+ *
+ * @return string
*/
- private function writeChartInCell(PHPExcel_Worksheet $pSheet, $coordinates)
+ private function writeChartInCell(Worksheet $pSheet, $coordinates)
{
// Construct HTML
$html = '';
// Write charts
foreach ($pSheet->getChartCollection() as $chart) {
- if ($chart instanceof PHPExcel_Chart) {
+ if ($chart instanceof Chart) {
$chartCoordinates = $chart->getTopLeftPosition();
if ($chartCoordinates['cell'] == $coordinates) {
- $chartFileName = PHPExcel_Shared_File::sys_get_temp_dir().'/'.uniqid().'.png';
+ $chartFileName = File::sysGetTempDir() . '/' . uniqid('', true) . '.png';
if (!$chart->render($chartFileName)) {
return;
}
$html .= PHP_EOL;
$imageDetails = getimagesize($chartFileName);
- if ($fp = fopen($chartFileName, "rb", 0)) {
+ if ($fp = fopen($chartFileName, 'rb', 0)) {
$picture = fread($fp, filesize($chartFileName));
fclose($fp);
// base64 encode the binary data, then break it
// into chunks according to RFC 2045 semantics
$base64 = chunk_split(base64_encode($picture));
- $imageData = 'data:'.$imageDetails['mime'].';base64,' . $base64;
+ $imageData = 'data:' . $imageDetails['mime'] . ';base64,' . $base64;
$html .= '';
$html .= '

' . PHP_EOL;
@@ -710,19 +731,16 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Generate CSS styles
+ * Generate CSS styles.
*
- * @param boolean $generateSurroundingHTML Generate surrounding HTML tags? (<style> and </style>)
- * @return string
- * @throws PHPExcel_Writer_Exception
+ * @param bool $generateSurroundingHTML Generate surrounding HTML tags? (<style> and </style>)
+ *
+ * @throws WriterException
+ *
+ * @return string
*/
public function generateStyles($generateSurroundingHTML = true)
{
- // PHPExcel object known?
- if (is_null($this->phpExcel)) {
- throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.');
- }
-
// Build CSS
$css = $this->buildCSS($generateSurroundingHTML);
@@ -752,21 +770,18 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Build CSS styles
+ * Build CSS styles.
*
- * @param boolean $generateSurroundingHTML Generate surrounding HTML style? (html { })
- * @return array
- * @throws PHPExcel_Writer_Exception
+ * @param bool $generateSurroundingHTML Generate surrounding HTML style? (html { })
+ *
+ * @throws WriterException
+ *
+ * @return array
*/
public function buildCSS($generateSurroundingHTML = true)
{
- // PHPExcel object known?
- if (is_null($this->phpExcel)) {
- throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.');
- }
-
// Cached?
- if (!is_null($this->cssStyles)) {
+ if ($this->cssStyles !== null) {
return $this->cssStyles;
}
@@ -776,19 +791,37 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
// Construct CSS
- $css = array();
+ $css = [];
// Start styles
if ($generateSurroundingHTML) {
// html { }
- $css['html']['font-family'] = 'Calibri, Arial, Helvetica, sans-serif';
- $css['html']['font-size'] = '11pt';
+ $css['html']['font-family'] = 'Calibri, Arial, Helvetica, sans-serif';
+ $css['html']['font-size'] = '11pt';
$css['html']['background-color'] = 'white';
}
+ // CSS for comments as found in LibreOffice
+ $css['a.comment-indicator:hover + div.comment'] = [
+ 'background' => '#ffd',
+ 'position' => 'absolute',
+ 'display' => 'block',
+ 'border' => '1px solid black',
+ 'padding' => '0.5em',
+ ];
+
+ $css['a.comment-indicator'] = [
+ 'background' => 'red',
+ 'display' => 'inline-block',
+ 'border' => '1px solid black',
+ 'width' => '0.5em',
+ 'height' => '0.5em',
+ ];
+
+ $css['div.comment']['display'] = 'none';
// table { }
- $css['table']['border-collapse'] = 'collapse';
+ $css['table']['border-collapse'] = 'collapse';
if (!$this->isPdf) {
$css['table']['page-break-after'] = 'always';
}
@@ -816,17 +849,17 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
$css['.s']['text-align'] = 'left'; // STRING
// Calculate cell style hashes
- foreach ($this->phpExcel->getCellXfCollection() as $index => $style) {
+ foreach ($this->spreadsheet->getCellXfCollection() as $index => $style) {
$css['td.style' . $index] = $this->createCSSStyle($style);
$css['th.style' . $index] = $this->createCSSStyle($style);
}
// Fetch sheets
- $sheets = array();
- if (is_null($this->sheetIndex)) {
- $sheets = $this->phpExcel->getAllSheets();
+ $sheets = [];
+ if ($this->sheetIndex === null) {
+ $sheets = $this->spreadsheet->getAllSheets();
} else {
- $sheets[] = $this->phpExcel->getSheet($this->sheetIndex);
+ $sheets[] = $this->spreadsheet->getSheet($this->sheetIndex);
}
// Build styles per sheet
@@ -839,7 +872,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
$sheet->calculateColumnWidths();
// col elements, initialize
- $highestColumnIndex = PHPExcel_Cell::columnIndexFromString($sheet->getHighestColumn()) - 1;
+ $highestColumnIndex = Coordinate::columnIndexFromString($sheet->getHighestColumn()) - 1;
$column = -1;
while ($column++ < $highestColumnIndex) {
$this->columnWidths[$sheetIndex][$column] = 42; // approximation
@@ -848,9 +881,9 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
// col elements, loop through columnDimensions and set width
foreach ($sheet->getColumnDimensions() as $columnDimension) {
- if (($width = PHPExcel_Shared_Drawing::cellDimensionToPixels($columnDimension->getWidth(), $this->defaultFont)) >= 0) {
- $width = PHPExcel_Shared_Drawing::pixelsToPoints($width);
- $column = PHPExcel_Cell::columnIndexFromString($columnDimension->getColumnIndex()) - 1;
+ if (($width = SharedDrawing::cellDimensionToPixels($columnDimension->getWidth(), $this->defaultFont)) >= 0) {
+ $width = SharedDrawing::pixelsToPoints($width);
+ $column = Coordinate::columnIndexFromString($columnDimension->getColumnIndex()) - 1;
$this->columnWidths[$sheetIndex][$column] = $width;
$css['table.sheet' . $sheetIndex . ' col.col' . $column]['width'] = $width . 'pt';
@@ -865,16 +898,16 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
$rowDimension = $sheet->getDefaultRowDimension();
// table.sheetN tr { }
- $css['table.sheet' . $sheetIndex . ' tr'] = array();
+ $css['table.sheet' . $sheetIndex . ' tr'] = [];
if ($rowDimension->getRowHeight() == -1) {
- $pt_height = PHPExcel_Shared_Font::getDefaultRowHeightByFont($this->phpExcel->getDefaultStyle()->getFont());
+ $pt_height = SharedFont::getDefaultRowHeightByFont($this->spreadsheet->getDefaultStyle()->getFont());
} else {
$pt_height = $rowDimension->getRowHeight();
}
$css['table.sheet' . $sheetIndex . ' tr']['height'] = $pt_height . 'pt';
if ($rowDimension->getVisible() === false) {
- $css['table.sheet' . $sheetIndex . ' tr']['display'] = 'none';
+ $css['table.sheet' . $sheetIndex . ' tr']['display'] = 'none';
$css['table.sheet' . $sheetIndex . ' tr']['visibility'] = 'hidden';
}
@@ -883,10 +916,10 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
$row = $rowDimension->getRowIndex() - 1;
// table.sheetN tr.rowYYYYYY { }
- $css['table.sheet' . $sheetIndex . ' tr.row' . $row] = array();
+ $css['table.sheet' . $sheetIndex . ' tr.row' . $row] = [];
if ($rowDimension->getRowHeight() == -1) {
- $pt_height = PHPExcel_Shared_Font::getDefaultRowHeightByFont($this->phpExcel->getDefaultStyle()->getFont());
+ $pt_height = SharedFont::getDefaultRowHeightByFont($this->spreadsheet->getDefaultStyle()->getFont());
} else {
$pt_height = $rowDimension->getRowHeight();
}
@@ -899,7 +932,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
// Cache
- if (is_null($this->cssStyles)) {
+ if ($this->cssStyles === null) {
$this->cssStyles = $css;
}
@@ -908,16 +941,14 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Create CSS style
+ * Create CSS style.
*
- * @param PHPExcel_Style $pStyle PHPExcel_Style
- * @return array
+ * @param Style $pStyle
+ *
+ * @return array
*/
- private function createCSSStyle(PHPExcel_Style $pStyle)
+ private function createCSSStyle(Style $pStyle)
{
- // Construct CSS
- $css = '';
-
// Create CSS
$css = array_merge(
$this->createCSSStyleAlignment($pStyle->getAlignment()),
@@ -931,22 +962,23 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Create CSS style (PHPExcel_Style_Alignment)
+ * Create CSS style (\PhpOffice\PhpSpreadsheet\Style\Alignment).
*
- * @param PHPExcel_Style_Alignment $pStyle PHPExcel_Style_Alignment
- * @return array
+ * @param Alignment $pStyle \PhpOffice\PhpSpreadsheet\Style\Alignment
+ *
+ * @return array
*/
- private function createCSSStyleAlignment(PHPExcel_Style_Alignment $pStyle)
+ private function createCSSStyleAlignment(Alignment $pStyle)
{
// Construct CSS
- $css = array();
+ $css = [];
// Create CSS
$css['vertical-align'] = $this->mapVAlign($pStyle->getVertical());
if ($textAlign = $this->mapHAlign($pStyle->getHorizontal())) {
$css['text-align'] = $textAlign;
- if (in_array($textAlign, array('left', 'right'))) {
- $css['padding-'.$textAlign] = (string)((int)$pStyle->getIndent() * 9).'px';
+ if (in_array($textAlign, ['left', 'right'])) {
+ $css['padding-' . $textAlign] = (string) ((int) $pStyle->getIndent() * 9) . 'px';
}
}
@@ -954,23 +986,24 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Create CSS style (PHPExcel_Style_Font)
+ * Create CSS style (\PhpOffice\PhpSpreadsheet\Style\Font).
*
- * @param PHPExcel_Style_Font $pStyle PHPExcel_Style_Font
- * @return array
+ * @param Font $pStyle
+ *
+ * @return array
*/
- private function createCSSStyleFont(PHPExcel_Style_Font $pStyle)
+ private function createCSSStyleFont(Font $pStyle)
{
// Construct CSS
- $css = array();
+ $css = [];
// Create CSS
if ($pStyle->getBold()) {
$css['font-weight'] = 'bold';
}
- if ($pStyle->getUnderline() != PHPExcel_Style_Font::UNDERLINE_NONE && $pStyle->getStrikethrough()) {
+ if ($pStyle->getUnderline() != Font::UNDERLINE_NONE && $pStyle->getStrikethrough()) {
$css['text-decoration'] = 'underline line-through';
- } elseif ($pStyle->getUnderline() != PHPExcel_Style_Font::UNDERLINE_NONE) {
+ } elseif ($pStyle->getUnderline() != Font::UNDERLINE_NONE) {
$css['text-decoration'] = 'underline';
} elseif ($pStyle->getStrikethrough()) {
$css['text-decoration'] = 'line-through';
@@ -979,43 +1012,43 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
$css['font-style'] = 'italic';
}
- $css['color'] = '#' . $pStyle->getColor()->getRGB();
+ $css['color'] = '#' . $pStyle->getColor()->getRGB();
$css['font-family'] = '\'' . $pStyle->getName() . '\'';
- $css['font-size'] = $pStyle->getSize() . 'pt';
+ $css['font-size'] = $pStyle->getSize() . 'pt';
return $css;
}
/**
- * Create CSS style (PHPExcel_Style_Borders)
+ * Create CSS style (Borders).
*
- * @param PHPExcel_Style_Borders $pStyle PHPExcel_Style_Borders
- * @return array
+ * @param Borders $pStyle Borders
+ *
+ * @return array
*/
- private function createCSSStyleBorders(PHPExcel_Style_Borders $pStyle)
+ private function createCSSStyleBorders(Borders $pStyle)
{
// Construct CSS
- $css = array();
+ $css = [];
// Create CSS
$css['border-bottom'] = $this->createCSSStyleBorder($pStyle->getBottom());
- $css['border-top'] = $this->createCSSStyleBorder($pStyle->getTop());
- $css['border-left'] = $this->createCSSStyleBorder($pStyle->getLeft());
- $css['border-right'] = $this->createCSSStyleBorder($pStyle->getRight());
+ $css['border-top'] = $this->createCSSStyleBorder($pStyle->getTop());
+ $css['border-left'] = $this->createCSSStyleBorder($pStyle->getLeft());
+ $css['border-right'] = $this->createCSSStyleBorder($pStyle->getRight());
return $css;
}
/**
- * Create CSS style (PHPExcel_Style_Border)
+ * Create CSS style (Border).
*
- * @param PHPExcel_Style_Border $pStyle PHPExcel_Style_Border
- * @return string
+ * @param Border $pStyle Border
+ *
+ * @return string
*/
- private function createCSSStyleBorder(PHPExcel_Style_Border $pStyle)
+ private function createCSSStyleBorder(Border $pStyle)
{
- // Create CSS
-// $css = $this->mapBorderStyle($pStyle->getBorderStyle()) . ' #' . $pStyle->getColor()->getRGB();
// Create CSS - add !important to non-none border styles for merged cells
$borderStyle = $this->mapBorderStyle($pStyle->getBorderStyle());
$css = $borderStyle . ' #' . $pStyle->getColor()->getRGB() . (($borderStyle == 'none') ? '' : ' !important');
@@ -1024,18 +1057,19 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Create CSS style (PHPExcel_Style_Fill)
+ * Create CSS style (Fill).
*
- * @param PHPExcel_Style_Fill $pStyle PHPExcel_Style_Fill
- * @return array
+ * @param Fill $pStyle Fill
+ *
+ * @return array
*/
- private function createCSSStyleFill(PHPExcel_Style_Fill $pStyle)
+ private function createCSSStyleFill(Fill $pStyle)
{
// Construct HTML
- $css = array();
+ $css = [];
// Create CSS
- $value = $pStyle->getFillType() == PHPExcel_Style_Fill::FILL_NONE ?
+ $value = $pStyle->getFillType() == Fill::FILL_NONE ?
'white' : '#' . $pStyle->getStartColor()->getRGB();
$css['background-color'] = $value;
@@ -1043,7 +1077,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Generate HTML footer
+ * Generate HTML footer.
*/
public function generateHTMLFooter()
{
@@ -1056,11 +1090,11 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Generate table header
+ * Generate table header.
*
- * @param PHPExcel_Worksheet $pSheet The worksheet for the table we are writing
- * @return string
- * @throws PHPExcel_Writer_Exception
+ * @param Worksheet $pSheet The worksheet for the table we are writing
+ *
+ * @return string
*/
private function generateTableHeader($pSheet)
{
@@ -1069,7 +1103,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
// Construct HTML
$html = '';
$html .= $this->setMargins($pSheet);
-
+
if (!$this->useInlineCss) {
$gridlines = $pSheet->getShowGridlines() ? ' gridlines' : '';
$html .= '
' . PHP_EOL;
@@ -1085,7 +1119,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
// Write elements
- $highestColumnIndex = PHPExcel_Cell::columnIndexFromString($pSheet->getHighestColumn()) - 1;
+ $highestColumnIndex = Coordinate::columnIndexFromString($pSheet->getHighestColumn()) - 1;
$i = -1;
while ($i++ < $highestColumnIndex) {
if (!$this->isPdf) {
@@ -1103,9 +1137,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Generate table footer
- *
- * @throws PHPExcel_Writer_Exception
+ * Generate table footer.
*/
private function generateTableFooter()
{
@@ -1115,266 +1147,268 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Generate row
+ * Generate row.
*
- * @param PHPExcel_Worksheet $pSheet PHPExcel_Worksheet
- * @param array $pValues Array containing cells in a row
- * @param int $pRow Row number (0-based)
- * @return string
- * @throws PHPExcel_Writer_Exception
+ * @param Worksheet $pSheet \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet
+ * @param array $pValues Array containing cells in a row
+ * @param int $pRow Row number (0-based)
+ * @param string $cellType eg: 'td'
+ *
+ * @throws WriterException
+ *
+ * @return string
*/
- private function generateRow(PHPExcel_Worksheet $pSheet, $pValues = null, $pRow = 0, $cellType = 'td')
+ private function generateRow(Worksheet $pSheet, array $pValues, $pRow, $cellType)
{
- if (is_array($pValues)) {
- // Construct HTML
- $html = '';
+ // Construct HTML
+ $html = '';
- // Sheet index
- $sheetIndex = $pSheet->getParent()->getIndex($pSheet);
+ // Sheet index
+ $sheetIndex = $pSheet->getParent()->getIndex($pSheet);
- // DomPDF and breaks
- if ($this->isPdf && count($pSheet->getBreaks()) > 0) {
- $breaks = $pSheet->getBreaks();
+ // Dompdf and breaks
+ if ($this->isPdf && count($pSheet->getBreaks()) > 0) {
+ $breaks = $pSheet->getBreaks();
- // check if a break is needed before this row
- if (isset($breaks['A' . $pRow])) {
- // close table:
- $html .= $this->generateTableFooter();
+ // check if a break is needed before this row
+ if (isset($breaks['A' . $pRow])) {
+ // close table:
+ $html .= $this->generateTableFooter();
- // insert page break
- $html .= '
';
+ // insert page break
+ $html .= '
';
- // open table again:
+ etc.
- $html .= $this->generateTableHeader($pSheet);
- }
+ // open table again: + etc.
+ $html .= $this->generateTableHeader($pSheet);
}
-
- // Write row start
- if (!$this->useInlineCss) {
- $html .= ' ' . PHP_EOL;
- } else {
- $style = isset($this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow])
- ? $this->assembleCSS($this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]) : '';
-
- $html .= '
' . PHP_EOL;
- }
-
- // Write cells
- $colNum = 0;
- foreach ($pValues as $cellAddress) {
- $cell = ($cellAddress > '') ? $pSheet->getCell($cellAddress) : '';
- $coordinate = PHPExcel_Cell::stringFromColumnIndex($colNum) . ($pRow + 1);
- if (!$this->useInlineCss) {
- $cssClass = '';
- $cssClass = 'column' . $colNum;
- } else {
- $cssClass = array();
- if ($cellType == 'th') {
- if (isset($this->cssStyles['table.sheet' . $sheetIndex . ' th.column' . $colNum])) {
- $this->cssStyles['table.sheet' . $sheetIndex . ' th.column' . $colNum];
- }
- } else {
- if (isset($this->cssStyles['table.sheet' . $sheetIndex . ' td.column' . $colNum])) {
- $this->cssStyles['table.sheet' . $sheetIndex . ' td.column' . $colNum];
- }
- }
- }
- $colSpan = 1;
- $rowSpan = 1;
-
- // initialize
- $cellData = ' ';
-
- // PHPExcel_Cell
- if ($cell instanceof PHPExcel_Cell) {
- $cellData = '';
- if (is_null($cell->getParent())) {
- $cell->attach($pSheet);
- }
- // Value
- if ($cell->getValue() instanceof PHPExcel_RichText) {
- // Loop through rich text elements
- $elements = $cell->getValue()->getRichTextElements();
- foreach ($elements as $element) {
- // Rich text start?
- if ($element instanceof PHPExcel_RichText_Run) {
- $cellData .= '';
-
- if ($element->getFont()->getSuperScript()) {
- $cellData .= '';
- } elseif ($element->getFont()->getSubScript()) {
- $cellData .= '';
- }
- }
-
- // Convert UTF8 data to PCDATA
- $cellText = $element->getText();
- $cellData .= htmlspecialchars($cellText);
-
- if ($element instanceof PHPExcel_RichText_Run) {
- if ($element->getFont()->getSuperScript()) {
- $cellData .= '';
- } elseif ($element->getFont()->getSubScript()) {
- $cellData .= '';
- }
-
- $cellData .= '';
- }
- }
- } else {
- if ($this->preCalculateFormulas) {
- $cellData = PHPExcel_Style_NumberFormat::toFormattedString(
- $cell->getCalculatedValue(),
- $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode(),
- array($this, 'formatColor')
- );
- } else {
- $cellData = PHPExcel_Style_NumberFormat::toFormattedString(
- $cell->getValue(),
- $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode(),
- array($this, 'formatColor')
- );
- }
- $cellData = htmlspecialchars($cellData);
- if ($pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont()->getSuperScript()) {
- $cellData = ''.$cellData.'';
- } elseif ($pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont()->getSubScript()) {
- $cellData = ''.$cellData.'';
- }
- }
-
- // Converts the cell content so that spaces occuring at beginning of each new line are replaced by
- // Example: " Hello\n to the world" is converted to " Hello\n to the world"
- $cellData = preg_replace("/(?m)(?:^|\\G) /", ' ', $cellData);
-
- // convert newline "\n" to '
'
- $cellData = nl2br($cellData);
-
- // Extend CSS class?
- if (!$this->useInlineCss) {
- $cssClass .= ' style' . $cell->getXfIndex();
- $cssClass .= ' ' . $cell->getDataType();
- } else {
- if ($cellType == 'th') {
- if (isset($this->cssStyles['th.style' . $cell->getXfIndex()])) {
- $cssClass = array_merge($cssClass, $this->cssStyles['th.style' . $cell->getXfIndex()]);
- }
- } else {
- if (isset($this->cssStyles['td.style' . $cell->getXfIndex()])) {
- $cssClass = array_merge($cssClass, $this->cssStyles['td.style' . $cell->getXfIndex()]);
- }
- }
-
- // General horizontal alignment: Actual horizontal alignment depends on dataType
- $sharedStyle = $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex());
- if ($sharedStyle->getAlignment()->getHorizontal() == PHPExcel_Style_Alignment::HORIZONTAL_GENERAL
- && isset($this->cssStyles['.' . $cell->getDataType()]['text-align'])) {
- $cssClass['text-align'] = $this->cssStyles['.' . $cell->getDataType()]['text-align'];
- }
- }
- }
-
- // Hyperlink?
- if ($pSheet->hyperlinkExists($coordinate) && !$pSheet->getHyperlink($coordinate)->isInternal()) {
- $cellData = '' . $cellData . '';
- }
-
- // Should the cell be written or is it swallowed by a rowspan or colspan?
- $writeCell = !(isset($this->isSpannedCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum])
- && $this->isSpannedCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum]);
-
- // Colspan and Rowspan
- $colspan = 1;
- $rowspan = 1;
- if (isset($this->isBaseCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum])) {
- $spans = $this->isBaseCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum];
- $rowSpan = $spans['rowspan'];
- $colSpan = $spans['colspan'];
-
- // Also apply style from last cell in merge to fix borders -
- // relies on !important for non-none border declarations in createCSSStyleBorder
- $endCellCoord = PHPExcel_Cell::stringFromColumnIndex($colNum + $colSpan - 1) . ($pRow + $rowSpan);
- if (!$this->useInlineCss) {
- $cssClass .= ' style' . $pSheet->getCell($endCellCoord)->getXfIndex();
- }
- }
-
- // Write
- if ($writeCell) {
- // Column start
- $html .= ' <' . $cellType;
- if (!$this->useInlineCss) {
- $html .= ' class="' . $cssClass . '"';
- } else {
- //** Necessary redundant code for the sake of PHPExcel_Writer_PDF **
- // We must explicitly write the width of the element because TCPDF
- // does not recognize e.g.
- $width = 0;
- $i = $colNum - 1;
- $e = $colNum + $colSpan - 1;
- while ($i++ < $e) {
- if (isset($this->columnWidths[$sheetIndex][$i])) {
- $width += $this->columnWidths[$sheetIndex][$i];
- }
- }
- $cssClass['width'] = $width . 'pt';
-
- // We must also explicitly write the height of the | element because TCPDF
- // does not recognize e.g. |
- if (isset($this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]['height'])) {
- $height = $this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]['height'];
- $cssClass['height'] = $height;
- }
- //** end of redundant code **
-
- $html .= ' style="' . $this->assembleCSS($cssClass) . '"';
- }
- if ($colSpan > 1) {
- $html .= ' colspan="' . $colSpan . '"';
- }
- if ($rowSpan > 1) {
- $html .= ' rowspan="' . $rowSpan . '"';
- }
- $html .= '>';
-
- // Image?
- $html .= $this->writeImageInCell($pSheet, $coordinate);
-
- // Chart?
- if ($this->includeCharts) {
- $html .= $this->writeChartInCell($pSheet, $coordinate);
- }
-
- // Cell data
- $html .= $cellData;
-
- // Column end
- $html .= ''.$cellType.'>' . PHP_EOL;
- }
-
- // Next column
- ++$colNum;
- }
-
- // Write row end
- $html .= '
' . PHP_EOL;
-
- // Return
- return $html;
- } else {
- throw new PHPExcel_Writer_Exception("Invalid parameters passed.");
}
+
+ // Write row start
+ if (!$this->useInlineCss) {
+ $html .= ' ' . PHP_EOL;
+ } else {
+ $style = isset($this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow])
+ ? $this->assembleCSS($this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]) : '';
+
+ $html .= '
' . PHP_EOL;
+ }
+
+ // Write cells
+ $colNum = 0;
+ foreach ($pValues as $cellAddress) {
+ $cell = ($cellAddress > '') ? $pSheet->getCell($cellAddress) : '';
+ $coordinate = Coordinate::stringFromColumnIndex($colNum + 1) . ($pRow + 1);
+ if (!$this->useInlineCss) {
+ $cssClass = 'column' . $colNum;
+ } else {
+ $cssClass = [];
+ if ($cellType == 'th') {
+ if (isset($this->cssStyles['table.sheet' . $sheetIndex . ' th.column' . $colNum])) {
+ $this->cssStyles['table.sheet' . $sheetIndex . ' th.column' . $colNum];
+ }
+ } else {
+ if (isset($this->cssStyles['table.sheet' . $sheetIndex . ' td.column' . $colNum])) {
+ $this->cssStyles['table.sheet' . $sheetIndex . ' td.column' . $colNum];
+ }
+ }
+ }
+ $colSpan = 1;
+ $rowSpan = 1;
+
+ // initialize
+ $cellData = ' ';
+
+ // Cell
+ if ($cell instanceof Cell) {
+ $cellData = '';
+ if ($cell->getParent() === null) {
+ $cell->attach($pSheet);
+ }
+ // Value
+ if ($cell->getValue() instanceof RichText) {
+ // Loop through rich text elements
+ $elements = $cell->getValue()->getRichTextElements();
+ foreach ($elements as $element) {
+ // Rich text start?
+ if ($element instanceof Run) {
+ $cellData .= '';
+
+ if ($element->getFont()->getSuperscript()) {
+ $cellData .= '';
+ } elseif ($element->getFont()->getSubscript()) {
+ $cellData .= '';
+ }
+ }
+
+ // Convert UTF8 data to PCDATA
+ $cellText = $element->getText();
+ $cellData .= htmlspecialchars($cellText);
+
+ if ($element instanceof Run) {
+ if ($element->getFont()->getSuperscript()) {
+ $cellData .= '';
+ } elseif ($element->getFont()->getSubscript()) {
+ $cellData .= '';
+ }
+
+ $cellData .= '';
+ }
+ }
+ } else {
+ if ($this->preCalculateFormulas) {
+ $cellData = NumberFormat::toFormattedString(
+ $cell->getCalculatedValue(),
+ $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode(),
+ [$this, 'formatColor']
+ );
+ } else {
+ $cellData = NumberFormat::toFormattedString(
+ $cell->getValue(),
+ $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getNumberFormat()->getFormatCode(),
+ [$this, 'formatColor']
+ );
+ }
+ $cellData = htmlspecialchars($cellData);
+ if ($pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont()->getSuperscript()) {
+ $cellData = '' . $cellData . '';
+ } elseif ($pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont()->getSubscript()) {
+ $cellData = '' . $cellData . '';
+ }
+ }
+
+ // Converts the cell content so that spaces occuring at beginning of each new line are replaced by
+ // Example: " Hello\n to the world" is converted to " Hello\n to the world"
+ $cellData = preg_replace('/(?m)(?:^|\\G) /', ' ', $cellData);
+
+ // convert newline "\n" to '
'
+ $cellData = nl2br($cellData);
+
+ // Extend CSS class?
+ if (!$this->useInlineCss) {
+ $cssClass .= ' style' . $cell->getXfIndex();
+ $cssClass .= ' ' . $cell->getDataType();
+ } else {
+ if ($cellType == 'th') {
+ if (isset($this->cssStyles['th.style' . $cell->getXfIndex()])) {
+ $cssClass = array_merge($cssClass, $this->cssStyles['th.style' . $cell->getXfIndex()]);
+ }
+ } else {
+ if (isset($this->cssStyles['td.style' . $cell->getXfIndex()])) {
+ $cssClass = array_merge($cssClass, $this->cssStyles['td.style' . $cell->getXfIndex()]);
+ }
+ }
+
+ // General horizontal alignment: Actual horizontal alignment depends on dataType
+ $sharedStyle = $pSheet->getParent()->getCellXfByIndex($cell->getXfIndex());
+ if ($sharedStyle->getAlignment()->getHorizontal() == Alignment::HORIZONTAL_GENERAL
+ && isset($this->cssStyles['.' . $cell->getDataType()]['text-align'])
+ ) {
+ $cssClass['text-align'] = $this->cssStyles['.' . $cell->getDataType()]['text-align'];
+ }
+ }
+ }
+
+ // Hyperlink?
+ if ($pSheet->hyperlinkExists($coordinate) && !$pSheet->getHyperlink($coordinate)->isInternal()) {
+ $cellData = '' . $cellData . '';
+ }
+
+ // Should the cell be written or is it swallowed by a rowspan or colspan?
+ $writeCell = !(isset($this->isSpannedCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum])
+ && $this->isSpannedCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum]);
+
+ // Colspan and Rowspan
+ $colspan = 1;
+ $rowspan = 1;
+ if (isset($this->isBaseCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum])) {
+ $spans = $this->isBaseCell[$pSheet->getParent()->getIndex($pSheet)][$pRow + 1][$colNum];
+ $rowSpan = $spans['rowspan'];
+ $colSpan = $spans['colspan'];
+
+ // Also apply style from last cell in merge to fix borders -
+ // relies on !important for non-none border declarations in createCSSStyleBorder
+ $endCellCoord = Coordinate::stringFromColumnIndex($colNum + $colSpan) . ($pRow + $rowSpan);
+ if (!$this->useInlineCss) {
+ $cssClass .= ' style' . $pSheet->getCell($endCellCoord)->getXfIndex();
+ }
+ }
+
+ // Write
+ if ($writeCell) {
+ // Column start
+ $html .= ' <' . $cellType;
+ if (!$this->useInlineCss) {
+ $html .= ' class="' . $cssClass . '"';
+ } else {
+ //** Necessary redundant code for the sake of \PhpOffice\PhpSpreadsheet\Writer\Pdf **
+ // We must explicitly write the width of the element because TCPDF
+ // does not recognize e.g.
+ $width = 0;
+ $i = $colNum - 1;
+ $e = $colNum + $colSpan - 1;
+ while ($i++ < $e) {
+ if (isset($this->columnWidths[$sheetIndex][$i])) {
+ $width += $this->columnWidths[$sheetIndex][$i];
+ }
+ }
+ $cssClass['width'] = $width . 'pt';
+
+ // We must also explicitly write the height of the | element because TCPDF
+ // does not recognize e.g. |
+ if (isset($this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]['height'])) {
+ $height = $this->cssStyles['table.sheet' . $sheetIndex . ' tr.row' . $pRow]['height'];
+ $cssClass['height'] = $height;
+ }
+ //** end of redundant code **
+
+ $html .= ' style="' . $this->assembleCSS($cssClass) . '"';
+ }
+ if ($colSpan > 1) {
+ $html .= ' colspan="' . $colSpan . '"';
+ }
+ if ($rowSpan > 1) {
+ $html .= ' rowspan="' . $rowSpan . '"';
+ }
+ $html .= '>';
+
+ $html .= $this->writeComment($pSheet, $coordinate);
+
+ // Image?
+ $html .= $this->writeImageInCell($pSheet, $coordinate);
+
+ // Chart?
+ if ($this->includeCharts) {
+ $html .= $this->writeChartInCell($pSheet, $coordinate);
+ }
+
+ // Cell data
+ $html .= $cellData;
+
+ // Column end
+ $html .= '' . $cellType . '>' . PHP_EOL;
+ }
+
+ // Next column
+ ++$colNum;
+ }
+
+ // Write row end
+ $html .= '
' . PHP_EOL;
+
+ // Return
+ return $html;
}
/**
- * Takes array where of CSS properties / values and converts to CSS string
+ * Takes array where of CSS properties / values and converts to CSS string.
+ *
+ * @param array $pValue
*
- * @param array
* @return string
*/
- private function assembleCSS($pValue = array())
+ private function assembleCSS(array $pValue = [])
{
- $pairs = array();
+ $pairs = [];
foreach ($pValue as $property => $value) {
$pairs[] = $property . ':' . $value;
}
@@ -1384,7 +1418,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Get images root
+ * Get images root.
*
* @return string
*/
@@ -1394,21 +1428,23 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Set images root
+ * Set images root.
*
* @param string $pValue
- * @return PHPExcel_Writer_HTML
+ *
+ * @return HTML
*/
- public function setImagesRoot($pValue = '.')
+ public function setImagesRoot($pValue)
{
$this->imagesRoot = $pValue;
+
return $this;
}
/**
- * Get embed images
+ * Get embed images.
*
- * @return boolean
+ * @return bool
*/
public function getEmbedImages()
{
@@ -1416,21 +1452,23 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Set embed images
+ * Set embed images.
*
- * @param boolean $pValue
- * @return PHPExcel_Writer_HTML
+ * @param bool $pValue
+ *
+ * @return HTML
*/
- public function setEmbedImages($pValue = '.')
+ public function setEmbedImages($pValue)
{
$this->embedImages = $pValue;
+
return $this;
}
/**
* Get use inline CSS?
*
- * @return boolean
+ * @return bool
*/
public function getUseInlineCss()
{
@@ -1440,32 +1478,34 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
/**
* Set use inline CSS?
*
- * @param boolean $pValue
- * @return PHPExcel_Writer_HTML
+ * @param bool $pValue
+ *
+ * @return HTML
*/
- public function setUseInlineCss($pValue = false)
+ public function setUseInlineCss($pValue)
{
$this->useInlineCss = $pValue;
+
return $this;
}
/**
- * Add color to formatted string as inline style
+ * Add color to formatted string as inline style.
*
* @param string $pValue Plain formatted value without color
* @param string $pFormat Format code
+ *
* @return string
*/
public function formatColor($pValue, $pFormat)
{
// Color information, e.g. [Red] is always at the beginning
$color = null; // initialize
- $matches = array();
+ $matches = [];
$color_regex = '/^\\[[a-zA-Z]+\\]/';
if (preg_match($color_regex, $pFormat, $matches)) {
- $color = str_replace('[', '', $matches[0]);
- $color = str_replace(']', '', $color);
+ $color = str_replace(['[', ']'], '', $matches[0]);
$color = strtolower($color);
}
@@ -1481,7 +1521,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
}
/**
- * Calculate information about HTML colspan and rowspan which is not always the same as Excel's
+ * Calculate information about HTML colspan and rowspan which is not always the same as Excel's.
*/
private function calculateSpans()
{
@@ -1489,24 +1529,24 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
// In HTML only the upper-left cell should be written and it should have
// appropriate rowspan / colspan attribute
$sheetIndexes = $this->sheetIndex !== null ?
- array($this->sheetIndex) : range(0, $this->phpExcel->getSheetCount() - 1);
+ [$this->sheetIndex] : range(0, $this->spreadsheet->getSheetCount() - 1);
foreach ($sheetIndexes as $sheetIndex) {
- $sheet = $this->phpExcel->getSheet($sheetIndex);
+ $sheet = $this->spreadsheet->getSheet($sheetIndex);
- $candidateSpannedRow = array();
+ $candidateSpannedRow = [];
// loop through all Excel merged cells
foreach ($sheet->getMergeCells() as $cells) {
- list($cells,) = PHPExcel_Cell::splitRange($cells);
+ list($cells) = Coordinate::splitRange($cells);
$first = $cells[0];
- $last = $cells[1];
+ $last = $cells[1];
- list($fc, $fr) = PHPExcel_Cell::coordinateFromString($first);
- $fc = PHPExcel_Cell::columnIndexFromString($fc) - 1;
+ list($fc, $fr) = Coordinate::coordinateFromString($first);
+ $fc = Coordinate::columnIndexFromString($fc) - 1;
- list($lc, $lr) = PHPExcel_Cell::coordinateFromString($last);
- $lc = PHPExcel_Cell::columnIndexFromString($lc) - 1;
+ list($lc, $lr) = Coordinate::coordinateFromString($last);
+ $lc = Coordinate::columnIndexFromString($lc) - 1;
// loop through the individual cells in the individual merge
$r = $fr - 1;
@@ -1518,17 +1558,17 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
while ($c++ < $lc) {
if (!($c == $fc && $r == $fr)) {
// not the upper-left cell (should not be written in HTML)
- $this->isSpannedCell[$sheetIndex][$r][$c] = array(
- 'baseCell' => array($fr, $fc),
- );
+ $this->isSpannedCell[$sheetIndex][$r][$c] = [
+ 'baseCell' => [$fr, $fc],
+ ];
} else {
// upper-left is the base cell that should hold the colspan/rowspan attribute
- $this->isBaseCell[$sheetIndex][$r][$c] = array(
+ $this->isBaseCell[$sheetIndex][$r][$c] = [
'xlrowspan' => $lr - $fr + 1, // Excel rowspan
- 'rowspan' => $lr - $fr + 1, // HTML rowspan, value may change
+ 'rowspan' => $lr - $fr + 1, // HTML rowspan, value may change
'xlcolspan' => $lc - $fc + 1, // Excel colspan
- 'colspan' => $lc - $fc + 1, // HTML colspan, value may change
- );
+ 'colspan' => $lc - $fc + 1, // HTML colspan, value may change
+ ];
}
}
}
@@ -1536,19 +1576,19 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
// Identify which rows should be omitted in HTML. These are the rows where all the cells
// participate in a merge and the where base cells are somewhere above.
- $countColumns = PHPExcel_Cell::columnIndexFromString($sheet->getHighestColumn());
+ $countColumns = Coordinate::columnIndexFromString($sheet->getHighestColumn());
foreach ($candidateSpannedRow as $rowIndex) {
if (isset($this->isSpannedCell[$sheetIndex][$rowIndex])) {
if (count($this->isSpannedCell[$sheetIndex][$rowIndex]) == $countColumns) {
$this->isSpannedRow[$sheetIndex][$rowIndex] = $rowIndex;
- };
+ }
}
}
// For each of the omitted rows we found above, the affected rowspans should be subtracted by 1
if (isset($this->isSpannedRow[$sheetIndex])) {
foreach ($this->isSpannedRow[$sheetIndex] as $rowIndex) {
- $adjustedBaseCells = array();
+ $adjustedBaseCells = [];
$c = -1;
$e = $countColumns - 1;
while ($c++ < $e) {
@@ -1556,7 +1596,7 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
if (!in_array($baseCell, $adjustedBaseCells)) {
// subtract rowspan by 1
- --$this->isBaseCell[$sheetIndex][ $baseCell[0] ][ $baseCell[1] ]['rowspan'];
+ --$this->isBaseCell[$sheetIndex][$baseCell[0]][$baseCell[1]]['rowspan'];
$adjustedBaseCells[] = $baseCell;
}
}
@@ -1570,21 +1610,21 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
$this->spansAreCalculated = true;
}
- private function setMargins(PHPExcel_Worksheet $pSheet)
+ private function setMargins(Worksheet $pSheet)
{
$htmlPage = '@page { ';
$htmlBody = 'body { ';
- $left = PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getLeft()) . 'in; ';
+ $left = StringHelper::formatNumber($pSheet->getPageMargins()->getLeft()) . 'in; ';
$htmlPage .= 'margin-left: ' . $left;
$htmlBody .= 'margin-left: ' . $left;
- $right = PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getRight()) . 'in; ';
+ $right = StringHelper::formatNumber($pSheet->getPageMargins()->getRight()) . 'in; ';
$htmlPage .= 'margin-right: ' . $right;
$htmlBody .= 'margin-right: ' . $right;
- $top = PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getTop()) . 'in; ';
+ $top = StringHelper::formatNumber($pSheet->getPageMargins()->getTop()) . 'in; ';
$htmlPage .= 'margin-top: ' . $top;
$htmlBody .= 'margin-top: ' . $top;
- $bottom = PHPExcel_Shared_String::FormatNumber($pSheet->getPageMargins()->getBottom()) . 'in; ';
+ $bottom = StringHelper::formatNumber($pSheet->getPageMargins()->getBottom()) . 'in; ';
$htmlPage .= 'margin-bottom: ' . $bottom;
$htmlBody .= 'margin-bottom: ' . $bottom;
@@ -1593,4 +1633,26 @@ class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_
return "\n";
}
+
+ /**
+ * Write a comment in the same format as LibreOffice.
+ *
+ * @see https://github.com/LibreOffice/core/blob/9fc9bf3240f8c62ad7859947ab8a033ac1fe93fa/sc/source/filter/html/htmlexp.cxx#L1073-L1092
+ *
+ * @param Worksheet $pSheet
+ * @param string $coordinate
+ *
+ * @return string
+ */
+ private function writeComment(Worksheet $pSheet, $coordinate)
+ {
+ $result = '';
+ if (!$this->isPdf && isset($pSheet->getComments()[$coordinate])) {
+ $result .= '';
+ $result .= '';
+ $result .= PHP_EOL;
+ }
+
+ return $result;
+ }
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/IWriter.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/IWriter.php
new file mode 100644
index 00000000000..9ce45a1946a
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/IWriter.php
@@ -0,0 +1,24 @@
+setSpreadsheet($spreadsheet);
+
+ $writerPartsArray = [
+ 'content' => Content::class,
+ 'meta' => Meta::class,
+ 'meta_inf' => MetaInf::class,
+ 'mimetype' => Mimetype::class,
+ 'settings' => Settings::class,
+ 'styles' => Styles::class,
+ 'thumbnails' => Thumbnails::class,
+ ];
+
+ foreach ($writerPartsArray as $writer => $class) {
+ $this->writerParts[$writer] = new $class($this);
+ }
+ }
+
+ /**
+ * Get writer part.
+ *
+ * @param string $pPartName Writer part name
+ *
+ * @return null|Ods\WriterPart
+ */
+ public function getWriterPart($pPartName)
+ {
+ if ($pPartName != '' && isset($this->writerParts[strtolower($pPartName)])) {
+ return $this->writerParts[strtolower($pPartName)];
+ }
+
+ return null;
+ }
+
+ /**
+ * Save PhpSpreadsheet to file.
+ *
+ * @param string $pFilename
+ *
+ * @throws WriterException
+ */
+ public function save($pFilename)
+ {
+ if (!$this->spreadSheet) {
+ throw new WriterException('PhpSpreadsheet object unassigned.');
+ }
+
+ // garbage collect
+ $this->spreadSheet->garbageCollect();
+
+ // If $pFilename is php://output or php://stdout, make it a temporary file...
+ $originalFilename = $pFilename;
+ if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') {
+ $pFilename = @tempnam(File::sysGetTempDir(), 'phpxltmp');
+ if ($pFilename == '') {
+ $pFilename = $originalFilename;
+ }
+ }
+
+ $zip = $this->createZip($pFilename);
+
+ $zip->addFromString('META-INF/manifest.xml', $this->getWriterPart('meta_inf')->writeManifest());
+ $zip->addFromString('Thumbnails/thumbnail.png', $this->getWriterPart('thumbnails')->writeThumbnail());
+ $zip->addFromString('content.xml', $this->getWriterPart('content')->write());
+ $zip->addFromString('meta.xml', $this->getWriterPart('meta')->write());
+ $zip->addFromString('mimetype', $this->getWriterPart('mimetype')->write());
+ $zip->addFromString('settings.xml', $this->getWriterPart('settings')->write());
+ $zip->addFromString('styles.xml', $this->getWriterPart('styles')->write());
+
+ // Close file
+ if ($zip->close() === false) {
+ throw new WriterException("Could not close zip file $pFilename.");
+ }
+
+ // If a temporary file was used, copy it to the correct file stream
+ if ($originalFilename != $pFilename) {
+ if (copy($pFilename, $originalFilename) === false) {
+ throw new WriterException("Could not copy temporary zip file $pFilename to $originalFilename.");
+ }
+ @unlink($pFilename);
+ }
+ }
+
+ /**
+ * Create zip object.
+ *
+ * @param string $pFilename
+ *
+ * @throws WriterException
+ *
+ * @return ZipArchive
+ */
+ private function createZip($pFilename)
+ {
+ // Create new ZIP file and open it for writing
+ $zip = new ZipArchive();
+
+ if (file_exists($pFilename)) {
+ unlink($pFilename);
+ }
+ // Try opening the ZIP file
+ if ($zip->open($pFilename, ZipArchive::OVERWRITE) !== true) {
+ if ($zip->open($pFilename, ZipArchive::CREATE) !== true) {
+ throw new WriterException("Could not open $pFilename for writing.");
+ }
+ }
+
+ return $zip;
+ }
+
+ /**
+ * Get Spreadsheet object.
+ *
+ * @throws WriterException
+ *
+ * @return Spreadsheet
+ */
+ public function getSpreadsheet()
+ {
+ if ($this->spreadSheet !== null) {
+ return $this->spreadSheet;
+ }
+
+ throw new WriterException('No PhpSpreadsheet assigned.');
+ }
+
+ /**
+ * Set Spreadsheet object.
+ *
+ * @param Spreadsheet $spreadsheet PhpSpreadsheet object
+ *
+ * @return self
+ */
+ public function setSpreadsheet(Spreadsheet $spreadsheet)
+ {
+ $this->spreadSheet = $spreadsheet;
+
+ return $this;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Cell/Comment.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Cell/Comment.php
new file mode 100644
index 00000000000..2f543be51b8
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Cell/Comment.php
@@ -0,0 +1,33 @@
+
+ */
+class Comment
+{
+ public static function write(XMLWriter $objWriter, Cell $cell)
+ {
+ $comments = $cell->getWorksheet()->getComments();
+ if (!isset($comments[$cell->getCoordinate()])) {
+ return;
+ }
+ $comment = $comments[$cell->getCoordinate()];
+
+ $objWriter->startElement('office:annotation');
+ $objWriter->writeAttribute('svg:width', $comment->getWidth());
+ $objWriter->writeAttribute('svg:height', $comment->getHeight());
+ $objWriter->writeAttribute('svg:x', $comment->getMarginLeft());
+ $objWriter->writeAttribute('svg:y', $comment->getMarginTop());
+ $objWriter->writeElement('dc:creator', $comment->getAuthor());
+ $objWriter->writeElement('text:p', $comment->getText()->getPlainText());
+ $objWriter->endElement();
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Content.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Content.php
new file mode 100644
index 00000000000..11de0fd3733
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Content.php
@@ -0,0 +1,395 @@
+
+ */
+class Content extends WriterPart
+{
+ const NUMBER_COLS_REPEATED_MAX = 1024;
+ const NUMBER_ROWS_REPEATED_MAX = 1048576;
+ const CELL_STYLE_PREFIX = 'ce';
+
+ /**
+ * Write content.xml to XML format.
+ *
+ * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ *
+ * @return string XML Output
+ */
+ public function write()
+ {
+ $objWriter = null;
+ if ($this->getParentWriter()->getUseDiskCaching()) {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ } else {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
+ }
+
+ // XML header
+ $objWriter->startDocument('1.0', 'UTF-8');
+
+ // Content
+ $objWriter->startElement('office:document-content');
+ $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
+ $objWriter->writeAttribute('xmlns:style', 'urn:oasis:names:tc:opendocument:xmlns:style:1.0');
+ $objWriter->writeAttribute('xmlns:text', 'urn:oasis:names:tc:opendocument:xmlns:text:1.0');
+ $objWriter->writeAttribute('xmlns:table', 'urn:oasis:names:tc:opendocument:xmlns:table:1.0');
+ $objWriter->writeAttribute('xmlns:draw', 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0');
+ $objWriter->writeAttribute('xmlns:fo', 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0');
+ $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
+ $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
+ $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
+ $objWriter->writeAttribute('xmlns:number', 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0');
+ $objWriter->writeAttribute('xmlns:presentation', 'urn:oasis:names:tc:opendocument:xmlns:presentation:1.0');
+ $objWriter->writeAttribute('xmlns:svg', 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0');
+ $objWriter->writeAttribute('xmlns:chart', 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0');
+ $objWriter->writeAttribute('xmlns:dr3d', 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0');
+ $objWriter->writeAttribute('xmlns:math', 'http://www.w3.org/1998/Math/MathML');
+ $objWriter->writeAttribute('xmlns:form', 'urn:oasis:names:tc:opendocument:xmlns:form:1.0');
+ $objWriter->writeAttribute('xmlns:script', 'urn:oasis:names:tc:opendocument:xmlns:script:1.0');
+ $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
+ $objWriter->writeAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer');
+ $objWriter->writeAttribute('xmlns:oooc', 'http://openoffice.org/2004/calc');
+ $objWriter->writeAttribute('xmlns:dom', 'http://www.w3.org/2001/xml-events');
+ $objWriter->writeAttribute('xmlns:xforms', 'http://www.w3.org/2002/xforms');
+ $objWriter->writeAttribute('xmlns:xsd', 'http://www.w3.org/2001/XMLSchema');
+ $objWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
+ $objWriter->writeAttribute('xmlns:rpt', 'http://openoffice.org/2005/report');
+ $objWriter->writeAttribute('xmlns:of', 'urn:oasis:names:tc:opendocument:xmlns:of:1.2');
+ $objWriter->writeAttribute('xmlns:xhtml', 'http://www.w3.org/1999/xhtml');
+ $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');
+ $objWriter->writeAttribute('xmlns:tableooo', 'http://openoffice.org/2009/table');
+ $objWriter->writeAttribute('xmlns:field', 'urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0');
+ $objWriter->writeAttribute('xmlns:formx', 'urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0');
+ $objWriter->writeAttribute('xmlns:css3t', 'http://www.w3.org/TR/css3-text/');
+ $objWriter->writeAttribute('office:version', '1.2');
+
+ $objWriter->writeElement('office:scripts');
+ $objWriter->writeElement('office:font-face-decls');
+
+ // Styles XF
+ $objWriter->startElement('office:automatic-styles');
+ $this->writeXfStyles($objWriter, $this->getParentWriter()->getSpreadsheet());
+ $objWriter->endElement();
+
+ $objWriter->startElement('office:body');
+ $objWriter->startElement('office:spreadsheet');
+ $objWriter->writeElement('table:calculation-settings');
+
+ $this->writeSheets($objWriter);
+
+ $objWriter->writeElement('table:named-expressions');
+ $objWriter->endElement();
+ $objWriter->endElement();
+ $objWriter->endElement();
+
+ return $objWriter->getData();
+ }
+
+ /**
+ * Write sheets.
+ *
+ * @param XMLWriter $objWriter
+ */
+ private function writeSheets(XMLWriter $objWriter)
+ {
+ $spreadsheet = $this->getParentWriter()->getSpreadsheet(); // @var $spreadsheet Spreadsheet
+
+ $sheetCount = $spreadsheet->getSheetCount();
+ for ($i = 0; $i < $sheetCount; ++$i) {
+ $objWriter->startElement('table:table');
+ $objWriter->writeAttribute('table:name', $spreadsheet->getSheet($i)->getTitle());
+ $objWriter->writeElement('office:forms');
+ $objWriter->startElement('table:table-column');
+ $objWriter->writeAttribute('table:number-columns-repeated', self::NUMBER_COLS_REPEATED_MAX);
+ $objWriter->endElement();
+ $this->writeRows($objWriter, $spreadsheet->getSheet($i));
+ $objWriter->endElement();
+ }
+ }
+
+ /**
+ * Write rows of the specified sheet.
+ *
+ * @param XMLWriter $objWriter
+ * @param Worksheet $sheet
+ */
+ private function writeRows(XMLWriter $objWriter, Worksheet $sheet)
+ {
+ $numberRowsRepeated = self::NUMBER_ROWS_REPEATED_MAX;
+ $span_row = 0;
+ $rows = $sheet->getRowIterator();
+ while ($rows->valid()) {
+ --$numberRowsRepeated;
+ $row = $rows->current();
+ if ($row->getCellIterator()->valid()) {
+ if ($span_row) {
+ $objWriter->startElement('table:table-row');
+ if ($span_row > 1) {
+ $objWriter->writeAttribute('table:number-rows-repeated', $span_row);
+ }
+ $objWriter->startElement('table:table-cell');
+ $objWriter->writeAttribute('table:number-columns-repeated', self::NUMBER_COLS_REPEATED_MAX);
+ $objWriter->endElement();
+ $objWriter->endElement();
+ $span_row = 0;
+ }
+ $objWriter->startElement('table:table-row');
+ $this->writeCells($objWriter, $row);
+ $objWriter->endElement();
+ } else {
+ ++$span_row;
+ }
+ $rows->next();
+ }
+ }
+
+ /**
+ * Write cells of the specified row.
+ *
+ * @param XMLWriter $objWriter
+ * @param Row $row
+ *
+ * @throws Exception
+ */
+ private function writeCells(XMLWriter $objWriter, Row $row)
+ {
+ $numberColsRepeated = self::NUMBER_COLS_REPEATED_MAX;
+ $prevColumn = -1;
+ $cells = $row->getCellIterator();
+ while ($cells->valid()) {
+ /** @var \PhpOffice\PhpSpreadsheet\Cell\Cell $cell */
+ $cell = $cells->current();
+ $column = Coordinate::columnIndexFromString($cell->getColumn()) - 1;
+
+ $this->writeCellSpan($objWriter, $column, $prevColumn);
+ $objWriter->startElement('table:table-cell');
+ $this->writeCellMerge($objWriter, $cell);
+
+ // Style XF
+ $style = $cell->getXfIndex();
+ if ($style !== null) {
+ $objWriter->writeAttribute('table:style-name', self::CELL_STYLE_PREFIX . $style);
+ }
+
+ switch ($cell->getDataType()) {
+ case DataType::TYPE_BOOL:
+ $objWriter->writeAttribute('office:value-type', 'boolean');
+ $objWriter->writeAttribute('office:value', $cell->getValue());
+ $objWriter->writeElement('text:p', $cell->getValue());
+
+ break;
+ case DataType::TYPE_ERROR:
+ throw new Exception('Writing of error not implemented yet.');
+
+ break;
+ case DataType::TYPE_FORMULA:
+ $formulaValue = $cell->getValue();
+ if ($this->getParentWriter()->getPreCalculateFormulas()) {
+ try {
+ $formulaValue = $cell->getCalculatedValue();
+ } catch (Exception $e) {
+ // don't do anything
+ }
+ }
+ $objWriter->writeAttribute('table:formula', 'of:' . $cell->getValue());
+ if (is_numeric($formulaValue)) {
+ $objWriter->writeAttribute('office:value-type', 'float');
+ } else {
+ $objWriter->writeAttribute('office:value-type', 'string');
+ }
+ $objWriter->writeAttribute('office:value', $formulaValue);
+ $objWriter->writeElement('text:p', $formulaValue);
+
+ break;
+ case DataType::TYPE_INLINE:
+ throw new Exception('Writing of inline not implemented yet.');
+
+ break;
+ case DataType::TYPE_NUMERIC:
+ $objWriter->writeAttribute('office:value-type', 'float');
+ $objWriter->writeAttribute('office:value', $cell->getValue());
+ $objWriter->writeElement('text:p', $cell->getValue());
+
+ break;
+ case DataType::TYPE_STRING:
+ $objWriter->writeAttribute('office:value-type', 'string');
+ $objWriter->writeElement('text:p', $cell->getValue());
+
+ break;
+ }
+ Comment::write($objWriter, $cell);
+ $objWriter->endElement();
+ $prevColumn = $column;
+ $cells->next();
+ }
+ $numberColsRepeated = $numberColsRepeated - $prevColumn - 1;
+ if ($numberColsRepeated > 0) {
+ if ($numberColsRepeated > 1) {
+ $objWriter->startElement('table:table-cell');
+ $objWriter->writeAttribute('table:number-columns-repeated', $numberColsRepeated);
+ $objWriter->endElement();
+ } else {
+ $objWriter->writeElement('table:table-cell');
+ }
+ }
+ }
+
+ /**
+ * Write span.
+ *
+ * @param XMLWriter $objWriter
+ * @param int $curColumn
+ * @param int $prevColumn
+ */
+ private function writeCellSpan(XMLWriter $objWriter, $curColumn, $prevColumn)
+ {
+ $diff = $curColumn - $prevColumn - 1;
+ if (1 === $diff) {
+ $objWriter->writeElement('table:table-cell');
+ } elseif ($diff > 1) {
+ $objWriter->startElement('table:table-cell');
+ $objWriter->writeAttribute('table:number-columns-repeated', $diff);
+ $objWriter->endElement();
+ }
+ }
+
+ /**
+ * Write XF cell styles.
+ *
+ * @param XMLWriter $writer
+ * @param Spreadsheet $spreadsheet
+ */
+ private function writeXfStyles(XMLWriter $writer, Spreadsheet $spreadsheet)
+ {
+ foreach ($spreadsheet->getCellXfCollection() as $style) {
+ $writer->startElement('style:style');
+ $writer->writeAttribute('style:name', self::CELL_STYLE_PREFIX . $style->getIndex());
+ $writer->writeAttribute('style:family', 'table-cell');
+ $writer->writeAttribute('style:parent-style-name', 'Default');
+
+ // style:text-properties
+
+ // Font
+ $writer->startElement('style:text-properties');
+
+ $font = $style->getFont();
+
+ if ($font->getBold()) {
+ $writer->writeAttribute('fo:font-weight', 'bold');
+ $writer->writeAttribute('style:font-weight-complex', 'bold');
+ $writer->writeAttribute('style:font-weight-asian', 'bold');
+ }
+
+ if ($font->getItalic()) {
+ $writer->writeAttribute('fo:font-style', 'italic');
+ }
+
+ if ($color = $font->getColor()) {
+ $writer->writeAttribute('fo:color', sprintf('#%s', $color->getRGB()));
+ }
+
+ if ($family = $font->getName()) {
+ $writer->writeAttribute('fo:font-family', $family);
+ }
+
+ if ($size = $font->getSize()) {
+ $writer->writeAttribute('fo:font-size', sprintf('%.1fpt', $size));
+ }
+
+ if ($font->getUnderline() && $font->getUnderline() != Font::UNDERLINE_NONE) {
+ $writer->writeAttribute('style:text-underline-style', 'solid');
+ $writer->writeAttribute('style:text-underline-width', 'auto');
+ $writer->writeAttribute('style:text-underline-color', 'font-color');
+
+ switch ($font->getUnderline()) {
+ case Font::UNDERLINE_DOUBLE:
+ $writer->writeAttribute('style:text-underline-type', 'double');
+
+ break;
+ case Font::UNDERLINE_SINGLE:
+ $writer->writeAttribute('style:text-underline-type', 'single');
+
+ break;
+ }
+ }
+
+ $writer->endElement(); // Close style:text-properties
+
+ // style:table-cell-properties
+
+ $writer->startElement('style:table-cell-properties');
+ $writer->writeAttribute('style:rotation-align', 'none');
+
+ // Fill
+ if ($fill = $style->getFill()) {
+ switch ($fill->getFillType()) {
+ case Fill::FILL_SOLID:
+ $writer->writeAttribute('fo:background-color', sprintf(
+ '#%s',
+ strtolower($fill->getStartColor()->getRGB())
+ ));
+
+ break;
+ case Fill::FILL_GRADIENT_LINEAR:
+ case Fill::FILL_GRADIENT_PATH:
+ /// TODO :: To be implemented
+ break;
+ case Fill::FILL_NONE:
+ default:
+ }
+ }
+
+ $writer->endElement(); // Close style:table-cell-properties
+
+ // End
+
+ $writer->endElement(); // Close style:style
+ }
+ }
+
+ /**
+ * Write attributes for merged cell.
+ *
+ * @param XMLWriter $objWriter
+ * @param Cell $cell
+ *
+ * @throws \PhpOffice\PhpSpreadsheet\Exception
+ */
+ private function writeCellMerge(XMLWriter $objWriter, Cell $cell)
+ {
+ if (!$cell->isMergeRangeValueCell()) {
+ return;
+ }
+
+ $mergeRange = Coordinate::splitRange($cell->getMergeRange());
+ list($startCell, $endCell) = $mergeRange[0];
+ $start = Coordinate::coordinateFromString($startCell);
+ $end = Coordinate::coordinateFromString($endCell);
+ $columnSpan = Coordinate::columnIndexFromString($end[0]) - Coordinate::columnIndexFromString($start[0]) + 1;
+ $rowSpan = $end[1] - $start[1] + 1;
+
+ $objWriter->writeAttribute('table:number-columns-spanned', $columnSpan);
+ $objWriter->writeAttribute('table:number-rows-spanned', $rowSpan);
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Meta.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Meta.php
new file mode 100644
index 00000000000..ffe5eff7925
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Meta.php
@@ -0,0 +1,77 @@
+getParentWriter()->getSpreadsheet();
+ }
+
+ $objWriter = null;
+ if ($this->getParentWriter()->getUseDiskCaching()) {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ } else {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
+ }
+
+ // XML header
+ $objWriter->startDocument('1.0', 'UTF-8');
+
+ // Meta
+ $objWriter->startElement('office:document-meta');
+
+ $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
+ $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
+ $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
+ $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
+ $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
+ $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');
+ $objWriter->writeAttribute('office:version', '1.2');
+
+ $objWriter->startElement('office:meta');
+
+ $objWriter->writeElement('meta:initial-creator', $spreadsheet->getProperties()->getCreator());
+ $objWriter->writeElement('dc:creator', $spreadsheet->getProperties()->getCreator());
+ $objWriter->writeElement('meta:creation-date', date(DATE_W3C, $spreadsheet->getProperties()->getCreated()));
+ $objWriter->writeElement('dc:date', date(DATE_W3C, $spreadsheet->getProperties()->getCreated()));
+ $objWriter->writeElement('dc:title', $spreadsheet->getProperties()->getTitle());
+ $objWriter->writeElement('dc:description', $spreadsheet->getProperties()->getDescription());
+ $objWriter->writeElement('dc:subject', $spreadsheet->getProperties()->getSubject());
+ $keywords = explode(' ', $spreadsheet->getProperties()->getKeywords());
+ foreach ($keywords as $keyword) {
+ $objWriter->writeElement('meta:keyword', $keyword);
+ }
+
+ //
+ $objWriter->startElement('meta:user-defined');
+ $objWriter->writeAttribute('meta:name', 'Company');
+ $objWriter->writeRaw($spreadsheet->getProperties()->getCompany());
+ $objWriter->endElement();
+
+ $objWriter->startElement('meta:user-defined');
+ $objWriter->writeAttribute('meta:name', 'category');
+ $objWriter->writeRaw($spreadsheet->getProperties()->getCategory());
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ return $objWriter->getData();
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/MetaInf.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/MetaInf.php
new file mode 100644
index 00000000000..1ec9d1eb44b
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/MetaInf.php
@@ -0,0 +1,62 @@
+getParentWriter()->getUseDiskCaching()) {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ } else {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
+ }
+
+ // XML header
+ $objWriter->startDocument('1.0', 'UTF-8');
+
+ // Manifest
+ $objWriter->startElement('manifest:manifest');
+ $objWriter->writeAttribute('xmlns:manifest', 'urn:oasis:names:tc:opendocument:xmlns:manifest:1.0');
+ $objWriter->writeAttribute('manifest:version', '1.2');
+
+ $objWriter->startElement('manifest:file-entry');
+ $objWriter->writeAttribute('manifest:full-path', '/');
+ $objWriter->writeAttribute('manifest:version', '1.2');
+ $objWriter->writeAttribute('manifest:media-type', 'application/vnd.oasis.opendocument.spreadsheet');
+ $objWriter->endElement();
+ $objWriter->startElement('manifest:file-entry');
+ $objWriter->writeAttribute('manifest:full-path', 'meta.xml');
+ $objWriter->writeAttribute('manifest:media-type', 'text/xml');
+ $objWriter->endElement();
+ $objWriter->startElement('manifest:file-entry');
+ $objWriter->writeAttribute('manifest:full-path', 'settings.xml');
+ $objWriter->writeAttribute('manifest:media-type', 'text/xml');
+ $objWriter->endElement();
+ $objWriter->startElement('manifest:file-entry');
+ $objWriter->writeAttribute('manifest:full-path', 'content.xml');
+ $objWriter->writeAttribute('manifest:media-type', 'text/xml');
+ $objWriter->endElement();
+ $objWriter->startElement('manifest:file-entry');
+ $objWriter->writeAttribute('manifest:full-path', 'Thumbnails/thumbnail.png');
+ $objWriter->writeAttribute('manifest:media-type', 'image/png');
+ $objWriter->endElement();
+ $objWriter->startElement('manifest:file-entry');
+ $objWriter->writeAttribute('manifest:full-path', 'styles.xml');
+ $objWriter->writeAttribute('manifest:media-type', 'text/xml');
+ $objWriter->endElement();
+ $objWriter->endElement();
+
+ return $objWriter->getData();
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Mimetype.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Mimetype.php
new file mode 100644
index 00000000000..d0fed2b379b
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Mimetype.php
@@ -0,0 +1,20 @@
+getParentWriter()->getUseDiskCaching()) {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ } else {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
+ }
+
+ // XML header
+ $objWriter->startDocument('1.0', 'UTF-8');
+
+ // Settings
+ $objWriter->startElement('office:document-settings');
+ $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
+ $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
+ $objWriter->writeAttribute('xmlns:config', 'urn:oasis:names:tc:opendocument:xmlns:config:1.0');
+ $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
+ $objWriter->writeAttribute('office:version', '1.2');
+
+ $objWriter->startElement('office:settings');
+ $objWriter->startElement('config:config-item-set');
+ $objWriter->writeAttribute('config:name', 'ooo:view-settings');
+ $objWriter->startElement('config:config-item-map-indexed');
+ $objWriter->writeAttribute('config:name', 'Views');
+ $objWriter->endElement();
+ $objWriter->endElement();
+ $objWriter->startElement('config:config-item-set');
+ $objWriter->writeAttribute('config:name', 'ooo:configuration-settings');
+ $objWriter->endElement();
+ $objWriter->endElement();
+ $objWriter->endElement();
+
+ return $objWriter->getData();
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Styles.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Styles.php
new file mode 100644
index 00000000000..eaf5cad9526
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Styles.php
@@ -0,0 +1,70 @@
+getParentWriter()->getUseDiskCaching()) {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ } else {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
+ }
+
+ // XML header
+ $objWriter->startDocument('1.0', 'UTF-8');
+
+ // Content
+ $objWriter->startElement('office:document-styles');
+ $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
+ $objWriter->writeAttribute('xmlns:style', 'urn:oasis:names:tc:opendocument:xmlns:style:1.0');
+ $objWriter->writeAttribute('xmlns:text', 'urn:oasis:names:tc:opendocument:xmlns:text:1.0');
+ $objWriter->writeAttribute('xmlns:table', 'urn:oasis:names:tc:opendocument:xmlns:table:1.0');
+ $objWriter->writeAttribute('xmlns:draw', 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0');
+ $objWriter->writeAttribute('xmlns:fo', 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0');
+ $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
+ $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
+ $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
+ $objWriter->writeAttribute('xmlns:number', 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0');
+ $objWriter->writeAttribute('xmlns:presentation', 'urn:oasis:names:tc:opendocument:xmlns:presentation:1.0');
+ $objWriter->writeAttribute('xmlns:svg', 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0');
+ $objWriter->writeAttribute('xmlns:chart', 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0');
+ $objWriter->writeAttribute('xmlns:dr3d', 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0');
+ $objWriter->writeAttribute('xmlns:math', 'http://www.w3.org/1998/Math/MathML');
+ $objWriter->writeAttribute('xmlns:form', 'urn:oasis:names:tc:opendocument:xmlns:form:1.0');
+ $objWriter->writeAttribute('xmlns:script', 'urn:oasis:names:tc:opendocument:xmlns:script:1.0');
+ $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
+ $objWriter->writeAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer');
+ $objWriter->writeAttribute('xmlns:oooc', 'http://openoffice.org/2004/calc');
+ $objWriter->writeAttribute('xmlns:dom', 'http://www.w3.org/2001/xml-events');
+ $objWriter->writeAttribute('xmlns:rpt', 'http://openoffice.org/2005/report');
+ $objWriter->writeAttribute('xmlns:of', 'urn:oasis:names:tc:opendocument:xmlns:of:1.2');
+ $objWriter->writeAttribute('xmlns:xhtml', 'http://www.w3.org/1999/xhtml');
+ $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');
+ $objWriter->writeAttribute('xmlns:tableooo', 'http://openoffice.org/2009/table');
+ $objWriter->writeAttribute('xmlns:css3t', 'http://www.w3.org/TR/css3-text/');
+ $objWriter->writeAttribute('office:version', '1.2');
+
+ $objWriter->writeElement('office:font-face-decls');
+ $objWriter->writeElement('office:styles');
+ $objWriter->writeElement('office:automatic-styles');
+ $objWriter->writeElement('office:master-styles');
+ $objWriter->endElement();
+
+ return $objWriter->getData();
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Thumbnails.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Thumbnails.php
new file mode 100644
index 00000000000..a29a14adbe8
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Ods/Thumbnails.php
@@ -0,0 +1,20 @@
+parentWriter;
+ }
+
+ /**
+ * Set parent Ods writer.
+ *
+ * @param Ods $writer
+ */
+ public function __construct(Ods $writer)
+ {
+ $this->parentWriter = $writer;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf.php
new file mode 100644
index 00000000000..b80083ae466
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf.php
@@ -0,0 +1,283 @@
+ 'LETTER', // (8.5 in. by 11 in.)
+ PageSetup::PAPERSIZE_LETTER_SMALL => 'LETTER', // (8.5 in. by 11 in.)
+ PageSetup::PAPERSIZE_TABLOID => [792.00, 1224.00], // (11 in. by 17 in.)
+ PageSetup::PAPERSIZE_LEDGER => [1224.00, 792.00], // (17 in. by 11 in.)
+ PageSetup::PAPERSIZE_LEGAL => 'LEGAL', // (8.5 in. by 14 in.)
+ PageSetup::PAPERSIZE_STATEMENT => [396.00, 612.00], // (5.5 in. by 8.5 in.)
+ PageSetup::PAPERSIZE_EXECUTIVE => 'EXECUTIVE', // (7.25 in. by 10.5 in.)
+ PageSetup::PAPERSIZE_A3 => 'A3', // (297 mm by 420 mm)
+ PageSetup::PAPERSIZE_A4 => 'A4', // (210 mm by 297 mm)
+ PageSetup::PAPERSIZE_A4_SMALL => 'A4', // (210 mm by 297 mm)
+ PageSetup::PAPERSIZE_A5 => 'A5', // (148 mm by 210 mm)
+ PageSetup::PAPERSIZE_B4 => 'B4', // (250 mm by 353 mm)
+ PageSetup::PAPERSIZE_B5 => 'B5', // (176 mm by 250 mm)
+ PageSetup::PAPERSIZE_FOLIO => 'FOLIO', // (8.5 in. by 13 in.)
+ PageSetup::PAPERSIZE_QUARTO => [609.45, 779.53], // (215 mm by 275 mm)
+ PageSetup::PAPERSIZE_STANDARD_1 => [720.00, 1008.00], // (10 in. by 14 in.)
+ PageSetup::PAPERSIZE_STANDARD_2 => [792.00, 1224.00], // (11 in. by 17 in.)
+ PageSetup::PAPERSIZE_NOTE => 'LETTER', // (8.5 in. by 11 in.)
+ PageSetup::PAPERSIZE_NO9_ENVELOPE => [279.00, 639.00], // (3.875 in. by 8.875 in.)
+ PageSetup::PAPERSIZE_NO10_ENVELOPE => [297.00, 684.00], // (4.125 in. by 9.5 in.)
+ PageSetup::PAPERSIZE_NO11_ENVELOPE => [324.00, 747.00], // (4.5 in. by 10.375 in.)
+ PageSetup::PAPERSIZE_NO12_ENVELOPE => [342.00, 792.00], // (4.75 in. by 11 in.)
+ PageSetup::PAPERSIZE_NO14_ENVELOPE => [360.00, 828.00], // (5 in. by 11.5 in.)
+ PageSetup::PAPERSIZE_C => [1224.00, 1584.00], // (17 in. by 22 in.)
+ PageSetup::PAPERSIZE_D => [1584.00, 2448.00], // (22 in. by 34 in.)
+ PageSetup::PAPERSIZE_E => [2448.00, 3168.00], // (34 in. by 44 in.)
+ PageSetup::PAPERSIZE_DL_ENVELOPE => [311.81, 623.62], // (110 mm by 220 mm)
+ PageSetup::PAPERSIZE_C5_ENVELOPE => 'C5', // (162 mm by 229 mm)
+ PageSetup::PAPERSIZE_C3_ENVELOPE => 'C3', // (324 mm by 458 mm)
+ PageSetup::PAPERSIZE_C4_ENVELOPE => 'C4', // (229 mm by 324 mm)
+ PageSetup::PAPERSIZE_C6_ENVELOPE => 'C6', // (114 mm by 162 mm)
+ PageSetup::PAPERSIZE_C65_ENVELOPE => [323.15, 649.13], // (114 mm by 229 mm)
+ PageSetup::PAPERSIZE_B4_ENVELOPE => 'B4', // (250 mm by 353 mm)
+ PageSetup::PAPERSIZE_B5_ENVELOPE => 'B5', // (176 mm by 250 mm)
+ PageSetup::PAPERSIZE_B6_ENVELOPE => [498.90, 354.33], // (176 mm by 125 mm)
+ PageSetup::PAPERSIZE_ITALY_ENVELOPE => [311.81, 651.97], // (110 mm by 230 mm)
+ PageSetup::PAPERSIZE_MONARCH_ENVELOPE => [279.00, 540.00], // (3.875 in. by 7.5 in.)
+ PageSetup::PAPERSIZE_6_3_4_ENVELOPE => [261.00, 468.00], // (3.625 in. by 6.5 in.)
+ PageSetup::PAPERSIZE_US_STANDARD_FANFOLD => [1071.00, 792.00], // (14.875 in. by 11 in.)
+ PageSetup::PAPERSIZE_GERMAN_STANDARD_FANFOLD => [612.00, 864.00], // (8.5 in. by 12 in.)
+ PageSetup::PAPERSIZE_GERMAN_LEGAL_FANFOLD => 'FOLIO', // (8.5 in. by 13 in.)
+ PageSetup::PAPERSIZE_ISO_B4 => 'B4', // (250 mm by 353 mm)
+ PageSetup::PAPERSIZE_JAPANESE_DOUBLE_POSTCARD => [566.93, 419.53], // (200 mm by 148 mm)
+ PageSetup::PAPERSIZE_STANDARD_PAPER_1 => [648.00, 792.00], // (9 in. by 11 in.)
+ PageSetup::PAPERSIZE_STANDARD_PAPER_2 => [720.00, 792.00], // (10 in. by 11 in.)
+ PageSetup::PAPERSIZE_STANDARD_PAPER_3 => [1080.00, 792.00], // (15 in. by 11 in.)
+ PageSetup::PAPERSIZE_INVITE_ENVELOPE => [623.62, 623.62], // (220 mm by 220 mm)
+ PageSetup::PAPERSIZE_LETTER_EXTRA_PAPER => [667.80, 864.00], // (9.275 in. by 12 in.)
+ PageSetup::PAPERSIZE_LEGAL_EXTRA_PAPER => [667.80, 1080.00], // (9.275 in. by 15 in.)
+ PageSetup::PAPERSIZE_TABLOID_EXTRA_PAPER => [841.68, 1296.00], // (11.69 in. by 18 in.)
+ PageSetup::PAPERSIZE_A4_EXTRA_PAPER => [668.98, 912.76], // (236 mm by 322 mm)
+ PageSetup::PAPERSIZE_LETTER_TRANSVERSE_PAPER => [595.80, 792.00], // (8.275 in. by 11 in.)
+ PageSetup::PAPERSIZE_A4_TRANSVERSE_PAPER => 'A4', // (210 mm by 297 mm)
+ PageSetup::PAPERSIZE_LETTER_EXTRA_TRANSVERSE_PAPER => [667.80, 864.00], // (9.275 in. by 12 in.)
+ PageSetup::PAPERSIZE_SUPERA_SUPERA_A4_PAPER => [643.46, 1009.13], // (227 mm by 356 mm)
+ PageSetup::PAPERSIZE_SUPERB_SUPERB_A3_PAPER => [864.57, 1380.47], // (305 mm by 487 mm)
+ PageSetup::PAPERSIZE_LETTER_PLUS_PAPER => [612.00, 913.68], // (8.5 in. by 12.69 in.)
+ PageSetup::PAPERSIZE_A4_PLUS_PAPER => [595.28, 935.43], // (210 mm by 330 mm)
+ PageSetup::PAPERSIZE_A5_TRANSVERSE_PAPER => 'A5', // (148 mm by 210 mm)
+ PageSetup::PAPERSIZE_JIS_B5_TRANSVERSE_PAPER => [515.91, 728.50], // (182 mm by 257 mm)
+ PageSetup::PAPERSIZE_A3_EXTRA_PAPER => [912.76, 1261.42], // (322 mm by 445 mm)
+ PageSetup::PAPERSIZE_A5_EXTRA_PAPER => [493.23, 666.14], // (174 mm by 235 mm)
+ PageSetup::PAPERSIZE_ISO_B5_EXTRA_PAPER => [569.76, 782.36], // (201 mm by 276 mm)
+ PageSetup::PAPERSIZE_A2_PAPER => 'A2', // (420 mm by 594 mm)
+ PageSetup::PAPERSIZE_A3_TRANSVERSE_PAPER => 'A3', // (297 mm by 420 mm)
+ PageSetup::PAPERSIZE_A3_EXTRA_TRANSVERSE_PAPER => [912.76, 1261.42], // (322 mm by 445 mm)
+ ];
+
+ /**
+ * Create a new PDF Writer instance.
+ *
+ * @param Spreadsheet $spreadsheet Spreadsheet object
+ */
+ public function __construct(Spreadsheet $spreadsheet)
+ {
+ parent::__construct($spreadsheet);
+ $this->setUseInlineCss(true);
+ $this->tempDir = File::sysGetTempDir();
+ }
+
+ /**
+ * Get Font.
+ *
+ * @return string
+ */
+ public function getFont()
+ {
+ return $this->font;
+ }
+
+ /**
+ * Set font. Examples:
+ * 'arialunicid0-chinese-simplified'
+ * 'arialunicid0-chinese-traditional'
+ * 'arialunicid0-korean'
+ * 'arialunicid0-japanese'.
+ *
+ * @param string $fontName
+ *
+ * @return Pdf
+ */
+ public function setFont($fontName)
+ {
+ $this->font = $fontName;
+
+ return $this;
+ }
+
+ /**
+ * Get Paper Size.
+ *
+ * @return int
+ */
+ public function getPaperSize()
+ {
+ return $this->paperSize;
+ }
+
+ /**
+ * Set Paper Size.
+ *
+ * @param string $pValue Paper size see PageSetup::PAPERSIZE_*
+ *
+ * @return self
+ */
+ public function setPaperSize($pValue)
+ {
+ $this->paperSize = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get Orientation.
+ *
+ * @return string
+ */
+ public function getOrientation()
+ {
+ return $this->orientation;
+ }
+
+ /**
+ * Set Orientation.
+ *
+ * @param string $pValue Page orientation see PageSetup::ORIENTATION_*
+ *
+ * @return self
+ */
+ public function setOrientation($pValue)
+ {
+ $this->orientation = $pValue;
+
+ return $this;
+ }
+
+ /**
+ * Get temporary storage directory.
+ *
+ * @return string
+ */
+ public function getTempDir()
+ {
+ return $this->tempDir;
+ }
+
+ /**
+ * Set temporary storage directory.
+ *
+ * @param string $pValue Temporary storage directory
+ *
+ * @throws WriterException when directory does not exist
+ *
+ * @return self
+ */
+ public function setTempDir($pValue)
+ {
+ if (is_dir($pValue)) {
+ $this->tempDir = $pValue;
+ } else {
+ throw new WriterException("Directory does not exist: $pValue");
+ }
+
+ return $this;
+ }
+
+ /**
+ * Save Spreadsheet to PDF file, pre-save.
+ *
+ * @param string $pFilename Name of the file to save as
+ *
+ * @throws WriterException
+ *
+ * @return resource
+ */
+ protected function prepareForSave($pFilename)
+ {
+ // garbage collect
+ $this->spreadsheet->garbageCollect();
+
+ $this->saveArrayReturnType = Calculation::getArrayReturnType();
+ Calculation::setArrayReturnType(Calculation::RETURN_ARRAY_AS_VALUE);
+
+ // Open file
+ $fileHandle = fopen($pFilename, 'w');
+ if ($fileHandle === false) {
+ throw new WriterException("Could not open file $pFilename for writing.");
+ }
+
+ // Set PDF
+ $this->isPdf = true;
+ // Build CSS
+ $this->buildCSS(true);
+
+ return $fileHandle;
+ }
+
+ /**
+ * Save PhpSpreadsheet to PDF file, post-save.
+ *
+ * @param resource $fileHandle
+ */
+ protected function restoreStateAfterSave($fileHandle)
+ {
+ // Close file
+ fclose($fileHandle);
+
+ Calculation::setArrayReturnType($this->saveArrayReturnType);
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php
new file mode 100644
index 00000000000..3c3044d711b
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Dompdf.php
@@ -0,0 +1,78 @@
+getSheetIndex() === null) {
+ $orientation = ($this->spreadsheet->getSheet(0)->getPageSetup()->getOrientation()
+ == PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
+ $printPaperSize = $this->spreadsheet->getSheet(0)->getPageSetup()->getPaperSize();
+ } else {
+ $orientation = ($this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
+ == PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
+ $printPaperSize = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
+ }
+
+ $orientation = ($orientation == 'L') ? 'landscape' : 'portrait';
+
+ // Override Page Orientation
+ if ($this->getOrientation() !== null) {
+ $orientation = ($this->getOrientation() == PageSetup::ORIENTATION_DEFAULT)
+ ? PageSetup::ORIENTATION_PORTRAIT
+ : $this->getOrientation();
+ }
+ // Override Paper Size
+ if ($this->getPaperSize() !== null) {
+ $printPaperSize = $this->getPaperSize();
+ }
+
+ if (isset(self::$paperSizes[$printPaperSize])) {
+ $paperSize = self::$paperSizes[$printPaperSize];
+ }
+
+ // Create PDF
+ $pdf = $this->createExternalWriterInstance();
+ $pdf->setPaper(strtolower($paperSize), $orientation);
+
+ $pdf->loadHtml(
+ $this->generateHTMLHeader(false) .
+ $this->generateSheetData() .
+ $this->generateHTMLFooter()
+ );
+ $pdf->render();
+
+ // Write to file
+ fwrite($fileHandle, $pdf->output());
+
+ parent::restoreStateAfterSave($fileHandle);
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Mpdf.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Mpdf.php
new file mode 100644
index 00000000000..fd2664a8238
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Mpdf.php
@@ -0,0 +1,112 @@
+getSheetIndex()) {
+ $orientation = ($this->spreadsheet->getSheet(0)->getPageSetup()->getOrientation()
+ == PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
+ $printPaperSize = $this->spreadsheet->getSheet(0)->getPageSetup()->getPaperSize();
+ } else {
+ $orientation = ($this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
+ == PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
+ $printPaperSize = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
+ }
+ $this->setOrientation($orientation);
+
+ // Override Page Orientation
+ if (null !== $this->getOrientation()) {
+ $orientation = ($this->getOrientation() == PageSetup::ORIENTATION_DEFAULT)
+ ? PageSetup::ORIENTATION_PORTRAIT
+ : $this->getOrientation();
+ }
+ $orientation = strtoupper($orientation);
+
+ // Override Paper Size
+ if (null !== $this->getPaperSize()) {
+ $printPaperSize = $this->getPaperSize();
+ }
+
+ if (isset(self::$paperSizes[$printPaperSize])) {
+ $paperSize = self::$paperSizes[$printPaperSize];
+ }
+
+ // Create PDF
+ $config = ['tempDir' => $this->tempDir];
+ $pdf = $this->createExternalWriterInstance($config);
+ $ortmp = $orientation;
+ $pdf->_setPageSize(strtoupper($paperSize), $ortmp);
+ $pdf->DefOrientation = $orientation;
+ $pdf->AddPageByArray([
+ 'orientation' => $orientation,
+ 'margin-left' => $this->inchesToMm($this->spreadsheet->getActiveSheet()->getPageMargins()->getLeft()),
+ 'margin-right' => $this->inchesToMm($this->spreadsheet->getActiveSheet()->getPageMargins()->getRight()),
+ 'margin-top' => $this->inchesToMm($this->spreadsheet->getActiveSheet()->getPageMargins()->getTop()),
+ 'margin-bottom' => $this->inchesToMm($this->spreadsheet->getActiveSheet()->getPageMargins()->getBottom()),
+ ]);
+
+ // Document info
+ $pdf->SetTitle($this->spreadsheet->getProperties()->getTitle());
+ $pdf->SetAuthor($this->spreadsheet->getProperties()->getCreator());
+ $pdf->SetSubject($this->spreadsheet->getProperties()->getSubject());
+ $pdf->SetKeywords($this->spreadsheet->getProperties()->getKeywords());
+ $pdf->SetCreator($this->spreadsheet->getProperties()->getCreator());
+
+ $pdf->WriteHTML($this->generateHTMLHeader(false));
+ $html = $this->generateSheetData();
+ foreach (\array_chunk(\explode(PHP_EOL, $html), 1000) as $lines) {
+ $pdf->WriteHTML(\implode(PHP_EOL, $lines));
+ }
+ $pdf->WriteHTML($this->generateHTMLFooter());
+
+ // Write to file
+ fwrite($fileHandle, $pdf->Output('', 'S'));
+
+ parent::restoreStateAfterSave($fileHandle);
+ }
+
+ /**
+ * Convert inches to mm.
+ *
+ * @param float $inches
+ *
+ * @return float
+ */
+ private function inchesToMm($inches)
+ {
+ return $inches * 25.4;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php
new file mode 100644
index 00000000000..8a97b8fed5d
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Pdf/Tcpdf.php
@@ -0,0 +1,98 @@
+getSheetIndex() === null) {
+ $orientation = ($this->spreadsheet->getSheet(0)->getPageSetup()->getOrientation()
+ == PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
+ $printPaperSize = $this->spreadsheet->getSheet(0)->getPageSetup()->getPaperSize();
+ $printMargins = $this->spreadsheet->getSheet(0)->getPageMargins();
+ } else {
+ $orientation = ($this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getOrientation()
+ == PageSetup::ORIENTATION_LANDSCAPE) ? 'L' : 'P';
+ $printPaperSize = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageSetup()->getPaperSize();
+ $printMargins = $this->spreadsheet->getSheet($this->getSheetIndex())->getPageMargins();
+ }
+
+ // Override Page Orientation
+ if ($this->getOrientation() !== null) {
+ $orientation = ($this->getOrientation() == PageSetup::ORIENTATION_LANDSCAPE)
+ ? 'L'
+ : 'P';
+ }
+ // Override Paper Size
+ if ($this->getPaperSize() !== null) {
+ $printPaperSize = $this->getPaperSize();
+ }
+
+ if (isset(self::$paperSizes[$printPaperSize])) {
+ $paperSize = self::$paperSizes[$printPaperSize];
+ }
+
+ // Create PDF
+ $pdf = $this->createExternalWriterInstance($orientation, 'pt', $paperSize);
+ $pdf->setFontSubsetting(false);
+ // Set margins, converting inches to points (using 72 dpi)
+ $pdf->SetMargins($printMargins->getLeft() * 72, $printMargins->getTop() * 72, $printMargins->getRight() * 72);
+ $pdf->SetAutoPageBreak(true, $printMargins->getBottom() * 72);
+
+ $pdf->setPrintHeader(false);
+ $pdf->setPrintFooter(false);
+
+ $pdf->AddPage();
+
+ // Set the appropriate font
+ $pdf->SetFont($this->getFont());
+ $pdf->writeHTML(
+ $this->generateHTMLHeader(false) .
+ $this->generateSheetData() .
+ $this->generateHTMLFooter()
+ );
+
+ // Document info
+ $pdf->SetTitle($this->spreadsheet->getProperties()->getTitle());
+ $pdf->SetAuthor($this->spreadsheet->getProperties()->getCreator());
+ $pdf->SetSubject($this->spreadsheet->getProperties()->getSubject());
+ $pdf->SetKeywords($this->spreadsheet->getProperties()->getKeywords());
+ $pdf->SetCreator($this->spreadsheet->getProperties()->getCreator());
+
+ // Write to file
+ fwrite($fileHandle, $pdf->output($pFilename, 'S'));
+
+ parent::restoreStateAfterSave($fileHandle);
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php
new file mode 100644
index 00000000000..dd19021e46e
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx.php
@@ -0,0 +1,547 @@
+setSpreadsheet($spreadsheet);
+
+ $writerPartsArray = [
+ 'stringtable' => StringTable::class,
+ 'contenttypes' => ContentTypes::class,
+ 'docprops' => DocProps::class,
+ 'rels' => Rels::class,
+ 'theme' => Theme::class,
+ 'style' => Style::class,
+ 'workbook' => Workbook::class,
+ 'worksheet' => Worksheet::class,
+ 'drawing' => Drawing::class,
+ 'comments' => Comments::class,
+ 'chart' => Chart::class,
+ 'relsvba' => RelsVBA::class,
+ 'relsribbonobjects' => RelsRibbon::class,
+ ];
+
+ // Initialise writer parts
+ // and Assign their parent IWriters
+ foreach ($writerPartsArray as $writer => $class) {
+ $this->writerParts[$writer] = new $class($this);
+ }
+
+ $hashTablesArray = ['stylesConditionalHashTable', 'fillHashTable', 'fontHashTable',
+ 'bordersHashTable', 'numFmtHashTable', 'drawingHashTable',
+ 'styleHashTable',
+ ];
+
+ // Set HashTable variables
+ foreach ($hashTablesArray as $tableName) {
+ $this->$tableName = new HashTable();
+ }
+ }
+
+ /**
+ * Get writer part.
+ *
+ * @param string $pPartName Writer part name
+ *
+ * @return \PhpOffice\PhpSpreadsheet\Writer\Xlsx\WriterPart
+ */
+ public function getWriterPart($pPartName)
+ {
+ if ($pPartName != '' && isset($this->writerParts[strtolower($pPartName)])) {
+ return $this->writerParts[strtolower($pPartName)];
+ }
+
+ return null;
+ }
+
+ /**
+ * Save PhpSpreadsheet to file.
+ *
+ * @param string $pFilename
+ *
+ * @throws WriterException
+ */
+ public function save($pFilename)
+ {
+ if ($this->spreadSheet !== null) {
+ // garbage collect
+ $this->spreadSheet->garbageCollect();
+
+ // If $pFilename is php://output or php://stdout, make it a temporary file...
+ $originalFilename = $pFilename;
+ if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') {
+ $pFilename = @tempnam(File::sysGetTempDir(), 'phpxltmp');
+ if ($pFilename == '') {
+ $pFilename = $originalFilename;
+ }
+ }
+
+ $saveDebugLog = Calculation::getInstance($this->spreadSheet)->getDebugLog()->getWriteDebugLog();
+ Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog(false);
+ $saveDateReturnType = Functions::getReturnDateType();
+ Functions::setReturnDateType(Functions::RETURNDATE_EXCEL);
+
+ // Create string lookup table
+ $this->stringTable = [];
+ for ($i = 0; $i < $this->spreadSheet->getSheetCount(); ++$i) {
+ $this->stringTable = $this->getWriterPart('StringTable')->createStringTable($this->spreadSheet->getSheet($i), $this->stringTable);
+ }
+
+ // Create styles dictionaries
+ $this->styleHashTable->addFromSource($this->getWriterPart('Style')->allStyles($this->spreadSheet));
+ $this->stylesConditionalHashTable->addFromSource($this->getWriterPart('Style')->allConditionalStyles($this->spreadSheet));
+ $this->fillHashTable->addFromSource($this->getWriterPart('Style')->allFills($this->spreadSheet));
+ $this->fontHashTable->addFromSource($this->getWriterPart('Style')->allFonts($this->spreadSheet));
+ $this->bordersHashTable->addFromSource($this->getWriterPart('Style')->allBorders($this->spreadSheet));
+ $this->numFmtHashTable->addFromSource($this->getWriterPart('Style')->allNumberFormats($this->spreadSheet));
+
+ // Create drawing dictionary
+ $this->drawingHashTable->addFromSource($this->getWriterPart('Drawing')->allDrawings($this->spreadSheet));
+
+ $zip = new ZipArchive();
+
+ if (file_exists($pFilename)) {
+ unlink($pFilename);
+ }
+ // Try opening the ZIP file
+ if ($zip->open($pFilename, ZipArchive::OVERWRITE) !== true) {
+ if ($zip->open($pFilename, ZipArchive::CREATE) !== true) {
+ throw new WriterException('Could not open ' . $pFilename . ' for writing.');
+ }
+ }
+
+ // Add [Content_Types].xml to ZIP file
+ $zip->addFromString('[Content_Types].xml', $this->getWriterPart('ContentTypes')->writeContentTypes($this->spreadSheet, $this->includeCharts));
+
+ //if hasMacros, add the vbaProject.bin file, Certificate file(if exists)
+ if ($this->spreadSheet->hasMacros()) {
+ $macrosCode = $this->spreadSheet->getMacrosCode();
+ if ($macrosCode !== null) {
+ // we have the code ?
+ $zip->addFromString('xl/vbaProject.bin', $macrosCode); //allways in 'xl', allways named vbaProject.bin
+ if ($this->spreadSheet->hasMacrosCertificate()) {
+ //signed macros ?
+ // Yes : add the certificate file and the related rels file
+ $zip->addFromString('xl/vbaProjectSignature.bin', $this->spreadSheet->getMacrosCertificate());
+ $zip->addFromString('xl/_rels/vbaProject.bin.rels', $this->getWriterPart('RelsVBA')->writeVBARelationships($this->spreadSheet));
+ }
+ }
+ }
+ //a custom UI in this workbook ? add it ("base" xml and additional objects (pictures) and rels)
+ if ($this->spreadSheet->hasRibbon()) {
+ $tmpRibbonTarget = $this->spreadSheet->getRibbonXMLData('target');
+ $zip->addFromString($tmpRibbonTarget, $this->spreadSheet->getRibbonXMLData('data'));
+ if ($this->spreadSheet->hasRibbonBinObjects()) {
+ $tmpRootPath = dirname($tmpRibbonTarget) . '/';
+ $ribbonBinObjects = $this->spreadSheet->getRibbonBinObjects('data'); //the files to write
+ foreach ($ribbonBinObjects as $aPath => $aContent) {
+ $zip->addFromString($tmpRootPath . $aPath, $aContent);
+ }
+ //the rels for files
+ $zip->addFromString($tmpRootPath . '_rels/' . basename($tmpRibbonTarget) . '.rels', $this->getWriterPart('RelsRibbonObjects')->writeRibbonRelationships($this->spreadSheet));
+ }
+ }
+
+ // Add relationships to ZIP file
+ $zip->addFromString('_rels/.rels', $this->getWriterPart('Rels')->writeRelationships($this->spreadSheet));
+ $zip->addFromString('xl/_rels/workbook.xml.rels', $this->getWriterPart('Rels')->writeWorkbookRelationships($this->spreadSheet));
+
+ // Add document properties to ZIP file
+ $zip->addFromString('docProps/app.xml', $this->getWriterPart('DocProps')->writeDocPropsApp($this->spreadSheet));
+ $zip->addFromString('docProps/core.xml', $this->getWriterPart('DocProps')->writeDocPropsCore($this->spreadSheet));
+ $customPropertiesPart = $this->getWriterPart('DocProps')->writeDocPropsCustom($this->spreadSheet);
+ if ($customPropertiesPart !== null) {
+ $zip->addFromString('docProps/custom.xml', $customPropertiesPart);
+ }
+
+ // Add theme to ZIP file
+ $zip->addFromString('xl/theme/theme1.xml', $this->getWriterPart('Theme')->writeTheme($this->spreadSheet));
+
+ // Add string table to ZIP file
+ $zip->addFromString('xl/sharedStrings.xml', $this->getWriterPart('StringTable')->writeStringTable($this->stringTable));
+
+ // Add styles to ZIP file
+ $zip->addFromString('xl/styles.xml', $this->getWriterPart('Style')->writeStyles($this->spreadSheet));
+
+ // Add workbook to ZIP file
+ $zip->addFromString('xl/workbook.xml', $this->getWriterPart('Workbook')->writeWorkbook($this->spreadSheet, $this->preCalculateFormulas));
+
+ $chartCount = 0;
+ // Add worksheets
+ for ($i = 0; $i < $this->spreadSheet->getSheetCount(); ++$i) {
+ $zip->addFromString('xl/worksheets/sheet' . ($i + 1) . '.xml', $this->getWriterPart('Worksheet')->writeWorksheet($this->spreadSheet->getSheet($i), $this->stringTable, $this->includeCharts));
+ if ($this->includeCharts) {
+ $charts = $this->spreadSheet->getSheet($i)->getChartCollection();
+ if (count($charts) > 0) {
+ foreach ($charts as $chart) {
+ $zip->addFromString('xl/charts/chart' . ($chartCount + 1) . '.xml', $this->getWriterPart('Chart')->writeChart($chart, $this->preCalculateFormulas));
+ ++$chartCount;
+ }
+ }
+ }
+ }
+
+ $chartRef1 = 0;
+ // Add worksheet relationships (drawings, ...)
+ for ($i = 0; $i < $this->spreadSheet->getSheetCount(); ++$i) {
+ // Add relationships
+ $zip->addFromString('xl/worksheets/_rels/sheet' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeWorksheetRelationships($this->spreadSheet->getSheet($i), ($i + 1), $this->includeCharts));
+
+ // Add unparsedLoadedData
+ $sheetCodeName = $this->spreadSheet->getSheet($i)->getCodeName();
+ $unparsedLoadedData = $this->spreadSheet->getUnparsedLoadedData();
+ if (isset($unparsedLoadedData['sheets'][$sheetCodeName]['ctrlProps'])) {
+ foreach ($unparsedLoadedData['sheets'][$sheetCodeName]['ctrlProps'] as $ctrlProp) {
+ $zip->addFromString($ctrlProp['filePath'], $ctrlProp['content']);
+ }
+ }
+ if (isset($unparsedLoadedData['sheets'][$sheetCodeName]['printerSettings'])) {
+ foreach ($unparsedLoadedData['sheets'][$sheetCodeName]['printerSettings'] as $ctrlProp) {
+ $zip->addFromString($ctrlProp['filePath'], $ctrlProp['content']);
+ }
+ }
+
+ $drawings = $this->spreadSheet->getSheet($i)->getDrawingCollection();
+ $drawingCount = count($drawings);
+ if ($this->includeCharts) {
+ $chartCount = $this->spreadSheet->getSheet($i)->getChartCount();
+ }
+
+ // Add drawing and image relationship parts
+ if (($drawingCount > 0) || ($chartCount > 0)) {
+ // Drawing relationships
+ $zip->addFromString('xl/drawings/_rels/drawing' . ($i + 1) . '.xml.rels', $this->getWriterPart('Rels')->writeDrawingRelationships($this->spreadSheet->getSheet($i), $chartRef1, $this->includeCharts));
+
+ // Drawings
+ $zip->addFromString('xl/drawings/drawing' . ($i + 1) . '.xml', $this->getWriterPart('Drawing')->writeDrawings($this->spreadSheet->getSheet($i), $this->includeCharts));
+ } elseif (isset($unparsedLoadedData['sheets'][$sheetCodeName]['drawingAlternateContents'])) {
+ // Drawings
+ $zip->addFromString('xl/drawings/drawing' . ($i + 1) . '.xml', $this->getWriterPart('Drawing')->writeDrawings($this->spreadSheet->getSheet($i), $this->includeCharts));
+ }
+
+ // Add comment relationship parts
+ if (count($this->spreadSheet->getSheet($i)->getComments()) > 0) {
+ // VML Comments
+ $zip->addFromString('xl/drawings/vmlDrawing' . ($i + 1) . '.vml', $this->getWriterPart('Comments')->writeVMLComments($this->spreadSheet->getSheet($i)));
+
+ // Comments
+ $zip->addFromString('xl/comments' . ($i + 1) . '.xml', $this->getWriterPart('Comments')->writeComments($this->spreadSheet->getSheet($i)));
+ }
+
+ // Add unparsed relationship parts
+ if (isset($unparsedLoadedData['sheets'][$this->spreadSheet->getSheet($i)->getCodeName()]['vmlDrawings'])) {
+ foreach ($unparsedLoadedData['sheets'][$this->spreadSheet->getSheet($i)->getCodeName()]['vmlDrawings'] as $vmlDrawing) {
+ $zip->addFromString($vmlDrawing['filePath'], $vmlDrawing['content']);
+ }
+ }
+
+ // Add header/footer relationship parts
+ if (count($this->spreadSheet->getSheet($i)->getHeaderFooter()->getImages()) > 0) {
+ // VML Drawings
+ $zip->addFromString('xl/drawings/vmlDrawingHF' . ($i + 1) . '.vml', $this->getWriterPart('Drawing')->writeVMLHeaderFooterImages($this->spreadSheet->getSheet($i)));
+
+ // VML Drawing relationships
+ $zip->addFromString('xl/drawings/_rels/vmlDrawingHF' . ($i + 1) . '.vml.rels', $this->getWriterPart('Rels')->writeHeaderFooterDrawingRelationships($this->spreadSheet->getSheet($i)));
+
+ // Media
+ foreach ($this->spreadSheet->getSheet($i)->getHeaderFooter()->getImages() as $image) {
+ $zip->addFromString('xl/media/' . $image->getIndexedFilename(), file_get_contents($image->getPath()));
+ }
+ }
+ }
+
+ // Add media
+ for ($i = 0; $i < $this->getDrawingHashTable()->count(); ++$i) {
+ if ($this->getDrawingHashTable()->getByIndex($i) instanceof WorksheetDrawing) {
+ $imageContents = null;
+ $imagePath = $this->getDrawingHashTable()->getByIndex($i)->getPath();
+ if (strpos($imagePath, 'zip://') !== false) {
+ $imagePath = substr($imagePath, 6);
+ $imagePathSplitted = explode('#', $imagePath);
+
+ $imageZip = new ZipArchive();
+ $imageZip->open($imagePathSplitted[0]);
+ $imageContents = $imageZip->getFromName($imagePathSplitted[1]);
+ $imageZip->close();
+ unset($imageZip);
+ } else {
+ $imageContents = file_get_contents($imagePath);
+ }
+
+ $zip->addFromString('xl/media/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents);
+ } elseif ($this->getDrawingHashTable()->getByIndex($i) instanceof MemoryDrawing) {
+ ob_start();
+ call_user_func(
+ $this->getDrawingHashTable()->getByIndex($i)->getRenderingFunction(),
+ $this->getDrawingHashTable()->getByIndex($i)->getImageResource()
+ );
+ $imageContents = ob_get_contents();
+ ob_end_clean();
+
+ $zip->addFromString('xl/media/' . str_replace(' ', '_', $this->getDrawingHashTable()->getByIndex($i)->getIndexedFilename()), $imageContents);
+ }
+ }
+
+ Functions::setReturnDateType($saveDateReturnType);
+ Calculation::getInstance($this->spreadSheet)->getDebugLog()->setWriteDebugLog($saveDebugLog);
+
+ // Close file
+ if ($zip->close() === false) {
+ throw new WriterException("Could not close zip file $pFilename.");
+ }
+
+ // If a temporary file was used, copy it to the correct file stream
+ if ($originalFilename != $pFilename) {
+ if (copy($pFilename, $originalFilename) === false) {
+ throw new WriterException("Could not copy temporary zip file $pFilename to $originalFilename.");
+ }
+ @unlink($pFilename);
+ }
+ } else {
+ throw new WriterException('PhpSpreadsheet object unassigned.');
+ }
+ }
+
+ /**
+ * Get Spreadsheet object.
+ *
+ * @throws WriterException
+ *
+ * @return Spreadsheet
+ */
+ public function getSpreadsheet()
+ {
+ if ($this->spreadSheet !== null) {
+ return $this->spreadSheet;
+ }
+
+ throw new WriterException('No Spreadsheet object assigned.');
+ }
+
+ /**
+ * Set Spreadsheet object.
+ *
+ * @param Spreadsheet $spreadsheet PhpSpreadsheet object
+ *
+ * @return Xlsx
+ */
+ public function setSpreadsheet(Spreadsheet $spreadsheet)
+ {
+ $this->spreadSheet = $spreadsheet;
+
+ return $this;
+ }
+
+ /**
+ * Get string table.
+ *
+ * @return string[]
+ */
+ public function getStringTable()
+ {
+ return $this->stringTable;
+ }
+
+ /**
+ * Get Style HashTable.
+ *
+ * @return HashTable
+ */
+ public function getStyleHashTable()
+ {
+ return $this->styleHashTable;
+ }
+
+ /**
+ * Get Conditional HashTable.
+ *
+ * @return HashTable
+ */
+ public function getStylesConditionalHashTable()
+ {
+ return $this->stylesConditionalHashTable;
+ }
+
+ /**
+ * Get Fill HashTable.
+ *
+ * @return HashTable
+ */
+ public function getFillHashTable()
+ {
+ return $this->fillHashTable;
+ }
+
+ /**
+ * Get \PhpOffice\PhpSpreadsheet\Style\Font HashTable.
+ *
+ * @return HashTable
+ */
+ public function getFontHashTable()
+ {
+ return $this->fontHashTable;
+ }
+
+ /**
+ * Get Borders HashTable.
+ *
+ * @return HashTable
+ */
+ public function getBordersHashTable()
+ {
+ return $this->bordersHashTable;
+ }
+
+ /**
+ * Get NumberFormat HashTable.
+ *
+ * @return HashTable
+ */
+ public function getNumFmtHashTable()
+ {
+ return $this->numFmtHashTable;
+ }
+
+ /**
+ * Get \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet\BaseDrawing HashTable.
+ *
+ * @return HashTable
+ */
+ public function getDrawingHashTable()
+ {
+ return $this->drawingHashTable;
+ }
+
+ /**
+ * Get Office2003 compatibility.
+ *
+ * @return bool
+ */
+ public function getOffice2003Compatibility()
+ {
+ return $this->office2003compatibility;
+ }
+
+ /**
+ * Set Office2003 compatibility.
+ *
+ * @param bool $pValue Office2003 compatibility?
+ *
+ * @return Xlsx
+ */
+ public function setOffice2003Compatibility($pValue)
+ {
+ $this->office2003compatibility = $pValue;
+
+ return $this;
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Writer/Excel2007/Chart.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Chart.php
similarity index 70%
rename from lib/phpexcel/PHPExcel/Writer/Excel2007/Chart.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Chart.php
index ebe0018f2c8..625fd16de21 100644
--- a/lib/phpexcel/PHPExcel/Writer/Excel2007/Chart.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Chart.php
@@ -1,51 +1,53 @@
calculateCellValues = $calculateCellValues;
+
// Create XML writer
$objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
} else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
}
// Ensure that data series values are up-to-date before we save
- $pChart->refresh();
+ if ($this->calculateCellValues) {
+ $pChart->refresh();
+ }
// XML header
$objWriter->startDocument('1.0', 'UTF-8', 'yes');
@@ -60,7 +62,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->writeAttribute('val', 0);
$objWriter->endElement();
$objWriter->startElement('c:lang');
- $objWriter->writeAttribute('val', "en-GB");
+ $objWriter->writeAttribute('val', 'en-GB');
$objWriter->endElement();
$objWriter->startElement('c:roundedCorners');
$objWriter->writeAttribute('val', 0);
@@ -70,22 +72,22 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->startElement('c:chart');
- $this->writeTitle($pChart->getTitle(), $objWriter);
+ $this->writeTitle($objWriter, $pChart->getTitle());
$objWriter->startElement('c:autoTitleDeleted');
$objWriter->writeAttribute('val', 0);
$objWriter->endElement();
- $this->writePlotArea($pChart->getPlotArea(), $pChart->getXAxisLabel(), $pChart->getYAxisLabel(), $objWriter, $pChart->getWorksheet(), $pChart->getChartAxisX(), $pChart->getChartAxisY(), $pChart->getMajorGridlines(), $pChart->getMinorGridlines());
+ $this->writePlotArea($objWriter, $pChart->getWorksheet(), $pChart->getPlotArea(), $pChart->getXAxisLabel(), $pChart->getYAxisLabel(), $pChart->getChartAxisX(), $pChart->getChartAxisY(), $pChart->getMajorGridlines(), $pChart->getMinorGridlines());
- $this->writeLegend($pChart->getLegend(), $objWriter);
+ $this->writeLegend($objWriter, $pChart->getLegend());
$objWriter->startElement('c:plotVisOnly');
$objWriter->writeAttribute('val', 1);
$objWriter->endElement();
$objWriter->startElement('c:dispBlanksAs');
- $objWriter->writeAttribute('val', "gap");
+ $objWriter->writeAttribute('val', 'gap');
$objWriter->endElement();
$objWriter->startElement('c:showDLblsOverMax');
@@ -103,16 +105,16 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Chart Title
+ * Write Chart Title.
*
- * @param PHPExcel_Chart_Title $title
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
+ * @param XMLWriter $objWriter XML Writer
+ * @param Title $title
*
- * @throws PHPExcel_Writer_Exception
+ * @throws WriterException
*/
- private function writeTitle(PHPExcel_Chart_Title $title = null, $objWriter)
+ private function writeTitle(XMLWriter $objWriter, Title $title = null)
{
- if (is_null($title)) {
+ if ($title === null) {
return;
}
@@ -138,7 +140,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement();
$objWriter->endElement();
- $this->writeLayout($title->getLayout(), $objWriter);
+ $this->writeLayout($objWriter, $title->getLayout());
$objWriter->startElement('c:overlay');
$objWriter->writeAttribute('val', 0);
@@ -148,16 +150,16 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Chart Legend
+ * Write Chart Legend.
*
- * @param PHPExcel_Chart_Legend $legend
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
+ * @param XMLWriter $objWriter XML Writer
+ * @param Legend $legend
*
- * @throws PHPExcel_Writer_Exception
+ * @throws WriterException
*/
- private function writeLegend(PHPExcel_Chart_Legend $legend = null, $objWriter)
+ private function writeLegend(XMLWriter $objWriter, Legend $legend = null)
{
- if (is_null($legend)) {
+ if ($legend === null) {
return;
}
@@ -167,7 +169,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->writeAttribute('val', $legend->getPosition());
$objWriter->endElement();
- $this->writeLayout($legend->getLayout(), $objWriter);
+ $this->writeLayout($objWriter, $legend->getLayout());
$objWriter->startElement('c:overlay');
$objWriter->writeAttribute('val', ($legend->getOverlay()) ? '1' : '0');
@@ -189,7 +191,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement();
$objWriter->startElement('a:endParaRPr');
- $objWriter->writeAttribute('lang', "en-US");
+ $objWriter->writeAttribute('lang', 'en-US');
$objWriter->endElement();
$objWriter->endElement();
@@ -199,30 +201,33 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Chart Plot Area
+ * Write Chart Plot Area.
*
- * @param PHPExcel_Chart_PlotArea $plotArea
- * @param PHPExcel_Chart_Title $xAxisLabel
- * @param PHPExcel_Chart_Title $yAxisLabel
- * @param PHPExcel_Chart_Axis $xAxis
- * @param PHPExcel_Chart_Axis $yAxis
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
+ * @param XMLWriter $objWriter XML Writer
+ * @param \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet
+ * @param PlotArea $plotArea
+ * @param Title $xAxisLabel
+ * @param Title $yAxisLabel
+ * @param Axis $xAxis
+ * @param Axis $yAxis
+ * @param null|GridLines $majorGridlines
+ * @param null|GridLines $minorGridlines
*
- * @throws PHPExcel_Writer_Exception
+ * @throws WriterException
*/
- private function writePlotArea(PHPExcel_Chart_PlotArea $plotArea, PHPExcel_Chart_Title $xAxisLabel = null, PHPExcel_Chart_Title $yAxisLabel = null, $objWriter, PHPExcel_Worksheet $pSheet, PHPExcel_Chart_Axis $xAxis, PHPExcel_Chart_Axis $yAxis, PHPExcel_Chart_GridLines $majorGridlines, PHPExcel_Chart_GridLines $minorGridlines)
+ private function writePlotArea(XMLWriter $objWriter, \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pSheet, PlotArea $plotArea, Title $xAxisLabel = null, Title $yAxisLabel = null, Axis $xAxis = null, Axis $yAxis = null, GridLines $majorGridlines = null, GridLines $minorGridlines = null)
{
- if (is_null($plotArea)) {
+ if ($plotArea === null) {
return;
}
$id1 = $id2 = 0;
- $this->_seriesIndex = 0;
+ $this->seriesIndex = 0;
$objWriter->startElement('c:plotArea');
$layout = $plotArea->getLayout();
- $this->writeLayout($layout, $objWriter);
+ $this->writeLayout($objWriter, $layout);
$chartTypes = self::getChartType($plotArea);
$catIsMultiLevelSeries = $valIsMultiLevelSeries = false;
@@ -236,29 +241,28 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$groupType = $plotGroup->getPlotType();
if ($groupType == $chartType) {
$plotStyle = $plotGroup->getPlotStyle();
- if ($groupType === PHPExcel_Chart_DataSeries::TYPE_RADARCHART) {
+ if ($groupType === DataSeries::TYPE_RADARCHART) {
$objWriter->startElement('c:radarStyle');
$objWriter->writeAttribute('val', $plotStyle);
$objWriter->endElement();
- } elseif ($groupType === PHPExcel_Chart_DataSeries::TYPE_SCATTERCHART) {
+ } elseif ($groupType === DataSeries::TYPE_SCATTERCHART) {
$objWriter->startElement('c:scatterStyle');
$objWriter->writeAttribute('val', $plotStyle);
$objWriter->endElement();
}
- $this->writePlotGroup($plotGroup, $chartType, $objWriter, $catIsMultiLevelSeries, $valIsMultiLevelSeries, $plotGroupingType, $pSheet);
+ $this->writePlotGroup($plotGroup, $chartType, $objWriter, $catIsMultiLevelSeries, $valIsMultiLevelSeries, $plotGroupingType);
}
}
$this->writeDataLabels($objWriter, $layout);
- if ($chartType === PHPExcel_Chart_DataSeries::TYPE_LINECHART) {
+ if ($chartType === DataSeries::TYPE_LINECHART) {
// Line only, Line3D can't be smoothed
-
$objWriter->startElement('c:smooth');
- $objWriter->writeAttribute('val', (integer) $plotGroup->getSmoothLine());
+ $objWriter->writeAttribute('val', (int) $plotGroup->getSmoothLine());
$objWriter->endElement();
- } elseif (($chartType === PHPExcel_Chart_DataSeries::TYPE_BARCHART) ||($chartType === PHPExcel_Chart_DataSeries::TYPE_BARCHART_3D)) {
+ } elseif (($chartType === DataSeries::TYPE_BARCHART) || ($chartType === DataSeries::TYPE_BARCHART_3D)) {
$objWriter->startElement('c:gapWidth');
$objWriter->writeAttribute('val', 150);
$objWriter->endElement();
@@ -268,7 +272,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->writeAttribute('val', 100);
$objWriter->endElement();
}
- } elseif ($chartType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) {
+ } elseif ($chartType === DataSeries::TYPE_BUBBLECHART) {
$objWriter->startElement('c:bubbleScale');
$objWriter->writeAttribute('val', 25);
$objWriter->endElement();
@@ -276,7 +280,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->startElement('c:showNegBubbles');
$objWriter->writeAttribute('val', 0);
$objWriter->endElement();
- } elseif ($chartType === PHPExcel_Chart_DataSeries::TYPE_STOCKCHART) {
+ } elseif ($chartType === DataSeries::TYPE_STOCKCHART) {
$objWriter->startElement('c:hiLowLines');
$objWriter->endElement();
@@ -296,14 +300,10 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
// Generate 2 unique numbers to use for axId values
- // $id1 = $id2 = rand(10000000,99999999);
- // do {
- // $id2 = rand(10000000,99999999);
- // } while ($id1 == $id2);
$id1 = '75091328';
$id2 = '75089408';
- if (($chartType !== PHPExcel_Chart_DataSeries::TYPE_PIECHART) && ($chartType !== PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) && ($chartType !== PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)) {
+ if (($chartType !== DataSeries::TYPE_PIECHART) && ($chartType !== DataSeries::TYPE_PIECHART_3D) && ($chartType !== DataSeries::TYPE_DONUTCHART)) {
$objWriter->startElement('c:axId');
$objWriter->writeAttribute('val', $id1);
$objWriter->endElement();
@@ -315,7 +315,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->writeAttribute('val', 0);
$objWriter->endElement();
- if ($chartType === PHPExcel_Chart_DataSeries::TYPE_DONUTCHART) {
+ if ($chartType === DataSeries::TYPE_DONUTCHART) {
$objWriter->startElement('c:holeSize');
$objWriter->writeAttribute('val', 50);
$objWriter->endElement();
@@ -325,28 +325,26 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement();
}
- if (($chartType !== PHPExcel_Chart_DataSeries::TYPE_PIECHART) && ($chartType !== PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) && ($chartType !== PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)) {
- if ($chartType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) {
- $this->writeValueAxis($objWriter, $plotArea, $xAxisLabel, $chartType, $id1, $id2, $catIsMultiLevelSeries, $xAxis, $yAxis, $majorGridlines, $minorGridlines);
+ if (($chartType !== DataSeries::TYPE_PIECHART) && ($chartType !== DataSeries::TYPE_PIECHART_3D) && ($chartType !== DataSeries::TYPE_DONUTCHART)) {
+ if ($chartType === DataSeries::TYPE_BUBBLECHART) {
+ $this->writeValueAxis($objWriter, $xAxisLabel, $chartType, $id1, $id2, $catIsMultiLevelSeries, $xAxis, $majorGridlines, $minorGridlines);
} else {
- $this->writeCategoryAxis($objWriter, $plotArea, $xAxisLabel, $chartType, $id1, $id2, $catIsMultiLevelSeries, $xAxis, $yAxis);
+ $this->writeCategoryAxis($objWriter, $xAxisLabel, $id1, $id2, $catIsMultiLevelSeries, $yAxis);
}
- $this->writeValueAxis($objWriter, $plotArea, $yAxisLabel, $chartType, $id1, $id2, $valIsMultiLevelSeries, $xAxis, $yAxis, $majorGridlines, $minorGridlines);
+ $this->writeValueAxis($objWriter, $yAxisLabel, $chartType, $id1, $id2, $valIsMultiLevelSeries, $xAxis, $majorGridlines, $minorGridlines);
}
$objWriter->endElement();
}
/**
- * Write Data Labels
+ * Write Data Labels.
*
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Chart_Layout $chartLayout Chart layout
- *
- * @throws PHPExcel_Writer_Exception
+ * @param XMLWriter $objWriter XML Writer
+ * @param \PhpOffice\PhpSpreadsheet\Chart\Layout $chartLayout Chart layout
*/
- private function writeDataLabels($objWriter, $chartLayout)
+ private function writeDataLabels(XMLWriter $objWriter, Layout $chartLayout = null)
{
$objWriter->startElement('c:dLbls');
@@ -389,19 +387,18 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Category Axis
+ * Write Category Axis.
*
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Chart_PlotArea $plotArea
- * @param PHPExcel_Chart_Title $xAxisLabel
- * @param string $groupType Chart type
- * @param string $id1
- * @param string $id2
- * @param boolean $isMultiLevelSeries
+ * @param XMLWriter $objWriter XML Writer
+ * @param Title $xAxisLabel
+ * @param string $id1
+ * @param string $id2
+ * @param bool $isMultiLevelSeries
+ * @param Axis $yAxis
*
- * @throws PHPExcel_Writer_Exception
+ * @throws WriterException
*/
- private function writeCategoryAxis($objWriter, PHPExcel_Chart_PlotArea $plotArea, $xAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis)
+ private function writeCategoryAxis($objWriter, $xAxisLabel, $id1, $id2, $isMultiLevelSeries, Axis $yAxis)
{
$objWriter->startElement('c:catAx');
@@ -422,10 +419,10 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement();
$objWriter->startElement('c:axPos');
- $objWriter->writeAttribute('val', "b");
+ $objWriter->writeAttribute('val', 'b');
$objWriter->endElement();
- if (!is_null($xAxisLabel)) {
+ if ($xAxisLabel !== null) {
$objWriter->startElement('c:title');
$objWriter->startElement('c:tx');
$objWriter->startElement('c:rich');
@@ -444,8 +441,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$caption = $caption[0];
}
$objWriter->startElement('a:t');
- // $objWriter->writeAttribute('xml:space', 'preserve');
- $objWriter->writeRawData(PHPExcel_Shared_String::ControlCharacterPHP2OOXML($caption));
+ $objWriter->writeRawData(StringHelper::controlCharacterPHP2OOXML($caption));
$objWriter->endElement();
$objWriter->endElement();
@@ -454,7 +450,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement();
$layout = $xAxisLabel->getLayout();
- $this->writeLayout($layout, $objWriter);
+ $this->writeLayout($objWriter, $layout);
$objWriter->startElement('c:overlay');
$objWriter->writeAttribute('val', 0);
@@ -495,7 +491,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement();
$objWriter->startElement('c:lblAlgn');
- $objWriter->writeAttribute('val', "ctr");
+ $objWriter->writeAttribute('val', 'ctr');
$objWriter->endElement();
$objWriter->startElement('c:lblOffset');
@@ -511,19 +507,21 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Value Axis
+ * Write Value Axis.
*
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Chart_PlotArea $plotArea
- * @param PHPExcel_Chart_Title $yAxisLabel
- * @param string $groupType Chart type
- * @param string $id1
- * @param string $id2
- * @param boolean $isMultiLevelSeries
+ * @param XMLWriter $objWriter XML Writer
+ * @param Title $yAxisLabel
+ * @param string $groupType Chart type
+ * @param string $id1
+ * @param string $id2
+ * @param bool $isMultiLevelSeries
+ * @param Axis $xAxis
+ * @param GridLines $majorGridlines
+ * @param GridLines $minorGridlines
*
- * @throws PHPExcel_Writer_Exception
+ * @throws WriterException
*/
- private function writeValueAxis($objWriter, PHPExcel_Chart_PlotArea $plotArea, $yAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, $xAxis, $yAxis, $majorGridlines, $minorGridlines)
+ private function writeValueAxis($objWriter, $yAxisLabel, $groupType, $id1, $id2, $isMultiLevelSeries, Axis $xAxis, GridLines $majorGridlines, GridLines $minorGridlines)
{
$objWriter->startElement('c:valAx');
@@ -534,21 +532,22 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
$objWriter->startElement('c:scaling');
- $objWriter->startElement('c:orientation');
- $objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('orientation'));
- if (!is_null($xAxis->getAxisOptionsProperty('maximum'))) {
+ if ($xAxis->getAxisOptionsProperty('maximum') !== null) {
$objWriter->startElement('c:max');
$objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('maximum'));
$objWriter->endElement();
}
- if (!is_null($xAxis->getAxisOptionsProperty('minimum'))) {
+ if ($xAxis->getAxisOptionsProperty('minimum') !== null) {
$objWriter->startElement('c:min');
$objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('minimum'));
$objWriter->endElement();
}
+ $objWriter->startElement('c:orientation');
+ $objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('orientation'));
+
$objWriter->endElement();
$objWriter->endElement();
@@ -557,13 +556,13 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement();
$objWriter->startElement('c:axPos');
- $objWriter->writeAttribute('val', "l");
+ $objWriter->writeAttribute('val', 'l');
$objWriter->endElement();
$objWriter->startElement('c:majorGridlines');
$objWriter->startElement('c:spPr');
- if (!is_null($majorGridlines->getLineColorProperty('value'))) {
+ if ($majorGridlines->getLineColorProperty('value') !== null) {
$objWriter->startElement('a:ln');
$objWriter->writeAttribute('w', $majorGridlines->getLineStyleProperty('width'));
$objWriter->startElement('a:solidFill');
@@ -588,17 +587,17 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement();
}
- if (!is_null($majorGridlines->getLineStyleProperty(array('arrow', 'head', 'type')))) {
+ if ($majorGridlines->getLineStyleProperty(['arrow', 'head', 'type']) !== null) {
$objWriter->startElement('a:headEnd');
- $objWriter->writeAttribute('type', $majorGridlines->getLineStyleProperty(array('arrow', 'head', 'type')));
+ $objWriter->writeAttribute('type', $majorGridlines->getLineStyleProperty(['arrow', 'head', 'type']));
$objWriter->writeAttribute('w', $majorGridlines->getLineStyleArrowParameters('head', 'w'));
$objWriter->writeAttribute('len', $majorGridlines->getLineStyleArrowParameters('head', 'len'));
$objWriter->endElement();
}
- if (!is_null($majorGridlines->getLineStyleProperty(array('arrow', 'end', 'type')))) {
+ if ($majorGridlines->getLineStyleProperty(['arrow', 'end', 'type']) !== null) {
$objWriter->startElement('a:tailEnd');
- $objWriter->writeAttribute('type', $majorGridlines->getLineStyleProperty(array('arrow', 'end', 'type')));
+ $objWriter->writeAttribute('type', $majorGridlines->getLineStyleProperty(['arrow', 'end', 'type']));
$objWriter->writeAttribute('w', $majorGridlines->getLineStyleArrowParameters('end', 'w'));
$objWriter->writeAttribute('len', $majorGridlines->getLineStyleArrowParameters('end', 'len'));
$objWriter->endElement();
@@ -607,7 +606,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
$objWriter->startElement('a:effectLst');
- if (!is_null($majorGridlines->getGlowSize())) {
+ if ($majorGridlines->getGlowSize() !== null) {
$objWriter->startElement('a:glow');
$objWriter->writeAttribute('rad', $majorGridlines->getGlowSize());
$objWriter->startElement("a:{$majorGridlines->getGlowColor('type')}");
@@ -619,44 +618,44 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement(); //end glow
}
- if (!is_null($majorGridlines->getShadowProperty('presets'))) {
+ if ($majorGridlines->getShadowProperty('presets') !== null) {
$objWriter->startElement("a:{$majorGridlines->getShadowProperty('effect')}");
- if (!is_null($majorGridlines->getShadowProperty('blur'))) {
+ if ($majorGridlines->getShadowProperty('blur') !== null) {
$objWriter->writeAttribute('blurRad', $majorGridlines->getShadowProperty('blur'));
}
- if (!is_null($majorGridlines->getShadowProperty('distance'))) {
+ if ($majorGridlines->getShadowProperty('distance') !== null) {
$objWriter->writeAttribute('dist', $majorGridlines->getShadowProperty('distance'));
}
- if (!is_null($majorGridlines->getShadowProperty('direction'))) {
+ if ($majorGridlines->getShadowProperty('direction') !== null) {
$objWriter->writeAttribute('dir', $majorGridlines->getShadowProperty('direction'));
}
- if (!is_null($majorGridlines->getShadowProperty('algn'))) {
+ if ($majorGridlines->getShadowProperty('algn') !== null) {
$objWriter->writeAttribute('algn', $majorGridlines->getShadowProperty('algn'));
}
- if (!is_null($majorGridlines->getShadowProperty(array('size', 'sx')))) {
- $objWriter->writeAttribute('sx', $majorGridlines->getShadowProperty(array('size', 'sx')));
+ if ($majorGridlines->getShadowProperty(['size', 'sx']) !== null) {
+ $objWriter->writeAttribute('sx', $majorGridlines->getShadowProperty(['size', 'sx']));
}
- if (!is_null($majorGridlines->getShadowProperty(array('size', 'sy')))) {
- $objWriter->writeAttribute('sy', $majorGridlines->getShadowProperty(array('size', 'sy')));
+ if ($majorGridlines->getShadowProperty(['size', 'sy']) !== null) {
+ $objWriter->writeAttribute('sy', $majorGridlines->getShadowProperty(['size', 'sy']));
}
- if (!is_null($majorGridlines->getShadowProperty(array('size', 'kx')))) {
- $objWriter->writeAttribute('kx', $majorGridlines->getShadowProperty(array('size', 'kx')));
+ if ($majorGridlines->getShadowProperty(['size', 'kx']) !== null) {
+ $objWriter->writeAttribute('kx', $majorGridlines->getShadowProperty(['size', 'kx']));
}
- if (!is_null($majorGridlines->getShadowProperty('rotWithShape'))) {
+ if ($majorGridlines->getShadowProperty('rotWithShape') !== null) {
$objWriter->writeAttribute('rotWithShape', $majorGridlines->getShadowProperty('rotWithShape'));
}
- $objWriter->startElement("a:{$majorGridlines->getShadowProperty(array('color', 'type'))}");
- $objWriter->writeAttribute('val', $majorGridlines->getShadowProperty(array('color', 'value')));
+ $objWriter->startElement("a:{$majorGridlines->getShadowProperty(['color', 'type'])}");
+ $objWriter->writeAttribute('val', $majorGridlines->getShadowProperty(['color', 'value']));
$objWriter->startElement('a:alpha');
- $objWriter->writeAttribute('val', $majorGridlines->getShadowProperty(array('color', 'alpha')));
+ $objWriter->writeAttribute('val', $majorGridlines->getShadowProperty(['color', 'alpha']));
$objWriter->endElement(); //end alpha
$objWriter->endElement(); //end color:type
$objWriter->endElement(); //end shadow
}
- if (!is_null($majorGridlines->getSoftEdgesSize())) {
+ if ($majorGridlines->getSoftEdgesSize() !== null) {
$objWriter->startElement('a:softEdge');
$objWriter->writeAttribute('rad', $majorGridlines->getSoftEdgesSize());
$objWriter->endElement(); //end softEdge
@@ -670,7 +669,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->startElement('c:minorGridlines');
$objWriter->startElement('c:spPr');
- if (!is_null($minorGridlines->getLineColorProperty('value'))) {
+ if ($minorGridlines->getLineColorProperty('value') !== null) {
$objWriter->startElement('a:ln');
$objWriter->writeAttribute('w', $minorGridlines->getLineStyleProperty('width'));
$objWriter->startElement('a:solidFill');
@@ -695,17 +694,17 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement();
}
- if (!is_null($minorGridlines->getLineStyleProperty(array('arrow', 'head', 'type')))) {
+ if ($minorGridlines->getLineStyleProperty(['arrow', 'head', 'type']) !== null) {
$objWriter->startElement('a:headEnd');
- $objWriter->writeAttribute('type', $minorGridlines->getLineStyleProperty(array('arrow', 'head', 'type')));
+ $objWriter->writeAttribute('type', $minorGridlines->getLineStyleProperty(['arrow', 'head', 'type']));
$objWriter->writeAttribute('w', $minorGridlines->getLineStyleArrowParameters('head', 'w'));
$objWriter->writeAttribute('len', $minorGridlines->getLineStyleArrowParameters('head', 'len'));
$objWriter->endElement();
}
- if (!is_null($minorGridlines->getLineStyleProperty(array('arrow', 'end', 'type')))) {
+ if ($minorGridlines->getLineStyleProperty(['arrow', 'end', 'type']) !== null) {
$objWriter->startElement('a:tailEnd');
- $objWriter->writeAttribute('type', $minorGridlines->getLineStyleProperty(array('arrow', 'end', 'type')));
+ $objWriter->writeAttribute('type', $minorGridlines->getLineStyleProperty(['arrow', 'end', 'type']));
$objWriter->writeAttribute('w', $minorGridlines->getLineStyleArrowParameters('end', 'w'));
$objWriter->writeAttribute('len', $minorGridlines->getLineStyleArrowParameters('end', 'len'));
$objWriter->endElement();
@@ -715,7 +714,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->startElement('a:effectLst');
- if (!is_null($minorGridlines->getGlowSize())) {
+ if ($minorGridlines->getGlowSize() !== null) {
$objWriter->startElement('a:glow');
$objWriter->writeAttribute('rad', $minorGridlines->getGlowSize());
$objWriter->startElement("a:{$minorGridlines->getGlowColor('type')}");
@@ -727,42 +726,42 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement(); //end glow
}
- if (!is_null($minorGridlines->getShadowProperty('presets'))) {
+ if ($minorGridlines->getShadowProperty('presets') !== null) {
$objWriter->startElement("a:{$minorGridlines->getShadowProperty('effect')}");
- if (!is_null($minorGridlines->getShadowProperty('blur'))) {
+ if ($minorGridlines->getShadowProperty('blur') !== null) {
$objWriter->writeAttribute('blurRad', $minorGridlines->getShadowProperty('blur'));
}
- if (!is_null($minorGridlines->getShadowProperty('distance'))) {
+ if ($minorGridlines->getShadowProperty('distance') !== null) {
$objWriter->writeAttribute('dist', $minorGridlines->getShadowProperty('distance'));
}
- if (!is_null($minorGridlines->getShadowProperty('direction'))) {
+ if ($minorGridlines->getShadowProperty('direction') !== null) {
$objWriter->writeAttribute('dir', $minorGridlines->getShadowProperty('direction'));
}
- if (!is_null($minorGridlines->getShadowProperty('algn'))) {
+ if ($minorGridlines->getShadowProperty('algn') !== null) {
$objWriter->writeAttribute('algn', $minorGridlines->getShadowProperty('algn'));
}
- if (!is_null($minorGridlines->getShadowProperty(array('size', 'sx')))) {
- $objWriter->writeAttribute('sx', $minorGridlines->getShadowProperty(array('size', 'sx')));
+ if ($minorGridlines->getShadowProperty(['size', 'sx']) !== null) {
+ $objWriter->writeAttribute('sx', $minorGridlines->getShadowProperty(['size', 'sx']));
}
- if (!is_null($minorGridlines->getShadowProperty(array('size', 'sy')))) {
- $objWriter->writeAttribute('sy', $minorGridlines->getShadowProperty(array('size', 'sy')));
+ if ($minorGridlines->getShadowProperty(['size', 'sy']) !== null) {
+ $objWriter->writeAttribute('sy', $minorGridlines->getShadowProperty(['size', 'sy']));
}
- if (!is_null($minorGridlines->getShadowProperty(array('size', 'kx')))) {
- $objWriter->writeAttribute('kx', $minorGridlines->getShadowProperty(array('size', 'kx')));
+ if ($minorGridlines->getShadowProperty(['size', 'kx']) !== null) {
+ $objWriter->writeAttribute('kx', $minorGridlines->getShadowProperty(['size', 'kx']));
}
- if (!is_null($minorGridlines->getShadowProperty('rotWithShape'))) {
+ if ($minorGridlines->getShadowProperty('rotWithShape') !== null) {
$objWriter->writeAttribute('rotWithShape', $minorGridlines->getShadowProperty('rotWithShape'));
}
- $objWriter->startElement("a:{$minorGridlines->getShadowProperty(array('color', 'type'))}");
- $objWriter->writeAttribute('val', $minorGridlines->getShadowProperty(array('color', 'value')));
+ $objWriter->startElement("a:{$minorGridlines->getShadowProperty(['color', 'type'])}");
+ $objWriter->writeAttribute('val', $minorGridlines->getShadowProperty(['color', 'value']));
$objWriter->startElement('a:alpha');
- $objWriter->writeAttribute('val', $minorGridlines->getShadowProperty(array('color', 'alpha')));
+ $objWriter->writeAttribute('val', $minorGridlines->getShadowProperty(['color', 'alpha']));
$objWriter->endElement(); //end alpha
$objWriter->endElement(); //end color:type
$objWriter->endElement(); //end shadow
}
- if (!is_null($minorGridlines->getSoftEdgesSize())) {
+ if ($minorGridlines->getSoftEdgesSize() !== null) {
$objWriter->startElement('a:softEdge');
$objWriter->writeAttribute('rad', $minorGridlines->getSoftEdgesSize());
$objWriter->endElement(); //end softEdge
@@ -773,7 +772,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement(); //end minorGridLines
}
- if (!is_null($yAxisLabel)) {
+ if ($yAxisLabel !== null) {
$objWriter->startElement('c:title');
$objWriter->startElement('c:tx');
$objWriter->startElement('c:rich');
@@ -793,8 +792,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
$objWriter->startElement('a:t');
- // $objWriter->writeAttribute('xml:space', 'preserve');
- $objWriter->writeRawData(PHPExcel_Shared_String::ControlCharacterPHP2OOXML($caption));
+ $objWriter->writeRawData(StringHelper::controlCharacterPHP2OOXML($caption));
$objWriter->endElement();
$objWriter->endElement();
@@ -802,9 +800,9 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement();
$objWriter->endElement();
- if ($groupType !== PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) {
+ if ($groupType !== DataSeries::TYPE_BUBBLECHART) {
$layout = $yAxisLabel->getLayout();
- $this->writeLayout($layout, $objWriter);
+ $this->writeLayout($objWriter, $layout);
}
$objWriter->startElement('c:overlay');
@@ -833,9 +831,9 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->startElement('c:spPr');
- if (!is_null($xAxis->getFillProperty('value'))) {
+ if ($xAxis->getFillProperty('value') !== null) {
$objWriter->startElement('a:solidFill');
- $objWriter->startElement("a:" . $xAxis->getFillProperty('type'));
+ $objWriter->startElement('a:' . $xAxis->getFillProperty('type'));
$objWriter->writeAttribute('val', $xAxis->getFillProperty('value'));
$objWriter->startElement('a:alpha');
$objWriter->writeAttribute('val', $xAxis->getFillProperty('alpha'));
@@ -850,9 +848,9 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->writeAttribute('cap', $xAxis->getLineStyleProperty('cap'));
$objWriter->writeAttribute('cmpd', $xAxis->getLineStyleProperty('compound'));
- if (!is_null($xAxis->getLineProperty('value'))) {
+ if ($xAxis->getLineProperty('value') !== null) {
$objWriter->startElement('a:solidFill');
- $objWriter->startElement("a:" . $xAxis->getLineProperty('type'));
+ $objWriter->startElement('a:' . $xAxis->getLineProperty('type'));
$objWriter->writeAttribute('val', $xAxis->getLineProperty('value'));
$objWriter->startElement('a:alpha');
$objWriter->writeAttribute('val', $xAxis->getLineProperty('alpha'));
@@ -874,17 +872,17 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement();
}
- if (!is_null($xAxis->getLineStyleProperty(array('arrow', 'head', 'type')))) {
+ if ($xAxis->getLineStyleProperty(['arrow', 'head', 'type']) !== null) {
$objWriter->startElement('a:headEnd');
- $objWriter->writeAttribute('type', $xAxis->getLineStyleProperty(array('arrow', 'head', 'type')));
+ $objWriter->writeAttribute('type', $xAxis->getLineStyleProperty(['arrow', 'head', 'type']));
$objWriter->writeAttribute('w', $xAxis->getLineStyleArrowWidth('head'));
$objWriter->writeAttribute('len', $xAxis->getLineStyleArrowLength('head'));
$objWriter->endElement();
}
- if (!is_null($xAxis->getLineStyleProperty(array('arrow', 'end', 'type')))) {
+ if ($xAxis->getLineStyleProperty(['arrow', 'end', 'type']) !== null) {
$objWriter->startElement('a:tailEnd');
- $objWriter->writeAttribute('type', $xAxis->getLineStyleProperty(array('arrow', 'end', 'type')));
+ $objWriter->writeAttribute('type', $xAxis->getLineStyleProperty(['arrow', 'end', 'type']));
$objWriter->writeAttribute('w', $xAxis->getLineStyleArrowWidth('end'));
$objWriter->writeAttribute('len', $xAxis->getLineStyleArrowLength('end'));
$objWriter->endElement();
@@ -894,57 +892,57 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->startElement('a:effectLst');
- if (!is_null($xAxis->getGlowProperty('size'))) {
+ if ($xAxis->getGlowProperty('size') !== null) {
$objWriter->startElement('a:glow');
$objWriter->writeAttribute('rad', $xAxis->getGlowProperty('size'));
- $objWriter->startElement("a:{$xAxis->getGlowProperty(array('color','type'))}");
- $objWriter->writeAttribute('val', $xAxis->getGlowProperty(array('color','value')));
+ $objWriter->startElement("a:{$xAxis->getGlowProperty(['color', 'type'])}");
+ $objWriter->writeAttribute('val', $xAxis->getGlowProperty(['color', 'value']));
$objWriter->startElement('a:alpha');
- $objWriter->writeAttribute('val', $xAxis->getGlowProperty(array('color','alpha')));
+ $objWriter->writeAttribute('val', $xAxis->getGlowProperty(['color', 'alpha']));
$objWriter->endElement();
$objWriter->endElement();
$objWriter->endElement();
}
- if (!is_null($xAxis->getShadowProperty('presets'))) {
+ if ($xAxis->getShadowProperty('presets') !== null) {
$objWriter->startElement("a:{$xAxis->getShadowProperty('effect')}");
- if (!is_null($xAxis->getShadowProperty('blur'))) {
+ if ($xAxis->getShadowProperty('blur') !== null) {
$objWriter->writeAttribute('blurRad', $xAxis->getShadowProperty('blur'));
}
- if (!is_null($xAxis->getShadowProperty('distance'))) {
+ if ($xAxis->getShadowProperty('distance') !== null) {
$objWriter->writeAttribute('dist', $xAxis->getShadowProperty('distance'));
}
- if (!is_null($xAxis->getShadowProperty('direction'))) {
+ if ($xAxis->getShadowProperty('direction') !== null) {
$objWriter->writeAttribute('dir', $xAxis->getShadowProperty('direction'));
}
- if (!is_null($xAxis->getShadowProperty('algn'))) {
+ if ($xAxis->getShadowProperty('algn') !== null) {
$objWriter->writeAttribute('algn', $xAxis->getShadowProperty('algn'));
}
- if (!is_null($xAxis->getShadowProperty(array('size','sx')))) {
- $objWriter->writeAttribute('sx', $xAxis->getShadowProperty(array('size','sx')));
+ if ($xAxis->getShadowProperty(['size', 'sx']) !== null) {
+ $objWriter->writeAttribute('sx', $xAxis->getShadowProperty(['size', 'sx']));
}
- if (!is_null($xAxis->getShadowProperty(array('size','sy')))) {
- $objWriter->writeAttribute('sy', $xAxis->getShadowProperty(array('size','sy')));
+ if ($xAxis->getShadowProperty(['size', 'sy']) !== null) {
+ $objWriter->writeAttribute('sy', $xAxis->getShadowProperty(['size', 'sy']));
}
- if (!is_null($xAxis->getShadowProperty(array('size','kx')))) {
- $objWriter->writeAttribute('kx', $xAxis->getShadowProperty(array('size','kx')));
+ if ($xAxis->getShadowProperty(['size', 'kx']) !== null) {
+ $objWriter->writeAttribute('kx', $xAxis->getShadowProperty(['size', 'kx']));
}
- if (!is_null($xAxis->getShadowProperty('rotWithShape'))) {
+ if ($xAxis->getShadowProperty('rotWithShape') !== null) {
$objWriter->writeAttribute('rotWithShape', $xAxis->getShadowProperty('rotWithShape'));
}
- $objWriter->startElement("a:{$xAxis->getShadowProperty(array('color','type'))}");
- $objWriter->writeAttribute('val', $xAxis->getShadowProperty(array('color','value')));
+ $objWriter->startElement("a:{$xAxis->getShadowProperty(['color', 'type'])}");
+ $objWriter->writeAttribute('val', $xAxis->getShadowProperty(['color', 'value']));
$objWriter->startElement('a:alpha');
- $objWriter->writeAttribute('val', $xAxis->getShadowProperty(array('color','alpha')));
+ $objWriter->writeAttribute('val', $xAxis->getShadowProperty(['color', 'alpha']));
$objWriter->endElement();
$objWriter->endElement();
$objWriter->endElement();
}
- if (!is_null($xAxis->getSoftEdgesSize())) {
+ if ($xAxis->getSoftEdgesSize() !== null) {
$objWriter->startElement('a:softEdge');
$objWriter->writeAttribute('rad', $xAxis->getSoftEdgesSize());
$objWriter->endElement();
@@ -958,7 +956,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->writeAttribute('val', $id2);
$objWriter->endElement();
- if (!is_null($xAxis->getAxisOptionsProperty('horizontal_crosses_value'))) {
+ if ($xAxis->getAxisOptionsProperty('horizontal_crosses_value') !== null) {
$objWriter->startElement('c:crossesAt');
$objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('horizontal_crosses_value'));
$objWriter->endElement();
@@ -969,16 +967,16 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
$objWriter->startElement('c:crossBetween');
- $objWriter->writeAttribute('val', "midCat");
+ $objWriter->writeAttribute('val', 'midCat');
$objWriter->endElement();
- if (!is_null($xAxis->getAxisOptionsProperty('major_unit'))) {
+ if ($xAxis->getAxisOptionsProperty('major_unit') !== null) {
$objWriter->startElement('c:majorUnit');
$objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('major_unit'));
$objWriter->endElement();
}
- if (!is_null($xAxis->getAxisOptionsProperty('minor_unit'))) {
+ if ($xAxis->getAxisOptionsProperty('minor_unit') !== null) {
$objWriter->startElement('c:minorUnit');
$objWriter->writeAttribute('val', $xAxis->getAxisOptionsProperty('minor_unit'));
$objWriter->endElement();
@@ -986,7 +984,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
if ($isMultiLevelSeries) {
- if ($groupType !== PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) {
+ if ($groupType !== DataSeries::TYPE_BUBBLECHART) {
$objWriter->startElement('c:noMultiLvlLbl');
$objWriter->writeAttribute('val', 0);
$objWriter->endElement();
@@ -997,27 +995,28 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Get the data series type(s) for a chart plot series
+ * Get the data series type(s) for a chart plot series.
*
- * @param PHPExcel_Chart_PlotArea $plotArea
+ * @param PlotArea $plotArea
*
- * @return string|array
- * @throws PHPExcel_Writer_Exception
+ * @throws WriterException
+ *
+ * @return array|string
*/
private static function getChartType($plotArea)
{
$groupCount = $plotArea->getPlotGroupCount();
if ($groupCount == 1) {
- $chartType = array($plotArea->getPlotGroupByIndex(0)->getPlotType());
+ $chartType = [$plotArea->getPlotGroupByIndex(0)->getPlotType()];
} else {
- $chartTypes = array();
+ $chartTypes = [];
for ($i = 0; $i < $groupCount; ++$i) {
$chartTypes[] = $plotArea->getPlotGroupByIndex($i)->getPlotType();
}
$chartType = array_unique($chartTypes);
if (count($chartTypes) == 0) {
- throw new PHPExcel_Writer_Exception('Chart is not yet implemented');
+ throw new WriterException('Chart is not yet implemented');
}
}
@@ -1025,31 +1024,62 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Plot Group (series of related plots)
+ * Method writing plot series values.
*
- * @param PHPExcel_Chart_DataSeries $plotGroup
- * @param string $groupType Type of plot for dataseries
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param boolean &$catIsMultiLevelSeries Is category a multi-series category
- * @param boolean &$valIsMultiLevelSeries Is value set a multi-series set
- * @param string &$plotGroupingType Type of grouping for multi-series values
- * @param PHPExcel_Worksheet $pSheet
+ * @param XMLWriter $objWriter XML Writer
+ * @param int $val value for idx (default: 3)
+ * @param string $fillColor hex color (default: FF9900)
*
- * @throws PHPExcel_Writer_Exception
+ * @return XMLWriter XML Writer
*/
- private function writePlotGroup($plotGroup, $groupType, $objWriter, &$catIsMultiLevelSeries, &$valIsMultiLevelSeries, &$plotGroupingType, PHPExcel_Worksheet $pSheet)
+ private function writePlotSeriesValuesElement($objWriter, $val = 3, $fillColor = 'FF9900')
{
- if (is_null($plotGroup)) {
+ $objWriter->startElement('c:dPt');
+ $objWriter->startElement('c:idx');
+ $objWriter->writeAttribute('val', $val);
+ $objWriter->endElement();
+
+ $objWriter->startElement('c:bubble3D');
+ $objWriter->writeAttribute('val', 0);
+ $objWriter->endElement();
+
+ $objWriter->startElement('c:spPr');
+ $objWriter->startElement('a:solidFill');
+ $objWriter->startElement('a:srgbClr');
+ $objWriter->writeAttribute('val', $fillColor);
+ $objWriter->endElement();
+ $objWriter->endElement();
+ $objWriter->endElement();
+ $objWriter->endElement();
+
+ return $objWriter;
+ }
+
+ /**
+ * Write Plot Group (series of related plots).
+ *
+ * @param DataSeries $plotGroup
+ * @param string $groupType Type of plot for dataseries
+ * @param XMLWriter $objWriter XML Writer
+ * @param bool &$catIsMultiLevelSeries Is category a multi-series category
+ * @param bool &$valIsMultiLevelSeries Is value set a multi-series set
+ * @param string &$plotGroupingType Type of grouping for multi-series values
+ *
+ * @throws WriterException
+ */
+ private function writePlotGroup($plotGroup, $groupType, $objWriter, &$catIsMultiLevelSeries, &$valIsMultiLevelSeries, &$plotGroupingType)
+ {
+ if ($plotGroup === null) {
return;
}
- if (($groupType == PHPExcel_Chart_DataSeries::TYPE_BARCHART) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_BARCHART_3D)) {
+ if (($groupType == DataSeries::TYPE_BARCHART) || ($groupType == DataSeries::TYPE_BARCHART_3D)) {
$objWriter->startElement('c:barDir');
$objWriter->writeAttribute('val', $plotGroup->getPlotDirection());
$objWriter->endElement();
}
- if (!is_null($plotGroup->getPlotGrouping())) {
+ if ($plotGroup->getPlotGrouping() !== null) {
$plotGroupingType = $plotGroup->getPlotGrouping();
$objWriter->startElement('c:grouping');
$objWriter->writeAttribute('val', $plotGroupingType);
@@ -1060,9 +1090,9 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$plotSeriesOrder = $plotGroup->getPlotOrder();
$plotSeriesCount = count($plotSeriesOrder);
- if (($groupType !== PHPExcel_Chart_DataSeries::TYPE_RADARCHART) && ($groupType !== PHPExcel_Chart_DataSeries::TYPE_STOCKCHART)) {
- if ($groupType !== PHPExcel_Chart_DataSeries::TYPE_LINECHART) {
- if (($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_DONUTCHART) || ($plotSeriesCount > 1)) {
+ if (($groupType !== DataSeries::TYPE_RADARCHART) && ($groupType !== DataSeries::TYPE_STOCKCHART)) {
+ if ($groupType !== DataSeries::TYPE_LINECHART) {
+ if (($groupType == DataSeries::TYPE_PIECHART) || ($groupType == DataSeries::TYPE_PIECHART_3D) || ($groupType == DataSeries::TYPE_DONUTCHART) || ($plotSeriesCount > 1)) {
$objWriter->startElement('c:varyColors');
$objWriter->writeAttribute('val', 1);
$objWriter->endElement();
@@ -1077,32 +1107,40 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
foreach ($plotSeriesOrder as $plotSeriesIdx => $plotSeriesRef) {
$objWriter->startElement('c:ser');
+ $plotLabel = $plotGroup->getPlotLabelByIndex($plotSeriesIdx);
+ if ($plotLabel) {
+ $fillColor = $plotLabel->getFillColor();
+ if ($fillColor !== null && !is_array($fillColor)) {
+ $objWriter->startElement('c:spPr');
+ $objWriter->startElement('a:solidFill');
+ $objWriter->startElement('a:srgbClr');
+ $objWriter->writeAttribute('val', $fillColor);
+ $objWriter->endElement();
+ $objWriter->endElement();
+ $objWriter->endElement();
+ }
+ }
+
$objWriter->startElement('c:idx');
- $objWriter->writeAttribute('val', $this->_seriesIndex + $plotSeriesIdx);
+ $objWriter->writeAttribute('val', $this->seriesIndex + $plotSeriesIdx);
$objWriter->endElement();
$objWriter->startElement('c:order');
- $objWriter->writeAttribute('val', $this->_seriesIndex + $plotSeriesRef);
+ $objWriter->writeAttribute('val', $this->seriesIndex + $plotSeriesRef);
$objWriter->endElement();
- if (($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)) {
- $objWriter->startElement('c:dPt');
- $objWriter->startElement('c:idx');
- $objWriter->writeAttribute('val', 3);
- $objWriter->endElement();
+ // Values
+ $plotSeriesValues = $plotGroup->getPlotValuesByIndex($plotSeriesRef);
- $objWriter->startElement('c:bubble3D');
- $objWriter->writeAttribute('val', 0);
- $objWriter->endElement();
-
- $objWriter->startElement('c:spPr');
- $objWriter->startElement('a:solidFill');
- $objWriter->startElement('a:srgbClr');
- $objWriter->writeAttribute('val', 'FF9900');
- $objWriter->endElement();
- $objWriter->endElement();
- $objWriter->endElement();
- $objWriter->endElement();
+ if (($groupType == DataSeries::TYPE_PIECHART) || ($groupType == DataSeries::TYPE_PIECHART_3D) || ($groupType == DataSeries::TYPE_DONUTCHART)) {
+ $fillColorValues = $plotSeriesValues->getFillColor();
+ if ($fillColorValues !== null && is_array($fillColorValues)) {
+ foreach ($plotSeriesValues->getDataValues() as $dataKey => $dataValue) {
+ $this->writePlotSeriesValuesElement($objWriter, $dataKey, (isset($fillColorValues[$dataKey]) ? $fillColorValues[$dataKey] : 'FF9900'));
+ }
+ } else {
+ $this->writePlotSeriesValuesElement($objWriter);
+ }
}
// Labels
@@ -1116,11 +1154,16 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
// Formatting for the points
- if (($groupType == PHPExcel_Chart_DataSeries::TYPE_LINECHART) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_STOCKCHART)) {
+ if (($groupType == DataSeries::TYPE_LINECHART) || ($groupType == DataSeries::TYPE_STOCKCHART)) {
+ $plotLineWidth = 12700;
+ if ($plotSeriesValues) {
+ $plotLineWidth = $plotSeriesValues->getLineWidth();
+ }
+
$objWriter->startElement('c:spPr');
$objWriter->startElement('a:ln');
- $objWriter->writeAttribute('w', 12700);
- if ($groupType == PHPExcel_Chart_DataSeries::TYPE_STOCKCHART) {
+ $objWriter->writeAttribute('w', $plotLineWidth);
+ if ($groupType == DataSeries::TYPE_STOCKCHART) {
$objWriter->startElement('a:noFill');
$objWriter->endElement();
}
@@ -1128,7 +1171,6 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement();
}
- $plotSeriesValues = $plotGroup->getPlotValuesByIndex($plotSeriesRef);
if ($plotSeriesValues) {
$plotSeriesMarker = $plotSeriesValues->getPointMarker();
if ($plotSeriesMarker) {
@@ -1147,7 +1189,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
}
- if (($groupType === PHPExcel_Chart_DataSeries::TYPE_BARCHART) || ($groupType === PHPExcel_Chart_DataSeries::TYPE_BARCHART_3D) || ($groupType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART)) {
+ if (($groupType === DataSeries::TYPE_BARCHART) || ($groupType === DataSeries::TYPE_BARCHART_3D) || ($groupType === DataSeries::TYPE_BUBBLECHART)) {
$objWriter->startElement('c:invertIfNegative');
$objWriter->writeAttribute('val', 0);
$objWriter->endElement();
@@ -1158,8 +1200,8 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
if ($plotSeriesCategory && ($plotSeriesCategory->getPointCount() > 0)) {
$catIsMultiLevelSeries = $catIsMultiLevelSeries || $plotSeriesCategory->isMultiLevelSeries();
- if (($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) || ($groupType == PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)) {
- if (!is_null($plotGroup->getPlotStyle())) {
+ if (($groupType == DataSeries::TYPE_PIECHART) || ($groupType == DataSeries::TYPE_PIECHART_3D) || ($groupType == DataSeries::TYPE_DONUTCHART)) {
+ if ($plotGroup->getPlotStyle() !== null) {
$plotStyle = $plotGroup->getPlotStyle();
if ($plotStyle) {
$objWriter->startElement('c:explosion');
@@ -1169,13 +1211,13 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
}
- if (($groupType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) || ($groupType === PHPExcel_Chart_DataSeries::TYPE_SCATTERCHART)) {
+ if (($groupType === DataSeries::TYPE_BUBBLECHART) || ($groupType === DataSeries::TYPE_SCATTERCHART)) {
$objWriter->startElement('c:xVal');
} else {
$objWriter->startElement('c:cat');
}
- $this->writePlotSeriesValues($plotSeriesCategory, $objWriter, $groupType, 'str', $pSheet);
+ $this->writePlotSeriesValues($plotSeriesCategory, $objWriter, $groupType, 'str');
$objWriter->endElement();
}
@@ -1183,37 +1225,35 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
if ($plotSeriesValues) {
$valIsMultiLevelSeries = $valIsMultiLevelSeries || $plotSeriesValues->isMultiLevelSeries();
- if (($groupType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) || ($groupType === PHPExcel_Chart_DataSeries::TYPE_SCATTERCHART)) {
+ if (($groupType === DataSeries::TYPE_BUBBLECHART) || ($groupType === DataSeries::TYPE_SCATTERCHART)) {
$objWriter->startElement('c:yVal');
} else {
$objWriter->startElement('c:val');
}
- $this->writePlotSeriesValues($plotSeriesValues, $objWriter, $groupType, 'num', $pSheet);
+ $this->writePlotSeriesValues($plotSeriesValues, $objWriter, $groupType, 'num');
$objWriter->endElement();
}
- if ($groupType === PHPExcel_Chart_DataSeries::TYPE_BUBBLECHART) {
- $this->writeBubbles($plotSeriesValues, $objWriter, $pSheet);
+ if ($groupType === DataSeries::TYPE_BUBBLECHART) {
+ $this->writeBubbles($plotSeriesValues, $objWriter);
}
$objWriter->endElement();
}
- $this->_seriesIndex += $plotSeriesIdx + 1;
+ $this->seriesIndex += $plotSeriesIdx + 1;
}
/**
- * Write Plot Series Label
+ * Write Plot Series Label.
*
- * @param PHPExcel_Chart_DataSeriesValues $plotSeriesLabel
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- *
- * @throws PHPExcel_Writer_Exception
+ * @param DataSeriesValues $plotSeriesLabel
+ * @param XMLWriter $objWriter XML Writer
*/
private function writePlotSeriesLabel($plotSeriesLabel, $objWriter)
{
- if (is_null($plotSeriesLabel)) {
+ if ($plotSeriesLabel === null) {
return;
}
@@ -1239,19 +1279,16 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Plot Series Values
+ * Write Plot Series Values.
*
- * @param PHPExcel_Chart_DataSeriesValues $plotSeriesValues
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param string $groupType Type of plot for dataseries
- * @param string $dataType Datatype of series values
- * @param PHPExcel_Worksheet $pSheet
- *
- * @throws PHPExcel_Writer_Exception
+ * @param DataSeriesValues $plotSeriesValues
+ * @param XMLWriter $objWriter XML Writer
+ * @param string $groupType Type of plot for dataseries
+ * @param string $dataType Datatype of series values
*/
- private function writePlotSeriesValues($plotSeriesValues, $objWriter, $groupType, $dataType = 'str', PHPExcel_Worksheet $pSheet)
+ private function writePlotSeriesValues($plotSeriesValues, XMLWriter $objWriter, $groupType, $dataType = 'str')
{
- if (is_null($plotSeriesValues)) {
+ if ($plotSeriesValues === null) {
return;
}
@@ -1300,7 +1337,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->startElement('c:' . $dataType . 'Cache');
- if (($groupType != PHPExcel_Chart_DataSeries::TYPE_PIECHART) && ($groupType != PHPExcel_Chart_DataSeries::TYPE_PIECHART_3D) && ($groupType != PHPExcel_Chart_DataSeries::TYPE_DONUTCHART)) {
+ if (($groupType != DataSeries::TYPE_PIECHART) && ($groupType != DataSeries::TYPE_PIECHART_3D) && ($groupType != DataSeries::TYPE_DONUTCHART)) {
if (($plotSeriesValues->getFormatCode() !== null) && ($plotSeriesValues->getFormatCode() !== '')) {
$objWriter->startElement('c:formatCode');
$objWriter->writeRawData($plotSeriesValues->getFormatCode());
@@ -1334,16 +1371,14 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Bubble Chart Details
+ * Write Bubble Chart Details.
*
- * @param PHPExcel_Chart_DataSeriesValues $plotSeriesValues
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- *
- * @throws PHPExcel_Writer_Exception
+ * @param DataSeriesValues $plotSeriesValues
+ * @param XMLWriter $objWriter XML Writer
*/
- private function writeBubbles($plotSeriesValues, $objWriter, PHPExcel_Worksheet $pSheet)
+ private function writeBubbles($plotSeriesValues, $objWriter)
{
- if (is_null($plotSeriesValues)) {
+ if ($plotSeriesValues === null) {
return;
}
@@ -1381,64 +1416,62 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Layout
+ * Write Layout.
*
- * @param PHPExcel_Chart_Layout $layout
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- *
- * @throws PHPExcel_Writer_Exception
+ * @param XMLWriter $objWriter XML Writer
+ * @param Layout $layout
*/
- private function writeLayout(PHPExcel_Chart_Layout $layout = null, $objWriter)
+ private function writeLayout(XMLWriter $objWriter, Layout $layout = null)
{
$objWriter->startElement('c:layout');
- if (!is_null($layout)) {
+ if ($layout !== null) {
$objWriter->startElement('c:manualLayout');
$layoutTarget = $layout->getLayoutTarget();
- if (!is_null($layoutTarget)) {
+ if ($layoutTarget !== null) {
$objWriter->startElement('c:layoutTarget');
$objWriter->writeAttribute('val', $layoutTarget);
$objWriter->endElement();
}
$xMode = $layout->getXMode();
- if (!is_null($xMode)) {
+ if ($xMode !== null) {
$objWriter->startElement('c:xMode');
$objWriter->writeAttribute('val', $xMode);
$objWriter->endElement();
}
$yMode = $layout->getYMode();
- if (!is_null($yMode)) {
+ if ($yMode !== null) {
$objWriter->startElement('c:yMode');
$objWriter->writeAttribute('val', $yMode);
$objWriter->endElement();
}
$x = $layout->getXPosition();
- if (!is_null($x)) {
+ if ($x !== null) {
$objWriter->startElement('c:x');
$objWriter->writeAttribute('val', $x);
$objWriter->endElement();
}
$y = $layout->getYPosition();
- if (!is_null($y)) {
+ if ($y !== null) {
$objWriter->startElement('c:y');
$objWriter->writeAttribute('val', $y);
$objWriter->endElement();
}
$w = $layout->getWidth();
- if (!is_null($w)) {
+ if ($w !== null) {
$objWriter->startElement('c:w');
$objWriter->writeAttribute('val', $w);
$objWriter->endElement();
}
$h = $layout->getHeight();
- if (!is_null($h)) {
+ if ($h !== null) {
$objWriter->startElement('c:h');
$objWriter->writeAttribute('val', $h);
$objWriter->endElement();
@@ -1451,11 +1484,9 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Alternate Content block
+ * Write Alternate Content block.
*
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- *
- * @throws PHPExcel_Writer_Exception
+ * @param XMLWriter $objWriter XML Writer
*/
private function writeAlternateContent($objWriter)
{
@@ -1481,11 +1512,9 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Printer Settings
+ * Write Printer Settings.
*
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- *
- * @throws PHPExcel_Writer_Exception
+ * @param XMLWriter $objWriter XML Writer
*/
private function writePrintSettings($objWriter)
{
@@ -1504,7 +1533,7 @@ class PHPExcel_Writer_Excel2007_Chart extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement();
$objWriter->startElement('c:pageSetup');
- $objWriter->writeAttribute('orientation', "portrait");
+ $objWriter->writeAttribute('orientation', 'portrait');
$objWriter->endElement();
$objWriter->endElement();
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Comments.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Comments.php
new file mode 100644
index 00000000000..8b08f31f3f8
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Comments.php
@@ -0,0 +1,242 @@
+getParentWriter()->getUseDiskCaching()) {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ } else {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
+ }
+
+ // XML header
+ $objWriter->startDocument('1.0', 'UTF-8', 'yes');
+
+ // Comments cache
+ $comments = $pWorksheet->getComments();
+
+ // Authors cache
+ $authors = [];
+ $authorId = 0;
+ foreach ($comments as $comment) {
+ if (!isset($authors[$comment->getAuthor()])) {
+ $authors[$comment->getAuthor()] = $authorId++;
+ }
+ }
+
+ // comments
+ $objWriter->startElement('comments');
+ $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main');
+
+ // Loop through authors
+ $objWriter->startElement('authors');
+ foreach ($authors as $author => $index) {
+ $objWriter->writeElement('author', $author);
+ }
+ $objWriter->endElement();
+
+ // Loop through comments
+ $objWriter->startElement('commentList');
+ foreach ($comments as $key => $value) {
+ $this->writeComment($objWriter, $key, $value, $authors);
+ }
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // Return
+ return $objWriter->getData();
+ }
+
+ /**
+ * Write comment to XML format.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param string $pCellReference Cell reference
+ * @param Comment $pComment Comment
+ * @param array $pAuthors Array of authors
+ *
+ * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ */
+ private function writeComment(XMLWriter $objWriter, $pCellReference, Comment $pComment, array $pAuthors)
+ {
+ // comment
+ $objWriter->startElement('comment');
+ $objWriter->writeAttribute('ref', $pCellReference);
+ $objWriter->writeAttribute('authorId', $pAuthors[$pComment->getAuthor()]);
+
+ // text
+ $objWriter->startElement('text');
+ $this->getParentWriter()->getWriterPart('stringtable')->writeRichText($objWriter, $pComment->getText());
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write VML comments to XML format.
+ *
+ * @param \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet
+ *
+ * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ *
+ * @return string XML Output
+ */
+ public function writeVMLComments(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet)
+ {
+ // Create XML writer
+ $objWriter = null;
+ if ($this->getParentWriter()->getUseDiskCaching()) {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ } else {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
+ }
+
+ // XML header
+ $objWriter->startDocument('1.0', 'UTF-8', 'yes');
+
+ // Comments cache
+ $comments = $pWorksheet->getComments();
+
+ // xml
+ $objWriter->startElement('xml');
+ $objWriter->writeAttribute('xmlns:v', 'urn:schemas-microsoft-com:vml');
+ $objWriter->writeAttribute('xmlns:o', 'urn:schemas-microsoft-com:office:office');
+ $objWriter->writeAttribute('xmlns:x', 'urn:schemas-microsoft-com:office:excel');
+
+ // o:shapelayout
+ $objWriter->startElement('o:shapelayout');
+ $objWriter->writeAttribute('v:ext', 'edit');
+
+ // o:idmap
+ $objWriter->startElement('o:idmap');
+ $objWriter->writeAttribute('v:ext', 'edit');
+ $objWriter->writeAttribute('data', '1');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // v:shapetype
+ $objWriter->startElement('v:shapetype');
+ $objWriter->writeAttribute('id', '_x0000_t202');
+ $objWriter->writeAttribute('coordsize', '21600,21600');
+ $objWriter->writeAttribute('o:spt', '202');
+ $objWriter->writeAttribute('path', 'm,l,21600r21600,l21600,xe');
+
+ // v:stroke
+ $objWriter->startElement('v:stroke');
+ $objWriter->writeAttribute('joinstyle', 'miter');
+ $objWriter->endElement();
+
+ // v:path
+ $objWriter->startElement('v:path');
+ $objWriter->writeAttribute('gradientshapeok', 't');
+ $objWriter->writeAttribute('o:connecttype', 'rect');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // Loop through comments
+ foreach ($comments as $key => $value) {
+ $this->writeVMLComment($objWriter, $key, $value);
+ }
+
+ $objWriter->endElement();
+
+ // Return
+ return $objWriter->getData();
+ }
+
+ /**
+ * Write VML comment to XML format.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param string $pCellReference Cell reference, eg: 'A1'
+ * @param Comment $pComment Comment
+ */
+ private function writeVMLComment(XMLWriter $objWriter, $pCellReference, Comment $pComment)
+ {
+ // Metadata
+ list($column, $row) = Coordinate::coordinateFromString($pCellReference);
+ $column = Coordinate::columnIndexFromString($column);
+ $id = 1024 + $column + $row;
+ $id = substr($id, 0, 4);
+
+ // v:shape
+ $objWriter->startElement('v:shape');
+ $objWriter->writeAttribute('id', '_x0000_s' . $id);
+ $objWriter->writeAttribute('type', '#_x0000_t202');
+ $objWriter->writeAttribute('style', 'position:absolute;margin-left:' . $pComment->getMarginLeft() . ';margin-top:' . $pComment->getMarginTop() . ';width:' . $pComment->getWidth() . ';height:' . $pComment->getHeight() . ';z-index:1;visibility:' . ($pComment->getVisible() ? 'visible' : 'hidden'));
+ $objWriter->writeAttribute('fillcolor', '#' . $pComment->getFillColor()->getRGB());
+ $objWriter->writeAttribute('o:insetmode', 'auto');
+
+ // v:fill
+ $objWriter->startElement('v:fill');
+ $objWriter->writeAttribute('color2', '#' . $pComment->getFillColor()->getRGB());
+ $objWriter->endElement();
+
+ // v:shadow
+ $objWriter->startElement('v:shadow');
+ $objWriter->writeAttribute('on', 't');
+ $objWriter->writeAttribute('color', 'black');
+ $objWriter->writeAttribute('obscured', 't');
+ $objWriter->endElement();
+
+ // v:path
+ $objWriter->startElement('v:path');
+ $objWriter->writeAttribute('o:connecttype', 'none');
+ $objWriter->endElement();
+
+ // v:textbox
+ $objWriter->startElement('v:textbox');
+ $objWriter->writeAttribute('style', 'mso-direction-alt:auto');
+
+ // div
+ $objWriter->startElement('div');
+ $objWriter->writeAttribute('style', 'text-align:left');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // x:ClientData
+ $objWriter->startElement('x:ClientData');
+ $objWriter->writeAttribute('ObjectType', 'Note');
+
+ // x:MoveWithCells
+ $objWriter->writeElement('x:MoveWithCells', '');
+
+ // x:SizeWithCells
+ $objWriter->writeElement('x:SizeWithCells', '');
+
+ // x:AutoFill
+ $objWriter->writeElement('x:AutoFill', 'False');
+
+ // x:Row
+ $objWriter->writeElement('x:Row', ($row - 1));
+
+ // x:Column
+ $objWriter->writeElement('x:Column', ($column - 1));
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Writer/Excel2007/ContentTypes.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php
similarity index 57%
rename from lib/phpexcel/PHPExcel/Writer/Excel2007/ContentTypes.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php
index 0d91189902a..6b22d7134f9 100644
--- a/lib/phpexcel/PHPExcel/Writer/Excel2007/ContentTypes.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/ContentTypes.php
@@ -1,48 +1,33 @@
getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
} else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
}
// XML header
@@ -68,16 +53,19 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
$this->writeDefaultContentType($objWriter, 'vml', 'application/vnd.openxmlformats-officedocument.vmlDrawing');
// Workbook
- if ($pPHPExcel->hasMacros()) { //Macros in workbook ?
+ if ($spreadsheet->hasMacros()) { //Macros in workbook ?
// Yes : not standard content but "macroEnabled"
$this->writeOverrideContentType($objWriter, '/xl/workbook.xml', 'application/vnd.ms-excel.sheet.macroEnabled.main+xml');
//... and define a new type for the VBA project
- $this->writeDefaultContentType($objWriter, 'bin', 'application/vnd.ms-office.vbaProject');
- if ($pPHPExcel->hasMacrosCertificate()) {// signed macros ?
+ // Better use Override, because we can use 'bin' also for xl\printerSettings\printerSettings1.bin
+ $this->writeOverrideContentType($objWriter, '/xl/vbaProject.bin', 'application/vnd.ms-office.vbaProject');
+ if ($spreadsheet->hasMacrosCertificate()) {
+ // signed macros ?
// Yes : add needed information
$this->writeOverrideContentType($objWriter, '/xl/vbaProjectSignature.bin', 'application/vnd.ms-office.vbaProjectSignature');
}
- } else {// no macros in workbook, so standard type
+ } else {
+ // no macros in workbook, so standard type
$this->writeOverrideContentType($objWriter, '/xl/workbook.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml');
}
@@ -86,13 +74,13 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
$this->writeOverrideContentType($objWriter, '/docProps/core.xml', 'application/vnd.openxmlformats-package.core-properties+xml');
- $customPropertyList = $pPHPExcel->getProperties()->getCustomProperties();
+ $customPropertyList = $spreadsheet->getProperties()->getCustomProperties();
if (!empty($customPropertyList)) {
$this->writeOverrideContentType($objWriter, '/docProps/custom.xml', 'application/vnd.openxmlformats-officedocument.custom-properties+xml');
}
// Worksheets
- $sheetCount = $pPHPExcel->getSheetCount();
+ $sheetCount = $spreadsheet->getSheetCount();
for ($i = 0; $i < $sheetCount; ++$i) {
$this->writeOverrideContentType($objWriter, '/xl/worksheets/sheet' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml');
}
@@ -101,14 +89,16 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
$this->writeOverrideContentType($objWriter, '/xl/sharedStrings.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml');
// Add worksheet relationship content types
+ $unparsedLoadedData = $spreadsheet->getUnparsedLoadedData();
$chart = 1;
for ($i = 0; $i < $sheetCount; ++$i) {
- $drawings = $pPHPExcel->getSheet($i)->getDrawingCollection();
+ $drawings = $spreadsheet->getSheet($i)->getDrawingCollection();
$drawingCount = count($drawings);
- $chartCount = ($includeCharts) ? $pPHPExcel->getSheet($i)->getChartCount() : 0;
+ $chartCount = ($includeCharts) ? $spreadsheet->getSheet($i)->getChartCount() : 0;
+ $hasUnparsedDrawing = isset($unparsedLoadedData['sheets'][$spreadsheet->getSheet($i)->getCodeName()]['drawingOriginalIds']);
// We need a drawing relationship for the worksheet if we have either drawings or charts
- if (($drawingCount > 0) || ($chartCount > 0)) {
+ if (($drawingCount > 0) || ($chartCount > 0) || $hasUnparsedDrawing) {
$this->writeOverrideContentType($objWriter, '/xl/drawings/drawing' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.drawing+xml');
}
@@ -122,22 +112,22 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
// Comments
for ($i = 0; $i < $sheetCount; ++$i) {
- if (count($pPHPExcel->getSheet($i)->getComments()) > 0) {
+ if (count($spreadsheet->getSheet($i)->getComments()) > 0) {
$this->writeOverrideContentType($objWriter, '/xl/comments' . ($i + 1) . '.xml', 'application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml');
}
}
// Add media content-types
- $aMediaContentTypes = array();
+ $aMediaContentTypes = [];
$mediaCount = $this->getParentWriter()->getDrawingHashTable()->count();
for ($i = 0; $i < $mediaCount; ++$i) {
- $extension = '';
- $mimeType = '';
+ $extension = '';
+ $mimeType = '';
- if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_Drawing) {
+ if ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof \PhpOffice\PhpSpreadsheet\Worksheet\Drawing) {
$extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getExtension());
$mimeType = $this->getImageMimeType($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getPath());
- } elseif ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof PHPExcel_Worksheet_MemoryDrawing) {
+ } elseif ($this->getParentWriter()->getDrawingHashTable()->getByIndex($i) instanceof MemoryDrawing) {
$extension = strtolower($this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType());
$extension = explode('/', $extension);
$extension = $extension[1];
@@ -145,26 +135,26 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
$mimeType = $this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType();
}
- if (!isset( $aMediaContentTypes[$extension])) {
+ if (!isset($aMediaContentTypes[$extension])) {
$aMediaContentTypes[$extension] = $mimeType;
$this->writeDefaultContentType($objWriter, $extension, $mimeType);
}
}
- if ($pPHPExcel->hasRibbonBinObjects()) {
+ if ($spreadsheet->hasRibbonBinObjects()) {
// Some additional objects in the ribbon ?
// we need to write "Extension" but not already write for media content
- $tabRibbonTypes=array_diff($pPHPExcel->getRibbonBinObjects('types'), array_keys($aMediaContentTypes));
+ $tabRibbonTypes = array_diff($spreadsheet->getRibbonBinObjects('types'), array_keys($aMediaContentTypes));
foreach ($tabRibbonTypes as $aRibbonType) {
- $mimeType='image/.'.$aRibbonType;//we wrote $mimeType like customUI Editor
+ $mimeType = 'image/.' . $aRibbonType; //we wrote $mimeType like customUI Editor
$this->writeDefaultContentType($objWriter, $aRibbonType, $mimeType);
}
}
- $sheetCount = $pPHPExcel->getSheetCount();
+ $sheetCount = $spreadsheet->getSheetCount();
for ($i = 0; $i < $sheetCount; ++$i) {
- if (count($pPHPExcel->getSheet()->getHeaderFooter()->getImages()) > 0) {
- foreach ($pPHPExcel->getSheet()->getHeaderFooter()->getImages() as $image) {
- if (!isset( $aMediaContentTypes[strtolower($image->getExtension())])) {
+ if (count($spreadsheet->getSheet($i)->getHeaderFooter()->getImages()) > 0) {
+ foreach ($spreadsheet->getSheet($i)->getHeaderFooter()->getImages() as $image) {
+ if (!isset($aMediaContentTypes[strtolower($image->getExtension())])) {
$aMediaContentTypes[strtolower($image->getExtension())] = $this->getImageMimeType($image->getPath());
$this->writeDefaultContentType($objWriter, strtolower($image->getExtension()), $aMediaContentTypes[strtolower($image->getExtension())]);
@@ -173,6 +163,20 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
}
}
+ // unparsed defaults
+ if (isset($unparsedLoadedData['default_content_types'])) {
+ foreach ($unparsedLoadedData['default_content_types'] as $extName => $contentType) {
+ $this->writeDefaultContentType($objWriter, $extName, $contentType);
+ }
+ }
+
+ // unparsed overrides
+ if (isset($unparsedLoadedData['override_content_types'])) {
+ foreach ($unparsedLoadedData['override_content_types'] as $partName => $overrideType) {
+ $this->writeOverrideContentType($objWriter, $partName, $overrideType);
+ }
+ }
+
$objWriter->endElement();
// Return
@@ -180,31 +184,35 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
}
/**
- * Get image mime type
+ * Get image mime type.
*
- * @param string $pFile Filename
- * @return string Mime Type
- * @throws PHPExcel_Writer_Exception
+ * @param string $pFile Filename
+ *
+ * @throws WriterException
+ *
+ * @return string Mime Type
*/
- private function getImageMimeType($pFile = '')
+ private function getImageMimeType($pFile)
{
- if (PHPExcel_Shared_File::file_exists($pFile)) {
+ if (File::fileExists($pFile)) {
$image = getimagesize($pFile);
+
return image_type_to_mime_type($image[2]);
- } else {
- throw new PHPExcel_Writer_Exception("File $pFile does not exist");
}
+
+ throw new WriterException("File $pFile does not exist");
}
/**
- * Write Default content type
+ * Write Default content type.
*
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param string $pPartname Part name
- * @param string $pContentType Content type
- * @throws PHPExcel_Writer_Exception
+ * @param XMLWriter $objWriter XML Writer
+ * @param string $pPartname Part name
+ * @param string $pContentType Content type
+ *
+ * @throws WriterException
*/
- private function writeDefaultContentType(PHPExcel_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '')
+ private function writeDefaultContentType(XMLWriter $objWriter, $pPartname, $pContentType)
{
if ($pPartname != '' && $pContentType != '') {
// Write content type
@@ -213,19 +221,20 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
$objWriter->writeAttribute('ContentType', $pContentType);
$objWriter->endElement();
} else {
- throw new PHPExcel_Writer_Exception("Invalid parameters passed.");
+ throw new WriterException('Invalid parameters passed.');
}
}
/**
- * Write Override content type
+ * Write Override content type.
*
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param string $pPartname Part name
- * @param string $pContentType Content type
- * @throws PHPExcel_Writer_Exception
+ * @param XMLWriter $objWriter XML Writer
+ * @param string $pPartname Part name
+ * @param string $pContentType Content type
+ *
+ * @throws WriterException
*/
- private function writeOverrideContentType(PHPExcel_Shared_XMLWriter $objWriter = null, $pPartname = '', $pContentType = '')
+ private function writeOverrideContentType(XMLWriter $objWriter, $pPartname, $pContentType)
{
if ($pPartname != '' && $pContentType != '') {
// Write content type
@@ -234,7 +243,7 @@ class PHPExcel_Writer_Excel2007_ContentTypes extends PHPExcel_Writer_Excel2007_W
$objWriter->writeAttribute('ContentType', $pContentType);
$objWriter->endElement();
} else {
- throw new PHPExcel_Writer_Exception("Invalid parameters passed.");
+ throw new WriterException('Invalid parameters passed.');
}
}
}
diff --git a/lib/phpexcel/PHPExcel/Writer/Excel2007/DocProps.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/DocProps.php
similarity index 56%
rename from lib/phpexcel/PHPExcel/Writer/Excel2007/DocProps.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/DocProps.php
index fef3d9371a4..2a18d5c7e3d 100644
--- a/lib/phpexcel/PHPExcel/Writer/Excel2007/DocProps.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/DocProps.php
@@ -1,47 +1,29 @@
getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
} else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
}
// XML header
@@ -76,7 +58,7 @@ class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_Write
// Variant
$objWriter->startElement('vt:variant');
- $objWriter->writeElement('vt:i4', $pPHPExcel->getSheetCount());
+ $objWriter->writeElement('vt:i4', $spreadsheet->getSheetCount());
$objWriter->endElement();
$objWriter->endElement();
@@ -88,12 +70,12 @@ class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_Write
// Vector
$objWriter->startElement('vt:vector');
- $objWriter->writeAttribute('size', $pPHPExcel->getSheetCount());
+ $objWriter->writeAttribute('size', $spreadsheet->getSheetCount());
$objWriter->writeAttribute('baseType', 'lpstr');
- $sheetCount = $pPHPExcel->getSheetCount();
+ $sheetCount = $spreadsheet->getSheetCount();
for ($i = 0; $i < $sheetCount; ++$i) {
- $objWriter->writeElement('vt:lpstr', $pPHPExcel->getSheet($i)->getTitle());
+ $objWriter->writeElement('vt:lpstr', $spreadsheet->getSheet($i)->getTitle());
}
$objWriter->endElement();
@@ -101,10 +83,10 @@ class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_Write
$objWriter->endElement();
// Company
- $objWriter->writeElement('Company', $pPHPExcel->getProperties()->getCompany());
+ $objWriter->writeElement('Company', $spreadsheet->getProperties()->getCompany());
// Company
- $objWriter->writeElement('Manager', $pPHPExcel->getProperties()->getManager());
+ $objWriter->writeElement('Manager', $spreadsheet->getProperties()->getManager());
// LinksUpToDate
$objWriter->writeElement('LinksUpToDate', 'false');
@@ -125,20 +107,22 @@ class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_Write
}
/**
- * Write docProps/core.xml to XML format
+ * Write docProps/core.xml to XML format.
*
- * @param PHPExcel $pPHPExcel
- * @return string XML Output
- * @throws PHPExcel_Writer_Exception
+ * @param Spreadsheet $spreadsheet
+ *
+ * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ *
+ * @return string XML Output
*/
- public function writeDocPropsCore(PHPExcel $pPHPExcel = null)
+ public function writeDocPropsCore(Spreadsheet $spreadsheet)
{
// Create XML writer
$objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
} else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
}
// XML header
@@ -153,37 +137,37 @@ class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_Write
$objWriter->writeAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
// dc:creator
- $objWriter->writeElement('dc:creator', $pPHPExcel->getProperties()->getCreator());
+ $objWriter->writeElement('dc:creator', $spreadsheet->getProperties()->getCreator());
// cp:lastModifiedBy
- $objWriter->writeElement('cp:lastModifiedBy', $pPHPExcel->getProperties()->getLastModifiedBy());
+ $objWriter->writeElement('cp:lastModifiedBy', $spreadsheet->getProperties()->getLastModifiedBy());
// dcterms:created
$objWriter->startElement('dcterms:created');
$objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF');
- $objWriter->writeRawData(date(DATE_W3C, $pPHPExcel->getProperties()->getCreated()));
+ $objWriter->writeRawData(date(DATE_W3C, $spreadsheet->getProperties()->getCreated()));
$objWriter->endElement();
// dcterms:modified
$objWriter->startElement('dcterms:modified');
$objWriter->writeAttribute('xsi:type', 'dcterms:W3CDTF');
- $objWriter->writeRawData(date(DATE_W3C, $pPHPExcel->getProperties()->getModified()));
+ $objWriter->writeRawData(date(DATE_W3C, $spreadsheet->getProperties()->getModified()));
$objWriter->endElement();
// dc:title
- $objWriter->writeElement('dc:title', $pPHPExcel->getProperties()->getTitle());
+ $objWriter->writeElement('dc:title', $spreadsheet->getProperties()->getTitle());
// dc:description
- $objWriter->writeElement('dc:description', $pPHPExcel->getProperties()->getDescription());
+ $objWriter->writeElement('dc:description', $spreadsheet->getProperties()->getDescription());
// dc:subject
- $objWriter->writeElement('dc:subject', $pPHPExcel->getProperties()->getSubject());
+ $objWriter->writeElement('dc:subject', $spreadsheet->getProperties()->getSubject());
// cp:keywords
- $objWriter->writeElement('cp:keywords', $pPHPExcel->getProperties()->getKeywords());
+ $objWriter->writeElement('cp:keywords', $spreadsheet->getProperties()->getKeywords());
// cp:category
- $objWriter->writeElement('cp:category', $pPHPExcel->getProperties()->getCategory());
+ $objWriter->writeElement('cp:category', $spreadsheet->getProperties()->getCategory());
$objWriter->endElement();
@@ -192,15 +176,17 @@ class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_Write
}
/**
- * Write docProps/custom.xml to XML format
+ * Write docProps/custom.xml to XML format.
*
- * @param PHPExcel $pPHPExcel
- * @return string XML Output
- * @throws PHPExcel_Writer_Exception
+ * @param Spreadsheet $spreadsheet
+ *
+ * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ *
+ * @return string XML Output
*/
- public function writeDocPropsCustom(PHPExcel $pPHPExcel = null)
+ public function writeDocPropsCustom(Spreadsheet $spreadsheet)
{
- $customPropertyList = $pPHPExcel->getProperties()->getCustomProperties();
+ $customPropertyList = $spreadsheet->getProperties()->getCustomProperties();
if (empty($customPropertyList)) {
return;
}
@@ -208,9 +194,9 @@ class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_Write
// Create XML writer
$objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
} else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
}
// XML header
@@ -221,40 +207,43 @@ class PHPExcel_Writer_Excel2007_DocProps extends PHPExcel_Writer_Excel2007_Write
$objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/officeDocument/2006/custom-properties');
$objWriter->writeAttribute('xmlns:vt', 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes');
-
foreach ($customPropertyList as $key => $customProperty) {
- $propertyValue = $pPHPExcel->getProperties()->getCustomPropertyValue($customProperty);
- $propertyType = $pPHPExcel->getProperties()->getCustomPropertyType($customProperty);
+ $propertyValue = $spreadsheet->getProperties()->getCustomPropertyValue($customProperty);
+ $propertyType = $spreadsheet->getProperties()->getCustomPropertyType($customProperty);
$objWriter->startElement('property');
$objWriter->writeAttribute('fmtid', '{D5CDD505-2E9C-101B-9397-08002B2CF9AE}');
- $objWriter->writeAttribute('pid', $key+2);
+ $objWriter->writeAttribute('pid', $key + 2);
$objWriter->writeAttribute('name', $customProperty);
switch ($propertyType) {
case 'i':
$objWriter->writeElement('vt:i4', $propertyValue);
+
break;
case 'f':
$objWriter->writeElement('vt:r8', $propertyValue);
+
break;
case 'b':
$objWriter->writeElement('vt:bool', ($propertyValue) ? 'true' : 'false');
+
break;
case 'd':
$objWriter->startElement('vt:filetime');
$objWriter->writeRawData(date(DATE_W3C, $propertyValue));
$objWriter->endElement();
+
break;
default:
$objWriter->writeElement('vt:lpwstr', $propertyValue);
+
break;
}
$objWriter->endElement();
}
-
$objWriter->endElement();
return $objWriter->getData();
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Drawing.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Drawing.php
new file mode 100644
index 00000000000..08256a1d5b7
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Drawing.php
@@ -0,0 +1,519 @@
+getParentWriter()->getUseDiskCaching()) {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ } else {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
+ }
+
+ // XML header
+ $objWriter->startDocument('1.0', 'UTF-8', 'yes');
+
+ // xdr:wsDr
+ $objWriter->startElement('xdr:wsDr');
+ $objWriter->writeAttribute('xmlns:xdr', 'http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing');
+ $objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main');
+
+ // Loop through images and write drawings
+ $i = 1;
+ $iterator = $pWorksheet->getDrawingCollection()->getIterator();
+ while ($iterator->valid()) {
+ /** @var BaseDrawing $pDrawing */
+ $pDrawing = $iterator->current();
+ $pRelationId = $i;
+ $hlinkClickId = $pDrawing->getHyperlink() === null ? null : ++$i;
+
+ $this->writeDrawing($objWriter, $pDrawing, $pRelationId, $hlinkClickId);
+
+ $iterator->next();
+ ++$i;
+ }
+
+ if ($includeCharts) {
+ $chartCount = $pWorksheet->getChartCount();
+ // Loop through charts and write the chart position
+ if ($chartCount > 0) {
+ for ($c = 0; $c < $chartCount; ++$c) {
+ $this->writeChart($objWriter, $pWorksheet->getChartByIndex($c), $c + $i);
+ }
+ }
+ }
+
+ // unparsed AlternateContent
+ $unparsedLoadedData = $pWorksheet->getParent()->getUnparsedLoadedData();
+ if (isset($unparsedLoadedData['sheets'][$pWorksheet->getCodeName()]['drawingAlternateContents'])) {
+ foreach ($unparsedLoadedData['sheets'][$pWorksheet->getCodeName()]['drawingAlternateContents'] as $drawingAlternateContent) {
+ $objWriter->writeRaw($drawingAlternateContent);
+ }
+ }
+
+ $objWriter->endElement();
+
+ // Return
+ return $objWriter->getData();
+ }
+
+ /**
+ * Write drawings to XML format.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param \PhpOffice\PhpSpreadsheet\Chart\Chart $pChart
+ * @param int $pRelationId
+ */
+ public function writeChart(XMLWriter $objWriter, \PhpOffice\PhpSpreadsheet\Chart\Chart $pChart, $pRelationId = -1)
+ {
+ $tl = $pChart->getTopLeftPosition();
+ $tl['colRow'] = Coordinate::coordinateFromString($tl['cell']);
+ $br = $pChart->getBottomRightPosition();
+ $br['colRow'] = Coordinate::coordinateFromString($br['cell']);
+
+ $objWriter->startElement('xdr:twoCellAnchor');
+
+ $objWriter->startElement('xdr:from');
+ $objWriter->writeElement('xdr:col', Coordinate::columnIndexFromString($tl['colRow'][0]) - 1);
+ $objWriter->writeElement('xdr:colOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($tl['xOffset']));
+ $objWriter->writeElement('xdr:row', $tl['colRow'][1] - 1);
+ $objWriter->writeElement('xdr:rowOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($tl['yOffset']));
+ $objWriter->endElement();
+ $objWriter->startElement('xdr:to');
+ $objWriter->writeElement('xdr:col', Coordinate::columnIndexFromString($br['colRow'][0]) - 1);
+ $objWriter->writeElement('xdr:colOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($br['xOffset']));
+ $objWriter->writeElement('xdr:row', $br['colRow'][1] - 1);
+ $objWriter->writeElement('xdr:rowOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($br['yOffset']));
+ $objWriter->endElement();
+
+ $objWriter->startElement('xdr:graphicFrame');
+ $objWriter->writeAttribute('macro', '');
+ $objWriter->startElement('xdr:nvGraphicFramePr');
+ $objWriter->startElement('xdr:cNvPr');
+ $objWriter->writeAttribute('name', 'Chart ' . $pRelationId);
+ $objWriter->writeAttribute('id', 1025 * $pRelationId);
+ $objWriter->endElement();
+ $objWriter->startElement('xdr:cNvGraphicFramePr');
+ $objWriter->startElement('a:graphicFrameLocks');
+ $objWriter->endElement();
+ $objWriter->endElement();
+ $objWriter->endElement();
+
+ $objWriter->startElement('xdr:xfrm');
+ $objWriter->startElement('a:off');
+ $objWriter->writeAttribute('x', '0');
+ $objWriter->writeAttribute('y', '0');
+ $objWriter->endElement();
+ $objWriter->startElement('a:ext');
+ $objWriter->writeAttribute('cx', '0');
+ $objWriter->writeAttribute('cy', '0');
+ $objWriter->endElement();
+ $objWriter->endElement();
+
+ $objWriter->startElement('a:graphic');
+ $objWriter->startElement('a:graphicData');
+ $objWriter->writeAttribute('uri', 'http://schemas.openxmlformats.org/drawingml/2006/chart');
+ $objWriter->startElement('c:chart');
+ $objWriter->writeAttribute('xmlns:c', 'http://schemas.openxmlformats.org/drawingml/2006/chart');
+ $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
+ $objWriter->writeAttribute('r:id', 'rId' . $pRelationId);
+ $objWriter->endElement();
+ $objWriter->endElement();
+ $objWriter->endElement();
+ $objWriter->endElement();
+
+ $objWriter->startElement('xdr:clientData');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write drawings to XML format.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param BaseDrawing $pDrawing
+ * @param int $pRelationId
+ * @param null|int $hlinkClickId
+ *
+ * @throws WriterException
+ */
+ public function writeDrawing(XMLWriter $objWriter, BaseDrawing $pDrawing, $pRelationId = -1, $hlinkClickId = null)
+ {
+ if ($pRelationId >= 0) {
+ // xdr:oneCellAnchor
+ $objWriter->startElement('xdr:oneCellAnchor');
+ // Image location
+ $aCoordinates = Coordinate::coordinateFromString($pDrawing->getCoordinates());
+ $aCoordinates[0] = Coordinate::columnIndexFromString($aCoordinates[0]);
+
+ // xdr:from
+ $objWriter->startElement('xdr:from');
+ $objWriter->writeElement('xdr:col', $aCoordinates[0] - 1);
+ $objWriter->writeElement('xdr:colOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getOffsetX()));
+ $objWriter->writeElement('xdr:row', $aCoordinates[1] - 1);
+ $objWriter->writeElement('xdr:rowOff', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getOffsetY()));
+ $objWriter->endElement();
+
+ // xdr:ext
+ $objWriter->startElement('xdr:ext');
+ $objWriter->writeAttribute('cx', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getWidth()));
+ $objWriter->writeAttribute('cy', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getHeight()));
+ $objWriter->endElement();
+
+ // xdr:pic
+ $objWriter->startElement('xdr:pic');
+
+ // xdr:nvPicPr
+ $objWriter->startElement('xdr:nvPicPr');
+
+ // xdr:cNvPr
+ $objWriter->startElement('xdr:cNvPr');
+ $objWriter->writeAttribute('id', $pRelationId);
+ $objWriter->writeAttribute('name', $pDrawing->getName());
+ $objWriter->writeAttribute('descr', $pDrawing->getDescription());
+
+ //a:hlinkClick
+ $this->writeHyperLinkDrawing($objWriter, $hlinkClickId);
+
+ $objWriter->endElement();
+
+ // xdr:cNvPicPr
+ $objWriter->startElement('xdr:cNvPicPr');
+
+ // a:picLocks
+ $objWriter->startElement('a:picLocks');
+ $objWriter->writeAttribute('noChangeAspect', '1');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // xdr:blipFill
+ $objWriter->startElement('xdr:blipFill');
+
+ // a:blip
+ $objWriter->startElement('a:blip');
+ $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
+ $objWriter->writeAttribute('r:embed', 'rId' . $pRelationId);
+ $objWriter->endElement();
+
+ // a:stretch
+ $objWriter->startElement('a:stretch');
+ $objWriter->writeElement('a:fillRect', null);
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // xdr:spPr
+ $objWriter->startElement('xdr:spPr');
+
+ // a:xfrm
+ $objWriter->startElement('a:xfrm');
+ $objWriter->writeAttribute('rot', \PhpOffice\PhpSpreadsheet\Shared\Drawing::degreesToAngle($pDrawing->getRotation()));
+ $objWriter->endElement();
+
+ // a:prstGeom
+ $objWriter->startElement('a:prstGeom');
+ $objWriter->writeAttribute('prst', 'rect');
+
+ // a:avLst
+ $objWriter->writeElement('a:avLst', null);
+
+ $objWriter->endElement();
+
+ if ($pDrawing->getShadow()->getVisible()) {
+ // a:effectLst
+ $objWriter->startElement('a:effectLst');
+
+ // a:outerShdw
+ $objWriter->startElement('a:outerShdw');
+ $objWriter->writeAttribute('blurRad', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getShadow()->getBlurRadius()));
+ $objWriter->writeAttribute('dist', \PhpOffice\PhpSpreadsheet\Shared\Drawing::pixelsToEMU($pDrawing->getShadow()->getDistance()));
+ $objWriter->writeAttribute('dir', \PhpOffice\PhpSpreadsheet\Shared\Drawing::degreesToAngle($pDrawing->getShadow()->getDirection()));
+ $objWriter->writeAttribute('algn', $pDrawing->getShadow()->getAlignment());
+ $objWriter->writeAttribute('rotWithShape', '0');
+
+ // a:srgbClr
+ $objWriter->startElement('a:srgbClr');
+ $objWriter->writeAttribute('val', $pDrawing->getShadow()->getColor()->getRGB());
+
+ // a:alpha
+ $objWriter->startElement('a:alpha');
+ $objWriter->writeAttribute('val', $pDrawing->getShadow()->getAlpha() * 1000);
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+ }
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // xdr:clientData
+ $objWriter->writeElement('xdr:clientData', null);
+
+ $objWriter->endElement();
+ } else {
+ throw new WriterException('Invalid parameters passed.');
+ }
+ }
+
+ /**
+ * Write VML header/footer images to XML format.
+ *
+ * @param \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet
+ *
+ * @throws WriterException
+ *
+ * @return string XML Output
+ */
+ public function writeVMLHeaderFooterImages(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet)
+ {
+ // Create XML writer
+ $objWriter = null;
+ if ($this->getParentWriter()->getUseDiskCaching()) {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ } else {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
+ }
+
+ // XML header
+ $objWriter->startDocument('1.0', 'UTF-8', 'yes');
+
+ // Header/footer images
+ $images = $pWorksheet->getHeaderFooter()->getImages();
+
+ // xml
+ $objWriter->startElement('xml');
+ $objWriter->writeAttribute('xmlns:v', 'urn:schemas-microsoft-com:vml');
+ $objWriter->writeAttribute('xmlns:o', 'urn:schemas-microsoft-com:office:office');
+ $objWriter->writeAttribute('xmlns:x', 'urn:schemas-microsoft-com:office:excel');
+
+ // o:shapelayout
+ $objWriter->startElement('o:shapelayout');
+ $objWriter->writeAttribute('v:ext', 'edit');
+
+ // o:idmap
+ $objWriter->startElement('o:idmap');
+ $objWriter->writeAttribute('v:ext', 'edit');
+ $objWriter->writeAttribute('data', '1');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // v:shapetype
+ $objWriter->startElement('v:shapetype');
+ $objWriter->writeAttribute('id', '_x0000_t75');
+ $objWriter->writeAttribute('coordsize', '21600,21600');
+ $objWriter->writeAttribute('o:spt', '75');
+ $objWriter->writeAttribute('o:preferrelative', 't');
+ $objWriter->writeAttribute('path', 'm@4@5l@4@11@9@11@9@5xe');
+ $objWriter->writeAttribute('filled', 'f');
+ $objWriter->writeAttribute('stroked', 'f');
+
+ // v:stroke
+ $objWriter->startElement('v:stroke');
+ $objWriter->writeAttribute('joinstyle', 'miter');
+ $objWriter->endElement();
+
+ // v:formulas
+ $objWriter->startElement('v:formulas');
+
+ // v:f
+ $objWriter->startElement('v:f');
+ $objWriter->writeAttribute('eqn', 'if lineDrawn pixelLineWidth 0');
+ $objWriter->endElement();
+
+ // v:f
+ $objWriter->startElement('v:f');
+ $objWriter->writeAttribute('eqn', 'sum @0 1 0');
+ $objWriter->endElement();
+
+ // v:f
+ $objWriter->startElement('v:f');
+ $objWriter->writeAttribute('eqn', 'sum 0 0 @1');
+ $objWriter->endElement();
+
+ // v:f
+ $objWriter->startElement('v:f');
+ $objWriter->writeAttribute('eqn', 'prod @2 1 2');
+ $objWriter->endElement();
+
+ // v:f
+ $objWriter->startElement('v:f');
+ $objWriter->writeAttribute('eqn', 'prod @3 21600 pixelWidth');
+ $objWriter->endElement();
+
+ // v:f
+ $objWriter->startElement('v:f');
+ $objWriter->writeAttribute('eqn', 'prod @3 21600 pixelHeight');
+ $objWriter->endElement();
+
+ // v:f
+ $objWriter->startElement('v:f');
+ $objWriter->writeAttribute('eqn', 'sum @0 0 1');
+ $objWriter->endElement();
+
+ // v:f
+ $objWriter->startElement('v:f');
+ $objWriter->writeAttribute('eqn', 'prod @6 1 2');
+ $objWriter->endElement();
+
+ // v:f
+ $objWriter->startElement('v:f');
+ $objWriter->writeAttribute('eqn', 'prod @7 21600 pixelWidth');
+ $objWriter->endElement();
+
+ // v:f
+ $objWriter->startElement('v:f');
+ $objWriter->writeAttribute('eqn', 'sum @8 21600 0');
+ $objWriter->endElement();
+
+ // v:f
+ $objWriter->startElement('v:f');
+ $objWriter->writeAttribute('eqn', 'prod @7 21600 pixelHeight');
+ $objWriter->endElement();
+
+ // v:f
+ $objWriter->startElement('v:f');
+ $objWriter->writeAttribute('eqn', 'sum @10 21600 0');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // v:path
+ $objWriter->startElement('v:path');
+ $objWriter->writeAttribute('o:extrusionok', 'f');
+ $objWriter->writeAttribute('gradientshapeok', 't');
+ $objWriter->writeAttribute('o:connecttype', 'rect');
+ $objWriter->endElement();
+
+ // o:lock
+ $objWriter->startElement('o:lock');
+ $objWriter->writeAttribute('v:ext', 'edit');
+ $objWriter->writeAttribute('aspectratio', 't');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // Loop through images
+ foreach ($images as $key => $value) {
+ $this->writeVMLHeaderFooterImage($objWriter, $key, $value);
+ }
+
+ $objWriter->endElement();
+
+ // Return
+ return $objWriter->getData();
+ }
+
+ /**
+ * Write VML comment to XML format.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param string $pReference Reference
+ * @param HeaderFooterDrawing $pImage Image
+ */
+ private function writeVMLHeaderFooterImage(XMLWriter $objWriter, $pReference, HeaderFooterDrawing $pImage)
+ {
+ // Calculate object id
+ preg_match('{(\d+)}', md5($pReference), $m);
+ $id = 1500 + (substr($m[1], 0, 2) * 1);
+
+ // Calculate offset
+ $width = $pImage->getWidth();
+ $height = $pImage->getHeight();
+ $marginLeft = $pImage->getOffsetX();
+ $marginTop = $pImage->getOffsetY();
+
+ // v:shape
+ $objWriter->startElement('v:shape');
+ $objWriter->writeAttribute('id', $pReference);
+ $objWriter->writeAttribute('o:spid', '_x0000_s' . $id);
+ $objWriter->writeAttribute('type', '#_x0000_t75');
+ $objWriter->writeAttribute('style', "position:absolute;margin-left:{$marginLeft}px;margin-top:{$marginTop}px;width:{$width}px;height:{$height}px;z-index:1");
+
+ // v:imagedata
+ $objWriter->startElement('v:imagedata');
+ $objWriter->writeAttribute('o:relid', 'rId' . $pReference);
+ $objWriter->writeAttribute('o:title', $pImage->getName());
+ $objWriter->endElement();
+
+ // o:lock
+ $objWriter->startElement('o:lock');
+ $objWriter->writeAttribute('v:ext', 'edit');
+ $objWriter->writeAttribute('textRotation', 't');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+ }
+
+ /**
+ * Get an array of all drawings.
+ *
+ * @param Spreadsheet $spreadsheet
+ *
+ * @return \PhpOffice\PhpSpreadsheet\Worksheet\Drawing[] All drawings in PhpSpreadsheet
+ */
+ public function allDrawings(Spreadsheet $spreadsheet)
+ {
+ // Get an array of all drawings
+ $aDrawings = [];
+
+ // Loop through PhpSpreadsheet
+ $sheetCount = $spreadsheet->getSheetCount();
+ for ($i = 0; $i < $sheetCount; ++$i) {
+ // Loop through images and add to array
+ $iterator = $spreadsheet->getSheet($i)->getDrawingCollection()->getIterator();
+ while ($iterator->valid()) {
+ $aDrawings[] = $iterator->current();
+
+ $iterator->next();
+ }
+ }
+
+ return $aDrawings;
+ }
+
+ /**
+ * @param XMLWriter $objWriter
+ * @param null|int $hlinkClickId
+ */
+ private function writeHyperLinkDrawing(XMLWriter $objWriter, $hlinkClickId)
+ {
+ if ($hlinkClickId === null) {
+ return;
+ }
+
+ $objWriter->startElement('a:hlinkClick');
+ $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
+ $objWriter->writeAttribute('r:id', 'rId' . $hlinkClickId);
+ $objWriter->endElement();
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Writer/Excel2007/Rels.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Rels.php
similarity index 58%
rename from lib/phpexcel/PHPExcel/Writer/Excel2007/Rels.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Rels.php
index dd1faf9b1c9..76c196b4495 100644
--- a/lib/phpexcel/PHPExcel/Writer/Excel2007/Rels.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Rels.php
@@ -1,47 +1,31 @@
getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
} else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
}
// XML header
@@ -51,7 +35,7 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
$objWriter->startElement('Relationships');
$objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');
- $customPropertyList = $pPHPExcel->getProperties()->getCustomProperties();
+ $customPropertyList = $spreadsheet->getProperties()->getCustomProperties();
if (!empty($customPropertyList)) {
// Relationship docProps/app.xml
$this->writeRelationship(
@@ -60,7 +44,6 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties',
'docProps/custom.xml'
);
-
}
// Relationship docProps/app.xml
@@ -87,12 +70,12 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
'xl/workbook.xml'
);
// a custom UI in workbook ?
- if ($pPHPExcel->hasRibbon()) {
- $this->_writeRelationShip(
+ if ($spreadsheet->hasRibbon()) {
+ $this->writeRelationShip(
$objWriter,
5,
'http://schemas.microsoft.com/office/2006/relationships/ui/extensibility',
- $pPHPExcel->getRibbonXMLData('target')
+ $spreadsheet->getRibbonXMLData('target')
);
}
@@ -102,20 +85,22 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
}
/**
- * Write workbook relationships to XML format
+ * Write workbook relationships to XML format.
*
- * @param PHPExcel $pPHPExcel
- * @return string XML Output
- * @throws PHPExcel_Writer_Exception
+ * @param Spreadsheet $spreadsheet
+ *
+ * @throws WriterException
+ *
+ * @return string XML Output
*/
- public function writeWorkbookRelationships(PHPExcel $pPHPExcel = null)
+ public function writeWorkbookRelationships(Spreadsheet $spreadsheet)
{
// Create XML writer
$objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
} else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
}
// XML header
@@ -150,7 +135,7 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
);
// Relationships with sheets
- $sheetCount = $pPHPExcel->getSheetCount();
+ $sheetCount = $spreadsheet->getSheetCount();
for ($i = 0; $i < $sheetCount; ++$i) {
$this->writeRelationship(
$objWriter,
@@ -161,14 +146,14 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
}
// Relationships for vbaProject if needed
// id : just after the last sheet
- if ($pPHPExcel->hasMacros()) {
- $this->_writeRelationShip(
+ if ($spreadsheet->hasMacros()) {
+ $this->writeRelationShip(
$objWriter,
($i + 1 + 3),
'http://schemas.microsoft.com/office/2006/relationships/vbaProject',
'vbaProject.bin'
);
- ++$i;//increment i if needed for an another relation
+ ++$i; //increment i if needed for an another relation
}
$objWriter->endElement();
@@ -177,26 +162,28 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
}
/**
- * Write worksheet relationships to XML format
+ * Write worksheet relationships to XML format.
*
* Numbering is as follows:
* rId1 - Drawings
* rId_hyperlink_x - Hyperlinks
*
- * @param PHPExcel_Worksheet $pWorksheet
- * @param int $pWorksheetId
- * @param boolean $includeCharts Flag indicating if we should write charts
- * @return string XML Output
- * @throws PHPExcel_Writer_Exception
+ * @param \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet
+ * @param int $pWorksheetId
+ * @param bool $includeCharts Flag indicating if we should write charts
+ *
+ * @throws WriterException
+ *
+ * @return string XML Output
*/
- public function writeWorksheetRelationships(PHPExcel_Worksheet $pWorksheet = null, $pWorksheetId = 1, $includeCharts = false)
+ public function writeWorksheetRelationships(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet, $pWorksheetId = 1, $includeCharts = false)
{
// Create XML writer
$objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
} else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
}
// XML header
@@ -208,36 +195,34 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
// Write drawing relationships?
$d = 0;
+ $drawingOriginalIds = [];
+ $unparsedLoadedData = $pWorksheet->getParent()->getUnparsedLoadedData();
+ if (isset($unparsedLoadedData['sheets'][$pWorksheet->getCodeName()]['drawingOriginalIds'])) {
+ $drawingOriginalIds = $unparsedLoadedData['sheets'][$pWorksheet->getCodeName()]['drawingOriginalIds'];
+ }
+
if ($includeCharts) {
$charts = $pWorksheet->getChartCollection();
} else {
- $charts = array();
+ $charts = [];
}
- if (($pWorksheet->getDrawingCollection()->count() > 0) ||
- (count($charts) > 0)) {
+
+ if (($pWorksheet->getDrawingCollection()->count() > 0) || (count($charts) > 0) || $drawingOriginalIds) {
+ $relPath = '../drawings/drawing' . $pWorksheetId . '.xml';
+ $rId = ++$d;
+
+ if (isset($drawingOriginalIds[$relPath])) {
+ $rId = (int) (substr($drawingOriginalIds[$relPath], 3));
+ }
+
$this->writeRelationship(
$objWriter,
- ++$d,
+ $rId,
'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing',
- '../drawings/drawing' . $pWorksheetId . '.xml'
+ $relPath
);
}
- // Write chart relationships?
-// $chartCount = 0;
-// $charts = $pWorksheet->getChartCollection();
-// echo 'Chart Rels: ' , count($charts) , '
';
-// if (count($charts) > 0) {
-// foreach ($charts as $chart) {
-// $this->writeRelationship(
-// $objWriter,
-// ++$d,
-// 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart',
-// '../charts/chart' . ++$chartCount . '.xml'
-// );
-// }
-// }
-//
// Write hyperlink relationships?
$i = 1;
foreach ($pWorksheet->getHyperlinkCollection() as $hyperlink) {
@@ -283,28 +268,51 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
);
}
+ $this->writeUnparsedRelationship($pWorksheet, $objWriter, 'ctrlProps', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp');
+ $this->writeUnparsedRelationship($pWorksheet, $objWriter, 'vmlDrawings', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing');
+ $this->writeUnparsedRelationship($pWorksheet, $objWriter, 'printerSettings', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/printerSettings');
+
$objWriter->endElement();
return $objWriter->getData();
}
+ private function writeUnparsedRelationship(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet, XMLWriter $objWriter, $relationship, $type)
+ {
+ $unparsedLoadedData = $pWorksheet->getParent()->getUnparsedLoadedData();
+ if (!isset($unparsedLoadedData['sheets'][$pWorksheet->getCodeName()][$relationship])) {
+ return;
+ }
+
+ foreach ($unparsedLoadedData['sheets'][$pWorksheet->getCodeName()][$relationship] as $rId => $value) {
+ $this->writeRelationship(
+ $objWriter,
+ $rId,
+ $type,
+ $value['relFilePath']
+ );
+ }
+ }
+
/**
- * Write drawing relationships to XML format
+ * Write drawing relationships to XML format.
*
- * @param PHPExcel_Worksheet $pWorksheet
- * @param int &$chartRef Chart ID
- * @param boolean $includeCharts Flag indicating if we should write charts
- * @return string XML Output
- * @throws PHPExcel_Writer_Exception
+ * @param \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet
+ * @param int &$chartRef Chart ID
+ * @param bool $includeCharts Flag indicating if we should write charts
+ *
+ * @throws WriterException
+ *
+ * @return string XML Output
*/
- public function writeDrawingRelationships(PHPExcel_Worksheet $pWorksheet = null, &$chartRef, $includeCharts = false)
+ public function writeDrawingRelationships(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet, &$chartRef, $includeCharts = false)
{
// Create XML writer
$objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
} else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
}
// XML header
@@ -318,15 +326,19 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
$i = 1;
$iterator = $pWorksheet->getDrawingCollection()->getIterator();
while ($iterator->valid()) {
- if ($iterator->current() instanceof PHPExcel_Worksheet_Drawing
- || $iterator->current() instanceof PHPExcel_Worksheet_MemoryDrawing) {
+ if ($iterator->current() instanceof \PhpOffice\PhpSpreadsheet\Worksheet\Drawing
+ || $iterator->current() instanceof MemoryDrawing) {
// Write relationship for image drawing
+ /** @var \PhpOffice\PhpSpreadsheet\Worksheet\Drawing $drawing */
+ $drawing = $iterator->current();
$this->writeRelationship(
$objWriter,
$i,
'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image',
- '../media/' . str_replace(' ', '', $iterator->current()->getIndexedFilename())
+ '../media/' . str_replace(' ', '', $drawing->getIndexedFilename())
);
+
+ $i = $this->writeDrawingHyperLink($objWriter, $drawing, $i);
}
$iterator->next();
@@ -354,20 +366,22 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
}
/**
- * Write header/footer drawing relationships to XML format
+ * Write header/footer drawing relationships to XML format.
*
- * @param PHPExcel_Worksheet $pWorksheet
- * @return string XML Output
- * @throws PHPExcel_Writer_Exception
+ * @param \PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet
+ *
+ * @throws WriterException
+ *
+ * @return string XML Output
*/
- public function writeHeaderFooterDrawingRelationships(PHPExcel_Worksheet $pWorksheet = null)
+ public function writeHeaderFooterDrawingRelationships(\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $pWorksheet)
{
// Create XML writer
$objWriter = null;
if ($this->getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
} else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
}
// XML header
@@ -394,16 +408,17 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
}
/**
- * Write Override content type
+ * Write Override content type.
*
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param int $pId Relationship ID. rId will be prepended!
- * @param string $pType Relationship type
- * @param string $pTarget Relationship target
- * @param string $pTargetMode Relationship target mode
- * @throws PHPExcel_Writer_Exception
+ * @param XMLWriter $objWriter XML Writer
+ * @param int $pId Relationship ID. rId will be prepended!
+ * @param string $pType Relationship type
+ * @param string $pTarget Relationship target
+ * @param string $pTargetMode Relationship target mode
+ *
+ * @throws WriterException
*/
- private function writeRelationship(PHPExcel_Shared_XMLWriter $objWriter = null, $pId = 1, $pType = '', $pTarget = '', $pTargetMode = '')
+ private function writeRelationship(XMLWriter $objWriter, $pId, $pType, $pTarget, $pTargetMode = '')
{
if ($pType != '' && $pTarget != '') {
// Write relationship
@@ -418,7 +433,34 @@ class PHPExcel_Writer_Excel2007_Rels extends PHPExcel_Writer_Excel2007_WriterPar
$objWriter->endElement();
} else {
- throw new PHPExcel_Writer_Exception("Invalid parameters passed.");
+ throw new WriterException('Invalid parameters passed.');
}
}
+
+ /**
+ * @param $objWriter
+ * @param \PhpOffice\PhpSpreadsheet\Worksheet\Drawing $drawing
+ * @param $i
+ *
+ * @throws WriterException
+ *
+ * @return int
+ */
+ private function writeDrawingHyperLink($objWriter, $drawing, $i)
+ {
+ if ($drawing->getHyperlink() === null) {
+ return $i;
+ }
+
+ ++$i;
+ $this->writeRelationship(
+ $objWriter,
+ $i,
+ 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink',
+ $drawing->getHyperlink()->getUrl(),
+ $drawing->getHyperlink()->getTypeHyperlink()
+ );
+
+ return $i;
+ }
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsRibbon.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsRibbon.php
new file mode 100644
index 00000000000..8a0cfe34508
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsRibbon.php
@@ -0,0 +1,49 @@
+getParentWriter()->getUseDiskCaching()) {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ } else {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
+ }
+
+ // XML header
+ $objWriter->startDocument('1.0', 'UTF-8', 'yes');
+
+ // Relationships
+ $objWriter->startElement('Relationships');
+ $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');
+ $localRels = $spreadsheet->getRibbonBinObjects('names');
+ if (is_array($localRels)) {
+ foreach ($localRels as $aId => $aTarget) {
+ $objWriter->startElement('Relationship');
+ $objWriter->writeAttribute('Id', $aId);
+ $objWriter->writeAttribute('Type', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image');
+ $objWriter->writeAttribute('Target', $aTarget);
+ $objWriter->endElement();
+ }
+ }
+ $objWriter->endElement();
+
+ return $objWriter->getData();
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsVBA.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsVBA.php
new file mode 100644
index 00000000000..01ad38de67b
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/RelsVBA.php
@@ -0,0 +1,44 @@
+getParentWriter()->getUseDiskCaching()) {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ } else {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
+ }
+
+ // XML header
+ $objWriter->startDocument('1.0', 'UTF-8', 'yes');
+
+ // Relationships
+ $objWriter->startElement('Relationships');
+ $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');
+ $objWriter->startElement('Relationship');
+ $objWriter->writeAttribute('Id', 'rId1');
+ $objWriter->writeAttribute('Type', 'http://schemas.microsoft.com/office/2006/relationships/vbaProjectSignature');
+ $objWriter->writeAttribute('Target', 'vbaProjectSignature.bin');
+ $objWriter->endElement();
+ $objWriter->endElement();
+
+ return $objWriter->getData();
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/StringTable.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/StringTable.php
new file mode 100644
index 00000000000..19604e44867
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/StringTable.php
@@ -0,0 +1,281 @@
+flipStringTable($aStringTable);
+
+ // Loop through cells
+ foreach ($pSheet->getCoordinates() as $coordinate) {
+ $cell = $pSheet->getCell($coordinate);
+ $cellValue = $cell->getValue();
+ if (!is_object($cellValue) &&
+ ($cellValue !== null) &&
+ $cellValue !== '' &&
+ !isset($aFlippedStringTable[$cellValue]) &&
+ ($cell->getDataType() == DataType::TYPE_STRING || $cell->getDataType() == DataType::TYPE_STRING2 || $cell->getDataType() == DataType::TYPE_NULL)) {
+ $aStringTable[] = $cellValue;
+ $aFlippedStringTable[$cellValue] = true;
+ } elseif ($cellValue instanceof RichText &&
+ ($cellValue !== null) &&
+ !isset($aFlippedStringTable[$cellValue->getHashCode()])) {
+ $aStringTable[] = $cellValue;
+ $aFlippedStringTable[$cellValue->getHashCode()] = true;
+ }
+ }
+
+ return $aStringTable;
+ }
+
+ /**
+ * Write string table to XML format.
+ *
+ * @param string[] $pStringTable
+ *
+ * @throws WriterException
+ *
+ * @return string XML Output
+ */
+ public function writeStringTable(array $pStringTable)
+ {
+ // Create XML writer
+ $objWriter = null;
+ if ($this->getParentWriter()->getUseDiskCaching()) {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ } else {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
+ }
+
+ // XML header
+ $objWriter->startDocument('1.0', 'UTF-8', 'yes');
+
+ // String table
+ $objWriter->startElement('sst');
+ $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main');
+ $objWriter->writeAttribute('uniqueCount', count($pStringTable));
+
+ // Loop through string table
+ foreach ($pStringTable as $textElement) {
+ $objWriter->startElement('si');
+
+ if (!$textElement instanceof RichText) {
+ $textToWrite = StringHelper::controlCharacterPHP2OOXML($textElement);
+ $objWriter->startElement('t');
+ if ($textToWrite !== trim($textToWrite)) {
+ $objWriter->writeAttribute('xml:space', 'preserve');
+ }
+ $objWriter->writeRawData($textToWrite);
+ $objWriter->endElement();
+ } elseif ($textElement instanceof RichText) {
+ $this->writeRichText($objWriter, $textElement);
+ }
+
+ $objWriter->endElement();
+ }
+
+ $objWriter->endElement();
+
+ return $objWriter->getData();
+ }
+
+ /**
+ * Write Rich Text.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param RichText $pRichText Rich text
+ * @param string $prefix Optional Namespace prefix
+ */
+ public function writeRichText(XMLWriter $objWriter, RichText $pRichText, $prefix = null)
+ {
+ if ($prefix !== null) {
+ $prefix .= ':';
+ }
+
+ // Loop through rich text elements
+ $elements = $pRichText->getRichTextElements();
+ foreach ($elements as $element) {
+ // r
+ $objWriter->startElement($prefix . 'r');
+
+ // rPr
+ if ($element instanceof Run) {
+ // rPr
+ $objWriter->startElement($prefix . 'rPr');
+
+ // rFont
+ $objWriter->startElement($prefix . 'rFont');
+ $objWriter->writeAttribute('val', $element->getFont()->getName());
+ $objWriter->endElement();
+
+ // Bold
+ $objWriter->startElement($prefix . 'b');
+ $objWriter->writeAttribute('val', ($element->getFont()->getBold() ? 'true' : 'false'));
+ $objWriter->endElement();
+
+ // Italic
+ $objWriter->startElement($prefix . 'i');
+ $objWriter->writeAttribute('val', ($element->getFont()->getItalic() ? 'true' : 'false'));
+ $objWriter->endElement();
+
+ // Superscript / subscript
+ if ($element->getFont()->getSuperscript() || $element->getFont()->getSubscript()) {
+ $objWriter->startElement($prefix . 'vertAlign');
+ if ($element->getFont()->getSuperscript()) {
+ $objWriter->writeAttribute('val', 'superscript');
+ } elseif ($element->getFont()->getSubscript()) {
+ $objWriter->writeAttribute('val', 'subscript');
+ }
+ $objWriter->endElement();
+ }
+
+ // Strikethrough
+ $objWriter->startElement($prefix . 'strike');
+ $objWriter->writeAttribute('val', ($element->getFont()->getStrikethrough() ? 'true' : 'false'));
+ $objWriter->endElement();
+
+ // Color
+ $objWriter->startElement($prefix . 'color');
+ $objWriter->writeAttribute('rgb', $element->getFont()->getColor()->getARGB());
+ $objWriter->endElement();
+
+ // Size
+ $objWriter->startElement($prefix . 'sz');
+ $objWriter->writeAttribute('val', $element->getFont()->getSize());
+ $objWriter->endElement();
+
+ // Underline
+ $objWriter->startElement($prefix . 'u');
+ $objWriter->writeAttribute('val', $element->getFont()->getUnderline());
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+ }
+
+ // t
+ $objWriter->startElement($prefix . 't');
+ $objWriter->writeAttribute('xml:space', 'preserve');
+ $objWriter->writeRawData(StringHelper::controlCharacterPHP2OOXML($element->getText()));
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+ }
+ }
+
+ /**
+ * Write Rich Text.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param RichText|string $pRichText text string or Rich text
+ * @param string $prefix Optional Namespace prefix
+ */
+ public function writeRichTextForCharts(XMLWriter $objWriter, $pRichText = null, $prefix = null)
+ {
+ if (!$pRichText instanceof RichText) {
+ $textRun = $pRichText;
+ $pRichText = new RichText();
+ $pRichText->createTextRun($textRun);
+ }
+
+ if ($prefix !== null) {
+ $prefix .= ':';
+ }
+
+ // Loop through rich text elements
+ $elements = $pRichText->getRichTextElements();
+ foreach ($elements as $element) {
+ // r
+ $objWriter->startElement($prefix . 'r');
+
+ // rPr
+ $objWriter->startElement($prefix . 'rPr');
+
+ // Bold
+ $objWriter->writeAttribute('b', ($element->getFont()->getBold() ? 1 : 0));
+ // Italic
+ $objWriter->writeAttribute('i', ($element->getFont()->getItalic() ? 1 : 0));
+ // Underline
+ $underlineType = $element->getFont()->getUnderline();
+ switch ($underlineType) {
+ case 'single':
+ $underlineType = 'sng';
+
+ break;
+ case 'double':
+ $underlineType = 'dbl';
+
+ break;
+ }
+ $objWriter->writeAttribute('u', $underlineType);
+ // Strikethrough
+ $objWriter->writeAttribute('strike', ($element->getFont()->getStrikethrough() ? 'sngStrike' : 'noStrike'));
+
+ // rFont
+ $objWriter->startElement($prefix . 'latin');
+ $objWriter->writeAttribute('typeface', $element->getFont()->getName());
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // t
+ $objWriter->startElement($prefix . 't');
+ $objWriter->writeRawData(StringHelper::controlCharacterPHP2OOXML($element->getText()));
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+ }
+ }
+
+ /**
+ * Flip string table (for index searching).
+ *
+ * @param array $stringTable Stringtable
+ *
+ * @return array
+ */
+ public function flipStringTable(array $stringTable)
+ {
+ // Return value
+ $returnValue = [];
+
+ // Loop through stringtable and add flipped items to $returnValue
+ foreach ($stringTable as $key => $value) {
+ if (!$value instanceof RichText) {
+ $returnValue[$value] = $key;
+ } elseif ($value instanceof RichText) {
+ $returnValue[$value->getHashCode()] = $key;
+ }
+ }
+
+ return $returnValue;
+ }
+}
diff --git a/lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Style.php
similarity index 56%
rename from lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php
rename to lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Style.php
index d3f0af7b2fc..16e800e01f0 100644
--- a/lib/phpexcel/PHPExcel/Writer/Excel2007/Style.php
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Style.php
@@ -1,47 +1,37 @@
getParentWriter()->getUseDiskCaching()) {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
} else {
- $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
}
// XML header
@@ -112,11 +102,11 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
// cellXfs
$objWriter->startElement('cellXfs');
- $objWriter->writeAttribute('count', count($pPHPExcel->getCellXfCollection()));
+ $objWriter->writeAttribute('count', count($spreadsheet->getCellXfCollection()));
// xf
- foreach ($pPHPExcel->getCellXfCollection() as $cellXf) {
- $this->writeCellStyleXf($objWriter, $cellXf, $pPHPExcel);
+ foreach ($spreadsheet->getCellXfCollection() as $cellXf) {
+ $this->writeCellStyleXf($objWriter, $cellXf, $spreadsheet);
}
$objWriter->endElement();
@@ -158,17 +148,16 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Fill
+ * Write Fill.
*
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Style_Fill $pFill Fill style
- * @throws PHPExcel_Writer_Exception
+ * @param XMLWriter $objWriter XML Writer
+ * @param Fill $pFill Fill style
*/
- private function writeFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null)
+ private function writeFill(XMLWriter $objWriter, Fill $pFill)
{
// Check if this is a pattern type or gradient type
- if ($pFill->getFillType() === PHPExcel_Style_Fill::FILL_GRADIENT_LINEAR ||
- $pFill->getFillType() === PHPExcel_Style_Fill::FILL_GRADIENT_PATH) {
+ if ($pFill->getFillType() === Fill::FILL_GRADIENT_LINEAR ||
+ $pFill->getFillType() === Fill::FILL_GRADIENT_PATH) {
// Gradient fill
$this->writeGradientFill($objWriter, $pFill);
} elseif ($pFill->getFillType() !== null) {
@@ -178,13 +167,12 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Gradient Fill
+ * Write Gradient Fill.
*
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Style_Fill $pFill Fill style
- * @throws PHPExcel_Writer_Exception
+ * @param XMLWriter $objWriter XML Writer
+ * @param Fill $pFill Fill style
*/
- private function writeGradientFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null)
+ private function writeGradientFill(XMLWriter $objWriter, Fill $pFill)
{
// fill
$objWriter->startElement('fill');
@@ -222,13 +210,12 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Pattern Fill
+ * Write Pattern Fill.
*
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Style_Fill $pFill Fill style
- * @throws PHPExcel_Writer_Exception
+ * @param XMLWriter $objWriter XML Writer
+ * @param Fill $pFill Fill style
*/
- private function writePatternFill(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Fill $pFill = null)
+ private function writePatternFill(XMLWriter $objWriter, Fill $pFill)
{
// fill
$objWriter->startElement('fill');
@@ -237,7 +224,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->startElement('patternFill');
$objWriter->writeAttribute('patternType', $pFill->getFillType());
- if ($pFill->getFillType() !== PHPExcel_Style_Fill::FILL_NONE) {
+ if ($pFill->getFillType() !== Fill::FILL_NONE) {
// fgColor
if ($pFill->getStartColor()->getARGB()) {
$objWriter->startElement('fgColor');
@@ -245,7 +232,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
$objWriter->endElement();
}
}
- if ($pFill->getFillType() !== PHPExcel_Style_Fill::FILL_NONE) {
+ if ($pFill->getFillType() !== Fill::FILL_NONE) {
// bgColor
if ($pFill->getEndColor()->getARGB()) {
$objWriter->startElement('bgColor');
@@ -260,17 +247,16 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Font
+ * Write Font.
*
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Style_Font $pFont Font style
- * @throws PHPExcel_Writer_Exception
+ * @param XMLWriter $objWriter XML Writer
+ * @param Font $pFont Font style
*/
- private function writeFont(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Font $pFont = null)
+ private function writeFont(XMLWriter $objWriter, Font $pFont)
{
// font
$objWriter->startElement('font');
- // Weird! The order of these elements actually makes a difference when opening Excel2007
+ // Weird! The order of these elements actually makes a difference when opening Xlsx
// files in Excel2003 with the compatibility pack. It's not documented behaviour,
// and makes for a real WTF!
@@ -305,11 +291,11 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
}
// Superscript / subscript
- if ($pFont->getSuperScript() === true || $pFont->getSubScript() === true) {
+ if ($pFont->getSuperscript() === true || $pFont->getSubscript() === true) {
$objWriter->startElement('vertAlign');
- if ($pFont->getSuperScript() === true) {
+ if ($pFont->getSuperscript() === true) {
$objWriter->writeAttribute('val', 'superscript');
- } elseif ($pFont->getSubScript() === true) {
+ } elseif ($pFont->getSubscript() === true) {
$objWriter->writeAttribute('val', 'subscript');
}
$objWriter->endElement();
@@ -318,7 +304,7 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
// Size
if ($pFont->getSize() !== null) {
$objWriter->startElement('sz');
- $objWriter->writeAttribute('val', $pFont->getSize());
+ $objWriter->writeAttribute('val', StringHelper::formatNumber($pFont->getSize()));
$objWriter->endElement();
}
@@ -340,29 +326,31 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Border
+ * Write Border.
*
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Style_Borders $pBorders Borders style
- * @throws PHPExcel_Writer_Exception
+ * @param XMLWriter $objWriter XML Writer
+ * @param Borders $pBorders Borders style
*/
- private function writeBorder(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_Borders $pBorders = null)
+ private function writeBorder(XMLWriter $objWriter, Borders $pBorders)
{
// Write border
$objWriter->startElement('border');
// Diagonal?
switch ($pBorders->getDiagonalDirection()) {
- case PHPExcel_Style_Borders::DIAGONAL_UP:
+ case Borders::DIAGONAL_UP:
$objWriter->writeAttribute('diagonalUp', 'true');
$objWriter->writeAttribute('diagonalDown', 'false');
+
break;
- case PHPExcel_Style_Borders::DIAGONAL_DOWN:
+ case Borders::DIAGONAL_DOWN:
$objWriter->writeAttribute('diagonalUp', 'false');
$objWriter->writeAttribute('diagonalDown', 'true');
+
break;
- case PHPExcel_Style_Borders::DIAGONAL_BOTH:
+ case Borders::DIAGONAL_BOTH:
$objWriter->writeAttribute('diagonalUp', 'true');
$objWriter->writeAttribute('diagonalDown', 'true');
+
break;
}
@@ -376,39 +364,40 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Cell Style Xf
+ * Write Cell Style Xf.
*
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Style $pStyle Style
- * @param PHPExcel $pPHPExcel Workbook
- * @throws PHPExcel_Writer_Exception
+ * @param XMLWriter $objWriter XML Writer
+ * @param \PhpOffice\PhpSpreadsheet\Style\Style $pStyle Style
+ * @param Spreadsheet $spreadsheet Workbook
+ *
+ * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
- private function writeCellStyleXf(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style $pStyle = null, PHPExcel $pPHPExcel = null)
+ private function writeCellStyleXf(XMLWriter $objWriter, \PhpOffice\PhpSpreadsheet\Style\Style $pStyle, Spreadsheet $spreadsheet)
{
// xf
$objWriter->startElement('xf');
$objWriter->writeAttribute('xfId', 0);
- $objWriter->writeAttribute('fontId', (int)$this->getParentWriter()->getFontHashTable()->getIndexForHashCode($pStyle->getFont()->getHashCode()));
+ $objWriter->writeAttribute('fontId', (int) $this->getParentWriter()->getFontHashTable()->getIndexForHashCode($pStyle->getFont()->getHashCode()));
if ($pStyle->getQuotePrefix()) {
$objWriter->writeAttribute('quotePrefix', 1);
}
if ($pStyle->getNumberFormat()->getBuiltInFormatCode() === false) {
- $objWriter->writeAttribute('numFmtId', (int)($this->getParentWriter()->getNumFmtHashTable()->getIndexForHashCode($pStyle->getNumberFormat()->getHashCode()) + 164));
+ $objWriter->writeAttribute('numFmtId', (int) ($this->getParentWriter()->getNumFmtHashTable()->getIndexForHashCode($pStyle->getNumberFormat()->getHashCode()) + 164));
} else {
- $objWriter->writeAttribute('numFmtId', (int)$pStyle->getNumberFormat()->getBuiltInFormatCode());
+ $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()));
+ $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');
- if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
+ $objWriter->writeAttribute('applyFont', ($spreadsheet->getDefaultStyle()->getFont()->getHashCode() != $pStyle->getFont()->getHashCode()) ? '1' : '0');
+ $objWriter->writeAttribute('applyNumberFormat', ($spreadsheet->getDefaultStyle()->getNumberFormat()->getHashCode() != $pStyle->getNumberFormat()->getHashCode()) ? '1' : '0');
+ $objWriter->writeAttribute('applyFill', ($spreadsheet->getDefaultStyle()->getFill()->getHashCode() != $pStyle->getFill()->getHashCode()) ? '1' : '0');
+ $objWriter->writeAttribute('applyBorder', ($spreadsheet->getDefaultStyle()->getBorders()->getHashCode() != $pStyle->getBorders()->getHashCode()) ? '1' : '0');
+ $objWriter->writeAttribute('applyAlignment', ($spreadsheet->getDefaultStyle()->getAlignment()->getHashCode() != $pStyle->getAlignment()->getHashCode()) ? '1' : '0');
+ if ($pStyle->getProtection()->getLocked() != Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != Protection::PROTECTION_INHERIT) {
$objWriter->writeAttribute('applyProtection', 'true');
}
@@ -431,19 +420,19 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
if ($pStyle->getAlignment()->getIndent() > 0) {
$objWriter->writeAttribute('indent', $pStyle->getAlignment()->getIndent());
}
- if ($pStyle->getAlignment()->getReadorder() > 0) {
- $objWriter->writeAttribute('readingOrder', $pStyle->getAlignment()->getReadorder());
+ if ($pStyle->getAlignment()->getReadOrder() > 0) {
+ $objWriter->writeAttribute('readingOrder', $pStyle->getAlignment()->getReadOrder());
}
$objWriter->endElement();
// protection
- if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
+ if ($pStyle->getProtection()->getLocked() != Protection::PROTECTION_INHERIT || $pStyle->getProtection()->getHidden() != Protection::PROTECTION_INHERIT) {
$objWriter->startElement('protection');
- if ($pStyle->getProtection()->getLocked() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
- $objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
+ if ($pStyle->getProtection()->getLocked() != Protection::PROTECTION_INHERIT) {
+ $objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
}
- if ($pStyle->getProtection()->getHidden() != PHPExcel_Style_Protection::PROTECTION_INHERIT) {
- $objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == PHPExcel_Style_Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
+ if ($pStyle->getProtection()->getHidden() != Protection::PROTECTION_INHERIT) {
+ $objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
}
$objWriter->endElement();
}
@@ -452,13 +441,12 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write Cell Style Dxf
+ * Write Cell Style Dxf.
*
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Style $pStyle Style
- * @throws PHPExcel_Writer_Exception
+ * @param XMLWriter $objWriter XML Writer
+ * @param \PhpOffice\PhpSpreadsheet\Style\Style $pStyle Style
*/
- private function writeCellStyleDxf(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style $pStyle = null)
+ private function writeCellStyleDxf(XMLWriter $objWriter, \PhpOffice\PhpSpreadsheet\Style\Style $pStyle)
{
// dxf
$objWriter->startElement('dxf');
@@ -497,16 +485,16 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
// 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) {
+ if ($pStyle->getProtection()->getLocked() !== Protection::PROTECTION_INHERIT ||
+ $pStyle->getProtection()->getHidden() !== 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'));
+ ($pStyle->getProtection()->getLocked() !== Protection::PROTECTION_INHERIT)) {
+ $objWriter->writeAttribute('locked', ($pStyle->getProtection()->getLocked() == 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'));
+ ($pStyle->getProtection()->getHidden() !== Protection::PROTECTION_INHERIT)) {
+ $objWriter->writeAttribute('hidden', ($pStyle->getProtection()->getHidden() == Protection::PROTECTION_PROTECTED ? 'true' : 'false'));
}
$objWriter->endElement();
}
@@ -516,17 +504,16 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write BorderPr
+ * Write BorderPr.
*
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param string $pName Element name
- * @param PHPExcel_Style_Border $pBorder Border style
- * @throws PHPExcel_Writer_Exception
+ * @param XMLWriter $objWriter XML Writer
+ * @param string $pName Element name
+ * @param Border $pBorder Border style
*/
- private function writeBorderPr(PHPExcel_Shared_XMLWriter $objWriter = null, $pName = 'left', PHPExcel_Style_Border $pBorder = null)
+ private function writeBorderPr(XMLWriter $objWriter, $pName, Border $pBorder)
{
// Write BorderPr
- if ($pBorder->getBorderStyle() != PHPExcel_Style_Border::BORDER_NONE) {
+ if ($pBorder->getBorderStyle() != Border::BORDER_NONE) {
$objWriter->startElement($pName);
$objWriter->writeAttribute('style', $pBorder->getBorderStyle());
@@ -540,14 +527,13 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Write NumberFormat
+ * Write NumberFormat.
*
- * @param PHPExcel_Shared_XMLWriter $objWriter XML Writer
- * @param PHPExcel_Style_NumberFormat $pNumberFormat Number Format
- * @param int $pId Number Format identifier
- * @throws PHPExcel_Writer_Exception
+ * @param XMLWriter $objWriter XML Writer
+ * @param NumberFormat $pNumberFormat Number Format
+ * @param int $pId Number Format identifier
*/
- private function writeNumFmt(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Style_NumberFormat $pNumberFormat = null, $pId = 0)
+ private function writeNumFmt(XMLWriter $objWriter, NumberFormat $pNumberFormat, $pId = 0)
{
// Translate formatcode
$formatCode = $pNumberFormat->getFormatCode();
@@ -562,32 +548,32 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Get an array of all styles
+ * Get an array of all styles.
*
- * @param PHPExcel $pPHPExcel
- * @return PHPExcel_Style[] All styles in PHPExcel
- * @throws PHPExcel_Writer_Exception
+ * @param Spreadsheet $spreadsheet
+ *
+ * @return \PhpOffice\PhpSpreadsheet\Style\Style[] All styles in PhpSpreadsheet
*/
- public function allStyles(PHPExcel $pPHPExcel = null)
+ public function allStyles(Spreadsheet $spreadsheet)
{
- return $pPHPExcel->getCellXfCollection();
+ return $spreadsheet->getCellXfCollection();
}
/**
- * Get an array of all conditional styles
+ * Get an array of all conditional styles.
*
- * @param PHPExcel $pPHPExcel
- * @return PHPExcel_Style_Conditional[] All conditional styles in PHPExcel
- * @throws PHPExcel_Writer_Exception
+ * @param Spreadsheet $spreadsheet
+ *
+ * @return Conditional[] All conditional styles in PhpSpreadsheet
*/
- public function allConditionalStyles(PHPExcel $pPHPExcel = null)
+ public function allConditionalStyles(Spreadsheet $spreadsheet)
{
// Get an array of all styles
- $aStyles = array();
+ $aStyles = [];
- $sheetCount = $pPHPExcel->getSheetCount();
+ $sheetCount = $spreadsheet->getSheetCount();
for ($i = 0; $i < $sheetCount; ++$i) {
- foreach ($pPHPExcel->getSheet($i)->getConditionalStylesCollection() as $conditionalStyles) {
+ foreach ($spreadsheet->getSheet($i)->getConditionalStylesCollection() as $conditionalStyles) {
foreach ($conditionalStyles as $conditionalStyle) {
$aStyles[] = $conditionalStyle;
}
@@ -598,30 +584,31 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Get an array of all fills
+ * Get an array of all fills.
*
- * @param PHPExcel $pPHPExcel
- * @return PHPExcel_Style_Fill[] All fills in PHPExcel
- * @throws PHPExcel_Writer_Exception
+ * @param Spreadsheet $spreadsheet
+ *
+ * @return Fill[] All fills in PhpSpreadsheet
*/
- public function allFills(PHPExcel $pPHPExcel = null)
+ public function allFills(Spreadsheet $spreadsheet)
{
// Get an array of unique fills
- $aFills = array();
+ $aFills = [];
// Two first fills are predefined
- $fill0 = new PHPExcel_Style_Fill();
- $fill0->setFillType(PHPExcel_Style_Fill::FILL_NONE);
+ $fill0 = new Fill();
+ $fill0->setFillType(Fill::FILL_NONE);
$aFills[] = $fill0;
- $fill1 = new PHPExcel_Style_Fill();
- $fill1->setFillType(PHPExcel_Style_Fill::FILL_PATTERN_GRAY125);
+ $fill1 = new Fill();
+ $fill1->setFillType(Fill::FILL_PATTERN_GRAY125);
$aFills[] = $fill1;
// The remaining fills
- $aStyles = $this->allStyles($pPHPExcel);
+ $aStyles = $this->allStyles($spreadsheet);
+ /** @var \PhpOffice\PhpSpreadsheet\Style\Style $style */
foreach ($aStyles as $style) {
- if (!array_key_exists($style->getFill()->getHashCode(), $aFills)) {
- $aFills[ $style->getFill()->getHashCode() ] = $style->getFill();
+ if (!isset($aFills[$style->getFill()->getHashCode()])) {
+ $aFills[$style->getFill()->getHashCode()] = $style->getFill();
}
}
@@ -629,21 +616,22 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Get an array of all fonts
+ * Get an array of all fonts.
*
- * @param PHPExcel $pPHPExcel
- * @return PHPExcel_Style_Font[] All fonts in PHPExcel
- * @throws PHPExcel_Writer_Exception
+ * @param Spreadsheet $spreadsheet
+ *
+ * @return Font[] All fonts in PhpSpreadsheet
*/
- public function allFonts(PHPExcel $pPHPExcel = null)
+ public function allFonts(Spreadsheet $spreadsheet)
{
// Get an array of unique fonts
- $aFonts = array();
- $aStyles = $this->allStyles($pPHPExcel);
+ $aFonts = [];
+ $aStyles = $this->allStyles($spreadsheet);
+ /** @var \PhpOffice\PhpSpreadsheet\Style\Style $style */
foreach ($aStyles as $style) {
- if (!array_key_exists($style->getFont()->getHashCode(), $aFonts)) {
- $aFonts[ $style->getFont()->getHashCode() ] = $style->getFont();
+ if (!isset($aFonts[$style->getFont()->getHashCode()])) {
+ $aFonts[$style->getFont()->getHashCode()] = $style->getFont();
}
}
@@ -651,21 +639,22 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Get an array of all borders
+ * Get an array of all borders.
*
- * @param PHPExcel $pPHPExcel
- * @return PHPExcel_Style_Borders[] All borders in PHPExcel
- * @throws PHPExcel_Writer_Exception
+ * @param Spreadsheet $spreadsheet
+ *
+ * @return Borders[] All borders in PhpSpreadsheet
*/
- public function allBorders(PHPExcel $pPHPExcel = null)
+ public function allBorders(Spreadsheet $spreadsheet)
{
// Get an array of unique borders
- $aBorders = array();
- $aStyles = $this->allStyles($pPHPExcel);
+ $aBorders = [];
+ $aStyles = $this->allStyles($spreadsheet);
+ /** @var \PhpOffice\PhpSpreadsheet\Style\Style $style */
foreach ($aStyles as $style) {
- if (!array_key_exists($style->getBorders()->getHashCode(), $aBorders)) {
- $aBorders[ $style->getBorders()->getHashCode() ] = $style->getBorders();
+ if (!isset($aBorders[$style->getBorders()->getHashCode()])) {
+ $aBorders[$style->getBorders()->getHashCode()] = $style->getBorders();
}
}
@@ -673,21 +662,22 @@ class PHPExcel_Writer_Excel2007_Style extends PHPExcel_Writer_Excel2007_WriterPa
}
/**
- * Get an array of all number formats
+ * Get an array of all number formats.
*
- * @param PHPExcel $pPHPExcel
- * @return PHPExcel_Style_NumberFormat[] All number formats in PHPExcel
- * @throws PHPExcel_Writer_Exception
+ * @param Spreadsheet $spreadsheet
+ *
+ * @return NumberFormat[] All number formats in PhpSpreadsheet
*/
- public function allNumberFormats(PHPExcel $pPHPExcel = null)
+ public function allNumberFormats(Spreadsheet $spreadsheet)
{
// Get an array of unique number formats
- $aNumFmts = array();
- $aStyles = $this->allStyles($pPHPExcel);
+ $aNumFmts = [];
+ $aStyles = $this->allStyles($spreadsheet);
+ /** @var \PhpOffice\PhpSpreadsheet\Style\Style $style */
foreach ($aStyles as $style) {
- if ($style->getNumberFormat()->getBuiltInFormatCode() === false && !array_key_exists($style->getNumberFormat()->getHashCode(), $aNumFmts)) {
- $aNumFmts[ $style->getNumberFormat()->getHashCode() ] = $style->getNumberFormat();
+ if ($style->getNumberFormat()->getBuiltInFormatCode() === false && !isset($aNumFmts[$style->getNumberFormat()->getHashCode()])) {
+ $aNumFmts[$style->getNumberFormat()->getHashCode()] = $style->getNumberFormat();
}
}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Theme.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Theme.php
new file mode 100644
index 00000000000..f5f8dc0752d
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Theme.php
@@ -0,0 +1,846 @@
+ 'MS Pゴシック',
+ 'Hang' => '맑은 고딕',
+ 'Hans' => '宋体',
+ 'Hant' => '新細明體',
+ 'Arab' => 'Times New Roman',
+ 'Hebr' => 'Times New Roman',
+ 'Thai' => 'Tahoma',
+ 'Ethi' => 'Nyala',
+ 'Beng' => 'Vrinda',
+ 'Gujr' => 'Shruti',
+ 'Khmr' => 'MoolBoran',
+ 'Knda' => 'Tunga',
+ 'Guru' => 'Raavi',
+ 'Cans' => 'Euphemia',
+ 'Cher' => 'Plantagenet Cherokee',
+ 'Yiii' => 'Microsoft Yi Baiti',
+ 'Tibt' => 'Microsoft Himalaya',
+ 'Thaa' => 'MV Boli',
+ 'Deva' => 'Mangal',
+ 'Telu' => 'Gautami',
+ 'Taml' => 'Latha',
+ 'Syrc' => 'Estrangelo Edessa',
+ 'Orya' => 'Kalinga',
+ 'Mlym' => 'Kartika',
+ 'Laoo' => 'DokChampa',
+ 'Sinh' => 'Iskoola Pota',
+ 'Mong' => 'Mongolian Baiti',
+ 'Viet' => 'Times New Roman',
+ 'Uigh' => 'Microsoft Uighur',
+ 'Geor' => 'Sylfaen',
+ ];
+
+ /**
+ * Map of Minor fonts to write.
+ *
+ * @var array of string
+ */
+ private static $minorFonts = [
+ 'Jpan' => 'MS Pゴシック',
+ 'Hang' => '맑은 고딕',
+ 'Hans' => '宋体',
+ 'Hant' => '新細明體',
+ 'Arab' => 'Arial',
+ 'Hebr' => 'Arial',
+ 'Thai' => 'Tahoma',
+ 'Ethi' => 'Nyala',
+ 'Beng' => 'Vrinda',
+ 'Gujr' => 'Shruti',
+ 'Khmr' => 'DaunPenh',
+ 'Knda' => 'Tunga',
+ 'Guru' => 'Raavi',
+ 'Cans' => 'Euphemia',
+ 'Cher' => 'Plantagenet Cherokee',
+ 'Yiii' => 'Microsoft Yi Baiti',
+ 'Tibt' => 'Microsoft Himalaya',
+ 'Thaa' => 'MV Boli',
+ 'Deva' => 'Mangal',
+ 'Telu' => 'Gautami',
+ 'Taml' => 'Latha',
+ 'Syrc' => 'Estrangelo Edessa',
+ 'Orya' => 'Kalinga',
+ 'Mlym' => 'Kartika',
+ 'Laoo' => 'DokChampa',
+ 'Sinh' => 'Iskoola Pota',
+ 'Mong' => 'Mongolian Baiti',
+ 'Viet' => 'Arial',
+ 'Uigh' => 'Microsoft Uighur',
+ 'Geor' => 'Sylfaen',
+ ];
+
+ /**
+ * Map of core colours.
+ *
+ * @var array of string
+ */
+ private static $colourScheme = [
+ 'dk2' => '1F497D',
+ 'lt2' => 'EEECE1',
+ 'accent1' => '4F81BD',
+ 'accent2' => 'C0504D',
+ 'accent3' => '9BBB59',
+ 'accent4' => '8064A2',
+ 'accent5' => '4BACC6',
+ 'accent6' => 'F79646',
+ 'hlink' => '0000FF',
+ 'folHlink' => '800080',
+ ];
+
+ /**
+ * Write theme to XML format.
+ *
+ * @param Spreadsheet $spreadsheet
+ *
+ * @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
+ *
+ * @return string XML Output
+ */
+ public function writeTheme(Spreadsheet $spreadsheet)
+ {
+ // Create XML writer
+ $objWriter = null;
+ if ($this->getParentWriter()->getUseDiskCaching()) {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ } else {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
+ }
+
+ // XML header
+ $objWriter->startDocument('1.0', 'UTF-8', 'yes');
+
+ // a:theme
+ $objWriter->startElement('a:theme');
+ $objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main');
+ $objWriter->writeAttribute('name', 'Office Theme');
+
+ // a:themeElements
+ $objWriter->startElement('a:themeElements');
+
+ // a:clrScheme
+ $objWriter->startElement('a:clrScheme');
+ $objWriter->writeAttribute('name', 'Office');
+
+ // a:dk1
+ $objWriter->startElement('a:dk1');
+
+ // a:sysClr
+ $objWriter->startElement('a:sysClr');
+ $objWriter->writeAttribute('val', 'windowText');
+ $objWriter->writeAttribute('lastClr', '000000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:lt1
+ $objWriter->startElement('a:lt1');
+
+ // a:sysClr
+ $objWriter->startElement('a:sysClr');
+ $objWriter->writeAttribute('val', 'window');
+ $objWriter->writeAttribute('lastClr', 'FFFFFF');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:dk2
+ $this->writeColourScheme($objWriter);
+
+ $objWriter->endElement();
+
+ // a:fontScheme
+ $objWriter->startElement('a:fontScheme');
+ $objWriter->writeAttribute('name', 'Office');
+
+ // a:majorFont
+ $objWriter->startElement('a:majorFont');
+ $this->writeFonts($objWriter, 'Cambria', self::$majorFonts);
+ $objWriter->endElement();
+
+ // a:minorFont
+ $objWriter->startElement('a:minorFont');
+ $this->writeFonts($objWriter, 'Calibri', self::$minorFonts);
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:fmtScheme
+ $objWriter->startElement('a:fmtScheme');
+ $objWriter->writeAttribute('name', 'Office');
+
+ // a:fillStyleLst
+ $objWriter->startElement('a:fillStyleLst');
+
+ // a:solidFill
+ $objWriter->startElement('a:solidFill');
+
+ // a:schemeClr
+ $objWriter->startElement('a:schemeClr');
+ $objWriter->writeAttribute('val', 'phClr');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:gradFill
+ $objWriter->startElement('a:gradFill');
+ $objWriter->writeAttribute('rotWithShape', '1');
+
+ // a:gsLst
+ $objWriter->startElement('a:gsLst');
+
+ // a:gs
+ $objWriter->startElement('a:gs');
+ $objWriter->writeAttribute('pos', '0');
+
+ // a:schemeClr
+ $objWriter->startElement('a:schemeClr');
+ $objWriter->writeAttribute('val', 'phClr');
+
+ // a:tint
+ $objWriter->startElement('a:tint');
+ $objWriter->writeAttribute('val', '50000');
+ $objWriter->endElement();
+
+ // a:satMod
+ $objWriter->startElement('a:satMod');
+ $objWriter->writeAttribute('val', '300000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:gs
+ $objWriter->startElement('a:gs');
+ $objWriter->writeAttribute('pos', '35000');
+
+ // a:schemeClr
+ $objWriter->startElement('a:schemeClr');
+ $objWriter->writeAttribute('val', 'phClr');
+
+ // a:tint
+ $objWriter->startElement('a:tint');
+ $objWriter->writeAttribute('val', '37000');
+ $objWriter->endElement();
+
+ // a:satMod
+ $objWriter->startElement('a:satMod');
+ $objWriter->writeAttribute('val', '300000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:gs
+ $objWriter->startElement('a:gs');
+ $objWriter->writeAttribute('pos', '100000');
+
+ // a:schemeClr
+ $objWriter->startElement('a:schemeClr');
+ $objWriter->writeAttribute('val', 'phClr');
+
+ // a:tint
+ $objWriter->startElement('a:tint');
+ $objWriter->writeAttribute('val', '15000');
+ $objWriter->endElement();
+
+ // a:satMod
+ $objWriter->startElement('a:satMod');
+ $objWriter->writeAttribute('val', '350000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:lin
+ $objWriter->startElement('a:lin');
+ $objWriter->writeAttribute('ang', '16200000');
+ $objWriter->writeAttribute('scaled', '1');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:gradFill
+ $objWriter->startElement('a:gradFill');
+ $objWriter->writeAttribute('rotWithShape', '1');
+
+ // a:gsLst
+ $objWriter->startElement('a:gsLst');
+
+ // a:gs
+ $objWriter->startElement('a:gs');
+ $objWriter->writeAttribute('pos', '0');
+
+ // a:schemeClr
+ $objWriter->startElement('a:schemeClr');
+ $objWriter->writeAttribute('val', 'phClr');
+
+ // a:shade
+ $objWriter->startElement('a:shade');
+ $objWriter->writeAttribute('val', '51000');
+ $objWriter->endElement();
+
+ // a:satMod
+ $objWriter->startElement('a:satMod');
+ $objWriter->writeAttribute('val', '130000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:gs
+ $objWriter->startElement('a:gs');
+ $objWriter->writeAttribute('pos', '80000');
+
+ // a:schemeClr
+ $objWriter->startElement('a:schemeClr');
+ $objWriter->writeAttribute('val', 'phClr');
+
+ // a:shade
+ $objWriter->startElement('a:shade');
+ $objWriter->writeAttribute('val', '93000');
+ $objWriter->endElement();
+
+ // a:satMod
+ $objWriter->startElement('a:satMod');
+ $objWriter->writeAttribute('val', '130000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:gs
+ $objWriter->startElement('a:gs');
+ $objWriter->writeAttribute('pos', '100000');
+
+ // a:schemeClr
+ $objWriter->startElement('a:schemeClr');
+ $objWriter->writeAttribute('val', 'phClr');
+
+ // a:shade
+ $objWriter->startElement('a:shade');
+ $objWriter->writeAttribute('val', '94000');
+ $objWriter->endElement();
+
+ // a:satMod
+ $objWriter->startElement('a:satMod');
+ $objWriter->writeAttribute('val', '135000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:lin
+ $objWriter->startElement('a:lin');
+ $objWriter->writeAttribute('ang', '16200000');
+ $objWriter->writeAttribute('scaled', '0');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:lnStyleLst
+ $objWriter->startElement('a:lnStyleLst');
+
+ // a:ln
+ $objWriter->startElement('a:ln');
+ $objWriter->writeAttribute('w', '9525');
+ $objWriter->writeAttribute('cap', 'flat');
+ $objWriter->writeAttribute('cmpd', 'sng');
+ $objWriter->writeAttribute('algn', 'ctr');
+
+ // a:solidFill
+ $objWriter->startElement('a:solidFill');
+
+ // a:schemeClr
+ $objWriter->startElement('a:schemeClr');
+ $objWriter->writeAttribute('val', 'phClr');
+
+ // a:shade
+ $objWriter->startElement('a:shade');
+ $objWriter->writeAttribute('val', '95000');
+ $objWriter->endElement();
+
+ // a:satMod
+ $objWriter->startElement('a:satMod');
+ $objWriter->writeAttribute('val', '105000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:prstDash
+ $objWriter->startElement('a:prstDash');
+ $objWriter->writeAttribute('val', 'solid');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:ln
+ $objWriter->startElement('a:ln');
+ $objWriter->writeAttribute('w', '25400');
+ $objWriter->writeAttribute('cap', 'flat');
+ $objWriter->writeAttribute('cmpd', 'sng');
+ $objWriter->writeAttribute('algn', 'ctr');
+
+ // a:solidFill
+ $objWriter->startElement('a:solidFill');
+
+ // a:schemeClr
+ $objWriter->startElement('a:schemeClr');
+ $objWriter->writeAttribute('val', 'phClr');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:prstDash
+ $objWriter->startElement('a:prstDash');
+ $objWriter->writeAttribute('val', 'solid');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:ln
+ $objWriter->startElement('a:ln');
+ $objWriter->writeAttribute('w', '38100');
+ $objWriter->writeAttribute('cap', 'flat');
+ $objWriter->writeAttribute('cmpd', 'sng');
+ $objWriter->writeAttribute('algn', 'ctr');
+
+ // a:solidFill
+ $objWriter->startElement('a:solidFill');
+
+ // a:schemeClr
+ $objWriter->startElement('a:schemeClr');
+ $objWriter->writeAttribute('val', 'phClr');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:prstDash
+ $objWriter->startElement('a:prstDash');
+ $objWriter->writeAttribute('val', 'solid');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:effectStyleLst
+ $objWriter->startElement('a:effectStyleLst');
+
+ // a:effectStyle
+ $objWriter->startElement('a:effectStyle');
+
+ // a:effectLst
+ $objWriter->startElement('a:effectLst');
+
+ // a:outerShdw
+ $objWriter->startElement('a:outerShdw');
+ $objWriter->writeAttribute('blurRad', '40000');
+ $objWriter->writeAttribute('dist', '20000');
+ $objWriter->writeAttribute('dir', '5400000');
+ $objWriter->writeAttribute('rotWithShape', '0');
+
+ // a:srgbClr
+ $objWriter->startElement('a:srgbClr');
+ $objWriter->writeAttribute('val', '000000');
+
+ // a:alpha
+ $objWriter->startElement('a:alpha');
+ $objWriter->writeAttribute('val', '38000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:effectStyle
+ $objWriter->startElement('a:effectStyle');
+
+ // a:effectLst
+ $objWriter->startElement('a:effectLst');
+
+ // a:outerShdw
+ $objWriter->startElement('a:outerShdw');
+ $objWriter->writeAttribute('blurRad', '40000');
+ $objWriter->writeAttribute('dist', '23000');
+ $objWriter->writeAttribute('dir', '5400000');
+ $objWriter->writeAttribute('rotWithShape', '0');
+
+ // a:srgbClr
+ $objWriter->startElement('a:srgbClr');
+ $objWriter->writeAttribute('val', '000000');
+
+ // a:alpha
+ $objWriter->startElement('a:alpha');
+ $objWriter->writeAttribute('val', '35000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:effectStyle
+ $objWriter->startElement('a:effectStyle');
+
+ // a:effectLst
+ $objWriter->startElement('a:effectLst');
+
+ // a:outerShdw
+ $objWriter->startElement('a:outerShdw');
+ $objWriter->writeAttribute('blurRad', '40000');
+ $objWriter->writeAttribute('dist', '23000');
+ $objWriter->writeAttribute('dir', '5400000');
+ $objWriter->writeAttribute('rotWithShape', '0');
+
+ // a:srgbClr
+ $objWriter->startElement('a:srgbClr');
+ $objWriter->writeAttribute('val', '000000');
+
+ // a:alpha
+ $objWriter->startElement('a:alpha');
+ $objWriter->writeAttribute('val', '35000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:scene3d
+ $objWriter->startElement('a:scene3d');
+
+ // a:camera
+ $objWriter->startElement('a:camera');
+ $objWriter->writeAttribute('prst', 'orthographicFront');
+
+ // a:rot
+ $objWriter->startElement('a:rot');
+ $objWriter->writeAttribute('lat', '0');
+ $objWriter->writeAttribute('lon', '0');
+ $objWriter->writeAttribute('rev', '0');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:lightRig
+ $objWriter->startElement('a:lightRig');
+ $objWriter->writeAttribute('rig', 'threePt');
+ $objWriter->writeAttribute('dir', 't');
+
+ // a:rot
+ $objWriter->startElement('a:rot');
+ $objWriter->writeAttribute('lat', '0');
+ $objWriter->writeAttribute('lon', '0');
+ $objWriter->writeAttribute('rev', '1200000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:sp3d
+ $objWriter->startElement('a:sp3d');
+
+ // a:bevelT
+ $objWriter->startElement('a:bevelT');
+ $objWriter->writeAttribute('w', '63500');
+ $objWriter->writeAttribute('h', '25400');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:bgFillStyleLst
+ $objWriter->startElement('a:bgFillStyleLst');
+
+ // a:solidFill
+ $objWriter->startElement('a:solidFill');
+
+ // a:schemeClr
+ $objWriter->startElement('a:schemeClr');
+ $objWriter->writeAttribute('val', 'phClr');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:gradFill
+ $objWriter->startElement('a:gradFill');
+ $objWriter->writeAttribute('rotWithShape', '1');
+
+ // a:gsLst
+ $objWriter->startElement('a:gsLst');
+
+ // a:gs
+ $objWriter->startElement('a:gs');
+ $objWriter->writeAttribute('pos', '0');
+
+ // a:schemeClr
+ $objWriter->startElement('a:schemeClr');
+ $objWriter->writeAttribute('val', 'phClr');
+
+ // a:tint
+ $objWriter->startElement('a:tint');
+ $objWriter->writeAttribute('val', '40000');
+ $objWriter->endElement();
+
+ // a:satMod
+ $objWriter->startElement('a:satMod');
+ $objWriter->writeAttribute('val', '350000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:gs
+ $objWriter->startElement('a:gs');
+ $objWriter->writeAttribute('pos', '40000');
+
+ // a:schemeClr
+ $objWriter->startElement('a:schemeClr');
+ $objWriter->writeAttribute('val', 'phClr');
+
+ // a:tint
+ $objWriter->startElement('a:tint');
+ $objWriter->writeAttribute('val', '45000');
+ $objWriter->endElement();
+
+ // a:shade
+ $objWriter->startElement('a:shade');
+ $objWriter->writeAttribute('val', '99000');
+ $objWriter->endElement();
+
+ // a:satMod
+ $objWriter->startElement('a:satMod');
+ $objWriter->writeAttribute('val', '350000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:gs
+ $objWriter->startElement('a:gs');
+ $objWriter->writeAttribute('pos', '100000');
+
+ // a:schemeClr
+ $objWriter->startElement('a:schemeClr');
+ $objWriter->writeAttribute('val', 'phClr');
+
+ // a:shade
+ $objWriter->startElement('a:shade');
+ $objWriter->writeAttribute('val', '20000');
+ $objWriter->endElement();
+
+ // a:satMod
+ $objWriter->startElement('a:satMod');
+ $objWriter->writeAttribute('val', '255000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:path
+ $objWriter->startElement('a:path');
+ $objWriter->writeAttribute('path', 'circle');
+
+ // a:fillToRect
+ $objWriter->startElement('a:fillToRect');
+ $objWriter->writeAttribute('l', '50000');
+ $objWriter->writeAttribute('t', '-80000');
+ $objWriter->writeAttribute('r', '50000');
+ $objWriter->writeAttribute('b', '180000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:gradFill
+ $objWriter->startElement('a:gradFill');
+ $objWriter->writeAttribute('rotWithShape', '1');
+
+ // a:gsLst
+ $objWriter->startElement('a:gsLst');
+
+ // a:gs
+ $objWriter->startElement('a:gs');
+ $objWriter->writeAttribute('pos', '0');
+
+ // a:schemeClr
+ $objWriter->startElement('a:schemeClr');
+ $objWriter->writeAttribute('val', 'phClr');
+
+ // a:tint
+ $objWriter->startElement('a:tint');
+ $objWriter->writeAttribute('val', '80000');
+ $objWriter->endElement();
+
+ // a:satMod
+ $objWriter->startElement('a:satMod');
+ $objWriter->writeAttribute('val', '300000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:gs
+ $objWriter->startElement('a:gs');
+ $objWriter->writeAttribute('pos', '100000');
+
+ // a:schemeClr
+ $objWriter->startElement('a:schemeClr');
+ $objWriter->writeAttribute('val', 'phClr');
+
+ // a:shade
+ $objWriter->startElement('a:shade');
+ $objWriter->writeAttribute('val', '30000');
+ $objWriter->endElement();
+
+ // a:satMod
+ $objWriter->startElement('a:satMod');
+ $objWriter->writeAttribute('val', '200000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:path
+ $objWriter->startElement('a:path');
+ $objWriter->writeAttribute('path', 'circle');
+
+ // a:fillToRect
+ $objWriter->startElement('a:fillToRect');
+ $objWriter->writeAttribute('l', '50000');
+ $objWriter->writeAttribute('t', '50000');
+ $objWriter->writeAttribute('r', '50000');
+ $objWriter->writeAttribute('b', '50000');
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ // a:objectDefaults
+ $objWriter->writeElement('a:objectDefaults', null);
+
+ // a:extraClrSchemeLst
+ $objWriter->writeElement('a:extraClrSchemeLst', null);
+
+ $objWriter->endElement();
+
+ // Return
+ return $objWriter->getData();
+ }
+
+ /**
+ * Write fonts to XML format.
+ *
+ * @param XMLWriter $objWriter
+ * @param string $latinFont
+ * @param array of string $fontSet
+ *
+ * @return string XML Output
+ */
+ private function writeFonts($objWriter, $latinFont, $fontSet)
+ {
+ // a:latin
+ $objWriter->startElement('a:latin');
+ $objWriter->writeAttribute('typeface', $latinFont);
+ $objWriter->endElement();
+
+ // a:ea
+ $objWriter->startElement('a:ea');
+ $objWriter->writeAttribute('typeface', '');
+ $objWriter->endElement();
+
+ // a:cs
+ $objWriter->startElement('a:cs');
+ $objWriter->writeAttribute('typeface', '');
+ $objWriter->endElement();
+
+ foreach ($fontSet as $fontScript => $typeface) {
+ $objWriter->startElement('a:font');
+ $objWriter->writeAttribute('script', $fontScript);
+ $objWriter->writeAttribute('typeface', $typeface);
+ $objWriter->endElement();
+ }
+ }
+
+ /**
+ * Write colour scheme to XML format.
+ *
+ * @param XMLWriter $objWriter
+ *
+ * @return string XML Output
+ */
+ private function writeColourScheme($objWriter)
+ {
+ foreach (self::$colourScheme as $colourName => $colourValue) {
+ $objWriter->startElement('a:' . $colourName);
+
+ $objWriter->startElement('a:srgbClr');
+ $objWriter->writeAttribute('val', $colourValue);
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Workbook.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Workbook.php
new file mode 100644
index 00000000000..e3ddb03c143
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Workbook.php
@@ -0,0 +1,426 @@
+getParentWriter()->getUseDiskCaching()) {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ } else {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
+ }
+
+ // XML header
+ $objWriter->startDocument('1.0', 'UTF-8', 'yes');
+
+ // workbook
+ $objWriter->startElement('workbook');
+ $objWriter->writeAttribute('xml:space', 'preserve');
+ $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main');
+ $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
+
+ // fileVersion
+ $this->writeFileVersion($objWriter);
+
+ // workbookPr
+ $this->writeWorkbookPr($objWriter);
+
+ // workbookProtection
+ $this->writeWorkbookProtection($objWriter, $spreadsheet);
+
+ // bookViews
+ if ($this->getParentWriter()->getOffice2003Compatibility() === false) {
+ $this->writeBookViews($objWriter, $spreadsheet);
+ }
+
+ // sheets
+ $this->writeSheets($objWriter, $spreadsheet);
+
+ // definedNames
+ $this->writeDefinedNames($objWriter, $spreadsheet);
+
+ // calcPr
+ $this->writeCalcPr($objWriter, $recalcRequired);
+
+ $objWriter->endElement();
+
+ // Return
+ return $objWriter->getData();
+ }
+
+ /**
+ * Write file version.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ */
+ private function writeFileVersion(XMLWriter $objWriter)
+ {
+ $objWriter->startElement('fileVersion');
+ $objWriter->writeAttribute('appName', 'xl');
+ $objWriter->writeAttribute('lastEdited', '4');
+ $objWriter->writeAttribute('lowestEdited', '4');
+ $objWriter->writeAttribute('rupBuild', '4505');
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write WorkbookPr.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ */
+ private function writeWorkbookPr(XMLWriter $objWriter)
+ {
+ $objWriter->startElement('workbookPr');
+
+ if (Date::getExcelCalendar() == Date::CALENDAR_MAC_1904) {
+ $objWriter->writeAttribute('date1904', '1');
+ }
+
+ $objWriter->writeAttribute('codeName', 'ThisWorkbook');
+
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write BookViews.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param Spreadsheet $spreadsheet
+ */
+ private function writeBookViews(XMLWriter $objWriter, Spreadsheet $spreadsheet)
+ {
+ // bookViews
+ $objWriter->startElement('bookViews');
+
+ // workbookView
+ $objWriter->startElement('workbookView');
+
+ $objWriter->writeAttribute('activeTab', $spreadsheet->getActiveSheetIndex());
+ $objWriter->writeAttribute('autoFilterDateGrouping', ($spreadsheet->getAutoFilterDateGrouping() ? 'true' : 'false'));
+ $objWriter->writeAttribute('firstSheet', $spreadsheet->getFirstSheetIndex());
+ $objWriter->writeAttribute('minimized', ($spreadsheet->getMinimized() ? 'true' : 'false'));
+ $objWriter->writeAttribute('showHorizontalScroll', ($spreadsheet->getShowHorizontalScroll() ? 'true' : 'false'));
+ $objWriter->writeAttribute('showSheetTabs', ($spreadsheet->getShowSheetTabs() ? 'true' : 'false'));
+ $objWriter->writeAttribute('showVerticalScroll', ($spreadsheet->getShowVerticalScroll() ? 'true' : 'false'));
+ $objWriter->writeAttribute('tabRatio', $spreadsheet->getTabRatio());
+ $objWriter->writeAttribute('visibility', $spreadsheet->getVisibility());
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write WorkbookProtection.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param Spreadsheet $spreadsheet
+ */
+ private function writeWorkbookProtection(XMLWriter $objWriter, Spreadsheet $spreadsheet)
+ {
+ if ($spreadsheet->getSecurity()->isSecurityEnabled()) {
+ $objWriter->startElement('workbookProtection');
+ $objWriter->writeAttribute('lockRevision', ($spreadsheet->getSecurity()->getLockRevision() ? 'true' : 'false'));
+ $objWriter->writeAttribute('lockStructure', ($spreadsheet->getSecurity()->getLockStructure() ? 'true' : 'false'));
+ $objWriter->writeAttribute('lockWindows', ($spreadsheet->getSecurity()->getLockWindows() ? 'true' : 'false'));
+
+ if ($spreadsheet->getSecurity()->getRevisionsPassword() != '') {
+ $objWriter->writeAttribute('revisionsPassword', $spreadsheet->getSecurity()->getRevisionsPassword());
+ }
+
+ if ($spreadsheet->getSecurity()->getWorkbookPassword() != '') {
+ $objWriter->writeAttribute('workbookPassword', $spreadsheet->getSecurity()->getWorkbookPassword());
+ }
+
+ $objWriter->endElement();
+ }
+ }
+
+ /**
+ * Write calcPr.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param bool $recalcRequired Indicate whether formulas should be recalculated before writing
+ */
+ private function writeCalcPr(XMLWriter $objWriter, $recalcRequired = true)
+ {
+ $objWriter->startElement('calcPr');
+
+ // Set the calcid to a higher value than Excel itself will use, otherwise Excel will always recalc
+ // If MS Excel does do a recalc, then users opening a file in MS Excel will be prompted to save on exit
+ // because the file has changed
+ $objWriter->writeAttribute('calcId', '999999');
+ $objWriter->writeAttribute('calcMode', 'auto');
+ // fullCalcOnLoad isn't needed if we've recalculating for the save
+ $objWriter->writeAttribute('calcCompleted', ($recalcRequired) ? 1 : 0);
+ $objWriter->writeAttribute('fullCalcOnLoad', ($recalcRequired) ? 0 : 1);
+ $objWriter->writeAttribute('forceFullCalc', ($recalcRequired) ? 0 : 1);
+
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write sheets.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param Spreadsheet $spreadsheet
+ *
+ * @throws WriterException
+ */
+ private function writeSheets(XMLWriter $objWriter, Spreadsheet $spreadsheet)
+ {
+ // Write sheets
+ $objWriter->startElement('sheets');
+ $sheetCount = $spreadsheet->getSheetCount();
+ for ($i = 0; $i < $sheetCount; ++$i) {
+ // sheet
+ $this->writeSheet(
+ $objWriter,
+ $spreadsheet->getSheet($i)->getTitle(),
+ ($i + 1),
+ ($i + 1 + 3),
+ $spreadsheet->getSheet($i)->getSheetState()
+ );
+ }
+
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write sheet.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param string $pSheetname Sheet name
+ * @param int $pSheetId Sheet id
+ * @param int $pRelId Relationship ID
+ * @param string $sheetState Sheet state (visible, hidden, veryHidden)
+ *
+ * @throws WriterException
+ */
+ private function writeSheet(XMLWriter $objWriter, $pSheetname, $pSheetId = 1, $pRelId = 1, $sheetState = 'visible')
+ {
+ if ($pSheetname != '') {
+ // Write sheet
+ $objWriter->startElement('sheet');
+ $objWriter->writeAttribute('name', $pSheetname);
+ $objWriter->writeAttribute('sheetId', $pSheetId);
+ if ($sheetState != 'visible' && $sheetState != '') {
+ $objWriter->writeAttribute('state', $sheetState);
+ }
+ $objWriter->writeAttribute('r:id', 'rId' . $pRelId);
+ $objWriter->endElement();
+ } else {
+ throw new WriterException('Invalid parameters passed.');
+ }
+ }
+
+ /**
+ * Write Defined Names.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param Spreadsheet $spreadsheet
+ *
+ * @throws WriterException
+ */
+ private function writeDefinedNames(XMLWriter $objWriter, Spreadsheet $spreadsheet)
+ {
+ // Write defined names
+ $objWriter->startElement('definedNames');
+
+ // Named ranges
+ if (count($spreadsheet->getNamedRanges()) > 0) {
+ // Named ranges
+ $this->writeNamedRanges($objWriter, $spreadsheet);
+ }
+
+ // Other defined names
+ $sheetCount = $spreadsheet->getSheetCount();
+ for ($i = 0; $i < $sheetCount; ++$i) {
+ // definedName for autoFilter
+ $this->writeDefinedNameForAutofilter($objWriter, $spreadsheet->getSheet($i), $i);
+
+ // definedName for Print_Titles
+ $this->writeDefinedNameForPrintTitles($objWriter, $spreadsheet->getSheet($i), $i);
+
+ // definedName for Print_Area
+ $this->writeDefinedNameForPrintArea($objWriter, $spreadsheet->getSheet($i), $i);
+ }
+
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write named ranges.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param Spreadsheet $spreadsheet
+ *
+ * @throws WriterException
+ */
+ private function writeNamedRanges(XMLWriter $objWriter, Spreadsheet $spreadsheet)
+ {
+ // Loop named ranges
+ $namedRanges = $spreadsheet->getNamedRanges();
+ foreach ($namedRanges as $namedRange) {
+ $this->writeDefinedNameForNamedRange($objWriter, $namedRange);
+ }
+ }
+
+ /**
+ * Write Defined Name for named range.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param NamedRange $pNamedRange
+ */
+ private function writeDefinedNameForNamedRange(XMLWriter $objWriter, NamedRange $pNamedRange)
+ {
+ // definedName for named range
+ $objWriter->startElement('definedName');
+ $objWriter->writeAttribute('name', $pNamedRange->getName());
+ if ($pNamedRange->getLocalOnly()) {
+ $objWriter->writeAttribute('localSheetId', $pNamedRange->getScope()->getParent()->getIndex($pNamedRange->getScope()));
+ }
+
+ // Create absolute coordinate and write as raw text
+ $range = Coordinate::splitRange($pNamedRange->getRange());
+ $iMax = count($range);
+ for ($i = 0; $i < $iMax; ++$i) {
+ $range[$i][0] = '\'' . str_replace("'", "''", $pNamedRange->getWorksheet()->getTitle()) . '\'!' . Coordinate::absoluteReference($range[$i][0]);
+ if (isset($range[$i][1])) {
+ $range[$i][1] = Coordinate::absoluteReference($range[$i][1]);
+ }
+ }
+ $range = Coordinate::buildRange($range);
+
+ $objWriter->writeRawData($range);
+
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write Defined Name for autoFilter.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param Worksheet $pSheet
+ * @param int $pSheetId
+ */
+ private function writeDefinedNameForAutofilter(XMLWriter $objWriter, Worksheet $pSheet, $pSheetId = 0)
+ {
+ // definedName for autoFilter
+ $autoFilterRange = $pSheet->getAutoFilter()->getRange();
+ if (!empty($autoFilterRange)) {
+ $objWriter->startElement('definedName');
+ $objWriter->writeAttribute('name', '_xlnm._FilterDatabase');
+ $objWriter->writeAttribute('localSheetId', $pSheetId);
+ $objWriter->writeAttribute('hidden', '1');
+
+ // Create absolute coordinate and write as raw text
+ $range = Coordinate::splitRange($autoFilterRange);
+ $range = $range[0];
+ // Strip any worksheet ref so we can make the cell ref absolute
+ list($ws, $range[0]) = Worksheet::extractSheetTitle($range[0], true);
+
+ $range[0] = Coordinate::absoluteCoordinate($range[0]);
+ $range[1] = Coordinate::absoluteCoordinate($range[1]);
+ $range = implode(':', $range);
+
+ $objWriter->writeRawData('\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . $range);
+
+ $objWriter->endElement();
+ }
+ }
+
+ /**
+ * Write Defined Name for PrintTitles.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param Worksheet $pSheet
+ * @param int $pSheetId
+ */
+ private function writeDefinedNameForPrintTitles(XMLWriter $objWriter, Worksheet $pSheet, $pSheetId = 0)
+ {
+ // definedName for PrintTitles
+ if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet() || $pSheet->getPageSetup()->isRowsToRepeatAtTopSet()) {
+ $objWriter->startElement('definedName');
+ $objWriter->writeAttribute('name', '_xlnm.Print_Titles');
+ $objWriter->writeAttribute('localSheetId', $pSheetId);
+
+ // Setting string
+ $settingString = '';
+
+ // Columns to repeat
+ if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet()) {
+ $repeat = $pSheet->getPageSetup()->getColumnsToRepeatAtLeft();
+
+ $settingString .= '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!$' . $repeat[0] . ':$' . $repeat[1];
+ }
+
+ // Rows to repeat
+ if ($pSheet->getPageSetup()->isRowsToRepeatAtTopSet()) {
+ if ($pSheet->getPageSetup()->isColumnsToRepeatAtLeftSet()) {
+ $settingString .= ',';
+ }
+
+ $repeat = $pSheet->getPageSetup()->getRowsToRepeatAtTop();
+
+ $settingString .= '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!$' . $repeat[0] . ':$' . $repeat[1];
+ }
+
+ $objWriter->writeRawData($settingString);
+
+ $objWriter->endElement();
+ }
+ }
+
+ /**
+ * Write Defined Name for PrintTitles.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param Worksheet $pSheet
+ * @param int $pSheetId
+ */
+ private function writeDefinedNameForPrintArea(XMLWriter $objWriter, Worksheet $pSheet, $pSheetId = 0)
+ {
+ // definedName for PrintArea
+ if ($pSheet->getPageSetup()->isPrintAreaSet()) {
+ $objWriter->startElement('definedName');
+ $objWriter->writeAttribute('name', '_xlnm.Print_Area');
+ $objWriter->writeAttribute('localSheetId', $pSheetId);
+
+ // Print area
+ $printArea = Coordinate::splitRange($pSheet->getPageSetup()->getPrintArea());
+
+ $chunks = [];
+ foreach ($printArea as $printAreaRect) {
+ $printAreaRect[0] = Coordinate::absoluteReference($printAreaRect[0]);
+ $printAreaRect[1] = Coordinate::absoluteReference($printAreaRect[1]);
+ $chunks[] = '\'' . str_replace("'", "''", $pSheet->getTitle()) . '\'!' . implode(':', $printAreaRect);
+ }
+
+ $objWriter->writeRawData(implode(',', $chunks));
+
+ $objWriter->endElement();
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php
new file mode 100644
index 00000000000..7f48a6c15ca
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php
@@ -0,0 +1,1228 @@
+getParentWriter()->getUseDiskCaching()) {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
+ } else {
+ $objWriter = new XMLWriter(XMLWriter::STORAGE_MEMORY);
+ }
+
+ // XML header
+ $objWriter->startDocument('1.0', 'UTF-8', 'yes');
+
+ // Worksheet
+ $objWriter->startElement('worksheet');
+ $objWriter->writeAttribute('xml:space', 'preserve');
+ $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/spreadsheetml/2006/main');
+ $objWriter->writeAttribute('xmlns:r', 'http://schemas.openxmlformats.org/officeDocument/2006/relationships');
+
+ $objWriter->writeAttribute('xmlns:xdr', 'http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing');
+ $objWriter->writeAttribute('xmlns:x14', 'http://schemas.microsoft.com/office/spreadsheetml/2009/9/main');
+ $objWriter->writeAttribute('xmlns:mc', 'http://schemas.openxmlformats.org/markup-compatibility/2006');
+ $objWriter->writeAttribute('mc:Ignorable', 'x14ac');
+ $objWriter->writeAttribute('xmlns:x14ac', 'http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac');
+
+ // sheetPr
+ $this->writeSheetPr($objWriter, $pSheet);
+
+ // Dimension
+ $this->writeDimension($objWriter, $pSheet);
+
+ // sheetViews
+ $this->writeSheetViews($objWriter, $pSheet);
+
+ // sheetFormatPr
+ $this->writeSheetFormatPr($objWriter, $pSheet);
+
+ // cols
+ $this->writeCols($objWriter, $pSheet);
+
+ // sheetData
+ $this->writeSheetData($objWriter, $pSheet, $pStringTable);
+
+ // sheetProtection
+ $this->writeSheetProtection($objWriter, $pSheet);
+
+ // protectedRanges
+ $this->writeProtectedRanges($objWriter, $pSheet);
+
+ // autoFilter
+ $this->writeAutoFilter($objWriter, $pSheet);
+
+ // mergeCells
+ $this->writeMergeCells($objWriter, $pSheet);
+
+ // conditionalFormatting
+ $this->writeConditionalFormatting($objWriter, $pSheet);
+
+ // dataValidations
+ $this->writeDataValidations($objWriter, $pSheet);
+
+ // hyperlinks
+ $this->writeHyperlinks($objWriter, $pSheet);
+
+ // Print options
+ $this->writePrintOptions($objWriter, $pSheet);
+
+ // Page margins
+ $this->writePageMargins($objWriter, $pSheet);
+
+ // Page setup
+ $this->writePageSetup($objWriter, $pSheet);
+
+ // Header / footer
+ $this->writeHeaderFooter($objWriter, $pSheet);
+
+ // Breaks
+ $this->writeBreaks($objWriter, $pSheet);
+
+ // Drawings and/or Charts
+ $this->writeDrawings($objWriter, $pSheet, $includeCharts);
+
+ // LegacyDrawing
+ $this->writeLegacyDrawing($objWriter, $pSheet);
+
+ // LegacyDrawingHF
+ $this->writeLegacyDrawingHF($objWriter, $pSheet);
+
+ // AlternateContent
+ $this->writeAlternateContent($objWriter, $pSheet);
+
+ $objWriter->endElement();
+
+ // Return
+ return $objWriter->getData();
+ }
+
+ /**
+ * Write SheetPr.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ */
+ private function writeSheetPr(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ // sheetPr
+ $objWriter->startElement('sheetPr');
+ if ($pSheet->getParent()->hasMacros()) {
+ //if the workbook have macros, we need to have codeName for the sheet
+ if ($pSheet->hasCodeName() == false) {
+ $pSheet->setCodeName($pSheet->getTitle());
+ }
+ $objWriter->writeAttribute('codeName', $pSheet->getCodeName());
+ }
+ $autoFilterRange = $pSheet->getAutoFilter()->getRange();
+ if (!empty($autoFilterRange)) {
+ $objWriter->writeAttribute('filterMode', 1);
+ $pSheet->getAutoFilter()->showHideRows();
+ }
+
+ // tabColor
+ if ($pSheet->isTabColorSet()) {
+ $objWriter->startElement('tabColor');
+ $objWriter->writeAttribute('rgb', $pSheet->getTabColor()->getARGB());
+ $objWriter->endElement();
+ }
+
+ // outlinePr
+ $objWriter->startElement('outlinePr');
+ $objWriter->writeAttribute('summaryBelow', ($pSheet->getShowSummaryBelow() ? '1' : '0'));
+ $objWriter->writeAttribute('summaryRight', ($pSheet->getShowSummaryRight() ? '1' : '0'));
+ $objWriter->endElement();
+
+ // pageSetUpPr
+ if ($pSheet->getPageSetup()->getFitToPage()) {
+ $objWriter->startElement('pageSetUpPr');
+ $objWriter->writeAttribute('fitToPage', '1');
+ $objWriter->endElement();
+ }
+
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write Dimension.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ */
+ private function writeDimension(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ // dimension
+ $objWriter->startElement('dimension');
+ $objWriter->writeAttribute('ref', $pSheet->calculateWorksheetDimension());
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write SheetViews.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ *
+ * @throws WriterException
+ */
+ private function writeSheetViews(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ // sheetViews
+ $objWriter->startElement('sheetViews');
+
+ // Sheet selected?
+ $sheetSelected = false;
+ if ($this->getParentWriter()->getSpreadsheet()->getIndex($pSheet) == $this->getParentWriter()->getSpreadsheet()->getActiveSheetIndex()) {
+ $sheetSelected = true;
+ }
+
+ // sheetView
+ $objWriter->startElement('sheetView');
+ $objWriter->writeAttribute('tabSelected', $sheetSelected ? '1' : '0');
+ $objWriter->writeAttribute('workbookViewId', '0');
+
+ // Zoom scales
+ if ($pSheet->getSheetView()->getZoomScale() != 100) {
+ $objWriter->writeAttribute('zoomScale', $pSheet->getSheetView()->getZoomScale());
+ }
+ if ($pSheet->getSheetView()->getZoomScaleNormal() != 100) {
+ $objWriter->writeAttribute('zoomScaleNormal', $pSheet->getSheetView()->getZoomScaleNormal());
+ }
+
+ // View Layout Type
+ if ($pSheet->getSheetView()->getView() !== SheetView::SHEETVIEW_NORMAL) {
+ $objWriter->writeAttribute('view', $pSheet->getSheetView()->getView());
+ }
+
+ // Gridlines
+ if ($pSheet->getShowGridlines()) {
+ $objWriter->writeAttribute('showGridLines', 'true');
+ } else {
+ $objWriter->writeAttribute('showGridLines', 'false');
+ }
+
+ // Row and column headers
+ if ($pSheet->getShowRowColHeaders()) {
+ $objWriter->writeAttribute('showRowColHeaders', '1');
+ } else {
+ $objWriter->writeAttribute('showRowColHeaders', '0');
+ }
+
+ // Right-to-left
+ if ($pSheet->getRightToLeft()) {
+ $objWriter->writeAttribute('rightToLeft', 'true');
+ }
+
+ $activeCell = $pSheet->getActiveCell();
+ $sqref = $pSheet->getSelectedCells();
+
+ // Pane
+ $pane = '';
+ if ($pSheet->getFreezePane()) {
+ list($xSplit, $ySplit) = Coordinate::coordinateFromString($pSheet->getFreezePane());
+ $xSplit = Coordinate::columnIndexFromString($xSplit);
+ --$xSplit;
+ --$ySplit;
+
+ $topLeftCell = $pSheet->getTopLeftCell();
+ $activeCell = $topLeftCell;
+ $sqref = $topLeftCell;
+
+ // pane
+ $pane = 'topRight';
+ $objWriter->startElement('pane');
+ if ($xSplit > 0) {
+ $objWriter->writeAttribute('xSplit', $xSplit);
+ }
+ if ($ySplit > 0) {
+ $objWriter->writeAttribute('ySplit', $ySplit);
+ $pane = ($xSplit > 0) ? 'bottomRight' : 'bottomLeft';
+ }
+ $objWriter->writeAttribute('topLeftCell', $topLeftCell);
+ $objWriter->writeAttribute('activePane', $pane);
+ $objWriter->writeAttribute('state', 'frozen');
+ $objWriter->endElement();
+
+ if (($xSplit > 0) && ($ySplit > 0)) {
+ // Write additional selections if more than two panes (ie both an X and a Y split)
+ $objWriter->startElement('selection');
+ $objWriter->writeAttribute('pane', 'topRight');
+ $objWriter->endElement();
+ $objWriter->startElement('selection');
+ $objWriter->writeAttribute('pane', 'bottomLeft');
+ $objWriter->endElement();
+ }
+ }
+
+ // Selection
+ // Only need to write selection element if we have a split pane
+ // We cheat a little by over-riding the active cell selection, setting it to the split cell
+ $objWriter->startElement('selection');
+ if ($pane != '') {
+ $objWriter->writeAttribute('pane', $pane);
+ }
+ $objWriter->writeAttribute('activeCell', $activeCell);
+ $objWriter->writeAttribute('sqref', $sqref);
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write SheetFormatPr.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ */
+ private function writeSheetFormatPr(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ // sheetFormatPr
+ $objWriter->startElement('sheetFormatPr');
+
+ // Default row height
+ if ($pSheet->getDefaultRowDimension()->getRowHeight() >= 0) {
+ $objWriter->writeAttribute('customHeight', 'true');
+ $objWriter->writeAttribute('defaultRowHeight', StringHelper::formatNumber($pSheet->getDefaultRowDimension()->getRowHeight()));
+ } else {
+ $objWriter->writeAttribute('defaultRowHeight', '14.4');
+ }
+
+ // Set Zero Height row
+ if ((string) $pSheet->getDefaultRowDimension()->getZeroHeight() == '1' ||
+ strtolower((string) $pSheet->getDefaultRowDimension()->getZeroHeight()) == 'true') {
+ $objWriter->writeAttribute('zeroHeight', '1');
+ }
+
+ // Default column width
+ if ($pSheet->getDefaultColumnDimension()->getWidth() >= 0) {
+ $objWriter->writeAttribute('defaultColWidth', StringHelper::formatNumber($pSheet->getDefaultColumnDimension()->getWidth()));
+ }
+
+ // Outline level - row
+ $outlineLevelRow = 0;
+ foreach ($pSheet->getRowDimensions() as $dimension) {
+ if ($dimension->getOutlineLevel() > $outlineLevelRow) {
+ $outlineLevelRow = $dimension->getOutlineLevel();
+ }
+ }
+ $objWriter->writeAttribute('outlineLevelRow', (int) $outlineLevelRow);
+
+ // Outline level - column
+ $outlineLevelCol = 0;
+ foreach ($pSheet->getColumnDimensions() as $dimension) {
+ if ($dimension->getOutlineLevel() > $outlineLevelCol) {
+ $outlineLevelCol = $dimension->getOutlineLevel();
+ }
+ }
+ $objWriter->writeAttribute('outlineLevelCol', (int) $outlineLevelCol);
+
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write Cols.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ */
+ private function writeCols(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ // cols
+ if (count($pSheet->getColumnDimensions()) > 0) {
+ $objWriter->startElement('cols');
+
+ $pSheet->calculateColumnWidths();
+
+ // Loop through column dimensions
+ foreach ($pSheet->getColumnDimensions() as $colDimension) {
+ // col
+ $objWriter->startElement('col');
+ $objWriter->writeAttribute('min', Coordinate::columnIndexFromString($colDimension->getColumnIndex()));
+ $objWriter->writeAttribute('max', Coordinate::columnIndexFromString($colDimension->getColumnIndex()));
+
+ if ($colDimension->getWidth() < 0) {
+ // No width set, apply default of 10
+ $objWriter->writeAttribute('width', '9.10');
+ } else {
+ // Width set
+ $objWriter->writeAttribute('width', StringHelper::formatNumber($colDimension->getWidth()));
+ }
+
+ // Column visibility
+ if ($colDimension->getVisible() == false) {
+ $objWriter->writeAttribute('hidden', 'true');
+ }
+
+ // Auto size?
+ if ($colDimension->getAutoSize()) {
+ $objWriter->writeAttribute('bestFit', 'true');
+ }
+
+ // Custom width?
+ if ($colDimension->getWidth() != $pSheet->getDefaultColumnDimension()->getWidth()) {
+ $objWriter->writeAttribute('customWidth', 'true');
+ }
+
+ // Collapsed
+ if ($colDimension->getCollapsed() == true) {
+ $objWriter->writeAttribute('collapsed', 'true');
+ }
+
+ // Outline level
+ if ($colDimension->getOutlineLevel() > 0) {
+ $objWriter->writeAttribute('outlineLevel', $colDimension->getOutlineLevel());
+ }
+
+ // Style
+ $objWriter->writeAttribute('style', $colDimension->getXfIndex());
+
+ $objWriter->endElement();
+ }
+
+ $objWriter->endElement();
+ }
+ }
+
+ /**
+ * Write SheetProtection.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ */
+ private function writeSheetProtection(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ // sheetProtection
+ $objWriter->startElement('sheetProtection');
+
+ if ($pSheet->getProtection()->getPassword() != '') {
+ $objWriter->writeAttribute('password', $pSheet->getProtection()->getPassword());
+ }
+
+ $objWriter->writeAttribute('sheet', ($pSheet->getProtection()->getSheet() ? 'true' : 'false'));
+ $objWriter->writeAttribute('objects', ($pSheet->getProtection()->getObjects() ? 'true' : 'false'));
+ $objWriter->writeAttribute('scenarios', ($pSheet->getProtection()->getScenarios() ? 'true' : 'false'));
+ $objWriter->writeAttribute('formatCells', ($pSheet->getProtection()->getFormatCells() ? 'true' : 'false'));
+ $objWriter->writeAttribute('formatColumns', ($pSheet->getProtection()->getFormatColumns() ? 'true' : 'false'));
+ $objWriter->writeAttribute('formatRows', ($pSheet->getProtection()->getFormatRows() ? 'true' : 'false'));
+ $objWriter->writeAttribute('insertColumns', ($pSheet->getProtection()->getInsertColumns() ? 'true' : 'false'));
+ $objWriter->writeAttribute('insertRows', ($pSheet->getProtection()->getInsertRows() ? 'true' : 'false'));
+ $objWriter->writeAttribute('insertHyperlinks', ($pSheet->getProtection()->getInsertHyperlinks() ? 'true' : 'false'));
+ $objWriter->writeAttribute('deleteColumns', ($pSheet->getProtection()->getDeleteColumns() ? 'true' : 'false'));
+ $objWriter->writeAttribute('deleteRows', ($pSheet->getProtection()->getDeleteRows() ? 'true' : 'false'));
+ $objWriter->writeAttribute('selectLockedCells', ($pSheet->getProtection()->getSelectLockedCells() ? 'true' : 'false'));
+ $objWriter->writeAttribute('sort', ($pSheet->getProtection()->getSort() ? 'true' : 'false'));
+ $objWriter->writeAttribute('autoFilter', ($pSheet->getProtection()->getAutoFilter() ? 'true' : 'false'));
+ $objWriter->writeAttribute('pivotTables', ($pSheet->getProtection()->getPivotTables() ? 'true' : 'false'));
+ $objWriter->writeAttribute('selectUnlockedCells', ($pSheet->getProtection()->getSelectUnlockedCells() ? 'true' : 'false'));
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write ConditionalFormatting.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ *
+ * @throws WriterException
+ */
+ private function writeConditionalFormatting(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ // Conditional id
+ $id = 1;
+
+ // Loop through styles in the current worksheet
+ foreach ($pSheet->getConditionalStylesCollection() as $cellCoordinate => $conditionalStyles) {
+ foreach ($conditionalStyles as $conditional) {
+ // WHY was this again?
+ // if ($this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode($conditional->getHashCode()) == '') {
+ // continue;
+ // }
+ if ($conditional->getConditionType() != Conditional::CONDITION_NONE) {
+ // conditionalFormatting
+ $objWriter->startElement('conditionalFormatting');
+ $objWriter->writeAttribute('sqref', $cellCoordinate);
+
+ // cfRule
+ $objWriter->startElement('cfRule');
+ $objWriter->writeAttribute('type', $conditional->getConditionType());
+ $objWriter->writeAttribute('dxfId', $this->getParentWriter()->getStylesConditionalHashTable()->getIndexForHashCode($conditional->getHashCode()));
+ $objWriter->writeAttribute('priority', $id++);
+
+ if (($conditional->getConditionType() == Conditional::CONDITION_CELLIS || $conditional->getConditionType() == Conditional::CONDITION_CONTAINSTEXT)
+ && $conditional->getOperatorType() != Conditional::OPERATOR_NONE) {
+ $objWriter->writeAttribute('operator', $conditional->getOperatorType());
+ }
+
+ if ($conditional->getConditionType() == Conditional::CONDITION_CONTAINSTEXT
+ && $conditional->getText() !== null) {
+ $objWriter->writeAttribute('text', $conditional->getText());
+ }
+
+ if ($conditional->getStopIfTrue()) {
+ $objWriter->writeAttribute('stopIfTrue', '1');
+ }
+
+ if ($conditional->getConditionType() == Conditional::CONDITION_CONTAINSTEXT
+ && $conditional->getOperatorType() == Conditional::OPERATOR_CONTAINSTEXT
+ && $conditional->getText() !== null) {
+ $objWriter->writeElement('formula', 'NOT(ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . ')))');
+ } elseif ($conditional->getConditionType() == Conditional::CONDITION_CONTAINSTEXT
+ && $conditional->getOperatorType() == Conditional::OPERATOR_BEGINSWITH
+ && $conditional->getText() !== null) {
+ $objWriter->writeElement('formula', 'LEFT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"');
+ } elseif ($conditional->getConditionType() == Conditional::CONDITION_CONTAINSTEXT
+ && $conditional->getOperatorType() == Conditional::OPERATOR_ENDSWITH
+ && $conditional->getText() !== null) {
+ $objWriter->writeElement('formula', 'RIGHT(' . $cellCoordinate . ',' . strlen($conditional->getText()) . ')="' . $conditional->getText() . '"');
+ } elseif ($conditional->getConditionType() == Conditional::CONDITION_CONTAINSTEXT
+ && $conditional->getOperatorType() == Conditional::OPERATOR_NOTCONTAINS
+ && $conditional->getText() !== null) {
+ $objWriter->writeElement('formula', 'ISERROR(SEARCH("' . $conditional->getText() . '",' . $cellCoordinate . '))');
+ } elseif ($conditional->getConditionType() == Conditional::CONDITION_CELLIS
+ || $conditional->getConditionType() == Conditional::CONDITION_CONTAINSTEXT
+ || $conditional->getConditionType() == Conditional::CONDITION_EXPRESSION) {
+ foreach ($conditional->getConditions() as $formula) {
+ // Formula
+ $objWriter->writeElement('formula', $formula);
+ }
+ } elseif ($conditional->getConditionType() == Conditional::CONDITION_CONTAINSBLANKS) {
+ // formula copied from ms xlsx xml source file
+ $objWriter->writeElement('formula', 'LEN(TRIM(' . $cellCoordinate . '))=0');
+ }
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+ }
+ }
+ }
+ }
+
+ /**
+ * Write DataValidations.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ */
+ private function writeDataValidations(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ // Datavalidation collection
+ $dataValidationCollection = $pSheet->getDataValidationCollection();
+
+ // Write data validations?
+ if (!empty($dataValidationCollection)) {
+ $dataValidationCollection = Coordinate::mergeRangesInCollection($dataValidationCollection);
+ $objWriter->startElement('dataValidations');
+ $objWriter->writeAttribute('count', count($dataValidationCollection));
+
+ foreach ($dataValidationCollection as $coordinate => $dv) {
+ $objWriter->startElement('dataValidation');
+
+ if ($dv->getType() != '') {
+ $objWriter->writeAttribute('type', $dv->getType());
+ }
+
+ if ($dv->getErrorStyle() != '') {
+ $objWriter->writeAttribute('errorStyle', $dv->getErrorStyle());
+ }
+
+ if ($dv->getOperator() != '') {
+ $objWriter->writeAttribute('operator', $dv->getOperator());
+ }
+
+ $objWriter->writeAttribute('allowBlank', ($dv->getAllowBlank() ? '1' : '0'));
+ $objWriter->writeAttribute('showDropDown', (!$dv->getShowDropDown() ? '1' : '0'));
+ $objWriter->writeAttribute('showInputMessage', ($dv->getShowInputMessage() ? '1' : '0'));
+ $objWriter->writeAttribute('showErrorMessage', ($dv->getShowErrorMessage() ? '1' : '0'));
+
+ if ($dv->getErrorTitle() !== '') {
+ $objWriter->writeAttribute('errorTitle', $dv->getErrorTitle());
+ }
+ if ($dv->getError() !== '') {
+ $objWriter->writeAttribute('error', $dv->getError());
+ }
+ if ($dv->getPromptTitle() !== '') {
+ $objWriter->writeAttribute('promptTitle', $dv->getPromptTitle());
+ }
+ if ($dv->getPrompt() !== '') {
+ $objWriter->writeAttribute('prompt', $dv->getPrompt());
+ }
+
+ $objWriter->writeAttribute('sqref', $coordinate);
+
+ if ($dv->getFormula1() !== '') {
+ $objWriter->writeElement('formula1', $dv->getFormula1());
+ }
+ if ($dv->getFormula2() !== '') {
+ $objWriter->writeElement('formula2', $dv->getFormula2());
+ }
+
+ $objWriter->endElement();
+ }
+
+ $objWriter->endElement();
+ }
+ }
+
+ /**
+ * Write Hyperlinks.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ */
+ private function writeHyperlinks(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ // Hyperlink collection
+ $hyperlinkCollection = $pSheet->getHyperlinkCollection();
+
+ // Relation ID
+ $relationId = 1;
+
+ // Write hyperlinks?
+ if (!empty($hyperlinkCollection)) {
+ $objWriter->startElement('hyperlinks');
+
+ foreach ($hyperlinkCollection as $coordinate => $hyperlink) {
+ $objWriter->startElement('hyperlink');
+
+ $objWriter->writeAttribute('ref', $coordinate);
+ if (!$hyperlink->isInternal()) {
+ $objWriter->writeAttribute('r:id', 'rId_hyperlink_' . $relationId);
+ ++$relationId;
+ } else {
+ $objWriter->writeAttribute('location', str_replace('sheet://', '', $hyperlink->getUrl()));
+ }
+
+ if ($hyperlink->getTooltip() != '') {
+ $objWriter->writeAttribute('tooltip', $hyperlink->getTooltip());
+ $objWriter->writeAttribute('display', $hyperlink->getTooltip());
+ }
+
+ $objWriter->endElement();
+ }
+
+ $objWriter->endElement();
+ }
+ }
+
+ /**
+ * Write ProtectedRanges.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ */
+ private function writeProtectedRanges(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ if (count($pSheet->getProtectedCells()) > 0) {
+ // protectedRanges
+ $objWriter->startElement('protectedRanges');
+
+ // Loop protectedRanges
+ foreach ($pSheet->getProtectedCells() as $protectedCell => $passwordHash) {
+ // protectedRange
+ $objWriter->startElement('protectedRange');
+ $objWriter->writeAttribute('name', 'p' . md5($protectedCell));
+ $objWriter->writeAttribute('sqref', $protectedCell);
+ if (!empty($passwordHash)) {
+ $objWriter->writeAttribute('password', $passwordHash);
+ }
+ $objWriter->endElement();
+ }
+
+ $objWriter->endElement();
+ }
+ }
+
+ /**
+ * Write MergeCells.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ */
+ private function writeMergeCells(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ if (count($pSheet->getMergeCells()) > 0) {
+ // mergeCells
+ $objWriter->startElement('mergeCells');
+
+ // Loop mergeCells
+ foreach ($pSheet->getMergeCells() as $mergeCell) {
+ // mergeCell
+ $objWriter->startElement('mergeCell');
+ $objWriter->writeAttribute('ref', $mergeCell);
+ $objWriter->endElement();
+ }
+
+ $objWriter->endElement();
+ }
+ }
+
+ /**
+ * Write PrintOptions.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ */
+ private function writePrintOptions(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ // printOptions
+ $objWriter->startElement('printOptions');
+
+ $objWriter->writeAttribute('gridLines', ($pSheet->getPrintGridlines() ? 'true' : 'false'));
+ $objWriter->writeAttribute('gridLinesSet', 'true');
+
+ if ($pSheet->getPageSetup()->getHorizontalCentered()) {
+ $objWriter->writeAttribute('horizontalCentered', 'true');
+ }
+
+ if ($pSheet->getPageSetup()->getVerticalCentered()) {
+ $objWriter->writeAttribute('verticalCentered', 'true');
+ }
+
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write PageMargins.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ */
+ private function writePageMargins(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ // pageMargins
+ $objWriter->startElement('pageMargins');
+ $objWriter->writeAttribute('left', StringHelper::formatNumber($pSheet->getPageMargins()->getLeft()));
+ $objWriter->writeAttribute('right', StringHelper::formatNumber($pSheet->getPageMargins()->getRight()));
+ $objWriter->writeAttribute('top', StringHelper::formatNumber($pSheet->getPageMargins()->getTop()));
+ $objWriter->writeAttribute('bottom', StringHelper::formatNumber($pSheet->getPageMargins()->getBottom()));
+ $objWriter->writeAttribute('header', StringHelper::formatNumber($pSheet->getPageMargins()->getHeader()));
+ $objWriter->writeAttribute('footer', StringHelper::formatNumber($pSheet->getPageMargins()->getFooter()));
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write AutoFilter.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ */
+ private function writeAutoFilter(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ $autoFilterRange = $pSheet->getAutoFilter()->getRange();
+ if (!empty($autoFilterRange)) {
+ // autoFilter
+ $objWriter->startElement('autoFilter');
+
+ // Strip any worksheet reference from the filter coordinates
+ $range = Coordinate::splitRange($autoFilterRange);
+ $range = $range[0];
+ // Strip any worksheet ref
+ list($ws, $range[0]) = PhpspreadsheetWorksheet::extractSheetTitle($range[0], true);
+ $range = implode(':', $range);
+
+ $objWriter->writeAttribute('ref', str_replace('$', '', $range));
+
+ $columns = $pSheet->getAutoFilter()->getColumns();
+ if (count($columns) > 0) {
+ foreach ($columns as $columnID => $column) {
+ $rules = $column->getRules();
+ if (count($rules) > 0) {
+ $objWriter->startElement('filterColumn');
+ $objWriter->writeAttribute('colId', $pSheet->getAutoFilter()->getColumnOffset($columnID));
+
+ $objWriter->startElement($column->getFilterType());
+ if ($column->getJoin() == Column::AUTOFILTER_COLUMN_JOIN_AND) {
+ $objWriter->writeAttribute('and', 1);
+ }
+
+ foreach ($rules as $rule) {
+ if (($column->getFilterType() === Column::AUTOFILTER_FILTERTYPE_FILTER) &&
+ ($rule->getOperator() === Rule::AUTOFILTER_COLUMN_RULE_EQUAL) &&
+ ($rule->getValue() === '')) {
+ // Filter rule for Blanks
+ $objWriter->writeAttribute('blank', 1);
+ } elseif ($rule->getRuleType() === Rule::AUTOFILTER_RULETYPE_DYNAMICFILTER) {
+ // Dynamic Filter Rule
+ $objWriter->writeAttribute('type', $rule->getGrouping());
+ $val = $column->getAttribute('val');
+ if ($val !== null) {
+ $objWriter->writeAttribute('val', $val);
+ }
+ $maxVal = $column->getAttribute('maxVal');
+ if ($maxVal !== null) {
+ $objWriter->writeAttribute('maxVal', $maxVal);
+ }
+ } elseif ($rule->getRuleType() === Rule::AUTOFILTER_RULETYPE_TOPTENFILTER) {
+ // Top 10 Filter Rule
+ $objWriter->writeAttribute('val', $rule->getValue());
+ $objWriter->writeAttribute('percent', (($rule->getOperator() === Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_PERCENT) ? '1' : '0'));
+ $objWriter->writeAttribute('top', (($rule->getGrouping() === Rule::AUTOFILTER_COLUMN_RULE_TOPTEN_TOP) ? '1' : '0'));
+ } else {
+ // Filter, DateGroupItem or CustomFilter
+ $objWriter->startElement($rule->getRuleType());
+
+ if ($rule->getOperator() !== Rule::AUTOFILTER_COLUMN_RULE_EQUAL) {
+ $objWriter->writeAttribute('operator', $rule->getOperator());
+ }
+ if ($rule->getRuleType() === Rule::AUTOFILTER_RULETYPE_DATEGROUP) {
+ // Date Group filters
+ foreach ($rule->getValue() as $key => $value) {
+ if ($value > '') {
+ $objWriter->writeAttribute($key, $value);
+ }
+ }
+ $objWriter->writeAttribute('dateTimeGrouping', $rule->getGrouping());
+ } else {
+ $objWriter->writeAttribute('val', $rule->getValue());
+ }
+
+ $objWriter->endElement();
+ }
+ }
+
+ $objWriter->endElement();
+
+ $objWriter->endElement();
+ }
+ }
+ }
+ $objWriter->endElement();
+ }
+ }
+
+ /**
+ * Write PageSetup.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ */
+ private function writePageSetup(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ // pageSetup
+ $objWriter->startElement('pageSetup');
+ $objWriter->writeAttribute('paperSize', $pSheet->getPageSetup()->getPaperSize());
+ $objWriter->writeAttribute('orientation', $pSheet->getPageSetup()->getOrientation());
+
+ if ($pSheet->getPageSetup()->getScale() !== null) {
+ $objWriter->writeAttribute('scale', $pSheet->getPageSetup()->getScale());
+ }
+ if ($pSheet->getPageSetup()->getFitToHeight() !== null) {
+ $objWriter->writeAttribute('fitToHeight', $pSheet->getPageSetup()->getFitToHeight());
+ } else {
+ $objWriter->writeAttribute('fitToHeight', '0');
+ }
+ if ($pSheet->getPageSetup()->getFitToWidth() !== null) {
+ $objWriter->writeAttribute('fitToWidth', $pSheet->getPageSetup()->getFitToWidth());
+ } else {
+ $objWriter->writeAttribute('fitToWidth', '0');
+ }
+ if ($pSheet->getPageSetup()->getFirstPageNumber() !== null) {
+ $objWriter->writeAttribute('firstPageNumber', $pSheet->getPageSetup()->getFirstPageNumber());
+ $objWriter->writeAttribute('useFirstPageNumber', '1');
+ }
+
+ $getUnparsedLoadedData = $pSheet->getParent()->getUnparsedLoadedData();
+ if (isset($getUnparsedLoadedData['sheets'][$pSheet->getCodeName()]['pageSetupRelId'])) {
+ $objWriter->writeAttribute('r:id', $getUnparsedLoadedData['sheets'][$pSheet->getCodeName()]['pageSetupRelId']);
+ }
+
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write Header / Footer.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ */
+ private function writeHeaderFooter(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ // headerFooter
+ $objWriter->startElement('headerFooter');
+ $objWriter->writeAttribute('differentOddEven', ($pSheet->getHeaderFooter()->getDifferentOddEven() ? 'true' : 'false'));
+ $objWriter->writeAttribute('differentFirst', ($pSheet->getHeaderFooter()->getDifferentFirst() ? 'true' : 'false'));
+ $objWriter->writeAttribute('scaleWithDoc', ($pSheet->getHeaderFooter()->getScaleWithDocument() ? 'true' : 'false'));
+ $objWriter->writeAttribute('alignWithMargins', ($pSheet->getHeaderFooter()->getAlignWithMargins() ? 'true' : 'false'));
+
+ $objWriter->writeElement('oddHeader', $pSheet->getHeaderFooter()->getOddHeader());
+ $objWriter->writeElement('oddFooter', $pSheet->getHeaderFooter()->getOddFooter());
+ $objWriter->writeElement('evenHeader', $pSheet->getHeaderFooter()->getEvenHeader());
+ $objWriter->writeElement('evenFooter', $pSheet->getHeaderFooter()->getEvenFooter());
+ $objWriter->writeElement('firstHeader', $pSheet->getHeaderFooter()->getFirstHeader());
+ $objWriter->writeElement('firstFooter', $pSheet->getHeaderFooter()->getFirstFooter());
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write Breaks.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ */
+ private function writeBreaks(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ // Get row and column breaks
+ $aRowBreaks = [];
+ $aColumnBreaks = [];
+ foreach ($pSheet->getBreaks() as $cell => $breakType) {
+ if ($breakType == PhpspreadsheetWorksheet::BREAK_ROW) {
+ $aRowBreaks[] = $cell;
+ } elseif ($breakType == PhpspreadsheetWorksheet::BREAK_COLUMN) {
+ $aColumnBreaks[] = $cell;
+ }
+ }
+
+ // rowBreaks
+ if (!empty($aRowBreaks)) {
+ $objWriter->startElement('rowBreaks');
+ $objWriter->writeAttribute('count', count($aRowBreaks));
+ $objWriter->writeAttribute('manualBreakCount', count($aRowBreaks));
+
+ foreach ($aRowBreaks as $cell) {
+ $coords = Coordinate::coordinateFromString($cell);
+
+ $objWriter->startElement('brk');
+ $objWriter->writeAttribute('id', $coords[1]);
+ $objWriter->writeAttribute('man', '1');
+ $objWriter->endElement();
+ }
+
+ $objWriter->endElement();
+ }
+
+ // Second, write column breaks
+ if (!empty($aColumnBreaks)) {
+ $objWriter->startElement('colBreaks');
+ $objWriter->writeAttribute('count', count($aColumnBreaks));
+ $objWriter->writeAttribute('manualBreakCount', count($aColumnBreaks));
+
+ foreach ($aColumnBreaks as $cell) {
+ $coords = Coordinate::coordinateFromString($cell);
+
+ $objWriter->startElement('brk');
+ $objWriter->writeAttribute('id', Coordinate::columnIndexFromString($coords[0]) - 1);
+ $objWriter->writeAttribute('man', '1');
+ $objWriter->endElement();
+ }
+
+ $objWriter->endElement();
+ }
+ }
+
+ /**
+ * Write SheetData.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ * @param string[] $pStringTable String table
+ *
+ * @throws WriterException
+ */
+ private function writeSheetData(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet, array $pStringTable)
+ {
+ // Flipped stringtable, for faster index searching
+ $aFlippedStringTable = $this->getParentWriter()->getWriterPart('stringtable')->flipStringTable($pStringTable);
+
+ // sheetData
+ $objWriter->startElement('sheetData');
+
+ // Get column count
+ $colCount = Coordinate::columnIndexFromString($pSheet->getHighestColumn());
+
+ // Highest row number
+ $highestRow = $pSheet->getHighestRow();
+
+ // Loop through cells
+ $cellsByRow = [];
+ foreach ($pSheet->getCoordinates() as $coordinate) {
+ $cellAddress = Coordinate::coordinateFromString($coordinate);
+ $cellsByRow[$cellAddress[1]][] = $coordinate;
+ }
+
+ $currentRow = 0;
+ while ($currentRow++ < $highestRow) {
+ // Get row dimension
+ $rowDimension = $pSheet->getRowDimension($currentRow);
+
+ // Write current row?
+ $writeCurrentRow = isset($cellsByRow[$currentRow]) || $rowDimension->getRowHeight() >= 0 || $rowDimension->getVisible() == false || $rowDimension->getCollapsed() == true || $rowDimension->getOutlineLevel() > 0 || $rowDimension->getXfIndex() !== null;
+
+ if ($writeCurrentRow) {
+ // Start a new row
+ $objWriter->startElement('row');
+ $objWriter->writeAttribute('r', $currentRow);
+ $objWriter->writeAttribute('spans', '1:' . $colCount);
+
+ // Row dimensions
+ if ($rowDimension->getRowHeight() >= 0) {
+ $objWriter->writeAttribute('customHeight', '1');
+ $objWriter->writeAttribute('ht', StringHelper::formatNumber($rowDimension->getRowHeight()));
+ }
+
+ // Row visibility
+ if ($rowDimension->getVisible() == false) {
+ $objWriter->writeAttribute('hidden', 'true');
+ }
+
+ // Collapsed
+ if ($rowDimension->getCollapsed() == true) {
+ $objWriter->writeAttribute('collapsed', 'true');
+ }
+
+ // Outline level
+ if ($rowDimension->getOutlineLevel() > 0) {
+ $objWriter->writeAttribute('outlineLevel', $rowDimension->getOutlineLevel());
+ }
+
+ // Style
+ if ($rowDimension->getXfIndex() !== null) {
+ $objWriter->writeAttribute('s', $rowDimension->getXfIndex());
+ $objWriter->writeAttribute('customFormat', '1');
+ }
+
+ // Write cells
+ if (isset($cellsByRow[$currentRow])) {
+ foreach ($cellsByRow[$currentRow] as $cellAddress) {
+ // Write cell
+ $this->writeCell($objWriter, $pSheet, $cellAddress, $aFlippedStringTable);
+ }
+ }
+
+ // End row
+ $objWriter->endElement();
+ }
+ }
+
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write Cell.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ * @param Cell $pCellAddress Cell Address
+ * @param string[] $pFlippedStringTable String table (flipped), for faster index searching
+ *
+ * @throws WriterException
+ */
+ private function writeCell(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet, $pCellAddress, array $pFlippedStringTable)
+ {
+ // Cell
+ $pCell = $pSheet->getCell($pCellAddress);
+ $objWriter->startElement('c');
+ $objWriter->writeAttribute('r', $pCellAddress);
+
+ // Sheet styles
+ if ($pCell->getXfIndex() != '') {
+ $objWriter->writeAttribute('s', $pCell->getXfIndex());
+ }
+
+ // If cell value is supplied, write cell value
+ $cellValue = $pCell->getValue();
+ if (is_object($cellValue) || $cellValue !== '') {
+ // Map type
+ $mappedType = $pCell->getDataType();
+
+ // Write data type depending on its type
+ switch (strtolower($mappedType)) {
+ case 'inlinestr': // Inline string
+ case 's': // String
+ case 'b': // Boolean
+ $objWriter->writeAttribute('t', $mappedType);
+
+ break;
+ case 'f': // Formula
+ $calculatedValue = ($this->getParentWriter()->getPreCalculateFormulas()) ?
+ $pCell->getCalculatedValue() : $cellValue;
+ if (is_string($calculatedValue)) {
+ $objWriter->writeAttribute('t', 'str');
+ } elseif (is_bool($calculatedValue)) {
+ $objWriter->writeAttribute('t', 'b');
+ }
+
+ break;
+ case 'e': // Error
+ $objWriter->writeAttribute('t', $mappedType);
+ }
+
+ // Write data depending on its type
+ switch (strtolower($mappedType)) {
+ case 'inlinestr': // Inline string
+ if (!$cellValue instanceof RichText) {
+ $objWriter->writeElement('t', StringHelper::controlCharacterPHP2OOXML(htmlspecialchars($cellValue)));
+ } elseif ($cellValue instanceof RichText) {
+ $objWriter->startElement('is');
+ $this->getParentWriter()->getWriterPart('stringtable')->writeRichText($objWriter, $cellValue);
+ $objWriter->endElement();
+ }
+
+ break;
+ case 's': // String
+ if (!$cellValue instanceof RichText) {
+ if (isset($pFlippedStringTable[$cellValue])) {
+ $objWriter->writeElement('v', $pFlippedStringTable[$cellValue]);
+ }
+ } elseif ($cellValue instanceof RichText) {
+ $objWriter->writeElement('v', $pFlippedStringTable[$cellValue->getHashCode()]);
+ }
+
+ break;
+ case 'f': // Formula
+ $attributes = $pCell->getFormulaAttributes();
+ if ($attributes['t'] == 'array') {
+ $objWriter->startElement('f');
+ $objWriter->writeAttribute('t', 'array');
+ $objWriter->writeAttribute('ref', $pCellAddress);
+ $objWriter->writeAttribute('aca', '1');
+ $objWriter->writeAttribute('ca', '1');
+ $objWriter->text(substr($cellValue, 1));
+ $objWriter->endElement();
+ } else {
+ $objWriter->writeElement('f', substr($cellValue, 1));
+ }
+ if ($this->getParentWriter()->getOffice2003Compatibility() === false) {
+ if ($this->getParentWriter()->getPreCalculateFormulas()) {
+ if (!is_array($calculatedValue) && substr($calculatedValue, 0, 1) != '#') {
+ $objWriter->writeElement('v', StringHelper::formatNumber($calculatedValue));
+ } else {
+ $objWriter->writeElement('v', '0');
+ }
+ } else {
+ $objWriter->writeElement('v', '0');
+ }
+ }
+
+ break;
+ case 'n': // Numeric
+ // force point as decimal separator in case current locale uses comma
+ $objWriter->writeElement('v', str_replace(',', '.', $cellValue));
+
+ break;
+ case 'b': // Boolean
+ $objWriter->writeElement('v', ($cellValue ? '1' : '0'));
+
+ break;
+ case 'e': // Error
+ if (substr($cellValue, 0, 1) == '=') {
+ $objWriter->writeElement('f', substr($cellValue, 1));
+ $objWriter->writeElement('v', substr($cellValue, 1));
+ } else {
+ $objWriter->writeElement('v', $cellValue);
+ }
+
+ break;
+ }
+ }
+
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write Drawings.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ * @param bool $includeCharts Flag indicating if we should include drawing details for charts
+ */
+ private function writeDrawings(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet, $includeCharts = false)
+ {
+ $unparsedLoadedData = $pSheet->getParent()->getUnparsedLoadedData();
+ $hasUnparsedDrawing = isset($unparsedLoadedData['sheets'][$pSheet->getCodeName()]['drawingOriginalIds']);
+ $chartCount = ($includeCharts) ? $pSheet->getChartCollection()->count() : 0;
+ if ($chartCount == 0 && $pSheet->getDrawingCollection()->count() == 0 && !$hasUnparsedDrawing) {
+ return;
+ }
+
+ // If sheet contains drawings, add the relationships
+ $objWriter->startElement('drawing');
+
+ $rId = 'rId1';
+ if (isset($unparsedLoadedData['sheets'][$pSheet->getCodeName()]['drawingOriginalIds'])) {
+ $drawingOriginalIds = $unparsedLoadedData['sheets'][$pSheet->getCodeName()]['drawingOriginalIds'];
+ // take first. In future can be overriten
+ $rId = reset($drawingOriginalIds);
+ }
+
+ $objWriter->writeAttribute('r:id', $rId);
+ $objWriter->endElement();
+ }
+
+ /**
+ * Write LegacyDrawing.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ */
+ private function writeLegacyDrawing(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ // If sheet contains comments, add the relationships
+ if (count($pSheet->getComments()) > 0) {
+ $objWriter->startElement('legacyDrawing');
+ $objWriter->writeAttribute('r:id', 'rId_comments_vml1');
+ $objWriter->endElement();
+ }
+ }
+
+ /**
+ * Write LegacyDrawingHF.
+ *
+ * @param XMLWriter $objWriter XML Writer
+ * @param PhpspreadsheetWorksheet $pSheet Worksheet
+ */
+ private function writeLegacyDrawingHF(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ // If sheet contains images, add the relationships
+ if (count($pSheet->getHeaderFooter()->getImages()) > 0) {
+ $objWriter->startElement('legacyDrawingHF');
+ $objWriter->writeAttribute('r:id', 'rId_headerfooter_vml1');
+ $objWriter->endElement();
+ }
+ }
+
+ private function writeAlternateContent(XMLWriter $objWriter, PhpspreadsheetWorksheet $pSheet)
+ {
+ if (empty($pSheet->getParent()->getUnparsedLoadedData()['sheets'][$pSheet->getCodeName()]['AlternateContents'])) {
+ return;
+ }
+
+ foreach ($pSheet->getParent()->getUnparsedLoadedData()['sheets'][$pSheet->getCodeName()]['AlternateContents'] as $alternateContent) {
+ $objWriter->writeRaw($alternateContent);
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/WriterPart.php b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/WriterPart.php
new file mode 100644
index 00000000000..7119512ce41
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Writer/Xlsx/WriterPart.php
@@ -0,0 +1,35 @@
+parentWriter;
+ }
+
+ /**
+ * Set parent Xlsx object.
+ *
+ * @param Xlsx $pWriter
+ */
+ public function __construct(Xlsx $pWriter)
+ {
+ $this->parentWriter = $pWriter;
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/psr/simple-cache/.editorconfig b/lib/phpspreadsheet/vendor/psr/simple-cache/.editorconfig
new file mode 100644
index 00000000000..48542cbb418
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/psr/simple-cache/.editorconfig
@@ -0,0 +1,12 @@
+; This file is for unifying the coding style for different editors and IDEs.
+; More information at http://editorconfig.org
+
+root = true
+
+[*]
+charset = utf-8
+indent_size = 4
+indent_style = space
+end_of_line = lf
+insert_final_newline = true
+trim_trailing_whitespace = true
diff --git a/lib/phpspreadsheet/vendor/psr/simple-cache/LICENSE.md b/lib/phpspreadsheet/vendor/psr/simple-cache/LICENSE.md
new file mode 100644
index 00000000000..e49a7c85a10
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/psr/simple-cache/LICENSE.md
@@ -0,0 +1,21 @@
+# The MIT License (MIT)
+
+Copyright (c) 2016 PHP Framework Interoperability Group
+
+> Permission is hereby granted, free of charge, to any person obtaining a copy
+> of this software and associated documentation files (the "Software"), to deal
+> in the Software without restriction, including without limitation the rights
+> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+> copies of the Software, and to permit persons to whom the Software is
+> furnished to do so, subject to the following conditions:
+>
+> The above copyright notice and this permission notice shall be included in
+> all copies or substantial portions of the Software.
+>
+> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+> THE SOFTWARE.
diff --git a/lib/phpspreadsheet/vendor/psr/simple-cache/README.md b/lib/phpspreadsheet/vendor/psr/simple-cache/README.md
new file mode 100644
index 00000000000..43641d175cc
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/psr/simple-cache/README.md
@@ -0,0 +1,8 @@
+PHP FIG Simple Cache PSR
+========================
+
+This repository holds all interfaces related to PSR-16.
+
+Note that this is not a cache implementation of its own. It is merely an interface that describes a cache implementation. See [the specification](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-16-simple-cache.md) for more details.
+
+You can find implementations of the specification by looking for packages providing the [psr/simple-cache-implementation](https://packagist.org/providers/psr/simple-cache-implementation) virtual package.
diff --git a/lib/phpspreadsheet/vendor/psr/simple-cache/composer.json b/lib/phpspreadsheet/vendor/psr/simple-cache/composer.json
new file mode 100644
index 00000000000..2978fa559a7
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/psr/simple-cache/composer.json
@@ -0,0 +1,25 @@
+{
+ "name": "psr/simple-cache",
+ "description": "Common interfaces for simple caching",
+ "keywords": ["psr", "psr-16", "cache", "simple-cache", "caching"],
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "PHP-FIG",
+ "homepage": "http://www.php-fig.org/"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "autoload": {
+ "psr-4": {
+ "Psr\\SimpleCache\\": "src/"
+ }
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ }
+}
diff --git a/lib/phpspreadsheet/vendor/psr/simple-cache/src/CacheException.php b/lib/phpspreadsheet/vendor/psr/simple-cache/src/CacheException.php
new file mode 100644
index 00000000000..eba53815c0c
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/psr/simple-cache/src/CacheException.php
@@ -0,0 +1,10 @@
+ value pairs. Cache keys that do not exist or are stale will have $default as value.
+ *
+ * @throws \Psr\SimpleCache\InvalidArgumentException
+ * MUST be thrown if $keys is neither an array nor a Traversable,
+ * or if any of the $keys are not a legal value.
+ */
+ public function getMultiple($keys, $default = null);
+
+ /**
+ * Persists a set of key => value pairs in the cache, with an optional TTL.
+ *
+ * @param iterable $values A list of key => value pairs for a multiple-set operation.
+ * @param null|int|\DateInterval $ttl Optional. The TTL value of this item. If no value is sent and
+ * the driver supports TTL then the library may set a default value
+ * for it or let the driver take care of that.
+ *
+ * @return bool True on success and false on failure.
+ *
+ * @throws \Psr\SimpleCache\InvalidArgumentException
+ * MUST be thrown if $values is neither an array nor a Traversable,
+ * or if any of the $values are not a legal value.
+ */
+ public function setMultiple($values, $ttl = null);
+
+ /**
+ * Deletes multiple cache items in a single operation.
+ *
+ * @param iterable $keys A list of string-based keys to be deleted.
+ *
+ * @return bool True if the items were successfully removed. False if there was an error.
+ *
+ * @throws \Psr\SimpleCache\InvalidArgumentException
+ * MUST be thrown if $keys is neither an array nor a Traversable,
+ * or if any of the $keys are not a legal value.
+ */
+ public function deleteMultiple($keys);
+
+ /**
+ * Determines whether an item is present in the cache.
+ *
+ * NOTE: It is recommended that has() is only to be used for cache warming type purposes
+ * and not to be used within your live applications operations for get/set, as this method
+ * is subject to a race condition where your has() will return true and immediately after,
+ * another script can remove it making the state of your app out of date.
+ *
+ * @param string $key The cache item key.
+ *
+ * @return bool
+ *
+ * @throws \Psr\SimpleCache\InvalidArgumentException
+ * MUST be thrown if the $key string is not a legal value.
+ */
+ public function has($key);
+}
diff --git a/lib/phpspreadsheet/vendor/psr/simple-cache/src/InvalidArgumentException.php b/lib/phpspreadsheet/vendor/psr/simple-cache/src/InvalidArgumentException.php
new file mode 100644
index 00000000000..6a9524a20c0
--- /dev/null
+++ b/lib/phpspreadsheet/vendor/psr/simple-cache/src/InvalidArgumentException.php
@@ -0,0 +1,13 @@
+box_end();
- echo $OUTPUT->single_button(new moodle_url($PAGE->url, array('type' => 'excel2007')), 'Test Excel 2007 format');
+ echo $OUTPUT->single_button(new moodle_url($PAGE->url, array('type' => 'xslx')), 'Test Excel format');
echo $OUTPUT->single_button(new moodle_url($PAGE->url, array('type' => 'ods')), 'Test ODS format');
echo $OUTPUT->footer();
die;
}
-if ($type === 'excel2007') {
- $workbook = new MoodleExcelWorkbook('moodletest.xlsx', 'Excel2007');
+if ($type === 'xslx') {
+ $workbook = new MoodleExcelWorkbook('moodletest.xlsx', 'Xslx');
} else if ($type === 'ods') {
$workbook = new MoodleODSWorkbook('moodletest.ods');
}
@@ -84,7 +83,8 @@ $worksheet = $workbook->add_worksheet('Supported');
$worksheet->hide_screen_gridlines();
-$worksheet->write_string(0, 0, 'Moodle worksheet export test', $workbook->add_format(array('color'=>'red', 'size'=>20, 'bold'=>1, 'italic'=>1)));
+$worksheet->write_string(0, 0, 'Moodle worksheet export test',
+ $workbook->add_format(array('color'=>'red', 'size'=>20, 'bold'=>1, 'italic'=>1)));
$worksheet->set_row(0, 25);
$worksheet->write(1, 0, 'Moodle release: '.$CFG->release, $workbook->add_format(array('size'=>8, 'italic'=>1)));
@@ -147,7 +147,8 @@ $worksheet->set_row(26, 5);
$worksheet->write(27, 0, 'Wrapped text - Žloťoučký koníček', $workbook->add_format(array('text_wrap'=>true, 'border'=>1)));
$worksheet->set_row(27, 30);
-$worksheet->write(27, 1, 'All centered', $workbook->add_format(array('v_align'=>'center', 'h_align'=>'center', 'border'=>1)));
+$worksheet->write(27, 1, 'All centered',
+ $workbook->add_format(array('v_align'=>'center', 'h_align'=>'center', 'border'=>1)));
$worksheet->write(28, 0, 'Top', $workbook->add_format(array('align'=>'top', 'border'=>1)));
$worksheet->set_row(28, 25);
$worksheet->write(29, 0, 'Vcenter', $workbook->add_format(array('align'=>'vcenter', 'border'=>1)));
@@ -162,21 +163,6 @@ $worksheet->write(32, 0, 'Number formats', $miniheading);
$worksheet->set_row(32, 20);
$worksheet->set_row(33, 5);
-$numbers[1] = '0';
-$numbers[2] = '0.00';
-$numbers[3] = '#,##0';
-$numbers[4] = '#,##0.00';
-$numbers[11] = '0.00E+00';
-$numbers[12] = '# ?/?';
-$numbers[13] = '# ??/??';
-$numbers[14] = 'mm-dd-yy';
-$numbers[15] = 'd-mmm-yy';
-$numbers[16] = 'd-mmm';
-$numbers[17] = 'mmm-yy';
-$numbers[22] = 'm/d/yy h:mm';
-$numbers[49] = '@';
-
-
$worksheet->write_string(34, 0, '1: 0');
$worksheet->write_number(34, 1, 1003.14159, array('num_format'=>1));
$worksheet->write_string(35, 0, '2: 0.00');
@@ -222,7 +208,8 @@ $worksheet->merge_cells(27, 3, 28, 3);
$worksheet->write(27, 3, 'Vertical merging of cells', $workbook->add_format(array('bg_color'=>'silver')));
$worksheet->merge_cells(30, 3, 30, 4);
-$worksheet->write(30, 3, 'Horizontal merging of cells', $workbook->add_format(array('pattern'=>1, 'bg_color'=>'silver')));
+$worksheet->write(30, 3, 'Horizontal merging of cells',
+ $workbook->add_format(array('pattern'=>1, 'bg_color'=>'silver')));
$worksheet->set_column(4, 4, 5);
$worksheet->set_row(44, null, null, true);
@@ -247,7 +234,8 @@ $worksheet->set_column(7, 7, 20, null, false, 2);
// Some unfinished stuff.
$worksheet2 = $workbook->add_worksheet('Unsupported');
-$worksheet2->write(0, 0, 'Incomplete and missing features', $workbook->add_format(array('size'=>20, 'bold'=>1, 'italic'=>1)));
+$worksheet2->write(0, 0, 'Incomplete and missing features',
+ $workbook->add_format(array('size'=>20, 'bold'=>1, 'italic'=>1)));
$worksheet2->set_row(0, 25);
$worksheet2->set_column(1, 1, 25);
diff --git a/lib/thirdpartylibs.xml b/lib/thirdpartylibs.xml
index 79c5ecf1436..054c56b9c8f 100644
--- a/lib/thirdpartylibs.xml
+++ b/lib/thirdpartylibs.xml
@@ -22,10 +22,10 @@
- phpexcel
- PHPExcel
+ phpspreadsheet
+ PhpSpreadsheet
LGPL
- 1.8.1
+ 1.7.0
2.1+
From fe3bec8a5eb3a5219be645f949724b6d522c9cb9 Mon Sep 17 00:00:00 2001
From: Sara Arjona
Date: Fri, 21 Jun 2019 11:30:26 +0200
Subject: [PATCH 2/2] MDL-65741 libraries: Fix coding style errors in Excel lib
---
lib/excellib.class.php | 89 ++++++++++----------
lib/tests/other/spreadsheettestpage.php | 103 ++++++++++++------------
2 files changed, 97 insertions(+), 95 deletions(-)
diff --git a/lib/excellib.class.php b/lib/excellib.class.php
index f656d64bac2..43ce6d9855a 100644
--- a/lib/excellib.class.php
+++ b/lib/excellib.class.php
@@ -110,7 +110,7 @@ class MoodleExcelWorkbook {
public function close() {
global $CFG;
- foreach ($this->objspreadsheet->getAllSheets() as $sheet){
+ foreach ($this->objspreadsheet->getAllSheets() as $sheet) {
$sheet->setSelectedCells('A1');
}
$this->objspreadsheet->setActiveSheetIndex(0);
@@ -139,8 +139,8 @@ class MoodleExcelWorkbook {
header('Content-Type: '.$mimetype);
header('Content-Disposition: attachment;filename="'.$filename.'"');
- $objWriter = IOFactory::createWriter($this->objspreadsheet, $this->type);
- $objWriter->save('php://output');
+ $objwriter = IOFactory::createWriter($this->objspreadsheet, $this->type);
+ $objwriter->save('php://output');
}
/**
@@ -203,8 +203,8 @@ class MoodleExcelWorksheet {
// For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
$col += 1;
- $this->worksheet->getStyleByColumnAndRow($col, $row+1)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_TEXT);
- $this->worksheet->setCellValueExplicitByColumnAndRow($col, $row+1, $str, DataType::TYPE_STRING);
+ $this->worksheet->getStyleByColumnAndRow($col, $row + 1)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_TEXT);
+ $this->worksheet->setCellValueExplicitByColumnAndRow($col, $row + 1, $str, DataType::TYPE_STRING);
$this->apply_format($row, $col, $format);
}
@@ -220,8 +220,8 @@ class MoodleExcelWorksheet {
// For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
$col += 1;
- $this->worksheet->getStyleByColumnAndRow($col, $row+1)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_GENERAL);
- $this->worksheet->setCellValueExplicitByColumnAndRow($col, $row+1, $num, DataType::TYPE_NUMERIC);
+ $this->worksheet->getStyleByColumnAndRow($col, $row + 1)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_GENERAL);
+ $this->worksheet->setCellValueExplicitByColumnAndRow($col, $row + 1, $num, DataType::TYPE_NUMERIC);
$this->apply_format($row, $col, $format);
}
@@ -237,8 +237,8 @@ class MoodleExcelWorksheet {
// For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
$col += 1;
- $this->worksheet->setCellValueByColumnAndRow($col, $row+1, $url);
- $this->worksheet->getCellByColumnAndRow($col, $row+1)->getHyperlink()->setUrl($url);
+ $this->worksheet->setCellValueByColumnAndRow($col, $row + 1, $url);
+ $this->worksheet->getCellByColumnAndRow($col, $row + 1)->getHyperlink()->setUrl($url);
$this->apply_format($row, $col, $format);
}
@@ -263,8 +263,9 @@ class MoodleExcelWorksheet {
$getdate['seconds']
);
- $this->worksheet->setCellValueByColumnAndRow($col, $row+1, $exceldate);
- $this->worksheet->getStyleByColumnAndRow($col, $row+1)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_XLSX22);
+ $this->worksheet->setCellValueByColumnAndRow($col, $row + 1, $exceldate);
+ $style = $this->worksheet->getStyleByColumnAndRow($col, $row + 1);
+ $style->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_DATE_XLSX22);
$this->apply_format($row, $col, $format);
}
@@ -280,7 +281,7 @@ class MoodleExcelWorksheet {
// For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
$col += 1;
- $this->worksheet->setCellValueExplicitByColumnAndRow($col, $row+1, $formula, DataType::TYPE_FORMULA);
+ $this->worksheet->setCellValueExplicitByColumnAndRow($col, $row + 1, $formula, DataType::TYPE_FORMULA);
$this->apply_format($row, $col, $format);
}
@@ -295,7 +296,7 @@ class MoodleExcelWorksheet {
// For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
$col += 1;
- $this->worksheet->setCellValueByColumnAndRow($col, $row+1, '');
+ $this->worksheet->setCellValueByColumnAndRow($col, $row + 1, '');
$this->apply_format($row, $col, $format);
}
@@ -353,10 +354,10 @@ class MoodleExcelWorksheet {
$level = 7;
}
if (isset($height)) {
- $this->worksheet->getRowDimension($row+1)->setRowHeight($height);
+ $this->worksheet->getRowDimension($row + 1)->setRowHeight($height);
}
- $this->worksheet->getRowDimension($row+1)->setVisible(!$hidden);
- $this->worksheet->getRowDimension($row+1)->setOutlineLevel($level);
+ $this->worksheet->getRowDimension($row + 1)->setVisible(!$hidden);
+ $this->worksheet->getRowDimension($row + 1)->setOutlineLevel($level);
$this->apply_row_format($row, $format);
}
@@ -378,7 +379,7 @@ class MoodleExcelWorksheet {
}
// For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
$i = $firstcol + 1;
- while($i <= $lastcol + 1) {
+ while ($i <= $lastcol + 1) {
if (isset($width)) {
$this->worksheet->getColumnDimensionByColumn($i)->setWidth($width);
}
@@ -411,40 +412,40 @@ class MoodleExcelWorksheet {
* @param string $bitmap The bitmap filename
* @param integer $x The horizontal position (offset) of the image inside the cell.
* @param integer $y The vertical position (offset) of the image inside the cell.
- * @param integer $scale_x The horizontal scale
- * @param integer $scale_y The vertical scale
+ * @param integer $scalex The horizontal scale
+ * @param integer $scaley The vertical scale
*/
- public function insert_bitmap($row, $col, $bitmap, $x = 0, $y = 0, $scale_x = 1, $scale_y = 1) {
+ public function insert_bitmap($row, $col, $bitmap, $x = 0, $y = 0, $scalex = 1, $scaley = 1) {
// For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
$col += 1;
- $objDrawing = new Drawing();
- $objDrawing->setPath($bitmap);
- $objDrawing->setCoordinates(Coordinate::stringFromColumnIndex($col) . ($row+1));
- $objDrawing->setOffsetX($x);
- $objDrawing->setOffsetY($y);
- $objDrawing->setWorksheet($this->worksheet);
+ $objdrawing = new Drawing();
+ $objdrawing->setPath($bitmap);
+ $objdrawing->setCoordinates(Coordinate::stringFromColumnIndex($col) . ($row + 1));
+ $objdrawing->setOffsetX($x);
+ $objdrawing->setOffsetY($y);
+ $objdrawing->setWorksheet($this->worksheet);
if ($scale_x != 1) {
- $objDrawing->setResizeProportional(false);
- $objDrawing->getWidth($objDrawing->getWidth()*$scale_x);
+ $objdrawing->setResizeProportional(false);
+ $objdrawing->getWidth($objdrawing->getWidth() * $scalex);
}
if ($scale_y != 1) {
- $objDrawing->setResizeProportional(false);
- $objDrawing->setHeight($objDrawing->getHeight()*$scale_y);
+ $objdrawing->setResizeProportional(false);
+ $objdrawing->setHeight($objdrawing->getHeight() * $scaley);
}
}
/**
* Merges the area given by its arguments.
*
- * @param integer $first_row First row of the area to merge
- * @param integer $first_col First column of the area to merge
- * @param integer $last_row Last row of the area to merge
- * @param integer $last_col Last column of the area to merge
+ * @param integer $firstrow First row of the area to merge
+ * @param integer $firstcol First column of the area to merge
+ * @param integer $lastrow Last row of the area to merge
+ * @param integer $lastcol Last column of the area to merge
*/
- public function merge_cells($first_row, $first_col, $last_row, $last_col) {
+ public function merge_cells($firstrow, $firstcol, $lastrow, $lastcol) {
// For PhpSpreadsheet library, the column indexes start on 1 (instead of 0 as before).
- $this->worksheet->mergeCellsByColumnAndRow($first_col + 1, $first_row+1, $last_col + 1, $last_row+1);
+ $this->worksheet->mergeCellsByColumnAndRow($firstcol + 1, $firstrow + 1, $lastcol + 1, $lastrow + 1);
}
protected function apply_format($row, $col, $format = null) {
@@ -453,7 +454,7 @@ class MoodleExcelWorksheet {
} else if (is_array($format)) {
$format = new MoodleExcelFormat($format);
}
- $this->worksheet->getStyleByColumnAndRow($col, $row+1)->applyFromArray($format->get_format_array());
+ $this->worksheet->getStyleByColumnAndRow($col, $row + 1)->applyFromArray($format->get_format_array());
}
protected function apply_column_format($col, $format = null) {
@@ -471,7 +472,7 @@ class MoodleExcelWorksheet {
} else if (is_array($format)) {
$format = new MoodleExcelFormat($format);
}
- $this->worksheet->getStyle($row+1)->applyFromArray($format->get_format_array());
+ $this->worksheet->getStyle($row + 1)->applyFromArray($format->get_format_array());
}
}
@@ -863,9 +864,9 @@ class MoodleExcelFormat {
* Set the numerical format of the format.
* It can be date, time, currency, etc...
*
- * @param mixed $num_format The numeric format
+ * @param mixed $numformat The numeric format
*/
- public function set_num_format($num_format) {
+ public function set_num_format($numformat) {
$numbers = array();
$numbers[1] = '0';
@@ -882,14 +883,14 @@ class MoodleExcelFormat {
$numbers[22] = 'm/d/yy h:mm';
$numbers[49] = '@';
- if ($num_format !== 0 and in_array($num_format, $numbers)) {
- $this->format['numberFormat']['formatCode'] = $num_format;
+ if ($numformat !== 0 and in_array($numformat, $numbers)) {
+ $this->format['numberFormat']['formatCode'] = $numformat;
}
- if (!isset($numbers[$num_format])) {
+ if (!isset($numbers[$numformat])) {
return;
}
- $this->format['numberFormat']['formatCode'] = $numbers[$num_format];
+ $this->format['numberFormat']['formatCode'] = $numbers[$numformat];
}
}
diff --git a/lib/tests/other/spreadsheettestpage.php b/lib/tests/other/spreadsheettestpage.php
index e26c8e9be22..5f6c3c795a4 100644
--- a/lib/tests/other/spreadsheettestpage.php
+++ b/lib/tests/other/spreadsheettestpage.php
@@ -84,9 +84,9 @@ $worksheet = $workbook->add_worksheet('Supported');
$worksheet->hide_screen_gridlines();
$worksheet->write_string(0, 0, 'Moodle worksheet export test',
- $workbook->add_format(array('color'=>'red', 'size'=>20, 'bold'=>1, 'italic'=>1)));
+ $workbook->add_format(array('color' => 'red', 'size' => 20, 'bold' => 1, 'italic' => 1)));
$worksheet->set_row(0, 25);
-$worksheet->write(1, 0, 'Moodle release: '.$CFG->release, $workbook->add_format(array('size'=>8, 'italic'=>1)));
+$worksheet->write(1, 0, 'Moodle release: '.$CFG->release, $workbook->add_format(array('size' => 8, 'italic' => 1)));
$worksheet->set_column(0, 0, 20);
$worksheet->set_column(1, 1, 30);
@@ -94,7 +94,7 @@ $worksheet->set_column(2, 2, 5);
$worksheet->set_column(3, 3, 30);
$worksheet->set_column(4, 4, 20);
-$miniheading = $workbook->add_format(array('size'=>15, 'bold'=>1, 'italic'=>1, 'underline'=>1));
+$miniheading = $workbook->add_format(array('size' => 15, 'bold' => 1, 'italic' => 1, 'underline' => 1));
$worksheet->write(2, 0, 'Cell types', $miniheading);
@@ -123,7 +123,7 @@ $worksheet->write(10, 0, 'Formula');
$worksheet->write(10, 1, '=1+2');
$worksheet->write(11, 0, 'Blank');
-$worksheet->write_blank(11, 1, $workbook->add_format(array('bg_color'=>'silver')));
+$worksheet->write_blank(11, 1, $workbook->add_format(array('bg_color' => 'silver')));
$worksheet->write(14, 0, 'Text formats', $miniheading);
@@ -131,92 +131,93 @@ $worksheet->set_row(14, 20);
$worksheet->set_row(15, 5);
// Following writes use alternative format array.
-$worksheet->write(16, 0, 'Bold', array('bold'=>1));
-$worksheet->write(17, 0, 'Italic', array('italic'=>1));
-$worksheet->write(18, 0, 'Single underline', array('underline'=>1));
-$worksheet->write(19, 0, 'Double underline', array('underline'=>2));
-$worksheet->write(20, 0, 'Strikeout', array('strikeout'=>1));
-$worksheet->write(21, 0, 'Superscript', array('script'=>1));
-$worksheet->write(22, 0, 'Subscript', array('script'=>2));
-$worksheet->write(23, 0, 'Red', array('color'=>'red'));
+$worksheet->write(16, 0, 'Bold', array('bold' => 1));
+$worksheet->write(17, 0, 'Italic', array('italic' => 1));
+$worksheet->write(18, 0, 'Single underline', array('underline' => 1));
+$worksheet->write(19, 0, 'Double underline', array('underline' => 2));
+$worksheet->write(20, 0, 'Strikeout', array('strikeout' => 1));
+$worksheet->write(21, 0, 'Superscript', array('script' => 1));
+$worksheet->write(22, 0, 'Subscript', array('script' => 2));
+$worksheet->write(23, 0, 'Red', array('color' => 'red'));
$worksheet->write(25, 0, 'Text align', $miniheading);
$worksheet->set_row(25, 20);
$worksheet->set_row(26, 5);
-$worksheet->write(27, 0, 'Wrapped text - Žloťoučký koníček', $workbook->add_format(array('text_wrap'=>true, 'border'=>1)));
+$worksheet->write(27, 0, 'Wrapped text - Žloťoučký koníček',
+ $workbook->add_format(array('text_wrap' => true, 'border' => 1)));
$worksheet->set_row(27, 30);
$worksheet->write(27, 1, 'All centered',
- $workbook->add_format(array('v_align'=>'center', 'h_align'=>'center', 'border'=>1)));
-$worksheet->write(28, 0, 'Top', $workbook->add_format(array('align'=>'top', 'border'=>1)));
+ $workbook->add_format(array('v_align' => 'center', 'h_align' => 'center', 'border' => 1)));
+$worksheet->write(28, 0, 'Top', $workbook->add_format(array('align' => 'top', 'border' => 1)));
$worksheet->set_row(28, 25);
-$worksheet->write(29, 0, 'Vcenter', $workbook->add_format(array('align'=>'vcenter', 'border'=>1)));
+$worksheet->write(29, 0, 'Vcenter', $workbook->add_format(array('align' => 'vcenter', 'border' => 1)));
$worksheet->set_row(29, 25);
-$worksheet->write(30, 0, 'Bottom', $workbook->add_format(array('align'=>'bottom', 'border'=>1)));
+$worksheet->write(30, 0, 'Bottom', $workbook->add_format(array('align' => 'bottom', 'border' => 1)));
$worksheet->set_row(30, 25);
-$worksheet->write(28, 1, 'Left', $workbook->add_format(array('align'=>'left', 'border'=>1)));
-$worksheet->write(29, 1, 'Center', $workbook->add_format(array('align'=>'center', 'border'=>1)));
-$worksheet->write(30, 1, 'Right', $workbook->add_format(array('align'=>'right', 'border'=>1)));
+$worksheet->write(28, 1, 'Left', $workbook->add_format(array('align' => 'left', 'border' => 1)));
+$worksheet->write(29, 1, 'Center', $workbook->add_format(array('align' => 'center', 'border' => 1)));
+$worksheet->write(30, 1, 'Right', $workbook->add_format(array('align' => 'right', 'border' => 1)));
$worksheet->write(32, 0, 'Number formats', $miniheading);
$worksheet->set_row(32, 20);
$worksheet->set_row(33, 5);
$worksheet->write_string(34, 0, '1: 0');
-$worksheet->write_number(34, 1, 1003.14159, array('num_format'=>1));
+$worksheet->write_number(34, 1, 1003.14159, array('num_format' => 1));
$worksheet->write_string(35, 0, '2: 0.00');
-$worksheet->write_number(35, 1, 1003.14159, array('num_format'=>2));
+$worksheet->write_number(35, 1, 1003.14159, array('num_format' => 2));
$worksheet->write_string(36, 0, '3: #,##0');
-$worksheet->write_number(36, 1, 1003.14159, array('num_format'=>3));
+$worksheet->write_number(36, 1, 1003.14159, array('num_format' => 3));
$worksheet->write_string(37, 0, '3: #,##0.00');
-$worksheet->write_number(37, 1, 1003.14159, array('num_format'=>4));
+$worksheet->write_number(37, 1, 1003.14159, array('num_format' => 4));
$worksheet->write_string(38, 0, '11: 0.00E+00');
-$worksheet->write_number(38, 1, 3.14159, array('num_format'=>11));
+$worksheet->write_number(38, 1, 3.14159, array('num_format' => 11));
$worksheet->write_string(39, 0, '12: # ?/?');
-$worksheet->write_number(39, 1, 3.14, array('num_format'=>12));
+$worksheet->write_number(39, 1, 3.14, array('num_format' => 12));
$worksheet->write_string(40, 0, '13: # ??/??');
-$worksheet->write_number(40, 1, 3.14, array('num_format'=>13));
+$worksheet->write_number(40, 1, 3.14, array('num_format' => 13));
$worksheet->write_string(41, 0, '15: d-mmm-yy');
-$worksheet->write_date(41, 1, time(), array('num_format'=>15));
+$worksheet->write_date(41, 1, time(), array('num_format' => 15));
$worksheet->write_string(42, 0, '22: m/d/yy h:mm');
-$worksheet->write_date(42, 1, time(), array('num_format'=>22));
+$worksheet->write_date(42, 1, time(), array('num_format' => 22));
$worksheet->write(2, 3, 'Borders', $miniheading);
-$worksheet->write(4, 3, 'Left', $workbook->add_format(array('left'=>'1')));
-$worksheet->write(6, 3, 'Bottom', $workbook->add_format(array('bottom'=>'1')));
-$worksheet->write(8, 3, 'Right', $workbook->add_format(array('right'=>'1')));
-$worksheet->write(10, 3, 'Top', $workbook->add_format(array('top'=>'1')));
-$worksheet->write(12, 3, 'Thick borders', $workbook->add_format(array('border'=>'2')));
+$worksheet->write(4, 3, 'Left', $workbook->add_format(array('left' => '1')));
+$worksheet->write(6, 3, 'Bottom', $workbook->add_format(array('bottom' => '1')));
+$worksheet->write(8, 3, 'Right', $workbook->add_format(array('right' => '1')));
+$worksheet->write(10, 3, 'Top', $workbook->add_format(array('top' => '1')));
+$worksheet->write(12, 3, 'Thick borders', $workbook->add_format(array('border' => '2')));
$worksheet->write(14, 3, 'Background colours', $miniheading);
-$worksheet->write(16, 3, 'Yellow', $workbook->add_format(array('bg_color'=>'yellow')));
-$worksheet->write(17, 3, 'Red', $workbook->add_format(array('bg_color'=>'red')));
-$worksheet->write(18, 3, 'Green', $workbook->add_format(array('bg_color'=>'green')));
-$worksheet->write(19, 3, 'Blue', $workbook->add_format(array('bg_color'=>12)));
-$worksheet->write(20, 3, 'Cyan', $workbook->add_format(array('bg_color'=>'#00FFFF')));
+$worksheet->write(16, 3, 'Yellow', $workbook->add_format(array('bg_color' => 'yellow')));
+$worksheet->write(17, 3, 'Red', $workbook->add_format(array('bg_color' => 'red')));
+$worksheet->write(18, 3, 'Green', $workbook->add_format(array('bg_color' => 'green')));
+$worksheet->write(19, 3, 'Blue', $workbook->add_format(array('bg_color' => 12)));
+$worksheet->write(20, 3, 'Cyan', $workbook->add_format(array('bg_color' => '#00FFFF')));
$worksheet->write(25, 3, 'Cell merging', $miniheading);
$worksheet->merge_cells(27, 3, 28, 3);
-$worksheet->write(27, 3, 'Vertical merging of cells', $workbook->add_format(array('bg_color'=>'silver')));
+$worksheet->write(27, 3, 'Vertical merging of cells', $workbook->add_format(array('bg_color' => 'silver')));
$worksheet->merge_cells(30, 3, 30, 4);
$worksheet->write(30, 3, 'Horizontal merging of cells',
- $workbook->add_format(array('pattern'=>1, 'bg_color'=>'silver')));
+ $workbook->add_format(array('pattern' => 1, 'bg_color' => 'silver')));
$worksheet->set_column(4, 4, 5);
$worksheet->set_row(44, null, null, true);
-$worksheet->write(44, 0, 'Hidden row', array('bg_color'=>'yellow'));
+$worksheet->write(44, 0, 'Hidden row', array('bg_color' => 'yellow'));
$worksheet->set_column(5, 5, null, null, true);
-$worksheet->write(0, 5, 'Hidden column', array('bg_color'=>'yellow'));
+$worksheet->write(0, 5, 'Hidden column', array('bg_color' => 'yellow'));
$worksheet->write(45, 0, 'Outline row 1');
@@ -235,26 +236,26 @@ $worksheet->set_column(7, 7, 20, null, false, 2);
$worksheet2 = $workbook->add_worksheet('Unsupported');
$worksheet2->write(0, 0, 'Incomplete and missing features',
- $workbook->add_format(array('size'=>20, 'bold'=>1, 'italic'=>1)));
+ $workbook->add_format(array('size' => 20, 'bold' => 1, 'italic' => 1)));
$worksheet2->set_row(0, 25);
$worksheet2->set_column(1, 1, 25);
$worksheet2->write(3, 1, 'Gray row - buggy');
-$worksheet2->set_row(3, null, array('bg_color'=>'silver'));
+$worksheet2->set_row(3, null, array('bg_color' => 'silver'));
$worksheet2->write(2, 6, 'Gray column - buggy');
-$worksheet2->set_column(6, 6, 20, array('bg_color'=>'silver'));
+$worksheet2->set_column(6, 6, 20, array('bg_color' => 'silver'));
$worksheet2->hide_gridlines();
-$worksheet2->write(5, 0, 'Outline text - not implemented', array('outline'=>1));
-$worksheet2->write(6, 0, 'Shadow text - not implemented', array('outline'=>1));
+$worksheet2->write(5, 0, 'Outline text - not implemented', array('outline' => 1));
+$worksheet2->write(6, 0, 'Shadow text - not implemented', array('outline' => 1));
$worksheet2->write(8, 0, 'Pattern 1');
-$worksheet2->write_blank(8, 1, array('pattern'=>1));
+$worksheet2->write_blank(8, 1, array('pattern' => 1));
$worksheet2->write(9, 0, 'Pattern 2');
-$worksheet2->write_blank(9, 1, array('pattern'=>2));
+$worksheet2->write_blank(9, 1, array('pattern' => 2));
$worksheet2->write(10, 0, 'Pattern 3');
-$worksheet2->write_blank(10, 1, array('pattern'=>3));
+$worksheet2->write_blank(10, 1, array('pattern' => 3));
// Other worksheet tests follow.