1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-05 07:40:24 +08:00

优化代码结构

This commit is contained in:
源文雨
2023-02-08 16:19:09 +08:00
parent d8f39cecf1
commit 7ff4850504
16 changed files with 153 additions and 114 deletions

View File

@@ -1,17 +1,18 @@
package docxlib
// AddParagraph adds a new paragraph
func (f *DocxLib) AddParagraph() *Paragraph {
func (f *Docx) AddParagraph() *Paragraph {
p := &Paragraph{
Data: make([]ParagraphChild, 0),
Data: make([]ParagraphChild, 0, 64),
file: f,
}
f.Document.Body.Paragraphs = append(f.Document.Body.Paragraphs, p)
return p
}
func (f *DocxLib) Paragraphs() []*Paragraph {
func (f *Docx) Paragraphs() []*Paragraph {
return f.Document.Body.Paragraphs
}