summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2015-06-03 15:37:59 +0200
committerEike Rathke <erack@redhat.com>2015-06-03 15:52:58 +0200
commitacf8946a5eea8bfb44817709b37dee171abb67e3 (patch)
tree653d740db4c3ac1eeafb57519a1118a33f981b74
parent12a5ed16718365fb9328ac4b399a41f219d4f3d2 (diff)
ensure that at least one abbreviated DateAcceptancePattern is present
Change-Id: I30619fc9f894dda89cd1c84153abcb21214a5fbc (cherry picked from commit 6df46d63e4397a0eb799149dab56a4c38b940e99)
-rw-r--r--i18npool/source/localedata/LocaleNode.cxx16
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;