1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-06 00:00:24 +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

@@ -25,7 +25,6 @@ import (
"io"
"strconv"
"strings"
"sync"
)
// WTable represents a table within a Word document.
@@ -502,8 +501,6 @@ type WTableRowHeight struct {
// WTableCell represents a cell within a table.
type WTableCell struct {
mu sync.Mutex
XMLName xml.Name `xml:"w:tc,omitempty"`
TableCellProperties *WTableCellProperties
Paragraphs []Paragraph `xml:"w:p,omitempty"`
@@ -532,9 +529,7 @@ func (c *WTableCell) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
}
if len(value.Children) > 0 {
value.file = c.file
c.mu.Lock()
c.Paragraphs = append(c.Paragraphs, value)
c.mu.Unlock()
}
case "tcPr":
var value WTableCellProperties