mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-05-16 06:25:04 +08:00
0025057: Message_Algorithm fails to find messages defined for base class
New method HasMsg() is added in Message_MsgFile class to check if message with given key is registered. That method is used in Message_Algorithm to check if message is defined on given level of class hierarchy. Generation of error message in Message_MsgFile::Msg() is revised: now it includes a message key and gets added to the registry, to avoid re-generation in case of multiple requests. Access to message registry maintained by the Message_MsgFile class is protected from concurrent access by mutex.
This commit is contained in:
@@ -224,7 +224,7 @@ void Message_Algorithm::SendStatusMessages (const Message_ExecStatus& theStatus,
|
||||
// find message, iterating by base classes if necessary
|
||||
TCollection_AsciiString aMsgName = aClassName + aSuffix;
|
||||
Handle(Standard_Type) aType = DynamicType();
|
||||
while (Message_MsgFile::Msg(aMsgName).Length() == 0 && !aType.IsNull())
|
||||
while (! Message_MsgFile::HasMsg(aMsgName) && !aType.IsNull())
|
||||
{
|
||||
Standard_AncestorIterator it(aType);
|
||||
aType.Nullify();
|
||||
@@ -233,7 +233,7 @@ void Message_Algorithm::SendStatusMessages (const Message_ExecStatus& theStatus,
|
||||
aType = it.Value();
|
||||
TCollection_AsciiString aClassName1 (aType->Name());
|
||||
TCollection_AsciiString aMsgName1 = aClassName1 + aSuffix;
|
||||
if (Message_MsgFile::Msg(aMsgName1).Length() != 0)
|
||||
if (Message_MsgFile::HasMsg(aMsgName1))
|
||||
{
|
||||
aMsgName = aMsgName1;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user