Skip to content

Commit 057739d

Browse files
committed
#15 : PowerPoint97 Reader
1 parent 8beb3ca commit 057739d

File tree

3 files changed

+9
-36
lines changed

3 files changed

+9
-36
lines changed

src/PhpPowerpoint/Reader/PowerPoint97.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -747,15 +747,8 @@ private function readRTSlide($pos)
747747
$pos += 4;
748748
// slideAtom > notesIdRef
749749
$pos += 4;
750-
751750
// slideAtom > slideFlags
752-
$slideFlags = self::getInt2d($this->streamPowerpointDocument, $pos);
753-
// $fMasterObjects = ($slideFlags >> 0) & bindec('1');
754-
// $fMasterScheme = ($slideFlags >> 1) & bindec('1');
755-
// $fMasterBackground = ($slideFlags >> 2) & bindec('1');
756-
// $reserved = ($slideFlags >> 3) & bindec('1111111111111');
757751
$pos += 2;
758-
759752
// slideAtom > unused;
760753
$pos += 2;
761754
// *** slideShowSlideInfoAtom (24 bytes)
@@ -880,7 +873,7 @@ private function readRTSlide($pos)
880873
$rHeader['recLen'] -= 8;
881874
// print_r('$shapePrimaryOptions'.EOL);
882875
//@link : http://msdn.microsoft.com/en-us/library/dd906086(v=office.12).aspx
883-
$OfficeArtFOPTE = array();
876+
$officeArtFOPTE = array();
884877
for ($inc = 0; $inc < $shapePrimaryOptions['recInstance']; $inc++) {
885878
$opid = self::getInt2d($this->streamPowerpointDocument, $pos);
886879
$pos += 2;
@@ -890,15 +883,15 @@ private function readRTSlide($pos)
890883
$pos += 4;
891884
$rHeader['recLen'] -= 4;
892885
$shapePrimaryOptions['recLen'] -= 4;
893-
$OfficeArtFOPTE[] = array(
886+
$officeArtFOPTE[] = array(
894887
'opid' => ($opid >> 0) & bindec('11111111111111'),
895888
'fBid' => ($opid >> 14) & bindec('1'),
896889
'fComplex' => ($opid >> 15) & bindec('1'),
897890
'op' => $optOp,
898891
);
899892
}
900893
//@link : http://code.metager.de/source/xref/kde/calligra/filters/libmso/OPID
901-
foreach ($OfficeArtFOPTE as $opt) {
894+
foreach ($officeArtFOPTE as $opt) {
902895
switch ($opt['opid']) {
903896
case 0x007F:
904897
// Transform : Protection Boolean Properties
@@ -1144,11 +1137,11 @@ private function readRTSlide($pos)
11441137
}
11451138

11461139
$shpSecondaryOptions1 = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
1147-
$bShpSecondaryOptions1 = false;
1140+
$bShpSecondaryOpt1 = false;
11481141
if ($shpSecondaryOptions1['recVer'] == 0x3 && $shpSecondaryOptions1['recType'] == 0xF121) {
11491142
$pos += 8;
11501143
$rHeader['recLen'] -= 8;
1151-
$bShpSecondaryOptions1 = true;
1144+
$bShpSecondaryOpt1 = true;
11521145
// echo '@$rhShapeSecondaryOptions1'.EOL;
11531146
}
11541147

@@ -1813,7 +1806,7 @@ private function readRTSlide($pos)
18131806
$shpSecondaryOptions2 = $this->loadRecordHeader($this->streamPowerpointDocument, $pos);
18141807
$pos += 8;
18151808
$rHeader['recLen'] -= 8;
1816-
if ($shpSecondaryOptions2 == true && $shpSecondaryOptions2['recVer'] == 0x3 && $shpSecondaryOptions2['recType'] == 0xF121) {
1809+
if ($bShpSecondaryOpt1 == true && $shpSecondaryOptions2['recVer'] == 0x3 && $shpSecondaryOptions2['recType'] == 0xF121) {
18171810
} else {
18181811
$pos -= 8;
18191812
$rHeader['recLen'] += 8;

src/PhpPowerpoint/Shared/OLERead.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
defined('IDENTIFIER_OLE') ||
3232
define('IDENTIFIER_OLE', pack('CCCCCCCC', 0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1));
3333

34-
class OLERead
34+
class OLERead
3535
{
3636
private $data = '';
3737

@@ -65,7 +65,7 @@ class OLERead
6565
const SIZE_POS = 0x78;
6666

6767
public $summaryInformation = null;
68-
public $docSummaryInformation = null;
68+
public $docSummaryInfos = null;
6969
public $powerpointDocument = null;
7070
public $currentUser = null;
7171
public $pictures = null;
@@ -285,7 +285,7 @@ private function readPropertySets()
285285
$this->summaryInformation = count($this->props) - 1;
286286
break;
287287
case chr(5).'DOCUMENTSUMMARYINFORMATION':
288-
$this->docSummaryInformation = count($this->props) - 1;
288+
$this->docSummaryInfos = count($this->props) - 1;
289289
break;
290290
case 'CURRENT USER':
291291
$this->currentUser = count($this->props) - 1;

tests/PhpPowerpoint/Tests/Writer/SerializedTest.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -76,26 +76,6 @@ public function testSave()
7676
$this->assertFileExists($file, $object->save($file));
7777
}
7878

79-
/**
80-
* @expectedException \Exception
81-
* @expectedExceptionMessage Could not
82-
*/
83-
public function testSaveNoRightFile()
84-
{
85-
$oPHPPowerPoint = new PhpPowerpoint();
86-
$oSlide = $oPHPPowerPoint->getActiveSlide();
87-
$oImage = $oSlide->createDrawingShape();
88-
$oImage->setPath(PHPPOWERPOINT_TESTS_BASE_DIR.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'PHPPowerPointLogo.png');
89-
$object = new Serialized($oPHPPowerPoint);
90-
91-
$file = tempnam(sys_get_temp_dir(), 'PhpPowerpoint_Serialized');
92-
93-
file_put_contents($file, '');
94-
chmod($file, 0000);
95-
96-
$this->assertFileExists($file, $object->save($file));
97-
}
98-
9979
/**
10080
* @expectedException \Exception
10181
* @expectedExceptionMessage Could not open

0 commit comments

Comments
 (0)