reportlab/platypus/tables.py
changeset 2574 d81949596070
parent 2523 0473810aff11
child 2575 0cba68b93555
equal deleted inserted replaced
2573:273f77e79536 2574:d81949596070
    77         commands = []
    77         commands = []
    78         if parent:
    78         if parent:
    79             # copy the parents list at construction time
    79             # copy the parents list at construction time
    80             commands = commands + parent.getCommands()
    80             commands = commands + parent.getCommands()
    81             self._opts = parent._opts
    81             self._opts = parent._opts
       
    82             for a in ('spaceBefore','spaceAfter'):
       
    83                 if hasattr(parent,a):
       
    84                     setattr(self,a,getattr(parent,a))
    82         if cmds:
    85         if cmds:
    83             commands = commands + list(cmds)
    86             commands = commands + list(cmds)
    84         self._cmds = commands
    87         self._cmds = commands
    85         self._opts={}
    88         self._opts={}
    86         self._opts.update(kw)
    89         self._opts.update(kw)
   778             tblstyle = TableStyle(tblstyle)
   781             tblstyle = TableStyle(tblstyle)
   779         for cmd in tblstyle.getCommands():
   782         for cmd in tblstyle.getCommands():
   780             self._addCommand(cmd)
   783             self._addCommand(cmd)
   781         for k,v in tblstyle._opts.items():
   784         for k,v in tblstyle._opts.items():
   782             setattr(self,k,v)
   785             setattr(self,k,v)
       
   786         for a in ('spaceBefore','spaceAfter'):
       
   787             if not hasattr(self,a) and hasattr(tblstyle,a):
       
   788                 setattr(self,a,getattr(tblstyle,a))
   783 
   789 
   784     def _addCommand(self,cmd):
   790     def _addCommand(self,cmd):
   785         if cmd[0] in ('BACKGROUND','ROWBACKGROUNDS','COLBACKGROUNDS'):
   791         if cmd[0] in ('BACKGROUND','ROWBACKGROUNDS','COLBACKGROUNDS'):
   786             self._bkgrndcmds.append(cmd)
   792             self._bkgrndcmds.append(cmd)
   787         elif cmd[0] == 'SPAN':
   793         elif cmd[0] == 'SPAN':