diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-02-07 10:04:31 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-02-07 10:04:59 +0100 |
commit | 0443d296720971697c48453912cc9ffb742f8640 (patch) | |
tree | fffa53540e67883e92e4f674623544063b9a362d /i18npool | |
parent | 91fcdd5a8d5c71103220c97bc0bb48acf0a502ba (diff) |
Avoid generation of unused replaceFrom* variables
Change-Id: I2a65485b8dcaa7b6ed4a049f97d460878b8bb17d
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/localedata/LocaleNode.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx index 69360de102a8..05762c6b0c3b 100644 --- a/i18npool/source/localedata/LocaleNode.cxx +++ b/i18npool/source/localedata/LocaleNode.cxx @@ -617,9 +617,14 @@ void LCFormatNode::generateCode (const OFileWriter &of) const ::std::vector< OUString > theDateAcceptancePatterns; + OUString useLocale(getAttr().getValueByName("ref")); + OUString str; OUString strFrom( getAttr().getValueByName("replaceFrom")); - of.writeParameter("replaceFrom", strFrom, mnSection); + if (useLocale.isEmpty()) + { + of.writeParameter("replaceFrom", strFrom, mnSection); + } str = getAttr().getValueByName("replaceTo"); if (!strFrom.isEmpty() && str.isEmpty()) incErrorStr("replaceFrom=\"%s\" replaceTo=\"\" is empty replacement.", strFrom); @@ -640,9 +645,14 @@ void LCFormatNode::generateCode (const OFileWriter &of) const } } - OUString useLocale = getAttr().getValueByName("ref"); if (!useLocale.isEmpty()) { + if (!strFrom.isEmpty() && strFrom != "[CURRENCY]") //??? + { + incErrorStrStr( + "non-empty replaceFrom=\"%s\" with non-empty ref=\"%s\".", + strFrom, useLocale); + } useLocale = useLocale.replace( '-', '_'); switch (mnSection) { |