setContentTypePartRelsExtensions provides a function to set the content type for relationship parts and the Main Document part.
()
| 287 | // setContentTypePartRelsExtensions provides a function to set the content type |
| 288 | // for relationship parts and the Main Document part. |
| 289 | func (f *File) setContentTypePartRelsExtensions() error { |
| 290 | var rels bool |
| 291 | content, err := f.contentTypesReader() |
| 292 | if err != nil { |
| 293 | return err |
| 294 | } |
| 295 | for _, v := range content.Defaults { |
| 296 | if v.Extension == "rels" { |
| 297 | rels = true |
| 298 | } |
| 299 | } |
| 300 | if !rels { |
| 301 | content.Defaults = append(content.Defaults, xlsxDefault{ |
| 302 | Extension: "rels", |
| 303 | ContentType: ContentTypeRelationships, |
| 304 | }) |
| 305 | } |
| 306 | return err |
| 307 | } |
| 308 | |
| 309 | // setContentTypePartImageExtensions provides a function to set the content type |
| 310 | // for relationship parts and the Main Document part. |