diff options
author | Eike Rathke <erack@redhat.com> | 2015-06-03 15:37:59 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-08-06 12:21:45 +0200 |
commit | f0c59eeb5faa6fa991b1491c61d679efec7c6e1d (patch) | |
tree | f90e31b10bd7820bb58d280cd3943f6e65719eee /i18npool | |
parent | 30cc030b6bd58da681e7ab8e09b1fa6063e7daa3 (diff) |
ensure that at least one abbreviated DateAcceptancePattern is present
Change-Id: I30619fc9f894dda89cd1c84153abcb21214a5fbc
(cherry picked from commit 6df46d63e4397a0eb799149dab56a4c38b940e99)
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/localedata/LocaleNode.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index 07f7d100bf5f..8ef4149c709a 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -896,6 +896,22 @@ void LCFormatNode::generateCode (const OFileWriter &of) const // LC_FORMAT, not in optional LC_FORMAT_1 if (mnSection == 0) { + // At least one abbreviated date acceptance pattern must be present. + if (theDateAcceptancePatterns.empty()) + incError( "No DateAcceptancePattern present.\n"); + else + { + bool bHaveAbbr = false; + for (::std::vector< OUString >::const_iterator it( theDateAcceptancePatterns.begin()); + !bHaveAbbr && it != theDateAcceptancePatterns.end(); ++it) + { + if ((*it).indexOf('D') > -1 && (*it).indexOf('M') > -1 && (*it).indexOf('Y') <= -1) + bHaveAbbr = true; + } + if (!bHaveAbbr) + incError( "No abbreviated DateAcceptancePattern present. For example M/D or D.M.\n"); + } + // 0..47 MUST be present, 48,49 MUST NOT be present ValueSet::const_iterator aIter( aFormatIndexSet.begin()); for (sal_Int16 nNext = cssi::NumberFormatIndex::NUMBER_START; |