diff options
author | xuri <xuri.me@gmail.com> | 2020-11-10 23:48:09 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2020-11-11 01:03:56 +0800 |
commit | 2514bb16c682679485dfb5298e1a5797b97bdcd7 (patch) | |
tree | a53f0e7de3fa76b6462e2016e9a734cbd46b3a42 /comment.go | |
parent | 5dd0b4aec2931079e064f1fb393b034ce4934540 (diff) |
Fix #724, standardize variable naming and update unit tests
Diffstat (limited to 'comment.go')
-rw-r--r-- | comment.go | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -91,7 +91,7 @@ func (f *File) AddComment(sheet, cell, format string) error { return err } // Read sheet data. - xlsx, err := f.workSheetReader(sheet) + ws, err := f.workSheetReader(sheet) if err != nil { return err } @@ -99,9 +99,9 @@ func (f *File) AddComment(sheet, cell, format string) error { drawingVML := "xl/drawings/vmlDrawing" + strconv.Itoa(commentID) + ".vml" sheetRelationshipsComments := "../comments" + strconv.Itoa(commentID) + ".xml" sheetRelationshipsDrawingVML := "../drawings/vmlDrawing" + strconv.Itoa(commentID) + ".vml" - if xlsx.LegacyDrawing != nil { + if ws.LegacyDrawing != nil { // The worksheet already has a comments relationships, use the relationships drawing ../drawings/vmlDrawing%d.vml. - sheetRelationshipsDrawingVML = f.getSheetRelationshipsTargetByID(sheet, xlsx.LegacyDrawing.RID) + sheetRelationshipsDrawingVML = f.getSheetRelationshipsTargetByID(sheet, ws.LegacyDrawing.RID) commentID, _ = strconv.Atoi(strings.TrimSuffix(strings.TrimPrefix(sheetRelationshipsDrawingVML, "../drawings/vmlDrawing"), ".vml")) drawingVML = strings.Replace(sheetRelationshipsDrawingVML, "..", "xl", -1) } else { |