/** * Test set active slide index exception * * @expectedException Exception * @expectedExceptionMessage Active slide index is out of bounds. */ public function testSetActiveSlideIndexException() { $object = new PhpPowerpoint(); $object->setActiveSlideIndex(1); }
/** * A container record that specifies a presentation slide or title master slide. * @param string $stream * @param int $pos * @link http://msdn.microsoft.com/en-us/library/dd946323(v=office.12).aspx */ private function readRecordSlideContainer($stream, $pos) { // Core $this->oPhpPowerpoint->createSlide(); $this->oPhpPowerpoint->setActiveSlideIndex($this->oPhpPowerpoint->getSlideCount() - 1); // *** slideAtom (32 bytes) $slideAtom = $this->readRecordSlideAtom($stream, $pos); if ($slideAtom['length'] == 0) { throw new \Exception('PowerPoint97 Reader : record SlideAtom'); } $pos += $slideAtom['length']; // *** slideShowSlideInfoAtom (24 bytes) $slideShowInfoAtom = $this->readRecordSlideShowSlideInfoAtom($stream, $pos); $pos += $slideShowInfoAtom['length']; // *** perSlideHFContainer (variable) : optional $perSlideHFContainer = $this->readRecordPerSlideHeadersFootersContainer($stream, $pos); $pos += $perSlideHFContainer['length']; // *** rtSlideSyncInfo12 (variable) : optional $rtSlideSyncInfo12 = $this->readRecordRoundTripSlideSyncInfo12Container($stream, $pos); $pos += $rtSlideSyncInfo12['length']; // *** drawing (variable) $drawing = $this->readRecordDrawingContainer($stream, $pos); $pos += $drawing['length']; // *** slideSchemeColorSchemeAtom (40 bytes) $slideSchemeColorAtom = $this->readRecordSlideSchemeColorSchemeAtom($stream, $pos); if ($slideSchemeColorAtom['length'] == 0) { throw new \Exception('PowerPoint97 Reader : record SlideSchemeColorSchemeAtom'); } $pos += $slideSchemeColorAtom['length']; // *** slideNameAtom (variable) $slideNameAtom = $this->readRecordSlideNameAtom($stream, $pos); $pos += $slideNameAtom['length']; // *** slideProgTagsContainer (variable). $slideProgTags = $this->readRecordSlideProgTagsContainer($stream, $pos); $pos += $slideProgTags['length']; // *** rgRoundTripSlide (variable) }