lib/writeexcel/olewriter.rb in writeexcel-0.6.9 vs lib/writeexcel/olewriter.rb in writeexcel-0.6.10

- old
+ new

@@ -96,11 +96,11 @@ @io.write(data) end ############################################################################### # - # set_size($biffsize) + # set_size(biffsize) # # Set the size of the data to be written to the OLE stream # # $big_blocks = (109 depot block x (128 -1 marker word) # - (1 x end words)) = 13842 @@ -110,16 +110,10 @@ if size > MaxSize return @size_allowed = false end @biff_size = size - - if size > BlockSize - @book_size = size - else - @book_size = BlockSize - end - + @book_size = [size, BlockSize].max @size_allowed = true end ############################################################################### #