Kaydet (Commit) 4635a869 authored tarafından Julien Nabet's avatar Julien Nabet

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
üst 6ca355d2
...@@ -65,8 +65,6 @@ namespace vcl { class Window; } ...@@ -65,8 +65,6 @@ namespace vcl { class Window; }
#define FILEDIALOG_FILTER_ALL "*.*" #define FILEDIALOG_FILTER_ALL "*.*"
#define FILE_OPEN_SERVICE_NAME_OOO "com.sun.star.ui.dialogs.OfficeFilePicker"
namespace sfx2 { namespace sfx2 {
class FileDialogHelper_Impl; class FileDialogHelper_Impl;
......
...@@ -858,14 +858,20 @@ FileDialogHelper_Impl::FileDialogHelper_Impl( ...@@ -858,14 +858,20 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
,meContext ( FileDialogHelper::UNKNOWN_CONTEXT ) ,meContext ( FileDialogHelper::UNKNOWN_CONTEXT )
{ {
const char* pServiceName=0; const char* pServiceName=0;
if ( nDialog == SFX2_IMPL_DIALOG_SYSTEM ) switch (nDialog)
pServiceName = FILE_OPEN_SERVICE_NAME_OOO; {
else if ( nDialog == SFX2_IMPL_DIALOG_OOO ) case SFX2_IMPL_DIALOG_SYSTEM:
pServiceName = FILE_OPEN_SERVICE_NAME_OOO; case SFX2_IMPL_DIALOG_OOO:
else if ( nDialog == SFX2_IMPL_DIALOG_REMOTE ) pServiceName = "com.sun.star.ui.dialogs.OfficeFilePicker";
pServiceName = "com.sun.star.ui.dialogs.RemoteFilePicker"; break;
else case SFX2_IMPL_DIALOG_REMOTE:
pServiceName = "com.sun.star.ui.dialogs.FilePicker"; pServiceName = "com.sun.star.ui.dialogs.RemoteFilePicker";
break;
default:
pServiceName = "com.sun.star.ui.dialogs.FilePicker";
break;
}
OUString aService = OUString::createFromAscii( pServiceName ); OUString aService = OUString::createFromAscii( pServiceName );
uno::Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); uno::Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment