88#define LOCTEXT_NAMESPACE " SML"
99
1010FString UConfigPropertySection::DescribeValue_Implementation () const {
11- const FString ElementsString = FString::JoinBy (SectionProperties, TEXT (" , " ), [this ](const TPair<FString, UConfigProperty* >& Property) {
11+ const FString ElementsString = FString::JoinBy (SectionProperties, TEXT (" , " ), [this ](const TPair<FString, TObjectPtr< UConfigProperty> >& Property) {
1212 return FString::Printf (TEXT (" %s = %s" ), *Property.Key , *Property.Value ->DescribeValue ());
1313 });
1414 return FString::Printf (TEXT (" [section %s]" ), *ElementsString);
1515}
1616
1717URawFormatValue* UConfigPropertySection::Serialize_Implementation (UObject* Outer) const {
1818 URawFormatValueObject* ObjectValue = NewObject<URawFormatValueObject>(Outer);
19- for (const TPair<FString, UConfigProperty* >& Property : SectionProperties) {
19+ for (const TPair<FString, TObjectPtr< UConfigProperty> >& Property : SectionProperties) {
2020 if (Property.Value != NULL ) {
2121 URawFormatValue* RawChildValue = Property.Value ->Serialize (ObjectValue);
2222 if (RawChildValue != NULL ) {
@@ -30,7 +30,7 @@ URawFormatValue* UConfigPropertySection::Serialize_Implementation(UObject* Outer
3030void UConfigPropertySection::Deserialize_Implementation (const URawFormatValue* Value) {
3131 const URawFormatValueObject* ObjectValue = Cast<URawFormatValueObject>(Value);
3232 if (ObjectValue != NULL ) {
33- for (const TPair<FString, UConfigProperty* >& Property : SectionProperties) {
33+ for (const TPair<FString, TObjectPtr< UConfigProperty> >& Property : SectionProperties) {
3434 const URawFormatValue* RawChildValue = ObjectValue->GetValue (Property.Key );
3535 if (Property.Value != NULL && RawChildValue != NULL ) {
3636 if (!bAllowUserReset || !bParentSectionAllowsUserReset) {
@@ -43,7 +43,7 @@ void UConfigPropertySection::Deserialize_Implementation(const URawFormatValue* V
4343}
4444
4545void UConfigPropertySection::FillConfigStructSelf (const FReflectedObject& ReflectedObject) const {
46- for (const TPair<FString, UConfigProperty* >& Property : SectionProperties) {
46+ for (const TPair<FString, TObjectPtr< UConfigProperty> >& Property : SectionProperties) {
4747 if (Property.Value != NULL ) {
4848 Property.Value ->FillConfigStruct (ReflectedObject, Property.Key );
4949 }
@@ -66,7 +66,7 @@ bool IsValidConfigIdentifier(const FString& Identifier) {
6666#if WITH_EDITOR
6767EDataValidationResult UConfigPropertySection::IsDataValid (TArray<FText>& ValidationErrors) {
6868 EDataValidationResult ValidationResult = EDataValidationResult::Valid;
69- for (const TPair<FString, UConfigProperty* >& Pair : SectionProperties) {
69+ for (const TPair<FString, TObjectPtr< UConfigProperty> >& Pair : SectionProperties) {
7070 if (!IsValid (Pair.Value )) {
7171 ValidationErrors.Add (FText::Format (LOCTEXT (" ConfigSectionValueNull" ,
7272 " Value '{0}' inside of the Config Section '{1}' is NULL." ),
@@ -102,7 +102,7 @@ bool UConfigPropertySection::ResetToDefault_Implementation() {
102102 return false ;
103103 }
104104 bool bAnyReset = (SectionProperties.Num () == 0 );
105- for (const TPair<FString, UConfigProperty* >& Pair : SectionProperties) {
105+ for (const TPair<FString, TObjectPtr< UConfigProperty> >& Pair : SectionProperties) {
106106 UConfigProperty* Property = Pair.Value ;
107107 if (Property) {
108108 bool bResetThisOne = Property->ResetToDefault ();
@@ -116,7 +116,7 @@ bool UConfigPropertySection::ResetToDefault_Implementation() {
116116}
117117
118118bool UConfigPropertySection::IsSetToDefaultValue_Implementation () const {
119- for (const TPair<FString, UConfigProperty* >& Pair : SectionProperties) {
119+ for (const TPair<FString, TObjectPtr< UConfigProperty> >& Pair : SectionProperties) {
120120 UConfigProperty* Property = Pair.Value ;
121121 if (IsValid (Property) && !Property->IsSetToDefaultValue ()) {
122122 return false ;
@@ -126,7 +126,7 @@ bool UConfigPropertySection::IsSetToDefaultValue_Implementation() const {
126126}
127127
128128bool UConfigPropertySection::HasResettableChildProperty (bool bIncludeHidden = true ) const {
129- for (const TPair<FString, UConfigProperty* >& Pair : SectionProperties) {
129+ for (const TPair<FString, TObjectPtr< UConfigProperty> >& Pair : SectionProperties) {
130130 UConfigProperty* Property = Pair.Value ;
131131 if (!IsValid (Property)) {
132132 continue ;
@@ -152,7 +152,7 @@ void UConfigPropertySection::HandleMarkDirty_Implementation() {
152152FConfigVariableDescriptor UConfigPropertySection::CreatePropertyDescriptor_Implementation (
153153 UConfigGenerationContext* Context, const FString& OuterPath) const {
154154 UConfigGeneratedStruct* GeneratedStruct = Context->CreateNewConfigStruct (OuterPath);
155- for (const TPair<FString, UConfigProperty* >& Property : SectionProperties) {
155+ for (const TPair<FString, TObjectPtr< UConfigProperty> >& Property : SectionProperties) {
156156 const FString InnerPath = FString::Printf (TEXT (" %s_%s" ), *OuterPath, *Property.Key );
157157 const FConfigVariableDescriptor Descriptor = Property.Value ->CreatePropertyDescriptor (Context, InnerPath);
158158 GeneratedStruct->AddConfigVariable (Descriptor, Property.Key );
0 commit comments