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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user