Standardize keys used for styling
Array keys used for styling have been standardized for a more coherent experience. It now uses the same wording and casing as the getter and setter methods. Closes #189
This commit is contained in:
parent
e6c95bf9b0
commit
1c5db4e170
|
@ -1,4 +1,5 @@
|
|||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
|
@ -16,6 +17,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||
|
||||
### Fixed
|
||||
|
||||
### BREAKING CHANGE
|
||||
|
||||
- Standardization of array keys used for style, see the [migration guide](./docs/topics/migration-from-PHPExcel.md).
|
||||
|
||||
## [1.0.0-beta] - 2017-08-17
|
||||
|
||||
|
@ -50,7 +54,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||
- Introduction of namespaces for all classes, eg: `PHPExcel_Calculation_Functions` becomes `PhpOffice\PhpSpreadsheet\Calculation\Functions`
|
||||
- Some classes were renamed for clarity and/or consistency:
|
||||
|
||||
For a comprehensive list of all class changes, and a semi-automated migration path, read the [migration guide](./docs/Migration-from-PHPExcel.md).
|
||||
For a comprehensive list of all class changes, and a semi-automated migration path, read the [migration guide](./docs/topics/migration-from-PHPExcel.md).
|
||||
|
||||
- Dropped `PHPExcel_Calculation_Functions::VERSION()`. Composer or git should be used to know the version.
|
||||
- Dropped `PHPExcel_Settings::setPdfRenderer()` and `PHPExcel_Settings::setPdfRenderer()`. Composer should be used to autoload PDF libs.
|
||||
|
|
|
@ -192,3 +192,74 @@ $cell = $worksheet->setCellValue('A1', 'value', true);
|
|||
// After
|
||||
$cell = $worksheet->getCell('A1')->setValue('value');
|
||||
```
|
||||
|
||||
## Standardized keys for styling
|
||||
|
||||
Array keys used for styling have been standardized for a more coherent experience.
|
||||
It now uses the same wording and casing as the getter and setter:
|
||||
|
||||
```php
|
||||
// Before
|
||||
$style = [
|
||||
'numberformat' => [
|
||||
'code' => NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE,
|
||||
],
|
||||
'font' => [
|
||||
'strike' => true,
|
||||
'superScript' => true,
|
||||
'subScript' => true,
|
||||
],
|
||||
'alignment' => [
|
||||
'rotation' => 90,
|
||||
'readorder' => Alignment::READORDER_RTL,
|
||||
'wrap' => true,
|
||||
],
|
||||
'borders' => [
|
||||
'diagonaldirection' => Borders::DIAGONAL_BOTH,
|
||||
'allborders' => [
|
||||
'style' => Border::BORDER_THIN,
|
||||
],
|
||||
],
|
||||
'fill' => [
|
||||
'type' => Fill::FILL_GRADIENT_LINEAR,
|
||||
'startcolor' => [
|
||||
'argb' => 'FFA0A0A0',
|
||||
],
|
||||
'endcolor' => [
|
||||
'argb' => 'FFFFFFFF',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
// After
|
||||
$style = [
|
||||
'numberFormat' => [
|
||||
'formatCode' => NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE,
|
||||
],
|
||||
'font' => [
|
||||
'strikethrough' => true,
|
||||
'superscript' => true,
|
||||
'subscript' => true,
|
||||
],
|
||||
'alignment' => [
|
||||
'textRotation' => 90,
|
||||
'readOrder' => Alignment::READORDER_RTL,
|
||||
'wrapText' => true,
|
||||
],
|
||||
'borders' => [
|
||||
'diagonalDirection' => Borders::DIAGONAL_BOTH,
|
||||
'allBorders' => [
|
||||
'borderStyle' => Border::BORDER_THIN,
|
||||
],
|
||||
],
|
||||
'fill' => [
|
||||
'fillType' => Fill::FILL_GRADIENT_LINEAR,
|
||||
'startColor' => [
|
||||
'argb' => 'FFA0A0A0',
|
||||
],
|
||||
'endColor' => [
|
||||
'argb' => 'FFFFFFFF',
|
||||
],
|
||||
],
|
||||
];
|
||||
```
|
||||
|
|
|
@ -558,16 +558,16 @@ $styleArray = array(
|
|||
),
|
||||
'borders' => array(
|
||||
'top' => array(
|
||||
'style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN,
|
||||
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THIN,
|
||||
),
|
||||
),
|
||||
'fill' => array(
|
||||
'type' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR,
|
||||
'fillType' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_GRADIENT_LINEAR,
|
||||
'rotation' => 90,
|
||||
'startcolor' => array(
|
||||
'startColor' => array(
|
||||
'argb' => 'FFA0A0A0',
|
||||
),
|
||||
'endcolor' => array(
|
||||
'endColor' => array(
|
||||
'argb' => 'FFFFFFFF',
|
||||
),
|
||||
),
|
||||
|
@ -693,7 +693,7 @@ B2:G8.
|
|||
$styleArray = array(
|
||||
'borders' => array(
|
||||
'outline' => array(
|
||||
'style' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK,
|
||||
'borderStyle' => \PhpOffice\PhpSpreadsheet\Style\Border::BORDER_THICK,
|
||||
'color' => array('argb' => 'FFFF0000'),
|
||||
),
|
||||
),
|
||||
|
@ -721,7 +721,7 @@ operating on a single cell at a time:
|
|||
Additional shortcut borders come in handy like in the example above.
|
||||
These are the shortcut borders available:
|
||||
|
||||
- allborders
|
||||
- allBorders
|
||||
- outline
|
||||
- inside
|
||||
- vertical
|
||||
|
@ -731,10 +731,10 @@ An overview of all border shortcuts can be seen in the following image:
|
|||
|
||||
![08-styling-border-options.png](./images/08-styling-border-options.png)
|
||||
|
||||
If you simultaneously set e.g. allborders and vertical, then we have
|
||||
If you simultaneously set e.g. allBorders and vertical, then we have
|
||||
"overlapping" borders, and one of the components has to win over the
|
||||
other where there is border overlap. In PhpSpreadsheet, from weakest to
|
||||
strongest borders, the list is as follows: allborders, outline/inside,
|
||||
strongest borders, the list is as follows: allBorders, outline/inside,
|
||||
vertical/horizontal, left/right/top/bottom/diagonal.
|
||||
|
||||
This border hierarchy can be utilized to achieve various effects in an
|
||||
|
@ -757,17 +757,17 @@ fill | getFill()
|
|||
font | getFont()
|
||||
borders | getBorders()
|
||||
alignment | getAlignment()
|
||||
numberformat | getNumberFormat()
|
||||
numberFormat | getNumberFormat()
|
||||
protection | getProtection()
|
||||
|
||||
**\PhpOffice\PhpSpreadsheet\Style\Fill**
|
||||
|
||||
Array key | Maps to property
|
||||
-----------|-------------------
|
||||
type | setFillType()
|
||||
fillType | setFillType()
|
||||
rotation | setRotation()
|
||||
startcolor | getStartColor()
|
||||
endcolor | getEndColor()
|
||||
startColor | getStartColor()
|
||||
endColor | getEndColor()
|
||||
color | getStartColor()
|
||||
|
||||
|
||||
|
@ -779,17 +779,17 @@ name | setName()
|
|||
bold | setBold()
|
||||
italic | setItalic()
|
||||
underline | setUnderline()
|
||||
strike | setStrikethrough()
|
||||
strikethrough | setStrikethrough()
|
||||
color | getColor()
|
||||
size | setSize()
|
||||
superScript | setSuperScript()
|
||||
subScript | setSubScript()
|
||||
superscript | setSuperscript()
|
||||
subscript | setSubscript()
|
||||
|
||||
**\PhpOffice\PhpSpreadsheet\Style\Borders**
|
||||
|
||||
Array key | Maps to property
|
||||
------------------|-------------------
|
||||
allborders | getLeft(); getRight(); getTop(); getBottom()
|
||||
allBorders | getLeft(); getRight(); getTop(); getBottom()
|
||||
left | getLeft()
|
||||
right | getRight()
|
||||
top | getTop()
|
||||
|
@ -797,7 +797,7 @@ bottom | getBottom()
|
|||
diagonal | getDiagonal()
|
||||
vertical | getVertical()
|
||||
horizontal | getHorizontal()
|
||||
diagonaldirection | setDiagonalDirection()
|
||||
diagonalDirection | setDiagonalDirection()
|
||||
outline | setOutline()
|
||||
|
||||
**\PhpOffice\PhpSpreadsheet\Style\Border**
|
||||
|
@ -813,8 +813,8 @@ Array key | Maps to property
|
|||
------------|-------------------
|
||||
horizontal | setHorizontal()
|
||||
vertical | setVertical()
|
||||
rotation | setTextRotation()
|
||||
wrap | setWrapText()
|
||||
textRotation| setTextRotation()
|
||||
wrapText | setWrapText()
|
||||
shrinkToFit | setShrinkToFit()
|
||||
indent | setIndent()
|
||||
|
||||
|
@ -822,7 +822,7 @@ indent | setIndent()
|
|||
|
||||
Array key | Maps to property
|
||||
----------|-------------------
|
||||
code | setFormatCode()
|
||||
formatCode | setFormatCode()
|
||||
|
||||
**\PhpOffice\PhpSpreadsheet\Style\Protection**
|
||||
|
||||
|
|
|
@ -26,19 +26,19 @@ $spreadsheet->setActiveSheetIndex(0);
|
|||
|
||||
$spreadsheet->getActiveSheet()->getStyle('A1:T100')->applyFromArray(
|
||||
['fill' => [
|
||||
'type' => Fill::FILL_SOLID,
|
||||
'fillType' => Fill::FILL_SOLID,
|
||||
'color' => ['argb' => 'FFCCFFCC'],
|
||||
],
|
||||
'borders' => [
|
||||
'bottom' => ['style' => Border::BORDER_THIN],
|
||||
'right' => ['style' => Border::BORDER_MEDIUM],
|
||||
'bottom' => ['borderStyle' => Border::BORDER_THIN],
|
||||
'right' => ['borderStyle' => Border::BORDER_MEDIUM],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$spreadsheet->getActiveSheet()->getStyle('C5:R95')->applyFromArray(
|
||||
['fill' => [
|
||||
'type' => Fill::FILL_SOLID,
|
||||
'fillType' => Fill::FILL_SOLID,
|
||||
'color' => ['argb' => 'FFFFFF00'],
|
||||
],
|
||||
]
|
||||
|
|
|
@ -30,24 +30,24 @@ $sharedStyle2 = new Style();
|
|||
|
||||
$sharedStyle1->applyFromArray(
|
||||
['fill' => [
|
||||
'type' => Fill::FILL_SOLID,
|
||||
'fillType' => Fill::FILL_SOLID,
|
||||
'color' => ['argb' => 'FFCCFFCC'],
|
||||
],
|
||||
'borders' => [
|
||||
'bottom' => ['style' => Border::BORDER_THIN],
|
||||
'right' => ['style' => Border::BORDER_MEDIUM],
|
||||
'bottom' => ['borderStyle' => Border::BORDER_THIN],
|
||||
'right' => ['borderStyle' => Border::BORDER_MEDIUM],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$sharedStyle2->applyFromArray(
|
||||
['fill' => [
|
||||
'type' => Fill::FILL_SOLID,
|
||||
'fillType' => Fill::FILL_SOLID,
|
||||
'color' => ['argb' => 'FFFFFF00'],
|
||||
],
|
||||
'borders' => [
|
||||
'bottom' => ['style' => Border::BORDER_THIN],
|
||||
'right' => ['style' => Border::BORDER_MEDIUM],
|
||||
'bottom' => ['borderStyle' => Border::BORDER_THIN],
|
||||
'right' => ['borderStyle' => Border::BORDER_MEDIUM],
|
||||
],
|
||||
]
|
||||
);
|
||||
|
|
|
@ -156,7 +156,7 @@ $helper->log('Set thin black border outline around column');
|
|||
$styleThinBlackBorderOutline = [
|
||||
'borders' => [
|
||||
'outline' => [
|
||||
'style' => Border::BORDER_THIN,
|
||||
'borderStyle' => Border::BORDER_THIN,
|
||||
'color' => ['argb' => 'FF000000'],
|
||||
],
|
||||
],
|
||||
|
@ -168,7 +168,7 @@ $helper->log('Set thick brown border outline around Total');
|
|||
$styleThickBrownBorderOutline = [
|
||||
'borders' => [
|
||||
'outline' => [
|
||||
'style' => Border::BORDER_THICK,
|
||||
'borderStyle' => Border::BORDER_THICK,
|
||||
'color' => ['argb' => 'FF993300'],
|
||||
],
|
||||
],
|
||||
|
@ -192,16 +192,16 @@ $spreadsheet->getActiveSheet()->getStyle('A3:E3')->applyFromArray(
|
|||
],
|
||||
'borders' => [
|
||||
'top' => [
|
||||
'style' => Border::BORDER_THIN,
|
||||
'borderStyle' => Border::BORDER_THIN,
|
||||
],
|
||||
],
|
||||
'fill' => [
|
||||
'type' => Fill::FILL_GRADIENT_LINEAR,
|
||||
'fillType' => Fill::FILL_GRADIENT_LINEAR,
|
||||
'rotation' => 90,
|
||||
'startcolor' => [
|
||||
'startColor' => [
|
||||
'argb' => 'FFA0A0A0',
|
||||
],
|
||||
'endcolor' => [
|
||||
'endColor' => [
|
||||
'argb' => 'FFFFFFFF',
|
||||
],
|
||||
],
|
||||
|
@ -215,7 +215,7 @@ $spreadsheet->getActiveSheet()->getStyle('A3')->applyFromArray(
|
|||
],
|
||||
'borders' => [
|
||||
'left' => [
|
||||
'style' => Border::BORDER_THIN,
|
||||
'borderStyle' => Border::BORDER_THIN,
|
||||
],
|
||||
],
|
||||
]
|
||||
|
@ -233,7 +233,7 @@ $spreadsheet->getActiveSheet()->getStyle('E3')->applyFromArray(
|
|||
[
|
||||
'borders' => [
|
||||
'right' => [
|
||||
'style' => Border::BORDER_THIN,
|
||||
'borderStyle' => Border::BORDER_THIN,
|
||||
],
|
||||
],
|
||||
]
|
||||
|
|
|
@ -678,10 +678,10 @@ class Html
|
|||
$richtextRun->getFont()->setUnderline(Font::UNDERLINE_SINGLE);
|
||||
}
|
||||
if ($this->superscript) {
|
||||
$richtextRun->getFont()->setSuperScript(true);
|
||||
$richtextRun->getFont()->setSuperscript(true);
|
||||
}
|
||||
if ($this->subscript) {
|
||||
$richtextRun->getFont()->setSubScript(true);
|
||||
$richtextRun->getFont()->setSubscript(true);
|
||||
}
|
||||
if ($this->strikethrough) {
|
||||
$richtextRun->getFont()->setStrikethrough(true);
|
||||
|
|
|
@ -486,7 +486,7 @@ class Gnumeric extends BaseReader implements IReader
|
|||
if ((!$this->readDataOnly) ||
|
||||
(Date::isDateTimeFormatCode((string) $styleAttributes['Format']))) {
|
||||
$styleArray = [];
|
||||
$styleArray['numberformat']['code'] = (string) $styleAttributes['Format'];
|
||||
$styleArray['numberFormat']['formatCode'] = (string) $styleAttributes['Format'];
|
||||
// If readDataOnly is false, we set all formatting information
|
||||
if (!$this->readDataOnly) {
|
||||
switch ($styleAttributes['HAlign']) {
|
||||
|
@ -526,7 +526,7 @@ class Gnumeric extends BaseReader implements IReader
|
|||
break;
|
||||
}
|
||||
|
||||
$styleArray['alignment']['wrap'] = ($styleAttributes['WrapText'] == '1') ? true : false;
|
||||
$styleArray['alignment']['wrapText'] = ($styleAttributes['WrapText'] == '1') ? true : false;
|
||||
$styleArray['alignment']['shrinkToFit'] = ($styleAttributes['ShrinkToFit'] == '1') ? true : false;
|
||||
$styleArray['alignment']['indent'] = ((int) ($styleAttributes['Indent']) > 0) ? $styleAttributes['indent'] : 0;
|
||||
|
||||
|
@ -535,69 +535,69 @@ class Gnumeric extends BaseReader implements IReader
|
|||
$RGB = self::parseGnumericColour($styleAttributes['Back']);
|
||||
$shade = $styleAttributes['Shade'];
|
||||
if (($RGB != '000000') || ($shade != '0')) {
|
||||
$styleArray['fill']['color']['rgb'] = $styleArray['fill']['startcolor']['rgb'] = $RGB;
|
||||
$styleArray['fill']['color']['rgb'] = $styleArray['fill']['startColor']['rgb'] = $RGB;
|
||||
$RGB2 = self::parseGnumericColour($styleAttributes['PatternColor']);
|
||||
$styleArray['fill']['endcolor']['rgb'] = $RGB2;
|
||||
$styleArray['fill']['endColor']['rgb'] = $RGB2;
|
||||
switch ($shade) {
|
||||
case '1':
|
||||
$styleArray['fill']['type'] = Fill::FILL_SOLID;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_SOLID;
|
||||
break;
|
||||
case '2':
|
||||
$styleArray['fill']['type'] = Fill::FILL_GRADIENT_LINEAR;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_GRADIENT_LINEAR;
|
||||
break;
|
||||
case '3':
|
||||
$styleArray['fill']['type'] = Fill::FILL_GRADIENT_PATH;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_GRADIENT_PATH;
|
||||
break;
|
||||
case '4':
|
||||
$styleArray['fill']['type'] = Fill::FILL_PATTERN_DARKDOWN;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_PATTERN_DARKDOWN;
|
||||
break;
|
||||
case '5':
|
||||
$styleArray['fill']['type'] = Fill::FILL_PATTERN_DARKGRAY;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_PATTERN_DARKGRAY;
|
||||
break;
|
||||
case '6':
|
||||
$styleArray['fill']['type'] = Fill::FILL_PATTERN_DARKGRID;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_PATTERN_DARKGRID;
|
||||
break;
|
||||
case '7':
|
||||
$styleArray['fill']['type'] = Fill::FILL_PATTERN_DARKHORIZONTAL;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_PATTERN_DARKHORIZONTAL;
|
||||
break;
|
||||
case '8':
|
||||
$styleArray['fill']['type'] = Fill::FILL_PATTERN_DARKTRELLIS;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_PATTERN_DARKTRELLIS;
|
||||
break;
|
||||
case '9':
|
||||
$styleArray['fill']['type'] = Fill::FILL_PATTERN_DARKUP;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_PATTERN_DARKUP;
|
||||
break;
|
||||
case '10':
|
||||
$styleArray['fill']['type'] = Fill::FILL_PATTERN_DARKVERTICAL;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_PATTERN_DARKVERTICAL;
|
||||
break;
|
||||
case '11':
|
||||
$styleArray['fill']['type'] = Fill::FILL_PATTERN_GRAY0625;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_PATTERN_GRAY0625;
|
||||
break;
|
||||
case '12':
|
||||
$styleArray['fill']['type'] = Fill::FILL_PATTERN_GRAY125;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_PATTERN_GRAY125;
|
||||
break;
|
||||
case '13':
|
||||
$styleArray['fill']['type'] = Fill::FILL_PATTERN_LIGHTDOWN;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_PATTERN_LIGHTDOWN;
|
||||
break;
|
||||
case '14':
|
||||
$styleArray['fill']['type'] = Fill::FILL_PATTERN_LIGHTGRAY;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_PATTERN_LIGHTGRAY;
|
||||
break;
|
||||
case '15':
|
||||
$styleArray['fill']['type'] = Fill::FILL_PATTERN_LIGHTGRID;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_PATTERN_LIGHTGRID;
|
||||
break;
|
||||
case '16':
|
||||
$styleArray['fill']['type'] = Fill::FILL_PATTERN_LIGHTHORIZONTAL;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_PATTERN_LIGHTHORIZONTAL;
|
||||
break;
|
||||
case '17':
|
||||
$styleArray['fill']['type'] = Fill::FILL_PATTERN_LIGHTTRELLIS;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_PATTERN_LIGHTTRELLIS;
|
||||
break;
|
||||
case '18':
|
||||
$styleArray['fill']['type'] = Fill::FILL_PATTERN_LIGHTUP;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_PATTERN_LIGHTUP;
|
||||
break;
|
||||
case '19':
|
||||
$styleArray['fill']['type'] = Fill::FILL_PATTERN_LIGHTVERTICAL;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_PATTERN_LIGHTVERTICAL;
|
||||
break;
|
||||
case '20':
|
||||
$styleArray['fill']['type'] = Fill::FILL_PATTERN_MEDIUMGRAY;
|
||||
$styleArray['fill']['fillType'] = Fill::FILL_PATTERN_MEDIUMGRAY;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -607,7 +607,7 @@ class Gnumeric extends BaseReader implements IReader
|
|||
$styleArray['font']['size'] = (int) ($fontAttributes['Unit']);
|
||||
$styleArray['font']['bold'] = ($fontAttributes['Bold'] == '1') ? true : false;
|
||||
$styleArray['font']['italic'] = ($fontAttributes['Italic'] == '1') ? true : false;
|
||||
$styleArray['font']['strike'] = ($fontAttributes['StrikeThrough'] == '1') ? true : false;
|
||||
$styleArray['font']['strikethrough'] = ($fontAttributes['StrikeThrough'] == '1') ? true : false;
|
||||
switch ($fontAttributes['Underline']) {
|
||||
case '1':
|
||||
$styleArray['font']['underline'] = Font::UNDERLINE_SINGLE;
|
||||
|
@ -627,10 +627,10 @@ class Gnumeric extends BaseReader implements IReader
|
|||
}
|
||||
switch ($fontAttributes['Script']) {
|
||||
case '1':
|
||||
$styleArray['font']['superScript'] = true;
|
||||
$styleArray['font']['superscript'] = true;
|
||||
break;
|
||||
case '-1':
|
||||
$styleArray['font']['subScript'] = true;
|
||||
$styleArray['font']['subscript'] = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -649,13 +649,13 @@ class Gnumeric extends BaseReader implements IReader
|
|||
}
|
||||
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'] = Borders::DIAGONAL_BOTH;
|
||||
$styleArray['borders']['diagonalDirection'] = Borders::DIAGONAL_BOTH;
|
||||
} elseif (isset($styleRegion->Style->StyleBorder->Diagonal)) {
|
||||
$styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->Diagonal->attributes());
|
||||
$styleArray['borders']['diagonaldirection'] = Borders::DIAGONAL_UP;
|
||||
$styleArray['borders']['diagonalDirection'] = Borders::DIAGONAL_UP;
|
||||
} elseif (isset($styleRegion->Style->StyleBorder->{'Rev-Diagonal'})) {
|
||||
$styleArray['borders']['diagonal'] = self::parseBorderAttributes($styleRegion->Style->StyleBorder->{'Rev-Diagonal'}->attributes());
|
||||
$styleArray['borders']['diagonaldirection'] = Borders::DIAGONAL_DOWN;
|
||||
$styleArray['borders']['diagonalDirection'] = Borders::DIAGONAL_DOWN;
|
||||
}
|
||||
}
|
||||
if (isset($styleRegion->Style->HyperLink)) {
|
||||
|
@ -770,46 +770,46 @@ class Gnumeric extends BaseReader implements IReader
|
|||
|
||||
switch ($borderAttributes['Style']) {
|
||||
case '0':
|
||||
$styleArray['style'] = Border::BORDER_NONE;
|
||||
$styleArray['borderStyle'] = Border::BORDER_NONE;
|
||||
break;
|
||||
case '1':
|
||||
$styleArray['style'] = Border::BORDER_THIN;
|
||||
$styleArray['borderStyle'] = Border::BORDER_THIN;
|
||||
break;
|
||||
case '2':
|
||||
$styleArray['style'] = Border::BORDER_MEDIUM;
|
||||
$styleArray['borderStyle'] = Border::BORDER_MEDIUM;
|
||||
break;
|
||||
case '3':
|
||||
$styleArray['style'] = Border::BORDER_SLANTDASHDOT;
|
||||
$styleArray['borderStyle'] = Border::BORDER_SLANTDASHDOT;
|
||||
break;
|
||||
case '4':
|
||||
$styleArray['style'] = Border::BORDER_DASHED;
|
||||
$styleArray['borderStyle'] = Border::BORDER_DASHED;
|
||||
break;
|
||||
case '5':
|
||||
$styleArray['style'] = Border::BORDER_THICK;
|
||||
$styleArray['borderStyle'] = Border::BORDER_THICK;
|
||||
break;
|
||||
case '6':
|
||||
$styleArray['style'] = Border::BORDER_DOUBLE;
|
||||
$styleArray['borderStyle'] = Border::BORDER_DOUBLE;
|
||||
break;
|
||||
case '7':
|
||||
$styleArray['style'] = Border::BORDER_DOTTED;
|
||||
$styleArray['borderStyle'] = Border::BORDER_DOTTED;
|
||||
break;
|
||||
case '8':
|
||||
$styleArray['style'] = Border::BORDER_MEDIUMDASHED;
|
||||
$styleArray['borderStyle'] = Border::BORDER_MEDIUMDASHED;
|
||||
break;
|
||||
case '9':
|
||||
$styleArray['style'] = Border::BORDER_DASHDOT;
|
||||
$styleArray['borderStyle'] = Border::BORDER_DASHDOT;
|
||||
break;
|
||||
case '10':
|
||||
$styleArray['style'] = Border::BORDER_MEDIUMDASHDOT;
|
||||
$styleArray['borderStyle'] = Border::BORDER_MEDIUMDASHDOT;
|
||||
break;
|
||||
case '11':
|
||||
$styleArray['style'] = Border::BORDER_DASHDOTDOT;
|
||||
$styleArray['borderStyle'] = Border::BORDER_DASHDOTDOT;
|
||||
break;
|
||||
case '12':
|
||||
$styleArray['style'] = Border::BORDER_MEDIUMDASHDOTDOT;
|
||||
$styleArray['borderStyle'] = Border::BORDER_MEDIUMDASHDOTDOT;
|
||||
break;
|
||||
case '13':
|
||||
$styleArray['style'] = Border::BORDER_MEDIUMDASHDOTDOT;
|
||||
$styleArray['borderStyle'] = Border::BORDER_MEDIUMDASHDOTDOT;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -110,7 +110,7 @@ class Html extends BaseReader implements IReader
|
|||
'hr' => [
|
||||
'borders' => [
|
||||
'bottom' => [
|
||||
'style' => Border::BORDER_THIN,
|
||||
'borderStyle' => Border::BORDER_THIN,
|
||||
'color' => [
|
||||
Color::COLOR_BLACK,
|
||||
],
|
||||
|
@ -482,7 +482,7 @@ class Html extends BaseReader implements IReader
|
|||
$sheet->getStyle($column . $row)->applyFromArray(
|
||||
[
|
||||
'fill' => [
|
||||
'type' => Fill::FILL_SOLID,
|
||||
'fillType' => Fill::FILL_SOLID,
|
||||
'color' => ['rgb' => $attributeArray['bgcolor']],
|
||||
],
|
||||
]
|
||||
|
@ -631,7 +631,7 @@ class Html extends BaseReader implements IReader
|
|||
|
||||
switch (trim($value[0])) {
|
||||
case 'background-color':
|
||||
$sheet->getStyle($column . $row)->applyFromArray(['fill' => ['type' => Fill::FILL_SOLID, 'color' => ['rgb' => "{$style_color}"]]]);
|
||||
$sheet->getStyle($column . $row)->applyFromArray(['fill' => ['fillType' => Fill::FILL_SOLID, 'color' => ['rgb' => "{$style_color}"]]]);
|
||||
break;
|
||||
case 'color':
|
||||
$sheet->getStyle($column . $row)->applyFromArray(['font' => ['color' => ['rgb' => "$style_color}"]]]);
|
||||
|
|
|
@ -260,7 +260,7 @@ class Slk extends BaseReader implements IReader
|
|||
foreach ($rowData as $rowDatum) {
|
||||
switch ($rowDatum[0]) {
|
||||
case 'P':
|
||||
$formatArray['numberformat']['code'] = str_replace($fromFormats, $toFormats, substr($rowDatum, 1));
|
||||
$formatArray['numberFormat']['formatCode'] = str_replace($fromFormats, $toFormats, substr($rowDatum, 1));
|
||||
break;
|
||||
case 'E':
|
||||
case 'F':
|
||||
|
@ -280,16 +280,16 @@ class Slk extends BaseReader implements IReader
|
|||
$formatArray['font']['bold'] = true;
|
||||
break;
|
||||
case 'T':
|
||||
$formatArray['borders']['top']['style'] = Border::BORDER_THIN;
|
||||
$formatArray['borders']['top']['borderStyle'] = Border::BORDER_THIN;
|
||||
break;
|
||||
case 'B':
|
||||
$formatArray['borders']['bottom']['style'] = Border::BORDER_THIN;
|
||||
$formatArray['borders']['bottom']['borderStyle'] = Border::BORDER_THIN;
|
||||
break;
|
||||
case 'L':
|
||||
$formatArray['borders']['left']['style'] = Border::BORDER_THIN;
|
||||
$formatArray['borders']['left']['borderStyle'] = Border::BORDER_THIN;
|
||||
break;
|
||||
case 'R':
|
||||
$formatArray['borders']['right']['style'] = Border::BORDER_THIN;
|
||||
$formatArray['borders']['right']['borderStyle'] = Border::BORDER_THIN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -401,16 +401,16 @@ class Slk extends BaseReader implements IReader
|
|||
$styleData['font']['bold'] = true;
|
||||
break;
|
||||
case 'T':
|
||||
$styleData['borders']['top']['style'] = Border::BORDER_THIN;
|
||||
$styleData['borders']['top']['borderStyle'] = Border::BORDER_THIN;
|
||||
break;
|
||||
case 'B':
|
||||
$styleData['borders']['bottom']['style'] = Border::BORDER_THIN;
|
||||
$styleData['borders']['bottom']['borderStyle'] = Border::BORDER_THIN;
|
||||
break;
|
||||
case 'L':
|
||||
$styleData['borders']['left']['style'] = Border::BORDER_THIN;
|
||||
$styleData['borders']['left']['borderStyle'] = Border::BORDER_THIN;
|
||||
break;
|
||||
case 'R':
|
||||
$styleData['borders']['right']['style'] = Border::BORDER_THIN;
|
||||
$styleData['borders']['right']['borderStyle'] = Border::BORDER_THIN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1942,7 +1942,7 @@ class Xls extends BaseReader implements IReader
|
|||
}
|
||||
|
||||
// bit: 2; mask 0x0004; underlined (redundant in BIFF5-BIFF8)
|
||||
// bit: 3; mask 0x0008; strike
|
||||
// bit: 3; mask 0x0008; strikethrough
|
||||
$isStrike = (0x0008 & self::getInt2d($recordData, 2)) >> 3;
|
||||
if ($isStrike) {
|
||||
$objFont->setStrikethrough(true);
|
||||
|
@ -1964,10 +1964,10 @@ class Xls extends BaseReader implements IReader
|
|||
$escapement = self::getInt2d($recordData, 8);
|
||||
switch ($escapement) {
|
||||
case 0x0001:
|
||||
$objFont->setSuperScript(true);
|
||||
$objFont->setSuperscript(true);
|
||||
break;
|
||||
case 0x0002:
|
||||
$objFont->setSubScript(true);
|
||||
$objFont->setSubscript(true);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2081,15 +2081,15 @@ class Xls extends BaseReader implements IReader
|
|||
$numberFormatIndex = self::getInt2d($recordData, 2);
|
||||
if (isset($this->formats[$numberFormatIndex])) {
|
||||
// then we have user-defined format code
|
||||
$numberformat = ['code' => $this->formats[$numberFormatIndex]];
|
||||
$numberFormat = ['formatCode' => $this->formats[$numberFormatIndex]];
|
||||
} elseif (($code = NumberFormat::builtInFormatCode($numberFormatIndex)) !== '') {
|
||||
// then we have built-in format code
|
||||
$numberformat = ['code' => $code];
|
||||
$numberFormat = ['formatCode' => $code];
|
||||
} else {
|
||||
// we set the general format code
|
||||
$numberformat = ['code' => 'General'];
|
||||
$numberFormat = ['formatCode' => 'General'];
|
||||
}
|
||||
$objStyle->getNumberFormat()->setFormatCode($numberformat['code']);
|
||||
$objStyle->getNumberFormat()->setFormatCode($numberFormat['formatCode']);
|
||||
|
||||
// offset: 4; size: 2; XF type, cell protection, and parent style XF
|
||||
// bit 2-0; mask 0x0007; XF_TYPE_PROT
|
||||
|
|
|
@ -1918,10 +1918,10 @@ class Xlsx extends BaseReader implements IReader
|
|||
if (isset($style->font->vertAlign) && isset($style->font->vertAlign['val'])) {
|
||||
$vertAlign = strtolower((string) $style->font->vertAlign['val']);
|
||||
if ($vertAlign == 'superscript') {
|
||||
$docStyle->getFont()->setSuperScript(true);
|
||||
$docStyle->getFont()->setSuperscript(true);
|
||||
}
|
||||
if ($vertAlign == 'subscript') {
|
||||
$docStyle->getFont()->setSubScript(true);
|
||||
$docStyle->getFont()->setSubscript(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1988,7 +1988,7 @@ class Xlsx extends BaseReader implements IReader
|
|||
$docStyle->getAlignment()->setWrapText(self::boolean((string) $style->alignment['wrapText']));
|
||||
$docStyle->getAlignment()->setShrinkToFit(self::boolean((string) $style->alignment['shrinkToFit']));
|
||||
$docStyle->getAlignment()->setIndent((int) ((string) $style->alignment['indent']) > 0 ? (int) ((string) $style->alignment['indent']) : 0);
|
||||
$docStyle->getAlignment()->setReadorder((int) ((string) $style->alignment['readingOrder']) > 0 ? (int) ((string) $style->alignment['readingOrder']) : 0);
|
||||
$docStyle->getAlignment()->setReadOrder((int) ((string) $style->alignment['readingOrder']) > 0 ? (int) ((string) $style->alignment['readingOrder']) : 0);
|
||||
}
|
||||
|
||||
// protection
|
||||
|
@ -2069,10 +2069,10 @@ class Xlsx extends BaseReader implements IReader
|
|||
if (isset($run->rPr->vertAlign) && isset($run->rPr->vertAlign['val'])) {
|
||||
$vertAlign = strtolower((string) $run->rPr->vertAlign['val']);
|
||||
if ($vertAlign == 'superscript') {
|
||||
$objText->getFont()->setSuperScript(true);
|
||||
$objText->getFont()->setSuperscript(true);
|
||||
}
|
||||
if ($vertAlign == 'subscript') {
|
||||
$objText->getFont()->setSubScript(true);
|
||||
$objText->getFont()->setSubscript(true);
|
||||
}
|
||||
}
|
||||
if (isset($run->rPr->u) && !isset($run->rPr->u['val'])) {
|
||||
|
|
|
@ -445,9 +445,9 @@ class Chart
|
|||
$baseline = self::getAttribute($titleDetailElement->rPr, 'baseline', 'integer');
|
||||
if (!is_null($baseline)) {
|
||||
if ($baseline > 0) {
|
||||
$objText->getFont()->setSuperScript(true);
|
||||
$objText->getFont()->setSuperscript(true);
|
||||
} elseif ($baseline < 0) {
|
||||
$objText->getFont()->setSubScript(true);
|
||||
$objText->getFont()->setSubscript(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -441,7 +441,7 @@ class Xml extends BaseReader implements IReader
|
|||
}
|
||||
break;
|
||||
case 'WrapText':
|
||||
$this->styles[$styleID]['alignment']['wrap'] = true;
|
||||
$this->styles[$styleID]['alignment']['wrapText'] = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -453,7 +453,7 @@ class Xml extends BaseReader implements IReader
|
|||
foreach ($borderAttributes as $borderStyleKey => $borderStyleValue) {
|
||||
switch ($borderStyleKey) {
|
||||
case 'LineStyle':
|
||||
$thisBorder['style'] = Border::BORDER_MEDIUM;
|
||||
$thisBorder['borderStyle'] = Border::BORDER_MEDIUM;
|
||||
break;
|
||||
case 'Weight':
|
||||
break;
|
||||
|
@ -507,7 +507,7 @@ class Xml extends BaseReader implements IReader
|
|||
$this->styles[$styleID]['fill']['color']['rgb'] = substr($styleAttributeValue, 1);
|
||||
break;
|
||||
case 'Pattern':
|
||||
$this->styles[$styleID]['fill']['type'] = strtolower($styleAttributeValue);
|
||||
$this->styles[$styleID]['fill']['fillType'] = strtolower($styleAttributeValue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -521,7 +521,7 @@ class Xml extends BaseReader implements IReader
|
|||
break;
|
||||
}
|
||||
if ($styleAttributeValue > '') {
|
||||
$this->styles[$styleID]['numberformat']['code'] = $styleAttributeValue;
|
||||
$this->styles[$styleID]['numberFormat']['formatCode'] = $styleAttributeValue;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -177,20 +177,20 @@ class Style extends Style\Supervisor implements IComparable
|
|||
* 'bold' => true,
|
||||
* 'italic' => false,
|
||||
* 'underline' => \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE,
|
||||
* 'strike' => false,
|
||||
* 'strikethrough' => false,
|
||||
* 'color' => array(
|
||||
* 'rgb' => '808080'
|
||||
* )
|
||||
* ),
|
||||
* 'borders' => array(
|
||||
* 'bottom' => array(
|
||||
* 'style' => Border::BORDER_DASHDOT,
|
||||
* 'borderStyle' => Border::BORDER_DASHDOT,
|
||||
* 'color' => array(
|
||||
* 'rgb' => '808080'
|
||||
* )
|
||||
* ),
|
||||
* 'top' => array(
|
||||
* 'style' => Border::BORDER_DASHDOT,
|
||||
* 'borderStyle' => Border::BORDER_DASHDOT,
|
||||
* 'color' => array(
|
||||
* 'rgb' => '808080'
|
||||
* )
|
||||
|
@ -241,15 +241,15 @@ class Style extends Style\Supervisor implements IComparable
|
|||
|
||||
// ADVANCED MODE:
|
||||
if ($pAdvanced && isset($pStyles['borders'])) {
|
||||
// 'allborders' is a shorthand property for 'outline' and 'inside' and
|
||||
// 'allBorders' is a shorthand property for 'outline' and 'inside' and
|
||||
// it applies to components that have not been set explicitly
|
||||
if (isset($pStyles['borders']['allborders'])) {
|
||||
if (isset($pStyles['borders']['allBorders'])) {
|
||||
foreach (['outline', 'inside'] as $component) {
|
||||
if (!isset($pStyles['borders'][$component])) {
|
||||
$pStyles['borders'][$component] = $pStyles['borders']['allborders'];
|
||||
$pStyles['borders'][$component] = $pStyles['borders']['allBorders'];
|
||||
}
|
||||
}
|
||||
unset($pStyles['borders']['allborders']); // not needed any more
|
||||
unset($pStyles['borders']['allBorders']); // not needed any more
|
||||
}
|
||||
// 'outline' is a shorthand property for 'top', 'right', 'bottom', 'left'
|
||||
// it applies to components that have not been set explicitly
|
||||
|
@ -452,8 +452,8 @@ class Style extends Style\Supervisor implements IComparable
|
|||
if (isset($pStyles['alignment'])) {
|
||||
$this->getAlignment()->applyFromArray($pStyles['alignment']);
|
||||
}
|
||||
if (isset($pStyles['numberformat'])) {
|
||||
$this->getNumberFormat()->applyFromArray($pStyles['numberformat']);
|
||||
if (isset($pStyles['numberFormat'])) {
|
||||
$this->getNumberFormat()->applyFromArray($pStyles['numberFormat']);
|
||||
}
|
||||
if (isset($pStyles['protection'])) {
|
||||
$this->getProtection()->applyFromArray($pStyles['protection']);
|
||||
|
|
|
@ -98,7 +98,7 @@ class Alignment extends Supervisor implements IComparable
|
|||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $readorder = 0;
|
||||
protected $readOrder = 0;
|
||||
|
||||
/**
|
||||
* Create a new Alignment.
|
||||
|
@ -152,8 +152,8 @@ class Alignment extends Supervisor implements IComparable
|
|||
* array(
|
||||
* 'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_CENTER,
|
||||
* 'vertical' => \PhpOffice\PhpSpreadsheet\Style\Alignment::VERTICAL_CENTER,
|
||||
* 'rotation' => 0,
|
||||
* 'wrap' => TRUE
|
||||
* 'textRotation' => 0,
|
||||
* 'wrapText' => TRUE
|
||||
* )
|
||||
* );
|
||||
* </code>.
|
||||
|
@ -176,11 +176,11 @@ class Alignment extends Supervisor implements IComparable
|
|||
if (isset($pStyles['vertical'])) {
|
||||
$this->setVertical($pStyles['vertical']);
|
||||
}
|
||||
if (isset($pStyles['rotation'])) {
|
||||
$this->setTextRotation($pStyles['rotation']);
|
||||
if (isset($pStyles['textRotation'])) {
|
||||
$this->setTextRotation($pStyles['textRotation']);
|
||||
}
|
||||
if (isset($pStyles['wrap'])) {
|
||||
$this->setWrapText($pStyles['wrap']);
|
||||
if (isset($pStyles['wrapText'])) {
|
||||
$this->setWrapText($pStyles['wrapText']);
|
||||
}
|
||||
if (isset($pStyles['shrinkToFit'])) {
|
||||
$this->setShrinkToFit($pStyles['shrinkToFit']);
|
||||
|
@ -188,8 +188,8 @@ class Alignment extends Supervisor implements IComparable
|
|||
if (isset($pStyles['indent'])) {
|
||||
$this->setIndent($pStyles['indent']);
|
||||
}
|
||||
if (isset($pStyles['readorder'])) {
|
||||
$this->setReadorder($pStyles['readorder']);
|
||||
if (isset($pStyles['readOrder'])) {
|
||||
$this->setReadOrder($pStyles['readOrder']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -303,7 +303,7 @@ class Alignment extends Supervisor implements IComparable
|
|||
// Set rotation
|
||||
if (($pValue >= -90 && $pValue <= 90) || $pValue == -165) {
|
||||
if ($this->isSupervisor) {
|
||||
$styleArray = $this->getStyleArray(['rotation' => $pValue]);
|
||||
$styleArray = $this->getStyleArray(['textRotation' => $pValue]);
|
||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
|
||||
} else {
|
||||
$this->textRotation = $pValue;
|
||||
|
@ -342,7 +342,7 @@ class Alignment extends Supervisor implements IComparable
|
|||
$pValue = false;
|
||||
}
|
||||
if ($this->isSupervisor) {
|
||||
$styleArray = $this->getStyleArray(['wrap' => $pValue]);
|
||||
$styleArray = $this->getStyleArray(['wrapText' => $pValue]);
|
||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
|
||||
} else {
|
||||
$this->wrapText = $pValue;
|
||||
|
@ -432,13 +432,13 @@ class Alignment extends Supervisor implements IComparable
|
|||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getReadorder()
|
||||
public function getReadOrder()
|
||||
{
|
||||
if ($this->isSupervisor) {
|
||||
return $this->getSharedComponent()->getReadorder();
|
||||
return $this->getSharedComponent()->getReadOrder();
|
||||
}
|
||||
|
||||
return $this->readorder;
|
||||
return $this->readOrder;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -448,16 +448,16 @@ class Alignment extends Supervisor implements IComparable
|
|||
*
|
||||
* @return Alignment
|
||||
*/
|
||||
public function setReadorder($pValue)
|
||||
public function setReadOrder($pValue)
|
||||
{
|
||||
if ($pValue < 0 || $pValue > 2) {
|
||||
$pValue = 0;
|
||||
}
|
||||
if ($this->isSupervisor) {
|
||||
$styleArray = $this->getStyleArray(['readorder' => $pValue]);
|
||||
$styleArray = $this->getStyleArray(['readOrder' => $pValue]);
|
||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
|
||||
} else {
|
||||
$this->readorder = $pValue;
|
||||
$this->readOrder = $pValue;
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
@ -481,7 +481,7 @@ class Alignment extends Supervisor implements IComparable
|
|||
($this->wrapText ? 't' : 'f') .
|
||||
($this->shrinkToFit ? 't' : 'f') .
|
||||
$this->indent .
|
||||
$this->readorder .
|
||||
$this->readOrder .
|
||||
__CLASS__
|
||||
);
|
||||
}
|
||||
|
|
|
@ -146,22 +146,7 @@ class Border extends Supervisor implements IComparable
|
|||
*/
|
||||
public function getStyleArray($array)
|
||||
{
|
||||
switch ($this->parentPropertyName) {
|
||||
case 'allborders':
|
||||
case 'bottom':
|
||||
case 'diagonal':
|
||||
case 'horizontal':
|
||||
case 'inside':
|
||||
case 'left':
|
||||
case 'outline':
|
||||
case 'right':
|
||||
case 'top':
|
||||
case 'vertical':
|
||||
$key = strtolower($this->parentPropertyName);
|
||||
break;
|
||||
}
|
||||
|
||||
return $this->parent->getStyleArray([$key => $array]);
|
||||
return $this->parent->getStyleArray([$this->parentPropertyName => $array]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -170,7 +155,7 @@ class Border extends Supervisor implements IComparable
|
|||
* <code>
|
||||
* $spreadsheet->getActiveSheet()->getStyle('B2')->getBorders()->getTop()->applyFromArray(
|
||||
* array(
|
||||
* 'style' => Border::BORDER_DASHDOT,
|
||||
* 'borderStyle' => Border::BORDER_DASHDOT,
|
||||
* 'color' => array(
|
||||
* 'rgb' => '808080'
|
||||
* )
|
||||
|
@ -189,8 +174,8 @@ class Border extends Supervisor implements IComparable
|
|||
if ($this->isSupervisor) {
|
||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
|
||||
} else {
|
||||
if (isset($pStyles['style'])) {
|
||||
$this->setBorderStyle($pStyles['style']);
|
||||
if (isset($pStyles['borderStyle'])) {
|
||||
$this->setBorderStyle($pStyles['borderStyle']);
|
||||
}
|
||||
if (isset($pStyles['color'])) {
|
||||
$this->getColor()->applyFromArray($pStyles['color']);
|
||||
|
@ -231,7 +216,7 @@ class Border extends Supervisor implements IComparable
|
|||
$pValue = self::BORDER_MEDIUM;
|
||||
}
|
||||
if ($this->isSupervisor) {
|
||||
$styleArray = $this->getStyleArray(['style' => $pValue]);
|
||||
$styleArray = $this->getStyleArray(['borderStyle' => $pValue]);
|
||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
|
||||
} else {
|
||||
$this->borderStyle = $pValue;
|
||||
|
|
|
@ -187,13 +187,13 @@ class Borders extends Supervisor implements IComparable
|
|||
* $spreadsheet->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray(
|
||||
* array(
|
||||
* 'bottom' => array(
|
||||
* 'style' => Border::BORDER_DASHDOT,
|
||||
* 'borderStyle' => Border::BORDER_DASHDOT,
|
||||
* 'color' => array(
|
||||
* 'rgb' => '808080'
|
||||
* )
|
||||
* ),
|
||||
* 'top' => array(
|
||||
* 'style' => Border::BORDER_DASHDOT,
|
||||
* 'borderStyle' => Border::BORDER_DASHDOT,
|
||||
* 'color' => array(
|
||||
* 'rgb' => '808080'
|
||||
* )
|
||||
|
@ -204,8 +204,8 @@ class Borders extends Supervisor implements IComparable
|
|||
* <code>
|
||||
* $spreadsheet->getActiveSheet()->getStyle('B2')->getBorders()->applyFromArray(
|
||||
* array(
|
||||
* 'allborders' => array(
|
||||
* 'style' => Border::BORDER_DASHDOT,
|
||||
* 'allBorders' => array(
|
||||
* 'borderStyle' => Border::BORDER_DASHDOT,
|
||||
* 'color' => array(
|
||||
* 'rgb' => '808080'
|
||||
* )
|
||||
|
@ -240,14 +240,14 @@ class Borders extends Supervisor implements IComparable
|
|||
if (isset($pStyles['diagonal'])) {
|
||||
$this->getDiagonal()->applyFromArray($pStyles['diagonal']);
|
||||
}
|
||||
if (isset($pStyles['diagonaldirection'])) {
|
||||
$this->setDiagonalDirection($pStyles['diagonaldirection']);
|
||||
if (isset($pStyles['diagonalDirection'])) {
|
||||
$this->setDiagonalDirection($pStyles['diagonalDirection']);
|
||||
}
|
||||
if (isset($pStyles['allborders'])) {
|
||||
$this->getLeft()->applyFromArray($pStyles['allborders']);
|
||||
$this->getRight()->applyFromArray($pStyles['allborders']);
|
||||
$this->getTop()->applyFromArray($pStyles['allborders']);
|
||||
$this->getBottom()->applyFromArray($pStyles['allborders']);
|
||||
if (isset($pStyles['allBorders'])) {
|
||||
$this->getLeft()->applyFromArray($pStyles['allBorders']);
|
||||
$this->getRight()->applyFromArray($pStyles['allBorders']);
|
||||
$this->getTop()->applyFromArray($pStyles['allBorders']);
|
||||
$this->getBottom()->applyFromArray($pStyles['allBorders']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -411,7 +411,7 @@ class Borders extends Supervisor implements IComparable
|
|||
$pValue = self::DIAGONAL_NONE;
|
||||
}
|
||||
if ($this->isSupervisor) {
|
||||
$styleArray = $this->getStyleArray(['diagonaldirection' => $pValue]);
|
||||
$styleArray = $this->getStyleArray(['diagonalDirection' => $pValue]);
|
||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
|
||||
} else {
|
||||
$this->diagonalDirection = $pValue;
|
||||
|
|
|
@ -127,19 +127,7 @@ class Color extends Supervisor implements IComparable
|
|||
*/
|
||||
public function getStyleArray($array)
|
||||
{
|
||||
switch ($this->parentPropertyName) {
|
||||
case 'endColor':
|
||||
$key = 'endcolor';
|
||||
break;
|
||||
case 'color':
|
||||
$key = 'color';
|
||||
break;
|
||||
case 'startColor':
|
||||
$key = 'startcolor';
|
||||
break;
|
||||
}
|
||||
|
||||
return $this->parent->getStyleArray([$key => $array]);
|
||||
return $this->parent->getStyleArray([$this->parentPropertyName => $array]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -137,12 +137,12 @@ class Fill extends Supervisor implements IComparable
|
|||
* <code>
|
||||
* $spreadsheet->getActiveSheet()->getStyle('B2')->getFill()->applyFromArray(
|
||||
* array(
|
||||
* 'type' => Fill::FILL_GRADIENT_LINEAR,
|
||||
* 'fillType' => Fill::FILL_GRADIENT_LINEAR,
|
||||
* 'rotation' => 0,
|
||||
* 'startcolor' => array(
|
||||
* 'startColor' => array(
|
||||
* 'rgb' => '000000'
|
||||
* ),
|
||||
* 'endcolor' => array(
|
||||
* 'endColor' => array(
|
||||
* 'argb' => 'FFFFFFFF'
|
||||
* )
|
||||
* )
|
||||
|
@ -160,17 +160,17 @@ class Fill extends Supervisor implements IComparable
|
|||
if ($this->isSupervisor) {
|
||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
|
||||
} else {
|
||||
if (isset($pStyles['type'])) {
|
||||
$this->setFillType($pStyles['type']);
|
||||
if (isset($pStyles['fillType'])) {
|
||||
$this->setFillType($pStyles['fillType']);
|
||||
}
|
||||
if (isset($pStyles['rotation'])) {
|
||||
$this->setRotation($pStyles['rotation']);
|
||||
}
|
||||
if (isset($pStyles['startcolor'])) {
|
||||
$this->getStartColor()->applyFromArray($pStyles['startcolor']);
|
||||
if (isset($pStyles['startColor'])) {
|
||||
$this->getStartColor()->applyFromArray($pStyles['startColor']);
|
||||
}
|
||||
if (isset($pStyles['endcolor'])) {
|
||||
$this->getEndColor()->applyFromArray($pStyles['endcolor']);
|
||||
if (isset($pStyles['endColor'])) {
|
||||
$this->getEndColor()->applyFromArray($pStyles['endColor']);
|
||||
}
|
||||
if (isset($pStyles['color'])) {
|
||||
$this->getStartColor()->applyFromArray($pStyles['color']);
|
||||
|
@ -205,7 +205,7 @@ class Fill extends Supervisor implements IComparable
|
|||
public function setFillType($pValue)
|
||||
{
|
||||
if ($this->isSupervisor) {
|
||||
$styleArray = $this->getStyleArray(['type' => $pValue]);
|
||||
$styleArray = $this->getStyleArray(['fillType' => $pValue]);
|
||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
|
||||
} else {
|
||||
$this->fillType = $pValue;
|
||||
|
|
|
@ -69,14 +69,14 @@ class Font extends Supervisor implements IComparable
|
|||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $superScript = false;
|
||||
protected $superscript = false;
|
||||
|
||||
/**
|
||||
* Subscript.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $subScript = false;
|
||||
protected $subscript = false;
|
||||
|
||||
/**
|
||||
* Underline.
|
||||
|
@ -120,8 +120,8 @@ class Font extends Supervisor implements IComparable
|
|||
$this->size = null;
|
||||
$this->bold = null;
|
||||
$this->italic = null;
|
||||
$this->superScript = null;
|
||||
$this->subScript = null;
|
||||
$this->superscript = null;
|
||||
$this->subscript = null;
|
||||
$this->underline = null;
|
||||
$this->strikethrough = null;
|
||||
$this->color = new Color(Color::COLOR_BLACK, $isSupervisor, $isConditional);
|
||||
|
@ -166,7 +166,7 @@ class Font extends Supervisor implements IComparable
|
|||
* 'bold' => TRUE,
|
||||
* 'italic' => FALSE,
|
||||
* 'underline' => \PhpOffice\PhpSpreadsheet\Style\Font::UNDERLINE_DOUBLE,
|
||||
* 'strike' => FALSE,
|
||||
* 'strikethrough' => FALSE,
|
||||
* 'color' => array(
|
||||
* 'rgb' => '808080'
|
||||
* )
|
||||
|
@ -194,17 +194,17 @@ class Font extends Supervisor implements IComparable
|
|||
if (isset($pStyles['italic'])) {
|
||||
$this->setItalic($pStyles['italic']);
|
||||
}
|
||||
if (isset($pStyles['superScript'])) {
|
||||
$this->setSuperScript($pStyles['superScript']);
|
||||
if (isset($pStyles['superscript'])) {
|
||||
$this->setSuperscript($pStyles['superscript']);
|
||||
}
|
||||
if (isset($pStyles['subScript'])) {
|
||||
$this->setSubScript($pStyles['subScript']);
|
||||
if (isset($pStyles['subscript'])) {
|
||||
$this->setSubscript($pStyles['subscript']);
|
||||
}
|
||||
if (isset($pStyles['underline'])) {
|
||||
$this->setUnderline($pStyles['underline']);
|
||||
}
|
||||
if (isset($pStyles['strike'])) {
|
||||
$this->setStrikethrough($pStyles['strike']);
|
||||
if (isset($pStyles['strikethrough'])) {
|
||||
$this->setStrikethrough($pStyles['strikethrough']);
|
||||
}
|
||||
if (isset($pStyles['color'])) {
|
||||
$this->getColor()->applyFromArray($pStyles['color']);
|
||||
|
@ -362,74 +362,74 @@ class Font extends Supervisor implements IComparable
|
|||
}
|
||||
|
||||
/**
|
||||
* Get SuperScript.
|
||||
* Get Superscript.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getSuperScript()
|
||||
public function getSuperscript()
|
||||
{
|
||||
if ($this->isSupervisor) {
|
||||
return $this->getSharedComponent()->getSuperScript();
|
||||
return $this->getSharedComponent()->getSuperscript();
|
||||
}
|
||||
|
||||
return $this->superScript;
|
||||
return $this->superscript;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set SuperScript.
|
||||
* Set Superscript.
|
||||
*
|
||||
* @param bool $pValue
|
||||
*
|
||||
* @return Font
|
||||
*/
|
||||
public function setSuperScript($pValue)
|
||||
public function setSuperscript($pValue)
|
||||
{
|
||||
if ($pValue == '') {
|
||||
$pValue = false;
|
||||
}
|
||||
if ($this->isSupervisor) {
|
||||
$styleArray = $this->getStyleArray(['superScript' => $pValue]);
|
||||
$styleArray = $this->getStyleArray(['superscript' => $pValue]);
|
||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
|
||||
} else {
|
||||
$this->superScript = $pValue;
|
||||
$this->subScript = !$pValue;
|
||||
$this->superscript = $pValue;
|
||||
$this->subscript = !$pValue;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get SubScript.
|
||||
* Get Subscript.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getSubScript()
|
||||
public function getSubscript()
|
||||
{
|
||||
if ($this->isSupervisor) {
|
||||
return $this->getSharedComponent()->getSubScript();
|
||||
return $this->getSharedComponent()->getSubscript();
|
||||
}
|
||||
|
||||
return $this->subScript;
|
||||
return $this->subscript;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set SubScript.
|
||||
* Set Subscript.
|
||||
*
|
||||
* @param bool $pValue
|
||||
*
|
||||
* @return Font
|
||||
*/
|
||||
public function setSubScript($pValue)
|
||||
public function setSubscript($pValue)
|
||||
{
|
||||
if ($pValue == '') {
|
||||
$pValue = false;
|
||||
}
|
||||
if ($this->isSupervisor) {
|
||||
$styleArray = $this->getStyleArray(['subScript' => $pValue]);
|
||||
$styleArray = $this->getStyleArray(['subscript' => $pValue]);
|
||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
|
||||
} else {
|
||||
$this->subScript = $pValue;
|
||||
$this->superScript = !$pValue;
|
||||
$this->subscript = $pValue;
|
||||
$this->superscript = !$pValue;
|
||||
}
|
||||
|
||||
return $this;
|
||||
|
@ -561,8 +561,8 @@ class Font extends Supervisor implements IComparable
|
|||
$this->size .
|
||||
($this->bold ? 't' : 'f') .
|
||||
($this->italic ? 't' : 'f') .
|
||||
($this->superScript ? 't' : 'f') .
|
||||
($this->subScript ? 't' : 'f') .
|
||||
($this->superscript ? 't' : 'f') .
|
||||
($this->subscript ? 't' : 'f') .
|
||||
$this->underline .
|
||||
($this->strikethrough ? 't' : 'f') .
|
||||
$this->color->getHashCode() .
|
||||
|
|
|
@ -141,7 +141,7 @@ class NumberFormat extends Supervisor implements IComparable
|
|||
*/
|
||||
public function getStyleArray($array)
|
||||
{
|
||||
return ['numberformat' => $array];
|
||||
return ['numberFormat' => $array];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -149,7 +149,7 @@ class NumberFormat extends Supervisor implements IComparable
|
|||
* <code>
|
||||
* $spreadsheet->getActiveSheet()->getStyle('B2')->getNumberFormat()->applyFromArray(
|
||||
* array(
|
||||
* 'code' => NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE
|
||||
* 'formatCode' => NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE
|
||||
* )
|
||||
* );
|
||||
* </code>.
|
||||
|
@ -165,8 +165,8 @@ class NumberFormat extends Supervisor implements IComparable
|
|||
if ($this->isSupervisor) {
|
||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($this->getStyleArray($pStyles));
|
||||
} else {
|
||||
if (isset($pStyles['code'])) {
|
||||
$this->setFormatCode($pStyles['code']);
|
||||
if (isset($pStyles['formatCode'])) {
|
||||
$this->setFormatCode($pStyles['formatCode']);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -203,7 +203,7 @@ class NumberFormat extends Supervisor implements IComparable
|
|||
$pValue = self::FORMAT_GENERAL;
|
||||
}
|
||||
if ($this->isSupervisor) {
|
||||
$styleArray = $this->getStyleArray(['code' => $pValue]);
|
||||
$styleArray = $this->getStyleArray(['formatCode' => $pValue]);
|
||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
|
||||
} else {
|
||||
$this->formatCode = $pValue;
|
||||
|
@ -237,7 +237,7 @@ class NumberFormat extends Supervisor implements IComparable
|
|||
public function setBuiltInFormatCode($pValue)
|
||||
{
|
||||
if ($this->isSupervisor) {
|
||||
$styleArray = $this->getStyleArray(['code' => self::builtInFormatCode($pValue)]);
|
||||
$styleArray = $this->getStyleArray(['formatCode' => self::builtInFormatCode($pValue)]);
|
||||
$this->getActiveSheet()->getStyle($this->getSelectedCells())->applyFromArray($styleArray);
|
||||
} else {
|
||||
$this->builtInFormatCode = $pValue;
|
||||
|
|
|
@ -1266,9 +1266,9 @@ class Html extends BaseWriter implements IWriter
|
|||
if ($element instanceof RichText\Run) {
|
||||
$cellData .= '<span style="' . $this->assembleCSS($this->createCSSStyleFont($element->getFont())) . '">';
|
||||
|
||||
if ($element->getFont()->getSuperScript()) {
|
||||
if ($element->getFont()->getSuperscript()) {
|
||||
$cellData .= '<sup>';
|
||||
} elseif ($element->getFont()->getSubScript()) {
|
||||
} elseif ($element->getFont()->getSubscript()) {
|
||||
$cellData .= '<sub>';
|
||||
}
|
||||
}
|
||||
|
@ -1278,9 +1278,9 @@ class Html extends BaseWriter implements IWriter
|
|||
$cellData .= htmlspecialchars($cellText);
|
||||
|
||||
if ($element instanceof RichText\Run) {
|
||||
if ($element->getFont()->getSuperScript()) {
|
||||
if ($element->getFont()->getSuperscript()) {
|
||||
$cellData .= '</sup>';
|
||||
} elseif ($element->getFont()->getSubScript()) {
|
||||
} elseif ($element->getFont()->getSubscript()) {
|
||||
$cellData .= '</sub>';
|
||||
}
|
||||
|
||||
|
@ -1302,9 +1302,9 @@ class Html extends BaseWriter implements IWriter
|
|||
);
|
||||
}
|
||||
$cellData = htmlspecialchars($cellData);
|
||||
if ($pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont()->getSuperScript()) {
|
||||
if ($pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont()->getSuperscript()) {
|
||||
$cellData = '<sup>' . $cellData . '</sup>';
|
||||
} elseif ($pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont()->getSubScript()) {
|
||||
} elseif ($pSheet->getParent()->getCellXfByIndex($cell->getXfIndex())->getFont()->getSubscript()) {
|
||||
$cellData = '<sub>' . $cellData . '</sub>';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,9 +74,9 @@ class Font
|
|||
$font_shadow = 0;
|
||||
|
||||
$icv = $this->colorIndex; // Index to color palette
|
||||
if ($this->font->getSuperScript()) {
|
||||
if ($this->font->getSuperscript()) {
|
||||
$sss = 1;
|
||||
} elseif ($this->font->getSubScript()) {
|
||||
} elseif ($this->font->getSubscript()) {
|
||||
$sss = 2;
|
||||
} else {
|
||||
$sss = 0;
|
||||
|
|
|
@ -3160,8 +3160,8 @@ class Worksheet extends BIFFwriter
|
|||
|| $conditional->getStyle()->getFont()->getSize() != null
|
||||
|| $conditional->getStyle()->getFont()->getBold() != null
|
||||
|| $conditional->getStyle()->getFont()->getItalic() != null
|
||||
|| $conditional->getStyle()->getFont()->getSuperScript() != null
|
||||
|| $conditional->getStyle()->getFont()->getSubScript() != null
|
||||
|| $conditional->getStyle()->getFont()->getSuperscript() != null
|
||||
|| $conditional->getStyle()->getFont()->getSubscript() != null
|
||||
|| $conditional->getStyle()->getFont()->getUnderline() != null
|
||||
|| $conditional->getStyle()->getFont()->getStrikethrough() != null
|
||||
|| $conditional->getStyle()->getFont()->getColor()->getARGB() != null) {
|
||||
|
@ -3233,10 +3233,10 @@ class Worksheet extends BIFFwriter
|
|||
$dataBlockFont .= pack('v', 0x0190);
|
||||
}
|
||||
// Escapement type
|
||||
if ($conditional->getStyle()->getFont()->getSubScript() == true) {
|
||||
if ($conditional->getStyle()->getFont()->getSubscript() == true) {
|
||||
$dataBlockFont .= pack('v', 0x02);
|
||||
$fontEscapement = 0;
|
||||
} elseif ($conditional->getStyle()->getFont()->getSuperScript() == true) {
|
||||
} elseif ($conditional->getStyle()->getFont()->getSuperscript() == true) {
|
||||
$dataBlockFont .= pack('v', 0x01);
|
||||
$fontEscapement = 0;
|
||||
} else {
|
||||
|
|
|
@ -477,7 +477,7 @@ class Drawing extends WriterPart
|
|||
// o:lock
|
||||
$objWriter->startElement('o:lock');
|
||||
$objWriter->writeAttribute('v:ext', 'edit');
|
||||
$objWriter->writeAttribute('rotation', 't');
|
||||
$objWriter->writeAttribute('textRotation', 't');
|
||||
$objWriter->endElement();
|
||||
|
||||
$objWriter->endElement();
|
||||
|
|
|
@ -175,11 +175,11 @@ class StringTable extends WriterPart
|
|||
$objWriter->endElement();
|
||||
|
||||
// Superscript / subscript
|
||||
if ($element->getFont()->getSuperScript() || $element->getFont()->getSubScript()) {
|
||||
if ($element->getFont()->getSuperscript() || $element->getFont()->getSubscript()) {
|
||||
$objWriter->startElement($prefix . 'vertAlign');
|
||||
if ($element->getFont()->getSuperScript()) {
|
||||
if ($element->getFont()->getSuperscript()) {
|
||||
$objWriter->writeAttribute('val', 'superscript');
|
||||
} elseif ($element->getFont()->getSubScript()) {
|
||||
} elseif ($element->getFont()->getSubscript()) {
|
||||
$objWriter->writeAttribute('val', 'subscript');
|
||||
}
|
||||
$objWriter->endElement();
|
||||
|
|
|
@ -320,11 +320,11 @@ class Style extends WriterPart
|
|||
}
|
||||
|
||||
// Superscript / subscript
|
||||
if ($pFont->getSuperScript() === true || $pFont->getSubScript() === true) {
|
||||
if ($pFont->getSuperscript() === true || $pFont->getSubscript() === true) {
|
||||
$objWriter->startElement('vertAlign');
|
||||
if ($pFont->getSuperScript() === true) {
|
||||
if ($pFont->getSuperscript() === true) {
|
||||
$objWriter->writeAttribute('val', 'superscript');
|
||||
} elseif ($pFont->getSubScript() === true) {
|
||||
} elseif ($pFont->getSubscript() === true) {
|
||||
$objWriter->writeAttribute('val', 'subscript');
|
||||
}
|
||||
$objWriter->endElement();
|
||||
|
@ -448,8 +448,8 @@ class Style extends WriterPart
|
|||
if ($pStyle->getAlignment()->getIndent() > 0) {
|
||||
$objWriter->writeAttribute('indent', $pStyle->getAlignment()->getIndent());
|
||||
}
|
||||
if ($pStyle->getAlignment()->getReadorder() > 0) {
|
||||
$objWriter->writeAttribute('readingOrder', $pStyle->getAlignment()->getReadorder());
|
||||
if ($pStyle->getAlignment()->getReadOrder() > 0) {
|
||||
$objWriter->writeAttribute('readingOrder', $pStyle->getAlignment()->getReadOrder());
|
||||
}
|
||||
$objWriter->endElement();
|
||||
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheetTests\Style;
|
||||
|
||||
use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||
use PhpOffice\PhpSpreadsheet\Style\Border;
|
||||
use PHPUnit_Framework_TestCase;
|
||||
|
||||
class BorderTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function testCase()
|
||||
{
|
||||
$spreadsheet = new Spreadsheet();
|
||||
$borders = $spreadsheet->getActiveSheet()->getStyle('A1')->getBorders();
|
||||
$allBorders = $borders->getAllBorders();
|
||||
$bottom = $borders->getBottom();
|
||||
|
||||
$actual = $bottom->getBorderStyle();
|
||||
$this->assertSame(Border::BORDER_NONE, $actual, 'should default to none');
|
||||
|
||||
$allBorders->setBorderStyle(Border::BORDER_THIN);
|
||||
|
||||
$actual = $bottom->getBorderStyle();
|
||||
$this->assertSame(Border::BORDER_THIN, $actual, 'should have been set via allBorders');
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue