Make copy of stringified value when displaying properties with Object values #111
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.
Fixes a bug where Component properties with Object values would get turned into strings due to the use of
juce::TextPropertyComponent
and shared values.To reproduce:
juce::Component
.juce::ReferenceCountedObject
, e.g. ajuce::DynamicObject
)."Object 0xabc"
This is due to how
juce::TextPropertyComponent
usesjuce::Value
- when it goes to display the value, it sets the text of it'sjuce::Label
to the stringified version of the object. This causes a listener-change callback in thejuce::Value
that the label refers to which causes the underlyingjuce::var
, originally in the component's properties list, to also be turned into a string.The proposed solution here is to simply make a copy of the stringified value if the value is an object type.