summaryrefslogtreecommitdiffstats
path: root/vendor
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-04-03 11:22:21 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2012-04-03 11:22:21 +0000
commit1a87912b06caa30d5aa144f82e8e5367c3e8ac23 (patch)
treed0c53437f532b42975c0ab8435808bf7db27e48f /vendor
parent29782860b7c29f4fd808633c1171aa3175866feb (diff)
downloadredmine-1a87912b06caa30d5aa144f82e8e5367c3e8ac23.tar.gz
redmine-1a87912b06caa30d5aa144f82e8e5367c3e8ac23.zip
pdf: fix tcpdf automatic line break bug (#10554)
Contributed by Jun NAITOH. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9312 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'vendor')
-rwxr-xr-xvendor/plugins/rfpdf/lib/tcpdf.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/vendor/plugins/rfpdf/lib/tcpdf.rb b/vendor/plugins/rfpdf/lib/tcpdf.rb
index 5ff5cd30f..e8878934c 100755
--- a/vendor/plugins/rfpdf/lib/tcpdf.rb
+++ b/vendor/plugins/rfpdf/lib/tcpdf.rb
@@ -1803,7 +1803,7 @@ class TCPDF
w = @w - @r_margin - @x;
end
- wmax = (w - 2 * @c_margin);
+ wmax = (w - 3 * @c_margin);
s = txt.gsub("\r", ''); # remove carriage returns
nb = s.length;
@@ -1862,7 +1862,7 @@ class TCPDF
ns += 1;
end
- l = GetStringWidth(s[from_j, to_index - from_j + 1]);
+ l = GetStringWidth(s[from_j, to_index - from_j]);
if (l > wmax)
#Automatic line break
@@ -1945,7 +1945,7 @@ class TCPDF
#Output text in flowing mode
w = @w - @r_margin - @x;
- wmax = (w - 2 * @c_margin);
+ wmax = (w - 3 * @c_margin);
s = txt.gsub("\r", '');
nb = s.length;
@@ -1974,7 +1974,7 @@ class TCPDF
if (nl == 1)
@x = @l_margin;
w = @w - @r_margin - @x;
- wmax = (w - 2 * @c_margin);
+ wmax = (w - 3 * @c_margin);
end
nl += 1;
next
@@ -1982,7 +1982,7 @@ class TCPDF
if (c == " "[0])
sep= i;
end
- l = GetStringWidth(s[j, i - j + 1]);
+ l = GetStringWidth(s[j, i - j]);
if (l > wmax)
#Automatic line break (word wrapping)
if (sep == -1)
@@ -1991,7 +1991,7 @@ class TCPDF
@x = @l_margin;
@y += h;
w=@w - @r_margin - @x;
- wmax=(w - 2 * @c_margin);
+ wmax=(w - 3 * @c_margin);
i += 1
nl += 1
next
@@ -2010,7 +2010,7 @@ class TCPDF
if (nl==1)
@x = @l_margin;
w = @w - @r_margin - @x;
- wmax = (w - 2 * @c_margin);
+ wmax = (w - 3 * @c_margin);
end
nl += 1;
else