summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx14
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