hack for links with an invalid target. this happens when testrendering tables in mwlib.rl
1 --- a/mwlib/reportlab/pdfbase/pdfdoc.py Tue Aug 19 10:13:14 2008 +0200
2 +++ b/mwlib/reportlab/pdfbase/pdfdoc.py Tue Nov 18 16:46:07 2008 +0100
3 @@ -1681,7 +1681,10 @@
4 self.fmt = self.page = None
5 def format(self, document):
6 f = self.fmt
7 - if f is None: raise ValueError, "format not resolved %s" % self.name
8 + #if f is None: raise ValueError, "format not resolved %s" % self.name
9 + # FIXME: below is a hack to prevent Exceptions when using internal links or booksmarks
10 + # which have an invalid target. this happens when testrendering tables in mwlib.rl for example
11 + if f is None: return ''
12 p = self.page
13 if p is None: raise ValueError, "Page reference unbound %s" % self.name
14 f.page = p