Add HashTable item

@param    PHPExcel_IComparable $pSource    Item to add
@throws    PHPExcel_Exception
1633
public function add(PHPExcel_IComparable $pSource = null)
    {
        $hash = $pSource->getHashCode();
        if (!isset($this->items[$hash])) {
            $this->items[$hash] = $pSource;
            $this->keyMap[count($this->items) - 1] = $hash;
        }
    }
1339764
public function copyCellCollection(PHPExcel_Worksheet $parent)
    {
        parent::copyCellCollection($parent);
        //    Open a new stream for the cell cache data
        $newFileHandle = fopen('php://temp/maxmemory:' . $this->memoryCacheSize, 'a+');
        //    Copy the existing cell cache data to the new stream
        fseek($this->fileHandle, 0);
        while (!feof($this->fileHandle)) {
            fwrite($newFileHandle, fread($this->fileHandle, 1024));
        }
        $this->fileHandle = $newFileHandle;
    }
312071
public function loadIntoExisting($pFilename, PHPExcel $objPHPExcel)
	{
		// Open file to validate
		$this->_openFile($pFilename);
		if (!$this->_isValidFormat()) {
			fclose ($this->_fileHandle);
			throw new PHPExcel_Reader_Exception($pFilename . " is an Invalid HTML file.");
		}
		//	Close after validating
		fclose ($this->_fileHandle);

		// Create new PHPExcel
		while ($objPHPExcel->getSheetCount() <= $this->_sheetIndex) {
			$objPHPExcel->createSheet();
		}
		$objPHPExcel->setActiveSheetIndex( $this->_sheetIndex );

		//	Create a new DOM object
		$dom = new domDocument;
		//	Reload the HTML file into the DOM object
		$loaded = $dom->loadHTMLFile($pFilename);
		if ($loaded === FALSE) {
			throw new PHPExcel_Reader_Exception('Failed to load ',$pFilename,' as a DOM Document');
		}

		//	Discard white space
		$dom->preserveWhiteSpace = false;


		$row = 0;
		$column = 'A';
		$content = '';
		$this->_processDomElement($dom,$objPHPExcel->getActiveSheet(),$row,$column,$content);

//		echo '<hr />';
//		var_dump($this->_dataArray);

		// Return
		return $objPHPExcel;
	}
943507
public function addEx(\Psc\Exception $e) {
    if (isset($e->errorMessage)) {
      $msg = $e->errorMessage;
    } else {
      $msg = $e->getMessage();
    }
    
    if (isset($e->errorStatus)) {
      $errorStatus = $e->errorStatus;
    } else {
      $errorStatus = self::ERROR;
    }
    
    $devInfo = NULL;
    if (PSC::getProject()->isDevelopment()) {
      $devInfo = \Psc\Exception::getExceptionText($e, 'html');
    }
    
    return $this->add($msg, $errorStatus, $devInfo);
  }
564419
public function writeTheme(PHPExcel $pPHPExcel = null)
	{
			// Create XML writer
			$objWriter = null;
			if ($this->getParentWriter()->getUseDiskCaching()) {
				$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
			} else {
				$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
			}

			// XML header
			$objWriter->startDocument('1.0','UTF-8','yes');

			// a:theme
			$objWriter->startElement('a:theme');
			$objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main');
			$objWriter->writeAttribute('name', 'Office Theme');

				// a:themeElements
				$objWriter->startElement('a:themeElements');

					// a:clrScheme
					$objWriter->startElement('a:clrScheme');
					$objWriter->writeAttribute('name', 'Office');

						// a:dk1
						$objWriter->startElement('a:dk1');

							// a:sysClr
							$objWriter->startElement('a:sysClr');
							$objWriter->writeAttribute('val', 'windowText');
							$objWriter->writeAttribute('lastClr', '000000');
							$objWriter->endElement();

						$objWriter->endElement();

						// a:lt1
						$objWriter->startElement('a:lt1');

							// a:sysClr
							$objWriter->startElement('a:sysClr');
							$objWriter->writeAttribute('val', 'window');
							$objWriter->writeAttribute('lastClr', 'FFFFFF');
							$objWriter->endElement();

						$objWriter->endElement();

						// a:dk2
						$this->_writeColourScheme($objWriter);

					$objWriter->endElement();

					// a:fontScheme
					$objWriter->startElement('a:fontScheme');
					$objWriter->writeAttribute('name', 'Office');

						// a:majorFont
						$objWriter->startElement('a:majorFont');
							$this->_writeFonts($objWriter, 'Cambria', self::$_majorFonts);
						$objWriter->endElement();

						// a:minorFont
						$objWriter->startElement('a:minorFont');
							$this->_writeFonts($objWriter, 'Calibri', self::$_minorFonts);
						$objWriter->endElement();

					$objWriter->endElement();

					// a:fmtScheme
					$objWriter->startElement('a:fmtScheme');
					$objWriter->writeAttribute('name', 'Office');

						// a:fillStyleLst
						$objWriter->startElement('a:fillStyleLst');

							// a:solidFill
							$objWriter->startElement('a:solidFill');

								// a:schemeClr
								$objWriter->startElement('a:schemeClr');
								$objWriter->writeAttribute('val', 'phClr');
								$objWriter->endElement();

							$objWriter->endElement();

							// a:gradFill
							$objWriter->startElement('a:gradFill');
							$objWriter->writeAttribute('rotWithShape', '1');

								// a:gsLst
								$objWriter->startElement('a:gsLst');

									// a:gs
									$objWriter->startElement('a:gs');
									$objWriter->writeAttribute('pos', '0');

										// a:schemeClr
										$objWriter->startElement('a:schemeClr');
										$objWriter->writeAttribute('val', 'phClr');

											// a:tint
											$objWriter->startElement('a:tint');
											$objWriter->writeAttribute('val', '50000');
											$objWriter->endElement();

											// a:satMod
											$objWriter->startElement('a:satMod');
											$objWriter->writeAttribute('val', '300000');
											$objWriter->endElement();

										$objWriter->endElement();

									$objWriter->endElement();

									// a:gs
									$objWriter->startElement('a:gs');
									$objWriter->writeAttribute('pos', '35000');

										// a:schemeClr
										$objWriter->startElement('a:schemeClr');
										$objWriter->writeAttribute('val', 'phClr');

											// a:tint
											$objWriter->startElement('a:tint');
											$objWriter->writeAttribute('val', '37000');
											$objWriter->endElement();

											// a:satMod
											$objWriter->startElement('a:satMod');
											$objWriter->writeAttribute('val', '300000');
											$objWriter->endElement();

										$objWriter->endElement();

									$objWriter->endElement();

									// a:gs
									$objWriter->startElement('a:gs');
									$objWriter->writeAttribute('pos', '100000');

										// a:schemeClr
										$objWriter->startElement('a:schemeClr');
										$objWriter->writeAttribute('val', 'phClr');

											// a:tint
											$objWriter->startElement('a:tint');
											$objWriter->writeAttribute('val', '15000');
											$objWriter->endElement();

											// a:satMod
											$objWriter->startElement('a:satMod');
											$objWriter->writeAttribute('val', '350000');
											$objWriter->endElement();

										$objWriter->endElement();

									$objWriter->endElement();

								$objWriter->endElement();

								// a:lin
								$objWriter->startElement('a:lin');
								$objWriter->writeAttribute('ang', '16200000');
								$objWriter->writeAttribute('scaled', '1');
								$objWriter->endElement();

							$objWriter->endElement();

							// a:gradFill
							$objWriter->startElement('a:gradFill');
							$objWriter->writeAttribute('rotWithShape', '1');

								// a:gsLst
								$objWriter->startElement('a:gsLst');

									// a:gs
									$objWriter->startElement('a:gs');
									$objWriter->writeAttribute('pos', '0');

										// a:schemeClr
										$objWriter->startElement('a:schemeClr');
										$objWriter->writeAttribute('val', 'phClr');

											// a:shade
											$objWriter->startElement('a:shade');
											$objWriter->writeAttribute('val', '51000');
											$objWriter->endElement();

											// a:satMod
											$objWriter->startElement('a:satMod');
											$objWriter->writeAttribute('val', '130000');
											$objWriter->endElement();

										$objWriter->endElement();

									$objWriter->endElement();

									// a:gs
									$objWriter->startElement('a:gs');
									$objWriter->writeAttribute('pos', '80000');

										// a:schemeClr
										$objWriter->startElement('a:schemeClr');
										$objWriter->writeAttribute('val', 'phClr');

											// a:shade
											$objWriter->startElement('a:shade');
											$objWriter->writeAttribute('val', '93000');
											$objWriter->endElement();

											// a:satMod
											$objWriter->startElement('a:satMod');
											$objWriter->writeAttribute('val', '130000');
											$objWriter->endElement();

										$objWriter->endElement();

									$objWriter->endElement();

									// a:gs
									$objWriter->startElement('a:gs');
									$objWriter->writeAttribute('pos', '100000');

										// a:schemeClr
										$objWriter->startElement('a:schemeClr');
										$objWriter->writeAttribute('val', 'phClr');

											// a:shade
											$objWriter->startElement('a:shade');
											$objWriter->writeAttribute('val', '94000');
											$objWriter->endElement();

											// a:satMod
											$objWriter->startElement('a:satMod');
											$objWriter->writeAttribute('val', '135000');
											$objWriter->endElement();

										$objWriter->endElement();

									$objWriter->endElement();

								$objWriter->endElement();

								// a:lin
								$objWriter->startElement('a:lin');
								$objWriter->writeAttribute('ang', '16200000');
								$objWriter->writeAttribute('scaled', '0');
								$objWriter->endElement();

							$objWriter->endElement();

						$objWriter->endElement();

						// a:lnStyleLst
						$objWriter->startElement('a:lnStyleLst');

							// a:ln
							$objWriter->startElement('a:ln');
							$objWriter->writeAttribute('w', '9525');
							$objWriter->writeAttribute('cap', 'flat');
							$objWriter->writeAttribute('cmpd', 'sng');
							$objWriter->writeAttribute('algn', 'ctr');

								// a:solidFill
								$objWriter->startElement('a:solidFill');

									// a:schemeClr
									$objWriter->startElement('a:schemeClr');
									$objWriter->writeAttribute('val', 'phClr');

											// a:shade
											$objWriter->startElement('a:shade');
											$objWriter->writeAttribute('val', '95000');
											$objWriter->endElement();

											// a:satMod
											$objWriter->startElement('a:satMod');
											$objWriter->writeAttribute('val', '105000');
											$objWriter->endElement();

									$objWriter->endElement();

								$objWriter->endElement();

								// a:prstDash
								$objWriter->startElement('a:prstDash');
								$objWriter->writeAttribute('val', 'solid');
								$objWriter->endElement();

							$objWriter->endElement();

							// a:ln
							$objWriter->startElement('a:ln');
							$objWriter->writeAttribute('w', '25400');
							$objWriter->writeAttribute('cap', 'flat');
							$objWriter->writeAttribute('cmpd', 'sng');
							$objWriter->writeAttribute('algn', 'ctr');

								// a:solidFill
								$objWriter->startElement('a:solidFill');

									// a:schemeClr
									$objWriter->startElement('a:schemeClr');
									$objWriter->writeAttribute('val', 'phClr');
									$objWriter->endElement();

								$objWriter->endElement();

								// a:prstDash
								$objWriter->startElement('a:prstDash');
								$objWriter->writeAttribute('val', 'solid');
								$objWriter->endElement();

							$objWriter->endElement();

							// a:ln
							$objWriter->startElement('a:ln');
							$objWriter->writeAttribute('w', '38100');
							$objWriter->writeAttribute('cap', 'flat');
							$objWriter->writeAttribute('cmpd', 'sng');
							$objWriter->writeAttribute('algn', 'ctr');

								// a:solidFill
								$objWriter->startElement('a:solidFill');

									// a:schemeClr
									$objWriter->startElement('a:schemeClr');
									$objWriter->writeAttribute('val', 'phClr');
									$objWriter->endElement();

								$objWriter->endElement();

								// a:prstDash
								$objWriter->startElement('a:prstDash');
								$objWriter->writeAttribute('val', 'solid');
								$objWriter->endElement();

							$objWriter->endElement();

						$objWriter->endElement();



						// a:effectStyleLst
						$objWriter->startElement('a:effectStyleLst');

							// a:effectStyle
							$objWriter->startElement('a:effectStyle');

								// a:effectLst
								$objWriter->startElement('a:effectLst');

									// a:outerShdw
									$objWriter->startElement('a:outerShdw');
									$objWriter->writeAttribute('blurRad', '40000');
									$objWriter->writeAttribute('dist', '20000');
									$objWriter->writeAttribute('dir', '5400000');
									$objWriter->writeAttribute('rotWithShape', '0');

										// a:srgbClr
										$objWriter->startElement('a:srgbClr');
										$objWriter->writeAttribute('val', '000000');

											// a:alpha
											$objWriter->startElement('a:alpha');
											$objWriter->writeAttribute('val', '38000');
											$objWriter->endElement();

										$objWriter->endElement();

									$objWriter->endElement();

								$objWriter->endElement();

							$objWriter->endElement();

							// a:effectStyle
							$objWriter->startElement('a:effectStyle');

								// a:effectLst
								$objWriter->startElement('a:effectLst');

									// a:outerShdw
									$objWriter->startElement('a:outerShdw');
									$objWriter->writeAttribute('blurRad', '40000');
									$objWriter->writeAttribute('dist', '23000');
									$objWriter->writeAttribute('dir', '5400000');
									$objWriter->writeAttribute('rotWithShape', '0');

										// a:srgbClr
										$objWriter->startElement('a:srgbClr');
										$objWriter->writeAttribute('val', '000000');

											// a:alpha
											$objWriter->startElement('a:alpha');
											$objWriter->writeAttribute('val', '35000');
											$objWriter->endElement();

										$objWriter->endElement();

									$objWriter->endElement();

								$objWriter->endElement();

							$objWriter->endElement();

							// a:effectStyle
							$objWriter->startElement('a:effectStyle');

								// a:effectLst
								$objWriter->startElement('a:effectLst');

									// a:outerShdw
									$objWriter->startElement('a:outerShdw');
									$objWriter->writeAttribute('blurRad', '40000');
									$objWriter->writeAttribute('dist', '23000');
									$objWriter->writeAttribute('dir', '5400000');
									$objWriter->writeAttribute('rotWithShape', '0');

										// a:srgbClr
										$objWriter->startElement('a:srgbClr');
										$objWriter->writeAttribute('val', '000000');

											// a:alpha
											$objWriter->startElement('a:alpha');
											$objWriter->writeAttribute('val', '35000');
											$objWriter->endElement();

										$objWriter->endElement();

									$objWriter->endElement();

								$objWriter->endElement();

								// a:scene3d
								$objWriter->startElement('a:scene3d');

									// a:camera
									$objWriter->startElement('a:camera');
									$objWriter->writeAttribute('prst', 'orthographicFront');

										// a:rot
										$objWriter->startElement('a:rot');
										$objWriter->writeAttribute('lat', '0');
										$objWriter->writeAttribute('lon', '0');
										$objWriter->writeAttribute('rev', '0');
										$objWriter->endElement();

									$objWriter->endElement();

									// a:lightRig
									$objWriter->startElement('a:lightRig');
									$objWriter->writeAttribute('rig', 'threePt');
									$objWriter->writeAttribute('dir', 't');

										// a:rot
										$objWriter->startElement('a:rot');
										$objWriter->writeAttribute('lat', '0');
										$objWriter->writeAttribute('lon', '0');
										$objWriter->writeAttribute('rev', '1200000');
										$objWriter->endElement();

									$objWriter->endElement();

								$objWriter->endElement();

								// a:sp3d
								$objWriter->startElement('a:sp3d');

									// a:bevelT
									$objWriter->startElement('a:bevelT');
									$objWriter->writeAttribute('w', '63500');
									$objWriter->writeAttribute('h', '25400');
									$objWriter->endElement();

								$objWriter->endElement();

							$objWriter->endElement();

						$objWriter->endElement();

						// a:bgFillStyleLst
						$objWriter->startElement('a:bgFillStyleLst');

							// a:solidFill
							$objWriter->startElement('a:solidFill');

								// a:schemeClr
								$objWriter->startElement('a:schemeClr');
								$objWriter->writeAttribute('val', 'phClr');
								$objWriter->endElement();

							$objWriter->endElement();

							// a:gradFill
							$objWriter->startElement('a:gradFill');
							$objWriter->writeAttribute('rotWithShape', '1');

								// a:gsLst
								$objWriter->startElement('a:gsLst');

									// a:gs
									$objWriter->startElement('a:gs');
									$objWriter->writeAttribute('pos', '0');

										// a:schemeClr
										$objWriter->startElement('a:schemeClr');
										$objWriter->writeAttribute('val', 'phClr');

											// a:tint
											$objWriter->startElement('a:tint');
											$objWriter->writeAttribute('val', '40000');
											$objWriter->endElement();

											// a:satMod
											$objWriter->startElement('a:satMod');
											$objWriter->writeAttribute('val', '350000');
											$objWriter->endElement();

										$objWriter->endElement();

									$objWriter->endElement();

									// a:gs
									$objWriter->startElement('a:gs');
									$objWriter->writeAttribute('pos', '40000');

										// a:schemeClr
										$objWriter->startElement('a:schemeClr');
										$objWriter->writeAttribute('val', 'phClr');

											// a:tint
											$objWriter->startElement('a:tint');
											$objWriter->writeAttribute('val', '45000');
											$objWriter->endElement();

											// a:shade
											$objWriter->startElement('a:shade');
											$objWriter->writeAttribute('val', '99000');
											$objWriter->endElement();

											// a:satMod
											$objWriter->startElement('a:satMod');
											$objWriter->writeAttribute('val', '350000');
											$objWriter->endElement();

										$objWriter->endElement();

									$objWriter->endElement();

									// a:gs
									$objWriter->startElement('a:gs');
									$objWriter->writeAttribute('pos', '100000');

										// a:schemeClr
										$objWriter->startElement('a:schemeClr');
										$objWriter->writeAttribute('val', 'phClr');

											// a:shade
											$objWriter->startElement('a:shade');
											$objWriter->writeAttribute('val', '20000');
											$objWriter->endElement();

											// a:satMod
											$objWriter->startElement('a:satMod');
											$objWriter->writeAttribute('val', '255000');
											$objWriter->endElement();

										$objWriter->endElement();

									$objWriter->endElement();

								$objWriter->endElement();

								// a:path
								$objWriter->startElement('a:path');
								$objWriter->writeAttribute('path', 'circle');

									// a:fillToRect
									$objWriter->startElement('a:fillToRect');
									$objWriter->writeAttribute('l', '50000');
									$objWriter->writeAttribute('t', '-80000');
									$objWriter->writeAttribute('r', '50000');
									$objWriter->writeAttribute('b', '180000');
									$objWriter->endElement();

								$objWriter->endElement();

							$objWriter->endElement();

							// a:gradFill
							$objWriter->startElement('a:gradFill');
							$objWriter->writeAttribute('rotWithShape', '1');

								// a:gsLst
								$objWriter->startElement('a:gsLst');

									// a:gs
									$objWriter->startElement('a:gs');
									$objWriter->writeAttribute('pos', '0');

										// a:schemeClr
										$objWriter->startElement('a:schemeClr');
										$objWriter->writeAttribute('val', 'phClr');

											// a:tint
											$objWriter->startElement('a:tint');
											$objWriter->writeAttribute('val', '80000');
											$objWriter->endElement();

											// a:satMod
											$objWriter->startElement('a:satMod');
											$objWriter->writeAttribute('val', '300000');
											$objWriter->endElement();

										$objWriter->endElement();

									$objWriter->endElement();

									// a:gs
									$objWriter->startElement('a:gs');
									$objWriter->writeAttribute('pos', '100000');

										// a:schemeClr
										$objWriter->startElement('a:schemeClr');
										$objWriter->writeAttribute('val', 'phClr');

											// a:shade
											$objWriter->startElement('a:shade');
											$objWriter->writeAttribute('val', '30000');
											$objWriter->endElement();

											// a:satMod
											$objWriter->startElement('a:satMod');
											$objWriter->writeAttribute('val', '200000');
											$objWriter->endElement();

										$objWriter->endElement();

									$objWriter->endElement();

								$objWriter->endElement();

								// a:path
								$objWriter->startElement('a:path');
								$objWriter->writeAttribute('path', 'circle');

									// a:fillToRect
									$objWriter->startElement('a:fillToRect');
									$objWriter->writeAttribute('l', '50000');
									$objWriter->writeAttribute('t', '50000');
									$objWriter->writeAttribute('r', '50000');
									$objWriter->writeAttribute('b', '50000');
									$objWriter->endElement();

								$objWriter->endElement();

							$objWriter->endElement();

						$objWriter->endElement();

					$objWriter->endElement();

				$objWriter->endElement();

				// a:objectDefaults
				$objWriter->writeElement('a:objectDefaults', null);

				// a:extraClrSchemeLst
				$objWriter->writeElement('a:extraClrSchemeLst', null);

			$objWriter->endElement();

			// Return
			return $objWriter->getData();
	}
125591
public function copyCellCollection(PHPExcel_Worksheet $parent) {
		parent::copyCellCollection($parent);
		//	Get a new id for the new file name
		$baseUnique = $this->_getUniqueID();
		$newFileName = $this->_cacheDirectory.'/PHPExcel.'.$baseUnique.'.cache';
		//	Copy the existing cell cache file
		copy ($this->_fileName,$newFileName);
		$this->_fileName = $newFileName;
		//	Open the copied cell cache file
		$this->_fileHandle = fopen($this->_fileName,'a+');
	}
793949
public function write(PHPExcel $pPHPExcel = null)
    {
        if (!$pPHPExcel) {
            $pPHPExcel = $this->getParentWriter()->getPHPExcel();
        }

        $objWriter = null;
        if ($this->getParentWriter()->getUseDiskCaching()) {
            $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
        } else {
            $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
        }

        // XML header
        $objWriter->startDocument('1.0', 'UTF-8');

        // Content
        $objWriter->startElement('office:document-styles');
            $objWriter->writeAttribute('xmlns:office', 'urn:oasis:names:tc:opendocument:xmlns:office:1.0');
            $objWriter->writeAttribute('xmlns:style', 'urn:oasis:names:tc:opendocument:xmlns:style:1.0');
            $objWriter->writeAttribute('xmlns:text', 'urn:oasis:names:tc:opendocument:xmlns:text:1.0');
            $objWriter->writeAttribute('xmlns:table', 'urn:oasis:names:tc:opendocument:xmlns:table:1.0');
            $objWriter->writeAttribute('xmlns:draw', 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0');
            $objWriter->writeAttribute('xmlns:fo', 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0');
            $objWriter->writeAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink');
            $objWriter->writeAttribute('xmlns:dc', 'http://purl.org/dc/elements/1.1/');
            $objWriter->writeAttribute('xmlns:meta', 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0');
            $objWriter->writeAttribute('xmlns:number', 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0');
            $objWriter->writeAttribute('xmlns:presentation', 'urn:oasis:names:tc:opendocument:xmlns:presentation:1.0');
            $objWriter->writeAttribute('xmlns:svg', 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0');
            $objWriter->writeAttribute('xmlns:chart', 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0');
            $objWriter->writeAttribute('xmlns:dr3d', 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0');
            $objWriter->writeAttribute('xmlns:math', 'http://www.w3.org/1998/Math/MathML');
            $objWriter->writeAttribute('xmlns:form', 'urn:oasis:names:tc:opendocument:xmlns:form:1.0');
            $objWriter->writeAttribute('xmlns:script', 'urn:oasis:names:tc:opendocument:xmlns:script:1.0');
            $objWriter->writeAttribute('xmlns:ooo', 'http://openoffice.org/2004/office');
            $objWriter->writeAttribute('xmlns:ooow', 'http://openoffice.org/2004/writer');
            $objWriter->writeAttribute('xmlns:oooc', 'http://openoffice.org/2004/calc');
            $objWriter->writeAttribute('xmlns:dom', 'http://www.w3.org/2001/xml-events');
            $objWriter->writeAttribute('xmlns:rpt', 'http://openoffice.org/2005/report');
            $objWriter->writeAttribute('xmlns:of', 'urn:oasis:names:tc:opendocument:xmlns:of:1.2');
            $objWriter->writeAttribute('xmlns:xhtml', 'http://www.w3.org/1999/xhtml');
            $objWriter->writeAttribute('xmlns:grddl', 'http://www.w3.org/2003/g/data-view#');
            $objWriter->writeAttribute('xmlns:tableooo', 'http://openoffice.org/2009/table');
            $objWriter->writeAttribute('xmlns:css3t', 'http://www.w3.org/TR/css3-text/');
            $objWriter->writeAttribute('office:version', '1.2');

            $objWriter->writeElement('office:font-face-decls');
            $objWriter->writeElement('office:styles');
            $objWriter->writeElement('office:automatic-styles');
            $objWriter->writeElement('office:master-styles');
        $objWriter->endElement();

        return $objWriter->getData();
    }
526003
public function copyCellCollection(PHPExcel_Worksheet $parent)
    {
        $this->currentCellIsDirty;
        $this->storeData();

        //    Get a new id for the new table name
        $tableName = str_replace('.', '_', $this->getUniqueID());
        if (!$this->DBHandle->exec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)
            AS SELECT * FROM kvp_'.$this->TableName)
        ) {
            throw new PHPExcel_Exception($this->DBHandle->lastErrorMsg());
        }

        //    Copy the existing cell cache file
        $this->TableName = $tableName;
    }
936273
public function writeWorkbookRelationships(PHPExcel $pPHPExcel = null)
	{
		// Create XML writer
		$objWriter = null;
		if ($this->getParentWriter()->getUseDiskCaching()) {
			$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
		} else {
			$objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
		}

		// XML header
		$objWriter->startDocument('1.0','UTF-8','yes');

		// Relationships
		$objWriter->startElement('Relationships');
		$objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/package/2006/relationships');

			// Relationship styles.xml
			$this->_writeRelationship(
				$objWriter,
				1,
				'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',
				'styles.xml'
			);

			// Relationship theme/theme1.xml
			$this->_writeRelationship(
				$objWriter,
				2,
				'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',
				'theme/theme1.xml'
			);

			// Relationship sharedStrings.xml
			$this->_writeRelationship(
				$objWriter,
				3,
				'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',
				'sharedStrings.xml'
			);

			// Relationships with sheets
			$sheetCount = $pPHPExcel->getSheetCount();
			for ($i = 0; $i < $sheetCount; ++$i) {
				$this->_writeRelationship(
					$objWriter,
					($i + 1 + 3),
					'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',
					'worksheets/sheet' . ($i + 1) . '.xml'
				);
			}

		$objWriter->endElement();

		// Return
		return $objWriter->getData();
	}
656951
private function _createCSSStyle(PHPExcel_Style $pStyle) {
		// Construct CSS
		$css = '';

		// Create CSS
		$css = array_merge(
			$this->_createCSSStyleAlignment($pStyle->getAlignment())
			, $this->_createCSSStyleBorders($pStyle->getBorders())
			, $this->_createCSSStyleFont($pStyle->getFont())
			, $this->_createCSSStyleFill($pStyle->getFill())
		);

		// Return
		return $css;
	}
1014920
public function addCache(CacheInterface $cache, $priority = 0)
    {
        $this->caches[spl_object_hash($cache)] = array(
            'cache' => $cache,
            'priority' => $priority
        );

        $this->sortedCaches = null;
    }
1012492
public function copyCellCollection(PHPExcel_Worksheet $parent)
    {
        $this->currentCellIsDirty;
        $this->storeData();

        //    Get a new id for the new table name
        $tableName = str_replace('.', '_', $this->getUniqueID());
        if (!$this->DBHandle->queryExec('CREATE TABLE kvp_'.$tableName.' (id VARCHAR(12) PRIMARY KEY, value BLOB)
            AS SELECT * FROM kvp_'.$this->TableName)
        ) {
            throw new PHPExcel_Exception(sqlite_error_string($this->DBHandle->lastError()));
        }

        //    Copy the existing cell cache file
        $this->TableName = $tableName;
    }
206126
public function addTable(Table $table)
    {
        if ($this->hasTable($table->getName())) {
            throw SchemaException::schemaTableAlreadyExists($this->getName(), $table->getName());
        }

        $this->tables[$table->getName()] = $table;

        if ($table->getSchema() !== $this) {
            $table->setSchema($this);
        }
    }
1122538
public function writeTheme(PHPExcel $pPHPExcel = null)
    {
        // Create XML writer
        $objWriter = null;
        if ($this->getParentWriter()->getUseDiskCaching()) {
            $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
        } else {
            $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
        }

        // XML header
        $objWriter->startDocument('1.0', 'UTF-8', 'yes');

        // a:theme
        $objWriter->startElement('a:theme');
        $objWriter->writeAttribute('xmlns:a', 'http://schemas.openxmlformats.org/drawingml/2006/main');
        $objWriter->writeAttribute('name', 'Office Theme');

            // a:themeElements
            $objWriter->startElement('a:themeElements');

                // a:clrScheme
                $objWriter->startElement('a:clrScheme');
                $objWriter->writeAttribute('name', 'Office');

                    // a:dk1
                    $objWriter->startElement('a:dk1');

                        // a:sysClr
                        $objWriter->startElement('a:sysClr');
                        $objWriter->writeAttribute('val', 'windowText');
                        $objWriter->writeAttribute('lastClr', '000000');
                        $objWriter->endElement();

                    $objWriter->endElement();

                    // a:lt1
                    $objWriter->startElement('a:lt1');

                        // a:sysClr
                        $objWriter->startElement('a:sysClr');
                        $objWriter->writeAttribute('val', 'window');
                        $objWriter->writeAttribute('lastClr', 'FFFFFF');
                        $objWriter->endElement();

                    $objWriter->endElement();

                    // a:dk2
                    $this->writeColourScheme($objWriter);

                $objWriter->endElement();

                // a:fontScheme
                $objWriter->startElement('a:fontScheme');
                $objWriter->writeAttribute('name', 'Office');

                    // a:majorFont
                    $objWriter->startElement('a:majorFont');
                        $this->writeFonts($objWriter, 'Cambria', self::$majorFonts);
                    $objWriter->endElement();

                    // a:minorFont
                    $objWriter->startElement('a:minorFont');
                        $this->writeFonts($objWriter, 'Calibri', self::$minorFonts);
                    $objWriter->endElement();

                $objWriter->endElement();

                // a:fmtScheme
                $objWriter->startElement('a:fmtScheme');
                $objWriter->writeAttribute('name', 'Office');

                    // a:fillStyleLst
                    $objWriter->startElement('a:fillStyleLst');

                        // a:solidFill
                        $objWriter->startElement('a:solidFill');

                            // a:schemeClr
                            $objWriter->startElement('a:schemeClr');
                            $objWriter->writeAttribute('val', 'phClr');
                            $objWriter->endElement();

                        $objWriter->endElement();

                        // a:gradFill
                        $objWriter->startElement('a:gradFill');
                        $objWriter->writeAttribute('rotWithShape', '1');

                            // a:gsLst
                            $objWriter->startElement('a:gsLst');

                                // a:gs
                                $objWriter->startElement('a:gs');
                                $objWriter->writeAttribute('pos', '0');

                                    // a:schemeClr
                                    $objWriter->startElement('a:schemeClr');
                                    $objWriter->writeAttribute('val', 'phClr');

                                        // a:tint
                                        $objWriter->startElement('a:tint');
                                        $objWriter->writeAttribute('val', '50000');
                                        $objWriter->endElement();

                                        // a:satMod
                                        $objWriter->startElement('a:satMod');
                                        $objWriter->writeAttribute('val', '300000');
                                        $objWriter->endElement();

                                    $objWriter->endElement();

                                $objWriter->endElement();

                                // a:gs
                                $objWriter->startElement('a:gs');
                                $objWriter->writeAttribute('pos', '35000');

                                    // a:schemeClr
                                    $objWriter->startElement('a:schemeClr');
                                    $objWriter->writeAttribute('val', 'phClr');

                                        // a:tint
                                        $objWriter->startElement('a:tint');
                                        $objWriter->writeAttribute('val', '37000');
                                        $objWriter->endElement();

                                        // a:satMod
                                        $objWriter->startElement('a:satMod');
                                        $objWriter->writeAttribute('val', '300000');
                                        $objWriter->endElement();

                                    $objWriter->endElement();

                                $objWriter->endElement();

                                // a:gs
                                $objWriter->startElement('a:gs');
                                $objWriter->writeAttribute('pos', '100000');

                                    // a:schemeClr
                                    $objWriter->startElement('a:schemeClr');
                                    $objWriter->writeAttribute('val', 'phClr');

                                        // a:tint
                                        $objWriter->startElement('a:tint');
                                        $objWriter->writeAttribute('val', '15000');
                                        $objWriter->endElement();

                                        // a:satMod
                                        $objWriter->startElement('a:satMod');
                                        $objWriter->writeAttribute('val', '350000');
                                        $objWriter->endElement();

                                    $objWriter->endElement();

                                $objWriter->endElement();

                            $objWriter->endElement();

                            // a:lin
                            $objWriter->startElement('a:lin');
                            $objWriter->writeAttribute('ang', '16200000');
                            $objWriter->writeAttribute('scaled', '1');
                            $objWriter->endElement();

                        $objWriter->endElement();

                        // a:gradFill
                        $objWriter->startElement('a:gradFill');
                        $objWriter->writeAttribute('rotWithShape', '1');

                            // a:gsLst
                            $objWriter->startElement('a:gsLst');

                                // a:gs
                                $objWriter->startElement('a:gs');
                                $objWriter->writeAttribute('pos', '0');

                                    // a:schemeClr
                                    $objWriter->startElement('a:schemeClr');
                                    $objWriter->writeAttribute('val', 'phClr');

                                        // a:shade
                                        $objWriter->startElement('a:shade');
                                        $objWriter->writeAttribute('val', '51000');
                                        $objWriter->endElement();

                                        // a:satMod
                                        $objWriter->startElement('a:satMod');
                                        $objWriter->writeAttribute('val', '130000');
                                        $objWriter->endElement();

                                    $objWriter->endElement();

                                $objWriter->endElement();

                                // a:gs
                                $objWriter->startElement('a:gs');
                                $objWriter->writeAttribute('pos', '80000');

                                    // a:schemeClr
                                    $objWriter->startElement('a:schemeClr');
                                    $objWriter->writeAttribute('val', 'phClr');

                                        // a:shade
                                        $objWriter->startElement('a:shade');
                                        $objWriter->writeAttribute('val', '93000');
                                        $objWriter->endElement();

                                        // a:satMod
                                        $objWriter->startElement('a:satMod');
                                        $objWriter->writeAttribute('val', '130000');
                                        $objWriter->endElement();

                                    $objWriter->endElement();

                                $objWriter->endElement();

                                // a:gs
                                $objWriter->startElement('a:gs');
                                $objWriter->writeAttribute('pos', '100000');

                                    // a:schemeClr
                                    $objWriter->startElement('a:schemeClr');
                                    $objWriter->writeAttribute('val', 'phClr');

                                        // a:shade
                                        $objWriter->startElement('a:shade');
                                        $objWriter->writeAttribute('val', '94000');
                                        $objWriter->endElement();

                                        // a:satMod
                                        $objWriter->startElement('a:satMod');
                                        $objWriter->writeAttribute('val', '135000');
                                        $objWriter->endElement();

                                    $objWriter->endElement();

                                $objWriter->endElement();

                            $objWriter->endElement();

                            // a:lin
                            $objWriter->startElement('a:lin');
                            $objWriter->writeAttribute('ang', '16200000');
                            $objWriter->writeAttribute('scaled', '0');
                            $objWriter->endElement();

                        $objWriter->endElement();

                    $objWriter->endElement();

                    // a:lnStyleLst
                    $objWriter->startElement('a:lnStyleLst');

                        // a:ln
                        $objWriter->startElement('a:ln');
                        $objWriter->writeAttribute('w', '9525');
                        $objWriter->writeAttribute('cap', 'flat');
                        $objWriter->writeAttribute('cmpd', 'sng');
                        $objWriter->writeAttribute('algn', 'ctr');

                            // a:solidFill
                            $objWriter->startElement('a:solidFill');

                                // a:schemeClr
                                $objWriter->startElement('a:schemeClr');
                                $objWriter->writeAttribute('val', 'phClr');

                                        // a:shade
                                        $objWriter->startElement('a:shade');
                                        $objWriter->writeAttribute('val', '95000');
                                        $objWriter->endElement();

                                        // a:satMod
                                        $objWriter->startElement('a:satMod');
                                        $objWriter->writeAttribute('val', '105000');
                                        $objWriter->endElement();

                                $objWriter->endElement();

                            $objWriter->endElement();

                            // a:prstDash
                            $objWriter->startElement('a:prstDash');
                            $objWriter->writeAttribute('val', 'solid');
                            $objWriter->endElement();

                        $objWriter->endElement();

                        // a:ln
                        $objWriter->startElement('a:ln');
                        $objWriter->writeAttribute('w', '25400');
                        $objWriter->writeAttribute('cap', 'flat');
                        $objWriter->writeAttribute('cmpd', 'sng');
                        $objWriter->writeAttribute('algn', 'ctr');

                            // a:solidFill
                            $objWriter->startElement('a:solidFill');

                                // a:schemeClr
                                $objWriter->startElement('a:schemeClr');
                                $objWriter->writeAttribute('val', 'phClr');
                                $objWriter->endElement();

                            $objWriter->endElement();

                            // a:prstDash
                            $objWriter->startElement('a:prstDash');
                            $objWriter->writeAttribute('val', 'solid');
                            $objWriter->endElement();

                        $objWriter->endElement();

                        // a:ln
                        $objWriter->startElement('a:ln');
                        $objWriter->writeAttribute('w', '38100');
                        $objWriter->writeAttribute('cap', 'flat');
                        $objWriter->writeAttribute('cmpd', 'sng');
                        $objWriter->writeAttribute('algn', 'ctr');

                            // a:solidFill
                            $objWriter->startElement('a:solidFill');

                                // a:schemeClr
                                $objWriter->startElement('a:schemeClr');
                                $objWriter->writeAttribute('val', 'phClr');
                                $objWriter->endElement();

                            $objWriter->endElement();

                            // a:prstDash
                            $objWriter->startElement('a:prstDash');
                            $objWriter->writeAttribute('val', 'solid');
                            $objWriter->endElement();

                        $objWriter->endElement();

                    $objWriter->endElement();



                    // a:effectStyleLst
                    $objWriter->startElement('a:effectStyleLst');

                        // a:effectStyle
                        $objWriter->startElement('a:effectStyle');

                            // a:effectLst
                            $objWriter->startElement('a:effectLst');

                                // a:outerShdw
                                $objWriter->startElement('a:outerShdw');
                                $objWriter->writeAttribute('blurRad', '40000');
                                $objWriter->writeAttribute('dist', '20000');
                                $objWriter->writeAttribute('dir', '5400000');
                                $objWriter->writeAttribute('rotWithShape', '0');

                                    // a:srgbClr
                                    $objWriter->startElement('a:srgbClr');
                                    $objWriter->writeAttribute('val', '000000');

                                        // a:alpha
                                        $objWriter->startElement('a:alpha');
                                        $objWriter->writeAttribute('val', '38000');
                                        $objWriter->endElement();

                                    $objWriter->endElement();

                                $objWriter->endElement();

                            $objWriter->endElement();

                        $objWriter->endElement();

                        // a:effectStyle
                        $objWriter->startElement('a:effectStyle');

                            // a:effectLst
                            $objWriter->startElement('a:effectLst');

                                // a:outerShdw
                                $objWriter->startElement('a:outerShdw');
                                $objWriter->writeAttribute('blurRad', '40000');
                                $objWriter->writeAttribute('dist', '23000');
                                $objWriter->writeAttribute('dir', '5400000');
                                $objWriter->writeAttribute('rotWithShape', '0');

                                    // a:srgbClr
                                    $objWriter->startElement('a:srgbClr');
                                    $objWriter->writeAttribute('val', '000000');

                                        // a:alpha
                                        $objWriter->startElement('a:alpha');
                                        $objWriter->writeAttribute('val', '35000');
                                        $objWriter->endElement();

                                    $objWriter->endElement();

                                $objWriter->endElement();

                            $objWriter->endElement();

                        $objWriter->endElement();

                        // a:effectStyle
                        $objWriter->startElement('a:effectStyle');

                            // a:effectLst
                            $objWriter->startElement('a:effectLst');

                                // a:outerShdw
                                $objWriter->startElement('a:outerShdw');
                                $objWriter->writeAttribute('blurRad', '40000');
                                $objWriter->writeAttribute('dist', '23000');
                                $objWriter->writeAttribute('dir', '5400000');
                                $objWriter->writeAttribute('rotWithShape', '0');

                                    // a:srgbClr
                                    $objWriter->startElement('a:srgbClr');
                                    $objWriter->writeAttribute('val', '000000');

                                        // a:alpha
                                        $objWriter->startElement('a:alpha');
                                        $objWriter->writeAttribute('val', '35000');
                                        $objWriter->endElement();

                                    $objWriter->endElement();

                                $objWriter->endElement();

                            $objWriter->endElement();

                            // a:scene3d
                            $objWriter->startElement('a:scene3d');

                                // a:camera
                                $objWriter->startElement('a:camera');
                                $objWriter->writeAttribute('prst', 'orthographicFront');

                                    // a:rot
                                    $objWriter->startElement('a:rot');
                                    $objWriter->writeAttribute('lat', '0');
                                    $objWriter->writeAttribute('lon', '0');
                                    $objWriter->writeAttribute('rev', '0');
                                    $objWriter->endElement();

                                $objWriter->endElement();

                                // a:lightRig
                                $objWriter->startElement('a:lightRig');
                                $objWriter->writeAttribute('rig', 'threePt');
                                $objWriter->writeAttribute('dir', 't');

                                    // a:rot
                                    $objWriter->startElement('a:rot');
                                    $objWriter->writeAttribute('lat', '0');
                                    $objWriter->writeAttribute('lon', '0');
                                    $objWriter->writeAttribute('rev', '1200000');
                                    $objWriter->endElement();

                                $objWriter->endElement();

                            $objWriter->endElement();

                            // a:sp3d
                            $objWriter->startElement('a:sp3d');

                                // a:bevelT
                                $objWriter->startElement('a:bevelT');
                                $objWriter->writeAttribute('w', '63500');
                                $objWriter->writeAttribute('h', '25400');
                                $objWriter->endElement();

                            $objWriter->endElement();

                        $objWriter->endElement();

                    $objWriter->endElement();

                    // a:bgFillStyleLst
                    $objWriter->startElement('a:bgFillStyleLst');

                        // a:solidFill
                        $objWriter->startElement('a:solidFill');

                            // a:schemeClr
                            $objWriter->startElement('a:schemeClr');
                            $objWriter->writeAttribute('val', 'phClr');
                            $objWriter->endElement();

                        $objWriter->endElement();

                        // a:gradFill
                        $objWriter->startElement('a:gradFill');
                        $objWriter->writeAttribute('rotWithShape', '1');

                            // a:gsLst
                            $objWriter->startElement('a:gsLst');

                                // a:gs
                                $objWriter->startElement('a:gs');
                                $objWriter->writeAttribute('pos', '0');

                                    // a:schemeClr
                                    $objWriter->startElement('a:schemeClr');
                                    $objWriter->writeAttribute('val', 'phClr');

                                        // a:tint
                                        $objWriter->startElement('a:tint');
                                        $objWriter->writeAttribute('val', '40000');
                                        $objWriter->endElement();

                                        // a:satMod
                                        $objWriter->startElement('a:satMod');
                                        $objWriter->writeAttribute('val', '350000');
                                        $objWriter->endElement();

                                    $objWriter->endElement();

                                $objWriter->endElement();

                                // a:gs
                                $objWriter->startElement('a:gs');
                                $objWriter->writeAttribute('pos', '40000');

                                    // a:schemeClr
                                    $objWriter->startElement('a:schemeClr');
                                    $objWriter->writeAttribute('val', 'phClr');

                                        // a:tint
                                        $objWriter->startElement('a:tint');
                                        $objWriter->writeAttribute('val', '45000');
                                        $objWriter->endElement();

                                        // a:shade
                                        $objWriter->startElement('a:shade');
                                        $objWriter->writeAttribute('val', '99000');
                                        $objWriter->endElement();

                                        // a:satMod
                                        $objWriter->startElement('a:satMod');
                                        $objWriter->writeAttribute('val', '350000');
                                        $objWriter->endElement();

                                    $objWriter->endElement();

                                $objWriter->endElement();

                                // a:gs
                                $objWriter->startElement('a:gs');
                                $objWriter->writeAttribute('pos', '100000');

                                    // a:schemeClr
                                    $objWriter->startElement('a:schemeClr');
                                    $objWriter->writeAttribute('val', 'phClr');

                                        // a:shade
                                        $objWriter->startElement('a:shade');
                                        $objWriter->writeAttribute('val', '20000');
                                        $objWriter->endElement();

                                        // a:satMod
                                        $objWriter->startElement('a:satMod');
                                        $objWriter->writeAttribute('val', '255000');
                                        $objWriter->endElement();

                                    $objWriter->endElement();

                                $objWriter->endElement();

                            $objWriter->endElement();

                            // a:path
                            $objWriter->startElement('a:path');
                            $objWriter->writeAttribute('path', 'circle');

                                // a:fillToRect
                                $objWriter->startElement('a:fillToRect');
                                $objWriter->writeAttribute('l', '50000');
                                $objWriter->writeAttribute('t', '-80000');
                                $objWriter->writeAttribute('r', '50000');
                                $objWriter->writeAttribute('b', '180000');
                                $objWriter->endElement();

                            $objWriter->endElement();

                        $objWriter->endElement();

                        // a:gradFill
                        $objWriter->startElement('a:gradFill');
                        $objWriter->writeAttribute('rotWithShape', '1');

                            // a:gsLst
                            $objWriter->startElement('a:gsLst');

                                // a:gs
                                $objWriter->startElement('a:gs');
                                $objWriter->writeAttribute('pos', '0');

                                    // a:schemeClr
                                    $objWriter->startElement('a:schemeClr');
                                    $objWriter->writeAttribute('val', 'phClr');

                                        // a:tint
                                        $objWriter->startElement('a:tint');
                                        $objWriter->writeAttribute('val', '80000');
                                        $objWriter->endElement();

                                        // a:satMod
                                        $objWriter->startElement('a:satMod');
                                        $objWriter->writeAttribute('val', '300000');
                                        $objWriter->endElement();

                                    $objWriter->endElement();

                                $objWriter->endElement();

                                // a:gs
                                $objWriter->startElement('a:gs');
                                $objWriter->writeAttribute('pos', '100000');

                                    // a:schemeClr
                                    $objWriter->startElement('a:schemeClr');
                                    $objWriter->writeAttribute('val', 'phClr');

                                        // a:shade
                                        $objWriter->startElement('a:shade');
                                        $objWriter->writeAttribute('val', '30000');
                                        $objWriter->endElement();

                                        // a:satMod
                                        $objWriter->startElement('a:satMod');
                                        $objWriter->writeAttribute('val', '200000');
                                        $objWriter->endElement();

                                    $objWriter->endElement();

                                $objWriter->endElement();

                            $objWriter->endElement();

                            // a:path
                            $objWriter->startElement('a:path');
                            $objWriter->writeAttribute('path', 'circle');

                                // a:fillToRect
                                $objWriter->startElement('a:fillToRect');
                                $objWriter->writeAttribute('l', '50000');
                                $objWriter->writeAttribute('t', '50000');
                                $objWriter->writeAttribute('r', '50000');
                                $objWriter->writeAttribute('b', '50000');
                                $objWriter->endElement();

                            $objWriter->endElement();

                        $objWriter->endElement();

                    $objWriter->endElement();

                $objWriter->endElement();

            $objWriter->endElement();

            // a:objectDefaults
            $objWriter->writeElement('a:objectDefaults', null);

            // a:extraClrSchemeLst
            $objWriter->writeElement('a:extraClrSchemeLst', null);

        $objWriter->endElement();

        // Return
        return $objWriter->getData();
    }
323624
public function writeDocPropsApp(PHPExcel $pPHPExcel = null)
    {
        // Create XML writer
        $objWriter = null;
        if ($this->getParentWriter()->getUseDiskCaching()) {
            $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_DISK, $this->getParentWriter()->getDiskCachingDirectory());
        } else {
            $objWriter = new PHPExcel_Shared_XMLWriter(PHPExcel_Shared_XMLWriter::STORAGE_MEMORY);
        }

        // XML header
        $objWriter->startDocument('1.0', 'UTF-8', 'yes');

        // Properties
        $objWriter->startElement('Properties');
        $objWriter->writeAttribute('xmlns', 'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties');
        $objWriter->writeAttribute('xmlns:vt', 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes');

        // Application
        $objWriter->writeElement('Application', 'Microsoft Excel');

        // DocSecurity
        $objWriter->writeElement('DocSecurity', '0');

        // ScaleCrop
        $objWriter->writeElement('ScaleCrop', 'false');

        // HeadingPairs
        $objWriter->startElement('HeadingPairs');

        // Vector
        $objWriter->startElement('vt:vector');
        $objWriter->writeAttribute('size', '2');
        $objWriter->writeAttribute('baseType', 'variant');

        // Variant
        $objWriter->startElement('vt:variant');
        $objWriter->writeElement('vt:lpstr', 'Worksheets');
        $objWriter->endElement();

        // Variant
        $objWriter->startElement('vt:variant');
        $objWriter->writeElement('vt:i4', $pPHPExcel->getSheetCount());
        $objWriter->endElement();

        $objWriter->endElement();

        $objWriter->endElement();

        // TitlesOfParts
        $objWriter->startElement('TitlesOfParts');

        // Vector
        $objWriter->startElement('vt:vector');
        $objWriter->writeAttribute('size', $pPHPExcel->getSheetCount());
        $objWriter->writeAttribute('baseType', 'lpstr');

        $sheetCount = $pPHPExcel->getSheetCount();
        for ($i = 0; $i < $sheetCount; ++$i) {
            $objWriter->writeElement('vt:lpstr', $pPHPExcel->getSheet($i)->getTitle());
        }

        $objWriter->endElement();

        $objWriter->endElement();

        // Company
        $objWriter->writeElement('Company', $pPHPExcel->getProperties()->getCompany());

        // Company
        $objWriter->writeElement('Manager', $pPHPExcel->getProperties()->getManager());

        // LinksUpToDate
        $objWriter->writeElement('LinksUpToDate', 'false');

        // SharedDoc
        $objWriter->writeElement('SharedDoc', 'false');

        // HyperlinksChanged
        $objWriter->writeElement('HyperlinksChanged', 'false');

        // AppVersion
        $objWriter->writeElement('AppVersion', '12.0000');

        $objWriter->endElement();

        // Return
        return $objWriter->getData();
    }
54364
private function writeSheetProtection(PHPExcel_Shared_XMLWriter $objWriter = null, PHPExcel_Worksheet $pSheet = null)
    {
        // sheetProtection
        $objWriter->startElement('sheetProtection');

        if ($pSheet->getProtection()->getPassword() != '') {
            $objWriter->writeAttribute('password', $pSheet->getProtection()->getPassword());
        }

        $objWriter->writeAttribute('sheet', ($pSheet->getProtection()->getSheet() ? 'true' : 'false'));
        $objWriter->writeAttribute('objects', ($pSheet->getProtection()->getObjects() ? 'true' : 'false'));
        $objWriter->writeAttribute('scenarios', ($pSheet->getProtection()->getScenarios() ? 'true' : 'false'));
        $objWriter->writeAttribute('formatCells', ($pSheet->getProtection()->getFormatCells() ? 'true' : 'false'));
        $objWriter->writeAttribute('formatColumns', ($pSheet->getProtection()->getFormatColumns() ? 'true' : 'false'));
        $objWriter->writeAttribute('formatRows', ($pSheet->getProtection()->getFormatRows() ? 'true' : 'false'));
        $objWriter->writeAttribute('insertColumns', ($pSheet->getProtection()->getInsertColumns() ? 'true' : 'false'));
        $objWriter->writeAttribute('insertRows', ($pSheet->getProtection()->getInsertRows() ? 'true' : 'false'));
        $objWriter->writeAttribute('insertHyperlinks', ($pSheet->getProtection()->getInsertHyperlinks() ? 'true' : 'false'));
        $objWriter->writeAttribute('deleteColumns', ($pSheet->getProtection()->getDeleteColumns() ? 'true' : 'false'));
        $objWriter->writeAttribute('deleteRows', ($pSheet->getProtection()->getDeleteRows() ? 'true' : 'false'));
        $objWriter->writeAttribute('selectLockedCells', ($pSheet->getProtection()->getSelectLockedCells() ? 'true' : 'false'));
        $objWriter->writeAttribute('sort', ($pSheet->getProtection()->getSort() ? 'true' : 'false'));
        $objWriter->writeAttribute('autoFilter', ($pSheet->getProtection()->getAutoFilter() ? 'true' : 'false'));
        $objWriter->writeAttribute('pivotTables', ($pSheet->getProtection()->getPivotTables() ? 'true' : 'false'));
        $objWriter->writeAttribute('selectUnlockedCells', ($pSheet->getProtection()->getSelectUnlockedCells() ? 'true' : 'false'));
        $objWriter->endElement();
    }
1266542
public function insertNewRowBefore($pBefore = 1, $pNumRows = 1)
    {
        if ($pBefore >= 1) {
            $objReferenceHelper = PHPExcel_ReferenceHelper::getInstance();
            $objReferenceHelper->insertNewBefore('A' . $pBefore, 0, $pNumRows, $this);
        } else {
            throw new PHPExcel_Exception("Rows can only be inserted before at least row 1.");
        }
        return $this;
    }