[Libreoffice-commits] core.git: Branch 'distro/lhm/libreoffice-5-2+backports' - include/svtools svtools/source

Katarina Behrens (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 4 12:34:40 UTC 2019


 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 <Katarina.Behrens at cib.de>
AuthorDate: Thu Apr 4 12:27:23 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
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 <Thorsten.Behrens at CIB.de>
    Tested-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

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 )


More information about the Libreoffice-commits mailing list