include/svtools/prnsetup.hxx | 1 + svtools/source/dialogs/prnsetup.cxx | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-)
New commits: commit eaaf6f4f925bf04833a464176d376efe92cdcd69 Author: Katarina Behrens <[email protected]> AuthorDate: Thu Apr 4 12:27:23 2019 +0200 Commit: Thorsten Behrens <[email protected]> CommitDate: Thu Apr 4 14:34:13 2019 +0200 Redirect printer setup into the main thread and avoid deadlock when called from extension in a non-main thread Change-Id: I9fc0c02f580655015d583219b886c6b24af59c18 Reviewed-on: https://gerrit.libreoffice.org/70256 Reviewed-by: Thorsten Behrens <[email protected]> Tested-by: Thorsten Behrens <[email protected]> diff --git a/include/svtools/prnsetup.hxx b/include/svtools/prnsetup.hxx index 007294e52656..267274d8d61a 100644 --- a/include/svtools/prnsetup.hxx +++ b/include/svtools/prnsetup.hxx @@ -47,6 +47,7 @@ private: AutoTimer maStatusTimer; VclPtr<Printer> mpPrinter; VclPtr<Printer> mpTempPrinter; + short solar_execute(); SVT_DLLPRIVATE void ImplSetInfo(); diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx index cf8a3f5c5eb9..e7362e7bc44c 100644 --- a/svtools/source/dialogs/prnsetup.cxx +++ b/svtools/source/dialogs/prnsetup.cxx @@ -21,6 +21,7 @@ #include <svtools/svtools.hrc> #include <svtools/svtresid.hxx> #include <vcl/print.hxx> +#include <vcl/threadex.hxx> void ImplFillPrnDlgListBox( const Printer* pPrinter, @@ -331,6 +332,10 @@ void PrinterSetupDialog::DataChanged( const DataChangedEvent& rDCEvt ) ModalDialog::DataChanged( rDCEvt ); } +short PrinterSetupDialog::solar_execute() +{ + return ModalDialog::Execute(); +} short PrinterSetupDialog::Execute() { @@ -347,7 +352,7 @@ short PrinterSetupDialog::Execute() maStatusTimer.Start(); // start dialog - short nRet = ModalDialog::Execute(); + short nRet = vcl::solarthread::syncExecute(std::bind(&PrinterSetupDialog::solar_execute, this)); // update data if the dialog was terminated with OK if ( nRet == RET_OK ) _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
