Feature: Work item 8769 - Implement Gnumeric File Format

Cell border formatting (diagonals)


git-svn-id: https://phpexcel.svn.codeplex.com/svn/trunk@60405 2327b42d-5241-43d6-9e2a-de5ac946f064
This commit is contained in:
Mark Baker 2010-09-05 14:02:26 +00:00
parent 119cd7035a
commit 84c449b74a

View File

@ -595,16 +595,26 @@ class PHPExcel_Reader_Gnumeric implements PHPExcel_Reader_IReader
if (isset($styleRegion->Style->StyleBorder)) { if (isset($styleRegion->Style->StyleBorder)) {
if (isset($styleRegion->Style->StyleBorder->Top)) { if (isset($styleRegion->Style->StyleBorder->Top)) {
$styleArray['borders']['top'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Top->attributes(),'top'); $styleArray['borders']['top'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Top->attributes());
} }
if (isset($styleRegion->Style->StyleBorder->Bottom)) { if (isset($styleRegion->Style->StyleBorder->Bottom)) {
$styleArray['borders']['bottom'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Bottom->attributes(),'bottom'); $styleArray['borders']['bottom'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Bottom->attributes());
} }
if (isset($styleRegion->Style->StyleBorder->Left)) { if (isset($styleRegion->Style->StyleBorder->Left)) {
$styleArray['borders']['left'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Left->attributes(),'left'); $styleArray['borders']['left'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Left->attributes());
} }
if (isset($styleRegion->Style->StyleBorder->Right)) { if (isset($styleRegion->Style->StyleBorder->Right)) {
$styleArray['borders']['right'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Right->attributes(),'right'); $styleArray['borders']['right'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Right->attributes());
}
if ((isset($styleRegion->Style->StyleBorder->Diagonal)) && (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}))) {
$styleArray['borders']['diagonal'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes());
$styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_BOTH;
} elseif (isset($styleRegion->Style->StyleBorder->Diagonal)) {
$styleArray['borders']['diagonal'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes());
$styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_UP;
} elseif (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'})) {
$styleArray['borders']['diagonal'] = self::_parseBorderAttributes($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}->attributes());
$styleArray['borders']['diagonaldirection'] = PHPExcel_Style_Borders::DIAGONAL_DOWN;
} }
} }
} }
@ -707,7 +717,7 @@ class PHPExcel_Reader_Gnumeric implements PHPExcel_Reader_IReader
return $objPHPExcel; return $objPHPExcel;
} }
private static function _parseBorderAttributes($borderAttributes,$border) { private static function _parseBorderAttributes($borderAttributes) {
$styleArray = array(); $styleArray = array();
$RGB = self::_parseGnumericColour($borderAttributes["Color"]); $RGB = self::_parseGnumericColour($borderAttributes["Color"]);