[Helper] Remove default value on OptionGroup #5605
Closed
hugtalbot wants to merge 2 commits into
Closed
Conversation
bakpaul
reviewed
Jul 10, 2025
| void setItemName( unsigned int id_item, const std::string& name ); | ||
|
|
||
| ///Get the vector of names available | ||
| type::vector<std::string> getItemNames(); |
Contributor
There was a problem hiding this comment.
I don't see any usage of this newly introduced method.
| ////////////////////////////////////////////////////////////////////////////////////////////////////// | ||
| OptionsGroup::OptionsGroup() : textItems() | ||
| { | ||
| selectedItem=0; |
Contributor
There was a problem hiding this comment.
This is certainly breaking. Even if not set here, selectedItem will have a default value. Might as well control it no ? Or add an internal mechanism that track if the optionGroup has been set at least once, to know if we can trust this attribute.
Contributor
There was a problem hiding this comment.
I agree. selectedItem will have a value if you define it or not. I don't see how it solves your problem. Could you imagine a fix in the CollisionResponse class instead?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #5604
It seems weird to me that the first entry is by default the selected one.
This was problematic in the case of CollisionReponse
responsedata field :parseusing all available response methodHere is my hacky solution. To be discussed :)
Real diff : cce4867
By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).
Reviewers will merge this pull-request only if