write_string in worksheet.rb modifies a string passed in through
worksheet.write.
The problem appear when upgrading from 0.3.4 to 0.3.5
I submitted a patch that fixes this problem,
https://sourceforge.net/tracker/index.php?
func=detail&aid=1596062&group_id=60975&atid=495784
Logged In: YES
user_id=612409
Originator: NO
I just got bitten by this bug too. Your patch looks like it should fix it.
Logged In: YES
user_id=612409
Originator: NO
Here is a work around you can add to your code until the gem gets updated.
(uncomment the puts to make sure it's working)
class Worksheet
alias_method :write_string_old, :write_string
def write_string(row, col, str, format)
# puts "Fixed!"
write_string_old(row, col, str.clone, format)
end
end
Logged In: YES
user_id=612409
Originator: NO
Crap. I needed dup and not clone since clone copies the "frozen" state of the string.
class Worksheet
alias_method :write_string_old, :write_string
def write_string(row, col, str, format)
# puts "Fixed!"
write_string_old(row, col, str.dup, format)
end
end