Skip to content

Commit

Permalink
corrects a bug in th xpath search wich may cause problems rendering t…
Browse files Browse the repository at this point in the history
…ables in some kinds of reports
  • Loading branch information
sandrods committed Dec 27, 2011
1 parent 2b61f49 commit a47ef96
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions lib/odf-report/section.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ def replace!(doc, row = nil)

def find_section_node(doc)

prefix = @parent ? "" : "//"

sections = doc.xpath("#{prefix}text:section[@text:name='#{@name}']")
sections = doc.xpath(".//text:section[@text:name='#{@name}']")

sections.empty? ? nil : sections.first

Expand Down
4 changes: 1 addition & 3 deletions lib/odf-report/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ def template_length

def find_table_node(doc)

prefix = @parent ? "" : "//"

tables = doc.xpath("#{prefix}table:table[@table:name='#{@name}']")
tables = doc.xpath(".//table:table[@table:name='#{@name}']")

tables.empty? ? nil : tables.first

Expand Down

0 comments on commit a47ef96

Please sign in to comment.