diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-04-07 13:24:11 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-04-07 16:54:45 +0200 |
commit | 9e786320a7d2609a9f997b32e31347f2eab0489e (patch) | |
tree | 5cce4899cb316735be546da843b29fb1fe6c6b33 /sfx2 | |
parent | 105a9390e02856887ff5cfb6dbf6fe008738ffe1 (diff) |
move using the vcl file dialog in headless mode to the point of creation
instead of setting and unsetting the config option at start and exit
because a document that crashes in headless mode leaves my config
in an unwanted built-in file dialog state.
Change-Id: Ib5fcc5994a08c78bffdf57cb5b252dc469167ba2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150126
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/shutdownicon.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index ae214842f61f..fca7e56b3f3f 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -138,11 +138,15 @@ void ShutdownIcon::deInitSystray() m_bInitialized = false; } +static bool UseSystemFileDialog() +{ + return !Application::IsHeadlessModeEnabled() && officecfg::Office::Common::Misc::UseSystemFileDialog::get(); +} ShutdownIcon::ShutdownIcon( css::uno::Reference< XComponentContext > xContext ) : m_bVeto ( false ), m_bListenForTermination ( false ), - m_bSystemDialogs(officecfg::Office::Common::Misc::UseSystemFileDialog::get()), + m_bSystemDialogs(UseSystemFileDialog()), m_xContext(std::move( xContext )), m_bInitialized( false ) { @@ -241,7 +245,7 @@ void ShutdownIcon::StartFileDialog() { ::SolarMutexGuard aGuard; - bool bDirty = ( m_bSystemDialogs != officecfg::Office::Common::Misc::UseSystemFileDialog::get() ); + bool bDirty = m_bSystemDialogs != UseSystemFileDialog(); if ( m_pFileDlg && bDirty ) { @@ -382,7 +386,7 @@ IMPL_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, /*unused*/, vo // 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 ( officecfg::Office::Common::Misc::UseSystemFileDialog::get() ) + if (UseSystemFileDialog()) { m_pFileDlg.reset(); } |