lib/axlsx.rb in axlsx-1.1.7 vs lib/axlsx.rb in axlsx-1.1.8

- old
+ new

@@ -1,18 +1,13 @@ # encoding: UTF-8 +require 'htmlentities' require 'axlsx/version.rb' require 'axlsx/util/simple_typed_list.rb' require 'axlsx/util/constants.rb' require 'axlsx/util/validators.rb' -#not even close to being ready but it does not break anything so it stays for now. -# needs a full re-write to use agile-encryption properly -# require 'axlsx/util/storage.rb' -# require 'axlsx/util/cbf.rb' -# require 'axlsx/util/ms_off_crypto.rb' - # to be included with parsable intitites. #require 'axlsx/util/parser.rb' require 'axlsx/stylesheet/styles.rb' @@ -51,9 +46,15 @@ "#{items.first.r_abs}" ref += ":#{items.last.r_abs}" if items.size > 1 ref end + #global reference html entity encoding + # @return [HtmlEntities] + def self.coder + @@coder ||= ::HTMLEntities.new + end + # returns the x, y position of a cell def self.name_to_indices(name) raise ArgumentError, 'invalid cell name' unless name.size > 1 v = name[/[A-Z]+/].reverse.chars.reduce({:base=>1, :i=>0}) do |val, c| val[:i] += ((c.bytes.first - 64) * val[:base]); val[:base] *= 26; val