summaryrefslogtreecommitdiff
path: root/rows.go
diff options
context:
space:
mode:
authorDokiy <49900744+Dokiys@users.noreply.github.com>2022-01-14 00:28:31 +0800
committerGitHub <noreply@github.com>2022-01-14 00:28:31 +0800
commit67127883dddf6a923d12231da8b089861bcca28c (patch)
treeed15341450f54ce976d028b30b981455392f45d2 /rows.go
parentb96329cc88b87da25a4389f1d4d5ad08cd40605a (diff)
Fix adjustMergeCells not modifies cell rect (#1118)
Diffstat (limited to 'rows.go')
-rw-r--r--rows.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/rows.go b/rows.go
index 56301dd..0ced386 100644
--- a/rows.go
+++ b/rows.go
@@ -661,7 +661,8 @@ func (f *File) DuplicateRowTo(sheet string, row, row2 int) error {
if err != nil {
return err
}
- if row > len(ws.SheetData.Row) || row2 < 1 || row == row2 {
+
+ if row2 < 1 || row == row2 {
return nil
}
@@ -675,14 +676,15 @@ func (f *File) DuplicateRowTo(sheet string, row, row2 int) error {
break
}
}
- if !ok {
- return nil
- }
if err := f.adjustHelper(sheet, rows, row2, 1); err != nil {
return err
}
+ if !ok {
+ return nil
+ }
+
idx2 := -1
for i, r := range ws.SheetData.Row {
if r.R == row2 {