Kaydet (Commit) 79cb9ef5 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

tdf#118690 don't try to process all messages

Regression from commit 221b0ab1 ("WIN use Reschedule instead
of own dispatch loops"). This limit the maximum reschedule loops
as the original code did. There is still a busy loop when opening
the print dialog, as it was before the patch, but this at least
gets printing started.

Change-Id: If867329b82b13c898bb15b08584244084488a66c
Reviewed-on: https://gerrit.libreoffice.org/60310
Tested-by: Jenkins
Reviewed-by: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
üst 95e023e8
...@@ -1287,6 +1287,7 @@ static BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ ) ...@@ -1287,6 +1287,7 @@ static BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
{ {
SalData* pSalData = GetSalData(); SalData* pSalData = GetSalData();
WinSalPrinter* pPrinter; WinSalPrinter* pPrinter;
int i = 0;
bool bWhile = true; bool bWhile = true;
// Ensure we handle the mutex which will be released in WinSalInstance::DoYield // Ensure we handle the mutex which will be released in WinSalInstance::DoYield
...@@ -1295,6 +1296,10 @@ static BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ ) ...@@ -1295,6 +1296,10 @@ static BOOL CALLBACK SalPrintAbortProc( HDC hPrnDC, int /* nError */ )
{ {
// process messages // process messages
bWhile = Application::Reschedule( true ); bWhile = Application::Reschedule( true );
if (i > 15)
bWhile = false;
else
++i;
pPrinter = pSalData->mpFirstPrinter; pPrinter = pSalData->mpFirstPrinter;
while ( pPrinter ) while ( pPrinter )
...@@ -1457,7 +1462,7 @@ bool WinSalPrinter::StartJob( const OUString* pFileName, ...@@ -1457,7 +1462,7 @@ bool WinSalPrinter::StartJob( const OUString* pFileName,
// As the Telecom Balloon Fax driver tends to send messages repeatedly // As the Telecom Balloon Fax driver tends to send messages repeatedly
// we try to process first all, and then insert a dummy message // we try to process first all, and then insert a dummy message
while ( Application::Reschedule( true ) ); for (int i = 0; Application::Reschedule( true ) && i <= 15; ++i);
BOOL const ret = PostMessageW(GetSalData()->mpInstance->mhComWnd, SAL_MSG_DUMMY, 0, 0); BOOL const ret = PostMessageW(GetSalData()->mpInstance->mhComWnd, SAL_MSG_DUMMY, 0, 0);
SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment