Skip to content

Commit d9da49b

Browse files
committed
fix: remove redundant w:pic "insertion"
The removed `._insert_pic(pic)` call is redundant because the `pic` element is already inserted by the prior `CT_Inline.new()` call. The reason the second `._insert_pic()` call did not add a second `pic` element is that the `pic` element is the same instance in both cases. So that `pic` element is "moved" from where it was, back to the same place.
1 parent 592fa8f commit d9da49b

File tree

1 file changed

+0
-1
lines changed

1 file changed

+0
-1
lines changed

src/docx/oxml/shape.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ def new_pic_inline(
100100
pic_id = 0 # Word doesn't seem to use this, but does not omit it
101101
pic = CT_Picture.new(pic_id, filename, rId, cx, cy)
102102
inline = cls.new(cx, cy, shape_id, pic)
103-
inline.graphic.graphicData._insert_pic(pic)
104103
return inline
105104

106105
@classmethod

0 commit comments

Comments
 (0)