diff vendor/plugins/rfpdf/lib/tcpdf.rb @ 929:5f33065ddc4b redmine-1.3

Update to Redmine SVN rev 9414 on 1.3-stable branch
author Chris Cannam
date Wed, 27 Jun 2012 14:54:18 +0100
parents cbb26bc654de
children
line wrap: on
line diff
--- a/vendor/plugins/rfpdf/lib/tcpdf.rb	Fri Feb 24 19:09:32 2012 +0000
+++ b/vendor/plugins/rfpdf/lib/tcpdf.rb	Wed Jun 27 14:54:18 2012 +0100
@@ -1803,7 +1803,7 @@
 			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 @@
 				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 @@
 
 		#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 @@
 				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 @@
 			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 @@
 						@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 @@
 				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
@@ -3474,7 +3474,7 @@
 					#Extract attributes
 					# get tag name
 					tag = element.scan(/([a-zA-Z0-9]*)/).flatten.delete_if {|x| x.length == 0}
-					tag = tag[0].downcase;
+					tag = tag[0].to_s.downcase;
 					
 					# get attributes
 					attr_array = element.scan(/([^=\s]*)=["\']?([^"\']*)["\']?/)
@@ -3497,7 +3497,7 @@
 					#Extract attributes
 					# get tag name
 					tag = element.scan(/([a-zA-Z0-9]*)/).flatten.delete_if {|x| x.length == 0}
-					tag = tag[0].downcase;
+					tag = tag[0].to_s.downcase;
 					
 					# get attributes
 					attr_array = element.scan(/([^=\s]*)=["\']?([^"\']*)["\']?/)