summaryrefslogtreecommitdiff
path: root/table.go
diff options
context:
space:
mode:
authorxuri <xuri.me@gmail.com>2019-09-16 01:17:35 +0800
committerxuri <xuri.me@gmail.com>2019-09-16 01:17:35 +0800
commit8922f659788187afa6d0a5d3248e999c2c1bb846 (patch)
tree29b2aae2028eaedc448daef08a5670d6f3ca4604 /table.go
parenta3ee098ab60d9528a0d6b7a7c475ea8ff7ebaba5 (diff)
Combine functions:
workBookRelsWriter, drawingRelsWriter into relsWriter; drawingRelsReader, workbookRelsReader, workSheetRelsReader into relsReader; addDrawingRelationships, addSheetRelationships into addRels
Diffstat (limited to 'table.go')
-rw-r--r--table.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/table.go b/table.go
index 45a1622..d26f8fd 100644
--- a/table.go
+++ b/table.go
@@ -77,7 +77,9 @@ func (f *File) AddTable(sheet, hcell, vcell, format string) error {
sheetRelationshipsTableXML := "../tables/table" + strconv.Itoa(tableID) + ".xml"
tableXML := strings.Replace(sheetRelationshipsTableXML, "..", "xl", -1)
// Add first table for given sheet.
- rID := f.addSheetRelationships(sheet, SourceRelationshipTable, sheetRelationshipsTableXML, "")
+ sheetPath, _ := f.sheetMap[trimSheetName(sheet)]
+ sheetRels := "xl/worksheets/_rels/" + strings.TrimPrefix(sheetPath, "xl/worksheets/") + ".rels"
+ rID := f.addRels(sheetRels, SourceRelationshipTable, sheetRelationshipsTableXML, "")
f.addSheetTable(sheet, rID)
err = f.addTable(sheet, tableXML, hcol, hrow, vcol, vrow, tableID, formatSet)
if err != nil {