lib/rspreadsheet/tools.rb in rspreadsheet-0.4.5 vs lib/rspreadsheet/tools.rb in rspreadsheet-0.4.7

- old
+ new

@@ -117,14 +117,14 @@ 'field'=>"urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0", 'formx'=>"urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0", 'css3t'=>"http://www.w3.org/TR/css3-text/", 'manifest'=>"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" } - if @pomnode.nil? + if !defined?(@pomnode) or @pomnode.nil? @pomnode = LibXML::XML::Node.new('xxx') end - if @ns.nil? then @ns={} end + if !defined?(@ns) or @ns.nil? then @ns={} end if @ns[prefix].nil? @ns[prefix] = LibXML::XML::Namespace.new(@pomnode, prefix, ns_array[prefix]) end return @ns[prefix] end @@ -189,14 +189,6 @@ Time.new(StartOfEpoch.year,StartOfEpoch.month,StartOfEpoch.day,h,m,s) end end -end - -# @private -class Range - def size - res = self.end-self.begin+1 - res>0 ? res : 0 - end end