diff options
author | Noel Grandin <noel@peralex.com> | 2015-02-25 09:49:59 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-02-25 10:34:27 +0200 |
commit | 2f928b2d0982af44b3d45f1d3c8919c0b0655b4f (patch) | |
tree | 36468544d70101f2fc3a49a59b2f9d40df10e61f /svl/source/numbers | |
parent | 3e475e574ee7ac8753bf50732f62bea5d36791a5 (diff) |
remove NUMBERFORMAT_ constants
.. in favour of just using the underlying constants from
css::util::NumberFormat
Change-Id: I0c6b128b66c91b268f5ae300f9c17c7792df5e99
Diffstat (limited to 'svl/source/numbers')
-rw-r--r-- | svl/source/numbers/numfmuno.cxx | 6 | ||||
-rw-r--r-- | svl/source/numbers/zforfind.cxx | 250 | ||||
-rw-r--r-- | svl/source/numbers/zforlist.cxx | 180 | ||||
-rw-r--r-- | svl/source/numbers/zformat.cxx | 72 | ||||
-rw-r--r-- | svl/source/numbers/zforscan.cxx | 180 |
5 files changed, 344 insertions, 344 deletions
diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index d53d8a2ec130..15e10a764760 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -601,7 +601,7 @@ sal_Int32 SAL_CALL SvNumberFormatsObj::getStandardFormat( sal_Int16 nType, const LanguageType eLang = lcl_GetLanguage( nLocale ); // Mask out "defined" bit, so type from an existing number format // can directly be used for getStandardFormat - nType &= ~NUMBERFORMAT_DEFINED; + nType &= ~css::util::NumberFormat::DEFINED; nRet = pFormatter->GetStandardFormat(nType, eLang); } else @@ -756,7 +756,7 @@ uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const OUString& aProperty } else if (aPropertyName == PROPERTYNAME_USERDEF) { - sal_Bool bUserDef = ( ( pFormat->GetType() & NUMBERFORMAT_DEFINED ) != 0 ); + sal_Bool bUserDef = ( ( pFormat->GetType() & css::util::NumberFormat::DEFINED ) != 0 ); aRet.setValue( &bUserDef, getBooleanCppuType() ); } else if (aPropertyName == PROPERTYNAME_DECIMALS) @@ -868,7 +868,7 @@ uno::Sequence<beans::PropertyValue> SAL_CALL SvNumberFormatObj::getPropertyValue OUString aComment = pFormat->GetComment(); sal_Bool bStandard = ( ( nKey % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 ); //! Pass through SvNumberformat Member bStandard? - sal_Bool bUserDef = ( ( pFormat->GetType() & NUMBERFORMAT_DEFINED ) != 0 ); + sal_Bool bUserDef = ( ( pFormat->GetType() & css::util::NumberFormat::DEFINED ) != 0 ); bool bThousand, bRed; sal_uInt16 nDecimals, nLeading; pFormat->GetFormatSpecialInfo( bThousand, bRed, nDecimals, nLeading ); diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 5011fe805fd4..c5e1e87bee24 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -79,8 +79,8 @@ ImpSvNumberInputScan::ImpSvNumberInputScan( SvNumberFormatter* pFormatterP ) bTextInitialized( false ), bScanGenitiveMonths( false ), bScanPartitiveMonths( false ), - eScannedType( NUMBERFORMAT_UNDEFINED ), - eSetType( NUMBERFORMAT_UNDEFINED ) + eScannedType( css::util::NumberFormat::UNDEFINED ), + eSetType( css::util::NumberFormat::UNDEFINED ) { pFormatter = pFormatterP; pNullDate = new Date(30,12,1899); @@ -117,7 +117,7 @@ void ImpSvNumberInputScan::Reset() nAnzStrings = 0; nAnzNums = 0; nThousand = 0; - eScannedType = NUMBERFORMAT_UNDEFINED; + eScannedType = css::util::NumberFormat::UNDEFINED; nAmPm = 0; nPosThousandString = 0; nLogical = 0; @@ -1489,7 +1489,7 @@ bool ImpSvNumberInputScan::GetDateRef( double& fDays, sal_uInt16& nCounter, using namespace ::com::sun::star::i18n; NfEvalDateFormat eEDF; int nFormatOrder; - if ( pFormat && ((pFormat->GetType() & NUMBERFORMAT_DATE) == NUMBERFORMAT_DATE) ) + if ( pFormat && (pFormat->GetType() & css::util::NumberFormat::DATE) ) { eEDF = pFormatter->GetEvalDateFormat(); switch ( eEDF ) @@ -2079,7 +2079,7 @@ bool ImpSvNumberInputScan::ScanStartString( const OUString& rString, } else if ( GetCurrency(rString, nPos, pFormat) ) // currency (DM 1)? { - eScannedType = NUMBERFORMAT_CURRENCY; // !!! it IS currency !!! + eScannedType = css::util::NumberFormat::CURRENCY; // !!! it IS currency !!! SkipBlanks(rString, nPos); if (nSign == 0) // no sign yet { @@ -2103,7 +2103,7 @@ bool ImpSvNumberInputScan::ScanStartString( const OUString& rString, { if (nPos < rString.getLength()) // Jan1 without separator is not a date { - eScannedType = NUMBERFORMAT_DATE; // !!! it IS a date !!! + eScannedType = css::util::NumberFormat::DATE; // !!! it IS a date !!! nMonth = nTempMonth; nMonthPos = 1; // month at the beginning if ( nMonth < 0 ) @@ -2123,7 +2123,7 @@ bool ImpSvNumberInputScan::ScanStartString( const OUString& rString, if ( nDayOfWeek ) { // day of week is just parsed away - eScannedType = NUMBERFORMAT_DATE; // !!! it IS a date !!! + eScannedType = css::util::NumberFormat::DATE; // !!! it IS a date !!! if ( nPos < rString.getLength() ) { if ( nDayOfWeek < 0 ) @@ -2226,15 +2226,15 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString, if (bDecSepInDateSeps || // . also date separator SkipDatePatternSeparator( nStringPos, nPos)) { - if ( eScannedType != NUMBERFORMAT_UNDEFINED && - eScannedType != NUMBERFORMAT_DATE && - eScannedType != NUMBERFORMAT_DATETIME) // already another type + if ( eScannedType != css::util::NumberFormat::UNDEFINED && + eScannedType != css::util::NumberFormat::DATE && + eScannedType != css::util::NumberFormat::DATETIME) // already another type { return MatchedReturn(); } - if (eScannedType == NUMBERFORMAT_UNDEFINED) + if (eScannedType == css::util::NumberFormat::UNDEFINED) { - eScannedType = NUMBERFORMAT_DATE; // !!! it IS a date + eScannedType = css::util::NumberFormat::DATE; // !!! it IS a date } SkipBlanks(rString, nPos); } @@ -2249,7 +2249,7 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString, SkipBlanks(rString, nPos); } } - else if ( ((eScannedType & NUMBERFORMAT_TIME) == NUMBERFORMAT_TIME) && + else if ( (eScannedType & css::util::NumberFormat::TIME) && GetTime100SecSep( rString, nPos ) ) { // hundredth seconds separator if ( nDecPos ) @@ -2262,13 +2262,13 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString, if (SkipChar('/', rString, nPos)) // fraction? { - if ( eScannedType != NUMBERFORMAT_UNDEFINED && // already another type - eScannedType != NUMBERFORMAT_DATE) // except date + if ( eScannedType != css::util::NumberFormat::UNDEFINED && // already another type + eScannedType != css::util::NumberFormat::DATE) // except date { return MatchedReturn(); // => jan/31/1994 } - else if (eScannedType != NUMBERFORMAT_DATE && // analyzed no date until now - ( eSetType == NUMBERFORMAT_FRACTION || // and preset was fraction + else if (eScannedType != css::util::NumberFormat::DATE && // analyzed no date until now + ( eSetType == css::util::NumberFormat::FRACTION || // and preset was fraction (nAnzNums == 3 && // or 3 numbers (nStringPos == 3 || // and 3rd string particle (nStringPos == 4 && nSign))))) // or 4th if signed @@ -2276,8 +2276,8 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString, SkipBlanks(rString, nPos); if (nPos == rString.getLength()) { - eScannedType = NUMBERFORMAT_FRACTION; // !!! it IS a fraction (so far) - if (eSetType == NUMBERFORMAT_FRACTION && + eScannedType = css::util::NumberFormat::FRACTION; // !!! it IS a fraction (so far) + if (eSetType == css::util::NumberFormat::FRACTION && nAnzNums == 2 && (nStringPos == 1 || // for 4/5 (nStringPos == 2 && nSign))) // or signed -4/5 @@ -2294,8 +2294,8 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString, if (GetThousandSep(rString, nPos, nStringPos)) // 1,000 { - if ( eScannedType != NUMBERFORMAT_UNDEFINED && // already another type - eScannedType != NUMBERFORMAT_CURRENCY) // except currency + if ( eScannedType != css::util::NumberFormat::UNDEFINED && // already another type + eScannedType != css::util::NumberFormat::CURRENCY) // except currency { return MatchedReturn(); } @@ -2313,13 +2313,13 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString, if (bDate || ((MayBeIso8601() || MayBeMonthDate()) && // 1999-12-31 31-Dec-1999 SkipChar( '-', rString, nPos))) { - if ( eScannedType != NUMBERFORMAT_UNDEFINED && // already another type - eScannedType != NUMBERFORMAT_DATE) // except date + if ( eScannedType != css::util::NumberFormat::UNDEFINED && // already another type + eScannedType != css::util::NumberFormat::DATE) // except date { return MatchedReturn(); } SkipBlanks(rString, nPos); - eScannedType = NUMBERFORMAT_DATE; // !!! it IS a date + eScannedType = css::util::NumberFormat::DATE; // !!! it IS a date short nTmpMonth = GetMonth(rString, nPos); // 10. Jan 94 if (nMonth && nTmpMonth) // month dup { @@ -2350,14 +2350,14 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString, { return MatchedReturn(); } - if ( eScannedType != NUMBERFORMAT_UNDEFINED && // already another type - eScannedType != NUMBERFORMAT_DATE) // except date + if ( eScannedType != css::util::NumberFormat::UNDEFINED && // already another type + eScannedType != css::util::NumberFormat::DATE) // except date { return MatchedReturn(); } if (nMonthStart > 0 && nPos < rString.getLength()) // 10Jan or Jan94 without separator are not dates { - eScannedType = NUMBERFORMAT_DATE; // !!! it IS a date + eScannedType = css::util::NumberFormat::DATE; // !!! it IS a date nMonth = nTempMonth; nMonthPos = 2; // month in the middle if ( nMonth < 0 ) @@ -2376,14 +2376,14 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString, if ( SkipChar('E', rString, nPos) || // 10E, 10e, 10,Ee SkipChar('e', rString, nPos) ) { - if (eScannedType != NUMBERFORMAT_UNDEFINED) // already another type + if (eScannedType != css::util::NumberFormat::UNDEFINED) // already another type { return MatchedReturn(); } else { SkipBlanks(rString, nPos); - eScannedType = NUMBERFORMAT_SCIENTIFIC; // !!! it IS scientific + eScannedType = css::util::NumberFormat::SCIENTIFIC; // !!! it IS scientific if ( nThousand+2 == nAnzNums && nDecPos == 2 ) // special case 1.E2 { nDecPos = 3; // 1,100.E2 1,100,100.E3 @@ -2400,12 +2400,12 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString, { if (bDecSepInDateSeps) // . also date sep { - if ( eScannedType != NUMBERFORMAT_DATE && // already another type than date - eScannedType != NUMBERFORMAT_DATETIME) // or date time + if ( eScannedType != css::util::NumberFormat::DATE && // already another type than date + eScannedType != css::util::NumberFormat::DATETIME) // or date time { return MatchedReturn(); } - if (eScannedType == NUMBERFORMAT_DATE) + if (eScannedType == css::util::NumberFormat::DATE) { nDecPos = 0; // reset for time transition } @@ -2415,22 +2415,22 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString, return MatchedReturn(); } } - if ((eScannedType == NUMBERFORMAT_DATE || // already date type - eScannedType == NUMBERFORMAT_DATETIME) && // or date time + if ((eScannedType == css::util::NumberFormat::DATE || // already date type + eScannedType == css::util::NumberFormat::DATETIME) && // or date time nAnzNums > 3) // and more than 3 numbers? (31.Dez.94 8:23) { SkipBlanks(rString, nPos); - eScannedType = NUMBERFORMAT_DATETIME; // !!! it IS date with time + eScannedType = css::util::NumberFormat::DATETIME; // !!! it IS date with time } - else if ( eScannedType != NUMBERFORMAT_UNDEFINED && // already another type - eScannedType != NUMBERFORMAT_TIME) // except time + else if ( eScannedType != css::util::NumberFormat::UNDEFINED && // already another type + eScannedType != css::util::NumberFormat::TIME) // except time { return MatchedReturn(); } else { SkipBlanks(rString, nPos); - eScannedType = NUMBERFORMAT_TIME; // !!! it IS a time + eScannedType = css::util::NumberFormat::TIME; // !!! it IS a time } if ( !nTimePos ) { @@ -2442,7 +2442,7 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString, { switch (eScannedType) { - case NUMBERFORMAT_DATE: + case css::util::NumberFormat::DATE: if (nMonthPos == 1 && pLoc->getLongDateFormat() == MDY) { // #68232# recognize long date separators like ", " in "September 5, 1999" @@ -2464,12 +2464,12 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString, // here if the locale's separator is not ':' so it couldn't // be detected above in the time block. if (nAnzNums >= 5) - eScannedType = NUMBERFORMAT_DATETIME; + eScannedType = css::util::NumberFormat::DATETIME; ++nPos; } } break; - case NUMBERFORMAT_DATETIME: + case css::util::NumberFormat::DATETIME: if (nPos == 0 && rString.getLength() == 1 && MayBeIso8601()) { if (nStringPos == 9 && rString[0] == ':') @@ -2563,15 +2563,15 @@ bool ImpSvNumberInputScan::ScanEndString( const OUString& rString, if (bDecSepInDateSeps || // . also date separator SkipDatePatternSeparator( nAnzStrings-1, nPos)) { - if ( eScannedType != NUMBERFORMAT_UNDEFINED && - eScannedType != NUMBERFORMAT_DATE && - eScannedType != NUMBERFORMAT_DATETIME) // already another type + if ( eScannedType != css::util::NumberFormat::UNDEFINED && + eScannedType != css::util::NumberFormat::DATE && + eScannedType != css::util::NumberFormat::DATETIME) // already another type { return MatchedReturn(); } - if (eScannedType == NUMBERFORMAT_UNDEFINED) + if (eScannedType == css::util::NumberFormat::UNDEFINED) { - eScannedType = NUMBERFORMAT_DATE; // !!! it IS a date + eScannedType = css::util::NumberFormat::DATE; // !!! it IS a date } SkipBlanks(rString, nPos); } @@ -2589,7 +2589,7 @@ bool ImpSvNumberInputScan::ScanEndString( const OUString& rString, bool bSignDetectedHere = false; if ( nSign == 0 && // conflict - not signed - eScannedType != NUMBERFORMAT_DATE) // and not date + eScannedType != css::util::NumberFormat::DATE) // and not date //!? catch time too? { // not signed yet nSign = GetSign(rString, nPos); // 1- DM @@ -2612,14 +2612,14 @@ bool ImpSvNumberInputScan::ScanEndString( const OUString& rString, if ( GetCurrency(rString, nPos, pFormat) ) // currency symbol? { - if (eScannedType != NUMBERFORMAT_UNDEFINED) // currency dup + if (eScannedType != css::util::NumberFormat::UNDEFINED) // currency dup { return MatchedReturn(); } else { SkipBlanks(rString, nPos); - eScannedType = NUMBERFORMAT_CURRENCY; + eScannedType = css::util::NumberFormat::CURRENCY; } // behind currency a '-' is allowed if (nSign == 0) // not signed yet { @@ -2630,7 +2630,7 @@ bool ImpSvNumberInputScan::ScanEndString( const OUString& rString, return MatchedReturn(); } } - if ( nNegCheck && eScannedType == NUMBERFORMAT_CURRENCY && + if ( nNegCheck && eScannedType == css::util::NumberFormat::CURRENCY && SkipChar(')', rString, nPos) ) { nNegCheck = 0; // ')' skipped @@ -2640,12 +2640,12 @@ bool ImpSvNumberInputScan::ScanEndString( const OUString& rString, if ( SkipChar('%', rString, nPos) ) // 1% { - if (eScannedType != NUMBERFORMAT_UNDEFINED) // already another type + if (eScannedType != css::util::NumberFormat::UNDEFINED) // already another type { return MatchedReturn(); } SkipBlanks(rString, nPos); - eScannedType = NUMBERFORMAT_PERCENT; + eScannedType = css::util::NumberFormat::PERCENT; } const LocaleDataWrapper* pLoc = pFormatter->GetLocaleData(); @@ -2656,20 +2656,20 @@ bool ImpSvNumberInputScan::ScanEndString( const OUString& rString, { return MatchedReturn(); } - if (eScannedType == NUMBERFORMAT_DATE && nAnzNums > 2) // 31.Dez.94 8: + if (eScannedType == css::util::NumberFormat::DATE && nAnzNums > 2) // 31.Dez.94 8: { SkipBlanks(rString, nPos); - eScannedType = NUMBERFORMAT_DATETIME; + eScannedType = css::util::NumberFormat::DATETIME; } - else if (eScannedType != NUMBERFORMAT_UNDEFINED && - eScannedType != NUMBERFORMAT_TIME) // already another type + else if (eScannedType != css::util::NumberFormat::UNDEFINED && + eScannedType != css::util::NumberFormat::TIME) // already another type { return MatchedReturn(); } else { SkipBlanks(rString, nPos); - eScannedType = NUMBERFORMAT_TIME; + eScannedType = css::util::NumberFormat::TIME; } if ( !nTimePos ) { @@ -2690,15 +2690,15 @@ bool ImpSvNumberInputScan::ScanEndString( const OUString& rString, if (bDate || ((MayBeIso8601() || MayBeMonthDate()) && SkipChar( '-', rString, nPos))) { - if (eScannedType != NUMBERFORMAT_UNDEFINED && - eScannedType != NUMBERFORMAT_DATE) // already another type + if (eScannedType != css::util::NumberFormat::UNDEFINED && + eScannedType != css::util::NumberFormat::DATE) // already another type { return MatchedReturn(); } else { SkipBlanks(rString, nPos); - eScannedType = NUMBERFORMAT_DATE; + eScannedType = css::util::NumberFormat::DATE; } short nTmpMonth = GetMonth(rString, nPos); // 10. Jan if (nMonth && nTmpMonth) // month dup @@ -2725,14 +2725,14 @@ bool ImpSvNumberInputScan::ScanEndString( const OUString& rString, { return MatchedReturn(); } - if (eScannedType != NUMBERFORMAT_UNDEFINED && - eScannedType != NUMBERFORMAT_DATE) // already another type + if (eScannedType != css::util::NumberFormat::UNDEFINED && + eScannedType != css::util::NumberFormat::DATE) // already another type { return MatchedReturn(); } if (nMonthStart > 0) // 10Jan without separator is not a date { - eScannedType = NUMBERFORMAT_DATE; + eScannedType = css::util::NumberFormat::DATE; nMonth = nTempMonth; nMonthPos = 3; // month at end if ( nMonth < 0 ) @@ -2750,9 +2750,9 @@ bool ImpSvNumberInputScan::ScanEndString( const OUString& rString, sal_Int32 nOrigPos = nPos; if (GetTimeAmPm(rString, nPos)) { - if (eScannedType != NUMBERFORMAT_UNDEFINED && - eScannedType != NUMBERFORMAT_TIME && - eScannedType != NUMBERFORMAT_DATETIME) // already another type + if (eScannedType != css::util::NumberFormat::UNDEFINED && + eScannedType != css::util::NumberFormat::TIME && + eScannedType != css::util::NumberFormat::DATETIME) // already another type { return MatchedReturn(); } @@ -2760,16 +2760,16 @@ bool ImpSvNumberInputScan::ScanEndString( const OUString& rString, { // If not already scanned as time, 6.78am does not result in 6 // seconds and 78 hundredths in the morning. Keep as suffix. - if (eScannedType != NUMBERFORMAT_TIME && nDecPos == 2 && nAnzNums == 2) + if (eScannedType != css::util::NumberFormat::TIME && nDecPos == 2 && nAnzNums == 2) { nPos = nOrigPos; // rewind am/pm } else { SkipBlanks(rString, nPos); - if ( eScannedType != NUMBERFORMAT_DATETIME ) + if ( eScannedType != css::util::NumberFormat::DATETIME ) { - eScannedType = NUMBERFORMAT_TIME; + eScannedType = css::util::NumberFormat::TIME; } } } @@ -2777,7 +2777,7 @@ bool ImpSvNumberInputScan::ScanEndString( const OUString& rString, if ( nNegCheck && SkipChar(')', rString, nPos) ) { - if (eScannedType == NUMBERFORMAT_CURRENCY) // only if currency + if (eScannedType == css::util::NumberFormat::CURRENCY) // only if currency { nNegCheck = 0; // skip ')' SkipBlanks(rString, nPos); @@ -2789,8 +2789,8 @@ bool ImpSvNumberInputScan::ScanEndString( const OUString& rString, } if ( nPos < rString.getLength() && - (eScannedType == NUMBERFORMAT_DATE || - eScannedType == NUMBERFORMAT_DATETIME) ) + (eScannedType == css::util::NumberFormat::DATE || + eScannedType == css::util::NumberFormat::DATETIME) ) { // day of week is just parsed away sal_Int32 nOldPos = nPos; @@ -2822,7 +2822,7 @@ bool ImpSvNumberInputScan::ScanEndString( const OUString& rString, } #if NF_RECOGNIZE_ISO8601_TIMEZONES - if (nPos == 0 && eScannedType == NUMBERFORMAT_DATETIME && + if (nPos == 0 && eScannedType == css::util::NumberFormat::DATETIME && rString.getLength() == 1 && rString[ 0 ] == (sal_Unicode)'Z' && MayBeIso8601()) { // ISO 8601 timezone UTC yyyy-mm-ddThh:mmZ @@ -2978,7 +2978,7 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / nLogical = GetLogical( rStrArray ); if ( nLogical ) { - eScannedType = NUMBERFORMAT_LOGICAL; // !!! it's a BOOLEAN + eScannedType = css::util::NumberFormat::LOGICAL; // !!! it's a BOOLEAN nMatchedAllStrings &= ~nMatchedVirgin; return true; } @@ -3002,12 +3002,12 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / // nAnzStrings >= 1 if (GetNextNumber(i,j)) // i=1,0 { // Number at start - if (eSetType == NUMBERFORMAT_FRACTION) // Fraction 1 = 1/1 + if (eSetType == css::util::NumberFormat::FRACTION) // Fraction 1 = 1/1 { if (i >= nAnzStrings || // no end string nor decimal separator sStrArray[i] == pFormatter->GetNumDecimalSep()) { - eScannedType = NUMBERFORMAT_FRACTION; + eScannedType = css::util::NumberFormat::FRACTION; nMatchedAllStrings &= ~nMatchedVirgin; return true; } @@ -3022,16 +3022,16 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / i++; // next symbol, i=1 } GetNextNumber(i,j); // i=1,2 - if (eSetType == NUMBERFORMAT_FRACTION) // Fraction -1 = -1/1 + if (eSetType == css::util::NumberFormat::FRACTION) // Fraction -1 = -1/1 { if (nSign && !nNegCheck && // Sign +, - - eScannedType == NUMBERFORMAT_UNDEFINED && // not date or currency + eScannedType == css::util::NumberFormat::UNDEFINED && // not date or currency nDecPos == 0 && // no previous decimal separator (i >= nAnzStrings || // no end string nor decimal separator sStrArray[i] == pFormatter->GetNumDecimalSep()) ) { - eScannedType = NUMBERFORMAT_FRACTION; + eScannedType = css::util::NumberFormat::FRACTION; nMatchedAllStrings &= ~nMatchedVirgin; return true; } @@ -3060,14 +3060,14 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / { return false; } - if (eSetType == NUMBERFORMAT_FRACTION) // -1,200. as fraction + if (eSetType == css::util::NumberFormat::FRACTION) // -1,200. as fraction { if (!nNegCheck && // no sign '(' - eScannedType == NUMBERFORMAT_UNDEFINED && + eScannedType == css::util::NumberFormat::UNDEFINED && (nDecPos == 0 || nDecPos == 3) // no decimal separator or at end ) { - eScannedType = NUMBERFORMAT_FRACTION; + eScannedType = css::util::NumberFormat::FRACTION; nMatchedAllStrings &= ~nMatchedVirgin; return true; } @@ -3093,7 +3093,7 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / return false; } i++; // i=2,3 - if (eScannedType == NUMBERFORMAT_SCIENTIFIC) // E only at end + if (eScannedType == css::util::NumberFormat::SCIENTIFIC) // E only at end { return false; } @@ -3108,19 +3108,19 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / { return false; } - if (eSetType == NUMBERFORMAT_FRACTION) // -1,200,100. as fraction + if (eSetType == css::util::NumberFormat::FRACTION) // -1,200,100. as fraction { if (!nNegCheck && // no sign '(' - eScannedType == NUMBERFORMAT_UNDEFINED && + eScannedType == css::util::NumberFormat::UNDEFINED && (nDecPos == 0 || nDecPos == 3) // no decimal separator or at end ) { - eScannedType = NUMBERFORMAT_FRACTION; + eScannedType = css::util::NumberFormat::FRACTION; nMatchedAllStrings &= ~nMatchedVirgin; return true; } } - if ( eScannedType == NUMBERFORMAT_FRACTION && nDecPos ) + if ( eScannedType == css::util::NumberFormat::FRACTION && nDecPos ) { return false; // #36857# not a real fraction } @@ -3147,7 +3147,7 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / // but leave one number. { // Loop over group separators nThOld = nThousand; - if (eScannedType == NUMBERFORMAT_SCIENTIFIC) // E only at end + if (eScannedType == css::util::NumberFormat::SCIENTIFIC) // E only at end { return false; } @@ -3159,13 +3159,13 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / i++; } } - if (eScannedType == NUMBERFORMAT_DATE || // long date or - eScannedType == NUMBERFORMAT_TIME || // long time or - eScannedType == NUMBERFORMAT_UNDEFINED) // long number + if (eScannedType == css::util::NumberFormat::DATE || // long date or + eScannedType == css::util::NumberFormat::TIME || // long time or + eScannedType == css::util::NumberFormat::UNDEFINED) // long number { for (sal_uInt16 k = j; k < nAnzNums-1; k++) { - if (eScannedType == NUMBERFORMAT_SCIENTIFIC) // E only at endd + if (eScannedType == css::util::NumberFormat::SCIENTIFIC) // E only at endd { return false; } @@ -3182,26 +3182,26 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / { return false; } - if (eSetType == NUMBERFORMAT_FRACTION) // -1,200,100. as fraction + if (eSetType == css::util::NumberFormat::FRACTION) // -1,200,100. as fraction { if (!nNegCheck && // no sign '(' - eScannedType == NUMBERFORMAT_UNDEFINED && + eScannedType == css::util::NumberFormat::UNDEFINED && (nDecPos == 0 || nDecPos == 3) // no decimal separator or at end ) { - eScannedType = NUMBERFORMAT_FRACTION; + eScannedType = css::util::NumberFormat::FRACTION; nMatchedAllStrings &= ~nMatchedVirgin; return true; } } - if ( eScannedType == NUMBERFORMAT_FRACTION && nDecPos ) + if ( eScannedType == css::util::NumberFormat::FRACTION && nDecPos ) { return false; // #36857# not a real fraction } break; } - if (eScannedType == NUMBERFORMAT_UNDEFINED) + if (eScannedType == css::util::NumberFormat::UNDEFINED) { nMatchedAllStrings &= ~nMatchedVirgin; // did match including nMatchedUsedAsReturn @@ -3225,11 +3225,11 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, / } else { - eScannedType = NUMBERFORMAT_NUMBER; + eScannedType = css::util::NumberFormat::NUMBER; // everything else should have been recognized by now } } - else if ( eScannedType == NUMBERFORMAT_DATE ) + else if ( eScannedType == css::util::NumberFormat::DATE ) { // the very relaxed date input checks may interfere with a preset format nMatchedAllStrings &= ~nMatchedVirgin; @@ -3421,8 +3421,8 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s if (res) { if ( nNegCheck || // ')' not found for '(' - (nSign && (eScannedType == NUMBERFORMAT_DATE || - eScannedType == NUMBERFORMAT_DATETIME))) // signed date/datetime + (nSign && (eScannedType == css::util::NumberFormat::DATE || + eScannedType == css::util::NumberFormat::DATETIME))) // signed date/datetime { res = false; } @@ -3430,9 +3430,9 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s { // check count of partial number strings switch (eScannedType) { - case NUMBERFORMAT_PERCENT: - case NUMBERFORMAT_CURRENCY: - case NUMBERFORMAT_NUMBER: + case css::util::NumberFormat::PERCENT: + case css::util::NumberFormat::CURRENCY: + case css::util::NumberFormat::NUMBER: if (nDecPos == 1) // .05 { // matched MidStrings function like group separators @@ -3471,7 +3471,7 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s } break; - case NUMBERFORMAT_SCIENTIFIC: // 1.0e-2 + case css::util::NumberFormat::SCIENTIFIC: // 1.0e-2 if (nDecPos == 1) // .05 { if (nAnzNums != 2) @@ -3495,7 +3495,7 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s } break; - case NUMBERFORMAT_DATE: + case css::util::NumberFormat::DATE: if (nMonth) { // month name and numbers if (nAnzNums > 2) @@ -3524,7 +3524,7 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s } break; - case NUMBERFORMAT_TIME: + case css::util::NumberFormat::TIME: if (nDecPos) { // hundredth seconds included if (nAnzNums > 4) @@ -3541,7 +3541,7 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s } break; - case NUMBERFORMAT_DATETIME: + case css::util::NumberFormat::DATETIME: if (nMonth) { // month name and numbers if (nDecPos) @@ -3594,7 +3594,7 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s { // we finally have a number switch (eScannedType) { - case NUMBERFORMAT_LOGICAL: + case css::util::NumberFormat::LOGICAL: if (nLogical == 1) { fOutNumber = 1.0; // True @@ -3609,11 +3609,11 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s } break; - case NUMBERFORMAT_PERCENT: - case NUMBERFORMAT_CURRENCY: - case NUMBERFORMAT_NUMBER: - case NUMBERFORMAT_SCIENTIFIC: - case NUMBERFORMAT_DEFINED: // if no category detected handle as number + case css::util::NumberFormat::PERCENT: + case css::util::NumberFormat::CURRENCY: + case css::util::NumberFormat::NUMBER: + case css::util::NumberFormat::SCIENTIFIC: + case css::util::NumberFormat::DEFINED: // if no category detected handle as number if ( nDecPos == 1 ) // . at start { sResString.append("0."); @@ -3626,7 +3626,7 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s if ( nDecPos == 2 && k < nAnzNums ) // . somewhere { sResString.append('.'); - sal_uInt16 nStop = (eScannedType == NUMBERFORMAT_SCIENTIFIC ? + sal_uInt16 nStop = (eScannedType == css::util::NumberFormat::SCIENTIFIC ? nAnzNums-1 : nAnzNums); for ( ; k < nStop; k++) { @@ -3634,7 +3634,7 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s } } - if (eScannedType != NUMBERFORMAT_SCIENTIFIC) + if (eScannedType != css::util::NumberFormat::SCIENTIFIC) { fOutNumber = StringToDouble(sResString.makeStringAndClear()); } @@ -3650,7 +3650,7 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s fOutNumber = ::rtl::math::stringToDouble( sResString.makeStringAndClear(), '.', ',', &eStatus, NULL ); if ( eStatus == rtl_math_ConversionStatus_OutOfRange ) { - F_Type = NUMBERFORMAT_TEXT; // overflow/underflow -> Text + F_Type = css::util::NumberFormat::TEXT; // overflow/underflow -> Text if (nESign == -1) { fOutNumber = 0.0; @@ -3679,13 +3679,13 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s fOutNumber = -fOutNumber; } - if (eScannedType == NUMBERFORMAT_PERCENT) + if (eScannedType == css::util::NumberFormat::PERCENT) { fOutNumber/= 100.0; } break; - case NUMBERFORMAT_FRACTION: + case css::util::NumberFormat::FRACTION: if (nAnzNums == 1) { fOutNumber = StringToDouble(sStrArray[nNums[0]]); @@ -3757,7 +3757,7 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s } break; - case NUMBERFORMAT_TIME: + case css::util::NumberFormat::TIME: res = GetTimeRef(fOutNumber, 0, nAnzNums); if ( nSign < 0 ) { @@ -3765,11 +3765,11 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s } break; - case NUMBERFORMAT_DATE: + case css::util::NumberFormat::DATE: res = GetDateRef( fOutNumber, k, pFormat ); break; - case NUMBERFORMAT_DATETIME: + case css::util::NumberFormat::DATETIME: res = GetDateRef( fOutNumber, k, pFormat ); if ( res ) { @@ -3790,13 +3790,13 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s { if (fOutNumber < -DBL_MAX) // -1.7E308 { - F_Type = NUMBERFORMAT_TEXT; + F_Type = css::util::NumberFormat::TEXT; fOutNumber = -DBL_MAX; return true; } else if (fOutNumber > DBL_MAX) // 1.7E308 { - F_Type = NUMBERFORMAT_TEXT; + F_Type = css::util::NumberFormat::TEXT; fOutNumber = DBL_MAX; return true; } @@ -3804,7 +3804,7 @@ bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // s if (res == false) { - eScannedType = NUMBERFORMAT_TEXT; + eScannedType = css::util::NumberFormat::TEXT; fOutNumber = 0.0; } diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx index 2d42ee50ea4e..e18281254f07 100644 --- a/svl/source/numbers/zforlist.cxx +++ b/svl/source/numbers/zforlist.cxx @@ -427,13 +427,13 @@ void SvNumberFormatter::ReplaceSystemCL( LanguageType eOldLanguage ) else { short eCheckType = pNewEntry->GetType(); - if ( eCheckType != NUMBERFORMAT_UNDEFINED ) + if ( eCheckType != css::util::NumberFormat::UNDEFINED ) { - pNewEntry->SetType( eCheckType | NUMBERFORMAT_DEFINED ); + pNewEntry->SetType( eCheckType | css::util::NumberFormat::DEFINED ); } else { - pNewEntry->SetType( NUMBERFORMAT_DEFINED ); + pNewEntry->SetType( css::util::NumberFormat::DEFINED ); } if ( !aFTable.insert( make_pair( nKey, pNewEntry) ).second ) @@ -522,15 +522,15 @@ bool SvNumberFormatter::PutEntry(OUString& rString, if (nCheckPos == 0) // Format ok { // Type comparison: short eCheckType = p_Entry->GetType(); - if ( eCheckType != NUMBERFORMAT_UNDEFINED) + if ( eCheckType != css::util::NumberFormat::UNDEFINED) { - p_Entry->SetType(eCheckType | NUMBERFORMAT_DEFINED); + p_Entry->SetType(eCheckType | css::util::NumberFormat::DEFINED); nType = eCheckType; } else { - p_Entry->SetType(NUMBERFORMAT_DEFINED); - nType = NUMBERFORMAT_DEFINED; + p_Entry->SetType(css::util::NumberFormat::DEFINED); + nType = css::util::NumberFormat::DEFINED; } sal_uInt32 CLOffset = ImpGenerateCL(eLge); // create new standard formats if necessary @@ -664,7 +664,7 @@ sal_uInt32 SvNumberFormatter::GetIndexPuttingAndConverting( OUString & rString, rType = GetType( nKey); // Convert any (!) old "automatic" currency format to new fixed currency // default format. - if ((rType & NUMBERFORMAT_CURRENCY) != 0) + if ((rType & css::util::NumberFormat::CURRENCY) != 0) { const SvNumberformat* pFormat = GetEntry( nKey); if (!pFormat->HasNewCurrency()) @@ -674,7 +674,7 @@ sal_uInt32 SvNumberFormatter::GetIndexPuttingAndConverting( OUString & rString, DeleteEntry( nKey); // don't leave trails of rubbish rNewInserted = false; } - nKey = GetStandardFormat( NUMBERFORMAT_CURRENCY, eLnge); + nKey = GetStandardFormat( css::util::NumberFormat::CURRENCY, eLnge); } } return nKey; @@ -778,7 +778,7 @@ SvNumberFormatTable& SvNumberFormatter::GetFirstEntryTable( LanguageType& rLnge) { short eTypetmp = eType; - if (eType == NUMBERFORMAT_ALL) // empty cell or don't care + if (eType == css::util::NumberFormat::ALL) // empty cell or don't care { rLnge = IniLnge; } @@ -788,22 +788,22 @@ SvNumberFormatTable& SvNumberFormatter::GetFirstEntryTable( if (!pFormat) { rLnge = IniLnge; - eType = NUMBERFORMAT_ALL; + eType = css::util::NumberFormat::ALL; eTypetmp = eType; } else { rLnge = pFormat->GetLanguage(); - eType = pFormat->GetType()&~NUMBERFORMAT_DEFINED; + eType = pFormat->GetType()&~css::util::NumberFormat::DEFINED; if (eType == 0) { - eType = NUMBERFORMAT_DEFINED; + eType = css::util::NumberFormat::DEFINED; eTypetmp = eType; } - else if (eType == NUMBERFORMAT_DATETIME) + else if (eType == css::util::NumberFormat::DATETIME) { eTypetmp = eType; - eType = NUMBERFORMAT_DATE; + eType = css::util::NumberFormat::DATE; } else { @@ -906,7 +906,7 @@ SvNumberFormatTable& SvNumberFormatter::GetEntryTable( SvNumberFormatTable::iterator it = aFTable.find( CLOffset); - if (eType == NUMBERFORMAT_ALL) + if (eType == css::util::NumberFormat::ALL) { while (it != aFTable.end() && it->second->GetLanguage() == ActLnge) { // copy all entries to output table @@ -944,21 +944,21 @@ bool SvNumberFormatter::IsNumberFormat(const OUString& sString, if (!pFormat) { ChangeIntl(IniLnge); - FType = NUMBERFORMAT_NUMBER; + FType = css::util::NumberFormat::NUMBER; } else { - FType = pFormat->GetType() &~NUMBERFORMAT_DEFINED; + FType = pFormat->GetType() &~css::util::NumberFormat::DEFINED; if (FType == 0) { - FType = NUMBERFORMAT_DEFINED; + FType = css::util::NumberFormat::DEFINED; } ChangeIntl(pFormat->GetLanguage()); } bool res; short RType = FType; - if (RType == NUMBERFORMAT_TEXT) + if (RType == css::util::NumberFormat::TEXT) { res = false; // type text preset => no conversion to number } @@ -970,7 +970,7 @@ bool SvNumberFormatter::IsNumberFormat(const OUString& sString, { switch ( RType ) { - case NUMBERFORMAT_DATE : + case css::util::NumberFormat::DATE : // Preserve ISO 8601 input. if (pStringScanner->CanForceToIso8601( DMY)) { @@ -981,7 +981,7 @@ bool SvNumberFormatter::IsNumberFormat(const OUString& sString, F_Index = GetStandardFormat( RType, ActLnge ); } break; - case NUMBERFORMAT_TIME : + case css::util::NumberFormat::TIME : if ( pStringScanner->GetDecPos() ) { // 100th seconds @@ -1022,7 +1022,7 @@ bool SvNumberFormatter::IsCompatible(short eOldType, { return true; } - else if (eOldType == NUMBERFORMAT_DEFINED) + else if (eOldType == css::util::NumberFormat::DEFINED) { return true; } @@ -1030,43 +1030,43 @@ bool SvNumberFormatter::IsCompatible(short eOldType, { switch (eNewType) { - case NUMBERFORMAT_NUMBER: + case css::util::NumberFormat::NUMBER: switch (eOldType) { - case NUMBERFORMAT_PERCENT: - case NUMBERFORMAT_CURRENCY: - case NUMBERFORMAT_SCIENTIFIC: - case NUMBERFORMAT_FRACTION: -// case NUMBERFORMAT_LOGICAL: - case NUMBERFORMAT_DEFINED: + case css::util::NumberFormat::PERCENT: + case css::util::NumberFormat::CURRENCY: + case css::util::NumberFormat::SCIENTIFIC: + case css::util::NumberFormat::FRACTION: +// case css::util::NumberFormat::LOGICAL: + case css::util::NumberFormat::DEFINED: return true; default: return false; } break; - case NUMBERFORMAT_DATE: + case css::util::NumberFormat::DATE: switch (eOldType) { - case NUMBERFORMAT_DATETIME: + case css::util::NumberFormat::DATETIME: return true; default: return false; } break; - case NUMBERFORMAT_TIME: + case css::util::NumberFormat::TIME: switch (eOldType) { - case NUMBERFORMAT_DATETIME: + case css::util::NumberFormat::DATETIME: return true; default: return false; } break; - case NUMBERFORMAT_DATETIME: + case css::util::NumberFormat::DATETIME: switch (eOldType) { - case NUMBERFORMAT_TIME: - case NUMBERFORMAT_DATE: + case css::util::NumberFormat::TIME: + case css::util::NumberFormat::DATE: return true; default: return false; @@ -1085,19 +1085,19 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultFormat( short nType ) sal_uInt32 nSearch; switch( nType ) { - case NUMBERFORMAT_DATE: + case css::util::NumberFormat::DATE: nSearch = CLOffset + ZF_STANDARD_DATE; break; - case NUMBERFORMAT_TIME: + case css::util::NumberFormat::TIME: nSearch = CLOffset + ZF_STANDARD_TIME; break; - case NUMBERFORMAT_DATETIME: + case css::util::NumberFormat::DATETIME: nSearch = CLOffset + ZF_STANDARD_DATETIME; break; - case NUMBERFORMAT_PERCENT: + case css::util::NumberFormat::PERCENT: nSearch = CLOffset + ZF_STANDARD_PERCENT; break; - case NUMBERFORMAT_SCIENTIFIC: + case css::util::NumberFormat::SCIENTIFIC: nSearch = CLOffset + ZF_STANDARD_SCIENTIFIC; break; default: @@ -1117,7 +1117,7 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultFormat( short nType ) { const SvNumberformat* pEntry = it2->second; if ( pEntry->IsStandard() && ((pEntry->GetType() & - ~NUMBERFORMAT_DEFINED) == nType) ) + ~css::util::NumberFormat::DEFINED) == nType) ) { nDefaultFormat = nKey; break; // while @@ -1129,19 +1129,19 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultFormat( short nType ) { // none found, use old fixed standards switch( nType ) { - case NUMBERFORMAT_DATE: + case css::util::NumberFormat::DATE: nDefaultFormat = CLOffset + ZF_STANDARD_DATE; break; - case NUMBERFORMAT_TIME: + case css::util::NumberFormat::TIME: nDefaultFormat = CLOffset + ZF_STANDARD_TIME+1; break; - case NUMBERFORMAT_DATETIME: + case css::util::NumberFormat::DATETIME: nDefaultFormat = CLOffset + ZF_STANDARD_DATETIME; break; - case NUMBERFORMAT_PERCENT: + case css::util::NumberFormat::PERCENT: nDefaultFormat = CLOffset + ZF_STANDARD_PERCENT+1; break; - case NUMBERFORMAT_SCIENTIFIC: + case css::util::NumberFormat::SCIENTIFIC: nDefaultFormat = CLOffset + ZF_STANDARD_SCIENTIFIC; break; default: @@ -1163,24 +1163,24 @@ sal_uInt32 SvNumberFormatter::GetStandardFormat( short eType, LanguageType eLnge sal_uInt32 CLOffset = ImpGenerateCL(eLnge); switch(eType) { - case NUMBERFORMAT_CURRENCY: + case css::util::NumberFormat::CURRENCY: return ( eLnge == LANGUAGE_SYSTEM ) ? ImpGetDefaultSystemCurrencyFormat() : ImpGetDefaultCurrencyFormat(); - case NUMBERFORMAT_DATE: - case NUMBERFORMAT_TIME: - case NUMBERFORMAT_DATETIME: - case NUMBERFORMAT_PERCENT: - case NUMBERFORMAT_SCIENTIFIC: + case css::util::NumberFormat::DATE: + case css::util::NumberFormat::TIME: + case css::util::NumberFormat::DATETIME: + case css::util::NumberFormat::PERCENT: + case css::util::NumberFormat::SCIENTIFIC: return ImpGetDefaultFormat( eType ); - case NUMBERFORMAT_FRACTION: + case css::util::NumberFormat::FRACTION: return CLOffset + ZF_STANDARD_FRACTION; - case NUMBERFORMAT_LOGICAL: + case css::util::NumberFormat::LOGICAL: return CLOffset + ZF_STANDARD_LOGICAL; - case NUMBERFORMAT_TEXT: + case css::util::NumberFormat::TEXT: return CLOffset + ZF_STANDARD_TEXT; - case NUMBERFORMAT_ALL: - case NUMBERFORMAT_DEFINED: - case NUMBERFORMAT_NUMBER: - case NUMBERFORMAT_UNDEFINED: + case css::util::NumberFormat::ALL: + case css::util::NumberFormat::DEFINED: + case css::util::NumberFormat::NUMBER: + case css::util::NumberFormat::UNDEFINED: default: return CLOffset + ZF_STANDARD; } @@ -1213,7 +1213,7 @@ sal_uInt32 SvNumberFormatter::GetStandardFormat( double fNumber, sal_uInt32 nFIn switch( eType ) { - case NUMBERFORMAT_TIME : + case css::util::NumberFormat::TIME : { bool bSign; if ( fNumber < 0.0 ) @@ -1252,7 +1252,7 @@ sal_uInt32 SvNumberFormatter::GetEditFormat( double fNumber, sal_uInt32 nFIndex, switch ( eType ) { // #61619# always edit using 4-digit year - case NUMBERFORMAT_DATE : + case css::util::NumberFormat::DATE : if (rtl::math::approxFloor( fNumber) != fNumber) nKey = GetFormatIndex( NF_DATETIME_SYS_DDMMYYYY_HHMMSS, eLang ); // fdo#34977 preserve time when editing even if only date was @@ -1273,7 +1273,7 @@ sal_uInt32 SvNumberFormatter::GetEditFormat( double fNumber, sal_uInt32 nFIndex, nKey = GetFormatIndex( NF_DATE_SYS_DDMMYYYY, eLang ); } break; - case NUMBERFORMAT_TIME : + case css::util::NumberFormat::TIME : if (fNumber < 0.0 || fNumber >= 1.0) { /* XXX NOTE: this is a purely arbitrary value within the limits @@ -1290,7 +1290,7 @@ sal_uInt32 SvNumberFormatter::GetEditFormat( double fNumber, sal_uInt32 nFIndex, else nKey = GetStandardFormat( fNumber, nFIndex, eType, eLang ); break; - case NUMBERFORMAT_DATETIME : + case css::util::NumberFormat::DATETIME : nKey = GetFormatIndex( NF_DATETIME_SYS_DDMMYYYY_HHMMSS, eLang ); /* FIXME: in case an ISO 8601 format was used, editing should * also use such. Unfortunately we have no builtin combined @@ -1316,23 +1316,23 @@ void SvNumberFormatter::GetInputLineString(const double& fOutNumber, LanguageType eLang = pFormat->GetLanguage(); ChangeIntl( eLang ); - short eType = pFormat->GetType() & ~NUMBERFORMAT_DEFINED; + short eType = pFormat->GetType() & ~css::util::NumberFormat::DEFINED; if (eType == 0) { - eType = NUMBERFORMAT_DEFINED; + eType = css::util::NumberFormat::DEFINED; } sal_uInt16 nOldPrec = pFormatScanner->GetStandardPrec(); bool bPrecChanged = false; - if (eType == NUMBERFORMAT_NUMBER || - eType == NUMBERFORMAT_PERCENT || - eType == NUMBERFORMAT_CURRENCY || - eType == NUMBERFORMAT_SCIENTIFIC || - eType == NUMBERFORMAT_FRACTION) + if (eType == css::util::NumberFormat::NUMBER || + eType == css::util::NumberFormat::PERCENT || + eType == css::util::NumberFormat::CURRENCY || + eType == css::util::NumberFormat::SCIENTIFIC || + eType == css::util::NumberFormat::FRACTION) { - if (eType != NUMBERFORMAT_PERCENT) // special treatment of % later + if (eType != css::util::NumberFormat::PERCENT) // special treatment of % later { - eType = NUMBERFORMAT_NUMBER; + eType = css::util::NumberFormat::NUMBER; } ChangeStandardPrec(INPUTSTRING_PRECISION); bPrecChanged = true; @@ -1345,7 +1345,7 @@ void SvNumberFormatter::GetInputLineString(const double& fOutNumber, } if (pFormat) { - if ( eType == NUMBERFORMAT_TIME && pFormat->GetFormatPrecision() ) + if ( eType == css::util::NumberFormat::TIME && pFormat->GetFormatPrecision() ) { ChangeStandardPrec(INPUTSTRING_PRECISION); bPrecChanged = true; @@ -2098,12 +2098,12 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditio if (pStdFormat) { // This is _the_ standard format. - if (LocaleDataWrapper::areChecksEnabled() && pStdFormat->GetType() != NUMBERFORMAT_NUMBER) + if (LocaleDataWrapper::areChecksEnabled() && pStdFormat->GetType() != css::util::NumberFormat::NUMBER) { LocaleDataWrapper::outputCheckMessage( xLocaleData-> appendLocaleInfo( "SvNumberFormatter::ImpGenerateFormats: General format not NUMBER")); } - pStdFormat->SetType( NUMBERFORMAT_NUMBER ); + pStdFormat->SetType( css::util::NumberFormat::NUMBER ); pStdFormat->SetStandard(); pStdFormat->SetLastInsertKey( SV_MAX_ANZ_STANDARD_FORMATE ); } @@ -2122,7 +2122,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditio pNewFormat = new SvNumberformat( aFormatCode, pFormatScanner, pStringScanner, nCheckPos, ActLnge ); - pNewFormat->SetType(NUMBERFORMAT_LOGICAL); + pNewFormat->SetType(css::util::NumberFormat::LOGICAL); pNewFormat->SetStandard(); if ( !aFTable.insert(make_pair( CLOffset + SetIndexTable( NF_BOOLEAN, ZF_STANDARD_LOGICAL ), @@ -2136,7 +2136,7 @@ void SvNumberFormatter::ImpGenerateFormats( sal_uInt32 CLOffset, bool bNoAdditio aFormatCode = "@"; pNewFormat = new SvNumberformat( aFormatCode, pFormatScanner, pStringScanner, nCheckPos, ActLnge ); - pNewFormat->SetType(NUMBERFORMAT_TEXT); + pNewFormat->SetType(css::util::NumberFormat::TEXT); pNewFormat->SetStandard(); if ( !aFTable.insert(make_pair( CLOffset + SetIndexTable( NF_TEXT, ZF_STANDARD_TEXT ), @@ -2648,11 +2648,11 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 nIndex, sString.append(GetNumDecimalSep()); padToLength(sString, sString.getLength() + nPrecision, '0'); } - if (eType == NUMBERFORMAT_PERCENT) + if (eType == css::util::NumberFormat::PERCENT) { sString.append('%'); } - else if (eType == NUMBERFORMAT_SCIENTIFIC) + else if (eType == css::util::NumberFormat::SCIENTIFIC) { OUStringBuffer sOldFormatString = pFormat->GetFormatstring(); sal_Int32 nIndexE = sOldFormatString.indexOf('E'); @@ -2665,7 +2665,7 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 nIndex, sString.append( sOldFormatString.copy(nIndexE) ); } } - else if (eType == NUMBERFORMAT_CURRENCY) + else if (eType == css::util::NumberFormat::CURRENCY) { OUStringBuffer sNegStr(sString); OUString aCurr; @@ -2716,10 +2716,10 @@ OUString SvNumberFormatter::GenerateFormat(sal_uInt32 nIndex, } sString.append(sNegStr.makeStringAndClear()); } - if (eType != NUMBERFORMAT_CURRENCY) + if (eType != css::util::NumberFormat::CURRENCY) { bool insertBrackets = false; - if ( eType != NUMBERFORMAT_UNDEFINED) + if ( eType != css::util::NumberFormat::UNDEFINED) { insertBrackets = pFormat->IsNegativeInBracket(); } @@ -2774,7 +2774,7 @@ bool SvNumberFormatter::IsUserDefined(const OUString& sStr, return true; } SvNumberformat* pEntry = GetFormatEntry( nKey ); - if ( pEntry && ((pEntry->GetType() & NUMBERFORMAT_DEFINED) != 0) ) + if ( pEntry && ((pEntry->GetType() & css::util::NumberFormat::DEFINED) != 0) ) { return true; } @@ -2798,7 +2798,7 @@ sal_uInt32 SvNumberFormatter::GetStandardIndex(LanguageType eLnge) { eLnge = IniLnge; } - return GetStandardFormat(NUMBERFORMAT_NUMBER, eLnge); + return GetStandardFormat(css::util::NumberFormat::NUMBER, eLnge); } short SvNumberFormatter::GetType(sal_uInt32 nFIndex) @@ -2807,14 +2807,14 @@ short SvNumberFormatter::GetType(sal_uInt32 nFIndex) SvNumberformat* pFormat = GetFormatEntry( nFIndex ); if (!pFormat) { - eType = NUMBERFORMAT_UNDEFINED; + eType = css::util::NumberFormat::UNDEFINED; } else { - eType = pFormat->GetType() &~NUMBERFORMAT_DEFINED; + eType = pFormat->GetType() &~css::util::NumberFormat::DEFINED; if (eType == 0) { - eType = NUMBERFORMAT_DEFINED; + eType = css::util::NumberFormat::DEFINED; } } return eType; @@ -3211,7 +3211,7 @@ sal_uInt32 SvNumberFormatter::ImpGetDefaultCurrencyFormat() while ( it2 != aFTable.end() && (nKey = it2->first) >= CLOffset && nKey < nStopKey ) { const SvNumberformat* pEntry = it2->second; - if ( pEntry->IsStandard() && (pEntry->GetType() & NUMBERFORMAT_CURRENCY) ) + if ( pEntry->IsStandard() && (pEntry->GetType() & css::util::NumberFormat::CURRENCY) ) { nDefaultCurrencyFormat = nKey; break; // while diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 70721e3f9078..e27348479985 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -334,7 +334,7 @@ ImpSvNumFor::ImpSvNumFor() nAnzStrings = 0; aI.nTypeArray = NULL; aI.sStrArray = NULL; - aI.eScannedType = NUMBERFORMAT_UNDEFINED; + aI.eScannedType = css::util::NumberFormat::UNDEFINED; aI.bThousand = false; aI.nThousand = 0; aI.nCntPre = 0; @@ -624,7 +624,7 @@ SvNumberformat::SvNumberformat(OUString& rString, fLimit2 = 0.0; eOp1 = NUMBERFORMAT_OP_NO; eOp2 = NUMBERFORMAT_OP_NO; - eType = NUMBERFORMAT_DEFINED; + eType = css::util::NumberFormat::DEFINED; bool bCancel = false; bool bCondition = false; @@ -671,10 +671,10 @@ SvNumberformat::SvNumberformat(OUString& rString, sal_Int32 nAnzChars = ImpGetNumber(sBuff, nPos, sStr); if (nAnzChars > 0) { - short F_Type = NUMBERFORMAT_UNDEFINED; + short F_Type = css::util::NumberFormat::UNDEFINED; if (!pISc->IsNumberFormat(sStr,F_Type,fNumber) || - ( F_Type != NUMBERFORMAT_NUMBER && - F_Type != NUMBERFORMAT_SCIENTIFIC) ) + ( F_Type != css::util::NumberFormat::NUMBER && + F_Type != css::util::NumberFormat::SCIENTIFIC) ) { fNumber = 0.0; nPos = nPos - nAnzChars; @@ -951,11 +951,11 @@ SvNumberformat::SvNumberformat(OUString& rString, } else if (nIndex == 3) { // #77026# Everything recognized IS text - NumFor[nIndex].Info().eScannedType = NUMBERFORMAT_TEXT; + NumFor[nIndex].Info().eScannedType = css::util::NumberFormat::TEXT; } else if ( (short) NumFor[nIndex].Info().eScannedType != eType) { - eType = NUMBERFORMAT_DEFINED; + eType = css::util::NumberFormat::DEFINED; } } else @@ -995,13 +995,13 @@ SvNumberformat::SvNumberformat(OUString& rString, { // #83510# A 4th subformat explicitly specified to be empty // hides any text. Need the type here for HasTextFormat() - NumFor[3].Info().eScannedType = NUMBERFORMAT_TEXT; + NumFor[3].Info().eScannedType = css::util::NumberFormat::TEXT; } bCancel = true; } if ( NumFor[nIndex].GetNatNum().IsSet() ) { - NumFor[nIndex].SetNatNumDate( (NumFor[nIndex].Info().eScannedType & NUMBERFORMAT_DATE) != 0 ); + NumFor[nIndex].SetNatNumDate( (NumFor[nIndex].Info().eScannedType & css::util::NumberFormat::DATE) != 0 ); } } @@ -1778,7 +1778,7 @@ void SvNumberformat::ImpGetOutputStdToPrecision(double& rNumber, OUString& rOutS void SvNumberformat::ImpGetOutputInputLine(double fNumber, OUString& OutString) { bool bModified = false; - if ( (eType & NUMBERFORMAT_PERCENT) && (fabs(fNumber) < _D_MAX_D_BY_100)) + if ( (eType & css::util::NumberFormat::PERCENT) && (fabs(fNumber) < _D_MAX_D_BY_100)) { if (fNumber == 0.0) { @@ -1800,7 +1800,7 @@ void SvNumberformat::ImpGetOutputInputLine(double fNumber, OUString& OutString) rtl_math_DecimalPlaces_Max, GetFormatter().GetNumDecimalSep()[0], true ); - if ( eType & NUMBERFORMAT_PERCENT && bModified) + if ( eType & css::util::NumberFormat::PERCENT && bModified) { OutString += "%"; } @@ -1862,7 +1862,7 @@ bool SvNumberformat::GetOutputString(const OUString& sString, { OUStringBuffer sOutBuff; sal_uInt16 nIx; - if (eType & NUMBERFORMAT_TEXT) + if (eType & css::util::NumberFormat::TEXT) { nIx = 0; } @@ -1878,7 +1878,7 @@ bool SvNumberformat::GetOutputString(const OUString& sString, *ppColor = NumFor[nIx].GetColor(); const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); bool bRes = false; - if (rInfo.eScannedType == NUMBERFORMAT_TEXT) + if (rInfo.eScannedType == css::util::NumberFormat::TEXT) { const sal_uInt16 nAnz = NumFor[nIx].GetCount(); for (sal_uInt16 i = 0; i < nAnz; i++) @@ -2015,7 +2015,7 @@ bool SvNumberformat::GetOutputString(double fNumber, sal_uInt16 nCharCount, OUSt { using namespace std; - if (eType != NUMBERFORMAT_NUMBER) + if (eType != css::util::NumberFormat::NUMBER) { return false; } @@ -2069,7 +2069,7 @@ bool SvNumberformat::GetOutputString(double fNumber, OUStringBuffer sBuff; OutString.clear(); *ppColor = NULL; // No color change - if (eType & NUMBERFORMAT_LOGICAL) + if (eType & css::util::NumberFormat::LOGICAL) { if (fNumber) { @@ -2081,7 +2081,7 @@ bool SvNumberformat::GetOutputString(double fNumber, } return false; } - if (eType & NUMBERFORMAT_TEXT) + if (eType & css::util::NumberFormat::TEXT) { ImpGetOutputStandard(fNumber, sBuff); OutString = sBuff.makeStringAndClear(); @@ -2097,7 +2097,7 @@ bool SvNumberformat::GetOutputString(double fNumber, } switch (eType) { - case NUMBERFORMAT_NUMBER: // Standard number format + case css::util::NumberFormat::NUMBER: // Standard number format if (rScan.GetStandardPrec() == SvNumberFormatter::UNLIMITED_PRECISION) { bool bSign = ::rtl::math::isSignBitSet(fNumber); @@ -2142,15 +2142,15 @@ bool SvNumberformat::GetOutputString(double fNumber, ImpGetOutputStandard(fNumber, sBuff); bHadStandard = true; break; - case NUMBERFORMAT_DATE: + case css::util::NumberFormat::DATE: bRes |= ImpGetDateOutput(fNumber, 0, sBuff); bHadStandard = true; break; - case NUMBERFORMAT_TIME: + case css::util::NumberFormat::TIME: bRes |= ImpGetTimeOutput(fNumber, 0, sBuff); bHadStandard = true; break; - case NUMBERFORMAT_DATETIME: + case css::util::NumberFormat::DATETIME: bRes |= ImpGetDateTimeOutput(fNumber, 0, sBuff); bHadStandard = true; break; @@ -2185,7 +2185,7 @@ bool SvNumberformat::GetOutputString(double fNumber, *ppColor = NumFor[nIx].GetColor(); const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); const sal_uInt16 nAnz = NumFor[nIx].GetCount(); - if (nAnz == 0 && rInfo.eScannedType == NUMBERFORMAT_UNDEFINED) + if (nAnz == 0 && rInfo.eScannedType == css::util::NumberFormat::UNDEFINED) { return false; // Empty => nothing } @@ -2197,8 +2197,8 @@ bool SvNumberformat::GetOutputString(double fNumber, } switch (rInfo.eScannedType) { - case NUMBERFORMAT_TEXT: - case NUMBERFORMAT_DEFINED: + case css::util::NumberFormat::TEXT: + case css::util::NumberFormat::DEFINED: for (sal_uInt16 i = 0; i < nAnz; i++) { switch (rInfo.nTypeArray[i]) @@ -2228,24 +2228,24 @@ bool SvNumberformat::GetOutputString(double fNumber, } } break; - case NUMBERFORMAT_DATE: + case css::util::NumberFormat::DATE: bRes |= ImpGetDateOutput(fNumber, nIx, sBuff); break; - case NUMBERFORMAT_TIME: + case css::util::NumberFormat::TIME: bRes |= ImpGetTimeOutput(fNumber, nIx, sBuff); break; - case NUMBERFORMAT_DATETIME: + case css::util::NumberFormat::DATETIME: bRes |= ImpGetDateTimeOutput(fNumber, nIx, sBuff); break; - case NUMBERFORMAT_NUMBER: - case NUMBERFORMAT_PERCENT: - case NUMBERFORMAT_CURRENCY: + case css::util::NumberFormat::NUMBER: + case css::util::NumberFormat::PERCENT: + case css::util::NumberFormat::CURRENCY: bRes |= ImpGetNumberOutput(fNumber, nIx, sBuff); break; - case NUMBERFORMAT_FRACTION: + case css::util::NumberFormat::FRACTION: bRes |= ImpGetFractionOutput(fNumber, nIx, sBuff); break; - case NUMBERFORMAT_SCIENTIFIC: + case css::util::NumberFormat::SCIENTIFIC: bRes |= ImpGetScientificOutput(fNumber, nIx, sBuff); break; } @@ -3192,7 +3192,7 @@ void SvNumberformat::ImpAppendEraG( OUStringBuffer& OutString, bool SvNumberformat::ImpIsIso8601( const ImpSvNumFor& rNumFor ) { bool bIsIso = false; - if ((eType & NUMBERFORMAT_DATE) == NUMBERFORMAT_DATE) + if ((eType & css::util::NumberFormat::DATE) == css::util::NumberFormat::DATE) { enum State { @@ -3846,7 +3846,7 @@ bool SvNumberformat::ImpGetNumberOutput(double fNumber, } } const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info(); - if (rInfo.eScannedType == NUMBERFORMAT_PERCENT) + if (rInfo.eScannedType == css::util::NumberFormat::PERCENT) { if (fNumber < _D_MAX_D_BY_100) { @@ -4366,7 +4366,7 @@ void SvNumberformat::GetNumForInfo( sal_uInt16 nNumFor, short& rScannedType, rScannedType = rInfo.eScannedType; bThousand = rInfo.bThousand; nPrecision = rInfo.nCntPost; - if (bStandard && rInfo.eScannedType == NUMBERFORMAT_NUMBER) + if (bStandard && rInfo.eScannedType == css::util::NumberFormat::NUMBER) { // StandardFormat nAnzLeading = 1; @@ -4541,7 +4541,7 @@ bool SvNumberformat::HasPositiveBracketPlaceholder() const DateFormat SvNumberformat::GetDateOrder() const { - if ( (eType & NUMBERFORMAT_DATE) == NUMBERFORMAT_DATE ) + if ( (eType & css::util::NumberFormat::DATE) == css::util::NumberFormat::DATE ) { short const * const pType = NumFor[0].Info().nTypeArray; sal_uInt16 nAnz = NumFor[0].GetCount(); @@ -4578,7 +4578,7 @@ DateFormat SvNumberformat::GetDateOrder() const sal_uInt32 SvNumberformat::GetExactDateOrder() const { sal_uInt32 nRet = 0; - if ( (eType & NUMBERFORMAT_DATE) != NUMBERFORMAT_DATE ) + if ( (eType & css::util::NumberFormat::DATE) != css::util::NumberFormat::DATE ) { SAL_WARN( "svl.numbers", "SvNumberformat::GetExactDateOrder: no date" ); return nRet; diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 582c23356b7b..04c8d177c5df 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -1089,7 +1089,7 @@ void ImpSvNumberformatScan::Reset() { nAnzStrings = 0; nAnzResStrings = 0; - eScannedType = NUMBERFORMAT_UNDEFINED; + eScannedType = css::util::NumberFormat::UNDEFINED; nRepPos = 0; bExp = false; bThousand = false; @@ -1137,7 +1137,7 @@ sal_Int32 ImpSvNumberformatScan::ScanType() switch (nTypeArray[i]) { case NF_KEY_E: // E - eNewType = NUMBERFORMAT_SCIENTIFIC; + eNewType = css::util::NumberFormat::SCIENTIFIC; break; case NF_KEY_AMPM: // AM,A,PM,P case NF_KEY_AP: @@ -1145,7 +1145,7 @@ sal_Int32 ImpSvNumberformatScan::ScanType() case NF_KEY_HH: // HH case NF_KEY_S: // S case NF_KEY_SS: // SS - eNewType = NUMBERFORMAT_TIME; + eNewType = css::util::NumberFormat::TIME; break; case NF_KEY_M: // M case NF_KEY_MM: // MM @@ -1159,12 +1159,12 @@ sal_Int32 ImpSvNumberformatScan::ScanType() nIndexNex == NF_KEY_SS || // SS cChar == '[' ) // [M { - eNewType = NUMBERFORMAT_TIME; + eNewType = css::util::NumberFormat::TIME; nTypeArray[i] -= 2; // 6 -> 4, 7 -> 5 } else { - eNewType = NUMBERFORMAT_DATE; + eNewType = css::util::NumberFormat::DATE; } break; case NF_KEY_MMM: // MMM @@ -1191,17 +1191,17 @@ sal_Int32 ImpSvNumberformatScan::ScanType() case NF_KEY_GGG : // GGG case NF_KEY_R : // R case NF_KEY_RR : // RR - eNewType = NUMBERFORMAT_DATE; + eNewType = css::util::NumberFormat::DATE; break; case NF_KEY_CCC: // CCC - eNewType = NUMBERFORMAT_CURRENCY; + eNewType = css::util::NumberFormat::CURRENCY; break; case NF_KEY_GENERAL: // Standard - eNewType = NUMBERFORMAT_NUMBER; + eNewType = css::util::NumberFormat::NUMBER; bHaveGeneral = true; break; default: - eNewType = NUMBERFORMAT_UNDEFINED; + eNewType = css::util::NumberFormat::UNDEFINED; break; } } @@ -1211,15 +1211,15 @@ sal_Int32 ImpSvNumberformatScan::ScanType() { case '#': case '?': - eNewType = NUMBERFORMAT_NUMBER; + eNewType = css::util::NumberFormat::NUMBER; break; case '0': - if ( (eScannedType & NUMBERFORMAT_TIME) == NUMBERFORMAT_TIME ) + if ( (eScannedType & css::util::NumberFormat::TIME) == css::util::NumberFormat::TIME ) { if ( Is100SecZero( i, bDecSep ) ) { bDecSep = true; // subsequent 0's - eNewType = NUMBERFORMAT_TIME; + eNewType = css::util::NumberFormat::TIME; } else { @@ -1228,28 +1228,28 @@ sal_Int32 ImpSvNumberformatScan::ScanType() } else { - eNewType = NUMBERFORMAT_NUMBER; + eNewType = css::util::NumberFormat::NUMBER; } break; case '%': - eNewType = NUMBERFORMAT_PERCENT; + eNewType = css::util::NumberFormat::PERCENT; break; case '/': - eNewType = NUMBERFORMAT_FRACTION; + eNewType = css::util::NumberFormat::FRACTION; break; case '[': if ( i < nAnzStrings-1 && nTypeArray[i+1] == NF_SYMBOLTYPE_STRING && sStrArray[i+1][0] == '$' ) { - eNewType = NUMBERFORMAT_CURRENCY; + eNewType = css::util::NumberFormat::CURRENCY; bMatchBracket = true; } else if ( i < nAnzStrings-1 && nTypeArray[i+1] == NF_SYMBOLTYPE_STRING && sStrArray[i+1][0] == '~' ) { - eNewType = NUMBERFORMAT_DATE; + eNewType = css::util::NumberFormat::DATE; bMatchBracket = true; } else @@ -1261,7 +1261,7 @@ sal_Int32 ImpSvNumberformatScan::ScanType() nIndexNex == NF_KEY_MM || // MM nIndexNex == NF_KEY_S || // S nIndexNex == NF_KEY_SS ) // SS - eNewType = NUMBERFORMAT_TIME; + eNewType = css::util::NumberFormat::TIME; else { return nPos; // Error @@ -1269,44 +1269,44 @@ sal_Int32 ImpSvNumberformatScan::ScanType() } break; case '@': - eNewType = NUMBERFORMAT_TEXT; + eNewType = css::util::NumberFormat::TEXT; break; default: if (pLoc->getTime100SecSep().equals(sStrArray[i])) { bDecSep = true; // for SS,0 } - eNewType = NUMBERFORMAT_UNDEFINED; + eNewType = css::util::NumberFormat::UNDEFINED; break; } } - if (eScannedType == NUMBERFORMAT_UNDEFINED) + if (eScannedType == css::util::NumberFormat::UNDEFINED) { eScannedType = eNewType; } - else if (eScannedType == NUMBERFORMAT_TEXT || eNewType == NUMBERFORMAT_TEXT) + else if (eScannedType == css::util::NumberFormat::TEXT || eNewType == css::util::NumberFormat::TEXT) { - eScannedType = NUMBERFORMAT_TEXT; // Text always remains text + eScannedType = css::util::NumberFormat::TEXT; // Text always remains text } - else if (eNewType == NUMBERFORMAT_UNDEFINED) + else if (eNewType == css::util::NumberFormat::UNDEFINED) { // Remains as is } else if (eScannedType != eNewType) { switch (eScannedType) { - case NUMBERFORMAT_DATE: + case css::util::NumberFormat::DATE: switch (eNewType) { - case NUMBERFORMAT_TIME: - eScannedType = NUMBERFORMAT_DATETIME; + case css::util::NumberFormat::TIME: + eScannedType = css::util::NumberFormat::DATETIME; break; - case NUMBERFORMAT_FRACTION: // DD/MM + case css::util::NumberFormat::FRACTION: // DD/MM break; default: if (nCurrPos >= 0) { - eScannedType = NUMBERFORMAT_UNDEFINED; + eScannedType = css::util::NumberFormat::UNDEFINED; } else if ( sStrArray[i] != OUString(pFormatter->GetDateSep()) ) { @@ -1314,18 +1314,18 @@ sal_Int32 ImpSvNumberformatScan::ScanType() } } break; - case NUMBERFORMAT_TIME: + case css::util::NumberFormat::TIME: switch (eNewType) { - case NUMBERFORMAT_DATE: - eScannedType = NUMBERFORMAT_DATETIME; + case css::util::NumberFormat::DATE: + eScannedType = css::util::NumberFormat::DATETIME; break; - case NUMBERFORMAT_FRACTION: // MM/SS + case css::util::NumberFormat::FRACTION: // MM/SS break; default: if (nCurrPos >= 0) { - eScannedType = NUMBERFORMAT_UNDEFINED; + eScannedType = css::util::NumberFormat::UNDEFINED; } else if (!pLoc->getTimeSep().equals(sStrArray[i])) { @@ -1334,18 +1334,18 @@ sal_Int32 ImpSvNumberformatScan::ScanType() break; } break; - case NUMBERFORMAT_DATETIME: + case css::util::NumberFormat::DATETIME: switch (eNewType) { - case NUMBERFORMAT_TIME: - case NUMBERFORMAT_DATE: + case css::util::NumberFormat::TIME: + case css::util::NumberFormat::DATE: break; - case NUMBERFORMAT_FRACTION: // DD/MM + case css::util::NumberFormat::FRACTION: // DD/MM break; default: if (nCurrPos >= 0) { - eScannedType = NUMBERFORMAT_UNDEFINED; + eScannedType = css::util::NumberFormat::UNDEFINED; } else if ( OUString(pFormatter->GetDateSep()) != sStrArray[i] && !pLoc->getTimeSep().equals(sStrArray[i]) ) @@ -1354,37 +1354,37 @@ sal_Int32 ImpSvNumberformatScan::ScanType() } } break; - case NUMBERFORMAT_PERCENT: + case css::util::NumberFormat::PERCENT: switch (eNewType) { - case NUMBERFORMAT_NUMBER: // Only number to percent + case css::util::NumberFormat::NUMBER: // Only number to percent break; default: return nPos; } break; - case NUMBERFORMAT_SCIENTIFIC: + case css::util::NumberFormat::SCIENTIFIC: switch (eNewType) { - case NUMBERFORMAT_NUMBER: // Only number to E + case css::util::NumberFormat::NUMBER: // Only number to E break; default: return nPos; } break; - case NUMBERFORMAT_NUMBER: + case css::util::NumberFormat::NUMBER: switch (eNewType) { - case NUMBERFORMAT_SCIENTIFIC: - case NUMBERFORMAT_PERCENT: - case NUMBERFORMAT_FRACTION: - case NUMBERFORMAT_CURRENCY: + case css::util::NumberFormat::SCIENTIFIC: + case css::util::NumberFormat::PERCENT: + case css::util::NumberFormat::FRACTION: + case css::util::NumberFormat::CURRENCY: eScannedType = eNewType; break; default: if (nCurrPos >= 0) { - eScannedType = NUMBERFORMAT_UNDEFINED; + eScannedType = css::util::NumberFormat::UNDEFINED; } else { @@ -1392,10 +1392,10 @@ sal_Int32 ImpSvNumberformatScan::ScanType() } } break; - case NUMBERFORMAT_FRACTION: + case css::util::NumberFormat::FRACTION: switch (eNewType) { - case NUMBERFORMAT_NUMBER: // Only number to fraction + case css::util::NumberFormat::NUMBER: // Only number to fraction break; default: return nPos; @@ -1431,15 +1431,15 @@ sal_Int32 ImpSvNumberformatScan::ScanType() SkipStrings(i, nPos); } - if ((eScannedType == NUMBERFORMAT_NUMBER || - eScannedType == NUMBERFORMAT_UNDEFINED) && + if ((eScannedType == css::util::NumberFormat::NUMBER || + eScannedType == css::util::NumberFormat::UNDEFINED) && nCurrPos >= 0 && !bHaveGeneral) { - eScannedType = NUMBERFORMAT_CURRENCY; // old "automatic" currency + eScannedType = css::util::NumberFormat::CURRENCY; // old "automatic" currency } - if (eScannedType == NUMBERFORMAT_UNDEFINED) + if (eScannedType == css::util::NumberFormat::UNDEFINED) { - eScannedType = NUMBERFORMAT_DEFINED; + eScannedType = css::util::NumberFormat::DEFINED; } return 0; // All is fine } @@ -1567,8 +1567,8 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) switch (eScannedType) { - case NUMBERFORMAT_TEXT: - case NUMBERFORMAT_DEFINED: + case css::util::NumberFormat::TEXT: + case css::util::NumberFormat::DEFINED: while (i < nAnzStrings) { switch (nTypeArray[i]) @@ -1591,16 +1591,16 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } // of while break; - case NUMBERFORMAT_NUMBER: - case NUMBERFORMAT_PERCENT: - case NUMBERFORMAT_CURRENCY: - case NUMBERFORMAT_SCIENTIFIC: - case NUMBERFORMAT_FRACTION: + case css::util::NumberFormat::NUMBER: + case css::util::NumberFormat::PERCENT: + case css::util::NumberFormat::CURRENCY: + case css::util::NumberFormat::SCIENTIFIC: + case css::util::NumberFormat::FRACTION: while (i < nAnzStrings) { // TODO: rechecking eScannedType is unnecessary. - // This switch-case is for eScannedType == NUMBERFORMAT_FRACTION anyway - if (eScannedType == NUMBERFORMAT_FRACTION && // special case + // This switch-case is for eScannedType == css::util::NumberFormat::FRACTION anyway + if (eScannedType == css::util::NumberFormat::FRACTION && // special case nTypeArray[i] == NF_SYMBOLTYPE_DEL && // # ### #/# StringEqualsChar( sOldThousandSep, ' ' ) && // e.g. France or Sweden StringEqualsChar( sStrArray[i], ' ' ) && @@ -1629,7 +1629,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) else if (nTypeArray[i] == NF_SYMBOLTYPE_STRING || // No Strings or nTypeArray[i] > 0) // Keywords { - if (eScannedType == NUMBERFORMAT_SCIENTIFIC && + if (eScannedType == css::util::NumberFormat::SCIENTIFIC && nTypeArray[i] == NF_KEY_E) // E+ { if (bExp) // Double @@ -1649,7 +1649,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) nCounter = 0; nTypeArray[i] = NF_SYMBOLTYPE_EXP; } - else if (eScannedType == NUMBERFORMAT_FRACTION && + else if (eScannedType == css::util::NumberFormat::FRACTION && sStrArray[i][0] == ' ') { if (!bBlank && !bFrac) // Not double or after a / @@ -1696,7 +1696,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) nCounter = nCntPre; } // don't artificially increment nCntPre for forced denominator - if ( ( eScannedType != NUMBERFORMAT_FRACTION ) && (!nCntPre) ) + if ( ( eScannedType != css::util::NumberFormat::FRACTION ) && (!nCntPre) ) { nCntPre++; } @@ -1774,7 +1774,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) // currency formats the last dash will be // interpreted literally as a minus sign. // Has to be this ugly. Period. - if ( eScannedType == NUMBERFORMAT_CURRENCY + if ( eScannedType == css::util::NumberFormat::CURRENCY && rStr.getLength() >= 2 && (i == nAnzStrings-1 || sStrArray[i+1][0] != '-') ) @@ -1971,7 +1971,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) else // . without meaning { if (cSaved == ' ' && - eScannedType == NUMBERFORMAT_FRACTION && + eScannedType == css::util::NumberFormat::FRACTION && StringEqualsChar( sStrArray[i], ' ' ) ) { if (!bBlank && !bFrac) // no dups @@ -2005,7 +2005,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } break; case '/': - if (eScannedType == NUMBERFORMAT_FRACTION) + if (eScannedType == css::util::NumberFormat::FRACTION) { if ( i == 0 || (nTypeArray[i-1] != NF_SYMBOLTYPE_DIGIT && @@ -2035,7 +2035,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } break; case '[' : - if ( eScannedType == NUMBERFORMAT_CURRENCY && + if ( eScannedType == css::util::NumberFormat::CURRENCY && i < nAnzStrings-1 && nTypeArray[i+1] == NF_SYMBOLTYPE_STRING && sStrArray[i+1][0] == '$' ) @@ -2101,7 +2101,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } break; default: // Other Dels - if (eScannedType == NUMBERFORMAT_PERCENT && cHere == '%') + if (eScannedType == css::util::NumberFormat::PERCENT && cHere == '%') { nTypeArray[i] = NF_SYMBOLTYPE_PERCENT; } @@ -2121,7 +2121,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) i++; } } // of while - if (eScannedType == NUMBERFORMAT_FRACTION) + if (eScannedType == css::util::NumberFormat::FRACTION) { if (bFrac) { @@ -2228,8 +2228,8 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) } } } - break; // of NUMBERFORMAT_NUMBER - case NUMBERFORMAT_DATE: + break; // of css::util::NumberFormat::NUMBER + case css::util::NumberFormat::DATE: while (i < nAnzStrings) { int nCalRet; @@ -2306,8 +2306,8 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) break; } } // of while - break; // of NUMBERFORMAT_DATE - case NUMBERFORMAT_TIME: + break; // of css::util::NumberFormat::DATE + case css::util::NumberFormat::TIME: while (i < nAnzStrings) { sal_Unicode cChar; @@ -2447,8 +2447,8 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) { nCntExp = 1; // Remembers AM/PM } - break; // of NUMBERFORMAT_TIME - case NUMBERFORMAT_DATETIME: + break; // of css::util::NumberFormat::TIME + case css::util::NumberFormat::DATETIME: while (i < nAnzStrings) { int nCalRet; @@ -2612,16 +2612,16 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) { nCntExp = 1; // Remembers AM/PM } - break; // of NUMBERFORMAT_DATETIME + break; // of css::util::NumberFormat::DATETIME default: break; } - if (eScannedType == NUMBERFORMAT_SCIENTIFIC && + if (eScannedType == css::util::NumberFormat::SCIENTIFIC && (nCntPre + nCntPost == 0 || nCntExp == 0)) { return nPos; } - else if (eScannedType == NUMBERFORMAT_FRACTION && (nCntExp > 8 || nCntExp == 0)) + else if (eScannedType == css::util::NumberFormat::FRACTION && (nCntExp > 8 || nCntExp == 0)) { return nPos; } @@ -2638,7 +2638,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) if ( nTypeArray[i] == NF_SYMBOLTYPE_STRING && sStrArray[i][0] != '\"' ) { - if ( bConvertSystemToSystem && eScannedType == NUMBERFORMAT_CURRENCY ) + if ( bConvertSystemToSystem && eScannedType == css::util::NumberFormat::CURRENCY ) { // don't stringize automatic currency, will be converted if ( sStrArray[i] == sOldCurSymbol ) @@ -2718,7 +2718,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) case ' ': case '.': case '/': - if (((eScannedType & NUMBERFORMAT_DATE) == 0) && + if (((eScannedType & css::util::NumberFormat::DATE) == 0) && (StringEqualsChar( pFormatter->GetNumThousandSep(), c) || StringEqualsChar( pFormatter->GetNumDecimalSep(), c) || (c == ' ' && @@ -2727,18 +2727,18 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) { rString += sStrArray[i]; } - else if ((eScannedType & NUMBERFORMAT_DATE) && + else if ((eScannedType & css::util::NumberFormat::DATE) && StringEqualsChar( pFormatter->GetDateSep(), c)) { rString += sStrArray[i]; } - else if ((eScannedType & NUMBERFORMAT_TIME) && + else if ((eScannedType & css::util::NumberFormat::TIME) && (StringEqualsChar( pLoc->getTimeSep(), c) || StringEqualsChar( pLoc->getTime100SecSep(), c))) { rString += sStrArray[i]; } - else if (eScannedType & NUMBERFORMAT_FRACTION) + else if (eScannedType & css::util::NumberFormat::FRACTION) { rString += sStrArray[i]; } @@ -2758,7 +2758,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) if ( RemoveQuotes( sStrArray[i] ) > 0 ) { // update currency up to quoted string - if ( eScannedType == NUMBERFORMAT_CURRENCY ) + if ( eScannedType == css::util::NumberFormat::CURRENCY ) { // dM -> DM or DM -> $ in old automatic // currency formats, oh my ..., why did we ever introduce them? @@ -2801,7 +2801,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) { i--; // enter switch on next symbol again } - if ( eScannedType == NUMBERFORMAT_CURRENCY && nStringPos < rString.getLength() ) + if ( eScannedType == css::util::NumberFormat::CURRENCY && nStringPos < rString.getLength() ) { // same as above, since last RemoveQuotes OUString aTmp( pChrCls->uppercase( sStrArray[iPos], nArrPos, |