diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-02-27 08:40:04 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2019-03-01 11:11:20 +0100 |
commit | 6360449f8b4a08de114f802f84a15d23103a5f41 (patch) | |
tree | ddb9a7d3c29d00ca28b5b76dd3ba00735b9dec72 | |
parent | 8ca0c4f23e69a2aae19a9f6899d5c88b0da10b55 (diff) |
tdf#123728 Always print on main thread to avoid deadlocks
Using lambda doesn't work on this branch, thus code differs from master commit.
Reviewed-on: https://gerrit.libreoffice.org/68421
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
(cherry picked from commit 110803068b75ffd895a9b1139aee2248d30f085b)
Change-Id: Ia8c2600aee42c3063e18032d1e485ad417ec4639
Reviewed-on: https://gerrit.libreoffice.org/68483
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 752bec0ebc07..72066d250740 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -87,6 +87,7 @@ #include <framework/titlehelper.hxx> #include <comphelper/numberedcollection.hxx> #include <unotools/ucbhelper.hxx> +#include <vcl/threadex.hxx> #include <sfx2/sfxbasecontroller.hxx> #include <sfx2/viewfac.hxx> @@ -1410,15 +1411,24 @@ void SAL_CALL SfxBaseModel::setPrinter(const Sequence< beans::PropertyValue >& r m_pData->m_xPrintable->setPrinter( rPrinter ); } +static bool ImplPrintStatic(const Reference<view::XPrintable>& m_xPrintable, + const Sequence<beans::PropertyValue>& rOptions) +{ + m_xPrintable->print(rOptions); + return true; +} + void SAL_CALL SfxBaseModel::print(const Sequence< beans::PropertyValue >& rOptions) { SfxModelGuard aGuard( *this ); if ( impl_getPrintHelper() ) - m_pData->m_xPrintable->print( rOptions ); + { + // tdf#123728 Always print on main thread to avoid deadlocks + vcl::solarthread::syncExecute(std::bind(&ImplPrintStatic, m_pData->m_xPrintable, rOptions)); + } } - // XStorable |