summaryrefslogtreecommitdiff
path: root/fpicker/source
diff options
context:
space:
mode:
authorPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2010-02-12 11:35:33 +0100
committerPhilipp Lohmann [pl] <Philipp.Lohmann@Sun.COM>2010-02-12 11:35:33 +0100
commit46752d1d51b5c82f17469c5749bdfa9c39d2788d (patch)
tree08fe3a0d8e1bdb0bd959b7ef034a315bf8760a1f /fpicker/source
parentd6f36043c6d5e3cdec583eef49c285b530d187b9 (diff)
vcl109: #i109129# avoid recursive behavior of NSFileWrapper
Diffstat (limited to 'fpicker/source')
-rw-r--r--fpicker/source/aqua/FilterHelper.cxx28
1 files changed, 11 insertions, 17 deletions
diff --git a/fpicker/source/aqua/FilterHelper.cxx b/fpicker/source/aqua/FilterHelper.cxx
index 75996f2d32..f135c63910 100644
--- a/fpicker/source/aqua/FilterHelper.cxx
+++ b/fpicker/source/aqua/FilterHelper.cxx
@@ -394,30 +394,25 @@ sal_Bool FilterHelper::filenameMatchesFilter(NSString* sFilename)
{
DBG_PRINT_ENTRY(CLASS_NAME, __func__);
-// OSL_TRACE("filter event handler called");
-
if (m_aCurrentFilter == NULL) {
OSL_TRACE("filter name is null");
return sal_True;
}
NSFileManager *manager = [NSFileManager defaultManager];
- MacOSBOOL bDir = NO;
- if ([manager fileExistsAtPath:sFilename isDirectory:&bDir] && bDir == YES) {
-// OSL_TRACE(" folder");
- return sal_True;
- }
-
- NSFileWrapper *wrapper = [[NSFileWrapper alloc] initWithPath:sFilename];
- MacOSBOOL bIsLink = [wrapper isSymbolicLink];
- [wrapper release];
- if (bIsLink) {
-// OSL_TRACE(" symboliclink");
- return sal_True;
+ NSDictionary* pAttribs = [manager fileAttributesAtPath: sFilename traverseLink: NO];
+ if( pAttribs )
+ {
+ NSObject* pType = [pAttribs objectForKey: NSFileType];
+ if( pType && [pType isMemberOfClass: [NSString class]] )
+ {
+ NSString* pT = (NSString*)pType;
+ if( [pT isEqualToString: NSFileTypeDirectory] ||
+ [pT isEqualToString: NSFileTypeSymbolicLink] )
+ return sal_True;
+ }
}
-// OSL_TRACE(" file");
-
FilterList::iterator filter = ::std::find_if(m_pFilterList->begin(), m_pFilterList->end(), FilterTitleMatch(m_aCurrentFilter));
if (filter == m_pFilterList->end()) {
OSL_TRACE("filter not found in list");
@@ -427,7 +422,6 @@ sal_Bool FilterHelper::filenameMatchesFilter(NSString* sFilename)
OUStringList suffixList = filter->getFilterSuffixList();
{
-// OSL_TRACE(" starting to work");
rtl::OUString aName = [sFilename OUString];
rtl::OUString allMatcher = rtl::OUString::createFromAscii(".*");
for(OUStringList::iterator iter = suffixList.begin(); iter != suffixList.end(); iter++) {