summaryrefslogtreecommitdiffstats
path: root/vendor
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-30 03:27:29 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-30 03:27:29 +0000
commitb257ad145741190fa69395521106b96340f4e7a1 (patch)
tree77b8851ff3c37702f51587e429209f3ac8cb64c9 /vendor
parent000cf8fa9e5be11063fd8b87dae19ff4bb4d00f9 (diff)
downloadredmine-b257ad145741190fa69395521106b96340f4e7a1.tar.gz
redmine-b257ad145741190fa69395521106b96340f4e7a1.zip
PDF: transplant r1497 (#61).
Fixes Chinese pdf export when the issue description is too long (#1170). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5252 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'vendor')
-rw-r--r--vendor/plugins/rfpdf/lib/fpdf/chinese.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/vendor/plugins/rfpdf/lib/fpdf/chinese.rb b/vendor/plugins/rfpdf/lib/fpdf/chinese.rb
index 6fe3eee8a..fecec48dc 100644
--- a/vendor/plugins/rfpdf/lib/fpdf/chinese.rb
+++ b/vendor/plugins/rfpdf/lib/fpdf/chinese.rb
@@ -189,7 +189,7 @@ module PDF_Chinese
c=s[i]
#Check if ASCII or MB
ascii=(c<128)
- if(c=="\n")
+ if(c.chr=="\n")
#Explicit line break
Cell(w,h,s[j,i-j],b,2,align,fill)
i+=1
@@ -209,12 +209,12 @@ module PDF_Chinese
sep=i
ls=l
end
- l+=ascii ? (cw[c.chr] || 0) : 1000
+ l+=ascii ? (cw[c.chr] || 0) : 1100
if(l>wmax)
#Automatic line break
if(sep==-1 or i==j)
if(i==j)
- i+=ascii ? 1 : 2
+ i+=ascii ? 1 : 3
end
Cell(w,h,s[j,i-j],b,2,align,fill)
else
@@ -229,7 +229,7 @@ module PDF_Chinese
b=b2
end
else
- i+=ascii ? 1 : 2
+ i+=ascii ? 1 : 3
end
end
#Last chunk
@@ -265,7 +265,7 @@ module PDF_Chinese
c=s[i]
#Check if ASCII or MB
ascii=(c<128)
- if(c=="\n")
+ if(c.chr=="\n")
#Explicit line break
Cell(w,h,s[j,i-j],0,2,'',0,link)
i+=1
@@ -283,7 +283,7 @@ module PDF_Chinese
if(!ascii or c==' ')
sep=i
end
- l+=ascii ? cw[c.chr] : 1000
+ l+=ascii ? cw[c.chr] : 1100
if(l>wmax)
#Automatic line break
if(sep==-1 or i==j)
@@ -298,7 +298,7 @@ module PDF_Chinese
next
end
if(i==j)
- i+=ascii ? 1 : 2
+ i+=ascii ? 1 : 3
end
Cell(w,h,s[j,i-j],0,2,'',0,link)
else
@@ -315,7 +315,7 @@ module PDF_Chinese
end
nl+=1
else
- i+=ascii ? 1 : 2
+ i+=ascii ? 1 : 3
end
end
#Last chunk