summaryrefslogtreecommitdiff
path: root/fpicker
diff options
context:
space:
mode:
authorDouglas Mencken <dougmencken@gmail.com>2014-02-28 09:13:20 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-02-28 10:04:42 -0600
commite53eacb13369e713c20153ea84caae6d8505f239 (patch)
tree9c77f9fd4764c38e6d1ccbed07854a6179ae99bb /fpicker
parent9beccfbd3793c86e1f6c4187c159e8a4c0bbba3a (diff)
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@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'fpicker')
-rw-r--r--fpicker/source/aqua/NSURL_OOoAdditions.mm20
1 files changed, 20 insertions, 0 deletions
diff --git a/fpicker/source/aqua/NSURL_OOoAdditions.mm b/fpicker/source/aqua/NSURL_OOoAdditions.mm
index 858eb27f04a4..80acb10b6745 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;