1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-16 06:20:25 +08:00

refactor: Run use Children

This commit is contained in:
源文雨
2023-02-25 21:18:29 +08:00
parent e32b907c6a
commit fafd4c9fc3
14 changed files with 101 additions and 129 deletions

View File

@@ -99,9 +99,11 @@ func (p *Paragraph) AddInlineDrawing(pic []byte) (*Run, error) {
},
},
}
c := make([]interface{}, 1, 64)
c[0] = d
run := &Run{
Drawing: d,
RunProperties: &RunProperties{},
Children: c,
}
p.Children = append(p.Children, run)
return run, nil
@@ -207,9 +209,11 @@ func (p *Paragraph) AddAnchorDrawing(pic []byte) (*Run, error) {
},
},
}
c := make([]interface{}, 1, 64)
c[0] = d
run := &Run{
Drawing: d,
RunProperties: &RunProperties{},
Children: c,
}
p.Children = append(p.Children, run)
return run, nil