Skip to content

Commit 7a523e7

Browse files
authored
Merge pull request #62 from gomutex/develop
allowing empty names in picture
2 parents eb86d61 + cf60dd2 commit 7a523e7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

dml/dmlct/cNvPr.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package dmlct
22

33
import (
44
"encoding/xml"
5-
"fmt"
65
"strconv"
76
)
87

@@ -32,9 +31,11 @@ func NewNonVisProp(id uint, name string) *CNvPr {
3231
}
3332

3433
func (c CNvPr) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
35-
if c.Name == "" {
36-
return fmt.Errorf("invalid Name for Non-Visual Drawing Properties when marshaling")
37-
}
34+
// ! NOTE: Disabling the empty name check for the Picture
35+
// since popular docx tools allow them
36+
// if c.Name == "" {
37+
// return fmt.Errorf("invalid Name for Non-Visual Drawing Properties when marshaling")
38+
// }
3839

3940
start.Attr = []xml.Attr{
4041
{Name: xml.Name{Local: "id"}, Value: strconv.FormatUint(uint64(c.ID), 10)},

0 commit comments

Comments
 (0)