+ if (!aLastLevel.empty()) { // get the context
+ size_t aLinePos = aLastLevel.find(L"_");
+ if (aLinePos != std::wstring::npos) {
+ std::wstring aContextName = aLastLevel.substr(aLinePos + 1);
+ if (!aContextName.empty()) {
+ TDF_Label aThisContext, aValue;
+ if (theNameGenerator->restoreContext(aContextName, aThisContext, aValue)) {
+ if (!aThisContext.IsNull())
+ aContext = aThisContext;
+ }
+ }
+ }
+ }
+ myContext = aContext;