Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The copied Comment is not equal to the original by Equal method #1450

Open
2 of 5 tasks
b0bi79 opened this issue May 31, 2020 · 1 comment · May be fixed by #1451
Open
2 of 5 tasks

The copied Comment is not equal to the original by Equal method #1450

b0bi79 opened this issue May 31, 2020 · 1 comment · May be fixed by #1451

Comments

@b0bi79
Copy link
Member

b0bi79 commented May 31, 2020

Do you want to request a feature or report a bug?

  • Bug
  • Feature
  • Question

Did you test against the latest CI build?

  • Yes
  • No

Version of ClosedXML

e.g. 0.95.3

What is the current behavior?

Comment.Equals returns FALSE for equal comments. The problem is that the XLFormattedText.Equals method compares objects using != instead of Equals.

What is the expected behavior or new feature?

Comment.Equals returns TRUE for equal comments.

Is this a regression from the previous version?

Reproducibility

Code to reproduce problem:

sourceCell.Comment.AddText("test")
targetCell.CopyFrom(sourceCell);
Assert.IsTrue(targetCell.Comment.Equals(sourceCell.Comment));
b0bi79 added a commit to b0bi79/ClosedXML that referenced this issue May 31, 2020
@igitur
Copy link
Member

igitur commented Jun 1, 2020

I guess it's debatable whether 2 comments with the same contents are equal or not in the true sense. Can you give me a more real-world use case of why this matters?

@b0bi79 b0bi79 linked a pull request Jun 1, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants