Complex classes like PowerPoint97 often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use PowerPoint97, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 37 | class PowerPoint97 implements ReaderInterface |
||
| 38 | { |
||
| 39 | const OFFICEARTBLIPEMF = 0xF01A; |
||
| 40 | const OFFICEARTBLIPWMF = 0xF01B; |
||
| 41 | const OFFICEARTBLIPPICT = 0xF01C; |
||
| 42 | const OFFICEARTBLIPJPG = 0xF01D; |
||
| 43 | const OFFICEARTBLIPPNG = 0xF01E; |
||
| 44 | const OFFICEARTBLIPDIB = 0xF01F; |
||
| 45 | const OFFICEARTBLIPTIFF = 0xF029; |
||
| 46 | const OFFICEARTBLIPJPEG = 0xF02A; |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @link http://msdn.microsoft.com/en-us/library/dd945336(v=office.12).aspx |
||
| 50 | */ |
||
| 51 | const RT_ANIMATIONINFO = 0x1014; |
||
| 52 | const RT_ANIMATIONINFOATOM = 0x0FF1; |
||
| 53 | const RT_BINARYTAGDATABLOB = 0x138B; |
||
| 54 | const RT_BLIPCOLLECTION9 = 0x07F8; |
||
| 55 | const RT_BLIPENTITY9ATOM = 0x07F9; |
||
| 56 | const RT_BOOKMARKCOLLECTION = 0x07E3; |
||
| 57 | const RT_BOOKMARKENTITYATOM = 0x0FD0; |
||
| 58 | const RT_BOOKMARKSEEDATOM = 0x07E9; |
||
| 59 | const RT_BROADCASTDOCINFO9 = 0x177E; |
||
| 60 | const RT_BROADCASTDOCINFO9ATOM = 0x177F; |
||
| 61 | const RT_BUILDATOM = 0x2B03; |
||
| 62 | const RT_BUILDLIST = 0x2B02; |
||
| 63 | const RT_CHARTBUILD = 0x2B04; |
||
| 64 | const RT_CHARTBUILDATOM = 0x2B05; |
||
| 65 | const RT_COLORSCHEMEATOM = 0x07F0; |
||
| 66 | const RT_COMMENT10 = 0x2EE0; |
||
| 67 | const RT_COMMENT10ATOM = 0x2EE1; |
||
| 68 | const RT_COMMENTINDEX10 = 0x2EE4; |
||
| 69 | const RT_COMMENTINDEX10ATOM = 0x2EE5; |
||
| 70 | const RT_CRYPTSESSION10CONTAINER = 0x2F14; |
||
| 71 | const RT_CURRENTUSERATOM = 0x0FF6; |
||
| 72 | const RT_CSTRING = 0x0FBA; |
||
| 73 | const RT_DATETIMEMETACHARATOM = 0x0FF7; |
||
| 74 | const RT_DEFAULTRULERATOM = 0x0FAB; |
||
| 75 | const RT_DOCROUTINGSLIPATOM = 0x0406; |
||
| 76 | const RT_DIAGRAMBUILD = 0x2B06; |
||
| 77 | const RT_DIAGRAMBUILDATOM = 0x2B07; |
||
| 78 | const RT_DIFF10 = 0x2EED; |
||
| 79 | const RT_DIFF10ATOM = 0x2EEE; |
||
| 80 | const RT_DIFFTREE10 = 0x2EEC; |
||
| 81 | const RT_DOCTOOLBARSTATES10ATOM = 0x36B1; |
||
| 82 | const RT_DOCUMENT = 0x03E8; |
||
| 83 | const RT_DOCUMENTATOM = 0x03E9; |
||
| 84 | const RT_DRAWING = 0x040C; |
||
| 85 | const RT_DRAWINGGROUP = 0x040B; |
||
| 86 | const RT_ENDDOCUMENTATOM = 0x03EA; |
||
| 87 | const RT_EXTERNALAVIMOVIE = 0x1006; |
||
| 88 | const RT_EXTERNALCDAUDIO = 0x100E; |
||
| 89 | const RT_EXTERNALCDAUDIOATOM = 0x1012; |
||
| 90 | const RT_EXTERNALHYPERLINK = 0x0FD7; |
||
| 91 | const RT_EXTERNALHYPERLINK9 = 0x0FE4; |
||
| 92 | const RT_EXTERNALHYPERLINKATOM = 0x0FD3; |
||
| 93 | const RT_EXTERNALHYPERLINKFLAGSATOM = 0x1018; |
||
| 94 | const RT_EXTERNALMCIMOVIE = 0x1007; |
||
| 95 | const RT_EXTERNALMEDIAATOM = 0x1004; |
||
| 96 | const RT_EXTERNALMIDIAUDIO = 0x100D; |
||
| 97 | const RT_EXTERNALOBJECTLIST = 0x0409; |
||
| 98 | const RT_EXTERNALOBJECTLISTATOM = 0x040A; |
||
| 99 | const RT_EXTERNALOBJECTREFATOM = 0x0BC1; |
||
| 100 | const RT_EXTERNALOLECONTROL = 0x0FEE; |
||
| 101 | const RT_EXTERNALOLECONTROLATOM = 0x0FFB; |
||
| 102 | const RT_EXTERNALOLEEMBED = 0x0FCC; |
||
| 103 | const RT_EXTERNALOLEEMBEDATOM = 0x0FCD; |
||
| 104 | const RT_EXTERNALOLELINK = 0x0FCE; |
||
| 105 | const RT_EXTERNALOLELINKATOM = 0x0FD1; |
||
| 106 | const RT_EXTERNALOLEOBJECTATOM = 0x0FC3; |
||
| 107 | const RT_EXTERNALOLEOBJECTSTG = 0x1011; |
||
| 108 | const RT_EXTERNALVIDEO = 0x1005; |
||
| 109 | const RT_EXTERNALWAVAUDIOEMBEDDED = 0x100F; |
||
| 110 | const RT_EXTERNALWAVAUDIOEMBEDDEDATOM = 0x1013; |
||
| 111 | const RT_EXTERNALWAVAUDIOLINK = 0x1010; |
||
| 112 | const RT_ENVELOPEDATA9ATOM = 0x1785; |
||
| 113 | const RT_ENVELOPEFLAGS9ATOM = 0x1784; |
||
| 114 | const RT_ENVIRONMENT = 0x03F2; |
||
| 115 | const RT_FONTCOLLECTION = 0x07D5; |
||
| 116 | const RT_FONTCOLLECTION10 = 0x07D6; |
||
| 117 | const RT_FONTEMBEDDATABLOB = 0x0FB8; |
||
| 118 | const RT_FONTEMBEDFLAGS10ATOM = 0x32C8; |
||
| 119 | const RT_FILTERPRIVACYFLAGS10ATOM = 0x36B0; |
||
| 120 | const RT_FONTENTITYATOM = 0x0FB7; |
||
| 121 | const RT_FOOTERMETACHARATOM = 0x0FFA; |
||
| 122 | const RT_GENERICDATEMETACHARATOM = 0x0FF8; |
||
| 123 | const RT_GRIDSPACING10ATOM = 0x040D; |
||
| 124 | const RT_GUIDEATOM = 0x03FB; |
||
| 125 | const RT_HANDOUT = 0x0FC9; |
||
| 126 | const RT_HASHCODEATOM = 0x2B00; |
||
| 127 | const RT_HEADERSFOOTERS = 0x0FD9; |
||
| 128 | const RT_HEADERSFOOTERSATOM = 0x0FDA; |
||
| 129 | const RT_HEADERMETACHARATOM = 0x0FF9; |
||
| 130 | const RT_HTMLDOCINFO9ATOM = 0x177B; |
||
| 131 | const RT_HTMLPUBLISHINFOATOM = 0x177C; |
||
| 132 | const RT_HTMLPUBLISHINFO9 = 0x177D; |
||
| 133 | const RT_INTERACTIVEINFO = 0x0FF2; |
||
| 134 | const RT_INTERACTIVEINFOATOM = 0x0FF3; |
||
| 135 | const RT_KINSOKU = 0x0FC8; |
||
| 136 | const RT_KINSOKUATOM = 0x0FD2; |
||
| 137 | const RT_LEVELINFOATOM = 0x2B0A; |
||
| 138 | const RT_LINKEDSHAPE10ATOM = 0x2EE6; |
||
| 139 | const RT_LINKEDSLIDE10ATOM = 0x2EE7; |
||
| 140 | const RT_LIST = 0x07D0; |
||
| 141 | const RT_MAINMASTER = 0x03F8; |
||
| 142 | const RT_MASTERTEXTPROPATOM = 0x0FA2; |
||
| 143 | const RT_METAFILE = 0x0FC1; |
||
| 144 | const RT_NAMEDSHOW = 0x0411; |
||
| 145 | const RT_NAMEDSHOWS = 0x0410; |
||
| 146 | const RT_NAMEDSHOWSLIDESATOM = 0x0412; |
||
| 147 | const RT_NORMALVIEWSETINFO9 = 0x0414; |
||
| 148 | const RT_NORMALVIEWSETINFO9ATOM = 0x0415; |
||
| 149 | const RT_NOTES= 0x03F0; |
||
| 150 | const RT_NOTESATOM = 0x03F1; |
||
| 151 | const RT_NOTESTEXTVIEWINFO9 = 0x0413; |
||
| 152 | const RT_OUTLINETEXTPROPS9 = 0x0FAE; |
||
| 153 | const RT_OUTLINETEXTPROPS10 = 0x0FB3; |
||
| 154 | const RT_OUTLINETEXTPROPS11 = 0x0FB5; |
||
| 155 | const RT_OUTLINETEXTPROPSHEADER9ATOM = 0x0FAF; |
||
| 156 | const RT_OUTLINETEXTREFATOM = 0x0F9E; |
||
| 157 | const RT_OUTLINEVIEWINFO = 0x0407; |
||
| 158 | const RT_PERSISTDIRECTORYATOM = 0x1772; |
||
| 159 | const RT_PARABUILD = 0x2B08; |
||
| 160 | const RT_PARABUILDATOM = 0x2B09; |
||
| 161 | const RT_PHOTOALBUMINFO10ATOM = 0x36B2; |
||
| 162 | const RT_PLACEHOLDERATOM = 0x0BC3; |
||
| 163 | const RT_PRESENTATIONADVISORFLAGS9ATOM = 0x177A; |
||
| 164 | const RT_PRINTOPTIONSATOM = 0x1770; |
||
| 165 | const RT_PROGBINARYTAG = 0x138A; |
||
| 166 | const RT_PROGSTRINGTAG = 0x1389; |
||
| 167 | const RT_PROGTAGS = 0x1388; |
||
| 168 | const RT_RECOLORINFOATOM = 0x0FE7; |
||
| 169 | const RT_RTFDATETIMEMETACHARATOM = 0x1015; |
||
| 170 | const RT_ROUNDTRIPANIMATIONATOM12ATOM = 0x2B0B; |
||
| 171 | const RT_ROUNDTRIPANIMATIONHASHATOM12ATOM = 0x2B0D; |
||
| 172 | const RT_ROUNDTRIPCOLORMAPPING12ATOM = 0x040F; |
||
| 173 | const RT_ROUNDTRIPCOMPOSITEMASTERID12ATOM = 0x041D; |
||
| 174 | const RT_ROUNDTRIPCONTENTMASTERID12ATOM = 0x0422; |
||
| 175 | const RT_ROUNDTRIPCONTENTMASTERINFO12ATOM = 0x041E; |
||
| 176 | const RT_ROUNDTRIPCUSTOMTABLESTYLES12ATOM = 0x0428; |
||
| 177 | const RT_ROUNDTRIPDOCFLAGS12ATOM = 0x0425; |
||
| 178 | const RT_ROUNDTRIPHEADERFOOTERDEFAULTS12ATOM = 0x0424; |
||
| 179 | const RT_ROUNDTRIPHFPLACEHOLDER12ATOM = 0x0420; |
||
| 180 | const RT_ROUNDTRIPNEWPLACEHOLDERID12ATOM = 0x0BDD; |
||
| 181 | const RT_ROUNDTRIPNOTESMASTERTEXTSTYLES12ATOM = 0x0427; |
||
| 182 | const RT_ROUNDTRIPOARTTEXTSTYLES12ATOM = 0x0423; |
||
| 183 | const RT_ROUNDTRIPORIGINALMAINMASTERID12ATOM = 0x041C; |
||
| 184 | const RT_ROUNDTRIPSHAPECHECKSUMFORCL12ATOM = 0x0426; |
||
| 185 | const RT_ROUNDTRIPSHAPEID12ATOM = 0x041F; |
||
| 186 | const RT_ROUNDTRIPSLIDESYNCINFO12 = 0x3714; |
||
| 187 | const RT_ROUNDTRIPSLIDESYNCINFOATOM12 = 0x3715; |
||
| 188 | const RT_ROUNDTRIPTHEME12ATOM = 0x040E; |
||
| 189 | const RT_SHAPEATOM = 0x0BDB; |
||
| 190 | const RT_SHAPEFLAGS10ATOM = 0x0BDC; |
||
| 191 | const RT_SLIDE = 0x03EE; |
||
| 192 | const RT_SLIDEATOM = 0x03EF; |
||
| 193 | const RT_SLIDEFLAGS10ATOM = 0x2EEA; |
||
| 194 | const RT_SLIDELISTENTRY10ATOM = 0x2EF0; |
||
| 195 | const RT_SLIDELISTTABLE10 = 0x2EF1; |
||
| 196 | const RT_SLIDELISTWITHTEXT = 0x0FF0; |
||
| 197 | const RT_SLIDELISTTABLESIZE10ATOM = 0x2EEF; |
||
| 198 | const RT_SLIDENUMBERMETACHARATOM = 0x0FD8; |
||
| 199 | const RT_SLIDEPERSISTATOM = 0x03F3; |
||
| 200 | const RT_SLIDESHOWDOCINFOATOM = 0x0401; |
||
| 201 | const RT_SLIDESHOWSLIDEINFOATOM = 0x03F9; |
||
| 202 | const RT_SLIDETIME10ATOM = 0x2EEB; |
||
| 203 | const RT_SLIDEVIEWINFO = 0x03FA; |
||
| 204 | const RT_SLIDEVIEWINFOATOM = 0x03FE; |
||
| 205 | const RT_SMARTTAGSTORE11CONTAINER = 0x36B3; |
||
| 206 | const RT_SOUND = 0x07E6; |
||
| 207 | const RT_SOUNDCOLLECTION = 0x07E4; |
||
| 208 | const RT_SOUNDCOLLECTIONATOM = 0x07E5; |
||
| 209 | const RT_SOUNDDATABLOB = 0x07E7; |
||
| 210 | const RT_SORTERVIEWINFO = 0x0408; |
||
| 211 | const RT_STYLETEXTPROPATOM = 0x0FA1; |
||
| 212 | const RT_STYLETEXTPROP10ATOM = 0x0FB1; |
||
| 213 | const RT_STYLETEXTPROP11ATOM = 0x0FB6; |
||
| 214 | const RT_STYLETEXTPROP9ATOM = 0x0FAC; |
||
| 215 | const RT_SUMMARY = 0x0402; |
||
| 216 | const RT_TEXTBOOKMARKATOM = 0x0FA7; |
||
| 217 | const RT_TEXTBYTESATOM = 0x0FA8; |
||
| 218 | const RT_TEXTCHARFORMATEXCEPTIONATOM = 0x0FA4; |
||
| 219 | const RT_TEXTCHARSATOM = 0x0FA0; |
||
| 220 | const RT_TEXTDEFAULTS10ATOM = 0x0FB4; |
||
| 221 | const RT_TEXTDEFAULTS9ATOM = 0x0FB0; |
||
| 222 | const RT_TEXTHEADERATOM = 0x0F9F; |
||
| 223 | const RT_TEXTINTERACTIVEINFOATOM = 0x0FDF; |
||
| 224 | const RT_TEXTMASTERSTYLEATOM = 0x0FA3; |
||
| 225 | const RT_TEXTMASTERSTYLE10ATOM = 0x0FB2; |
||
| 226 | const RT_TEXTMASTERSTYLE9ATOM = 0x0FAD; |
||
| 227 | const RT_TEXTPARAGRAPHFORMATEXCEPTIONATOM = 0x0FA5; |
||
| 228 | const RT_TEXTRULERATOM = 0x0FA6; |
||
| 229 | const RT_TEXTSPECIALINFOATOM = 0x0FAA; |
||
| 230 | const RT_TEXTSPECIALINFODEFAULTATOM = 0x0FA9; |
||
| 231 | const RT_TIMEANIMATEBEHAVIOR = 0xF134; |
||
| 232 | const RT_TIMEANIMATEBEHAVIORCONTAINER = 0xF12B; |
||
| 233 | const RT_TIMEANIMATIONVALUE = 0xF143; |
||
| 234 | const RT_TIMEANIMATIONVALUELIST = 0xF13F; |
||
| 235 | const RT_TIMEBEHAVIOR = 0xF133; |
||
| 236 | const RT_TIMEBEHAVIORCONTAINER = 0xF12A; |
||
| 237 | const RT_TIMECOLORBEHAVIOR = 0xF135; |
||
| 238 | const RT_TIMECOLORBEHAVIORCONTAINER = 0xF12C; |
||
| 239 | const RT_TIMECLIENTVISUALELEMENT = 0xF13C; |
||
| 240 | const RT_TIMECOMMANDBEHAVIOR = 0xF13B; |
||
| 241 | const RT_TIMECOMMANDBEHAVIORCONTAINER = 0xF132; |
||
| 242 | const RT_TIMECONDITION = 0xF128; |
||
| 243 | const RT_TIMECONDITIONCONTAINER = 0xF125; |
||
| 244 | const RT_TIMEEFFECTBEHAVIOR = 0xF136; |
||
| 245 | const RT_TIMEEFFECTBEHAVIORCONTAINER = 0xF12D; |
||
| 246 | const RT_TIMEEXTTIMENODECONTAINER = 0xF144; |
||
| 247 | const RT_TIMEITERATEDATA = 0xF140; |
||
| 248 | const RT_TIMEMODIFIER = 0xF129; |
||
| 249 | const RT_TIMEMOTIONBEHAVIOR = 0xF137; |
||
| 250 | const RT_TIMEMOTIONBEHAVIORCONTAINER = 0xF12E; |
||
| 251 | const RT_TIMENODE = 0xF127; |
||
| 252 | const RT_TIMEPROPERTYLIST = 0xF13D; |
||
| 253 | const RT_TIMEROTATIONBEHAVIOR = 0xF138; |
||
| 254 | const RT_TIMEROTATIONBEHAVIORCONTAINER = 0xF12F; |
||
| 255 | const RT_TIMESCALEBEHAVIOR = 0xF139; |
||
| 256 | const RT_TIMESCALEBEHAVIORCONTAINER = 0xF130; |
||
| 257 | const RT_TIMESEQUENCEDATA = 0xF141; |
||
| 258 | const RT_TIMESETBEHAVIOR = 0xF13A; |
||
| 259 | const RT_TIMESETBEHAVIORCONTAINER = 0xF131; |
||
| 260 | const RT_TIMESUBEFFECTCONTAINER = 0xF145; |
||
| 261 | const RT_TIMEVARIANT = 0xF142; |
||
| 262 | const RT_TIMEVARIANTLIST = 0xF13E; |
||
| 263 | const RT_USEREDITATOM = 0x0FF5; |
||
| 264 | const RT_VBAINFO = 0x03FF; |
||
| 265 | const RT_VBAINFOATOM = 0x0400; |
||
| 266 | const RT_VIEWINFOATOM = 0x03FD; |
||
| 267 | const RT_VISUALPAGEATOM = 0x2B01; |
||
| 268 | const RT_VISUALSHAPEATOM = 0x2AFB; |
||
| 269 | |||
| 270 | /** |
||
| 271 | * @var http://msdn.microsoft.com/en-us/library/dd926394(v=office.12).aspx |
||
| 272 | */ |
||
| 273 | const SL_BIGOBJECT = 0x0000000F; |
||
| 274 | const SL_BLANK = 0x00000010; |
||
| 275 | const SL_COLUMNTWOROWS = 0x0000000A; |
||
| 276 | const SL_FOUROBJECTS = 0x0000000E; |
||
| 277 | const SL_MASTERTITLE = 0x00000002; |
||
| 278 | const SL_TITLEBODY = 0x00000001; |
||
| 279 | const SL_TITLEONLY = 0x00000007; |
||
| 280 | const SL_TITLESLIDE = 0x00000000; |
||
| 281 | const SL_TWOCOLUMNS = 0x00000008; |
||
| 282 | const SL_TWOCOLUMNSROW = 0x0000000D; |
||
| 283 | const SL_TWOROWS = 0x00000009; |
||
| 284 | const SL_TWOROWSCOLUMN = 0x0000000B; |
||
| 285 | const SL_VERTICALTITLEBODY = 0x00000011; |
||
| 286 | const SL_VERTICALTWOROWS = 0x00000012; |
||
| 287 | |||
| 288 | /** |
||
| 289 | * Array with Fonts |
||
| 290 | */ |
||
| 291 | private $arrayFonts = array(); |
||
| 292 | /** |
||
| 293 | * Array with Hyperlinks |
||
| 294 | */ |
||
| 295 | private $arrayHyperlinks = array(); |
||
| 296 | /** |
||
| 297 | * Array with Notes |
||
| 298 | */ |
||
| 299 | private $arrayNotes = array(); |
||
| 300 | /** |
||
| 301 | * Array with Pictures |
||
| 302 | */ |
||
| 303 | private $arrayPictures = array(); |
||
| 304 | /** |
||
| 305 | * Offset (in bytes) from the beginning of the PowerPoint Document Stream to the UserEditAtom record for the most recent user edit. |
||
| 306 | * @var int |
||
| 307 | */ |
||
| 308 | private $offsetToCurrentEdit; |
||
| 309 | /** |
||
| 310 | * A structure that specifies a compressed table of sequential persist object identifiers and stream offsets to associated persist objects. |
||
| 311 | * @var int[] |
||
| 312 | */ |
||
| 313 | private $rgPersistDirEntry; |
||
| 314 | /** |
||
| 315 | * Offset (in bytes) from the beginning of the PowerPoint Document Stream to the PersistDirectoryAtom record for this user edit |
||
| 316 | * @var int |
||
| 317 | */ |
||
| 318 | private $offsetPersistDirectory; |
||
| 319 | /** |
||
| 320 | * Output Object |
||
| 321 | * @var PhpPresentation |
||
| 322 | */ |
||
| 323 | private $oPhpPresentation; |
||
| 324 | /** |
||
| 325 | * Group Object |
||
| 326 | * @var Group |
||
| 327 | */ |
||
| 328 | private $oCurrentGroup; |
||
| 329 | /** |
||
| 330 | * @var boolean |
||
| 331 | */ |
||
| 332 | private $bFirstShapeGroup = false; |
||
| 333 | /** |
||
| 334 | * Stream "Powerpoint Document" |
||
| 335 | * @var string |
||
| 336 | */ |
||
| 337 | private $streamPowerpointDocument; |
||
| 338 | /** |
||
| 339 | * Stream "Current User" |
||
| 340 | * @var string |
||
| 341 | */ |
||
| 342 | private $streamCurrentUser; |
||
| 343 | /** |
||
| 344 | * Stream "Summary Information" |
||
| 345 | * @var string |
||
| 346 | */ |
||
| 347 | private $streamSummaryInformation; |
||
| 348 | /** |
||
| 349 | * Stream "Document Summary Information" |
||
| 350 | * @var string |
||
| 351 | */ |
||
| 352 | private $streamDocumentSummaryInformation; |
||
| 353 | /** |
||
| 354 | * Stream "Pictures" |
||
| 355 | * @var string |
||
| 356 | */ |
||
| 357 | private $streamPictures; |
||
| 358 | /** |
||
| 359 | * @var integer |
||
| 360 | */ |
||
| 361 | private $inMainType; |
||
| 362 | /** |
||
| 363 | * @var integer |
||
| 364 | */ |
||
| 365 | private $currentNote; |
||
| 366 | |||
| 367 | /** |
||
| 368 | * Can the current \PhpOffice\PhpPresentation\Reader\ReaderInterface read the file? |
||
| 369 | * |
||
| 370 | * @param string $pFilename |
||
| 371 | * @throws \Exception |
||
| 372 | * @return boolean |
||
| 373 | */ |
||
| 374 | 3 | public function canRead($pFilename) |
|
| 378 | |||
| 379 | /** |
||
| 380 | * Does a file support UnserializePhpPresentation ? |
||
| 381 | * |
||
| 382 | * @param string $pFilename |
||
| 383 | * @throws \Exception |
||
| 384 | * @return boolean |
||
| 385 | */ |
||
| 386 | 10 | public function fileSupportsUnserializePhpPresentation($pFilename = '') |
|
| 403 | |||
| 404 | /** |
||
| 405 | * Loads PhpPresentation Serialized file |
||
| 406 | * |
||
| 407 | * @param string $pFilename |
||
| 408 | * @return \PhpOffice\PhpPresentation\PhpPresentation |
||
| 409 | * @throws \Exception |
||
| 410 | */ |
||
| 411 | 6 | public function load($pFilename) |
|
| 420 | |||
| 421 | /** |
||
| 422 | * Load PhpPresentation Serialized file |
||
| 423 | * |
||
| 424 | * @param string $pFilename |
||
| 425 | * @return \PhpOffice\PhpPresentation\PhpPresentation |
||
| 426 | * @throws \Exception |
||
| 427 | */ |
||
| 428 | 4 | private function loadFile($pFilename) |
|
| 444 | |||
| 445 | /** |
||
| 446 | * Read OLE Part |
||
| 447 | * @param string $pFilename |
||
| 448 | * @throws \Exception |
||
| 449 | */ |
||
| 450 | 4 | private function loadOLE($pFilename) |
|
| 471 | |||
| 472 | /** |
||
| 473 | * Stream Pictures |
||
| 474 | * @link http://msdn.microsoft.com/en-us/library/dd920746(v=office.12).aspx |
||
| 475 | */ |
||
| 476 | 4 | private function loadPicturesStream() |
|
| 502 | |||
| 503 | /** |
||
| 504 | * Stream Current User |
||
| 505 | * @link http://msdn.microsoft.com/en-us/library/dd908567(v=office.12).aspx |
||
| 506 | */ |
||
| 507 | 4 | private function loadCurrentUserStream() |
|
| 600 | |||
| 601 | /** |
||
| 602 | * Stream Powerpoint Document |
||
| 603 | * @link http://msdn.microsoft.com/en-us/library/dd921564(v=office.12).aspx |
||
| 604 | */ |
||
| 605 | 4 | private function loadPowerpointDocumentStream() |
|
| 634 | |||
| 635 | /** |
||
| 636 | * Read a record header |
||
| 637 | * @param string $stream |
||
| 638 | * @param integer $pos |
||
| 639 | * @return array |
||
| 640 | */ |
||
| 641 | 4 | private function loadRecordHeader($stream, $pos) |
|
| 653 | |||
| 654 | /** |
||
| 655 | * Read 8-bit unsigned integer |
||
| 656 | * |
||
| 657 | * @param string $data |
||
| 658 | * @param int $pos |
||
| 659 | * @return int |
||
| 660 | */ |
||
| 661 | 4 | public static function getInt1d($data, $pos) |
|
| 665 | |||
| 666 | /** |
||
| 667 | * Read 16-bit unsigned integer |
||
| 668 | * |
||
| 669 | * @param string $data |
||
| 670 | * @param int $pos |
||
| 671 | * @return int |
||
| 672 | */ |
||
| 673 | 4 | public static function getInt2d($data, $pos) |
|
| 677 | |||
| 678 | /** |
||
| 679 | * Read 32-bit signed integer |
||
| 680 | * |
||
| 681 | * @param string $data |
||
| 682 | * @param int $pos |
||
| 683 | * @return int |
||
| 684 | */ |
||
| 685 | 4 | public static function getInt4d($data, $pos) |
|
| 699 | |||
| 700 | /** |
||
| 701 | * A container record that specifies the animation and sound information for a shape. |
||
| 702 | * @param string $stream |
||
| 703 | * @param integer $pos |
||
| 704 | * @return array |
||
| 705 | * @throws \Exception |
||
| 706 | * @link https://msdn.microsoft.com/en-us/library/dd772900(v=office.12).aspx |
||
| 707 | */ |
||
| 708 | 4 | private function readRecordAnimationInfoContainer($stream, $pos) |
|
| 725 | |||
| 726 | /** |
||
| 727 | * A container record that specifies information about the document. |
||
| 728 | * @param string $stream |
||
| 729 | * @param integer $pos |
||
| 730 | * @throws \Exception |
||
| 731 | * @link http://msdn.microsoft.com/en-us/library/dd947357(v=office.12).aspx |
||
| 732 | */ |
||
| 733 | 4 | private function readRecordDocumentContainer($stream, $pos) |
|
| 1011 | |||
| 1012 | /** |
||
| 1013 | * An atom record that specifies information about a slide. |
||
| 1014 | * @param string $stream |
||
| 1015 | * @param integer $pos |
||
| 1016 | * @return array |
||
| 1017 | * @throws \Exception |
||
| 1018 | * @link https://msdn.microsoft.com/en-us/library/dd923801(v=office.12).aspx |
||
| 1019 | */ |
||
| 1020 | 4 | private function readRecordDrawingContainer($stream, $pos) |
|
| 1036 | |||
| 1037 | 4 | private function readRecordDrawingGroupContainer($stream, $pos) |
|
| 1052 | |||
| 1053 | /** |
||
| 1054 | * An atom record that specifies a reference to an external object. |
||
| 1055 | * @param string $stream |
||
| 1056 | * @param integer $pos |
||
| 1057 | * @return array |
||
| 1058 | * @link https://msdn.microsoft.com/en-us/library/dd910388(v=office.12).aspx |
||
| 1059 | */ |
||
| 1060 | 4 | private function readRecordExObjRefAtom($stream, $pos) |
|
| 1076 | |||
| 1077 | /** |
||
| 1078 | * An atom record that specifies a type of action to be performed. |
||
| 1079 | * @param string $stream |
||
| 1080 | * @param integer $pos |
||
| 1081 | * @return array |
||
| 1082 | * @link https://msdn.microsoft.com/en-us/library/dd953300(v=office.12).aspx |
||
| 1083 | */ |
||
| 1084 | 1 | private function readRecordInteractiveInfoAtom($stream, $pos) |
|
| 1119 | |||
| 1120 | /** |
||
| 1121 | * An atom record that specifies the name of a macro, a file name, or a named show. |
||
| 1122 | * @param string $stream |
||
| 1123 | * @param integer $pos |
||
| 1124 | * @return array |
||
| 1125 | * @link https://msdn.microsoft.com/en-us/library/dd925121(v=office.12).aspx |
||
| 1126 | */ |
||
| 1127 | 1 | private function readRecordMacroNameAtom($stream, $pos) |
|
| 1143 | |||
| 1144 | /** |
||
| 1145 | * A container record that specifies what actions to perform when interacting with an object by means of a mouse click. |
||
| 1146 | * @param string $stream |
||
| 1147 | * @param integer $pos |
||
| 1148 | * @return array |
||
| 1149 | * @link https://msdn.microsoft.com/en-us/library/dd952348(v=office.12).aspx |
||
| 1150 | */ |
||
| 1151 | 4 | private function readRecordMouseClickInteractiveInfoContainer($stream, $pos) |
|
| 1174 | |||
| 1175 | /** |
||
| 1176 | * A container record that specifies what actions to perform when interacting with an object by moving the mouse cursor over it. |
||
| 1177 | * @param string $stream |
||
| 1178 | * @param integer $pos |
||
| 1179 | * @return array |
||
| 1180 | * @throws \Exception |
||
| 1181 | * @link https://msdn.microsoft.com/en-us/library/dd925811(v=office.12).aspx |
||
| 1182 | */ |
||
| 1183 | 4 | private function readRecordMouseOverInteractiveInfoContainer($stream, $pos) |
|
| 1200 | |||
| 1201 | /** |
||
| 1202 | * The OfficeArtBlip record specifies BLIP file data. |
||
| 1203 | * @param string $stream |
||
| 1204 | * @param integer $pos |
||
| 1205 | * @return array |
||
| 1206 | * @throws \Exception |
||
| 1207 | * @link https://msdn.microsoft.com/en-us/library/dd910081(v=office.12).aspx |
||
| 1208 | */ |
||
| 1209 | 4 | private function readRecordOfficeArtBlip($stream, $pos) |
|
| 1246 | |||
| 1247 | /** |
||
| 1248 | * The OfficeArtChildAnchor record specifies four signed integers that specify the anchor for the shape that contains this record. |
||
| 1249 | * @param string $stream |
||
| 1250 | * @param integer $pos |
||
| 1251 | * @return array |
||
| 1252 | * @link https://msdn.microsoft.com/en-us/library/dd922720(v=office.12).aspx |
||
| 1253 | */ |
||
| 1254 | 4 | private function readRecordOfficeArtChildAnchor($stream, $pos) |
|
| 1277 | |||
| 1278 | /** |
||
| 1279 | * An atom record that specifies the location of a shape. |
||
| 1280 | * @param string $stream |
||
| 1281 | * @param integer $pos |
||
| 1282 | * @return array |
||
| 1283 | * @throws \Exception |
||
| 1284 | * @link https://msdn.microsoft.com/en-us/library/dd922797(v=office.12).aspx |
||
| 1285 | */ |
||
| 1286 | 4 | private function readRecordOfficeArtClientAnchor($stream, $pos) |
|
| 1316 | |||
| 1317 | /** |
||
| 1318 | * A container record that specifies text related data for a shape. |
||
| 1319 | * @param string $stream |
||
| 1320 | * @param integer $pos |
||
| 1321 | * @return array |
||
| 1322 | * @throws \Exception |
||
| 1323 | * @link https://msdn.microsoft.com/en-us/library/dd910958(v=office.12).aspx |
||
| 1324 | */ |
||
| 1325 | 4 | private function readRecordOfficeArtClientTextbox($stream, $pos) |
|
| 1464 | |||
| 1465 | /** |
||
| 1466 | * The OfficeArtSpContainer record specifies a shape container. |
||
| 1467 | * @param string $stream |
||
| 1468 | * @param integer $pos |
||
| 1469 | * @return array |
||
| 1470 | * @throws \Exception |
||
| 1471 | * @link https://msdn.microsoft.com/en-us/library/dd943794(v=office.12).aspx |
||
| 1472 | */ |
||
| 1473 | 4 | private function readRecordOfficeArtSpContainer($stream, $pos) |
|
| 1726 | |||
| 1727 | /** |
||
| 1728 | * The OfficeArtSpgrContainer record specifies a container for groups of shapes. |
||
| 1729 | * @param string $stream |
||
| 1730 | * @param integer $pos |
||
| 1731 | * @param boolean $bInGroup |
||
| 1732 | * @return array |
||
| 1733 | * @throws \Exception |
||
| 1734 | * @link : https://msdn.microsoft.com/en-us/library/dd910416(v=office.12).aspx |
||
| 1735 | */ |
||
| 1736 | 4 | private function readRecordOfficeArtSpgrContainer($stream, $pos, $bInGroup = false) |
|
| 1800 | |||
| 1801 | /** |
||
| 1802 | * The OfficeArtTertiaryFOPT record specifies a table of OfficeArtRGFOPTE records,. |
||
| 1803 | * @param string $stream |
||
| 1804 | * @param integer $pos |
||
| 1805 | * @return array |
||
| 1806 | * @throws \Exception |
||
| 1807 | * @link https://msdn.microsoft.com/en-us/library/dd950206(v=office.12).aspx |
||
| 1808 | */ |
||
| 1809 | 4 | private function readRecordOfficeArtTertiaryFOPT($stream, $pos) |
|
| 1865 | |||
| 1866 | /** |
||
| 1867 | * The OfficeArtDgContainer record specifies the container for all the file records for the objects in a drawing. |
||
| 1868 | * @param string $stream |
||
| 1869 | * @param integer $pos |
||
| 1870 | * @return array |
||
| 1871 | * @throws \Exception |
||
| 1872 | * @link : https://msdn.microsoft.com/en-us/library/dd924455(v=office.12).aspx |
||
| 1873 | */ |
||
| 1874 | 4 | private function readRecordOfficeArtDgContainer($stream, $pos) |
|
| 1905 | |||
| 1906 | /** |
||
| 1907 | * The OfficeArtFDG record specifies the number of shapes, the drawing identifier, and the shape identifier of the last shape in a drawing. |
||
| 1908 | * @param string $stream |
||
| 1909 | * @param integer $pos |
||
| 1910 | * @return array |
||
| 1911 | * @link : https://msdn.microsoft.com/en-us/library/dd946757(v=office.12).aspx |
||
| 1912 | */ |
||
| 1913 | 4 | private function readRecordOfficeArtFDG($stream, $pos) |
|
| 1929 | |||
| 1930 | /** |
||
| 1931 | * The OfficeArtFOPT record specifies a table of OfficeArtRGFOPTE records. |
||
| 1932 | * @param string $stream |
||
| 1933 | * @param integer $pos |
||
| 1934 | * @return array |
||
| 1935 | * @link https://msdn.microsoft.com/en-us/library/dd943404(v=office.12).aspx |
||
| 1936 | */ |
||
| 1937 | 4 | private function readRecordOfficeArtFOPT($stream, $pos) |
|
| 1938 | { |
||
| 1939 | $arrayReturn = array( |
||
| 1940 | 4 | 'length' => 0, |
|
| 1941 | ); |
||
| 1942 | |||
| 1943 | 4 | $data = $this->loadRecordHeader($stream, $pos); |
|
| 1944 | 4 | if ($data['recVer'] == 0x3 && $data['recType'] == 0xF00B) { |
|
| 1945 | // Record Header |
||
| 1946 | 4 | $arrayReturn['length'] += 8; |
|
| 1947 | |||
| 1948 | //@link : http://msdn.microsoft.com/en-us/library/dd906086(v=office.12).aspx |
||
| 1949 | 4 | $officeArtFOPTE = array(); |
|
| 1950 | 4 | for ($inc = 0; $inc < $data['recInstance']; $inc++) { |
|
| 1951 | 4 | $opid = self::getInt2d($this->streamPowerpointDocument, $pos + $arrayReturn['length']); |
|
| 1952 | 4 | $arrayReturn['length'] += 2; |
|
| 1953 | 4 | $data['recLen'] -= 2; |
|
| 1954 | 4 | $optOp = self::getInt4d($this->streamPowerpointDocument, $pos + $arrayReturn['length']); |
|
| 1955 | 4 | $arrayReturn['length'] += 4; |
|
| 1956 | 4 | $data['recLen'] -= 4; |
|
| 1957 | 4 | $officeArtFOPTE[] = array( |
|
| 1958 | 4 | 'opid' => ($opid >> 0) & bindec('11111111111111'), |
|
| 1959 | 4 | 'fBid' => ($opid >> 14) & bindec('1'), |
|
| 1960 | 4 | 'fComplex' => ($opid >> 15) & bindec('1'), |
|
| 1961 | 4 | 'op' => $optOp, |
|
| 1962 | ); |
||
| 1963 | } |
||
| 1964 | //@link : http://code.metager.de/source/xref/kde/calligra/filters/libmso/OPID |
||
| 1965 | 4 | foreach ($officeArtFOPTE as $opt) { |
|
| 1966 | // echo $opt['opid'].'-0x'.dechex($opt['opid']).EOL; |
||
| 1967 | 4 | switch ($opt['opid']) { |
|
| 1968 | 4 | case 0x0004: |
|
| 1969 | // Transform : rotation |
||
| 1970 | //@link : https://msdn.microsoft.com/en-us/library/dd949750(v=office.12).aspx |
||
| 1971 | $arrayReturn['rotation'] = $opt['op']; |
||
| 1972 | break; |
||
| 1973 | 4 | case 0x007F: |
|
| 1974 | // Transform : Protection Boolean Properties |
||
| 1975 | //@link : http://msdn.microsoft.com/en-us/library/dd909131(v=office.12).aspx |
||
| 1976 | 4 | break; |
|
| 1977 | 4 | case 0x0080: |
|
| 1978 | // Text : ltxid |
||
| 1979 | //@link : http://msdn.microsoft.com/en-us/library/dd947446(v=office.12).aspx |
||
| 1980 | 4 | break; |
|
| 1981 | 4 | case 0x0081: |
|
| 1982 | // Text : dxTextLeft |
||
| 1983 | //@link : http://msdn.microsoft.com/en-us/library/dd953234(v=office.12).aspx |
||
| 1984 | 4 | $arrayReturn['insetLeft'] = \PhpOffice\Common\Drawing::emuToPixels($opt['op']); |
|
| 1985 | 4 | break; |
|
| 1986 | 4 | case 0x0082: |
|
| 1987 | // Text : dyTextTop |
||
| 1988 | //@link : http://msdn.microsoft.com/en-us/library/dd925068(v=office.12).aspx |
||
| 1989 | 4 | $arrayReturn['insetTop'] = \PhpOffice\Common\Drawing::emuToPixels($opt['op']); |
|
| 1990 | 4 | break; |
|
| 1991 | 4 | case 0x0083: |
|
| 1992 | // Text : dxTextRight |
||
| 1993 | //@link : http://msdn.microsoft.com/en-us/library/dd906782(v=office.12).aspx |
||
| 1994 | 4 | $arrayReturn['insetRight'] = \PhpOffice\Common\Drawing::emuToPixels($opt['op']); |
|
| 1995 | 4 | break; |
|
| 1996 | 4 | case 0x0084: |
|
| 1997 | // Text : dyTextBottom |
||
| 1998 | //@link : http://msdn.microsoft.com/en-us/library/dd772858(v=office.12).aspx |
||
| 1999 | 4 | $arrayReturn['insetBottom'] = \PhpOffice\Common\Drawing::emuToPixels($opt['op']); |
|
| 2000 | 4 | break; |
|
| 2001 | 4 | case 0x0085: |
|
| 2002 | // Text : WrapText |
||
| 2003 | //@link : http://msdn.microsoft.com/en-us/library/dd924770(v=office.12).aspx |
||
| 2004 | 4 | break; |
|
| 2005 | 4 | case 0x0087: |
|
| 2006 | // Text : anchorText |
||
| 2007 | //@link : http://msdn.microsoft.com/en-us/library/dd948575(v=office.12).aspx |
||
| 2008 | 4 | break; |
|
| 2009 | 4 | case 0x00BF: |
|
| 2010 | // Text : Text Boolean Properties |
||
| 2011 | //@link : http://msdn.microsoft.com/en-us/library/dd950905(v=office.12).aspx |
||
| 2012 | 4 | break; |
|
| 2013 | 4 | case 0x0104: |
|
| 2014 | // Blip : pib |
||
| 2015 | //@link : http://msdn.microsoft.com/en-us/library/dd772837(v=office.12).aspx |
||
| 2016 | 4 | if ($opt['fComplex'] == 0) { |
|
| 2017 | 4 | $arrayReturn['pib'] = $opt['op']; |
|
| 2018 | 4 | $data['recLen'] -= $opt['op']; |
|
| 2019 | } else { |
||
| 2020 | // pib Complex |
||
| 2021 | } |
||
| 2022 | 4 | break; |
|
| 2023 | 4 | case 0x13F: |
|
| 2024 | // Blip Boolean Properties |
||
| 2025 | //@link : https://msdn.microsoft.com/en-us/library/dd944215(v=office.12).aspx |
||
| 2026 | break; |
||
| 2027 | 4 | case 0x140: |
|
| 2028 | // Geometry : geoLeft |
||
| 2029 | //@link : http://msdn.microsoft.com/en-us/library/dd947489(v=office.12).aspx |
||
| 2030 | // print_r('geoLeft : '.$opt['op'].EOL); |
||
| 2031 | 2 | break; |
|
| 2032 | 4 | case 0x141: |
|
| 2033 | // Geometry : geoTop |
||
| 2034 | //@link : http://msdn.microsoft.com/en-us/library/dd949459(v=office.12).aspx |
||
| 2035 | // print_r('geoTop : '.$opt['op'].EOL); |
||
| 2036 | 2 | break; |
|
| 2037 | 4 | case 0x142: |
|
| 2038 | // Geometry : geoRight |
||
| 2039 | //@link : http://msdn.microsoft.com/en-us/library/dd947117(v=office.12).aspx |
||
| 2040 | // print_r('geoRight : '.$opt['op'].EOL); |
||
| 2041 | 2 | break; |
|
| 2042 | 4 | case 0x143: |
|
| 2043 | // Geometry : geoBottom |
||
| 2044 | //@link : http://msdn.microsoft.com/en-us/library/dd948602(v=office.12).aspx |
||
| 2045 | // print_r('geoBottom : '.$opt['op'].EOL); |
||
| 2046 | 2 | break; |
|
| 2047 | 4 | case 0x144: |
|
| 2048 | // Geometry : shapePath |
||
| 2049 | //@link : http://msdn.microsoft.com/en-us/library/dd945249(v=office.12).aspx |
||
| 2050 | 1 | $arrayReturn['line'] = true; |
|
| 2051 | 1 | break; |
|
| 2052 | 4 | case 0x145: |
|
| 2053 | // Geometry : pVertices |
||
| 2054 | //@link : http://msdn.microsoft.com/en-us/library/dd949814(v=office.12).aspx |
||
| 2055 | 2 | if ($opt['fComplex'] == 1) { |
|
| 2056 | 2 | $arrayReturn['length'] += $opt['op']; |
|
| 2057 | 2 | $data['recLen'] -= $opt['op']; |
|
| 2058 | } |
||
| 2059 | 2 | break; |
|
| 2060 | 4 | case 0x146: |
|
| 2061 | // Geometry : pSegmentInfo |
||
| 2062 | //@link : http://msdn.microsoft.com/en-us/library/dd905742(v=office.12).aspx |
||
| 2063 | 2 | if ($opt['fComplex'] == 1) { |
|
| 2064 | 2 | $arrayReturn['length'] += $opt['op']; |
|
| 2065 | 2 | $data['recLen'] -= $opt['op']; |
|
| 2066 | } |
||
| 2067 | 2 | break; |
|
| 2068 | 4 | case 0x155: |
|
| 2069 | // Geometry : pAdjustHandles |
||
| 2070 | //@link : http://msdn.microsoft.com/en-us/library/dd905890(v=office.12).aspx |
||
| 2071 | 2 | if ($opt['fComplex'] == 1) { |
|
| 2072 | 2 | $arrayReturn['length'] += $opt['op']; |
|
| 2073 | 2 | $data['recLen'] -= $opt['op']; |
|
| 2074 | } |
||
| 2075 | 2 | break; |
|
| 2076 | 4 | case 0x156: |
|
| 2077 | // Geometry : pGuides |
||
| 2078 | //@link : http://msdn.microsoft.com/en-us/library/dd910801(v=office.12).aspx |
||
| 2079 | 2 | if ($opt['fComplex'] == 1) { |
|
| 2080 | 2 | $arrayReturn['length'] += $opt['op']; |
|
| 2081 | 2 | $data['recLen'] -= $opt['op']; |
|
| 2082 | } |
||
| 2083 | 2 | break; |
|
| 2084 | 4 | case 0x157: |
|
| 2085 | // Geometry : pInscribe |
||
| 2086 | //@link : http://msdn.microsoft.com/en-us/library/dd904889(v=office.12).aspx |
||
| 2087 | 2 | if ($opt['fComplex'] == 1) { |
|
| 2088 | 2 | $arrayReturn['length'] += $opt['op']; |
|
| 2089 | 2 | $data['recLen'] -= $opt['op']; |
|
| 2090 | } |
||
| 2091 | 2 | break; |
|
| 2092 | 4 | case 0x17F: |
|
| 2093 | // Geometry Boolean Properties |
||
| 2094 | //@link : http://msdn.microsoft.com/en-us/library/dd944968(v=office.12).aspx |
||
| 2095 | 1 | break; |
|
| 2096 | 4 | case 0x0180: |
|
| 2097 | // Fill : fillType |
||
| 2098 | //@link : http://msdn.microsoft.com/en-us/library/dd947909(v=office.12).aspx |
||
| 2099 | 4 | break; |
|
| 2100 | 4 | case 0x0181: |
|
| 2101 | // Fill : fillColor |
||
| 2102 | //@link : http://msdn.microsoft.com/en-us/library/dd921332(v=office.12).aspx |
||
| 2103 | 4 | $strColor = str_pad(dechex(($opt['op'] >> 0) & bindec('11111111')), 2, STR_PAD_LEFT, '0'); |
|
| 2104 | 4 | $strColor .= str_pad(dechex(($opt['op'] >> 8) & bindec('11111111')), 2, STR_PAD_LEFT, '0'); |
|
| 2105 | 4 | $strColor .= str_pad(dechex(($opt['op'] >> 16) & bindec('11111111')), 2, STR_PAD_LEFT, '0'); |
|
| 2106 | // echo 'fillColor : '.$strColor.EOL; |
||
| 2107 | 4 | break; |
|
| 2108 | 4 | case 0x0183: |
|
| 2109 | // Fill : fillBackColor |
||
| 2110 | //@link : http://msdn.microsoft.com/en-us/library/dd950634(v=office.12).aspx |
||
| 2111 | 4 | $strColor = str_pad(dechex(($opt['op'] >> 0) & bindec('11111111')), 2, STR_PAD_LEFT, '0'); |
|
| 2112 | 4 | $strColor .= str_pad(dechex(($opt['op'] >> 8) & bindec('11111111')), 2, STR_PAD_LEFT, '0'); |
|
| 2113 | 4 | $strColor .= str_pad(dechex(($opt['op'] >> 16) & bindec('11111111')), 2, STR_PAD_LEFT, '0'); |
|
| 2114 | // echo 'fillBackColor : '.$strColor.EOL; |
||
| 2115 | 4 | break; |
|
| 2116 | 4 | case 0x0193: |
|
| 2117 | // Fill : fillRectRight |
||
| 2118 | //@link : http://msdn.microsoft.com/en-us/library/dd951294(v=office.12).aspx |
||
| 2119 | // echo 'fillRectRight : '.\PhpOffice\Common\Drawing::emuToPixels($opt['op']).EOL; |
||
| 2120 | 4 | break; |
|
| 2121 | 4 | case 0x0194: |
|
| 2122 | // Fill : fillRectBottom |
||
| 2123 | //@link : http://msdn.microsoft.com/en-us/library/dd910194(v=office.12).aspx |
||
| 2124 | // echo 'fillRectBottom : '.\PhpOffice\Common\Drawing::emuToPixels($opt['op']).EOL; |
||
| 2125 | 4 | break; |
|
| 2126 | 4 | case 0x01BF: |
|
| 2127 | // Fill : Fill Style Boolean Properties |
||
| 2128 | //@link : http://msdn.microsoft.com/en-us/library/dd909380(v=office.12).aspx |
||
| 2129 | 4 | break; |
|
| 2130 | 4 | case 0x01C0: |
|
| 2131 | // Line Style : lineColor |
||
| 2132 | //@link : http://msdn.microsoft.com/en-us/library/dd920397(v=office.12).aspx |
||
| 2133 | 4 | $strColor = str_pad(dechex(($opt['op'] >> 0) & bindec('11111111')), 2, STR_PAD_LEFT, '0'); |
|
| 2134 | 4 | $strColor .= str_pad(dechex(($opt['op'] >> 8) & bindec('11111111')), 2, STR_PAD_LEFT, '0'); |
|
| 2135 | 4 | $strColor .= str_pad(dechex(($opt['op'] >> 16) & bindec('11111111')), 2, STR_PAD_LEFT, '0'); |
|
| 2136 | 4 | $arrayReturn['lineColor'] = $strColor; |
|
| 2137 | 4 | break; |
|
| 2138 | 4 | case 0x01C1: |
|
| 2139 | // Line Style : lineOpacity |
||
| 2140 | //@link : http://msdn.microsoft.com/en-us/library/dd923433(v=office.12).aspx |
||
| 2141 | // echo 'lineOpacity : '.dechex($opt['op']).EOL; |
||
| 2142 | 4 | break; |
|
| 2143 | 4 | case 0x01C2: |
|
| 2144 | // Line Style : lineBackColor |
||
| 2145 | //@link : http://msdn.microsoft.com/en-us/library/dd947669(v=office.12).aspx |
||
| 2146 | 4 | break; |
|
| 2147 | 4 | case 0x01CB: |
|
| 2148 | // Line Style : lineWidth |
||
| 2149 | //@link : http://msdn.microsoft.com/en-us/library/dd926964(v=office.12).aspx |
||
| 2150 | 2 | $arrayReturn['lineWidth'] = \PhpOffice\Common\Drawing::emuToPixels($opt['op']); |
|
| 2151 | 2 | break; |
|
| 2152 | 4 | case 0x01D6: |
|
| 2153 | // Line Style : lineJoinStyle |
||
| 2154 | //@link : http://msdn.microsoft.com/en-us/library/dd909643(v=office.12).aspx |
||
| 2155 | 4 | break; |
|
| 2156 | 4 | case 0x01D7: |
|
| 2157 | // Line Style : lineEndCapStyle |
||
| 2158 | //@link : http://msdn.microsoft.com/en-us/library/dd925071(v=office.12).aspx |
||
| 2159 | 4 | break; |
|
| 2160 | 4 | case 0x01FF: |
|
| 2161 | // Line Style : Line Style Boolean Properties |
||
| 2162 | //@link : http://msdn.microsoft.com/en-us/library/dd951605(v=office.12).aspx |
||
| 2163 | 4 | break; |
|
| 2164 | 4 | case 0x0201: |
|
| 2165 | // Shadow Style : shadowColor |
||
| 2166 | //@link : http://msdn.microsoft.com/en-us/library/dd923454(v=office.12).aspx |
||
| 2167 | 4 | break; |
|
| 2168 | 4 | case 0x0204: |
|
| 2169 | // Shadow Style : shadowOpacity |
||
| 2170 | //@link : http://msdn.microsoft.com/en-us/library/dd920720(v=office.12).aspx |
||
| 2171 | 3 | break; |
|
| 2172 | 4 | case 0x0205: |
|
| 2173 | // Shadow Style : shadowOffsetX |
||
| 2174 | //@link : http://msdn.microsoft.com/en-us/library/dd945280(v=office.12).aspx |
||
| 2175 | 3 | $arrayReturn['shadowOffsetX'] = \PhpOffice\Common\Drawing::emuToPixels($opt['op']); |
|
| 2176 | 3 | break; |
|
| 2177 | 4 | case 0x0206: |
|
| 2178 | // Shadow Style : shadowOffsetY |
||
| 2179 | //@link : http://msdn.microsoft.com/en-us/library/dd907855(v=office.12).aspx |
||
| 2180 | 3 | $arrayReturn['shadowOffsetY'] = \PhpOffice\Common\Drawing::emuToPixels($opt['op']); |
|
| 2181 | 3 | break; |
|
| 2182 | 4 | case 0x023F: |
|
| 2183 | // Shadow Style : Shadow Style Boolean Properties |
||
| 2184 | //@link : http://msdn.microsoft.com/en-us/library/dd947887(v=office.12).aspx |
||
| 2185 | 4 | break; |
|
| 2186 | 4 | case 0x0304: |
|
| 2187 | // Shape : bWMode |
||
| 2188 | //@link : http://msdn.microsoft.com/en-us/library/dd947659(v=office.12).aspx |
||
| 2189 | 4 | break; |
|
| 2190 | 4 | case 0x033F: |
|
| 2191 | // Shape Boolean Properties |
||
| 2192 | //@link : http://msdn.microsoft.com/en-us/library/dd951345(v=office.12).aspx |
||
| 2193 | 4 | break; |
|
| 2194 | 1 | case 0x0380: |
|
| 2195 | // Group Shape Property Set : wzName |
||
| 2196 | //@link : http://msdn.microsoft.com/en-us/library/dd950681(v=office.12).aspx |
||
| 2197 | if ($opt['fComplex'] == 1) { |
||
| 2198 | $arrayReturn['length'] += $opt['op']; |
||
| 2199 | $data['recLen'] -= $opt['op']; |
||
| 2200 | } |
||
| 2201 | break; |
||
| 2202 | 1 | case 0x03BF: |
|
| 2203 | // Group Shape Property Set : Group Shape Boolean Properties |
||
| 2204 | //@link : http://msdn.microsoft.com/en-us/library/dd949807(v=office.12).aspx |
||
| 2205 | break; |
||
| 2206 | default: |
||
| 2207 | // throw new \Exception('Feature not implemented (l.'.__LINE__.' : 0x'.dechex($opt['opid']).')'); |
||
| 2208 | } |
||
| 2209 | } |
||
| 2210 | 4 | if ($data['recLen'] > 0) { |
|
| 2211 | 2 | $arrayReturn['length'] += $data['recLen']; |
|
| 2212 | } |
||
| 2213 | } |
||
| 2214 | |||
| 2215 | 4 | return $arrayReturn; |
|
| 2216 | } |
||
| 2217 | |||
| 2218 | /** |
||
| 2219 | * The OfficeArtFPSPL record specifies the former hierarchical position of the containing object that is either a shape or a group of shapes. |
||
| 2220 | * @param string $stream |
||
| 2221 | * @param integer $pos |
||
| 2222 | * @return array |
||
| 2223 | * @link https://msdn.microsoft.com/en-us/library/dd947479(v=office.12).aspx |
||
| 2224 | */ |
||
| 2225 | private function readRecordOfficeArtFPSPL($stream, $pos) |
||
| 2239 | |||
| 2240 | /** |
||
| 2241 | * The OfficeArtFSP record specifies an instance of a shape. |
||
| 2242 | * @param string $stream |
||
| 2243 | * @param integer $pos |
||
| 2244 | * @return array |
||
| 2245 | * @link https://msdn.microsoft.com/en-us/library/dd925898(v=office.12).aspx |
||
| 2246 | */ |
||
| 2247 | 4 | private function readRecordOfficeArtFSP($stream, $pos) |
|
| 2269 | |||
| 2270 | /** |
||
| 2271 | * The OfficeArtFSPGR record specifies the coordinate system of the group shape that the anchors of the child shape are expressed in. |
||
| 2272 | * @param string $stream |
||
| 2273 | * @param integer $pos |
||
| 2274 | * @return array |
||
| 2275 | * @link https://msdn.microsoft.com/en-us/library/dd925381(v=office.12).aspx |
||
| 2276 | */ |
||
| 2277 | 4 | private function readRecordOfficeArtFSPGR($stream, $pos) |
|
| 2298 | |||
| 2299 | /** |
||
| 2300 | * The OfficeArtSecondaryFOPT record specifies a table of OfficeArtRGFOPTE records. |
||
| 2301 | * @param string $stream |
||
| 2302 | * @param integer $pos |
||
| 2303 | * @return array |
||
| 2304 | * @link https://msdn.microsoft.com/en-us/library/dd950259(v=office.12).aspx |
||
| 2305 | */ |
||
| 2306 | 4 | private function readRecordOfficeArtSecondaryFOPT($stream, $pos) |
|
| 2321 | |||
| 2322 | /** |
||
| 2323 | * A container record that specifies information about a shape. |
||
| 2324 | * @param string $stream |
||
| 2325 | * @param integer $pos |
||
| 2326 | * @return array |
||
| 2327 | * @throws \Exception |
||
| 2328 | * @link : https://msdn.microsoft.com/en-us/library/dd950927(v=office.12).aspx |
||
| 2329 | */ |
||
| 2330 | 4 | private function readRecordOfficeArtClientData($stream, $pos) |
|
| 2404 | |||
| 2405 | /** |
||
| 2406 | * An atom record that specifies a persist object directory. Each persist object identifier specified MUST be unique in that persist object directory. |
||
| 2407 | * @link http://msdn.microsoft.com/en-us/library/dd952680(v=office.12).aspx |
||
| 2408 | * @param string $stream |
||
| 2409 | * @param integer $pos |
||
| 2410 | * @throws \Exception |
||
| 2411 | */ |
||
| 2412 | 4 | private function readRecordPersistDirectoryAtom($stream, $pos) |
|
| 2437 | |||
| 2438 | /** |
||
| 2439 | * A container record that specifies information about the headers (1) and footers within a slide. |
||
| 2440 | * @param string $stream |
||
| 2441 | * @param integer $pos |
||
| 2442 | * @link https://msdn.microsoft.com/en-us/library/dd904856(v=office.12).aspx |
||
| 2443 | * @return array |
||
| 2444 | */ |
||
| 2445 | 4 | private function readRecordPerSlideHeadersFootersContainer($stream, $pos) |
|
| 2461 | |||
| 2462 | /** |
||
| 2463 | * An atom record that specifies whether a shape is a placeholder shape. |
||
| 2464 | * @param string $stream |
||
| 2465 | * @param integer $pos |
||
| 2466 | * @link https://msdn.microsoft.com/en-us/library/dd923930(v=office.12).aspx |
||
| 2467 | * @return array |
||
| 2468 | */ |
||
| 2469 | 4 | private function readRecordPlaceholderAtom($stream, $pos) |
|
| 2485 | |||
| 2486 | /** |
||
| 2487 | * An atom record that specifies a collection of re-color mappings for a metafile ([MS-WMF]). |
||
| 2488 | * @param string $stream |
||
| 2489 | * @param integer $pos |
||
| 2490 | * @link https://msdn.microsoft.com/en-us/library/dd904899(v=office.12).aspx |
||
| 2491 | * @return array |
||
| 2492 | */ |
||
| 2493 | 4 | private function readRecordRecolorInfoAtom($stream, $pos) |
|
| 2509 | |||
| 2510 | /** |
||
| 2511 | * An atom record that specifies that a shape is a header or footerplaceholder shape. |
||
| 2512 | * @param string $stream |
||
| 2513 | * @param integer $pos |
||
| 2514 | * @link https://msdn.microsoft.com/en-us/library/dd910800(v=office.12).aspx |
||
| 2515 | * @return array |
||
| 2516 | */ |
||
| 2517 | private function readRecordRoundTripHFPlaceholder12Atom($stream, $pos) |
||
| 2533 | |||
| 2534 | /** |
||
| 2535 | * An atom record that specifies a shape identifier. |
||
| 2536 | * @param string $stream |
||
| 2537 | * @param integer $pos |
||
| 2538 | * @link https://msdn.microsoft.com/en-us/library/dd772926(v=office.12).aspx |
||
| 2539 | * @return array |
||
| 2540 | */ |
||
| 2541 | private function readRecordRoundTripShapeId12Atom($stream, $pos) |
||
| 2557 | |||
| 2558 | /** |
||
| 2559 | * A container record that specifies information about a slide that synchronizes to a slide in a slide library. |
||
| 2560 | * @param string $stream |
||
| 2561 | * @param integer $pos |
||
| 2562 | * @link https://msdn.microsoft.com/en-us/library/dd923801(v=office.12).aspx |
||
| 2563 | * @return array |
||
| 2564 | */ |
||
| 2565 | 4 | private function readRecordRoundTripSlideSyncInfo12Container($stream, $pos) |
|
| 2581 | |||
| 2582 | /** |
||
| 2583 | * An atom record that specifies shape-level Boolean flags. |
||
| 2584 | * @param string $stream |
||
| 2585 | * @param integer $pos |
||
| 2586 | * @link https://msdn.microsoft.com/en-us/library/dd908949(v=office.12).aspx |
||
| 2587 | * @return array |
||
| 2588 | */ |
||
| 2589 | 4 | private function readRecordShapeFlags10Atom($stream, $pos) |
|
| 2605 | |||
| 2606 | /** |
||
| 2607 | * An atom record that specifies shape-level Boolean flags. |
||
| 2608 | * @param string $stream |
||
| 2609 | * @param integer $pos |
||
| 2610 | * @link https://msdn.microsoft.com/en-us/library/dd925824(v=office.12).aspx |
||
| 2611 | * @return array |
||
| 2612 | */ |
||
| 2613 | 4 | private function readRecordShapeFlagsAtom($stream, $pos) |
|
| 2629 | |||
| 2630 | /** |
||
| 2631 | * A container record that specifies programmable tags with additional binary shape data. |
||
| 2632 | * @param string $stream |
||
| 2633 | * @param integer $pos |
||
| 2634 | * @link https://msdn.microsoft.com/en-us/library/dd911033(v=office.12).aspx |
||
| 2635 | * @return array |
||
| 2636 | */ |
||
| 2637 | private function readRecordShapeProgBinaryTagContainer($stream, $pos) |
||
| 2653 | |||
| 2654 | /** |
||
| 2655 | * A container record that specifies programmable tags with additional shape data. |
||
| 2656 | * @param string $stream |
||
| 2657 | * @param integer $pos |
||
| 2658 | * @return array |
||
| 2659 | * @throws \Exception |
||
| 2660 | * @link https://msdn.microsoft.com/en-us/library/dd911266(v=office.12).aspx |
||
| 2661 | */ |
||
| 2662 | private function readRecordShapeProgTagsContainer($stream, $pos) |
||
| 2692 | |||
| 2693 | /** |
||
| 2694 | * An atom record that specifies information about a slide. |
||
| 2695 | * @param string $stream |
||
| 2696 | * @param integer $pos |
||
| 2697 | * @return array |
||
| 2698 | * @link https://msdn.microsoft.com/en-us/library/dd923801(v=office.12).aspx |
||
| 2699 | */ |
||
| 2700 | 4 | private function readRecordSlideAtom($stream, $pos) |
|
| 2731 | |||
| 2732 | /** |
||
| 2733 | * A container record that specifies a presentation slide or title master slide. |
||
| 2734 | * @param string $stream |
||
| 2735 | * @param int $pos |
||
| 2736 | * @throws \Exception |
||
| 2737 | * @link http://msdn.microsoft.com/en-us/library/dd946323(v=office.12).aspx |
||
| 2738 | */ |
||
| 2739 | 4 | private function readRecordSlideContainer($stream, $pos) |
|
| 2785 | |||
| 2786 | /** |
||
| 2787 | * An atom record that specifies the name of a slide. |
||
| 2788 | * @param string $stream |
||
| 2789 | * @param integer $pos |
||
| 2790 | * @link https://msdn.microsoft.com/en-us/library/dd906297(v=office.12).aspx |
||
| 2791 | * @return array |
||
| 2792 | */ |
||
| 2793 | 4 | private function readRecordSlideNameAtom($stream, $pos) |
|
| 2815 | |||
| 2816 | /** |
||
| 2817 | * An atom record that specifies a slide number metacharacter. |
||
| 2818 | * @param string $stream |
||
| 2819 | * @param integer $pos |
||
| 2820 | * @link https://msdn.microsoft.com/en-us/library/dd945703(v=office.12).aspx |
||
| 2821 | * @return array |
||
| 2822 | */ |
||
| 2823 | 4 | private function readRecordSlideNumberMCAtom($stream, $pos) |
|
| 2839 | |||
| 2840 | /** |
||
| 2841 | * A container record that specifies programmable tags with additional slide data. |
||
| 2842 | * @param string $stream |
||
| 2843 | * @param integer $pos |
||
| 2844 | * @link https://msdn.microsoft.com/en-us/library/dd951946(v=office.12).aspx |
||
| 2845 | * @return array |
||
| 2846 | */ |
||
| 2847 | 4 | private function readRecordSlideProgTagsContainer($stream, $pos) |
|
| 2863 | |||
| 2864 | /** |
||
| 2865 | * A container record that specifies the color scheme used by a slide. |
||
| 2866 | * @param string $stream |
||
| 2867 | * @param integer $pos |
||
| 2868 | * @link https://msdn.microsoft.com/en-us/library/dd949420(v=office.12).aspx |
||
| 2869 | * @return array |
||
| 2870 | */ |
||
| 2871 | 4 | private function readRecordSlideSchemeColorSchemeAtom($stream, $pos) |
|
| 2895 | |||
| 2896 | /** |
||
| 2897 | * An atom record that specifies what transition effect to perform during a slide show, and how to advance to the next presentation slide. |
||
| 2898 | * @param string $stream |
||
| 2899 | * @param integer $pos |
||
| 2900 | * @link https://msdn.microsoft.com/en-us/library/dd943408(v=office.12).aspx |
||
| 2901 | * @return array |
||
| 2902 | */ |
||
| 2903 | 4 | private function readRecordSlideShowSlideInfoAtom($stream, $pos) |
|
| 2919 | |||
| 2920 | /** |
||
| 2921 | * UserEditAtom |
||
| 2922 | * @link http://msdn.microsoft.com/en-us/library/dd945746(v=office.12).aspx |
||
| 2923 | * @param string $stream |
||
| 2924 | * @param integer $pos |
||
| 2925 | * @throws \Exception |
||
| 2926 | */ |
||
| 2927 | 4 | private function readRecordUserEditAtom($stream, $pos) |
|
| 2974 | |||
| 2975 | /** |
||
| 2976 | * A structure that specifies the character-level formatting of a run of text. |
||
| 2977 | * @param string $stream |
||
| 2978 | * @param int $pos |
||
| 2979 | * @param int $strLenRT |
||
| 2980 | * @return array |
||
| 2981 | * @throws \Exception |
||
| 2982 | * @link https://msdn.microsoft.com/en-us/library/dd945870(v=office.12).aspx |
||
| 2983 | */ |
||
| 2984 | 4 | private function readStructureTextCFRun($stream, $pos, $strLenRT) |
|
| 3091 | |||
| 3092 | /** |
||
| 3093 | * A structure that specifies the paragraph-level formatting of a run of text. |
||
| 3094 | * @param string $stream |
||
| 3095 | * @param integer $pos |
||
| 3096 | * @param integer $strLenRT |
||
| 3097 | * @return array |
||
| 3098 | * @throws \Exception |
||
| 3099 | * @link https://msdn.microsoft.com/en-us/library/dd923535(v=office.12).aspx |
||
| 3100 | */ |
||
| 3101 | 4 | private function readStructureTextPFRun($stream, $pos, $strLenRT) |
|
| 3102 | { |
||
| 3103 | $arrayReturn = array( |
||
| 3104 | 4 | 'length' => 0, |
|
| 3105 | 4 | 'strLenRT' => $strLenRT, |
|
| 3106 | ); |
||
| 3107 | |||
| 3108 | // rgTextPFRun |
||
| 3109 | 4 | $countRgTextPFRun = self::getInt4d($stream, $pos + $arrayReturn['length']); |
|
| 3110 | 4 | $arrayReturn['strLenRT'] -= $countRgTextPFRun; |
|
| 3111 | 4 | $arrayReturn['length'] += 4; |
|
| 3112 | |||
| 3113 | // indent |
||
| 3114 | 4 | $arrayReturn['length'] += 2; |
|
| 3115 | |||
| 3116 | 4 | $masks = self::getInt4d($stream, $pos + $arrayReturn['length']); |
|
| 3117 | 4 | $arrayReturn['length'] += 4; |
|
| 3118 | |||
| 3119 | 4 | $masksData = array(); |
|
| 3120 | 4 | $masksData['hasBullet'] = ($masks >> 0) & bindec('1'); |
|
| 3121 | 4 | $masksData['bulletHasFont'] = ($masks >> 1) & bindec('1'); |
|
| 3122 | 4 | $masksData['bulletHasColor'] = ($masks >> 2) & bindec('1'); |
|
| 3123 | 4 | $masksData['bulletHasSize'] = ($masks >> 3) & bindec('1'); |
|
| 3124 | 4 | $masksData['bulletFont'] = ($masks >> 4) & bindec('1'); |
|
| 3125 | 4 | $masksData['bulletColor'] = ($masks >> 5) & bindec('1'); |
|
| 3126 | 4 | $masksData['bulletSize'] = ($masks >> 6) & bindec('1'); |
|
| 3127 | 4 | $masksData['bulletChar'] = ($masks >> 7) & bindec('1'); |
|
| 3128 | 4 | $masksData['leftMargin'] = ($masks >> 8) & bindec('1'); |
|
| 3129 | 4 | $masksData['unused'] = ($masks >> 9) & bindec('1'); |
|
| 3130 | 4 | $masksData['indent'] = ($masks >> 10) & bindec('1'); |
|
| 3131 | 4 | $masksData['align'] = ($masks >> 11) & bindec('1'); |
|
| 3132 | 4 | $masksData['lineSpacing'] = ($masks >> 12) & bindec('1'); |
|
| 3133 | 4 | $masksData['spaceBefore'] = ($masks >> 13) & bindec('1'); |
|
| 3134 | 4 | $masksData['spaceAfter'] = ($masks >> 14) & bindec('1'); |
|
| 3135 | 4 | $masksData['defaultTabSize'] = ($masks >> 15) & bindec('1'); |
|
| 3136 | 4 | $masksData['fontAlign'] = ($masks >> 16) & bindec('1'); |
|
| 3137 | 4 | $masksData['charWrap'] = ($masks >> 17) & bindec('1'); |
|
| 3138 | 4 | $masksData['wordWrap'] = ($masks >> 18) & bindec('1'); |
|
| 3139 | 4 | $masksData['overflow'] = ($masks >> 19) & bindec('1'); |
|
| 3140 | 4 | $masksData['tabStops'] = ($masks >> 20) & bindec('1'); |
|
| 3141 | 4 | $masksData['textDirection'] = ($masks >> 21) & bindec('1'); |
|
| 3142 | 4 | $masksData['reserved1'] = ($masks >> 22) & bindec('1'); |
|
| 3143 | 4 | $masksData['bulletBlip'] = ($masks >> 23) & bindec('1'); |
|
| 3144 | 4 | $masksData['bulletScheme'] = ($masks >> 24) & bindec('1'); |
|
| 3145 | 4 | $masksData['bulletHasScheme'] = ($masks >> 25) & bindec('1'); |
|
| 3146 | |||
| 3147 | 4 | $bulletFlags = array(); |
|
| 3148 | 4 | if ($masksData['hasBullet'] == 1 || $masksData['bulletHasFont'] == 1 || $masksData['bulletHasColor'] == 1 || $masksData['bulletHasSize'] == 1) { |
|
| 3149 | 4 | $data = self::getInt2d($stream, $pos + $arrayReturn['length']); |
|
| 3150 | 4 | $arrayReturn['length'] += 2; |
|
| 3151 | |||
| 3152 | 4 | $bulletFlags['fHasBullet'] = ($data >> 0) & bindec('1'); |
|
| 3153 | 4 | $bulletFlags['fBulletHasFont'] = ($data >> 1) & bindec('1'); |
|
| 3154 | 4 | $bulletFlags['fBulletHasColor'] = ($data >> 2) & bindec('1'); |
|
| 3155 | 4 | $bulletFlags['fBulletHasSize'] = ($data >> 3) & bindec('1'); |
|
| 3156 | } |
||
| 3157 | 4 | if ($masksData['bulletChar'] == 1) { |
|
| 3158 | 1 | $data = self::getInt2d($stream, $pos + $arrayReturn['length']); |
|
| 3159 | 1 | $arrayReturn['length'] += 2; |
|
| 3160 | 1 | $arrayReturn['bulletChar'] = chr($data); |
|
| 3161 | } |
||
| 3162 | 4 | if ($masksData['bulletFont'] == 1) { |
|
| 3163 | // $data = self::getInt2d($stream, $pos); |
||
| 3164 | 1 | $arrayReturn['length'] += 2; |
|
| 3165 | } |
||
| 3166 | 4 | if ($masksData['bulletSize'] == 1) { |
|
| 3167 | // $data = self::getInt2d($stream, $pos); |
||
| 3168 | 2 | $arrayReturn['length'] += 2; |
|
| 3169 | } |
||
| 3170 | 4 | if ($masksData['bulletColor'] == 1) { |
|
| 3171 | 1 | $red = self::getInt1d($stream, $pos + $arrayReturn['length']); |
|
| 3172 | 1 | $arrayReturn['length'] += 1; |
|
| 3173 | 1 | $green = self::getInt1d($stream, $pos + $arrayReturn['length']); |
|
| 3174 | 1 | $arrayReturn['length'] += 1; |
|
| 3175 | 1 | $blue = self::getInt1d($stream, $pos + $arrayReturn['length']); |
|
| 3176 | 1 | $arrayReturn['length'] += 1; |
|
| 3177 | 1 | $index = self::getInt1d($stream, $pos + $arrayReturn['length']); |
|
| 3178 | 1 | $arrayReturn['length'] += 1; |
|
| 3179 | |||
| 3180 | 1 | if ($index == 0xFE) { |
|
| 3181 | 1 | $strColor = str_pad(dechex($red), 2, STR_PAD_LEFT, '0'); |
|
| 3182 | 1 | $strColor .= str_pad(dechex($green), 2, STR_PAD_LEFT, '0'); |
|
| 3183 | 1 | $strColor .= str_pad(dechex($blue), 2, STR_PAD_LEFT, '0'); |
|
| 3184 | } |
||
| 3185 | } |
||
| 3186 | 4 | if ($masksData['align'] == 1) { |
|
| 3187 | 4 | $data = self::getInt2d($stream, $pos + $arrayReturn['length']); |
|
| 3188 | 4 | $arrayReturn['length'] += 2; |
|
| 3189 | 4 | switch ($data) { |
|
| 3190 | 4 | case 0x0000: |
|
| 3191 | 1 | $arrayReturn['alignH'] = Alignment::HORIZONTAL_LEFT; |
|
| 3192 | 1 | break; |
|
| 3193 | 4 | case 0x0001: |
|
| 3194 | 2 | $arrayReturn['alignH'] = Alignment::HORIZONTAL_CENTER; |
|
| 3195 | 2 | break; |
|
| 3196 | 4 | case 0x0002: |
|
| 3197 | 4 | $arrayReturn['alignH'] = Alignment::HORIZONTAL_RIGHT; |
|
| 3198 | 4 | break; |
|
| 3199 | case 0x0003: |
||
| 3200 | $arrayReturn['alignH'] = Alignment::HORIZONTAL_JUSTIFY; |
||
| 3201 | break; |
||
| 3202 | case 0x0004: |
||
| 3203 | $arrayReturn['alignH'] = Alignment::HORIZONTAL_DISTRIBUTED; |
||
| 3204 | break; |
||
| 3205 | case 0x0005: |
||
| 3206 | $arrayReturn['alignH'] = Alignment::HORIZONTAL_DISTRIBUTED; |
||
| 3207 | break; |
||
| 3208 | case 0x0006: |
||
| 3209 | $arrayReturn['alignH'] = Alignment::HORIZONTAL_JUSTIFY; |
||
| 3210 | break; |
||
| 3211 | default: |
||
| 3212 | break; |
||
| 3213 | } |
||
| 3214 | } |
||
| 3215 | 4 | if ($masksData['lineSpacing'] == 1) { |
|
| 3216 | // $data = self::getInt2d($stream, $pos + $arrayReturn['length']); |
||
| 3217 | 4 | $arrayReturn['length'] += 2; |
|
| 3218 | } |
||
| 3219 | 4 | if ($masksData['spaceBefore'] == 1) { |
|
| 3220 | // $data = self::getInt2d($stream, $pos + $arrayReturn['length']); |
||
| 3221 | 2 | $arrayReturn['length'] += 2; |
|
| 3222 | } |
||
| 3223 | 4 | if ($masksData['spaceAfter'] == 1) { |
|
| 3224 | // $data = self::getInt2d($stream, $pos + $arrayReturn['length']); |
||
| 3225 | 2 | $arrayReturn['length'] += 2; |
|
| 3226 | } |
||
| 3227 | 4 | if ($masksData['leftMargin'] == 1) { |
|
| 3228 | 1 | $data = self::getInt2d($stream, $pos + $arrayReturn['length']); |
|
| 3229 | 1 | $arrayReturn['length'] += 2; |
|
| 3230 | 1 | $arrayReturn['leftMargin'] = (int)round($data/6); |
|
| 3231 | } |
||
| 3232 | 4 | if ($masksData['indent'] == 1) { |
|
| 3233 | 1 | $data = self::getInt2d($stream, $pos + $arrayReturn['length']); |
|
| 3234 | 1 | $arrayReturn['length'] += 2; |
|
| 3235 | 1 | $arrayReturn['indent'] = (int)round($data/6); |
|
| 3236 | } |
||
| 3237 | 4 | if ($masksData['defaultTabSize'] == 1) { |
|
| 3238 | // $data = self::getInt2d($stream, $pos + $arrayReturn['length']); |
||
| 3239 | $arrayReturn['length'] += 2; |
||
| 3240 | } |
||
| 3241 | 4 | if ($masksData['tabStops'] == 1) { |
|
| 3242 | throw new \Exception('Feature not implemented (l.'.__LINE__.')'); |
||
| 3243 | } |
||
| 3244 | 4 | if ($masksData['fontAlign'] == 1) { |
|
| 3245 | // $data = self::getInt2d($stream, $pos + $arrayReturn['length']); |
||
| 3246 | $arrayReturn['length'] += 2; |
||
| 3247 | } |
||
| 3248 | 4 | if ($masksData['charWrap'] == 1 || $masksData['wordWrap'] == 1 || $masksData['overflow'] == 1) { |
|
| 3249 | // $data = self::getInt2d($stream, $pos + $arrayReturn['length']); |
||
| 3250 | 4 | $arrayReturn['length'] += 2; |
|
| 3251 | } |
||
| 3252 | 4 | if ($masksData['textDirection'] == 1) { |
|
| 3253 | throw new \Exception('Feature not implemented (l.'.__LINE__.')'); |
||
| 3254 | } |
||
| 3255 | |||
| 3256 | 4 | return $arrayReturn; |
|
| 3257 | } |
||
| 3258 | |||
| 3259 | /** |
||
| 3260 | * A structure that specifies language and spelling information for a run of text. |
||
| 3261 | * @param string $stream |
||
| 3262 | * @param integer $pos |
||
| 3263 | * @param string $strLenRT |
||
| 3264 | * @return array |
||
| 3265 | * @throws \Exception |
||
| 3266 | * @link https://msdn.microsoft.com/en-us/library/dd909603(v=office.12).aspx |
||
| 3267 | */ |
||
| 3268 | 4 | private function readStructureTextSIRun($stream, $pos, $strLenRT) |
|
| 3320 | |||
| 3321 | /** |
||
| 3322 | * A structure that specifies tabbing, margins, and indentation for text. |
||
| 3323 | * @param string $stream |
||
| 3324 | * @param integer $pos |
||
| 3325 | * @return array |
||
| 3326 | * @throws \Exception |
||
| 3327 | * @link https://msdn.microsoft.com/en-us/library/dd922749(v=office.12).aspx |
||
| 3328 | */ |
||
| 3329 | 4 | private function readStructureTextRuler($stream, $pos) |
|
| 3417 | |||
| 3418 | /** |
||
| 3419 | * @param $stream |
||
| 3420 | * @param int $pos |
||
| 3421 | * @throws \Exception |
||
| 3422 | */ |
||
| 3423 | 4 | private function readRecordNotesContainer($stream, $pos) |
|
| 3438 | |||
| 3439 | /** |
||
| 3440 | * @param $stream |
||
| 3441 | * @param int $pos |
||
| 3442 | * @return array |
||
| 3443 | * @throws \Exception |
||
| 3444 | */ |
||
| 3445 | 4 | private function readRecordNotesAtom($stream, $pos) |
|
| 3472 | } |
||
| 3473 |