summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basctl/source/basicide/baside2.cxx2
-rw-r--r--basic/source/classes/sbxmod.cxx2
-rw-r--r--basic/source/runtime/methods1.cxx2
-rw-r--r--fpicker/source/win32/asyncrequests.cxx2
-rw-r--r--framework/source/loadenv/loadenv.cxx2
-rw-r--r--include/vcl/svapp.hxx4
-rw-r--r--sc/source/filter/oox/workbookfragment.cxx2
-rw-r--r--sfx2/source/doc/docfile.cxx2
-rw-r--r--sfx2/source/doc/printhelper.cxx4
-rw-r--r--svx/source/dialog/docrecovery.cxx2
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx2
-rw-r--r--vbahelper/source/vbahelper/vbahelper.cxx2
-rw-r--r--vcl/source/app/svapp.cxx5
-rw-r--r--vcl/source/control/prgsbar.cxx2
-rw-r--r--vcl/source/window/dialog.cxx2
-rw-r--r--vcl/source/window/menufloatingwindow.cxx2
-rw-r--r--vcl/source/window/syswin.cxx2
17 files changed, 25 insertions, 16 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx
index 41c0ff4413f3..a7bf5b2edeb8 100644
--- a/basctl/source/basicide/baside2.cxx
+++ b/basctl/source/basicide/baside2.cxx
@@ -679,7 +679,7 @@ BasicDebugFlags ModulWindow::BasicBreakHdl()
InvalidateDebuggerSlots();
- while( m_aStatus.bIsRunning )
+ while( m_aStatus.bIsRunning && !Application::IsQuit())
Application::Yield();
m_aStatus.bIsInReschedule = false;
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 5e9647e955a7..a9caaccc9758 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -1048,7 +1048,7 @@ namespace
if (m_bDelInst)
{
// Compare here with 1 instead of 0, because before nCallLvl--
- while (m_pSbData->pInst->nCallLvl != 1)
+ while (m_pSbData->pInst->nCallLvl != 1 && !Application::IsQuit())
Application::Yield();
}
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx
index c847df8d26e6..2f9b6ff7b655 100644
--- a/basic/source/runtime/methods1.cxx
+++ b/basic/source/runtime/methods1.cxx
@@ -581,7 +581,7 @@ void Wait_Impl( bool bDurationBased, SbxArray& rPar )
Timer aTimer;
aTimer.SetTimeout( nWait );
aTimer.Start();
- while ( aTimer.IsActive() )
+ while ( aTimer.IsActive() && !Application::IsQuit())
{
Application::Yield();
}
diff --git a/fpicker/source/win32/asyncrequests.cxx b/fpicker/source/win32/asyncrequests.cxx
index 86b71cf51540..bfecc42125a3 100644
--- a/fpicker/source/win32/asyncrequests.cxx
+++ b/fpicker/source/win32/asyncrequests.cxx
@@ -50,7 +50,7 @@ void Request::wait( ::sal_Int32 nMilliSeconds )
void Request::waitProcessMessages()
{
SolarMutexGuard aGuard;
- while ( !m_aJoiner.check() )
+ while ( !m_aJoiner.check() && !Application::IsQuit())
Application::Yield();
}
diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx
index 59687abbeefb..e41c6db1d142 100644
--- a/framework/source/loadenv/loadenv.cxx
+++ b/framework/source/loadenv/loadenv.cxx
@@ -413,7 +413,7 @@ bool LoadEnv::waitWhileLoading(sal_uInt32 nTimeout)
// in an intelligent manner :-)
sal_Int32 nTime = nTimeout;
- while(true)
+ while(!Application::IsQuit())
{
// SAFE -> ------------------------------
{
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index bfa92cf88321..1f4dff193024 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -455,6 +455,10 @@ public:
*/
static void Quit();
+ /** Has Quit() been called?
+ */
+ static bool IsQuit();
+
/** Attempt to process current pending event(s)
It doesn't sleep if no events are available for processing.
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index ac92e96d6e41..33605a09fc3f 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -328,7 +328,7 @@ void importSheetFragments( WorkbookFragment& rWorkbookHandler, SheetFragmentVect
}
// coverity[loop_top] - this isn't an infinite loop where nSheetsLeft gets decremented by the above threads
- while( nSheetsLeft > 0)
+ while( nSheetsLeft > 0 && !Application::IsQuit())
{
// This is a much more controlled re-enterancy hazard than
// allowing a yield deeper inside the filter code for progress
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 59865fb2b8eb..631c06bd0713 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -2731,7 +2731,7 @@ void SfxMedium::Download( const Link<void*,void>& aLink )
GetInStream();
if ( pImpl->m_pInStream && !aLink.IsSet() )
{
- while( !pImpl->bDownloadDone )
+ while( !pImpl->bDownloadDone && !Application::IsQuit())
Application::Yield();
}
}
diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx
index 09d1c506522c..729aab620f11 100644
--- a/sfx2/source/doc/printhelper.cxx
+++ b/sfx2/source/doc/printhelper.cxx
@@ -429,7 +429,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue >
//wait until printing is done
SfxPrinter* pDocPrinter = pViewSh->GetPrinter();
- while ( pDocPrinter->IsPrinting() )
+ while ( pDocPrinter->IsPrinting() && !Application::IsQuit())
Application::Yield();
}
@@ -485,7 +485,7 @@ class ImplUCBPrintWatcher : public ::osl::Thread
/* SAFE { */
{
SolarMutexGuard aGuard;
- while( m_pPrinter->IsPrinting() )
+ while( m_pPrinter->IsPrinting() && !Application::IsQuit())
Application::Yield();
m_pPrinter.clear(); // don't delete it! It's borrowed only :-)
}
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index f8f7c61fc2d1..7ba2d0c9dcfa 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -713,7 +713,7 @@ short RecoveryDialog::execute()
m_pCore->doRecovery();
m_bWaitForCore = true;
- while(m_bWaitForCore)
+ while(m_bWaitForCore && !Application::IsQuit())
Application::Yield();
m_pCore->setUpdateListener(nullptr);
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index fb6706b0ba82..d88ea837aa6b 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1612,7 +1612,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
"sw::SwDBManager aEmailDispatcherPollTimer" );
aEmailDispatcherPollTimer.SetTimeout( 500 );
aEmailDispatcherPollTimer.Start();
- while( IsMergeOk() && m_pImpl->m_xLastMessage.is() )
+ while( IsMergeOk() && m_pImpl->m_xLastMessage.is() && !Application::IsQuit())
Application::Yield();
aEmailDispatcherPollTimer.Stop();
}
diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx
index d47dbb01bdd6..73e7b0b5ac52 100644
--- a/vbahelper/source/vbahelper/vbahelper.cxx
+++ b/vbahelper/source/vbahelper/vbahelper.cxx
@@ -437,7 +437,7 @@ void PrintPreviewHelper( const css::uno::Any& /*EnableChanges*/, SfxViewShell co
void WaitUntilPreviewIsClosed( SfxViewFrame* pViewFrame )
{
- while ( pViewFrame && isInPrintPreview( pViewFrame ) )
+ while ( pViewFrame && isInPrintPreview( pViewFrame ) && !Application::IsQuit())
Application::Yield();
}
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 332075cccd93..2494bfcaf92e 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -577,6 +577,11 @@ bool Application::IsInExecute()
return ImplGetSVData()->maAppData.mbInAppExecute;
}
+bool Application::IsQuit()
+{
+ return ImplGetSVData()->maAppData.mbAppQuit;
+}
+
bool Application::IsInModalMode()
{
return (ImplGetSVData()->maAppData.mnModalMode != 0);
diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx
index e861d66bcb03..ef8d2867018a 100644
--- a/vcl/source/control/prgsbar.cxx
+++ b/vcl/source/control/prgsbar.cxx
@@ -182,7 +182,7 @@ void ProgressBar::SetValue( sal_uInt16 nNewPercent )
Idle aIdle("ProgressBar::SetValue aIdle");
aIdle.SetPriority(TaskPriority::POST_PAINT);
aIdle.Start();
- while (aIdle.IsActive())
+ while (aIdle.IsActive() && !Application::IsQuit())
{
Application::Yield();
}
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 92528597e476..21f875fd7fc2 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1041,7 +1041,7 @@ short Dialog::Execute()
// Yield util EndDialog is called or dialog gets destroyed
// (the latter should not happen, but better safe than sorry
- while ( !xWindow->IsDisposed() && mbInExecute )
+ while ( !xWindow->IsDisposed() && mbInExecute && !Application::IsQuit() )
Application::Yield();
ImplEndExecuteModal();
diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx
index cfcb58b8f63e..dd1e2c6ea557 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -455,7 +455,7 @@ void MenuFloatingWindow::Execute()
Start();
- while (bInExecute)
+ while (bInExecute && !Application::IsQuit())
Application::Yield();
pSVData->maAppData.mpActivePopupMenu = nullptr;
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index 04139f454881..2d5ce380dca0 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -1197,7 +1197,7 @@ void SystemWindow::ensureRepaint()
Invalidate();
mbPaintComplete = false;
- while (!mbPaintComplete)
+ while (!mbPaintComplete && !Application::IsQuit())
{
Application::Yield();
}