@@ -21,28 +21,28 @@ |
||
21 | 21 | |
22 | 22 | foreach($exampleTypeList as $exampleType) { |
23 | 23 | |
24 | - echo '<h1>PHPExcel ' . pathinfo($exampleType,PATHINFO_BASENAME) . ' Examples</h1>'; |
|
24 | + echo '<h1>PHPExcel ' . pathinfo($exampleType,PATHINFO_BASENAME) . ' Examples</h1>'; |
|
25 | 25 | |
26 | - $exampleList = glob('./'.$exampleType.'/*.php'); |
|
26 | + $exampleList = glob('./'.$exampleType.'/*.php'); |
|
27 | 27 | |
28 | - foreach($exampleList as $exampleFile) { |
|
29 | - $fileData = file_get_contents($exampleFile); |
|
28 | + foreach($exampleList as $exampleFile) { |
|
29 | + $fileData = file_get_contents($exampleFile); |
|
30 | 30 | |
31 | - $h1Pattern = '#<h1>(.*?)</h1>#'; |
|
32 | - $h2Pattern = '#<h2>(.*?)</h2>#'; |
|
31 | + $h1Pattern = '#<h1>(.*?)</h1>#'; |
|
32 | + $h2Pattern = '#<h2>(.*?)</h2>#'; |
|
33 | 33 | |
34 | - if (preg_match($h1Pattern, $fileData, $out)) { |
|
35 | - $h1Text = $out[1]; |
|
36 | - $h2Text = (preg_match($h2Pattern, $fileData, $out)) ? $out[1] : ''; |
|
34 | + if (preg_match($h1Pattern, $fileData, $out)) { |
|
35 | + $h1Text = $out[1]; |
|
36 | + $h2Text = (preg_match($h2Pattern, $fileData, $out)) ? $out[1] : ''; |
|
37 | 37 | |
38 | - echo '<a href="',$exampleFile,'">',$h1Text,'</a><br />'; |
|
39 | - if (($h2Text > '') && |
|
40 | - (pathinfo($exampleType,PATHINFO_BASENAME) != 'Calculations')) { |
|
41 | - echo $h2Text,'<br />'; |
|
42 | - } |
|
43 | - } |
|
38 | + echo '<a href="',$exampleFile,'">',$h1Text,'</a><br />'; |
|
39 | + if (($h2Text > '') && |
|
40 | + (pathinfo($exampleType,PATHINFO_BASENAME) != 'Calculations')) { |
|
41 | + echo $h2Text,'<br />'; |
|
42 | + } |
|
43 | + } |
|
44 | 44 | |
45 | - } |
|
45 | + } |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | ?> |
@@ -17,15 +17,15 @@ discard block |
||
17 | 17 | |
18 | 18 | <?php |
19 | 19 | |
20 | -$exampleTypeList = glob('./*',GLOB_ONLYDIR); |
|
20 | +$exampleTypeList = glob('./*', GLOB_ONLYDIR); |
|
21 | 21 | |
22 | -foreach($exampleTypeList as $exampleType) { |
|
22 | +foreach ($exampleTypeList as $exampleType) { |
|
23 | 23 | |
24 | - echo '<h1>PHPExcel ' . pathinfo($exampleType,PATHINFO_BASENAME) . ' Examples</h1>'; |
|
24 | + echo '<h1>PHPExcel ' . pathinfo($exampleType, PATHINFO_BASENAME) . ' Examples</h1>'; |
|
25 | 25 | |
26 | - $exampleList = glob('./'.$exampleType.'/*.php'); |
|
26 | + $exampleList = glob('./' . $exampleType . '/*.php'); |
|
27 | 27 | |
28 | - foreach($exampleList as $exampleFile) { |
|
28 | + foreach ($exampleList as $exampleFile) { |
|
29 | 29 | $fileData = file_get_contents($exampleFile); |
30 | 30 | |
31 | 31 | $h1Pattern = '#<h1>(.*?)</h1>#'; |
@@ -35,10 +35,10 @@ discard block |
||
35 | 35 | $h1Text = $out[1]; |
36 | 36 | $h2Text = (preg_match($h2Pattern, $fileData, $out)) ? $out[1] : ''; |
37 | 37 | |
38 | - echo '<a href="',$exampleFile,'">',$h1Text,'</a><br />'; |
|
38 | + echo '<a href="', $exampleFile, '">', $h1Text, '</a><br />'; |
|
39 | 39 | if (($h2Text > '') && |
40 | - (pathinfo($exampleType,PATHINFO_BASENAME) != 'Calculations')) { |
|
41 | - echo $h2Text,'<br />'; |
|
40 | + (pathinfo($exampleType, PATHINFO_BASENAME) != 'Calculations')) { |
|
41 | + echo $h2Text, '<br />'; |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | |
55 | 55 | if (is_numeric($field)) { |
56 | 56 | $keys = array_keys($fieldNames); |
57 | - return $keys[$field-1]; |
|
57 | + return $keys[$field - 1]; |
|
58 | 58 | } |
59 | 59 | $key = array_search($field, $fieldNames); |
60 | 60 | return ($key) ? $key : null; |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $testConditionCount = 0; |
93 | 93 | foreach ($criteria as $row => $criterion) { |
94 | 94 | if ($criterion[$key] > '') { |
95 | - $testCondition[] = '[:'.$criteriaName.']'.Functions::ifCondition($criterion[$key]); |
|
95 | + $testCondition[] = '[:' . $criteriaName . ']' . Functions::ifCondition($criterion[$key]); |
|
96 | 96 | $testConditionCount++; |
97 | 97 | } |
98 | 98 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } |
125 | 125 | } |
126 | 126 | // evaluate the criteria against the row data |
127 | - $result = \PHPExcel\Calculation::getInstance()->_calculateFormulaValue('='.$testConditionList); |
|
127 | + $result = \PHPExcel\Calculation::getInstance()->_calculateFormulaValue('=' . $testConditionList); |
|
128 | 128 | // If the row failed to meet the criteria, remove it from the database |
129 | 129 | if (!$result) { |
130 | 130 | unset($database[$dataRow]); |
@@ -41,117 +41,117 @@ |
||
41 | 41 | { |
42 | 42 | switch ($codePage) { |
43 | 43 | case 367: |
44 | - return 'ASCII'; // ASCII |
|
44 | + return 'ASCII'; // ASCII |
|
45 | 45 | case 437: |
46 | - return 'CP437'; // OEM US |
|
46 | + return 'CP437'; // OEM US |
|
47 | 47 | case 720: |
48 | - throw new \PHPExcel\Exception('Code page 720 not supported.'); // OEM Arabic |
|
48 | + throw new \PHPExcel\Exception('Code page 720 not supported.'); // OEM Arabic |
|
49 | 49 | case 737: |
50 | - return 'CP737'; // OEM Greek |
|
50 | + return 'CP737'; // OEM Greek |
|
51 | 51 | case 775: |
52 | - return 'CP775'; // OEM Baltic |
|
52 | + return 'CP775'; // OEM Baltic |
|
53 | 53 | case 850: |
54 | - return 'CP850'; // OEM Latin I |
|
54 | + return 'CP850'; // OEM Latin I |
|
55 | 55 | case 852: |
56 | - return 'CP852'; // OEM Latin II (Central European) |
|
56 | + return 'CP852'; // OEM Latin II (Central European) |
|
57 | 57 | case 855: |
58 | - return 'CP855'; // OEM Cyrillic |
|
58 | + return 'CP855'; // OEM Cyrillic |
|
59 | 59 | case 857: |
60 | - return 'CP857'; // OEM Turkish |
|
60 | + return 'CP857'; // OEM Turkish |
|
61 | 61 | case 858: |
62 | - return 'CP858'; // OEM Multilingual Latin I with Euro |
|
62 | + return 'CP858'; // OEM Multilingual Latin I with Euro |
|
63 | 63 | case 860: |
64 | - return 'CP860'; // OEM Portugese |
|
64 | + return 'CP860'; // OEM Portugese |
|
65 | 65 | case 861: |
66 | - return 'CP861'; // OEM Icelandic |
|
66 | + return 'CP861'; // OEM Icelandic |
|
67 | 67 | case 862: |
68 | - return 'CP862'; // OEM Hebrew |
|
68 | + return 'CP862'; // OEM Hebrew |
|
69 | 69 | case 863: |
70 | - return 'CP863'; // OEM Canadian (French) |
|
70 | + return 'CP863'; // OEM Canadian (French) |
|
71 | 71 | case 864: |
72 | - return 'CP864'; // OEM Arabic |
|
72 | + return 'CP864'; // OEM Arabic |
|
73 | 73 | case 865: |
74 | - return 'CP865'; // OEM Nordic |
|
74 | + return 'CP865'; // OEM Nordic |
|
75 | 75 | case 866: |
76 | - return 'CP866'; // OEM Cyrillic (Russian) |
|
76 | + return 'CP866'; // OEM Cyrillic (Russian) |
|
77 | 77 | case 869: |
78 | - return 'CP869'; // OEM Greek (Modern) |
|
78 | + return 'CP869'; // OEM Greek (Modern) |
|
79 | 79 | case 874: |
80 | - return 'CP874'; // ANSI Thai |
|
80 | + return 'CP874'; // ANSI Thai |
|
81 | 81 | case 932: |
82 | - return 'CP932'; // ANSI Japanese Shift-JIS |
|
82 | + return 'CP932'; // ANSI Japanese Shift-JIS |
|
83 | 83 | case 936: |
84 | - return 'CP936'; // ANSI Chinese Simplified GBK |
|
84 | + return 'CP936'; // ANSI Chinese Simplified GBK |
|
85 | 85 | case 949: |
86 | - return 'CP949'; // ANSI Korean (Wansung) |
|
86 | + return 'CP949'; // ANSI Korean (Wansung) |
|
87 | 87 | case 950: |
88 | - return 'CP950'; // ANSI Chinese Traditional BIG5 |
|
88 | + return 'CP950'; // ANSI Chinese Traditional BIG5 |
|
89 | 89 | case 1200: |
90 | 90 | return 'UTF-16LE'; // UTF-16 (BIFF8) |
91 | 91 | case 1250: |
92 | - return 'CP1250'; // ANSI Latin II (Central European) |
|
92 | + return 'CP1250'; // ANSI Latin II (Central European) |
|
93 | 93 | case 1251: |
94 | - return 'CP1251'; // ANSI Cyrillic |
|
94 | + return 'CP1251'; // ANSI Cyrillic |
|
95 | 95 | case 0: |
96 | 96 | // CodePage is not always correctly set when the xls file was saved by Apple's Numbers program |
97 | 97 | case 1252: |
98 | - return 'CP1252'; // ANSI Latin I (BIFF4-BIFF7) |
|
98 | + return 'CP1252'; // ANSI Latin I (BIFF4-BIFF7) |
|
99 | 99 | case 1253: |
100 | - return 'CP1253'; // ANSI Greek |
|
100 | + return 'CP1253'; // ANSI Greek |
|
101 | 101 | case 1254: |
102 | - return 'CP1254'; // ANSI Turkish |
|
102 | + return 'CP1254'; // ANSI Turkish |
|
103 | 103 | case 1255: |
104 | - return 'CP1255'; // ANSI Hebrew |
|
104 | + return 'CP1255'; // ANSI Hebrew |
|
105 | 105 | case 1256: |
106 | - return 'CP1256'; // ANSI Arabic |
|
106 | + return 'CP1256'; // ANSI Arabic |
|
107 | 107 | case 1257: |
108 | - return 'CP1257'; // ANSI Baltic |
|
108 | + return 'CP1257'; // ANSI Baltic |
|
109 | 109 | case 1258: |
110 | - return 'CP1258'; // ANSI Vietnamese |
|
110 | + return 'CP1258'; // ANSI Vietnamese |
|
111 | 111 | case 1361: |
112 | - return 'CP1361'; // ANSI Korean (Johab) |
|
112 | + return 'CP1361'; // ANSI Korean (Johab) |
|
113 | 113 | case 10000: |
114 | - return 'MAC'; // Apple Roman |
|
114 | + return 'MAC'; // Apple Roman |
|
115 | 115 | case 10001: |
116 | - return 'CP932'; // Macintosh Japanese |
|
116 | + return 'CP932'; // Macintosh Japanese |
|
117 | 117 | case 10002: |
118 | - return 'CP950'; // Macintosh Chinese Traditional |
|
118 | + return 'CP950'; // Macintosh Chinese Traditional |
|
119 | 119 | case 10003: |
120 | - return 'CP1361'; // Macintosh Korean |
|
120 | + return 'CP1361'; // Macintosh Korean |
|
121 | 121 | case 10004: |
122 | 122 | return 'MACARABIC'; // Apple Arabic |
123 | 123 | case 10005: |
124 | 124 | return 'MACHEBREW'; // Apple Hebrew |
125 | 125 | case 10006: |
126 | - return 'MACGREEK'; // Macintosh Greek |
|
126 | + return 'MACGREEK'; // Macintosh Greek |
|
127 | 127 | case 10007: |
128 | - return 'MACCYRILLIC'; // Macintosh Cyrillic |
|
128 | + return 'MACCYRILLIC'; // Macintosh Cyrillic |
|
129 | 129 | case 10008: |
130 | - return 'CP936'; // Macintosh - Simplified Chinese (GB 2312) |
|
130 | + return 'CP936'; // Macintosh - Simplified Chinese (GB 2312) |
|
131 | 131 | case 10010: |
132 | - return 'MACROMANIA'; // Macintosh Romania |
|
132 | + return 'MACROMANIA'; // Macintosh Romania |
|
133 | 133 | case 10017: |
134 | - return 'MACUKRAINE'; // Macintosh Ukraine |
|
134 | + return 'MACUKRAINE'; // Macintosh Ukraine |
|
135 | 135 | case 10021: |
136 | - return 'MACTHAI'; // Macintosh Thai |
|
136 | + return 'MACTHAI'; // Macintosh Thai |
|
137 | 137 | case 10029: |
138 | - return 'MACCENTRALEUROPE'; // Macintosh Central Europe |
|
138 | + return 'MACCENTRALEUROPE'; // Macintosh Central Europe |
|
139 | 139 | case 10079: |
140 | - return 'MACICELAND'; // Macintosh Icelandic |
|
140 | + return 'MACICELAND'; // Macintosh Icelandic |
|
141 | 141 | case 10081: |
142 | - return 'MACTURKISH'; // Macintosh Turkish |
|
142 | + return 'MACTURKISH'; // Macintosh Turkish |
|
143 | 143 | case 10082: |
144 | - return 'MACCROATIAN'; // Macintosh Croatian |
|
144 | + return 'MACCROATIAN'; // Macintosh Croatian |
|
145 | 145 | case 21010: |
146 | - return 'UTF-16LE'; // UTF-16 (BIFF8) This isn't correct, but some Excel writer libraries erroneously use Codepage 21010 for UTF-16LE |
|
146 | + return 'UTF-16LE'; // UTF-16 (BIFF8) This isn't correct, but some Excel writer libraries erroneously use Codepage 21010 for UTF-16LE |
|
147 | 147 | case 32768: |
148 | - return 'MAC'; // Apple Roman |
|
148 | + return 'MAC'; // Apple Roman |
|
149 | 149 | case 32769: |
150 | - throw new \PHPExcel\Exception('Code page 32769 not supported.'); // ANSI Latin I (BIFF2-BIFF3) |
|
150 | + throw new \PHPExcel\Exception('Code page 32769 not supported.'); // ANSI Latin I (BIFF2-BIFF3) |
|
151 | 151 | case 65000: |
152 | - return 'UTF-7'; // Unicode (UTF-7) |
|
152 | + return 'UTF-7'; // Unicode (UTF-7) |
|
153 | 153 | case 65001: |
154 | - return 'UTF-8'; // Unicode (UTF-8) |
|
154 | + return 'UTF-8'; // Unicode (UTF-8) |
|
155 | 155 | } |
156 | 156 | throw new \PHPExcel\Exception('Unknown codepage: ' . $codePage); |
157 | 157 | } |
@@ -61,11 +61,11 @@ |
||
61 | 61 | |
62 | 62 | |
63 | 63 | /** |
64 | - * Verify if a file exists |
|
65 | - * |
|
66 | - * @param string $pFilename Filename |
|
67 | - * @return bool |
|
68 | - */ |
|
64 | + * Verify if a file exists |
|
65 | + * |
|
66 | + * @param string $pFilename Filename |
|
67 | + * @return bool |
|
68 | + */ |
|
69 | 69 | public static function fileExists($pFilename) |
70 | 70 | { |
71 | 71 | // Sick construction, but it seems that |
@@ -36,9 +36,9 @@ |
||
36 | 36 | private $m; |
37 | 37 | |
38 | 38 | /** |
39 | - * Column dimension. |
|
40 | - * @var integer |
|
41 | - */ |
|
39 | + * Column dimension. |
|
40 | + * @var integer |
|
41 | + */ |
|
42 | 42 | private $n; |
43 | 43 | |
44 | 44 | /** |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | class QRDecomposition |
23 | 23 | { |
24 | - const MATRIX_RANK_EXCEPTION = "Can only perform operation on full-rank matrix."; |
|
24 | + const MATRIX_RANK_EXCEPTION = "Can only perform operation on full-rank matrix."; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Array for internal storage of decomposition. |
@@ -78,12 +78,12 @@ discard block |
||
78 | 78 | } |
79 | 79 | $this->QR[$k][$k] += 1.0; |
80 | 80 | // Apply transformation to remaining columns. |
81 | - for ($j = $k+1; $j < $this->n; ++$j) { |
|
81 | + for ($j = $k + 1; $j < $this->n; ++$j) { |
|
82 | 82 | $s = 0.0; |
83 | 83 | for ($i = $k; $i < $this->m; ++$i) { |
84 | 84 | $s += $this->QR[$i][$k] * $this->QR[$i][$j]; |
85 | 85 | } |
86 | - $s = -$s/$this->QR[$k][$k]; |
|
86 | + $s = -$s / $this->QR[$k][$k]; |
|
87 | 87 | for ($i = $k; $i < $this->m; ++$i) { |
88 | 88 | $this->QR[$i][$j] += $s * $this->QR[$i][$k]; |
89 | 89 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | */ |
160 | 160 | public function getQ() |
161 | 161 | { |
162 | - for ($k = $this->n-1; $k >= 0; --$k) { |
|
162 | + for ($k = $this->n - 1; $k >= 0; --$k) { |
|
163 | 163 | for ($i = 0; $i < $this->m; ++$i) { |
164 | 164 | $Q[$i][$k] = 0.0; |
165 | 165 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | for ($i = $k; $i < $this->m; ++$i) { |
171 | 171 | $s += $this->QR[$i][$k] * $Q[$i][$j]; |
172 | 172 | } |
173 | - $s = -$s/$this->QR[$k][$k]; |
|
173 | + $s = -$s / $this->QR[$k][$k]; |
|
174 | 174 | for ($i = $k; $i < $this->m; ++$i) { |
175 | 175 | $Q[$i][$j] += $s * $this->QR[$i][$k]; |
176 | 176 | } |
@@ -209,25 +209,25 @@ discard block |
||
209 | 209 | for ($i = $k; $i < $this->m; ++$i) { |
210 | 210 | $s += $this->QR[$i][$k] * $X[$i][$j]; |
211 | 211 | } |
212 | - $s = -$s/$this->QR[$k][$k]; |
|
212 | + $s = -$s / $this->QR[$k][$k]; |
|
213 | 213 | for ($i = $k; $i < $this->m; ++$i) { |
214 | 214 | $X[$i][$j] += $s * $this->QR[$i][$k]; |
215 | 215 | } |
216 | 216 | } |
217 | 217 | } |
218 | 218 | // Solve R*X = Y; |
219 | - for ($k = $this->n-1; $k >= 0; --$k) { |
|
219 | + for ($k = $this->n - 1; $k >= 0; --$k) { |
|
220 | 220 | for ($j = 0; $j < $nx; ++$j) { |
221 | 221 | $X[$k][$j] /= $this->Rdiag[$k]; |
222 | 222 | } |
223 | 223 | for ($i = 0; $i < $k; ++$i) { |
224 | 224 | for ($j = 0; $j < $nx; ++$j) { |
225 | - $X[$i][$j] -= $X[$k][$j]* $this->QR[$i][$k]; |
|
225 | + $X[$i][$j] -= $X[$k][$j] * $this->QR[$i][$k]; |
|
226 | 226 | } |
227 | 227 | } |
228 | 228 | } |
229 | 229 | $X = new Matrix($X); |
230 | - return ($X->getMatrix(0, $this->n-1, 0, $nx)); |
|
230 | + return ($X->getMatrix(0, $this->n - 1, 0, $nx)); |
|
231 | 231 | } else { |
232 | 232 | throw new \PHPExcel\Calculation\Exception(self::MATRIX_RANK_EXCEPTION); |
233 | 233 | } |
@@ -71,7 +71,7 @@ |
||
71 | 71 | } |
72 | 72 | } |
73 | 73 | |
74 | - for ($k = $i+1; $k < $this->m; ++$k) { |
|
74 | + for ($k = $i + 1; $k < $this->m; ++$k) { |
|
75 | 75 | $this->L[$i][$k] = 0.0; |
76 | 76 | } |
77 | 77 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | * @param \PHPExcel\Worksheet $sheet The sheet |
38 | 38 | * @param string $col The column |
39 | 39 | * @return integer The width in pixels |
40 | - */ |
|
40 | + */ |
|
41 | 41 | public static function sizeCol($sheet, $col = 'A') |
42 | 42 | { |
43 | 43 | // default font of the workbook |
@@ -236,8 +236,8 @@ discard block |
||
236 | 236 | $y1 = $offsetY; |
237 | 237 | |
238 | 238 | // Initialise end cell to the same as the start cell |
239 | - $col_end = $col_start; // Col containing lower right corner of object |
|
240 | - $row_end = $row_start; // Row containing bottom right corner of object |
|
239 | + $col_end = $col_start; // Col containing lower right corner of object |
|
240 | + $row_end = $row_start; // Row containing bottom right corner of object |
|
241 | 241 | |
242 | 242 | // Zero the specified offset if greater than the cell dimensions |
243 | 243 | if ($x1 >= self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_start))) { |
@@ -247,8 +247,8 @@ discard block |
||
247 | 247 | $y1 = 0; |
248 | 248 | } |
249 | 249 | |
250 | - $width = $width + $x1 -1; |
|
251 | - $height = $height + $y1 -1; |
|
250 | + $width = $width + $x1 - 1; |
|
251 | + $height = $height + $y1 - 1; |
|
252 | 252 | |
253 | 253 | // Subtract the underlying cell widths to find the end cell of the image |
254 | 254 | while ($width >= self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end))) { |
@@ -267,21 +267,21 @@ discard block |
||
267 | 267 | if (self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_start)) == 0) { |
268 | 268 | return; |
269 | 269 | } |
270 | - if (self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end)) == 0) { |
|
270 | + if (self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end)) == 0) { |
|
271 | 271 | return; |
272 | 272 | } |
273 | 273 | if (self::sizeRow($sheet, $row_start + 1) == 0) { |
274 | 274 | return; |
275 | 275 | } |
276 | - if (self::sizeRow($sheet, $row_end + 1) == 0) { |
|
276 | + if (self::sizeRow($sheet, $row_end + 1) == 0) { |
|
277 | 277 | return; |
278 | 278 | } |
279 | 279 | |
280 | 280 | // Convert the pixel values to the percentage value expected by Excel |
281 | - $x1 = $x1 / self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_start)) * 1024; |
|
282 | - $y1 = $y1 / self::sizeRow($sheet, $row_start + 1) * 256; |
|
283 | - $x2 = ($width + 1) / self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object |
|
284 | - $y2 = ($height + 1) / self::sizeRow($sheet, $row_end + 1) * 256; // Distance to bottom of object |
|
281 | + $x1 = $x1 / self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_start)) * 1024; |
|
282 | + $y1 = $y1 / self::sizeRow($sheet, $row_start + 1) * 256; |
|
283 | + $x2 = ($width + 1) / self::sizeCol($sheet, \PHPExcel\Cell::stringFromColumnIndex($col_end)) * 1024; // Distance to right side of object |
|
284 | + $y2 = ($height + 1) / self::sizeRow($sheet, $row_end + 1) * 256; // Distance to bottom of object |
|
285 | 285 | |
286 | 286 | $startCoordinates = \PHPExcel\Cell::stringFromColumnIndex($col_start) . ($row_start + 1); |
287 | 287 | $endCoordinates = \PHPExcel\Cell::stringFromColumnIndex($col_end) . ($row_end + 1); |
@@ -33,98 +33,98 @@ discard block |
||
33 | 33 | class PPS |
34 | 34 | { |
35 | 35 | /** |
36 | - * The PPS index |
|
37 | - * @var integer |
|
38 | - */ |
|
36 | + * The PPS index |
|
37 | + * @var integer |
|
38 | + */ |
|
39 | 39 | public $No; |
40 | 40 | |
41 | 41 | /** |
42 | - * The PPS name (in Unicode) |
|
43 | - * @var string |
|
44 | - */ |
|
42 | + * The PPS name (in Unicode) |
|
43 | + * @var string |
|
44 | + */ |
|
45 | 45 | public $Name; |
46 | 46 | |
47 | 47 | /** |
48 | - * The PPS type. Dir, Root or File |
|
49 | - * @var integer |
|
50 | - */ |
|
48 | + * The PPS type. Dir, Root or File |
|
49 | + * @var integer |
|
50 | + */ |
|
51 | 51 | public $Type; |
52 | 52 | |
53 | 53 | /** |
54 | - * The index of the previous PPS |
|
55 | - * @var integer |
|
56 | - */ |
|
54 | + * The index of the previous PPS |
|
55 | + * @var integer |
|
56 | + */ |
|
57 | 57 | public $PrevPps; |
58 | 58 | |
59 | 59 | /** |
60 | - * The index of the next PPS |
|
61 | - * @var integer |
|
62 | - */ |
|
60 | + * The index of the next PPS |
|
61 | + * @var integer |
|
62 | + */ |
|
63 | 63 | public $NextPps; |
64 | 64 | |
65 | 65 | /** |
66 | - * The index of it's first child if this is a Dir or Root PPS |
|
67 | - * @var integer |
|
68 | - */ |
|
66 | + * The index of it's first child if this is a Dir or Root PPS |
|
67 | + * @var integer |
|
68 | + */ |
|
69 | 69 | public $DirPps; |
70 | 70 | |
71 | 71 | /** |
72 | - * A timestamp |
|
73 | - * @var integer |
|
74 | - */ |
|
72 | + * A timestamp |
|
73 | + * @var integer |
|
74 | + */ |
|
75 | 75 | public $Time1st; |
76 | 76 | |
77 | 77 | /** |
78 | - * A timestamp |
|
79 | - * @var integer |
|
80 | - */ |
|
78 | + * A timestamp |
|
79 | + * @var integer |
|
80 | + */ |
|
81 | 81 | public $Time2nd; |
82 | 82 | |
83 | 83 | /** |
84 | - * Starting block (small or big) for this PPS's data inside the container |
|
85 | - * @var integer |
|
86 | - */ |
|
84 | + * Starting block (small or big) for this PPS's data inside the container |
|
85 | + * @var integer |
|
86 | + */ |
|
87 | 87 | public $startBlock; |
88 | 88 | |
89 | 89 | /** |
90 | - * The size of the PPS's data (in bytes) |
|
91 | - * @var integer |
|
92 | - */ |
|
90 | + * The size of the PPS's data (in bytes) |
|
91 | + * @var integer |
|
92 | + */ |
|
93 | 93 | public $Size; |
94 | 94 | |
95 | 95 | /** |
96 | - * The PPS's data (only used if it's not using a temporary file) |
|
97 | - * @var string |
|
98 | - */ |
|
96 | + * The PPS's data (only used if it's not using a temporary file) |
|
97 | + * @var string |
|
98 | + */ |
|
99 | 99 | public $_data; |
100 | 100 | |
101 | 101 | /** |
102 | - * Array of child PPS's (only used by Root and Dir PPS's) |
|
103 | - * @var array |
|
104 | - */ |
|
102 | + * Array of child PPS's (only used by Root and Dir PPS's) |
|
103 | + * @var array |
|
104 | + */ |
|
105 | 105 | public $children = array(); |
106 | 106 | |
107 | 107 | /** |
108 | - * Pointer to OLE container |
|
109 | - * @var OLE |
|
110 | - */ |
|
108 | + * Pointer to OLE container |
|
109 | + * @var OLE |
|
110 | + */ |
|
111 | 111 | public $ole; |
112 | 112 | |
113 | 113 | /** |
114 | - * The constructor |
|
115 | - * |
|
116 | - * @access public |
|
117 | - * @param integer $No The PPS index |
|
118 | - * @param string $name The PPS name |
|
119 | - * @param integer $type The PPS type. Dir, Root or File |
|
120 | - * @param integer $prev The index of the previous PPS |
|
121 | - * @param integer $next The index of the next PPS |
|
122 | - * @param integer $dir The index of it's first child if this is a Dir or Root PPS |
|
123 | - * @param integer $time_1st A timestamp |
|
124 | - * @param integer $time_2nd A timestamp |
|
125 | - * @param string $data The (usually binary) source data of the PPS |
|
126 | - * @param array $children Array containing children PPS for this PPS |
|
127 | - */ |
|
114 | + * The constructor |
|
115 | + * |
|
116 | + * @access public |
|
117 | + * @param integer $No The PPS index |
|
118 | + * @param string $name The PPS name |
|
119 | + * @param integer $type The PPS type. Dir, Root or File |
|
120 | + * @param integer $prev The index of the previous PPS |
|
121 | + * @param integer $next The index of the next PPS |
|
122 | + * @param integer $dir The index of it's first child if this is a Dir or Root PPS |
|
123 | + * @param integer $time_1st A timestamp |
|
124 | + * @param integer $time_2nd A timestamp |
|
125 | + * @param string $data The (usually binary) source data of the PPS |
|
126 | + * @param array $children Array containing children PPS for this PPS |
|
127 | + */ |
|
128 | 128 | public function __construct($No, $name, $type, $prev, $next, $dir, $time_1st, $time_2nd, $data, $children) |
129 | 129 | { |
130 | 130 | $this->No = $No; |
@@ -145,11 +145,11 @@ discard block |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
148 | - * Returns the amount of data saved for this PPS |
|
149 | - * |
|
150 | - * @access public |
|
151 | - * @return integer The amount of data (in bytes) |
|
152 | - */ |
|
148 | + * Returns the amount of data saved for this PPS |
|
149 | + * |
|
150 | + * @access public |
|
151 | + * @return integer The amount of data (in bytes) |
|
152 | + */ |
|
153 | 153 | public function getDataLen() |
154 | 154 | { |
155 | 155 | if (!isset($this->_data)) { |
@@ -165,43 +165,43 @@ discard block |
||
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
168 | - * Returns a string with the PPS's WK (What is a WK?) |
|
169 | - * |
|
170 | - * @access public |
|
171 | - * @return string The binary string |
|
172 | - */ |
|
168 | + * Returns a string with the PPS's WK (What is a WK?) |
|
169 | + * |
|
170 | + * @access public |
|
171 | + * @return string The binary string |
|
172 | + */ |
|
173 | 173 | public function _getPpsWk() |
174 | 174 | { |
175 | 175 | $ret = str_pad($this->Name, 64, "\x00"); |
176 | 176 | |
177 | 177 | $ret .= pack("v", strlen($this->Name) + 2) // 66 |
178 | - . pack("c", $this->Type) // 67 |
|
179 | - . pack("c", 0x00) //UK // 68 |
|
180 | - . pack("V", $this->PrevPps) //Prev // 72 |
|
181 | - . pack("V", $this->NextPps) //Next // 76 |
|
182 | - . pack("V", $this->DirPps) //Dir // 80 |
|
183 | - . "\x00\x09\x02\x00" // 84 |
|
184 | - . "\x00\x00\x00\x00" // 88 |
|
185 | - . "\xc0\x00\x00\x00" // 92 |
|
186 | - . "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root |
|
187 | - . "\x00\x00\x00\x00" // 100 |
|
188 | - . \PHPExcel\Shared\OLE::localDateToOLE($this->Time1st) // 108 |
|
189 | - . \PHPExcel\Shared\OLE::localDateToOLE($this->Time2nd) // 116 |
|
190 | - . pack("V", isset($this->startBlock) ? $this->startBlock : 0) // 120 |
|
191 | - . pack("V", $this->Size) // 124 |
|
192 | - . pack("V", 0); // 128 |
|
178 | + . pack("c", $this->Type) // 67 |
|
179 | + . pack("c", 0x00) //UK // 68 |
|
180 | + . pack("V", $this->PrevPps) //Prev // 72 |
|
181 | + . pack("V", $this->NextPps) //Next // 76 |
|
182 | + . pack("V", $this->DirPps) //Dir // 80 |
|
183 | + . "\x00\x09\x02\x00" // 84 |
|
184 | + . "\x00\x00\x00\x00" // 88 |
|
185 | + . "\xc0\x00\x00\x00" // 92 |
|
186 | + . "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root |
|
187 | + . "\x00\x00\x00\x00" // 100 |
|
188 | + . \PHPExcel\Shared\OLE::localDateToOLE($this->Time1st) // 108 |
|
189 | + . \PHPExcel\Shared\OLE::localDateToOLE($this->Time2nd) // 116 |
|
190 | + . pack("V", isset($this->startBlock) ? $this->startBlock : 0) // 120 |
|
191 | + . pack("V", $this->Size) // 124 |
|
192 | + . pack("V", 0); // 128 |
|
193 | 193 | return $ret; |
194 | 194 | } |
195 | 195 | |
196 | 196 | /** |
197 | - * Updates index and pointers to previous, next and children PPS's for this |
|
198 | - * PPS. I don't think it'll work with Dir PPS's. |
|
199 | - * |
|
200 | - * @access public |
|
201 | - * @param array &$raList Reference to the array of PPS's for the whole OLE |
|
202 | - * container |
|
203 | - * @return integer The index for this PPS |
|
204 | - */ |
|
197 | + * Updates index and pointers to previous, next and children PPS's for this |
|
198 | + * PPS. I don't think it'll work with Dir PPS's. |
|
199 | + * |
|
200 | + * @access public |
|
201 | + * @param array &$raList Reference to the array of PPS's for the whole OLE |
|
202 | + * container |
|
203 | + * @return integer The index for this PPS |
|
204 | + */ |
|
205 | 205 | public static function _savePpsSetPnt(&$raList, $to_save, $depth = 0) |
206 | 206 | { |
207 | 207 | if (!is_array($to_save) || (empty($to_save))) { |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | . \PHPExcel\Shared\OLE::localDateToOLE($this->Time2nd) // 116 |
190 | 190 | . pack("V", isset($this->startBlock) ? $this->startBlock : 0) // 120 |
191 | 191 | . pack("V", $this->Size) // 124 |
192 | - . pack("V", 0); // 128 |
|
192 | + . pack("V", 0); // 128 |
|
193 | 193 | return $ret; |
194 | 194 | } |
195 | 195 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | } elseif (count($to_save) == 1) { |
210 | 210 | $cnt = count($raList); |
211 | 211 | // If the first entry, it's the root... Don't clone it! |
212 | - $raList[$cnt] = ( $depth == 0 ) ? $to_save[0] : clone $to_save[0]; |
|
212 | + $raList[$cnt] = ($depth == 0) ? $to_save[0] : clone $to_save[0]; |
|
213 | 213 | $raList[$cnt]->No = $cnt; |
214 | 214 | $raList[$cnt]->PrevPps = 0xFFFFFFFF; |
215 | 215 | $raList[$cnt]->NextPps = 0xFFFFFFFF; |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | $aNext = array_slice($to_save, $iPos + 1); |
221 | 221 | $cnt = count($raList); |
222 | 222 | // If the first entry, it's the root... Don't clone it! |
223 | - $raList[$cnt] = ( $depth == 0 ) ? $to_save[$iPos] : clone $to_save[$iPos]; |
|
223 | + $raList[$cnt] = ($depth == 0) ? $to_save[$iPos] : clone $to_save[$iPos]; |
|
224 | 224 | $raList[$cnt]->No = $cnt; |
225 | 225 | $raList[$cnt]->PrevPps = self::_savePpsSetPnt($raList, $aPrev, $depth++); |
226 | 226 | $raList[$cnt]->NextPps = self::_savePpsSetPnt($raList, $aNext, $depth++); |
@@ -33,34 +33,34 @@ |
||
33 | 33 | class File extends \PHPExcel\Shared\OLE\PPS |
34 | 34 | { |
35 | 35 | /** |
36 | - * The constructor |
|
37 | - * |
|
38 | - * @access public |
|
39 | - * @param string $name The name of the file (in Unicode) |
|
40 | - * @see OLE::ascToUcs() |
|
41 | - */ |
|
36 | + * The constructor |
|
37 | + * |
|
38 | + * @access public |
|
39 | + * @param string $name The name of the file (in Unicode) |
|
40 | + * @see OLE::ascToUcs() |
|
41 | + */ |
|
42 | 42 | public function __construct($name) |
43 | 43 | { |
44 | 44 | parent::__construct(null, $name, \PHPExcel\Shared\OLE::OLE_PPS_TYPE_FILE, null, null, null, null, null, '', array()); |
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
48 | - * Initialization method. Has to be called right after OLE_PPS_File(). |
|
49 | - * |
|
50 | - * @access public |
|
51 | - * @return mixed true on success |
|
52 | - */ |
|
48 | + * Initialization method. Has to be called right after OLE_PPS_File(). |
|
49 | + * |
|
50 | + * @access public |
|
51 | + * @return mixed true on success |
|
52 | + */ |
|
53 | 53 | public function init() |
54 | 54 | { |
55 | 55 | return true; |
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
59 | - * Append data to PPS |
|
60 | - * |
|
61 | - * @access public |
|
62 | - * @param string $data The data to append |
|
63 | - */ |
|
59 | + * Append data to PPS |
|
60 | + * |
|
61 | + * @access public |
|
62 | + * @param string $data The data to append |
|
63 | + */ |
|
64 | 64 | public function append($data) |
65 | 65 | { |
66 | 66 | $this->_data .= $data; |