From 5a9de2b77360d285169fa4b3187b061ccb6b59b1 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Mon, 28 Mar 2022 01:03:17 -0700 Subject: [PATCH] viewertexteditor: empty check for styles list --- app/widget/viewer/viewertexteditor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/widget/viewer/viewertexteditor.cpp b/app/widget/viewer/viewertexteditor.cpp index ec630513f..74fd53116 100644 --- a/app/widget/viewer/viewertexteditor.cpp +++ b/app/widget/viewer/viewertexteditor.cpp @@ -144,7 +144,7 @@ void ViewerTextEditor::UpdateToolBar(ViewerTextEditorToolBar *toolbar, const QTe QString style = f.fontStyleName().toString(); QStringList styles = fd.styles(family); - if (style.isEmpty() || !styles.contains(style)) { + if (!styles.isEmpty() && (style.isEmpty() || !styles.contains(style))) { // There seems to be no better way to find the "regular" style outside of this heuristic. // Feel free to add more if a font isn't working right. style = QStringLiteral("Regular");