DOCX Input: Ignore the hidden bookmark Word 2010 inserts to enable the go to last edit feature. Fixes #1552972 [DOCX Conversion - gitch](https://bugs.launchpad.net/calibre/+bug/1552972)

This commit is contained in:
Kovid Goyal 2016-03-04 20:01:32 +05:30
parent 97734c5039
commit 5d404dd5ab

View File

@ -433,7 +433,9 @@ class Convert(object):
self.layers[p].append(x) self.layers[p].append(x)
elif x.tag.endswith('}bookmarkStart'): elif x.tag.endswith('}bookmarkStart'):
anchor = self.namespace.get(x, 'w:name') anchor = self.namespace.get(x, 'w:name')
if anchor and anchor not in self.anchor_map: if anchor and anchor not in self.anchor_map and anchor != '_GoBack':
# _GoBack is a special bookmark inserted by Word 2010 for
# the return to previous edit feature, we ignore it
old_anchor = current_anchor old_anchor = current_anchor
self.anchor_map[anchor] = current_anchor = generate_anchor(anchor, frozenset(self.anchor_map.itervalues())) self.anchor_map[anchor] = current_anchor = generate_anchor(anchor, frozenset(self.anchor_map.itervalues()))
if old_anchor is not None: if old_anchor is not None: