diff --git a/src/html/helpwnd.cpp b/src/html/helpwnd.cpp
index ef91722efd..131375b07c 100644
--- a/src/html/helpwnd.cpp
+++ b/src/html/helpwnd.cpp
@@ -55,6 +55,7 @@
#include "wx/fontenum.h"
#include "wx/artprov.h"
#include "wx/spinctrl.h"
+#include "wx/wupdlock.h"
// what is considered "small index"?
#define INDEX_IS_SMALL 1000
@@ -1340,18 +1341,26 @@ void wxHtmlHelpWindow::OptionsDialog()
m_FixedFace = fnt.GetFaceName();
}
- for (i = 0; i < m_NormalFonts->GetCount(); i++)
- dlg.NormalFont->Append((*m_NormalFonts)[i]);
- for (i = 0; i < m_FixedFonts->GetCount(); i++)
- dlg.FixedFont->Append((*m_FixedFonts)[i]);
- if (!m_NormalFace.empty())
- dlg.NormalFont->SetStringSelection(m_NormalFace);
- else
- dlg.NormalFont->SetSelection(0);
- if (!m_FixedFace.empty())
- dlg.FixedFont->SetStringSelection(m_FixedFace);
- else
- dlg.FixedFont->SetSelection(0);
+ // Lock updates to the choice controls before inserting potentially many
+ // items into them until the end of this block.
+ {
+ wxWindowUpdateLocker lockNormalFont(dlg.NormalFont);
+ wxWindowUpdateLocker lockFixedFont(dlg.FixedFont);
+
+ for (i = 0; i < m_NormalFonts->GetCount(); i++)
+ dlg.NormalFont->Append((*m_NormalFonts)[i]);
+ for (i = 0; i < m_FixedFonts->GetCount(); i++)
+ dlg.FixedFont->Append((*m_FixedFonts)[i]);
+ if (!m_NormalFace.empty())
+ dlg.NormalFont->SetStringSelection(m_NormalFace);
+ else
+ dlg.NormalFont->SetSelection(0);
+ if (!m_FixedFace.empty())
+ dlg.FixedFont->SetStringSelection(m_FixedFace);
+ else
+ dlg.FixedFont->SetSelection(0);
+ }
+
dlg.FontSize->SetValue(m_FontSize);
dlg.UpdateTestWin();