Avoid generation of unused replaceFrom* variables

Change-Id: I2a65485b8dcaa7b6ed4a049f97d460878b8bb17d
This commit is contained in:
Stephan Bergmann
2014-02-07 10:04:31 +01:00
parent 91fcdd5a8d
commit 0443d29672

View File

@@ -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"));
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)
{