[Libreoffice-commits] core.git: fpicker/source
Douglas Mencken
dougmencken at gmail.com
Fri Feb 28 08:05:04 PST 2014
fpicker/source/aqua/NSURL_OOoAdditions.mm | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
New commits:
commit e53eacb13369e713c20153ea84caae6d8505f239
Author: Douglas Mencken <dougmencken at gmail.com>
Date: Fri Feb 28 09:13:20 2014 -0500
Use FSResolveAliasFile at least on OS X < 10.6
(see also: commit 7aa42913bb1828b877c2f73b4fe59cc3c65a67bf)
Change-Id: I6b8945bfcfce277eefdd54d25c7827c2ae19ef16
Reviewed-on: https://gerrit.libreoffice.org/8394
Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>
Tested-by: Norbert Thiebaud <nthiebaud at gmail.com>
diff --git a/fpicker/source/aqua/NSURL_OOoAdditions.mm b/fpicker/source/aqua/NSURL_OOoAdditions.mm
index 858eb27..80acb10 100644
--- a/fpicker/source/aqua/NSURL_OOoAdditions.mm
+++ b/fpicker/source/aqua/NSURL_OOoAdditions.mm
@@ -83,6 +83,25 @@ NSString* resolveAlias( NSString* i_pSystemPath )
kCFURLPOSIXPathStyle, false);
if( rUrl != NULL )
{
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
+ FSRef rFS;
+ if( CFURLGetFSRef( rUrl, &rFS ) )
+ {
+ Boolean bIsFolder = false;
+ Boolean bAlias = false;
+ OSErr err = FSResolveAliasFile( &rFS, true, &bIsFolder, &bAlias);
+ if( (err == noErr) && bAlias )
+ {
+ CFURLRef rResolvedUrl = CFURLCreateFromFSRef( kCFAllocatorDefault, &rFS );
+ if( rResolvedUrl != NULL )
+ {
+ pResolvedPath = (NSString*)CFURLCopyFileSystemPath( rResolvedUrl, kCFURLPOSIXPathStyle );
+ CFRelease( rResolvedUrl );
+ }
+ }
+ }
+ CFRelease( rUrl );
+#else
CFErrorRef rError;
CFDataRef rBookmark = CFURLCreateBookmarkDataFromFile( NULL, rUrl, &rError );
CFRelease( rUrl );
@@ -102,6 +121,7 @@ NSString* resolveAlias( NSString* i_pSystemPath )
CFRelease( rResolvedUrl );
}
}
+#endif
}
return pResolvedPath;
More information about the Libreoffice-commits
mailing list