LibreOffice Module svl (master) 1
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
SvNumberFormatter Class Reference

#include <numformat.hxx>

Collaboration diagram for SvNumberFormatter:
[legend]

Classes

struct  InputScannerPrivateAccess
 

Public Member Functions

 SvNumberFormatter (const css::uno::Reference< css::uno::XComponentContext > &rxContext, LanguageType eLang)
 Preferred ctor with service manager and language/country enum. More...
 
 ~SvNumberFormatter ()
 
void SetColorLink (const Link< sal_uInt16, Color * > &rColorTableCallBack)
 Set CallBack to ColorTable. More...
 
ColorGetUserDefColor (sal_uInt16 nIndex)
 Do the CallBack to ColorTable. More...
 
void ChangeIntl (LanguageType eLnge)
 Change language/country, also input and format scanner. More...
 
void ChangeNullDate (sal_uInt16 nDay, sal_uInt16 nMonth, sal_Int16 nYear)
 Change the reference null date. More...
 
void ChangeStandardPrec (short nPrec)
 Change standard precision. More...
 
void SetNoZero (bool bNZ)
 Set zero value suppression. More...
 
LanguageType GetLanguage () const
 The language with which the formatter was initialized (system setting), NOT the current language after a ChangeIntl() More...
 
SvNumberFormatTableGetEntryTable (SvNumFormatType eType, sal_uInt32 &FIndex, LanguageType eLnge)
 Get table of formats of a specific type of a locale. More...
 
SvNumberFormatTableChangeCL (SvNumFormatType eType, sal_uInt32 &FIndex, LanguageType eLnge)
 Get table of formats of a specific type of a language/country. More...
 
SvNumberFormatTableGetFirstEntryTable (SvNumFormatType &eType, sal_uInt32 &FIndex, LanguageType &rLnge)
 Get table of formats of the same type as FIndex; eType and rLnge are set accordingly. More...
 
void DeleteEntry (sal_uInt32 nKey)
 Delete an entry including the format it is referring to. More...
 
bool PutEntry (OUString &rString, sal_Int32 &nCheckPos, SvNumFormatType &nType, sal_uInt32 &nKey, LanguageType eLnge=LANGUAGE_DONTKNOW, bool bReplaceBooleanEquivalent=true)
 Create new entry of a format code string for language/country. More...
 
bool PutandConvertEntry (OUString &rString, sal_Int32 &nCheckPos, SvNumFormatType &nType, sal_uInt32 &nKey, LanguageType eLnge, LanguageType eNewLnge, bool bConvertDateOrder, bool bReplaceBooleanEquivalent=true)
 Same as <method>PutEntry</method> but the format code string is considered to be of language/country eLnge and is converted to language/country eNewLnge. More...
 
bool PutandConvertEntrySystem (OUString &rString, sal_Int32 &nCheckPos, SvNumFormatType &nType, sal_uInt32 &nKey, LanguageType eLnge, LanguageType eNewLnge)
 Same as <method>PutandConvertEntry</method> but the format code string is considered to be of the System language/country eLnge and is converted to another System language/country eNewLnge. More...
 
sal_uInt32 GetIndexPuttingAndConverting (OUString &rString, LanguageType eLnge, LanguageType eSysLnge, SvNumFormatType &rType, bool &rNewInserted, sal_Int32 &rCheckPos)
 Similar to <method>PutEntry</method> and <method>PutandConvertEntry</method> or <method>PutandConvertEntrySystem</method>, the format code string passed is considered to be of language/country eLnge. More...
 
OUString GenerateFormat (sal_uInt32 nIndex, LanguageType eLnge=LANGUAGE_DONTKNOW, bool bThousand=false, bool IsRed=false, sal_uInt16 nPrecision=0, sal_uInt16 nLeadingCnt=1)
 Create a format code string using format nIndex as a template and applying other settings (passed from the dialog) More...
 
bool IsNumberFormat (const OUString &sString, sal_uInt32 &F_Index, double &fOutNumber, SvNumInputOptions eInputOptions=SvNumInputOptions::NONE)
 Analyze an input string. More...
 
void GetOutputString (const double &fOutNumber, sal_uInt32 nFIndex, OUString &sOutString, const Color **ppColor, bool bUseStarFormat=false)
 Format a number according to a format index, return string and color. More...
 
void GetOutputString (const OUString &sString, sal_uInt32 nFIndex, OUString &sOutString, const Color **ppColor, bool bUseStarFormat=false)
 Format a string according to a format index, return string and color. More...
 
void GetInputLineString (const double &fOutNumber, sal_uInt32 nFIndex, OUString &rOutString, bool bFiltering=false, bool bForceSystemLocale=false)
 Format a number according to the standard default format matching the given format index. More...
 
bool GetPreviewString (const OUString &sFormatString, double fPreviewNumber, OUString &sOutString, const Color **ppColor, LanguageType eLnge, bool bUseStarFormat=false)
 Format a number according to a format code string to be scanned. More...
 
bool GetPreviewStringGuess (const OUString &sFormatString, double fPreviewNumber, OUString &sOutString, const Color **ppColor, LanguageType eLnge=LANGUAGE_DONTKNOW)
 Same as <method>GetPreviewString</method> but the format code string may be either language/country eLnge or en_US english US. More...
 
bool GetPreviewString (const OUString &sFormatString, const OUString &sPreviewString, OUString &sOutString, const Color **ppColor, LanguageType eLnge=LANGUAGE_DONTKNOW)
 Format a string according to a format code string to be scanned. More...
 
sal_uInt32 TestNewString (const OUString &sFormatString, LanguageType eLnge=LANGUAGE_DONTKNOW)
 Test whether the format code string is already present in container. More...
 
bool IsTextFormat (sal_uInt32 nFIndex) const
 Whether format index nFIndex is of type text or not. More...
 
bool IsNatNum12 (sal_uInt32 nFIndex) const
 Whether format index nFIndex has NatNum12 modifier. More...
 
void GetFormatSpecialInfo (sal_uInt32 nFormat, bool &bThousand, bool &IsRed, sal_uInt16 &nPrecision, sal_uInt16 &nLeadingCnt)
 Get additional info of a format index, e.g. for dialog box. More...
 
sal_uInt16 GetFormatPrecision (sal_uInt32 nFormat) const
 Count of decimals. More...
 
sal_uInt16 GetFormatIntegerDigits (sal_uInt32 nFormat) const
 Count of integer digits. More...
 
sal_uInt32 GetFormatSpecialInfo (const OUString &, bool &bThousand, bool &IsRed, sal_uInt16 &nPrecision, sal_uInt16 &nLeadingCnt, LanguageType eLnge=LANGUAGE_DONTKNOW)
 Get additional info of a format code string, e.g. More...
 
OUString GetCalcCellReturn (sal_uInt32 nFormat) const
 Get return string for Calc CELL() function, "G", "D1", ... More...
 
bool IsUserDefined (sal_uInt32 F_Index) const
 
bool IsUserDefined (std::u16string_view sStr, LanguageType eLnge=LANGUAGE_DONTKNOW)
 Check if format code string may be deleted by user. More...
 
sal_uInt32 GetEntryKey (std::u16string_view sStr, LanguageType eLnge=LANGUAGE_DONTKNOW)
 Return the format index of the format code string for language/country, or NUMBERFORMAT_ENTRY_NOT_FOUND. More...
 
const SvNumberformatGetEntry (sal_uInt32 nKey) const
 Return the format for a format index. More...
 
const SvNumberformatGetSubstitutedEntry (sal_uInt32 nKey, sal_uInt32 &o_rNewKey) const
 Obtain substituted GetFormatEntry(), i.e. system formats. More...
 
sal_uInt32 GetStandardIndex (LanguageType eLnge=LANGUAGE_DONTKNOW)
 Return the format index of the standard default number format for language/country. More...
 
sal_uInt32 GetStandardFormat (SvNumFormatType eType, LanguageType eLnge=LANGUAGE_DONTKNOW)
 Return the format index of the default format of a type for language/country. More...
 
sal_uInt32 GetStandardFormat (sal_uInt32 nFIndex, SvNumFormatType eType, LanguageType eLnge)
 Return the format index of the default format of a type for language/country. More...
 
sal_uInt32 GetStandardFormat (double fNumber, sal_uInt32 nFIndex, SvNumFormatType eType, LanguageType eLnge)
 Return the format index of the default format of a type for language/country. More...
 
bool IsSpecialStandardFormat (sal_uInt32 nFIndex, LanguageType eLnge)
 Whether nFIndex is a special builtin format. More...
 
sal_uInt32 GetTimeFormat (double fNumber, LanguageType eLnge, bool bForceDuration)
 Return a time format that best matches fNumber. More...
 
sal_uInt32 GuessDateTimeFormat (SvNumFormatType &rType, double fNumber, LanguageType eLnge)
 Return a format and type that best matches the value of fNumber if fNumber is assumed to be a date, time or datetime value, but unknown which. More...
 
sal_uInt32 GetEditFormat (double fNumber, sal_uInt32 nFIndex, SvNumFormatType eType, SvNumberformat const *pFormat, LanguageType eForLocale=LANGUAGE_DONTKNOW)
 Return the corresponding edit format of a format. More...
 
const DateGetNullDate () const
 Return the reference date. More...
 
sal_uInt16 GetStandardPrec () const
 Return the standard decimal precision. More...
 
bool GetNoZero () const
 Return whether zero suppression is switched on. More...
 
SvNumFormatType GetType (sal_uInt32 nFIndex) const
 Get the type of a format (or css::util::NumberFormat::UNDEFINED if no entry), but with css::util::NumberFormat::DEFINED masked out. More...
 
void ClearMergeTable ()
 As the name says. More...
 
SvNumberFormatterIndexTableMergeFormatter (SvNumberFormatter &rNewTable)
 Merge in all new entries from rNewTable and return a table of resulting new format indices. More...
 
bool HasMergeFormatTable () const
 Whether a merge table is present or not. More...
 
sal_uInt32 GetMergeFormatIndex (sal_uInt32 nOldFmt) const
 Return the new format index for an old format index, if a merge table exists. More...
 
SvNumberFormatterMergeMap ConvertMergeTableToMap ()
 Convert the ugly old tools' Table type bloated with new'ed sal_uInt32 entries merge table to ::std::map with old index key and new index key. More...
 
sal_uInt32 GetFormatForLanguageIfBuiltIn (sal_uInt32 nFormat, LanguageType eLnge=LANGUAGE_DONTKNOW)
 Return the format index of a builtin format for a specific language/country. More...
 
sal_uInt32 GetFormatIndex (NfIndexTableOffset, LanguageType eLnge=LANGUAGE_DONTKNOW)
 Return the format index for a builtin format of a specific language. More...
 
NfIndexTableOffset GetIndexTableOffset (sal_uInt32 nFormat) const
 Return enum index of a format index of a builtin format, NF_INDEX_TABLE_ENTRIES if it's not a builtin format. More...
 
void SetEvalDateFormat (NfEvalDateFormat eEDF)
 Set evaluation type and order of input date strings. More...
 
NfEvalDateFormat GetEvalDateFormat () const
 
void SetYear2000 (sal_uInt16 nVal)
 Set TwoDigitYearStart, how the input string scanner handles a two digit year. More...
 
sal_uInt16 GetYear2000 () const
 
sal_uInt16 ExpandTwoDigitYear (sal_uInt16 nYear) const
 
OUString GetFormatDecimalSep (sal_uInt32 nFormat) const
 Return the decimal separator matching the locale of the given format. More...
 
OUString GetLangDecimalSep (LanguageType nLang) const
 Return the decimal separator matching the given locale / LanguageType. More...
 
sal_uInt16 GetCurrencyFormatStrings (NfWSStringsDtor &, const NfCurrencyEntry &, bool bBank) const
 Get all standard formats for a specific currency, formats are appended to the NfWSStringsDtor list. More...
 
bool GetNewCurrencySymbolString (sal_uInt32 nFormat, OUString &rSymbol, const NfCurrencyEntry **ppEntry, bool *pBank=nullptr) const
 Whether nFormat is of type css::util::NumberFormat::CURRENCY and the format code contains a new SYMBOLTYPE_CURRENCY and if so which one [$xxx-nnn]. More...
 
void GetCompatibilityCurrency (OUString &rSymbol, OUString &rAbbrev) const
 Get compatibility ("automatic" old style) currency from I18N locale data. More...
 
void GetUsedLanguages (std::vector< LanguageType > &rList)
 Fill rList with the language/country codes that have been allocated. More...
 
void FillKeywordTable (NfKeywordTable &rKeywords, LanguageType eLang)
 Fill a NfKeywordIndex table with keywords of a language/country. More...
 
void FillKeywordTableForExcel (NfKeywordTable &rKeywords)
 Fill a NfKeywordIndex table with keywords usable in Excel export with GetFormatStringForExcel() or SvNumberformat::GetMappedFormatstring() More...
 
OUString GetFormatStringForExcel (sal_uInt32 nKey, const NfKeywordTable &rKeywords, SvNumberFormatter &rTempFormatter) const
 Return a format code string suitable for Excel export. More...
 
OUString GetKeyword (LanguageType eLnge, sal_uInt16 nIndex)
 Return a keyword for a language/country and NfKeywordIndex for XML import, to generate number format strings. More...
 
OUString GetStandardName (LanguageType eLnge)
 Return the GENERAL keyword in proper case ("General") for a language/country, used in XML import. More...
 
const NfKeywordTableGetKeywords (sal_uInt32 nKey)
 Obtain NfKeywordTable used with a format, possibly localized. More...
 
const NfKeywordTableGetEnglishKeywords () const
 Access for unit tests. More...
 
const std::vector< Color > & GetStandardColors () const
 Access for unit tests. More...
 
size_t GetMaxDefaultColors () const
 Access for unit tests. More...
 
OnDemandLocaleDataWrapperGetOnDemandLocaleDataWrapper (const InputScannerPrivateAccess &)
 Access for input scanner to temporarily (!) switch locales. More...
 
void ResetDefaultSystemCurrency ()
 
void InvalidateDateAcceptancePatterns ()
 
void ReplaceSystemCL (LanguageType eOldLanguage)
 
const css::uno::Reference< css::uno::XComponentContext > & GetComponentContext () const
 
const ImpSvNumberformatScanGetFormatScanner () const
 The following method is not to be used from outside but must be public for the InputScanner. More...
 
const LanguageTagGetLanguageTag () const
 The following methods are not to be used from outside but must be public for the InputScanner and FormatScanner. More...
 
const ::utl::TransliterationWrapperGetTransliteration () const
 
const CharClassGetCharClass () const
 
const LocaleDataWrapperGetLocaleData () const
 
CalendarWrapperGetCalendar () const
 
const NativeNumberWrapper * GetNatNum () const
 
const OUString & GetNumDecimalSep () const
 
const OUString & GetNumDecimalSepAlt () const
 
const OUString & GetNumThousandSep () const
 
const OUString & GetDateSep () const
 
bool IsDecimalSep (std::u16string_view rStr) const
 

Static Public Member Functions

static bool IsCompatible (SvNumFormatType eOldType, SvNumFormatType eNewType)
 
static sal_uInt16 GetYear2000Default ()
 
static sal_uInt16 ExpandTwoDigitYear (sal_uInt16 nYear, sal_uInt16 nTwoDigitYearStart)
 
static void resetTheCurrencyTable ()
 
static const NfCurrencyTableGetTheCurrencyTable ()
 Return a NfCurrencyTable with pointers to <type>NfCurrencyEntry</type> entries. More...
 
static const NfCurrencyEntry * MatchSystemCurrency ()
 Searches, according to the default locale currency, an entry of the CurrencyTable which is <bold>not</bold> the first (LANGUAGE_SYSTEM) entry. More...
 
static const NfCurrencyEntry & GetCurrencyEntry (LanguageType)
 Return a NfCurrencyEntry matching a language/country. More...
 
static const NfCurrencyEntry * GetCurrencyEntry (std::u16string_view rAbbrev, LanguageType eLang)
 Return a NfCurrencyEntry pointer matching a language/country and currency abbreviation (AKA banking symbol). More...
 
static const NfCurrencyEntry * GetLegacyOnlyCurrencyEntry (std::u16string_view rSymbol, std::u16string_view rAbbrev)
 Return a NfCurrencyEntry pointer matching the symbol combination of a LegacyOnly currency. More...
 
static void SetDefaultSystemCurrency (std::u16string_view rAbbrev, LanguageType eLang)
 Set the default system currency. More...
 
static const NfCurrencyEntry * GetCurrencyEntry (bool &bFoundBank, std::u16string_view rSymbol, std::u16string_view rExtension, LanguageType eFormatLanguage, bool bOnlyStringLanguage=false)
 Look up the corresponding NfCurrencyEntry matching rSymbol (may be CurrencySymbol or CurrencyAbbreviation) and possibly a rExtension (being yyy of [$xxx-yyy]) or a given language/country value. More...
 
static bool IsLocaleInstalled (LanguageType eLang)
 Check if a specific locale has supported locale data. More...
 

Static Public Attributes

static const sal_uInt16 UNLIMITED_PRECISION = ::std::numeric_limits<sal_uInt16>::max()
 We can't technically have an "infinite" value, so we use an arbitrary upper precision threshold to represent the "unlimited" precision. More...
 
static const sal_uInt16 INPUTSTRING_PRECISION = ::std::numeric_limits<sal_uInt16>::max()-1
 Precision suitable for numbers displayed in input bar, for instance Calc's formula input bar. More...
 

Private Types

typedef std::map< sal_uInt32, sal_uInt32 > DefaultFormatKeysMap
 

Private Member Functions

SVL_DLLPRIVATE void ImpConstruct (LanguageType eLang)
 
SVL_DLLPRIVATE void ImpGenerateFormats (sal_uInt32 CLOffset, bool bNoAdditionalFormats)
 
SVL_DLLPRIVATE void ImpGenerateAdditionalFormats (sal_uInt32 CLOffset, css::uno::Reference< css::i18n::XNumberFormatCode > const &rNumberFormatCode, bool bAfterChangingSystemCL)
 
SVL_DLLPRIVATE SvNumberformatImpInsertFormat (const css::i18n::NumberFormatCode &rCode, sal_uInt32 nPos, bool bAfterChangingSystemCL=false, sal_Int16 nOrgIndex=0)
 
SVL_DLLPRIVATE sal_uInt32 ImpGetCLOffset (LanguageType eLnge) const
 
SVL_DLLPRIVATE sal_uInt32 ImpIsEntry (std::u16string_view rString, sal_uInt32 CLOffset, LanguageType eLnge)
 
SVL_DLLPRIVATE sal_uInt32 ImpGenerateCL (LanguageType eLnge)
 
SVL_DLLPRIVATE sal_uInt32 ImpGetDefaultSystemCurrencyFormat ()
 
SVL_DLLPRIVATE sal_uInt32 ImpGetDefaultCurrencyFormat ()
 
SVL_DLLPRIVATE sal_uInt32 ImpGetDefaultFormat (SvNumFormatType nType)
 
SVL_DLLPRIVATE sal_Int32 ImpGetFormatCodeIndex (css::uno::Sequence< css::i18n::NumberFormatCode > &rSeq, const NfIndexTableOffset nTabOff)
 
SVL_DLLPRIVATE void ImpAdjustFormatCodeDefault (css::i18n::NumberFormatCode *pFormatArr, sal_Int32 nCount)
 
SVL_DLLPRIVATE SvNumberformatGetFormatEntry (sal_uInt32 nKey)
 
SVL_DLLPRIVATE const SvNumberformatGetFormatEntry (sal_uInt32 nKey) const
 
 DECL_DLLPRIVATE_STATIC_LINK (SvNumberFormatter, CurrencyChangeLink, LinkParamNone *, void)
 
sal_Int32 ImpPosToken (const OUStringBuffer &sFormat, sal_Unicode token, sal_Int32 nStartPos=0) const
 
SvNumberformatImpSubstituteEntry (SvNumberformat *pFormat, sal_uInt32 *o_pRealKey=nullptr)
 
::osl::Mutex & GetInstanceMutex () const
 

Static Private Member Functions

static SVL_DLLPRIVATE SvNumberFormatterRegistry_ImplGetFormatterRegistry ()
 
static SVL_DLLPRIVATE void ImpInitCurrencyTable ()
 
static bool ImpLookupCurrencyEntryLoopBody (const NfCurrencyEntry *&pFoundEntry, bool &bFoundBank, const NfCurrencyEntry *pData, sal_uInt16 nPos, std::u16string_view rSymbol)
 
::osl::Mutex & GetGlobalMutex ()
 

Private Attributes

mutable::osl::Mutex m_aMutex
 
css::uno::Reference< css::uno::XComponentContext > m_xContext
 
LanguageTag maLanguageTag
 
std::map< sal_uInt32, std::unique_ptr< SvNumberformat > > aFTable
 
DefaultFormatKeysMap aDefaultFormatKeys
 
std::unique_ptr< SvNumberFormatTablepFormatTable
 
std::unique_ptr< SvNumberFormatterIndexTablepMergeTable
 
OnDemandCharClass xCharClass
 
OnDemandLocaleDataWrapper xLocaleData
 
OnDemandTransliterationWrapper xTransliteration
 
OnDemandCalendarWrapper xCalendar
 
OnDemandNativeNumberWrapper xNatNum
 
std::unique_ptr< ImpSvNumberInputScanpStringScanner
 
std::unique_ptr< ImpSvNumberformatScanpFormatScanner
 
Link< sal_uInt16, Color * > aColorLink
 
sal_uInt32 MaxCLOffset
 
sal_uInt32 nDefaultSystemCurrencyFormat
 
LanguageType IniLnge
 
LanguageType ActLnge
 
NfEvalDateFormat eEvalDateFormat
 
bool bNoZero
 
OUString aDecimalSep
 
OUString aDecimalSepAlt
 
OUString aThousandSep
 
OUString aDateSep
 

Static Private Attributes

static SVL_DLLPRIVATE volatile bool bCurrencyTableInitialized = false
 
static SVL_DLLPRIVATE sal_uInt16 nSystemCurrencyPosition = 0
 
static SVL_DLLPRIVATE SvNumberFormatterRegistry_ImplpFormatterRegistry = nullptr
 

Friends

class SvNumberFormatterRegistry_Impl
 

Detailed Description

Definition at line 39 of file numformat.hxx.

Member Typedef Documentation

◆ DefaultFormatKeysMap

typedef std::map<sal_uInt32, sal_uInt32> SvNumberFormatter::DefaultFormatKeysMap
private

Definition at line 579 of file numformat.hxx.

Constructor & Destructor Documentation

◆ SvNumberFormatter()

SvNumberFormatter::SvNumberFormatter ( const css::uno::Reference< css::uno::XComponentContext > &  rxContext,
LanguageType  eLang 
)

Preferred ctor with service manager and language/country enum.

Definition at line 275 of file zforlist.cxx.

References ImpConstruct(), m_xContext, and maLanguageTag.

◆ ~SvNumberFormatter()

SvNumberFormatter::~SvNumberFormatter ( )

Member Function Documentation

◆ ChangeCL()

SvNumberFormatTable & SvNumberFormatter::ChangeCL ( SvNumFormatType  eType,
sal_uInt32 &  FIndex,
LanguageType  eLnge 
)

Get table of formats of a specific type of a language/country.

FIndex returns the default format of that type. If the language/country was never touched before new entries are generated

Definition at line 1134 of file zforlist.cxx.

References ActLnge, eType, GetEntryTable(), GetInstanceMutex(), and ImpGenerateCL().

Referenced by SvNumberFormatsObj::queryKeys().

◆ ChangeIntl()

void SvNumberFormatter::ChangeIntl ( LanguageType  eLnge)

◆ ChangeNullDate()

void SvNumberFormatter::ChangeNullDate ( sal_uInt16  nDay,
sal_uInt16  nMonth,
sal_Int16  nYear 
)

Change the reference null date.

Definition at line 406 of file zforlist.cxx.

References GetInstanceMutex(), pFormatScanner, and pStringScanner.

Referenced by SvNumberFormatSettingsObj::setPropertyValue().

◆ ChangeStandardPrec()

void SvNumberFormatter::ChangeStandardPrec ( short  nPrec)

Change standard precision.

Definition at line 421 of file zforlist.cxx.

References GetInstanceMutex(), and pFormatScanner.

Referenced by GetInputLineString(), and SvNumberFormatSettingsObj::setPropertyValue().

◆ ClearMergeTable()

void SvNumberFormatter::ClearMergeTable ( )

As the name says.

Definition at line 3446 of file zforlist.cxx.

References GetInstanceMutex(), and pMergeTable.

Referenced by ConvertMergeTableToMap(), MergeFormatter(), and ~SvNumberFormatter().

◆ ConvertMergeTableToMap()

SvNumberFormatterMergeMap SvNumberFormatter::ConvertMergeTableToMap ( )

Convert the ugly old tools' Table type bloated with new'ed sal_uInt32 entries merge table to ::std::map with old index key and new index key.

@ATTENTION! Also clears the old table using ClearMergeTable()

Definition at line 3530 of file zforlist.cxx.

References aMap, ClearMergeTable(), GetInstanceMutex(), HasMergeFormatTable(), and pMergeTable.

◆ DECL_DLLPRIVATE_STATIC_LINK()

SvNumberFormatter::DECL_DLLPRIVATE_STATIC_LINK ( SvNumberFormatter  ,
CurrencyChangeLink  ,
LinkParamNone ,
void   
)
private

◆ DeleteEntry()

void SvNumberFormatter::DeleteEntry ( sal_uInt32  nKey)

Delete an entry including the format it is referring to.

Definition at line 793 of file zforlist.cxx.

References aFTable, and GetInstanceMutex().

Referenced by GetIndexPuttingAndConverting(), and SvNumberFormatsObj::removeByKey().

◆ ExpandTwoDigitYear() [1/2]

sal_uInt16 SvNumberFormatter::ExpandTwoDigitYear ( sal_uInt16  nYear) const

Definition at line 3631 of file zforlist.cxx.

References ExpandTwoDigitYear(), and pStringScanner.

Referenced by ExpandTwoDigitYear(), and ImpSvNumberInputScan::ImplGetYear().

◆ ExpandTwoDigitYear() [2/2]

sal_uInt16 SvNumberFormatter::ExpandTwoDigitYear ( sal_uInt16  nYear,
sal_uInt16  nTwoDigitYearStart 
)
static

Definition at line 4433 of file zforlist.cxx.

◆ FillKeywordTable()

void SvNumberFormatter::FillKeywordTable ( NfKeywordTable rKeywords,
LanguageType  eLang 
)

Fill a NfKeywordIndex table with keywords of a language/country.

Definition at line 817 of file zforlist.cxx.

References ChangeIntl(), GetInstanceMutex(), i, NF_KEYWORD_ENTRIES_COUNT, and pFormatScanner.

Referenced by FillKeywordTableForExcel().

◆ FillKeywordTableForExcel()

void SvNumberFormatter::FillKeywordTableForExcel ( NfKeywordTable rKeywords)

◆ GenerateFormat()

OUString SvNumberFormatter::GenerateFormat ( sal_uInt32  nIndex,
LanguageType  eLnge = LANGUAGE_DONTKNOW,
bool  bThousand = false,
bool  IsRed = false,
sal_uInt16  nPrecision = 0,
sal_uInt16  nLeadingCnt = 1 
)

◆ GetCalcCellReturn()

OUString SvNumberFormatter::GetCalcCellReturn ( sal_uInt32  nFormat) const

◆ GetCalendar()

CalendarWrapper * SvNumberFormatter::GetCalendar ( ) const

◆ GetCharClass()

const CharClass * SvNumberFormatter::GetCharClass ( ) const

◆ GetCompatibilityCurrency()

void SvNumberFormatter::GetCompatibilityCurrency ( OUString &  rSymbol,
OUString &  rAbbrev 
) const

◆ GetComponentContext()

const css::uno::Reference< css::uno::XComponentContext > & SvNumberFormatter::GetComponentContext ( ) const

Definition at line 527 of file zforlist.cxx.

References m_xContext.

Referenced by ImpSvNumberformatScan::ImpSvNumberformatScan().

◆ GetCurrencyEntry() [1/3]

const NfCurrencyEntry * SvNumberFormatter::GetCurrencyEntry ( bool &  bFoundBank,
std::u16string_view  rSymbol,
std::u16string_view  rExtension,
LanguageType  eFormatLanguage,
bool  bOnlyStringLanguage = false 
)
static

Look up the corresponding NfCurrencyEntry matching rSymbol (may be CurrencySymbol or CurrencyAbbreviation) and possibly a rExtension (being yyy of [$xxx-yyy]) or a given language/country value.

Tries to match a rSymbol with rExtension first, then with eFormatLanguage, then rSymbol only. This is because a currency entry might have been constructed using I18N locale data where a used locale of a currency format code must not necessarily match the locale of the locale data itself, e.g. [$HK$-40C] (being "zh_HK" locale) in zh_CN locale data. Here the rExtension would have the value 0x40c but eFormatLanguage of the number format would have the value of zh_CN locale, the value with which the corresponding CurrencyEntry is constructed.

Parameters
bFoundBankOnly used for output. If the return value is not <NULL> this value is set to <TRUE> if the matching entry was found by comparing rSymbol against the CurrencyAbbreviation (AKA BankSymbol). If the return value is <NULL> the value of bFoundBank is undefined.
rSymbolCurrency symbol, preferably obtained of a format by a call to <method>SvNumberformat::GetNewCurrencySymbol()</method>
rExtensionCurrency extension, preferably obtained of a format by a call to <method>SvNumberformat::GetNewCurrencySymbol()</method>
eFormatLanguageThe language/country value of the format of which rSymbol and rExtension are obtained (<method>SvNumberformat::GetLanguage()</method>).
bOnlyStringLanguageIf <TRUE> only entries with language/country of rExtension are checked, no match on eFormatLanguage. If rExtension is empty all entries are checked.
Returns
The matching entry if unique (in which case bFoundBank is set), else <NULL>.

Definition at line 3983 of file zforlist.cxx.

References GetTheCurrencyTable(), ImpLookupCurrencyEntryLoopBody(), LANGUAGE_DONTKNOW, LANGUAGE_SYSTEM, nCount, SAL_WARN_IF, NfCurrencyTable::size(), and o3tl::toInt32().

◆ GetCurrencyEntry() [2/3]

const NfCurrencyEntry & SvNumberFormatter::GetCurrencyEntry ( LanguageType  eLang)
static

Return a NfCurrencyEntry matching a language/country.

If language/country is LANGUAGE_SYSTEM a <method>MatchSystemCurrency</method> call is tried to get an entry. If that fails or the corresponding language/country is not present the entry for LANGUAGE_SYSTEM is returned.

Definition at line 3678 of file zforlist.cxx.

References GetLanguage(), MsLangId::getRealLanguage(), GetTheCurrencyTable(), LANGUAGE_SYSTEM, MatchSystemCurrency(), nCount, and NfCurrencyTable::size().

Referenced by ImpSvNumberInputScan::GetCurrency(), GetNewCurrencySymbolString(), SvNumberFormatObj::getPropertyValue(), SvNumberFormatObj::getPropertyValues(), ImpGetDefaultCurrencyFormat(), and ImpGetDefaultSystemCurrencyFormat().

◆ GetCurrencyEntry() [3/3]

const NfCurrencyEntry * SvNumberFormatter::GetCurrencyEntry ( std::u16string_view  rAbbrev,
LanguageType  eLang 
)
static

Return a NfCurrencyEntry pointer matching a language/country and currency abbreviation (AKA banking symbol).

This method is meant for the configuration of the default currency.

Returns
<NULL> if not found else pointer to NfCurrencyEntry

Definition at line 3701 of file zforlist.cxx.

References GetLanguage(), MsLangId::getRealLanguage(), GetTheCurrencyTable(), nCount, and NfCurrencyTable::size().

◆ GetCurrencyFormatStrings()

sal_uInt16 SvNumberFormatter::GetCurrencyFormatStrings ( NfWSStringsDtor rStrArr,
const NfCurrencyEntry &  rCurr,
bool  bBank 
) const

Get all standard formats for a specific currency, formats are appended to the NfWSStringsDtor list.

Parameters
bBank<TRUE>: generate only format strings with currency abbreviation <FALSE>: mixed format strings
Returns
position of default format

Definition at line 4325 of file zforlist.cxx.

References addToCurrencyFormatsList(), GetInstanceMutex(), pFormatScanner, and xLocaleData.

Referenced by ImpGetDefaultCurrencyFormat(), and ImpGetDefaultSystemCurrencyFormat().

◆ GetDateSep()

const OUString & SvNumberFormatter::GetDateSep ( ) const

◆ GetEditFormat()

sal_uInt32 SvNumberFormatter::GetEditFormat ( double  fNumber,
sal_uInt32  nFIndex,
SvNumFormatType  eType,
SvNumberformat const *  pFormat,
LanguageType  eForLocale = LANGUAGE_DONTKNOW 
)

Return the corresponding edit format of a format.

nFIndex, eType and pFormat (if not nullptr) are assumed to match each other / be of one format. The locale to use is obtained from pFormat, if nullptr then LANGUAGE_SYSTEM is used. This can be overridden by specifying eForLocale other than LANGUAGE_DONTKNOW.

Definition at line 1593 of file zforlist.cxx.

References DATE, DATETIME, DURATION, eType, GetFormatIndex(), GetInstanceMutex(), SvNumberformat::GetLanguage(), GetStandardFormat(), GetTimeFormat(), SvNumberformat::IsIso8601(), LANGUAGE_DONTKNOW, LANGUAGE_SYSTEM, NF_DATE_DIN_MMDD, NF_DATE_DIN_YYMMDD, NF_DATE_DIN_YYYYMMDD, NF_DATE_ISO_YYYYMMDD, NF_DATE_SYS_DDMMYYYY, NF_DATETIME_ISO_YYYYMMDD_HHMMSS, NF_DATETIME_ISO_YYYYMMDD_HHMMSS000, NF_DATETIME_ISO_YYYYMMDDTHHMMSS, NF_DATETIME_ISO_YYYYMMDDTHHMMSS000, NF_DATETIME_SYS_DDMMYYYY_HHMMSS, NUMBER, and TIME.

Referenced by GetInputLineString().

◆ GetEnglishKeywords()

const NfKeywordTable & SvNumberFormatter::GetEnglishKeywords ( ) const

Access for unit tests.

Definition at line 4964 of file zforlist.cxx.

References ImpSvNumberformatScan::GetEnglishKeywords().

◆ GetEntry()

const SvNumberformat * SvNumberFormatter::GetEntry ( sal_uInt32  nKey) const

◆ GetEntryKey()

sal_uInt32 SvNumberFormatter::GetEntryKey ( std::u16string_view  sStr,
LanguageType  eLnge = LANGUAGE_DONTKNOW 
)

Return the format index of the format code string for language/country, or NUMBERFORMAT_ENTRY_NOT_FOUND.

Definition at line 3404 of file zforlist.cxx.

References GetInstanceMutex(), ImpGenerateCL(), ImpIsEntry(), IniLnge, and LANGUAGE_DONTKNOW.

Referenced by GetIndexPuttingAndConverting(), and SvNumberFormatsObj::queryKey().

◆ GetEntryTable()

SvNumberFormatTable & SvNumberFormatter::GetEntryTable ( SvNumFormatType  eType,
sal_uInt32 &  FIndex,
LanguageType  eLnge 
)

Get table of formats of a specific type of a locale.

A format FIndex is tested whether it has the type and locale requested, if it doesn't match FIndex returns the default format for the type/locale. If no specific format is to be selected FIndex may be initialized to 0.

Definition at line 1143 of file zforlist.cxx.

References ActLnge, aFTable, ALL, ChangeIntl(), eType, GetFormatEntry(), GetInstanceMutex(), SvNumberformat::GetLanguage(), GetStandardFormat(), SvNumberformat::GetType(), ImpGetCLOffset(), and pFormatTable.

Referenced by ChangeCL(), GetFirstEntryTable(), and SvNumberFormatsObj::queryKeys().

◆ GetEvalDateFormat()

NfEvalDateFormat SvNumberFormatter::GetEvalDateFormat ( ) const

◆ GetFirstEntryTable()

SvNumberFormatTable & SvNumberFormatter::GetFirstEntryTable ( SvNumFormatType eType,
sal_uInt32 &  FIndex,
LanguageType rLnge 
)

Get table of formats of the same type as FIndex; eType and rLnge are set accordingly.

An unknown format is set to Standard/General

Definition at line 1034 of file zforlist.cxx.

References ALL, ChangeIntl(), DATE, DATETIME, DEFINED, eType, GetEntryTable(), GetFormatEntry(), GetInstanceMutex(), SvNumberformat::GetLanguage(), SvNumberformat::GetMaskedType(), and IniLnge.

◆ GetFormatDecimalSep()

OUString SvNumberFormatter::GetFormatDecimalSep ( sal_uInt32  nFormat) const

Return the decimal separator matching the locale of the given format.

Definition at line 2222 of file zforlist.cxx.

References GetFormatEntry(), GetInstanceMutex(), GetLangDecimalSep(), SvNumberformat::GetLanguage(), and GetNumDecimalSep().

◆ GetFormatEntry() [1/2]

SvNumberformat * SvNumberFormatter::GetFormatEntry ( sal_uInt32  nKey)
private

◆ GetFormatEntry() [2/2]

const SvNumberformat * SvNumberFormatter::GetFormatEntry ( sal_uInt32  nKey) const
private

Definition at line 2526 of file zforlist.cxx.

References GetEntry().

◆ GetFormatForLanguageIfBuiltIn()

sal_uInt32 SvNumberFormatter::GetFormatForLanguageIfBuiltIn ( sal_uInt32  nFormat,
LanguageType  eLnge = LANGUAGE_DONTKNOW 
)

Return the format index of a builtin format for a specific language/country.

If nFormat is not a builtin format nFormat is returned.

Definition at line 3548 of file zforlist.cxx.

References GetInstanceMutex(), ImpGenerateCL(), IniLnge, LANGUAGE_DONTKNOW, SV_COUNTRY_LANGUAGE_OFFSET, and SV_MAX_COUNT_STANDARD_FORMATS.

Referenced by SvNumberFormatsObj::getFormatForLocale(), and GetIndexPuttingAndConverting().

◆ GetFormatIndex()

sal_uInt32 SvNumberFormatter::GetFormatIndex ( NfIndexTableOffset  nTabOff,
LanguageType  eLnge = LANGUAGE_DONTKNOW 
)

◆ GetFormatIntegerDigits()

sal_uInt16 SvNumberFormatter::GetFormatIntegerDigits ( sal_uInt32  nFormat) const

Count of integer digits.

Definition at line 2212 of file zforlist.cxx.

References GetFormatEntry(), SvNumberformat::GetFormatIntegerDigits(), and GetInstanceMutex().

◆ GetFormatPrecision()

sal_uInt16 SvNumberFormatter::GetFormatPrecision ( sal_uInt32  nFormat) const

Count of decimals.

Definition at line 2202 of file zforlist.cxx.

References GetFormatEntry(), SvNumberformat::GetFormatPrecision(), GetInstanceMutex(), and pFormatScanner.

◆ GetFormatScanner()

const ImpSvNumberformatScan * SvNumberFormatter::GetFormatScanner ( ) const

The following method is not to be used from outside but must be public for the InputScanner.

Definition at line 532 of file zforlist.cxx.

References pFormatScanner.

Referenced by ImpSvNumberInputScan::GetLogical().

◆ GetFormatSpecialInfo() [1/2]

sal_uInt32 SvNumberFormatter::GetFormatSpecialInfo ( const OUString &  rFormatString,
bool &  bThousand,
bool &  IsRed,
sal_uInt16 &  nPrecision,
sal_uInt16 &  nLeadingCnt,
LanguageType  eLnge = LANGUAGE_DONTKNOW 
)

Get additional info of a format code string, e.g.

for dialog box. Uses a temporary parse, if possible use only if format code is not present in container yet, otherwise ineffective.

Returns
0 if format code string parsed without errors, otherwise error position (like nCheckPos on <method>PutEntry</method>)

Definition at line 2264 of file zforlist.cxx.

References ActLnge, ChangeIntl(), SvNumberformat::GetFormatSpecialInfo(), GetInstanceMutex(), IniLnge, LANGUAGE_DONTKNOW, pFormatScanner, and pStringScanner.

◆ GetFormatSpecialInfo() [2/2]

void SvNumberFormatter::GetFormatSpecialInfo ( sal_uInt32  nFormat,
bool &  bThousand,
bool &  IsRed,
sal_uInt16 &  nPrecision,
sal_uInt16 &  nLeadingCnt 
)

Get additional info of a format index, e.g. for dialog box.

Definition at line 2181 of file zforlist.cxx.

References GetFormatEntry(), SvNumberformat::GetFormatSpecialInfo(), GetInstanceMutex(), and pFormatScanner.

◆ GetFormatStringForExcel()

OUString SvNumberFormatter::GetFormatStringForExcel ( sal_uInt32  nKey,
const NfKeywordTable rKeywords,
SvNumberFormatter rTempFormatter 
) const

Return a format code string suitable for Excel export.

Parameters
rTempFormatterSvNumberFormatter to use if a non-en-US format code needs to be converted and put, should not be the same formatter to not pollute the entries of this one here.

Definition at line 899 of file zforlist.cxx.

References ChangeIntl(), DEFINED, GetEntry(), GetInstanceMutex(), SvtSysLocale::GetLanguageTag(), LanguageTag::getLanguageType(), GetLocaleData(), LANGUAGE_ENGLISH_US, LANGUAGE_SYSTEM, lcl_buildBooleanStringFormat(), LOGICAL, nType, NUMBERFORMAT_ENTRY_NOT_FOUND, PutandConvertEntry(), SAL_WARN, and SAL_WARN_IF.

◆ GetFormatterRegistry()

SvNumberFormatterRegistry_Impl & SvNumberFormatter::GetFormatterRegistry ( )
staticprivate

◆ GetGlobalMutex()

osl::Mutex & SvNumberFormatter::GetGlobalMutex ( )
staticprivate

◆ GetIndexPuttingAndConverting()

sal_uInt32 SvNumberFormatter::GetIndexPuttingAndConverting ( OUString &  rString,
LanguageType  eLnge,
LanguageType  eSysLnge,
SvNumFormatType rType,
bool &  rNewInserted,
sal_Int32 &  rCheckPos 
)

Similar to <method>PutEntry</method> and <method>PutandConvertEntry</method> or <method>PutandConvertEntrySystem</method>, the format code string passed is considered to be of language/country eLnge.

If eLnge==LANGUAGE_SYSTEM the format code has to match eSysLnge, and if eSysLnge is not the current application locale the format code is converted to the current locale. Additionally, if the format code represents an old "automatic" currency format, it is converted to the new default currency format of the eLnge locale. The rString format code passed as an argument may get adapted in case eLnge was used (or is LANGUAGE_SYSTEM and eSysLnge is identical); in case it wasn't the method works on a copy instead, otherwise the resulting string would not match eSysLnge anymore.

This method was introduced to handle the legacy currency formats of the "autotbl.fmt" file used by Calc and Writer and convert them to fixed currency codes of the actual currency. Note that in the case of legacy currency formats no special attribution is converted, only the default currency format of the locale is chosen, and that new fixed currency codes are of course not converted to other currencies. The method may also be used as a general method taking, converting and inserting almost arbitrary format codes. To insert or use, for example, the default currency format code matching the current locale, the method could be called with

GetIndexPuttingAndConverting( "0 $", LANGUAGE_SYSTEM, LANGUAGE_ENGLISH_US, ...);

Returns
The index key of the resulting number format. If the format code was empty, could not be converted or has errors, the eLnge locale's standard number format is chosen instead. The index key is guaranteed to represent some valid number format. If rNewInserted==false and rCheckPos>0 the format code has errors and/or could not be converted.

Definition at line 717 of file zforlist.cxx.

References CURRENCY, DeleteEntry(), GetEntry(), GetEntryKey(), GetFormatForLanguageIfBuiltIn(), GetInstanceMutex(), GetLanguageTag(), GetStandardFormat(), GetStandardIndex(), GetType(), SvNumberformat::HasNewCurrency(), LANGUAGE_SYSTEM, NUMBERFORMAT_ENTRY_NOT_FOUND, PutandConvertEntrySystem(), PutEntry(), and SAL_WARN.

◆ GetIndexTableOffset()

NfIndexTableOffset SvNumberFormatter::GetIndexTableOffset ( sal_uInt32  nFormat) const

Return enum index of a format index of a builtin format, NF_INDEX_TABLE_ENTRIES if it's not a builtin format.

See also
NfIndexTableOffset

Definition at line 3589 of file zforlist.cxx.

References indexTable, NF_INDEX_TABLE_ENTRIES, SV_COUNTRY_LANGUAGE_OFFSET, and SV_MAX_COUNT_STANDARD_FORMATS.

Referenced by GetCalcCellReturn().

◆ GetInputLineString()

void SvNumberFormatter::GetInputLineString ( const double &  fOutNumber,
sal_uInt32  nFIndex,
OUString &  rOutString,
bool  bFiltering = false,
bool  bForceSystemLocale = false 
)

Format a number according to the standard default format matching the given format index.

rOutString will be the real cell string (e.g. a number rounded by the cell format, which rounded value is used in the filtering condition now), instead of the EditFormat string (e.g a not rounded value, which is visible during editing).

Definition at line 1673 of file zforlist.cxx.

References ALL, ChangeIntl(), ChangeStandardPrec(), CURRENCY, eType, FRACTION, GetEditFormat(), GetFormatEntry(), SvNumberformat::GetFormatPrecision(), GetInstanceMutex(), SvNumberformat::GetLanguage(), SvNumberformat::GetMaskedType(), SvNumberformat::GetNumForInfoScannedType(), SvNumberformat::GetOutputString(), ImpSubstituteEntry(), INPUTSTRING_PRECISION, LANGUAGE_DONTKNOW, LANGUAGE_SYSTEM, NUMBER, PERCENT, pFormatScanner, SCIENTIFIC, ImpSvNumberformatScan::sErrStr, TIME, and ZF_STANDARD.

Referenced by SvNumberFormatterServiceObj::getInputString().

◆ GetInstanceMutex()

::osl::Mutex & SvNumberFormatter::GetInstanceMutex ( ) const
inlineprivate

◆ GetKeyword()

OUString SvNumberFormatter::GetKeyword ( LanguageType  eLnge,
sal_uInt16  nIndex 
)

Return a keyword for a language/country and NfKeywordIndex for XML import, to generate number format strings.

Definition at line 975 of file zforlist.cxx.

References ChangeIntl(), GetInstanceMutex(), NF_KEYWORD_ENTRIES_COUNT, nIndex, pFormatScanner, and SAL_WARN.

◆ GetKeywords()

const NfKeywordTable & SvNumberFormatter::GetKeywords ( sal_uInt32  nKey)

Obtain NfKeywordTable used with a format, possibly localized.

XXX NOTE: the content (actual keywords) is only valid as long as the locale context of the associated ImpSvNumberformatScan instance does not change to a locale with different keywords, which may happen anytime with a call (implicit or explicit) to SvNumberFormatter::ChangeIntl(). If needed longer, copy-create another NfKeywordTable instance or copy individual elements.

If the format specified with nKey does not exist, the content of the NfKeywordTable matches the locale with which the SvNumberFormatter instance was created and initialized.

This function preliminary exists for unit tests and otherwise is pretty much useless.

Definition at line 4953 of file zforlist.cxx.

References ChangeIntl(), GetFormatEntry(), GetInstanceMutex(), SvNumberformat::GetLanguage(), IniLnge, and pFormatScanner.

◆ GetLangDecimalSep()

OUString SvNumberFormatter::GetLangDecimalSep ( LanguageType  nLang) const

◆ GetLanguage()

LanguageType SvNumberFormatter::GetLanguage ( ) const

The language with which the formatter was initialized (system setting), NOT the current language after a ChangeIntl()

Definition at line 1303 of file zforlist.cxx.

References GetInstanceMutex(), and IniLnge.

Referenced by GetCurrencyEntry(), ImpSvNumberInputScan::IsAcceptedDatePattern(), and SetDefaultSystemCurrency().

◆ GetLanguageTag()

const LanguageTag & SvNumberFormatter::GetLanguageTag ( ) const

The following methods are not to be used from outside but must be public for the InputScanner and FormatScanner.

Definition at line 534 of file zforlist.cxx.

References maLanguageTag.

Referenced by GetIndexPuttingAndConverting(), ImpSvNumberInputScan::GetMonth(), ImpGenerateAdditionalFormats(), ImpGenerateFormats(), ImpInitCurrencyTable(), and TransformInput().

◆ GetLegacyOnlyCurrencyEntry()

const NfCurrencyEntry * SvNumberFormatter::GetLegacyOnlyCurrencyEntry ( std::u16string_view  rSymbol,
std::u16string_view  rAbbrev 
)
static

Return a NfCurrencyEntry pointer matching the symbol combination of a LegacyOnly currency.

Note that this means only that the currency matching both symbols was once used in the Office, but is not offered in dialogs anymore. It doesn't even mean that the currency symbol combination is valid, since the reason for removing it may have been just that. #i61657#

Returns
A matching entry, or else <NULL>.

Definition at line 3719 of file zforlist.cxx.

References GetTheCurrencyTable(), nCount, and NfCurrencyTable::size().

◆ GetLocaleData()

const LocaleDataWrapper * SvNumberFormatter::GetLocaleData ( ) const

◆ GetMaxDefaultColors()

size_t SvNumberFormatter::GetMaxDefaultColors ( ) const

Access for unit tests.

Definition at line 4974 of file zforlist.cxx.

References ImpSvNumberformatScan::GetMaxDefaultColors().

◆ GetMergeFormatIndex()

sal_uInt32 SvNumberFormatter::GetMergeFormatIndex ( sal_uInt32  nOldFmt) const

Return the new format index for an old format index, if a merge table exists.

Definition at line 4412 of file zforlist.cxx.

References GetInstanceMutex(), and pMergeTable.

◆ GetNatNum()

const NativeNumberWrapper * SvNumberFormatter::GetNatNum ( ) const

◆ GetNewCurrencySymbolString()

bool SvNumberFormatter::GetNewCurrencySymbolString ( sal_uInt32  nFormat,
OUString &  rSymbol,
const NfCurrencyEntry **  ppEntry,
bool *  pBank = nullptr 
) const

Whether nFormat is of type css::util::NumberFormat::CURRENCY and the format code contains a new SYMBOLTYPE_CURRENCY and if so which one [$xxx-nnn].

If ppEntry is not NULL and exactly one entry is found, a [$xxx-nnn] is returned, even if the format code only contains [$xxx] !

Definition at line 3923 of file zforlist.cxx.

References GetCurrencyEntry(), GetFormatEntry(), GetInstanceMutex(), SvNumberformat::GetLanguage(), and SvNumberformat::GetNewCurrencySymbol().

Referenced by GenerateFormat().

◆ GetNoZero()

bool SvNumberFormatter::GetNoZero ( ) const

Return whether zero suppression is switched on.

Definition at line 439 of file zforlist.cxx.

References bNoZero, and GetInstanceMutex().

Referenced by SvNumberFormatSettingsObj::getPropertyValue().

◆ GetNullDate()

const Date & SvNumberFormatter::GetNullDate ( ) const

Return the reference date.

Definition at line 415 of file zforlist.cxx.

References GetInstanceMutex(), and pFormatScanner.

Referenced by SvNumberFormatSettingsObj::getPropertyValue().

◆ GetNumDecimalSep()

const OUString & SvNumberFormatter::GetNumDecimalSep ( ) const

◆ GetNumDecimalSepAlt()

const OUString & SvNumberFormatter::GetNumDecimalSepAlt ( ) const

◆ GetNumThousandSep()

const OUString & SvNumberFormatter::GetNumThousandSep ( ) const

◆ GetOnDemandLocaleDataWrapper()

OnDemandLocaleDataWrapper & SvNumberFormatter::GetOnDemandLocaleDataWrapper ( const InputScannerPrivateAccess )
inline

Access for input scanner to temporarily (!) switch locales.

Definition at line 568 of file numformat.hxx.

Referenced by ImpSvNumberInputScan::IsAcceptedDatePattern().

◆ GetOutputString() [1/2]

void SvNumberFormatter::GetOutputString ( const double &  fOutNumber,
sal_uInt32  nFIndex,
OUString &  sOutString,
const Color **  ppColor,
bool  bUseStarFormat = false 
)

◆ GetOutputString() [2/2]

void SvNumberFormatter::GetOutputString ( const OUString &  sString,
sal_uInt32  nFIndex,
OUString &  sOutString,
const Color **  ppColor,
bool  bUseStarFormat = false 
)

Format a string according to a format index, return string and color.

Formats only if the format code is of type text or the 4th subcode of a format code is specified, otherwise sOutString will be == ""

Definition at line 1760 of file zforlist.cxx.

References ChangeIntl(), GetFormatEntry(), GetInstanceMutex(), SvNumberformat::GetLanguage(), SvNumberformat::GetOutputString(), SvNumberformat::HasTextFormat(), SvNumberformat::IsTextFormat(), SvNumberformat::SetStarFormatSupport(), and ZF_STANDARD_TEXT.

◆ GetPreviewString() [1/2]

bool SvNumberFormatter::GetPreviewString ( const OUString &  sFormatString,
const OUString &  sPreviewString,
OUString &  sOutString,
const Color **  ppColor,
LanguageType  eLnge = LANGUAGE_DONTKNOW 
)

Format a string according to a format code string to be scanned.

Returns
<FALSE> if format code contains an error <TRUE> else, in which case the string and color are returned.

Definition at line 1971 of file zforlist.cxx.

References ActLnge, ChangeIntl(), SvNumberformat::GetFormatstring(), GetInstanceMutex(), GetOutputString(), SvNumberformat::GetOutputString(), SvNumberformat::HasTextFormat(), ImpGenerateCL(), ImpIsEntry(), IniLnge, SvNumberformat::IsTextFormat(), LANGUAGE_DONTKNOW, NUMBERFORMAT_ENTRY_NOT_FOUND, pFormatScanner, and pStringScanner.

◆ GetPreviewString() [2/2]

bool SvNumberFormatter::GetPreviewString ( const OUString &  sFormatString,
double  fPreviewNumber,
OUString &  sOutString,
const Color **  ppColor,
LanguageType  eLnge,
bool  bUseStarFormat = false 
)

Format a number according to a format code string to be scanned.

Returns
<FALSE> if format code contains an error <TRUE> else, in which case the string and color are returned.

Definition at line 1817 of file zforlist.cxx.

References ActLnge, ChangeIntl(), SvNumberformat::GetFormatstring(), GetInstanceMutex(), GetOutputString(), SvNumberformat::GetOutputString(), ImpGenerateCL(), ImpIsEntry(), IniLnge, LANGUAGE_DONTKNOW, NUMBERFORMAT_ENTRY_NOT_FOUND, pFormatScanner, pStringScanner, and SvNumberformat::SetStarFormatSupport().

Referenced by SvNumberFormatterServiceObj::convertNumberToPreviewString(), and SvNumberFormatterServiceObj::queryPreviewColorForNumber().

◆ GetPreviewStringGuess()

bool SvNumberFormatter::GetPreviewStringGuess ( const OUString &  sFormatString,
double  fPreviewNumber,
OUString &  sOutString,
const Color **  ppColor,
LanguageType  eLnge = LANGUAGE_DONTKNOW 
)

◆ GetStandardColors()

const std::vector< Color > & SvNumberFormatter::GetStandardColors ( ) const

Access for unit tests.

Definition at line 4969 of file zforlist.cxx.

References ImpSvNumberformatScan::GetStandardColors().

◆ GetStandardFormat() [1/3]

sal_uInt32 SvNumberFormatter::GetStandardFormat ( double  fNumber,
sal_uInt32  nFIndex,
SvNumFormatType  eType,
LanguageType  eLnge 
)

Return the format index of the default format of a type for language/country.

Maybe not the default format but a special builtin format, e.g. for NF_TIME_HH_MMSS00, or NF_TIME_HH_MMSS if fNumber >= 1.0

Definition at line 1539 of file zforlist.cxx.

References DURATION, eType, GetInstanceMutex(), GetStandardFormat(), GetTimeFormat(), IsSpecialStandardFormat(), and TIME.

◆ GetStandardFormat() [2/3]

sal_uInt32 SvNumberFormatter::GetStandardFormat ( sal_uInt32  nFIndex,
SvNumFormatType  eType,
LanguageType  eLnge 
)

Return the format index of the default format of a type for language/country.

Maybe not the default format but a special builtin format, e.g. for NF_TIME_HH_MMSS00, if that format is passed in nFIndex.

Definition at line 1501 of file zforlist.cxx.

References eType, GetInstanceMutex(), GetStandardFormat(), and IsSpecialStandardFormat().

◆ GetStandardFormat() [3/3]

sal_uInt32 SvNumberFormatter::GetStandardFormat ( SvNumFormatType  eType,
LanguageType  eLnge = LANGUAGE_DONTKNOW 
)

◆ GetStandardIndex()

sal_uInt32 SvNumberFormatter::GetStandardIndex ( LanguageType  eLnge = LANGUAGE_DONTKNOW)

Return the format index of the standard default number format for language/country.

Definition at line 3416 of file zforlist.cxx.

References GetInstanceMutex(), GetStandardFormat(), IniLnge, LANGUAGE_DONTKNOW, and NUMBER.

Referenced by GetIndexPuttingAndConverting(), and SvNumberFormatsObj::getStandardIndex().

◆ GetStandardName()

OUString SvNumberFormatter::GetStandardName ( LanguageType  eLnge)

Return the GENERAL keyword in proper case ("General") for a language/country, used in XML import.

Definition at line 989 of file zforlist.cxx.

References ChangeIntl(), GetInstanceMutex(), and pFormatScanner.

Referenced by FillKeywordTableForExcel().

◆ GetStandardPrec()

sal_uInt16 SvNumberFormatter::GetStandardPrec ( ) const

Return the standard decimal precision.

Definition at line 433 of file zforlist.cxx.

References GetInstanceMutex(), and pFormatScanner.

Referenced by SvNumberFormatSettingsObj::getPropertyValue().

◆ GetSubstitutedEntry()

const SvNumberformat * SvNumberFormatter::GetSubstitutedEntry ( sal_uInt32  nKey,
sal_uInt32 &  o_rNewKey 
) const

Obtain substituted GetFormatEntry(), i.e. system formats.

Definition at line 2540 of file zforlist.cxx.

References GetFormatEntry(), GetInstanceMutex(), and ImpSubstituteEntry().

◆ GetTheCurrencyTable()

const NfCurrencyTable & SvNumberFormatter::GetTheCurrencyTable ( )
static

Return a NfCurrencyTable with pointers to <type>NfCurrencyEntry</type> entries.

Definition at line 3660 of file zforlist.cxx.

References bCurrencyTableInitialized, and ImpInitCurrencyTable().

Referenced by GetCurrencyEntry(), GetLegacyOnlyCurrencyEntry(), IsLocaleInstalled(), MatchSystemCurrency(), and SetDefaultSystemCurrency().

◆ GetTimeFormat()

sal_uInt32 SvNumberFormatter::GetTimeFormat ( double  fNumber,
LanguageType  eLnge,
bool  bForceDuration 
)

Return a time format that best matches fNumber.

Definition at line 1511 of file zforlist.cxx.

References GetFormatIndex(), GetInstanceMutex(), GetStandardFormat(), NF_TIME_HH_MMSS, NF_TIME_HH_MMSS00, NF_TIME_MMSS00, and TIME.

Referenced by GetEditFormat(), GetStandardFormat(), and GuessDateTimeFormat().

◆ GetTransliteration()

const ::utl::TransliterationWrapper * SvNumberFormatter::GetTransliteration ( ) const

◆ GetType()

SvNumFormatType SvNumberFormatter::GetType ( sal_uInt32  nFIndex) const

Get the type of a format (or css::util::NumberFormat::UNDEFINED if no entry), but with css::util::NumberFormat::DEFINED masked out.

Definition at line 3426 of file zforlist.cxx.

References ALL, DEFINED, eType, GetFormatEntry(), GetInstanceMutex(), SvNumberformat::GetMaskedType(), and UNDEFINED.

Referenced by GetIndexPuttingAndConverting().

◆ GetUsedLanguages()

void SvNumberFormatter::GetUsedLanguages ( std::vector< LanguageType > &  rList)

Fill rList with the language/country codes that have been allocated.

Definition at line 799 of file zforlist.cxx.

References GetFormatEntry(), GetInstanceMutex(), SvNumberformat::GetLanguage(), MaxCLOffset, and SV_COUNTRY_LANGUAGE_OFFSET.

◆ GetUserDefColor()

Color * SvNumberFormatter::GetUserDefColor ( sal_uInt16  nIndex)

◆ GetYear2000()

sal_uInt16 SvNumberFormatter::GetYear2000 ( ) const

Definition at line 3624 of file zforlist.cxx.

References GetInstanceMutex(), and pStringScanner.

Referenced by SvNumberFormatSettingsObj::getPropertyValue().

◆ GetYear2000Default()

sal_uInt16 SvNumberFormatter::GetYear2000Default ( )
static

◆ GuessDateTimeFormat()

sal_uInt32 SvNumberFormatter::GuessDateTimeFormat ( SvNumFormatType rType,
double  fNumber,
LanguageType  eLnge 
)

Return a format and type that best matches the value of fNumber if fNumber is assumed to be a date, time or datetime value, but unknown which.

Originally introduced for Chart databrowser editor, probably should not be used otherwise.

Definition at line 1557 of file zforlist.cxx.

References DATE, DATETIME, GetFormatIndex(), GetInstanceMutex(), GetTimeFormat(), NF_DATE_SYS_DDMMYYYY, NF_DATETIME_SYS_DDMMYYYY_HHMMSS, and TIME.

◆ HasMergeFormatTable()

bool SvNumberFormatter::HasMergeFormatTable ( ) const

Whether a merge table is present or not.

Definition at line 4426 of file zforlist.cxx.

References GetInstanceMutex(), and pMergeTable.

Referenced by ConvertMergeTableToMap().

◆ ImpAdjustFormatCodeDefault()

void SvNumberFormatter::ImpAdjustFormatCodeDefault ( css::i18n::NumberFormatCode *  pFormatArr,
sal_Int32  nCount 
)
private

◆ ImpConstruct()

void SvNumberFormatter::ImpConstruct ( LanguageType  eLang)
private

◆ ImpGenerateAdditionalFormats()

void SvNumberFormatter::ImpGenerateAdditionalFormats ( sal_uInt32  CLOffset,
css::uno::Reference< css::i18n::XNumberFormatCode > const &  rNumberFormatCode,
bool  bAfterChangingSystemCL 
)
private

◆ ImpGenerateCL()

sal_uInt32 SvNumberFormatter::ImpGenerateCL ( LanguageType  eLnge)
private

◆ ImpGenerateFormats()

void SvNumberFormatter::ImpGenerateFormats ( sal_uInt32  CLOffset,
bool  bNoAdditionalFormats 
)
private

"??/" would be interpreted by the compiler as a trigraph for '\'

"??/" would be interpreted by the compiler as a trigraph for '\'

Definition at line 2575 of file zforlist.cxx.

References ActLnge, aFTable, LocaleDataWrapper::areChecksEnabled(), GetLanguageTag(), LanguageTag::getLocale(), GetLocaleData(), LocaleDataWrapper::getTime100SecSep(), SvNumberformat::GetType(), ImpAdjustFormatCodeDefault(), ImpGenerateAdditionalFormats(), ImpGetFormatCodeIndex(), ImpInsertFormat(), LOGICAL, m_xContext, NF_CURRENCY_1000DEC2, NF_CURRENCY_1000DEC2_CCC, NF_CURRENCY_1000DEC2_DASHED, NF_CURRENCY_1000DEC2_RED, NF_CURRENCY_1000INT, NF_CURRENCY_1000INT_RED, NF_DATE_DEF_NNDDMMMYY, NF_DATE_DIN_DMMMMYYYY, NF_DATE_DIN_DMMMYYYY, NF_DATE_DIN_MMDD, NF_DATE_DIN_YYMMDD, NF_DATE_DIN_YYYYMMDD, NF_DATE_MMMM, NF_DATE_QQJJ, NF_DATE_SYS_DDMMM, NF_DATE_SYS_DDMMYY, NF_DATE_SYS_DDMMYYYY, NF_DATE_SYS_DMMMMYYYY, NF_DATE_SYS_DMMMYY, NF_DATE_SYS_DMMMYYYY, NF_DATE_SYS_MMYY, NF_DATE_SYS_NNDMMMMYYYY, NF_DATE_SYS_NNDMMMYY, NF_DATE_SYS_NNNNDMMMMYYYY, NF_DATE_SYSTEM_LONG, NF_DATE_SYSTEM_SHORT, NF_DATETIME_SYS_DDMMYYYY_HHMM, NF_DATETIME_SYS_DDMMYYYY_HHMMSS, NF_DATETIME_SYSTEM_SHORT_HHMM, NF_KEY_DD, NF_KEY_HH, NF_KEY_MM, NF_KEY_MMI, NF_KEY_SS, NF_KEY_WW, NF_KEY_YYYY, NF_NUMBER_1000DEC2, NF_NUMBER_1000INT, NF_NUMBER_DEC2, NF_NUMBER_INT, NF_NUMBER_STANDARD, NF_NUMBER_SYSTEM, NF_PERCENT_DEC2, NF_PERCENT_INT, NF_SCIENTIFIC_000E00, NF_SCIENTIFIC_000E000, NF_TIME_HH_MMSS, NF_TIME_HH_MMSS00, NF_TIME_HHMM, NF_TIME_HHMMAMPM, NF_TIME_HHMMSS, NF_TIME_HHMMSSAMPM, NF_TIME_MMSS00, NUMBER, LocaleDataWrapper::outputCheckMessage(), pFormatScanner, pStringScanner, SAL_WARN, SvNumberformat::SetComment(), SvNumberformat::SetLastInsertKey(), SvNumberformat::SetStandard(), SvNumberformat::SetType(), SV_MAX_COUNT_STANDARD_FORMATS, TEXT, u, xLocaleData, ZF_STANDARD, ZF_STANDARD_CURRENCY, ZF_STANDARD_DATE, ZF_STANDARD_DATE_DIN_DMMMMYYYY, ZF_STANDARD_DATE_DIN_DMMMYYYY, ZF_STANDARD_DATE_DIN_MMDD, ZF_STANDARD_DATE_DIN_YYMMDD, ZF_STANDARD_DATE_DIN_YYYYMMDD, ZF_STANDARD_DATE_SYS_DMMMMYYYY, ZF_STANDARD_DATE_SYS_DMMMYYYY, ZF_STANDARD_DATE_SYS_NNDMMMMYYYY, ZF_STANDARD_DATE_SYS_NNDMMMYY, ZF_STANDARD_DATE_SYS_NNNNDMMMMYYYY, ZF_STANDARD_DATE_WW, ZF_STANDARD_DATETIME, ZF_STANDARD_FRACTION, ZF_STANDARD_LOGICAL, ZF_STANDARD_PERCENT, ZF_STANDARD_SCIENTIFIC, ZF_STANDARD_TEXT, and ZF_STANDARD_TIME.

Referenced by ImpConstruct(), ImpGenerateCL(), and ReplaceSystemCL().

◆ ImpGetCLOffset()

sal_uInt32 SvNumberFormatter::ImpGetCLOffset ( LanguageType  eLnge) const
private

◆ ImpGetDefaultCurrencyFormat()

sal_uInt32 SvNumberFormatter::ImpGetDefaultCurrencyFormat ( )
private

◆ ImpGetDefaultFormat()

sal_uInt32 SvNumberFormatter::ImpGetDefaultFormat ( SvNumFormatType  nType)
private

◆ ImpGetDefaultSystemCurrencyFormat()

sal_uInt32 SvNumberFormatter::ImpGetDefaultSystemCurrencyFormat ( )
private

◆ ImpGetFormatCodeIndex()

sal_Int32 SvNumberFormatter::ImpGetFormatCodeIndex ( css::uno::Sequence< css::i18n::NumberFormatCode > &  rSeq,
const NfIndexTableOffset  nTabOff 
)
private

◆ ImpInitCurrencyTable()

void SvNumberFormatter::ImpInitCurrencyTable ( )
staticprivate

◆ ImpInsertFormat()

SvNumberformat * SvNumberFormatter::ImpInsertFormat ( const css::i18n::NumberFormatCode &  rCode,
sal_uInt32  nPos,
bool  bAfterChangingSystemCL = false,
sal_Int16  nOrgIndex = 0 
)
private

◆ ImpIsEntry()

sal_uInt32 SvNumberFormatter::ImpIsEntry ( std::u16string_view  rString,
sal_uInt32  CLOffset,
LanguageType  eLnge 
)
private

◆ ImpLookupCurrencyEntryLoopBody()

bool SvNumberFormatter::ImpLookupCurrencyEntryLoopBody ( const NfCurrencyEntry *&  pFoundEntry,
bool &  bFoundBank,
const NfCurrencyEntry *  pData,
sal_uInt16  nPos,
std::u16string_view  rSymbol 
)
staticprivate

Definition at line 3876 of file zforlist.cxx.

References MatchSystemCurrency(), nPos, and pData.

Referenced by GetCurrencyEntry().

◆ ImpPosToken()

sal_Int32 SvNumberFormatter::ImpPosToken ( const OUStringBuffer &  sFormat,
sal_Unicode  token,
sal_Int32  nStartPos = 0 
) const
private

Definition at line 3125 of file zforlist.cxx.

References i, and nLength.

Referenced by GenerateFormat().

◆ ImpSubstituteEntry()

SvNumberformat * SvNumberFormatter::ImpSubstituteEntry ( SvNumberformat pFormat,
sal_uInt32 *  o_pRealKey = nullptr 
)
private

◆ InvalidateDateAcceptancePatterns()

void SvNumberFormatter::InvalidateDateAcceptancePatterns ( )

Definition at line 3789 of file zforlist.cxx.

References pStringScanner.

◆ IsCompatible()

bool SvNumberFormatter::IsCompatible ( SvNumFormatType  eOldType,
SvNumFormatType  eNewType 
)
static

◆ IsDecimalSep()

bool SvNumberFormatter::IsDecimalSep ( std::u16string_view  rStr) const

Definition at line 557 of file zforlist.cxx.

References GetNumDecimalSep(), and GetNumDecimalSepAlt().

Referenced by ImpSvNumberInputScan::IsNumberFormatMain().

◆ IsLocaleInstalled()

bool SvNumberFormatter::IsLocaleInstalled ( LanguageType  eLang)
static

Check if a specific locale has supported locale data.

Definition at line 4140 of file zforlist.cxx.

References GetTheCurrencyTable().

Referenced by SvNumberformat::SvNumberformat().

◆ IsNatNum12()

bool SvNumberFormatter::IsNatNum12 ( sal_uInt32  nFIndex) const

Whether format index nFIndex has NatNum12 modifier.

Definition at line 2256 of file zforlist.cxx.

References GetFormatEntry(), GetInstanceMutex(), and SvNumberformat::GetNatNumModifierString().

◆ IsNumberFormat()

bool SvNumberFormatter::IsNumberFormat ( const OUString &  sString,
sal_uInt32 &  F_Index,
double &  fOutNumber,
SvNumInputOptions  eInputOptions = SvNumInputOptions::NONE 
)

◆ IsSpecialStandardFormat()

bool SvNumberFormatter::IsSpecialStandardFormat ( sal_uInt32  nFIndex,
LanguageType  eLnge 
)

Whether nFIndex is a special builtin format.

Definition at line 1490 of file zforlist.cxx.

References GetFormatIndex(), GetInstanceMutex(), NF_TIME_HH_MMSS, NF_TIME_HH_MMSS00, and NF_TIME_MMSS00.

Referenced by GetStandardFormat().

◆ IsTextFormat()

bool SvNumberFormatter::IsTextFormat ( sal_uInt32  nFIndex) const

Whether format index nFIndex is of type text or not.

Definition at line 566 of file zforlist.cxx.

References GetFormatEntry(), GetInstanceMutex(), and SvNumberformat::IsTextFormat().

◆ IsUserDefined() [1/2]

bool SvNumberFormatter::IsUserDefined ( sal_uInt32  F_Index) const

◆ IsUserDefined() [2/2]

bool SvNumberFormatter::IsUserDefined ( std::u16string_view  sStr,
LanguageType  eLnge = LANGUAGE_DONTKNOW 
)

Check if format code string may be deleted by user.

Definition at line 3384 of file zforlist.cxx.

References ActLnge, DEFINED, GetFormatEntry(), GetInstanceMutex(), SvNumberformat::GetType(), ImpGenerateCL(), ImpIsEntry(), IniLnge, LANGUAGE_DONTKNOW, and NUMBERFORMAT_ENTRY_NOT_FOUND.

◆ MatchSystemCurrency()

const NfCurrencyEntry * SvNumberFormatter::MatchSystemCurrency ( )
static

Searches, according to the default locale currency, an entry of the CurrencyTable which is <bold>not</bold> the first (LANGUAGE_SYSTEM) entry.

Returns
<NULL> if not found else pointer to NfCurrencyEntry

Definition at line 3669 of file zforlist.cxx.

References GetTheCurrencyTable(), and nSystemCurrencyPosition.

Referenced by GetCurrencyEntry(), and ImpLookupCurrencyEntryLoopBody().

◆ MergeFormatter()

SvNumberFormatterIndexTable * SvNumberFormatter::MergeFormatter ( SvNumberFormatter rNewTable)

◆ PutandConvertEntry()

bool SvNumberFormatter::PutandConvertEntry ( OUString &  rString,
sal_Int32 &  nCheckPos,
SvNumFormatType nType,
sal_uInt32 &  nKey,
LanguageType  eLnge,
LanguageType  eNewLnge,
bool  bConvertDateOrder,
bool  bReplaceBooleanEquivalent = true 
)

Same as <method>PutEntry</method> but the format code string is considered to be of language/country eLnge and is converted to language/country eNewLnge.

Definition at line 642 of file zforlist.cxx.

References ChangeIntl(), DEFINED, GetFormatEntry(), GetInstanceMutex(), SvNumberformat::GetType(), IniLnge, LANGUAGE_DONTKNOW, LOGICAL, nType, NUMBERFORMAT_ENTRY_NOT_FOUND, pFormatScanner, PutEntry(), and SAL_WARN.

Referenced by SvNumberFormatsObj::addNewConverted(), SvNumberformat::ConvertLanguage(), and GetFormatStringForExcel().

◆ PutandConvertEntrySystem()

bool SvNumberFormatter::PutandConvertEntrySystem ( OUString &  rString,
sal_Int32 &  nCheckPos,
SvNumFormatType nType,
sal_uInt32 &  nKey,
LanguageType  eLnge,
LanguageType  eNewLnge 
)

Same as <method>PutandConvertEntry</method> but the format code string is considered to be of the System language/country eLnge and is converted to another System language/country eNewLnge.

In this case the automatic currency is converted too.

Definition at line 698 of file zforlist.cxx.

References GetInstanceMutex(), IniLnge, LANGUAGE_DONTKNOW, nType, pFormatScanner, and PutEntry().

Referenced by GetIndexPuttingAndConverting().

◆ PutEntry()

bool SvNumberFormatter::PutEntry ( OUString &  rString,
sal_Int32 &  nCheckPos,
SvNumFormatType nType,
sal_uInt32 &  nKey,
LanguageType  eLnge = LANGUAGE_DONTKNOW,
bool  bReplaceBooleanEquivalent = true 
)

Create new entry of a format code string for language/country.

Returns
<TRUE> if string new and ok and inserted. <FALSE> if string already exists or an unresolvable parse error occurred, in which case nCheckPos is the error position within rString. If the error occurs at position 0 or rString is empty nCheckPos will be 1, so an error in the string is always indicated by nCheckPos not being zero. The content of the rString variable can be changed and corrected by the method. nType contains the type of the format. nKey contains the index key of the format.

Definition at line 574 of file zforlist.cxx.

References aFTable, ChangeIntl(), DEFINED, GetFormatEntry(), GetInstanceMutex(), SvNumberformat::GetLastInsertKey(), ImpGenerateCL(), ImpIsEntry(), IniLnge, LANGUAGE_DONTKNOW, nPos, nType, NUMBERFORMAT_ENTRY_NOT_FOUND, pFormatScanner, pStringScanner, SAL_WARN, SvNumberformat::SetLastInsertKey(), SV_COUNTRY_LANGUAGE_OFFSET, UNDEFINED, and ZF_STANDARD.

Referenced by SvNumberFormatsObj::addNew(), GetIndexPuttingAndConverting(), ImpGetDefaultCurrencyFormat(), ImpGetDefaultSystemCurrencyFormat(), PutandConvertEntry(), and PutandConvertEntrySystem().

◆ ReplaceSystemCL()

void SvNumberFormatter::ReplaceSystemCL ( LanguageType  eOldLanguage)

◆ ResetDefaultSystemCurrency()

void SvNumberFormatter::ResetDefaultSystemCurrency ( )

Definition at line 3783 of file zforlist.cxx.

References nDefaultSystemCurrencyFormat, and NUMBERFORMAT_ENTRY_NOT_FOUND.

◆ resetTheCurrencyTable()

void SvNumberFormatter::resetTheCurrencyTable ( )
static

◆ SetColorLink()

void SvNumberFormatter::SetColorLink ( const Link< sal_uInt16, Color * > &  rColorTableCallBack)

Set CallBack to ColorTable.

Definition at line 387 of file zforlist.cxx.

References aColorLink, and GetInstanceMutex().

◆ SetDefaultSystemCurrency()

void SvNumberFormatter::SetDefaultSystemCurrency ( std::u16string_view  rAbbrev,
LanguageType  eLang 
)
static

Set the default system currency.

The combination of abbreviation and language must match an existent element of theCurrencyTable. If not, the SYSTEM (current locale) entry becomes the default. This method is meant for the configuration of the default currency.

Definition at line 3748 of file zforlist.cxx.

References GetGlobalMutex(), GetLanguage(), SvtSysLocale::GetLanguageTag(), LanguageTag::getLanguageType(), GetTheCurrencyTable(), LANGUAGE_SYSTEM, nCount, nSystemCurrencyPosition, and NfCurrencyTable::size().

◆ SetEvalDateFormat()

void SvNumberFormatter::SetEvalDateFormat ( NfEvalDateFormat  eEDF)

Set evaluation type and order of input date strings.

See also
NfEvalDateFormat

Definition at line 3605 of file zforlist.cxx.

References eEvalDateFormat, and GetInstanceMutex().

◆ SetNoZero()

void SvNumberFormatter::SetNoZero ( bool  bNZ)

Set zero value suppression.

Definition at line 427 of file zforlist.cxx.

References bNoZero, and GetInstanceMutex().

Referenced by SvNumberFormatSettingsObj::setPropertyValue().

◆ SetYear2000()

void SvNumberFormatter::SetYear2000 ( sal_uInt16  nVal)

Set TwoDigitYearStart, how the input string scanner handles a two digit year.

Default from VCL: 1930, 30-99 19xx, 00-29 20xx

Historically (prior to src513e) it was a two digit number determining until which number the string scanner recognizes a year to be 20xx, default <= 29 is used by SFX/OfaMiscCfg. The name Year2000 is kept although the actual functionality is now a TwoDigitYearStart which might be in any century.

Definition at line 3617 of file zforlist.cxx.

References GetInstanceMutex(), and pStringScanner.

Referenced by SvNumberFormatSettingsObj::setPropertyValue().

◆ TestNewString()

sal_uInt32 SvNumberFormatter::TestNewString ( const OUString &  sFormatString,
LanguageType  eLnge = LANGUAGE_DONTKNOW 
)

Test whether the format code string is already present in container.

Returns
NUMBERFORMAT_ENTRY_NOT_FOUND if not found, else the format index.

Definition at line 2027 of file zforlist.cxx.

References ActLnge, ChangeIntl(), SvNumberformat::GetFormatstring(), GetInstanceMutex(), ImpGenerateCL(), ImpIsEntry(), IniLnge, LANGUAGE_DONTKNOW, NUMBERFORMAT_ENTRY_NOT_FOUND, pFormatScanner, and pStringScanner.

Friends And Related Function Documentation

◆ SvNumberFormatterRegistry_Impl

friend class SvNumberFormatterRegistry_Impl
friend

Definition at line 41 of file numformat.hxx.

Referenced by GetFormatterRegistry().

Member Data Documentation

◆ aColorLink

Link<sal_uInt16, Color*> SvNumberFormatter::aColorLink
private

Definition at line 591 of file numformat.hxx.

Referenced by GetUserDefColor(), and SetColorLink().

◆ ActLnge

LanguageType SvNumberFormatter::ActLnge
private

◆ aDateSep

OUString SvNumberFormatter::aDateSep
private

Definition at line 603 of file numformat.hxx.

Referenced by ChangeIntl(), GetDateSep(), and ImpConstruct().

◆ aDecimalSep

OUString SvNumberFormatter::aDecimalSep
private

Definition at line 600 of file numformat.hxx.

Referenced by ChangeIntl(), GetNumDecimalSep(), and ImpConstruct().

◆ aDecimalSepAlt

OUString SvNumberFormatter::aDecimalSepAlt
private

Definition at line 601 of file numformat.hxx.

Referenced by ChangeIntl(), GetNumDecimalSepAlt(), and ImpConstruct().

◆ aDefaultFormatKeys

DefaultFormatKeysMap SvNumberFormatter::aDefaultFormatKeys
private

Definition at line 580 of file numformat.hxx.

Referenced by ImpGetDefaultCurrencyFormat(), and ImpGetDefaultFormat().

◆ aFTable

std::map<sal_uInt32, std::unique_ptr<SvNumberformat> > SvNumberFormatter::aFTable
private

◆ aThousandSep

OUString SvNumberFormatter::aThousandSep
private

Definition at line 602 of file numformat.hxx.

Referenced by ChangeIntl(), GetNumThousandSep(), and ImpConstruct().

◆ bCurrencyTableInitialized

volatile bool SvNumberFormatter::bCurrencyTableInitialized = false
staticprivate

Definition at line 605 of file numformat.hxx.

Referenced by GetTheCurrencyTable(), ImpInitCurrencyTable(), and resetTheCurrencyTable().

◆ bNoZero

bool SvNumberFormatter::bNoZero
private

Definition at line 597 of file numformat.hxx.

Referenced by GetNoZero(), GetOutputString(), ImpConstruct(), and SetNoZero().

◆ eEvalDateFormat

NfEvalDateFormat SvNumberFormatter::eEvalDateFormat
private

Definition at line 596 of file numformat.hxx.

Referenced by GetEvalDateFormat(), ImpConstruct(), and SetEvalDateFormat().

◆ IniLnge

LanguageType SvNumberFormatter::IniLnge
private

◆ INPUTSTRING_PRECISION

const sal_uInt16 SvNumberFormatter::INPUTSTRING_PRECISION = ::std::numeric_limits<sal_uInt16>::max()-1
static

Precision suitable for numbers displayed in input bar, for instance Calc's formula input bar.

Definition at line 54 of file numformat.hxx.

Referenced by GetInputLineString(), SvNumberformat::GetOutputString(), SvNumberformat::ImpGetDateTimeOutput(), and SvNumberformat::ImpGetTimeOutput().

◆ m_aMutex

mutable::osl::Mutex SvNumberFormatter::m_aMutex
private

Definition at line 574 of file numformat.hxx.

◆ m_xContext

css::uno::Reference<css::uno::XComponentContext> SvNumberFormatter::m_xContext
private

◆ maLanguageTag

LanguageTag SvNumberFormatter::maLanguageTag
private

◆ MaxCLOffset

sal_uInt32 SvNumberFormatter::MaxCLOffset
private

◆ nDefaultSystemCurrencyFormat

sal_uInt32 SvNumberFormatter::nDefaultSystemCurrencyFormat
private

◆ nSystemCurrencyPosition

sal_uInt16 SvNumberFormatter::nSystemCurrencyPosition = 0
staticprivate

◆ pFormatScanner

std::unique_ptr<ImpSvNumberformatScan> SvNumberFormatter::pFormatScanner
private

◆ pFormatTable

std::unique_ptr<SvNumberFormatTable> SvNumberFormatter::pFormatTable
private

Definition at line 581 of file numformat.hxx.

Referenced by GetEntryTable(), and ImpConstruct().

◆ pFormatterRegistry

SvNumberFormatterRegistry_Impl * SvNumberFormatter::pFormatterRegistry = nullptr
staticprivate

Definition at line 607 of file numformat.hxx.

Referenced by GetFormatterRegistry(), and ~SvNumberFormatter().

◆ pMergeTable

std::unique_ptr<SvNumberFormatterIndexTable> SvNumberFormatter::pMergeTable
private

◆ pStringScanner

std::unique_ptr<ImpSvNumberInputScan> SvNumberFormatter::pStringScanner
private

◆ UNLIMITED_PRECISION

const sal_uInt16 SvNumberFormatter::UNLIMITED_PRECISION = ::std::numeric_limits<sal_uInt16>::max()
static

We can't technically have an "infinite" value, so we use an arbitrary upper precision threshold to represent the "unlimited" precision.

Definition at line 48 of file numformat.hxx.

Referenced by SvNumberformat::GetOutputString(), and SvNumberformat::GetThousandDivisorPrecision().

◆ xCalendar

OnDemandCalendarWrapper SvNumberFormatter::xCalendar
private

Definition at line 587 of file numformat.hxx.

Referenced by ChangeIntl(), GetCalendar(), and ImpConstruct().

◆ xCharClass

OnDemandCharClass SvNumberFormatter::xCharClass
private

Definition at line 584 of file numformat.hxx.

Referenced by ChangeIntl(), GetCharClass(), GetPreviewStringGuess(), and ImpConstruct().

◆ xLocaleData

OnDemandLocaleDataWrapper SvNumberFormatter::xLocaleData
private

◆ xNatNum

OnDemandNativeNumberWrapper SvNumberFormatter::xNatNum
private

Definition at line 588 of file numformat.hxx.

Referenced by GetNatNum(), and ImpConstruct().

◆ xTransliteration

OnDemandTransliterationWrapper SvNumberFormatter::xTransliteration
private

Definition at line 586 of file numformat.hxx.

Referenced by ChangeIntl(), GetPreviewStringGuess(), GetTransliteration(), and ImpConstruct().


The documentation for this class was generated from the following files: