diff options
author | Muthu Subramanian K <sumuthu@novell.com> | 2010-11-10 13:41:59 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2010-11-10 13:52:53 +0100 |
commit | 25a3bf71f32d6263bc1c9dbbdf952a072704257e (patch) | |
tree | c205ef3b5511a8e1e1bc480628a634a618779051 /fpicker | |
parent | 202b47060159238b25447b1caa7ba99e78e1c569 (diff) |
i#112411: Fixed Gnome filepicker filter selection
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/unx/gnome/SalGtkFilePicker.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx index 8cbfb7a59b9d..28e081b9f62a 100644 --- a/fpicker/source/unx/gnome/SalGtkFilePicker.cxx +++ b/fpicker/source/unx/gnome/SalGtkFilePicker.cxx @@ -909,6 +909,9 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw { static const OUString aStarDot = OUString::createFromAscii( "*." ); + ::rtl::OUString aNewFilter; + ::rtl::OUString aOldFilter = getCurrentFilter(); + sal_Bool bChangeFilter = sal_True; for ( FilterList::iterator aListIter = m_pFilterList->begin(); aListIter != m_pFilterList->end(); ++aListIter @@ -916,11 +919,17 @@ uno::Sequence<rtl::OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() throw { if( aListIter->getFilter().indexOf( aStarDot+sExtension ) >= 0 ) { - setCurrentFilter( aListIter->getTitle() ); + if( !aNewFilter.getLength() ) + aNewFilter = aListIter->getTitle(); + + if( aOldFilter == aListIter->getTitle() ) + bChangeFilter = sal_False; + bExtensionTypedIn = true; - break; } } + if( bChangeFilter && bExtensionTypedIn ) + setCurrentFilter( aNewFilter ); } } |