=== modified file 'share/extensions/inkex.py' --- share/extensions/inkex.py 2014-11-25 19:49:28 +0000 +++ share/extensions/inkex.py 2015-07-10 06:42:54 +0000 @@ -207,7 +207,7 @@ x = self.unittouu( xattr[0] + 'px' ) y = self.unittouu( yattr[0] + 'px') doc_height = self.unittouu(self.document.getroot().get('height')) - if x and y: + if x and y and doc_height is not None: self.view_center = (float(x), doc_height - float(y)) # FIXME: y-coordinate flip, eliminate it when it's gone in Inkscape def getselected(self): @@ -340,19 +340,22 @@ unit = re.compile('(%s)$' % '|'.join(self.__uuconv.keys())) param = re.compile(r'(([-+]?[0-9]+(\.[0-9]*)?|[-+]?\.[0-9]+)([eE][-+]?[0-9]+)?)') - p = param.match(string) - u = unit.search(string) - if p: - retval = float(p.string[p.start():p.end()]) + if string is not None: + p = param.match(string) + u = unit.search(string) + if p: + retval = float(p.string[p.start():p.end()]) + else: + retval = 0.0 + if u: + try: + return retval * (self.__uuconv[u.string[u.start():u.end()]] / self.__uuconv[self.getDocumentUnit()]) + except KeyError: + pass + else: # default assume 'px' unit + return retval / self.__uuconv[self.getDocumentUnit()] else: - retval = 0.0 - if u: - try: - return retval * (self.__uuconv[u.string[u.start():u.end()]] / self.__uuconv[self.getDocumentUnit()]) - except KeyError: - pass - else: # default assume 'px' unit - return retval / self.__uuconv[self.getDocumentUnit()] + retval = None return retval