Fixes issue #948 (#1228)

* Fixes issue #948 by including a setUseEmbeddedCSS(false) method. Doesn't change current behaviour if not set

* Removes a empty line in src/PhpSpreadsheet/Writer/Html.php that fails a test
This commit is contained in:
Suraxius 2019-11-01 00:52:20 +01:00 committed by Mark Baker
parent 617ea476c0
commit 13eaeb39cf
1 changed files with 34 additions and 1 deletions

View File

@ -62,6 +62,13 @@ class Html extends BaseWriter
*/ */
private $useInlineCss = false; private $useInlineCss = false;
/**
* Use embedded CSS?
*
* @var bool
*/
private $useEmbeddedCSS = true;
/** /**
* Array of CSS styles. * Array of CSS styles.
* *
@ -1105,7 +1112,9 @@ class Html extends BaseWriter
// Construct HTML // Construct HTML
$html = ''; $html = '';
if ($this->useEmbeddedCSS) {
$html .= $this->setMargins($pSheet); $html .= $this->setMargins($pSheet);
}
if (!$this->useInlineCss) { if (!$this->useInlineCss) {
$gridlines = $pSheet->getShowGridlines() ? ' gridlines' : ''; $gridlines = $pSheet->getShowGridlines() ? ' gridlines' : '';
@ -1492,6 +1501,30 @@ class Html extends BaseWriter
return $this; return $this;
} }
/**
* Get use embedded CSS?
*
* @return bool
*/
public function getUseEmbeddedCSS()
{
return $this->useEmbeddedCSS;
}
/**
* Set use embedded CSS?
*
* @param bool $pValue
*
* @return HTML
*/
public function setUseEmbeddedCSS($pValue)
{
$this->useEmbeddedCSS = $pValue;
return $this;
}
/** /**
* Add color to formatted string as inline style. * Add color to formatted string as inline style.
* *