sfx2/source/doc/sfxbasemodel.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
New commits: commit e58c8aa75313a183fc31a5fa55c09d93fbefc8b0 Author: Samuel Mehrbrodt <samuel.mehrbr...@cib.de> AuthorDate: Wed Feb 27 08:40:04 2019 +0100 Commit: Thorsten Behrens <thorsten.behr...@cib.de> CommitDate: Mon Mar 4 12:38:04 2019 +0100 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.mehrbr...@cib.de> (cherry picked from commit 110803068b75ffd895a9b1139aee2248d30f085b) Change-Id: Ia8c2600aee42c3063e18032d1e485ad417ec4639 Reviewed-on: https://gerrit.libreoffice.org/68474 Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de> Tested-by: Thorsten Behrens <thorsten.behr...@cib.de> diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 0de1a2ca4f92..b7f15838804b 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -84,6 +84,7 @@ #include <comphelper/numberedcollection.hxx> #include <unotools/ucbstreamhelper.hxx> #include <unotools/ucbhelper.hxx> +#include <vcl/threadex.hxx> #include <sfx2/sfxbasecontroller.hxx> #include <sfx2/viewfac.hxx> @@ -1426,13 +1427,23 @@ 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) throw (lang::IllegalArgumentException, RuntimeException, std::exception) { 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)); + } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits