#include <Message_Msg.hxx>
#include <Message_MsgFile.hxx>
#include <Message_Messenger.hxx>
-#include <Standard_AncestorIterator.hxx>
#include <TCollection_AsciiString.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <TColStd_HSequenceOfInteger.hxx>
return;
}
- const TCollection_AsciiString aClassName (DynamicType()->Name());
-
// Iterate on all set flags in the specified range
for ( Standard_Integer i = Message_ExecStatus::FirstStatus;
i <= Message_ExecStatus::LastStatus; i++ )
}
aSuffix.AssignCat( Message_ExecStatus::LocalStatusIndex( stat ) );
- // find message, iterating by base classes if necessary
- TCollection_AsciiString aMsgName = aClassName + aSuffix;
- Handle(Standard_Type) aType = DynamicType();
- while (! Message_MsgFile::HasMsg(aMsgName) && !aType.IsNull())
+ // find message, prefixed by class type name, iterating by base classes if necessary
+ TCollection_AsciiString aMsgName;
+ for (Handle(Standard_Type) aType = DynamicType(); ! aType.IsNull(); aType = aType->Parent())
{
- Standard_AncestorIterator it(aType);
- aType.Nullify();
- for (; it.More(); it.Next())
- {
- aType = it.Value();
- TCollection_AsciiString aClassName1 (aType->Name());
- TCollection_AsciiString aMsgName1 = aClassName1 + aSuffix;
- if (Message_MsgFile::HasMsg(aMsgName1))
- {
- aMsgName = aMsgName1;
- break;
- }
- }
+ aMsgName = aType->Name();
+ aMsgName += aSuffix;
+ if (Message_MsgFile::HasMsg(aMsgName))
+ break;
}
// create a message