@@ -341,6 +341,7 @@ NFSubstitution::makeSubstitution(int32_t pos,
341
341
const UnicodeString& description,
342
342
UErrorCode& status)
343
343
{
344
+ if (U_FAILURE (status)) return nullptr ;
344
345
// if the description is empty, return a NullSubstitution
345
346
if (description.length () == 0 ) {
346
347
return nullptr ;
@@ -427,6 +428,7 @@ NFSubstitution::NFSubstitution(int32_t _pos,
427
428
UErrorCode& status)
428
429
: pos(_pos), ruleSet(nullptr ), numberFormat(nullptr )
429
430
{
431
+ if (U_FAILURE (status)) return ;
430
432
// the description should begin and end with the same character.
431
433
// If it doesn't that's a syntax error. Otherwise,
432
434
// makeSubstitution() was the only thing that needed to know
@@ -592,6 +594,7 @@ NFSubstitution::toString(UnicodeString& text) const
592
594
void
593
595
NFSubstitution::doSubstitution (int64_t number, UnicodeString& toInsertInto, int32_t _pos, int32_t recursionCount, UErrorCode& status) const
594
596
{
597
+ if (U_FAILURE (status)) return ;
595
598
if (ruleSet != nullptr ) {
596
599
// Perform a transformation on the number that is dependent
597
600
// on the type of substitution this is, then just call its
@@ -634,6 +637,7 @@ NFSubstitution::doSubstitution(int64_t number, UnicodeString& toInsertInto, int3
634
637
*/
635
638
void
636
639
NFSubstitution::doSubstitution (double number, UnicodeString& toInsertInto, int32_t _pos, int32_t recursionCount, UErrorCode& status) const {
640
+ if (U_FAILURE (status)) return ;
637
641
// perform a transformation on the number being formatted that
638
642
// is dependent on the type of substitution this is
639
643
double numberToFormat = transformNumber (number);
@@ -850,6 +854,7 @@ ModulusSubstitution::ModulusSubstitution(int32_t _pos,
850
854
, divisor(rule->getDivisor ())
851
855
, ruleToUse(nullptr )
852
856
{
857
+ if (U_FAILURE (status)) return ;
853
858
// the owning rule's divisor controls the behavior of this
854
859
// substitution: rather than keeping a backpointer to the rule,
855
860
// we keep a copy of the divisor
@@ -893,6 +898,7 @@ bool ModulusSubstitution::operator==(const NFSubstitution& rhs) const
893
898
void
894
899
ModulusSubstitution::doSubstitution (int64_t number, UnicodeString& toInsertInto, int32_t _pos, int32_t recursionCount, UErrorCode& status) const
895
900
{
901
+ if (U_FAILURE (status)) return ;
896
902
// if this isn't a >>> substitution, just use the inherited version
897
903
// of this function (which uses either a rule set or a DecimalFormat
898
904
// to format its substitution value)
@@ -918,6 +924,7 @@ ModulusSubstitution::doSubstitution(int64_t number, UnicodeString& toInsertInto,
918
924
void
919
925
ModulusSubstitution::doSubstitution (double number, UnicodeString& toInsertInto, int32_t _pos, int32_t recursionCount, UErrorCode& status) const
920
926
{
927
+ if (U_FAILURE (status)) return ;
921
928
// if this isn't a >>> substitution, just use the inherited version
922
929
// of this function (which uses either a rule set or a DecimalFormat
923
930
// to format its substitution value)
@@ -1026,6 +1033,7 @@ FractionalPartSubstitution::FractionalPartSubstitution(int32_t _pos,
1026
1033
, useSpaces(true )
1027
1034
1028
1035
{
1036
+ if (U_FAILURE (status)) return ;
1029
1037
// akk, ruleSet can change in superclass constructor
1030
1038
if (0 == description.compare (gGreaterGreaterThan , 2 ) ||
1031
1039
0 == description.compare (gGreaterGreaterGreaterThan , 3 ) ||
@@ -1058,6 +1066,7 @@ void
1058
1066
FractionalPartSubstitution::doSubstitution (double number, UnicodeString& toInsertInto,
1059
1067
int32_t _pos, int32_t recursionCount, UErrorCode& status) const
1060
1068
{
1069
+ if (U_FAILURE (status)) return ;
1061
1070
// if we're not in "byDigits" mode, just use the inherited
1062
1071
// doSubstitution() routine
1063
1072
if (!byDigits) {
@@ -1233,6 +1242,7 @@ UOBJECT_DEFINE_RTTI_IMPLEMENTATION(AbsoluteValueSubstitution)
1233
1242
1234
1243
void
1235
1244
NumeratorSubstitution::doSubstitution (double number, UnicodeString& toInsertInto, int32_t apos, int32_t recursionCount, UErrorCode& status) const {
1245
+ if (U_FAILURE (status)) return ;
1236
1246
// perform a transformation on the number being formatted that
1237
1247
// is dependent on the type of substitution this is
1238
1248
0 commit comments