diff options
| author | Greg Roach <fisharebest@gmail.com> | 2015-05-30 19:13:51 +0100 |
|---|---|---|
| committer | Greg Roach <fisharebest@gmail.com> | 2015-05-30 23:29:57 +0100 |
| commit | cbc1590a8c715aa2d88bd745610b899587bd9563 (patch) | |
| tree | 8411c52737b981c7eff37ffcdd083902cb769141 /app/Report/ReportHtmlText.php | |
| parent | ffd703ea1e658c7dcb5e5f1f9ef137a420f2d167 (diff) | |
| download | webtrees-cbc1590a8c715aa2d88bd745610b899587bd9563.tar.gz webtrees-cbc1590a8c715aa2d88bd745610b899587bd9563.tar.bz2 webtrees-cbc1590a8c715aa2d88bd745610b899587bd9563.zip | |
Code style
Diffstat (limited to 'app/Report/ReportHtmlText.php')
| -rw-r--r-- | app/Report/ReportHtmlText.php | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/app/Report/ReportHtmlText.php b/app/Report/ReportHtmlText.php index 18a42091cb..eb92c669dd 100644 --- a/app/Report/ReportHtmlText.php +++ b/app/Report/ReportHtmlText.php @@ -22,10 +22,8 @@ namespace Fisharebest\Webtrees; class ReportHtmlText extends ReportBaseText { /** * @param ReportHtml $renderer - * @param integer $curx - * @param boolean $attrib Is is called from a different element? - * - * @return void + * @param int $curx + * @param bool $attrib Is is called from a different element? */ public function render($renderer, $curx = 0, $attrib = true) { @@ -46,7 +44,7 @@ class ReportHtmlText extends ReportBaseText { // Save the start positions $startX = $renderer->getX(); $startY = $renderer->getY(); - $width = $renderer->getRemainingWidth(); + $width = $renderer->getRemainingWidth(); // If text is wider then page width then wrap it if ($renderer->GetStringWidth($temptext) > $width) { $lines = explode("\n", $temptext); @@ -85,6 +83,7 @@ class ReportHtmlText extends ReportBaseText { $ct += 1; } $style = $html->getStyle($this->styleName); + return ($style["size"] * $ct) * $html->cellHeightRatio; } @@ -115,18 +114,18 @@ class ReportHtmlText extends ReportBaseText { if ($this->wrapWidthRemaining > 0) { // Check with line counter too! if (($lw >= $this->wrapWidthRemaining) or ($lfct > 1)) { - $newtext = ""; + $newtext = ""; $wrapWidthRemaining = $this->wrapWidthRemaining; - $lines = explode("\n", $this->text); + $lines = explode("\n", $this->text); // Go throught the text line by line foreach ($lines as $line) { // Line width in points + a little margin $lw = $html->GetStringWidth($line); // If the line has to be wraped if ($lw > $wrapWidthRemaining) { - $words = explode(" ", $line); + $words = explode(" ", $line); $addspace = count($words); - $lw = 0; + $lw = 0; foreach ($words as $word) { $addspace--; $lw += $html->GetStringWidth($word . " "); @@ -160,15 +159,17 @@ class ReportHtmlText extends ReportBaseText { $lfct--; } $this->text = $newtext; - $lfct = substr_count($this->text, "\n"); + $lfct = substr_count($this->text, "\n"); + return array($lw, 1, $lfct); } } - $l = 0; + $l = 0; $lfct = substr_count($this->text, "\n"); if ($lfct > 0) { $l = 2; } + return array($lw, $l, $lfct); } } |
