Sha256: 642671d3bb1a85671a4b28e9a0c7afdc2b7c681120d18e1373b0ed0c77a3b155

Contents?: true

Size: 1.28 KB

Versions: 10

Compression:

Stored size: 1.28 KB

Contents

module RubyXL

  # http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.cellvalues(v=office.14).aspx
  module DataType
    SHARED_STRING = 's'
    RAW_STRING    = 'str'
    INLINE_STRING = 'inlineStr'
    ERROR         = 'e'
    BOOLEAN       = 'b'
    NUMBER        = 'n'
    DATE          = 'd'  # Only available in Office2010.
  end

  module LegacyCell
    attr_accessor :formula, :worksheet

    def workbook
      @worksheet.workbook
    end

    private

    def validate_workbook()
      unless workbook.nil? || workbook.worksheets.nil?
        workbook.worksheets.each { |sheet|
          unless sheet.nil? || sheet.sheet_data.nil? || sheet.sheet_data[row].nil?
            if sheet.sheet_data[row][column] == self
              return
            end
          end
        }
      end
      raise "This cell #{self} is not in workbook #{workbook}"
    end

    def validate_worksheet()
      return if @worksheet && @worksheet[row] && @worksheet[row][column].equal?(self)
      raise "Cell #{self} is not in worksheet #{worksheet}"
    end

    def get_cell_xf
      workbook.cell_xfs[self.style_index || 0]
    end

    def get_cell_font
      workbook.fonts[get_cell_xf.font_id]
    end

    def get_cell_border
      workbook.borders[get_cell_xf.border_id]
    end

  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
rubyXL-3.4.0 lib/rubyXL/cell.rb
rubyXL-3.3.33 lib/rubyXL/cell.rb
rubyXL-3.3.31 lib/rubyXL/cell.rb
rubyXL-3.3.30 lib/rubyXL/cell.rb
rubyXL-3.3.29 lib/rubyXL/cell.rb
rubyXL-ptr-3.3.27 lib/rubyXL/cell.rb
rubyXL-3.3.28 lib/rubyXL/cell.rb
rubyXL-3.3.27 lib/rubyXL/cell.rb
rubyXL-3.3.26 lib/rubyXL/cell.rb
rubyXL-3.3.25 lib/rubyXL/cell.rb