[Poppler-bugs] [Bug 107057] [Patch] Skip XRef gaps in PDFDoc save methods

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jun 29 14:50:40 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=107057

--- Comment #8 from Tobias Deiminger <haxtibal at posteo.de> ---
(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?

I'm traveling right now, will come back to that on Monday.

-- 
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/20180629/7436fc50/attachment.html>


More information about the Poppler-bugs mailing list