summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Nowee <peter.nowee@gmail.com>2015-01-21 04:31:30 +0100
committerMichael Stahl <mstahl@redhat.com>2015-01-23 11:57:15 +0000
commit9a9a33efaf613f8c4b0e0b4f36053c0fda68187b (patch)
tree7fca1d67c59b2bc0e3e41159944873849d2437a4
parente1dcf9331eacc308b521609ccbb1eaf6a81f4826 (diff)
fdo#75467 extend Carbon API alias resolve from OS X 10.5 to 10.7
Commits aa539f6 and 7aa4291 (June 2013) change the way Mac alias files are resolved. They replace Carbon API calls that were deprecated in OS X 10.8, such as FSResolveAliasFile, by Cocoa API calls such as CFURLCreateBookmarkDataFromFile. Unfortunately, these changes were also responsible for bug fdo#75467: Under Mac OS X 10.6 and 10.7, selecting a file in the Open File dialog or merely viewing files in the Save File dialog adds resource fork to those files, changing their sizes and modification dates. Introducing only the calls CFURLCreateBookmarkDataFromFile to the code as it was before the above-mentioned commits already introduces the bug. It was further established that the bugs are specific to the OS version (10.6 and 10.7), not the bitness (32-bit) of the build. (Thanks to Alex Thurgood.) This all indicates that there is unexpected behavior in Apple's CFURLCreateBookmarkDataFromFile under Mac OS X 10.6 and 10.7. However, a web search for this behavior yielded no results, suggesting it may only show up under specific circumstances. Since there is no report of this behavior under Mac OS X 10.8 or higher, and a simple and effective solution is available (see below), I did not investigate any further. Reverting to the code using the Carbon API, as it was used up until LibreOffice 4.1, resolves the problem for Mac OS X 10.6 and 10.7. Douglas Mencken, in his work to port LibreOffice to PowerPC Macs, already brought back this code, wrapped in conditional compiler directives, so that it only applied to Mac OS X 10.5 and lower. See his commits e53eacb1 and 72e8f62 (February 2014). This commit extends the use of the Carbon API code for resolving aliases to Mac OS X 10.6 and 10.7 as well, thereby fixing bug fdo#75467. Change-Id: Ic2af13f487e1e62cb0a2683f3f4bbcf818e77e9f Reviewed-on: https://gerrit.libreoffice.org/14123 Reviewed-by: Tor Lillqvist <tml@collabora.com> Tested-by: Tor Lillqvist <tml@collabora.com> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--fpicker/source/aqua/NSURL_OOoAdditions.mm2
-rw-r--r--sal/osl/unx/system.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/fpicker/source/aqua/NSURL_OOoAdditions.mm b/fpicker/source/aqua/NSURL_OOoAdditions.mm
index 80acb10b6745..4e5ea6b5f7c2 100644
--- a/fpicker/source/aqua/NSURL_OOoAdditions.mm
+++ b/fpicker/source/aqua/NSURL_OOoAdditions.mm
@@ -83,7 +83,7 @@ NSString* resolveAlias( NSString* i_pSystemPath )
kCFURLPOSIXPathStyle, false);
if( rUrl != NULL )
{
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1080
FSRef rFS;
if( CFURLGetFSRef( rUrl, &rFS ) )
{
diff --git a/sal/osl/unx/system.c b/sal/osl/unx/system.c
index a234fce2a13a..8914275ea4bb 100644
--- a/sal/osl/unx/system.c
+++ b/sal/osl/unx/system.c
@@ -157,7 +157,7 @@ int macxp_resolveAlias(char *path, int buflen)
(void) buflen;
return 0;
#else
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1080
FSRef aFSRef;
OSStatus nErr;
Boolean bFolder;
@@ -181,7 +181,7 @@ int macxp_resolveAlias(char *path, int buflen)
if ( unprocessedPath )
*unprocessedPath = '\0';
-#if MAC_OS_X_VERSION_MAX_ALLOWED < 1060
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1080
nErr = noErr;
bFolder = FALSE;
bAliased = FALSE;