Skip to content

When using DuplicateRow, it is not duplicated correctly when there are multiple merged cells. #752

@yuki2006

Description

@yuki2006

Description

When duplicating a row with multiple merged cells, the cells that are used correctly are not copied.

Perhaps this i++ skips the loop step.

https://github.com/360EntSecGroup-Skylar/excelize/blob/77978ac68d3808060e58df41ebede4b9f3631641/rows.go#L605

Steps to reproduce the issue:
1.

	f, err := excelize.OpenFile("../../.ignore/B.xlsx")
	if err != nil {
		panic(err)
	}
	sheet := f.GetSheetName(0)
	err = f.DuplicateRowTo(sheet, 1, 3)
	if err != nil {
		panic(err)
	}
	err = f.SaveAs("../../.ignore/B_.xlsx")
	if err != nil {
		panic(err)
	}

Describe the results you received:

image

Describe the results you expected:

Want the same thing as the 1 col to be the 3 col.

Output of go version:

go 1.15

Excelize version or commit ID:

77978ac68d3808060e58df41ebede4b9f3631641

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmedThis issue can be reproduced

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions