19#ifndef INCLUDED_SVL_ZFORMAT_HXX
20#define INCLUDED_SVL_ZFORMAT_HXX
28 class DigitGroupingIterator;
161 OUString generateCode()
const;
166 bool isPlainLocale()
const;
174 sal_Int32& nCheckPos,
176 bool bReplaceBooleanEquivalent =
true );
206 return maLocale.meSubstitute != LocaleType::Substitute::NONE;
214 return maLocale.meSubstitute == LocaleType::Substitute::TIME && maLocale.meLanguage ==
LANGUAGE_SYSTEM;
222 return maLocale.meSubstitute == LocaleType::Substitute::LONGDATE && maLocale.meLanguage ==
LANGUAGE_SYSTEM;
228 bool IsMinuteSecondFormat()
const;
236 bool bSystemLanguage =
false )
const;
244 bool GetOutputString(
double fNumber, sal_uInt16 nCharCount, OUString& rOutString )
const;
246 bool GetOutputString(
double fNumber, OUString& OutString,
const Color** ppColor );
247 void GetOutputString( std::u16string_view sString, OUString& OutString,
const Color** ppColor );
254 return (NumFor[3].GetCount() > 0) ||
258 void GetFormatSpecialInfo(
bool& bThousand,
260 sal_uInt16& nPrecision,
261 sal_uInt16& nLeadingCnt)
const;
264 sal_uInt16 GetSubformatIndex(
double fNumber )
const;
268 {
return NumFor[nIx].Info().nCntPost; }
272 {
return NumFor[nIx].Info().nCntPre; }
283 sal_uInt16 GetThousandDivisorPrecision( sal_uInt16 nIx = 0 )
const;
289 {
return NumFor[0].Info().nThousand; }
291 { NumFor[0].Info().nThousand = nKey; }
300 const OUString* GetNumForString( sal_uInt16 nNumFor, sal_uInt16 nPos,
301 bool bString =
false )
const;
305 short GetNumForType( sal_uInt16 nNumFor, sal_uInt16 nPos )
const;
307 OUString GetPercentString( sal_uInt16 nNumFor = 0 )
const;
309 OUString GetDenominatorString( sal_uInt16 nNumFor )
const;
310 OUString GetNumeratorString( sal_uInt16 nNumFor )
const;
311 OUString GetIntegerFractionDelimiterString( sal_uInt16 nNumFor )
const;
313 double GetRoundFractionValue (
double fNumber )
const;
316 OUString GetFormatStringForTimePrecision(
int nPrecision )
const;
324 sal_uInt16 nNumCount )
const
333 sal_uInt16 nCnt = NumFor[nNumFor].GetCount();
334 if ( nAllCount == nCnt )
336 if ( nAllCount < nCnt )
337 return ImpGetNumForStringElementCount( nNumFor ) ==
338 (nAllCount - nNumCount);
343 sal_uInt16 GetNumForNumberElementCount( sal_uInt16 nNumFor )
const;
355 return fLimit1 == 0.0 && fLimit2 == 0.0 &&
365 return fLimit1 == 0.0 && fLimit2 == 0.0 &&
374 bool IsNegativeWithoutSign()
const;
376 bool IsNegativeInBracket()
const;
378 bool HasPositiveBracketPlaceholder()
const;
381 bool HasNewCurrency()
const;
384 static OUString StripNewCurrencyDelimiters(
const OUString& rStr );
389 bool GetNewCurrencySymbol( OUString& rSymbol, OUString& rExtension )
const;
391 static bool HasStringNegativeSign(
const OUString& rStr );
403 static bool IsInQuote(
const OUString& rString, sal_Int32 nPos,
418 static sal_Int32 GetQuoteEnd(
const OUString& rString, sal_Int32 nPos,
431 OUStringBuffer sBuff(r);
434 r = sBuff.makeStringAndClear();
441 static sal_Int32 InsertBlanks( OUStringBuffer& r, sal_Int32 nPos,
sal_Unicode c );
449 sal_uInt32 GetExactDateOrder()
const;
454 const Color* GetColor( sal_uInt16 nNumFor )
const;
456 bool& bThousand, sal_uInt16& nPrecision, sal_uInt16& nLeadingCnt )
const;
460 css::i18n::NativeNumberXmlAttributes2& rAttr,
461 sal_uInt16 nNumFor )
const;
464 OUString GetNatNumModifierString( sal_uInt16 nNumFor = 0 )
const;
469 void SwitchToOtherCalendar( OUString& rOrgCalendar,
double& fOrgDateTime )
const;
475 void SwitchToGregorianCalendar( std::u16string_view rOrgCalendar,
double fOrgDateTime )
const;
486 bool SwitchToSpecifiedCalendar( OUString& rOrgCalendar,
double& fOrgDateTime,
487 sal_uInt16 nNumFor )
const
490 return ImpSwitchToSpecifiedCalendar( rOrgCalendar,
491 fOrgDateTime, NumFor[nNumFor] );
500 return ImpIsIso8601( NumFor[nNumFor]);
520 SVL_DLLPRIVATE sal_uInt16 ImpGetNumForStringElementCount( sal_uInt16 nNumFor )
const;
525 SVL_DLLPRIVATE bool ImpSwitchToSpecifiedCalendar( OUString& rOrgCalendar,
526 double& fOrgDateTime,
561 OUString& sSymbol )
const;
564 SVL_DLLPRIVATE static sal_Int32 ImpGetNumber( OUStringBuffer& rString,
605 SVL_DLLPRIVATE OUString ImpObtainCalendarAndNumerals( OUStringBuffer & rString,
611 SVL_DLLPRIVATE void ImpGetOutputStandard(
double& fNumber, OUString& OutString )
const;
612 SVL_DLLPRIVATE void ImpGetOutputStandard(
double& fNumber, OUStringBuffer& OutString )
const;
613 SVL_DLLPRIVATE void ImpGetOutputStdToPrecision(
double& rNumber, OUString& rOutString, sal_uInt16 nPrecision )
const;
615 SVL_DLLPRIVATE void ImpGetOutputInputLine(
double fNumber, OUString& OutString )
const;
632 bool bInsertRightBlank =
false );
635 SVL_DLLPRIVATE bool ImpNumberFillWithThousands( OUStringBuffer& sStr,
641 bool bAddDecSep =
true );
649 sal_Int32 & nDigitCount,
671 sal_Int64& nDiv )
const;
674 OUStringBuffer& OutString);
677 OUStringBuffer& OutString);
681 OUStringBuffer& OutString );
684 OUStringBuffer& OutString );
687 OUStringBuffer& OutString );
694 SVL_DLLPRIVATE bool ImpFallBackToGregorianCalendar( OUString& rOrgCalendar,
double& fOrgDateTime );
704 OUStringBuffer& OutString );
708 OUStringBuffer& OutString );
715 sal_uInt16 nMinDigits )
const;
717 OUString
ImpIntToString( sal_uInt16 nIx, sal_Int64 nVal, sal_uInt16 nMinDigits = 0 )
const
722 return ImpGetNatNumString( rNum, nVal, nMinDigits );
724 return OUString::number(nVal);
733 SVL_DLLPRIVATE sal_uInt16 ImpGetFractionOfSecondString( OUStringBuffer& rBuf,
double fFractionOfSecond,
734 int nFractionDecimals,
bool bAddOneRoundingDecimal, sal_uInt16 nIx, sal_uInt16 nMinimumInputLineDecimals );
743 return rNum.
IsComplete() ? impTransliterateImpl(rStr, rNum) : rStr;
750 impTransliterateImpl(rStr, rNum);
756 return rNum.
IsComplete() ? impTransliterateImpl(rStr, rNum, nDateKey) : rStr;
void SetColor(const Color *pCol, OUString const &rName)
const SvNumberNatNum & GetNatNum() const
bool HasNewCurrency() const
void SetNatNumParams(const OUString &sParams)
const OUString & GetColorName() const
const ImpSvNumberformatInfo & Info() const
void SetNatNumDate(bool bDate)
const Color * GetColor() const
ImpSvNumberformatInfo & Info()
void Copy(const ImpSvNumFor &rNumFor, const ImpSvNumberformatScan *pSc)
void Enlarge(sal_uInt16 nCount)
bool GetNewCurrencySymbol(OUString &rSymbol, OUString &rExtension) const
void SetNatNumNum(sal_uInt8 nNum, bool bDBNum)
sal_uInt16 GetCount() const
void SetNatNumLang(LanguageType eLang)
void SetDate(bool bDateP)
void SetLang(LanguageType e)
sal_uInt8 GetNatNum() const
void SetNum(sal_uInt8 nNumber, bool bDBNumber)
void SetParams(const OUString &s)
sal_uInt8 GetDBNum() const
static sal_uInt8 MapNatNumToDBNum(sal_uInt8 nNatNum, LanguageType eLang, bool bDate)
OUString const & GetParams() const
LanguageType GetLang() const
static sal_uInt8 MapDBNumToNatNum(sal_uInt8 nDBNum, LanguageType eLang, bool bDate)
#define LANGUAGE_DONTKNOW
::std::array< OUString, NF_KEYWORD_ENTRIES_COUNT > NfKeywordTable
NfKeywordIndex
For ImpSvNumberformatScan: first the short symbols, then the long symbols! e.g.
SvNumFormatType
MAX_ULONG.
@ UNDEFINED
is used as a return value if no format exists.
@ TEXT
selects text number formats.
@ DEFINED
selects only user-defined number formats.