summaryrefslogtreecommitdiffstats
path: root/admin/survey/export/libs/PHPPowerPoint/Style
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2022-01-11 12:35:47 +0100
committerAnton Luka Šijanec <anton@sijanec.eu>2022-01-11 12:35:47 +0100
commit19985dbb8c0aa66dc4bf7905abc1148de909097d (patch)
tree2cd5a5d20d7e80fc2a51adf60d838d8a2c40999e /admin/survey/export/libs/PHPPowerPoint/Style
download1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.gz
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.bz2
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.lz
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.xz
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.tar.zst
1ka-19985dbb8c0aa66dc4bf7905abc1148de909097d.zip
Diffstat (limited to 'admin/survey/export/libs/PHPPowerPoint/Style')
-rw-r--r--admin/survey/export/libs/PHPPowerPoint/Style/Alignment.php243
-rw-r--r--admin/survey/export/libs/PHPPowerPoint/Style/Color.php170
-rw-r--r--admin/survey/export/libs/PHPPowerPoint/Style/Fill.php245
-rw-r--r--admin/survey/export/libs/PHPPowerPoint/Style/Font.php411
-rw-r--r--admin/survey/export/libs/PHPPowerPoint/Style/_notused_Border.php331
-rw-r--r--admin/survey/export/libs/PHPPowerPoint/Style/_notused_Borders.php577
6 files changed, 1977 insertions, 0 deletions
diff --git a/admin/survey/export/libs/PHPPowerPoint/Style/Alignment.php b/admin/survey/export/libs/PHPPowerPoint/Style/Alignment.php
new file mode 100644
index 0000000..996d064
--- /dev/null
+++ b/admin/survey/export/libs/PHPPowerPoint/Style/Alignment.php
@@ -0,0 +1,243 @@
+<?php
+/**
+ * PHPPowerPoint
+ *
+ * Copyright (c) 2009 - 2010 PHPPowerPoint
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * @category PHPPowerPoint
+ * @package PHPPowerPoint_Style
+ * @copyright Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
+ * @version 0.1.0, 2009-04-27
+ */
+
+
+/** PHPPowerPoint_IComparable */
+require_once 'PHPPowerPoint/IComparable.php';
+
+
+/**
+ * PHPPowerPoint_Style_Alignment
+ *
+ * @category PHPPowerPoint
+ * @package PHPPowerPoint_Style
+ * @copyright Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
+ */
+class PHPPowerPoint_Style_Alignment implements PHPPowerPoint_IComparable
+{
+ /* Horizontal alignment styles */
+ const HORIZONTAL_LEFT = 'l';
+ const HORIZONTAL_RIGHT = 'r';
+ const HORIZONTAL_CENTER = 'ctr';
+ const HORIZONTAL_JUSTIFY = 'just';
+ const HORIZONTAL_DISTRIBUTED = 'dist';
+
+ /* Vertical alignment styles */
+ const VERTICAL_BASE = 'base';
+ const VERTICAL_AUTO = 'auto';
+ const VERTICAL_BOTTOM = 'b';
+ const VERTICAL_TOP = 't';
+ const VERTICAL_CENTER = 'ctr';
+
+ /**
+ * Horizontal
+ *
+ * @var string
+ */
+ private $_horizontal;
+
+ /**
+ * Vertical
+ *
+ * @var string
+ */
+ private $_vertical;
+
+ /**
+ * Level
+ *
+ * @var int
+ */
+ private $_level;
+
+ /**
+ * Indent - only possible with horizontal alignment left and right
+ *
+ * @var int
+ */
+ private $_indent;
+
+ /**
+ * Create a new PHPPowerPoint_Style_Alignment
+ */
+ public function __construct()
+ {
+ // Initialise values
+ $this->_horizontal = PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT;
+ $this->_vertical = PHPPowerPoint_Style_Alignment::VERTICAL_BASE;
+ $this->_level = 0;
+ $this->_indent = 0;
+ }
+
+ /**
+ * Get Horizontal
+ *
+ * @return string
+ */
+ public function getHorizontal() {
+ return $this->_horizontal;
+ }
+
+ /**
+ * Set Horizontal
+ *
+ * @param string $pValue
+ */
+ public function setHorizontal($pValue = PHPPowerPoint_Style_Alignment::HORIZONTAL_LEF) {
+ if ($pValue == '') {
+ $pValue = PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT;
+ }
+ $this->_horizontal = $pValue;
+ }
+
+ /**
+ * Get Vertical
+ *
+ * @return string
+ */
+ public function getVertical() {
+ return $this->_vertical;
+ }
+
+ /**
+ * Set Vertical
+ *
+ * @param string $pValue
+ */
+ public function setVertical($pValue = PHPPowerPoint_Style_Alignment::VERTICAL_BASE) {
+ if ($pValue == '') {
+ $pValue = PHPPowerPoint_Style_Alignment::VERTICAL_BASE;
+ }
+ $this->_vertical = $pValue;
+ }
+
+ /**
+ * Get Level
+ *
+ * @return int
+ */
+ public function getLevel() {
+ return $this->_level;
+ }
+
+ /**
+ * Set Level
+ *
+ * @param int $pValue Ranging 0 - 8
+ * @throws Exception
+ */
+ public function setLevel($pValue = 0) {
+ if ($pValue < 0 || $pValue > 8) {
+ throw new Exception("Invalid value: shoul be range 0 - 8.");
+ }
+ $this->_level = $pValue;
+ }
+
+ /**
+ * Get indent
+ *
+ * @return int
+ */
+ public function getIndent() {
+ return $this->_indent;
+ }
+
+ /**
+ * Set indent
+ *
+ * @param int $pValue
+ */
+ public function setIndent($pValue = 0) {
+ if ($pValue > 0) {
+ if ($this->getHorizontal() != self::HORIZONTAL_GENERAL && $this->getHorizontal() != self::HORIZONTAL_LEFT && $this->getHorizontal() != self::HORIZONTAL_RIGHT) {
+ $pValue = 0; // indent not supported
+ }
+ }
+
+ $this->_indent = $pValue;
+ }
+
+ /**
+ * Get hash code
+ *
+ * @return string Hash code
+ */
+ public function getHashCode() {
+ return md5(
+ $this->_horizontal
+ . $this->_vertical
+ . $this->_level
+ . $this->_indent
+ . __CLASS__
+ );
+ }
+
+ /**
+ * Hash index
+ *
+ * @var string
+ */
+ private $_hashIndex;
+
+ /**
+ * Get hash index
+ *
+ * Note that this index may vary during script execution! Only reliable moment is
+ * while doing a write of a workbook and when changes are not allowed.
+ *
+ * @return string Hash index
+ */
+ public function getHashIndex() {
+ return $this->_hashIndex;
+ }
+
+ /**
+ * Set hash index
+ *
+ * Note that this index may vary during script execution! Only reliable moment is
+ * while doing a write of a workbook and when changes are not allowed.
+ *
+ * @param string $value Hash index
+ */
+ public function setHashIndex($value) {
+ $this->_hashIndex = $value;
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone() {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+}
diff --git a/admin/survey/export/libs/PHPPowerPoint/Style/Color.php b/admin/survey/export/libs/PHPPowerPoint/Style/Color.php
new file mode 100644
index 0000000..4f73c31
--- /dev/null
+++ b/admin/survey/export/libs/PHPPowerPoint/Style/Color.php
@@ -0,0 +1,170 @@
+<?php
+/**
+ * PHPPowerPoint
+ *
+ * Copyright (c) 2009 - 2010 PHPPowerPoint
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * @category PHPPowerPoint
+ * @package PHPPowerPoint_Style
+ * @copyright Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
+ * @version 0.1.0, 2009-04-27
+ */
+
+
+/** PHPPowerPoint_IComparable */
+require_once 'PHPPowerPoint/IComparable.php';
+
+
+/**
+ * PHPPowerPoint_Style_Color
+ *
+ * @category PHPPowerPoint
+ * @package PHPPowerPoint_Style
+ * @copyright Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
+ */
+class PHPPowerPoint_Style_Color implements PHPPowerPoint_IComparable
+{
+ /* Colors */
+ const COLOR_BLACK = 'FF000000';
+ const COLOR_WHITE = 'FFFFFFFF';
+ const COLOR_RED = 'FFFF0000';
+ const COLOR_DARKRED = 'FF800000';
+ const COLOR_BLUE = 'FF0000FF';
+ const COLOR_DARKBLUE = 'FF000080';
+ const COLOR_GREEN = 'FF00FF00';
+ const COLOR_DARKGREEN = 'FF008000';
+ const COLOR_YELLOW = 'FFFFFF00';
+ const COLOR_DARKYELLOW = 'FF808000';
+
+ /**
+ * ARGB - Alpha RGB
+ *
+ * @var string
+ */
+ private $_argb;
+
+ /**
+ * Create a new PHPPowerPoint_Style_Color
+ *
+ * @param string $pARGB
+ */
+ public function __construct($pARGB = PHPPowerPoint_Style_Color::COLOR_BLACK)
+ {
+ // Initialise values
+ $this->_argb = $pARGB;
+ }
+
+ /**
+ * Get ARGB
+ *
+ * @return string
+ */
+ public function getARGB() {
+ return $this->_argb;
+ }
+
+ /**
+ * Set ARGB
+ *
+ * @param string $pValue
+ */
+ public function setARGB($pValue = PHPPowerPoint_Style_Color::COLOR_BLACK) {
+ if ($pValue == '') {
+ $pValue = PHPPowerPoint_Style_Color::COLOR_BLACK;
+ }
+ $this->_argb = $pValue;
+ }
+
+ /**
+ * Get RGB
+ *
+ * @return string
+ */
+ public function getRGB() {
+ return substr($this->_argb, 2);
+ }
+
+ /**
+ * Set RGB
+ *
+ * @param string $pValue
+ */
+ public function setRGB($pValue = '000000') {
+ if ($pValue == '') {
+ $pValue = '000000';
+ }
+ $this->_argb = 'FF' . $pValue;
+ }
+
+ /**
+ * Get hash code
+ *
+ * @return string Hash code
+ */
+ public function getHashCode() {
+ return md5(
+ $this->_argb
+ . __CLASS__
+ );
+ }
+
+ /**
+ * Hash index
+ *
+ * @var string
+ */
+ private $_hashIndex;
+
+ /**
+ * Get hash index
+ *
+ * Note that this index may vary during script execution! Only reliable moment is
+ * while doing a write of a workbook and when changes are not allowed.
+ *
+ * @return string Hash index
+ */
+ public function getHashIndex() {
+ return $this->_hashIndex;
+ }
+
+ /**
+ * Set hash index
+ *
+ * Note that this index may vary during script execution! Only reliable moment is
+ * while doing a write of a workbook and when changes are not allowed.
+ *
+ * @param string $value Hash index
+ */
+ public function setHashIndex($value) {
+ $this->_hashIndex = $value;
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone() {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+}
diff --git a/admin/survey/export/libs/PHPPowerPoint/Style/Fill.php b/admin/survey/export/libs/PHPPowerPoint/Style/Fill.php
new file mode 100644
index 0000000..9c3120a
--- /dev/null
+++ b/admin/survey/export/libs/PHPPowerPoint/Style/Fill.php
@@ -0,0 +1,245 @@
+<?php
+/**
+ * PHPPowerPoint
+ *
+ * Copyright (c) 2009 - 2010 PHPPowerPoint
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * @category PHPPowerPoint
+ * @package PHPPowerPoint_Style
+ * @copyright Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
+ * @version 0.1.0, 2009-04-27
+ */
+
+
+/** PHPPowerPoint_Style_Color */
+require_once 'PHPPowerPoint/Style/Color.php';
+
+/** PHPPowerPoint_IComparable */
+require_once 'PHPPowerPoint/IComparable.php';
+
+
+/**
+ * PHPPowerPoint_Style_Fill
+ *
+ * @category PHPPowerPoint
+ * @package PHPPowerPoint_Style
+ * @copyright Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
+ */
+class PHPPowerPoint_Style_Fill implements PHPPowerPoint_IComparable
+{
+ /* Fill types */
+ const FILL_NONE = 'none';
+ const FILL_SOLID = 'solid';
+ const FILL_GRADIENT_LINEAR = 'linear';
+ const FILL_GRADIENT_PATH = 'path';
+ const FILL_PATTERN_DARKDOWN = 'darkDown';
+ const FILL_PATTERN_DARKGRAY = 'darkGray';
+ const FILL_PATTERN_DARKGRID = 'darkGrid';
+ const FILL_PATTERN_DARKHORIZONTAL = 'darkHorizontal';
+ const FILL_PATTERN_DARKTRELLIS = 'darkTrellis';
+ const FILL_PATTERN_DARKUP = 'darkUp';
+ const FILL_PATTERN_DARKVERTICAL = 'darkVertical';
+ const FILL_PATTERN_GRAY0625 = 'gray0625';
+ const FILL_PATTERN_GRAY125 = 'gray125';
+ const FILL_PATTERN_LIGHTDOWN = 'lightDown';
+ const FILL_PATTERN_LIGHTGRAY = 'lightGray';
+ const FILL_PATTERN_LIGHTGRID = 'lightGrid';
+ const FILL_PATTERN_LIGHTHORIZONTAL = 'lightHorizontal';
+ const FILL_PATTERN_LIGHTTRELLIS = 'lightTrellis';
+ const FILL_PATTERN_LIGHTUP = 'lightUp';
+ const FILL_PATTERN_LIGHTVERTICAL = 'lightVertical';
+ const FILL_PATTERN_MEDIUMGRAY = 'mediumGray';
+
+ /**
+ * Fill type
+ *
+ * @var string
+ */
+ private $_fillType;
+
+ /**
+ * Rotation
+ *
+ * @var double
+ */
+ private $_rotation;
+
+ /**
+ * Start color
+ *
+ * @var PHPPowerPoint_Style_Color
+ */
+ private $_startColor;
+
+ /**
+ * End color
+ *
+ * @var PHPPowerPoint_Style_Color
+ */
+ private $_endColor;
+
+ /**
+ * Create a new PHPPowerPoint_Style_Fill
+ */
+ public function __construct()
+ {
+ // Initialise values
+ $this->_fillType = PHPPowerPoint_Style_Fill::FILL_NONE;
+ $this->_rotation = 0;
+ $this->_startColor = new PHPPowerPoint_Style_Color(PHPPowerPoint_Style_Color::COLOR_WHITE);
+ $this->_endColor = new PHPPowerPoint_Style_Color(PHPPowerPoint_Style_Color::COLOR_BLACK);
+ }
+
+ /**
+ * Get Fill Type
+ *
+ * @return string
+ */
+ public function getFillType() {
+ $this->_fillType;
+ }
+
+ /**
+ * Set Fill Type
+ *
+ * @param string $pValue PHPPowerPoint_Style_Fill fill type
+ */
+ public function setFillType($pValue = PHPPowerPoint_Style_Fill::FILL_NONE) {
+ $this->_fillType = $pValue;
+ }
+
+ /**
+ * Get Rotation
+ *
+ * @return double
+ */
+ public function getRotation() {
+ return $this->_rotation;
+ }
+
+ /**
+ * Set Rotation
+ *
+ * @param double $pValue
+ */
+ public function setRotation($pValue = 0) {
+ $this->_rotation = $pValue;
+ }
+
+ /**
+ * Get Start Color
+ *
+ * @return PHPPowerPoint_Style_Color
+ */
+ public function getStartColor() {
+ // It's a get but it may lead to a modified color which we won't detect but in which case we must bind.
+ // So bind as an assurance.
+ return $this->_startColor;
+ }
+
+ /**
+ * Set Start Color
+ *
+ * @param PHPPowerPoint_Style_Color $pValue
+ * @throws Exception
+ */
+ public function setStartColor(PHPPowerPoint_Style_Color $pValue = null) {
+ $this->_startColor = $pValue;
+ }
+
+ /**
+ * Get End Color
+ *
+ * @return PHPPowerPoint_Style_Color
+ */
+ public function getEndColor() {
+ // It's a get but it may lead to a modified color which we won't detect but in which case we must bind.
+ // So bind as an assurance.
+ return $this->_endColor;
+ }
+
+ /**
+ * Set End Color
+ *
+ * @param PHPPowerPoint_Style_Color $pValue
+ * @throws Exception
+ */
+ public function setEndColor(PHPPowerPoint_Style_Color $pValue = null) {
+ $this->_endColor = $pValue;
+ }
+
+ /**
+ * Get hash code
+ *
+ * @return string Hash code
+ */
+ public function getHashCode() {
+ return md5(
+ $this->getFillType()
+ . $this->getRotation()
+ . $this->getStartColor()->getHashCode()
+ . $this->getEndColor()->getHashCode()
+ . __CLASS__
+ );
+ }
+
+ /**
+ * Hash index
+ *
+ * @var string
+ */
+ private $_hashIndex;
+
+ /**
+ * Get hash index
+ *
+ * Note that this index may vary during script execution! Only reliable moment is
+ * while doing a write of a workbook and when changes are not allowed.
+ *
+ * @return string Hash index
+ */
+ public function getHashIndex() {
+ return $this->_hashIndex;
+ }
+
+ /**
+ * Set hash index
+ *
+ * Note that this index may vary during script execution! Only reliable moment is
+ * while doing a write of a workbook and when changes are not allowed.
+ *
+ * @param string $value Hash index
+ */
+ public function setHashIndex($value) {
+ $this->_hashIndex = $value;
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone() {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+}
diff --git a/admin/survey/export/libs/PHPPowerPoint/Style/Font.php b/admin/survey/export/libs/PHPPowerPoint/Style/Font.php
new file mode 100644
index 0000000..8376dfb
--- /dev/null
+++ b/admin/survey/export/libs/PHPPowerPoint/Style/Font.php
@@ -0,0 +1,411 @@
+<?php
+/**
+ * PHPPowerPoint
+ *
+ * Copyright (c) 2009 - 2010 PHPPowerPoint
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * @category PHPPowerPoint
+ * @package PHPPowerPoint_Style
+ * @copyright Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
+ * @version 0.1.0, 2009-04-27
+ */
+
+
+/** PHPPowerPoint_Style_Color */
+require_once 'PHPPowerPoint/Style/Color.php';
+
+/** PHPPowerPoint_IComparable */
+require_once 'PHPPowerPoint/IComparable.php';
+
+
+/**
+ * PHPPowerPoint_Style_Font
+ *
+ * @category PHPPowerPoint
+ * @package PHPPowerPoint_Style
+ * @copyright Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
+ */
+class PHPPowerPoint_Style_Font implements PHPPowerPoint_IComparable
+{
+ /* Underline types */
+ const UNDERLINE_NONE = 'none';
+ const UNDERLINE_DASH = 'dash';
+ const UNDERLINE_DASHHEAVY = 'dashHeavy';
+ const UNDERLINE_DASHLONG = 'dashLong';
+ const UNDERLINE_DASHLONGHEAVY = 'dashLongHeavy';
+ const UNDERLINE_DOUBLE = 'dbl';
+ const UNDERLINE_DOTHASH = 'dotDash';
+ const UNDERLINE_DOTHASHHEAVY = 'dotDashHeavy';
+ const UNDERLINE_DOTDOTDASH = 'dotDotDash';
+ const UNDERLINE_DOTDOTDASHHEAVY = 'dotDotDashHeavy';
+ const UNDERLINE_DOTTED = 'dotted';
+ const UNDERLINE_DOTTEDHEAVY = 'dottedHeavy';
+ const UNDERLINE_HEAVY = 'heavy';
+ const UNDERLINE_SINGLE = 'sng';
+ const UNDERLINE_WAVY = 'wavy';
+ const UNDERLINE_WAVYDOUBLE = 'wavyDbl';
+ const UNDERLINE_WAVYHEAVY = 'wavyHeavy';
+ const UNDERLINE_WORDS = 'words';
+
+ /**
+ * Name
+ *
+ * @var string
+ */
+ private $_name;
+
+ /**
+ * Bold
+ *
+ * @var boolean
+ */
+ private $_bold;
+
+ /**
+ * Italic
+ *
+ * @var boolean
+ */
+ private $_italic;
+
+ /**
+ * Superscript
+ *
+ * @var boolean
+ */
+ private $_superScript;
+
+ /**
+ * Subscript
+ *
+ * @var boolean
+ */
+ private $_subScript;
+
+ /**
+ * Underline
+ *
+ * @var string
+ */
+ private $_underline;
+
+ /**
+ * Strikethrough
+ *
+ * @var boolean
+ */
+ private $_strikethrough;
+
+ /**
+ * Foreground color
+ *
+ * @var PHPPowerPoint_Style_Color
+ */
+ private $_color;
+
+ /**
+ * Create a new PHPPowerPoint_Style_Font
+ */
+ public function __construct()
+ {
+ // Initialise values
+ $this->_name = 'Calibri';
+ $this->_size = 10;
+ $this->_bold = false;
+ $this->_italic = false;
+ $this->_superScript = false;
+ $this->_subScript = false;
+ $this->_underline = PHPPowerPoint_Style_Font::UNDERLINE_NONE;
+ $this->_strikethrough = false;
+ $this->_color = new PHPPowerPoint_Style_Color(PHPPowerPoint_Style_Color::COLOR_BLACK);
+ }
+
+ /**
+ * Get Name
+ *
+ * @return string
+ */
+ public function getName() {
+ return $this->_name;
+ }
+
+ /**
+ * Set Name
+ *
+ * @param string $pValue
+ */
+ public function setName($pValue = 'Calibri') {
+ if ($pValue == '') {
+ $pValue = 'Calibri';
+ }
+ $this->_name = $pValue;
+ }
+
+ /**
+ * Get Size
+ *
+ * @return double
+ */
+ public function getSize() {
+ return $this->_size;
+ }
+
+ /**
+ * Set Size
+ *
+ * @param double $pValue
+ */
+ public function setSize($pValue = 10) {
+ if ($pValue == '') {
+ $pValue = 10;
+ }
+ $this->_size = $pValue;
+ }
+
+ /**
+ * Get Bold
+ *
+ * @return boolean
+ */
+ public function getBold() {
+ return $this->_bold;
+ }
+
+ /**
+ * Set Bold
+ *
+ * @param boolean $pValue
+ */
+ public function setBold($pValue = false) {
+ if ($pValue == '') {
+ $pValue = false;
+ }
+ $this->_bold = $pValue;
+ }
+
+ /**
+ * Get Italic
+ *
+ * @return boolean
+ */
+ public function getItalic() {
+ return $this->_italic;
+ }
+
+ /**
+ * Set Italic
+ *
+ * @param boolean $pValue
+ */
+ public function setItalic($pValue = false) {
+ if ($pValue == '') {
+ $pValue = false;
+ }
+ $this->_italic = $pValue;
+ }
+
+ /**
+ * Get SuperScript
+ *
+ * @return boolean
+ */
+ public function getSuperScript() {
+ return $this->_superScript;
+ }
+
+ /**
+ * Set SuperScript
+ *
+ * @param boolean $pValue
+ */
+ public function setSuperScript($pValue = false) {
+ if ($pValue == '') {
+ $pValue = false;
+ }
+ $this->_superScript = $pValue;
+ $this->_subScript = !$pValue;
+ }
+
+ /**
+ * Get SubScript
+ *
+ * @return boolean
+ */
+ public function getSubScript() {
+ return $this->_subScript;
+ }
+
+ /**
+ * Set SubScript
+ *
+ * @param boolean $pValue
+ */
+ public function setSubScript($pValue = false) {
+ if ($pValue == '') {
+ $pValue = false;
+ }
+ $this->_subScript = $pValue;
+ $this->_superScript = !$pValue;
+ }
+
+ /**
+ * Get Underline
+ *
+ * @return string
+ */
+ public function getUnderline() {
+ return $this->_underline;
+ }
+
+ /**
+ * Set Underline
+ *
+ * @param string $pValue PHPPowerPoint_Style_Font underline type
+ */
+ public function setUnderline($pValue = PHPPowerPoint_Style_Font::UNDERLINE_NONE) {
+ if ($pValue == '') {
+ $pValue = PHPPowerPoint_Style_Font::UNDERLINE_NONE;
+ }
+ $this->_underline = $pValue;
+ }
+
+ /**
+ * Get Striketrough
+ *
+ * @deprecated Use getStrikethrough() instead.
+ * @return boolean
+ */
+ public function getStriketrough() {
+ return $this->getStrikethrough();
+ }
+
+ /**
+ * Set Striketrough
+ *
+ * @deprecated Use setStrikethrough() instead.
+ * @param boolean $pValue
+ */
+ public function setStriketrough($pValue = false) {
+ $this->setStrikethrough($pValue);
+ }
+
+ /**
+ * Get Strikethrough
+ *
+ * @return boolean
+ */
+ public function getStrikethrough() {
+ return $this->_strikethrough;
+ }
+
+ /**
+ * Set Strikethrough
+ *
+ * @param boolean $pValue
+ */
+ public function setStrikethrough($pValue = false) {
+ if ($pValue == '') {
+ $pValue = false;
+ }
+ $this->_strikethrough = $pValue;
+ }
+
+ /**
+ * Get Color
+ *
+ * @return PHPPowerPoint_Style_Color
+ */
+ public function getColor() {
+ return $this->_color;
+ }
+
+ /**
+ * Set Color
+ *
+ * @param PHPPowerPoint_Style_Color $pValue
+ * @throws Exception
+ */
+ public function setColor(PHPPowerPoint_Style_Color $pValue = null) {
+ $this->_color = $pValue;
+ }
+
+ /**
+ * Get hash code
+ *
+ * @return string Hash code
+ */
+ public function getHashCode() {
+ return md5(
+ $this->_name
+ . $this->_size
+ . ($this->_bold ? 't' : 'f')
+ . ($this->_italic ? 't' : 'f')
+ . ($this->_superScript ? 't' : 'f')
+ . ($this->_subScript ? 't' : 'f')
+ . $this->_underline
+ . ($this->_strikethrough ? 't' : 'f')
+ . $this->_color->getHashCode()
+ . __CLASS__
+ );
+ }
+
+ /**
+ * Hash index
+ *
+ * @var string
+ */
+ private $_hashIndex;
+
+ /**
+ * Get hash index
+ *
+ * Note that this index may vary during script execution! Only reliable moment is
+ * while doing a write of a workbook and when changes are not allowed.
+ *
+ * @return string Hash index
+ */
+ public function getHashIndex() {
+ return $this->_hashIndex;
+ }
+
+ /**
+ * Set hash index
+ *
+ * Note that this index may vary during script execution! Only reliable moment is
+ * while doing a write of a workbook and when changes are not allowed.
+ *
+ * @param string $value Hash index
+ */
+ public function setHashIndex($value) {
+ $this->_hashIndex = $value;
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone() {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+}
diff --git a/admin/survey/export/libs/PHPPowerPoint/Style/_notused_Border.php b/admin/survey/export/libs/PHPPowerPoint/Style/_notused_Border.php
new file mode 100644
index 0000000..4867328
--- /dev/null
+++ b/admin/survey/export/libs/PHPPowerPoint/Style/_notused_Border.php
@@ -0,0 +1,331 @@
+<?php
+/**
+ * PHPPowerPoint
+ *
+ * Copyright (c) 2009 - 2010 PHPPowerPoint
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * @category PHPPowerPoint
+ * @package PHPPowerPoint_Style
+ * @copyright Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
+ * @version 0.1.0, 2009-04-27
+ */
+
+
+/** PHPPowerPoint_Style_Color */
+require_once 'PHPPowerPoint/Style/Color.php';
+
+/** PHPPowerPoint_IComparable */
+require_once 'PHPPowerPoint/IComparable.php';
+
+
+/**
+ * PHPPowerPoint_Style_Border
+ *
+ * @category PHPPowerPoint
+ * @package PHPPowerPoint_Style
+ * @copyright Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
+ */
+class PHPPowerPoint_Style_Border implements PHPPowerPoint_IComparable
+{
+ /* Border style */
+ const BORDER_NONE = 'none';
+ const BORDER_DASHDOT = 'dashDot';
+ const BORDER_DASHDOTDOT = 'dashDotDot';
+ const BORDER_DASHED = 'dashed';
+ const BORDER_DOTTED = 'dotted';
+ const BORDER_DOUBLE = 'double';
+ const BORDER_HAIR = 'hair';
+ const BORDER_MEDIUM = 'medium';
+ const BORDER_MEDIUMDASHDOT = 'mediumDashDot';
+ const BORDER_MEDIUMDASHDOTDOT = 'mediumDashDotDot';
+ const BORDER_MEDIUMDASHED = 'mediumDashed';
+ const BORDER_SLANTDASHDOT = 'slantDashDot';
+ const BORDER_THICK = 'thick';
+ const BORDER_THIN = 'thin';
+
+ /**
+ * Border style
+ *
+ * @var string
+ */
+ private $_borderStyle;
+
+ /**
+ * Border color
+ *
+ * @var PHPPowerPoint_Style_Color
+ */
+ private $_borderColor;
+
+ /**
+ * Parent
+ *
+ * @var PHPPowerPoint_Style_Borders
+ */
+ private $_parent;
+
+ /**
+ * Parent Property Name
+ *
+ * @var string
+ */
+ private $_parentPropertyName;
+
+ /**
+ * Create a new PHPPowerPoint_Style_Border
+ */
+ public function __construct()
+ {
+ // Initialise values
+ $this->_borderStyle = PHPPowerPoint_Style_Border::BORDER_NONE;
+ $this->_borderColor = new PHPPowerPoint_Style_Color(PHPPowerPoint_Style_Color::COLOR_BLACK);
+ }
+
+ /**
+ * Property Prepare bind
+ *
+ * Configures this object for late binding as a property of a parent object
+ *
+ * @param $parent
+ * @param $parentPropertyName
+ */
+ public function propertyPrepareBind($parent, $parentPropertyName)
+ {
+ // Initialize parent PHPPowerPoint_Style for late binding. This relationship purposely ends immediately when this object
+ // is bound to the PHPPowerPoint_Style object pointed to so as to prevent circular references.
+ $this->_parent = $parent;
+ $this->_parentPropertyName = $parentPropertyName;
+ }
+
+ /**
+ * Property Get Bound
+ *
+ * Returns the PHPPowerPoint_Style_Border that is actual bound to PHPPowerPoint_Style_Borders
+ *
+ * @return PHPPowerPoint_Style_Border
+ */
+ private function propertyGetBound() {
+ if(!isset($this->_parent))
+ return $this; // I am bound
+
+ if($this->_parent->propertyIsBound($this->_parentPropertyName))
+ {
+ switch($this->_parentPropertyName) // Another one is bound
+ {
+ case "_left":
+ return $this->_parent->getLeft();
+
+ case "_right":
+ return $this->_parent->getRight();
+
+ case "_top":
+ return $this->_parent->getTop();
+
+ case "_bottom":
+ return $this->_parent->getBottom();
+
+ case "_diagonal":
+ return $this->_parent->getDiagonal();
+
+ case "_vertical":
+ return $this->_parent->getVertical();
+
+ case "_horizontal":
+ return $this->_parent->getHorizontal();
+ }
+ }
+
+ return $this; // No one is bound yet
+ }
+
+ /**
+ * Property Begin Bind
+ *
+ * If no PHPPowerPoint_Style_Border has been bound to PHPPowerPoint_Style_Borders then bind this one. Return the actual bound one.
+ *
+ * @return PHPPowerPoint_Style_Border
+ */
+ private function propertyBeginBind() {
+
+ if(!isset($this->_parent))
+ return $this; // I am already bound
+
+ if($this->_parent->propertyIsBound($this->_parentPropertyName))
+ {
+ switch($this->_parentPropertyName) // Another one is already bound
+ {
+ case "_left":
+ return $this->_parent->getLeft();
+
+ case "_right":
+ return $this->_parent->getRight();
+
+ case "_top":
+ return $this->_parent->getTop();
+
+ case "_bottom":
+ return $this->_parent->getBottom();
+
+ case "_diagonal":
+ return $this->_parent->getDiagonal();
+
+ case "_vertical":
+ return $this->_parent->getVertical();
+
+ case "_horizontal":
+ return $this->_parent->getHorizontal();
+ }
+ }
+
+ $this->_parent->propertyCompleteBind($this, $this->_parentPropertyName); // Bind myself
+ $this->_parent = null;
+ return $this;
+ }
+
+ /**
+ * Apply styles from array
+ *
+ * <code>
+ * $objPHPPowerPoint->getActiveSheet()->getStyle('B2')->getBorders()->getTop()->applyFromArray(
+ * array(
+ * 'style' => PHPPowerPoint_Style_Border::BORDER_DASHDOT,
+ * 'color' => array(
+ * 'rgb' => '808080'
+ * )
+ * )
+ * );
+ * </code>
+ *
+ * @param array $pStyles Array containing style information
+ * @throws Exception
+ */
+ public function applyFromArray($pStyles = null) {
+ if (is_array($pStyles)) {
+ if (array_key_exists('style', $pStyles)) {
+ $this->setBorderStyle($pStyles['style']);
+ }
+ if (array_key_exists('color', $pStyles)) {
+ $this->getColor()->applyFromArray($pStyles['color']);
+ }
+ } else {
+ throw new Exception("Invalid style array passed.");
+ }
+ }
+
+ /**
+ * Get Border style
+ *
+ * @return string
+ */
+ public function getBorderStyle() {
+ return $this->propertyGetBound()->_borderStyle;
+ }
+
+ /**
+ * Set Border style
+ *
+ * @param string $pValue
+ */
+ public function setBorderStyle($pValue = PHPPowerPoint_Style_Border::BORDER_NONE) {
+
+ if ($pValue == '') {
+ $pValue = PHPPowerPoint_Style_Border::BORDER_NONE;
+ }
+ $this->propertyBeginBind()->_borderStyle = $pValue;
+ }
+
+ /**
+ * Get Border Color
+ *
+ * @return PHPPowerPoint_Style_Color
+ */
+ public function getColor() {
+ // It's a get but it may lead to a modified color which we won't detect but in which case we must bind.
+ // So bind as an assurance.
+ return $this->propertyBeginBind()->_borderColor;
+ }
+
+ /**
+ * Set Border Color
+ *
+ * @param PHPPowerPoint_Style_Color $pValue
+ * @throws Exception
+ */
+ public function setColor(PHPPowerPoint_Style_Color $pValue = null) {
+ $this->propertyBeginBind()->_borderColor = $pValue;
+ }
+
+ /**
+ * Get hash code
+ *
+ * @return string Hash code
+ */
+ public function getHashCode() {
+ $property = $this->propertyGetBound();
+ return md5(
+ $property->_borderStyle
+ . $property->_borderColor->getHashCode()
+ . __CLASS__
+ );
+ }
+
+ /**
+ * Hash index
+ *
+ * @var string
+ */
+ private $_hashIndex;
+
+ /**
+ * Get hash index
+ *
+ * Note that this index may vary during script execution! Only reliable moment is
+ * while doing a write of a workbook and when changes are not allowed.
+ *
+ * @return string Hash index
+ */
+ public function getHashIndex() {
+ return $this->_hashIndex;
+ }
+
+ /**
+ * Set hash index
+ *
+ * Note that this index may vary during script execution! Only reliable moment is
+ * while doing a write of a workbook and when changes are not allowed.
+ *
+ * @param string $value Hash index
+ */
+ public function setHashIndex($value) {
+ $this->_hashIndex = $value;
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone() {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+}
diff --git a/admin/survey/export/libs/PHPPowerPoint/Style/_notused_Borders.php b/admin/survey/export/libs/PHPPowerPoint/Style/_notused_Borders.php
new file mode 100644
index 0000000..f2ad8b7
--- /dev/null
+++ b/admin/survey/export/libs/PHPPowerPoint/Style/_notused_Borders.php
@@ -0,0 +1,577 @@
+<?php
+/**
+ * PHPPowerPoint
+ *
+ * Copyright (c) 2009 - 2010 PHPPowerPoint
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * @category PHPPowerPoint
+ * @package PHPPowerPoint_Style
+ * @copyright Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
+ * @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
+ * @version 0.1.0, 2009-04-27
+ */
+
+
+/** PHPPowerPoint_Style_Border */
+require_once 'PHPPowerPoint/Style/Border.php';
+
+/** PHPPowerPoint_IComparable */
+require_once 'PHPPowerPoint/IComparable.php';
+
+
+/**
+ * PHPPowerPoint_Style_Borders
+ *
+ * @category PHPPowerPoint
+ * @package PHPPowerPoint_Style
+ * @copyright Copyright (c) 2009 - 2010 PHPPowerPoint (http://www.codeplex.com/PHPPowerPoint)
+ */
+class PHPPowerPoint_Style_Borders implements PHPPowerPoint_IComparable
+{
+ /* Diagonal directions */
+ const DIAGONAL_NONE = 0;
+ const DIAGONAL_UP = 1;
+ const DIAGONAL_DOWN = 2;
+
+ /**
+ * Left
+ *
+ * @var PHPPowerPoint_Style_Border
+ */
+ private $_left;
+
+ /**
+ * Right
+ *
+ * @var PHPPowerPoint_Style_Border
+ */
+ private $_right;
+
+ /**
+ * Top
+ *
+ * @var PHPPowerPoint_Style_Border
+ */
+ private $_top;
+
+ /**
+ * Bottom
+ *
+ * @var PHPPowerPoint_Style_Border
+ */
+ private $_bottom;
+
+ /**
+ * Diagonal
+ *
+ * @var PHPPowerPoint_Style_Border
+ */
+ private $_diagonal;
+
+ /**
+ * Vertical
+ *
+ * @var PHPPowerPoint_Style_Border
+ */
+ private $_vertical;
+
+ /**
+ * Horizontal
+ *
+ * @var PHPPowerPoint_Style_Border
+ */
+ private $_horizontal;
+
+ /**
+ * DiagonalDirection
+ *
+ * @var int
+ */
+ private $_diagonalDirection;
+
+ /**
+ * Outline, defaults to true
+ *
+ * @var boolean
+ */
+ private $_outline;
+
+ /**
+ * Parent
+ *
+ * @var PHPPowerPoint_Style
+ */
+
+ private $_parent;
+
+ /**
+ * Parent Borders
+ *
+ * @var _parentPropertyName string
+ */
+ private $_parentPropertyName;
+
+ /**
+ * Create a new PHPPowerPoint_Style_Borders
+ */
+ public function __construct()
+ {
+ // Initialise values
+
+ /**
+ * The following properties are late bound. Binding is initiated by property classes when they are modified.
+ *
+ * _left
+ * _right
+ * _top
+ * _bottom
+ * _diagonal
+ * _vertical
+ * _horizontal
+ *
+ */
+
+ $this->_diagonalDirection = PHPPowerPoint_Style_Borders::DIAGONAL_NONE;
+ $this->_outline = true;
+ }
+
+ /**
+ * Property Prepare bind
+ *
+ * Configures this object for late binding as a property of a parent object
+ *
+ * @param $parent
+ * @param $parentPropertyName
+ */
+ public function propertyPrepareBind($parent, $parentPropertyName)
+ {
+ // Initialize parent PHPPowerPoint_Style for late binding. This relationship purposely ends immediately when this object
+ // is bound to the PHPPowerPoint_Style object pointed to so as to prevent circular references.
+ $this->_parent = $parent;
+ $this->_parentPropertyName = $parentPropertyName;
+ }
+
+ /**
+ * Property Get Bound
+ *
+ * Returns the PHPPowerPoint_Style_Borders that is actual bound to PHPPowerPoint_Style
+ *
+ * @return PHPPowerPoint_Style_Borders
+ */
+ private function propertyGetBound() {
+ if(!isset($this->_parent))
+ return $this; // I am bound
+
+ if($this->_parent->propertyIsBound($this->_parentPropertyName))
+ return $this->_parent->getBorders(); // Another one is bound
+
+ return $this; // No one is bound yet
+ }
+
+ /**
+ * Property Begin Bind
+ *
+ * If no PHPPowerPoint_Style_Borders has been bound to PHPPowerPoint_Style then bind this one. Return the actual bound one.
+ *
+ * @return PHPPowerPoint_Style_Borders
+ */
+ private function propertyBeginBind() {
+ if(!isset($this->_parent))
+ return $this; // I am already bound
+
+ if($this->_parent->propertyIsBound($this->_parentPropertyName))
+ return $this->_parent->getBorders(); // Another one is already bound
+
+ $this->_parent->propertyCompleteBind($this, $this->_parentPropertyName); // Bind myself
+ $this->_parent = null;
+
+ return $this;
+ }
+
+
+ /**
+ * Property Complete Bind
+ *
+ * Complete the binding process a child property object started
+ *
+ * @param $propertyObject
+ * @param $propertyName Name of this property in the parent object
+ */
+ public function propertyCompleteBind($propertyObject, $propertyName) {
+ switch($propertyName) {
+ case "_left":
+ $this->propertyBeginBind()->_left = $propertyObject;
+ break;
+
+ case "_right":
+ $this->propertyBeginBind()->_right = $propertyObject;
+ break;
+
+ case "_top":
+ $this->propertyBeginBind()->_top = $propertyObject;
+ break;
+
+ case "_bottom":
+ $this->propertyBeginBind()->_bottom = $propertyObject;
+ break;
+
+ case "_diagonal":
+ $this->propertyBeginBind()->_diagonal = $propertyObject;
+ break;
+
+ case "_vertical":
+ $this->propertyBeginBind()->_vertical = $propertyObject;
+ break;
+
+ case "_horizontal":
+ $this->propertyBeginBind()->_horizontal = $propertyObject;
+ break;
+
+ default:
+ throw new Exception("Invalid property passed.");
+ }
+ }
+
+ /**
+ * Property Is Bound
+ *
+ * Determines if a child property is bound to this one
+ *
+ * @param $propertyName Name of this property in the parent object
+ *
+ * @return boolean
+ */
+ public function propertyIsBound($propertyName) {
+ switch($propertyName) {
+ case "_left":
+ return isset($this->propertyGetBound()->_left);
+
+ case "_right":
+ return isset($this->propertyGetBound()->_right);
+
+ case "_top":
+ return isset($this->propertyGetBound()->_top);
+
+ case "_bottom":
+ return isset($this->propertyGetBound()->_bottom);
+
+ case "_diagonal":
+ return isset($this->propertyGetBound()->_diagonal);
+
+ case "_vertical":
+ return isset($this->propertyGetBound()->_vertical);
+
+ case "_horizontal":
+ return isset($this->propertyGetBound()->_horizontal);
+
+ default:
+ throw new Exception("Invalid property passed.");
+ }
+ }
+
+ /**
+ * Apply styles from array
+ *
+ * <code>
+ * $objPHPPowerPoint->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray(
+ * array(
+ * 'bottom' => array(
+ * 'style' => PHPPowerPoint_Style_Border::BORDER_DASHDOT,
+ * 'color' => array(
+ * 'rgb' => '808080'
+ * )
+ * ),
+ * 'top' => array(
+ * 'style' => PHPPowerPoint_Style_Border::BORDER_DASHDOT,
+ * 'color' => array(
+ * 'rgb' => '808080'
+ * )
+ * )
+ * )
+ * );
+ * </code>
+ * <code>
+ * $objPHPPowerPoint->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray(
+ * array(
+ * 'allborders' => array(
+ * 'style' => PHPPowerPoint_Style_Border::BORDER_DASHDOT,
+ * 'color' => array(
+ * 'rgb' => '808080'
+ * )
+ * )
+ * )
+ * );
+ * </code>
+ *
+ * @param array $pStyles Array containing style information
+ * @throws Exception
+ */
+ public function applyFromArray($pStyles = null) {
+ if (is_array($pStyles)) {
+ if (array_key_exists('allborders', $pStyles)) {
+ $this->getLeft()->applyFromArray($pStyles['allborders']);
+ $this->getRight()->applyFromArray($pStyles['allborders']);
+ $this->getTop()->applyFromArray($pStyles['allborders']);
+ $this->getBottom()->applyFromArray($pStyles['allborders']);
+ }
+ if (array_key_exists('left', $pStyles)) {
+ $this->getLeft()->applyFromArray($pStyles['left']);
+ }
+ if (array_key_exists('right', $pStyles)) {
+ $this->getRight()->applyFromArray($pStyles['right']);
+ }
+ if (array_key_exists('top', $pStyles)) {
+ $this->getTop()->applyFromArray($pStyles['top']);
+ }
+ if (array_key_exists('bottom', $pStyles)) {
+ $this->getBottom()->applyFromArray($pStyles['bottom']);
+ }
+ if (array_key_exists('diagonal', $pStyles)) {
+ $this->getDiagonal()->applyFromArray($pStyles['diagonal']);
+ }
+ if (array_key_exists('vertical', $pStyles)) {
+ $this->getVertical()->applyFromArray($pStyles['vertical']);
+ }
+ if (array_key_exists('horizontal', $pStyles)) {
+ $this->getHorizontal()->applyFromArray($pStyles['horizontal']);
+ }
+ if (array_key_exists('diagonaldirection', $pStyles)) {
+ $this->setDiagonalDirection($pStyles['diagonaldirection']);
+ }
+ if (array_key_exists('outline', $pStyles)) {
+ $this->setOutline($pStyles['outline']);
+ }
+ } else {
+ throw new Exception("Invalid style array passed.");
+ }
+ }
+
+ /**
+ * Get Left
+ *
+ * @return PHPPowerPoint_Style_Border
+ */
+ public function getLeft() {
+ $property = $this->propertyGetBound();
+ if(isset($property->_left))
+ return $property->_left;
+
+ $property = new PHPPowerPoint_Style_Border();
+ $property->propertyPrepareBind($this, "_left");
+ return $property;
+ }
+
+ /**
+ * Get Right
+ *
+ * @return PHPPowerPoint_Style_Border
+ */
+ public function getRight() {
+ $property = $this->propertyGetBound();
+ if(isset($property->_right))
+ return $property->_right;
+
+
+ $property = new PHPPowerPoint_Style_Border();
+ $property->propertyPrepareBind($this, "_right");
+ return $property;
+ }
+
+ /**
+ * Get Top
+ *
+ * @return PHPPowerPoint_Style_Border
+ */
+ public function getTop() {
+ $property = $this->propertyGetBound();
+ if(isset($property->_top))
+ return $property->_top;
+
+
+ $property = new PHPPowerPoint_Style_Border();
+ $property->propertyPrepareBind($this, "_top");
+ return $property;
+ }
+
+ /**
+ * Get Bottom
+ *
+ * @return PHPPowerPoint_Style_Border
+ */
+ public function getBottom() {
+ $property = $this->propertyGetBound();
+ if(isset($property->_bottom))
+ return $property->_bottom;
+
+ $property = new PHPPowerPoint_Style_Border();
+ $property->propertyPrepareBind($this, "_bottom");
+ return $property;
+ }
+
+ /**
+ * Get Diagonal
+ *
+ * @return PHPPowerPoint_Style_Border
+ */
+ public function getDiagonal() {
+ $property = $this->propertyGetBound();
+ if(isset($property->_diagonal))
+ return $property->_diagonal;
+
+ $property = new PHPPowerPoint_Style_Border();
+ $property->propertyPrepareBind($this, "_diagonal");
+ return $property;
+ }
+
+ /**
+ * Get Vertical
+ *
+ * @return PHPPowerPoint_Style_Border
+ */
+ public function getVertical() {
+ $property = $this->propertyGetBound();
+ if(isset($property->_vertical))
+ return $property->_vertical;
+
+ $property = new PHPPowerPoint_Style_Border();
+ $property->propertyPrepareBind($this, "_vertical");
+ return $property;
+ }
+
+ /**
+ * Get Horizontal
+ *
+ * @return PHPPowerPoint_Style_Border
+ */
+ public function getHorizontal() {
+ $property = $this->propertyGetBound();
+ if(isset($property->_horizontal))
+ return $property->_horizontal;
+
+ $property = new PHPPowerPoint_Style_Border();
+ $property->propertyPrepareBind($this, "_horizontal");
+ return $property;
+ }
+
+ /**
+ * Get DiagonalDirection
+ *
+ * @return int
+ */
+ public function getDiagonalDirection() {
+ return $this->propertyGetBound()->_diagonalDirection;
+ }
+
+ /**
+ * Set DiagonalDirection
+ *
+ * @param int $pValue
+ */
+ public function setDiagonalDirection($pValue = PHPPowerPoint_Style_Borders::DIAGONAL_NONE) {
+ if ($pValue == '') {
+ $pValue = PHPPowerPoint_Style_Borders::DIAGONAL_NONE;
+ }
+ $this->propertyBeginBind()->_diagonalDirection = $pValue;
+ }
+
+ /**
+ * Get Outline
+ *
+ * @return boolean
+ */
+ public function getOutline() {
+ return $this->propertyGetBound()->_outline;
+ }
+
+ /**
+ * Set Outline
+ *
+ * @param boolean $pValue
+ */
+ public function setOutline($pValue = true) {
+ if ($pValue == '') {
+ $pValue = true;
+ }
+ $this->propertyBeginBind()->_outline = $pValue;
+ }
+
+ /**
+ * Get hash code
+ *
+ * @return string Hash code
+ */
+ public function getHashCode() {
+ $property = $this->propertyGetBound();
+ return md5(
+ $property->getLeft()->getHashCode()
+ . $property->getRight()->getHashCode()
+ . $property->getTop()->getHashCode()
+ . $property->getBottom()->getHashCode()
+ . $property->getDiagonal()->getHashCode()
+ . $property->getVertical()->getHashCode()
+ . $property->getHorizontal()->getHashCode()
+ . $property->getDiagonalDirection()
+ . ($property->getOutline() ? 't' : 'f')
+ . __CLASS__
+ );
+ }
+
+ /**
+ * Hash index
+ *
+ * @var string
+ */
+ private $_hashIndex;
+
+ /**
+ * Get hash index
+ *
+ * Note that this index may vary during script execution! Only reliable moment is
+ * while doing a write of a workbook and when changes are not allowed.
+ *
+ * @return string Hash index
+ */
+ public function getHashIndex() {
+ return $this->_hashIndex;
+ }
+
+ /**
+ * Set hash index
+ *
+ * Note that this index may vary during script execution! Only reliable moment is
+ * while doing a write of a workbook and when changes are not allowed.
+ *
+ * @param string $value Hash index
+ */
+ public function setHashIndex($value) {
+ $this->_hashIndex = $value;
+ }
+
+ /**
+ * Implement PHP __clone to create a deep clone, not just a shallow copy.
+ */
+ public function __clone() {
+ $vars = get_object_vars($this);
+ foreach ($vars as $key => $value) {
+ if (is_object($value)) {
+ $this->$key = clone $value;
+ } else {
+ $this->$key = $value;
+ }
+ }
+ }
+}