minor cosmetic changes
authorrgbecker
Wed, 09 Aug 2006 15:41:35 +0000
changeset 2670 3fdd642a7b76
parent 2669 e35ac776f389
child 2671 d076db57c478
minor cosmetic changes
reportlab/platypus/doctemplate.py
reportlab/platypus/paragraph.py
reportlab/platypus/paraparser.py
--- a/reportlab/platypus/doctemplate.py	Tue Aug 08 10:59:58 2006 +0000
+++ b/reportlab/platypus/doctemplate.py	Wed Aug 09 15:41:35 2006 +0000
@@ -688,7 +688,6 @@
         self.handle_documentBegin()
 
     def _endBuild(self):
-        print 'start of doc._endBuild: keywords=', self.canv._doc.info.keywords
         if self._hanging!=[] and self._hanging[-1] is PageBegin:
             del self._hanging[-1]
             self.clean_hanging()
--- a/reportlab/platypus/paragraph.py	Tue Aug 08 10:59:58 2006 +0000
+++ b/reportlab/platypus/paragraph.py	Wed Aug 09 15:41:35 2006 +0000
@@ -398,7 +398,6 @@
     textlen = tx._canvas.stringWidth(text, tx._fontname, tx._fontsize)
     tx._canvas.line(t_off, y, t_off+textlen, y)
 
-
 _scheme_re = re.compile('^[a-zA-Z][-+a-zA-Z0-9]+$')
 def _doLink(tx,link,rect):
     if type(link) is unicode:
@@ -473,6 +472,15 @@
         <sub> ... </sub> - subscript
         <font name=fontfamily/fontname color=colorname size=float>
         <onDraw name=callable label="a label">
+        <link>link text</link>
+            attributes of links 
+                size/fontSize=num
+                name/face/fontName=name
+                fg/textColor/color=color
+                backcolor/backColor/bgcolor=color
+                dest/destination/target/href/link=target
+        <unichar name="unicode character name"/>
+        <unichar value="unicode code point"/>
 
         The whole may be surrounded by <para> </para> tags
 
@@ -643,7 +651,7 @@
                 #this underscores my feeling that Unicode throughout would be easier!
                 wordWidth = stringWidth(word, fontName, fontSize, self.encoding)
                 newWidth = currentWidth + spaceWidth + wordWidth
-                if newWidth <= maxWidth or len(cLine) == 0:
+                if newWidth <= maxWidth or not len(cLine):
                     # fit one more on this line
                     cLine.append(word)
                     currentWidth = newWidth
@@ -904,7 +912,7 @@
                 tx.setFont(f.fontName, f.fontSize, style.leading)
                 t_off = dpl( tx, offset, lines[0][0], lines[0][1], noJustifyLast and nLines==1)
                 if f.underline or f.link or f.strike:
-                    xs = tx.XtraState=ABag()
+                    xs = tx.XtraState = ABag()
                     xs.cur_y = cur_y
                     xs.f = f
                     xs.style = style
@@ -964,9 +972,6 @@
                 xs.cur_y = cur_y
                 xs.f = f
                 xs.style = style
-                #f = lines[0].words[0]
-                #tx._setFont(f.fontName, f.fontSize)
-
 
                 tx._fontname,tx._fontsize = None, None
                 t_off = dpl( tx, offset, lines[0], noJustifyLast and nLines==1)
--- a/reportlab/platypus/paraparser.py	Tue Aug 08 10:59:58 2006 +0000
+++ b/reportlab/platypus/paraparser.py	Wed Aug 09 15:41:35 2006 +0000
@@ -319,6 +319,13 @@
 #       <font name=fontfamily/fontname color=colorname size=float>
 #       < bullet > </bullet> - bullet text (at head of para only)
 #       <onDraw name=callable label="a label">
+#       <link>link text</link>
+#           attributes of links 
+#               size/fontSize=num
+#               name/face/fontName=name
+#               fg/textColor/color=color
+#               backcolor/backColor/bgcolor=color
+#               dest/destination/target/href/link=target
 #       <unichar name="unicode character name"/>
 #       <unichar value="unicode code point"/>
 #       <greek> - </greek>
@@ -917,6 +924,4 @@
     check_text('''Here comes <FONT FACE="Helvetica" SIZE="14pt">Helvetica 14</FONT> with <STRONG>strong</STRONG> <EM>emphasis</EM>.''')
     check_text('''Here comes <font face="Helvetica" size="14pt">Helvetica 14</font> with <Strong>strong</Strong> <em>emphasis</em>.''')
     check_text('''Here comes <font face="Courier" size="3cm">Courier 3cm</font> and normal again.''')
-    #AR 14-Jul-2006: test <br/> tag
     check_text('''Before the break <br/>the middle line <br/> and the last line.''')
-