killmenow
This commit is contained in:
parent
bca69a7fcd
commit
7a73f5b2cd
@ -14,7 +14,7 @@ class OptionsManager extends OptionsManagerAbstract
|
|||||||
{
|
{
|
||||||
/** Default style font values */
|
/** Default style font values */
|
||||||
const DEFAULT_FONT_SIZE = 12;
|
const DEFAULT_FONT_SIZE = 12;
|
||||||
const DEFAULT_FONT_NAME = 'Calibri';
|
const DEFAULT_FONT_NAME = 'Arial';
|
||||||
|
|
||||||
/** @var StyleBuilder Style builder */
|
/** @var StyleBuilder Style builder */
|
||||||
protected $styleBuilder;
|
protected $styleBuilder;
|
||||||
|
@ -225,7 +225,7 @@ EOD;
|
|||||||
$styleId = $style->getId();
|
$styleId = $style->getId();
|
||||||
$fillId = $this->getFillIdForStyleId($styleId);
|
$fillId = $this->getFillIdForStyleId($styleId);
|
||||||
$borderId = $this->getBorderIdForStyleId($styleId);
|
$borderId = $this->getBorderIdForStyleId($styleId);
|
||||||
$numberFormatId = !empty($style->getNumberFormat()) ? $style->getNumberFormat()->getId() : 0;
|
$numberFormatId = $this->getNumberFormatIdForStyleId($styleId);
|
||||||
|
|
||||||
$content .= '<xf numFmtId="'.$numberFormatId.'" fontId="' . $styleId . '" fillId="' . $fillId . '" borderId="' . $borderId . '" xfId="0"';
|
$content .= '<xf numFmtId="'.$numberFormatId.'" fontId="' . $styleId . '" fillId="' . $fillId . '" borderId="' . $borderId . '" xfId="0"';
|
||||||
|
|
||||||
@ -282,6 +282,22 @@ EOD;
|
|||||||
return $isDefaultStyle ? 0 : ($this->styleRegistry->getBorderIdForStyleId($styleId) ?: 0);
|
return $isDefaultStyle ? 0 : ($this->styleRegistry->getBorderIdForStyleId($styleId) ?: 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the fill ID associated to the given style ID.
|
||||||
|
* For the default style, we don't a border.
|
||||||
|
*
|
||||||
|
* @param int $styleId
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
private function getNumberFormatIdForStyleId($styleId)
|
||||||
|
{
|
||||||
|
// For the default style (ID = 0), we don't want to override the border.
|
||||||
|
// Otherwise all cells of the spreadsheet will have a border.
|
||||||
|
$isDefaultStyle = ($styleId === 0);
|
||||||
|
|
||||||
|
return $isDefaultStyle ? 0 : ($this->styleRegistry->getNumberFormatIdForStyleId($styleId) ?: 0);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the content of the "<cellStyles>" section.
|
* Returns the content of the "<cellStyles>" section.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user