- if (fullURLRef)
- {
- CFStringRef cfString = ::CFURLCopyPath(fullURLRef);
- ::CFRelease(fullURLRef);
-
- if (cfString)
- {
- // unescape the URL for
- // "file name" instead of "file%20name"
- CFStringRef cfStringUnescaped =
- ::CFURLCreateStringByReplacingPercentEscapes(NULL,
- cfString,
- CFSTR(""));
- ::CFRelease(cfString);
-
- if (cfStringUnescaped)
- {
- Size len = CFStringGetLength( cfStringUnescaped ) ;
- wxChar* buf = thePath.GetWriteBuf( len ) ;
- //buf[0] = '\0';
-#if wxUSE_UNICODE
- CFStringGetCharacters(cfStringUnescaped , CFRangeMake( 0 , len ) , (UniChar*) buf ) ;
-#else
- CFStringGetCString( cfStringUnescaped , buf , len+1 , CFStringGetSystemEncoding() ) ;
-#endif
- buf[len] = 0 ;
- wxMacConvertNewlines10To13( buf ) ;
- thePath.UngetWriteBuf() ;
- ::CFRelease(cfStringUnescaped);
- }
- }
- }
- }
- if (!thePath)
- {
- ::NavDisposeReply(&navReply);
- return wxID_CANCEL;