mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024852: Crash on storage of an Ocaf document in XML file format
Blanks are removed. A check is implemented to correct a GUID in case of presence of the blanks. Test case for issues CR24852
This commit is contained in:
@@ -1187,7 +1187,16 @@ void CDM_Document::LoadResources()
|
||||
theResourceName+="StoragePlugin";
|
||||
TCollection_ExtendedString thePluginId;
|
||||
FIND(theDocumentResource,theResourceName,myStoragePluginWasFound,thePluginId);
|
||||
if(myStoragePluginWasFound) myStoragePlugin=UTL::GUID(thePluginId);
|
||||
if(myStoragePluginWasFound)
|
||||
{
|
||||
// Check whether the GUID (as a string) contains blanks before and after the string.
|
||||
// If it is so, remove them.
|
||||
if (thePluginId.Search(' ') != -1)
|
||||
thePluginId.RemoveAll(' ');
|
||||
|
||||
// Convert to GUID.
|
||||
myStoragePlugin=UTL::GUID(thePluginId);
|
||||
}
|
||||
myResourcesAreLoaded=Standard_True;
|
||||
|
||||
// cout << "resource Loaded: " << "Format: " << theFormat << ", FileExtension:" << myFileExtension << ", DataType:" << myDataType << ", VersionDataType:" << myVersionDataType << ", Description:" << myDescription << ", Domain:" << myDomain << endl;
|
||||
|
Reference in New Issue
Block a user