From ceab9748a7c11244030d33fbda589872b29688e2 Mon Sep 17 00:00:00 2001 From: Greg Roach Date: Wed, 8 Sep 2021 11:01:32 +0100 Subject: [PATCH] Remove dead code --- app/Report/PdfRenderer.php | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/app/Report/PdfRenderer.php b/app/Report/PdfRenderer.php index ab7081cc282..d311aa5449b 100644 --- a/app/Report/PdfRenderer.php +++ b/app/Report/PdfRenderer.php @@ -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 * @@ -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']); } @@ -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]; } /** @@ -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']; } @@ -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);