Ver código fonte

修复rect2table

luojiehua 2 anos atrás
pai
commit
0c0cd1417c
1 arquivos alterados com 5 adições e 2 exclusões
  1. 5 2
      format_convert/utils.py

+ 5 - 2
format_convert/utils.py

@@ -1286,9 +1286,9 @@ class LineTable:
                 set_y.add(y0)
                 set_y.add(y1)
         if len(set_x)==0 or len(set_y)==0:
-            return
+            return None,[],[]
         if len(list_rect)<=1:
-            return
+            return None,[],[]
         list_x = list(set_x)
         list_y = list(set_y)
 
@@ -1356,6 +1356,9 @@ class LineTable:
 
         _table,list_x,list_y = self.makeTableByRect(list_rect,margin,sourceP_LB)
 
+        if _table is None:
+            return
+
 
         self.feedText2table(_table,list_textbox,in_objs,sourceP_LB)
         self.fixRect(_table,list_x,list_y,sourceP_LB,margin)