Skip to content
This repository
Browse code

harden these to flip to r1c1 mode rather than fialing with a TypeError

  • Loading branch information...
commit ccba76eb74f83078c9f3a3ce8bb4066f9ff78072 1 parent 413e11d
Chris Withers cjw296 authored

Showing 1 changed file with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. +6 0 xlrd/formula.py
6 xlrd/formula.py
@@ -2049,6 +2049,9 @@ def dump_formula(bk, data, fmlalen, bv, reldelta, blah=0, isname=0):
2049 2049 # sheet component as empty, just like Excel etc.
2050 2050
2051 2051 def rownamerel(rowx, rowxrel, browx=None, r1c1=0):
  2052 + # if no base rowx is provided, we have to return r1c1
  2053 + if browx is None:
  2054 + r1c1 = True
2052 2055 if not rowxrel:
2053 2056 if r1c1:
2054 2057 return "R%d" % (rowx+1)
@@ -2060,6 +2063,9 @@ def rownamerel(rowx, rowxrel, browx=None, r1c1=0):
2060 2063 return "%d" % ((browx + rowx) % 65536 + 1)
2061 2064
2062 2065 def colnamerel(colx, colxrel, bcolx=None, r1c1=0):
  2066 + # if no base colx is provided, we have to return r1c1
  2067 + if bcolx is None:
  2068 + r1c1 = True
2063 2069 if not colxrel:
2064 2070 if r1c1:
2065 2071 return "C%d" % (colx + 1)

0 comments on commit ccba76e

Please sign in to comment.
Something went wrong with that request. Please try again.