parent
39b55ded30
commit
4337de4930
|
@ -38,7 +38,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|---------------------------------|-------------------------------------------|
|
|---------------------------------|-------------------------------------------|
|
||||||
| `PHPExcel` | `PhpOffice\PhpSpreadsheet\Spreadsheet` |
|
| `PHPExcel` | `PhpOffice\PhpSpreadsheet\Spreadsheet` |
|
||||||
| `PHPExcel_Reader_Excel2007` | `PhpOffice\PhpSpreadsheet\Reader\Xlsx` |
|
| `PHPExcel_Reader_Excel2007` | `PhpOffice\PhpSpreadsheet\Reader\Xlsx` |
|
||||||
|
| `PHPExcel_Reader_Excel5` | `PhpOffice\PhpSpreadsheet\Reader\Xls` |
|
||||||
| `PHPExcel_Writer_Excel2007` | `PhpOffice\PhpSpreadsheet\Writer\Xlsx` |
|
| `PHPExcel_Writer_Excel2007` | `PhpOffice\PhpSpreadsheet\Writer\Xlsx` |
|
||||||
|
| `PHPExcel_Writer_Excel5` | `PhpOffice\PhpSpreadsheet\Writer\Xls` |
|
||||||
|
|
||||||
- Some methods were renamed for clarity and/or consistency:
|
- Some methods were renamed for clarity and/or consistency:
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
||||||
include 'PHPExcel/IOFactory.php';
|
include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
|
|
|
@ -26,7 +26,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
||||||
include 'PHPExcel/IOFactory.php';
|
include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
|
|
|
@ -26,7 +26,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
||||||
include 'PHPExcel/IOFactory.php';
|
include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
|
|
|
@ -26,7 +26,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
||||||
include 'PHPExcel/IOFactory.php';
|
include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
|
|
|
@ -26,7 +26,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
||||||
include 'PHPExcel/IOFactory.php';
|
include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
|
|
|
@ -26,7 +26,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
||||||
include 'PHPExcel/IOFactory.php';
|
include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
|
|
|
@ -26,7 +26,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
||||||
include 'PHPExcel/IOFactory.php';
|
include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
|
|
|
@ -26,7 +26,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
||||||
include 'PHPExcel/IOFactory.php';
|
include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
|
|
|
@ -26,7 +26,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
||||||
include 'PHPExcel/IOFactory.php';
|
include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
|
|
|
@ -26,7 +26,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
||||||
include 'PHPExcel/IOFactory.php';
|
include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
|
|
|
@ -26,7 +26,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
||||||
include 'PHPExcel/IOFactory.php';
|
include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
|
|
|
@ -26,7 +26,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
||||||
include 'PHPExcel/IOFactory.php';
|
include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
|
|
|
@ -26,7 +26,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
||||||
include 'PHPExcel/IOFactory.php';
|
include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
$inputFileName = './sampleData/example1.xls';
|
$inputFileName = './sampleData/example1.xls';
|
||||||
|
|
||||||
/** Create a new Reader of the type defined in $inputFileType **/
|
/** Create a new Reader of the type defined in $inputFileType **/
|
||||||
|
|
|
@ -26,7 +26,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
||||||
include 'PHPExcel/IOFactory.php';
|
include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
$inputFileName = './sampleData/example2.xls';
|
$inputFileName = './sampleData/example2.xls';
|
||||||
|
|
||||||
/** Create a new Reader of the type defined in $inputFileType **/
|
/** Create a new Reader of the type defined in $inputFileType **/
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
## General Introduction
|
## General Introduction
|
||||||
|
|
||||||
### Function that are not Supported in Excel5
|
### Function that are not Supported in Xls
|
||||||
|
|
||||||
Not all functions are supported by the Excel 5 Writer. Use of these functions within your workbooks will result in an error when trying to write to Excel5.
|
Not all functions are supported by the Excel 5 Writer. Use of these functions within your workbooks will result in an error when trying to write to Xls.
|
||||||
|
|
||||||
The following is the list of those functions that are implemented within PHPExcel, but that cannot currently be written to Excel 5.
|
The following is the list of those functions that are implemented within PHPExcel, but that cannot currently be written to Excel 5.
|
||||||
|
|
||||||
|
|
|
@ -299,7 +299,7 @@ DATEVALUE uses the php date/time object implementation of strtotime() (which can
|
||||||
|
|
||||||
__WARNING:-__ PHPExcel accepts a wider range of date formats than MS Excel, so it is entirely possible that Excel will return a #VALUE! error when passed a date string that it can’t interpret, while PHPExcel is able to translate that same string into a correct date value.
|
__WARNING:-__ PHPExcel accepts a wider range of date formats than MS Excel, so it is entirely possible that Excel will return a #VALUE! error when passed a date string that it can’t interpret, while PHPExcel is able to translate that same string into a correct date value.
|
||||||
|
|
||||||
Care should be taken in workbooks that use string formatted dates in calculations when writing to Excel5 or Xlsx.
|
Care should be taken in workbooks that use string formatted dates in calculations when writing to Xls or Xlsx.
|
||||||
|
|
||||||
#### DAY
|
#### DAY
|
||||||
|
|
||||||
|
@ -435,7 +435,7 @@ $retVal = call_user_func_array(
|
||||||
|
|
||||||
##### Notes
|
##### Notes
|
||||||
|
|
||||||
__WARNING:-__ This function does not currently work with the Excel5 Writer when a PHP Boolean is used for the third (optional) parameter (as shown in the example above), and the writer will generate and error. It will work if a numeric 0 or 1 is used for the method parameter; or if the Excel TRUE() and FALSE() functions are used instead.
|
__WARNING:-__ This function does not currently work with the Xls Writer when a PHP Boolean is used for the third (optional) parameter (as shown in the example above), and the writer will generate and error. It will work if a numeric 0 or 1 is used for the method parameter; or if the Excel TRUE() and FALSE() functions are used instead.
|
||||||
|
|
||||||
#### EDATE
|
#### EDATE
|
||||||
|
|
||||||
|
@ -498,7 +498,7 @@ $retVal = call_user_func_array(
|
||||||
|
|
||||||
###### Notes
|
###### Notes
|
||||||
|
|
||||||
__WARNING:-__ This function is currently not supported by the Excel5 Writer because it is not a standard function within Excel 5, but an add-in from the Analysis ToolPak.
|
__WARNING:-__ This function is currently not supported by the Xls Writer because it is not a standard function within Excel 5, but an add-in from the Analysis ToolPak.
|
||||||
|
|
||||||
#### EOMONTH
|
#### EOMONTH
|
||||||
|
|
||||||
|
@ -559,7 +559,7 @@ $retVal = call_user_func_array(
|
||||||
|
|
||||||
##### Notes
|
##### Notes
|
||||||
|
|
||||||
__WARNING:-__ This function is currently not supported by the Excel5 Writer because it is not a standard function within Excel 5, but an add-in from the Analysis ToolPak.
|
__WARNING:-__ This function is currently not supported by the Xls Writer because it is not a standard function within Excel 5, but an add-in from the Analysis ToolPak.
|
||||||
|
|
||||||
#### HOUR
|
#### HOUR
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ $objPHPExcel->getActiveSheet()->getProtection()->setSheet(true);
|
||||||
|
|
||||||
Not all features of PHPExcel are implemented in all of the Reader / Writer classes. This is mostly due to underlying libraries not supporting a specific feature or not having implemented a specific feature.
|
Not all features of PHPExcel are implemented in all of the Reader / Writer classes. This is mostly due to underlying libraries not supporting a specific feature or not having implemented a specific feature.
|
||||||
|
|
||||||
For example autofilter is not implemented in PEAR Spreadsheet_Excel_writer, which is the base of our Excel5 writer.
|
For example autofilter is not implemented in PEAR Spreadsheet_Excel_writer, which is the base of our Xls writer.
|
||||||
|
|
||||||
We are slowly building up a list of features, together with the different readers and writers that support them, in the "Functionality Cross-Reference.xls" file in the /Documentation folder.
|
We are slowly building up a list of features, together with the different readers and writers that support them, in the "Functionality Cross-Reference.xls" file in the /Documentation folder.
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ $objPHPExcel->getActiveSheet()->getStyle('A10')
|
||||||
![07-simple-example-1.png](./images/07-simple-example-1.png "")
|
![07-simple-example-1.png](./images/07-simple-example-1.png "")
|
||||||
|
|
||||||
|
|
||||||
**Note** that not all complex format masks such as this one will work when retrieving a formatted value to display "on screen", or for certain writers such as HTML or PDF, but it will work with the true spreadsheet writers (Xlsx and Excel5).
|
**Note** that not all complex format masks such as this one will work when retrieving a formatted value to display "on screen", or for certain writers such as HTML or PDF, but it will work with the true spreadsheet writers (Xlsx and Xls).
|
||||||
|
|
||||||
### Setting a range of cells from an array
|
### Setting a range of cells from an array
|
||||||
|
|
||||||
|
|
|
@ -1082,7 +1082,7 @@ $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Xlsx');
|
||||||
$objWriter->save('php://output');
|
$objWriter->save('php://output');
|
||||||
```
|
```
|
||||||
|
|
||||||
Example of a script redirecting an Excel5 file to the client's browser:
|
Example of a script redirecting an Xls file to the client's browser:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
/* Here there will be some code where you create $objPHPExcel */
|
/* Here there will be some code where you create $objPHPExcel */
|
||||||
|
@ -1092,7 +1092,7 @@ header('Content-Type: application/vnd.ms-excel');
|
||||||
header('Content-Disposition: attachment;filename="myfile.xls"');
|
header('Content-Disposition: attachment;filename="myfile.xls"');
|
||||||
header('Cache-Control: max-age=0');
|
header('Cache-Control: max-age=0');
|
||||||
|
|
||||||
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
|
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Xls');
|
||||||
$objWriter->save('php://output');
|
$objWriter->save('php://output');
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -144,9 +144,9 @@ Office2003 compatibility option should only be used when needed. This option dis
|
||||||
|
|
||||||
### Excel 5 (BIFF) file format
|
### Excel 5 (BIFF) file format
|
||||||
|
|
||||||
Excel5 file format is the old Excel file format, implemented in PHPExcel to provide a uniform manner to create both .xlsx and .xls files. It is basically a modified version of [PEAR Spreadsheet_Excel_Writer][21], although it has been extended and has fewer limitations and more features than the old PEAR library. This can read all BIFF versions that use OLE2: BIFF5 (introduced with office 95) through BIFF8, but cannot read earlier versions.
|
Xls file format is the old Excel file format, implemented in PHPExcel to provide a uniform manner to create both .xlsx and .xls files. It is basically a modified version of [PEAR Spreadsheet_Excel_Writer][21], although it has been extended and has fewer limitations and more features than the old PEAR library. This can read all BIFF versions that use OLE2: BIFF5 (introduced with office 95) through BIFF8, but cannot read earlier versions.
|
||||||
|
|
||||||
Excel5 file format will not be developed any further, it just provides an additional file format for PHPExcel.
|
Xls file format will not be developed any further, it just provides an additional file format for PHPExcel.
|
||||||
|
|
||||||
__Excel5 (BIFF) limitations__
|
__Excel5 (BIFF) limitations__
|
||||||
Please note that BIFF file format has some limits regarding to styling cells and handling large spreadsheets via PHP.
|
Please note that BIFF file format has some limits regarding to styling cells and handling large spreadsheets via PHP.
|
||||||
|
@ -704,7 +704,7 @@ $objWorksheet = $objPHPexcel->getActiveSheet();
|
||||||
$objWorksheet->getCell('A1')->setValue('John');
|
$objWorksheet->getCell('A1')->setValue('John');
|
||||||
$objWorksheet->getCell('A2')->setValue('Smith');
|
$objWorksheet->getCell('A2')->setValue('Smith');
|
||||||
|
|
||||||
$objWriter = PHPExcel_IOFactory::createWriter($objPHPexcel, 'Excel5');
|
$objWriter = PHPExcel_IOFactory::createWriter($objPHPexcel, 'Xls');
|
||||||
$objWriter->save('write.xls');
|
$objWriter->save('write.xls');
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ PHPExcel can read a number of different spreadsheet and file formats, although n
|
||||||
|
|
||||||
Currently, PHPExcel supports the following File Types for Reading:
|
Currently, PHPExcel supports the following File Types for Reading:
|
||||||
|
|
||||||
### Excel5
|
### Xls
|
||||||
|
|
||||||
The Microsoft Excel™ Binary file format (BIFF5 and BIFF8) is a binary file format that was used by Microsoft Excel™ between versions 95 and 2003. The format is supported (to various extents) by most spreadsheet programs. BIFF files normally have an extension of .xls. Documentation describing the format can be found online at [http://msdn.microsoft.com/en-us/library/cc313154(v=office.12).aspx][1] or from [http://download.microsoft.com/download/2/4/8/24862317-78F0-4C4B-B355-C7B2C1D997DB/[MS-XLS].pdf][2] (as a downloadable PDF).
|
The Microsoft Excel™ Binary file format (BIFF5 and BIFF8) is a binary file format that was used by Microsoft Excel™ between versions 95 and 2003. The format is supported (to various extents) by most spreadsheet programs. BIFF files normally have an extension of .xls. Documentation describing the format can be found online at [http://msdn.microsoft.com/en-us/library/cc313154(v=office.12).aspx][1] or from [http://download.microsoft.com/download/2/4/8/24862317-78F0-4C4B-B355-C7B2C1D997DB/[MS-XLS].pdf][2] (as a downloadable PDF).
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
|
||||||
|
|
||||||
The load() method will attempt to identify the file type, and instantiate a loader for that file type; using it to load the file and store the data and any formatting in a PHPExcel object.
|
The load() method will attempt to identify the file type, and instantiate a loader for that file type; using it to load the file and store the data and any formatting in a PHPExcel object.
|
||||||
|
|
||||||
The method makes an initial guess at the loader to instantiate based on the file extension; but will test the file before actually executing the load: so if (for example) the file is actually a CSV file or contains HTML markup, but that has been given a .xls extension (quite a common practise), it will reject the Excel5 loader that it would normally use for a .xls file; and test the file using the other loaders until it finds the appropriate loader, and then use that to read the file.
|
The method makes an initial guess at the loader to instantiate based on the file extension; but will test the file before actually executing the load: so if (for example) the file is actually a CSV file or contains HTML markup, but that has been given a .xls extension (quite a common practise), it will reject the Xls loader that it would normally use for a .xls file; and test the file using the other loaders until it finds the appropriate loader, and then use that to read the file.
|
||||||
|
|
||||||
While easy to implement in your code, and you don't need to worry about the file type; this isn't the most efficient method to load a file; and it lacks the flexibility to configure the loader in any way before actually reading the file into a PHPExcel object.
|
While easy to implement in your code, and you don't need to worry about the file type; this isn't the most efficient method to load a file; and it lacks the flexibility to configure the loader in any way before actually reading the file into a PHPExcel object.
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ If you know the file type of the spreadsheet file that you need to load, you can
|
||||||
```php
|
```php
|
||||||
$inputFileName = './sampleData/example1.xls';
|
$inputFileName = './sampleData/example1.xls';
|
||||||
|
|
||||||
/** Create a new Excel5 Reader **/
|
/** Create a new Xls Reader **/
|
||||||
$objReader = new PHPExcel_Reader_Excel5();
|
$objReader = new PHPExcel_Reader_Excel5();
|
||||||
// $objReader = new PHPExcel_Reader_Excel2007();
|
// $objReader = new PHPExcel_Reader_Excel2007();
|
||||||
// $objReader = new PHPExcel_Reader_Excel2003XML();
|
// $objReader = new PHPExcel_Reader_Excel2003XML();
|
||||||
|
@ -24,7 +24,7 @@ $objPHPExcel = $objReader->load($inputFileName);
|
||||||
Alternatively, you can use the IO Factory's createReader() method to instantiate the reader object for you, simply telling it the file type of the reader that you want instantiating.
|
Alternatively, you can use the IO Factory's createReader() method to instantiate the reader object for you, simply telling it the file type of the reader that you want instantiating.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
// $inputFileType = 'Xlsx';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
|
|
|
@ -9,7 +9,7 @@ Once you have created a reader object for the workbook that you want to load, yo
|
||||||
If you're only interested in the cell values in a workbook, but don't need any of the cell formatting information, then you can set the reader to read only the data values and any formulae from each cell using the setReadDataOnly() method.
|
If you're only interested in the cell values in a workbook, but don't need any of the cell formatting information, then you can set the reader to read only the data values and any formulae from each cell using the setReadDataOnly() method.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
$inputFileName = './sampleData/example1.xls';
|
$inputFileName = './sampleData/example1.xls';
|
||||||
|
|
||||||
/** Create a new Reader of the type defined in $inputFileType **/
|
/** Create a new Reader of the type defined in $inputFileType **/
|
||||||
|
@ -29,7 +29,7 @@ Reading Only Data from a Spreadsheet File applies to Readers:
|
||||||
|
|
||||||
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
||||||
----------|:---:|--------|:---:|--------------|:---:|
|
----------|:---:|--------|:---:|--------------|:---:|
|
||||||
Xlsx | YES | Excel5 | YES | Excel2003XML | YES |
|
Xlsx | YES | Xls | YES | Excel2003XML | YES |
|
||||||
OOCalc | YES | SYLK | NO | Gnumeric | YES |
|
OOCalc | YES | SYLK | NO | Gnumeric | YES |
|
||||||
CSV | NO | HTML | NO
|
CSV | NO | HTML | NO
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ If your workbook contains a number of worksheets, but you are only interested in
|
||||||
To read a single sheet, you can pass that sheet name as a parameter to the setLoadSheetsOnly() method.
|
To read a single sheet, you can pass that sheet name as a parameter to the setLoadSheetsOnly() method.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
$inputFileName = './sampleData/example1.xls';
|
$inputFileName = './sampleData/example1.xls';
|
||||||
$sheetname = 'Data Sheet #2';
|
$sheetname = 'Data Sheet #2';
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ $objPHPExcel = $objReader->load($inputFileName);
|
||||||
If you want to read more than just a single sheet, you can pass a list of sheet names as an array parameter to the setLoadSheetsOnly() method.
|
If you want to read more than just a single sheet, you can pass a list of sheet names as an array parameter to the setLoadSheetsOnly() method.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
$inputFileName = './sampleData/example1.xls';
|
$inputFileName = './sampleData/example1.xls';
|
||||||
$sheetnames = array('Data Sheet #1','Data Sheet #3');
|
$sheetnames = array('Data Sheet #1','Data Sheet #3');
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ $objPHPExcel = $objReader->load($inputFileName);
|
||||||
To reset this option to the default, you can call the setLoadAllSheets() method.
|
To reset this option to the default, you can call the setLoadAllSheets() method.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
$inputFileName = './sampleData/example1.xls';
|
$inputFileName = './sampleData/example1.xls';
|
||||||
|
|
||||||
/** Create a new Reader of the type defined in $inputFileType **/
|
/** Create a new Reader of the type defined in $inputFileType **/
|
||||||
|
@ -88,7 +88,7 @@ Reading Only Named WorkSheets from a File applies to Readers:
|
||||||
|
|
||||||
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
||||||
----------|:---:|--------|:---:|--------------|:---:|
|
----------|:---:|--------|:---:|--------------|:---:|
|
||||||
Xlsx | YES | Excel5 | YES | Excel2003XML | YES |
|
Xlsx | YES | Xls | YES | Excel2003XML | YES |
|
||||||
OOCalc | YES | SYLK | NO | Gnumeric | YES |
|
OOCalc | YES | SYLK | NO | Gnumeric | YES |
|
||||||
CSV | NO | HTML | NO
|
CSV | NO | HTML | NO
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ CSV | NO | HTML | NO
|
||||||
If you are only interested in reading part of a worksheet, then you can write a filter class that identifies whether or not individual cells should be read by the loader. A read filter must implement the PHPExcel_Reader_IReadFilter interface, and contain a readCell() method that accepts arguments of $column, $row and $worksheetName, and return a boolean true or false that indicates whether a workbook cell identified by those arguments should be read or not.
|
If you are only interested in reading part of a worksheet, then you can write a filter class that identifies whether or not individual cells should be read by the loader. A read filter must implement the PHPExcel_Reader_IReadFilter interface, and contain a readCell() method that accepts arguments of $column, $row and $worksheetName, and return a boolean true or false that indicates whether a workbook cell identified by those arguments should be read or not.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
$inputFileName = './sampleData/example1.xls';
|
$inputFileName = './sampleData/example1.xls';
|
||||||
$sheetname = 'Data Sheet #3';
|
$sheetname = 'Data Sheet #3';
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ $filterSubset = new MyReadFilter(9,15,range('G','K'));
|
||||||
This can be particularly useful for conserving memory, by allowing you to read and process a large workbook in “chunks”: an example of this usage might be when transferring data from an Excel worksheet to a database.
|
This can be particularly useful for conserving memory, by allowing you to read and process a large workbook in “chunks”: an example of this usage might be when transferring data from an Excel worksheet to a database.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
$inputFileName = './sampleData/example2.xls';
|
$inputFileName = './sampleData/example2.xls';
|
||||||
|
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ Using Read Filters applies to:
|
||||||
|
|
||||||
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
||||||
----------|:---:|--------|:---:|--------------|:---:|
|
----------|:---:|--------|:---:|--------------|:---:|
|
||||||
Xlsx | YES | Excel5 | YES | Excel2003XML | YES |
|
Xlsx | YES | Xls | YES | Excel2003XML | YES |
|
||||||
OOCalc | YES | SYLK | NO | Gnumeric | YES |
|
OOCalc | YES | SYLK | NO | Gnumeric | YES |
|
||||||
CSV | YES | HTML | NO
|
CSV | YES | HTML | NO
|
||||||
|
|
||||||
|
@ -264,13 +264,13 @@ Combining Multiple Files into a Single PHPExcel Object applies to:
|
||||||
|
|
||||||
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
||||||
----------|:---:|--------|:---:|--------------|:---:|
|
----------|:---:|--------|:---:|--------------|:---:|
|
||||||
Xlsx | NO | Excel5 | NO | Excel2003XML | NO |
|
Xlsx | NO | Xls | NO | Excel2003XML | NO |
|
||||||
OOCalc | NO | SYLK | YES | Gnumeric | NO |
|
OOCalc | NO | SYLK | YES | Gnumeric | NO |
|
||||||
CSV | YES | HTML | NO
|
CSV | YES | HTML | NO
|
||||||
|
|
||||||
### Combining Read Filters with the setSheetIndex() method to split a large CSV file across multiple Worksheets
|
### Combining Read Filters with the setSheetIndex() method to split a large CSV file across multiple Worksheets
|
||||||
|
|
||||||
An Excel5 BIFF .xls file is limited to 65536 rows in a worksheet, while the Xlsx Microsoft Office Open XML SpreadsheetML .xlsx file is limited to 1,048,576 rows in a worksheet; but a CSV file is not limited other than by available disk space. This means that we wouldn’t ordinarily be able to read all the rows from a very large CSV file that exceeded those limits, and save it as an Excel5 or Xlsx file. However, by using Read Filters to read the CSV file in “chunks” (using the chunkReadFilter Class that we defined in section REF _Ref275604563 \r \p 5.3 above), and the setSheetIndex() method of the $objReader, we can split the CSV file across several individual worksheets.
|
An Xls BIFF .xls file is limited to 65536 rows in a worksheet, while the Xlsx Microsoft Office Open XML SpreadsheetML .xlsx file is limited to 1,048,576 rows in a worksheet; but a CSV file is not limited other than by available disk space. This means that we wouldn’t ordinarily be able to read all the rows from a very large CSV file that exceeded those limits, and save it as an Xls or Xlsx file. However, by using Read Filters to read the CSV file in “chunks” (using the chunkReadFilter Class that we defined in section REF _Ref275604563 \r \p 5.3 above), and the setSheetIndex() method of the $objReader, we can split the CSV file across several individual worksheets.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$inputFileType = 'CSV';
|
$inputFileType = 'CSV';
|
||||||
|
@ -325,7 +325,7 @@ Splitting a single loaded file across multiple worksheets applies to:
|
||||||
|
|
||||||
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
||||||
----------|:---:|--------|:---:|--------------|:---:|
|
----------|:---:|--------|:---:|--------------|:---:|
|
||||||
Xlsx | NO | Excel5 | NO | Excel2003XML | NO |
|
Xlsx | NO | Xls | NO | Excel2003XML | NO |
|
||||||
OOCalc | NO | SYLK | NO | Gnumeric | NO |
|
OOCalc | NO | SYLK | NO | Gnumeric | NO |
|
||||||
CSV | YES | HTML | NO
|
CSV | YES | HTML | NO
|
||||||
|
|
||||||
|
@ -357,7 +357,7 @@ Setting CSV delimiter applies to:
|
||||||
|
|
||||||
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
||||||
----------|:---:|--------|:---:|--------------|:---:|
|
----------|:---:|--------|:---:|--------------|:---:|
|
||||||
Xlsx | NO | Excel5 | NO | Excel2003XML | NO |
|
Xlsx | NO | Xls | NO | Excel2003XML | NO |
|
||||||
OOCalc | NO | SYLK | NO | Gnumeric | NO |
|
OOCalc | NO | SYLK | NO | Gnumeric | NO |
|
||||||
CSV | YES | HTML | NO
|
CSV | YES | HTML | NO
|
||||||
|
|
||||||
|
@ -386,7 +386,7 @@ Loading using a Value Binder applies to:
|
||||||
|
|
||||||
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
||||||
----------|:---:|--------|:---:|--------------|:---:|
|
----------|:---:|--------|:---:|--------------|:---:|
|
||||||
Xlsx | NO | Excel5 | NO | Excel2003XML | NO |
|
Xlsx | NO | Xls | NO | Excel2003XML | NO |
|
||||||
OOCalc | NO | SYLK | NO | Gnumeric | NO |
|
OOCalc | NO | SYLK | NO | Gnumeric | NO |
|
||||||
CSV | YES | HTML | YES
|
CSV | YES | HTML | YES
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ $spreadsheet->getActiveSheet()->setTitle('Simple');
|
||||||
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
|
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
|
||||||
$spreadsheet->setActiveSheetIndex(0);
|
$spreadsheet->setActiveSheetIndex(0);
|
||||||
|
|
||||||
// Redirect output to a client’s web browser (Excel5)
|
// Redirect output to a client’s web browser (Xls)
|
||||||
header('Content-Type: application/vnd.ms-excel');
|
header('Content-Type: application/vnd.ms-excel');
|
||||||
header('Content-Disposition: attachment;filename="01simple.xls"');
|
header('Content-Disposition: attachment;filename="01simple.xls"');
|
||||||
header('Cache-Control: max-age=0');
|
header('Cache-Control: max-age=0');
|
||||||
|
@ -52,6 +52,6 @@ header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modifie
|
||||||
header('Cache-Control: cache, must-revalidate'); // HTTP/1.1
|
header('Cache-Control: cache, must-revalidate'); // HTTP/1.1
|
||||||
header('Pragma: public'); // HTTP/1.0
|
header('Pragma: public'); // HTTP/1.0
|
||||||
|
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel5');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xls');
|
||||||
$writer->save('php://output');
|
$writer->save('php://output');
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -4,7 +4,7 @@ require __DIR__ . '/Header.php';
|
||||||
$spreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php';
|
$spreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php';
|
||||||
|
|
||||||
$filename = $helper->getFilename(__FILE__, 'xls');
|
$filename = $helper->getFilename(__FILE__, 'xls');
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel5');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xls');
|
||||||
|
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
|
@ -6,15 +6,15 @@ $spreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php';
|
||||||
|
|
||||||
// Write temporary file
|
// Write temporary file
|
||||||
$filename = $helper->getTemporaryFilename('xls');
|
$filename = $helper->getTemporaryFilename('xls');
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel5');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xls');
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
$helper->logWrite($writer, $filename, $callStartTime);
|
$helper->logWrite($writer, $filename, $callStartTime);
|
||||||
|
|
||||||
// Read Excel5 file
|
// Read Xls file
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename);
|
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename);
|
||||||
$helper->logRead('Excel5', $filename, $callStartTime);
|
$helper->logRead('Xls', $filename, $callStartTime);
|
||||||
|
|
||||||
// Save
|
// Save
|
||||||
$helper->write($spreadsheet, __FILE__);
|
$helper->write($spreadsheet, __FILE__);
|
||||||
|
|
|
@ -18,7 +18,7 @@ $reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx');
|
||||||
$spreadsheet = $reader->load(__DIR__ . '/templates/26template.xlsx');
|
$spreadsheet = $reader->load(__DIR__ . '/templates/26template.xlsx');
|
||||||
|
|
||||||
/* at this point, we could do some manipulations with the template, but we skip this step */
|
/* at this point, we could do some manipulations with the template, but we skip this step */
|
||||||
$helper->write($spreadsheet, __FILE__, ['Xlsx' => 'xlsx', 'Excel5' => 'xls', 'HTML' => 'html']);
|
$helper->write($spreadsheet, __FILE__, ['Xlsx' => 'xlsx', 'Xls' => 'xls', 'HTML' => 'html']);
|
||||||
|
|
||||||
// Export to PDF (.pdf)
|
// Export to PDF (.pdf)
|
||||||
$helper->log('Write to PDF format');
|
$helper->log('Write to PDF format');
|
||||||
|
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
require __DIR__ . '/Header.php';
|
require __DIR__ . '/Header.php';
|
||||||
|
|
||||||
// Read from Excel5 (.xls) template
|
// Read from Xls (.xls) template
|
||||||
$helper->log('Load Xlsx template file');
|
$helper->log('Load Xlsx template file');
|
||||||
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Excel5');
|
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xls');
|
||||||
$spreadsheet = $reader->load(__DIR__ . '/templates/27template.xls');
|
$spreadsheet = $reader->load(__DIR__ . '/templates/27template.xls');
|
||||||
|
|
||||||
// Save
|
// Save
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
require __DIR__ . '/Header.php';
|
require __DIR__ . '/Header.php';
|
||||||
|
|
||||||
$helper->log('Load from Excel5 template');
|
$helper->log('Load from Xls template');
|
||||||
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Excel5');
|
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xls');
|
||||||
$spreadsheet = $reader->load(__DIR__ . '/templates/30template.xls');
|
$spreadsheet = $reader->load(__DIR__ . '/templates/30template.xls');
|
||||||
|
|
||||||
$helper->log('Add new data to the template');
|
$helper->log('Add new data to the template');
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require __DIR__ . '/Header.php';
|
require __DIR__ . '/Header.php';
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Xls';
|
||||||
$inputFileName = __DIR__ . '/templates/31docproperties.xls';
|
$inputFileName = __DIR__ . '/templates/31docproperties.xls';
|
||||||
|
|
||||||
$spreadsheetReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
|
$spreadsheetReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
|
||||||
|
@ -18,7 +18,7 @@ $spreadsheet->getProperties()->setTitle('Office 95 XLS Test Document')
|
||||||
|
|
||||||
// Save Excel 95 file
|
// Save Excel 95 file
|
||||||
$filename = $helper->getFilename(__FILE__, 'xls');
|
$filename = $helper->getFilename(__FILE__, 'xls');
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel5');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xls');
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
$helper->logWrite($writer, $filename, $callStartTime);
|
$helper->logWrite($writer, $filename, $callStartTime);
|
||||||
|
@ -27,7 +27,7 @@ $helper->logWrite($writer, $filename, $callStartTime);
|
||||||
$helper->logEndingNotes();
|
$helper->logEndingNotes();
|
||||||
|
|
||||||
// Reread File
|
// Reread File
|
||||||
$helper->log('Reread Excel5 file');
|
$helper->log('Reread Xls file');
|
||||||
$spreadsheetRead = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename);
|
$spreadsheetRead = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename);
|
||||||
|
|
||||||
// Set properties
|
// Set properties
|
||||||
|
|
|
@ -78,7 +78,7 @@ class Sample
|
||||||
* @param string $filename
|
* @param string $filename
|
||||||
* @param array $writers
|
* @param array $writers
|
||||||
*/
|
*/
|
||||||
public function write(Spreadsheet $spreadsheet, $filename, array $writers = ['Xlsx' => 'xlsx', 'Excel5' => 'xls'])
|
public function write(Spreadsheet $spreadsheet, $filename, array $writers = ['Xlsx' => 'xlsx', 'Xls' => 'xls'])
|
||||||
{
|
{
|
||||||
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
|
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
|
||||||
$spreadsheet->setActiveSheetIndex(0);
|
$spreadsheet->setActiveSheetIndex(0);
|
||||||
|
|
|
@ -45,7 +45,7 @@ class IOFactory
|
||||||
*/
|
*/
|
||||||
private static $autoResolveClasses = [
|
private static $autoResolveClasses = [
|
||||||
'Xlsx',
|
'Xlsx',
|
||||||
'Excel5',
|
'Xls',
|
||||||
'Excel2003XML',
|
'Excel2003XML',
|
||||||
'OOCalc',
|
'OOCalc',
|
||||||
'SYLK',
|
'SYLK',
|
||||||
|
@ -217,7 +217,7 @@ class IOFactory
|
||||||
break;
|
break;
|
||||||
case 'xls': // Excel (BIFF) Spreadsheet
|
case 'xls': // Excel (BIFF) Spreadsheet
|
||||||
case 'xlt': // Excel (BIFF) Template
|
case 'xlt': // Excel (BIFF) Template
|
||||||
$extensionType = 'Excel5';
|
$extensionType = 'Xls';
|
||||||
break;
|
break;
|
||||||
case 'ods': // Open/Libre Offic Calc
|
case 'ods': // Open/Libre Offic Calc
|
||||||
case 'ots': // Open/Libre Offic Calc Template
|
case 'ots': // Open/Libre Offic Calc Template
|
||||||
|
|
|
@ -55,7 +55,7 @@ namespace PhpOffice\PhpSpreadsheet\Reader;
|
||||||
// Patch code for user-defined named cells supports single cells only.
|
// Patch code for user-defined named cells supports single cells only.
|
||||||
// NOTE: this patch only works for BIFF8 as BIFF5-7 use a different
|
// NOTE: this patch only works for BIFF8 as BIFF5-7 use a different
|
||||||
// external sheet reference structure
|
// external sheet reference structure
|
||||||
class Excel5 extends BaseReader implements IReader
|
class Xls extends BaseReader implements IReader
|
||||||
{
|
{
|
||||||
// ParseXL definitions
|
// ParseXL definitions
|
||||||
const XLS_BIFF8 = 0x0600;
|
const XLS_BIFF8 = 0x0600;
|
||||||
|
@ -383,7 +383,7 @@ class Excel5 extends BaseReader implements IReader
|
||||||
/**
|
/**
|
||||||
* The current RC4 decryption object
|
* The current RC4 decryption object
|
||||||
*
|
*
|
||||||
* @var Excel5\RC4
|
* @var Xls\RC4
|
||||||
*/
|
*/
|
||||||
private $rc4Key = null;
|
private $rc4Key = null;
|
||||||
|
|
||||||
|
@ -402,7 +402,7 @@ class Excel5 extends BaseReader implements IReader
|
||||||
private $md5Ctxt = null;
|
private $md5Ctxt = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new Excel5 Reader instance
|
* Create a new Xls Reader instance
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
@ -713,7 +713,7 @@ class Excel5 extends BaseReader implements IReader
|
||||||
if (!$this->readDataOnly) {
|
if (!$this->readDataOnly) {
|
||||||
foreach ($this->objFonts as $objFont) {
|
foreach ($this->objFonts as $objFont) {
|
||||||
if (isset($objFont->colorIndex)) {
|
if (isset($objFont->colorIndex)) {
|
||||||
$color = Excel5\Color::map($objFont->colorIndex, $this->palette, $this->version);
|
$color = Xls\Color::map($objFont->colorIndex, $this->palette, $this->version);
|
||||||
$objFont->getColor()->setRGB($color['rgb']);
|
$objFont->getColor()->setRGB($color['rgb']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -723,11 +723,11 @@ class Excel5 extends BaseReader implements IReader
|
||||||
$fill = $objStyle->getFill();
|
$fill = $objStyle->getFill();
|
||||||
|
|
||||||
if (isset($fill->startcolorIndex)) {
|
if (isset($fill->startcolorIndex)) {
|
||||||
$startColor = Excel5\Color::map($fill->startcolorIndex, $this->palette, $this->version);
|
$startColor = Xls\Color::map($fill->startcolorIndex, $this->palette, $this->version);
|
||||||
$fill->getStartColor()->setRGB($startColor['rgb']);
|
$fill->getStartColor()->setRGB($startColor['rgb']);
|
||||||
}
|
}
|
||||||
if (isset($fill->endcolorIndex)) {
|
if (isset($fill->endcolorIndex)) {
|
||||||
$endColor = Excel5\Color::map($fill->endcolorIndex, $this->palette, $this->version);
|
$endColor = Xls\Color::map($fill->endcolorIndex, $this->palette, $this->version);
|
||||||
$fill->getEndColor()->setRGB($endColor['rgb']);
|
$fill->getEndColor()->setRGB($endColor['rgb']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -739,23 +739,23 @@ class Excel5 extends BaseReader implements IReader
|
||||||
$diagonal = $objStyle->getBorders()->getDiagonal();
|
$diagonal = $objStyle->getBorders()->getDiagonal();
|
||||||
|
|
||||||
if (isset($top->colorIndex)) {
|
if (isset($top->colorIndex)) {
|
||||||
$borderTopColor = Excel5\Color::map($top->colorIndex, $this->palette, $this->version);
|
$borderTopColor = Xls\Color::map($top->colorIndex, $this->palette, $this->version);
|
||||||
$top->getColor()->setRGB($borderTopColor['rgb']);
|
$top->getColor()->setRGB($borderTopColor['rgb']);
|
||||||
}
|
}
|
||||||
if (isset($right->colorIndex)) {
|
if (isset($right->colorIndex)) {
|
||||||
$borderRightColor = Excel5\Color::map($right->colorIndex, $this->palette, $this->version);
|
$borderRightColor = Xls\Color::map($right->colorIndex, $this->palette, $this->version);
|
||||||
$right->getColor()->setRGB($borderRightColor['rgb']);
|
$right->getColor()->setRGB($borderRightColor['rgb']);
|
||||||
}
|
}
|
||||||
if (isset($bottom->colorIndex)) {
|
if (isset($bottom->colorIndex)) {
|
||||||
$borderBottomColor = Excel5\Color::map($bottom->colorIndex, $this->palette, $this->version);
|
$borderBottomColor = Xls\Color::map($bottom->colorIndex, $this->palette, $this->version);
|
||||||
$bottom->getColor()->setRGB($borderBottomColor['rgb']);
|
$bottom->getColor()->setRGB($borderBottomColor['rgb']);
|
||||||
}
|
}
|
||||||
if (isset($left->colorIndex)) {
|
if (isset($left->colorIndex)) {
|
||||||
$borderLeftColor = Excel5\Color::map($left->colorIndex, $this->palette, $this->version);
|
$borderLeftColor = Xls\Color::map($left->colorIndex, $this->palette, $this->version);
|
||||||
$left->getColor()->setRGB($borderLeftColor['rgb']);
|
$left->getColor()->setRGB($borderLeftColor['rgb']);
|
||||||
}
|
}
|
||||||
if (isset($diagonal->colorIndex)) {
|
if (isset($diagonal->colorIndex)) {
|
||||||
$borderDiagonalColor = Excel5\Color::map($diagonal->colorIndex, $this->palette, $this->version);
|
$borderDiagonalColor = Xls\Color::map($diagonal->colorIndex, $this->palette, $this->version);
|
||||||
$diagonal->getColor()->setRGB($borderDiagonalColor['rgb']);
|
$diagonal->getColor()->setRGB($borderDiagonalColor['rgb']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -764,7 +764,7 @@ class Excel5 extends BaseReader implements IReader
|
||||||
// treat MSODRAWINGGROUP records, workbook-level Escher
|
// treat MSODRAWINGGROUP records, workbook-level Escher
|
||||||
if (!$this->readDataOnly && $this->drawingGroupData) {
|
if (!$this->readDataOnly && $this->drawingGroupData) {
|
||||||
$escherWorkbook = new \PhpOffice\PhpSpreadsheet\Shared\Escher();
|
$escherWorkbook = new \PhpOffice\PhpSpreadsheet\Shared\Escher();
|
||||||
$reader = new Excel5\Escher($escherWorkbook);
|
$reader = new Xls\Escher($escherWorkbook);
|
||||||
$escherWorkbook = $reader->load($this->drawingGroupData);
|
$escherWorkbook = $reader->load($this->drawingGroupData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -982,7 +982,7 @@ class Excel5 extends BaseReader implements IReader
|
||||||
// treat MSODRAWING records, sheet-level Escher
|
// treat MSODRAWING records, sheet-level Escher
|
||||||
if (!$this->readDataOnly && $this->drawingData) {
|
if (!$this->readDataOnly && $this->drawingData) {
|
||||||
$escherWorksheet = new \PhpOffice\PhpSpreadsheet\Shared\Escher();
|
$escherWorksheet = new \PhpOffice\PhpSpreadsheet\Shared\Escher();
|
||||||
$reader = new Excel5\Escher($escherWorksheet);
|
$reader = new Xls\Escher($escherWorksheet);
|
||||||
$escherWorksheet = $reader->load($this->drawingData);
|
$escherWorksheet = $reader->load($this->drawingData);
|
||||||
|
|
||||||
// get all spContainers in one long array, so they can be mapped to OBJ records
|
// get all spContainers in one long array, so they can be mapped to OBJ records
|
||||||
|
@ -1009,12 +1009,12 @@ class Excel5 extends BaseReader implements IReader
|
||||||
$endOffsetX = $spContainer->getEndOffsetX();
|
$endOffsetX = $spContainer->getEndOffsetX();
|
||||||
$endOffsetY = $spContainer->getEndOffsetY();
|
$endOffsetY = $spContainer->getEndOffsetY();
|
||||||
|
|
||||||
$width = \PhpOffice\PhpSpreadsheet\Shared\Excel5::getDistanceX($this->phpSheet, $startColumn, $startOffsetX, $endColumn, $endOffsetX);
|
$width = \PhpOffice\PhpSpreadsheet\Shared\Xls::getDistanceX($this->phpSheet, $startColumn, $startOffsetX, $endColumn, $endOffsetX);
|
||||||
$height = \PhpOffice\PhpSpreadsheet\Shared\Excel5::getDistanceY($this->phpSheet, $startRow, $startOffsetY, $endRow, $endOffsetY);
|
$height = \PhpOffice\PhpSpreadsheet\Shared\Xls::getDistanceY($this->phpSheet, $startRow, $startOffsetY, $endRow, $endOffsetY);
|
||||||
|
|
||||||
// calculate offsetX and offsetY of the shape
|
// calculate offsetX and offsetY of the shape
|
||||||
$offsetX = $startOffsetX * \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, $startColumn) / 1024;
|
$offsetX = $startOffsetX * \PhpOffice\PhpSpreadsheet\Shared\Xls::sizeCol($this->phpSheet, $startColumn) / 1024;
|
||||||
$offsetY = $startOffsetY * \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $startRow) / 256;
|
$offsetY = $startOffsetY * \PhpOffice\PhpSpreadsheet\Shared\Xls::sizeRow($this->phpSheet, $startRow) / 256;
|
||||||
|
|
||||||
switch ($obj['otObjType']) {
|
switch ($obj['otObjType']) {
|
||||||
case 0x19:
|
case 0x19:
|
||||||
|
@ -1711,7 +1711,7 @@ class Excel5 extends BaseReader implements IReader
|
||||||
* @param int Block for which to create decrypto
|
* @param int Block for which to create decrypto
|
||||||
* @param string $valContext MD5 context state
|
* @param string $valContext MD5 context state
|
||||||
*
|
*
|
||||||
* @return Excel5\RC4
|
* @return Xls\RC4
|
||||||
*/
|
*/
|
||||||
private function makeKey($block, $valContext)
|
private function makeKey($block, $valContext)
|
||||||
{
|
{
|
||||||
|
@ -1729,12 +1729,12 @@ class Excel5 extends BaseReader implements IReader
|
||||||
$pwarray[9] = "\x80";
|
$pwarray[9] = "\x80";
|
||||||
$pwarray[56] = "\x48";
|
$pwarray[56] = "\x48";
|
||||||
|
|
||||||
$md5 = new Excel5\MD5();
|
$md5 = new Xls\MD5();
|
||||||
$md5->add($pwarray);
|
$md5->add($pwarray);
|
||||||
|
|
||||||
$s = $md5->getContext();
|
$s = $md5->getContext();
|
||||||
|
|
||||||
return new Excel5\RC4($s);
|
return new Xls\RC4($s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1760,7 +1760,7 @@ class Excel5 extends BaseReader implements IReader
|
||||||
$pwarray[2 * $i] = chr(0x80);
|
$pwarray[2 * $i] = chr(0x80);
|
||||||
$pwarray[56] = chr(($i << 4) & 0xff);
|
$pwarray[56] = chr(($i << 4) & 0xff);
|
||||||
|
|
||||||
$md5 = new Excel5\MD5();
|
$md5 = new Xls\MD5();
|
||||||
$md5->add($pwarray);
|
$md5->add($pwarray);
|
||||||
|
|
||||||
$mdContext1 = $md5->getContext();
|
$mdContext1 = $md5->getContext();
|
||||||
|
@ -2147,19 +2147,19 @@ class Excel5 extends BaseReader implements IReader
|
||||||
|
|
||||||
// offset: 10; size: 4; Cell border lines and background area
|
// offset: 10; size: 4; Cell border lines and background area
|
||||||
// bit: 3-0; mask: 0x0000000F; left style
|
// bit: 3-0; mask: 0x0000000F; left style
|
||||||
if ($bordersLeftStyle = Excel5\Style\Border::lookup((0x0000000F & self::getInt4d($recordData, 10)) >> 0)) {
|
if ($bordersLeftStyle = Xls\Style\Border::lookup((0x0000000F & self::getInt4d($recordData, 10)) >> 0)) {
|
||||||
$objStyle->getBorders()->getLeft()->setBorderStyle($bordersLeftStyle);
|
$objStyle->getBorders()->getLeft()->setBorderStyle($bordersLeftStyle);
|
||||||
}
|
}
|
||||||
// bit: 7-4; mask: 0x000000F0; right style
|
// bit: 7-4; mask: 0x000000F0; right style
|
||||||
if ($bordersRightStyle = Excel5\Style\Border::lookup((0x000000F0 & self::getInt4d($recordData, 10)) >> 4)) {
|
if ($bordersRightStyle = Xls\Style\Border::lookup((0x000000F0 & self::getInt4d($recordData, 10)) >> 4)) {
|
||||||
$objStyle->getBorders()->getRight()->setBorderStyle($bordersRightStyle);
|
$objStyle->getBorders()->getRight()->setBorderStyle($bordersRightStyle);
|
||||||
}
|
}
|
||||||
// bit: 11-8; mask: 0x00000F00; top style
|
// bit: 11-8; mask: 0x00000F00; top style
|
||||||
if ($bordersTopStyle = Excel5\Style\Border::lookup((0x00000F00 & self::getInt4d($recordData, 10)) >> 8)) {
|
if ($bordersTopStyle = Xls\Style\Border::lookup((0x00000F00 & self::getInt4d($recordData, 10)) >> 8)) {
|
||||||
$objStyle->getBorders()->getTop()->setBorderStyle($bordersTopStyle);
|
$objStyle->getBorders()->getTop()->setBorderStyle($bordersTopStyle);
|
||||||
}
|
}
|
||||||
// bit: 15-12; mask: 0x0000F000; bottom style
|
// bit: 15-12; mask: 0x0000F000; bottom style
|
||||||
if ($bordersBottomStyle = Excel5\Style\Border::lookup((0x0000F000 & self::getInt4d($recordData, 10)) >> 12)) {
|
if ($bordersBottomStyle = Xls\Style\Border::lookup((0x0000F000 & self::getInt4d($recordData, 10)) >> 12)) {
|
||||||
$objStyle->getBorders()->getBottom()->setBorderStyle($bordersBottomStyle);
|
$objStyle->getBorders()->getBottom()->setBorderStyle($bordersBottomStyle);
|
||||||
}
|
}
|
||||||
// bit: 22-16; mask: 0x007F0000; left color
|
// bit: 22-16; mask: 0x007F0000; left color
|
||||||
|
@ -2195,12 +2195,12 @@ class Excel5 extends BaseReader implements IReader
|
||||||
$objStyle->getBorders()->getDiagonal()->colorIndex = (0x001FC000 & self::getInt4d($recordData, 14)) >> 14;
|
$objStyle->getBorders()->getDiagonal()->colorIndex = (0x001FC000 & self::getInt4d($recordData, 14)) >> 14;
|
||||||
|
|
||||||
// bit: 24-21; mask: 0x01E00000; diagonal style
|
// bit: 24-21; mask: 0x01E00000; diagonal style
|
||||||
if ($bordersDiagonalStyle = Excel5\Style\Border::lookup((0x01E00000 & self::getInt4d($recordData, 14)) >> 21)) {
|
if ($bordersDiagonalStyle = Xls\Style\Border::lookup((0x01E00000 & self::getInt4d($recordData, 14)) >> 21)) {
|
||||||
$objStyle->getBorders()->getDiagonal()->setBorderStyle($bordersDiagonalStyle);
|
$objStyle->getBorders()->getDiagonal()->setBorderStyle($bordersDiagonalStyle);
|
||||||
}
|
}
|
||||||
|
|
||||||
// bit: 31-26; mask: 0xFC000000 fill pattern
|
// bit: 31-26; mask: 0xFC000000 fill pattern
|
||||||
if ($fillType = Excel5\Style\FillPattern::lookup((0xFC000000 & self::getInt4d($recordData, 14)) >> 26)) {
|
if ($fillType = Xls\Style\FillPattern::lookup((0xFC000000 & self::getInt4d($recordData, 14)) >> 26)) {
|
||||||
$objStyle->getFill()->setFillType($fillType);
|
$objStyle->getFill()->setFillType($fillType);
|
||||||
}
|
}
|
||||||
// offset: 18; size: 2; pattern and background colour
|
// offset: 18; size: 2; pattern and background colour
|
||||||
|
@ -2242,10 +2242,10 @@ class Excel5 extends BaseReader implements IReader
|
||||||
$objStyle->getFill()->endcolorIndex = (0x00003F80 & $borderAndBackground) >> 7;
|
$objStyle->getFill()->endcolorIndex = (0x00003F80 & $borderAndBackground) >> 7;
|
||||||
|
|
||||||
// bit: 21-16; mask: 0x003F0000; fill pattern
|
// bit: 21-16; mask: 0x003F0000; fill pattern
|
||||||
$objStyle->getFill()->setFillType(Excel5\Style\FillPattern::lookup((0x003F0000 & $borderAndBackground) >> 16));
|
$objStyle->getFill()->setFillType(Xls\Style\FillPattern::lookup((0x003F0000 & $borderAndBackground) >> 16));
|
||||||
|
|
||||||
// bit: 24-22; mask: 0x01C00000; bottom line style
|
// bit: 24-22; mask: 0x01C00000; bottom line style
|
||||||
$objStyle->getBorders()->getBottom()->setBorderStyle(Excel5\Style\Border::lookup((0x01C00000 & $borderAndBackground) >> 22));
|
$objStyle->getBorders()->getBottom()->setBorderStyle(Xls\Style\Border::lookup((0x01C00000 & $borderAndBackground) >> 22));
|
||||||
|
|
||||||
// bit: 31-25; mask: 0xFE000000; bottom line color
|
// bit: 31-25; mask: 0xFE000000; bottom line color
|
||||||
$objStyle->getBorders()->getBottom()->colorIndex = (0xFE000000 & $borderAndBackground) >> 25;
|
$objStyle->getBorders()->getBottom()->colorIndex = (0xFE000000 & $borderAndBackground) >> 25;
|
||||||
|
@ -2254,13 +2254,13 @@ class Excel5 extends BaseReader implements IReader
|
||||||
$borderLines = self::getInt4d($recordData, 12);
|
$borderLines = self::getInt4d($recordData, 12);
|
||||||
|
|
||||||
// bit: 2-0; mask: 0x00000007; top line style
|
// bit: 2-0; mask: 0x00000007; top line style
|
||||||
$objStyle->getBorders()->getTop()->setBorderStyle(Excel5\Style\Border::lookup((0x00000007 & $borderLines) >> 0));
|
$objStyle->getBorders()->getTop()->setBorderStyle(Xls\Style\Border::lookup((0x00000007 & $borderLines) >> 0));
|
||||||
|
|
||||||
// bit: 5-3; mask: 0x00000038; left line style
|
// bit: 5-3; mask: 0x00000038; left line style
|
||||||
$objStyle->getBorders()->getLeft()->setBorderStyle(Excel5\Style\Border::lookup((0x00000038 & $borderLines) >> 3));
|
$objStyle->getBorders()->getLeft()->setBorderStyle(Xls\Style\Border::lookup((0x00000038 & $borderLines) >> 3));
|
||||||
|
|
||||||
// bit: 8-6; mask: 0x000001C0; right line style
|
// bit: 8-6; mask: 0x000001C0; right line style
|
||||||
$objStyle->getBorders()->getRight()->setBorderStyle(Excel5\Style\Border::lookup((0x000001C0 & $borderLines) >> 6));
|
$objStyle->getBorders()->getRight()->setBorderStyle(Xls\Style\Border::lookup((0x000001C0 & $borderLines) >> 6));
|
||||||
|
|
||||||
// bit: 15-9; mask: 0x0000FE00; top line color index
|
// bit: 15-9; mask: 0x0000FE00; top line color index
|
||||||
$objStyle->getBorders()->getTop()->colorIndex = (0x0000FE00 & $borderLines) >> 9;
|
$objStyle->getBorders()->getTop()->colorIndex = (0x0000FE00 & $borderLines) >> 9;
|
||||||
|
@ -3831,7 +3831,7 @@ class Excel5 extends BaseReader implements IReader
|
||||||
&& (ord($recordData{13}) == 255)) {
|
&& (ord($recordData{13}) == 255)) {
|
||||||
// Error formula. Error code is in +2
|
// Error formula. Error code is in +2
|
||||||
$dataType = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_ERROR;
|
$dataType = \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_ERROR;
|
||||||
$value = Excel5\ErrorCode::lookup(ord($recordData{8}));
|
$value = Xls\ErrorCode::lookup(ord($recordData{8}));
|
||||||
} elseif ((ord($recordData{6}) == 3)
|
} elseif ((ord($recordData{6}) == 3)
|
||||||
&& (ord($recordData{12}) == 255)
|
&& (ord($recordData{12}) == 255)
|
||||||
&& (ord($recordData{13}) == 255)) {
|
&& (ord($recordData{13}) == 255)) {
|
||||||
|
@ -3974,7 +3974,7 @@ class Excel5 extends BaseReader implements IReader
|
||||||
$cell->setValueExplicit($value, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_BOOL);
|
$cell->setValueExplicit($value, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_BOOL);
|
||||||
break;
|
break;
|
||||||
case 1: // error type
|
case 1: // error type
|
||||||
$value = Excel5\ErrorCode::lookup($boolErr);
|
$value = Xls\ErrorCode::lookup($boolErr);
|
||||||
|
|
||||||
// add cell value
|
// add cell value
|
||||||
$cell->setValueExplicit($value, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_ERROR);
|
$cell->setValueExplicit($value, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_ERROR);
|
||||||
|
@ -4817,7 +4817,7 @@ class Excel5 extends BaseReader implements IReader
|
||||||
case 0x14:
|
case 0x14:
|
||||||
// offset: 16; size: 2; color index for sheet tab
|
// offset: 16; size: 2; color index for sheet tab
|
||||||
$colorIndex = self::getInt2d($recordData, 16);
|
$colorIndex = self::getInt2d($recordData, 16);
|
||||||
$color = Excel5\Color::map($colorIndex, $this->palette, $this->version);
|
$color = Xls\Color::map($colorIndex, $this->palette, $this->version);
|
||||||
$this->phpSheet->getTabColor()->setRGB($color['rgb']);
|
$this->phpSheet->getTabColor()->setRGB($color['rgb']);
|
||||||
break;
|
break;
|
||||||
case 0x28:
|
case 0x28:
|
||||||
|
@ -5550,7 +5550,7 @@ class Excel5 extends BaseReader implements IReader
|
||||||
// offset: 1; size: 1; error code
|
// offset: 1; size: 1; error code
|
||||||
$name = 'tErr';
|
$name = 'tErr';
|
||||||
$size = 2;
|
$size = 2;
|
||||||
$data = Excel5\ErrorCode::lookup(ord($formulaData[1]));
|
$data = Xls\ErrorCode::lookup(ord($formulaData[1]));
|
||||||
break;
|
break;
|
||||||
case 0x1D: // boolean
|
case 0x1D: // boolean
|
||||||
// offset: 1; size: 1; 0 = false, 1 = true;
|
// offset: 1; size: 1; 0 = false, 1 = true;
|
||||||
|
@ -7025,7 +7025,7 @@ class Excel5 extends BaseReader implements IReader
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// TODO: external sheet support
|
// TODO: external sheet support
|
||||||
throw new Exception('Excel5 reader only supports internal sheets in fomulas');
|
throw new Exception('Xls reader only supports internal sheets in fomulas');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7111,7 +7111,7 @@ class Excel5 extends BaseReader implements IReader
|
||||||
break;
|
break;
|
||||||
case 0x10: // error code
|
case 0x10: // error code
|
||||||
// offset: 1; size: 1; error code
|
// offset: 1; size: 1; error code
|
||||||
$value = Excel5\ErrorCode::lookup(ord($valueData[1]));
|
$value = Xls\ErrorCode::lookup(ord($valueData[1]));
|
||||||
$size = 9;
|
$size = 9;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Reader\Excel5;
|
namespace PhpOffice\PhpSpreadsheet\Reader\Xls;
|
||||||
|
|
||||||
class Color
|
class Color
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,7 @@ class Color
|
||||||
return $palette[$color - 8];
|
return $palette[$color - 8];
|
||||||
} else {
|
} else {
|
||||||
// default color table
|
// default color table
|
||||||
if ($version == \PhpOffice\PhpSpreadsheet\Reader\Excel5::XLS_BIFF8) {
|
if ($version == \PhpOffice\PhpSpreadsheet\Reader\Xls::XLS_BIFF8) {
|
||||||
return Color\BIFF8::lookup($color);
|
return Color\BIFF8::lookup($color);
|
||||||
} else {
|
} else {
|
||||||
// BIFF5
|
// BIFF5
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Reader\Excel5\Color;
|
namespace PhpOffice\PhpSpreadsheet\Reader\Xls\Color;
|
||||||
|
|
||||||
class BIFF5
|
class BIFF5
|
||||||
{
|
{
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Reader\Excel5\Color;
|
namespace PhpOffice\PhpSpreadsheet\Reader\Xls\Color;
|
||||||
|
|
||||||
class BIFF8
|
class BIFF8
|
||||||
{
|
{
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Reader\Excel5\Color;
|
namespace PhpOffice\PhpSpreadsheet\Reader\Xls\Color;
|
||||||
|
|
||||||
class BuiltIn
|
class BuiltIn
|
||||||
{
|
{
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Reader\Excel5;
|
namespace PhpOffice\PhpSpreadsheet\Reader\Xls;
|
||||||
|
|
||||||
class ErrorCode
|
class ErrorCode
|
||||||
{
|
{
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Reader\Excel5;
|
namespace PhpOffice\PhpSpreadsheet\Reader\Xls;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
||||||
|
@ -100,7 +100,7 @@ class Escher
|
||||||
// Parse Escher stream
|
// Parse Escher stream
|
||||||
while ($this->pos < $this->dataSize) {
|
while ($this->pos < $this->dataSize) {
|
||||||
// offset: 2; size: 2: Record Type
|
// offset: 2; size: 2: Record Type
|
||||||
$fbt = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos + 2);
|
$fbt = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($this->data, $this->pos + 2);
|
||||||
|
|
||||||
switch ($fbt) {
|
switch ($fbt) {
|
||||||
case self::DGGCONTAINER:
|
case self::DGGCONTAINER:
|
||||||
|
@ -172,15 +172,15 @@ class Escher
|
||||||
private function readDefault()
|
private function readDefault()
|
||||||
{
|
{
|
||||||
// offset 0; size: 2; recVer and recInstance
|
// offset 0; size: 2; recVer and recInstance
|
||||||
$verInstance = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos);
|
$verInstance = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($this->data, $this->pos);
|
||||||
|
|
||||||
// offset: 2; size: 2: Record Type
|
// offset: 2; size: 2: Record Type
|
||||||
$fbt = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos + 2);
|
$fbt = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($this->data, $this->pos + 2);
|
||||||
|
|
||||||
// bit: 0-3; mask: 0x000F; recVer
|
// bit: 0-3; mask: 0x000F; recVer
|
||||||
$recVer = (0x000F & $verInstance) >> 0;
|
$recVer = (0x000F & $verInstance) >> 0;
|
||||||
|
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
|
@ -192,7 +192,7 @@ class Escher
|
||||||
*/
|
*/
|
||||||
private function readDggContainer()
|
private function readDggContainer()
|
||||||
{
|
{
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
|
@ -210,7 +210,7 @@ class Escher
|
||||||
*/
|
*/
|
||||||
private function readDgg()
|
private function readDgg()
|
||||||
{
|
{
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
|
@ -222,7 +222,7 @@ class Escher
|
||||||
*/
|
*/
|
||||||
private function readBstoreContainer()
|
private function readBstoreContainer()
|
||||||
{
|
{
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
|
@ -243,9 +243,9 @@ class Escher
|
||||||
// offset: 0; size: 2; recVer and recInstance
|
// offset: 0; size: 2; recVer and recInstance
|
||||||
|
|
||||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||||
$recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4;
|
$recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($this->data, $this->pos)) >> 4;
|
||||||
|
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
|
@ -267,16 +267,16 @@ class Escher
|
||||||
$rgbUid = substr($recordData, 2, 16);
|
$rgbUid = substr($recordData, 2, 16);
|
||||||
|
|
||||||
// offset: 18; size: 2; tag
|
// offset: 18; size: 2; tag
|
||||||
$tag = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 18);
|
$tag = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($recordData, 18);
|
||||||
|
|
||||||
// offset: 20; size: 4; size of BLIP in bytes
|
// offset: 20; size: 4; size of BLIP in bytes
|
||||||
$size = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($recordData, 20);
|
$size = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($recordData, 20);
|
||||||
|
|
||||||
// offset: 24; size: 4; number of references to this BLIP
|
// offset: 24; size: 4; number of references to this BLIP
|
||||||
$cRef = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($recordData, 24);
|
$cRef = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($recordData, 24);
|
||||||
|
|
||||||
// offset: 28; size: 4; MSOFO file offset
|
// offset: 28; size: 4; MSOFO file offset
|
||||||
$foDelay = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($recordData, 28);
|
$foDelay = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($recordData, 28);
|
||||||
|
|
||||||
// offset: 32; size: 1; unused1
|
// offset: 32; size: 1; unused1
|
||||||
$unused1 = ord($recordData{32});
|
$unused1 = ord($recordData{32});
|
||||||
|
@ -297,7 +297,7 @@ class Escher
|
||||||
$blipData = substr($recordData, 36 + $cbName);
|
$blipData = substr($recordData, 36 + $cbName);
|
||||||
|
|
||||||
// record is a container, read contents
|
// record is a container, read contents
|
||||||
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Excel5\Escher($BSE);
|
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xls\Escher($BSE);
|
||||||
$reader->load($blipData);
|
$reader->load($blipData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,9 +309,9 @@ class Escher
|
||||||
// offset: 0; size: 2; recVer and recInstance
|
// offset: 0; size: 2; recVer and recInstance
|
||||||
|
|
||||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||||
$recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4;
|
$recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($this->data, $this->pos)) >> 4;
|
||||||
|
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
|
@ -350,9 +350,9 @@ class Escher
|
||||||
// offset: 0; size: 2; recVer and recInstance
|
// offset: 0; size: 2; recVer and recInstance
|
||||||
|
|
||||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||||
$recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4;
|
$recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($this->data, $this->pos)) >> 4;
|
||||||
|
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
|
@ -391,9 +391,9 @@ class Escher
|
||||||
// offset: 0; size: 2; recVer and recInstance
|
// offset: 0; size: 2; recVer and recInstance
|
||||||
|
|
||||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||||
$recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4;
|
$recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($this->data, $this->pos)) >> 4;
|
||||||
|
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
|
@ -410,9 +410,9 @@ class Escher
|
||||||
// offset: 0; size: 2; recVer and recInstance
|
// offset: 0; size: 2; recVer and recInstance
|
||||||
|
|
||||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||||
$recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4;
|
$recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($this->data, $this->pos)) >> 4;
|
||||||
|
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
|
@ -424,7 +424,7 @@ class Escher
|
||||||
*/
|
*/
|
||||||
private function readSplitMenuColors()
|
private function readSplitMenuColors()
|
||||||
{
|
{
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
|
@ -436,7 +436,7 @@ class Escher
|
||||||
*/
|
*/
|
||||||
private function readDgContainer()
|
private function readDgContainer()
|
||||||
{
|
{
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
|
@ -445,7 +445,7 @@ class Escher
|
||||||
// record is a container, read contents
|
// record is a container, read contents
|
||||||
$dgContainer = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer();
|
$dgContainer = new \PhpOffice\PhpSpreadsheet\Shared\Escher\DgContainer();
|
||||||
$this->object->setDgContainer($dgContainer);
|
$this->object->setDgContainer($dgContainer);
|
||||||
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Excel5\Escher($dgContainer);
|
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xls\Escher($dgContainer);
|
||||||
$escher = $reader->load($recordData);
|
$escher = $reader->load($recordData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -454,7 +454,7 @@ class Escher
|
||||||
*/
|
*/
|
||||||
private function readDg()
|
private function readDg()
|
||||||
{
|
{
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
|
@ -468,7 +468,7 @@ class Escher
|
||||||
{
|
{
|
||||||
// context is either context DgContainer or SpgrContainer
|
// context is either context DgContainer or SpgrContainer
|
||||||
|
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
|
@ -494,7 +494,7 @@ class Escher
|
||||||
*/
|
*/
|
||||||
private function readSpContainer()
|
private function readSpContainer()
|
||||||
{
|
{
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// add spContainer to spgrContainer
|
// add spContainer to spgrContainer
|
||||||
|
@ -514,7 +514,7 @@ class Escher
|
||||||
*/
|
*/
|
||||||
private function readSpgr()
|
private function readSpgr()
|
||||||
{
|
{
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
|
@ -529,9 +529,9 @@ class Escher
|
||||||
// offset: 0; size: 2; recVer and recInstance
|
// offset: 0; size: 2; recVer and recInstance
|
||||||
|
|
||||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||||
$recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4;
|
$recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($this->data, $this->pos)) >> 4;
|
||||||
|
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
|
@ -546,9 +546,9 @@ class Escher
|
||||||
// offset: 0; size: 2; recVer and recInstance
|
// offset: 0; size: 2; recVer and recInstance
|
||||||
|
|
||||||
// bit: 4-15; mask: 0xFFF0; recInstance
|
// bit: 4-15; mask: 0xFFF0; recInstance
|
||||||
$recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($this->data, $this->pos)) >> 4;
|
$recInstance = (0xFFF0 & \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($this->data, $this->pos)) >> 4;
|
||||||
|
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
|
@ -560,35 +560,35 @@ class Escher
|
||||||
*/
|
*/
|
||||||
private function readClientAnchor()
|
private function readClientAnchor()
|
||||||
{
|
{
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
$this->pos += 8 + $length;
|
$this->pos += 8 + $length;
|
||||||
|
|
||||||
// offset: 2; size: 2; upper-left corner column index (0-based)
|
// offset: 2; size: 2; upper-left corner column index (0-based)
|
||||||
$c1 = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 2);
|
$c1 = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($recordData, 2);
|
||||||
|
|
||||||
// offset: 4; size: 2; upper-left corner horizontal offset in 1/1024 of column width
|
// offset: 4; size: 2; upper-left corner horizontal offset in 1/1024 of column width
|
||||||
$startOffsetX = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 4);
|
$startOffsetX = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($recordData, 4);
|
||||||
|
|
||||||
// offset: 6; size: 2; upper-left corner row index (0-based)
|
// offset: 6; size: 2; upper-left corner row index (0-based)
|
||||||
$r1 = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 6);
|
$r1 = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($recordData, 6);
|
||||||
|
|
||||||
// offset: 8; size: 2; upper-left corner vertical offset in 1/256 of row height
|
// offset: 8; size: 2; upper-left corner vertical offset in 1/256 of row height
|
||||||
$startOffsetY = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 8);
|
$startOffsetY = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($recordData, 8);
|
||||||
|
|
||||||
// offset: 10; size: 2; bottom-right corner column index (0-based)
|
// offset: 10; size: 2; bottom-right corner column index (0-based)
|
||||||
$c2 = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 10);
|
$c2 = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($recordData, 10);
|
||||||
|
|
||||||
// offset: 12; size: 2; bottom-right corner horizontal offset in 1/1024 of column width
|
// offset: 12; size: 2; bottom-right corner horizontal offset in 1/1024 of column width
|
||||||
$endOffsetX = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 12);
|
$endOffsetX = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($recordData, 12);
|
||||||
|
|
||||||
// offset: 14; size: 2; bottom-right corner row index (0-based)
|
// offset: 14; size: 2; bottom-right corner row index (0-based)
|
||||||
$r2 = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 14);
|
$r2 = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($recordData, 14);
|
||||||
|
|
||||||
// offset: 16; size: 2; bottom-right corner vertical offset in 1/256 of row height
|
// offset: 16; size: 2; bottom-right corner vertical offset in 1/256 of row height
|
||||||
$endOffsetY = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($recordData, 16);
|
$endOffsetY = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($recordData, 16);
|
||||||
|
|
||||||
// set the start coordinates
|
// set the start coordinates
|
||||||
$this->object->setStartCoordinates(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($c1) . ($r1 + 1));
|
$this->object->setStartCoordinates(\PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($c1) . ($r1 + 1));
|
||||||
|
@ -614,7 +614,7 @@ class Escher
|
||||||
*/
|
*/
|
||||||
private function readClientData()
|
private function readClientData()
|
||||||
{
|
{
|
||||||
$length = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($this->data, $this->pos + 4);
|
$length = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($this->data, $this->pos + 4);
|
||||||
$recordData = substr($this->data, $this->pos + 8, $length);
|
$recordData = substr($this->data, $this->pos + 8, $length);
|
||||||
|
|
||||||
// move stream pointer to next record
|
// move stream pointer to next record
|
||||||
|
@ -637,7 +637,7 @@ class Escher
|
||||||
$fopte = substr($data, 6 * $i, 6);
|
$fopte = substr($data, 6 * $i, 6);
|
||||||
|
|
||||||
// offset: 0; size: 2; opid
|
// offset: 0; size: 2; opid
|
||||||
$opid = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt2d($fopte, 0);
|
$opid = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt2d($fopte, 0);
|
||||||
|
|
||||||
// bit: 0-13; mask: 0x3FFF; opid.opid
|
// bit: 0-13; mask: 0x3FFF; opid.opid
|
||||||
$opidOpid = (0x3FFF & $opid) >> 0;
|
$opidOpid = (0x3FFF & $opid) >> 0;
|
||||||
|
@ -649,7 +649,7 @@ class Escher
|
||||||
$opidFComplex = (0x8000 & $opid) >> 15;
|
$opidFComplex = (0x8000 & $opid) >> 15;
|
||||||
|
|
||||||
// offset: 2; size: 4; the value for this property
|
// offset: 2; size: 4; the value for this property
|
||||||
$op = \PhpOffice\PhpSpreadsheet\Reader\Excel5::getInt4d($fopte, 2);
|
$op = \PhpOffice\PhpSpreadsheet\Reader\Xls::getInt4d($fopte, 2);
|
||||||
|
|
||||||
if ($opidFComplex) {
|
if ($opidFComplex) {
|
||||||
$complexData = substr($splicedComplexData, 0, $op);
|
$complexData = substr($splicedComplexData, 0, $op);
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Reader\Excel5;
|
namespace PhpOffice\PhpSpreadsheet\Reader\Xls;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Reader\Excel5;
|
namespace PhpOffice\PhpSpreadsheet\Reader\Xls;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Reader\Excel5\Style;
|
namespace PhpOffice\PhpSpreadsheet\Reader\Xls\Style;
|
||||||
|
|
||||||
use PhpOffice\PhpSpreadsheet\Style\Border as StyleBorder;
|
use PhpOffice\PhpSpreadsheet\Style\Border as StyleBorder;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Reader\Excel5\Style;
|
namespace PhpOffice\PhpSpreadsheet\Reader\Xls\Style;
|
||||||
|
|
||||||
use PhpOffice\PhpSpreadsheet\Style\Fill;
|
use PhpOffice\PhpSpreadsheet\Style\Fill;
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace PhpOffice\PhpSpreadsheet\Shared;
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
class Excel5
|
class Xls
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Get the width of a column in pixels. We use the relationship y = ceil(7x) where
|
* Get the width of a column in pixels. We use the relationship y = ceil(7x) where
|
|
@ -24,7 +24,7 @@ namespace PhpOffice\PhpSpreadsheet\Writer;
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
class Excel5 extends BaseWriter implements IWriter
|
class Xls extends BaseWriter implements IWriter
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* PhpSpreadsheet object
|
* PhpSpreadsheet object
|
||||||
|
@ -64,7 +64,7 @@ class Excel5 extends BaseWriter implements IWriter
|
||||||
/**
|
/**
|
||||||
* Formula parser
|
* Formula parser
|
||||||
*
|
*
|
||||||
* @var \PhpOffice\PhpSpreadsheet\Writer\Excel5\Parser
|
* @var \PhpOffice\PhpSpreadsheet\Writer\Xls\Parser
|
||||||
*/
|
*/
|
||||||
private $parser;
|
private $parser;
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ class Excel5 extends BaseWriter implements IWriter
|
||||||
private $documentSummaryInformation;
|
private $documentSummaryInformation;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new Excel5 Writer
|
* Create a new Xls Writer
|
||||||
*
|
*
|
||||||
* @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet PhpSpreadsheet object
|
* @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet PhpSpreadsheet object
|
||||||
*/
|
*/
|
||||||
|
@ -98,7 +98,7 @@ class Excel5 extends BaseWriter implements IWriter
|
||||||
{
|
{
|
||||||
$this->spreadsheet = $spreadsheet;
|
$this->spreadsheet = $spreadsheet;
|
||||||
|
|
||||||
$this->parser = new Excel5\Parser();
|
$this->parser = new Xls\Parser();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -122,12 +122,12 @@ class Excel5 extends BaseWriter implements IWriter
|
||||||
$this->colors = [];
|
$this->colors = [];
|
||||||
|
|
||||||
// Initialise workbook writer
|
// Initialise workbook writer
|
||||||
$this->writerWorkbook = new Excel5\Workbook($this->spreadsheet, $this->strTotal, $this->strUnique, $this->strTable, $this->colors, $this->parser);
|
$this->writerWorkbook = new Xls\Workbook($this->spreadsheet, $this->strTotal, $this->strUnique, $this->strTable, $this->colors, $this->parser);
|
||||||
|
|
||||||
// Initialise worksheet writers
|
// Initialise worksheet writers
|
||||||
$countSheets = $this->spreadsheet->getSheetCount();
|
$countSheets = $this->spreadsheet->getSheetCount();
|
||||||
for ($i = 0; $i < $countSheets; ++$i) {
|
for ($i = 0; $i < $countSheets; ++$i) {
|
||||||
$this->writerWorksheets[$i] = new Excel5\Worksheet($this->strTotal, $this->strUnique, $this->strTable, $this->colors, $this->parser, $this->preCalculateFormulas, $this->spreadsheet->getSheet($i));
|
$this->writerWorksheets[$i] = new Xls\Worksheet($this->strTotal, $this->strUnique, $this->strTable, $this->colors, $this->parser, $this->preCalculateFormulas, $this->spreadsheet->getSheet($i));
|
||||||
}
|
}
|
||||||
|
|
||||||
// build Escher objects. Escher objects for workbooks needs to be build before Escher object for workbook.
|
// build Escher objects. Escher objects for workbooks needs to be build before Escher object for workbook.
|
||||||
|
@ -222,7 +222,7 @@ class Excel5 extends BaseWriter implements IWriter
|
||||||
* @deprecated
|
* @deprecated
|
||||||
* @param string $pValue Temporary storage directory
|
* @param string $pValue Temporary storage directory
|
||||||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception when directory does not exist
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception when directory does not exist
|
||||||
* @return \PhpOffice\PhpSpreadsheet\Writer\Excel5
|
* @return \PhpOffice\PhpSpreadsheet\Writer\Xls
|
||||||
*/
|
*/
|
||||||
public function setTempDir($pValue = '')
|
public function setTempDir($pValue = '')
|
||||||
{
|
{
|
||||||
|
@ -311,7 +311,7 @@ class Excel5 extends BaseWriter implements IWriter
|
||||||
$width = $drawing->getWidth();
|
$width = $drawing->getWidth();
|
||||||
$height = $drawing->getHeight();
|
$height = $drawing->getHeight();
|
||||||
|
|
||||||
$twoAnchor = \PhpOffice\PhpSpreadsheet\Shared\Excel5::oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height);
|
$twoAnchor = \PhpOffice\PhpSpreadsheet\Shared\Xls::oneAnchor2twoAnchor($sheet, $coordinates, $offsetX, $offsetY, $width, $height);
|
||||||
|
|
||||||
$spContainer->setStartCoordinates($twoAnchor['startCoordinates']);
|
$spContainer->setStartCoordinates($twoAnchor['startCoordinates']);
|
||||||
$spContainer->setStartOffsetX($twoAnchor['startOffsetX']);
|
$spContainer->setStartOffsetX($twoAnchor['startOffsetX']);
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel5;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xls;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2015 PhpSpreadsheet
|
* Copyright (c) 2006 - 2015 PhpSpreadsheet
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel5;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xls;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2015 PhpSpreadsheet
|
* Copyright (c) 2006 - 2015 PhpSpreadsheet
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel5;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xls;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2015 PhpSpreadsheet
|
* Copyright (c) 2006 - 2015 PhpSpreadsheet
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel5;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xls;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2015 PhpSpreadsheet
|
* Copyright (c) 2006 - 2015 PhpSpreadsheet
|
||||||
|
@ -845,7 +845,7 @@ class Parser
|
||||||
/**
|
/**
|
||||||
* Look up the index that corresponds to an external sheet name. The hash of
|
* Look up the index that corresponds to an external sheet name. The hash of
|
||||||
* sheet names is updated by the addworksheet() method of the
|
* sheet names is updated by the addworksheet() method of the
|
||||||
* \PhpOffice\PhpSpreadsheet\Writer\Excel5\Workbook class.
|
* \PhpOffice\PhpSpreadsheet\Writer\Xls\Workbook class.
|
||||||
*
|
*
|
||||||
* @param string $sheet_name Sheet name
|
* @param string $sheet_name Sheet name
|
||||||
* @return int The sheet index, -1 if the sheet was not found
|
* @return int The sheet index, -1 if the sheet was not found
|
||||||
|
@ -862,9 +862,9 @@ class Parser
|
||||||
/**
|
/**
|
||||||
* This method is used to update the array of sheet names. It is
|
* This method is used to update the array of sheet names. It is
|
||||||
* called by the addWorksheet() method of the
|
* called by the addWorksheet() method of the
|
||||||
* \PhpOffice\PhpSpreadsheet\Writer\Excel5\Workbook class.
|
* \PhpOffice\PhpSpreadsheet\Writer\Xls\Workbook class.
|
||||||
*
|
*
|
||||||
* @see \PhpOffice\PhpSpreadsheet\Writer\Excel5\Workbook::addWorksheet()
|
* @see \PhpOffice\PhpSpreadsheet\Writer\Xls\Workbook::addWorksheet()
|
||||||
* @param string $name The name of the worksheet being added
|
* @param string $name The name of the worksheet being added
|
||||||
* @param int $index The index of the worksheet being added
|
* @param int $index The index of the worksheet being added
|
||||||
*/
|
*/
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel5;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xls;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2015 PhpSpreadsheet
|
* Copyright (c) 2006 - 2015 PhpSpreadsheet
|
||||||
|
@ -64,7 +64,7 @@ class Workbook extends BIFFwriter
|
||||||
/**
|
/**
|
||||||
* Formula parser
|
* Formula parser
|
||||||
*
|
*
|
||||||
* @var \PhpOffice\PhpSpreadsheet\Writer\Excel5\Parser
|
* @var \PhpOffice\PhpSpreadsheet\Writer\Xls\Parser
|
||||||
*/
|
*/
|
||||||
private $parser;
|
private $parser;
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ class Workbook extends BIFFwriter
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* XF Writers
|
* XF Writers
|
||||||
* @var \PhpOffice\PhpSpreadsheet\Writer\Excel5\Xf[]
|
* @var \PhpOffice\PhpSpreadsheet\Writer\Xls\Xf[]
|
||||||
*/
|
*/
|
||||||
private $xfWriters = [];
|
private $xfWriters = [];
|
||||||
|
|
||||||
|
@ -108,7 +108,7 @@ class Workbook extends BIFFwriter
|
||||||
/**
|
/**
|
||||||
* Fonts writers
|
* Fonts writers
|
||||||
*
|
*
|
||||||
* @var \PhpOffice\PhpSpreadsheet\Writer\Excel5\Font[]
|
* @var \PhpOffice\PhpSpreadsheet\Writer\Xls\Font[]
|
||||||
*/
|
*/
|
||||||
private $fontWriters = [];
|
private $fontWriters = [];
|
||||||
|
|
||||||
|
@ -295,7 +295,7 @@ class Workbook extends BIFFwriter
|
||||||
$countFonts = count($this->fontWriters);
|
$countFonts = count($this->fontWriters);
|
||||||
$fontIndex = ($countFonts < 4) ? $countFonts : $countFonts + 1;
|
$fontIndex = ($countFonts < 4) ? $countFonts : $countFonts + 1;
|
||||||
|
|
||||||
$fontWriter = new \PhpOffice\PhpSpreadsheet\Writer\Excel5\Font($font);
|
$fontWriter = new \PhpOffice\PhpSpreadsheet\Writer\Xls\Font($font);
|
||||||
$fontWriter->setColorIndex($this->addColor($font->getColor()->getRGB()));
|
$fontWriter->setColorIndex($this->addColor($font->getColor()->getRGB()));
|
||||||
$this->fontWriters[] = $fontWriter;
|
$this->fontWriters[] = $fontWriter;
|
||||||
|
|
||||||
|
@ -1401,7 +1401,7 @@ class Workbook extends BIFFwriter
|
||||||
{
|
{
|
||||||
// write the Escher stream if necessary
|
// write the Escher stream if necessary
|
||||||
if (isset($this->escher)) {
|
if (isset($this->escher)) {
|
||||||
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Excel5\Escher($this->escher);
|
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xls\Escher($this->escher);
|
||||||
$data = $writer->close();
|
$data = $writer->close();
|
||||||
|
|
||||||
$record = 0x00EB;
|
$record = 0x00EB;
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel5;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xls;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2015 PhpSpreadsheet
|
* Copyright (c) 2006 - 2015 PhpSpreadsheet
|
||||||
|
@ -64,7 +64,7 @@ class Worksheet extends BIFFwriter
|
||||||
/**
|
/**
|
||||||
* Formula parser
|
* Formula parser
|
||||||
*
|
*
|
||||||
* @var \PhpOffice\PhpSpreadsheet\Writer\Excel5\Parser
|
* @var \PhpOffice\PhpSpreadsheet\Writer\Xls\Parser
|
||||||
*/
|
*/
|
||||||
private $parser;
|
private $parser;
|
||||||
|
|
||||||
|
@ -255,7 +255,7 @@ class Worksheet extends BIFFwriter
|
||||||
* Add data to the beginning of the workbook (note the reverse order)
|
* Add data to the beginning of the workbook (note the reverse order)
|
||||||
* and to the end of the workbook.
|
* and to the end of the workbook.
|
||||||
*
|
*
|
||||||
* @see \PhpOffice\PhpSpreadsheet\Writer\Excel5\Workbook::storeWorkbook()
|
* @see \PhpOffice\PhpSpreadsheet\Writer\Xls\Workbook::storeWorkbook()
|
||||||
*/
|
*/
|
||||||
public function close()
|
public function close()
|
||||||
{
|
{
|
||||||
|
@ -2372,10 +2372,10 @@ class Worksheet extends BIFFwriter
|
||||||
$row_end = $row_start; // Row containing bottom right corner of object
|
$row_end = $row_start; // Row containing bottom right corner of object
|
||||||
|
|
||||||
// Zero the specified offset if greater than the cell dimensions
|
// Zero the specified offset if greater than the cell dimensions
|
||||||
if ($x1 >= \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_start))) {
|
if ($x1 >= \PhpOffice\PhpSpreadsheet\Shared\Xls::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_start))) {
|
||||||
$x1 = 0;
|
$x1 = 0;
|
||||||
}
|
}
|
||||||
if ($y1 >= \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_start + 1)) {
|
if ($y1 >= \PhpOffice\PhpSpreadsheet\Shared\Xls::sizeRow($this->phpSheet, $row_start + 1)) {
|
||||||
$y1 = 0;
|
$y1 = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2383,38 +2383,38 @@ class Worksheet extends BIFFwriter
|
||||||
$height = $height + $y1 - 1;
|
$height = $height + $y1 - 1;
|
||||||
|
|
||||||
// Subtract the underlying cell widths to find the end cell of the image
|
// Subtract the underlying cell widths to find the end cell of the image
|
||||||
while ($width >= \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_end))) {
|
while ($width >= \PhpOffice\PhpSpreadsheet\Shared\Xls::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_end))) {
|
||||||
$width -= \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_end));
|
$width -= \PhpOffice\PhpSpreadsheet\Shared\Xls::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_end));
|
||||||
++$col_end;
|
++$col_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Subtract the underlying cell heights to find the end cell of the image
|
// Subtract the underlying cell heights to find the end cell of the image
|
||||||
while ($height >= \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1)) {
|
while ($height >= \PhpOffice\PhpSpreadsheet\Shared\Xls::sizeRow($this->phpSheet, $row_end + 1)) {
|
||||||
$height -= \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1);
|
$height -= \PhpOffice\PhpSpreadsheet\Shared\Xls::sizeRow($this->phpSheet, $row_end + 1);
|
||||||
++$row_end;
|
++$row_end;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bitmap isn't allowed to start or finish in a hidden cell, i.e. a cell
|
// Bitmap isn't allowed to start or finish in a hidden cell, i.e. a cell
|
||||||
// with zero eight or width.
|
// with zero eight or width.
|
||||||
//
|
//
|
||||||
if (\PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) == 0) {
|
if (\PhpOffice\PhpSpreadsheet\Shared\Xls::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (\PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) == 0) {
|
if (\PhpOffice\PhpSpreadsheet\Shared\Xls::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (\PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_start + 1) == 0) {
|
if (\PhpOffice\PhpSpreadsheet\Shared\Xls::sizeRow($this->phpSheet, $row_start + 1) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (\PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1) == 0) {
|
if (\PhpOffice\PhpSpreadsheet\Shared\Xls::sizeRow($this->phpSheet, $row_end + 1) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert the pixel values to the percentage value expected by Excel
|
// Convert the pixel values to the percentage value expected by Excel
|
||||||
$x1 = $x1 / \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) * 1024;
|
$x1 = $x1 / \PhpOffice\PhpSpreadsheet\Shared\Xls::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_start)) * 1024;
|
||||||
$y1 = $y1 / \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_start + 1) * 256;
|
$y1 = $y1 / \PhpOffice\PhpSpreadsheet\Shared\Xls::sizeRow($this->phpSheet, $row_start + 1) * 256;
|
||||||
$x2 = $width / \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object
|
$x2 = $width / \PhpOffice\PhpSpreadsheet\Shared\Xls::sizeCol($this->phpSheet, \PhpOffice\PhpSpreadsheet\Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object
|
||||||
$y2 = $height / \PhpOffice\PhpSpreadsheet\Shared\Excel5::sizeRow($this->phpSheet, $row_end + 1) * 256; // Distance to bottom of object
|
$y2 = $height / \PhpOffice\PhpSpreadsheet\Shared\Xls::sizeRow($this->phpSheet, $row_end + 1) * 256; // Distance to bottom of object
|
||||||
|
|
||||||
$this->writeObjPicture($col_start, $x1, $row_start, $y1, $col_end, $x2, $row_end, $y2);
|
$this->writeObjPicture($col_start, $x1, $row_start, $y1, $col_end, $x2, $row_end, $y2);
|
||||||
}
|
}
|
||||||
|
@ -2656,7 +2656,7 @@ class Worksheet extends BIFFwriter
|
||||||
{
|
{
|
||||||
// write the Escher stream if necessary
|
// write the Escher stream if necessary
|
||||||
if (isset($this->escher)) {
|
if (isset($this->escher)) {
|
||||||
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Excel5\Escher($this->escher);
|
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xls\Escher($this->escher);
|
||||||
$data = $writer->close();
|
$data = $writer->close();
|
||||||
$spOffsets = $writer->getSpOffsets();
|
$spOffsets = $writer->getSpOffsets();
|
||||||
$spTypes = $writer->getSpTypes();
|
$spTypes = $writer->getSpTypes();
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel5;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xls;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2015 PhpSpreadsheet
|
* Copyright (c) 2006 - 2015 PhpSpreadsheet
|
Loading…
Reference in New Issue