diff options
author | Eike Rathke <erack@redhat.com> | 2012-06-20 14:49:56 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2012-06-20 14:53:37 +0200 |
commit | 209f1cdc933e42d097c03b35cbf8a6f7d52314b4 (patch) | |
tree | 9d521fde10adddae9a30d3d693112faf710aecb8 /unotools | |
parent | bd91d9319efb7fcf0e5861e66ab5ea9e5630bf3f (diff) |
adapt callers of getCurrFormatsImpl() to changes
06e2005ed83567452783003e3113ad6a92190c2d changed String to OUString and
initialized some variables with -1 instead of STRING_NOTFOUND, which was
unsigned 0xffff so var1<var2 was true if var1 had a value other than
default and var2 was default. After the change the comparison had logic
reversed and the result was a default negative currency format with
parentheses for all locales.
Change-Id: I3fe49fed7c1047618dc653fce992eb01582c398d
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/i18n/localedatawrapper.cxx | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx index f4714b64d966..0c130ece5854 100644 --- a/unotools/source/i18n/localedatawrapper.cxx +++ b/unotools/source/i18n/localedatawrapper.cxx @@ -801,21 +801,20 @@ void LocaleDataWrapper::getCurrFormatsImpl() const ::rtl::OUString& rCode = pFormatArr[nNeg].Code; sal_Int32 nDelim = rCode.indexOf(';'); scanCurrFormatImpl( rCode, nDelim+1, nSign, nPar, nNum, nBlank, nSym ); - if (areChecksEnabled() && (nNum == -1 || - nSym == -1 || (nPar == -1 && - nSign == -1))) + if (areChecksEnabled() && (nNum == -1 || nSym == -1 || (nPar == -1 && nSign == -1))) { rtl::OUString aMsg( RTL_CONSTASCII_USTRINGPARAM( "LocaleDataWrapper::getCurrFormatsImpl: CurrNegativeFormat?")); outputCheckMessage( appendLocaleInfo( aMsg ) ); } + // NOTE: one of nPar or nSign are allowed to be -1 if (nBlank == -1) { if ( nSym < nNum ) { - if ( nPar < nSym ) + if ( -1 < nPar && nPar < nSym ) nCurrNegativeFormat = 0; // ($1) - else if ( nSign < nSym ) + else if ( -1 < nSign && nSign < nSym ) nCurrNegativeFormat = 1; // -$1 else if ( nNum < nSign ) nCurrNegativeFormat = 3; // $1- @@ -824,9 +823,9 @@ void LocaleDataWrapper::getCurrFormatsImpl() } else { - if ( nPar < nNum ) + if ( -1 < nPar && nPar < nNum ) nCurrNegativeFormat = 4; // (1$) - else if ( nSign < nNum ) + else if ( -1 < nSign && nSign < nNum ) nCurrNegativeFormat = 5; // -1$ else if ( nSym < nSign ) nCurrNegativeFormat = 7; // 1$- @@ -838,9 +837,9 @@ void LocaleDataWrapper::getCurrFormatsImpl() { if ( nSym < nNum ) { - if ( nPar < nSym ) + if ( -1 < nPar && nPar < nSym ) nCurrNegativeFormat = 14; // ($ 1) - else if ( nSign < nSym ) + else if ( -1 < nSign && nSign < nSym ) nCurrNegativeFormat = 9; // -$ 1 else if ( nNum < nSign ) nCurrNegativeFormat = 12; // $ 1- @@ -849,9 +848,9 @@ void LocaleDataWrapper::getCurrFormatsImpl() } else { - if ( nPar < nNum ) + if ( -1 < nPar && nPar < nNum ) nCurrNegativeFormat = 15; // (1 $) - else if ( nSign < nNum ) + else if ( -1 < nSign && nSign < nNum ) nCurrNegativeFormat = 8; // -1 $ else if ( nSym < nSign ) nCurrNegativeFormat = 10; // 1 $- |