changeset f010341e7ca5 in tryton:default
details: https://hg.tryton.org/tryton?cmd=changeset;node=f010341e7ca5
description:
Do not detect or set style if there no toolbar
If the richtext widget has no toolbar, it does not need to detect the
style and
neither set style.
Those callback's failed any way because tag_widgets is not filled.
issue9048
review274841004
diffstat:
tryton/gui/window/view_form/view/form_gtk/richtextbox.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diffs (21 lines):
diff -r 005a8691c81d -r f010341e7ca5
tryton/gui/window/view_form/view/form_gtk/richtextbox.py
--- a/tryton/gui/window/view_form/view/form_gtk/richtextbox.py Sat Feb 15
01:38:31 2020 +0100
+++ b/tryton/gui/window/view_form/view/form_gtk/richtextbox.py Mon Feb 17
23:17:39 2020 +0100
@@ -179,6 +179,8 @@
self.toolbar.set_sensitive(not value)
def detect_style(self, textview, *args):
+ if not self.toolbar:
+ return
tag_widgets = self.tag_widgets[textview]
text_buffer = textview.get_buffer()
try:
@@ -269,6 +271,8 @@
toggle_justification(justifications, True)
def insert_text_style(self, text_buffer, iter_, text, length, textview):
+ if not self.toolbar:
+ return
# Text is already inserted so iter_ point to the end
start = iter_.copy()
start.backward_chars(length)