From 1bb9d7d370c2bb63e1f073a10c2e6e7efe2342ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 20 Jun 2012 10:54:07 +0200 Subject: [PATCH] Don't fail on unknow font family issue2617 review399004 (transplanted from 03432c9a3c3db53087a8e83c5ca0da58069ab62a) --- tryton/gui/window/view_form/view/form_gtk/richtextbox.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tryton/gui/window/view_form/view/form_gtk/richtextbox.py b/tryton/gui/window/view_form/view/form_gtk/richtextbox.py index 85c68d5e47..8325f6a5dd 100644 --- a/tryton/gui/window/view_form/view/form_gtk/richtextbox.py +++ b/tryton/gui/window/view_form/view/form_gtk/richtextbox.py @@ -145,8 +145,10 @@ class RichTextBox(TextBox): } self.tools['size'].child.set_active(self.sizes.index( self.current_font_prop['size'])) - self.tools['font_family'].child.set_active(self.families.index( - self.current_font_prop['font_family'])) + font_family = self.current_font_prop['font_family'] + if font_family in self.families: + self.tools['font_family'].child.set_active(self.families.index( + font_family)) self.start_tags = {} self.end_tags = {} # Connect events