don't run generate preview idle if there are no fonts in the list
and reset preview idle when font list is cleared
Change-Id: Ice8c149754fbf64c9f81aa812465f0269de4c9d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93161
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index f5ad5df..fafc2cb 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -423,6 +423,8 @@ void FontNameBox::InitFontMRUEntriesFile()
void FontNameBox::ImplDestroyFontList()
{
mpFontList.reset();
mnPreviewProgress = 0;
maUpdateIdle.Stop();
}
void FontNameBox::Fill( const FontList* pList )
@@ -453,9 +455,9 @@ void FontNameBox::Fill( const FontList* pList )
m_xComboBox->thaw();
if (mbWYSIWYG)
if (mbWYSIWYG && nFontCount)
{
mnPreviewProgress = 0;
assert(mnPreviewProgress == 0 && "ImplDestroyFontList wasn't called");
maUpdateIdle.Start();
}