[office/calligra] libs/text: KoTextEditor: Preserve FontFamily property

Carl Schwan <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit e6653e815106b8ed4226a10893269c97bda3dd6c by Carl Schwan, on behalf of Lokesh Sarkar.
Committed on 02/08/2026 at 16:38.
Pushed by carlschwan into branch 'master'.

KoTextEditor: Preserve FontFamily property

Qt no longer keeps the legacy FontFamily property synchronized
automatically. Preserve it explicitly so font information is written
correctly when saving documents.

M  +1    -0    libs/text/KoTextEditor_format.cpp

https://invent.kde.org/office/calligra/-/commit/e6653e815106b8ed4226a10893269c97bda3dd6c

diff --git a/libs/text/KoTextEditor_format.cpp b/libs/text/KoTextEditor_format.cpp
index 8064dd48348..3dd16a821be 100644
--- a/libs/text/KoTextEditor_format.cpp
+++ b/libs/text/KoTextEditor_format.cpp
@@ -297,6 +297,7 @@ void KoTextEditor::setFontFamily(const QString &font)
     d->updateState(KoTextEditor::Private::Format, kundo2_i18n("Set Font"));
     QTextCharFormat format;
     format.setFontFamily(font);
+    format.setProperty(QTextFormat::FontFamily, font);
     mergeAutoStyle(format);
     d->updateState(KoTextEditor::Private::NoOp);
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.