#define SV_COUNTRY_LANGUAGE_OFFSET 10000// Max count of formats per country/language #define SV_MAX_COUNT_STANDARD_FORMATS 100// Max count of builtin default formats per CL
constexpr size_t NF_MAX_FORMAT_SYMBOLS = 100;
/// The built-in @ Text format, offset within a locale, key in the locale the /// number formatter was constructed with.
constexpr sal_uInt32 NF_STANDARD_FORMAT_TEXT = SV_MAX_COUNT_STANDARD_FORMATS;
enumclass SvNumFormatType : sal_Int16
{ /** selects all number formats.
*/
ALL = css::util::NumberFormat::ALL, // 0 /** selects only user-defined number formats.
*/ DEFINED = css::util::NumberFormat::DEFINED, // 1 /** selects date formats.
*/
DATE = css::util::NumberFormat::DATE, // 2 /** selects time formats.
*/
TIME = css::util::NumberFormat::TIME, // 4 /** selects currency formats.
*/
CURRENCY = css::util::NumberFormat::CURRENCY, // 8 /** selects decimal number formats.
*/
NUMBER = css::util::NumberFormat::NUMBER, // 16 /** selects scientific number formats.
*/
SCIENTIFIC = css::util::NumberFormat::SCIENTIFIC, // 32 /** selects number formats for fractions.
*/
FRACTION = css::util::NumberFormat::FRACTION, // 64 /** selects percentage number formats.
*/
PERCENT = css::util::NumberFormat::PERCENT, // 128 /** selects text number formats.
*/
TEXT = css::util::NumberFormat::TEXT, // 256 /** selects number formats which contain date and time.
*/
DATETIME = DATE | TIME, // 6 /** selects boolean number formats.
*/
LOGICAL = css::util::NumberFormat::LOGICAL, // 1024 /** is used as a return value if no format exists.
*/
UNDEFINED = css::util::NumberFormat::UNDEFINED, // 2048 /** @internal is used to flag an empty sub format. @sinceLibreOffice5.1
*/
EMPTY = css::util::NumberFormat::EMPTY, // 4096 /** @internal selects a time duration format. 8192+TIME(4) @sinceLibreOffice6.2
*/
DURATION = css::util::NumberFormat::DURATION, // 8196
}; namespace o3tl { template<> struct typed_flags<SvNumFormatType> : is_typed_flags<SvNumFormatType, 0x3dff> {};
}
/** enum values for <method>SvNumberFormatter::GetFormatIndex</method>
NF_DATETIME_START,
NF_DATETIME_SYSTEM_SHORT_HHMM = NF_DATETIME_START, // 08.10.97 01:23
NF_DATETIME_SYS_DDMMYYYY_HHMMSS, // 08.10.1997 01:23:45 THE edit format, formatindex="47"
NF_DATETIME_END = NF_DATETIME_SYS_DDMMYYYY_HHMMSS,
NF_BOOLEAN, // BOOLEAN
NF_TEXT, // @
NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS, // == 50, old number of predefined entries, i18npool locale data additions start after this
// From here on are values of new predefined and built-in formats that are // not in the original NumberFormatIndex.idl
// XXX Values appended here must also get a corresponding entry in // svl/source/numbers/zforlist.cxx indexTable[] in the same order.
// XXX The dialog's number format shell assumes start/end spans // (NF_..._START and NF_..._END above) to fill its categories with builtin // formats, make new formats known to svx/source/items/numfmtsh.cxx // SvxNumberFormatShell::FillEListWithStd_Impl(), otherwise they will not // be listed at all. Yes that is ugly. // DATETIME formats need to be added to // SvxNumberFormatShell::FillEListWithDateTime_Impl().
// New predefined format added to i18npool locale data.
NF_DATETIME_SYS_DDMMYYYY_HHMM = NF_INDEX_TABLE_LOCALE_DATA_DEFAULTS, // 08.10.1997 01:23 formatindex="50"
// No i18npool defined locale data between here and NF_INDEX_TABLE_ENTRIES.
NF_INDEX_TABLE_RESERVED_START,
NF_DATETIME_ISO_YYYYMMDD_HHMMSS, // 1997-10-08 01:23:45 ISO (with blank instead of T)
NF_DATETIME_ISO_YYYYMMDD_HHMMSS000, // 1997-10-08 01:23:45.678 not quite ISO with locale's separator
NF_DATETIME_ISO_YYYYMMDDTHHMMSS, // 1997-10-08T01:23:45 ISO
NF_DATETIME_ISO_YYYYMMDDTHHMMSS000, // 1997-10-08T01:23:45,678 ISO with milliseconds and ',' or '.'
// XXX When adding values here, follow the comment above about // svx/source/items/numfmtsh.cxx
NF_INDEX_TABLE_ENTRIES // == 62, reserved to not be used in i18npool locale data.
// XXX Adding values above may increment the reserved area that can't be // used by i18npool's locale data FormatCode definitions, see the // description at i18npool/source/localedata/data/locale.dtd for ELEMENT // FormatCode what the current convention's value is. In that case, the // used formatIndex values in i18npool/source/localedata/data/*.xml will // have to be adjusted. // Overlapping the area will bail out with a check in // SvNumberFormatter::ImpInsertFormat() in debug builds.
};
// #45717# IsNumberFormat( "98-10-24", 30, x ), YMD Format set with DMY // International settings doesn't recognize the string as a date. /** enum values for <method>SvNumberFormatter::SetEvalDateFormat</method>
<p>How<method>ImpSvNumberInputScan::GetDateRef</method>shalltakethe DateFormatorder(YMD,DMY,MDY)intoaccount,ifcalledfromIsNumberFormat withadateformattomatchagainst.
*/ enum NfEvalDateFormat
{ /** DateFormat only from International, default. */
NF_EVALDATEFORMAT_INTL,
/** DateFormat only from date format passed to function (if any).
If no date format is passed then the DateFormat is taken from International. */
NF_EVALDATEFORMAT_FORMAT,
/** First try the DateFormat from International. If it doesn't match a
valid date try the DateFormat from the date format passed. */
NF_EVALDATEFORMAT_INTL_FORMAT,
/** First try the DateFormat from the date format passed. If it doesn't
match a valid date try the DateFormat from International. */
NF_EVALDATEFORMAT_FORMAT_INTL
};
/// This table is std::map because it needs to preserve insertion order, /// because the formats are roughly ordered from most to least common, and some /// parts of the UI want to show them in that order. typedef std::map<sal_uInt32, SvNumberformat*> SvNumberFormatTable; typedef std::unordered_map<sal_uInt16, sal_uInt32> SvNumberFormatterIndexTable; typedef std::unordered_map< sal_uInt32, sal_uInt32> SvNumberFormatterMergeMap;
/** Language/country dependent currency entries
*/ class UNLESS_MERGELIBS(SVL_DLLPUBLIC) NfCurrencyEntry final
{
OUString aSymbol; /// currency symbol
OUString aBankSymbol; /// currency abbreviation
LanguageType eLanguage; /// language/country value
sal_uInt16 nPositiveFormat; /// position of symbol
sal_uInt16 nNegativeFormat; /// position of symbol and type and position of negative sign
sal_uInt16 nDigits; /// count of decimal digits
sal_Unicode cZeroChar; /// which character is used for zeros as last decimal digits
private:
// nDecimalFormat := 0, 1, 2 // #,##0 or #,##0.00 or #,##0.-- is returned
SVL_DLLPRIVATE OUString Impl_BuildFormatStringNumChars( const LocaleDataWrapper&, sal_uInt16 nDecimalFormat) const;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.