From 9c093c0025d861eae2f4aa4e1b48772216c73cfc Mon Sep 17 00:00:00 2001 From: yudshj Date: Sat, 21 Nov 2026 00:20:19 +0800 Subject: [PATCH] =?UTF-8?q?test(office):=20PowerPoint=20=E8=A7=86=E8=A7=89?= =?UTF-8?q?=E6=84=8F=E5=9B=BE=E7=94=A8=E4=BE=8B=E7=9A=84=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=A1=86=E6=94=B9=E4=B8=BA=E6=BB=A1=E5=AE=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原来的文本框偏离页面中心,「标题居中」需要同时移动文本框。office 正文 不再写这条 python-pptx 细节,用户排除渲染时模型拿不到位置反馈,用例因此 不稳定。改为满宽文本框后,用例只验证段落对齐、颜色和文本框仍然居中。 --- packages/skill/skill-office/tests/fixtures/visual-intent.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/skill/skill-office/tests/fixtures/visual-intent.ts b/packages/skill/skill-office/tests/fixtures/visual-intent.ts index ccfa9bea9f..c30bb848e0 100644 --- a/packages/skill/skill-office/tests/fixtures/visual-intent.ts +++ b/packages/skill/skill-office/tests/fixtures/visual-intent.ts @@ -23,7 +23,7 @@ const formats = [ notesTask: 'set the speaker notes of slide 1 to Revenue grew 50%. without changing the slide', verifyNotes: "from pptx import Presentation\np=Presentation('result.pptx'); s=p.slides[0]; assert s.has_notes_slide and s.notes_slide.notes_text_frame.text.strip() == 'Revenue grew 50%.'; assert s.shapes[0].text == 'Quarterly revenue'", format: 'pptx', task: 'center the title on slide 1 and set its font color to #1F4E79', - seed: "from pptx import Presentation\nfrom pptx.util import Inches\np=Presentation(); s=p.slides.add_slide(p.slide_layouts[6]); s.shapes.add_textbox(Inches(1),Inches(1),Inches(6),Inches(1)).text='Quarterly revenue'; p.save('input.pptx')", + seed: "from pptx import Presentation\nfrom pptx.util import Inches\np=Presentation(); s=p.slides.add_slide(p.slide_layouts[6]); s.shapes.add_textbox(0,Inches(1),p.slide_width,Inches(1)).text='Quarterly revenue'; p.save('input.pptx')", verify: "from pptx import Presentation\nfrom pptx.enum.text import PP_ALIGN\np=Presentation('result.pptx'); title=p.slides[0].shapes[0]; r=title.text_frame.paragraphs[0]; assert r.alignment == PP_ALIGN.CENTER; assert abs(2*title.left+title.width-p.slide_width) <= 1; assert str(r.runs[0].font.color.rgb).upper() == '1F4E79'", }, {