* BCountry : add error checking in case the system runs out of memory, cleanup function prototypes (we don't need virtual, this was a leftover of
OpenTracker days) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@37697 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
+19
-17
@@ -41,41 +41,43 @@ class BCountry {
|
|||||||
BCountry& operator=(const BCountry& other);
|
BCountry& operator=(const BCountry& other);
|
||||||
virtual ~BCountry();
|
virtual ~BCountry();
|
||||||
|
|
||||||
virtual bool Name(BString&) const;
|
bool Name(BString&) const;
|
||||||
bool LocaleName(BString&) const;
|
bool LocaleName(BString&) const;
|
||||||
const char* Code() const;
|
const char* Code() const;
|
||||||
status_t GetIcon(BBitmap* result);
|
status_t GetIcon(BBitmap* result);
|
||||||
|
|
||||||
const char* GetString(uint32 id) const;
|
const char* GetString(uint32 id) const;
|
||||||
|
|
||||||
// date & time
|
// Date
|
||||||
|
|
||||||
virtual void FormatDate(char* string, size_t maxSize, time_t time,
|
status_t FormatDate(char* string, size_t maxSize, time_t time,
|
||||||
bool longFormat);
|
bool longFormat);
|
||||||
virtual void FormatDate(BString* string, time_t time,
|
status_t FormatDate(BString* string, time_t time,
|
||||||
bool longFormat);
|
bool longFormat);
|
||||||
status_t FormatDate(BString* string, int*& fieldPositions,
|
status_t FormatDate(BString* string, int*& fieldPositions,
|
||||||
int& fieldCount, time_t time, bool longFormat);
|
int& fieldCount, time_t time, bool longFormat);
|
||||||
|
status_t DateFields(BDateElement*& fields, int& fieldCount,
|
||||||
virtual void FormatTime(char* string, size_t maxSize, time_t time,
|
|
||||||
bool longFormat);
|
bool longFormat);
|
||||||
virtual void FormatTime(BString* string, time_t time,
|
status_t DateFormat(BString&, bool longFormat);
|
||||||
|
status_t SetDateFormat(const char* formatString,
|
||||||
|
bool longFormat = true);
|
||||||
|
|
||||||
|
int StartOfWeek();
|
||||||
|
|
||||||
|
// Time
|
||||||
|
|
||||||
|
status_t FormatTime(char* string, size_t maxSize, time_t time,
|
||||||
|
bool longFormat);
|
||||||
|
status_t FormatTime(BString* string, time_t time,
|
||||||
bool longFormat);
|
bool longFormat);
|
||||||
status_t FormatTime(BString* string, int*& fieldPositions,
|
status_t FormatTime(BString* string, int*& fieldPositions,
|
||||||
int& fieldCount, time_t time, bool longFormat);
|
int& fieldCount, time_t time, bool longFormat);
|
||||||
status_t TimeFields(BDateElement*& fields, int& fieldCount,
|
status_t TimeFields(BDateElement*& fields, int& fieldCount,
|
||||||
bool longFormat);
|
bool longFormat);
|
||||||
status_t DateFields(BDateElement*& fields, int& fieldCount,
|
|
||||||
bool longFormat);
|
|
||||||
|
|
||||||
bool DateFormat(BString&, bool longFormat);
|
status_t SetTimeFormat(const char* formatString,
|
||||||
void SetDateFormat(const char* formatString,
|
|
||||||
bool longFormat = true);
|
bool longFormat = true);
|
||||||
void SetTimeFormat(const char* formatString,
|
status_t TimeFormat(BString&, bool longFormat);
|
||||||
bool longFormat = true);
|
|
||||||
bool TimeFormat(BString&, bool longFormat);
|
|
||||||
|
|
||||||
int StartOfWeek();
|
|
||||||
|
|
||||||
// numbers
|
// numbers
|
||||||
|
|
||||||
|
|||||||
+170
-116
@@ -179,7 +179,7 @@ BCountry::GetIcon(BBitmap* result)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark - Date and Time
|
// #pragma mark - Date
|
||||||
|
|
||||||
|
|
||||||
DateFormat*
|
DateFormat*
|
||||||
@@ -220,28 +220,36 @@ BCountry::TimeFormatter(bool longFormat)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
status_t
|
||||||
BCountry::FormatDate(char* string, size_t maxSize, time_t time, bool longFormat)
|
BCountry::FormatDate(char* string, size_t maxSize, time_t time, bool longFormat)
|
||||||
{
|
{
|
||||||
BString fullString;
|
BString fullString;
|
||||||
FormatDate(&fullString, time, longFormat);
|
status_t returnCode;
|
||||||
strncpy(string, fullString.String(), maxSize);
|
returnCode = FormatDate(&fullString, time, longFormat);
|
||||||
|
if (returnCode == B_OK)
|
||||||
|
strncpy(string, fullString.String(), maxSize);
|
||||||
|
return returnCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
status_t
|
||||||
BCountry::FormatDate(BString *string, time_t time, bool longFormat)
|
BCountry::FormatDate(BString *string, time_t time, bool longFormat)
|
||||||
{
|
{
|
||||||
// TODO: ICU allows for 4 different levels of expansion :
|
// TODO: ICU allows for 4 different levels of expansion :
|
||||||
// short, medium, long, and full. Our bool parameter is not enough...
|
// short, medium, long, and full. Our bool parameter is not enough...
|
||||||
|
ICU_VERSION::DateFormat* dateFormatter = DateFormatter(longFormat);
|
||||||
|
if (dateFormatter == NULL)
|
||||||
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
UnicodeString ICUString;
|
UnicodeString ICUString;
|
||||||
ICUString = DateFormatter(longFormat)->format((UDate)time * 1000,
|
ICUString = dateFormatter->format((UDate)time * 1000, ICUString);
|
||||||
ICUString);
|
|
||||||
|
|
||||||
string->Truncate(0);
|
string->Truncate(0);
|
||||||
BStringByteSink stringConverter(string);
|
BStringByteSink stringConverter(string);
|
||||||
|
|
||||||
ICUString.toUTF8(stringConverter);
|
ICUString.toUTF8(stringConverter);
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -249,6 +257,10 @@ status_t
|
|||||||
BCountry::FormatDate(BString* string, int*& fieldPositions, int& fieldCount,
|
BCountry::FormatDate(BString* string, int*& fieldPositions, int& fieldCount,
|
||||||
time_t time, bool longFormat)
|
time_t time, bool longFormat)
|
||||||
{
|
{
|
||||||
|
ICU_VERSION::DateFormat* dateFormatter = DateFormatter(longFormat);
|
||||||
|
if (dateFormatter == NULL)
|
||||||
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
fieldPositions = NULL;
|
fieldPositions = NULL;
|
||||||
UErrorCode error = U_ZERO_ERROR;
|
UErrorCode error = U_ZERO_ERROR;
|
||||||
ICU_VERSION::FieldPositionIterator positionIterator;
|
ICU_VERSION::FieldPositionIterator positionIterator;
|
||||||
@@ -282,28 +294,142 @@ BCountry::FormatDate(BString* string, int*& fieldPositions, int& fieldCount,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
status_t
|
||||||
BCountry::FormatTime(char* string, size_t maxSize, time_t time, bool longFormat)
|
BCountry::DateFormat(BString& format, bool longFormat)
|
||||||
{
|
{
|
||||||
BString fullString;
|
ICU_VERSION::DateFormat* dateFormatter = DateFormatter(longFormat);
|
||||||
FormatTime(&fullString, time, longFormat);
|
if (dateFormatter == NULL)
|
||||||
strncpy(string, fullString.String(), maxSize);
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
|
SimpleDateFormat* dateFormatterImpl
|
||||||
|
= static_cast<SimpleDateFormat*>(dateFormatter);
|
||||||
|
|
||||||
|
UnicodeString ICUString;
|
||||||
|
ICUString = dateFormatterImpl->toPattern(ICUString);
|
||||||
|
|
||||||
|
BStringByteSink stringConverter(&format);
|
||||||
|
|
||||||
|
ICUString.toUTF8(stringConverter);
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
status_t
|
||||||
|
BCountry::SetDateFormat(const char* formatString, bool longFormat)
|
||||||
|
{
|
||||||
|
ICU_VERSION::DateFormat* dateFormatter = DateFormatter(longFormat);
|
||||||
|
if (dateFormatter == NULL)
|
||||||
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
|
SimpleDateFormat* dateFormatterImpl
|
||||||
|
= static_cast<SimpleDateFormat*>(dateFormatter);
|
||||||
|
|
||||||
|
UnicodeString pattern(formatString);
|
||||||
|
dateFormatterImpl->applyPattern(pattern);
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
BCountry::DateFields(BDateElement*& fields, int& fieldCount, bool longFormat)
|
||||||
|
{
|
||||||
|
ICU_VERSION::DateFormat* dateFormatter = DateFormatter(longFormat);
|
||||||
|
if (dateFormatter == NULL)
|
||||||
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
|
fields = NULL;
|
||||||
|
UErrorCode error = U_ZERO_ERROR;
|
||||||
|
ICU_VERSION::FieldPositionIterator positionIterator;
|
||||||
|
UnicodeString ICUString;
|
||||||
|
time_t now;
|
||||||
|
ICUString = dateFormatter->format((UDate)time(&now) * 1000, ICUString,
|
||||||
|
&positionIterator, error);
|
||||||
|
|
||||||
|
if (error != U_ZERO_ERROR)
|
||||||
|
return B_ERROR;
|
||||||
|
|
||||||
|
ICU_VERSION::FieldPosition field;
|
||||||
|
std::vector<int> fieldPosStorage;
|
||||||
|
fieldCount = 0;
|
||||||
|
while (positionIterator.next(field)) {
|
||||||
|
fieldPosStorage.push_back(field.getField());
|
||||||
|
fieldCount ++;
|
||||||
|
}
|
||||||
|
|
||||||
|
fields = (BDateElement*) malloc(fieldCount * sizeof(BDateElement));
|
||||||
|
|
||||||
|
for (int i = 0 ; i < fieldCount ; i++ ) {
|
||||||
|
switch (fieldPosStorage[i]) {
|
||||||
|
case UDAT_YEAR_FIELD:
|
||||||
|
fields[i] = B_DATE_ELEMENT_YEAR;
|
||||||
|
break;
|
||||||
|
case UDAT_MONTH_FIELD:
|
||||||
|
fields[i] = B_DATE_ELEMENT_MONTH;
|
||||||
|
break;
|
||||||
|
case UDAT_DATE_FIELD:
|
||||||
|
fields[i] = B_DATE_ELEMENT_DAY;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
fields[i] = B_DATE_ELEMENT_INVALID;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int
|
||||||
|
BCountry::StartOfWeek()
|
||||||
|
{
|
||||||
|
UErrorCode err = U_ZERO_ERROR;
|
||||||
|
Calendar* c = Calendar::createInstance(*fICULocale, err);
|
||||||
|
|
||||||
|
if (err == U_ZERO_ERROR && c->getFirstDayOfWeek(err) == UCAL_SUNDAY) {
|
||||||
|
delete c;
|
||||||
|
return B_WEEK_START_SUNDAY;
|
||||||
|
} else {
|
||||||
|
delete c;
|
||||||
|
// Might be another day, but BeAPI will not handle it
|
||||||
|
return B_WEEK_START_MONDAY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// #pragma mark - Time
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
BCountry::FormatTime(char* string, size_t maxSize, time_t time, bool longFormat)
|
||||||
|
{
|
||||||
|
BString fullString;
|
||||||
|
status_t returnCode = FormatTime(&fullString, time, longFormat);
|
||||||
|
if (returnCode == B_OK)
|
||||||
|
strncpy(string, fullString.String(), maxSize);
|
||||||
|
return returnCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
BCountry::FormatTime(BString* string, time_t time, bool longFormat)
|
BCountry::FormatTime(BString* string, time_t time, bool longFormat)
|
||||||
{
|
{
|
||||||
// TODO: ICU allows for 4 different levels of expansion :
|
// TODO: ICU allows for 4 different levels of expansion :
|
||||||
// short, medium, long, and full. Our bool parameter is not enough...
|
// short, medium, long, and full. Our bool parameter is not enough...
|
||||||
|
ICU_VERSION::DateFormat* timeFormatter = TimeFormatter(longFormat);
|
||||||
|
if (timeFormatter == NULL)
|
||||||
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
UnicodeString ICUString;
|
UnicodeString ICUString;
|
||||||
ICUString = TimeFormatter(longFormat)->format((UDate)time * 1000,
|
ICUString = timeFormatter->format((UDate)time * 1000, ICUString);
|
||||||
ICUString);
|
|
||||||
|
|
||||||
string->Truncate(0);
|
string->Truncate(0);
|
||||||
BStringByteSink stringConverter(string);
|
BStringByteSink stringConverter(string);
|
||||||
|
|
||||||
ICUString.toUTF8(stringConverter);
|
ICUString.toUTF8(stringConverter);
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -311,11 +437,15 @@ status_t
|
|||||||
BCountry::FormatTime(BString* string, int*& fieldPositions, int& fieldCount,
|
BCountry::FormatTime(BString* string, int*& fieldPositions, int& fieldCount,
|
||||||
time_t time, bool longFormat)
|
time_t time, bool longFormat)
|
||||||
{
|
{
|
||||||
|
ICU_VERSION::DateFormat* timeFormatter = TimeFormatter(longFormat);
|
||||||
|
if (timeFormatter == NULL)
|
||||||
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
fieldPositions = NULL;
|
fieldPositions = NULL;
|
||||||
UErrorCode error = U_ZERO_ERROR;
|
UErrorCode error = U_ZERO_ERROR;
|
||||||
ICU_VERSION::FieldPositionIterator positionIterator;
|
ICU_VERSION::FieldPositionIterator positionIterator;
|
||||||
UnicodeString ICUString;
|
UnicodeString ICUString;
|
||||||
ICUString = TimeFormatter(longFormat)->format((UDate)time * 1000, ICUString,
|
ICUString = timeFormatter->format((UDate)time * 1000, ICUString,
|
||||||
&positionIterator, error);
|
&positionIterator, error);
|
||||||
|
|
||||||
if (error != U_ZERO_ERROR)
|
if (error != U_ZERO_ERROR)
|
||||||
@@ -347,13 +477,17 @@ BCountry::FormatTime(BString* string, int*& fieldPositions, int& fieldCount,
|
|||||||
status_t
|
status_t
|
||||||
BCountry::TimeFields(BDateElement*& fields, int& fieldCount, bool longFormat)
|
BCountry::TimeFields(BDateElement*& fields, int& fieldCount, bool longFormat)
|
||||||
{
|
{
|
||||||
|
ICU_VERSION::DateFormat* timeFormatter = TimeFormatter(longFormat);
|
||||||
|
if (timeFormatter == NULL)
|
||||||
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
fields = NULL;
|
fields = NULL;
|
||||||
UErrorCode error = U_ZERO_ERROR;
|
UErrorCode error = U_ZERO_ERROR;
|
||||||
ICU_VERSION::FieldPositionIterator positionIterator;
|
ICU_VERSION::FieldPositionIterator positionIterator;
|
||||||
UnicodeString ICUString;
|
UnicodeString ICUString;
|
||||||
time_t now;
|
time_t now;
|
||||||
ICUString = TimeFormatter(longFormat)->format((UDate)time(&now) * 1000,
|
ICUString = timeFormatter->format((UDate)time(&now) * 1000, ICUString,
|
||||||
ICUString, &positionIterator, error);
|
&positionIterator, error);
|
||||||
|
|
||||||
if (error != U_ZERO_ERROR)
|
if (error != U_ZERO_ERROR)
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
@@ -396,94 +530,31 @@ BCountry::TimeFields(BDateElement*& fields, int& fieldCount, bool longFormat)
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
BCountry::DateFields(BDateElement*& fields, int& fieldCount, bool longFormat)
|
BCountry::SetTimeFormat(const char* formatString, bool longFormat)
|
||||||
{
|
{
|
||||||
fields = NULL;
|
ICU_VERSION::DateFormat* timeFormatter = TimeFormatter(longFormat);
|
||||||
UErrorCode error = U_ZERO_ERROR;
|
if (timeFormatter == NULL)
|
||||||
ICU_VERSION::FieldPositionIterator positionIterator;
|
return B_NO_MEMORY;
|
||||||
UnicodeString ICUString;
|
|
||||||
time_t now;
|
|
||||||
ICUString = DateFormatter(longFormat)->format((UDate)time(&now) * 1000,
|
|
||||||
ICUString, &positionIterator, error);
|
|
||||||
|
|
||||||
if (error != U_ZERO_ERROR)
|
SimpleDateFormat* dateFormatterImpl
|
||||||
return B_ERROR;
|
= static_cast<SimpleDateFormat*>(timeFormatter);
|
||||||
|
|
||||||
ICU_VERSION::FieldPosition field;
|
UnicodeString pattern(formatString);
|
||||||
std::vector<int> fieldPosStorage;
|
dateFormatterImpl->applyPattern(pattern);
|
||||||
fieldCount = 0;
|
|
||||||
while (positionIterator.next(field)) {
|
|
||||||
fieldPosStorage.push_back(field.getField());
|
|
||||||
fieldCount ++;
|
|
||||||
}
|
|
||||||
|
|
||||||
fields = (BDateElement*) malloc(fieldCount * sizeof(BDateElement));
|
|
||||||
|
|
||||||
for (int i = 0 ; i < fieldCount ; i++ ) {
|
|
||||||
switch (fieldPosStorage[i]) {
|
|
||||||
case UDAT_YEAR_FIELD:
|
|
||||||
fields[i] = B_DATE_ELEMENT_YEAR;
|
|
||||||
break;
|
|
||||||
case UDAT_MONTH_FIELD:
|
|
||||||
fields[i] = B_DATE_ELEMENT_MONTH;
|
|
||||||
break;
|
|
||||||
case UDAT_DATE_FIELD:
|
|
||||||
fields[i] = B_DATE_ELEMENT_DAY;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
fields[i] = B_DATE_ELEMENT_INVALID;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
status_t
|
||||||
BCountry::DateFormat(BString& format, bool longFormat)
|
|
||||||
{
|
|
||||||
SimpleDateFormat* dateFormatterImpl
|
|
||||||
= static_cast<SimpleDateFormat*>(DateFormatter(longFormat));
|
|
||||||
|
|
||||||
UnicodeString ICUString;
|
|
||||||
ICUString = dateFormatterImpl->toPattern(ICUString);
|
|
||||||
|
|
||||||
BStringByteSink stringConverter(&format);
|
|
||||||
|
|
||||||
ICUString.toUTF8(stringConverter);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
BCountry::SetDateFormat(const char* formatString, bool longFormat)
|
|
||||||
{
|
|
||||||
SimpleDateFormat* dateFormatterImpl
|
|
||||||
= static_cast<SimpleDateFormat*>(DateFormatter(longFormat));
|
|
||||||
|
|
||||||
UnicodeString pattern(formatString);
|
|
||||||
dateFormatterImpl->applyPattern(pattern);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
BCountry::SetTimeFormat(const char* formatString, bool longFormat)
|
|
||||||
{
|
|
||||||
SimpleDateFormat* dateFormatterImpl
|
|
||||||
= static_cast<SimpleDateFormat*>(DateFormatter(longFormat));
|
|
||||||
|
|
||||||
UnicodeString pattern(formatString);
|
|
||||||
dateFormatterImpl->applyPattern(pattern);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool
|
|
||||||
BCountry::TimeFormat(BString& format, bool longFormat)
|
BCountry::TimeFormat(BString& format, bool longFormat)
|
||||||
{
|
{
|
||||||
|
ICU_VERSION::DateFormat* timeFormatter = TimeFormatter(longFormat);
|
||||||
|
if (timeFormatter == NULL)
|
||||||
|
return B_NO_MEMORY;
|
||||||
|
|
||||||
SimpleDateFormat* dateFormatterImpl
|
SimpleDateFormat* dateFormatterImpl
|
||||||
= static_cast<SimpleDateFormat*>(DateFormatter(longFormat));
|
= static_cast<SimpleDateFormat*>(timeFormatter);
|
||||||
|
|
||||||
UnicodeString ICUString;
|
UnicodeString ICUString;
|
||||||
ICUString = dateFormatterImpl->toPattern(ICUString);
|
ICUString = dateFormatterImpl->toPattern(ICUString);
|
||||||
@@ -492,24 +563,7 @@ BCountry::TimeFormat(BString& format, bool longFormat)
|
|||||||
|
|
||||||
ICUString.toUTF8(stringConverter);
|
ICUString.toUTF8(stringConverter);
|
||||||
|
|
||||||
return true;
|
return B_OK;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
BCountry::StartOfWeek()
|
|
||||||
{
|
|
||||||
UErrorCode err = U_ZERO_ERROR;
|
|
||||||
Calendar* c = Calendar::createInstance(*fICULocale, err);
|
|
||||||
|
|
||||||
if (err == U_ZERO_ERROR && c->getFirstDayOfWeek(err) == UCAL_SUNDAY) {
|
|
||||||
delete c;
|
|
||||||
return B_WEEK_START_SUNDAY;
|
|
||||||
} else {
|
|
||||||
delete c;
|
|
||||||
// Might be another day, but BeAPI will not handle it
|
|
||||||
return B_WEEK_START_MONDAY;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -533,8 +587,8 @@ BCountry::FormatNumber(BString* string, double value)
|
|||||||
= NumberFormat::createInstance(*fICULocale, NumberFormat::kNumberStyle,
|
= NumberFormat::createInstance(*fICULocale, NumberFormat::kNumberStyle,
|
||||||
err);
|
err);
|
||||||
|
|
||||||
// Warning: we're returning an ICU error here but the type is status_t.
|
if (U_FAILURE(err))
|
||||||
if (U_FAILURE(err)) return err;
|
return B_ERROR;
|
||||||
|
|
||||||
UnicodeString ICUString;
|
UnicodeString ICUString;
|
||||||
ICUString = numberFormatter->format(value, ICUString);
|
ICUString = numberFormatter->format(value, ICUString);
|
||||||
@@ -544,7 +598,7 @@ BCountry::FormatNumber(BString* string, double value)
|
|||||||
|
|
||||||
ICUString.toUTF8(stringConverter);
|
ICUString.toUTF8(stringConverter);
|
||||||
|
|
||||||
return U_ZERO_ERROR;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user