Implement swapBackingFile for the PDF backend

Authored by aacid on Oct 26 2017, 7:47 AM.

Description

Implement swapBackingFile for the PDF backend

How does it work:

  • What it does is really closing and opening the file again through poppler
  • This means that things that are generated in "open" time like Page, Rects, Annotations, Forms need to be updated
  • For Page what we do is swap the PagePrivate so that other classes that hold Page* don't break
    • Since some parts of the PagePrivate can be reused, we move them in PagePrivate::adoptGeneratedContents
  • For all the commands in the undo stack we need to update the annotations/forms it refers to, added a new function to do that
  • The annotationmodel needs updating it's pointers
  • The widgets for the forms are reused and their form* updated
  • the widgets for the videos are recreased since videos don't really hold much content (you lose the playing status on save but i think that's acceptable)

TODO: Make this work for .okular files
TODO: For files with password we will need to reload the file, asking for the password again and thus losing the undo stack, warn the user
TODO: autotests

Details

Committed
aacidOct 26 2017, 1:30 PM
Parents
R223:423dd010e0c9: Remove m_formButtons
Branches
Unknown
Tags
Unknown