Code Duplication    Length = 6-10 lines in 4 locations

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

@@ 1059-1064 (lines=6) @@
1056
        if ($c == "\n")
1057
        {
1058
            // Explicit line break
1059
            if ($this->unifontSubset) {
1060
                $this->Cell($w, $h, mb_substr($s, $j, $i - $j, 'UTF-8'), 0, 2, '', 0, $link);
1061
            } else {
1062
                $this->Cell($w, $h, substr($s, $j, $i - $j), 0, 2, '', 0, $link);
1063
            }
1064
            $i++;
1065
            $sep = -1;
1066
            $j = $i;
1067
            $l = 0;
@@ 1102-1107 (lines=6) @@
1099
                if ($i == $j) {
1100
                                    $i++;
1101
                }
1102
                if ($this->unifontSubset) {
1103
                    $this->Cell($w, $h, mb_substr($s, $j, $i - $j, 'UTF-8'), 0, 2, '', 0, $link);
1104
                } else {
1105
                    $this->Cell($w, $h, substr($s, $j, $i - $j), 0, 2, '', 0, $link);
1106
                }
1107
            } else
1108
            {
1109
                if ($this->unifontSubset) {
1110
                    $this->Cell($w, $h, mb_substr($s, $j, $sep - $j, 'UTF-8'), 0, 2, '', 0, $link);
@@ 1107-1116 (lines=10) @@
1104
                } else {
1105
                    $this->Cell($w, $h, substr($s, $j, $i - $j), 0, 2, '', 0, $link);
1106
                }
1107
            } else
1108
            {
1109
                if ($this->unifontSubset) {
1110
                    $this->Cell($w, $h, mb_substr($s, $j, $sep - $j, 'UTF-8'), 0, 2, '', 0, $link);
1111
                } else {
1112
                    $this->Cell($w, $h, substr($s, $j, $sep - $j), 0, 2, '', 0, $link);
1113
                }
1114
                $i = $sep + 1;
1115
            }
1116
            $sep = -1;
1117
            $j = $i;
1118
            $l = 0;
1119
            if ($nl == 1)
@@ 1131-1138 (lines=8) @@
1128
        }
1129
    }
1130
    // Last chunk
1131
    if ($i != $j) {
1132
        if ($this->unifontSubset) {
1133
            $this->Cell($l, $h, mb_substr($s, $j, $i - $j, 'UTF-8'), 0, 0, '', 0, $link);
1134
        } else {
1135
            $this->Cell($l, $h, substr($s, $j), 0, 0, '', 0, $link);
1136
        }
1137
    }
1138
}
1139
1140
/**
1141
 * @param integer $h