]> git.saurik.com Git - wxWidgets.git/commitdiff
fixing the carbon cfm
authorStefan Csomor <csomor@advancedconcepts.ch>
Sat, 5 Jun 2004 16:20:27 +0000 (16:20 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sat, 5 Jun 2004 16:20:27 +0000 (16:20 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/filefn.cpp
src/mac/carbon/utils.cpp

index 2bb2a424022dc06af37069008865ba8963078f43..c5c4267f2e80843f192168eee3aaa35d7835f3b4 100644 (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
index c2f1be7ea19fb143ec6a9cc57041dd0fa9bd6937..258c28bcf165485406d4a11be3b8c2359a4aecbf 100644 (file)
@@ -1307,9 +1307,13 @@ OSStatus wxMacControl::SetData(ControlPartCode inPartCode , ResType inTag , Size
 
 OSStatus wxMacControl::SendEvent(  EventRef event , OptionBits inOptions ) 
 {
+#if TARGET_API_MAC_OSX
     return SendEventToEventTargetWithOptions( event, 
-        HIObjectGetEventTarget( (HIObjectRef) m_controlRef ),
-               inOptions );        
+        HIObjectGetEventTarget(  (HIObjectRef) m_controlRef ), inOptions );        
+#else
+    #pragma unused(inOptions) 
+    return SendEventToEventTarget(event,GetControlEventTarget( m_controlRef ) ) ;
+#endif
 }
 
 OSStatus wxMacControl::SendHICommand( HICommand &command , OptionBits inOptions )