summaryrefslogtreecommitdiff
path: root/i18npool/source/localedata/LocaleNode.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'i18npool/source/localedata/LocaleNode.cxx')
-rw-r--r--i18npool/source/localedata/LocaleNode.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index 7596efc1087c..3f09e394a833 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -448,6 +448,11 @@ void LCCTYPENode::generateCode (const OFileWriter &of) const
if (aListSep == aThoSep)
fprintf( stderr, "Warning: %s\n",
"ListSeparator equals ThousandSeparator.");
+ if (aListSep.getLength() != 1 || aListSep.getStr()[0] != ';')
+ {
+ incError( "ListSeparator not ';' semicolon. Strongly recommended. Currently required.");
+ ++nSavErr; // format codes not affected
+ }
if (aTimeSep == aTime100Sep)
++nWarn, fprintf( stderr, "Warning: %s\n",
"Time100SecSeparator equals TimeSeparator, this is probably an error.");
@@ -1299,6 +1304,16 @@ void LCCalendarNode::generateCode (const OFileWriter &of) const
delete []nbOfEras;
}
+bool isIso4217( const OUString& rStr )
+{
+ const sal_Unicode* p = rStr.getStr();
+ return rStr.getLength() == 3
+ && 'A' <= p[0] && p[0] <= 'Z'
+ && 'A' <= p[1] && p[1] <= 'Z'
+ && 'A' <= p[2] && p[2] <= 'Z'
+ ;
+}
+
void LCCurrencyNode :: generateCode (const OFileWriter &of) const
{
::rtl::OUString useLocale = getAttr() -> getValueByName("ref");
@@ -1336,10 +1351,17 @@ void LCCurrencyNode :: generateCode (const OFileWriter &of) const
}
str = calNode -> findNode ("CurrencyID") -> getValue();
of.writeParameter("currencyID", str, nbOfCurrencies);
+ // CurrencyID MUST be ISO 4217.
+ if (!bLegacy && !isIso4217(str))
+ incError( "CurrencyID is not ISO 4217");
str = calNode -> findNode ("CurrencySymbol") -> getValue();
of.writeParameter("currencySymbol", str, nbOfCurrencies);
str = calNode -> findNode ("BankSymbol") -> getValue();
of.writeParameter("bankSymbol", str, nbOfCurrencies);
+ // BankSymbol currently must be ISO 4217. May change later if
+ // application always uses CurrencyID instead of BankSymbol.
+ if (!bLegacy && !isIso4217(str))
+ incError( "BankSymbol is not ISO 4217");
str = calNode -> findNode ("CurrencyName") -> getValue();
of.writeParameter("currencyName", str, nbOfCurrencies);
str = calNode -> findNode ("DecimalPlaces") -> getValue();