diff options
author | Michael Meeks <michael.meeks@suse.com> | 2011-11-04 21:04:18 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2011-11-07 14:19:34 +0000 |
commit | f1abe3035cc237609dc4d20f3dd9c6e2484ef7a8 (patch) | |
tree | d30103ffb6561bc5071ca625634de718a400d000 /cui | |
parent | 17084c750df84e0da377d716a4088f72bd25f972 (diff) |
gtk: cleanup to make the vcl file-picker interface work.
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optgdlg.cxx | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index e08dcc797afb..72355b768ea0 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -124,20 +124,11 @@ int OfaMiscTabPage::DeactivatePage( SfxItemSet* pSet_ ) namespace { - ::rtl::OUString impl_SystemFileOpenServiceName() + static ::rtl::OUString impl_SystemFileOpenServiceName() { - const ::rtl::OUString &rDesktopEnvironment = - Application::GetDesktopEnvironment(); + const ::rtl::OUString &rDesktopEnvironment = Application::GetDesktopEnvironment(); - if ( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "gnome" ) ) - { - #ifdef ENABLE_GTK - return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.GtkFilePicker") ); - #else - return rtl::OUString(); - #endif - } - else if ( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde4" ) ) + if ( rDesktopEnvironment.equalsIgnoreAsciiCaseAscii( "kde4" ) ) { #ifdef ENABLE_KDE4 return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ui.dialogs.KDE4FilePicker") ); @@ -162,10 +153,14 @@ namespace #endif } - sal_Bool lcl_HasSystemFilePicker() + static bool lcl_HasSystemFilePicker() { + if( Application::hasNativeFileSelection() ) + return true; + + // Otherwise fall-back on querying services + bool bRet = false; Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); - sal_Bool bRet = sal_False; Reference< XContentEnumerationAccess > xEnumAccess( xFactory, UNO_QUERY ); Reference< XSet > xSet( xFactory, UNO_QUERY ); @@ -178,7 +173,7 @@ namespace ::rtl::OUString aFileService = impl_SystemFileOpenServiceName(); Reference< XEnumeration > xEnum = xEnumAccess->createContentEnumeration( aFileService ); if ( xEnum.is() && xEnum->hasMoreElements() ) - bRet = sal_True; + bRet = true; } catch (const IllegalArgumentException&) { |