diff --git a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx index 3f51aa9c765d..c44e4bd65b35 100644 --- a/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx +++ b/fpicker/source/win32/filepicker/VistaFilePickerEventHandler.cxx @@ -125,14 +125,14 @@ STDMETHODIMP VistaFilePickerEventHandler::OnFileOk(IFileDialog* /*pDialog*/) } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnFolderChanging(IFileDialog* pDialog, - IShellItem* pFolder) +STDMETHODIMP VistaFilePickerEventHandler::OnFolderChanging(IFileDialog* /*pDialog*/, + IShellItem* /*pFolder*/) { return E_NOTIMPL; } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnFolderChange(IFileDialog* pDialog) +STDMETHODIMP VistaFilePickerEventHandler::OnFolderChange(IFileDialog* /*pDialog*/) { impl_sendEvent(E_DIRECTORY_CHANGED, 0); return S_OK; @@ -250,7 +250,7 @@ void lcl_updateVersionListDirectly(IFileDialog* pDialog) } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnSelectionChange(IFileDialog* pDialog) +STDMETHODIMP VistaFilePickerEventHandler::OnSelectionChange(IFileDialog* /*pDialog*/) { impl_sendEvent(E_FILE_SELECTION_CHANGED, 0); //lcl_updateVersionListDirectly(pDialog); @@ -258,16 +258,16 @@ STDMETHODIMP VistaFilePickerEventHandler::OnSelectionChange(IFileDialog* pDialog } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnShareViolation(IFileDialog* pDialog , - IShellItem* pItem , - FDE_SHAREVIOLATION_RESPONSE* pResponse) +STDMETHODIMP VistaFilePickerEventHandler::OnShareViolation(IFileDialog* /*pDialog*/ , + IShellItem* /*pItem*/ , + FDE_SHAREVIOLATION_RESPONSE* /*pResponse*/) { impl_sendEvent(E_CONTROL_STATE_CHANGED, css::ui::dialogs::CommonFilePickerElementIds::LISTBOX_FILTER); return S_OK; } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnTypeChange(IFileDialog* pDialog) +STDMETHODIMP VistaFilePickerEventHandler::OnTypeChange(IFileDialog* /*pDialog*/) { /* IFileDialogCustomize *iCustomize; @@ -299,32 +299,32 @@ STDMETHODIMP VistaFilePickerEventHandler::OnTypeChange(IFileDialog* pDialog) } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnOverwrite(IFileDialog* pDialog , - IShellItem* pItem , - FDE_OVERWRITE_RESPONSE* pResponse) +STDMETHODIMP VistaFilePickerEventHandler::OnOverwrite(IFileDialog* /*pDialog*/ , + IShellItem* /*pItem*/ , + FDE_OVERWRITE_RESPONSE* /*pResponse*/) { return E_NOTIMPL; } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnItemSelected(IFileDialogCustomize* pCustomize, +STDMETHODIMP VistaFilePickerEventHandler::OnItemSelected(IFileDialogCustomize* /*pCustomize*/, DWORD nIDCtl , - DWORD nIDItem ) + DWORD /*nIDItem*/ ) { - impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl); + impl_sendEvent(E_CONTROL_STATE_CHANGED, static_cast( nIDCtl )); return S_OK; } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnButtonClicked(IFileDialogCustomize* pCustomize, +STDMETHODIMP VistaFilePickerEventHandler::OnButtonClicked(IFileDialogCustomize* /*pCustomize*/, DWORD nIDCtl ) { - impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl); + impl_sendEvent(E_CONTROL_STATE_CHANGED, static_cast( nIDCtl)); return S_OK; } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnCheckButtonToggled(IFileDialogCustomize* pCustomize, +STDMETHODIMP VistaFilePickerEventHandler::OnCheckButtonToggled(IFileDialogCustomize* /*pCustomize*/, DWORD nIDCtl , BOOL bChecked ) { @@ -353,15 +353,15 @@ STDMETHODIMP VistaFilePickerEventHandler::OnCheckButtonToggled(IFileDialogCustom if (nIDCtl == css::ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_AUTOEXTENSION) m_pInternalNotify->onAutoExtensionChanged(bChecked); - impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl); + impl_sendEvent(E_CONTROL_STATE_CHANGED, static_cast( nIDCtl)); return S_OK; } //----------------------------------------------------------------------------------------- -STDMETHODIMP VistaFilePickerEventHandler::OnControlActivating(IFileDialogCustomize* pCustomize, +STDMETHODIMP VistaFilePickerEventHandler::OnControlActivating(IFileDialogCustomize* /*pCustomize*/, DWORD nIDCtl ) { - impl_sendEvent(E_CONTROL_STATE_CHANGED, nIDCtl); + impl_sendEvent(E_CONTROL_STATE_CHANGED, static_cast( nIDCtl)); return S_OK; } diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index 1d85552e47ae..3fce25e7e0d6 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -33,6 +33,7 @@ #include #include #include +#include // #include #include #include @@ -235,6 +236,7 @@ ShutdownIcon::ShutdownIcon( Reference< XMultiServiceFactory > aSMgr ) : ShutdownIconServiceBase( m_aMutex ), m_bVeto ( false ), m_bListenForTermination ( false ), + m_bSystemDialogs( false ), m_pResMgr( NULL ), m_pFileDlg( NULL ), m_xServiceManager( aSMgr ), @@ -243,6 +245,7 @@ ShutdownIcon::ShutdownIcon( Reference< XMultiServiceFactory > aSMgr ) : m_pPlugin( 0 ), m_bInitialized( false ) { + m_bSystemDialogs = SvtMiscOptions().UseSystemFileDialog(); } ShutdownIcon::~ShutdownIcon() @@ -376,6 +379,16 @@ void ShutdownIcon::StartFileDialog() { ::vos::OGuard aGuard( Application::GetSolarMutex() ); + bool bDirty = ( m_bSystemDialogs != static_cast(SvtMiscOptions().UseSystemFileDialog()) ); + + if ( m_pFileDlg && bDirty ) + { + // Destroy instance as changing the system file dialog setting + // forces us to create a new FileDialogHelper instance! + delete m_pFileDlg; + m_pFileDlg = NULL; + } + if ( !m_pFileDlg ) m_pFileDlg = new FileDialogHelper( WB_OPEN | SFXWB_MULTISELECTION, String() ); m_pFileDlg->StartExecuteModal( STATIC_LINK( this, ShutdownIcon, DialogClosedHdl_Impl ) ); @@ -512,8 +525,14 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR #ifdef WNT // #103346 Destroy dialog to prevent problems with custom controls - delete pThis->m_pFileDlg; - pThis->m_pFileDlg = NULL; + // This fix is dependent on the dialog settings. Destroying the dialog here will + // crash the non-native dialog implementation! Therefore make this dependent on + // the settings. + if ( SvtMiscOptions().UseSystemFileDialog() ) + { + delete pThis->m_pFileDlg; + pThis->m_pFileDlg = NULL; + } #endif LeaveModalMode(); diff --git a/sfx2/source/appl/shutdownicon.hxx b/sfx2/source/appl/shutdownicon.hxx index 4e7cc6ecc247..d702f2a50977 100644 --- a/sfx2/source/appl/shutdownicon.hxx +++ b/sfx2/source/appl/shutdownicon.hxx @@ -52,6 +52,7 @@ class SFX2_DLLPUBLIC ShutdownIcon : public ShutdownIconServiceBase ::osl::Mutex m_aMutex; bool m_bVeto; bool m_bListenForTermination; + bool m_bSystemDialogs; ResMgr* m_pResMgr; sfx2::FileDialogHelper* m_pFileDlg; ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceManager;