'Fill in the correct values for all filepos="..." links with the offsets
of the linked to content (as stored in id_offsets).'

def fixup_links(self):

    buf = self.buf
    id_offsets = self.id_offsets
    start_href = getattr(self, u'_start_href', None)
    for (href, hoffs) in self.href_offsets.items():
        is_start = (href and (href == start_href))
        if (href not in id_offsets):
            self.logger.warn((u'Hyperlink    target    %r    not    found' % href))
            (href, _) = urldefrag(href)
        if (href in self.id_offsets):
            ioff = self.id_offsets[href]
            if is_start:
                self.start_offset = ioff
            for hoff in hoffs:
                buf.seek(hoff)
                buf.write(('%010d' % ioff))
