|
@@ 2209-2223 (lines=15) @@
|
| 2206 |
|
$extData = substr($recordData, $offset + 4, $cb); |
| 2207 |
|
|
| 2208 |
|
switch ($extType) { |
| 2209 |
|
case 4: // fill start color |
| 2210 |
|
$xclfType = self::_GetInt2d($extData, 0); // color type |
| 2211 |
|
$xclrValue = substr($extData, 4, 4); // color value (value based on color type) |
| 2212 |
|
|
| 2213 |
|
if ($xclfType == 2) { |
| 2214 |
|
$rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); |
| 2215 |
|
|
| 2216 |
|
// modify the relevant style property |
| 2217 |
|
if ( isset($this->_mapCellXfIndex[$ixfe]) ) { |
| 2218 |
|
$fill = $this->_phpExcel->getCellXfByIndex($this->_mapCellXfIndex[$ixfe])->getFill(); |
| 2219 |
|
$fill->getStartColor()->setRGB($rgb); |
| 2220 |
|
unset($fill->startcolorIndex); // normal color index does not apply, discard |
| 2221 |
|
} |
| 2222 |
|
} |
| 2223 |
|
break; |
| 2224 |
|
|
| 2225 |
|
case 5: // fill end color |
| 2226 |
|
$xclfType = self::_GetInt2d($extData, 0); // color type |
|
@@ 2225-2239 (lines=15) @@
|
| 2222 |
|
} |
| 2223 |
|
break; |
| 2224 |
|
|
| 2225 |
|
case 5: // fill end color |
| 2226 |
|
$xclfType = self::_GetInt2d($extData, 0); // color type |
| 2227 |
|
$xclrValue = substr($extData, 4, 4); // color value (value based on color type) |
| 2228 |
|
|
| 2229 |
|
if ($xclfType == 2) { |
| 2230 |
|
$rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); |
| 2231 |
|
|
| 2232 |
|
// modify the relevant style property |
| 2233 |
|
if ( isset($this->_mapCellXfIndex[$ixfe]) ) { |
| 2234 |
|
$fill = $this->_phpExcel->getCellXfByIndex($this->_mapCellXfIndex[$ixfe])->getFill(); |
| 2235 |
|
$fill->getEndColor()->setRGB($rgb); |
| 2236 |
|
unset($fill->endcolorIndex); // normal color index does not apply, discard |
| 2237 |
|
} |
| 2238 |
|
} |
| 2239 |
|
break; |
| 2240 |
|
|
| 2241 |
|
case 7: // border color top |
| 2242 |
|
$xclfType = self::_GetInt2d($extData, 0); // color type |
|
@@ 2241-2255 (lines=15) @@
|
| 2238 |
|
} |
| 2239 |
|
break; |
| 2240 |
|
|
| 2241 |
|
case 7: // border color top |
| 2242 |
|
$xclfType = self::_GetInt2d($extData, 0); // color type |
| 2243 |
|
$xclrValue = substr($extData, 4, 4); // color value (value based on color type) |
| 2244 |
|
|
| 2245 |
|
if ($xclfType == 2) { |
| 2246 |
|
$rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); |
| 2247 |
|
|
| 2248 |
|
// modify the relevant style property |
| 2249 |
|
if ( isset($this->_mapCellXfIndex[$ixfe]) ) { |
| 2250 |
|
$top = $this->_phpExcel->getCellXfByIndex($this->_mapCellXfIndex[$ixfe])->getBorders()->getTop(); |
| 2251 |
|
$top->getColor()->setRGB($rgb); |
| 2252 |
|
unset($top->colorIndex); // normal color index does not apply, discard |
| 2253 |
|
} |
| 2254 |
|
} |
| 2255 |
|
break; |
| 2256 |
|
|
| 2257 |
|
case 8: // border color bottom |
| 2258 |
|
$xclfType = self::_GetInt2d($extData, 0); // color type |
|
@@ 2257-2271 (lines=15) @@
|
| 2254 |
|
} |
| 2255 |
|
break; |
| 2256 |
|
|
| 2257 |
|
case 8: // border color bottom |
| 2258 |
|
$xclfType = self::_GetInt2d($extData, 0); // color type |
| 2259 |
|
$xclrValue = substr($extData, 4, 4); // color value (value based on color type) |
| 2260 |
|
|
| 2261 |
|
if ($xclfType == 2) { |
| 2262 |
|
$rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); |
| 2263 |
|
|
| 2264 |
|
// modify the relevant style property |
| 2265 |
|
if ( isset($this->_mapCellXfIndex[$ixfe]) ) { |
| 2266 |
|
$bottom = $this->_phpExcel->getCellXfByIndex($this->_mapCellXfIndex[$ixfe])->getBorders()->getBottom(); |
| 2267 |
|
$bottom->getColor()->setRGB($rgb); |
| 2268 |
|
unset($bottom->colorIndex); // normal color index does not apply, discard |
| 2269 |
|
} |
| 2270 |
|
} |
| 2271 |
|
break; |
| 2272 |
|
|
| 2273 |
|
case 9: // border color left |
| 2274 |
|
$xclfType = self::_GetInt2d($extData, 0); // color type |
|
@@ 2273-2287 (lines=15) @@
|
| 2270 |
|
} |
| 2271 |
|
break; |
| 2272 |
|
|
| 2273 |
|
case 9: // border color left |
| 2274 |
|
$xclfType = self::_GetInt2d($extData, 0); // color type |
| 2275 |
|
$xclrValue = substr($extData, 4, 4); // color value (value based on color type) |
| 2276 |
|
|
| 2277 |
|
if ($xclfType == 2) { |
| 2278 |
|
$rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); |
| 2279 |
|
|
| 2280 |
|
// modify the relevant style property |
| 2281 |
|
if ( isset($this->_mapCellXfIndex[$ixfe]) ) { |
| 2282 |
|
$left = $this->_phpExcel->getCellXfByIndex($this->_mapCellXfIndex[$ixfe])->getBorders()->getLeft(); |
| 2283 |
|
$left->getColor()->setRGB($rgb); |
| 2284 |
|
unset($left->colorIndex); // normal color index does not apply, discard |
| 2285 |
|
} |
| 2286 |
|
} |
| 2287 |
|
break; |
| 2288 |
|
|
| 2289 |
|
case 10: // border color right |
| 2290 |
|
$xclfType = self::_GetInt2d($extData, 0); // color type |
|
@@ 2289-2303 (lines=15) @@
|
| 2286 |
|
} |
| 2287 |
|
break; |
| 2288 |
|
|
| 2289 |
|
case 10: // border color right |
| 2290 |
|
$xclfType = self::_GetInt2d($extData, 0); // color type |
| 2291 |
|
$xclrValue = substr($extData, 4, 4); // color value (value based on color type) |
| 2292 |
|
|
| 2293 |
|
if ($xclfType == 2) { |
| 2294 |
|
$rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); |
| 2295 |
|
|
| 2296 |
|
// modify the relevant style property |
| 2297 |
|
if ( isset($this->_mapCellXfIndex[$ixfe]) ) { |
| 2298 |
|
$right = $this->_phpExcel->getCellXfByIndex($this->_mapCellXfIndex[$ixfe])->getBorders()->getRight(); |
| 2299 |
|
$right->getColor()->setRGB($rgb); |
| 2300 |
|
unset($right->colorIndex); // normal color index does not apply, discard |
| 2301 |
|
} |
| 2302 |
|
} |
| 2303 |
|
break; |
| 2304 |
|
|
| 2305 |
|
case 11: // border color diagonal |
| 2306 |
|
$xclfType = self::_GetInt2d($extData, 0); // color type |
|
@@ 2305-2319 (lines=15) @@
|
| 2302 |
|
} |
| 2303 |
|
break; |
| 2304 |
|
|
| 2305 |
|
case 11: // border color diagonal |
| 2306 |
|
$xclfType = self::_GetInt2d($extData, 0); // color type |
| 2307 |
|
$xclrValue = substr($extData, 4, 4); // color value (value based on color type) |
| 2308 |
|
|
| 2309 |
|
if ($xclfType == 2) { |
| 2310 |
|
$rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); |
| 2311 |
|
|
| 2312 |
|
// modify the relevant style property |
| 2313 |
|
if ( isset($this->_mapCellXfIndex[$ixfe]) ) { |
| 2314 |
|
$diagonal = $this->_phpExcel->getCellXfByIndex($this->_mapCellXfIndex[$ixfe])->getBorders()->getDiagonal(); |
| 2315 |
|
$diagonal->getColor()->setRGB($rgb); |
| 2316 |
|
unset($diagonal->colorIndex); // normal color index does not apply, discard |
| 2317 |
|
} |
| 2318 |
|
} |
| 2319 |
|
break; |
| 2320 |
|
|
| 2321 |
|
case 13: // font color |
| 2322 |
|
$xclfType = self::_GetInt2d($extData, 0); // color type |
|
@@ 2321-2335 (lines=15) @@
|
| 2318 |
|
} |
| 2319 |
|
break; |
| 2320 |
|
|
| 2321 |
|
case 13: // font color |
| 2322 |
|
$xclfType = self::_GetInt2d($extData, 0); // color type |
| 2323 |
|
$xclrValue = substr($extData, 4, 4); // color value (value based on color type) |
| 2324 |
|
|
| 2325 |
|
if ($xclfType == 2) { |
| 2326 |
|
$rgb = sprintf('%02X%02X%02X', ord($xclrValue{0}), ord($xclrValue{1}), ord($xclrValue{2})); |
| 2327 |
|
|
| 2328 |
|
// modify the relevant style property |
| 2329 |
|
if ( isset($this->_mapCellXfIndex[$ixfe]) ) { |
| 2330 |
|
$font = $this->_phpExcel->getCellXfByIndex($this->_mapCellXfIndex[$ixfe])->getFont(); |
| 2331 |
|
$font->getColor()->setRGB($rgb); |
| 2332 |
|
unset($font->colorIndex); // normal color index does not apply, discard |
| 2333 |
|
} |
| 2334 |
|
} |
| 2335 |
|
break; |
| 2336 |
|
} |
| 2337 |
|
|
| 2338 |
|
$offset += $cb; |