[Poppler-bugs] [Bug 107057] [Patch] Skip XRef gaps in PDFDoc save methods
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Tue Jul 3 22:55:36 UTC 2018
https://bugs.freedesktop.org/show_bug.cgi?id=107057
--- Comment #9 from Albert Astals Cid <aacid at kde.org> ---
(In reply to Tobias Deiminger from comment #8)
> (In reply to Albert Astals Cid from comment #7)
> > Took me a while to realize the problem was getEntry tries to reconstruct on
> > the none entries (because i didn't read the comment before reading the
> > patch).
> >
> > I was wondering if changig getEntry would be easier for the next people that
> > read the code next time?
> >
> > i.e. a new bool (or changing the bool to a flag) to tell getEntry to don't
> > try to reconstruct?
> >
> > enum GetEntryFlags
> > {
> > None,
> > DoNotComplainIfMissing
> > DoNotTryToRecoverIfNone
> > }
> >
> > XRefEntry *getEntry(int i, GetEntryFlags flags = None);
> >
> > then the code in saveXXX would be xref->getEntry(i, DoNotTryToRecoverIfNone)
> > which may be easier to understand for third party readers?
>
> That's an interesting idea. What I woukd tell getEntry then (perhaps
> implicitly) is: "don't recover if none, but yes do recover if offset is
> wrong and yes do recover if...<other reasons>". Is this still understandable
> for third parties?
No, on save you always use DoNotTryToRecoverIfNone, it's what you're doing with
your patch code, no?
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20180703/9851e7a3/attachment.html>
More information about the Poppler-bugs
mailing list