From 8c0791e3590bc96dc3d8f826908cdb439a9abca5 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 17 Apr 2021 10:22:48 +0530 Subject: [PATCH] Fix #1924187 [Edit metadata: Text alignment on lists in WYSIWYG editor](https://bugs.launchpad.net/calibre/+bug/1924187) --- src/calibre/gui2/comments_editor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calibre/gui2/comments_editor.py b/src/calibre/gui2/comments_editor.py index 3c4e70ce16..cc4343969a 100644 --- a/src/calibre/gui2/comments_editor.py +++ b/src/calibre/gui2/comments_editor.py @@ -458,9 +458,9 @@ class EditorWidget(QTextEdit, LineEditECM): # {{{ def do_alignment(self, which): with self.editing_cursor() as c: c = self.textCursor() - fmt = c.blockFormat() + fmt = QTextBlockFormat() fmt.setAlignment(which) - c.setBlockFormat(fmt) + c.mergeBlockFormat(fmt) def do_align_left(self): self.do_alignment(Qt.AlignmentFlag.AlignLeft)