diff options
author | Michael Meeks <michael.meeks@suse.com> | 2013-03-05 11:48:56 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-03-05 11:49:47 +0000 |
commit | c123ea35635943bebf87b7515ecf9c9e5b330ffe (patch) | |
tree | b0761cc3c7327bf5d4cc98a028552f6f0aff0a07 /vcl/source/filter/FilterConfigCache.cxx | |
parent | 0b789377ffc1a05b6c6a58e373900e378835e07e (diff) |
make vcl filter config extension search cleaner and more comprehensive
Change-Id: I7a5740b42490bf2301e6466f056fdb1dae4c6dbb
Diffstat (limited to 'vcl/source/filter/FilterConfigCache.cxx')
-rw-r--r-- | vcl/source/filter/FilterConfigCache.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vcl/source/filter/FilterConfigCache.cxx b/vcl/source/filter/FilterConfigCache.cxx index 53d0ef822fda..c3873c363576 100644 --- a/vcl/source/filter/FilterConfigCache.cxx +++ b/vcl/source/filter/FilterConfigCache.cxx @@ -333,6 +333,22 @@ sal_uInt16 FilterConfigCache::GetImportFormatNumber( const String& rFormatName ) return sal::static_int_cast< sal_uInt16 >(aIter == aImport.end() ? GRFILTER_FORMAT_NOTFOUND : aIter - aImport.begin()); } +/// get the index of the filter that matches this extension +sal_uInt16 FilterConfigCache::GetImportFormatNumberForExtension( const String& rExt ) +{ + CacheVector::iterator aIter( aImport.begin() ); + while ( aIter != aImport.end() ) + { + for ( sal_Int32 i = 0; i < aIter->lExtensionList.getLength(); i++ ) + { + if ( aIter->lExtensionList[i].equalsIgnoreAsciiCase( rExt ) ) + return sal::static_int_cast< sal_uInt16 >( aIter - aImport.begin() ); + } + aIter++; + } + return GRFILTER_FORMAT_NOTFOUND; +} + sal_uInt16 FilterConfigCache::GetImportFormatNumberForMediaType( const String& rMediaType ) { CacheVector::iterator aIter( aImport.begin() ); |