@@ -19,7 +19,6 @@ import (
1919 "io/ioutil"
2020 "os"
2121 "strconv"
22- "strings"
2322)
2423
2524// File define a populated XLSX file struct.
@@ -215,49 +214,3 @@ func (f *File) UpdateLinkedValue() error {
215214 }
216215 return nil
217216}
218-
219- // GetMergeCells provides a function to get all merged cells from a worksheet
220- // currently.
221- func (f * File ) GetMergeCells (sheet string ) ([]MergeCell , error ) {
222- var mergeCells []MergeCell
223- xlsx , err := f .workSheetReader (sheet )
224- if err != nil {
225- return mergeCells , err
226- }
227- if xlsx .MergeCells != nil {
228- mergeCells = make ([]MergeCell , 0 , len (xlsx .MergeCells .Cells ))
229-
230- for i := range xlsx .MergeCells .Cells {
231- ref := xlsx .MergeCells .Cells [i ].Ref
232- axis := strings .Split (ref , ":" )[0 ]
233- val , _ := f .GetCellValue (sheet , axis )
234- mergeCells = append (mergeCells , []string {ref , val })
235- }
236- }
237-
238- return mergeCells , err
239- }
240-
241- // MergeCell define a merged cell data.
242- // It consists of the following structure.
243- // example: []string{"D4:E10", "cell value"}
244- type MergeCell []string
245-
246- // GetCellValue returns merged cell value.
247- func (m * MergeCell ) GetCellValue () string {
248- return (* m )[1 ]
249- }
250-
251- // GetStartAxis returns the merge start axis.
252- // example: "C2"
253- func (m * MergeCell ) GetStartAxis () string {
254- axis := strings .Split ((* m )[0 ], ":" )
255- return axis [0 ]
256- }
257-
258- // GetEndAxis returns the merge end axis.
259- // example: "D4"
260- func (m * MergeCell ) GetEndAxis () string {
261- axis := strings .Split ((* m )[0 ], ":" )
262- return axis [1 ]
263- }
0 commit comments