diff --git a/Classes/PHPExcel/Style/Font.php b/Classes/PHPExcel/Style/Font.php index 095f06fb..c80e08d6 100644 --- a/Classes/PHPExcel/Style/Font.php +++ b/Classes/PHPExcel/Style/Font.php @@ -89,7 +89,7 @@ class PHPExcel_Style_Font implements PHPExcel_IComparable * * @var string */ - private $_underline = PHPExcel_Style_Font::UNDERLINE_NONE; + private $_underline = self::UNDERLINE_NONE; /** * Strikethrough @@ -500,15 +500,16 @@ class PHPExcel_Style_Font implements PHPExcel_IComparable /** * Set Underline * - * @param string $pValue PHPExcel_Style_Font underline type + * @param string|boolean $pValue PHPExcel_Style_Font underline type + * If a boolean is passed, then true equates to UNDERLINE_SINGLE, + * false equates to UNDERLINE_NONE * @return PHPExcel_Style_Font */ - public function setUnderline($pValue = PHPExcel_Style_Font::UNDERLINE_NONE) { + public function setUnderline($pValue = self::UNDERLINE_NONE) { if (is_bool($pValue)) { - $pValue = ($pValue) ? PHPExcel_Style_Font::UNDERLINE_SINGLE : PHPExcel_Style_Font::UNDERLINE_NONE; - } - if ($pValue == '') { - $pValue = PHPExcel_Style_Font::UNDERLINE_NONE; + $pValue = ($pValue) ? self::UNDERLINE_SINGLE : self::UNDERLINE_NONE; + } elseif ($pValue == '') { + $pValue = self::UNDERLINE_NONE; } if ($this->_isSupervisor) { $styleArray = $this->getStyleArray(array('underline' => $pValue)); diff --git a/Classes/PHPExcel/Writer/PDF/mPDF.php b/Classes/PHPExcel/Writer/PDF/mPDF.php index ccd17a22..d874b89f 100644 --- a/Classes/PHPExcel/Writer/PDF/mPDF.php +++ b/Classes/PHPExcel/Writer/PDF/mPDF.php @@ -95,6 +95,8 @@ class PHPExcel_Writer_PDF_mPDF extends PHPExcel_Writer_PDF_Core implements PHPEx $orientation = ($this->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT) ? PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT : $this->getOrientation(); } + $orientation = strtolower($orientation); + // Override Paper Size if (!is_null($this->getPaperSize())) { $printPaperSize = $this->getPaperSize(); @@ -106,7 +108,7 @@ class PHPExcel_Writer_PDF_mPDF extends PHPExcel_Writer_PDF_Core implements PHPEx // Create PDF $pdf = new mpdf(); - $pdf->_setPageSize(strtoupper($paperSize), strtolower($orientation)); + $pdf->_setPageSize(strtoupper($paperSize), $orientation); // Document info $pdf->SetTitle($this->_phpExcel->getProperties()->getTitle());