Minor bugfixes

This commit is contained in:
Mark Baker 2012-10-04 21:48:27 +01:00
parent 4c88a30abd
commit 8900a49d4e
2 changed files with 11 additions and 8 deletions

View File

@ -89,7 +89,7 @@ class PHPExcel_Style_Font implements PHPExcel_IComparable
* *
* @var string * @var string
*/ */
private $_underline = PHPExcel_Style_Font::UNDERLINE_NONE; private $_underline = self::UNDERLINE_NONE;
/** /**
* Strikethrough * Strikethrough
@ -500,15 +500,16 @@ class PHPExcel_Style_Font implements PHPExcel_IComparable
/** /**
* Set Underline * 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 * @return PHPExcel_Style_Font
*/ */
public function setUnderline($pValue = PHPExcel_Style_Font::UNDERLINE_NONE) { public function setUnderline($pValue = self::UNDERLINE_NONE) {
if (is_bool($pValue)) { if (is_bool($pValue)) {
$pValue = ($pValue) ? PHPExcel_Style_Font::UNDERLINE_SINGLE : PHPExcel_Style_Font::UNDERLINE_NONE; $pValue = ($pValue) ? self::UNDERLINE_SINGLE : self::UNDERLINE_NONE;
} } elseif ($pValue == '') {
if ($pValue == '') { $pValue = self::UNDERLINE_NONE;
$pValue = PHPExcel_Style_Font::UNDERLINE_NONE;
} }
if ($this->_isSupervisor) { if ($this->_isSupervisor) {
$styleArray = $this->getStyleArray(array('underline' => $pValue)); $styleArray = $this->getStyleArray(array('underline' => $pValue));

View File

@ -95,6 +95,8 @@ class PHPExcel_Writer_PDF_mPDF extends PHPExcel_Writer_PDF_Core implements PHPEx
$orientation = ($this->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT) ? $orientation = ($this->getOrientation() == PHPExcel_Worksheet_PageSetup::ORIENTATION_DEFAULT) ?
PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT : $this->getOrientation(); PHPExcel_Worksheet_PageSetup::ORIENTATION_PORTRAIT : $this->getOrientation();
} }
$orientation = strtolower($orientation);
// Override Paper Size // Override Paper Size
if (!is_null($this->getPaperSize())) { if (!is_null($this->getPaperSize())) {
$printPaperSize = $this->getPaperSize(); $printPaperSize = $this->getPaperSize();
@ -106,7 +108,7 @@ class PHPExcel_Writer_PDF_mPDF extends PHPExcel_Writer_PDF_Core implements PHPEx
// Create PDF // Create PDF
$pdf = new mpdf(); $pdf = new mpdf();
$pdf->_setPageSize(strtoupper($paperSize), strtolower($orientation)); $pdf->_setPageSize(strtoupper($paperSize), $orientation);
// Document info // Document info
$pdf->SetTitle($this->_phpExcel->getProperties()->getTitle()); $pdf->SetTitle($this->_phpExcel->getProperties()->getTitle());