Changeset 104:65a41313fe3a

Show
Ignore:
Timestamp:
01/23/09 03:50:32 (18 months ago)
Author:
Ga?tan de Menten <ged@…>
Branch:
default
Message:

fix the case where the opening directive and closing directive are on the same
line without any style (ie the outermost_x_ancestors are the opening and
closing tags themselves).

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • relatorio/templates/opendocument.py

    r103 r104  
    296296                # - we find the nearest common ancestor of the closing and 
    297297                #   opening statements 
    298                 o_ancestors = [] 
    299                 c_ancestors = list(closing.iterancestors()) 
     298                o_ancestors = [opening] 
     299                c_ancestors = [closing] + list(closing.iterancestors()) 
    300300                ancestor = None 
    301301                for node in opening.iterancestors(): 
     
    314314                assert ancestor is not None, \ 
    315315                       "No common ancestor found for opening and closing tag" 
     316 
    316317                outermost_o_ancestor = o_ancestors[-1] 
    317318                outermost_c_ancestor = c_ancestors[-1]