D14752: Fix links being "lost" on save

Tobias Deiminger noreply at phabricator.kde.org
Mon Aug 13 08:28:58 BST 2018


tobiasdeiminger added inline comments.

INLINE COMMENTS

> generator_pdf.cpp:653
>  
> +    if (oldRectsGenerated.count() == rectsGenerated.count()) {
> +        for (int i = 0; i < oldRectsGenerated.count(); ++i) {

Guess this is the same sanity check as in document.cpp, Document::swapBackingFile, probably meaning "is it still the same document?". Could there be situations where old page count != new page count? Or where page count is equal, but content is completely different?

> generator_pdf.cpp:655-661
> +            if (oldRectsGenerated[i]) {
> +                Okular::Page *page = newPagesVector[i];
> +                Poppler::Page *pp = pdfdoc->page( i );
> +                page->setObjectRects(generateLinks(pp->links()));
> +                rectsGenerated[i] = true;
> +                resolveMediaLinkReferences(page);
> +            }

This adds a few lines of redundant code and minor special handling (wrt PDFGenerator::image). But I shouldn't complain, don't know how to do it better.

REPOSITORY
  R223 Okular

REVISION DETAIL
  https://phabricator.kde.org/D14752

To: aacid
Cc: tobiasdeiminger, sander, okular-devel, ngraham, aacid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20180813/f9c3e22e/attachment.html>


More information about the Okular-devel mailing list