fixed PPTC examples load

This commit is contained in:
tsuky_chen
2024-02-22 16:25:35 +08:00
parent d278f39233
commit 83fbae3b0e
2 changed files with 8 additions and 8 deletions

View File

@@ -146,7 +146,7 @@ def compare_pptx_files(file1_path, file2_path, **options):
examine_font_underline = options.get("examine_font_underline", True)
examine_strike_through = options.get("examine_strike_through", True)
examine_alignment = options.get("examine_alignment", True)
examine_title_bottom_position = options.get("examine_bottom_position", False)
examine_title_bottom_position = options.get("examine_title_bottom_position", False)
examine_table_bottom_position = options.get("examine_table_bottom_position", False)
examine_right_position = options.get("examine_right_position", False)
examine_top_position = options.get("examine_top_position", False)
@@ -188,26 +188,26 @@ def compare_pptx_files(file1_path, file2_path, **options):
for shape1, shape2 in zip(slide1.shapes, slide2.shapes):
if examine_title_bottom_position:
if hasattr(shape1, "text") and hasattr(shape2, "text") and shape1.text == shape2.text:
if shape1.text == "Product Comparison" and shape1.top <= shape2.top:
if shape1.text == "Product Comparison" and (shape1.top <= shape2.top or shape1.top < 3600000):
return 0
elif shape1.left != shape2.left or shape1.top != shape2.top or shape1.width != shape2.width or shape1.height != shape2.height:
return 0
if examine_table_bottom_position:
if slide_idx == 3 and shape1.shape_type == 19 and shape2.shape_type == 19:
if shape1.top <= shape2.top:
if shape1.top <= shape2.top or shape1.top < 3600000:
return 0
elif shape1.left != shape2.left or shape1.top != shape2.top or shape1.width != shape2.width or shape1.height != shape2.height:
return 0
if examine_right_position:
if slide_idx == 2 and not hasattr(shape1, "text") and not hasattr(shape2, "text"):
if shape1.left <= shape2.left:
if shape1.left <= shape2.left or shape1.left < 4320000:
return 0
if examine_top_position:
if shape1.top != shape2.top and not hasattr(shape1, "text") and not hasattr(shape2, "text"):
if shape1.top >= shape2.top:
if slide_idx == 2 and shape1.shape_type == 13 and shape2.shape_type == 13:
if shape1.top >= shape2.top or shape1.top > 1980000:
return 0
elif shape1.left != shape2.left or shape1.top != shape2.top or shape1.width != shape2.width or shape1.height != shape2.height:
return 0