Browse Source

Fix json printing failing to print `MutableText`

This is regarding an artifact left after text refactoring: when printing
JSON text values, they were being converted into `Text`, which after
refactoring always basically erased `MutableText` value, emptying it.
pull/8/head
Anton Tarasenko 2 years ago
parent
commit
2a14a2a0d1
  1. 4
      sources/Text/JSON/JSONAPI.uc

4
sources/Text/JSON/JSONAPI.uc

@ -1092,7 +1092,7 @@ public final function MutableText Print(AcediaObject toPrint)
} }
if ( toPrint.class == class'Text' if ( toPrint.class == class'Text'
|| toPrint.class == class'MutableText') { || toPrint.class == class'MutableText') {
return DisplayText(Text(toPrint)); return DisplayText(BaseText(toPrint));
} }
if (toPrint.class == class'DynamicArray') { if (toPrint.class == class'DynamicArray') {
return PrintArray(DynamicArray(toPrint)); return PrintArray(DynamicArray(toPrint));
@ -1530,7 +1530,7 @@ private final function MutableText PrettyPrintWithIndent(
if ( toPrint.class == class'Text' if ( toPrint.class == class'Text'
|| toPrint.class == class'MutableText') || toPrint.class == class'MutableText')
{ {
return DisplayText(Text(toPrint)).ChangeFormatting(jString); return DisplayText(BaseText(toPrint)).ChangeFormatting(jString);
} }
if (toPrint.class == class'DynamicArray') if (toPrint.class == class'DynamicArray')
{ {

Loading…
Cancel
Save