Code Duplication    Length = 14-14 lines in 2 locations

web_interface/astpp/application/libraries/html2pdf/_class/parsingCss.class.php 2 locations

@@ 1135-1148 (lines=14) @@
1132
     * @param  boolean $mode true => adding padding and border
1133
     * @return float $width in mm
1134
     */
1135
    public function getLastWidth($mode = false)
1136
    {
1137
        for ($k = count($this->table) - 1; $k >= 0; $k--) {
1138
            if ($this->table[$k]['width']) {
1139
                $w = $this->table[$k]['width'];
1140
                if ($mode) {
1141
                    $w += $this->table[$k]['border']['l']['width'] + $this->table[$k]['padding']['l'] + 0.02;
1142
                    $w += $this->table[$k]['border']['r']['width'] + $this->table[$k]['padding']['r'] + 0.02;
1143
                }
1144
                return $w;
1145
            }
1146
        }
1147
        return $this->_pdf->getW() - $this->_pdf->getlMargin() - $this->_pdf->getrMargin();
1148
    }
1149
1150
     /**
1151
     * get the height of the parent
@@ 1157-1170 (lines=14) @@
1154
     * @param  boolean $mode true => adding padding and border
1155
     * @return float $height in mm
1156
     */
1157
    public function getLastHeight($mode = false)
1158
    {
1159
        for ($k = count($this->table) - 1; $k >= 0; $k--) {
1160
            if ($this->table[$k]['height']) {
1161
                $h = $this->table[$k]['height'];
1162
                if ($mode) {
1163
                    $h += $this->table[$k]['border']['t']['width'] + $this->table[$k]['padding']['t'] + 0.02;
1164
                    $h += $this->table[$k]['border']['b']['width'] + $this->table[$k]['padding']['b'] + 0.02;
1165
                }
1166
                return $h;
1167
            }
1168
        }
1169
        return $this->_pdf->getH() - $this->_pdf->gettMargin() - $this->_pdf->getbMargin();
1170
    }
1171
1172
    /**
1173
     * get the value of the float property