diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2015-10-06 21:47:23 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2015-10-06 21:49:12 +0200 |
commit | 4635a86971b6183e4161e35d903da5e86706f382 (patch) | |
tree | 56b8adc5f17cb263a00950930fca177160e311c0 /sfx2/source/dialog/filedlghelper.cxx | |
parent | 6ca355d281133c1e0e54df4e4710a4e99bc38c17 (diff) |
Simplify a bit
1) change if/else if/... into switch for readability
2) no need to use a #define for something which appears once
Change-Id: Ia27d1bd07e4ed0761daa90df0f209c3a4c6cb8f0
Diffstat (limited to 'sfx2/source/dialog/filedlghelper.cxx')
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index fdca859cd80c..1cc0a08d4901 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -858,14 +858,20 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( ,meContext ( FileDialogHelper::UNKNOWN_CONTEXT ) { const char* pServiceName=0; - if ( nDialog == SFX2_IMPL_DIALOG_SYSTEM ) - pServiceName = FILE_OPEN_SERVICE_NAME_OOO; - else if ( nDialog == SFX2_IMPL_DIALOG_OOO ) - pServiceName = FILE_OPEN_SERVICE_NAME_OOO; - else if ( nDialog == SFX2_IMPL_DIALOG_REMOTE ) - pServiceName = "com.sun.star.ui.dialogs.RemoteFilePicker"; - else - pServiceName = "com.sun.star.ui.dialogs.FilePicker"; + switch (nDialog) + { + case SFX2_IMPL_DIALOG_SYSTEM: + case SFX2_IMPL_DIALOG_OOO: + pServiceName = "com.sun.star.ui.dialogs.OfficeFilePicker"; + break; + case SFX2_IMPL_DIALOG_REMOTE: + pServiceName = "com.sun.star.ui.dialogs.RemoteFilePicker"; + break; + default: + pServiceName = "com.sun.star.ui.dialogs.FilePicker"; + break; + } + OUString aService = OUString::createFromAscii( pServiceName ); uno::Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); |