1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0027433: Opening/Saving OCAF Documents With Own Document Format Does Not Work

Modified Load(...) method of Resource_Manager.cxx to print file names correctly.

Removed appending (empty) file name to directory name, since this is not
necessary and leads to a Standard_OutOfRange failure in TCollection_AsciiString.

Appending file name is done, but only if the name is not empty.

Added test case
This commit is contained in:
Benjamin Bihler
2016-04-28 14:18:35 +03:00
committed by bugmaster
parent c59fcd1186
commit a1530ab1b8
2 changed files with 30 additions and 4 deletions

View File

@@ -113,9 +113,9 @@ void Resource_Manager::Load(TCollection_AsciiString& aPath,
{
Resource_KindOfLine aKind;
TCollection_AsciiString Token1, Token2;
TCollection_AsciiString Directory, Name;
TCollection_AsciiString FileName;
OSD_File File = OSD_Path(aPath);
OSD_Path Path(aPath);
OSD_File File = Path;
TCollection_AsciiString FileName = Path.Name();
File.Open(OSD_ReadOnly,OSD_Protection());
if (File.Failed()) {
if (myVerbose)
@@ -486,7 +486,12 @@ void Resource_Manager::GetResourcePath (TCollection_AsciiString& aPath, const St
TCollection_AsciiString aResPath(dir);
OSD_Path anOSDPath(aResPath);
anOSDPath.DownTrek(anOSDPath.Name());
if (!anOSDPath.Name().IsEmpty())
{
anOSDPath.DownTrek(anOSDPath.Name());
}
anOSDPath.SetName(aName);
anOSDPath.SystemName(aPath);