QString result(4, Qt::Uninitialized);
const int decresult = unorm2_getDecomposition(normalizer, ucs4,
reinterpret_cast<UChar*>(result.data()), result.size(), &errorcode);
- if (Q_UNLIKELY(decresult < 1)) {
- // no decomposition value
- return QString();
- }
-
if (Q_UNLIKELY(U_FAILURE(errorcode))) {
qWarning("QChar::decomposition: unorm2_getDecomposition() failed %s", u_errorName(errorcode));
return QString();
+ } else if (Q_UNLIKELY(decresult < 1)) {
+ // no decomposition value
+ return QString();
}
result.resize(decresult);
const int decresult = unorm2_normalize(normalizer,
reinterpret_cast<const UChar*>(unicode()), srcsize,
reinterpret_cast<UChar*>(result.data()), result.size(), &error);
- if (Q_UNLIKELY(decresult < 1)) {
- // no normalization value
- return *this;
- } else if (Q_UNLIKELY(U_FAILURE(error))) {
+ if (Q_UNLIKELY(U_FAILURE(error))) {
qWarning("QString::normalized: unorm2_normalize() failed %s", u_errorName(error));
return QString();
+ } else if (Q_UNLIKELY(decresult < 1)) {
+ // no normalization value
+ return *this;
}
result.resize(decresult);