From 25a3bf71f32d6263bc1c9dbbdf952a072704257e Mon Sep 17 00:00:00 2001 From: Muthu Subramanian K Date: Wed, 10 Nov 2010 13:41:59 +0100 Subject: i#112411: Fixed Gnome filepicker filter selection --- fpicker/source/unx/gnome/SalGtkFilePicker.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'fpicker') 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 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 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 ); } } -- cgit