Code Duplication    Length = 6-10 lines in 4 locations

includes/libraries/Pdf/Tfpdf/tfpdf.class.php 4 locations

@@ 1023-1028 (lines=6) @@
1020
        if ($c == "\n")
1021
        {
1022
            // Explicit line break
1023
            if ($this->unifontSubset) {
1024
                $this->Cell($w, $h, mb_substr($s, $j, $i - $j, 'UTF-8'), 0, 2, '', 0, $link);
1025
            }
1026
            else {
1027
                $this->Cell($w, $h, substr($s, $j, $i - $j), 0, 2, '', 0, $link);
1028
            }
1029
            $i++;
1030
            $sep = -1;
1031
            $j = $i;
@@ 1066-1071 (lines=6) @@
1063
                }
1064
                if ($i == $j)
1065
                    $i++;
1066
                if ($this->unifontSubset) {
1067
                    $this->Cell($w, $h, mb_substr($s, $j, $i - $j, 'UTF-8'), 0, 2, '', 0, $link);
1068
                }
1069
                else {
1070
                    $this->Cell($w, $h, substr($s, $j, $i - $j), 0, 2, '', 0, $link);
1071
                }
1072
            }
1073
            else
1074
            {
@@ 1073-1082 (lines=10) @@
1070
                    $this->Cell($w, $h, substr($s, $j, $i - $j), 0, 2, '', 0, $link);
1071
                }
1072
            }
1073
            else
1074
            {
1075
                if ($this->unifontSubset) {
1076
                    $this->Cell($w, $h, mb_substr($s, $j, $sep - $j, 'UTF-8'), 0, 2, '', 0, $link);
1077
                }
1078
                else {
1079
                    $this->Cell($w, $h, substr($s, $j, $sep - $j), 0, 2, '', 0, $link);
1080
                }
1081
                $i = $sep + 1;
1082
            }
1083
            $sep = -1;
1084
            $j = $i;
1085
            $l = 0;
@@ 1098-1105 (lines=8) @@
1095
        }
1096
    }
1097
    // Last chunk
1098
    if($i!=$j) {
1099
        if ($this->unifontSubset) {
1100
            $this->Cell($l,$h,mb_substr($s,$j,$i-$j,'UTF-8'),0,0,'',0,$link);
1101
        } else {
1102
            $this->Cell($l,$h,substr($s,$j),0,0,'',0,$link);
1103
        }
1104
    }
1105
}
1106
1107
/**
1108
 * @param integer $h