summaryrefslogtreecommitdiffstats
path: root/vendor
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-30 03:26:47 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-03-30 03:26:47 +0000
commitb9b2f2454065a561d89374ed4a6e68d2b3ae6e2a (patch)
tree93e20f5c0c113bd10a0ff69e91a37765b718ba1f /vendor
parentaff157f0a07e3b47994b739b50bf4070cbee40ab (diff)
downloadredmine-b9b2f2454065a561d89374ed4a6e68d2b3ae6e2a.tar.gz
redmine-b9b2f2454065a561d89374ed4a6e68d2b3ae6e2a.zip
PDF: transplant r393 (#61).
Added chinese simplified translation (Andy Wu) Fixed rfpdf chinese.rb git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5250 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'vendor')
-rw-r--r--vendor/plugins/rfpdf/lib/fpdf/chinese.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/vendor/plugins/rfpdf/lib/fpdf/chinese.rb b/vendor/plugins/rfpdf/lib/fpdf/chinese.rb
index 731d582a2..6fe3eee8a 100644
--- a/vendor/plugins/rfpdf/lib/fpdf/chinese.rb
+++ b/vendor/plugins/rfpdf/lib/fpdf/chinese.rb
@@ -132,7 +132,7 @@ module PDF_Chinese
while(i<nb)
c=s[i]
if(c<128)
- l+=cw[c.chr]
+ l+=cw[c.chr] if cw[c.chr]
i+=1
else
l+=1000
@@ -170,13 +170,13 @@ module PDF_Chinese
b2='LR'
else
b2=''
- if(border.index('L').nil?)
+ if(border.to_s.index('L'))
b2+='L'
end
- if(border.index('R').nil?)
+ if(border.to_s.index('R'))
b2+='R'
end
- b=border.index('T').nil? ? b2+'T' : b2
+ b=border.to_s.index('T') ? b2+'T' : b2
end
end
sep=-1
@@ -209,7 +209,7 @@ module PDF_Chinese
sep=i
ls=l
end
- l+=ascii ? cw[c.chr] : 1000
+ l+=ascii ? (cw[c.chr] || 0) : 1000
if(l>wmax)
#Automatic line break
if(sep==-1 or i==j)
@@ -233,7 +233,7 @@ module PDF_Chinese
end
end
#Last chunk
- if(border and not border.index('B').nil?)
+ if(border and not border.to_s.index('B').nil?)
b+='B'
end
Cell(w,h,s[j,i-j],b,2,align,fill)