From dea57dd0aeb5507dc4f58de48b261d4013364232 Mon Sep 17 00:00:00 2001 From: Ri Xu Date: Wed, 24 May 2017 14:17:35 +0800 Subject: Code optimize. --- table.go | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'table.go') diff --git a/table.go b/table.go index ce467fc..c198082 100644 --- a/table.go +++ b/table.go @@ -64,7 +64,7 @@ func (f *File) AddTable(sheet, hcell, vcell, format string) { rID := f.addSheetRelationships(sheet, SourceRelationshipTable, sheetRelationshipsTableXML, "") f.addSheetTable(sheet, rID) f.addTable(sheet, tableXML, hxAxis, hyAxis, vxAxis, vyAxis, tableID, formatSet) - f.addTableContentTypePart(tableID) + f.addContentTypePart(tableID, "table") } // countTables provides function to get table files count storage in the folder @@ -150,18 +150,3 @@ func (f *File) addTable(sheet, tableXML string, hxAxis, hyAxis, vxAxis, vyAxis, table, _ := xml.Marshal(t) f.saveFileList(tableXML, string(table)) } - -// addTableContentTypePart provides function to add image part relationships -// in the file [Content_Types].xml by given drawing index. -func (f *File) addTableContentTypePart(index int) { - content := f.contentTypesReader() - for _, v := range content.Overrides { - if v.PartName == "/xl/tables/table"+strconv.Itoa(index)+".xml" { - return - } - } - content.Overrides = append(content.Overrides, xlsxOverride{ - PartName: "/xl/tables/table" + strconv.Itoa(index) + ".xml", - ContentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml", - }) -} -- cgit v1.2.1