Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* #315, #323, #329

* New testfile
  • Loading branch information
zgordan-vv authored and gunnsth committed Oct 1, 2019
1 parent 541b6a8 commit ae4e2e3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 0 deletions.
Binary file modified _examples/document/toc/toc.docx
Binary file not shown.
Binary file modified _examples/document/use-template/use-template.docx
Binary file not shown.
2 changes: 2 additions & 0 deletions document/document.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func New() *Document {
d.Settings = NewSettings()
d.docRels.AddRelationship("settings.xml", unioffice.SettingsType)
d.ContentTypes.AddOverride("/word/settings.xml", "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml")
d.ContentTypes.AddOverride("/docProps/custom.xml", "application/vnd.openxmlformats-officedocument.custom-properties+xml")

d.Rels = common.NewRelationships()
d.Rels.AddRelationship(unioffice.RelativeFilename(unioffice.DocTypeDocument, "", unioffice.CorePropertiesType, 0), unioffice.CorePropertiesType)
Expand Down Expand Up @@ -555,6 +556,7 @@ func Read(r io.ReaderAt, size int64) (*Document, error) {
}
if !customPropertiesExist {
doc.Rels.AddRelationship("docProps/custom.xml", unioffice.CustomPropertiesType)
doc.ContentTypes.AddOverride("/docProps/custom.xml", "application/vnd.openxmlformats-officedocument.custom-properties+xml")
}

return doc, nil
Expand Down
Binary file modified document/testdata/simple-1.docx
Binary file not shown.

0 comments on commit ae4e2e3

Please sign in to comment.