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

fix: empty getAtt

This commit is contained in:
源文雨
2023-02-24 12:19:01 +08:00
parent be9f9e9672
commit 1e5dbea998
5 changed files with 86 additions and 52 deletions

View File

@@ -5,6 +5,7 @@ import (
"flag"
"fmt"
"os"
"strings"
"github.com/fumiama/docxlib"
)
@@ -150,7 +151,9 @@ func main() {
}
if *unm {
f, err := os.Create("unmarshal_" + *fileLocation)
i := strings.LastIndex(*fileLocation, "/")
name := (*fileLocation)[:i+1] + "unmarshal_" + (*fileLocation)[i+1:]
f, err := os.Create(name)
if err != nil {
panic(err)
}
@@ -174,7 +177,7 @@ func main() {
fmt.Printf("[%d] ", x)
for y, c := range r.TableCells {
if len(c.Paragraphs) > 0 && len(c.Paragraphs[0].Children) > 0 {
fmt.Printf("<%d> %s\t", y, c.Paragraphs[0].Children[0].(*docxlib.Run).Text.Text)
fmt.Printf("<%d> %v\t", y, &c.Paragraphs[0])
} else {
fmt.Print("\t")
}