From ca69de396200461c7a5fe7bec38fff72cdac96bd Mon Sep 17 00:00:00 2001 From: Progi1984 Date: Fri, 15 Aug 2014 19:26:23 +0200 Subject: [PATCH] #23 : Implement Word97 aka MsDoc Reader --- samples/Sample_11_ReadWord97.php | 6 +- samples/Sample_Header.php | 3 + src/PhpWord/Reader/MsDoc.php | 3289 +++++++++++++++++++----------- src/PhpWord/Shared/Drawing.php | 70 + src/PhpWord/Style/Font.php | 1 - 5 files changed, 2179 insertions(+), 1190 deletions(-) diff --git a/samples/Sample_11_ReadWord97.php b/samples/Sample_11_ReadWord97.php index f0df59bf..68a30d36 100644 --- a/samples/Sample_11_ReadWord97.php +++ b/samples/Sample_11_ReadWord97.php @@ -5,15 +5,15 @@ include_once 'Sample_Header.php'; $name = basename(__FILE__, '.php'); $source = "resources/{$name}.doc"; echo date('H:i:s'), " Reading contents from `{$source}`", EOL; -$phpWord = \PhpOffice\PhpWord\IOFactory::load($source, 'Word97'); +$phpWord = \PhpOffice\PhpWord\IOFactory::load($source, 'MsDoc'); // (Re)write contents -/*$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); +$writers = array('Word2007' => 'docx', 'ODText' => 'odt', 'RTF' => 'rtf'); foreach ($writers as $writer => $extension) { echo date('H:i:s'), " Write to {$writer} format", EOL; $xmlWriter = \PhpOffice\PhpWord\IOFactory::createWriter($phpWord, $writer); $xmlWriter->save("{$name}.{$extension}"); rename("{$name}.{$extension}", "results/{$name}.{$extension}"); -}*/ +} include_once 'Sample_Footer.php'; diff --git a/samples/Sample_Header.php b/samples/Sample_Header.php index c6431c03..a7721559 100644 --- a/samples/Sample_Header.php +++ b/samples/Sample_Header.php @@ -1,4 +1,7 @@ readFib($this->dataWorkDocument); $this->readFibContent(); - /*$this->read1Table($this->data1Table); - $this->readData($this->dataData); - $this->readObjectPool($this->dataObjectPool);*/ return $this->phpWord; } @@ -99,9 +139,22 @@ class MsDoc extends AbstractReader implements ReaderInterface // Get Data stream $this->dataObjectPool = $ole->getStream($ole->wrkObjectPool); // Get Summary Information data - $this->_summaryInformation = $ole->getStream($ole->summaryInformation); + $this->_SummaryInformation = $ole->getStream($ole->summaryInformation); // Get Document Summary Information data - $this->_documentSummaryInformation = $ole->getStream($ole->documentSummaryInformation); + $this->_DocumentSummaryInformation = $ole->getStream($ole->documentSummaryInformation); + } + + private function getNumInLcb($lcb, $iSize){ + return ($lcb - 4) / (4 + $iSize); + } + + private function getArrayCP($data, $posMem, $iNum){ + $arrayCP = array(); + for($inc = 0 ; $inc < $iNum ; $inc++){ + $arrayCP[$inc] = self::getInt4d($data, $posMem); + $posMem += 4; + } + return $arrayCP; } /** @@ -111,1264 +164,2116 @@ class MsDoc extends AbstractReader implements ReaderInterface */ private function readFib($data) { - $length = 0; - print_r('============ readFib'.PHP_EOL); - print_r('============ length : '.strlen($data).PHP_EOL); - print_r('======================== FibBase'.PHP_EOL); + $pos = 0; //----- FibBase // wIdent - $wIdent = self::_GetInt2d($data, $length); - $length += 2; - print_r('$wIdent : '.$wIdent.'#'.dechex($wIdent).PHP_EOL); + $pos += 2; // nFib - $nFib = self::_GetInt2d($data, $length); - print_r('$nFib : '.$nFib.'#'.dechex($nFib).PHP_EOL); - $length += 2; + $pos += 2; // unused - $length += 2; + $pos += 2; // lid : Language Identifier - $lid = self::_GetInt2d($data, $length); - $length += 2; + $pos += 2; // pnNext - $pnNext = self::_GetInt2d($data, $length); - $length += 2; + $pos += 2; - $mem = self::_GetInt2d($data, $length); - $fDot = ($mem >> 15) & 1; - $fGlsy = ($mem >> 14) & 1; - $fComplex = ($mem >> 13) & 1; - $fHasPic = ($mem >> 12) & 1; - $cQuickSaves = ($mem >> 8) & bindec('1111'); - $fEncrypted = ($mem >> 7) & 1; - $fWhichTblStm = ($mem >> 6) & 1; - print_r('$fWhichTblStm : '.$fWhichTblStm.'#'.dechex($fWhichTblStm).PHP_EOL); - $fReadOnlyRecommended = ($mem >> 5) & 1; - $fWriteReservation = ($mem >> 4) & 1; - $fExtChar = ($mem >> 3) & 1; - $fLoadOverride = ($mem >> 2) & 1; - $fFarEast = ($mem >> 1) & 1; - $fObfuscated = ($mem >> 0) & 1; - $length += 2; + // $mem = self::getInt2d($data, $pos); + // $fDot = ($mem >> 15) & 1; + // $fGlsy = ($mem >> 14) & 1; + // $fComplex = ($mem >> 13) & 1; + // $fHasPic = ($mem >> 12) & 1; + // $cQuickSaves = ($mem >> 8) & bindec('1111'); + // $fEncrypted = ($mem >> 7) & 1; + // $fWhichTblStm = ($mem >> 6) & 1; + // $fReadOnlyRecommended = ($mem >> 5) & 1; + // $fWriteReservation = ($mem >> 4) & 1; + // $fExtChar = ($mem >> 3) & 1; + // $fLoadOverride = ($mem >> 2) & 1; + // $fFarEast = ($mem >> 1) & 1; + // $fObfuscated = ($mem >> 0) & 1; + $pos += 2; // nFibBack - $nFibBack = self::_GetInt2d($data, $length); - $length += 2; + $pos += 2; // lKey - $lKey = self::_GetInt4d($data, $length); - $length += 4; + $pos += 4; // envr - $envr = self::_GetInt1d($data, $length); - $length += 1; + $pos += 1; - $mem = self::_GetInt1d($data, $length); - $fMac = ($mem >> 7) & 1; - $fEmptySpecial = ($mem >> 6) & 1; - $fLoadOverridePage = ($mem >> 5) & 1; - $reserved1 = ($mem >> 4) & 1; - $reserved2 = ($mem >> 3) & 1; - $fSpare0 = ($mem >> 0) & bindec('111'); - $length += 1; + // $mem = self::getInt1d($data, $pos); + // $fMac = ($mem >> 7) & 1; + // $fEmptySpecial = ($mem >> 6) & 1; + // $fLoadOverridePage = ($mem >> 5) & 1; + // $reserved1 = ($mem >> 4) & 1; + // $reserved2 = ($mem >> 3) & 1; + // $fSpare0 = ($mem >> 0) & bindec('111'); + $pos += 1; - $reserved3 = self::_GetInt2d($data, $length); - $length += 2; - $reserved4 = self::_GetInt2d($data, $length); - $length += 2; - $reserved5 = self::_GetInt4d($data, $length); - $length += 4; - $reserved6 = self::_GetInt4d($data, $length); - $length += 4; + // reserved3 + $pos += 2; + // reserved4 + $pos += 2; + // reserved5 + $pos += 4; + // reserved6 + $pos += 4; //----- csw - print_r('======================== csw'.PHP_EOL); - $csw = self::_GetInt2d($data, $length); - $length += 2; - print_r('$csw : '.$csw.'#'.dechex($csw).PHP_EOL); + $pos += 2; //----- fibRgW - print_r('======================== fibRgW'.PHP_EOL); - $fibRgW_reserved1 = self::_GetInt2d($data, $length); - $length += 2; - $fibRgW_reserved2 = self::_GetInt2d($data, $length); - $length += 2; - $fibRgW_reserved3 = self::_GetInt2d($data, $length); - $length += 2; - $fibRgW_reserved4 = self::_GetInt2d($data, $length); - $length += 2; - $fibRgW_reserved5 = self::_GetInt2d($data, $length); - $length += 2; - $fibRgW_reserved6 = self::_GetInt2d($data, $length); - $length += 2; - $fibRgW_reserved7 = self::_GetInt2d($data, $length); - $length += 2; - $fibRgW_reserved8 = self::_GetInt2d($data, $length); - $length += 2; - $fibRgW_reserved9 = self::_GetInt2d($data, $length); - $length += 2; - $fibRgW_reserved10 = self::_GetInt2d($data, $length); - $length += 2; - $fibRgW_reserved11 = self::_GetInt2d($data, $length); - $length += 2; - $fibRgW_reserved12 = self::_GetInt2d($data, $length); - $length += 2; - $fibRgW_reserved13 = self::_GetInt2d($data, $length); - $length += 2; - $fibRgW_lidFE = self::_GetInt2d($data, $length); - $length += 2; + // reserved1 + $pos += 2; + // reserved2 + $pos += 2; + // reserved3 + $pos += 2; + // reserved4 + $pos += 2; + // reserved5 + $pos += 2; + // reserved6 + $pos += 2; + // reserved7 + $pos += 2; + // reserved8 + $pos += 2; + // reserved9 + $pos += 2; + // reserved10 + $pos += 2; + // reserved11 + $pos += 2; + // reserved12 + $pos += 2; + // reserved13 + $pos += 2; + // lidFE + $pos += 2; //----- cslw - print_r('======================== cslw'.PHP_EOL); - $cslw = self::_GetInt2d($data, $length); - $length += 2; - print_r('$cslw : '.$cslw.'#'.dechex($cslw).PHP_EOL); + $pos += 2; //----- fibRgLw - print_r('======================== fibRgLw'.PHP_EOL); - $fibRgLw_cbMac = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_reserved1 = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_reserved2 = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_ccpText = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_ccpFtn = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_ccpHdd = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_reserved3 = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_ccpAtn = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_ccpEdn = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_ccpTxbx = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_ccpHdrTxbx = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_reserved4 = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_reserved5 = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_reserved6 = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_reserved7 = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_reserved8 = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_reserved9 = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_reserved10 = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_reserved11 = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_reserved12 = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_reserved13 = self::_GetInt4d($data, $length); - $length += 4; - $fibRgLw_reserved14 = self::_GetInt4d($data, $length); - $length += 4; + // cbMac + $pos += 4; + // reserved1 + $pos += 4; + // reserved2 + $pos += 4; + $this->arrayFib['ccpText'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['ccpFtn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['ccpHdd'] = self::getInt4d($data, $pos); + $pos += 4; + // reserved3 + $pos += 4; + // ccpAtn + $pos += 4; + // ccpEdn + $pos += 4; + // ccpTxbx + $pos += 4; + // ccpHdrTxbx + $pos += 4; + // reserved4 + $pos += 4; + // reserved5 + $pos += 4; + // reserved6 + $pos += 4; + // reserved7 + $pos += 4; + // reserved8 + $pos += 4; + // reserved9 + $pos += 4; + // reserved10 + $pos += 4; + // reserved11 + $pos += 4; + // reserved12 + $pos += 4; + // reserved13 + $pos += 4; + // reserved14 + $pos += 4; //----- cbRgFcLcb - print_r('======================== cbRgFcLcb'.PHP_EOL); - $cbRgFcLcb = self::_GetInt2d($data, $length); - print_r('$cbRgFcLcb : '.$cbRgFcLcb.'#'.dechex($cbRgFcLcb).PHP_EOL); - $length += 2; + $cbRgFcLcb = self::getInt2d($data, $pos); + $pos += 2; //----- fibRgFcLcbBlob - print_r('======================== fibRgFcLcbBlob'.PHP_EOL); switch ($cbRgFcLcb) { case 0x005D: - $length = $this->readBlockFibRgFcLcb($data, $length, self::VERSION_97); + $pos = $this->readBlockFibRgFcLcb($data, $pos, self::VERSION_97); break; case 0x006C: - $length = $this->readBlockFibRgFcLcb($data, $length, self::VERSION_97); - $length = $this->readBlockFibRgFcLcb($data, $length, self::VERSION_2000); + $pos = $this->readBlockFibRgFcLcb($data, $pos, self::VERSION_97); + $pos = $this->readBlockFibRgFcLcb($data, $pos, self::VERSION_2000); break; case 0x0088: - $length = $this->readBlockFibRgFcLcb($data, $length, self::VERSION_97); - $length = $this->readBlockFibRgFcLcb($data, $length, self::VERSION_2000); - $length = $this->readBlockFibRgFcLcb($data, $length, self::VERSION_2002); + $pos = $this->readBlockFibRgFcLcb($data, $pos, self::VERSION_97); + $pos = $this->readBlockFibRgFcLcb($data, $pos, self::VERSION_2000); + $pos = $this->readBlockFibRgFcLcb($data, $pos, self::VERSION_2002); break; case 0x00A4 : - $length = $this->readBlockFibRgFcLcb($data, $length, self::VERSION_97); - $length = $this->readBlockFibRgFcLcb($data, $length, self::VERSION_2000); - $length = $this->readBlockFibRgFcLcb($data, $length, self::VERSION_2002); - $length = $this->readBlockFibRgFcLcb($data, $length, self::VERSION_2003); + $pos = $this->readBlockFibRgFcLcb($data, $pos, self::VERSION_97); + $pos = $this->readBlockFibRgFcLcb($data, $pos, self::VERSION_2000); + $pos = $this->readBlockFibRgFcLcb($data, $pos, self::VERSION_2002); + $pos = $this->readBlockFibRgFcLcb($data, $pos, self::VERSION_2003); break; case 0x00B7: - $length = $this->readBlockFibRgFcLcb($data, $length, self::VERSION_97); - $length = $this->readBlockFibRgFcLcb($data, $length, self::VERSION_2000); - $length = $this->readBlockFibRgFcLcb($data, $length, self::VERSION_2002); - $length = $this->readBlockFibRgFcLcb($data, $length, self::VERSION_2003); - $length = $this->readBlockFibRgFcLcb($data, $length, self::VERSION_2007); + $pos = $this->readBlockFibRgFcLcb($data, $pos, self::VERSION_97); + $pos = $this->readBlockFibRgFcLcb($data, $pos, self::VERSION_2000); + $pos = $this->readBlockFibRgFcLcb($data, $pos, self::VERSION_2002); + $pos = $this->readBlockFibRgFcLcb($data, $pos, self::VERSION_2003); + $pos = $this->readBlockFibRgFcLcb($data, $pos, self::VERSION_2007); break; } - //print_r($this->arrayFib); //----- cswNew - print_r('======================== cswNew'.PHP_EOL); - $cswNew = self::_GetInt2d($data, $length); - $length += 2; - print_r('$cswNew : '.$cswNew.'#'.dechex($cswNew).PHP_EOL); + $this->arrayFib['cswNew'] = self::getInt2d($data, $pos); + $pos += 2; - if($cswNew != 0){ - // fibRgCswNew - print_r('======================== fibRgCswNew'.PHP_EOL); + if($this->arrayFib['cswNew'] != 0){ + //@todo : fibRgCswNew } - print_r('======================== length : '.$length.'#'.dechex($length).PHP_EOL); - return $length; + return $pos; } - const VERSION_97 = '97'; - const VERSION_2000 = '2000'; - const VERSION_2002 = '2002'; - const VERSION_2003 = '2003'; - const VERSION_2007 = '2007'; - - /** - * @var array - */ - private $arrayFib = array(); - - private function readBlockFibRgFcLcb($data, $length, $version) + private function readBlockFibRgFcLcb($data, $pos, $version) { if($version == self::VERSION_97){ - $this->arrayFib['fcStshfOrig'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbStshfOrig'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcStshf'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbStshf'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcffndRef'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcffndRef'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcffndTxt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcffndTxt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfandRef'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfandRef'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfandTxt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfandTxt '] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfSed'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfSed'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcPad'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcPad'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfPhe'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfPhe'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfGlsy'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfGlsy'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfGlsy'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfGlsy'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfHdd'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfHdd'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBteChpx'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBteChpx'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBtePapx'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBtePapx'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfSea'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfSea'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfFfn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfFfn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfFldMom'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfFldMom'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfFldHdr'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfFldHdr'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfFldFtn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfFldFtn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfFldAtn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfFldAtn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfFldMcr'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfFldMcr'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfBkmk'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfBkmk'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBkf'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBkf'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBkl'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBkl'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcCmds'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbCmds'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcUnused1'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbUnused1'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfMcr'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfMcr'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPrDrvr'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPrDrvr'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPrEnvPort'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPrEnvPort'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPrEnvLand'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPrEnvLand'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcWss'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbWss'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcDop'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbDop'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfAssoc'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfAssoc'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcClx'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbClx'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfPgdFtn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfPgdFtn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcAutosaveSource'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbAutosaveSource'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcGrpXstAtnOwners'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbGrpXstAtnOwners'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfAtnBkmk'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfAtnBkmk'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcUnused2'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbUnused2'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcUnused3'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbUnused3'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcSpaMom'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcSpaMom'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcSpaHdr'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcSpaHdr'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfAtnBkf'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfAtnBkf'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfAtnBkl'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfAtnBkl'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPms'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPms'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcFormFldSttbs'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbFormFldSttbs'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfendRef'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfendRef'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfendTxt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfendTxt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfFldEdn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfFldEdn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcUnused4'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbUnused4'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcDggInfo'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbDggInfo'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfRMark'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfRMark'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfCaption'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfCaption'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfAutoCaption'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfAutoCaption'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfWkb'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfWkb'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfSpl'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfSpl'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcftxbxTxt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcftxbxTxt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfFldTxbx'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfFldTxbx'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfHdrtxbxTxt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfHdrtxbxTxt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcffldHdrTxbx'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcffldHdrTxbx'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcStwUser'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbStwUser'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbTtmbd'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbTtmbd'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcCookieData'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbCookieData'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPgdMotherOldOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPgdMotherOldOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcBkdMotherOldOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbBkdMotherOldOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPgdFtnOldOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPgdFtnOldOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcBkdFtnOldOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbBkdFtnOldOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPgdEdnOldOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPgdEdnOldOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcBkdEdnOldOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbBkdEdnOldOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfIntlFld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfIntlFld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcRouteSlip'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbRouteSlip'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbSavedBy'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbSavedBy'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbFnm'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbFnm'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlfLst'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlfLst'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlfLfo'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlfLfo'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfTxbxBkd'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfTxbxBkd'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfTxbxHdrBkd'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfTxbxHdrBkd'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcDocUndoWord9'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbDocUndoWord9'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcRgbUse'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbRgbUse'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcUsp'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbUsp'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcUskf'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbUskf'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcupcRgbUse'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcupcRgbUse'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcupcUsp'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcupcUsp'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbGlsyStyle'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbGlsyStyle'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlgosl'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlgosl'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcocx'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcocx'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBteLvc'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBteLvc'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['dwLowDateTime'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['dwHighDateTime'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfLvcPre10'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfLvcPre10'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfAsumy'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfAsumy'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfGram'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfGram'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbListNames'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbListNames'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfUssr'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfUssr'] = self::_GetInt4d($data, $length); - $length += 4; + $this->arrayFib['fcStshfOrig'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbStshfOrig'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcStshf'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbStshf'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcffndRef'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcffndRef'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcffndTxt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcffndTxt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfandRef'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfandRef'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfandTxt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfandTxt '] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfSed'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfSed'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcPad'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcPad'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfPhe'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfPhe'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfGlsy'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfGlsy'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfGlsy'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfGlsy'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfHdd'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfHdd'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBteChpx'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBteChpx'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBtePapx'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBtePapx'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfSea'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfSea'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfFfn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfFfn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfFldMom'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfFldMom'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfFldHdr'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfFldHdr'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfFldFtn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfFldFtn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfFldAtn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfFldAtn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfFldMcr'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfFldMcr'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfBkmk'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfBkmk'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBkf'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBkf'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBkl'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBkl'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcCmds'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbCmds'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcUnused1'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbUnused1'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfMcr'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfMcr'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPrDrvr'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPrDrvr'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPrEnvPort'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPrEnvPort'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPrEnvLand'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPrEnvLand'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcWss'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbWss'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcDop'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbDop'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfAssoc'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfAssoc'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcClx'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbClx'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfPgdFtn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfPgdFtn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcAutosaveSource'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbAutosaveSource'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcGrpXstAtnOwners'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbGrpXstAtnOwners'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfAtnBkmk'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfAtnBkmk'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcUnused2'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbUnused2'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcUnused3'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbUnused3'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcSpaMom'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcSpaMom'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcSpaHdr'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcSpaHdr'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfAtnBkf'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfAtnBkf'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfAtnBkl'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfAtnBkl'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPms'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPms'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcFormFldSttbs'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbFormFldSttbs'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfendRef'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfendRef'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfendTxt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfendTxt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfFldEdn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfFldEdn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcUnused4'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbUnused4'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcDggInfo'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbDggInfo'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfRMark'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfRMark'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfCaption'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfCaption'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfAutoCaption'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfAutoCaption'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfWkb'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfWkb'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfSpl'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfSpl'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcftxbxTxt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcftxbxTxt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfFldTxbx'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfFldTxbx'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfHdrtxbxTxt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfHdrtxbxTxt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcffldHdrTxbx'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcffldHdrTxbx'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcStwUser'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbStwUser'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbTtmbd'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbTtmbd'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcCookieData'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbCookieData'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPgdMotherOldOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPgdMotherOldOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcBkdMotherOldOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbBkdMotherOldOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPgdFtnOldOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPgdFtnOldOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcBkdFtnOldOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbBkdFtnOldOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPgdEdnOldOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPgdEdnOldOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcBkdEdnOldOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbBkdEdnOldOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfIntlFld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfIntlFld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcRouteSlip'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbRouteSlip'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbSavedBy'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbSavedBy'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbFnm'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbFnm'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlfLst'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlfLst'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlfLfo'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlfLfo'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfTxbxBkd'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfTxbxBkd'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfTxbxHdrBkd'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfTxbxHdrBkd'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcDocUndoWord9'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbDocUndoWord9'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcRgbUse'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbRgbUse'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcUsp'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbUsp'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcUskf'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbUskf'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcupcRgbUse'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcupcRgbUse'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcupcUsp'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcupcUsp'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbGlsyStyle'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbGlsyStyle'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlgosl'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlgosl'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcocx'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcocx'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBteLvc'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBteLvc'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['dwLowDateTime'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['dwHighDateTime'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfLvcPre10'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfLvcPre10'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfAsumy'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfAsumy'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfGram'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfGram'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbListNames'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbListNames'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfUssr'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfUssr'] = self::getInt4d($data, $pos); + $pos += 4; } if($version == self::VERSION_2000){ - $this->arrayFib['fcPlcfTch'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfTch'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcRmdThreading'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbRmdThreading'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcMid'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbMid'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbRgtplc'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbRgtplc'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcMsoEnvelope'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbMsoEnvelope'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfLad'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfLad'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcRgDofr'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbRgDofr'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcosl'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcosl'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfCookieOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfCookieOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPgdMotherOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPgdMotherOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcBkdMotherOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbBkdMotherOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPgdFtnOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPgdFtnOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcBkdFtnOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbBkdFtnOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPgdEdnOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPgdEdnOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcBkdEdnOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbBkdEdnOld'] = self::_GetInt4d($data, $length); - $length += 4; + $this->arrayFib['fcPlcfTch'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfTch'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcRmdThreading'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbRmdThreading'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcMid'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbMid'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbRgtplc'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbRgtplc'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcMsoEnvelope'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbMsoEnvelope'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfLad'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfLad'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcRgDofr'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbRgDofr'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcosl'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcosl'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfCookieOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfCookieOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPgdMotherOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPgdMotherOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcBkdMotherOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbBkdMotherOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPgdFtnOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPgdFtnOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcBkdFtnOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbBkdFtnOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPgdEdnOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPgdEdnOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcBkdEdnOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbBkdEdnOld'] = self::getInt4d($data, $pos); + $pos += 4; } if($version == self::VERSION_2002){ - $this->arrayFib['fcUnused1'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbUnused1'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfPgp'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfPgp'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfuim'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfuim'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlfguidUim'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlfguidUim'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcAtrdExtra'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbAtrdExtra'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlrsid'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlrsid'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfBkmkFactoid'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfBkmkFactoid'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBkfFactoid'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBkfFactoid'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfcookie'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfcookie'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBklFactoid'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBklFactoid'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcFactoidData'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbFactoidData'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcDocUndo'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbDocUndo'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfBkmkFcc'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfBkmkFcc'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBkfFcc'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBkfFcc'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBklFcc'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBklFcc'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfbkmkBPRepairs'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfbkmkBPRepairs'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfbkfBPRepairs'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfbkfBPRepairs'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfbklBPRepairs'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfbklBPRepairs'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPmsNew'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPmsNew'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcODSO'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbODSO'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfpmiOldXP'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfpmiOldXP'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfpmiNewXP'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfpmiNewXP'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfpmiMixedXP'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfpmiMixedXP'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcUnused2'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbUnused2'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcffactoid'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcffactoid'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcflvcOldXP'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcflvcOldXP'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcflvcNewXP'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcflvcNewXP'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcflvcMixedXP'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcflvcMixedXP'] = self::_GetInt4d($data, $length); - $length += 4; + $this->arrayFib['fcUnused1'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbUnused1'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfPgp'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfPgp'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfuim'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfuim'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlfguidUim'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlfguidUim'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcAtrdExtra'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbAtrdExtra'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlrsid'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlrsid'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfBkmkFactoid'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfBkmkFactoid'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBkfFactoid'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBkfFactoid'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfcookie'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfcookie'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBklFactoid'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBklFactoid'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcFactoidData'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbFactoidData'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcDocUndo'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbDocUndo'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfBkmkFcc'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfBkmkFcc'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBkfFcc'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBkfFcc'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBklFcc'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBklFcc'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfbkmkBPRepairs'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfbkmkBPRepairs'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfbkfBPRepairs'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfbkfBPRepairs'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfbklBPRepairs'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfbklBPRepairs'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPmsNew'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPmsNew'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcODSO'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbODSO'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfpmiOldXP'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfpmiOldXP'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfpmiNewXP'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfpmiNewXP'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfpmiMixedXP'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfpmiMixedXP'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcUnused2'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbUnused2'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcffactoid'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcffactoid'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcflvcOldXP'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcflvcOldXP'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcflvcNewXP'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcflvcNewXP'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcflvcMixedXP'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcflvcMixedXP'] = self::getInt4d($data, $pos); + $pos += 4; } if($version == self::VERSION_2003){ - $this->arrayFib['fcHplxsdr'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbHplxsdr'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfBkmkSdt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfBkmkSdt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBkfSdt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBkfSdt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBklSdt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBklSdt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcCustomXForm'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbCustomXForm'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfBkmkProt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfBkmkProt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBkfProt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBkfProt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBklProt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBklProt'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbProtUser'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbProtUser'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcUnused'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbUnused'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfpmiOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfpmiOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfpmiOldInline'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfpmiOldInline'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfpmiNew'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfpmiNew'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfpmiNewInline'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfpmiNewInline'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcflvcOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcflvcOld'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcflvcOldInline'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcflvcOldInline'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcflvcNew'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcflvcNew'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcflvcNewInline'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcflvcNewInline'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPgdMother'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPgdMother'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcBkdMother'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbBkdMother'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcAfdMother'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbAfdMother'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPgdFtn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPgdFtn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcBkdFtn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbBkdFtn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcAfdFtn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbAfdFtn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPgdEdn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPgdEdn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcBkdEdn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbBkdEdn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcAfdEdn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbAfdEdn'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcAfd'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbAfd'] = self::_GetInt4d($data, $length); - $length += 4; + $this->arrayFib['fcHplxsdr'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbHplxsdr'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfBkmkSdt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfBkmkSdt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBkfSdt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBkfSdt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBklSdt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBklSdt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcCustomXForm'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbCustomXForm'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfBkmkProt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfBkmkProt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBkfProt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBkfProt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBklProt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBklProt'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbProtUser'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbProtUser'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcUnused'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbUnused'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfpmiOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfpmiOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfpmiOldInline'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfpmiOldInline'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfpmiNew'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfpmiNew'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfpmiNewInline'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfpmiNewInline'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcflvcOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcflvcOld'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcflvcOldInline'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcflvcOldInline'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcflvcNew'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcflvcNew'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcflvcNewInline'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcflvcNewInline'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPgdMother'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPgdMother'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcBkdMother'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbBkdMother'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcAfdMother'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbAfdMother'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPgdFtn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPgdFtn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcBkdFtn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbBkdFtn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcAfdFtn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbAfdFtn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPgdEdn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPgdEdn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcBkdEdn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbBkdEdn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcAfdEdn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbAfdEdn'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcAfd'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbAfd'] = self::getInt4d($data, $pos); + $pos += 4; } if($version == self::VERSION_2007){ - $this->arrayFib['fcPlcfmthd'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfmthd'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfBkmkMoveFrom'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfBkmkMoveFrom'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBkfMoveFrom'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBkfMoveFrom'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBklMoveFrom'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBklMoveFrom'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfBkmkMoveTo'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfBkmkMoveTo'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBkfMoveTo'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBkfMoveTo'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBklMoveTo'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBklMoveTo'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcUnused1'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbUnused1'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcUnused2'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbUnused2'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcUnused3'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbUnused3'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcSttbfBkmkArto'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbSttbfBkmkArto'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBkfArto'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBkfArto'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcPlcfBklArto'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbPlcfBklArto'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcArtoData'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbArtoData'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcUnused4'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbUnused4'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcUnused5'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbUnused5'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcUnused6'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbUnused6'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcOssTheme'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbOssTheme'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['fcColorSchemeMapping'] = self::_GetInt4d($data, $length); - $length += 4; - $this->arrayFib['lcbColorSchemeMapping'] = self::_GetInt4d($data, $length); - $length += 4; + $this->arrayFib['fcPlcfmthd'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfmthd'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfBkmkMoveFrom'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfBkmkMoveFrom'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBkfMoveFrom'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBkfMoveFrom'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBklMoveFrom'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBklMoveFrom'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfBkmkMoveTo'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfBkmkMoveTo'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBkfMoveTo'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBkfMoveTo'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBklMoveTo'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBklMoveTo'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcUnused1'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbUnused1'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcUnused2'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbUnused2'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcUnused3'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbUnused3'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcSttbfBkmkArto'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbSttbfBkmkArto'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBkfArto'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBkfArto'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcPlcfBklArto'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbPlcfBklArto'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcArtoData'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbArtoData'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcUnused4'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbUnused4'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcUnused5'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbUnused5'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcUnused6'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbUnused6'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcOssTheme'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbOssTheme'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['fcColorSchemeMapping'] = self::getInt4d($data, $pos); + $pos += 4; + $this->arrayFib['lcbColorSchemeMapping'] = self::getInt4d($data, $pos); + $pos += 4; } - return $length; + return $pos; } private function readFibContent() { - #$this->readRecordSTSH(); + // Informations about Font + $this->readRecordSttbfFfn(); + + // Informations about page $this->readRecordPlcfSed(); + + // reading paragraphs + //@link https://github.com/notmasteryet/CompoundFile/blob/ec118f354efebdee9102e41b5b7084fce81125b0/WordFileReader/WordDocument.cs#L86 + $this->readRecordPlcfBtePapx(); + + // reading character formattings + //@link https://github.com/notmasteryet/CompoundFile/blob/ec118f354efebdee9102e41b5b7084fce81125b0/WordFileReader/WordDocument.cs#L94 + $this->readRecordPlcfBteChpx(); + + $this->generatePhpWord(); } - private function readRecordSTSH() - { - print_r('============ readRecordSTSH'.PHP_EOL); - // Table Stream - // fcStshf (4 bytes): An unsigned integer that specifies an offset in the Table Stream. An STSH that specifies the style sheet for this document begins at this offset. - // lcbStshf (4 bytes): An unsigned integer that specifies the size, in bytes, of the STSH that begins at offset fcStshf in the Table Stream. This MUST be a nonzero value. - /*[fcStshf] => 0 - [lcbStshf] => 1060*/ - $posMem = $this->arrayFib['fcStshf']; - - // RECORD "STSH" - - // lpstshi (variable): An LPStshi that specifies information about the stylesheet. - // - LPStshi - // - LPStshi : cbStshi - $cbStshi = self::_GetInt2d($this->data1Table, $posMem); - $posMem += 2; - print_r('$cbStshi :'.$cbStshi.PHP_EOL); - - // - LPStshi : stshi - // - LPStshi : stshi : stshif (18o) - // - LPStshi : stshi : stshif : cstd - $cstd = self::_GetInt2d($this->data1Table, $posMem); - $posMem += 2; - // - LPStshi : stshi : stshif : cbSTDBaseInFile - $cbSTDBaseInFile = self::_GetInt2d($this->data1Table, $posMem); - $posMem += 2; - // - LPStshi : stshi : stshif : fStdStylenamesWritten (1 bit) - // - LPStshi : stshi : stshif : fReserved (15 bits) - $fStdStylenamesWritten = self::_GetInt1d($this->data1Table, $posMem); - $posMem += 2; - // - LPStshi : stshi : stshif : stiMaxWhenSaved - $stiMaxWhenSaved = self::_GetInt2d($this->data1Table, $posMem); - $posMem += 2; - print_r('$stiMaxWhenSaved :'.$stiMaxWhenSaved.PHP_EOL); - // - LPStshi : stshi : stshif : istdMaxFixedWhenSaved - $istdMaxFixedWhenSaved = self::_GetInt2d($this->data1Table, $posMem); - $posMem += 2; - // - LPStshi : stshi : stshif : nVerBuiltInNamesWhenSaved - $nVerBuiltInNamesWhenSaved = self::_GetInt2d($this->data1Table, $posMem); - $posMem += 2; - // - LPStshi : stshi : stshif : ftcAsci - $ftcAsci = self::_GetInt2d($this->data1Table, $posMem); - $posMem += 2; - // - LPStshi : stshi : stshif : ftcFE - $ftcFE = self::_GetInt2d($this->data1Table, $posMem); - $posMem += 2; - // - LPStshi : stshi : stshif : ftcOther - $ftcOther = self::_GetInt2d($this->data1Table, $posMem); - $posMem += 2; - - // - LPStshi : stshi : ftcBi (2o) - $ftcBi = self::_GetInt2d($this->data1Table, $posMem); - $posMem += 2; - // - LPStshi : stshi : StshiLsd - // - LPStshi : stshi : StshiLsd : cbLSD - $cbLSD = self::_GetInt2d($this->data1Table, $posMem); - $posMem += 2; - print_r('$cbLSD :'.$cbLSD.PHP_EOL); - - - // - LPStshi : stshi : StshiLsd : mpstiilsd - // - LPStshi : stshi : StshiB - - // rglpstd (variable): An array of LPStd that specifies the style definitions. - } + /** + * Section and information about them + * @link : http://msdn.microsoft.com/en-us/library/dd924458%28v=office.12%29.aspx + */ private function readRecordPlcfSed(){ - // fcPlcfSed (4 bytes): An unsigned integer that specifies an offset in the Table Stream. A PlcfSed begins at this offset and specifies the locations of property lists for each section in the Main Document. If lcbPlcfSed is zero, fcPlcfSed is undefined and MUST be ignored. - // lcbPlcfSed (4 bytes): An unsigned integer that specifies the size, in bytes, of the PlcfSed that begins at offset fcPlcfSed in the Table Stream. - print_r('============ readRecordPlcfSed'.PHP_EOL); - $posMem = $this->arrayFib['fcPlcfSed']; // PlcfSed // PlcfSed : aCP $aCP = array(); - $aCP[0] = self::_GetInt4d($this->data1Table, $posMem); + $aCP[0] = self::getInt4d($this->data1Table, $posMem); $posMem += 4; - $aCP[1] = self::_GetInt4d($this->data1Table, $posMem); + $aCP[1] = self::getInt4d($this->data1Table, $posMem); $posMem += 4; - print_r('$aCP :'.PHP_EOL); - print_r($aCP); - // PlcfSed : aSed - $numSed = ($this->arrayFib['lcbPlcfSed'] - 4) / 12; + //@link : http://msdn.microsoft.com/en-us/library/dd950194%28v=office.12%29.aspx + $numSed = $this->getNumInLcb($this->arrayFib['lcbPlcfSed'], 12); $aSed = array(); - for($iInc = 1 ; $iInc < $numSed ; ++$iInc){ - // ignored + for($iInc = 0 ; $iInc < $numSed ; ++$iInc){ + // Sed : http://msdn.microsoft.com/en-us/library/dd950982%28v=office.12%29.aspx + // fn $posMem += 2; - // A signed integer value that specifies the position in the WordDocument Stream at which a Sepx structure is located. - $aSed[$iInc] = self::_GetInt4d($this->data1Table, $posMem); + // fnMpr + $aSed[$iInc] = self::getInt4d($this->data1Table, $posMem); $posMem += 4; - // ignored + // fnMpr $posMem += 2; - // ignored + // fcMpr $posMem += 4; } - // page 541 pour la lecture des informations sur la section - } + foreach($aSed as $keySed => $offsetSed){ + // Sepx : http://msdn.microsoft.com/en-us/library/dd921348%28v=office.12%29.aspx + $cb = self::getInt2d($this->dataWorkDocument, $offsetSed); + $offsetSed += 2; + $oStylePrl = $this->readPrl($this->dataWorkDocument, $offsetSed, $cb); + $offsetSed += $oStylePrl->length; - private function read1Table($data) - { - /* - offset[0] = offsetClx + 1; - int lcb = stream.getInteger(offset); - - int countPcd = (lcb - 4)/12; - int countCp = (lcb - countPcd*8)/4; - int offsetPlcpcd = offsetClx + 5; - - for(int i=0;i> 30; - start = (start << 2) >> 2; - - offset[0] = offsetPlcpcd + i*4; - int cpPre = stream.getInteger(offset); - int cpNext = stream.getInteger(offset); - int length = cpNext - cpPre -1; - if(fc == 0) - { - length *= 2; - } - else - { - start = start/2; - } - - start += 512; - bytesToString(ogiBytes, content, start, length, fc); - - System.out.println(start +", "+ length); - }*/ - - print_r('============ read1Table'.PHP_EOL); - $clxPosition = $this->arrayFib['fcClx']; - - $text = self::_GetInt1d($data, $clxPosition); - print_r('$text : '.$text.PHP_EOL); - $lcb_piece_table = self::_GetInt4d($data, $clxPosition + 1); - $piece_table = $clxPosition + 5; - $piece_count = ($lcb_piece_table - 4) / 12; - print_r('$piece_count : '.$piece_count.PHP_EOL); - - - $countCp = ($lcb_piece_table - $piece_count*8)/4; - print_r('$countCp : '.$countCp.PHP_EOL); - for($i=0 ; $i < $piece_count ; $i++) { - - $piece_start = self::_GetInt4d($data, $piece_table + ($i * 4)); - $piece_end = self::_GetInt4d($data, $piece_table + (($i + 1) * 4)); - $piece_descriptor = $piece_table + (($piece_count + 1) * 4) + ($i * 8); - $fc = self::_GetInt4d ($data, $piece_descriptor + 2); - $is_ansi = ($fc & 0x40000000) == 0x40000000; - if (!$is_ansi) { - $fc = ($fc & 0xBFFFFFFF); - } else { - $fc = ($fc & 0xBFFFFFFF) >> 1; - } - $piece_size = $piece_end - $piece_start; - print_r('$piece_size : '.$piece_size.PHP_EOL); - if (!$is_ansi) { - $piece_size *= 2; - } - print_r('$piece_size : '.$piece_size.PHP_EOL); - if ($piece_size >= 1) { - $fc+=512; - print_r(chr(self::_GetInt2d($data, $fc + 2))); - print_r(chr(self::_GetInt2d($data, $fc + 4))); - print_r(chr(self::_GetInt2d($data, $fc + 6))); - print_r(chr(self::_GetInt2d($data, $fc + 8))); - print_r(chr(self::_GetInt2d($data, $fc + 10))); - print_r(chr(self::_GetInt2d($data, $fc + 12))); - print_r(chr(self::_GetInt2d($data, $fc + 14))); - print_r(chr(self::_GetInt2d($data, $fc + 16))); - print_r(chr(self::_GetInt2d($data, $fc + 18))); - print_r(chr(self::_GetInt2d($data, $fc + 20))); - print_r(chr(self::_GetInt2d($data, $fc + 22))); - print_r(chr(self::_GetInt2d($data, $fc + 24))); - print_r(chr(self::_GetInt2d($data, $fc + 26))); - print_r(chr(self::_GetInt2d($data, $fc + 28))); - print_r(chr(self::_GetInt2d($data, $fc + 30))); - print_r(chr(self::_GetInt2d($data, $fc + 32))); - print_r(chr(self::_GetInt2d($data, $fc + 34))); - print_r(chr(self::_GetInt2d($data, $fc + 36))); - print_r(chr(self::_GetInt2d($data, $fc + 38))); - print_r(PHP_EOL); - } - - $offsetPcd = $piece_table + $countCp*4 + $i*8; - - $start = self::_GetInt4d($data, $offsetPcd+2); - print_r('$start : '.$start.PHP_EOL); - $fc = $start >> 30; - $start = ($start << 2) >> 2; - print_r('$fc : '.$fc.PHP_EOL); - print_r('$start : '.$start.PHP_EOL); - - $offset = $piece_table + $i*4; - print_r('$offset : '.$offset.PHP_EOL); - $cpPre = self::_GetInt4d($data, $offset); - print_r('$cpPre : '.$cpPre.PHP_EOL); - $cpNext = self::_GetInt4d($data, $offset + 4); - print_r('$cpNext : '.$cpNext.PHP_EOL); - $length = $cpNext - $cpPre -1; - if($fc == 0) { - $length *= 2; - } else { - $start = $start/2; - } - - $start += 512; - print_r($start); - print_r(PHP_EOL); - print_r($length); - print_r(PHP_EOL); - print_r(self::_GetInt2d($data, $start + 2)); - print_r(PHP_EOL); - print_r(chr(self::_GetInt2d($data, $start + 2))); - print_r(PHP_EOL); - print_r(chr(self::_GetInt2d($data, $start + 4))); - print_r(chr(self::_GetInt2d($data, $start + 6))); - print_r(chr(self::_GetInt2d($data, $start + 8))); - print_r(chr(self::_GetInt2d($data, $start + 10))); - print_r(chr(self::_GetInt2d($data, $start + 12))); - print_r(chr(self::_GetInt2d($data, $start + 14))); - print_r(chr(self::_GetInt2d($data, $start + 16))); - print_r(chr(self::_GetInt2d($data, $start + 18))); - print_r(chr(self::_GetInt2d($data, $start + 20))); - print_r(chr(self::_GetInt2d($data, $start + 22))); - print_r(chr(self::_GetInt2d($data, $start + 24))); - print_r(chr(self::_GetInt2d($data, $start + 26))); - print_r(chr(self::_GetInt2d($data, $start + 28))); - print_r(chr(self::_GetInt2d($data, $start + 30))); - print_r(chr(self::_GetInt2d($data, $start + 32))); - print_r(chr(self::_GetInt2d($data, $start + 34))); - print_r(chr(self::_GetInt2d($data, $start + 36))); - print_r(chr(self::_GetInt2d($data, $start + 38))); + $this->arraySections[] = $oStylePrl; } -/* - - $start = self::_GetInt4d($data, 1850); - print_r('$start : '.$start.PHP_EOL); - $end = self::_GetInt4d($data, 1854); - print_r('$end : '.$end.PHP_EOL);*/ - - print_r(PHP_EOL); - print_r(PHP_EOL); - print_r(PHP_EOL); - //print_r($data); - print_r(PHP_EOL); - //print_r(dechex($data)); - print_r(PHP_EOL); } - private function readData($data) + /** + * Specifies the fonts that are used in the document + * @link : http://msdn.microsoft.com/en-us/library/dd943880%28v=office.12%29.aspx + */ + private function readRecordSttbfFfn() { - print_r('============ readData'.PHP_EOL); - $text = self::_GetInt1d($data, 0); - print_r(dechex($text)); + $posMem = $this->arrayFib['fcSttbfFfn']; - print_r(PHP_EOL); - print_r(PHP_EOL); - print_r(PHP_EOL); - //print_r($data); - print_r(PHP_EOL); - //print_r(dechex($data)); - print_r(PHP_EOL); + $cData = self::getInt2d($this->data1Table, $posMem); + $posMem += 2; + $cbExtra = self::getInt2d($this->data1Table, $posMem); + $posMem += 2; + + if ($cData < 0x7FF0 && $cbExtra == 0) { + for ($inc = 0; $inc < $cData; $inc++) { + // len + $posMem += 1; + // ffid + $posMem += 1; + // wWeight (400 : Normal - 700 bold) + $posMem += 2; + // chs + $posMem += 1; + // ixchSzAlt + $ixchSzAlt = self::getInt1d($this->data1Table, $posMem); + $posMem += 1; + // panose + $posMem += 10; + // fs + $posMem += 24; + // xszFfn + $xszFfn = ''; + do { + $char = self::getInt2d($this->data1Table, $posMem); + $posMem += 2; + if($char > 0) { + $xszFfn .= chr($char); + } + } while ($char != 0); + // xszAlt + $xszAlt = ''; + if($ixchSzAlt > 0) { + do { + $char = self::getInt2d($this->data1Table, $posMem); + $posMem += 2; + if($char == 0) { + break; + } + $xszAlt .= chr($char); + } while ($char != 0); + } + $this->arrayFonts[] = array( + 'main' => $xszFfn, + 'alt' => $xszAlt, + ); + } + } } - private function readObjectPool($data) - { - print_r('============ readObjectPool'.PHP_EOL); + /** + * Paragraph and information about them + * @link http://msdn.microsoft.com/en-us/library/dd908569%28v=office.12%29.aspx + */ + private function readRecordPlcfBtePapx(){ + $posMem = $this->arrayFib['fcPlcfBtePapx']; + $num = $this->getNumInLcb($this->arrayFib['lcbPlcfBtePapx'], 4); + $posMem += 4 * ($num + 1); + $plcfBtePapx_aPnBtePapx = $this->getArrayCP($this->data1Table, $posMem, $num); + $posMem += 4 * $num; - print_r(PHP_EOL); - print_r(PHP_EOL); - print_r(PHP_EOL); - //print_r($data); - print_r(PHP_EOL); - //print_r(dechex($data)); - print_r(PHP_EOL); + foreach($plcfBtePapx_aPnBtePapx as $aPnBtePapx){ + $offsetBase = $aPnBtePapx * 512; + $offset = $offsetBase; + + $string = ''; + + $numRun = self::getInt1d($this->dataWorkDocument, $offset + 511); + $arrayRGFC = array(); + for($inc = 0 ; $inc <= $numRun ; $inc++){ + $arrayRGFC[$inc] = self::getInt4d($this->dataWorkDocument, $offset); + $offset += 4; + } + $arrayRGB = array(); + for($inc = 1 ; $inc <= $numRun ; $inc++){ + // @link http://msdn.microsoft.com/en-us/library/dd925804(v=office.12).aspx + $arrayRGB[$inc] = self::getInt1d($this->dataWorkDocument, $offset); + $offset += 1; + // reserved + $offset += 12; + } + + foreach ($arrayRGFC as $key => $rgFc) { + if(!isset($arrayRGFC[$key + 1])){ + break; + } + $strLen = $arrayRGFC[$key + 1] - $arrayRGFC[$key] - 1; + for ($inc = 0; $inc < $strLen; $inc++) { + $byte = self::getInt1d($this->dataWorkDocument, $arrayRGFC[$key] + $inc); + if($byte > 0) { + $string .= chr($byte); + } + } + } + $this->arrayParagraphs[] = $string; + + //@todo readPrl for paragraphs + /*// use $this->readPrl() + foreach ($arrayRGB as $key => $rgb) { + $offset = $offsetBase + ($rgb * 2); + + $cb = self::getInt1d($this->dataWorkDocument, $offset); + $offset += 1; + print_r('$cb : '.$cb.PHP_EOL); + if($cb == 0){ + $cb = self::getInt1d($this->dataWorkDocument, $offset); + $cb = $cb * 2; + $offset += 1; + print_r('$cb0 : '.$cb.PHP_EOL); + } else { + $cb = $cb * 2 - 1; + print_r('$cbD : '.$cb.PHP_EOL); + } + $istd = self::getInt2d($this->dataWorkDocument, $offset); + $offset += 2; + $cb -= 2; + print_r('$istd : '.$istd.($istd == 0 ? ' (Normal)' : '').PHP_EOL); + if($cb > 0){ + do{ + $sprm = self::getInt2d($this->dataWorkDocument, $offset); + $offset += 2; + $cb -= 2; + $sprm_IsPmd = $sprm & 0x01FF; + $sprm_F = ($sprm/512) & 0x0001; + $sprm_Sgc = ($sprm/1024) & 0x0007; + $sprm_Spra = ($sprm/8192); + + print_r('$sprm : 0x'.dechex($sprm).PHP_EOL); + print_r('$sprm.ispmd : 0x'.dechex($sprm_IsPmd).PHP_EOL); + print_r('$sprm.f : 0x'.dechex($sprm_F).PHP_EOL); + print_r('$sprm.sgc : 0x'.dechex($sprm_Sgc)); + switch(dechex($sprm_Sgc)){ + case 0x01: + print_r(' (Paragraph property)'); + break; + case 0x02: + print_r(' (Character property)'); + break; + case 0x03: + print_r(' (Picture property)'); + break; + case 0x04: + print_r(' (Section property)'); + break; + case 0x05: + print_r(' (Table property)'); + break; + } + print_r(PHP_EOL); + print_r('$sprm.spra : 0x'.dechex($sprm_Spra).PHP_EOL); + switch(dechex($sprm_Spra)){ + case 0x0: + $operand = self::getInt1d($this->dataWorkDocument, $offset); + $offset += 1; + $cb -= 1; + switch(dechex($operand)){ + case 0x00: + $operand = 'OFF'; + break; + case 0x01: + $operand = 'ON'; + break; + case 0x80: + $operand = 'CURRENT VALUE'; + print_r(''.PHP_EOL.PHP_EOL); + break; + case 0x81: + $operand = 'OPPOSITE OF THE CURRENT VALUE'; + break; + } + break; + case 0x1: + $operand = self::getInt1d($this->dataWorkDocument, $offset); + $offset += 1; + $cb -= 1; + print_r('$operand : 0x'.dechex($operand).PHP_EOL); + break; + case 0x2: + case 0x4: + case 0x5: + $operand = self::getInt2d($this->dataWorkDocument, $offset); + $offset += 2; + $cb -= 2; + print_r('$operand : 0x'.dechex($operand).PHP_EOL); + break; + case 0x3: + if($sprm_IsPmd != 0x70){ + $operand = self::getInt4d($this->dataWorkDocument, $offset); + $offset += 4; + $cb -= 4; + print_r('$operand : 0x'.dechex($operand).PHP_EOL); + } + break; + case 0x7: + $operand = self::_GetInt3d($this->dataWorkDocument, $offset); + $offset += 3; + $cb -= 3; + print_r('$operand : 0x'.dechex($operand).PHP_EOL); + break; + default: + print_r('YO YO YO : '.PHP_EOL); + } + + // + switch(dechex($sprm_Sgc)){ + case 0x01: // Sprm is modifying a paragraph property. + switch($sprm_IsPmd){ + case 0x0A: // sprmPIlvl + print_r('sprmPIlvl : '.$operand.PHP_EOL.PHP_EOL); + break; + case 0x0B: // sprmPIlfo + print_r('sprmPIlfo : '.$operand.PHP_EOL.PHP_EOL); + break; + default: + print_r('$sprm_IsPmd(1) : '.$sprm_IsPmd.PHP_EOL.PHP_EOL); + break; + } + break; + case 0x02: // Sprm is modifying a character property. + switch($sprm_IsPmd){ + default: + print_r('$sprm_IsPmd(2) : '.$sprm_IsPmd.PHP_EOL.PHP_EOL); + break; + } + break; + case 0x03: // Sprm is modifying a picture property. + switch($sprm_IsPmd){ + default: + print_r('$sprm_IsPmd(3) : '.$sprm_IsPmd.PHP_EOL.PHP_EOL); + break; + } + break; + case 0x04: // Sprm is modifying a section property. + switch($sprm_IsPmd){ + default: + print_r('$sprm_IsPmd(4) : '.$sprm_IsPmd.PHP_EOL.PHP_EOL); + break; + } + break; + case 0x05: // Sprm is modifying a table property. + switch($sprm_IsPmd){ + default: + print_r('$sprm_IsPmd(4) : '.$sprm_IsPmd.PHP_EOL.PHP_EOL); + break; + } + break; + default: + print_r('$sprm_Sgc : '.dechex($sprm_Sgc).PHP_EOL.PHP_EOL); + break; + } + } while($cb > 0); + } else { + if($istd > 0){ + // @todo : Determining Properties of a Paragraph Style + # @link http://msdn.microsoft.com/en-us/library/dd948631%28v=office.12%29.aspx + } + } + }*/ + } + } + + /** + * Character formatting properties to text in a document + * @link http://msdn.microsoft.com/en-us/library/dd907108%28v=office.12%29.aspx + */ + private function readRecordPlcfBteChpx(){ + $posMem = $this->arrayFib['fcPlcfBteChpx']; + $num = $this->getNumInLcb($this->arrayFib['lcbPlcfBteChpx'], 4); + $PlcBteChpx_aPnBteChpx = array(); + for($inc = 0 ; $inc <= $num ; $inc++){ + $PlcBteChpx_aPnBteChpx[$inc] = self::getInt4d($this->data1Table, $posMem); + $posMem += 4; + } + $PnFkpChpx = self::getInt4d($this->data1Table, $posMem); + $posMem += 4; + + $offsetBase = $PnFkpChpx * 512; + $offset = $offsetBase; + + // ChpxFkp + // @link : http://msdn.microsoft.com/en-us/library/dd910989%28v=office.12%29.aspx + $numRGFC = self::getInt1d($this->dataWorkDocument, $offset + 511); + $arrayRGFC = array(); + for($inc = 0 ; $inc <= $numRGFC ; $inc++){ + $arrayRGFC[$inc] = self::getInt4d($this->dataWorkDocument, $offset); + $offset += 4; + } + + $arrayRGB = array(); + for($inc = 1 ; $inc <= $numRGFC ; $inc++){ + $arrayRGB[$inc] = self::getInt1d($this->dataWorkDocument, $offset); + $offset += 1; + } + + $start = 0; + foreach ($arrayRGB as $keyRGB => $rgb) { + $oStyle = new \stdClass(); + $oStyle->pos_start = $start; + $oStyle->pos_len = (int)ceil((($arrayRGFC[$keyRGB] -1) - $arrayRGFC[$keyRGB -1]) / 2); + $start += $oStyle->pos_len; + + if($rgb > 0){ + // Chp Structure + // @link : http://msdn.microsoft.com/en-us/library/dd772849%28v=office.12%29.aspx + $posRGB = $offsetBase + $rgb * 2; + + $cb = self::getInt1d($this->dataWorkDocument, $posRGB); + $posRGB += 1; + + $oStyle->style = $this->readPrl($this->dataWorkDocument, $posRGB, $cb); + $posRGB += $oStyle->style->length; + } + $this->arrayCharacters[] = $oStyle; + } + } + + /** + * @param $sprm + * @return \stdClass + */ + private function readSprm($sprm) + { + $oSprm = new \stdClass(); + $oSprm->isPmd = $sprm & 0x01FF; + $oSprm->f = ($sprm / 512) & 0x0001; + $oSprm->sgc = ($sprm / 1024) & 0x0007; + $oSprm->spra = ($sprm / 8192); + return $oSprm; + } + + /** + * @param string $data + * @param integer $pos + * @param \stdClass $oSprm + * @return array + */ + private function readSprmSpra($data, $pos, $oSprm) + { + $length = 0; + $operand = null; + + switch(dechex($oSprm->spra)){ + case 0x0: + $operand = self::getInt1d($data, $pos); + $length = 1; + switch(dechex($operand)){ + case 0x00: + $operand = false; + break; + case 0x01: + $operand = true; + break; + case 0x80: + $operand = self::SPRA_VALUE; + break; + case 0x81: + $operand = self::SPRA_VALUE_OPPOSITE; + break; + } + break; + case 0x1: + $operand = self::getInt1d($data, $pos); + $length = 1; + break; + case 0x2: + case 0x4: + case 0x5: + $operand = self::getInt2d($data, $pos); + $length = 2; + break; + case 0x3: + if($oSprm->isPmd != 0x70){ + $operand = self::getInt4d($data, $pos); + $length = 4; + } + break; + case 0x7: + $operand = self::_GetInt3d($data, $pos); + $length = 3; + break; + default: + // print_r('YO YO YO : '.PHP_EOL); + } + + return array( + 'length' => $length, + 'operand' => $operand, + ); + } + + /** + * @param $data integer + * @param $pos integer + * @return \stdClass + * @link http://msdn.microsoft.com/en-us/library/dd772849%28v=office.12%29.aspx + */ + private function readPrl($data, $pos, $cb) + { + $posStart = $pos; + $oStylePrl = new \stdClass(); + + // Variables + $sprmCPicLocation = null; + $sprmCFData = null; + $sprmCFSpec = null; + + do { + // Variables + $operand = null; + + $sprm = self::getInt2d($data, $pos); + $oSprm = $this->readSprm($sprm); + $pos += 2; + $cb -= 2; + + $arrayReturn = $this->readSprmSpra($data, $pos, $oSprm); + $pos += $arrayReturn['length']; + $cb -= $arrayReturn['length']; + $operand = $arrayReturn['operand']; + + switch(dechex($oSprm->sgc)){ + // Paragraph property + case 0x01: + break; + // Character property + case 0x02: + if(!isset($oStylePrl->styleFont)) { + $oStylePrl->styleFont = array(); + } + switch($oSprm->isPmd){ + // sprmCFRMarkIns + case 0x01: + break; + // sprmCFFldVanish + case 0x02: + break; + // sprmCPicLocation + case 0x03: + $sprmCPicLocation = $operand; + break; + // sprmCFData + case 0x06: + $sprmCFData = dechex($operand) == 0x00 ? false : true; + break; + // sprmCFItalic + case 0x36: + // By default, text is not italicized. + switch($operand) { + case false: + case true: + $oStylePrl->styleFont['italic'] = $operand; + break; + case self::SPRA_VALUE: + $oStylePrl->styleFont['italic'] = false; + break; + case self::SPRA_VALUE_OPPOSITE: + $oStylePrl->styleFont['italic'] = true; + break; + } + break; + // sprmCIstd + case 0x30: + //print_r('sprmCIstd : '.dechex($operand).PHP_EOL.PHP_EOL); + break; + // sprmCFBold + case 0x35: + // By default, text is not bold. + switch($operand) { + case false: + case true: + $oStylePrl->styleFont['bold'] = $operand; + break; + case self::SPRA_VALUE: + $oStylePrl->styleFont['bold'] = false; + break; + case self::SPRA_VALUE_OPPOSITE: + $oStylePrl->styleFont['bold'] = true; + break; + } + break; + // sprmCFStrike + case 0x37: + // By default, text is not struck through. + switch($operand) { + case false: + case true: + $oStylePrl->styleFont['strikethrough'] = $operand; + break; + case self::SPRA_VALUE: + $oStylePrl->styleFont['strikethrough'] = false; + break; + case self::SPRA_VALUE_OPPOSITE: + $oStylePrl->styleFont['strikethrough'] = true; + break; + } + break; + // sprmCKul + case 0x3E: + switch(dechex($operand)){ + case 0x00: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_NONE; + break; + case 0x01: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_SINGLE; + break; + case 0x02: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_WORDS; + break; + case 0x03: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_DOUBLE; + break; + case 0x04: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_DOTTED; + break; + case 0x06: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_HEAVY; + break; + case 0x07: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_DASH; + break; + case 0x09: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_DOTHASH; + break; + case 0x0A: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_DOTDOTDASH; + break; + case 0x0B: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_WAVY; + break; + case 0x14: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_DOTTEDHEAVY; + break; + case 0x17: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_DASHHEAVY; + break; + case 0x19: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_DOTHASHHEAVY; + break; + case 0x1A: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_DOTDOTDASHHEAVY; + break; + case 0x1B: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_WAVYHEAVY; + break; + case 0x27: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_DASHLONG; + break; + case 0x2B: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_WAVYDOUBLE; + break; + case 0x37: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_DASHLONGHEAVY; + break; + default: + $oStylePrl->styleFont['underline'] = Style\Font::UNDERLINE_NONE; + break; + } + break; + // sprmCIco + //@link http://msdn.microsoft.com/en-us/library/dd773060%28v=office.12%29.aspx + case 0x42: + switch(dechex($operand)){ + case 0x00: + case 0x01: + $oStylePrl->styleFont['color'] = '000000'; + break; + case 0x02: + $oStylePrl->styleFont['color'] = '0000FF'; + break; + case 0x03: + $oStylePrl->styleFont['color'] = '00FFFF'; + break; + case 0x04: + $oStylePrl->styleFont['color'] = '00FF00'; + break; + case 0x05: + $oStylePrl->styleFont['color'] = 'FF00FF'; + break; + case 0x06: + $oStylePrl->styleFont['color'] = 'FF0000'; + break; + case 0x07: + $oStylePrl->styleFont['color'] = 'FFFF00'; + break; + case 0x08: + $oStylePrl->styleFont['color'] = 'FFFFFF'; + break; + case 0x09: + $oStylePrl->styleFont['color'] = '000080'; + break; + case 0x0A: + $oStylePrl->styleFont['color'] = '008080'; + break; + case 0x0B: + $oStylePrl->styleFont['color'] = '008000'; + break; + case 0x0C: + $oStylePrl->styleFont['color'] = '800080'; + break; + case 0x0D: + $oStylePrl->styleFont['color'] = '800080'; + break; + case 0x0E: + $oStylePrl->styleFont['color'] = '808000'; + break; + case 0x0F: + $oStylePrl->styleFont['color'] = '808080'; + break; + case 0x10: + $oStylePrl->styleFont['color'] = 'C0C0C0'; + } + break; + // sprmCHps + case 0x43: + $oStylePrl->styleFont['size'] = dechex($operand/2); + break; + // sprmCIss + case 0x48: + if (!isset($oStylePrl->styleFont['superScript'])) { + $oStylePrl->styleFont['superScript'] = false; + } + if (!isset($oStylePrl->styleFont['subScript'])) { + $oStylePrl->styleFont['subScript'] = false; + } + switch (dechex($operand)) { + case 0x00: + // Normal text + break; + case 0x01: + $oStylePrl->styleFont['superScript'] = true; + break; + case 0x02: + $oStylePrl->styleFont['subScript'] = true; + break; + } + break; + // sprmCRgFtc0 + case 0x4F: + $oStylePrl->styleFont['name'] = ''; + if(isset($this->arrayFonts[$operand])) { + $oStylePrl->styleFont['name'] = $this->arrayFonts[$operand]['main']; + } + break; + // sprmCRgFtc1 + case 0x50: + // if the language for the text is an East Asian language + break; + // sprmCRgFtc2 + case 0x51: + // if the character falls outside the Unicode character range + break; + // sprmCFSpec + case 0x55: + $sprmCFSpec = $operand; + break; + // sprmCFtcBi + case 0x5E: + break; + // sprmCFItalicBi + case 0x5D: + break; + // sprmCHpsBi + case 0x61: + break; + // sprmCShd80 + //@link http://msdn.microsoft.com/en-us/library/dd923447%28v=office.12%29.aspx + case 0x66: + // $operand = self::getInt2d($data, $pos); + $pos += 2; + $cb -= 2; + // $ipat = ($operand >> 0) && bindec('111111'); + // $icoBack = ($operand >> 6) && bindec('11111'); + // $icoFore = ($operand >> 11) && bindec('11111'); + break; + // sprmCCv + //@link : http://msdn.microsoft.com/en-us/library/dd952824%28v=office.12%29.aspx + case 0x70: + $red = str_pad(dechex(self::getInt1d($this->dataWorkDocument, $pos)), 2, '0', STR_PAD_LEFT); + $pos += 1; + $green = str_pad(dechex(self::getInt1d($this->dataWorkDocument, $pos)), 2, '0', STR_PAD_LEFT); + $pos += 1; + $blue = str_pad(dechex(self::getInt1d($this->dataWorkDocument, $pos)), 2, '0', STR_PAD_LEFT); + $pos += 1; + $pos += 1; + $oStylePrl->styleFont['color'] = $red.$green.$blue; + $cb -= 4; + break; + default: + // print_r('@todo Character : 0x'.dechex($oSprm->isPmd)); + // print_r(PHP_EOL); + } + break; + // Picture property + case 0x03: + break; + // Section property + case 0x04: + if(!isset($oStylePrl->styleSection)) { + $oStylePrl->styleSection = array(); + } + switch($oSprm->isPmd){ + // sprmSNfcPgn + case 0x0E: + // numbering format used for page numbers + break; + // sprmSXaPage + case 0x1F: + $oStylePrl->styleSection['pageSizeW'] = $operand; + break; + // sprmSYaPage + case 0x20: + $oStylePrl->styleSection['pageSizeH'] = $operand; + break; + // sprmSDxaLeft + case 0x21: + $oStylePrl->styleSection['marginLeft'] = $operand; + break; + // sprmSDxaRight + case 0x22: + $oStylePrl->styleSection['marginRight'] = $operand; + break; + // sprmSDyaTop + case 0x23: + $oStylePrl->styleSection['marginTop'] = $operand; + break; + // sprmSDyaBottom + case 0x24: + $oStylePrl->styleSection['marginBottom'] = $operand; + break; + // sprmSFBiDi + case 0x28: + // RTL layout + break; + // sprmSDxtCharSpace + case 0x30: + // characpter pitch + break; + // sprmSDyaLinePitch + case 0x31: + // line height + break; + // sprmSClm + case 0x32: + // document grid mode + break; + // sprmSTextFlow + case 0x33: + // text flow + break; + default: + // print_r('@todo Section : 0x'.dechex($oSprm->isPmd)); + // print_r(PHP_EOL); + + } + break; + // Table property + case 0x05: + break; + } + } while($cb > 0); + + if (!is_null($sprmCPicLocation)) { + if (!is_null($sprmCFData) && $sprmCFData == 0x01) { + // NilPICFAndBinData + //@todo Read Hyperlink structure + /*$lcb = self::getInt4d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 4; + $cbHeader = self::getInt2d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 2; + // ignored + $sprmCPicLocation += 62; + // depending of the element + // Hyperlink => HFD + // HFD > bits + $sprmCPicLocation += 1; + // HFD > clsid + $sprmCPicLocation += 16; + // HFD > hyperlink + //@link : http://msdn.microsoft.com/en-us/library/dd909835%28v=office.12%29.aspx + $streamVersion = self::getInt4d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 4; + $data = self::getInt4d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 4; + $hlstmfAbsFromGetdataRel = ($data >> 9) & bindec('1'); + $hlstmfMonikerSavedAsStr = ($data >> 8) & bindec('1'); + $hlstmfHasFrameName = ($data >> 7) & bindec('1'); + $hlstmfHasCreationTime = ($data >> 6) & bindec('1'); + $hlstmfHasGUID = ($data >> 5) & bindec('1'); + $hlstmfHasDisplayName = ($data >> 4) & bindec('1'); + $hlstmfHasLocationStr = ($data >> 3) & bindec('1'); + $hlstmfSiteGaveDisplayName = ($data >> 2) & bindec('1'); + $hlstmfIsAbsolute = ($data >> 1) & bindec('1'); + $hlstmfHasMoniker = ($data >> 0) & bindec('1'); + for($inc = 0 ; $inc <= 32 ; $inc++){ + echo ($data >> $inc) & bindec('1'); + } + + print_r('$hlstmfHasMoniker > '.$hlstmfHasMoniker.PHP_EOL); + print_r('$hlstmfIsAbsolute > '.$hlstmfIsAbsolute.PHP_EOL); + print_r('$hlstmfSiteGaveDisplayName > '.$hlstmfSiteGaveDisplayName.PHP_EOL); + print_r('$hlstmfHasLocationStr > '.$hlstmfHasLocationStr.PHP_EOL); + print_r('$hlstmfHasDisplayName > '.$hlstmfHasDisplayName.PHP_EOL); + print_r('$hlstmfHasGUID > '.$hlstmfHasGUID.PHP_EOL); + print_r('$hlstmfHasCreationTime > '.$hlstmfHasCreationTime.PHP_EOL); + print_r('$hlstmfHasFrameName > '.$hlstmfHasFrameName.PHP_EOL); + print_r('$hlstmfMonikerSavedAsStr > '.$hlstmfMonikerSavedAsStr.PHP_EOL); + print_r('$hlstmfAbsFromGetdataRel > '.$hlstmfAbsFromGetdataRel.PHP_EOL); + if($streamVersion == 2){ + $AAA = self::getInt4d($this->dataData, $sprmCPicLocation); + echo 'AAAA : '.$AAA.PHP_EOL; + if($hlstmfHasDisplayName == 1){ + echo 'displayName'.PHP_EOL; + } + if($hlstmfHasFrameName == 1){ + echo 'targetFrameName'.PHP_EOL; + } + if($hlstmfHasMoniker == 1 || $hlstmfMonikerSavedAsStr == 1){ + $sprmCPicLocation += 16; + $length = self::getInt4d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 4; + for($inc = 0 ; $inc < ($length / 2) ; $inc++) { + $chr = self::getInt2d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 2; + print_r(chr($chr)); + } + echo PHP_EOL; + echo 'moniker : '.$length.PHP_EOL; + } + if($hlstmfHasMoniker == 1 || $hlstmfMonikerSavedAsStr == 1){ + echo 'oleMoniker'.PHP_EOL; + } + if($hlstmfHasLocationStr == 1){ + echo 'location'.PHP_EOL; + } + if($hlstmfHasGUID == 1) { + echo 'guid'.PHP_EOL; + $sprmCPicLocation += 16; + } + if($hlstmfHasCreationTime == 1) { + echo 'fileTime'.PHP_EOL; + $sprmCPicLocation += 4; + } + echo 'HYPERLINK'.PHP_EOL; + }*/ + } else { + // Pictures + //@link : http://msdn.microsoft.com/en-us/library/dd925458%28v=office.12%29.aspx + //@link : http://msdn.microsoft.com/en-us/library/dd926136%28v=office.12%29.aspx + // PICF : lcb + $sprmCPicLocation += 4; + // PICF : cbHeader + $sprmCPicLocation += 2; + // PICF : mfpf : mm + $mfpf_mm = self::getInt2d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 2; + // PICF : mfpf : xExt + $sprmCPicLocation += 2; + // PICF : mfpf : yExt + $sprmCPicLocation += 2; + // PICF : mfpf : swHMF + $sprmCPicLocation += 2; + // PICF : innerHeader : grf + $sprmCPicLocation += 4; + // PICF : innerHeader : padding1 + $sprmCPicLocation += 4; + // PICF : innerHeader : mmPM + $sprmCPicLocation += 2; + // PICF : innerHeader : padding2 + $sprmCPicLocation += 4; + // PICF : picmid : dxaGoal + $picmid_dxaGoal = self::getInt2d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 2; + // PICF : picmid : dyaGoal + $picmid_dyaGoal = self::getInt2d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 2; + // PICF : picmid : mx + $picmid_mx = self::getInt2d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 2; + // PICF : picmid : my + $picmid_my = self::getInt2d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 2; + // PICF : picmid : dxaReserved1 + $picmid_dxaCropLeft = self::getInt2d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 2; + // PICF : picmid : dyaReserved1 + $picmid_dxaCropTop = self::getInt2d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 2; + // PICF : picmid : dxaReserved2 + $picmid_dxaCropRight = self::getInt2d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 2; + // PICF : picmid : dyaReserved2 + $picmid_dxaCropBottom = self::getInt2d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 2; + // PICF : picmid : fReserved + $sprmCPicLocation += 1; + // PICF : picmid : bpp + $sprmCPicLocation += 1; + // PICF : picmid : brcTop80 + $sprmCPicLocation += 4; + // PICF : picmid : brcLeft80 + $sprmCPicLocation += 4; + // PICF : picmid : brcBottom80 + $sprmCPicLocation += 4; + // PICF : picmid : brcRight80 + $sprmCPicLocation += 4; + // PICF : picmid : dxaReserved3 + $sprmCPicLocation += 2; + // PICF : picmid : dyaReserved3 + $sprmCPicLocation += 2; + // PICF : cProps + $sprmCPicLocation += 2; + + if ($mfpf_mm == 0x0066) { + // cchPicName + $cchPicName = self::getInt1d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 1; + + // stPicName + $stPicName = ''; + for($inc = 0; $inc <= $cchPicName; $inc++){ + $chr = self::getInt1d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 1; + $stPicName .= chr($chr); + } + } + + // picture (OfficeArtInlineSpContainer) + // picture : shape + $shapeRH = $this->loadRecordHeader($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 8; + if($shapeRH['recVer'] == 0xF && $shapeRH['recInstance'] == 0x000 && $shapeRH['recType'] == 0xF004){ + $sprmCPicLocation += $shapeRH['recLen']; + } + // picture : rgfb + //@link : http://msdn.microsoft.com/en-us/library/dd950560%28v=office.12%29.aspx + $fileBlockRH = $this->loadRecordHeader($this->dataData, $sprmCPicLocation); + while ($fileBlockRH['recType'] == 0xF007 || ($fileBlockRH['recType'] >= 0xF018 && $fileBlockRH['recType'] <= 0xF117)){ + $sprmCPicLocation += 8; + switch ($fileBlockRH['recType']) { + // OfficeArtFBSE + //@link : http://msdn.microsoft.com/en-us/library/dd944923%28v=office.12%29.aspx + case 0xF007: + // btWin32 + $sprmCPicLocation += 1; + // btMacOS + $sprmCPicLocation += 1; + // rgbUid + $sprmCPicLocation += 16; + // tag + $sprmCPicLocation += 2; + // size + $sprmCPicLocation += 4; + // cRef + $sprmCPicLocation += 4; + // foDelay + $sprmCPicLocation += 4; + // unused1 + $sprmCPicLocation += 1; + // cbName + $cbName = self::getInt1d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 1; + // unused2 + $sprmCPicLocation += 1; + // unused3 + $sprmCPicLocation += 1; + // nameData + if ($cbName > 0) { + $nameData = ''; + for($inc = 0; $inc <= ($cbName / 2); $inc++){ + $chr = self::getInt2d($this->dataData, $sprmCPicLocation); + $sprmCPicLocation += 2; + $nameData .= chr($chr); + } + } + // embeddedBlip + //@link : http://msdn.microsoft.com/en-us/library/dd910081%28v=office.12%29.aspx + $embeddedBlipRH = $this->loadRecordHeader($this->dataData, $sprmCPicLocation); + switch ($embeddedBlipRH['recType']) { + case self::OFFICEARTBLIPJPG: + case self::OFFICEARTBLIPJPEG: + if(!isset($oStylePrl->image)){ + $oStylePrl->image = array(); + } + $sprmCPicLocation += 8; + // embeddedBlip : rgbUid1 + $sprmCPicLocation += 16; + if ($embeddedBlipRH['recInstance'] == 0x6E1) { + // rgbUid2 + $sprmCPicLocation += 16; + } + // embeddedBlip : tag + $sprmCPicLocation += 1; + // embeddedBlip : BLIPFileData + $oStylePrl->image['data'] = substr($this->dataData, $sprmCPicLocation, $embeddedBlipRH['recLen']); + $oStylePrl->image['format'] = 'jpg'; + // Image Size + $iCropWidth = $picmid_dxaGoal - ($picmid_dxaCropLeft + $picmid_dxaCropRight); + $iCropHeight = $picmid_dyaGoal - ($picmid_dxaCropTop + $picmid_dxaCropBottom); + if (!$iCropWidth){ + $iCropWidth = 1; + } + if (!$iCropHeight){ + $iCropHeight = 1; + } + $oStylePrl->image['width'] = Drawing::twipsToPixels($iCropWidth * $picmid_mx / 1000); + $oStylePrl->image['height'] = Drawing::twipsToPixels($iCropHeight * $picmid_my / 1000); + + $sprmCPicLocation += $embeddedBlipRH['recLen']; + break; + default: + // print_r(dechex($embeddedBlipRH['recType'])); + } + break; + } + $fileBlockRH = $this->loadRecordHeader($this->dataData, $sprmCPicLocation); + } + } + } + + $oStylePrl->length = $pos - $posStart; + return $oStylePrl; + } + + /** + * Read a record header + * @param string $stream + * @param integer $pos + * @return array + */ + private function loadRecordHeader($stream, $pos) + { + $rec = self::getInt2d($stream, $pos); + $recType = self::getInt2d($stream, $pos + 2); + $recLen = self::getInt4d($stream, $pos + 4); + return array( + 'recVer' => ($rec >> 0) & bindec('1111'), + 'recInstance' => ($rec >> 4) & bindec('111111111111'), + 'recType' => $recType, + 'recLen' => $recLen, + ); + } + + private function generatePhpWord() + { + foreach ($this->arraySections as $itmSection) { + $oSection = $this->phpWord->addSection(); + $oSection->setSettings($itmSection->styleSection); + + $sHYPERLINK = ''; + foreach ($this->arrayParagraphs as $itmParagraph) { + $textPara = $itmParagraph; + foreach ($this->arrayCharacters as $keyCharacters => $oCharacters) { + $subText = substr($textPara, $oCharacters->pos_start, $oCharacters->pos_len); + $subText = str_replace(chr(13), PHP_EOL, $subText); + $arrayText = explode(PHP_EOL, $subText); + if (end($arrayText) == '') { + array_pop($arrayText); + } + if (reset($arrayText) == '') { + array_shift($arrayText); + } + + // Style Character + $styleFont = array(); + if(isset($oCharacters->style)){ + if(isset($oCharacters->style->styleFont)){ + $styleFont = $oCharacters->style->styleFont; + } + } + + foreach ($arrayText as $sText) { + // HyperLink + if(empty($sText) && !empty($sHYPERLINK)) { + $arrHYPERLINK = explode('"', $sHYPERLINK); + $oSection->addLink($arrHYPERLINK[1], null); + // print_r('>addHyperLink<'.$sHYPERLINK.'>'.ord($sHYPERLINK[0]).EOL); + $sHYPERLINK = ''; + } + + // TextBreak + if(empty($sText)) { + $oSection->addTextBreak(); + $sHYPERLINK = ''; + // print_r('>addTextBreak<' . EOL); + } + + if(!empty($sText)){ + if(!empty($sHYPERLINK) && ord($sText[0]) > 20){ + $sHYPERLINK .= $sText; + } + if(empty($sHYPERLINK)) { + if(ord($sText[0]) > 20){ + if(strpos(trim($sText), 'HYPERLINK "') === 0){ + $sHYPERLINK = $sText; + } else { + $oSection->addText($sText, $styleFont); + // print_r('>addText<'.$sText.'>'.ord($sText[0]).EOL); + } + } + if(ord($sText[0]) == 1) { + if(isset($oCharacters->style->image)){ + $fileImage = tempnam(sys_get_temp_dir(), 'PHPWord_MsDoc').'.'.$oCharacters->style->image['format']; + file_put_contents($fileImage, $oCharacters->style->image['data']); + $oSection->addImage($fileImage, array('width' => $oCharacters->style->image['width'], 'height' => $oCharacters->style->image['height'])); + // print_r('>addImage<'.$fileImage.'>'.EOL); + } + } + } + } + } + } + } + + } } /** @@ -1378,7 +2283,7 @@ class MsDoc extends AbstractReader implements ReaderInterface * @param int $pos * @return int */ - public static function _GetInt1d($data, $pos) + public static function getInt1d($data, $pos) { return ord($data[$pos]); } @@ -1390,11 +2295,23 @@ class MsDoc extends AbstractReader implements ReaderInterface * @param int $pos * @return int */ - public static function _GetInt2d($data, $pos) + public static function getInt2d($data, $pos) { return ord($data[$pos]) | (ord($data[$pos+1]) << 8); } + /** + * Read 24-bit signed integer + * + * @param string $data + * @param int $pos + * @return int + */ + public static function _GetInt3d($data, $pos) + { + return ord($data[$pos]) | (ord($data[$pos+1]) << 8) | (ord($data[$pos+2]) << 16); + } + /** * Read 32-bit signed integer * @@ -1402,7 +2319,7 @@ class MsDoc extends AbstractReader implements ReaderInterface * @param int $pos * @return int */ - public static function _GetInt4d($data, $pos) + public static function getInt4d($data, $pos) { // FIX: represent numbers correctly on 64-bit system // http://sourceforge.net/tracker/index.php?func=detail&aid=1487372&group_id=99160&atid=623334 diff --git a/src/PhpWord/Shared/Drawing.php b/src/PhpWord/Shared/Drawing.php index 58a6ee1a..85ce595f 100644 --- a/src/PhpWord/Shared/Drawing.php +++ b/src/PhpWord/Shared/Drawing.php @@ -118,6 +118,76 @@ class Drawing } } + /** + * Convert centimeters width to twips + * + * @param integer $pValue + */ + public static function centimetersToTwips($pValue = 0) + { + if ($pValue != 0) { + return $pValue * 566.928; + } else { + return 0; + } + } + + /** + * Convert twips width to centimeters + * + * @param integer $pValue + */ + public static function twipsToCentimeters($pValue = 0) + { + if ($pValue != 0) { + return $pValue / 566.928; + } else { + return 0; + } + } + + /** + * Convert inches width to twips + * + * @param integer $pValue + */ + public static function inchesToTwips($pValue = 0) + { + if ($pValue != 0) { + return $pValue * 1440; + } else { + return 0; + } + } + + /** + * Convert twips width to inches + * + * @param integer $pValue + */ + public static function twipsToInches($pValue = 0) + { + if ($pValue != 0) { + return $pValue / 1440; + } else { + return 0; + } + } + + /** + * Convert twips width to pixels + * + * @param integer $pValue + */ + public static function twipsToPixels($pValue = 0) + { + if ($pValue != 0) { + return round($pValue / 15.873984); + } else { + return 0; + } + } + /** * Convert HTML hexadecimal to RGB * diff --git a/src/PhpWord/Style/Font.php b/src/PhpWord/Style/Font.php index dd8ff02a..149f7c54 100644 --- a/src/PhpWord/Style/Font.php +++ b/src/PhpWord/Style/Font.php @@ -225,7 +225,6 @@ class Font extends AbstractStyle return $this; } - /** * Get font size *