diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2019-02-27 08:40:04 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2019-02-28 13:01:03 +0100 |
commit | 559fa3d0d49ae53991626923d59f9c7f22858c58 (patch) | |
tree | 5deea623b979d88172367691a4e4caeff3b6259e /sfx2 | |
parent | 1cc66501179f2a396e221d6803f2e1f8019ada5c (diff) |
tdf#123728 Always print on main thread to avoid deadlocks
Change-Id: Ia8c2600aee42c3063e18032d1e485ad417ec4639
Reviewed-on: https://gerrit.libreoffice.org/68421
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
(cherry picked from commit 110803068b75ffd895a9b1139aee2248d30f085b)
Reviewed-on: https://gerrit.libreoffice.org/68461
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 72a4b7b00aed..27ba812a2449 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -91,6 +91,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> @@ -1411,14 +1412,22 @@ 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 ); 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 |