diff --git a/sources/Text/BaseText.uc b/sources/Text/BaseText.uc index 23ff3bf..90e7b48 100644 --- a/sources/Text/BaseText.uc +++ b/sources/Text/BaseText.uc @@ -198,65 +198,6 @@ protected final function ReformatRange( NormalizeFormatting(); } -/** - * Static method for creating an immutable `Text` object from (plain) `string`. - * - * It is preferred to use `TextAPI` methods for creating `Text` instances. - * - * @param source Plain `string` to convert into `Text`. - * @return `Text` instance (guaranteed to be not `none`) that stores contents - * of `source` if treated as a plain `string`. - */ -public static final function Text ConstFromPlainString(string source) -{ - local MutableText builder; - local Text result; - builder = MutableText(__().memory.Allocate(class'MutableText')); - result = builder.AppendString(source).Copy(); - builder.FreeSelf(); - return result; -} - -/** - * Static method for creating an immutable `Text` object from - * (colored) `string`. - * - * It is preferred to use `TextAPI` methods for creating `Text` instances. - * - * @param source Colored `string` to convert into `Text`. - * @return `Text` instance (guaranteed to be not `none`) that stores contents - * of `source` if treated as a colored `string`. - */ -public static final function Text ConstFromColoredString(string source) -{ - local MutableText builder; - local Text result; - builder = MutableText(__().memory.Allocate(class'MutableText')); - result = builder.AppendColoredString(source).Copy(); - builder.FreeSelf(); - return result; -} - -/** - * Static method for creating an immutable `Text` object from - * (formatted) `string`. - * - * It is preferred to use `TextAPI` methods for creating `Text` instances. - * - * @param source Formatted `string` to convert into `Text`. - * @return `Text` instance (guaranteed to be not `none`) that stores contents - * of `source` if treated as a formatted `string`. - */ -public static final function Text ConstFromFormattedString(string source) -{ - local MutableText builder; - local Text result; - builder = MutableText(__().memory.Allocate(class'MutableText')); - result = builder.AppendFormattedString(source).Copy(); - builder.FreeSelf(); - return result; -} - /** * Makes an immutable copy (`class'Text'`) of the caller `BaseText`. * diff --git a/sources/Text/Tests/TEST_Text.uc b/sources/Text/Tests/TEST_Text.uc index 46af352..8b0502c 100644 Binary files a/sources/Text/Tests/TEST_Text.uc and b/sources/Text/Tests/TEST_Text.uc differ diff --git a/sources/Text/TextAPI.uc b/sources/Text/TextAPI.uc index 0fc75da..e356db2 100644 --- a/sources/Text/TextAPI.uc +++ b/sources/Text/TextAPI.uc @@ -665,7 +665,12 @@ public final function MutableText Empty() */ public final function Text FromString(string source) { - return class'Text'.static.ConstFromPlainString(source); + local MutableText builder; + local Text result; + builder = MutableText(_.memory.Allocate(class'MutableText')); + result = builder.AppendString(source).Copy(); + builder.FreeSelf(); + return result; } /** @@ -695,7 +700,12 @@ public final function MutableText FromStringM(string source) */ public final function Text FromColoredString(string source) { - return class'Text'.static.ConstFromColoredString(source); + local MutableText builder; + local Text result; + builder = MutableText(_.memory.Allocate(class'MutableText')); + result = builder.AppendColoredString(source).Copy(); + builder.FreeSelf(); + return result; } /** @@ -725,7 +735,12 @@ public final function MutableText FromColoredStringM(string source) */ public final function Text FromFormattedString(string source) { - return class'Text'.static.ConstFromFormattedString(source); + local MutableText builder; + local Text result; + builder = MutableText(_.memory.Allocate(class'MutableText')); + result = builder.AppendFormattedString(source).Copy(); + builder.FreeSelf(); + return result; } /**