Kaydet (Commit) 6df46d63 authored tarafından Eike Rathke's avatar Eike Rathke

ensure that at least one abbreviated DateAcceptancePattern is present

Change-Id: I30619fc9f894dda89cd1c84153abcb21214a5fbc
üst c681c4ca
...@@ -896,6 +896,22 @@ void LCFormatNode::generateCode (const OFileWriter &of) const ...@@ -896,6 +896,22 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
// LC_FORMAT, not in optional LC_FORMAT_1 // LC_FORMAT, not in optional LC_FORMAT_1
if (mnSection == 0) 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 // 0..47 MUST be present, 48,49 MUST NOT be present
ValueSet::const_iterator aIter( aFormatIndexSet.begin()); ValueSet::const_iterator aIter( aFormatIndexSet.begin());
for (sal_Int16 nNext = cssi::NumberFormatIndex::NUMBER_START; for (sal_Int16 nNext = cssi::NumberFormatIndex::NUMBER_START;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment