OSQLParser::RuleIDToRule should not silently change s_aReverseRuleIDLookup

Change-Id: I2b408a23162b1200bbcd530be7acb42435388b04
This commit is contained in:
Lionel Elie Mamane 2013-01-23 15:20:24 +01:00
parent 22fef9910e
commit 09109f3dcd
2 changed files with 13 additions and 1 deletions

View File

@ -4772,7 +4772,18 @@ sal_uInt32 OSQLParser::StrToRuleID(const ::rtl::OString & rValue)
//-----------------------------------------------------------------------------
OSQLParseNode::Rule OSQLParser::RuleIDToRule( sal_uInt32 _nRule )
{
return s_aReverseRuleIDLookup[ _nRule ];
OSQLParser::RuleIDMap::const_iterator i (s_aReverseRuleIDLookup.find(_nRule));
if (i == s_aReverseRuleIDLookup.end())
{
SAL_WARN("connectivity.parse",
"connectivity::OSQLParser::RuleIDToRule cannot reverse-lookup rule. "
"Reverse mapping incomplete? "
"_nRule='" << _nRule << "' "
"yytname[_nRule]='" << yytname[_nRule] << "'");
return OSQLParseNode::UNKNOWN_RULE;
}
else
return i->second;
}
//-----------------------------------------------------------------------------

View File

@ -37,6 +37,7 @@ certain functionality.
@section connectivity
@li @c connectivity.mork
@li @c connectivity.parse
@section cui