diff options
author | Rüdiger Timm <rt@openoffice.org> | 2005-01-28 16:23:52 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2005-01-28 16:23:52 +0000 |
commit | d24aaac83ac01d278bb12b13645ea584a37f9a1e (patch) | |
tree | 292ff27ac212e788bcd5f645ab587fc43f884015 /sfx2/source/dialog | |
parent | 178fc348de1cc9e875c3cebd81ee76e99819bed8 (diff) |
INTEGRATION: CWS fwkbeta03 (1.22.94); FILE MERGED
2005/01/25 12:30:58 as 1.22.94.2: #i22205# remove unused filter matcher
2005/01/25 12:21:43 as 1.22.94.1: #i22205# use new filter query to get sorted filter list
Diffstat (limited to 'sfx2/source/dialog')
-rw-r--r-- | sfx2/source/dialog/filtergrouping.cxx | 65 |
1 files changed, 56 insertions, 9 deletions
diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx index 4c3b4868a853..3f7c2718fad2 100644 --- a/sfx2/source/dialog/filtergrouping.cxx +++ b/sfx2/source/dialog/filtergrouping.cxx @@ -2,9 +2,9 @@ * * $RCSfile: filtergrouping.cxx,v $ * - * $Revision: 1.22 $ + * $Revision: 1.23 $ * - * last change: $Author: hr $ $Date: 2004-11-09 16:43:55 $ + * last change: $Author: rt $ $Date: 2005-01-28 17:23:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -93,6 +93,9 @@ #ifndef _COMPHELPER_PROCESSFACTORY_HXX_ #include <comphelper/processfactory.hxx> #endif +#ifndef _COMPHELPER_SEQUENCEASHASHMAP_HXX_ +#include <comphelper/sequenceashashmap.hxx> +#endif #ifndef _WLDCRD_HXX //autogen #include <tools/wldcrd.hxx> #endif @@ -645,7 +648,7 @@ namespace sfx2 }; //-------------------------------------------------------------------- - void lcl_GroupAndClassify( SfxFilterMatcherIter& _rFilterMatcher, GroupedFilterList& _rAllFilters ) + void lcl_GroupAndClassify( TSortedFilterList& _rFilterMatcher, GroupedFilterList& _rAllFilters ) { _rAllFilters.clear(); @@ -843,7 +846,7 @@ namespace sfx2 // ======================================================================= //-------------------------------------------------------------------- - sal_Bool lcl_hasAllFilesFilter( SfxFilterMatcherIter& _rFilterMatcher, String& /* [out] */ _rAllFilterName ) + sal_Bool lcl_hasAllFilesFilter( TSortedFilterList& _rFilterMatcher, String& /* [out] */ _rAllFilterName ) { ::rtl::OUString sUIName; sal_Bool bHasAll = sal_False; @@ -860,7 +863,7 @@ namespace sfx2 } //-------------------------------------------------------------------- - void lcl_EnsureAllFilesEntry( SfxFilterMatcherIter& _rFilterMatcher, GroupedFilterList& _rFilters ) + void lcl_EnsureAllFilesEntry( TSortedFilterList& _rFilterMatcher, GroupedFilterList& _rFilters ) { // String sAllFilterName; @@ -878,7 +881,7 @@ namespace sfx2 #ifdef DISABLE_GROUPING_AND_CLASSIFYING //-------------------------------------------------------------------- - void lcl_EnsureAllFilesEntry( SfxFilterMatcherIter& _rFilterMatcher, const Reference< XFilterManager >& _rxFilterManager, ::rtl::OUString& _rFirstNonEmpty ) + void lcl_EnsureAllFilesEntry( TSortedFilterList& _rFilterMatcher, const Reference< XFilterManager >& _rxFilterManager, ::rtl::OUString& _rFirstNonEmpty ) { // String sAllFilterName; @@ -971,7 +974,51 @@ namespace sfx2 }; //-------------------------------------------------------------------- - void appendFiltersForSave( SfxFilterMatcherIter& _rFilterMatcher, + TSortedFilterList::TSortedFilterList(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration >& xFilterList) + : m_nIterator(0) + { + if (!xFilterList.is()) + return; + + m_lFilters.clear(); + while(xFilterList->hasMoreElements()) + { + ::comphelper::SequenceAsHashMap lFilterProps (xFilterList->nextElement()); + ::rtl::OUString sFilterName = lFilterProps.getUnpackedValueOrDefault( + ::rtl::OUString::createFromAscii("Name"), + ::rtl::OUString()); + if (sFilterName.getLength()) + m_lFilters.push_back(sFilterName); + } + } + + //-------------------------------------------------------------------- + const SfxFilter* TSortedFilterList::First() + { + m_nIterator = 0; + return impl_getFilter(m_nIterator); + } + + //-------------------------------------------------------------------- + const SfxFilter* TSortedFilterList::Next() + { + ++m_nIterator; + return impl_getFilter(m_nIterator); + } + + //-------------------------------------------------------------------- + const SfxFilter* TSortedFilterList::impl_getFilter(sal_Int32 nIndex) + { + if (nIndex<0 || nIndex>=(sal_Int32)m_lFilters.size()) + return 0; + const ::rtl::OUString& sFilterName = m_lFilters[nIndex]; + if (!sFilterName.getLength()) + return 0; + return SfxFilter::GetFilterByName(String(sFilterName)); + } + + //-------------------------------------------------------------------- + void appendFiltersForSave( TSortedFilterList& _rFilterMatcher, const Reference< XFilterManager >& _rxFilterManager, ::rtl::OUString& _rFirstNonEmpty, FileDialogHelper_Impl& _rFileDlgImpl, const ::rtl::OUString& _rFactory ) @@ -1043,7 +1090,7 @@ namespace sfx2 }; //-------------------------------------------------------------------- - void appendExportFilters( SfxFilterMatcherIter& _rFilterMatcher, + void appendExportFilters( TSortedFilterList& _rFilterMatcher, const Reference< XFilterManager >& _rxFilterManager, ::rtl::OUString& _rFirstNonEmpty, FileDialogHelper_Impl& _rFileDlgImpl ) { @@ -1203,7 +1250,7 @@ namespace sfx2 } //-------------------------------------------------------------------- - void appendFiltersForOpen( SfxFilterMatcherIter& _rFilterMatcher, + void appendFiltersForOpen( TSortedFilterList& _rFilterMatcher, const Reference< XFilterManager >& _rxFilterManager, ::rtl::OUString& _rFirstNonEmpty, FileDialogHelper_Impl& _rFileDlgImpl ) { |