[LyX/master] Another special font UI fix

Juergen Spitzmueller via lyx-cvs <[email protected]> Mon, 20 Jul 2026 08:54:03 +0000
Newsgroups gmane.editors.lyx.cvs
Message-ID <[email protected]>
commit f7e54c0bb21db95c19a869440023bf6218a9b53b
Author: Juergen Spitzmueller <[email protected]>
Date:   Mon Jul 20 10:53:26 2026 +0200

    Another special font UI fix
    
    This is only a workaround, I fail to find the real problem.
---
 src/frontends/qt/GuiDocument.cpp | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/frontends/qt/GuiDocument.cpp b/src/frontends/qt/GuiDocument.cpp
index e70f9b319c..ae14c02a18 100644
--- a/src/frontends/qt/GuiDocument.cpp
+++ b/src/frontends/qt/GuiDocument.cpp
@@ -3096,6 +3096,28 @@ void GuiDocument::addSpecialFont()
 	}
 	fontSpecialModule->langFontsTW->addTopLevelItems(specialLangFontItems);
 	fontSpecialModule->scriptFontsTW->addTopLevelItems(specialScriptFontItems);
+
+	// Post cleanup; for some reason, empty rows might end up in
+	// the widget.
+	// FIXME: find cause.
+	QTreeWidgetItemIterator twi(fontSpecialModule->langFontsTW);
+	while (*twi) {
+		if ((*twi)->text(0).isEmpty()) {
+			QTreeWidgetItem *item = *twi;
+			fontSpecialModule->langFontsTW->takeTopLevelItem(
+						fontSpecialModule->langFontsTW->indexOfTopLevelItem(item));
+		}
+		++twi;
+	}
+	twi = QTreeWidgetItemIterator(fontSpecialModule->scriptFontsTW);
+	while (*twi) {
+		if ((*twi)->text(0).isEmpty()) {
+			QTreeWidgetItem *item = *twi;
+			fontSpecialModule->scriptFontsTW->takeTopLevelItem(
+						fontSpecialModule->scriptFontsTW->indexOfTopLevelItem(item));
+		}
+		++twi;
+	}
 	change_adaptor();
 }
 
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs