office-gobmx/include/i18npool/reservedconstants.hxx
Eike Rathke 8453f6e5d1 Resolves: tdf#130563 Add predefined 4-digit year date+time format
Add a predefined NF_DATETIME_SYS_DDMMYYYY_HHMM format code with
formatindex="50" to all locale data files, which shifts all
reserved area internally generated built-in formats up by one.
Reserved area was filled already so that boundary has to be
increased as well. Add some flexibility for future additions by
setting the new boundary to 65, free first format index to be used
by additional locale data formats is 66 now. Adapt all locales to
the new boundary.

The existing predefined NF_DATETIME_SYSTEM_SHORT_HHMM format code
with formatindex="46" mostly was and is used with 2-digit years
(stemming back from the old binary format and Excel
compatibility), some locales that don't use 2-digit years at all
already defined it to 4-digit years. Keep those but move the
default="true" attribute (if so) to the new "50" format.

Modify populating the format list such that resulting duplicates
will be suppressed there as well.

Also try to match the new format in ODF import if a long year was
requested with date+time.

Finally set the new format as default for all *_IT locales. In
future changing the default date+time format to 4-digit year is
just a matter of moving the default="true" attribute to the new
format.

Change-Id: Ib16aa9fda0e71b2d03f78e3dd013785de03cd288
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89265
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
2020-02-22 20:17:54 +01:00

29 lines
1.2 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <sal/types.h>
/** Constant values shared between i18npool and, for example, the number formatter. */
namespace i18npool
{
/** The number of predefined format code indices that must be defined by
locale data, except BOOLEAN and TEXT, exclusive.
This later in the build is static asserted to be equal to
NfIndexTableOffset::NF_INDEX_TABLE_RESERVED_START. */
constexpr sal_Int16 nStopPredefinedFormatIndex = 51;
/** The number of reserved (with defined meaning) built-in format code indices,
additional locale data format codes can be defined starting at this index
value.
This later in the build is static asserted to be greater or equal to
NfIndexTableOffset::NF_INDEX_TABLE_ENTRIES */
constexpr sal_Int16 nFirstFreeFormatIndex = 66;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */