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

rudimentary check if date acceptance pattern interferes with decimal number

üst fa836f7b
......@@ -382,7 +382,8 @@ void LCInfoNode::generateCode (const OFileWriter &of) const
}
OUString aDateSep;
static OUString aDateSep;
static OUString aDecSep;
void LCCTYPENode::generateCode (const OFileWriter &of) const
{
......@@ -400,7 +401,7 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const
writeParameterCheckLen( of, "DateSeparator", "dateSeparator", 1, 1);
OUString aThoSep =
writeParameterCheckLen( of, "ThousandSeparator", "thousandSeparator", 1, 1);
OUString aDecSep =
aDecSep =
writeParameterCheckLen( of, "DecimalSeparator", "decimalSeparator", 1, 1);
OUString aTimeSep =
writeParameterCheckLen( of, "TimeSeparator", "timeSeparator", 1, 1);
......@@ -1203,6 +1204,24 @@ void LCFormatNode::generateCode (const OFileWriter &of) const
}
}
// Rudimentary check if a pattern interferes with decimal number.
nIndex = 0;
sal_uInt32 cDecSep = aDecSep.iterateCodePoints( &nIndex);
for (vector<OUString>::const_iterator aIt = theDateAcceptancePatterns.begin();
aIt != theDateAcceptancePatterns.end(); ++aIt)
{
if ((*aIt).getLength() == (cDecSep <= 0xffff ? 3 : 4))
{
nIndex = 1;
if ((*aIt).iterateCodePoints( &nIndex) == cDecSep)
{
++nError;
fprintf( stderr, "Error: Date acceptance pattern '%s' matches decimal number '#%s#'\n",
OSTR( *aIt), OSTR( aDecSep));
}
}
}
sal_Int16 nbOfDateAcceptancePatterns = static_cast<sal_Int16>(theDateAcceptancePatterns.size());
for (sal_Int16 i = 0; i < nbOfDateAcceptancePatterns; ++i)
......
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