From 656a18c236d9d60d31fe74a05710f3fff5e05c99 Mon Sep 17 00:00:00 2001
From: Patrick Luby <plubius@libreoffice.org>
Date: Sun, 24 Dec 2023 16:43:54 -0500
Subject: Eliminate warning when changing timer's priority

Task::SetPriority() expects the timer to be stopped while
changing the timer's priority.

Change-Id: Ib025cc1451bf6fa959284d202d29dbb1489beb0d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161272
Tested-by: Jenkins
Reviewed-by: Patrick Luby <plubius@libreoffice.org>
(cherry picked from commit c6a7432b6240f2de7af3b8321c427a4da8b5cab3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161227
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
---
 vcl/source/control/InterimItemWindow.cxx | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/vcl/source/control/InterimItemWindow.cxx b/vcl/source/control/InterimItemWindow.cxx
index 697f78759933..0769245eb477 100644
--- a/vcl/source/control/InterimItemWindow.cxx
+++ b/vcl/source/control/InterimItemWindow.cxx
@@ -189,7 +189,15 @@ void InterimItemWindow::Draw(OutputDevice* pDevice, const Point& rPos,
 
 void InterimItemWindow::SetPriority(TaskPriority nPriority)
 {
+    // Eliminate warning when changing timer's priority
+    // Task::SetPriority() expects the timer to be stopped while
+    // changing the timer's priority.
+    bool bActive = m_aLayoutIdle.IsActive();
+    if (bActive)
+        m_aLayoutIdle.Stop();
     m_aLayoutIdle.SetPriority(nPriority);
+    if (bActive)
+        m_aLayoutIdle.Start();
 }
 
 void InterimItemWindow::ImplPaintToDevice(::OutputDevice* pTargetOutDev, const Point& rPos)
-- 
cgit