]> source.dussan.org Git - redmine.git/commitdiff
PDF: Ruby 1.9 compatibility for FPDF ANSI (#61).
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 5 Apr 2011 14:13:03 +0000 (14:13 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 5 Apr 2011 14:13:03 +0000 (14:13 +0000)
Contributed by Jun NAITOH.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5331 e93f8b46-1217-0410-a6f0-8f06a7374b81

vendor/plugins/rfpdf/lib/fpdf/chinese.rb
vendor/plugins/rfpdf/lib/fpdf/japanese.rb
vendor/plugins/rfpdf/lib/fpdf/korean.rb

index 94f8ee49d64cf34a15cb977b3c1787e640fe4d03..dca53c556959e41fe70cd12044f1d6606df3caa6 100644 (file)
@@ -130,7 +130,7 @@ module PDF_Chinese
        nb=s.length
        i=0
        while(i<nb)
-               c=s[i]
+               c = s[i].is_a?(String) ? s[i].ord : s[i]
                if(c<128)
                        l+=cw[c.chr] if cw[c.chr]
                        i+=1
@@ -182,7 +182,7 @@ module PDF_Chinese
        nl=1
        while(i<nb)
                #Get next character
-               c=s[i]
+               c = s[i].is_a?(String) ? s[i].ord : s[i]
                #Check if ASCII or MB
                ascii=(c<128)
                if(c.chr=="\n")
@@ -258,7 +258,7 @@ module PDF_Chinese
        nl=1
        while(i<nb)
                #Get next character
-               c=s[i]
+               c = s[i].is_a?(String) ? s[i].ord : s[i]
                #Check if ASCII or MB
                ascii=(c<128)
                if(c.chr=="\n")
index 93bc283cc9fc90886f76f4460c4a218e769e54fe..78f6ce9320721c1857260b3cdefca9f80f0ae71c 100644 (file)
@@ -100,7 +100,7 @@ module PDF_Japanese
        nb=s.length
        i=0
        while(i<nb)
-               o=s[i]
+               o = s[i].is_a?(String) ? s[i].ord : s[i]
                if(o<128)
                        #ASCII
                        l+=cw[o.chr] if cw[o.chr]
@@ -158,7 +158,7 @@ module PDF_Japanese
        nl=1
        while(i<nb)
                #Get next character
-               c=s[i]
+               c = s[i].is_a?(String) ? s[i].ord : s[i]
                o=c #o=ord(c)
                if(o==10)
                        #Explicit line break
@@ -246,7 +246,7 @@ module PDF_Japanese
        nl=1
        while(i<nb)
                #Get next character
-               c=s[i]
+               c = s[i].is_a?(String) ? s[i].ord : s[i]
                o=c
                if(o==10)
                        #Explicit line break
index 0d4ee3f6e45ed1d00800e9a1444d450fd3e7b08f..1777ab09a15d643435ee312b29c5f1a389c2e7a7 100644 (file)
@@ -99,7 +99,7 @@ UHC_widths={' ' => 333, '!' => 416, '"' => 416, '#' => 833, '$' => 625, '%' => 9
        nb=s.length\r
        i=0\r
        while(i<nb)\r
-               c=s[i]\r
+               c = s[i].is_a?(String) ? s[i].ord : s[i]\r
                if(c<128)\r
                        l+=cw[c.chr] if cw[c.chr]\r
                        i+=1\r
@@ -151,7 +151,7 @@ UHC_widths={' ' => 333, '!' => 416, '"' => 416, '#' => 833, '$' => 625, '%' => 9
        nl=1\r
        while(i<nb)\r
                #Get next character\r
-               c=s[i]\r
+               c = s[i].is_a?(String) ? s[i].ord : s[i]\r
                #Check if ASCII or MB\r
                ascii=(c<128)\r
                if(c.chr=="\n")\r
@@ -227,7 +227,7 @@ UHC_widths={' ' => 333, '!' => 416, '"' => 416, '#' => 833, '$' => 625, '%' => 9
        nl=1\r
        while(i<nb)\r
                #Get next character\r
-               c=s[i]\r
+               c = s[i].is_a?(String) ? s[i].ord : s[i]\r
                #Check if ASCII or MB\r
                ascii=(c<128)\r
                if(c.chr=="\n")\r