Renamed setencrypt to setEncrypt to follow naming convention.
authorjonas
Tue, 13 Jan 2009 11:01:49 +0000
changeset 3048 3ff2383916b9
parent 3047 ddf424d4c290
child 3049 6e9ca03c4dbe
Renamed setencrypt to setEncrypt to follow naming convention.
src/reportlab/pdfgen/canvas.py
src/reportlab/platypus/doctemplate.py
src/reportlab/platypus/paragraph.py
--- a/src/reportlab/pdfgen/canvas.py	Mon Jan 12 15:29:14 2009 +0000
+++ b/src/reportlab/pdfgen/canvas.py	Tue Jan 13 11:01:49 2009 +0000
@@ -181,9 +181,9 @@
         self._make_preamble()
         self.state_stack = []
 
-        self.setencrypt(encrypt)
+        self.setEncrypt(encrypt)
 
-    def setencrypt(self, encrypt):
+    def setEncrypt(self, encrypt):
         if encrypt:
             from reportlab.lib import pdfencrypt
             if isinstance(encrypt, basestring):
--- a/src/reportlab/platypus/doctemplate.py	Mon Jan 12 15:29:14 2009 +0000
+++ b/src/reportlab/platypus/doctemplate.py	Tue Jan 13 11:01:49 2009 +0000
@@ -718,7 +718,7 @@
                                 invariant=self.invariant,
                                 pageCompression=self.pageCompression)
  
-        getattr(self.canv,'setencrypt',lambda x: None)(self.encrypt)
+        getattr(self.canv,'setEncrypt',lambda x: None)(self.encrypt)
 
         self.canv.setAuthor(self.author)
         self.canv.setTitle(self.title)
--- a/src/reportlab/platypus/paragraph.py	Mon Jan 12 15:29:14 2009 +0000
+++ b/src/reportlab/platypus/paragraph.py	Tue Jan 13 11:01:49 2009 +0000
@@ -224,7 +224,11 @@
                     func = getattr(tx._canvas,name,None)
                     if not func:
                         raise AttributeError("Missing %s callback attribute '%s'" % (kind,name))
-                    func(tx._canvas,kind,cbDefn.label)
+                    tx._canvas._curr_tx_info=dict(tx=tx,cur_x=cur_x,cur_y=cur_y,leading=leading,xs=tx.XtraState)
+                    try:
+                        func(tx._canvas,kind,cbDefn.label)
+                    finally:
+                        del tx._canvas._curr_tx_info
             if f is words[-1]:
                 if not tx._fontname:
                     tx.setFont(xs.style.fontName,xs.style.fontSize)