Commit cd30c047 authored by Kevin Deldycke's avatar Kevin Deldycke

Delete empty lines earlier


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2975 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 262210ad
...@@ -257,6 +257,16 @@ class OOoParser: ...@@ -257,6 +257,16 @@ class OOoParser:
table_line.append(cell_text) table_line.append(cell_text)
col_number += 1 col_number += 1
# Delete empty lines if needed
if no_empty_lines:
empty_cell = 0
for table_cell in table_line:
if table_cell == None:
empty_cell += 1
if empty_cell == len(table_line):
table_line = None
if table_line != None:
table.append(table_line) table.append(table_line)
line_number += 1 line_number += 1
...@@ -266,8 +276,6 @@ class OOoParser: ...@@ -266,8 +276,6 @@ class OOoParser:
, width = text_min_bounds['width'] , width = text_min_bounds['width']
, height = text_min_bounds['height'] , height = text_min_bounds['height']
) )
if no_empty_lines:
table = self._deleteTableEmptyLines(table)
return {table_name: table} return {table_name: table}
...@@ -323,22 +331,6 @@ class OOoParser: ...@@ -323,22 +331,6 @@ class OOoParser:
return table return table
security.declarePrivate('_deleteTableEmptyLines')
def _deleteTableEmptyLines(self, table):
"""
Delete table empty lines.
"""
new_table = []
for line in table:
empty_cell = 0
for cell in line:
if cell == None:
empty_cell += 1
if empty_cell != len(line):
new_table.append(line)
return new_table
security.declarePrivate('_getTableListUnion') security.declarePrivate('_getTableListUnion')
def _getTableListUnion(self, list1, list2): def _getTableListUnion(self, list1, list2):
""" """
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment