diff options
author | xuri <xuri.me@gmail.com> | 2019-12-29 16:02:31 +0800 |
---|---|---|
committer | xuri <xuri.me@gmail.com> | 2019-12-29 16:02:31 +0800 |
commit | 09485b3f9f0aefc58d51462aed65c2416205c591 (patch) | |
tree | f5fbe1830e03875d4c5422110f42ad665b91b14f /cellmerged.go | |
parent | 5c87effc7e6c97fff36a56dea1afac8a2f06fb37 (diff) |
Improve code coverage unit tests
Diffstat (limited to 'cellmerged.go')
-rw-r--r-- | cellmerged.go | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/cellmerged.go b/cellmerged.go index 5bea0bc..b952a1e 100644 --- a/cellmerged.go +++ b/cellmerged.go @@ -1,4 +1,4 @@ -// Copyright 2016 - 2019 The excelize Authors. All rights reserved. Use of +// Copyright 2016 - 2020 The excelize Authors. All rights reserved. Use of // this source code is governed by a BSD-style license that can be found in // the LICENSE file. // @@ -43,13 +43,7 @@ func (f *File) MergeCell(sheet, hcell, vcell string) error { return err } // Correct the coordinate area, such correct C1:B3 to B1:C3. - if rect1[2] < rect1[0] { - rect1[0], rect1[2] = rect1[2], rect1[0] - } - - if rect1[3] < rect1[1] { - rect1[1], rect1[3] = rect1[3], rect1[1] - } + _ = sortCoordinates(rect1) hcell, _ = CoordinatesToCellName(rect1[0], rect1[1]) vcell, _ = CoordinatesToCellName(rect1[2], rect1[3]) @@ -123,12 +117,8 @@ func (f *File) UnmergeCell(sheet string, hcell, vcell string) error { return err } - if rect1[2] < rect1[0] { - rect1[0], rect1[2] = rect1[2], rect1[0] - } - if rect1[3] < rect1[1] { - rect1[1], rect1[3] = rect1[3], rect1[1] - } + // Correct the coordinate area, such correct C1:B3 to B1:C3. + _ = sortCoordinates(rect1) // return nil since no MergeCells in the sheet if xlsx.MergeCells == nil { |