fixing the carbon cfm

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2004-06-05 16:20:27 +00:00
parent 1f919f38c8
commit e996f50942
2 changed files with 25 additions and 2 deletions

View File

@@ -923,9 +923,28 @@ wxString wxMacFSSpec2MacFilename( const FSSpec *spec )
Str255 theParentPath = "\p";
FSSpec theParentSpec;
FSRef theParentRef;
FSRef theRef ;
char theFileName[FILENAME_MAX];
char thePath[FILENAME_MAX];
// we loose the long filename by merely copying the spec->name
// so try the built-ins, which only work if the file exists, but still...
theErr = FSpMakeFSRef(spec, &theRef);
if ( theErr == noErr )
{
CFURLRef fullURLRef;
fullURLRef = ::CFURLCreateFromFSRef(NULL, &theRef);
#ifdef __UNIX__
CFURLPathStyle pathstyle = kCFURLPOSIXPathStyle;
#else
CFURLPathStyle pathstyle = kCFURLHFSPathStyle;
#endif
CFStringRef cfString = CFURLCopyFileSystemPath(fullURLRef, pathstyle);
::CFRelease( fullURLRef ) ;
return wxMacCFStringHolder(cfString).AsString(wxFont::GetDefaultEncoding());
}
strcpy(thePath, "");
// GD: Separate file name from path and make a FSRef to the parent