From e84ccb92db970cb41b616646a375cb860fa04d8e Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Sat, 5 Jan 2013 11:19:14 +0000 Subject: [PATCH] 6277: Out of index when creating textreort with PDF format svn: r20994 --- gramps/plugins/lib/libcairodoc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gramps/plugins/lib/libcairodoc.py b/gramps/plugins/lib/libcairodoc.py index b7ee42bd2..4e53d353e 100644 --- a/gramps/plugins/lib/libcairodoc.py +++ b/gramps/plugins/lib/libcairodoc.py @@ -651,6 +651,7 @@ class GtkDocParagraph(GtkDocBaseElement): pos = 0 realpos = 0 markstarts = [] + #index is in bytecode in the text.. !! while pos < index: char = oldtext[realpos] if char == '<' and oldtext[realpos+1] != '/': @@ -663,7 +664,7 @@ class GtkDocParagraph(GtkDocBaseElement): realpos = realpos + oldtext[realpos:].find('>') + 1 markstarts.pop() else: - pos +=1 + pos += len(char.encode('utf-8')) realpos += 1 #now construct the marked up text to use newtext = ''.join(markstarts)