Skip to content

Commit

Permalink
fix empty lines to be really empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Schrank committed May 29, 2015
1 parent 0a2c5dc commit f7ef66f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/app/code/community/FireGento/Pdf/Model/Engine/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* @copyright 2014 FireGento Team (http://www.firegento.com)
* @license http://opensource.org/licenses/gpl-3.0 GNU General Public License, version 3 (GPLv3)
*/

/**
* Abstract pdf model.
*
Expand Down Expand Up @@ -185,6 +186,7 @@ public function drawLineBlocks(
public function setMode($mode)
{
$this->mode = $mode;

return $this;
}

Expand Down Expand Up @@ -450,6 +452,7 @@ protected function getHeaderblockOffset()
} else {
$offsetAdjustment = 315;
}

return $offsetAdjustment;
}

Expand Down Expand Up @@ -805,6 +808,7 @@ protected function _drawItem(
$renderer->setRenderedModel($this);

$renderer->draw($position);

return $renderer->getPage();
}

Expand Down Expand Up @@ -923,6 +927,7 @@ protected function insertTotals($page, $source)
}
}
$page = $this->drawLineBlocks($page, array($lineBlock));

return $page;
}

Expand Down Expand Up @@ -980,6 +985,7 @@ protected function _insertNote($page, &$order, &$model)
$this->Ln(15);
}
}

return $page;
}

Expand Down Expand Up @@ -1211,6 +1217,7 @@ public function getFontRegular()
if ($this->getRegularFont() && $this->regularFontFileExists()) {
return Zend_Pdf_Font::fontWithPath($this->getRegularFontFile());
}

return Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA);
}

Expand All @@ -1226,6 +1233,7 @@ protected function _setFontRegular($object, $size = 10)
{
$font = $this->getFontRegular();
$object->setFont($font, $size);

return $font;
}

Expand All @@ -1239,6 +1247,7 @@ public function getFontBold()
if ($this->getBoldFont() && $this->boldFontFileExists()) {
return Zend_Pdf_Font::fontWithPath($this->getBoldFontFile());
}

return Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA_BOLD);
}

Expand All @@ -1254,6 +1263,7 @@ protected function _setFontBold($object, $size = 10)
{
$font = $this->getFontBold();
$object->setFont($font, $size);

return $font;
}

Expand All @@ -1267,6 +1277,7 @@ public function getFontItalic()
if ($this->getItalicFont() && $this->italicFontFileExists()) {
return Zend_Pdf_Font::fontWithPath($this->getItalicFontFile());
}

return Zend_Pdf_Font::fontWithName(
Zend_Pdf_Font::FONT_HELVETICA_ITALIC
);
Expand All @@ -1284,6 +1295,7 @@ protected function _setFontItalic($object, $size = 10)
{
$font = $this->getFontItalic();
$object->setFont($font, $size);

return $font;
}

Expand Down Expand Up @@ -1329,6 +1341,7 @@ public function _prepareText($text, $page, $font, $fontSize, $width = null)
}
// append the last line
$lines .= $currentLine;

return explode("\n", $lines);
}

Expand All @@ -1351,8 +1364,10 @@ protected function fixNumberFormat($label)
'precision' => 2,
)
);

return $matches[1] . '(' . $percentage . '%)';
}

return $label;
}

Expand Down

0 comments on commit f7ef66f

Please sign in to comment.