Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
fisharebest committed Sep 8, 2021
1 parent 345fcc8 commit ceab974
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions app/Report/PdfRenderer.php
Expand Up @@ -194,18 +194,6 @@ public function clearHeader(): void
$this->headerElements = [];
}

/**
* Set the report.
*
* @param PdfRenderer $report
*
* @return void
*/
public function setReport(PdfRenderer $report): void
{
$this->wt_report = $report;
}

/**
* Get the currently used style name -PDF
*
Expand All @@ -226,7 +214,7 @@ public function getCurrentStyle(): string
public function setCurrentStyle(string $s): void
{
$this->currentStyle = $s;
$style = $this->wt_report->getStyle($s);
$style = $this->getStyle($s);
$this->tcpdf->SetFont($style['font'], $style['style'], $style['size']);
}

Expand All @@ -239,12 +227,12 @@ public function setCurrentStyle(string $s): void
*/
public function getStyle(string $s): array
{
if (!isset($this->wt_report->styles[$s])) {
$s = $this->getCurrentStyle();
$this->wt_report->styles[$s] = $s;
if (!isset($this->styles[$s])) {
$s = $this->getCurrentStyle();
$this->styles[$s] = $s;
}

return $this->wt_report->styles[$s];
return $this->styles[$s];
}

/**
Expand Down Expand Up @@ -307,9 +295,9 @@ public function getFootnotesHeight(): float
public function getCurrentStyleHeight(): float
{
if ($this->currentStyle === '') {
return $this->wt_report->default_font_size;
return $this->default_font_size;
}
$style = $this->wt_report->getStyle($this->currentStyle);
$style = $this->getStyle($this->currentStyle);

return (float) $style['size'];
}
Expand Down Expand Up @@ -412,8 +400,6 @@ public function setup(): void
$this->tcpdf->SetHeaderData('', 0, $this->title);
$this->tcpdf->setHeaderFont([$this->default_font, '', $this->default_font_size]);

$this->setReport($this);

if ($this->show_generated_by) {
// The default style name for Generated by.... is 'genby'
$element = new ReportPdfCell(0, 10, 0, 'C', '', 'genby', 1, ReportBaseElement::CURRENT_POSITION, ReportBaseElement::CURRENT_POSITION, 0, 0, '', '', true);
Expand Down

0 comments on commit ceab974

Please sign in to comment.