9335: Gramps has experienced an unexpected error

This commit is contained in:
Josip 2016-03-28 14:53:17 -07:00 committed by Paul Franklin
parent cfeb97a524
commit 8a283ff376
2 changed files with 6 additions and 0 deletions

View File

@ -597,6 +597,8 @@ class GuiGramplet(object):
int(event.x), int(event.x),
int(event.y)) int(event.y))
iter = view.get_iter_at_location(*buffer_location) iter = view.get_iter_at_location(*buffer_location)
if isinstance(iter, tuple):
iter = iter[1]
cursor = self.standard_cursor cursor = self.standard_cursor
ttip = None ttip = None
for (tag, link_type, handle, tooltip) in self._tags: for (tag, link_type, handle, tooltip) in self._tags:
@ -619,6 +621,8 @@ class GuiGramplet(object):
int(event.x), int(event.x),
int(event.y)) int(event.y))
iter = view.get_iter_at_location(*buffer_location) iter = view.get_iter_at_location(*buffer_location)
if isinstance(iter, tuple):
iter = iter[1]
for (tag, link_type, handle, tooltip) in self._tags: for (tag, link_type, handle, tooltip) in self._tags:
if iter.has_tag(tag): if iter.has_tag(tag):
if link_type == 'Person': if link_type == 'Person':

View File

@ -286,6 +286,8 @@ class StyledTextEditor(Gtk.TextView):
x, y = self.window_to_buffer_coords(Gtk.TextWindowType.WIDGET, x, y = self.window_to_buffer_coords(Gtk.TextWindowType.WIDGET,
int(event.x), int(event.y)) int(event.x), int(event.y))
iter_at_location = self.get_iter_at_location(x, y) iter_at_location = self.get_iter_at_location(x, y)
if isinstance(iter_at_location, tuple):
iter_at_location = iter_at_location[1]
self.match = self.textbuffer.match_check(iter_at_location.get_offset()) self.match = self.textbuffer.match_check(iter_at_location.get_offset())
tooltip = None tooltip = None
if not self.match: if not self.match: