summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@collabora.co.uk>2023-11-13 13:13:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-11-13 14:02:59 +0100
commit07dfeffae8cba808dbad85dfed9b6a693a1f9543 (patch)
treec3b403f4f36377fc24544533b7b1b09e3ecd07af /vcl/win
parent9bb9ba6ae02692e65498bae4598e3b63bb65c02e (diff)
tdf#127547 Freeze in Microsoft Print to PDF dialog
Change-Id: I7a6ef85fae637c8359a96df1bd31d7e8f0b36512 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159369 Tested-by: Hossein <hossein@libreoffice.org> Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/gdi/salprn.cxx12
1 files changed, 11 insertions, 1 deletions
diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx
index 0631bcd37c3f..3302efa2d986 100644
--- a/vcl/win/gdi/salprn.cxx
+++ b/vcl/win/gdi/salprn.cxx
@@ -1375,7 +1375,7 @@ void WinSalPrinter::markInvalid()
// need wrappers for StarTocW/A to use structured exception handling
// since SEH does not mix with standard exception handling's cleanup
-static int lcl_StartDocW( HDC hDC, DOCINFOW const * pInfo, WinSalPrinter* pPrt )
+static int lcl_StartDocW1( HDC hDC, DOCINFOW const * pInfo, WinSalPrinter* pPrt )
{
int nRet = 0;
CATCH_DRIVER_EX_BEGIN;
@@ -1384,6 +1384,16 @@ static int lcl_StartDocW( HDC hDC, DOCINFOW const * pInfo, WinSalPrinter* pPrt )
return nRet;
}
+static int lcl_StartDocW( HDC hDC, DOCINFOW const * pInfo, WinSalPrinter* pPrt )
+{
+ //tdf#127547 - Freeze/crash in Microsoft Print to PDF dialog, if we try to paste while
+ // executing the StartDocW method, Windows will call back into us on a separate thread,
+ // where we will attempt to take the SolarMutex.
+ SolarMutexReleaser aReleaser;
+
+ return lcl_StartDocW1(hDC, pInfo, pPrt);
+}
+
bool WinSalPrinter::StartJob( const OUString* pFileName,
const OUString& rJobName,
const OUString&,