aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike FABIAN <mike.fabian@basyskom.de>2010-05-06 12:36:07 +0200
committerMike FABIAN <mike.fabian@basyskom.de>2010-05-07 14:09:56 +0200
commit7b77929f8efe3281fcae31859a645da5322032b8 (patch)
tree1040abe11f711083009b586c7c51b564e7b967e6
parent061a63b1b18e75d70779cf6492eb5772416645ad (diff)
Changes: Fix coverity issues in MLocale
RevBy: Holger Schröder Details: Fixed the following issues: 630 REVERSE_INULL MLocale::icuFormatString(MLocale::DateType, MLocale::TimeType, MLocale::CalendarType) const 134 UNINIT_CTOR MLocalePrivate::MLocalePrivate() 118 UNINIT_CTOR MLocalePrivate::MLocalePrivate(const MLocalePrivate&)
-rw-r--r--src/corelib/i18n/mlocale.cpp22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/corelib/i18n/mlocale.cpp b/src/corelib/i18n/mlocale.cpp
index 7b296ef3..c2cc3af7 100644
--- a/src/corelib/i18n/mlocale.cpp
+++ b/src/corelib/i18n/mlocale.cpp
@@ -349,6 +349,7 @@ MLocalePrivate::MLocalePrivate()
currentLcNumericItem(SettingsLcNumeric),
currentLcMonetaryItem(SettingsLcMonetary)
#endif
+ , q_ptr(0)
{
}
@@ -377,6 +378,7 @@ MLocalePrivate::MLocalePrivate(const MLocalePrivate &other)
currentLcNumericItem(SettingsLcNumeric),
currentLcMonetaryItem(SettingsLcMonetary)
#endif
+ , q_ptr(0)
{
#ifdef HAVE_ICU
if (other._numberFormat != 0) {
@@ -1618,18 +1620,18 @@ QString MLocale::icuFormatString( DateType dateType,
calendarType);
DateFormatSymbols *dfs = MLocalePrivate::createDateFormatSymbols(symbolLocale);
- // This is not nice but seems to be the only way to set the
- // symbols with the public API
- static_cast<SimpleDateFormat *>(df)->adoptDateFormatSymbols(dfs);
-
- icu::UnicodeString icuFormatString;
- static_cast<SimpleDateFormat *>(df)->toPattern(icuFormatString);
+ QString icuFormatQString;
- QString icuFormatQString = MIcuConversions::unicodeStringToQString(icuFormatString);
-
- if( df )
+ if (df)
+ {
+ icu::UnicodeString icuFormatString;
+ // This is not nice but seems to be the only way to set the
+ // symbols with the public API
+ static_cast<SimpleDateFormat *>(df)->adoptDateFormatSymbols(dfs);
+ static_cast<SimpleDateFormat *>(df)->toPattern(icuFormatString);
+ icuFormatQString = MIcuConversions::unicodeStringToQString(icuFormatString);
delete df;
-
+ }
return icuFormatQString;
}
#endif