| @@ 2232-2251 (lines=20) @@ | ||
| 2229 | /** |
|
| 2230 | * Write SCENPROTECT |
|
| 2231 | */ |
|
| 2232 | private function _writeScenProtect() |
|
| 2233 | { |
|
| 2234 | // Exit if sheet protection is not active |
|
| 2235 | if (!$this->_phpSheet->getProtection()->getSheet()) { |
|
| 2236 | return; |
|
| 2237 | } |
|
| 2238 | ||
| 2239 | // Exit if scenarios are not protected |
|
| 2240 | if (!$this->_phpSheet->getProtection()->getScenarios()) { |
|
| 2241 | return; |
|
| 2242 | } |
|
| 2243 | ||
| 2244 | $record = 0x00DD; // Record identifier |
|
| 2245 | $length = 0x0002; // Bytes to follow |
|
| 2246 | ||
| 2247 | $header = pack('vv', $record, $length); |
|
| 2248 | $data = pack('v', 1); |
|
| 2249 | ||
| 2250 | $this->_append($header . $data); |
|
| 2251 | } |
|
| 2252 | ||
| 2253 | /** |
|
| 2254 | * Write OBJECTPROTECT |
|
| @@ 2256-2275 (lines=20) @@ | ||
| 2253 | /** |
|
| 2254 | * Write OBJECTPROTECT |
|
| 2255 | */ |
|
| 2256 | private function _writeObjectProtect() |
|
| 2257 | { |
|
| 2258 | // Exit if sheet protection is not active |
|
| 2259 | if (!$this->_phpSheet->getProtection()->getSheet()) { |
|
| 2260 | return; |
|
| 2261 | } |
|
| 2262 | ||
| 2263 | // Exit if objects are not protected |
|
| 2264 | if (!$this->_phpSheet->getProtection()->getObjects()) { |
|
| 2265 | return; |
|
| 2266 | } |
|
| 2267 | ||
| 2268 | $record = 0x0063; // Record identifier |
|
| 2269 | $length = 0x0002; // Bytes to follow |
|
| 2270 | ||
| 2271 | $header = pack('vv', $record, $length); |
|
| 2272 | $data = pack('v', 1); |
|
| 2273 | ||
| 2274 | $this->_append($header . $data); |
|
| 2275 | } |
|
| 2276 | ||
| 2277 | /** |
|
| 2278 | * Write the worksheet PASSWORD record. |
|
| @@ 2639-2652 (lines=14) @@ | ||
| 2636 | * Store the window zoom factor. This should be a reduced fraction but for |
|
| 2637 | * simplicity we will store all fractions with a numerator of 100. |
|
| 2638 | */ |
|
| 2639 | private function _writeZoom() |
|
| 2640 | { |
|
| 2641 | // If scale is 100 we don't need to write a record |
|
| 2642 | if ($this->_phpSheet->getSheetView()->getZoomScale() == 100) { |
|
| 2643 | return; |
|
| 2644 | } |
|
| 2645 | ||
| 2646 | $record = 0x00A0; // Record identifier |
|
| 2647 | $length = 0x0004; // Bytes to follow |
|
| 2648 | ||
| 2649 | $header = pack("vv", $record, $length); |
|
| 2650 | $data = pack("vv", $this->_phpSheet->getSheetView()->getZoomScale(), 100); |
|
| 2651 | $this->_append($header . $data); |
|
| 2652 | } |
|
| 2653 | ||
| 2654 | /** |
|
| 2655 | * Get Escher object |
|