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

condition A with style ,the unstyled condition will be applied with A's style. #1867

Closed
ShowerBandV opened this issue Apr 1, 2024 · 1 comment
Labels
confirmed This issue can be reproduced
Projects

Comments

@ShowerBandV
Copy link

@xuri I found something wrong in commit 866f308, if there is a condition A with style ,the unstyled condition will be applied with A's style.

func (f *File) extractCondFmtCellIs(c *xlsxCfRule, extLst *xlsxExtLst) ConditionalFormatOptions {
   format := ConditionalFormatOptions{StopIfTrue: c.StopIfTrue, Type: "cell", Criteria: operatorType[c.Operator]}
   if c.DxfID != nil {
   	format.Format = *c.DxfID
   }
   if len(c.Formula) == 2 {
   	format.MinValue, format.MaxValue = c.Formula[0], c.Formula[1]
   	return format
   }
   format.Value = c.Formula[0]
   return format
}

because the condition A's DxfID is 0,that is to say c.DxfID is 0 , and the unstyled condition's DxfID is nil, format default is 0,so after extract,they all will be 0,we can't distinguish who is unstyled

@xuri xuri added the confirmed This issue can be reproduced label Apr 2, 2024
@xuri xuri added this to Features in v2.9.0 Apr 2, 2024
@xuri xuri added the in progress Working in progress label Apr 2, 2024
@xuri xuri closed this as completed in 5f8a5b8 Apr 3, 2024
@xuri
Copy link
Member

xuri commented Apr 3, 2024

Thanks for your issue. I have change the data type for the ConditionalFormatOptions structure field Format as a pointer to resolve this problem. Please upgrade to the master branch code, and this breaking change will be released in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed This issue can be reproduced
Projects
v2.9.0
Features
Development

No branches or pull requests

2 participants