diff options
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/aqua/CFStringUtilities.cxx | 30 | ||||
-rw-r--r-- | fpicker/source/aqua/NSURL_OOoAdditions.mm | 40 | ||||
-rw-r--r-- | fpicker/source/aqua/SalAquaPicker.cxx | 12 |
3 files changed, 46 insertions, 36 deletions
diff --git a/fpicker/source/aqua/CFStringUtilities.cxx b/fpicker/source/aqua/CFStringUtilities.cxx index 7d9293d7a1f1..da624fe829a5 100644 --- a/fpicker/source/aqua/CFStringUtilities.cxx +++ b/fpicker/source/aqua/CFStringUtilities.cxx @@ -92,21 +92,25 @@ rtl::OUString CFURLRefToOUString(CFURLRef aUrlRef, InfoType info) CFRetain(sURLString); break; case FILENAME: - OSL_TRACE("Extracting the file name of an item"); - CFStringRef fullString = CFURLGetString(aUrlRef); - CFURLRef dirRef = CFURLCreateCopyDeletingLastPathComponent(NULL,aUrlRef); - CFIndex dirLength = CFStringGetLength(CFURLGetString(dirRef)); - CFRelease(dirRef); - CFIndex fullLength = CFStringGetLength(fullString); - CFRange substringRange = CFRangeMake(dirLength, fullLength - dirLength); - sURLString = CFStringCreateWithSubstring(NULL, fullString, substringRange); + { + OSL_TRACE("Extracting the file name of an item"); + CFStringRef fullString = CFURLGetString(aUrlRef); + CFURLRef dirRef = CFURLCreateCopyDeletingLastPathComponent(NULL,aUrlRef); + CFIndex dirLength = CFStringGetLength(CFURLGetString(dirRef)); + CFRelease(dirRef); + CFIndex fullLength = CFStringGetLength(fullString); + CFRange substringRange = CFRangeMake(dirLength, fullLength - dirLength); + sURLString = CFStringCreateWithSubstring(NULL, fullString, substringRange); + } break; case PATHWITHOUTLASTCOMPONENT: - OSL_TRACE("Extracting the last but one component of an item's path"); - CFURLRef directoryRef = CFURLCreateCopyDeletingLastPathComponent(NULL,aUrlRef); - sURLString = CFURLGetString(directoryRef); - CFRetain(sURLString); - CFRelease(directoryRef); + { + OSL_TRACE("Extracting the last but one component of an item's path"); + CFURLRef directoryRef = CFURLCreateCopyDeletingLastPathComponent(NULL,aUrlRef); + sURLString = CFURLGetString(directoryRef); + CFRetain(sURLString); + CFRelease(directoryRef); + } break; default: break; diff --git a/fpicker/source/aqua/NSURL_OOoAdditions.mm b/fpicker/source/aqua/NSURL_OOoAdditions.mm index 6be80a765228..e5d5aaa3e42e 100644 --- a/fpicker/source/aqua/NSURL_OOoAdditions.mm +++ b/fpicker/source/aqua/NSURL_OOoAdditions.mm @@ -45,28 +45,32 @@ [sURLString retain]; break; case FILENAME: - OSL_TRACE("Extracting the file name of an item"); - NSString *path = [self path]; - if (path == nil) { - sURLString = @""; - } - else { - sURLString = [path lastPathComponent]; + { + OSL_TRACE("Extracting the file name of an item"); + NSString *path = [self path]; + if (path == nil) { + sURLString = @""; + } + else { + sURLString = [path lastPathComponent]; + } + [sURLString retain]; } - [sURLString retain]; break; case PATHWITHOUTLASTCOMPONENT: - OSL_TRACE("Extracting the last but one component of an item's path"); - path = [self absoluteString]; - if (path == nil) { - sURLString = @""; - } - else { - NSString* lastComponent = [path lastPathComponent]; - unsigned int lastLength = [lastComponent length]; - sURLString = [path substringToIndex:([path length] - lastLength)]; + { + OSL_TRACE("Extracting the last but one component of an item's path"); + NSString *path = [self absoluteString]; + if (path == nil) { + sURLString = @""; + } + else { + NSString* lastComponent = [path lastPathComponent]; + unsigned int lastLength = [lastComponent length]; + sURLString = [path substringToIndex:([path length] - lastLength)]; + } + [sURLString retain]; } - [sURLString retain]; break; default: break; diff --git a/fpicker/source/aqua/SalAquaPicker.cxx b/fpicker/source/aqua/SalAquaPicker.cxx index 43962a30d3d5..07534a2f401a 100644 --- a/fpicker/source/aqua/SalAquaPicker.cxx +++ b/fpicker/source/aqua/SalAquaPicker.cxx @@ -123,11 +123,13 @@ void SAL_CALL SalAquaPicker::implInitialize() * So the only reliable way seems to be using the NSUserDefaults object because that is where that value is stored and * to just overwrite it if it has the wrong value. */ - NSUserDefaults *pDefaults = [NSUserDefaults standardUserDefaults]; - NSNumber *pExtn = [pDefaults objectForKey:kSetHideExtensionStateKey]; - if(pExtn == nil || [pExtn boolValue] == NO) { - OSL_TRACE("Hiding extension"); - [pDefaults setBool:YES forKey:kSetHideExtensionStateKey]; + { + NSUserDefaults *pDefaults = [NSUserDefaults standardUserDefaults]; + NSNumber *pExtn = [pDefaults objectForKey:kSetHideExtensionStateKey]; + if(pExtn == nil || [pExtn boolValue] == NO) { + OSL_TRACE("Hiding extension"); + [pDefaults setBool:YES forKey:kSetHideExtensionStateKey]; + } } break; |